X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/f6fa6a40d4156cdf5dea882024beb7b10d2412f1..c0c93f3a653f3aa56631c3bf6ee60772ec417e5e:/print-null.c diff --git a/print-null.c b/print-null.c index 13035720..26a343ac 100644 --- a/print-null.c +++ b/print-null.c @@ -21,7 +21,11 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.25 1999-10-17 21:37:14 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 @@ -40,13 +44,19 @@ struct rtentry; #include #include #include +#include #include +#include #include #include #include #include +#ifdef INET6 +#include +#endif + #include "interface.h" #include "addrtoname.h" @@ -77,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; @@ -111,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);