3 * Fortress Technologies, Inc. All rights reserved.
4 * Charlie Lenahan (clenahan@fortresstech.com)
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that: (1) source code distributions
8 * retain the above copyright notice and this paragraph in its entirety, (2)
9 * distributions including binary code include the above copyright notice and
10 * this paragraph in its entirety in the documentation or other materials
11 * provided with the distribution, and (3) all advertising materials mentioning
12 * features or use of this software display the following acknowledgement:
13 * ``This product includes software developed by the University of California,
14 * Lawrence Berkeley Laboratory and its contributors.'' Neither the name of
15 * the University nor the names of its contributors may be used to endorse
16 * or promote products derived from this software without specific prior
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
19 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
20 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
24 static const char rcsid
[] _U_
=
25 "@(#) $Header: /tcpdump/master/tcpdump/print-802_11.c,v 1.49 2007-12-29 23:25:02 guy Exp $ (LBL)";
32 #include <tcpdump-stdinc.h>
38 #include "interface.h"
39 #include "addrtoname.h"
40 #include "ethertype.h"
46 #include "ieee802_11.h"
47 #include "ieee802_11_radio.h"
49 static const char tstr
[] = "[|802.11]";
52 /* This is used to save state when parsing/processing parameters */
60 #define PRINT_SSID(p) \
61 if (p.ssid_present) { \
63 fn_print(p.ssid.ssid, NULL); \
67 #define PRINT_RATE(_sep, _r, _suf) \
68 printf("%s%2.1f%s", _sep, (.5 * ((_r) & 0x7f)), _suf)
69 #define PRINT_RATES(p) \
70 if (p.rates_present) { \
72 const char *sep = " ["; \
73 for (z = 0; z < p.rates.length ; z++) { \
74 PRINT_RATE(sep, p.rates.rate[z], \
75 (p.rates.rate[z] & 0x80 ? "*" : "")); \
78 if (p.rates.length != 0) \
82 #define PRINT_DS_CHANNEL(p) \
84 printf(" CH: %u", p.ds.channel); \
86 CAPABILITY_PRIVACY(p.capability_info) ? ", PRIVACY" : "" );
88 #define MAX_MCS_INDEX 76
93 * the MCS index (0-76);
95 * 0 for 20 MHz, 1 for 40 MHz;
97 * 0 for a long guard interval, 1 for a short guard interval.
99 static const float ieee80211_float_htrates
[MAX_MCS_INDEX
+1][2][2] = {
101 { /* 20 Mhz */ { 6.5, /* SGI */ 7.2, },
102 /* 40 Mhz */ { 13.5, /* SGI */ 15.0, },
106 { /* 20 Mhz */ { 13.0, /* SGI */ 14.4, },
107 /* 40 Mhz */ { 27.0, /* SGI */ 30.0, },
111 { /* 20 Mhz */ { 19.5, /* SGI */ 21.7, },
112 /* 40 Mhz */ { 40.5, /* SGI */ 45.0, },
116 { /* 20 Mhz */ { 26.0, /* SGI */ 28.9, },
117 /* 40 Mhz */ { 54.0, /* SGI */ 60.0, },
121 { /* 20 Mhz */ { 39.0, /* SGI */ 43.3, },
122 /* 40 Mhz */ { 81.0, /* SGI */ 90.0, },
126 { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
127 /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
131 { /* 20 Mhz */ { 58.5, /* SGI */ 65.0, },
132 /* 40 Mhz */ { 121.5, /* SGI */ 135.0, },
136 { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
137 /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
141 { /* 20 Mhz */ { 13.0, /* SGI */ 14.4, },
142 /* 40 Mhz */ { 27.0, /* SGI */ 30.0, },
146 { /* 20 Mhz */ { 26.0, /* SGI */ 28.9, },
147 /* 40 Mhz */ { 54.0, /* SGI */ 60.0, },
151 { /* 20 Mhz */ { 39.0, /* SGI */ 43.3, },
152 /* 40 Mhz */ { 81.0, /* SGI */ 90.0, },
156 { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
157 /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
161 { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
162 /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
166 { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
167 /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
171 { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
172 /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
176 { /* 20 Mhz */ { 130.0, /* SGI */ 144.4, },
177 /* 40 Mhz */ { 270.0, /* SGI */ 300.0, },
181 { /* 20 Mhz */ { 19.5, /* SGI */ 21.7, },
182 /* 40 Mhz */ { 40.5, /* SGI */ 45.0, },
186 { /* 20 Mhz */ { 39.0, /* SGI */ 43.3, },
187 /* 40 Mhz */ { 81.0, /* SGI */ 90.0, },
191 { /* 20 Mhz */ { 58.5, /* SGI */ 65.0, },
192 /* 40 Mhz */ { 121.5, /* SGI */ 135.0, },
196 { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
197 /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
201 { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
202 /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
206 { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
207 /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
211 { /* 20 Mhz */ { 175.5, /* SGI */ 195.0, },
212 /* 40 Mhz */ { 364.5, /* SGI */ 405.0, },
216 { /* 20 Mhz */ { 195.0, /* SGI */ 216.7, },
217 /* 40 Mhz */ { 405.0, /* SGI */ 450.0, },
221 { /* 20 Mhz */ { 26.0, /* SGI */ 28.9, },
222 /* 40 Mhz */ { 54.0, /* SGI */ 60.0, },
226 { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
227 /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
231 { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
232 /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
236 { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
237 /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
241 { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
242 /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
246 { /* 20 Mhz */ { 208.0, /* SGI */ 231.1, },
247 /* 40 Mhz */ { 432.0, /* SGI */ 480.0, },
251 { /* 20 Mhz */ { 234.0, /* SGI */ 260.0, },
252 /* 40 Mhz */ { 486.0, /* SGI */ 540.0, },
256 { /* 20 Mhz */ { 260.0, /* SGI */ 288.9, },
257 /* 40 Mhz */ { 540.0, /* SGI */ 600.0, },
261 { /* 20 Mhz */ { 0.0, /* SGI */ 0.0, }, /* not valid */
262 /* 40 Mhz */ { 6.0, /* SGI */ 6.7, },
266 { /* 20 Mhz */ { 39.0, /* SGI */ 43.3, },
267 /* 40 Mhz */ { 81.0, /* SGI */ 90.0, },
271 { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
272 /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
276 { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
277 /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
281 { /* 20 Mhz */ { 58.5, /* SGI */ 65.0, },
282 /* 40 Mhz */ { 121.5, /* SGI */ 135.0, },
286 { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
287 /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
291 { /* 20 Mhz */ { 97.5, /* SGI */ 108.3, },
292 /* 40 Mhz */ { 202.5, /* SGI */ 225.0, },
296 { /* 20 Mhz */ { 52.0, /* SGI */ 57.8, },
297 /* 40 Mhz */ { 108.0, /* SGI */ 120.0, },
301 { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
302 /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
306 { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
307 /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
311 { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
312 /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
316 { /* 20 Mhz */ { 91.0, /* SGI */ 101.1, },
317 /* 40 Mhz */ { 189.0, /* SGI */ 210.0, },
321 { /* 20 Mhz */ { 91.0, /* SGI */ 101.1, },
322 /* 40 Mhz */ { 189.0, /* SGI */ 210.0, },
326 { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
327 /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
331 { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
332 /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
336 { /* 20 Mhz */ { 97.5, /* SGI */ 108.3, },
337 /* 40 Mhz */ { 202.5, /* SGI */ 225.0, },
341 { /* 20 Mhz */ { 97.5, /* SGI */ 108.3, },
342 /* 40 Mhz */ { 202.5, /* SGI */ 225.0, },
346 { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
347 /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
351 { /* 20 Mhz */ { 136.5, /* SGI */ 151.7, },
352 /* 40 Mhz */ { 283.5, /* SGI */ 315.0, },
356 { /* 20 Mhz */ { 136.5, /* SGI */ 151.7, },
357 /* 40 Mhz */ { 283.5, /* SGI */ 315.0, },
361 { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
362 /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
366 { /* 20 Mhz */ { 65.0, /* SGI */ 72.2, },
367 /* 40 Mhz */ { 135.0, /* SGI */ 150.0, },
371 { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
372 /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
376 { /* 20 Mhz */ { 91.0, /* SGI */ 101.1, },
377 /* 40 Mhz */ { 189.0, /* SGI */ 210.0, },
381 { /* 20 Mhz */ { 78.0, /* SGI */ 86.7, },
382 /* 40 Mhz */ { 162.0, /* SGI */ 180.0, },
386 { /* 20 Mhz */ { 91.0, /* SGI */ 101.1, },
387 /* 40 Mhz */ { 189.0, /* SGI */ 210.0, },
391 { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
392 /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
396 { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
397 /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
401 { /* 20 Mhz */ { 104.0, /* SGI */ 115.6, },
402 /* 40 Mhz */ { 216.0, /* SGI */ 240.0, },
406 { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
407 /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
411 { /* 20 Mhz */ { 130.0, /* SGI */ 144.4, },
412 /* 40 Mhz */ { 270.0, /* SGI */ 300.0, },
416 { /* 20 Mhz */ { 130.0, /* SGI */ 144.4, },
417 /* 40 Mhz */ { 270.0, /* SGI */ 300.0, },
421 { /* 20 Mhz */ { 143.0, /* SGI */ 158.9, },
422 /* 40 Mhz */ { 297.0, /* SGI */ 330.0, },
426 { /* 20 Mhz */ { 97.5, /* SGI */ 108.3, },
427 /* 40 Mhz */ { 202.5, /* SGI */ 225.0, },
431 { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
432 /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
436 { /* 20 Mhz */ { 136.5, /* SGI */ 151.7, },
437 /* 40 Mhz */ { 283.5, /* SGI */ 315.0, },
441 { /* 20 Mhz */ { 117.0, /* SGI */ 130.0, },
442 /* 40 Mhz */ { 243.0, /* SGI */ 270.0, },
446 { /* 20 Mhz */ { 136.5, /* SGI */ 151.7, },
447 /* 40 Mhz */ { 283.5, /* SGI */ 315.0, },
451 { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
452 /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
456 { /* 20 Mhz */ { 175.5, /* SGI */ 195.0, },
457 /* 40 Mhz */ { 364.5, /* SGI */ 405.0, },
461 { /* 20 Mhz */ { 156.0, /* SGI */ 173.3, },
462 /* 40 Mhz */ { 324.0, /* SGI */ 360.0, },
466 { /* 20 Mhz */ { 175.5, /* SGI */ 195.0, },
467 /* 40 Mhz */ { 364.5, /* SGI */ 405.0, },
471 { /* 20 Mhz */ { 195.0, /* SGI */ 216.7, },
472 /* 40 Mhz */ { 405.0, /* SGI */ 450.0, },
476 { /* 20 Mhz */ { 195.0, /* SGI */ 216.7, },
477 /* 40 Mhz */ { 405.0, /* SGI */ 450.0, },
481 { /* 20 Mhz */ { 214.5, /* SGI */ 238.3, },
482 /* 40 Mhz */ { 445.5, /* SGI */ 495.0, },
486 static const char *auth_alg_text
[]={"Open System","Shared Key","EAP"};
487 #define NUM_AUTH_ALGS (sizeof auth_alg_text / sizeof auth_alg_text[0])
489 static const char *status_text
[] = {
490 "Successful", /* 0 */
491 "Unspecified failure", /* 1 */
500 "Cannot Support all requested capabilities in the Capability "
501 "Information field", /* 10 */
502 "Reassociation denied due to inability to confirm that association "
504 "Association denied due to reason outside the scope of the "
506 "Responding station does not support the specified authentication "
507 "algorithm ", /* 13 */
508 "Received an Authentication frame with authentication transaction "
509 "sequence number out of expected sequence", /* 14 */
510 "Authentication rejected because of challenge failure", /* 15 */
511 "Authentication rejected due to timeout waiting for next frame in "
513 "Association denied because AP is unable to handle additional"
514 "associated stations", /* 17 */
515 "Association denied due to requesting station not supporting all of "
516 "the data rates in BSSBasicRateSet parameter", /* 18 */
517 "Association denied due to requesting station not supporting "
518 "short preamble operation", /* 19 */
519 "Association denied due to requesting station not supporting "
520 "PBCC encoding", /* 20 */
521 "Association denied due to requesting station not supporting "
522 "channel agility", /* 21 */
523 "Association request rejected because Spectrum Management "
524 "capability is required", /* 22 */
525 "Association request rejected because the information in the "
526 "Power Capability element is unacceptable", /* 23 */
527 "Association request rejected because the information in the "
528 "Supported Channels element is unacceptable", /* 24 */
529 "Association denied due to requesting station not supporting "
530 "short slot operation", /* 25 */
531 "Association denied due to requesting station not supporting "
532 "DSSS-OFDM operation", /* 26 */
533 "Association denied because the requested STA does not support HT "
536 "Association denied because the requested STA does not support "
537 "the PCO transition time required by the AP", /* 29 */
540 "Unspecified, QoS-related failure", /* 32 */
541 "Association denied due to QAP having insufficient bandwidth "
542 "to handle another QSTA", /* 33 */
543 "Association denied due to excessive frame loss rates and/or "
544 "poor conditions on current operating channel", /* 34 */
545 "Association (with QBSS) denied due to requesting station not "
546 "supporting the QoS facility", /* 35 */
547 "Association denied due to requesting station not supporting "
548 "Block Ack", /* 36 */
549 "The request has been declined", /* 37 */
550 "The request has not been successful as one or more parameters "
551 "have invalid values", /* 38 */
552 "The TS has not been created because the request cannot be honored. "
553 "However, a suggested TSPEC is provided so that the initiating QSTA"
554 "may attempt to set another TS with the suggested changes to the "
556 "Invalid Information Element", /* 40 */
557 "Group Cipher is not valid", /* 41 */
558 "Pairwise Cipher is not valid", /* 42 */
559 "AKMP is not valid", /* 43 */
560 "Unsupported RSN IE version", /* 44 */
561 "Invalid RSN IE Capabilities", /* 45 */
562 "Cipher suite is rejected per security policy", /* 46 */
563 "The TS has not been created. However, the HC may be capable of "
564 "creating a TS, in response to a request, after the time indicated "
565 "in the TS Delay element", /* 47 */
566 "Direct Link is not allowed in the BSS by policy", /* 48 */
567 "Destination STA is not present within this QBSS.", /* 49 */
568 "The Destination STA is not a QSTA.", /* 50 */
571 #define NUM_STATUSES (sizeof status_text / sizeof status_text[0])
573 static const char *reason_text
[] = {
575 "Unspecified reason", /* 1 */
576 "Previous authentication no longer valid", /* 2 */
577 "Deauthenticated because sending station is leaving (or has left) "
578 "IBSS or ESS", /* 3 */
579 "Disassociated due to inactivity", /* 4 */
580 "Disassociated because AP is unable to handle all currently "
581 " associated stations", /* 5 */
582 "Class 2 frame received from nonauthenticated station", /* 6 */
583 "Class 3 frame received from nonassociated station", /* 7 */
584 "Disassociated because sending station is leaving "
585 "(or has left) BSS", /* 8 */
586 "Station requesting (re)association is not authenticated with "
587 "responding station", /* 9 */
588 "Disassociated because the information in the Power Capability "
589 "element is unacceptable", /* 10 */
590 "Disassociated because the information in the SupportedChannels "
591 "element is unacceptable", /* 11 */
592 "Invalid Information Element", /* 12 */
594 "Michael MIC failure", /* 14 */
595 "4-Way Handshake timeout", /* 15 */
596 "Group key update timeout", /* 16 */
597 "Information element in 4-Way Handshake different from (Re)Association"
598 "Request/Probe Response/Beacon", /* 17 */
599 "Group Cipher is not valid", /* 18 */
600 "AKMP is not valid", /* 20 */
601 "Unsupported RSN IE version", /* 21 */
602 "Invalid RSN IE Capabilities", /* 22 */
603 "IEEE 802.1X Authentication failed", /* 23 */
604 "Cipher suite is rejected per security policy", /* 24 */
611 "TS deleted because QoS AP lacks sufficient bandwidth for this "
612 "QoS STA due to a change in BSS service characteristics or "
613 "operational mode (e.g. an HT BSS change from 40 MHz channel "
614 "to 20 MHz channel)", /* 31 */
615 "Disassociated for unspecified, QoS-related reason", /* 32 */
616 "Disassociated because QoS AP lacks sufficient bandwidth for this "
618 "Disassociated because of excessive number of frames that need to be "
619 "acknowledged, but are not acknowledged for AP transmissions "
620 "and/or poor channel conditions", /* 34 */
621 "Disassociated because STA is transmitting outside the limits "
622 "of its TXOPs", /* 35 */
623 "Requested from peer STA as the STA is leaving the BSS "
624 "(or resetting)", /* 36 */
625 "Requested from peer STA as it does not want to use the "
626 "mechanism", /* 37 */
627 "Requested from peer STA as the STA received frames using the "
628 "mechanism for which a set up is required", /* 38 */
629 "Requested from peer STA due to time out", /* 39 */
635 "Peer STA does not support the requested cipher suite", /* 45 */
636 "Association denied due to requesting STA not supporting HT "
639 #define NUM_REASONS (sizeof reason_text / sizeof reason_text[0])
642 wep_print(const u_char
*p
)
646 if (!TTEST2(*p
, IEEE802_11_IV_LEN
+ IEEE802_11_KID_LEN
))
648 iv
= EXTRACT_LE_32BITS(p
);
650 printf("Data IV:%3x Pad %x KeyID %x", IV_IV(iv
), IV_PAD(iv
),
657 parse_elements(struct mgmt_body_t
*pbody
, const u_char
*p
, int offset
,
662 struct challenge_t challenge
;
663 struct rates_t rates
;
669 * We haven't seen any elements yet.
671 pbody
->challenge_present
= 0;
672 pbody
->ssid_present
= 0;
673 pbody
->rates_present
= 0;
674 pbody
->ds_present
= 0;
675 pbody
->cf_present
= 0;
676 pbody
->tim_present
= 0;
678 while (length
!= 0) {
679 if (!TTEST2(*(p
+ offset
), 1))
683 switch (*(p
+ offset
)) {
685 if (!TTEST2(*(p
+ offset
), 2))
689 memcpy(&ssid
, p
+ offset
, 2);
692 if (ssid
.length
!= 0) {
693 if (ssid
.length
> sizeof(ssid
.ssid
) - 1)
695 if (!TTEST2(*(p
+ offset
), ssid
.length
))
697 if (length
< ssid
.length
)
699 memcpy(&ssid
.ssid
, p
+ offset
, ssid
.length
);
700 offset
+= ssid
.length
;
701 length
-= ssid
.length
;
703 ssid
.ssid
[ssid
.length
] = '\0';
705 * Present and not truncated.
707 * If we haven't already seen an SSID IE,
708 * copy this one, otherwise ignore this one,
709 * so we later report the first one we saw.
711 if (!pbody
->ssid_present
) {
713 pbody
->ssid_present
= 1;
717 if (!TTEST2(*(p
+ offset
), 2))
721 memcpy(&challenge
, p
+ offset
, 2);
724 if (challenge
.length
!= 0) {
725 if (challenge
.length
>
726 sizeof(challenge
.text
) - 1)
728 if (!TTEST2(*(p
+ offset
), challenge
.length
))
730 if (length
< challenge
.length
)
732 memcpy(&challenge
.text
, p
+ offset
,
734 offset
+= challenge
.length
;
735 length
-= challenge
.length
;
737 challenge
.text
[challenge
.length
] = '\0';
739 * Present and not truncated.
741 * If we haven't already seen a challenge IE,
742 * copy this one, otherwise ignore this one,
743 * so we later report the first one we saw.
745 if (!pbody
->challenge_present
) {
746 pbody
->challenge
= challenge
;
747 pbody
->challenge_present
= 1;
751 if (!TTEST2(*(p
+ offset
), 2))
755 memcpy(&rates
, p
+ offset
, 2);
758 if (rates
.length
!= 0) {
759 if (rates
.length
> sizeof rates
.rate
)
761 if (!TTEST2(*(p
+ offset
), rates
.length
))
763 if (length
< rates
.length
)
765 memcpy(&rates
.rate
, p
+ offset
, rates
.length
);
766 offset
+= rates
.length
;
767 length
-= rates
.length
;
770 * Present and not truncated.
772 * If we haven't already seen a rates IE,
773 * copy this one if it's not zero-length,
774 * otherwise ignore this one, so we later
775 * report the first one we saw.
777 * We ignore zero-length rates IEs as some
778 * devices seem to put a zero-length rates
779 * IE, followed by an SSID IE, followed by
780 * a non-zero-length rates IE into frames,
781 * even though IEEE Std 802.11-2007 doesn't
782 * seem to indicate that a zero-length rates
785 if (!pbody
->rates_present
&& rates
.length
!= 0) {
786 pbody
->rates
= rates
;
787 pbody
->rates_present
= 1;
791 if (!TTEST2(*(p
+ offset
), 3))
795 memcpy(&ds
, p
+ offset
, 3);
799 * Present and not truncated.
801 * If we haven't already seen a DS IE,
802 * copy this one, otherwise ignore this one,
803 * so we later report the first one we saw.
805 if (!pbody
->ds_present
) {
807 pbody
->ds_present
= 1;
811 if (!TTEST2(*(p
+ offset
), 8))
815 memcpy(&cf
, p
+ offset
, 8);
819 * Present and not truncated.
821 * If we haven't already seen a CF IE,
822 * copy this one, otherwise ignore this one,
823 * so we later report the first one we saw.
825 if (!pbody
->cf_present
) {
827 pbody
->cf_present
= 1;
831 if (!TTEST2(*(p
+ offset
), 2))
835 memcpy(&tim
, p
+ offset
, 2);
838 if (!TTEST2(*(p
+ offset
), 3))
842 memcpy(&tim
.count
, p
+ offset
, 3);
848 if (tim
.length
- 3 > (int)sizeof tim
.bitmap
)
850 if (!TTEST2(*(p
+ offset
), tim
.length
- 3))
852 if (length
< (u_int
)(tim
.length
- 3))
854 memcpy(tim
.bitmap
, p
+ (tim
.length
- 3),
856 offset
+= tim
.length
- 3;
857 length
-= tim
.length
- 3;
859 * Present and not truncated.
861 * If we haven't already seen a TIM IE,
862 * copy this one, otherwise ignore this one,
863 * so we later report the first one we saw.
865 if (!pbody
->tim_present
) {
867 pbody
->tim_present
= 1;
872 printf("(1) unhandled element_id (%d) ",
875 if (!TTEST2(*(p
+ offset
), 2))
879 elementlen
= *(p
+ offset
+ 1);
880 if (!TTEST2(*(p
+ offset
+ 2), elementlen
))
882 if (length
< elementlen
+ 2)
884 offset
+= elementlen
+ 2;
885 length
-= elementlen
+ 2;
890 /* No problems found. */
894 /*********************************************************************************
895 * Print Handle functions for the management frame types
896 *********************************************************************************/
899 handle_beacon(const u_char
*p
, u_int length
)
901 struct mgmt_body_t pbody
;
905 memset(&pbody
, 0, sizeof(pbody
));
907 if (!TTEST2(*p
, IEEE802_11_TSTAMP_LEN
+ IEEE802_11_BCNINT_LEN
+
908 IEEE802_11_CAPINFO_LEN
))
910 if (length
< IEEE802_11_TSTAMP_LEN
+ IEEE802_11_BCNINT_LEN
+
911 IEEE802_11_CAPINFO_LEN
)
913 memcpy(&pbody
.timestamp
, p
, IEEE802_11_TSTAMP_LEN
);
914 offset
+= IEEE802_11_TSTAMP_LEN
;
915 length
-= IEEE802_11_TSTAMP_LEN
;
916 pbody
.beacon_interval
= EXTRACT_LE_16BITS(p
+offset
);
917 offset
+= IEEE802_11_BCNINT_LEN
;
918 length
-= IEEE802_11_BCNINT_LEN
;
919 pbody
.capability_info
= EXTRACT_LE_16BITS(p
+offset
);
920 offset
+= IEEE802_11_CAPINFO_LEN
;
921 length
-= IEEE802_11_CAPINFO_LEN
;
923 ret
= parse_elements(&pbody
, p
, offset
, length
);
928 CAPABILITY_ESS(pbody
.capability_info
) ? "ESS" : "IBSS");
929 PRINT_DS_CHANNEL(pbody
);
935 handle_assoc_request(const u_char
*p
, u_int length
)
937 struct mgmt_body_t pbody
;
941 memset(&pbody
, 0, sizeof(pbody
));
943 if (!TTEST2(*p
, IEEE802_11_CAPINFO_LEN
+ IEEE802_11_LISTENINT_LEN
))
945 if (length
< IEEE802_11_CAPINFO_LEN
+ IEEE802_11_LISTENINT_LEN
)
947 pbody
.capability_info
= EXTRACT_LE_16BITS(p
);
948 offset
+= IEEE802_11_CAPINFO_LEN
;
949 length
-= IEEE802_11_CAPINFO_LEN
;
950 pbody
.listen_interval
= EXTRACT_LE_16BITS(p
+offset
);
951 offset
+= IEEE802_11_LISTENINT_LEN
;
952 length
-= IEEE802_11_LISTENINT_LEN
;
954 ret
= parse_elements(&pbody
, p
, offset
, length
);
962 handle_assoc_response(const u_char
*p
, u_int length
)
964 struct mgmt_body_t pbody
;
968 memset(&pbody
, 0, sizeof(pbody
));
970 if (!TTEST2(*p
, IEEE802_11_CAPINFO_LEN
+ IEEE802_11_STATUS_LEN
+
973 if (length
< IEEE802_11_CAPINFO_LEN
+ IEEE802_11_STATUS_LEN
+
976 pbody
.capability_info
= EXTRACT_LE_16BITS(p
);
977 offset
+= IEEE802_11_CAPINFO_LEN
;
978 length
-= IEEE802_11_CAPINFO_LEN
;
979 pbody
.status_code
= EXTRACT_LE_16BITS(p
+offset
);
980 offset
+= IEEE802_11_STATUS_LEN
;
981 length
-= IEEE802_11_STATUS_LEN
;
982 pbody
.aid
= EXTRACT_LE_16BITS(p
+offset
);
983 offset
+= IEEE802_11_AID_LEN
;
984 length
-= IEEE802_11_AID_LEN
;
986 ret
= parse_elements(&pbody
, p
, offset
, length
);
988 printf(" AID(%x) :%s: %s", ((u_int16_t
)(pbody
.aid
<< 2 )) >> 2 ,
989 CAPABILITY_PRIVACY(pbody
.capability_info
) ? " PRIVACY " : "",
990 (pbody
.status_code
< NUM_STATUSES
991 ? status_text
[pbody
.status_code
]
998 handle_reassoc_request(const u_char
*p
, u_int length
)
1000 struct mgmt_body_t pbody
;
1004 memset(&pbody
, 0, sizeof(pbody
));
1006 if (!TTEST2(*p
, IEEE802_11_CAPINFO_LEN
+ IEEE802_11_LISTENINT_LEN
+
1009 if (length
< IEEE802_11_CAPINFO_LEN
+ IEEE802_11_LISTENINT_LEN
+
1012 pbody
.capability_info
= EXTRACT_LE_16BITS(p
);
1013 offset
+= IEEE802_11_CAPINFO_LEN
;
1014 length
-= IEEE802_11_CAPINFO_LEN
;
1015 pbody
.listen_interval
= EXTRACT_LE_16BITS(p
+offset
);
1016 offset
+= IEEE802_11_LISTENINT_LEN
;
1017 length
-= IEEE802_11_LISTENINT_LEN
;
1018 memcpy(&pbody
.ap
, p
+offset
, IEEE802_11_AP_LEN
);
1019 offset
+= IEEE802_11_AP_LEN
;
1020 length
-= IEEE802_11_AP_LEN
;
1022 ret
= parse_elements(&pbody
, p
, offset
, length
);
1025 printf(" AP : %s", etheraddr_string( pbody
.ap
));
1031 handle_reassoc_response(const u_char
*p
, u_int length
)
1033 /* Same as a Association Reponse */
1034 return handle_assoc_response(p
, length
);
1038 handle_probe_request(const u_char
*p
, u_int length
)
1040 struct mgmt_body_t pbody
;
1044 memset(&pbody
, 0, sizeof(pbody
));
1046 ret
= parse_elements(&pbody
, p
, offset
, length
);
1055 handle_probe_response(const u_char
*p
, u_int length
)
1057 struct mgmt_body_t pbody
;
1061 memset(&pbody
, 0, sizeof(pbody
));
1063 if (!TTEST2(*p
, IEEE802_11_TSTAMP_LEN
+ IEEE802_11_BCNINT_LEN
+
1064 IEEE802_11_CAPINFO_LEN
))
1066 if (length
< IEEE802_11_TSTAMP_LEN
+ IEEE802_11_BCNINT_LEN
+
1067 IEEE802_11_CAPINFO_LEN
)
1069 memcpy(&pbody
.timestamp
, p
, IEEE802_11_TSTAMP_LEN
);
1070 offset
+= IEEE802_11_TSTAMP_LEN
;
1071 length
-= IEEE802_11_TSTAMP_LEN
;
1072 pbody
.beacon_interval
= EXTRACT_LE_16BITS(p
+offset
);
1073 offset
+= IEEE802_11_BCNINT_LEN
;
1074 length
-= IEEE802_11_BCNINT_LEN
;
1075 pbody
.capability_info
= EXTRACT_LE_16BITS(p
+offset
);
1076 offset
+= IEEE802_11_CAPINFO_LEN
;
1077 length
-= IEEE802_11_CAPINFO_LEN
;
1079 ret
= parse_elements(&pbody
, p
, offset
, length
);
1083 PRINT_DS_CHANNEL(pbody
);
1091 /* the frame body for ATIM is null. */
1096 handle_disassoc(const u_char
*p
, u_int length
)
1098 struct mgmt_body_t pbody
;
1100 memset(&pbody
, 0, sizeof(pbody
));
1102 if (!TTEST2(*p
, IEEE802_11_REASON_LEN
))
1104 if (length
< IEEE802_11_REASON_LEN
)
1106 pbody
.reason_code
= EXTRACT_LE_16BITS(p
);
1109 (pbody
.reason_code
< NUM_REASONS
)
1110 ? reason_text
[pbody
.reason_code
]
1117 handle_auth(const u_char
*p
, u_int length
)
1119 struct mgmt_body_t pbody
;
1123 memset(&pbody
, 0, sizeof(pbody
));
1129 pbody
.auth_alg
= EXTRACT_LE_16BITS(p
);
1132 pbody
.auth_trans_seq_num
= EXTRACT_LE_16BITS(p
+ offset
);
1135 pbody
.status_code
= EXTRACT_LE_16BITS(p
+ offset
);
1139 ret
= parse_elements(&pbody
, p
, offset
, length
);
1141 if ((pbody
.auth_alg
== 1) &&
1142 ((pbody
.auth_trans_seq_num
== 2) ||
1143 (pbody
.auth_trans_seq_num
== 3))) {
1144 printf(" (%s)-%x [Challenge Text] %s",
1145 (pbody
.auth_alg
< NUM_AUTH_ALGS
)
1146 ? auth_alg_text
[pbody
.auth_alg
]
1148 pbody
.auth_trans_seq_num
,
1149 ((pbody
.auth_trans_seq_num
% 2)
1150 ? ((pbody
.status_code
< NUM_STATUSES
)
1151 ? status_text
[pbody
.status_code
]
1155 printf(" (%s)-%x: %s",
1156 (pbody
.auth_alg
< NUM_AUTH_ALGS
)
1157 ? auth_alg_text
[pbody
.auth_alg
]
1159 pbody
.auth_trans_seq_num
,
1160 (pbody
.auth_trans_seq_num
% 2)
1161 ? ((pbody
.status_code
< NUM_STATUSES
)
1162 ? status_text
[pbody
.status_code
]
1170 handle_deauth(const struct mgmt_header_t
*pmh
, const u_char
*p
, u_int length
)
1172 struct mgmt_body_t pbody
;
1174 const char *reason
= NULL
;
1176 memset(&pbody
, 0, sizeof(pbody
));
1178 if (!TTEST2(*p
, IEEE802_11_REASON_LEN
))
1180 if (length
< IEEE802_11_REASON_LEN
)
1182 pbody
.reason_code
= EXTRACT_LE_16BITS(p
);
1183 offset
+= IEEE802_11_REASON_LEN
;
1184 length
-= IEEE802_11_REASON_LEN
;
1186 reason
= (pbody
.reason_code
< NUM_REASONS
)
1187 ? reason_text
[pbody
.reason_code
]
1191 printf(": %s", reason
);
1193 printf(" (%s): %s", etheraddr_string(pmh
->sa
), reason
);
1198 #define PRINT_HT_ACTION(v) (\
1199 (v) == 0 ? printf("TxChWidth") : \
1200 (v) == 1 ? printf("MIMOPwrSave") : \
1201 printf("Act#%d", (v)) \
1203 #define PRINT_BA_ACTION(v) (\
1204 (v) == 0 ? printf("ADDBA Request") : \
1205 (v) == 1 ? printf("ADDBA Response") : \
1206 (v) == 2 ? printf("DELBA") : \
1207 printf("Act#%d", (v)) \
1209 #define PRINT_MESHLINK_ACTION(v) (\
1210 (v) == 0 ? printf("Request") : \
1211 (v) == 1 ? printf("Report") : \
1212 printf("Act#%d", (v)) \
1214 #define PRINT_MESHPEERING_ACTION(v) (\
1215 (v) == 0 ? printf("Open") : \
1216 (v) == 1 ? printf("Confirm") : \
1217 (v) == 2 ? printf("Close") : \
1218 printf("Act#%d", (v)) \
1220 #define PRINT_MESHPATH_ACTION(v) (\
1221 (v) == 0 ? printf("Request") : \
1222 (v) == 1 ? printf("Report") : \
1223 (v) == 2 ? printf("Error") : \
1224 (v) == 3 ? printf("RootAnnouncement") : \
1225 printf("Act#%d", (v)) \
1228 #define PRINT_MESH_ACTION(v) (\
1229 (v) == 0 ? printf("MeshLink") : \
1230 (v) == 1 ? printf("HWMP") : \
1231 (v) == 2 ? printf("Gate Announcement") : \
1232 (v) == 3 ? printf("Congestion Control") : \
1233 (v) == 4 ? printf("MCCA Setup Request") : \
1234 (v) == 5 ? printf("MCCA Setup Reply") : \
1235 (v) == 6 ? printf("MCCA Advertisement Request") : \
1236 (v) == 7 ? printf("MCCA Advertisement") : \
1237 (v) == 8 ? printf("MCCA Teardown") : \
1238 (v) == 9 ? printf("TBTT Adjustment Request") : \
1239 (v) == 10 ? printf("TBTT Adjustment Response") : \
1240 printf("Act#%d", (v)) \
1242 #define PRINT_MULTIHOP_ACTION(v) (\
1243 (v) == 0 ? printf("Proxy Update") : \
1244 (v) == 1 ? printf("Proxy Update Confirmation") : \
1245 printf("Act#%d", (v)) \
1247 #define PRINT_SELFPROT_ACTION(v) (\
1248 (v) == 1 ? printf("Peering Open") : \
1249 (v) == 2 ? printf("Peering Confirm") : \
1250 (v) == 3 ? printf("Peering Close") : \
1251 (v) == 4 ? printf("Group Key Inform") : \
1252 (v) == 5 ? printf("Group Key Acknowledge") : \
1253 printf("Act#%d", (v)) \
1257 handle_action(const struct mgmt_header_t
*pmh
, const u_char
*p
, u_int length
)
1266 printf(" (%s): ", etheraddr_string(pmh
->sa
));
1269 case 0: printf("Spectrum Management Act#%d", p
[1]); break;
1270 case 1: printf("QoS Act#%d", p
[1]); break;
1271 case 2: printf("DLS Act#%d", p
[1]); break;
1272 case 3: printf("BA "); PRINT_BA_ACTION(p
[1]); break;
1273 case 7: printf("HT "); PRINT_HT_ACTION(p
[1]); break;
1274 case 13: printf("MeshAction "); PRINT_MESH_ACTION(p
[1]); break;
1276 printf("MultiohopAction ");
1277 PRINT_MULTIHOP_ACTION(p
[1]); break;
1279 printf("SelfprotectAction ");
1280 PRINT_SELFPROT_ACTION(p
[1]); break;
1281 case 127: printf("Vendor Act#%d", p
[1]); break;
1283 printf("Reserved(%d) Act#%d", p
[0], p
[1]);
1290 /*********************************************************************************
1292 *********************************************************************************/
1296 mgmt_body_print(u_int16_t fc
, const struct mgmt_header_t
*pmh
,
1297 const u_char
*p
, u_int length
)
1299 switch (FC_SUBTYPE(fc
)) {
1300 case ST_ASSOC_REQUEST
:
1301 printf("Assoc Request");
1302 return handle_assoc_request(p
, length
);
1303 case ST_ASSOC_RESPONSE
:
1304 printf("Assoc Response");
1305 return handle_assoc_response(p
, length
);
1306 case ST_REASSOC_REQUEST
:
1307 printf("ReAssoc Request");
1308 return handle_reassoc_request(p
, length
);
1309 case ST_REASSOC_RESPONSE
:
1310 printf("ReAssoc Response");
1311 return handle_reassoc_response(p
, length
);
1312 case ST_PROBE_REQUEST
:
1313 printf("Probe Request");
1314 return handle_probe_request(p
, length
);
1315 case ST_PROBE_RESPONSE
:
1316 printf("Probe Response");
1317 return handle_probe_response(p
, length
);
1320 return handle_beacon(p
, length
);
1323 return handle_atim();
1325 printf("Disassociation");
1326 return handle_disassoc(p
, length
);
1328 printf("Authentication");
1331 if ((p
[0] == 0 ) && (p
[1] == 0) && (p
[2] == 0)) {
1332 printf("Authentication (Shared-Key)-3 ");
1333 return wep_print(p
);
1335 return handle_auth(p
, length
);
1337 printf("DeAuthentication");
1338 return handle_deauth(pmh
, p
, length
);
1342 return handle_action(pmh
, p
, length
);
1345 printf("Unhandled Management subtype(%x)",
1352 /*********************************************************************************
1353 * Handles printing all the control frame types
1354 *********************************************************************************/
1357 ctrl_body_print(u_int16_t fc
, const u_char
*p
)
1359 switch (FC_SUBTYPE(fc
)) {
1360 case CTRL_CONTROL_WRAPPER
:
1361 printf("Control Wrapper");
1362 /* XXX - requires special handling */
1366 if (!TTEST2(*p
, CTRL_BAR_HDRLEN
))
1369 printf(" RA:%s TA:%s CTL(%x) SEQ(%u) ",
1370 etheraddr_string(((const struct ctrl_bar_t
*)p
)->ra
),
1371 etheraddr_string(((const struct ctrl_bar_t
*)p
)->ta
),
1372 EXTRACT_LE_16BITS(&(((const struct ctrl_bar_t
*)p
)->ctl
)),
1373 EXTRACT_LE_16BITS(&(((const struct ctrl_bar_t
*)p
)->seq
)));
1377 if (!TTEST2(*p
, CTRL_BA_HDRLEN
))
1381 etheraddr_string(((const struct ctrl_ba_t
*)p
)->ra
));
1384 printf("Power Save-Poll");
1385 if (!TTEST2(*p
, CTRL_PS_POLL_HDRLEN
))
1388 EXTRACT_LE_16BITS(&(((const struct ctrl_ps_poll_t
*)p
)->aid
)));
1391 printf("Request-To-Send");
1392 if (!TTEST2(*p
, CTRL_RTS_HDRLEN
))
1396 etheraddr_string(((const struct ctrl_rts_t
*)p
)->ta
));
1399 printf("Clear-To-Send");
1400 if (!TTEST2(*p
, CTRL_CTS_HDRLEN
))
1404 etheraddr_string(((const struct ctrl_cts_t
*)p
)->ra
));
1407 printf("Acknowledgment");
1408 if (!TTEST2(*p
, CTRL_ACK_HDRLEN
))
1412 etheraddr_string(((const struct ctrl_ack_t
*)p
)->ra
));
1416 if (!TTEST2(*p
, CTRL_END_HDRLEN
))
1420 etheraddr_string(((const struct ctrl_end_t
*)p
)->ra
));
1423 printf("CF-End+CF-Ack");
1424 if (!TTEST2(*p
, CTRL_END_ACK_HDRLEN
))
1428 etheraddr_string(((const struct ctrl_end_ack_t
*)p
)->ra
));
1431 printf("Unknown Ctrl Subtype");
1437 * Print Header funcs
1441 * Data Frame - Address field contents
1443 * To Ds | From DS | Addr 1 | Addr 2 | Addr 3 | Addr 4
1444 * 0 | 0 | DA | SA | BSSID | n/a
1445 * 0 | 1 | DA | BSSID | SA | n/a
1446 * 1 | 0 | BSSID | SA | DA | n/a
1447 * 1 | 1 | RA | TA | DA | SA
1451 data_header_print(u_int16_t fc
, const u_char
*p
, const u_int8_t
**srcp
,
1452 const u_int8_t
**dstp
)
1454 u_int subtype
= FC_SUBTYPE(fc
);
1456 if (DATA_FRAME_IS_CF_ACK(subtype
) || DATA_FRAME_IS_CF_POLL(subtype
) ||
1457 DATA_FRAME_IS_QOS(subtype
)) {
1459 if (DATA_FRAME_IS_CF_ACK(subtype
)) {
1460 if (DATA_FRAME_IS_CF_POLL(subtype
))
1465 if (DATA_FRAME_IS_CF_POLL(subtype
))
1468 if (DATA_FRAME_IS_QOS(subtype
))
1473 #define ADDR1 (p + 4)
1474 #define ADDR2 (p + 10)
1475 #define ADDR3 (p + 16)
1476 #define ADDR4 (p + 24)
1478 if (!FC_TO_DS(fc
) && !FC_FROM_DS(fc
)) {
1485 printf("DA:%s SA:%s BSSID:%s ",
1486 etheraddr_string(ADDR1
), etheraddr_string(ADDR2
),
1487 etheraddr_string(ADDR3
));
1488 } else if (!FC_TO_DS(fc
) && FC_FROM_DS(fc
)) {
1495 printf("DA:%s BSSID:%s SA:%s ",
1496 etheraddr_string(ADDR1
), etheraddr_string(ADDR2
),
1497 etheraddr_string(ADDR3
));
1498 } else if (FC_TO_DS(fc
) && !FC_FROM_DS(fc
)) {
1505 printf("BSSID:%s SA:%s DA:%s ",
1506 etheraddr_string(ADDR1
), etheraddr_string(ADDR2
),
1507 etheraddr_string(ADDR3
));
1508 } else if (FC_TO_DS(fc
) && FC_FROM_DS(fc
)) {
1515 printf("RA:%s TA:%s DA:%s SA:%s ",
1516 etheraddr_string(ADDR1
), etheraddr_string(ADDR2
),
1517 etheraddr_string(ADDR3
), etheraddr_string(ADDR4
));
1527 mgmt_header_print(const u_char
*p
, const u_int8_t
**srcp
,
1528 const u_int8_t
**dstp
)
1530 const struct mgmt_header_t
*hp
= (const struct mgmt_header_t
*) p
;
1539 printf("BSSID:%s DA:%s SA:%s ",
1540 etheraddr_string((hp
)->bssid
), etheraddr_string((hp
)->da
),
1541 etheraddr_string((hp
)->sa
));
1545 ctrl_header_print(u_int16_t fc
, const u_char
*p
, const u_int8_t
**srcp
,
1546 const u_int8_t
**dstp
)
1555 switch (FC_SUBTYPE(fc
)) {
1557 printf(" RA:%s TA:%s CTL(%x) SEQ(%u) ",
1558 etheraddr_string(((const struct ctrl_bar_t
*)p
)->ra
),
1559 etheraddr_string(((const struct ctrl_bar_t
*)p
)->ta
),
1560 EXTRACT_LE_16BITS(&(((const struct ctrl_bar_t
*)p
)->ctl
)),
1561 EXTRACT_LE_16BITS(&(((const struct ctrl_bar_t
*)p
)->seq
)));
1565 etheraddr_string(((const struct ctrl_ba_t
*)p
)->ra
));
1568 printf("BSSID:%s TA:%s ",
1569 etheraddr_string(((const struct ctrl_ps_poll_t
*)p
)->bssid
),
1570 etheraddr_string(((const struct ctrl_ps_poll_t
*)p
)->ta
));
1573 printf("RA:%s TA:%s ",
1574 etheraddr_string(((const struct ctrl_rts_t
*)p
)->ra
),
1575 etheraddr_string(((const struct ctrl_rts_t
*)p
)->ta
));
1579 etheraddr_string(((const struct ctrl_cts_t
*)p
)->ra
));
1583 etheraddr_string(((const struct ctrl_ack_t
*)p
)->ra
));
1586 printf("RA:%s BSSID:%s ",
1587 etheraddr_string(((const struct ctrl_end_t
*)p
)->ra
),
1588 etheraddr_string(((const struct ctrl_end_t
*)p
)->bssid
));
1591 printf("RA:%s BSSID:%s ",
1592 etheraddr_string(((const struct ctrl_end_ack_t
*)p
)->ra
),
1593 etheraddr_string(((const struct ctrl_end_ack_t
*)p
)->bssid
));
1596 printf("(H) Unknown Ctrl Subtype");
1602 extract_header_length(u_int16_t fc
)
1606 switch (FC_TYPE(fc
)) {
1610 switch (FC_SUBTYPE(fc
)) {
1612 return CTRL_BAR_HDRLEN
;
1614 return CTRL_PS_POLL_HDRLEN
;
1616 return CTRL_RTS_HDRLEN
;
1618 return CTRL_CTS_HDRLEN
;
1620 return CTRL_ACK_HDRLEN
;
1622 return CTRL_END_HDRLEN
;
1624 return CTRL_END_ACK_HDRLEN
;
1629 len
= (FC_TO_DS(fc
) && FC_FROM_DS(fc
)) ? 30 : 24;
1630 if (DATA_FRAME_IS_QOS(FC_SUBTYPE(fc
)))
1634 printf("unknown IEEE802.11 frame type (%d)", FC_TYPE(fc
));
1640 extract_mesh_header_length(const u_char
*p
)
1642 return (p
[0] &~ 3) ? 0 : 6*(1 + (p
[0] & 3));
1646 * Print the 802.11 MAC header if eflag is set, and set "*srcp" and "*dstp"
1647 * to point to the source and destination MAC addresses in any case if
1648 * "srcp" and "dstp" aren't null.
1651 ieee_802_11_hdr_print(u_int16_t fc
, const u_char
*p
, u_int hdrlen
,
1652 u_int meshdrlen
, const u_int8_t
**srcp
, const u_int8_t
**dstp
)
1655 if (FC_MORE_DATA(fc
))
1656 printf("More Data ");
1657 if (FC_MORE_FLAG(fc
))
1658 printf("More Fragments ");
1659 if (FC_POWER_MGMT(fc
))
1660 printf("Pwr Mgmt ");
1664 printf("Strictly Ordered ");
1666 printf("WEP Encrypted ");
1667 if (FC_TYPE(fc
) != T_CTRL
|| FC_SUBTYPE(fc
) != CTRL_PS_POLL
)
1670 &((const struct mgmt_header_t
*)p
)->duration
));
1672 if (meshdrlen
!= 0) {
1673 const struct meshcntl_t
*mc
=
1674 (const struct meshcntl_t
*)&p
[hdrlen
- meshdrlen
];
1675 int ae
= mc
->flags
& 3;
1677 printf("MeshData (AE %d TTL %u seq %u", ae
, mc
->ttl
,
1678 EXTRACT_LE_32BITS(mc
->seq
));
1680 printf(" A4:%s", etheraddr_string(mc
->addr4
));
1682 printf(" A5:%s", etheraddr_string(mc
->addr5
));
1684 printf(" A6:%s", etheraddr_string(mc
->addr6
));
1688 switch (FC_TYPE(fc
)) {
1690 mgmt_header_print(p
, srcp
, dstp
);
1693 ctrl_header_print(fc
, p
, srcp
, dstp
);
1696 data_header_print(fc
, p
, srcp
, dstp
);
1699 printf("(header) unknown IEEE802.11 frame type (%d)",
1708 #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
1712 ieee802_11_print(const u_char
*p
, u_int length
, u_int orig_caplen
, int pad
,
1716 u_int caplen
, hdrlen
, meshdrlen
;
1717 const u_int8_t
*src
, *dst
;
1718 u_short extracted_ethertype
;
1720 caplen
= orig_caplen
;
1721 /* Remove FCS, if present */
1722 if (length
< fcslen
) {
1727 if (caplen
> length
) {
1728 /* Amount of FCS in actual packet data, if any */
1729 fcslen
= caplen
- length
;
1734 if (caplen
< IEEE802_11_FC_LEN
) {
1739 fc
= EXTRACT_LE_16BITS(p
);
1740 hdrlen
= extract_header_length(fc
);
1742 hdrlen
= roundup2(hdrlen
, 4);
1743 if (Hflag
&& FC_TYPE(fc
) == T_DATA
&&
1744 DATA_FRAME_IS_QOS(FC_SUBTYPE(fc
))) {
1745 meshdrlen
= extract_mesh_header_length(p
+hdrlen
);
1746 hdrlen
+= meshdrlen
;
1751 if (caplen
< hdrlen
) {
1756 ieee_802_11_hdr_print(fc
, p
, hdrlen
, meshdrlen
, &src
, &dst
);
1759 * Go past the 802.11 header.
1765 switch (FC_TYPE(fc
)) {
1767 if (!mgmt_body_print(fc
,
1768 (const struct mgmt_header_t
*)(p
- hdrlen
), p
, length
)) {
1774 if (!ctrl_body_print(fc
, p
- hdrlen
)) {
1780 if (DATA_FRAME_IS_NULL(FC_SUBTYPE(fc
)))
1781 return hdrlen
; /* no-data frame */
1782 /* There may be a problem w/ AP not having this bit set */
1784 if (!wep_print(p
)) {
1788 } else if (llc_print(p
, length
, caplen
, dst
, src
,
1789 &extracted_ethertype
) == 0) {
1791 * Some kinds of LLC packet we cannot
1792 * handle intelligently
1795 ieee_802_11_hdr_print(fc
, p
- hdrlen
, hdrlen
,
1796 meshdrlen
, NULL
, NULL
);
1797 if (extracted_ethertype
)
1800 htons(extracted_ethertype
)));
1801 if (!suppress_default_print
)
1802 default_print(p
, caplen
);
1806 printf("unknown 802.11 frame type (%d)", FC_TYPE(fc
));
1814 * This is the top level routine of the printer. 'p' points
1815 * to the 802.11 header of the packet, 'h->ts' is the timestamp,
1816 * 'h->len' is the length of the packet off the wire, and 'h->caplen'
1817 * is the number of bytes actually captured.
1820 ieee802_11_if_print(const struct pcap_pkthdr
*h
, const u_char
*p
)
1822 return ieee802_11_print(p
, h
->len
, h
->caplen
, 0, 0);
1825 #define IEEE80211_CHAN_FHSS \
1826 (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK)
1827 #define IEEE80211_CHAN_A \
1828 (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM)
1829 #define IEEE80211_CHAN_B \
1830 (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK)
1831 #define IEEE80211_CHAN_PUREG \
1832 (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM)
1833 #define IEEE80211_CHAN_G \
1834 (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN)
1836 #define IS_CHAN_FHSS(flags) \
1837 ((flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS)
1838 #define IS_CHAN_A(flags) \
1839 ((flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A)
1840 #define IS_CHAN_B(flags) \
1841 ((flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B)
1842 #define IS_CHAN_PUREG(flags) \
1843 ((flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG)
1844 #define IS_CHAN_G(flags) \
1845 ((flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G)
1846 #define IS_CHAN_ANYG(flags) \
1847 (IS_CHAN_PUREG(flags) || IS_CHAN_G(flags))
1850 print_chaninfo(int freq
, int flags
)
1852 printf("%u MHz", freq
);
1853 if (IS_CHAN_FHSS(flags
))
1855 if (IS_CHAN_A(flags
)) {
1856 if (flags
& IEEE80211_CHAN_HALF
)
1857 printf(" 11a/10Mhz");
1858 else if (flags
& IEEE80211_CHAN_QUARTER
)
1859 printf(" 11a/5Mhz");
1863 if (IS_CHAN_ANYG(flags
)) {
1864 if (flags
& IEEE80211_CHAN_HALF
)
1865 printf(" 11g/10Mhz");
1866 else if (flags
& IEEE80211_CHAN_QUARTER
)
1867 printf(" 11g/5Mhz");
1870 } else if (IS_CHAN_B(flags
))
1872 if (flags
& IEEE80211_CHAN_TURBO
)
1874 if (flags
& IEEE80211_CHAN_HT20
)
1876 else if (flags
& IEEE80211_CHAN_HT40D
)
1878 else if (flags
& IEEE80211_CHAN_HT40U
)
1884 print_radiotap_field(struct cpack_state
*s
, u_int32_t bit
, u_int8_t
*flags
,
1885 struct radiotap_state
*state
, u_int32_t presentflags
)
1898 case IEEE80211_RADIOTAP_FLAGS
:
1899 rc
= cpack_uint8(s
, &u
.u8
);
1904 case IEEE80211_RADIOTAP_RATE
:
1905 rc
= cpack_uint8(s
, &u
.u8
);
1909 /* Save state rate */
1912 case IEEE80211_RADIOTAP_DB_ANTSIGNAL
:
1913 case IEEE80211_RADIOTAP_DB_ANTNOISE
:
1914 case IEEE80211_RADIOTAP_ANTENNA
:
1915 rc
= cpack_uint8(s
, &u
.u8
);
1917 case IEEE80211_RADIOTAP_DBM_ANTSIGNAL
:
1918 case IEEE80211_RADIOTAP_DBM_ANTNOISE
:
1919 rc
= cpack_int8(s
, &u
.i8
);
1921 case IEEE80211_RADIOTAP_CHANNEL
:
1922 rc
= cpack_uint16(s
, &u
.u16
);
1925 rc
= cpack_uint16(s
, &u2
.u16
);
1927 case IEEE80211_RADIOTAP_FHSS
:
1928 case IEEE80211_RADIOTAP_LOCK_QUALITY
:
1929 case IEEE80211_RADIOTAP_TX_ATTENUATION
:
1930 case IEEE80211_RADIOTAP_RX_FLAGS
:
1931 rc
= cpack_uint16(s
, &u
.u16
);
1933 case IEEE80211_RADIOTAP_DB_TX_ATTENUATION
:
1934 rc
= cpack_uint8(s
, &u
.u8
);
1936 case IEEE80211_RADIOTAP_DBM_TX_POWER
:
1937 rc
= cpack_int8(s
, &u
.i8
);
1939 case IEEE80211_RADIOTAP_TSFT
:
1940 rc
= cpack_uint64(s
, &u
.u64
);
1942 case IEEE80211_RADIOTAP_XCHANNEL
:
1943 rc
= cpack_uint32(s
, &u
.u32
);
1946 rc
= cpack_uint16(s
, &u2
.u16
);
1949 rc
= cpack_uint8(s
, &u3
.u8
);
1952 rc
= cpack_uint8(s
, &u4
.u8
);
1954 case IEEE80211_RADIOTAP_MCS
:
1955 rc
= cpack_uint8(s
, &u
.u8
);
1958 rc
= cpack_uint8(s
, &u2
.u8
);
1961 rc
= cpack_uint8(s
, &u3
.u8
);
1963 case IEEE80211_RADIOTAP_VENDOR_NAMESPACE
: {
1968 if ((cpack_align_and_reserve(s
, 2)) == NULL
) {
1973 rc
= cpack_uint8(s
, &vns
[0]);
1976 rc
= cpack_uint8(s
, &vns
[1]);
1979 rc
= cpack_uint8(s
, &vns
[2]);
1982 rc
= cpack_uint8(s
, &subspace
);
1985 rc
= cpack_uint16(s
, &length
);
1989 /* Skip up to length */
1990 s
->c_next
+= length
;
1994 /* this bit indicates a field whose
1995 * size we do not know, so we cannot
1996 * proceed. Just print the bit number.
1998 printf("[bit %u] ", bit
);
2007 /* Preserve the state present flags */
2008 state
->present
= presentflags
;
2011 case IEEE80211_RADIOTAP_CHANNEL
:
2013 * If CHANNEL and XCHANNEL are both present, skip
2016 if (presentflags
& (1 << IEEE80211_RADIOTAP_XCHANNEL
))
2018 print_chaninfo(u
.u16
, u2
.u16
);
2020 case IEEE80211_RADIOTAP_FHSS
:
2021 printf("fhset %d fhpat %d ", u
.u16
& 0xff, (u
.u16
>> 8) & 0xff);
2023 case IEEE80211_RADIOTAP_RATE
:
2025 * XXX On FreeBSD rate & 0x80 means we have an MCS. On
2026 * Linux and AirPcap it does not. (What about
2027 * Mac OS X, NetBSD, OpenBSD, and DragonFly BSD?)
2029 * This is an issue either for proprietary extensions
2030 * to 11a or 11g, which do exist, or for 11n
2031 * implementations that stuff a rate value into
2032 * this field, which also appear to exist.
2034 * We currently handle that by assuming that
2035 * if the 0x80 bit is set *and* the remaining
2036 * bits have a value between 0 and 15 it's
2037 * an MCS value, otherwise it's a rate. If
2038 * there are cases where systems that use
2039 * "0x80 + MCS index" for MCS indices > 15,
2040 * or stuff a rate value here between 64 and
2041 * 71.5 Mb/s in here, we'll need a preference
2042 * setting. Such rates do exist, e.g. 11n
2043 * MCS 7 at 20 MHz with a long guard interval.
2045 if (u
.u8
>= 0x80 && u
.u8
<= 0x8f) {
2047 * XXX - we don't know the channel width
2048 * or guard interval length, so we can't
2049 * convert this to a data rate.
2051 * If you want us to show a data rate,
2052 * use the MCS field, not the Rate field;
2053 * the MCS field includes not only the
2054 * MCS index, it also includes bandwidth
2055 * and guard interval information.
2057 * XXX - can we get the channel width
2058 * from XChannel and the guard interval
2059 * information from Flags, at least on
2062 printf("MCS %u ", u
.u8
& 0x7f);
2064 printf("%2.1f Mb/s ", .5*u
.u8
);
2066 case IEEE80211_RADIOTAP_DBM_ANTSIGNAL
:
2067 printf("%ddB signal ", u
.i8
);
2069 case IEEE80211_RADIOTAP_DBM_ANTNOISE
:
2070 printf("%ddB noise ", u
.i8
);
2072 case IEEE80211_RADIOTAP_DB_ANTSIGNAL
:
2073 printf("%ddB signal ", u
.u8
);
2075 case IEEE80211_RADIOTAP_DB_ANTNOISE
:
2076 printf("%ddB noise ", u
.u8
);
2078 case IEEE80211_RADIOTAP_LOCK_QUALITY
:
2079 printf("%u sq ", u
.u16
);
2081 case IEEE80211_RADIOTAP_TX_ATTENUATION
:
2082 printf("%d tx power ", -(int)u
.u16
);
2084 case IEEE80211_RADIOTAP_DB_TX_ATTENUATION
:
2085 printf("%ddB tx power ", -(int)u
.u8
);
2087 case IEEE80211_RADIOTAP_DBM_TX_POWER
:
2088 printf("%ddBm tx power ", u
.i8
);
2090 case IEEE80211_RADIOTAP_FLAGS
:
2091 if (u
.u8
& IEEE80211_RADIOTAP_F_CFP
)
2093 if (u
.u8
& IEEE80211_RADIOTAP_F_SHORTPRE
)
2094 printf("short preamble ");
2095 if (u
.u8
& IEEE80211_RADIOTAP_F_WEP
)
2097 if (u
.u8
& IEEE80211_RADIOTAP_F_FRAG
)
2098 printf("fragmented ");
2099 if (u
.u8
& IEEE80211_RADIOTAP_F_BADFCS
)
2102 case IEEE80211_RADIOTAP_ANTENNA
:
2103 printf("antenna %d ", u
.u8
);
2105 case IEEE80211_RADIOTAP_TSFT
:
2106 printf("%" PRIu64
"us tsft ", u
.u64
);
2108 case IEEE80211_RADIOTAP_RX_FLAGS
:
2109 /* Do nothing for now */
2111 case IEEE80211_RADIOTAP_XCHANNEL
:
2112 print_chaninfo(u2
.u16
, u
.u32
);
2114 case IEEE80211_RADIOTAP_MCS
: {
2115 static const char *bandwidth
[4] = {
2123 if (u
.u8
& IEEE80211_RADIOTAP_MCS_MCS_INDEX_KNOWN
) {
2125 * We know the MCS index.
2127 if (u3
.u8
<= MAX_MCS_INDEX
) {
2129 * And it's in-range.
2131 if (u
.u8
& (IEEE80211_RADIOTAP_MCS_BANDWIDTH_KNOWN
|IEEE80211_RADIOTAP_MCS_GUARD_INTERVAL_KNOWN
)) {
2133 * And we know both the bandwidth and
2134 * the guard interval, so we can look
2138 ieee80211_float_htrates \
2140 [((u2
.u8
& IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK
) == IEEE80211_RADIOTAP_MCS_BANDWIDTH_40
? 1 : 0)] \
2141 [((u2
.u8
& IEEE80211_RADIOTAP_MCS_SHORT_GI
) ? 1 : 0)];
2144 * We don't know both the bandwidth
2145 * and the guard interval, so we can
2146 * only report the MCS index.
2152 * The MCS value is out of range.
2156 if (htrate
!= 0.0) {
2161 printf("%.1f Mb/s MCS %u ", htrate
, u3
.u8
);
2164 * We at least have the MCS index.
2167 printf("MCS %u ", u3
.u8
);
2170 if (u
.u8
& IEEE80211_RADIOTAP_MCS_BANDWIDTH_KNOWN
) {
2172 bandwidth
[u2
.u8
& IEEE80211_RADIOTAP_MCS_BANDWIDTH_MASK
]);
2174 if (u
.u8
& IEEE80211_RADIOTAP_MCS_GUARD_INTERVAL_KNOWN
) {
2176 (u2
.u8
& IEEE80211_RADIOTAP_MCS_SHORT_GI
) ?
2179 if (u
.u8
& IEEE80211_RADIOTAP_MCS_HT_FORMAT_KNOWN
) {
2181 (u2
.u8
& IEEE80211_RADIOTAP_MCS_HT_GREENFIELD
) ?
2182 "greenfield" : "mixed");
2184 if (u
.u8
& IEEE80211_RADIOTAP_MCS_FEC_TYPE_KNOWN
) {
2186 (u2
.u8
& IEEE80211_RADIOTAP_MCS_FEC_LDPC
) ?
2189 if (u
.u8
& IEEE80211_RADIOTAP_MCS_STBC_KNOWN
) {
2190 printf("RX-STBC%u ",
2191 (u2
.u8
& IEEE80211_RADIOTAP_MCS_STBC_MASK
) >> IEEE80211_RADIOTAP_MCS_STBC_SHIFT
);
2201 ieee802_11_radio_print(const u_char
*p
, u_int length
, u_int caplen
)
2203 #define BITNO_32(x) (((x) >> 16) ? 16 + BITNO_16((x) >> 16) : BITNO_16((x)))
2204 #define BITNO_16(x) (((x) >> 8) ? 8 + BITNO_8((x) >> 8) : BITNO_8((x)))
2205 #define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x)))
2206 #define BITNO_4(x) (((x) >> 2) ? 2 + BITNO_2((x) >> 2) : BITNO_2((x)))
2207 #define BITNO_2(x) (((x) & 2) ? 1 : 0)
2208 #define BIT(n) (1U << n)
2209 #define IS_EXTENDED(__p) \
2210 (EXTRACT_LE_32BITS(__p) & BIT(IEEE80211_RADIOTAP_EXT)) != 0
2212 struct cpack_state cpacker
;
2213 struct ieee80211_radiotap_header
*hdr
;
2214 u_int32_t present
, next_present
;
2215 u_int32_t presentflags
= 0;
2216 u_int32_t
*presentp
, *last_presentp
;
2217 enum ieee80211_radiotap_type bit
;
2223 struct radiotap_state state
;
2225 if (caplen
< sizeof(*hdr
)) {
2230 hdr
= (struct ieee80211_radiotap_header
*)p
;
2232 len
= EXTRACT_LE_16BITS(&hdr
->it_len
);
2238 cpack_init(&cpacker
, (u_int8_t
*)hdr
, len
); /* align against header start */
2239 cpack_advance(&cpacker
, sizeof(*hdr
)); /* includes the 1st bitmap */
2240 for (last_presentp
= &hdr
->it_present
;
2241 IS_EXTENDED(last_presentp
) &&
2242 (u_char
*)(last_presentp
+ 1) <= p
+ len
;
2244 cpack_advance(&cpacker
, sizeof(hdr
->it_present
)); /* more bitmaps */
2246 /* are there more bitmap extensions than bytes in header? */
2247 if (IS_EXTENDED(last_presentp
)) {
2252 /* Assume no flags */
2254 /* Assume no Atheros padding between 802.11 header and body */
2256 /* Assume no FCS at end of frame */
2258 for (bit0
= 0, presentp
= &hdr
->it_present
; presentp
<= last_presentp
;
2259 presentp
++, bit0
+= 32) {
2260 presentflags
= EXTRACT_LE_32BITS(presentp
);
2263 memset(&state
, 0, sizeof(state
));
2265 for (present
= EXTRACT_LE_32BITS(presentp
); present
;
2266 present
= next_present
) {
2267 /* clear the least significant bit that is set */
2268 next_present
= present
& (present
- 1);
2270 /* extract the least significant bit that is set */
2271 bit
= (enum ieee80211_radiotap_type
)
2272 (bit0
+ BITNO_32(present
^ next_present
));
2274 if (print_radiotap_field(&cpacker
, bit
, &flags
, &state
, presentflags
) != 0)
2280 if (flags
& IEEE80211_RADIOTAP_F_DATAPAD
)
2281 pad
= 1; /* Atheros padding */
2282 if (flags
& IEEE80211_RADIOTAP_F_FCS
)
2283 fcslen
= 4; /* FCS at end of packet */
2284 return len
+ ieee802_11_print(p
+ len
, length
- len
, caplen
- len
, pad
,
2295 ieee802_11_avs_radio_print(const u_char
*p
, u_int length
, u_int caplen
)
2297 u_int32_t caphdr_len
;
2304 caphdr_len
= EXTRACT_32BITS(p
+ 4);
2305 if (caphdr_len
< 8) {
2307 * Yow! The capture header length is claimed not
2308 * to be large enough to include even the version
2309 * cookie or capture header length!
2315 if (caplen
< caphdr_len
) {
2320 return caphdr_len
+ ieee802_11_print(p
+ caphdr_len
,
2321 length
- caphdr_len
, caplen
- caphdr_len
, 0, 0);
2324 #define PRISM_HDR_LEN 144
2326 #define WLANCAP_MAGIC_COOKIE_BASE 0x80211000
2327 #define WLANCAP_MAGIC_COOKIE_V1 0x80211001
2328 #define WLANCAP_MAGIC_COOKIE_V2 0x80211002
2331 * For DLT_PRISM_HEADER; like DLT_IEEE802_11, but with an extra header,
2332 * containing information such as radio information, which we
2335 * If, however, the packet begins with WLANCAP_MAGIC_COOKIE_V1 or
2336 * WLANCAP_MAGIC_COOKIE_V2, it's really DLT_IEEE802_11_RADIO_AVS
2337 * (currently, on Linux, there's no ARPHRD_ type for
2338 * DLT_IEEE802_11_RADIO_AVS, as there is a ARPHRD_IEEE80211_PRISM
2339 * for DLT_PRISM_HEADER, so ARPHRD_IEEE80211_PRISM is used for
2340 * the AVS header, and the first 4 bytes of the header are used to
2341 * indicate whether it's a Prism header or an AVS header).
2344 prism_if_print(const struct pcap_pkthdr
*h
, const u_char
*p
)
2346 u_int caplen
= h
->caplen
;
2347 u_int length
= h
->len
;
2355 msgcode
= EXTRACT_32BITS(p
);
2356 if (msgcode
== WLANCAP_MAGIC_COOKIE_V1
||
2357 msgcode
== WLANCAP_MAGIC_COOKIE_V2
)
2358 return ieee802_11_avs_radio_print(p
, length
, caplen
);
2360 if (caplen
< PRISM_HDR_LEN
) {
2365 return PRISM_HDR_LEN
+ ieee802_11_print(p
+ PRISM_HDR_LEN
,
2366 length
- PRISM_HDR_LEN
, caplen
- PRISM_HDR_LEN
, 0, 0);
2370 * For DLT_IEEE802_11_RADIO; like DLT_IEEE802_11, but with an extra
2371 * header, containing information such as radio information.
2374 ieee802_11_radio_if_print(const struct pcap_pkthdr
*h
, const u_char
*p
)
2376 return ieee802_11_radio_print(p
, h
->len
, h
->caplen
);
2380 * For DLT_IEEE802_11_RADIO_AVS; like DLT_IEEE802_11, but with an
2381 * extra header, containing information such as radio information,
2382 * which we currently ignore.
2385 ieee802_11_radio_avs_if_print(const struct pcap_pkthdr
*h
, const u_char
*p
)
2387 return ieee802_11_avs_radio_print(p
, h
->len
, h
->caplen
);