path: root/nametoaddr.c
diff options
authorguy <guy>2002-08-02 03:44:19 +0000
committerguy <guy>2002-08-02 03:44:19 +0000
commit309e3868706ee5115eefbc2ddf7e35bb9651dad6 (patch)
tree16414555c0f45ccb091efad9f37de3a92804fc3d /nametoaddr.c
parent3073e4c400921ff0f4521ab199bcb8c51a582cf3 (diff)
Use <pcap-stdinc.h> only on Windows; on UNIX, selectively include, in
each source file, only the headers that file needs, and all the headers it needs in order to compile on various platforms and not to get any avoidable compiler warnings on those platforms (as well as any incomplete structure definitions needed to avoid those warnings). That also means that <pcap.h> doesn't include <pcap-stdinc.h> on UNIX; we don't want it to include <pcap-stdinc.h>, at least on UNIX, as doing so 1) would mean we'd have to install that, so that programs can build with libpcap and 2) would mean that programs including <pcap.h> would drag in a bunch of header files that they don't need. Put a newline at the end of "inet.c" - the Sun C compiler doesn't like it if the last line doesn't end with a newline.
Diffstat (limited to 'nametoaddr.c')
1 files changed, 12 insertions, 1 deletions
diff --git a/nametoaddr.c b/nametoaddr.c
index b220f8b..6128666 100644
--- a/nametoaddr.c
+++ b/nametoaddr.c
@@ -24,19 +24,27 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.65 2002-08-01 08:33:03 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.66 2002-08-02 03:44:20 guy Exp $ (LBL)";
#include "config.h"
+#ifdef WIN32
#include <pcap-stdinc.h>
#ifdef __MINGW32__
#include "IP6_misc.h"
+#else /* WIN32 */
+#include <sys/param.h>
+#include <sys/types.h> /* concession to AIX */
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <netinet/in.h>
struct mbuf; /* Squelch compiler warnings on some platforms for */
@@ -45,6 +53,9 @@ struct rtentry; /* declarations in <net/if.h> */
#include <netinet/if_ether.h>
+#include <arpa/inet.h>
+#include <netdb.h>
+#endif /* WIN32 */
#include <ctype.h>
#include <errno.h>