From 8bee8bad813446bbf75428a8cdd756fe6063ca6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Wed, 10 Feb 2016 09:11:12 +0000 Subject: Add inet_pton/inet_ntop interface to libwsutil MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifc344ed33f2f7ca09a6912a5adb49dc35f07c81f Reviewed-on: https://code.wireshark.org/review/13881 Petri-Dish: João Valverde Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde --- epan/address_types.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'epan/address_types.c') 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 /* needed for on some platforms */ -#endif - -#ifdef HAVE_ARPA_INET_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include /* needed to define AF_ values on UNIX */ -#endif - #include /* 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 @@ -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) */ -- cgit v1.2.1