summaryrefslogtreecommitdiffstats
path: root/contrib/tcpdump/print-null.c
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2000-01-30 01:05:24 +0000
committerfenner <fenner@FreeBSD.org>2000-01-30 01:05:24 +0000
commitc780ea93f313e481b5e76344d0c206cf1568e727 (patch)
treecd7ad03c67eea60f72e32cf23a00c051002101b6 /contrib/tcpdump/print-null.c
parent107d567bf3f832610112e1377af645f8f827e1dd (diff)
downloadFreeBSD-src-c780ea93f313e481b5e76344d0c206cf1568e727.zip
FreeBSD-src-c780ea93f313e481b5e76344d0c206cf1568e727.tar.gz
Merge tcpdump 3.5
Diffstat (limited to 'contrib/tcpdump/print-null.c')
-rw-r--r--contrib/tcpdump/print-null.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/contrib/tcpdump/print-null.c b/contrib/tcpdump/print-null.c
index f1469ab..64c7df3 100644
--- a/contrib/tcpdump/print-null.c
+++ b/contrib/tcpdump/print-null.c
@@ -17,11 +17,17 @@
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * $FreeBSD$
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: print-null.c,v 1.24 97/05/28 12:52:47 leres Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.30 1999/12/22 06:27:21 itojun Exp $ (LBL)";
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
#endif
#include <sys/param.h>
@@ -44,12 +50,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 +89,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 +129,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 u_char *)ip, length);
+ break;
+#ifdef INET6
+ case 6:
+ ip6_print((const u_char *)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);
OpenPOWER on IntegriCloud