]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-sll.c
Remove the -a flag. It's nonsensical to apply the local netmask to all
[tcpdump] / print-sll.c
index 2cd90f72ace1673f2f37230236bdcaac21c974bc..eaf7797893495779fe587088dc5377fdc45785c7 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.10 2002-12-18 08:53:24 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-sll.c,v 1.12 2002-12-19 09:39:16 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -92,8 +92,8 @@ sll_print(register const struct sll_header *sllp, u_int length)
  * 'h->length' is the length of the packet off the wire, and 'h->caplen'
  * is the number of bytes actually captured.
  */
-void
-sll_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
+u_int
+sll_if_print(const struct pcap_pkthdr *h, const u_char *p)
 {
        u_int caplen = h->caplen;
        u_int length = h->len;
@@ -101,9 +101,6 @@ sll_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
        u_short ether_type;
        u_short extracted_ethertype;
 
-       ++infodelay;
-       ts_print(&h->ts);
-
        if (caplen < SLL_HDR_LEN) {
                /*
                 * XXX - this "can't happen" because "pcap-linux.c" always
@@ -111,7 +108,7 @@ sll_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
                 * cooked socket capture.
                 */
                printf("[|sll]");
-               goto out;
+               return (caplen);
        }
 
        sllp = (const struct sll_header *)p;
@@ -120,12 +117,8 @@ sll_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
                sll_print(sllp, length);
 
        /*
-        * 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.
+        * Go past the cooked-mode header.
         */
-       snapend = p + caplen;
-
        length -= SLL_HDR_LEN;
        caplen -= SLL_HDR_LEN;
        p += SLL_HDR_LEN;
@@ -181,11 +174,6 @@ sll_if_print(u_char *user _U_, const struct pcap_pkthdr *h, const u_char *p)
                if (!xflag && !qflag)
                        default_print(p, caplen);
        }
-       if (xflag)
-               default_print(p, caplen);
- out:
-       putchar('\n');
-       --infodelay;
-       if (infoprint)
-               info(0);
+
+       return (SLL_HDR_LEN);
 }