X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/aa22569a90e6228e33590a16be7e545a46928fd7..e070cf232ffadbdbbca68b132ef369675890e566:/print-null.c diff --git a/print-null.c b/print-null.c index a602bc3a..cdbb3734 100644 --- a/print-null.c +++ b/print-null.c @@ -21,23 +21,14 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.40 2000-12-16 22:00:50 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.45 2002-12-18 08:53:22 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include -#include -#include -#include -#include - -struct mbuf; -struct rtentry; - -#include +#include #include #include @@ -106,13 +97,14 @@ null_print(u_int family, u_int length) ((((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) +null_if_print(u_char *user _U_, 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)); @@ -129,11 +121,10 @@ null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) 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. + * Some printers want to check that they're not walking off the + * end of the packet. + * Rather than pass it all the way down, we set this global. */ - packetp = p; snapend = p + caplen; length -= NULL_HDRLEN; @@ -160,5 +151,8 @@ null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p) if (xflag) default_print((const u_char *)ip, caplen - NULL_HDRLEN); putchar('\n'); + --infodelay; + if (infoprint) + info(0); }