X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/3d932490b826facb568937a1290910a1265267f5..bcd506b0a6b27f66b5f44f6dbc623cb6ccec8784:/print-null.c diff --git a/print-null.c b/print-null.c index 821a447d..6b7ffe7b 100644 --- a/print-null.c +++ b/print-null.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.43 2002-08-01 08:53:22 risso Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.47 2002-12-19 09:39:13 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -96,17 +96,13 @@ null_print(u_int family, u_int length) #define SWAPLONG(y) \ ((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff)) -void -null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) +u_int +null_if_print(const struct pcap_pkthdr *h, const u_char *p) { u_int length = h->len; - u_int caplen = h->caplen; const struct ip *ip; u_int family; - ++infodelay; - ts_print(&h->ts); - memcpy((char *)&family, (char *)p, sizeof(family)); /* @@ -120,14 +116,6 @@ null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) if ((family & 0xFFFF0000) != 0) family = SWAPLONG(family); - /* - * Some printers want to get back at the link level addresses, - * and/or check that they're not walking off the end of the packet. - * Rather than pass them all the way down, we set these globals. - */ - packetp = p; - snapend = p + caplen; - length -= NULL_HDRLEN; ip = (struct ip *)(p + NULL_HDRLEN); @@ -149,11 +137,6 @@ null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) break; } - if (xflag) - default_print((const u_char *)ip, caplen - NULL_HDRLEN); - putchar('\n'); - --infodelay; - if (infoprint) - info(0); + return (NULL_HDRLEN); }