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 --- capchild/capture_ifinfo.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'capchild/capture_ifinfo.c') diff --git a/capchild/capture_ifinfo.c b/capchild/capture_ifinfo.c index b6bef3cf1e..3753ee2684 100644 --- a/capchild/capture_ifinfo.c +++ b/capchild/capture_ifinfo.c @@ -28,22 +28,6 @@ #include #include -#ifdef HAVE_ARPA_INET_H -#include -#endif - -#ifdef HAVE_SYS_SOCKET_H -#include /* needed to define AF_ values on UNIX */ -#endif - -#ifdef HAVE_WINSOCK2_H -#include /* needed to define AF_ values on Windows */ -#endif - -#ifdef NEED_INET_V6DEFS_H -# include "wsutil/inet_v6defs.h" -#endif - #include #include "capture_opts.h" @@ -56,6 +40,7 @@ #include "log.h" #include +#include #ifdef HAVE_PCAP_REMOTE static GList *remote_interface_list = NULL; @@ -187,10 +172,9 @@ capture_interface_list(int *err, char **err_str, void (*update_cb)(void)) addr_parts = g_strsplit(if_parts[4], ",", 0); for (j = 0; addr_parts[j] != NULL; j++) { if_addr = g_new0(if_addr_t,1); - if (inet_pton(AF_INET, addr_parts[j], &if_addr->addr.ip4_addr) > 0) { + if (ws_inet_pton4(addr_parts[j], &if_addr->addr.ip4_addr)) { if_addr->ifat_type = IF_AT_IPv4; - } else if (inet_pton(AF_INET6, addr_parts[j], - &if_addr->addr.ip6_addr) > 0) { + } else if (ws_inet_pton6(addr_parts[j], (struct e_in6_addr *)&if_addr->addr.ip6_addr)) { if_addr->ifat_type = IF_AT_IPv6; } else { g_free(if_addr); -- cgit v1.2.3