]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-null.c
We no longer use "packetp" for anything, so eliminate it. (If any
[tcpdump] / print-null.c
index a602bc3a511cfde4886733ed1ccc050100bb7447..cdbb3734bcd02428a9251a29dbba0e8158785319 100644 (file)
 
 #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 <sys/param.h>
-#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-
-struct mbuf;
-struct rtentry;
-
-#include <netinet/in.h>
+#include <tcpdump-stdinc.h>
 
 #include <pcap.h>
 #include <stdio.h>
@@ -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);
 }