2 * Routines for Wireless LAN (IEEE 802.11) dissection
3 * Copyright 2000, Axis Communications AB
4 * Inquiries/bugreports should be sent to Johan.Jorgensen@axis.com
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * Copied from README.developer
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 * The following people helped me by pointing out bugs etc. Thank you!
34 * Magnus Hultman-Persson
38 * 09/12/2003 - Added dissection of country information tag
40 * Ritchie<at>tipsybottle.com
42 * 03/22/2004 - Added dissection of RSN IE
43 * Jouni Malinen <jkmaline@cc.hut.fi>
45 * 10/24/2005 - Add dissection for 802.11e
46 * Zhu Yi <yi.zhu@intel.com>
48 * Dutin Johnson - 802.11n and portions of 802.11k and 802.11ma
49 * dustin@dustinj.us & dustin.johnson@cacetech.com
51 * 04/21/2008 - Added dissection for 802.11p
52 * Arada Systems <http://www.aradasystems.com>
65 #include <epan/bitswap.h>
66 #include <epan/proto.h>
67 #include <epan/packet.h>
68 #include <epan/addr_resolv.h>
69 #include <epan/strutil.h>
70 #include <epan/prefs.h>
71 #include <epan/reassemble.h>
72 #include "packet-ipx.h"
73 #include "packet-llc.h"
74 #include "packet-ieee80211.h"
75 #include <epan/etypes.h>
76 #include <epan/greproto.h>
78 #include <epan/crc32.h>
80 #include <epan/emem.h>
81 #include <epan/crypt/wep-wpadefs.h>
86 #include "packet-wps.h"
89 #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
92 /* Defragment fragmented 802.11 datagrams */
93 static gboolean wlan_defragment = TRUE;
95 /* call subdissector for retransmitted frames */
96 static gboolean wlan_subdissector = TRUE;
98 /* Check for the presence of the 802.11 FCS */
99 static gboolean wlan_check_fcs = FALSE;
101 /* Ignore vendor-specific HT elements */
102 static gboolean wlan_ignore_draft_ht = FALSE;
104 /* Ignore the WEP bit; assume packet is decrypted */
105 #define WLAN_IGNORE_WEP_NO 0
106 #define WLAN_IGNORE_WEP_WO_IV 1
107 #define WLAN_IGNORE_WEP_W_IV 2
108 static gint wlan_ignore_wep = WLAN_IGNORE_WEP_NO;
110 /* Tables for reassembly of fragments. */
111 static GHashTable *wlan_fragment_table = NULL;
112 static GHashTable *wlan_reassembled_table = NULL;
114 /* Statistical data */
115 static struct _wlan_stats wlan_stats;
117 /* Stuff for the WEP decoder */
118 static gboolean enable_decryption = FALSE;
119 static void init_wepkeys(void);
121 #ifndef HAVE_AIRPDCAP
122 static gint num_wepkeys = 0;
123 static guint8 **wep_keys = NULL;
124 static int *wep_keylens = NULL;
125 static tvbuff_t *try_decrypt_wep(tvbuff_t *tvb, guint32 offset, guint32 len);
126 static int wep_decrypt(guint8 *buf, guint32 len, int key_override);
128 /* Davide Schiera (2006-11-26): created function to decrypt WEP and WPA/WPA2 */
129 static tvbuff_t *try_decrypt(tvbuff_t *tvb, guint32 offset, guint32 len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer);
132 static int weak_iv(guchar *iv);
133 #define SSWAP(a,b) {guint8 tmp = s[a]; s[a] = s[b]; s[b] = tmp;}
135 /* #define USE_ENV */
136 /* When this is set, an unlimited number of WEP keys can be set in the
139 WIRESHARK_WEPKEYNUM=##
140 WIRESHARK_WEPKEY1=aa:bb:cc:dd:...
141 WIRESHARK_WEPKEY2=aa:bab:cc:dd:ee:...
143 ... you get the idea.
145 otherwise you're limited to specifying four keys in the preference system.
149 static char *wep_keystr[MAX_ENCRYPTION_KEYS];
152 typedef struct mimo_control
158 guint8 coefficient_size;
159 guint8 codebook_info;
160 guint8 remaining_matrix_segment;
163 mimo_control_t get_mimo_control (tvbuff_t *tvb, int offset);
164 int add_mimo_csi_matrices_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl);
165 int add_mimo_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl);
166 int add_mimo_compressed_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl);
168 /* ************************************************************************* */
169 /* Miscellaneous Constants */
170 /* ************************************************************************* */
171 #define SHORT_STR 256
173 /* ************************************************************************* */
174 /* Define some very useful macros that are used to analyze frame types etc. */
175 /* ************************************************************************* */
178 * Fetch the frame control field and swap it if needed. "fcf" and "tvb"
179 * must be valid variables.
181 #define FETCH_FCF(off) (wlan_broken_fc ? \
182 BSWAP16(tvb_get_letohs(tvb, off)) : \
183 tvb_get_letohs(tvb, off))
186 * Extract the protocol version from the frame control field
188 #define FCF_PROT_VERSION(x) ((x) & 0x3)
191 * Extract the frame type from the frame control field.
193 #define FCF_FRAME_TYPE(x) (((x) & 0xC) >> 2)
196 * Extract the frame subtype from the frame control field.
198 #define FCF_FRAME_SUBTYPE(x) (((x) & 0xF0) >> 4)
201 * Convert the frame type and subtype from the frame control field into
202 * one of the MGT_, CTRL_, or DATA_ values.
204 #define COMPOSE_FRAME_TYPE(x) (((x & 0x0C)<< 2)+FCF_FRAME_SUBTYPE(x)) /* Create key to (sub)type */
207 * The subtype field of a data frame is, in effect, composed of 4 flag
208 * bits - CF-Ack, CF-Poll, Null (means the frame doesn't actually have
209 * any data), and QoS.
211 #define DATA_FRAME_IS_CF_ACK(x) ((x) & 0x01)
212 #define DATA_FRAME_IS_CF_POLL(x) ((x) & 0x02)
213 #define DATA_FRAME_IS_NULL(x) ((x) & 0x04)
214 #define DATA_FRAME_IS_QOS(x) ((x) & 0x08)
217 * Extract the flags from the frame control field.
219 #define FCF_FLAGS(x) (((x) & 0xFF00) >> 8)
222 * Bits from the flags field.
224 #define FLAG_TO_DS 0x01
225 #define FLAG_FROM_DS 0x02
226 #define FLAG_MORE_FRAGMENTS 0x04
227 #define FLAG_RETRY 0x08
228 #define FLAG_POWER_MGT 0x10
229 #define FLAG_MORE_DATA 0x20
230 #define FLAG_PROTECTED 0x40
231 #define FLAG_ORDER 0x80
234 * Test bits in the flags field.
237 * XXX - Only HAVE_FRAGMENTS, IS_PROTECTED, and IS_STRICTLY_ORDERED
238 * are in use. Should the rest be removed?
240 #define IS_TO_DS(x) ((x) & FLAG_TO_DS)
241 #define IS_FROM_DS(x) ((x) & FLAG_FROM_DS)
242 #define HAVE_FRAGMENTS(x) ((x) & FLAG_MORE_FRAGMENTS)
243 #define IS_RETRY(x) ((x) & FLAG_RETRY)
244 #define POWER_MGT_STATUS(x) ((x) & FLAG_POWER_MGT)
245 #define HAS_MORE_DATA(x) ((x) & FLAG_MORE_DATA)
246 #define IS_PROTECTED(x) ((x) & FLAG_PROTECTED)
247 #define IS_STRICTLY_ORDERED(x) ((x) & FLAG_ORDER)
250 * Extract subfields from the flags field.
252 #define FLAGS_DS_STATUS(x) ((x) & (FLAG_FROM_DS|FLAG_TO_DS))
255 * Extract an indication of the types of addresses in a data frame from
256 * the frame control field.
258 #define FCF_ADDR_SELECTOR(x) ((x) & ((FLAG_TO_DS|FLAG_FROM_DS) << 8))
260 #define DATA_ADDR_T1 0
261 #define DATA_ADDR_T2 (FLAG_FROM_DS << 8)
262 #define DATA_ADDR_T3 (FLAG_TO_DS << 8)
263 #define DATA_ADDR_T4 ((FLAG_TO_DS|FLAG_FROM_DS) << 8)
266 * Extract the fragment number and sequence number from the sequence
269 #define SEQCTL_FRAGMENT_NUMBER(x) ((x) & 0x000F)
270 #define SEQCTL_SEQUENCE_NUMBER(x) (((x) & 0xFFF0) >> 4)
273 * Extract subfields from the QoS control field.
275 #define QOS_TID(x) ((x) & 0x000F)
276 #define QOS_PRIORITY(x) ((x) & 0x0007)
277 #define QOS_EOSP(x) (((x) & 0x0010) >> 4) /* end of service period */
278 #define QOS_ACK_POLICY(x) (((x) & 0x0060) >> 5)
279 #define QOS_AMSDU_PRESENT(x) (((x) & 0x0080) >> 6)
280 #define QOS_FIELD_CONTENT(x) (((x) & 0xFF00) >> 8)
282 #define QOS_FLAG_EOSP 0x10
285 * Extract subfields from the result of QOS_FIELD_CONTENT().
287 #define QOS_PS_BUF_STATE(x) (((x) & 0x02) >> 1)
288 #define QOS_PS_BUF_AC(x) (((x) & 0x0C) >> 2)
289 #define QOS_PS_BUF_LOAD(x) (((x) & 0xF0) >> 4)
292 * Extract subfields from the HT Control field.
293 * .11n D-1.10 & D-2.0, 7.1.3.5a, 32 bits.
295 #define HTC_LAC(htc) ((htc) & 0xFF)
296 #define HTC_LAC_MAI(htc) (((htc) >> 2) & 0xF)
297 #define HTC_IS_ASELI(htc) (HTC_LAC_MAI(htc) == 0xE)
298 #define HTC_LAC_MAI_MRQ(htc) ((HTC_LAC_MAI(htc)) & 0x1)
299 #define HTC_LAC_MAI_MSI(htc) ((HTC_LAC_MAI(htc) >> 1) & 0x7)
300 #define HTC_LAC_MFSI(htc) (((htc) >> 4) & 0x7)
301 #define HTC_LAC_ASEL_CMD(htc) (((htc) >> 9) & 0x7)
302 #define HTC_LAC_ASEL_DATA(htc) (((htc) >> 12) & 0xF)
303 #define HTC_LAC_MFB(htc) (((htc) >> 9) & 0x7F)
304 #define HTC_CAL_POS(htc) (((htc) >> 16) & 0x3)
305 #define HTC_CAL_SEQ(htc) (((htc) >> 18) & 0x3)
306 #define HTC_CSI_STEERING(htc) (((htc) >> 22) & 0x3)
307 #define HTC_NDP_ANN(htc) (((htc) >> 24) & 0x1)
308 #define HTC_AC_CONSTRAINT(htc) (((htc) >> 30) & 0x1)
309 #define HTC_RDG_MORE_PPDU(htc) (((htc) >> 31) & 0x1)
312 * Extract the association ID from the value in an association ID field.
314 #define ASSOC_ID(x) ((x) & 0x3FFF)
317 * Extract subfields from the key octet in WEP-encrypted frames.
319 #define KEY_OCTET_WEP_KEY(x) (((x) & 0xC0) >> 6)
322 * Extract subfields from TS Info field.
324 #define TSI_TYPE(x) (((x) & 0x000001) >> 0)
325 #define TSI_TSID(x) (((x) & 0x00001E) >> 1)
326 #define TSI_DIR(x) (((x) & 0x000060) >> 5)
327 #define TSI_ACCESS(x) (((x) & 0x000180) >> 7)
328 #define TSI_AGG(x) (((x) & 0x000200) >> 9)
329 #define TSI_APSD(x) (((x) & 0x000400) >> 10)
330 #define TSI_UP(x) (((x) & 0x003800) >> 11)
331 #define TSI_ACK(x) (((x) & 0x00C000) >> 14)
332 #define TSI_SCHED(x) (((x) & 0x010000) >> 16)
333 #define TSI_RESERVED(x) (((x) & 0xFE0000) >> 17)
335 #define KEY_EXTIV 0x20
339 /* ************************************************************************* */
340 /* Constants used to identify cooked frame types */
341 /* ************************************************************************* */
342 #define MGT_FRAME 0x00 /* Frame type is management */
343 #define CONTROL_FRAME 0x01 /* Frame type is control */
344 #define DATA_FRAME 0x02 /* Frame type is Data */
346 #define DATA_SHORT_HDR_LEN 24
347 #define DATA_LONG_HDR_LEN 30
348 #define MGT_FRAME_HDR_LEN 24 /* Length of Managment frame-headers */
351 * COMPOSE_FRAME_TYPE() values for management frames.
353 #define MGT_ASSOC_REQ 0x00 /* association request */
354 #define MGT_ASSOC_RESP 0x01 /* association response */
355 #define MGT_REASSOC_REQ 0x02 /* reassociation request */
356 #define MGT_REASSOC_RESP 0x03 /* reassociation response */
357 #define MGT_PROBE_REQ 0x04 /* Probe request */
358 #define MGT_PROBE_RESP 0x05 /* Probe response */
359 #define MGT_MEASUREMENT_PILOT 0x06 /* Measurement Pilot */
360 #define MGT_BEACON 0x08 /* Beacon frame */
361 #define MGT_ATIM 0x09 /* ATIM */
362 #define MGT_DISASS 0x0A /* Disassociation */
363 #define MGT_AUTHENTICATION 0x0B /* Authentication */
364 #define MGT_DEAUTHENTICATION 0x0C /* Deauthentication */
365 #define MGT_ACTION 0x0D /* Action */
366 #define MGT_ACTION_NO_ACK 0x0E /* Action No Ack */
367 #define MGT_ARUBA_WLAN 0x0F /* Aruba WLAN Specific */
370 * COMPOSE_FRAME_TYPE() values for control frames.
372 #define CTRL_CONTROL_WRAPPER 0x17 /* Control Wrapper */
373 #define CTRL_BLOCK_ACK_REQ 0x18 /* Block ack Request */
374 #define CTRL_BLOCK_ACK 0x19 /* Block ack */
375 #define CTRL_PS_POLL 0x1A /* power-save poll */
376 #define CTRL_RTS 0x1B /* request to send */
377 #define CTRL_CTS 0x1C /* clear to send */
378 #define CTRL_ACKNOWLEDGEMENT 0x1D /* acknowledgement */
379 #define CTRL_CFP_END 0x1E /* contention-free period end */
380 #define CTRL_CFP_ENDACK 0x1F /* contention-free period end/ack */
383 * COMPOSE_FRAME_TYPE() values for data frames.
385 #define DATA 0x20 /* Data */
386 #define DATA_CF_ACK 0x21 /* Data + CF-Ack */
387 #define DATA_CF_POLL 0x22 /* Data + CF-Poll */
388 #define DATA_CF_ACK_POLL 0x23 /* Data + CF-Ack + CF-Poll */
389 #define DATA_NULL_FUNCTION 0x24 /* Null function (no data) */
390 #define DATA_CF_ACK_NOD 0x25 /* CF-Ack (no data) */
391 #define DATA_CF_POLL_NOD 0x26 /* CF-Poll (No data) */
392 #define DATA_CF_ACK_POLL_NOD 0x27 /* CF-Ack + CF-Poll (no data) */
394 #define DATA_QOS_DATA 0x28 /* QoS Data */
395 #define DATA_QOS_DATA_CF_ACK 0x29 /* QoS Data + CF-Ack */
396 #define DATA_QOS_DATA_CF_POLL 0x2A /* QoS Data + CF-Poll */
397 #define DATA_QOS_DATA_CF_ACK_POLL 0x2B /* QoS Data + CF-Ack + CF-Poll */
398 #define DATA_QOS_NULL 0x2C /* QoS Null */
399 #define DATA_QOS_CF_POLL_NOD 0x2E /* QoS CF-Poll (No Data) */
400 #define DATA_QOS_CF_ACK_POLL_NOD 0x2F /* QoS CF-Ack + CF-Poll (No Data) */
403 /* ************************************************************************* */
404 /* Macros used to extract information about fixed fields */
405 /* ************************************************************************* */
406 #define ESS_SET(x) ((x) & 0x0001)
407 #define IBSS_SET(x) ((x) & 0x0002)
411 /* ************************************************************************* */
412 /* Logical field codes (dissector's encoding of fixed fields) */
413 /* ************************************************************************* */
414 #define FIELD_TIMESTAMP 0x01 /* 64-bit timestamp */
415 #define FIELD_BEACON_INTERVAL 0x02 /* 16-bit beacon interval */
416 #define FIELD_CAP_INFO 0x03 /* Add capability information tree */
417 #define FIELD_AUTH_ALG 0x04 /* Authentication algorithm used */
418 #define FIELD_AUTH_TRANS_SEQ 0x05 /* Authentication sequence number */
419 #define FIELD_CURRENT_AP_ADDR 0x06
420 #define FIELD_LISTEN_IVAL 0x07
421 #define FIELD_REASON_CODE 0x08
422 #define FIELD_ASSOC_ID 0x09
423 #define FIELD_STATUS_CODE 0x0A
424 #define FIELD_CATEGORY_CODE 0x0B /* Management action category */
425 #define FIELD_ACTION_CODE 0x0C /* Management action code */
426 #define FIELD_DIALOG_TOKEN 0x0D /* Management action dialog token */
427 #define FIELD_WME_ACTION_CODE 0x0E /* Management notification action code */
428 #define FIELD_WME_DIALOG_TOKEN 0x0F /* Management notification dialog token */
429 #define FIELD_WME_STATUS_CODE 0x10 /* Management notification setup response status code */
430 #define FIELD_QOS_ACTION_CODE 0x11
431 #define FIELD_QOS_TS_INFO 0x12
432 #define FIELD_DLS_ACTION_CODE 0x13
433 #define FIELD_DST_MAC_ADDR 0X14 /* DLS destination MAC address */
434 #define FIELD_SRC_MAC_ADDR 0X15 /* DLS source MAC address */
435 #define FIELD_DLS_TIMEOUT 0X16 /* DLS timeout value */
436 #define FIELD_SCHEDULE_INFO 0X17 /* Schedule Info field */
437 #define FIELD_ACTION 0X18 /* Action field */
438 #define FIELD_BLOCK_ACK_ACTION_CODE 0x19
439 #define FIELD_QOS_INFO_AP 0x1A
440 #define FIELD_QOS_INFO_STA 0x1B
441 #define FIELD_BLOCK_ACK_PARAM 0x1C
442 #define FIELD_BLOCK_ACK_TIMEOUT 0x1D
443 #define FIELD_BLOCK_ACK_SSC 0x1E
444 #define FIELD_DELBA_PARAM_SET 0x1F
445 #define FIELD_MAX_REG_PWR 0x20
446 #define FIELD_MEASUREMENT_PILOT_INT 0x21
447 #define FIELD_COUNTRY_STR 0x22
448 #define FIELD_MAX_TX_PWR 0x23
449 #define FIELD_TX_PWR_USED 0x24
450 #define FIELD_TRANSCEIVER_NOISE_FLOOR 0x25
451 #define FIELD_DS_PARAM_SET 0x26
452 #define FIELD_CHANNEL_WIDTH 0x27
453 #define FIELD_SM_PWR_CNTRL 0x28
454 #define FIELD_PCO_PHASE_CNTRL 0x29
455 #define FIELD_PSMP_PARAM_SET 0x2A
456 #define FIELD_PSMP_STA_INFO 0x2B
457 #define FIELD_MIMO_CNTRL 0x2C
458 #define FIELD_ANT_SELECTION 0x2D
459 #define FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT 0x2E
460 #define FIELD_HT_INFORMATION 0x2F
461 #define FIELD_HT_ACTION_CODE 0x30
463 /* ************************************************************************* */
464 /* Logical field codes (IEEE 802.11 encoding of tags) */
465 /* ************************************************************************* */
466 #define TAG_SSID 0x00
467 #define TAG_SUPP_RATES 0x01
468 #define TAG_FH_PARAMETER 0x02
469 #define TAG_DS_PARAMETER 0x03
470 #define TAG_CF_PARAMETER 0x04
472 #define TAG_IBSS_PARAMETER 0x06
473 #define TAG_COUNTRY_INFO 0x07
474 #define TAG_FH_HOPPING_PARAMETER 0x08
475 #define TAG_FH_HOPPING_TABLE 0x09
476 #define TAG_REQUEST 0x0A
477 #define TAG_QBSS_LOAD 0x0B
478 #define TAG_EDCA_PARAM_SET 0x0C
479 #define TAG_TSPEC 0x0D
480 #define TAG_TCLAS 0x0E
481 #define TAG_SCHEDULE 0x0F
482 #define TAG_CHALLENGE_TEXT 0x10
483 #define TAG_POWER_CONSTRAINT 0x20
484 #define TAG_POWER_CAPABILITY 0x21
485 #define TAG_TPC_REQUEST 0x22
486 #define TAG_TPC_REPORT 0x23
487 #define TAG_SUPPORTED_CHANNELS 0x24
488 #define TAG_CHANNEL_SWITCH_ANN 0x25
489 #define TAG_MEASURE_REQ 0x26
490 #define TAG_MEASURE_REP 0x27
491 #define TAG_QUIET 0x28
492 #define TAG_IBSS_DFS 0x29
493 #define TAG_ERP_INFO 0x2A
494 #define TAG_TS_DELAY 0x2B
495 #define TAG_TCLAS_PROCESS 0x2C
496 #define TAG_HT_CAPABILITY 0x2D /* IEEE Stc 802.11n/D2.0 */
497 #define TAG_QOS_CAPABILITY 0x2E
498 #define TAG_ERP_INFO_OLD 0x2F /* IEEE Std 802.11g/D4.0 */
499 #define TAG_RSN_IE 0x30
501 #define TAG_EXT_SUPP_RATES 0x32
502 #define TAG_NEIGHBOR_REPORT 0x34
503 #define TAG_HT_INFO 0x3D /* IEEE Stc 802.11n/D2.0 */
504 #define TAG_SECONDARY_CHANNEL_OFFSET 0x3E /* IEEE Stc 802.11n/D1.10/D2.0 */
505 #define TAG_WSIE 0x45 /* tag of the Wave Service Information (802.11p) */
506 #define TAG_20_40_BSS_CO_EX 0x48 /* IEEE P802.11n/D6.0 */
507 #define TAG_20_40_BSS_INTOL_CH_REP 0x49 /* IEEE P802.11n/D6.0 */
508 #define TAG_OVERLAP_BSS_SCAN_PAR 0x49 /* IEEE P802.11n/D6.0 */
509 #define TAG_EXTENDED_CAPABILITIES 0X7F /* IEEE Stc 802.11n/D1.10/D2.0 */
510 #define TAG_AGERE_PROPRIETARY 0x80
511 #define TAG_CISCO_UNKNOWN_1 0x85 /* Cisco Compatible eXtensions */
512 #define TAG_CISCO_UNKNOWN_2 0x88 /* Cisco Compatible eXtensions? */
513 #define TAG_CISCO_UNKNOWN_3 0x95 /* Cisco Compatible eXtensions */
514 #define TAG_VENDOR_SPECIFIC_IE 0xDD
515 #define TAG_SYMBOL_PROPRIETARY 0xAD
516 #if 0 /* Not yet assigned tag numbers by ANA */
517 #define TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT 0xFF
518 #define TAG_SUPPORTED_REGULATORY_CLASSES 0xFE
521 #define WPA_OUI (const guint8 *) "\x00\x50\xF2"
522 #define RSN_OUI (const guint8 *) "\x00\x0F\xAC"
523 #define WME_OUI (const guint8 *) "\x00\x50\xF2"
524 #define PRE_11N_OUI (const guint8 *) "\x00\x90\x4c" /* 802.11n pre 1 oui */
528 /* ************************************************************************* */
529 /* Wireless Access in Vehicular Environment IEEE 802.11p */
530 /* ************************************************************************* */
531 #define WAVE_ACID 0x0001
532 #define WAVE_ACM 0x0002
533 #define WAVE_ACF 0x0004
534 #define WAVE_PRIORITY 0x0008
535 #define WAVE_CHANNEL 0x0010
536 #define WAVE_IPV6ADDR 0x0020
537 #define WAVE_PEERMAC 0x0040
541 /* ************************************************************************* */
542 /* Frame types, and their names */
543 /* ************************************************************************* */
544 static const value_string frame_type_subtype_vals[] = {
545 {MGT_ASSOC_REQ, "Association Request"},
546 {MGT_ASSOC_RESP, "Association Response"},
547 {MGT_REASSOC_REQ, "Reassociation Request"},
548 {MGT_REASSOC_RESP, "Reassociation Response"},
549 {MGT_PROBE_REQ, "Probe Request"},
550 {MGT_PROBE_RESP, "Probe Response"},
551 {MGT_MEASUREMENT_PILOT,"Measurement Pilot"},
552 {MGT_BEACON, "Beacon frame"},
554 {MGT_DISASS, "Disassociate"},
555 {MGT_AUTHENTICATION, "Authentication"},
556 {MGT_DEAUTHENTICATION, "Deauthentication"},
557 {MGT_ACTION, "Action"},
558 {MGT_ACTION_NO_ACK, "Action No Ack"},
559 {MGT_ARUBA_WLAN, "Aruba Management"},
561 {CTRL_CONTROL_WRAPPER, "Control Wrapper"},
562 {CTRL_BLOCK_ACK_REQ, "802.11 Block Ack Req"},
563 {CTRL_BLOCK_ACK, "802.11 Block Ack"},
564 {CTRL_PS_POLL, "Power-Save poll"},
565 {CTRL_RTS, "Request-to-send"},
566 {CTRL_CTS, "Clear-to-send"},
567 {CTRL_ACKNOWLEDGEMENT, "Acknowledgement"},
568 {CTRL_CFP_END, "CF-End (Control-frame)"},
569 {CTRL_CFP_ENDACK, "CF-End + CF-Ack (Control-frame)"},
572 {DATA_CF_ACK, "Data + CF-Ack"},
573 {DATA_CF_POLL, "Data + CF-Poll"},
574 {DATA_CF_ACK_POLL, "Data + CF-Ack + CF-Poll"},
575 {DATA_NULL_FUNCTION, "Null function (No data)"},
576 {DATA_CF_ACK_NOD, "Acknowledgement (No data)"},
577 {DATA_CF_POLL_NOD, "CF-Poll (No data)"},
578 {DATA_CF_ACK_POLL_NOD, "CF-Ack/Poll (No data)"},
579 {DATA_QOS_DATA, "QoS Data"},
580 {DATA_QOS_DATA_CF_ACK, "QoS Data + CF-Acknowledgment"},
581 {DATA_QOS_DATA_CF_POLL, "QoS Data + CF-Poll"},
582 {DATA_QOS_DATA_CF_ACK_POLL, "QoS Data + CF-Ack + CF-Poll"},
583 {DATA_QOS_NULL, "QoS Null function (No data)"},
584 {DATA_QOS_CF_POLL_NOD, "QoS CF-Poll (No Data)"},
585 {DATA_QOS_CF_ACK_POLL_NOD, "QoS CF-Ack + CF-Poll (No data)"},
589 /* ************************************************************************* */
590 /* 802.1D Tag Names */
591 /* ************************************************************************* */
592 static const char *qos_tags[8] = {
603 /* ************************************************************************* */
604 /* WME Access Category Names (by 802.1D Tag) */
605 /* ************************************************************************* */
606 static const char *qos_acs[8] = {
617 /* ************************************************************************* */
618 /* WME Access Category Names (by WME ACI) */
619 /* ************************************************************************* */
620 static const char *wme_acs[4] = {
627 /* ************************************************************************* */
628 /* Aruba Management Type */
629 /* ************************************************************************* */
630 static const value_string aruba_mgt_typevals[] = {
634 { 0x0004, "Ageout" },
635 { 0x0005, "Heartbeat" },
636 { 0x0006, "Deauth" },
637 { 0x0007, "Disassoc" },
638 { 0x0008, "Probe response" },
639 { 0x0009, "Tunnel update" },
640 { 0x000A, "Laser beam active" },
641 { 0x000B, "Client IP" },
642 { 0x000C, "Laser beam active v2" },
643 { 0x000D, "AP statistics" },
647 /*** Begin: Action Fixed Parameter ***/
648 #define CAT_SPECTRUM_MGMT 0
651 #define CAT_BLOCK_ACK 3
653 #define CAT_RADIO_MEASUREMENT 6
655 #define CAT_MGMT_NOTIFICATION 17
656 #define CAT_VENDOR_SPECIFIC 127
658 #define SM_ACTION_MEASUREMENT_REQUEST 0
659 #define SM_ACTION_MEASUREMENT_REPORT 1
660 #define SM_ACTION_TPC_REQUEST 2
661 #define SM_ACTION_TPC_REPORT 3
662 #define SM_ACTION_CHAN_SWITCH_ANNC 4
663 #define SM_ACTION_EXT_CHAN_SWITCH_ANNC 5
665 #define SM_ACTION_ADDTS_REQUEST 0
666 #define SM_ACTION_ADDTS_RESPONSE 1
667 #define SM_ACTION_DELTS 2
668 #define SM_ACTION_QOS_SCHEDULE 3
670 #define SM_ACTION_DLS_REQUEST 0
671 #define SM_ACTION_DLS_RESPONSE 1
672 #define SM_ACTION_DLS_TEARDOWN 2
674 #define BA_ADD_BLOCK_ACK_REQUEST 0
675 #define BA_ADD_BLOCK_ACK_RESPONSE 1
676 #define BA_DELETE_BLOCK_ACK 2
678 #define HT_ACTION_NOTIFY_CHAN_WIDTH 0
679 #define HT_ACTION_SM_PWR_SAVE 1
680 #define HT_ACTION_PSMP_ACTION 2
681 #define HT_ACTION_SET_PCO_PHASE 3
682 #define HT_ACTION_MIMO_CSI 4
683 #define HT_ACTION_MIMO_BEAMFORMING 5
684 #define HT_ACTION_MIMO_COMPRESSED_BEAMFORMING 6
685 #define HT_ACTION_ANT_SEL_FEEDBACK 7
686 #define HT_ACTION_HT_INFO_EXCHANGE 8
689 #define MRVL_ACTION_MESH_MANAGEMENT 1
691 #define MRVL_MESH_MGMT_ACTION_RREQ 0
692 #define MRVL_MESH_MGMT_ACTION_RREP 1
693 #define MRVL_MESH_MGMT_ACTION_RERR 2
694 #define MRVL_MESH_MGMT_ACTION_PLDM 3
696 /*** End: Action Fixed Parameter ***/
698 static int proto_wlan = -1;
699 static int proto_aggregate = -1;
700 static packet_info * g_pinfo;
702 static int proto_radio = -1;
703 static int proto_wlancap = -1;
704 static int proto_prism = -1;
706 /* ************************************************************************* */
707 /* Header field info values for radio information */
708 /* ************************************************************************* */
709 static int hf_mactime = -1;
710 static int hf_hosttime = -1;
711 static int hf_data_rate = -1;
712 static int hf_channel = -1;
713 static int hf_channel_frequency = -1;
714 static int hf_normrssi_antsignal = -1;
715 static int hf_dbm_antsignal = -1;
716 static int hf_rawrssi_antsignal = -1;
717 static int hf_normrssi_antnoise = -1;
718 static int hf_dbm_antnoise = -1;
719 static int hf_rawrssi_antnoise = -1;
720 static int hf_signal_strength = -1;
722 /* Prism radio header */
723 static int hf_prism_msgcode = -1;
724 static int hf_prism_msglen = -1;
725 static int hf_prism_rssi_data = -1;
726 static int hf_prism_sq_data = -1;
727 static int hf_prism_signal_data = -1;
728 static int hf_prism_noise_data = -1;
729 static int hf_prism_rate_data = -1;
730 static int hf_prism_istx_data = -1;
731 static int hf_prism_frmlen_data = -1;
733 /* AVS WLANCAP radio header */
734 static int hf_wlan_magic = -1;
735 static int hf_wlan_version = -1;
736 static int hf_wlan_length = -1;
737 static int hf_wlan_phytype = -1;
738 static int hf_wlan_antenna = -1;
739 static int hf_wlan_priority = -1;
740 static int hf_wlan_ssi_type = -1;
741 static int hf_wlan_ssi_signal = -1;
742 static int hf_wlan_ssi_noise = -1;
743 static int hf_wlan_preamble = -1;
744 static int hf_wlan_encoding = -1;
745 static int hf_wlan_sequence = -1;
746 static int hf_wlan_drops = -1;
747 static int hf_wlan_receiver_addr = -1;
748 static int hf_wlan_padding = -1;
750 /* ************************************************************************* */
751 /* Header field info values for FC-field */
752 /* ************************************************************************* */
753 static int hf_fc_field = -1;
754 static int hf_fc_proto_version = -1;
755 static int hf_fc_frame_type = -1;
756 static int hf_fc_frame_subtype = -1;
757 static int hf_fc_frame_type_subtype = -1;
759 static int hf_fc_flags = -1;
760 static int hf_fc_to_ds = -1;
761 static int hf_fc_from_ds = -1;
762 static int hf_fc_data_ds = -1;
764 static int hf_fc_more_frag = -1;
765 static int hf_fc_retry = -1;
766 static int hf_fc_pwr_mgt = -1;
767 static int hf_fc_more_data = -1;
768 static int hf_fc_protected = -1;
769 static int hf_fc_order = -1;
771 typedef struct retransmit_key {
778 static GHashTable *fc_analyse_retransmit_table = NULL;
779 static GHashTable *fc_first_frame_table = NULL;
781 static int hf_fc_analysis_retransmission = -1;
782 static int hf_fc_analysis_retransmission_frame = -1;
784 /* ************************************************************************* */
785 /* Header values for Duration/ID field */
786 /* ************************************************************************* */
787 static int hf_did_duration = -1;
788 static int hf_assoc_id = -1;
791 /* ************************************************************************* */
792 /* Header values for different address-fields (all 4 of them) */
793 /* ************************************************************************* */
794 static int hf_addr_da = -1; /* Destination address subfield */
795 static int hf_addr_sa = -1; /* Source address subfield */
796 static int hf_addr_ra = -1; /* Receiver address subfield */
797 static int hf_addr_ta = -1; /* Transmitter address subfield */
798 static int hf_addr_addr1 = -1;
799 static int hf_addr_bssid = -1; /* address is bssid */
801 static int hf_addr = -1; /* Source or destination address subfield */
804 /* ************************************************************************* */
805 /* Header values for QoS control field */
806 /* ************************************************************************* */
807 static int hf_qos_priority = -1;
808 static int hf_qos_ack_policy = -1;
809 static int hf_qos_amsdu_present = -1;
810 static int hf_qos_eosp = -1;
811 static int hf_qos_field_content = -1;
812 /*static int hf_qos_txop_limit = -1;*/
813 /* FIXME: hf_ values not defined
814 static int hf_qos_buf_state = -1;
815 static int hf_qos_buf_ac = -1;
816 static int hf_qos_buf_load = -1;
818 /*static int hf_qos_txop_dur_req = -1;
819 static int hf_qos_queue_size = -1;*/
821 /* ************************************************************************* */
822 /* Header values for HT control field (+HTC) */
823 /* ************************************************************************* */
824 /* 802.11nD-1.10 & 802.11nD-2.0 7.1.3.5a */
825 static int hf_htc = -1;
826 static int hf_htc_lac = -1;
827 static int hf_htc_lac_reserved = -1;
828 static int hf_htc_lac_trq = -1;
829 static int hf_htc_lac_mai_aseli = -1;
830 static int hf_htc_lac_mai_mrq = -1;
831 static int hf_htc_lac_mai_msi = -1;
832 static int hf_htc_lac_mai_reserved = -1;
833 static int hf_htc_lac_mfsi = -1;
834 static int hf_htc_lac_mfb = -1;
835 static int hf_htc_lac_asel_command = -1;
836 static int hf_htc_lac_asel_data = -1;
837 static int hf_htc_cal_pos = -1;
838 static int hf_htc_cal_seq = -1;
839 static int hf_htc_reserved1 = -1;
840 static int hf_htc_csi_steering = -1;
841 static int hf_htc_ndp_announcement = -1;
842 static int hf_htc_reserved2 = -1;
843 static int hf_htc_ac_constraint = -1;
844 static int hf_htc_rdg_more_ppdu = -1;
846 /* ************************************************************************* */
847 /* Header values for sequence number field */
848 /* ************************************************************************* */
849 static int hf_frag_number = -1;
850 static int hf_seq_number = -1;
852 /* ************************************************************************* */
853 /* Header values for Frame Check field */
854 /* ************************************************************************* */
855 static int hf_fcs = -1;
856 static int hf_fcs_good = -1;
857 static int hf_fcs_bad = -1;
859 /* ************************************************************************* */
860 /* Header values for reassembly */
861 /* ************************************************************************* */
862 static int hf_fragments = -1;
863 static int hf_fragment = -1;
864 static int hf_fragment_overlap = -1;
865 static int hf_fragment_overlap_conflict = -1;
866 static int hf_fragment_multiple_tails = -1;
867 static int hf_fragment_too_long_fragment = -1;
868 static int hf_fragment_error = -1;
869 static int hf_reassembled_in = -1;
872 static int proto_wlan_mgt = -1;
874 /* ************************************************************************* */
875 /* Header values for WAVE */
876 /* ************************************************************************* */
877 static int hf_pst_timingquality = -1;
878 static int hf_pst_providercount = -1;
879 static int hf_pst_length = -1;
880 static int hf_pst_contents = -1;
882 static int hf_pst_acid = -1;
883 static int hf_pst_acm_length = -1;
884 static int hf_pst_acm = -1;
885 static int hf_pst_acm_contents =-1;
886 static int hf_pst_acf = -1;
887 static int hf_pst_priority = -1;
888 static int hf_pst_ipv6addr = -1;
889 static int hf_pst_serviceport = -1;
890 static int hf_pst_addressing = -1;
891 static int hf_pst_macaddr = -1;
892 static int hf_pst_channel = -1;
894 static int hf_chan_noc = -1;
895 static int hf_chan_length = -1;
896 static int hf_chan_content = -1;
897 static int hf_chan_channel = -1;
898 static int hf_chan_adapt = -1;
899 static int hf_chan_rate = -1;
900 static int hf_chan_tx_pow = -1;
902 /* ************************************************************************* */
903 /* Fixed fields found in mgt frames */
904 /* ************************************************************************* */
905 static int ff_auth_alg = -1; /* Authentication algorithm field */
906 static int ff_auth_seq = -1; /* Authentication transaction sequence */
907 static int ff_current_ap = -1; /* Current AP MAC address */
908 static int ff_listen_ival = -1; /* Listen interval fixed field */
909 static int ff_timestamp = -1; /* 64 bit timestamp */
910 static int ff_beacon_interval = -1; /* 16 bit Beacon interval */
911 static int ff_assoc_id = -1; /* 16 bit AID field */
912 static int ff_reason = -1; /* 16 bit reason code */
913 static int ff_status_code = -1; /* Status code */
914 static int ff_category_code = -1; /* 8 bit Category code */
915 static int ff_action_code = -1; /* 8 bit Action code */
916 static int ff_dialog_token = -1; /* 8 bit Dialog token */
917 static int ff_wme_action_code = -1; /* Management notification action code */
918 static int ff_wme_status_code = -1; /* Management notification setup response status code */
919 static int ff_qos_action_code = -1;
920 static int ff_dls_action_code = -1;
921 static int ff_dst_mac_addr = -1; /* DLS destination MAC addressi */
922 static int ff_src_mac_addr = -1; /* DLS source MAC addressi */
923 static int ff_dls_timeout = -1; /* DLS timeout value */
925 /* Vendor specific */
926 static int ff_marvell_action_type = -1;
927 static int ff_marvell_mesh_mgt_action_code = -1;
928 static int ff_mesh_mgt_length = -1; /* Mesh Management length */
929 static int ff_mesh_mgt_mode = -1; /* Mesh Management mode */
930 static int ff_mesh_mgt_ttl = -1; /* Mesh Management TTL */
931 static int ff_mesh_mgt_dstcount = -1; /* Mesh Management dst count */
932 static int ff_mesh_mgt_hopcount = -1; /* Mesh Management hop count */
933 static int ff_mesh_mgt_rreqid = -1; /* Mesh Management RREQ ID */
934 static int ff_mesh_mgt_sa = -1; /* Mesh Management src addr */
935 static int ff_mesh_mgt_ssn = -1; /* Mesh Management src sequence number */
936 static int ff_mesh_mgt_metric = -1; /* Mesh Management metric */
937 static int ff_mesh_mgt_flags = -1; /* Mesh Management RREQ flags */
938 static int ff_mesh_mgt_da = -1; /* Mesh Management dst addr */
939 static int ff_mesh_mgt_dsn = -1; /* Mesh Management dst sequence number */
940 static int ff_mesh_mgt_lifetime = -1; /* Mesh Management lifetime */
943 /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/
944 static int ff_ba_action = -1;
945 /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/
947 /*** Begin: Block Ack Params Fixed Field - Dustin Johnson ***/
948 static int ff_block_ack_params = -1;
949 static int ff_block_ack_params_amsdu_permitted = -1;
950 static int ff_block_ack_params_policy = -1;
951 static int ff_block_ack_params_tid = -1;
952 static int ff_block_ack_params_buffer_size = -1;
953 /*** End: Block Ack Params Fixed Field - Dustin Johnson ***/
955 /*** Begin: Block Ack Timeout Fixed Field - Dustin Johnson ***/
956 static int ff_block_ack_timeout = -1;
957 /*** End: Block Ack Timeout Fixed Field - Dustin Johnson ***/
959 /*** Begin: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
960 static int ff_block_ack_ssc = -1;
961 static int ff_block_ack_ssc_fragment = -1;
962 static int ff_block_ack_ssc_sequence = -1;
963 /*** End: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
965 /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
966 static int ff_delba_param = -1;
967 static int ff_delba_param_reserved = -1;
968 static int ff_delba_param_init = -1;
969 static int ff_delba_param_tid = -1;
970 /*** End: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
972 /*** Begin: Max Regulation Power Fixed Field - Dustin Johnson ***/
973 static int ff_max_reg_pwr = -1;
974 /*** End: Max Regulation Power Fixed Field - Dustin Johnson ***/
976 /*** Begin: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
977 static int ff_measurement_pilot_int = -1;
978 /*** End: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
980 /*** Begin: Country String Fixed Field - Dustin Johnson ***/
981 static int ff_country_str = -1;
982 /*** End: Country String Fixed Field - Dustin Johnson ***/
984 /*** Begin: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
985 static int ff_max_tx_pwr = -1;
986 /*** End: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
988 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
989 static int ff_tx_pwr_used = -1;
990 /*** End: Transmit Power Used Fixed Field - Dustin Johnson ***/
992 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
993 static int ff_transceiver_noise_floor = -1;
994 /*** End: Transmit Power Used Fixed Field - Dustin Johnson ***/
996 /*** Begin: Channel Width Fixed Field - Dustin Johnson ***/
997 static int ff_channel_width = -1;
998 /*** End: Channel Width Fixed Field - Dustin Johnson ***/
1000 /*** Begin: QoS Information AP Fixed Field - Dustin Johnson ***/
1001 static int ff_qos_info_ap = -1;
1002 static int ff_qos_info_ap_edca_param_set_counter = -1;
1003 static int ff_qos_info_ap_q_ack = -1;
1004 static int ff_qos_info_ap_queue_req = -1;
1005 static int ff_qos_info_ap_txop_request = -1;
1006 static int ff_qos_info_ap_reserved = -1;
1007 /*** End: QoS Information AP Fixed Field - Dustin Johnson ***/
1009 /*** Begin: QoS Information STA Fixed Field - Dustin Johnson ***/
1010 static int ff_qos_info_sta = -1;
1011 static int ff_qos_info_sta_ac_vo = -1;
1012 static int ff_qos_info_sta_ac_vi = -1;
1013 static int ff_qos_info_sta_ac_bk = -1;
1014 static int ff_qos_info_sta_ac_be = -1;
1015 static int ff_qos_info_sta_q_ack = -1;
1016 static int ff_qos_info_sta_max_sp_len = -1;
1017 static int ff_qos_info_sta_more_data_ack = -1;
1018 /*** End: QoS Information STA Fixed Field - Dustin Johnson ***/
1020 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
1021 static int ff_sm_pwr_save = -1;
1022 static int ff_sm_pwr_save_enabled = -1;
1023 static int ff_sm_pwr_save_sm_mode = -1;
1024 static int ff_sm_pwr_save_reserved = -1;
1025 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
1027 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
1028 static int ff_pco_phase_cntrl = -1;
1029 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
1031 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
1032 static int ff_psmp_param_set = -1;
1033 static int ff_psmp_param_set_n_sta = -1;
1034 static int ff_psmp_param_set_more_psmp = -1;
1035 static int ff_psmp_param_set_psmp_sequence_duration = -1;
1036 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
1038 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
1039 static int ff_mimo_cntrl_nc_index = -1;
1040 static int ff_mimo_cntrl_nr_index = -1;
1041 static int ff_mimo_cntrl_channel_width = -1;
1042 static int ff_mimo_cntrl_grouping = -1;
1043 static int ff_mimo_cntrl_coefficient_size = -1;
1044 static int ff_mimo_cntrl_codebook_info = -1;
1045 static int ff_mimo_cntrl_remaining_matrix_segment = -1;
1046 static int ff_mimo_cntrl_reserved = -1;
1047 static int ff_mimo_cntrl_sounding_timestamp = -1;
1048 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
1050 /*** Begin: Antenna Selection Fixed Field - Dustin Johnson ***/
1051 static int ff_ant_selection = -1;
1052 static int ff_ant_selection_0 = -1;
1053 static int ff_ant_selection_1 = -1;
1054 static int ff_ant_selection_2 = -1;
1055 static int ff_ant_selection_3 = -1;
1056 static int ff_ant_selection_4 = -1;
1057 static int ff_ant_selection_5 = -1;
1058 static int ff_ant_selection_6 = -1;
1059 static int ff_ant_selection_7 = -1;
1060 /*** End: Antenna Selection Fixed Field - Dustin Johnson ***/
1062 /*** Begin: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
1063 static int ff_ext_channel_switch_announcement = -1;
1064 /*** End: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
1066 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
1067 static int ff_ht_info = -1;
1068 static int ff_ht_info_information_request = -1;
1069 static int ff_ht_info_40_mhz_intolerant = -1;
1070 static int ff_ht_info_sta_chan_width = -1;
1071 static int ff_ht_info_reserved = -1;
1072 /*** End: HT Information Fixed Field - Dustin Johnson ***/
1074 /*** Begin: HT Action Fixed Field - Dustin Johnson ***/
1075 static int ff_ht_action = -1;
1076 /*** End: HT Action Fixed Field - Dustin Johnson ***/
1078 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
1079 static int ff_psmp_sta_info = -1;
1080 static int ff_psmp_sta_info_dtt_start_offset = -1;
1081 static int ff_psmp_sta_info_dtt_duration = -1;
1082 static int ff_psmp_sta_info_sta_id = -1;
1083 static int ff_psmp_sta_info_utt_start_offset = -1;
1084 static int ff_psmp_sta_info_utt_duration = -1;
1085 static int ff_psmp_sta_info_reserved_small= -1;
1086 static int ff_psmp_sta_info_reserved_large = -1;
1087 static int ff_psmp_sta_info_psmp_multicast_id = -1;
1088 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
1090 /*** Begin: MIMO CSI Matrices Report - Dustin Johnson ***/
1091 static int ff_mimo_csi_snr = -1;
1092 /*** End: MIMO CSI Matrices Report - Dustin Johnson ***/
1094 /* ************************************************************************* */
1095 /* Flags found in the capability field (fixed field) */
1096 /* ************************************************************************* */
1097 static int ff_capture = -1;
1098 static int ff_cf_ess = -1;
1099 static int ff_cf_ibss = -1;
1100 static int ff_cf_sta_poll = -1; /* CF pollable status for a STA */
1101 static int ff_cf_ap_poll = -1; /* CF pollable status for an AP */
1102 static int ff_cf_privacy = -1;
1103 static int ff_cf_preamble = -1;
1104 static int ff_cf_pbcc = -1;
1105 static int ff_cf_agility = -1;
1106 static int ff_short_slot_time = -1;
1107 static int ff_dsss_ofdm = -1;
1108 static int ff_cf_spec_man = -1;
1109 static int ff_cf_apsd = -1;
1110 static int ff_cf_del_blk_ack = -1;
1111 static int ff_cf_imm_blk_ack = -1;
1113 /* ************************************************************************* */
1115 /* ************************************************************************* */
1116 static int amsdu_msdu_header_text = -1;
1119 /* ************************************************************************* */
1120 /* Tagged value format fields */
1121 /* ************************************************************************* */
1122 static int tag_number = -1;
1123 static int tag_length = -1;
1124 static int tag_interpretation = -1;
1125 static int tag_oui = -1;
1128 static int tim_length = -1;
1129 static int tim_dtim_count = -1;
1130 static int tim_dtim_period = -1;
1131 static int tim_bmapctl = -1;
1134 static int hf_fixed_parameters = -1; /* Protocol payload for management frames */
1135 static int hf_tagged_parameters = -1; /* Fixed payload item */
1136 static int hf_tagged_ssid = -1;
1137 static int hf_wep_iv = -1;
1138 static int hf_wep_iv_weak = -1;
1139 static int hf_tkip_extiv = -1;
1140 static int hf_ccmp_extiv = -1;
1141 static int hf_wep_key = -1;
1142 static int hf_wep_icv = -1;
1144 /*** Begin: Block Ack Request/Block Ack - Dustin Johnson***/
1145 static int hf_block_ack_request_control = -1;
1146 static int hf_block_ack_control = -1;
1147 static int hf_block_ack_control_ack_policy = -1;
1148 static int hf_block_ack_control_multi_tid = -1;
1149 static int hf_block_ack_control_compressed_bitmap = -1;
1150 static int hf_block_ack_control_reserved = -1;
1152 static int hf_block_ack_control_basic_tid_info = -1;
1153 static int hf_block_ack_control_compressed_tid_info = -1;
1154 static int hf_block_ack_control_multi_tid_info = -1;
1156 static int hf_tag_measure_request_measurement_mode = -1;
1157 static int hf_tag_measure_request_bssid = -1;
1158 static int hf_tag_measure_request_reporting_condition = -1;
1159 static int hf_tag_measure_request_threshold_offset_unsigned = -1;
1160 static int hf_tag_measure_request_threshold_offset_signed = -1;
1162 static int hf_tag_measure_request_report_mac = -1;
1164 static int hf_tag_measure_request_group_id = -1;
1166 static int hf_block_ack_multi_tid_info = -1;
1167 static int hf_block_ack_request_type = -1;
1168 static int hf_block_ack_multi_tid_reserved = -1;
1169 static int hf_block_ack_multi_tid_value = -1;
1170 static int hf_block_ack_type = -1;
1171 /*** End: Block Ack Request/Block Ack - Dustin Johnson***/
1173 static int ht_cap = -1;
1174 static int ht_vs_cap = -1;
1175 static int ht_ldpc_coding = -1;
1176 static int ht_chan_width = -1;
1177 static int ht_sm_pwsave = -1;
1178 static int ht_green = -1;
1179 static int ht_short20 = -1;
1180 static int ht_short40 = -1;
1181 static int ht_tx_stbc = -1;
1182 static int ht_rx_stbc = -1;
1183 static int ht_delayed_block_ack = -1;
1184 static int ht_max_amsdu = -1;
1185 static int ht_dss_cck_40 = -1;
1186 static int ht_psmp = -1;
1187 static int ht_40_mhz_intolerant = -1;
1188 static int ht_l_sig = -1;
1190 static int ampduparam = -1;
1191 static int ampduparam_vs = -1;
1192 static int ampduparam_mpdu = -1;
1193 static int ampduparam_mpdu_start_spacing = -1;
1194 static int ampduparam_reserved = -1;
1196 static int mcsset = -1;
1197 static int mcsset_vs = -1;
1198 static int mcsset_rx_bitmask_0to7 = -1;
1199 static int mcsset_rx_bitmask_8to15 = -1;
1200 static int mcsset_rx_bitmask_16to23 = -1;
1201 static int mcsset_rx_bitmask_24to31 = -1;
1202 static int mcsset_rx_bitmask_32 = -1;
1203 static int mcsset_rx_bitmask_33to38 = -1;
1204 static int mcsset_rx_bitmask_39to52 = -1;
1205 static int mcsset_rx_bitmask_53to76 = -1;
1206 static int mcsset_highest_data_rate = -1;
1207 static int mcsset_tx_mcs_set_defined = -1;
1208 static int mcsset_tx_rx_mcs_set_not_equal = -1;
1209 static int mcsset_tx_max_spatial_streams = -1;
1210 static int mcsset_tx_unequal_modulation = -1;
1212 static int htex_cap = -1;
1213 static int htex_vs_cap = -1;
1214 static int htex_pco = -1;
1215 static int htex_transtime = -1;
1216 static int htex_mcs = -1;
1217 static int htex_htc_support = -1;
1218 static int htex_rd_responder = -1;
1220 static int txbf = -1;
1221 static int txbf_vs = -1;
1222 static int txbf_cap = -1;
1223 static int txbf_rcv_ssc = -1;
1224 static int txbf_tx_ssc = -1;
1225 static int txbf_rcv_ndp = -1;
1226 static int txbf_tx_ndp = -1;
1227 static int txbf_impl_txbf = -1;
1228 static int txbf_calib = -1;
1229 static int txbf_expl_csi = -1;
1230 static int txbf_expl_uncomp_fm = -1;
1231 static int txbf_expl_comp_fm = -1;
1232 static int txbf_expl_bf_csi = -1;
1233 static int txbf_expl_uncomp_fm_feed = -1;
1234 static int txbf_expl_comp_fm_feed = -1;
1235 static int txbf_csi_num_bf_ant = -1;
1236 static int txbf_min_group = -1;
1237 static int txbf_uncomp_sm_bf_ant = -1;
1238 static int txbf_comp_sm_bf_ant = -1;
1239 static int txbf_csi_max_rows_bf = -1;
1240 static int txbf_chan_est = -1;
1241 static int txbf_resrv = -1;
1243 /*** Begin: 802.11n D1.10 - HT Information IE ***/
1244 static int ht_info_primary_channel = -1;
1246 static int ht_info_delimiter1 = -1;
1247 static int ht_info_secondary_channel_offset = -1;
1248 static int ht_info_channel_width = -1;
1249 static int ht_info_rifs_mode = -1;
1250 static int ht_info_psmp_stas_only = -1;
1251 static int ht_info_service_interval_granularity = -1;
1253 static int ht_info_delimiter2 = -1;
1254 static int ht_info_operating_mode = -1;
1255 static int ht_info_non_greenfield_sta_present = -1;
1256 static int ht_info_transmit_burst_limit = -1;
1257 static int ht_info_obss_non_ht_stas_present = -1;
1258 static int ht_info_reserved_1 = -1;
1260 static int ht_info_delimiter3 = -1;
1261 static int ht_info_reserved_2 = -1;
1262 static int ht_info_dual_beacon = -1;
1263 static int ht_info_dual_cts_protection = -1;
1264 static int ht_info_secondary_beacon = -1;
1265 static int ht_info_lsig_txop_protection_full_support = -1;
1266 static int ht_info_pco_active = -1;
1267 static int ht_info_pco_phase = -1;
1268 static int ht_info_reserved_3 = -1;
1269 /*** End: 802.11n D1.10 - HT Information IE ***/
1271 /*** Begin: 802.11n D1.10 - Secondary Channel Offset Tag - Dustin Johnson***/
1272 static int hf_tag_secondary_channel_offset = -1;
1273 /*** End: 802.11n D1.10 - Secondary Channel Offset Tag - Dustin Johnson***/
1275 /*** Begin: Power Capability Tag - Dustin Johnson ***/
1276 static int hf_tag_power_capability_min = -1;
1277 static int hf_tag_power_capability_max = -1;
1278 /*** End: Power Capability Tag - Dustin Johnson ***/
1280 static int hf_tag_tpc_report_trsmt_pow = -1;
1281 static int hf_tag_tpc_report_link_mrg = -1;
1283 /*** Begin: Power Capability Tag - Dustin Johnson ***/
1284 static int hf_tag_supported_channels = -1;
1285 static int hf_tag_supported_channels_first = -1;
1286 static int hf_tag_supported_channels_range = -1;
1287 /*** End: Power Capability Tag - Dustin Johnson ***/
1289 /*** Begin: Measurement Request Tag - Dustin Johnson***/
1290 static int hf_tag_measure_request_measurement_token = -1;
1291 static int hf_tag_measure_request_mode = -1;
1292 static int hf_tag_measure_request_mode_reserved1 = -1;
1293 static int hf_tag_measure_request_mode_enable = -1;
1294 static int hf_tag_measure_request_mode_request = -1;
1295 static int hf_tag_measure_request_mode_report = -1;
1296 static int hf_tag_measure_request_mode_reserved2 = -1;
1297 static int hf_tag_measure_request_type = -1;
1299 static int hf_tag_measure_request_channel_number = -1;
1300 static int hf_tag_measure_request_start_time = -1;
1301 static int hf_tag_measure_request_duration = -1;
1303 static int hf_tag_measure_request_regulatory_class = -1;
1304 static int hf_tag_measure_request_randomization_interval = -1;
1305 /*** End: Measurement Request Tag - Dustin Johnson***/
1307 /*** Begin: Measurement Report Tag - Dustin Johnson***/
1308 static int hf_tag_measure_report_measurement_token = -1;
1309 static int hf_tag_measure_report_mode = -1;
1310 static int hf_tag_measure_report_mode_late = -1;
1311 static int hf_tag_measure_report_mode_incapable = -1;
1312 static int hf_tag_measure_report_mode_refused = -1;
1313 static int hf_tag_measure_report_mode_reserved = -1;
1314 static int hf_tag_measure_report_type = -1;
1315 static int hf_tag_measure_report_channel_number = -1;
1316 static int hf_tag_measure_report_start_time = -1;
1317 static int hf_tag_measure_report_duration = -1;
1319 static int hf_tag_measure_basic_map_field = -1;
1320 static int hf_tag_measure_map_field_bss = -1;
1321 static int hf_tag_measure_map_field_odfm = -1;
1322 static int hf_tag_measure_map_field_unident_signal = -1;
1323 static int hf_tag_measure_map_field_radar = -1;
1324 static int hf_tag_measure_map_field_unmeasured = -1;
1325 static int hf_tag_measure_map_field_reserved = -1;
1327 static int hf_tag_measure_cca_busy_fraction = -1;
1329 static int hf_tag_measure_rpi_histogram_report = -1;
1330 static int hf_tag_measure_rpi_histogram_report_0 = -1;
1331 static int hf_tag_measure_rpi_histogram_report_1 = -1;
1332 static int hf_tag_measure_rpi_histogram_report_2 = -1;
1333 static int hf_tag_measure_rpi_histogram_report_3 = -1;
1334 static int hf_tag_measure_rpi_histogram_report_4 = -1;
1335 static int hf_tag_measure_rpi_histogram_report_5 = -1;
1336 static int hf_tag_measure_rpi_histogram_report_6 = -1;
1337 static int hf_tag_measure_rpi_histogram_report_7 = -1;
1339 static int hf_tag_measure_report_regulatory_class = -1;
1340 static int hf_tag_measure_report_channel_load = -1;
1341 static int hf_tag_measure_report_frame_info = -1;
1342 static int hf_tag_measure_report_frame_info_phy_type = -1;
1343 static int hf_tag_measure_report_frame_info_frame_type = -1;
1344 static int hf_tag_measure_report_rcpi = -1;
1345 static int hf_tag_measure_report_rsni = -1;
1346 static int hf_tag_measure_report_bssid = -1;
1347 static int hf_tag_measure_report_ant_id = -1;
1348 static int hf_tag_measure_report_parent_tsf = -1;
1349 /*** End: Measurement Report Tag - Dustin Johnson***/
1351 /*** Begin: Extended Capabilities Tag - Dustin Johnson ***/
1352 static int hf_tag_extended_capabilities = -1;
1353 static int hf_tag_extended_capabilities_b0 = -1;
1354 static int hf_tag_extended_capabilities_b1 = -1;
1355 static int hf_tag_extended_capabilities_b2 = -1;
1356 static int hf_tag_extended_capabilities_b3 = -1;
1357 /*** End: Extended Capabilities Tag - Dustin Johnson ***/
1359 /*** Begin: Neighbor Report Tag - Dustin Johnson ***/
1360 static int hf_tag_neighbor_report_bssid = -1;
1361 static int hf_tag_neighbor_report_bssid_info = -1;
1362 static int hf_tag_neighbor_report_bssid_info_reachability = -1;
1363 static int hf_tag_neighbor_report_bssid_info_security = -1;
1364 static int hf_tag_neighbor_report_bssid_info_key_scope = -1;
1365 /*static int hf_tag_neighbor_report_bssid_info_capability = -1; */ /* TODO Make this the parent tree item */
1366 static int hf_tag_neighbor_report_bssid_info_capability_spec_mng = -1;
1367 static int hf_tag_neighbor_report_bssid_info_capability_qos = -1;
1368 static int hf_tag_neighbor_report_bssid_info_capability_apsd = -1;
1369 static int hf_tag_neighbor_report_bssid_info_capability_radio_msnt = -1;
1370 static int hf_tag_neighbor_report_bssid_info_capability_dback = -1;
1371 static int hf_tag_neighbor_report_bssid_info_capability_iback = -1;
1372 static int hf_tag_neighbor_report_bssid_info_mobility_domain = -1;
1373 static int hf_tag_neighbor_report_bssid_info_high_throughput = -1;
1374 static int hf_tag_neighbor_report_bssid_info_reserved = -1;
1375 static int hf_tag_neighbor_report_reg_class = -1;
1376 static int hf_tag_neighbor_report_channel_number = -1;
1377 static int hf_tag_neighbor_report_phy_type = -1;
1378 /*** End: Neighbor Report Tag - Dustin Johnson ***/
1380 /*** Begin: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
1381 static int hf_tag_ext_channel_switch_announcement_switch_mode = -1;
1382 static int hf_tag_ext_channel_switch_announcement_new_reg_class = -1;
1383 static int hf_tag_ext_channel_switch_announcement_new_chan_number = -1;
1384 static int hf_tag_ext_channel_switch_announcement_switch_count = -1;
1385 /*** End: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
1387 /*** Begin: Supported Regulatory Classes Tag - Dustin Johnson ***/
1388 static int hf_tag_supported_reg_classes_current = -1;
1389 static int hf_tag_supported_reg_classes_alternate = -1;
1390 /*** End: Supported Regulatory Classes Tag - Dustin Johnson ***/
1392 /* 802.11n 7.3.2.48 */
1393 static int hta_cap = -1;
1394 static int hta_ext_chan_offset = -1;
1395 static int hta_rec_tx_width = -1;
1396 static int hta_rifs_mode = -1;
1397 static int hta_controlled_access = -1;
1398 static int hta_service_interval = -1;
1399 static int hta_operating_mode = -1;
1400 static int hta_non_gf_devices = -1;
1401 static int hta_basic_stbc_mcs = -1;
1402 static int hta_dual_stbc_protection = -1;
1403 static int hta_secondary_beacon = -1;
1404 static int hta_lsig_txop_protection = -1;
1405 static int hta_pco_active = -1;
1406 static int hta_pco_phase = -1;
1409 static int antsel = -1;
1410 static int antsel_vs = -1;
1411 static int antsel_b0 = -1;
1412 static int antsel_b1 = -1;
1413 static int antsel_b2 = -1;
1414 static int antsel_b3 = -1;
1415 static int antsel_b4 = -1;
1416 static int antsel_b5 = -1;
1417 static int antsel_b6 = -1;
1418 static int antsel_b7 = -1;
1420 static int rsn_cap = -1;
1421 static int rsn_cap_preauth = -1;
1422 static int rsn_cap_no_pairwise = -1;
1423 static int rsn_cap_ptksa_replay_counter = -1;
1424 static int rsn_cap_gtksa_replay_counter = -1;
1426 static int hf_aironet_ie_type = -1;
1427 static int hf_aironet_ie_version = -1;
1428 static int hf_aironet_ie_data = -1;
1429 static int hf_aironet_ie_qos_unk1 = -1;
1430 static int hf_aironet_ie_qos_paramset = -1;
1431 static int hf_aironet_ie_qos_val = -1;
1433 static int hf_marvell_ie_type = -1;
1434 static int hf_marvell_ie_mesh_subtype = -1;
1435 static int hf_marvell_ie_mesh_version = -1;
1436 static int hf_marvell_ie_mesh_active_proto_id = -1;
1437 static int hf_marvell_ie_mesh_active_metric_id = -1;
1438 static int hf_marvell_ie_mesh_cap = -1;
1439 static int hf_marvell_ie_data = -1;
1441 /*QBSS - Version 1,2,802.11e*/
1443 static int hf_qbss2_cal = -1;
1444 static int hf_qbss2_gl = -1;
1445 static int hf_qbss_cu = -1;
1446 static int hf_qbss2_cu = -1;
1447 static int hf_qbss_scount = -1;
1448 static int hf_qbss2_scount = -1;
1449 static int hf_qbss_version = -1;
1450 static int hf_qbss_adc = -1;
1452 static int hf_ts_info = -1;
1453 static int hf_tsinfo_type = -1;
1454 static int hf_tsinfo_tsid = -1;
1455 static int hf_tsinfo_dir = -1;
1456 static int hf_tsinfo_access = -1;
1457 static int hf_tsinfo_agg = -1;
1458 static int hf_tsinfo_apsd = -1;
1459 static int hf_tsinfo_up = -1;
1460 static int hf_tsinfo_ack = -1;
1461 static int hf_tsinfo_sched = -1;
1462 static int tspec_nor_msdu = -1;
1463 static int tspec_max_msdu = -1;
1464 static int tspec_min_srv = -1;
1465 static int tspec_max_srv = -1;
1466 static int tspec_inact_int = -1;
1467 static int tspec_susp_int = -1;
1468 static int tspec_srv_start = -1;
1469 static int tspec_min_data = -1;
1470 static int tspec_mean_data = -1;
1471 static int tspec_peak_data = -1;
1472 static int tspec_burst_size = -1;
1473 static int tspec_delay_bound = -1;
1474 static int tspec_min_phy = -1;
1475 static int tspec_surplus = -1;
1476 static int tspec_medium = -1;
1477 static int ts_delay = -1;
1478 static int hf_class_type = -1;
1479 static int hf_class_mask = -1;
1480 static int hf_ether_type = -1;
1481 static int hf_tclas_process = -1;
1482 static int hf_sched_info = -1;
1483 static int hf_sched_srv_start = -1;
1484 static int hf_sched_srv_int = -1;
1485 static int hf_sched_spec_int = -1;
1486 static int hf_action = -1;
1487 static int cf_version = -1;
1488 static int cf_ipv4_src = -1;
1489 static int cf_ipv4_dst = -1;
1490 static int cf_src_port = -1;
1491 static int cf_dst_port = -1;
1492 static int cf_dscp = -1;
1493 static int cf_protocol = -1;
1494 static int cf_ipv6_src = -1;
1495 static int cf_ipv6_dst = -1;
1496 static int cf_flow = -1;
1497 static int cf_tag_type = -1;
1498 static int cf_aruba = -1;
1499 static int cf_aruba_hb_seq = -1;
1500 static int cf_aruba_mtu = -1;
1502 /* ************************************************************************* */
1503 /* Protocol trees */
1504 /* ************************************************************************* */
1505 static gint ett_80211 = -1;
1506 static gint ett_proto_flags = -1;
1507 static gint ett_cap_tree = -1;
1508 static gint ett_fc_tree = -1;
1509 static gint ett_cntrl_wrapper_fc = -1;
1510 static gint ett_cntrl_wrapper_payload = -1;
1511 static gint ett_fragments = -1;
1512 static gint ett_fragment = -1;
1513 static gint ett_block_ack = -1;
1516 static gint ett_80211_mgt = -1;
1517 static gint ett_fixed_parameters = -1;
1518 static gint ett_tagged_parameters = -1;
1519 static gint ett_qos_parameters = -1;
1520 static gint ett_qos_ps_buf_state = -1;
1521 static gint ett_wep_parameters = -1;
1523 static gint ett_rsn_cap_tree = -1;
1525 static gint ett_ht_cap_tree = -1;
1526 static gint ett_ampduparam_tree = -1;
1527 static gint ett_mcsset_tree = -1;
1528 static gint ett_mcsbit_tree = -1;
1529 static gint ett_htex_cap_tree = -1;
1530 static gint ett_txbf_tree = -1;
1531 static gint ett_antsel_tree = -1;
1532 static gint ett_hta_cap_tree = -1;
1533 static gint ett_hta_cap1_tree = -1;
1534 static gint ett_hta_cap2_tree = -1;
1535 static gint ett_htc_tree = -1;
1537 /*** Start: 802.11n D1.10 - HT Information IE - Dustin Johnson ***/
1538 static gint ett_ht_info_delimiter1_tree = -1;
1539 static gint ett_ht_info_delimiter2_tree = -1;
1540 static gint ett_ht_info_delimiter3_tree = -1;
1541 /*** End: 802.11n D1.10 - HT Information IE - Dustin Johnson ***/
1543 /*** Start: 802.11n D1.10 - Tag Measure Request IE - Dustin Johnson ***/
1544 static gint ett_tag_measure_request_tree = -1;
1545 /*** End: 802.11n D1.10 - Tag Measure Request IE - Dustin Johnson ***/
1547 static gint ett_tag_ex_cap = -1;
1549 /*** Begin: Supported Channels Tag - Dustin Johnson ***/
1550 static gint ett_tag_supported_channels = -1;
1551 /*** End: Supported Channels Tag - Dustin Johnson ***/
1553 /*** Begin: Neighbor Report Tag - Dustin Johnson ***/
1554 static gint ett_tag_neighbor_report_bssid_info_tree = -1;
1555 static gint ett_tag_neighbor_report_bssid_info_capability_tree = -1;
1556 static gint ett_tag_neighbor_report_sub_tag_tree = -1;
1557 /*** End: Neighbor Report Tag - Dustin Johnson ***/
1559 /*** Begin: Block Ack Timeout Fixed Field - Dustin Johnson ***/
1560 static gint ett_ff_ba_param_tree = -1;
1561 static gint ett_ff_ba_ssc_tree = -1;
1562 /*** End: Block Ack Timeout Fixed Field - Dustin Johnson ***/
1564 /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
1565 static gint ett_ff_delba_param_tree = -1;
1566 /*** End: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
1568 /*** Begin: QoS Information AP/STA Fixed Field - Dustin Johnson ***/
1569 static gint ett_ff_qos_info = -1;
1570 /*** End: QoS Information AP/STA Fixed Field - Dustin Johnson ***/
1572 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
1573 static gint ett_ff_sm_pwr_save = -1;
1574 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
1576 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
1577 static gint ett_ff_psmp_param_set = -1;
1578 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
1580 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
1581 static gint ett_ff_mimo_cntrl = -1;
1582 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
1584 /*** Begin: Antenna Selection Fixed Field - Dustin Johnson ***/
1585 static gint ett_ff_ant_sel = -1;
1586 /*** End: Antenna Selection Fixed Field - Dustin Johnson ***/
1588 /*** Begin: MIMO Reports - Dustin Johnson ***/
1589 static gint ett_mimo_report = -1;
1590 /*** End: MIMO Reports - Dustin Johnson ***/
1592 /*** Begin: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
1593 static gint ett_ff_chan_switch_announce = -1;
1594 /*** End: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
1596 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
1597 static gint ett_ff_ht_info = -1;
1598 /*** End: HT Information Fixed Field - Dustin Johnson ***/
1600 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
1601 static gint ett_ff_psmp_sta_info = -1;
1602 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
1604 /*** Begin: A-MSDU Dissection - Dustin Johnson ***/
1605 static gint ett_msdu_aggregation_parent_tree = -1;
1606 static gint ett_msdu_aggregation_subframe_tree = -1;
1607 /*** End: A-MSDU Dissection - Dustin Johnson ***/
1609 /*** Begin: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
1610 static gint ett_pst_tree = -1;
1611 static gint ett_pst_cap_tree = -1;
1612 static gint ett_chan_noc_tree = -1;
1613 static gint ett_wave_chnl_tree = -1;
1615 /*** End: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
1617 static gint ett_80211_mgt_ie = -1;
1618 static gint ett_tsinfo_tree = -1;
1619 static gint ett_sched_tree = -1;
1621 static gint ett_fcs = -1;
1623 static gint ett_radio = -1;
1625 static const fragment_items frag_items = {
1630 &hf_fragment_overlap,
1631 &hf_fragment_overlap_conflict,
1632 &hf_fragment_multiple_tails,
1633 &hf_fragment_too_long_fragment,
1639 static enum_val_t wlan_ignore_wep_options[] = {
1640 { "no", "No", WLAN_IGNORE_WEP_NO },
1641 { "without_iv", "Yes - without IV", WLAN_IGNORE_WEP_WO_IV },
1642 { "with_iv", "Yes - with IV", WLAN_IGNORE_WEP_W_IV },
1646 static dissector_handle_t ieee80211_handle;
1647 static dissector_handle_t llc_handle;
1648 static dissector_handle_t ipx_handle;
1649 static dissector_handle_t eth_withoutfcs_handle;
1650 static dissector_handle_t data_handle;
1651 static dissector_handle_t wlancap_handle;
1653 static int wlan_tap = -1;
1655 /* Davide Schiera (2006-11-22): including AirPDcap project */
1656 #ifdef HAVE_AIRPDCAP
1657 #include <epan/crypt/airpdcap_ws.h>
1658 AIRPDCAP_CONTEXT airpdcap_ctx;
1662 /* Davide Schiera (2006-11-22) ---------------------------------------------- */
1665 /* ************************************************************************* */
1666 /* Return the length of the current header (in bytes) */
1667 /* ************************************************************************* */
1669 find_header_length (guint16 fcf, guint16 ctrl_fcf, gboolean is_ht)
1674 switch (FCF_FRAME_TYPE (fcf)) {
1677 if (is_ht && IS_STRICTLY_ORDERED(FCF_FLAGS(fcf)))
1678 return MGT_FRAME_HDR_LEN + 4;
1680 return MGT_FRAME_HDR_LEN;
1683 if (COMPOSE_FRAME_TYPE(fcf) == CTRL_CONTROL_WRAPPER) {
1690 switch (COMPOSE_FRAME_TYPE (cw_fcf)) {
1693 case CTRL_ACKNOWLEDGEMENT:
1699 case CTRL_CFP_ENDACK:
1700 case CTRL_BLOCK_ACK_REQ:
1701 case CTRL_BLOCK_ACK:
1704 return len + 4; /* XXX */
1707 len = (FCF_ADDR_SELECTOR(fcf) ==
1708 DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
1710 if (DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
1712 if (is_ht && IS_STRICTLY_ORDERED(FCF_FLAGS(fcf))) {
1724 mimo_control_t get_mimo_control (tvbuff_t *tvb, int offset)
1727 mimo_control_t output;
1729 mimo = tvb_get_letohs (tvb, offset);
1731 output.nc = (mimo & 0x0003) + 1;
1732 output.nr = ((mimo & 0x000C) >> 2) + 1;
1733 output.chan_width = (mimo & 0x0010) >> 4;
1734 output.coefficient_size = 4; /* XXX - Is this a good default? */
1736 switch ((mimo & 0x0060) >> 5)
1739 output.grouping = 1;
1743 output.grouping = 2;
1747 output.grouping = 4;
1751 output.grouping = 1;
1755 switch ((mimo & 0x0180) >> 7)
1758 output.coefficient_size = 4;
1762 output.coefficient_size = 5;
1766 output.coefficient_size = 6;
1770 output.coefficient_size = 8;
1774 output.codebook_info = (mimo & 0x0600) >> 9;
1775 output.remaining_matrix_segment = (mimo & 0x3800) >> 11;
1780 int get_mimo_na (guint8 nr, guint8 nc)
1782 if (nr == 2 && nc == 1){
1784 }else if (nr == 2 && nc == 2){
1786 }else if (nr == 3 && nc == 1){
1788 }else if (nr == 3 && nc == 2){
1790 }else if (nr == 3 && nc == 3){
1792 }else if (nr == 4 && nc == 1){
1794 }else if (nr == 4 && nc == 2){
1796 }else if (nr == 4 && nc == 3){
1798 }else if (nr == 4 && nc == 4){
1805 int get_mimo_ns (gboolean chan_width, guint8 output_grouping)
1811 switch (output_grouping)
1829 switch (output_grouping)
1851 int add_mimo_csi_matrices_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
1853 proto_item *snr_item;
1854 proto_tree *snr_tree;
1855 int csi_matrix_size, start_offset;
1858 start_offset = offset;
1859 snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
1860 snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
1862 for (i=1; i <= mimo_cntrl.nr; i++)
1866 snr = tvb_get_guint8(tvb, offset);
1867 proto_tree_add_uint_format(snr_tree, ff_mimo_csi_snr, tvb, offset, 1, snr, "Channel %d - Signal to Noise Ratio: 0x%02X", i, snr);
1871 ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
1872 csi_matrix_size = ns*(3+(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size));
1873 csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
1874 proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "CSI Matrices");
1875 offset += csi_matrix_size;
1876 return offset - start_offset;
1879 int add_mimo_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
1881 proto_item *snr_item;
1882 proto_tree *snr_tree;
1883 int csi_matrix_size, start_offset;
1886 start_offset = offset;
1887 snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
1888 snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
1890 for (i=1; i <= mimo_cntrl.nc; i++)
1894 snr = tvb_get_guint8(tvb, offset);
1895 proto_tree_add_uint_format(snr_tree, ff_mimo_csi_snr, tvb, offset, 1, snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
1899 ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
1900 csi_matrix_size = ns*(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size);
1901 csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
1902 proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "Beamforming Feedback Matrices");
1903 offset += csi_matrix_size;
1904 return offset - start_offset;
1907 int add_mimo_compressed_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
1909 proto_item *snr_item;
1910 proto_tree *snr_tree;
1911 int csi_matrix_size, start_offset;
1914 start_offset = offset;
1915 snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
1916 snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
1918 for (i=1; i <= mimo_cntrl.nc; i++)
1922 snr = tvb_get_guint8(tvb, offset);
1923 proto_tree_add_uint_format(snr_tree, ff_mimo_csi_snr, tvb, offset, 1, snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
1927 na = get_mimo_na(mimo_cntrl.nr, mimo_cntrl.nc);
1928 ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
1929 csi_matrix_size = ns*(na*((mimo_cntrl.codebook_info+1)*2 + 2)/2);
1930 csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
1931 proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "Compressed Beamforming Feedback Matrices");
1932 offset += csi_matrix_size;
1933 return offset - start_offset;
1936 /* ************************************************************************* */
1937 /* This is the capture function used to update packet counts */
1938 /* ************************************************************************* */
1940 capture_ieee80211_common (const guchar * pd, int offset, int len,
1941 packet_counts * ld, gboolean fixed_length_header,
1942 gboolean datapad, gboolean is_ht)
1944 guint16 fcf, hdr_length;
1946 if (!BYTES_ARE_IN_FRAME(offset, len, 2)) {
1951 fcf = pletohs (&pd[offset]);
1953 if (IS_PROTECTED(FCF_FLAGS(fcf)) && wlan_ignore_wep == WLAN_IGNORE_WEP_NO) {
1958 switch (COMPOSE_FRAME_TYPE (fcf)) {
1960 case DATA: /* We got a data frame */
1961 case DATA_CF_ACK: /* Data with ACK */
1963 case DATA_CF_ACK_POLL:
1966 if (fixed_length_header)
1967 hdr_length = DATA_LONG_HDR_LEN;
1969 hdr_length = find_header_length (fcf, 0, is_ht);
1971 hdr_length = roundup2(hdr_length, 4);
1972 /* I guess some bridges take Netware Ethernet_802_3 frames,
1973 which are 802.3 frames (with a length field rather than
1974 a type field, but with no 802.2 header in the payload),
1975 and just stick the payload into an 802.11 frame. I've seen
1976 captures that show frames of that sort.
1978 This means we have to do the same check for Netware 802.3 -
1979 or, if you will, "Netware 802.11" - that we do in the
1980 Ethernet dissector, i.e. checking for 0xffff as the first
1981 four bytes of the payload and, if we find it, treating it
1983 if (!BYTES_ARE_IN_FRAME(offset+hdr_length, len, 2)) {
1987 if (pd[offset+hdr_length] == 0xff && pd[offset+hdr_length+1] == 0xff) {
1991 capture_llc (pd, offset + hdr_length, len, ld);
2003 * Handle 802.11 with a variable-length link-layer header.
2006 capture_ieee80211 (const guchar * pd, int offset, int len, packet_counts * ld)
2008 capture_ieee80211_common (pd, offset, len, ld, FALSE, FALSE, FALSE);
2012 * Handle 802.11 with a variable-length link-layer header and data padding.
2015 capture_ieee80211_datapad (const guchar * pd, int offset, int len,
2018 capture_ieee80211_common (pd, offset, len, ld, FALSE, TRUE, FALSE);
2022 * Handle 802.11 with a fixed-length link-layer header (padded to the
2026 capture_ieee80211_fixed (const guchar * pd, int offset, int len, packet_counts * ld)
2028 capture_ieee80211_common (pd, offset, len, ld, TRUE, FALSE, FALSE);
2032 * Handle an HT 802.11 with a variable-length link-layer header.
2035 capture_ieee80211_ht (const guchar * pd, int offset, int len, packet_counts * ld)
2037 capture_ieee80211_common (pd, offset, len, ld, FALSE, FALSE, TRUE);
2040 #define WLANCAP_MAGIC_COOKIE_BASE 0x80211000
2041 #define WLANCAP_MAGIC_COOKIE_V1 0x80211001
2042 #define WLANCAP_MAGIC_COOKIE_V2 0x80211002
2045 * Prism II-based wlan devices have a monitoring mode that sticks
2046 * a proprietary header on each packet with lots of good
2047 * information. This file is responsible for decoding that
2050 * Support by Tim Newsham
2052 * A value from the header.
2054 * It appears from looking at the linux-wlan-ng and Prism II HostAP
2055 * drivers, and various patches to the orinoco_cs drivers to add
2056 * Prism headers, that:
2058 * the "did" identifies what the value is (i.e., what it's the value
2061 * "status" is 0 if the value is present or 1 if it's absent;
2063 * "len" is the length of the value (always 4, in that code);
2065 * "data" is the value of the data (or 0 if not present).
2067 * Note: all of those values are in the *host* byte order of the machine
2068 * on which the capture was written.
2072 unsigned short status, len;
2077 * Header attached during Prism monitor mode.
2079 * At least according to one paper I've seen, the Prism 2.5 chip set
2082 * RSSI (receive signal strength indication) is "the total power
2083 * received by the radio hardware while receiving the frame,
2084 * including signal, interfereence, and background noise";
2086 * "silence value" is "the total power observed just before the
2087 * start of the frame".
2089 * None of the drivers I looked at supply the "rssi" or "sq" value,
2090 * but they do supply "signal" and "noise" values, along with a "rate"
2091 * value that's 1/5 of the raw value from what is presumably a raw
2092 * HFA384x frame descriptor, with the comment "set to 802.11 units",
2093 * which presumably means the units are 500 Kb/s.
2095 * I infer from the current NetBSD "wi" driver that "signal" and "noise"
2096 * are adjusted dBm values, with the dBm value having 100 added to it
2097 * for the Prism II cards (although the NetBSD code has an XXX comment
2098 * for the #define for WI_PRISM_DBM_OFFSET) and 149 (with no XXX comment)
2099 * for the Orinoco cards.
2101 * XXX - what about other drivers that supply Prism headers, such as
2102 * old versions of the MadWifi driver?
2105 unsigned int msgcode, msglen;
2107 struct val_80211 hosttime, mactime, channel, rssi, sq, signal,
2108 noise, rate, istx, frmlen;
2112 capture_prism(const guchar *pd, int offset, int len, packet_counts *ld)
2116 if (!BYTES_ARE_IN_FRAME(offset, len, sizeof(guint32))) {
2121 /* Some captures with DLT_PRISM have the AVS WLAN header */
2122 cookie = pntohl(pd);
2123 if ((cookie == WLANCAP_MAGIC_COOKIE_V1) ||
2124 (cookie == WLANCAP_MAGIC_COOKIE_V2)) {
2125 capture_wlancap(pd, offset, len, ld);
2130 if (!BYTES_ARE_IN_FRAME(offset, len, (int)sizeof(struct prism_hdr))) {
2134 offset += sizeof(struct prism_hdr);
2136 /* 802.11 header follows */
2137 capture_ieee80211(pd, offset, len, ld);
2141 capture_wlancap(const guchar *pd, int offset, int len, packet_counts *ld)
2145 if (!BYTES_ARE_IN_FRAME(offset, len, sizeof(guint32)*2)) {
2150 length = pntohl(pd+sizeof(guint32));
2152 if (!BYTES_ARE_IN_FRAME(offset, len, length)) {
2159 /* 802.11 header follows */
2160 capture_ieee80211(pd, offset, len, ld);
2163 /* ************************************************************************* */
2164 /* Add the subtree used to store the fixed parameters */
2165 /* ************************************************************************* */
2167 get_fixed_parameter_tree (proto_tree * tree, tvbuff_t *tvb, int start, int size)
2169 proto_item *fixed_fields;
2171 proto_tree_add_uint_format (tree, hf_fixed_parameters, tvb, start,
2172 size, size, "Fixed parameters (%d bytes)",
2175 return proto_item_add_subtree (fixed_fields, ett_fixed_parameters);
2179 /* ************************************************************************* */
2180 /* Add the subtree used to store tagged parameters */
2181 /* ************************************************************************* */
2183 get_tagged_parameter_tree (proto_tree * tree, tvbuff_t *tvb, int start, int size)
2185 proto_item *tagged_fields;
2187 tagged_fields = proto_tree_add_uint_format (tree, hf_tagged_parameters,
2192 "Tagged parameters (%d bytes)",
2195 return proto_item_add_subtree (tagged_fields, ett_tagged_parameters);
2199 /* ************************************************************************* */
2200 /* Dissect and add fixed mgmt fields to protocol tree */
2201 /* ************************************************************************* */
2203 add_fixed_field(proto_tree * tree, tvbuff_t * tvb, int offset, int lfcode)
2205 const guint8 *dataptr;
2206 char out_buff[SHORT_STR];
2208 proto_item *cap_item;
2209 static proto_tree *cap_tree;
2215 case FIELD_TIMESTAMP:
2216 dataptr = tvb_get_ptr (tvb, offset, 8);
2217 memset (out_buff, 0, SHORT_STR);
2218 g_snprintf (out_buff, SHORT_STR, "0x%02X%02X%02X%02X%02X%02X%02X%02X",
2228 proto_tree_add_string (tree, ff_timestamp, tvb, offset, 8, out_buff);
2232 case FIELD_BEACON_INTERVAL:
2234 capability = tvb_get_letohs (tvb, offset);
2235 temp_double = (double)capability;
2236 temp_double = temp_double * 1024 / 1000000;
2237 proto_tree_add_double_format (tree, ff_beacon_interval, tvb, offset, 2,
2238 temp_double,"Beacon Interval: %f [Seconds]", temp_double);
2239 if (check_col (g_pinfo->cinfo, COL_INFO)) {
2240 col_append_fstr(g_pinfo->cinfo, COL_INFO, ", BI=%d", capability);
2246 case FIELD_CAP_INFO:
2248 capability = tvb_get_letohs (tvb, offset);
2250 cap_item = proto_tree_add_uint_format (tree, ff_capture,
2251 tvb, offset, 2, capability,
2252 "Capability Information: 0x%04X", capability);
2253 cap_tree = proto_item_add_subtree (cap_item, ett_cap_tree);
2254 proto_tree_add_boolean (cap_tree, ff_cf_ess, tvb, offset, 2, capability);
2255 proto_tree_add_boolean (cap_tree, ff_cf_ibss, tvb, offset, 2, capability);
2256 if (ESS_SET (capability) != 0) /* This is an AP */
2257 proto_tree_add_uint (cap_tree, ff_cf_ap_poll, tvb, offset, 2,
2259 else /* This is a STA */
2260 proto_tree_add_uint (cap_tree, ff_cf_sta_poll, tvb, offset, 2,
2263 proto_tree_add_boolean (cap_tree, ff_cf_privacy, tvb, offset, 2,
2265 proto_tree_add_boolean (cap_tree, ff_cf_preamble, tvb, offset, 2,
2267 proto_tree_add_boolean (cap_tree, ff_cf_pbcc, tvb, offset, 2,
2269 proto_tree_add_boolean (cap_tree, ff_cf_agility, tvb, offset, 2,
2271 proto_tree_add_boolean (cap_tree, ff_cf_spec_man, tvb, offset, 2,
2273 proto_tree_add_boolean (cap_tree, ff_short_slot_time, tvb, offset, 2,
2275 proto_tree_add_boolean (cap_tree, ff_cf_apsd, tvb, offset, 2,
2277 proto_tree_add_boolean (cap_tree, ff_dsss_ofdm, tvb, offset, 2,
2279 proto_tree_add_boolean (cap_tree, ff_cf_del_blk_ack, tvb, offset, 2,
2281 proto_tree_add_boolean (cap_tree, ff_cf_imm_blk_ack, tvb, offset, 2,
2286 case FIELD_AUTH_ALG:
2287 proto_tree_add_item (tree, ff_auth_alg, tvb, offset, 2, TRUE);
2291 case FIELD_AUTH_TRANS_SEQ:
2292 proto_tree_add_item (tree, ff_auth_seq, tvb, offset, 2, TRUE);
2296 case FIELD_CURRENT_AP_ADDR:
2297 proto_tree_add_item (tree, ff_current_ap, tvb, offset, 6, FALSE);
2301 case FIELD_LISTEN_IVAL:
2302 proto_tree_add_item (tree, ff_listen_ival, tvb, offset, 2, TRUE);
2306 case FIELD_REASON_CODE:
2307 proto_tree_add_item (tree, ff_reason, tvb, offset, 2, TRUE);
2311 case FIELD_ASSOC_ID:
2312 proto_tree_add_uint(tree, ff_assoc_id, tvb, offset, 2,
2313 ASSOC_ID(tvb_get_letohs(tvb,offset)));
2314 /* proto_tree_add_item (tree, ff_assoc_id, tvb, offset, 2, TRUE); */
2318 case FIELD_STATUS_CODE:
2319 proto_tree_add_item (tree, ff_status_code, tvb, offset, 2, TRUE);
2323 case FIELD_CATEGORY_CODE:
2324 proto_tree_add_item (tree, ff_category_code, tvb, offset, 1, TRUE);
2328 case FIELD_ACTION_CODE:
2329 proto_tree_add_item (tree, ff_action_code, tvb, offset, 1, TRUE);
2333 case FIELD_DIALOG_TOKEN:
2334 proto_tree_add_item (tree, ff_dialog_token, tvb, offset, 1, TRUE);
2338 case FIELD_WME_ACTION_CODE:
2339 proto_tree_add_item (tree, ff_wme_action_code, tvb, offset, 1, TRUE);
2343 case FIELD_WME_STATUS_CODE:
2344 proto_tree_add_item (tree, ff_wme_status_code, tvb, offset, 1, TRUE);
2348 case FIELD_QOS_ACTION_CODE:
2349 proto_tree_add_item (tree, ff_qos_action_code, tvb, offset, 1, TRUE);
2353 /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/
2354 case FIELD_BLOCK_ACK_ACTION_CODE:
2355 proto_tree_add_item (tree, ff_ba_action, tvb, offset, 1, TRUE);
2358 /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/
2360 /*** Begin: Block Ack Params Fixed Field - Dustin Johnson ***/
2361 case FIELD_BLOCK_ACK_PARAM:
2364 proto_item *param_item;
2365 proto_tree *param_tree;
2367 params = tvb_get_letohs (tvb, offset);
2369 param_item = proto_tree_add_uint(tree, ff_block_ack_params, tvb, offset, 2, params);
2370 param_tree = proto_item_add_subtree (param_item, ett_ff_ba_param_tree);
2372 proto_tree_add_boolean(param_tree, ff_block_ack_params_amsdu_permitted, tvb, offset, 1, params);
2373 proto_tree_add_boolean(param_tree, ff_block_ack_params_policy, tvb, offset, 1, params);
2374 proto_tree_add_uint(param_tree, ff_block_ack_params_tid, tvb, offset, 1, params);
2375 proto_tree_add_uint(param_tree, ff_block_ack_params_buffer_size, tvb, offset, 2, params);
2379 /*** End: Block Ack Params Fixed Field - Dustin Johnson ***/
2381 /*** Begin: Block Ack Timeout Fixed Field - Dustin Johnson ***/
2382 case FIELD_BLOCK_ACK_TIMEOUT:
2386 timeout = tvb_get_letohs (tvb, offset);
2387 proto_tree_add_uint(tree, ff_block_ack_timeout, tvb, offset, 2, timeout);
2391 /*** End: Block Ack Timeout Fixed Field - Dustin Johnson ***/
2393 /*** Begin: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
2394 case FIELD_BLOCK_ACK_SSC:
2397 proto_item *ssc_item;
2398 proto_tree *ssc_tree;
2400 ssc = tvb_get_letohs (tvb, offset);
2401 ssc_item = proto_tree_add_uint(tree, ff_block_ack_ssc, tvb, offset, 2, ssc);
2402 ssc_tree = proto_item_add_subtree (ssc_item, ett_ff_ba_ssc_tree);
2403 proto_tree_add_uint(ssc_tree, ff_block_ack_ssc_fragment, tvb, offset, 1, ssc);
2404 proto_tree_add_uint(ssc_tree, ff_block_ack_ssc_sequence, tvb, offset, 2, ssc);
2408 /*** End: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
2410 case FIELD_QOS_TS_INFO:
2412 proto_item *tsinfo_item;
2413 proto_tree *tsinfo_tree;
2416 tsinfo_item = proto_tree_add_item(tree, hf_ts_info, tvb,
2418 tsinfo_tree = proto_item_add_subtree(tsinfo_item, ett_tsinfo_tree);
2419 tsi = tvb_get_letoh24(tvb, offset);
2420 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_type, tvb,
2421 offset, 3, TSI_TYPE (tsi));
2422 if (TSI_TSID (tsi) < 8)
2424 proto_tree_add_text(tsinfo_tree, tvb, offset, 3,
2425 "TSID: %u (< 8 is invalid)", TSI_TSID (tsi));
2429 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_tsid, tvb,
2430 offset, 3, TSI_TSID (tsi));
2432 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_dir, tvb,
2433 offset, 3, TSI_DIR (tsi));
2434 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_access, tvb,
2435 offset, 3, TSI_ACCESS (tsi));
2436 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_agg, tvb,
2437 offset, 3, TSI_AGG (tsi));
2438 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_apsd, tvb,
2439 offset, 3, TSI_APSD (tsi));
2440 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_up, tvb,
2441 offset, 3, TSI_UP (tsi));
2442 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_ack, tvb,
2443 offset, 3, TSI_ACK (tsi));
2444 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_sched, tvb,
2445 offset, 3, TSI_SCHED (tsi));
2450 case FIELD_DLS_ACTION_CODE:
2451 proto_tree_add_item (tree, ff_dls_action_code, tvb, offset, 1, TRUE);
2455 case FIELD_DST_MAC_ADDR:
2456 proto_tree_add_item (tree, ff_dst_mac_addr, tvb, offset, 6, TRUE);
2460 case FIELD_SRC_MAC_ADDR:
2461 proto_tree_add_item (tree, ff_src_mac_addr, tvb, offset, 6, TRUE);
2465 case FIELD_DLS_TIMEOUT:
2466 proto_tree_add_item (tree, ff_dls_timeout, tvb, offset, 2, TRUE);
2470 /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
2471 case FIELD_DELBA_PARAM_SET:
2474 proto_item *param_item;
2475 proto_tree *param_tree;
2477 params = tvb_get_letohs (tvb, offset);
2479 param_item = proto_tree_add_uint(tree, ff_delba_param, tvb, offset, 2, params);
2480 param_tree = proto_item_add_subtree (param_item, ett_ff_ba_param_tree);
2482 proto_tree_add_uint(param_tree, ff_delba_param_reserved, tvb, offset, 2, params);
2483 proto_tree_add_boolean(param_tree, ff_delba_param_init, tvb, offset+1, 1, params);
2484 proto_tree_add_uint(param_tree, ff_delba_param_tid, tvb, offset+1, 1, params);
2488 /*** End: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
2490 /*** Begin: Max Regulation Power Fixed Field - Dustin Johnson ***/
2491 case FIELD_MAX_REG_PWR:
2492 proto_tree_add_uint(tree, ff_max_reg_pwr, tvb, offset, 2, tvb_get_letohs (tvb, offset));
2495 /*** End: Max Regulation Power Fixed Field - Dustin Johnson ***/
2497 /*** Begin: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
2498 case FIELD_MEASUREMENT_PILOT_INT:
2499 proto_tree_add_uint(tree, ff_measurement_pilot_int, tvb, offset, 2, tvb_get_letohs (tvb, offset));
2502 /*** End: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
2504 /*** Begin: Country String Fixed Field - Dustin Johnson ***/
2505 case FIELD_COUNTRY_STR:
2507 guint8 *country_string;
2509 country_string = tvb_get_ephemeral_string(tvb, offset, 3);
2510 proto_tree_add_string (tree, ff_country_str, tvb, offset, 3, (char *) country_string);
2513 /*** End: Country String Fixed Field - Dustin Johnson ***/
2515 /*** Begin: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
2516 case FIELD_MAX_TX_PWR:
2517 proto_tree_add_uint(tree, ff_max_tx_pwr, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
2520 /*** End: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
2522 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
2523 case FIELD_TX_PWR_USED:
2524 proto_tree_add_uint(tree, ff_tx_pwr_used, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
2527 /*** End: Transmit Power Used Fixed Field - Dustin Johnson ***/
2529 /*** Begin: Transceiver Noise Floor Fixed Field - Dustin Johnson ***/
2530 case FIELD_TRANSCEIVER_NOISE_FLOOR:
2531 proto_tree_add_uint(tree, ff_transceiver_noise_floor, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
2534 /*** End: Transceiver Noise Floor Fixed Field - Dustin Johnson ***/
2536 /*** Begin: Channel Width Fixed Field - Dustin Johnson ***/
2537 case FIELD_CHANNEL_WIDTH:
2538 proto_tree_add_item(tree, ff_channel_width, tvb, offset, 1, TRUE);
2541 /*** End: Channel Width Fixed Field - Dustin Johnson ***/
2543 /*** Begin: QoS Information AP Fixed Field - Dustin Johnson ***/
2544 case FIELD_QOS_INFO_AP:
2547 proto_item *info_item;
2548 proto_tree *info_tree;
2550 info = tvb_get_guint8 (tvb, offset);
2552 info_item = proto_tree_add_uint(tree, ff_qos_info_ap, tvb, offset, 1, info);
2553 info_tree = proto_item_add_subtree (info_item, ett_ff_qos_info);
2555 proto_tree_add_uint(info_tree, ff_qos_info_ap_edca_param_set_counter, tvb, offset, 1, info);
2556 proto_tree_add_uint(info_tree, ff_qos_info_ap_q_ack, tvb, offset, 1, info);
2557 proto_tree_add_boolean(info_tree, ff_qos_info_ap_queue_req, tvb, offset, 1, info);
2558 proto_tree_add_boolean(info_tree, ff_qos_info_ap_txop_request, tvb, offset, 1, info);
2559 proto_tree_add_boolean(info_tree, ff_qos_info_ap_reserved, tvb, offset, 1, info);
2563 /*** End: QoS Information AP Fixed Field - Dustin Johnson ***/
2565 /*** Begin: QoS Information STA Fixed Field - Dustin Johnson ***/
2566 case FIELD_QOS_INFO_STA:
2569 proto_item *info_item;
2570 proto_tree *info_tree;
2572 info = tvb_get_guint8 (tvb, offset);
2574 info_item = proto_tree_add_uint(tree, ff_qos_info_sta, tvb, offset, 1, info);
2575 info_tree = proto_item_add_subtree (info_item, ett_ff_qos_info);
2577 proto_tree_add_boolean(info_tree, ff_qos_info_sta_ac_vo, tvb, offset, 1, info);
2578 proto_tree_add_boolean(info_tree, ff_qos_info_sta_ac_vi, tvb, offset, 1, info);
2579 proto_tree_add_boolean(info_tree, ff_qos_info_sta_ac_bk, tvb, offset, 1, info);
2580 proto_tree_add_boolean(info_tree, ff_qos_info_sta_ac_be, tvb, offset, 1, info);
2581 proto_tree_add_boolean(info_tree, ff_qos_info_sta_q_ack, tvb, offset, 1, info);
2582 proto_tree_add_uint(info_tree, ff_qos_info_sta_max_sp_len, tvb, offset, 1, info);
2583 proto_tree_add_boolean(info_tree, ff_qos_info_sta_more_data_ack, tvb, offset, 1, info);
2588 /*** End: QoS Information STA Fixed Field - Dustin Johnson ***/
2590 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
2591 case FIELD_SM_PWR_CNTRL:
2594 proto_item *info_item;
2595 proto_tree *info_tree;
2597 info = tvb_get_guint8 (tvb, offset);
2599 info_item = proto_tree_add_uint(tree, ff_sm_pwr_save, tvb, offset, 1, info);
2600 info_tree = proto_item_add_subtree (info_item, ett_ff_sm_pwr_save);
2602 proto_tree_add_boolean(info_tree, ff_sm_pwr_save_enabled, tvb, offset, 1, info);
2603 proto_tree_add_boolean(info_tree, ff_sm_pwr_save_sm_mode, tvb, offset, 1, info);
2604 proto_tree_add_uint(info_tree, ff_sm_pwr_save_reserved, tvb, offset, 1, info);
2608 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
2610 /*** Begin: PCO Phase Control Fixed Field - Dustin Johnson ***/
2611 case FIELD_PCO_PHASE_CNTRL:
2612 proto_tree_add_item(tree, ff_pco_phase_cntrl, tvb, offset, 1, TRUE);
2615 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
2617 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
2618 case FIELD_PSMP_PARAM_SET:
2621 proto_item *param_item;
2622 proto_tree *param_tree;
2624 params = tvb_get_letohs (tvb, offset);
2626 param_item = proto_tree_add_uint(tree, ff_psmp_param_set, tvb, offset, 2, params);
2627 param_tree = proto_item_add_subtree (param_item, ett_ff_psmp_param_set);
2629 proto_tree_add_uint(param_tree, ff_psmp_param_set_n_sta, tvb, offset, 1, params & 0x000F);
2630 proto_tree_add_boolean(param_tree, ff_psmp_param_set_more_psmp, tvb, offset, 1, (params & 0x0010) >> 4);
2631 proto_tree_add_uint_format(param_tree, ff_psmp_param_set_psmp_sequence_duration, tvb, offset, 2,
2632 (params & 0xFFE0) >> 5, "PSMP Sequence Duration: %u [us]", ((params & 0xFFE0) >> 5) * 8);
2636 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
2638 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
2639 case FIELD_MIMO_CNTRL:
2643 proto_item *mimo_item;
2644 proto_tree *mimo_tree;
2646 mimo = tvb_get_letohs (tvb, offset);
2648 mimo_item = proto_tree_add_text(tree, tvb, offset, 2, "MIMO Control");
2649 mimo_tree = proto_item_add_subtree (mimo_item, ett_ff_mimo_cntrl);
2651 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_nc_index, tvb, offset, 1, mimo);
2652 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_nr_index, tvb, offset, 1, mimo);
2653 proto_tree_add_boolean(mimo_tree, ff_mimo_cntrl_channel_width, tvb, offset, 1, mimo);
2654 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_grouping, tvb, offset, 1, mimo);
2655 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_coefficient_size, tvb, offset, 2, mimo);
2656 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_codebook_info, tvb, offset+1, 1, mimo);
2657 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_remaining_matrix_segment, tvb, offset+1, 1, mimo);
2658 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_reserved, tvb, offset+1, 1, mimo);
2661 time = tvb_get_letohl (tvb, offset);
2662 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_sounding_timestamp, tvb, offset, 4, time);
2666 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
2668 /*** Begin: Antenna Selection Fixed Field - Dustin Johnson ***/
2669 case FIELD_ANT_SELECTION:
2672 proto_item *ant_item;
2673 proto_tree *ant_tree;
2675 ant = tvb_get_guint8 (tvb, offset);
2677 ant_item = proto_tree_add_uint(tree, ff_ant_selection, tvb, offset, 1, ant);
2678 ant_tree = proto_item_add_subtree (ant_item, ett_ff_ant_sel);
2680 proto_tree_add_uint(ant_tree, ff_ant_selection_0, tvb, offset, 1, ant);
2681 proto_tree_add_uint(ant_tree, ff_ant_selection_1, tvb, offset, 1, ant);
2682 proto_tree_add_uint(ant_tree, ff_ant_selection_2, tvb, offset, 1, ant);
2683 proto_tree_add_uint(ant_tree, ff_ant_selection_3, tvb, offset, 1, ant);
2684 proto_tree_add_uint(ant_tree, ff_ant_selection_4, tvb, offset, 1, ant);
2685 proto_tree_add_uint(ant_tree, ff_ant_selection_5, tvb, offset, 1, ant);
2686 proto_tree_add_uint(ant_tree, ff_ant_selection_6, tvb, offset, 1, ant);
2687 proto_tree_add_uint(ant_tree, ff_ant_selection_7, tvb, offset, 1, ant);
2692 /*** End: Antenna Selection Fixed Field - Dustin Johnson ***/
2694 /*** Begin: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
2695 case FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT:
2698 proto_item *chan_item;
2699 proto_tree *chan_tree;
2701 ext_chan = tvb_get_letohl (tvb, offset);
2703 chan_item = proto_tree_add_uint(tree, ff_ext_channel_switch_announcement, tvb, offset, 1, ext_chan);
2704 chan_tree = proto_item_add_subtree (chan_item, ett_ff_chan_switch_announce);
2706 proto_tree_add_uint(chan_tree, hf_tag_ext_channel_switch_announcement_switch_mode, tvb, offset++, 1, (ext_chan & 0x000000FF));
2707 proto_tree_add_uint(chan_tree, hf_tag_ext_channel_switch_announcement_new_reg_class, tvb, offset++, 1, (ext_chan & 0x0000FF00) >> 8);
2708 proto_tree_add_uint(chan_tree, hf_tag_ext_channel_switch_announcement_new_chan_number, tvb, offset++, 1, (ext_chan & 0x00FF0000) >> 16);
2709 proto_tree_add_uint(chan_tree, hf_tag_ext_channel_switch_announcement_switch_count, tvb, offset++, 1, (ext_chan & 0xFF000000) >> 24);
2713 /*** End: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
2715 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
2716 case FIELD_HT_INFORMATION:
2719 proto_item *ht_item;
2720 proto_tree *ht_tree;
2722 info = tvb_get_guint8 (tvb, offset);
2724 ht_item = proto_tree_add_uint(tree, ff_ht_info, tvb, offset, 1, info);
2725 ht_tree = proto_item_add_subtree (ht_item, ett_ff_ht_info);
2727 proto_tree_add_boolean(ht_tree, ff_ht_info_information_request, tvb, offset, 1, info);
2728 proto_tree_add_boolean(ht_tree, ff_ht_info_40_mhz_intolerant, tvb, offset, 1, info);
2729 proto_tree_add_boolean(ht_tree, ff_ht_info_sta_chan_width, tvb, offset, 1, info);
2730 proto_tree_add_uint(ht_tree, ff_ht_info_reserved, tvb, offset, 1, info);
2734 /*** End: HT Information Fixed Field - Dustin Johnson ***/
2736 /*** Begin: HT Action Fixed Field - Dustin Johnson ***/
2737 case FIELD_HT_ACTION_CODE:
2738 proto_tree_add_uint(tree, ff_ht_action, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
2741 /*** End: HT Action Fixed Field - Dustin Johnson ***/
2743 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
2744 case FIELD_PSMP_STA_INFO:
2748 #define INDIVIDUALLY_ADDRESSED 2
2751 guint32 info_medium;
2754 proto_item *psmp_item;
2755 proto_tree *psmp_tree;
2757 info_medium = tvb_get_letohl (tvb, offset);
2758 type = info_medium & 0x3;
2760 psmp_item = proto_tree_add_uint(tree, ff_psmp_sta_info, tvb, offset, 8, type);
2761 psmp_tree = proto_item_add_subtree (psmp_item, ett_ff_psmp_sta_info);
2767 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_start_offset, tvb, offset, 2, (info_medium & 0x00001FFC) >> 2);
2768 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_duration, tvb, offset+1, 2, (info_medium & 0x001FE000) >> 13);
2769 info_large = tvb_get_letoh64 (tvb, offset);
2770 proto_tree_add_uint64(psmp_tree, ff_psmp_sta_info_reserved_large, tvb, offset, 6, (info_large & G_GINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
2776 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_start_offset, tvb, offset, 2, (info_medium & 0x00001FFC) >> 2);
2777 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_duration, tvb, offset+1, 2, (info_medium & 0x001FE000) >> 13);
2778 info_large = tvb_get_letoh64 (tvb, offset);
2779 proto_tree_add_uint64(psmp_tree, ff_psmp_sta_info_psmp_multicast_id, tvb, offset, 6, (info_large & G_GINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
2783 case INDIVIDUALLY_ADDRESSED:
2785 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_start_offset, tvb, offset, 2, (info_medium & 0x00001FFC) >> 2);
2786 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_duration, tvb, offset+1, 2, (info_medium & 0x001FE000) >> 13);
2788 info_medium = tvb_get_letohl (tvb, offset);
2789 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_sta_id, tvb, offset, 3, (info_medium & 0x001FFFE0) >> 5);
2790 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_utt_start_offset, tvb, offset+2, 2, (info_medium & 0xFFE00000) >> 21);
2792 info_small = tvb_get_letohs (tvb, offset);
2793 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_utt_duration, tvb, offset, 2, info_small & 0x03FF);
2794 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_reserved_small, tvb, offset+1, 1, (info_small & 0xFC00) >> 10);
2801 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
2803 case FIELD_SCHEDULE_INFO:
2805 proto_item *sched_item;
2806 proto_tree *sched_tree;
2809 sched_item = proto_tree_add_item(tree, hf_sched_info,
2810 tvb, offset, 2, TRUE);
2811 sched_tree = proto_item_add_subtree(sched_item, ett_sched_tree);
2812 sched = tvb_get_letohs(tvb, offset);
2813 proto_tree_add_uint(sched_tree, hf_tsinfo_agg, tvb, offset,
2817 proto_tree_add_uint(sched_tree, hf_tsinfo_tsid, tvb, offset,
2818 2, (sched & 0x001E) >> 1);
2819 proto_tree_add_uint(sched_tree, hf_tsinfo_dir, tvb, offset,
2820 2, (sched & 0x0060) >> 5);
2829 proto_item *action_item;
2830 proto_tree *action_tree;
2832 action_item = proto_tree_add_item(tree, hf_action, tvb, offset, 1, TRUE);
2833 action_tree = proto_item_add_subtree(action_item, ett_sched_tree);
2835 switch (tvb_get_guint8(tvb, offset))
2837 case CAT_SPECTRUM_MGMT:
2839 switch (tvb_get_guint8(tvb, offset+1))
2841 case SM_ACTION_MEASUREMENT_REQUEST:
2842 case SM_ACTION_MEASUREMENT_REPORT:
2843 case SM_ACTION_TPC_REQUEST:
2844 case SM_ACTION_TPC_REPORT:
2845 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2846 add_fixed_field(action_tree, tvb, offset+1, FIELD_ACTION_CODE);
2847 add_fixed_field(action_tree, tvb, offset+2, FIELD_DIALOG_TOKEN);
2848 length += 3; /* Size of fixed fields */
2851 case SM_ACTION_CHAN_SWITCH_ANNC:
2852 case SM_ACTION_EXT_CHAN_SWITCH_ANNC:
2853 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2854 add_fixed_field(action_tree, tvb, offset+1, FIELD_ACTION_CODE);
2855 length += 2; /* Size of fixed fields */
2859 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2860 add_fixed_field(action_tree, tvb, offset+1, FIELD_ACTION_CODE);
2861 length += 2; /* Size of fixed fields */
2869 switch (tvb_get_guint8(tvb, offset+1))
2871 case SM_ACTION_ADDTS_REQUEST:
2872 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2873 add_fixed_field(action_tree, tvb, offset+1, FIELD_QOS_ACTION_CODE);
2874 add_fixed_field(action_tree, tvb, offset+2, FIELD_DIALOG_TOKEN);
2878 case SM_ACTION_ADDTS_RESPONSE:
2879 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2880 add_fixed_field(action_tree, tvb, offset+1, FIELD_QOS_ACTION_CODE);
2881 add_fixed_field(action_tree, tvb, offset+2, FIELD_DIALOG_TOKEN);
2882 add_fixed_field(action_tree, tvb, offset+3, FIELD_STATUS_CODE);
2886 case SM_ACTION_DELTS:
2887 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2888 add_fixed_field(action_tree, tvb, offset+1, FIELD_QOS_ACTION_CODE);
2889 add_fixed_field(action_tree, tvb, offset+2, FIELD_QOS_TS_INFO);
2890 add_fixed_field(action_tree, tvb, offset+5, FIELD_REASON_CODE);
2894 case SM_ACTION_QOS_SCHEDULE:
2895 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2896 add_fixed_field(action_tree, tvb, offset+1, FIELD_QOS_ACTION_CODE);
2901 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2902 length += 2; /* Size of fixed fields */
2910 switch (tvb_get_guint8(tvb, offset+1))
2912 case SM_ACTION_DLS_REQUEST:
2913 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2914 add_fixed_field(action_tree, tvb, offset+1, FIELD_DLS_ACTION_CODE);
2915 add_fixed_field(action_tree, tvb, offset+2, FIELD_DST_MAC_ADDR);
2916 add_fixed_field(action_tree, tvb, offset+8, FIELD_SRC_MAC_ADDR);
2917 add_fixed_field(action_tree, tvb, offset+14, FIELD_CAP_INFO);
2918 add_fixed_field(action_tree, tvb, offset+16, FIELD_DLS_TIMEOUT);
2922 case SM_ACTION_DLS_RESPONSE:
2923 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2924 add_fixed_field(action_tree, tvb, offset+1, FIELD_DLS_ACTION_CODE);
2925 add_fixed_field(action_tree, tvb, offset+2, FIELD_STATUS_CODE);
2926 add_fixed_field(action_tree, tvb, offset+4, FIELD_DST_MAC_ADDR);
2927 add_fixed_field(action_tree, tvb, offset+10, FIELD_SRC_MAC_ADDR);
2929 if (!ff_status_code)
2930 add_fixed_field(action_tree, tvb, offset+16, FIELD_CAP_INFO);
2933 case SM_ACTION_DLS_TEARDOWN:
2934 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2935 add_fixed_field(action_tree, tvb, offset+1, FIELD_DLS_ACTION_CODE);
2936 add_fixed_field(action_tree, tvb, offset+2, FIELD_DST_MAC_ADDR);
2937 add_fixed_field(action_tree, tvb, offset+8, FIELD_SRC_MAC_ADDR);
2938 add_fixed_field(action_tree, tvb, offset+14, FIELD_REASON_CODE);
2943 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2944 length += 2; /* Size of fixed fields */
2952 switch (tvb_get_guint8(tvb, offset+1))
2954 case BA_ADD_BLOCK_ACK_REQUEST:
2959 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2960 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_ACTION_CODE);
2961 offset += add_fixed_field(action_tree, tvb, offset, FIELD_DIALOG_TOKEN);
2962 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_PARAM);
2963 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_TIMEOUT);
2964 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
2965 length = offset - start; /* Size of fixed fields */
2968 case BA_ADD_BLOCK_ACK_RESPONSE:
2973 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2974 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_ACTION_CODE);
2975 offset += add_fixed_field(action_tree, tvb, offset, FIELD_DIALOG_TOKEN);
2976 offset += add_fixed_field(action_tree, tvb, offset, FIELD_STATUS_CODE);
2977 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_PARAM);
2978 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_TIMEOUT);
2979 length = offset - start; /* Size of fixed fields */
2982 case BA_DELETE_BLOCK_ACK:
2987 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2988 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_ACTION_CODE);
2989 offset += add_fixed_field(action_tree, tvb, offset, FIELD_DELBA_PARAM_SET);
2990 offset += add_fixed_field(action_tree, tvb, offset, FIELD_REASON_CODE);
2991 length = offset - start; /* Size of fixed fields */
2998 case CAT_MGMT_NOTIFICATION: /* Management notification frame */
3003 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3004 offset += add_fixed_field(action_tree, tvb, offset, FIELD_WME_ACTION_CODE);
3005 offset += add_fixed_field(action_tree, tvb, offset, FIELD_DIALOG_TOKEN);
3006 offset += add_fixed_field(action_tree, tvb, offset, FIELD_WME_STATUS_CODE);
3007 length = offset - start; /* Size of fixed fields */
3011 case CAT_VENDOR_SPECIFIC:/* Vendor Specific Category */
3015 const guint8 *tag_data_ptr;
3020 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3021 oui = tvb_get_ntoh24(tvb, offset);
3022 tag_data_ptr = tvb_get_ptr(tvb, offset, 3);
3023 proto_tree_add_bytes_format (action_tree, tag_oui, tvb, offset, 3,
3024 tag_data_ptr, "Vendor: %s", get_manuf_name(tag_data_ptr));
3028 octet = tvb_get_guint8(tvb, offset);
3029 proto_tree_add_item (action_tree, ff_marvell_action_type, tvb, offset, 1, TRUE);
3032 case MRVL_ACTION_MESH_MANAGEMENT:
3033 octet = tvb_get_guint8(tvb, offset);
3034 proto_tree_add_item (action_tree, ff_marvell_mesh_mgt_action_code, tvb, offset, 1, TRUE);
3037 case MRVL_MESH_MGMT_ACTION_RREQ:
3038 proto_tree_add_item (action_tree, ff_mesh_mgt_length, tvb, offset, 1, TRUE);
3040 proto_tree_add_item (action_tree, ff_mesh_mgt_mode, tvb, offset, 1, TRUE);
3042 proto_tree_add_item (tree, ff_mesh_mgt_hopcount, tvb, offset, 1, TRUE);
3044 proto_tree_add_item (tree, ff_mesh_mgt_ttl, tvb, offset, 1, TRUE);
3046 proto_tree_add_item (tree, ff_mesh_mgt_rreqid, tvb, offset, 4, TRUE);
3048 proto_tree_add_item (tree, ff_mesh_mgt_sa, tvb, offset, 6, FALSE);
3050 proto_tree_add_item (tree, ff_mesh_mgt_ssn, tvb, offset, 4, TRUE);
3052 proto_tree_add_item (tree, ff_mesh_mgt_lifetime, tvb, offset, 4, TRUE);
3054 proto_tree_add_item (tree, ff_mesh_mgt_metric, tvb, offset, 4, TRUE);
3056 proto_tree_add_item (tree, ff_mesh_mgt_dstcount, tvb, offset, 1, TRUE);
3058 proto_tree_add_item (tree, ff_mesh_mgt_flags, tvb, offset, 1, TRUE);
3060 proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset, 6, FALSE);
3062 proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset, 4, TRUE);
3064 length = offset - start; /* Size of fixed fields */
3066 case MRVL_MESH_MGMT_ACTION_RREP:
3067 proto_tree_add_item (tree, ff_mesh_mgt_length, tvb, offset, 1, TRUE);
3069 proto_tree_add_item (tree, ff_mesh_mgt_mode, tvb, offset, 1, TRUE);
3071 proto_tree_add_item (tree, ff_mesh_mgt_hopcount, tvb, offset, 1, TRUE);
3073 proto_tree_add_item (tree, ff_mesh_mgt_ttl, tvb, offset, 1, TRUE);
3075 proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset, 6, FALSE);
3077 proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset, 4, TRUE);
3079 proto_tree_add_item (tree, ff_mesh_mgt_lifetime, tvb, offset, 4, TRUE);
3081 proto_tree_add_item (tree, ff_mesh_mgt_metric, tvb, offset, 4, TRUE);
3083 proto_tree_add_item (tree, ff_mesh_mgt_sa, tvb, offset, 6, FALSE);
3085 proto_tree_add_item (tree, ff_mesh_mgt_ssn, tvb, offset, 4, TRUE);
3087 length = offset - start; /* Size of fixed fields */
3089 case MRVL_MESH_MGMT_ACTION_RERR:
3090 proto_tree_add_item (tree, ff_mesh_mgt_length, tvb, offset, 1, TRUE);
3092 proto_tree_add_item (tree, ff_mesh_mgt_mode, tvb, offset, 1, TRUE);
3094 proto_tree_add_item (tree, ff_mesh_mgt_dstcount, tvb, offset, 1, TRUE);
3096 proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset, 6, FALSE);
3098 proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset, 4, TRUE);
3100 length = offset - start; /* Size of fixed fields */
3111 /* Don't know how to handle this vendor */
3115 }/* Case vendor specific */
3122 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3123 offset += add_fixed_field(action_tree, tvb, offset, FIELD_HT_ACTION_CODE);
3124 switch (tvb_get_guint8(tvb, offset-1))
3126 case HT_ACTION_NOTIFY_CHAN_WIDTH:
3127 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CHANNEL_WIDTH);
3130 case HT_ACTION_SM_PWR_SAVE:
3131 offset += add_fixed_field(action_tree, tvb, offset, FIELD_SM_PWR_CNTRL);
3134 case HT_ACTION_PSMP_ACTION:
3138 n_sta = tvb_get_guint8(tvb, offset);
3139 offset += add_fixed_field(action_tree, tvb, offset, FIELD_PSMP_PARAM_SET);
3141 for (i=0; i< (n_sta & 0x0F); i++)
3142 offset += add_fixed_field(action_tree, tvb, offset, FIELD_PSMP_STA_INFO);
3147 case HT_ACTION_SET_PCO_PHASE:
3148 offset += add_fixed_field(action_tree, tvb, offset, FIELD_PCO_PHASE_CNTRL);
3151 case HT_ACTION_MIMO_CSI:
3153 mimo_control_t mimo_cntrl;
3154 mimo_cntrl = get_mimo_control (tvb, offset);
3155 offset += add_fixed_field(action_tree, tvb, offset, FIELD_MIMO_CNTRL);
3156 offset += add_mimo_csi_matrices_report (action_tree, tvb, offset, mimo_cntrl);
3160 case HT_ACTION_MIMO_BEAMFORMING:
3162 mimo_control_t mimo_cntrl;
3163 mimo_cntrl = get_mimo_control (tvb, offset);
3164 offset += add_fixed_field(action_tree, tvb, offset, FIELD_MIMO_CNTRL);
3165 offset += add_mimo_beamforming_feedback_report (action_tree, tvb, offset, mimo_cntrl);
3169 case HT_ACTION_MIMO_COMPRESSED_BEAMFORMING:
3171 mimo_control_t mimo_cntrl;
3172 mimo_cntrl = get_mimo_control (tvb, offset);
3173 offset += add_fixed_field(action_tree, tvb, offset, FIELD_MIMO_CNTRL);
3174 offset += add_mimo_compressed_beamforming_feedback_report (action_tree, tvb, offset, mimo_cntrl);
3178 case HT_ACTION_ANT_SEL_FEEDBACK:
3179 offset += add_fixed_field(action_tree, tvb, offset, FIELD_ANT_SELECTION);
3182 case HT_ACTION_HT_INFO_EXCHANGE:
3183 offset += add_fixed_field(action_tree, tvb, offset, FIELD_HT_INFORMATION);
3190 length = offset - start;
3195 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3196 length += 1; /* Size of fixed fields */
3204 static const value_string wpa_cipher_vals[] =
3207 {1, "WEP (40-bit)"},
3211 {5, "WEP (104-bit)"},
3215 static const value_string wpa_keymgmt_vals[] =
3225 dissect_vendor_ie_wpawme(proto_item * item, proto_tree * tree, tvbuff_t * tag_tvb)
3228 gint tag_len = tvb_length(tag_tvb);
3229 gchar out_buff[SHORT_STR];
3230 guint i, byte1, byte2;
3232 /* Wi-Fi Protected Access (WPA) Information Element */
3233 if (tag_off + 6 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WPA_OUI"\x01", 4)) {
3234 g_snprintf(out_buff, SHORT_STR, "WPA IE, type %u, version %u",
3235 tvb_get_guint8(tag_tvb, tag_off + 3), tvb_get_letohs(tag_tvb, tag_off + 4));
3236 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 6, out_buff);
3238 if (tag_off + 4 <= tag_len) {
3239 /* multicast cipher suite */
3240 if (!tvb_memeql(tag_tvb, tag_off, WPA_OUI, 3)) {
3241 g_snprintf(out_buff, SHORT_STR, "Multicast cipher suite: %s",
3242 val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3), wpa_cipher_vals,
3244 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3247 /* unicast cipher suites */
3248 if (tag_off + 2 <= tag_len) {
3249 g_snprintf(out_buff, SHORT_STR,
3250 "# of unicast cipher suites: %u", tvb_get_letohs(tag_tvb, tag_off));
3251 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3255 while (tag_off + 4 <= tag_len) {
3256 if (!tvb_memeql(tag_tvb, tag_off, WPA_OUI, 3)) {
3257 g_snprintf(out_buff, SHORT_STR,
3258 "Unicast cipher suite %u: %s", i,
3259 val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3260 wpa_cipher_vals, "UNKNOWN"));
3261 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3269 /* authenticated key management suites */
3270 if (tag_off + 2 <= tag_len) {
3271 g_snprintf(out_buff, SHORT_STR,
3272 "# of auth key management suites: %u", tvb_get_letohs(tag_tvb, tag_off));
3273 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3277 while (tag_off + 4 <= tag_len) {
3278 if (!tvb_memeql(tag_tvb, tag_off, WPA_OUI, 3)) {
3279 g_snprintf(out_buff, SHORT_STR,
3280 "auth key management suite %u: %s", i,
3281 val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3282 wpa_keymgmt_vals, "UNKNOWN"));
3283 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3295 if (tag_off < tag_len)
3296 proto_tree_add_string(tree, tag_interpretation, tag_tvb,
3297 tag_off, tag_len - tag_off, "Not interpreted");
3298 proto_item_append_text(item, ": WPA");
3299 } else if (tag_off + 7 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WME_OUI"\x02\x00", 5)) {
3300 /* Wireless Multimedia Enhancements (WME) Information Element */
3301 g_snprintf(out_buff, SHORT_STR,
3302 "WME IE: type %u, subtype %u, version %u, parameter set %u",
3303 tvb_get_guint8(tag_tvb, tag_off+3), tvb_get_guint8(tag_tvb, tag_off+4),
3304 tvb_get_guint8(tag_tvb, tag_off+5), tvb_get_guint8(tag_tvb, tag_off+6));
3305 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 7,
3307 proto_item_append_text(item, ": WME");
3308 } else if (tag_off + 24 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WME_OUI"\x02\x01", 5)) {
3309 /* Wireless Multimedia Enhancements (WME) Parameter Element */
3310 g_snprintf(out_buff, SHORT_STR,
3311 "WME PE: type %u, subtype %u, version %u, parameter set %u",
3312 tvb_get_guint8(tag_tvb, tag_off+3), tvb_get_guint8(tag_tvb, tag_off+4),
3313 tvb_get_guint8(tag_tvb, tag_off+5), tvb_get_guint8(tag_tvb, tag_off+6));
3314 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 7,
3317 for (i = 0; i < 4; i++) {
3318 byte1 = tvb_get_guint8(tag_tvb, tag_off);
3319 byte2 = tvb_get_guint8(tag_tvb, tag_off + 1);
3320 g_snprintf(out_buff, SHORT_STR,
3321 "WME AC Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
3322 (byte1 & 0x60) >> 5, wme_acs[(byte1 & 0x60) >> 5],
3323 (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
3324 byte2 & 0x0f, byte2 & 0xf0 >> 4,
3325 tvb_get_letohs(tag_tvb, tag_off + 2));
3326 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3330 proto_item_append_text(item, ": WME");
3331 } else if (tag_off + 56 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WME_OUI"\x02\x02", 5)) {
3332 /* Wireless Multimedia Enhancements (WME) TSPEC Element */
3333 guint16 ts_info, msdu_size, surplus_bandwidth;
3334 const char *direction[] = { "Uplink", "Downlink", "Reserved", "Bi-directional" };
3335 const value_string fields[] = {
3336 {13, "Minimum Service Interval"},
3337 {17, "Maximum Service Interval"},
3338 {21, "Inactivity Interval"},
3339 {25, "Suspension Interval"},
3340 {29, "Service Start Time"},
3341 {33, "Minimum Data Rate"},
3342 {37, "Mean Data Rate"},
3343 {41, "Peak Data Rate"},
3344 {45, "Maximum Burst Size"},
3345 {49, "Delay Bound"},
3346 {53, "Minimum PHY Rate"},
3351 g_snprintf(out_buff, SHORT_STR,
3352 "WME TSPEC: type %u, subtype %u, version %u",
3353 tvb_get_guint8(tag_tvb, tag_off+3), tvb_get_guint8(tag_tvb, tag_off+4),
3354 tvb_get_guint8(tag_tvb, tag_off+5));
3355 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 6,
3359 ts_info = tvb_get_letohs(tag_tvb, tag_off);
3360 byte1 = (ts_info >> 11) & 0x7;
3361 g_snprintf(out_buff, SHORT_STR,
3362 "WME TS Info: Priority %u (%s) (%s), Contention-based access %sset, %s",
3363 byte1, qos_tags[byte1], qos_acs[byte1],
3364 (ts_info & 0x0080) ? "" : "not ",
3365 direction[(ts_info >> 5) & 0x3]);
3366 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 3,
3370 msdu_size = tvb_get_letohs(tag_tvb, tag_off);
3371 g_snprintf(out_buff, SHORT_STR,
3372 "WME TSPEC: %s MSDU Size %u",
3373 (msdu_size & 0x8000) ? "Fixed" : "Nominal", msdu_size & 0x7fff);
3374 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3378 g_snprintf(out_buff, SHORT_STR,
3379 "WME TSPEC: Maximum MSDU Size %u", tvb_get_letohs(tag_tvb, tag_off));
3380 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3384 while ((field = val_to_str(tag_off, fields, "Unknown"))) {
3385 g_snprintf(out_buff, SHORT_STR,
3386 "WME TSPEC: %s %u", field, tvb_get_letohl(tag_tvb, tag_off));
3387 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3394 surplus_bandwidth = tvb_get_letohs(tag_tvb, tag_off);
3395 g_snprintf(out_buff, SHORT_STR,
3396 "WME TSPEC: Surplus Bandwidth Allowance Factor %u.%u",
3397 (surplus_bandwidth >> 13) & 0x7, (surplus_bandwidth & 0x1fff));
3398 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3402 g_snprintf(out_buff, SHORT_STR,
3403 "WME TSPEC: Medium Time %u", tvb_get_letohs(tag_tvb, tag_off));
3404 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3407 proto_item_append_text(item, ": WME");
3408 } else if (tag_off + 6 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WPA_OUI"\x04", 4)) {
3409 dissect_wps_tlvs(item, tag_tvb, tag_off+4, tag_len-4, NULL);
3410 proto_item_append_text(item, ": WPS");
3415 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tag_tvb)
3418 guint tag_len = tvb_length(tag_tvb);
3419 guint pmkid_len = tag_len - 4;
3420 char out_buff[SHORT_STR], valid_str[SHORT_STR] = "";
3422 if (tag_len >= 4 && !tvb_memeql(tag_tvb, tag_off, RSN_OUI"\x04", 4)) {
3423 /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
3424 * This is only used within EAPOL-Key frame Key Data. */
3425 if (pmkid_len != PMKID_LEN) {
3426 g_snprintf(valid_str, SHORT_STR,
3427 "(invalid PMKID len=%d, expected 16) ", pmkid_len);
3429 g_snprintf(out_buff, SHORT_STR, "RSN PMKID: %s%s", valid_str,
3430 tvb_bytes_to_str(tag_tvb, 4, pmkid_len));
3431 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 0,
3434 proto_item_append_text(item, ": RSN");
3439 } marvell_ie_type_t;
3442 dissect_vendor_ie_marvell(proto_item * item _U_, proto_tree * ietree,
3443 tvbuff_t * tvb, int offset, guint32 tag_len)
3447 type = tvb_get_guint8(tvb, offset);
3448 proto_tree_add_item (ietree, hf_marvell_ie_type, tvb, offset, 1, TRUE);
3452 case MARVELL_IE_MESH:
3453 proto_tree_add_item (ietree, hf_marvell_ie_mesh_subtype, tvb,
3454 offset++, 1, TRUE );
3455 proto_tree_add_item (ietree, hf_marvell_ie_mesh_version, tvb,
3456 offset++, 1, TRUE );
3457 proto_tree_add_item (ietree, hf_marvell_ie_mesh_active_proto_id, tvb,
3458 offset++, 1, TRUE );
3459 proto_tree_add_item (ietree, hf_marvell_ie_mesh_active_metric_id, tvb,
3460 offset++, 1, TRUE );
3461 proto_tree_add_item (ietree, hf_marvell_ie_mesh_cap, tvb,
3462 offset++, 1, TRUE );
3466 proto_tree_add_item(ietree, hf_marvell_ie_data, tvb, offset,
3467 tag_len - 1, FALSE);
3473 AIRONET_IE_VERSION = 3,
3475 AIRONET_IE_QBSS_V2 = 14
3476 } aironet_ie_type_t;
3478 static const value_string aironet_ie_type_vals[] = {
3479 { AIRONET_IE_VERSION, "CCX version"},
3480 { AIRONET_IE_QOS, "Qos"},
3481 { AIRONET_IE_QBSS_V2, "QBSS V2 - CCA"},
3486 dissect_vendor_ie_aironet(proto_item * aironet_item, proto_tree * ietree,
3487 tvbuff_t * tvb, int offset, guint32 tag_len)
3491 gboolean dont_change = FALSE; /* Don't change the IE item text to default */
3493 type = tvb_get_guint8(tvb, offset);
3494 proto_tree_add_item (ietree, hf_aironet_ie_type, tvb, offset, 1, TRUE);
3498 case AIRONET_IE_VERSION:
3499 proto_tree_add_item (ietree, hf_aironet_ie_version, tvb, offset, 1, TRUE);
3500 proto_item_append_text(aironet_item, ": Aironet CCX version = %d",
3501 tvb_get_guint8(tvb, offset));
3504 case AIRONET_IE_QOS:
3505 proto_tree_add_item (ietree, hf_aironet_ie_qos_unk1, tvb, offset, 1, TRUE);
3507 proto_tree_add_item (ietree, hf_aironet_ie_qos_paramset, tvb, offset, 1, TRUE);
3510 /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
3511 * need to be swapped. Also, the "TXOP" may be TXOP - or not.
3513 for (i = 0; i < 4; i++) {
3514 guint8 byte1, byte2;
3516 byte1 = tvb_get_guint8(tvb, offset);
3517 byte2 = tvb_get_guint8(tvb, offset + 1);
3518 txop = tvb_get_letohs(tvb, offset + 2);
3519 proto_tree_add_bytes_format(ietree, hf_aironet_ie_qos_val, tvb, offset, 4,
3520 tvb_get_ptr(tvb, offset, 4),
3521 "CCX QoS Parameters??: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
3522 (byte1 & 0x60) >> 5, wme_acs[(byte1 & 0x60) >> 5],
3523 (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
3524 byte2 & 0x0f, (byte2 & 0xf0) >> 4,
3529 case AIRONET_IE_QBSS_V2:
3530 /* Extract Values */
3531 proto_tree_add_item (ietree, hf_qbss2_scount, tvb, offset, 2, TRUE);
3532 proto_tree_add_item (ietree, hf_qbss2_cu, tvb, offset + 2, 1, FALSE);
3533 proto_tree_add_item (ietree, hf_qbss2_cal, tvb, offset + 3, 1, FALSE);
3534 proto_tree_add_item (ietree, hf_qbss2_gl, tvb, offset + 4, 1, FALSE);
3537 proto_tree_add_item(ietree, hf_aironet_ie_data, tvb, offset,
3538 tag_len - 1, FALSE);
3542 proto_item_append_text(aironet_item, ": Aironet %s",
3543 val_to_str(type, aironet_ie_type_vals, "Unknown"));
3548 dissect_rsn_ie(proto_tree * tree, tvbuff_t * tag_tvb)
3551 guint tag_len = tvb_length(tag_tvb);
3553 char out_buff[SHORT_STR];
3555 proto_item *cap_item;
3556 proto_tree *cap_tree;
3558 if (tag_off + 2 > tag_len) {
3559 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, tag_len,
3564 g_snprintf(out_buff, SHORT_STR, "RSN IE, version %u",
3565 tvb_get_letohs(tag_tvb, tag_off));
3566 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2, out_buff);
3570 if (tag_off + 4 > tag_len)
3573 /* multicast cipher suite */
3574 if (!tvb_memeql(tag_tvb, tag_off, RSN_OUI, 3)) {
3575 g_snprintf(out_buff, SHORT_STR, "Multicast cipher suite: %s",
3576 val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3577 wpa_cipher_vals, "UNKNOWN"));
3578 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4, out_buff);
3582 if (tag_off + 2 > tag_len)
3585 /* unicast cipher suites */
3586 count = tvb_get_letohs(tag_tvb, tag_off);
3587 g_snprintf(out_buff, SHORT_STR, "# of unicast cipher suites: %u", count);
3588 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2, out_buff);
3591 while (tag_off + 4 <= tag_len && i <= count) {
3592 if (tvb_memeql(tag_tvb, tag_off, RSN_OUI, 3) != 0)
3594 g_snprintf(out_buff, SHORT_STR, "Unicast cipher suite %u: %s",
3595 i, val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3596 wpa_cipher_vals, "UNKNOWN"));
3597 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4, out_buff);
3602 if (i <= count || tag_off + 2 > tag_len)
3605 /* authenticated key management suites */
3606 count = tvb_get_letohs(tag_tvb, tag_off);
3607 g_snprintf(out_buff, SHORT_STR, "# of auth key management suites: %u", count);
3608 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2, out_buff);
3611 while (tag_off + 4 <= tag_len && i <= count) {
3612 if (tvb_memeql(tag_tvb, tag_off, RSN_OUI, 3) != 0)
3614 g_snprintf(out_buff, SHORT_STR, "auth key management suite %u: %s",
3615 i, val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3616 wpa_keymgmt_vals, "UNKNOWN"));
3617 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4, out_buff);
3622 if (i <= count || tag_off + 2 > tag_len)
3625 rsn_capab = tvb_get_letohs(tag_tvb, tag_off);
3626 g_snprintf(out_buff, SHORT_STR, "RSN Capabilities 0x%04x", rsn_capab);
3627 cap_item = proto_tree_add_uint_format(tree, rsn_cap, tag_tvb,
3628 tag_off, 2, rsn_capab,
3629 "RSN Capabilities: 0x%04X", rsn_capab);
3630 cap_tree = proto_item_add_subtree(cap_item, ett_rsn_cap_tree);
3631 proto_tree_add_boolean(cap_tree, rsn_cap_preauth, tag_tvb, tag_off, 2,
3633 proto_tree_add_boolean(cap_tree, rsn_cap_no_pairwise, tag_tvb, tag_off, 2,
3635 proto_tree_add_uint(cap_tree, rsn_cap_ptksa_replay_counter, tag_tvb, tag_off, 2,
3637 proto_tree_add_uint(cap_tree, rsn_cap_gtksa_replay_counter, tag_tvb, tag_off, 2,
3641 if (tag_off + 2 > tag_len)
3644 count = tvb_get_letohs(tag_tvb, tag_off);
3645 g_snprintf(out_buff, SHORT_STR, "# of PMKIDs: %u", count);
3646 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2, out_buff);
3649 /* PMKID List (16 * n octets) */
3650 for (i = 0; i < count; i++) {
3651 if (tag_off + PMKID_LEN > tag_len)
3653 g_snprintf(out_buff, SHORT_STR, "PMKID %u: %s", i,
3654 tvb_bytes_to_str(tag_tvb, tag_off, PMKID_LEN));
3655 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off,
3656 PMKID_LEN, out_buff);
3657 tag_off += PMKID_LEN;
3661 if (tag_off < tag_len)
3662 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off,
3663 tag_len - tag_off, "Not interpreted");
3667 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vs) {
3669 proto_tree *mcs_tree, *bit_tree;
3672 /* 16 byte Supported MCS set */
3673 ti = proto_tree_add_string(tree, vs ? mcsset_vs : mcsset, tvb, offset, 16,
3674 basic ? "Basic MCS Set" : "MCS Set");
3675 mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
3677 /* Rx MCS Bitmask */
3678 ti = proto_tree_add_string(mcs_tree, tag_interpretation, tvb, offset,
3679 10, "Rx Modulation and Coding Scheme (One bit per modulation)");
3680 bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
3683 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_0to7, tvb, offset, 4, TRUE);
3684 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_8to15, tvb, offset, 4, TRUE);
3685 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_16to23, tvb, offset, 4, TRUE);
3686 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_24to31, tvb, offset, 4, TRUE);
3689 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_32, tvb, offset + 4, 4, TRUE);
3690 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_33to38, tvb, offset + 4, 4, TRUE);
3691 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_39to52, tvb, offset + 4, 4, TRUE);
3694 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_53to76, tvb, offset + 6, 4, TRUE);
3696 capability = tvb_get_letohs (tvb, offset+10);
3697 proto_tree_add_uint_format(mcs_tree, mcsset_highest_data_rate, tvb, offset + 10, 2,
3698 capability, "Highest Supported Data Rate: 0x%04X", capability);
3699 capability = tvb_get_letohs (tvb, offset+12);
3700 proto_tree_add_boolean(mcs_tree, mcsset_tx_mcs_set_defined, tvb, offset + 12, 1,
3702 proto_tree_add_boolean(mcs_tree, mcsset_tx_rx_mcs_set_not_equal, tvb, offset + 12, 1,
3704 proto_tree_add_uint(mcs_tree, mcsset_tx_max_spatial_streams, tvb, offset + 12, 1,
3706 proto_tree_add_boolean(mcs_tree, mcsset_tx_unequal_modulation, tvb, offset + 12, 1,
3710 /* 802.11n D1.10 - HT Information IE */
3712 dissect_ht_info_ie_1_1(proto_tree * tree, tvbuff_t * tvb, int offset,
3715 proto_item *cap_item;
3716 proto_tree *cap_tree;
3717 guint32 tag_val_init_off = 0;
3720 tag_val_init_off = offset;
3724 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
3725 "HT Information IE content length must be at least 22 bytes");
3729 info = tvb_get_guint8 (tvb, offset);
3730 proto_tree_add_item(cap_tree, ht_info_primary_channel, tvb, offset, 1, TRUE);
3732 info = tvb_get_guint8 (tvb, ++offset);
3733 cap_item = proto_tree_add_uint_format(tree, ht_info_delimiter1, tvb,
3735 "HT Information Subset (1 of 3): 0x%02X", info);
3736 cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter1_tree);
3737 proto_tree_add_uint(cap_tree, ht_info_secondary_channel_offset, tvb, offset, 1,
3739 proto_tree_add_boolean(cap_tree, ht_info_channel_width, tvb, offset, 1,
3741 proto_tree_add_boolean(cap_tree, ht_info_rifs_mode, tvb, offset, 1,
3743 proto_tree_add_boolean(cap_tree, ht_info_psmp_stas_only, tvb, offset, 1,
3745 proto_tree_add_uint(cap_tree, ht_info_service_interval_granularity, tvb, offset, 1,
3748 info = tvb_get_letohs (tvb, ++offset);
3749 cap_item = proto_tree_add_uint_format(tree, ht_info_delimiter2, tvb,
3751 "HT Information Subset (2 of 3): 0x%04X", info);
3752 cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter2_tree);
3753 proto_tree_add_uint(cap_tree, ht_info_operating_mode, tvb, offset, 1,
3755 proto_tree_add_boolean(cap_tree, ht_info_non_greenfield_sta_present, tvb, offset, 1,
3757 proto_tree_add_boolean(cap_tree, ht_info_transmit_burst_limit, tvb, offset, 1,
3759 proto_tree_add_boolean(cap_tree, ht_info_obss_non_ht_stas_present, tvb, offset, 1,
3761 proto_tree_add_uint(cap_tree, ht_info_reserved_1, tvb, offset, 2,
3765 info = tvb_get_letohs (tvb, offset);
3766 cap_item = proto_tree_add_uint_format(tree, ht_info_delimiter3, tvb,
3768 "HT Information Subset (3 of 3): 0x%04X", info);
3769 cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter3_tree);
3770 proto_tree_add_uint(cap_tree, ht_info_reserved_2, tvb, offset, 1,
3772 proto_tree_add_boolean(cap_tree, ht_info_dual_beacon, tvb, offset, 1,
3774 proto_tree_add_boolean(cap_tree, ht_info_dual_cts_protection, tvb, offset, 1,
3776 proto_tree_add_boolean(cap_tree, ht_info_secondary_beacon, tvb, offset+1, 1,
3778 proto_tree_add_boolean(cap_tree, ht_info_lsig_txop_protection_full_support, tvb, offset+1, 1,
3780 proto_tree_add_boolean(cap_tree, ht_info_pco_active, tvb, offset+1, 1,
3782 proto_tree_add_boolean(cap_tree, ht_info_pco_phase, tvb, offset+1, 1,
3784 proto_tree_add_uint(cap_tree, ht_info_reserved_3, tvb, offset+1, 1,
3790 dissect_mcs_set(cap_tree, tvb, offset, TRUE, FALSE);
3793 if (tag_val_init_off - offset < tag_len){
3794 proto_tree_add_string(cap_tree, tag_interpretation, tvb, offset,
3795 tag_len + tag_val_init_off - offset, "Unparsed Extra Data");
3799 /*** WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
3801 dissect_wsie_ie(proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len _U_)
3803 proto_item *pst_item, *cap_item, *chan_noc_item, *chnl_item;
3804 proto_tree *pst_tree, *cap_tree, *chan_noc_tree, *chnl_tree;
3806 guint8 providercount, pst_contents, pst_acm_length;
3808 guint16 pst_length = 0;
3810 guint8 chan_length = 0;
3813 proto_tree_add_item(tree, hf_pst_timingquality, tvb, offset, 2, TRUE);
3816 providercount = tvb_get_guint8 (tvb, offset);
3817 pst_item = proto_tree_add_item(tree, hf_pst_providercount, tvb, offset, 1, TRUE);
3818 pst_tree = proto_item_add_subtree(pst_item,ett_pst_tree);
3821 for (i=0;i<providercount;i++) {
3823 local_offset = offset;
3824 cap_item = proto_tree_add_text (pst_tree, tvb, local_offset, pst_length, "Capabilities of Provider :%u", i+1);
3825 cap_tree = proto_item_add_subtree(cap_item, ett_pst_cap_tree);
3827 pst_length = tvb_get_letohl(tvb, local_offset);
3828 proto_tree_add_item(cap_tree, hf_pst_length, tvb, local_offset, 2, TRUE);
3831 pst_contents = tvb_get_guint8 (tvb, local_offset);
3832 proto_tree_add_item(cap_tree, hf_pst_contents, tvb, local_offset, 1, TRUE);
3835 if (pst_contents & WAVE_ACID) {
3836 proto_tree_add_item(cap_tree, hf_pst_acid, tvb, local_offset, 1, TRUE);
3840 if (pst_contents & WAVE_ACM) {
3841 pst_acm_length = tvb_get_guint8 (tvb, local_offset);
3842 proto_tree_add_item(cap_tree, hf_pst_acm_length, tvb, local_offset, 1, TRUE);
3844 proto_tree_add_item(cap_tree, hf_pst_acm, tvb, local_offset, pst_acm_length, FALSE);
3846 if (pst_contents & WAVE_ACF) {
3849 if (pst_contents & WAVE_PRIORITY) {
3850 proto_tree_add_item(cap_tree, hf_pst_priority, tvb, local_offset, 1, TRUE);
3853 if (pst_contents & WAVE_IPV6ADDR) {
3854 proto_tree_add_item(cap_tree, hf_pst_ipv6addr, tvb, local_offset, 16, FALSE);
3856 proto_tree_add_item(cap_tree, hf_pst_serviceport, tvb, local_offset, 2, FALSE);
3858 proto_tree_add_item(cap_tree, hf_pst_addressing, tvb, local_offset, 1, FALSE);
3861 if (pst_contents & WAVE_PEERMAC) {
3862 proto_tree_add_item(cap_tree, hf_pst_macaddr, tvb, local_offset, 6, FALSE);
3865 if (pst_contents & WAVE_CHANNEL) {
3866 proto_tree_add_item(cap_tree, hf_pst_channel, tvb, local_offset, 1, FALSE);
3870 offset = offset + pst_length;
3873 chan_noc = tvb_get_guint8 (tvb, offset);
3874 chan_noc_item = proto_tree_add_item(tree, hf_chan_noc, tvb, offset, 1, TRUE);
3875 chan_noc_tree = proto_item_add_subtree(chan_noc_item,ett_chan_noc_tree);
3879 for (i=0;i<chan_noc;i++) {
3880 chan_length = tvb_get_guint8 (tvb, offset);
3881 chnl_item = proto_tree_add_text (chan_noc_tree, tvb, offset, chan_length, "Channel :%u Information ", i+1);
3882 chnl_tree = proto_item_add_subtree(chnl_item, ett_wave_chnl_tree);
3883 proto_tree_add_item(chnl_tree, hf_chan_length, tvb, offset, 1, TRUE);
3884 proto_tree_add_item(chnl_tree, hf_chan_content, tvb, offset+1, 1, TRUE);
3885 proto_tree_add_item(chnl_tree, hf_chan_channel, tvb, offset+2, 1, TRUE);
3886 proto_tree_add_item(chnl_tree, hf_chan_adapt, tvb, offset+3, 1, TRUE);
3887 proto_tree_add_item(chnl_tree, hf_chan_rate, tvb, offset+4, 1, TRUE);
3888 proto_tree_add_item(chnl_tree, hf_chan_tx_pow, tvb, offset+5, 1, TRUE);
3889 offset = offset + chan_length;
3894 /*** Begin: Secondary Channel Offset Tag - Dustin Johnson ***/
3895 static void secondary_channel_offset_ie(proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
3901 proto_tree_add_text (tree, tvb, offset, tag_len, "Secondary Channel Offset: Error: Tag length must be at least 1 byte long");
3905 tag_offset = offset;
3906 proto_tree_add_uint(tree, hf_tag_secondary_channel_offset, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
3909 if ((tag_len - (offset-tag_offset)) > 0)
3911 proto_tree_add_text (tree, tvb, offset, tag_len - (offset-tag_offset), "Unknown Data");
3915 /*** End: Secondary Channel Offset Tag - Dustin Johnson ***/
3918 dissect_ht_capability_ie(proto_tree * tree, tvbuff_t * tvb, int offset,
3919 guint32 tag_len, gboolean vs)
3921 proto_item *cap_item;
3922 proto_tree *cap_tree;
3925 guint32 tag_val_off = 0;
3927 if (tag_val_off + 2 > tag_len) {
3928 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
3933 if (tag_len != 26) {
3934 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
3935 "HT Capabilities IE content length must be exactly 26 bytes");
3939 if (wlan_ignore_draft_ht && vs)
3942 /* 2 byte HT Capabilities Info*/
3943 capability = tvb_get_letohs (tvb, offset);
3944 cap_item = proto_tree_add_item(tree, vs ? ht_vs_cap : ht_cap, tvb,
3946 cap_tree = proto_item_add_subtree(cap_item, ett_ht_cap_tree);
3947 proto_tree_add_boolean(cap_tree, ht_ldpc_coding, tvb, offset, 1,
3949 proto_tree_add_boolean(cap_tree, ht_chan_width, tvb, offset, 1,
3951 proto_tree_add_uint(cap_tree, ht_sm_pwsave, tvb, offset, 1,
3953 proto_tree_add_boolean(cap_tree, ht_green, tvb, offset, 1,
3955 proto_tree_add_boolean(cap_tree, ht_short20, tvb, offset, 1,
3957 proto_tree_add_boolean(cap_tree, ht_short40, tvb, offset, 1,
3959 proto_tree_add_boolean(cap_tree, ht_tx_stbc, tvb, offset, 1,
3961 proto_tree_add_uint(cap_tree, ht_rx_stbc, tvb, offset+1, 1,
3963 proto_tree_add_boolean(cap_tree, ht_delayed_block_ack, tvb, offset+1, 1,
3965 proto_tree_add_boolean(cap_tree, ht_max_amsdu, tvb, offset+1, 1,
3967 proto_tree_add_boolean(cap_tree, ht_dss_cck_40, tvb, offset+1, 1,
3969 proto_tree_add_boolean(cap_tree, ht_psmp, tvb, offset+1, 1,
3971 proto_tree_add_boolean(cap_tree, ht_40_mhz_intolerant, tvb, offset+1, 1,
3973 proto_tree_add_boolean(cap_tree, ht_l_sig, tvb, offset+1, 1,
3979 /* 1 byte A-MPDU Parameters */
3980 capability = tvb_get_guint8 (tvb, offset);
3981 cap_item = proto_tree_add_item(tree, vs ? ampduparam_vs : ampduparam, tvb,
3983 cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
3984 proto_tree_add_uint_format(cap_tree, ampduparam_mpdu, tvb, offset, 1, capability, decode_numeric_bitfield(capability, 0x03, 8,"Maximum Rx A-MPDU Length: %%04.0Lf [Bytes]"), pow(2,13+(capability & 0x3))-1);
3985 proto_tree_add_uint(cap_tree, ampduparam_mpdu_start_spacing, tvb, offset, 1, capability);
3986 proto_tree_add_uint(cap_tree, ampduparam_reserved, tvb, offset, 1, capability);
3990 /* 16 byte MCS set */
3991 dissect_mcs_set(tree, tvb, offset, FALSE, vs);
3995 /* 2 byte HT Extended Capabilities */
3996 capability = tvb_get_letohs (tvb, offset);
3997 cap_item = proto_tree_add_item(tree, vs ? htex_vs_cap : htex_cap, tvb,
3999 cap_tree = proto_item_add_subtree(cap_item, ett_htex_cap_tree);
4000 proto_tree_add_boolean(cap_tree, htex_pco, tvb, offset, 1,
4002 proto_tree_add_uint(cap_tree, htex_transtime, tvb, offset, 1,
4004 proto_tree_add_uint(cap_tree, htex_mcs, tvb, offset+1, 1,
4006 proto_tree_add_boolean(cap_tree, htex_htc_support, tvb, offset+1, 1,
4008 proto_tree_add_boolean(cap_tree, htex_rd_responder, tvb, offset+1, 1,
4014 /* 4 byte TxBF capabilities */
4015 txbfcap = tvb_get_letohl (tvb, offset);
4016 cap_item = proto_tree_add_item(tree, vs ? txbf_vs : txbf, tvb,
4018 cap_tree = proto_item_add_subtree(cap_item, ett_txbf_tree);
4019 proto_tree_add_boolean(cap_tree, txbf_cap, tvb, offset, 1,
4021 proto_tree_add_boolean(cap_tree, txbf_rcv_ssc, tvb, offset, 1,
4023 proto_tree_add_boolean(cap_tree, txbf_tx_ssc, tvb, offset, 1,
4025 proto_tree_add_boolean(cap_tree, txbf_rcv_ndp, tvb, offset, 1,
4027 proto_tree_add_boolean(cap_tree, txbf_tx_ndp, tvb, offset, 1,
4029 proto_tree_add_boolean(cap_tree, txbf_impl_txbf, tvb, offset, 1,
4031 proto_tree_add_uint(cap_tree, txbf_calib, tvb, offset, 1,
4033 proto_tree_add_boolean(cap_tree, txbf_expl_csi, tvb, offset+1, 1,
4035 proto_tree_add_boolean(cap_tree, txbf_expl_uncomp_fm, tvb, offset+1, 1,
4037 proto_tree_add_boolean(cap_tree, txbf_expl_comp_fm, tvb, offset+1, 1,
4039 proto_tree_add_uint(cap_tree, txbf_expl_bf_csi, tvb, offset+1, 1,
4041 proto_tree_add_uint(cap_tree, txbf_expl_uncomp_fm_feed, tvb, offset+1, 1,
4043 proto_tree_add_uint(cap_tree, txbf_expl_comp_fm_feed, tvb, offset+1, 2,
4045 proto_tree_add_uint(cap_tree, txbf_min_group, tvb, offset+2, 1,
4047 proto_tree_add_uint(cap_tree, txbf_csi_num_bf_ant, tvb, offset+2, 1,
4049 proto_tree_add_uint(cap_tree, txbf_uncomp_sm_bf_ant, tvb, offset+2, 1,
4051 proto_tree_add_uint(cap_tree, txbf_comp_sm_bf_ant, tvb, offset+2, 2,
4053 proto_tree_add_uint(cap_tree, txbf_csi_max_rows_bf, tvb, offset+3, 1,
4055 proto_tree_add_uint(cap_tree, txbf_chan_est, tvb, offset+3, 1,
4057 proto_tree_add_uint(cap_tree, txbf_resrv, tvb, offset+3, 1,
4063 /* 1 byte Antenna Selection (ASEL) capabilities */
4064 capability = tvb_get_guint8 (tvb, offset);
4065 cap_item = proto_tree_add_item(tree, vs ? antsel_vs : antsel, tvb,
4067 cap_tree = proto_item_add_subtree(cap_item, ett_antsel_tree);
4068 proto_tree_add_boolean(cap_tree, antsel_b0, tvb, offset, 1,
4070 proto_tree_add_boolean(cap_tree, antsel_b1, tvb, offset, 1,
4072 proto_tree_add_boolean(cap_tree, antsel_b2, tvb, offset, 1,
4074 proto_tree_add_boolean(cap_tree, antsel_b3, tvb, offset, 1,
4076 proto_tree_add_boolean(cap_tree, antsel_b4, tvb, offset, 1,
4078 proto_tree_add_boolean(cap_tree, antsel_b5, tvb, offset, 1,
4080 proto_tree_add_boolean(cap_tree, antsel_b6, tvb, offset, 1,
4082 proto_tree_add_uint(cap_tree, antsel_b7, tvb, offset, 1,
4088 if (tag_val_off < tag_len)
4089 proto_tree_add_string(tree, tag_interpretation, tvb, offset,
4090 tag_len - tag_val_off, "Not interpreted");
4094 dissect_ht_info_ie_1_0(proto_tree * tree, tvbuff_t * tvb, int offset,
4097 proto_item *cap_item;
4098 proto_tree *cap_tree;
4100 guint32 tag_val_off = 0;
4101 gchar out_buff[SHORT_STR];
4103 if (tag_val_off + 2 > tag_len) {
4104 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
4110 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
4111 "HT Additional Capabilities IE content length must be 22");
4115 if (wlan_ignore_draft_ht)
4118 g_snprintf(out_buff, SHORT_STR, "Control Channel %d",
4119 tvb_get_guint8(tvb, offset));
4120 proto_tree_add_string(tree, tag_interpretation, tvb, offset, 1, out_buff);
4124 /* 1 byte HT additional capabilities */
4125 capability = tvb_get_guint8 (tvb, offset);
4126 cap_item = proto_tree_add_uint_format(tree, hta_cap, tvb,
4127 offset, 1, capability,
4128 "HT Additional Capabilities: 0x%04X", capability);
4129 cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap_tree);
4130 proto_tree_add_uint(cap_tree, hta_ext_chan_offset, tvb, offset, 1,
4132 proto_tree_add_boolean(cap_tree, hta_rec_tx_width, tvb, offset, 1,
4134 proto_tree_add_boolean(cap_tree, hta_rifs_mode, tvb, offset, 1,
4136 proto_tree_add_boolean(cap_tree, hta_controlled_access, tvb, offset, 1,
4138 proto_tree_add_uint(cap_tree, hta_service_interval, tvb, offset, 1,
4143 /* 2 byte HT additional capabilities */
4144 capability = tvb_get_letohs (tvb, offset);
4145 cap_item = proto_tree_add_uint_format(tree, hta_cap, tvb,
4146 offset, 2, capability,
4147 "HT Additional Capabilities: 0x%04X", capability);
4148 cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap1_tree);
4149 proto_tree_add_uint(cap_tree, hta_operating_mode, tvb, offset, 2,
4151 proto_tree_add_boolean(cap_tree, hta_non_gf_devices, tvb, offset, 2,
4157 /* 2 byte HT additional capabilities */
4158 capability = tvb_get_letohs (tvb, offset);
4159 cap_item = proto_tree_add_uint_format(tree, hta_cap, tvb,
4160 offset, 2, capability,
4161 "HT Additional Capabilities: 0x%04X", capability);
4162 cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap2_tree);
4163 proto_tree_add_uint(cap_tree, hta_basic_stbc_mcs, tvb, offset, 2,
4165 proto_tree_add_boolean(cap_tree, hta_dual_stbc_protection, tvb, offset, 2,
4167 proto_tree_add_boolean(cap_tree, hta_secondary_beacon, tvb, offset, 2,
4169 proto_tree_add_boolean(cap_tree, hta_lsig_txop_protection, tvb, offset, 2,
4171 proto_tree_add_boolean(cap_tree, hta_pco_active, tvb, offset, 2,
4173 proto_tree_add_boolean(cap_tree, hta_pco_phase, tvb, offset, 2,
4178 /* 16 byte Supported MCS set */
4179 dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
4183 if (tag_val_off < tag_len)
4184 proto_tree_add_string(tree, tag_interpretation, tvb, offset,
4185 tag_len - tag_val_off, "Not interpreted");
4188 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
4192 * "The Order field is 1 bit in length and is set to 1 in any non-QoS Data
4193 * frame that contains an MSDU, or fragment thereof, which is being
4194 * transferred using the StrictlyOrdered service class. The presence of the
4195 * HT Control field in frames is indicated by setting the Order field to 1
4196 * in any Data type or Management type frame that is transmitted with a
4197 * value of HT_GF or HT_MM for the FORMAT parameter of the TXVECTOR except
4198 * a non-QoS Data frame or a Control Wrapper frame. The Order field is set
4199 * to 0 in all other frames. All non-HT QoS STAs set the Order field to 0."
4201 * ...so does this mean that we can check for the presence of +HTC by
4202 * looking for QoS frames with the Order bit set, or do we need extra
4203 * information from the PHY (which would be monumentally silly)?
4205 * At any rate, it doesn't look like any equipment we have produces
4206 * +HTC frames, so the code is completely untested.
4210 dissect_ht_control(proto_tree *tree, tvbuff_t * tvb, int offset)
4213 proto_tree *htc_tree, *lac_subtree;
4216 htc = tvb_get_letohs(tvb, offset);
4218 ti = proto_tree_add_item(tree, hf_htc, tvb, offset, 4, TRUE);
4219 htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
4221 /* Start: Link Adaptation Control */
4222 ti = proto_tree_add_item(htc_tree, hf_htc_lac, tvb, offset, 2, TRUE);
4223 lac_subtree = proto_item_add_subtree(ti, ett_htc_tree);
4224 proto_tree_add_item(lac_subtree, hf_htc_lac_reserved, tvb, offset, 1, htc);
4225 proto_tree_add_item(lac_subtree, hf_htc_lac_trq, tvb, offset, 1, TRUE);
4227 if (HTC_IS_ASELI(htc)) {
4228 proto_tree_add_uint(lac_subtree, hf_htc_lac_mai_aseli, tvb, offset, 1, htc);
4230 proto_tree_add_item(lac_subtree, hf_htc_lac_mai_mrq, tvb, offset, 1, TRUE);
4231 if (HTC_LAC_MAI_MRQ(htc)){
4232 proto_tree_add_uint(lac_subtree, hf_htc_lac_mai_msi, tvb, offset, 1, htc);
4234 proto_tree_add_uint(lac_subtree, hf_htc_lac_mai_reserved, tvb, offset, 1, htc);
4238 proto_tree_add_uint(lac_subtree, hf_htc_lac_mfsi, tvb, offset, 2, htc);
4241 if (HTC_IS_ASELI(htc)) {
4242 proto_tree_add_uint(lac_subtree, hf_htc_lac_asel_command, tvb, offset, 1, htc);
4243 proto_tree_add_uint(lac_subtree, hf_htc_lac_asel_data, tvb, offset, 1, htc);
4245 proto_tree_add_uint(lac_subtree, hf_htc_lac_mfb, tvb, offset, 1, htc);
4247 /* End: Link Adaptation Control */
4250 htc = tvb_get_letohs(tvb, offset);
4252 proto_tree_add_uint(htc_tree, hf_htc_cal_pos, tvb, offset, 1, htc);
4253 proto_tree_add_uint(htc_tree, hf_htc_cal_seq, tvb, offset, 1, htc);
4254 proto_tree_add_uint(htc_tree, hf_htc_reserved1, tvb, offset, 1, htc);
4255 proto_tree_add_uint(htc_tree, hf_htc_csi_steering, tvb, offset, 1, htc);
4258 proto_tree_add_boolean(htc_tree, hf_htc_ndp_announcement, tvb, offset, 1, htc);
4259 proto_tree_add_uint(htc_tree, hf_htc_reserved2, tvb, offset, 1, htc);
4260 proto_tree_add_boolean(htc_tree, hf_htc_ac_constraint, tvb, offset, 1, htc);
4261 proto_tree_add_boolean(htc_tree, hf_htc_rdg_more_ppdu, tvb, offset, 1, htc);
4265 dissect_frame_control(proto_tree * tree, tvbuff_t * tvb, gboolean wlan_broken_fc,
4268 guint16 fcf, flags, frame_type_subtype;
4269 proto_tree *fc_tree, *flag_tree;
4270 proto_item *fc_item, *flag_item, *hidden_item;
4272 fcf = FETCH_FCF(offset);
4274 flags = FCF_FLAGS(fcf);
4275 frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
4277 proto_tree_add_uint (tree, hf_fc_frame_type_subtype,
4278 tvb, wlan_broken_fc?offset+1:offset, 1,
4279 frame_type_subtype);
4281 fc_item = proto_tree_add_uint_format (tree, hf_fc_field, tvb,
4282 offset, 2, fcf, "Frame Control: 0x%04X (%s)",
4283 fcf, wlan_broken_fc?"Swapped":"Normal");
4285 fc_tree = proto_item_add_subtree (fc_item, ett_fc_tree);
4287 proto_tree_add_uint (fc_tree, hf_fc_proto_version, tvb, wlan_broken_fc?offset+1:offset, 1,
4288 FCF_PROT_VERSION (fcf));
4290 proto_tree_add_uint (fc_tree, hf_fc_frame_type, tvb, wlan_broken_fc?offset+1:offset, 1,
4291 FCF_FRAME_TYPE (fcf));
4293 proto_tree_add_uint (fc_tree, hf_fc_frame_subtype, tvb, wlan_broken_fc?offset+1:offset, 1,
4294 FCF_FRAME_SUBTYPE (fcf));
4296 flag_item = proto_tree_add_uint_format (fc_tree, hf_fc_flags, tvb,
4297 wlan_broken_fc?offset:offset+1, 1,
4298 flags, "Flags: 0x%X", flags);
4300 flag_tree = proto_item_add_subtree (flag_item, ett_proto_flags);
4301 proto_tree_add_uint (flag_tree, hf_fc_data_ds, tvb, wlan_broken_fc?offset:offset+1, 1,
4302 FLAGS_DS_STATUS (flags));
4303 hidden_item = proto_tree_add_boolean (flag_tree, hf_fc_to_ds, tvb, offset+1, 1, flags);
4304 PROTO_ITEM_SET_HIDDEN(hidden_item);
4305 hidden_item = proto_tree_add_boolean (flag_tree, hf_fc_from_ds, tvb, offset+1, 1, flags);
4306 PROTO_ITEM_SET_HIDDEN(hidden_item);
4307 proto_tree_add_boolean (flag_tree, hf_fc_more_frag, tvb, wlan_broken_fc?offset:offset+1, 1,
4309 proto_tree_add_boolean (flag_tree, hf_fc_retry, tvb, wlan_broken_fc?offset:offset+1, 1,
4311 proto_tree_add_boolean (flag_tree, hf_fc_pwr_mgt, tvb, wlan_broken_fc?offset:offset+1, 1,
4313 proto_tree_add_boolean (flag_tree, hf_fc_more_data, tvb, wlan_broken_fc?offset:offset+1, 1,
4315 proto_tree_add_boolean (flag_tree, hf_fc_protected, tvb, wlan_broken_fc?offset:offset+1, 1,
4317 proto_tree_add_boolean (flag_tree, hf_fc_order, tvb, wlan_broken_fc?offset:offset+1, 1,
4322 dissect_vendor_ie_ht(proto_item * item, proto_tree * tree, tvbuff_t * tag_tvb)
4324 gint tag_len = tvb_length(tag_tvb);
4325 gchar out_buff[SHORT_STR];
4327 g_snprintf(out_buff, SHORT_STR, "802.11n (Pre) OUI");
4328 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 0, 3, out_buff);
4329 /* 802.11n OUI Information Element */
4330 if (4 <= tag_len && !tvb_memeql(tag_tvb, 0, PRE_11N_OUI"\x33", 4)) {
4331 g_snprintf(out_buff, SHORT_STR, "802.11n (Pre) HT information");
4332 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 3, 1, out_buff);
4334 dissect_ht_capability_ie(tree, tag_tvb, 4, tag_len - 4, TRUE);
4335 proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
4338 if (4 <= tag_len && !tvb_memeql(tag_tvb, 0, PRE_11N_OUI"\x34", 4)) {
4339 g_snprintf(out_buff, SHORT_STR, "HT additional information (802.11n D1.00)");
4340 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 3, 1, out_buff);
4342 dissect_ht_info_ie_1_0(tree, tag_tvb, 4, tag_len - 4);
4343 proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
4346 g_snprintf(out_buff, SHORT_STR, "Unknown type");
4347 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 3, 1, out_buff);
4348 proto_item_append_text(item, ": 802.11n (pre) Unknown type");
4349 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 4,
4350 tag_len - 4, "Not interpreted");
4356 /* ************************************************************************* */
4357 /* Dissect and add tagged (optional) fields to proto tree */
4358 /* ************************************************************************* */
4360 static const value_string tag_num_vals[] = {
4361 { TAG_SSID, "SSID parameter set" },
4362 { TAG_SUPP_RATES, "Supported Rates" },
4363 { TAG_FH_PARAMETER, "FH Parameter set" },
4364 { TAG_DS_PARAMETER, "DS Parameter set" },
4365 { TAG_CF_PARAMETER, "CF Parameter set" },
4366 { TAG_TIM, "Traffic Indication Map (TIM)" },
4367 { TAG_IBSS_PARAMETER, "IBSS Parameter set" },
4368 { TAG_COUNTRY_INFO, "Country Information" },
4369 { TAG_FH_HOPPING_PARAMETER, "Hopping Pattern Parameters" },
4370 { TAG_CHALLENGE_TEXT, "Challenge text" },
4371 { TAG_ERP_INFO, "ERP Information" },
4372 { TAG_ERP_INFO_OLD, "ERP Information" },
4373 { TAG_RSN_IE, "RSN Information" },
4374 { TAG_EXT_SUPP_RATES, "Extended Supported Rates" },
4375 { TAG_CISCO_UNKNOWN_1, "Cisco Unknown 1 + Device Name" },
4376 { TAG_CISCO_UNKNOWN_2, "Cisco Unknown 2" },
4377 { TAG_CISCO_UNKNOWN_3, "Cisco Unknown 3" },
4378 { TAG_VENDOR_SPECIFIC_IE, "Vendor Specific" },
4379 { TAG_SYMBOL_PROPRIETARY, "Symbol Proprietary"},
4380 { TAG_AGERE_PROPRIETARY, "Agere Proprietary"},
4381 { TAG_REQUEST, "Request"},
4382 { TAG_QBSS_LOAD, "QBSS Load Element"},
4383 { TAG_EDCA_PARAM_SET, "EDCA Parameter Set"},
4384 { TAG_TSPEC, "Traffic Specification"},
4385 { TAG_TCLAS, "Traffic Classification"},
4386 { TAG_SCHEDULE, "Schedule"},
4387 { TAG_TS_DELAY, "TS Delay"},
4388 { TAG_TCLAS_PROCESS, "TCLAS Processing"},
4389 { TAG_HT_CAPABILITY, "HT Capabilities (802.11n D1.10)"},
4390 { TAG_NEIGHBOR_REPORT, "Neighbor Report"},
4391 { TAG_HT_INFO, "HT Information (802.11n D1.10)"},
4392 { TAG_SECONDARY_CHANNEL_OFFSET, "Secondary Channel Offset (802.11n D1.10)"},
4393 { TAG_WSIE, "Wave Service Information"}, /* www.aradasystems.com */
4394 { TAG_20_40_BSS_CO_EX, "20/40 BSS Coexistence"},
4395 { TAG_20_40_BSS_INTOL_CH_REP, "20/40 BSS Intolerant Channel Report"}, /* IEEE P802.11n/D6.0 */
4396 { TAG_OVERLAP_BSS_SCAN_PAR, "Overlapping BSS Scan Parameters"}, /* IEEE P802.11n/D6.0 */
4397 { TAG_QOS_CAPABILITY, "QoS Capability"},
4398 { TAG_POWER_CONSTRAINT, "Power Constraint"},
4399 { TAG_POWER_CAPABILITY, "Power Capability"},
4400 { TAG_TPC_REQUEST, "TPC Request"},
4401 { TAG_TPC_REPORT, "TPC Report"},
4402 { TAG_SUPPORTED_CHANNELS, "Supported Channels"},
4403 { TAG_CHANNEL_SWITCH_ANN, "Channel Switch Announcement"},
4404 { TAG_MEASURE_REQ, "Measurement Request"},
4405 { TAG_MEASURE_REP, "Measurement Report"},
4406 { TAG_QUIET, "Quiet"},
4407 { TAG_IBSS_DFS, "IBSS DFS"},
4408 { TAG_EXTENDED_CAPABILITIES, "Extended Capabilities"},
4409 #if 0 /*Not yet assigned tag numbers by ANA */
4410 { TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement"},
4411 { TAG_SUPPORTED_REGULATORY_CLASSES, "Supported Regulatory Classes"},
4416 static const value_string environment_vals[] = {
4418 { 0x4f, "Outdoor" },
4423 static int beacon_padding = 0; /* beacon padding bug */
4425 add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int offset)
4429 const guint8 *tag_data_ptr;
4430 guint32 tag_no, tag_len;
4433 char out_buff[SHORT_STR];
4434 char print_buff[SHORT_STR];
4435 proto_tree * orig_tree=tree;
4436 proto_item *ti, *en;
4437 guint8 tag_len_len; /* The length of the length parameter in bytes*/
4439 tag_no = tvb_get_guint8(tvb, offset);
4440 if(tag_no == TAG_WSIE){
4442 tag_len = tvb_get_letohl(tvb, offset + 1);
4445 tag_len = tvb_get_guint8(tvb, offset + 1);
4448 ti=proto_tree_add_text(orig_tree,tvb,offset,tag_len+1+tag_len_len,"%s",
4449 val_to_str(tag_no, tag_num_vals,
4450 (tag_no >= 17 && tag_no <= 31) ?
4451 "Reserved for challenge text" : "Reserved tag number" ));
4452 tree=proto_item_add_subtree(ti,ett_80211_mgt_ie);
4454 proto_tree_add_uint_format (tree, tag_number, tvb, offset, 1, tag_no,
4455 "Tag Number: %u (%s)",
4457 val_to_str(tag_no, tag_num_vals,
4458 (tag_no >= 17 && tag_no <= 31) ?
4459 "Reserved for challenge text" :
4460 "Reserved tag number"));
4461 proto_tree_add_uint (tree, (tag_no==TAG_TIM ? tim_length : tag_length), tvb, offset + 1, tag_len_len, tag_len);
4467 if(beacon_padding == 0) /* padding bug */
4469 guint8 *ssid; /* The SSID may consist of arbitrary bytes */
4471 ssid = tvb_get_ephemeral_string(tvb, offset + 2, tag_len);
4472 #ifdef HAVE_AIRPDCAP
4473 AirPDcapSetLastSSID(&airpdcap_ctx, (CHAR *) ssid, tag_len);
4475 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4476 tag_len, (char *) ssid);
4477 if (check_col (pinfo->cinfo, COL_INFO)) {
4479 col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=\"%s\"",
4480 format_text(ssid, tag_len));
4482 col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Broadcast");
4486 proto_item_append_text(ti, ": \"%s\"",
4487 format_text(ssid, tag_len));
4488 memcpy(wlan_stats.ssid, ssid, MAX_SSID_LEN);
4489 wlan_stats.ssid_len = tag_len;
4491 proto_item_append_text(ti, ": Broadcast");
4493 en = proto_tree_add_string_format (tree, hf_tagged_ssid, tvb, offset + 2,
4494 tag_len, format_text(ssid, tag_len),
4495 "SSID: %s", format_text(ssid, tag_len));
4496 PROTO_ITEM_SET_HIDDEN (en);
4497 beacon_padding++; /* padding bug */
4501 case TAG_SUPP_RATES:
4502 case TAG_EXT_SUPP_RATES:
4505 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4506 "Tag length %u too short, must be greater than 0", tag_len);
4510 tag_data_ptr = tvb_get_ptr (tvb, offset + 2, tag_len);
4511 for (i = 0, n = 0; i < tag_len && n < SHORT_STR; i++) {
4512 if (tag_data_ptr[i] == 0xFF){
4513 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2 + i,
4514 1, "BSS requires support for mandatory features of HT PHY (IEEE 802.11 - Clause 20)");
4516 ret = g_snprintf (print_buff + n, SHORT_STR - n, "%2.1f%s ",
4517 (tag_data_ptr[i] & 0x7F) * 0.5,
4518 (tag_data_ptr[i] & 0x80) ? "(B)" : "");
4519 if (ret == -1 || ret >= SHORT_STR - n) {
4520 /* Some versions of snprintf return -1 if they'd truncate
4521 the output. Others return <buf_size> or greater. */
4527 g_snprintf (out_buff, SHORT_STR, "Supported rates: %s [Mbit/sec]", print_buff);
4528 out_buff[SHORT_STR-1] = '\0';
4529 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4531 proto_item_append_text(ti, ": %s", print_buff);
4534 case TAG_FH_PARAMETER:
4537 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 5",
4541 g_snprintf (out_buff, SHORT_STR,
4542 "Dwell time 0x%04X, Hop Set %2d, Hop Pattern %2d, Hop Index %2d",
4543 tvb_get_letohs(tvb, offset + 2),
4544 tvb_get_guint8(tvb, offset + 4),
4545 tvb_get_guint8(tvb, offset + 5),
4546 tvb_get_guint8(tvb, offset + 6));
4547 out_buff[SHORT_STR-1] = '\0';
4548 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4552 case TAG_DS_PARAMETER:
4555 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 1",
4559 g_snprintf (out_buff, SHORT_STR, "Current Channel: %u",
4560 tvb_get_guint8(tvb, offset + 2));
4561 out_buff[SHORT_STR-1] = '\0';
4562 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4564 proto_item_append_text(ti, ": %s", out_buff);
4565 wlan_stats.channel = tvb_get_guint8(tvb, offset + 2);
4568 case TAG_CF_PARAMETER:
4571 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 6",
4575 g_snprintf (out_buff, SHORT_STR, "CFP count: %u",
4576 tvb_get_guint8(tvb, offset + 2));
4577 out_buff[SHORT_STR-1] = '\0';
4578 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2,
4579 1, out_buff, "%s", out_buff);
4580 g_snprintf (out_buff, SHORT_STR, "CFP period: %u",
4581 tvb_get_guint8(tvb, offset + 3));
4582 out_buff[SHORT_STR-1] = '\0';
4583 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 3,
4584 1, out_buff, "%s", out_buff);
4585 g_snprintf (out_buff, SHORT_STR, "CFP max duration: %u",
4586 tvb_get_letohs(tvb, offset + 4));
4587 out_buff[SHORT_STR-1] = '\0';
4588 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 4,
4589 2, out_buff, "%s", out_buff);
4590 g_snprintf (out_buff, SHORT_STR, "CFP Remaining: %u",
4591 tvb_get_letohs(tvb, offset + 6));
4592 out_buff[SHORT_STR-1] = '\0';
4593 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 6,
4594 2, out_buff, "%s", out_buff);
4595 proto_item_append_text(ti, ": CFP count %u, CFP period %u, CFP max duration %u, "
4597 tvb_get_guint8(tvb, offset + 2),
4598 tvb_get_guint8(tvb, offset + 3),
4599 tvb_get_letohs(tvb, offset + 4),
4600 tvb_get_letohs(tvb, offset + 6));
4606 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 4",
4616 proto_tree_add_item(tree, tim_dtim_count, tvb,
4617 offset + 2, 1, TRUE);
4618 proto_tree_add_item(tree, tim_dtim_period, tvb,
4619 offset + 3, 1, TRUE);
4620 proto_item_append_text(ti, ": DTIM %u of %u bitmap",
4621 tvb_get_guint8(tvb, offset + 2),
4622 tvb_get_guint8(tvb, offset + 3));
4624 bmapctl = tvb_get_guint8(tvb, offset + 4);
4625 bmapoff = bmapctl>>1;
4626 proto_tree_add_uint_format(tree, tim_bmapctl, tvb,
4627 offset + 4, 1, bmapctl,
4628 "Bitmap Control: 0x%02X (mcast:%u, bitmap offset %u)",
4629 bmapctl, bmapctl&1, bmapoff);
4631 bmaplen = tag_len - 3;
4632 bmap = tvb_get_ptr(tvb, offset + 5, bmaplen);
4633 if (bmaplen==1 && 0==bmap[0] && !(bmapctl&1)) {
4634 proto_item_append_text(ti, " empty");
4637 proto_item_append_text(ti, " mcast");
4640 if (bmaplen>1 || bmap[0]) {
4641 int len=g_snprintf (out_buff, SHORT_STR,
4642 "Bitmap: traffic for AID's:");
4644 for (i=0;i<bmaplen*8;i++) {
4645 if (bmap[i/8] & (1<<(i%8))) {
4646 int aid=i+2*bmapoff*8;
4647 len+=g_snprintf (out_buff+len, SHORT_STR-len," %u", aid);
4648 proto_item_append_text(ti, " %u", aid);
4649 if (len>=SHORT_STR) {
4654 out_buff[SHORT_STR-1] = '\0';
4655 proto_tree_add_string_format (tree, tag_interpretation, tvb, offset + 5,
4656 bmaplen, out_buff, "%s", out_buff);
4661 case TAG_IBSS_PARAMETER:
4664 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 2",
4668 g_snprintf (out_buff, SHORT_STR, "ATIM window 0x%X",
4669 tvb_get_letohs(tvb, offset + 2));
4670 out_buff[SHORT_STR-1] = '\0';
4671 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4673 proto_item_append_text(ti, ": %s", out_buff);
4676 case TAG_COUNTRY_INFO: /* IEEE 802.11d-2001 and IEEE 802.11j-2004 */
4682 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 3",
4686 tvb_memcpy(tvb, ccode, offset + 2, 2);
4688 g_snprintf (out_buff, SHORT_STR, "Country Code: %s, %s Environment",
4689 format_text(ccode, 2),
4690 val_to_str(tvb_get_guint8(tvb, offset + 4), environment_vals,"Unknown (0x%02x)"));
4691 out_buff[SHORT_STR-1] = '\0';
4692 proto_item_append_text(ti, ": %s", out_buff);
4693 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,3, out_buff);
4695 for (i = 3; (i + 3) <= tag_len; i += 3)
4697 guint8 val1, val2, val3;
4698 val1 = tvb_get_guint8(tvb, offset + 2 + i);
4699 val2 = tvb_get_guint8(tvb, offset + 3 + i);
4700 val3 = tvb_get_guint8(tvb, offset + 4 + i);
4702 if (val1 <= 200) { /* 802.11d */
4703 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2+i,3, out_buff,
4704 " Start Channel: %u, Channels: %u, Max TX Power: %d dBm",
4705 val1, val2, (gint) val3);
4706 } else { /* 802.11j */
4707 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2+i,3, out_buff,
4708 " Reg Extension Id: %u, Regulatory Class: %u, Coverage Class: %u",
4716 if (tag_len < 4 || tag_len >5)
4718 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Wrong QBSS Tag Length %u", tag_len);
4724 /* QBSS Version 1 */
4725 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 1,
4726 tag_len, "Cisco QBSS Version 1 - non CCA");
4728 /* Extract Values */
4729 proto_tree_add_uint (tree, hf_qbss_version, tvb, offset + 2, tag_len, 1);
4730 proto_tree_add_item (tree, hf_qbss_scount, tvb, offset + 2, 2, TRUE);
4731 proto_tree_add_item (tree, hf_qbss_cu, tvb, offset + 4, 1, FALSE);
4732 proto_tree_add_item (tree, hf_qbss_adc, tvb, offset + 5, 1, FALSE);
4734 else if (tag_len == 5)
4736 /* QBSS Version 2 */
4737 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4738 tag_len, "802.11e CCA Version");
4740 /* Extract Values */
4741 proto_tree_add_uint (tree, hf_qbss_version, tvb, offset + 2, tag_len, 2);
4742 proto_tree_add_item (tree, hf_qbss_scount, tvb, offset + 2, 2, TRUE);
4743 proto_tree_add_item (tree, hf_qbss_cu, tvb, offset + 4, 1, FALSE);
4744 proto_tree_add_item (tree, hf_qbss_adc, tvb, offset + 5, 2, TRUE);
4748 case TAG_FH_HOPPING_PARAMETER:
4751 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 2",
4755 g_snprintf (out_buff, SHORT_STR, "Prime Radix: %u, Number of Channels: %u",
4756 tvb_get_guint8(tvb, offset + 2),
4757 tvb_get_guint8(tvb, offset + 3));
4758 out_buff[SHORT_STR-1] = '\0';
4759 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2, tag_len, out_buff);
4760 proto_item_append_text(ti, ": %s", out_buff);
4766 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4767 "TSPEC tag length %u != 55", tag_len);
4770 add_fixed_field(tree, tvb, offset + 2, FIELD_QOS_TS_INFO);
4771 proto_tree_add_item(tree, tspec_nor_msdu, tvb, offset + 5, 2, TRUE);
4772 proto_tree_add_item(tree, tspec_max_msdu, tvb, offset + 7, 2, TRUE);
4773 proto_tree_add_item(tree, tspec_min_srv, tvb, offset + 9, 4, TRUE);
4774 proto_tree_add_item(tree, tspec_max_srv, tvb, offset + 13, 4, TRUE);
4775 proto_tree_add_item(tree, tspec_inact_int, tvb, offset + 17, 4, TRUE);
4776 proto_tree_add_item(tree, tspec_susp_int, tvb, offset + 21, 4, TRUE);
4777 proto_tree_add_item(tree, tspec_srv_start, tvb, offset + 25, 4, TRUE);
4778 proto_tree_add_item(tree, tspec_min_data, tvb, offset + 29, 4, TRUE);
4779 proto_tree_add_item(tree, tspec_mean_data, tvb, offset + 33, 4, TRUE);
4780 proto_tree_add_item(tree, tspec_peak_data, tvb, offset + 37, 4, TRUE);
4781 proto_tree_add_item(tree, tspec_burst_size, tvb, offset + 41, 4, TRUE);
4782 proto_tree_add_item(tree, tspec_delay_bound, tvb, offset + 45, 4, TRUE);
4783 proto_tree_add_item(tree, tspec_min_phy, tvb, offset + 49, 4, TRUE);
4784 proto_tree_add_item(tree, tspec_surplus, tvb, offset + 53, 2, TRUE);
4785 proto_tree_add_item(tree, tspec_medium, tvb, offset + 55, 2, TRUE);
4791 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4792 "TS_DELAY tag length %u != 4", tag_len);
4795 proto_tree_add_item(tree, ts_delay, tvb, offset + 2, 4, TRUE);
4801 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4802 "TCLAS element is too small %u", tag_len);
4809 type = tvb_get_guint8(tvb, offset + 2);
4810 proto_tree_add_item(tree, hf_tsinfo_up, tvb, offset + 2, 1, TRUE);
4811 proto_tree_add_item(tree, hf_class_type, tvb, offset + 3, 1, TRUE);
4812 proto_tree_add_item(tree, hf_class_mask, tvb, offset + 4, 1, TRUE);
4816 proto_tree_add_item(tree, ff_src_mac_addr, tvb, offset + 5,
4818 proto_tree_add_item(tree, ff_dst_mac_addr, tvb, offset + 11,
4820 proto_tree_add_item(tree, hf_ether_type, tvb, offset + 17,
4825 version = tvb_get_guint8(tvb, offset + 5);
4826 proto_tree_add_item(tree, cf_version, tvb, offset + 5, 1, TRUE);
4829 proto_tree_add_item(tree, cf_ipv4_src, tvb, offset + 6,
4831 proto_tree_add_item(tree, cf_ipv4_dst, tvb, offset + 10,
4833 proto_tree_add_item(tree, cf_src_port, tvb, offset + 14,
4835 proto_tree_add_item(tree, cf_dst_port, tvb, offset + 16,
4837 proto_tree_add_item(tree, cf_dscp, tvb, offset + 18,
4839 proto_tree_add_item(tree, cf_protocol, tvb, offset + 19,
4842 else if (version == 6)
4844 proto_tree_add_item(tree, cf_ipv6_src, tvb, offset + 6,
4846 proto_tree_add_item(tree, cf_ipv6_dst, tvb, offset + 22,
4848 proto_tree_add_item(tree, cf_src_port, tvb, offset + 38,
4850 proto_tree_add_item(tree, cf_dst_port, tvb, offset + 40,
4852 proto_tree_add_item(tree, cf_flow, tvb, offset + 42,
4858 proto_tree_add_item(tree, cf_tag_type, tvb, offset + 5,
4868 case TAG_TCLAS_PROCESS:
4871 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4872 "TCLAS_PROCESS element length %u != 1", tag_len);
4875 proto_tree_add_item(tree, hf_tclas_process, tvb, offset + 2, 1, TRUE);
4881 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4882 "TCLAS_PROCESS element length %u != 14", tag_len);
4885 add_fixed_field(tree, tvb, offset + 2, FIELD_SCHEDULE_INFO);
4886 proto_tree_add_item(tree, hf_sched_srv_start, tvb, offset + 4, 4, TRUE);
4887 proto_tree_add_item(tree, hf_sched_srv_int, tvb, offset + 8, 4, TRUE);
4888 proto_tree_add_item(tree, hf_sched_spec_int, tvb, offset + 12, 2, TRUE);
4891 case TAG_CHALLENGE_TEXT:
4892 g_snprintf (out_buff, SHORT_STR, "Challenge text: %s",
4893 tvb_bytes_to_str(tvb, offset + 2, tag_len));
4894 out_buff[SHORT_STR-1] = '\0';
4895 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4900 case TAG_ERP_INFO_OLD:
4906 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 1",
4910 erp_info = tvb_get_guint8 (tvb, offset + 2);
4911 g_snprintf (print_buff, SHORT_STR, "%sNon-ERP STAs, %suse protection, %s preambles",
4912 erp_info & 0x01 ? "" : "no ",
4913 erp_info & 0x02 ? "" : "do not ",
4914 /* 802.11g, 7.3.2.13: 1 means "one or more ... STAs
4915 * are not short preamble capable" */
4916 erp_info & 0x04 ? "long": "short or long");
4917 print_buff[SHORT_STR-1] = '\0';
4918 g_snprintf (out_buff, SHORT_STR,
4919 "ERP info: 0x%x (%s)",erp_info,print_buff);
4920 out_buff[SHORT_STR-1] = '\0';
4921 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4923 proto_item_append_text(ti, ": %s", print_buff);
4927 case TAG_CISCO_UNKNOWN_1:
4929 * If Aironet IE support is enabled, the access point sends an Aironet
4930 * IE 0x85 (which contains the access point name, load, number of
4931 * associated clients, and so on) in the beacon and probe responses of
4932 * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
4933 * (which contains the management IP address of the controller and
4934 * the IP address of the access point) in the reassociation response
4935 * if it receives Aironet IE 0x85 in the reassociation request.
4938 /* The Name of the sending device starts at offset 10 and is up to
4939 15 or 16 bytes in length, \0 padded */
4942 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 26",
4946 /* A cisco AP transmits the first 15 bytes of the AP name, probably
4947 followed by '\0' for ASCII termination */
4948 g_snprintf (out_buff, SHORT_STR, "%.16s",
4949 tvb_format_stringzpad(tvb, offset + 12, 16));
4950 out_buff[SHORT_STR-1] = '\0';
4951 proto_tree_add_string_format (tree, tag_interpretation, tvb, offset + 2,
4952 tag_len, "", "Tag interpretation: Unknown + Name: %s #Clients: %u",
4954 /* Total number off associated clients and repeater access points */
4955 tvb_get_guint8(tvb, offset + 28));
4956 if (check_col (pinfo->cinfo, COL_INFO)) {
4957 col_append_fstr(pinfo->cinfo, COL_INFO, ", Name=\"%s\"", out_buff);
4962 * 7.3.2.26 Vendor Specific information element
4964 * information element is in the format shown in Figure 7-75 and requires that the first 3 octets of the
4965 * information field contain the OUI of the entity that has defined the content of the particular Vendor Specific
4966 * information element. The length of the information field (n) is 3 >= n =< 255. The OUI field shall be a public
4967 * OUI assigned by the IEEE. It is 3 octets in length. The length of the vendor-specific content is n-3 octets.
4969 * Element ID Length OUI Vendor-specific content
4973 case TAG_VENDOR_SPECIFIC_IE:
4974 tvb_ensure_bytes_exist (tvb, offset + 2, tag_len);
4976 oui = tvb_get_ntoh24(tvb, offset + 2);
4977 tag_tvb = tvb_new_subset(tvb, offset + 2, tag_len, tag_len);
4978 tag_data_ptr = tvb_get_ptr(tag_tvb, 0, 3);
4979 proto_tree_add_bytes_format (tree, tag_oui, tvb, offset + 2, 3,
4980 tag_data_ptr, "Vendor: %s", get_manuf_name(tag_data_ptr));
4981 proto_item_append_text(ti, ": %s", get_manuf_name(tag_data_ptr));
4983 #define WPAWME_OUI 0x0050F2
4984 #define RSNOUI_VAL 0x000FAC
4985 #define PRE11N_OUI 0x00904c
4989 dissect_vendor_ie_wpawme(ti, tree, tag_tvb);
4992 dissect_vendor_ie_rsn(ti, tree, tag_tvb);
4994 case OUI_CISCOWL: /* Cisco Wireless (Aironet) */
4995 dissect_vendor_ie_aironet(ti, tree, tvb, offset + 5, tag_len - 3);
4998 dissect_vendor_ie_ht(ti, tree, tag_tvb);
5001 dissect_vendor_ie_marvell(ti, tree, tvb, offset + 5, tag_len - 3);
5004 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 5,
5005 tag_len - 3, "Not interpreted");
5013 tag_tvb = tvb_new_subset(tvb, offset + 2, tag_len, tag_len);
5014 dissect_rsn_ie(tree, tag_tvb);
5017 case TAG_HT_CAPABILITY:
5018 dissect_ht_capability_ie(tree, tvb, offset + 2, tag_len, FALSE);
5022 dissect_ht_info_ie_1_1(tree, tvb, offset + 2, tag_len);
5024 /*** Begin: Secondary Channel Offset Tag - Dustin Johnson ***/
5025 case TAG_SECONDARY_CHANNEL_OFFSET:
5026 secondary_channel_offset_ie(tree, tvb, offset + 2, tag_len);
5028 /*** End: Secondary Channel Offset Tag - Dustin Johnson ***/
5030 /*** Begin: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
5032 dissect_wsie_ie(tree, tvb, offset + 3, tag_len);
5034 /*** End: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
5036 /*** Begin: Power Capability Tag - Dustin Johnson ***/
5037 case TAG_POWER_CAPABILITY:
5042 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5043 "Power Capability: Error: Tag length must be exactly 2 bytes long");
5046 proto_tree_add_item(tree, hf_tag_power_capability_min, tvb, offset, 1, TRUE);
5047 proto_tree_add_item(tree, hf_tag_power_capability_max, tvb, offset+1, 1, TRUE);
5050 /*** End: Power Capability Tag - Dustin Johnson ***/
5052 * 7.3.2.18 TPC Report element
5055 case TAG_TPC_REPORT:
5057 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5058 "TPC Report: Error: Tag length must be 2 bytes long");
5059 /* Transmit Power field
5060 * The field is coded as a signed integer in units of decibels relative to 1 mW
5063 proto_tree_add_item(tree, hf_tag_tpc_report_trsmt_pow, tvb, offset, 1, TRUE);
5066 proto_tree_add_item(tree, hf_tag_tpc_report_link_mrg, tvb, offset, 1, TRUE);
5069 /*** Begin: Supported Channels Tag - Dustin Johnson ***/
5070 case TAG_SUPPORTED_CHANNELS:
5072 proto_item *chan_item;
5073 proto_tree *chan_tree;
5077 if (tag_len > 8) /* XXX Is this a sane limit? */
5079 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5080 "Supported Channels: Error: Tag length too long");
5081 } else if (tag_len % 2 == 1) {
5082 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5083 "Supported Channels: Error: Tag length must be even");
5086 for (i=0; i<(tag_len/2); i++)
5088 chan_item = proto_tree_add_uint_format(tree, hf_tag_supported_channels, tvb, offset, 2, i,
5089 "Supported Channels Set #%d", i);
5090 chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
5091 proto_tree_add_item(chan_tree, hf_tag_supported_channels_first, tvb, offset++, 1, TRUE);
5092 proto_tree_add_item(chan_tree, hf_tag_supported_channels_range, tvb, offset++, 1, TRUE);
5096 /*** End: Supported Channels Tag - Dustin Johnson ***/
5098 /*** Begin: Measure Request Tag - Dustin Johnson ***/
5099 case TAG_MEASURE_REQ:
5102 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5103 "Measurement Request: Error: Tag length must be at least 3 bytes long");
5105 guint8 info, request_type;
5107 proto_item *parent_item;
5108 proto_tree *sub_tree;
5111 tag_offset = offset;
5112 info = tvb_get_guint8 (tvb, offset);
5113 proto_tree_add_uint_format(tree, hf_tag_measure_request_measurement_token, tvb,
5114 offset, 1, info, "Measurement Token: 0x%02X", info);
5116 info = tvb_get_guint8 (tvb, ++offset);
5117 parent_item = proto_tree_add_uint_format(tree, hf_tag_measure_request_mode, tvb,
5118 offset, 1, info, "Measurement Request Mode: 0x%02X", info);
5119 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5120 proto_tree_add_uint(sub_tree, hf_tag_measure_request_mode_reserved1, tvb, offset, 1, info);
5121 proto_tree_add_boolean(sub_tree, hf_tag_measure_request_mode_enable, tvb, offset, 1, info);
5122 proto_tree_add_boolean(sub_tree, hf_tag_measure_request_mode_request, tvb, offset, 1, info);
5123 proto_tree_add_boolean(sub_tree, hf_tag_measure_request_mode_report, tvb, offset, 1, info);
5124 proto_tree_add_uint(sub_tree, hf_tag_measure_request_mode_reserved2, tvb, offset, 1, info);
5126 request_type = tvb_get_guint8 (tvb, ++offset);
5127 parent_item = proto_tree_add_uint(tree, hf_tag_measure_request_type, tvb, offset, 1, request_type);
5128 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5131 switch (request_type) {
5132 case 0: /* Basic Request */
5133 case 1: /* Clear channel assessment (CCA) request */
5134 case 2: /* Receive power indication (RPI) histogram request */
5136 guint8 channel_number;
5140 channel_number = tvb_get_guint8 (tvb, offset);
5141 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5143 start_time = tvb_get_letoh64 (tvb, offset);
5144 proto_tree_add_uint64_format(sub_tree, hf_tag_measure_request_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016" G_GINT64_MODIFIER "X", start_time);
5147 duration = tvb_get_letohs (tvb, offset);
5148 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_duration, tvb, offset, 2, duration, "Measurement Duration: 0x%04X TU (1 TU = 1024 us)", duration);
5151 case 3: /* Channel Load Request */
5152 case 4: /* Noise Histogram Request */
5154 guint8 regulatory_class, channel_number;
5155 guint16 rand_interval, duration;
5157 regulatory_class = tvb_get_guint8 (tvb, offset);
5158 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_regulatory_class, tvb, offset, 1, regulatory_class, "Regulatory Class: 0x%02X", regulatory_class);
5161 channel_number = tvb_get_guint8 (tvb, offset);
5162 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5165 rand_interval = tvb_get_letohs (tvb, offset);
5166 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_randomization_interval, tvb, offset, 2, rand_interval, "Randomization Interval: 0x%02X TU (1 TU = 1024 us)", rand_interval);
5169 duration = tvb_get_letohs (tvb, offset);
5170 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_duration, tvb, offset, 2, duration, "Measurement Duration: 0x%04X TU (1 TU = 1024 us)", duration);
5173 case 5: /* Beacon Request */
5175 guint8 regulatory_class, channel_number, measurement_mode, reporting_condition, threshold_offset;
5176 guint16 rand_interval, duration;
5177 const guint8 *bssid = NULL;
5179 regulatory_class = tvb_get_guint8 (tvb, offset);
5180 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_regulatory_class, tvb, offset, 1, regulatory_class, "Regulatory Class: 0x%02X", regulatory_class);
5183 channel_number = tvb_get_guint8 (tvb, offset);
5184 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5187 rand_interval = tvb_get_letohs (tvb, offset);
5188 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_randomization_interval, tvb, offset, 2, rand_interval, "Randomization Interval: 0x%02X TU (1 TU = 1024 us)", rand_interval);
5191 duration = tvb_get_letohs (tvb, offset);
5192 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_duration, tvb, offset, 2, duration, "Measurement Duration: 0x%04X TU (1 TU = 1024 us)", duration);
5195 measurement_mode = tvb_get_guint8 (tvb, offset);
5196 proto_tree_add_uint(sub_tree, hf_tag_measure_request_measurement_mode, tvb, offset, 1, measurement_mode);
5199 bssid = tvb_get_ptr (tvb, offset, 6);
5200 proto_tree_add_ether(sub_tree, hf_tag_measure_request_bssid, tvb, offset, 6, bssid);
5203 reporting_condition = tvb_get_guint8 (tvb, offset);
5204 proto_tree_add_uint(sub_tree, hf_tag_measure_request_reporting_condition, tvb, offset, 1, reporting_condition);
5207 threshold_offset = tvb_get_guint8 (tvb, offset);
5208 if (reporting_condition == 0) {
5210 } else if (reporting_condition >= 1 && reporting_condition <= 4){ /* Unsigned dBm */
5211 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_threshold_offset_unsigned, tvb, offset, 1, threshold_offset, "Threshold/Offset: 0x%02X dBm", threshold_offset);
5212 } else if (reporting_condition == 5 || reporting_condition == 6 || reporting_condition == 9){ /* Signed dBm */
5213 proto_tree_add_int_format(sub_tree, hf_tag_measure_request_threshold_offset_signed, tvb, offset, 1, threshold_offset, "Threshold/Offset: 0x%02X dBm", threshold_offset);
5214 } else if (reporting_condition == 7 || reporting_condition == 8 || reporting_condition == 10){ /* Signed dB */
5215 proto_tree_add_int_format(sub_tree, hf_tag_measure_request_threshold_offset_signed, tvb, offset, 1, threshold_offset, "Threshold/Offset: 0x%02X dB", threshold_offset);
5221 add_tagged_field (pinfo, sub_tree, tvb, offset);
5225 case 6: /* Frame Request */
5227 guint8 regulatory_class, channel_number;
5228 guint16 rand_interval, duration;
5229 const guint8 *mac = NULL;
5231 regulatory_class = tvb_get_guint8 (tvb, offset);
5232 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_regulatory_class, tvb, offset, 1, regulatory_class, "Regulatory Class: 0x%02X", regulatory_class);
5235 channel_number = tvb_get_guint8 (tvb, offset);
5236 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5239 rand_interval = tvb_get_letohs (tvb, offset);
5240 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_randomization_interval, tvb, offset, 2, rand_interval, "Randomization Interval: 0x%02X TU (1 TU = 1024 us)", rand_interval);
5243 duration = tvb_get_letohs (tvb, offset);
5244 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_duration, tvb, offset, 2, duration, "Measurement Duration: 0x%04X TU (1 TU = 1024 us)", duration);
5247 if (tag_len >= ((offset-tag_offset)+6)){
5248 mac = tvb_get_ptr (tvb, offset, 6);
5249 proto_tree_add_ether(sub_tree, hf_tag_measure_request_bssid, tvb, offset, 6, mac);
5253 case 7: /* BSTA Statistics Request */
5256 guint16 rand_interval, duration;
5259 rand_interval = tvb_get_letohs (tvb, offset);
5260 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_randomization_interval, tvb, offset, 2, rand_interval, "Randomization Interval: 0x%02X TU (1 TU = 1024 us)", rand_interval);
5263 duration = tvb_get_letohs (tvb, offset);
5264 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_duration, tvb, offset, 2, duration, "Measurement Duration: 0x%04X TU (1 TU = 1024 us)", duration);
5267 group_id = tvb_get_guint8 (tvb, offset);
5268 proto_tree_add_uint(sub_tree, hf_tag_measure_request_group_id, tvb, offset, 1, group_id);
5271 case 8: /* Location Configuration Indication (LCI) Request */
5273 case 9: /* Transmit Stream Measurement Request */
5275 case 255: /* Measurement Pause Request*/
5277 default: /* unknown */
5278 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Undissected Data");
5284 /* End: Measure Request Tag - Dustin Johnson */
5285 /* Begin: Measure Report Tag - Dustin Johnson */
5286 /* 7.3.2.22 Measurement Report element
5287 * The Length field is variable and depends on the length of the
5288 * Measurement Report field. The minimum value of the Length field is 3.
5290 case TAG_MEASURE_REP:
5293 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5294 "Measurement Report: Error: Tag length must be at least 3 bytes long");
5296 guint8 info, report_type, channel_number;
5299 proto_item *parent_item;
5300 proto_tree *sub_tree;
5304 tag_offset = offset;
5305 info = tvb_get_guint8 (tvb, offset);
5306 proto_tree_add_uint_format(tree, hf_tag_measure_report_measurement_token, tvb,
5307 offset, 1, info, "Measurement Token: 0x%02X", info);
5310 info = tvb_get_guint8 (tvb, offset);
5311 parent_item = proto_tree_add_uint_format(tree, hf_tag_measure_report_mode, tvb,
5312 offset, 1, info, "Measurement Report Mode: 0x%02X", info);
5313 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5314 proto_tree_add_boolean(sub_tree, hf_tag_measure_report_mode_late, tvb, offset, 1, info);
5315 proto_tree_add_boolean(sub_tree, hf_tag_measure_report_mode_incapable, tvb, offset, 1, info);
5316 proto_tree_add_boolean(sub_tree, hf_tag_measure_report_mode_refused, tvb, offset, 1, info);
5317 proto_tree_add_uint(sub_tree, hf_tag_measure_report_mode_reserved, tvb, offset, 1, info);
5320 report_type = tvb_get_guint8 (tvb, offset);
5321 parent_item = proto_tree_add_uint(tree, hf_tag_measure_report_type, tvb, offset, 1, report_type);
5322 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5327 switch (report_type) {
5328 case 0: /* Basic Report */
5330 proto_tree *sub_tree_map_field;
5332 channel_number = tvb_get_guint8 (tvb, offset);
5333 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5336 start_time = tvb_get_letoh64 (tvb, offset);
5337 proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016" G_GINT64_MODIFIER "x", start_time);
5340 duration = tvb_get_letohs (tvb, offset);
5341 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_duration, tvb, offset, 2, duration, "Measurement Duration in TUs (1TU = 1024 us): 0x%04X", duration);
5344 info = tvb_get_guint8 (tvb, offset);
5345 parent_item = proto_tree_add_uint_format(tree, hf_tag_measure_basic_map_field, tvb,
5346 offset, 1, info, "Map Field: 0x%02X", info);
5347 sub_tree_map_field = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5348 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_bss, tvb, offset, 1, info);
5349 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_odfm, tvb, offset, 1, info);
5350 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_unident_signal, tvb, offset, 1, info);
5351 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_radar, tvb, offset, 1, info);
5352 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_unmeasured, tvb, offset, 1, info);
5353 proto_tree_add_uint(sub_tree_map_field, hf_tag_measure_map_field_reserved, tvb, offset, 1, info);
5356 case 1: /* Clear channel assessment (CCA) report */
5357 channel_number = tvb_get_guint8 (tvb, offset);
5358 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5361 start_time = tvb_get_letoh64 (tvb, offset);
5362 proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016" G_GINT64_MODIFIER "X", start_time);
5365 duration = tvb_get_letohs (tvb, offset);
5366 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_duration, tvb, offset, 2, duration, "Measurement Duration in TUs (1TU = 1024 us): 0x%04X", duration);
5369 info = tvb_get_guint8 (tvb, offset);
5370 proto_tree_add_uint_format(sub_tree, hf_tag_measure_cca_busy_fraction, tvb, offset, 1, info, "CCA Busy Fraction: 0x%02X", info);
5372 case 2: /* Receive power indication (RPI) histogram report */
5373 channel_number = tvb_get_guint8 (tvb, offset);
5374 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5377 start_time = tvb_get_letoh64 (tvb, offset);
5378 proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016" G_GINT64_MODIFIER "X", start_time);
5381 duration = tvb_get_letohs (tvb, offset);
5382 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_duration, tvb, offset, 2, duration, "Measurement Duration in TUs (1TU = 1024 us): 0x%04X", duration);
5385 parent_item = proto_tree_add_string(sub_tree, hf_tag_measure_rpi_histogram_report, tvb,
5386 offset, 8, "RPI Histogram Report");
5387 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5388 info = tvb_get_guint8 (tvb, offset);
5389 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_0, tvb, offset, 1, info, "RPI 0 Density: 0x%02X", info);
5390 info = tvb_get_guint8 (tvb, ++offset);
5391 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_1, tvb, offset, 1, info, "RPI 1 Density: 0x%02X", info);
5392 info = tvb_get_guint8 (tvb, ++offset);
5393 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_2, tvb, offset, 1, info, "RPI 2 Density: 0x%02X", info);
5394 info = tvb_get_guint8 (tvb, ++offset);
5395 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_3, tvb, offset, 1, info, "RPI 3 Density: 0x%02X", info);
5396 info = tvb_get_guint8 (tvb, ++offset);
5397 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_4, tvb, offset, 1, info, "RPI 4 Density: 0x%02X", info);
5398 info = tvb_get_guint8 (tvb, ++offset);
5399 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_5, tvb, offset, 1, info, "RPI 5 Density: 0x%02X", info);
5400 info = tvb_get_guint8 (tvb, ++offset);
5401 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_6, tvb, offset, 1, info, "RPI 6 Density: 0x%02X", info);
5402 info = tvb_get_guint8 (tvb, ++offset);
5403 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_7, tvb, offset, 1, info, "RPI 7 Density: 0x%02X", info);
5405 case 3: /* Channel Load Report */
5407 guint8 regulatory_class, channel_load;
5409 regulatory_class = tvb_get_guint8 (tvb, offset);
5410 proto_tree_add_uint(sub_tree, hf_tag_measure_report_regulatory_class, tvb, offset, 1, regulatory_class);
5413 channel_number = tvb_get_guint8 (tvb, offset);
5414 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5417 start_time = tvb_get_letoh64 (tvb, offset);
5418 proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016" G_GINT64_MODIFIER "X", start_time);
5421 duration = tvb_get_letohs (tvb, offset);
5422 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_duration, tvb, offset, 2, duration, "Measurement Duration in TUs (1TU = 1024 us): 0x%04X", duration);
5425 channel_load = tvb_get_guint8 (tvb, offset);
5426 proto_tree_add_uint(sub_tree, hf_tag_measure_report_channel_load, tvb, offset, 1, channel_load);
5429 case 4: /* Noise Histogram Report */
5431 proto_tree_add_text (sub_tree, tvb, offset, tag_len - (offset - tag_offset), "Undissected Data");
5433 case 5: /* Beacon Report */
5435 guint8 regulatory_class, reported_frame_info, rcpi, rsni, ant_id;
5437 proto_tree *sub_tree_frame_info;
5438 const guint8 *bssid = NULL;
5440 regulatory_class = tvb_get_guint8 (tvb, offset);
5441 proto_tree_add_uint(sub_tree, hf_tag_measure_report_regulatory_class, tvb, offset, 1, regulatory_class);
5444 channel_number = tvb_get_guint8 (tvb, offset);
5445 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_channel_number, tvb, offset, 1, channel_number, "Measurement Channel Number: 0x%02X", channel_number);
5448 start_time = tvb_get_letoh64 (tvb, offset);
5449 proto_tree_add_uint64_format(sub_tree, hf_tag_measure_report_start_time, tvb, offset, 8, start_time, "Measurement Start Time: 0x%016" G_GINT64_MODIFIER "X", start_time);
5452 duration = tvb_get_letohs (tvb, offset);
5453 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_duration, tvb, offset, 2, duration, "Measurement Duration in TUs (1TU = 1024 us): 0x%04X", duration);
5456 reported_frame_info = tvb_get_guint8 (tvb, offset);
5457 parent_item = proto_tree_add_uint(sub_tree, hf_tag_measure_report_frame_info, tvb, offset, 1, reported_frame_info);
5458 sub_tree_frame_info = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5459 proto_tree_add_uint(sub_tree_frame_info, hf_tag_measure_report_frame_info_phy_type, tvb, offset, 1, reported_frame_info);
5460 proto_tree_add_uint(sub_tree_frame_info, hf_tag_measure_report_frame_info_frame_type, tvb, offset, 1, reported_frame_info);
5463 rcpi = tvb_get_guint8 (tvb, offset);
5464 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_rcpi, tvb, offset, 1, rcpi, "Received Channel Power Indicator (RCPI): 0x%02X dBm", rcpi);
5467 rsni = tvb_get_guint8 (tvb, offset);
5468 proto_tree_add_uint_format(sub_tree, hf_tag_measure_report_rsni, tvb, offset, 1, rsni, "Received Signal to Noise Indicator (RSNI): 0x%02X dB", rsni);
5471 bssid = tvb_get_ptr (tvb, offset, 6);
5472 proto_tree_add_ether(sub_tree, hf_tag_measure_request_bssid, tvb, offset, 6, bssid);
5475 ant_id = tvb_get_guint8 (tvb, offset);
5476 proto_tree_add_uint(sub_tree, hf_tag_measure_report_ant_id, tvb, offset, 1, ant_id);
5479 parent_tsf = tvb_get_letohl (tvb, offset);
5480 proto_tree_add_uint(sub_tree, hf_tag_measure_report_parent_tsf, tvb, offset, 4, parent_tsf);
5483 /* TODO - Must determine frame type and dissect this */
5484 if (tag_len > (offset - tag_offset))
5486 proto_tree_add_text (sub_tree, tvb, offset, tag_len - (offset - tag_offset), "Reported Frame Body");
5490 case 6: /* Frame Report */
5492 case 7: /* BSTA Statistics Report */
5494 case 8: /* Location Configuration Information Report element */
5496 case 9: /* Transmit Stream Measurement Report */
5498 default: /* unknown */
5499 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Undissected Data");
5505 /*** End: Measure Report Tag - Dustin Johnson ***/
5506 /*** Begin: Extended Capabilities Tag - Dustin Johnson ***/
5507 /* The Capabilities field is a bit field indicating the capabilities being advertised
5508 * by the STA transmitting the information element
5510 case TAG_EXTENDED_CAPABILITIES:
5513 guint8 info_exchange;
5515 proto_tree *ex_cap_tree;
5519 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5520 "Extended Capabilities: Error: Tag length must be at least 1 byte long");
5524 tag_offset = offset;
5526 info_exchange = tvb_get_guint8 (tvb, offset);
5527 ti = proto_tree_add_item (tree, hf_tag_extended_capabilities, tvb, offset, 1, FALSE);
5528 ex_cap_tree = proto_item_add_subtree (ti, ett_tag_ex_cap);
5529 proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b0, tvb, offset, 1, FALSE);
5530 proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b1, tvb, offset, 1, FALSE);
5531 proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b2, tvb, offset, 1, FALSE);
5532 proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b3, tvb, offset, 1, FALSE);
5534 if (tag_len > (offset - tag_offset))
5536 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
5541 /*** End: Extended Capabilities Tag - Dustin Johnson ***/
5542 /*** Begin: Neighbor Report Tag - Dustin Johnson ***/
5543 case TAG_NEIGHBOR_REPORT:
5545 #define SUB_TAG_TSF_INFO 0x01
5546 #define SUB_TAG_MEASUREMENT_PILOT_INFO 0x02
5547 #define SUB_TAG_HT_CAPABILITIES 0x03
5548 #define SUB_TAG_HT_INFO 0x04
5549 #define SUB_TAG_SEC_CHANNEL_OFFSET 0x05
5550 #define SUB_TAG_VENDOR_SPECIFIC 0xDD
5555 guint32 bssid_info, info, sub_tag_length;
5556 const guint8 *bssid = NULL;
5557 proto_item *parent_item;
5558 proto_tree *bssid_info_subtree, *sub_tag_tree;
5559 tvbuff_t *volatile sub_tag_tvb = NULL;
5563 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5564 "Neighbor Report: Error: Tag length must be at least 13 bytes long");
5568 tag_offset = offset;
5570 bssid = tvb_get_ptr (tvb, offset, 6);
5571 proto_tree_add_ether(tree, hf_tag_neighbor_report_bssid, tvb, offset, 6, bssid);
5573 /*** Begin: BSSID Information ***/
5575 bssid_info = tvb_get_letohl (tvb, offset);
5576 parent_item = proto_tree_add_uint_format(tree, hf_tag_neighbor_report_bssid_info, tvb, offset, 4, bssid_info, "BSSID Information: 0x%08X", bssid_info);
5577 bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
5579 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_reachability, tvb, offset, 1, bssid_info);
5580 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_security, tvb, offset, 1, bssid_info);
5581 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 1, bssid_info);
5582 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 1, bssid_info);
5583 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 1, bssid_info);
5584 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 1, bssid_info);
5585 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 1, bssid_info);
5586 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_dback, tvb, offset+1, 1, bssid_info);
5587 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_iback, tvb, offset+1, 1, bssid_info);
5588 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset+1, 1, bssid_info);
5589 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_high_throughput, tvb, offset+1, 1, bssid_info);
5590 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_reserved, tvb, offset+1, 3, (bssid_info & 0xfffff000) >> 12);
5591 /*** End: BSSID Information ***/
5594 info = tvb_get_guint8 (tvb, offset);
5595 proto_tree_add_uint_format(tree, hf_tag_neighbor_report_reg_class, tvb, offset, 1, info, "Regulatory Class: 0x%02X", info);
5598 info = tvb_get_guint8 (tvb, offset);
5599 proto_tree_add_uint_format(tree, hf_tag_neighbor_report_channel_number, tvb, offset, 1, info, "Channel Number: 0x%02X", info);
5602 info = tvb_get_guint8 (tvb, offset);
5603 proto_tree_add_uint_format(tree, hf_tag_neighbor_report_phy_type, tvb, offset, 1, info, "PHY Type: 0x%02X", info);
5606 sub_tag_id = tvb_get_guint8 (tvb, offset);
5608 sub_tag_length = tvb_get_guint8 (tvb, offset);
5611 sub_tag_tvb = tvb_new_subset(tvb, offset, sub_tag_length, -1);
5613 switch (sub_tag_id) {
5614 case SUB_TAG_TSF_INFO:
5617 case SUB_TAG_MEASUREMENT_PILOT_INFO:
5620 case SUB_TAG_HT_CAPABILITIES:
5621 parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "HT Capabilities");
5622 sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
5623 dissect_ht_capability_ie(sub_tag_tree, sub_tag_tvb, 0, sub_tag_length, FALSE);
5625 case SUB_TAG_HT_INFO:
5626 parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "HT Information");
5627 sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
5628 dissect_ht_info_ie_1_1(sub_tag_tree, sub_tag_tvb, 0, sub_tag_length);
5630 case SUB_TAG_SEC_CHANNEL_OFFSET:
5631 parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "Secondary Channel Offset");
5632 sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
5633 secondary_channel_offset_ie(sub_tag_tree, sub_tag_tvb, 0, sub_tag_length);
5635 case SUB_TAG_VENDOR_SPECIFIC:
5640 offset += sub_tag_length;
5642 if (tag_len > (offset - tag_offset))
5644 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
5649 /*** End: Neighbor Report Tag - Dustin Johnson ***/
5650 #if 0 /*Not yet assigned tag numbers by ANA */
5651 /*** Begin: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
5652 case TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT:
5658 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5659 "Extended Channel Switch Announcement: Error: Tag length must be exactly 4 bytes long");
5664 tag_offset = offset;
5666 offset+= add_fixed_field(tree, tvb, offset, FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT);
5668 if (tag_len > (offset - tag_offset))
5670 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
5675 /*** End: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
5677 #if 0 /*Not yet assigned tag numbers by ANA */
5678 /*** Begin: Supported Regulatory Classes Tag - Dustin Johnson ***/
5679 case TAG_SUPPORTED_REGULATORY_CLASSES:
5682 guint8 current_field;
5685 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5686 "Supported Regulatory Classes: Error: Tag length must be at least 2 bytes long");
5688 } else if (tag_len > 32) {
5689 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5690 "Supported Regulatory Classes: Error: Tag length must be no more than 32 bytes long");
5695 tag_offset = offset;
5697 current_field = tvb_get_guint8 (tvb, offset);
5698 proto_tree_add_uint(tree, hf_tag_supported_reg_classes_current, tvb, offset, 1, current_field);
5701 /* Partially taken from the ssid section */
5702 tag_data_ptr = tvb_get_ptr (tvb, offset, tag_len);
5703 for (i = 0, n = 0; i < tag_len && n < SHORT_STR; i++) {
5704 ret = g_snprintf (print_buff + n, SHORT_STR - n, (i == tag_len-1)?"%d":"%d, ", tag_data_ptr[i]);
5705 if (ret == -1 || ret >= SHORT_STR - n) {
5706 /* Some versions of snprintf return -1 if they'd truncate
5707 the output. Others return <buf_size> or greater. */
5712 print_buff[SHORT_STR-1] = '\0';
5713 proto_tree_add_string (tree, hf_tag_supported_reg_classes_alternate, tvb, offset, tag_len, print_buff);
5717 /*** End: Supported Regulatory Classes Tag - Dustin Johnson ***/
5720 tvb_ensure_bytes_exist (tvb, offset + 2, tag_len);
5721 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 1 + tag_len_len,
5722 tag_len, "Not interpreted");
5723 proto_item_append_text(ti, ": Tag %u Len %u", tag_no, tag_len);
5727 return tag_len + 1 + tag_len_len;
5731 ieee_80211_add_tagged_parameters (tvbuff_t * tvb, int offset, packet_info * pinfo,
5732 proto_tree * tree, int tagged_parameters_len)
5736 beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
5737 while (tagged_parameters_len > 0) {
5738 if ((next_len=add_tagged_field (pinfo, tree, tvb, offset))==0)
5740 if (next_len > tagged_parameters_len) {
5741 /* XXX - flag this as an error? */
5742 next_len = tagged_parameters_len;
5745 tagged_parameters_len -= next_len;
5749 /* ************************************************************************* */
5750 /* Dissect 802.11 management frame */
5751 /* ************************************************************************* */
5753 dissect_ieee80211_mgt (guint16 fcf, tvbuff_t * tvb, packet_info * pinfo,
5756 proto_item *ti = NULL;
5757 proto_tree *mgt_tree;
5758 proto_tree *fixed_tree;
5759 proto_tree *tagged_tree;
5761 int tagged_parameter_tree_len;
5765 CHECK_DISPLAY_AS_X(data_handle,proto_wlan_mgt, tvb, pinfo, tree);
5767 ti = proto_tree_add_item (tree, proto_wlan_mgt, tvb, 0, -1, FALSE);
5768 mgt_tree = proto_item_add_subtree (ti, ett_80211_mgt);
5770 switch (COMPOSE_FRAME_TYPE(fcf))
5774 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 4);
5775 add_fixed_field(fixed_tree, tvb, 0, FIELD_CAP_INFO);
5776 add_fixed_field(fixed_tree, tvb, 2, FIELD_LISTEN_IVAL);
5777 offset = 4; /* Size of fixed fields */
5779 tagged_parameter_tree_len =
5780 tvb_reported_length_remaining(tvb, offset);
5781 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5782 tagged_parameter_tree_len);
5783 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5784 tagged_parameter_tree_len);
5788 case MGT_ASSOC_RESP:
5789 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
5790 add_fixed_field(fixed_tree, tvb, 0, FIELD_CAP_INFO);
5791 add_fixed_field(fixed_tree, tvb, 2, FIELD_STATUS_CODE);
5792 add_fixed_field(fixed_tree, tvb, 4, FIELD_ASSOC_ID);
5793 offset = 6; /* Size of fixed fields */
5795 tagged_parameter_tree_len =
5796 tvb_reported_length_remaining(tvb, offset);
5797 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5798 tagged_parameter_tree_len);
5799 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5800 tagged_parameter_tree_len);
5804 case MGT_REASSOC_REQ:
5805 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 10);
5806 add_fixed_field(fixed_tree, tvb, 0, FIELD_CAP_INFO);
5807 add_fixed_field(fixed_tree, tvb, 2, FIELD_LISTEN_IVAL);
5808 add_fixed_field(fixed_tree, tvb, 4, FIELD_CURRENT_AP_ADDR);
5809 offset = 10; /* Size of fixed fields */
5811 tagged_parameter_tree_len =
5812 tvb_reported_length_remaining(tvb, offset);
5813 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5814 tagged_parameter_tree_len);
5815 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5816 tagged_parameter_tree_len);
5819 case MGT_REASSOC_RESP:
5820 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
5821 add_fixed_field(fixed_tree, tvb, 0, FIELD_CAP_INFO);
5822 add_fixed_field(fixed_tree, tvb, 2, FIELD_STATUS_CODE);
5823 add_fixed_field(fixed_tree, tvb, 4, FIELD_ASSOC_ID);
5824 offset = 6; /* Size of fixed fields */
5826 tagged_parameter_tree_len =
5827 tvb_reported_length_remaining(tvb, offset);
5828 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5829 tagged_parameter_tree_len);
5830 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5831 tagged_parameter_tree_len);
5837 tagged_parameter_tree_len =
5838 tvb_reported_length_remaining(tvb, offset);
5839 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5840 tagged_parameter_tree_len);
5841 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5842 tagged_parameter_tree_len);
5845 case MGT_PROBE_RESP:
5847 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
5848 add_fixed_field(fixed_tree, tvb, 0, FIELD_TIMESTAMP);
5849 add_fixed_field(fixed_tree, tvb, 8, FIELD_BEACON_INTERVAL);
5850 add_fixed_field(fixed_tree, tvb, 10, FIELD_CAP_INFO);
5851 offset = 12; /* Size of fixed fields */
5853 tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
5854 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
5855 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len);
5858 case MGT_MEASUREMENT_PILOT:
5860 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
5861 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_TIMESTAMP);
5862 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_MEASUREMENT_PILOT_INT);
5863 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_BEACON_INTERVAL);
5864 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_CAP_INFO);
5865 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_COUNTRY_STR);
5866 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_MAX_REG_PWR);
5867 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_MAX_TX_PWR);
5868 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_TX_PWR_USED);
5869 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_TRANSCEIVER_NOISE_FLOOR);
5870 /* TODO DS Parameter Set ??? */
5872 tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
5873 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
5874 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len);
5877 case MGT_BEACON: /* Dissect protocol payload fields */
5878 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
5879 add_fixed_field(fixed_tree, tvb, 0, FIELD_TIMESTAMP);
5880 add_fixed_field(fixed_tree, tvb, 8, FIELD_BEACON_INTERVAL);
5881 add_fixed_field(fixed_tree, tvb, 10, FIELD_CAP_INFO);
5882 offset = 12; /* Size of fixed fields */
5884 tagged_parameter_tree_len =
5885 tvb_reported_length_remaining(tvb, offset);
5886 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5887 tagged_parameter_tree_len);
5888 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5889 tagged_parameter_tree_len);
5896 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
5897 add_fixed_field(fixed_tree, tvb, 0, FIELD_REASON_CODE);
5900 case MGT_AUTHENTICATION:
5901 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
5902 add_fixed_field(fixed_tree, tvb, 0, FIELD_AUTH_ALG);
5903 add_fixed_field(fixed_tree, tvb, 2, FIELD_AUTH_TRANS_SEQ);
5904 add_fixed_field(fixed_tree, tvb, 4, FIELD_STATUS_CODE);
5905 offset = 6; /* Size of fixed fields */
5907 tagged_parameter_tree_len =
5908 tvb_reported_length_remaining(tvb, offset);
5909 if (tagged_parameter_tree_len != 0)
5911 tagged_tree = get_tagged_parameter_tree (mgt_tree,
5914 tagged_parameter_tree_len);
5915 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5916 tagged_parameter_tree_len);
5920 case MGT_DEAUTHENTICATION:
5921 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
5922 add_fixed_field(fixed_tree, tvb, 0, FIELD_REASON_CODE);
5927 proto_item *fixed_hdr;
5928 proto_tree *fixed_tree;
5929 fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters");
5930 fixed_tree = proto_item_add_subtree (fixed_hdr, ett_fixed_parameters);
5932 offset += add_fixed_field(fixed_tree, tvb, 0, FIELD_ACTION);
5934 proto_item_set_len(fixed_hdr, offset);
5935 tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
5936 if (tagged_parameter_tree_len != 0)
5938 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5939 tagged_parameter_tree_len);
5940 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5941 tagged_parameter_tree_len);
5945 case MGT_ACTION_NO_ACK:
5947 proto_item *fixed_hdr;
5948 proto_tree *fixed_tree;
5949 fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters");
5950 fixed_tree = proto_item_add_subtree (fixed_hdr, ett_fixed_parameters);
5952 offset += add_fixed_field(fixed_tree, tvb, 0, FIELD_ACTION);
5954 proto_item_set_len(fixed_hdr, offset);
5955 tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
5956 if (tagged_parameter_tree_len != 0)
5958 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5959 tagged_parameter_tree_len);
5960 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5961 tagged_parameter_tree_len);
5965 case MGT_ARUBA_WLAN:
5967 proto_item *aruba_hdr;
5968 proto_tree *aruba_tree;
5970 type = tvb_get_ntohs(tvb, offset);
5972 aruba_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Aruba Management");
5973 aruba_tree = proto_item_add_subtree(aruba_hdr, ett_fixed_parameters);
5975 proto_tree_add_item(aruba_tree, cf_aruba, tvb, offset, 2, FALSE);
5977 /* HeartBeat Sequence */
5978 if ( type == 0x0005 )
5980 proto_tree_add_item(aruba_tree, cf_aruba_hb_seq, tvb, offset, 8, FALSE);
5983 if ( type == 0x0003 )
5985 proto_tree_add_item(aruba_tree, cf_aruba_mtu, tvb, offset, 2, FALSE);
5993 set_src_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type)
5995 if (check_col(pinfo->cinfo, COL_RES_DL_SRC))
5996 col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
5997 get_ether_name(addr), type);
5998 if (check_col(pinfo->cinfo, COL_UNRES_DL_SRC))
5999 col_add_str(pinfo->cinfo, COL_UNRES_DL_SRC, ether_to_str(addr));
6003 set_dst_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type)
6005 if (check_col(pinfo->cinfo, COL_RES_DL_DST))
6006 col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
6007 get_ether_name(addr), type);
6008 if (check_col(pinfo->cinfo, COL_UNRES_DL_DST))
6009 col_add_str(pinfo->cinfo, COL_UNRES_DL_DST, ether_to_str(addr));
6013 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
6017 c_crc = crc32_ccitt_tvb(tvb, hdr_len);
6018 c_crc = crc32_ccitt_seed(tvb_get_ptr(tvb, hdr_size, len), len, ~c_crc);
6021 c_crc = ((unsigned char)(c_crc>>0)<<24) |
6022 ((unsigned char)(c_crc>>8)<<16) |
6023 ((unsigned char)(c_crc>>16)<<8) |
6024 ((unsigned char)(c_crc>>24)<<0);
6036 /* ************************************************************************* */
6037 /* Dissect 802.11 frame */
6038 /* ************************************************************************* */
6041 * The 802.11n specification makes some fairly significant changes to the
6042 * layout of the MAC header. The first two bits of the MAC header are the
6043 * protocol version. You'd think that the 802.11 committee would have
6044 * bumped the version to indicate a different MAC layout, but NOOOO -- we
6045 * have to go digging for bits in various locations instead.
6049 dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo,
6050 proto_tree * tree, gboolean fixed_length_header, gint fcs_len,
6051 gboolean wlan_broken_fc, gboolean datapad,
6054 guint16 fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
6055 guint16 seq_control;
6056 guint32 seq_number, frag_number;
6057 gboolean more_frags;
6058 const guint8 *src = NULL;
6059 const guint8 *dst = NULL;
6060 const guint8 *bssid = NULL;
6061 proto_item *ti = NULL;
6062 proto_item *fcs_item = NULL;
6063 proto_item *cw_item = NULL;
6064 proto_item *hidden_item;
6065 proto_tree *hdr_tree = NULL;
6066 proto_tree *fcs_tree = NULL;
6067 proto_tree *cw_tree = NULL;
6068 guint16 hdr_len, ohdr_len, htc_len = 0;
6069 gboolean has_fcs, fcs_good, fcs_bad;
6070 gint len, reported_len, ivlen;
6071 gboolean is_amsdu = 0;
6072 gboolean save_fragmented;
6073 tvbuff_t *volatile next_tvb = NULL;
6075 volatile encap_t encap_type;
6076 guint8 octet1, octet2;
6077 char out_buff[SHORT_STR];
6080 const char *addr1_str = NULL;
6083 const gchar *fts_str;
6084 gchar flag_str[] = "opmPRMFTC";
6087 wlan_hdr *volatile whdr;
6088 static wlan_hdr whdrs[4];
6089 gboolean retransmitted;
6093 if (check_col (pinfo->cinfo, COL_PROTOCOL))
6094 col_set_str (pinfo->cinfo, COL_PROTOCOL, "IEEE 802.11");
6095 if (check_col (pinfo->cinfo, COL_INFO))
6096 col_clear (pinfo->cinfo, COL_INFO);
6099 frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
6100 if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
6101 ctrl_fcf = FETCH_FCF(10);
6105 if (fixed_length_header)
6106 hdr_len = DATA_LONG_HDR_LEN;
6108 hdr_len = find_header_length (fcf, ctrl_fcf, is_ht);
6111 hdr_len = roundup2(hdr_len, 4);
6113 fts_str = val_to_str(frame_type_subtype, frame_type_subtype_vals,
6114 "Unrecognized (Reserved frame)");
6115 if (check_col (pinfo->cinfo, COL_INFO))
6116 col_set_str (pinfo->cinfo, COL_INFO, fts_str);
6119 flags = FCF_FLAGS (fcf);
6120 more_frags = HAVE_FRAGMENTS (flags);
6122 for (i = 0; i < 8; i++) {
6123 if (! (flags & 0x80 >> i)) {
6128 if (is_ht && IS_STRICTLY_ORDERED(flags) &&
6129 ((FCF_FRAME_TYPE(fcf) == MGT_FRAME) || (FCF_FRAME_TYPE(fcf) == DATA_FRAME &&
6130 DATA_FRAME_IS_QOS(frame_type_subtype)))) {
6134 /* Add the FC to the current tree */
6137 ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
6138 "IEEE 802.11 %s", fts_str);
6139 hdr_tree = proto_item_add_subtree (ti, ett_80211);
6141 dissect_frame_control(hdr_tree, tvb, wlan_broken_fc, 0);
6143 if (frame_type_subtype == CTRL_PS_POLL)
6144 proto_tree_add_uint(hdr_tree, hf_assoc_id,tvb,2,2,
6145 ASSOC_ID(tvb_get_letohs(tvb,2)));
6148 proto_tree_add_uint (hdr_tree, hf_did_duration, tvb, 2, 2,
6149 tvb_get_letohs (tvb, 2));
6153 * Decode the part of the frame header that isn't the same for all
6160 switch (FCF_FRAME_TYPE (fcf))
6165 * All management frame types have the same header.
6167 src = tvb_get_ptr (tvb, 10, 6);
6168 dst = tvb_get_ptr (tvb, 4, 6);
6170 SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, src);
6171 SET_ADDRESS(&pinfo->src, AT_ETHER, 6, src);
6172 SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, dst);
6173 SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, dst);
6176 SET_ADDRESS(&whdr->bssid, AT_ETHER, 6, tvb_get_ptr(tvb, 16,6));
6177 SET_ADDRESS(&whdr->src, AT_ETHER, 6, src);
6178 SET_ADDRESS(&whdr->dst, AT_ETHER, 6, dst);
6179 whdr->type = frame_type_subtype;
6181 seq_control = tvb_get_letohs(tvb, 22);
6182 frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
6183 seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
6185 if (check_col (pinfo->cinfo, COL_INFO))
6187 col_append_fstr(pinfo->cinfo, COL_INFO,
6188 ", SN=%d", seq_number);
6190 col_append_fstr(pinfo->cinfo, COL_INFO,
6191 ", FN=%d",frag_number);
6196 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 4, 6, dst);
6198 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 10, 6, src);
6200 /* add items for wlan.addr filter */
6201 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 4, 6, dst);
6202 PROTO_ITEM_SET_HIDDEN(hidden_item);
6203 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 10, 6, src);
6204 PROTO_ITEM_SET_HIDDEN(hidden_item);
6206 proto_tree_add_ether (hdr_tree, hf_addr_bssid, tvb, 16, 6,
6207 tvb_get_ptr (tvb, 16, 6));
6209 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6212 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6220 * Control Wrapper frames insert themselves between address 1
6221 * and address 2 in a normal control frame. Process address 1
6222 * first, then handle the rest of the frame in dissect_control.
6224 if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
6225 offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
6226 ctrl_fcf = FETCH_FCF(10);
6227 ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
6229 offset = 10; /* FC + D/ID + Address 1 */
6231 ctrl_type_subtype = frame_type_subtype;
6234 switch (ctrl_type_subtype)
6237 addr1_str = "BSSID";
6238 addr1_hf = hf_addr_bssid;
6242 case CTRL_ACKNOWLEDGEMENT:
6244 case CTRL_CFP_ENDACK:
6245 case CTRL_BLOCK_ACK_REQ:
6246 case CTRL_BLOCK_ACK:
6248 addr1_hf = hf_addr_ra;
6254 if (!addr1_str) /* XXX - Should we throw some sort of error? */
6258 dst = tvb_get_ptr(tvb, 4, 6);
6259 set_dst_addr_cols(pinfo, dst, addr1_str);
6261 proto_tree_add_item(hdr_tree, addr1_hf, tvb, 4, 6, FALSE);
6265 * Start shoving in other fields if needed.
6266 * XXX - Should we look for is_ht as well?
6268 if (frame_type_subtype == CTRL_CONTROL_WRAPPER && tree) {
6269 cw_item = proto_tree_add_text(hdr_tree, tvb, offset, 2,
6270 "Contained Frame Control");
6271 cw_tree = proto_item_add_subtree (cw_item, ett_cntrl_wrapper_fc);
6272 dissect_frame_control(cw_tree, tvb, FALSE, offset);
6273 dissect_ht_control(hdr_tree, tvb, offset + 2);
6275 cw_item = proto_tree_add_text(hdr_tree, tvb, offset, 2,
6277 hdr_tree = proto_item_add_subtree (cw_item, ett_cntrl_wrapper_fc);
6280 switch (ctrl_type_subtype)
6284 case CTRL_CFP_ENDACK:
6286 src = tvb_get_ptr (tvb, offset, 6);
6287 set_src_addr_cols(pinfo, src, "BSSID");
6289 proto_tree_add_item(hdr_tree, hf_addr_ta, tvb, offset, 6, FALSE);
6296 src = tvb_get_ptr (tvb, offset, 6);
6297 set_src_addr_cols(pinfo, src, "TA");
6299 proto_tree_add_item(hdr_tree, hf_addr_ta, tvb, offset, 6, FALSE);
6304 case CTRL_CONTROL_WRAPPER:
6306 /* XXX - We shouldn't see this. Should we throw an error? */
6310 /*** Begin: Block Ack Request - Dustin Johnson ***/
6311 case CTRL_BLOCK_ACK_REQ:
6313 src = tvb_get_ptr (tvb, offset, 6);
6314 set_src_addr_cols(pinfo, src, "TA");
6318 guint16 bar_control;
6319 guint8 block_ack_type;
6320 proto_item *bar_parent_item;
6321 proto_tree *bar_sub_tree;
6323 proto_tree_add_item(hdr_tree, hf_addr_ta, tvb, offset, 6, FALSE);
6326 bar_control = tvb_get_letohs(tvb, offset);
6327 block_ack_type = (bar_control & 0x0006) >> 1;
6328 proto_tree_add_uint(hdr_tree, hf_block_ack_request_type, tvb,
6329 offset, 1, block_ack_type);
6330 bar_parent_item = proto_tree_add_uint_format(hdr_tree,
6331 hf_block_ack_request_control, tvb, offset, 2, bar_control,
6332 "Block Ack Request (BAR) Control: 0x%04X", bar_control);
6333 bar_sub_tree = proto_item_add_subtree(bar_parent_item,
6335 proto_tree_add_boolean(bar_sub_tree,
6336 hf_block_ack_control_ack_policy, tvb, offset, 1, bar_control);
6337 proto_tree_add_boolean(bar_sub_tree, hf_block_ack_control_multi_tid,
6338 tvb, offset, 1, bar_control);
6339 proto_tree_add_boolean(bar_sub_tree,
6340 hf_block_ack_control_compressed_bitmap, tvb, offset, 1,
6342 proto_tree_add_uint(bar_sub_tree, hf_block_ack_control_reserved,
6343 tvb, offset, 2, bar_control);
6345 switch (block_ack_type)
6347 case 0: /*Basic BlockAckReq */
6349 proto_tree_add_uint(bar_sub_tree,
6350 hf_block_ack_control_basic_tid_info, tvb, offset+1, 1,
6354 offset += add_fixed_field(hdr_tree, tvb, offset,
6355 FIELD_BLOCK_ACK_SSC);
6358 case 2: /* Compressed BlockAckReq */
6360 proto_tree_add_uint(bar_sub_tree,
6361 hf_block_ack_control_compressed_tid_info, tvb, offset+1, 1,
6365 offset += add_fixed_field(hdr_tree, tvb, offset,
6366 FIELD_BLOCK_ACK_SSC);
6369 case 3: /* Multi-TID BlockAckReq */
6371 guint8 tid_count, i;
6372 proto_tree *bar_mtid_tree, *bar_mtid_sub_tree;
6374 tid_count = ((bar_control & 0xF000) >> 12) + 1;
6375 proto_tree_add_uint_format(bar_sub_tree, hf_block_ack_control_compressed_tid_info, tvb, offset+1, 1, bar_control,
6376 decode_numeric_bitfield(bar_control, 0xF000, 16,"Number of TIDs Present: 0x%%X"), tid_count);
6379 bar_parent_item = proto_tree_add_text (hdr_tree, tvb, offset, tid_count*4, "Per TID Info");
6380 bar_mtid_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
6381 for (i = 1; i <= tid_count; i++) {
6382 bar_parent_item = proto_tree_add_uint(bar_mtid_tree, hf_block_ack_multi_tid_info, tvb, offset, 4, i);
6383 bar_mtid_sub_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
6385 bar_control = tvb_get_letohs(tvb, offset);
6386 proto_tree_add_uint(bar_mtid_sub_tree, hf_block_ack_multi_tid_reserved, tvb, offset, 2, bar_control);
6387 proto_tree_add_uint(bar_mtid_sub_tree, hf_block_ack_multi_tid_value, tvb, offset+1, 1, bar_control);
6390 offset += add_fixed_field(bar_mtid_sub_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
6398 /*** End: Block Ack Request - Dustin Johnson ***/
6400 /*** Begin: Block Ack - Dustin Johnson ***/
6401 case CTRL_BLOCK_ACK:
6403 src = tvb_get_ptr (tvb, offset, 6);
6404 set_src_addr_cols(pinfo, src, "TA");
6409 guint8 block_ack_type;
6410 proto_item *ba_parent_item;
6411 proto_tree *ba_sub_tree;
6413 proto_tree_add_item(hdr_tree, hf_addr_ta, tvb, offset, 6, FALSE);
6416 ba_control = tvb_get_letohs(tvb, offset);
6417 block_ack_type = (ba_control & 0x0006) >> 1;
6418 proto_tree_add_uint(hdr_tree, hf_block_ack_type, tvb, offset, 1, block_ack_type);
6419 ba_parent_item = proto_tree_add_uint_format(hdr_tree,
6420 hf_block_ack_control, tvb, offset, 2, ba_control,
6421 "Block Ack (BA) Control: 0x%04X", ba_control);
6422 ba_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
6423 proto_tree_add_boolean(ba_sub_tree, hf_block_ack_control_ack_policy,
6424 tvb, offset, 1, ba_control);
6425 proto_tree_add_boolean(ba_sub_tree, hf_block_ack_control_multi_tid,
6426 tvb, offset, 1, ba_control);
6427 proto_tree_add_boolean(ba_sub_tree,
6428 hf_block_ack_control_compressed_bitmap, tvb, offset, 1,
6430 proto_tree_add_uint(ba_sub_tree, hf_block_ack_control_reserved, tvb,
6431 offset, 2, ba_control);
6433 switch (block_ack_type)
6435 case 0: /*Basic BlockAck */
6437 proto_tree_add_uint(ba_sub_tree,
6438 hf_block_ack_control_basic_tid_info, tvb, offset+1, 1,
6442 offset += add_fixed_field(hdr_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
6443 proto_tree_add_text(hdr_tree, tvb, offset, 128, "Block Ack Bitmap");
6447 case 2: /* Compressed BlockAck */
6449 proto_tree_add_uint(ba_sub_tree, hf_block_ack_control_basic_tid_info, tvb, offset+1, 1, ba_control);
6452 offset += add_fixed_field(hdr_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
6453 proto_tree_add_text(hdr_tree, tvb, offset, 8, "Block Ack Bitmap");
6457 case 3: /* Multi-TID BlockAck */
6459 guint8 tid_count, i;
6460 proto_tree *ba_mtid_tree, *ba_mtid_sub_tree;
6462 tid_count = ((ba_control & 0xF000) >> 12) + 1;
6463 proto_tree_add_uint_format(ba_sub_tree,
6464 hf_block_ack_control_compressed_tid_info, tvb, offset+1, 1,
6465 ba_control, decode_numeric_bitfield(ba_control, 0xF000,
6466 16,"Number of TIDs Present: 0x%%X"), tid_count);
6469 ba_parent_item = proto_tree_add_text (hdr_tree, tvb, offset, tid_count*4, "Per TID Info");
6470 ba_mtid_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
6471 for (i=1; i<=tid_count; i++) {
6472 ba_parent_item = proto_tree_add_uint(ba_mtid_tree, hf_block_ack_multi_tid_info, tvb, offset, 4, i);
6473 ba_mtid_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
6475 ba_control = tvb_get_letohs(tvb, offset);
6476 proto_tree_add_uint(ba_mtid_sub_tree, hf_block_ack_multi_tid_reserved, tvb, offset, 2, ba_control);
6477 proto_tree_add_uint(ba_mtid_sub_tree, hf_block_ack_multi_tid_value, tvb, offset+1, 1, ba_control);
6480 offset += add_fixed_field(ba_mtid_sub_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
6481 proto_tree_add_text(ba_mtid_sub_tree, tvb, offset, 8, "Block Ack Bitmap");
6490 /*** End: Block Ack - Dustin Johnson ***/
6496 addr_type = FCF_ADDR_SELECTOR (fcf);
6498 /* In order to show src/dst address we must always do the following */
6503 src = tvb_get_ptr (tvb, 10, 6);
6504 dst = tvb_get_ptr (tvb, 4, 6);
6505 bssid = tvb_get_ptr (tvb, 16, 6);
6509 src = tvb_get_ptr (tvb, 16, 6);
6510 dst = tvb_get_ptr (tvb, 4, 6);
6511 bssid = tvb_get_ptr (tvb, 10, 6);
6515 src = tvb_get_ptr (tvb, 10, 6);
6516 dst = tvb_get_ptr (tvb, 16, 6);
6517 bssid = tvb_get_ptr (tvb, 4, 6);
6521 src = tvb_get_ptr (tvb, 24, 6);
6522 dst = tvb_get_ptr (tvb, 16, 6);
6523 bssid = tvb_get_ptr (tvb, 16, 6);
6527 SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, src);
6528 SET_ADDRESS(&pinfo->src, AT_ETHER, 6, src);
6529 SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, dst);
6530 SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, dst);
6534 SET_ADDRESS(&whdr->bssid, AT_ETHER, 6, bssid);
6535 SET_ADDRESS(&whdr->src, AT_ETHER, 6, src);
6536 SET_ADDRESS(&whdr->dst, AT_ETHER, 6, dst);
6537 whdr->type = frame_type_subtype;
6539 seq_control = tvb_get_letohs(tvb, 22);
6540 frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
6541 seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
6543 if (check_col (pinfo->cinfo, COL_INFO))
6545 col_append_fstr(pinfo->cinfo, COL_INFO,
6546 ", SN=%d", seq_number);
6548 col_append_fstr(pinfo->cinfo, COL_INFO,
6549 ", FN=%d",frag_number);
6552 /* Now if we have a tree we start adding stuff */
6560 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 4, 6, dst);
6561 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 10, 6, src);
6562 proto_tree_add_ether (hdr_tree, hf_addr_bssid, tvb, 16, 6,
6563 tvb_get_ptr (tvb, 16, 6));
6564 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6566 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6569 /* add items for wlan.addr filter */
6570 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 4, 6, dst);
6571 PROTO_ITEM_SET_HIDDEN(hidden_item);
6572 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 10, 6, src);
6573 PROTO_ITEM_SET_HIDDEN(hidden_item);
6577 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 4, 6, dst);
6578 proto_tree_add_ether (hdr_tree, hf_addr_bssid, tvb, 10, 6,
6579 tvb_get_ptr (tvb, 10, 6));
6580 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 16, 6, src);
6581 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6583 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6586 /* add items for wlan.addr filter */
6587 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 4, 6, dst);
6588 PROTO_ITEM_SET_HIDDEN(hidden_item);
6589 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 16, 6, src);
6590 PROTO_ITEM_SET_HIDDEN(hidden_item);
6594 proto_tree_add_ether (hdr_tree, hf_addr_bssid, tvb, 4, 6,
6595 tvb_get_ptr (tvb, 4, 6));
6596 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 10, 6, src);
6597 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 16, 6, dst);
6599 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6601 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6604 /* add items for wlan.addr filter */
6605 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 10, 6, src);
6606 PROTO_ITEM_SET_HIDDEN(hidden_item);
6607 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 16, 6, dst);
6608 PROTO_ITEM_SET_HIDDEN(hidden_item);
6612 proto_tree_add_ether (hdr_tree, hf_addr_ra, tvb, 4, 6,
6613 tvb_get_ptr (tvb, 4, 6));
6614 proto_tree_add_ether (hdr_tree, hf_addr_ta, tvb, 10, 6,
6615 tvb_get_ptr (tvb, 10, 6));
6616 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 16, 6, dst);
6617 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6619 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6621 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 24, 6, src);
6623 /* add items for wlan.addr filter */
6624 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 16, 6, dst);
6625 PROTO_ITEM_SET_HIDDEN(hidden_item);
6626 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 24, 6, src);
6627 PROTO_ITEM_SET_HIDDEN(hidden_item);
6635 len = tvb_length_remaining(tvb, hdr_len);
6636 reported_len = tvb_reported_length_remaining(tvb, hdr_len);
6640 case 0: /* Definitely has no FCS */
6644 case 4: /* Definitely has an FCS */
6648 default: /* Don't know - use "wlan_check_fcs" */
6649 has_fcs = wlan_check_fcs;
6655 * Well, this packet should, in theory, have an FCS.
6656 * Do we have the entire packet, and does it have enough data for
6659 if (reported_len < 4)
6662 * The packet is claimed not to even have enough data for a 4-byte
6664 * Pretend it doesn't have an FCS.
6668 else if (len < reported_len)
6671 * The packet is claimed to have enough data for a 4-byte FCS, but
6672 * we didn't capture all of the packet.
6673 * Slice off the 4-byte FCS from the reported length, and trim the
6674 * captured length so it's no more than the reported length; that
6675 * will slice off what of the FCS, if any, is in the captured
6679 if (len > reported_len)
6685 * We have the entire packet, and it includes a 4-byte FCS.
6686 * Slice it off, and put it into the tree.
6692 guint32 sent_fcs = tvb_get_ntohl(tvb, hdr_len + len);
6696 fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
6698 fcs = crc32_802_tvb(tvb, hdr_len + len);
6699 if (fcs == sent_fcs) {
6708 fcs_item = proto_tree_add_uint_format(hdr_tree, hf_fcs, tvb,
6709 hdr_len + len, 4, sent_fcs,
6710 "Frame check sequence: 0x%08x [correct]", sent_fcs);
6712 fcs_item = proto_tree_add_uint_format(hdr_tree, hf_fcs, tvb,
6713 hdr_len + len, 4, sent_fcs,
6714 "Frame check sequence: 0x%08x [incorrect, should be 0x%08x]",
6719 proto_tree_set_appendix(hdr_tree, tvb, hdr_len + len, 4);
6721 fcs_tree = proto_item_add_subtree(fcs_item, ett_fcs);
6723 fcs_item = proto_tree_add_boolean(fcs_tree,
6727 PROTO_ITEM_SET_GENERATED(fcs_item);
6729 fcs_item = proto_tree_add_boolean(fcs_tree,
6733 PROTO_ITEM_SET_GENERATED(fcs_item);
6740 proto_item_append_text(ti, ", Flags: %s", flag_str);
6741 if (check_col (pinfo->cinfo, COL_INFO))
6742 col_append_fstr (pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
6746 * Only management and data frames have a body, so we don't have
6747 * anything more to do for other types of frames.
6749 switch (FCF_FRAME_TYPE (fcf))
6754 dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
6759 if (tree && DATA_FRAME_IS_QOS(frame_type_subtype))
6761 proto_item *qos_fields;
6762 proto_tree *qos_tree;
6765 guint16 qos_control;
6766 guint16 qos_priority;
6767 guint16 qos_ack_policy;
6768 guint16 qos_amsdu_present;
6770 guint16 qos_field_content;
6773 * We calculate the offset to the QoS header data as
6774 * an offset relative to the end of the header. But
6775 * when the header has been padded to align the data
6776 * this must be done relative to true header size, not
6777 * the padded/aligned value. To simplify this work we
6778 * stash the original header size in ohdr_len instead
6779 * of recalculating it.
6781 qosoff = ohdr_len - htc_len - 2;
6782 qos_fields = proto_tree_add_text(hdr_tree, tvb, qosoff, 2,
6784 qos_tree = proto_item_add_subtree (qos_fields, ett_qos_parameters);
6786 qos_control = tvb_get_letohs(tvb, qosoff + 0);
6787 qos_priority = QOS_PRIORITY(qos_control);
6788 qos_ack_policy = QOS_ACK_POLICY(qos_control);
6789 qos_amsdu_present = QOS_AMSDU_PRESENT(qos_control);
6790 qos_eosp = QOS_EOSP(qos_control);
6791 qos_field_content = QOS_FIELD_CONTENT(qos_control);
6793 proto_tree_add_uint_format (qos_tree, hf_qos_priority, tvb,
6794 qosoff, 1, qos_priority,
6795 "Priority: %d (%s) (%s)",
6796 qos_priority, qos_tags[qos_priority], qos_acs[qos_priority]);
6798 if (flags & FLAG_FROM_DS) {
6799 proto_tree_add_boolean (qos_tree, hf_qos_eosp, tvb,
6800 qosoff, 1, qos_control);
6803 proto_tree_add_uint (qos_tree, hf_qos_ack_policy, tvb, qosoff, 1,
6806 if (flags & FLAG_FROM_DS) {
6807 if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
6808 proto_tree_add_boolean(qos_tree, hf_qos_amsdu_present, tvb,
6809 qosoff, 1, qos_amsdu_present);
6810 is_amsdu = qos_amsdu_present;
6812 if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
6814 proto_tree_add_uint_format (qos_tree, hf_qos_field_content, tvb,
6815 qosoff + 1, 1, qos_field_content, "Transmit Opportunity (TXOP) Limit: 0x%02X", qos_field_content);
6818 /* qap ps buffer state */
6819 proto_item *qos_ps_buf_state_fields;
6820 proto_tree *qos_ps_buf_state_tree;
6825 buf_state = QOS_PS_BUF_STATE(qos_field_content);
6826 buf_ac = QOS_PS_BUF_AC(qos_field_content); /*access category */
6827 buf_load = QOS_PS_BUF_LOAD(qos_field_content);
6829 qos_ps_buf_state_fields = proto_tree_add_text(qos_tree, tvb, qosoff + 1, 1,
6830 "QAP PS Buffer State: 0x%x", qos_field_content);
6831 qos_ps_buf_state_tree = proto_item_add_subtree (qos_ps_buf_state_fields, ett_qos_ps_buf_state);
6833 /* FIXME: hf_ values not defined
6834 proto_tree_add_boolean (qos_ps_buf_state_tree, hf_qos_buf_state, tvb,
6837 proto_tree_add_uint_format (qos_ps_buf_state_tree, hf_qos_buf_ac, tvb,
6838 qosoff + 1, 1, buf_ac, "Priority: %d (%s)",
6839 buf_ac, wme_acs[buf_ac]);
6841 proto_tree_add_uint_format (qos_ps_buf_state_tree, hf_qos_buf_load, tvb,
6842 qosoff + 1, 1, buf_load, "Buffered load: %d ", (buf_load * 4096));
6847 if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
6848 proto_tree_add_boolean(qos_tree, hf_qos_amsdu_present, tvb,
6849 qosoff, 1, qos_amsdu_present);
6850 is_amsdu = qos_amsdu_present;
6853 /* txop limit requested */
6854 proto_tree_add_uint_format (qos_tree, hf_qos_field_content, tvb,
6855 qosoff + 1, 1, qos_field_content, "Queue Size: %d", (qos_field_content * 254));
6858 proto_tree_add_uint_format (qos_tree, hf_qos_field_content, tvb,
6859 qosoff + 1, 1, qos_field_content, "Transmit Opportunity (TXOP) Limit Requested: 0x%02X", qos_field_content);
6863 /* Do we have +HTC? */
6865 dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
6867 } /* end of qos control field */
6869 #ifdef HAVE_AIRPDCAP
6870 /* Davide Schiera (2006-11-21): process handshake packet with AirPDcap */
6871 /* the processing will take care of 4-way handshake sessions for WPA */
6872 /* and WPA2 decryption */
6873 if (enable_decryption && !pinfo->fd->flags.visited) {
6874 const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
6875 AirPDcapPacketProcess(&airpdcap_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE, FALSE);
6877 /* Davide Schiera -------------------------------------------------------- */
6881 * No-data frames don't have a body.
6883 if (DATA_FRAME_IS_NULL(frame_type_subtype))
6886 if (!wlan_subdissector) {
6890 * data: last seq_control seen and frame number
6892 retransmitted = FALSE;
6893 if(!pinfo->fd->flags.visited){
6895 retransmit_key *result;
6897 memcpy(key.bssid, bssid, 6);
6898 memcpy(key.src, src, 6);
6899 key.seq_control = 0;
6900 result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
6901 if (result && result->seq_control == seq_control) {
6902 /* keep a pointer to the first seen frame, could be done with proto data? */
6903 fnum = result->fnum;
6904 g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER( pinfo->fd->num),
6905 GINT_TO_POINTER(fnum));
6906 retransmitted = TRUE;
6908 /* first time or new seq*/
6910 result = se_alloc(sizeof(retransmit_key));
6912 g_hash_table_insert(fc_analyse_retransmit_table, result, result);
6914 result->seq_control = seq_control;
6915 result->fnum = pinfo->fd->num;
6918 else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER( pinfo->fd->num))))) {
6919 retransmitted = TRUE;
6922 if (retransmitted) {
6923 if (check_col (pinfo->cinfo, COL_INFO))
6924 col_append_fstr(pinfo->cinfo, COL_INFO, " [retransmitted]");
6928 item=proto_tree_add_none_format(hdr_tree, hf_fc_analysis_retransmission, tvb, 0, 0, "Retransmitted frame");
6929 PROTO_ITEM_SET_GENERATED(item);
6930 item=proto_tree_add_uint(hdr_tree, hf_fc_analysis_retransmission_frame,tvb, 0, 0, fnum);
6931 PROTO_ITEM_SET_GENERATED(item);
6933 next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
6934 call_dissector(data_handle, next_tvb, pinfo, tree);
6948 if (IS_PROTECTED(FCF_FLAGS(fcf)) && wlan_ignore_wep != WLAN_IGNORE_WEP_WO_IV) {
6950 * It's a WEP or WPA encrypted frame; dissect the protections parameters
6951 * and decrypt the data, if we have a matching key. Otherwise display it as data.
6954 gboolean can_decrypt = FALSE;
6955 proto_tree *wep_tree = NULL;
6957 guint8 key, keybyte;
6959 /* Davide Schiera (2006-11-27): define algorithms constants and macros */
6960 #ifdef HAVE_AIRPDCAP
6961 #define PROTECTION_ALG_TKIP AIRPDCAP_KEY_TYPE_TKIP
6962 #define PROTECTION_ALG_CCMP AIRPDCAP_KEY_TYPE_CCMP
6963 #define PROTECTION_ALG_WEP AIRPDCAP_KEY_TYPE_WEP
6964 #define PROTECTION_ALG_RSNA PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
6966 #define PROTECTION_ALG_WEP 0
6967 #define PROTECTION_ALG_TKIP 1
6968 #define PROTECTION_ALG_CCMP 2
6969 #define PROTECTION_ALG_RSNA PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
6971 guint8 algorithm=-1;
6972 /* Davide Schiera (2006-11-27): added macros to check the algorithm */
6973 /* used could be TKIP or CCMP */
6974 #define IS_TKIP(tvb, hdr_len) (tvb_get_guint8(tvb, hdr_len + 1) & 0x20)
6975 #define IS_CCMP(tvb, hdr_len) (tvb_get_guint8(tvb, hdr_len + 2) == 0)
6976 /* Davide Schiera ----------------------------------------------------- */
6978 #ifdef HAVE_AIRPDCAP
6979 /* Davide Schiera (2006-11-21): recorded original lengths to pass them */
6980 /* to the packets process function */
6981 guint32 sec_header=0;
6982 guint32 sec_trailer=0;
6984 next_tvb = try_decrypt(tvb, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer);
6986 /* Davide Schiera ----------------------------------------------------- */
6988 keybyte = tvb_get_guint8(tvb, hdr_len + 3);
6989 key = KEY_OCTET_WEP_KEY(keybyte);
6990 if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
6991 /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
6995 proto_item *extiv_fields;
6997 #ifdef HAVE_AIRPDCAP
6998 /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if */
7000 if (algorithm==PROTECTION_ALG_TKIP)
7001 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7003 else if (algorithm==PROTECTION_ALG_CCMP)
7004 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7007 /* Davide Schiera -------------------------------------------- */
7009 /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if*/
7011 if (IS_TKIP(tvb, hdr_len)) {
7012 algorithm=PROTECTION_ALG_TKIP;
7013 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7015 } else if (IS_CCMP(tvb, hdr_len)) {
7016 algorithm=PROTECTION_ALG_CCMP;
7017 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7020 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7021 "TKIP/CCMP parameters");
7022 #ifdef HAVE_AIRPDCAP
7025 proto_item_set_len (ti, hdr_len + 8);
7027 wep_tree = proto_item_add_subtree (extiv_fields, ett_wep_parameters);
7029 if (algorithm==PROTECTION_ALG_TKIP) {
7030 g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
7031 tvb_get_letohl(tvb, hdr_len + 4),
7032 tvb_get_guint8(tvb, hdr_len),
7033 tvb_get_guint8(tvb, hdr_len + 2));
7034 proto_tree_add_string(wep_tree, hf_tkip_extiv, tvb, hdr_len,
7035 EXTIV_LEN, out_buff);
7036 } else if (algorithm==PROTECTION_ALG_CCMP) {
7037 g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
7038 tvb_get_letohl(tvb, hdr_len + 4),
7039 tvb_get_guint8(tvb, hdr_len + 1),
7040 tvb_get_guint8(tvb, hdr_len));
7041 proto_tree_add_string(wep_tree, hf_ccmp_extiv, tvb, hdr_len,
7042 EXTIV_LEN, out_buff);
7045 proto_tree_add_uint(wep_tree, hf_wep_key, tvb, hdr_len + 3, 1, key);
7048 /* Subtract out the length of the IV. */
7050 reported_len -= EXTIV_LEN;
7052 /* It is unknown whether this is TKIP or CCMP, so let's not even try to
7053 * parse TKIP Michael MIC+ICV or CCMP MIC. */
7055 #ifdef HAVE_AIRPDCAP
7056 /* Davide Schiera (2006-11-21): enable TKIP and CCMP decryption */
7057 /* checking for the trailer */
7058 if (next_tvb!=NULL) {
7059 if (reported_len < (gint) sec_trailer) {
7060 /* There is no space for a trailer, ignore it and don't decrypt */
7062 } else if (len < reported_len) {
7063 /* There is space for a trailer, but we haven't capture all the */
7064 /* packet. Slice off the trailer, but don't try to decrypt */
7065 reported_len -= sec_trailer;
7066 if (len > reported_len)
7069 /* Ok, we have a trailer and the whole packet. Decrypt it! */
7070 /* TODO: At the moment we won't add the trailer to the tree, */
7071 /* so don't remove the trailer from the packet */
7073 reported_len -= sec_trailer;
7077 /* Davide Schiera -------------------------------------------------- */
7080 /* No Ext. IV - WEP packet */
7082 * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
7083 * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
7086 * Also, just pass the data *following* the WEP parameters as the
7087 * buffer to decrypt.
7089 iv = tvb_get_ntoh24(tvb, hdr_len);
7091 proto_item *wep_fields;
7093 wep_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 4,
7096 wep_tree = proto_item_add_subtree (wep_fields, ett_wep_parameters);
7097 proto_tree_add_uint (wep_tree, hf_wep_iv, tvb, hdr_len, 3, iv);
7098 tvb_memcpy(tvb, iv_buff, hdr_len, 3);
7099 is_iv_bad = weak_iv(iv_buff);
7100 if (is_iv_bad != -1) {
7101 proto_tree_add_boolean_format (wep_tree, hf_wep_iv_weak,
7103 "Weak IV for key byte %d",
7108 proto_tree_add_uint (wep_tree, hf_wep_key, tvb, hdr_len + 3, 1, key);
7110 /* Subtract out the length of the IV. */
7115 /* Davide Schiera (2006-11-27): Even if the decryption was not */
7116 /* successful, set the algorithm */
7117 algorithm=PROTECTION_ALG_WEP;
7120 * Well, this packet should, in theory, have an ICV.
7121 * Do we have the entire packet, and does it have enough data for
7124 if (reported_len < 4) {
7126 * The packet is claimed not to even have enough data for a
7128 * Pretend it doesn't have an ICV.
7131 } else if (len < reported_len) {
7133 * The packet is claimed to have enough data for a 4-byte ICV,
7134 * but we didn't capture all of the packet.
7135 * Slice off the 4-byte ICV from the reported length, and trim
7136 * the captured length so it's no more than the reported length;
7137 * that will slice off what of the ICV, if any, is in the
7141 if (len > reported_len)
7145 * We have the entire packet, and it includes a 4-byte ICV.
7146 * Slice it off, and put it into the tree.
7148 * We only support decrypting if we have the the ICV.
7150 * XXX - the ICV is encrypted; we're putting the encrypted
7151 * value, not the decrypted value, into the tree.
7159 if (algorithm == PROTECTION_ALG_WEP) {
7160 g_strlcpy (wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
7161 } else if (algorithm == PROTECTION_ALG_TKIP) {
7162 g_strlcpy (wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
7163 } else if (algorithm == PROTECTION_ALG_CCMP) {
7164 g_strlcpy (wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
7166 g_strlcpy (wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
7169 #ifndef HAVE_AIRPDCAP
7171 next_tvb = try_decrypt_wep(tvb, hdr_len, reported_len + 8);
7173 /* Davide Schiera (2006-11-26): decrypted before parsing header and */
7174 /* protection header */
7176 if (!can_decrypt || next_tvb == NULL) {
7178 * WEP decode impossible or failed, treat payload as raw data
7179 * and don't attempt fragment reassembly or further dissection.
7181 next_tvb = tvb_new_subset(tvb, hdr_len + ivlen, len, reported_len);
7184 /* Davide Schiera (2006-11-21): added WEP or WPA separation */
7185 if (algorithm==PROTECTION_ALG_WEP) {
7187 proto_tree_add_uint_format (wep_tree, hf_wep_icv, tvb,
7188 hdr_len + ivlen + len, 4,
7189 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
7190 "WEP ICV: 0x%08x (not verified)",
7191 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
7192 } else if (algorithm==PROTECTION_ALG_CCMP) {
7193 } else if (algorithm==PROTECTION_ALG_TKIP) {
7196 /* Davide Schiera (2006-11-21) ---------------------------------- */
7198 if (pinfo->ethertype != ETHERTYPE_CENTRINO_PROMISC && wlan_ignore_wep == WLAN_IGNORE_WEP_NO) {
7199 /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
7200 call_dissector(data_handle, next_tvb, pinfo, tree);
7204 /* Davide Schiera (2006-11-21): added WEP or WPA separation */
7205 if (algorithm==PROTECTION_ALG_WEP) {
7207 proto_tree_add_uint_format (wep_tree, hf_wep_icv, tvb,
7208 hdr_len + ivlen + len, 4,
7209 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
7210 "WEP ICV: 0x%08x (correct)",
7211 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
7213 add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
7214 } else if (algorithm==PROTECTION_ALG_CCMP) {
7215 add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
7216 } else if (algorithm==PROTECTION_ALG_TKIP) {
7217 add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
7219 /* Davide Schiera (2006-11-21) ------------------------------------- */
7220 /* Davide Schiera (2006-11-27): undefine macros and definitions */
7223 #undef PROTECTION_ALG_CCMP
7224 #undef PROTECTION_ALG_TKIP
7225 #undef PROTECTION_ALG_WEP
7226 /* Davide Schiera -------------------------------------------------- */
7230 * WEP decryption successful!
7232 * Use the tvbuff we got back from the decryption; the data starts at
7233 * the beginning. The lengths are already correct for the decoded WEP
7240 * Not a WEP-encrypted frame; just use the data from the tvbuff
7243 * The payload starts at "hdr_len" (i.e., just past the 802.11
7244 * MAC header), the length of data in the tvbuff following the
7245 * 802.11 header is "len", and the length of data in the packet
7246 * following the 802.11 header is "reported_len".
7252 * Do defragmentation if "wlan_defragment" is true, and we have more
7253 * fragments or this isn't the first fragment.
7255 * We have to do some special handling to catch frames that
7256 * have the "More Fragments" indicator not set but that
7257 * don't show up as reassembled and don't have any other
7258 * fragments present. Some networking interfaces appear
7259 * to do reassembly even when you're capturing raw packets
7260 * *and* show the reassembled packet without the "More
7261 * Fragments" indicator set *but* with a non-zero fragment
7264 * "fragment_add_seq_802_11()" handles that; we want to call it
7265 * even if we have a short frame, so that it does those checks - if
7266 * the frame is short, it doesn't do reassembly on it.
7268 * (This could get some false positives if we really *did* only
7269 * capture the last fragment of a fragmented packet, but that's
7272 save_fragmented = pinfo->fragmented;
7273 if (wlan_defragment && (more_frags || frag_number != 0)) {
7274 fragment_data *fd_head;
7277 * If we've already seen this frame, look it up in the
7278 * table of reassembled packets, otherwise add it to
7279 * whatever reassembly is in progress, if any, and see
7282 if (reported_len < 0)
7283 THROW(ReportedBoundsError);
7284 fd_head = fragment_add_seq_802_11(next_tvb, hdr_len, pinfo, seq_number,
7285 wlan_fragment_table,
7286 wlan_reassembled_table,
7290 next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
7291 "Reassembled 802.11", fd_head,
7292 &frag_items, NULL, hdr_tree);
7295 * If this is the first fragment, dissect its contents, otherwise
7296 * just show it as a fragment.
7298 if (frag_number != 0) {
7299 /* Not the first fragment - don't dissect it. */
7302 /* First fragment, or not fragmented. Dissect what we have here. */
7304 /* Get a tvbuff for the payload. */
7305 next_tvb = tvb_new_subset (next_tvb, hdr_len, len, reported_len);
7308 * If this is the first fragment, but not the only fragment,
7309 * tell the next protocol that.
7312 pinfo->fragmented = TRUE;
7314 pinfo->fragmented = FALSE;
7318 if (next_tvb == NULL) {
7319 /* Just show this as an incomplete fragment. */
7320 if (check_col(pinfo->cinfo, COL_INFO))
7321 col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
7322 next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
7323 call_dissector(data_handle, next_tvb, pinfo, tree);
7324 pinfo->fragmented = save_fragmented;
7328 switch (FCF_FRAME_TYPE (fcf))
7332 dissect_ieee80211_mgt (fcf, next_tvb, pinfo, tree);
7336 if (is_amsdu && tvb_reported_length_remaining(next_tvb, 0) > 4){
7337 tvbuff_t *volatile msdu_tvb = NULL;
7338 guint32 msdu_offset = 0;
7340 const guint8 *src = NULL;
7341 const guint8 *dst = NULL;
7342 guint16 msdu_length;
7343 proto_item *parent_item;
7344 proto_tree *mpdu_tree;
7345 proto_tree *subframe_tree;
7347 parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
7348 tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
7349 mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
7352 dst = tvb_get_ptr (next_tvb, msdu_offset, 6);
7353 src = tvb_get_ptr (next_tvb, msdu_offset+6, 6);
7354 msdu_length = tvb_get_ntohs (next_tvb, msdu_offset+12);
7356 parent_item = proto_tree_add_uint_format(mpdu_tree, amsdu_msdu_header_text, next_tvb,
7357 msdu_offset, roundup2(msdu_offset+14+msdu_length, 4),
7358 i, "A-MSDU Subframe #%u", i);
7359 subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
7362 proto_tree_add_ether(subframe_tree, hf_addr_da, next_tvb, msdu_offset, 6, dst);
7363 proto_tree_add_ether(subframe_tree, hf_addr_sa, next_tvb, msdu_offset+6, 6, src);
7364 proto_tree_add_uint_format(subframe_tree, mcsset_highest_data_rate, next_tvb, msdu_offset+12, 2,
7365 msdu_length, "MSDU length: 0x%04X", msdu_length);
7368 msdu_tvb = tvb_new_subset(next_tvb, msdu_offset, msdu_length, -1);
7369 call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
7370 msdu_offset = roundup2(msdu_offset+msdu_length, 4);
7371 } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
7375 /* I guess some bridges take Netware Ethernet_802_3 frames,
7376 which are 802.3 frames (with a length field rather than
7377 a type field, but with no 802.2 header in the payload),
7378 and just stick the payload into an 802.11 frame. I've seen
7379 captures that show frames of that sort.
7381 We also handle some odd form of encapsulation in which a
7382 complete Ethernet frame is encapsulated within an 802.11
7383 data frame, with no 802.2 header. This has been seen
7386 So, if the packet doesn't start with 0xaa 0xaa:
7388 we first use the same scheme that linux-wlan-ng does to detect
7389 those encapsulated Ethernet frames, namely looking to see whether
7390 the frame either starts with 6 octets that match the destination
7391 address from the 802.11 header or has 6 octets that match the
7392 source address from the 802.11 header following the first 6 octets,
7393 and, if so, treat it as an encapsulated Ethernet frame;
7395 otherwise, we use the same scheme that we use in the Ethernet
7396 dissector to recognize Netware 802.3 frames, namely checking
7397 whether the packet starts with 0xff 0xff and, if so, treat it
7398 as an encapsulated IPX frame. */
7399 encap_type = ENCAP_802_2;
7401 octet1 = tvb_get_guint8(next_tvb, 0);
7402 octet2 = tvb_get_guint8(next_tvb, 1);
7403 if (octet1 != 0xaa || octet2 != 0xaa) {
7404 src = tvb_get_ptr (next_tvb, 6, 6);
7405 dst = tvb_get_ptr (next_tvb, 0, 6);
7406 if (memcmp(src, pinfo->dl_src.data, 6) == 0 ||
7407 memcmp(dst, pinfo->dl_dst.data, 6) == 0)
7408 encap_type = ENCAP_ETHERNET;
7409 else if (octet1 == 0xff && octet2 == 0xff)
7410 encap_type = ENCAP_IPX;
7413 CATCH2(BoundsError, ReportedBoundsError) {
7419 switch (encap_type) {
7422 call_dissector(llc_handle, next_tvb, pinfo, tree);
7425 case ENCAP_ETHERNET:
7426 call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
7430 call_dissector(ipx_handle, next_tvb, pinfo, tree);
7435 pinfo->fragmented = save_fragmented;
7438 whdr->stats = wlan_stats;
7439 tap_queue_packet(wlan_tap, pinfo, whdr);
7440 memset (&wlan_stats, 0, sizeof wlan_stats);
7444 * Dissect 802.11 with a variable-length link-layer header.
7447 dissect_ieee80211 (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7449 dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
7450 pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, FALSE);
7454 * Dissect 802.11 with a variable-length link-layer header and data padding.
7457 dissect_ieee80211_datapad (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7459 dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
7460 pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, TRUE, FALSE);
7464 * Dissect 802.11 with a variable-length link-layer header and a pseudo-
7465 * header containing radio information.
7468 dissect_radio (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7470 proto_item *ti = NULL;
7471 proto_tree *radio_tree = NULL;
7473 if (check_col(pinfo->cinfo, COL_PROTOCOL))
7474 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Radio");
7475 if (check_col(pinfo->cinfo, COL_INFO))
7476 col_clear(pinfo->cinfo, COL_INFO);
7478 /* Add the radio information to the column information */
7479 if (check_col(pinfo->cinfo, COL_TX_RATE)) {
7480 col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%u.%u",
7481 pinfo->pseudo_header->ieee_802_11.data_rate / 2,
7482 pinfo->pseudo_header->ieee_802_11.data_rate & 1 ? 5 : 0);
7484 if (check_col(pinfo->cinfo, COL_RSSI)) {
7485 /* XX - this is a percentage, not a dBm or normalized or raw RSSI */
7486 col_add_fstr(pinfo->cinfo, COL_RSSI, "%u",
7487 pinfo->pseudo_header->ieee_802_11.signal_level);
7491 ti = proto_tree_add_item(tree, proto_radio, tvb, 0, 0, FALSE);
7492 radio_tree = proto_item_add_subtree (ti, ett_radio);
7494 proto_tree_add_uint64_format(radio_tree, hf_data_rate, tvb, 0, 0,
7495 (guint64)pinfo->pseudo_header->ieee_802_11.data_rate * 500000,
7496 "Data Rate: %u.%u Mb/s",
7497 pinfo->pseudo_header->ieee_802_11.data_rate / 2,
7498 pinfo->pseudo_header->ieee_802_11.data_rate & 1 ? 5 : 0);
7500 proto_tree_add_uint(radio_tree, hf_channel, tvb, 0, 0,
7501 pinfo->pseudo_header->ieee_802_11.channel);
7503 proto_tree_add_uint_format(radio_tree, hf_signal_strength, tvb, 0, 0,
7504 pinfo->pseudo_header->ieee_802_11.signal_level,
7505 "Signal Strength: %u%%",
7506 pinfo->pseudo_header->ieee_802_11.signal_level);
7509 pinfo->current_proto = "IEEE 802.11";
7510 dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
7511 pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, FALSE);
7515 * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
7516 * control field (some hardware sends out LWAPP-encapsulated 802.11
7517 * packets with the control field byte swapped).
7520 dissect_ieee80211_bsfc (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7522 dissect_ieee80211_common (tvb, pinfo, tree, FALSE, 0, TRUE, FALSE, FALSE);
7526 * Dissect 802.11 with a fixed-length link-layer header (padded to the
7530 dissect_ieee80211_fixed (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7532 dissect_ieee80211_common (tvb, pinfo, tree, TRUE, 0, FALSE, FALSE, FALSE);
7536 * Dissect an HT 802.11 frame with a variable-length link-layer header.
7537 * XXX - Can we tell if a frame is +HTC just by looking at the MAC header?
7538 * If so, we can dispense with this.
7541 dissect_ieee80211_ht (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7543 dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
7544 pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, TRUE);
7548 wlan_defragment_init(void)
7550 fragment_table_init(&wlan_fragment_table);
7551 reassembled_table_init(&wlan_reassembled_table);
7556 free_all(gpointer key_arg _U_, gpointer value _U_, gpointer user_data _U_)
7562 retransmit_hash(gconstpointer k)
7564 const retransmit_key *key = (const retransmit_key *)k;
7569 for (i = 0; i < 6; i++)
7570 hash_val += key->bssid[i];
7572 for (i = 0; i < 6; i++)
7573 hash_val += key->src[i];
7579 retransmit_equal(gconstpointer k1, gconstpointer k2)
7581 const retransmit_key *key1 = (const retransmit_key *)k1;
7582 const retransmit_key *key2 = (const retransmit_key *)k2;
7584 return ( (!memcmp(key1->bssid, key2->bssid, 6) && !memcmp( key1->src, key2->src, 6))? TRUE:FALSE);
7588 frame_hash(gconstpointer k)
7590 guint32 frame = GPOINTER_TO_UINT(k);
7596 frame_equal(gconstpointer k1, gconstpointer k2)
7598 guint32 frame1 = GPOINTER_TO_UINT(k1);
7599 guint32 frame2 = GPOINTER_TO_UINT(k2);
7601 return frame1==frame2;
7605 wlan_retransmit_init(void)
7607 if ( fc_analyse_retransmit_table ){
7608 g_hash_table_foreach_remove(fc_analyse_retransmit_table,free_all, NULL);
7609 g_hash_table_destroy(fc_analyse_retransmit_table);
7610 fc_analyse_retransmit_table = NULL;
7613 if( fc_first_frame_table ){
7614 g_hash_table_foreach_remove(fc_first_frame_table,free_all, NULL);
7615 g_hash_table_destroy(fc_first_frame_table);
7616 fc_first_frame_table = NULL;
7619 if (wlan_subdissector)
7622 fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
7623 fc_first_frame_table = g_hash_table_new( frame_hash, frame_equal);
7630 * yah, I know, macros, ugh, but it makes the code
7631 * below more readable
7632 * XXX - This should be rewritten to use ptvcursors, then.
7634 #define FIELD_PRESENT(name) (hdr.name.status == 0 && hdr.name.did != 0)
7635 #define IFHELP(size, name, var, str) \
7637 proto_tree_add_uint_format(prism_tree, hf_prism_ ## name, \
7638 tvb, offset, size, hdr.var, str, hdr.var); \
7641 #define INTFIELD(size, name, str) IFHELP(size, name, name, str)
7642 #define VALFIELD(name, str) \
7643 if (FIELD_PRESENT(name)) { \
7645 proto_tree_add_uint_format(prism_tree, hf_ ## name, \
7646 tvb, offset, 12, hdr.name.data, \
7647 str ": 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)", \
7648 hdr.name.data, hdr.name.did, \
7649 hdr.name.status, hdr.name.len); \
7653 #define VALFIELD_PRISM(name, str) \
7654 if (FIELD_PRESENT(name)) { \
7656 proto_tree_add_uint_format(prism_tree, hf_prism_ ## name ## _data, \
7657 tvb, offset, 12, hdr.name.data, \
7658 str ": 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)", \
7659 hdr.name.data, hdr.name.did, \
7660 hdr.name.status, hdr.name.len); \
7666 dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
7668 struct prism_hdr hdr;
7669 proto_tree *prism_tree = NULL;
7677 /* handle the new capture type. */
7678 msgcode = tvb_get_ntohl(tvb, offset);
7679 if ((msgcode == WLANCAP_MAGIC_COOKIE_V1) ||
7680 (msgcode == WLANCAP_MAGIC_COOKIE_V2)) {
7681 call_dissector(wlancap_handle, tvb, pinfo, tree);
7685 tvb_memcpy(tvb, (guint8 *)&hdr, offset, sizeof(hdr));
7687 if(check_col(pinfo->cinfo, COL_PROTOCOL))
7688 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Prism");
7689 if(check_col(pinfo->cinfo, COL_INFO))
7690 col_clear(pinfo->cinfo, COL_INFO);
7692 if(check_col(pinfo->cinfo, COL_INFO))
7693 col_add_fstr(pinfo->cinfo, COL_INFO, "Device: %.16s "
7694 "Message 0x%x, Length %d", hdr.devname,
7695 hdr.msgcode, hdr.msglen);
7698 ti = proto_tree_add_item(tree, proto_prism, tvb, 0, sizeof hdr, FALSE);
7699 prism_tree = proto_item_add_subtree(ti, ett_radio);
7702 INTFIELD(4, msgcode, "Message Code: %d");
7703 INTFIELD(4, msglen, "Message Length: %d");
7705 proto_tree_add_text(prism_tree, tvb, offset, sizeof hdr.devname,
7706 "Device: %s", hdr.devname);
7708 offset += sizeof hdr.devname;
7710 if (FIELD_PRESENT(hosttime)) {
7712 proto_tree_add_uint64_format(prism_tree, hf_hosttime,
7713 tvb, offset, 12, hdr.hosttime.data,
7714 "Host timestamp: 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)",
7715 hdr.hosttime.data, hdr.hosttime.did,
7716 hdr.hosttime.status, hdr.hosttime.len);
7720 if (FIELD_PRESENT(mactime)) {
7722 proto_tree_add_uint64_format(prism_tree, hf_mactime,
7723 tvb, offset, 12, hdr.mactime.data,
7724 "MAC timestamp: 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)",
7725 hdr.mactime.data, hdr.mactime.did,
7726 hdr.mactime.status, hdr.mactime.len);
7730 if (FIELD_PRESENT(channel)) {
7731 if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
7732 col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u", hdr.channel.data);
7734 VALFIELD(channel, "Channel");
7735 if (FIELD_PRESENT(rssi)) {
7736 if (check_col(pinfo->cinfo, COL_RSSI))
7737 col_add_fstr(pinfo->cinfo, COL_RSSI, "%d", hdr.rssi.data);
7739 proto_tree_add_uint_format(prism_tree, hf_prism_rssi_data,
7740 tvb, offset, 12, hdr.rssi.data,
7741 "RSSI: 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)",
7742 hdr.rssi.data, hdr.rssi.did, hdr.rssi.status, hdr.rssi.len);
7746 VALFIELD_PRISM(sq, "SQ");
7747 VALFIELD_PRISM(signal, "Signal");
7748 VALFIELD_PRISM(noise, "Noise");
7749 if (FIELD_PRESENT(rate)) {
7750 if (check_col(pinfo->cinfo, COL_TX_RATE)) {
7751 col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%u.%u",
7752 hdr.rate.data / 2, hdr.rate.data & 1 ? 5 : 0);
7755 proto_tree_add_uint64_format(prism_tree, hf_data_rate,
7756 tvb, offset, 12, (guint64)hdr.rate.data * 500000,
7757 "Data Rate: %u.%u Mb/s",
7758 hdr.rate.data / 2, hdr.rate.data & 1 ? 5 : 0);
7762 VALFIELD_PRISM(istx, "IsTX");
7763 VALFIELD_PRISM(frmlen, "Frame Length");
7765 /* dissect the 802.11 header next */
7766 next_tvb = tvb_new_subset(tvb, sizeof hdr, -1, -1);
7767 call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
7771 * AVS linux-wlan-based products use a new sniff header to replace the
7772 * old Prism header. This one has additional fields, is designed to be
7773 * non-hardware-specific, and more importantly, version and length fields
7774 * so it can be extended later without breaking anything.
7776 * Support by Solomon Peachy
7778 * Description, from the capturefrm.txt file in the linux-wlan-ng 0.2.9
7779 * release (linux-wlan-ng-0.2.9/doc/capturefrm.txt):
7781 AVS Capture Frame Format
7785 The original header format for "monitor mode" or capturing frames was
7786 a considerable hack. The document covers a redesign of that format.
7788 Any questions, corrections, or proposed changes go to info@linux-wlan.com
7791 All sniff frames follow the same format:
7793 Offset Name Size Description
7794 --------------------------------------------------------------------
7795 0 CaptureHeader AVS capture metadata header
7796 64 802.11Header [10-30] 802.11 frame header
7797 ?? 802.11Payload [0-2312] 802.11 frame payload
7798 ?? 802.11FCS 4 802.11 frame check sequence
7800 Note that the header and payload are variable length and the payload
7803 If the hardware does not supply the FCS to the driver, then the frame shall
7804 have a FCS of 0xFFFFFFFF.
7807 All multibyte fields of the capture header are in "network" byte
7808 order. The "host to network" and "network to host" functions should
7809 work just fine. All the remaining multibyte fields are ordered
7810 according to their respective standards.
7812 4. Capture Header Format
7813 The following fields make up the AVS capture header:
7816 ------------------------------
7833 72 receiver_addr uint8[6]
7835 ------------------------------
7838 The following subsections detail the fields of the capture header.
7841 The version field identifies this type of frame as a subtype of
7842 ETH_P_802111_CAPTURE as received by an ARPHRD_IEEE80211_PRISM or
7843 an ARPHRD_IEEE80211_CAPTURE device. The value of this field shall be
7844 0x80211002. As new revisions of this header are necessary, we can
7845 increment the version appropriately.
7848 The length field contains the length of the entire AVS capture header,
7852 Many WLAN devices supply a relatively high resolution frame reception
7853 time value. This field contains the value supplied by the device. If
7854 the device does not supply a receive time value, this field shall be
7855 set to zero. The units for this field are microseconds.
7857 If possible, this time value should be absolute, representing the number
7858 of microseconds elapsed since the UNIX epoch.
7861 The hosttime field is set to the current value of the host maintained
7862 clock variable when the frame is received by the host.
7864 If possible, this time value should be absolute, representing the number
7865 of microseconds elapsed since the UNIX epoch.
7868 The phytype field identifies what type of PHY is employed by the WLAN
7869 device used to capture this frame. The valid values are:
7872 -------------------------------------
7873 phytype_fhss_dot11_97 1
7874 phytype_dsss_dot11_97 2
7875 phytype_irbaseband 3
7876 phytype_dsss_dot11_b 4
7877 phytype_pbcc_dot11_b 5
7878 phytype_ofdm_dot11_g 6
7879 phytype_pbcc_dot11_g 7
7880 phytype_ofdm_dot11_a 8
7881 phytype_dss_ofdm_dot11_g 9
7885 This represents the frequency or channel number of the receiver at the
7886 time the frame was received. It is interpreted as follows:
7888 For frequency hopping radios, this field is broken in to the
7889 following subfields:
7892 ------------------------
7898 For non-hopping radios, the frequency is interpreted as follows:
7901 -----------------------------------------
7902 < 256 Channel number (using externally-defined
7904 < 10000 Center frequency, in MHz
7905 >= 10000 Center frequency, in KHz
7908 The data rate field contains the rate at which the frame was received
7909 in units of 100kbps.
7912 For WLAN devices that indicate the receive antenna for each frame, the
7913 antenna field shall contain an index value into the dot11AntennaList.
7914 If the device does not indicate a receive antenna value, this field
7915 shall be set to zero.
7918 The priority field indicates the receive priority of the frame. The
7919 value is in the range [0-15] with the value 0 reserved to indicate
7920 contention period and the value 6 reserved to indicate contention free
7924 The ssi_type field is used to indicate what type of signal strength
7925 information is present: "None", "Normalized RSSI" or "dBm". "None"
7926 indicates that the underlying WLAN device does not supply any signal
7927 strength at all and the ssi_* values are unset. "Normalized RSSI"
7928 values are integers in the range [0-1000] where higher numbers
7929 indicate stronger signal. "dBm" values indicate an actual signal
7930 strength measurement quantity and are usually in the range [-108 - 10].
7931 The following values indicate the three types:
7934 ---------------------------------------------
7941 The ssi_signal field contains the signal strength value reported by
7942 the WLAN device for this frame. Note that this is a signed quantity
7943 and if the ssi_type value is "dBm" that the value may be negative.
7946 The ssi_noise field contains the noise or "silence" value reported by
7947 the WLAN device. This value is commonly defined to be the "signal
7948 strength reported immediately prior to the baseband processor lock on
7949 the frame preamble". If the hardware does not provide noise data, this
7950 shall equal 0xffffffff.
7953 For PHYs that support variable preamble lengths, the preamble field
7954 indicates the preamble type used for this frame. The values are:
7957 ---------------------------------------------
7963 This specifies the encoding of the received packet. For PHYs that support
7964 multiple encoding types, this will tell us which one was used.
7967 ---------------------------------------------
7979 This is a receive frame sequence counter. The sniff host shall
7980 increment this by one for every valid frame received off the medium.
7981 By watching for gaps in the sequence numbers we can determine when
7982 packets are lost due to unreliable transport, rather than a frame never
7983 being received to begin with.
7986 This is a counter of the number of known frame drops that occured. This
7987 is particularly useful when the system or hardware cannot keep up with
7991 This specifies the MAC address of the receiver of this frame.
7992 It is six octets in length. This field is followed by two octets of
7993 padding to keep the structure 32-bit word aligned.
7995 ================================
7999 * Added contact e-mail address to introduction
8000 * Added sniffer_addr, drop count, and sequence fields, bringing total
8002 * Bumped version to 0x80211002
8003 * Mactime is specified in microseconds, not nanoseconds
8004 * Added 64QAM, 16QAM, BPSK, QPSK encodings
8006 ================================
8008 Changes: v2.1->v2.1.1
8010 * Renamed 'channel' to 'frequency'
8011 * Clarified the interpretation of the frequency/channel field.
8012 * Renamed 'sniffer address' to 'receiver address'
8013 * Clarified timestamp fields.
8017 * Signal/noise strength type values.
8019 #define SSI_NONE 0 /* no SSI information */
8020 #define SSI_NORM_RSSI 1 /* normalized RSSI - 0-1000 */
8021 #define SSI_DBM 2 /* dBm */
8022 #define SSI_RAW_RSSI 3 /* raw RSSI from the hardware */
8025 dissect_wlancap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
8027 proto_tree *wlan_tree = NULL;
8038 if(check_col(pinfo->cinfo, COL_PROTOCOL))
8039 col_set_str(pinfo->cinfo, COL_PROTOCOL, "WLAN");
8040 if(check_col(pinfo->cinfo, COL_INFO))
8041 col_clear(pinfo->cinfo, COL_INFO);
8044 version = tvb_get_ntohl(tvb, offset) - WLANCAP_MAGIC_COOKIE_BASE;
8046 length = tvb_get_ntohl(tvb, offset+4);
8048 if(check_col(pinfo->cinfo, COL_INFO))
8049 col_add_fstr(pinfo->cinfo, COL_INFO, "AVS WLAN Capture v%x, Length %d",version, length);
8055 /* Dissect the AVS header */
8057 ti = proto_tree_add_item(tree, proto_wlancap, tvb, 0, length, FALSE);
8058 wlan_tree = proto_item_add_subtree(ti, ett_radio);
8059 proto_tree_add_item(wlan_tree, hf_wlan_magic, tvb, offset, 4, FALSE);
8060 proto_tree_add_item(wlan_tree, hf_wlan_version, tvb, offset, 4, FALSE);
8064 proto_tree_add_item(wlan_tree, hf_wlan_length, tvb, offset, 4, FALSE);
8067 proto_tree_add_item(wlan_tree, hf_mactime, tvb, offset, 8, FALSE);
8070 proto_tree_add_item(wlan_tree, hf_hosttime, tvb, offset, 8, FALSE);
8073 proto_tree_add_item(wlan_tree, hf_wlan_phytype, tvb, offset, 4, FALSE);
8076 /* XXX cook channel (fh uses different numbers) */
8077 channel = tvb_get_ntohl(tvb, offset);
8078 if (channel < 256) {
8079 if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
8080 col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u", channel);
8082 proto_tree_add_uint(wlan_tree, hf_channel, tvb, offset, 4, channel);
8083 } else if (channel < 10000) {
8084 if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
8085 col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u MHz", channel);
8087 proto_tree_add_uint_format(wlan_tree, hf_channel_frequency, tvb, offset,
8088 4, channel, "Frequency: %u MHz", channel);
8090 if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
8091 col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u KHz", channel);
8093 proto_tree_add_uint_format(wlan_tree, hf_channel_frequency, tvb, offset,
8094 4, channel, "Frequency: %u KHz", channel);
8097 datarate = tvb_get_ntohl(tvb, offset);
8098 if (datarate < 100000) {
8099 /* In units of 100 Kb/s; convert to b/s */
8102 if (check_col(pinfo->cinfo, COL_TX_RATE)) {
8103 col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%u.%u",
8105 ((datarate % 1000000) > 500000) ? 5 : 0);
8108 proto_tree_add_uint64_format(wlan_tree, hf_data_rate, tvb, offset, 4,
8110 "Data Rate: %u.%u Mb/s",
8112 ((datarate % 1000000) > 500000) ? 5 : 0);
8116 proto_tree_add_item(wlan_tree, hf_wlan_antenna, tvb, offset, 4, FALSE);
8119 proto_tree_add_item(wlan_tree, hf_wlan_priority, tvb, offset, 4, FALSE);
8121 ssi_type = tvb_get_ntohl(tvb, offset);
8123 proto_tree_add_uint(wlan_tree, hf_wlan_ssi_type, tvb, offset, 4, ssi_type);
8129 /* either there is no SSI information, or we don't know what type it is */
8133 /* Normalized RSSI */
8134 if (check_col(pinfo->cinfo, COL_RSSI))
8135 col_add_fstr(pinfo->cinfo, COL_RSSI, "%u (norm)", tvb_get_ntohl(tvb, offset));
8137 proto_tree_add_item(wlan_tree, hf_normrssi_antsignal, tvb, offset, 4, FALSE);
8142 if (check_col(pinfo->cinfo, COL_RSSI))
8143 col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm", tvb_get_ntohl(tvb, offset));
8145 proto_tree_add_item(wlan_tree, hf_dbm_antsignal, tvb, offset, 4, FALSE);
8150 if (check_col(pinfo->cinfo, COL_RSSI))
8151 col_add_fstr(pinfo->cinfo, COL_RSSI, "%u (raw)", tvb_get_ntohl(tvb, offset));
8153 proto_tree_add_item(wlan_tree, hf_rawrssi_antsignal, tvb, offset, 4, FALSE);
8157 antnoise = tvb_get_ntohl(tvb, offset);
8158 /* 0xffffffff means "hardware does not provide noise data" */
8159 if (antnoise != 0xffffffff) {
8164 /* either there is no SSI information, or we don't know what type it is */
8168 /* Normalized RSSI */
8170 proto_tree_add_uint(wlan_tree, hf_normrssi_antnoise, tvb, offset, 4, antnoise);
8176 proto_tree_add_int(wlan_tree, hf_dbm_antnoise, tvb, offset, 4, antnoise);
8182 proto_tree_add_uint(wlan_tree, hf_rawrssi_antnoise, tvb, offset, 4, antnoise);
8188 proto_tree_add_item(wlan_tree, hf_wlan_preamble, tvb, offset, 4, FALSE);
8191 proto_tree_add_item(wlan_tree, hf_wlan_encoding, tvb, offset, 4, FALSE);
8195 proto_tree_add_item(wlan_tree, hf_wlan_sequence, tvb, offset, 4, FALSE);
8198 proto_tree_add_item(wlan_tree, hf_wlan_drops, tvb, offset, 4, FALSE);
8201 proto_tree_add_item(wlan_tree, hf_wlan_receiver_addr, tvb, offset, 6, FALSE);
8204 proto_tree_add_item(wlan_tree, hf_wlan_padding, tvb, offset, 2, FALSE);
8212 /* dissect the 802.11 header next */
8213 next_tvb = tvb_new_subset(tvb, offset, -1, -1);
8214 call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
8218 proto_register_ieee80211 (void)
8221 GString *key_name, *key_title, *key_desc;
8223 static const value_string frame_type[] = {
8224 {MGT_FRAME, "Management frame"},
8225 {CONTROL_FRAME, "Control frame"},
8226 {DATA_FRAME, "Data frame"},
8230 static const value_string tofrom_ds[] = {
8231 {0, "Not leaving DS or network is operating "
8232 "in AD-HOC mode (To DS: 0 From DS: 0)"},
8233 {FLAG_TO_DS, "Frame from STA to DS via an AP (To DS: 1 "
8235 {FLAG_FROM_DS, "Frame from DS to a STA via AP(To DS: 0 "
8237 {FLAG_TO_DS|FLAG_FROM_DS, "Frame part of WDS from one AP to another "
8238 "AP (To DS: 1 From DS: 1)"},
8242 static const true_false_string tods_flag = {
8243 "Frame is entering DS",
8244 "Frame is not entering DS"
8247 static const true_false_string fromds_flag = {
8248 "Frame is exiting DS",
8249 "Frame is not exiting DS"
8252 static const true_false_string more_frags = {
8253 "More fragments follow",
8254 "This is the last fragment"
8257 static const true_false_string retry_flags = {
8258 "Frame is being retransmitted",
8259 "Frame is not being retransmitted"
8262 static const true_false_string pm_flags = {
8263 "STA will go to sleep",
8267 static const true_false_string md_flags = {
8268 "Data is buffered for STA at AP",
8272 static const true_false_string protected_flags = {
8273 "Data is protected",
8274 "Data is not protected"
8277 static const true_false_string order_flags = {
8279 "Not strictly ordered"
8282 static const true_false_string cf_ess_flags = {
8283 "Transmitter is an AP",
8284 "Transmitter is a STA"
8288 static const true_false_string cf_privacy_flags = {
8289 "AP/STA can support WEP",
8290 "AP/STA cannot support WEP"
8293 static const true_false_string cf_preamble_flags = {
8294 "Short preamble allowed",
8295 "Short preamble not allowed"
8298 static const true_false_string cf_pbcc_flags = {
8299 "PBCC modulation allowed",
8300 "PBCC modulation not allowed"
8303 static const true_false_string cf_agility_flags = {
8304 "Channel agility in use",
8305 "Channel agility not in use"
8308 static const true_false_string short_slot_time_flags = {
8309 "Short slot time in use",
8310 "Short slot time not in use"
8313 static const true_false_string dsss_ofdm_flags = {
8314 "DSSS-OFDM modulation allowed",
8315 "DSSS-OFDM modulation not allowed"
8318 static const true_false_string cf_spec_man_flags = {
8319 "dot11SpectrumManagementRequired TRUE",
8320 "dot11SpectrumManagementRequired FALSE"
8323 static const true_false_string cf_apsd_flags = {
8325 "apsd not implemented"
8328 static const true_false_string cf_del_blk_ack_flags = {
8329 "delayed block ack implemented",
8330 "delayed block ack not implemented"
8333 static const true_false_string cf_imm_blk_ack_flags = {
8334 "immediate block ack implemented",
8335 "immediate block ack not implemented"
8337 static const true_false_string cf_ibss_flags = {
8338 "Transmitter belongs to an IBSS",
8339 "Transmitter belongs to a BSS"
8342 static const true_false_string eosp_flag = {
8343 "End of service period",
8347 static const true_false_string hf_qos_amsdu_present_flag = {
8352 static const value_string sta_cf_pollable[] = {
8353 {0x00, "Station is not CF-Pollable"},
8354 {0x02, "Station is CF-Pollable, "
8355 "not requesting to be placed on the CF-polling list"},
8356 {0x01, "Station is CF-Pollable, "
8357 "requesting to be placed on the CF-polling list"},
8358 {0x03, "Station is CF-Pollable, requesting never to be polled"},
8359 {0x0200, "QSTA requesting association in QBSS"},
8363 static const value_string ap_cf_pollable[] = {
8364 {0x00, "No point coordinator at AP"},
8365 {0x02, "Point coordinator at AP for delivery only (no polling)"},
8366 {0x01, "Point coordinator at AP for delivery and polling"},
8368 {0x0200, "QAP (HC) does not use CFP for delivery of unicast data type frames"},
8369 {0x0202, "QAP (HC) uses CFP for delivery, but does not send CF-Polls to non-QoS STAs"},
8370 {0x0201, "QAP (HC) uses CFP for delivery, and sends CF-Polls to non-QoS STAs"},
8371 {0x0203, "Reserved"},
8376 static const value_string auth_alg[] = {
8377 {0x00, "Open System"},
8378 {0x01, "Shared key"},
8379 {0x80, "Network EAP"}, /* Cisco proprietary? */
8383 /*** Begin: Block Ack Params Fixed Field - Dustin Johnson ***/
8384 static const true_false_string ff_block_ack_params_amsdu_permitted_flag = {
8385 "Permitted in QoS Data MPDUs",
8389 static const true_false_string ff_block_ack_params_policy_flag = {
8390 "Immediate Block Ack",
8393 /*** End: Block Ack Params Fixed Field - Dustin Johnson ***/
8395 /*** Begin: Channel Width Fixed Field - Dustin Johnson ***/
8396 static const value_string ff_channel_width_vals[] = {
8397 {0x00, "20 MHz channel width only"},
8398 {0x01, "Any channel width in the STA
\92s Supported Channel Width Set"},
8401 /*** End: Channel Width Fixed Field - Dustin Johnson ***/
8403 /*** Begin: QoS Information AP Fixed Field - Dustin Johnson ***/
8404 static const true_false_string ff_qos_info_ap_q_ack_flag = {
8409 static const true_false_string ff_qos_info_ap_queue_req_flag = {
8410 "Can process a nonzero Queue Size subfield in the QoS Control field in QoS data frames",
8411 "Can NOT process a nonzero Queue Size subfield in the QoS Control field in QoS data frames"
8414 static const true_false_string ff_qos_info_ap_txop_request_flag = {
8415 "Can process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames",
8416 "Can NOT process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames"
8418 /*** End: QoS Information AP Fixed Field - Dustin Johnson ***/
8420 /*** Begin: QoS Information STA Fixed Field - Dustin Johnson ***/
8421 static const true_false_string ff_qos_info_sta_ac_flag = {
8422 "Trigger-enabled and Delivery-enabled",
8423 "Neither Trigger-enabled nor Delivery-enabled"
8426 static const true_false_string ff_qos_info_sta_q_ack_flag = {
8431 static const value_string ff_qos_info_sta_max_sp_len_flags[] = {
8432 {0x00, "AP may deliver all buffered MSDUs, A-MSDUs and MMPDUs"},
8433 {0x01, "AP may deliver a maximum of two MSDUs and MMPDUs per SP"},
8434 {0x02, "AP may deliver a maximum of four MSDUs and MMPDUs per SP"},
8435 {0x03, "AP may deliver a maximum of six MSDUs and MMPDUs per SP"},
8439 static const true_false_string ff_qos_info_sta_more_data_ack_flag = {
8440 "Can process ACK frames with the More Data bit in the Frame Control field set to 1",
8441 "Can NOT process ACK frames with the More Data bit in the Frame Control field set to 1"
8443 /*** End: QoS Information STA Fixed Field - Dustin Johnson ***/
8445 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
8446 static const true_false_string ff_sm_pwr_save_enabled_flag = {
8451 static const true_false_string ff_sm_pwr_save_sm_mode_flag = {
8452 "Dynamic SM Power Save mode",
8453 "Static SM Power Save mode"
8455 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
8457 /*** Begin: PCO Phase Control Fixed Field - Dustin Johnson ***/
8458 static const true_false_string ff_pco_phase_cntrl_flag = {
8462 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
8464 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
8465 static const true_false_string ff_psmp_param_set_more_psmp_flag = {
8466 "More PSMP Sequences Follow",
8467 "No PSMP Sequences Follow"
8469 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
8471 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
8472 static const value_string ff_mimo_cntrl_nc_index_flags[] = {
8474 {0x01, "2 Columns"},
8475 {0x02, "3 Columns"},
8476 {0x03, "4 Columns"},
8480 static const value_string ff_mimo_cntrl_nr_index_flags[] = {
8488 static const true_false_string ff_mimo_cntrl_channel_width_flag = {
8493 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
8494 static const true_false_string ff_ht_info_information_request_flag = {
8495 "Requesting HT Information Exchange management action frame",
8496 "Should not send an HT Information Exchange management action frame"
8499 static const true_false_string ff_ht_info_40_mhz_intolerant_flag = {
8500 "Transmitting station is intolerant of 40 MHz operation",
8501 "Transmitting station permits 40 MHz operation"
8504 static const true_false_string ff_ht_info_sta_chan_width_flag = {
8508 /*** End: HT Information Fixed Field - Dustin Johnson ***/
8510 /*** Begin: HT Category Fixed Field - Dustin Johnson ***/
8511 static const value_string ff_ht_action_flags[] = {
8512 {HT_ACTION_NOTIFY_CHAN_WIDTH, "Notify Channel Width"},
8513 {HT_ACTION_SM_PWR_SAVE, "Spatial Multiplexing (SM) Power Save"},
8514 {HT_ACTION_PSMP_ACTION, "Power Save Multi-Poll (PSMP) action frame"},
8515 {HT_ACTION_SET_PCO_PHASE, "Set PCO Phase"},
8516 {HT_ACTION_MIMO_CSI, "MIMO CSI Matrices"},
8517 {HT_ACTION_MIMO_BEAMFORMING, "MIMO Non-compressed Beamforming"},
8518 {HT_ACTION_MIMO_COMPRESSED_BEAMFORMING, "MIMO Compressed Beamforming"},
8519 {HT_ACTION_ANT_SEL_FEEDBACK, "Antenna Selection Indices Feedback"},
8520 {HT_ACTION_HT_INFO_EXCHANGE, "HT Information Exchange"},
8523 /*** Begin: HT Category Fixed Field - Dustin Johnson ***/
8525 static const value_string ff_mimo_cntrl_grouping_flags[] = {
8526 {0x00, "No Grouping"},
8527 {0x01, "Carrier Groups of 2"},
8528 {0x02, "Carrier Groups of 4"},
8533 static const value_string ff_mimo_cntrl_coefficient_size_flags[] = {
8541 static const value_string ff_mimo_cntrl_codebook_info_flags[] = {
8542 {0x00, "1 bit for 'Capital Psi', 3 bits for 'Small Psi'"},
8543 {0x01, "2 bit for 'Capital Psi', 4 bits for 'Small Psi'"},
8544 {0x02, "3 bit for 'Capital Psi', 5 bits for 'Small Psi'"},
8545 {0x03, "4 bit for 'Capital Psi', 6 bits for 'Small Psi'"},
8548 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
8550 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
8551 static const value_string ff_psmp_sta_info_flags[] = {
8552 {0x00, "Broadcast"},
8553 {0x01, "Multicast"},
8554 {0x02, "Individually Addressed"},
8558 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
8560 static const value_string reason_codes[] = {
8562 {0x01, "Unspecified reason"},
8563 {0x02, "Previous authentication no longer valid"},
8564 {0x03, "Deauthenticated because sending STA is leaving (has left) "
8566 {0x04, "Disassociated due to inactivity"},
8567 {0x05, "Disassociated because AP is unable to handle all currently "
8568 "associated stations"},
8569 {0x06, "Class 2 frame received from nonauthenticated station"},
8570 {0x07, "Class 3 frame received from nonassociated station"},
8571 {0x08, "Disassociated because sending STA is leaving (has left) BSS"},
8572 {0x09, "Station requesting (re)association is not authenticated with "
8573 "responding station"},
8574 {0x0A, "Disassociated because the information in the Power Capability "
8575 "element is unacceptable"},
8576 {0x0B, "Disassociated because the information in the Supported"
8577 "Channels element is unacceptable"},
8578 {0x0D, "Invalid Information Element"},
8579 {0x0E, "Michael MIC failure"},
8580 {0x0F, "4-Way Handshake timeout"},
8581 {0x10, "Group key update timeout"},
8582 {0x11, "Information element in 4-Way Handshake different from "
8583 "(Re)Association Request/Probe Response/Beacon"},
8584 {0x12, "Group Cipher is not valid"},
8585 {0x13, "Pairwise Cipher is not valid"},
8586 {0x14, "AKMP is not valid"},
8587 {0x15, "Unsupported RSN IE version"},
8588 {0x16, "Invalid RSN IE Capabilities"},
8589 {0x17, "IEEE 802.1X Authentication failed"},
8590 {0x18, "Cipher suite is rejected per security policy"},
8591 {0x20, "Disassociated for unspecified, QoS-related reason"},
8592 {0x21, "Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA"},
8593 {0x22, "Disassociated because of excessive number of frames that need to be "
8594 "acknowledged, but are not acknowledged for AP transmissions and/or poor "
8595 "channel conditions"},
8596 {0x23, "Disassociated because STA is transmitting outside the limits of its TXOPs"},
8597 {0x24, "Requested from peer STA as the STA is leaving the BSS (or resetting)"},
8598 {0x25, "Requested from peer STA as it does not want to use the mechanism"},
8599 {0x26, "Requested from peer STA as the STA received frames using the mechanism "
8600 "for which a set up is required"},
8601 {0x27, "Requested from peer STA due to time out"},
8602 {0x2D, "Peer STA does not support the requested cipher suite"},
8603 {0x2E, "Association denied due to requesting STA not supporting HT features"},
8608 static const value_string status_codes[] = {
8609 {0x00, "Successful"},
8610 {0x01, "Unspecified failure"},
8611 {0x0A, "Cannot support all requested capabilities in the "
8612 "Capability information field"},
8613 {0x0B, "Reassociation denied due to inability to confirm that "
8614 "association exists"},
8615 {0x0C, "Association denied due to reason outside the scope of this "
8618 {0x0D, "Responding station does not support the specified authentication "
8620 {0x0E, "Received an Authentication frame with authentication sequence "
8621 "transaction sequence number out of expected sequence"},
8622 {0x0F, "Authentication rejected because of challenge failure"},
8623 {0x10, "Authentication rejected due to timeout waiting for next "
8624 "frame in sequence"},
8625 {0x11, "Association denied because AP is unable to handle additional "
8626 "associated stations"},
8627 {0x12, "Association denied due to requesting station not supporting all "
8628 "of the datarates in the BSSBasicServiceSet Parameter"},
8629 {0x13, "Association denied due to requesting station not supporting "
8630 "short preamble operation"},
8631 {0x14, "Association denied due to requesting station not supporting "
8633 {0x15, "Association denied due to requesting station not supporting "
8635 {0x16, "Association request rejected because Spectrum Management"
8636 "capability is required"},
8637 {0x17, "Association request rejected because the information in the"
8638 "Power Capability element is unacceptable"},
8639 {0x18, "Association request rejected because the information in the"
8640 "Supported Channels element is unacceptable"},
8641 {0x19, "Association denied due to requesting station not supporting "
8642 "short slot operation"},
8643 {0x1A, "Association denied due to requesting station not supporting "
8644 "DSSS-OFDM operation"},
8645 {0x20, "Unspecified, QoS-related failure"},
8646 {0x21, "Association denied due to QAP having insufficient bandwidth "
8647 "to handle another QSTA"},
8648 {0x22, "Association denied due to excessive frame loss rates and/or "
8649 "poor conditions on current operating channel"},
8650 {0x23, "Association (with QBSS) denied due to requesting station not "
8651 "supporting the QoS facility"},
8652 {0x24, "Association denied due to requesting station not supporting "
8654 {0x25, "The request has been declined."},
8655 {0x26, "The request has not been successful as one or more parameters "
8656 "have invalid values."},
8657 {0x27, "The TS has not been created because the request cannot be honored. "
8658 "However, a suggested TSPEC is provided so that the initiating QSTA may "
8659 "attempt to set another TS with the suggested changes to the TSPEC."},
8660 {0x28, "Invalid Information Element"},
8661 {0x29, "Group Cipher is not valid"},
8662 {0x2A, "Pairwise Cipher is not valid"},
8663 {0x2B, "AKMP is not valid"},
8664 {0x2C, "Unsupported RSN IE version"},
8665 {0x2D, "Invalid RSN IE Capabilities"},
8666 {0x2E, "Cipher suite is rejected per security policy"},
8667 {0x2F, "The TS has not been created. However, the HC may be capable of "
8668 "creating a TS, in response to a request, after the time indicated in the TS Delay element."},
8669 {0x30, "Direct Link is not allowed in the BSS by policy"},
8670 {0x31, "Destination STA is not present within this QBSS."},
8671 {0x32, "The Destination STA is not a QSTA."},
8675 static const value_string category_codes[] = {
8676 {CAT_SPECTRUM_MGMT, "Spectrum Management (SM)"},
8677 {CAT_QOS, "Quality of Service (QoS)"},
8678 {CAT_DLS, "Direct-Link Setup (DLS)"},
8679 {CAT_BLOCK_ACK, "Block Ack"},
8680 {CAT_RADIO_MEASUREMENT, "Radio Measurement"},
8681 {CAT_HT, "High Throughput"},
8682 {CAT_MGMT_NOTIFICATION, "Management Notification"},
8683 {CAT_VENDOR_SPECIFIC, "Vendor Specific"},
8687 static const value_string action_codes[] ={
8688 {SM_ACTION_MEASUREMENT_REQUEST, "Measurement Request"},
8689 {SM_ACTION_MEASUREMENT_REPORT, "Measurement Report"},
8690 {SM_ACTION_TPC_REQUEST, "TPC Request"},
8691 {SM_ACTION_TPC_REPORT, "TPC Report"},
8692 {SM_ACTION_CHAN_SWITCH_ANNC, "Channel Switch Announcement"},
8696 static const value_string vendor_action_types_mrvl[] ={
8697 {MRVL_ACTION_MESH_MANAGEMENT, "Mesh Management"},
8701 static const value_string mesh_mgt_action_codes_mrvl[] ={
8702 {MRVL_MESH_MGMT_ACTION_RREQ, "Route Request"},
8703 {MRVL_MESH_MGMT_ACTION_RREP, "Route Response"},
8704 {MRVL_MESH_MGMT_ACTION_RERR, "Route Error"},
8705 {MRVL_MESH_MGMT_ACTION_PLDM, "Peer Link Down"},
8709 static const value_string mesh_path_selection_codes[] ={
8710 {0x0, "Hybrid Wireless Mesh Protocol"},
8714 static const value_string mesh_metric_codes[] ={
8715 {0x0, "Airtime Link Metric"},
8719 static const value_string wme_action_codes[] = {
8720 {0x00, "Setup request"},
8721 {0x01, "Setup response"},
8726 static const value_string wme_status_codes[] = {
8727 {0x00, "Admission accepted"},
8728 {0x01, "Invalid parameters"},
8733 static const value_string ack_policy[] = {
8734 {0x00, "Normal Ack"},
8736 {0x02, "No explicit acknowledgment"},
8737 {0x03, "Block Ack"},
8741 static const value_string qos_action_codes[] = {
8742 {SM_ACTION_ADDTS_REQUEST, "ADDTS Request"},
8743 {SM_ACTION_ADDTS_RESPONSE, "ADDTS Response"},
8744 {SM_ACTION_DELTS, "DELTS"},
8745 {SM_ACTION_QOS_SCHEDULE, "Schedule"},
8749 /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/
8750 static const value_string ba_action_codes[] = {
8751 {BA_ADD_BLOCK_ACK_REQUEST, "Add Block Ack Request"},
8752 {BA_ADD_BLOCK_ACK_RESPONSE, "Add Block Ack Response"},
8753 {BA_DELETE_BLOCK_ACK, "Delete Block Ack"},
8756 /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/
8758 static const value_string dls_action_codes[] = {
8759 {SM_ACTION_DLS_REQUEST, "DLS Request"},
8760 {SM_ACTION_DLS_RESPONSE, "DLS Response"},
8761 {SM_ACTION_DLS_TEARDOWN, "DLS Teardown"},
8765 static const value_string tsinfo_type[] = {
8766 {0x0, "Aperiodic or unspecified Traffic"},
8767 {0x1, "Periodic Traffic"},
8771 static const value_string tsinfo_direction[] = {
8774 {0x02, "Direct link"},
8775 {0x03, "Bidirectional link"},
8779 static const value_string tsinfo_access[] = {
8787 static const value_string qos_up[] = {
8788 {0x00, "Best Effort"},
8789 {0x01, "Background"},
8791 {0x03, "Excellent Effort"},
8792 {0x04, "Controlled Load"},
8795 {0x07, "Network Control"},
8799 static const value_string classifier_type[] = {
8800 {0x00, "Ethernet parameters"},
8801 {0x01, "TCP/UDP IP parameters"},
8802 {0x02, "IEEE 802.1D/Q parameters"},
8806 static const value_string tclas_process[] = {
8807 {0x00, "Incoming MSDU's higher layer parameters have to match to the parameters in all associated TCLAS elements."},
8808 {0x01, "Incoming MSDU's higher layer parameters have to match to at least one of the associated TCLAS elements."},
8809 {0x02, "Incoming MSDU's that do not belong to any other TS are classified to the TS for which this TCLAS Processing element is used. In this case, there will not be any associated TCLAS elements."},
8813 /*** Begin: Block Ack/Block Ack Request - Dustin Johnson***/
8814 static const true_false_string hf_block_ack_control_ack_policy_flag = {
8815 "Immediate Acknowledgement Required",
8816 "Sender Does Not Require Immediate Acknowledgement"
8819 static const value_string hf_block_ack_request_type_flags[] = {
8820 {0x00, "Basic Block Ack Request"},
8822 {0x02, "Compressed Block Ack Request"},
8823 {0x03, "Multi-TID Block Ack Request"},
8827 static const value_string hf_block_ack_type_flags[] = {
8828 {0x00, "Basic Block Ack"},
8830 {0x02, "Compressed Block"},
8831 {0x03, "Multi-TID Block"},
8834 /*** End: Block Ack/Block Ack Request - Dustin Johnson***/
8836 static const value_string phy_type[] = {
8838 { 1, "FHSS 802.11 '97" },
8839 { 2, "DSSS 802.11 '97" },
8840 { 3, "IR Baseband" },
8841 { 4, "DSSS 802.11b" },
8842 { 5, "PBCC 802.11b" },
8843 { 6, "OFDM 802.11g" },
8844 { 7, "PBCC 802.11g" },
8845 { 8, "OFDM 802.11a" },
8849 static const value_string encoding_type[] = {
8862 static const value_string ssi_type[] = {
8863 { SSI_NONE, "None" },
8864 { SSI_NORM_RSSI, "Normalized RSSI" },
8866 { SSI_RAW_RSSI, "Raw RSSI" },
8870 static const value_string preamble_type[] = {
8877 static hf_register_info hf[] = {
8879 {"MAC timestamp", "wlan.mactime", FT_UINT64, BASE_DEC, NULL, 0x0,
8880 "Value in microseconds of the MAC's Time Synchronization Function timer when the first bit of the MPDU arrived at the MAC", HFILL }},
8883 {"Host timestamp", "wlan.hosttime", FT_UINT64, BASE_DEC, NULL, 0x0,
8887 {"Data Rate", "wlan.data_rate", FT_UINT64, BASE_DEC, NULL, 0,
8888 "Data rate (b/s)", HFILL }},
8891 {"Channel", "wlan.channel", FT_UINT8, BASE_DEC, NULL, 0,
8892 "802.11 channel number that this frame was sent/received on", HFILL }},
8894 {&hf_channel_frequency,
8895 {"Channel frequency", "wlan.channel_frequency", FT_UINT32, BASE_DEC, NULL, 0x0,
8896 "Channel frequency in megahertz that this frame was sent/received on", HFILL }},
8899 {"Antenna", "wlan.antenna", FT_UINT32, BASE_DEC, NULL, 0x0,
8900 "Antenna number this frame was sent/received over (starting at 0)", HFILL } },
8902 {&hf_normrssi_antsignal,
8903 {"Normalized RSSI Signal", "wlan.normrssi_antsignal", FT_UINT32, BASE_DEC, NULL, 0x0,
8904 "RF signal power at the antenna, normalized to the range 0-1000", HFILL }},
8907 {"SSI Signal (dBm)", "wlan.dbm_antsignal", FT_INT32, BASE_DEC, NULL, 0x0,
8908 "RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL }},
8910 {&hf_rawrssi_antsignal,
8911 {"Raw RSSI Signal", "wlan.rawrssi_antsignal", FT_UINT32, BASE_DEC, NULL, 0x0,
8912 "RF signal power at the antenna, reported as RSSI by the adapter", HFILL }},
8914 {&hf_normrssi_antnoise,
8915 {"Normalized RSSI Noise", "wlan.normrssi_antnoise", FT_UINT32, BASE_DEC, NULL, 0x0,
8916 "RF noise power at the antenna, normalized to the range 0-1000", HFILL }},
8919 {"SSI Noise (dBm)", "radiotap.dbm_antnoise", FT_INT32, BASE_DEC, NULL, 0x0,
8920 "RF noise power at the antenna from a fixed, arbitrary value in decibels per one milliwatt", HFILL }},
8922 {&hf_rawrssi_antnoise,
8923 {"Raw RSSI Noise", "wlan.rawrssi_antnoise", FT_UINT32, BASE_DEC, NULL, 0x0,
8924 "RF noise power at the antenna, reported as RSSI by the adapter", HFILL }},
8926 {&hf_signal_strength,
8927 {"Signal Strength", "wlan.signal_strength", FT_UINT8, BASE_DEC, NULL, 0,
8928 "Signal strength (Percentage)", HFILL }},
8931 {"Frame Control Field", "wlan.fc", FT_UINT16, BASE_HEX, NULL, 0,
8932 "MAC Frame control", HFILL }},
8934 {&hf_fc_proto_version,
8935 {"Version", "wlan.fc.version", FT_UINT8, BASE_DEC, NULL, 0,
8936 "MAC Protocol version", HFILL }}, /* 0 */
8939 {"Type", "wlan.fc.type", FT_UINT8, BASE_DEC, VALS(frame_type), 0,
8940 "Frame type", HFILL }},
8942 {&hf_fc_frame_subtype,
8943 {"Subtype", "wlan.fc.subtype", FT_UINT8, BASE_DEC, NULL, 0,
8944 "Frame subtype", HFILL }}, /* 2 */
8946 {&hf_fc_frame_type_subtype,
8947 {"Type/Subtype", "wlan.fc.type_subtype", FT_UINT8, BASE_HEX, VALS(frame_type_subtype_vals), 0,
8948 "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
8951 {"Protocol Flags", "wlan.flags", FT_UINT8, BASE_HEX, NULL, 0,
8952 "Protocol flags", HFILL }},
8955 {"DS status", "wlan.fc.ds", FT_UINT8, BASE_HEX, VALS (&tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
8956 "Data-frame DS-traversal status", HFILL }}, /* 3 */
8959 {"To DS", "wlan.fc.tods", FT_BOOLEAN, 8, TFS (&tods_flag), FLAG_TO_DS,
8960 "To DS flag", HFILL }}, /* 4 */
8963 {"From DS", "wlan.fc.fromds", FT_BOOLEAN, 8, TFS (&fromds_flag), FLAG_FROM_DS,
8964 "From DS flag", HFILL }}, /* 5 */
8967 {"More Fragments", "wlan.fc.frag", FT_BOOLEAN, 8, TFS (&more_frags), FLAG_MORE_FRAGMENTS,
8968 "More Fragments flag", HFILL }}, /* 6 */
8971 {"Retry", "wlan.fc.retry", FT_BOOLEAN, 8, TFS (&retry_flags), FLAG_RETRY,
8972 "Retransmission flag", HFILL }},
8974 { &hf_fc_analysis_retransmission,
8975 {"Retransmission", "wlan.analysis.retransmission", FT_NONE, BASE_NONE,
8976 NULL, 0x0, "This frame is a suspected wireless retransmission", HFILL }},
8978 { &hf_fc_analysis_retransmission_frame,
8979 {"Retransmission of frame", "wlan.analysis.retransmission_frame", FT_FRAMENUM, BASE_NONE,
8980 NULL, 0x0, "This is a retransmission of frame #", HFILL }},
8983 {"PWR MGT", "wlan.fc.pwrmgt", FT_BOOLEAN, 8, TFS (&pm_flags), FLAG_POWER_MGT,
8984 "Power management status", HFILL }},
8987 {"More Data", "wlan.fc.moredata", FT_BOOLEAN, 8, TFS (&md_flags), FLAG_MORE_DATA,
8988 "More data flag", HFILL }},
8991 {"Protected flag", "wlan.fc.protected", FT_BOOLEAN, 8, TFS (&protected_flags), FLAG_PROTECTED,
8992 "Protected flag", HFILL }},
8995 {"Order flag", "wlan.fc.order", FT_BOOLEAN, 8, TFS (&order_flags), FLAG_ORDER,
8996 "Strictly ordered flag", HFILL }},
8999 {"Association ID","wlan.aid",FT_UINT16, BASE_DEC,NULL,0,
9000 "Association-ID field", HFILL }},
9003 {"Duration", "wlan.duration", FT_UINT16, BASE_DEC, NULL, 0,
9004 "Duration field", HFILL }},
9007 {"Destination address", "wlan.da", FT_ETHER, BASE_NONE, NULL, 0,
9008 "Destination Hardware Address", HFILL }},
9011 {"Source address", "wlan.sa", FT_ETHER, BASE_NONE, NULL, 0,
9012 "Source Hardware Address", HFILL }},
9015 {"Source or Destination address", "wlan.addr", FT_ETHER, BASE_NONE, NULL, 0,
9016 "Source or Destination Hardware Address", HFILL }},
9019 {"Receiver address", "wlan.ra", FT_ETHER, BASE_NONE, NULL, 0,
9020 "Receiving Station Hardware Address", HFILL }},
9023 {"Transmitter address", "wlan.ta", FT_ETHER, BASE_NONE, NULL, 0,
9024 "Transmitting Station Hardware Address", HFILL }},
9027 {"First Address of Contained Frame", "wlan.controlwrap.addr1", FT_ETHER, BASE_NONE, NULL, 0,
9028 "First Address of Contained Frame", HFILL }},
9031 {"BSS Id", "wlan.bssid", FT_ETHER, BASE_NONE, NULL, 0,
9032 "Basic Service Set ID", HFILL }},
9035 {"Fragment number", "wlan.frag", FT_UINT16, BASE_DEC, NULL, 0,
9036 "Fragment number", HFILL }},
9039 {"Sequence number", "wlan.seq", FT_UINT16, BASE_DEC, NULL, 0,
9040 "Sequence number", HFILL }},
9043 {"Priority", "wlan.qos.priority", FT_UINT16, BASE_DEC, NULL, 0,
9044 "802.1D Tag", HFILL }},
9047 {"EOSP", "wlan.qos.eosp", FT_BOOLEAN, 8, TFS (&eosp_flag), QOS_FLAG_EOSP,
9048 "EOSP Field", HFILL }},
9050 {&hf_qos_ack_policy,
9051 {"Ack Policy", "wlan.qos.ack", FT_UINT8, BASE_HEX, VALS (&ack_policy), 0,
9052 "Ack Policy", HFILL }},
9054 {&hf_qos_amsdu_present,
9055 {"Payload Type", "wlan.qos.amsdupresent", FT_BOOLEAN, BASE_NONE,
9056 TFS (&hf_qos_amsdu_present_flag), 0, "Payload Type", HFILL }},
9058 {&hf_qos_field_content,
9059 {"Content", "wlan.qos.fc_content", FT_UINT16, BASE_DEC, NULL, 0,
9060 "Content1", HFILL }},
9062 /* {&hf_qos_buffer_state,
9063 {"QAP PS buffer State", "wlan.qos.ps_buf_state", FT_UINT16, BASE_DEC, NULL, 0,
9064 "QAP PS buffer State", HFILL }},
9066 {&hf_qos_txop_dur_req,
9067 {"TXOP Duration Requested", "wlan.qos.txop_dur_req", FT_UINT16, BASE_DEC, NULL, 0,
9068 "TXOP Duration Requested", HFILL }},
9070 {&hf_qos_queue_size,
9071 {"Queue Size", "wlan.qos.queue_size", FT_UINT16, BASE_DEC, NULL, 0,
9072 "Queue Size", HFILL }},*/
9075 {"Frame check sequence", "wlan.fcs", FT_UINT32, BASE_HEX,
9076 NULL, 0, "Frame Check Sequence (FCS)", HFILL }},
9079 {"Good", "wlan.fcs_good", FT_BOOLEAN, BASE_NONE,
9080 NULL, 0, "True if the FCS is correct", HFILL }},
9083 {"Bad", "wlan.fcs_bad", FT_BOOLEAN, BASE_NONE,
9084 NULL, 0, "True if the FCS is incorrect", HFILL }},
9086 {&hf_fragment_overlap,
9087 {"Fragment overlap", "wlan.fragment.overlap", FT_BOOLEAN, BASE_NONE,
9088 NULL, 0x0, "Fragment overlaps with other fragments", HFILL }},
9090 {&hf_fragment_overlap_conflict,
9091 {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
9092 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9093 "Overlapping fragments contained conflicting data", HFILL }},
9095 {&hf_fragment_multiple_tails,
9096 {"Multiple tail fragments found", "wlan.fragment.multipletails",
9097 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9098 "Several tails were found when defragmenting the packet", HFILL }},
9100 {&hf_fragment_too_long_fragment,
9101 {"Fragment too long", "wlan.fragment.toolongfragment",
9102 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9103 "Fragment contained data past end of packet", HFILL }},
9105 {&hf_fragment_error,
9106 {"Defragmentation error", "wlan.fragment.error",
9107 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9108 "Defragmentation error due to illegal fragments", HFILL }},
9111 {"802.11 Fragment", "wlan.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9112 "802.11 Fragment", HFILL }},
9115 {"802.11 Fragments", "wlan.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
9116 "802.11 Fragments", HFILL }},
9118 {&hf_reassembled_in,
9119 {"Reassembled 802.11 in frame", "wlan.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9120 "This 802.11 packet is reassembled in this frame", HFILL }},
9123 {"Initialization Vector", "wlan.wep.iv", FT_UINT24, BASE_HEX, NULL, 0,
9124 "Initialization Vector", HFILL }},
9127 {"Weak IV", "wlan.wep.weakiv", FT_BOOLEAN,BASE_NONE, NULL,0x0,
9131 {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv", FT_STRING,
9132 BASE_HEX, NULL, 0, "TKIP Extended Initialization Vector", HFILL }},
9135 {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv", FT_STRING,
9136 BASE_HEX, NULL, 0, "CCMP Extended Initialization Vector", HFILL }},
9139 {"Key Index", "wlan.wep.key", FT_UINT8, BASE_DEC, NULL, 0,
9140 "Key Index", HFILL }},
9143 {"WEP ICV", "wlan.wep.icv", FT_UINT32, BASE_HEX, NULL, 0,
9144 "WEP ICV", HFILL }},
9145 /*** Begin: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
9146 {&hf_pst_timingquality,
9147 {"Timing Quality", "pst.timingQuality", FT_UINT16, BASE_DEC, NULL, 0,
9148 "PST Timing Quality", HFILL }},
9150 {&hf_pst_providercount,
9151 {"No. of Providers announcing their Services", "pst.providerCount", FT_UINT8, BASE_DEC, NULL, 0,
9152 "Provider Count", HFILL }},
9155 {"Provider Service Table Length ", "pst.length", FT_UINT16, BASE_DEC, NULL, 0,
9156 "PST Length", HFILL }},
9159 {"Provider Service Table Contents ", "pst.contents", FT_UINT8, BASE_HEX, NULL, 0,
9160 "PST Contents", HFILL }},
9163 {"Application Class ID (ACID) ", "pst.ACID", FT_UINT8, BASE_DEC, NULL, 0,
9164 "PST ACID", HFILL }},
9166 {&hf_pst_acm_length,
9167 {"Application Context Mask (ACM) Length", "pst.ACM.length", FT_UINT8, BASE_DEC, NULL, 0,
9168 "PST ACM Length", HFILL }},
9171 {"Application Context Mask", "pst.ACM", FT_STRING, BASE_NONE, NULL, 0,
9172 "PST ACM", HFILL }},
9174 {&hf_pst_acm_contents,
9175 {"Application Context Mask Contents (ACM)", "pst.ACM.contents", FT_UINT32, BASE_DEC, NULL, 0,
9176 "PST ACM Contents", HFILL }},
9179 {"Application Contents Field (ACF)", "pst.ACF", FT_UINT32, BASE_DEC, NULL, 0,
9180 "PST ACF", HFILL }},
9183 {"Application Priority", "pst.priority", FT_UINT8, BASE_DEC, NULL, 0,
9184 "PST Priority", HFILL }},
9187 {"Internet Protocol V6 Address", "pst.ipv6addr", FT_IPv6, BASE_NONE, NULL, 0,
9188 "IP v6 Addr", HFILL }},
9191 {"Medium Access Control Address (MAC addr)", "pst.macaddr", FT_ETHER, BASE_NONE, NULL, 0,
9192 "MAC Address", HFILL }},
9194 {&hf_pst_serviceport,
9195 {"Service Port ", "pst.serviceport", FT_UINT16, BASE_DEC, NULL, 0,
9196 "PST Service Port", HFILL }},
9198 {&hf_pst_addressing,
9199 {"Addressing ", "pst.addressing", FT_UINT8, BASE_DEC, NULL, 0,
9200 "PST Addressing", HFILL }},
9203 {"Service (IEE802.11) Channel", "pst.channel", FT_UINT8, BASE_DEC, NULL, 0,
9204 "PST Service Channel", HFILL }},
9207 {"Number of Channels", "chan.chan_uknown", FT_UINT8, BASE_DEC, NULL, 0,
9208 "Number of Channels", HFILL }},
9211 {"Length", "chan.chan_length", FT_UINT8, BASE_DEC, NULL, 0,
9215 {"Contents", "chan.chan_content", FT_UINT8, BASE_DEC, NULL, 0,
9216 "Contents", HFILL }},
9219 {"channel", "chan.chan_channel", FT_UINT8, BASE_DEC, NULL, 0,
9220 "channel", HFILL }},
9223 {"Adaptable", "chan.chan_adapt", FT_UINT8, BASE_DEC, NULL, 0,
9224 "Adaptable", HFILL }},
9227 {"Rate", "chan.chan_rate", FT_UINT8, BASE_DEC, NULL, 0,
9231 {"Tx Power", "chan.chan_tx_pow", FT_UINT8, BASE_DEC, NULL, 0,
9232 "Tx Power", HFILL }},
9234 /*** Begin: Block Ack Request/Block Ack - Dustin Johnson***/
9235 {&hf_block_ack_request_control,
9236 {"Block Ack Request (BAR) Control", "wlan.bar.control",
9237 FT_UINT16, BASE_HEX, NULL, 0, "Block Ack Request (BAR) Control", HFILL }},
9239 {&hf_block_ack_control,
9240 {"Block Ack Request Control", "wlan.ba.control",
9241 FT_UINT16, BASE_HEX, NULL, 0, "Block Ack Request Control", HFILL }},
9243 {&hf_block_ack_control_ack_policy,
9244 {"BAR Ack Policy", "wlan.ba.control.ackpolicy",
9245 FT_BOOLEAN, 16, TFS (&hf_block_ack_control_ack_policy_flag), 0x01, "Block Ack Request (BAR) Ack Policy", HFILL }},
9247 {&hf_block_ack_control_multi_tid,
9248 {"Multi-TID", "wlan.ba.control.multitid",
9249 FT_BOOLEAN, 16, 0, 0x02, "Multi-Traffic Identifier (TID)", HFILL }},
9251 {&hf_block_ack_control_compressed_bitmap,
9252 {"Compressed Bitmap", "wlan.ba.control.cbitmap",
9253 FT_BOOLEAN, 16, 0, 0x04, "Compressed Bitmap", HFILL }},
9255 {&hf_block_ack_control_reserved,
9256 {"Reserved", "wlan.ba.control.cbitmap",
9257 FT_UINT16, BASE_HEX, NULL, 0x0ff8, "Reserved", HFILL }},
9259 {&hf_block_ack_control_basic_tid_info,
9260 {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
9261 FT_UINT16, BASE_HEX, NULL, 0xf000, "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
9263 {&hf_block_ack_control_compressed_tid_info,
9264 {"TID for which a BlockAck frame is requested", "wlan.bar.compressed.tidinfo",
9265 FT_UINT16, BASE_HEX, NULL, 0xf000, "Traffic Identifier (TID) for which a BlockAck frame is requested", HFILL }},
9267 {&hf_block_ack_control_multi_tid_info,
9268 {"Number of TIDs Present", "wlan.ba.mtid.tidinfo",
9269 FT_UINT16, BASE_HEX, NULL, 0xf000, "Number of Traffic Identifiers (TIDs) Present", HFILL }},
9271 {&hf_block_ack_multi_tid_info,
9272 {"Traffic Identifier (TID) Info", "wlan.ba.mtid.tid",
9273 FT_UINT8, BASE_DEC, 0, 0, "Traffic Identifier (TID) Info", HFILL }},
9275 {&hf_block_ack_multi_tid_reserved,
9276 {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
9277 FT_UINT16, BASE_HEX, 0, 0x0fff, "Reserved", HFILL }},
9279 {&hf_block_ack_multi_tid_value,
9280 {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
9281 FT_UINT16, BASE_HEX, 0, 0xf000, "Multi-TID Value", HFILL }},
9283 {&hf_block_ack_request_type,
9284 {"Block Ack Request Type", "wlan.bar.type",
9285 FT_UINT8, BASE_HEX, VALS(&hf_block_ack_request_type_flags), 0, "Block Ack Request (BAR) Type", HFILL }},
9287 {&hf_block_ack_type,
9288 {"Block Ack Request Type", "wlan.ba.type",
9289 FT_UINT8, BASE_HEX, VALS(&hf_block_ack_type_flags), 0, "Block Ack Request Type", HFILL }}
9290 /*** End: Block Ack Request/Block Ack - Dustin Johnson***/
9293 static hf_register_info hf_prism[] = {
9294 /* Prism-specific header fields
9295 XXX - make as many of these generic as possible. */
9296 { &hf_prism_msgcode,
9297 {"Message Code", "prism.msgcode", FT_UINT32, BASE_HEX, NULL, 0x0,
9301 {"Message Length", "prism.msglen", FT_UINT32, BASE_HEX, NULL, 0x0,
9304 { &hf_prism_rssi_data,
9305 {"RSSI Field", "prism.rssi.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9308 { &hf_prism_sq_data,
9309 {"SQ Field", "prism.sq.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9312 { &hf_prism_signal_data,
9313 {"Signal Field", "prism.signal.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9316 { &hf_prism_noise_data,
9317 {"Noise Field", "prism.noise.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9320 { &hf_prism_rate_data,
9321 {"Rate Field", "prism.rate.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9324 { &hf_prism_istx_data,
9325 {"IsTX Field", "prism.istx.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9328 { &hf_prism_frmlen_data,
9329 {"Frame Length Field", "prism.frmlen.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9333 static hf_register_info hf_wlancap[] = {
9334 /* AVS-specific header fields.
9335 XXX - make as many of these generic as possible. */
9337 {"Header magic", "wlancap.magic", FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF0, "", HFILL } },
9338 { &hf_wlan_version, { "Header revision", "wlancap.version", FT_UINT32,
9339 BASE_DEC, NULL, 0xF, "", HFILL } },
9340 { &hf_wlan_length, { "Header length", "wlancap.length", FT_UINT32,
9341 BASE_DEC, NULL, 0x0, "", HFILL } },
9343 {"PHY type", "wlan.phytype", FT_UINT32, BASE_DEC, VALS(phy_type), 0x0,
9346 { &hf_wlan_priority, { "Priority", "wlancap.priority", FT_UINT32, BASE_DEC,
9347 NULL, 0x0, "", HFILL } },
9348 { &hf_wlan_ssi_type, { "SSI Type", "wlancap.ssi_type", FT_UINT32, BASE_DEC,
9349 VALS(ssi_type), 0x0, "", HFILL } },
9350 { &hf_wlan_ssi_signal, { "SSI Signal", "wlancap.ssi_signal", FT_INT32,
9351 BASE_DEC, NULL, 0x0, "", HFILL } },
9352 { &hf_wlan_ssi_noise, { "SSI Noise", "wlancap.ssi_noise", FT_INT32,
9353 BASE_DEC, NULL, 0x0, "", HFILL } },
9354 { &hf_wlan_preamble, { "Preamble", "wlancap.preamble", FT_UINT32,
9355 BASE_DEC, VALS(preamble_type), 0x0, "", HFILL } },
9356 { &hf_wlan_encoding, { "Encoding Type", "wlancap.encoding", FT_UINT32,
9357 BASE_DEC, VALS(encoding_type), 0x0, "", HFILL } },
9358 { &hf_wlan_sequence, { "Receive sequence", "wlancap.sequence", FT_UINT32,
9359 BASE_DEC, NULL, 0x0, "", HFILL } },
9360 { &hf_wlan_drops, { "Known Dropped Frames", "wlancap.drops", FT_UINT32,
9361 BASE_DEC, NULL, 0x0, "", HFILL } },
9362 { &hf_wlan_receiver_addr, { "Receiver Address", "wlancap.receiver_addr", FT_ETHER,
9363 BASE_NONE, NULL, 0x0, "Receiver Hardware Address", HFILL } },
9364 { &hf_wlan_padding, { "Padding", "wlancap.padding", FT_BYTES,
9365 BASE_NONE, NULL, 0x0, "", HFILL } }
9368 static const true_false_string rsn_preauth_flags = {
9369 "Transmitter supports pre-authentication",
9370 "Transmitter does not support pre-authentication"
9373 static const true_false_string rsn_no_pairwise_flags = {
9374 "Transmitter cannot support WEP default key 0 simultaneously with "
9376 "Transmitter can support WEP default key 0 simultaneously with "
9380 static const value_string rsn_cap_replay_counter[] = {
9381 {0x00, "1 replay counter per PTKSA/GTKSA/STAKeySA"},
9382 {0x01, "2 replay counters per PTKSA/GTKSA/STAKeySA"},
9383 {0x02, "4 replay counters per PTKSA/GTKSA/STAKeySA"},
9384 {0x03, "16 replay counters per PTKSA/GTKSA/STAKeySA"},
9388 static const true_false_string ht_ldpc_coding_flag = {
9389 "Transmitter supports receiving LDPC coded packets",
9390 "Transmitter does not support receiving LDPC coded packets"
9393 static const true_false_string ht_chan_width_flag = {
9394 "Transmitter supports 20MHz and 40MHz operation",
9395 "Transmitter only supports 20MHz operation"
9398 static const value_string ht_sm_pwsave_flag[] = {
9399 {0x00, "Static SM Power Save mode"},
9400 {0x01, "Dynamic SM Power Save mode"},
9402 {0x03, "SM Power Save disabled"},
9406 static const true_false_string ht_green_flag = {
9407 "Transmitter is able to receive PPDUs with Green Field (GF) preamble",
9408 "Transmitter is not able to receive PPDUs with Green Field (GF) preamble"
9411 static const true_false_string ht_tf_flag = {
9416 static const value_string ht_rx_stbc_flag[] = {
9417 {0x00, "No Rx STBC support"},
9418 {0x01, "Rx support of one spatial stream"},
9419 {0x02, "Rx support of one and two spatial streams"},
9420 {0x03, "Rx support of one, two, and three spatial streams"},
9424 static const true_false_string ht_delayed_block_ack_flag = {
9425 "Transmitter supports HT-Delayed BlockAck",
9426 "Transmitter does not support HT-Delayed BlockAck"
9429 static const true_false_string ht_max_amsdu_flag = {
9434 static const true_false_string ht_dss_cck_40_flag = {
9435 "Will/Can use DSSS/CCK in 40 MHz",
9436 "Won't/Can't use of DSSS/CCK in 40 MHz"
9439 static const true_false_string ht_psmp_flag = {
9440 "Will/Can support PSMP operation",
9441 "Won't/Can't support PSMP operation"
9444 static const true_false_string ht_40_mhz_intolerant_flag = {
9445 "Use of 40 MHz transmissions restricted/disallowed",
9446 "Use of 40 MHz transmissions unrestricted/allowed"
9449 static const value_string ampduparam_mpdu_start_spacing_flags[] = {
9450 {0x00, "no restriction"},
9451 {0x01, "1/4 [usec]"},
9452 {0x02, "1/2 [usec]"},
9457 {0x07, "16 [usec]"},
9461 static const true_false_string mcsset_tx_mcs_set_defined_flag = {
9466 static const true_false_string mcsset_tx_rx_mcs_set_not_equal_flag = {
9471 static const value_string mcsset_tx_max_spatial_streams_flags[] = {
9472 {0x00, "1 spatial stream"},
9473 {0x01, "2 spatial streams"},
9474 {0x02, "3 spatial streams"},
9475 {0x03, "4 spatial streams"},
9479 static const value_string htex_transtime_flags[] = {
9480 {0x00, "No Transition"},
9487 static const value_string htex_mcs_flags[] = {
9488 {0x00, "STA does not provide MCS feedback"},
9490 {0x02, "STA provides only unsolicited MCS feedback"},
9491 {0x03, "STA can provide MCS feedback in response to MRQ as well as unsolicited MCS feedback"},
9495 static const value_string txbf_calib_flag[] = {
9496 {0x00, "incapable"},
9497 {0x01, "Limited involvement, cannot initiate"},
9498 {0x02, "Limited involvement, can initiate"},
9499 {0x03, "Fully capable"},
9503 static const value_string txbf_feedback_flags[] = {
9504 {0x00, "not supported"},
9505 {0x01, "delayed feedback capable"},
9506 {0x02, "immediate feedback capable"},
9507 {0x03, "delayed and immediate feedback capable"},
9511 static const value_string txbf_antenna_flags[] = {
9512 {0x00, "1 TX antenna sounding"},
9513 {0x01, "2 TX antenna sounding"},
9514 {0x02, "3 TX antenna sounding"},
9515 {0x03, "4 TX antenna sounding"},
9519 static const value_string txbf_csi_max_rows_bf_flags[] = {
9520 {0x00, "1 row of CSI"},
9521 {0x01, "2 rows of CSI"},
9522 {0x02, "3 rows of CSI"},
9523 {0x03, "4 rows of CSI"},
9527 static const value_string txbf_chan_est_flags[] = {
9528 {0x00, "1 space time stream"},
9529 {0x01, "2 space time streams"},
9530 {0x02, "3 space time streams"},
9531 {0x03, "4 space time streams"},
9535 static const value_string txbf_min_group_flags[] = {
9536 {0x00, "No grouping supported"},
9537 {0x01, "Groups of 1,2 supported"},
9538 {0x02, "Groups of 1,4 supported"},
9539 {0x03, "Groups of 1,2,4 supported"},
9543 static const value_string hta_ext_chan_offset_flag[] = {
9544 {0x00, "No Extension Channel"},
9545 {0x01, "Extension Channel above control channel"},
9546 {0x02, "Undefined"},
9547 {0x03, "Extension Channel below control channel"},
9551 static const true_false_string hta_rec_tx_width_flag = {
9552 "Any channel width enabled",
9553 "Use 20MHz channel (control)"
9556 static const true_false_string hta_rifs_mode_flag = {
9557 "Use of RIFS permitted",
9558 "Use of RIFS prohibited"
9561 static const true_false_string hta_controlled_access_flag = {
9566 static const value_string hta_service_interval_flag[] = {
9578 static const value_string hta_operating_mode_flag[] = {
9579 {0x00, "Pure HT, no protection"},
9580 {0x01, "There may be non-HT devices (control & ext channel)"},
9581 {0x02, "No non-HT is associated, but at least 1 20MHz is. protect on"},
9582 {0x03, "Mixed: no non-HT is associated, protect on"},
9586 static const true_false_string hta_non_gf_devices_flag = {
9587 "All HT devices associated are GF capable",
9588 "One or More HT devices are not GF capable"
9591 static const true_false_string hta_dual_stbc_protection_flag = {
9592 "Dual CTS protections is used",
9593 "Regular use of RTS/CTS"
9596 static const true_false_string hta_secondary_beacon_flag = {
9601 static const true_false_string hta_lsig_txop_protection_flag = {
9606 static const true_false_string hta_pco_active_flag = {
9607 "PCO is activated in the BSS",
9608 "PCO is not activated in the BSS"
9611 static const true_false_string hta_pco_phase_flag = {
9612 "Switch to 20MHz phase/keep 20MHz",
9613 "Switch to 40MHz phase/keep 40MHz"
9616 static const value_string ht_info_secondary_channel_offset_flags[] = {
9617 {0x00, "No secondary channel"},
9618 {0x01, "Secondary channel is above the primary channel"},
9620 {0x03, "Secondary channel is below the primary channel"},
9624 static const true_false_string ht_info_channel_width_flag = {
9625 "Channel of any width supported",
9626 "20 MHz channel width only"
9629 static const true_false_string ht_info_rifs_mode_flag = {
9634 static const true_false_string ht_info_psmp_stas_only_flag = {
9635 "Association requests are accepted from only PSMP capable STA",
9636 "Association requests are accepted regardless of PSMP capability"
9639 static const value_string ht_info_service_interval_granularity_flags[] = {
9651 static const value_string ht_info_operating_mode_flags[] = {
9652 {0x00, "All STAs are - 20/40 MHz HT or in a 20/40 MHz BSS or are 20 MHz HT in a 20 MHz BSS"},
9653 {0x01, "HT non-member protection mode"},
9654 {0x02, "Only HT STAs in the BSS, however, there exists at least one 20 MHz STA"},
9655 {0x03, "HT mixed mode"},
9659 static const true_false_string ht_info_non_greenfield_sta_present_flag = {
9660 "One or more associated STAs are not greenfield capable",
9661 "All associated STAs are greenfield capable"
9664 static const true_false_string ht_info_transmit_burst_limit_flag = {
9665 "2.4 GHz - 6.16 ms | All other bands - 3.08 ms",
9669 static const true_false_string ht_info_obss_non_ht_stas_present_flag = {
9670 "Use of protection for non-HT STAs by overlapping BSSs is needed",
9671 "Use of protection for non-HT STAs by overlapping BSSs is not needed"
9674 static const true_false_string ht_info_dual_beacon_flag = {
9675 "AP transmits a secondary beacon",
9676 "No second beacon is transmitted"
9679 static const true_false_string ht_info_dual_cts_protection_flag = {
9684 static const true_false_string ht_info_secondary_beacon_flag = {
9689 static const true_false_string ht_info_lsig_txop_protection_full_support_flag = {
9690 "All HT STAs in the BSS support L-SIG TXOP protection",
9691 "One or more HT STAs in the BSS do not support L-SIG TXOP protection"
9694 /* XXX - We might want to use tfs_active_inactive here */
9695 static const true_false_string ht_info_pco_active_flag = {
9700 static const true_false_string ht_info_pco_phase_flag = {
9701 "Switch to or continue 40 MHz phase",
9702 "Switch to or continue 20 MHz phase"
9705 static const true_false_string htc_lac_trq_flag = {
9706 "Want sounding PPDU",
9707 "Don't want sounding PPDU"
9710 static const true_false_string htc_lac_mai_mrq_flag = {
9711 "MCS feedback requested",
9712 "No MCS feedback requested"
9715 static const value_string hf_htc_lac_asel_command_flags[] = {
9716 {0x00, "Transmit Antenna Selection Sounding Indication (TXASSI)"},
9717 {0x01, "Transmit Antenna Selection Sounding Request (TXASSR)"},
9718 {0x02, "Receive Antenna Selection Sounding Indication (RXASSI)"},
9719 {0x03, "Receive Antenna Selection Sounding Request (RXASSR)"},
9720 {0x04, "Sounding Label"},
9721 {0x05, "No feedback, ASEL training failure"},
9722 {0x06, "Transmit Antenna Selection Sounding Indication (TXASSI) requesting feedback of explicit CSI"},
9727 static const value_string hf_htc_cal_pos_flags[] = {
9728 {0x00, "Not a calibration frame"},
9729 {0x01, "Calibration Start"},
9730 {0x02, "Sounding Response"},
9731 {0x03, "Sounding Complete"},
9735 static const true_false_string hf_htc_ndp_announcement_flag = {
9737 "No NDP will follow"
9740 static const value_string hf_htc_csi_steering_flags[] = {
9741 {0x00, "No feedback required"},
9743 {0x02, "Non-compressed Beamforming Feedback Matrix"},
9744 {0x03, "Compressed Beamforming Feedback Matrix"},
9748 static const value_string hf_tag_secondary_channel_offset_flags[] = {
9749 {0x00, "No Secondary Channel"},
9750 {0x01, "Above Primary Channel"},
9752 {0x03, "Below Primary Channel"},
9756 static const true_false_string hf_tag_measure_enable_flag = {
9761 static const true_false_string hf_tag_measure_acc_not_acc = {
9766 static const value_string hf_tag_measure_request_type_flags[] = {
9767 {0x00, "Basic Request"},
9768 {0x01, "Clear Channel Assessment (CCA) Request"},
9769 {0x02, "Receive Power Indication (RPI) Histogram Request"},
9770 {0x03, "Channel Load Request"},
9771 {0x04, "Noise Histogram Request"},
9772 {0x05, "Beacon Request"},
9773 {0x06, "Frame Request"},
9774 {0x07, "STA Statistics Request"},
9775 {0x08, "Location Configuration Indication (LCI) Request"},
9776 {0x09, "Transmit Stream Measurement Request"},
9777 {0x0A, "Measurement Pause Request"},
9781 static const value_string hf_tag_measure_report_type_flags[] = {
9782 {0x00, "Basic Report"},
9783 {0x01, "Clear Channel Assessment (CCA) Report"},
9784 {0x02, "Receive Power Indication (RPI) Histogram Report"},
9785 {0x03, "Channel Load Report"},
9786 {0x04, "Noise Histogram Report"},
9787 {0x05, "Beacon Report"},
9788 {0x06, "Frame Report"},
9789 {0x07, "STA Statistics Report"},
9790 {0x08, "Location Configuration Information (LCI) Report"},
9791 {0x09, "Transmit Stream Measurement Report"},
9795 static const true_false_string hf_tag_measure_report_frame_info_frame_type_flag = {
9796 "Measurement Pilot Frame",
9797 "Beacon/Probe Response Frame"
9800 static const true_false_string hf_tag_measure_map_field_bss_flag = {
9801 "At least one MPDU was received by another BSS or IBSS in the measurement period.",
9802 "No MPDUs were received from another BSS or IBSS in the measurement period."
9805 static const true_false_string hf_tag_measure_detected_not_detected = {
9810 static const true_false_string hf_tag_measure_true_false = {
9815 static const value_string hf_tag_measure_request_measurement_mode_flags[] = {
9818 {0x02, "Beacon Table"},
9822 static const value_string hf_tag_measure_request_reporting_condition_flags[] = {
9823 {0x00, "Report to be issued after each measurement."},
9824 {0x01, "The measured RCPI level is greater than an absolute threshold."},
9825 {0x02, "The measured RCPI level is less than an absolute threshold."},
9826 {0x03, "The measured RSNI level is greater than an absolute threshold."},
9827 {0x04, "The measured RSNI level is less than an absolute threshold."},
9828 {0x05, "The measured RCPI level is greater than a threshold defined by an offset from the serving AP's reference RCPI."},
9829 {0x06, "The measured RCPI level is less than a threshold defined by an offset from the serving AP's reference RCPI."},
9830 {0x07, "The measured RSNI level is greater than a threshold defined by an offset from the serving AP's reference RSNI."},
9831 {0x08, "The measured RSNI level is less than a threshold defined by an offset from the serving AP's reference RSNI."},
9832 {0x09, "The measured RCPI level is in a range bound by the serving AP's reference RCPI and an offset from the serving AP's reference RCPI."},
9833 {0x0a, "The measured RSNI level is in a range bound by the serving AP's reference RSNI and an offset from the serving AP's reference RSNI."},
9834 {0xfe, "Report not required to be issued"},
9838 static const value_string hf_tag_measure_request_group_id_flags[] = {
9839 {0x00, "STA Counters from dot11CountersTable"},
9840 {0x01, "STA Counters from dot11MacStatistics group"},
9841 {0x02, "QoS STA Counters for UP0 from dot11QosCountersTable"},
9842 {0x03, "QoS STA Counters for UP1 from dot11QosCountersTable"},
9843 {0x04, "QoS STA Counters for UP2 from dot11QosCountersTable"},
9844 {0x05, "QoS STA Counters for UP3 from dot11QosCountersTable"},
9845 {0x06, "QoS STA Counters for UP4 from dot11QosCountersTable"},
9846 {0x07, "QoS STA Counters for UP5 from dot11QosCountersTable"},
9847 {0x08, "QoS STA Counters for UP6 from dot11QosCountersTable"},
9848 {0x09, "QoS STA Counters for UP7 from dot11QosCountersTable"},
9849 {0x0a, "BSS Average Access Delays"},
9850 {0x0b, "STA Counters from dot11A-MSDU Group"},
9851 {0x0c, "STA Counters from dot11A-MPDU Group"},
9852 {0x0d, "STA Counters from dot11 BAR, Channel Width, PSMP Group"},
9853 {0x0e, "STA Counters from dot11Protection Group"},
9854 {0x0f, "STBC Group"},
9858 static const true_false_string hf_tag_extended_capabilities_flag = {
9863 /*** Begin: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
9864 static const value_string hf_tag_ext_channel_switch_announcement_switch_mode_flags[] = {
9865 {0x00, "Frames may be transmitted before the channel switch has been completed"},
9866 {0x01, "No more frames are to be transmitted until the channel switch has been completed"},
9869 /*** End: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
9871 static hf_register_info ff[] = {
9874 {"Timestamp", "wlan_mgt.fixed.timestamp", FT_STRING, BASE_NONE,
9875 NULL, 0, "Timestamp", HFILL }},
9878 {"Authentication Algorithm", "wlan_mgt.fixed.auth.alg",
9879 FT_UINT16, BASE_DEC, VALS (&auth_alg), 0, "Authentication Algorithm", HFILL }},
9881 {&ff_beacon_interval,
9882 {"Beacon Interval", "wlan_mgt.fixed.beacon", FT_DOUBLE, BASE_DEC, NULL, 0,
9883 "Beacon Interval", HFILL }},
9885 {&hf_fixed_parameters,
9886 {"Fixed parameters", "wlan_mgt.fixed.all", FT_UINT16, BASE_DEC, NULL, 0,
9887 "Fixed parameters", HFILL }},
9889 {&hf_tagged_parameters,
9890 {"Tagged parameters", "wlan_mgt.tagged.all", FT_UINT16, BASE_DEC, NULL, 0,
9891 "Tagged parameters", HFILL }},
9894 {"SSID", "wlan_mgt.ssid", FT_STRING, BASE_DEC, NULL, 0,
9897 /*** Begin: Block Ack Params Fixed Field - Dustin Johnson ***/
9898 {&ff_block_ack_params,
9899 {"Block Ack Parameters", "wlan_mgt.fixed.baparams",
9900 FT_UINT16, BASE_HEX, NULL, 0, "Block Ack Parameters", HFILL }},
9902 {&ff_block_ack_params_amsdu_permitted,
9903 {"A-MSDUs", "wlan_mgt.fixed.baparams.amsdu",
9904 FT_BOOLEAN, 16, TFS (&ff_block_ack_params_amsdu_permitted_flag), 0x0001, "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
9906 {&ff_block_ack_params_policy,
9907 {"Block Ack Policy", "wlan_mgt.fixed.baparams.policy",
9908 FT_BOOLEAN, 16, TFS (&ff_block_ack_params_policy_flag), 0x0002, "Block Ack Policy", HFILL }},
9910 {&ff_block_ack_params_tid,
9911 {"Traffic Identifier", "wlan_mgt.fixed.baparams.tid",
9912 FT_UINT8, BASE_HEX, NULL, 0x003C, "Traffic Identifier", HFILL }},
9914 {&ff_block_ack_params_buffer_size,
9915 {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan_mgt.fixed.baparams.buffersize",
9916 FT_UINT16, BASE_DEC, NULL, 0xFFC0, "Number of Buffers", HFILL }},
9917 /*** End: Block Ack Params Fixed Field - Dustin Johnson ***/
9919 /*** Begin: Block Ack Timeout Fixed Field - Dustin Johnson ***/
9920 {&ff_block_ack_timeout,
9921 {"Block Ack Timeout", "wlan_mgt.fixed.batimeout",
9922 FT_UINT16, BASE_HEX, NULL, 0, "Block Ack Timeout", HFILL }},
9923 /*** End: Block Ack Timeout Fixed Field - Dustin Johnson ***/
9925 /*** Begin: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
9927 {"Block Ack Starting Sequence Control (SSC)", "wlan_mgt.fixed.ssc",
9928 FT_UINT16, BASE_HEX, 0, 0, "Block Ack Starting Sequence Control (SSC)", HFILL }},
9930 {&ff_block_ack_ssc_fragment,
9931 {"Fragment", "wlan_mgt.fixed.fragment",
9932 FT_UINT16, BASE_DEC, 0, 0x000f, "Fragment", HFILL }},
9934 {&ff_block_ack_ssc_sequence,
9935 {"Starting Sequence Number", "wlan_mgt.fixed.sequence",
9936 FT_UINT16, BASE_DEC, 0, 0xfff0, "Starting Sequence Number", HFILL }},
9937 /*** End: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
9939 /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
9941 {"Delete Block Ack (DELBA) Parameter Set", "wlan_mgt.fixed.delba.param",
9942 FT_UINT16, BASE_HEX, 0, 0, "Delete Block Ack (DELBA) Parameter Set", HFILL }},
9944 {&ff_delba_param_reserved,
9945 {"Reserved", "wlan_mgt.fixed.delba.param.reserved",
9946 FT_UINT16, BASE_HEX, 0, 0x07ff, "Reserved", HFILL }},
9948 {&ff_delba_param_init,
9949 {"Initiator", "wlan_mgt.fixed.delba.param.initiator",
9950 FT_BOOLEAN, 16, 0, 0x08000, "Initiator", HFILL }},
9952 {&ff_delba_param_tid,
9953 {"TID", "wlan_mgt.fixed.delba.param.tid",
9954 FT_UINT16, BASE_HEX, 0, 0xf000, "Traffic Identifier (TID)", HFILL }},
9955 /*** End: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
9957 /*** Begin: Max Regulation Power Fixed Field - Dustin Johnson ***/
9959 {"Maximum Regulation Power", "wlan_mgt.fixed.maxregpwr",
9960 FT_UINT16, BASE_HEX, 0, 0, "Maximum Regulation Power", HFILL }},
9961 /*** End: Max Regulation Power Fixed Field - Dustin Johnson ***/
9963 /*** Begin: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
9964 {&ff_measurement_pilot_int,
9965 {"Measurement Pilot Interval", "wlan_mgt.fixed.msmtpilotint",
9966 FT_UINT16, BASE_HEX, 0, 0, "Measurement Pilot Interval Fixed Field", HFILL }},
9967 /*** End: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
9969 /*** Begin: Country String Fixed Field - Dustin Johnson ***/
9971 {"Country String", "wlan_mgt.fixed.country",
9972 FT_STRING, BASE_NONE, 0, 0, "Country String", HFILL }},
9973 /*** End: Country String Fixed Field - Dustin Johnson ***/
9975 /*** Begin: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
9977 {"Maximum Transmit Power", "wlan_mgt.fixed.maxtxpwr",
9978 FT_UINT8, BASE_HEX, 0, 0, "Maximum Transmit Power", HFILL }},
9979 /*** End: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
9981 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
9983 {"Transmit Power Used", "wlan_mgt.fixed.txpwr",
9984 FT_UINT8, BASE_HEX, 0, 0, "Transmit Power Used", HFILL }},
9985 /*** End: Transmit Power Used Fixed Field - Dustin Johnson ***/
9987 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
9988 {&ff_transceiver_noise_floor,
9989 {"Transceiver Noise Floor", "wlan_mgt.fixed.tnoisefloor",
9990 FT_UINT8, BASE_HEX, 0, 0, "Transceiver Noise Floor", HFILL }},
9991 /*** End: Transceiver Noise Floor Fixed Field - Dustin Johnson ***/
9993 /*** Begin: Channel Width Fixed Field - Dustin Johnson ***/
9995 {"Supported Channel Width", "wlan_mgt.fixed.chanwidth",
9996 FT_UINT8, BASE_HEX, VALS (ff_channel_width_vals), 0, "Supported Channel Width", HFILL }},
9997 /*** End: Channel Width Fixed Field - Dustin Johnson ***/
9999 /*** Begin: QoS Information AP Fixed Field - Dustin Johnson ***/
10001 {"QoS Information (AP)", "wlan_mgt.fixed.qosinfo.ap",
10002 FT_UINT8, BASE_HEX, NULL, 0, "QoS Information (AP)", HFILL }},
10004 {&ff_qos_info_ap_edca_param_set_counter,
10005 {"EDCA Parameter Set Update Count", "wlan_mgt.fixed.qosinfo.ap.edcaupdate",
10006 FT_UINT8, BASE_HEX, NULL, 0x0F, "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
10008 {&ff_qos_info_ap_q_ack,
10009 {"Q-Ack", "wlan_mgt.fixed.qosinfo.ap.qack",
10010 FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_q_ack_flag), 0x10, "QoS Ack", HFILL }},
10012 {&ff_qos_info_ap_queue_req,
10013 {"Queue Request", "wlan_mgt.fixed.qosinfo.ap",
10014 FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_queue_req_flag), 0x20, "Queue Request", HFILL }},
10016 {&ff_qos_info_ap_txop_request,
10017 {"TXOP Request", "wlan_mgt.fixed.qosinfo.ap.txopreq",
10018 FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_txop_request_flag), 0x40, "Transmit Opportunity (TXOP) Request", HFILL }},
10020 {&ff_qos_info_ap_reserved,
10021 {"Reserved", "wlan_mgt.fixed.qosinfo.ap.reserved",
10022 FT_BOOLEAN, 8, NULL, 0x80, "Reserved", HFILL }},
10023 /*** End: QoS Information AP Fixed Field - Dustin Johnson ***/
10025 /*** Begin: QoS Information STA Fixed Field - Dustin Johnson ***/
10027 {"QoS Information (STA)", "wlan_mgt.fixed.qosinfo.sta",
10028 FT_UINT8, BASE_HEX, NULL, 0, "QoS Information (STA)", HFILL }},
10030 {&ff_qos_info_sta_ac_vo,
10031 {"AC_VO", "wlan_mgt.fixed.qosinfo.sta.ac.vo",
10032 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x01, "AC_VO", HFILL }},
10034 {&ff_qos_info_sta_ac_vi,
10035 {"AC_VI", "wlan_mgt.fixed.qosinfo.sta.ac.vi",
10036 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x02, "AC_VI", HFILL }},
10038 {&ff_qos_info_sta_ac_bk,
10039 {"AC_BK", "wlan_mgt.fixed.qosinfo.sta.ac.bk",
10040 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x04, "AC_BK", HFILL }},
10042 {&ff_qos_info_sta_ac_be,
10043 {"AC_BE", "wlan_mgt.fixed.qosinfo.sta.ac.be",
10044 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x08, "AC_BE", HFILL }},
10046 {&ff_qos_info_sta_q_ack,
10047 {"Q-Ack", "wlan_mgt.fixed.qosinfo.sta.qack",
10048 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_q_ack_flag), 0x10, "QoS Ack", HFILL }},
10050 {&ff_qos_info_sta_max_sp_len,
10051 {"Service Period (SP) Length", "wlan_mgt.fixed.qosinfo.sta.splen",
10052 FT_UINT8, BASE_HEX, VALS (&ff_qos_info_sta_max_sp_len_flags) , 0x60, "Service Period (SP) Length", HFILL }},
10054 {&ff_qos_info_sta_more_data_ack,
10055 {"More Data Ack", "wlan_mgt.fixed.qosinfo.sta.moredataack",
10056 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_more_data_ack_flag), 0x80, "More Data Ack", HFILL }},
10057 /*** End: QoS Information STA Fixed Field - Dustin Johnson ***/
10059 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
10061 {"Spatial Multiplexing (SM) Power Control", "wlan_mgt.fixed.sm.powercontrol",
10062 FT_UINT8, BASE_HEX, NULL, 0, "Spatial Multiplexing (SM) Power Control", HFILL }},
10064 {&ff_sm_pwr_save_enabled,
10065 {"SM Power Save", "wlan_mgt.fixed.sm.powercontrol.enabled",
10066 FT_BOOLEAN, 8, TFS (&ff_sm_pwr_save_enabled_flag), 0x01, "Spatial Multiplexing (SM) Power Save", HFILL }},
10068 {&ff_sm_pwr_save_sm_mode,
10069 {"SM Mode", "wlan_mgt.fixed.sm.powercontrol.mode",
10070 FT_BOOLEAN, 8, TFS (&ff_sm_pwr_save_sm_mode_flag), 0x02, "Spatial Multiplexing (SM) Mode", HFILL }},
10072 {&ff_sm_pwr_save_reserved,
10073 {"Reserved", "wlan_mgt.fixed.sm.powercontrol.reserved",
10074 FT_UINT8, BASE_HEX, NULL, 0xFC, "Reserved", HFILL }},
10075 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
10077 /*** Begin: PCO Phase Control Fixed Field - Dustin Johnson ***/
10078 {&ff_pco_phase_cntrl,
10079 {"Phased Coexistence Operation (PCO) Phase Control", "wlan_mgt.fixed.pco.phasecntrl",
10080 FT_BOOLEAN, 0, TFS (&ff_pco_phase_cntrl_flag), 0, "Phased Coexistence Operation (PCO) Phase Control", HFILL }},
10081 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
10083 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
10084 {&ff_psmp_param_set,
10085 {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan_mgt.fixed.psmp.paramset",
10086 FT_UINT16, BASE_HEX, 0, 0, "Power Save Multi-Poll (PSMP) Parameter Set", HFILL }},
10088 {&ff_psmp_param_set_n_sta,
10089 {"Number of STA Info Fields Present", "wlan_mgt.fixed.psmp.paramset.nsta",
10090 FT_UINT8, BASE_HEX, 0, 0, "Number of STA Info Fields Present", HFILL }},
10092 {&ff_psmp_param_set_more_psmp,
10093 {"More PSMP", "wlan_mgt.fixed.psmp.paramset.more",
10094 FT_BOOLEAN, 0, TFS(&ff_psmp_param_set_more_psmp_flag), 0, "More Power Save Multi-Poll (PSMP)", HFILL }},
10096 {&ff_psmp_param_set_psmp_sequence_duration,
10097 {"PSMP Sequence Duration", "wlan_mgt.fixed.psmp.paramset.seqduration",
10098 FT_UINT16, BASE_DEC, 0, 0, "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
10099 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
10101 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
10102 {&ff_mimo_cntrl_nc_index,
10103 {"Nc Index", "wlan_mgt.fixed.mimo.control.ncindex",
10104 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_nc_index_flags), 0x0003, "Number of Columns Less One", HFILL }},
10106 {&ff_mimo_cntrl_nr_index,
10107 {"Nr Index", "wlan_mgt.fixed.mimo.control.nrindex",
10108 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_nr_index_flags), 0x000C, "Number of Rows Less One", HFILL }},
10110 {&ff_mimo_cntrl_channel_width,
10111 {"Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
10112 FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010, "Channel Width", HFILL }},
10114 {&ff_mimo_cntrl_grouping,
10115 {"Grouping (Ng)", "wlan_mgt.fixed.mimo.control.grouping",
10116 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_grouping_flags), 0x0060, "Grouping (Ng)", HFILL }},
10118 {&ff_mimo_cntrl_coefficient_size,
10119 {"Coefficient Size (Nb)", "wlan_mgt.fixed.mimo.control.cosize",
10120 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_coefficient_size_flags), 0x0180, "Coefficient Size (Nb)", HFILL }},
10122 {&ff_mimo_cntrl_codebook_info,
10123 {"Codebook Information", "wlan_mgt.fixed.mimo.control.codebookinfo",
10124 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_codebook_info_flags), 0x0600, "Codebook Information", HFILL }},
10126 {&ff_mimo_cntrl_remaining_matrix_segment,
10127 {"Remaining Matrix Segment", "wlan_mgt.fixed.mimo.control.matrixseg",
10128 FT_UINT16, BASE_HEX, 0, 0x3800, "Remaining Matrix Segment", HFILL }},
10130 {&ff_mimo_cntrl_reserved,
10131 {"Reserved", "wlan_mgt.fixed.mimo.control.reserved",
10132 FT_UINT16, BASE_HEX, 0, 0xC000, "Reserved", HFILL }},
10134 {&ff_mimo_cntrl_sounding_timestamp,
10135 {"Sounding Timestamp", "wlan_mgt.fixed.mimo.control.soundingtime",
10136 FT_UINT32, BASE_HEX, 0, 0, "Sounding Timestamp", HFILL }},
10137 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
10139 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
10140 {&ff_psmp_sta_info,
10141 {"Power Save Multi-Poll (PSMP) Station Information", "wlan_mgt.fixed.psmp.stainfo",
10142 FT_UINT8, BASE_HEX, VALS (&ff_psmp_sta_info_flags), 0, "Power Save Multi-Poll (PSMP) Station Information", HFILL }},
10144 {&ff_psmp_sta_info_dtt_start_offset,
10145 {"DTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.dttstart",
10146 FT_UINT16, BASE_HEX, 0, 0, "DTT Start Offset", HFILL }},
10148 {&ff_psmp_sta_info_dtt_duration,
10149 {"DTT Duration", "wlan_mgt.fixed.psmp.stainfo.dttduration",
10150 FT_UINT8, BASE_HEX, 0, 0, "DTT Duration", HFILL }},
10152 {&ff_psmp_sta_info_sta_id,
10153 {"Target Station ID", "wlan_mgt.fixed.psmp.stainfo.staid",
10154 FT_UINT16, BASE_HEX, 0, 0, "Target Station ID", HFILL }},
10156 {&ff_psmp_sta_info_utt_start_offset,
10157 {"UTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.uttstart",
10158 FT_UINT16, BASE_HEX, 0, 0, "UTT Start Offset", HFILL }},
10160 {&ff_psmp_sta_info_utt_duration,
10161 {"UTT Duration", "wlan_mgt.fixed.psmp.stainfo.uttduration",
10162 FT_UINT16, BASE_HEX, 0, 0, "UTT Duration", HFILL }},
10164 {&ff_psmp_sta_info_reserved_small,
10165 {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
10166 FT_UINT16, BASE_HEX, 0, 0, "Reserved", HFILL }},
10168 {&ff_psmp_sta_info_reserved_large,
10169 {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
10170 FT_UINT64, BASE_HEX, 0, 0, "Reserved", HFILL }},
10172 {&ff_psmp_sta_info_psmp_multicast_id,
10173 {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan_mgt.fixed.psmp.stainfo.multicastid",
10174 FT_UINT64, BASE_HEX, 0, 0, "Power Save Multi-Poll (PSMP) Multicast ID", HFILL }},
10175 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
10177 /*** Begin: Antenna Selection Fixed Field - Dustin Johnson ***/
10178 {&ff_ant_selection,
10179 {"Antenna Selection", "wlan_mgt.fixed.antsel",
10180 FT_UINT8, BASE_HEX, 0, 0, "Antenna Selection", HFILL }},
10182 {&ff_ant_selection_0,
10183 {"Antenna 0", "wlan_mgt.fixed.antsel.ant0",
10184 FT_UINT8, BASE_HEX, 0, 0x01, "Antenna 0", HFILL }},
10186 {&ff_ant_selection_1,
10187 {"Antenna 1", "wlan_mgt.fixed.antsel.ant1",
10188 FT_UINT8, BASE_HEX, 0, 0x02, "Antenna 1", HFILL }},
10190 {&ff_ant_selection_2,
10191 {"Antenna 2", "wlan_mgt.fixed.antsel.ant2",
10192 FT_UINT8, BASE_HEX, 0, 0x04, "Antenna 2", HFILL }},
10194 {&ff_ant_selection_3,
10195 {"Antenna 3", "wlan_mgt.fixed.antsel.ant3",
10196 FT_UINT8, BASE_HEX, 0, 0x08, "Antenna 3", HFILL }},
10198 {&ff_ant_selection_4,
10199 {"Antenna 4", "wlan_mgt.fixed.antsel.ant4",
10200 FT_UINT8, BASE_HEX, 0, 0x10, "Antenna 4", HFILL }},
10202 {&ff_ant_selection_5,
10203 {"Antenna 5", "wlan_mgt.fixed.antsel.ant5",
10204 FT_UINT8, BASE_HEX, 0, 0x20, "Antenna 5", HFILL }},
10206 {&ff_ant_selection_6,
10207 {"Antenna 6", "wlan_mgt.fixed.antsel.ant6",
10208 FT_UINT8, BASE_HEX, 0, 0x40, "Antenna 6", HFILL }},
10210 {&ff_ant_selection_7,
10211 {"Antenna 7", "wlan_mgt.fixed.antsel.ant7",
10212 FT_UINT8, BASE_HEX, 0, 0x80, "Antenna 7", HFILL }},
10213 /*** End: Antenna Selection Fixed Field - Dustin Johnson ***/
10215 /*** Begin: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
10216 {&ff_ext_channel_switch_announcement,
10217 {"Extended Channel Switch Announcement", "wlan_mgt.fixed.extchansw",
10218 FT_UINT32, BASE_HEX, 0, 0, "", HFILL }},
10219 /*** End: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
10221 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
10223 {"HT Information", "wlan_mgt.fixed.extchansw",
10224 FT_UINT8, BASE_HEX, 0, 0, "HT Information Fixed Field", HFILL }},
10226 {&ff_ht_info_information_request,
10227 {"Information Request", "wlan_mgt.fixed.mimo.control.chanwidth",
10228 FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01, "Information Request", HFILL }},
10230 {&ff_ht_info_40_mhz_intolerant,
10231 {"40 MHz Intolerant", "wlan_mgt.fixed.mimo.control.chanwidth",
10232 FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02, "40 MHz Intolerant", HFILL }},
10234 {&ff_ht_info_sta_chan_width,
10235 {"Station Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
10236 FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04, "Station Channel Width", HFILL }},
10238 {&ff_ht_info_reserved,
10239 {"Reserved", "wlan_mgt.fixed.extchansw",
10240 FT_UINT8, BASE_HEX, 0, 0xF8, "Reserved Field", HFILL }},
10241 /*** End: HT Information Fixed Field - Dustin Johnson ***/
10243 /*** Begin: HT Action Fixed Field - Dustin Johnson ***/
10245 {"HT Action", "wlan_mgt.fixed.htact",
10246 FT_UINT8, BASE_HEX, VALS (&ff_ht_action_flags), 0, "HT Action Code", HFILL }},
10247 /*** End: HT Action Fixed Field - Dustin Johnson ***/
10249 /*** Begin: MIMO CSI Matrices Report - Dustin Johnson ***/
10251 {"Signal to Noise Ratio (SNR)", "wlan_mgt.mimo.csimatrices.snr",
10252 FT_UINT8, BASE_HEX, NULL, 0, "Signal to Noise Ratio (SNR)", HFILL }},
10253 /*** End: MIMO CSI Matrices Report - Dustin Johnson ***/
10256 {"Capabilities", "wlan_mgt.fixed.capabilities", FT_UINT16, BASE_HEX, NULL, 0,
10257 "Capability information", HFILL }},
10260 {"ESS capabilities", "wlan_mgt.fixed.capabilities.ess",
10261 FT_BOOLEAN, 16, TFS (&cf_ess_flags), 0x0001, "ESS capabilities", HFILL }},
10264 {"IBSS status", "wlan_mgt.fixed.capabilities.ibss",
10265 FT_BOOLEAN, 16, TFS (&cf_ibss_flags), 0x0002, "IBSS participation", HFILL }},
10268 {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.sta",
10269 FT_UINT16, BASE_HEX, VALS (&sta_cf_pollable), 0x020C,
10270 "CF-Poll capabilities for a STA", HFILL }},
10273 {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.ap",
10274 FT_UINT16, BASE_HEX, VALS (&ap_cf_pollable), 0x020C,
10275 "CF-Poll capabilities for an AP", HFILL }},
10278 {"Privacy", "wlan_mgt.fixed.capabilities.privacy",
10279 FT_BOOLEAN, 16, TFS (&cf_privacy_flags), 0x0010, "WEP support", HFILL }},
10282 {"Short Preamble", "wlan_mgt.fixed.capabilities.preamble",
10283 FT_BOOLEAN, 16, TFS (&cf_preamble_flags), 0x0020, "Short Preamble", HFILL }},
10286 {"PBCC", "wlan_mgt.fixed.capabilities.pbcc",
10287 FT_BOOLEAN, 16, TFS (&cf_pbcc_flags), 0x0040, "PBCC Modulation", HFILL }},
10290 {"Channel Agility", "wlan_mgt.fixed.capabilities.agility",
10291 FT_BOOLEAN, 16, TFS (&cf_agility_flags), 0x0080, "Channel Agility", HFILL }},
10294 {"Spectrum Management", "wlan_mgt.fixed.capabilities.spec_man",
10295 FT_BOOLEAN, 16, TFS (&cf_spec_man_flags), 0x0100, "Spectrum Management", HFILL }},
10297 {&ff_short_slot_time,
10298 {"Short Slot Time", "wlan_mgt.fixed.capabilities.short_slot_time",
10299 FT_BOOLEAN, 16, TFS (&short_slot_time_flags), 0x0400, "Short Slot Time",
10303 {"Automatic Power Save Delivery", "wlan_mgt.fixed.capabilities.apsd",
10304 FT_BOOLEAN, 16, TFS (&cf_apsd_flags), 0x0800, "Automatic Power Save Delivery", HFILL }},
10307 {"DSSS-OFDM", "wlan_mgt.fixed.capabilities.dsss_ofdm",
10308 FT_BOOLEAN, 16, TFS (&dsss_ofdm_flags), 0x2000, "DSSS-OFDM Modulation",
10311 {&ff_cf_del_blk_ack,
10312 {"Delayed Block Ack", "wlan_mgt.fixed.capabilities.del_blk_ack",
10313 FT_BOOLEAN, 16, TFS (&cf_del_blk_ack_flags), 0x4000, "Delayed Block Ack", HFILL }},
10315 {&ff_cf_imm_blk_ack,
10316 {"Immediate Block Ack", "wlan_mgt.fixed.capabilities.imm_blk_ack",
10317 FT_BOOLEAN, 16, TFS (&cf_imm_blk_ack_flags), 0x8000, "Immediate Block Ack", HFILL }},
10320 {"Authentication SEQ", "wlan_mgt.fixed.auth_seq",
10321 FT_UINT16, BASE_HEX, NULL, 0, "Authentication Sequence Number", HFILL }},
10324 {"Association ID", "wlan_mgt.fixed.aid",
10325 FT_UINT16, BASE_HEX, NULL, 0, "Association ID", HFILL }},
10328 {"Listen Interval", "wlan_mgt.fixed.listen_ival",
10329 FT_UINT16, BASE_HEX, NULL, 0, "Listen Interval", HFILL }},
10332 {"Current AP", "wlan_mgt.fixed.current_ap",
10333 FT_ETHER, BASE_NONE, NULL, 0, "MAC address of current AP", HFILL }},
10336 {"Reason code", "wlan_mgt.fixed.reason_code",
10337 FT_UINT16, BASE_HEX, VALS (&reason_codes), 0,
10338 "Reason for unsolicited notification", HFILL }},
10341 {"Status code", "wlan_mgt.fixed.status_code",
10342 FT_UINT16, BASE_HEX, VALS (&status_codes), 0,
10343 "Status of requested event", HFILL }},
10345 {&ff_category_code,
10346 {"Category code", "wlan_mgt.fixed.category_code",
10347 FT_UINT16, BASE_DEC, VALS (&category_codes), 0,
10348 "Management action category", HFILL }},
10351 {"Action code", "wlan_mgt.fixed.action_code",
10352 FT_UINT16, BASE_DEC, VALS (&action_codes), 0,
10353 "Management action code", HFILL }},
10356 {"Dialog token", "wlan_mgt.fixed.dialog_token",
10357 FT_UINT8, BASE_HEX, NULL, 0, "Management action dialog token", HFILL }},
10359 {&ff_marvell_action_type,
10360 {"Marvell Action type", "wlan_mgt.fixed.mrvl_action_type",
10361 FT_UINT8, BASE_DEC, VALS (&vendor_action_types_mrvl), 0,
10362 "Vendor Specific Action Type (Marvell)", HFILL }},
10364 {&ff_marvell_mesh_mgt_action_code,
10365 {"Mesh action(Marvell)", "wlan_mgt.fixed.mrvl_mesh_action",
10366 FT_UINT8, BASE_HEX, VALS (&mesh_mgt_action_codes_mrvl), 0,
10367 "Mesh action code(Marvell)", HFILL }},
10369 {&ff_mesh_mgt_length,
10370 {"Message Length", "wlan_mgt.fixed.length",
10371 FT_UINT8, BASE_DEC, NULL, 0, "Message Length", HFILL }},
10373 {&ff_mesh_mgt_mode,
10374 {"Message Mode", "wlan_mgt.fixed.mode",
10375 FT_UINT8, BASE_HEX, NULL, 0, "Message Mode", HFILL }},
10378 {"Message TTL", "wlan_mgt.fixed.ttl",
10379 FT_UINT8, BASE_DEC, NULL, 0, "Message TTL", HFILL }},
10381 {&ff_mesh_mgt_dstcount,
10382 {"Destination Count", "wlan_mgt.fixed.dstcount",
10383 FT_UINT8, BASE_DEC, NULL, 0, "Destination Count", HFILL }},
10385 {&ff_mesh_mgt_hopcount,
10386 {"Hop Count", "wlan_mgt.fixed.hopcount",
10387 FT_UINT8, BASE_DEC, NULL, 0, "Hop Count", HFILL }},
10389 {&ff_mesh_mgt_rreqid,
10390 {"RREQ ID", "wlan_mgt.fixed.rreqid",
10391 FT_UINT32, BASE_DEC, NULL, 0, "RREQ ID", HFILL }},
10394 {"Source Address", "wlan_mgt.fixed.sa",
10395 FT_ETHER, BASE_NONE, NULL, 0, "Source MAC address", HFILL }},
10398 {"SSN", "wlan_mgt.fixed.ssn",
10399 FT_UINT32, BASE_DEC, NULL, 0, "Source Sequence Number", HFILL }},
10401 {&ff_mesh_mgt_metric,
10402 {"Metric", "wlan_mgt.fixed.metric",
10403 FT_UINT32, BASE_DEC, NULL, 0, "Route Metric", HFILL }},
10405 {&ff_mesh_mgt_flags,
10406 {"RREQ Flags", "wlan_mgt.fixed.hopcount",
10407 FT_UINT8, BASE_HEX, NULL, 0, "RREQ Flags", HFILL }},
10410 {"Destination Address", "wlan_mgt.fixed.da",
10411 FT_ETHER, BASE_NONE, NULL, 0, "Destination MAC address", HFILL }},
10414 {"DSN", "wlan_mgt.fixed.dsn",
10415 FT_UINT32, BASE_DEC, NULL, 0, "Destination Sequence Number", HFILL }},
10417 {&ff_mesh_mgt_lifetime,
10418 {"Lifetime", "wlan_mgt.fixed.lifetime",
10419 FT_UINT32, BASE_DEC, NULL, 0, "Route Lifetime", HFILL }},
10421 {&ff_wme_action_code,
10422 {"Action code", "wlan_mgt.fixed.action_code",
10423 FT_UINT16, BASE_HEX, VALS (&wme_action_codes), 0,
10424 "Management notification action code", HFILL }},
10426 {&ff_wme_status_code,
10427 {"Status code", "wlan_mgt.fixed.status_code",
10428 FT_UINT16, BASE_HEX, VALS (&wme_status_codes), 0,
10429 "Management notification setup response status code", HFILL }},
10431 {&ff_qos_action_code,
10432 {"Action code", "wlan_mgt.fixed.action_code",
10433 FT_UINT16, BASE_HEX, VALS (&qos_action_codes), 0,
10434 "QoS management action code", HFILL }},
10436 /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/
10438 {"Action code", "wlan_mgt.fixed.action_code",
10439 FT_UINT8, BASE_HEX, VALS (&ba_action_codes), 0,
10440 "Block Ack action code", HFILL }},
10441 /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/
10443 {&ff_dls_action_code,
10444 {"Action code", "wlan_mgt.fixed.action_code",
10445 FT_UINT16, BASE_HEX, VALS (&dls_action_codes), 0,
10446 "DLS management action code", HFILL }},
10449 {"Destination address", "wlan_mgt.fixed.dst_mac_addr",
10450 FT_ETHER, BASE_NONE, NULL, 0, "Destination MAC address", HFILL }},
10453 {"Source address", "wlan_mgt.fixed.src_mac_addr",
10454 FT_ETHER, BASE_NONE, NULL, 0, "Source MAC address", HFILL }},
10457 {"DLS timeout", "wlan_mgt.fixed.dls_timeout",
10458 FT_UINT16, BASE_HEX, NULL, 0, "DLS timeout value", HFILL }},
10461 {"Tag", "wlan_mgt.tag.number",
10462 FT_UINT8, BASE_DEC, VALS(tag_num_vals), 0,
10463 "Element ID", HFILL }},
10466 {"Tag length", "wlan_mgt.tag.length",
10467 FT_UINT32, BASE_DEC, NULL, 0, "Length of tag", HFILL }},
10469 {&tag_interpretation,
10470 {"Tag interpretation", "wlan_mgt.tag.interpretation",
10471 FT_STRING, BASE_NONE, NULL, 0, "Interpretation of tag", HFILL }},
10474 {"OUI", "wlan_mgt.tag.oui",
10475 FT_BYTES, BASE_NONE, NULL, 0, "OUI of vendor specific IE", HFILL }},
10478 {"TIM length", "wlan_mgt.tim.length",
10479 FT_UINT8, BASE_DEC, NULL, 0,
10480 "Traffic Indication Map length", HFILL }},
10483 {"DTIM count", "wlan_mgt.tim.dtim_count",
10484 FT_UINT8, BASE_DEC, NULL, 0,
10485 "DTIM count", HFILL }},
10488 {"DTIM period", "wlan_mgt.tim.dtim_period",
10489 FT_UINT8, BASE_DEC, NULL, 0,
10490 "DTIM period", HFILL }},
10493 {"Bitmap control", "wlan_mgt.tim.bmapctl",
10494 FT_UINT8, BASE_HEX, NULL, 0,
10495 "Bitmap control", HFILL }},
10498 {"RSN Capabilities", "wlan_mgt.rsn.capabilities", FT_UINT16, BASE_HEX,
10499 NULL, 0, "RSN Capability information", HFILL }},
10502 {"RSN Pre-Auth capabilities", "wlan_mgt.rsn.capabilities.preauth",
10503 FT_BOOLEAN, 16, TFS (&rsn_preauth_flags), 0x0001,
10504 "RSN Pre-Auth capabilities", HFILL }},
10506 {&rsn_cap_no_pairwise,
10507 {"RSN No Pairwise capabilities", "wlan_mgt.rsn.capabilities.no_pairwise",
10508 FT_BOOLEAN, 16, TFS (&rsn_no_pairwise_flags), 0x0002,
10509 "RSN No Pairwise capabilities", HFILL }},
10511 {&rsn_cap_ptksa_replay_counter,
10512 {"RSN PTKSA Replay Counter capabilities",
10513 "wlan_mgt.rsn.capabilities.ptksa_replay_counter",
10514 FT_UINT16, BASE_HEX, VALS (&rsn_cap_replay_counter), 0x000C,
10515 "RSN PTKSA Replay Counter capabilities", HFILL }},
10517 {&rsn_cap_gtksa_replay_counter,
10518 {"RSN GTKSA Replay Counter capabilities",
10519 "wlan_mgt.rsn.capabilities.gtksa_replay_counter",
10520 FT_UINT16, BASE_HEX, VALS (&rsn_cap_replay_counter), 0x0030,
10521 "RSN GTKSA Replay Counter capabilities", HFILL }},
10524 {"HT Capabilities Info", "wlan_mgt.ht.capabilities", FT_UINT16, BASE_HEX,
10525 NULL, 0, "HT Capability information", HFILL }},
10528 {"HT Capabilities Info (VS)", "wlan_mgt.vs.ht.capabilities", FT_UINT16, BASE_HEX,
10529 NULL, 0, "Vendor Specific HT Capability information", HFILL }},
10532 {"HT LDPC coding capability", "wlan_mgt.ht.capabilities.ldpccoding",
10533 FT_BOOLEAN, 16, TFS (&ht_ldpc_coding_flag), 0x0001,
10534 "HT LDPC coding capability", HFILL }},
10537 {"HT Support channel width", "wlan_mgt.ht.capabilities.width",
10538 FT_BOOLEAN, 16, TFS (&ht_chan_width_flag), 0x0002,
10539 "HT Support channel width", HFILL }},
10542 {"HT SM Power Save", "wlan_mgt.ht.capabilities.sm",
10543 FT_UINT16, BASE_HEX, VALS (&ht_sm_pwsave_flag), 0x000c,
10544 "HT SM Power Save", HFILL }},
10547 {"HT Green Field", "wlan_mgt.ht.capabilities.green",
10548 FT_BOOLEAN, 16, TFS (&ht_green_flag), 0x0010,
10549 "HT Green Field", HFILL }},
10552 {"HT Short GI for 20MHz", "wlan_mgt.ht.capabilities.short20",
10553 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0020,
10554 "HT Short GI for 20MHz", HFILL }},
10557 {"HT Short GI for 40MHz", "wlan_mgt.ht.capabilities.short40",
10558 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0040,
10559 "HT Short GI for 40MHz", HFILL }},
10562 {"HT Tx STBC", "wlan_mgt.ht.capabilities.txstbc",
10563 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0080,
10564 "HT Tx STBC", HFILL }},
10567 {"HT Rx STBC", "wlan_mgt.ht.capabilities.rxstbc",
10568 FT_UINT16, BASE_HEX, VALS (&ht_rx_stbc_flag), 0x0300,
10569 "HT Tx STBC", HFILL }},
10571 {&ht_delayed_block_ack,
10572 {"HT Delayed Block ACK", "wlan_mgt.ht.capabilities.delayedblockack",
10573 FT_BOOLEAN, 16, TFS (&ht_delayed_block_ack_flag), 0x0400,
10574 "HT Delayed Block ACK", HFILL }},
10577 {"HT Max A-MSDU length", "wlan_mgt.ht.capabilities.amsdu",
10578 FT_BOOLEAN, 16, TFS (&ht_max_amsdu_flag), 0x0800,
10579 "HT Max A-MSDU length", HFILL }},
10582 {"HT DSSS/CCK mode in 40MHz", "wlan_mgt.ht.capabilities.dsscck",
10583 FT_BOOLEAN, 16, TFS (&ht_dss_cck_40_flag), 0x1000,
10584 "HT DSS/CCK mode in 40MHz", HFILL }},
10587 {"HT PSMP Support", "wlan_mgt.ht.capabilities.psmp",
10588 FT_BOOLEAN, 16, TFS (&ht_psmp_flag), 0x2000,
10589 "HT PSMP Support", HFILL }},
10591 {&ht_40_mhz_intolerant,
10592 {"HT Forty MHz Intolerant", "wlan_mgt.ht.capabilities.40mhzintolerant",
10593 FT_BOOLEAN, 16, TFS (&ht_40_mhz_intolerant_flag), 0x4000,
10594 "HT Forty MHz Intolerant", HFILL }},
10597 {"HT L-SIG TXOP Protection support", "wlan_mgt.ht.capabilities.lsig",
10598 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x8000,
10599 "HT L-SIG TXOP Protection support", HFILL }},
10602 {"A-MPDU Parameters", "wlan_mgt.ht.ampduparam", FT_UINT16, BASE_HEX,
10603 NULL, 0, "A-MPDU Parameters", HFILL }},
10606 {"A-MPDU Parameters (VS)", "wlan_mgt.vs.ht.ampduparam", FT_UINT16, BASE_HEX,
10607 NULL, 0, "Vendor Specific A-MPDU Parameters", HFILL }},
10610 {"Maximum Rx A-MPDU Length", "wlan_mgt.ht.ampduparam.maxlength",
10611 FT_UINT8, BASE_HEX, 0 , 0x03,
10612 "Maximum Rx A-MPDU Length", HFILL }},
10614 {&duparam_mpdu_start_spacing,
10615 {"MPDU Density", "wlan_mgt.ht.ampduparam.mpdudensity",
10616 FT_UINT8, BASE_HEX, VALS (&duparam_mpdu_start_spacing_flags) , 0x1c,
10617 "MPDU Density", HFILL }},
10619 {&duparam_reserved,
10620 {"Reserved", "wlan_mgt.ht.ampduparam.reserved",
10621 FT_UINT8, BASE_HEX, NULL, 0xE0,
10622 "Reserved", HFILL }},
10625 {"Rx Supported Modulation and Coding Scheme Set", "wlan_mgt.ht.mcsset",
10626 FT_STRING, BASE_NONE, NULL, 0, "Rx Supported Modulation and Coding Scheme Set", HFILL }},
10629 {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan_mgt.vs.ht.mcsset",
10630 FT_STRING, BASE_NONE, NULL, 0, "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
10632 {&mcsset_rx_bitmask_0to7,
10633 {"Rx Bitmask Bits 0-7", "wlan_mgt.ht.mcsset.rxbitmask.0to7",
10634 FT_UINT32, BASE_HEX, 0, 0x000000ff, "Rx Bitmask Bits 0-7", HFILL }},
10636 {&mcsset_rx_bitmask_8to15,
10637 {"Rx Bitmask Bits 8-15", "wlan_mgt.ht.mcsset.rxbitmask.8to15",
10638 FT_UINT32, BASE_HEX, 0, 0x0000ff00, "Rx Bitmask Bits 8-15", HFILL }},
10640 {&mcsset_rx_bitmask_16to23,
10641 {"Rx Bitmask Bits 16-23", "wlan_mgt.ht.mcsset.rxbitmask.16to23",
10642 FT_UINT32, BASE_HEX, 0, 0x00ff0000, "Rx Bitmask Bits 16-23", HFILL }},
10644 {&mcsset_rx_bitmask_24to31,
10645 {"Rx Bitmask Bits 24-31", "wlan_mgt.ht.mcsset.rxbitmask.24to31",
10646 FT_UINT32, BASE_HEX, 0, 0xff000000, "Rx Bitmask Bits 24-31", HFILL }},
10648 {&mcsset_rx_bitmask_32,
10649 {"Rx Bitmask Bit 32", "wlan_mgt.ht.mcsset.rxbitmask.32",
10650 FT_UINT32, BASE_HEX, 0, 0x000001, "Rx Bitmask Bit 32", HFILL }},
10652 {&mcsset_rx_bitmask_33to38,
10653 {"Rx Bitmask Bits 33-38", "wlan_mgt.ht.mcsset.rxbitmask.33to38",
10654 FT_UINT32, BASE_HEX, 0, 0x00007e, "Rx Bitmask Bits 33-38", HFILL }},
10656 {&mcsset_rx_bitmask_39to52,
10657 {"Rx Bitmask Bits 39-52", "wlan_mgt.ht.mcsset.rxbitmask.39to52",
10658 FT_UINT32, BASE_HEX, 0, 0x1fff80, "Rx Bitmask Bits 39-52", HFILL }},
10660 {&mcsset_rx_bitmask_53to76,
10661 {"Rx Bitmask Bits 53-76", "wlan_mgt.ht.mcsset.rxbitmask.53to76",
10662 FT_UINT32, BASE_HEX, 0, 0x1fffffe0, "Rx Bitmask Bits 53-76", HFILL }},
10664 {&mcsset_highest_data_rate,
10665 {"Highest Supported Data Rate", "wlan_mgt.ht.mcsset.highestdatarate",
10666 FT_UINT16, BASE_HEX, 0, 0x03ff, "Highest Supported Data Rate", HFILL }},
10668 {&mcsset_tx_mcs_set_defined,
10669 {"Tx Supported MCS Set", "wlan_mgt.ht.mcsset.txsetdefined",
10670 FT_BOOLEAN, 16, TFS (&mcsset_tx_mcs_set_defined_flag), 0x0001,
10671 "Tx Supported MCS Set", HFILL }},
10673 {&mcsset_tx_rx_mcs_set_not_equal,
10674 {"Tx and Rx MCS Set", "wlan_mgt.ht.mcsset.txrxmcsnotequal",
10675 FT_BOOLEAN, 16, TFS (&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
10676 "Tx and Rx MCS Set", HFILL }},
10678 {&mcsset_tx_max_spatial_streams,
10679 {"Tx Maximum Number of Spatial Streams Supported", "wlan_mgt.ht.mcsset.txmaxss",
10680 FT_UINT16, BASE_HEX, VALS (&mcsset_tx_max_spatial_streams_flags) , 0x000c,
10681 "Tx Maximum Number of Spatial Streams Supported", HFILL }},
10683 {&mcsset_tx_unequal_modulation,
10684 {"Unequal Modulation", "wlan_mgt.ht.mcsset.txunequalmod",
10685 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0010,
10686 "Unequal Modulation", HFILL }},
10689 {"HT Extended Capabilities", "wlan_mgt.htex.capabilities", FT_UINT16, BASE_HEX,
10690 NULL, 0, "HT Extended Capability information", HFILL }},
10693 {"HT Extended Capabilities (VS)", "wlan_mgt.vs.htex.capabilities", FT_UINT16, BASE_HEX,
10694 NULL, 0, "Vendor Specific HT Extended Capability information", HFILL }},
10697 {"Transmitter supports PCO", "wlan_mgt.htex.capabilities.pco",
10698 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0001,
10699 "Transmitter supports PCO", HFILL }},
10702 {"Time needed to transition between 20MHz and 40MHz", "wlan_mgt.htex.capabilities.transtime",
10703 FT_UINT16, BASE_HEX, VALS (&htex_transtime_flags), 0x0006,
10704 "Time needed to transition between 20MHz and 40MHz", HFILL }},
10707 {"MCS Feedback capability", "wlan_mgt.htex.capabilities.mcs",
10708 FT_UINT16, BASE_HEX, VALS (&htex_mcs_flags), 0x0300,
10709 "MCS Feedback capability", HFILL }},
10711 {&htex_htc_support,
10712 {"High Throughput", "wlan_mgt.htex.capabilities.htc",
10713 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0400,
10714 "High Throughput", HFILL }},
10716 {&htex_rd_responder,
10717 {"Reverse Direction Responder", "wlan_mgt.htex.capabilities.rdresponder",
10718 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0800,
10719 "Reverse Direction Responder", HFILL }},
10722 {"Transmit Beam Forming (TxBF) Capabilities", "wlan_mgt.txbf", FT_UINT16, BASE_HEX,
10723 NULL, 0, "Transmit Beam Forming (TxBF) Capabilities", HFILL }},
10726 {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan_mgt.vs.txbf", FT_UINT16, BASE_HEX,
10727 NULL, 0, "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
10730 {"Transmit Beamforming", "wlan_mgt.txbf.txbf",
10731 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000001,
10732 "Transmit Beamforming", HFILL }},
10735 {"Receive Staggered Sounding", "wlan_mgt.txbf.rxss",
10736 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000002,
10737 "Receive Staggered Sounding", HFILL }},
10740 {"Transmit Staggered Sounding", "wlan_mgt.txbf.txss",
10741 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000004,
10742 "Transmit staggered sounding", HFILL }},
10745 {"Receive Null Data packet (NDP)", "wlan_mgt.txbf.rxndp",
10746 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000008,
10747 "Receive Null Data packet (NDP)", HFILL }},
10750 {"Transmit Null Data packet (NDP)", "wlan_mgt.txbf.txndp",
10751 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000010,
10752 "Transmit Null Data packet (NDP)", HFILL }},
10755 {"Implicit TxBF capable", "wlan_mgt.txbf.impltxbf",
10756 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000020,
10757 "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
10760 {"Calibration", "wlan_mgt.txbf.calibration",
10761 FT_UINT32, BASE_HEX, VALS (&txbf_calib_flag), 0x000000c0,
10762 "Calibration", HFILL }},
10765 {"STA can apply TxBF using CSI explicit feedback", "wlan_mgt.txbf.csi",
10766 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000100,
10767 "Station can apply TxBF using CSI explicit feedback", HFILL }},
10769 {&txbf_expl_uncomp_fm,
10770 {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan_mgt.txbf.fm.uncompressed.tbf",
10771 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000200,
10772 "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
10774 {&txbf_expl_comp_fm,
10775 {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan_mgt.txbf.fm.compressed.tbf",
10776 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000400,
10777 "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
10779 {&txbf_expl_bf_csi,
10780 {"Receiver can return explicit CSI feedback", "wlan_mgt.txbf.rcsi",
10781 FT_UINT32, BASE_HEX, VALS (&txbf_feedback_flags), 0x00001800,
10782 "Receiver can return explicit CSI feedback", HFILL }},
10784 {&txbf_expl_uncomp_fm_feed,
10785 {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.uncompressed.rbf",
10786 FT_UINT32, BASE_HEX, VALS (&txbf_feedback_flags), 0x00006000,
10787 "Receiver can return explicit uncompressed Beamforming Feedback Matrix", HFILL }},
10789 {&txbf_expl_comp_fm_feed,
10790 {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.compressed.bf",
10791 FT_UINT32, BASE_HEX, VALS (&txbf_feedback_flags), 0x00018000,
10792 "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
10795 {"Minimal grouping used for explicit feedback reports", "wlan_mgt.txbf.mingroup",
10796 FT_UINT32, BASE_HEX, VALS (&txbf_min_group_flags), 0x00060000,
10797 "Minimal grouping used for explicit feedback reports", HFILL }},
10799 {&txbf_csi_num_bf_ant,
10800 {"Max antennae STA can support when CSI feedback required", "wlan_mgt.txbf.csinumant",
10801 FT_UINT32, BASE_HEX, VALS (&txbf_antenna_flags), 0x00180000,
10802 "Max antennae station can support when CSI feedback required", HFILL }},
10804 {&txbf_uncomp_sm_bf_ant,
10805 {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan_mgt.txbf.fm.uncompressed.maxant",
10806 FT_UINT32, BASE_HEX, VALS (&txbf_antenna_flags), 0x00600000,
10807 "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
10809 {&txbf_comp_sm_bf_ant,
10810 {"Max antennae STA can support when compressed Beamforming feedback required", "wlan_mgt.txbf.fm.compressed.maxant",
10811 FT_UINT32, BASE_HEX, VALS (&txbf_antenna_flags), 0x01800000,
10812 "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
10814 {&txbf_csi_max_rows_bf,
10815 {"Maximum number of rows of CSI explicit feedback", "wlan_mgt.txbf.csi.maxrows",
10816 FT_UINT32, BASE_HEX, VALS (&txbf_csi_max_rows_bf_flags), 0x06000000,
10817 "Maximum number of rows of CSI explicit feedback", HFILL }},
10820 {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan_mgt.txbf.channelest",
10821 FT_UINT32, BASE_HEX, VALS (&txbf_chan_est_flags), 0x18000000,
10822 "Maximum number of space time streams for which channel dimensions can be simultaneously estimated", HFILL }},
10825 {"Reserved", "wlan_mgt.txbf.reserved",
10826 FT_UINT32, BASE_HEX, NULL, 0xe0000000,
10827 "Reserved", HFILL }},
10830 {"HT Additional Capabilities", "wlan_mgt.hta.capabilities", FT_UINT16, BASE_HEX,
10831 NULL, 0, "HT Additional Capability information", HFILL }},
10833 {&hta_ext_chan_offset,
10834 {"Extension Channel Offset", "wlan_mgt.hta.capabilities.extchan",
10835 FT_UINT16, BASE_HEX, VALS (&hta_ext_chan_offset_flag), 0x0003,
10836 "Extension Channel Offset", HFILL }},
10838 {&hta_rec_tx_width,
10839 {"Recommended Tx Channel Width", "wlan_mgt.hta.capabilities.rectxwidth",
10840 FT_BOOLEAN, 16, TFS (&hta_rec_tx_width_flag), 0x0004,
10841 "Recommended Transmit Channel Width", HFILL }},
10844 {"Reduced Interframe Spacing (RIFS) Mode", "wlan_mgt.hta.capabilities.rifsmode",
10845 FT_BOOLEAN, 16, TFS (&hta_rifs_mode_flag), 0x0008,
10846 "Reduced Interframe Spacing (RIFS) Mode", HFILL }},
10848 {&hta_controlled_access,
10849 {"Controlled Access Only", "wlan_mgt.hta.capabilities.controlledaccess",
10850 FT_BOOLEAN, 16, TFS (&hta_controlled_access_flag), 0x0010,
10851 "Controlled Access Only", HFILL }},
10853 {&hta_service_interval,
10854 {"Service Interval Granularity", "wlan_mgt.hta.capabilities.serviceinterval",
10855 FT_UINT16, BASE_HEX, VALS (&hta_service_interval_flag), 0x00E0,
10856 "Service Interval Granularity", HFILL }},
10858 {&hta_operating_mode,
10859 {"Operating Mode", "wlan_mgt.hta.capabilities.operatingmode",
10860 FT_UINT16, BASE_HEX, VALS (&hta_operating_mode_flag), 0x0003,
10861 "Operating Mode", HFILL }},
10863 {&hta_non_gf_devices,
10864 {"Non Greenfield (GF) devices Present", "wlan_mgt.hta.capabilities.nongfdevices",
10865 FT_BOOLEAN, 16, TFS (&hta_non_gf_devices_flag), 0x0004,
10866 "on Greenfield (GF) devices Present", HFILL }},
10868 {&hta_basic_stbc_mcs,
10869 {"Basic STB Modulation and Coding Scheme (MCS)", "wlan_mgt.hta.capabilities.",
10870 FT_UINT16, BASE_HEX, NULL , 0x007f,
10871 "Basic STB Modulation and Coding Scheme (MCS)", HFILL }},
10873 {&hta_dual_stbc_protection,
10874 {"Dual Clear To Send (CTS) Protection", "wlan_mgt.hta.capabilities.",
10875 FT_BOOLEAN, 16, TFS (&hta_dual_stbc_protection_flag), 0x0080,
10876 "Dual Clear To Send (CTS) Protection", HFILL }},
10878 {&hta_secondary_beacon,
10879 {"Secondary Beacon", "wlan_mgt.hta.capabilities.",
10880 FT_BOOLEAN, 16, TFS (&hta_secondary_beacon_flag), 0x0100,
10881 "Secondary Beacon", HFILL }},
10883 {&hta_lsig_txop_protection,
10884 {"L-SIG TXOP Protection Support", "wlan_mgt.hta.capabilities.",
10885 FT_BOOLEAN, 16, TFS (&hta_lsig_txop_protection_flag), 0x0200,
10886 "L-SIG TXOP Protection Support", HFILL }},
10889 {"Phased Coexistence Operation (PCO) Active", "wlan_mgt.hta.capabilities.",
10890 FT_BOOLEAN, 16, TFS (&hta_pco_active_flag), 0x0400,
10891 "Phased Coexistence Operation (PCO) Active", HFILL }},
10894 {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.hta.capabilities.",
10895 FT_BOOLEAN, 16, TFS (&hta_pco_phase_flag), 0x0800,
10896 "Phased Coexistence Operation (PCO) Phase", HFILL }},
10899 {"Antenna Selection (ASEL) Capabilities", "wlan_mgt.asel",
10900 FT_UINT8, BASE_HEX, NULL, 0, "Antenna Selection (ASEL) Capabilities", HFILL }},
10903 {"Antenna Selection (ASEL) Capabilities (VS)", "wlan_mgt.vs.asel",
10904 FT_UINT8, BASE_HEX, NULL, 0, "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
10907 {"Antenna Selection Capable", "wlan_mgt.asel.capable",
10908 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x01, "Antenna Selection Capable", HFILL }},
10911 {"Explicit CSI Feedback Based Tx ASEL", "wlan_mgt.asel.txcsi",
10912 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x02, "Explicit CSI Feedback Based Tx ASEL", HFILL }},
10915 {"Antenna Indices Feedback Based Tx ASEL", "wlan_mgt.asel.txif",
10916 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x04, "Antenna Indices Feedback Based Tx ASEL", HFILL }},
10919 {"Explicit CSI Feedback", "wlan_mgt.asel.csi",
10920 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x08, "Explicit CSI Feedback", HFILL }},
10923 {"Antenna Indices Feedback", "wlan_mgt.asel.if",
10924 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x10, "Antenna Indices Feedback", HFILL }},
10927 {"Rx ASEL", "wlan_mgt.asel.rx",
10928 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x20, "Rx ASEL", HFILL }},
10931 {"Tx Sounding PPDUs", "wlan_mgt.asel.sppdu",
10932 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x40, "Tx Sounding PPDUs", HFILL }},
10935 {"Reserved", "wlan_mgt.asel.reserved",
10936 FT_UINT8, BASE_HEX, NULL, 0x80, "Reserved", HFILL }},
10938 {&ht_info_delimiter1,
10939 {"HT Information Delimiter #1", "wlan_mgt.ht.info.delim1",
10940 FT_UINT8, BASE_HEX, NULL, 0xff, "HT Information Delimiter #1", HFILL }},
10942 {&ht_info_primary_channel,
10943 {"Primary Channel", "wlan_mgt.ht.info.primarychannel",
10944 FT_UINT8, BASE_DEC, NULL, 0, "Primary Channel", HFILL }},
10946 {&ht_info_secondary_channel_offset,
10947 {"Secondary channel offset", "wlan_mgt.ht.info.secchanoffset",
10948 FT_UINT8, BASE_HEX, VALS (&ht_info_secondary_channel_offset_flags), 0x03, "Secondary channel offset", HFILL }},
10950 {&ht_info_channel_width,
10951 {"Supported channel width", "wlan_mgt.ht.info.chanwidth",
10952 FT_BOOLEAN, 8, TFS (&ht_info_channel_width_flag), 0x04, "Supported channel width", HFILL }},
10954 {&ht_info_rifs_mode,
10955 {"Reduced Interframe Spacing (RIFS)", "wlan_mgt.ht.info.rifs",
10956 FT_BOOLEAN, 8, TFS (&ht_info_rifs_mode_flag), 0x08, "Reduced Interframe Spacing (RIFS)", HFILL }},
10958 {&ht_info_psmp_stas_only,
10959 {"Power Save Multi-Poll (PSMP) stations only", "wlan_mgt.ht.info.psmponly",
10960 FT_BOOLEAN, 8, TFS (&ht_info_psmp_stas_only_flag), 0x10, "Power Save Multi-Poll (PSMP) stations only", HFILL }},
10962 {&ht_info_service_interval_granularity,
10963 {"Shortest service interval", "wlan_mgt.ht.info.",
10964 FT_UINT8, BASE_HEX, VALS (&ht_info_service_interval_granularity_flags), 0xe0, "Shortest service interval", HFILL }},
10966 {&ht_info_delimiter2,
10967 {"HT Information Delimiter #2", "wlan_mgt.ht.info.delim2",
10968 FT_UINT16, BASE_HEX, NULL, 0xffff, "HT Information Delimiter #2", HFILL }},
10970 {&ht_info_operating_mode,
10971 {"Operating mode of BSS", "wlan_mgt.ht.info.operatingmode",
10972 FT_UINT16, BASE_HEX, VALS (&ht_info_operating_mode_flags), 0x0003, "Operating mode of BSS", HFILL }},
10974 {&ht_info_non_greenfield_sta_present,
10975 {"Non-greenfield STAs present", "wlan_mgt.ht.info.greenfield",
10976 FT_BOOLEAN, 16, TFS (&ht_info_non_greenfield_sta_present_flag), 0x0004, "Non-greenfield STAs present", HFILL }},
10978 {&ht_info_transmit_burst_limit,
10979 {"Transmit burst limit", "wlan_mgt.ht.info.burstlim",
10980 FT_BOOLEAN, 16, TFS (&ht_info_transmit_burst_limit_flag), 0x0008, "Transmit burst limit", HFILL }},
10982 {&ht_info_obss_non_ht_stas_present,
10983 {"OBSS non-HT STAs present", "wlan_mgt.ht.info.obssnonht",
10984 FT_BOOLEAN, 16, TFS (&ht_info_obss_non_ht_stas_present_flag), 0x0010, "OBSS non-HT STAs present", HFILL }},
10986 {&ht_info_reserved_1,
10987 {"Reserved", "wlan_mgt.ht.info.reserved1",
10988 FT_UINT16, BASE_HEX, NULL, 0xffe0, "Reserved", HFILL }},
10990 {&ht_info_delimiter3,
10991 {"HT Information Delimiter #3", "wlan_mgt.ht.info.delim3",
10992 FT_UINT16, BASE_HEX, NULL, 0xffff, "HT Information Delimiter #3", HFILL }},
10994 {&ht_info_reserved_2,
10995 {"Reserved", "wlan_mgt.ht.info.reserved2",
10996 FT_UINT16, BASE_HEX, NULL, 0x003f, "Reserved", HFILL }},
10998 {&ht_info_dual_beacon,
10999 {"Dual beacon", "wlan_mgt.ht.info.dualbeacon",
11000 FT_BOOLEAN, 16, TFS (&ht_info_dual_beacon_flag), 0x0040, "Dual beacon", HFILL }},
11002 {&ht_info_dual_cts_protection,
11003 {"Dual Clear To Send (CTS) protection", "wlan_mgt.ht.info.dualcts",
11004 FT_BOOLEAN, 16, TFS (&ht_info_dual_cts_protection_flag), 0x0080, "Dual Clear To Send (CTS) protection", HFILL }},
11006 {&ht_info_secondary_beacon,
11007 {"Beacon ID", "wlan_mgt.ht.info.secondarybeacon",
11008 FT_BOOLEAN, 16, TFS (&ht_info_secondary_beacon_flag), 0x0100, "Beacon ID", HFILL }},
11010 {&ht_info_lsig_txop_protection_full_support,
11011 {"L-SIG TXOP Protection Full Support", "wlan_mgt.ht.info.lsigprotsupport",
11012 FT_BOOLEAN, 16, TFS (&ht_info_lsig_txop_protection_full_support_flag), 0x0200, "L-SIG TXOP Protection Full Support", HFILL }},
11014 {&ht_info_pco_active,
11015 {"Phased Coexistence Operation (PCO)", "wlan_mgt.ht.info.pco.active",
11016 FT_BOOLEAN, 16, TFS (&ht_info_pco_active_flag), 0x0400, "Phased Coexistence Operation (PCO)", HFILL }},
11018 {&ht_info_pco_phase,
11019 {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.ht.info.pco.phase",
11020 FT_BOOLEAN, 16, TFS (&ht_info_pco_phase_flag), 0x0800, "Phased Coexistence Operation (PCO) Phase", HFILL }},
11022 {&ht_info_reserved_3,
11023 {"Reserved", "wlan_mgt.ht.info.reserved3",
11024 FT_UINT16, BASE_HEX, NULL, 0xf000, "Reserved", HFILL }},
11026 {&hf_tag_secondary_channel_offset,
11027 {"Secondary Channel Offset", "wlan_mgt.secchanoffset",
11028 FT_UINT8, BASE_HEX, VALS (&hf_tag_secondary_channel_offset_flags), 0,
11029 "Secondary Channel Offset", HFILL }},
11031 /*** Begin: Power Capability Tag - Dustin Johnson ***/
11032 {&hf_tag_power_capability_min,
11033 {"Minimum Transmit Power", "wlan_mgt.powercap.min",
11034 FT_UINT8, BASE_HEX, NULL, 0, "Minimum Transmit Power", HFILL }},
11036 {&hf_tag_power_capability_max,
11037 {"Maximum Transmit Power", "wlan_mgt.powercap.max",
11038 FT_UINT8, BASE_HEX, NULL, 0, "Maximum Transmit Power", HFILL }},
11039 /*** End: Power Capability Tag - Dustin Johnson ***/
11040 {&hf_tag_tpc_report_trsmt_pow,
11041 {"Transmit Power", "wlan_mgt.tcprep.trsmt_pow",
11042 FT_INT8, BASE_DEC, NULL, 0, "Transmit Power", HFILL }},
11043 {&hf_tag_tpc_report_link_mrg,
11044 {"Link Margin", "wlan_mgt.tcprep.link_mrg",
11045 FT_INT8, BASE_DEC, NULL, 0, "Link Margin", HFILL }},
11046 /*** Begin: Supported Channels Tag - Dustin Johnson ***/
11047 {&hf_tag_supported_channels,
11048 {"Supported Channels Set", "wlan_mgt.supchan",
11049 FT_UINT8, BASE_DEC, NULL, 0, "Supported Channels Set", HFILL }},
11051 {&hf_tag_supported_channels_first,
11052 {"First Supported Channel", "wlan_mgt.supchan.first",
11053 FT_UINT8, BASE_HEX, NULL, 0, "First Supported Channel", HFILL }},
11055 {&hf_tag_supported_channels_range,
11056 {"Supported Channel Range", "wlan_mgt.supchan.range",
11057 FT_UINT8, BASE_HEX, NULL, 0, "Supported Channel Range", HFILL }},
11058 /*** End: Supported Channels Tag - Dustin Johnson ***/
11060 /*** Start: Measurement Request Tag - Dustin Johnson***/
11061 {&hf_tag_measure_request_measurement_token,
11062 {"Measurement Token", "wlan_mgt.measure.req.measuretoken",
11063 FT_UINT8, BASE_HEX, NULL, 0xff, "Measurement Token", HFILL }},
11065 {&hf_tag_measure_request_mode,
11066 {"Measurement Request Mode", "wlan_mgt.measure.req.reqmode",
11067 FT_UINT8, BASE_HEX, NULL, 0xff, "Measurement Request Mode", HFILL }},
11069 {&hf_tag_measure_request_mode_reserved1,
11070 {"Reserved", "wlan_mgt.measure.req.reqmode.reserved1",
11071 FT_UINT8, BASE_HEX, NULL, 0x01, "Reserved", HFILL }},
11073 {&hf_tag_measure_request_mode_enable,
11074 {"Measurement Request Mode Field", "wlan_mgt.measure.req.reqmode.enable",
11075 FT_BOOLEAN, 8, TFS (&hf_tag_measure_enable_flag), 0x02, "Measurement Request Mode Field", HFILL }},
11077 {&hf_tag_measure_request_mode_request,
11078 {"Measurement Reports", "wlan_mgt.measure.req.reqmode.request",
11079 FT_BOOLEAN, 8, TFS (&hf_tag_measure_acc_not_acc), 0x04, "Measurement Reports", HFILL }},
11081 {&hf_tag_measure_request_mode_report,
11082 {"Autonomous Measurement Reports", "wlan_mgt.measure.req.reqmode.report",
11083 FT_BOOLEAN, 8, TFS (&hf_tag_measure_acc_not_acc), 0x08, "Autonomous Measurement Reports", HFILL }},
11085 {&hf_tag_measure_request_mode_reserved2,
11086 {"Reserved", "wlan_mgt.measure.req.reqmode.reserved2",
11087 FT_UINT8, BASE_HEX, NULL, 0xf0, "Reserved", HFILL }},
11089 {&hf_tag_measure_request_type,
11090 {"Measurement Request Type", "wlan_mgt.measure.req.reqtype",
11091 FT_UINT8, BASE_HEX, VALS (&hf_tag_measure_request_type_flags), 0x00, "Measurement Request Type", HFILL }},
11093 {&hf_tag_measure_request_channel_number,
11094 {"Measurement Channel Number", "wlan_mgt.measure.req.channelnumber",
11095 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Channel Number", HFILL }},
11097 {&hf_tag_measure_request_start_time,
11098 {"Measurement Start Time", "wlan_mgt.measure.req.starttime",
11099 FT_UINT64, BASE_HEX, NULL, 0, "Measurement Start Time", HFILL }},
11101 {&hf_tag_measure_request_duration,
11102 {"Measurement Duration", "wlan_mgt.measure.req.channelnumber",
11103 FT_UINT16, BASE_HEX, NULL, 0, "Measurement Duration", HFILL }},
11105 {&hf_tag_measure_request_regulatory_class,
11106 {"Measurement Channel Number", "wlan_mgt.measure.req.regclass",
11107 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Channel Number", HFILL }},
11109 {&hf_tag_measure_request_randomization_interval,
11110 {"Randomization Interval", "wlan_mgt.measure.req.randint",
11111 FT_UINT16, BASE_HEX, NULL, 0, "Randomization Interval", HFILL }},
11113 {&hf_tag_measure_request_measurement_mode,
11114 {"Measurement Mode", "wlan_mgt.measure.req.measurementmode",
11115 FT_UINT8, BASE_HEX, VALS(&hf_tag_measure_request_measurement_mode_flags), 0, "Measurement Mode", HFILL }},
11117 {&hf_tag_measure_request_bssid,
11118 {"BSSID", "wlan_mgt.measure.req.bssid",
11119 FT_ETHER, BASE_NONE, NULL, 0, "BSSID", HFILL }},
11121 {&hf_tag_measure_request_reporting_condition,
11122 {"Reporting Condition", "wlan_mgt.measure.req.repcond",
11123 FT_UINT8, BASE_HEX, VALS(&hf_tag_measure_request_reporting_condition_flags), 0, "Reporting Condition", HFILL }},
11125 {&hf_tag_measure_request_threshold_offset_unsigned,
11126 {"Threshold/Offset", "wlan_mgt.measure.req.threshold",
11127 FT_UINT8, BASE_HEX, 0, 0, "Threshold/Offset", HFILL }},
11129 {&hf_tag_measure_request_threshold_offset_signed,
11130 {"Threshold/Offset", "wlan_mgt.measure.req.threshold",
11131 FT_UINT8, BASE_HEX, 0, 0, "Threshold/Offset", HFILL }},
11133 {&hf_tag_measure_request_report_mac,
11134 {"MAC on wich to gather data", "wlan_mgt.measure.req.reportmac",
11135 FT_ETHER, BASE_NONE, NULL, 0, "MAC on wich to gather data", HFILL }},
11137 {&hf_tag_measure_request_group_id,
11138 {"Group ID", "wlan_mgt.measure.req.groupid",
11139 FT_UINT8, BASE_HEX, VALS(&hf_tag_measure_request_group_id_flags), 0, "Group ID", HFILL }},
11140 /*** End: Measurement Request Tag - Dustin Johnson***/
11142 /*** Start: Measurement Report Tag - Dustin Johnson***/
11143 {&hf_tag_measure_report_measurement_token,
11144 {"Measurement Token", "wlan_mgt.measure.req.clr",
11145 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Token", HFILL }},
11147 {&hf_tag_measure_report_mode,
11148 {"Measurement Report Mode", "wlan_mgt.measure.req.clr",
11149 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Report Mode", HFILL }},
11151 {&hf_tag_measure_report_mode_late,
11152 {"Measurement Report Mode Field", "wlan_mgt.measure.rep.repmode.late",
11153 FT_BOOLEAN, 8, TFS (&hf_tag_measure_enable_flag), 0x01, "Measurement Report Mode Field", HFILL }},
11155 {&hf_tag_measure_report_mode_incapable,
11156 {"Measurement Reports", "wlan_mgt.measure.rep.repmode.incapable",
11157 FT_BOOLEAN, 8, TFS (&hf_tag_measure_acc_not_acc), 0x02, "Measurement Reports", HFILL }},
11159 {&hf_tag_measure_report_mode_refused,
11160 {"Autonomous Measurement Reports", "wlan_mgt.measure.rep.repmode.refused",
11161 FT_BOOLEAN, 8, TFS (&hf_tag_measure_acc_not_acc), 0x04, "Autonomous Measurement Reports", HFILL }},
11163 {&hf_tag_measure_report_mode_reserved,
11164 {"Reserved", "wlan_mgt.measure.rep.repmode.reserved",
11165 FT_UINT8, BASE_HEX, NULL, 0xf8, "Reserved", HFILL }},
11167 {&hf_tag_measure_report_type,
11168 {"Measurement Report Type", "wlan_mgt.measure.rep.reptype",
11169 FT_UINT8, BASE_HEX, VALS (&hf_tag_measure_report_type_flags), 0x00, "Measurement Report Type", HFILL }},
11171 {&hf_tag_measure_report_channel_number,
11172 {"Measurement Channel Number", "wlan_mgt.measure.rep.channelnumber",
11173 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Channel Number", HFILL }},
11175 {&hf_tag_measure_report_start_time,
11176 {"Measurement Start Time", "wlan_mgt.measure.rep.starttime",
11177 FT_UINT64, BASE_HEX, NULL, 0, "Measurement Start Time", HFILL }},
11179 {&hf_tag_measure_report_duration,
11180 {"Measurement Duration", "wlan_mgt.measure.rep.channelnumber",
11181 FT_UINT16, BASE_HEX, NULL, 0, "Measurement Duration", HFILL }},
11183 {&hf_tag_measure_cca_busy_fraction,
11184 {"CCA Busy Fraction", "wlan_mgt.measure.rep.ccabusy",
11185 FT_UINT8, BASE_HEX, NULL, 0, "CCA Busy Fraction", HFILL }},
11187 {&hf_tag_measure_basic_map_field,
11188 {"Map Field", "wlan_mgt.measure.rep.mapfield",
11189 FT_UINT8, BASE_HEX, NULL, 0, "Map Field", HFILL }},
11191 {&hf_tag_measure_map_field_bss,
11192 {"BSS", "wlan_mgt.measure.rep.repmode.mapfield.bss",
11193 FT_BOOLEAN, 8, TFS (&hf_tag_measure_map_field_bss_flag), 0x01, "BSS", HFILL }},
11195 {&hf_tag_measure_map_field_odfm,
11196 {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan_mgt.measure.rep.repmode.mapfield.bss",
11197 FT_BOOLEAN, 8, TFS (&hf_tag_measure_detected_not_detected), 0x02, "Orthogonal Frequency Division Multiplexing (ODFM) Preamble", HFILL }},
11199 {&hf_tag_measure_map_field_unident_signal,
11200 {"Unidentified Signal", "wlan_mgt.measure.rep.repmode.mapfield.unidentsig",
11201 FT_BOOLEAN, 8, TFS (&hf_tag_measure_detected_not_detected), 0x04, "Unidentified Signal", HFILL }},
11203 {&hf_tag_measure_map_field_radar,
11204 {"Radar", "wlan_mgt.measure.rep.repmode.mapfield.radar",
11205 FT_BOOLEAN, 8, TFS (&hf_tag_measure_detected_not_detected), 0x08, "Radar", HFILL }},
11207 {&hf_tag_measure_map_field_unmeasured,
11208 {"Unmeasured", "wlan_mgt.measure.rep.repmode.mapfield.unmeasured",
11209 FT_BOOLEAN, 8, TFS (&hf_tag_measure_true_false), 0x10, "Unmeasured", HFILL }},
11211 {&hf_tag_measure_map_field_reserved,
11212 {"Reserved", "wlan_mgt.measure.rep.repmode.mapfield.reserved",
11213 FT_UINT8, BASE_HEX, NULL, 0xe0, "Reserved", HFILL }},
11215 {&hf_tag_measure_rpi_histogram_report,
11216 {"Receive Power Indicator (RPI) Histogram Report", "wlan_mgt.measure.rep.rpi.histogram_report",
11217 FT_STRING, BASE_NONE, NULL, 0, "Receive Power Indicator (RPI) Histogram Report", HFILL }},
11219 {&hf_tag_measure_rpi_histogram_report_0,
11220 {"RPI 0 Density", "wlan_mgt.measure.rep.rpi.rpi0density",
11221 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 0 Density", HFILL }},
11223 {&hf_tag_measure_rpi_histogram_report_1,
11224 {"RPI 1 Density", "wlan_mgt.measure.rep.rpi.rpi1density",
11225 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 1 Density", HFILL }},
11227 {&hf_tag_measure_rpi_histogram_report_2,
11228 {"RPI 2 Density", "wlan_mgt.measure.rep.rpi.rpi2density",
11229 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 2 Density", HFILL }},
11231 {&hf_tag_measure_rpi_histogram_report_3,
11232 {"RPI 3 Density", "wlan_mgt.measure.rep.rpi.rpi3density",
11233 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 3 Density", HFILL }},
11235 {&hf_tag_measure_rpi_histogram_report_4,
11236 {"RPI 4 Density", "wlan_mgt.measure.rep.rpi.rpi4density",
11237 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 4 Density", HFILL }},
11239 {&hf_tag_measure_rpi_histogram_report_5,
11240 {"RPI 5 Density", "wlan_mgt.measure.rep.rpi.rpi5density",
11241 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 5 Density", HFILL }},
11243 {&hf_tag_measure_rpi_histogram_report_6,
11244 {"RPI 6 Density", "wlan_mgt.measure.rep.rpi.rpi6density",
11245 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 6 Density", HFILL }},
11247 {&hf_tag_measure_rpi_histogram_report_7,
11248 {"RPI 7 Density", "wlan_mgt.measure.rep.rpi.rpi7density",
11249 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 7 Density", HFILL }},
11251 {&hf_tag_measure_report_regulatory_class,
11252 {"Regulatory Class", "wlan_mgt.measure.rep.regclass",
11253 FT_UINT8, BASE_HEX, NULL, 0, "Regulatory Class", HFILL }},
11255 {&hf_tag_measure_report_channel_load,
11256 {"Channel Load", "wlan_mgt.measure.rep.chanload",
11257 FT_UINT8, BASE_HEX, NULL, 0, "Channel Load", HFILL }},
11259 {&hf_tag_measure_report_frame_info,
11260 {"Reported Frame Information", "wlan_mgt.measure.rep.frameinfo",
11261 FT_UINT8, BASE_HEX, NULL, 0, "Reported Frame Information", HFILL }},
11263 {&hf_tag_measure_report_frame_info_phy_type,
11264 {"Condensed PHY", "wlan_mgt.measure.rep.frameinfo.phytype",
11265 FT_UINT8, BASE_HEX, NULL, 0x7F, "Condensed PHY", HFILL }},
11267 {&hf_tag_measure_report_frame_info_frame_type,
11268 {"Reported Frame Type", "wlan_mgt.measure.rep.frameinfo.frametype",
11269 FT_UINT8, BASE_HEX, TFS(&hf_tag_measure_report_frame_info_frame_type_flag), 0x80, "Reported Frame Type", HFILL }},
11271 {&hf_tag_measure_report_rcpi,
11272 {"Received Channel Power Indicator (RCPI)", "wlan_mgt.measure.rep.rcpi",
11273 FT_UINT8, BASE_HEX, NULL, 0, "Received Channel Power Indicator (RCPI)", HFILL }},
11275 {&hf_tag_measure_report_rsni,
11276 {"Received Signal to Noise Indicator (RSNI)", "wlan_mgt.measure.rep.rsni",
11277 FT_UINT8, BASE_HEX, NULL, 0, "Received Signal to Noise Indicator (RSNI)", HFILL }},
11279 {&hf_tag_measure_report_bssid,
11280 {"BSSID Being Reported", "wlan_mgt.measure.rep.bssid",
11281 FT_ETHER, BASE_NONE, NULL, 0, "BSSID Being Reported", HFILL }},
11283 {&hf_tag_measure_report_ant_id,
11284 {"Antenna ID", "wlan_mgt.measure.rep.antid",
11285 FT_UINT8, BASE_HEX, NULL, 0, "Antenna ID", HFILL }},
11287 {&hf_tag_measure_report_parent_tsf,
11288 {"Parent Timing Synchronization Function (TSF)", "wlan_mgt.measure.rep.parenttsf",
11289 FT_UINT32, BASE_HEX, NULL, 0, "Parent Timing Synchronization Function (TSF)", HFILL }},
11290 /*** End: Measurement Report Tag - Dustin Johnson***/
11292 /*** Begin: Extended Capabilities Tag - Dustin Johnson ***/
11293 /* Table 7-35a
\97Capabilities field */
11294 {&hf_tag_extended_capabilities,
11295 {"Extended Capabilities", "wlan_mgt.extcap",
11296 FT_UINT8, BASE_HEX, NULL, 0, "Extended Capabilities", HFILL }},
11298 /* P802.11n/D6.0 */
11299 {&hf_tag_extended_capabilities_b0,
11300 {"20/40 BSS Coexistence Management Support", "wlan_mgt.extcap.infoexchange.b0",
11301 FT_BOOLEAN, 8, TFS(&hf_tag_extended_capabilities_flag), 0x0001, "HT Information Exchange Support", HFILL }},
11303 /* P802.11p/D4.0 */
11304 {&hf_tag_extended_capabilities_b1,
11305 {"On-demand beacon", "wlan_mgt.extcap.infoexchange.b1",
11306 FT_BOOLEAN, 8, TFS(&hf_tag_extended_capabilities_flag), 0x0002, "On-demand beacon", HFILL }},
11308 {&hf_tag_extended_capabilities_b2,
11309 {"Extended Channel Switching", "wlan_mgt.extcap.infoexchange.b2",
11310 FT_BOOLEAN, 8, TFS(&hf_tag_extended_capabilities_flag), 0x0004, "Extended Channel Switching", HFILL }},
11312 {&hf_tag_extended_capabilities_b3,
11313 {"WAVE indication", "wlan_mgt.extcap.infoexchange.b3",
11314 FT_BOOLEAN, 8, TFS(&hf_tag_extended_capabilities_flag), 0x0008, "WAVE indication", HFILL }},
11315 /*End: P802.11p/D4.0 */
11317 /*** End: Extended Capabilities Tag - Dustin Johnson ***/
11319 /*** Begin: Neighbor Report Tag - Dustin Johnson ***/
11320 {&hf_tag_neighbor_report_bssid,
11321 {"BSSID", "wlan_mgt.nreport.bssid",
11322 FT_ETHER, BASE_NONE, NULL, 0, "BSSID", HFILL }},
11324 {&hf_tag_neighbor_report_bssid_info,
11325 {"BSSID Information", "wlan_mgt.nreport.bssid.info",
11326 FT_UINT32, BASE_HEX, NULL, 0, "BSSID Information", HFILL }},
11328 {&hf_tag_neighbor_report_bssid_info_reachability,
11329 {"AP Reachability", "wlan_mgt.nreport.bssid.info.reachability",
11330 FT_UINT16, BASE_HEX, NULL, 0x0003, "AP Reachability", HFILL }},
11332 {&hf_tag_neighbor_report_bssid_info_security,
11333 {"Security", "wlan_mgt.nreport.bssid.info.security",
11334 FT_UINT16, BASE_HEX, NULL, 0x0004, "Security", HFILL }},
11336 {&hf_tag_neighbor_report_bssid_info_key_scope,
11337 {"Key Scope", "wlan_mgt.nreport.bssid.info.keyscope",
11338 FT_UINT16, BASE_HEX, NULL, 0x0008, "Key Scope", HFILL }},
11340 {&hf_tag_neighbor_report_bssid_info_capability_spec_mng,
11341 {"Capability: Spectrum Management", "wlan_mgt.nreport.bssid.info.capability.specmngt",
11342 FT_UINT16, BASE_HEX, NULL, 0x0010, "Capability: Spectrum Management", HFILL }},
11344 {&hf_tag_neighbor_report_bssid_info_capability_qos,
11345 {"Capability: QoS", "wlan_mgt.nreport.bssid.info.capability.qos",
11346 FT_UINT16, BASE_HEX, NULL, 0x0020, "Capability: QoS", HFILL }},
11348 {&hf_tag_neighbor_report_bssid_info_capability_apsd,
11349 {"Capability: APSD", "wlan_mgt.nreport.bssid.info.capability.apsd",
11350 FT_UINT16, BASE_HEX, NULL, 0x0040, "Capability: APSD", HFILL }},
11352 {&hf_tag_neighbor_report_bssid_info_capability_radio_msnt,
11353 {"Capability: Radio Measurement", "wlan_mgt.nreport.bssid.info.capability.radiomsnt",
11354 FT_UINT16, BASE_HEX, NULL, 0x0080, "Capability: Radio Measurement", HFILL }},
11356 {&hf_tag_neighbor_report_bssid_info_capability_dback,
11357 {"Capability: Delayed Block Ack", "wlan_mgt.nreport.bssid.info.capability.dback",
11358 FT_UINT16, BASE_HEX, NULL, 0x0100, "Capability: Delayed Block Ack", HFILL }},
11360 {&hf_tag_neighbor_report_bssid_info_capability_iback,
11361 {"Capability: Immediate Block Ack", "wlan_mgt.nreport.bssid.info.capability.iback",
11362 FT_UINT16, BASE_HEX, NULL, 0x0200, "Capability: Immediate Block Ack", HFILL }},
11364 {&hf_tag_neighbor_report_bssid_info_mobility_domain,
11365 {"Mobility Domain", "wlan_mgt.nreport.bssid.info.mobilitydomain",
11366 FT_UINT16, BASE_HEX, NULL, 0x0400, "Mobility Domain", HFILL }},
11368 {&hf_tag_neighbor_report_bssid_info_high_throughput,
11369 {"High Throughput", "wlan_mgt.nreport.bssid.info.hthoughput",
11370 FT_UINT16, BASE_HEX, NULL, 0x0800, "High Throughput", HFILL }},
11372 {&hf_tag_neighbor_report_bssid_info_reserved,
11373 {"Reserved", "wlan_mgt.nreport.bssid.info.reserved",
11374 FT_UINT32, BASE_HEX, NULL, 0, "Reserved", HFILL }},
11376 {&hf_tag_neighbor_report_reg_class,
11377 {"Regulatory Class", "wlan_mgt.nreport.regclass",
11378 FT_UINT8, BASE_HEX, NULL, 0, "Regulatory Class", HFILL }},
11380 {&hf_tag_neighbor_report_channel_number,
11381 {"Channel Number", "wlan_mgt.nreport.channumber",
11382 FT_UINT8, BASE_HEX, NULL, 0, "Channel Number", HFILL }},
11384 {&hf_tag_neighbor_report_phy_type,
11385 {"PHY Type", "wlan_mgt.nreport.phytype",
11386 FT_UINT8, BASE_HEX, NULL, 0, "PHY Type", HFILL }},
11387 /*** End: Neighbor Report Tag - Dustin Johnson ***/
11389 /*** Begin: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
11390 {&hf_tag_ext_channel_switch_announcement_switch_mode,
11391 {"Channel Switch Mode", "wlan_mgt.extchanswitch.switchmode",
11392 FT_UINT8, BASE_HEX, VALS (&hf_tag_ext_channel_switch_announcement_switch_mode_flags), 0, "Channel Switch Mode", HFILL }},
11394 {&hf_tag_ext_channel_switch_announcement_new_reg_class,
11395 {"New Regulatory Class", "wlan_mgt.extchanswitch.new.regclass",
11396 FT_UINT8, BASE_HEX, NULL, 0, "New Regulatory Class", HFILL }},
11398 {&hf_tag_ext_channel_switch_announcement_new_chan_number,
11399 {"New Channel Number", "wlan_mgt.extchanswitch.new.channumber",
11400 FT_UINT8, BASE_HEX, NULL, 0, "New Channel Number", HFILL }},
11402 {&hf_tag_ext_channel_switch_announcement_switch_count,
11403 {"Channel Switch Count", "wlan_mgt.extchanswitch.switchcount",
11404 FT_UINT8, BASE_HEX, NULL, 0, "Channel Switch Count", HFILL }},
11405 /*** End: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
11407 /*** Begin: Supported Regulatory Classes Tag - Dustin Johnson ***/
11408 {&hf_tag_supported_reg_classes_current,
11409 {"Current Regulatory Class", "wlan_mgt.supregclass.current",
11410 FT_UINT8, BASE_HEX, NULL, 0, "Current Regulatory Class", HFILL }},
11412 {&hf_tag_supported_reg_classes_alternate,
11413 {"Alternate Regulatory Classes", "wlan_mgt.supregclass.alt",
11414 FT_STRING, BASE_NONE, NULL, 0, "Alternate Regulatory Classes", HFILL }},
11415 /*** End: Supported Regulatory Classes Tag - Dustin Johnson ***/
11417 {&hf_marvell_ie_type,
11418 {"Type", "wlan_mgt.marvell.ie.type",
11419 FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }},
11421 {&hf_marvell_ie_mesh_subtype,
11422 {"Subtype", "wlan_mgt.marvell.ie.subtype",
11423 FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }},
11425 {&hf_marvell_ie_mesh_version,
11426 {"Version", "wlan_mgt.marvell.ie.version",
11427 FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }},
11429 {&hf_marvell_ie_mesh_active_proto_id,
11430 {"Path Selection Protocol", "wlan_mgt.marvell.ie.proto_id",
11431 FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0, "", HFILL }},
11433 {&hf_marvell_ie_mesh_active_metric_id,
11434 {"Path Selection Metric", "wlan_mgt.marvell.ie.metric_id",
11435 FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0, "", HFILL }},
11437 {&hf_marvell_ie_mesh_cap,
11438 {"Mesh Capabilities", "wlan_mgt.marvell.ie.cap",
11439 FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }},
11441 {&hf_marvell_ie_data,
11442 { "Marvell IE data", "wlan_mgt.marvell.data",
11443 FT_BYTES, BASE_NONE, NULL, 0x0, "Marvell IE data", HFILL }},
11445 {&hf_aironet_ie_type,
11446 {"Aironet IE type", "wlan_mgt.aironet.type",
11447 FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0, "Aironet IE type", HFILL }},
11449 {&hf_aironet_ie_version,
11450 {"Aironet IE CCX version?", "wlan_mgt.aironet.version",
11451 FT_UINT8, BASE_DEC, NULL, 0, "Aironet IE CCX version?", HFILL }},
11453 {&hf_aironet_ie_data,
11454 { "Aironet IE data", "wlan_mgt.aironet.data",
11455 FT_BYTES, BASE_NONE, NULL, 0x0, "Aironet IE data", HFILL }},
11458 {"QBSS Version", "wlan_mgt.qbss.version",
11459 FT_UINT8, BASE_DEC, NULL, 0, "QBSS Version", HFILL }},
11462 {"Station Count", "wlan_mgt.qbss.scount",
11463 FT_UINT16, BASE_DEC, NULL, 0, "Station Count", HFILL }},
11466 {"Channel Utilization", "wlan_mgt.qbss.cu",
11467 FT_UINT8, BASE_DEC, NULL, 0, "Channel Utilization", HFILL }},
11470 {"Available Admission Capabilities", "wlan_mgt.qbss.adc",
11471 FT_UINT8, BASE_DEC, NULL, 0, "Available Admission Capabilities", HFILL }},
11474 {"Channel Utilization", "wlan_mgt.qbss2.cu",
11475 FT_UINT8, BASE_DEC, NULL, 0, "Channel Utilization", HFILL }},
11478 {"G.711 CU Quantum", "wlan_mgt.qbss2.glimit",
11479 FT_UINT8, BASE_DEC, NULL, 0, "G.711 CU Quantum", HFILL }},
11482 {"Call Admission Limit", "wlan_mgt.qbss2.cal",
11483 FT_UINT8, BASE_DEC, NULL, 0, "Call Admission Limit", HFILL }},
11486 {"Station Count", "wlan_mgt.qbss2.scount",
11487 FT_UINT16, BASE_DEC, NULL, 0, "Station Count", HFILL }},
11489 {&hf_aironet_ie_qos_unk1,
11490 {"Aironet IE QoS unknown 1", "wlan_mgt.aironet.qos.unk1",
11491 FT_UINT8, BASE_HEX, NULL, 0, "Aironet IE QoS unknown 1", HFILL }},
11493 {&hf_aironet_ie_qos_paramset,
11494 {"Aironet IE QoS paramset", "wlan_mgt.aironet.qos.paramset",
11495 FT_UINT8, BASE_DEC, NULL, 0, "Aironet IE QoS paramset", HFILL }},
11497 {&hf_aironet_ie_qos_val,
11498 {"Aironet IE QoS valueset", "wlan_mgt.aironet.qos.val",
11499 FT_BYTES, BASE_NONE, NULL, 0, "Aironet IE QoS valueset", HFILL }},
11502 {"Traffic Stream (TS) Info", "wlan_mgt.ts_info",
11503 FT_UINT24, BASE_HEX, NULL, 0, "Traffic Stream (TS) Info field", HFILL }},
11506 {"Traffic Type", "wlan_mgt.ts_info.type", FT_UINT8, BASE_DEC,
11507 VALS (&tsinfo_type), 0, "Traffic Stream (TS) Info Traffic Type", HFILL }},
11510 {"Traffic Stream ID (TSID)", "wlan_mgt.ts_info.tsid",
11511 FT_UINT8, BASE_DEC, NULL, 0, "Traffic Stream ID (TSID) Info TSID", HFILL }},
11514 {"Direction", "wlan_mgt.ts_info.dir", FT_UINT8, BASE_DEC,
11515 VALS (&tsinfo_direction), 0, "Traffic Stream (TS) Info Direction", HFILL }},
11517 {&hf_tsinfo_access,
11518 {"Access Policy", "wlan_mgt.ts_info.dir", FT_UINT8, BASE_DEC,
11519 VALS (&tsinfo_access), 0, "Traffic Stream (TS) Info Access Policy", HFILL }},
11522 {"Aggregation", "wlan_mgt.ts_info.agg", FT_UINT8, BASE_DEC,
11523 NULL, 0, "Traffic Stream (TS) Info Access Policy", HFILL }},
11526 {"Automatic Power-Save Delivery (APSD)", "wlan_mgt.ts_info.apsd", FT_UINT8, BASE_DEC,
11527 NULL, 0, "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
11530 {"User Priority", "wlan_mgt.ts_info.up", FT_UINT8, BASE_DEC,
11531 VALS (&qos_up), 0, "Traffic Stream (TS) Info User Priority", HFILL }},
11534 {"Ack Policy", "wlan_mgt.ts_info.ack", FT_UINT8, BASE_DEC,
11535 VALS (&ack_policy), 0, "Traffic Stream (TS) Info Ack Policy", HFILL }},
11538 {"Schedule", "wlan_mgt.ts_info.sched", FT_UINT8, BASE_DEC,
11539 NULL, 0, "Traffic Stream (TS) Info Schedule", HFILL }},
11542 {"Normal MSDU Size", "wlan_mgt.tspec.nor_msdu",
11543 FT_UINT16, BASE_DEC, NULL, 0, "Normal MSDU Size", HFILL }},
11546 {"Maximum MSDU Size", "wlan_mgt.tspec.max_msdu",
11547 FT_UINT16, BASE_DEC, NULL, 0, "Maximum MSDU Size", HFILL }},
11550 {"Minimum Service Interval", "wlan_mgt.tspec.min_srv",
11551 FT_UINT32, BASE_DEC, NULL, 0, "Minimum Service Interval", HFILL }},
11554 {"Maximum Service Interval", "wlan_mgt.tspec.max_srv",
11555 FT_UINT32, BASE_DEC, NULL, 0, "Maximum Service Interval", HFILL }},
11558 {"Inactivity Interval", "wlan_mgt.tspec.inact_int",
11559 FT_UINT32, BASE_DEC, NULL, 0, "Inactivity Interval", HFILL }},
11562 {"Suspension Interval", "wlan_mgt.tspec.susp_int",
11563 FT_UINT32, BASE_DEC, NULL, 0, "Suspension Interval", HFILL }},
11566 {"Service Start Time", "wlan_mgt.tspec.srv_start",
11567 FT_UINT32, BASE_DEC, NULL, 0, "Service Start Time", HFILL }},
11570 {"Minimum Data Rate", "wlan_mgt.tspec.min_data",
11571 FT_UINT32, BASE_DEC, NULL, 0, "Minimum Data Rate", HFILL }},
11574 {"Mean Data Rate", "wlan_mgt.tspec.mean_data",
11575 FT_UINT32, BASE_DEC, NULL, 0, "Mean Data Rate", HFILL }},
11578 {"Peak Data Rate", "wlan_mgt.tspec.peak_data",
11579 FT_UINT32, BASE_DEC, NULL, 0, "Peak Data Rate", HFILL }},
11581 {&tspec_burst_size,
11582 {"Burst Size", "wlan_mgt.tspec.burst_size",
11583 FT_UINT32, BASE_DEC, NULL, 0, "Burst Size", HFILL }},
11585 {&tspec_delay_bound,
11586 {"Delay Bound", "wlan_mgt.tspec.delay_bound",
11587 FT_UINT32, BASE_DEC, NULL, 0, "Delay Bound", HFILL }},
11590 {"Minimum PHY Rate", "wlan_mgt.tspec.min_phy",
11591 FT_UINT32, BASE_DEC, NULL, 0, "Minimum PHY Rate", HFILL }},
11594 {"Surplus Bandwidth Allowance", "wlan_mgt.tspec.surplus",
11595 FT_UINT16, BASE_DEC, NULL, 0, "Surplus Bandwidth Allowance", HFILL }},
11598 {"Medium Time", "wlan_mgt.tspec.medium",
11599 FT_UINT16, BASE_DEC, NULL, 0, "Medium Time", HFILL }},
11602 {"Traffic Stream (TS) Delay", "wlan_mgt.ts_delay",
11603 FT_UINT32, BASE_DEC, NULL, 0, "Traffic Stream (TS) Delay", HFILL }},
11606 {"Classifier Type", "wlan_mgt.tclas.class_type", FT_UINT8, BASE_DEC,
11607 VALS (classifier_type), 0, "Classifier Type", HFILL }},
11610 {"Classifier Mask", "wlan_mgt.tclas.class_mask", FT_UINT8, BASE_HEX,
11611 NULL, 0, "Classifier Mask", HFILL }},
11614 {"Ethernet Type", "wlan_mgt.tclas.params.type", FT_UINT8, BASE_DEC,
11615 NULL, 0, "Classifier Parameters Ethernet Type", HFILL }},
11617 {&hf_tclas_process,
11618 {"Processing", "wlan_mgt.tclas_proc.processing", FT_UINT8, BASE_DEC,
11619 VALS (tclas_process), 0, "TCLAS Processing", HFILL }},
11622 {"Schedule Info", "wlan_mgt.sched.sched_info",
11623 FT_UINT16, BASE_HEX, NULL, 0, "Schedule Info field", HFILL }},
11625 {&hf_sched_srv_start,
11626 {"Service Start Time", "wlan_mgt.sched.srv_start",
11627 FT_UINT32, BASE_HEX, NULL, 0, "Service Start Time", HFILL }},
11629 {&hf_sched_srv_int,
11630 {"Service Interval", "wlan_mgt.sched.srv_int",
11631 FT_UINT32, BASE_HEX, NULL, 0, "Service Interval", HFILL }},
11633 {&hf_sched_spec_int,
11634 {"Specification Interval", "wlan_mgt.sched.spec_int",
11635 FT_UINT16, BASE_HEX, NULL, 0, "Specification Interval", HFILL }},
11638 {"Action", "wlan_mgt.fixed.action",
11639 FT_UINT8, BASE_HEX, NULL, 0, "Action", HFILL }},
11642 {"IP Version", "wlan_mgt.tclas.params.version",
11643 FT_UINT8, BASE_DEC, NULL, 0, "IP Version", HFILL }},
11646 {"IPv4 Src Addr", "wlan_mgt.tclas.params.ipv4_src",
11647 FT_IPv4, BASE_NONE, NULL, 0, "IPv4 Src Addr", HFILL }},
11650 {"IPv4 Dst Addr", "wlan_mgt.tclas.params.ipv4_dst",
11651 FT_IPv4, BASE_NONE, NULL, 0, "IPv4 Dst Addr", HFILL }},
11654 {"Source Port", "wlan_mgt.tclas.params.src_port",
11655 FT_UINT16, BASE_DEC, NULL, 0, "Source Port", HFILL }},
11658 {"Destination Port", "wlan_mgt.tclas.params.dst_port",
11659 FT_UINT16, BASE_DEC, NULL, 0, "Destination Port", HFILL }},
11662 {"IPv4 DSCP", "wlan_mgt.tclas.params.dscp",
11663 FT_UINT8, BASE_HEX, NULL, 0, "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
11666 {"Protocol", "wlan_mgt.tclas.params.protocol",
11667 FT_UINT8, BASE_HEX, NULL, 0, "IPv4 Protocol", HFILL }},
11670 {"IPv6 Src Addr", "wlan_mgt.tclas.params.ipv6_src",
11671 FT_IPv6, BASE_NONE, NULL, 0, "IPv6 Src Addr", HFILL }},
11674 {"IPv6 Dst Addr", "wlan_mgt.tclas.params.ipv6_dst",
11675 FT_IPv6, BASE_NONE, NULL, 0, "IPv6 Dst Addr", HFILL }},
11678 {"Flow Label", "wlan_mgt.tclas.params.flow",
11679 FT_UINT24, BASE_HEX, NULL, 0, "IPv6 Flow Label", HFILL }},
11682 {"802.1Q Tag Type", "wlan_mgt.tclas.params.tag_type",
11683 FT_UINT16, BASE_HEX, NULL, 0, "802.1Q Tag Type", HFILL }},
11686 {"Aruba Type", "wlan_mgt.aruba_type",
11687 FT_UINT16, BASE_DEC, VALS(aruba_mgt_typevals), 0, "Aruba Management", HFILL }},
11690 {"Aruba Heartbeat Sequence", "wlan_mgt.aruba_heartbeat_sequence",
11691 FT_UINT64, BASE_DEC, NULL, 0, "Aruba Heartbeat Sequence", HFILL }},
11694 {"Aruba MTU Size", "wlan_mgt.aruba_mtu_size",
11695 FT_UINT16, BASE_DEC, NULL, 0, "Aruba MTU Size", HFILL }},
11697 /* Start: HT Control (+HTC) */
11699 {"HT Control (+HTC)", "wlan_mgt.htc",
11700 FT_UINT32, BASE_HEX, NULL, 0, "High Throughput Control (+HTC)", HFILL }},
11702 {"Link Adaptation Control (LAC)", "wlan_mgt.htc.lac",
11703 FT_UINT16, BASE_HEX, NULL, 0, "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
11704 {&hf_htc_lac_reserved,
11705 {"Reserved", "wlan_mgt.htc.lac.reserved",
11706 FT_BOOLEAN, 16, NULL, 0x0001, "High Throughput Control Link Adaptation Control Reserved", HFILL }},
11708 {"Training Request (TRQ)", "wlan_mgt.htc.lac.trq",
11709 FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002, "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
11710 {&hf_htc_lac_mai_aseli,
11711 {"Antenna Selection Indication (ASELI)", "wlan_mgt.htc.lac.mai.aseli",
11712 FT_UINT16, BASE_HEX, NULL, 0x003C, "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
11713 {&hf_htc_lac_mai_mrq,
11714 {"MCS Request (MRQ)", "wlan_mgt.htc.lac.mai.mrq",
11715 FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004, "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
11716 {&hf_htc_lac_mai_msi,
11717 {"MCS Request Sequence Identifier (MSI)", "wlan_mgt.htc.lac.mai.msi",
11718 FT_UINT16, BASE_HEX, NULL, 0x0038, "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
11719 {&hf_htc_lac_mai_reserved,
11720 {"Reserved", "wlan_mgt.htc.lac.mai.reserved",
11721 FT_UINT16, BASE_HEX, NULL, 0x0038, "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
11723 {"MCS Feedback Sequence Identifier (MFSI)", "wlan_mgt.htc.lac.mfsi",
11724 FT_UINT16, BASE_DEC, NULL, 0x01C0, "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
11725 {&hf_htc_lac_asel_command,
11726 {"Antenna Selection (ASEL) Command", "wlan_mgt.htc.lac.asel.command",
11727 FT_UINT16, BASE_HEX, VALS (&hf_htc_lac_asel_command_flags), 0x0E00, "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
11728 {&hf_htc_lac_asel_data,
11729 {"Antenna Selection (ASEL) Data", "wlan_mgt.htc.lac.asel.data",
11730 FT_UINT16, BASE_HEX, NULL, 0xF000, "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
11732 {"MCS Feedback (MFB)", "wlan_mgt.htc.lac.mfb",
11733 FT_UINT16, BASE_HEX, NULL, 0xFE00, "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
11735 {"Calibration Position", "wlan_mgt.htc.cal.pos",
11736 FT_UINT16, BASE_DEC, VALS (&hf_htc_cal_pos_flags), 0x0003, "High Throughput Control Calibration Position", HFILL }},
11738 {"Calibration Sequence Identifier", "wlan_mgt.htc.cal.seq",
11739 FT_UINT16, BASE_DEC, NULL, 0x000C, "High Throughput Control Calibration Sequence Identifier", HFILL }},
11740 {&hf_htc_reserved1,
11741 {"Reserved", "wlan_mgt.htc.reserved1",
11742 FT_UINT16, BASE_DEC, NULL, 0x0030, "High Throughput Control Reserved", HFILL }},
11743 {&hf_htc_csi_steering,
11744 {"CSI/Steering", "wlan_mgt.htc.csi_steering",
11745 FT_UINT16, BASE_DEC, VALS (&hf_htc_csi_steering_flags), 0x00C0, "High Throughput Control CSI/Steering", HFILL }},
11746 {&hf_htc_ndp_announcement,
11747 {"NDP Announcement", "wlan_mgt.htc.ndp_announcement",
11748 FT_BOOLEAN, 16, TFS(&hf_htc_ndp_announcement_flag), 0x0100, "High Throughput Control NDP Announcement", HFILL }},
11749 {&hf_htc_reserved2,
11750 {"Reserved", "wlan_mgt.htc.reserved2",
11751 FT_UINT16, BASE_HEX, NULL, 0x3E00, "High Throughput Control Reserved", HFILL }},
11752 {&hf_htc_ac_constraint,
11753 {"AC Constraint", "wlan_mgt.htc.ac_constraint",
11754 FT_BOOLEAN, 16, NULL, 0x4000, "High Throughput Control AC Constraint", HFILL }},
11755 {&hf_htc_rdg_more_ppdu,
11756 {"RDG/More PPDU", "wlan_mgt.htc.rdg_more_ppdu",
11757 FT_BOOLEAN, 16, NULL, 0x8000, "High Throughput Control RDG/More PPDU", HFILL }}
11758 /* End: HT Control (+HTC) */
11761 static hf_register_info aggregate_fields[] = {
11762 {&amsdu_msdu_header_text,
11763 {"MAC Service Data Unit (MSDU)", "wlan_aggregate.msduheader", FT_UINT16,
11764 BASE_DEC, 0, 0x0000, "MAC Service Data Unit (MSDU)", HFILL }}
11767 static gint *tree_array[] = {
11775 &ett_fixed_parameters,
11776 &ett_tagged_parameters,
11777 &ett_qos_parameters,
11778 &ett_qos_ps_buf_state,
11779 &ett_wep_parameters,
11783 &ett_ff_ba_param_tree,
11785 &ett_ff_sm_pwr_save,
11786 &ett_ff_psmp_param_set,
11787 &ett_ff_mimo_cntrl,
11789 &ett_ff_chan_switch_announce,
11791 &ett_ff_psmp_sta_info,
11792 &ett_ff_delba_param_tree,
11793 &ett_ff_ba_ssc_tree,
11795 &ett_cntrl_wrapper_fc,
11796 &ett_cntrl_wrapper_payload,
11797 &ett_ht_info_delimiter1_tree,
11798 &ett_ht_info_delimiter2_tree,
11799 &ett_ht_info_delimiter3_tree,
11800 &ett_msdu_aggregation_parent_tree,
11801 &ett_msdu_aggregation_subframe_tree,
11802 &ett_tag_measure_request_tree,
11804 &ett_tag_supported_channels,
11805 &ett_tag_neighbor_report_bssid_info_tree,
11806 &ett_tag_neighbor_report_bssid_info_capability_tree,
11807 &ett_tag_neighbor_report_sub_tag_tree,
11808 &ett_ampduparam_tree,
11811 &ett_htex_cap_tree,
11814 &ett_hta_cap1_tree,
11815 &ett_hta_cap2_tree,
11825 &ett_chan_noc_tree,
11826 &ett_wave_chnl_tree
11828 module_t *wlan_module;
11830 memset (&wlan_stats, 0, sizeof wlan_stats);
11832 proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
11833 "IEEE 802.11 Aggregate Data", "wlan_aggregate");
11834 proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
11835 proto_wlan = proto_register_protocol ("IEEE 802.11 wireless LAN",
11836 "IEEE 802.11", "wlan");
11837 proto_register_field_array (proto_wlan, hf, array_length (hf));
11838 proto_wlan_mgt = proto_register_protocol ("IEEE 802.11 wireless LAN management frame",
11839 "802.11 MGT", "wlan_mgt");
11840 proto_register_field_array (proto_wlan_mgt, ff, array_length (ff));
11841 proto_register_subtree_array (tree_array, array_length (tree_array));
11843 register_dissector("wlan", dissect_ieee80211, proto_wlan);
11844 register_dissector("wlan_fixed", dissect_ieee80211_fixed, proto_wlan);
11845 register_dissector("wlan_bsfc", dissect_ieee80211_bsfc, proto_wlan);
11846 register_dissector("wlan_datapad", dissect_ieee80211_datapad, proto_wlan);
11847 register_dissector("wlan_ht", dissect_ieee80211_ht, proto_wlan);
11848 register_init_routine(wlan_defragment_init);
11849 register_init_routine(wlan_retransmit_init);
11851 proto_radio = proto_register_protocol("802.11 radio information", "Radio", "radio");
11853 proto_prism = proto_register_protocol("Prism capture header", "Prism", "prism");
11854 proto_register_field_array(proto_prism, hf_prism, array_length(hf_prism));
11856 proto_wlancap = proto_register_protocol("AVS WLAN Capture header",
11857 "AVS WLANCAP", "wlancap");
11858 proto_register_field_array(proto_wlancap, hf_wlancap, array_length(hf_wlancap));
11859 register_dissector("wlancap", dissect_wlancap, proto_wlancap);
11861 wlan_tap = register_tap("wlan");
11863 /* Register configuration options */
11864 wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
11865 prefs_register_bool_preference(wlan_module, "defragment",
11866 "Reassemble fragmented 802.11 datagrams",
11867 "Whether fragmented 802.11 datagrams should be reassembled",
11870 prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
11871 "Ignore vendor-specific HT elements",
11872 "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
11873 &wlan_ignore_draft_ht);
11875 prefs_register_bool_preference(wlan_module, "retransmitted",
11876 "Call subdissector for retransmitted 802.11 frames",
11877 "Whether retransmitted 802.11 frames should be subdissected",
11878 &wlan_subdissector);
11880 prefs_register_bool_preference(wlan_module, "check_fcs",
11881 "Assume packets have FCS",
11882 "Some 802.11 cards include the FCS at the end of a packet, others do not.",
11885 /* Davide Schiera (2006-11-26): changed "WEP bit" in "Protection bit" */
11886 /* (according to the document IEEE Std 802.11i-2004) */
11887 prefs_register_enum_preference(wlan_module, "ignore_wep",
11888 "Ignore the Protection bit",
11889 "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
11890 "and some also leave the IV (initialization vector).",
11891 &wlan_ignore_wep, wlan_ignore_wep_options, TRUE);
11895 prefs_register_obsolete_preference(wlan_module, "wep_keys");
11897 #ifdef HAVE_AIRPDCAP
11898 /* Davide Schiera (2006-11-26): added reference to WPA/WPA2 decryption */
11899 prefs_register_bool_preference(wlan_module, "enable_decryption",
11900 "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
11901 &enable_decryption);
11903 prefs_register_bool_preference(wlan_module, "enable_decryption",
11904 "Enable decryption", "Enable WEP decryption",
11905 &enable_decryption);
11908 #ifdef HAVE_AIRPDCAP
11909 prefs_register_static_text_preference(wlan_module, "info_decryption_key",
11910 "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
11911 "010203040506070809101111213 (104/128-bit WEP),\n"
11912 "wpa-pwd:MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
11913 "wpa-psk:0102030405...6061626364 (WPA + 256-bit key). "
11914 "Invalid keys will be ignored.",
11915 "Valid key formats");
11917 prefs_register_static_text_preference(wlan_module, "info_decryption_key",
11918 "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
11919 "010203040506070809101111213 (104/128-bit WEP)",
11920 "Valid key formats");
11923 for (i = 0; i < MAX_ENCRYPTION_KEYS; i++) {
11924 key_name = g_string_new("");
11925 key_title = g_string_new("");
11926 key_desc = g_string_new("");
11927 wep_keystr[i] = NULL;
11928 /* prefs_register_*_preference() expects unique strings, so
11929 * we build them using g_string_printf and just leave them
11931 #ifdef HAVE_AIRPDCAP
11932 g_string_printf(key_name, "wep_key%d", i + 1);
11933 g_string_printf(key_title, "Key #%d", i + 1);
11934 /* Davide Schiera (2006-11-26): modified keys input tooltip */
11935 g_string_printf(key_desc,
11936 "Key #%d string can be:"
11937 " <wep hexadecimal key>;"
11938 " wep:<wep hexadecimal key>;"
11939 " wpa-pwd:<passphrase>[:<ssid>];"
11940 " wpa-psk:<wpa hexadecimal key>", i + 1);
11942 g_string_printf(key_name, "wep_key%d", i + 1);
11943 g_string_printf(key_title, "WEP key #%d", i + 1);
11944 g_string_printf(key_desc, "WEP key #%d can be:"
11945 " <wep hexadecimal key>;"
11946 " wep:<wep hexadecimal key>", i + 1);
11949 prefs_register_string_preference(wlan_module, key_name->str,
11950 key_title->str, key_desc->str, (const char **) &wep_keystr[i]);
11952 g_string_free(key_name, FALSE);
11953 g_string_free(key_title, FALSE);
11954 g_string_free(key_desc, FALSE);
11960 proto_reg_handoff_ieee80211(void)
11962 dissector_handle_t radio_handle;
11963 dissector_handle_t prism_handle;
11966 * Get handles for the LLC, IPX and Ethernet dissectors.
11968 llc_handle = find_dissector("llc");
11969 ipx_handle = find_dissector("ipx");
11970 eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
11971 data_handle = find_dissector("data");
11973 ieee80211_handle = find_dissector("wlan");
11974 dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
11975 dissector_add("ethertype", ETHERTYPE_CENTRINO_PROMISC, ieee80211_handle);
11977 /* Register handoff to radio-header dissectors */
11978 radio_handle = create_dissector_handle(dissect_radio, proto_radio);
11979 dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11_WITH_RADIO, radio_handle);
11981 prism_handle = create_dissector_handle(dissect_prism, proto_prism);
11982 dissector_add("wtap_encap", WTAP_ENCAP_PRISM_HEADER, prism_handle);
11984 wlancap_handle = create_dissector_handle(dissect_wlancap, proto_wlancap);
11985 dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11_WLAN_AVS, wlancap_handle);
11987 /* Register handoff to Aruba GRE */
11988 dissector_add("gre.proto", GRE_ARUBA_8200, ieee80211_handle);
11989 dissector_add("gre.proto", GRE_ARUBA_8210, ieee80211_handle);
11990 dissector_add("gre.proto", GRE_ARUBA_8220, ieee80211_handle);
11991 dissector_add("gre.proto", GRE_ARUBA_8230, ieee80211_handle);
11992 dissector_add("gre.proto", GRE_ARUBA_8240, ieee80211_handle);
11993 dissector_add("gre.proto", GRE_ARUBA_8250, ieee80211_handle);
11994 dissector_add("gre.proto", GRE_ARUBA_8260, ieee80211_handle);
11995 dissector_add("gre.proto", GRE_ARUBA_8270, ieee80211_handle);
11996 dissector_add("gre.proto", GRE_ARUBA_8280, ieee80211_handle);
11997 dissector_add("gre.proto", GRE_ARUBA_8290, ieee80211_handle);
11998 dissector_add("gre.proto", GRE_ARUBA_82A0, ieee80211_handle);
11999 dissector_add("gre.proto", GRE_ARUBA_82B0, ieee80211_handle);
12000 dissector_add("gre.proto", GRE_ARUBA_82C0, ieee80211_handle);
12001 dissector_add("gre.proto", GRE_ARUBA_82D0, ieee80211_handle);
12002 dissector_add("gre.proto", GRE_ARUBA_82E0, ieee80211_handle);
12003 dissector_add("gre.proto", GRE_ARUBA_82F0, ieee80211_handle);
12004 dissector_add("gre.proto", GRE_ARUBA_8300, ieee80211_handle);
12005 dissector_add("gre.proto", GRE_ARUBA_8310, ieee80211_handle);
12006 dissector_add("gre.proto", GRE_ARUBA_8320, ieee80211_handle);
12007 dissector_add("gre.proto", GRE_ARUBA_8330, ieee80211_handle);
12008 dissector_add("gre.proto", GRE_ARUBA_8340, ieee80211_handle);
12009 dissector_add("gre.proto", GRE_ARUBA_8350, ieee80211_handle);
12010 dissector_add("gre.proto", GRE_ARUBA_8360, ieee80211_handle);
12011 dissector_add("gre.proto", GRE_ARUBA_8370, ieee80211_handle);
12014 #ifdef HAVE_AIRPDCAP
12015 /* Davide Schiera (2006-11-26): this function will try to decrypt with WEP or */
12016 /* WPA and return a tvb to the caller to add a new tab. It returns the */
12017 /* algorithm used for decryption (WEP, TKIP, CCMP) and the header and */
12018 /* trailer lengths. */
12020 try_decrypt(tvbuff_t *tvb, guint offset, guint len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer) {
12021 const guint8 *enc_data;
12022 guint8 *tmp = NULL;
12023 tvbuff_t *decr_tvb = NULL;
12024 guint32 dec_caplen;
12025 guchar dec_data[AIRPDCAP_MAX_CAPLEN];
12026 AIRPDCAP_KEY_ITEM used_key;
12028 if (!enable_decryption)
12031 /* get the entire packet */
12032 enc_data = tvb_get_ptr(tvb, 0, len+offset);
12034 /* process packet with AirPDcap */
12035 if (AirPDcapPacketProcess(&airpdcap_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen, &used_key, FALSE, TRUE)==AIRPDCAP_RET_SUCCESS)
12037 *algorithm=used_key.KeyType;
12038 switch (*algorithm) {
12039 case AIRPDCAP_KEY_TYPE_WEP:
12040 *sec_header=AIRPDCAP_WEP_HEADER;
12041 *sec_trailer=AIRPDCAP_WEP_TRAILER;
12043 case AIRPDCAP_KEY_TYPE_CCMP:
12044 *sec_header=AIRPDCAP_RSNA_HEADER;
12045 *sec_trailer=AIRPDCAP_CCMP_TRAILER;
12047 case AIRPDCAP_KEY_TYPE_TKIP:
12048 *sec_header=AIRPDCAP_RSNA_HEADER;
12049 *sec_trailer=AIRPDCAP_TKIP_TRAILER;
12055 /* allocate buffer for decrypted payload */
12056 if ((tmp = g_malloc(dec_caplen-offset)) == NULL)
12057 return NULL; /* krap! */
12058 memcpy(tmp, dec_data+offset, dec_caplen-offset);
12060 len=dec_caplen-offset;
12062 /* decrypt successful, let's set up a new data tvb. */
12063 decr_tvb = tvb_new_real_data(tmp, len, len);
12064 tvb_set_free_cb(decr_tvb, g_free);
12065 tvb_set_child_real_data_tvbuff(tvb, decr_tvb);
12071 /* Davide Schiera ----------------------------------------------------------- */
12074 static tvbuff_t *try_decrypt_wep(tvbuff_t *tvb, guint32 offset, guint32 len) {
12075 const guint8 *enc_data;
12076 guint8 *tmp = NULL;
12078 tvbuff_t *decr_tvb = NULL;
12080 if (! enable_decryption)
12083 enc_data = tvb_get_ptr(tvb, offset, len);
12085 if ((tmp = g_malloc(len)) == NULL)
12086 return NULL; /* krap! */
12088 /* try once with the key index in the packet, then look through our list. */
12089 for (i = 0; i < num_wepkeys; i++) {
12090 /* copy the encrypted data over to the tmp buffer */
12092 printf("trying %d\n", i);
12094 memcpy(tmp, enc_data, len);
12095 if (wep_decrypt(tmp, len, i) == 0) {
12097 /* decrypt successful, let's set up a new data tvb. */
12098 decr_tvb = tvb_new_real_data(tmp, len-8, len-8);
12099 tvb_set_free_cb(decr_tvb, g_free);
12100 tvb_set_child_real_data_tvbuff(tvb, decr_tvb);
12106 if ((!decr_tvb) && (tmp)) g_free(tmp);
12109 printf("de-wep %p\n", decr_tvb);
12117 * Convert a raw WEP key or one prefixed with "wep:" to a byte array.
12118 * Separators are allowed.
12120 /* XXX This is duplicated in epan/airpdcap.c:parse_key_string() */
12122 wep_str_to_bytes(const char *hex_str, GByteArray *bytes) {
12123 char *first_nibble = (char *) hex_str;
12125 if (g_ascii_strncasecmp(hex_str, STRING_KEY_TYPE_WEP ":", 4) == 0) {
12129 return hex_str_to_bytes(first_nibble, bytes, FALSE);
12132 /* Collect our WEP and WPA keys */
12133 #ifdef HAVE_AIRPDCAP
12135 void set_airpdcap_keys(void)
12138 AIRPDCAP_KEY_ITEM key;
12139 PAIRPDCAP_KEYS_COLLECTION keys;
12140 decryption_key_t* dk = NULL;
12141 GByteArray *bytes = NULL;
12143 gchar* tmpk = NULL;
12145 keys=(PAIRPDCAP_KEYS_COLLECTION)g_malloc(sizeof(AIRPDCAP_KEYS_COLLECTION));
12148 for(i = 0; i < MAX_ENCRYPTION_KEYS; i++)
12150 tmpk = g_strdup(wep_keystr[i]);
12152 dk = parse_key_string(tmpk);
12156 if(dk->type == AIRPDCAP_KEY_TYPE_WEP)
12158 key.KeyType = AIRPDCAP_KEY_TYPE_WEP;
12160 bytes = g_byte_array_new();
12161 res = wep_str_to_bytes(dk->key->str, bytes);
12163 if (dk->key->str && res && bytes->len > 0 && bytes->len <= AIRPDCAP_WEP_KEY_MAXLEN)
12166 * WEP key is correct (well, the can be even or odd, so it is not
12167 * a real check, I think... is a check performed somewhere in the
12168 * AirPDcap function??? )
12170 memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
12171 key.KeyData.Wep.WepKeyLen = bytes->len;
12172 keys->Keys[keys->nKeys] = key;
12176 else if(dk->type == AIRPDCAP_KEY_TYPE_WPA_PWD)
12178 key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PWD;
12180 /* XXX - This just lops the end if the key off if it's too long.
12181 * Should we handle this more gracefully? */
12182 g_strlcpy(key.UserPwd.Passphrase, dk->key->str, AIRPDCAP_WPA_PASSPHRASE_MAX_LEN);
12184 key.UserPwd.SsidLen = 0;
12185 if(dk->ssid != NULL && dk->ssid->len <= AIRPDCAP_WPA_SSID_MAX_LEN)
12187 memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
12188 key.UserPwd.SsidLen = dk->ssid->len;
12191 keys->Keys[keys->nKeys] = key;
12194 else if(dk->type == AIRPDCAP_KEY_TYPE_WPA_PMK)
12196 key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PMK;
12198 bytes = g_byte_array_new();
12199 res = wep_str_to_bytes(dk->key->str, bytes);
12201 /* XXX - Pass the correct array of bytes... */
12202 if (bytes-> len <= AIRPDCAP_WPA_PMK_LEN) {
12203 memcpy(key.KeyData.Wpa.Pmk, bytes->data, bytes->len);
12205 keys->Keys[keys->nKeys] = key;
12210 if(tmpk != NULL) g_free(tmpk);
12213 /* Now set the keys */
12214 AirPDcapSetKeys(&airpdcap_ctx,keys->Keys,keys->nKeys);
12217 g_byte_array_free(bytes, TRUE);
12222 #ifndef HAVE_AIRPDCAP
12223 /* de-weps the block. if successful, buf* will point to the data start. */
12224 static int wep_decrypt(guint8 *buf, guint32 len, int keyidx) {
12225 guint32 i, j, k, crc, keylen;
12226 guint8 s[256], key[128], c_crc[4];
12227 guint8 *dpos, *cpos;
12229 /* Needs to be at least 8 bytes of payload */
12233 /* initialize the first bytes of the key from the IV */
12238 if (keyidx < 0 || keyidx >= num_wepkeys)
12241 keylen = wep_keylens[keyidx];
12245 if (wep_keys[keyidx] == NULL)
12248 keylen+=3; /* add in ICV bytes */
12250 /* copy the rest of the key over from the designated key */
12251 memcpy(key+3, wep_keys[keyidx], wep_keylens[keyidx]);
12254 printf("%d: %02x %02x %02x (%d %d) %02x:%02x:%02x:%02x:%02x\n", len, key[0], key[1], key[2], keyidx, keylen, key[3], key[4], key[5], key[6], key[7]);
12257 /* set up the RC4 state */
12258 for (i = 0; i < 256; i++)
12261 for (i = 0; i < 256; i++) {
12262 j = (j + s[i] + key[i % keylen]) & 0xff;
12266 /* Apply the RC4 to the data, update the CRC32 */
12271 for (k = 0; k < (len -8); k++) {
12273 j = (j+s[i]) & 0xff;
12276 printf("%d -- %02x ", k, *dpos);
12278 *dpos = *cpos++ ^ s[(s[i] + s[j]) & 0xff];
12280 printf("%02x\n", *dpos);
12282 crc = crc32_ccitt_table[(crc ^ *dpos++) & 0xff] ^ (crc >> 8);
12286 /* now let's check the crc */
12288 c_crc[1] = crc >> 8;
12289 c_crc[2] = crc >> 16;
12290 c_crc[3] = crc >> 24;
12292 for (k = 0; k < 4; k++) {
12293 i = (i + 1) & 0xff;
12294 j = (j+s[i]) & 0xff;
12297 printf("-- %02x %02x\n", *dpos, c_crc[k]);
12299 if ((*cpos++ ^ s[(s[i] + s[j]) & 0xff]) != c_crc[k])
12300 return -1; /* ICV mismatch */
12307 static void init_wepkeys(void) {
12308 #ifndef HAVE_AIRPDCAP
12315 for (i = 0; i < num_wepkeys; i++)
12316 g_free(wep_keys[i]);
12321 g_free(wep_keylens);
12326 tmp = getenv("WIRESHARK_WEPKEYNUM");
12331 num_wepkeys = atoi(tmp);
12333 if (num_wepkeys < 1)
12337 /* Figure out how many valid keys we have */
12338 bytes = g_byte_array_new();
12340 for ( i = 0; i < MAX_ENCRYPTION_KEYS; i++) {
12341 g_strstrip(wep_keystr[i]);
12342 res = wep_str_to_bytes(wep_keystr[i], bytes);
12343 if (wep_keystr[i] && res && bytes-> len > 0) {
12348 wep_keys = g_malloc0(num_wepkeys * sizeof(guint8*));
12349 wep_keylens = g_malloc(num_wepkeys * sizeof(int));
12351 for (i = 0, keyidx = 0; i < MAX_ENCRYPTION_KEYS && keyidx < num_wepkeys; i++) {
12352 wep_keys[keyidx] = NULL;
12353 wep_keylens[keyidx] = 0;
12357 g_snprintf(buf, 128, "WIRESHARK_WEPKEY%d", i+1);
12360 tmp = wep_keystr[i];
12366 printf("%s -- %s\n", buf, tmp);
12368 printf("%d -- %s\n", i+1, tmp);
12372 if (wep_keys[keyidx]) {
12373 g_free(wep_keys[keyidx]);
12376 res = wep_str_to_bytes(tmp, bytes);
12377 if (tmp && res && bytes->len > 0) {
12378 if (bytes->len > 32) {
12381 wep_keys[keyidx] = g_malloc0(32 * sizeof(guint8));
12382 memcpy(wep_keys[keyidx], bytes->data, bytes->len * sizeof(guint8));
12383 wep_keylens[keyidx] = bytes->len;
12386 printf("%d: %d bytes\n", i, bytes->len);
12387 printf("%d: %s\n", i, bytes_to_str(bytes->data, bytes->len));
12391 printf("res: %d bytes->len: %d\n", res, bytes->len);
12393 if (tmp[0] != 'w') /* Assume it begins with "wep:" or "wpa-*:" */
12394 g_warning("Could not parse WEP key %d: %s", i + 1, tmp);
12398 g_byte_array_free(bytes, TRUE);
12400 #else /* HAVE_AIRPDCAP defined */
12403 * XXX - AirPDcap - That God sends it to us beautiful (che dio ce la mandi bona)
12404 * The next lines will add a key to the AirPDcap context. The keystring will be added
12405 * to the old WEP array too, but we don't care, because the packets will come here
12406 * already decrypted... One of these days we will fix this too
12408 set_airpdcap_keys();
12409 #endif /* HAVE_AIRPDCAP */
12412 * This code had been taken from AirSnort crack.c function classify()
12413 * Permission granted by snax <at> shmoo dot com
12414 * weak_iv - determine which key byte an iv is useful in resolving
12415 * parm - p, pointer to the first byte of an IV
12416 * return - n - this IV is weak for byte n of a WEP key
12417 * -1 - this IV is not weak for any key bytes
12419 * This function tests for IVs that are known to satisfy the criteria
12420 * for a weak IV as specified in FMS section 7.1
12424 weak_iv(guchar *iv)
12428 if (iv[1] == 255 && iv[0] > 2 && iv[0] < 16) {
12432 sum = iv[0] + iv[1];
12434 if (iv[2] <= 0x0a) {
12437 else if (iv[2] == 0xff){
12442 if (sum == k && (iv[2] >= 0xf2 && iv[2] <= 0xfe && iv[2] != 0xfd)){
12452 * c-basic-offset: 2
12454 * indent-tabs-mode: nil
12457 * ex: set shiftwidth=2 tabstop=8 expandtab
12458 * :indentSize=2:tabSize=8:noTabs=true: