From 6831542ec753e8d13d7de2f383aebcc2df8b5a98 Mon Sep 17 00:00:00 2001 From: risso Date: Thu, 1 Aug 2002 08:33:01 +0000 Subject: Added support for Win32, based on WinPcap. --- nametoaddr.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'nametoaddr.c') diff --git a/nametoaddr.c b/nametoaddr.c index c4b7b65..b220f8b 100644 --- a/nametoaddr.c +++ b/nametoaddr.c @@ -24,19 +24,19 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.64 2002-06-11 17:04:45 itojun Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.65 2002-08-01 08:33:03 risso Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include /* concession to AIX */ -#include -#include +#include + +#ifdef __MINGW32__ +#include "IP6_misc.h" +#endif -#include #ifdef HAVE_ETHER_HOSTTON #ifdef HAVE_NETINET_IF_ETHER_H struct mbuf; /* Squelch compiler warnings on some platforms for */ @@ -45,8 +45,6 @@ struct rtentry; /* declarations in */ #include #endif /* HAVE_NETINET_IF_ETHER_H */ #endif /* HAVE_ETHER_HOSTTON */ -#include -#include #include #include @@ -123,12 +121,19 @@ pcap_nametoaddrinfo(const char *name) bpf_u_int32 pcap_nametonetaddr(const char *name) { +#ifndef WIN32 struct netent *np; if ((np = getnetbyname(name)) != NULL) return np->n_net; else return 0; +#else + /* + * There's no "getnetbyname()" on Windows. + */ + return 0; +#endif } /* -- cgit v1.2.3