aboutsummaryrefslogtreecommitdiffstats
path: root/nametoaddr.c
diff options
context:
space:
mode:
authorguy <guy>2002-04-09 07:41:19 +0000
committerguy <guy>2002-04-09 07:41:19 +0000
commit55dba26a626d8c1367616af8f643afc6cb98a367 (patch)
tree3f3f97e2efd83dda393023fef4536693c95b22bf /nametoaddr.c
parent9328cdfd194ab5d0ff252a1cba7d4782d5f3900a (diff)
Indicate why we have incomplete definitions for "struct mbuf" and
"struct rtentry" (in <net/if.h> on some systems, e.g. Digital UNIX 4.0, there are prototypes for kernel functions that include "struct mbuf *" and "struct rtentry *" arguments, and they are included even if you're just user-mode code). We don't need to include <netinet/if_ether.h> unless we have "ether_hostton()", and we don't need to include <net/if.h> unless we're including <netinet/if_ether.h>, and we don't need to define "struct mbuf" or "struct rtentry" unless we're including <net/if.h>.
Diffstat (limited to 'nametoaddr.c')
-rw-r--r--nametoaddr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/nametoaddr.c b/nametoaddr.c
index 32b394d..d699c87 100644
--- a/nametoaddr.c
+++ b/nametoaddr.c
@@ -24,7 +24,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.62 2002-04-07 00:22:30 guy Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/nametoaddr.c,v 1.63 2002-04-09 07:41:19 guy Exp $ (LBL)";
#endif
#ifdef HAVE_CONFIG_H
@@ -36,13 +36,15 @@ static const char rcsid[] =
#include <sys/socket.h>
#include <sys/time.h>
-struct mbuf;
-struct rtentry;
-#include <net/if.h>
#include <netinet/in.h>
+#ifdef HAVE_ETHER_HOSTTON
#ifdef HAVE_NETINET_IF_ETHER_H
+struct mbuf; /* Squelch compiler warnings on some platforms for */
+struct rtentry; /* declarations in <net/if.h> */
+#include <net/if.h> /* for "struct ifnet" in "struct arpcom" on Solaris */
#include <netinet/if_ether.h>
-#endif
+#endif /* HAVE_NETINET_IF_ETHER_H */
+#endif /* HAVE_ETHER_HOSTTON */
#include <arpa/inet.h>
#include <netdb.h>