mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Add a convenience function to check for unspec address.
This commit is contained in:
parent
1e97f96888
commit
cca3164f8d
@ -95,6 +95,7 @@ static inline uint32_t tor_addr_to_ipv4n(const tor_addr_t *a);
|
||||
static inline uint32_t tor_addr_to_ipv4h(const tor_addr_t *a);
|
||||
static inline uint32_t tor_addr_to_mapped_ipv4h(const tor_addr_t *a);
|
||||
static inline sa_family_t tor_addr_family(const tor_addr_t *a);
|
||||
static inline bool tor_addr_is_unspec(const tor_addr_t *a);
|
||||
static inline const struct in_addr *tor_addr_to_in(const tor_addr_t *a);
|
||||
static inline int tor_addr_eq_ipv4h(const tor_addr_t *a, uint32_t u);
|
||||
|
||||
@ -188,6 +189,15 @@ tor_addr_family(const tor_addr_t *a)
|
||||
return a->family;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if the address @a is in the UNSPEC family.
|
||||
**/
|
||||
static inline bool
|
||||
tor_addr_is_unspec(const tor_addr_t *a)
|
||||
{
|
||||
return a->family == AF_UNSPEC;
|
||||
}
|
||||
|
||||
/** Return an in_addr* equivalent to <b>a</b>, or NULL if <b>a</b> is not
|
||||
* an IPv4 address. */
|
||||
static inline const struct in_addr *
|
||||
|
Loading…
Reference in New Issue
Block a user