aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/inet_ipv4.h
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2017-11-08 14:02:08 +0000
committerJoão Valverde <j@v6e.pt>2017-11-09 16:08:25 +0000
commit39967011836c1e23dff188ffaadb747d9dcda062 (patch)
tree768e37aa23b5ad8775a47543ce26f1fdb3f3269d /wsutil/inet_ipv4.h
parent2ebc41050e43c508edbc8c0fa8cccb9797c463cf (diff)
Replace inet_addr() with our inet_pton() wrapper
Error checking omitted like in original code. Change-Id: If8b4181d30ddf5717951aaf7ec61db25c0bc5322 Reviewed-on: https://code.wireshark.org/review/24309 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'wsutil/inet_ipv4.h')
-rw-r--r--wsutil/inet_ipv4.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/wsutil/inet_ipv4.h b/wsutil/inet_ipv4.h
index 9c1094f5af..f86ac6d933 100644
--- a/wsutil/inet_ipv4.h
+++ b/wsutil/inet_ipv4.h
@@ -26,6 +26,12 @@
typedef guint32 ws_in4_addr; /* 32 bit IPv4 address, in network byte order */
+/*
+ * We define these in *network byte order*, unlike the C library. Therefore
+ * it uses a different prefix than INADDR_* to make the distinction more obvious.
+ */
+#define WS_IN4_LOOPBACK ((ws_in4_addr)GUINT32_TO_BE(0x7f000001))
+
/**
* Unicast Local
* Returns true if the address is in the 224.0.0.0/24 local network