]> The Tcpdump Group git mirrors - libpcap/commitdiff
Indicate why we have incomplete definitions for "struct mbuf" and
authorguy <guy>
Tue, 9 Apr 2002 07:41:19 +0000 (07:41 +0000)
committerguy <guy>
Tue, 9 Apr 2002 07:41:19 +0000 (07:41 +0000)
"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>.

nametoaddr.c

index 32b394d36dbf26a9de27ab7ca1e922d890e73eda..d699c87f263e7a2c72a76f3640599ba0d73f537d 100644 (file)
@@ -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>