diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-26 21:26:05 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-26 21:26:05 +0000 |
commit | 374c1e979f0206f50dc2afd026289d502ce49e30 (patch) | |
tree | db1c1b9f0fc132eca2a8db8b14e5d8e902e610c2 /src/common/address.h | |
parent | 616f6643ef9c6222418a4e75e84691c8ed9507f9 (diff) | |
download | tor-374c1e979f0206f50dc2afd026289d502ce49e30.tar.gz tor-374c1e979f0206f50dc2afd026289d502ce49e30.zip |
Refactor tor_addr_t manipulation functions so that as few as possible look at the tor_addr_t representation.
svn:r17790
Diffstat (limited to 'src/common/address.h')
-rw-r--r-- | src/common/address.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/address.h b/src/common/address.h index 0bc7674913..689d566ed5 100644 --- a/src/common/address.h +++ b/src/common/address.h @@ -157,6 +157,8 @@ void tor_addr_from_ipv4n(tor_addr_t *dest, uint32_t v4addr); #define tor_addr_from_ipv4h(dest, v4addr) \ tor_addr_from_ipv4n((dest), htonl(v4addr)) void tor_addr_from_ipv6_bytes(tor_addr_t *dest, const char *bytes); +#define tor_addr_from_in(dest, in) \ + tor_addr_from_ipv4n((dest), (in)->s_addr); void tor_addr_from_in6(tor_addr_t *dest, const struct in6_addr *in6); int tor_addr_is_null(const tor_addr_t *addr); int tor_addr_is_loopback(const tor_addr_t *addr); |