]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-null.c
Add a new routine "default_print_packet()", which takes a pointer to the
[tcpdump] / print-null.c
index 30724ec68305b7b9fbb7cdc49ad7cd83fb538c72..064408a05538f89927243656af3911bc66c51f18 100644 (file)
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.41 2001-07-05 18:54:15 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-null.c,v 1.46 2002-12-18 09:41:16 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,7 +97,7 @@ 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;
@@ -130,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;
@@ -159,7 +149,7 @@ 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);
+               default_print_packet(p, caplen, NULL_HDRLEN);
        putchar('\n');
        --infodelay;
        if (infoprint)