diff options
author | teor <teor@torproject.org> | 2020-04-15 09:52:57 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2020-04-29 22:43:09 +1000 |
commit | a72e017e7f69581ceb005d05ce8033a6fd05626e (patch) | |
tree | 6308dc41fa1b22cb2d019ea55380c73d9d3af10a /src/lib/net/address.h | |
parent | e9d04b05c6ba3930d55dc6c7e512e082ff67ebfb (diff) | |
download | tor-a72e017e7f69581ceb005d05ce8033a6fd05626e.tar.gz tor-a72e017e7f69581ceb005d05ce8033a6fd05626e.zip |
net: Add fmt_addrport_ap() and fmt_addr_family()
Add fmt_addrport_ap(), a macro that takes a tor_addr_port_t, and uses
it to call fmt_addrport().
Add fmt_addr_family(), a function that returns a string constant
describing the address family.
Utility functions for 33817.
Diffstat (limited to 'src/lib/net/address.h')
-rw-r--r-- | src/lib/net/address.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/net/address.h b/src/lib/net/address.h index 186f1fe86a..611d1ca1ee 100644 --- a/src/lib/net/address.h +++ b/src/lib/net/address.h @@ -221,7 +221,9 @@ char *tor_addr_to_str_dup(const tor_addr_t *addr) ATTR_MALLOC; const char *fmt_addr_impl(const tor_addr_t *addr, int decorate); const char *fmt_addrport(const tor_addr_t *addr, uint16_t port); +#define fmt_addrport_ap(ap) fmt_addrport(&(ap)->addr, (ap)->port) const char *fmt_addr32(uint32_t addr); +const char *fmt_addr_family(const tor_addr_t *addr); MOCK_DECL(int,get_interface_address6,(int severity, sa_family_t family, tor_addr_t *addr)); |