diff options
author | teor <teor@torproject.org> | 2020-04-30 22:22:09 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2020-04-30 22:22:09 +1000 |
commit | 6dc9930d3a14c30af0f285a884476f33a782938c (patch) | |
tree | cdfc6e78095427a32ae830c58d53b73da4506822 /src/lib/net/address.h | |
parent | efcae919aea4611d9f4ec5815170c48fc67134cf (diff) | |
parent | 7bf257b1297d146047d10e0d527b45a88abf892a (diff) | |
download | tor-6dc9930d3a14c30af0f285a884476f33a782938c.tar.gz tor-6dc9930d3a14c30af0f285a884476f33a782938c.zip |
Merge branch 'pr1870_squashed'
Diffstat (limited to 'src/lib/net/address.h')
-rw-r--r-- | src/lib/net/address.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/net/address.h b/src/lib/net/address.h index b5754087cc..e5016ee4fe 100644 --- a/src/lib/net/address.h +++ b/src/lib/net/address.h @@ -213,6 +213,15 @@ tor_addr_eq_ipv4h(const tor_addr_t *a, uint32_t u) */ #define TOR_ADDR_BUF_LEN 48 +/** Length of a buffer containing an IP address along with a port number and + * a seperating colon. + * + * This allows enough space for + * "[ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255]:12345", + * plus a terminating NUL. + */ +#define TOR_ADDRPORT_BUF_LEN (TOR_ADDR_BUF_LEN + 6) + char *tor_addr_to_str_dup(const tor_addr_t *addr) ATTR_MALLOC; /** Wrapper function of fmt_addr_impl(). It does not decorate IPv6 |