summaryrefslogtreecommitdiff
path: root/lib/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/net.c')
-rw-r--r--lib/net.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/net.c b/lib/net.c
index 56eb16fd..b851871a 100644
--- a/lib/net.c
+++ b/lib/net.c
@@ -18,6 +18,13 @@ const u8 net_max_prefix_length[] = {
[NET_VPN6] = IP4_MAX_PREFIX_LENGTH
};
+const u16 net_max_text_length[] = {
+ [NET_IP4] = 18, /* "255.255.255.255/32" */
+ [NET_IP6] = 43, /* "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" */
+ [NET_VPN4] = 40, /* "4294967296:4294967296 255.255.255.255/32" */
+ [NET_VPN6] = 65, /* "4294967296:4294967296 ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128" */
+};
+
int
net_format(const net_addr *N, char *buf, int buflen)