mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-11 05:33:47 +01:00
Add a function to set a tor_addr_t to a null address
This commit is contained in:
parent
cac5335195
commit
898f9c8bcc
@ -181,6 +181,14 @@ tor_addr_make_unspec(tor_addr_t *a)
|
||||
a->family = AF_UNSPEC;
|
||||
}
|
||||
|
||||
/** DOCDOC */
|
||||
void
|
||||
tor_addr_make_null(tor_addr_t *a, sa_family_t family)
|
||||
{
|
||||
memset(a, 0, sizeof(*a));
|
||||
a->family = family;
|
||||
}
|
||||
|
||||
/** Similar behavior to Unix gethostbyname: resolve <b>name</b>, and set
|
||||
* *<b>addr</b> to the proper IP address and family. The <b>family</b>
|
||||
* argument (which must be AF_INET, AF_INET6, or AF_UNSPEC) declares a
|
||||
|
@ -55,6 +55,7 @@ socklen_t tor_addr_to_sockaddr(const tor_addr_t *a, uint16_t port,
|
||||
int tor_addr_from_sockaddr(tor_addr_t *a, const struct sockaddr *sa,
|
||||
uint16_t *port_out);
|
||||
void tor_addr_make_unspec(tor_addr_t *a);
|
||||
void tor_addr_make_null(tor_addr_t *a, sa_family_t family);
|
||||
char *tor_sockaddr_to_str(const struct sockaddr *sa);
|
||||
|
||||
/** Return an in6_addr* equivalent to <b>a</b>, or NULL if <b>a</b> is not
|
||||
|
Loading…
Reference in New Issue
Block a user