]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-null.c
From: Juergen Schoenwaelder <[email protected]>
[tcpdump] / print-null.c
index bb7a1fd4ef12dcf0070e37fa9f6cac589746dece..26a343ac2c21631fa76fb9c6385f74e26f9871ec 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.24 1999-10-07 23:47:12 mcr Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.29 1999-11-21 12:38:24 itojun Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
 #endif
 
 #include <sys/param.h>
@@ -44,12 +48,15 @@ struct rtentry;
 #include <netinet/udp.h>
 #include <netinet/udp_var.h>
 #include <netinet/tcp.h>
-#include <netinet/tcpip.h>
 
 #include <pcap.h>
 #include <stdio.h>
 #include <string.h>
 
+#ifdef INET6
+#include <netinet/ip6.h>
+#endif
+
 #include "interface.h"
 #include "addrtoname.h"
 
@@ -80,6 +87,12 @@ null_print(const u_char *p, const struct ip *ip, u_int length)
                printf("ip: ");
                break;
 
+#ifdef INET6
+       case AF_INET6:
+               printf("ip6: ");
+               break;
+#endif
+
        case AF_NS:
                printf("ns: ");
                break;
@@ -114,7 +127,19 @@ null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
        if (eflag)
                null_print(p, ip, length);
 
-       ip_print((const u_char *)ip, length);
+       switch (ip->ip_v) {
+       case 4 :
+               ip_print((const void *)ip, length);
+               break;
+#ifdef INET6
+       case 6:
+               ip6_print((const void *)ip, length);
+               break;
+#endif /* INET6 */
+       default :
+               printf("ip v%d", ip->ip_v);
+               break;
+       }
 
        if (xflag)
                default_print((const u_char *)ip, caplen - NULL_HDRLEN);