Skip to content

Commit 8b49055

Browse files
committed
net: ip: Add max IPv6 address length define
Define max length of the IPv6 address as a string without IPv4 mapping. Useful if you have to print IPv6 address string that will never contain IPv4 mapping address. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent da22e6d commit 8b49055

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/zephyr/net/net_ip.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,9 @@ extern const struct in6_addr in6addr_loopback;
482482
#define NET_IPV6_ADDR_LEN sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxx.xxx.xxx.xxx")
483483
#define NET_IPV4_ADDR_LEN sizeof("xxx.xxx.xxx.xxx")
484484

485+
/* Max length of the IPv6 address as a string without IPv4 mapping */
486+
#define NET_IPV6_ADDR_STR_LEN sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
487+
485488
/** @endcond */
486489

487490
/** @brief IP Maximum Transfer Unit */

0 commit comments

Comments
 (0)