]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-sll.c
change make check to work with POSIX shell
[tcpdump] / print-sll.c
index e3e6ec96e28865b13205d7af2e2e042d989a97eb..9bc5d2015ec28f8396fbe511cf6b2b46a07ba015 100644 (file)
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
+/* \summary: Linux cooked sockets capture printer */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
 
-#include <tcpdump-stdinc.h>
+#include <netdissect-stdinc.h>
 
-#include "interface.h"
+#include "netdissect.h"
 #include "addrtoname.h"
 #include "ethertype.h"
 #include "extract.h"
@@ -196,6 +198,7 @@ sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
        u_int caplen = h->caplen;
        u_int length = h->len;
        register const struct sll_header *sllp;
+       u_short hatype;
        u_short ether_type;
        int llc_hdrlen;
        u_int hdrlen;
@@ -223,6 +226,16 @@ sll_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char
        p += SLL_HDR_LEN;
        hdrlen = SLL_HDR_LEN;
 
+       hatype = EXTRACT_16BITS(&sllp->sll_hatype);
+       switch (hatype) {
+
+       case 803:
+               /*
+                * This is an packet with a radiotap header;
+                * just dissect the payload as such.
+                */
+               return (SLL_HDR_LEN + ieee802_11_radio_print(ndo, p, length, caplen));
+       }
        ether_type = EXTRACT_16BITS(&sllp->sll_protocol);
 
 recurse:
@@ -295,7 +308,7 @@ recurse:
                hdrlen += 4;
                goto recurse;
        } else {
-               if (ethertype_print(ndo, ether_type, p, length, caplen) == 0) {
+               if (ethertype_print(ndo, ether_type, p, length, caplen, NULL, NULL) == 0) {
                        /* ether_type not known, print raw packet */
                        if (!ndo->ndo_eflag)
                                sll_print(ndo, sllp, length + SLL_HDR_LEN);