mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
Merge branch 'tor-gitlab/mr/47'
This commit is contained in:
@@ -764,6 +764,15 @@ tor_addr_is_v4(const tor_addr_t *addr)
|
||||
return 0; /* Not IPv4 - unknown family or a full-blood IPv6 address */
|
||||
}
|
||||
|
||||
/** Determine whether an address <b>addr</b> is an IPv6 (AF_INET6). Return
|
||||
* true if so else false. */
|
||||
int
|
||||
tor_addr_is_v6(const tor_addr_t *addr)
|
||||
{
|
||||
tor_assert(addr);
|
||||
return (tor_addr_family(addr) == AF_INET6);
|
||||
}
|
||||
|
||||
/** Determine whether an address <b>addr</b> is null, either all zeroes or
|
||||
* belonging to family AF_UNSPEC.
|
||||
*/
|
||||
|
||||
@@ -284,6 +284,7 @@ struct sipkey;
|
||||
uint64_t tor_addr_keyed_hash(const struct sipkey *key, const tor_addr_t *addr);
|
||||
|
||||
int tor_addr_is_v4(const tor_addr_t *addr);
|
||||
int tor_addr_is_v6(const tor_addr_t *addr);
|
||||
int tor_addr_is_internal_(const tor_addr_t *ip, int for_listening,
|
||||
const char *filename, int lineno);
|
||||
#define tor_addr_is_internal(addr, for_listening) \
|
||||
|
||||
Reference in New Issue
Block a user