aboutsummaryrefslogtreecommitdiffstats
path: root/epan/address_types.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-02-10 09:11:12 +0000
committerJoão Valverde <j@v6e.pt>2016-02-19 15:55:09 +0000
commit8bee8bad813446bbf75428a8cdd756fe6063ca6f (patch)
treed6a335bcf1bf745c36fcefefab3356f6c1705a05 /epan/address_types.c
parent5fec8fa74619a69e3faeca01fd483157d39f7b13 (diff)
Add inet_pton/inet_ntop interface to libwsutil
Change-Id: Ifc344ed33f2f7ca09a6912a5adb49dc35f07c81f Reviewed-on: https://code.wireshark.org/review/13881 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'epan/address_types.c')
-rw-r--r--epan/address_types.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/epan/address_types.c b/epan/address_types.c
index e84be71ad6..f7da4deeeb 100644
--- a/epan/address_types.c
+++ b/epan/address_types.c
@@ -21,18 +21,6 @@
#include "config.h"
-#ifdef HAVE_NETINET_IN_H
-# include <netinet/in.h> /* needed for <arpa/inet.h> on some platforms */
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h> /* needed to define AF_ values on UNIX */
-#endif
-
#include <string.h> /* for memcmp */
#include "packet.h"
#include "address_types.h"
@@ -41,7 +29,7 @@
#include "addr_resolv.h"
#include "wsutil/pint.h"
#include "wsutil/str_util.h"
-#include "wsutil/inet_v6defs.h"
+#include "wsutil/inet_addr.h"
#include <epan/dissectors/packet-mtp3.h>
@@ -599,7 +587,7 @@ ib_addr_to_str( const address *addr, gchar *buf, int buf_len){
#define PREAMBLE_STR_LEN ((int)(sizeof("GID: ") - 1))
g_strlcpy(buf, "GID: ", buf_len);
if (buf_len < PREAMBLE_STR_LEN ||
- inet_ntop(AF_INET6, addr->data, buf + PREAMBLE_STR_LEN,
+ ws_inet_ntop6(addr->data, buf + PREAMBLE_STR_LEN,
buf_len - PREAMBLE_STR_LEN) == NULL ) /* Returns NULL if no space and does not touch buf */
g_strlcpy(buf, BUF_TOO_SMALL_ERR, buf_len); /* Let the unexpected value alert user */
} else { /* this is a LID (16 bits) */