summaryrefslogtreecommitdiff
path: root/lib/net.h
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2015-12-18 11:57:38 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2015-12-20 13:47:39 +0100
commit7fd4143eadd5af6e1ad7825d7d7506ad021bf1ad (patch)
treeb16f93737a5bda12b6677a5ad3f45cf5b1c13c30 /lib/net.h
parent9656dce72eead158e6da3ad560720bb0addfe7e2 (diff)
Integrated address print lengths
Minor changes by Ondrej Santiago Zajicek
Diffstat (limited to 'lib/net.h')
-rw-r--r--lib/net.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/net.h b/lib/net.h
index c9ca349f..ee9b382e 100644
--- a/lib/net.h
+++ b/lib/net.h
@@ -68,7 +68,11 @@ typedef union net_addr_union {
extern const u16 net_addr_length[];
-extern const u8 net_max_prefix_length[];
+extern const u8 net_max_prefix_length[];
+extern const u16 net_max_text_length[];
+
+#define NET_MAX_TEXT_LENGTH 65
+
#define NET_ADDR_IP4(prefix,pxlen) \
((net_addr_ip4) { NET_IP4, pxlen, sizeof(net_addr_ip4), prefix })
@@ -103,6 +107,7 @@ static inline void net_fill_ipa(net_addr *a, ip_addr prefix, uint pxlen)
net_fill_ip6(a, ipa_to_ip6(prefix), pxlen);
}
+
static inline ip4_addr net4_prefix(const net_addr *a)
{ return ((net_addr_ip4 *) a)->prefix; }
@@ -243,6 +248,3 @@ int net_in_netX(const net_addr *A, const net_addr *N);
#endif
-
-
-