net: Add INET_ADDRSTRLEN POSIX define
POSIX defines INET_ADDRSTRLEN and INET6_ADDRSTRLEN as max sizes of textual form of IP addresses (including terminating NUL): http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/netinet_in.h.html We already define INET6_ADDRSTRLEN, so it makes sense to define INET_ADDRSTRLEN too. Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This commit is contained in:
parent
4d375eef23
commit
5f8d24baca
1 changed files with 4 additions and 0 deletions
|
@ -179,7 +179,11 @@ struct net_addr {
|
|||
extern const struct in6_addr in6addr_any;
|
||||
extern const struct in6_addr in6addr_loopback;
|
||||
|
||||
/* Defined by POSIX. INET6_ADDRSTRLEN accounts for mapped IPv4 addresses. */
|
||||
#define INET_ADDRSTRLEN 16
|
||||
#define INET6_ADDRSTRLEN 46
|
||||
|
||||
/* These are for internal usage of the stack */
|
||||
#define NET_IPV6_ADDR_LEN sizeof("xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx")
|
||||
#define NET_IPV4_ADDR_LEN sizeof("xxx.xxx.xxx.xxx")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue