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>
77 #include <epan/crc32.h>
79 #include <epan/emem.h>
80 #include <epan/crypt/wep-wpadefs.h>
85 #include "packet-wps.h"
88 #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */
91 /* Defragment fragmented 802.11 datagrams */
92 static gboolean wlan_defragment = TRUE;
94 /* call subdissector for retransmitted frames */
95 static gboolean wlan_subdissector = TRUE;
97 /* Check for the presence of the 802.11 FCS */
98 static gboolean wlan_check_fcs = FALSE;
100 /* Ignore vendor-specific HT elements */
101 static gboolean wlan_ignore_draft_ht = FALSE;
103 /* Ignore the WEP bit; assume packet is decrypted */
104 #define WLAN_IGNORE_WEP_NO 0
105 #define WLAN_IGNORE_WEP_WO_IV 1
106 #define WLAN_IGNORE_WEP_W_IV 2
107 static gint wlan_ignore_wep = WLAN_IGNORE_WEP_NO;
109 /* Tables for reassembly of fragments. */
110 static GHashTable *wlan_fragment_table = NULL;
111 static GHashTable *wlan_reassembled_table = NULL;
113 /* Statistical data */
114 static struct _wlan_stats wlan_stats;
116 /* Stuff for the WEP decoder */
117 static gboolean enable_decryption = FALSE;
118 static void init_wepkeys(void);
120 #ifndef HAVE_AIRPDCAP
121 static gint num_wepkeys = 0;
122 static guint8 **wep_keys = NULL;
123 static int *wep_keylens = NULL;
124 static tvbuff_t *try_decrypt_wep(tvbuff_t *tvb, guint32 offset, guint32 len);
125 static int wep_decrypt(guint8 *buf, guint32 len, int key_override);
127 /* Davide Schiera (2006-11-26): created function to decrypt WEP and WPA/WPA2 */
128 static tvbuff_t *try_decrypt(tvbuff_t *tvb, guint32 offset, guint32 len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer);
131 static int weak_iv(guchar *iv);
132 #define SSWAP(a,b) {guint8 tmp = s[a]; s[a] = s[b]; s[b] = tmp;}
134 /* #define USE_ENV */
135 /* When this is set, an unlimited number of WEP keys can be set in the
138 WIRESHARK_WEPKEYNUM=##
139 WIRESHARK_WEPKEY1=aa:bb:cc:dd:...
140 WIRESHARK_WEPKEY2=aa:bab:cc:dd:ee:...
142 ... you get the idea.
144 otherwise you're limited to specifying four keys in the preference system.
148 static char *wep_keystr[MAX_ENCRYPTION_KEYS];
151 typedef struct mimo_control
157 guint8 coefficient_size;
158 guint8 codebook_info;
159 guint8 remaining_matrix_segment;
162 mimo_control_t get_mimo_control (tvbuff_t *tvb, int offset);
163 int add_mimo_csi_matrices_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl);
164 int add_mimo_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl);
165 int add_mimo_compressed_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl);
167 /* ************************************************************************* */
168 /* Miscellaneous Constants */
169 /* ************************************************************************* */
170 #define SHORT_STR 256
172 /* ************************************************************************* */
173 /* Define some very useful macros that are used to analyze frame types etc. */
174 /* ************************************************************************* */
177 * Fetch the frame control field and swap it if needed. "fcf" and "tvb"
178 * must be valid variables.
180 #define FETCH_FCF(off) (wlan_broken_fc ? \
181 BSWAP16(tvb_get_letohs(tvb, off)) : \
182 tvb_get_letohs(tvb, off))
185 * Extract the protocol version from the frame control field
187 #define FCF_PROT_VERSION(x) ((x) & 0x3)
190 * Extract the frame type from the frame control field.
192 #define FCF_FRAME_TYPE(x) (((x) & 0xC) >> 2)
195 * Extract the frame subtype from the frame control field.
197 #define FCF_FRAME_SUBTYPE(x) (((x) & 0xF0) >> 4)
200 * Convert the frame type and subtype from the frame control field into
201 * one of the MGT_, CTRL_, or DATA_ values.
203 #define COMPOSE_FRAME_TYPE(x) (((x & 0x0C)<< 2)+FCF_FRAME_SUBTYPE(x)) /* Create key to (sub)type */
206 * The subtype field of a data frame is, in effect, composed of 4 flag
207 * bits - CF-Ack, CF-Poll, Null (means the frame doesn't actually have
208 * any data), and QoS.
210 #define DATA_FRAME_IS_CF_ACK(x) ((x) & 0x01)
211 #define DATA_FRAME_IS_CF_POLL(x) ((x) & 0x02)
212 #define DATA_FRAME_IS_NULL(x) ((x) & 0x04)
213 #define DATA_FRAME_IS_QOS(x) ((x) & 0x08)
216 * Extract the flags from the frame control field.
218 #define FCF_FLAGS(x) (((x) & 0xFF00) >> 8)
221 * Bits from the flags field.
223 #define FLAG_TO_DS 0x01
224 #define FLAG_FROM_DS 0x02
225 #define FLAG_MORE_FRAGMENTS 0x04
226 #define FLAG_RETRY 0x08
227 #define FLAG_POWER_MGT 0x10
228 #define FLAG_MORE_DATA 0x20
229 #define FLAG_PROTECTED 0x40
230 #define FLAG_ORDER 0x80
233 * Test bits in the flags field.
236 * XXX - Only HAVE_FRAGMENTS, IS_PROTECTED, and IS_STRICTLY_ORDERED
237 * are in use. Should the rest be removed?
239 #define IS_TO_DS(x) ((x) & FLAG_TO_DS)
240 #define IS_FROM_DS(x) ((x) & FLAG_FROM_DS)
241 #define HAVE_FRAGMENTS(x) ((x) & FLAG_MORE_FRAGMENTS)
242 #define IS_RETRY(x) ((x) & FLAG_RETRY)
243 #define POWER_MGT_STATUS(x) ((x) & FLAG_POWER_MGT)
244 #define HAS_MORE_DATA(x) ((x) & FLAG_MORE_DATA)
245 #define IS_PROTECTED(x) ((x) & FLAG_PROTECTED)
246 #define IS_STRICTLY_ORDERED(x) ((x) & FLAG_ORDER)
249 * Extract subfields from the flags field.
251 #define FLAGS_DS_STATUS(x) ((x) & (FLAG_FROM_DS|FLAG_TO_DS))
254 * Extract an indication of the types of addresses in a data frame from
255 * the frame control field.
257 #define FCF_ADDR_SELECTOR(x) ((x) & ((FLAG_TO_DS|FLAG_FROM_DS) << 8))
259 #define DATA_ADDR_T1 0
260 #define DATA_ADDR_T2 (FLAG_FROM_DS << 8)
261 #define DATA_ADDR_T3 (FLAG_TO_DS << 8)
262 #define DATA_ADDR_T4 ((FLAG_TO_DS|FLAG_FROM_DS) << 8)
265 * Extract the fragment number and sequence number from the sequence
268 #define SEQCTL_FRAGMENT_NUMBER(x) ((x) & 0x000F)
269 #define SEQCTL_SEQUENCE_NUMBER(x) (((x) & 0xFFF0) >> 4)
272 * Extract subfields from the QoS control field.
274 #define QOS_TID(x) ((x) & 0x000F)
275 #define QOS_PRIORITY(x) ((x) & 0x0007)
276 #define QOS_EOSP(x) (((x) & 0x0010) >> 4) /* end of service period */
277 #define QOS_ACK_POLICY(x) (((x) & 0x0060) >> 5)
278 #define QOS_AMSDU_PRESENT(x) (((x) & 0x0080) >> 6)
279 #define QOS_FIELD_CONTENT(x) (((x) & 0xFF00) >> 8)
281 #define QOS_FLAG_EOSP 0x10
284 * Extract subfields from the result of QOS_FIELD_CONTENT().
286 #define QOS_PS_BUF_STATE(x) (((x) & 0x02) >> 1)
287 #define QOS_PS_BUF_AC(x) (((x) & 0x0C) >> 2)
288 #define QOS_PS_BUF_LOAD(x) (((x) & 0xF0) >> 4)
291 * Extract subfields from the HT Control field.
292 * .11n D-1.10 & D-2.0, 7.1.3.5a, 32 bits.
294 #define HTC_LAC(htc) ((htc) & 0xFF)
295 #define HTC_LAC_MAI(htc) (((htc) >> 2) & 0xF)
296 #define HTC_IS_ASELI(htc) (HTC_LAC_MAI(htc) == 0xE)
297 #define HTC_LAC_MAI_MRQ(htc) ((HTC_LAC_MAI(htc)) & 0x1)
298 #define HTC_LAC_MAI_MSI(htc) ((HTC_LAC_MAI(htc) >> 1) & 0x7)
299 #define HTC_LAC_MFSI(htc) (((htc) >> 4) & 0x7)
300 #define HTC_LAC_ASEL_CMD(htc) (((htc) >> 9) & 0x7)
301 #define HTC_LAC_ASEL_DATA(htc) (((htc) >> 12) & 0xF)
302 #define HTC_LAC_MFB(htc) (((htc) >> 9) & 0x7F)
303 #define HTC_CAL_POS(htc) (((htc) >> 16) & 0x3)
304 #define HTC_CAL_SEQ(htc) (((htc) >> 18) & 0x3)
305 #define HTC_CSI_STEERING(htc) (((htc) >> 22) & 0x3)
306 #define HTC_NDP_ANN(htc) (((htc) >> 24) & 0x1)
307 #define HTC_AC_CONSTRAINT(htc) (((htc) >> 30) & 0x1)
308 #define HTC_RDG_MORE_PPDU(htc) (((htc) >> 31) & 0x1)
311 * Extract the association ID from the value in an association ID field.
313 #define ASSOC_ID(x) ((x) & 0x3FFF)
316 * Extract subfields from the key octet in WEP-encrypted frames.
318 #define KEY_OCTET_WEP_KEY(x) (((x) & 0xC0) >> 6)
321 * Extract subfields from TS Info field.
323 #define TSI_TYPE(x) (((x) & 0x000001) >> 0)
324 #define TSI_TSID(x) (((x) & 0x00001E) >> 1)
325 #define TSI_DIR(x) (((x) & 0x000060) >> 5)
326 #define TSI_ACCESS(x) (((x) & 0x000180) >> 7)
327 #define TSI_AGG(x) (((x) & 0x000200) >> 9)
328 #define TSI_APSD(x) (((x) & 0x000400) >> 10)
329 #define TSI_UP(x) (((x) & 0x003800) >> 11)
330 #define TSI_ACK(x) (((x) & 0x00C000) >> 14)
331 #define TSI_SCHED(x) (((x) & 0x010000) >> 16)
332 #define TSI_RESERVED(x) (((x) & 0xFE0000) >> 17)
334 #define KEY_EXTIV 0x20
338 /* ************************************************************************* */
339 /* Constants used to identify cooked frame types */
340 /* ************************************************************************* */
341 #define MGT_FRAME 0x00 /* Frame type is management */
342 #define CONTROL_FRAME 0x01 /* Frame type is control */
343 #define DATA_FRAME 0x02 /* Frame type is Data */
345 #define DATA_SHORT_HDR_LEN 24
346 #define DATA_LONG_HDR_LEN 30
347 #define MGT_FRAME_HDR_LEN 24 /* Length of Managment frame-headers */
350 * COMPOSE_FRAME_TYPE() values for management frames.
352 #define MGT_ASSOC_REQ 0x00 /* association request */
353 #define MGT_ASSOC_RESP 0x01 /* association response */
354 #define MGT_REASSOC_REQ 0x02 /* reassociation request */
355 #define MGT_REASSOC_RESP 0x03 /* reassociation response */
356 #define MGT_PROBE_REQ 0x04 /* Probe request */
357 #define MGT_PROBE_RESP 0x05 /* Probe response */
358 #define MGT_MEASUREMENT_PILOT 0x06 /* Measurement Pilot */
359 #define MGT_BEACON 0x08 /* Beacon frame */
360 #define MGT_ATIM 0x09 /* ATIM */
361 #define MGT_DISASS 0x0A /* Disassociation */
362 #define MGT_AUTHENTICATION 0x0B /* Authentication */
363 #define MGT_DEAUTHENTICATION 0x0C /* Deauthentication */
364 #define MGT_ACTION 0x0D /* Action */
365 #define MGT_ACTION_NO_ACK 0x0E /* Action No Ack */
366 #define MGT_ARUBA_WLAN 0x0F /* Aruba WLAN Specific */
369 * COMPOSE_FRAME_TYPE() values for control frames.
371 #define CTRL_CONTROL_WRAPPER 0x17 /* Control Wrapper */
372 #define CTRL_BLOCK_ACK_REQ 0x18 /* Block ack Request */
373 #define CTRL_BLOCK_ACK 0x19 /* Block ack */
374 #define CTRL_PS_POLL 0x1A /* power-save poll */
375 #define CTRL_RTS 0x1B /* request to send */
376 #define CTRL_CTS 0x1C /* clear to send */
377 #define CTRL_ACKNOWLEDGEMENT 0x1D /* acknowledgement */
378 #define CTRL_CFP_END 0x1E /* contention-free period end */
379 #define CTRL_CFP_ENDACK 0x1F /* contention-free period end/ack */
382 * COMPOSE_FRAME_TYPE() values for data frames.
384 #define DATA 0x20 /* Data */
385 #define DATA_CF_ACK 0x21 /* Data + CF-Ack */
386 #define DATA_CF_POLL 0x22 /* Data + CF-Poll */
387 #define DATA_CF_ACK_POLL 0x23 /* Data + CF-Ack + CF-Poll */
388 #define DATA_NULL_FUNCTION 0x24 /* Null function (no data) */
389 #define DATA_CF_ACK_NOD 0x25 /* CF-Ack (no data) */
390 #define DATA_CF_POLL_NOD 0x26 /* CF-Poll (No data) */
391 #define DATA_CF_ACK_POLL_NOD 0x27 /* CF-Ack + CF-Poll (no data) */
393 #define DATA_QOS_DATA 0x28 /* QoS Data */
394 #define DATA_QOS_DATA_CF_ACK 0x29 /* QoS Data + CF-Ack */
395 #define DATA_QOS_DATA_CF_POLL 0x2A /* QoS Data + CF-Poll */
396 #define DATA_QOS_DATA_CF_ACK_POLL 0x2B /* QoS Data + CF-Ack + CF-Poll */
397 #define DATA_QOS_NULL 0x2C /* QoS Null */
398 #define DATA_QOS_CF_POLL_NOD 0x2E /* QoS CF-Poll (No Data) */
399 #define DATA_QOS_CF_ACK_POLL_NOD 0x2F /* QoS CF-Ack + CF-Poll (No Data) */
402 /* ************************************************************************* */
403 /* Macros used to extract information about fixed fields */
404 /* ************************************************************************* */
405 #define ESS_SET(x) ((x) & 0x0001)
406 #define IBSS_SET(x) ((x) & 0x0002)
410 /* ************************************************************************* */
411 /* Logical field codes (dissector's encoding of fixed fields) */
412 /* ************************************************************************* */
413 #define FIELD_TIMESTAMP 0x01 /* 64-bit timestamp */
414 #define FIELD_BEACON_INTERVAL 0x02 /* 16-bit beacon interval */
415 #define FIELD_CAP_INFO 0x03 /* Add capability information tree */
416 #define FIELD_AUTH_ALG 0x04 /* Authentication algorithm used */
417 #define FIELD_AUTH_TRANS_SEQ 0x05 /* Authentication sequence number */
418 #define FIELD_CURRENT_AP_ADDR 0x06
419 #define FIELD_LISTEN_IVAL 0x07
420 #define FIELD_REASON_CODE 0x08
421 #define FIELD_ASSOC_ID 0x09
422 #define FIELD_STATUS_CODE 0x0A
423 #define FIELD_CATEGORY_CODE 0x0B /* Management action category */
424 #define FIELD_ACTION_CODE 0x0C /* Management action code */
425 #define FIELD_DIALOG_TOKEN 0x0D /* Management action dialog token */
426 #define FIELD_WME_ACTION_CODE 0x0E /* Management notification action code */
427 #define FIELD_WME_DIALOG_TOKEN 0x0F /* Management notification dialog token */
428 #define FIELD_WME_STATUS_CODE 0x10 /* Management notification setup response status code */
429 #define FIELD_QOS_ACTION_CODE 0x11
430 #define FIELD_QOS_TS_INFO 0x12
431 #define FIELD_DLS_ACTION_CODE 0x13
432 #define FIELD_DST_MAC_ADDR 0X14 /* DLS destination MAC address */
433 #define FIELD_SRC_MAC_ADDR 0X15 /* DLS source MAC address */
434 #define FIELD_DLS_TIMEOUT 0X16 /* DLS timeout value */
435 #define FIELD_SCHEDULE_INFO 0X17 /* Schedule Info field */
436 #define FIELD_ACTION 0X18 /* Action field */
437 #define FIELD_BLOCK_ACK_ACTION_CODE 0x19
438 #define FIELD_QOS_INFO_AP 0x1A
439 #define FIELD_QOS_INFO_STA 0x1B
440 #define FIELD_BLOCK_ACK_PARAM 0x1C
441 #define FIELD_BLOCK_ACK_TIMEOUT 0x1D
442 #define FIELD_BLOCK_ACK_SSC 0x1E
443 #define FIELD_DELBA_PARAM_SET 0x1F
444 #define FIELD_MAX_REG_PWR 0x20
445 #define FIELD_MEASUREMENT_PILOT_INT 0x21
446 #define FIELD_COUNTRY_STR 0x22
447 #define FIELD_MAX_TX_PWR 0x23
448 #define FIELD_TX_PWR_USED 0x24
449 #define FIELD_TRANSCEIVER_NOISE_FLOOR 0x25
450 #define FIELD_DS_PARAM_SET 0x26
451 #define FIELD_CHANNEL_WIDTH 0x27
452 #define FIELD_SM_PWR_CNTRL 0x28
453 #define FIELD_PCO_PHASE_CNTRL 0x29
454 #define FIELD_PSMP_PARAM_SET 0x2A
455 #define FIELD_PSMP_STA_INFO 0x2B
456 #define FIELD_MIMO_CNTRL 0x2C
457 #define FIELD_ANT_SELECTION 0x2D
458 #define FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT 0x2E
459 #define FIELD_HT_INFORMATION 0x2F
460 #define FIELD_HT_ACTION_CODE 0x30
462 /* ************************************************************************* */
463 /* Logical field codes (IEEE 802.11 encoding of tags) */
464 /* ************************************************************************* */
465 #define TAG_SSID 0x00
466 #define TAG_SUPP_RATES 0x01
467 #define TAG_FH_PARAMETER 0x02
468 #define TAG_DS_PARAMETER 0x03
469 #define TAG_CF_PARAMETER 0x04
471 #define TAG_IBSS_PARAMETER 0x06
472 #define TAG_COUNTRY_INFO 0x07
473 #define TAG_FH_HOPPING_PARAMETER 0x08
474 #define TAG_FH_HOPPING_TABLE 0x09
475 #define TAG_REQUEST 0x0A
476 #define TAG_QBSS_LOAD 0x0B
477 #define TAG_EDCA_PARAM_SET 0x0C
478 #define TAG_TSPEC 0x0D
479 #define TAG_TCLAS 0x0E
480 #define TAG_SCHEDULE 0x0F
481 #define TAG_CHALLENGE_TEXT 0x10
482 #define TAG_POWER_CONSTRAINT 0x20
483 #define TAG_POWER_CAPABILITY 0x21
484 #define TAG_TPC_REQUEST 0x22
485 #define TAG_TPC_REPORT 0x23
486 #define TAG_SUPPORTED_CHANNELS 0x24
487 #define TAG_CHANNEL_SWITCH_ANN 0x25
488 #define TAG_MEASURE_REQ 0x26
489 #define TAG_MEASURE_REP 0x27
490 #define TAG_QUIET 0x28
491 #define TAG_IBSS_DFS 0x29
492 #define TAG_ERP_INFO 0x2A
493 #define TAG_TS_DELAY 0x2B
494 #define TAG_TCLAS_PROCESS 0x2C
495 #define TAG_HT_CAPABILITY 0x2D /* IEEE Stc 802.11n/D2.0 */
496 #define TAG_QOS_CAPABILITY 0x2E
497 #define TAG_ERP_INFO_OLD 0x2F /* IEEE Std 802.11g/D4.0 */
498 #define TAG_RSN_IE 0x30
500 #define TAG_EXT_SUPP_RATES 0x32
501 #define TAG_NEIGHBOR_REPORT 0x34
502 #define TAG_HT_INFO 0x3D /* IEEE Stc 802.11n/D2.0 */
503 #define TAG_SECONDARY_CHANNEL_OFFSET 0x3E /* IEEE Stc 802.11n/D1.10/D2.0 */
504 #define TAG_WSIE 0x45 /* tag of the Wave Service Information (802.11p) */
505 #define TAG_20_40_BSS_CO_EX 0x48 /* IEEE P802.11n/D6.0 */
506 #define TAG_20_40_BSS_INTOL_CH_REP 0x49 /* IEEE P802.11n/D6.0 */
507 #define TAG_OVERLAP_BSS_SCAN_PAR 0x49 /* IEEE P802.11n/D6.0 */
508 #define TAG_EXTENDED_CAPABILITIES 0X7F /* IEEE Stc 802.11n/D1.10/D2.0 */
509 #define TAG_AGERE_PROPRIETARY 0x80
510 #define TAG_CISCO_UNKNOWN_1 0x85 /* Cisco Compatible eXtensions */
511 #define TAG_CISCO_UNKNOWN_2 0x88 /* Cisco Compatible eXtensions? */
512 #define TAG_CISCO_UNKNOWN_3 0x95 /* Cisco Compatible eXtensions */
513 #define TAG_VENDOR_SPECIFIC_IE 0xDD
514 #define TAG_SYMBOL_PROPRIETARY 0xAD
515 #if 0 /* Not yet assigned tag numbers by ANA */
516 #define TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT 0xFF
517 #define TAG_SUPPORTED_REGULATORY_CLASSES 0xFE
520 #define WPA_OUI (const guint8 *) "\x00\x50\xF2"
521 #define RSN_OUI (const guint8 *) "\x00\x0F\xAC"
522 #define WME_OUI (const guint8 *) "\x00\x50\xF2"
523 #define PRE_11N_OUI (const guint8 *) "\x00\x90\x4c" /* 802.11n pre 1 oui */
527 /* ************************************************************************* */
528 /* Wireless Access in Vehicular Environment IEEE 802.11p */
529 /* ************************************************************************* */
530 #define WAVE_ACID 0x0001
531 #define WAVE_ACM 0x0002
532 #define WAVE_ACF 0x0004
533 #define WAVE_PRIORITY 0x0008
534 #define WAVE_CHANNEL 0x0010
535 #define WAVE_IPV6ADDR 0x0020
536 #define WAVE_PEERMAC 0x0040
538 /* ************************************************************************* */
539 /* Aruba GRE Encapulsation ID */
540 /* ************************************************************************* */
541 #define GRE_ARUBA_8200 0x8200
542 #define GRE_ARUBA_8210 0x8210
543 #define GRE_ARUBA_8220 0x8220
544 #define GRE_ARUBA_8230 0x8230
545 #define GRE_ARUBA_8240 0x8240
546 #define GRE_ARUBA_8250 0x8250
547 #define GRE_ARUBA_8260 0x8260
548 #define GRE_ARUBA_8270 0x8270
549 #define GRE_ARUBA_8280 0x8280
550 #define GRE_ARUBA_8290 0x8290
551 #define GRE_ARUBA_82A0 0x82A0
552 #define GRE_ARUBA_82B0 0x82B0
553 #define GRE_ARUBA_82C0 0x82C0
554 #define GRE_ARUBA_82D0 0x82D0
555 #define GRE_ARUBA_82E0 0x82E0
556 #define GRE_ARUBA_82F0 0x82F0
557 #define GRE_ARUBA_8300 0x8300
558 #define GRE_ARUBA_8310 0x8310
559 #define GRE_ARUBA_8320 0x8320
560 #define GRE_ARUBA_8330 0x8330
561 #define GRE_ARUBA_8340 0x8340
562 #define GRE_ARUBA_8350 0x8350
563 #define GRE_ARUBA_8360 0x8360
564 #define GRE_ARUBA_8370 0x8370
567 /* ************************************************************************* */
568 /* Frame types, and their names */
569 /* ************************************************************************* */
570 static const value_string frame_type_subtype_vals[] = {
571 {MGT_ASSOC_REQ, "Association Request"},
572 {MGT_ASSOC_RESP, "Association Response"},
573 {MGT_REASSOC_REQ, "Reassociation Request"},
574 {MGT_REASSOC_RESP, "Reassociation Response"},
575 {MGT_PROBE_REQ, "Probe Request"},
576 {MGT_PROBE_RESP, "Probe Response"},
577 {MGT_MEASUREMENT_PILOT,"Measurement Pilot"},
578 {MGT_BEACON, "Beacon frame"},
580 {MGT_DISASS, "Disassociate"},
581 {MGT_AUTHENTICATION, "Authentication"},
582 {MGT_DEAUTHENTICATION, "Deauthentication"},
583 {MGT_ACTION, "Action"},
584 {MGT_ACTION_NO_ACK, "Action No Ack"},
585 {MGT_ARUBA_WLAN, "Aruba Management"},
587 {CTRL_CONTROL_WRAPPER, "Control Wrapper"},
588 {CTRL_BLOCK_ACK_REQ, "802.11 Block Ack Req"},
589 {CTRL_BLOCK_ACK, "802.11 Block Ack"},
590 {CTRL_PS_POLL, "Power-Save poll"},
591 {CTRL_RTS, "Request-to-send"},
592 {CTRL_CTS, "Clear-to-send"},
593 {CTRL_ACKNOWLEDGEMENT, "Acknowledgement"},
594 {CTRL_CFP_END, "CF-End (Control-frame)"},
595 {CTRL_CFP_ENDACK, "CF-End + CF-Ack (Control-frame)"},
598 {DATA_CF_ACK, "Data + CF-Ack"},
599 {DATA_CF_POLL, "Data + CF-Poll"},
600 {DATA_CF_ACK_POLL, "Data + CF-Ack + CF-Poll"},
601 {DATA_NULL_FUNCTION, "Null function (No data)"},
602 {DATA_CF_ACK_NOD, "Acknowledgement (No data)"},
603 {DATA_CF_POLL_NOD, "CF-Poll (No data)"},
604 {DATA_CF_ACK_POLL_NOD, "CF-Ack/Poll (No data)"},
605 {DATA_QOS_DATA, "QoS Data"},
606 {DATA_QOS_DATA_CF_ACK, "QoS Data + CF-Acknowledgment"},
607 {DATA_QOS_DATA_CF_POLL, "QoS Data + CF-Poll"},
608 {DATA_QOS_DATA_CF_ACK_POLL, "QoS Data + CF-Ack + CF-Poll"},
609 {DATA_QOS_NULL, "QoS Null function (No data)"},
610 {DATA_QOS_CF_POLL_NOD, "QoS CF-Poll (No Data)"},
611 {DATA_QOS_CF_ACK_POLL_NOD, "QoS CF-Ack + CF-Poll (No data)"},
615 /* ************************************************************************* */
616 /* 802.1D Tag Names */
617 /* ************************************************************************* */
618 static const char *qos_tags[8] = {
629 /* ************************************************************************* */
630 /* WME Access Category Names (by 802.1D Tag) */
631 /* ************************************************************************* */
632 static const char *qos_acs[8] = {
643 /* ************************************************************************* */
644 /* WME Access Category Names (by WME ACI) */
645 /* ************************************************************************* */
646 static const char *wme_acs[4] = {
653 /* ************************************************************************* */
654 /* Aruba Management Type */
655 /* ************************************************************************* */
656 static const value_string aruba_mgt_typevals[] = {
660 { 0x0004, "Ageout" },
661 { 0x0005, "Heartbeat" },
662 { 0x0006, "Deauth" },
663 { 0x0007, "Disassoc" },
664 { 0x0008, "Probe response" },
665 { 0x0009, "Tunnel update" },
666 { 0x000A, "Laser beam active" },
667 { 0x000B, "Client IP" },
668 { 0x000C, "Laser beam active v2" },
669 { 0x000D, "AP statistics" },
673 /*** Begin: Action Fixed Parameter ***/
674 #define CAT_SPECTRUM_MGMT 0
677 #define CAT_BLOCK_ACK 3
679 #define CAT_RADIO_MEASUREMENT 6
681 #define CAT_MGMT_NOTIFICATION 17
682 #define CAT_VENDOR_SPECIFIC 127
684 #define SM_ACTION_MEASUREMENT_REQUEST 0
685 #define SM_ACTION_MEASUREMENT_REPORT 1
686 #define SM_ACTION_TPC_REQUEST 2
687 #define SM_ACTION_TPC_REPORT 3
688 #define SM_ACTION_CHAN_SWITCH_ANNC 4
689 #define SM_ACTION_EXT_CHAN_SWITCH_ANNC 5
691 #define SM_ACTION_ADDTS_REQUEST 0
692 #define SM_ACTION_ADDTS_RESPONSE 1
693 #define SM_ACTION_DELTS 2
694 #define SM_ACTION_QOS_SCHEDULE 3
696 #define SM_ACTION_DLS_REQUEST 0
697 #define SM_ACTION_DLS_RESPONSE 1
698 #define SM_ACTION_DLS_TEARDOWN 2
700 #define BA_ADD_BLOCK_ACK_REQUEST 0
701 #define BA_ADD_BLOCK_ACK_RESPONSE 1
702 #define BA_DELETE_BLOCK_ACK 2
704 #define HT_ACTION_NOTIFY_CHAN_WIDTH 0
705 #define HT_ACTION_SM_PWR_SAVE 1
706 #define HT_ACTION_PSMP_ACTION 2
707 #define HT_ACTION_SET_PCO_PHASE 3
708 #define HT_ACTION_MIMO_CSI 4
709 #define HT_ACTION_MIMO_BEAMFORMING 5
710 #define HT_ACTION_MIMO_COMPRESSED_BEAMFORMING 6
711 #define HT_ACTION_ANT_SEL_FEEDBACK 7
712 #define HT_ACTION_HT_INFO_EXCHANGE 8
715 #define MRVL_ACTION_MESH_MANAGEMENT 1
717 #define MRVL_MESH_MGMT_ACTION_RREQ 0
718 #define MRVL_MESH_MGMT_ACTION_RREP 1
719 #define MRVL_MESH_MGMT_ACTION_RERR 2
720 #define MRVL_MESH_MGMT_ACTION_PLDM 3
722 /*** End: Action Fixed Parameter ***/
724 static int proto_wlan = -1;
725 static int proto_aggregate = -1;
726 static packet_info * g_pinfo;
728 static int proto_radio = -1;
729 static int proto_wlancap = -1;
730 static int proto_prism = -1;
732 /* ************************************************************************* */
733 /* Header field info values for radio information */
734 /* ************************************************************************* */
735 static int hf_mactime = -1;
736 static int hf_hosttime = -1;
737 static int hf_data_rate = -1;
738 static int hf_channel = -1;
739 static int hf_channel_frequency = -1;
740 static int hf_normrssi_antsignal = -1;
741 static int hf_dbm_antsignal = -1;
742 static int hf_rawrssi_antsignal = -1;
743 static int hf_normrssi_antnoise = -1;
744 static int hf_dbm_antnoise = -1;
745 static int hf_rawrssi_antnoise = -1;
746 static int hf_signal_strength = -1;
748 /* Prism radio header */
749 static int hf_prism_msgcode = -1;
750 static int hf_prism_msglen = -1;
751 static int hf_prism_rssi_data = -1;
752 static int hf_prism_sq_data = -1;
753 static int hf_prism_signal_data = -1;
754 static int hf_prism_noise_data = -1;
755 static int hf_prism_rate_data = -1;
756 static int hf_prism_istx_data = -1;
757 static int hf_prism_frmlen_data = -1;
759 /* AVS WLANCAP radio header */
760 static int hf_wlan_magic = -1;
761 static int hf_wlan_version = -1;
762 static int hf_wlan_length = -1;
763 static int hf_wlan_phytype = -1;
764 static int hf_wlan_antenna = -1;
765 static int hf_wlan_priority = -1;
766 static int hf_wlan_ssi_type = -1;
767 static int hf_wlan_ssi_signal = -1;
768 static int hf_wlan_ssi_noise = -1;
769 static int hf_wlan_preamble = -1;
770 static int hf_wlan_encoding = -1;
771 static int hf_wlan_sequence = -1;
772 static int hf_wlan_drops = -1;
773 static int hf_wlan_receiver_addr = -1;
774 static int hf_wlan_padding = -1;
776 /* ************************************************************************* */
777 /* Header field info values for FC-field */
778 /* ************************************************************************* */
779 static int hf_fc_field = -1;
780 static int hf_fc_proto_version = -1;
781 static int hf_fc_frame_type = -1;
782 static int hf_fc_frame_subtype = -1;
783 static int hf_fc_frame_type_subtype = -1;
785 static int hf_fc_flags = -1;
786 static int hf_fc_to_ds = -1;
787 static int hf_fc_from_ds = -1;
788 static int hf_fc_data_ds = -1;
790 static int hf_fc_more_frag = -1;
791 static int hf_fc_retry = -1;
792 static int hf_fc_pwr_mgt = -1;
793 static int hf_fc_more_data = -1;
794 static int hf_fc_protected = -1;
795 static int hf_fc_order = -1;
797 typedef struct retransmit_key {
804 static GHashTable *fc_analyse_retransmit_table = NULL;
805 static GHashTable *fc_first_frame_table = NULL;
807 static int hf_fc_analysis_retransmission = -1;
808 static int hf_fc_analysis_retransmission_frame = -1;
810 /* ************************************************************************* */
811 /* Header values for Duration/ID field */
812 /* ************************************************************************* */
813 static int hf_did_duration = -1;
814 static int hf_assoc_id = -1;
817 /* ************************************************************************* */
818 /* Header values for different address-fields (all 4 of them) */
819 /* ************************************************************************* */
820 static int hf_addr_da = -1; /* Destination address subfield */
821 static int hf_addr_sa = -1; /* Source address subfield */
822 static int hf_addr_ra = -1; /* Receiver address subfield */
823 static int hf_addr_ta = -1; /* Transmitter address subfield */
824 static int hf_addr_addr1 = -1;
825 static int hf_addr_bssid = -1; /* address is bssid */
827 static int hf_addr = -1; /* Source or destination address subfield */
830 /* ************************************************************************* */
831 /* Header values for QoS control field */
832 /* ************************************************************************* */
833 static int hf_qos_priority = -1;
834 static int hf_qos_ack_policy = -1;
835 static int hf_qos_amsdu_present = -1;
836 static int hf_qos_eosp = -1;
837 static int hf_qos_field_content = -1;
838 /*static int hf_qos_txop_limit = -1;*/
839 /* FIXME: hf_ values not defined
840 static int hf_qos_buf_state = -1;
841 static int hf_qos_buf_ac = -1;
842 static int hf_qos_buf_load = -1;
844 /*static int hf_qos_txop_dur_req = -1;
845 static int hf_qos_queue_size = -1;*/
847 /* ************************************************************************* */
848 /* Header values for HT control field (+HTC) */
849 /* ************************************************************************* */
850 /* 802.11nD-1.10 & 802.11nD-2.0 7.1.3.5a */
851 static int hf_htc = -1;
852 static int hf_htc_lac = -1;
853 static int hf_htc_lac_reserved = -1;
854 static int hf_htc_lac_trq = -1;
855 static int hf_htc_lac_mai_aseli = -1;
856 static int hf_htc_lac_mai_mrq = -1;
857 static int hf_htc_lac_mai_msi = -1;
858 static int hf_htc_lac_mai_reserved = -1;
859 static int hf_htc_lac_mfsi = -1;
860 static int hf_htc_lac_mfb = -1;
861 static int hf_htc_lac_asel_command = -1;
862 static int hf_htc_lac_asel_data = -1;
863 static int hf_htc_cal_pos = -1;
864 static int hf_htc_cal_seq = -1;
865 static int hf_htc_reserved1 = -1;
866 static int hf_htc_csi_steering = -1;
867 static int hf_htc_ndp_announcement = -1;
868 static int hf_htc_reserved2 = -1;
869 static int hf_htc_ac_constraint = -1;
870 static int hf_htc_rdg_more_ppdu = -1;
872 /* ************************************************************************* */
873 /* Header values for sequence number field */
874 /* ************************************************************************* */
875 static int hf_frag_number = -1;
876 static int hf_seq_number = -1;
878 /* ************************************************************************* */
879 /* Header values for Frame Check field */
880 /* ************************************************************************* */
881 static int hf_fcs = -1;
882 static int hf_fcs_good = -1;
883 static int hf_fcs_bad = -1;
885 /* ************************************************************************* */
886 /* Header values for reassembly */
887 /* ************************************************************************* */
888 static int hf_fragments = -1;
889 static int hf_fragment = -1;
890 static int hf_fragment_overlap = -1;
891 static int hf_fragment_overlap_conflict = -1;
892 static int hf_fragment_multiple_tails = -1;
893 static int hf_fragment_too_long_fragment = -1;
894 static int hf_fragment_error = -1;
895 static int hf_reassembled_in = -1;
898 static int proto_wlan_mgt = -1;
900 /* ************************************************************************* */
901 /* Header values for WAVE */
902 /* ************************************************************************* */
903 static int hf_pst_timingquality = -1;
904 static int hf_pst_providercount = -1;
905 static int hf_pst_length = -1;
906 static int hf_pst_contents = -1;
908 static int hf_pst_acid = -1;
909 static int hf_pst_acm_length = -1;
910 static int hf_pst_acm = -1;
911 static int hf_pst_acm_contents =-1;
912 static int hf_pst_acf = -1;
913 static int hf_pst_priority = -1;
914 static int hf_pst_ipv6addr = -1;
915 static int hf_pst_serviceport = -1;
916 static int hf_pst_addressing = -1;
917 static int hf_pst_macaddr = -1;
918 static int hf_pst_channel = -1;
920 static int hf_chan_noc = -1;
921 static int hf_chan_length = -1;
922 static int hf_chan_content = -1;
923 static int hf_chan_channel = -1;
924 static int hf_chan_adapt = -1;
925 static int hf_chan_rate = -1;
926 static int hf_chan_tx_pow = -1;
928 /* ************************************************************************* */
929 /* Fixed fields found in mgt frames */
930 /* ************************************************************************* */
931 static int ff_auth_alg = -1; /* Authentication algorithm field */
932 static int ff_auth_seq = -1; /* Authentication transaction sequence */
933 static int ff_current_ap = -1; /* Current AP MAC address */
934 static int ff_listen_ival = -1; /* Listen interval fixed field */
935 static int ff_timestamp = -1; /* 64 bit timestamp */
936 static int ff_beacon_interval = -1; /* 16 bit Beacon interval */
937 static int ff_assoc_id = -1; /* 16 bit AID field */
938 static int ff_reason = -1; /* 16 bit reason code */
939 static int ff_status_code = -1; /* Status code */
940 static int ff_category_code = -1; /* 8 bit Category code */
941 static int ff_action_code = -1; /* 8 bit Action code */
942 static int ff_dialog_token = -1; /* 8 bit Dialog token */
943 static int ff_wme_action_code = -1; /* Management notification action code */
944 static int ff_wme_status_code = -1; /* Management notification setup response status code */
945 static int ff_qos_action_code = -1;
946 static int ff_dls_action_code = -1;
947 static int ff_dst_mac_addr = -1; /* DLS destination MAC addressi */
948 static int ff_src_mac_addr = -1; /* DLS source MAC addressi */
949 static int ff_dls_timeout = -1; /* DLS timeout value */
951 /* Vendor specific */
952 static int ff_marvell_action_type = -1;
953 static int ff_marvell_mesh_mgt_action_code = -1;
954 static int ff_mesh_mgt_length = -1; /* Mesh Management length */
955 static int ff_mesh_mgt_mode = -1; /* Mesh Management mode */
956 static int ff_mesh_mgt_ttl = -1; /* Mesh Management TTL */
957 static int ff_mesh_mgt_dstcount = -1; /* Mesh Management dst count */
958 static int ff_mesh_mgt_hopcount = -1; /* Mesh Management hop count */
959 static int ff_mesh_mgt_rreqid = -1; /* Mesh Management RREQ ID */
960 static int ff_mesh_mgt_sa = -1; /* Mesh Management src addr */
961 static int ff_mesh_mgt_ssn = -1; /* Mesh Management src sequence number */
962 static int ff_mesh_mgt_metric = -1; /* Mesh Management metric */
963 static int ff_mesh_mgt_flags = -1; /* Mesh Management RREQ flags */
964 static int ff_mesh_mgt_da = -1; /* Mesh Management dst addr */
965 static int ff_mesh_mgt_dsn = -1; /* Mesh Management dst sequence number */
966 static int ff_mesh_mgt_lifetime = -1; /* Mesh Management lifetime */
969 /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/
970 static int ff_ba_action = -1;
971 /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/
973 /*** Begin: Block Ack Params Fixed Field - Dustin Johnson ***/
974 static int ff_block_ack_params = -1;
975 static int ff_block_ack_params_amsdu_permitted = -1;
976 static int ff_block_ack_params_policy = -1;
977 static int ff_block_ack_params_tid = -1;
978 static int ff_block_ack_params_buffer_size = -1;
979 /*** End: Block Ack Params Fixed Field - Dustin Johnson ***/
981 /*** Begin: Block Ack Timeout Fixed Field - Dustin Johnson ***/
982 static int ff_block_ack_timeout = -1;
983 /*** End: Block Ack Timeout Fixed Field - Dustin Johnson ***/
985 /*** Begin: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
986 static int ff_block_ack_ssc = -1;
987 static int ff_block_ack_ssc_fragment = -1;
988 static int ff_block_ack_ssc_sequence = -1;
989 /*** End: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
991 /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
992 static int ff_delba_param = -1;
993 static int ff_delba_param_reserved = -1;
994 static int ff_delba_param_init = -1;
995 static int ff_delba_param_tid = -1;
996 /*** End: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
998 /*** Begin: Max Regulation Power Fixed Field - Dustin Johnson ***/
999 static int ff_max_reg_pwr = -1;
1000 /*** End: Max Regulation Power Fixed Field - Dustin Johnson ***/
1002 /*** Begin: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
1003 static int ff_measurement_pilot_int = -1;
1004 /*** End: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
1006 /*** Begin: Country String Fixed Field - Dustin Johnson ***/
1007 static int ff_country_str = -1;
1008 /*** End: Country String Fixed Field - Dustin Johnson ***/
1010 /*** Begin: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
1011 static int ff_max_tx_pwr = -1;
1012 /*** End: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
1014 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
1015 static int ff_tx_pwr_used = -1;
1016 /*** End: Transmit Power Used Fixed Field - Dustin Johnson ***/
1018 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
1019 static int ff_transceiver_noise_floor = -1;
1020 /*** End: Transmit Power Used Fixed Field - Dustin Johnson ***/
1022 /*** Begin: Channel Width Fixed Field - Dustin Johnson ***/
1023 static int ff_channel_width = -1;
1024 /*** End: Channel Width Fixed Field - Dustin Johnson ***/
1026 /*** Begin: QoS Inforamtion AP Fixed Field - Dustin Johnson ***/
1027 static int ff_qos_info_ap = -1;
1028 static int ff_qos_info_ap_edca_param_set_counter = -1;
1029 static int ff_qos_info_ap_q_ack = -1;
1030 static int ff_qos_info_ap_queue_req = -1;
1031 static int ff_qos_info_ap_txop_request = -1;
1032 static int ff_qos_info_ap_reserved = -1;
1033 /*** End: QoS Inforamtion AP Fixed Field - Dustin Johnson ***/
1035 /*** Begin: QoS Inforamtion STA Fixed Field - Dustin Johnson ***/
1036 static int ff_qos_info_sta = -1;
1037 static int ff_qos_info_sta_ac_vo = -1;
1038 static int ff_qos_info_sta_ac_vi = -1;
1039 static int ff_qos_info_sta_ac_bk = -1;
1040 static int ff_qos_info_sta_ac_be = -1;
1041 static int ff_qos_info_sta_q_ack = -1;
1042 static int ff_qos_info_sta_max_sp_len = -1;
1043 static int ff_qos_info_sta_more_data_ack = -1;
1044 /*** End: QoS Inforamtion STA Fixed Field - Dustin Johnson ***/
1046 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
1047 static int ff_sm_pwr_save = -1;
1048 static int ff_sm_pwr_save_enabled = -1;
1049 static int ff_sm_pwr_save_sm_mode = -1;
1050 static int ff_sm_pwr_save_reserved = -1;
1051 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
1053 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
1054 static int ff_pco_phase_cntrl = -1;
1055 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
1057 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
1058 static int ff_psmp_param_set = -1;
1059 static int ff_psmp_param_set_n_sta = -1;
1060 static int ff_psmp_param_set_more_psmp = -1;
1061 static int ff_psmp_param_set_psmp_sequence_duration = -1;
1062 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
1064 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
1065 static int ff_mimo_cntrl_nc_index = -1;
1066 static int ff_mimo_cntrl_nr_index = -1;
1067 static int ff_mimo_cntrl_channel_width = -1;
1068 static int ff_mimo_cntrl_grouping = -1;
1069 static int ff_mimo_cntrl_coefficient_size = -1;
1070 static int ff_mimo_cntrl_codebook_info = -1;
1071 static int ff_mimo_cntrl_remaining_matrix_segment = -1;
1072 static int ff_mimo_cntrl_reserved = -1;
1073 static int ff_mimo_cntrl_sounding_timestamp = -1;
1074 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
1076 /*** Begin: Antenna Selection Fixed Field - Dustin Johnson ***/
1077 static int ff_ant_selection = -1;
1078 static int ff_ant_selection_0 = -1;
1079 static int ff_ant_selection_1 = -1;
1080 static int ff_ant_selection_2 = -1;
1081 static int ff_ant_selection_3 = -1;
1082 static int ff_ant_selection_4 = -1;
1083 static int ff_ant_selection_5 = -1;
1084 static int ff_ant_selection_6 = -1;
1085 static int ff_ant_selection_7 = -1;
1086 /*** End: Antenna Selection Fixed Field - Dustin Johnson ***/
1088 /*** Begin: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
1089 static int ff_ext_channel_switch_announcement = -1;
1090 /*** End: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
1092 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
1093 static int ff_ht_info = -1;
1094 static int ff_ht_info_information_request = -1;
1095 static int ff_ht_info_40_mhz_intolerant = -1;
1096 static int ff_ht_info_sta_chan_width = -1;
1097 static int ff_ht_info_reserved = -1;
1098 /*** End: HT Information Fixed Field - Dustin Johnson ***/
1100 /*** Begin: HT Action Fixed Field - Dustin Johnson ***/
1101 static int ff_ht_action = -1;
1102 /*** End: HT Action Fixed Field - Dustin Johnson ***/
1104 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
1105 static int ff_psmp_sta_info = -1;
1106 static int ff_psmp_sta_info_dtt_start_offset = -1;
1107 static int ff_psmp_sta_info_dtt_duration = -1;
1108 static int ff_psmp_sta_info_sta_id = -1;
1109 static int ff_psmp_sta_info_utt_start_offset = -1;
1110 static int ff_psmp_sta_info_utt_duration = -1;
1111 static int ff_psmp_sta_info_reserved_small= -1;
1112 static int ff_psmp_sta_info_reserved_large = -1;
1113 static int ff_psmp_sta_info_psmp_multicast_id = -1;
1114 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
1116 /*** Begin: MIMO CSI Matrices Report - Dustin Johnson ***/
1117 static int ff_mimo_csi_snr = -1;
1118 /*** End: MIMO CSI Matrices Report - Dustin Johnson ***/
1120 /* ************************************************************************* */
1121 /* Flags found in the capability field (fixed field) */
1122 /* ************************************************************************* */
1123 static int ff_capture = -1;
1124 static int ff_cf_ess = -1;
1125 static int ff_cf_ibss = -1;
1126 static int ff_cf_sta_poll = -1; /* CF pollable status for a STA */
1127 static int ff_cf_ap_poll = -1; /* CF pollable status for an AP */
1128 static int ff_cf_privacy = -1;
1129 static int ff_cf_preamble = -1;
1130 static int ff_cf_pbcc = -1;
1131 static int ff_cf_agility = -1;
1132 static int ff_short_slot_time = -1;
1133 static int ff_dsss_ofdm = -1;
1134 static int ff_cf_spec_man = -1;
1135 static int ff_cf_apsd = -1;
1136 static int ff_cf_del_blk_ack = -1;
1137 static int ff_cf_imm_blk_ack = -1;
1139 /* ************************************************************************* */
1141 /* ************************************************************************* */
1142 static int amsdu_msdu_header_text = -1;
1145 /* ************************************************************************* */
1146 /* Tagged value format fields */
1147 /* ************************************************************************* */
1148 static int tag_number = -1;
1149 static int tag_length = -1;
1150 static int tag_interpretation = -1;
1151 static int tag_oui = -1;
1154 static int tim_length = -1;
1155 static int tim_dtim_count = -1;
1156 static int tim_dtim_period = -1;
1157 static int tim_bmapctl = -1;
1160 static int hf_fixed_parameters = -1; /* Protocol payload for management frames */
1161 static int hf_tagged_parameters = -1; /* Fixed payload item */
1162 static int hf_tagged_ssid = -1;
1163 static int hf_wep_iv = -1;
1164 static int hf_wep_iv_weak = -1;
1165 static int hf_tkip_extiv = -1;
1166 static int hf_ccmp_extiv = -1;
1167 static int hf_wep_key = -1;
1168 static int hf_wep_icv = -1;
1170 /*** Begin: Block Ack Request/Block Ack - Dustin Johnson***/
1171 static int hf_block_ack_request_control = -1;
1172 static int hf_block_ack_control = -1;
1173 static int hf_block_ack_control_ack_policy = -1;
1174 static int hf_block_ack_control_multi_tid = -1;
1175 static int hf_block_ack_control_compressed_bitmap = -1;
1176 static int hf_block_ack_control_reserved = -1;
1178 static int hf_block_ack_control_basic_tid_info = -1;
1179 static int hf_block_ack_control_compressed_tid_info = -1;
1180 static int hf_block_ack_control_multi_tid_info = -1;
1182 static int hf_tag_measure_request_measurement_mode = -1;
1183 static int hf_tag_measure_request_bssid = -1;
1184 static int hf_tag_measure_request_reporting_condition = -1;
1185 static int hf_tag_measure_request_threshold_offset_unsigned = -1;
1186 static int hf_tag_measure_request_threshold_offset_signed = -1;
1188 static int hf_tag_measure_request_report_mac = -1;
1190 static int hf_tag_measure_request_group_id = -1;
1192 static int hf_block_ack_multi_tid_info = -1;
1193 static int hf_block_ack_request_type = -1;
1194 static int hf_block_ack_multi_tid_reserved = -1;
1195 static int hf_block_ack_multi_tid_value = -1;
1196 static int hf_block_ack_type = -1;
1197 /*** End: Block Ack Request/Block Ack - Dustin Johnson***/
1199 static int ht_cap = -1;
1200 static int ht_vs_cap = -1;
1201 static int ht_ldpc_coding = -1;
1202 static int ht_chan_width = -1;
1203 static int ht_sm_pwsave = -1;
1204 static int ht_green = -1;
1205 static int ht_short20 = -1;
1206 static int ht_short40 = -1;
1207 static int ht_tx_stbc = -1;
1208 static int ht_rx_stbc = -1;
1209 static int ht_delayed_block_ack = -1;
1210 static int ht_max_amsdu = -1;
1211 static int ht_dss_cck_40 = -1;
1212 static int ht_psmp = -1;
1213 static int ht_40_mhz_intolerant = -1;
1214 static int ht_l_sig = -1;
1216 static int ampduparam = -1;
1217 static int ampduparam_vs = -1;
1218 static int ampduparam_mpdu = -1;
1219 static int ampduparam_mpdu_start_spacing = -1;
1220 static int ampduparam_reserved = -1;
1222 static int mcsset = -1;
1223 static int mcsset_vs = -1;
1224 static int mcsset_rx_bitmask_0to7 = -1;
1225 static int mcsset_rx_bitmask_8to15 = -1;
1226 static int mcsset_rx_bitmask_16to23 = -1;
1227 static int mcsset_rx_bitmask_24to31 = -1;
1228 static int mcsset_rx_bitmask_32 = -1;
1229 static int mcsset_rx_bitmask_33to38 = -1;
1230 static int mcsset_rx_bitmask_39to52 = -1;
1231 static int mcsset_rx_bitmask_53to76 = -1;
1232 static int mcsset_highest_data_rate = -1;
1233 static int mcsset_tx_mcs_set_defined = -1;
1234 static int mcsset_tx_rx_mcs_set_not_equal = -1;
1235 static int mcsset_tx_max_spatial_streams = -1;
1236 static int mcsset_tx_unequal_modulation = -1;
1238 static int htex_cap = -1;
1239 static int htex_vs_cap = -1;
1240 static int htex_pco = -1;
1241 static int htex_transtime = -1;
1242 static int htex_mcs = -1;
1243 static int htex_htc_support = -1;
1244 static int htex_rd_responder = -1;
1246 static int txbf = -1;
1247 static int txbf_vs = -1;
1248 static int txbf_cap = -1;
1249 static int txbf_rcv_ssc = -1;
1250 static int txbf_tx_ssc = -1;
1251 static int txbf_rcv_ndp = -1;
1252 static int txbf_tx_ndp = -1;
1253 static int txbf_impl_txbf = -1;
1254 static int txbf_calib = -1;
1255 static int txbf_expl_csi = -1;
1256 static int txbf_expl_uncomp_fm = -1;
1257 static int txbf_expl_comp_fm = -1;
1258 static int txbf_expl_bf_csi = -1;
1259 static int txbf_expl_uncomp_fm_feed = -1;
1260 static int txbf_expl_comp_fm_feed = -1;
1261 static int txbf_csi_num_bf_ant = -1;
1262 static int txbf_min_group = -1;
1263 static int txbf_uncomp_sm_bf_ant = -1;
1264 static int txbf_comp_sm_bf_ant = -1;
1265 static int txbf_csi_max_rows_bf = -1;
1266 static int txbf_chan_est = -1;
1267 static int txbf_resrv = -1;
1269 /*** Begin: 802.11n D1.10 - HT Information IE ***/
1270 static int ht_info_primary_channel = -1;
1272 static int ht_info_delimiter1 = -1;
1273 static int ht_info_secondary_channel_offset = -1;
1274 static int ht_info_channel_width = -1;
1275 static int ht_info_rifs_mode = -1;
1276 static int ht_info_psmp_stas_only = -1;
1277 static int ht_info_service_interval_granularity = -1;
1279 static int ht_info_delimiter2 = -1;
1280 static int ht_info_operating_mode = -1;
1281 static int ht_info_non_greenfield_sta_present = -1;
1282 static int ht_info_transmit_burst_limit = -1;
1283 static int ht_info_obss_non_ht_stas_present = -1;
1284 static int ht_info_reserved_1 = -1;
1286 static int ht_info_delimiter3 = -1;
1287 static int ht_info_reserved_2 = -1;
1288 static int ht_info_dual_beacon = -1;
1289 static int ht_info_dual_cts_protection = -1;
1290 static int ht_info_secondary_beacon = -1;
1291 static int ht_info_lsig_txop_protection_full_support = -1;
1292 static int ht_info_pco_active = -1;
1293 static int ht_info_pco_phase = -1;
1294 static int ht_info_reserved_3 = -1;
1295 /*** End: 802.11n D1.10 - HT Information IE ***/
1297 /*** Begin: 802.11n D1.10 - Secondary Channel Offset Tag - Dustin Johnson***/
1298 static int hf_tag_secondary_channel_offset = -1;
1299 /*** End: 802.11n D1.10 - Secondary Channel Offset Tag - Dustin Johnson***/
1301 /*** Begin: Power Capability Tag - Dustin Johnson ***/
1302 static int hf_tag_power_capability_min = -1;
1303 static int hf_tag_power_capability_max = -1;
1304 /*** End: Power Capability Tag - Dustin Johnson ***/
1306 static int hf_tag_tpc_report_trsmt_pow = -1;
1307 static int hf_tag_tpc_report_link_mrg = -1;
1309 /*** Begin: Power Capability Tag - Dustin Johnson ***/
1310 static int hf_tag_supported_channels = -1;
1311 static int hf_tag_supported_channels_first = -1;
1312 static int hf_tag_supported_channels_range = -1;
1313 /*** End: Power Capability Tag - Dustin Johnson ***/
1315 /*** Begin: Measurement Request Tag - Dustin Johnson***/
1316 static int hf_tag_measure_request_measurement_token = -1;
1317 static int hf_tag_measure_request_mode = -1;
1318 static int hf_tag_measure_request_mode_reserved1 = -1;
1319 static int hf_tag_measure_request_mode_enable = -1;
1320 static int hf_tag_measure_request_mode_request = -1;
1321 static int hf_tag_measure_request_mode_report = -1;
1322 static int hf_tag_measure_request_mode_reserved2 = -1;
1323 static int hf_tag_measure_request_type = -1;
1325 static int hf_tag_measure_request_channel_number = -1;
1326 static int hf_tag_measure_request_start_time = -1;
1327 static int hf_tag_measure_request_duration = -1;
1329 static int hf_tag_measure_request_regulatory_class = -1;
1330 static int hf_tag_measure_request_randomization_interval = -1;
1331 /*** End: Measurement Request Tag - Dustin Johnson***/
1333 /*** Begin: Measurement Report Tag - Dustin Johnson***/
1334 static int hf_tag_measure_report_measurement_token = -1;
1335 static int hf_tag_measure_report_mode = -1;
1336 static int hf_tag_measure_report_mode_late = -1;
1337 static int hf_tag_measure_report_mode_incapable = -1;
1338 static int hf_tag_measure_report_mode_refused = -1;
1339 static int hf_tag_measure_report_mode_reserved = -1;
1340 static int hf_tag_measure_report_type = -1;
1341 static int hf_tag_measure_report_channel_number = -1;
1342 static int hf_tag_measure_report_start_time = -1;
1343 static int hf_tag_measure_report_duration = -1;
1345 static int hf_tag_measure_basic_map_field = -1;
1346 static int hf_tag_measure_map_field_bss = -1;
1347 static int hf_tag_measure_map_field_odfm = -1;
1348 static int hf_tag_measure_map_field_unident_signal = -1;
1349 static int hf_tag_measure_map_field_radar = -1;
1350 static int hf_tag_measure_map_field_unmeasured = -1;
1351 static int hf_tag_measure_map_field_reserved = -1;
1353 static int hf_tag_measure_cca_busy_fraction = -1;
1355 static int hf_tag_measure_rpi_histogram_report = -1;
1356 static int hf_tag_measure_rpi_histogram_report_0 = -1;
1357 static int hf_tag_measure_rpi_histogram_report_1 = -1;
1358 static int hf_tag_measure_rpi_histogram_report_2 = -1;
1359 static int hf_tag_measure_rpi_histogram_report_3 = -1;
1360 static int hf_tag_measure_rpi_histogram_report_4 = -1;
1361 static int hf_tag_measure_rpi_histogram_report_5 = -1;
1362 static int hf_tag_measure_rpi_histogram_report_6 = -1;
1363 static int hf_tag_measure_rpi_histogram_report_7 = -1;
1365 static int hf_tag_measure_report_regulatory_class = -1;
1366 static int hf_tag_measure_report_channel_load = -1;
1367 static int hf_tag_measure_report_frame_info = -1;
1368 static int hf_tag_measure_report_frame_info_phy_type = -1;
1369 static int hf_tag_measure_report_frame_info_frame_type = -1;
1370 static int hf_tag_measure_report_rcpi = -1;
1371 static int hf_tag_measure_report_rsni = -1;
1372 static int hf_tag_measure_report_bssid = -1;
1373 static int hf_tag_measure_report_ant_id = -1;
1374 static int hf_tag_measure_report_parent_tsf = -1;
1375 /*** End: Measurement Report Tag - Dustin Johnson***/
1377 /*** Begin: Extended Capabilities Tag - Dustin Johnson ***/
1378 static int hf_tag_extended_capabilities = -1;
1379 static int hf_tag_extended_capabilities_b0 = -1;
1380 static int hf_tag_extended_capabilities_b1 = -1;
1381 static int hf_tag_extended_capabilities_b2 = -1;
1382 static int hf_tag_extended_capabilities_b3 = -1;
1383 /*** End: Extended Capabilities Tag - Dustin Johnson ***/
1385 /*** Begin: Neighbor Report Tag - Dustin Johnson ***/
1386 static int hf_tag_neighbor_report_bssid = -1;
1387 static int hf_tag_neighbor_report_bssid_info = -1;
1388 static int hf_tag_neighbor_report_bssid_info_reachability = -1;
1389 static int hf_tag_neighbor_report_bssid_info_security = -1;
1390 static int hf_tag_neighbor_report_bssid_info_key_scope = -1;
1391 /*static int hf_tag_neighbor_report_bssid_info_capability = -1; */ /* TODO Make this the parent tree item */
1392 static int hf_tag_neighbor_report_bssid_info_capability_spec_mng = -1;
1393 static int hf_tag_neighbor_report_bssid_info_capability_qos = -1;
1394 static int hf_tag_neighbor_report_bssid_info_capability_apsd = -1;
1395 static int hf_tag_neighbor_report_bssid_info_capability_radio_msnt = -1;
1396 static int hf_tag_neighbor_report_bssid_info_capability_dback = -1;
1397 static int hf_tag_neighbor_report_bssid_info_capability_iback = -1;
1398 static int hf_tag_neighbor_report_bssid_info_mobility_domain = -1;
1399 static int hf_tag_neighbor_report_bssid_info_high_throughput = -1;
1400 static int hf_tag_neighbor_report_bssid_info_reserved = -1;
1401 static int hf_tag_neighbor_report_reg_class = -1;
1402 static int hf_tag_neighbor_report_channel_number = -1;
1403 static int hf_tag_neighbor_report_phy_type = -1;
1404 /*** End: Neighbor Report Tag - Dustin Johnson ***/
1406 /*** Begin: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
1407 static int hf_tag_ext_channel_switch_announcement_switch_mode = -1;
1408 static int hf_tag_ext_channel_switch_announcement_new_reg_class = -1;
1409 static int hf_tag_ext_channel_switch_announcement_new_chan_number = -1;
1410 static int hf_tag_ext_channel_switch_announcement_switch_count = -1;
1411 /*** End: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
1413 /*** Begin: Supported Regulatory Classes Tag - Dustin Johnson ***/
1414 static int hf_tag_supported_reg_classes_current = -1;
1415 static int hf_tag_supported_reg_classes_alternate = -1;
1416 /*** End: Supported Regulatory Classes Tag - Dustin Johnson ***/
1418 /* 802.11n 7.3.2.48 */
1419 static int hta_cap = -1;
1420 static int hta_ext_chan_offset = -1;
1421 static int hta_rec_tx_width = -1;
1422 static int hta_rifs_mode = -1;
1423 static int hta_controlled_access = -1;
1424 static int hta_service_interval = -1;
1425 static int hta_operating_mode = -1;
1426 static int hta_non_gf_devices = -1;
1427 static int hta_basic_stbc_mcs = -1;
1428 static int hta_dual_stbc_protection = -1;
1429 static int hta_secondary_beacon = -1;
1430 static int hta_lsig_txop_protection = -1;
1431 static int hta_pco_active = -1;
1432 static int hta_pco_phase = -1;
1435 static int antsel = -1;
1436 static int antsel_vs = -1;
1437 static int antsel_b0 = -1;
1438 static int antsel_b1 = -1;
1439 static int antsel_b2 = -1;
1440 static int antsel_b3 = -1;
1441 static int antsel_b4 = -1;
1442 static int antsel_b5 = -1;
1443 static int antsel_b6 = -1;
1444 static int antsel_b7 = -1;
1446 static int rsn_cap = -1;
1447 static int rsn_cap_preauth = -1;
1448 static int rsn_cap_no_pairwise = -1;
1449 static int rsn_cap_ptksa_replay_counter = -1;
1450 static int rsn_cap_gtksa_replay_counter = -1;
1452 static int hf_aironet_ie_type = -1;
1453 static int hf_aironet_ie_version = -1;
1454 static int hf_aironet_ie_data = -1;
1455 static int hf_aironet_ie_qos_unk1 = -1;
1456 static int hf_aironet_ie_qos_paramset = -1;
1457 static int hf_aironet_ie_qos_val = -1;
1459 static int hf_marvell_ie_type = -1;
1460 static int hf_marvell_ie_mesh_subtype = -1;
1461 static int hf_marvell_ie_mesh_version = -1;
1462 static int hf_marvell_ie_mesh_active_proto_id = -1;
1463 static int hf_marvell_ie_mesh_active_metric_id = -1;
1464 static int hf_marvell_ie_mesh_cap = -1;
1465 static int hf_marvell_ie_data = -1;
1467 /*QBSS - Version 1,2,802.11e*/
1469 static int hf_qbss2_cal = -1;
1470 static int hf_qbss2_gl = -1;
1471 static int hf_qbss_cu = -1;
1472 static int hf_qbss2_cu = -1;
1473 static int hf_qbss_scount = -1;
1474 static int hf_qbss2_scount = -1;
1475 static int hf_qbss_version = -1;
1476 static int hf_qbss_adc = -1;
1478 static int hf_ts_info = -1;
1479 static int hf_tsinfo_type = -1;
1480 static int hf_tsinfo_tsid = -1;
1481 static int hf_tsinfo_dir = -1;
1482 static int hf_tsinfo_access = -1;
1483 static int hf_tsinfo_agg = -1;
1484 static int hf_tsinfo_apsd = -1;
1485 static int hf_tsinfo_up = -1;
1486 static int hf_tsinfo_ack = -1;
1487 static int hf_tsinfo_sched = -1;
1488 static int tspec_nor_msdu = -1;
1489 static int tspec_max_msdu = -1;
1490 static int tspec_min_srv = -1;
1491 static int tspec_max_srv = -1;
1492 static int tspec_inact_int = -1;
1493 static int tspec_susp_int = -1;
1494 static int tspec_srv_start = -1;
1495 static int tspec_min_data = -1;
1496 static int tspec_mean_data = -1;
1497 static int tspec_peak_data = -1;
1498 static int tspec_burst_size = -1;
1499 static int tspec_delay_bound = -1;
1500 static int tspec_min_phy = -1;
1501 static int tspec_surplus = -1;
1502 static int tspec_medium = -1;
1503 static int ts_delay = -1;
1504 static int hf_class_type = -1;
1505 static int hf_class_mask = -1;
1506 static int hf_ether_type = -1;
1507 static int hf_tclas_process = -1;
1508 static int hf_sched_info = -1;
1509 static int hf_sched_srv_start = -1;
1510 static int hf_sched_srv_int = -1;
1511 static int hf_sched_spec_int = -1;
1512 static int hf_action = -1;
1513 static int cf_version = -1;
1514 static int cf_ipv4_src = -1;
1515 static int cf_ipv4_dst = -1;
1516 static int cf_src_port = -1;
1517 static int cf_dst_port = -1;
1518 static int cf_dscp = -1;
1519 static int cf_protocol = -1;
1520 static int cf_ipv6_src = -1;
1521 static int cf_ipv6_dst = -1;
1522 static int cf_flow = -1;
1523 static int cf_tag_type = -1;
1524 static int cf_aruba = -1;
1525 static int cf_aruba_hb_seq = -1;
1526 static int cf_aruba_mtu = -1;
1528 /* ************************************************************************* */
1529 /* Protocol trees */
1530 /* ************************************************************************* */
1531 static gint ett_80211 = -1;
1532 static gint ett_proto_flags = -1;
1533 static gint ett_cap_tree = -1;
1534 static gint ett_fc_tree = -1;
1535 static gint ett_cntrl_wrapper_fc = -1;
1536 static gint ett_cntrl_wrapper_payload = -1;
1537 static gint ett_fragments = -1;
1538 static gint ett_fragment = -1;
1539 static gint ett_block_ack = -1;
1542 static gint ett_80211_mgt = -1;
1543 static gint ett_fixed_parameters = -1;
1544 static gint ett_tagged_parameters = -1;
1545 static gint ett_qos_parameters = -1;
1546 static gint ett_qos_ps_buf_state = -1;
1547 static gint ett_wep_parameters = -1;
1549 static gint ett_rsn_cap_tree = -1;
1551 static gint ett_ht_cap_tree = -1;
1552 static gint ett_ampduparam_tree = -1;
1553 static gint ett_mcsset_tree = -1;
1554 static gint ett_mcsbit_tree = -1;
1555 static gint ett_htex_cap_tree = -1;
1556 static gint ett_txbf_tree = -1;
1557 static gint ett_antsel_tree = -1;
1558 static gint ett_hta_cap_tree = -1;
1559 static gint ett_hta_cap1_tree = -1;
1560 static gint ett_hta_cap2_tree = -1;
1561 static gint ett_htc_tree = -1;
1563 /*** Start: 802.11n D1.10 - HT Information IE - Dustin Johnson ***/
1564 static gint ett_ht_info_delimiter1_tree = -1;
1565 static gint ett_ht_info_delimiter2_tree = -1;
1566 static gint ett_ht_info_delimiter3_tree = -1;
1567 /*** End: 802.11n D1.10 - HT Information IE - Dustin Johnson ***/
1569 /*** Start: 802.11n D1.10 - Tag Measure Request IE - Dustin Johnson ***/
1570 static gint ett_tag_measure_request_tree = -1;
1571 /*** End: 802.11n D1.10 - Tag Measure Request IE - Dustin Johnson ***/
1573 static gint ett_tag_ex_cap = -1;
1575 /*** Begin: Supported Channels Tag - Dustin Johnson ***/
1576 static gint ett_tag_supported_channels = -1;
1577 /*** End: Supported Channels Tag - Dustin Johnson ***/
1579 /*** Begin: Neighbor Report Tag - Dustin Johnson ***/
1580 static gint ett_tag_neighbor_report_bssid_info_tree = -1;
1581 static gint ett_tag_neighbor_report_bssid_info_capability_tree = -1;
1582 static gint ett_tag_neighbor_report_sub_tag_tree = -1;
1583 /*** End: Neighbor Report Tag - Dustin Johnson ***/
1585 /*** Begin: Block Ack Timeout Fixed Field - Dustin Johnson ***/
1586 static gint ett_ff_ba_param_tree = -1;
1587 static gint ett_ff_ba_ssc_tree = -1;
1588 /*** End: Block Ack Timeout Fixed Field - Dustin Johnson ***/
1590 /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
1591 static gint ett_ff_delba_param_tree = -1;
1592 /*** End: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
1594 /*** Begin: QoS Inforamtion AP/STA Fixed Field - Dustin Johnson ***/
1595 static gint ett_ff_qos_info = -1;
1596 /*** End: QoS Inforamtion AP/STA Fixed Field - Dustin Johnson ***/
1598 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
1599 static gint ett_ff_sm_pwr_save = -1;
1600 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
1602 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
1603 static gint ett_ff_psmp_param_set = -1;
1604 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
1606 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
1607 static gint ett_ff_mimo_cntrl = -1;
1608 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
1610 /*** Begin: Antenna Selection Fixed Field - Dustin Johnson ***/
1611 static gint ett_ff_ant_sel = -1;
1612 /*** End: Antenna Selection Fixed Field - Dustin Johnson ***/
1614 /*** Begin: MIMO Reports - Dustin Johnson ***/
1615 static gint ett_mimo_report = -1;
1616 /*** End: MIMO Reports - Dustin Johnson ***/
1618 /*** Begin: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
1619 static gint ett_ff_chan_switch_announce = -1;
1620 /*** End: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
1622 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
1623 static gint ett_ff_ht_info = -1;
1624 /*** End: HT Information Fixed Field - Dustin Johnson ***/
1626 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
1627 static gint ett_ff_psmp_sta_info = -1;
1628 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
1630 /*** Begin: A-MSDU Dissection - Dustin Johnson ***/
1631 static gint ett_msdu_aggregation_parent_tree = -1;
1632 static gint ett_msdu_aggregation_subframe_tree = -1;
1633 /*** End: A-MSDU Dissection - Dustin Johnson ***/
1635 /*** Begin: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
1636 static gint ett_pst_tree = -1;
1637 static gint ett_pst_cap_tree = -1;
1638 static gint ett_chan_noc_tree = -1;
1639 static gint ett_wave_chnl_tree = -1;
1641 /*** End: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
1643 static gint ett_80211_mgt_ie = -1;
1644 static gint ett_tsinfo_tree = -1;
1645 static gint ett_sched_tree = -1;
1647 static gint ett_fcs = -1;
1649 static gint ett_radio = -1;
1651 static const fragment_items frag_items = {
1656 &hf_fragment_overlap,
1657 &hf_fragment_overlap_conflict,
1658 &hf_fragment_multiple_tails,
1659 &hf_fragment_too_long_fragment,
1665 static enum_val_t wlan_ignore_wep_options[] = {
1666 { "no", "No", WLAN_IGNORE_WEP_NO },
1667 { "without_iv", "Yes - without IV", WLAN_IGNORE_WEP_WO_IV },
1668 { "with_iv", "Yes - with IV", WLAN_IGNORE_WEP_W_IV },
1672 static dissector_handle_t ieee80211_handle;
1673 static dissector_handle_t llc_handle;
1674 static dissector_handle_t ipx_handle;
1675 static dissector_handle_t eth_withoutfcs_handle;
1676 static dissector_handle_t data_handle;
1677 static dissector_handle_t wlancap_handle;
1679 static int wlan_tap = -1;
1681 /* Davide Schiera (2006-11-22): including AirPDcap project */
1682 #ifdef HAVE_AIRPDCAP
1683 #include <epan/crypt/airpdcap_ws.h>
1684 AIRPDCAP_CONTEXT airpdcap_ctx;
1688 /* Davide Schiera (2006-11-22) ---------------------------------------------- */
1691 /* ************************************************************************* */
1692 /* Return the length of the current header (in bytes) */
1693 /* ************************************************************************* */
1695 find_header_length (guint16 fcf, guint16 ctrl_fcf, gboolean is_ht)
1700 switch (FCF_FRAME_TYPE (fcf)) {
1703 if (is_ht && IS_STRICTLY_ORDERED(FCF_FLAGS(fcf)))
1704 return MGT_FRAME_HDR_LEN + 4;
1706 return MGT_FRAME_HDR_LEN;
1709 if (COMPOSE_FRAME_TYPE(fcf) == CTRL_CONTROL_WRAPPER) {
1716 switch (COMPOSE_FRAME_TYPE (cw_fcf)) {
1719 case CTRL_ACKNOWLEDGEMENT:
1725 case CTRL_CFP_ENDACK:
1726 case CTRL_BLOCK_ACK_REQ:
1727 case CTRL_BLOCK_ACK:
1730 return len + 4; /* XXX */
1733 len = (FCF_ADDR_SELECTOR(fcf) ==
1734 DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
1736 if (DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
1738 if (is_ht && IS_STRICTLY_ORDERED(FCF_FLAGS(fcf))) {
1750 mimo_control_t get_mimo_control (tvbuff_t *tvb, int offset)
1753 mimo_control_t output;
1755 mimo = tvb_get_letohs (tvb, offset);
1757 output.nc = (mimo & 0x0003) + 1;
1758 output.nr = ((mimo & 0x000C) >> 2) + 1;
1759 output.chan_width = (mimo & 0x0010) >> 4;
1760 output.coefficient_size = 4; /* XXX - Is this a good default? */
1762 switch ((mimo & 0x0060) >> 5)
1765 output.grouping = 1;
1769 output.grouping = 2;
1773 output.grouping = 4;
1777 output.grouping = 1;
1781 switch ((mimo & 0x0180) >> 7)
1784 output.coefficient_size = 4;
1788 output.coefficient_size = 5;
1792 output.coefficient_size = 6;
1796 output.coefficient_size = 8;
1800 output.codebook_info = (mimo & 0x0600) >> 9;
1801 output.remaining_matrix_segment = (mimo & 0x3800) >> 11;
1806 int get_mimo_na (guint8 nr, guint8 nc)
1808 if (nr == 2 && nc == 1){
1810 }else if (nr == 2 && nc == 2){
1812 }else if (nr == 3 && nc == 1){
1814 }else if (nr == 3 && nc == 2){
1816 }else if (nr == 3 && nc == 3){
1818 }else if (nr == 4 && nc == 1){
1820 }else if (nr == 4 && nc == 2){
1822 }else if (nr == 4 && nc == 3){
1824 }else if (nr == 4 && nc == 4){
1831 int get_mimo_ns (gboolean chan_width, guint8 output_grouping)
1837 switch (output_grouping)
1855 switch (output_grouping)
1877 int add_mimo_csi_matrices_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
1879 proto_item *snr_item;
1880 proto_tree *snr_tree;
1881 int csi_matrix_size, start_offset;
1884 start_offset = offset;
1885 snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
1886 snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
1888 for (i=1; i <= mimo_cntrl.nr; i++)
1892 snr = tvb_get_guint8(tvb, offset);
1893 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);
1897 ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
1898 csi_matrix_size = ns*(3+(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size));
1899 csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
1900 proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "CSI Matrices");
1901 offset += csi_matrix_size;
1902 return offset - start_offset;
1905 int add_mimo_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
1907 proto_item *snr_item;
1908 proto_tree *snr_tree;
1909 int csi_matrix_size, start_offset;
1912 start_offset = offset;
1913 snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
1914 snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
1916 for (i=1; i <= mimo_cntrl.nc; i++)
1920 snr = tvb_get_guint8(tvb, offset);
1921 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);
1925 ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
1926 csi_matrix_size = ns*(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size);
1927 csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
1928 proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "Beamforming Feedback Matrices");
1929 offset += csi_matrix_size;
1930 return offset - start_offset;
1933 int add_mimo_compressed_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
1935 proto_item *snr_item;
1936 proto_tree *snr_tree;
1937 int csi_matrix_size, start_offset;
1940 start_offset = offset;
1941 snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
1942 snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
1944 for (i=1; i <= mimo_cntrl.nc; i++)
1948 snr = tvb_get_guint8(tvb, offset);
1949 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);
1953 na = get_mimo_na(mimo_cntrl.nr, mimo_cntrl.nc);
1954 ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
1955 csi_matrix_size = ns*(na*((mimo_cntrl.codebook_info+1)*2 + 2)/2);
1956 csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
1957 proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "Compressed Beamforming Feedback Matrices");
1958 offset += csi_matrix_size;
1959 return offset - start_offset;
1962 /* ************************************************************************* */
1963 /* This is the capture function used to update packet counts */
1964 /* ************************************************************************* */
1966 capture_ieee80211_common (const guchar * pd, int offset, int len,
1967 packet_counts * ld, gboolean fixed_length_header,
1968 gboolean datapad, gboolean is_ht)
1970 guint16 fcf, hdr_length;
1972 if (!BYTES_ARE_IN_FRAME(offset, len, 2)) {
1977 fcf = pletohs (&pd[offset]);
1979 if (IS_PROTECTED(FCF_FLAGS(fcf)) && wlan_ignore_wep == WLAN_IGNORE_WEP_NO) {
1984 switch (COMPOSE_FRAME_TYPE (fcf)) {
1986 case DATA: /* We got a data frame */
1987 case DATA_CF_ACK: /* Data with ACK */
1989 case DATA_CF_ACK_POLL:
1992 if (fixed_length_header)
1993 hdr_length = DATA_LONG_HDR_LEN;
1995 hdr_length = find_header_length (fcf, 0, is_ht);
1997 hdr_length = roundup2(hdr_length, 4);
1998 /* I guess some bridges take Netware Ethernet_802_3 frames,
1999 which are 802.3 frames (with a length field rather than
2000 a type field, but with no 802.2 header in the payload),
2001 and just stick the payload into an 802.11 frame. I've seen
2002 captures that show frames of that sort.
2004 This means we have to do the same check for Netware 802.3 -
2005 or, if you will, "Netware 802.11" - that we do in the
2006 Ethernet dissector, i.e. checking for 0xffff as the first
2007 four bytes of the payload and, if we find it, treating it
2009 if (!BYTES_ARE_IN_FRAME(offset+hdr_length, len, 2)) {
2013 if (pd[offset+hdr_length] == 0xff && pd[offset+hdr_length+1] == 0xff) {
2017 capture_llc (pd, offset + hdr_length, len, ld);
2029 * Handle 802.11 with a variable-length link-layer header.
2032 capture_ieee80211 (const guchar * pd, int offset, int len, packet_counts * ld)
2034 capture_ieee80211_common (pd, offset, len, ld, FALSE, FALSE, FALSE);
2038 * Handle 802.11 with a variable-length link-layer header and data padding.
2041 capture_ieee80211_datapad (const guchar * pd, int offset, int len,
2044 capture_ieee80211_common (pd, offset, len, ld, FALSE, TRUE, FALSE);
2048 * Handle 802.11 with a fixed-length link-layer header (padded to the
2052 capture_ieee80211_fixed (const guchar * pd, int offset, int len, packet_counts * ld)
2054 capture_ieee80211_common (pd, offset, len, ld, TRUE, FALSE, FALSE);
2058 * Handle an HT 802.11 with a variable-length link-layer header.
2061 capture_ieee80211_ht (const guchar * pd, int offset, int len, packet_counts * ld)
2063 capture_ieee80211_common (pd, offset, len, ld, FALSE, FALSE, TRUE);
2066 #define WLANCAP_MAGIC_COOKIE_BASE 0x80211000
2067 #define WLANCAP_MAGIC_COOKIE_V1 0x80211001
2068 #define WLANCAP_MAGIC_COOKIE_V2 0x80211002
2071 * Prism II-based wlan devices have a monitoring mode that sticks
2072 * a proprietary header on each packet with lots of good
2073 * information. This file is responsible for decoding that
2076 * Support by Tim Newsham
2078 * A value from the header.
2080 * It appears from looking at the linux-wlan-ng and Prism II HostAP
2081 * drivers, and various patches to the orinoco_cs drivers to add
2082 * Prism headers, that:
2084 * the "did" identifies what the value is (i.e., what it's the value
2087 * "status" is 0 if the value is present or 1 if it's absent;
2089 * "len" is the length of the value (always 4, in that code);
2091 * "data" is the value of the data (or 0 if not present).
2093 * Note: all of those values are in the *host* byte order of the machine
2094 * on which the capture was written.
2098 unsigned short status, len;
2103 * Header attached during Prism monitor mode.
2105 * At least according to one paper I've seen, the Prism 2.5 chip set
2108 * RSSI (receive signal strength indication) is "the total power
2109 * received by the radio hardware while receiving the frame,
2110 * including signal, interfereence, and background noise";
2112 * "silence value" is "the total power observed just before the
2113 * start of the frame".
2115 * None of the drivers I looked at supply the "rssi" or "sq" value,
2116 * but they do supply "signal" and "noise" values, along with a "rate"
2117 * value that's 1/5 of the raw value from what is presumably a raw
2118 * HFA384x frame descriptor, with the comment "set to 802.11 units",
2119 * which presumably means the units are 500 Kb/s.
2121 * I infer from the current NetBSD "wi" driver that "signal" and "noise"
2122 * are adjusted dBm values, with the dBm value having 100 added to it
2123 * for the Prism II cards (although the NetBSD code has an XXX comment
2124 * for the #define for WI_PRISM_DBM_OFFSET) and 149 (with no XXX comment)
2125 * for the Orinoco cards.
2127 * XXX - what about other drivers that supply Prism headers, such as
2128 * old versions of the MadWifi driver?
2131 unsigned int msgcode, msglen;
2133 struct val_80211 hosttime, mactime, channel, rssi, sq, signal,
2134 noise, rate, istx, frmlen;
2138 capture_prism(const guchar *pd, int offset, int len, packet_counts *ld)
2142 if (!BYTES_ARE_IN_FRAME(offset, len, sizeof(guint32))) {
2147 /* Some captures with DLT_PRISM have the AVS WLAN header */
2148 cookie = pntohl(pd);
2149 if ((cookie == WLANCAP_MAGIC_COOKIE_V1) ||
2150 (cookie == WLANCAP_MAGIC_COOKIE_V2)) {
2151 capture_wlancap(pd, offset, len, ld);
2156 if (!BYTES_ARE_IN_FRAME(offset, len, (int)sizeof(struct prism_hdr))) {
2160 offset += sizeof(struct prism_hdr);
2162 /* 802.11 header follows */
2163 capture_ieee80211(pd, offset, len, ld);
2167 capture_wlancap(const guchar *pd, int offset, int len, packet_counts *ld)
2171 if (!BYTES_ARE_IN_FRAME(offset, len, sizeof(guint32)*2)) {
2176 length = pntohl(pd+sizeof(guint32));
2178 if (!BYTES_ARE_IN_FRAME(offset, len, length)) {
2185 /* 802.11 header follows */
2186 capture_ieee80211(pd, offset, len, ld);
2189 /* ************************************************************************* */
2190 /* Add the subtree used to store the fixed parameters */
2191 /* ************************************************************************* */
2193 get_fixed_parameter_tree (proto_tree * tree, tvbuff_t *tvb, int start, int size)
2195 proto_item *fixed_fields;
2197 proto_tree_add_uint_format (tree, hf_fixed_parameters, tvb, start,
2198 size, size, "Fixed parameters (%d bytes)",
2201 return proto_item_add_subtree (fixed_fields, ett_fixed_parameters);
2205 /* ************************************************************************* */
2206 /* Add the subtree used to store tagged parameters */
2207 /* ************************************************************************* */
2209 get_tagged_parameter_tree (proto_tree * tree, tvbuff_t *tvb, int start, int size)
2211 proto_item *tagged_fields;
2213 tagged_fields = proto_tree_add_uint_format (tree, hf_tagged_parameters,
2218 "Tagged parameters (%d bytes)",
2221 return proto_item_add_subtree (tagged_fields, ett_tagged_parameters);
2225 /* ************************************************************************* */
2226 /* Dissect and add fixed mgmt fields to protocol tree */
2227 /* ************************************************************************* */
2229 add_fixed_field(proto_tree * tree, tvbuff_t * tvb, int offset, int lfcode)
2231 const guint8 *dataptr;
2232 char out_buff[SHORT_STR];
2234 proto_item *cap_item;
2235 static proto_tree *cap_tree;
2241 case FIELD_TIMESTAMP:
2242 dataptr = tvb_get_ptr (tvb, offset, 8);
2243 memset (out_buff, 0, SHORT_STR);
2244 g_snprintf (out_buff, SHORT_STR, "0x%02X%02X%02X%02X%02X%02X%02X%02X",
2254 proto_tree_add_string (tree, ff_timestamp, tvb, offset, 8, out_buff);
2258 case FIELD_BEACON_INTERVAL:
2260 capability = tvb_get_letohs (tvb, offset);
2261 temp_double = (double)capability;
2262 temp_double = temp_double * 1024 / 1000000;
2263 proto_tree_add_double_format (tree, ff_beacon_interval, tvb, offset, 2,
2264 temp_double,"Beacon Interval: %f [Seconds]", temp_double);
2265 if (check_col (g_pinfo->cinfo, COL_INFO)) {
2266 col_append_fstr(g_pinfo->cinfo, COL_INFO, ", BI=%d", capability);
2272 case FIELD_CAP_INFO:
2274 capability = tvb_get_letohs (tvb, offset);
2276 cap_item = proto_tree_add_uint_format (tree, ff_capture,
2277 tvb, offset, 2, capability,
2278 "Capability Information: 0x%04X", capability);
2279 cap_tree = proto_item_add_subtree (cap_item, ett_cap_tree);
2280 proto_tree_add_boolean (cap_tree, ff_cf_ess, tvb, offset, 2, capability);
2281 proto_tree_add_boolean (cap_tree, ff_cf_ibss, tvb, offset, 2, capability);
2282 if (ESS_SET (capability) != 0) /* This is an AP */
2283 proto_tree_add_uint (cap_tree, ff_cf_ap_poll, tvb, offset, 2,
2285 else /* This is a STA */
2286 proto_tree_add_uint (cap_tree, ff_cf_sta_poll, tvb, offset, 2,
2289 proto_tree_add_boolean (cap_tree, ff_cf_privacy, tvb, offset, 2,
2291 proto_tree_add_boolean (cap_tree, ff_cf_preamble, tvb, offset, 2,
2293 proto_tree_add_boolean (cap_tree, ff_cf_pbcc, tvb, offset, 2,
2295 proto_tree_add_boolean (cap_tree, ff_cf_agility, tvb, offset, 2,
2297 proto_tree_add_boolean (cap_tree, ff_cf_spec_man, tvb, offset, 2,
2299 proto_tree_add_boolean (cap_tree, ff_short_slot_time, tvb, offset, 2,
2301 proto_tree_add_boolean (cap_tree, ff_cf_apsd, tvb, offset, 2,
2303 proto_tree_add_boolean (cap_tree, ff_dsss_ofdm, tvb, offset, 2,
2305 proto_tree_add_boolean (cap_tree, ff_cf_del_blk_ack, tvb, offset, 2,
2307 proto_tree_add_boolean (cap_tree, ff_cf_imm_blk_ack, tvb, offset, 2,
2312 case FIELD_AUTH_ALG:
2313 proto_tree_add_item (tree, ff_auth_alg, tvb, offset, 2, TRUE);
2317 case FIELD_AUTH_TRANS_SEQ:
2318 proto_tree_add_item (tree, ff_auth_seq, tvb, offset, 2, TRUE);
2322 case FIELD_CURRENT_AP_ADDR:
2323 proto_tree_add_item (tree, ff_current_ap, tvb, offset, 6, FALSE);
2327 case FIELD_LISTEN_IVAL:
2328 proto_tree_add_item (tree, ff_listen_ival, tvb, offset, 2, TRUE);
2332 case FIELD_REASON_CODE:
2333 proto_tree_add_item (tree, ff_reason, tvb, offset, 2, TRUE);
2337 case FIELD_ASSOC_ID:
2338 proto_tree_add_uint(tree, ff_assoc_id, tvb, offset, 2,
2339 ASSOC_ID(tvb_get_letohs(tvb,offset)));
2340 /* proto_tree_add_item (tree, ff_assoc_id, tvb, offset, 2, TRUE); */
2344 case FIELD_STATUS_CODE:
2345 proto_tree_add_item (tree, ff_status_code, tvb, offset, 2, TRUE);
2349 case FIELD_CATEGORY_CODE:
2350 proto_tree_add_item (tree, ff_category_code, tvb, offset, 1, TRUE);
2354 case FIELD_ACTION_CODE:
2355 proto_tree_add_item (tree, ff_action_code, tvb, offset, 1, TRUE);
2359 case FIELD_DIALOG_TOKEN:
2360 proto_tree_add_item (tree, ff_dialog_token, tvb, offset, 1, TRUE);
2364 case FIELD_WME_ACTION_CODE:
2365 proto_tree_add_item (tree, ff_wme_action_code, tvb, offset, 1, TRUE);
2369 case FIELD_WME_STATUS_CODE:
2370 proto_tree_add_item (tree, ff_wme_status_code, tvb, offset, 1, TRUE);
2374 case FIELD_QOS_ACTION_CODE:
2375 proto_tree_add_item (tree, ff_qos_action_code, tvb, offset, 1, TRUE);
2379 /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/
2380 case FIELD_BLOCK_ACK_ACTION_CODE:
2381 proto_tree_add_item (tree, ff_ba_action, tvb, offset, 1, TRUE);
2384 /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/
2386 /*** Begin: Block Ack Params Fixed Field - Dustin Johnson ***/
2387 case FIELD_BLOCK_ACK_PARAM:
2390 proto_item *param_item;
2391 proto_tree *param_tree;
2393 params = tvb_get_letohs (tvb, offset);
2395 param_item = proto_tree_add_uint(tree, ff_block_ack_params, tvb, offset, 2, params);
2396 param_tree = proto_item_add_subtree (param_item, ett_ff_ba_param_tree);
2398 proto_tree_add_boolean(param_tree, ff_block_ack_params_amsdu_permitted, tvb, offset, 1, params);
2399 proto_tree_add_boolean(param_tree, ff_block_ack_params_policy, tvb, offset, 1, params);
2400 proto_tree_add_uint(param_tree, ff_block_ack_params_tid, tvb, offset, 1, params);
2401 proto_tree_add_uint(param_tree, ff_block_ack_params_buffer_size, tvb, offset, 2, params);
2405 /*** End: Block Ack Params Fixed Field - Dustin Johnson ***/
2407 /*** Begin: Block Ack Timeout Fixed Field - Dustin Johnson ***/
2408 case FIELD_BLOCK_ACK_TIMEOUT:
2412 timeout = tvb_get_letohs (tvb, offset);
2413 proto_tree_add_uint(tree, ff_block_ack_timeout, tvb, offset, 2, timeout);
2417 /*** End: Block Ack Timeout Fixed Field - Dustin Johnson ***/
2419 /*** Begin: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
2420 case FIELD_BLOCK_ACK_SSC:
2423 proto_item *ssc_item;
2424 proto_tree *ssc_tree;
2426 ssc = tvb_get_letohs (tvb, offset);
2427 ssc_item = proto_tree_add_uint(tree, ff_block_ack_ssc, tvb, offset, 2, ssc);
2428 ssc_tree = proto_item_add_subtree (ssc_item, ett_ff_ba_ssc_tree);
2429 proto_tree_add_uint(ssc_tree, ff_block_ack_ssc_fragment, tvb, offset, 1, ssc);
2430 proto_tree_add_uint(ssc_tree, ff_block_ack_ssc_sequence, tvb, offset, 2, ssc);
2434 /*** End: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
2436 case FIELD_QOS_TS_INFO:
2438 proto_item *tsinfo_item;
2439 proto_tree *tsinfo_tree;
2442 tsinfo_item = proto_tree_add_item(tree, hf_ts_info, tvb,
2444 tsinfo_tree = proto_item_add_subtree(tsinfo_item, ett_tsinfo_tree);
2445 tsi = tvb_get_letoh24(tvb, offset);
2446 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_type, tvb,
2447 offset, 3, TSI_TYPE (tsi));
2448 if (TSI_TSID (tsi) < 8)
2450 proto_tree_add_text(tsinfo_tree, tvb, offset, 3,
2451 "TSID: %u (< 8 is invalid)", TSI_TSID (tsi));
2455 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_tsid, tvb,
2456 offset, 3, TSI_TSID (tsi));
2458 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_dir, tvb,
2459 offset, 3, TSI_DIR (tsi));
2460 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_access, tvb,
2461 offset, 3, TSI_ACCESS (tsi));
2462 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_agg, tvb,
2463 offset, 3, TSI_AGG (tsi));
2464 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_apsd, tvb,
2465 offset, 3, TSI_APSD (tsi));
2466 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_up, tvb,
2467 offset, 3, TSI_UP (tsi));
2468 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_ack, tvb,
2469 offset, 3, TSI_ACK (tsi));
2470 proto_tree_add_uint(tsinfo_tree, hf_tsinfo_sched, tvb,
2471 offset, 3, TSI_SCHED (tsi));
2476 case FIELD_DLS_ACTION_CODE:
2477 proto_tree_add_item (tree, ff_dls_action_code, tvb, offset, 1, TRUE);
2481 case FIELD_DST_MAC_ADDR:
2482 proto_tree_add_item (tree, ff_dst_mac_addr, tvb, offset, 6, TRUE);
2486 case FIELD_SRC_MAC_ADDR:
2487 proto_tree_add_item (tree, ff_src_mac_addr, tvb, offset, 6, TRUE);
2491 case FIELD_DLS_TIMEOUT:
2492 proto_tree_add_item (tree, ff_dls_timeout, tvb, offset, 2, TRUE);
2496 /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
2497 case FIELD_DELBA_PARAM_SET:
2500 proto_item *param_item;
2501 proto_tree *param_tree;
2503 params = tvb_get_letohs (tvb, offset);
2505 param_item = proto_tree_add_uint(tree, ff_delba_param, tvb, offset, 2, params);
2506 param_tree = proto_item_add_subtree (param_item, ett_ff_ba_param_tree);
2508 proto_tree_add_uint(param_tree, ff_delba_param_reserved, tvb, offset, 2, params);
2509 proto_tree_add_boolean(param_tree, ff_delba_param_init, tvb, offset+1, 1, params);
2510 proto_tree_add_uint(param_tree, ff_delba_param_tid, tvb, offset+1, 1, params);
2514 /*** End: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
2516 /*** Begin: Max Regulation Power Fixed Field - Dustin Johnson ***/
2517 case FIELD_MAX_REG_PWR:
2518 proto_tree_add_uint(tree, ff_max_reg_pwr, tvb, offset, 2, tvb_get_letohs (tvb, offset));
2521 /*** End: Max Regulation Power Fixed Field - Dustin Johnson ***/
2523 /*** Begin: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
2524 case FIELD_MEASUREMENT_PILOT_INT:
2525 proto_tree_add_uint(tree, ff_measurement_pilot_int, tvb, offset, 2, tvb_get_letohs (tvb, offset));
2528 /*** End: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
2530 /*** Begin: Country String Fixed Field - Dustin Johnson ***/
2531 case FIELD_COUNTRY_STR:
2533 guint8 *country_string;
2535 country_string = tvb_get_ephemeral_string(tvb, offset, 3);
2536 proto_tree_add_string (tree, ff_country_str, tvb, offset, 3, (char *) country_string);
2539 /*** End: Country String Fixed Field - Dustin Johnson ***/
2541 /*** Begin: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
2542 case FIELD_MAX_TX_PWR:
2543 proto_tree_add_uint(tree, ff_max_tx_pwr, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
2546 /*** End: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
2548 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
2549 case FIELD_TX_PWR_USED:
2550 proto_tree_add_uint(tree, ff_tx_pwr_used, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
2553 /*** End: Transmit Power Used Fixed Field - Dustin Johnson ***/
2555 /*** Begin: Transceiver Noise Floor Fixed Field - Dustin Johnson ***/
2556 case FIELD_TRANSCEIVER_NOISE_FLOOR:
2557 proto_tree_add_uint(tree, ff_transceiver_noise_floor, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
2560 /*** End: Transceiver Noise Floor Fixed Field - Dustin Johnson ***/
2562 /*** Begin: Channel Width Fixed Field - Dustin Johnson ***/
2563 case FIELD_CHANNEL_WIDTH:
2564 proto_tree_add_item(tree, ff_channel_width, tvb, offset, 1, TRUE);
2567 /*** End: Channel Width Fixed Field - Dustin Johnson ***/
2569 /*** Begin: QoS Inforamtion AP Fixed Field - Dustin Johnson ***/
2570 case FIELD_QOS_INFO_AP:
2573 proto_item *info_item;
2574 proto_tree *info_tree;
2576 info = tvb_get_guint8 (tvb, offset);
2578 info_item = proto_tree_add_uint(tree, ff_qos_info_ap, tvb, offset, 1, info);
2579 info_tree = proto_item_add_subtree (info_item, ett_ff_qos_info);
2581 proto_tree_add_uint(info_tree, ff_qos_info_ap_edca_param_set_counter, tvb, offset, 1, info);
2582 proto_tree_add_uint(info_tree, ff_qos_info_ap_q_ack, tvb, offset, 1, info);
2583 proto_tree_add_boolean(info_tree, ff_qos_info_ap_queue_req, tvb, offset, 1, info);
2584 proto_tree_add_boolean(info_tree, ff_qos_info_ap_txop_request, tvb, offset, 1, info);
2585 proto_tree_add_boolean(info_tree, ff_qos_info_ap_reserved, tvb, offset, 1, info);
2589 /*** End: QoS Inforamtion AP Fixed Field - Dustin Johnson ***/
2591 /*** Begin: QoS Inforamtion STA Fixed Field - Dustin Johnson ***/
2592 case FIELD_QOS_INFO_STA:
2595 proto_item *info_item;
2596 proto_tree *info_tree;
2598 info = tvb_get_guint8 (tvb, offset);
2600 info_item = proto_tree_add_uint(tree, ff_qos_info_sta, tvb, offset, 1, info);
2601 info_tree = proto_item_add_subtree (info_item, ett_ff_qos_info);
2603 proto_tree_add_boolean(info_tree, ff_qos_info_sta_ac_vo, tvb, offset, 1, info);
2604 proto_tree_add_boolean(info_tree, ff_qos_info_sta_ac_vi, tvb, offset, 1, info);
2605 proto_tree_add_boolean(info_tree, ff_qos_info_sta_ac_bk, tvb, offset, 1, info);
2606 proto_tree_add_boolean(info_tree, ff_qos_info_sta_ac_be, tvb, offset, 1, info);
2607 proto_tree_add_boolean(info_tree, ff_qos_info_sta_q_ack, tvb, offset, 1, info);
2608 proto_tree_add_uint(info_tree, ff_qos_info_sta_max_sp_len, tvb, offset, 1, info);
2609 proto_tree_add_boolean(info_tree, ff_qos_info_sta_more_data_ack, tvb, offset, 1, info);
2614 /*** End: QoS Inforamtion STA Fixed Field - Dustin Johnson ***/
2616 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
2617 case FIELD_SM_PWR_CNTRL:
2620 proto_item *info_item;
2621 proto_tree *info_tree;
2623 info = tvb_get_guint8 (tvb, offset);
2625 info_item = proto_tree_add_uint(tree, ff_sm_pwr_save, tvb, offset, 1, info);
2626 info_tree = proto_item_add_subtree (info_item, ett_ff_sm_pwr_save);
2628 proto_tree_add_boolean(info_tree, ff_sm_pwr_save_enabled, tvb, offset, 1, info);
2629 proto_tree_add_boolean(info_tree, ff_sm_pwr_save_sm_mode, tvb, offset, 1, info);
2630 proto_tree_add_uint(info_tree, ff_sm_pwr_save_reserved, tvb, offset, 1, info);
2634 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
2636 /*** Begin: PCO Phase Control Fixed Field - Dustin Johnson ***/
2637 case FIELD_PCO_PHASE_CNTRL:
2638 proto_tree_add_item(tree, ff_pco_phase_cntrl, tvb, offset, 1, TRUE);
2641 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
2643 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
2644 case FIELD_PSMP_PARAM_SET:
2647 proto_item *param_item;
2648 proto_tree *param_tree;
2650 params = tvb_get_letohs (tvb, offset);
2652 param_item = proto_tree_add_uint(tree, ff_psmp_param_set, tvb, offset, 2, params);
2653 param_tree = proto_item_add_subtree (param_item, ett_ff_psmp_param_set);
2655 proto_tree_add_uint(param_tree, ff_psmp_param_set_n_sta, tvb, offset, 1, params & 0x000F);
2656 proto_tree_add_boolean(param_tree, ff_psmp_param_set_more_psmp, tvb, offset, 1, (params & 0x0010) >> 4);
2657 proto_tree_add_uint_format(param_tree, ff_psmp_param_set_psmp_sequence_duration, tvb, offset, 2,
2658 (params & 0xFFE0) >> 5, "PSMP Sequence Duration: %u [us]", ((params & 0xFFE0) >> 5) * 8);
2662 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
2664 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
2665 case FIELD_MIMO_CNTRL:
2669 proto_item *mimo_item;
2670 proto_tree *mimo_tree;
2672 mimo = tvb_get_letohs (tvb, offset);
2674 mimo_item = proto_tree_add_text(tree, tvb, offset, 2, "MIMO Control");
2675 mimo_tree = proto_item_add_subtree (mimo_item, ett_ff_mimo_cntrl);
2677 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_nc_index, tvb, offset, 1, mimo);
2678 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_nr_index, tvb, offset, 1, mimo);
2679 proto_tree_add_boolean(mimo_tree, ff_mimo_cntrl_channel_width, tvb, offset, 1, mimo);
2680 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_grouping, tvb, offset, 1, mimo);
2681 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_coefficient_size, tvb, offset, 2, mimo);
2682 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_codebook_info, tvb, offset+1, 1, mimo);
2683 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_remaining_matrix_segment, tvb, offset+1, 1, mimo);
2684 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_reserved, tvb, offset+1, 1, mimo);
2687 time = tvb_get_letohl (tvb, offset);
2688 proto_tree_add_uint(mimo_tree, ff_mimo_cntrl_sounding_timestamp, tvb, offset, 4, time);
2692 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
2694 /*** Begin: Antenna Selection Fixed Field - Dustin Johnson ***/
2695 case FIELD_ANT_SELECTION:
2698 proto_item *ant_item;
2699 proto_tree *ant_tree;
2701 ant = tvb_get_guint8 (tvb, offset);
2703 ant_item = proto_tree_add_uint(tree, ff_ant_selection, tvb, offset, 1, ant);
2704 ant_tree = proto_item_add_subtree (ant_item, ett_ff_ant_sel);
2706 proto_tree_add_uint(ant_tree, ff_ant_selection_0, tvb, offset, 1, ant);
2707 proto_tree_add_uint(ant_tree, ff_ant_selection_1, tvb, offset, 1, ant);
2708 proto_tree_add_uint(ant_tree, ff_ant_selection_2, tvb, offset, 1, ant);
2709 proto_tree_add_uint(ant_tree, ff_ant_selection_3, tvb, offset, 1, ant);
2710 proto_tree_add_uint(ant_tree, ff_ant_selection_4, tvb, offset, 1, ant);
2711 proto_tree_add_uint(ant_tree, ff_ant_selection_5, tvb, offset, 1, ant);
2712 proto_tree_add_uint(ant_tree, ff_ant_selection_6, tvb, offset, 1, ant);
2713 proto_tree_add_uint(ant_tree, ff_ant_selection_7, tvb, offset, 1, ant);
2718 /*** End: Antenna Selection Fixed Field - Dustin Johnson ***/
2720 /*** Begin: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
2721 case FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT:
2724 proto_item *chan_item;
2725 proto_tree *chan_tree;
2727 ext_chan = tvb_get_letohl (tvb, offset);
2729 chan_item = proto_tree_add_uint(tree, ff_ext_channel_switch_announcement, tvb, offset, 1, ext_chan);
2730 chan_tree = proto_item_add_subtree (chan_item, ett_ff_chan_switch_announce);
2732 proto_tree_add_uint(chan_tree, hf_tag_ext_channel_switch_announcement_switch_mode, tvb, offset++, 1, (ext_chan & 0x000000FF));
2733 proto_tree_add_uint(chan_tree, hf_tag_ext_channel_switch_announcement_new_reg_class, tvb, offset++, 1, (ext_chan & 0x0000FF00) >> 8);
2734 proto_tree_add_uint(chan_tree, hf_tag_ext_channel_switch_announcement_new_chan_number, tvb, offset++, 1, (ext_chan & 0x00FF0000) >> 16);
2735 proto_tree_add_uint(chan_tree, hf_tag_ext_channel_switch_announcement_switch_count, tvb, offset++, 1, (ext_chan & 0xFF000000) >> 24);
2739 /*** End: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
2741 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
2742 case FIELD_HT_INFORMATION:
2745 proto_item *ht_item;
2746 proto_tree *ht_tree;
2748 info = tvb_get_guint8 (tvb, offset);
2750 ht_item = proto_tree_add_uint(tree, ff_ht_info, tvb, offset, 1, info);
2751 ht_tree = proto_item_add_subtree (ht_item, ett_ff_ht_info);
2753 proto_tree_add_boolean(ht_tree, ff_ht_info_information_request, tvb, offset, 1, info);
2754 proto_tree_add_boolean(ht_tree, ff_ht_info_40_mhz_intolerant, tvb, offset, 1, info);
2755 proto_tree_add_boolean(ht_tree, ff_ht_info_sta_chan_width, tvb, offset, 1, info);
2756 proto_tree_add_uint(ht_tree, ff_ht_info_reserved, tvb, offset, 1, info);
2760 /*** End: HT Information Fixed Field - Dustin Johnson ***/
2762 /*** Begin: HT Action Fixed Field - Dustin Johnson ***/
2763 case FIELD_HT_ACTION_CODE:
2764 proto_tree_add_uint(tree, ff_ht_action, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
2767 /*** End: HT Action Fixed Field - Dustin Johnson ***/
2769 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
2770 case FIELD_PSMP_STA_INFO:
2774 #define INDIVIDUALLY_ADDRESSED 2
2777 guint32 info_medium;
2780 proto_item *psmp_item;
2781 proto_tree *psmp_tree;
2783 info_medium = tvb_get_letohl (tvb, offset);
2784 type = info_medium & 0x3;
2786 psmp_item = proto_tree_add_uint(tree, ff_psmp_sta_info, tvb, offset, 8, type);
2787 psmp_tree = proto_item_add_subtree (psmp_item, ett_ff_psmp_sta_info);
2793 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_start_offset, tvb, offset, 2, (info_medium & 0x00001FFC) >> 2);
2794 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_duration, tvb, offset+1, 2, (info_medium & 0x001FE000) >> 13);
2795 info_large = tvb_get_letoh64 (tvb, offset);
2796 proto_tree_add_uint64(psmp_tree, ff_psmp_sta_info_reserved_large, tvb, offset, 6, (info_large & G_GINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
2802 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_start_offset, tvb, offset, 2, (info_medium & 0x00001FFC) >> 2);
2803 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_duration, tvb, offset+1, 2, (info_medium & 0x001FE000) >> 13);
2804 info_large = tvb_get_letoh64 (tvb, offset);
2805 proto_tree_add_uint64(psmp_tree, ff_psmp_sta_info_psmp_multicast_id, tvb, offset, 6, (info_large & G_GINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
2809 case INDIVIDUALLY_ADDRESSED:
2811 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_start_offset, tvb, offset, 2, (info_medium & 0x00001FFC) >> 2);
2812 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_dtt_duration, tvb, offset+1, 2, (info_medium & 0x001FE000) >> 13);
2814 info_medium = tvb_get_letohl (tvb, offset);
2815 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_sta_id, tvb, offset, 3, (info_medium & 0x001FFFE0) >> 5);
2816 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_utt_start_offset, tvb, offset+2, 2, (info_medium & 0xFFE00000) >> 21);
2818 info_small = tvb_get_letohs (tvb, offset);
2819 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_utt_duration, tvb, offset, 2, info_small & 0x03FF);
2820 proto_tree_add_uint(psmp_tree, ff_psmp_sta_info_reserved_small, tvb, offset+1, 1, (info_small & 0xFC00) >> 10);
2827 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
2829 case FIELD_SCHEDULE_INFO:
2831 proto_item *sched_item;
2832 proto_tree *sched_tree;
2835 sched_item = proto_tree_add_item(tree, hf_sched_info,
2836 tvb, offset, 2, TRUE);
2837 sched_tree = proto_item_add_subtree(sched_item, ett_sched_tree);
2838 sched = tvb_get_letohs(tvb, offset);
2839 proto_tree_add_uint(sched_tree, hf_tsinfo_agg, tvb, offset,
2843 proto_tree_add_uint(sched_tree, hf_tsinfo_tsid, tvb, offset,
2844 2, (sched & 0x001E) >> 1);
2845 proto_tree_add_uint(sched_tree, hf_tsinfo_dir, tvb, offset,
2846 2, (sched & 0x0060) >> 5);
2855 proto_item *action_item;
2856 proto_tree *action_tree;
2858 action_item = proto_tree_add_item(tree, hf_action, tvb, offset, 1, TRUE);
2859 action_tree = proto_item_add_subtree(action_item, ett_sched_tree);
2861 switch (tvb_get_guint8(tvb, offset))
2863 case CAT_SPECTRUM_MGMT:
2865 switch (tvb_get_guint8(tvb, offset+1))
2867 case SM_ACTION_MEASUREMENT_REQUEST:
2868 case SM_ACTION_MEASUREMENT_REPORT:
2869 case SM_ACTION_TPC_REQUEST:
2870 case SM_ACTION_TPC_REPORT:
2871 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2872 add_fixed_field(action_tree, tvb, offset+1, FIELD_ACTION_CODE);
2873 add_fixed_field(action_tree, tvb, offset+2, FIELD_DIALOG_TOKEN);
2874 length += 3; /* Size of fixed fields */
2877 case SM_ACTION_CHAN_SWITCH_ANNC:
2878 case SM_ACTION_EXT_CHAN_SWITCH_ANNC:
2879 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2880 add_fixed_field(action_tree, tvb, offset+1, FIELD_ACTION_CODE);
2881 length += 2; /* Size of fixed fields */
2885 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2886 add_fixed_field(action_tree, tvb, offset+1, FIELD_ACTION_CODE);
2887 length += 2; /* Size of fixed fields */
2895 switch (tvb_get_guint8(tvb, offset+1))
2897 case SM_ACTION_ADDTS_REQUEST:
2898 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2899 add_fixed_field(action_tree, tvb, offset+1, FIELD_QOS_ACTION_CODE);
2900 add_fixed_field(action_tree, tvb, offset+2, FIELD_DIALOG_TOKEN);
2904 case SM_ACTION_ADDTS_RESPONSE:
2905 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2906 add_fixed_field(action_tree, tvb, offset+1, FIELD_QOS_ACTION_CODE);
2907 add_fixed_field(action_tree, tvb, offset+2, FIELD_DIALOG_TOKEN);
2908 add_fixed_field(action_tree, tvb, offset+3, FIELD_STATUS_CODE);
2912 case SM_ACTION_DELTS:
2913 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2914 add_fixed_field(action_tree, tvb, offset+1, FIELD_QOS_ACTION_CODE);
2915 add_fixed_field(action_tree, tvb, offset+2, FIELD_QOS_TS_INFO);
2916 add_fixed_field(action_tree, tvb, offset+5, FIELD_REASON_CODE);
2920 case SM_ACTION_QOS_SCHEDULE:
2921 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2922 add_fixed_field(action_tree, tvb, offset+1, FIELD_QOS_ACTION_CODE);
2927 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2928 length += 2; /* Size of fixed fields */
2936 switch (tvb_get_guint8(tvb, offset+1))
2938 case SM_ACTION_DLS_REQUEST:
2939 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2940 add_fixed_field(action_tree, tvb, offset+1, FIELD_DLS_ACTION_CODE);
2941 add_fixed_field(action_tree, tvb, offset+2, FIELD_DST_MAC_ADDR);
2942 add_fixed_field(action_tree, tvb, offset+8, FIELD_SRC_MAC_ADDR);
2943 add_fixed_field(action_tree, tvb, offset+14, FIELD_CAP_INFO);
2944 add_fixed_field(action_tree, tvb, offset+16, FIELD_DLS_TIMEOUT);
2948 case SM_ACTION_DLS_RESPONSE:
2949 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2950 add_fixed_field(action_tree, tvb, offset+1, FIELD_DLS_ACTION_CODE);
2951 add_fixed_field(action_tree, tvb, offset+2, FIELD_STATUS_CODE);
2952 add_fixed_field(action_tree, tvb, offset+4, FIELD_DST_MAC_ADDR);
2953 add_fixed_field(action_tree, tvb, offset+10, FIELD_SRC_MAC_ADDR);
2955 if (!ff_status_code)
2956 add_fixed_field(action_tree, tvb, offset+16, FIELD_CAP_INFO);
2959 case SM_ACTION_DLS_TEARDOWN:
2960 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2961 add_fixed_field(action_tree, tvb, offset+1, FIELD_DLS_ACTION_CODE);
2962 add_fixed_field(action_tree, tvb, offset+2, FIELD_DST_MAC_ADDR);
2963 add_fixed_field(action_tree, tvb, offset+8, FIELD_SRC_MAC_ADDR);
2964 add_fixed_field(action_tree, tvb, offset+14, FIELD_REASON_CODE);
2969 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2970 length += 2; /* Size of fixed fields */
2978 switch (tvb_get_guint8(tvb, offset+1))
2980 case BA_ADD_BLOCK_ACK_REQUEST:
2985 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
2986 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_ACTION_CODE);
2987 offset += add_fixed_field(action_tree, tvb, offset, FIELD_DIALOG_TOKEN);
2988 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_PARAM);
2989 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_TIMEOUT);
2990 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
2991 length = offset - start; /* Size of fixed fields */
2994 case BA_ADD_BLOCK_ACK_RESPONSE:
2999 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3000 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_ACTION_CODE);
3001 offset += add_fixed_field(action_tree, tvb, offset, FIELD_DIALOG_TOKEN);
3002 offset += add_fixed_field(action_tree, tvb, offset, FIELD_STATUS_CODE);
3003 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_PARAM);
3004 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_TIMEOUT);
3005 length = offset - start; /* Size of fixed fields */
3008 case BA_DELETE_BLOCK_ACK:
3013 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3014 offset += add_fixed_field(action_tree, tvb, offset, FIELD_BLOCK_ACK_ACTION_CODE);
3015 offset += add_fixed_field(action_tree, tvb, offset, FIELD_DELBA_PARAM_SET);
3016 offset += add_fixed_field(action_tree, tvb, offset, FIELD_REASON_CODE);
3017 length = offset - start; /* Size of fixed fields */
3024 case CAT_MGMT_NOTIFICATION: /* Management notification frame */
3029 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3030 offset += add_fixed_field(action_tree, tvb, offset, FIELD_WME_ACTION_CODE);
3031 offset += add_fixed_field(action_tree, tvb, offset, FIELD_DIALOG_TOKEN);
3032 offset += add_fixed_field(action_tree, tvb, offset, FIELD_WME_STATUS_CODE);
3033 length = offset - start; /* Size of fixed fields */
3037 case CAT_VENDOR_SPECIFIC:/* Vendor Specific Category */
3041 const guint8 *tag_data_ptr;
3046 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3047 oui = tvb_get_ntoh24(tvb, offset);
3048 tag_data_ptr = tvb_get_ptr(tvb, offset, 3);
3049 proto_tree_add_bytes_format (action_tree, tag_oui, tvb, offset, 3,
3050 tag_data_ptr, "Vendor: %s", get_manuf_name(tag_data_ptr));
3054 octet = tvb_get_guint8(tvb, offset);
3055 proto_tree_add_item (action_tree, ff_marvell_action_type, tvb, offset, 1, TRUE);
3058 case MRVL_ACTION_MESH_MANAGEMENT:
3059 octet = tvb_get_guint8(tvb, offset);
3060 proto_tree_add_item (action_tree, ff_marvell_mesh_mgt_action_code, tvb, offset, 1, TRUE);
3063 case MRVL_MESH_MGMT_ACTION_RREQ:
3064 proto_tree_add_item (action_tree, ff_mesh_mgt_length, tvb, offset, 1, TRUE);
3066 proto_tree_add_item (action_tree, ff_mesh_mgt_mode, tvb, offset, 1, TRUE);
3068 proto_tree_add_item (tree, ff_mesh_mgt_hopcount, tvb, offset, 1, TRUE);
3070 proto_tree_add_item (tree, ff_mesh_mgt_ttl, tvb, offset, 1, TRUE);
3072 proto_tree_add_item (tree, ff_mesh_mgt_rreqid, tvb, offset, 4, TRUE);
3074 proto_tree_add_item (tree, ff_mesh_mgt_sa, tvb, offset, 6, FALSE);
3076 proto_tree_add_item (tree, ff_mesh_mgt_ssn, tvb, offset, 4, TRUE);
3078 proto_tree_add_item (tree, ff_mesh_mgt_lifetime, tvb, offset, 4, TRUE);
3080 proto_tree_add_item (tree, ff_mesh_mgt_metric, tvb, offset, 4, TRUE);
3082 proto_tree_add_item (tree, ff_mesh_mgt_dstcount, tvb, offset, 1, TRUE);
3084 proto_tree_add_item (tree, ff_mesh_mgt_flags, tvb, offset, 1, TRUE);
3086 proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset, 6, FALSE);
3088 proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset, 4, TRUE);
3090 length = offset - start; /* Size of fixed fields */
3092 case MRVL_MESH_MGMT_ACTION_RREP:
3093 proto_tree_add_item (tree, ff_mesh_mgt_length, tvb, offset, 1, TRUE);
3095 proto_tree_add_item (tree, ff_mesh_mgt_mode, tvb, offset, 1, TRUE);
3097 proto_tree_add_item (tree, ff_mesh_mgt_hopcount, tvb, offset, 1, TRUE);
3099 proto_tree_add_item (tree, ff_mesh_mgt_ttl, tvb, offset, 1, TRUE);
3101 proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset, 6, FALSE);
3103 proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset, 4, TRUE);
3105 proto_tree_add_item (tree, ff_mesh_mgt_lifetime, tvb, offset, 4, TRUE);
3107 proto_tree_add_item (tree, ff_mesh_mgt_metric, tvb, offset, 4, TRUE);
3109 proto_tree_add_item (tree, ff_mesh_mgt_sa, tvb, offset, 6, FALSE);
3111 proto_tree_add_item (tree, ff_mesh_mgt_ssn, tvb, offset, 4, TRUE);
3113 length = offset - start; /* Size of fixed fields */
3115 case MRVL_MESH_MGMT_ACTION_RERR:
3116 proto_tree_add_item (tree, ff_mesh_mgt_length, tvb, offset, 1, TRUE);
3118 proto_tree_add_item (tree, ff_mesh_mgt_mode, tvb, offset, 1, TRUE);
3120 proto_tree_add_item (tree, ff_mesh_mgt_dstcount, tvb, offset, 1, TRUE);
3122 proto_tree_add_item (tree, ff_mesh_mgt_da, tvb, offset, 6, FALSE);
3124 proto_tree_add_item (tree, ff_mesh_mgt_dsn, tvb, offset, 4, TRUE);
3126 length = offset - start; /* Size of fixed fields */
3137 /* Don't know how to handle this vendor */
3141 }/* Case vendor specific */
3148 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3149 offset += add_fixed_field(action_tree, tvb, offset, FIELD_HT_ACTION_CODE);
3150 switch (tvb_get_guint8(tvb, offset-1))
3152 case HT_ACTION_NOTIFY_CHAN_WIDTH:
3153 offset += add_fixed_field(action_tree, tvb, offset, FIELD_CHANNEL_WIDTH);
3156 case HT_ACTION_SM_PWR_SAVE:
3157 offset += add_fixed_field(action_tree, tvb, offset, FIELD_SM_PWR_CNTRL);
3160 case HT_ACTION_PSMP_ACTION:
3164 n_sta = tvb_get_guint8(tvb, offset);
3165 offset += add_fixed_field(action_tree, tvb, offset, FIELD_PSMP_PARAM_SET);
3167 for (i=0; i< (n_sta & 0x0F); i++)
3168 offset += add_fixed_field(action_tree, tvb, offset, FIELD_PSMP_STA_INFO);
3173 case HT_ACTION_SET_PCO_PHASE:
3174 offset += add_fixed_field(action_tree, tvb, offset, FIELD_PCO_PHASE_CNTRL);
3177 case HT_ACTION_MIMO_CSI:
3179 mimo_control_t mimo_cntrl;
3180 mimo_cntrl = get_mimo_control (tvb, offset);
3181 offset += add_fixed_field(action_tree, tvb, offset, FIELD_MIMO_CNTRL);
3182 offset += add_mimo_csi_matrices_report (action_tree, tvb, offset, mimo_cntrl);
3186 case HT_ACTION_MIMO_BEAMFORMING:
3188 mimo_control_t mimo_cntrl;
3189 mimo_cntrl = get_mimo_control (tvb, offset);
3190 offset += add_fixed_field(action_tree, tvb, offset, FIELD_MIMO_CNTRL);
3191 offset += add_mimo_beamforming_feedback_report (action_tree, tvb, offset, mimo_cntrl);
3195 case HT_ACTION_MIMO_COMPRESSED_BEAMFORMING:
3197 mimo_control_t mimo_cntrl;
3198 mimo_cntrl = get_mimo_control (tvb, offset);
3199 offset += add_fixed_field(action_tree, tvb, offset, FIELD_MIMO_CNTRL);
3200 offset += add_mimo_compressed_beamforming_feedback_report (action_tree, tvb, offset, mimo_cntrl);
3204 case HT_ACTION_ANT_SEL_FEEDBACK:
3205 offset += add_fixed_field(action_tree, tvb, offset, FIELD_ANT_SELECTION);
3208 case HT_ACTION_HT_INFO_EXCHANGE:
3209 offset += add_fixed_field(action_tree, tvb, offset, FIELD_HT_INFORMATION);
3216 length = offset - start;
3221 add_fixed_field(action_tree, tvb, offset, FIELD_CATEGORY_CODE);
3222 length += 1; /* Size of fixed fields */
3230 static const value_string wpa_cipher_vals[] =
3233 {1, "WEP (40-bit)"},
3237 {5, "WEP (104-bit)"},
3241 static const value_string wpa_keymgmt_vals[] =
3251 dissect_vendor_ie_wpawme(proto_item * item, proto_tree * tree, tvbuff_t * tag_tvb)
3254 gint tag_len = tvb_length(tag_tvb);
3255 gchar out_buff[SHORT_STR];
3256 guint i, byte1, byte2;
3258 /* Wi-Fi Protected Access (WPA) Information Element */
3259 if (tag_off + 6 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WPA_OUI"\x01", 4)) {
3260 g_snprintf(out_buff, SHORT_STR, "WPA IE, type %u, version %u",
3261 tvb_get_guint8(tag_tvb, tag_off + 3), tvb_get_letohs(tag_tvb, tag_off + 4));
3262 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 6, out_buff);
3264 if (tag_off + 4 <= tag_len) {
3265 /* multicast cipher suite */
3266 if (!tvb_memeql(tag_tvb, tag_off, WPA_OUI, 3)) {
3267 g_snprintf(out_buff, SHORT_STR, "Multicast cipher suite: %s",
3268 val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3), wpa_cipher_vals,
3270 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3273 /* unicast cipher suites */
3274 if (tag_off + 2 <= tag_len) {
3275 g_snprintf(out_buff, SHORT_STR,
3276 "# of unicast cipher suites: %u", tvb_get_letohs(tag_tvb, tag_off));
3277 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3281 while (tag_off + 4 <= tag_len) {
3282 if (!tvb_memeql(tag_tvb, tag_off, WPA_OUI, 3)) {
3283 g_snprintf(out_buff, SHORT_STR,
3284 "Unicast cipher suite %u: %s", i,
3285 val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3286 wpa_cipher_vals, "UNKNOWN"));
3287 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3295 /* authenticated key management suites */
3296 if (tag_off + 2 <= tag_len) {
3297 g_snprintf(out_buff, SHORT_STR,
3298 "# of auth key management suites: %u", tvb_get_letohs(tag_tvb, tag_off));
3299 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3303 while (tag_off + 4 <= tag_len) {
3304 if (!tvb_memeql(tag_tvb, tag_off, WPA_OUI, 3)) {
3305 g_snprintf(out_buff, SHORT_STR,
3306 "auth key management suite %u: %s", i,
3307 val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3308 wpa_keymgmt_vals, "UNKNOWN"));
3309 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3321 if (tag_off < tag_len)
3322 proto_tree_add_string(tree, tag_interpretation, tag_tvb,
3323 tag_off, tag_len - tag_off, "Not interpreted");
3324 proto_item_append_text(item, ": WPA");
3325 } else if (tag_off + 7 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WME_OUI"\x02\x00", 5)) {
3326 /* Wireless Multimedia Enhancements (WME) Information Element */
3327 g_snprintf(out_buff, SHORT_STR,
3328 "WME IE: type %u, subtype %u, version %u, parameter set %u",
3329 tvb_get_guint8(tag_tvb, tag_off+3), tvb_get_guint8(tag_tvb, tag_off+4),
3330 tvb_get_guint8(tag_tvb, tag_off+5), tvb_get_guint8(tag_tvb, tag_off+6));
3331 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 7,
3333 proto_item_append_text(item, ": WME");
3334 } else if (tag_off + 24 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WME_OUI"\x02\x01", 5)) {
3335 /* Wireless Multimedia Enhancements (WME) Parameter Element */
3336 g_snprintf(out_buff, SHORT_STR,
3337 "WME PE: type %u, subtype %u, version %u, parameter set %u",
3338 tvb_get_guint8(tag_tvb, tag_off+3), tvb_get_guint8(tag_tvb, tag_off+4),
3339 tvb_get_guint8(tag_tvb, tag_off+5), tvb_get_guint8(tag_tvb, tag_off+6));
3340 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 7,
3343 for (i = 0; i < 4; i++) {
3344 byte1 = tvb_get_guint8(tag_tvb, tag_off);
3345 byte2 = tvb_get_guint8(tag_tvb, tag_off + 1);
3346 g_snprintf(out_buff, SHORT_STR,
3347 "WME AC Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
3348 (byte1 & 0x60) >> 5, wme_acs[(byte1 & 0x60) >> 5],
3349 (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
3350 byte2 & 0x0f, byte2 & 0xf0 >> 4,
3351 tvb_get_letohs(tag_tvb, tag_off + 2));
3352 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3356 proto_item_append_text(item, ": WME");
3357 } else if (tag_off + 56 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WME_OUI"\x02\x02", 5)) {
3358 /* Wireless Multimedia Enhancements (WME) TSPEC Element */
3359 guint16 ts_info, msdu_size, surplus_bandwidth;
3360 const char *direction[] = { "Uplink", "Downlink", "Reserved", "Bi-directional" };
3361 const value_string fields[] = {
3362 {13, "Minimum Service Interval"},
3363 {17, "Maximum Service Interval"},
3364 {21, "Inactivity Interval"},
3365 {25, "Suspension Interval"},
3366 {29, "Service Start Time"},
3367 {33, "Minimum Data Rate"},
3368 {37, "Mean Data Rate"},
3369 {41, "Peak Data Rate"},
3370 {45, "Maximum Burst Size"},
3371 {49, "Delay Bound"},
3372 {53, "Minimum PHY Rate"},
3377 g_snprintf(out_buff, SHORT_STR,
3378 "WME TSPEC: type %u, subtype %u, version %u",
3379 tvb_get_guint8(tag_tvb, tag_off+3), tvb_get_guint8(tag_tvb, tag_off+4),
3380 tvb_get_guint8(tag_tvb, tag_off+5));
3381 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 6,
3385 ts_info = tvb_get_letohs(tag_tvb, tag_off);
3386 byte1 = (ts_info >> 11) & 0x7;
3387 g_snprintf(out_buff, SHORT_STR,
3388 "WME TS Info: Priority %u (%s) (%s), Contention-based access %sset, %s",
3389 byte1, qos_tags[byte1], qos_acs[byte1],
3390 (ts_info & 0x0080) ? "" : "not ",
3391 direction[(ts_info >> 5) & 0x3]);
3392 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 3,
3396 msdu_size = tvb_get_letohs(tag_tvb, tag_off);
3397 g_snprintf(out_buff, SHORT_STR,
3398 "WME TSPEC: %s MSDU Size %u",
3399 (msdu_size & 0x8000) ? "Fixed" : "Nominal", msdu_size & 0x7fff);
3400 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3404 g_snprintf(out_buff, SHORT_STR,
3405 "WME TSPEC: Maximum MSDU Size %u", tvb_get_letohs(tag_tvb, tag_off));
3406 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3410 while ((field = val_to_str(tag_off, fields, "Unknown"))) {
3411 g_snprintf(out_buff, SHORT_STR,
3412 "WME TSPEC: %s %u", field, tvb_get_letohl(tag_tvb, tag_off));
3413 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4,
3420 surplus_bandwidth = tvb_get_letohs(tag_tvb, tag_off);
3421 g_snprintf(out_buff, SHORT_STR,
3422 "WME TSPEC: Surplus Bandwidth Allowance Factor %u.%u",
3423 (surplus_bandwidth >> 13) & 0x7, (surplus_bandwidth & 0x1fff));
3424 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3428 g_snprintf(out_buff, SHORT_STR,
3429 "WME TSPEC: Medium Time %u", tvb_get_letohs(tag_tvb, tag_off));
3430 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2,
3433 proto_item_append_text(item, ": WME");
3434 } else if (tag_off + 6 <= tag_len && !tvb_memeql(tag_tvb, tag_off, WPA_OUI"\x04", 4)) {
3435 dissect_wps_tlvs(item, tag_tvb, tag_off+4, tag_len-4, NULL);
3436 proto_item_append_text(item, ": WPS");
3441 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tag_tvb)
3444 guint tag_len = tvb_length(tag_tvb);
3445 guint pmkid_len = tag_len - 4;
3446 char out_buff[SHORT_STR], valid_str[SHORT_STR] = "";
3448 if (tag_len >= 4 && !tvb_memeql(tag_tvb, tag_off, RSN_OUI"\x04", 4)) {
3449 /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
3450 * This is only used within EAPOL-Key frame Key Data. */
3451 if (pmkid_len != PMKID_LEN) {
3452 g_snprintf(valid_str, SHORT_STR,
3453 "(invalid PMKID len=%d, expected 16) ", pmkid_len);
3455 g_snprintf(out_buff, SHORT_STR, "RSN PMKID: %s%s", valid_str,
3456 tvb_bytes_to_str(tag_tvb, 4, pmkid_len));
3457 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 0,
3460 proto_item_append_text(item, ": RSN");
3465 } marvell_ie_type_t;
3468 dissect_vendor_ie_marvell(proto_item * item _U_, proto_tree * ietree,
3469 tvbuff_t * tvb, int offset, guint32 tag_len)
3473 type = tvb_get_guint8(tvb, offset);
3474 proto_tree_add_item (ietree, hf_marvell_ie_type, tvb, offset, 1, TRUE);
3478 case MARVELL_IE_MESH:
3479 proto_tree_add_item (ietree, hf_marvell_ie_mesh_subtype, tvb,
3480 offset++, 1, TRUE );
3481 proto_tree_add_item (ietree, hf_marvell_ie_mesh_version, tvb,
3482 offset++, 1, TRUE );
3483 proto_tree_add_item (ietree, hf_marvell_ie_mesh_active_proto_id, tvb,
3484 offset++, 1, TRUE );
3485 proto_tree_add_item (ietree, hf_marvell_ie_mesh_active_metric_id, tvb,
3486 offset++, 1, TRUE );
3487 proto_tree_add_item (ietree, hf_marvell_ie_mesh_cap, tvb,
3488 offset++, 1, TRUE );
3492 proto_tree_add_item(ietree, hf_marvell_ie_data, tvb, offset,
3493 tag_len - 1, FALSE);
3499 AIRONET_IE_VERSION = 3,
3501 AIRONET_IE_QBSS_V2 = 14
3502 } aironet_ie_type_t;
3504 static const value_string aironet_ie_type_vals[] = {
3505 { AIRONET_IE_VERSION, "CCX version"},
3506 { AIRONET_IE_QOS, "Qos"},
3507 { AIRONET_IE_QBSS_V2, "QBSS V2 - CCA"},
3512 dissect_vendor_ie_aironet(proto_item * aironet_item, proto_tree * ietree,
3513 tvbuff_t * tvb, int offset, guint32 tag_len)
3517 gboolean dont_change = FALSE; /* Don't change the IE item text to default */
3519 type = tvb_get_guint8(tvb, offset);
3520 proto_tree_add_item (ietree, hf_aironet_ie_type, tvb, offset, 1, TRUE);
3524 case AIRONET_IE_VERSION:
3525 proto_tree_add_item (ietree, hf_aironet_ie_version, tvb, offset, 1, TRUE);
3526 proto_item_append_text(aironet_item, ": Aironet CCX version = %d",
3527 tvb_get_guint8(tvb, offset));
3530 case AIRONET_IE_QOS:
3531 proto_tree_add_item (ietree, hf_aironet_ie_qos_unk1, tvb, offset, 1, TRUE);
3533 proto_tree_add_item (ietree, hf_aironet_ie_qos_paramset, tvb, offset, 1, TRUE);
3536 /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
3537 * need to be swapped. Also, the "TXOP" may be TXOP - or not.
3539 for (i = 0; i < 4; i++) {
3540 guint8 byte1, byte2;
3542 byte1 = tvb_get_guint8(tvb, offset);
3543 byte2 = tvb_get_guint8(tvb, offset + 1);
3544 txop = tvb_get_letohs(tvb, offset + 2);
3545 proto_tree_add_bytes_format(ietree, hf_aironet_ie_qos_val, tvb, offset, 4,
3546 tvb_get_ptr(tvb, offset, 4),
3547 "CCX QoS Parameters??: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
3548 (byte1 & 0x60) >> 5, wme_acs[(byte1 & 0x60) >> 5],
3549 (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
3550 byte2 & 0x0f, (byte2 & 0xf0) >> 4,
3555 case AIRONET_IE_QBSS_V2:
3556 /* Extract Values */
3557 proto_tree_add_item (ietree, hf_qbss2_scount, tvb, offset, 2, TRUE);
3558 proto_tree_add_item (ietree, hf_qbss2_cu, tvb, offset + 2, 1, FALSE);
3559 proto_tree_add_item (ietree, hf_qbss2_cal, tvb, offset + 3, 1, FALSE);
3560 proto_tree_add_item (ietree, hf_qbss2_gl, tvb, offset + 4, 1, FALSE);
3563 proto_tree_add_item(ietree, hf_aironet_ie_data, tvb, offset,
3564 tag_len - 1, FALSE);
3568 proto_item_append_text(aironet_item, ": Aironet %s",
3569 val_to_str(type, aironet_ie_type_vals, "Unknown"));
3574 dissect_rsn_ie(proto_tree * tree, tvbuff_t * tag_tvb)
3577 guint tag_len = tvb_length(tag_tvb);
3579 char out_buff[SHORT_STR];
3581 proto_item *cap_item;
3582 proto_tree *cap_tree;
3584 if (tag_off + 2 > tag_len) {
3585 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, tag_len,
3590 g_snprintf(out_buff, SHORT_STR, "RSN IE, version %u",
3591 tvb_get_letohs(tag_tvb, tag_off));
3592 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2, out_buff);
3596 if (tag_off + 4 > tag_len)
3599 /* multicast cipher suite */
3600 if (!tvb_memeql(tag_tvb, tag_off, RSN_OUI, 3)) {
3601 g_snprintf(out_buff, SHORT_STR, "Multicast cipher suite: %s",
3602 val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3603 wpa_cipher_vals, "UNKNOWN"));
3604 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4, out_buff);
3608 if (tag_off + 2 > tag_len)
3611 /* unicast cipher suites */
3612 count = tvb_get_letohs(tag_tvb, tag_off);
3613 g_snprintf(out_buff, SHORT_STR, "# of unicast cipher suites: %u", count);
3614 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2, out_buff);
3617 while (tag_off + 4 <= tag_len && i <= count) {
3618 if (tvb_memeql(tag_tvb, tag_off, RSN_OUI, 3) != 0)
3620 g_snprintf(out_buff, SHORT_STR, "Unicast cipher suite %u: %s",
3621 i, val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3622 wpa_cipher_vals, "UNKNOWN"));
3623 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4, out_buff);
3628 if (i <= count || tag_off + 2 > tag_len)
3631 /* authenticated key management suites */
3632 count = tvb_get_letohs(tag_tvb, tag_off);
3633 g_snprintf(out_buff, SHORT_STR, "# of auth key management suites: %u", count);
3634 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2, out_buff);
3637 while (tag_off + 4 <= tag_len && i <= count) {
3638 if (tvb_memeql(tag_tvb, tag_off, RSN_OUI, 3) != 0)
3640 g_snprintf(out_buff, SHORT_STR, "auth key management suite %u: %s",
3641 i, val_to_str(tvb_get_guint8(tag_tvb, tag_off + 3),
3642 wpa_keymgmt_vals, "UNKNOWN"));
3643 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 4, out_buff);
3648 if (i <= count || tag_off + 2 > tag_len)
3651 rsn_capab = tvb_get_letohs(tag_tvb, tag_off);
3652 g_snprintf(out_buff, SHORT_STR, "RSN Capabilities 0x%04x", rsn_capab);
3653 cap_item = proto_tree_add_uint_format(tree, rsn_cap, tag_tvb,
3654 tag_off, 2, rsn_capab,
3655 "RSN Capabilities: 0x%04X", rsn_capab);
3656 cap_tree = proto_item_add_subtree(cap_item, ett_rsn_cap_tree);
3657 proto_tree_add_boolean(cap_tree, rsn_cap_preauth, tag_tvb, tag_off, 2,
3659 proto_tree_add_boolean(cap_tree, rsn_cap_no_pairwise, tag_tvb, tag_off, 2,
3661 proto_tree_add_uint(cap_tree, rsn_cap_ptksa_replay_counter, tag_tvb, tag_off, 2,
3663 proto_tree_add_uint(cap_tree, rsn_cap_gtksa_replay_counter, tag_tvb, tag_off, 2,
3667 if (tag_off + 2 > tag_len)
3670 count = tvb_get_letohs(tag_tvb, tag_off);
3671 g_snprintf(out_buff, SHORT_STR, "# of PMKIDs: %u", count);
3672 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off, 2, out_buff);
3675 /* PMKID List (16 * n octets) */
3676 for (i = 0; i < count; i++) {
3677 if (tag_off + PMKID_LEN > tag_len)
3679 g_snprintf(out_buff, SHORT_STR, "PMKID %u: %s", i,
3680 tvb_bytes_to_str(tag_tvb, tag_off, PMKID_LEN));
3681 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off,
3682 PMKID_LEN, out_buff);
3683 tag_off += PMKID_LEN;
3687 if (tag_off < tag_len)
3688 proto_tree_add_string(tree, tag_interpretation, tag_tvb, tag_off,
3689 tag_len - tag_off, "Not interpreted");
3693 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vs) {
3695 proto_tree *mcs_tree, *bit_tree;
3698 /* 16 byte Supported MCS set */
3699 ti = proto_tree_add_string(tree, vs ? mcsset_vs : mcsset, tvb, offset, 16,
3700 basic ? "Basic MCS Set" : "MCS Set");
3701 mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
3703 /* Rx MCS Bitmask */
3704 ti = proto_tree_add_string(mcs_tree, tag_interpretation, tvb, offset,
3705 10, "Rx Modulation and Coding Scheme (One bit per modulation)");
3706 bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
3709 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_0to7, tvb, offset, 4, TRUE);
3710 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_8to15, tvb, offset, 4, TRUE);
3711 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_16to23, tvb, offset, 4, TRUE);
3712 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_24to31, tvb, offset, 4, TRUE);
3715 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_32, tvb, offset + 4, 4, TRUE);
3716 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_33to38, tvb, offset + 4, 4, TRUE);
3717 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_39to52, tvb, offset + 4, 4, TRUE);
3720 proto_tree_add_item(bit_tree, mcsset_rx_bitmask_53to76, tvb, offset + 6, 4, TRUE);
3722 capability = tvb_get_letohs (tvb, offset+10);
3723 proto_tree_add_uint_format(mcs_tree, mcsset_highest_data_rate, tvb, offset + 10, 2,
3724 capability, "Highest Supported Data Rate: 0x%04X", capability);
3725 capability = tvb_get_letohs (tvb, offset+12);
3726 proto_tree_add_boolean(mcs_tree, mcsset_tx_mcs_set_defined, tvb, offset + 12, 1,
3728 proto_tree_add_boolean(mcs_tree, mcsset_tx_rx_mcs_set_not_equal, tvb, offset + 12, 1,
3730 proto_tree_add_uint(mcs_tree, mcsset_tx_max_spatial_streams, tvb, offset + 12, 1,
3732 proto_tree_add_boolean(mcs_tree, mcsset_tx_unequal_modulation, tvb, offset + 12, 1,
3736 /* 802.11n D1.10 - HT Information IE */
3738 dissect_ht_info_ie_1_1(proto_tree * tree, tvbuff_t * tvb, int offset,
3741 proto_item *cap_item;
3742 proto_tree *cap_tree;
3743 guint32 tag_val_init_off = 0;
3746 tag_val_init_off = offset;
3750 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
3751 "HT Information IE content length must be at least 22 bytes");
3755 info = tvb_get_guint8 (tvb, offset);
3756 proto_tree_add_item(cap_tree, ht_info_primary_channel, tvb, offset, 1, TRUE);
3758 info = tvb_get_guint8 (tvb, ++offset);
3759 cap_item = proto_tree_add_uint_format(tree, ht_info_delimiter1, tvb,
3761 "HT Information Subset (1 of 3): 0x%02X", info);
3762 cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter1_tree);
3763 proto_tree_add_uint(cap_tree, ht_info_secondary_channel_offset, tvb, offset, 1,
3765 proto_tree_add_boolean(cap_tree, ht_info_channel_width, tvb, offset, 1,
3767 proto_tree_add_boolean(cap_tree, ht_info_rifs_mode, tvb, offset, 1,
3769 proto_tree_add_boolean(cap_tree, ht_info_psmp_stas_only, tvb, offset, 1,
3771 proto_tree_add_uint(cap_tree, ht_info_service_interval_granularity, tvb, offset, 1,
3774 info = tvb_get_letohs (tvb, ++offset);
3775 cap_item = proto_tree_add_uint_format(tree, ht_info_delimiter2, tvb,
3777 "HT Information Subset (2 of 3): 0x%04X", info);
3778 cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter2_tree);
3779 proto_tree_add_uint(cap_tree, ht_info_operating_mode, tvb, offset, 1,
3781 proto_tree_add_boolean(cap_tree, ht_info_non_greenfield_sta_present, tvb, offset, 1,
3783 proto_tree_add_boolean(cap_tree, ht_info_transmit_burst_limit, tvb, offset, 1,
3785 proto_tree_add_boolean(cap_tree, ht_info_obss_non_ht_stas_present, tvb, offset, 1,
3787 proto_tree_add_uint(cap_tree, ht_info_reserved_1, tvb, offset, 2,
3791 info = tvb_get_letohs (tvb, offset);
3792 cap_item = proto_tree_add_uint_format(tree, ht_info_delimiter3, tvb,
3794 "HT Information Subset (3 of 3): 0x%04X", info);
3795 cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter3_tree);
3796 proto_tree_add_uint(cap_tree, ht_info_reserved_2, tvb, offset, 1,
3798 proto_tree_add_boolean(cap_tree, ht_info_dual_beacon, tvb, offset, 1,
3800 proto_tree_add_boolean(cap_tree, ht_info_dual_cts_protection, tvb, offset, 1,
3802 proto_tree_add_boolean(cap_tree, ht_info_secondary_beacon, tvb, offset+1, 1,
3804 proto_tree_add_boolean(cap_tree, ht_info_lsig_txop_protection_full_support, tvb, offset+1, 1,
3806 proto_tree_add_boolean(cap_tree, ht_info_pco_active, tvb, offset+1, 1,
3808 proto_tree_add_boolean(cap_tree, ht_info_pco_phase, tvb, offset+1, 1,
3810 proto_tree_add_uint(cap_tree, ht_info_reserved_3, tvb, offset+1, 1,
3816 dissect_mcs_set(cap_tree, tvb, offset, TRUE, FALSE);
3819 if (tag_val_init_off - offset < tag_len){
3820 proto_tree_add_string(cap_tree, tag_interpretation, tvb, offset,
3821 tag_len + tag_val_init_off - offset, "Unparsed Extra Data");
3825 /*** WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
3827 dissect_wsie_ie(proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len _U_)
3829 proto_item *pst_item, *cap_item, *chan_noc_item, *chnl_item;
3830 proto_tree *pst_tree, *cap_tree, *chan_noc_tree, *chnl_tree;
3832 guint8 providercount, pst_contents, pst_acm_length;
3834 guint16 pst_length = 0;
3836 guint8 chan_length = 0;
3839 proto_tree_add_item(tree, hf_pst_timingquality, tvb, offset, 2, TRUE);
3842 providercount = tvb_get_guint8 (tvb, offset);
3843 pst_item = proto_tree_add_item(tree, hf_pst_providercount, tvb, offset, 1, TRUE);
3844 pst_tree = proto_item_add_subtree(pst_item,ett_pst_tree);
3847 for (i=0;i<providercount;i++) {
3849 local_offset = offset;
3850 cap_item = proto_tree_add_text (pst_tree, tvb, local_offset, pst_length, "Capabilities of Provider :%u", i+1);
3851 cap_tree = proto_item_add_subtree(cap_item, ett_pst_cap_tree);
3853 pst_length = tvb_get_letohl(tvb, local_offset);
3854 proto_tree_add_item(cap_tree, hf_pst_length, tvb, local_offset, 2, TRUE);
3857 pst_contents = tvb_get_guint8 (tvb, local_offset);
3858 proto_tree_add_item(cap_tree, hf_pst_contents, tvb, local_offset, 1, TRUE);
3861 if (pst_contents & WAVE_ACID) {
3862 proto_tree_add_item(cap_tree, hf_pst_acid, tvb, local_offset, 1, TRUE);
3866 if (pst_contents & WAVE_ACM) {
3867 pst_acm_length = tvb_get_guint8 (tvb, local_offset);
3868 proto_tree_add_item(cap_tree, hf_pst_acm_length, tvb, local_offset, 1, TRUE);
3870 proto_tree_add_item(cap_tree, hf_pst_acm, tvb, local_offset, pst_acm_length, FALSE);
3872 if (pst_contents & WAVE_ACF) {
3875 if (pst_contents & WAVE_PRIORITY) {
3876 proto_tree_add_item(cap_tree, hf_pst_priority, tvb, local_offset, 1, TRUE);
3879 if (pst_contents & WAVE_IPV6ADDR) {
3880 proto_tree_add_item(cap_tree, hf_pst_ipv6addr, tvb, local_offset, 16, FALSE);
3882 proto_tree_add_item(cap_tree, hf_pst_serviceport, tvb, local_offset, 2, FALSE);
3884 proto_tree_add_item(cap_tree, hf_pst_addressing, tvb, local_offset, 1, FALSE);
3887 if (pst_contents & WAVE_PEERMAC) {
3888 proto_tree_add_item(cap_tree, hf_pst_macaddr, tvb, local_offset, 6, FALSE);
3891 if (pst_contents & WAVE_CHANNEL) {
3892 proto_tree_add_item(cap_tree, hf_pst_channel, tvb, local_offset, 1, FALSE);
3896 offset = offset + pst_length;
3899 chan_noc = tvb_get_guint8 (tvb, offset);
3900 chan_noc_item = proto_tree_add_item(tree, hf_chan_noc, tvb, offset, 1, TRUE);
3901 chan_noc_tree = proto_item_add_subtree(chan_noc_item,ett_chan_noc_tree);
3905 for (i=0;i<chan_noc;i++) {
3906 chan_length = tvb_get_guint8 (tvb, offset);
3907 chnl_item = proto_tree_add_text (chan_noc_tree, tvb, offset, chan_length, "Channel :%u Information ", i+1);
3908 chnl_tree = proto_item_add_subtree(chnl_item, ett_wave_chnl_tree);
3909 proto_tree_add_item(chnl_tree, hf_chan_length, tvb, offset, 1, TRUE);
3910 proto_tree_add_item(chnl_tree, hf_chan_content, tvb, offset+1, 1, TRUE);
3911 proto_tree_add_item(chnl_tree, hf_chan_channel, tvb, offset+2, 1, TRUE);
3912 proto_tree_add_item(chnl_tree, hf_chan_adapt, tvb, offset+3, 1, TRUE);
3913 proto_tree_add_item(chnl_tree, hf_chan_rate, tvb, offset+4, 1, TRUE);
3914 proto_tree_add_item(chnl_tree, hf_chan_tx_pow, tvb, offset+5, 1, TRUE);
3915 offset = offset + chan_length;
3920 /*** Begin: Secondary Channel Offset Tag - Dustin Johnson ***/
3921 static void secondary_channel_offset_ie(proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
3927 proto_tree_add_text (tree, tvb, offset, tag_len, "Secondary Channel Offset: Error: Tag length must be at least 1 byte long");
3931 tag_offset = offset;
3932 proto_tree_add_uint(tree, hf_tag_secondary_channel_offset, tvb, offset, 1, tvb_get_guint8 (tvb, offset));
3935 if ((tag_len - (offset-tag_offset)) > 0)
3937 proto_tree_add_text (tree, tvb, offset, tag_len - (offset-tag_offset), "Unknown Data");
3941 /*** End: Secondary Channel Offset Tag - Dustin Johnson ***/
3944 dissect_ht_capability_ie(proto_tree * tree, tvbuff_t * tvb, int offset,
3945 guint32 tag_len, gboolean vs)
3947 proto_item *cap_item;
3948 proto_tree *cap_tree;
3951 guint32 tag_val_off = 0;
3953 if (tag_val_off + 2 > tag_len) {
3954 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
3959 if (tag_len != 26) {
3960 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
3961 "HT Capabilities IE content length must be exactly 26 bytes");
3965 if (wlan_ignore_draft_ht && vs)
3968 /* 2 byte HT Capabilities Info*/
3969 capability = tvb_get_letohs (tvb, offset);
3970 cap_item = proto_tree_add_item(tree, vs ? ht_vs_cap : ht_cap, tvb,
3972 cap_tree = proto_item_add_subtree(cap_item, ett_ht_cap_tree);
3973 proto_tree_add_boolean(cap_tree, ht_ldpc_coding, tvb, offset, 1,
3975 proto_tree_add_boolean(cap_tree, ht_chan_width, tvb, offset, 1,
3977 proto_tree_add_uint(cap_tree, ht_sm_pwsave, tvb, offset, 1,
3979 proto_tree_add_boolean(cap_tree, ht_green, tvb, offset, 1,
3981 proto_tree_add_boolean(cap_tree, ht_short20, tvb, offset, 1,
3983 proto_tree_add_boolean(cap_tree, ht_short40, tvb, offset, 1,
3985 proto_tree_add_boolean(cap_tree, ht_tx_stbc, tvb, offset, 1,
3987 proto_tree_add_uint(cap_tree, ht_rx_stbc, tvb, offset+1, 1,
3989 proto_tree_add_boolean(cap_tree, ht_delayed_block_ack, tvb, offset+1, 1,
3991 proto_tree_add_boolean(cap_tree, ht_max_amsdu, tvb, offset+1, 1,
3993 proto_tree_add_boolean(cap_tree, ht_dss_cck_40, tvb, offset+1, 1,
3995 proto_tree_add_boolean(cap_tree, ht_psmp, tvb, offset+1, 1,
3997 proto_tree_add_boolean(cap_tree, ht_40_mhz_intolerant, tvb, offset+1, 1,
3999 proto_tree_add_boolean(cap_tree, ht_l_sig, tvb, offset+1, 1,
4005 /* 1 byte A-MPDU Parameters */
4006 capability = tvb_get_guint8 (tvb, offset);
4007 cap_item = proto_tree_add_item(tree, vs ? ampduparam_vs : ampduparam, tvb,
4009 cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
4010 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);
4011 proto_tree_add_uint(cap_tree, ampduparam_mpdu_start_spacing, tvb, offset, 1, capability);
4012 proto_tree_add_uint(cap_tree, ampduparam_reserved, tvb, offset, 1, capability);
4016 /* 16 byte MCS set */
4017 dissect_mcs_set(tree, tvb, offset, FALSE, vs);
4021 /* 2 byte HT Extended Capabilities */
4022 capability = tvb_get_letohs (tvb, offset);
4023 cap_item = proto_tree_add_item(tree, vs ? htex_vs_cap : htex_cap, tvb,
4025 cap_tree = proto_item_add_subtree(cap_item, ett_htex_cap_tree);
4026 proto_tree_add_boolean(cap_tree, htex_pco, tvb, offset, 1,
4028 proto_tree_add_uint(cap_tree, htex_transtime, tvb, offset, 1,
4030 proto_tree_add_uint(cap_tree, htex_mcs, tvb, offset+1, 1,
4032 proto_tree_add_boolean(cap_tree, htex_htc_support, tvb, offset+1, 1,
4034 proto_tree_add_boolean(cap_tree, htex_rd_responder, tvb, offset+1, 1,
4040 /* 4 byte TxBF capabilities */
4041 txbfcap = tvb_get_letohl (tvb, offset);
4042 cap_item = proto_tree_add_item(tree, vs ? txbf_vs : txbf, tvb,
4044 cap_tree = proto_item_add_subtree(cap_item, ett_txbf_tree);
4045 proto_tree_add_boolean(cap_tree, txbf_cap, tvb, offset, 1,
4047 proto_tree_add_boolean(cap_tree, txbf_rcv_ssc, tvb, offset, 1,
4049 proto_tree_add_boolean(cap_tree, txbf_tx_ssc, tvb, offset, 1,
4051 proto_tree_add_boolean(cap_tree, txbf_rcv_ndp, tvb, offset, 1,
4053 proto_tree_add_boolean(cap_tree, txbf_tx_ndp, tvb, offset, 1,
4055 proto_tree_add_boolean(cap_tree, txbf_impl_txbf, tvb, offset, 1,
4057 proto_tree_add_uint(cap_tree, txbf_calib, tvb, offset, 1,
4059 proto_tree_add_boolean(cap_tree, txbf_expl_csi, tvb, offset+1, 1,
4061 proto_tree_add_boolean(cap_tree, txbf_expl_uncomp_fm, tvb, offset+1, 1,
4063 proto_tree_add_boolean(cap_tree, txbf_expl_comp_fm, tvb, offset+1, 1,
4065 proto_tree_add_uint(cap_tree, txbf_expl_bf_csi, tvb, offset+1, 1,
4067 proto_tree_add_uint(cap_tree, txbf_expl_uncomp_fm_feed, tvb, offset+1, 1,
4069 proto_tree_add_uint(cap_tree, txbf_expl_comp_fm_feed, tvb, offset+1, 2,
4071 proto_tree_add_uint(cap_tree, txbf_min_group, tvb, offset+2, 1,
4073 proto_tree_add_uint(cap_tree, txbf_csi_num_bf_ant, tvb, offset+2, 1,
4075 proto_tree_add_uint(cap_tree, txbf_uncomp_sm_bf_ant, tvb, offset+2, 1,
4077 proto_tree_add_uint(cap_tree, txbf_comp_sm_bf_ant, tvb, offset+2, 2,
4079 proto_tree_add_uint(cap_tree, txbf_csi_max_rows_bf, tvb, offset+3, 1,
4081 proto_tree_add_uint(cap_tree, txbf_chan_est, tvb, offset+3, 1,
4083 proto_tree_add_uint(cap_tree, txbf_resrv, tvb, offset+3, 1,
4089 /* 1 byte Antenna Selection (ASEL) capabilities */
4090 capability = tvb_get_guint8 (tvb, offset);
4091 cap_item = proto_tree_add_item(tree, vs ? antsel_vs : antsel, tvb,
4093 cap_tree = proto_item_add_subtree(cap_item, ett_antsel_tree);
4094 proto_tree_add_boolean(cap_tree, antsel_b0, tvb, offset, 1,
4096 proto_tree_add_boolean(cap_tree, antsel_b1, tvb, offset, 1,
4098 proto_tree_add_boolean(cap_tree, antsel_b2, tvb, offset, 1,
4100 proto_tree_add_boolean(cap_tree, antsel_b3, tvb, offset, 1,
4102 proto_tree_add_boolean(cap_tree, antsel_b4, tvb, offset, 1,
4104 proto_tree_add_boolean(cap_tree, antsel_b5, tvb, offset, 1,
4106 proto_tree_add_boolean(cap_tree, antsel_b6, tvb, offset, 1,
4108 proto_tree_add_uint(cap_tree, antsel_b7, tvb, offset, 1,
4114 if (tag_val_off < tag_len)
4115 proto_tree_add_string(tree, tag_interpretation, tvb, offset,
4116 tag_len - tag_val_off, "Not interpreted");
4120 dissect_ht_info_ie_1_0(proto_tree * tree, tvbuff_t * tvb, int offset,
4123 proto_item *cap_item;
4124 proto_tree *cap_tree;
4126 guint32 tag_val_off = 0;
4127 gchar out_buff[SHORT_STR];
4129 if (tag_val_off + 2 > tag_len) {
4130 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
4136 proto_tree_add_string(tree, tag_interpretation, tvb, offset, tag_len,
4137 "HT Additional Capabilities IE content length must be 22");
4141 if (wlan_ignore_draft_ht)
4144 g_snprintf(out_buff, SHORT_STR, "Control Channel %d",
4145 tvb_get_guint8(tvb, offset));
4146 proto_tree_add_string(tree, tag_interpretation, tvb, offset, 1, out_buff);
4150 /* 1 byte HT additional capabilities */
4151 capability = tvb_get_guint8 (tvb, offset);
4152 cap_item = proto_tree_add_uint_format(tree, hta_cap, tvb,
4153 offset, 1, capability,
4154 "HT Additional Capabilities: 0x%04X", capability);
4155 cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap_tree);
4156 proto_tree_add_uint(cap_tree, hta_ext_chan_offset, tvb, offset, 1,
4158 proto_tree_add_boolean(cap_tree, hta_rec_tx_width, tvb, offset, 1,
4160 proto_tree_add_boolean(cap_tree, hta_rifs_mode, tvb, offset, 1,
4162 proto_tree_add_boolean(cap_tree, hta_controlled_access, tvb, offset, 1,
4164 proto_tree_add_uint(cap_tree, hta_service_interval, tvb, offset, 1,
4169 /* 2 byte HT additional capabilities */
4170 capability = tvb_get_letohs (tvb, offset);
4171 cap_item = proto_tree_add_uint_format(tree, hta_cap, tvb,
4172 offset, 2, capability,
4173 "HT Additional Capabilities: 0x%04X", capability);
4174 cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap1_tree);
4175 proto_tree_add_uint(cap_tree, hta_operating_mode, tvb, offset, 2,
4177 proto_tree_add_boolean(cap_tree, hta_non_gf_devices, tvb, offset, 2,
4183 /* 2 byte HT additional capabilities */
4184 capability = tvb_get_letohs (tvb, offset);
4185 cap_item = proto_tree_add_uint_format(tree, hta_cap, tvb,
4186 offset, 2, capability,
4187 "HT Additional Capabilities: 0x%04X", capability);
4188 cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap2_tree);
4189 proto_tree_add_uint(cap_tree, hta_basic_stbc_mcs, tvb, offset, 2,
4191 proto_tree_add_boolean(cap_tree, hta_dual_stbc_protection, tvb, offset, 2,
4193 proto_tree_add_boolean(cap_tree, hta_secondary_beacon, tvb, offset, 2,
4195 proto_tree_add_boolean(cap_tree, hta_lsig_txop_protection, tvb, offset, 2,
4197 proto_tree_add_boolean(cap_tree, hta_pco_active, tvb, offset, 2,
4199 proto_tree_add_boolean(cap_tree, hta_pco_phase, tvb, offset, 2,
4204 /* 16 byte Supported MCS set */
4205 dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
4209 if (tag_val_off < tag_len)
4210 proto_tree_add_string(tree, tag_interpretation, tvb, offset,
4211 tag_len - tag_val_off, "Not interpreted");
4214 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
4218 * "The Order field is 1 bit in length and is set to 1 in any non-QoS Data
4219 * frame that contains an MSDU, or fragment thereof, which is being
4220 * transferred using the StrictlyOrdered service class. The presence of the
4221 * HT Control field in frames is indicated by setting the Order field to 1
4222 * in any Data type or Management type frame that is transmitted with a
4223 * value of HT_GF or HT_MM for the FORMAT parameter of the TXVECTOR except
4224 * a non-QoS Data frame or a Control Wrapper frame. The Order field is set
4225 * to 0 in all other frames. All non-HT QoS STAs set the Order field to 0."
4227 * ...so does this mean that we can check for the presence of +HTC by
4228 * looking for QoS frames with the Order bit set, or do we need extra
4229 * information from the PHY (which would be monumentally silly)?
4231 * At any rate, it doesn't look like any equipment we have produces
4232 * +HTC frames, so the code is completely untested.
4236 dissect_ht_control(proto_tree *tree, tvbuff_t * tvb, int offset)
4239 proto_tree *htc_tree, *lac_subtree;
4242 htc = tvb_get_letohs(tvb, offset);
4244 ti = proto_tree_add_item(tree, hf_htc, tvb, offset, 4, TRUE);
4245 htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
4247 /* Start: Link Adaptation Control */
4248 ti = proto_tree_add_item(htc_tree, hf_htc_lac, tvb, offset, 2, TRUE);
4249 lac_subtree = proto_item_add_subtree(ti, ett_htc_tree);
4250 proto_tree_add_item(lac_subtree, hf_htc_lac_reserved, tvb, offset, 1, htc);
4251 proto_tree_add_item(lac_subtree, hf_htc_lac_trq, tvb, offset, 1, TRUE);
4253 if (HTC_IS_ASELI(htc)) {
4254 proto_tree_add_uint(lac_subtree, hf_htc_lac_mai_aseli, tvb, offset, 1, htc);
4256 proto_tree_add_item(lac_subtree, hf_htc_lac_mai_mrq, tvb, offset, 1, TRUE);
4257 if (HTC_LAC_MAI_MRQ(htc)){
4258 proto_tree_add_uint(lac_subtree, hf_htc_lac_mai_msi, tvb, offset, 1, htc);
4260 proto_tree_add_uint(lac_subtree, hf_htc_lac_mai_reserved, tvb, offset, 1, htc);
4264 proto_tree_add_uint(lac_subtree, hf_htc_lac_mfsi, tvb, offset, 2, htc);
4267 if (HTC_IS_ASELI(htc)) {
4268 proto_tree_add_uint(lac_subtree, hf_htc_lac_asel_command, tvb, offset, 1, htc);
4269 proto_tree_add_uint(lac_subtree, hf_htc_lac_asel_data, tvb, offset, 1, htc);
4271 proto_tree_add_uint(lac_subtree, hf_htc_lac_mfb, tvb, offset, 1, htc);
4273 /* End: Link Adaptation Control */
4276 htc = tvb_get_letohs(tvb, offset);
4278 proto_tree_add_uint(htc_tree, hf_htc_cal_pos, tvb, offset, 1, htc);
4279 proto_tree_add_uint(htc_tree, hf_htc_cal_seq, tvb, offset, 1, htc);
4280 proto_tree_add_uint(htc_tree, hf_htc_reserved1, tvb, offset, 1, htc);
4281 proto_tree_add_uint(htc_tree, hf_htc_csi_steering, tvb, offset, 1, htc);
4284 proto_tree_add_boolean(htc_tree, hf_htc_ndp_announcement, tvb, offset, 1, htc);
4285 proto_tree_add_uint(htc_tree, hf_htc_reserved2, tvb, offset, 1, htc);
4286 proto_tree_add_boolean(htc_tree, hf_htc_ac_constraint, tvb, offset, 1, htc);
4287 proto_tree_add_boolean(htc_tree, hf_htc_rdg_more_ppdu, tvb, offset, 1, htc);
4291 dissect_frame_control(proto_tree * tree, tvbuff_t * tvb, gboolean wlan_broken_fc,
4294 guint16 fcf, flags, frame_type_subtype;
4295 proto_tree *fc_tree, *flag_tree;
4296 proto_item *fc_item, *flag_item, *hidden_item;
4298 fcf = FETCH_FCF(offset);
4300 flags = FCF_FLAGS(fcf);
4301 frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
4303 proto_tree_add_uint (tree, hf_fc_frame_type_subtype,
4304 tvb, wlan_broken_fc?offset+1:offset, 1,
4305 frame_type_subtype);
4307 fc_item = proto_tree_add_uint_format (tree, hf_fc_field, tvb,
4308 offset, 2, fcf, "Frame Control: 0x%04X (%s)",
4309 fcf, wlan_broken_fc?"Swapped":"Normal");
4311 fc_tree = proto_item_add_subtree (fc_item, ett_fc_tree);
4313 proto_tree_add_uint (fc_tree, hf_fc_proto_version, tvb, wlan_broken_fc?offset+1:offset, 1,
4314 FCF_PROT_VERSION (fcf));
4316 proto_tree_add_uint (fc_tree, hf_fc_frame_type, tvb, wlan_broken_fc?offset+1:offset, 1,
4317 FCF_FRAME_TYPE (fcf));
4319 proto_tree_add_uint (fc_tree, hf_fc_frame_subtype, tvb, wlan_broken_fc?offset+1:offset, 1,
4320 FCF_FRAME_SUBTYPE (fcf));
4322 flag_item = proto_tree_add_uint_format (fc_tree, hf_fc_flags, tvb,
4323 wlan_broken_fc?offset:offset+1, 1,
4324 flags, "Flags: 0x%X", flags);
4326 flag_tree = proto_item_add_subtree (flag_item, ett_proto_flags);
4327 proto_tree_add_uint (flag_tree, hf_fc_data_ds, tvb, wlan_broken_fc?offset:offset+1, 1,
4328 FLAGS_DS_STATUS (flags));
4329 hidden_item = proto_tree_add_boolean (flag_tree, hf_fc_to_ds, tvb, offset+1, 1, flags);
4330 PROTO_ITEM_SET_HIDDEN(hidden_item);
4331 hidden_item = proto_tree_add_boolean (flag_tree, hf_fc_from_ds, tvb, offset+1, 1, flags);
4332 PROTO_ITEM_SET_HIDDEN(hidden_item);
4333 proto_tree_add_boolean (flag_tree, hf_fc_more_frag, tvb, wlan_broken_fc?offset:offset+1, 1,
4335 proto_tree_add_boolean (flag_tree, hf_fc_retry, tvb, wlan_broken_fc?offset:offset+1, 1,
4337 proto_tree_add_boolean (flag_tree, hf_fc_pwr_mgt, tvb, wlan_broken_fc?offset:offset+1, 1,
4339 proto_tree_add_boolean (flag_tree, hf_fc_more_data, tvb, wlan_broken_fc?offset:offset+1, 1,
4341 proto_tree_add_boolean (flag_tree, hf_fc_protected, tvb, wlan_broken_fc?offset:offset+1, 1,
4343 proto_tree_add_boolean (flag_tree, hf_fc_order, tvb, wlan_broken_fc?offset:offset+1, 1,
4348 dissect_vendor_ie_ht(proto_item * item, proto_tree * tree, tvbuff_t * tag_tvb)
4350 gint tag_len = tvb_length(tag_tvb);
4351 gchar out_buff[SHORT_STR];
4353 g_snprintf(out_buff, SHORT_STR, "802.11n (Pre) OUI");
4354 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 0, 3, out_buff);
4355 /* 802.11n OUI Information Element */
4356 if (4 <= tag_len && !tvb_memeql(tag_tvb, 0, PRE_11N_OUI"\x33", 4)) {
4357 g_snprintf(out_buff, SHORT_STR, "802.11n (Pre) HT information");
4358 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 3, 1, out_buff);
4360 dissect_ht_capability_ie(tree, tag_tvb, 4, tag_len - 4, TRUE);
4361 proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
4364 if (4 <= tag_len && !tvb_memeql(tag_tvb, 0, PRE_11N_OUI"\x34", 4)) {
4365 g_snprintf(out_buff, SHORT_STR, "HT additional information (802.11n D1.00)");
4366 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 3, 1, out_buff);
4368 dissect_ht_info_ie_1_0(tree, tag_tvb, 4, tag_len - 4);
4369 proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
4372 g_snprintf(out_buff, SHORT_STR, "Unknown type");
4373 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 3, 1, out_buff);
4374 proto_item_append_text(item, ": 802.11n (pre) Unknown type");
4375 proto_tree_add_string(tree, tag_interpretation, tag_tvb, 4,
4376 tag_len - 4, "Not interpreted");
4382 /* ************************************************************************* */
4383 /* Dissect and add tagged (optional) fields to proto tree */
4384 /* ************************************************************************* */
4386 static const value_string tag_num_vals[] = {
4387 { TAG_SSID, "SSID parameter set" },
4388 { TAG_SUPP_RATES, "Supported Rates" },
4389 { TAG_FH_PARAMETER, "FH Parameter set" },
4390 { TAG_DS_PARAMETER, "DS Parameter set" },
4391 { TAG_CF_PARAMETER, "CF Parameter set" },
4392 { TAG_TIM, "Traffic Indication Map (TIM)" },
4393 { TAG_IBSS_PARAMETER, "IBSS Parameter set" },
4394 { TAG_COUNTRY_INFO, "Country Information" },
4395 { TAG_FH_HOPPING_PARAMETER, "Hopping Pattern Parameters" },
4396 { TAG_CHALLENGE_TEXT, "Challenge text" },
4397 { TAG_ERP_INFO, "ERP Information" },
4398 { TAG_ERP_INFO_OLD, "ERP Information" },
4399 { TAG_RSN_IE, "RSN Information" },
4400 { TAG_EXT_SUPP_RATES, "Extended Supported Rates" },
4401 { TAG_CISCO_UNKNOWN_1, "Cisco Unknown 1 + Device Name" },
4402 { TAG_CISCO_UNKNOWN_2, "Cisco Unknown 2" },
4403 { TAG_CISCO_UNKNOWN_3, "Cisco Unknown 3" },
4404 { TAG_VENDOR_SPECIFIC_IE, "Vendor Specific" },
4405 { TAG_SYMBOL_PROPRIETARY, "Symbol Proprietary"},
4406 { TAG_AGERE_PROPRIETARY, "Agere Proprietary"},
4407 { TAG_REQUEST, "Request"},
4408 { TAG_QBSS_LOAD, "QBSS Load Element"},
4409 { TAG_EDCA_PARAM_SET, "EDCA Parameter Set"},
4410 { TAG_TSPEC, "Traffic Specification"},
4411 { TAG_TCLAS, "Traffic Classification"},
4412 { TAG_SCHEDULE, "Schedule"},
4413 { TAG_TS_DELAY, "TS Delay"},
4414 { TAG_TCLAS_PROCESS, "TCLAS Processing"},
4415 { TAG_HT_CAPABILITY, "HT Capabilities (802.11n D1.10)"},
4416 { TAG_NEIGHBOR_REPORT, "Neighbor Report"},
4417 { TAG_HT_INFO, "HT Information (802.11n D1.10)"},
4418 { TAG_SECONDARY_CHANNEL_OFFSET, "Secondary Channel Offset (802.11n D1.10)"},
4419 { TAG_WSIE, "Wave Service Information"}, /* www.aradasystems.com */
4420 { TAG_20_40_BSS_CO_EX, "20/40 BSS Coexistence"},
4421 { TAG_20_40_BSS_INTOL_CH_REP, "20/40 BSS Intolerant Channel Report"}, /* IEEE P802.11n/D6.0 */
4422 { TAG_OVERLAP_BSS_SCAN_PAR, "Overlapping BSS Scan Parameters"}, /* IEEE P802.11n/D6.0 */
4423 { TAG_QOS_CAPABILITY, "QoS Capability"},
4424 { TAG_POWER_CONSTRAINT, "Power Constraint"},
4425 { TAG_POWER_CAPABILITY, "Power Capability"},
4426 { TAG_TPC_REQUEST, "TPC Request"},
4427 { TAG_TPC_REPORT, "TPC Report"},
4428 { TAG_SUPPORTED_CHANNELS, "Supported Channels"},
4429 { TAG_CHANNEL_SWITCH_ANN, "Channel Switch Announcement"},
4430 { TAG_MEASURE_REQ, "Measurement Request"},
4431 { TAG_MEASURE_REP, "Measurement Report"},
4432 { TAG_QUIET, "Quiet"},
4433 { TAG_IBSS_DFS, "IBSS DFS"},
4434 { TAG_EXTENDED_CAPABILITIES, "Extended Capabilities"},
4435 #if 0 /*Not yet assigned tag numbers by ANA */
4436 { TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement"},
4437 { TAG_SUPPORTED_REGULATORY_CLASSES, "Supported Regulatory Classes"},
4442 static const value_string environment_vals[] = {
4444 { 0x4f, "Outdoor" },
4449 static int beacon_padding = 0; /* beacon padding bug */
4451 add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int offset)
4455 const guint8 *tag_data_ptr;
4456 guint32 tag_no, tag_len;
4459 char out_buff[SHORT_STR];
4460 char print_buff[SHORT_STR];
4461 proto_tree * orig_tree=tree;
4462 proto_item *ti, *en;
4463 guint8 tag_len_len; /* The length of the length parameter in bytes*/
4465 tag_no = tvb_get_guint8(tvb, offset);
4466 if(tag_no == TAG_WSIE){
4468 tag_len = tvb_get_letohl(tvb, offset + 1);
4471 tag_len = tvb_get_guint8(tvb, offset + 1);
4474 ti=proto_tree_add_text(orig_tree,tvb,offset,tag_len+1+tag_len_len,"%s",
4475 val_to_str(tag_no, tag_num_vals,
4476 (tag_no >= 17 && tag_no <= 31) ?
4477 "Reserved for challenge text" : "Reserved tag number" ));
4478 tree=proto_item_add_subtree(ti,ett_80211_mgt_ie);
4480 proto_tree_add_uint_format (tree, tag_number, tvb, offset, 1, tag_no,
4481 "Tag Number: %u (%s)",
4483 val_to_str(tag_no, tag_num_vals,
4484 (tag_no >= 17 && tag_no <= 31) ?
4485 "Reserved for challenge text" :
4486 "Reserved tag number"));
4487 proto_tree_add_uint (tree, (tag_no==TAG_TIM ? tim_length : tag_length), tvb, offset + 1, tag_len_len, tag_len);
4493 if(beacon_padding == 0) /* padding bug */
4495 guint8 *ssid; /* The SSID may consist of arbitrary bytes */
4497 ssid = tvb_get_ephemeral_string(tvb, offset + 2, tag_len);
4498 #ifdef HAVE_AIRPDCAP
4499 AirPDcapSetLastSSID(&airpdcap_ctx, (CHAR *) ssid, tag_len);
4501 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4502 tag_len, (char *) ssid);
4503 if (check_col (pinfo->cinfo, COL_INFO)) {
4505 col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=\"%s\"",
4506 format_text(ssid, tag_len));
4508 col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Broadcast");
4512 proto_item_append_text(ti, ": \"%s\"",
4513 format_text(ssid, tag_len));
4514 memcpy(wlan_stats.ssid, ssid, MAX_SSID_LEN);
4515 wlan_stats.ssid_len = tag_len;
4517 proto_item_append_text(ti, ": Broadcast");
4519 en = proto_tree_add_string_format (tree, hf_tagged_ssid, tvb, offset + 2,
4520 tag_len, format_text(ssid, tag_len),
4521 "SSID: %s", format_text(ssid, tag_len));
4522 PROTO_ITEM_SET_HIDDEN (en);
4523 beacon_padding++; /* padding bug */
4527 case TAG_SUPP_RATES:
4528 case TAG_EXT_SUPP_RATES:
4531 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4532 "Tag length %u too short, must be greater than 0", tag_len);
4536 tag_data_ptr = tvb_get_ptr (tvb, offset + 2, tag_len);
4537 for (i = 0, n = 0; i < tag_len && n < SHORT_STR; i++) {
4538 if (tag_data_ptr[i] == 0xFF){
4539 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2 + i,
4540 1, "BSS requires support for mandatory features of HT PHY (IEEE 802.11 - Clause 20)");
4542 ret = g_snprintf (print_buff + n, SHORT_STR - n, "%2.1f%s ",
4543 (tag_data_ptr[i] & 0x7F) * 0.5,
4544 (tag_data_ptr[i] & 0x80) ? "(B)" : "");
4545 if (ret == -1 || ret >= SHORT_STR - n) {
4546 /* Some versions of snprintf return -1 if they'd truncate
4547 the output. Others return <buf_size> or greater. */
4553 g_snprintf (out_buff, SHORT_STR, "Supported rates: %s [Mbit/sec]", print_buff);
4554 out_buff[SHORT_STR-1] = '\0';
4555 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4557 proto_item_append_text(ti, ": %s", print_buff);
4560 case TAG_FH_PARAMETER:
4563 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 5",
4567 g_snprintf (out_buff, SHORT_STR,
4568 "Dwell time 0x%04X, Hop Set %2d, Hop Pattern %2d, Hop Index %2d",
4569 tvb_get_letohs(tvb, offset + 2),
4570 tvb_get_guint8(tvb, offset + 4),
4571 tvb_get_guint8(tvb, offset + 5),
4572 tvb_get_guint8(tvb, offset + 6));
4573 out_buff[SHORT_STR-1] = '\0';
4574 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4578 case TAG_DS_PARAMETER:
4581 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 1",
4585 g_snprintf (out_buff, SHORT_STR, "Current Channel: %u",
4586 tvb_get_guint8(tvb, offset + 2));
4587 out_buff[SHORT_STR-1] = '\0';
4588 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4590 proto_item_append_text(ti, ": %s", out_buff);
4591 wlan_stats.channel = tvb_get_guint8(tvb, offset + 2);
4594 case TAG_CF_PARAMETER:
4597 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 6",
4601 g_snprintf (out_buff, SHORT_STR, "CFP count: %u",
4602 tvb_get_guint8(tvb, offset + 2));
4603 out_buff[SHORT_STR-1] = '\0';
4604 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2,
4605 1, out_buff, "%s", out_buff);
4606 g_snprintf (out_buff, SHORT_STR, "CFP period: %u",
4607 tvb_get_guint8(tvb, offset + 3));
4608 out_buff[SHORT_STR-1] = '\0';
4609 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 3,
4610 1, out_buff, "%s", out_buff);
4611 g_snprintf (out_buff, SHORT_STR, "CFP max duration: %u",
4612 tvb_get_letohs(tvb, offset + 4));
4613 out_buff[SHORT_STR-1] = '\0';
4614 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 4,
4615 2, out_buff, "%s", out_buff);
4616 g_snprintf (out_buff, SHORT_STR, "CFP Remaining: %u",
4617 tvb_get_letohs(tvb, offset + 6));
4618 out_buff[SHORT_STR-1] = '\0';
4619 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 6,
4620 2, out_buff, "%s", out_buff);
4621 proto_item_append_text(ti, ": CFP count %u, CFP period %u, CFP max duration %u, "
4623 tvb_get_guint8(tvb, offset + 2),
4624 tvb_get_guint8(tvb, offset + 3),
4625 tvb_get_letohs(tvb, offset + 4),
4626 tvb_get_letohs(tvb, offset + 6));
4632 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 4",
4642 proto_tree_add_item(tree, tim_dtim_count, tvb,
4643 offset + 2, 1, TRUE);
4644 proto_tree_add_item(tree, tim_dtim_period, tvb,
4645 offset + 3, 1, TRUE);
4646 proto_item_append_text(ti, ": DTIM %u of %u bitmap",
4647 tvb_get_guint8(tvb, offset + 2),
4648 tvb_get_guint8(tvb, offset + 3));
4650 bmapctl = tvb_get_guint8(tvb, offset + 4);
4651 bmapoff = bmapctl>>1;
4652 proto_tree_add_uint_format(tree, tim_bmapctl, tvb,
4653 offset + 4, 1, bmapctl,
4654 "Bitmap Control: 0x%02X (mcast:%u, bitmap offset %u)",
4655 bmapctl, bmapctl&1, bmapoff);
4657 bmaplen = tag_len - 3;
4658 bmap = tvb_get_ptr(tvb, offset + 5, bmaplen);
4659 if (bmaplen==1 && 0==bmap[0] && !(bmapctl&1)) {
4660 proto_item_append_text(ti, " empty");
4663 proto_item_append_text(ti, " mcast");
4666 if (bmaplen>1 || bmap[0]) {
4667 int len=g_snprintf (out_buff, SHORT_STR,
4668 "Bitmap: traffic for AID's:");
4670 for (i=0;i<bmaplen*8;i++) {
4671 if (bmap[i/8] & (1<<(i%8))) {
4672 int aid=i+2*bmapoff*8;
4673 len+=g_snprintf (out_buff+len, SHORT_STR-len," %u", aid);
4674 proto_item_append_text(ti, " %u", aid);
4675 if (len>=SHORT_STR) {
4680 out_buff[SHORT_STR-1] = '\0';
4681 proto_tree_add_string_format (tree, tag_interpretation, tvb, offset + 5,
4682 bmaplen, out_buff, "%s", out_buff);
4687 case TAG_IBSS_PARAMETER:
4690 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 2",
4694 g_snprintf (out_buff, SHORT_STR, "ATIM window 0x%X",
4695 tvb_get_letohs(tvb, offset + 2));
4696 out_buff[SHORT_STR-1] = '\0';
4697 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4699 proto_item_append_text(ti, ": %s", out_buff);
4702 case TAG_COUNTRY_INFO: /* IEEE 802.11d-2001 and IEEE 802.11j-2004 */
4708 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 3",
4712 tvb_memcpy(tvb, ccode, offset + 2, 2);
4714 g_snprintf (out_buff, SHORT_STR, "Country Code: %s, %s Environment",
4715 format_text(ccode, 2),
4716 val_to_str(tvb_get_guint8(tvb, offset + 4), environment_vals,"Unknown (0x%02x)"));
4717 out_buff[SHORT_STR-1] = '\0';
4718 proto_item_append_text(ti, ": %s", out_buff);
4719 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,3, out_buff);
4721 for (i = 3; (i + 3) <= tag_len; i += 3)
4723 guint8 val1, val2, val3;
4724 val1 = tvb_get_guint8(tvb, offset + 2 + i);
4725 val2 = tvb_get_guint8(tvb, offset + 3 + i);
4726 val3 = tvb_get_guint8(tvb, offset + 4 + i);
4728 if (val1 <= 200) { /* 802.11d */
4729 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2+i,3, out_buff,
4730 " Start Channel: %u, Channels: %u, Max TX Power: %d dBm",
4731 val1, val2, (gint) val3);
4732 } else { /* 802.11j */
4733 proto_tree_add_string_format(tree, tag_interpretation, tvb, offset + 2+i,3, out_buff,
4734 " Reg Extension Id: %u, Regulatory Class: %u, Coverage Class: %u",
4742 if (tag_len < 4 || tag_len >5)
4744 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Wrong QBSS Tag Length %u", tag_len);
4750 /* QBSS Version 1 */
4751 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 1,
4752 tag_len, "Cisco QBSS Version 1 - non CCA");
4754 /* Extract Values */
4755 proto_tree_add_uint (tree, hf_qbss_version, tvb, offset + 2, tag_len, 1);
4756 proto_tree_add_item (tree, hf_qbss_scount, tvb, offset + 2, 2, TRUE);
4757 proto_tree_add_item (tree, hf_qbss_cu, tvb, offset + 4, 1, FALSE);
4758 proto_tree_add_item (tree, hf_qbss_adc, tvb, offset + 5, 1, FALSE);
4760 else if (tag_len == 5)
4762 /* QBSS Version 2 */
4763 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4764 tag_len, "802.11e CCA Version");
4766 /* Extract Values */
4767 proto_tree_add_uint (tree, hf_qbss_version, tvb, offset + 2, tag_len, 2);
4768 proto_tree_add_item (tree, hf_qbss_scount, tvb, offset + 2, 2, TRUE);
4769 proto_tree_add_item (tree, hf_qbss_cu, tvb, offset + 4, 1, FALSE);
4770 proto_tree_add_item (tree, hf_qbss_adc, tvb, offset + 5, 2, TRUE);
4774 case TAG_FH_HOPPING_PARAMETER:
4777 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 2",
4781 g_snprintf (out_buff, SHORT_STR, "Prime Radix: %u, Number of Channels: %u",
4782 tvb_get_guint8(tvb, offset + 2),
4783 tvb_get_guint8(tvb, offset + 3));
4784 out_buff[SHORT_STR-1] = '\0';
4785 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2, tag_len, out_buff);
4786 proto_item_append_text(ti, ": %s", out_buff);
4792 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4793 "TSPEC tag length %u != 55", tag_len);
4796 add_fixed_field(tree, tvb, offset + 2, FIELD_QOS_TS_INFO);
4797 proto_tree_add_item(tree, tspec_nor_msdu, tvb, offset + 5, 2, TRUE);
4798 proto_tree_add_item(tree, tspec_max_msdu, tvb, offset + 7, 2, TRUE);
4799 proto_tree_add_item(tree, tspec_min_srv, tvb, offset + 9, 4, TRUE);
4800 proto_tree_add_item(tree, tspec_max_srv, tvb, offset + 13, 4, TRUE);
4801 proto_tree_add_item(tree, tspec_inact_int, tvb, offset + 17, 4, TRUE);
4802 proto_tree_add_item(tree, tspec_susp_int, tvb, offset + 21, 4, TRUE);
4803 proto_tree_add_item(tree, tspec_srv_start, tvb, offset + 25, 4, TRUE);
4804 proto_tree_add_item(tree, tspec_min_data, tvb, offset + 29, 4, TRUE);
4805 proto_tree_add_item(tree, tspec_mean_data, tvb, offset + 33, 4, TRUE);
4806 proto_tree_add_item(tree, tspec_peak_data, tvb, offset + 37, 4, TRUE);
4807 proto_tree_add_item(tree, tspec_burst_size, tvb, offset + 41, 4, TRUE);
4808 proto_tree_add_item(tree, tspec_delay_bound, tvb, offset + 45, 4, TRUE);
4809 proto_tree_add_item(tree, tspec_min_phy, tvb, offset + 49, 4, TRUE);
4810 proto_tree_add_item(tree, tspec_surplus, tvb, offset + 53, 2, TRUE);
4811 proto_tree_add_item(tree, tspec_medium, tvb, offset + 55, 2, TRUE);
4817 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4818 "TS_DELAY tag length %u != 4", tag_len);
4821 proto_tree_add_item(tree, ts_delay, tvb, offset + 2, 4, TRUE);
4827 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4828 "TCLAS element is too small %u", tag_len);
4835 type = tvb_get_guint8(tvb, offset + 2);
4836 proto_tree_add_item(tree, hf_tsinfo_up, tvb, offset + 2, 1, TRUE);
4837 proto_tree_add_item(tree, hf_class_type, tvb, offset + 3, 1, TRUE);
4838 proto_tree_add_item(tree, hf_class_mask, tvb, offset + 4, 1, TRUE);
4842 proto_tree_add_item(tree, ff_src_mac_addr, tvb, offset + 5,
4844 proto_tree_add_item(tree, ff_dst_mac_addr, tvb, offset + 11,
4846 proto_tree_add_item(tree, hf_ether_type, tvb, offset + 17,
4851 version = tvb_get_guint8(tvb, offset + 5);
4852 proto_tree_add_item(tree, cf_version, tvb, offset + 5, 1, TRUE);
4855 proto_tree_add_item(tree, cf_ipv4_src, tvb, offset + 6,
4857 proto_tree_add_item(tree, cf_ipv4_dst, tvb, offset + 10,
4859 proto_tree_add_item(tree, cf_src_port, tvb, offset + 14,
4861 proto_tree_add_item(tree, cf_dst_port, tvb, offset + 16,
4863 proto_tree_add_item(tree, cf_dscp, tvb, offset + 18,
4865 proto_tree_add_item(tree, cf_protocol, tvb, offset + 19,
4868 else if (version == 6)
4870 proto_tree_add_item(tree, cf_ipv6_src, tvb, offset + 6,
4872 proto_tree_add_item(tree, cf_ipv6_dst, tvb, offset + 22,
4874 proto_tree_add_item(tree, cf_src_port, tvb, offset + 38,
4876 proto_tree_add_item(tree, cf_dst_port, tvb, offset + 40,
4878 proto_tree_add_item(tree, cf_flow, tvb, offset + 42,
4884 proto_tree_add_item(tree, cf_tag_type, tvb, offset + 5,
4894 case TAG_TCLAS_PROCESS:
4897 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4898 "TCLAS_PROCESS element length %u != 1", tag_len);
4901 proto_tree_add_item(tree, hf_tclas_process, tvb, offset + 2, 1, TRUE);
4907 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
4908 "TCLAS_PROCESS element length %u != 14", tag_len);
4911 add_fixed_field(tree, tvb, offset + 2, FIELD_SCHEDULE_INFO);
4912 proto_tree_add_item(tree, hf_sched_srv_start, tvb, offset + 4, 4, TRUE);
4913 proto_tree_add_item(tree, hf_sched_srv_int, tvb, offset + 8, 4, TRUE);
4914 proto_tree_add_item(tree, hf_sched_spec_int, tvb, offset + 12, 2, TRUE);
4917 case TAG_CHALLENGE_TEXT:
4918 g_snprintf (out_buff, SHORT_STR, "Challenge text: %s",
4919 tvb_bytes_to_str(tvb, offset + 2, tag_len));
4920 out_buff[SHORT_STR-1] = '\0';
4921 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4926 case TAG_ERP_INFO_OLD:
4932 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 1",
4936 erp_info = tvb_get_guint8 (tvb, offset + 2);
4937 g_snprintf (print_buff, SHORT_STR, "%sNon-ERP STAs, %suse protection, %s preambles",
4938 erp_info & 0x01 ? "" : "no ",
4939 erp_info & 0x02 ? "" : "do not ",
4940 /* 802.11g, 7.3.2.13: 1 means "one or more ... STAs
4941 * are not short preamble capable" */
4942 erp_info & 0x04 ? "long": "short or long");
4943 print_buff[SHORT_STR-1] = '\0';
4944 g_snprintf (out_buff, SHORT_STR,
4945 "ERP info: 0x%x (%s)",erp_info,print_buff);
4946 out_buff[SHORT_STR-1] = '\0';
4947 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2,
4949 proto_item_append_text(ti, ": %s", print_buff);
4953 case TAG_CISCO_UNKNOWN_1:
4955 * If Aironet IE support is enabled, the access point sends an Aironet
4956 * IE 0x85 (which contains the access point name, load, number of
4957 * associated clients, and so on) in the beacon and probe responses of
4958 * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
4959 * (which contains the management IP address of the controller and
4960 * the IP address of the access point) in the reassociation response
4961 * if it receives Aironet IE 0x85 in the reassociation request.
4964 /* The Name of the sending device starts at offset 10 and is up to
4965 15 or 16 bytes in length, \0 padded */
4968 proto_tree_add_text (tree, tvb, offset + 2, tag_len, "Tag length %u too short, must be >= 26",
4972 /* A cisco AP transmits the first 15 bytes of the AP name, probably
4973 followed by '\0' for ASCII termination */
4974 g_snprintf (out_buff, SHORT_STR, "%.16s",
4975 tvb_format_stringzpad(tvb, offset + 12, 16));
4976 out_buff[SHORT_STR-1] = '\0';
4977 proto_tree_add_string_format (tree, tag_interpretation, tvb, offset + 2,
4978 tag_len, "", "Tag interpretation: Unknown + Name: %s #Clients: %u",
4980 /* Total number off associated clients and repeater access points */
4981 tvb_get_guint8(tvb, offset + 28));
4982 if (check_col (pinfo->cinfo, COL_INFO)) {
4983 col_append_fstr(pinfo->cinfo, COL_INFO, ", Name=\"%s\"", out_buff);
4988 * 7.3.2.26 Vendor Specific information element
4990 * information element is in the format shown in Figure 7-75 and requires that the first 3 octets of the
4991 * information field contain the OUI of the entity that has defined the content of the particular Vendor Specific
4992 * information element. The length of the information field (n) is 3 >= n =< 255. The OUI field shall be a public
4993 * OUI assigned by the IEEE. It is 3 octets in length. The length of the vendor-specific content is n-3 octets.
4995 * Element ID Length OUI Vendor-specific content
4999 case TAG_VENDOR_SPECIFIC_IE:
5000 tvb_ensure_bytes_exist (tvb, offset + 2, tag_len);
5002 oui = tvb_get_ntoh24(tvb, offset + 2);
5003 tag_tvb = tvb_new_subset(tvb, offset + 2, tag_len, tag_len);
5004 tag_data_ptr = tvb_get_ptr(tag_tvb, 0, 3);
5005 proto_tree_add_bytes_format (tree, tag_oui, tvb, offset + 2, 3,
5006 tag_data_ptr, "Vendor: %s", get_manuf_name(tag_data_ptr));
5007 proto_item_append_text(ti, ": %s", get_manuf_name(tag_data_ptr));
5009 #define WPAWME_OUI 0x0050F2
5010 #define RSNOUI_VAL 0x000FAC
5011 #define PRE11N_OUI 0x00904c
5015 dissect_vendor_ie_wpawme(ti, tree, tag_tvb);
5018 dissect_vendor_ie_rsn(ti, tree, tag_tvb);
5020 case OUI_CISCOWL: /* Cisco Wireless (Aironet) */
5021 dissect_vendor_ie_aironet(ti, tree, tvb, offset + 5, tag_len - 3);
5024 dissect_vendor_ie_ht(ti, tree, tag_tvb);
5027 dissect_vendor_ie_marvell(ti, tree, tvb, offset + 5, tag_len - 3);
5030 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 5,
5031 tag_len - 3, "Not interpreted");
5039 tag_tvb = tvb_new_subset(tvb, offset + 2, tag_len, tag_len);
5040 dissect_rsn_ie(tree, tag_tvb);
5043 case TAG_HT_CAPABILITY:
5044 dissect_ht_capability_ie(tree, tvb, offset + 2, tag_len, FALSE);
5048 dissect_ht_info_ie_1_1(tree, tvb, offset + 2, tag_len);
5050 /*** Begin: Secondary Channel Offset Tag - Dustin Johnson ***/
5051 case TAG_SECONDARY_CHANNEL_OFFSET:
5052 secondary_channel_offset_ie(tree, tvb, offset + 2, tag_len);
5054 /*** End: Secondary Channel Offset Tag - Dustin Johnson ***/
5056 /*** Begin: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
5058 dissect_wsie_ie(tree, tvb, offset + 3, tag_len);
5060 /*** End: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
5062 /*** Begin: Power Capability Tag - Dustin Johnson ***/
5063 case TAG_POWER_CAPABILITY:
5068 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5069 "Power Capability: Error: Tag length must be exactly 2 bytes long");
5072 proto_tree_add_item(tree, hf_tag_power_capability_min, tvb, offset, 1, TRUE);
5073 proto_tree_add_item(tree, hf_tag_power_capability_max, tvb, offset+1, 1, TRUE);
5076 /*** End: Power Capability Tag - Dustin Johnson ***/
5078 * 7.3.2.18 TPC Report element
5081 case TAG_TPC_REPORT:
5083 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5084 "TPC Report: Error: Tag length must be 2 bytes long");
5085 /* Transmit Power field
5086 * The field is coded as a signed integer in units of decibels relative to 1 mW
5089 proto_tree_add_item(tree, hf_tag_tpc_report_trsmt_pow, tvb, offset, 1, TRUE);
5092 proto_tree_add_item(tree, hf_tag_tpc_report_link_mrg, tvb, offset, 1, TRUE);
5095 /*** Begin: Supported Channels Tag - Dustin Johnson ***/
5096 case TAG_SUPPORTED_CHANNELS:
5098 proto_item *chan_item;
5099 proto_tree *chan_tree;
5103 if (tag_len > 8) /* XXX Is this a sane limit? */
5105 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5106 "Supported Channels: Error: Tag length too long");
5107 } else if (tag_len % 2 == 1) {
5108 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5109 "Supported Channels: Error: Tag length must be even");
5112 for (i=0; i<(tag_len/2); i++)
5114 chan_item = proto_tree_add_uint_format(tree, hf_tag_supported_channels, tvb, offset, 2, i,
5115 "Supported Channels Set #%d", i);
5116 chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
5117 proto_tree_add_item(chan_tree, hf_tag_supported_channels_first, tvb, offset++, 1, TRUE);
5118 proto_tree_add_item(chan_tree, hf_tag_supported_channels_range, tvb, offset++, 1, TRUE);
5122 /*** End: Supported Channels Tag - Dustin Johnson ***/
5124 /*** Begin: Measure Request Tag - Dustin Johnson ***/
5125 case TAG_MEASURE_REQ:
5128 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5129 "Measurement Request: Error: Tag length must be at least 3 bytes long");
5131 guint8 info, request_type;
5133 proto_item *parent_item;
5134 proto_tree *sub_tree;
5137 tag_offset = offset;
5138 info = tvb_get_guint8 (tvb, offset);
5139 proto_tree_add_uint_format(tree, hf_tag_measure_request_measurement_token, tvb,
5140 offset, 1, info, "Measurement Token: 0x%02X", info);
5142 info = tvb_get_guint8 (tvb, ++offset);
5143 parent_item = proto_tree_add_uint_format(tree, hf_tag_measure_request_mode, tvb,
5144 offset, 1, info, "Measurement Request Mode: 0x%02X", info);
5145 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5146 proto_tree_add_uint(sub_tree, hf_tag_measure_request_mode_reserved1, tvb, offset, 1, info);
5147 proto_tree_add_boolean(sub_tree, hf_tag_measure_request_mode_enable, tvb, offset, 1, info);
5148 proto_tree_add_boolean(sub_tree, hf_tag_measure_request_mode_request, tvb, offset, 1, info);
5149 proto_tree_add_boolean(sub_tree, hf_tag_measure_request_mode_report, tvb, offset, 1, info);
5150 proto_tree_add_uint(sub_tree, hf_tag_measure_request_mode_reserved2, tvb, offset, 1, info);
5152 request_type = tvb_get_guint8 (tvb, ++offset);
5153 parent_item = proto_tree_add_uint(tree, hf_tag_measure_request_type, tvb, offset, 1, request_type);
5154 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5157 switch (request_type) {
5158 case 0: /* Basic Request */
5159 case 1: /* Clear channel assessment (CCA) request */
5160 case 2: /* Receive power indication (RPI) histogram request */
5162 guint8 channel_number;
5166 channel_number = tvb_get_guint8 (tvb, offset);
5167 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);
5169 start_time = tvb_get_letoh64 (tvb, offset);
5170 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);
5173 duration = tvb_get_letohs (tvb, offset);
5174 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);
5177 case 3: /* Channel Load Request */
5178 case 4: /* Noise Histogram Request */
5180 guint8 regulatory_class, channel_number;
5181 guint16 rand_interval, duration;
5183 regulatory_class = tvb_get_guint8 (tvb, offset);
5184 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_regulatory_class, tvb, offset, 1, regulatory_class, "Regulatory Class: 0x%02X", regulatory_class);
5187 channel_number = tvb_get_guint8 (tvb, offset);
5188 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);
5191 rand_interval = tvb_get_letohs (tvb, offset);
5192 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);
5195 duration = tvb_get_letohs (tvb, offset);
5196 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);
5199 case 5: /* Beacon Request */
5201 guint8 regulatory_class, channel_number, measurement_mode, reporting_condition, threshold_offset;
5202 guint16 rand_interval, duration;
5203 const guint8 *bssid = NULL;
5205 regulatory_class = tvb_get_guint8 (tvb, offset);
5206 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_regulatory_class, tvb, offset, 1, regulatory_class, "Regulatory Class: 0x%02X", regulatory_class);
5209 channel_number = tvb_get_guint8 (tvb, offset);
5210 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);
5213 rand_interval = tvb_get_letohs (tvb, offset);
5214 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);
5217 duration = tvb_get_letohs (tvb, offset);
5218 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);
5221 measurement_mode = tvb_get_guint8 (tvb, offset);
5222 proto_tree_add_uint(sub_tree, hf_tag_measure_request_measurement_mode, tvb, offset, 1, measurement_mode);
5225 bssid = tvb_get_ptr (tvb, offset, 6);
5226 proto_tree_add_ether(sub_tree, hf_tag_measure_request_bssid, tvb, offset, 6, bssid);
5229 reporting_condition = tvb_get_guint8 (tvb, offset);
5230 proto_tree_add_uint(sub_tree, hf_tag_measure_request_reporting_condition, tvb, offset, 1, reporting_condition);
5233 threshold_offset = tvb_get_guint8 (tvb, offset);
5234 if (reporting_condition == 0) {
5236 } else if (reporting_condition >= 1 && reporting_condition <= 4){ /* Unsigned dBm */
5237 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);
5238 } else if (reporting_condition == 5 || reporting_condition == 6 || reporting_condition == 9){ /* Signed dBm */
5239 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);
5240 } else if (reporting_condition == 7 || reporting_condition == 8 || reporting_condition == 10){ /* Signed dB */
5241 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);
5247 add_tagged_field (pinfo, sub_tree, tvb, offset);
5251 case 6: /* Frame Request */
5253 guint8 regulatory_class, channel_number;
5254 guint16 rand_interval, duration;
5255 const guint8 *mac = NULL;
5257 regulatory_class = tvb_get_guint8 (tvb, offset);
5258 proto_tree_add_uint_format(sub_tree, hf_tag_measure_request_regulatory_class, tvb, offset, 1, regulatory_class, "Regulatory Class: 0x%02X", regulatory_class);
5261 channel_number = tvb_get_guint8 (tvb, offset);
5262 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);
5265 rand_interval = tvb_get_letohs (tvb, offset);
5266 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);
5269 duration = tvb_get_letohs (tvb, offset);
5270 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);
5273 if (tag_len >= ((offset-tag_offset)+6)){
5274 mac = tvb_get_ptr (tvb, offset, 6);
5275 proto_tree_add_ether(sub_tree, hf_tag_measure_request_bssid, tvb, offset, 6, mac);
5279 case 7: /* BSTA Statistics Request */
5282 guint16 rand_interval, duration;
5285 rand_interval = tvb_get_letohs (tvb, offset);
5286 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);
5289 duration = tvb_get_letohs (tvb, offset);
5290 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);
5293 group_id = tvb_get_guint8 (tvb, offset);
5294 proto_tree_add_uint(sub_tree, hf_tag_measure_request_group_id, tvb, offset, 1, group_id);
5297 case 8: /* Location Configuration Indication (LCI) Request */
5299 case 9: /* Transmit Stream Measurement Request */
5301 case 255: /* Measurement Pause Request*/
5303 default: /* unknown */
5304 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Undissected Data");
5310 /* End: Measure Request Tag - Dustin Johnson */
5311 /* Begin: Measure Report Tag - Dustin Johnson */
5312 /* 7.3.2.22 Measurement Report element
5313 * The Length field is variable and depends on the length of the
5314 * Measurement Report field. The minimum value of the Length field is 3.
5316 case TAG_MEASURE_REP:
5319 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5320 "Measurement Report: Error: Tag length must be at least 3 bytes long");
5322 guint8 info, report_type, channel_number;
5325 proto_item *parent_item;
5326 proto_tree *sub_tree;
5330 tag_offset = offset;
5331 info = tvb_get_guint8 (tvb, offset);
5332 proto_tree_add_uint_format(tree, hf_tag_measure_report_measurement_token, tvb,
5333 offset, 1, info, "Measurement Token: 0x%02X", info);
5336 info = tvb_get_guint8 (tvb, offset);
5337 parent_item = proto_tree_add_uint_format(tree, hf_tag_measure_report_mode, tvb,
5338 offset, 1, info, "Measurement Report Mode: 0x%02X", info);
5339 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5340 proto_tree_add_boolean(sub_tree, hf_tag_measure_report_mode_late, tvb, offset, 1, info);
5341 proto_tree_add_boolean(sub_tree, hf_tag_measure_report_mode_incapable, tvb, offset, 1, info);
5342 proto_tree_add_boolean(sub_tree, hf_tag_measure_report_mode_refused, tvb, offset, 1, info);
5343 proto_tree_add_uint(sub_tree, hf_tag_measure_report_mode_reserved, tvb, offset, 1, info);
5346 report_type = tvb_get_guint8 (tvb, offset);
5347 parent_item = proto_tree_add_uint(tree, hf_tag_measure_report_type, tvb, offset, 1, report_type);
5348 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5353 switch (report_type) {
5354 case 0: /* Basic Report */
5356 proto_tree *sub_tree_map_field;
5358 channel_number = tvb_get_guint8 (tvb, offset);
5359 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);
5362 start_time = tvb_get_letoh64 (tvb, offset);
5363 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);
5366 duration = tvb_get_letohs (tvb, offset);
5367 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);
5370 info = tvb_get_guint8 (tvb, offset);
5371 parent_item = proto_tree_add_uint_format(tree, hf_tag_measure_basic_map_field, tvb,
5372 offset, 1, info, "Map Field: 0x%02X", info);
5373 sub_tree_map_field = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5374 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_bss, tvb, offset, 1, info);
5375 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_odfm, tvb, offset, 1, info);
5376 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_unident_signal, tvb, offset, 1, info);
5377 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_radar, tvb, offset, 1, info);
5378 proto_tree_add_boolean(sub_tree_map_field, hf_tag_measure_map_field_unmeasured, tvb, offset, 1, info);
5379 proto_tree_add_uint(sub_tree_map_field, hf_tag_measure_map_field_reserved, tvb, offset, 1, info);
5382 case 1: /* Clear channel assessment (CCA) report */
5383 channel_number = tvb_get_guint8 (tvb, offset);
5384 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);
5387 start_time = tvb_get_letoh64 (tvb, offset);
5388 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);
5391 duration = tvb_get_letohs (tvb, offset);
5392 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);
5395 info = tvb_get_guint8 (tvb, offset);
5396 proto_tree_add_uint_format(sub_tree, hf_tag_measure_cca_busy_fraction, tvb, offset, 1, info, "CCA Busy Fraction: 0x%02X", info);
5398 case 2: /* Receive power indication (RPI) histogram report */
5399 channel_number = tvb_get_guint8 (tvb, offset);
5400 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);
5403 start_time = tvb_get_letoh64 (tvb, offset);
5404 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);
5407 duration = tvb_get_letohs (tvb, offset);
5408 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);
5411 parent_item = proto_tree_add_string(sub_tree, hf_tag_measure_rpi_histogram_report, tvb,
5412 offset, 8, "RPI Histogram Report");
5413 sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5414 info = tvb_get_guint8 (tvb, offset);
5415 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_0, tvb, offset, 1, info, "RPI 0 Density: 0x%02X", info);
5416 info = tvb_get_guint8 (tvb, ++offset);
5417 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_1, tvb, offset, 1, info, "RPI 1 Density: 0x%02X", info);
5418 info = tvb_get_guint8 (tvb, ++offset);
5419 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_2, tvb, offset, 1, info, "RPI 2 Density: 0x%02X", info);
5420 info = tvb_get_guint8 (tvb, ++offset);
5421 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_3, tvb, offset, 1, info, "RPI 3 Density: 0x%02X", info);
5422 info = tvb_get_guint8 (tvb, ++offset);
5423 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_4, tvb, offset, 1, info, "RPI 4 Density: 0x%02X", info);
5424 info = tvb_get_guint8 (tvb, ++offset);
5425 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_5, tvb, offset, 1, info, "RPI 5 Density: 0x%02X", info);
5426 info = tvb_get_guint8 (tvb, ++offset);
5427 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_6, tvb, offset, 1, info, "RPI 6 Density: 0x%02X", info);
5428 info = tvb_get_guint8 (tvb, ++offset);
5429 proto_tree_add_uint_format(sub_tree, hf_tag_measure_rpi_histogram_report_7, tvb, offset, 1, info, "RPI 7 Density: 0x%02X", info);
5431 case 3: /* Channel Load Report */
5433 guint8 regulatory_class, channel_load;
5435 regulatory_class = tvb_get_guint8 (tvb, offset);
5436 proto_tree_add_uint(sub_tree, hf_tag_measure_report_regulatory_class, tvb, offset, 1, regulatory_class);
5439 channel_number = tvb_get_guint8 (tvb, offset);
5440 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);
5443 start_time = tvb_get_letoh64 (tvb, offset);
5444 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);
5447 duration = tvb_get_letohs (tvb, offset);
5448 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);
5451 channel_load = tvb_get_guint8 (tvb, offset);
5452 proto_tree_add_uint(sub_tree, hf_tag_measure_report_channel_load, tvb, offset, 1, channel_load);
5455 case 4: /* Noise Histogram Report */
5457 proto_tree_add_text (sub_tree, tvb, offset, tag_len - (offset - tag_offset), "Undissected Data");
5459 case 5: /* Beacon Report */
5461 guint8 regulatory_class, reported_frame_info, rcpi, rsni, ant_id;
5463 proto_tree *sub_tree_frame_info;
5464 const guint8 *bssid = NULL;
5466 regulatory_class = tvb_get_guint8 (tvb, offset);
5467 proto_tree_add_uint(sub_tree, hf_tag_measure_report_regulatory_class, tvb, offset, 1, regulatory_class);
5470 channel_number = tvb_get_guint8 (tvb, offset);
5471 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);
5474 start_time = tvb_get_letoh64 (tvb, offset);
5475 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);
5478 duration = tvb_get_letohs (tvb, offset);
5479 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);
5482 reported_frame_info = tvb_get_guint8 (tvb, offset);
5483 parent_item = proto_tree_add_uint(sub_tree, hf_tag_measure_report_frame_info, tvb, offset, 1, reported_frame_info);
5484 sub_tree_frame_info = proto_item_add_subtree(parent_item, ett_tag_measure_request_tree);
5485 proto_tree_add_uint(sub_tree_frame_info, hf_tag_measure_report_frame_info_phy_type, tvb, offset, 1, reported_frame_info);
5486 proto_tree_add_uint(sub_tree_frame_info, hf_tag_measure_report_frame_info_frame_type, tvb, offset, 1, reported_frame_info);
5489 rcpi = tvb_get_guint8 (tvb, offset);
5490 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);
5493 rsni = tvb_get_guint8 (tvb, offset);
5494 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);
5497 bssid = tvb_get_ptr (tvb, offset, 6);
5498 proto_tree_add_ether(sub_tree, hf_tag_measure_request_bssid, tvb, offset, 6, bssid);
5501 ant_id = tvb_get_guint8 (tvb, offset);
5502 proto_tree_add_uint(sub_tree, hf_tag_measure_report_ant_id, tvb, offset, 1, ant_id);
5505 parent_tsf = tvb_get_letohl (tvb, offset);
5506 proto_tree_add_uint(sub_tree, hf_tag_measure_report_parent_tsf, tvb, offset, 4, parent_tsf);
5509 /* TODO - Must determine frame type and dissect this */
5510 if (tag_len > (offset - tag_offset))
5512 proto_tree_add_text (sub_tree, tvb, offset, tag_len - (offset - tag_offset), "Reported Frame Body");
5516 case 6: /* Frame Report */
5518 case 7: /* BSTA Statistics Report */
5520 case 8: /* Location Configuration Information Report element */
5522 case 9: /* Transmit Stream Measurement Report */
5524 default: /* unknown */
5525 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Undissected Data");
5531 /*** End: Measure Report Tag - Dustin Johnson ***/
5532 /*** Begin: Extended Capabilities Tag - Dustin Johnson ***/
5533 /* The Capabilities field is a bit field indicating the capabilities being advertised
5534 * by the STA transmitting the information element
5536 case TAG_EXTENDED_CAPABILITIES:
5539 guint8 info_exchange;
5541 proto_tree *ex_cap_tree;
5545 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5546 "Extended Capabilities: Error: Tag length must be at least 1 byte long");
5550 tag_offset = offset;
5552 info_exchange = tvb_get_guint8 (tvb, offset);
5553 ti = proto_tree_add_item (tree, hf_tag_extended_capabilities, tvb, offset, 1, FALSE);
5554 ex_cap_tree = proto_item_add_subtree (ti, ett_tag_ex_cap);
5555 proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b0, tvb, offset, 1, FALSE);
5556 proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b1, tvb, offset, 1, FALSE);
5557 proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b2, tvb, offset, 1, FALSE);
5558 proto_tree_add_item (ex_cap_tree, hf_tag_extended_capabilities_b3, tvb, offset, 1, FALSE);
5560 if (tag_len > (offset - tag_offset))
5562 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
5567 /*** End: Extended Capabilities Tag - Dustin Johnson ***/
5568 /*** Begin: Neighbor Report Tag - Dustin Johnson ***/
5569 case TAG_NEIGHBOR_REPORT:
5571 #define SUB_TAG_TSF_INFO 0x01
5572 #define SUB_TAG_MEASUREMENT_PILOT_INFO 0x02
5573 #define SUB_TAG_HT_CAPABILITIES 0x03
5574 #define SUB_TAG_HT_INFO 0x04
5575 #define SUB_TAG_SEC_CHANNEL_OFFSET 0x05
5576 #define SUB_TAG_VENDOR_SPECIFIC 0xDD
5581 guint32 bssid_info, info, sub_tag_length;
5582 const guint8 *bssid = NULL;
5583 proto_item *parent_item;
5584 proto_tree *bssid_info_subtree, *sub_tag_tree;
5585 tvbuff_t *volatile sub_tag_tvb = NULL;
5589 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5590 "Neighbor Report: Error: Tag length must be at least 13 bytes long");
5594 tag_offset = offset;
5596 bssid = tvb_get_ptr (tvb, offset, 6);
5597 proto_tree_add_ether(tree, hf_tag_neighbor_report_bssid, tvb, offset, 6, bssid);
5599 /*** Begin: BSSID Information ***/
5601 bssid_info = tvb_get_letohl (tvb, offset);
5602 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);
5603 bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
5605 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_reachability, tvb, offset, 1, bssid_info);
5606 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_security, tvb, offset, 1, bssid_info);
5607 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 1, bssid_info);
5608 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 1, bssid_info);
5609 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 1, bssid_info);
5610 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 1, bssid_info);
5611 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 1, bssid_info);
5612 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_dback, tvb, offset+1, 1, bssid_info);
5613 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_capability_iback, tvb, offset+1, 1, bssid_info);
5614 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset+1, 1, bssid_info);
5615 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_high_throughput, tvb, offset+1, 1, bssid_info);
5616 proto_tree_add_uint(bssid_info_subtree, hf_tag_neighbor_report_bssid_info_reserved, tvb, offset+1, 3, (bssid_info & 0xfffff000) >> 12);
5617 /*** End: BSSID Information ***/
5620 info = tvb_get_guint8 (tvb, offset);
5621 proto_tree_add_uint_format(tree, hf_tag_neighbor_report_reg_class, tvb, offset, 1, info, "Regulatory Class: 0x%02X", info);
5624 info = tvb_get_guint8 (tvb, offset);
5625 proto_tree_add_uint_format(tree, hf_tag_neighbor_report_channel_number, tvb, offset, 1, info, "Channel Number: 0x%02X", info);
5628 info = tvb_get_guint8 (tvb, offset);
5629 proto_tree_add_uint_format(tree, hf_tag_neighbor_report_phy_type, tvb, offset, 1, info, "PHY Type: 0x%02X", info);
5632 sub_tag_id = tvb_get_guint8 (tvb, offset);
5634 sub_tag_length = tvb_get_guint8 (tvb, offset);
5637 sub_tag_tvb = tvb_new_subset(tvb, offset, sub_tag_length, -1);
5639 switch (sub_tag_id) {
5640 case SUB_TAG_TSF_INFO:
5643 case SUB_TAG_MEASUREMENT_PILOT_INFO:
5646 case SUB_TAG_HT_CAPABILITIES:
5647 parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "HT Capabilities");
5648 sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
5649 dissect_ht_capability_ie(sub_tag_tree, sub_tag_tvb, 0, sub_tag_length, FALSE);
5651 case SUB_TAG_HT_INFO:
5652 parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "HT Information");
5653 sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
5654 dissect_ht_info_ie_1_1(sub_tag_tree, sub_tag_tvb, 0, sub_tag_length);
5656 case SUB_TAG_SEC_CHANNEL_OFFSET:
5657 parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "Secondary Channel Offset");
5658 sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
5659 secondary_channel_offset_ie(sub_tag_tree, sub_tag_tvb, 0, sub_tag_length);
5661 case SUB_TAG_VENDOR_SPECIFIC:
5666 offset += sub_tag_length;
5668 if (tag_len > (offset - tag_offset))
5670 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
5675 /*** End: Neighbor Report Tag - Dustin Johnson ***/
5676 #if 0 /*Not yet assigned tag numbers by ANA */
5677 /*** Begin: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
5678 case TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT:
5684 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5685 "Extended Channel Switch Announcement: Error: Tag length must be exactly 4 bytes long");
5690 tag_offset = offset;
5692 offset+= add_fixed_field(tree, tvb, offset, FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT);
5694 if (tag_len > (offset - tag_offset))
5696 proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
5701 /*** End: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
5703 #if 0 /*Not yet assigned tag numbers by ANA */
5704 /*** Begin: Supported Regulatory Classes Tag - Dustin Johnson ***/
5705 case TAG_SUPPORTED_REGULATORY_CLASSES:
5708 guint8 current_field;
5711 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5712 "Supported Regulatory Classes: Error: Tag length must be at least 2 bytes long");
5714 } else if (tag_len > 32) {
5715 proto_tree_add_text (tree, tvb, offset + 2, tag_len,
5716 "Supported Regulatory Classes: Error: Tag length must be no more than 32 bytes long");
5721 tag_offset = offset;
5723 current_field = tvb_get_guint8 (tvb, offset);
5724 proto_tree_add_uint(tree, hf_tag_supported_reg_classes_current, tvb, offset, 1, current_field);
5727 /* Partially taken from the ssid section */
5728 tag_data_ptr = tvb_get_ptr (tvb, offset, tag_len);
5729 for (i = 0, n = 0; i < tag_len && n < SHORT_STR; i++) {
5730 ret = g_snprintf (print_buff + n, SHORT_STR - n, (i == tag_len-1)?"%d":"%d, ", tag_data_ptr[i]);
5731 if (ret == -1 || ret >= SHORT_STR - n) {
5732 /* Some versions of snprintf return -1 if they'd truncate
5733 the output. Others return <buf_size> or greater. */
5738 print_buff[SHORT_STR-1] = '\0';
5739 proto_tree_add_string (tree, hf_tag_supported_reg_classes_alternate, tvb, offset, tag_len, print_buff);
5743 /*** End: Supported Regulatory Classes Tag - Dustin Johnson ***/
5746 tvb_ensure_bytes_exist (tvb, offset + 2, tag_len);
5747 proto_tree_add_string (tree, tag_interpretation, tvb, offset + 1 + tag_len_len,
5748 tag_len, "Not interpreted");
5749 proto_item_append_text(ti, ": Tag %u Len %u", tag_no, tag_len);
5753 return tag_len + 1 + tag_len_len;
5757 ieee_80211_add_tagged_parameters (tvbuff_t * tvb, int offset, packet_info * pinfo,
5758 proto_tree * tree, int tagged_parameters_len)
5762 beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
5763 while (tagged_parameters_len > 0) {
5764 if ((next_len=add_tagged_field (pinfo, tree, tvb, offset))==0)
5766 if (next_len > tagged_parameters_len) {
5767 /* XXX - flag this as an error? */
5768 next_len = tagged_parameters_len;
5771 tagged_parameters_len -= next_len;
5775 /* ************************************************************************* */
5776 /* Dissect 802.11 management frame */
5777 /* ************************************************************************* */
5779 dissect_ieee80211_mgt (guint16 fcf, tvbuff_t * tvb, packet_info * pinfo,
5782 proto_item *ti = NULL;
5783 proto_tree *mgt_tree;
5784 proto_tree *fixed_tree;
5785 proto_tree *tagged_tree;
5787 int tagged_parameter_tree_len;
5791 CHECK_DISPLAY_AS_X(data_handle,proto_wlan_mgt, tvb, pinfo, tree);
5793 ti = proto_tree_add_item (tree, proto_wlan_mgt, tvb, 0, -1, FALSE);
5794 mgt_tree = proto_item_add_subtree (ti, ett_80211_mgt);
5796 switch (COMPOSE_FRAME_TYPE(fcf))
5800 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 4);
5801 add_fixed_field(fixed_tree, tvb, 0, FIELD_CAP_INFO);
5802 add_fixed_field(fixed_tree, tvb, 2, FIELD_LISTEN_IVAL);
5803 offset = 4; /* Size of fixed fields */
5805 tagged_parameter_tree_len =
5806 tvb_reported_length_remaining(tvb, offset);
5807 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5808 tagged_parameter_tree_len);
5809 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5810 tagged_parameter_tree_len);
5814 case MGT_ASSOC_RESP:
5815 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
5816 add_fixed_field(fixed_tree, tvb, 0, FIELD_CAP_INFO);
5817 add_fixed_field(fixed_tree, tvb, 2, FIELD_STATUS_CODE);
5818 add_fixed_field(fixed_tree, tvb, 4, FIELD_ASSOC_ID);
5819 offset = 6; /* Size of fixed fields */
5821 tagged_parameter_tree_len =
5822 tvb_reported_length_remaining(tvb, offset);
5823 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5824 tagged_parameter_tree_len);
5825 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5826 tagged_parameter_tree_len);
5830 case MGT_REASSOC_REQ:
5831 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 10);
5832 add_fixed_field(fixed_tree, tvb, 0, FIELD_CAP_INFO);
5833 add_fixed_field(fixed_tree, tvb, 2, FIELD_LISTEN_IVAL);
5834 add_fixed_field(fixed_tree, tvb, 4, FIELD_CURRENT_AP_ADDR);
5835 offset = 10; /* Size of fixed fields */
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_REASSOC_RESP:
5846 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
5847 add_fixed_field(fixed_tree, tvb, 0, FIELD_CAP_INFO);
5848 add_fixed_field(fixed_tree, tvb, 2, FIELD_STATUS_CODE);
5849 add_fixed_field(fixed_tree, tvb, 4, FIELD_ASSOC_ID);
5850 offset = 6; /* Size of fixed fields */
5852 tagged_parameter_tree_len =
5853 tvb_reported_length_remaining(tvb, offset);
5854 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5855 tagged_parameter_tree_len);
5856 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5857 tagged_parameter_tree_len);
5863 tagged_parameter_tree_len =
5864 tvb_reported_length_remaining(tvb, offset);
5865 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5866 tagged_parameter_tree_len);
5867 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5868 tagged_parameter_tree_len);
5871 case MGT_PROBE_RESP:
5873 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
5874 add_fixed_field(fixed_tree, tvb, 0, FIELD_TIMESTAMP);
5875 add_fixed_field(fixed_tree, tvb, 8, FIELD_BEACON_INTERVAL);
5876 add_fixed_field(fixed_tree, tvb, 10, FIELD_CAP_INFO);
5877 offset = 12; /* Size of fixed fields */
5879 tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
5880 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
5881 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len);
5884 case MGT_MEASUREMENT_PILOT:
5886 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
5887 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_TIMESTAMP);
5888 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_MEASUREMENT_PILOT_INT);
5889 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_BEACON_INTERVAL);
5890 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_CAP_INFO);
5891 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_COUNTRY_STR);
5892 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_MAX_REG_PWR);
5893 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_MAX_TX_PWR);
5894 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_TX_PWR_USED);
5895 offset += add_fixed_field(fixed_tree, tvb, offset, FIELD_TRANSCEIVER_NOISE_FLOOR);
5896 /* TODO DS Parameter Set ??? */
5898 tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
5899 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
5900 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len);
5903 case MGT_BEACON: /* Dissect protocol payload fields */
5904 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
5905 add_fixed_field(fixed_tree, tvb, 0, FIELD_TIMESTAMP);
5906 add_fixed_field(fixed_tree, tvb, 8, FIELD_BEACON_INTERVAL);
5907 add_fixed_field(fixed_tree, tvb, 10, FIELD_CAP_INFO);
5908 offset = 12; /* Size of fixed fields */
5910 tagged_parameter_tree_len =
5911 tvb_reported_length_remaining(tvb, offset);
5912 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5913 tagged_parameter_tree_len);
5914 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5915 tagged_parameter_tree_len);
5922 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
5923 add_fixed_field(fixed_tree, tvb, 0, FIELD_REASON_CODE);
5926 case MGT_AUTHENTICATION:
5927 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
5928 add_fixed_field(fixed_tree, tvb, 0, FIELD_AUTH_ALG);
5929 add_fixed_field(fixed_tree, tvb, 2, FIELD_AUTH_TRANS_SEQ);
5930 add_fixed_field(fixed_tree, tvb, 4, FIELD_STATUS_CODE);
5931 offset = 6; /* Size of fixed fields */
5933 tagged_parameter_tree_len =
5934 tvb_reported_length_remaining(tvb, offset);
5935 if (tagged_parameter_tree_len != 0)
5937 tagged_tree = get_tagged_parameter_tree (mgt_tree,
5940 tagged_parameter_tree_len);
5941 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5942 tagged_parameter_tree_len);
5946 case MGT_DEAUTHENTICATION:
5947 fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
5948 add_fixed_field(fixed_tree, tvb, 0, FIELD_REASON_CODE);
5953 proto_item *fixed_hdr;
5954 proto_tree *fixed_tree;
5955 fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters");
5956 fixed_tree = proto_item_add_subtree (fixed_hdr, ett_fixed_parameters);
5958 offset += add_fixed_field(fixed_tree, tvb, 0, FIELD_ACTION);
5960 proto_item_set_len(fixed_hdr, offset);
5961 tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
5962 if (tagged_parameter_tree_len != 0)
5964 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5965 tagged_parameter_tree_len);
5966 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5967 tagged_parameter_tree_len);
5971 case MGT_ACTION_NO_ACK:
5973 proto_item *fixed_hdr;
5974 proto_tree *fixed_tree;
5975 fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters");
5976 fixed_tree = proto_item_add_subtree (fixed_hdr, ett_fixed_parameters);
5978 offset += add_fixed_field(fixed_tree, tvb, 0, FIELD_ACTION);
5980 proto_item_set_len(fixed_hdr, offset);
5981 tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
5982 if (tagged_parameter_tree_len != 0)
5984 tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
5985 tagged_parameter_tree_len);
5986 ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
5987 tagged_parameter_tree_len);
5991 case MGT_ARUBA_WLAN:
5993 proto_item *aruba_hdr;
5994 proto_tree *aruba_tree;
5996 type = tvb_get_ntohs(tvb, offset);
5998 aruba_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Aruba Management");
5999 aruba_tree = proto_item_add_subtree(aruba_hdr, ett_fixed_parameters);
6001 proto_tree_add_item(aruba_tree, cf_aruba, tvb, offset, 2, FALSE);
6003 /* HeartBeat Sequence */
6004 if ( type == 0x0005 )
6006 proto_tree_add_item(aruba_tree, cf_aruba_hb_seq, tvb, offset, 8, FALSE);
6009 if ( type == 0x0003 )
6011 proto_tree_add_item(aruba_tree, cf_aruba_mtu, tvb, offset, 2, FALSE);
6019 set_src_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type)
6021 if (check_col(pinfo->cinfo, COL_RES_DL_SRC))
6022 col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
6023 get_ether_name(addr), type);
6024 if (check_col(pinfo->cinfo, COL_UNRES_DL_SRC))
6025 col_add_str(pinfo->cinfo, COL_UNRES_DL_SRC, ether_to_str(addr));
6029 set_dst_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type)
6031 if (check_col(pinfo->cinfo, COL_RES_DL_DST))
6032 col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
6033 get_ether_name(addr), type);
6034 if (check_col(pinfo->cinfo, COL_UNRES_DL_DST))
6035 col_add_str(pinfo->cinfo, COL_UNRES_DL_DST, ether_to_str(addr));
6039 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
6043 c_crc = crc32_ccitt_tvb(tvb, hdr_len);
6044 c_crc = crc32_ccitt_seed(tvb_get_ptr(tvb, hdr_size, len), len, ~c_crc);
6047 c_crc = ((unsigned char)(c_crc>>0)<<24) |
6048 ((unsigned char)(c_crc>>8)<<16) |
6049 ((unsigned char)(c_crc>>16)<<8) |
6050 ((unsigned char)(c_crc>>24)<<0);
6062 /* ************************************************************************* */
6063 /* Dissect 802.11 frame */
6064 /* ************************************************************************* */
6067 * The 802.11n specification makes some fairly significant changes to the
6068 * layout of the MAC header. The first two bits of the MAC header are the
6069 * protocol version. You'd think that the 802.11 committee would have
6070 * bumped the version to indicate a different MAC layout, but NOOOO -- we
6071 * have to go digging for bits in various locations instead.
6075 dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo,
6076 proto_tree * tree, gboolean fixed_length_header, gint fcs_len,
6077 gboolean wlan_broken_fc, gboolean datapad,
6080 guint16 fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
6081 guint16 seq_control;
6082 guint32 seq_number, frag_number;
6083 gboolean more_frags;
6084 const guint8 *src = NULL;
6085 const guint8 *dst = NULL;
6086 const guint8 *bssid = NULL;
6087 proto_item *ti = NULL;
6088 proto_item *fcs_item = NULL;
6089 proto_item *cw_item = NULL;
6090 proto_item *hidden_item;
6091 proto_tree *hdr_tree = NULL;
6092 proto_tree *fcs_tree = NULL;
6093 proto_tree *cw_tree = NULL;
6094 guint16 hdr_len, ohdr_len, htc_len = 0;
6095 gboolean has_fcs, fcs_good, fcs_bad;
6096 gint len, reported_len, ivlen;
6097 gboolean is_amsdu = 0;
6098 gboolean save_fragmented;
6099 tvbuff_t *volatile next_tvb = NULL;
6101 volatile encap_t encap_type;
6102 guint8 octet1, octet2;
6103 char out_buff[SHORT_STR];
6106 const char *addr1_str = NULL;
6109 const gchar *fts_str;
6110 gchar flag_str[] = "opmPRMFTC";
6113 wlan_hdr *volatile whdr;
6114 static wlan_hdr whdrs[4];
6115 gboolean retransmitted;
6119 if (check_col (pinfo->cinfo, COL_PROTOCOL))
6120 col_set_str (pinfo->cinfo, COL_PROTOCOL, "IEEE 802.11");
6121 if (check_col (pinfo->cinfo, COL_INFO))
6122 col_clear (pinfo->cinfo, COL_INFO);
6125 frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
6126 if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
6127 ctrl_fcf = FETCH_FCF(10);
6131 if (fixed_length_header)
6132 hdr_len = DATA_LONG_HDR_LEN;
6134 hdr_len = find_header_length (fcf, ctrl_fcf, is_ht);
6137 hdr_len = roundup2(hdr_len, 4);
6139 fts_str = val_to_str(frame_type_subtype, frame_type_subtype_vals,
6140 "Unrecognized (Reserved frame)");
6141 if (check_col (pinfo->cinfo, COL_INFO))
6142 col_set_str (pinfo->cinfo, COL_INFO, fts_str);
6145 flags = FCF_FLAGS (fcf);
6146 more_frags = HAVE_FRAGMENTS (flags);
6148 for (i = 0; i < 8; i++) {
6149 if (! (flags & 0x80 >> i)) {
6154 if (is_ht && IS_STRICTLY_ORDERED(flags) &&
6155 ((FCF_FRAME_TYPE(fcf) == MGT_FRAME) || (FCF_FRAME_TYPE(fcf) == DATA_FRAME &&
6156 DATA_FRAME_IS_QOS(frame_type_subtype)))) {
6160 /* Add the FC to the current tree */
6163 ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
6164 "IEEE 802.11 %s", fts_str);
6165 hdr_tree = proto_item_add_subtree (ti, ett_80211);
6167 dissect_frame_control(hdr_tree, tvb, wlan_broken_fc, 0);
6169 if (frame_type_subtype == CTRL_PS_POLL)
6170 proto_tree_add_uint(hdr_tree, hf_assoc_id,tvb,2,2,
6171 ASSOC_ID(tvb_get_letohs(tvb,2)));
6174 proto_tree_add_uint (hdr_tree, hf_did_duration, tvb, 2, 2,
6175 tvb_get_letohs (tvb, 2));
6179 * Decode the part of the frame header that isn't the same for all
6186 switch (FCF_FRAME_TYPE (fcf))
6191 * All management frame types have the same header.
6193 src = tvb_get_ptr (tvb, 10, 6);
6194 dst = tvb_get_ptr (tvb, 4, 6);
6196 SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, src);
6197 SET_ADDRESS(&pinfo->src, AT_ETHER, 6, src);
6198 SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, dst);
6199 SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, dst);
6202 SET_ADDRESS(&whdr->bssid, AT_ETHER, 6, tvb_get_ptr(tvb, 16,6));
6203 SET_ADDRESS(&whdr->src, AT_ETHER, 6, src);
6204 SET_ADDRESS(&whdr->dst, AT_ETHER, 6, dst);
6205 whdr->type = frame_type_subtype;
6207 seq_control = tvb_get_letohs(tvb, 22);
6208 frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
6209 seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
6211 if (check_col (pinfo->cinfo, COL_INFO))
6213 col_append_fstr(pinfo->cinfo, COL_INFO,
6214 ", SN=%d", seq_number);
6216 col_append_fstr(pinfo->cinfo, COL_INFO,
6217 ", FN=%d",frag_number);
6222 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 4, 6, dst);
6224 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 10, 6, src);
6226 /* add items for wlan.addr filter */
6227 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 4, 6, dst);
6228 PROTO_ITEM_SET_HIDDEN(hidden_item);
6229 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 10, 6, src);
6230 PROTO_ITEM_SET_HIDDEN(hidden_item);
6232 proto_tree_add_ether (hdr_tree, hf_addr_bssid, tvb, 16, 6,
6233 tvb_get_ptr (tvb, 16, 6));
6235 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6238 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6246 * Control Wrapper frames insert themselves between address 1
6247 * and address 2 in a normal control frame. Process address 1
6248 * first, then handle the rest of the frame in dissect_control.
6250 if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
6251 offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
6252 ctrl_fcf = FETCH_FCF(10);
6253 ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
6255 offset = 10; /* FC + D/ID + Address 1 */
6257 ctrl_type_subtype = frame_type_subtype;
6260 switch (ctrl_type_subtype)
6263 addr1_str = "BSSID";
6264 addr1_hf = hf_addr_bssid;
6268 case CTRL_ACKNOWLEDGEMENT:
6270 case CTRL_CFP_ENDACK:
6271 case CTRL_BLOCK_ACK_REQ:
6272 case CTRL_BLOCK_ACK:
6274 addr1_hf = hf_addr_ra;
6280 if (!addr1_str) /* XXX - Should we throw some sort of error? */
6284 dst = tvb_get_ptr(tvb, 4, 6);
6285 set_dst_addr_cols(pinfo, dst, addr1_str);
6287 proto_tree_add_item(hdr_tree, addr1_hf, tvb, 4, 6, FALSE);
6291 * Start shoving in other fields if needed.
6292 * XXX - Should we look for is_ht as well?
6294 if (frame_type_subtype == CTRL_CONTROL_WRAPPER && tree) {
6295 cw_item = proto_tree_add_text(hdr_tree, tvb, offset, 2,
6296 "Contained Frame Control");
6297 cw_tree = proto_item_add_subtree (cw_item, ett_cntrl_wrapper_fc);
6298 dissect_frame_control(cw_tree, tvb, FALSE, offset);
6299 dissect_ht_control(hdr_tree, tvb, offset + 2);
6301 cw_item = proto_tree_add_text(hdr_tree, tvb, offset, 2,
6303 hdr_tree = proto_item_add_subtree (cw_item, ett_cntrl_wrapper_fc);
6306 switch (ctrl_type_subtype)
6310 case CTRL_CFP_ENDACK:
6312 src = tvb_get_ptr (tvb, offset, 6);
6313 set_src_addr_cols(pinfo, src, "BSSID");
6315 proto_tree_add_item(hdr_tree, hf_addr_ta, tvb, offset, 6, FALSE);
6322 src = tvb_get_ptr (tvb, offset, 6);
6323 set_src_addr_cols(pinfo, src, "TA");
6325 proto_tree_add_item(hdr_tree, hf_addr_ta, tvb, offset, 6, FALSE);
6330 case CTRL_CONTROL_WRAPPER:
6332 /* XXX - We shouldn't see this. Should we throw an error? */
6336 /*** Begin: Block Ack Request - Dustin Johnson ***/
6337 case CTRL_BLOCK_ACK_REQ:
6339 src = tvb_get_ptr (tvb, offset, 6);
6340 set_src_addr_cols(pinfo, src, "TA");
6344 guint16 bar_control;
6345 guint8 block_ack_type;
6346 proto_item *bar_parent_item;
6347 proto_tree *bar_sub_tree;
6349 proto_tree_add_item(hdr_tree, hf_addr_ta, tvb, offset, 6, FALSE);
6352 bar_control = tvb_get_letohs(tvb, offset);
6353 block_ack_type = (bar_control & 0x0006) >> 1;
6354 proto_tree_add_uint(hdr_tree, hf_block_ack_request_type, tvb,
6355 offset, 1, block_ack_type);
6356 bar_parent_item = proto_tree_add_uint_format(hdr_tree,
6357 hf_block_ack_request_control, tvb, offset, 2, bar_control,
6358 "Block Ack Request (BAR) Control: 0x%04X", bar_control);
6359 bar_sub_tree = proto_item_add_subtree(bar_parent_item,
6361 proto_tree_add_boolean(bar_sub_tree,
6362 hf_block_ack_control_ack_policy, tvb, offset, 1, bar_control);
6363 proto_tree_add_boolean(bar_sub_tree, hf_block_ack_control_multi_tid,
6364 tvb, offset, 1, bar_control);
6365 proto_tree_add_boolean(bar_sub_tree,
6366 hf_block_ack_control_compressed_bitmap, tvb, offset, 1,
6368 proto_tree_add_uint(bar_sub_tree, hf_block_ack_control_reserved,
6369 tvb, offset, 2, bar_control);
6371 switch (block_ack_type)
6373 case 0: /*Basic BlockAckReq */
6375 proto_tree_add_uint(bar_sub_tree,
6376 hf_block_ack_control_basic_tid_info, tvb, offset+1, 1,
6380 offset += add_fixed_field(hdr_tree, tvb, offset,
6381 FIELD_BLOCK_ACK_SSC);
6384 case 2: /* Compressed BlockAckReq */
6386 proto_tree_add_uint(bar_sub_tree,
6387 hf_block_ack_control_compressed_tid_info, tvb, offset+1, 1,
6391 offset += add_fixed_field(hdr_tree, tvb, offset,
6392 FIELD_BLOCK_ACK_SSC);
6395 case 3: /* Multi-TID BlockAckReq */
6397 guint8 tid_count, i;
6398 proto_tree *bar_mtid_tree, *bar_mtid_sub_tree;
6400 tid_count = ((bar_control & 0xF000) >> 12) + 1;
6401 proto_tree_add_uint_format(bar_sub_tree, hf_block_ack_control_compressed_tid_info, tvb, offset+1, 1, bar_control,
6402 decode_numeric_bitfield(bar_control, 0xF000, 16,"Number of TIDs Present: 0x%%X"), tid_count);
6405 bar_parent_item = proto_tree_add_text (hdr_tree, tvb, offset, tid_count*4, "Per TID Info");
6406 bar_mtid_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
6407 for (i = 1; i <= tid_count; i++) {
6408 bar_parent_item = proto_tree_add_uint(bar_mtid_tree, hf_block_ack_multi_tid_info, tvb, offset, 4, i);
6409 bar_mtid_sub_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
6411 bar_control = tvb_get_letohs(tvb, offset);
6412 proto_tree_add_uint(bar_mtid_sub_tree, hf_block_ack_multi_tid_reserved, tvb, offset, 2, bar_control);
6413 proto_tree_add_uint(bar_mtid_sub_tree, hf_block_ack_multi_tid_value, tvb, offset+1, 1, bar_control);
6416 offset += add_fixed_field(bar_mtid_sub_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
6424 /*** End: Block Ack Request - Dustin Johnson ***/
6426 /*** Begin: Block Ack - Dustin Johnson ***/
6427 case CTRL_BLOCK_ACK:
6429 src = tvb_get_ptr (tvb, offset, 6);
6430 set_src_addr_cols(pinfo, src, "TA");
6435 guint8 block_ack_type;
6436 proto_item *ba_parent_item;
6437 proto_tree *ba_sub_tree;
6439 proto_tree_add_item(hdr_tree, hf_addr_ta, tvb, offset, 6, FALSE);
6442 ba_control = tvb_get_letohs(tvb, offset);
6443 block_ack_type = (ba_control & 0x0006) >> 1;
6444 proto_tree_add_uint(hdr_tree, hf_block_ack_type, tvb, offset, 1, block_ack_type);
6445 ba_parent_item = proto_tree_add_uint_format(hdr_tree,
6446 hf_block_ack_control, tvb, offset, 2, ba_control,
6447 "Block Ack (BA) Control: 0x%04X", ba_control);
6448 ba_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
6449 proto_tree_add_boolean(ba_sub_tree, hf_block_ack_control_ack_policy,
6450 tvb, offset, 1, ba_control);
6451 proto_tree_add_boolean(ba_sub_tree, hf_block_ack_control_multi_tid,
6452 tvb, offset, 1, ba_control);
6453 proto_tree_add_boolean(ba_sub_tree,
6454 hf_block_ack_control_compressed_bitmap, tvb, offset, 1,
6456 proto_tree_add_uint(ba_sub_tree, hf_block_ack_control_reserved, tvb,
6457 offset, 2, ba_control);
6459 switch (block_ack_type)
6461 case 0: /*Basic BlockAck */
6463 proto_tree_add_uint(ba_sub_tree,
6464 hf_block_ack_control_basic_tid_info, tvb, offset+1, 1,
6468 offset += add_fixed_field(hdr_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
6469 proto_tree_add_text(hdr_tree, tvb, offset, 128, "Block Ack Bitmap");
6473 case 2: /* Compressed BlockAck */
6475 proto_tree_add_uint(ba_sub_tree, hf_block_ack_control_basic_tid_info, tvb, offset+1, 1, ba_control);
6478 offset += add_fixed_field(hdr_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
6479 proto_tree_add_text(hdr_tree, tvb, offset, 8, "Block Ack Bitmap");
6483 case 3: /* Multi-TID BlockAck */
6485 guint8 tid_count, i;
6486 proto_tree *ba_mtid_tree, *ba_mtid_sub_tree;
6488 tid_count = ((ba_control & 0xF000) >> 12) + 1;
6489 proto_tree_add_uint_format(ba_sub_tree,
6490 hf_block_ack_control_compressed_tid_info, tvb, offset+1, 1,
6491 ba_control, decode_numeric_bitfield(ba_control, 0xF000,
6492 16,"Number of TIDs Present: 0x%%X"), tid_count);
6495 ba_parent_item = proto_tree_add_text (hdr_tree, tvb, offset, tid_count*4, "Per TID Info");
6496 ba_mtid_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
6497 for (i=1; i<=tid_count; i++) {
6498 ba_parent_item = proto_tree_add_uint(ba_mtid_tree, hf_block_ack_multi_tid_info, tvb, offset, 4, i);
6499 ba_mtid_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
6501 ba_control = tvb_get_letohs(tvb, offset);
6502 proto_tree_add_uint(ba_mtid_sub_tree, hf_block_ack_multi_tid_reserved, tvb, offset, 2, ba_control);
6503 proto_tree_add_uint(ba_mtid_sub_tree, hf_block_ack_multi_tid_value, tvb, offset+1, 1, ba_control);
6506 offset += add_fixed_field(ba_mtid_sub_tree, tvb, offset, FIELD_BLOCK_ACK_SSC);
6507 proto_tree_add_text(ba_mtid_sub_tree, tvb, offset, 8, "Block Ack Bitmap");
6516 /*** End: Block Ack - Dustin Johnson ***/
6522 addr_type = FCF_ADDR_SELECTOR (fcf);
6524 /* In order to show src/dst address we must always do the following */
6529 src = tvb_get_ptr (tvb, 10, 6);
6530 dst = tvb_get_ptr (tvb, 4, 6);
6531 bssid = tvb_get_ptr (tvb, 16, 6);
6535 src = tvb_get_ptr (tvb, 16, 6);
6536 dst = tvb_get_ptr (tvb, 4, 6);
6537 bssid = tvb_get_ptr (tvb, 10, 6);
6541 src = tvb_get_ptr (tvb, 10, 6);
6542 dst = tvb_get_ptr (tvb, 16, 6);
6543 bssid = tvb_get_ptr (tvb, 4, 6);
6547 src = tvb_get_ptr (tvb, 24, 6);
6548 dst = tvb_get_ptr (tvb, 16, 6);
6549 bssid = tvb_get_ptr (tvb, 16, 6);
6553 SET_ADDRESS(&pinfo->dl_src, AT_ETHER, 6, src);
6554 SET_ADDRESS(&pinfo->src, AT_ETHER, 6, src);
6555 SET_ADDRESS(&pinfo->dl_dst, AT_ETHER, 6, dst);
6556 SET_ADDRESS(&pinfo->dst, AT_ETHER, 6, dst);
6560 SET_ADDRESS(&whdr->bssid, AT_ETHER, 6, bssid);
6561 SET_ADDRESS(&whdr->src, AT_ETHER, 6, src);
6562 SET_ADDRESS(&whdr->dst, AT_ETHER, 6, dst);
6563 whdr->type = frame_type_subtype;
6565 seq_control = tvb_get_letohs(tvb, 22);
6566 frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
6567 seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
6569 if (check_col (pinfo->cinfo, COL_INFO))
6571 col_append_fstr(pinfo->cinfo, COL_INFO,
6572 ", SN=%d", seq_number);
6574 col_append_fstr(pinfo->cinfo, COL_INFO,
6575 ", FN=%d",frag_number);
6578 /* Now if we have a tree we start adding stuff */
6586 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 4, 6, dst);
6587 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 10, 6, src);
6588 proto_tree_add_ether (hdr_tree, hf_addr_bssid, tvb, 16, 6,
6589 tvb_get_ptr (tvb, 16, 6));
6590 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6592 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6595 /* add items for wlan.addr filter */
6596 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 4, 6, dst);
6597 PROTO_ITEM_SET_HIDDEN(hidden_item);
6598 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 10, 6, src);
6599 PROTO_ITEM_SET_HIDDEN(hidden_item);
6603 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 4, 6, dst);
6604 proto_tree_add_ether (hdr_tree, hf_addr_bssid, tvb, 10, 6,
6605 tvb_get_ptr (tvb, 10, 6));
6606 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 16, 6, src);
6607 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6609 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6612 /* add items for wlan.addr filter */
6613 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 4, 6, dst);
6614 PROTO_ITEM_SET_HIDDEN(hidden_item);
6615 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 16, 6, src);
6616 PROTO_ITEM_SET_HIDDEN(hidden_item);
6620 proto_tree_add_ether (hdr_tree, hf_addr_bssid, tvb, 4, 6,
6621 tvb_get_ptr (tvb, 4, 6));
6622 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 10, 6, src);
6623 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 16, 6, dst);
6625 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6627 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6630 /* add items for wlan.addr filter */
6631 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 10, 6, src);
6632 PROTO_ITEM_SET_HIDDEN(hidden_item);
6633 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 16, 6, dst);
6634 PROTO_ITEM_SET_HIDDEN(hidden_item);
6638 proto_tree_add_ether (hdr_tree, hf_addr_ra, tvb, 4, 6,
6639 tvb_get_ptr (tvb, 4, 6));
6640 proto_tree_add_ether (hdr_tree, hf_addr_ta, tvb, 10, 6,
6641 tvb_get_ptr (tvb, 10, 6));
6642 proto_tree_add_ether (hdr_tree, hf_addr_da, tvb, 16, 6, dst);
6643 proto_tree_add_uint (hdr_tree, hf_frag_number, tvb, 22, 2,
6645 proto_tree_add_uint (hdr_tree, hf_seq_number, tvb, 22, 2,
6647 proto_tree_add_ether (hdr_tree, hf_addr_sa, tvb, 24, 6, src);
6649 /* add items for wlan.addr filter */
6650 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 16, 6, dst);
6651 PROTO_ITEM_SET_HIDDEN(hidden_item);
6652 hidden_item = proto_tree_add_ether (hdr_tree, hf_addr, tvb, 24, 6, src);
6653 PROTO_ITEM_SET_HIDDEN(hidden_item);
6661 len = tvb_length_remaining(tvb, hdr_len);
6662 reported_len = tvb_reported_length_remaining(tvb, hdr_len);
6666 case 0: /* Definitely has no FCS */
6670 case 4: /* Definitely has an FCS */
6674 default: /* Don't know - use "wlan_check_fcs" */
6675 has_fcs = wlan_check_fcs;
6681 * Well, this packet should, in theory, have an FCS.
6682 * Do we have the entire packet, and does it have enough data for
6685 if (reported_len < 4)
6688 * The packet is claimed not to even have enough data for a 4-byte
6690 * Pretend it doesn't have an FCS.
6694 else if (len < reported_len)
6697 * The packet is claimed to have enough data for a 4-byte FCS, but
6698 * we didn't capture all of the packet.
6699 * Slice off the 4-byte FCS from the reported length, and trim the
6700 * captured length so it's no more than the reported length; that
6701 * will slice off what of the FCS, if any, is in the captured
6705 if (len > reported_len)
6711 * We have the entire packet, and it includes a 4-byte FCS.
6712 * Slice it off, and put it into the tree.
6718 guint32 sent_fcs = tvb_get_ntohl(tvb, hdr_len + len);
6722 fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
6724 fcs = crc32_802_tvb(tvb, hdr_len + len);
6725 if (fcs == sent_fcs) {
6734 fcs_item = proto_tree_add_uint_format(hdr_tree, hf_fcs, tvb,
6735 hdr_len + len, 4, sent_fcs,
6736 "Frame check sequence: 0x%08x [correct]", sent_fcs);
6738 fcs_item = proto_tree_add_uint_format(hdr_tree, hf_fcs, tvb,
6739 hdr_len + len, 4, sent_fcs,
6740 "Frame check sequence: 0x%08x [incorrect, should be 0x%08x]",
6745 proto_tree_set_appendix(hdr_tree, tvb, hdr_len + len, 4);
6747 fcs_tree = proto_item_add_subtree(fcs_item, ett_fcs);
6749 fcs_item = proto_tree_add_boolean(fcs_tree,
6753 PROTO_ITEM_SET_GENERATED(fcs_item);
6755 fcs_item = proto_tree_add_boolean(fcs_tree,
6759 PROTO_ITEM_SET_GENERATED(fcs_item);
6766 proto_item_append_text(ti, ", Flags: %s", flag_str);
6767 if (check_col (pinfo->cinfo, COL_INFO))
6768 col_append_fstr (pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
6772 * Only management and data frames have a body, so we don't have
6773 * anything more to do for other types of frames.
6775 switch (FCF_FRAME_TYPE (fcf))
6780 dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
6785 if (tree && DATA_FRAME_IS_QOS(frame_type_subtype))
6787 proto_item *qos_fields;
6788 proto_tree *qos_tree;
6791 guint16 qos_control;
6792 guint16 qos_priority;
6793 guint16 qos_ack_policy;
6794 guint16 qos_amsdu_present;
6796 guint16 qos_field_content;
6799 * We calculate the offset to the QoS header data as
6800 * an offset relative to the end of the header. But
6801 * when the header has been padded to align the data
6802 * this must be done relative to true header size, not
6803 * the padded/aligned value. To simplify this work we
6804 * stash the original header size in ohdr_len instead
6805 * of recalculating it.
6807 qosoff = ohdr_len - htc_len - 2;
6808 qos_fields = proto_tree_add_text(hdr_tree, tvb, qosoff, 2,
6810 qos_tree = proto_item_add_subtree (qos_fields, ett_qos_parameters);
6812 qos_control = tvb_get_letohs(tvb, qosoff + 0);
6813 qos_priority = QOS_PRIORITY(qos_control);
6814 qos_ack_policy = QOS_ACK_POLICY(qos_control);
6815 qos_amsdu_present = QOS_AMSDU_PRESENT(qos_control);
6816 qos_eosp = QOS_EOSP(qos_control);
6817 qos_field_content = QOS_FIELD_CONTENT(qos_control);
6819 proto_tree_add_uint_format (qos_tree, hf_qos_priority, tvb,
6820 qosoff, 1, qos_priority,
6821 "Priority: %d (%s) (%s)",
6822 qos_priority, qos_tags[qos_priority], qos_acs[qos_priority]);
6824 if (flags & FLAG_FROM_DS) {
6825 proto_tree_add_boolean (qos_tree, hf_qos_eosp, tvb,
6826 qosoff, 1, qos_control);
6829 proto_tree_add_uint (qos_tree, hf_qos_ack_policy, tvb, qosoff, 1,
6832 if (flags & FLAG_FROM_DS) {
6833 if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
6834 proto_tree_add_boolean(qos_tree, hf_qos_amsdu_present, tvb,
6835 qosoff, 1, qos_amsdu_present);
6836 is_amsdu = qos_amsdu_present;
6838 if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
6840 proto_tree_add_uint_format (qos_tree, hf_qos_field_content, tvb,
6841 qosoff + 1, 1, qos_field_content, "Transmit Opportunity (TXOP) Limit: 0x%02X", qos_field_content);
6844 /* qap ps buffer state */
6845 proto_item *qos_ps_buf_state_fields;
6846 proto_tree *qos_ps_buf_state_tree;
6851 buf_state = QOS_PS_BUF_STATE(qos_field_content);
6852 buf_ac = QOS_PS_BUF_AC(qos_field_content); /*access category */
6853 buf_load = QOS_PS_BUF_LOAD(qos_field_content);
6855 qos_ps_buf_state_fields = proto_tree_add_text(qos_tree, tvb, qosoff + 1, 1,
6856 "QAP PS Buffer State: 0x%x", qos_field_content);
6857 qos_ps_buf_state_tree = proto_item_add_subtree (qos_ps_buf_state_fields, ett_qos_ps_buf_state);
6859 /* FIXME: hf_ values not defined
6860 proto_tree_add_boolean (qos_ps_buf_state_tree, hf_qos_buf_state, tvb,
6863 proto_tree_add_uint_format (qos_ps_buf_state_tree, hf_qos_buf_ac, tvb,
6864 qosoff + 1, 1, buf_ac, "Priority: %d (%s)",
6865 buf_ac, wme_acs[buf_ac]);
6867 proto_tree_add_uint_format (qos_ps_buf_state_tree, hf_qos_buf_load, tvb,
6868 qosoff + 1, 1, buf_load, "Buffered load: %d ", (buf_load * 4096));
6873 if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
6874 proto_tree_add_boolean(qos_tree, hf_qos_amsdu_present, tvb,
6875 qosoff, 1, qos_amsdu_present);
6876 is_amsdu = qos_amsdu_present;
6879 /* txop limit requested */
6880 proto_tree_add_uint_format (qos_tree, hf_qos_field_content, tvb,
6881 qosoff + 1, 1, qos_field_content, "Queue Size: %d", (qos_field_content * 254));
6884 proto_tree_add_uint_format (qos_tree, hf_qos_field_content, tvb,
6885 qosoff + 1, 1, qos_field_content, "Transmit Opportunity (TXOP) Limit Requested: 0x%02X", qos_field_content);
6889 /* Do we have +HTC? */
6891 dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
6893 } /* end of qos control field */
6895 #ifdef HAVE_AIRPDCAP
6896 /* Davide Schiera (2006-11-21): process handshake packet with AirPDcap */
6897 /* the processing will take care of 4-way handshake sessions for WPA */
6898 /* and WPA2 decryption */
6899 if (enable_decryption && !pinfo->fd->flags.visited) {
6900 const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
6901 AirPDcapPacketProcess(&airpdcap_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE, FALSE);
6903 /* Davide Schiera -------------------------------------------------------- */
6907 * No-data frames don't have a body.
6909 if (DATA_FRAME_IS_NULL(frame_type_subtype))
6912 if (!wlan_subdissector) {
6916 * data: last seq_control seen and frame number
6918 retransmitted = FALSE;
6919 if(!pinfo->fd->flags.visited){
6921 retransmit_key *result;
6923 memcpy(key.bssid, bssid, 6);
6924 memcpy(key.src, src, 6);
6925 key.seq_control = 0;
6926 result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
6927 if (result && result->seq_control == seq_control) {
6928 /* keep a pointer to the first seen frame, could be done with proto data? */
6929 fnum = result->fnum;
6930 g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER( pinfo->fd->num),
6931 GINT_TO_POINTER(fnum));
6932 retransmitted = TRUE;
6934 /* first time or new seq*/
6936 result = se_alloc(sizeof(retransmit_key));
6938 g_hash_table_insert(fc_analyse_retransmit_table, result, result);
6940 result->seq_control = seq_control;
6941 result->fnum = pinfo->fd->num;
6944 else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER( pinfo->fd->num))))) {
6945 retransmitted = TRUE;
6948 if (retransmitted) {
6949 if (check_col (pinfo->cinfo, COL_INFO))
6950 col_append_fstr(pinfo->cinfo, COL_INFO, " [retransmitted]");
6954 item=proto_tree_add_none_format(hdr_tree, hf_fc_analysis_retransmission, tvb, 0, 0, "Retransmitted frame");
6955 PROTO_ITEM_SET_GENERATED(item);
6956 item=proto_tree_add_uint(hdr_tree, hf_fc_analysis_retransmission_frame,tvb, 0, 0, fnum);
6957 PROTO_ITEM_SET_GENERATED(item);
6959 next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
6960 call_dissector(data_handle, next_tvb, pinfo, tree);
6974 if (IS_PROTECTED(FCF_FLAGS(fcf)) && wlan_ignore_wep != WLAN_IGNORE_WEP_WO_IV) {
6976 * It's a WEP or WPA encrypted frame; dissect the protections parameters
6977 * and decrypt the data, if we have a matching key. Otherwise display it as data.
6980 gboolean can_decrypt = FALSE;
6981 proto_tree *wep_tree = NULL;
6983 guint8 key, keybyte;
6985 /* Davide Schiera (2006-11-27): define algorithms constants and macros */
6986 #ifdef HAVE_AIRPDCAP
6987 #define PROTECTION_ALG_TKIP AIRPDCAP_KEY_TYPE_TKIP
6988 #define PROTECTION_ALG_CCMP AIRPDCAP_KEY_TYPE_CCMP
6989 #define PROTECTION_ALG_WEP AIRPDCAP_KEY_TYPE_WEP
6990 #define PROTECTION_ALG_RSNA PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
6992 #define PROTECTION_ALG_WEP 0
6993 #define PROTECTION_ALG_TKIP 1
6994 #define PROTECTION_ALG_CCMP 2
6995 #define PROTECTION_ALG_RSNA PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
6997 guint8 algorithm=-1;
6998 /* Davide Schiera (2006-11-27): added macros to check the algorithm */
6999 /* used could be TKIP or CCMP */
7000 #define IS_TKIP(tvb, hdr_len) (tvb_get_guint8(tvb, hdr_len + 1) & 0x20)
7001 #define IS_CCMP(tvb, hdr_len) (tvb_get_guint8(tvb, hdr_len + 2) == 0)
7002 /* Davide Schiera ----------------------------------------------------- */
7004 #ifdef HAVE_AIRPDCAP
7005 /* Davide Schiera (2006-11-21): recorded original lengths to pass them */
7006 /* to the packets process function */
7007 guint32 sec_header=0;
7008 guint32 sec_trailer=0;
7010 next_tvb = try_decrypt(tvb, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer);
7012 /* Davide Schiera ----------------------------------------------------- */
7014 keybyte = tvb_get_guint8(tvb, hdr_len + 3);
7015 key = KEY_OCTET_WEP_KEY(keybyte);
7016 if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
7017 /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
7021 proto_item *extiv_fields;
7023 #ifdef HAVE_AIRPDCAP
7024 /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if */
7026 if (algorithm==PROTECTION_ALG_TKIP)
7027 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7029 else if (algorithm==PROTECTION_ALG_CCMP)
7030 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7033 /* Davide Schiera -------------------------------------------- */
7035 /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if*/
7037 if (IS_TKIP(tvb, hdr_len)) {
7038 algorithm=PROTECTION_ALG_TKIP;
7039 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7041 } else if (IS_CCMP(tvb, hdr_len)) {
7042 algorithm=PROTECTION_ALG_CCMP;
7043 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7046 extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
7047 "TKIP/CCMP parameters");
7048 #ifdef HAVE_AIRPDCAP
7051 proto_item_set_len (ti, hdr_len + 8);
7053 wep_tree = proto_item_add_subtree (extiv_fields, ett_wep_parameters);
7055 if (algorithm==PROTECTION_ALG_TKIP) {
7056 g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
7057 tvb_get_letohl(tvb, hdr_len + 4),
7058 tvb_get_guint8(tvb, hdr_len),
7059 tvb_get_guint8(tvb, hdr_len + 2));
7060 proto_tree_add_string(wep_tree, hf_tkip_extiv, tvb, hdr_len,
7061 EXTIV_LEN, out_buff);
7062 } else if (algorithm==PROTECTION_ALG_CCMP) {
7063 g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
7064 tvb_get_letohl(tvb, hdr_len + 4),
7065 tvb_get_guint8(tvb, hdr_len + 1),
7066 tvb_get_guint8(tvb, hdr_len));
7067 proto_tree_add_string(wep_tree, hf_ccmp_extiv, tvb, hdr_len,
7068 EXTIV_LEN, out_buff);
7071 proto_tree_add_uint(wep_tree, hf_wep_key, tvb, hdr_len + 3, 1, key);
7074 /* Subtract out the length of the IV. */
7076 reported_len -= EXTIV_LEN;
7078 /* It is unknown whether this is TKIP or CCMP, so let's not even try to
7079 * parse TKIP Michael MIC+ICV or CCMP MIC. */
7081 #ifdef HAVE_AIRPDCAP
7082 /* Davide Schiera (2006-11-21): enable TKIP and CCMP decryption */
7083 /* checking for the trailer */
7084 if (next_tvb!=NULL) {
7085 if (reported_len < (gint) sec_trailer) {
7086 /* There is no space for a trailer, ignore it and don't decrypt */
7088 } else if (len < reported_len) {
7089 /* There is space for a trailer, but we haven't capture all the */
7090 /* packet. Slice off the trailer, but don't try to decrypt */
7091 reported_len -= sec_trailer;
7092 if (len > reported_len)
7095 /* Ok, we have a trailer and the whole packet. Decrypt it! */
7096 /* TODO: At the moment we won't add the trailer to the tree, */
7097 /* so don't remove the trailer from the packet */
7099 reported_len -= sec_trailer;
7103 /* Davide Schiera -------------------------------------------------- */
7106 /* No Ext. IV - WEP packet */
7108 * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
7109 * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
7112 * Also, just pass the data *following* the WEP parameters as the
7113 * buffer to decrypt.
7115 iv = tvb_get_ntoh24(tvb, hdr_len);
7117 proto_item *wep_fields;
7119 wep_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 4,
7122 wep_tree = proto_item_add_subtree (wep_fields, ett_wep_parameters);
7123 proto_tree_add_uint (wep_tree, hf_wep_iv, tvb, hdr_len, 3, iv);
7124 tvb_memcpy(tvb, iv_buff, hdr_len, 3);
7125 is_iv_bad = weak_iv(iv_buff);
7126 if (is_iv_bad != -1) {
7127 proto_tree_add_boolean_format (wep_tree, hf_wep_iv_weak,
7129 "Weak IV for key byte %d",
7134 proto_tree_add_uint (wep_tree, hf_wep_key, tvb, hdr_len + 3, 1, key);
7136 /* Subtract out the length of the IV. */
7141 /* Davide Schiera (2006-11-27): Even if the decryption was not */
7142 /* successful, set the algorithm */
7143 algorithm=PROTECTION_ALG_WEP;
7146 * Well, this packet should, in theory, have an ICV.
7147 * Do we have the entire packet, and does it have enough data for
7150 if (reported_len < 4) {
7152 * The packet is claimed not to even have enough data for a
7154 * Pretend it doesn't have an ICV.
7157 } else if (len < reported_len) {
7159 * The packet is claimed to have enough data for a 4-byte ICV,
7160 * but we didn't capture all of the packet.
7161 * Slice off the 4-byte ICV from the reported length, and trim
7162 * the captured length so it's no more than the reported length;
7163 * that will slice off what of the ICV, if any, is in the
7167 if (len > reported_len)
7171 * We have the entire packet, and it includes a 4-byte ICV.
7172 * Slice it off, and put it into the tree.
7174 * We only support decrypting if we have the the ICV.
7176 * XXX - the ICV is encrypted; we're putting the encrypted
7177 * value, not the decrypted value, into the tree.
7185 if (algorithm == PROTECTION_ALG_WEP) {
7186 g_strlcpy (wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
7187 } else if (algorithm == PROTECTION_ALG_TKIP) {
7188 g_strlcpy (wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
7189 } else if (algorithm == PROTECTION_ALG_CCMP) {
7190 g_strlcpy (wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
7192 g_strlcpy (wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
7195 #ifndef HAVE_AIRPDCAP
7197 next_tvb = try_decrypt_wep(tvb, hdr_len, reported_len + 8);
7199 /* Davide Schiera (2006-11-26): decrypted before parsing header and */
7200 /* protection header */
7202 if (!can_decrypt || next_tvb == NULL) {
7204 * WEP decode impossible or failed, treat payload as raw data
7205 * and don't attempt fragment reassembly or further dissection.
7207 next_tvb = tvb_new_subset(tvb, hdr_len + ivlen, len, reported_len);
7210 /* Davide Schiera (2006-11-21): added WEP or WPA separation */
7211 if (algorithm==PROTECTION_ALG_WEP) {
7213 proto_tree_add_uint_format (wep_tree, hf_wep_icv, tvb,
7214 hdr_len + ivlen + len, 4,
7215 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
7216 "WEP ICV: 0x%08x (not verified)",
7217 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
7218 } else if (algorithm==PROTECTION_ALG_CCMP) {
7219 } else if (algorithm==PROTECTION_ALG_TKIP) {
7222 /* Davide Schiera (2006-11-21) ---------------------------------- */
7224 if (pinfo->ethertype != ETHERTYPE_CENTRINO_PROMISC && wlan_ignore_wep == WLAN_IGNORE_WEP_NO) {
7225 /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
7226 call_dissector(data_handle, next_tvb, pinfo, tree);
7230 /* Davide Schiera (2006-11-21): added WEP or WPA separation */
7231 if (algorithm==PROTECTION_ALG_WEP) {
7233 proto_tree_add_uint_format (wep_tree, hf_wep_icv, tvb,
7234 hdr_len + ivlen + len, 4,
7235 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
7236 "WEP ICV: 0x%08x (correct)",
7237 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
7239 add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
7240 } else if (algorithm==PROTECTION_ALG_CCMP) {
7241 add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
7242 } else if (algorithm==PROTECTION_ALG_TKIP) {
7243 add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
7245 /* Davide Schiera (2006-11-21) ------------------------------------- */
7246 /* Davide Schiera (2006-11-27): undefine macros and definitions */
7249 #undef PROTECTION_ALG_CCMP
7250 #undef PROTECTION_ALG_TKIP
7251 #undef PROTECTION_ALG_WEP
7252 /* Davide Schiera -------------------------------------------------- */
7256 * WEP decryption successful!
7258 * Use the tvbuff we got back from the decryption; the data starts at
7259 * the beginning. The lengths are already correct for the decoded WEP
7266 * Not a WEP-encrypted frame; just use the data from the tvbuff
7269 * The payload starts at "hdr_len" (i.e., just past the 802.11
7270 * MAC header), the length of data in the tvbuff following the
7271 * 802.11 header is "len", and the length of data in the packet
7272 * following the 802.11 header is "reported_len".
7278 * Do defragmentation if "wlan_defragment" is true, and we have more
7279 * fragments or this isn't the first fragment.
7281 * We have to do some special handling to catch frames that
7282 * have the "More Fragments" indicator not set but that
7283 * don't show up as reassembled and don't have any other
7284 * fragments present. Some networking interfaces appear
7285 * to do reassembly even when you're capturing raw packets
7286 * *and* show the reassembled packet without the "More
7287 * Fragments" indicator set *but* with a non-zero fragment
7290 * "fragment_add_seq_802_11()" handles that; we want to call it
7291 * even if we have a short frame, so that it does those checks - if
7292 * the frame is short, it doesn't do reassembly on it.
7294 * (This could get some false positives if we really *did* only
7295 * capture the last fragment of a fragmented packet, but that's
7298 save_fragmented = pinfo->fragmented;
7299 if (wlan_defragment && (more_frags || frag_number != 0)) {
7300 fragment_data *fd_head;
7303 * If we've already seen this frame, look it up in the
7304 * table of reassembled packets, otherwise add it to
7305 * whatever reassembly is in progress, if any, and see
7308 if (reported_len < 0)
7309 THROW(ReportedBoundsError);
7310 fd_head = fragment_add_seq_802_11(next_tvb, hdr_len, pinfo, seq_number,
7311 wlan_fragment_table,
7312 wlan_reassembled_table,
7316 next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
7317 "Reassembled 802.11", fd_head,
7318 &frag_items, NULL, hdr_tree);
7321 * If this is the first fragment, dissect its contents, otherwise
7322 * just show it as a fragment.
7324 if (frag_number != 0) {
7325 /* Not the first fragment - don't dissect it. */
7328 /* First fragment, or not fragmented. Dissect what we have here. */
7330 /* Get a tvbuff for the payload. */
7331 next_tvb = tvb_new_subset (next_tvb, hdr_len, len, reported_len);
7334 * If this is the first fragment, but not the only fragment,
7335 * tell the next protocol that.
7338 pinfo->fragmented = TRUE;
7340 pinfo->fragmented = FALSE;
7344 if (next_tvb == NULL) {
7345 /* Just show this as an incomplete fragment. */
7346 if (check_col(pinfo->cinfo, COL_INFO))
7347 col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
7348 next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
7349 call_dissector(data_handle, next_tvb, pinfo, tree);
7350 pinfo->fragmented = save_fragmented;
7354 switch (FCF_FRAME_TYPE (fcf))
7358 dissect_ieee80211_mgt (fcf, next_tvb, pinfo, tree);
7362 if (is_amsdu && tvb_reported_length_remaining(next_tvb, 0) > 4){
7363 tvbuff_t *volatile msdu_tvb = NULL;
7364 guint32 msdu_offset = 0;
7366 const guint8 *src = NULL;
7367 const guint8 *dst = NULL;
7368 guint16 msdu_length;
7369 proto_item *parent_item;
7370 proto_tree *mpdu_tree;
7371 proto_tree *subframe_tree;
7373 parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
7374 tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
7375 mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
7378 dst = tvb_get_ptr (next_tvb, msdu_offset, 6);
7379 src = tvb_get_ptr (next_tvb, msdu_offset+6, 6);
7380 msdu_length = tvb_get_ntohs (next_tvb, msdu_offset+12);
7382 parent_item = proto_tree_add_uint_format(mpdu_tree, amsdu_msdu_header_text, next_tvb,
7383 msdu_offset, roundup2(msdu_offset+14+msdu_length, 4),
7384 i, "A-MSDU Subframe #%u", i);
7385 subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
7388 proto_tree_add_ether(subframe_tree, hf_addr_da, next_tvb, msdu_offset, 6, dst);
7389 proto_tree_add_ether(subframe_tree, hf_addr_sa, next_tvb, msdu_offset+6, 6, src);
7390 proto_tree_add_uint_format(subframe_tree, mcsset_highest_data_rate, next_tvb, msdu_offset+12, 2,
7391 msdu_length, "MSDU length: 0x%04X", msdu_length);
7394 msdu_tvb = tvb_new_subset(next_tvb, msdu_offset, msdu_length, -1);
7395 call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
7396 msdu_offset = roundup2(msdu_offset+msdu_length, 4);
7397 } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
7401 /* I guess some bridges take Netware Ethernet_802_3 frames,
7402 which are 802.3 frames (with a length field rather than
7403 a type field, but with no 802.2 header in the payload),
7404 and just stick the payload into an 802.11 frame. I've seen
7405 captures that show frames of that sort.
7407 We also handle some odd form of encapsulation in which a
7408 complete Ethernet frame is encapsulated within an 802.11
7409 data frame, with no 802.2 header. This has been seen
7412 So, if the packet doesn't start with 0xaa 0xaa:
7414 we first use the same scheme that linux-wlan-ng does to detect
7415 those encapsulated Ethernet frames, namely looking to see whether
7416 the frame either starts with 6 octets that match the destination
7417 address from the 802.11 header or has 6 octets that match the
7418 source address from the 802.11 header following the first 6 octets,
7419 and, if so, treat it as an encapsulated Ethernet frame;
7421 otherwise, we use the same scheme that we use in the Ethernet
7422 dissector to recognize Netware 802.3 frames, namely checking
7423 whether the packet starts with 0xff 0xff and, if so, treat it
7424 as an encapsulated IPX frame. */
7425 encap_type = ENCAP_802_2;
7427 octet1 = tvb_get_guint8(next_tvb, 0);
7428 octet2 = tvb_get_guint8(next_tvb, 1);
7429 if (octet1 != 0xaa || octet2 != 0xaa) {
7430 src = tvb_get_ptr (next_tvb, 6, 6);
7431 dst = tvb_get_ptr (next_tvb, 0, 6);
7432 if (memcmp(src, pinfo->dl_src.data, 6) == 0 ||
7433 memcmp(dst, pinfo->dl_dst.data, 6) == 0)
7434 encap_type = ENCAP_ETHERNET;
7435 else if (octet1 == 0xff && octet2 == 0xff)
7436 encap_type = ENCAP_IPX;
7439 CATCH2(BoundsError, ReportedBoundsError) {
7445 switch (encap_type) {
7448 call_dissector(llc_handle, next_tvb, pinfo, tree);
7451 case ENCAP_ETHERNET:
7452 call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
7456 call_dissector(ipx_handle, next_tvb, pinfo, tree);
7461 pinfo->fragmented = save_fragmented;
7464 whdr->stats = wlan_stats;
7465 tap_queue_packet(wlan_tap, pinfo, whdr);
7466 memset (&wlan_stats, 0, sizeof wlan_stats);
7470 * Dissect 802.11 with a variable-length link-layer header.
7473 dissect_ieee80211 (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7475 dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
7476 pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, FALSE);
7480 * Dissect 802.11 with a variable-length link-layer header and data padding.
7483 dissect_ieee80211_datapad (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7485 dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
7486 pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, TRUE, FALSE);
7490 * Dissect 802.11 with a variable-length link-layer header and a pseudo-
7491 * header containing radio information.
7494 dissect_radio (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7496 proto_item *ti = NULL;
7497 proto_tree *radio_tree = NULL;
7499 if (check_col(pinfo->cinfo, COL_PROTOCOL))
7500 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Radio");
7501 if (check_col(pinfo->cinfo, COL_INFO))
7502 col_clear(pinfo->cinfo, COL_INFO);
7504 /* Add the radio information to the column information */
7505 if (check_col(pinfo->cinfo, COL_TX_RATE)) {
7506 col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%u.%u",
7507 pinfo->pseudo_header->ieee_802_11.data_rate / 2,
7508 pinfo->pseudo_header->ieee_802_11.data_rate & 1 ? 5 : 0);
7510 if (check_col(pinfo->cinfo, COL_RSSI)) {
7511 /* XX - this is a percentage, not a dBm or normalized or raw RSSI */
7512 col_add_fstr(pinfo->cinfo, COL_RSSI, "%u",
7513 pinfo->pseudo_header->ieee_802_11.signal_level);
7517 ti = proto_tree_add_item(tree, proto_radio, tvb, 0, 0, FALSE);
7518 radio_tree = proto_item_add_subtree (ti, ett_radio);
7520 proto_tree_add_uint64_format(radio_tree, hf_data_rate, tvb, 0, 0,
7521 (guint64)pinfo->pseudo_header->ieee_802_11.data_rate * 500000,
7522 "Data Rate: %u.%u Mb/s",
7523 pinfo->pseudo_header->ieee_802_11.data_rate / 2,
7524 pinfo->pseudo_header->ieee_802_11.data_rate & 1 ? 5 : 0);
7526 proto_tree_add_uint(radio_tree, hf_channel, tvb, 0, 0,
7527 pinfo->pseudo_header->ieee_802_11.channel);
7529 proto_tree_add_uint_format(radio_tree, hf_signal_strength, tvb, 0, 0,
7530 pinfo->pseudo_header->ieee_802_11.signal_level,
7531 "Signal Strength: %u%%",
7532 pinfo->pseudo_header->ieee_802_11.signal_level);
7535 pinfo->current_proto = "IEEE 802.11";
7536 dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
7537 pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, FALSE);
7541 * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
7542 * control field (some hardware sends out LWAPP-encapsulated 802.11
7543 * packets with the control field byte swapped).
7546 dissect_ieee80211_bsfc (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7548 dissect_ieee80211_common (tvb, pinfo, tree, FALSE, 0, TRUE, FALSE, FALSE);
7552 * Dissect 802.11 with a fixed-length link-layer header (padded to the
7556 dissect_ieee80211_fixed (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7558 dissect_ieee80211_common (tvb, pinfo, tree, TRUE, 0, FALSE, FALSE, FALSE);
7562 * Dissect an HT 802.11 frame with a variable-length link-layer header.
7563 * XXX - Can we tell if a frame is +HTC just by looking at the MAC header?
7564 * If so, we can dispense with this.
7567 dissect_ieee80211_ht (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7569 dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
7570 pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, TRUE);
7574 wlan_defragment_init(void)
7576 fragment_table_init(&wlan_fragment_table);
7577 reassembled_table_init(&wlan_reassembled_table);
7582 free_all(gpointer key_arg _U_, gpointer value _U_, gpointer user_data _U_)
7588 retransmit_hash(gconstpointer k)
7590 const retransmit_key *key = (const retransmit_key *)k;
7595 for (i = 0; i < 6; i++)
7596 hash_val += key->bssid[i];
7598 for (i = 0; i < 6; i++)
7599 hash_val += key->src[i];
7605 retransmit_equal(gconstpointer k1, gconstpointer k2)
7607 const retransmit_key *key1 = (const retransmit_key *)k1;
7608 const retransmit_key *key2 = (const retransmit_key *)k2;
7610 return ( (!memcmp(key1->bssid, key2->bssid, 6) && !memcmp( key1->src, key2->src, 6))? TRUE:FALSE);
7614 frame_hash(gconstpointer k)
7616 guint32 frame = GPOINTER_TO_UINT(k);
7622 frame_equal(gconstpointer k1, gconstpointer k2)
7624 guint32 frame1 = GPOINTER_TO_UINT(k1);
7625 guint32 frame2 = GPOINTER_TO_UINT(k2);
7627 return frame1==frame2;
7631 wlan_retransmit_init(void)
7633 if ( fc_analyse_retransmit_table ){
7634 g_hash_table_foreach_remove(fc_analyse_retransmit_table,free_all, NULL);
7635 g_hash_table_destroy(fc_analyse_retransmit_table);
7636 fc_analyse_retransmit_table = NULL;
7639 if( fc_first_frame_table ){
7640 g_hash_table_foreach_remove(fc_first_frame_table,free_all, NULL);
7641 g_hash_table_destroy(fc_first_frame_table);
7642 fc_first_frame_table = NULL;
7645 if (wlan_subdissector)
7648 fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
7649 fc_first_frame_table = g_hash_table_new( frame_hash, frame_equal);
7656 * yah, I know, macros, ugh, but it makes the code
7657 * below more readable
7658 * XXX - This should be rewritten to use ptvcursors, then.
7660 #define FIELD_PRESENT(name) (hdr.name.status == 0 && hdr.name.did != 0)
7661 #define IFHELP(size, name, var, str) \
7663 proto_tree_add_uint_format(prism_tree, hf_prism_ ## name, \
7664 tvb, offset, size, hdr.var, str, hdr.var); \
7667 #define INTFIELD(size, name, str) IFHELP(size, name, name, str)
7668 #define VALFIELD(name, str) \
7669 if (FIELD_PRESENT(name)) { \
7671 proto_tree_add_uint_format(prism_tree, hf_ ## name, \
7672 tvb, offset, 12, hdr.name.data, \
7673 str ": 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)", \
7674 hdr.name.data, hdr.name.did, \
7675 hdr.name.status, hdr.name.len); \
7679 #define VALFIELD_PRISM(name, str) \
7680 if (FIELD_PRESENT(name)) { \
7682 proto_tree_add_uint_format(prism_tree, hf_prism_ ## name ## _data, \
7683 tvb, offset, 12, hdr.name.data, \
7684 str ": 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)", \
7685 hdr.name.data, hdr.name.did, \
7686 hdr.name.status, hdr.name.len); \
7692 dissect_prism(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
7694 struct prism_hdr hdr;
7695 proto_tree *prism_tree = NULL;
7703 /* handle the new capture type. */
7704 msgcode = tvb_get_ntohl(tvb, offset);
7705 if ((msgcode == WLANCAP_MAGIC_COOKIE_V1) ||
7706 (msgcode == WLANCAP_MAGIC_COOKIE_V2)) {
7707 call_dissector(wlancap_handle, tvb, pinfo, tree);
7711 tvb_memcpy(tvb, (guint8 *)&hdr, offset, sizeof(hdr));
7713 if(check_col(pinfo->cinfo, COL_PROTOCOL))
7714 col_set_str(pinfo->cinfo, COL_PROTOCOL, "Prism");
7715 if(check_col(pinfo->cinfo, COL_INFO))
7716 col_clear(pinfo->cinfo, COL_INFO);
7718 if(check_col(pinfo->cinfo, COL_INFO))
7719 col_add_fstr(pinfo->cinfo, COL_INFO, "Device: %.16s "
7720 "Message 0x%x, Length %d", hdr.devname,
7721 hdr.msgcode, hdr.msglen);
7724 ti = proto_tree_add_item(tree, proto_prism, tvb, 0, sizeof hdr, FALSE);
7725 prism_tree = proto_item_add_subtree(ti, ett_radio);
7728 INTFIELD(4, msgcode, "Message Code: %d");
7729 INTFIELD(4, msglen, "Message Length: %d");
7731 proto_tree_add_text(prism_tree, tvb, offset, sizeof hdr.devname,
7732 "Device: %s", hdr.devname);
7734 offset += sizeof hdr.devname;
7736 if (FIELD_PRESENT(hosttime)) {
7738 proto_tree_add_uint64_format(prism_tree, hf_hosttime,
7739 tvb, offset, 12, hdr.hosttime.data,
7740 "Host timestamp: 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)",
7741 hdr.hosttime.data, hdr.hosttime.did,
7742 hdr.hosttime.status, hdr.hosttime.len);
7746 if (FIELD_PRESENT(mactime)) {
7748 proto_tree_add_uint64_format(prism_tree, hf_mactime,
7749 tvb, offset, 12, hdr.mactime.data,
7750 "MAC timestamp: 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)",
7751 hdr.mactime.data, hdr.mactime.did,
7752 hdr.mactime.status, hdr.mactime.len);
7756 if (FIELD_PRESENT(channel)) {
7757 if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
7758 col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u", hdr.channel.data);
7760 VALFIELD(channel, "Channel");
7761 if (FIELD_PRESENT(rssi)) {
7762 if (check_col(pinfo->cinfo, COL_RSSI))
7763 col_add_fstr(pinfo->cinfo, COL_RSSI, "%d", hdr.rssi.data);
7765 proto_tree_add_uint_format(prism_tree, hf_prism_rssi_data,
7766 tvb, offset, 12, hdr.rssi.data,
7767 "RSSI: 0x%x (DID 0x%x, Status 0x%x, Length 0x%x)",
7768 hdr.rssi.data, hdr.rssi.did, hdr.rssi.status, hdr.rssi.len);
7772 VALFIELD_PRISM(sq, "SQ");
7773 VALFIELD_PRISM(signal, "Signal");
7774 VALFIELD_PRISM(noise, "Noise");
7775 if (FIELD_PRESENT(rate)) {
7776 if (check_col(pinfo->cinfo, COL_TX_RATE)) {
7777 col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%u.%u",
7778 hdr.rate.data / 2, hdr.rate.data & 1 ? 5 : 0);
7781 proto_tree_add_uint64_format(prism_tree, hf_data_rate,
7782 tvb, offset, 12, (guint64)hdr.rate.data * 500000,
7783 "Data Rate: %u.%u Mb/s",
7784 hdr.rate.data / 2, hdr.rate.data & 1 ? 5 : 0);
7788 VALFIELD_PRISM(istx, "IsTX");
7789 VALFIELD_PRISM(frmlen, "Frame Length");
7791 /* dissect the 802.11 header next */
7792 next_tvb = tvb_new_subset(tvb, sizeof hdr, -1, -1);
7793 call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
7797 * AVS linux-wlan-based products use a new sniff header to replace the
7798 * old Prism header. This one has additional fields, is designed to be
7799 * non-hardware-specific, and more importantly, version and length fields
7800 * so it can be extended later without breaking anything.
7802 * Support by Solomon Peachy
7804 * Description, from the capturefrm.txt file in the linux-wlan-ng 0.2.9
7805 * release (linux-wlan-ng-0.2.9/doc/capturefrm.txt):
7807 AVS Capture Frame Format
7811 The original header format for "monitor mode" or capturing frames was
7812 a considerable hack. The document covers a redesign of that format.
7814 Any questions, corrections, or proposed changes go to info@linux-wlan.com
7817 All sniff frames follow the same format:
7819 Offset Name Size Description
7820 --------------------------------------------------------------------
7821 0 CaptureHeader AVS capture metadata header
7822 64 802.11Header [10-30] 802.11 frame header
7823 ?? 802.11Payload [0-2312] 802.11 frame payload
7824 ?? 802.11FCS 4 802.11 frame check sequence
7826 Note that the header and payload are variable length and the payload
7829 If the hardware does not supply the FCS to the driver, then the frame shall
7830 have a FCS of 0xFFFFFFFF.
7833 All multibyte fields of the capture header are in "network" byte
7834 order. The "host to network" and "network to host" functions should
7835 work just fine. All the remaining multibyte fields are ordered
7836 according to their respective standards.
7838 4. Capture Header Format
7839 The following fields make up the AVS capture header:
7842 ------------------------------
7859 72 receiver_addr uint8[6]
7861 ------------------------------
7864 The following subsections detail the fields of the capture header.
7867 The version field identifies this type of frame as a subtype of
7868 ETH_P_802111_CAPTURE as received by an ARPHRD_IEEE80211_PRISM or
7869 an ARPHRD_IEEE80211_CAPTURE device. The value of this field shall be
7870 0x80211002. As new revisions of this header are necessary, we can
7871 increment the version appropriately.
7874 The length field contains the length of the entire AVS capture header,
7878 Many WLAN devices supply a relatively high resolution frame reception
7879 time value. This field contains the value supplied by the device. If
7880 the device does not supply a receive time value, this field shall be
7881 set to zero. The units for this field are microseconds.
7883 If possible, this time value should be absolute, representing the number
7884 of microseconds elapsed since the UNIX epoch.
7887 The hosttime field is set to the current value of the host maintained
7888 clock variable when the frame is received by the host.
7890 If possible, this time value should be absolute, representing the number
7891 of microseconds elapsed since the UNIX epoch.
7894 The phytype field identifies what type of PHY is employed by the WLAN
7895 device used to capture this frame. The valid values are:
7898 -------------------------------------
7899 phytype_fhss_dot11_97 1
7900 phytype_dsss_dot11_97 2
7901 phytype_irbaseband 3
7902 phytype_dsss_dot11_b 4
7903 phytype_pbcc_dot11_b 5
7904 phytype_ofdm_dot11_g 6
7905 phytype_pbcc_dot11_g 7
7906 phytype_ofdm_dot11_a 8
7907 phytype_dss_ofdm_dot11_g 9
7911 This represents the frequency or channel number of the receiver at the
7912 time the frame was received. It is interpreted as follows:
7914 For frequency hopping radios, this field is broken in to the
7915 following subfields:
7918 ------------------------
7924 For non-hopping radios, the frequency is interpreted as follows:
7927 -----------------------------------------
7928 < 256 Channel number (using externally-defined
7930 < 10000 Center frequency, in MHz
7931 >= 10000 Center frequency, in KHz
7934 The data rate field contains the rate at which the frame was received
7935 in units of 100kbps.
7938 For WLAN devices that indicate the receive antenna for each frame, the
7939 antenna field shall contain an index value into the dot11AntennaList.
7940 If the device does not indicate a receive antenna value, this field
7941 shall be set to zero.
7944 The priority field indicates the receive priority of the frame. The
7945 value is in the range [0-15] with the value 0 reserved to indicate
7946 contention period and the value 6 reserved to indicate contention free
7950 The ssi_type field is used to indicate what type of signal strength
7951 information is present: "None", "Normalized RSSI" or "dBm". "None"
7952 indicates that the underlying WLAN device does not supply any signal
7953 strength at all and the ssi_* values are unset. "Normalized RSSI"
7954 values are integers in the range [0-1000] where higher numbers
7955 indicate stronger signal. "dBm" values indicate an actual signal
7956 strength measurement quantity and are usually in the range [-108 - 10].
7957 The following values indicate the three types:
7960 ---------------------------------------------
7967 The ssi_signal field contains the signal strength value reported by
7968 the WLAN device for this frame. Note that this is a signed quantity
7969 and if the ssi_type value is "dBm" that the value may be negative.
7972 The ssi_noise field contains the noise or "silence" value reported by
7973 the WLAN device. This value is commonly defined to be the "signal
7974 strength reported immediately prior to the baseband processor lock on
7975 the frame preamble". If the hardware does not provide noise data, this
7976 shall equal 0xffffffff.
7979 For PHYs that support variable preamble lengths, the preamble field
7980 indicates the preamble type used for this frame. The values are:
7983 ---------------------------------------------
7989 This specifies the encoding of the received packet. For PHYs that support
7990 multiple encoding types, this will tell us which one was used.
7993 ---------------------------------------------
8005 This is a receive frame sequence counter. The sniff host shall
8006 increment this by one for every valid frame received off the medium.
8007 By watching for gaps in the sequence numbers we can determine when
8008 packets are lost due to unreliable transport, rather than a frame never
8009 being received to begin with.
8012 This is a counter of the number of known frame drops that occured. This
8013 is particularly useful when the system or hardware cannot keep up with
8017 This specifies the MAC address of the receiver of this frame.
8018 It is six octets in length. This field is followed by two octets of
8019 padding to keep the structure 32-bit word aligned.
8021 ================================
8025 * Added contact e-mail address to introduction
8026 * Added sniffer_addr, drop count, and sequence fields, bringing total
8028 * Bumped version to 0x80211002
8029 * Mactime is specified in microseconds, not nanoseconds
8030 * Added 64QAM, 16QAM, BPSK, QPSK encodings
8032 ================================
8034 Changes: v2.1->v2.1.1
8036 * Renamed 'channel' to 'frequency'
8037 * Clarified the interpretation of the frequency/channel field.
8038 * Renamed 'sniffer address' to 'receiver address'
8039 * Clarified timestamp fields.
8043 * Signal/noise strength type values.
8045 #define SSI_NONE 0 /* no SSI information */
8046 #define SSI_NORM_RSSI 1 /* normalized RSSI - 0-1000 */
8047 #define SSI_DBM 2 /* dBm */
8048 #define SSI_RAW_RSSI 3 /* raw RSSI from the hardware */
8051 dissect_wlancap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
8053 proto_tree *wlan_tree = NULL;
8064 if(check_col(pinfo->cinfo, COL_PROTOCOL))
8065 col_set_str(pinfo->cinfo, COL_PROTOCOL, "WLAN");
8066 if(check_col(pinfo->cinfo, COL_INFO))
8067 col_clear(pinfo->cinfo, COL_INFO);
8070 version = tvb_get_ntohl(tvb, offset) - WLANCAP_MAGIC_COOKIE_BASE;
8072 length = tvb_get_ntohl(tvb, offset+4);
8074 if(check_col(pinfo->cinfo, COL_INFO))
8075 col_add_fstr(pinfo->cinfo, COL_INFO, "AVS WLAN Capture v%x, Length %d",version, length);
8081 /* Dissect the AVS header */
8083 ti = proto_tree_add_item(tree, proto_wlancap, tvb, 0, length, FALSE);
8084 wlan_tree = proto_item_add_subtree(ti, ett_radio);
8085 proto_tree_add_item(wlan_tree, hf_wlan_magic, tvb, offset, 4, FALSE);
8086 proto_tree_add_item(wlan_tree, hf_wlan_version, tvb, offset, 4, FALSE);
8090 proto_tree_add_item(wlan_tree, hf_wlan_length, tvb, offset, 4, FALSE);
8093 proto_tree_add_item(wlan_tree, hf_mactime, tvb, offset, 8, FALSE);
8096 proto_tree_add_item(wlan_tree, hf_hosttime, tvb, offset, 8, FALSE);
8099 proto_tree_add_item(wlan_tree, hf_wlan_phytype, tvb, offset, 4, FALSE);
8102 /* XXX cook channel (fh uses different numbers) */
8103 channel = tvb_get_ntohl(tvb, offset);
8104 if (channel < 256) {
8105 if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
8106 col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u", channel);
8108 proto_tree_add_uint(wlan_tree, hf_channel, tvb, offset, 4, channel);
8109 } else if (channel < 10000) {
8110 if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
8111 col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u MHz", channel);
8113 proto_tree_add_uint_format(wlan_tree, hf_channel_frequency, tvb, offset,
8114 4, channel, "Frequency: %u MHz", channel);
8116 if (check_col(pinfo->cinfo, COL_FREQ_CHAN))
8117 col_add_fstr(pinfo->cinfo, COL_FREQ_CHAN, "%u KHz", channel);
8119 proto_tree_add_uint_format(wlan_tree, hf_channel_frequency, tvb, offset,
8120 4, channel, "Frequency: %u KHz", channel);
8123 datarate = tvb_get_ntohl(tvb, offset);
8124 if (datarate < 100000) {
8125 /* In units of 100 Kb/s; convert to b/s */
8128 if (check_col(pinfo->cinfo, COL_TX_RATE)) {
8129 col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%u.%u",
8131 ((datarate % 1000000) > 500000) ? 5 : 0);
8134 proto_tree_add_uint64_format(wlan_tree, hf_data_rate, tvb, offset, 4,
8136 "Data Rate: %u.%u Mb/s",
8138 ((datarate % 1000000) > 500000) ? 5 : 0);
8142 proto_tree_add_item(wlan_tree, hf_wlan_antenna, tvb, offset, 4, FALSE);
8145 proto_tree_add_item(wlan_tree, hf_wlan_priority, tvb, offset, 4, FALSE);
8147 ssi_type = tvb_get_ntohl(tvb, offset);
8149 proto_tree_add_uint(wlan_tree, hf_wlan_ssi_type, tvb, offset, 4, ssi_type);
8155 /* either there is no SSI information, or we don't know what type it is */
8159 /* Normalized RSSI */
8160 if (check_col(pinfo->cinfo, COL_RSSI))
8161 col_add_fstr(pinfo->cinfo, COL_RSSI, "%u (norm)", tvb_get_ntohl(tvb, offset));
8163 proto_tree_add_item(wlan_tree, hf_normrssi_antsignal, tvb, offset, 4, FALSE);
8168 if (check_col(pinfo->cinfo, COL_RSSI))
8169 col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm", tvb_get_ntohl(tvb, offset));
8171 proto_tree_add_item(wlan_tree, hf_dbm_antsignal, tvb, offset, 4, FALSE);
8176 if (check_col(pinfo->cinfo, COL_RSSI))
8177 col_add_fstr(pinfo->cinfo, COL_RSSI, "%u (raw)", tvb_get_ntohl(tvb, offset));
8179 proto_tree_add_item(wlan_tree, hf_rawrssi_antsignal, tvb, offset, 4, FALSE);
8183 antnoise = tvb_get_ntohl(tvb, offset);
8184 /* 0xffffffff means "hardware does not provide noise data" */
8185 if (antnoise != 0xffffffff) {
8190 /* either there is no SSI information, or we don't know what type it is */
8194 /* Normalized RSSI */
8196 proto_tree_add_uint(wlan_tree, hf_normrssi_antnoise, tvb, offset, 4, antnoise);
8202 proto_tree_add_int(wlan_tree, hf_dbm_antnoise, tvb, offset, 4, antnoise);
8208 proto_tree_add_uint(wlan_tree, hf_rawrssi_antnoise, tvb, offset, 4, antnoise);
8214 proto_tree_add_item(wlan_tree, hf_wlan_preamble, tvb, offset, 4, FALSE);
8217 proto_tree_add_item(wlan_tree, hf_wlan_encoding, tvb, offset, 4, FALSE);
8221 proto_tree_add_item(wlan_tree, hf_wlan_sequence, tvb, offset, 4, FALSE);
8224 proto_tree_add_item(wlan_tree, hf_wlan_drops, tvb, offset, 4, FALSE);
8227 proto_tree_add_item(wlan_tree, hf_wlan_receiver_addr, tvb, offset, 6, FALSE);
8230 proto_tree_add_item(wlan_tree, hf_wlan_padding, tvb, offset, 2, FALSE);
8238 /* dissect the 802.11 header next */
8239 next_tvb = tvb_new_subset(tvb, offset, -1, -1);
8240 call_dissector(ieee80211_handle, next_tvb, pinfo, tree);
8244 proto_register_ieee80211 (void)
8247 GString *key_name, *key_title, *key_desc;
8249 static const value_string frame_type[] = {
8250 {MGT_FRAME, "Management frame"},
8251 {CONTROL_FRAME, "Control frame"},
8252 {DATA_FRAME, "Data frame"},
8256 static const value_string tofrom_ds[] = {
8257 {0, "Not leaving DS or network is operating "
8258 "in AD-HOC mode (To DS: 0 From DS: 0)"},
8259 {FLAG_TO_DS, "Frame from STA to DS via an AP (To DS: 1 "
8261 {FLAG_FROM_DS, "Frame from DS to a STA via AP(To DS: 0 "
8263 {FLAG_TO_DS|FLAG_FROM_DS, "Frame part of WDS from one AP to another "
8264 "AP (To DS: 1 From DS: 1)"},
8268 static const true_false_string tods_flag = {
8269 "Frame is entering DS",
8270 "Frame is not entering DS"
8273 static const true_false_string fromds_flag = {
8274 "Frame is exiting DS",
8275 "Frame is not exiting DS"
8278 static const true_false_string more_frags = {
8279 "More fragments follow",
8280 "This is the last fragment"
8283 static const true_false_string retry_flags = {
8284 "Frame is being retransmitted",
8285 "Frame is not being retransmitted"
8288 static const true_false_string pm_flags = {
8289 "STA will go to sleep",
8293 static const true_false_string md_flags = {
8294 "Data is buffered for STA at AP",
8298 static const true_false_string protected_flags = {
8299 "Data is protected",
8300 "Data is not protected"
8303 static const true_false_string order_flags = {
8305 "Not strictly ordered"
8308 static const true_false_string cf_ess_flags = {
8309 "Transmitter is an AP",
8310 "Transmitter is a STA"
8314 static const true_false_string cf_privacy_flags = {
8315 "AP/STA can support WEP",
8316 "AP/STA cannot support WEP"
8319 static const true_false_string cf_preamble_flags = {
8320 "Short preamble allowed",
8321 "Short preamble not allowed"
8324 static const true_false_string cf_pbcc_flags = {
8325 "PBCC modulation allowed",
8326 "PBCC modulation not allowed"
8329 static const true_false_string cf_agility_flags = {
8330 "Channel agility in use",
8331 "Channel agility not in use"
8334 static const true_false_string short_slot_time_flags = {
8335 "Short slot time in use",
8336 "Short slot time not in use"
8339 static const true_false_string dsss_ofdm_flags = {
8340 "DSSS-OFDM modulation allowed",
8341 "DSSS-OFDM modulation not allowed"
8344 static const true_false_string cf_spec_man_flags = {
8345 "dot11SpectrumManagementRequired TRUE",
8346 "dot11SpectrumManagementRequired FALSE"
8349 static const true_false_string cf_apsd_flags = {
8351 "apsd not implemented"
8354 static const true_false_string cf_del_blk_ack_flags = {
8355 "delayed block ack implemented",
8356 "delayed block ack not implemented"
8359 static const true_false_string cf_imm_blk_ack_flags = {
8360 "immediate block ack implemented",
8361 "immediate block ack not implemented"
8363 static const true_false_string cf_ibss_flags = {
8364 "Transmitter belongs to an IBSS",
8365 "Transmitter belongs to a BSS"
8368 static const true_false_string eosp_flag = {
8369 "End of service period",
8373 static const true_false_string hf_qos_amsdu_present_flag = {
8378 static const value_string sta_cf_pollable[] = {
8379 {0x00, "Station is not CF-Pollable"},
8380 {0x02, "Station is CF-Pollable, "
8381 "not requesting to be placed on the CF-polling list"},
8382 {0x01, "Station is CF-Pollable, "
8383 "requesting to be placed on the CF-polling list"},
8384 {0x03, "Station is CF-Pollable, requesting never to be polled"},
8385 {0x0200, "QSTA requesting association in QBSS"},
8389 static const value_string ap_cf_pollable[] = {
8390 {0x00, "No point coordinator at AP"},
8391 {0x02, "Point coordinator at AP for delivery only (no polling)"},
8392 {0x01, "Point coordinator at AP for delivery and polling"},
8394 {0x0200, "QAP (HC) does not use CFP for delivery of unicast data type frames"},
8395 {0x0202, "QAP (HC) uses CFP for delivery, but does not send CF-Polls to non-QoS STAs"},
8396 {0x0201, "QAP (HC) uses CFP for delivery, and sends CF-Polls to non-QoS STAs"},
8397 {0x0203, "Reserved"},
8402 static const value_string auth_alg[] = {
8403 {0x00, "Open System"},
8404 {0x01, "Shared key"},
8405 {0x80, "Network EAP"}, /* Cisco proprietary? */
8409 /*** Begin: Block Ack Params Fixed Field - Dustin Johnson ***/
8410 static const true_false_string ff_block_ack_params_amsdu_permitted_flag = {
8411 "Permitted in QoS Data MPDUs",
8415 static const true_false_string ff_block_ack_params_policy_flag = {
8416 "Immediate Block Ack",
8419 /*** End: Block Ack Params Fixed Field - Dustin Johnson ***/
8421 /*** Begin: Channel Width Fixed Field - Dustin Johnson ***/
8422 static const value_string ff_channel_width_vals[] = {
8423 {0x00, "20 MHz channel width only"},
8424 {0x01, "Any channel width in the STA
\92s Supported Channel Width Set"},
8427 /*** End: Channel Width Fixed Field - Dustin Johnson ***/
8429 /*** Begin: QoS Inforamtion AP Fixed Field - Dustin Johnson ***/
8430 static const true_false_string ff_qos_info_ap_q_ack_flag = {
8435 static const true_false_string ff_qos_info_ap_queue_req_flag = {
8436 "Can process a nonzero Queue Size subfield in the QoS Control field in QoS data frames",
8437 "Can NOT process a nonzero Queue Size subfield in the QoS Control field in QoS data frames"
8440 static const true_false_string ff_qos_info_ap_txop_request_flag = {
8441 "Can process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames",
8442 "Can NOT process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames"
8444 /*** End: QoS Inforamtion AP Fixed Field - Dustin Johnson ***/
8446 /*** Begin: QoS Inforamtion STA Fixed Field - Dustin Johnson ***/
8447 static const true_false_string ff_qos_info_sta_ac_flag = {
8448 "Trigger-enabled and Delivery-enabled",
8449 "Neither Trigger-enabled nor Delivery-enabled"
8452 static const true_false_string ff_qos_info_sta_q_ack_flag = {
8457 static const value_string ff_qos_info_sta_max_sp_len_flags[] = {
8458 {0x00, "AP may deliver all buffered MSDUs, A-MSDUs and MMPDUs"},
8459 {0x01, "AP may deliver a maximum of two MSDUs and MMPDUs per SP"},
8460 {0x02, "AP may deliver a maximum of four MSDUs and MMPDUs per SP"},
8461 {0x03, "AP may deliver a maximum of six MSDUs and MMPDUs per SP"},
8465 static const true_false_string ff_qos_info_sta_more_data_ack_flag = {
8466 "Can process ACK frames with the More Data bit in the Frame Control field set to 1",
8467 "Can NOT process ACK frames with the More Data bit in the Frame Control field set to 1"
8469 /*** End: QoS Inforamtion STA Fixed Field - Dustin Johnson ***/
8471 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
8472 static const true_false_string ff_sm_pwr_save_enabled_flag = {
8477 static const true_false_string ff_sm_pwr_save_sm_mode_flag = {
8478 "Dynamic SM Power Save mode",
8479 "Static SM Power Save mode"
8481 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
8483 /*** Begin: PCO Phase Control Fixed Field - Dustin Johnson ***/
8484 static const true_false_string ff_pco_phase_cntrl_flag = {
8488 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
8490 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
8491 static const true_false_string ff_psmp_param_set_more_psmp_flag = {
8492 "More PSMP Sequences Follow",
8493 "No PSMP Sequences Follow"
8495 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
8497 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
8498 static const value_string ff_mimo_cntrl_nc_index_flags[] = {
8500 {0x01, "2 Columns"},
8501 {0x02, "3 Columns"},
8502 {0x03, "4 Columns"},
8506 static const value_string ff_mimo_cntrl_nr_index_flags[] = {
8514 static const true_false_string ff_mimo_cntrl_channel_width_flag = {
8519 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
8520 static const true_false_string ff_ht_info_information_request_flag = {
8521 "Requesting HT Information Exchange management action frame",
8522 "Should not send an HT Information Exchange management action frame"
8525 static const true_false_string ff_ht_info_40_mhz_intolerant_flag = {
8526 "Transmitting station is intolerant of 40 MHz operation",
8527 "Transmitting station permits 40 MHz operation"
8530 static const true_false_string ff_ht_info_sta_chan_width_flag = {
8534 /*** End: HT Information Fixed Field - Dustin Johnson ***/
8536 /*** Begin: HT Category Fixed Field - Dustin Johnson ***/
8537 static const value_string ff_ht_action_flags[] = {
8538 {HT_ACTION_NOTIFY_CHAN_WIDTH, "Notify Channel Width"},
8539 {HT_ACTION_SM_PWR_SAVE, "Spatial Multiplexing (SM) Power Save"},
8540 {HT_ACTION_PSMP_ACTION, "Power Save Multi-Poll (PSMP) action frame"},
8541 {HT_ACTION_SET_PCO_PHASE, "Set PCO Phase"},
8542 {HT_ACTION_MIMO_CSI, "MIMO CSI Matrices"},
8543 {HT_ACTION_MIMO_BEAMFORMING, "MIMO Non-compressed Beamforming"},
8544 {HT_ACTION_MIMO_COMPRESSED_BEAMFORMING, "MIMO Compressed Beamforming"},
8545 {HT_ACTION_ANT_SEL_FEEDBACK, "Antenna Selection Indices Feedback"},
8546 {HT_ACTION_HT_INFO_EXCHANGE, "HT Information Exchange"},
8549 /*** Begin: HT Category Fixed Field - Dustin Johnson ***/
8551 static const value_string ff_mimo_cntrl_grouping_flags[] = {
8552 {0x00, "No Grouping"},
8553 {0x01, "Carrier Groups of 2"},
8554 {0x02, "Carrier Groups of 4"},
8559 static const value_string ff_mimo_cntrl_coefficient_size_flags[] = {
8567 static const value_string ff_mimo_cntrl_codebook_info_flags[] = {
8568 {0x00, "1 bit for 'Capital Psi', 3 bits for 'Small Psi'"},
8569 {0x01, "2 bit for 'Capital Psi', 4 bits for 'Small Psi'"},
8570 {0x02, "3 bit for 'Capital Psi', 5 bits for 'Small Psi'"},
8571 {0x03, "4 bit for 'Capital Psi', 6 bits for 'Small Psi'"},
8574 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
8576 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
8577 static const value_string ff_psmp_sta_info_flags[] = {
8578 {0x00, "Broadcast"},
8579 {0x01, "Multicast"},
8580 {0x02, "Individually Addressed"},
8584 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
8586 static const value_string reason_codes[] = {
8588 {0x01, "Unspecified reason"},
8589 {0x02, "Previous authentication no longer valid"},
8590 {0x03, "Deauthenticated because sending STA is leaving (has left) "
8592 {0x04, "Disassociated due to inactivity"},
8593 {0x05, "Disassociated because AP is unable to handle all currently "
8594 "associated stations"},
8595 {0x06, "Class 2 frame received from nonauthenticated station"},
8596 {0x07, "Class 3 frame received from nonassociated station"},
8597 {0x08, "Disassociated because sending STA is leaving (has left) BSS"},
8598 {0x09, "Station requesting (re)association is not authenticated with "
8599 "responding station"},
8600 {0x0A, "Disassociated because the information in the Power Capability "
8601 "element is unacceptable"},
8602 {0x0B, "Disassociated because the information in the Supported"
8603 "Channels element is unacceptable"},
8604 {0x0D, "Invalid Information Element"},
8605 {0x0E, "Michael MIC failure"},
8606 {0x0F, "4-Way Handshake timeout"},
8607 {0x10, "Group key update timeout"},
8608 {0x11, "Information element in 4-Way Handshake different from "
8609 "(Re)Association Request/Probe Response/Beacon"},
8610 {0x12, "Group Cipher is not valid"},
8611 {0x13, "Pairwise Cipher is not valid"},
8612 {0x14, "AKMP is not valid"},
8613 {0x15, "Unsupported RSN IE version"},
8614 {0x16, "Invalid RSN IE Capabilities"},
8615 {0x17, "IEEE 802.1X Authentication failed"},
8616 {0x18, "Cipher suite is rejected per security policy"},
8617 {0x20, "Disassociated for unspecified, QoS-related reason"},
8618 {0x21, "Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA"},
8619 {0x22, "Disassociated because of excessive number of frames that need to be "
8620 "acknowledged, but are not acknowledged for AP transmissions and/or poor "
8621 "channel conditions"},
8622 {0x23, "Disassociated because STA is transmitting outside the limits of its TXOPs"},
8623 {0x24, "Requested from peer STA as the STA is leaving the BSS (or resetting)"},
8624 {0x25, "Requested from peer STA as it does not want to use the mechanism"},
8625 {0x26, "Requested from peer STA as the STA received frames using the mechanism "
8626 "for which a set up is required"},
8627 {0x27, "Requested from peer STA due to time out"},
8628 {0x2D, "Peer STA does not support the requested cipher suite"},
8629 {0x2E, "Association denied due to requesting STA not supporting HT features"},
8634 static const value_string status_codes[] = {
8635 {0x00, "Successful"},
8636 {0x01, "Unspecified failure"},
8637 {0x0A, "Cannot support all requested capabilities in the "
8638 "Capability information field"},
8639 {0x0B, "Reassociation denied due to inability to confirm that "
8640 "association exists"},
8641 {0x0C, "Association denied due to reason outside the scope of this "
8644 {0x0D, "Responding station does not support the specified authentication "
8646 {0x0E, "Received an Authentication frame with authentication sequence "
8647 "transaction sequence number out of expected sequence"},
8648 {0x0F, "Authentication rejected because of challenge failure"},
8649 {0x10, "Authentication rejected due to timeout waiting for next "
8650 "frame in sequence"},
8651 {0x11, "Association denied because AP is unable to handle additional "
8652 "associated stations"},
8653 {0x12, "Association denied due to requesting station not supporting all "
8654 "of the datarates in the BSSBasicServiceSet Parameter"},
8655 {0x13, "Association denied due to requesting station not supporting "
8656 "short preamble operation"},
8657 {0x14, "Association denied due to requesting station not supporting "
8659 {0x15, "Association denied due to requesting station not supporting "
8661 {0x16, "Association request rejected because Spectrum Management"
8662 "capability is required"},
8663 {0x17, "Association request rejected because the information in the"
8664 "Power Capability element is unacceptable"},
8665 {0x18, "Association request rejected because the information in the"
8666 "Supported Channels element is unacceptable"},
8667 {0x19, "Association denied due to requesting station not supporting "
8668 "short slot operation"},
8669 {0x1A, "Association denied due to requesting station not supporting "
8670 "DSSS-OFDM operation"},
8671 {0x20, "Unspecified, QoS-related failure"},
8672 {0x21, "Association denied due to QAP having insufficient bandwidth "
8673 "to handle another QSTA"},
8674 {0x22, "Association denied due to excessive frame loss rates and/or "
8675 "poor conditions on current operating channel"},
8676 {0x23, "Association (with QBSS) denied due to requesting station not "
8677 "supporting the QoS facility"},
8678 {0x24, "Association denied due to requesting station not supporting "
8680 {0x25, "The request has been declined."},
8681 {0x26, "The request has not been successful as one or more parameters "
8682 "have invalid values."},
8683 {0x27, "The TS has not been created because the request cannot be honored. "
8684 "However, a suggested TSPEC is provided so that the initiating QSTA may "
8685 "attempt to set another TS with the suggested changes to the TSPEC."},
8686 {0x28, "Invalid Information Element"},
8687 {0x29, "Group Cipher is not valid"},
8688 {0x2A, "Pairwise Cipher is not valid"},
8689 {0x2B, "AKMP is not valid"},
8690 {0x2C, "Unsupported RSN IE version"},
8691 {0x2D, "Invalid RSN IE Capabilities"},
8692 {0x2E, "Cipher suite is rejected per security policy"},
8693 {0x2F, "The TS has not been created. However, the HC may be capable of "
8694 "creating a TS, in response to a request, after the time indicated in the TS Delay element."},
8695 {0x30, "Direct Link is not allowed in the BSS by policy"},
8696 {0x31, "Destination STA is not present within this QBSS."},
8697 {0x32, "The Destination STA is not a QSTA."},
8701 static const value_string category_codes[] = {
8702 {CAT_SPECTRUM_MGMT, "Spectrum Management (SM)"},
8703 {CAT_QOS, "Quality of Service (QoS)"},
8704 {CAT_DLS, "Direct-Link Setup (DLS)"},
8705 {CAT_BLOCK_ACK, "Block Ack"},
8706 {CAT_RADIO_MEASUREMENT, "Radio Measurement"},
8707 {CAT_HT, "High Throughput"},
8708 {CAT_MGMT_NOTIFICATION, "Management Notification"},
8709 {CAT_VENDOR_SPECIFIC, "Vendor Specific"},
8713 static const value_string action_codes[] ={
8714 {SM_ACTION_MEASUREMENT_REQUEST, "Measurement Request"},
8715 {SM_ACTION_MEASUREMENT_REPORT, "Measurement Report"},
8716 {SM_ACTION_TPC_REQUEST, "TPC Request"},
8717 {SM_ACTION_TPC_REPORT, "TPC Report"},
8718 {SM_ACTION_CHAN_SWITCH_ANNC, "Channel Switch Announcement"},
8722 static const value_string vendor_action_types_mrvl[] ={
8723 {MRVL_ACTION_MESH_MANAGEMENT, "Mesh Management"},
8727 static const value_string mesh_mgt_action_codes_mrvl[] ={
8728 {MRVL_MESH_MGMT_ACTION_RREQ, "Route Request"},
8729 {MRVL_MESH_MGMT_ACTION_RREP, "Route Response"},
8730 {MRVL_MESH_MGMT_ACTION_RERR, "Route Error"},
8731 {MRVL_MESH_MGMT_ACTION_PLDM, "Peer Link Down"},
8735 static const value_string mesh_path_selection_codes[] ={
8736 {0x0, "Hybrid Wireless Mesh Protocol"},
8740 static const value_string mesh_metric_codes[] ={
8741 {0x0, "Airtime Link Metric"},
8745 static const value_string wme_action_codes[] = {
8746 {0x00, "Setup request"},
8747 {0x01, "Setup response"},
8752 static const value_string wme_status_codes[] = {
8753 {0x00, "Admission accepted"},
8754 {0x01, "Invalid parameters"},
8759 static const value_string ack_policy[] = {
8760 {0x00, "Normal Ack"},
8762 {0x02, "No explicit acknowledgment"},
8763 {0x03, "Block Ack"},
8767 static const value_string qos_action_codes[] = {
8768 {SM_ACTION_ADDTS_REQUEST, "ADDTS Request"},
8769 {SM_ACTION_ADDTS_RESPONSE, "ADDTS Response"},
8770 {SM_ACTION_DELTS, "DELTS"},
8771 {SM_ACTION_QOS_SCHEDULE, "Schedule"},
8775 /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/
8776 static const value_string ba_action_codes[] = {
8777 {BA_ADD_BLOCK_ACK_REQUEST, "Add Block Ack Request"},
8778 {BA_ADD_BLOCK_ACK_RESPONSE, "Add Block Ack Response"},
8779 {BA_DELETE_BLOCK_ACK, "Delete Block Ack"},
8782 /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/
8784 static const value_string dls_action_codes[] = {
8785 {SM_ACTION_DLS_REQUEST, "DLS Request"},
8786 {SM_ACTION_DLS_RESPONSE, "DLS Response"},
8787 {SM_ACTION_DLS_TEARDOWN, "DLS Teardown"},
8791 static const value_string tsinfo_type[] = {
8792 {0x0, "Aperiodic or unspecified Traffic"},
8793 {0x1, "Periodic Traffic"},
8797 static const value_string tsinfo_direction[] = {
8800 {0x02, "Direct link"},
8801 {0x03, "Bidirectional link"},
8805 static const value_string tsinfo_access[] = {
8813 static const value_string qos_up[] = {
8814 {0x00, "Best Effort"},
8815 {0x01, "Background"},
8817 {0x03, "Excellent Effort"},
8818 {0x04, "Controlled Load"},
8821 {0x07, "Network Control"},
8825 static const value_string classifier_type[] = {
8826 {0x00, "Ethernet parameters"},
8827 {0x01, "TCP/UDP IP parameters"},
8828 {0x02, "IEEE 802.1D/Q parameters"},
8832 static const value_string tclas_process[] = {
8833 {0x00, "Incoming MSDU's higher layer parameters have to match to the parameters in all associated TCLAS elements."},
8834 {0x01, "Incoming MSDU's higher layer parameters have to match to at least one of the associated TCLAS elements."},
8835 {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."},
8839 /*** Begin: Block Ack/Block Ack Request - Dustin Johnson***/
8840 static const true_false_string hf_block_ack_control_ack_policy_flag = {
8841 "Immediate Acknowledgement Required",
8842 "Sender Does Not Require Immediate Acknowledgement"
8845 static const value_string hf_block_ack_request_type_flags[] = {
8846 {0x00, "Basic Block Ack Request"},
8848 {0x02, "Compressed Block Ack Request"},
8849 {0x03, "Multi-TID Block Ack Request"},
8853 static const value_string hf_block_ack_type_flags[] = {
8854 {0x00, "Basic Block Ack"},
8856 {0x02, "Compressed Block"},
8857 {0x03, "Multi-TID Block"},
8860 /*** End: Block Ack/Block Ack Request - Dustin Johnson***/
8862 static const value_string phy_type[] = {
8864 { 1, "FHSS 802.11 '97" },
8865 { 2, "DSSS 802.11 '97" },
8866 { 3, "IR Baseband" },
8867 { 4, "DSSS 802.11b" },
8868 { 5, "PBCC 802.11b" },
8869 { 6, "OFDM 802.11g" },
8870 { 7, "PBCC 802.11g" },
8871 { 8, "OFDM 802.11a" },
8875 static const value_string encoding_type[] = {
8888 static const value_string ssi_type[] = {
8889 { SSI_NONE, "None" },
8890 { SSI_NORM_RSSI, "Normalized RSSI" },
8892 { SSI_RAW_RSSI, "Raw RSSI" },
8896 static const value_string preamble_type[] = {
8903 static hf_register_info hf[] = {
8905 {"MAC timestamp", "wlan.mactime", FT_UINT64, BASE_DEC, NULL, 0x0,
8906 "Value in microseconds of the MAC's Time Synchronization Function timer when the first bit of the MPDU arrived at the MAC", HFILL }},
8909 {"Host timestamp", "wlan.hosttime", FT_UINT64, BASE_DEC, NULL, 0x0,
8913 {"Data Rate", "wlan.data_rate", FT_UINT64, BASE_DEC, NULL, 0,
8914 "Data rate (b/s)", HFILL }},
8917 {"Channel", "wlan.channel", FT_UINT8, BASE_DEC, NULL, 0,
8918 "802.11 channel number that this frame was sent/received on", HFILL }},
8920 {&hf_channel_frequency,
8921 {"Channel frequency", "wlan.channel_frequency", FT_UINT32, BASE_DEC, NULL, 0x0,
8922 "Channel frequency in megahertz that this frame was sent/received on", HFILL }},
8925 {"Antenna", "wlan.antenna", FT_UINT32, BASE_DEC, NULL, 0x0,
8926 "Antenna number this frame was sent/received over (starting at 0)", HFILL } },
8928 {&hf_normrssi_antsignal,
8929 {"Normalized RSSI Signal", "wlan.normrssi_antsignal", FT_UINT32, BASE_DEC, NULL, 0x0,
8930 "RF signal power at the antenna, normalized to the range 0-1000", HFILL }},
8933 {"SSI Signal (dBm)", "wlan.dbm_antsignal", FT_INT32, BASE_DEC, NULL, 0x0,
8934 "RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL }},
8936 {&hf_rawrssi_antsignal,
8937 {"Raw RSSI Signal", "wlan.rawrssi_antsignal", FT_UINT32, BASE_DEC, NULL, 0x0,
8938 "RF signal power at the antenna, reported as RSSI by the adapter", HFILL }},
8940 {&hf_normrssi_antnoise,
8941 {"Normalized RSSI Noise", "wlan.normrssi_antnoise", FT_UINT32, BASE_DEC, NULL, 0x0,
8942 "RF noise power at the antenna, normalized to the range 0-1000", HFILL }},
8945 {"SSI Noise (dBm)", "radiotap.dbm_antnoise", FT_INT32, BASE_DEC, NULL, 0x0,
8946 "RF noise power at the antenna from a fixed, arbitrary value in decibels per one milliwatt", HFILL }},
8948 {&hf_rawrssi_antnoise,
8949 {"Raw RSSI Noise", "wlan.rawrssi_antnoise", FT_UINT32, BASE_DEC, NULL, 0x0,
8950 "RF noise power at the antenna, reported as RSSI by the adapter", HFILL }},
8952 {&hf_signal_strength,
8953 {"Signal Strength", "wlan.signal_strength", FT_UINT8, BASE_DEC, NULL, 0,
8954 "Signal strength (Percentage)", HFILL }},
8957 {"Frame Control Field", "wlan.fc", FT_UINT16, BASE_HEX, NULL, 0,
8958 "MAC Frame control", HFILL }},
8960 {&hf_fc_proto_version,
8961 {"Version", "wlan.fc.version", FT_UINT8, BASE_DEC, NULL, 0,
8962 "MAC Protocol version", HFILL }}, /* 0 */
8965 {"Type", "wlan.fc.type", FT_UINT8, BASE_DEC, VALS(frame_type), 0,
8966 "Frame type", HFILL }},
8968 {&hf_fc_frame_subtype,
8969 {"Subtype", "wlan.fc.subtype", FT_UINT8, BASE_DEC, NULL, 0,
8970 "Frame subtype", HFILL }}, /* 2 */
8972 {&hf_fc_frame_type_subtype,
8973 {"Type/Subtype", "wlan.fc.type_subtype", FT_UINT8, BASE_HEX, VALS(frame_type_subtype_vals), 0,
8974 "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
8977 {"Protocol Flags", "wlan.flags", FT_UINT8, BASE_HEX, NULL, 0,
8978 "Protocol flags", HFILL }},
8981 {"DS status", "wlan.fc.ds", FT_UINT8, BASE_HEX, VALS (&tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
8982 "Data-frame DS-traversal status", HFILL }}, /* 3 */
8985 {"To DS", "wlan.fc.tods", FT_BOOLEAN, 8, TFS (&tods_flag), FLAG_TO_DS,
8986 "To DS flag", HFILL }}, /* 4 */
8989 {"From DS", "wlan.fc.fromds", FT_BOOLEAN, 8, TFS (&fromds_flag), FLAG_FROM_DS,
8990 "From DS flag", HFILL }}, /* 5 */
8993 {"More Fragments", "wlan.fc.frag", FT_BOOLEAN, 8, TFS (&more_frags), FLAG_MORE_FRAGMENTS,
8994 "More Fragments flag", HFILL }}, /* 6 */
8997 {"Retry", "wlan.fc.retry", FT_BOOLEAN, 8, TFS (&retry_flags), FLAG_RETRY,
8998 "Retransmission flag", HFILL }},
9000 { &hf_fc_analysis_retransmission,
9001 {"Retransmission", "wlan.analysis.retransmission", FT_NONE, BASE_NONE,
9002 NULL, 0x0, "This frame is a suspected wireless retransmission", HFILL }},
9004 { &hf_fc_analysis_retransmission_frame,
9005 {"Retransmission of frame", "wlan.analysis.retransmission_frame", FT_FRAMENUM, BASE_NONE,
9006 NULL, 0x0, "This is a retransmission of frame #", HFILL }},
9009 {"PWR MGT", "wlan.fc.pwrmgt", FT_BOOLEAN, 8, TFS (&pm_flags), FLAG_POWER_MGT,
9010 "Power management status", HFILL }},
9013 {"More Data", "wlan.fc.moredata", FT_BOOLEAN, 8, TFS (&md_flags), FLAG_MORE_DATA,
9014 "More data flag", HFILL }},
9017 {"Protected flag", "wlan.fc.protected", FT_BOOLEAN, 8, TFS (&protected_flags), FLAG_PROTECTED,
9018 "Protected flag", HFILL }},
9021 {"Order flag", "wlan.fc.order", FT_BOOLEAN, 8, TFS (&order_flags), FLAG_ORDER,
9022 "Strictly ordered flag", HFILL }},
9025 {"Association ID","wlan.aid",FT_UINT16, BASE_DEC,NULL,0,
9026 "Association-ID field", HFILL }},
9029 {"Duration", "wlan.duration", FT_UINT16, BASE_DEC, NULL, 0,
9030 "Duration field", HFILL }},
9033 {"Destination address", "wlan.da", FT_ETHER, BASE_NONE, NULL, 0,
9034 "Destination Hardware Address", HFILL }},
9037 {"Source address", "wlan.sa", FT_ETHER, BASE_NONE, NULL, 0,
9038 "Source Hardware Address", HFILL }},
9041 {"Source or Destination address", "wlan.addr", FT_ETHER, BASE_NONE, NULL, 0,
9042 "Source or Destination Hardware Address", HFILL }},
9045 {"Receiver address", "wlan.ra", FT_ETHER, BASE_NONE, NULL, 0,
9046 "Receiving Station Hardware Address", HFILL }},
9049 {"Transmitter address", "wlan.ta", FT_ETHER, BASE_NONE, NULL, 0,
9050 "Transmitting Station Hardware Address", HFILL }},
9053 {"First Address of Contained Frame", "wlan.controlwrap.addr1", FT_ETHER, BASE_NONE, NULL, 0,
9054 "First Address of Contained Frame", HFILL }},
9057 {"BSS Id", "wlan.bssid", FT_ETHER, BASE_NONE, NULL, 0,
9058 "Basic Service Set ID", HFILL }},
9061 {"Fragment number", "wlan.frag", FT_UINT16, BASE_DEC, NULL, 0,
9062 "Fragment number", HFILL }},
9065 {"Sequence number", "wlan.seq", FT_UINT16, BASE_DEC, NULL, 0,
9066 "Sequence number", HFILL }},
9069 {"Priority", "wlan.qos.priority", FT_UINT16, BASE_DEC, NULL, 0,
9070 "802.1D Tag", HFILL }},
9073 {"EOSP", "wlan.qos.eosp", FT_BOOLEAN, 8, TFS (&eosp_flag), QOS_FLAG_EOSP,
9074 "EOSP Field", HFILL }},
9076 {&hf_qos_ack_policy,
9077 {"Ack Policy", "wlan.qos.ack", FT_UINT8, BASE_HEX, VALS (&ack_policy), 0,
9078 "Ack Policy", HFILL }},
9080 {&hf_qos_amsdu_present,
9081 {"Payload Type", "wlan.qos.amsdupresent", FT_BOOLEAN, BASE_NONE,
9082 TFS (&hf_qos_amsdu_present_flag), 0, "Payload Type", HFILL }},
9084 {&hf_qos_field_content,
9085 {"Content", "wlan.qos.fc_content", FT_UINT16, BASE_DEC, NULL, 0,
9086 "Content1", HFILL }},
9088 /* {&hf_qos_buffer_state,
9089 {"QAP PS buffer State", "wlan.qos.ps_buf_state", FT_UINT16, BASE_DEC, NULL, 0,
9090 "QAP PS buffer State", HFILL }},
9092 {&hf_qos_txop_dur_req,
9093 {"TXOP Duration Requested", "wlan.qos.txop_dur_req", FT_UINT16, BASE_DEC, NULL, 0,
9094 "TXOP Duration Requested", HFILL }},
9096 {&hf_qos_queue_size,
9097 {"Queue Size", "wlan.qos.queue_size", FT_UINT16, BASE_DEC, NULL, 0,
9098 "Queue Size", HFILL }},*/
9101 {"Frame check sequence", "wlan.fcs", FT_UINT32, BASE_HEX,
9102 NULL, 0, "Frame Check Sequence (FCS)", HFILL }},
9105 {"Good", "wlan.fcs_good", FT_BOOLEAN, BASE_NONE,
9106 NULL, 0, "True if the FCS is correct", HFILL }},
9109 {"Bad", "wlan.fcs_bad", FT_BOOLEAN, BASE_NONE,
9110 NULL, 0, "True if the FCS is incorrect", HFILL }},
9112 {&hf_fragment_overlap,
9113 {"Fragment overlap", "wlan.fragment.overlap", FT_BOOLEAN, BASE_NONE,
9114 NULL, 0x0, "Fragment overlaps with other fragments", HFILL }},
9116 {&hf_fragment_overlap_conflict,
9117 {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
9118 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9119 "Overlapping fragments contained conflicting data", HFILL }},
9121 {&hf_fragment_multiple_tails,
9122 {"Multiple tail fragments found", "wlan.fragment.multipletails",
9123 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9124 "Several tails were found when defragmenting the packet", HFILL }},
9126 {&hf_fragment_too_long_fragment,
9127 {"Fragment too long", "wlan.fragment.toolongfragment",
9128 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9129 "Fragment contained data past end of packet", HFILL }},
9131 {&hf_fragment_error,
9132 {"Defragmentation error", "wlan.fragment.error",
9133 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9134 "Defragmentation error due to illegal fragments", HFILL }},
9137 {"802.11 Fragment", "wlan.fragment", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9138 "802.11 Fragment", HFILL }},
9141 {"802.11 Fragments", "wlan.fragments", FT_NONE, BASE_NONE, NULL, 0x0,
9142 "802.11 Fragments", HFILL }},
9144 {&hf_reassembled_in,
9145 {"Reassembled 802.11 in frame", "wlan.reassembled_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9146 "This 802.11 packet is reassembled in this frame", HFILL }},
9149 {"Initialization Vector", "wlan.wep.iv", FT_UINT24, BASE_HEX, NULL, 0,
9150 "Initialization Vector", HFILL }},
9153 {"Weak IV", "wlan.wep.weakiv", FT_BOOLEAN,BASE_NONE, NULL,0x0,
9157 {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv", FT_STRING,
9158 BASE_HEX, NULL, 0, "TKIP Extended Initialization Vector", HFILL }},
9161 {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv", FT_STRING,
9162 BASE_HEX, NULL, 0, "CCMP Extended Initialization Vector", HFILL }},
9165 {"Key Index", "wlan.wep.key", FT_UINT8, BASE_DEC, NULL, 0,
9166 "Key Index", HFILL }},
9169 {"WEP ICV", "wlan.wep.icv", FT_UINT32, BASE_HEX, NULL, 0,
9170 "WEP ICV", HFILL }},
9171 /*** Begin: WAVE Service information element Dissection - IEEE 802.11p Draft 4.0 ***/
9172 {&hf_pst_timingquality,
9173 {"Timing Quality", "pst.timingQuality", FT_UINT16, BASE_DEC, NULL, 0,
9174 "PST Timing Quality", HFILL }},
9176 {&hf_pst_providercount,
9177 {"No. of Providers announcing their Services", "pst.providerCount", FT_UINT8, BASE_DEC, NULL, 0,
9178 "Provider Count", HFILL }},
9181 {"Provider Service Table Length ", "pst.length", FT_UINT16, BASE_DEC, NULL, 0,
9182 "PST Length", HFILL }},
9185 {"Provider Service Table Contents ", "pst.contents", FT_UINT8, BASE_HEX, NULL, 0,
9186 "PST Contents", HFILL }},
9189 {"Application Class ID (ACID) ", "pst.ACID", FT_UINT8, BASE_DEC, NULL, 0,
9190 "PST ACID", HFILL }},
9192 {&hf_pst_acm_length,
9193 {"Application Context Mask (ACM) Length", "pst.ACM.length", FT_UINT8, BASE_DEC, NULL, 0,
9194 "PST ACM Length", HFILL }},
9197 {"Application Context Mask", "pst.ACM", FT_STRING, BASE_NONE, NULL, 0,
9198 "PST ACM", HFILL }},
9200 {&hf_pst_acm_contents,
9201 {"Application Context Mask Contents (ACM)", "pst.ACM.contents", FT_UINT32, BASE_DEC, NULL, 0,
9202 "PST ACM Contents", HFILL }},
9205 {"Application Contents Field (ACF)", "pst.ACF", FT_UINT32, BASE_DEC, NULL, 0,
9206 "PST ACF", HFILL }},
9209 {"Application Priority", "pst.priority", FT_UINT8, BASE_DEC, NULL, 0,
9210 "PST Priority", HFILL }},
9213 {"Internet Protocol V6 Address", "pst.ipv6addr", FT_IPv6, BASE_NONE, NULL, 0,
9214 "IP v6 Addr", HFILL }},
9217 {"Medium Access Control Address (MAC addr)", "pst.macaddr", FT_ETHER, BASE_NONE, NULL, 0,
9218 "MAC Address", HFILL }},
9220 {&hf_pst_serviceport,
9221 {"Service Port ", "pst.serviceport", FT_UINT16, BASE_DEC, NULL, 0,
9222 "PST Service Port", HFILL }},
9224 {&hf_pst_addressing,
9225 {"Addressing ", "pst.addressing", FT_UINT8, BASE_DEC, NULL, 0,
9226 "PST Addressing", HFILL }},
9229 {"Service (IEE802.11) Channel", "pst.channel", FT_UINT8, BASE_DEC, NULL, 0,
9230 "PST Service Channel", HFILL }},
9233 {"Number of Channels", "chan.chan_uknown", FT_UINT8, BASE_DEC, NULL, 0,
9234 "Number of Channels", HFILL }},
9237 {"Length", "chan.chan_length", FT_UINT8, BASE_DEC, NULL, 0,
9241 {"Contents", "chan.chan_content", FT_UINT8, BASE_DEC, NULL, 0,
9242 "Contents", HFILL }},
9245 {"channel", "chan.chan_channel", FT_UINT8, BASE_DEC, NULL, 0,
9246 "channel", HFILL }},
9249 {"Adaptable", "chan.chan_adapt", FT_UINT8, BASE_DEC, NULL, 0,
9250 "Adaptable", HFILL }},
9253 {"Rate", "chan.chan_rate", FT_UINT8, BASE_DEC, NULL, 0,
9257 {"Tx Power", "chan.chan_tx_pow", FT_UINT8, BASE_DEC, NULL, 0,
9258 "Tx Power", HFILL }},
9260 /*** Begin: Block Ack Request/Block Ack - Dustin Johnson***/
9261 {&hf_block_ack_request_control,
9262 {"Block Ack Request (BAR) Control", "wlan.bar.control",
9263 FT_UINT16, BASE_HEX, NULL, 0, "Block Ack Request (BAR) Control", HFILL }},
9265 {&hf_block_ack_control,
9266 {"Block Ack Request Control", "wlan.ba.control",
9267 FT_UINT16, BASE_HEX, NULL, 0, "Block Ack Request Control", HFILL }},
9269 {&hf_block_ack_control_ack_policy,
9270 {"BAR Ack Policy", "wlan.ba.control.ackpolicy",
9271 FT_BOOLEAN, 16, TFS (&hf_block_ack_control_ack_policy_flag), 0x01, "Block Ack Request (BAR) Ack Policy", HFILL }},
9273 {&hf_block_ack_control_multi_tid,
9274 {"Multi-TID", "wlan.ba.control.multitid",
9275 FT_BOOLEAN, 16, 0, 0x02, "Multi-Traffic Identifier (TID)", HFILL }},
9277 {&hf_block_ack_control_compressed_bitmap,
9278 {"Compressed Bitmap", "wlan.ba.control.cbitmap",
9279 FT_BOOLEAN, 16, 0, 0x04, "Compressed Bitmap", HFILL }},
9281 {&hf_block_ack_control_reserved,
9282 {"Reserved", "wlan.ba.control.cbitmap",
9283 FT_UINT16, BASE_HEX, NULL, 0x0ff8, "Reserved", HFILL }},
9285 {&hf_block_ack_control_basic_tid_info,
9286 {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
9287 FT_UINT16, BASE_HEX, NULL, 0xf000, "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
9289 {&hf_block_ack_control_compressed_tid_info,
9290 {"TID for which a BlockAck frame is requested", "wlan.bar.compressed.tidinfo",
9291 FT_UINT16, BASE_HEX, NULL, 0xf000, "Traffic Identifier (TID) for which a BlockAck frame is requested", HFILL }},
9293 {&hf_block_ack_control_multi_tid_info,
9294 {"Number of TIDs Present", "wlan.ba.mtid.tidinfo",
9295 FT_UINT16, BASE_HEX, NULL, 0xf000, "Number of Traffic Identifiers (TIDs) Present", HFILL }},
9297 {&hf_block_ack_multi_tid_info,
9298 {"Traffic Identifier (TID) Info", "wlan.ba.mtid.tid",
9299 FT_UINT8, BASE_DEC, 0, 0, "Traffic Identifier (TID) Info", HFILL }},
9301 {&hf_block_ack_multi_tid_reserved,
9302 {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
9303 FT_UINT16, BASE_HEX, 0, 0x0fff, "Reserved", HFILL }},
9305 {&hf_block_ack_multi_tid_value,
9306 {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
9307 FT_UINT16, BASE_HEX, 0, 0xf000, "Multi-TID Value", HFILL }},
9309 {&hf_block_ack_request_type,
9310 {"Block Ack Request Type", "wlan.bar.type",
9311 FT_UINT8, BASE_HEX, VALS(&hf_block_ack_request_type_flags), 0, "Block Ack Request (BAR) Type", HFILL }},
9313 {&hf_block_ack_type,
9314 {"Block Ack Request Type", "wlan.ba.type",
9315 FT_UINT8, BASE_HEX, VALS(&hf_block_ack_type_flags), 0, "Block Ack Request Type", HFILL }}
9316 /*** End: Block Ack Request/Block Ack - Dustin Johnson***/
9319 static hf_register_info hf_prism[] = {
9320 /* Prism-specific header fields
9321 XXX - make as many of these generic as possible. */
9322 { &hf_prism_msgcode,
9323 {"Message Code", "prism.msgcode", FT_UINT32, BASE_HEX, NULL, 0x0,
9327 {"Message Length", "prism.msglen", FT_UINT32, BASE_HEX, NULL, 0x0,
9330 { &hf_prism_rssi_data,
9331 {"RSSI Field", "prism.rssi.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9334 { &hf_prism_sq_data,
9335 {"SQ Field", "prism.sq.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9338 { &hf_prism_signal_data,
9339 {"Signal Field", "prism.signal.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9342 { &hf_prism_noise_data,
9343 {"Noise Field", "prism.noise.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9346 { &hf_prism_rate_data,
9347 {"Rate Field", "prism.rate.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9350 { &hf_prism_istx_data,
9351 {"IsTX Field", "prism.istx.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9354 { &hf_prism_frmlen_data,
9355 {"Frame Length Field", "prism.frmlen.data", FT_UINT32, BASE_HEX, NULL, 0x0,
9359 static hf_register_info hf_wlancap[] = {
9360 /* AVS-specific header fields.
9361 XXX - make as many of these generic as possible. */
9363 {"Header magic", "wlancap.magic", FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF0, "", HFILL } },
9364 { &hf_wlan_version, { "Header revision", "wlancap.version", FT_UINT32,
9365 BASE_DEC, NULL, 0xF, "", HFILL } },
9366 { &hf_wlan_length, { "Header length", "wlancap.length", FT_UINT32,
9367 BASE_DEC, NULL, 0x0, "", HFILL } },
9369 {"PHY type", "wlan.phytype", FT_UINT32, BASE_DEC, VALS(phy_type), 0x0,
9372 { &hf_wlan_priority, { "Priority", "wlancap.priority", FT_UINT32, BASE_DEC,
9373 NULL, 0x0, "", HFILL } },
9374 { &hf_wlan_ssi_type, { "SSI Type", "wlancap.ssi_type", FT_UINT32, BASE_DEC,
9375 VALS(ssi_type), 0x0, "", HFILL } },
9376 { &hf_wlan_ssi_signal, { "SSI Signal", "wlancap.ssi_signal", FT_INT32,
9377 BASE_DEC, NULL, 0x0, "", HFILL } },
9378 { &hf_wlan_ssi_noise, { "SSI Noise", "wlancap.ssi_noise", FT_INT32,
9379 BASE_DEC, NULL, 0x0, "", HFILL } },
9380 { &hf_wlan_preamble, { "Preamble", "wlancap.preamble", FT_UINT32,
9381 BASE_DEC, VALS(preamble_type), 0x0, "", HFILL } },
9382 { &hf_wlan_encoding, { "Encoding Type", "wlancap.encoding", FT_UINT32,
9383 BASE_DEC, VALS(encoding_type), 0x0, "", HFILL } },
9384 { &hf_wlan_sequence, { "Receive sequence", "wlancap.sequence", FT_UINT32,
9385 BASE_DEC, NULL, 0x0, "", HFILL } },
9386 { &hf_wlan_drops, { "Known Dropped Frames", "wlancap.drops", FT_UINT32,
9387 BASE_DEC, NULL, 0x0, "", HFILL } },
9388 { &hf_wlan_receiver_addr, { "Receiver Address", "wlancap.receiver_addr", FT_ETHER,
9389 BASE_NONE, NULL, 0x0, "Receiver Hardware Address", HFILL } },
9390 { &hf_wlan_padding, { "Padding", "wlancap.padding", FT_BYTES,
9391 BASE_NONE, NULL, 0x0, "", HFILL } }
9394 static const true_false_string rsn_preauth_flags = {
9395 "Transmitter supports pre-authentication",
9396 "Transmitter does not support pre-authentication"
9399 static const true_false_string rsn_no_pairwise_flags = {
9400 "Transmitter cannot support WEP default key 0 simultaneously with "
9402 "Transmitter can support WEP default key 0 simultaneously with "
9406 static const value_string rsn_cap_replay_counter[] = {
9407 {0x00, "1 replay counter per PTKSA/GTKSA/STAKeySA"},
9408 {0x01, "2 replay counters per PTKSA/GTKSA/STAKeySA"},
9409 {0x02, "4 replay counters per PTKSA/GTKSA/STAKeySA"},
9410 {0x03, "16 replay counters per PTKSA/GTKSA/STAKeySA"},
9414 static const true_false_string ht_ldpc_coding_flag = {
9415 "Transmitter supports receiving LDPC coded packets",
9416 "Transmitter does not support receiving LDPC coded packets"
9419 static const true_false_string ht_chan_width_flag = {
9420 "Transmitter supports 20MHz and 40MHz operation",
9421 "Transmitter only supports 20MHz operation"
9424 static const value_string ht_sm_pwsave_flag[] = {
9425 {0x00, "Static SM Power Save mode"},
9426 {0x01, "Dynamic SM Power Save mode"},
9428 {0x03, "SM enabled"},
9432 static const true_false_string ht_green_flag = {
9433 "Transmitter is able to receive PPDUs with Green Field (GF) preamble",
9434 "Transmitter is not able to receive PPDUs with Green Field (GF) preamble"
9437 static const true_false_string ht_tf_flag = {
9442 static const value_string ht_rx_stbc_flag[] = {
9443 {0x00, "No Rx STBC support"},
9444 {0x01, "Rx support of one spatial stream"},
9445 {0x02, "Rx support of one and two spatial streams"},
9446 {0x03, "Rx support of one, two, and three spatial streams"},
9450 static const true_false_string ht_delayed_block_ack_flag = {
9451 "Transmitter supports HT-Delayed BlockAck",
9452 "Transmitter does not support HT-Delayed BlockAck"
9455 static const true_false_string ht_max_amsdu_flag = {
9460 static const true_false_string ht_dss_cck_40_flag = {
9461 "Will/Can use DSSS/CCK in 40 MHz",
9462 "Won't/Can't use of DSSS/CCK in 40 MHz"
9465 static const true_false_string ht_psmp_flag = {
9466 "Will/Can support PSMP operation",
9467 "Won't/Can't support PSMP operation"
9470 static const true_false_string ht_40_mhz_intolerant_flag = {
9471 "Use of 40 MHz transmissions restricted/disallowed",
9472 "Use of 40 MHz transmissions unrestricted/allowed"
9475 static const value_string ampduparam_mpdu_start_spacing_flags[] = {
9476 {0x00, "no restriction"},
9477 {0x01, "1/4 [usec]"},
9478 {0x02, "1/2 [usec]"},
9483 {0x07, "16 [usec]"},
9487 static const true_false_string mcsset_tx_mcs_set_defined_flag = {
9492 static const true_false_string mcsset_tx_rx_mcs_set_not_equal_flag = {
9497 static const value_string mcsset_tx_max_spatial_streams_flags[] = {
9498 {0x00, "1 spatial stream"},
9499 {0x01, "2 spatial streams"},
9500 {0x02, "3 spatial streams"},
9501 {0x03, "4 spatial streams"},
9505 static const value_string htex_transtime_flags[] = {
9506 {0x00, "No Transition"},
9513 static const value_string htex_mcs_flags[] = {
9514 {0x00, "STA does not provide MCS feedback"},
9516 {0x02, "STA provides only unsolicited MCS feedback"},
9517 {0x03, "STA can provide MCS feedback in response to MRQ as well as unsolicited MCS feedback"},
9521 static const value_string txbf_calib_flag[] = {
9522 {0x00, "incapable"},
9523 {0x01, "Limited involvement, cannot initiate"},
9524 {0x02, "Limited involvement, can initiate"},
9525 {0x03, "Fully capable"},
9529 static const value_string txbf_feedback_flags[] = {
9530 {0x00, "not supported"},
9531 {0x01, "delayed feedback capable"},
9532 {0x02, "immediate feedback capable"},
9533 {0x03, "delayed and immediate feedback capable"},
9537 static const value_string txbf_antenna_flags[] = {
9538 {0x00, "1 TX antenna sounding"},
9539 {0x01, "2 TX antenna sounding"},
9540 {0x02, "3 TX antenna sounding"},
9541 {0x03, "4 TX antenna sounding"},
9545 static const value_string txbf_csi_max_rows_bf_flags[] = {
9546 {0x00, "1 row of CSI"},
9547 {0x01, "2 rows of CSI"},
9548 {0x02, "3 rows of CSI"},
9549 {0x03, "4 rows of CSI"},
9553 static const value_string txbf_chan_est_flags[] = {
9554 {0x00, "1 space time stream"},
9555 {0x01, "2 space time streams"},
9556 {0x02, "3 space time streams"},
9557 {0x03, "4 space time streams"},
9561 static const value_string txbf_min_group_flags[] = {
9562 {0x00, "No grouping supported"},
9563 {0x01, "Groups of 1,2 supported"},
9564 {0x02, "Groups of 1,4 supported"},
9565 {0x03, "Groups of 1,2,4 supported"},
9569 static const value_string hta_ext_chan_offset_flag[] = {
9570 {0x00, "No Extension Channel"},
9571 {0x01, "Extension Channel above control channel"},
9572 {0x02, "Undefined"},
9573 {0x03, "Extension Channel below control channel"},
9577 static const true_false_string hta_rec_tx_width_flag = {
9578 "Any channel width enabled",
9579 "Use 20MHz channel (control)"
9582 static const true_false_string hta_rifs_mode_flag = {
9583 "Use of RIFS permitted",
9584 "Use of RIFS prohibited"
9587 static const true_false_string hta_controlled_access_flag = {
9592 static const value_string hta_service_interval_flag[] = {
9604 static const value_string hta_operating_mode_flag[] = {
9605 {0x00, "Pure HT, no protection"},
9606 {0x01, "There may be non-HT devices (control & ext channel)"},
9607 {0x02, "No non-HT is associated, but at least 1 20MHz is. protect on"},
9608 {0x03, "Mixed: no non-HT is associated, protect on"},
9612 static const true_false_string hta_non_gf_devices_flag = {
9613 "All HT devices associated are GF capable",
9614 "One or More HT devices are not GF capable"
9617 static const true_false_string hta_dual_stbc_protection_flag = {
9618 "Dual CTS protections is used",
9619 "Regular use of RTS/CTS"
9622 static const true_false_string hta_secondary_beacon_flag = {
9627 static const true_false_string hta_lsig_txop_protection_flag = {
9632 static const true_false_string hta_pco_active_flag = {
9633 "PCO is activated in the BSS",
9634 "PCO is not activated in the BSS"
9637 static const true_false_string hta_pco_phase_flag = {
9638 "Switch to 20MHz phase/keep 20MHz",
9639 "Switch to 40MHz phase/keep 40MHz"
9642 static const value_string ht_info_secondary_channel_offset_flags[] = {
9643 {0x00, "No secondary channel"},
9644 {0x01, "Secondary channel is above the primary channel"},
9646 {0x03, "Secondary channel is below the primary channel"},
9650 static const true_false_string ht_info_channel_width_flag = {
9651 "Channel of any width supported",
9652 "20 MHz channel width only"
9655 static const true_false_string ht_info_rifs_mode_flag = {
9660 static const true_false_string ht_info_psmp_stas_only_flag = {
9661 "Association requests are accepted from only PSMP capable STA",
9662 "Association requests are accepted regardless of PSMP capability"
9665 static const value_string ht_info_service_interval_granularity_flags[] = {
9677 static const value_string ht_info_operating_mode_flags[] = {
9678 {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"},
9679 {0x01, "HT non-member protection mode"},
9680 {0x02, "Only HT STAs in the BSS, however, there exists at least one 20 MHz STA"},
9681 {0x03, "HT mixed mode"},
9685 static const true_false_string ht_info_non_greenfield_sta_present_flag = {
9686 "One or more associated STAs are not greenfield capable",
9687 "All associated STAs are greenfield capable"
9690 static const true_false_string ht_info_transmit_burst_limit_flag = {
9691 "2.4 GHz - 6.16 ms | All other bands - 3.08 ms",
9695 static const true_false_string ht_info_obss_non_ht_stas_present_flag = {
9696 "Use of protection for non-HT STAs by overlapping BSSs is needed",
9697 "Use of protection for non-HT STAs by overlapping BSSs is not needed"
9700 static const true_false_string ht_info_dual_beacon_flag = {
9701 "AP transmits a secondary beacon",
9702 "No second beacon is transmitted"
9705 static const true_false_string ht_info_dual_cts_protection_flag = {
9710 static const true_false_string ht_info_secondary_beacon_flag = {
9715 static const true_false_string ht_info_lsig_txop_protection_full_support_flag = {
9716 "All HT STAs in the BSS support L-SIG TXOP protection",
9717 "One or more HT STAs in the BSS do not support L-SIG TXOP protection"
9720 /* XXX - We might want to use tfs_active_inactive here */
9721 static const true_false_string ht_info_pco_active_flag = {
9726 static const true_false_string ht_info_pco_phase_flag = {
9727 "Switch to or continue 40 MHz phase",
9728 "Switch to or continue 20 MHz phase"
9731 static const true_false_string htc_lac_trq_flag = {
9732 "Want sounding PPDU",
9733 "Don't want sounding PPDU"
9736 static const true_false_string htc_lac_mai_mrq_flag = {
9737 "MCS feedback requested",
9738 "No MCS feedback requested"
9741 static const value_string hf_htc_lac_asel_command_flags[] = {
9742 {0x00, "Transmit Antenna Selection Sounding Indication (TXASSI)"},
9743 {0x01, "Transmit Antenna Selection Sounding Request (TXASSR)"},
9744 {0x02, "Receive Antenna Selection Sounding Indication (RXASSI)"},
9745 {0x03, "Receive Antenna Selection Sounding Request (RXASSR)"},
9746 {0x04, "Sounding Label"},
9747 {0x05, "No feedback, ASEL training failure"},
9748 {0x06, "Transmit Antenna Selection Sounding Indication (TXASSI) requesting feedback of explicit CSI"},
9753 static const value_string hf_htc_cal_pos_flags[] = {
9754 {0x00, "Not a calibration frame"},
9755 {0x01, "Calibration Start"},
9756 {0x02, "Sounding Response"},
9757 {0x03, "Sounding Complete"},
9761 static const true_false_string hf_htc_ndp_announcement_flag = {
9763 "No NDP will follow"
9766 static const value_string hf_htc_csi_steering_flags[] = {
9767 {0x00, "No feedback required"},
9769 {0x02, "Non-compressed Beamforming Feedback Matrix"},
9770 {0x03, "Compressed Beamforming Feedback Matrix"},
9774 static const value_string hf_tag_secondary_channel_offset_flags[] = {
9775 {0x00, "No Secondary Channel"},
9776 {0x01, "Above Primary Channel"},
9778 {0x03, "Below Primary Channel"},
9782 static const true_false_string hf_tag_measure_enable_flag = {
9787 static const true_false_string hf_tag_measure_acc_not_acc = {
9792 static const value_string hf_tag_measure_request_type_flags[] = {
9793 {0x00, "Basic Request"},
9794 {0x01, "Clear Channel Assessment (CCA) Request"},
9795 {0x02, "Receive Power Indication (RPI) Histogram Request"},
9796 {0x03, "Channel Load Request"},
9797 {0x04, "Noise Histogram Request"},
9798 {0x05, "Beacon Request"},
9799 {0x06, "Frame Request"},
9800 {0x07, "STA Statistics Request"},
9801 {0x08, "Location Configuration Indication (LCI) Request"},
9802 {0x09, "Transmit Stream Measurement Request"},
9803 {0x0A, "Measurement Pause Request"},
9807 static const value_string hf_tag_measure_report_type_flags[] = {
9808 {0x00, "Basic Report"},
9809 {0x01, "Clear Channel Assessment (CCA) Report"},
9810 {0x02, "Receive Power Indication (RPI) Histogram Report"},
9811 {0x03, "Channel Load Report"},
9812 {0x04, "Noise Histogram Report"},
9813 {0x05, "Beacon Report"},
9814 {0x06, "Frame Report"},
9815 {0x07, "STA Statistics Report"},
9816 {0x08, "Location Configuration Information (LCI) Report"},
9817 {0x09, "Transmit Stream Measurement Report"},
9821 static const true_false_string hf_tag_measure_report_frame_info_frame_type_flag = {
9822 "Measurement Pilot Frame",
9823 "Beacon/Probe Response Frame"
9826 static const true_false_string hf_tag_measure_map_field_bss_flag = {
9827 "At least one MPDU was received by another BSS or IBSS in the measurement period.",
9828 "No MPDUs were received from another BSS or IBSS in the measurement period."
9831 static const true_false_string hf_tag_measure_detected_not_detected = {
9836 static const true_false_string hf_tag_measure_true_false = {
9841 static const value_string hf_tag_measure_request_measurement_mode_flags[] = {
9844 {0x02, "Beacon Table"},
9848 static const value_string hf_tag_measure_request_reporting_condition_flags[] = {
9849 {0x00, "Report to be issued after each measurement."},
9850 {0x01, "The measured RCPI level is greater than an absolute threshold."},
9851 {0x02, "The measured RCPI level is less than an absolute threshold."},
9852 {0x03, "The measured RSNI level is greater than an absolute threshold."},
9853 {0x04, "The measured RSNI level is less than an absolute threshold."},
9854 {0x05, "The measured RCPI level is greater than a threshold defined by an offset from the serving AP's reference RCPI."},
9855 {0x06, "The measured RCPI level is less than a threshold defined by an offset from the serving AP's reference RCPI."},
9856 {0x07, "The measured RSNI level is greater than a threshold defined by an offset from the serving AP's reference RSNI."},
9857 {0x08, "The measured RSNI level is less than a threshold defined by an offset from the serving AP's reference RSNI."},
9858 {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."},
9859 {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."},
9860 {0xfe, "Report not required to be issued"},
9864 static const value_string hf_tag_measure_request_group_id_flags[] = {
9865 {0x00, "STA Counters from dot11CountersTable"},
9866 {0x01, "STA Counters from dot11MacStatistics group"},
9867 {0x02, "QoS STA Counters for UP0 from dot11QosCountersTable"},
9868 {0x03, "QoS STA Counters for UP1 from dot11QosCountersTable"},
9869 {0x04, "QoS STA Counters for UP2 from dot11QosCountersTable"},
9870 {0x05, "QoS STA Counters for UP3 from dot11QosCountersTable"},
9871 {0x06, "QoS STA Counters for UP4 from dot11QosCountersTable"},
9872 {0x07, "QoS STA Counters for UP5 from dot11QosCountersTable"},
9873 {0x08, "QoS STA Counters for UP6 from dot11QosCountersTable"},
9874 {0x09, "QoS STA Counters for UP7 from dot11QosCountersTable"},
9875 {0x0a, "BSS Average Access Delays"},
9876 {0x0b, "STA Counters from dot11A-MSDU Group"},
9877 {0x0c, "STA Counters from dot11A-MPDU Group"},
9878 {0x0d, "STA Counters from dot11 BAR, Channel Width, PSMP Group"},
9879 {0x0e, "STA Counters from dot11Protection Group"},
9880 {0x0f, "STBC Group"},
9884 static const true_false_string hf_tag_extended_capabilities_flag = {
9889 /*** Begin: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
9890 static const value_string hf_tag_ext_channel_switch_announcement_switch_mode_flags[] = {
9891 {0x00, "Frames may be transmitted before the channel switch has been completed"},
9892 {0x01, "No more frames are to be transmitted until the channel switch has been completed"},
9895 /*** End: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
9897 static hf_register_info ff[] = {
9900 {"Timestamp", "wlan_mgt.fixed.timestamp", FT_STRING, BASE_NONE,
9901 NULL, 0, "Timestamp", HFILL }},
9904 {"Authentication Algorithm", "wlan_mgt.fixed.auth.alg",
9905 FT_UINT16, BASE_DEC, VALS (&auth_alg), 0, "Authentication Algorithm", HFILL }},
9907 {&ff_beacon_interval,
9908 {"Beacon Interval", "wlan_mgt.fixed.beacon", FT_DOUBLE, BASE_DEC, NULL, 0,
9909 "Beacon Interval", HFILL }},
9911 {&hf_fixed_parameters,
9912 {"Fixed parameters", "wlan_mgt.fixed.all", FT_UINT16, BASE_DEC, NULL, 0,
9913 "Fixed parameters", HFILL }},
9915 {&hf_tagged_parameters,
9916 {"Tagged parameters", "wlan_mgt.tagged.all", FT_UINT16, BASE_DEC, NULL, 0,
9917 "Tagged parameters", HFILL }},
9920 {"SSID", "wlan_mgt.ssid", FT_STRING, BASE_DEC, NULL, 0,
9923 /*** Begin: Block Ack Params Fixed Field - Dustin Johnson ***/
9924 {&ff_block_ack_params,
9925 {"Block Ack Parameters", "wlan_mgt.fixed.baparams",
9926 FT_UINT16, BASE_HEX, NULL, 0, "Block Ack Parameters", HFILL }},
9928 {&ff_block_ack_params_amsdu_permitted,
9929 {"A-MSDUs", "wlan_mgt.fixed.baparams.amsdu",
9930 FT_BOOLEAN, 16, TFS (&ff_block_ack_params_amsdu_permitted_flag), 0x0001, "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
9932 {&ff_block_ack_params_policy,
9933 {"Block Ack Policy", "wlan_mgt.fixed.baparams.policy",
9934 FT_BOOLEAN, 16, TFS (&ff_block_ack_params_policy_flag), 0x0002, "Block Ack Policy", HFILL }},
9936 {&ff_block_ack_params_tid,
9937 {"Traffic Identifier", "wlan_mgt.fixed.baparams.tid",
9938 FT_UINT8, BASE_HEX, NULL, 0x003C, "Traffic Identifier", HFILL }},
9940 {&ff_block_ack_params_buffer_size,
9941 {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan_mgt.fixed.baparams.buffersize",
9942 FT_UINT16, BASE_DEC, NULL, 0xFFC0, "Number of Buffers", HFILL }},
9943 /*** End: Block Ack Params Fixed Field - Dustin Johnson ***/
9945 /*** Begin: Block Ack Timeout Fixed Field - Dustin Johnson ***/
9946 {&ff_block_ack_timeout,
9947 {"Block Ack Timeout", "wlan_mgt.fixed.batimeout",
9948 FT_UINT16, BASE_HEX, NULL, 0, "Block Ack Timeout", HFILL }},
9949 /*** End: Block Ack Timeout Fixed Field - Dustin Johnson ***/
9951 /*** Begin: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
9953 {"Block Ack Starting Sequence Control (SSC)", "wlan_mgt.fixed.ssc",
9954 FT_UINT16, BASE_HEX, 0, 0, "Block Ack Starting Sequence Control (SSC)", HFILL }},
9956 {&ff_block_ack_ssc_fragment,
9957 {"Fragment", "wlan_mgt.fixed.fragment",
9958 FT_UINT16, BASE_DEC, 0, 0x000f, "Fragment", HFILL }},
9960 {&ff_block_ack_ssc_sequence,
9961 {"Starting Sequence Number", "wlan_mgt.fixed.sequence",
9962 FT_UINT16, BASE_DEC, 0, 0xfff0, "Starting Sequence Number", HFILL }},
9963 /*** End: Block Ack Starting Sequence Control Fixed Field - Dustin Johnson ***/
9965 /*** Begin: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
9967 {"Delete Block Ack (DELBA) Parameter Set", "wlan_mgt.fixed.delba.param",
9968 FT_UINT16, BASE_HEX, 0, 0, "Delete Block Ack (DELBA) Parameter Set", HFILL }},
9970 {&ff_delba_param_reserved,
9971 {"Reserved", "wlan_mgt.fixed.delba.param.reserved",
9972 FT_UINT16, BASE_HEX, 0, 0x07ff, "Reserved", HFILL }},
9974 {&ff_delba_param_init,
9975 {"Initiator", "wlan_mgt.fixed.delba.param.initiator",
9976 FT_BOOLEAN, 16, 0, 0x08000, "Initiator", HFILL }},
9978 {&ff_delba_param_tid,
9979 {"TID", "wlan_mgt.fixed.delba.param.tid",
9980 FT_UINT16, BASE_HEX, 0, 0xf000, "Traffic Identifier (TID)", HFILL }},
9981 /*** End: DELBA Parameter Set Fixed Field - Dustin Johnson ***/
9983 /*** Begin: Max Regulation Power Fixed Field - Dustin Johnson ***/
9985 {"Maximum Regulation Power", "wlan_mgt.fixed.maxregpwr",
9986 FT_UINT16, BASE_HEX, 0, 0, "Maximum Regulation Power", HFILL }},
9987 /*** End: Max Regulation Power Fixed Field - Dustin Johnson ***/
9989 /*** Begin: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
9990 {&ff_measurement_pilot_int,
9991 {"Measurement Pilot Interval", "wlan_mgt.fixed.msmtpilotint",
9992 FT_UINT16, BASE_HEX, 0, 0, "Measurement Pilot Interval Fixed Field", HFILL }},
9993 /*** End: Measurement Pilot Interval Fixed Field - Dustin Johnson ***/
9995 /*** Begin: Country String Fixed Field - Dustin Johnson ***/
9997 {"Country String", "wlan_mgt.fixed.country",
9998 FT_STRING, BASE_NONE, 0, 0, "Country String", HFILL }},
9999 /*** End: Country String Fixed Field - Dustin Johnson ***/
10001 /*** Begin: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
10003 {"Maximum Transmit Power", "wlan_mgt.fixed.maxtxpwr",
10004 FT_UINT8, BASE_HEX, 0, 0, "Maximum Transmit Power", HFILL }},
10005 /*** End: Maximum Transmit Power Fixed Field - Dustin Johnson ***/
10007 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
10009 {"Transmit Power Used", "wlan_mgt.fixed.txpwr",
10010 FT_UINT8, BASE_HEX, 0, 0, "Transmit Power Used", HFILL }},
10011 /*** End: Transmit Power Used Fixed Field - Dustin Johnson ***/
10013 /*** Begin: Transmit Power Used Fixed Field - Dustin Johnson ***/
10014 {&ff_transceiver_noise_floor,
10015 {"Transceiver Noise Floor", "wlan_mgt.fixed.tnoisefloor",
10016 FT_UINT8, BASE_HEX, 0, 0, "Transceiver Noise Floor", HFILL }},
10017 /*** End: Transceiver Noise Floor Fixed Field - Dustin Johnson ***/
10019 /*** Begin: Channel Width Fixed Field - Dustin Johnson ***/
10020 {&ff_channel_width,
10021 {"Supported Channel Width", "wlan_mgt.fixed.chanwidth",
10022 FT_UINT8, BASE_HEX, VALS (ff_channel_width_vals), 0, "Supported Channel Width", HFILL }},
10023 /*** End: Channel Width Fixed Field - Dustin Johnson ***/
10025 /*** Begin: QoS Inforamtion AP Fixed Field - Dustin Johnson ***/
10027 {"QoS Inforamtion (AP)", "wlan_mgt.fixed.qosinfo.ap",
10028 FT_UINT8, BASE_HEX, NULL, 0, "QoS Inforamtion (AP)", HFILL }},
10030 {&ff_qos_info_ap_edca_param_set_counter,
10031 {"EDCA Parameter Set Update Count", "wlan_mgt.fixed.qosinfo.ap.edcaupdate",
10032 FT_UINT8, BASE_HEX, NULL, 0x0F, "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
10034 {&ff_qos_info_ap_q_ack,
10035 {"Q-Ack", "wlan_mgt.fixed.qosinfo.ap.qack",
10036 FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_q_ack_flag), 0x10, "QoS Ack", HFILL }},
10038 {&ff_qos_info_ap_queue_req,
10039 {"Queue Request", "wlan_mgt.fixed.qosinfo.ap",
10040 FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_queue_req_flag), 0x20, "Queue Request", HFILL }},
10042 {&ff_qos_info_ap_txop_request,
10043 {"TXOP Request", "wlan_mgt.fixed.qosinfo.ap.txopreq",
10044 FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_txop_request_flag), 0x40, "Transmit Opportunity (TXOP) Request", HFILL }},
10046 {&ff_qos_info_ap_reserved,
10047 {"Reserved", "wlan_mgt.fixed.qosinfo.ap.reserved",
10048 FT_BOOLEAN, 8, NULL, 0x80, "Reserved", HFILL }},
10049 /*** End: QoS Inforamtion AP Fixed Field - Dustin Johnson ***/
10051 /*** Begin: QoS Inforamtion STA Fixed Field - Dustin Johnson ***/
10053 {"QoS Inforamtion (STA)", "wlan_mgt.fixed.qosinfo.sta",
10054 FT_UINT8, BASE_HEX, NULL, 0, "QoS Inforamtion (STA)", HFILL }},
10056 {&ff_qos_info_sta_ac_vo,
10057 {"AC_VO", "wlan_mgt.fixed.qosinfo.sta.ac.vo",
10058 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x01, "AC_VO", HFILL }},
10060 {&ff_qos_info_sta_ac_vi,
10061 {"AC_VI", "wlan_mgt.fixed.qosinfo.sta.ac.vi",
10062 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x02, "AC_VI", HFILL }},
10064 {&ff_qos_info_sta_ac_bk,
10065 {"AC_BK", "wlan_mgt.fixed.qosinfo.sta.ac.bk",
10066 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x04, "AC_BK", HFILL }},
10068 {&ff_qos_info_sta_ac_be,
10069 {"AC_BE", "wlan_mgt.fixed.qosinfo.sta.ac.be",
10070 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x08, "AC_BE", HFILL }},
10072 {&ff_qos_info_sta_q_ack,
10073 {"Q-Ack", "wlan_mgt.fixed.qosinfo.sta.qack",
10074 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_q_ack_flag), 0x10, "QoS Ack", HFILL }},
10076 {&ff_qos_info_sta_max_sp_len,
10077 {"Service Period (SP) Length", "wlan_mgt.fixed.qosinfo.sta.splen",
10078 FT_UINT8, BASE_HEX, VALS (&ff_qos_info_sta_max_sp_len_flags) , 0x60, "Service Period (SP) Length", HFILL }},
10080 {&ff_qos_info_sta_more_data_ack,
10081 {"More Data Ack", "wlan_mgt.fixed.qosinfo.sta.moredataack",
10082 FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_more_data_ack_flag), 0x80, "More Data Ack", HFILL }},
10083 /*** End: QoS Inforamtion STA Fixed Field - Dustin Johnson ***/
10085 /*** Begin: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
10087 {"Spatial Multiplexing (SM) Power Control", "wlan_mgt.fixed.sm.powercontrol",
10088 FT_UINT8, BASE_HEX, NULL, 0, "Spatial Multiplexing (SM) Power Control", HFILL }},
10090 {&ff_sm_pwr_save_enabled,
10091 {"SM Power Save", "wlan_mgt.fixed.sm.powercontrol.enabled",
10092 FT_BOOLEAN, 8, TFS (&ff_sm_pwr_save_enabled_flag), 0x01, "Spatial Multiplexing (SM) Power Save", HFILL }},
10094 {&ff_sm_pwr_save_sm_mode,
10095 {"SM Mode", "wlan_mgt.fixed.sm.powercontrol.mode",
10096 FT_BOOLEAN, 8, TFS (&ff_sm_pwr_save_sm_mode_flag), 0x02, "Spatial Multiplexing (SM) Mode", HFILL }},
10098 {&ff_sm_pwr_save_reserved,
10099 {"Reserved", "wlan_mgt.fixed.sm.powercontrol.reserved",
10100 FT_UINT8, BASE_HEX, NULL, 0xFC, "Reserved", HFILL }},
10101 /*** End: Spatial Multiplexing (SM) Power Control - Dustin Johnson ***/
10103 /*** Begin: PCO Phase Control Fixed Field - Dustin Johnson ***/
10104 {&ff_pco_phase_cntrl,
10105 {"Phased Coexistence Operation (PCO) Phase Control", "wlan_mgt.fixed.pco.phasecntrl",
10106 FT_BOOLEAN, 0, TFS (&ff_pco_phase_cntrl_flag), 0, "Phased Coexistence Operation (PCO) Phase Control", HFILL }},
10107 /*** End: PCO Phase Control Fixed Field - Dustin Johnson ***/
10109 /*** Begin: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
10110 {&ff_psmp_param_set,
10111 {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan_mgt.fixed.psmp.paramset",
10112 FT_UINT16, BASE_HEX, 0, 0, "Power Save Multi-Poll (PSMP) Parameter Set", HFILL }},
10114 {&ff_psmp_param_set_n_sta,
10115 {"Number of STA Info Fields Present", "wlan_mgt.fixed.psmp.paramset.nsta",
10116 FT_UINT8, BASE_HEX, 0, 0, "Number of STA Info Fields Present", HFILL }},
10118 {&ff_psmp_param_set_more_psmp,
10119 {"More PSMP", "wlan_mgt.fixed.psmp.paramset.more",
10120 FT_BOOLEAN, 0, TFS(&ff_psmp_param_set_more_psmp_flag), 0, "More Power Save Multi-Poll (PSMP)", HFILL }},
10122 {&ff_psmp_param_set_psmp_sequence_duration,
10123 {"PSMP Sequence Duration", "wlan_mgt.fixed.psmp.paramset.seqduration",
10124 FT_UINT16, BASE_DEC, 0, 0, "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
10125 /*** End: PSMP Parameter Set Fixed Field - Dustin Johnson ***/
10127 /*** Begin: MIMO Control Fixed Field - Dustin Johnson ***/
10128 {&ff_mimo_cntrl_nc_index,
10129 {"Nc Index", "wlan_mgt.fixed.mimo.control.ncindex",
10130 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_nc_index_flags), 0x0003, "Number of Columns Less One", HFILL }},
10132 {&ff_mimo_cntrl_nr_index,
10133 {"Nr Index", "wlan_mgt.fixed.mimo.control.nrindex",
10134 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_nr_index_flags), 0x000C, "Number of Rows Less One", HFILL }},
10136 {&ff_mimo_cntrl_channel_width,
10137 {"Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
10138 FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010, "Channel Width", HFILL }},
10140 {&ff_mimo_cntrl_grouping,
10141 {"Grouping (Ng)", "wlan_mgt.fixed.mimo.control.grouping",
10142 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_grouping_flags), 0x0060, "Grouping (Ng)", HFILL }},
10144 {&ff_mimo_cntrl_coefficient_size,
10145 {"Coefficient Size (Nb)", "wlan_mgt.fixed.mimo.control.cosize",
10146 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_coefficient_size_flags), 0x0180, "Coefficient Size (Nb)", HFILL }},
10148 {&ff_mimo_cntrl_codebook_info,
10149 {"Codebook Information", "wlan_mgt.fixed.mimo.control.codebookinfo",
10150 FT_UINT16, BASE_HEX, VALS (&ff_mimo_cntrl_codebook_info_flags), 0x0600, "Codebook Information", HFILL }},
10152 {&ff_mimo_cntrl_remaining_matrix_segment,
10153 {"Remaining Matrix Segment", "wlan_mgt.fixed.mimo.control.matrixseg",
10154 FT_UINT16, BASE_HEX, 0, 0x3800, "Remaining Matrix Segment", HFILL }},
10156 {&ff_mimo_cntrl_reserved,
10157 {"Reserved", "wlan_mgt.fixed.mimo.control.reserved",
10158 FT_UINT16, BASE_HEX, 0, 0xC000, "Reserved", HFILL }},
10160 {&ff_mimo_cntrl_sounding_timestamp,
10161 {"Sounding Timestamp", "wlan_mgt.fixed.mimo.control.soundingtime",
10162 FT_UINT32, BASE_HEX, 0, 0, "Sounding Timestamp", HFILL }},
10163 /*** End: MIMO Control Fixed Field - Dustin Johnson ***/
10165 /*** Begin: PSMP Station Information Fixed Field - Dustin Johnson ***/
10166 {&ff_psmp_sta_info,
10167 {"Power Save Multi-Poll (PSMP) Station Information", "wlan_mgt.fixed.psmp.stainfo",
10168 FT_UINT8, BASE_HEX, VALS (&ff_psmp_sta_info_flags), 0, "Power Save Multi-Poll (PSMP) Station Information", HFILL }},
10170 {&ff_psmp_sta_info_dtt_start_offset,
10171 {"DTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.dttstart",
10172 FT_UINT16, BASE_HEX, 0, 0, "DTT Start Offset", HFILL }},
10174 {&ff_psmp_sta_info_dtt_duration,
10175 {"DTT Duration", "wlan_mgt.fixed.psmp.stainfo.dttduration",
10176 FT_UINT8, BASE_HEX, 0, 0, "DTT Duration", HFILL }},
10178 {&ff_psmp_sta_info_sta_id,
10179 {"Target Station ID", "wlan_mgt.fixed.psmp.stainfo.staid",
10180 FT_UINT16, BASE_HEX, 0, 0, "Target Station ID", HFILL }},
10182 {&ff_psmp_sta_info_utt_start_offset,
10183 {"UTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.uttstart",
10184 FT_UINT16, BASE_HEX, 0, 0, "UTT Start Offset", HFILL }},
10186 {&ff_psmp_sta_info_utt_duration,
10187 {"UTT Duration", "wlan_mgt.fixed.psmp.stainfo.uttduration",
10188 FT_UINT16, BASE_HEX, 0, 0, "UTT Duration", HFILL }},
10190 {&ff_psmp_sta_info_reserved_small,
10191 {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
10192 FT_UINT16, BASE_HEX, 0, 0, "Reserved", HFILL }},
10194 {&ff_psmp_sta_info_reserved_large,
10195 {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
10196 FT_UINT64, BASE_HEX, 0, 0, "Reserved", HFILL }},
10198 {&ff_psmp_sta_info_psmp_multicast_id,
10199 {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan_mgt.fixed.psmp.stainfo.multicastid",
10200 FT_UINT64, BASE_HEX, 0, 0, "Power Save Multi-Poll (PSMP) Multicast ID", HFILL }},
10201 /*** End: PSMP Station Information Fixed Field - Dustin Johnson ***/
10203 /*** Begin: Antenna Selection Fixed Field - Dustin Johnson ***/
10204 {&ff_ant_selection,
10205 {"Antenna Selection", "wlan_mgt.fixed.antsel",
10206 FT_UINT8, BASE_HEX, 0, 0, "Antenna Selection", HFILL }},
10208 {&ff_ant_selection_0,
10209 {"Antenna 0", "wlan_mgt.fixed.antsel.ant0",
10210 FT_UINT8, BASE_HEX, 0, 0x01, "Antenna 0", HFILL }},
10212 {&ff_ant_selection_1,
10213 {"Antenna 1", "wlan_mgt.fixed.antsel.ant1",
10214 FT_UINT8, BASE_HEX, 0, 0x02, "Antenna 1", HFILL }},
10216 {&ff_ant_selection_2,
10217 {"Antenna 2", "wlan_mgt.fixed.antsel.ant2",
10218 FT_UINT8, BASE_HEX, 0, 0x04, "Antenna 2", HFILL }},
10220 {&ff_ant_selection_3,
10221 {"Antenna 3", "wlan_mgt.fixed.antsel.ant3",
10222 FT_UINT8, BASE_HEX, 0, 0x08, "Antenna 3", HFILL }},
10224 {&ff_ant_selection_4,
10225 {"Antenna 4", "wlan_mgt.fixed.antsel.ant4",
10226 FT_UINT8, BASE_HEX, 0, 0x10, "Antenna 4", HFILL }},
10228 {&ff_ant_selection_5,
10229 {"Antenna 5", "wlan_mgt.fixed.antsel.ant5",
10230 FT_UINT8, BASE_HEX, 0, 0x20, "Antenna 5", HFILL }},
10232 {&ff_ant_selection_6,
10233 {"Antenna 6", "wlan_mgt.fixed.antsel.ant6",
10234 FT_UINT8, BASE_HEX, 0, 0x40, "Antenna 6", HFILL }},
10236 {&ff_ant_selection_7,
10237 {"Antenna 7", "wlan_mgt.fixed.antsel.ant7",
10238 FT_UINT8, BASE_HEX, 0, 0x80, "Antenna 7", HFILL }},
10239 /*** End: Antenna Selection Fixed Field - Dustin Johnson ***/
10241 /*** Begin: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
10242 {&ff_ext_channel_switch_announcement,
10243 {"Extended Channel Switch Announcement", "wlan_mgt.fixed.extchansw",
10244 FT_UINT32, BASE_HEX, 0, 0, "", HFILL }},
10245 /*** End: Extended Channel Switch Announcement Fixed Field - Dustin Johnson ***/
10247 /*** Begin: HT Information Fixed Field - Dustin Johnson ***/
10249 {"HT Information", "wlan_mgt.fixed.extchansw",
10250 FT_UINT8, BASE_HEX, 0, 0, "HT Information Fixed Field", HFILL }},
10252 {&ff_ht_info_information_request,
10253 {"Information Request", "wlan_mgt.fixed.mimo.control.chanwidth",
10254 FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01, "Information Request", HFILL }},
10256 {&ff_ht_info_40_mhz_intolerant,
10257 {"40 MHz Intolerant", "wlan_mgt.fixed.mimo.control.chanwidth",
10258 FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02, "40 MHz Intolerant", HFILL }},
10260 {&ff_ht_info_sta_chan_width,
10261 {"Station Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
10262 FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04, "Station Channel Width", HFILL }},
10264 {&ff_ht_info_reserved,
10265 {"Reserved", "wlan_mgt.fixed.extchansw",
10266 FT_UINT8, BASE_HEX, 0, 0xF8, "Reserved Field", HFILL }},
10267 /*** End: HT Information Fixed Field - Dustin Johnson ***/
10269 /*** Begin: HT Action Fixed Field - Dustin Johnson ***/
10271 {"HT Action", "wlan_mgt.fixed.htact",
10272 FT_UINT8, BASE_HEX, VALS (&ff_ht_action_flags), 0, "HT Action Code", HFILL }},
10273 /*** End: HT Action Fixed Field - Dustin Johnson ***/
10275 /*** Begin: MIMO CSI Matrices Report - Dustin Johnson ***/
10277 {"Signal to Noise Ratio (SNR)", "wlan_mgt.mimo.csimatrices.snr",
10278 FT_UINT8, BASE_HEX, NULL, 0, "Signal to Noise Ratio (SNR)", HFILL }},
10279 /*** End: MIMO CSI Matrices Report - Dustin Johnson ***/
10282 {"Capabilities", "wlan_mgt.fixed.capabilities", FT_UINT16, BASE_HEX, NULL, 0,
10283 "Capability information", HFILL }},
10286 {"ESS capabilities", "wlan_mgt.fixed.capabilities.ess",
10287 FT_BOOLEAN, 16, TFS (&cf_ess_flags), 0x0001, "ESS capabilities", HFILL }},
10290 {"IBSS status", "wlan_mgt.fixed.capabilities.ibss",
10291 FT_BOOLEAN, 16, TFS (&cf_ibss_flags), 0x0002, "IBSS participation", HFILL }},
10294 {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.sta",
10295 FT_UINT16, BASE_HEX, VALS (&sta_cf_pollable), 0x020C,
10296 "CF-Poll capabilities for a STA", HFILL }},
10299 {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.ap",
10300 FT_UINT16, BASE_HEX, VALS (&ap_cf_pollable), 0x020C,
10301 "CF-Poll capabilities for an AP", HFILL }},
10304 {"Privacy", "wlan_mgt.fixed.capabilities.privacy",
10305 FT_BOOLEAN, 16, TFS (&cf_privacy_flags), 0x0010, "WEP support", HFILL }},
10308 {"Short Preamble", "wlan_mgt.fixed.capabilities.preamble",
10309 FT_BOOLEAN, 16, TFS (&cf_preamble_flags), 0x0020, "Short Preamble", HFILL }},
10312 {"PBCC", "wlan_mgt.fixed.capabilities.pbcc",
10313 FT_BOOLEAN, 16, TFS (&cf_pbcc_flags), 0x0040, "PBCC Modulation", HFILL }},
10316 {"Channel Agility", "wlan_mgt.fixed.capabilities.agility",
10317 FT_BOOLEAN, 16, TFS (&cf_agility_flags), 0x0080, "Channel Agility", HFILL }},
10320 {"Spectrum Management", "wlan_mgt.fixed.capabilities.spec_man",
10321 FT_BOOLEAN, 16, TFS (&cf_spec_man_flags), 0x0100, "Spectrum Management", HFILL }},
10323 {&ff_short_slot_time,
10324 {"Short Slot Time", "wlan_mgt.fixed.capabilities.short_slot_time",
10325 FT_BOOLEAN, 16, TFS (&short_slot_time_flags), 0x0400, "Short Slot Time",
10329 {"Automatic Power Save Delivery", "wlan_mgt.fixed.capabilities.apsd",
10330 FT_BOOLEAN, 16, TFS (&cf_apsd_flags), 0x0800, "Automatic Power Save Delivery", HFILL }},
10333 {"DSSS-OFDM", "wlan_mgt.fixed.capabilities.dsss_ofdm",
10334 FT_BOOLEAN, 16, TFS (&dsss_ofdm_flags), 0x2000, "DSSS-OFDM Modulation",
10337 {&ff_cf_del_blk_ack,
10338 {"Delayed Block Ack", "wlan_mgt.fixed.capabilities.del_blk_ack",
10339 FT_BOOLEAN, 16, TFS (&cf_del_blk_ack_flags), 0x4000, "Delayed Block Ack", HFILL }},
10341 {&ff_cf_imm_blk_ack,
10342 {"Immediate Block Ack", "wlan_mgt.fixed.capabilities.imm_blk_ack",
10343 FT_BOOLEAN, 16, TFS (&cf_imm_blk_ack_flags), 0x8000, "Immediate Block Ack", HFILL }},
10346 {"Authentication SEQ", "wlan_mgt.fixed.auth_seq",
10347 FT_UINT16, BASE_HEX, NULL, 0, "Authentication Sequence Number", HFILL }},
10350 {"Association ID", "wlan_mgt.fixed.aid",
10351 FT_UINT16, BASE_HEX, NULL, 0, "Association ID", HFILL }},
10354 {"Listen Interval", "wlan_mgt.fixed.listen_ival",
10355 FT_UINT16, BASE_HEX, NULL, 0, "Listen Interval", HFILL }},
10358 {"Current AP", "wlan_mgt.fixed.current_ap",
10359 FT_ETHER, BASE_NONE, NULL, 0, "MAC address of current AP", HFILL }},
10362 {"Reason code", "wlan_mgt.fixed.reason_code",
10363 FT_UINT16, BASE_HEX, VALS (&reason_codes), 0,
10364 "Reason for unsolicited notification", HFILL }},
10367 {"Status code", "wlan_mgt.fixed.status_code",
10368 FT_UINT16, BASE_HEX, VALS (&status_codes), 0,
10369 "Status of requested event", HFILL }},
10371 {&ff_category_code,
10372 {"Category code", "wlan_mgt.fixed.category_code",
10373 FT_UINT16, BASE_DEC, VALS (&category_codes), 0,
10374 "Management action category", HFILL }},
10377 {"Action code", "wlan_mgt.fixed.action_code",
10378 FT_UINT16, BASE_DEC, VALS (&action_codes), 0,
10379 "Management action code", HFILL }},
10382 {"Dialog token", "wlan_mgt.fixed.dialog_token",
10383 FT_UINT8, BASE_HEX, NULL, 0, "Management action dialog token", HFILL }},
10385 {&ff_marvell_action_type,
10386 {"Marvell Action type", "wlan_mgt.fixed.mrvl_action_type",
10387 FT_UINT8, BASE_DEC, VALS (&vendor_action_types_mrvl), 0,
10388 "Vendor Specific Action Type (Marvell)", HFILL }},
10390 {&ff_marvell_mesh_mgt_action_code,
10391 {"Mesh action(Marvell)", "wlan_mgt.fixed.mrvl_mesh_action",
10392 FT_UINT8, BASE_HEX, VALS (&mesh_mgt_action_codes_mrvl), 0,
10393 "Mesh action code(Marvell)", HFILL }},
10395 {&ff_mesh_mgt_length,
10396 {"Message Length", "wlan_mgt.fixed.length",
10397 FT_UINT8, BASE_DEC, NULL, 0, "Message Length", HFILL }},
10399 {&ff_mesh_mgt_mode,
10400 {"Message Mode", "wlan_mgt.fixed.mode",
10401 FT_UINT8, BASE_HEX, NULL, 0, "Message Mode", HFILL }},
10404 {"Message TTL", "wlan_mgt.fixed.ttl",
10405 FT_UINT8, BASE_DEC, NULL, 0, "Message TTL", HFILL }},
10407 {&ff_mesh_mgt_dstcount,
10408 {"Destination Count", "wlan_mgt.fixed.dstcount",
10409 FT_UINT8, BASE_DEC, NULL, 0, "Destination Count", HFILL }},
10411 {&ff_mesh_mgt_hopcount,
10412 {"Hop Count", "wlan_mgt.fixed.hopcount",
10413 FT_UINT8, BASE_DEC, NULL, 0, "Hop Count", HFILL }},
10415 {&ff_mesh_mgt_rreqid,
10416 {"RREQ ID", "wlan_mgt.fixed.rreqid",
10417 FT_UINT32, BASE_DEC, NULL, 0, "RREQ ID", HFILL }},
10420 {"Source Address", "wlan_mgt.fixed.sa",
10421 FT_ETHER, BASE_NONE, NULL, 0, "Source MAC address", HFILL }},
10424 {"SSN", "wlan_mgt.fixed.ssn",
10425 FT_UINT32, BASE_DEC, NULL, 0, "Source Sequence Number", HFILL }},
10427 {&ff_mesh_mgt_metric,
10428 {"Metric", "wlan_mgt.fixed.metric",
10429 FT_UINT32, BASE_DEC, NULL, 0, "Route Metric", HFILL }},
10431 {&ff_mesh_mgt_flags,
10432 {"RREQ Flags", "wlan_mgt.fixed.hopcount",
10433 FT_UINT8, BASE_HEX, NULL, 0, "RREQ Flags", HFILL }},
10436 {"Destination Address", "wlan_mgt.fixed.da",
10437 FT_ETHER, BASE_NONE, NULL, 0, "Destination MAC address", HFILL }},
10440 {"DSN", "wlan_mgt.fixed.dsn",
10441 FT_UINT32, BASE_DEC, NULL, 0, "Destination Sequence Number", HFILL }},
10443 {&ff_mesh_mgt_lifetime,
10444 {"Lifetime", "wlan_mgt.fixed.lifetime",
10445 FT_UINT32, BASE_DEC, NULL, 0, "Route Lifetime", HFILL }},
10447 {&ff_wme_action_code,
10448 {"Action code", "wlan_mgt.fixed.action_code",
10449 FT_UINT16, BASE_HEX, VALS (&wme_action_codes), 0,
10450 "Management notification action code", HFILL }},
10452 {&ff_wme_status_code,
10453 {"Status code", "wlan_mgt.fixed.status_code",
10454 FT_UINT16, BASE_HEX, VALS (&wme_status_codes), 0,
10455 "Management notification setup response status code", HFILL }},
10457 {&ff_qos_action_code,
10458 {"Action code", "wlan_mgt.fixed.action_code",
10459 FT_UINT16, BASE_HEX, VALS (&qos_action_codes), 0,
10460 "QoS management action code", HFILL }},
10462 /*** Begin: Block Ack Action Fixed Field - Dustin Johnson ***/
10464 {"Action code", "wlan_mgt.fixed.action_code",
10465 FT_UINT8, BASE_HEX, VALS (&ba_action_codes), 0,
10466 "Block Ack action code", HFILL }},
10467 /*** End: Block Ack Action Fixed Field - Dustin Johnson ***/
10469 {&ff_dls_action_code,
10470 {"Action code", "wlan_mgt.fixed.action_code",
10471 FT_UINT16, BASE_HEX, VALS (&dls_action_codes), 0,
10472 "DLS management action code", HFILL }},
10475 {"Destination address", "wlan_mgt.fixed.dst_mac_addr",
10476 FT_ETHER, BASE_NONE, NULL, 0, "Destination MAC address", HFILL }},
10479 {"Source address", "wlan_mgt.fixed.src_mac_addr",
10480 FT_ETHER, BASE_NONE, NULL, 0, "Source MAC address", HFILL }},
10483 {"DLS timeout", "wlan_mgt.fixed.dls_timeout",
10484 FT_UINT16, BASE_HEX, NULL, 0, "DLS timeout value", HFILL }},
10487 {"Tag", "wlan_mgt.tag.number",
10488 FT_UINT8, BASE_DEC, VALS(tag_num_vals), 0,
10489 "Element ID", HFILL }},
10492 {"Tag length", "wlan_mgt.tag.length",
10493 FT_UINT32, BASE_DEC, NULL, 0, "Length of tag", HFILL }},
10495 {&tag_interpretation,
10496 {"Tag interpretation", "wlan_mgt.tag.interpretation",
10497 FT_STRING, BASE_NONE, NULL, 0, "Interpretation of tag", HFILL }},
10500 {"OUI", "wlan_mgt.tag.oui",
10501 FT_BYTES, BASE_NONE, NULL, 0, "OUI of vendor specific IE", HFILL }},
10504 {"TIM length", "wlan_mgt.tim.length",
10505 FT_UINT8, BASE_DEC, NULL, 0,
10506 "Traffic Indication Map length", HFILL }},
10509 {"DTIM count", "wlan_mgt.tim.dtim_count",
10510 FT_UINT8, BASE_DEC, NULL, 0,
10511 "DTIM count", HFILL }},
10514 {"DTIM period", "wlan_mgt.tim.dtim_period",
10515 FT_UINT8, BASE_DEC, NULL, 0,
10516 "DTIM period", HFILL }},
10519 {"Bitmap control", "wlan_mgt.tim.bmapctl",
10520 FT_UINT8, BASE_HEX, NULL, 0,
10521 "Bitmap control", HFILL }},
10524 {"RSN Capabilities", "wlan_mgt.rsn.capabilities", FT_UINT16, BASE_HEX,
10525 NULL, 0, "RSN Capability information", HFILL }},
10528 {"RSN Pre-Auth capabilities", "wlan_mgt.rsn.capabilities.preauth",
10529 FT_BOOLEAN, 16, TFS (&rsn_preauth_flags), 0x0001,
10530 "RSN Pre-Auth capabilities", HFILL }},
10532 {&rsn_cap_no_pairwise,
10533 {"RSN No Pairwise capabilities", "wlan_mgt.rsn.capabilities.no_pairwise",
10534 FT_BOOLEAN, 16, TFS (&rsn_no_pairwise_flags), 0x0002,
10535 "RSN No Pairwise capabilities", HFILL }},
10537 {&rsn_cap_ptksa_replay_counter,
10538 {"RSN PTKSA Replay Counter capabilities",
10539 "wlan_mgt.rsn.capabilities.ptksa_replay_counter",
10540 FT_UINT16, BASE_HEX, VALS (&rsn_cap_replay_counter), 0x000C,
10541 "RSN PTKSA Replay Counter capabilities", HFILL }},
10543 {&rsn_cap_gtksa_replay_counter,
10544 {"RSN GTKSA Replay Counter capabilities",
10545 "wlan_mgt.rsn.capabilities.gtksa_replay_counter",
10546 FT_UINT16, BASE_HEX, VALS (&rsn_cap_replay_counter), 0x0030,
10547 "RSN GTKSA Replay Counter capabilities", HFILL }},
10550 {"HT Capabilities Info", "wlan_mgt.ht.capabilities", FT_UINT16, BASE_HEX,
10551 NULL, 0, "HT Capability information", HFILL }},
10554 {"HT Capabilities Info (VS)", "wlan_mgt.vs.ht.capabilities", FT_UINT16, BASE_HEX,
10555 NULL, 0, "Vendor Specific HT Capability information", HFILL }},
10558 {"HT LDPC coding capability", "wlan_mgt.ht.capabilities.ldpccoding",
10559 FT_BOOLEAN, 16, TFS (&ht_ldpc_coding_flag), 0x0001,
10560 "HT LDPC coding capability", HFILL }},
10563 {"HT Support channel width", "wlan_mgt.ht.capabilities.width",
10564 FT_BOOLEAN, 16, TFS (&ht_chan_width_flag), 0x0002,
10565 "HT Support channel width", HFILL }},
10568 {"HT SM Power Save", "wlan_mgt.ht.capabilities.sm",
10569 FT_UINT16, BASE_HEX, VALS (&ht_sm_pwsave_flag), 0x000c,
10570 "HT SM Power Save", HFILL }},
10573 {"HT Green Field", "wlan_mgt.ht.capabilities.green",
10574 FT_BOOLEAN, 16, TFS (&ht_green_flag), 0x0010,
10575 "HT Green Field", HFILL }},
10578 {"HT Short GI for 20MHz", "wlan_mgt.ht.capabilities.short20",
10579 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0020,
10580 "HT Short GI for 20MHz", HFILL }},
10583 {"HT Short GI for 40MHz", "wlan_mgt.ht.capabilities.short40",
10584 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0040,
10585 "HT Short GI for 40MHz", HFILL }},
10588 {"HT Tx STBC", "wlan_mgt.ht.capabilities.txstbc",
10589 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0080,
10590 "HT Tx STBC", HFILL }},
10593 {"HT Rx STBC", "wlan_mgt.ht.capabilities.rxstbc",
10594 FT_UINT16, BASE_HEX, VALS (&ht_rx_stbc_flag), 0x0300,
10595 "HT Tx STBC", HFILL }},
10597 {&ht_delayed_block_ack,
10598 {"HT Delayed Block ACK", "wlan_mgt.ht.capabilities.delayedblockack",
10599 FT_BOOLEAN, 16, TFS (&ht_delayed_block_ack_flag), 0x0400,
10600 "HT Delayed Block ACK", HFILL }},
10603 {"HT Max A-MSDU length", "wlan_mgt.ht.capabilities.amsdu",
10604 FT_BOOLEAN, 16, TFS (&ht_max_amsdu_flag), 0x0800,
10605 "HT Max A-MSDU length", HFILL }},
10608 {"HT DSSS/CCK mode in 40MHz", "wlan_mgt.ht.capabilities.dsscck",
10609 FT_BOOLEAN, 16, TFS (&ht_dss_cck_40_flag), 0x1000,
10610 "HT DSS/CCK mode in 40MHz", HFILL }},
10613 {"HT PSMP Support", "wlan_mgt.ht.capabilities.psmp",
10614 FT_BOOLEAN, 16, TFS (&ht_psmp_flag), 0x2000,
10615 "HT PSMP Support", HFILL }},
10617 {&ht_40_mhz_intolerant,
10618 {"HT Forty MHz Intolerant", "wlan_mgt.ht.capabilities.40mhzintolerant",
10619 FT_BOOLEAN, 16, TFS (&ht_40_mhz_intolerant_flag), 0x4000,
10620 "HT Forty MHz Intolerant", HFILL }},
10623 {"HT L-SIG TXOP Protection support", "wlan_mgt.ht.capabilities.lsig",
10624 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x8000,
10625 "HT L-SIG TXOP Protection support", HFILL }},
10628 {"A-MPDU Parameters", "wlan_mgt.ht.ampduparam", FT_UINT16, BASE_HEX,
10629 NULL, 0, "A-MPDU Parameters", HFILL }},
10632 {"A-MPDU Parameters (VS)", "wlan_mgt.vs.ht.ampduparam", FT_UINT16, BASE_HEX,
10633 NULL, 0, "Vendor Specific A-MPDU Parameters", HFILL }},
10636 {"Maximum Rx A-MPDU Length", "wlan_mgt.ht.ampduparam.maxlength",
10637 FT_UINT8, BASE_HEX, 0 , 0x03,
10638 "Maximum Rx A-MPDU Length", HFILL }},
10640 {&duparam_mpdu_start_spacing,
10641 {"MPDU Density", "wlan_mgt.ht.ampduparam.mpdudensity",
10642 FT_UINT8, BASE_HEX, VALS (&duparam_mpdu_start_spacing_flags) , 0x1c,
10643 "MPDU Density", HFILL }},
10645 {&duparam_reserved,
10646 {"Reserved", "wlan_mgt.ht.ampduparam.reserved",
10647 FT_UINT8, BASE_HEX, NULL, 0xE0,
10648 "Reserved", HFILL }},
10651 {"Rx Supported Modulation and Coding Scheme Set", "wlan_mgt.ht.mcsset",
10652 FT_STRING, BASE_NONE, NULL, 0, "Rx Supported Modulation and Coding Scheme Set", HFILL }},
10655 {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan_mgt.vs.ht.mcsset",
10656 FT_STRING, BASE_NONE, NULL, 0, "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
10658 {&mcsset_rx_bitmask_0to7,
10659 {"Rx Bitmask Bits 0-7", "wlan_mgt.ht.mcsset.rxbitmask.0to7",
10660 FT_UINT32, BASE_HEX, 0, 0x000000ff, "Rx Bitmask Bits 0-7", HFILL }},
10662 {&mcsset_rx_bitmask_8to15,
10663 {"Rx Bitmask Bits 8-15", "wlan_mgt.ht.mcsset.rxbitmask.8to15",
10664 FT_UINT32, BASE_HEX, 0, 0x0000ff00, "Rx Bitmask Bits 8-15", HFILL }},
10666 {&mcsset_rx_bitmask_16to23,
10667 {"Rx Bitmask Bits 16-23", "wlan_mgt.ht.mcsset.rxbitmask.16to23",
10668 FT_UINT32, BASE_HEX, 0, 0x00ff0000, "Rx Bitmask Bits 16-23", HFILL }},
10670 {&mcsset_rx_bitmask_24to31,
10671 {"Rx Bitmask Bits 24-31", "wlan_mgt.ht.mcsset.rxbitmask.24to31",
10672 FT_UINT32, BASE_HEX, 0, 0xff000000, "Rx Bitmask Bits 24-31", HFILL }},
10674 {&mcsset_rx_bitmask_32,
10675 {"Rx Bitmask Bit 32", "wlan_mgt.ht.mcsset.rxbitmask.32",
10676 FT_UINT32, BASE_HEX, 0, 0x000001, "Rx Bitmask Bit 32", HFILL }},
10678 {&mcsset_rx_bitmask_33to38,
10679 {"Rx Bitmask Bits 33-38", "wlan_mgt.ht.mcsset.rxbitmask.33to38",
10680 FT_UINT32, BASE_HEX, 0, 0x00007e, "Rx Bitmask Bits 33-38", HFILL }},
10682 {&mcsset_rx_bitmask_39to52,
10683 {"Rx Bitmask Bits 39-52", "wlan_mgt.ht.mcsset.rxbitmask.39to52",
10684 FT_UINT32, BASE_HEX, 0, 0x1fff80, "Rx Bitmask Bits 39-52", HFILL }},
10686 {&mcsset_rx_bitmask_53to76,
10687 {"Rx Bitmask Bits 53-76", "wlan_mgt.ht.mcsset.rxbitmask.53to76",
10688 FT_UINT32, BASE_HEX, 0, 0x1fffffe0, "Rx Bitmask Bits 53-76", HFILL }},
10690 {&mcsset_highest_data_rate,
10691 {"Highest Supported Data Rate", "wlan_mgt.ht.mcsset.highestdatarate",
10692 FT_UINT16, BASE_HEX, 0, 0x03ff, "Highest Supported Data Rate", HFILL }},
10694 {&mcsset_tx_mcs_set_defined,
10695 {"Tx Supported MCS Set", "wlan_mgt.ht.mcsset.txsetdefined",
10696 FT_BOOLEAN, 16, TFS (&mcsset_tx_mcs_set_defined_flag), 0x0001,
10697 "Tx Supported MCS Set", HFILL }},
10699 {&mcsset_tx_rx_mcs_set_not_equal,
10700 {"Tx and Rx MCS Set", "wlan_mgt.ht.mcsset.txrxmcsnotequal",
10701 FT_BOOLEAN, 16, TFS (&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
10702 "Tx and Rx MCS Set", HFILL }},
10704 {&mcsset_tx_max_spatial_streams,
10705 {"Tx Maximum Number of Spatial Streams Supported", "wlan_mgt.ht.mcsset.txmaxss",
10706 FT_UINT16, BASE_HEX, VALS (&mcsset_tx_max_spatial_streams_flags) , 0x000c,
10707 "Tx Maximum Number of Spatial Streams Supported", HFILL }},
10709 {&mcsset_tx_unequal_modulation,
10710 {"Unequal Modulation", "wlan_mgt.ht.mcsset.txunequalmod",
10711 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0010,
10712 "Unequal Modulation", HFILL }},
10715 {"HT Extended Capabilities", "wlan_mgt.htex.capabilities", FT_UINT16, BASE_HEX,
10716 NULL, 0, "HT Extended Capability information", HFILL }},
10719 {"HT Extended Capabilities (VS)", "wlan_mgt.vs.htex.capabilities", FT_UINT16, BASE_HEX,
10720 NULL, 0, "Vendor Specific HT Extended Capability information", HFILL }},
10723 {"Transmitter supports PCO", "wlan_mgt.htex.capabilities.pco",
10724 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0001,
10725 "Transmitter supports PCO", HFILL }},
10728 {"Time needed to transition between 20MHz and 40MHz", "wlan_mgt.htex.capabilities.transtime",
10729 FT_UINT16, BASE_HEX, VALS (&htex_transtime_flags), 0x0006,
10730 "Time needed to transition between 20MHz and 40MHz", HFILL }},
10733 {"MCS Feedback capability", "wlan_mgt.htex.capabilities.mcs",
10734 FT_UINT16, BASE_HEX, VALS (&htex_mcs_flags), 0x0300,
10735 "MCS Feedback capability", HFILL }},
10737 {&htex_htc_support,
10738 {"High Throughput", "wlan_mgt.htex.capabilities.htc",
10739 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0400,
10740 "High Throughput", HFILL }},
10742 {&htex_rd_responder,
10743 {"Reverse Direction Responder", "wlan_mgt.htex.capabilities.rdresponder",
10744 FT_BOOLEAN, 16, TFS (&ht_tf_flag), 0x0800,
10745 "Reverse Direction Responder", HFILL }},
10748 {"Transmit Beam Forming (TxBF) Capabilities", "wlan_mgt.txbf", FT_UINT16, BASE_HEX,
10749 NULL, 0, "Transmit Beam Forming (TxBF) Capabilities", HFILL }},
10752 {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan_mgt.vs.txbf", FT_UINT16, BASE_HEX,
10753 NULL, 0, "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
10756 {"Transmit Beamforming", "wlan_mgt.txbf.txbf",
10757 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000001,
10758 "Transmit Beamforming", HFILL }},
10761 {"Receive Staggered Sounding", "wlan_mgt.txbf.rxss",
10762 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000002,
10763 "Receive Staggered Sounding", HFILL }},
10766 {"Transmit Staggered Sounding", "wlan_mgt.txbf.txss",
10767 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000004,
10768 "Transmit staggered sounding", HFILL }},
10771 {"Receive Null Data packet (NDP)", "wlan_mgt.txbf.rxndp",
10772 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000008,
10773 "Receive Null Data packet (NDP)", HFILL }},
10776 {"Transmit Null Data packet (NDP)", "wlan_mgt.txbf.txndp",
10777 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000010,
10778 "Transmit Null Data packet (NDP)", HFILL }},
10781 {"Implicit TxBF capable", "wlan_mgt.txbf.impltxbf",
10782 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000020,
10783 "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
10786 {"Calibration", "wlan_mgt.txbf.calibration",
10787 FT_UINT32, BASE_HEX, VALS (&txbf_calib_flag), 0x000000c0,
10788 "Calibration", HFILL }},
10791 {"STA can apply TxBF using CSI explicit feedback", "wlan_mgt.txbf.csi",
10792 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000100,
10793 "Station can apply TxBF using CSI explicit feedback", HFILL }},
10795 {&txbf_expl_uncomp_fm,
10796 {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan_mgt.txbf.fm.uncompressed.tbf",
10797 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000200,
10798 "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
10800 {&txbf_expl_comp_fm,
10801 {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan_mgt.txbf.fm.compressed.tbf",
10802 FT_BOOLEAN, 32, TFS (&ht_tf_flag), 0x00000400,
10803 "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
10805 {&txbf_expl_bf_csi,
10806 {"Receiver can return explicit CSI feedback", "wlan_mgt.txbf.rcsi",
10807 FT_UINT32, BASE_HEX, VALS (&txbf_feedback_flags), 0x00001800,
10808 "Receiver can return explicit CSI feedback", HFILL }},
10810 {&txbf_expl_uncomp_fm_feed,
10811 {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.uncompressed.rbf",
10812 FT_UINT32, BASE_HEX, VALS (&txbf_feedback_flags), 0x00006000,
10813 "Receiver can return explicit uncompressed Beamforming Feedback Matrix", HFILL }},
10815 {&txbf_expl_comp_fm_feed,
10816 {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.compressed.bf",
10817 FT_UINT32, BASE_HEX, VALS (&txbf_feedback_flags), 0x00018000,
10818 "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
10821 {"Minimal grouping used for explicit feedback reports", "wlan_mgt.txbf.mingroup",
10822 FT_UINT32, BASE_HEX, VALS (&txbf_min_group_flags), 0x00060000,
10823 "Minimal grouping used for explicit feedback reports", HFILL }},
10825 {&txbf_csi_num_bf_ant,
10826 {"Max antennae STA can support when CSI feedback required", "wlan_mgt.txbf.csinumant",
10827 FT_UINT32, BASE_HEX, VALS (&txbf_antenna_flags), 0x00180000,
10828 "Max antennae station can support when CSI feedback required", HFILL }},
10830 {&txbf_uncomp_sm_bf_ant,
10831 {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan_mgt.txbf.fm.uncompressed.maxant",
10832 FT_UINT32, BASE_HEX, VALS (&txbf_antenna_flags), 0x00600000,
10833 "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
10835 {&txbf_comp_sm_bf_ant,
10836 {"Max antennae STA can support when compressed Beamforming feedback required", "wlan_mgt.txbf.fm.compressed.maxant",
10837 FT_UINT32, BASE_HEX, VALS (&txbf_antenna_flags), 0x01800000,
10838 "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
10840 {&txbf_csi_max_rows_bf,
10841 {"Maximum number of rows of CSI explicit feeback", "wlan_mgt.txbf.csi.maxrows",
10842 FT_UINT32, BASE_HEX, VALS (&txbf_csi_max_rows_bf_flags), 0x06000000,
10843 "Maximum number of rows of CSI explicit feeback", HFILL }},
10846 {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan_mgt.txbf.channelest",
10847 FT_UINT32, BASE_HEX, VALS (&txbf_chan_est_flags), 0x18000000,
10848 "Maximum number of space time streams for which channel dimensions can be simultaneously estimated", HFILL }},
10851 {"Reserved", "wlan_mgt.txbf.reserved",
10852 FT_UINT32, BASE_HEX, NULL, 0xe0000000,
10853 "Reserved", HFILL }},
10856 {"HT Additional Capabilities", "wlan_mgt.hta.capabilities", FT_UINT16, BASE_HEX,
10857 NULL, 0, "HT Additional Capability information", HFILL }},
10859 {&hta_ext_chan_offset,
10860 {"Extension Channel Offset", "wlan_mgt.hta.capabilities.extchan",
10861 FT_UINT16, BASE_HEX, VALS (&hta_ext_chan_offset_flag), 0x0003,
10862 "Extension Channel Offset", HFILL }},
10864 {&hta_rec_tx_width,
10865 {"Recommended Tx Channel Width", "wlan_mgt.hta.capabilities.rectxwidth",
10866 FT_BOOLEAN, 16, TFS (&hta_rec_tx_width_flag), 0x0004,
10867 "Recommended Transmit Channel Width", HFILL }},
10870 {"Reduced Interframe Spacing (RIFS) Mode", "wlan_mgt.hta.capabilities.rifsmode",
10871 FT_BOOLEAN, 16, TFS (&hta_rifs_mode_flag), 0x0008,
10872 "Reduced Interframe Spacing (RIFS) Mode", HFILL }},
10874 {&hta_controlled_access,
10875 {"Controlled Access Only", "wlan_mgt.hta.capabilities.controlledaccess",
10876 FT_BOOLEAN, 16, TFS (&hta_controlled_access_flag), 0x0010,
10877 "Controlled Access Only", HFILL }},
10879 {&hta_service_interval,
10880 {"Service Interval Granularity", "wlan_mgt.hta.capabilities.serviceinterval",
10881 FT_UINT16, BASE_HEX, VALS (&hta_service_interval_flag), 0x00E0,
10882 "Service Interval Granularity", HFILL }},
10884 {&hta_operating_mode,
10885 {"Operating Mode", "wlan_mgt.hta.capabilities.operatingmode",
10886 FT_UINT16, BASE_HEX, VALS (&hta_operating_mode_flag), 0x0003,
10887 "Operating Mode", HFILL }},
10889 {&hta_non_gf_devices,
10890 {"Non Greenfield (GF) devices Present", "wlan_mgt.hta.capabilities.nongfdevices",
10891 FT_BOOLEAN, 16, TFS (&hta_non_gf_devices_flag), 0x0004,
10892 "on Greenfield (GF) devices Present", HFILL }},
10894 {&hta_basic_stbc_mcs,
10895 {"Basic STB Modulation and Coding Scheme (MCS)", "wlan_mgt.hta.capabilities.",
10896 FT_UINT16, BASE_HEX, NULL , 0x007f,
10897 "Basic STB Modulation and Coding Scheme (MCS)", HFILL }},
10899 {&hta_dual_stbc_protection,
10900 {"Dual Clear To Send (CTS) Protection", "wlan_mgt.hta.capabilities.",
10901 FT_BOOLEAN, 16, TFS (&hta_dual_stbc_protection_flag), 0x0080,
10902 "Dual Clear To Send (CTS) Protection", HFILL }},
10904 {&hta_secondary_beacon,
10905 {"Secondary Beacon", "wlan_mgt.hta.capabilities.",
10906 FT_BOOLEAN, 16, TFS (&hta_secondary_beacon_flag), 0x0100,
10907 "Secondary Beacon", HFILL }},
10909 {&hta_lsig_txop_protection,
10910 {"L-SIG TXOP Protection Support", "wlan_mgt.hta.capabilities.",
10911 FT_BOOLEAN, 16, TFS (&hta_lsig_txop_protection_flag), 0x0200,
10912 "L-SIG TXOP Protection Support", HFILL }},
10915 {"Phased Coexistence Operation (PCO) Active", "wlan_mgt.hta.capabilities.",
10916 FT_BOOLEAN, 16, TFS (&hta_pco_active_flag), 0x0400,
10917 "Phased Coexistence Operation (PCO) Active", HFILL }},
10920 {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.hta.capabilities.",
10921 FT_BOOLEAN, 16, TFS (&hta_pco_phase_flag), 0x0800,
10922 "Phased Coexistence Operation (PCO) Phase", HFILL }},
10925 {"Antenna Selection (ASEL) Capabilities", "wlan_mgt.asel",
10926 FT_UINT8, BASE_HEX, NULL, 0, "Antenna Selection (ASEL) Capabilities", HFILL }},
10929 {"Antenna Selection (ASEL) Capabilities (VS)", "wlan_mgt.vs.asel",
10930 FT_UINT8, BASE_HEX, NULL, 0, "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
10933 {"Antenna Selection Capable", "wlan_mgt.asel.capable",
10934 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x01, "Antenna Selection Capable", HFILL }},
10937 {"Explicit CSI Feedback Based Tx ASEL", "wlan_mgt.asel.txcsi",
10938 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x02, "Explicit CSI Feedback Based Tx ASEL", HFILL }},
10941 {"Antenna Indices Feedback Based Tx ASEL", "wlan_mgt.asel.txif",
10942 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x04, "Antenna Indices Feedback Based Tx ASEL", HFILL }},
10945 {"Explicit CSI Feedback", "wlan_mgt.asel.csi",
10946 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x08, "Explicit CSI Feedback", HFILL }},
10949 {"Antenna Indices Feedback", "wlan_mgt.asel.if",
10950 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x10, "Antenna Indices Feedback", HFILL }},
10953 {"Rx ASEL", "wlan_mgt.asel.rx",
10954 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x20, "Rx ASEL", HFILL }},
10957 {"Tx Sounding PPDUs", "wlan_mgt.asel.sppdu",
10958 FT_BOOLEAN, 8, TFS (&ht_tf_flag), 0x40, "Tx Sounding PPDUs", HFILL }},
10961 {"Reserved", "wlan_mgt.asel.reserved",
10962 FT_UINT8, BASE_HEX, NULL, 0x80, "Reserved", HFILL }},
10964 {&ht_info_delimiter1,
10965 {"HT Information Delimiter #1", "wlan_mgt.ht.info.delim1",
10966 FT_UINT8, BASE_HEX, NULL, 0xff, "HT Information Delimiter #1", HFILL }},
10968 {&ht_info_primary_channel,
10969 {"Primary Channel", "wlan_mgt.ht.info.primarychannel",
10970 FT_UINT8, BASE_DEC, NULL, 0, "Primary Channel", HFILL }},
10972 {&ht_info_secondary_channel_offset,
10973 {"Secondary channel offset", "wlan_mgt.ht.info.secchanoffset",
10974 FT_UINT8, BASE_HEX, VALS (&ht_info_secondary_channel_offset_flags), 0x03, "Secondary channel offset", HFILL }},
10976 {&ht_info_channel_width,
10977 {"Supported channel width", "wlan_mgt.ht.info.chanwidth",
10978 FT_BOOLEAN, 8, TFS (&ht_info_channel_width_flag), 0x04, "Supported channel width", HFILL }},
10980 {&ht_info_rifs_mode,
10981 {"Reduced Interframe Spacing (RIFS)", "wlan_mgt.ht.info.rifs",
10982 FT_BOOLEAN, 8, TFS (&ht_info_rifs_mode_flag), 0x08, "Reduced Interframe Spacing (RIFS)", HFILL }},
10984 {&ht_info_psmp_stas_only,
10985 {"Power Save Multi-Poll (PSMP) stations only", "wlan_mgt.ht.info.psmponly",
10986 FT_BOOLEAN, 8, TFS (&ht_info_psmp_stas_only_flag), 0x10, "Power Save Multi-Poll (PSMP) stations only", HFILL }},
10988 {&ht_info_service_interval_granularity,
10989 {"Shortest service interval", "wlan_mgt.ht.info.",
10990 FT_UINT8, BASE_HEX, VALS (&ht_info_service_interval_granularity_flags), 0xe0, "Shortest service interval", HFILL }},
10992 {&ht_info_delimiter2,
10993 {"HT Information Delimiter #2", "wlan_mgt.ht.info.delim2",
10994 FT_UINT16, BASE_HEX, NULL, 0xffff, "HT Information Delimiter #2", HFILL }},
10996 {&ht_info_operating_mode,
10997 {"Operating mode of BSS", "wlan_mgt.ht.info.operatingmode",
10998 FT_UINT16, BASE_HEX, VALS (&ht_info_operating_mode_flags), 0x0003, "Operating mode of BSS", HFILL }},
11000 {&ht_info_non_greenfield_sta_present,
11001 {"Non-greenfield STAs present", "wlan_mgt.ht.info.greenfield",
11002 FT_BOOLEAN, 16, TFS (&ht_info_non_greenfield_sta_present_flag), 0x0004, "Non-greenfield STAs present", HFILL }},
11004 {&ht_info_transmit_burst_limit,
11005 {"Transmit burst limit", "wlan_mgt.ht.info.burstlim",
11006 FT_BOOLEAN, 16, TFS (&ht_info_transmit_burst_limit_flag), 0x0008, "Transmit burst limit", HFILL }},
11008 {&ht_info_obss_non_ht_stas_present,
11009 {"OBSS non-HT STAs present", "wlan_mgt.ht.info.obssnonht",
11010 FT_BOOLEAN, 16, TFS (&ht_info_obss_non_ht_stas_present_flag), 0x0010, "OBSS non-HT STAs present", HFILL }},
11012 {&ht_info_reserved_1,
11013 {"Reserved", "wlan_mgt.ht.info.reserved1",
11014 FT_UINT16, BASE_HEX, NULL, 0xffe0, "Reserved", HFILL }},
11016 {&ht_info_delimiter3,
11017 {"HT Information Delimiter #3", "wlan_mgt.ht.info.delim3",
11018 FT_UINT16, BASE_HEX, NULL, 0xffff, "HT Information Delimiter #3", HFILL }},
11020 {&ht_info_reserved_2,
11021 {"Reserved", "wlan_mgt.ht.info.reserved2",
11022 FT_UINT16, BASE_HEX, NULL, 0x003f, "Reserved", HFILL }},
11024 {&ht_info_dual_beacon,
11025 {"Dual beacon", "wlan_mgt.ht.info.dualbeacon",
11026 FT_BOOLEAN, 16, TFS (&ht_info_dual_beacon_flag), 0x0040, "Dual beacon", HFILL }},
11028 {&ht_info_dual_cts_protection,
11029 {"Dual Clear To Send (CTS) protection", "wlan_mgt.ht.info.dualcts",
11030 FT_BOOLEAN, 16, TFS (&ht_info_dual_cts_protection_flag), 0x0080, "Dual Clear To Send (CTS) protection", HFILL }},
11032 {&ht_info_secondary_beacon,
11033 {"Beacon ID", "wlan_mgt.ht.info.secondarybeacon",
11034 FT_BOOLEAN, 16, TFS (&ht_info_secondary_beacon_flag), 0x0100, "Beacon ID", HFILL }},
11036 {&ht_info_lsig_txop_protection_full_support,
11037 {"L-SIG TXOP Protection Full Support", "wlan_mgt.ht.info.lsigprotsupport",
11038 FT_BOOLEAN, 16, TFS (&ht_info_lsig_txop_protection_full_support_flag), 0x0200, "L-SIG TXOP Protection Full Support", HFILL }},
11040 {&ht_info_pco_active,
11041 {"Phased Coexistence Operation (PCO)", "wlan_mgt.ht.info.pco.active",
11042 FT_BOOLEAN, 16, TFS (&ht_info_pco_active_flag), 0x0400, "Phased Coexistence Operation (PCO)", HFILL }},
11044 {&ht_info_pco_phase,
11045 {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.ht.info.pco.phase",
11046 FT_BOOLEAN, 16, TFS (&ht_info_pco_phase_flag), 0x0800, "Phased Coexistence Operation (PCO) Phase", HFILL }},
11048 {&ht_info_reserved_3,
11049 {"Reserved", "wlan_mgt.ht.info.reserved3",
11050 FT_UINT16, BASE_HEX, NULL, 0xf000, "Reserved", HFILL }},
11052 {&hf_tag_secondary_channel_offset,
11053 {"Secondary Channel Offset", "wlan_mgt.secchanoffset",
11054 FT_UINT8, BASE_HEX, VALS (&hf_tag_secondary_channel_offset_flags), 0,
11055 "Secondary Channel Offset", HFILL }},
11057 /*** Begin: Power Capability Tag - Dustin Johnson ***/
11058 {&hf_tag_power_capability_min,
11059 {"Minimum Transmit Power", "wlan_mgt.powercap.min",
11060 FT_UINT8, BASE_HEX, NULL, 0, "Minimum Transmit Power", HFILL }},
11062 {&hf_tag_power_capability_max,
11063 {"Maximum Transmit Power", "wlan_mgt.powercap.max",
11064 FT_UINT8, BASE_HEX, NULL, 0, "Maximum Transmit Power", HFILL }},
11065 /*** End: Power Capability Tag - Dustin Johnson ***/
11066 {&hf_tag_tpc_report_trsmt_pow,
11067 {"Transmit Power", "wlan_mgt.tcprep.trsmt_pow",
11068 FT_INT8, BASE_DEC, NULL, 0, "Transmit Power", HFILL }},
11069 {&hf_tag_tpc_report_link_mrg,
11070 {"Link Margin", "wlan_mgt.tcprep.link_mrg",
11071 FT_INT8, BASE_DEC, NULL, 0, "Link Margin", HFILL }},
11072 /*** Begin: Supported Channels Tag - Dustin Johnson ***/
11073 {&hf_tag_supported_channels,
11074 {"Supported Channels Set", "wlan_mgt.supchan",
11075 FT_UINT8, BASE_DEC, NULL, 0, "Supported Channels Set", HFILL }},
11077 {&hf_tag_supported_channels_first,
11078 {"First Supported Channel", "wlan_mgt.supchan.first",
11079 FT_UINT8, BASE_HEX, NULL, 0, "First Supported Channel", HFILL }},
11081 {&hf_tag_supported_channels_range,
11082 {"Supported Channel Range", "wlan_mgt.supchan.range",
11083 FT_UINT8, BASE_HEX, NULL, 0, "Supported Channel Range", HFILL }},
11084 /*** End: Supported Channels Tag - Dustin Johnson ***/
11086 /*** Start: Measurement Request Tag - Dustin Johnson***/
11087 {&hf_tag_measure_request_measurement_token,
11088 {"Measurement Token", "wlan_mgt.measure.req.measuretoken",
11089 FT_UINT8, BASE_HEX, NULL, 0xff, "Measurement Token", HFILL }},
11091 {&hf_tag_measure_request_mode,
11092 {"Measurement Request Mode", "wlan_mgt.measure.req.reqmode",
11093 FT_UINT8, BASE_HEX, NULL, 0xff, "Measurement Request Mode", HFILL }},
11095 {&hf_tag_measure_request_mode_reserved1,
11096 {"Reserved", "wlan_mgt.measure.req.reqmode.reserved1",
11097 FT_UINT8, BASE_HEX, NULL, 0x01, "Reserved", HFILL }},
11099 {&hf_tag_measure_request_mode_enable,
11100 {"Measurement Request Mode Field", "wlan_mgt.measure.req.reqmode.enable",
11101 FT_BOOLEAN, 8, TFS (&hf_tag_measure_enable_flag), 0x02, "Measurement Request Mode Field", HFILL }},
11103 {&hf_tag_measure_request_mode_request,
11104 {"Measurement Reports", "wlan_mgt.measure.req.reqmode.request",
11105 FT_BOOLEAN, 8, TFS (&hf_tag_measure_acc_not_acc), 0x04, "Measurement Reports", HFILL }},
11107 {&hf_tag_measure_request_mode_report,
11108 {"Autonomous Measurement Reports", "wlan_mgt.measure.req.reqmode.report",
11109 FT_BOOLEAN, 8, TFS (&hf_tag_measure_acc_not_acc), 0x08, "Autonomous Measurement Reports", HFILL }},
11111 {&hf_tag_measure_request_mode_reserved2,
11112 {"Reserved", "wlan_mgt.measure.req.reqmode.reserved2",
11113 FT_UINT8, BASE_HEX, NULL, 0xf0, "Reserved", HFILL }},
11115 {&hf_tag_measure_request_type,
11116 {"Measurement Request Type", "wlan_mgt.measure.req.reqtype",
11117 FT_UINT8, BASE_HEX, VALS (&hf_tag_measure_request_type_flags), 0x00, "Measurement Request Type", HFILL }},
11119 {&hf_tag_measure_request_channel_number,
11120 {"Measurement Channel Number", "wlan_mgt.measure.req.channelnumber",
11121 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Channel Number", HFILL }},
11123 {&hf_tag_measure_request_start_time,
11124 {"Measurement Start Time", "wlan_mgt.measure.req.starttime",
11125 FT_UINT64, BASE_HEX, NULL, 0, "Measurement Start Time", HFILL }},
11127 {&hf_tag_measure_request_duration,
11128 {"Measurement Duration", "wlan_mgt.measure.req.channelnumber",
11129 FT_UINT16, BASE_HEX, NULL, 0, "Measurement Duration", HFILL }},
11131 {&hf_tag_measure_request_regulatory_class,
11132 {"Measurement Channel Number", "wlan_mgt.measure.req.regclass",
11133 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Channel Number", HFILL }},
11135 {&hf_tag_measure_request_randomization_interval,
11136 {"Randomization Interval", "wlan_mgt.measure.req.randint",
11137 FT_UINT16, BASE_HEX, NULL, 0, "Randomization Interval", HFILL }},
11139 {&hf_tag_measure_request_measurement_mode,
11140 {"Measurement Mode", "wlan_mgt.measure.req.measurementmode",
11141 FT_UINT8, BASE_HEX, VALS(&hf_tag_measure_request_measurement_mode_flags), 0, "Measurement Mode", HFILL }},
11143 {&hf_tag_measure_request_bssid,
11144 {"BSSID", "wlan_mgt.measure.req.bssid",
11145 FT_ETHER, BASE_NONE, NULL, 0, "BSSID", HFILL }},
11147 {&hf_tag_measure_request_reporting_condition,
11148 {"Reporting Condition", "wlan_mgt.measure.req.repcond",
11149 FT_UINT8, BASE_HEX, VALS(&hf_tag_measure_request_reporting_condition_flags), 0, "Reporting Condition", HFILL }},
11151 {&hf_tag_measure_request_threshold_offset_unsigned,
11152 {"Threshold/Offset", "wlan_mgt.measure.req.threshold",
11153 FT_UINT8, BASE_HEX, 0, 0, "Threshold/Offset", HFILL }},
11155 {&hf_tag_measure_request_threshold_offset_signed,
11156 {"Threshold/Offset", "wlan_mgt.measure.req.threshold",
11157 FT_UINT8, BASE_HEX, 0, 0, "Threshold/Offset", HFILL }},
11159 {&hf_tag_measure_request_report_mac,
11160 {"MAC on wich to gather data", "wlan_mgt.measure.req.reportmac",
11161 FT_ETHER, BASE_NONE, NULL, 0, "MAC on wich to gather data", HFILL }},
11163 {&hf_tag_measure_request_group_id,
11164 {"Group ID", "wlan_mgt.measure.req.groupid",
11165 FT_UINT8, BASE_HEX, VALS(&hf_tag_measure_request_group_id_flags), 0, "Group ID", HFILL }},
11166 /*** End: Measurement Request Tag - Dustin Johnson***/
11168 /*** Start: Measurement Report Tag - Dustin Johnson***/
11169 {&hf_tag_measure_report_measurement_token,
11170 {"Measurement Token", "wlan_mgt.measure.req.clr",
11171 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Token", HFILL }},
11173 {&hf_tag_measure_report_mode,
11174 {"Measurement Report Mode", "wlan_mgt.measure.req.clr",
11175 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Report Mode", HFILL }},
11177 {&hf_tag_measure_report_mode_late,
11178 {"Measurement Report Mode Field", "wlan_mgt.measure.rep.repmode.late",
11179 FT_BOOLEAN, 8, TFS (&hf_tag_measure_enable_flag), 0x01, "Measurement Report Mode Field", HFILL }},
11181 {&hf_tag_measure_report_mode_incapable,
11182 {"Measurement Reports", "wlan_mgt.measure.rep.repmode.incapable",
11183 FT_BOOLEAN, 8, TFS (&hf_tag_measure_acc_not_acc), 0x02, "Measurement Reports", HFILL }},
11185 {&hf_tag_measure_report_mode_refused,
11186 {"Autonomous Measurement Reports", "wlan_mgt.measure.rep.repmode.refused",
11187 FT_BOOLEAN, 8, TFS (&hf_tag_measure_acc_not_acc), 0x04, "Autonomous Measurement Reports", HFILL }},
11189 {&hf_tag_measure_report_mode_reserved,
11190 {"Reserved", "wlan_mgt.measure.rep.repmode.reserved",
11191 FT_UINT8, BASE_HEX, NULL, 0xf8, "Reserved", HFILL }},
11193 {&hf_tag_measure_report_type,
11194 {"Measurement Report Type", "wlan_mgt.measure.rep.reptype",
11195 FT_UINT8, BASE_HEX, VALS (&hf_tag_measure_report_type_flags), 0x00, "Measurement Report Type", HFILL }},
11197 {&hf_tag_measure_report_channel_number,
11198 {"Measurement Channel Number", "wlan_mgt.measure.rep.channelnumber",
11199 FT_UINT8, BASE_HEX, NULL, 0, "Measurement Channel Number", HFILL }},
11201 {&hf_tag_measure_report_start_time,
11202 {"Measurement Start Time", "wlan_mgt.measure.rep.starttime",
11203 FT_UINT64, BASE_HEX, NULL, 0, "Measurement Start Time", HFILL }},
11205 {&hf_tag_measure_report_duration,
11206 {"Measurement Duration", "wlan_mgt.measure.rep.channelnumber",
11207 FT_UINT16, BASE_HEX, NULL, 0, "Measurement Duration", HFILL }},
11209 {&hf_tag_measure_cca_busy_fraction,
11210 {"CCA Busy Fraction", "wlan_mgt.measure.rep.ccabusy",
11211 FT_UINT8, BASE_HEX, NULL, 0, "CCA Busy Fraction", HFILL }},
11213 {&hf_tag_measure_basic_map_field,
11214 {"Map Field", "wlan_mgt.measure.rep.mapfield",
11215 FT_UINT8, BASE_HEX, NULL, 0, "Map Field", HFILL }},
11217 {&hf_tag_measure_map_field_bss,
11218 {"BSS", "wlan_mgt.measure.rep.repmode.mapfield.bss",
11219 FT_BOOLEAN, 8, TFS (&hf_tag_measure_map_field_bss_flag), 0x01, "BSS", HFILL }},
11221 {&hf_tag_measure_map_field_odfm,
11222 {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan_mgt.measure.rep.repmode.mapfield.bss",
11223 FT_BOOLEAN, 8, TFS (&hf_tag_measure_detected_not_detected), 0x02, "Orthogonal Frequency Division Multiplexing (ODFM) Preamble", HFILL }},
11225 {&hf_tag_measure_map_field_unident_signal,
11226 {"Unidentified Signal", "wlan_mgt.measure.rep.repmode.mapfield.unidentsig",
11227 FT_BOOLEAN, 8, TFS (&hf_tag_measure_detected_not_detected), 0x04, "Unidentified Signal", HFILL }},
11229 {&hf_tag_measure_map_field_radar,
11230 {"Radar", "wlan_mgt.measure.rep.repmode.mapfield.radar",
11231 FT_BOOLEAN, 8, TFS (&hf_tag_measure_detected_not_detected), 0x08, "Radar", HFILL }},
11233 {&hf_tag_measure_map_field_unmeasured,
11234 {"Unmeasured", "wlan_mgt.measure.rep.repmode.mapfield.unmeasured",
11235 FT_BOOLEAN, 8, TFS (&hf_tag_measure_true_false), 0x10, "Unmeasured", HFILL }},
11237 {&hf_tag_measure_map_field_reserved,
11238 {"Reserved", "wlan_mgt.measure.rep.repmode.mapfield.reserved",
11239 FT_UINT8, BASE_HEX, NULL, 0xe0, "Reserved", HFILL }},
11241 {&hf_tag_measure_rpi_histogram_report,
11242 {"Receive Power Indicator (RPI) Histogram Report", "wlan_mgt.measure.rep.rpi.histogram_report",
11243 FT_STRING, BASE_NONE, NULL, 0, "Receive Power Indicator (RPI) Histogram Report", HFILL }},
11245 {&hf_tag_measure_rpi_histogram_report_0,
11246 {"RPI 0 Density", "wlan_mgt.measure.rep.rpi.rpi0density",
11247 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 0 Density", HFILL }},
11249 {&hf_tag_measure_rpi_histogram_report_1,
11250 {"RPI 1 Density", "wlan_mgt.measure.rep.rpi.rpi1density",
11251 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 1 Density", HFILL }},
11253 {&hf_tag_measure_rpi_histogram_report_2,
11254 {"RPI 2 Density", "wlan_mgt.measure.rep.rpi.rpi2density",
11255 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 2 Density", HFILL }},
11257 {&hf_tag_measure_rpi_histogram_report_3,
11258 {"RPI 3 Density", "wlan_mgt.measure.rep.rpi.rpi3density",
11259 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 3 Density", HFILL }},
11261 {&hf_tag_measure_rpi_histogram_report_4,
11262 {"RPI 4 Density", "wlan_mgt.measure.rep.rpi.rpi4density",
11263 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 4 Density", HFILL }},
11265 {&hf_tag_measure_rpi_histogram_report_5,
11266 {"RPI 5 Density", "wlan_mgt.measure.rep.rpi.rpi5density",
11267 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 5 Density", HFILL }},
11269 {&hf_tag_measure_rpi_histogram_report_6,
11270 {"RPI 6 Density", "wlan_mgt.measure.rep.rpi.rpi6density",
11271 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 6 Density", HFILL }},
11273 {&hf_tag_measure_rpi_histogram_report_7,
11274 {"RPI 7 Density", "wlan_mgt.measure.rep.rpi.rpi7density",
11275 FT_UINT8, BASE_HEX, NULL, 0, "Receive Power Indicator (RPI) 7 Density", HFILL }},
11277 {&hf_tag_measure_report_regulatory_class,
11278 {"Regulatory Class", "wlan_mgt.measure.rep.regclass",
11279 FT_UINT8, BASE_HEX, NULL, 0, "Regulatory Class", HFILL }},
11281 {&hf_tag_measure_report_channel_load,
11282 {"Channel Load", "wlan_mgt.measure.rep.chanload",
11283 FT_UINT8, BASE_HEX, NULL, 0, "Channel Load", HFILL }},
11285 {&hf_tag_measure_report_frame_info,
11286 {"Reported Frame Information", "wlan_mgt.measure.rep.frameinfo",
11287 FT_UINT8, BASE_HEX, NULL, 0, "Reported Frame Information", HFILL }},
11289 {&hf_tag_measure_report_frame_info_phy_type,
11290 {"Condensed PHY", "wlan_mgt.measure.rep.frameinfo.phytype",
11291 FT_UINT8, BASE_HEX, NULL, 0x7F, "Condensed PHY", HFILL }},
11293 {&hf_tag_measure_report_frame_info_frame_type,
11294 {"Reported Frame Type", "wlan_mgt.measure.rep.frameinfo.frametype",
11295 FT_UINT8, BASE_HEX, TFS(&hf_tag_measure_report_frame_info_frame_type_flag), 0x80, "Reported Frame Type", HFILL }},
11297 {&hf_tag_measure_report_rcpi,
11298 {"Received Channel Power Indicator (RCPI)", "wlan_mgt.measure.rep.rcpi",
11299 FT_UINT8, BASE_HEX, NULL, 0, "Received Channel Power Indicator (RCPI)", HFILL }},
11301 {&hf_tag_measure_report_rsni,
11302 {"Received Signal to Noise Indicator (RSNI)", "wlan_mgt.measure.rep.rsni",
11303 FT_UINT8, BASE_HEX, NULL, 0, "Received Signal to Noise Indicator (RSNI)", HFILL }},
11305 {&hf_tag_measure_report_bssid,
11306 {"BSSID Being Reported", "wlan_mgt.measure.rep.bssid",
11307 FT_ETHER, BASE_NONE, NULL, 0, "BSSID Being Reported", HFILL }},
11309 {&hf_tag_measure_report_ant_id,
11310 {"Antenna ID", "wlan_mgt.measure.rep.antid",
11311 FT_UINT8, BASE_HEX, NULL, 0, "Antenna ID", HFILL }},
11313 {&hf_tag_measure_report_parent_tsf,
11314 {"Parent Timing Synchronization Function (TSF)", "wlan_mgt.measure.rep.parenttsf",
11315 FT_UINT32, BASE_HEX, NULL, 0, "Parent Timing Synchronization Function (TSF)", HFILL }},
11316 /*** End: Measurement Report Tag - Dustin Johnson***/
11318 /*** Begin: Extended Capabilities Tag - Dustin Johnson ***/
11319 /* Table 7-35a
\97Capabilities field */
11320 {&hf_tag_extended_capabilities,
11321 {"Extended Capabilities", "wlan_mgt.extcap",
11322 FT_UINT8, BASE_HEX, NULL, 0, "Extended Capabilities", HFILL }},
11324 /* P802.11n/D6.0 */
11325 {&hf_tag_extended_capabilities_b0,
11326 {"20/40 BSS Coexistence Management Support", "wlan_mgt.extcap.infoexchange.b0",
11327 FT_BOOLEAN, 8, TFS(&hf_tag_extended_capabilities_flag), 0x0001, "HT Information Exchange Support", HFILL }},
11329 /* P802.11p/D4.0 */
11330 {&hf_tag_extended_capabilities_b1,
11331 {"On-demand beacon", "wlan_mgt.extcap.infoexchange.b1",
11332 FT_BOOLEAN, 8, TFS(&hf_tag_extended_capabilities_flag), 0x0002, "On-demand beacon", HFILL }},
11334 {&hf_tag_extended_capabilities_b2,
11335 {"Extended Channel Switching", "wlan_mgt.extcap.infoexchange.b2",
11336 FT_BOOLEAN, 8, TFS(&hf_tag_extended_capabilities_flag), 0x0004, "Extended Channel Switching", HFILL }},
11338 {&hf_tag_extended_capabilities_b3,
11339 {"WAVE indication", "wlan_mgt.extcap.infoexchange.b3",
11340 FT_BOOLEAN, 8, TFS(&hf_tag_extended_capabilities_flag), 0x0008, "WAVE indication", HFILL }},
11341 /*End: P802.11p/D4.0 */
11343 /*** End: Extended Capabilities Tag - Dustin Johnson ***/
11345 /*** Begin: Neighbor Report Tag - Dustin Johnson ***/
11346 {&hf_tag_neighbor_report_bssid,
11347 {"BSSID", "wlan_mgt.nreport.bssid",
11348 FT_ETHER, BASE_NONE, NULL, 0, "BSSID", HFILL }},
11350 {&hf_tag_neighbor_report_bssid_info,
11351 {"BSSID Information", "wlan_mgt.nreport.bssid.info",
11352 FT_UINT32, BASE_HEX, NULL, 0, "BSSID Information", HFILL }},
11354 {&hf_tag_neighbor_report_bssid_info_reachability,
11355 {"AP Reachability", "wlan_mgt.nreport.bssid.info.reachability",
11356 FT_UINT16, BASE_HEX, NULL, 0x0003, "AP Reachability", HFILL }},
11358 {&hf_tag_neighbor_report_bssid_info_security,
11359 {"Security", "wlan_mgt.nreport.bssid.info.security",
11360 FT_UINT16, BASE_HEX, NULL, 0x0004, "Security", HFILL }},
11362 {&hf_tag_neighbor_report_bssid_info_key_scope,
11363 {"Key Scope", "wlan_mgt.nreport.bssid.info.keyscope",
11364 FT_UINT16, BASE_HEX, NULL, 0x0008, "Key Scope", HFILL }},
11366 {&hf_tag_neighbor_report_bssid_info_capability_spec_mng,
11367 {"Capability: Spectrum Management", "wlan_mgt.nreport.bssid.info.capability.specmngt",
11368 FT_UINT16, BASE_HEX, NULL, 0x0010, "Capability: Spectrum Management", HFILL }},
11370 {&hf_tag_neighbor_report_bssid_info_capability_qos,
11371 {"Capability: QoS", "wlan_mgt.nreport.bssid.info.capability.qos",
11372 FT_UINT16, BASE_HEX, NULL, 0x0020, "Capability: QoS", HFILL }},
11374 {&hf_tag_neighbor_report_bssid_info_capability_apsd,
11375 {"Capability: APSD", "wlan_mgt.nreport.bssid.info.capability.apsd",
11376 FT_UINT16, BASE_HEX, NULL, 0x0040, "Capability: APSD", HFILL }},
11378 {&hf_tag_neighbor_report_bssid_info_capability_radio_msnt,
11379 {"Capability: Radio Measurement", "wlan_mgt.nreport.bssid.info.capability.radiomsnt",
11380 FT_UINT16, BASE_HEX, NULL, 0x0080, "Capability: Radio Measurement", HFILL }},
11382 {&hf_tag_neighbor_report_bssid_info_capability_dback,
11383 {"Capability: Delayed Block Ack", "wlan_mgt.nreport.bssid.info.capability.dback",
11384 FT_UINT16, BASE_HEX, NULL, 0x0100, "Capability: Delayed Block Ack", HFILL }},
11386 {&hf_tag_neighbor_report_bssid_info_capability_iback,
11387 {"Capability: Immediate Block Ack", "wlan_mgt.nreport.bssid.info.capability.iback",
11388 FT_UINT16, BASE_HEX, NULL, 0x0200, "Capability: Immediate Block Ack", HFILL }},
11390 {&hf_tag_neighbor_report_bssid_info_mobility_domain,
11391 {"Mobility Domain", "wlan_mgt.nreport.bssid.info.mobilitydomain",
11392 FT_UINT16, BASE_HEX, NULL, 0x0400, "Mobility Domain", HFILL }},
11394 {&hf_tag_neighbor_report_bssid_info_high_throughput,
11395 {"High Throughput", "wlan_mgt.nreport.bssid.info.hthoughput",
11396 FT_UINT16, BASE_HEX, NULL, 0x0800, "High Throughput", HFILL }},
11398 {&hf_tag_neighbor_report_bssid_info_reserved,
11399 {"Reserved", "wlan_mgt.nreport.bssid.info.reserved",
11400 FT_UINT32, BASE_HEX, NULL, 0, "Reserved", HFILL }},
11402 {&hf_tag_neighbor_report_reg_class,
11403 {"Regulatory Class", "wlan_mgt.nreport.regclass",
11404 FT_UINT8, BASE_HEX, NULL, 0, "Regulatory Class", HFILL }},
11406 {&hf_tag_neighbor_report_channel_number,
11407 {"Channel Number", "wlan_mgt.nreport.channumber",
11408 FT_UINT8, BASE_HEX, NULL, 0, "Channel Number", HFILL }},
11410 {&hf_tag_neighbor_report_phy_type,
11411 {"PHY Type", "wlan_mgt.nreport.phytype",
11412 FT_UINT8, BASE_HEX, NULL, 0, "PHY Type", HFILL }},
11413 /*** End: Neighbor Report Tag - Dustin Johnson ***/
11415 /*** Begin: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
11416 {&hf_tag_ext_channel_switch_announcement_switch_mode,
11417 {"Channel Switch Mode", "wlan_mgt.extchanswitch.switchmode",
11418 FT_UINT8, BASE_HEX, VALS (&hf_tag_ext_channel_switch_announcement_switch_mode_flags), 0, "Channel Switch Mode", HFILL }},
11420 {&hf_tag_ext_channel_switch_announcement_new_reg_class,
11421 {"New Regulatory Class", "wlan_mgt.extchanswitch.new.regclass",
11422 FT_UINT8, BASE_HEX, NULL, 0, "New Regulatory Class", HFILL }},
11424 {&hf_tag_ext_channel_switch_announcement_new_chan_number,
11425 {"New Channel Number", "wlan_mgt.extchanswitch.new.channumber",
11426 FT_UINT8, BASE_HEX, NULL, 0, "New Channel Number", HFILL }},
11428 {&hf_tag_ext_channel_switch_announcement_switch_count,
11429 {"Channel Switch Count", "wlan_mgt.extchanswitch.switchcount",
11430 FT_UINT8, BASE_HEX, NULL, 0, "Channel Switch Count", HFILL }},
11431 /*** End: Extended Channel Switch Announcement Tag - Dustin Johnson ***/
11433 /*** Begin: Supported Regulatory Classes Tag - Dustin Johnson ***/
11434 {&hf_tag_supported_reg_classes_current,
11435 {"Current Regulatory Class", "wlan_mgt.supregclass.current",
11436 FT_UINT8, BASE_HEX, NULL, 0, "Current Regulatory Class", HFILL }},
11438 {&hf_tag_supported_reg_classes_alternate,
11439 {"Alternate Regulatory Classes", "wlan_mgt.supregclass.alt",
11440 FT_STRING, BASE_NONE, NULL, 0, "Alternate Regulatory Classes", HFILL }},
11441 /*** End: Supported Regulatory Classes Tag - Dustin Johnson ***/
11443 {&hf_marvell_ie_type,
11444 {"Type", "wlan_mgt.marvell.ie.type",
11445 FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }},
11447 {&hf_marvell_ie_mesh_subtype,
11448 {"Subtype", "wlan_mgt.marvell.ie.subtype",
11449 FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }},
11451 {&hf_marvell_ie_mesh_version,
11452 {"Version", "wlan_mgt.marvell.ie.version",
11453 FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }},
11455 {&hf_marvell_ie_mesh_active_proto_id,
11456 {"Path Selection Protocol", "wlan_mgt.marvell.ie.proto_id",
11457 FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0, "", HFILL }},
11459 {&hf_marvell_ie_mesh_active_metric_id,
11460 {"Path Selection Metric", "wlan_mgt.marvell.ie.metric_id",
11461 FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0, "", HFILL }},
11463 {&hf_marvell_ie_mesh_cap,
11464 {"Mesh Capabilities", "wlan_mgt.marvell.ie.cap",
11465 FT_UINT8, BASE_HEX, NULL, 0, "", HFILL }},
11467 {&hf_marvell_ie_data,
11468 { "Marvell IE data", "wlan_mgt.marvell.data",
11469 FT_BYTES, BASE_NONE, NULL, 0x0, "Marvell IE data", HFILL }},
11471 {&hf_aironet_ie_type,
11472 {"Aironet IE type", "wlan_mgt.aironet.type",
11473 FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0, "Aironet IE type", HFILL }},
11475 {&hf_aironet_ie_version,
11476 {"Aironet IE CCX version?", "wlan_mgt.aironet.version",
11477 FT_UINT8, BASE_DEC, NULL, 0, "Aironet IE CCX version?", HFILL }},
11479 {&hf_aironet_ie_data,
11480 { "Aironet IE data", "wlan_mgt.aironet.data",
11481 FT_BYTES, BASE_NONE, NULL, 0x0, "Aironet IE data", HFILL }},
11484 {"QBSS Version", "wlan_mgt.qbss.version",
11485 FT_UINT8, BASE_DEC, NULL, 0, "QBSS Version", HFILL }},
11488 {"Station Count", "wlan_mgt.qbss.scount",
11489 FT_UINT16, BASE_DEC, NULL, 0, "Station Count", HFILL }},
11492 {"Channel Utilization", "wlan_mgt.qbss.cu",
11493 FT_UINT8, BASE_DEC, NULL, 0, "Channel Utilization", HFILL }},
11496 {"Available Admission Capabilities", "wlan_mgt.qbss.adc",
11497 FT_UINT8, BASE_DEC, NULL, 0, "Available Admission Capabilities", HFILL }},
11500 {"Channel Utilization", "wlan_mgt.qbss2.cu",
11501 FT_UINT8, BASE_DEC, NULL, 0, "Channel Utilization", HFILL }},
11504 {"G.711 CU Quantum", "wlan_mgt.qbss2.glimit",
11505 FT_UINT8, BASE_DEC, NULL, 0, "G.711 CU Quantum", HFILL }},
11508 {"Call Admission Limit", "wlan_mgt.qbss2.cal",
11509 FT_UINT8, BASE_DEC, NULL, 0, "Call Admission Limit", HFILL }},
11512 {"Station Count", "wlan_mgt.qbss2.scount",
11513 FT_UINT16, BASE_DEC, NULL, 0, "Station Count", HFILL }},
11515 {&hf_aironet_ie_qos_unk1,
11516 {"Aironet IE QoS unknown 1", "wlan_mgt.aironet.qos.unk1",
11517 FT_UINT8, BASE_HEX, NULL, 0, "Aironet IE QoS unknown 1", HFILL }},
11519 {&hf_aironet_ie_qos_paramset,
11520 {"Aironet IE QoS paramset", "wlan_mgt.aironet.qos.paramset",
11521 FT_UINT8, BASE_DEC, NULL, 0, "Aironet IE QoS paramset", HFILL }},
11523 {&hf_aironet_ie_qos_val,
11524 {"Aironet IE QoS valueset", "wlan_mgt.aironet.qos.val",
11525 FT_BYTES, BASE_NONE, NULL, 0, "Aironet IE QoS valueset", HFILL }},
11528 {"Traffic Stream (TS) Info", "wlan_mgt.ts_info",
11529 FT_UINT24, BASE_HEX, NULL, 0, "Traffic Stream (TS) Info field", HFILL }},
11532 {"Traffic Type", "wlan_mgt.ts_info.type", FT_UINT8, BASE_DEC,
11533 VALS (&tsinfo_type), 0, "Traffic Stream (TS) Info Traffic Type", HFILL }},
11536 {"Traffic Stream ID (TSID)", "wlan_mgt.ts_info.tsid",
11537 FT_UINT8, BASE_DEC, NULL, 0, "Traffic Stream ID (TSID) Info TSID", HFILL }},
11540 {"Direction", "wlan_mgt.ts_info.dir", FT_UINT8, BASE_DEC,
11541 VALS (&tsinfo_direction), 0, "Traffic Stream (TS) Info Direction", HFILL }},
11543 {&hf_tsinfo_access,
11544 {"Access Policy", "wlan_mgt.ts_info.dir", FT_UINT8, BASE_DEC,
11545 VALS (&tsinfo_access), 0, "Traffic Stream (TS) Info Access Policy", HFILL }},
11548 {"Aggregation", "wlan_mgt.ts_info.agg", FT_UINT8, BASE_DEC,
11549 NULL, 0, "Traffic Stream (TS) Info Access Policy", HFILL }},
11552 {"Automatic Power-Save Delivery (APSD)", "wlan_mgt.ts_info.apsd", FT_UINT8, BASE_DEC,
11553 NULL, 0, "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
11556 {"User Priority", "wlan_mgt.ts_info.up", FT_UINT8, BASE_DEC,
11557 VALS (&qos_up), 0, "Traffic Stream (TS) Info User Priority", HFILL }},
11560 {"Ack Policy", "wlan_mgt.ts_info.ack", FT_UINT8, BASE_DEC,
11561 VALS (&ack_policy), 0, "Traffic Stream (TS) Info Ack Policy", HFILL }},
11564 {"Schedule", "wlan_mgt.ts_info.sched", FT_UINT8, BASE_DEC,
11565 NULL, 0, "Traffic Stream (TS) Info Schedule", HFILL }},
11568 {"Normal MSDU Size", "wlan_mgt.tspec.nor_msdu",
11569 FT_UINT16, BASE_DEC, NULL, 0, "Normal MSDU Size", HFILL }},
11572 {"Maximum MSDU Size", "wlan_mgt.tspec.max_msdu",
11573 FT_UINT16, BASE_DEC, NULL, 0, "Maximum MSDU Size", HFILL }},
11576 {"Minimum Service Interval", "wlan_mgt.tspec.min_srv",
11577 FT_UINT32, BASE_DEC, NULL, 0, "Minimum Service Interval", HFILL }},
11580 {"Maximum Service Interval", "wlan_mgt.tspec.max_srv",
11581 FT_UINT32, BASE_DEC, NULL, 0, "Maximum Service Interval", HFILL }},
11584 {"Inactivity Interval", "wlan_mgt.tspec.inact_int",
11585 FT_UINT32, BASE_DEC, NULL, 0, "Inactivity Interval", HFILL }},
11588 {"Suspension Interval", "wlan_mgt.tspec.susp_int",
11589 FT_UINT32, BASE_DEC, NULL, 0, "Suspension Interval", HFILL }},
11592 {"Service Start Time", "wlan_mgt.tspec.srv_start",
11593 FT_UINT32, BASE_DEC, NULL, 0, "Service Start Time", HFILL }},
11596 {"Minimum Data Rate", "wlan_mgt.tspec.min_data",
11597 FT_UINT32, BASE_DEC, NULL, 0, "Minimum Data Rate", HFILL }},
11600 {"Mean Data Rate", "wlan_mgt.tspec.mean_data",
11601 FT_UINT32, BASE_DEC, NULL, 0, "Mean Data Rate", HFILL }},
11604 {"Peak Data Rate", "wlan_mgt.tspec.peak_data",
11605 FT_UINT32, BASE_DEC, NULL, 0, "Peak Data Rate", HFILL }},
11607 {&tspec_burst_size,
11608 {"Burst Size", "wlan_mgt.tspec.burst_size",
11609 FT_UINT32, BASE_DEC, NULL, 0, "Burst Size", HFILL }},
11611 {&tspec_delay_bound,
11612 {"Delay Bound", "wlan_mgt.tspec.delay_bound",
11613 FT_UINT32, BASE_DEC, NULL, 0, "Delay Bound", HFILL }},
11616 {"Minimum PHY Rate", "wlan_mgt.tspec.min_phy",
11617 FT_UINT32, BASE_DEC, NULL, 0, "Minimum PHY Rate", HFILL }},
11620 {"Surplus Bandwidth Allowance", "wlan_mgt.tspec.surplus",
11621 FT_UINT16, BASE_DEC, NULL, 0, "Surplus Bandwidth Allowance", HFILL }},
11624 {"Medium Time", "wlan_mgt.tspec.medium",
11625 FT_UINT16, BASE_DEC, NULL, 0, "Medium Time", HFILL }},
11628 {"Traffic Stream (TS) Delay", "wlan_mgt.ts_delay",
11629 FT_UINT32, BASE_DEC, NULL, 0, "Traffic Stream (TS) Delay", HFILL }},
11632 {"Classifier Type", "wlan_mgt.tclas.class_type", FT_UINT8, BASE_DEC,
11633 VALS (classifier_type), 0, "Classifier Type", HFILL }},
11636 {"Classifier Mask", "wlan_mgt.tclas.class_mask", FT_UINT8, BASE_HEX,
11637 NULL, 0, "Classifier Mask", HFILL }},
11640 {"Ethernet Type", "wlan_mgt.tclas.params.type", FT_UINT8, BASE_DEC,
11641 NULL, 0, "Classifier Parameters Ethernet Type", HFILL }},
11643 {&hf_tclas_process,
11644 {"Processing", "wlan_mgt.tclas_proc.processing", FT_UINT8, BASE_DEC,
11645 VALS (tclas_process), 0, "TCLAS Processing", HFILL }},
11648 {"Schedule Info", "wlan_mgt.sched.sched_info",
11649 FT_UINT16, BASE_HEX, NULL, 0, "Schedule Info field", HFILL }},
11651 {&hf_sched_srv_start,
11652 {"Service Start Time", "wlan_mgt.sched.srv_start",
11653 FT_UINT32, BASE_HEX, NULL, 0, "Service Start Time", HFILL }},
11655 {&hf_sched_srv_int,
11656 {"Service Interval", "wlan_mgt.sched.srv_int",
11657 FT_UINT32, BASE_HEX, NULL, 0, "Service Interval", HFILL }},
11659 {&hf_sched_spec_int,
11660 {"Specification Interval", "wlan_mgt.sched.spec_int",
11661 FT_UINT16, BASE_HEX, NULL, 0, "Specification Interval", HFILL }},
11664 {"Action", "wlan_mgt.fixed.action",
11665 FT_UINT8, BASE_HEX, NULL, 0, "Action", HFILL }},
11668 {"IP Version", "wlan_mgt.tclas.params.version",
11669 FT_UINT8, BASE_DEC, NULL, 0, "IP Version", HFILL }},
11672 {"IPv4 Src Addr", "wlan_mgt.tclas.params.ipv4_src",
11673 FT_IPv4, BASE_NONE, NULL, 0, "IPv4 Src Addr", HFILL }},
11676 {"IPv4 Dst Addr", "wlan_mgt.tclas.params.ipv4_dst",
11677 FT_IPv4, BASE_NONE, NULL, 0, "IPv4 Dst Addr", HFILL }},
11680 {"Source Port", "wlan_mgt.tclas.params.src_port",
11681 FT_UINT16, BASE_DEC, NULL, 0, "Source Port", HFILL }},
11684 {"Destination Port", "wlan_mgt.tclas.params.dst_port",
11685 FT_UINT16, BASE_DEC, NULL, 0, "Destination Port", HFILL }},
11688 {"IPv4 DSCP", "wlan_mgt.tclas.params.dscp",
11689 FT_UINT8, BASE_HEX, NULL, 0, "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
11692 {"Protocol", "wlan_mgt.tclas.params.protocol",
11693 FT_UINT8, BASE_HEX, NULL, 0, "IPv4 Protocol", HFILL }},
11696 {"IPv6 Src Addr", "wlan_mgt.tclas.params.ipv6_src",
11697 FT_IPv6, BASE_NONE, NULL, 0, "IPv6 Src Addr", HFILL }},
11700 {"IPv6 Dst Addr", "wlan_mgt.tclas.params.ipv6_dst",
11701 FT_IPv6, BASE_NONE, NULL, 0, "IPv6 Dst Addr", HFILL }},
11704 {"Flow Label", "wlan_mgt.tclas.params.flow",
11705 FT_UINT24, BASE_HEX, NULL, 0, "IPv6 Flow Label", HFILL }},
11708 {"802.1Q Tag Type", "wlan_mgt.tclas.params.tag_type",
11709 FT_UINT16, BASE_HEX, NULL, 0, "802.1Q Tag Type", HFILL }},
11712 {"Aruba Type", "wlan_mgt.aruba_type",
11713 FT_UINT16, BASE_DEC, VALS(aruba_mgt_typevals), 0, "Aruba Management", HFILL }},
11716 {"Aruba Heartbeat Sequence", "wlan_mgt.aruba_heartbeat_sequence",
11717 FT_UINT64, BASE_DEC, NULL, 0, "Aruba Heartbeat Sequence", HFILL }},
11720 {"Aruba MTU Size", "wlan_mgt.aruba_mtu_size",
11721 FT_UINT16, BASE_DEC, NULL, 0, "Aruba MTU Size", HFILL }},
11723 /* Start: HT Control (+HTC) */
11725 {"HT Control (+HTC)", "wlan_mgt.htc",
11726 FT_UINT32, BASE_HEX, NULL, 0, "High Throughput Control (+HTC)", HFILL }},
11728 {"Link Adaptation Control (LAC)", "wlan_mgt.htc.lac",
11729 FT_UINT16, BASE_HEX, NULL, 0, "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
11730 {&hf_htc_lac_reserved,
11731 {"Reserved", "wlan_mgt.htc.lac.reserved",
11732 FT_BOOLEAN, 16, NULL, 0x0001, "High Throughput Control Link Adaptation Control Reserved", HFILL }},
11734 {"Training Request (TRQ)", "wlan_mgt.htc.lac.trq",
11735 FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002, "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
11736 {&hf_htc_lac_mai_aseli,
11737 {"Antenna Selection Indication (ASELI)", "wlan_mgt.htc.lac.mai.aseli",
11738 FT_UINT16, BASE_HEX, NULL, 0x003C, "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
11739 {&hf_htc_lac_mai_mrq,
11740 {"MCS Request (MRQ)", "wlan_mgt.htc.lac.mai.mrq",
11741 FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004, "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
11742 {&hf_htc_lac_mai_msi,
11743 {"MCS Request Sequence Identifier (MSI)", "wlan_mgt.htc.lac.mai.msi",
11744 FT_UINT16, BASE_HEX, NULL, 0x0038, "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
11745 {&hf_htc_lac_mai_reserved,
11746 {"Reserved", "wlan_mgt.htc.lac.mai.reserved",
11747 FT_UINT16, BASE_HEX, NULL, 0x0038, "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
11749 {"MCS Feedback Sequence Identifier (MFSI)", "wlan_mgt.htc.lac.mfsi",
11750 FT_UINT16, BASE_DEC, NULL, 0x01C0, "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
11751 {&hf_htc_lac_asel_command,
11752 {"Antenna Selection (ASEL) Command", "wlan_mgt.htc.lac.asel.command",
11753 FT_UINT16, BASE_HEX, VALS (&hf_htc_lac_asel_command_flags), 0x0E00, "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
11754 {&hf_htc_lac_asel_data,
11755 {"Antenna Selection (ASEL) Data", "wlan_mgt.htc.lac.asel.data",
11756 FT_UINT16, BASE_HEX, NULL, 0xF000, "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
11758 {"MCS Feedback (MFB)", "wlan_mgt.htc.lac.mfb",
11759 FT_UINT16, BASE_HEX, NULL, 0xFE00, "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
11761 {"Calibration Position", "wlan_mgt.htc.cal.pos",
11762 FT_UINT16, BASE_DEC, VALS (&hf_htc_cal_pos_flags), 0x0003, "High Throughput Control Calibration Position", HFILL }},
11764 {"Calibration Sequence Identifier", "wlan_mgt.htc.cal.seq",
11765 FT_UINT16, BASE_DEC, NULL, 0x000C, "High Throughput Control Calibration Sequence Identifier", HFILL }},
11766 {&hf_htc_reserved1,
11767 {"Reserved", "wlan_mgt.htc.reserved1",
11768 FT_UINT16, BASE_DEC, NULL, 0x0030, "High Throughput Control Reserved", HFILL }},
11769 {&hf_htc_csi_steering,
11770 {"CSI/Steering", "wlan_mgt.htc.csi_steering",
11771 FT_UINT16, BASE_DEC, VALS (&hf_htc_csi_steering_flags), 0x00C0, "High Throughput Control CSI/Steering", HFILL }},
11772 {&hf_htc_ndp_announcement,
11773 {"NDP Announcement", "wlan_mgt.htc.ndp_announcement",
11774 FT_BOOLEAN, 16, TFS(&hf_htc_ndp_announcement_flag), 0x0100, "High Throughput Control NDP Announcement", HFILL }},
11775 {&hf_htc_reserved2,
11776 {"Reserved", "wlan_mgt.htc.reserved2",
11777 FT_UINT16, BASE_HEX, NULL, 0x3E00, "High Throughput Control Reserved", HFILL }},
11778 {&hf_htc_ac_constraint,
11779 {"AC Constraint", "wlan_mgt.htc.ac_constraint",
11780 FT_BOOLEAN, 16, NULL, 0x4000, "High Throughput Control AC Constraint", HFILL }},
11781 {&hf_htc_rdg_more_ppdu,
11782 {"RDG/More PPDU", "wlan_mgt.htc.rdg_more_ppdu",
11783 FT_BOOLEAN, 16, NULL, 0x8000, "High Throughput Control RDG/More PPDU", HFILL }}
11784 /* End: HT Control (+HTC) */
11787 static hf_register_info aggregate_fields[] = {
11788 {&amsdu_msdu_header_text,
11789 {"MAC Service Data Unit (MSDU)", "wlan_aggregate.msduheader", FT_UINT16,
11790 BASE_DEC, 0, 0x0000, "MAC Service Data Unit (MSDU)", HFILL }}
11793 static gint *tree_array[] = {
11801 &ett_fixed_parameters,
11802 &ett_tagged_parameters,
11803 &ett_qos_parameters,
11804 &ett_qos_ps_buf_state,
11805 &ett_wep_parameters,
11809 &ett_ff_ba_param_tree,
11811 &ett_ff_sm_pwr_save,
11812 &ett_ff_psmp_param_set,
11813 &ett_ff_mimo_cntrl,
11815 &ett_ff_chan_switch_announce,
11817 &ett_ff_psmp_sta_info,
11818 &ett_ff_delba_param_tree,
11819 &ett_ff_ba_ssc_tree,
11821 &ett_cntrl_wrapper_fc,
11822 &ett_cntrl_wrapper_payload,
11823 &ett_ht_info_delimiter1_tree,
11824 &ett_ht_info_delimiter2_tree,
11825 &ett_ht_info_delimiter3_tree,
11826 &ett_msdu_aggregation_parent_tree,
11827 &ett_msdu_aggregation_subframe_tree,
11828 &ett_tag_measure_request_tree,
11830 &ett_tag_supported_channels,
11831 &ett_tag_neighbor_report_bssid_info_tree,
11832 &ett_tag_neighbor_report_bssid_info_capability_tree,
11833 &ett_tag_neighbor_report_sub_tag_tree,
11834 &ett_ampduparam_tree,
11837 &ett_htex_cap_tree,
11840 &ett_hta_cap1_tree,
11841 &ett_hta_cap2_tree,
11851 &ett_chan_noc_tree,
11852 &ett_wave_chnl_tree
11854 module_t *wlan_module;
11856 memset (&wlan_stats, 0, sizeof wlan_stats);
11858 proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
11859 "IEEE 802.11 Aggregate Data", "wlan_aggregate");
11860 proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
11861 proto_wlan = proto_register_protocol ("IEEE 802.11 wireless LAN",
11862 "IEEE 802.11", "wlan");
11863 proto_register_field_array (proto_wlan, hf, array_length (hf));
11864 proto_wlan_mgt = proto_register_protocol ("IEEE 802.11 wireless LAN management frame",
11865 "802.11 MGT", "wlan_mgt");
11866 proto_register_field_array (proto_wlan_mgt, ff, array_length (ff));
11867 proto_register_subtree_array (tree_array, array_length (tree_array));
11869 register_dissector("wlan", dissect_ieee80211, proto_wlan);
11870 register_dissector("wlan_fixed", dissect_ieee80211_fixed, proto_wlan);
11871 register_dissector("wlan_bsfc", dissect_ieee80211_bsfc, proto_wlan);
11872 register_dissector("wlan_datapad", dissect_ieee80211_datapad, proto_wlan);
11873 register_dissector("wlan_ht", dissect_ieee80211_ht, proto_wlan);
11874 register_init_routine(wlan_defragment_init);
11875 register_init_routine(wlan_retransmit_init);
11877 proto_radio = proto_register_protocol("802.11 radio information", "Radio", "radio");
11879 proto_prism = proto_register_protocol("Prism capture header", "Prism", "prism");
11880 proto_register_field_array(proto_prism, hf_prism, array_length(hf_prism));
11882 proto_wlancap = proto_register_protocol("AVS WLAN Capture header",
11883 "AVS WLANCAP", "wlancap");
11884 proto_register_field_array(proto_wlancap, hf_wlancap, array_length(hf_wlancap));
11885 register_dissector("wlancap", dissect_wlancap, proto_wlancap);
11887 wlan_tap = register_tap("wlan");
11889 /* Register configuration options */
11890 wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
11891 prefs_register_bool_preference(wlan_module, "defragment",
11892 "Reassemble fragmented 802.11 datagrams",
11893 "Whether fragmented 802.11 datagrams should be reassembled",
11896 prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
11897 "Ignore vendor-specific HT elements",
11898 "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
11899 &wlan_ignore_draft_ht);
11901 prefs_register_bool_preference(wlan_module, "retransmitted",
11902 "Call subdissector for retransmitted 802.11 frames",
11903 "Whether retransmitted 802.11 frames should be subdissected",
11904 &wlan_subdissector);
11906 prefs_register_bool_preference(wlan_module, "check_fcs",
11907 "Assume packets have FCS",
11908 "Some 802.11 cards include the FCS at the end of a packet, others do not.",
11911 /* Davide Schiera (2006-11-26): changed "WEP bit" in "Protection bit" */
11912 /* (according to the document IEEE Std 802.11i-2004) */
11913 prefs_register_enum_preference(wlan_module, "ignore_wep",
11914 "Ignore the Protection bit",
11915 "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
11916 "and some also leave the IV (initialization vector).",
11917 &wlan_ignore_wep, wlan_ignore_wep_options, TRUE);
11921 prefs_register_obsolete_preference(wlan_module, "wep_keys");
11923 #ifdef HAVE_AIRPDCAP
11924 /* Davide Schiera (2006-11-26): added reference to WPA/WPA2 decryption */
11925 prefs_register_bool_preference(wlan_module, "enable_decryption",
11926 "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
11927 &enable_decryption);
11929 prefs_register_bool_preference(wlan_module, "enable_decryption",
11930 "Enable decryption", "Enable WEP decryption",
11931 &enable_decryption);
11934 #ifdef HAVE_AIRPDCAP
11935 prefs_register_static_text_preference(wlan_module, "info_decryption_key",
11936 "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
11937 "010203040506070809101111213 (104/128-bit WEP),\n"
11938 "wpa-pwd:MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
11939 "wpa-psk:0102030405...6061626364 (WPA + 256-bit key). "
11940 "Invalid keys will be ignored.",
11941 "Valid key formats");
11943 prefs_register_static_text_preference(wlan_module, "info_decryption_key",
11944 "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
11945 "010203040506070809101111213 (104/128-bit WEP)",
11946 "Valid key formats");
11949 for (i = 0; i < MAX_ENCRYPTION_KEYS; i++) {
11950 key_name = g_string_new("");
11951 key_title = g_string_new("");
11952 key_desc = g_string_new("");
11953 wep_keystr[i] = NULL;
11954 /* prefs_register_*_preference() expects unique strings, so
11955 * we build them using g_string_printf and just leave them
11957 #ifdef HAVE_AIRPDCAP
11958 g_string_printf(key_name, "wep_key%d", i + 1);
11959 g_string_printf(key_title, "Key #%d", i + 1);
11960 /* Davide Schiera (2006-11-26): modified keys input tooltip */
11961 g_string_printf(key_desc,
11962 "Key #%d string can be:"
11963 " <wep hexadecimal key>;"
11964 " wep:<wep hexadecimal key>;"
11965 " wpa-pwd:<passphrase>[:<ssid>];"
11966 " wpa-psk:<wpa hexadecimal key>", i + 1);
11968 g_string_printf(key_name, "wep_key%d", i + 1);
11969 g_string_printf(key_title, "WEP key #%d", i + 1);
11970 g_string_printf(key_desc, "WEP key #%d can be:"
11971 " <wep hexadecimal key>;"
11972 " wep:<wep hexadecimal key>", i + 1);
11975 prefs_register_string_preference(wlan_module, key_name->str,
11976 key_title->str, key_desc->str, (const char **) &wep_keystr[i]);
11978 g_string_free(key_name, FALSE);
11979 g_string_free(key_title, FALSE);
11980 g_string_free(key_desc, FALSE);
11986 proto_reg_handoff_ieee80211(void)
11988 dissector_handle_t radio_handle;
11989 dissector_handle_t prism_handle;
11992 * Get handles for the LLC, IPX and Ethernet dissectors.
11994 llc_handle = find_dissector("llc");
11995 ipx_handle = find_dissector("ipx");
11996 eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
11997 data_handle = find_dissector("data");
11999 ieee80211_handle = find_dissector("wlan");
12000 dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
12001 dissector_add("ethertype", ETHERTYPE_CENTRINO_PROMISC, ieee80211_handle);
12003 /* Register handoff to radio-header dissectors */
12004 radio_handle = create_dissector_handle(dissect_radio, proto_radio);
12005 dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11_WITH_RADIO, radio_handle);
12007 prism_handle = create_dissector_handle(dissect_prism, proto_prism);
12008 dissector_add("wtap_encap", WTAP_ENCAP_PRISM_HEADER, prism_handle);
12010 wlancap_handle = create_dissector_handle(dissect_wlancap, proto_wlancap);
12011 dissector_add("wtap_encap", WTAP_ENCAP_IEEE_802_11_WLAN_AVS, wlancap_handle);
12013 /* Register handoff to Aruba GRE */
12014 dissector_add("gre.proto", GRE_ARUBA_8200, ieee80211_handle);
12015 dissector_add("gre.proto", GRE_ARUBA_8210, ieee80211_handle);
12016 dissector_add("gre.proto", GRE_ARUBA_8220, ieee80211_handle);
12017 dissector_add("gre.proto", GRE_ARUBA_8230, ieee80211_handle);
12018 dissector_add("gre.proto", GRE_ARUBA_8240, ieee80211_handle);
12019 dissector_add("gre.proto", GRE_ARUBA_8250, ieee80211_handle);
12020 dissector_add("gre.proto", GRE_ARUBA_8260, ieee80211_handle);
12021 dissector_add("gre.proto", GRE_ARUBA_8270, ieee80211_handle);
12022 dissector_add("gre.proto", GRE_ARUBA_8280, ieee80211_handle);
12023 dissector_add("gre.proto", GRE_ARUBA_8290, ieee80211_handle);
12024 dissector_add("gre.proto", GRE_ARUBA_82A0, ieee80211_handle);
12025 dissector_add("gre.proto", GRE_ARUBA_82B0, ieee80211_handle);
12026 dissector_add("gre.proto", GRE_ARUBA_82C0, ieee80211_handle);
12027 dissector_add("gre.proto", GRE_ARUBA_82D0, ieee80211_handle);
12028 dissector_add("gre.proto", GRE_ARUBA_82E0, ieee80211_handle);
12029 dissector_add("gre.proto", GRE_ARUBA_82F0, ieee80211_handle);
12030 dissector_add("gre.proto", GRE_ARUBA_8300, ieee80211_handle);
12031 dissector_add("gre.proto", GRE_ARUBA_8310, ieee80211_handle);
12032 dissector_add("gre.proto", GRE_ARUBA_8320, ieee80211_handle);
12033 dissector_add("gre.proto", GRE_ARUBA_8330, ieee80211_handle);
12034 dissector_add("gre.proto", GRE_ARUBA_8340, ieee80211_handle);
12035 dissector_add("gre.proto", GRE_ARUBA_8350, ieee80211_handle);
12036 dissector_add("gre.proto", GRE_ARUBA_8360, ieee80211_handle);
12037 dissector_add("gre.proto", GRE_ARUBA_8370, ieee80211_handle);
12040 #ifdef HAVE_AIRPDCAP
12041 /* Davide Schiera (2006-11-26): this function will try to decrypt with WEP or */
12042 /* WPA and return a tvb to the caller to add a new tab. It returns the */
12043 /* algorithm used for decryption (WEP, TKIP, CCMP) and the header and */
12044 /* trailer lengths. */
12046 try_decrypt(tvbuff_t *tvb, guint offset, guint len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer) {
12047 const guint8 *enc_data;
12048 guint8 *tmp = NULL;
12049 tvbuff_t *decr_tvb = NULL;
12050 guint32 dec_caplen;
12051 guchar dec_data[AIRPDCAP_MAX_CAPLEN];
12052 AIRPDCAP_KEY_ITEM used_key;
12054 if (!enable_decryption)
12057 /* get the entire packet */
12058 enc_data = tvb_get_ptr(tvb, 0, len+offset);
12060 /* process packet with AirPDcap */
12061 if (AirPDcapPacketProcess(&airpdcap_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen, &used_key, FALSE, TRUE)==AIRPDCAP_RET_SUCCESS)
12063 *algorithm=used_key.KeyType;
12064 switch (*algorithm) {
12065 case AIRPDCAP_KEY_TYPE_WEP:
12066 *sec_header=AIRPDCAP_WEP_HEADER;
12067 *sec_trailer=AIRPDCAP_WEP_TRAILER;
12069 case AIRPDCAP_KEY_TYPE_CCMP:
12070 *sec_header=AIRPDCAP_RSNA_HEADER;
12071 *sec_trailer=AIRPDCAP_CCMP_TRAILER;
12073 case AIRPDCAP_KEY_TYPE_TKIP:
12074 *sec_header=AIRPDCAP_RSNA_HEADER;
12075 *sec_trailer=AIRPDCAP_TKIP_TRAILER;
12081 /* allocate buffer for decrypted payload */
12082 if ((tmp = g_malloc(dec_caplen-offset)) == NULL)
12083 return NULL; /* krap! */
12084 memcpy(tmp, dec_data+offset, dec_caplen-offset);
12086 len=dec_caplen-offset;
12088 /* decrypt successful, let's set up a new data tvb. */
12089 decr_tvb = tvb_new_real_data(tmp, len, len);
12090 tvb_set_free_cb(decr_tvb, g_free);
12091 tvb_set_child_real_data_tvbuff(tvb, decr_tvb);
12097 /* Davide Schiera ----------------------------------------------------------- */
12100 static tvbuff_t *try_decrypt_wep(tvbuff_t *tvb, guint32 offset, guint32 len) {
12101 const guint8 *enc_data;
12102 guint8 *tmp = NULL;
12104 tvbuff_t *decr_tvb = NULL;
12106 if (! enable_decryption)
12109 enc_data = tvb_get_ptr(tvb, offset, len);
12111 if ((tmp = g_malloc(len)) == NULL)
12112 return NULL; /* krap! */
12114 /* try once with the key index in the packet, then look through our list. */
12115 for (i = 0; i < num_wepkeys; i++) {
12116 /* copy the encrypted data over to the tmp buffer */
12118 printf("trying %d\n", i);
12120 memcpy(tmp, enc_data, len);
12121 if (wep_decrypt(tmp, len, i) == 0) {
12123 /* decrypt successful, let's set up a new data tvb. */
12124 decr_tvb = tvb_new_real_data(tmp, len-8, len-8);
12125 tvb_set_free_cb(decr_tvb, g_free);
12126 tvb_set_child_real_data_tvbuff(tvb, decr_tvb);
12132 if ((!decr_tvb) && (tmp)) g_free(tmp);
12135 printf("de-wep %p\n", decr_tvb);
12143 * Convert a raw WEP key or one prefixed with "wep:" to a byte array.
12144 * Separators are allowed.
12146 /* XXX This is duplicated in epan/airpdcap.c:parse_key_string() */
12148 wep_str_to_bytes(const char *hex_str, GByteArray *bytes) {
12149 char *first_nibble = (char *) hex_str;
12151 if (g_ascii_strncasecmp(hex_str, STRING_KEY_TYPE_WEP ":", 4) == 0) {
12155 return hex_str_to_bytes(first_nibble, bytes, FALSE);
12158 /* Collect our WEP and WPA keys */
12159 #ifdef HAVE_AIRPDCAP
12161 void set_airpdcap_keys(void)
12164 AIRPDCAP_KEY_ITEM key;
12165 PAIRPDCAP_KEYS_COLLECTION keys;
12166 decryption_key_t* dk = NULL;
12167 GByteArray *bytes = NULL;
12169 gchar* tmpk = NULL;
12171 keys=(PAIRPDCAP_KEYS_COLLECTION)g_malloc(sizeof(AIRPDCAP_KEYS_COLLECTION));
12174 for(i = 0; i < MAX_ENCRYPTION_KEYS; i++)
12176 tmpk = g_strdup(wep_keystr[i]);
12178 dk = parse_key_string(tmpk);
12182 if(dk->type == AIRPDCAP_KEY_TYPE_WEP)
12184 key.KeyType = AIRPDCAP_KEY_TYPE_WEP;
12186 bytes = g_byte_array_new();
12187 res = wep_str_to_bytes(dk->key->str, bytes);
12189 if (dk->key->str && res && bytes->len > 0 && bytes->len <= AIRPDCAP_WEP_KEY_MAXLEN)
12192 * WEP key is correct (well, the can be even or odd, so it is not
12193 * a real check, I think... is a check performed somewhere in the
12194 * AirPDcap function??? )
12196 memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
12197 key.KeyData.Wep.WepKeyLen = bytes->len;
12198 keys->Keys[keys->nKeys] = key;
12202 else if(dk->type == AIRPDCAP_KEY_TYPE_WPA_PWD)
12204 key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PWD;
12206 /* XXX - This just lops the end if the key off if it's too long.
12207 * Should we handle this more gracefully? */
12208 g_strlcpy(key.UserPwd.Passphrase, dk->key->str, AIRPDCAP_WPA_PASSPHRASE_MAX_LEN);
12210 key.UserPwd.SsidLen = 0;
12211 if(dk->ssid != NULL && dk->ssid->len <= AIRPDCAP_WPA_SSID_MAX_LEN)
12213 memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
12214 key.UserPwd.SsidLen = dk->ssid->len;
12217 keys->Keys[keys->nKeys] = key;
12220 else if(dk->type == AIRPDCAP_KEY_TYPE_WPA_PMK)
12222 key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PMK;
12224 bytes = g_byte_array_new();
12225 res = wep_str_to_bytes(dk->key->str, bytes);
12227 /* XXX - Pass the correct array of bytes... */
12228 if (bytes-> len <= AIRPDCAP_WPA_PMK_LEN) {
12229 memcpy(key.KeyData.Wpa.Pmk, bytes->data, bytes->len);
12231 keys->Keys[keys->nKeys] = key;
12236 if(tmpk != NULL) g_free(tmpk);
12239 /* Now set the keys */
12240 AirPDcapSetKeys(&airpdcap_ctx,keys->Keys,keys->nKeys);
12243 g_byte_array_free(bytes, TRUE);
12248 #ifndef HAVE_AIRPDCAP
12249 /* de-weps the block. if successful, buf* will point to the data start. */
12250 static int wep_decrypt(guint8 *buf, guint32 len, int keyidx) {
12251 guint32 i, j, k, crc, keylen;
12252 guint8 s[256], key[128], c_crc[4];
12253 guint8 *dpos, *cpos;
12255 /* Needs to be at least 8 bytes of payload */
12259 /* initialize the first bytes of the key from the IV */
12264 if (keyidx < 0 || keyidx >= num_wepkeys)
12267 keylen = wep_keylens[keyidx];
12271 if (wep_keys[keyidx] == NULL)
12274 keylen+=3; /* add in ICV bytes */
12276 /* copy the rest of the key over from the designated key */
12277 memcpy(key+3, wep_keys[keyidx], wep_keylens[keyidx]);
12280 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]);
12283 /* set up the RC4 state */
12284 for (i = 0; i < 256; i++)
12287 for (i = 0; i < 256; i++) {
12288 j = (j + s[i] + key[i % keylen]) & 0xff;
12292 /* Apply the RC4 to the data, update the CRC32 */
12297 for (k = 0; k < (len -8); k++) {
12299 j = (j+s[i]) & 0xff;
12302 printf("%d -- %02x ", k, *dpos);
12304 *dpos = *cpos++ ^ s[(s[i] + s[j]) & 0xff];
12306 printf("%02x\n", *dpos);
12308 crc = crc32_ccitt_table[(crc ^ *dpos++) & 0xff] ^ (crc >> 8);
12312 /* now let's check the crc */
12314 c_crc[1] = crc >> 8;
12315 c_crc[2] = crc >> 16;
12316 c_crc[3] = crc >> 24;
12318 for (k = 0; k < 4; k++) {
12319 i = (i + 1) & 0xff;
12320 j = (j+s[i]) & 0xff;
12323 printf("-- %02x %02x\n", *dpos, c_crc[k]);
12325 if ((*cpos++ ^ s[(s[i] + s[j]) & 0xff]) != c_crc[k])
12326 return -1; /* ICV mismatch */
12333 static void init_wepkeys(void) {
12334 #ifndef HAVE_AIRPDCAP
12341 for (i = 0; i < num_wepkeys; i++)
12342 g_free(wep_keys[i]);
12347 g_free(wep_keylens);
12352 tmp = getenv("WIRESHARK_WEPKEYNUM");
12357 num_wepkeys = atoi(tmp);
12359 if (num_wepkeys < 1)
12363 /* Figure out how many valid keys we have */
12364 bytes = g_byte_array_new();
12366 for ( i = 0; i < MAX_ENCRYPTION_KEYS; i++) {
12367 g_strstrip(wep_keystr[i]);
12368 res = wep_str_to_bytes(wep_keystr[i], bytes);
12369 if (wep_keystr[i] && res && bytes-> len > 0) {
12374 wep_keys = g_malloc0(num_wepkeys * sizeof(guint8*));
12375 wep_keylens = g_malloc(num_wepkeys * sizeof(int));
12377 for (i = 0, keyidx = 0; i < MAX_ENCRYPTION_KEYS && keyidx < num_wepkeys; i++) {
12378 wep_keys[keyidx] = NULL;
12379 wep_keylens[keyidx] = 0;
12383 g_snprintf(buf, 128, "WIRESHARK_WEPKEY%d", i+1);
12386 tmp = wep_keystr[i];
12392 printf("%s -- %s\n", buf, tmp);
12394 printf("%d -- %s\n", i+1, tmp);
12398 if (wep_keys[keyidx]) {
12399 g_free(wep_keys[keyidx]);
12402 res = wep_str_to_bytes(tmp, bytes);
12403 if (tmp && res && bytes->len > 0) {
12404 if (bytes->len > 32) {
12407 wep_keys[keyidx] = g_malloc0(32 * sizeof(guint8));
12408 memcpy(wep_keys[keyidx], bytes->data, bytes->len * sizeof(guint8));
12409 wep_keylens[keyidx] = bytes->len;
12412 printf("%d: %d bytes\n", i, bytes->len);
12413 printf("%d: %s\n", i, bytes_to_str(bytes->data, bytes->len));
12417 printf("res: %d bytes->len: %d\n", res, bytes->len);
12419 if (tmp[0] != 'w') /* Assume it begins with "wep:" or "wpa-*:" */
12420 g_warning("Could not parse WEP key %d: %s", i + 1, tmp);
12424 g_byte_array_free(bytes, TRUE);
12426 #else /* HAVE_AIRPDCAP defined */
12429 * XXX - AirPDcap - That God sends it to us beautiful (che dio ce la mandi bona)
12430 * The next lines will add a key to the AirPDcap context. The keystring will be added
12431 * to the old WEP array too, but we don't care, because the packets will come here
12432 * already decrypted... One of these days we will fix this too
12434 set_airpdcap_keys();
12435 #endif /* HAVE_AIRPDCAP */
12438 * This code had been taken from AirSnort crack.c function classify()
12439 * Permission granted by snax <at> shmoo dot com
12440 * weak_iv - determine which key byte an iv is useful in resolving
12441 * parm - p, pointer to the first byte of an IV
12442 * return - n - this IV is weak for byte n of a WEP key
12443 * -1 - this IV is not weak for any key bytes
12445 * This function tests for IVs that are known to satisfy the criteria
12446 * for a weak IV as specified in FMS section 7.1
12450 weak_iv(guchar *iv)
12454 if (iv[1] == 255 && iv[0] > 2 && iv[0] < 16) {
12458 sum = iv[0] + iv[1];
12460 if (iv[2] <= 0x0a) {
12463 else if (iv[2] == 0xff){
12468 if (sum == k && (iv[2] >= 0xf2 && iv[2] <= 0xfe && iv[2] != 0xfd)){
12478 * c-basic-offset: 2
12480 * indent-tabs-mode: nil
12483 * ex: set shiftwidth=2 tabstop=8 expandtab
12484 * :indentSize=2:tabSize=8:noTabs=true: