diff options
author | George Kadianakis <desnacked@riseup.net> | 2012-04-12 22:42:37 +0200 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2012-04-12 22:42:37 +0200 |
commit | 6d2898607bd831944c6c15b6e15200a426149811 (patch) | |
tree | e0b2baee164b62b85c89c24aefdfaddee37252ec /src/common/address.h | |
parent | b03f90b5383744593dc1e83fc5834c965573a4dc (diff) | |
download | tor-6d2898607bd831944c6c15b6e15200a426149811.tar.gz tor-6d2898607bd831944c6c15b6e15200a426149811.zip |
Fix issues found by nickm.
* Document fmt_addr_impl() and friends.
* Parenthesize macro arguments.
* Rename get_first_listener_addrport_for_pt() to
get_first_listener_addrport_string().
* Handle port_cfg_t with no_listen.
* Handle failure of router_get_active_listener_port_by_type().
* Add an XXX to router_get_active_listener_port_by_type().
Diffstat (limited to 'src/common/address.h')
-rw-r--r-- | src/common/address.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/address.h b/src/common/address.h index bdb14eb390..761eed661c 100644 --- a/src/common/address.h +++ b/src/common/address.h @@ -135,8 +135,13 @@ tor_addr_eq_ipv4h(const tor_addr_t *a, uint32_t u) int tor_addr_lookup(const char *name, uint16_t family, tor_addr_t *addr_out); char *tor_dup_addr(const tor_addr_t *addr) ATTR_MALLOC; -#define fmt_addr(a) fmt_addr_impl(a, 0) -#define fmt_and_decorate_addr(a) fmt_addr_impl(a, 1) + +/** Wrapper function of fmt_addr_impl(). It does not decorate IPv6 + * addresses. */ +#define fmt_addr(a) fmt_addr_impl((a), 0) +/** Wrapper function of fmt_addr_impl(). It decorates IPv6 + * addresses. */ +#define fmt_and_decorate_addr(a) fmt_addr_impl((a), 1) const char *fmt_addr_impl(const tor_addr_t *addr, int decorate); const char * fmt_addr32(uint32_t addr); int get_interface_address6(int severity, sa_family_t family, tor_addr_t *addr); |