802.11: Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
[metze/wireshark/wip.git] / epan / dissectors / packet-ieee80211.c
1 /* packet-ieee80211.c
2  * Routines for Wireless LAN (IEEE 802.11) dissection
3  * Copyright 2000, Axis Communications AB
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * SPDX-License-Identifier: GPL-2.0-or-later
10  *
11  * Credits:
12  *
13  * The following people helped me by pointing out bugs etc. Thank you!
14  *
15  * Marco Molteni
16  * Lena-Marie Nilsson
17  * Magnus Hultman-Persson
18  */
19
20 /*
21  * 10/24/2005 - Add dissection for 802.11e
22  * Zhu Yi <yi.zhu@intel.com>
23  *
24  * 04/21/2008 - Added dissection for 802.11p
25  * Arada Systems <http://www.aradasystems.com>
26  *
27  * 04/20/2013 - Added dissection of 802.11ad according to the 9th draft of the standard.
28  * Extended as a project in the Laboratory of Computer Communication & Networking (LCCN), Computer Science Department, Technion, Israel.
29  * Majd Omari    <majd.omari@outlook.com>
30  * Jalil Moraney <moraney.jalil@outlook.com>
31  */
32
33 /*
34  * Reference :
35  * The 802.11 standard is "free", 6 month after the publication.
36  *
37  * IEEE Std 802.11-2012: Revision of IEEE Std 802.11-2007
38  * include 10 amendments (802.11k,r,y,w,n,p,z,v,u,s) 802.11-2007
39  * include 8 amendments (802.11a,b,d,e,g,h,i,j) 802.11-1999
40  * http://standards.ieee.org/getieee802/download/802.11-2012.pdf
41  *
42  * WAPI (IE 68)
43  * http://isotc.iso.org/livelink/livelink/fetch/-8913189/8913214/8913250/8913253/JTC001-N-9880.pdf?nodeid=8500308&vernum=-2
44  */
45
46 #include "config.h"
47
48 #include <math.h>
49
50 #include <epan/packet.h>
51 #include <epan/capture_dissectors.h>
52 #include <epan/exceptions.h>
53 #include <wsutil/pint.h>
54 #include <wsutil/str_util.h>
55 #include <epan/addr_resolv.h>
56 #include <epan/address_types.h>
57 #include <epan/strutil.h>
58 #include <epan/prefs.h>
59 #include <epan/reassemble.h>
60 #include "packet-ipx.h"
61 #include "packet-llc.h"
62 #include "packet-ieee80211.h"
63 #include <epan/etypes.h>
64 #include <epan/oui.h>
65 #include <epan/crc32-tvb.h>
66 #include <epan/crypt/wep-wpadefs.h>
67 #include <epan/expert.h>
68 #include <epan/conversation_table.h>
69 #include <epan/uat.h>
70 #include <epan/eapol_keydes_types.h>
71 #include <epan/to_str.h>
72 #include <epan/proto_data.h>
73
74 #include "packet-wps.h"
75 #include "packet-e212.h"
76 #include "packet-sflow.h"
77 #include "packet-gre.h"
78
79 #include <epan/crypt/dot11decrypt_ws.h>
80
81 void proto_register_ieee80211(void);
82 void proto_reg_handoff_ieee80211(void);
83 void proto_register_wlan_rsna_eapol(void);
84
85 extern value_string_ext eap_type_vals_ext; /* from packet-eap.c */
86
87 #ifndef roundup2
88 #define roundup2(x, y)  (((x)+((y)-1))&(~((y)-1)))  /* if y is powers of two */
89 #endif
90
91 /* bitmask for bits [l..h]
92  * taken from kernel's include/linux/bitops.h
93  */
94 #define GENMASK(h, l)  (((1U << ((h) - (l) + 1)) - 1) << (l))
95
96 /* Defragment fragmented 802.11 datagrams */
97 static gboolean wlan_defragment = TRUE;
98
99 /* call subdissector for retransmitted frames */
100 static gboolean wlan_subdissector = TRUE;
101
102 /* Check for the presence of the 802.11 FCS */
103 static gboolean wlan_check_fcs = FALSE;
104
105 /* Check the FCS checksum */
106 static gboolean wlan_check_checksum = TRUE;
107
108 /* Ignore vendor-specific HT elements */
109 static gboolean wlan_ignore_draft_ht = FALSE;
110
111 /* Ignore the Protection bit; assume packet is decrypted */
112 #define WLAN_IGNORE_PROT_NO     0
113 #define WLAN_IGNORE_PROT_WO_IV  1
114 #define WLAN_IGNORE_PROT_W_IV   2
115 static gint wlan_ignore_prot = WLAN_IGNORE_PROT_NO;
116
117 /* The Key MIC len has been set by the user */
118 static guint wlan_key_mic_len = 0;
119
120 /* Table for reassembly of fragments. */
121 static reassembly_table wlan_reassembly_table;
122
123 /* Statistical data */
124 static struct _wlan_stats wlan_stats;
125
126 /*-------------------------------------
127  * UAT for WEP decoder
128  *-------------------------------------
129  */
130 static uat_wep_key_record_t *uat_wep_key_records = NULL;
131 static uat_t                *wep_uat             = NULL;
132 static guint                 num_wepkeys_uat     = 0;
133
134 static void *
135 uat_wep_key_record_copy_cb(void* n, const void* o, size_t siz _U_)
136 {
137   uat_wep_key_record_t* new_key = (uat_wep_key_record_t *)n;
138   const uat_wep_key_record_t* old_key = (const uat_wep_key_record_t *)o;
139
140   new_key->string = g_strdup(old_key->string);
141
142   return new_key;
143 }
144
145 static gboolean
146 uat_wep_key_record_update_cb(void* r, char** err)
147 {
148   uat_wep_key_record_t* rec = (uat_wep_key_record_t *)r;
149   decryption_key_t* dk;
150   guint dk_type;
151
152   if (rec->string == NULL) {
153     *err = g_strdup("Key can't be blank");
154     return FALSE;
155   }
156
157   g_strstrip(rec->string);
158   dk = parse_key_string(rec->string, rec->key);
159
160   if (dk != NULL) {
161     dk_type = dk->type;
162     free_key_string(dk);
163     switch (dk_type) {
164       case DOT11DECRYPT_KEY_TYPE_WEP:
165       case DOT11DECRYPT_KEY_TYPE_WEP_40:
166       case DOT11DECRYPT_KEY_TYPE_WEP_104:
167         if (rec->key != DOT11DECRYPT_KEY_TYPE_WEP) {
168           *err = g_strdup("Invalid key format");
169           return FALSE;
170         }
171         break;
172       case DOT11DECRYPT_KEY_TYPE_WPA_PWD:
173         if (rec->key != DOT11DECRYPT_KEY_TYPE_WPA_PWD) {
174           *err = g_strdup("Invalid key format");
175           return FALSE;
176         }
177         break;
178       case DOT11DECRYPT_KEY_TYPE_WPA_PSK:
179         if (rec->key != DOT11DECRYPT_KEY_TYPE_WPA_PSK) {
180           *err = g_strdup("Invalid key format");
181           return FALSE;
182         }
183         break;
184       default:
185         *err = g_strdup("Invalid key format");
186         return FALSE;
187         break;
188     }
189   } else {
190     *err = g_strdup("Invalid key format");
191     return FALSE;
192   }
193   return TRUE;
194 }
195
196 static void
197 uat_wep_key_record_free_cb(void*r)
198 {
199   uat_wep_key_record_t* key = (uat_wep_key_record_t *)r;
200   g_free(key->string);
201 }
202
203 UAT_VS_DEF(uat_wep_key_records, key, uat_wep_key_record_t, guint8, 0, STRING_KEY_TYPE_WEP)
204 UAT_CSTRING_CB_DEF(uat_wep_key_records, string, uat_wep_key_record_t)
205
206 /* Stuff for the WEP/WPA/WPA2 decoder */
207 static gboolean enable_decryption = TRUE;
208
209 static void
210 ieee_80211_add_tagged_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
211                                   proto_tree *tree, int tagged_parameters_len, int ftype,
212                                   association_sanity_check_t *association_sanity_check);
213
214 static tvbuff_t *try_decrypt(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, guint32 len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer, PDOT11DECRYPT_KEY_ITEM used_key);
215
216 static int weak_iv(guchar *iv);
217
218 typedef struct mimo_control
219 {
220   guint8 nc;
221   guint8 nr;
222   gboolean chan_width;
223   guint8 grouping;
224   guint8 coefficient_size;
225   guint8 codebook_info;
226   guint8 remaining_matrix_segment;
227 } mimo_control_t;
228
229 /* ************************************************************************* */
230 /*                          Miscellaneous Constants                          */
231 /* ************************************************************************* */
232 #define SHORT_STR 256
233 #define IS_DMG_KEY 1
234 #define IS_AP_KEY 2
235 #define IS_CTRL_GRANT_OR_GRANT_ACK_KEY 2
236 /* ************************************************************************* */
237 /*  Define some very useful macros that are used to analyze frame types etc. */
238 /* ************************************************************************* */
239
240 /*
241  * Fetch the frame control field and swap it if needed.  "fcf" and "tvb"
242  * must be valid variables.
243  */
244 #define FETCH_FCF(off) ((option_flags & IEEE80211_COMMON_OPT_BROKEN_FC) ? \
245   GUINT16_SWAP_LE_BE(tvb_get_letohs(tvb, off)) : \
246   tvb_get_letohs(tvb, off))
247
248 /*
249  * Extract the fragment number and sequence number from the sequence
250  * control field.
251  */
252 #define SEQCTL_FRAGMENT_NUMBER(x) ((x) & 0x000F)
253 #define SEQCTL_SEQUENCE_NUMBER(x) (((x) & 0xFFF0) >> 4)
254
255 /*
256  * Extract subfields from the QoS control field.
257  */
258 #define QOS_TID(x)            ((x) & 0x000F)
259 #define QOS_PRIORITY(x)       ((x) & 0x0007)
260 #define QOS_EOSP(x)           (((x) & 0x0010) >> 4) /* end of service period */
261 #define QOS_ACK_POLICY(x)     (((x) & 0x0060) >> 5)
262 #define QOS_AMSDU_PRESENT(x)  (((x) & 0x0080) >> 6)
263 #define QOS_FIELD_CONTENT(x)  (((x) & 0xFF00) >> 8)
264 #define QOS_MESH_CONTROL_PRESENT(x) (((x) & 0x0100) >> 8)
265
266 #define QOS_FLAG_EOSP    0x0010
267
268 /*
269  * Extract subfields from the result of QOS_FIELD_CONTENT().
270  */
271 #define QOS_PS_BUF_STATE_INDICATED(x)  (((x) & 0x02) >> 1)
272 #define QOS_PS_HIGHEST_PRI_BUF_AC(x)   (((x) & 0x0C) >> 2)
273 #define QOS_PS_QAP_BUF_LOAD(x)         (((x) & 0xF0) >> 4)
274
275 /*
276  * Bits from the HT Control field.
277  * 802.11-2012 and 802.11ac-2013 8.2.4.6, 32 bits.
278  */
279 #define HTC_VHT              0x00000001
280 #define HTC_HE               0x00000002
281 #define HTC_MRQ              0x00000004
282 #define HTC_UNSOLICITED_MFB  0x20000000
283
284 /*
285  * Extract subfields from the HT Control field.
286  */
287 #define HTC_LAC(htc)           ((htc) & 0xFE)
288 #define HTC_LAC_MAI(htc)       (((htc) >> 2) & 0xF)
289 #define HTC_IS_ASELI(htc)      (HTC_LAC_MAI(htc) == 0xE)
290 #define HTC_LAC_MAI_MRQ(htc)   ((HTC_LAC_MAI(htc))  & 0x1)
291 #define HTC_LAC_MAI_MSI(htc)   ((HTC_LAC_MAI(htc) >> 1) & 0x7)
292 #define HTC_LAC_MFSI(htc)      (((htc) >> 4) & 0x7)
293 #define HTC_LAC_ASEL_CMD(htc)  (((htc) >> 9) & 0x7)
294 #define HTC_LAC_ASEL_DATA(htc) (((htc) >> 12) & 0xF)
295 #define HTC_LAC_MFB(htc)       (((htc) >> 9) & 0x7F)
296 #define HTC_CAL_POS(htc)       (((htc) >> 16) & 0x3)
297 #define HTC_CAL_SEQ(htc)       (((htc) >> 18) & 0x3)
298 #define HTC_CSI_STEERING(htc)  (((htc) >> 22) & 0x3)
299 #define HTC_NDP_ANN(htc)       (((htc) >> 24) & 0x1)
300 #define HTC_AC_CONSTRAINT(htc) (((htc) >> 30) & 0x1)
301 #define HTC_RDG_MORE_PPDU(htc) (((htc) >> 31) & 0x1)
302
303 #define HTC_MFB(htc)           (((htc) >> 9) & 0x7FFF)
304
305 /* VHT-MCS = 15, NUM_STS = 7 */
306 #define HTC_NO_FEEDBACK_PRESENT(mfb) (((mfb) & 0x7F) == 0x7F)
307
308 /*
309  * Extract subfields from the key octet in WEP-encrypted frames.
310  */
311 #define KEY_OCTET_WEP_KEY(x)   (((x) & 0xC0) >> 6)
312
313 #define KEY_EXTIV    0x20
314 #define EXTIV_LEN    8
315
316 /*
317  * Bits from the Mesh Flags field
318  */
319 #define MESH_FLAGS_ADDRESS_EXTENSION  0x3
320
321 /* ************************************************************************* */
322 /*              Constants used to identify cooked frame types                */
323 /* ************************************************************************* */
324 #define MGT_FRAME            0x00  /* Frame type is management */
325 #define CONTROL_FRAME        0x01  /* Frame type is control */
326 #define DATA_FRAME           0x02  /* Frame type is Data */
327 #define EXTENSION_FRAME      0x03  /* Frame type is Extension */
328
329 #define DATA_SHORT_HDR_LEN     24
330 #define DATA_LONG_HDR_LEN      30
331 #define MGT_FRAME_HDR_LEN      24  /* Length of Management frame-headers */
332
333 /* ************************************************************************* */
334 /*        Logical field codes (IEEE 802.11 encoding of tags)                 */
335 /* ************************************************************************* */
336 #define TAG_SSID                       0
337 #define TAG_SUPP_RATES                 1
338 #define TAG_FH_PARAMETER               2
339 #define TAG_DS_PARAMETER               3
340 #define TAG_CF_PARAMETER               4
341 #define TAG_TIM                        5
342 #define TAG_IBSS_PARAMETER             6
343 #define TAG_COUNTRY_INFO               7
344 #define TAG_FH_HOPPING_PARAMETER       8
345 #define TAG_FH_HOPPING_TABLE           9
346 #define TAG_REQUEST                   10
347 #define TAG_QBSS_LOAD                 11
348 #define TAG_EDCA_PARAM_SET            12
349 #define TAG_TSPEC                     13
350 #define TAG_TCLAS                     14
351 #define TAG_SCHEDULE                  15
352 #define TAG_CHALLENGE_TEXT            16
353
354 #define TAG_POWER_CONSTRAINT          32
355 #define TAG_POWER_CAPABILITY          33
356 #define TAG_TPC_REQUEST               34
357 #define TAG_TPC_REPORT                35
358 #define TAG_SUPPORTED_CHANNELS        36
359 #define TAG_CHANNEL_SWITCH_ANN        37
360 #define TAG_MEASURE_REQ               38
361 #define TAG_MEASURE_REP               39
362 #define TAG_QUIET                     40
363 #define TAG_IBSS_DFS                  41
364 #define TAG_ERP_INFO                  42
365 #define TAG_TS_DELAY                  43
366 #define TAG_TCLAS_PROCESS             44
367 #define TAG_HT_CAPABILITY             45 /* IEEE Stc 802.11n/D2.0 */
368 #define TAG_QOS_CAPABILITY            46
369 #define TAG_ERP_INFO_OLD              47 /* IEEE Std 802.11g/D4.0 */
370 #define TAG_RSN_IE                    48
371 /* Reserved 49 */
372 #define TAG_EXT_SUPP_RATES            50
373 #define TAG_AP_CHANNEL_REPORT         51
374 #define TAG_NEIGHBOR_REPORT           52
375 #define TAG_RCPI                      53
376 #define TAG_MOBILITY_DOMAIN           54  /* IEEE Std 802.11r-2008 */
377 #define TAG_FAST_BSS_TRANSITION       55  /* IEEE Std 802.11r-2008 */
378 #define TAG_TIMEOUT_INTERVAL          56  /* IEEE Std 802.11r-2008 */
379 #define TAG_RIC_DATA                  57  /* IEEE Std 802.11r-2008 */
380 #define TAG_DSE_REG_LOCATION          58
381 #define TAG_SUPPORTED_OPERATING_CLASSES             59 /* IEEE Std 802.11w-2009 */
382 #define TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT    60 /* IEEE Std 802.11w-2009 */
383 #define TAG_HT_INFO                   61  /* IEEE Stc 802.11n/D2.0 */
384 #define TAG_SECONDARY_CHANNEL_OFFSET  62  /* IEEE Stc 802.11n/D1.10/D2.0 */
385 #define TAG_BSS_AVG_ACCESS_DELAY      63
386 #define TAG_ANTENNA                   64
387 #define TAG_RSNI                      65
388 #define TAG_MEASURE_PILOT_TRANS       66
389 #define TAG_BSS_AVB_ADM_CAPACITY      67
390 #define TAG_IE_68_CONFLICT            68  /* Conflict: WAPI Vs. IEEE */
391 #define TAG_WAPI_PARAM_SET            68
392 #define TAG_BSS_AC_ACCESS_DELAY       68
393 #define TAG_TIME_ADV                  69  /* IEEE Std 802.11p-2010 */
394 #define TAG_RM_ENABLED_CAPABILITY     70
395 #define TAG_MULTIPLE_BSSID            71
396 #define TAG_20_40_BSS_CO_EX           72  /* IEEE P802.11n/D6.0 */
397 #define TAG_20_40_BSS_INTOL_CH_REP    73  /* IEEE P802.11n/D6.0 */
398 #define TAG_OVERLAP_BSS_SCAN_PAR      74  /* IEEE P802.11n/D6.0 */
399 #define TAG_RIC_DESCRIPTOR            75  /* IEEE Std 802.11r-2008 */
400 #define TAG_MMIE                      76  /* IEEE Std 802.11w-2009 */
401 #define TAG_EVENT_REQUEST             78
402 #define TAG_EVENT_REPORT              79
403 #define TAG_DIAGNOSTIC_REQUEST        80
404 #define TAG_DIAGNOSTIC_REPORT         81
405 #define TAG_LOCATION_PARAMETERS       82
406 #define TAG_NO_BSSID_CAPABILITY       83
407 #define TAG_SSID_LIST                 84
408 #define TAG_MULTIPLE_BSSID_INDEX      85
409 #define TAG_FMS_DESCRIPTOR            86
410 #define TAG_FMS_REQUEST               87
411 #define TAG_FMS_RESPONSE              88
412 #define TAG_QOS_TRAFFIC_CAPABILITY    89
413 #define TAG_BSS_MAX_IDLE_PERIOD       90
414 #define TAG_TFS_REQUEST               91
415 #define TAG_TFS_RESPONSE              92
416 #define TAG_WNM_SLEEP_MODE            93
417 #define TAG_TIM_BROADCAST_REQUEST     94
418 #define TAG_TIM_BROADCAST_RESPONSE    95
419 #define TAG_COLLOCATED_INTER_REPORT   96
420 #define TAG_CHANNEL_USAGE             97
421 #define TAG_TIME_ZONE                 98  /* IEEE Std 802.11v-2011 */
422 #define TAG_DMS_REQUEST               99
423 #define TAG_DMS_RESPONSE             100
424 #define TAG_LINK_IDENTIFIER          101  /* IEEE Std 802.11z-2010 */
425 #define TAG_WAKEUP_SCHEDULE          102  /* IEEE Std 802.11z-2010 */
426 #define TAG_CHANNEL_SWITCH_TIMING    104  /* IEEE Std 802.11z-2010 */
427 #define TAG_PTI_CONTROL              105  /* IEEE Std 802.11z-2010 */
428 #define TAG_PU_BUFFER_STATUS         106  /* IEEE Std 802.11z-2010 */
429 #define TAG_INTERWORKING             107  /* IEEE Std 802.11u-2011 */
430 #define TAG_ADVERTISEMENT_PROTOCOL   108  /* IEEE Std 802.11u-2011 */
431 #define TAG_EXPIDITED_BANDWIDTH_REQ  109  /* IEEE Std 802.11u-2011 */
432 #define TAG_QOS_MAP_SET              110  /* IEEE Std 802.11u-2011 */
433 #define TAG_ROAMING_CONSORTIUM       111  /* IEEE Std 802.11u-2011 */
434 #define TAG_EMERGENCY_ALERT_ID       112  /* IEEE Std 802.11u-2011 */
435 #define TAG_MESH_CONFIGURATION       113  /* IEEE Std 802.11s-2011 */
436 #define TAG_MESH_ID                  114  /* IEEE Std 802.11s-2011 */
437 #define TAG_MESH_LINK_METRIC_REPORT  115
438 #define TAG_CONGESTION_NOTIFICATION  116
439 #define TAG_MESH_PEERING_MGMT        117  /* IEEE Std 802.11s-2011 */
440 #define TAG_MESH_CHANNEL_SWITCH      118
441 #define TAG_MESH_AWAKE_WINDOW        119  /* IEEE Std 802.11s-2011 */
442 #define TAG_BEACON_TIMING            120
443 #define TAG_MCCAOP_SETUP_REQUEST     121
444 #define TAG_MCCAOP_SETUP_REPLY       122
445 #define TAG_MCCAOP_ADVERTISEMENT     123
446 #define TAG_MCCAOP_TEARDOWN          124
447 #define TAG_GANN                     125
448 #define TAG_RANN                     126  /* IEEE Std 802.11s-2011 */
449 #define TAG_EXTENDED_CAPABILITIES    127  /* IEEE Stc 802.11n/D1.10/D2.0 */
450 #define TAG_AGERE_PROPRIETARY        128
451 #define TAG_MESH_PREQ                130  /* IEEE Std 802.11s-2011 */
452 #define TAG_MESH_PREP                131  /* IEEE Std 802.11s-2011 */
453 #define TAG_MESH_PERR                132  /* IEEE Std 802.11s-2011 */
454 #define TAG_CISCO_CCX1_CKIP          133  /* Cisco Compatible eXtensions v1 */
455 #define TAG_CISCO_CCX2               136  /* Cisco Compatible eXtensions v2 */
456 #define TAG_PXU                      137
457 #define TAG_PXUC                     138
458 #define TAG_AUTH_MESH_PEERING_EXCH   139
459 #define TAG_MIC                      140
460 #define TAG_DESTINATION_URI          141
461 #define TAG_U_APSD_COEX              142
462 #define TAG_WAKEUP_SCHEDULE_AD       143  /* IEEE Std 802.11ad */
463 #define TAG_EXTENDED_SCHEDULE        144  /* IEEE Std 802.11ad */
464 #define TAG_STA_AVAILABILITY         145  /* IEEE Std 802.11ad */
465 #define TAG_DMG_TSPEC                146  /* IEEE Std 802.11ad */
466 #define TAG_NEXT_DMG_ATI             147  /* IEEE Std 802.11ad */
467 #define TAG_DMG_CAPABILITIES         148  /* IEEE Std 802.11ad */
468 #define TAG_CISCO_CCX3               149  /* Cisco Compatible eXtensions v3 */
469 #define TAG_CISCO_VENDOR_SPECIFIC    150  /* Cisco Compatible eXtensions */
470 #define TAG_DMG_OPERATION            151  /* IEEE Std 802.11ad */
471 #define TAG_DMG_BSS_PARAMETER_CHANGE 152  /* IEEE Std 802.11ad */
472 #define TAG_DMG_BEAM_REFINEMENT      153  /* IEEE Std 802.11ad */
473 #define TAG_CHANNEL_MEASURMENT_FB    154  /* IEEE Std 802.11ad */
474 #define TAG_AWAKE_WINDOW             157  /* IEEE Std 802.11ad */
475 #define TAG_MULTI_BAND               158  /* IEEE Std 802.11ad */
476 #define TAG_ADDBA_EXT                159  /* IEEE Std 802.11ad */
477 #define TAG_NEXTPCP_LIST             160  /* IEEE Std 802.11ad */
478 #define TAG_PCP_HANDOVER             161  /* IEEE Std 802.11ad */
479 #define TAG_DMG_LINK_MARGIN          162  /* IEEE Std 802.11ad */
480 #define TAG_SWITCHING_STREAM         163  /* IEEE Std 802.11ad */
481 #define TAG_SESSION_TRANSMISSION     164  /* IEEE Std 802.11ad */
482 #define TAG_DYN_TONE_PAIR_REP        165  /* IEEE Std 802.11ad */
483 #define TAG_CLUSTER_REP              166  /* IEEE Std 802.11ad */
484 #define TAG_RELAY_CAPABILITIES       167  /* IEEE Std 802.11ad */
485 #define TAG_RELAY_TRANSFER_PARAM     168  /* IEEE Std 802.11ad */
486 #define TAG_BEAMLINK_MAINTENANCE     169  /* IEEE Std 802.11ad */
487 #define TAG_MULTIPLE_MAC_SUBLAYERS   170  /* IEEE Std 802.11ad */
488 #define TAG_U_PID                    171  /* IEEE Std 802.11ad */
489 #define TAG_DMG_LINK_ADAPTION_ACK    172  /* IEEE Std 802.11ad */
490 #define TAG_SYMBOL_PROPRIETARY       173
491 #define TAG_MCCAOP_ADVERTISEMENT_OV  174
492 #define TAG_QUIET_PERIOD_REQ         175  /* IEEE Std 802.11ad */
493 #define TAG_QUIET_PERIOD_RES         177  /* IEEE Std 802.11ad */
494 #define TAG_ECPAC_POLICY             182  /* IEEE Std 802.11ad */
495 #define TAG_CLUSTER_TIME_OFFSET      183  /* IEEE Std 802.11ad */
496 #define TAG_ANTENNA_SECTOR_ID        190  /* IEEE Std 802.11ad */
497 #define TAG_VHT_CAPABILITY           191  /* IEEE Std 802.11ac/D3.1 */
498 #define TAG_VHT_OPERATION            192  /* IEEE Std 802.11ac/D3.1 */
499 #define TAG_EXT_BSS_LOAD             193  /* IEEE Std 802.11ac */
500 #define TAG_WIDE_BW_CHANNEL_SWITCH   194  /* IEEE Std 802.11ac */
501 #define TAG_VHT_TX_PWR_ENVELOPE      195  /* IEEE Std 802.11ac/D5.0 */
502 #define TAG_CHANNEL_SWITCH_WRAPPER   196  /* IEEE Std 802.11ac */
503 #define TAG_OPERATING_MODE_NOTIFICATION 199  /* IEEE Std 802.11ac */
504 #define TAG_VENDOR_SPECIFIC_IE       221
505 #define TAG_ELEMENT_ID_EXTENSION     255  /* IEEE Std 802.11ai */
506
507 static const value_string tag_num_vals[] = {
508   { TAG_SSID,                                 "SSID parameter set" },
509   { TAG_SUPP_RATES,                           "Supported Rates" },
510   { TAG_FH_PARAMETER,                         "FH Parameter set" },
511   { TAG_DS_PARAMETER,                         "DS Parameter set" },
512   { TAG_CF_PARAMETER,                         "CF Parameter set" },
513   { TAG_TIM,                                  "Traffic Indication Map (TIM)" },
514   { TAG_IBSS_PARAMETER,                       "IBSS Parameter set" },
515   { TAG_COUNTRY_INFO,                         "Country Information" },
516   { TAG_FH_HOPPING_PARAMETER,                 "Hopping Pattern Parameters" },
517   { TAG_FH_HOPPING_TABLE,                     "Hopping Pattern Table" },
518   { TAG_REQUEST,                              "Request" },
519   { TAG_QBSS_LOAD,                            "QBSS Load Element" },
520   { TAG_EDCA_PARAM_SET,                       "EDCA Parameter Set" },
521   { TAG_TSPEC,                                "Traffic Specification" },
522   { TAG_TCLAS,                                "Traffic Classification" },
523   { TAG_SCHEDULE,                             "Schedule" },
524   { TAG_CHALLENGE_TEXT,                       "Challenge text" },
525   { TAG_POWER_CONSTRAINT,                     "Power Constraint" },
526   { TAG_POWER_CAPABILITY,                     "Power Capability" },
527   { TAG_TPC_REQUEST,                          "TPC Request" },
528   { TAG_TPC_REPORT,                           "TPC Report" },
529   { TAG_SUPPORTED_CHANNELS,                   "Supported Channels" },
530   { TAG_CHANNEL_SWITCH_ANN,                   "Channel Switch Announcement" },
531   { TAG_MEASURE_REQ,                          "Measurement Request" },
532   { TAG_MEASURE_REP,                          "Measurement Report" },
533   { TAG_QUIET,                                "Quiet" },
534   { TAG_IBSS_DFS,                             "IBSS DFS" },
535   { TAG_ERP_INFO,                             "ERP Information" },
536   { TAG_TS_DELAY,                             "TS Delay" },
537   { TAG_TCLAS_PROCESS,                        "TCLAS Processing" },
538   { TAG_HT_CAPABILITY,                        "HT Capabilities (802.11n D1.10)" },
539   { TAG_QOS_CAPABILITY,                       "QoS Capability" },
540   { TAG_ERP_INFO_OLD,                         "ERP Information" }, /* Reserved... */
541   { TAG_RSN_IE,                               "RSN Information" },
542   { TAG_EXT_SUPP_RATES,                       "Extended Supported Rates" },
543   { TAG_AP_CHANNEL_REPORT,                    "AP Channel Report" },
544   { TAG_NEIGHBOR_REPORT,                      "Neighbor Report" },
545   { TAG_RCPI,                                 "RCPI" },
546   { TAG_MOBILITY_DOMAIN,                      "Mobility Domain" },
547   { TAG_FAST_BSS_TRANSITION,                  "Fast BSS Transition" },
548   { TAG_TIMEOUT_INTERVAL,                     "Timeout Interval" },
549   { TAG_RIC_DATA,                             "RIC Data" },
550   { TAG_DSE_REG_LOCATION,                     "DSE Registered Location" },
551   { TAG_SUPPORTED_OPERATING_CLASSES,          "Supported Operating Classes" },
552   { TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement" },
553   { TAG_HT_INFO,                              "HT Information (802.11n D1.10)" },
554   { TAG_SECONDARY_CHANNEL_OFFSET,             "Secondary Channel Offset (802.11n D1.10)" },
555   { TAG_BSS_AVG_ACCESS_DELAY,                 "BSS Average Access Delay" },
556   { TAG_ANTENNA,                              "Antenna" },
557   { TAG_RSNI,                                 "RSNI" },
558   { TAG_MEASURE_PILOT_TRANS,                  "Measurement Pilot Transmission" },
559   { TAG_BSS_AVB_ADM_CAPACITY,                 "BSS Available Admission Capacity" },
560   { TAG_IE_68_CONFLICT,                       "BSS AC Access Delay/WAPI Parameter Set" },
561   { TAG_TIME_ADV,                             "Time Advertisement" },
562   { TAG_RM_ENABLED_CAPABILITY,                "RM Enabled Capabilities" },
563   { TAG_MULTIPLE_BSSID,                       "Multiple BSSID" },
564   { TAG_20_40_BSS_CO_EX,                      "20/40 BSS Coexistence" },
565   { TAG_20_40_BSS_INTOL_CH_REP,               "20/40 BSS Intolerant Channel Report" },   /* IEEE P802.11n/D6.0 */
566   { TAG_OVERLAP_BSS_SCAN_PAR,                 "Overlapping BSS Scan Parameters" },       /* IEEE P802.11n/D6.0 */
567   { TAG_RIC_DESCRIPTOR,                       "RIC Descriptor" },
568   { TAG_MMIE,                                 "Management MIC" },
569   { TAG_EVENT_REQUEST,                        "Event Request" },
570   { TAG_EVENT_REPORT,                         "Event Report" },
571   { TAG_DIAGNOSTIC_REQUEST,                   "Diagnostic Request" },
572   { TAG_DIAGNOSTIC_REPORT,                    "Diagnostic Report" },
573   { TAG_LOCATION_PARAMETERS,                  "Location Parameters" },
574   { TAG_NO_BSSID_CAPABILITY,                  "Non Transmitted BSSID Capability" },
575   { TAG_SSID_LIST,                            "SSID List" },
576   { TAG_MULTIPLE_BSSID_INDEX,                 "Multiple BSSID Index" },
577   { TAG_FMS_DESCRIPTOR,                       "FMS Descriptor" },
578   { TAG_FMS_REQUEST,                          "FMS Request" },
579   { TAG_FMS_RESPONSE,                         "FMS Response" },
580   { TAG_QOS_TRAFFIC_CAPABILITY,               "QoS Traffic Capability" },
581   { TAG_BSS_MAX_IDLE_PERIOD,                  "BSS Max Idle Period" },
582   { TAG_TFS_REQUEST,                          "TFS Request" },
583   { TAG_TFS_RESPONSE,                         "TFS Response" },
584   { TAG_WNM_SLEEP_MODE,                       "WNM-Sleep Mode" },
585   { TAG_TIM_BROADCAST_REQUEST,                "TIM Broadcast Request" },
586   { TAG_TIM_BROADCAST_RESPONSE,               "TIM Broadcast Response" },
587   { TAG_COLLOCATED_INTER_REPORT,              "Collocated Interference Report" },
588   { TAG_CHANNEL_USAGE,                        "Channel Usage" },
589   { TAG_TIME_ZONE,                            "Time Zone" },
590   { TAG_DMS_REQUEST,                          "DMS Request" },
591   { TAG_DMS_RESPONSE,                         "DMS Response" },
592   { TAG_LINK_IDENTIFIER,                      "Link Identifier" },
593   { TAG_WAKEUP_SCHEDULE,                      "Wakeup Schedule" },
594   { TAG_CHANNEL_SWITCH_TIMING,                "Channel Switch Timing" },
595   { TAG_PTI_CONTROL,                          "PTI Control" },
596   { TAG_PU_BUFFER_STATUS,                     "PU Buffer Status" },
597   { TAG_INTERWORKING,                         "Interworking" },
598   { TAG_ADVERTISEMENT_PROTOCOL,               "Advertisement Protocol"},
599   { TAG_EXPIDITED_BANDWIDTH_REQ,              "Expedited Bandwidth Request" },
600   { TAG_QOS_MAP_SET,                          "QoS Map Set" },
601   { TAG_ROAMING_CONSORTIUM,                   "Roaming Consortium" },
602   { TAG_EMERGENCY_ALERT_ID,                   "Emergency Alert Identifier" },
603   { TAG_MESH_CONFIGURATION,                   "Mesh Configuration" },
604   { TAG_MESH_ID,                              "Mesh ID" },
605   { TAG_MESH_LINK_METRIC_REPORT,              "Mesh Link Metric Report" },
606   { TAG_CONGESTION_NOTIFICATION,              "Congestion Notification" },
607   { TAG_MESH_PEERING_MGMT,                    "Mesh Peering Management" },
608   { TAG_MESH_CHANNEL_SWITCH,                  "Mesh Channel Switch Parameters" },
609   { TAG_MESH_AWAKE_WINDOW,                    "Mesh Awake Window" },
610   { TAG_BEACON_TIMING,                        "Beacon Timing" },
611   { TAG_MCCAOP_SETUP_REQUEST,                 "MCCAOP Setup Request" },
612   { TAG_MCCAOP_SETUP_REPLY,                   "MCCAOP SETUP Reply" },
613   { TAG_MCCAOP_ADVERTISEMENT,                 "MCCAOP Advertisement" },
614   { TAG_MCCAOP_TEARDOWN,                      "MCCAOP Teardown" },
615   { TAG_GANN,                                 "Gate Announcement" },
616   { TAG_RANN,                                 "Root Announcement" },
617   { TAG_EXTENDED_CAPABILITIES,                "Extended Capabilities" },
618   { TAG_AGERE_PROPRIETARY,                    "Agere Proprietary" },
619   { TAG_MESH_PREQ,                            "Path Request" },
620   { TAG_MESH_PREP,                            "Path Reply" },
621   { TAG_MESH_PERR,                            "Path Error" },
622   { TAG_CISCO_CCX1_CKIP,                      "Cisco CCX1 CKIP + Device Name" },
623   { TAG_CISCO_CCX2,                           "Cisco CCX2" },
624   { TAG_PXU,                                  "Proxy Update" },
625   { TAG_PXUC,                                 "Proxy Update Confirmation"},
626   { TAG_AUTH_MESH_PEERING_EXCH,               "Auhenticated Mesh Perring Exchange" },
627   { TAG_MIC,                                  "MIC (Message Integrity Code)" },
628   { TAG_DESTINATION_URI,                      "Destination URI" },
629   { TAG_U_APSD_COEX,                          "U-APSD Coexistence" },
630   { TAG_WAKEUP_SCHEDULE_AD,                   "Wakeup Schedule 802.11ad" },
631   { TAG_EXTENDED_SCHEDULE,                    "Extended Schedule" },
632   { TAG_STA_AVAILABILITY,                     "STA Availability" },
633   { TAG_DMG_TSPEC,                            "DMG TSPEC" },
634   { TAG_NEXT_DMG_ATI,                         "Next DMG ATI" },
635   { TAG_DMG_CAPABILITIES,                     "DMG Capabilities" },
636   { TAG_CISCO_CCX3,                           "Cisco Unknown 95" },
637   { TAG_CISCO_VENDOR_SPECIFIC,                "Vendor Specific" },
638   { TAG_DMG_OPERATION,                        "DMG Operating" },
639   { TAG_DMG_BSS_PARAMETER_CHANGE,             "DMG BSS Parameter Change" },
640   { TAG_DMG_BEAM_REFINEMENT,                  "DMG Beam Refinement" },
641   { TAG_CHANNEL_MEASURMENT_FB,                "Channel Measurement Feedback" },
642   { TAG_AWAKE_WINDOW,                         "Awake Window" },
643   { TAG_MULTI_BAND,                           "Multi Band" },
644   { TAG_ADDBA_EXT,                            "ADDBA Extension" },
645   { TAG_NEXTPCP_LIST,                         "NEXTPCP List" },
646   { TAG_PCP_HANDOVER,                         "PCP Handover" },
647   { TAG_DMG_LINK_MARGIN,                      "DMG Link Margin" },
648   { TAG_SWITCHING_STREAM,                     "Switching Stream" },
649   { TAG_SESSION_TRANSMISSION,                 "Session Transmission" },
650   { TAG_DYN_TONE_PAIR_REP,                    "Dynamic Tone Pairing Report" },
651   { TAG_CLUSTER_REP,                          "Cluster Report" },
652   { TAG_RELAY_CAPABILITIES,                   "Relay Capabilities" },
653   { TAG_RELAY_TRANSFER_PARAM,                 "Relay Transfer Parameter" },
654   { TAG_BEAMLINK_MAINTENANCE,                 "Beamlink Maintenance" },
655   { TAG_MULTIPLE_MAC_SUBLAYERS,               "Multiple MAC Sublayers" },
656   { TAG_U_PID,                                "U-PID" },
657   { TAG_DMG_LINK_ADAPTION_ACK,                "DMG Link Adaption Acknowledgment" },
658   { TAG_SYMBOL_PROPRIETARY,                   "Symbol Proprietary" },
659   { TAG_MCCAOP_ADVERTISEMENT_OV,              "MCCAOP Advertisement Overview" },
660   { TAG_QUIET_PERIOD_REQ,                     "Quiet Period Request" },
661   { TAG_QUIET_PERIOD_RES,                     "Quiet Period Response" },
662   { TAG_ECPAC_POLICY,                         "ECPAC Policy" },
663   { TAG_CLUSTER_TIME_OFFSET,                  "Cluster Time Offset" },
664   { TAG_ANTENNA_SECTOR_ID,                    "Antenna Sector ID" },
665   { TAG_VHT_CAPABILITY,                       "VHT Capabilities" },
666   { TAG_VHT_OPERATION,                        "VHT Operation" },
667   { TAG_EXT_BSS_LOAD,                         "Extended BSS Load" },
668   { TAG_WIDE_BW_CHANNEL_SWITCH,               "Wide Bandwidth Channel Switch" },
669   { TAG_VHT_TX_PWR_ENVELOPE,                  "VHT Tx Power Envelope" },
670   { TAG_CHANNEL_SWITCH_WRAPPER,               "Channel Switch Wrapper" },
671   { TAG_OPERATING_MODE_NOTIFICATION,          "Operating Mode Notification" },
672   { TAG_VENDOR_SPECIFIC_IE,                   "Vendor Specific" },
673   { TAG_ELEMENT_ID_EXTENSION,                 "Element ID Extension" },
674   { 0, NULL }
675 };
676 static value_string_ext tag_num_vals_ext = VALUE_STRING_EXT_INIT(tag_num_vals);
677
678 #define ETAG_ASSOC_DELAY_INFO          1
679 #define ETAG_FILS_REQ_PARAMS           2
680 #define ETAG_FILS_KEY_CONFIRM          3
681 #define ETAG_FILS_SESSION              4
682 #define ETAG_FILS_HLP_CONTAINER        5
683 #define ETAG_FILS_IP_ADDRESS_ASSIGN    6
684 #define ETAG_KEY_DELIVERY              7
685 #define ETAG_FILS_WRAPPED_DATA         8
686 #define ETAG_FTM_SYNC_INFO             9
687 #define ETAG_EXTENDED_REQUEST          10
688 #define ETAG_ESTIMATED_SERVICE_PARAM   11
689 #define ETAG_FILS_PUBLIC_KEY           12
690 #define ETAG_FILS_NONCE                13
691 #define ETAG_FUTURE_CHANNEL_GUIDANCE   14
692
693 /* 802.11AX defined tags */
694 #define ETAG_HE_CAPABILITIES                   35
695 #define ETAG_HE_OPERATION                      36
696 #define ETAG_UORA_PARAMETER_SET                37
697 #define ETAG_MU_EDCA_PARAMETER_SET             38
698 #define ETAG_SPATIAL_REUSE_PARAMETER_SET       39
699 #define ETAG_NDP_FEEDBACK_REPORT_PARAMETER_SET 41
700 #define ETAG_BSS_COLOR_CHANGE_ANNOUNCEMENT     42
701 #define ETAG_QUIET_TIME_PERIOD_SETUP           43
702 #define ETAG_ESS_REPORT                        44
703
704 static const value_string tag_num_vals_eid_ext[] = {
705   { ETAG_ASSOC_DELAY_INFO,                    "Association Delay Info" },
706   { ETAG_FILS_REQ_PARAMS,                     "FILS Request Parameters" },
707   { ETAG_FILS_KEY_CONFIRM,                    "FILS Key Confirmation" },
708   { ETAG_FILS_SESSION,                        "FILS Session" },
709   { ETAG_FILS_HLP_CONTAINER,                  "FILS HLP Container" },
710   { ETAG_FILS_IP_ADDRESS_ASSIGN,              "FILS IP Address Assignment" },
711   { ETAG_KEY_DELIVERY,                        "Key Delivery" },
712   { ETAG_FILS_WRAPPED_DATA,                   "FILS Wrapped Data" },
713   { ETAG_FTM_SYNC_INFO,                       "FTM Synchronization Information" },
714   { ETAG_EXTENDED_REQUEST,                    "Extended Request" },
715   { ETAG_ESTIMATED_SERVICE_PARAM,             "Estimated Service Parameters" },
716   { ETAG_FILS_PUBLIC_KEY,                     "FILS Public Key" },
717   { ETAG_FILS_NONCE,                          "FILS Nonce" },
718   { ETAG_FUTURE_CHANNEL_GUIDANCE,             "Future Channel Guidance" },
719   { ETAG_HE_CAPABILITIES,                     "HE Capabilities (IEEE Std 802.11ax/D2.0)" },
720   { ETAG_HE_OPERATION,                        "HE Operation (IEEE Std 802.11ax/D2.0)" },
721   { ETAG_UORA_PARAMETER_SET,                  "UORA Parameter Set" },
722   { ETAG_MU_EDCA_PARAMETER_SET,               "MU EDCA Parameter Set" },
723   { ETAG_SPATIAL_REUSE_PARAMETER_SET,         "Spatial Reuse Parameter Set" },
724   { ETAG_NDP_FEEDBACK_REPORT_PARAMETER_SET,   "NDP Feedback Report Parameter Set" },
725   { ETAG_BSS_COLOR_CHANGE_ANNOUNCEMENT,       "BSS Color Change Announcement" },
726   { ETAG_QUIET_TIME_PERIOD_SETUP,             "Quiet Time Period Setup" },
727   { ETAG_ESS_REPORT,                          "ESS Report" },
728   { 0, NULL }
729 };
730 static value_string_ext tag_num_vals_eid_ext_ext = VALUE_STRING_EXT_INIT(tag_num_vals_eid_ext);
731
732 static const value_string wfa_subtype_vals[] = {
733   { WFA_SUBTYPE_P2P, "P2P" },
734   { WFA_SUBTYPE_HS20_INDICATION, "Hotspot 2.0 Indication" },
735   { WFA_SUBTYPE_HS20_ANQP, "Hotspot 2.0 ANQP" },
736   { WFA_SUBTYPE_DPP, "Device Provisioning Protocol" },
737   { WFA_SUBTYPE_IEEE1905_MULTI_AP, "IEEE1905 Multi-AP" },
738   { 0, NULL }
739 };
740
741 #define DPP_CONFIGURATION_PROTOCOL 0x01
742
743 static const value_string dpp_subtype_vals[] = {
744   { DPP_CONFIGURATION_PROTOCOL, "DPP Configuration Protocol" },
745   { 0, NULL }
746 };
747
748 /* ************************************************************************* */
749 /*              Supported Rates (7.3.2.2)                                    */
750 /* ************************************************************************* */
751
752 static const value_string ieee80211_supported_rates_vals[] = {
753   { 0x02, "1" },
754   { 0x03, "1.5" },
755   { 0x04, "2" },
756   { 0x05, "2.5" },
757   { 0x06, "3" },
758   { 0x09, "4.5" },
759   { 0x0B, "5.5" },
760   { 0x0C, "6" },
761   { 0x12, "9" },
762   { 0x16, "11" },
763   { 0x18, "12" },
764   { 0x1B, "13.5" },
765   { 0x24, "18" },
766   { 0x2C, "22" },
767   { 0x30, "24" },
768   { 0x36, "27" },
769   { 0x42, "33" },
770   { 0x48, "36" },
771   { 0x60, "48" },
772   { 0x6C, "54" },
773   { 0x82, "1(B)" },
774   { 0x83, "1.5(B)" },
775   { 0x84, "2(B)" },
776   { 0x85, "2.5(B)" },
777   { 0x86, "3(B)" },
778   { 0x89, "4.5(B)" },
779   { 0x8B, "5.5(B)" },
780   { 0x8C, "6(B)" },
781   { 0x92, "9(B)" },
782   { 0x96, "11(B)" },
783   { 0x98, "12(B)" },
784   { 0x9B, "13.5(B)" },
785   { 0xA4, "18(B)" },
786   { 0xAC, "22(B)" },
787   { 0xB0, "24(B)" },
788   { 0xB6, "27(B)" },
789   { 0xC2, "33(B)" },
790   { 0xC8, "36(B)" },
791   { 0xE0, "48(B)" },
792   { 0xEC, "54(B)" },
793   { 0xFF, "BSS requires support for mandatory features of HT PHY (IEEE 802.11 - Clause 20)" },
794   { 0,    NULL}
795 };
796 value_string_ext ieee80211_supported_rates_vals_ext = VALUE_STRING_EXT_INIT(ieee80211_supported_rates_vals);
797
798 /* ************************************************************************* */
799 /*                         8.4.1.7 Reason Code field                         */
800 /* ************************************************************************* */
801 static const value_string ieee80211_reason_code[] = {
802   {  1, "Unspecified reason" },
803   {  2, "Previous authentication no longer valid" },
804   {  3, "Deauthenticated because sending STA is leaving (or has left) IBSS or ESS" },
805   {  4, "Disassociated due to inactivity" },
806   {  5, "Disassociated because AP is unable to handle all currently associated STAs" },
807   {  6, "Class 2 frame received from nonauthenticated STA" },
808   {  7, "Class 3 frame received from nonassociated STA" },
809   {  8, "Disassociated because sending STA is leaving (or has left) BSS" },
810   {  9, "STA requesting (re)association is not authenticated with responding STA" },
811   { 10, "Disassociated because the information in the Power Capability element is unacceptable" },
812   { 11, "Disassociated because the information in the Supported Channels element is unacceptable" },
813   { 12, "Reserved" },
814   { 13, "Invalid information element, i.e., an information element defined in this standard for which the content does not meet the specifications in Clause 7" },
815   { 14, "Message integrity code (MIC) failure" },
816   { 15, "4-Way Handshake timeout" },
817   { 16, "Group Key Handshake timeout" },
818   { 17, "Information element in 4-Way Handshake different from (Re)Association Request/Probe Response/Beacon frame" },
819   { 18, "Invalid group cipher" },
820   { 19, "Invalid pairwise cipher" },
821   { 20, "Invalid AKMP" },
822   { 21, "Unsupported RSN information element version" },
823   { 22, "Invalid RSN information element capabilities" },
824   { 23, "IEEE 802.1X authentication failed" },
825   { 24, "Cipher suite rejected because of the security policy" },
826   { 25, "TDLS direct-link teardown due to TDLS peer STA unreachable via the TDLS direct link" },
827   { 26, "TDLS direct-link teardown for unspecified reason" },
828   { 27, "Disassociated because session terminated by SSP request" },
829   { 28, "Disassociated because of lack of SSP roaming agreement" },
830   { 29, "Requested service rejected because of SSP cipher suite or AKM requirement " },
831   { 30, "Requested service not authorized in this location" },
832   { 31, "TS deleted because QoS AP lacks sufficient bandwidth for this QoS STA due to a change in BSS service characteristics or operational mode" },
833   { 32, "Disassociated for unspecified, QoS-related reason" },
834   { 33, "Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA" },
835   { 34, "Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions" },
836   { 35, "Disassociated because STA is transmitting outside the limits of its TXOPs" },
837   { 36, "Requested from peer STA as the STA is leaving the BSS (or resetting)" },
838   { 37, "Requested from peer STA as it does not want to use the mechanism" },
839   { 38, "Requested from peer STA as the STA received frames using the mechanism for which a setup is required" },
840   { 39, "Requested from peer STA due to timeout" },
841   { 45, "Peer STA does not support the requested cipher suite" },
842   { 46, "Disassociated because authorized access limit reached" },
843   { 47, "Disassociated due to external service requirements" },
844   { 48, "Invalid FT Action frame count" },
845   { 49, "Invalid pairwise master key identifier (PMKI)" },
846   { 50, "Invalid MDE" },
847   { 51, "Invalid FTE" },
848   { 52, "SME cancels the mesh peering instance with the reason other than reaching the maximum number of peer mesh STAs" },
849   { 53, "The mesh STA has reached the supported maximum number of peer mesh STAs" },
850   { 54, "The received information violates the Mesh Configuration policy configured in the mesh STA profile" },
851   { 55, "The mesh STA has received a Mesh Peering Close message requesting to close the mesh peering" },
852   { 56, "The mesh STA has re-sent dot11MeshMaxRetries Mesh Peering Open messages, without receiving a Mesh Peering Confirm message" },
853   { 57, "The confirmTimer for the mesh peering instance times out" },
854   { 58, "The mesh STA fails to unwrap the GTK or the values in the wrapped contents do not match" },
855   { 59, "The mesh STA receives inconsistent information about the mesh parameters between Mesh Peering Management frames" },
856   { 60, "The mesh STA fails the authenticated mesh peering exchange because due to failure in selecting either the pairwise ciphersuite or group ciphersuite" },
857   { 61, "The mesh STA does not have proxy information for this external destination" },
858   { 62, "The mesh STA does not have forwarding information for this destination" },
859   { 63, "The mesh STA determines that the link to the next hop of an active path in its forwarding information is no longer usable" },
860   { 64, "The Deauthentication frame was sent because the MAC address of the STA already exists in the mesh BSS. See 11.3.3 (Additional mechanisms for an AP collocated with a mesh STA)" },
861   { 65, "The mesh STA performs channel switch to meet regulatory requirements" },
862   { 66, "The mesh STA performs channel switch with unspecified reason" },
863   { 0,    NULL}
864 };
865 static value_string_ext ieee80211_reason_code_ext = VALUE_STRING_EXT_INIT(ieee80211_reason_code);
866
867 /* ************************************************************************* */
868 /*                         8.4.1.9 Status Code field                         */
869 /* ************************************************************************* */
870 static const value_string ieee80211_status_code[] = {
871   {  0, "Successful" },
872   {  1, "Unspecified failure" },
873   {  2, "TDLS wakeup schedule rejected but alternative schedule provided" },
874   {  3, "TDLS wakeup schedule rejected" },
875   {  4, "Reserved" },
876   {  5, "Security disabled" },
877   {  6, "Unacceptable lifetime" },
878   {  7, "Not in same BSS" },
879   {  8, "Reserved" },
880   {  9, "Reserved" },
881   { 10, "Cannot support all requested capabilities in the Capability Information field" },
882   { 11, "Reassociation denied due to inability to confirm that association exists" },
883   { 12, "Association denied due to reason outside the scope of this standard" },
884   { 13, "Responding STA does not support the specified authentication algorithm" },
885   { 14, "Received an Authentication frame with authentication transaction sequence number out of expected sequence" },
886   { 15, "Authentication rejected because of challenge failure" },
887   { 16, "Authentication rejected due to timeout waiting for next frame in sequence" },
888   { 17, "Association denied because AP is unable to handle additional associated STAs" },
889   { 18, "Association denied due to requesting STA not supporting all of the data rates in the BSSBasicRateSet parameter" },
890   { 19, "Association denied due to requesting STA not supporting the short preamble option" },
891   { 20, "Association denied due to requesting STA not supporting the PBCC modulation option" },
892   { 21, "Association denied due to requesting STA not supporting the Channel Agility option" },
893   { 22, "Association request rejected because Spectrum Management capability is required" },
894   { 23, "Association request rejected because the information in the Power Capability element is unacceptable" },
895   { 24, "Association request rejected because the information in the Supported Channels element is unacceptable" },
896   { 25, "Association denied due to requesting STA not supporting the Short Slot Time option" },
897   { 26, "Association denied due to requesting STA not supporting the DSSS-OFDM option" },
898   { 27, "Reserved Association denied because the requesting STA does not support HT features" },
899   { 28, "R0KH unreachable" },
900   { 29, "Association denied because the requesting STA does not support the phased coexistence operation (PCO) transition time required by the AP" },
901   { 30, "Association request rejected temporarily; try again later" },
902   { 31, "Robust Management frame policy violation" },
903   { 32, "Unspecified, QoS-related failure" },
904   { 33, "Association denied because QoS AP or PCP has insufficient bandwidth to handle another QoS STA" },
905   { 34, "Association denied due to excessive frame loss rates and/or poor conditions on current operating channel" },
906   { 35, "Association (with QoS BSS) denied because the requesting STA does not support the QoS facility" },
907   { 36, "Reserved" },
908   { 37, "The request has been declined" },
909   { 38, "The request has not been successful as one or more parameters have invalid values" },
910   { 39, "The allocation or TS has not been created because the request cannot be honored; however, a suggested TSPEC/DMG TSPEC is provided so that the initiating STA may attempt to set another allocation or TS with the suggested changes to the TSPEC/DMG TSPEC" },
911   { 40, "Invalid information element, i.e., an information element defined in this standard for which the content does not meet the specifications in Clause 7" },
912   { 41, "Invalid group cipher" },
913   { 42, "Invalid pairwise cipher" },
914   { 43, "Invalid AKMP" },
915   { 44, "Unsupported RSN information element version" },
916   { 45, "Invalid RSN information element capabilities" },
917   { 46, "Cipher suite rejected because of security policy" },
918   { 47, "The TS per allocation has not been created; however, the PCP/HC may be capable of creating a TS or allocation, in response to a request, after the time indicated in the TS Delay element" },
919   { 48, "Direct link is not allowed in the BSS by policy" },
920   { 49, "The Destination STA is not present within this BSS" },
921   { 50, "The Destination STA is not a QoS STA" },
922   { 51, "Association denied because the ListenInterval is too large" },
923   { 52, "Invalid FT Action frame count" },
924   { 53, "Invalid pairwise master key identifier (PMKID)" },
925   { 54, "Invalid MDIE" },
926   { 55, "Invalid FTIE" },
927   { 56, "Requested TCLAS processing is not supported by the PCP/AP" },
928   { 57, "The PCP/AP has insufficient TCLAS processing resources to satisfy the request" },
929   { 58, "The TS has not been created because the request cannot be honored; however, the PCP/HC suggests the STA to transition to other BSSs to setup the TS" },
930   { 59, "GAS Advertisement Protocol not supported" },
931   { 60, "No outstanding GAS request" },
932   { 61, "GAS Response not received from the Advertisement Server" },
933   { 62, "STA timed out waiting for GAS Query Response" },
934   { 63, "GAS Response is larger than query response length limit" },
935   { 64, "Request refused because home network does not support request" },
936   { 65, "Advertisement Server in the network is not currently reachable" },
937   { 66, "Reserved" },
938   { 67, "Request refused due to permissions received via SSPN interface" },
939   { 68, "Request refused because PCP/AP does not support unauthenticated access" },
940   { 69, "Reserved" },
941   { 70, "Reserved" },
942   { 71, "Reserved" },
943   { 72, "Invalid contents of RSNIE" },
944   { 73, "U-APSD Coexistence is not supported" },
945   { 74, "Requested U-APSD Coexistence mode is not supported" },
946   { 75, "Requested Interval/Duration value cannot be supported with U-APSD Coexistence" },
947   { 76, "Authentication is rejected because an Anti-Clogging Token is required" },
948   { 77, "Authentication is rejected because the offered finite cyclic group is not supported" },
949   { 78, "The TBTT adjustment request has not been successful because the STA could not find an alternative TBTT" },
950   { 79, "Transmission failure" },
951   { 80, "Requested TCLAS Not Supported" },
952   { 81, "TCLAS Resources Exhausted" },
953   { 82, "Rejected with Suggested BSS Transition" },
954   { 83, "Reject with recommended schedule" },
955   { 84, "Reject because no wakeup schedule specified" },
956   { 85, "Success, the destination STA is in power save mode" },
957   { 86, "FST pending, in process of admitting FST session" },
958   { 87, "performing FST now" },
959   { 88, "FST pending, gap(s) in Block Ack window" },
960   { 89, "Reject because of U-PID setting" },
961   { 92, "(Re)association refused for some external reason" },
962   { 93, "(Re)association refused because of memory limits at the AP" },
963   { 94, "(Re)association refused because emergency services are not supported at the AP" },
964   { 95, "GAS query response not yet received" },
965   { 96, "Reject since the request is for transition to a frequency band subject to DSE procedures and FST initiator is a dependent STA" },
966   { 97, "Reserved" },
967   { 98, "Reserved" },
968   { 99, "The association has been denied; however, one or more Multi-band elements are included that can be used by the receiving STA to join the BSS" },
969   { 100, "The request failed due to a reservation conflict" },
970   { 101, "The request failed due to exceeded MAF limit" },
971   { 102, "The request failed due to exceeded MCCA track limit" },
972   { 103, "Association denied because the information in the Spectrum Management field is unacceptable" },
973   { 104, "Association denied because the requesting STA does not support VHT features" },
974   { 105, "Enablement denied" },
975   { 106, "Enablement denied due to restriction from an authorized GDB" },
976   { 107, "Authorization deenabled" },
977   { 0,    NULL}
978 };
979 static value_string_ext ieee80211_status_code_ext = VALUE_STRING_EXT_INIT(ieee80211_status_code);
980
981 static const value_string ieee80211_transition_reasons[] = {
982   { 0, "Unspecified" },
983   { 1, "Excessive frame loss rates and/or poor conditions" },
984   { 2, "Excessive delay for current traffic streams" },
985   { 3, "Insufficient QoS capacity for current traffic streams (TSPEC rejected)" },
986   { 4, "First association to ESS (the association initiated by an Association Request frame instead of a Reassociation Request frame)" },
987   { 5, "Load balancing" },
988   { 6, "Better AP found" },
989   { 7, "Deauthenticated or Disassociated from the previous AP" },
990   { 8, "AP failed IEEE 802.1X EAP Authentication" },
991   { 9, "AP failed 4-way handshake" },
992   { 10, "Received too many replay counter failures" },
993   { 11, "Received too many data MIC failures" },
994   { 12, "Exceeded maximum number of retransmissions" },
995   { 13, "Received too many broadcast disassociations" },
996   { 14, "Received too many broadcast deauthentications" },
997   { 15, "Previous transition failed" },
998   { 16, "Low RSSI" },
999   { 17, "Roam from a non-IEEE-802.11 system" },
1000   { 18, "Transition due to received BSS Transition Request frame" },
1001   { 19, "Preferred BSS transition candidate list included" },
1002   { 20, "Leaving ESS" },
1003   { 0,    NULL}
1004 };
1005 /* ************************************************************************* */
1006 /*                         Frame types, and their names                      */
1007 /* ************************************************************************* */
1008 static const value_string frame_type_subtype_vals[] = {
1009   {MGT_ASSOC_REQ,             "Association Request"},
1010   {MGT_ASSOC_RESP,            "Association Response"},
1011   {MGT_REASSOC_REQ,           "Reassociation Request"},
1012   {MGT_REASSOC_RESP,          "Reassociation Response"},
1013   {MGT_PROBE_REQ,             "Probe Request"},
1014   {MGT_PROBE_RESP,            "Probe Response"},
1015   {MGT_MEASUREMENT_PILOT,     "Measurement Pilot"},
1016   {MGT_BEACON,                "Beacon frame"},
1017   {MGT_ATIM,                  "ATIM"},
1018   {MGT_DISASS,                "Disassociate"},
1019   {MGT_AUTHENTICATION,        "Authentication"},
1020   {MGT_DEAUTHENTICATION,      "Deauthentication"},
1021   {MGT_ACTION,                "Action"},
1022   {MGT_ACTION_NO_ACK,         "Action No Ack"},
1023   {MGT_ARUBA_WLAN,            "Aruba Management"},
1024
1025   {CTRL_TRIGGER,              "Trigger"},
1026   {CTRL_BEAMFORM_RPT_POLL,    "Beamforming Report Poll"},
1027   {CTRL_VHT_NDP_ANNC,         "VHT NDP Announcement"},
1028   {CTRL_CONTROL_WRAPPER,      "Control Wrapper"},
1029   {CTRL_BLOCK_ACK_REQ,        "802.11 Block Ack Req"},
1030   {CTRL_BLOCK_ACK,            "802.11 Block Ack"},
1031   {CTRL_PS_POLL,              "Power-Save poll"},
1032   {CTRL_RTS,                  "Request-to-send"},
1033   {CTRL_CTS,                  "Clear-to-send"},
1034   {CTRL_ACKNOWLEDGEMENT,      "Acknowledgement"},
1035   {CTRL_CFP_END,              "CF-End (Control-frame)"},
1036   {CTRL_CFP_ENDACK,           "CF-End + CF-Ack (Control-frame)"},
1037
1038   {DATA,                      "Data"},
1039   {DATA_CF_ACK,               "Data + CF-Ack"},
1040   {DATA_CF_POLL,              "Data + CF-Poll"},
1041   {DATA_CF_ACK_POLL,          "Data + CF-Ack + CF-Poll"},
1042   {DATA_NULL_FUNCTION,        "Null function (No data)"},
1043   {DATA_CF_ACK_NOD,           "Acknowledgement (No data)"},
1044   {DATA_CF_POLL_NOD,          "CF-Poll (No data)"},
1045   {DATA_CF_ACK_POLL_NOD,      "CF-Ack/Poll (No data)"},
1046   {DATA_QOS_DATA,             "QoS Data"},
1047   {DATA_QOS_DATA_CF_ACK,      "QoS Data + CF-Acknowledgment"},
1048   {DATA_QOS_DATA_CF_POLL,     "QoS Data + CF-Poll"},
1049   {DATA_QOS_DATA_CF_ACK_POLL, "QoS Data + CF-Ack + CF-Poll"},
1050   {DATA_QOS_NULL,             "QoS Null function (No data)"},
1051   {DATA_QOS_CF_POLL_NOD,      "QoS CF-Poll (No Data)"},
1052   {DATA_QOS_CF_ACK_POLL_NOD,  "QoS CF-Ack + CF-Poll (No data)"},
1053
1054   {EXTENSION_DMG_BEACON,      "DMG Beacon"},
1055
1056   {CTRL_POLL,                 "Poll"},
1057   {CTRL_SPR,                  "Service Period Request"},
1058   {CTRL_GRANT,                "Grant"},
1059   {CTRL_DMG_CTS,              "DMG Clear-to-send"},
1060   {CTRL_DMG_DTS,              "DMG Denial-to-send"},
1061   {CTRL_GRANT_ACK,            "Grant Acknowledgment"},
1062   {CTRL_SSW,                  "Sector Sweep"},
1063   {CTRL_SSW_FEEDBACK,         "Sector Sweep Feedback"},
1064   {CTRL_SSW_ACK,              "Sector Sweep Acknowledgment"},
1065
1066   {0,                         NULL}
1067 };
1068 static value_string_ext frame_type_subtype_vals_ext = VALUE_STRING_EXT_INIT(frame_type_subtype_vals);
1069
1070 /* ************************************************************************* */
1071 /*                 802.1D Tag Name (by WME Access Category Names)            */
1072 /* ************************************************************************* */
1073 static const value_string ieee80211_qos_tags_acs[] = {
1074   { 0, "Best Effort (Best Effort)" },
1075   { 1, "Background (Background)" },
1076   { 2, "Spare (Background)" },
1077   { 3, "Excellent Effort (Best Effort)" },
1078   { 4, "Controlled Load (Video)" },
1079   { 5, "Video (Video)" },
1080   { 6, "Voice (Voice)" },
1081   { 7, "Network Control (Voice)" },
1082   { 0, NULL }
1083 };
1084
1085 /* ************************************************************************* */
1086 /*                   WME Access Category Names (by WME ACI)                  */
1087 /* ************************************************************************* */
1088 static const value_string wme_acs[] = {
1089   { 0, "Best Effort" },
1090   { 1, "Background" },
1091   { 2, "Video" },
1092   { 3, "Voice" },
1093   { 0, NULL }
1094 };
1095
1096 /* ************************************************************************* */
1097 /*                  Aruba Management Type                                    */
1098 /* ************************************************************************* */
1099 static const value_string aruba_mgt_typevals[] = {
1100   { 0x0001,       "Hello" },
1101   { 0x0002,       "Probe" },
1102   { 0x0003,       "MTU" },
1103   { 0x0004,       "Ageout" },
1104   { 0x0005,       "Heartbeat" },
1105   { 0x0006,       "Deauth" },
1106   { 0x0007,       "Disassoc" },
1107   { 0x0008,       "Probe response" },
1108   { 0x0009,       "Tunnel update" },
1109   { 0x000A,       "Laser beam active" },
1110   { 0x000B,       "Client IP" },
1111   { 0x000C,       "Laser beam active v2" },
1112   { 0x000D,       "AP statistics" },
1113   { 0,            NULL }
1114 };
1115 static value_string_ext aruba_mgt_typevals_ext = VALUE_STRING_EXT_INIT(aruba_mgt_typevals);
1116
1117 /*** Begin: Action Fixed Parameter ***/
1118 #define CAT_SPECTRUM_MGMT          0
1119 #define CAT_QOS                    1
1120 #define CAT_DLS                    2
1121 #define CAT_BLOCK_ACK              3
1122 #define CAT_PUBLIC                 4
1123 #define CAT_RADIO_MEASUREMENT      5
1124 #define CAT_FAST_BSS_TRANSITION    6
1125 #define CAT_HT                     7
1126 #define CAT_SA_QUERY               8
1127 #define CAT_PUBLIC_PROTECTED       9
1128 #define CAT_WNM                   10
1129 #define CAT_UNPROTECTED_WNM       11
1130 #define CAT_TDLS                  12
1131 #define CAT_MESH                  13
1132 #define CAT_MULTIHOP              14
1133 #define CAT_SELF_PROTECTED        15
1134 #define CAT_DMG                   16
1135 #define CAT_MGMT_NOTIFICATION     17
1136 #define CAT_FAST_SESSION_TRANSFER 18
1137 #define CAT_ROBUST_AV_STREAMING   19
1138 #define CAT_UNPROTECTED_DMG       20
1139 #define CAT_VHT                   21
1140 #define CAT_HE                    30
1141 #define CAT_PROTECTED_HE          31
1142 #define CAT_VENDOR_SPECIFIC_PROTECTED 126
1143 #define CAT_VENDOR_SPECIFIC     127
1144
1145 #define CAT_MESH_LINK_METRIC               31
1146 #define CAT_MESH_PATH_SELECTION            32
1147 #define CAT_MESH_INTERWORKING              33
1148 #define CAT_MESH_RESOURCE_COORDINATION     34
1149 #define CAT_MESH_SECURITY_ARCHITECTURE     35
1150
1151 #define SM_ACTION_MEASUREMENT_REQUEST   0
1152 #define SM_ACTION_MEASUREMENT_REPORT    1
1153 #define SM_ACTION_TPC_REQUEST           2
1154 #define SM_ACTION_TPC_REPORT            3
1155 #define SM_ACTION_CHAN_SWITCH_ANNC      4
1156 #define SM_ACTION_EXT_CHAN_SWITCH_ANNC  5
1157
1158 #define QOS_ACTION_ADDTS_REQUEST     0
1159 #define QOS_ACTION_ADDTS_RESPONSE    1
1160 #define QOS_ACTION_DELTS             2
1161 #define QOS_ACTION_SCHEDULE      3
1162 #define QOS_ACTION_MAP_CONFIGURE 4
1163
1164 #define DLS_ACTION_REQUEST       0
1165 #define DLS_ACTION_RESPONSE      1
1166 #define DLS_ACTION_TEARDOWN      2
1167
1168 #define BA_ADD_BLOCK_ACK_REQUEST    0
1169 #define BA_ADD_BLOCK_ACK_RESPONSE   1
1170 #define BA_DELETE_BLOCK_ACK         2
1171
1172 /* Keep in sync with PPA_* defines */
1173 #define PA_20_40_BSS_COEXISTENCE_MANAGEMENT 0
1174 #define PA_DSE_ENABLEMENT                   1
1175 #define PA_DSE_DEENABLEMENT                 2
1176 #define PA_DSE_REG_LOC_ANNOUNCEMENT         3
1177 #define PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT  4
1178 #define PA_DSE_MEASUREMENT_REQUEST          5
1179 #define PA_DSE_MEASUREMENT_REPORT           6
1180 #define PA_MEASUREMENT_PILOT                7
1181 #define PA_DSE_POWER_CONSTRAINT             8
1182 #define PA_VENDOR_SPECIFIC                  9
1183 #define PA_GAS_INITIAL_REQUEST             10
1184 #define PA_GAS_INITIAL_RESPONSE            11
1185 #define PA_GAS_COMEBACK_REQUEST            12
1186 #define PA_GAS_COMEBACK_RESPONSE           13
1187 #define PA_TDLS_DISCOVERY_RESPONSE         14
1188 #define PA_LOCATION_TRACK_NOTIFICATION     15
1189 #define PA_QAB_REQUEST                     16
1190 #define PA_QAB_RESPONSE                    17
1191
1192 /* Keep in sync with PA_* defines */
1193 #define PPA_DSE_ENABLEMENT                   1
1194 #define PPA_DSE_DEENABLEMENT                 2
1195 #define PPA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT  4
1196 #define PPA_DSE_MEASUREMENT_REQUEST          5
1197 #define PPA_DSE_MEASUREMENT_REPORT           6
1198 #define PPA_DSE_POWER_CONSTRAINT             8
1199 #define PPA_VENDOR_SPECIFIC                  9
1200 #define PPA_GAS_INITIAL_REQUEST             10
1201 #define PPA_GAS_INITIAL_RESPONSE            11
1202 #define PPA_GAS_COMEBACK_REQUEST            12
1203 #define PPA_GAS_COMEBACK_RESPONSE           13
1204 #define PPA_QAB_REQUEST                     16
1205 #define PPA_QAB_RESPONSE                    17
1206
1207 #define HT_ACTION_NOTIFY_CHAN_WIDTH           0
1208 #define HT_ACTION_SM_PWR_SAVE                 1
1209 #define HT_ACTION_PSMP_ACTION                 2
1210 #define HT_ACTION_SET_PCO_PHASE               3
1211 #define HT_ACTION_MIMO_CSI                    4
1212 #define HT_ACTION_MIMO_BEAMFORMING            5
1213 #define HT_ACTION_MIMO_COMPRESSED_BEAMFORMING 6
1214 #define HT_ACTION_ANT_SEL_FEEDBACK            7
1215 #define HT_ACTION_HT_INFO_EXCHANGE            8
1216
1217 #define DMG_ACTION_PWR_SAVE_CONFIG_REQ           0
1218 #define DMG_ACTION_PWR_SAVE_CONFIG_RES           1
1219 #define DMG_ACTION_INFO_REQ                      2
1220 #define DMG_ACTION_INFO_RES                      3
1221 #define DMG_ACTION_HANDOVER_REQ                  4
1222 #define DMG_ACTION_HANDOVER_RES                  5
1223 #define DMG_ACTION_DTP_REQ                       6
1224 #define DMG_ACTION_DTP_RES                       7
1225 #define DMG_ACTION_RELAY_SEARCH_REQ              8
1226 #define DMG_ACTION_RELAY_SEARCH_RES              9
1227 #define DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ 10
1228 #define DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES 11
1229 #define DMG_ACTION_RLS_REQ                       12
1230 #define DMG_ACTION_RLS_RES                       13
1231 #define DMG_ACTION_RLS_ANNOUNCE                  14
1232 #define DMG_ACTION_RLS_TEARDOWN                  15
1233 #define DMG_ACTION_RELAY_ACK_REQ                 16
1234 #define DMG_ACTION_RELAY_ACK_RES                 17
1235 #define DMG_ACTION_TPA_REQ                       18
1236 #define DMG_ACTION_TPA_RES                       19
1237 #define DMG_ACTION_TPA_REP                       20
1238 #define DMG_ACTION_ROC_REQ                       21
1239 #define DMG_ACTION_ROC_RES                       22
1240
1241 #define UNPROTECTED_DMG_ANNOUNCE                 0
1242 #define UNPROTECTED_DMG_BRP                      1
1243
1244 #define FST_SETUP_REQUEST                        0
1245 #define FST_SETUP_RESPONSE                       1
1246 #define FST_TEAR_DOWN                            2
1247 #define FST_ACK_REQUEST                          3
1248 #define FST_ACK_RESPONSE                         4
1249 #define FST_ON_CHANNEL_TUNNEL_REQUEST            5
1250
1251 /* IEEE Std 802.11r-2008, 7.4.8, Table 7-57g */
1252 #define FT_ACTION_REQUEST               1
1253 #define FT_ACTION_RESPONSE              2
1254 #define FT_ACTION_CONFIRM               3
1255 #define FT_ACTION_ACK                   4
1256
1257 /* SA Query Action frame codes (IEEE 802.11w-2009, 7.4.9) */
1258 #define SA_QUERY_REQUEST                0
1259 #define SA_QUERY_RESPONSE               1
1260
1261 /* IEEE Std 802.11z-2010, 7.4.11, Table 7-57v1 */
1262 #define TDLS_SETUP_REQUEST              0
1263 #define TDLS_SETUP_RESPONSE             1
1264 #define TDLS_SETUP_CONFIRM              2
1265 #define TDLS_TEARDOWN                   3
1266 #define TDLS_PEER_TRAFFIC_INDICATION    4
1267 #define TDLS_CHANNEL_SWITCH_REQUEST     5
1268 #define TDLS_CHANNEL_SWITCH_RESPONSE    6
1269 #define TDLS_PEER_PSM_REQUEST           7
1270 #define TDLS_PEER_PSM_RESPONSE          8
1271 #define TDLS_PEER_TRAFFIC_RESPONSE      9
1272 #define TDLS_DISCOVERY_REQUEST          10
1273
1274 /* IEEE Std 802.11-2012, 8.5.7.1, Table 8-206 */
1275 #define RM_ACTION_RADIO_MEASUREMENT_REQUEST         0
1276 #define RM_ACTION_RADIO_MEASUREMENT_REPORT          1
1277 #define RM_ACTION_LINK_MEASUREMENT_REQUEST          2
1278 #define RM_ACTION_LINK_MEASUREMENT_REPORT           3
1279 #define RM_ACTION_NEIGHBOR_REPORT_REQUEST           4
1280 #define RM_ACTION_NEIGHBOR_REPORT_RESPONSE          5
1281
1282 /* 11s draft 12.0, table 7-57v30 */
1283 #define MESH_ACTION_LINK_METRIC_REPORT              0
1284 #define MESH_ACTION_HWMP                            1
1285 #define MESH_ACTION_GATE_ANNOUNCE                   2
1286 #define MESH_ACTION_CONGESTION_CTL                  3
1287 #define MESH_ACTION_MCCA_SETUP_REQUEST              4
1288 #define MESH_ACTION_MCCA_SETUP_REPLY                5
1289 #define MESH_ACTION_MCCA_ADV_REQUEST                6
1290 #define MESH_ACTION_MCCA_ADV                        7
1291 #define MESH_ACTION_MCCA_TEARDOWN                   8
1292 #define MESH_ACTION_TBTT_ADJ_REQUEST                9
1293 #define MESH_ACTION_TBTT_ADJ_RESPONSE              10
1294
1295 /* 11s draft 12.0, table 7-57v42: Multihop Action field values */
1296 #define MULTIHOP_ACTION_PROXY_UPDATE                0
1297 #define MULTIHOP_ACTION_PROXY_UPDATE_CONF           1
1298
1299 /* 11s draft 12.0, table 7-57v24: Self-protected Action field values */
1300 #define SELFPROT_ACTION_MESH_PEERING_OPEN           1
1301 #define SELFPROT_ACTION_MESH_PEERING_CONFIRM        2
1302 #define SELFPROT_ACTION_MESH_PEERING_CLOSE          3
1303 #define SELFPROT_ACTION_MESH_GROUP_KEY_INFORM       4
1304 #define SELFPROT_ACTION_MESH_GROUP_KEY_ACK          5
1305
1306 /* 11s draft 12.0, table 7-43bj6: Mesh Peering Protocol Identifier field values */
1307 #define MESH_PEERING_PROTO_MGMT                     0
1308 #define MESH_PEERING_PROTO_AMPE                     1
1309 #define MESH_PEERING_PROTO_VENDOR                 255
1310
1311 /* Vendor actions */
1312 /* MARVELL */
1313 #define MRVL_ACTION_MESH_MANAGEMENT     1
1314
1315 #define MRVL_MESH_MGMT_ACTION_RREQ      0
1316 #define MRVL_MESH_MGMT_ACTION_RREP      1
1317 #define MRVL_MESH_MGMT_ACTION_RERR      2
1318 #define MRVL_MESH_MGMT_ACTION_PLDM      3
1319
1320 #define ANQP_INFO_ANQP_QUERY_LIST                256
1321 #define ANQP_INFO_ANQP_CAPAB_LIST                257
1322 #define ANQP_INFO_VENUE_NAME_INFO                258
1323 #define ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO     259
1324 #define ANQP_INFO_NETWORK_AUTH_TYPE_INFO         260
1325 #define ANQP_INFO_ROAMING_CONSORTIUM_LIST        261
1326 #define ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO 262
1327 #define ANQP_INFO_NAI_REALM_LIST                 263
1328 #define ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO     264
1329 #define ANQP_INFO_AP_GEOSPATIAL_LOCATION         265
1330 #define ANQP_INFO_AP_CIVIC_LOCATION              266
1331 #define ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI      267
1332 #define ANQP_INFO_DOMAIN_NAME_LIST               268
1333 #define ANQP_INFO_EMERGENCY_ALERT_ID_URI         269
1334 #define ANQP_INFO_TDLS_CAPAB_INFO                270
1335 #define ANQP_INFO_EMERGENCY_NAI                  271
1336 #define ANQP_INFO_NEIGHBOR_REPORT                272
1337 #define ANQP_INFO_VENUE_URL                      277
1338 #define ANQP_INFO_ADVICE_OF_CHARGE               278
1339 #define ANQP_INFO_LOCAL_CONTENT                  279
1340 #define ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST    56797
1341
1342 /* ANQP information ID - IEEE Std 802.11u-2011 - Table 7-43bk */
1343 static const value_string anqp_info_id_vals[] = {
1344   {ANQP_INFO_ANQP_QUERY_LIST, "ANQP Query list"},
1345   {ANQP_INFO_ANQP_CAPAB_LIST, "ANQP Capability list"},
1346   {ANQP_INFO_VENUE_NAME_INFO, "Venue Name information"},
1347   {ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO, "Emergency Call Number information"},
1348   {ANQP_INFO_NETWORK_AUTH_TYPE_INFO,
1349    "Network Authentication Type information"},
1350   {ANQP_INFO_ROAMING_CONSORTIUM_LIST, "Roaming Consortium list"},
1351   {ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO,
1352    "IP Address Type Availability information"},
1353   {ANQP_INFO_NAI_REALM_LIST, "NAI Realm list"},
1354   {ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO, "3GPP Cellular Network information"},
1355   {ANQP_INFO_AP_GEOSPATIAL_LOCATION, "AP Geospatial Location"},
1356   {ANQP_INFO_AP_CIVIC_LOCATION, "AP Civic Location"},
1357   {ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI, "AP Location Public Identifier URI"},
1358   {ANQP_INFO_DOMAIN_NAME_LIST, "Domain Name list"},
1359   {ANQP_INFO_EMERGENCY_ALERT_ID_URI, "Emergency Alert Identifier URI"},
1360   {ANQP_INFO_TDLS_CAPAB_INFO, "TDLS Capability information"},
1361   {ANQP_INFO_EMERGENCY_NAI, "Emergency NAI"},
1362   {ANQP_INFO_NEIGHBOR_REPORT, "Neighbor Report"},
1363   {ANQP_INFO_VENUE_URL, "Venue URL"},
1364   {ANQP_INFO_ADVICE_OF_CHARGE, "Advice of Charge"},
1365   {ANQP_INFO_LOCAL_CONTENT, "Local Content"},
1366   {ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST, "ANQP vendor-specific list"},
1367   {0, NULL}
1368 };
1369 static value_string_ext anqp_info_id_vals_ext = VALUE_STRING_EXT_INIT(anqp_info_id_vals);
1370
1371 /* IEEE 802.11v - WNM Action field values */
1372 enum wnm_action {
1373   WNM_EVENT_REQ = 0,
1374   WNM_EVENT_REPORT = 1,
1375   WNM_DIAGNOSTIC_REQ = 2,
1376   WNM_DIAGNOSTIC_REPORT = 3,
1377   WNM_LOCATION_CFG_REQ = 4,
1378   WNM_LOCATION_CFG_RESP = 5,
1379   WNM_BSS_TRANS_MGMT_QUERY = 6,
1380   WNM_BSS_TRANS_MGMT_REQ = 7,
1381   WNM_BSS_TRANS_MGMT_RESP = 8,
1382   WNM_FMS_REQ = 9,
1383   WNM_FMS_RESP = 10,
1384   WNM_COLLOCATED_INTERFERENCE_REQ = 11,
1385   WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
1386   WNM_TFS_REQ = 13,
1387   WNM_TFS_RESP = 14,
1388   WNM_TFS_NOTIFY = 15,
1389   WNM_SLEEP_MODE_REQ = 16,
1390   WNM_SLEEP_MODE_RESP = 17,
1391   WNM_TIM_BROADCAST_REQ = 18,
1392   WNM_TIM_BROADCAST_RESP = 19,
1393   WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
1394   WNM_CHANNEL_USAGE_REQ = 21,
1395   WNM_CHANNEL_USAGE_RESP = 22,
1396   WNM_DMS_REQ = 23,
1397   WNM_DMS_RESP = 24,
1398   WNM_TIMING_MEASUREMENT_REQ = 25,
1399   WNM_NOTIFICATION_REQ = 26,
1400   WNM_NOTIFICATION_RESP = 27
1401 };
1402
1403 static const value_string wnm_action_codes[] = {
1404   { WNM_EVENT_REQ, "Event Request" },
1405   { WNM_EVENT_REPORT, "Event Report" },
1406   { WNM_DIAGNOSTIC_REQ, "Diagnostic Request" },
1407   { WNM_DIAGNOSTIC_REPORT, "Diagnostic Report" },
1408   { WNM_LOCATION_CFG_REQ, "Location Configuration Request" },
1409   { WNM_LOCATION_CFG_RESP, "Location Configuration Response" },
1410   { WNM_BSS_TRANS_MGMT_QUERY, "BSS Transition Management Query" },
1411   { WNM_BSS_TRANS_MGMT_REQ, "BSS Transition Management Request" },
1412   { WNM_BSS_TRANS_MGMT_RESP, "BSS Transition Management Response" },
1413   { WNM_FMS_REQ, "FMS Request" },
1414   { WNM_FMS_RESP, "FMS Response" },
1415   { WNM_COLLOCATED_INTERFERENCE_REQ, "Collocated Interference Request" },
1416   { WNM_COLLOCATED_INTERFERENCE_REPORT, "Collocated Interference Report" },
1417   { WNM_TFS_REQ, "TFS Request" },
1418   { WNM_TFS_RESP, "TFS Response" },
1419   { WNM_TFS_NOTIFY, "TFS Notify" },
1420   { WNM_SLEEP_MODE_REQ, "WNM-Sleep Mode Request" },
1421   { WNM_SLEEP_MODE_RESP, "WNM-Sleep Mode Response" },
1422   { WNM_TIM_BROADCAST_REQ, "TIM Broadcast Request" },
1423   { WNM_TIM_BROADCAST_RESP, "TIM Broadcast Response" },
1424   { WNM_QOS_TRAFFIC_CAPAB_UPDATE, "QoS Traffic Capability Update" },
1425   { WNM_CHANNEL_USAGE_REQ, "Channel Usage Request" },
1426   { WNM_CHANNEL_USAGE_RESP, "Channel Usage Response" },
1427   { WNM_DMS_REQ, "DMS Request" },
1428   { WNM_DMS_RESP, "DMS Response" },
1429   { WNM_TIMING_MEASUREMENT_REQ, "Timing Measurement Request" },
1430   { WNM_NOTIFICATION_REQ, "WNM-Notification Request" },
1431   { WNM_NOTIFICATION_RESP, "WNM-Notification Response" },
1432   { 0, NULL }
1433 };
1434 static value_string_ext wnm_action_codes_ext = VALUE_STRING_EXT_INIT(wnm_action_codes);
1435
1436 enum unprotected_wnm_action {
1437   UNPROTECTED_WNM_TIM = 0,
1438   UNPROTECTED_WNM_TIMING_MEASUREMENT = 1
1439 };
1440
1441 static const value_string unprotected_wnm_action_codes[] = {
1442   { UNPROTECTED_WNM_TIM, "TIM" },
1443   { UNPROTECTED_WNM_TIMING_MEASUREMENT, "Timing Measurement" },
1444   { 0, NULL }
1445 };
1446 static value_string_ext unprotected_wnm_action_codes_ext = VALUE_STRING_EXT_INIT(unprotected_wnm_action_codes);
1447
1448 static const value_string wnm_notification_types[] = {
1449   { 0, "Firmware Update Notification" },
1450   { 1, "Reserved for use by WFA" },
1451   { 221, "Vendor Specific" },
1452   { 0, NULL }
1453 };
1454
1455 static value_string_ext wnm_notification_types_ext =
1456   VALUE_STRING_EXT_INIT(wnm_notification_types);
1457
1458 /*** End: Action Fixed Parameter ***/
1459
1460 static const value_string ieee80211_tag_measure_request_type_flags[] = {
1461   {0x00, "Basic Request"},
1462   {0x01, "Clear Channel Assessment (CCA) Request"},
1463   {0x02, "Receive Power Indication (RPI) Histogram Request"},
1464   {0x03, "Channel Load Request"},
1465   {0x04, "Noise Histogram Request"},
1466   {0x05, "Beacon Request"},
1467   {0x06, "Frame Request"},
1468   {0x07, "STA Statistics Request"},
1469   {0x08, "Location Configuration Indication (LCI) Request"},
1470   {0x09, "Transmit Stream Measurement Request"},
1471   {0x0A, "Measurement Pause Request"},
1472   {0x00, NULL}
1473 };
1474 static value_string_ext ieee80211_tag_measure_request_type_flags_ext =
1475   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_type_flags);
1476
1477 static const value_string ieee80211_tag_measure_report_type_flags[] = {
1478   { 0x00, "Basic Report" },
1479   { 0x01, "Clear Channel Assessment (CCA) Report" },
1480   { 0x02, "Receive Power Indication (RPI) Histogram Report" },
1481   { 0x03, "Channel Load Report" },
1482   { 0x04, "Noise Histogram Report" },
1483   { 0x05, "Beacon Report" },
1484   { 0x06, "Frame Report" },
1485   { 0x07, "STA Statistics Report" },
1486   { 0x08, "Location Configuration Information (LCI) Report" },
1487   { 0x09, "Transmit Stream Measurement Report" },
1488   { 0x00, NULL }
1489 };
1490 static value_string_ext ieee80211_tag_measure_report_type_flags_ext =
1491   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_report_type_flags);
1492
1493 static const true_false_string ieee80211_tag_measure_report_frame_info_frame_type_flag = {
1494   "Measurement Pilot Frame",
1495   "Beacon/Probe Response Frame"
1496 };
1497
1498 static const true_false_string ieee80211_tag_measure_map_field_bss_flag = {
1499   "At least one MPDU was received by another BSS or IBSS in the measurement period.",
1500   "No MPDUs were received from another BSS or IBSS in the measurement period."
1501 };
1502
1503 static const value_string ieee80211_tag_measure_request_measurement_mode_flags[] = {
1504   { 0x00, "Passive" },
1505   { 0x01, "Active" },
1506   { 0x02, "Beacon Table" },
1507   { 0x00, NULL }
1508 };
1509
1510 #define MEASURE_REQ_BEACON_SUB_SSID 0
1511 #define MEASURE_REQ_BEACON_SUB_BRI 1
1512 #define MEASURE_REQ_BEACON_SUB_RD 2
1513 #define MEASURE_REQ_BEACON_SUB_REQUEST 10
1514 #define MEASURE_REQ_BEACON_SUB_APCP 51
1515 #define MEASURE_REQ_BEACON_SUB_VS 221
1516
1517 static const value_string ieee80211_tag_measure_request_beacon_sub_id_flags[] = {
1518   { MEASURE_REQ_BEACON_SUB_SSID, "SSID" },
1519   { MEASURE_REQ_BEACON_SUB_BRI, "Beacon Reporting Information" },
1520   { MEASURE_REQ_BEACON_SUB_RD, "Reporting Detail" },
1521   { MEASURE_REQ_BEACON_SUB_REQUEST, "Request" },
1522   { MEASURE_REQ_BEACON_SUB_APCP, "AP Channel Report" },
1523   { MEASURE_REQ_BEACON_SUB_VS, "Vendor Specific" },
1524   { 0x00, NULL}
1525 };
1526
1527 static const value_string ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags[] = {
1528   { 0x00, "Report to be issued after each measurement." },
1529   { 0x01, "The measured RCPI level is greater than an absolute threshold." },
1530   { 0x02, "The measured RCPI level is less than an absolute threshold." },
1531   { 0x03, "The measured RSNI level is greater than an absolute threshold." },
1532   { 0x04, "The measured RSNI level is less than an absolute threshold." },
1533   { 0x05, "The measured RCPI level is greater than a threshold defined by an offset from the serving AP's reference RCPI." },
1534   { 0x06, "The measured RCPI level is less than a threshold defined by an offset from the serving AP's reference RCPI." },
1535   { 0x07, "The measured RSNI level is greater than a threshold defined by an offset from the serving AP's reference RSNI." },
1536   { 0x08, "The measured RSNI level is less than a threshold defined by an offset from the serving AP's reference RSNI." },
1537   { 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." },
1538   { 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." },
1539   { 0xfe, "Report not required to be issued" },
1540   { 0x00, NULL }
1541 };
1542
1543 static const value_string ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags[] = {
1544   { 0, "No fixed length fields or elements" },
1545   { 1, "All fixed length fields and any requested elements in the Request information element if present" },
1546   { 2, "All fixed length fields and elements (default, used when Reporting Detail subelement is not included in Beacon Request" },
1547   { 0x00, NULL }
1548 };
1549
1550 static const value_string ieee80211_tag_measure_request_group_id_flags[] = {
1551   { 0x00, "STA Counters from dot11CountersTable" },
1552   { 0x01, "STA Counters from dot11MacStatistics group" },
1553   { 0x02, "QoS STA Counters for UP0 from dot11QosCountersTable" },
1554   { 0x03, "QoS STA Counters for UP1 from dot11QosCountersTable" },
1555   { 0x04, "QoS STA Counters for UP2 from dot11QosCountersTable" },
1556   { 0x05, "QoS STA Counters for UP3 from dot11QosCountersTable" },
1557   { 0x06, "QoS STA Counters for UP4 from dot11QosCountersTable" },
1558   { 0x07, "QoS STA Counters for UP5 from dot11QosCountersTable" },
1559   { 0x08, "QoS STA Counters for UP6 from dot11QosCountersTable" },
1560   { 0x09, "QoS STA Counters for UP7 from dot11QosCountersTable" },
1561   { 0x0a, "BSS Average Access Delays" },
1562   { 0x0b, "STA Counters from dot11A-MSDU Group" },
1563   { 0x0c, "STA Counters from dot11A-MPDU Group" },
1564   { 0x0d, "STA Counters from dot11 BAR, Channel Width, PSMP Group" },
1565   { 0x0e, "STA Counters from dot11Protection Group" },
1566   { 0x0f, "STBC Group" },
1567   { 0x00, NULL }
1568 };
1569 static value_string_ext ieee80211_tag_measure_request_group_id_flags_ext =
1570   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_group_id_flags);
1571
1572 static const value_string ieee80211_tclas_process_flag[] = {
1573   {0x00, "Incoming MSDU's higher layer parameters have to match to the parameters in all associated TCLAS elements."},
1574   {0x01, "Incoming MSDU's higher layer parameters have to match to at least one of the associated TCLAS elements."},
1575   {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."},
1576   {0, NULL}
1577 };
1578
1579
1580 #define MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO 1
1581
1582 static const value_string ieee80211_tag_measure_request_channel_load_sub_id_vals[] = {
1583   { MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO, "Channel Load Reporting Information" },
1584   { 221, "Vendor Specific" },
1585   { 0x00, NULL}
1586 };
1587
1588 static const value_string ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals[] = {
1589   { 0x00, "Report to be issued after each measurement (default, used when Channel Load Reporting Information subelement is not included in Channel Load Request)." },
1590   { 0x01, "Report to be issued when measured Channel Load is equal to or greater than the reference value." },
1591   { 0x02, "Report to be issued when measured Channel Load is equal to or less than the reference value." },
1592   { 0x00, NULL}
1593 };
1594
1595 #define MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO 1
1596
1597 static const value_string ieee80211_tag_measure_request_noise_histogram_sub_id_vals[] = {
1598   { MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO, "Noise Histogram Reporting Information" },
1599   { 221, "Vendor Specific" },
1600   { 0x00, NULL}
1601 };
1602
1603 static const value_string ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals[] = {
1604   { 0x00, "Report to be issued after each measurement (default, used when Noise Histogram Reporting Information subelement is not included in Noise Histogram Request)." },
1605   { 0x01, "Noise Histogram Report to be issued when measured ANPI is equal to or greater than the reference value." },
1606   { 0x02, "Noise Histogram Report to be issued when measured ANPI is equal to or less than the reference value." },
1607   { 0x00, NULL}
1608 };
1609
1610 #define MEASURE_REP_REPORTED_FRAME_BODY 1
1611
1612 static const value_string ieee80211_tag_measure_report_beacon_sub_id_vals[] = {
1613   { MEASURE_REP_REPORTED_FRAME_BODY, "Reported Frame Body" },
1614   { 221, "Vendor Specific" },
1615   { 0x00, NULL}
1616 };
1617
1618 static const value_string frame_type[] = {
1619   {MGT_FRAME,       "Management frame"},
1620   {CONTROL_FRAME,   "Control frame"},
1621   {DATA_FRAME,      "Data frame"},
1622   {EXTENSION_FRAME, "Extension frame"},
1623   {0,               NULL}
1624 };
1625
1626 static const value_string tofrom_ds[] = {
1627   {0,                     "Not leaving DS or network is operating "
1628     "in AD-HOC mode (To DS: 0 From DS: 0)"},
1629   {FLAG_TO_DS,            "Frame from STA to DS via an AP (To DS: 1 "
1630     "From DS: 0)"},
1631   {FLAG_FROM_DS,          "Frame from DS to a STA via AP(To DS: 0 "
1632     "From DS: 1)"},
1633   {FLAG_TO_DS|FLAG_FROM_DS, "WDS (AP to AP) or Mesh (MP to MP) Frame "
1634     "(To DS: 1 From DS: 1)"},
1635   {0, NULL}
1636 };
1637
1638 static const true_false_string tods_flag = {
1639   "Frame is entering DS",
1640   "Frame is not entering DS"
1641 };
1642
1643 static const true_false_string fromds_flag = {
1644   "Frame is exiting DS",
1645   "Frame is not exiting DS"
1646 };
1647
1648 static const true_false_string more_fragments = {
1649   "More fragments follow",
1650   "This is the last fragment"
1651 };
1652
1653 static const true_false_string retry_flags = {
1654   "Frame is being retransmitted",
1655   "Frame is not being retransmitted"
1656 };
1657
1658 static const true_false_string pm_flags = {
1659   "STA will go to sleep",
1660   "STA will stay up"
1661 };
1662
1663 static const true_false_string md_flags = {
1664   "Data is buffered for STA at AP",
1665   "No data buffered"
1666 };
1667
1668 static const true_false_string protected_flags = {
1669   "Data is protected",
1670   "Data is not protected"
1671 };
1672
1673 static const true_false_string order_flags = {
1674   "Strictly ordered",
1675   "Not strictly ordered"
1676 };
1677
1678 static const true_false_string cf_ess_flags = {
1679   "Transmitter is an AP",
1680   "Transmitter is a STA"
1681 };
1682
1683
1684 static const true_false_string cf_privacy_flags = {
1685   "AP/STA can support WEP",
1686   "AP/STA cannot support WEP"
1687 };
1688
1689 static const true_false_string cf_ibss_flags = {
1690   "Transmitter belongs to an IBSS",
1691   "Transmitter belongs to a BSS"
1692 };
1693
1694 static const true_false_string eosp_flag = {
1695   "End of service period",
1696   "Service period"
1697 };
1698
1699 static const true_false_string bit4_flag = {
1700   "Bits 8-15 of QoS Control field are Queue Size",
1701   "Bits 8-15 of QoS Control field are TXOP Duration Requested"
1702 };
1703
1704 static const true_false_string ieee80211_qos_amsdu_present_flag = {
1705   "A-MSDU",
1706   "MSDU"
1707 };
1708
1709 static const true_false_string csa_txrestrict_flags = {
1710   "Tx Restrict",
1711   "No Tx Restrict"
1712 };
1713
1714 static const true_false_string csa_initiator_flags = {
1715   "Initiator",
1716   "Non Initiator"
1717 };
1718
1719 static const true_false_string mesh_config_cap_power_save_level_flags = {
1720    "One of the peer-specific mesh power modes is deep sleep mode",
1721    "No one is in deep sleep mode"
1722 };
1723
1724 static const value_string sta_cf_pollable[] = {
1725   {0x00, "Station is not CF-Pollable"},
1726   {0x02, "Station is CF-Pollable, not requesting to be placed on the  CF-polling list"},
1727   {0x01, "Station is CF-Pollable, requesting to be placed on the CF-polling list"},
1728   {0x03, "Station is CF-Pollable, requesting never to be polled"},
1729   {0x80, "QSTA requesting association in QBSS"},
1730   {0x81, "Reserved"},
1731   {0x82, "Reserved"},
1732   {0x83, "Reserved"},
1733   {0, NULL}
1734 };
1735
1736 static const value_string ap_cf_pollable[] = {
1737   {0x00, "No point coordinator at AP"},
1738   {0x02, "Point coordinator at AP for delivery only (no polling)"},
1739   {0x01, "Point coordinator at AP for delivery and polling"},
1740   {0x03, "Reserved"},
1741   {0x80, "QAP (HC) does not use CFP for delivery of unicast data type frames"},
1742   {0x82, "QAP (HC) uses CFP for delivery, but does not send CF-Polls to non-QoS STAs"},
1743   {0x81, "QAP (HC) uses CFP for delivery, and sends CF-Polls to non-QoS STAs"},
1744   {0x83, "Reserved"},
1745   {0, NULL}
1746 };
1747
1748
1749 static const value_string auth_alg[] = {
1750   {0x00, "Open System"},
1751   {0x01, "Shared key"},
1752   {0x02, "Fast BSS Transition"},
1753   {0x03, "Simultaneous Authentication of Equals (SAE)"},
1754   {0x04, "FILS Shared Key authentication without PFS"},
1755   {0x05, "FILS Shared Key authentication with PFS"},
1756   {0x06, "FILS Public Key authentication"},
1757   {0x80, "Network EAP"},  /* Cisco proprietary? */
1758   {0, NULL}
1759 };
1760
1761 static const true_false_string ff_block_ack_params_amsdu_permitted_flag = {
1762   "Permitted in QoS Data MPDUs",
1763   "Not Permitted"
1764 };
1765
1766 static const true_false_string ff_block_ack_params_policy_flag = {
1767   "Immediate Block Ack",
1768   "Delayed Block Ack"
1769 };
1770
1771 static const value_string  ff_channel_width_vals[] = {
1772   {0x00, "20 MHz channel width only"},
1773   {0x01, "Any channel width in the STA's Supported Channel Width Set"},
1774   {0, NULL}
1775 };
1776
1777 static const true_false_string ff_qos_info_ap_q_ack_flag = {
1778   "APs MIB attribute dot11QAckOptionImplemented is true",
1779   "APs MIB attribute dot11QAckOptionImplemented is false"
1780 };
1781
1782 static const true_false_string ff_qos_info_ap_queue_req_flag = {
1783   "AP can process a nonzero Queue Size subfield in the QoS Control field in QoS data frames",
1784   "AP cannot process a nonzero Queue Size subfield in the QoS Control field in QoS data frames"
1785 };
1786
1787 static const true_false_string ff_qos_info_ap_txop_request_flag = {
1788   "AP can process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames",
1789   "AP cannot process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames"
1790 };
1791
1792 static const true_false_string ff_qos_info_sta_ac_flag = {
1793   "Trigger-enabled and Delivery-enabled",
1794   "Neither Trigger-enabled nor Delivery-enabled"
1795 };
1796
1797 static const true_false_string ff_qos_info_sta_q_ack_flag = {
1798   "STAs MIB attribute dot11QAckOptionImplemented is true",
1799   "STAs MIB attribute dot11QAckOptionImplemented is false"
1800 };
1801
1802 static const value_string ff_qos_info_sta_max_sp_len_flags[] = {
1803   {0x00, "AP may deliver all buffered MSDUs, A-MSDUs and MMPDUs"},
1804   {0x01, "AP may deliver a maximum of two MSDUs, A-MSDUs and MMPDUs per SP"},
1805   {0x02, "AP may deliver a maximum of four MSDUs, A-MSDUs and MMPDUs per SP"},
1806   {0x03, "AP may deliver a maximum of six MSDUs, A-MSDUs and MMPDUs per SP"},
1807   {0, NULL}
1808 };
1809
1810 static const true_false_string ff_qos_info_sta_more_data_ack_flag = {
1811   "STA can process ACK frames with the More Data bit in the Frame Control field set to 1 and will remain in the wake state",
1812   "STA cannot process ACK frames with the More Data bit in the Frame Control field set to 1"
1813 };
1814
1815 static const true_false_string ff_sm_pwr_save_sm_mode_flag = {
1816   "Dynamic SM Power Save mode",
1817   "Static SM Power Save mode"
1818 };
1819
1820 static const true_false_string ff_pco_phase_cntrl_flag = {
1821   "40 MHz Phase",
1822   "20 MHz Phase"
1823 };
1824
1825 static const true_false_string ff_psmp_param_set_more_psmp_flag = {
1826   "More PSMP Sequences Follow",
1827   "No PSMP Sequences Follow"
1828 };
1829
1830 static const value_string ff_mimo_cntrl_nc_index_flags[] = {
1831   {0x00, "1 Column"},
1832   {0x01, "2 Columns"},
1833   {0x02, "3 Columns"},
1834   {0x03, "4 Columns"},
1835   {0, NULL}
1836 };
1837
1838 static const value_string ff_mimo_cntrl_nr_index_flags[] = {
1839   {0x00, "1 Row"},
1840   {0x01, "2 Rows"},
1841   {0x02, "3 Rows"},
1842   {0x03, "4 Rows"},
1843   {0, NULL}
1844 };
1845
1846 static const true_false_string ff_mimo_cntrl_channel_width_flag = {
1847   "40 MHz",
1848   "20 MHz"
1849 };
1850
1851 static const true_false_string ff_ht_info_information_request_flag = {
1852   "Requesting HT Information Exchange management action frame",
1853   "Should not send an HT Information Exchange management action frame"
1854 };
1855
1856 static const true_false_string ff_ht_info_40_mhz_intolerant_flag = {
1857   "Transmitting station is intolerant of 40 MHz operation",
1858   "Transmitting station permits 40 MHz operation"
1859 };
1860
1861 static const true_false_string ff_ht_info_sta_chan_width_flag = {
1862   "40 MHz",
1863   "20 MHz"
1864 };
1865
1866 static const value_string ff_ht_action_flags[] = {
1867   {HT_ACTION_NOTIFY_CHAN_WIDTH,           "Notify Channel Width"},
1868   {HT_ACTION_SM_PWR_SAVE,                 "Spatial Multiplexing (SM) Power Save"},
1869   {HT_ACTION_PSMP_ACTION,                 "Power Save Multi-Poll (PSMP) action frame"},
1870   {HT_ACTION_SET_PCO_PHASE,               "Set PCO Phase"},
1871   {HT_ACTION_MIMO_CSI,                    "MIMO CSI Matrices"},
1872   {HT_ACTION_MIMO_BEAMFORMING,            "MIMO Non-compressed Beamforming"},
1873   {HT_ACTION_MIMO_COMPRESSED_BEAMFORMING, "MIMO Compressed Beamforming"},
1874   {HT_ACTION_ANT_SEL_FEEDBACK,            "Antenna Selection Indices Feedback"},
1875   {HT_ACTION_HT_INFO_EXCHANGE,            "HT Information Exchange"},
1876   {0x00, NULL}
1877 };
1878
1879 static const value_string ff_fst_action_flags[] = {
1880   {FST_SETUP_REQUEST,             "FST Setup Request"},
1881   {FST_SETUP_RESPONSE,            "FST Setup Response"},
1882   {FST_TEAR_DOWN,                 "FST Tear Down"},
1883   {FST_ACK_REQUEST,               "FST Ack Request"},
1884   {FST_ACK_RESPONSE,              "FST Ack Response"},
1885   {FST_ON_CHANNEL_TUNNEL_REQUEST, "FST On-channel Tunnel Request"},
1886   {0x00, NULL}
1887 };
1888
1889 static const value_string ff_dmg_action_flags[] = {
1890   {DMG_ACTION_PWR_SAVE_CONFIG_REQ,           "Power Save Configuration Request"},
1891   {DMG_ACTION_PWR_SAVE_CONFIG_RES,           "Power Save Configuration Response"},
1892   {DMG_ACTION_INFO_REQ,                      "Information Request"},
1893   {DMG_ACTION_INFO_RES,                      "Information Response"},
1894   {DMG_ACTION_HANDOVER_REQ,                  "Handover Request"},
1895   {DMG_ACTION_HANDOVER_RES,                  "Handover Response"},
1896   {DMG_ACTION_DTP_REQ,                       "DTP Request"},
1897   {DMG_ACTION_DTP_RES,                       "DTP Response"},
1898   {DMG_ACTION_RELAY_SEARCH_REQ,              "Relay Search Request"},
1899   {DMG_ACTION_RELAY_SEARCH_RES,              "Relay Search Response"},
1900   {DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ, "Multi Relay Channel Measurement Request"},
1901   {DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES, "Multi Relay Channel Measurement Response"},
1902   {DMG_ACTION_RLS_REQ,                       "RLS Request"},
1903   {DMG_ACTION_RLS_RES,                       "RLS Response"},
1904   {DMG_ACTION_RLS_ANNOUNCE,                  "RLS Announcement"},
1905   {DMG_ACTION_RLS_TEARDOWN,                  "RLS Teardown"},
1906   {DMG_ACTION_RELAY_ACK_REQ,                 "Relay ACK Request"},
1907   {DMG_ACTION_RELAY_ACK_RES,                 "Relay ACK Response"},
1908   {DMG_ACTION_TPA_REQ,                       "TPA Request"},
1909   {DMG_ACTION_TPA_RES,                       "TPA Response"},
1910   {DMG_ACTION_TPA_REP,                       "TPA Report"},
1911   {DMG_ACTION_ROC_REQ,                       "ROC Request"},
1912   {DMG_ACTION_ROC_RES,                       "ROC Response"},
1913   {0x00, NULL}
1914 };
1915
1916 static const value_string ff_unprotected_dmg_action_flags[] = {
1917   {UNPROTECTED_DMG_ANNOUNCE,      "Announce"},
1918   {UNPROTECTED_DMG_BRP,           "BRP"},
1919   {0x00, NULL}
1920 };
1921 static const value_string ff_mimo_cntrl_grouping_flags[] = {
1922   {0x00, "No Grouping"},
1923   {0x01, "Carrier Groups of 2"},
1924   {0x02, "Carrier Groups of 4"},
1925   {0x03, "Reserved"},
1926   {0, NULL}
1927 };
1928
1929 static const value_string ff_mimo_cntrl_coefficient_size_flags[] = {
1930   {0x00, "4 Bits"},
1931   {0x01, "5 Bits"},
1932   {0x02, "6 Bits"},
1933   {0x03, "8 Bits"},
1934   {0, NULL}
1935 };
1936
1937 static const value_string ff_mimo_cntrl_codebook_info_flags[] = {
1938   {0x00, "1 bit for 'Capital Psi', 3 bits for 'Small Psi'"},
1939   {0x01, "2 bit for 'Capital Psi', 4 bits for 'Small Psi'"},
1940   {0x02, "3 bit for 'Capital Psi', 5 bits for 'Small Psi'"},
1941   {0x03, "4 bit for 'Capital Psi', 6 bits for 'Small Psi'"},
1942   {0, NULL}
1943 };
1944
1945 static const value_string ff_ppa_action_codes[] = {
1946   {PPA_DSE_ENABLEMENT,                  "Protected DSE enablement"},
1947   {PPA_DSE_DEENABLEMENT,                "Protected DSE deenablement"},
1948   {PPA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Protected Extended Channel Switch Announcement"},
1949   {PPA_DSE_MEASUREMENT_REQUEST,         "Protected DSE measurement request"},
1950   {PPA_DSE_MEASUREMENT_REPORT,          "Protected DSE measurement report"},
1951   {PPA_DSE_POWER_CONSTRAINT,            "Protected DSE power constraint"},
1952   {PPA_VENDOR_SPECIFIC,                 "Protected Vendor Specific"},
1953   {PPA_GAS_INITIAL_REQUEST,             "Protected GAS Initial Request"},
1954   {PPA_GAS_INITIAL_RESPONSE,            "Protected GAS Initial Response"},
1955   {PPA_GAS_COMEBACK_REQUEST,            "Protected GAS Comeback Request"},
1956   {PPA_GAS_COMEBACK_RESPONSE,           "Protected GAS Comeback Response"},
1957   {PPA_QAB_REQUEST,                     "Protected QAB Request"},
1958   {PPA_QAB_RESPONSE,                    "Protected QAB Response"},
1959   {0x00, NULL}
1960 };
1961 static value_string_ext ff_ppa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_ppa_action_codes);
1962
1963 static const value_string ff_pa_action_codes[] = {
1964   {PA_20_40_BSS_COEXISTENCE_MANAGEMENT, "20/40 BSS Coexistence Management"},
1965   {PA_DSE_ENABLEMENT,                  "DSE enablement"},
1966   {PA_DSE_DEENABLEMENT,                "DSE deenablement"},
1967   {PA_DSE_REG_LOC_ANNOUNCEMENT,        "DSE Registered Location Announcement"},
1968   {PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement"},
1969   {PA_DSE_MEASUREMENT_REQUEST,         "DSE measurement request"},
1970   {PA_DSE_MEASUREMENT_REPORT,          "DSE measurement report"},
1971   {PA_MEASUREMENT_PILOT,               "Measurement Pilot"},
1972   {PA_DSE_POWER_CONSTRAINT,            "DSE power constraint"},
1973   {PA_VENDOR_SPECIFIC,                 "Vendor Specific"},
1974   {PA_GAS_INITIAL_REQUEST,             "GAS Initial Request"},
1975   {PA_GAS_INITIAL_RESPONSE,            "GAS Initial Response"},
1976   {PA_GAS_COMEBACK_REQUEST,            "GAS Comeback Request"},
1977   {PA_GAS_COMEBACK_RESPONSE,           "GAS Comeback Response"},
1978   {PA_TDLS_DISCOVERY_RESPONSE,         "TDLS Discovery Response"},
1979   {PA_LOCATION_TRACK_NOTIFICATION,     "Location Track Notification"},
1980   {PA_QAB_REQUEST,                     "QAB Request"},
1981   {PA_QAB_RESPONSE,                    "QAB Response"},
1982   {0x00, NULL}
1983 };
1984 static value_string_ext ff_pa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_pa_action_codes);
1985
1986 static const value_string category_codes[] = {
1987   {CAT_SPECTRUM_MGMT,                    "Spectrum Management (SM)"},
1988   {CAT_QOS,                              "Quality of Service (QoS)"},
1989   {CAT_DLS,                              "Direct-Link Setup (DLS)"},
1990   {CAT_BLOCK_ACK,                        "Block Ack"},
1991   {CAT_PUBLIC,                           "Public Action"},
1992   {CAT_RADIO_MEASUREMENT,                "Radio Measurement"},
1993   {CAT_FAST_BSS_TRANSITION,              "Fast BSS Transition"},
1994   {CAT_HT,                               "High Throughput"},
1995   {CAT_SA_QUERY,                         "SA Query"},
1996   {CAT_PUBLIC_PROTECTED,                 "Protected Dual of Public Action"},
1997   {CAT_WNM,                              "WNM"},
1998   {CAT_UNPROTECTED_WNM,                  "Unprotected WNM"},
1999   {CAT_TDLS,                             "TDLS"},
2000   {CAT_MESH,                             "MESH"},
2001   {CAT_MULTIHOP,                         "Multihop"},
2002   {CAT_SELF_PROTECTED,                   "Self-protected"},
2003   {CAT_DMG,                              "DMG"},
2004   {CAT_MGMT_NOTIFICATION,                "Management Notification"},
2005   {CAT_FAST_SESSION_TRANSFER,            "Fast Session Transfer"},
2006   {CAT_ROBUST_AV_STREAMING,              "Robust AV Streaming"},
2007   {CAT_UNPROTECTED_DMG,                  "Unprotected DMG"},
2008   {CAT_VHT,                              "VHT"},
2009   {CAT_HE,                               "HE"},
2010   {CAT_PROTECTED_HE,                     "Protected HE"},
2011   {CAT_VENDOR_SPECIFIC_PROTECTED,        "Vendor-specific Protected"},
2012   {CAT_VENDOR_SPECIFIC,                  "Vendor Specific"},
2013
2014   {0x80 | CAT_SPECTRUM_MGMT,             "Spectrum Management (SM) (error)"},
2015   {0x80 | CAT_QOS,                       "Quality of Service (QoS (error))"},
2016   {0x80 | CAT_DLS,                       "Direct-Link Setup (DLS) (error)"},
2017   {0x80 | CAT_BLOCK_ACK,                 "Block Ack (error)"},
2018   {0x80 | CAT_PUBLIC,                    "Public Action (error)"},
2019   {0x80 | CAT_RADIO_MEASUREMENT,         "Radio Measurement (error)"},
2020   {0x80 | CAT_FAST_BSS_TRANSITION,       "Fast BSS Transition (error)"},
2021   {0x80 | CAT_HT,                        "High Throughput (error)"},
2022   {0x80 | CAT_SA_QUERY,                  "SA Query (error)"},
2023   {0x80 | CAT_PUBLIC_PROTECTED,          "Protected Dual of Public Action (error)"},
2024   {0x80 | CAT_WNM,                       "WNM (error)"},
2025   {0x80 | CAT_UNPROTECTED_WNM,           "Unprotected WNM (error)"},
2026   {0x80 | CAT_TDLS,                      "TDLS (error)"},
2027   {0x80 | CAT_MESH,                      "Mesh (error)"},
2028   {0x80 | CAT_MULTIHOP,                  "Multihop (error)"},
2029   {0x80 | CAT_SELF_PROTECTED,            "Self-protected (error)"},
2030   {0x80 | CAT_DMG,                       "DMG (error)"},
2031   {0x80 | CAT_MGMT_NOTIFICATION,         "Management Notification (error)"},
2032   {0x80 | CAT_FAST_SESSION_TRANSFER,     "Fast Session Transfer (error)"},
2033   {0x80 | CAT_ROBUST_AV_STREAMING,       "Robust AV Streaming (error)"},
2034   {0x80 | CAT_UNPROTECTED_DMG,           "Unprotected DMG (error)"},
2035   {0x80 | CAT_VHT,                       "VHT"},
2036   {0x80 | CAT_VENDOR_SPECIFIC_PROTECTED, "Vendor-specific Protected (error)"},
2037   {0x80 | CAT_VENDOR_SPECIFIC,           "Vendor Specific (error)"},
2038   {0, NULL}
2039 };
2040 static value_string_ext category_codes_ext = VALUE_STRING_EXT_INIT(category_codes);
2041
2042 #define NR_SUB_ID_TSF_INFO                 1
2043 #define NR_SUB_ID_CON_COU_STR              2
2044 #define NR_SUB_ID_BSS_TRN_CAN_PREF         3
2045 #define NR_SUB_ID_BSS_TER_DUR              4
2046 #define NR_SUB_ID_BEARING                  5
2047 #define NR_SUB_ID_WIDE_BW_CHANNEL          6
2048
2049 #define NR_SUB_ID_MEASUREMENT_REPORT       39
2050 #define NR_SUB_ID_HT_CAPABILITIES          45
2051 #define NR_SUB_ID_HT_OPERATION             61
2052 #define NR_SUB_ID_SEC_CHANNEL_OFFSET       62
2053 #define NR_SUB_ID_MEASUREMENT_PILOT_INFO   66
2054 #define NR_SUB_ID_RM_ENABLE_CAP            70
2055 #define NR_SUB_ID_HT_MULTIPLE_BSSID        71
2056 #define NR_SUB_ID_VHT_CAPABILITIES         191
2057 #define NR_SUB_ID_VHT_OPERATION            192
2058 #define NR_SUB_ID_HE_CAPABILITIES          193
2059 #define NR_SUB_ID_HE_OPERATION             194
2060
2061 #define NR_SUB_ID_VENDOR_SPECIFIC          221
2062
2063 static const value_string ieee80211_neighbor_report_subelement_id_vals[] = {
2064   {NR_SUB_ID_TSF_INFO, "TSF Information"},
2065   {NR_SUB_ID_CON_COU_STR, "Condensed Country String"},
2066   {NR_SUB_ID_BSS_TRN_CAN_PREF, "BSS Transition Candidate Preference"},
2067   {NR_SUB_ID_BSS_TER_DUR, "BSS Termination Duration"},
2068   {NR_SUB_ID_BEARING, "Bearing"},
2069   {NR_SUB_ID_WIDE_BW_CHANNEL, "Wide Bandwidth Channel"},
2070   {NR_SUB_ID_MEASUREMENT_REPORT, "Measurement Report"},
2071   {NR_SUB_ID_HT_CAPABILITIES, "HT Capabilities"},
2072   {NR_SUB_ID_HT_OPERATION, "HT Operation"},
2073   {NR_SUB_ID_SEC_CHANNEL_OFFSET, "Secondary Channel Offset"},
2074   {NR_SUB_ID_MEASUREMENT_PILOT_INFO, "Measurement Pilot Transmission"},
2075   {NR_SUB_ID_RM_ENABLE_CAP, "RM Enabled Capabilities"},
2076   {NR_SUB_ID_HT_MULTIPLE_BSSID, "Multiple BSSID"},
2077   {NR_SUB_ID_VHT_CAPABILITIES, "VHT Capabilities"},
2078   {NR_SUB_ID_VHT_OPERATION, "VHT Operation"},
2079   {NR_SUB_ID_HE_CAPABILITIES, "HE Capabilities"},
2080   {NR_SUB_ID_HE_OPERATION, "HE Operation"},
2081   {NR_SUB_ID_VENDOR_SPECIFIC, "Vendor Specific"},
2082   {0, NULL}
2083 };
2084
2085 static const value_string ieee80211_neighbor_report_bssid_info_reachability_vals[] = {
2086   {0, "Reserved"},
2087   {1, "Not Reachable"},
2088   {2, "Unknown"},
2089   {3, "Reachable"},
2090   {0, NULL}
2091 };
2092
2093 static const value_string action_codes[] = {
2094   {SM_ACTION_MEASUREMENT_REQUEST, "Measurement Request"},
2095   {SM_ACTION_MEASUREMENT_REPORT,  "Measurement Report"},
2096   {SM_ACTION_TPC_REQUEST,         "TPC Request"},
2097   {SM_ACTION_TPC_REPORT,          "TPC Report"},
2098   {SM_ACTION_CHAN_SWITCH_ANNC,    "Channel Switch Announcement"},
2099   {0, NULL}
2100 };
2101
2102 static const value_string vendor_action_types_mrvl[] = {
2103   {MRVL_ACTION_MESH_MANAGEMENT, "Mesh Management"},
2104   {0, NULL}
2105 };
2106
2107 static const value_string mesh_mgt_action_codes_mrvl[] = {
2108   {MRVL_MESH_MGMT_ACTION_RREQ, "Route Request"},
2109   {MRVL_MESH_MGMT_ACTION_RREP, "Route Response"},
2110   {MRVL_MESH_MGMT_ACTION_RERR, "Route Error"},
2111   {MRVL_MESH_MGMT_ACTION_PLDM, "Peer Link Down"},
2112   {0, NULL}
2113 };
2114
2115 static const value_string mesh_path_selection_codes[] = {
2116   {0x0, "Hybrid Wireless Mesh Protocol"},
2117   {0, NULL}
2118 };
2119
2120 static const value_string mesh_metric_codes[] = {
2121   {0x0, "Airtime Link Metric"},
2122   {0, NULL}
2123 };
2124
2125 static const value_string wme_action_codes[] = {
2126   {0x00, "Setup request"},
2127   {0x01, "Setup response"},
2128   {0x02, "Teardown"},
2129   {0x00, NULL}
2130 };
2131
2132 static const value_string wme_status_codes[] = {
2133   {0x00, "Admission accepted"},
2134   {0x01, "Invalid parameters"},
2135   {0x03, "Refused"},
2136   {0x00, NULL}
2137 };
2138
2139 static const value_string mesh_action[] = {
2140   {MESH_ACTION_LINK_METRIC_REPORT, "Mesh Link Metric Report"},
2141   {MESH_ACTION_HWMP,               "HWMP Mesh Path Selection"},
2142   {MESH_ACTION_GATE_ANNOUNCE,      "Gate Announcement"},
2143   {MESH_ACTION_CONGESTION_CTL,     "Congestion Control Notification"},
2144   {MESH_ACTION_MCCA_SETUP_REQUEST, "MCCA Setup Request"},
2145   {MESH_ACTION_MCCA_SETUP_REPLY,   "MCCA Setup Reply"},
2146   {MESH_ACTION_MCCA_ADV_REQUEST,   "MCCA Advertisement Request"},
2147   {MESH_ACTION_MCCA_ADV,           "MCCA Advertisement"},
2148   {MESH_ACTION_MCCA_TEARDOWN,      "MCCA Teardown"},
2149   {MESH_ACTION_TBTT_ADJ_REQUEST,   "TBTT Adjustment Request"},
2150   {MESH_ACTION_TBTT_ADJ_RESPONSE,  "TBTT Adjustment Response"},
2151   {0, NULL}
2152 };
2153 static value_string_ext mesh_action_ext = VALUE_STRING_EXT_INIT(mesh_action);
2154
2155 static const value_string multihop_action[] = {
2156   {MULTIHOP_ACTION_PROXY_UPDATE,      "Proxy Update"},
2157   {MULTIHOP_ACTION_PROXY_UPDATE_CONF, "Proxy Update Confirmation"},
2158   {0, NULL}
2159 };
2160
2161 static const value_string selfprot_action[] = {
2162   {SELFPROT_ACTION_MESH_PEERING_OPEN,     "Mesh Peering Open"},
2163   {SELFPROT_ACTION_MESH_PEERING_CONFIRM,  "Mesh Peering Confirm"},
2164   {SELFPROT_ACTION_MESH_PEERING_CLOSE,    "Mesh Peering Close"},
2165   {SELFPROT_ACTION_MESH_GROUP_KEY_INFORM, "Mesh Group Key Inform"},
2166   {SELFPROT_ACTION_MESH_GROUP_KEY_ACK,    "Mesh Group Key Ack"},
2167   {0, NULL}
2168 };
2169
2170 static const value_string mesh_peering_proto_ids[] = {
2171   {MESH_PEERING_PROTO_MGMT,   "Mesh peering management protocol"},
2172   {MESH_PEERING_PROTO_AMPE,   "Authenticated mesh peering exchange protocol"},
2173   {MESH_PEERING_PROTO_VENDOR, "Vendor specific"},
2174   {0, NULL}
2175 };
2176
2177 static const true_false_string hwmp_targ_usn_flags = {
2178   "[USN = 1] Target Sequence Number Unknown at Originator",
2179   "[USN = 0] Target Sequence Number Known at Originator"
2180 };
2181
2182 static const true_false_string hwmp_targ_to_flags = {
2183   "[TO = 1] Only Target Will Respond",
2184   "[TO = 0] Intermediate Nodes May Respond"
2185 };
2186
2187 static const value_string ack_policy[] = {
2188   {0x00, "Normal Ack"},
2189   {0x01, "No Ack"},
2190   {0x02, "No explicit acknowledgment"},
2191   {0x03, "Block Ack"},
2192   {0x00, NULL}
2193 };
2194
2195 static const value_string qos_action_codes[] = {
2196   {QOS_ACTION_ADDTS_REQUEST,  "ADDTS Request"},
2197   {QOS_ACTION_ADDTS_RESPONSE, "ADDTS Response"},
2198   {QOS_ACTION_DELTS,          "DELTS"},
2199   {QOS_ACTION_SCHEDULE,   "Schedule"},
2200   {QOS_ACTION_MAP_CONFIGURE, "QoS Map Configure"},
2201   {0, NULL}
2202 };
2203
2204 static const value_string ba_action_codes[] = {
2205   {BA_ADD_BLOCK_ACK_REQUEST,  "Add Block Ack Request"},
2206   {BA_ADD_BLOCK_ACK_RESPONSE, "Add Block Ack Response"},
2207   {BA_DELETE_BLOCK_ACK,       "Delete Block Ack"},
2208   {0x00, NULL}
2209 };
2210
2211 static const value_string dls_action_codes[] = {
2212   {DLS_ACTION_REQUEST,  "DLS Request"},
2213   {DLS_ACTION_RESPONSE, "DLS Response"},
2214   {DLS_ACTION_TEARDOWN, "DLS Teardown"},
2215   {0, NULL}
2216 };
2217
2218 static const value_string tsinfo_type[] = {
2219   {0x0, "Aperiodic or unspecified Traffic"},
2220   {0x1, "Periodic Traffic"},
2221   {0, NULL}
2222 };
2223
2224 static const value_string tsinfo_direction[] = {
2225   {0x00, "Uplink"},
2226   {0x01, "Downlink"},
2227   {0x02, "Direct link"},
2228   {0x03, "Bidirectional link"},
2229   {0, NULL}
2230 };
2231
2232 static const value_string tsinfo_access[] = {
2233   {0x00, "Reserved"},
2234   {0x01, "EDCA"},
2235   {0x02, "HCCA"},
2236   {0x03, "HEMM"},
2237   {0, NULL}
2238 };
2239
2240 static const value_string qos_up[] = {
2241   {0x00, "Best Effort"},
2242   {0x01, "Background"},
2243   {0x02, "Spare"},
2244   {0x03, "Excellent Effort"},
2245   {0x04, "Controlled Load"},
2246   {0x05, "Video"},
2247   {0x06, "Voice"},
2248   {0x07, "Network Control"},
2249   {0, NULL}
2250 };
2251
2252 static const value_string classifier_type[] = {
2253   {0x00, "Ethernet parameters"},
2254   {0x01, "TCP/UDP IP parameters"},
2255   {0x02, "IEEE 802.1D/Q parameters"},
2256   {0, NULL}
2257 };
2258
2259 static const true_false_string ieee80211_block_ack_control_ack_policy_flag = {
2260     "Sender Does Not Require Immediate Acknowledgement",
2261     "Immediate Acknowledgement Required"
2262 };
2263
2264 static const value_string ft_action_codes[] = {
2265   {FT_ACTION_REQUEST, "FT Request"},
2266   {FT_ACTION_RESPONSE, "FT Response"},
2267   {FT_ACTION_CONFIRM, "FT Confirm"},
2268   {FT_ACTION_ACK, "FT Ack"},
2269   {0, NULL}
2270 };
2271
2272 static const value_string sa_query_action_codes[] = {
2273   {SA_QUERY_REQUEST, "SA Query Request"},
2274   {SA_QUERY_RESPONSE, "SA Query Response"},
2275   {0, NULL}
2276 };
2277
2278 static const value_string ieee80211_data_encap_payload_types[] = {
2279   {1, "Remote Request/Response"},
2280   {2, "TDLS"},
2281   {0, NULL}
2282 };
2283
2284 static const true_false_string rsn_preauth_flags = {
2285   "Transmitter supports pre-authentication",
2286   "Transmitter does not support pre-authentication"
2287 };
2288
2289 static const true_false_string rsn_no_pairwise_flags = {
2290   "Transmitter cannot support WEP default key 0 simultaneously with "
2291   "Pairwise key",
2292   "Transmitter can support WEP default key 0 simultaneously with "
2293   "Pairwise key"
2294 };
2295
2296 static const value_string rsn_cap_replay_counter[] = {
2297   {0x00, "1 replay counter per PTKSA/GTKSA/STAKeySA"},
2298   {0x01, "2 replay counters per PTKSA/GTKSA/STAKeySA"},
2299   {0x02, "4 replay counters per PTKSA/GTKSA/STAKeySA"},
2300   {0x03, "16 replay counters per PTKSA/GTKSA/STAKeySA"},
2301   {0, NULL}
2302 };
2303
2304 static const true_false_string ht_ldpc_coding_flag = {
2305   "Transmitter supports receiving LDPC coded packets",
2306   "Transmitter does not support receiving LDPC coded packets"
2307 };
2308
2309 static const true_false_string ht_chan_width_flag = {
2310   "Transmitter supports 20MHz and 40MHz operation",
2311   "Transmitter only supports 20MHz operation"
2312 };
2313
2314 static const value_string ht_sm_pwsave_flag[] = {
2315   {0x00, "Static SM Power Save mode"},
2316   {0x01, "Dynamic SM Power Save mode"},
2317   {0x02, "Reserved"},
2318   {0x03, "SM Power Save disabled"},
2319   {0x00, NULL}
2320 };
2321
2322 static const true_false_string ht_green_flag = {
2323   "Transmitter is able to receive PPDUs with Green Field (GF) preamble",
2324   "Transmitter is not able to receive PPDUs with Green Field (GF) preamble"
2325 };
2326
2327 static const value_string ht_rx_stbc_flag[] = {
2328   {0x00, "No Rx STBC support"},
2329   {0x01, "Rx support of one spatial stream"},
2330   {0x02, "Rx support of one and two spatial streams"},
2331   {0x03, "Rx support of one, two, and three spatial streams"},
2332   {0x00, NULL}
2333 };
2334
2335   /* IEEE Stc 802.11ac-2013 8.4.2.29 Extended Capabilities element*/
2336 static const value_string vht_max_mpdu_in_amsdu[] = {
2337     {0x00, "No limit"},
2338     {0x01, "32"},
2339     {0x02, "16"},
2340     {0x03, "8"},
2341     {0, NULL}
2342 };
2343
2344   /* IEEE Stc 802.11ac/D3.1 */
2345
2346 static const value_string vht_max_mpdu_length_flag[] = {
2347   {0x00, "3 895"},
2348   {0x01, "7 991"},
2349   {0x02, "11 454"},
2350   {0x03, "Reserved"},
2351   {0x00, NULL}
2352 };
2353
2354 static const value_string vht_supported_chan_width_set_flag[] = {
2355   {0x00, "Neither 160MHz nor 80+80 supported"},
2356   {0x01, "160MHz supported"},
2357   {0x02, "160MHz and 80+80 Supported"},
2358   {0x03, "Reserved"},
2359   {0x00, NULL}
2360 };
2361
2362 static const value_string vht_rx_stbc_flag[] = {
2363   {0x00, "None"},
2364   {0x01, "1 Spatial Stream Supported"},
2365   {0x02, "1 to 2 Spatial Stream Supported"},
2366   {0x03, "1 to 3 Spatial Stream Supported"},
2367   {0x04, "1 to 4 Spatial Stream Supported"},
2368   {0x05, "Reserved"},
2369   {0x06, "Reserved"},
2370   {0x07, "Reserved"},
2371   {0x00, NULL}
2372 };
2373
2374 static const value_string num_plus_one_3bit_flag[] = {
2375   {0x00, "1"},
2376   {0x01, "2"},
2377   {0x02, "3"},
2378   {0x03, "4"},
2379   {0x04, "5"},
2380   {0x05, "6"},
2381   {0x06, "7"},
2382   {0x07, "8"},
2383   {0x00, NULL}
2384 };
2385
2386 static const value_string vht_max_ampdu_flag[] = {
2387   {0x00, "8 191"},
2388   {0x01, "16 383"},
2389   {0x02, "32 767"},
2390   {0x03, "65,535"},
2391   {0x04, "131 071"},
2392   {0x05, "262 143"},
2393   {0x06, "524 287"},
2394   {0x07, "1 048 575"},
2395   {0x00, NULL}
2396 };
2397
2398 static const value_string vht_link_adapt_flag[] = {
2399   {0x00, "No Feedback"},
2400   {0x01, "Reserved (logically only solicited feedback)"},
2401   {0x02, "Unsolicited feedback only"},
2402   {0x03, "Both (can provide unsolicited feedback and respond to VHT MRQ)"},
2403   {0x00, NULL}
2404 };
2405
2406 static const value_string vht_supported_mcs_flag[] = {
2407   {0x00, "MCS 0-7"},
2408   {0x01, "MCS 0-8"},
2409   {0x02, "MCS 0-9"},
2410   {0x03, "Not Supported"},
2411   {0x00, NULL}
2412 };
2413
2414 static const value_string vht_op_channel_width_flag[] = {
2415   {0x00, "20 MHz or 40 MHz"},
2416   {0x01, "80 MHz"},
2417   {0x02, "160 MHz"},
2418   {0x03, "80+80 MHz"},
2419   {0x00, NULL}
2420 };
2421
2422 static const value_string vht_tpe_pwr_units[] = {
2423   {0x00, "EIRP"},
2424   {0x00, NULL}
2425 };
2426
2427 static const true_false_string vht_ndp_annc_sta_info_feedback_type = {
2428   "MU feedback requested",
2429   "SU feedback requested"
2430 };
2431
2432 static const true_false_string ht_delayed_block_ack_flag = {
2433   "Transmitter supports HT-Delayed BlockAck",
2434   "Transmitter does not support HT-Delayed BlockAck"
2435 };
2436
2437 static const true_false_string ht_max_amsdu_flag = {
2438   "7935 bytes",
2439   "3839 bytes"
2440 };
2441
2442 static const true_false_string ht_dss_cck_40_flag = {
2443   "Will/Can use DSSS/CCK in 40 MHz",
2444   "Won't/Can't use of DSSS/CCK in 40 MHz"
2445 };
2446
2447 static const true_false_string ht_psmp_flag = {
2448   "Will/Can support PSMP operation",
2449   "Won't/Can't support PSMP operation"
2450 };
2451
2452 static const true_false_string ht_40_mhz_intolerant_flag = {
2453   "Use of 40 MHz transmissions restricted/disallowed",
2454   "Use of 40 MHz transmissions unrestricted/allowed"
2455 };
2456
2457 static const value_string ampduparam_mpdu_start_spacing_flags[] = {
2458   {0x00, "no restriction"},
2459   {0x01, "1/4 [usec]"},
2460   {0x02, "1/2 [usec]"},
2461   {0x03, "1 [usec]"},
2462   {0x04, "2 [usec]"},
2463   {0x05, "4 [usec]"},
2464   {0x06, "8 [usec]"},
2465   {0x07, "16 [usec]"},
2466   {0x00, NULL}
2467 };
2468
2469 static const true_false_string mcsset_tx_rx_mcs_set_not_equal_flag = {
2470   "Not Equal",
2471   "Equal",
2472 };
2473
2474 static const value_string mcsset_tx_max_spatial_streams_flags[] = {
2475   {0x00, "1 spatial stream"},
2476   {0x01, "2 spatial streams"},
2477   {0x02, "3 spatial streams"},
2478   {0x03, "4 spatial streams"},
2479   {0x04, "TX MCS Set Not Defined"},
2480   {0x00, NULL}
2481 };
2482
2483 static const value_string htex_transtime_flags[] = {
2484   {0x00, "No Transition"},
2485   {0x01, "400 usec"},
2486   {0x02, "1.5 msec"},
2487   {0x03, "5 msec"},
2488   {0x00, NULL}
2489 };
2490
2491 static const value_string htex_mcs_flags[] = {
2492   {0x00, "STA does not provide MCS feedback"},
2493   {0x01, "Reserved"},
2494   {0x02, "STA provides only unsolicited MCS feedback"},
2495   {0x03, "STA can provide MCS feedback in response to MRQ as well as unsolicited MCS feedback"},
2496   {0x00, NULL}
2497 };
2498
2499 static const value_string txbf_calib_flag[] = {
2500   {0x00, "incapable"},
2501   {0x01, "Limited involvement, cannot initiate"},
2502   {0x02, "Limited involvement, can initiate"},
2503   {0x03, "Fully capable"},
2504   {0x00, NULL}
2505 };
2506
2507 static const value_string txbf_feedback_flags[] = {
2508   {0x00, "not supported"},
2509   {0x01, "delayed feedback capable"},
2510   {0x02, "immediate feedback capable"},
2511   {0x03, "delayed and immediate feedback capable"},
2512   {0x00, NULL}
2513 };
2514
2515 static const value_string txbf_antenna_flags[] = {
2516   {0x00, "1 TX antenna sounding"},
2517   {0x01, "2 TX antenna sounding"},
2518   {0x02, "3 TX antenna sounding"},
2519   {0x03, "4 TX antenna sounding"},
2520   {0x00, NULL}
2521 };
2522
2523 static const value_string txbf_csi_max_rows_bf_flags[] = {
2524   {0x00, "1 row of CSI"},
2525   {0x01, "2 rows of CSI"},
2526   {0x02, "3 rows of CSI"},
2527   {0x03, "4 rows of CSI"},
2528   {0x00, NULL}
2529 };
2530
2531 static const value_string txbf_chan_est_flags[] = {
2532   {0x00, "1 space time stream"},
2533   {0x01, "2 space time streams"},
2534   {0x02, "3 space time streams"},
2535   {0x03, "4 space time streams"},
2536   {0x00, NULL}
2537 };
2538
2539 static const value_string txbf_min_group_flags[] = {
2540   {0x00, "No grouping supported"},
2541   {0x01, "Groups of 1, 2 supported"},
2542   {0x02, "Groups of 1, 4 supported"},
2543   {0x03, "Groups of 1, 2, 4 supported"},
2544   {0x00, NULL}
2545 };
2546
2547 static const value_string hta_ext_chan_offset_flag[] = {
2548   {0x00, "No Extension Channel"},
2549   {0x01, "Extension Channel above control channel"},
2550   {0x02, "Undefined"},
2551   {0x03, "Extension Channel below control channel"},
2552   {0x00, NULL}
2553 };
2554
2555 static const true_false_string hta_rec_tx_width_flag = {
2556   "Any channel width enabled",
2557   "Use 20MHz channel (control)"
2558 };
2559
2560 static const true_false_string hta_rifs_mode_flag = {
2561   "Use of RIFS permitted",
2562   "Use of RIFS prohibited"
2563 };
2564
2565 static const true_false_string hta_controlled_access_flag = {
2566   "Not only PSMP",
2567   "PSMP only"
2568 };
2569
2570 static const value_string hta_service_interval_flag[] = {
2571   {0x00, "5ms"},
2572   {0x01, "10ms"},
2573   {0x02, "15ms"},
2574   {0x03, "20ms"},
2575   {0x04, "25ms"},
2576   {0x05, "30ms"},
2577   {0x06, "35ms"},
2578   {0x07, "40ms"},
2579   {0x00, NULL}
2580 };
2581
2582 static const value_string hta_operating_mode_flag[] = {
2583   {0x00, "Pure HT, no protection"},
2584   {0x01, "There may be non-HT devices (control & ext channel)"},
2585   {0x02, "No non-HT is associated, but at least 1 20MHz is. protect on"},
2586   {0x03, "Mixed: no non-HT is associated, protect on"},
2587   {0x00, NULL}
2588 };
2589
2590 static const true_false_string hta_non_gf_devices_flag = {
2591   "All HT devices associated are GF capable",
2592   "One or More HT devices are not GF capable"
2593 };
2594
2595 static const true_false_string hta_dual_stbc_protection_flag = {
2596   "Dual CTS protections is used",
2597   "Regular use of RTS/CTS"
2598 };
2599
2600 static const true_false_string hta_secondary_beacon_flag = {
2601   "Secondary Beacon",
2602   "Primary Beacon"
2603 };
2604
2605 static const true_false_string hta_lsig_txop_protection_flag = {
2606   "Full Support",
2607   "Not full support"
2608 };
2609
2610 static const true_false_string hta_pco_active_flag = {
2611   "PCO is activated in the BSS",
2612   "PCO is not activated in the BSS"
2613 };
2614
2615 static const true_false_string hta_pco_phase_flag = {
2616   "Switch to 20MHz phase/keep 20MHz",
2617   "Switch to 40MHz phase/keep 40MHz"
2618 };
2619
2620 static const value_string ht_info_secondary_channel_offset_flags[] = {
2621   {0x00, "No secondary channel"},
2622   {0x01, "Secondary channel is above the primary channel"},
2623   {0x02, "Reserved"},
2624   {0x03, "Secondary channel is below the primary channel"},
2625   {0x00, NULL}
2626 };
2627
2628 static const true_false_string ht_info_channel_width_flag = {
2629   "Channel of any width supported",
2630   "20 MHz channel width only"
2631 };
2632
2633 static const true_false_string ht_info_rifs_mode_flag = {
2634   "Permitted",
2635   "Prohibited"
2636 };
2637
2638 static const true_false_string ht_info_psmp_stas_only_flag = {
2639   "Association requests are accepted from only PSMP capable STA",
2640   "Association requests are accepted regardless of PSMP capability"
2641 };
2642
2643 static const value_string ht_info_service_interval_granularity_flags[] = {
2644   {0x00, "5 ms"},
2645   {0x01, "10 ms"},
2646   {0x02, "15 ms"},
2647   {0x03, "20 ms"},
2648   {0x04, "25 ms"},
2649   {0x05, "30 ms"},
2650   {0x06, "35 ms"},
2651   {0x07, "40 ms"},
2652   {0x00, NULL}
2653 };
2654
2655 static const value_string ht_info_operating_mode_flags[] = {
2656   {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"},
2657   {0x01, "HT non-member protection mode"},
2658   {0x02, "Only HT STAs in the BSS, however, there exists at least one 20 MHz STA"},
2659   {0x03, "HT mixed mode"},
2660   {0x00, NULL}
2661 };
2662
2663 static const true_false_string ht_info_non_greenfield_sta_present_flag = {
2664   "One or more associated STAs are not greenfield capable",
2665   "All associated STAs are greenfield capable"
2666 };
2667
2668 static const true_false_string ht_info_transmit_burst_limit_flag = {
2669   "2.4 GHz - 6.16 ms | All other bands - 3.08 ms",
2670   "No limit"
2671 };
2672
2673 static const true_false_string ht_info_obss_non_ht_stas_present_flag = {
2674   "Use of protection for non-HT STAs by overlapping BSSs is needed",
2675   "Use of protection for non-HT STAs by overlapping BSSs is not needed"
2676 };
2677
2678 static const true_false_string ht_info_dual_beacon_flag = {
2679   "AP transmits a secondary beacon",
2680   "No second beacon is transmitted"
2681 };
2682
2683 static const true_false_string ht_info_dual_cts_protection_flag = {
2684   "Required",
2685   "Not required"
2686 };
2687
2688 static const true_false_string ht_info_secondary_beacon_flag = {
2689   "Secondary beacon",
2690   "Primary beacon"
2691 };
2692
2693 static const true_false_string ht_info_lsig_txop_protection_full_support_flag = {
2694   "All HT STAs in the BSS support L-SIG TXOP protection",
2695   "One or more HT STAs in the BSS do not support L-SIG TXOP protection"
2696 };
2697
2698 static const true_false_string ht_info_pco_phase_flag = {
2699   "Switch to or continue 40 MHz phase",
2700   "Switch to or continue 20 MHz phase"
2701 };
2702
2703 static const true_false_string htc_lac_trq_flag = {
2704   "Want sounding PPDU",
2705   "Don't want sounding PPDU"
2706 };
2707
2708 static const true_false_string htc_lac_mai_mrq_flag = {
2709   "MCS feedback requested",
2710   "No MCS feedback requested"
2711 };
2712
2713 static const value_string ieee80211_htc_lac_asel_command_flags[] = {
2714   {0x00, "Transmit Antenna Selection Sounding Indication (TXASSI)"},
2715   {0x01, "Transmit Antenna Selection Sounding Request (TXASSR)"},
2716   {0x02, "Receive Antenna Selection Sounding Indication (RXASSI)"},
2717   {0x03, "Receive Antenna Selection Sounding Request (RXASSR)"},
2718   {0x04, "Sounding Label"},
2719   {0x05, "No feedback, ASEL training failure"},
2720   {0x06, "Transmit Antenna Selection Sounding Indication (TXASSI) requesting feedback of explicit CSI"},
2721   {0x07, "Reserved"},
2722   {0x00, NULL}
2723 };
2724
2725 static const value_string ieee80211_htc_cal_pos_flags[] = {
2726   {0x00, "Not a calibration frame"},
2727   {0x01, "Calibration Start"},
2728   {0x02, "Sounding Response"},
2729   {0x03, "Sounding Complete"},
2730   {0x00, NULL}
2731 };
2732
2733 static const value_string ieee80211_htc_csi_steering_flags[] = {
2734   {0x00, "No feedback required"},
2735   {0x01, "CSI"},
2736   {0x02, "Non-compressed Beamforming Feedback Matrix"},
2737   {0x03, "Compressed Beamforming Feedback Matrix"},
2738   {0x00, NULL}
2739 };
2740
2741 static const true_false_string ieee80211_htc_ndp_announcement_flag = {
2742   "NDP will follow",
2743   "No NDP will follow"
2744 };
2745
2746 static const value_string ieee80211_htc_bw_recommended_vht_mcs_vals[] = {
2747   {0, "20 MHz"},
2748   {1, "40 MHz"},
2749   {2, "80 MHz"},
2750   {3, "160 MHz and 80+80 MHz"},
2751   {0, NULL}
2752 };
2753
2754 static const value_string ieee80211_htc_coding_type_vals[] = {
2755   {0, "BCC"},
2756   {1, "LDPC"},
2757   {0, NULL}
2758 };
2759
2760 static const value_string ieee80211_htc_fb_tx_type_vals[] = {
2761   {0, "Not beamformed"},
2762   {1, "Beamformed"},
2763   {0, NULL}
2764 };
2765
2766 static const value_string ieee80211_tag_secondary_channel_offset_flags[] = {
2767   {0x00, "No Secondary Channel"},
2768   {0x01, "Above Primary Channel"},
2769   {0x02, "Reserved"},
2770   {0x03, "Below Primary Channel"},
2771   {0x00, NULL}
2772 };
2773
2774 #define BSS_BITMASK_UP0   0x0001
2775 #define BSS_BITMASK_UP1   0x0002
2776 #define BSS_BITMASK_UP2   0x0004
2777 #define BSS_BITMASK_UP3   0x0008
2778 #define BSS_BITMASK_UP4   0x0010
2779 #define BSS_BITMASK_UP5   0x0020
2780 #define BSS_BITMASK_UP6   0x0040
2781 #define BSS_BITMASK_UP7   0x0080
2782 #define BSS_BITMASK_AC0   0x0100
2783 #define BSS_BITMASK_AC1   0x0200
2784 #define BSS_BITMASK_AC2   0x0400
2785 #define BSS_BITMASK_AC3   0x0800
2786 #define BSS_BITMASK_RSV   0xF000
2787
2788 static const value_string ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags[] = {
2789   {0x00, "Frames may be transmitted before the channel switch has been completed"},
2790   {0x01, "No more frames are to be transmitted until the channel switch has been completed"},
2791   {0x00, NULL}
2792 };
2793
2794 static const value_string service_interval_granularity_vals[] = {
2795   { 0, "5 ms" },
2796   { 1, "10 ms" },
2797   { 2, "15 ms" },
2798   { 3, "20 ms" },
2799   { 4, "25 ms" },
2800   { 5, "30 ms" },
2801   { 6, "35 ms" },
2802   { 7, "40 ms" },
2803   { 0x00, NULL }
2804 };
2805
2806 static const value_string wep_type_vals[] = {
2807   { DOT11DECRYPT_KEY_TYPE_WEP, STRING_KEY_TYPE_WEP },
2808   { DOT11DECRYPT_KEY_TYPE_WPA_PWD, STRING_KEY_TYPE_WPA_PWD },
2809   { DOT11DECRYPT_KEY_TYPE_WPA_PSK, STRING_KEY_TYPE_WPA_PSK },
2810   { 0x00, NULL }
2811 };
2812
2813 static const value_string ieee80211_ht_pren_type_vals[] = {
2814   { 51,  "HT Capabilities (802.11n D1.10)" },
2815   { 52,  "HT Additional Capabilities (802.11n D1.00)" },
2816   { 0, NULL }
2817 };
2818
2819 static const true_false_string ieee80211_cf_ssw_direction = {
2820   "Transmitted by the beamforming responder",
2821   "Transmitted by the beamforming initiator"
2822 };
2823
2824 static const value_string bss_type[] = {
2825   {0x0, "Reserved"},
2826   {0x1, "IBSS"},
2827   {0x2, "PBSS"},
2828   {0x3, "Infrastructure BSS"},
2829   {0,   NULL}
2830 };
2831
2832 static const value_string band_id[] = {
2833   {0x0, "TV white spaces"},
2834   {0x1, "Sub-1 GHZ (excluding TV white spaces)"},
2835   {0x2, "2.4 GHZ"},
2836   {0x3, "3.6 GHZ"},
2837   {0x4, "4.9 and 5 GHZ"},
2838   {0x5, "60 GHZ"},
2839   {0,   NULL}
2840 };
2841
2842 static const value_string allocation_type[] = {
2843   {0x0, "SP Allocation"},
2844   {0x4, "CBAP allocation"},
2845   {0,   NULL}
2846 };
2847
2848 static const value_string vht_operation_info_channel_width[] = {
2849   {0x00, "20MHz or 40MHz"},
2850   {0x01, "80MHZ"},
2851   {0x10, "160MHz"},
2852   {0x11, "80MHz+80MHz"},
2853   {0, NULL}
2854 };
2855 static const value_string operating_mode_field_channel_width[] = {
2856   {0x00, "20MHz"},
2857   {0x01, "40MHZ"},
2858   {0x02, "80MHz"},
2859   {0x03, "160MHz or 80MHz+80MHz"},
2860   {0, NULL}
2861 };
2862
2863 static const value_string operat_mode_field_rxnss[] = {
2864   {0x0, "1Nss"},
2865   {0x1, "2Nss"},
2866   {0x2, "3Nss"},
2867   {0x3, "4Nss"},
2868   {0x4, "5Nss"},
2869   {0x5, "6Nss"},
2870   {0x6, "7Nss"},
2871   {0x7, "8Nss"},
2872   {0, NULL}
2873 };
2874
2875 #define VHT_ACT_VHT_COMPRESSED_BEAMFORMING  0
2876 #define VHT_ACT_GROUP_ID_MANAGEMENT         1
2877 #define VHT_ACT_OPERATION_MODE_NOTIFICATION 2
2878
2879 static const value_string vht_action_vals[] = {
2880   {VHT_ACT_VHT_COMPRESSED_BEAMFORMING, "VHT Compressed Beamforming"},
2881   {VHT_ACT_GROUP_ID_MANAGEMENT, "Group ID Management"},
2882   {VHT_ACT_OPERATION_MODE_NOTIFICATION, "Operating Mode Notification"},
2883   {0,   NULL}
2884 };
2885
2886 static const value_string ff_vht_mimo_cntrl_nc_index_vals[] = {
2887   {0x00, "1 Column"},
2888   {0x01, "2 Columns"},
2889   {0x02, "3 Columns"},
2890   {0x03, "4 Columns"},
2891   {0x04, "5 Columns"},
2892   {0x05, "6 Columns"},
2893   {0x06, "7 Columns"},
2894   {0x07, "8 Columns"},
2895   {0, NULL}
2896 };
2897
2898 static const value_string ff_vht_mimo_cntrl_nr_index_vals[] = {
2899   {0x00, "1 Row"},
2900   {0x01, "2 Rows"},
2901   {0x02, "3 Rows"},
2902   {0x03, "4 Rows"},
2903   {0x04, "5 Rows"},
2904   {0x05, "6 Rows"},
2905   {0x06, "7 Rows"},
2906   {0x07, "8 Rows"},
2907   {0, NULL}
2908 };
2909
2910 static const value_string ff_vht_mimo_cntrl_channel_width_vals[] = {
2911   {0x00, "20 MHz"},
2912   {0x01, "40 MHz"},
2913   {0x02, "80 MHz"},
2914   {0x03, "160 MHz / 80+80 MHz"},
2915   {0, NULL}
2916 };
2917
2918 static const value_string ff_vht_mimo_cntrl_grouping_vals[] = {
2919   {0x00, "1 (No Grouping)"},
2920   {0x01, "2"},
2921   {0x02, "4"},
2922   {0x03, "Reserved"},
2923   {0, NULL}
2924 };
2925
2926 static const value_string ff_vht_mimo_cntrl_feedback_vals[] = {
2927   {0x00, "SU"},
2928   {0x01, "MU"},
2929   {0, NULL}
2930 };
2931
2932 static int proto_wlan = -1;
2933 static int proto_centrino = -1;
2934 static int proto_aggregate = -1;
2935 static gboolean ieee80211_tvb_invalid = FALSE;
2936
2937 /* ************************************************************************* */
2938 /*                Header field info values for FC-field                      */
2939 /* ************************************************************************* */
2940 static int hf_ieee80211_fc_field = -1;
2941 static int hf_ieee80211_fc_proto_version = -1;
2942 static int hf_ieee80211_fc_frame_type = -1;
2943 static int hf_ieee80211_fc_frame_subtype = -1;
2944 static int hf_ieee80211_fc_frame_extension = -1;
2945 static int hf_ieee80211_fc_frame_type_subtype = -1;
2946
2947 static int hf_ieee80211_fc_flags = -1;
2948 static int hf_ieee80211_fc_to_ds = -1;
2949 static int hf_ieee80211_fc_from_ds = -1;
2950 static int hf_ieee80211_fc_data_ds = -1;
2951
2952 static int hf_ieee80211_fc_more_frag = -1;
2953 static int hf_ieee80211_fc_retry = -1;
2954 static int hf_ieee80211_fc_pwr_mgt = -1;
2955 static int hf_ieee80211_fc_more_data = -1;
2956 static int hf_ieee80211_fc_protected = -1;
2957 static int hf_ieee80211_fc_order = -1;
2958
2959 typedef struct retransmit_key {
2960   guint8  bssid[6];
2961   guint8  src[6];
2962   guint16 seq_control;
2963   guint   fnum;
2964 } retransmit_key;
2965
2966 static GHashTable *fc_analyse_retransmit_table = NULL;
2967 static GHashTable *fc_first_frame_table = NULL;
2968
2969 static int hf_ieee80211_fc_analysis_retransmission = -1;
2970 static int hf_ieee80211_fc_analysis_retransmission_frame = -1;
2971
2972 /* ************************************************************************* */
2973 /*                   Header values for Duration/ID field                     */
2974 /* ************************************************************************* */
2975 static int hf_ieee80211_did_duration = -1;
2976 static int hf_ieee80211_assoc_id = -1;
2977
2978 /* ************************************************************************* */
2979 /*         Header values for different address-fields (all 4 of them)        */
2980 /* ************************************************************************* */
2981 static int hf_ieee80211_addr_da = -1;  /* Destination address subfield */
2982 static int hf_ieee80211_addr_da_resolved = -1;  /* Dst addr subfield resolved*/
2983 static int hf_ieee80211_addr_sa = -1;  /* Source address subfield */
2984 static int hf_ieee80211_addr_sa_resolved = -1;  /* Src addr subfield resolved*/
2985 static int hf_ieee80211_addr_ra = -1;  /* Receiver address subfield */
2986 static int hf_ieee80211_addr_ra_resolved = -1;  /* Rcv addr subfield resolved*/
2987 static int hf_ieee80211_addr_ta = -1;  /* Transmitter address subfield */
2988 static int hf_ieee80211_addr_ta_resolved = -1;  /* Txm addr subfield resolved*/
2989 static int hf_ieee80211_addr_bssid = -1;  /* address is bssid */
2990 static int hf_ieee80211_addr_bssid_resolved = -1;  /* bssid resolved*/
2991 static int hf_ieee80211_addr_staa = -1;  /* address is station address */
2992 static int hf_ieee80211_addr_staa_resolved = -1;  /* station address resolved*/
2993
2994 static int hf_ieee80211_addr = -1;  /* Source or destination address subfield */
2995 static int hf_ieee80211_addr_resolved = -1;/*Src/dst address subfield resolved*/
2996
2997 /* ************************************************************************* */
2998 /*                Header values for QoS control field                        */
2999 /* ************************************************************************* */
3000 static int hf_ieee80211_qos = -1;
3001 static int hf_ieee80211_qos_tid = -1;
3002 static int hf_ieee80211_qos_priority = -1;
3003 static int hf_ieee80211_qos_ack_policy = -1;
3004 static int hf_ieee80211_qos_amsdu_present = -1;
3005 static int hf_ieee80211_qos_eosp = -1;
3006 static int hf_ieee80211_qos_bit4 = -1;
3007 static int hf_ieee80211_qos_txop_limit = -1;
3008 static int hf_ieee80211_qos_ps_buf_state = -1;
3009 static int hf_ieee80211_qos_buf_state_indicated = -1;
3010 static int hf_ieee80211_qos_highest_pri_buf_ac = -1;
3011 static int hf_ieee80211_qos_qap_buf_load = -1;
3012 static int hf_ieee80211_qos_txop_dur_req = -1;
3013 static int hf_ieee80211_qos_queue_size = -1;
3014
3015 /* ************************************************************************* */
3016 /*                Header values for HT control field (+HTC) and HE control   */
3017 /* ************************************************************************* */
3018 /* 802.11-2012 and 802.11ac-2013 8.2.4.6 */
3019 static int hf_ieee80211_htc = -1;
3020 static int hf_ieee80211_htc_vht = -1;
3021 static int hf_ieee80211_htc_he = -1;
3022 static int hf_ieee80211_htc_he_ctrl_id = -1;
3023 static int hf_ieee80211_he_umrs_he_tb_ppdu_len = -1;
3024 static int hf_ieee80211_he_umrs_ru_allocation = -1;
3025 static int hf_ieee80211_he_dl_tx_power = -1;
3026 static int hf_ieee80211_he_ul_target_rssi = -1;
3027 static int hf_ieee80211_he_ul_mcs = -1;
3028 static int hf_ieee80211_he_om_rx_nss = -1;
3029 static int hf_ieee80211_he_om_channel_width = -1;
3030 static int hf_ieee80211_he_om_ul_mu_disable = -1;
3031 static int hf_ieee80211_he_om_tx_nsts = -1;
3032 static int hf_ieee80211_he_hla_unsolicited_mfb = -1;
3033 static int hf_ieee80211_he_hla_mrq = -1;
3034 static int hf_ieee80211_he_hla_nss = -1;
3035 static int hf_ieee80211_he_hla_he_mcs = -1;
3036 static int hf_ieee80211_he_hla_dcm = -1;
3037 static int hf_ieee80211_he_hla_ru = -1;
3038 static int hf_ieee80211_he_hla_bw = -1;
3039 static int hf_ieee80211_he_hla_msi_ppdu_type = -1;
3040 static int hf_ieee80211_he_hla_tx_bf = -1;
3041 static int hf_ieee80211_he_bsr_aci_bitmap = -1;
3042 static int hf_ieee80211_he_bsr_delta_tid = -1;
3043 static int hf_ieee80211_he_bsr_aci_high = -1;
3044 static int hf_ieee80211_he_bsr_scaling_factor = -1;
3045 static int hf_ieee80211_he_bsr_queue_size_high = -1;
3046 static int hf_ieee80211_he_bsr_queue_size_all = -1;
3047 static int hf_ieee80211_he_uph_ul_power_headroom = -1;
3048 static int hf_ieee80211_he_uph_ul_min_transmit_power_flag = -1;
3049 static int hf_ieee80211_he_cci_ac_constraint = -1;
3050 static int hf_ieee80211_he_cci_rdg_more_ppdu = -1;
3051 static int hf_ieee80211_he_cci_sr_ppdu_indic = -1;
3052 static int hf_ieee80211_he_btc_avail_chan = -1;
3053 static int hf_ieee80211_he_btc_reserved = -1;
3054 static int hf_ieee80211_he_trigger_common_info = -1;
3055 static int hf_ieee80211_he_trigger_type = -1;
3056 static int hf_ieee80211_he_trigger_length = -1;
3057 static int hf_ieee80211_he_trigger_cascade_indication = -1;
3058 static int hf_ieee80211_he_trigger_cs_required = -1;
3059 static int hf_ieee80211_he_trigger_bw = -1;
3060 static int hf_ieee80211_he_trigger_gi_and_ltf_type = -1;
3061 static int hf_ieee80211_he_trigger_mu_mimo_ltf_mode = -1;
3062 static int hf_ieee80211_he_trigger_num_he_ltf_syms_etc = -1;
3063 static int hf_ieee80211_he_trigger_stbc = -1;
3064 static int hf_ieee80211_he_trigger_ldpc_extra_sym_seg = -1;
3065 static int hf_ieee80211_he_trigger_ap_tx_power = -1;
3066 static int hf_ieee80211_he_trigger_packet_extension = -1;
3067 static int hf_ieee80211_he_trigger_spatial_reuse = -1;
3068 static int hf_ieee80211_he_trigger_doppler = -1;
3069 static int hf_ieee80211_he_trigger_he_sig_a_reserved = -1;
3070 static int hf_ieee80211_he_trigger_reserved = -1;
3071 static int hf_ieee80211_he_trigger_bar_ctrl = -1;
3072 static int hf_ieee80211_he_trigger_bar_ctrl_ba_ack_policy = -1;
3073 static int hf_ieee80211_he_trigger_bar_ctrl_ba_type = -1;
3074 static int hf_ieee80211_he_trigger_bar_ctrl_reserved = -1;
3075 static int hf_ieee80211_he_trigger_bar_ctrl_tid_info = -1;
3076 static int hf_ieee80211_he_trigger_bar_info = -1;
3077 static int hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl = -1;
3078 static int hf_ieee80211_he_trigger_mpdu_mu_spacing = -1;
3079 static int hf_ieee80211_he_trigger_tid_aggregation_limit = -1;
3080 static int hf_ieee80211_he_trigger_dependent_reserved1 = -1;
3081 static int hf_ieee80211_he_trigger_preferred_ac = -1;
3082 static int hf_ieee80211_he_trigger_user_info = -1;
3083 static int hf_ieee80211_he_trigger_starting_aid = -1;
3084 static int hf_ieee80211_he_trigger_dependent_reserved2 = -1;
3085 static int hf_ieee80211_he_trigger_feedback_type = -1;
3086 static int hf_ieee80211_he_trigger_dependent_reserved3 = -1;
3087 static int hf_ieee80211_he_trigger_nfrp_target_rssi = -1;
3088 static int hf_ieee80211_he_trigger_multiplexing_flag = -1;
3089 static int hf_ieee80211_he_trigger_dep_nfrp_user_info = -1;
3090 static int hf_ieee80211_he_trigger_feedback_seg_retrans_bm = -1;
3091 static int hf_ieee80211_he_trigger_aid12 = -1;
3092 static int hf_ieee80211_he_trigger_ru_allocation = -1;
3093 static int hf_ieee80211_he_trigger_coding_type = -1;
3094 static int hf_ieee80211_he_trigger_mcs = -1;
3095 static int hf_ieee80211_he_trigger_dcm = -1;
3096 static int hf_ieee80211_he_trigger_ss_allocation = -1;
3097 static int hf_ieee80211_he_trigger_target_rssi = -1;
3098 static int hf_ieee80211_he_trigger_user_reserved = -1;
3099 static int hf_ieee80211_he_trigger_dep_basic_user_info = -1;
3100 static int hf_ieee80211_he_ndp_annc_token = -1;
3101 static int hf_ieee80211_he_ndp_annc_sta = -1;
3102 static int hf_he_ndp_sounding_dialog_token_number = -1;
3103 static int hf_he_ndp_annc_he_subfield = -1;
3104 static int hf_he_ndp_annc_reserved = -1;
3105 static int hf_he_ndp_annc_aid11 = -1;
3106 static int hf_he_ndp_annc_partial_bw_info = -1;
3107 static int hf_he_ndp_annc_feedback_type_and_ng = -1;
3108 static int hf_he_ndp_annc_disambiguation = -1;
3109 static int hf_he_ndp_annc_codebook_size = -1;
3110 static int hf_he_ndp_annc_nc = -1;
3111 static int hf_ieee80211_htc_ht_lac = -1;
3112 static int hf_ieee80211_htc_lac_trq = -1;
3113 static int hf_ieee80211_htc_lac_mai_aseli = -1;
3114 static int hf_ieee80211_htc_lac_mai_mrq = -1;
3115 static int hf_ieee80211_htc_lac_mai_msi = -1;
3116 static int hf_ieee80211_htc_lac_mai_reserved = -1;
3117 static int hf_ieee80211_htc_lac_mfsi = -1;
3118 static int hf_ieee80211_htc_lac_mfb = -1;
3119 static int hf_ieee80211_htc_lac_asel_command = -1;
3120 static int hf_ieee80211_htc_lac_asel_data = -1;
3121 static int hf_ieee80211_htc_cal_pos = -1;
3122 static int hf_ieee80211_htc_cal_seq = -1;
3123 static int hf_ieee80211_htc_reserved1 = -1;
3124 static int hf_ieee80211_htc_csi_steering = -1;
3125 static int hf_ieee80211_htc_ndp_announcement = -1;
3126 static int hf_ieee80211_htc_reserved2 = -1;
3127 static int hf_ieee80211_htc_mrq = -1;
3128 static int hf_ieee80211_htc_msi = -1;
3129 static int hf_ieee80211_htc_msi_stbc_reserved = -1;
3130 static int hf_ieee80211_htc_compressed_msi = -1;
3131 static int hf_ieee80211_htc_ppdu_stbc_encoded = -1;
3132 static int hf_ieee80211_htc_mfsi = -1;
3133 static int hf_ieee80211_htc_gid_l = -1;
3134 static int hf_ieee80211_htc_mfb = -1;
3135 static int hf_ieee80211_htc_num_sts = -1;
3136 static int hf_ieee80211_htc_vht_mcs = -1;
3137 static int hf_ieee80211_htc_bw = -1;
3138 static int hf_ieee80211_htc_snr = -1;
3139 static int hf_ieee80211_htc_reserved3 = -1;
3140 static int hf_ieee80211_htc_gid_h = -1;
3141 static int hf_ieee80211_htc_coding_type = -1;
3142 static int hf_ieee80211_htc_fb_tx_type = -1;
3143 static int hf_ieee80211_htc_unsolicited_mfb = -1;
3144 static int hf_ieee80211_htc_ac_constraint = -1;
3145 static int hf_ieee80211_htc_rdg_more_ppdu = -1;
3146
3147 /* ************************************************************************* */
3148 /*                Header values for sequence number field                    */
3149 /* ************************************************************************* */
3150 static int hf_ieee80211_frag_number = -1;
3151 static int hf_ieee80211_seq_number = -1;
3152
3153 /* ************************************************************************* */
3154 /*                   Header values for Frame Check field                     */
3155 /* ************************************************************************* */
3156 static int hf_ieee80211_fcs = -1;
3157 static int hf_ieee80211_fcs_status = -1;
3158
3159 /* ************************************************************************* */
3160 /*                   Header values for reassembly                            */
3161 /* ************************************************************************* */
3162 static int hf_ieee80211_fragments = -1;
3163 static int hf_ieee80211_fragment = -1;
3164 static int hf_ieee80211_fragment_overlap = -1;
3165 static int hf_ieee80211_fragment_overlap_conflict = -1;
3166 static int hf_ieee80211_fragment_multiple_tails = -1;
3167 static int hf_ieee80211_fragment_too_long_fragment = -1;
3168 static int hf_ieee80211_fragment_error = -1;
3169 static int hf_ieee80211_fragment_count = -1;
3170 static int hf_ieee80211_reassembled_in = -1;
3171 static int hf_ieee80211_reassembled_length = -1;
3172
3173 static int proto_wlan_ext = -1;
3174
3175 /* ************************************************************************* */
3176 /*                      Fixed fields found in mgt frames                     */
3177 /* ************************************************************************* */
3178 static int hf_ieee80211_fixed_parameters = -1;  /* Protocol payload for management frames */
3179
3180 static int hf_ieee80211_ff_auth_alg = -1;            /* Authentication algorithm field            */
3181 static int hf_ieee80211_ff_auth_seq = -1;            /* Authentication transaction sequence       */
3182 static int hf_ieee80211_ff_current_ap = -1;          /* Current AP MAC address                    */
3183 static int hf_ieee80211_ff_listen_ival = -1;         /* Listen interval fixed field               */
3184 static int hf_ieee80211_ff_timestamp = -1;           /* 64 bit timestamp                          */
3185 static int hf_ieee80211_ff_beacon_interval = -1;     /* 16 bit Beacon interval                    */
3186 static int hf_ieee80211_ff_assoc_id = -1;            /* 16 bit AID field                          */
3187 static int hf_ieee80211_ff_reason = -1;              /* 16 bit reason code                        */
3188 static int hf_ieee80211_ff_status_code = -1;         /* Status code                               */
3189 static int hf_ieee80211_ff_category_code = -1;       /* 8 bit Category code */
3190 static int hf_ieee80211_ff_action_code = -1;         /* 8 bit Action code */
3191 static int hf_ieee80211_ff_dialog_token = -1;        /* 8 bit Dialog token */
3192 static int hf_ieee80211_ff_followup_dialog_token = -1;
3193 static int hf_ieee80211_ff_wme_action_code = -1;     /* Management notification action code */
3194 static int hf_ieee80211_ff_wme_status_code = -1;     /* Management notification setup response status code */
3195 static int hf_ieee80211_ff_qos_action_code = -1;
3196 static int hf_ieee80211_ff_dls_action_code = -1;
3197 static int hf_ieee80211_ff_dst_mac_addr = -1;        /* DLS destination MAC addressi */
3198 static int hf_ieee80211_ff_src_mac_addr = -1;        /* DLS source MAC addressi */
3199 static int hf_ieee80211_ff_req_ap_addr = -1;
3200 static int hf_ieee80211_ff_res_ap_addr = -1;
3201 static int hf_ieee80211_ff_check_beacon = -1;
3202 static int hf_ieee80211_ff_dls_timeout = -1;         /* DLS timeout value */
3203 static int hf_ieee80211_ff_ft_action_code = -1; /* 8 bit FT Action code */
3204 static int hf_ieee80211_ff_sta_address = -1;
3205 static int hf_ieee80211_ff_target_ap_address = -1;
3206 static int hf_ieee80211_ff_gas_comeback_delay = -1;
3207 static int hf_ieee80211_ff_gas_fragment_id = -1;
3208 static int hf_ieee80211_ff_more_gas_fragments = -1;
3209 static int hf_ieee80211_ff_query_request_length = -1;
3210 static int hf_ieee80211_ff_query_request = -1;
3211 static int hf_ieee80211_ff_query_response_length = -1;
3212 static int hf_ieee80211_ff_query_response = -1;
3213 static int hf_ieee80211_ff_anqp_info_id = -1;
3214 static int hf_ieee80211_ff_anqp_info_length = -1;
3215 static int hf_ieee80211_ff_anqp_info = -1;
3216 static int hf_ieee80211_ff_anqp_query_id = -1;
3217 static int hf_ieee80211_ff_anqp_capability = -1;
3218 static int hf_ieee80211_ff_anqp_capability_vlen = -1;
3219 static int hf_ieee80211_ff_anqp_capability_vendor = -1;
3220 static int hf_ieee80211_ff_venue_info_group = -1;
3221 static int hf_ieee80211_ff_venue_info_type = -1;
3222 static int hf_ieee80211_ff_anqp_venue_length = -1;
3223 static int hf_ieee80211_ff_anqp_venue_language = -1;
3224 static int hf_ieee80211_ff_anqp_venue_name = -1;
3225 static int hf_ieee80211_ff_anqp_nw_auth_type_indicator = -1;
3226 static int hf_ieee80211_ff_anqp_nw_auth_type_url_len = -1;
3227 static int hf_ieee80211_ff_anqp_nw_auth_type_url = -1;
3228 static int hf_ieee80211_ff_anqp_roaming_consortium_oi_len = -1;
3229 static int hf_ieee80211_ff_anqp_roaming_consortium_oi = -1;
3230 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv6 = -1;
3231 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv4 = -1;
3232 static int hf_ieee80211_ff_anqp_nai_realm_count = -1;
3233 static int hf_ieee80211_ff_anqp_nai_field_len = -1;
3234 static int hf_ieee80211_ff_anqp_nai_realm_encoding = -1;
3235 static int hf_ieee80211_ff_anqp_nai_realm_length = -1;
3236 static int hf_ieee80211_ff_anqp_nai_realm = -1;
3237 static int hf_ieee80211_ff_anqp_nai_realm_eap_count = -1;
3238 static int hf_ieee80211_ff_anqp_nai_realm_eap_len = -1;
3239 static int hf_ieee80211_ff_anqp_nai_realm_eap_method = -1;
3240 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_count = -1;
3241 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_id = -1;
3242 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_len = -1;
3243 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_value = -1;
3244 static int hf_ieee80211_3gpp_gc_gud = -1;
3245 static int hf_ieee80211_3gpp_gc_udhl = -1;
3246 static int hf_ieee80211_3gpp_gc_iei = -1;
3247 static int hf_ieee80211_3gpp_gc_num_plmns = -1;
3248 static int hf_ieee80211_3gpp_gc_plmn_len = -1;
3249 static int hf_ieee80211_ff_anqp_domain_name_len = -1;
3250 static int hf_ieee80211_ff_anqp_domain_name = -1;
3251 static int hf_ieee80211_ff_anqp_venue_url_len = -1;
3252 static int hf_ieee80211_ff_anqp_venue_url_number = -1;
3253 static int hf_ieee80211_ff_anqp_venue_url = -1;
3254 static int hf_ieee80211_ff_tdls_action_code = -1;
3255 static int hf_ieee80211_ff_target_channel = -1;
3256 static int hf_ieee80211_ff_operating_class = -1;
3257 static int hf_ieee80211_ff_wnm_action_code = -1;
3258 static int hf_ieee80211_ff_unprotected_wnm_action_code = -1;
3259 static int hf_ieee80211_ff_key_data_length = -1;
3260 static int hf_ieee80211_ff_key_data = -1;
3261 static int hf_ieee80211_ff_wnm_notification_type = -1;
3262 static int hf_ieee80211_ff_rm_action_code = -1;
3263 static int hf_ieee80211_ff_rm_dialog_token = -1;
3264 static int hf_ieee80211_ff_rm_repetitions = -1;
3265 static int hf_ieee80211_ff_rm_tx_power = -1;
3266 static int hf_ieee80211_ff_rm_max_tx_power = -1;
3267 static int hf_ieee80211_ff_tpc = -1;
3268 static int hf_ieee80211_ff_tpc_element_id = -1;
3269 static int hf_ieee80211_ff_tpc_length = -1;
3270 static int hf_ieee80211_ff_tpc_tx_power = -1;
3271 static int hf_ieee80211_ff_tpc_link_margin = -1;
3272 static int hf_ieee80211_ff_rm_rx_antenna_id = -1;
3273 static int hf_ieee80211_ff_rm_tx_antenna_id = -1;
3274 static int hf_ieee80211_ff_rm_rcpi = -1;
3275 static int hf_ieee80211_ff_rm_rsni = -1;
3276 static int hf_ieee80211_ff_request_mode_pref_cand = -1;
3277 static int hf_ieee80211_ff_request_mode_abridged = -1;
3278 static int hf_ieee80211_ff_request_mode_disassoc_imminent = -1;
3279 static int hf_ieee80211_ff_request_mode_bss_term_included = -1;
3280 static int hf_ieee80211_ff_request_mode_ess_disassoc_imminent = -1;
3281 static int hf_ieee80211_ff_disassoc_timer = -1;
3282 static int hf_ieee80211_ff_validity_interval = -1;
3283 static int hf_ieee80211_ff_bss_termination_duration = -1;
3284 static int hf_ieee80211_ff_url_len = -1;
3285 static int hf_ieee80211_ff_url = -1;
3286 static int hf_ieee80211_ff_target_bss = -1;
3287 static int hf_ieee80211_ff_bss_transition_query_reason = -1;
3288 static int hf_ieee80211_ff_bss_transition_status_code = -1;
3289 static int hf_ieee80211_ff_bss_termination_delay = -1;
3290 static int hf_ieee80211_ff_bss_transition_candidate_list_entries = -1;
3291
3292 static int hf_ieee80211_ff_sa_query_action_code = -1;
3293 static int hf_ieee80211_ff_transaction_id = -1;
3294
3295 static int hf_ieee80211_ff_send_confirm = -1;
3296 static int hf_ieee80211_ff_anti_clogging_token = -1;
3297 static int hf_ieee80211_ff_scalar = -1;
3298 static int hf_ieee80211_ff_finite_field_element = -1;
3299 static int hf_ieee80211_ff_confirm = -1;
3300 static int hf_ieee80211_ff_finite_cyclic_group = -1;
3301
3302 /* Vendor specific */
3303 static int hf_ieee80211_ff_marvell_action_type = -1;
3304 static int hf_ieee80211_ff_marvell_mesh_mgt_action_code = -1;
3305 static int hf_ieee80211_ff_marvell_mesh_mgt_length = -1;     /* Mesh Management length */
3306 static int hf_ieee80211_ff_marvell_mesh_mgt_mode = -1;       /* Mesh Management mode */
3307 static int hf_ieee80211_ff_marvell_mesh_mgt_ttl = -1;        /* Mesh Management TTL */
3308 static int hf_ieee80211_ff_marvell_mesh_mgt_dstcount = -1;   /* Mesh Management dst count */
3309 static int hf_ieee80211_ff_marvell_mesh_mgt_hopcount = -1;   /* Mesh Management hop count */
3310 static int hf_ieee80211_ff_marvell_mesh_mgt_rreqid = -1;     /* Mesh Management RREQ ID */
3311 static int hf_ieee80211_ff_marvell_mesh_mgt_sa = -1;         /* Mesh Management src addr */
3312 static int hf_ieee80211_ff_marvell_mesh_mgt_ssn = -1;        /* Mesh Management src sequence number */
3313 static int hf_ieee80211_ff_marvell_mesh_mgt_metric = -1;     /* Mesh Management metric */
3314 static int hf_ieee80211_ff_marvell_mesh_mgt_flags = -1;      /* Mesh Management RREQ flags */
3315 static int hf_ieee80211_ff_marvell_mesh_mgt_da = -1;         /* Mesh Management dst addr */
3316 static int hf_ieee80211_ff_marvell_mesh_mgt_dsn = -1;        /* Mesh Management dst sequence number */
3317 static int hf_ieee80211_ff_marvell_mesh_mgt_lifetime = -1;   /* Mesh Management lifetime */
3318
3319
3320 static int hf_ieee80211_ff_ba_action = -1;
3321
3322 static int hf_ieee80211_ff_block_ack_params = -1;
3323 static int hf_ieee80211_ff_block_ack_params_amsdu_permitted = -1;
3324 static int hf_ieee80211_ff_block_ack_params_policy = -1;
3325 static int hf_ieee80211_ff_block_ack_params_tid = -1;
3326 static int hf_ieee80211_ff_block_ack_params_buffer_size = -1;
3327
3328 static const int *ieee80211_ff_block_ack_params_fields[] = {
3329   &hf_ieee80211_ff_block_ack_params_amsdu_permitted,
3330   &hf_ieee80211_ff_block_ack_params_policy,
3331   &hf_ieee80211_ff_block_ack_params_tid,
3332   &hf_ieee80211_ff_block_ack_params_buffer_size,
3333   NULL
3334 };
3335
3336 static int hf_ieee80211_ff_block_ack_timeout = -1;
3337
3338 static int hf_ieee80211_ff_block_ack_ssc = -1;
3339 static int hf_ieee80211_ff_block_ack_ssc_fragment = -1;
3340 static int hf_ieee80211_ff_block_ack_ssc_sequence = -1;
3341
3342 static const int *ieee80211_ff_block_ack_ssc_fields[] = {
3343   &hf_ieee80211_ff_block_ack_ssc_fragment,
3344   &hf_ieee80211_ff_block_ack_ssc_sequence,
3345   NULL
3346 };
3347
3348 static int hf_ieee80211_ff_delba_param = -1;
3349 static int hf_ieee80211_ff_delba_param_reserved = -1;
3350 static int hf_ieee80211_ff_delba_param_init = -1;
3351 static int hf_ieee80211_ff_delba_param_tid = -1;
3352
3353 static const int *ieee80211_ff_delba_param_fields[] = {
3354   &hf_ieee80211_ff_delba_param_reserved,
3355   &hf_ieee80211_ff_delba_param_init,
3356   &hf_ieee80211_ff_delba_param_tid,
3357   NULL
3358 };
3359
3360 static int hf_ieee80211_ff_max_reg_pwr = -1;
3361 static int hf_ieee80211_ff_measurement_pilot_int = -1;
3362 static int hf_ieee80211_ff_country_str = -1;
3363 static int hf_ieee80211_ff_max_tx_pwr = -1;
3364 static int hf_ieee80211_ff_tx_pwr_used = -1;
3365 static int hf_ieee80211_ff_transceiver_noise_floor = -1;
3366 static int hf_ieee80211_ff_channel_width = -1;
3367
3368 static int hf_ieee80211_ff_qos_info_ap = -1;
3369 static int hf_ieee80211_ff_qos_info_ap_edca_param_set_counter = -1;
3370 static int hf_ieee80211_ff_qos_info_ap_q_ack = -1;
3371 static int hf_ieee80211_ff_qos_info_ap_queue_req = -1;
3372 static int hf_ieee80211_ff_qos_info_ap_txop_request = -1;
3373 static int hf_ieee80211_ff_qos_info_ap_reserved = -1;
3374
3375 static const int *ieee80211_ff_qos_info_ap_fields[] = {
3376   &hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
3377   &hf_ieee80211_ff_qos_info_ap_q_ack,
3378   &hf_ieee80211_ff_qos_info_ap_queue_req,
3379   &hf_ieee80211_ff_qos_info_ap_txop_request,
3380   &hf_ieee80211_ff_qos_info_ap_reserved,
3381   NULL
3382 };
3383
3384 static int hf_ieee80211_ff_qos_info_sta = -1;
3385 static int hf_ieee80211_ff_qos_info_sta_ac_vo = -1;
3386 static int hf_ieee80211_ff_qos_info_sta_ac_vi = -1;
3387 static int hf_ieee80211_ff_qos_info_sta_ac_bk = -1;
3388 static int hf_ieee80211_ff_qos_info_sta_ac_be = -1;
3389 static int hf_ieee80211_ff_qos_info_sta_q_ack = -1;
3390 static int hf_ieee80211_ff_qos_info_sta_max_sp_length = -1;
3391 static int hf_ieee80211_ff_qos_info_sta_more_data_ack = -1;
3392
3393 static const int *ieee80211_ff_qos_info_sta_fields[] = {
3394   &hf_ieee80211_ff_qos_info_sta_ac_vo,
3395   &hf_ieee80211_ff_qos_info_sta_ac_vi,
3396   &hf_ieee80211_ff_qos_info_sta_ac_bk,
3397   &hf_ieee80211_ff_qos_info_sta_ac_be,
3398   &hf_ieee80211_ff_qos_info_sta_q_ack,
3399   &hf_ieee80211_ff_qos_info_sta_max_sp_length,
3400   &hf_ieee80211_ff_qos_info_sta_more_data_ack,
3401   NULL
3402 };
3403
3404 static int hf_ieee80211_ff_sm_pwr_save = -1;
3405 static int hf_ieee80211_ff_sm_pwr_save_enabled = -1;
3406 static int hf_ieee80211_ff_sm_pwr_save_sm_mode = -1;
3407 static int hf_ieee80211_ff_sm_pwr_save_reserved = -1;
3408
3409 static const int *ieee80211_ff_sw_pwr_save_fields[] = {
3410   &hf_ieee80211_ff_sm_pwr_save_enabled,
3411   &hf_ieee80211_ff_sm_pwr_save_sm_mode,
3412   &hf_ieee80211_ff_sm_pwr_save_reserved,
3413   NULL
3414 };
3415
3416 static int hf_ieee80211_ff_pco_phase_cntrl = -1;
3417
3418 static int hf_ieee80211_ff_psmp_param_set = -1;
3419 static int hf_ieee80211_ff_psmp_param_set_n_sta = -1;
3420 static int hf_ieee80211_ff_psmp_param_set_more_psmp = -1;
3421 static int hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration = -1;
3422
3423 static const int *ieee80211_ff_psmp_param_set_fields[] = {
3424   &hf_ieee80211_ff_psmp_param_set_n_sta,
3425   &hf_ieee80211_ff_psmp_param_set_more_psmp,
3426   &hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
3427   NULL
3428 };
3429
3430 static int hf_ieee80211_ff_mimo_cntrl = -1;
3431 static int hf_ieee80211_ff_mimo_cntrl_nc_index = -1;
3432 static int hf_ieee80211_ff_mimo_cntrl_nr_index = -1;
3433 static int hf_ieee80211_ff_mimo_cntrl_channel_width = -1;
3434 static int hf_ieee80211_ff_mimo_cntrl_grouping = -1;
3435 static int hf_ieee80211_ff_mimo_cntrl_coefficient_size = -1;
3436 static int hf_ieee80211_ff_mimo_cntrl_codebook_info = -1;
3437 static int hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment = -1;
3438 static int hf_ieee80211_ff_mimo_cntrl_reserved = -1;
3439 static int hf_ieee80211_ff_mimo_cntrl_sounding_timestamp = -1;
3440
3441 static int hf_ieee80211_ff_ant_selection = -1;
3442 static int hf_ieee80211_ff_ant_selection_0 = -1;
3443 static int hf_ieee80211_ff_ant_selection_1 = -1;
3444 static int hf_ieee80211_ff_ant_selection_2 = -1;
3445 static int hf_ieee80211_ff_ant_selection_3 = -1;
3446 static int hf_ieee80211_ff_ant_selection_4 = -1;
3447 static int hf_ieee80211_ff_ant_selection_5 = -1;
3448 static int hf_ieee80211_ff_ant_selection_6 = -1;
3449 static int hf_ieee80211_ff_ant_selection_7 = -1;
3450
3451 static const int *ieee80211_ff_ant_selection_fields[] = {
3452   &hf_ieee80211_ff_ant_selection_0,
3453   &hf_ieee80211_ff_ant_selection_1,
3454   &hf_ieee80211_ff_ant_selection_2,
3455   &hf_ieee80211_ff_ant_selection_3,
3456   &hf_ieee80211_ff_ant_selection_4,
3457   &hf_ieee80211_ff_ant_selection_5,
3458   &hf_ieee80211_ff_ant_selection_6,
3459   &hf_ieee80211_ff_ant_selection_7,
3460   NULL
3461 };
3462
3463 static int hf_ieee80211_ff_ext_channel_switch_announcement = -1;
3464 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode = -1;
3465 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class = -1;
3466 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number = -1;
3467 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_count = -1;
3468
3469 static const int *ieee80211_ff_ext_channel_switch_announcement_fields[] = {
3470   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
3471   &hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
3472   &hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
3473   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
3474   NULL
3475 };
3476
3477 static int hf_ieee80211_ff_ht_info = -1;
3478 static int hf_ieee80211_ff_ht_info_information_request = -1;
3479 static int hf_ieee80211_ff_ht_info_40_mhz_intolerant = -1;
3480 static int hf_ieee80211_ff_ht_info_sta_chan_width = -1;
3481 static int hf_ieee80211_ff_ht_info_reserved = -1;
3482
3483 static const int *ieee80211_ff_ht_info_fields[] = {
3484   &hf_ieee80211_ff_ht_info_information_request,
3485   &hf_ieee80211_ff_ht_info_40_mhz_intolerant,
3486   &hf_ieee80211_ff_ht_info_sta_chan_width,
3487   &hf_ieee80211_ff_ht_info_reserved,
3488   NULL
3489 };
3490
3491 static int hf_ieee80211_ff_ht_action = -1;
3492
3493 static int hf_ieee80211_ff_psmp_sta_info = -1;
3494 static int hf_ieee80211_ff_psmp_sta_info_type = -1;
3495 static int hf_ieee80211_ff_psmp_sta_info_dtt_start_offset = -1;
3496 static int hf_ieee80211_ff_psmp_sta_info_dtt_duration = -1;
3497 static int hf_ieee80211_ff_psmp_sta_info_sta_id = -1;
3498 static int hf_ieee80211_ff_psmp_sta_info_utt_start_offset = -1;
3499 static int hf_ieee80211_ff_psmp_sta_info_utt_duration = -1;
3500 static int hf_ieee80211_ff_psmp_sta_info_reserved_small= -1;
3501 static int hf_ieee80211_ff_psmp_sta_info_reserved_large = -1;
3502 static int hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id = -1;
3503
3504 static int hf_ieee80211_ff_mimo_csi_snr = -1;
3505 static int hf_ieee80211_ff_mimo_csi_matrices = -1;
3506 static int hf_ieee80211_ff_mimo_csi_bf_matrices = -1;
3507 static int hf_ieee80211_ff_mimo_csi_cbf_matrices = -1;
3508
3509 /*** Begin: 802.11s additions ***/
3510 static int hf_ieee80211_mesh_control_field = -1;
3511
3512 static int hf_ieee80211_ff_mesh_action = -1;
3513 static int hf_ieee80211_ff_multihop_action = -1;
3514 static int hf_ieee80211_ff_mesh_flags = -1;
3515 static int hf_ieee80211_ff_mesh_ttl = -1;
3516 static int hf_ieee80211_ff_mesh_sequence = -1;
3517 static int hf_ieee80211_ff_mesh_addr4 = -1;
3518 static int hf_ieee80211_ff_mesh_addr5 = -1;
3519 static int hf_ieee80211_ff_mesh_addr6 = -1;
3520 static int hf_ieee80211_ff_selfprot_action = -1;
3521
3522 static int hf_ieee80211_mesh_peering_proto = -1;
3523 static int hf_ieee80211_mesh_peering_local_link_id = -1;
3524 static int hf_ieee80211_mesh_peering_peer_link_id = -1;
3525
3526 static int hf_ieee80211_ff_hwmp_flags = -1;
3527 static int hf_ieee80211_ff_hwmp_hopcount = -1;
3528 static int hf_ieee80211_ff_hwmp_ttl = -1;
3529 static int hf_ieee80211_ff_hwmp_pdid = -1;
3530 static int hf_ieee80211_ff_hwmp_orig_sta = -1;
3531 static int hf_ieee80211_ff_hwmp_orig_sn = -1;
3532 static int hf_ieee80211_ff_hwmp_orig_ext = -1;
3533 static int hf_ieee80211_ff_hwmp_lifetime = -1;
3534 static int hf_ieee80211_ff_hwmp_metric = -1;
3535 static int hf_ieee80211_ff_hwmp_targ_count = -1;
3536 static int hf_ieee80211_ff_hwmp_targ_flags = -1;
3537 static int hf_ieee80211_ff_hwmp_targ_to_flags = -1;
3538 static int hf_ieee80211_ff_hwmp_targ_usn_flags = -1;
3539 static int hf_ieee80211_ff_hwmp_targ_sta = -1;
3540 static int hf_ieee80211_ff_hwmp_targ_sn = -1;
3541 static int hf_ieee80211_ff_hwmp_targ_ext = -1;
3542 static int hf_ieee80211_rann_flags = -1;
3543 static int hf_ieee80211_rann_root_sta = -1;
3544 static int hf_ieee80211_rann_sn = -1;
3545 static int hf_ieee80211_rann_interval = -1;
3546
3547 static int hf_ieee80211_mesh_channel_switch_ttl = -1;
3548 static int hf_ieee80211_mesh_channel_switch_flag = -1;
3549 static int hf_ieee80211_mesh_channel_switch_reason_code = -1;
3550 static int hf_ieee80211_mesh_channel_switch_precedence_value = -1;
3551 static int hf_ieee80211_mesh_chswitch_flag_txrestrict = -1;
3552 static int hf_ieee80211_mesh_chswitch_flag_initiator = -1;
3553
3554 static int hf_ieee80211_mesh_config_path_sel_protocol = -1;
3555 static int hf_ieee80211_mesh_config_path_sel_metric = -1;
3556 static int hf_ieee80211_mesh_config_congestion_control = -1;
3557 static int hf_ieee80211_mesh_config_sync_method = -1;
3558 static int hf_ieee80211_mesh_config_auth_protocol = -1;
3559 static int hf_ieee80211_mesh_config_formation_info = -1;
3560 static int hf_ieee80211_mesh_config_capability = -1;
3561 static int hf_ieee80211_mesh_id = -1;
3562 static int hf_ieee80211_mesh_config_cap_accepting = -1;
3563 static int hf_ieee80211_mesh_config_cap_mcca_support = -1;
3564 static int hf_ieee80211_mesh_config_cap_mcca_enabled = -1;
3565 static int hf_ieee80211_mesh_config_cap_forwarding = -1;
3566 static int hf_ieee80211_mesh_config_cap_mbca_enabled = -1;
3567 static int hf_ieee80211_mesh_config_cap_tbtt_adjusting = -1;
3568 static int hf_ieee80211_mesh_config_cap_power_save_level = -1;
3569 static int hf_ieee80211_mesh_form_info_num_of_peerings = -1;
3570 static int hf_ieee80211_mesh_awake_window = -1;
3571
3572 static int hf_ieee80211_ff_public_action = -1;
3573 static int hf_ieee80211_ff_protected_public_action = -1;
3574 static int hf_ieee80211_ff_tod = -1;
3575 static int hf_ieee80211_ff_toa = -1;
3576 static int hf_ieee80211_ff_max_tod_err = -1;
3577 static int hf_ieee80211_ff_max_toa_err = -1;
3578
3579 /* ************************************************************************* */
3580 /*            Flags found in the capability field (fixed field)              */
3581 /* ************************************************************************* */
3582 static int hf_ieee80211_ff_capture = -1;
3583 static int hf_ieee80211_ff_cf_ess = -1;
3584 static int hf_ieee80211_ff_cf_ibss = -1;
3585 static int hf_ieee80211_ff_cf_sta_poll = -1; /* CF pollable status for a STA            */
3586 static int hf_ieee80211_ff_cf_ap_poll = -1;  /* CF pollable status for an AP            */
3587 static int hf_ieee80211_ff_cf_privacy = -1;
3588 static int hf_ieee80211_ff_cf_preamble = -1;
3589 static int hf_ieee80211_ff_cf_pbcc = -1;
3590 static int hf_ieee80211_ff_cf_agility = -1;
3591 static int hf_ieee80211_ff_short_slot_time = -1;
3592 static int hf_ieee80211_ff_dsss_ofdm = -1;
3593 static int hf_ieee80211_ff_cf_spec_man = -1;
3594 static int hf_ieee80211_ff_cf_apsd = -1;
3595 static int hf_ieee80211_ff_radio_measurement = -1;
3596 static int hf_ieee80211_ff_cf_del_blk_ack = -1;
3597 static int hf_ieee80211_ff_cf_imm_blk_ack = -1;
3598
3599 /* ************************************************************************* */
3600 /*                       A-MSDU fields                                       */
3601 /* ************************************************************************* */
3602 static int hf_ieee80211_amsdu_subframe = -1;
3603 static int hf_ieee80211_amsdu_length = -1;
3604
3605 /* ************************************************************************* */
3606 /*                       Tagged value format fields                          */
3607 /* ************************************************************************* */
3608 static int hf_ieee80211_tagged_parameters = -1;  /* Tagged payload item */
3609 static int hf_ieee80211_tag = -1;
3610 static int hf_ieee80211_tag_number = -1;
3611 static int hf_ieee80211_tag_length = -1;
3612 static int hf_ieee80211_tag_interpretation = -1;
3613 static int hf_ieee80211_tag_data = -1;
3614 static int hf_ieee80211_tag_oui = -1;
3615 static int hf_ieee80211_tag_oui_wfa_subtype = -1;
3616 static int hf_ieee80211_tag_ssid = -1;
3617 static int hf_ieee80211_tag_supp_rates = -1;
3618 static int hf_ieee80211_tag_fh_dwell_time = -1;
3619 static int hf_ieee80211_tag_fh_hop_set = -1;
3620 static int hf_ieee80211_tag_fh_hop_pattern = -1;
3621 static int hf_ieee80211_tag_fh_hop_index = -1;
3622 static int hf_ieee80211_tag_ds_param_channel = -1;
3623 static int hf_ieee80211_tag_cfp_count = -1;
3624 static int hf_ieee80211_tag_cfp_period = -1;
3625 static int hf_ieee80211_tag_cfp_max_duration = -1;
3626 static int hf_ieee80211_tag_cfp_dur_remaining = -1;
3627 static int hf_ieee80211_tim_dtim_count = -1;
3628 static int hf_ieee80211_tim_dtim_period = -1;
3629 static int hf_ieee80211_tim_bmapctl = -1;
3630 static int hf_ieee80211_tim_bmapctl_mcast = -1;
3631 static int hf_ieee80211_tim_bmapctl_offset = -1;
3632 static int hf_ieee80211_tim_partial_virtual_bitmap = -1;
3633 static int hf_ieee80211_tim_aid = -1;
3634 static int hf_ieee80211_tag_ibss_atim_window = -1;
3635 static int hf_ieee80211_tag_country_info_code = -1;
3636 static int hf_ieee80211_tag_country_info_env = -1;
3637 static int hf_ieee80211_tag_country_info_pad = -1;
3638 static int hf_ieee80211_tag_country_info_fnm = -1;
3639 static int hf_ieee80211_tag_country_info_fnm_fcn = -1;
3640 static int hf_ieee80211_tag_country_info_fnm_nc = -1;
3641 static int hf_ieee80211_tag_country_info_fnm_mtpl = -1;
3642 static int hf_ieee80211_tag_country_info_rrc = -1;
3643 static int hf_ieee80211_tag_country_info_rrc_oei = -1;
3644 static int hf_ieee80211_tag_country_info_rrc_oc = -1;
3645 static int hf_ieee80211_tag_country_info_rrc_cc = -1;
3646 static int hf_ieee80211_tag_fh_hopping_parameter_prime_radix = -1;
3647 static int hf_ieee80211_tag_fh_hopping_parameter_nb_channels = -1;
3648 static int hf_ieee80211_tag_fh_hopping_table_flag = -1;
3649 static int hf_ieee80211_tag_fh_hopping_table_number_of_sets = -1;
3650 static int hf_ieee80211_tag_fh_hopping_table_modulus = -1;
3651 static int hf_ieee80211_tag_fh_hopping_table_offset = -1;
3652 static int hf_ieee80211_tag_fh_hopping_random_table = -1;
3653 static int hf_ieee80211_tag_request = -1;
3654 static int hf_ieee80211_tag_challenge_text = -1;
3655
3656 static int hf_ieee80211_wep_iv = -1;
3657 static int hf_ieee80211_wep_iv_weak = -1;
3658 static int hf_ieee80211_tkip_extiv = -1;
3659 static int hf_ieee80211_ccmp_extiv = -1;
3660 static int hf_ieee80211_wep_key = -1;
3661 static int hf_ieee80211_wep_icv = -1;
3662 static int hf_ieee80211_fc_analysis_pmk = -1;
3663 static int hf_ieee80211_fc_analysis_tk = -1;
3664 static int hf_ieee80211_fc_analysis_gtk = -1;
3665
3666 static int hf_ieee80211_block_ack_control = -1;
3667 static int hf_ieee80211_block_ack_control_ack_policy = -1;
3668 static int hf_ieee80211_block_ack_control_type = -1;
3669 static int hf_ieee80211_block_ack_control_reserved = -1;
3670 static int hf_ieee80211_block_ack_control_tid_info = -1;
3671
3672 static int hf_ieee80211_block_ack_multi_tid_reserved = -1;
3673 static int hf_ieee80211_block_ack_multi_tid_value = -1;
3674 static int hf_ieee80211_block_ack_bitmap = -1;
3675 static int hf_ieee80211_block_ack_bitmap_missing_frame = -1;
3676 static int hf_ieee80211_block_ack_gcr_addr = -1;
3677
3678 static int hf_ieee80211_tag_measure_request_measurement_mode = -1;
3679 static int hf_ieee80211_tag_measure_request_bssid = -1;
3680
3681 static int hf_ieee80211_tag_measure_request_subelement_length = -1;
3682 static int hf_ieee80211_tag_measure_request_beacon_sub_id = -1;
3683 static int hf_ieee80211_tag_measure_request_beacon_sub_ssid = -1;
3684 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition = -1;
3685 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset = -1;
3686 static int hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail = -1;
3687 static int hf_ieee80211_tag_measure_request_beacon_sub_request = -1;
3688 static int hf_ieee80211_tag_measure_request_beacon_unknown = -1;
3689
3690 static int hf_ieee80211_tag_measure_request_channel_load_sub_id = -1;
3691 static int hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition = -1;
3692 static int hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref = -1;
3693
3694 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_id = -1;
3695 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition = -1;
3696 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref = -1;
3697
3698 static int hf_ieee80211_tag_measure_request_frame_request_type = -1;
3699 static int hf_ieee80211_tag_measure_request_mac_address  = -1;
3700 static int hf_ieee80211_tag_measure_request_peer_mac_address = -1;
3701 static int hf_ieee80211_tag_measure_request_group_id = -1;
3702
3703 static int hf_ieee80211_tag_measure_request_unknown = -1;
3704
3705 static int hf_ieee80211_ht_pren_type = -1;
3706 static int hf_ieee80211_ht_pren_unknown = -1;
3707
3708 static int hf_ieee80211_ht_cap = -1;
3709 static int hf_ieee80211_ht_vs_cap = -1;
3710 static int hf_ieee80211_ht_ldpc_coding = -1;
3711 static int hf_ieee80211_ht_chan_width = -1;
3712 static int hf_ieee80211_ht_sm_pwsave = -1;
3713 static int hf_ieee80211_ht_green = -1;
3714 static int hf_ieee80211_ht_short20 = -1;
3715 static int hf_ieee80211_ht_short40 = -1;
3716 static int hf_ieee80211_ht_tx_stbc = -1;
3717 static int hf_ieee80211_ht_rx_stbc = -1;
3718 static int hf_ieee80211_ht_delayed_block_ack = -1;
3719 static int hf_ieee80211_ht_max_amsdu = -1;
3720 static int hf_ieee80211_ht_dss_cck_40 = -1;
3721 static int hf_ieee80211_ht_psmp = -1;
3722 static int hf_ieee80211_ht_40_mhz_intolerant = -1;
3723 static int hf_ieee80211_ht_l_sig = -1;
3724
3725 static int hf_ieee80211_ext_bss_mu_mimo_capable_sta_count = -1;
3726 static int hf_ieee80211_ext_bss_ss_underutilization = -1;
3727 static int hf_ieee80211_ext_bss_observable_sec_20mhz_utilization = -1;
3728 static int hf_ieee80211_ext_bss_observable_sec_40mhz_utilization = -1;
3729 static int hf_ieee80211_ext_bss_observable_sec_80mhz_utilization = -1;
3730 static int hf_ieee80211_wide_bw_new_channel_width = -1;
3731 static int hf_ieee80211_wide_bw_new_channel_center_freq_segment0 = -1;
3732 static int hf_ieee80211_wide_bw_new_channel_center_freq_segment1 = -1;
3733
3734 static int hf_ieee80211_operat_notification_mode = -1;
3735 static int hf_ieee80211_operat_mode_field_channel_width = -1;
3736 static int hf_ieee80211_operat_mode_field_reserved = -1;
3737 static int hf_ieee80211_operat_mode_field_rxnss = -1;
3738 static int hf_ieee80211_operat_mode_field_rxnsstype= -1;
3739 static int hf_ieee80211_ampduparam = -1;
3740 static int hf_ieee80211_ampduparam_vs = -1;
3741 static int hf_ieee80211_ampduparam_mpdu = -1;
3742 static int hf_ieee80211_ampduparam_mpdu_start_spacing = -1;
3743 static int hf_ieee80211_ampduparam_reserved = -1;
3744
3745 static int hf_ieee80211_mcsset = -1;
3746 static int hf_ieee80211_mcsset_vs = -1;
3747 static int hf_ieee80211_mcsset_rx_bitmask = -1;
3748 static int hf_ieee80211_mcsset_rx_bitmask_0to7 = -1;
3749 static int hf_ieee80211_mcsset_rx_bitmask_8to15 = -1;
3750 static int hf_ieee80211_mcsset_rx_bitmask_16to23 = -1;
3751 static int hf_ieee80211_mcsset_rx_bitmask_24to31 = -1;
3752 static int hf_ieee80211_mcsset_rx_bitmask_32 = -1;
3753 static int hf_ieee80211_mcsset_rx_bitmask_33to38 = -1;
3754 static int hf_ieee80211_mcsset_rx_bitmask_39to52 = -1;
3755 static int hf_ieee80211_mcsset_rx_bitmask_53to76 = -1;
3756 static int hf_ieee80211_mcsset_highest_data_rate = -1;
3757 static int hf_ieee80211_mcsset_tx_mcs_set_defined = -1;
3758 static int hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal = -1;
3759 static int hf_ieee80211_mcsset_tx_max_spatial_streams = -1;
3760 static int hf_ieee80211_mcsset_tx_unequal_modulation = -1;
3761
3762 static int hf_ieee80211_htex_cap = -1;
3763 static int hf_ieee80211_htex_vs_cap = -1;
3764 static int hf_ieee80211_htex_pco = -1;
3765 static int hf_ieee80211_htex_transtime = -1;
3766 static int hf_ieee80211_htex_mcs = -1;
3767 static int hf_ieee80211_htex_htc_support = -1;
3768 static int hf_ieee80211_htex_rd_responder = -1;
3769
3770 static int hf_ieee80211_txbf = -1;
3771 static int hf_ieee80211_txbf_vs = -1;
3772 static int hf_ieee80211_txbf_cap = -1;
3773 static int hf_ieee80211_txbf_rcv_ssc = -1;
3774 static int hf_ieee80211_txbf_tx_ssc = -1;
3775 static int hf_ieee80211_txbf_rcv_ndp = -1;
3776 static int hf_ieee80211_txbf_tx_ndp = -1;
3777 static int hf_ieee80211_txbf_impl_txbf = -1;
3778 static int hf_ieee80211_txbf_calib = -1;
3779 static int hf_ieee80211_txbf_expl_csi = -1;
3780 static int hf_ieee80211_txbf_expl_uncomp_fm = -1;
3781 static int hf_ieee80211_txbf_expl_comp_fm = -1;
3782 static int hf_ieee80211_txbf_expl_bf_csi = -1;
3783 static int hf_ieee80211_txbf_expl_uncomp_fm_feed = -1;
3784 static int hf_ieee80211_txbf_expl_comp_fm_feed = -1;
3785 static int hf_ieee80211_txbf_csi_num_bf_ant = -1;
3786 static int hf_ieee80211_txbf_min_group = -1;
3787 static int hf_ieee80211_txbf_uncomp_sm_bf_ant = -1;
3788 static int hf_ieee80211_txbf_comp_sm_bf_ant = -1;
3789 static int hf_ieee80211_txbf_csi_max_rows_bf = -1;
3790 static int hf_ieee80211_txbf_chan_est = -1;
3791 static int hf_ieee80211_txbf_resrv = -1;
3792
3793 /*** Begin: 802.11n D1.10 - HT Information IE  ***/
3794 static int hf_ieee80211_ht_info_primary_channel = -1;
3795
3796 static int hf_ieee80211_ht_info_delimiter1 = -1;
3797 static int hf_ieee80211_ht_info_secondary_channel_offset = -1;
3798 static int hf_ieee80211_ht_info_channel_width = -1;
3799 static int hf_ieee80211_ht_info_rifs_mode = -1;
3800 static int hf_ieee80211_ht_info_psmp_stas_only = -1;
3801 static int hf_ieee80211_ht_info_service_interval_granularity = -1;
3802
3803 static int hf_ieee80211_ht_info_delimiter2 = -1;
3804 static int hf_ieee80211_ht_info_operating_mode = -1;
3805 static int hf_ieee80211_ht_info_non_greenfield_sta_present = -1;
3806 static int hf_ieee80211_ht_info_transmit_burst_limit = -1;
3807 static int hf_ieee80211_ht_info_obss_non_ht_stas_present = -1;
3808 static int hf_ieee80211_ht_info_reserved_1 = -1;
3809
3810 static int hf_ieee80211_ht_info_delimiter3 = -1;
3811 static int hf_ieee80211_ht_info_reserved_2 = -1;
3812 static int hf_ieee80211_ht_info_dual_beacon = -1;
3813 static int hf_ieee80211_ht_info_dual_cts_protection = -1;
3814 static int hf_ieee80211_ht_info_secondary_beacon = -1;
3815 static int hf_ieee80211_ht_info_lsig_txop_protection_full_support = -1;
3816 static int hf_ieee80211_ht_info_pco_active = -1;
3817 static int hf_ieee80211_ht_info_pco_phase = -1;
3818 static int hf_ieee80211_ht_info_reserved_3 = -1;
3819 /*** End: 802.11n D1.10 - HT Information IE  ***/
3820
3821 static int hf_ieee80211_tag_ap_channel_report_operating_class = -1;
3822 static int hf_ieee80211_tag_ap_channel_report_channel_list = -1;
3823
3824 static int hf_ieee80211_tag_secondary_channel_offset = -1;
3825
3826 static int hf_ieee80211_tag_bss_ap_avg_access_delay = -1;
3827
3828 static int hf_ieee80211_tag_antenna_id = -1;
3829
3830 static int hf_ieee80211_tag_rsni = -1;
3831
3832 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask = -1;
3833 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0 = -1;
3834 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1 = -1;
3835 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2 = -1;
3836 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3 = -1;
3837 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4 = -1;
3838 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5 = -1;
3839 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6 = -1;
3840 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7 = -1;
3841 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0 = -1;
3842 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1 = -1;
3843 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2 = -1;
3844 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3 = -1;
3845 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv = -1;
3846 static int hf_ieee80211_tag_bss_avb_adm_cap_up0 = -1;
3847 static int hf_ieee80211_tag_bss_avb_adm_cap_up1 = -1;
3848 static int hf_ieee80211_tag_bss_avb_adm_cap_up2 = -1;
3849 static int hf_ieee80211_tag_bss_avb_adm_cap_up3 = -1;
3850 static int hf_ieee80211_tag_bss_avb_adm_cap_up4 = -1;
3851 static int hf_ieee80211_tag_bss_avb_adm_cap_up5 = -1;
3852 static int hf_ieee80211_tag_bss_avb_adm_cap_up6 = -1;
3853 static int hf_ieee80211_tag_bss_avb_adm_cap_up7 = -1;
3854 static int hf_ieee80211_tag_bss_avb_adm_cap_ac0 = -1;
3855 static int hf_ieee80211_tag_bss_avb_adm_cap_ac1 = -1;
3856 static int hf_ieee80211_tag_bss_avb_adm_cap_ac2 = -1;
3857 static int hf_ieee80211_tag_bss_avb_adm_cap_ac3 = -1;
3858
3859 static int hf_ieee80211_tag_bss_avg_ac_access_delay_be = -1;
3860 static int hf_ieee80211_tag_bss_avg_ac_access_delay_bk = -1;
3861 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vi = -1;
3862 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vo = -1;
3863
3864 static int hf_ieee80211_tag_rm_enabled_capabilities = -1;
3865 static int hf_ieee80211_tag_rm_enabled_capabilities_b0 = -1;
3866 static int hf_ieee80211_tag_rm_enabled_capabilities_b1 = -1;
3867 static int hf_ieee80211_tag_rm_enabled_capabilities_b2 = -1;
3868 static int hf_ieee80211_tag_rm_enabled_capabilities_b3 = -1;
3869 static int hf_ieee80211_tag_rm_enabled_capabilities_b4 = -1;
3870 static int hf_ieee80211_tag_rm_enabled_capabilities_b5 = -1;
3871 static int hf_ieee80211_tag_rm_enabled_capabilities_b6 = -1;
3872 static int hf_ieee80211_tag_rm_enabled_capabilities_b7 = -1;
3873 static int hf_ieee80211_tag_rm_enabled_capabilities_b8 = -1;
3874 static int hf_ieee80211_tag_rm_enabled_capabilities_b9 = -1;
3875 static int hf_ieee80211_tag_rm_enabled_capabilities_b10 = -1;
3876 static int hf_ieee80211_tag_rm_enabled_capabilities_b11 = -1;
3877 static int hf_ieee80211_tag_rm_enabled_capabilities_b12 = -1;
3878 static int hf_ieee80211_tag_rm_enabled_capabilities_b13 = -1;
3879 static int hf_ieee80211_tag_rm_enabled_capabilities_b14 = -1;
3880 static int hf_ieee80211_tag_rm_enabled_capabilities_b15 = -1;
3881 static int hf_ieee80211_tag_rm_enabled_capabilities_b16 = -1;
3882 static int hf_ieee80211_tag_rm_enabled_capabilities_b17 = -1;
3883 static int hf_ieee80211_tag_rm_enabled_capabilities_b18to20 = -1;
3884 static int hf_ieee80211_tag_rm_enabled_capabilities_b21to23 = -1;
3885 static int hf_ieee80211_tag_rm_enabled_capabilities_b24to26 = -1;
3886 static int hf_ieee80211_tag_rm_enabled_capabilities_b27 = -1;
3887 static int hf_ieee80211_tag_rm_enabled_capabilities_b28 = -1;
3888 static int hf_ieee80211_tag_rm_enabled_capabilities_b29 = -1;
3889 static int hf_ieee80211_tag_rm_enabled_capabilities_b30 = -1;
3890 static int hf_ieee80211_tag_rm_enabled_capabilities_b31 = -1;
3891 static int hf_ieee80211_tag_rm_enabled_capabilities_b32 = -1;
3892 static int hf_ieee80211_tag_rm_enabled_capabilities_b33 = -1;
3893 static int hf_ieee80211_tag_rm_enabled_capabilities_o5 = -1;
3894
3895 static int hf_ieee80211_tag_20_40_bc = -1;
3896 static int hf_ieee80211_tag_20_40_bc_information_request = -1;
3897 static int hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant = -1;
3898 static int hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request = -1;
3899 static int hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request = -1;
3900 static int hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant = -1;
3901 static int hf_ieee80211_tag_20_40_bc_reserved = -1;
3902
3903 static int hf_ieee80211_tag_power_constraint_local = -1;
3904
3905 static int hf_ieee80211_tag_power_capability_min = -1;
3906 static int hf_ieee80211_tag_power_capability_max = -1;
3907
3908 static int hf_ieee80211_tag_tpc_report_trsmt_pow = -1;
3909 static int hf_ieee80211_tag_tpc_report_link_mrg = -1;
3910
3911 static int hf_ieee80211_tag_supported_channels = -1;
3912 static int hf_ieee80211_tag_supported_channels_first = -1;
3913 static int hf_ieee80211_tag_supported_channels_range = -1;
3914
3915 static int hf_ieee80211_csa_channel_switch_mode = -1;
3916 static int hf_ieee80211_csa_new_channel_number = -1;
3917 static int hf_ieee80211_csa_channel_switch_count = -1;
3918
3919 static int hf_ieee80211_tag_measure_request_token = -1;
3920 static int hf_ieee80211_tag_measure_request_mode = -1;
3921 static int hf_ieee80211_tag_measure_request_mode_parallel = -1;
3922 static int hf_ieee80211_tag_measure_request_mode_enable = -1;
3923 static int hf_ieee80211_tag_measure_request_mode_request = -1;
3924 static int hf_ieee80211_tag_measure_request_mode_report = -1;
3925 static int hf_ieee80211_tag_measure_request_mode_duration_mandatory = -1;
3926 static int hf_ieee80211_tag_measure_request_mode_reserved = -1;
3927 static int hf_ieee80211_tag_measure_request_type = -1;
3928
3929 static int hf_ieee80211_tag_measure_request_channel_number = -1;
3930 static int hf_ieee80211_tag_measure_request_start_time = -1;
3931 static int hf_ieee80211_tag_measure_request_duration = -1;
3932
3933 static int hf_ieee80211_tag_measure_request_operating_class = -1;
3934 static int hf_ieee80211_tag_measure_request_randomization_interval = -1;
3935
3936 static int hf_ieee80211_tag_measure_report_measurement_token = -1;
3937 static int hf_ieee80211_tag_measure_report_mode = -1;
3938 static int hf_ieee80211_tag_measure_report_mode_late = -1;
3939 static int hf_ieee80211_tag_measure_report_mode_incapable = -1;
3940 static int hf_ieee80211_tag_measure_report_mode_refused = -1;
3941 static int hf_ieee80211_tag_measure_report_mode_reserved = -1;
3942 static int hf_ieee80211_tag_measure_report_type = -1;
3943 static int hf_ieee80211_tag_measure_report_channel_number = -1;
3944 static int hf_ieee80211_tag_measure_report_start_time = -1;
3945 static int hf_ieee80211_tag_measure_report_duration = -1;
3946
3947 static int hf_ieee80211_tag_measure_basic_map_field = -1;
3948 static int hf_ieee80211_tag_measure_map_field_bss = -1;
3949 static int hf_ieee80211_tag_measure_map_field_odfm = -1;
3950 static int hf_ieee80211_tag_measure_map_field_unident_signal = -1;
3951 static int hf_ieee80211_tag_measure_map_field_radar = -1;
3952 static int hf_ieee80211_tag_measure_map_field_unmeasured = -1;
3953 static int hf_ieee80211_tag_measure_map_field_reserved = -1;
3954
3955 static int hf_ieee80211_tag_measure_cca_busy_fraction = -1;
3956
3957 static int hf_ieee80211_tag_measure_rpi_histogram_report = -1;
3958 static int hf_ieee80211_tag_measure_rpi_histogram_report_0 = -1;
3959 static int hf_ieee80211_tag_measure_rpi_histogram_report_1 = -1;
3960 static int hf_ieee80211_tag_measure_rpi_histogram_report_2 = -1;
3961 static int hf_ieee80211_tag_measure_rpi_histogram_report_3 = -1;
3962 static int hf_ieee80211_tag_measure_rpi_histogram_report_4 = -1;
3963 static int hf_ieee80211_tag_measure_rpi_histogram_report_5 = -1;
3964 static int hf_ieee80211_tag_measure_rpi_histogram_report_6 = -1;
3965 static int hf_ieee80211_tag_measure_rpi_histogram_report_7 = -1;
3966
3967 static int hf_ieee80211_tag_measure_report_operating_class = -1;
3968 static int hf_ieee80211_tag_measure_report_channel_load = -1;
3969 static int hf_ieee80211_tag_measure_report_frame_info = -1;
3970 static int hf_ieee80211_tag_measure_report_frame_info_phy_type = -1;
3971 static int hf_ieee80211_tag_measure_report_frame_info_frame_type = -1;
3972 static int hf_ieee80211_tag_measure_report_rcpi = -1;
3973 static int hf_ieee80211_tag_measure_report_rsni = -1;
3974 static int hf_ieee80211_tag_measure_report_bssid = -1;
3975 static int hf_ieee80211_tag_measure_report_ant_id = -1;
3976 static int hf_ieee80211_tag_measure_report_anpi = -1;
3977 static int hf_ieee80211_tag_measure_report_ipi_density_0 = -1;
3978 static int hf_ieee80211_tag_measure_report_ipi_density_1 = -1;
3979 static int hf_ieee80211_tag_measure_report_ipi_density_2 = -1;
3980 static int hf_ieee80211_tag_measure_report_ipi_density_3 = -1;
3981 static int hf_ieee80211_tag_measure_report_ipi_density_4 = -1;
3982 static int hf_ieee80211_tag_measure_report_ipi_density_5 = -1;
3983 static int hf_ieee80211_tag_measure_report_ipi_density_6 = -1;
3984 static int hf_ieee80211_tag_measure_report_ipi_density_7 = -1;
3985 static int hf_ieee80211_tag_measure_report_ipi_density_8 = -1;
3986 static int hf_ieee80211_tag_measure_report_ipi_density_9 = -1;
3987 static int hf_ieee80211_tag_measure_report_ipi_density_10 = -1;
3988 static int hf_ieee80211_tag_measure_report_parent_tsf = -1;
3989
3990 static int hf_ieee80211_tag_measure_report_subelement_length = -1;
3991 static int hf_ieee80211_tag_measure_report_beacon_sub_id = -1;
3992
3993 static int hf_ieee80211_tag_measure_report_unknown = -1;
3994
3995 static int hf_ieee80211_tag_quiet_count = -1;
3996 static int hf_ieee80211_tag_quiet_period = -1;
3997 static int hf_ieee80211_tag_quiet_duration = -1;
3998 static int hf_ieee80211_tag_quiet_offset = -1;
3999
4000 static int hf_ieee80211_tag_dfs_owner = -1;
4001 static int hf_ieee80211_tag_dfs_recovery_interval = -1;
4002 static int hf_ieee80211_tag_dfs_channel_map = -1;
4003 static int hf_ieee80211_tag_dfs_channel_number = -1;
4004 static int hf_ieee80211_tag_dfs_map = -1;
4005
4006 static int hf_ieee80211_tag_erp_info = -1;
4007 static int hf_ieee80211_tag_erp_info_erp_present = -1;
4008 static int hf_ieee80211_tag_erp_info_use_protection = -1;
4009 static int hf_ieee80211_tag_erp_info_barker_preamble_mode = -1;
4010 static int hf_ieee80211_tag_erp_info_reserved = -1;
4011
4012 static int hf_ieee80211_tag_extended_capabilities = -1;
4013 static int hf_ieee80211_tag_extended_capabilities_b0 = -1;
4014 static int hf_ieee80211_tag_extended_capabilities_b1 = -1;
4015 static int hf_ieee80211_tag_extended_capabilities_b2 = -1;
4016 static int hf_ieee80211_tag_extended_capabilities_b3 = -1;
4017 static int hf_ieee80211_tag_extended_capabilities_b4 = -1;
4018 static int hf_ieee80211_tag_extended_capabilities_b5 = -1;
4019 static int hf_ieee80211_tag_extended_capabilities_b6 = -1;
4020 static int hf_ieee80211_tag_extended_capabilities_b7 = -1;
4021 static int hf_ieee80211_tag_extended_capabilities_b8 = -1;
4022 static int hf_ieee80211_tag_extended_capabilities_b9 = -1;
4023 static int hf_ieee80211_tag_extended_capabilities_b10 = -1;
4024 static int hf_ieee80211_tag_extended_capabilities_b11 = -1;
4025 static int hf_ieee80211_tag_extended_capabilities_b12 = -1;
4026 static int hf_ieee80211_tag_extended_capabilities_b13 = -1;
4027 static int hf_ieee80211_tag_extended_capabilities_b14 = -1;
4028 static int hf_ieee80211_tag_extended_capabilities_b15 = -1;
4029 static int hf_ieee80211_tag_extended_capabilities_b16 = -1;
4030 static int hf_ieee80211_tag_extended_capabilities_b17 = -1;
4031 static int hf_ieee80211_tag_extended_capabilities_b18 = -1;
4032 static int hf_ieee80211_tag_extended_capabilities_b19 = -1;
4033 static int hf_ieee80211_tag_extended_capabilities_b20 = -1;
4034 static int hf_ieee80211_tag_extended_capabilities_b21 = -1;
4035 static int hf_ieee80211_tag_extended_capabilities_b22 = -1;
4036 static int hf_ieee80211_tag_extended_capabilities_b23 = -1;
4037 static int hf_ieee80211_tag_extended_capabilities_b24 = -1;
4038 static int hf_ieee80211_tag_extended_capabilities_b25 = -1;
4039 static int hf_ieee80211_tag_extended_capabilities_b26 = -1;
4040 static int hf_ieee80211_tag_extended_capabilities_b27 = -1;
4041 static int hf_ieee80211_tag_extended_capabilities_b28 = -1;
4042 static int hf_ieee80211_tag_extended_capabilities_b29 = -1;
4043 static int hf_ieee80211_tag_extended_capabilities_b30 = -1;
4044 static int hf_ieee80211_tag_extended_capabilities_b31 = -1;
4045 static int hf_ieee80211_tag_extended_capabilities_b32 = -1;
4046 static int hf_ieee80211_tag_extended_capabilities_b33 = -1;
4047 static int hf_ieee80211_tag_extended_capabilities_b34 = -1;
4048 static int hf_ieee80211_tag_extended_capabilities_b35 = -1;
4049 static int hf_ieee80211_tag_extended_capabilities_b36 = -1;
4050 static int hf_ieee80211_tag_extended_capabilities_b37 = -1;
4051 static int hf_ieee80211_tag_extended_capabilities_b38 = -1;
4052 static int hf_ieee80211_tag_extended_capabilities_b39 = -1;
4053 static int hf_ieee80211_tag_extended_capabilities_b40 = -1;
4054 static int hf_ieee80211_tag_extended_capabilities_serv_int_granularity = -1;
4055 static int hf_ieee80211_tag_extended_capabilities_b44 = -1;
4056 static int hf_ieee80211_tag_extended_capabilities_b45 = -1;
4057 static int hf_ieee80211_tag_extended_capabilities_b46 = -1;
4058 static int hf_ieee80211_tag_extended_capabilities_b47 = -1;
4059 static int hf_ieee80211_tag_extended_capabilities_b48 = -1;
4060 static int hf_ieee80211_tag_extended_capabilities_b49 = -1;
4061 static int hf_ieee80211_tag_extended_capabilities_b50 = -1;
4062 static int hf_ieee80211_tag_extended_capabilities_b51 = -1;
4063 static int hf_ieee80211_tag_extended_capabilities_b52 = -1;
4064 static int hf_ieee80211_tag_extended_capabilities_b53 = -1;
4065 static int hf_ieee80211_tag_extended_capabilities_b54 = -1;
4066 static int hf_ieee80211_tag_extended_capabilities_b55 = -1;
4067 static int hf_ieee80211_tag_extended_capabilities_b56 = -1;
4068 static int hf_ieee80211_tag_extended_capabilities_b57 = -1;
4069 static int hf_ieee80211_tag_extended_capabilities_b58 = -1;
4070 static int hf_ieee80211_tag_extended_capabilities_b59 = -1;
4071 static int hf_ieee80211_tag_extended_capabilities_b60 = -1;
4072 static int hf_ieee80211_tag_extended_capabilities_b61 = -1;
4073 static int hf_ieee80211_tag_extended_capabilities_b62 = -1;
4074 static int hf_ieee80211_tag_extended_capabilities_b63 = -1;
4075 /* Used for the two-byte ext-cap field when present */
4076 static int hf_ieee80211_tag_extended_capabilities_2 = -1;
4077 static int hf_ieee80211_tag_extended_capabilities_b56_2 = -1;
4078 static int hf_ieee80211_tag_extended_capabilities_b57_2 = -1;
4079 static int hf_ieee80211_tag_extended_capabilities_b58_2 = -1;
4080 static int hf_ieee80211_tag_extended_capabilities_b59_2 = -1;
4081 static int hf_ieee80211_tag_extended_capabilities_b60_2 = -1;
4082 static int hf_ieee80211_tag_extended_capabilities_b61_2 = -1;
4083 static int hf_ieee80211_tag_extended_capabilities_b62_2 = -1;
4084 static int hf_ieee80211_tag_extended_capabilities_max_num_msdus = -1;
4085 static int hf_ieee80211_tag_extended_capabilities_b65_2 = -1;
4086 static int hf_ieee80211_tag_extended_capabilities_b66_2 = -1;
4087 static int hf_ieee80211_tag_extended_capabilities_b67_2 = -1;
4088 static int hf_ieee80211_tag_extended_capabilities_b68_2 = -1;
4089 static int hf_ieee80211_tag_extended_capabilities_b69_2 = -1;
4090 static int hf_ieee80211_tag_extended_capabilities_b70_2 = -1;
4091 static int hf_ieee80211_tag_extended_capabilities_b71_2 = -1;
4092
4093 static int hf_ieee80211_tag_extended_capabilities_b72 = -1;
4094 static int hf_ieee80211_tag_extended_capabilities_b73 = -1;
4095 static int hf_ieee80211_tag_extended_capabilities_b74 = -1;
4096 static int hf_ieee80211_tag_extended_capabilities_b75 = -1;
4097 static int hf_ieee80211_tag_extended_capabilities_b76 = -1;
4098 static int hf_ieee80211_tag_extended_capabilities_b77 = -1;
4099 static int hf_ieee80211_tag_extended_capabilities_b78 = -1;
4100 static int hf_ieee80211_tag_extended_capabilities_b79 = -1;
4101
4102 static int hf_ieee80211_tag_cisco_ccx1_unknown = -1;
4103 static int hf_ieee80211_tag_cisco_ccx1_name = -1;
4104 static int hf_ieee80211_tag_cisco_ccx1_clients = -1;
4105 static int hf_ieee80211_tag_cisco_ccx1_unknown2 = -1;
4106
4107 static int hf_ieee80211_vht_cap = -1;
4108 static int hf_ieee80211_vht_max_mpdu_length = -1;
4109 static int hf_ieee80211_vht_supported_chan_width_set = -1;
4110 static int hf_ieee80211_vht_rx_ldpc = -1;
4111 static int hf_ieee80211_vht_short_gi_for_80 = -1;
4112 static int hf_ieee80211_vht_short_gi_for_160 = -1;
4113 static int hf_ieee80211_vht_tx_stbc = -1;
4114 static int hf_ieee80211_vht_rx_stbc = -1;
4115 static int hf_ieee80211_vht_su_beamformer_cap = -1;
4116 static int hf_ieee80211_vht_su_beamformee_cap = -1;
4117 static int hf_ieee80211_vht_beamformer_antennas = -1;
4118 static int hf_ieee80211_vht_sounding_dimensions = -1;
4119 static int hf_ieee80211_vht_mu_beamformer_cap = -1;
4120 static int hf_ieee80211_vht_mu_beamformee_cap = -1;
4121 static int hf_ieee80211_vht_txop_ps = -1;
4122 static int hf_ieee80211_vht_var_htc_field = -1;
4123 static int hf_ieee80211_vht_max_ampdu = -1;
4124 static int hf_ieee80211_vht_link_adaptation_cap = -1;
4125 static int hf_ieee80211_vht_rx_pattern = -1;
4126 static int hf_ieee80211_vht_tx_pattern = -1;
4127 static int hf_ieee80211_vht_ext_nss_bw_support = -1;
4128
4129 static int hf_ieee80211_vht_mcsset = -1;
4130
4131 static int hf_ieee80211_vht_mcsset_rx_mcs_map = -1;
4132 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss = -1;
4133 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss = -1;
4134 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss = -1;
4135 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss = -1;
4136 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss = -1;
4137 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss = -1;
4138 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss = -1;
4139 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss = -1;
4140
4141 static int hf_ieee80211_vht_mcsset_rx_highest_long_gi = -1;
4142
4143 static int hf_ieee80211_vht_mcsset_tx_mcs_map = -1;
4144 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss = -1;
4145 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss = -1;
4146 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss = -1;
4147 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss = -1;
4148 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss = -1;
4149 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss = -1;
4150 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss = -1;
4151 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss = -1;
4152
4153 static int hf_ieee80211_vht_op = -1;
4154 static int hf_ieee80211_vht_op_channel_width = -1;
4155 static int hf_ieee80211_vht_op_channel_center0 = -1;
4156 static int hf_ieee80211_vht_op_channel_center1 = -1;
4157
4158 static int hf_ieee80211_vht_op_basic_mcs_map = -1;
4159 static int hf_ieee80211_vht_op_max_basic_mcs_for_1_ss = -1;
4160 static int hf_ieee80211_vht_op_max_basic_mcs_for_2_ss = -1;
4161 static int hf_ieee80211_vht_op_max_basic_mcs_for_3_ss = -1;
4162 static int hf_ieee80211_vht_op_max_basic_mcs_for_4_ss = -1;
4163 static int hf_ieee80211_vht_op_max_basic_mcs_for_5_ss = -1;
4164 static int hf_ieee80211_vht_op_max_basic_mcs_for_6_ss = -1;
4165 static int hf_ieee80211_vht_op_max_basic_mcs_for_7_ss = -1;
4166 static int hf_ieee80211_vht_op_max_basic_mcs_for_8_ss = -1;
4167 static int hf_ieee80211_vht_mcsset_tx_highest_long_gi = -1;
4168
4169 static int hf_ieee80211_vht_tpe_pwr_info = -1;
4170 static int hf_ieee80211_vht_tpe_pwr_info_count = -1;
4171 static int hf_ieee80211_vht_tpe_pwr_info_unit = -1;
4172 static int hf_ieee80211_vht_tpe_pwr_info_reserved = -1;
4173 static int hf_ieee80211_vht_tpe_pwr_constr_20 = -1;
4174 static int hf_ieee80211_vht_tpe_pwr_constr_40 = -1;
4175 static int hf_ieee80211_vht_tpe_pwr_constr_80 = -1;
4176 static int hf_ieee80211_vht_tpe_pwr_constr_160 = -1;
4177
4178 static int hf_ieee80211_beamform_feedback_seg_retrans_bitmap = -1;
4179
4180 static int hf_ieee80211_vht_ndp_annc_token = -1;
4181 static int hf_ieee80211_vht_ndp_annc_token_number = -1;
4182 static int hf_ieee80211_vht_ndp_annc_he_subfield = -1;
4183 static int hf_ieee80211_vht_ndp_annc_token_reserved = -1;
4184 static int hf_ieee80211_vht_ndp_annc_sta_info = -1;
4185 static int hf_ieee80211_vht_ndp_annc_sta_info_aid12 = -1;
4186 static int hf_ieee80211_vht_ndp_annc_sta_info_feedback_type = -1;
4187 static int hf_ieee80211_vht_ndp_annc_sta_info_nc_index = -1;
4188 static int hf_ieee80211_vht_ndp_annc_sta_info_reserved = -1;
4189
4190
4191 static int hf_ieee80211_ff_vht_action = -1;
4192 static int hf_ieee80211_ff_vht_mimo_cntrl = -1;
4193 static int hf_ieee80211_ff_vht_mimo_cntrl_nc_index = -1;
4194 static int hf_ieee80211_ff_vht_mimo_cntrl_nr_index = -1;
4195 static int hf_ieee80211_ff_vht_mimo_cntrl_channel_width = -1;
4196 static int hf_ieee80211_ff_vht_mimo_cntrl_grouping = -1;
4197 static int hf_ieee80211_ff_vht_mimo_cntrl_codebook_info = -1;
4198 static int hf_ieee80211_ff_vht_mimo_cntrl_feedback_type = -1;
4199 static int hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg = -1;
4200 static int hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg = -1;
4201 static int hf_ieee80211_ff_vht_mimo_cntrl_reserved = -1;
4202 static int hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number = -1;
4203
4204 static const int *hf_ieee80211_ff_vht_mimo_cntrl_fields[] = {
4205   &hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
4206   &hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
4207   &hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
4208   &hf_ieee80211_ff_vht_mimo_cntrl_grouping,
4209   &hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
4210   &hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
4211   &hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
4212   &hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
4213   &hf_ieee80211_ff_vht_mimo_cntrl_reserved,
4214   &hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
4215   NULL,
4216 };
4217
4218 static int hf_ieee80211_vht_compressed_beamforming_report = -1;
4219 static int hf_ieee80211_vht_compressed_beamforming_report_snr = -1;
4220 static int hf_ieee80211_vht_compressed_beamforming_feedback_matrix = -1;
4221 static int hf_ieee80211_vht_group_id_management = -1;
4222 static int hf_ieee80211_vht_membership_status_array = -1;
4223 static int hf_ieee80211_vht_user_position_array = -1;
4224 static int hf_ieee80211_vht_operation_mode_notification = -1;
4225 static int hf_ieee80211_vht_membership_status_field = -1;
4226 static int hf_ieee80211_vht_user_position_field = -1;
4227 static int hf_ieee80211_vht_mu_exclusive_beamforming_report = -1;
4228 static int hf_ieee80211_vht_mu_Exclusive_beamforming_delta_snr = -1;
4229 static int hf_ieee80211_vht_compressed_beamforming_phi_angle = -1;
4230 static int hf_ieee80211_vht_compressed_beamforming_psi_angle = -1;
4231
4232 static int hf_ieee80211_ff_he_action = -1;
4233 static int hf_he_mimo_control_nc_index = -1;
4234 static int hf_he_mimo_control_nr_index = -1;
4235 static int hf_he_mimo_control_bw = -1;
4236 static int hf_he_mimo_control_grouping = -1;
4237 static int hf_he_mimo_control_codebook_info = -1;
4238 static int hf_he_mimo_control_feedback_type = -1;
4239 static int hf_he_mimo_control_remaining_feedback_segs = -1;
4240 static int hf_he_mimo_control_first_feedback_seg = -1;
4241 static int hf_he_mimo_control_ru_start_index = -1;
4242 static int hf_he_mimo_control_ru_end_index = -1;
4243 static int hf_he_mimo_control_sounding_dialog_token_num = -1;
4244 static int hf_he_mimo_control_reserved = -1;
4245 static int hf_ieee80211_he_mimo_control_field = -1;
4246
4247 static int hf_ieee80211_tag_neighbor_report_bssid = -1;
4248 static int hf_ieee80211_tag_neighbor_report_bssid_info = -1;
4249 static int hf_ieee80211_tag_neighbor_report_bssid_info_reachability = -1;
4250 static int hf_ieee80211_tag_neighbor_report_bssid_info_security = -1;
4251 static int hf_ieee80211_tag_neighbor_report_bssid_info_key_scope = -1;
4252 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability = -1;
4253 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng = -1;
4254 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos = -1;
4255 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd = -1;
4256 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt = -1;
4257 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback = -1;
4258 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback = -1;
4259 static int hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain = -1;
4260 static int hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput = -1;
4261 static int hf_ieee80211_tag_neighbor_report_bssid_info_very_high_throughput = -1;
4262 static int hf_ieee80211_tag_neighbor_report_bssid_info_ftm = -1;
4263 static int hf_ieee80211_tag_neighbor_report_bssid_info_high_efficiency = -1;
4264 static int hf_ieee80211_tag_neighbor_report_bssid_info_er_bss = -1;
4265 static int hf_ieee80211_tag_neighbor_report_bssid_info_reserved = -1;
4266 static int hf_ieee80211_tag_neighbor_report_ope_class = -1;
4267 static int hf_ieee80211_tag_neighbor_report_channel_number = -1;
4268 static int hf_ieee80211_tag_neighbor_report_phy_type = -1;
4269 static int hf_ieee80211_tag_neighbor_report_subelement_id = -1;
4270 static int hf_ieee80211_tag_neighbor_report_subelement_length = -1;
4271 static int hf_ieee80211_tag_neighbor_report_subelement_data = -1;
4272 static int hf_ieee80211_tag_neighbor_report_subelement_bss_trn_can_pref = -1;
4273 static int hf_ieee80211_tag_neighbor_report_subelement_bss_ter_tsf = -1;
4274 static int hf_ieee80211_tag_neighbor_report_subelement_bss_dur = -1;
4275 static int hf_ieee80211_tag_supported_ope_classes_current = -1;
4276 static int hf_ieee80211_tag_supported_ope_classes_alternate = -1;
4277
4278 /* IEEE Std 802.11r-2008 7.3.2.47 */
4279 static int hf_ieee80211_tag_mobility_domain_mdid = -1;
4280 static int hf_ieee80211_tag_mobility_domain_ft_capab = -1;
4281 static int hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds = -1;
4282 static int hf_ieee80211_tag_mobility_domain_ft_capab_resource_req = -1;
4283
4284 /* IEEE Std 802.11r-2008 7.3.2.48 */
4285 static int hf_ieee80211_tag_ft_mic_control = -1;
4286 static int hf_ieee80211_tag_ft_element_count = -1;
4287 static int hf_ieee80211_tag_ft_mic = -1;
4288 static int hf_ieee80211_tag_ft_anonce = -1;
4289 static int hf_ieee80211_tag_ft_snonce = -1;
4290 static int hf_ieee80211_tag_ft_subelem_id = -1;
4291 static int hf_ieee80211_tag_ft_subelem_len = -1;
4292 static int hf_ieee80211_tag_ft_subelem_data = -1;
4293 static int hf_ieee80211_tag_ft_subelem_r1kh_id = -1;
4294 static int hf_ieee80211_tag_ft_subelem_gtk_key_info = -1;
4295 static int hf_ieee80211_tag_ft_subelem_gtk_key_id = -1;
4296 static int hf_ieee80211_tag_ft_subelem_gtk_key_length = -1;
4297 static int hf_ieee80211_tag_ft_subelem_gtk_rsc = -1;
4298 static int hf_ieee80211_tag_ft_subelem_gtk_key = -1;
4299 static int hf_ieee80211_tag_ft_subelem_r0kh_id = -1;
4300 static int hf_ieee80211_tag_ft_subelem_igtk_key_id = -1;
4301 static int hf_ieee80211_tag_ft_subelem_igtk_ipn = -1;
4302 static int hf_ieee80211_tag_ft_subelem_igtk_key_length = -1;
4303 static int hf_ieee80211_tag_ft_subelem_igtk_key = -1;
4304
4305 /* IEEE Std 802.11-2012: 11r 8.4.2.52 */
4306 static int hf_ieee80211_tag_ric_data_id = -1;
4307 static int hf_ieee80211_tag_ric_data_desc_cnt = -1;
4308 static int hf_ieee80211_tag_ric_data_status_code = -1;
4309
4310 /* IEEE Std 802.11-2012: 11r 8.4.2.53 */
4311 static int hf_ieee80211_tag_ric_desc_rsrc_type = -1;
4312 static int hf_ieee80211_tag_ric_desc_var_params = -1;
4313
4314 /* IEEE Std 802.11w-2009 7.3.2.55 */
4315 static int hf_ieee80211_tag_mmie_keyid = -1;
4316 static int hf_ieee80211_tag_mmie_ipn = -1;
4317 static int hf_ieee80211_tag_mmie_mic = -1;
4318
4319 /* IEEE Std 802.11-2012: 8.4.2.61 */
4320 static int hf_ieee80211_tag_obss_spd = -1;
4321 static int hf_ieee80211_tag_obss_sad = -1;
4322 static int hf_ieee80211_tag_obss_cwtsi = -1;
4323 static int hf_ieee80211_tag_obss_sptpc = -1;
4324 static int hf_ieee80211_tag_obss_satpc = -1;
4325 static int hf_ieee80211_tag_obss_wctdf = -1;
4326 static int hf_ieee80211_tag_obss_sat = -1;
4327
4328
4329 /*WAPI-Specification 7.3.2.25 : WAPI Parameter Set*/
4330 static int hf_ieee80211_tag_wapi_param_set_version = -1;
4331
4332 static int hf_ieee80211_tag_wapi_param_set_akm_suite_count = -1;
4333 static int hf_ieee80211_tag_wapi_param_set_akm_suite_oui = -1;
4334 static int hf_ieee80211_tag_wapi_param_set_akm_suite_type = -1;
4335
4336 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count = -1;
4337 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui = -1;
4338 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type = -1;
4339
4340 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui = -1;
4341 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type = -1;
4342
4343 static int hf_ieee80211_tag_wapi_param_set_capab = -1;
4344 static int hf_ieee80211_tag_wapi_param_set_capab_preauth = -1;
4345 static int hf_ieee80211_tag_wapi_param_set_capab_rsvd = -1;
4346 static int hf_ieee80211_tag_wapi_param_set_bkid_count = -1;
4347 static int hf_ieee80211_tag_wapi_param_set_bkid_list = -1;
4348
4349 /* IEEE Std 802.11v-2011 7.3.2.61 */
4350 static int hf_ieee80211_tag_time_adv_timing_capab = -1;
4351 static int hf_ieee80211_tag_time_adv_time_value = -1;
4352 static int hf_ieee80211_tag_time_adv_time_value_year = -1;
4353 static int hf_ieee80211_tag_time_adv_time_value_month = -1;
4354 static int hf_ieee80211_tag_time_adv_time_value_day = -1;
4355 static int hf_ieee80211_tag_time_adv_time_value_hours = -1;
4356 static int hf_ieee80211_tag_time_adv_time_value_minutes = -1;
4357 static int hf_ieee80211_tag_time_adv_time_value_seconds = -1;
4358 static int hf_ieee80211_tag_time_adv_time_value_milliseconds = -1;
4359 static int hf_ieee80211_tag_time_adv_time_value_reserved = -1;
4360 static int hf_ieee80211_tag_time_adv_time_error = -1;
4361 static int hf_ieee80211_tag_time_adv_time_update_counter = -1;
4362
4363 /* IEEE Std 802.11-2012 8.4.2.81 */
4364 static int hf_ieee80211_tag_bss_max_idle_period = -1;
4365 static int hf_ieee80211_tag_bss_max_idle_options_protected = -1;
4366
4367 /* IEEE Std 802.11-2012 8.4.2.82 */
4368 static int hf_ieee80211_tag_tfs_request_id = -1;
4369 static int hf_ieee80211_tag_tfs_request_ac_delete_after_match = -1;
4370 static int hf_ieee80211_tag_tfs_request_ac_notify = -1;
4371 static int hf_ieee80211_tag_tfs_request_subelem_id = -1;
4372 static int hf_ieee80211_tag_tfs_request_subelem_len = -1;
4373 static int hf_ieee80211_tag_tfs_request_subelem = -1;
4374
4375 /* IEEE Std 802.11-2012 8.4.2.83 */
4376 static int hf_ieee80211_tag_tfs_response_subelem_id = -1;
4377 static int hf_ieee80211_tag_tfs_response_subelem_len = -1;
4378 static int hf_ieee80211_tag_tfs_response_subelem = -1;
4379 static int hf_ieee80211_tag_tfs_response_status = -1;
4380 static int hf_ieee80211_tag_tfs_response_id = -1;
4381
4382 /* IEEE Std 802.11-2012 8.4.2.84 */
4383 static int hf_ieee80211_tag_wnm_sleep_mode_action_type = -1;
4384 static int hf_ieee80211_tag_wnm_sleep_mode_response_status = -1;
4385 static int hf_ieee80211_tag_wnm_sleep_mode_interval = -1;
4386
4387 /* IEEE Std 802.11v-2011 7.3.2.87 */
4388 static int hf_ieee80211_tag_time_zone = -1;
4389
4390 /* IEEE Std 802.11u-2011 7.3.2.92 */
4391 static int hf_ieee80211_tag_interworking_access_network_type = -1;
4392 static int hf_ieee80211_tag_interworking_internet = -1;
4393 static int hf_ieee80211_tag_interworking_asra = -1;
4394 static int hf_ieee80211_tag_interworking_esr = -1;
4395 static int hf_ieee80211_tag_interworking_uesa = -1;
4396 static int hf_ieee80211_tag_interworking_hessid = -1;
4397
4398 /* IEEE Std 802.11-2012, 8.4.2.97 */
4399 static int hf_ieee80211_tag_qos_map_set_dscp_exc = -1;
4400 static int hf_ieee80211_tag_qos_map_set_dscp_exc_val = -1;
4401 static int hf_ieee80211_tag_qos_map_set_dscp_exc_up = -1;
4402 static int hf_ieee80211_tag_qos_map_set_range = -1;
4403 static int hf_ieee80211_tag_qos_map_set_low = -1;
4404 static int hf_ieee80211_tag_qos_map_set_high = -1;
4405
4406 /* IEEE Std 802.11u-2011 7.3.2.93 */
4407 static int hf_ieee80211_tag_adv_proto_resp_len_limit = -1;
4408 static int hf_ieee80211_tag_adv_proto_pame_bi = -1;
4409 static int hf_ieee80211_tag_adv_proto_id = -1;
4410 static int hf_ieee80211_tag_adv_vs_len = -1;
4411 /* static int hf_ieee80211_tag_adv_proto_vs_info = -1; */
4412
4413 /* IEEE Std 802.11u-2011 7.3.2.96 */
4414 static int hf_ieee80211_tag_roaming_consortium_num_anqp_oi = -1;
4415 static int hf_ieee80211_tag_roaming_consortium_oi1_len = -1;
4416 static int hf_ieee80211_tag_roaming_consortium_oi2_len = -1;
4417 static int hf_ieee80211_tag_roaming_consortium_oi1 = -1;
4418 static int hf_ieee80211_tag_roaming_consortium_oi2 = -1;
4419 static int hf_ieee80211_tag_roaming_consortium_oi3 = -1;
4420
4421 /* 802.11n 7.3.2.48 */
4422 static int hf_ieee80211_hta_cc = -1;
4423 static int hf_ieee80211_hta_cap1 = -1;
4424 static int hf_ieee80211_hta_cap2 = -1;
4425 static int hf_ieee80211_hta_ext_chan_offset = -1;
4426 static int hf_ieee80211_hta_rec_tx_width = -1;
4427 static int hf_ieee80211_hta_rifs_mode = -1;
4428 static int hf_ieee80211_hta_controlled_access = -1;
4429 static int hf_ieee80211_hta_service_interval = -1;
4430 static int hf_ieee80211_hta_operating_mode = -1;
4431 static int hf_ieee80211_hta_non_gf_devices = -1;
4432 static int hf_ieee80211_hta_basic_stbc_mcs = -1;
4433 static int hf_ieee80211_hta_dual_stbc_protection = -1;
4434 static int hf_ieee80211_hta_secondary_beacon = -1;
4435 static int hf_ieee80211_hta_lsig_txop_protection = -1;
4436 static int hf_ieee80211_hta_pco_active = -1;
4437 static int hf_ieee80211_hta_pco_phase = -1;
4438
4439 static int hf_ieee80211_antsel = -1;
4440 static int hf_ieee80211_antsel_vs = -1;
4441 static int hf_ieee80211_antsel_b0 = -1;
4442 static int hf_ieee80211_antsel_b1 = -1;
4443 static int hf_ieee80211_antsel_b2 = -1;
4444 static int hf_ieee80211_antsel_b3 = -1;
4445 static int hf_ieee80211_antsel_b4 = -1;
4446 static int hf_ieee80211_antsel_b5 = -1;
4447 static int hf_ieee80211_antsel_b6 = -1;
4448 static int hf_ieee80211_antsel_b7 = -1;
4449
4450 static int hf_ieee80211_rsn_version = -1;
4451 static int hf_ieee80211_rsn_gcs = -1;
4452 static int hf_ieee80211_rsn_gcs_oui = -1;
4453 static int hf_ieee80211_rsn_gcs_type = -1;
4454 static int hf_ieee80211_rsn_gcs_80211_type = -1;
4455 static int hf_ieee80211_rsn_pcs_count = -1;
4456 static int hf_ieee80211_rsn_pcs_list = -1;
4457 static int hf_ieee80211_rsn_pcs = -1;
4458 static int hf_ieee80211_rsn_pcs_oui = -1;
4459 static int hf_ieee80211_rsn_pcs_80211_type = -1;
4460 static int hf_ieee80211_rsn_pcs_type = -1;
4461 static int hf_ieee80211_rsn_akms_count = -1;
4462 static int hf_ieee80211_rsn_akms_list = -1;
4463 static int hf_ieee80211_rsn_akms = -1;
4464 static int hf_ieee80211_rsn_akms_oui = -1;
4465 static int hf_ieee80211_rsn_akms_80211_type = -1;
4466 static int hf_ieee80211_rsn_akms_type = -1;
4467 static int hf_ieee80211_rsn_cap = -1;
4468 static int hf_ieee80211_rsn_cap_preauth = -1;
4469 static int hf_ieee80211_rsn_cap_no_pairwise = -1;
4470 static int hf_ieee80211_rsn_cap_ptksa_replay_counter = -1;
4471 static int hf_ieee80211_rsn_cap_gtksa_replay_counter = -1;
4472 static int hf_ieee80211_rsn_cap_mfpr = -1;
4473 static int hf_ieee80211_rsn_cap_mfpc = -1;
4474 static int hf_ieee80211_rsn_cap_jmr = -1;
4475 static int hf_ieee80211_rsn_cap_peerkey = -1;
4476 static int hf_ieee80211_rsn_pmkid_count = -1;
4477 static int hf_ieee80211_rsn_pmkid_list = -1;
4478 static int hf_ieee80211_rsn_pmkid = -1;
4479 static int hf_ieee80211_rsn_gmcs = -1;
4480 static int hf_ieee80211_rsn_gmcs_oui = -1;
4481 static int hf_ieee80211_rsn_gmcs_type = -1;
4482 static int hf_ieee80211_rsn_gmcs_80211_type = -1;
4483
4484 static int hf_ieee80211_wfa_ie_type = -1;
4485 static int hf_ieee80211_wfa_ie_wpa_version = -1;
4486 static int hf_ieee80211_wfa_ie_wpa_mcs = -1;
4487 static int hf_ieee80211_wfa_ie_wpa_mcs_oui = -1;
4488 static int hf_ieee80211_wfa_ie_wpa_mcs_type = -1;
4489 static int hf_ieee80211_wfa_ie_wpa_mcs_wfa_type = -1;
4490 static int hf_ieee80211_wfa_ie_wpa_ucs_count = -1;
4491 static int hf_ieee80211_wfa_ie_wpa_ucs_list = -1;
4492 static int hf_ieee80211_wfa_ie_wpa_ucs = -1;
4493 static int hf_ieee80211_wfa_ie_wpa_ucs_oui = -1;
4494 static int hf_ieee80211_wfa_ie_wpa_ucs_wfa_type = -1;
4495 static int hf_ieee80211_wfa_ie_wpa_ucs_type = -1;
4496 static int hf_ieee80211_wfa_ie_wpa_akms_count = -1;
4497 static int hf_ieee80211_wfa_ie_wpa_akms_list = -1;
4498 static int hf_ieee80211_wfa_ie_wpa_akms = -1;
4499 static int hf_ieee80211_wfa_ie_wpa_akms_oui = -1;
4500 static int hf_ieee80211_wfa_ie_wpa_akms_wfa_type = -1;
4501 static int hf_ieee80211_wfa_ie_wpa_akms_type = -1;
4502 static int hf_ieee80211_wfa_ie_wme_subtype = -1;
4503 static int hf_ieee80211_wfa_ie_wme_version = -1;
4504 static int hf_ieee80211_wfa_ie_wme_qos_info = -1;
4505 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length = -1;
4506 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be = -1;
4507 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk = -1;
4508 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi = -1;
4509 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo = -1;
4510 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved = -1;
4511 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd = -1;
4512 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count = -1;
4513 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved = -1;
4514 static int hf_ieee80211_wfa_ie_wme_reserved = -1;
4515 static int hf_ieee80211_wfa_ie_wme_ac_parameters = -1;
4516 static int hf_ieee80211_wfa_ie_wme_acp_aci_aifsn = -1;
4517 static int hf_ieee80211_wfa_ie_wme_acp_aci = -1;
4518 static int hf_ieee80211_wfa_ie_wme_acp_acm = -1;
4519 static int hf_ieee80211_wfa_ie_wme_acp_aifsn = -1;
4520 static int hf_ieee80211_wfa_ie_wme_acp_reserved = -1;
4521 static int hf_ieee80211_wfa_ie_wme_acp_ecw = -1;
4522 static int hf_ieee80211_wfa_ie_wme_acp_ecw_max = -1;
4523 static int hf_ieee80211_wfa_ie_wme_acp_ecw_min = -1;
4524 static int hf_ieee80211_wfa_ie_wme_acp_cw_max = -1;
4525 static int hf_ieee80211_wfa_ie_wme_acp_cw_min = -1;
4526 static int hf_ieee80211_wfa_ie_wme_acp_txop_limit = -1;
4527 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo = -1;
4528 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid = -1;
4529 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction = -1;
4530 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb = -1;
4531 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up = -1;
4532 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved = -1;
4533 static int hf_ieee80211_wfa_ie_wme_tspec_nor_msdu = -1;
4534 static int hf_ieee80211_wfa_ie_wme_tspec_max_msdu = -1;
4535 static int hf_ieee80211_wfa_ie_wme_tspec_min_srv = -1;
4536 static int hf_ieee80211_wfa_ie_wme_tspec_max_srv = -1;
4537 static int hf_ieee80211_wfa_ie_wme_tspec_inact_int = -1;
4538 static int hf_ieee80211_wfa_ie_wme_tspec_susp_int = -1;
4539 static int hf_ieee80211_wfa_ie_wme_tspec_srv_start = -1;
4540 static int hf_ieee80211_wfa_ie_wme_tspec_min_data = -1;
4541 static int hf_ieee80211_wfa_ie_wme_tspec_mean_data = -1;
4542 static int hf_ieee80211_wfa_ie_wme_tspec_peak_data = -1;
4543 static int hf_ieee80211_wfa_ie_wme_tspec_burst_size = -1;
4544 static int hf_ieee80211_wfa_ie_wme_tspec_delay_bound = -1;
4545 static int hf_ieee80211_wfa_ie_wme_tspec_min_phy = -1;
4546 static int hf_ieee80211_wfa_ie_wme_tspec_surplus = -1;
4547 static int hf_ieee80211_wfa_ie_wme_tspec_medium = -1;
4548
4549 static int hf_ieee80211_aironet_ie_type = -1;
4550 static int hf_ieee80211_aironet_ie_dtpc = -1;
4551 static int hf_ieee80211_aironet_ie_dtpc_unknown = -1;
4552 static int hf_ieee80211_aironet_ie_version = -1;
4553 static int hf_ieee80211_aironet_ie_data = -1;
4554 static int hf_ieee80211_aironet_ie_qos_reserved = -1;
4555 static int hf_ieee80211_aironet_ie_qos_paramset = -1;
4556 static int hf_ieee80211_aironet_ie_qos_val = -1;
4557 static int hf_ieee80211_aironet_ie_clientmfp = -1;
4558
4559 static int hf_ieee80211_vs_nintendo_type = -1;
4560 static int hf_ieee80211_vs_nintendo_length = -1;
4561 static int hf_ieee80211_vs_nintendo_servicelist = -1;
4562 static int hf_ieee80211_vs_nintendo_service = -1;
4563 static int hf_ieee80211_vs_nintendo_consoleid = -1;
4564 static int hf_ieee80211_vs_nintendo_unknown = -1;
4565
4566 static int hf_ieee80211_vs_aruba_subtype = -1;
4567 static int hf_ieee80211_vs_aruba_apname = -1;
4568 static int hf_ieee80211_vs_aruba_data = -1;
4569
4570 static int hf_ieee80211_vs_mikrotik_unknown = -1;
4571 static int hf_ieee80211_vs_mikrotik_subitem = -1;
4572 static int hf_ieee80211_vs_mikrotik_subtype = -1;
4573 static int hf_ieee80211_vs_mikrotik_sublength = -1;
4574 static int hf_ieee80211_vs_mikrotik_subdata = -1;
4575
4576 static int hf_ieee80211_vs_meru_subitem = -1;
4577 static int hf_ieee80211_vs_meru_subtype = -1;
4578 static int hf_ieee80211_vs_meru_sublength = -1;
4579 static int hf_ieee80211_vs_meru_subdata = -1;
4580
4581 static int hf_ieee80211_vs_extreme_subtype = -1;
4582 static int hf_ieee80211_vs_extreme_subdata = -1;
4583 static int hf_ieee80211_vs_extreme_unknown = -1;
4584 static int hf_ieee80211_vs_extreme_ap_length = -1;
4585 static int hf_ieee80211_vs_extreme_ap_name = -1;
4586
4587 static int hf_ieee80211_rsn_ie_pmkid = -1;
4588 static int hf_ieee80211_rsn_ie_unknown = -1;
4589
4590 static int hf_ieee80211_marvell_ie_type = -1;
4591 static int hf_ieee80211_marvell_ie_mesh_subtype = -1;
4592 static int hf_ieee80211_marvell_ie_mesh_version = -1;
4593 static int hf_ieee80211_marvell_ie_mesh_active_proto_id = -1;
4594 static int hf_ieee80211_marvell_ie_mesh_active_metric_id = -1;
4595 static int hf_ieee80211_marvell_ie_mesh_cap = -1;
4596 static int hf_ieee80211_marvell_ie_data = -1;
4597
4598 static int hf_ieee80211_atheros_ie_type = -1;
4599 static int hf_ieee80211_atheros_ie_subtype = -1;
4600 static int hf_ieee80211_atheros_ie_version = -1;
4601 static int hf_ieee80211_atheros_ie_cap_f_turbop = -1;
4602 static int hf_ieee80211_atheros_ie_cap_f_comp = -1;
4603 static int hf_ieee80211_atheros_ie_cap_f_ff = -1;
4604 static int hf_ieee80211_atheros_ie_cap_f_xr = -1;
4605 static int hf_ieee80211_atheros_ie_cap_f_ar = -1;
4606 static int hf_ieee80211_atheros_ie_cap_f_burst = -1;
4607 static int hf_ieee80211_atheros_ie_cap_f_wme = -1;
4608 static int hf_ieee80211_atheros_ie_cap_f_boost = -1;
4609 static int hf_ieee80211_atheros_ie_advcap_cap = -1;
4610 static int hf_ieee80211_atheros_ie_advcap_defkey = -1;
4611 static int hf_ieee80211_atheros_ie_xr_info = -1;
4612 static int hf_ieee80211_atheros_ie_xr_base_bssid = -1;
4613 static int hf_ieee80211_atheros_ie_xr_xr_bssid = -1;
4614 static int hf_ieee80211_atheros_ie_xr_xr_beacon = -1;
4615 static int hf_ieee80211_atheros_ie_xr_base_cap = -1;
4616 static int hf_ieee80211_atheros_ie_xr_xr_cap = -1;
4617 static int hf_ieee80211_atheros_ie_data = -1;
4618
4619 /*QBSS - Version 1,2,802.11e*/
4620
4621 static int hf_ieee80211_qbss2_cal = -1;
4622 static int hf_ieee80211_qbss2_gl = -1;
4623 static int hf_ieee80211_qbss_cu = -1;
4624 static int hf_ieee80211_qbss2_cu = -1;
4625 static int hf_ieee80211_qbss_scount = -1;
4626 static int hf_ieee80211_qbss2_scount = -1;
4627 static int hf_ieee80211_qbss_version = -1;
4628 static int hf_ieee80211_qbss_adc = -1;
4629
4630 static int hf_ieee80211_tsinfo = -1;
4631 static int hf_ieee80211_tsinfo_type = -1;
4632 static int hf_ieee80211_tsinfo_tsid = -1;
4633 static int hf_ieee80211_tsinfo_dir = -1;
4634 static int hf_ieee80211_tsinfo_access = -1;
4635 static int hf_ieee80211_tsinfo_agg = -1;
4636 static int hf_ieee80211_tsinfo_apsd = -1;
4637 static int hf_ieee80211_tsinfo_up = -1;
4638 static int hf_ieee80211_tsinfo_ack = -1;
4639 static int hf_ieee80211_tsinfo_sched = -1;
4640 static int hf_ieee80211_tsinfo_rsv = -1;
4641
4642 static const int *ieee80211_tsinfo_fields[] = {
4643   &hf_ieee80211_tsinfo_type,
4644   &hf_ieee80211_tsinfo_tsid,
4645   &hf_ieee80211_tsinfo_dir,
4646   &hf_ieee80211_tsinfo_access,
4647   &hf_ieee80211_tsinfo_agg,
4648   &hf_ieee80211_tsinfo_apsd,
4649   &hf_ieee80211_tsinfo_up,
4650   &hf_ieee80211_tsinfo_ack,
4651   &hf_ieee80211_tsinfo_sched,
4652   &hf_ieee80211_tsinfo_rsv,
4653   NULL
4654 };
4655
4656 static int hf_ieee80211_tspec_nor_msdu = -1;
4657 static int hf_ieee80211_tspec_max_msdu = -1;
4658 static int hf_ieee80211_tspec_min_srv = -1;
4659 static int hf_ieee80211_tspec_max_srv = -1;
4660 static int hf_ieee80211_tspec_inact_int = -1;
4661 static int hf_ieee80211_tspec_susp_int = -1;
4662 static int hf_ieee80211_tspec_srv_start = -1;
4663 static int hf_ieee80211_tspec_min_data = -1;
4664 static int hf_ieee80211_tspec_mean_data = -1;
4665 static int hf_ieee80211_tspec_peak_data = -1;
4666 static int hf_ieee80211_tspec_burst_size = -1;
4667 static int hf_ieee80211_tspec_delay_bound = -1;
4668 static int hf_ieee80211_tspec_min_phy = -1;
4669 static int hf_ieee80211_tspec_surplus = -1;
4670 static int hf_ieee80211_tspec_medium = -1;
4671 static int hf_ieee80211_tspec_dmg = -1;
4672 static int hf_ieee80211_ts_delay = -1;
4673 static int hf_ieee80211_tclas_process = -1;
4674 static int hf_ieee80211_tag_ext_supp_rates = -1;
4675 static int hf_ieee80211_sched_info = -1;
4676 static int hf_ieee80211_sched_info_agg = -1;
4677 static int hf_ieee80211_sched_info_tsid = -1;
4678 static int hf_ieee80211_sched_info_dir = -1;
4679 static int hf_ieee80211_sched_srv_start = -1;
4680 static int hf_ieee80211_sched_srv_int = -1;
4681 static int hf_ieee80211_sched_spec_int = -1;
4682 static int hf_ieee80211_tclas_up = -1;
4683 static int hf_ieee80211_tclas_class_type = -1;
4684 static int hf_ieee80211_tclas_class_mask = -1;
4685 static int hf_ieee80211_tclas_class_mask0_src_addr = -1;
4686 static int hf_ieee80211_tclas_class_mask0_dst_addr = -1;
4687 static int hf_ieee80211_tclas_class_mask0_type = -1;
4688 static int hf_ieee80211_tclas_class_mask1_ver = -1;
4689 static int hf_ieee80211_tclas_class_mask1_src_ip = -1;
4690 static int hf_ieee80211_tclas_class_mask1_dst_ip = -1;
4691 static int hf_ieee80211_tclas_class_mask1_src_port = -1;
4692 static int hf_ieee80211_tclas_class_mask1_dst_port = -1;
4693 static int hf_ieee80211_tclas_class_mask1_ipv4_dscp = -1;
4694 static int hf_ieee80211_tclas_class_mask1_ipv4_proto = -1;
4695 static int hf_ieee80211_tclas_class_mask1_ipv6_flow = -1;
4696 static int hf_ieee80211_tclas_class_mask2_tci = -1;
4697 static int hf_ieee80211_tclas_src_mac_addr = -1;
4698 static int hf_ieee80211_tclas_dst_mac_addr = -1;
4699 static int hf_ieee80211_tclas_ether_type = -1;
4700 static int hf_ieee80211_tclas_version = -1;
4701 static int hf_ieee80211_tclas_ipv4_src = -1;
4702 static int hf_ieee80211_tclas_ipv4_dst = -1;
4703 static int hf_ieee80211_tclas_src_port = -1;
4704 static int hf_ieee80211_tclas_dst_port = -1;
4705 static int hf_ieee80211_tclas_dscp = -1;
4706 static int hf_ieee80211_tclas_protocol = -1;
4707 static int hf_ieee80211_tclas_ipv6_src = -1;
4708 static int hf_ieee80211_tclas_ipv6_dst = -1;
4709 static int hf_ieee80211_tclas_flow = -1;
4710 static int hf_ieee80211_tclas_tag_type = -1;
4711
4712 static int hf_ieee80211_aruba = -1;
4713 static int hf_ieee80211_aruba_hb_seq = -1;
4714 static int hf_ieee80211_aruba_mtu = -1;
4715
4716 static int hf_ieee80211_tag_vendor_oui_type = -1;
4717 static int hf_ieee80211_tag_vendor_data = -1;
4718
4719 /* IEEE Std 802.11z-2010 7.3.2.62 */
4720 static int hf_ieee80211_tag_link_id_bssid = -1;
4721 static int hf_ieee80211_tag_link_id_init_sta = -1;
4722 static int hf_ieee80211_tag_link_id_resp_sta = -1;
4723
4724 /* IEEE Std 802.11z-2010 7.3.2.63 */
4725 static int hf_ieee80211_tag_wakeup_schedule_offset = -1;
4726 static int hf_ieee80211_tag_wakeup_schedule_interval = -1;
4727 static int hf_ieee80211_tag_wakeup_schedule_awake_window_slots = -1;
4728 static int hf_ieee80211_tag_wakeup_schedule_max_awake_dur = -1;
4729 static int hf_ieee80211_tag_wakeup_schedule_idle_count = -1;
4730
4731 /* IEEE Std 802.11z-2010 7.3.2.64 */
4732 static int hf_ieee80211_tag_channel_switch_timing_switch_time = -1;
4733 static int hf_ieee80211_tag_channel_switch_timing_switch_timeout = -1;
4734
4735 /* IEEE Std 802.11z-2010 7.3.2.65 */
4736 static int hf_ieee80211_tag_pti_control_tid = -1;
4737 static int hf_ieee80211_tag_pti_control_sequence_control = -1;
4738
4739 /* IEEE Std 802.11z-2010 7.3.2.66 */
4740 static int hf_ieee80211_tag_pu_buffer_status_ac_bk = -1;
4741 static int hf_ieee80211_tag_pu_buffer_status_ac_be = -1;
4742 static int hf_ieee80211_tag_pu_buffer_status_ac_vi = -1;
4743 static int hf_ieee80211_tag_pu_buffer_status_ac_vo = -1;
4744
4745 /* IEEE Std 802.11r-2008 7.3.2.49 */
4746 static int hf_ieee80211_tag_timeout_int_type = -1;
4747 static int hf_ieee80211_tag_timeout_int_value = -1;
4748
4749 /* Ethertype 89-0d */
4750 static int hf_ieee80211_data_encap_payload_type = -1;
4751
4752 static int hf_ieee80211_anqp_wfa_subtype = -1;
4753
4754 static int hf_ieee80211_dpp_subtype = -1;
4755
4756 /* Hotspot 2.0 */
4757 static int hf_hs20_indication_dgaf_disabled = -1;
4758 static int hf_hs20_indication_pps_mo_id_present = -1;
4759 static int hf_hs20_indication_anqp_domain_id_present = -1;
4760 static int hf_hs20_indication_release_number = -1;
4761
4762 static int hf_hs20_anqp_subtype = -1;
4763 static int hf_hs20_anqp_reserved = -1;
4764 static int hf_hs20_anqp_payload = -1;
4765 static int hf_hs20_anqp_hs_query_list = -1;
4766 static int hf_hs20_anqp_hs_capability_list = -1;
4767 static int hf_hs20_anqp_ofn_length = -1;
4768 static int hf_hs20_anqp_ofn_language = -1;
4769 static int hf_hs20_anqp_ofn_name = -1;
4770 static int hf_hs20_anqp_wan_metrics_link_status = -1;
4771 static int hf_hs20_anqp_wan_metrics_symmetric_link = -1;
4772 static int hf_hs20_anqp_wan_metrics_at_capacity = -1;
4773 static int hf_hs20_anqp_wan_metrics_reserved = -1;
4774 static int hf_hs20_anqp_wan_metrics_downlink_speed = -1;
4775 static int hf_hs20_anqp_wan_metrics_uplink_speed = -1;
4776 static int hf_hs20_anqp_wan_metrics_downlink_load = -1;
4777 static int hf_hs20_anqp_wan_metrics_uplink_load = -1;
4778 static int hf_hs20_anqp_wan_metrics_lmd = -1;
4779 static int hf_hs20_anqp_cc_proto_ip_proto = -1;
4780 static int hf_hs20_anqp_cc_proto_port_num = -1;
4781 static int hf_hs20_anqp_cc_proto_status = -1;
4782 static int hf_hs20_anqp_nai_hrq_count = -1;
4783 static int hf_hs20_anqp_nai_hrq_encoding_type = -1;
4784 static int hf_hs20_anqp_nai_hrq_length = -1;
4785 static int hf_hs20_anqp_nai_hrq_realm_name = -1;
4786 static int hf_hs20_anqp_oper_class_indic = -1;
4787
4788 /* IEEE Std 802.11ad */
4789 static int hf_ieee80211_block_ack_RBUFCAP = -1;
4790 static int hf_ieee80211_cf_response_offset = -1;
4791 static int hf_ieee80211_grant_ack_reserved = -1;
4792 static int hf_ieee80211_ff_dynamic_allocation = -1;
4793 static int hf_ieee80211_ff_TID = -1;
4794 static int hf_ieee80211_ff_alloc_type = -1;
4795 static int hf_ieee80211_ff_src_aid = -1;
4796 static int hf_ieee80211_ff_dest_aid = -1;
4797 static int hf_ieee80211_ff_alloc_duration = -1;
4798 static int hf_ieee80211_ff_b39 = -1;
4799 static int hf_ieee80211_ff_ssw = -1;
4800 static int hf_ieee80211_ff_ssw_direction = -1;
4801 static int hf_ieee80211_ff_ssw_cdown = -1;
4802 static int hf_ieee80211_ff_ssw_sector_id = -1;
4803 static int hf_ieee80211_ff_ssw_dmg_ant_id = -1;
4804 static int hf_ieee80211_ff_ssw_rxss_len = -1;
4805 static int hf_ieee80211_ff_bf = -1;
4806 static int hf_ieee80211_ff_bf_train = -1;
4807 static int hf_ieee80211_ff_bf_is_init = -1;
4808 static int hf_ieee80211_ff_bf_is_resp = -1;
4809 static int hf_ieee80211_ff_bf_num_sectors = -1;
4810 static int hf_ieee80211_ff_bf_num_rx_dmg_ants = -1;
4811 static int hf_ieee80211_ff_bf_b12b15 = -1;
4812 static int hf_ieee80211_ff_bf_rxss_len = -1;
4813 static int hf_ieee80211_ff_bf_rxss_rate = -1;
4814 static int hf_ieee80211_ff_bf_b10b15 = -1;
4815 static int hf_ieee80211_addr_nav_da = -1;
4816 static int hf_ieee80211_addr_nav_sa = -1;
4817 static int hf_ieee80211_ff_sswf = -1;
4818 static int hf_ieee80211_ff_sswf_num_rx_dmg_ants = -1;
4819 static int hf_ieee80211_ff_sswf_poll_required = -1;
4820 static int hf_ieee80211_ff_sswf_total_sectors = -1;
4821 static int hf_ieee80211_ff_sswf_reserved1 = -1;
4822 static int hf_ieee80211_ff_sswf_reserved2 = -1;
4823 static int hf_ieee80211_ff_sswf_sector_select = -1;
4824 static int hf_ieee80211_ff_sswf_dmg_antenna_select = -1;
4825 static int hf_ieee80211_ff_sswf_snr_report = -1;
4826 static int hf_ieee80211_ff_brp = -1;
4827 static int hf_ieee80211_ff_brp_L_RX = -1;
4828 static int hf_ieee80211_ff_brp_TX_TRN_REQ = -1;
4829 static int hf_ieee80211_ff_brp_MID_REQ = -1;
4830 static int hf_ieee80211_ff_brp_BC_REQ = -1;
4831 static int hf_ieee80211_ff_brp_MID_GRANT = -1;
4832 static int hf_ieee80211_ff_brp_BC_GRANT = -1;
4833 static int hf_ieee80211_ff_brp_chan_FBCK_CAP = -1;
4834 static int hf_ieee80211_ff_brp_tx_sector = -1;
4835 static int hf_ieee80211_ff_brp_other_aid = -1;
4836 static int hf_ieee80211_ff_brp_tx_antenna = -1;
4837 static int hf_ieee80211_ff_brp_reserved = -1;
4838 static int hf_ieee80211_ff_blm = -1;
4839 static int hf_ieee80211_ff_blm_unit_index = -1;
4840 static int hf_ieee80211_ff_blm_maint_value = -1;
4841 static int hf_ieee80211_ff_blm_is_master = -1;
4842 static int hf_ieee80211_ff_bic = -1;
4843 static int hf_ieee80211_ff_bic_cc_present = -1;
4844 static int hf_ieee80211_ff_bic_discovery_mode = -1;
4845 static int hf_ieee80211_ff_bic_next_beacon = -1;
4846 static int hf_ieee80211_ff_bic_ati_present = -1;
4847 static int hf_ieee80211_ff_bic_abft_len = -1;
4848 static int hf_ieee80211_ff_bic_fss = -1;
4849 static int hf_ieee80211_ff_bic_is_resp = -1;
4850 static int hf_ieee80211_ff_bic_next_abft = -1;
4851 static int hf_ieee80211_ff_bic_frag_txss = -1;
4852 static int hf_ieee80211_ff_bic_txss_span = -1;
4853 static int hf_ieee80211_ff_bic_NBI_abft = -1;
4854 static int hf_ieee80211_ff_bic_abft_count = -1;
4855 static int hf_ieee80211_ff_bic_nabft = -1;
4856 static int hf_ieee80211_ff_bic_pcp = -1;
4857 static int hf_ieee80211_ff_bic_reserved = -1;
4858 static const int *ieee80211_ff_bic_fields[] = {
4859   &hf_ieee80211_ff_bic_cc_present,
4860   &hf_ieee80211_ff_bic_discovery_mode,
4861   &hf_ieee80211_ff_bic_next_beacon,
4862   &hf_ieee80211_ff_bic_ati_present,
4863   &hf_ieee80211_ff_bic_abft_len,
4864   &hf_ieee80211_ff_bic_fss,
4865   &hf_ieee80211_ff_bic_is_resp,
4866   &hf_ieee80211_ff_bic_next_abft,
4867   &hf_ieee80211_ff_bic_frag_txss,
4868   &hf_ieee80211_ff_bic_txss_span,
4869   &hf_ieee80211_ff_bic_NBI_abft,
4870   &hf_ieee80211_ff_bic_abft_count,
4871   &hf_ieee80211_ff_bic_nabft,
4872   &hf_ieee80211_ff_bic_pcp,
4873   &hf_ieee80211_ff_bic_reserved,
4874   NULL
4875 };
4876 static int hf_ieee80211_ff_dmg_params = -1;
4877 static int hf_ieee80211_ff_dmg_params_bss = -1;
4878 static int hf_ieee80211_ff_dmg_params_cbap_only = -1;
4879 static int hf_ieee80211_ff_dmg_params_cbap_src = -1;
4880 static int hf_ieee80211_ff_dmg_params_privacy = -1;
4881 static int hf_ieee80211_ff_dmg_params_policy = -1;
4882 static int hf_ieee80211_ff_cc = -1;
4883 static int hf_ieee80211_ff_cc_abft_resp_addr = -1;
4884 static int hf_ieee80211_ff_cc_sp_duration = -1;
4885 static int hf_ieee80211_ff_cc_cluster_id = -1;
4886 static int hf_ieee80211_ff_cc_role = -1;
4887 static int hf_ieee80211_ff_cc_max_mem = -1;
4888 static int hf_ieee80211_ff_dmg_action_code = -1;
4889 static int hf_ieee80211_ff_dmg_pwr_mgmt = -1;
4890 static int hf_ieee80211_ff_subject_address = -1;
4891 static int hf_ieee80211_ff_handover_reason = -1;
4892 static int hf_ieee80211_ff_handover_remaining_bi = -1;
4893 static int hf_ieee80211_ff_handover_result = -1;
4894 static int hf_ieee80211_ff_handover_reject_reason = -1;
4895 static int hf_ieee80211_ff_destination_reds_aid = -1;
4896 static int hf_ieee80211_ff_destination_aid = -1;
4897 static int hf_ieee80211_ff_realy_aid = -1;
4898 static int hf_ieee80211_ff_source_aid = -1;
4899 static int hf_ieee80211_ff_timing_offset = -1;
4900 static int hf_ieee80211_ff_sampling_frequency_offset = -1;
4901 static int hf_ieee80211_ff_relay_operation_type = -1;
4902 static int hf_ieee80211_ff_peer_sta_aid = -1;
4903 static int hf_ieee80211_ff_snr = -1;
4904 static int hf_ieee80211_ff_internal_angle = -1;
4905 static int hf_ieee80211_ff_recommend = -1;
4906 static int hf_ieee80211_ff_unprotected_dmg_action_code = -1;
4907 static int hf_ieee80211_ff_fst_action_code = -1;
4908 static int hf_ieee80211_ff_llt = -1;
4909 static int hf_ieee80211_ff_fsts_id = -1;
4910 static int hf_ieee80211_ff_mmpdu_len = -1;
4911 static int hf_ieee80211_ff_mmpdu_ctrl = -1;
4912 static int hf_ieee80211_ff_oct_mmpdu = -1;
4913 #if 0
4914 static int hf_ieee80211_ff_rcsi = -1;
4915 static int hf_ieee80211_ff_rcsi_aid = -1;
4916 #endif
4917 static int hf_ieee80211_ff_band_id = -1;
4918 static int hf_ieee80211_tag_relay_support = -1;
4919 static int hf_ieee80211_tag_relay_use = -1;
4920 static int hf_ieee80211_tag_relay_permission = -1;
4921 static int hf_ieee80211_tag_AC_power = -1;
4922 static int hf_ieee80211_tag_relay_prefer = -1;
4923 static int hf_ieee80211_tag_duplex = -1;
4924 static int hf_ieee80211_tag_cooperation = -1;
4925 static int hf_ieee80211_tag_move = -1;
4926 static int hf_ieee80211_tag_size = -1;
4927 static int hf_ieee80211_tag_tbtt_offset = -1;
4928 static int hf_ieee80211_tag_bi_duration = -1;
4929 static int hf_ieee80211_tag_dmg_capa_sta_addr = -1;
4930 static int hf_ieee80211_tag_dmg_capa_aid = -1;
4931 static int hf_ieee80211_tag_reverse_direction = -1;
4932 static int hf_ieee80211_tag_hlts = -1;
4933 static int hf_ieee80211_tag_tpc = -1;
4934 static int hf_ieee80211_tag_spsh = -1;
4935 static int hf_ieee80211_tag_rx_antenna = -1;
4936 static int hf_ieee80211_tag_fast_link = -1;
4937 static int hf_ieee80211_tag_num_sectors = -1;
4938 static int hf_ieee80211_tag_rxss_length = -1;
4939 static int hf_ieee80211_tag_reciprocity = -1;
4940 static int hf_ieee80211_tag_max_ampdu_exp = -1;
4941 static int hf_ieee80211_tag_min_mpdu_spacing = -1;
4942 static int hf_ieee80211_tag_ba_flow_control = -1;
4943 static int hf_ieee80211_tag_max_sc_rx_mcs = -1;
4944 static int hf_ieee80211_tag_max_ofdm_rx_mcs = -1;
4945 static int hf_ieee80211_tag_max_sc_tx_mcs = -1;
4946 static int hf_ieee80211_tag_max_ofdm_tx_mcs = -1;
4947 static int hf_ieee80211_tag_low_power_supported = -1;
4948 static int hf_ieee80211_tag_code_rate = -1;
4949 static int hf_ieee80211_tag_dtp = -1;
4950 static int hf_ieee80211_tag_appdu_supp = -1;
4951 static int hf_ieee80211_tag_heartbeat = -1;
4952 static int hf_ieee80211_tag_other_aid = -1;
4953 static int hf_ieee80211_tag_pattern_recip = -1;
4954 static int hf_ieee80211_tag_heartbeat_elapsed = -1;
4955 static int hf_ieee80211_tag_grant_ack_supp = -1;
4956 static int hf_ieee80211_tag_RXSSTxRate_supp = -1;
4957 static int hf_ieee80211_tag_pcp_tddti = -1;
4958 static int hf_ieee80211_tag_pcp_PSA = -1;
4959 static int hf_ieee80211_tag_pcp_handover = -1;
4960 static int hf_ieee80211_tag_pcp_max_assoc = -1;
4961 static int hf_ieee80211_tag_pcp_power_src = -1;
4962 static int hf_ieee80211_tag_pcp_decenter = -1;
4963 static int hf_ieee80211_tag_pcp_forwarding = -1;
4964 static int hf_ieee80211_tag_pcp_center = -1;
4965 static int hf_ieee80211_tag_PSRSI = -1;
4966 static int hf_ieee80211_tag_min_BHI_duration = -1;
4967 static int hf_ieee80211_tag_brdct_sta_info_dur = -1;
4968 static int hf_ieee80211_tag_assoc_resp_confirm_time = -1;
4969 static int hf_ieee80211_tag_min_pp_duration = -1;
4970 static int hf_ieee80211_tag_SP_idle_timeout = -1;
4971 static int hf_ieee80211_tag_max_lost_beacons = -1;
4972 static int hf_ieee80211_tag_type = -1;
4973 static int hf_ieee80211_tag_tap1 = -1;
4974 static int hf_ieee80211_tag_state1 = -1;
4975 static int hf_ieee80211_tag_tap2 = -1;
4976 static int hf_ieee80211_tag_state2 = -1;
4977 static int hf_ieee80211_tag_allocation_id = -1;
4978 static int hf_ieee80211_tag_allocation_type = -1;
4979 static int hf_ieee80211_tag_pseudo_static = -1;
4980 static int hf_ieee80211_tag_truncatable = -1;
4981 static int hf_ieee80211_tag_extendable = -1;
4982 static int hf_ieee80211_tag_pcp_active = -1;
4983 static int hf_ieee80211_tag_lp_sc_used = -1;
4984 static int hf_ieee80211_tag_src_aid = -1;
4985 static int hf_ieee80211_tag_dest_aid = -1;
4986 static int hf_ieee80211_tag_alloc_start = -1;
4987 static int hf_ieee80211_tag_alloc_block_duration = -1;
4988 static int hf_ieee80211_tag_num_blocks = -1;
4989 static int hf_ieee80211_tag_alloc_block_period = -1;
4990 static int hf_ieee80211_tag_aid = -1;
4991 static int hf_ieee80211_tag_cbap = -1;
4992 static int hf_ieee80211_tag_pp_avail = -1;
4993 static int hf_ieee80211_tag_next_ati_start_time = -1;
4994 static int hf_ieee80211_tag_next_ati_duration = -1;
4995 static int hf_ieee80211_tag_old_bssid = -1;
4996 static int hf_ieee80211_tag_new_pcp_addr = -1;
4997 static int hf_ieee80211_tag_bssid = -1;
4998 static int hf_ieee80211_tag_duplex_relay = -1;
4999 static int hf_ieee80211_tag_cooperation_relay = -1;
5000 static int hf_ieee80211_tag_tx_mode = -1;
5001 static int hf_ieee80211_tag_link_change_interval = -1;
5002 static int hf_ieee80211_tag_data_sensing_time = -1;
5003 static int hf_ieee80211_tag_first_period = -1;
5004 static int hf_ieee80211_tag_second_period = -1;
5005 static int hf_ieee80211_tag_initiator = -1;
5006 static int hf_ieee80211_tag_tx_train_res = -1;
5007 static int hf_ieee80211_tag_rx_train_res = -1;
5008 static int hf_ieee80211_tag_tx_trn_ok = -1;
5009 static int hf_ieee80211_tag_txss_fbck_req = -1;
5010 static int hf_ieee80211_tag_bs_fbck = -1;
5011 static int hf_ieee80211_tag_bs_fbck_antenna_id = -1;
5012 static int hf_ieee80211_tag_snr_requested = -1;
5013 static int hf_ieee80211_tag_channel_measurement_requested = -1;
5014 static int hf_ieee80211_tag_number_of_taps_requested = -1;
5015 static int hf_ieee80211_tag_sector_id_order_req = -1;
5016 static int hf_ieee80211_tag_snr_present = -1;
5017 static int hf_ieee80211_tag_channel_measurement_present = -1;
5018 static int hf_ieee80211_tag_tap_delay_present = -1;
5019 static int hf_ieee80211_tag_number_of_taps_present = -1;
5020 static int hf_ieee80211_tag_number_of_measurement = -1;
5021 static int hf_ieee80211_tag_sector_id_order_present = -1;
5022 static int hf_ieee80211_tag_number_of_beams = -1;
5023 static int hf_ieee80211_tag_mid_extension = -1;
5024 static int hf_ieee80211_tag_capability_request = -1;
5025 static int hf_ieee80211_tag_beam_refine_reserved = -1;
5026 static int hf_ieee80211_tag_nextpcp_list = -1;
5027 static int hf_ieee80211_tag_nextpcp_token = -1;
5028 static int hf_ieee80211_tag_reamaining_BI = -1;
5029 static int hf_ieee80211_tag_request_token = -1;
5030 static int hf_ieee80211_tag_bi_start_time = -1;
5031 static int hf_ieee80211_tag_sleep_cycle = -1;
5032 static int hf_ieee80211_tag_num_awake_bis = -1;
5033 static int hf_ieee80211_tag_tspec_allocation_id = -1;
5034 static int hf_ieee80211_tag_tspec_allocation_type = -1;
5035 static int hf_ieee80211_tag_tspec_allocation_format = -1;
5036 static int hf_ieee80211_tag_tspec_pseudo_static = -1;
5037 static int hf_ieee80211_tag_tspec_truncatable = -1;
5038 static int hf_ieee80211_tag_tspec_extendable = -1;
5039 static int hf_ieee80211_tag_tspec_lp_sc_used = -1;
5040 static int hf_ieee80211_tag_tspec_up = -1;
5041 static int hf_ieee80211_tag_tspec_dest_aid = -1;
5042 static int hf_ieee80211_tag_tspec_allocation_period = -1;
5043 static int hf_ieee80211_tag_tspec_min_allocation = -1;
5044 static int hf_ieee80211_tag_tspec_max_allocation = -1;
5045 static int hf_ieee80211_tag_tspec_min_duration = -1;
5046 static int hf_ieee80211_tag_tspec_num_of_constraints = -1;
5047 static int hf_ieee80211_tag_tspec_tsconst_start_time = -1;
5048 static int hf_ieee80211_tag_tspec_tsconst_duration = -1;
5049 static int hf_ieee80211_tag_tspec_tsconst_period = -1;
5050 static int hf_ieee80211_tag_tspec_tsconst_interferer_mac = -1;
5051 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_I = -1;
5052 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_Q = -1;
5053 static int hf_ieee80211_tag_channel_measurement_feedback_tap_delay = -1;
5054 static int hf_ieee80211_tag_channel_measurement_feedback_sector_id = -1;
5055 static int hf_ieee80211_tag_channel_measurement_feedback_antenna_id = -1;
5056 static int hf_ieee80211_tag_awake_window = -1;
5057 static int hf_ieee80211_tag_addba_ext_no_frag = -1;
5058 static int hf_ieee80211_tag_addba_ext_he_fragmentation_operation = -1;
5059 static int hf_ieee80211_tag_addba_ext_reserved = -1;
5060 static int hf_ieee80211_tag_multi_band_ctrl_sta_role = -1;
5061 static int hf_ieee80211_tag_multi_band_ctrl_addr_present = -1;
5062 static int hf_ieee80211_tag_multi_band_ctrl_cipher_present = -1;
5063 static int hf_ieee80211_tag_multi_band_oper_class = -1;
5064 static int hf_ieee80211_tag_multi_band_channel_number = -1;
5065 static int hf_ieee80211_tag_multi_band_tsf_offset = -1;
5066 static int hf_ieee80211_tag_multi_band_conn_ap = -1;
5067 static int hf_ieee80211_tag_multi_band_conn_pcp = -1;
5068 static int hf_ieee80211_tag_multi_band_conn_dls = -1;
5069 static int hf_ieee80211_tag_multi_band_conn_tdls = -1;
5070 static int hf_ieee80211_tag_multi_band_conn_ibss = -1;
5071 static int hf_ieee80211_tag_multi_band_fst_timeout = -1;
5072 static int hf_ieee80211_tag_multi_band_sta_mac = -1;
5073 static int hf_ieee80211_tag_activity = -1;
5074 static int hf_ieee80211_tag_dmg_link_adapt_mcs = -1;
5075 static int hf_ieee80211_tag_dmg_link_adapt_link_margin = -1;
5076 static int hf_ieee80211_tag_ref_timestamp = -1;
5077 static int hf_ieee80211_tag_switching_stream_non_qos = -1;
5078 static int hf_ieee80211_tag_switching_stream_param_num = -1;
5079 static int hf_ieee80211_tag_switching_stream_old_tid = -1;
5080 static int hf_ieee80211_tag_switching_stream_old_direction = -1;
5081 static int hf_ieee80211_tag_switching_stream_new_tid = -1;
5082 static int hf_ieee80211_tag_switching_stream_new_direction = -1;
5083 static int hf_ieee80211_tag_switching_stream_new_valid_id = -1;
5084 static int hf_ieee80211_tag_switching_stream_llt_type = -1;
5085
5086 static int hf_ieee80211_mysterious_olpc_stuff = -1;
5087
5088 static int hf_ieee80211_esp_access_category = -1;
5089 static int hf_ieee80211_esp_reserved = -1;
5090 static int hf_ieee80211_esp_data_format = -1;
5091 static int hf_ieee80211_esp_ba_windows_size = -1;
5092 static int hf_ieee80211_esp_est_air_time_frac = -1;
5093 static int hf_ieee80211_esp_data_ppdu_duration_target = -1;
5094 static int hf_ieee80211_estimated_service_params = -1;
5095
5096 static int hf_ieee80211_fcg_new_channel_number = -1;
5097 static int hf_ieee80211_fcg_extra_info = -1;
5098
5099 static int hf_ieee80211_ext_tag = -1;
5100 static int hf_ieee80211_ext_tag_number = -1;
5101 static int hf_ieee80211_ext_tag_length = -1;
5102 static int hf_ieee80211_fils_session = -1;
5103 static int hf_ieee80211_fils_wrapped_data = -1;
5104 static int hf_ieee80211_fils_nonce = -1;
5105
5106 /* ************************************************************************* */
5107 /*                              802.11AX fields                              */
5108 /* ************************************************************************* */
5109 static int hf_he_mac_capabilities = -1;
5110 static int hf_he_htc_he_support = -1;
5111 static int hf_he_twt_requester_support = -1;
5112 static int hf_he_twt_responder_support = -1;
5113 static int hf_he_fragmentation_support = -1;
5114 static int hf_he_max_number_fragmented_msdus = -1;
5115 static int hf_he_min_fragment_size = -1;
5116 static int hf_he_trigger_frame_mac_padding_dur = -1;
5117 static int hf_he_multi_tid_aggregation_support = -1;
5118 static int hf_he_he_link_adaptation_support = -1;
5119 static int hf_he_all_ack_support = -1;
5120 static int hf_he_umrs_support = -1;
5121 static int hf_he_bsr_support = -1;
5122 static int hf_he_broadcast_twt_support = -1;
5123 static int hf_he_32_bit_ba_bitmap_support = -1;
5124 static int hf_he_mu_cascading_support = -1;
5125 static int hf_he_ack_enabled_aggregation_support = -1;
5126 static int hf_he_group_addressed_multi_sta_blkack_support = -1;
5127 static int hf_he_om_control_support = -1;
5128 static int hf_he_ofdma_ra_support = -1;
5129 static int hf_he_max_a_mpdu_length_exponent = -1;
5130 static int hf_he_a_msdu_fragmentation_support = -1;
5131 static int hf_he_flexible_twt_schedule_support = -1;
5132 static int hf_he_rx_control_frame_to_multibss = -1;
5133 static int hf_he_bsrp_bqrp_a_mpdu_aggregation = -1;
5134 static int hf_he_qtp_support = -1;
5135 static int hf_he_bqr_support = -1;
5136 static int hf_he_sr_responder = -1;
5137 static int hf_he_ndp_feedback_report_support = -1;
5138 static int hf_he_ops_support = -1;
5139 static int hf_he_a_msdu_in_a_mpdu_support = -1;
5140 static int hf_he_reserved = -1;
5141 static int hf_he_reserved_bit_18 = -1;
5142 static int hf_he_reserved_bit_19 = -1;
5143 static int hf_he_reserved_bit_25 = -1;
5144 static int hf_he_reserved_bits_5_7 = -1;
5145 static int hf_he_reserved_bits_8_9 = -1;
5146 static int hf_he_reserved_bits_15_16 = -1;
5147 static int hf_he_phy_chan_width_set = -1;
5148 static int hf_he_40mhz_channel_2_4ghz = -1;
5149 static int hf_he_40_and_80_mhz_5ghz = -1;
5150 static int hf_he_160_mhz_5ghz = -1;
5151 static int hf_he_160_80_plus_80_mhz_5ghz = -1;
5152 static int hf_he_242_tone_rus_in_2_4ghz = -1;
5153 static int hf_he_242_tone_rus_in_5ghz = -1;
5154 static int hf_he_chan_width_reserved = -1;
5155 static int hf_he_mcs_max_he_mcs_1_ss = -1;
5156 static int hf_he_mcs_max_he_mcs_2_ss = -1;
5157 static int hf_he_mcs_max_he_mcs_3_ss = -1;
5158 static int hf_he_mcs_max_he_mcs_4_ss = -1;
5159 static int hf_he_mcs_max_he_mcs_5_ss = -1;
5160 static int hf_he_mcs_max_he_mcs_6_ss = -1;
5161 static int hf_he_mcs_max_he_mcs_7_ss = -1;
5162 static int hf_he_mcs_max_he_mcs_8_ss = -1;
5163 static int hf_he_rx_he_mcs_map_lte_80 = -1;
5164 static int hf_he_tx_he_mcs_map_lte_80 = -1;
5165 static int hf_he_rx_he_mcs_map_160 = -1;
5166 static int hf_he_tx_he_mcs_map_160 = -1;
5167 static int hf_he_rx_he_mcs_map_80_80 = -1;
5168 static int hf_he_tx_he_mcs_map_80_80 = -1;
5169 static int hf_he_ppe_thresholds_nss = -1;
5170 static int hf_he_ppe_thresholds_ru_index_bitmask = -1;
5171 static int hf_he_ppe_ppet16 = -1;
5172 static int hf_he_ppe_ppet8 = -1;
5173 static int hf_he_phy_dual_band_support = -1;
5174 static int hf_he_phy_cap_dual_band_support = -1;
5175 static int hf_he_phy_b8_to_b23 = -1;
5176 static int hf_he_phy_cap_punctured_preamble_rx = -1;
5177 static int hf_he_phy_cap_device_class = -1;
5178 static int hf_he_phy_cap_ldpc_coding_in_payload = -1;
5179 static int hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us = -1;
5180 static int hf_he_phy_cap_midamble_rx_max_nsts = -1;
5181 static int hf_he_phy_cap_ndp_with_4x_he_ltf_32us = -1;
5182 static int hf_he_phy_cap_stbc_tx_lt_80mhz = -1;
5183 static int hf_he_phy_cap_stbc_rx_lt_80mhz = -1;
5184 static int hf_he_phy_cap_doppler_tx = -1;
5185 static int hf_he_phy_cap_doppler_rx = -1;
5186 static int hf_he_phy_cap_full_bw_ul_mu_mimo = -1;
5187 static int hf_he_phy_cap_partial_bw_ul_mu_mimo = -1;
5188 static int hf_he_phy_b24_to_b39 = -1;
5189 static int hf_he_phy_cap_dcm_max_constellation_tx = -1;
5190 static int hf_he_phy_cap_dcm_max_nss_tx = -1;
5191 static int hf_he_phy_cap_dcm_max_constellation_rx = -1;
5192 static int hf_he_phy_cap_dcm_max_nss_rx = -1;
5193 static int hf_he_phy_cap_rx_he_muppdu_from_non_ap = -1;
5194 static int hf_he_phy_cap_su_beamformer = -1;
5195 static int hf_he_phy_cap_su_beamformee = -1;
5196 static int hf_he_phy_cap_mu_beamformer = -1;
5197 static int hf_he_phy_cap_beamformer_sts_lte_80mhz = -1;
5198 static int hf_he_phy_cap_beamformer_sts_gt_80mhz = -1;
5199 static int hf_he_phy_b40_to_b55 = -1;
5200 static int hf_he_phy_cap_number_of_sounding_dims_lte_80 = -1;
5201 static int hf_he_phy_cap_number_of_sounding_dims_gt_80 = -1;
5202 static int hf_he_phy_cap_ng_eq_16_su_fb = -1;
5203 static int hf_he_phy_cap_ng_eq_16_mu_fb = -1;
5204 static int hf_he_phy_cap_codebook_size_eq_4_2_fb = -1;
5205 static int hf_he_phy_cap_codebook_size_eq_7_5_fb = -1;
5206 static int hf_he_phy_cap_triggered_su_beamforming_fb = -1;
5207 static int hf_he_phy_cap_triggered_mu_beamforming_fb = -1;
5208 static int hf_he_phy_cap_triggered_cqi_fb = -1;
5209 static int hf_he_phy_cap_partial_bw_extended_range = -1;
5210 static int hf_he_phy_cap_partial_bw_dl_mu_mimo = -1;
5211 static int hf_he_phy_cap_ppe_threshold_present = -1;
5212 static int hf_he_phy_b56_to_b71 = -1;
5213 static int hf_he_phy_cap_srp_based_sr_support = -1;
5214 static int hf_he_phy_cap_power_boost_factor_ar_support = -1;
5215 static int hf_he_phy_cap_he_su_ppdu_etc_gi = -1;
5216 static int hf_he_phy_cap_max_nc = -1;
5217 static int hf_he_phy_cap_stbc_tx_gt_80_mhz = -1;
5218 static int hf_he_phy_cap_stbc_rx_gt_80_mhz = -1;
5219 static int hf_he_phy_cap_he_er_su_ppdu_4xxx_gi = -1;
5220 static int hf_he_phy_cap_20mhz_in_40mhz_24ghz_band = -1;
5221 static int hf_he_phy_cap_20mhz_in_160_80p80_ppdu = -1;
5222 static int hf_he_phy_cap_80mgz_in_160_80p80_ppdu = -1;
5223 static int hf_he_phy_cap_he_er_su_ppdu_1xxx_gi = -1;
5224 static int hf_he_phy_cap_midamble_rx_2x_xxx_ltf = -1;
5225 static int hf_he_phy_cap_b70_b71_reserved = -1;
5226 static int hf_he_operation_parameter = -1;
5227 static int hf_he_operation_bss_color = -1;
5228 static int hf_he_operation_default_pe_duration = -1;
5229 static int hf_he_operation_twt_required = -1;
5230 static int hf_he_operation_txop_duration_rts_threshold = -1;
5231 static int hf_he_operation_partial_bss_color = -1;
5232 static int hf_he_operation_vht_operation_information_present = -1;
5233 static int hf_he_operation_reserved_b22_b27 = -1;
5234 static int hf_he_operation_multiple_bssid_ap = -1;
5235 static int hf_he_operation_txbssid_indicator = -1;
5236 static int hf_he_operation_bss_color_disabled = -1;
5237 static int hf_he_operation_reserved_b31 = -1;
5238 static int hf_he_operation_basic_mcs = -1;
5239 static int hf_he_oper_max_he_mcs_for_1_ss = -1;
5240 static int hf_he_oper_max_he_mcs_for_2_ss = -1;
5241 static int hf_he_oper_max_he_mcs_for_3_ss = -1;
5242 static int hf_he_oper_max_he_mcs_for_4_ss = -1;
5243 static int hf_he_oper_max_he_mcs_for_5_ss = -1;
5244 static int hf_he_oper_max_he_mcs_for_6_ss = -1;
5245 static int hf_he_oper_max_he_mcs_for_7_ss = -1;
5246 static int hf_he_oper_max_he_mcs_for_8_ss = -1;
5247 static int hf_he_operation_channel_width = -1;
5248 static int hf_he_operation_channel_center_freq_0 = -1;
5249 static int hf_he_operation_channel_center_freq_1 = -1;
5250 static int hf_he_operation_max_bssid_indicator = -1;
5251 static int hf_he_muac_aci_aifsn = -1;
5252 static int hf_he_mu_edca_timer = -1;
5253 static int hf_he_muac_ecwmin_ecwmax = -1;
5254 static int hf_he_srp_disallowed = -1;
5255 static int hf_he_non_srg_obss_pd_sr_disallowed = -1;
5256 static int hf_he_non_srg_offset_present = -1;
5257 static int hf_he_srg_information_present = -1;
5258 static int hf_he_hesiga_spatial_reuse_value15_allowed = -1;
5259 static int hf_he_sr_control_reserved = -1;
5260 static int hf_he_spatial_reuse_sr_control = -1;
5261 static int hf_he_spatial_non_srg_obss_pd_max_offset = -1;
5262 static int hf_he_spatial_srg_obss_pd_min_offset = -1;
5263 static int hf_he_spatial_srg_obss_pd_max_offset = -1;
5264 static int hf_he_spatial_srg_bss_color_bitmap = -1;
5265 static int hf_he_spatial_srg_partial_bssid_bitmap = -1;
5266 static int hf_he_ess_report_planned_ess = -1;
5267 static int hf_he_ess_report_edge_of_ess = -1;
5268 static int hf_he_resource_request_buffer_thresh = -1;
5269 static int hf_he_bss_color_change_new_color_info = -1;
5270 static int hf_he_new_bss_color_info_color = -1;
5271 static int hf_he_new_bss_color_info_reserved = -1;
5272 static int hf_he_bss_color_change_switch_countdown = -1;
5273 static int hf_he_ess_report_info_field = -1;
5274 static int hf_he_ess_report_recommend_transition_thresh = -1;
5275 static int hf_he_uora_field = -1;
5276 static int hf_he_uora_eocwmin = -1;
5277 static int hf_he_uora_owcwmax = -1;
5278 static int hf_he_uora_reserved = -1;
5279
5280 /* ************************************************************************* */
5281 /*                               Protocol trees                              */
5282 /* ************************************************************************* */
5283 static gint ett_80211 = -1;
5284 static gint ett_proto_flags = -1;
5285 static gint ett_cap_tree = -1;
5286 static gint ett_fc_tree = -1;
5287 static gint ett_cntrl_wrapper_fc = -1;
5288 static gint ett_cntrl_wrapper_payload = -1;
5289 static gint ett_fragments = -1;
5290 static gint ett_fragment = -1;
5291 static gint ett_block_ack = -1;
5292 static gint ett_block_ack_tid = -1;
5293 static gint ett_block_ack_request_control = -1;
5294 static gint ett_block_ack_bitmap = -1;
5295 static gint ett_ath_cap_tree = -1;
5296
5297 static gint ett_80211_mgt = -1;
5298 static gint ett_fixed_parameters = -1;
5299 static gint ett_tagged_parameters = -1;
5300 static gint ett_tag_bmapctl_tree = -1;
5301 static gint ett_tag_country_fnm_tree = -1;
5302 static gint ett_tag_country_rcc_tree = -1;
5303 static gint ett_qos_parameters = -1;
5304 static gint ett_qos_ps_buf_state = -1;
5305 static gint ett_wep_parameters = -1;
5306 static gint ett_msh_control = -1;
5307 static gint ett_hwmp_targ_flags_tree = -1;
5308 static gint ett_mesh_chswitch_flag_tree = -1;
5309 static gint ett_mesh_config_cap_tree = -1;
5310 static gint ett_mesh_formation_info_tree = -1;
5311
5312 static gint ett_rsn_gcs_tree = -1;
5313 static gint ett_rsn_pcs_tree = -1;
5314 static gint ett_rsn_sub_pcs_tree = -1;
5315 static gint ett_rsn_akms_tree = -1;
5316 static gint ett_rsn_sub_akms_tree = -1;
5317 static gint ett_rsn_cap_tree = -1;
5318 static gint ett_rsn_pmkid_tree = -1;
5319 static gint ett_rsn_gmcs_tree = -1;
5320
5321 static gint ett_wpa_mcs_tree = -1;
5322 static gint ett_wpa_ucs_tree = -1;
5323 static gint ett_wpa_sub_ucs_tree = -1;
5324 static gint ett_wpa_akms_tree = -1;
5325 static gint ett_wpa_sub_akms_tree = -1;
5326 static gint ett_wme_ac = -1;
5327 static gint ett_wme_aci_aifsn = -1;
5328 static gint ett_wme_ecw = -1;
5329 static gint ett_wme_qos_info = -1;
5330
5331 static gint ett_ht_cap_tree = -1;
5332 static gint ett_ampduparam_tree = -1;
5333 static gint ett_mcsset_tree = -1;
5334 static gint ett_mcsbit_tree = -1;
5335 static gint ett_htex_cap_tree = -1;
5336 static gint ett_txbf_tree = -1;
5337 static gint ett_antsel_tree = -1;
5338 static gint ett_hta_cap_tree = -1;
5339 static gint ett_hta_cap1_tree = -1;
5340 static gint ett_hta_cap2_tree = -1;
5341
5342 static gint ett_htc_tree = -1;
5343 static gint ett_htc_he_a_control = -1;
5344 static gint ett_mfb_subtree = -1;
5345 static gint ett_lac_subtree = -1;
5346
5347 static gint ett_vht_cap_tree = -1;
5348 static gint ett_vht_mcsset_tree = -1;
5349 static gint ett_vht_rx_mcsbit_tree = -1;
5350 static gint ett_vht_tx_mcsbit_tree = -1;
5351 static gint ett_vht_basic_mcsbit_tree = -1;
5352 static gint ett_vht_op_tree = -1;
5353 static gint ett_vht_tpe_info_tree = -1;
5354
5355 static gint ett_vht_ndp_annc = -1;
5356 static gint ett_vht_ndp_annc_sta_info_tree = -1;
5357
5358 static gint ett_he_mimo_control = -1;
5359
5360 static gint ett_ff_vhtmimo_cntrl = -1;
5361 static gint ett_ff_vhtmimo_beamforming_report = -1;
5362 static gint ett_ff_vhtmimo_beamforming_report_snr = -1;
5363 static gint ett_ff_vhtmimo_beamforming_angle = -1;
5364 static gint ett_ff_vhtmimo_beamforming_report_feedback_matrices = -1;
5365 static gint ett_ff_vhtmu_exclusive_beamforming_report_matrices = -1;
5366
5367 static gint ett_vht_grpidmgmt = -1;
5368 static gint ett_vht_msa = -1;
5369 static gint ett_vht_upa = -1;
5370
5371 static gint ett_ht_info_delimiter1_tree = -1;
5372 static gint ett_ht_info_delimiter2_tree = -1;
5373 static gint ett_ht_info_delimiter3_tree = -1;
5374
5375 static gint ett_tag_measure_request_mode_tree = -1;
5376 static gint ett_tag_measure_request_type_tree = -1;
5377 static gint ett_tag_measure_report_mode_tree = -1;
5378 static gint ett_tag_measure_report_type_tree = -1;
5379 static gint ett_tag_measure_report_basic_map_tree = -1;
5380 static gint ett_tag_measure_report_rpi_tree = -1;
5381 static gint ett_tag_measure_report_frame_tree = -1;
5382 static gint ett_tag_measure_reported_frame_tree = -1;
5383 static gint ett_tag_bss_bitmask_tree = -1;
5384 static gint ett_tag_dfs_map_tree = -1;
5385 static gint ett_tag_erp_info_tree = -1;
5386 static gint ett_tag_ex_cap1 = -1;
5387 static gint ett_tag_ex_cap2 = -1;
5388 static gint ett_tag_ex_cap3 = -1;
5389 static gint ett_tag_ex_cap4 = -1;
5390 static gint ett_tag_ex_cap5 = -1;
5391 static gint ett_tag_ex_cap6 = -1;
5392 static gint ett_tag_ex_cap7 = -1;
5393 static gint ett_tag_ex_cap8 = -1;
5394 static gint ett_tag_ex_cap89 = -1;
5395 static gint ett_tag_ex_cap10 = -1;
5396
5397 static gint ett_tag_rm_cap1 = -1;
5398 static gint ett_tag_rm_cap2 = -1;
5399 static gint ett_tag_rm_cap3 = -1;
5400 static gint ett_tag_rm_cap4 = -1;
5401 static gint ett_tag_rm_cap5 = -1;
5402
5403 static gint ett_tag_20_40_bc = -1;
5404
5405 static gint ett_tag_tclas_mask_tree = -1;
5406
5407 static gint ett_tag_supported_channels = -1;
5408
5409 static gint ett_tag_neighbor_report_bssid_info_tree = -1;
5410 static gint ett_tag_neighbor_report_bssid_info_capability_tree = -1;
5411 static gint ett_tag_neighbor_report_sub_tag_tree = -1;
5412
5413 static gint ett_tag_wapi_param_set_akm_tree = -1;
5414 static gint ett_tag_wapi_param_set_ucast_tree = -1;
5415 static gint ett_tag_wapi_param_set_mcast_tree = -1;
5416 static gint ett_tag_wapi_param_set_preauth_tree = -1;
5417
5418 static gint ett_tag_time_adv_tree = -1;
5419
5420 static gint ett_ff_ba_param_tree = -1;
5421 static gint ett_ff_ba_ssc_tree = -1;
5422 static gint ett_ff_delba_param_tree = -1;
5423 static gint ett_ff_qos_info = -1;
5424 static gint ett_ff_sm_pwr_save = -1;
5425 static gint ett_ff_psmp_param_set = -1;
5426 static gint ett_ff_mimo_cntrl = -1;
5427 static gint ett_ff_ant_sel = -1;
5428 static gint ett_mimo_report = -1;
5429 static gint ett_ff_chan_switch_announce = -1;
5430 static gint ett_ff_ht_info = -1;
5431 static gint ett_ff_psmp_sta_info = -1;
5432
5433 static gint ett_tpc = -1;
5434
5435 static gint ett_msdu_aggregation_parent_tree = -1;
5436 static gint ett_msdu_aggregation_subframe_tree = -1;
5437
5438 static gint ett_80211_mgt_ie = -1;
5439 static gint ett_tsinfo_tree = -1;
5440 static gint ett_sched_tree = -1;
5441
5442 static gint ett_fcs = -1;
5443
5444 static gint ett_adv_proto = -1;
5445 static gint ett_adv_proto_tuple = -1;
5446 static gint ett_gas_query = -1;
5447 static gint ett_gas_anqp = -1;
5448 static gint ett_nai_realm = -1;
5449 static gint ett_nai_realm_eap = -1;
5450 static gint ett_tag_ric_data_desc_ie = -1;
5451 static gint ett_anqp_vendor_capab = -1;
5452
5453 static gint ett_hs20_cc_proto_port_tuple = -1;
5454
5455 static gint ett_ssid_list = -1;
5456
5457 static gint ett_nintendo = -1;
5458
5459 static gint ett_mikrotik = -1;
5460
5461 static gint ett_meru = -1;
5462
5463 static gint ett_qos_map_set_exception = -1;
5464 static gint ett_qos_map_set_range = -1;
5465
5466 static expert_field ei_ieee80211_bad_length = EI_INIT;
5467 static expert_field ei_ieee80211_inv_val = EI_INIT;
5468 static expert_field ei_ieee80211_vht_tpe_pwr_info_count = EI_INIT;
5469 static expert_field ei_ieee80211_ff_query_response_length = EI_INIT;
5470 static expert_field ei_ieee80211_ff_anqp_nai_realm_eap_len = EI_INIT;
5471 static expert_field ei_hs20_anqp_nai_hrq_length = EI_INIT;
5472 static expert_field ei_ieee80211_extra_data = EI_INIT;
5473 static expert_field ei_ieee80211_tag_data = EI_INIT;
5474 static expert_field ei_ieee80211_tdls_setup_confirm_malformed = EI_INIT;
5475 static expert_field ei_ieee80211_ff_anqp_nai_field_len = EI_INIT;
5476 static expert_field ei_ieee80211_rsn_pcs_count = EI_INIT;
5477 static expert_field ei_ieee80211_tag_measure_request_unknown = EI_INIT;
5478 static expert_field ei_ieee80211_tag_measure_request_beacon_unknown = EI_INIT;
5479 static expert_field ei_ieee80211_tag_measure_report_unknown = EI_INIT;
5480 static expert_field ei_ieee80211_tag_number = EI_INIT;
5481 static expert_field ei_ieee80211_ff_anqp_info_length = EI_INIT;
5482 static expert_field ei_hs20_anqp_ofn_length = EI_INIT;
5483 static expert_field ei_ieee80211_tdls_setup_response_malformed = EI_INIT;
5484 static expert_field ei_ieee80211_ff_anqp_capability = EI_INIT;
5485 static expert_field ei_ieee80211_not_enough_room_for_anqp_header = EI_INIT;
5486 static expert_field ei_ieee80211_ff_query_request_length = EI_INIT;
5487 static expert_field ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype = EI_INIT;
5488 static expert_field ei_ieee80211_qos_info_bad_ftype = EI_INIT;
5489 static expert_field ei_ieee80211_qos_bad_aifsn = EI_INIT;
5490 static expert_field ei_ieee80211_pmkid_count_too_large = EI_INIT;
5491 static expert_field ei_ieee80211_ff_anqp_venue_length = EI_INIT;
5492 static expert_field ei_ieee80211_ff_anqp_roaming_consortium_oi_len = EI_INIT;
5493 static expert_field ei_ieee80211_tag_length = EI_INIT;
5494 static expert_field ei_ieee80211_missing_data = EI_INIT;
5495 static expert_field ei_ieee80211_rsn_pmkid_count = EI_INIT;
5496 static expert_field ei_ieee80211_fc_retry = EI_INIT;
5497 static expert_field ei_ieee80211_tag_wnm_sleep_mode_no_key_data = EI_INIT;
5498 static expert_field ei_ieee80211_dmg_subtype = EI_INIT;
5499 static expert_field ei_ieee80211_vht_action = EI_INIT;
5500 static expert_field ei_ieee80211_mesh_peering_unexpected = EI_INIT;
5501 static expert_field ei_ieee80211_fcs = EI_INIT;
5502 static expert_field ei_ieee80211_mismatched_akm_suite = EI_INIT;
5503
5504 /* 802.11ad trees */
5505 static gint ett_dynamic_alloc_tree = -1;
5506 static gint ett_ssw_tree = -1;
5507 static gint ett_bf_tree = -1;
5508 static gint ett_sswf_tree = -1;
5509 static gint ett_brp_tree = -1;
5510 static gint ett_blm_tree = -1;
5511 static gint ett_bic_tree = -1;
5512 static gint ett_dmg_params_tree = -1;
5513 static gint ett_cc_tree = -1;
5514 static gint ett_rcsi_tree = -1;
5515 static gint ett_80211_ext = -1;
5516 static gint ett_allocation_tree = -1;
5517 static gint ett_sta_info = -1;
5518
5519 static gint ett_ieee80211_esp = -1;
5520
5521 /* 802.11ax trees */
5522 static gint ett_he_mac_capabilities = -1;
5523 static gint ett_he_phy_capabilities = -1;
5524 static gint ett_he_phy_cap_first_byte = -1;
5525 static gint ett_he_phy_cap_chan_width_set = -1;
5526 static gint ett_he_phy_cap_b8_to_b23 = -1;
5527 static gint ett_he_phy_cap_b24_to_b39 = -1;
5528 static gint ett_he_phy_cap_b40_to_b55 = -1;
5529 static gint ett_he_phy_cap_b56_to_b71 = -1;
5530 static gint ett_he_mcs_and_nss_set = -1;
5531 static gint ett_he_rx_tx_he_mcs_map_lte_80 = -1;
5532 static gint ett_he_rx_mcs_map_lte_80 = -1;
5533 static gint ett_he_tx_mcs_map_lte_80 = -1;
5534 static gint ett_he_rx_tx_he_mcs_map_160 = -1;
5535 static gint ett_he_rx_mcs_map_160 = -1;
5536 static gint ett_he_tx_mcs_map_160 = -1;
5537 static gint ett_he_rx_tx_he_mcs_map_80_80 = -1;
5538 static gint ett_he_rx_mcs_map_80_80 = -1;
5539 static gint ett_he_tx_mcs_map_80_80 = -1;
5540 static gint ett_he_ppe_threshold = -1;
5541 static gint ett_he_ppe_nss = -1;
5542 static gint ett_he_ppe_ru_alloc = -1;
5543 static gint ett_he_uora_tree = -1;
5544 static gint ett_he_spatial_reuse_control = -1;
5545 static gint ett_he_bss_new_color_info = -1;
5546 static gint ett_he_ess_report_info_field = -1;
5547 static gint ett_he_operation_params = -1;
5548 static gint ett_he_oper_basic_mcs = -1;
5549 static gint ett_he_operation_vht_op_info = -1;
5550 static gint ett_he_mu_edca_param = -1;
5551 static gint ett_he_trigger_common_info = -1;
5552 static gint ett_he_trigger_base_common_info = -1;
5553 static gint ett_he_trigger_bar_ctrl = -1;
5554 static gint ett_he_trigger_bar_info = -1;
5555 static gint ett_he_trigger_user_info = -1;
5556 static gint ett_he_trigger_base_user_info = -1;
5557 static gint ett_he_trigger_dep_basic_user_info = -1;
5558 static gint ett_he_trigger_dep_nfrp_user_info = -1;
5559 static gint ett_he_ndp_annc = -1;
5560 static gint ett_he_ndp_annc_sta_list = -1;
5561 static gint ett_he_ndp_annc_sta_item = -1;
5562 static gint ett_he_ndp_annc_sta_info = -1;
5563
5564 static const fragment_items frag_items = {
5565   &ett_fragment,
5566   &ett_fragments,
5567   &hf_ieee80211_fragments,
5568   &hf_ieee80211_fragment,
5569   &hf_ieee80211_fragment_overlap,
5570   &hf_ieee80211_fragment_overlap_conflict,
5571   &hf_ieee80211_fragment_multiple_tails,
5572   &hf_ieee80211_fragment_too_long_fragment,
5573   &hf_ieee80211_fragment_error,
5574   &hf_ieee80211_fragment_count,
5575   &hf_ieee80211_reassembled_in,
5576   &hf_ieee80211_reassembled_length,
5577   /* Reassembled data field */
5578   NULL,
5579   "fragments"
5580 };
5581
5582 static const enum_val_t wlan_ignore_prot_options[] = {
5583   { "no",         "No",               WLAN_IGNORE_PROT_NO    },
5584   { "without_iv", "Yes - without IV", WLAN_IGNORE_PROT_WO_IV },
5585   { "with_iv",    "Yes - with IV",    WLAN_IGNORE_PROT_W_IV  },
5586   { NULL,         NULL,               0                     }
5587 };
5588
5589 static int wlan_address_type = -1;
5590 static int wlan_bssid_address_type = -1;
5591
5592 static const unsigned char bssid_broadcast_data[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
5593 static address bssid_broadcast;
5594 gboolean
5595 is_broadcast_bssid(const address *bssid) {
5596   return addresses_equal(&bssid_broadcast, bssid);
5597 }
5598
5599 static dissector_handle_t ieee80211_handle;
5600 static dissector_handle_t wlan_withoutfcs_handle;
5601 static dissector_handle_t llc_handle;
5602 static dissector_handle_t ipx_handle;
5603 static dissector_handle_t eth_withoutfcs_handle;
5604
5605 static capture_dissector_handle_t llc_cap_handle;
5606 static capture_dissector_handle_t ipx_cap_handle;
5607
5608 static dissector_table_t tagged_field_table;
5609 static dissector_table_t vendor_specific_action_table;
5610 static dissector_table_t wifi_alliance_action_subtype_table;
5611 static dissector_table_t vendor_specific_anqp_info_table;
5612 static dissector_table_t wifi_alliance_anqp_info_table;
5613 static dissector_table_t wifi_alliance_ie_table;
5614 static dissector_table_t wifi_alliance_public_action_table;
5615
5616 static int wlan_tap = -1;
5617
5618 static const value_string access_network_type_vals[] = {
5619   {  0, "Private network" },
5620   {  1, "Private network with guest access" },
5621   {  2, "Chargeable public network" },
5622   {  3, "Free public network" },
5623   {  4, "Personal device network" },
5624   {  5, "Emergency services only network" },
5625   { 14, "Test or experimental" },
5626   { 15, "Wildcard" },
5627   { 0, NULL }
5628 };
5629
5630 static const value_string adv_proto_id_vals[] = {
5631   {  0, "Access Network Query Protocol"},
5632   {  1, "MIH Information Service"},
5633   {  2, "MIH Command and Event Services Capability Discovery"},
5634   {  3, "Emergency Alert System (EAS)"},
5635   {  4, "Location-to-Service Translation Protocol"},
5636   {221, "Vendor Specific"},
5637   {0, NULL}
5638 };
5639
5640 static const value_string timeout_int_types[] = {
5641   {1, "Reassociation deadline interval (TUs)"},
5642   {2, "Key lifetime interval (seconds)"},
5643   {3, "Association Comeback time (TUs)"},
5644   {4, "Time to start (TUs)"},
5645   {0, NULL}
5646 };
5647
5648 static const value_string tdls_action_codes[] = {
5649   {TDLS_SETUP_REQUEST,           "TDLS Setup Request"},
5650   {TDLS_SETUP_RESPONSE,          "TDLS Setup Response"},
5651   {TDLS_SETUP_CONFIRM,           "TDLS Setup Confirm"},
5652   {TDLS_TEARDOWN,                "TDLS Teardown"},
5653   {TDLS_PEER_TRAFFIC_INDICATION, "TDLS Peer Traffic Indication"},
5654   {TDLS_CHANNEL_SWITCH_REQUEST,  "TDLS Channel Switch Request"},
5655   {TDLS_CHANNEL_SWITCH_RESPONSE, "TDLS Channel Switch Response"},
5656   {TDLS_PEER_PSM_REQUEST,        "TDLS Peer PSM Request"},
5657   {TDLS_PEER_PSM_RESPONSE,       "TDLS Peer PSM Response"},
5658   {TDLS_PEER_TRAFFIC_RESPONSE,   "TDLS Peer Traffic Response"},
5659   {TDLS_DISCOVERY_REQUEST,       "TDLS Discovery Request"},
5660   {0, NULL}
5661 };
5662 static value_string_ext tdls_action_codes_ext = VALUE_STRING_EXT_INIT(tdls_action_codes);
5663
5664 static const value_string rm_action_codes[] = {
5665   {RM_ACTION_RADIO_MEASUREMENT_REQUEST,   "Radio Measurement Request"},
5666   {RM_ACTION_RADIO_MEASUREMENT_REPORT,    "Radio Measurement Report"},
5667   {RM_ACTION_LINK_MEASUREMENT_REQUEST,    "Link Measurement Request"},
5668   {RM_ACTION_LINK_MEASUREMENT_REPORT,     "Link Measurement Report"},
5669   {RM_ACTION_NEIGHBOR_REPORT_REQUEST,     "Neighbor Report Request"},
5670   {RM_ACTION_NEIGHBOR_REPORT_RESPONSE,    "Neighbor Report Response"},
5671   {0, NULL}
5672 };
5673 static value_string_ext rm_action_codes_ext = VALUE_STRING_EXT_INIT(rm_action_codes);
5674
5675 static const val64_string number_of_taps_values[] = {
5676   {0x0, "1 tap"},
5677   {0x1, "5 taps"},
5678   {0x2, "15 taps"},
5679   {0x3, "63 taps"},
5680   {0, NULL}
5681 };
5682
5683 DOT11DECRYPT_CONTEXT dot11decrypt_ctx;
5684
5685 #define PSMP_STA_INFO_BROADCAST 0
5686 #define PSMP_STA_INFO_MULTICAST 1
5687 #define PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED 2
5688
5689 #define PSMP_STA_INFO_FLAG_TYPE         0x00000003
5690 #define PSMP_STA_INFO_FLAG_DTT_START    0x00001FFC
5691 #define PSMP_STA_INFO_FLAG_DTT_DURATION 0x001FE000
5692
5693 #define PSMP_STA_INFO_FLAG_STA_ID       0x001FFFE0
5694
5695 #define PSMP_STA_INFO_FLAG_UTT_START    0x0000FFE0
5696 #define PSMP_STA_INFO_FLAG_UTT_DURATION 0x03FF0000
5697
5698 #define PSMP_STA_INFO_FLAG_IA_RESERVED  0xFC000000
5699
5700 static const value_string ff_psmp_sta_info_flags[] = {
5701   { PSMP_STA_INFO_BROADCAST,              "Broadcast"},
5702   { PSMP_STA_INFO_MULTICAST,              "Multicast"},
5703   { PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED, "Individually Addressed"},
5704   {0, NULL}
5705 };
5706
5707 static const char*
5708 wlan_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter)
5709 {
5710     if ((filter == CONV_FT_SRC_ADDRESS) && (conv->src_address.type == wlan_address_type))
5711         return "wlan.sa";
5712
5713     if ((filter == CONV_FT_DST_ADDRESS) && (conv->dst_address.type == wlan_address_type))
5714         return "wlan.da";
5715
5716     if ((filter == CONV_FT_ANY_ADDRESS) && (conv->src_address.type == wlan_address_type))
5717         return "wlan.addr";
5718
5719     return CONV_FILTER_INVALID;
5720 }
5721
5722 static ct_dissector_info_t wlan_ct_dissector_info = {&wlan_conv_get_filter_type};
5723
5724 static int
5725 wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5726 {
5727   conv_hash_t *hash = (conv_hash_t*) pct;
5728   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5729
5730   add_conversation_table_data(hash, &whdr->src, &whdr->dst, 0, 0, 1, pinfo->fd->pkt_len, &pinfo->rel_ts, &pinfo->abs_ts, &wlan_ct_dissector_info, ENDPOINT_NONE);
5731
5732   return 1;
5733 }
5734
5735 static const char*
5736 wlan_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
5737 {
5738   if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == wlan_address_type))
5739     return "wlan.addr";
5740
5741   return CONV_FILTER_INVALID;
5742 }
5743
5744 static hostlist_dissector_info_t wlan_host_dissector_info = {&wlan_host_get_filter_type};
5745
5746 static int
5747 wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5748 {
5749   conv_hash_t *hash = (conv_hash_t*) pit;
5750   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5751
5752   /* Take two "add" passes per packet, adding for each direction, ensures that all
5753   packets are counted properly (even if address is sending to itself)
5754   XXX - this could probably be done more efficiently inside hostlist_table */
5755   add_hostlist_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
5756   add_hostlist_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
5757
5758   return 1;
5759 }
5760
5761 static const char*
5762 wlan_col_filter_str(const address* addr _U_, gboolean is_src)
5763 {
5764   if (is_src)
5765     return "wlan.sa";
5766
5767   return "wlan.da";
5768 }
5769
5770 static const char*
5771 wlan_bssid_col_filter_str(const address* addr _U_, gboolean is_src _U_)
5772 {
5773   return "wlan.bssid";
5774 }
5775
5776
5777 static void
5778 beacon_interval_base_custom(gchar *result, guint32 beacon_interval)
5779 {
5780   double temp_double;
5781
5782   temp_double = (double)beacon_interval;
5783   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double * 1024 / 1000000));
5784 }
5785
5786 static void
5787 allocation_duration_base_custom(gchar *result, guint32 allocation_duration)
5788 {
5789   double temp_double;
5790
5791   temp_double = (double)allocation_duration;
5792   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double / 1000000));
5793 }
5794
5795 static void
5796 extra_one_base_custom(gchar *result, guint32 value)
5797 {
5798   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1);
5799 }
5800
5801 static void
5802 extra_one_mul_two_base_custom(gchar *result, guint32 value)
5803 {
5804   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", (value+1)*2);
5805 }
5806
5807 /* ************************************************************************* */
5808 /* Mesh Control field helper functions
5809  *
5810  * Per IEEE 802.11s Draft 12.0 section 7.2.2.1:
5811  *
5812  * The frame body consists of either:
5813  * The MSDU (or a fragment thereof), the Mesh Control field (if and only if the
5814  * frame is transmitted by a mesh STA and the Mesh Control Present subfield of
5815  * the QoS Control field is 1)...
5816  *
5817  * 8.2.4.5.1 "QoS Control field structure", table 8-4, in 802.11-2012,
5818  * seems to indicate that the bit that means "Mesh Control Present" in
5819  * frames sent by mesh STAs in a mesh BSS is part of the TXOP Limit field,
5820  * the AP PS Buffer State field, the TXOP Duration Requested field, or the
5821  * Queue Size field in some data frames in non-mesh BSSes.
5822  *
5823  * We need a statefull sniffer for that.  For now, use heuristics.
5824  *
5825  * Notably, only mesh data frames contain the Mesh Control field in the header.
5826  * Other frames that contain mesh control (i.e., multihop action frames) have
5827  * it deeper in the frame body where it can be definitively identified.
5828  * Further, mesh data frames always have to-ds and from-ds either 11 or 01.  We
5829  * use these facts to make our heuristics more reliable.
5830  * ************************************************************************* */
5831 static int
5832 has_mesh_control(guint16 fcf, guint16 qos_ctl, guint8 mesh_flags)
5833 {
5834   /* assume mesh control present if the QOS field's Mesh Control Present bit is
5835    * set, all reserved bits in the mesh_flags field are zero, and the address
5836    * extension mode is not a reserved value.
5837    */
5838   return (((FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) || (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2)) &&
5839           (QOS_MESH_CONTROL_PRESENT(qos_ctl)) &&
5840           ((mesh_flags & ~MESH_FLAGS_ADDRESS_EXTENSION) == 0) &&
5841           ((mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION) != MESH_FLAGS_ADDRESS_EXTENSION));
5842 }
5843
5844 static int
5845 find_mesh_control_length(guint8 mesh_flags)
5846 {
5847   return 6 + 6*(mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION);
5848 }
5849
5850 static mimo_control_t
5851 get_mimo_control(tvbuff_t *tvb, int offset)
5852 {
5853   guint16        mimo;
5854   mimo_control_t output;
5855
5856   mimo = tvb_get_letohs(tvb, offset);
5857
5858   output.nc = (mimo & 0x0003) + 1;
5859   output.nr = ((mimo & 0x000C) >> 2) + 1;
5860   output.chan_width = (mimo & 0x0010) >> 4;
5861   output.coefficient_size = 4; /* XXX - Is this a good default? */
5862
5863   switch ((mimo & 0x0060) >> 5)
5864     {
5865       case 0:
5866         output.grouping = 1;
5867         break;
5868
5869       case 1:
5870         output.grouping = 2;
5871         break;
5872
5873       case 2:
5874         output.grouping = 4;
5875         break;
5876
5877       default:
5878         output.grouping = 1;
5879         break;
5880     }
5881
5882   switch ((mimo & 0x0180) >> 7)
5883     {
5884       case 0:
5885         output.coefficient_size = 4;
5886         break;
5887
5888       case 1:
5889         output.coefficient_size = 5;
5890         break;
5891
5892       case 2:
5893         output.coefficient_size = 6;
5894         break;
5895
5896       case 3:
5897         output.coefficient_size = 8;
5898         break;
5899     }
5900
5901   output.codebook_info = (mimo & 0x0600) >> 9;
5902   output.remaining_matrix_segment = (mimo & 0x3800) >> 11;
5903
5904   return output;
5905 }
5906
5907 static int
5908 get_mimo_na(guint8 nr, guint8 nc)
5909 {
5910   if ((nr == 2) && (nc == 1)) {
5911     return 2;
5912   } else if ((nr == 2) && (nc == 2)) {
5913     return 2;
5914   } else if ((nr == 3) && (nc == 1)) {
5915     return 4;
5916   } else if ((nr == 3) && (nc == 2)) {
5917     return 6;
5918   } else if ((nr == 3) && (nc == 3)) {
5919     return 6;
5920   } else if ((nr == 4) && (nc == 1)) {
5921     return 6;
5922   } else if ((nr == 4) && (nc == 2)) {
5923     return 10;
5924   } else if ((nr == 4) && (nc == 3)) {
5925     return 12;
5926   } else if ((nr == 4) && (nc == 4)) {
5927     return 12;
5928   } else{
5929     return 0;
5930   }
5931 }
5932
5933 static int
5934 get_mimo_ns(gboolean chan_width, guint8 output_grouping)
5935 {
5936   int ns = 0;
5937
5938   if (chan_width)
5939   {
5940     switch (output_grouping)
5941       {
5942         case 1:
5943           ns = 114;
5944           break;
5945
5946           case 2:
5947             ns = 58;
5948             break;
5949
5950           case 4:
5951             ns = 30;
5952             break;
5953
5954           default:
5955             ns = 0;
5956       }
5957   } else {
5958     switch (output_grouping)
5959       {
5960         case 1:
5961           ns = 56;
5962           break;
5963
5964         case 2:
5965           ns = 30;
5966           break;
5967
5968         case 4:
5969           ns = 16;
5970           break;
5971
5972         default:
5973           ns = 0;
5974       }
5975   }
5976
5977   return ns;
5978 }
5979
5980 static int
5981 add_mimo_csi_matrices_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
5982 {
5983   proto_tree *snr_tree;
5984   int         csi_matrix_size, start_offset;
5985   int         ns, i;
5986
5987   start_offset = offset;
5988   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
5989                         ett_mimo_report, NULL, "Signal to Noise Ratio");
5990
5991   for (i = 1; i <= mimo_cntrl.nr; i++)
5992   {
5993     guint8 snr;
5994
5995     snr = tvb_get_guint8(tvb, offset);
5996     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
5997                                snr, "Channel %d - Signal to Noise Ratio: 0x%02X", i, snr);
5998     offset += 1;
5999   }
6000
6001   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6002   csi_matrix_size = ns*(3+(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size));
6003   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6004   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6005   offset += csi_matrix_size;
6006   return offset - start_offset;
6007 }
6008
6009 static int
6010 add_mimo_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
6011 {
6012   proto_tree *snr_tree;
6013   int         csi_matrix_size, start_offset;
6014   int         ns, i;
6015
6016   start_offset = offset;
6017   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc, ett_mimo_report, NULL, "Signal to Noise Ratio");
6018
6019   for (i = 1; i <= mimo_cntrl.nc; i++)
6020   {
6021     guint8 snr;
6022
6023     snr = tvb_get_guint8(tvb, offset);
6024     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
6025                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
6026     offset += 1;
6027   }
6028
6029   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6030   csi_matrix_size = ns*(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size);
6031   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6032   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_bf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6033   offset += csi_matrix_size;
6034   return offset - start_offset;
6035 }
6036
6037 static int
6038 add_mimo_compressed_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
6039 {
6040   proto_tree *snr_tree;
6041   int         csi_matrix_size, start_offset;
6042   int         ns, na, i;
6043
6044   start_offset = offset;
6045   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
6046                         ett_mimo_report, NULL, "Signal to Noise Ratio");
6047
6048   for (i = 1; i <= mimo_cntrl.nc; i++)
6049   {
6050     gint8 snr;
6051     char edge_sign;
6052
6053     snr = (gint8) tvb_get_guint8(tvb, offset);
6054
6055     switch(snr) {
6056       case -128:
6057         edge_sign = '<';
6058         break;
6059       case 127:
6060         edge_sign = '>';
6061         break;
6062       default:
6063         edge_sign = ' ';
6064         break;
6065     }
6066     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
6067                                snr, "Stream %d - Signal to Noise Ratio: %c%3.2fdB", i, edge_sign,snr/4.0+22.0);
6068     offset += 1;
6069   }
6070
6071   na = get_mimo_na(mimo_cntrl.nr, mimo_cntrl.nc);
6072   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6073   csi_matrix_size = ns*(na*((mimo_cntrl.codebook_info+1)*2 + 2)/2);
6074   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6075   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_cbf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6076   offset += csi_matrix_size;
6077   return offset - start_offset;
6078 }
6079
6080 static void
6081 mesh_active_window_base_custom(gchar *result, guint32 mesh_active_window)
6082 {
6083   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (mesh_active_window * 1024.0 / 1000000));
6084 }
6085
6086 /* ************************************************************************* */
6087 /*          This is the capture function used to update packet counts        */
6088 /* ************************************************************************* */
6089 static gboolean
6090 capture_ieee80211_common(const guchar * pd, int offset, int len,
6091                           capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_, gboolean datapad)
6092 {
6093   guint16 fcf, hdr_length;
6094
6095   if (!BYTES_ARE_IN_FRAME(offset, len, 2))
6096     return FALSE;
6097
6098   fcf = pletoh16(&pd[offset]);
6099
6100   if (IS_PROTECTED(FCF_FLAGS(fcf)) && (wlan_ignore_prot == WLAN_IGNORE_PROT_NO))
6101     return FALSE;
6102
6103   switch (COMPOSE_FRAME_TYPE (fcf)) {
6104
6105     case DATA:
6106     case DATA_CF_ACK:
6107     case DATA_CF_POLL:
6108     case DATA_CF_ACK_POLL:
6109     case DATA_QOS_DATA:
6110     case DATA_QOS_DATA_CF_ACK:
6111     case DATA_QOS_DATA_CF_POLL:
6112     case DATA_QOS_DATA_CF_ACK_POLL:
6113     {
6114       /* These are data frames that actually contain *data*. */
6115       hdr_length = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
6116
6117       if (DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
6118         /* QoS frame, so the header includes a QoS field */
6119         guint16 qosoff;  /* Offset of the 2-byte QoS field */
6120         guint8 mesh_flags;
6121
6122         qosoff = hdr_length;
6123         hdr_length += 2; /* Include the QoS field in the header length */
6124
6125         if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
6126           /* Frame has a 4-byte HT Control field */
6127           hdr_length += 4;
6128         }
6129
6130         /*
6131          * Does it look as if we have a mesh header?
6132          * Look at the Mesh Control subfield of the QoS field and at the
6133          * purported mesh flag fields.
6134          */
6135         if (!BYTES_ARE_IN_FRAME(offset, hdr_length, 1))
6136           return FALSE;
6137
6138         mesh_flags = pd[hdr_length];
6139         if (has_mesh_control(fcf, pletoh16(&pd[qosoff]), mesh_flags)) {
6140           /* Yes, add the length of that in as well. */
6141           hdr_length += find_mesh_control_length(mesh_flags);
6142         }
6143
6144         if (datapad) {
6145           /*
6146            * Include the padding between the 802.11 header and the body,
6147            * as "helpfully" provided by some Atheros adapters.
6148            *
6149            * XXX - would the mesh header be part of the header or the body
6150            * from the point of view of the Atheros adapters that insert
6151            * the padding, assuming they even recognize a mesh header?
6152            */
6153           hdr_length = roundup2(hdr_length, 4);
6154         }
6155       }
6156       /* I guess some bridges take Netware Ethernet_802_3 frames,
6157          which are 802.3 frames (with a length field rather than
6158          a type field, but with no 802.2 header in the payload),
6159          and just stick the payload into an 802.11 frame.  I've seen
6160          captures that show frames of that sort.
6161
6162          We also handle some odd form of encapsulation in which a
6163          complete Ethernet frame is encapsulated within an 802.11
6164          data frame, with no 802.2 header.  This has been seen
6165          from some hardware.
6166
6167          On top of that, at least at some point it appeared that
6168          the OLPC XO sent out frames with two bytes of 0 between
6169          the "end" of the 802.11 header and the beginning of
6170          the payload.
6171
6172          So, if the packet doesn't start with 0xaa 0xaa:
6173
6174            we first use the same scheme that linux-wlan-ng does to detect
6175            those encapsulated Ethernet frames, namely looking to see whether
6176            the frame either starts with 6 octets that match the destination
6177            address from the 802.11 header or has 6 octets that match the
6178            source address from the 802.11 header following the first 6 octets,
6179            and, if so, treat it as an encapsulated Ethernet frame;
6180
6181            otherwise, we use the same scheme that we use in the Ethernet
6182            dissector to recognize Netware 802.3 frames, namely checking
6183            whether the packet starts with 0xff 0xff and, if so, treat it
6184            as an encapsulated IPX frame, and then check whether the
6185            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
6186            frame. */
6187       if (!BYTES_ARE_IN_FRAME(offset+hdr_length, len, 2))
6188         return FALSE;
6189
6190       if ((pd[offset+hdr_length] != 0xaa) && (pd[offset+hdr_length+1] != 0xaa)) {
6191 #if 0
6192         /* XXX - this requires us to parse the header to find the source
6193            and destination addresses. */
6194         if (BYTES_ARE_IN_FRAME(offset+hdr_length, len, 12)) {
6195           /* We have two MAC addresses after the header. */
6196           if ((memcmp(&pd[offset+hdr_length+6], pinfo->dl_src.data, 6) == 0) ||
6197               (memcmp(&pd[offset+hdr_length+6], pinfo->dl_dst.data, 6) == 0)) {
6198             return capture_eth (pd, offset + hdr_length, len, cpinfo, pseudo_header);
6199           }
6200         }
6201 #endif
6202         if ((pd[offset+hdr_length] == 0xff) && (pd[offset+hdr_length+1] == 0xff))
6203           return call_capture_dissector (ipx_cap_handle, pd, offset+hdr_length, len, cpinfo, pseudo_header);
6204         else if ((pd[offset+hdr_length] == 0x00) && (pd[offset+hdr_length+1] == 0x00))
6205           return call_capture_dissector (llc_cap_handle, pd, offset + hdr_length + 2, len, cpinfo, pseudo_header);
6206       }
6207       else {
6208         return call_capture_dissector (llc_cap_handle, pd, offset + hdr_length, len, cpinfo, pseudo_header);
6209       }
6210       break;
6211     }
6212   }
6213
6214   return FALSE;
6215 }
6216
6217 /*
6218  * Handle 802.11 with a variable-length link-layer header.
6219  */
6220 static gboolean
6221 capture_ieee80211(const guchar * pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
6222 {
6223   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, FALSE);
6224 }
6225
6226 /*
6227  * Handle 802.11 with a variable-length link-layer header and data padding.
6228  */
6229 static gboolean
6230 capture_ieee80211_datapad(const guchar * pd, int offset, int len,
6231                            capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
6232 {
6233   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, TRUE);
6234 }
6235
6236
6237 /* ************************************************************************* */
6238 /*          Add the subtree used to store the fixed parameters               */
6239 /* ************************************************************************* */
6240 static proto_tree *
6241 get_fixed_parameter_tree(proto_tree * tree, tvbuff_t *tvb, int start, int size)
6242 {
6243   proto_item *fixed_fields;
6244
6245   fixed_fields = proto_tree_add_item(tree, hf_ieee80211_fixed_parameters, tvb, start, size, ENC_NA);
6246   proto_item_append_text(fixed_fields, " (%d bytes)", size);
6247
6248   return proto_item_add_subtree(fixed_fields, ett_fixed_parameters);
6249 }
6250
6251
6252 /* ************************************************************************* */
6253 /*            Add the subtree used to store tagged parameters                */
6254 /* ************************************************************************* */
6255 static proto_tree *
6256 get_tagged_parameter_tree(proto_tree * tree, tvbuff_t *tvb, int start, int size)
6257 {
6258   proto_item *tagged_fields;
6259
6260   tagged_fields = proto_tree_add_item(tree, hf_ieee80211_tagged_parameters, tvb, start, -1, ENC_NA);
6261   proto_item_append_text(tagged_fields, " (%d bytes)", size);
6262
6263   return proto_item_add_subtree(tagged_fields, ett_tagged_parameters);
6264 }
6265
6266
6267 static int
6268 dissect_vendor_action_marvell(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
6269 {
6270   guint8 octet;
6271   int offset = 0;
6272
6273   octet = tvb_get_guint8(tvb, offset);
6274   proto_tree_add_item(tree, hf_ieee80211_ff_marvell_action_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6275   offset += 1;
6276   switch (octet)
6277     {
6278       case MRVL_ACTION_MESH_MANAGEMENT:
6279         octet = tvb_get_guint8(tvb, offset);
6280         proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6281         offset += 1;
6282         switch (octet)
6283           {
6284             case MRVL_MESH_MGMT_ACTION_RREQ:
6285               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6286               offset += 1;
6287               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6288               offset += 1;
6289               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6290               offset += 1;
6291               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6292               offset += 1;
6293               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_rreqid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6294               offset += 4;
6295               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
6296               offset += 6;
6297               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6298               offset += 4;
6299               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6300               offset += 4;
6301               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6302               offset += 4;
6303               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6304               offset += 1;
6305               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6306               offset += 1;
6307               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6308               offset += 6;
6309               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6310               offset += 4;
6311               break;
6312             case MRVL_MESH_MGMT_ACTION_RREP:
6313               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6314               offset += 1;
6315               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6316               offset += 1;
6317               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6318               offset += 1;
6319               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6320               offset += 1;
6321               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6322               offset += 6;
6323               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6324               offset += 4;
6325               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6326               offset += 4;
6327               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6328               offset += 4;
6329               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
6330               offset += 6;
6331               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6332               offset += 4;
6333               break;
6334             case MRVL_MESH_MGMT_ACTION_RERR:
6335               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6336               offset += 1;
6337               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6338               offset += 1;
6339               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6340               offset += 1;
6341               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6342               offset += 6;
6343               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6344               offset += 4;
6345               break;
6346             default:
6347               break;
6348           }
6349         break;
6350       default:
6351         break;
6352     }
6353
6354   return offset;
6355 }
6356
6357 static int
6358 dissect_vendor_action_wifi_alliance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
6359 {
6360   guint8 subtype;
6361   int offset = 0;
6362   int dissected;
6363   tvbuff_t *subtvb;
6364
6365   subtype = tvb_get_guint8(tvb, offset);
6366   proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
6367   offset += 1;
6368
6369   subtvb = tvb_new_subset_remaining(tvb, offset);
6370   dissected = dissector_try_uint_new(wifi_alliance_action_subtype_table, subtype, subtvb, pinfo, tree, FALSE, NULL);
6371   if (dissected <= 0)
6372   {
6373       call_data_dissector(subtvb, pinfo, tree);
6374       dissected = tvb_reported_length(subtvb);
6375   }
6376
6377   offset += dissected;
6378
6379   return offset;
6380 }
6381
6382 static guint
6383 dissect_advertisement_protocol_common(packet_info *pinfo, proto_tree *tree,
6384                                tvbuff_t *tvb, int offset, guint *type,
6385                                guint *subtype)
6386 {
6387   guint8      tag_no, tag_len, left;
6388   proto_item *item = NULL, *adv_item;
6389   proto_tree *adv_tree, *adv_tuple_tree;
6390
6391   if (type)
6392     *type = 0xff; // Last reserved value
6393   if (subtype)
6394     *subtype = 0xff;
6395   tag_no = tvb_get_guint8(tvb, offset);
6396   if (type)
6397     item = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6398
6399   tag_len = tvb_get_guint8(tvb, offset + 1);
6400   if (tag_no != TAG_ADVERTISEMENT_PROTOCOL) {
6401     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_number,
6402                            "Unexpected IE %d (expected Advertisement "
6403                            "Protocol)", tag_no);
6404     return 2 + tag_len;
6405   }
6406   if (type)
6407     item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
6408   if (tag_len < 2) {
6409     if (!type)
6410       item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
6411     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
6412                            "Advertisement Protocol: IE must be at least 2 "
6413                            "octets long");
6414     return 2 + tag_len;
6415   }
6416
6417   left = tag_len;
6418   offset += 2;
6419   adv_tree = proto_tree_add_subtree(tree, tvb, offset, left,
6420                                  ett_adv_proto, &adv_item, "Advertisement Protocol element");
6421
6422   while (left >= 2) {
6423     guint8 id;
6424
6425     id = tvb_get_guint8(tvb, offset + 1);
6426     if (id == 0)
6427       proto_item_append_text(adv_item, ": ANQP");
6428     adv_tuple_tree = proto_tree_add_subtree_format(adv_tree, tvb, offset, 2, ett_adv_proto_tuple, &item,
6429                                "Advertisement Protocol Tuple: %s",
6430                                val_to_str(id, adv_proto_id_vals,
6431                                           "Unknown (%d)"));
6432
6433     proto_tree_add_item(adv_tuple_tree,
6434                         hf_ieee80211_tag_adv_proto_resp_len_limit, tvb,
6435                         offset, 1, ENC_LITTLE_ENDIAN);
6436     proto_tree_add_item(adv_tuple_tree,
6437                         hf_ieee80211_tag_adv_proto_pame_bi, tvb,
6438                         offset, 1, ENC_LITTLE_ENDIAN);
6439     offset += 1;
6440     left--;
6441     proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_proto_id, tvb,
6442                         offset, 1, ENC_LITTLE_ENDIAN);
6443     offset += 1;
6444     left--;
6445
6446     if ((id == 0) && type)
6447       *type = ADV_PROTO_ID_ANQP;
6448
6449     if (id == 221) {
6450       /* Vendor specific */
6451       guint8 len = tvb_get_guint8(tvb, offset);
6452       guint oui;
6453       guint8 wfa_subtype;
6454       proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_vs_len, tvb, offset, 1, ENC_NA);
6455       offset += 1;
6456       left   -= 1;
6457       if (type)
6458         *type = ADV_PROTO_ID_VS;
6459       if (len > left) {
6460         expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
6461                                "Vendor specific info length error");
6462         return 2 + tag_len;
6463       }
6464       proto_tree_add_item_ret_uint(adv_tuple_tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
6465       offset += 3;
6466       left   -= 3;
6467       wfa_subtype = tvb_get_guint8(tvb, offset);
6468       proto_tree_add_item(adv_tuple_tree, hf_ieee80211_anqp_wfa_subtype, tvb,
6469                         offset, 1, ENC_NA);
6470       offset += 1;
6471       left   -= 1;
6472       if (oui == OUI_WFA) {
6473         proto_tree_add_item(adv_tuple_tree, hf_ieee80211_dpp_subtype, tvb, offset, 1, ENC_NA);
6474         if (wfa_subtype == WFA_SUBTYPE_DPP) {
6475           *subtype = WFA_SUBTYPE_DPP;
6476           *subtype |= (tvb_get_guint8(tvb, offset) << 8);
6477         }
6478         offset++;
6479         left--;
6480       }
6481     }
6482   }
6483
6484   if (left) {
6485     expert_add_info_format(pinfo, item, &ei_ieee80211_extra_data,
6486                            "Unexpected extra data in the end");
6487   }
6488
6489   return 2 + tag_len;
6490 }
6491
6492 static int
6493 dissect_advertisement_protocol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
6494 {
6495   return dissect_advertisement_protocol_common(pinfo, tree, tvb, 0, NULL, NULL);
6496 }
6497
6498 static void
6499 dissect_anqp_query_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6500 {
6501   while (offset + 2 <= end) {
6502     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_query_id,
6503                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6504     offset += 2;
6505   }
6506   if (offset != end) {
6507     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
6508                            "Unexpected ANQP Query list format");
6509   }
6510 }
6511
6512 static void
6513 dissect_hs20_anqp_hs_capability_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6514 {
6515   while (offset < end) {
6516     proto_tree_add_item(tree, hf_hs20_anqp_hs_capability_list,
6517                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6518     offset++;
6519   }
6520 }
6521
6522 static void
6523 dissect_anqp_capab_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6524 {
6525   guint16     id, len;
6526   proto_item *item;
6527   proto_tree *vtree;
6528   guint32     oui;
6529   guint8      subtype;
6530
6531   while (offset + 2 <= end) {
6532     id = tvb_get_letohs(tvb, offset);
6533     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_capability,
6534                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6535     offset += 2;
6536     if (id == ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
6537       vtree = proto_item_add_subtree(item, ett_anqp_vendor_capab);
6538       len = tvb_get_letohs(tvb, offset);
6539       proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vlen,
6540                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
6541       offset += 2;
6542       if ((len < 3) || ((offset + len) > end)) {
6543         expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_capability);
6544         return;
6545       }
6546       proto_tree_add_item_ret_uint(vtree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
6547       offset += 3;
6548       len    -= 3;
6549
6550       switch (oui) {
6551       case OUI_WFA:
6552         if (len == 0)
6553           break;
6554         subtype = tvb_get_guint8(tvb, offset);
6555         proto_item_append_text(vtree, " - WFA - %s",
6556                                val_to_str(subtype, wfa_subtype_vals,
6557                                           "Unknown (%u)"));
6558         proto_tree_add_item(vtree, hf_ieee80211_anqp_wfa_subtype,
6559                             tvb, offset, 1, ENC_NA);
6560         offset++;
6561         len--;
6562         switch (subtype) {
6563         case WFA_SUBTYPE_HS20_ANQP:
6564           dissect_hs20_anqp_hs_capability_list(vtree, tvb, offset, end);
6565           break;
6566         default:
6567           proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
6568                               tvb, offset, len, ENC_NA);
6569           break;
6570         }
6571         break;
6572       default:
6573         proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
6574                             tvb, offset, len, ENC_NA);
6575         break;
6576       }
6577
6578       offset += len;
6579     }
6580   }
6581   if (offset != end) {
6582     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
6583                            "Unexpected ANQP Capability list format");
6584   }
6585 }
6586
6587 static const value_string venue_group_vals[] = {
6588   {  0, "Unspecified" },
6589   {  1, "Assembly" },
6590   {  2, "Business" },
6591   {  3, "Educational" },
6592   {  4, "Factory and Industrial" },
6593   {  5, "Institutional" },
6594   {  6, "Mercantile" },
6595   {  7, "Residential" },
6596   {  8, "Storage" },
6597   {  9, "Utility and Miscellaneous" },
6598   { 10, "Vehicular" },
6599   { 11, "Outdoor" },
6600   { 0, NULL }
6601 };
6602 static value_string_ext venue_group_vals_ext = VALUE_STRING_EXT_INIT(venue_group_vals);
6603
6604 static void
6605 dissect_venue_info(proto_tree *tree, tvbuff_t *tvb, int offset)
6606 {
6607   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_group,
6608                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6609   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_type,
6610                       tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
6611 }
6612
6613 static void
6614 dissect_venue_name_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6615 {
6616   proto_item *item;
6617
6618   dissect_venue_info(tree, tvb, offset);
6619   offset += 2;
6620   while (offset + 4 <= end) {
6621     guint8 vlen = tvb_get_guint8(tvb, offset);
6622     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_length,
6623                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6624     offset += 1;
6625     if ((vlen > (end - offset)) || (vlen < 3)) {
6626       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_venue_length);
6627       break;
6628     }
6629     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_language,
6630                         tvb, offset, 3, ENC_ASCII|ENC_NA);
6631     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_name,
6632                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
6633     offset += vlen;
6634   }
6635 }
6636
6637 static const value_string nw_auth_type_vals[] = {
6638   { 0, "Acceptance of terms and conditions" },
6639   { 1, "On-line enrollment supported" },
6640   { 2, "http/https redirection" },
6641   { 3, "DNS redirection" },
6642   { 0, NULL }
6643 };
6644
6645 static void
6646 dissect_network_auth_type(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6647 {
6648   while (offset + 3 <= end) {
6649     guint16 len;
6650     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_indicator,
6651                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6652     offset += 1;
6653     len = tvb_get_letohs(tvb, offset);
6654     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url_len,
6655                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6656     offset += 2;
6657     if (len)
6658       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url,
6659                           tvb, offset, len, ENC_ASCII|ENC_NA);
6660     offset += len;
6661   }
6662 }
6663
6664 static void
6665 add_manuf(proto_item *item, tvbuff_t *tvb, int offset)
6666 {
6667   const gchar *manuf_name;
6668
6669   manuf_name = tvb_get_manuf_name_if_known(tvb, offset);
6670   if (manuf_name == NULL)
6671     return;
6672   proto_item_append_text(item, " - %s", manuf_name);
6673 }
6674
6675 static void
6676 dissect_roaming_consortium_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6677                                 int end)
6678 {
6679   proto_item *item;
6680   guint8      len;
6681
6682   while (offset < end) {
6683     len = tvb_get_guint8(tvb, offset);
6684     item = proto_tree_add_item(tree,
6685                                hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
6686                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6687     offset += 1;
6688     if ((len > (end - offset)) || (len < 3)) {
6689       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_roaming_consortium_oi_len);
6690       break;
6691     }
6692     item = proto_tree_add_item(tree,
6693                                hf_ieee80211_ff_anqp_roaming_consortium_oi,
6694                                tvb, offset, len, ENC_NA);
6695     add_manuf(item, tvb, offset);
6696     offset += len;
6697   }
6698 }
6699
6700 static const value_string ip_addr_avail_ipv6_vals[] = {
6701   { 0, "Address type not available" },
6702   { 1, "Address type available" },
6703   { 2, "Availability of the address type not known" },
6704   { 0, NULL }
6705 };
6706
6707 static const value_string ip_addr_avail_ipv4_vals[] = {
6708   { 0, "Address type not available" },
6709   { 1, "Public IPv4 address available" },
6710   { 2, "Port-restricted IPv4 address available" },
6711   { 3, "Single NATed private IPv4 address available" },
6712   { 4, "Double NATed private IPv4 address available" },
6713   { 5, "Port-restricted IPv4 address and single NATed IPv4 address available" },
6714   { 6, "Port-restricted IPv4 address and double NATed IPv4 address available" },
6715   { 7, "Availability of the address type is not known" },
6716   { 0, NULL }
6717 };
6718
6719 static void
6720 dissect_ip_addr_type_availability_info(proto_tree *tree, tvbuff_t *tvb,
6721                                        int offset)
6722 {
6723   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
6724                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6725   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
6726                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6727 }
6728
6729 static const value_string nai_realm_encoding_vals[] = {
6730   { 0, "Formatted in accordance with RFC 4282" },
6731   { 1, "UTF-8 formatted that is not formatted in accordance with RFC 4282" },
6732   { 0, NULL }
6733 };
6734
6735 static const value_string nai_realm_auth_param_id_vals[] = {
6736   {   1, "Expanded EAP Method" },
6737   {   2, "Non-EAP Inner Authentication Type" },
6738   {   3, "Inner Authentication EAP Method Type" },
6739   {   4, "Expanded Inner EAP Method" },
6740   {   5, "Credential Type" },
6741   {   6, "Tunneled EAP Method Credential Type" },
6742   { 221, "Vendor Specific" },
6743   { 0, NULL }
6744 };
6745
6746 static void
6747 dissect_nai_realm_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6748 {
6749   guint16       count, len;
6750   proto_item   *item, *r_item;
6751   int           f_end, eap_end;
6752   guint8        nai_len, eap_count, eap_len, auth_param_count, auth_param_len;
6753   guint8        auth_param_id;
6754   proto_tree   *realm_tree, *eap_tree;
6755   const guint8 *realm;
6756
6757   count = tvb_get_letohs(tvb, offset);
6758   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nai_realm_count,
6759                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6760   offset += 2;
6761   while (count > 0) {
6762     len = tvb_get_letohs(tvb, offset);
6763     realm_tree = proto_tree_add_subtree(tree, tvb, offset, 2 + len, ett_nai_realm, &r_item, "NAI Realm Data");
6764
6765     item = proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_field_len,
6766                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6767     offset += 2;
6768     if (offset + len > end) {
6769       expert_add_info_format(pinfo, item, &ei_ieee80211_ff_anqp_nai_field_len,
6770                              "Invalid NAI Realm List");
6771       break;
6772     }
6773     f_end = offset + len;
6774     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_encoding,
6775                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6776     offset += 1;
6777     nai_len = tvb_get_guint8(tvb, offset);
6778     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_length,
6779                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6780     offset += 1;
6781     if (offset + nai_len > f_end) {
6782       expert_add_info_format(pinfo, r_item, &ei_ieee80211_ff_anqp_nai_field_len,
6783                              "Invalid NAI Realm Data");
6784       break;
6785     }
6786     proto_tree_add_item_ret_string(realm_tree, hf_ieee80211_ff_anqp_nai_realm,
6787                         tvb, offset, nai_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &realm);
6788     if (realm) {
6789       proto_item_append_text(r_item, " (%s)", realm);
6790     }
6791     offset += nai_len;
6792     eap_count = tvb_get_guint8(tvb, offset);
6793     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_eap_count,
6794                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6795     offset += 1;
6796
6797     while (eap_count > 0) {
6798       eap_len = tvb_get_guint8(tvb, offset);
6799       eap_end = offset + 1 + eap_len;
6800       eap_tree = proto_tree_add_subtree(realm_tree, tvb, offset, 1 + eap_len,
6801                                  ett_nai_realm_eap, NULL, "EAP Method");
6802
6803       item = proto_tree_add_item(eap_tree,
6804                                  hf_ieee80211_ff_anqp_nai_realm_eap_len,
6805                                  tvb, offset, 1, ENC_LITTLE_ENDIAN);
6806       offset += 1;
6807       if (offset + eap_len > f_end) {
6808         expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_nai_realm_eap_len);
6809         break;
6810       }
6811
6812       proto_item_append_text(eap_tree, ": %s",
6813                              val_to_str_ext(tvb_get_guint8(tvb, offset),
6814                                             &eap_type_vals_ext, "Unknown (%d)"));
6815       proto_tree_add_item(eap_tree, hf_ieee80211_ff_anqp_nai_realm_eap_method,
6816                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
6817       offset += 1;
6818       auth_param_count = tvb_get_guint8(tvb, offset);
6819       proto_tree_add_item(eap_tree,
6820                           hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
6821                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
6822       offset += 1;
6823
6824       while (auth_param_count > 0) {
6825         auth_param_id = tvb_get_guint8(tvb, offset);
6826         proto_tree_add_item(eap_tree,
6827                             hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
6828                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
6829         offset += 1;
6830         auth_param_len = tvb_get_guint8(tvb, offset);
6831         proto_tree_add_item(eap_tree,
6832                             hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
6833                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
6834         offset += 1;
6835         item = proto_tree_add_item(
6836           eap_tree, hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
6837           tvb, offset, auth_param_len, ENC_NA);
6838         if ((auth_param_id == 3) && (auth_param_len == 1)) {
6839           guint8 inner_method = tvb_get_guint8(tvb, offset);
6840           const char *str;
6841           str = val_to_str_ext(inner_method, &eap_type_vals_ext, "Unknown (%d)");
6842
6843           proto_item_append_text(eap_tree, " / %s", str);
6844           proto_item_append_text(item, " - %s", str);
6845         }
6846         offset += auth_param_len;
6847
6848         auth_param_count--;
6849       }
6850
6851       offset = eap_end;
6852       eap_count--;
6853     }
6854
6855     offset = f_end;
6856     count--;
6857   }
6858 }
6859
6860 static void
6861 dissect_3gpp_cellular_network_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6862 {
6863   guint8      iei, num;
6864   proto_item *item;
6865
6866   /* See Annex A of 3GPP TS 24.234 v8.1.0 for description */
6867   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_gud, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6868   offset += 1;
6869   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_udhl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6870   offset += 1;
6871   iei = tvb_get_guint8(tvb, offset);
6872   item = proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_iei, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6873   if (iei == 0)
6874     proto_item_append_text(item, " (PLMN List)");
6875   else
6876     return;
6877   offset += 1;
6878   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_plmn_len, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6879   offset += 1;
6880   num = tvb_get_guint8(tvb, offset);
6881   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_num_plmns, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6882   offset += 1;
6883   while (num > 0) {
6884     if (tvb_reported_length_remaining(tvb, offset) < 3)
6885       break;
6886     dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, offset, E212_NONE, TRUE);
6887     num--;
6888     offset += 3;
6889   }
6890 }
6891
6892 static void
6893 dissect_domain_name_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6894 {
6895   guint8 len;
6896
6897   while (offset < end) {
6898     len = tvb_get_guint8(tvb, offset);
6899     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name_len,
6900                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6901     offset += 1;
6902     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name,
6903                         tvb, offset, len, ENC_ASCII|ENC_NA);
6904     offset += len;
6905   }
6906 }
6907
6908 static void
6909 dissect_venue_url_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6910 {
6911   guint8 len;
6912
6913   while (offset < end) {
6914     len = tvb_get_guint8(tvb, offset);
6915     proto_item *pi = NULL;
6916     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_url_len,
6917                         tvb, offset, 1, ENC_NA);
6918     offset += 1;
6919     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_url_number,
6920                         tvb, offset, 1, ENC_NA);
6921     offset += 1;
6922     pi = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_url,
6923                         tvb, offset, len - 1, ENC_ASCII|ENC_NA);
6924     PROTO_ITEM_SET_URL(pi);
6925     offset += len - 1;
6926   }
6927 }
6928
6929 #define HS20_ANQP_HS_QUERY_LIST 1
6930 #define HS20_ANQP_HS_CAPABILITY_LIST 2
6931 #define HS20_ANQP_OPERATOR_FRIENDLY_NAME 3
6932 #define HS20_ANQP_WAN_METRICS 4
6933 #define HS20_ANQP_CONNECTION_CAPABILITY 5
6934 #define HS20_ANQP_NAI_HOME_REALM_QUERY 6
6935 #define HS20_ANQP_OPERATING_CLASS_INDICATION 7
6936
6937 static const value_string hs20_anqp_subtype_vals[] = {
6938   { HS20_ANQP_HS_QUERY_LIST, "HS Query list" },
6939   { HS20_ANQP_HS_CAPABILITY_LIST, "HS Capability List" },
6940   { HS20_ANQP_OPERATOR_FRIENDLY_NAME, "Operator Friendly Name" },
6941   { HS20_ANQP_WAN_METRICS, "WAN Metrics" },
6942   { HS20_ANQP_CONNECTION_CAPABILITY, "Connection Capability" },
6943   { HS20_ANQP_NAI_HOME_REALM_QUERY, "NAI Home Realm Query" },
6944   { HS20_ANQP_OPERATING_CLASS_INDICATION, "Operating Class Indication" },
6945   { 0, NULL }
6946 };
6947
6948 static void
6949 dissect_hs20_anqp_hs_query_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6950 {
6951   while (offset < end) {
6952     proto_tree_add_item(tree, hf_hs20_anqp_hs_query_list,
6953                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6954     offset++;
6955   }
6956 }
6957
6958 static void
6959 dissect_hs20_anqp_operator_friendly_name(proto_tree *tree, tvbuff_t *tvb,
6960                                          packet_info *pinfo, int offset, int end)
6961 {
6962   while (offset + 4 <= end) {
6963     guint8 vlen = tvb_get_guint8(tvb, offset);
6964     proto_item *item = proto_tree_add_item(tree, hf_hs20_anqp_ofn_length,
6965                                            tvb, offset, 1, ENC_LITTLE_ENDIAN);
6966     offset++;
6967     if (vlen > end - offset || vlen < 3) {
6968       expert_add_info(pinfo, item, &ei_hs20_anqp_ofn_length);
6969       break;
6970     }
6971     proto_tree_add_item(tree, hf_hs20_anqp_ofn_language,
6972                         tvb, offset, 3, ENC_ASCII|ENC_NA);
6973     proto_tree_add_item(tree, hf_hs20_anqp_ofn_name,
6974                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
6975     offset += vlen;
6976   }
6977 }
6978
6979 static const value_string hs20_wm_link_status_vals[] = {
6980   { 0, "Reserved" },
6981   { 1, "Link up" },
6982   { 2, "Link down" },
6983   { 3, "Link in test state" },
6984   { 0, NULL }
6985 };
6986
6987 static void
6988 dissect_hs20_anqp_wan_metrics(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean request)
6989 {
6990   if (request)
6991     return;
6992
6993   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_link_status,
6994                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6995   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_symmetric_link,
6996                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6997   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_at_capacity,
6998                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6999   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_reserved,
7000                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7001   offset++;
7002
7003   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_speed,
7004                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
7005   offset += 4;
7006
7007   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_speed,
7008                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
7009   offset += 4;
7010
7011   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_load,
7012                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7013   offset++;
7014
7015   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_load,
7016                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7017   offset++;
7018
7019   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_lmd,
7020                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7021 }
7022
7023 static const value_string hs20_cc_status_vals[] = {
7024   { 0, "Closed" },
7025   { 1, "Open" },
7026   { 2, "Unknown" },
7027   { 0, NULL }
7028 };
7029
7030 static void
7031 dissect_hs20_anqp_connection_capability(proto_tree *tree, tvbuff_t *tvb,
7032                                         int offset, int end)
7033 {
7034   proto_tree *tuple;
7035   while (offset + 4 <= end) {
7036     guint8 ip_proto, status;
7037     guint16 port_num;
7038
7039     ip_proto = tvb_get_guint8(tvb, offset);
7040     port_num = tvb_get_letohs(tvb, offset + 1);
7041     status = tvb_get_guint8(tvb, offset + 3);
7042
7043     tuple = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_hs20_cc_proto_port_tuple, NULL,
7044                                "ProtoPort Tuple - ip_proto=%u port_num=%u status=%s",
7045                                ip_proto, port_num,
7046                                val_to_str(status, hs20_cc_status_vals,
7047                                           "Unknown (%u)"));
7048     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_ip_proto,
7049                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7050     offset++;
7051     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_port_num,
7052                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
7053     offset += 2;
7054     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_status,
7055                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7056     offset++;
7057   }
7058 }
7059
7060 static void
7061 dissect_hs20_anqp_nai_home_realm_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
7062                                        int offset, int end)
7063 {
7064   guint8 len;
7065   proto_item *item;
7066
7067   proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_count,
7068                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7069   offset++;
7070
7071   while (offset + 2 <= end) {
7072     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_encoding_type,
7073                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7074     offset++;
7075     len = tvb_get_guint8(tvb, offset);
7076     item = proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_length,
7077                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
7078     offset++;
7079     if (offset + len > end) {
7080       expert_add_info(pinfo, item, &ei_hs20_anqp_nai_hrq_length);
7081       break;
7082     }
7083     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_realm_name,
7084                         tvb, offset, len, ENC_ASCII|ENC_NA);
7085     offset += len;
7086   }
7087 }
7088
7089 static void
7090 dissect_hs20_anqp_oper_class_indic(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7091 {
7092   while (offset < end) {
7093     proto_tree_add_item(tree, hf_hs20_anqp_oper_class_indic,
7094                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7095     offset++;
7096   }
7097 }
7098
7099 static int
7100 dissect_hs20_anqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
7101 {
7102   guint8 subtype;
7103   int end = tvb_reported_length(tvb);
7104   int offset = 0;
7105   anqp_info_dissector_data_t* anqp_data = (anqp_info_dissector_data_t*)data;
7106
7107   DISSECTOR_ASSERT(anqp_data);
7108
7109   subtype = tvb_get_guint8(tvb, offset);
7110   proto_item_append_text(tree, " - HS 2.0 %s",
7111                          val_to_str(subtype, hs20_anqp_subtype_vals,
7112                                     "Unknown (%u)"));
7113   if (anqp_data->idx == 0) {
7114     col_append_fstr(pinfo->cinfo, COL_INFO, " HS 2.0 %s",
7115                     val_to_str(subtype, hs20_anqp_subtype_vals,
7116                                "Unknown (%u)"));
7117   } else if (anqp_data->idx == 1) {
7118     col_append_str(pinfo->cinfo, COL_INFO, ", ..");
7119   }
7120   proto_tree_add_item(tree, hf_hs20_anqp_subtype, tvb, offset, 1,
7121                       ENC_LITTLE_ENDIAN);
7122   offset++;
7123
7124   proto_tree_add_item(tree, hf_hs20_anqp_reserved, tvb, offset, 1,
7125                       ENC_LITTLE_ENDIAN);
7126   offset++;
7127
7128   switch (subtype) {
7129   case HS20_ANQP_HS_QUERY_LIST:
7130     dissect_hs20_anqp_hs_query_list(tree, tvb, offset, end);
7131     break;
7132   case HS20_ANQP_HS_CAPABILITY_LIST:
7133     dissect_hs20_anqp_hs_capability_list(tree, tvb, offset, end);
7134     break;
7135   case HS20_ANQP_OPERATOR_FRIENDLY_NAME:
7136     dissect_hs20_anqp_operator_friendly_name(tree, tvb, pinfo, offset, end);
7137     break;
7138   case HS20_ANQP_WAN_METRICS:
7139     dissect_hs20_anqp_wan_metrics(tree, tvb, offset, anqp_data->request);
7140     break;
7141   case HS20_ANQP_CONNECTION_CAPABILITY:
7142     dissect_hs20_anqp_connection_capability(tree, tvb, offset, end);
7143     break;
7144   case HS20_ANQP_NAI_HOME_REALM_QUERY:
7145     dissect_hs20_anqp_nai_home_realm_query(tree, tvb, pinfo, offset, end);
7146     break;
7147   case HS20_ANQP_OPERATING_CLASS_INDICATION:
7148     dissect_hs20_anqp_oper_class_indic(tree, tvb, offset, end);
7149     break;
7150   default:
7151     if (offset == end)
7152       break;
7153     proto_tree_add_item(tree, hf_hs20_anqp_payload, tvb, offset,
7154                         end - offset, ENC_NA);
7155     break;
7156   }
7157
7158   return tvb_captured_length(tvb);
7159 }
7160
7161 static int
7162 dissect_vendor_wifi_alliance_anqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
7163 {
7164   guint8 subtype;
7165   int offset = 0;
7166   tvbuff_t *subtvb;
7167
7168   subtype = tvb_get_guint8(tvb, offset);
7169   proto_tree_add_item(tree, hf_ieee80211_anqp_wfa_subtype, tvb, offset, 1, ENC_NA);
7170   offset += 1;
7171
7172   subtvb = tvb_new_subset_remaining(tvb, offset);
7173   if (!dissector_try_uint_new(wifi_alliance_anqp_info_table, subtype, subtvb, pinfo, tree, FALSE, data))
7174       call_data_dissector(subtvb, pinfo, tree);
7175
7176   return tvb_captured_length(tvb);
7177 }
7178
7179
7180 static int
7181 dissect_neighbor_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
7182
7183 static int
7184 dissect_anqp_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
7185                   gboolean request, int idx)
7186 {
7187   guint16     id, len;
7188   guint32     oui;
7189   proto_item *item, *item_len;
7190   tvbuff_t *vendor_tvb;
7191   anqp_info_dissector_data_t anqp_info;
7192
7193   item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_id,
7194                              tvb, offset, 2, ENC_LITTLE_ENDIAN);
7195   id = tvb_get_letohs(tvb, offset);
7196   if (id != ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
7197     if (idx == 0) {
7198       proto_item_append_text(tree, " - %s",
7199                              val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
7200       col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
7201                       val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
7202     } else if (idx == 1) {
7203       proto_item_append_text(tree, ", ..");
7204       col_append_str(pinfo->cinfo, COL_INFO, ", ..");
7205     }
7206   }
7207   tree = proto_item_add_subtree(item, ett_gas_anqp);
7208   offset += 2;
7209   item_len = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_length,
7210                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7211   len = tvb_get_letohs(tvb, offset);
7212   offset += 2;
7213   if (tvb_reported_length_remaining(tvb, offset) < len) {
7214     expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_info_length);
7215     return 4 + len;
7216   }
7217   switch (id)
7218   {
7219   case ANQP_INFO_ANQP_QUERY_LIST:
7220     dissect_anqp_query_list(tree, tvb, pinfo, offset, offset + len);
7221     break;
7222   case ANQP_INFO_ANQP_CAPAB_LIST:
7223     dissect_anqp_capab_list(tree, tvb, pinfo, offset, offset + len);
7224     break;
7225   case ANQP_INFO_VENUE_NAME_INFO:
7226     dissect_venue_name_info(tree, tvb, pinfo, offset, offset + len);
7227     break;
7228   case ANQP_INFO_NETWORK_AUTH_TYPE_INFO:
7229     dissect_network_auth_type(tree, tvb, offset, offset + len);
7230     break;
7231   case ANQP_INFO_ROAMING_CONSORTIUM_LIST:
7232     dissect_roaming_consortium_list(tree, tvb, pinfo, offset, offset + len);
7233     break;
7234   case ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO:
7235     dissect_ip_addr_type_availability_info(tree, tvb, offset);
7236     break;
7237   case ANQP_INFO_NAI_REALM_LIST:
7238     dissect_nai_realm_list(tree, tvb, pinfo, offset, offset + len);
7239     break;
7240   case ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO:
7241     dissect_3gpp_cellular_network_info(tree, tvb, pinfo, offset);
7242     break;
7243   case ANQP_INFO_DOMAIN_NAME_LIST:
7244     dissect_domain_name_list(tree, tvb, offset, offset + len);
7245     break;
7246   case ANQP_INFO_VENUE_URL:
7247     dissect_venue_url_list(tree, tvb, offset, offset + len);
7248     break;
7249   case ANQP_INFO_NEIGHBOR_REPORT:
7250     {
7251       tvbuff_t *report_tvb;
7252       ieee80211_tagged_field_data_t field_data;
7253
7254       report_tvb = tvb_new_subset_length(tvb, offset, len);
7255       field_data.item_tag = item;
7256       field_data.item_tag_length = item_len;
7257       dissect_neighbor_report(report_tvb, pinfo, tree, &field_data);
7258     }
7259     break;
7260   case ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST:
7261     proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
7262     offset += 3;
7263     vendor_tvb = tvb_new_subset_length(tvb, offset, len);
7264
7265     anqp_info.request = request;
7266     anqp_info.idx = idx;
7267     if (!dissector_try_uint_new(vendor_specific_anqp_info_table, oui, vendor_tvb, pinfo, tree, FALSE, &anqp_info))
7268     {
7269       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info, tvb, offset, len, ENC_NA);
7270     }
7271     break;
7272   default:
7273     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
7274                         tvb, offset, len, ENC_NA);
7275     break;
7276   }
7277
7278   return 4 + len;
7279 }
7280
7281 static void
7282 dissect_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, gboolean request)
7283 {
7284   int idx = 0;
7285
7286   proto_item_append_text(tree, ": ANQP ");
7287   proto_item_append_text(tree, request ? "Request" : "Response");
7288   if (tvb_reported_length_remaining(tvb, offset) < 4) {
7289     expert_add_info_format(pinfo, tree, &ei_ieee80211_not_enough_room_for_anqp_header,
7290                            "Not enough room for ANQP header");
7291     return;
7292   }
7293   col_append_fstr(pinfo->cinfo, COL_INFO, ", ANQP %s",
7294                   request ? "Req" : "Resp");
7295   while (tvb_reported_length_remaining(tvb, offset) > 0) {
7296     offset += dissect_anqp_info(tree, tvb, pinfo, offset, request, idx);
7297     idx += 1;
7298   }
7299 }
7300
7301 static guint
7302 dissect_gas_initial_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
7303                             guint type, guint subtype)
7304 {
7305   guint16     req_len;
7306   int         start = offset;
7307   proto_item *item;
7308   proto_tree *query;
7309
7310   /* Query Request Length (2 octets) */
7311   req_len = tvb_get_letohs(tvb, offset);
7312
7313   query = proto_tree_add_subtree(tree, tvb, offset, 2 + req_len, ett_gas_query, &item, "Query Request");
7314   if (tvb_reported_length_remaining(tvb, offset) < 2 + req_len) {
7315     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_request_length);
7316     return tvb_reported_length_remaining(tvb, offset);
7317   }
7318
7319   proto_tree_add_item(query, hf_ieee80211_ff_query_request_length,
7320                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7321   offset += 2;
7322   /*
7323    * Query Request (GAS query; formatted per protocol specified in the
7324    * Advertisement Protocol IE)
7325    */
7326   switch (type) {
7327   case ADV_PROTO_ID_ANQP:
7328     dissect_anqp(query, tvb, pinfo, offset, TRUE);
7329     break;
7330   case ADV_PROTO_ID_VS:
7331     if (subtype == ((DPP_CONFIGURATION_PROTOCOL << 8) | WFA_SUBTYPE_DPP)) {
7332        col_append_fstr(pinfo->cinfo, COL_INFO, ", DPP - %s",
7333                        val_to_str(subtype >> 8, dpp_subtype_vals, "Unknown (%u)"));
7334       dissect_wifi_dpp_config_proto(pinfo, query, tvb, offset);
7335     }
7336     break;
7337   default:
7338     proto_tree_add_item(query, hf_ieee80211_ff_query_request,
7339                         tvb, offset, req_len, ENC_NA);
7340   }
7341   offset += req_len;
7342
7343   return offset - start;
7344 }
7345
7346 static guint
7347 dissect_gas_initial_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
7348                              guint type, guint subtype)
7349 {
7350   guint16     resp_len;
7351   int         start = offset;
7352   proto_item *item;
7353   proto_tree *query;
7354
7355   /* Query Response Length (2 octets) */
7356   resp_len = tvb_get_letohs(tvb, offset);
7357
7358   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
7359                              ett_gas_query, &item, "Query Response");
7360   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
7361     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
7362     return tvb_reported_length_remaining(tvb, offset);
7363   }
7364
7365   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
7366                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7367   offset += 2;
7368   /* Query Response (optional) */
7369   if (resp_len) {
7370     switch (type) {
7371     case ADV_PROTO_ID_ANQP:
7372       dissect_anqp(query, tvb, pinfo, offset, FALSE);
7373       break;
7374     case ADV_PROTO_ID_VS:
7375       if (subtype == ((DPP_CONFIGURATION_PROTOCOL << 8) | WFA_SUBTYPE_DPP)) {
7376          col_append_fstr(pinfo->cinfo, COL_INFO, ", DPP - %s",
7377                          val_to_str(subtype >> 8, dpp_subtype_vals, "Unknown (%u)"));
7378         dissect_wifi_dpp_config_proto(pinfo, query, tvb, offset);
7379       }
7380       break;
7381     default:
7382       proto_tree_add_item(query, hf_ieee80211_ff_query_response,
7383                           tvb, offset, resp_len, ENC_NA);
7384     }
7385     offset += resp_len;
7386   }
7387
7388   return offset - start;
7389 }
7390
7391 static reassembly_table gas_reassembly_table;
7392
7393 static gint ett_gas_resp_fragment = -1;
7394 static gint ett_gas_resp_fragments = -1;
7395
7396 static int hf_ieee80211_gas_resp_fragments = -1;
7397 static int hf_ieee80211_gas_resp_fragment = -1;
7398 static int hf_ieee80211_gas_resp_fragment_overlap = -1;
7399 static int hf_ieee80211_gas_resp_fragment_overlap_conflict = -1;
7400 static int hf_ieee80211_gas_resp_fragment_multiple_tails = -1;
7401 static int hf_ieee80211_gas_resp_fragment_too_long_fragment = -1;
7402 static int hf_ieee80211_gas_resp_fragment_error = -1;
7403 static int hf_ieee80211_gas_resp_fragment_count = -1;
7404 static int hf_ieee80211_gas_resp_reassembled_in = -1;
7405 static int hf_ieee80211_gas_resp_reassembled_length = -1;
7406
7407 static const fragment_items gas_resp_frag_items = {
7408   &ett_gas_resp_fragment,
7409   &ett_gas_resp_fragments,
7410   &hf_ieee80211_gas_resp_fragments,
7411   &hf_ieee80211_gas_resp_fragment,
7412   &hf_ieee80211_gas_resp_fragment_overlap,
7413   &hf_ieee80211_gas_resp_fragment_overlap_conflict,
7414   &hf_ieee80211_gas_resp_fragment_multiple_tails,
7415   &hf_ieee80211_gas_resp_fragment_too_long_fragment,
7416   &hf_ieee80211_gas_resp_fragment_error,
7417   &hf_ieee80211_gas_resp_fragment_count,
7418   &hf_ieee80211_gas_resp_reassembled_in,
7419   &hf_ieee80211_gas_resp_reassembled_length,
7420   /* Reassembled data field */
7421   NULL,
7422   "GAS Response fragments"
7423 };
7424
7425 static guint
7426 dissect_gas_comeback_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
7427                               guint type, guint subtype _U_, guint8 frag, gboolean more,
7428                               guint8 dialog_token)
7429 {
7430   guint16     resp_len;
7431   int         start = offset;
7432   proto_item *item;
7433   proto_tree *query;
7434
7435   /* Query Response Length (2 octets) */
7436   resp_len = tvb_get_letohs(tvb, offset);
7437
7438   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
7439                              ett_gas_query, &item, "Query Response");
7440   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
7441     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
7442     return tvb_reported_length_remaining(tvb, offset);
7443   }
7444
7445   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
7446                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7447   offset += 2;
7448   /* Query Response (optional) */
7449   if (resp_len) {
7450     if (type == ADV_PROTO_ID_ANQP && (frag == 0) && !more)
7451       dissect_anqp(query, tvb, pinfo, offset, FALSE);
7452     else {
7453       fragment_head *frag_msg;
7454       gboolean save_fragmented;
7455       tvbuff_t *new_tvb;
7456
7457       save_fragmented = pinfo->fragmented;
7458       pinfo->fragmented = TRUE;
7459       frag_msg = fragment_add_seq_check(&gas_reassembly_table, tvb, offset,
7460                                         pinfo, dialog_token, NULL,
7461                                         frag, resp_len, more);
7462       new_tvb = process_reassembled_data(tvb, offset, pinfo,
7463                                          "Reassembled GAS Query Response",
7464                                          frag_msg, &gas_resp_frag_items,
7465                                          NULL, tree);
7466       if (new_tvb) {
7467         if (type == ADV_PROTO_ID_ANQP)
7468           dissect_anqp(query, new_tvb, pinfo, 0, FALSE);
7469         else
7470           proto_tree_add_item(query, hf_ieee80211_ff_query_response,
7471                               new_tvb, 0,
7472                               tvb_reported_length_remaining(new_tvb, 0),
7473                               ENC_NA);
7474       }
7475
7476       /* The old tvb cannot be used anymore */
7477       ieee80211_tvb_invalid = TRUE;
7478
7479       pinfo->fragmented = save_fragmented;
7480     }
7481     offset += resp_len;
7482   }
7483
7484   return offset - start;
7485 }
7486
7487 /* ************************************************************************* */
7488 /*              Dissect and add fixed mgmt fields to protocol tree           */
7489 /* ************************************************************************* */
7490
7491 static guint64 last_timestamp;
7492
7493 static guint
7494 add_ff_timestamp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7495 {
7496   last_timestamp = tvb_get_letoh64(tvb, offset);
7497   proto_tree_add_item(tree, hf_ieee80211_ff_timestamp, tvb, offset, 8,
7498                       ENC_LITTLE_ENDIAN);
7499   return 8;
7500 }
7501
7502 static guint
7503 add_ff_beacon_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7504 {
7505   proto_tree_add_item(tree, hf_ieee80211_ff_beacon_interval, tvb, offset, 2,
7506                       ENC_LITTLE_ENDIAN);
7507   col_append_fstr(pinfo->cinfo, COL_INFO, ", BI=%d",
7508                   tvb_get_letohs(tvb, offset));
7509   return 2;
7510 }
7511
7512 static guint
7513 add_ff_cap_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7514 {
7515   static const int *ieee80211_ap_fields[] = {
7516     &hf_ieee80211_ff_cf_ess,
7517     &hf_ieee80211_ff_cf_ibss,
7518     &hf_ieee80211_ff_cf_ap_poll,
7519     &hf_ieee80211_ff_cf_privacy,
7520     &hf_ieee80211_ff_cf_preamble,
7521     &hf_ieee80211_ff_cf_pbcc,
7522     &hf_ieee80211_ff_cf_agility,
7523     &hf_ieee80211_ff_cf_spec_man,
7524     &hf_ieee80211_ff_short_slot_time,
7525     &hf_ieee80211_ff_cf_apsd,
7526     &hf_ieee80211_ff_radio_measurement,
7527     &hf_ieee80211_ff_dsss_ofdm,
7528     &hf_ieee80211_ff_cf_del_blk_ack,
7529     &hf_ieee80211_ff_cf_imm_blk_ack,
7530     NULL
7531   };
7532
7533   static const int *ieee80211_sta_fields[] = {
7534     &hf_ieee80211_ff_cf_ess,
7535     &hf_ieee80211_ff_cf_ibss,
7536     &hf_ieee80211_ff_cf_sta_poll,
7537     &hf_ieee80211_ff_cf_privacy,
7538     &hf_ieee80211_ff_cf_preamble,
7539     &hf_ieee80211_ff_cf_pbcc,
7540     &hf_ieee80211_ff_cf_agility,
7541     &hf_ieee80211_ff_cf_spec_man,
7542     &hf_ieee80211_ff_short_slot_time,
7543     &hf_ieee80211_ff_cf_apsd,
7544     &hf_ieee80211_ff_radio_measurement,
7545     &hf_ieee80211_ff_dsss_ofdm,
7546     &hf_ieee80211_ff_cf_del_blk_ack,
7547     &hf_ieee80211_ff_cf_imm_blk_ack,
7548     NULL
7549   };
7550
7551   if ((tvb_get_letohs(tvb, offset) & 0x0001) != 0) {
7552     /* This is an AP */
7553     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_capture,
7554                                     ett_cap_tree, ieee80211_ap_fields,
7555                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
7556     p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_AP_KEY, GINT_TO_POINTER(TRUE));
7557   } else {
7558     /* This is a STA */
7559     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_capture,
7560                                     ett_cap_tree, ieee80211_sta_fields,
7561                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
7562   }
7563
7564   return 2;
7565 }
7566
7567 static guint
7568 add_ff_auth_alg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7569 {
7570   proto_tree_add_item(tree, hf_ieee80211_ff_auth_alg, tvb, offset, 2,
7571                       ENC_LITTLE_ENDIAN);
7572   return 2;
7573 }
7574
7575 static guint
7576 add_ff_auth_trans_seq(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7577 {
7578   proto_tree_add_item(tree, hf_ieee80211_ff_auth_seq, tvb, offset, 2,
7579                       ENC_LITTLE_ENDIAN);
7580   return 2;
7581 }
7582
7583 static guint
7584 add_ff_current_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7585 {
7586   proto_tree_add_item(tree, hf_ieee80211_ff_current_ap, tvb, offset, 6,
7587                       ENC_NA);
7588   return 6;
7589 }
7590
7591 static guint
7592 add_ff_listen_ival(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7593 {
7594   proto_tree_add_item(tree, hf_ieee80211_ff_listen_ival, tvb, offset, 2,
7595                       ENC_LITTLE_ENDIAN);
7596   return 2;
7597 }
7598
7599 static guint
7600 add_ff_reason_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7601 {
7602   proto_tree_add_item(tree, hf_ieee80211_ff_reason, tvb, offset, 2,
7603                       ENC_LITTLE_ENDIAN);
7604   return 2;
7605 }
7606
7607 static guint
7608 add_ff_assoc_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7609 {
7610   proto_tree_add_item(tree, hf_ieee80211_ff_assoc_id, tvb, offset, 2,
7611                       ENC_LITTLE_ENDIAN);
7612   return 2;
7613 }
7614
7615 static guint
7616 add_ff_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7617 {
7618   proto_tree_add_item(tree, hf_ieee80211_ff_status_code, tvb, offset, 2,
7619                       ENC_LITTLE_ENDIAN);
7620   return 2;
7621 }
7622
7623 static guint
7624 add_ff_category_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7625 {
7626   proto_tree_add_item(tree, hf_ieee80211_ff_category_code, tvb, offset, 1,
7627                       ENC_LITTLE_ENDIAN);
7628   return 1;
7629 }
7630
7631 static guint
7632 add_ff_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7633 {
7634   proto_tree_add_item(tree, hf_ieee80211_ff_action_code, tvb, offset, 1,
7635                       ENC_LITTLE_ENDIAN);
7636   return 1;
7637 }
7638
7639 static guint
7640 add_ff_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7641 {
7642   proto_tree_add_item(tree, hf_ieee80211_ff_dialog_token, tvb, offset, 1,
7643                       ENC_LITTLE_ENDIAN);
7644   return 1;
7645 }
7646
7647 static guint
7648 add_ff_followup_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7649 {
7650   proto_tree_add_item(tree, hf_ieee80211_ff_followup_dialog_token, tvb, offset, 1,
7651                       ENC_LITTLE_ENDIAN);
7652   return 1;
7653 }
7654
7655 static guint
7656 add_ff_wme_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7657 {
7658   proto_tree_add_item(tree, hf_ieee80211_ff_wme_action_code, tvb, offset, 1,
7659                       ENC_LITTLE_ENDIAN);
7660   return 1;
7661 }
7662
7663 static guint
7664 add_ff_wme_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7665 {
7666   proto_tree_add_item(tree, hf_ieee80211_ff_wme_status_code, tvb, offset, 1,
7667                       ENC_LITTLE_ENDIAN);
7668   return 1;
7669 }
7670
7671 static guint
7672 add_ff_qos_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7673 {
7674   proto_tree_add_item(tree, hf_ieee80211_ff_qos_action_code, tvb, offset, 1,
7675                       ENC_LITTLE_ENDIAN);
7676   return 1;
7677 }
7678
7679 static guint
7680 add_ff_block_ack_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7681 {
7682   proto_tree_add_item(tree, hf_ieee80211_ff_ba_action, tvb, offset, 1,
7683                       ENC_LITTLE_ENDIAN);
7684   return 1;
7685 }
7686
7687 static guint
7688 add_ff_block_ack_param(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7689 {
7690   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_params,
7691                          ett_ff_ba_param_tree,
7692                          ieee80211_ff_block_ack_params_fields,
7693                          ENC_LITTLE_ENDIAN);
7694   return 2;
7695 }
7696
7697 static guint
7698 add_ff_block_ack_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7699 {
7700   proto_tree_add_item(tree, hf_ieee80211_ff_block_ack_timeout, tvb, offset, 2,
7701                       ENC_LITTLE_ENDIAN);
7702   return 2;
7703 }
7704
7705 static guint
7706 add_ff_block_ack_ssc(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7707 {
7708   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_ssc,
7709                          ett_ff_ba_ssc_tree, ieee80211_ff_block_ack_ssc_fields,
7710                          ENC_LITTLE_ENDIAN);
7711   return 2;
7712 }
7713
7714 static guint
7715 add_ff_qos_ts_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7716 {
7717   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_tsinfo,
7718                          ett_tsinfo_tree, ieee80211_tsinfo_fields,
7719                          ENC_LITTLE_ENDIAN);
7720   return 3;
7721 }
7722
7723 static guint
7724 add_ff_mesh_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7725 {
7726   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_action, tvb, offset, 1,
7727                       ENC_LITTLE_ENDIAN);
7728   return 1;
7729 }
7730
7731 static guint
7732 add_ff_multihop_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7733 {
7734   proto_tree_add_item(tree, hf_ieee80211_ff_multihop_action, tvb, offset, 1,
7735                       ENC_LITTLE_ENDIAN);
7736   return 1;
7737 }
7738
7739 static guint
7740 add_ff_mesh_control(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7741 {
7742   int    start = offset;
7743   guint8 flags;
7744
7745   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_flags, tvb, offset, 1,
7746                       ENC_LITTLE_ENDIAN);
7747   flags = tvb_get_guint8(tvb, offset);
7748   offset += 1;
7749   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_ttl, tvb, offset, 1,
7750                       ENC_LITTLE_ENDIAN);
7751   offset += 1;
7752   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_sequence, tvb, offset, 4,
7753                       ENC_LITTLE_ENDIAN);
7754   offset += 4;
7755
7756   switch (flags & 0x03) {
7757   case 1:
7758     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr4, tvb, offset, 6,
7759                         ENC_NA);
7760     offset += 6;
7761     break;
7762   case 2:
7763     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr5, tvb, offset, 6,
7764                         ENC_NA);
7765     offset += 6;
7766     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr6, tvb, offset, 6,
7767                         ENC_NA);
7768     offset += 6;
7769     break;
7770   case 3:
7771     proto_item_append_text(tree, " Unknown Address Extension Mode");
7772     break;
7773   default:
7774     /* no default action */
7775     break;
7776   }
7777
7778   return offset - start;
7779 }
7780
7781 static guint
7782 add_ff_selfprot_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7783 {
7784   proto_tree_add_item(tree, hf_ieee80211_ff_selfprot_action, tvb, offset, 1,
7785                       ENC_LITTLE_ENDIAN);
7786   return 1;
7787 }
7788
7789 static guint
7790 add_ff_dls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7791 {
7792   proto_tree_add_item(tree, hf_ieee80211_ff_dls_action_code, tvb, offset, 1,
7793                       ENC_LITTLE_ENDIAN);
7794   return 1;
7795 }
7796
7797 static guint
7798 add_ff_dst_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7799 {
7800   proto_tree_add_item(tree, hf_ieee80211_ff_dst_mac_addr, tvb, offset, 6,
7801                       ENC_NA);
7802   return 6;
7803 }
7804
7805 static guint
7806 add_ff_src_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7807 {
7808   proto_tree_add_item(tree, hf_ieee80211_ff_src_mac_addr, tvb, offset, 6,
7809                       ENC_NA);
7810   return 6;
7811 }
7812
7813 static guint
7814 add_ff_req_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7815 {
7816   proto_tree_add_item(tree, hf_ieee80211_ff_req_ap_addr, tvb, offset, 6,
7817                       ENC_NA);
7818   return 6;
7819 }
7820
7821 static guint
7822 add_ff_res_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7823 {
7824   proto_tree_add_item(tree, hf_ieee80211_ff_res_ap_addr, tvb, offset, 6,
7825                       ENC_NA);
7826   return 6;
7827 }
7828
7829 static guint
7830 add_ff_check_beacon(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7831 {
7832   proto_tree_add_item(tree, hf_ieee80211_ff_check_beacon, tvb, offset, 1,
7833                       ENC_NA);
7834   return 1;
7835 }
7836
7837 static guint
7838 add_ff_tod(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7839 {
7840   proto_tree_add_item(tree, hf_ieee80211_ff_tod, tvb, offset, 4,
7841                      ENC_NA);
7842   return 4;
7843 }
7844
7845 static guint
7846 add_ff_toa(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7847 {
7848   proto_tree_add_item(tree, hf_ieee80211_ff_toa, tvb, offset, 4,
7849                       ENC_NA);
7850   return 4;
7851 }
7852
7853 static guint
7854 add_ff_max_tod_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7855 {
7856   proto_tree_add_item(tree, hf_ieee80211_ff_max_tod_err, tvb, offset, 1,
7857                       ENC_NA);
7858   return 1;
7859 }
7860
7861 static guint
7862 add_ff_max_toa_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7863 {
7864   proto_tree_add_item(tree, hf_ieee80211_ff_max_toa_err, tvb, offset, 1,
7865                       ENC_NA);
7866   return 1;
7867 }
7868
7869 static guint
7870 add_ff_dls_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7871 {
7872   proto_tree_add_item(tree, hf_ieee80211_ff_dls_timeout, tvb, offset, 2,
7873                       ENC_LITTLE_ENDIAN);
7874   return 2;
7875 }
7876
7877 static guint
7878 add_ff_delba_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7879 {
7880   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_delba_param,
7881                          ett_ff_ba_param_tree, ieee80211_ff_delba_param_fields,
7882                          ENC_LITTLE_ENDIAN);
7883   return 2;
7884 }
7885
7886 static guint
7887 add_ff_max_reg_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7888 {
7889   proto_tree_add_item(tree, hf_ieee80211_ff_max_reg_pwr, tvb, offset, 2,
7890                       ENC_LITTLE_ENDIAN);
7891   return 2;
7892 }
7893
7894 static guint
7895 add_ff_measurement_pilot_int(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7896 {
7897   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
7898                       1, ENC_NA);
7899   return 1;
7900 }
7901
7902 static guint
7903 add_ff_country_str(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7904 {
7905   proto_tree_add_item(tree, hf_ieee80211_ff_country_str, tvb, offset, 3,
7906                       ENC_ASCII|ENC_NA);
7907   return 3;
7908 }
7909
7910 static guint
7911 add_ff_max_tx_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7912 {
7913   proto_tree_add_item(tree, hf_ieee80211_ff_max_tx_pwr, tvb, offset, 1,
7914                       ENC_LITTLE_ENDIAN);
7915   return 1;
7916 }
7917
7918 static guint
7919 add_ff_tx_pwr_used(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7920 {
7921   proto_tree_add_item(tree, hf_ieee80211_ff_tx_pwr_used, tvb, offset, 1,
7922                       ENC_LITTLE_ENDIAN);
7923   return 1;
7924 }
7925
7926 static guint
7927 add_ff_transceiver_noise_floor(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7928 {
7929   proto_tree_add_item(tree, hf_ieee80211_ff_transceiver_noise_floor, tvb,
7930                       offset, 1, ENC_LITTLE_ENDIAN);
7931   return 1;
7932 }
7933
7934 static guint
7935 add_ff_channel_width(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7936 {
7937   proto_tree_add_item(tree, hf_ieee80211_ff_channel_width, tvb, offset, 1,
7938                       ENC_LITTLE_ENDIAN);
7939   return 1;
7940 }
7941
7942 /* QoS Info:  802.11-2012 8.4.1.17 */
7943 static guint
7944 add_ff_qos_info_ap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7945 {
7946   /* From AP so decode as AP: Figure 8-51-QoS Info field when sent by a AP */
7947   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
7948                                     ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
7949                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
7950   return 1;
7951 }
7952
7953
7954 /* QoS Info:  802.11-2012 8.4.1.17 */
7955 static guint
7956 add_ff_qos_info_sta(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7957 {
7958   /* To AP so decode as STA: Figure 8-52-QoS Info field when set by a non-AP STA */
7959   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_sta,
7960                                     ett_ff_qos_info, ieee80211_ff_qos_info_sta_fields,
7961                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
7962   return 1;
7963 }
7964
7965 static guint
7966 add_ff_sm_pwr_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7967 {
7968   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_sm_pwr_save,
7969                          ett_ff_sm_pwr_save, ieee80211_ff_sw_pwr_save_fields,
7970                          ENC_LITTLE_ENDIAN);
7971   return 1;
7972 }
7973
7974 static guint
7975 add_ff_pco_phase_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7976 {
7977   proto_tree_add_item(tree, hf_ieee80211_ff_pco_phase_cntrl, tvb, offset, 1,
7978                       ENC_LITTLE_ENDIAN);
7979   return 1;
7980 }
7981
7982 static guint
7983 add_ff_psmp_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7984 {
7985   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_psmp_param_set,
7986                          ett_ff_psmp_param_set,
7987                          ieee80211_ff_psmp_param_set_fields,
7988                          ENC_LITTLE_ENDIAN);
7989   return 2;
7990 }
7991
7992 static guint
7993 add_ff_mimo_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7994 {
7995   proto_item *mimo_item;
7996   proto_tree *mimo_tree;
7997   static const int *ieee80211_mimo_fields[] = {
7998     &hf_ieee80211_ff_mimo_cntrl_nc_index,
7999     &hf_ieee80211_ff_mimo_cntrl_nr_index,
8000     &hf_ieee80211_ff_mimo_cntrl_channel_width,
8001     &hf_ieee80211_ff_mimo_cntrl_grouping,
8002     &hf_ieee80211_ff_mimo_cntrl_coefficient_size,
8003     &hf_ieee80211_ff_mimo_cntrl_codebook_info,
8004     &hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
8005     &hf_ieee80211_ff_mimo_cntrl_reserved,
8006     NULL
8007   };
8008
8009   mimo_item = proto_tree_add_item(tree, hf_ieee80211_ff_mimo_cntrl, tvb,
8010                                   offset, 6, ENC_NA);
8011   mimo_tree = proto_item_add_subtree(mimo_item, ett_ff_mimo_cntrl);
8012
8013   proto_tree_add_bitmask_list(mimo_tree, tvb, offset, 2, ieee80211_mimo_fields, ENC_LITTLE_ENDIAN);
8014   offset += 2;
8015   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
8016                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
8017
8018   return 6;
8019 }
8020
8021 static guint
8022 add_ff_ant_selection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8023 {
8024   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ant_selection,
8025                          ett_ff_ant_sel, ieee80211_ff_ant_selection_fields,
8026                          ENC_LITTLE_ENDIAN);
8027   return 1;
8028 }
8029
8030 static guint
8031 add_ff_extended_channel_switch_announcement(proto_tree *tree, tvbuff_t *tvb,
8032                                             packet_info *pinfo _U_, int offset)
8033 {
8034   proto_tree_add_bitmask(tree, tvb, offset,
8035                          hf_ieee80211_ff_ext_channel_switch_announcement,
8036                          ett_ff_chan_switch_announce,
8037                          ieee80211_ff_ext_channel_switch_announcement_fields,
8038                          ENC_LITTLE_ENDIAN);
8039   return 4;
8040 }
8041
8042 static guint
8043 add_ff_ht_information(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8044 {
8045   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ht_info,
8046                          ett_ff_ht_info, ieee80211_ff_ht_info_fields,
8047                          ENC_LITTLE_ENDIAN);
8048   return 1;
8049 }
8050
8051 static guint
8052 add_ff_ht_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8053 {
8054   proto_tree_add_item(tree, hf_ieee80211_ff_ht_action, tvb, offset, 1,
8055                       ENC_LITTLE_ENDIAN);
8056   return 1;
8057 }
8058
8059 static guint
8060 add_ff_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8061 {
8062   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_action_code, tvb, offset, 1,
8063                       ENC_LITTLE_ENDIAN);
8064   return 1;
8065 }
8066
8067 static guint
8068 add_ff_dmg_pwr_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8069 {
8070   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_pwr_mgmt, tvb, offset, 1,
8071                       ENC_LITTLE_ENDIAN);
8072   return 1;
8073 }
8074
8075 static guint
8076 add_ff_psmp_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8077 {
8078   proto_item *psmp_item;
8079   proto_tree *psmp_tree;
8080
8081   psmp_item = proto_tree_add_item(tree, hf_ieee80211_ff_psmp_sta_info, tvb,
8082                                   offset, 8, ENC_LITTLE_ENDIAN);
8083   psmp_tree = proto_item_add_subtree(psmp_item, ett_ff_psmp_sta_info);
8084
8085   proto_tree_add_item(psmp_item, hf_ieee80211_ff_psmp_sta_info_type, tvb,
8086                       offset, 4, ENC_LITTLE_ENDIAN);
8087
8088   switch (tvb_get_letohl(tvb, offset) & PSMP_STA_INFO_FLAG_TYPE) {
8089   case PSMP_STA_INFO_BROADCAST:
8090     proto_tree_add_item(psmp_tree,
8091                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8092                         offset, 4, ENC_LITTLE_ENDIAN);
8093     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8094                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8095     /* Missing 64 bit bitmask... */
8096     proto_tree_add_uint64(psmp_tree,
8097                           hf_ieee80211_ff_psmp_sta_info_reserved_large,
8098                           tvb, offset, 8,
8099                           (tvb_get_letoh64(tvb, offset) &
8100                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
8101     break;
8102   case PSMP_STA_INFO_MULTICAST:
8103     proto_tree_add_item(psmp_tree,
8104                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8105                         offset, 4, ENC_LITTLE_ENDIAN);
8106     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8107                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8108     /* Missing 64 bit bitmask... */
8109     proto_tree_add_uint64(psmp_tree,
8110                           hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
8111                           tvb, offset, 6,
8112                           (tvb_get_letoh64(tvb, offset) &
8113                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
8114     break;
8115   case PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED:
8116     proto_tree_add_item(psmp_tree,
8117                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8118                         offset, 4, ENC_LITTLE_ENDIAN);
8119     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8120                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8121     offset += 2;
8122     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_sta_id, tvb,
8123                         offset, 4, ENC_LITTLE_ENDIAN);
8124     offset += 2;
8125
8126     proto_tree_add_item(psmp_tree,
8127                         hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
8128                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8129     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_utt_duration,
8130                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8131     proto_tree_add_item(psmp_tree,
8132                         hf_ieee80211_ff_psmp_sta_info_reserved_small, tvb,
8133                         offset, 4, ENC_LITTLE_ENDIAN);
8134     break;
8135   }
8136
8137   return 8;
8138 }
8139
8140 static guint
8141 add_ff_schedule_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8142 {
8143   static const int *ieee80211_schedule_info_fields1[] = {
8144     &hf_ieee80211_sched_info_agg,
8145     NULL
8146   };
8147   static const int *ieee80211_schedule_info_fields2[] = {
8148     &hf_ieee80211_sched_info_agg,
8149     &hf_ieee80211_sched_info_tsid,
8150     &hf_ieee80211_sched_info_dir,
8151     NULL
8152   };
8153
8154   if (tvb_get_letohs(tvb, offset) & 0x0001) {
8155     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_sched_info,
8156                                     ett_sched_tree, ieee80211_schedule_info_fields2,
8157                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8158   } else {
8159     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_sched_info,
8160                                     ett_sched_tree, ieee80211_schedule_info_fields1,
8161                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8162   }
8163
8164   return 2;
8165 }
8166
8167 static guint
8168 add_ff_pa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8169 {
8170   proto_tree_add_item(tree, hf_ieee80211_ff_public_action, tvb, offset, 1,
8171                       ENC_LITTLE_ENDIAN);
8172   return 1;
8173 }
8174
8175 static guint
8176 add_ff_ppa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8177 {
8178   proto_tree_add_item(tree, hf_ieee80211_ff_protected_public_action, tvb, offset, 1,
8179                       ENC_LITTLE_ENDIAN);
8180   return 1;
8181 }
8182
8183 static guint
8184 add_ff_ft_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8185 {
8186   proto_tree_add_item(tree, hf_ieee80211_ff_ft_action_code, tvb, offset, 1,
8187                       ENC_LITTLE_ENDIAN);
8188   return 1;
8189 }
8190
8191 static guint
8192 add_ff_sta_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8193 {
8194   proto_tree_add_item(tree, hf_ieee80211_ff_sta_address, tvb, offset, 6,
8195                       ENC_NA);
8196   return 6;
8197 }
8198
8199 static guint
8200 add_ff_target_ap_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8201 {
8202   proto_tree_add_item(tree, hf_ieee80211_ff_target_ap_address, tvb, offset, 6,
8203                       ENC_NA);
8204   return 6;
8205 }
8206
8207 static guint
8208 add_ff_gas_comeback_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8209 {
8210   proto_tree_add_item(tree, hf_ieee80211_ff_gas_comeback_delay, tvb, offset, 2,
8211                       ENC_LITTLE_ENDIAN);
8212   return 2;
8213 }
8214
8215 static guint
8216 add_ff_gas_fragment_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8217 {
8218   proto_tree_add_item(tree, hf_ieee80211_ff_gas_fragment_id, tvb, offset, 1,
8219                       ENC_LITTLE_ENDIAN);
8220   proto_tree_add_item(tree, hf_ieee80211_ff_more_gas_fragments, tvb, offset, 1,
8221                       ENC_LITTLE_ENDIAN);
8222   return 1;
8223 }
8224
8225 static guint
8226 add_ff_sa_query_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8227 {
8228   proto_tree_add_item(tree, hf_ieee80211_ff_sa_query_action_code, tvb, offset,
8229                       1, ENC_LITTLE_ENDIAN);
8230   return 1;
8231 }
8232
8233 static guint
8234 add_ff_transaction_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8235 {
8236   proto_tree_add_item(tree, hf_ieee80211_ff_transaction_id, tvb, offset, 2,
8237                       ENC_LITTLE_ENDIAN);
8238   return 2;
8239 }
8240
8241 static guint
8242 add_ff_tdls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8243 {
8244   guint8 code;
8245   code = tvb_get_guint8(tvb, offset);
8246   col_set_str(pinfo->cinfo, COL_INFO,
8247               val_to_str_ext_const(code, &tdls_action_codes_ext,
8248                                    "Unknown TDLS Action"));
8249   proto_tree_add_item(tree, hf_ieee80211_ff_tdls_action_code, tvb, offset, 1,
8250                       ENC_LITTLE_ENDIAN);
8251   return 1;
8252 }
8253
8254 static guint
8255 add_ff_target_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8256 {
8257   proto_tree_add_item(tree, hf_ieee80211_ff_target_channel, tvb, offset, 1,
8258                       ENC_LITTLE_ENDIAN);
8259   return 1;
8260 }
8261
8262 static guint
8263 add_ff_operating_class(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8264 {
8265   proto_tree_add_item(tree, hf_ieee80211_ff_operating_class, tvb, offset, 1,
8266                       ENC_LITTLE_ENDIAN);
8267   return 1;
8268 }
8269
8270 static guint
8271 add_ff_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8272 {
8273   guint8 code;
8274
8275   code = tvb_get_guint8(tvb, offset);
8276   col_set_str(pinfo->cinfo, COL_INFO,
8277               val_to_str_ext_const(code, &wnm_action_codes_ext, "Unknown WNM Action"));
8278   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8279   return 1;
8280 }
8281
8282 static guint
8283 add_ff_unprotected_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8284 {
8285   guint8 code;
8286
8287   code = tvb_get_guint8(tvb, offset);
8288   col_set_str(pinfo->cinfo, COL_INFO,
8289               val_to_str_ext_const(code, &unprotected_wnm_action_codes_ext, "Unknown Unprotected WNM Action"));
8290   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8291   return 1;
8292 }
8293
8294 static guint
8295 add_ff_unprotected_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8296 {
8297   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_dmg_action_code, tvb, offset, 1, ENC_NA);
8298   return 1;
8299 }
8300
8301 static guint
8302 add_ff_key_data_length(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8303 {
8304   proto_tree_add_item(tree, hf_ieee80211_ff_key_data_length, tvb, offset, 2,
8305                       ENC_LITTLE_ENDIAN);
8306   return 2;
8307 }
8308
8309 static guint
8310 add_ff_wnm_notification_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8311 {
8312   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_notification_type,
8313                       tvb, offset, 1, ENC_NA);
8314   return 1;
8315 }
8316
8317 /* Action frame: Radio Measurement actions */
8318 static guint
8319 add_ff_rm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8320 {
8321   proto_tree_add_item(tree, hf_ieee80211_ff_rm_action_code, tvb, offset, 1, ENC_NA);
8322   return 1;
8323 }
8324
8325 static guint
8326 add_ff_rm_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8327 {
8328   proto_tree_add_item(tree, hf_ieee80211_ff_rm_dialog_token, tvb, offset, 1, ENC_NA);
8329   return 1;
8330 }
8331
8332 /* Radio Measurement Request frame, Action fields */
8333 static guint
8334 add_ff_rm_repetitions(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8335 {
8336   /* Note: 65535 means repeated until cancelled or superseded */
8337   proto_tree_add_item(tree, hf_ieee80211_ff_rm_repetitions, tvb, offset, 2,
8338                       ENC_BIG_ENDIAN);
8339   return 2;
8340 }
8341
8342 /* Link Measurement Request frame, Action fields*/
8343 static guint
8344 add_ff_rm_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8345 {
8346   /* In dBm, see 8.4.1.20 */
8347   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_power, tvb, offset, 1, ENC_NA);
8348   return 1;
8349 }
8350
8351 static guint
8352 add_ff_rm_max_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8353 {
8354   /* In dBm, see 8.4.1.19 */
8355   proto_tree_add_item(tree, hf_ieee80211_ff_rm_max_tx_power, tvb, offset, 1, ENC_NA);
8356   return 1;
8357 }
8358
8359 /* Link Measurement Report frame, Action fields */
8360 static guint
8361 add_ff_rm_tpc_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8362 {
8363   proto_tree *tpc_tree;
8364   proto_item *tpc_item;
8365
8366   /* 8.4.2.19 TPC Report element */
8367   tpc_item = proto_tree_add_item(tree, hf_ieee80211_ff_tpc, tvb, offset, 4, ENC_NA);
8368   tpc_tree = proto_item_add_subtree(tpc_item, ett_tpc);
8369   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_element_id, tvb, offset, 1, ENC_NA);
8370   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_length, tvb, offset + 1, 1, ENC_NA);
8371   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_tx_power, tvb, offset + 2, 1, ENC_NA);
8372   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_link_margin, tvb, offset + 3, 1, ENC_NA);
8373   return 4;
8374 }
8375
8376 static guint
8377 add_ff_rm_rx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8378 {
8379   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
8380   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rx_antenna_id, tvb, offset, 1, ENC_NA);
8381   return 1;
8382 }
8383
8384 static guint
8385 add_ff_rm_tx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8386 {
8387   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
8388   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_antenna_id, tvb, offset, 1, ENC_NA);
8389   return 1;
8390 }
8391
8392 static guint
8393 add_ff_rm_rcpi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8394 {
8395   /* 8.4.2.40: RCPI as specified for certain PHYs */
8396   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rcpi, tvb, offset, 1, ENC_NA);
8397   return 1;
8398 }
8399
8400 static guint
8401 add_ff_rm_rsni(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8402 {
8403   /* 8.4.2.43: RSNI in steps of 0.5 dB, calculated as:
8404    * RSNI = (10 * log10((RCPI_{power} - ANPI_{power}) / ANPI_{power}) + 20)*2 */
8405   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rsni, tvb, offset, 1, ENC_NA);
8406   return 1;
8407 }
8408
8409 static guint
8410 add_ff_bss_transition_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8411 {
8412   proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_status_code, tvb, offset, 1,
8413                       ENC_LITTLE_ENDIAN);
8414   return 1;
8415 }
8416
8417 static guint
8418 add_ff_bss_termination_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8419 {
8420   proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_delay, tvb, offset, 1,
8421                       ENC_LITTLE_ENDIAN);
8422   return 1;
8423 }
8424
8425 static guint
8426 add_ff_action_spectrum_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8427 {
8428     switch (tvb_get_guint8(tvb, offset + 1)) {
8429     case SM_ACTION_MEASUREMENT_REQUEST:
8430     case SM_ACTION_MEASUREMENT_REPORT:
8431     case SM_ACTION_TPC_REQUEST:
8432     case SM_ACTION_TPC_REPORT:
8433       add_ff_category_code(tree, tvb, pinfo, offset);
8434       add_ff_action_code(tree, tvb, pinfo, offset + 1);
8435       add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
8436       return 3;
8437     case SM_ACTION_CHAN_SWITCH_ANNC:
8438     case SM_ACTION_EXT_CHAN_SWITCH_ANNC:
8439       add_ff_category_code(tree, tvb, pinfo, offset);
8440       add_ff_action_code(tree, tvb, pinfo, offset + 1);
8441       return 2;
8442     default:
8443       add_ff_category_code(tree, tvb, pinfo, offset);
8444       add_ff_action_code(tree, tvb, pinfo, offset + 1);
8445       return 2;
8446     }
8447 }
8448
8449 static guint
8450 add_ff_action_qos(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8451 {
8452   switch (tvb_get_guint8(tvb, offset + 1)) {
8453   case QOS_ACTION_ADDTS_REQUEST:
8454     add_ff_category_code(tree, tvb, pinfo, offset);
8455     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
8456     add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
8457     return 3;
8458   case QOS_ACTION_ADDTS_RESPONSE:
8459     add_ff_category_code(tree, tvb, pinfo, offset);
8460     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
8461     add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
8462     add_ff_status_code(tree, tvb, pinfo, offset + 3);
8463     return 5;
8464   case QOS_ACTION_DELTS:
8465     add_ff_category_code(tree, tvb, pinfo, offset);
8466     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
8467     add_ff_qos_ts_info(tree, tvb, pinfo, offset + 2);
8468     add_ff_reason_code(tree, tvb, pinfo, offset + 5);
8469     return 7;
8470   case QOS_ACTION_SCHEDULE:
8471     add_ff_category_code(tree, tvb, pinfo, offset);
8472     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
8473     return 2;
8474   case QOS_ACTION_MAP_CONFIGURE:
8475     add_ff_category_code(tree, tvb, pinfo, offset);
8476     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
8477     return 2;
8478   default:
8479     add_ff_category_code(tree, tvb, pinfo, offset);
8480     return 2;
8481   }
8482 }
8483
8484 static guint
8485 add_ff_action_dls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8486 {
8487   switch (tvb_get_guint8(tvb, offset + 1)) {
8488   case DLS_ACTION_REQUEST:
8489     add_ff_category_code(tree, tvb, pinfo, offset);
8490     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
8491     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  2);
8492     add_ff_src_mac_addr(tree, tvb, pinfo, offset +  8);
8493     add_ff_cap_info(tree, tvb, pinfo, offset + 14);
8494     add_ff_dls_timeout(tree, tvb, pinfo, offset + 16);
8495     return 18;
8496   case DLS_ACTION_RESPONSE:
8497     add_ff_category_code(tree, tvb, pinfo, offset);
8498     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
8499     add_ff_status_code(tree, tvb, pinfo, offset +  2);
8500     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  4);
8501     add_ff_src_mac_addr(tree, tvb, pinfo, offset + 10);
8502     if (!hf_ieee80211_ff_status_code) {
8503       add_ff_cap_info(tree, tvb, pinfo, offset + 16);
8504     }
8505     return 16;
8506   case DLS_ACTION_TEARDOWN:
8507     add_ff_category_code(tree, tvb, pinfo, offset);
8508     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
8509     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  2);
8510     add_ff_src_mac_addr(tree, tvb, pinfo, offset +  8);
8511     add_ff_reason_code(tree, tvb, pinfo, offset + 14);
8512     return 16;
8513   default:
8514     add_ff_category_code(tree, tvb, pinfo, offset);
8515     return 2;
8516   }
8517 }
8518
8519 static guint
8520 add_ff_action_block_ack(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8521 {
8522   guint start = offset;
8523
8524   switch (tvb_get_guint8(tvb, offset + 1)) {
8525   case BA_ADD_BLOCK_ACK_REQUEST:
8526     offset += add_ff_category_code(tree, tvb, pinfo, offset);
8527     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
8528     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8529     offset += add_ff_block_ack_param(tree, tvb, pinfo, offset);
8530     offset += add_ff_block_ack_timeout(tree, tvb, pinfo, offset);
8531     offset += add_ff_block_ack_ssc(tree, tvb, pinfo, offset);
8532     break;
8533   case BA_ADD_BLOCK_ACK_RESPONSE:
8534     offset += add_ff_category_code(tree, tvb, pinfo, offset);
8535     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
8536     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8537     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8538     offset += add_ff_block_ack_param(tree, tvb, pinfo, offset);
8539     offset += add_ff_block_ack_timeout(tree, tvb, pinfo, offset);
8540     break;
8541   case BA_DELETE_BLOCK_ACK:
8542     offset += add_ff_category_code(tree, tvb, pinfo, offset);
8543     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
8544     offset += add_ff_delba_param_set(tree, tvb, pinfo, offset);
8545     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
8546     break;
8547   }
8548
8549   return offset - start;  /* Size of fixed fields */
8550 }
8551
8552 static guint
8553 add_ff_action_public_fields(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint8 code)
8554 {
8555   guint32  oui;
8556   guint    type;
8557   guint    subtype;
8558   guint8   dialog_token;
8559   guint8   frag;
8560   gboolean more;
8561   tvbuff_t *vendor_tvb;
8562   int dissected;
8563
8564   guint start = offset;
8565
8566   switch (code) {
8567   case PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT:
8568     offset += add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
8569     break;
8570   case PA_VENDOR_SPECIFIC:
8571     proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
8572     offset += 3;
8573     switch (oui) {
8574     case OUI_WFA:
8575       subtype = tvb_get_guint8(tvb, offset);
8576       proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
8577       offset += 1;
8578       vendor_tvb = tvb_new_subset_remaining(tvb, offset);
8579       dissected = dissector_try_uint_new(wifi_alliance_public_action_table, subtype, vendor_tvb, pinfo, tree, FALSE, NULL);
8580       offset += dissected;
8581       break;
8582     default:
8583       /* Don't know how to handle this vendor */
8584       break;
8585     }
8586     break;
8587   case PA_GAS_INITIAL_REQUEST:
8588     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8589     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
8590                                              &type, &subtype);
8591     offset += dissect_gas_initial_request(tree, tvb, pinfo, offset, type,
8592                                           subtype);
8593     break;
8594   case PA_GAS_INITIAL_RESPONSE:
8595     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8596     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8597     offset += add_ff_gas_comeback_delay(tree, tvb, pinfo, offset);
8598     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
8599                                              &type, &subtype);
8600     offset += dissect_gas_initial_response(tree, tvb, pinfo, offset, type,
8601                                            subtype);
8602     break;
8603   case PA_GAS_COMEBACK_REQUEST:
8604     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8605     break;
8606   case PA_GAS_COMEBACK_RESPONSE:
8607     dialog_token = tvb_get_guint8(tvb, offset);
8608     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8609     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8610     frag = tvb_get_guint8(tvb, offset) & 0x7f;
8611     more = (tvb_get_guint8(tvb, offset) & 0x80) != 0;
8612     offset += add_ff_gas_fragment_id(tree, tvb, pinfo, offset);
8613     offset += add_ff_gas_comeback_delay(tree, tvb, pinfo, offset);
8614     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
8615                                              &type, &subtype);
8616     offset += dissect_gas_comeback_response(tree, tvb, pinfo, offset, type,
8617                                             subtype, frag, more, dialog_token);
8618     break;
8619   case PA_TDLS_DISCOVERY_RESPONSE:
8620     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
8621     col_set_str(pinfo->cinfo, COL_INFO, "TDLS Discovery Response");
8622     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8623     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
8624     break;
8625   case PA_QAB_REQUEST:
8626   case PA_QAB_RESPONSE:
8627     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8628     offset += add_ff_req_ap_addr(tree, tvb, pinfo, offset);
8629     offset += add_ff_res_ap_addr(tree, tvb, pinfo, offset);
8630     break;
8631   }
8632
8633   return offset - start;  /* Size of fixed fields */
8634 }
8635
8636 static guint
8637 add_ff_action_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8638 {
8639   guint8 code;
8640   guint start = offset;
8641   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8642   code    = tvb_get_guint8(tvb, offset);
8643   offset += add_ff_pa_action_code(tree, tvb, pinfo, offset);
8644   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
8645   return offset - start;
8646 }
8647
8648 static guint
8649 add_ff_action_protected_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8650 {
8651   guint8 code;
8652   guint start = offset;
8653   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8654   code    = tvb_get_guint8(tvb, offset);
8655   offset += add_ff_ppa_action_code(tree, tvb, pinfo, offset);
8656   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
8657   return offset - start;
8658 }
8659
8660 static guint
8661 add_ff_action_radio_measurement(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8662 {
8663   guint  start = offset;
8664   guint8 code;
8665
8666   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8667   code = tvb_get_guint8(tvb, offset);
8668   offset += add_ff_rm_action_code(tree, tvb, pinfo, offset);
8669
8670   switch (code) {
8671   case RM_ACTION_RADIO_MEASUREMENT_REQUEST:
8672     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8673     offset += add_ff_rm_repetitions(tree, tvb, pinfo, offset);
8674     /* Followed by Measurement Request Elements */
8675     break;
8676   case RM_ACTION_RADIO_MEASUREMENT_REPORT:
8677     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8678     /* Followed by Measurement Report Elements */
8679     break;
8680   case RM_ACTION_LINK_MEASUREMENT_REQUEST:
8681     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8682     offset += add_ff_rm_tx_power(tree, tvb, pinfo, offset);
8683     offset += add_ff_rm_max_tx_power(tree, tvb, pinfo, offset);
8684     /* Followed by Optional Subelements */
8685     break;
8686   case RM_ACTION_LINK_MEASUREMENT_REPORT:
8687     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8688     offset += add_ff_rm_tpc_report(tree, tvb, pinfo, offset);
8689     offset += add_ff_rm_rx_antenna_id(tree, tvb, pinfo, offset);
8690     offset += add_ff_rm_tx_antenna_id(tree, tvb, pinfo, offset);
8691     offset += add_ff_rm_rcpi(tree, tvb, pinfo, offset);
8692     offset += add_ff_rm_rsni(tree, tvb, pinfo, offset);
8693     /* Followed by Optional Subelements */
8694     break;
8695   case RM_ACTION_NEIGHBOR_REPORT_REQUEST:
8696     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8697     /* Followed by Optional Subelements */
8698     break;
8699   case RM_ACTION_NEIGHBOR_REPORT_RESPONSE:
8700     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8701     /* Followed by Neighbor Report Elements */
8702     break;
8703   }
8704
8705   return offset - start;  /* Size of fixed fields */
8706 }
8707
8708 static guint
8709 add_ff_action_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8710 {
8711   guint  start = offset;
8712   guint8 code;
8713
8714   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8715   code    = tvb_get_guint8(tvb, offset);
8716   offset += add_ff_ft_action_code(tree, tvb, pinfo, offset);
8717
8718   switch (code) {
8719   case FT_ACTION_REQUEST:
8720     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
8721     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
8722     /* Followed by FT Request frame body (IEs) */
8723     break;
8724   case FT_ACTION_RESPONSE:
8725     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
8726     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
8727     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8728     /* Followed by FT Response frame body (IEs) */
8729     break;
8730   case FT_ACTION_CONFIRM:
8731     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
8732     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
8733     /* Followed by FT Confirm frame body (IEs) */
8734     break;
8735   case FT_ACTION_ACK:
8736     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
8737     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
8738     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8739     /* Followed by FT Ack frame body (IEs) */
8740     break;
8741   }
8742
8743   return offset - start;  /* Size of fixed fields */
8744 }
8745
8746 static guint
8747 add_ff_action_sa_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8748 {
8749   guint  start = offset;
8750   guint8 code;
8751
8752   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8753   code    = tvb_get_guint8(tvb, offset);
8754   offset += add_ff_sa_query_action_code(tree, tvb, pinfo, offset);
8755
8756   switch (code) {
8757   case SA_QUERY_REQUEST:
8758     offset += add_ff_transaction_id(tree, tvb, pinfo, offset);
8759     break;
8760   case SA_QUERY_RESPONSE:
8761     offset += add_ff_transaction_id(tree, tvb, pinfo, offset);
8762     break;
8763   }
8764
8765   return offset - start;  /* Size of fixed fields */
8766 }
8767
8768 static guint
8769 add_ff_action_mesh(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8770 {
8771   guint length;
8772
8773   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8774   offset += add_ff_mesh_action(tree, tvb, pinfo, offset);
8775   /* The only fixed fields are the category and mesh action.  The rest are IEs.
8776    */
8777   length = 2;
8778   if (tvb_get_guint8(tvb, 1) == MESH_ACTION_TBTT_ADJ_RESPONSE) {
8779     /* ..except for the TBTT Adjustment Response, which has a status code field
8780      */
8781     length += add_ff_status_code(tree, tvb, pinfo, offset);
8782   }
8783   return length;
8784 }
8785
8786 static guint
8787 add_ff_action_multihop(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8788 {
8789   guint start = offset;
8790
8791   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8792   offset += add_ff_multihop_action(tree, tvb, pinfo, offset);
8793   offset += add_ff_mesh_control(tree, tvb, pinfo, offset);
8794   return offset - start;
8795 }
8796
8797 static guint
8798 add_ff_action_self_protected(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8799 {
8800   guint start = offset;
8801
8802   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8803   offset += add_ff_selfprot_action(tree, tvb, pinfo, offset);
8804
8805   switch (tvb_get_guint8(tvb, start + 1)) {
8806   case SELFPROT_ACTION_MESH_PEERING_OPEN:
8807     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
8808     break;
8809   case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
8810     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
8811     offset += add_ff_assoc_id(tree, tvb, pinfo, offset);
8812     break;
8813   }
8814
8815   return offset - start;
8816 }
8817
8818 static guint
8819 add_ff_vht_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8820 {
8821   proto_tree_add_item(tree, hf_ieee80211_ff_vht_action, tvb, offset, 1,
8822                       ENC_LITTLE_ENDIAN);
8823   return 1;
8824 }
8825
8826 static guint
8827 get_ff_auth_sae_len(tvbuff_t *tvb)
8828 {
8829   guint alg, seq, status_code;
8830   alg = tvb_get_letohs(tvb, 0);
8831
8832   /* SAE authentication is alg 3 (cf auth_alg) */
8833   if (alg != 3)
8834     return 0;
8835
8836   seq = tvb_get_letohs(tvb, 2);
8837   status_code = tvb_get_letohs(tvb, 4);
8838
8839   /* 82: Rejected with Suggested BSS Transition (cf ieee80211_status_code) */
8840   if ((seq == 2) && (status_code == 82))
8841     return 0;
8842
8843   /* everything is fixed size fields */
8844   return tvb_reported_length_remaining(tvb, 6);
8845 }
8846
8847 static void
8848 add_ff_auth_sae(proto_tree *tree, tvbuff_t *tvb)
8849 {
8850   guint alg, seq, status_code, len;
8851   alg = tvb_get_letohs(tvb, 0);
8852
8853   /* SAE authentication is alg 3 (cf auth_alg) */
8854   if (alg != 3)
8855     return;
8856
8857   seq = tvb_get_letohs(tvb, 2);
8858   status_code = tvb_get_letohs(tvb, 4);
8859
8860   if (seq == 1)
8861   {
8862     /* 76: Authentication is rejected because an Anti-Clogging Token is required (cf ieee80211_status_code) */
8863     if (status_code == 76)
8864     {
8865       proto_tree_add_item(tree, hf_ieee80211_ff_finite_cyclic_group, tvb, 6, 2,
8866                           ENC_LITTLE_ENDIAN);
8867       len = tvb_reported_length_remaining(tvb, 8);
8868       proto_tree_add_item(tree, hf_ieee80211_ff_anti_clogging_token, tvb, 8, len,
8869                           ENC_NA);
8870     }
8871     else if (status_code == 0)
8872     {
8873       guint group = tvb_get_letohs(tvb, 6);
8874       guint sc_len, elt_len, offset;
8875       proto_tree_add_item(tree, hf_ieee80211_ff_finite_cyclic_group, tvb, 6, 2,
8876                           ENC_LITTLE_ENDIAN);
8877       offset = 8;
8878       len = tvb_reported_length_remaining(tvb, offset);
8879       switch (group)
8880       {
8881         /* Diffie-Hellman groups */
8882         case 1:
8883           sc_len = elt_len = 96;
8884           break;
8885         case 2:
8886           sc_len = elt_len = 128;
8887           break;
8888         case 5:
8889           sc_len = elt_len = 192;
8890           break;
8891         case 14:
8892           sc_len = elt_len = 256;
8893           break;
8894         case 15:
8895           sc_len = elt_len = 384;
8896           break;
8897         case 16:
8898           sc_len = elt_len = 512;
8899           break;
8900         case 17:
8901           sc_len = elt_len = 768;
8902           break;
8903         case 18:
8904           sc_len = elt_len = 1024;
8905           break;
8906         case 22:
8907           sc_len = 20;
8908           elt_len = 128;
8909           break;
8910         case 23:
8911           sc_len = 28;
8912           elt_len = 256;
8913           break;
8914         case 24:
8915           sc_len = 32;
8916           elt_len = 256;
8917           break;
8918         /* ECC groups */
8919         case 19:
8920         case 28:
8921           sc_len = 32;
8922           elt_len = 64;
8923           break;
8924         case 20:
8925         case 29:
8926           sc_len = 48;
8927           elt_len = 96;
8928           break;
8929         case 21:
8930           sc_len = 66;
8931           elt_len = 132;
8932           break;
8933         case 25:
8934           sc_len = 24;
8935           elt_len = 48;
8936           break;
8937         case 26:
8938           sc_len = 28;
8939           elt_len = 56;
8940           break;
8941         case 30:
8942           sc_len = 64;
8943           elt_len = 128;
8944           break;
8945         default:
8946           /* assume no anti-clogging token */
8947           if (!(len % 3))
8948           {
8949             sc_len = len / 3;
8950           }
8951           else
8952           {
8953             sc_len = len / 2;
8954           }
8955           elt_len = len - sc_len;
8956           break;
8957       }
8958
8959       if ((sc_len + elt_len) < len)
8960       {
8961         len = len - (sc_len + elt_len);
8962         proto_tree_add_item(tree, hf_ieee80211_ff_anti_clogging_token, tvb, offset,
8963                             len, ENC_NA);
8964         offset += len;
8965       }
8966       proto_tree_add_item(tree, hf_ieee80211_ff_scalar, tvb, offset,
8967                           sc_len, ENC_NA);
8968       offset += sc_len;
8969       proto_tree_add_item(tree, hf_ieee80211_ff_finite_field_element, tvb, offset,
8970                           elt_len, ENC_NA);
8971     }
8972   }
8973   /* 82: Rejected with Suggested BSS Transition (cf ieee80211_status_code) */
8974   else if ((seq == 2) && (status_code != 82))
8975   {
8976     proto_tree_add_item(tree, hf_ieee80211_ff_send_confirm, tvb, 6, 2,
8977                         ENC_LITTLE_ENDIAN);
8978     len = tvb_reported_length_remaining(tvb, 8);
8979     proto_tree_add_item(tree, hf_ieee80211_ff_confirm, tvb, 8, len,
8980                         ENC_NA);
8981   };
8982 }
8983
8984 static guint
8985 wnm_bss_trans_mgmt_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8986 {
8987   int    start = offset;
8988   gint   left;
8989   int tmp_sublen;
8990   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
8991
8992
8993   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8994
8995   proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_query_reason, tvb, offset, 1,
8996                       ENC_NA);
8997   offset += 1;
8998
8999   left = tvb_reported_length_remaining(tvb, offset);
9000   if (left > 0) {
9001     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9002                         tvb, offset, left, ENC_NA);
9003
9004     while (left > 0){
9005       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9006       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9007         break;
9008       }
9009       left -= (tmp_sublen + 2);
9010       offset += (tmp_sublen + 2);
9011     }
9012   }
9013
9014   return offset - start;
9015 }
9016
9017
9018 static guint
9019 wnm_bss_trans_mgmt_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9020 {
9021   int    start = offset;
9022   guint8 mode;
9023   gint   left;
9024   int tmp_sublen;
9025   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
9026
9027   static const int *ieee80211_ff_request_flags[] = {
9028     &hf_ieee80211_ff_request_mode_pref_cand,
9029     &hf_ieee80211_ff_request_mode_abridged,
9030     &hf_ieee80211_ff_request_mode_disassoc_imminent,
9031     &hf_ieee80211_ff_request_mode_bss_term_included,
9032     &hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
9033     NULL
9034   };
9035
9036   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9037
9038   mode = tvb_get_guint8(tvb, offset);
9039   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_ff_request_flags, ENC_LITTLE_ENDIAN);
9040   offset += 1;
9041
9042   proto_tree_add_item(tree, hf_ieee80211_ff_disassoc_timer, tvb, offset, 2,
9043                       ENC_LITTLE_ENDIAN);
9044   offset += 2;
9045
9046   proto_tree_add_item(tree, hf_ieee80211_ff_validity_interval, tvb, offset, 1,
9047                       ENC_LITTLE_ENDIAN);
9048   offset += 1;
9049
9050   if (mode & 0x08) {
9051     proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_duration,
9052                         tvb, offset, 8, ENC_NA);
9053     offset += 8;
9054   }
9055
9056   if (mode & 0x10) {
9057     guint8 url_len;
9058     url_len = tvb_get_guint8(tvb, offset);
9059     proto_tree_add_item(tree, hf_ieee80211_ff_url_len, tvb, offset, 1,
9060                         ENC_LITTLE_ENDIAN);
9061     offset += 1;
9062     proto_tree_add_item(tree, hf_ieee80211_ff_url, tvb, offset, url_len,
9063                         ENC_ASCII|ENC_NA);
9064     offset += url_len;
9065   }
9066
9067   left = tvb_reported_length_remaining(tvb, offset);
9068   if (left > 0) {
9069     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9070                         tvb, offset, left, ENC_NA);
9071
9072     while (left > 0){
9073       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9074       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9075         break;
9076       }
9077       left -= (tmp_sublen + 2);
9078       offset += (tmp_sublen + 2);
9079     }
9080   }
9081
9082   return offset - start;
9083 }
9084
9085
9086 static guint
9087 wnm_bss_trans_mgmt_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9088 {
9089   int    start = offset;
9090   guint8 code;
9091   gint   left;
9092   int tmp_sublen;
9093   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
9094
9095   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9096   code = tvb_get_guint8(tvb, offset);
9097   offset += add_ff_bss_transition_status_code(tree, tvb, pinfo, offset);
9098   offset += add_ff_bss_termination_delay(tree, tvb, pinfo, offset);
9099   if (!code) {
9100     proto_tree_add_item(tree, hf_ieee80211_ff_target_bss,
9101                         tvb, offset, 6, ENC_NA);
9102     offset += 6;
9103   }
9104   left = tvb_reported_length_remaining(tvb, offset);
9105   if (left > 0) {
9106     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9107                         tvb, offset, left, ENC_NA);
9108     while (left > 0){
9109       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9110       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9111         break;
9112       }
9113       left -= (tmp_sublen + 2);
9114       offset += (tmp_sublen + 2);
9115     }
9116   }
9117
9118   return offset - start;
9119 }
9120
9121 static guint
9122 wnm_sleep_mode_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9123 {
9124   int start = offset;
9125   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9126   return offset - start;
9127 }
9128
9129 static guint
9130 wnm_sleep_mode_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9131 {
9132   int start = offset;
9133   guint16 key_data_len;
9134   gint left;
9135
9136   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9137   key_data_len = tvb_get_letohs(tvb, offset);
9138   offset += add_ff_key_data_length(tree, tvb, pinfo, offset);
9139   left = tvb_reported_length_remaining(tvb, offset);
9140   if (left < key_data_len) {
9141     expert_add_info(pinfo, tree, &ei_ieee80211_tag_wnm_sleep_mode_no_key_data);
9142     return offset - start;
9143   }
9144   proto_tree_add_item(tree, hf_ieee80211_ff_key_data, tvb, offset,
9145                       key_data_len, ENC_NA);
9146   offset += key_data_len;
9147   return offset - start;
9148 }
9149
9150 static guint
9151 wnm_tfs_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9152 {
9153   int start = offset;
9154   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9155   return offset - start;
9156 }
9157
9158 static guint
9159 wnm_tfs_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9160 {
9161   int start = offset;
9162   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9163   return offset - start;
9164 }
9165
9166 static guint
9167 wnm_notification_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9168 {
9169   int start = offset;
9170   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9171   offset += add_ff_wnm_notification_type(tree, tvb, pinfo, offset);
9172   return offset - start;
9173 }
9174
9175 static guint
9176 add_ff_action_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9177 {
9178   guint8 code;
9179   guint  start = offset;
9180
9181   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9182   code    = tvb_get_guint8(tvb, offset);
9183   offset += add_ff_wnm_action_code(tree, tvb, pinfo, offset);
9184   switch (code) {
9185   case WNM_BSS_TRANS_MGMT_QUERY:
9186     offset += wnm_bss_trans_mgmt_query(tree, tvb, pinfo, offset);
9187     break;
9188   case WNM_BSS_TRANS_MGMT_REQ:
9189     offset += wnm_bss_trans_mgmt_req(tree, tvb, pinfo, offset);
9190     break;
9191   case WNM_BSS_TRANS_MGMT_RESP:
9192     offset += wnm_bss_trans_mgmt_resp(tree, tvb, pinfo, offset);
9193     break;
9194   case WNM_TFS_REQ:
9195     offset += wnm_tfs_req(tree, tvb, pinfo, offset);
9196     break;
9197   case WNM_TFS_RESP:
9198     offset += wnm_tfs_resp(tree, tvb, pinfo, offset);
9199     break;
9200   case WNM_SLEEP_MODE_REQ:
9201     offset += wnm_sleep_mode_req(tree, tvb, pinfo, offset);
9202     break;
9203   case WNM_SLEEP_MODE_RESP:
9204     offset += wnm_sleep_mode_resp(tree, tvb, pinfo, offset);
9205     break;
9206   case WNM_NOTIFICATION_REQ:
9207     offset += wnm_notification_req(tree, tvb, pinfo, offset);
9208     break;
9209   }
9210
9211   return offset - start;  /* Size of fixed fields */
9212 }
9213
9214 static guint
9215 add_ff_action_unprotected_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9216 {
9217   guint8 code;
9218   guint  start = offset;
9219
9220   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9221   code    = tvb_get_guint8(tvb, offset);
9222   offset += add_ff_unprotected_wnm_action_code(tree, tvb, pinfo, offset);
9223
9224   switch (code) {
9225   case UNPROTECTED_WNM_TIM:
9226     offset += add_ff_check_beacon(tree, tvb, pinfo, offset);
9227     offset += add_ff_timestamp(tree, tvb, pinfo, offset);
9228     offset += add_ff_tod(tree, tvb, pinfo, offset);
9229     offset += add_ff_toa(tree, tvb, pinfo, offset);
9230     offset += add_ff_max_tod_err(tree, tvb, pinfo, offset);
9231     offset += add_ff_max_toa_err(tree, tvb, pinfo, offset);
9232     break;
9233   case UNPROTECTED_WNM_TIMING_MEASUREMENT:
9234     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9235     offset += add_ff_followup_dialog_token(tree, tvb, pinfo, offset);
9236     break;
9237   }
9238
9239   return offset - start;  /* Size of fixed fields */
9240 }
9241
9242 static guint
9243 add_ff_action_tdls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9244 {
9245   guint8  code;
9246   guint16 status;
9247   guint   start = offset;
9248
9249   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9250   code = tvb_get_guint8(tvb, offset);
9251   offset += add_ff_tdls_action_code(tree, tvb, pinfo, offset);
9252   switch (code) {
9253   case TDLS_SETUP_REQUEST:
9254     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9255     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
9256     break;
9257   case TDLS_SETUP_RESPONSE:
9258     status = tvb_get_letohs(tvb, offset);
9259     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9260     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9261     if (tvb_reported_length_remaining(tvb, offset) < 2) {
9262       if (status == 0) {
9263         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_response_malformed);
9264       }
9265       break;
9266     }
9267     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
9268     break;
9269   case TDLS_SETUP_CONFIRM:
9270     status = tvb_get_letohs(tvb, offset);
9271     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9272     if (tvb_reported_length_remaining(tvb, offset) < 1) {
9273       if (status == 0) {
9274         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_confirm_malformed);
9275       }
9276       break;
9277     }
9278     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9279     break;
9280   case TDLS_TEARDOWN:
9281     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
9282     break;
9283   case TDLS_PEER_TRAFFIC_INDICATION:
9284     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9285     break;
9286   case TDLS_CHANNEL_SWITCH_REQUEST:
9287     offset += add_ff_target_channel(tree, tvb, pinfo, offset);
9288     offset += add_ff_operating_class(tree, tvb, pinfo, offset);
9289     break;
9290   case TDLS_CHANNEL_SWITCH_RESPONSE:
9291     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9292     break;
9293   case TDLS_PEER_PSM_REQUEST:
9294     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9295     break;
9296   case TDLS_PEER_PSM_RESPONSE:
9297     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9298     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9299     break;
9300   case TDLS_PEER_TRAFFIC_RESPONSE:
9301     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9302     break;
9303   case TDLS_DISCOVERY_REQUEST:
9304     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9305     break;
9306   }
9307
9308   return offset - start;  /* Size of fixed fields */
9309 }
9310
9311 static guint
9312 add_ff_action_mgmt_notification(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9313 {
9314   guint start = offset;
9315
9316   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9317   offset += add_ff_wme_action_code(tree, tvb, pinfo, offset);
9318   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9319   offset += add_ff_wme_status_code(tree, tvb, pinfo, offset);
9320
9321   return offset - start;  /* Size of fixed fields */
9322 }
9323
9324 static guint
9325 add_ff_action_vendor_specific(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9326 {
9327   guint   start = offset;
9328   guint32 oui;
9329   tvbuff_t *vendor_tvb;
9330   int dissected;
9331
9332   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9333   proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
9334   offset += 3;
9335
9336   vendor_tvb = tvb_new_subset_remaining(tvb, offset);
9337   dissected = dissector_try_uint_new(vendor_specific_action_table, oui, vendor_tvb, pinfo, tree, FALSE, NULL);
9338   if (dissected <= 0)
9339   {
9340       call_data_dissector(vendor_tvb, pinfo, tree);
9341       /* don't advance the dissector pointer as this will probably cause more malformed packets
9342          if vendor is unknown. It also matches previous behavior (before dissection table implementation) */
9343       dissected = 0;
9344   }
9345
9346   offset += dissected;
9347
9348   return offset - start;  /* Size of fixed fields */
9349 }
9350
9351 static guint
9352 add_ff_action_ht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9353 {
9354   guint  start = offset;
9355   guint8 n_sta, i;
9356   mimo_control_t mimo_cntrl;
9357
9358   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9359   offset += add_ff_ht_action_code(tree, tvb, pinfo, offset);
9360
9361   switch (tvb_get_guint8(tvb, offset - 1)) {
9362   case HT_ACTION_NOTIFY_CHAN_WIDTH:
9363     offset += add_ff_channel_width(tree, tvb, pinfo, offset);
9364     break;
9365   case HT_ACTION_SM_PWR_SAVE:
9366     offset += add_ff_sm_pwr_cntrl(tree, tvb, pinfo, offset);
9367     break;
9368   case HT_ACTION_PSMP_ACTION:
9369     n_sta = tvb_get_guint8(tvb, offset);
9370     offset += add_ff_psmp_param_set(tree, tvb, pinfo, offset);
9371     for (i = 0; i < (n_sta & 0x0F); i++) {
9372       offset += add_ff_psmp_sta_info(tree, tvb, pinfo, offset);
9373     }
9374     break;
9375   case HT_ACTION_SET_PCO_PHASE:
9376     offset += add_ff_pco_phase_cntrl(tree, tvb, pinfo, offset);
9377     break;
9378   case HT_ACTION_MIMO_CSI:
9379     mimo_cntrl = get_mimo_control(tvb, offset);
9380     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
9381     offset += add_mimo_csi_matrices_report(tree, tvb, offset, mimo_cntrl);
9382     break;
9383   case HT_ACTION_MIMO_BEAMFORMING:
9384     mimo_cntrl = get_mimo_control(tvb, offset);
9385     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
9386     offset += add_mimo_beamforming_feedback_report(tree, tvb, offset,
9387                                                    mimo_cntrl);
9388     break;
9389   case HT_ACTION_MIMO_COMPRESSED_BEAMFORMING:
9390     mimo_cntrl = get_mimo_control(tvb, offset);
9391     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
9392     offset += add_mimo_compressed_beamforming_feedback_report(tree, tvb,
9393                                                               offset,
9394                                                               mimo_cntrl);
9395     break;
9396   case HT_ACTION_ANT_SEL_FEEDBACK:
9397     offset += add_ff_ant_selection(tree, tvb, pinfo, offset);
9398     break;
9399   case HT_ACTION_HT_INFO_EXCHANGE:
9400     offset += add_ff_ht_information(tree, tvb, pinfo, offset);
9401     break;
9402   }
9403
9404   return offset - start;
9405 }
9406
9407 static guint
9408 add_ff_beacon_interval_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9409 {
9410   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bic,
9411                                     ett_bic_tree, ieee80211_ff_bic_fields,
9412                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9413
9414   return 6;
9415 }
9416
9417 static guint
9418 add_ff_beamforming_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset, gboolean isGrant)
9419 {
9420   guint16 bf_field = tvb_get_letohs(tvb, offset);
9421   gboolean isInit = (bf_field & 0x2) >> 1;
9422   gboolean isResp = (bf_field & 0x4) >> 2;
9423   static const int *ieee80211_ff_beamforming_ctrl[] = {
9424     &hf_ieee80211_ff_bf_train,
9425     &hf_ieee80211_ff_bf_is_init,
9426     &hf_ieee80211_ff_bf_is_resp,
9427     &hf_ieee80211_ff_bf_rxss_len,
9428     &hf_ieee80211_ff_bf_rxss_rate,
9429     &hf_ieee80211_ff_bf_b10b15,
9430     NULL
9431   };
9432
9433   static const int *ieee80211_ff_beamforming_ctrl_grant[] = {
9434     &hf_ieee80211_ff_bf_train,
9435     &hf_ieee80211_ff_bf_is_init,
9436     &hf_ieee80211_ff_bf_is_resp,
9437     &hf_ieee80211_ff_bf_num_sectors,
9438     &hf_ieee80211_ff_bf_num_rx_dmg_ants,
9439     &hf_ieee80211_ff_bf_b12b15,
9440     NULL
9441   };
9442
9443   if((isInit==TRUE) && (isResp==TRUE) && isGrant) {
9444     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bf,
9445                                     ett_bf_tree, ieee80211_ff_beamforming_ctrl_grant,
9446                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9447   } else {
9448     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bf,
9449                                     ett_bf_tree, ieee80211_ff_beamforming_ctrl,
9450                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9451   }
9452   return 2;
9453 }
9454
9455 static guint
9456 add_ff_dynamic_allocation(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9457 {
9458   static const int *ieee80211_ff_dynamic_allocation[] = {
9459     &hf_ieee80211_ff_TID,
9460     &hf_ieee80211_ff_alloc_type,
9461     &hf_ieee80211_ff_src_aid,
9462     &hf_ieee80211_ff_dest_aid,
9463     &hf_ieee80211_ff_alloc_duration,
9464     &hf_ieee80211_ff_b39,
9465     NULL
9466   };
9467
9468   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_dynamic_allocation,
9469                                     ett_dynamic_alloc_tree, ieee80211_ff_dynamic_allocation,
9470                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9471
9472   return 5;
9473 }
9474
9475 static guint
9476 add_ff_beamformed_link(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9477 {
9478   static const int *ieee80211_ff_beamformed_link[] = {
9479     &hf_ieee80211_ff_blm_unit_index,
9480     &hf_ieee80211_ff_blm_maint_value,
9481     &hf_ieee80211_ff_blm_is_master,
9482     NULL
9483   };
9484
9485   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_blm,
9486                                     ett_blm_tree, ieee80211_ff_beamformed_link,
9487                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9488   return 1;
9489 }
9490
9491 static guint
9492 add_ff_BRP_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9493 {
9494   static const int *ieee80211_ff_BRP_request[] = {
9495     &hf_ieee80211_ff_brp_L_RX,
9496     &hf_ieee80211_ff_brp_TX_TRN_REQ,
9497     &hf_ieee80211_ff_brp_MID_REQ,
9498     &hf_ieee80211_ff_brp_BC_REQ,
9499     &hf_ieee80211_ff_brp_MID_GRANT,
9500     &hf_ieee80211_ff_brp_BC_GRANT,
9501     &hf_ieee80211_ff_brp_chan_FBCK_CAP,
9502     &hf_ieee80211_ff_brp_tx_sector,
9503     &hf_ieee80211_ff_brp_other_aid,
9504     &hf_ieee80211_ff_brp_tx_antenna,
9505     &hf_ieee80211_ff_brp_reserved,
9506     NULL
9507   };
9508
9509   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_brp,
9510                                     ett_brp_tree, ieee80211_ff_BRP_request,
9511                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9512   return 4;
9513 }
9514
9515 static guint
9516 add_ff_sector_sweep_feedback_from_iss(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9517 {
9518   static const int *ieee80211_ff_sector_sweep_feedback_from_iss[] = {
9519     &hf_ieee80211_ff_sswf_total_sectors,
9520     &hf_ieee80211_ff_sswf_num_rx_dmg_ants,
9521     &hf_ieee80211_ff_sswf_reserved1,
9522     &hf_ieee80211_ff_sswf_poll_required,
9523     &hf_ieee80211_ff_sswf_reserved2,
9524     NULL
9525   };
9526
9527   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_sswf,
9528                                     ett_sswf_tree, ieee80211_ff_sector_sweep_feedback_from_iss,
9529                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9530   return 3;
9531 }
9532
9533 static guint
9534 add_ff_sector_sweep_feedback_to_iss(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9535 {
9536   static const int *ieee80211_ff_sector_sweep_feedback_to_iss[] = {
9537     &hf_ieee80211_ff_sswf_sector_select,
9538     &hf_ieee80211_ff_sswf_dmg_antenna_select,
9539     &hf_ieee80211_ff_sswf_snr_report,
9540     &hf_ieee80211_ff_sswf_poll_required,
9541     &hf_ieee80211_ff_sswf_reserved2,
9542     NULL
9543   };
9544
9545   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_sswf,
9546                                     ett_sswf_tree, ieee80211_ff_sector_sweep_feedback_to_iss,
9547                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9548   return 3;
9549 }
9550
9551 static guint
9552 add_ff_sector_sweep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9553 {
9554   static const int *ieee80211_ff_sector_sweep[] = {
9555     &hf_ieee80211_ff_ssw_direction,
9556     &hf_ieee80211_ff_ssw_cdown,
9557     &hf_ieee80211_ff_ssw_sector_id,
9558     &hf_ieee80211_ff_ssw_dmg_ant_id,
9559     &hf_ieee80211_ff_ssw_rxss_len,
9560     NULL
9561   };
9562
9563   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_ssw,
9564                                     ett_ssw_tree, ieee80211_ff_sector_sweep,
9565                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9566   return 3;
9567 }
9568
9569 static guint
9570 add_ff_dmg_params(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9571 {
9572   static const int *ieee80211_ff_dmg_params[] = {
9573     &hf_ieee80211_ff_dmg_params_bss,
9574     &hf_ieee80211_ff_dmg_params_cbap_only,
9575     &hf_ieee80211_ff_dmg_params_cbap_src,
9576     &hf_ieee80211_ff_dmg_params_privacy,
9577     &hf_ieee80211_ff_dmg_params_policy,
9578     NULL
9579   };
9580
9581   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_dmg_params,
9582                                     ett_dmg_params_tree, ieee80211_ff_dmg_params,
9583                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
9584   return 1;
9585 }
9586
9587 static guint
9588 add_ff_cc_field(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean dis)
9589 {
9590   proto_item *cc_item = proto_tree_add_item(tree, hf_ieee80211_ff_cc, tvb, offset, 8, ENC_LITTLE_ENDIAN);
9591   proto_tree *cc_tree = proto_item_add_subtree(cc_item, ett_cc_tree);
9592   guint64 cc_field;
9593   if(dis) {
9594     proto_tree_add_item(cc_tree, hf_ieee80211_ff_cc_abft_resp_addr, tvb, offset, 6, ENC_NA);
9595   } else {
9596     cc_field = tvb_get_letoh64(tvb, offset);
9597     /*TODO : Add support of bitmask for FT_(U)INT64 */
9598     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_sp_duration, tvb, offset, 1, (guint32)(cc_field & 0xff));
9599     proto_tree_add_uint64(cc_tree, hf_ieee80211_ff_cc_cluster_id, tvb, offset+1, 6, (guint64)((cc_field & G_GUINT64_CONSTANT(0x00ffffffffffff00)) >> 8));
9600     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_role, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x0300000000000000)) >> 56));
9601     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_max_mem, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x7c00000000000000)) >> 58));
9602   }
9603   return 8;
9604 }
9605
9606
9607 static guint
9608 add_ff_band_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9609 {
9610   proto_tree_add_item(tree, hf_ieee80211_ff_band_id, tvb, offset, 1, ENC_NA);
9611   return 1;
9612 }
9613
9614 static guint
9615 add_ff_subject_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9616 {
9617   proto_tree_add_item(tree, hf_ieee80211_ff_subject_address, tvb, offset, 6, ENC_NA);
9618   return 6;
9619 }
9620
9621 static guint
9622 add_ff_handover_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9623 {
9624   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reason, tvb, offset, 1, ENC_NA);
9625   return 1;
9626 }
9627
9628 static guint
9629 add_ff_handover_remaining_bi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9630 {
9631   proto_tree_add_item(tree, hf_ieee80211_ff_handover_remaining_bi, tvb, offset, 1, ENC_NA);
9632   return 1;
9633 }
9634
9635 static guint
9636 add_ff_handover_result(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9637 {
9638   proto_tree_add_item(tree, hf_ieee80211_ff_handover_result, tvb, offset, 1, ENC_NA);
9639   return 1;
9640 }
9641
9642 static guint
9643 add_ff_handover_reject_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9644 {
9645   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reject_reason, tvb, offset, 1, ENC_NA);
9646   return 1;
9647 }
9648
9649 static guint
9650 add_ff_destination_reds_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9651 {
9652   proto_tree_add_item(tree, hf_ieee80211_ff_destination_reds_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9653   return 2;
9654 }
9655
9656 static guint
9657 add_ff_destination_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9658 {
9659   proto_tree_add_item(tree, hf_ieee80211_ff_destination_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9660   return 2;
9661 }
9662
9663 static guint
9664 add_ff_realy_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9665 {
9666   proto_tree_add_item(tree, hf_ieee80211_ff_realy_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9667   return 2;
9668 }
9669
9670 static guint
9671 add_ff_source_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9672 {
9673   proto_tree_add_item(tree, hf_ieee80211_ff_source_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9674   return 2;
9675 }
9676
9677 static guint
9678 add_ff_timing_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9679 {
9680   proto_tree_add_item(tree, hf_ieee80211_ff_timing_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9681   return 2;
9682 }
9683
9684 static guint
9685 add_ff_sampling_frequency_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9686 {
9687   proto_tree_add_item(tree, hf_ieee80211_ff_sampling_frequency_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9688   return 2;
9689 }
9690
9691 static guint
9692 add_ff_relay_operation_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9693 {
9694   proto_tree_add_item(tree, hf_ieee80211_ff_relay_operation_type, tvb, offset, 1, ENC_NA);
9695   return 1;
9696 }
9697
9698 static guint
9699 add_ff_fst_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9700 {
9701   proto_tree_add_item(tree, hf_ieee80211_ff_fst_action_code, tvb, offset, 1, ENC_NA);
9702   return 1;
9703 }
9704
9705 static guint
9706 add_ff_llt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9707 {
9708   proto_tree_add_item(tree, hf_ieee80211_ff_llt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9709   return 4;
9710 }
9711
9712 static guint
9713 add_ff_fsts_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9714 {
9715   proto_tree_add_item(tree, hf_ieee80211_ff_fsts_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9716   return 4;
9717 }
9718
9719 static guint
9720 add_ff_oct_mmpdu(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9721 {
9722   guint start = offset;
9723   guint len = tvb_get_letohs(tvb, offset);
9724   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9725   offset += 2;
9726   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_ctrl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9727   offset += 2;
9728   proto_tree_add_item(tree, hf_ieee80211_ff_oct_mmpdu, tvb, offset, len, ENC_NA);
9729   offset += len;
9730   return offset - start;
9731 }
9732
9733 static int
9734 add_tag_relay_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
9735 {
9736   int tag_len = tvb_reported_length(tvb);
9737   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
9738   int offset = 0;
9739   static const int *ieee80211_tag_relay_capabilities[] = {
9740     &hf_ieee80211_tag_relay_support,
9741     &hf_ieee80211_tag_relay_use,
9742     &hf_ieee80211_tag_relay_permission,
9743     &hf_ieee80211_tag_AC_power,
9744     &hf_ieee80211_tag_relay_prefer,
9745     &hf_ieee80211_tag_duplex,
9746     &hf_ieee80211_tag_cooperation,
9747     NULL
9748   };
9749
9750   if (tag_len < 2) {
9751     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length must be 2");
9752     return 1;
9753   }
9754
9755   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_relay_capabilities, ENC_NA);
9756   return tvb_captured_length(tvb);
9757 }
9758
9759 #if 0
9760 static guint
9761 add_ff_relay_capable_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9762 {
9763   proto_item *rcsi_item = proto_tree_add_item(tree, hf_ieee80211_ff_rcsi, tvb, offset, 3, ENC_LITTLE_ENDIAN);
9764   proto_tree *rcsi_tree = proto_item_add_subtree(rcsi_item, ett_rcsi_tree);
9765   proto_tree_add_item(rcsi_tree, hf_ieee80211_ff_rcsi_aid, tvb, offset, 1, ENC_NA);
9766   offset += 1;
9767   add_tag_relay_capabilities(pinfo, rcsi_item, 2, rcsi_tree, tvb, &offset);
9768   return 3;
9769 }
9770 #endif
9771
9772 static void
9773 dissect_ieee80211_extension(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
9774 {
9775   proto_item *ti;
9776   proto_tree *ext_tree;
9777   proto_tree *fixed_tree;
9778   proto_tree *tagged_tree;
9779
9780   int offset = 0;
9781   int tagged_parameter_tree_len;
9782
9783   ti = proto_tree_add_item(tree, proto_wlan_ext, tvb, offset, -1, ENC_NA);
9784   ext_tree = proto_item_add_subtree(ti, ett_80211_ext);
9785
9786   switch (COMPOSE_FRAME_TYPE(fcf))
9787   {
9788     case EXTENSION_DMG_BEACON:
9789     {
9790       gboolean cc, dis;
9791       guint16 bic_field;
9792       fixed_tree = get_fixed_parameter_tree(ext_tree, tvb, offset, 20);
9793       offset += add_ff_timestamp(fixed_tree, tvb, pinfo, offset);
9794       offset += add_ff_sector_sweep(fixed_tree, tvb, pinfo, offset);
9795       offset += add_ff_beacon_interval(fixed_tree, tvb, pinfo, offset);
9796       bic_field = tvb_get_letohs(tvb, offset);
9797       cc = (bic_field & 0x1);
9798       dis  = (bic_field & 0x2) >> 1;
9799       offset += add_ff_beacon_interval_ctrl(fixed_tree, tvb, pinfo, offset);
9800       offset += add_ff_dmg_params(fixed_tree, tvb, pinfo, offset);
9801       if(cc) {
9802         offset += add_ff_cc_field(fixed_tree, tvb, offset, dis);
9803       }
9804       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
9805
9806       /*
9807        * The tagged params are optional here. See Table 8.33a of the 2012
9808        * version of the standard.
9809        */
9810       if (tagged_parameter_tree_len) {
9811         tagged_tree = get_tagged_parameter_tree(ext_tree, tvb, offset, tagged_parameter_tree_len);
9812         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, EXTENSION_DMG_BEACON, NULL);
9813       }
9814       break;
9815     }
9816   }
9817 }
9818
9819 static guint
9820 add_ff_action_unprotected_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9821 {
9822   guint8 code;
9823   guint  start = offset;
9824
9825   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9826   code    = tvb_get_guint8(tvb, offset);
9827   offset += add_ff_unprotected_dmg_action_code(tree, tvb, pinfo, offset);
9828   switch (code) {
9829     case UNPROTECTED_DMG_ANNOUNCE:
9830       offset += add_ff_timestamp(tree, tvb, pinfo, offset);
9831       offset += add_ff_beacon_interval(tree, tvb, pinfo, offset);
9832       break;
9833     case UNPROTECTED_DMG_BRP:
9834       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9835       offset += add_ff_BRP_request(tree, tvb, pinfo, offset);
9836       break;
9837   }
9838   return offset - start;
9839 }
9840
9841 /* There is no easy way to skip all these subcarrier indices that must not
9842  * be displayed when showing compressed beamforming feedback matrices
9843  * Table 8-53g IEEE Std 802.11ac-2013 amendment.
9844  *
9845  * The irregular use of case statements in this function is to improve
9846  * readability in what is otherwise a large funtion that does very little.
9847  */
9848 static inline int
9849 vht_compressed_skip_scidx(guint8 nchan_width, guint8 ng, int scidx)
9850 {
9851   switch(nchan_width) {
9852     /* 20 MHz */
9853     case 0:
9854       /* No Grouping */
9855       if (ng == 0)
9856         switch (scidx) {
9857           /* Pilot subcarriers */
9858           case -21: case -7: case 7: case 21:
9859           /* DC subcarrier */
9860           case 0:
9861             scidx++;
9862           default:
9863             break;
9864         }
9865       break;
9866     /* 40 MHz */
9867     case 1:
9868       /* No Grouping */
9869       if (ng == 0)
9870         switch (scidx) {
9871           /* Pilot subcarriers */
9872           case -53: case -25: case -11: case 11: case 25: case 53:
9873             scidx++;
9874             break;
9875           /* DC subcarriers */
9876           case -1: case 0: case 1:
9877             scidx = 2;
9878           default:
9879             break;
9880         }
9881       break;
9882     /* 80 MHz */
9883     case 2:
9884       /* No Grouping */
9885       if (ng == 0)
9886         switch (scidx) {
9887           /* Pilot subcarriers */
9888           case -103: case -75: case -39: case -11: case 11: case 39: case 75: case 103:
9889             scidx++;
9890             break;
9891           /* DC subcarriers, skip -1, 0, 1 */
9892           case -1:
9893             scidx = 2;
9894           default:
9895             break;
9896         }
9897       break;
9898     /* 160 MHz / 80+80 Mhz
9899      * Skip values here assume 160 MHz, as vht_mimo_control does not let us differentiate
9900      * between 160 MHz & 80-80MHz */
9901     case 3:
9902       switch (ng) {
9903         /* No Grouping */
9904         case 0:
9905           /* DC subcarriers, skip -5 to 5*/
9906           if (scidx == -5) {
9907             scidx = 6;
9908             break;
9909           }
9910           switch (scidx) {
9911             /* Pilot subcarriers */
9912             case -231: case -203: case -167: case -139: case -117: case -89: case -53: case -25:
9913             case 25: case 53: case 89: case 117: case 139: case 167: case 203: case 231:
9914               scidx++;
9915               break;
9916             /* Other subcarriers, skip -129 to -127, 127 to 129 */
9917             case -129:
9918               scidx = -126;
9919               break;
9920             case 127:
9921               scidx = 130;
9922               break;
9923             default:
9924               break;
9925           }
9926           break;
9927         /* Grouping of 2 */
9928         case 1:
9929           switch (scidx) {
9930             /* DC subcarriers */
9931             case -128: case -4: case -2: case 0: case 2: case 4: case 128:
9932               scidx++;
9933             default:
9934               break;
9935           }
9936           break;
9937         /* Grouping of 4 */
9938         case 2:
9939           if (scidx == -2 || scidx == 2)
9940             scidx++;
9941           break;
9942       }
9943       break;
9944     default:
9945       break;
9946   }
9947
9948   return scidx;
9949 }
9950
9951 static inline int vht_exclusive_skip_scidx(guint8 nchan_width, guint8 ng, int scidx)
9952 {
9953   switch (nchan_width) {
9954     /* 20 MHz */
9955     case 0:
9956       switch (ng) {
9957         /* No Grouping */
9958         case 0:
9959           if (scidx == -2 || scidx == 1)
9960               scidx++;
9961           else
9962               scidx = scidx + 2;
9963           break;
9964         case 1:
9965           switch (scidx) {
9966             case -4: case 1:
9967               scidx = scidx + 3;
9968               break;
9969             case -1:
9970               scidx = 1;
9971               break;
9972             default:
9973               scidx = scidx + 4;
9974               break;
9975           }
9976           break;
9977         default:
9978           switch (scidx) {
9979             case -4: case 1:
9980               scidx = scidx + 3;
9981               break;
9982             case -1:
9983               scidx = 1;
9984               break;
9985             default:
9986               scidx = scidx + 8;
9987               break;
9988           }
9989           break;
9990       }
9991       break;
9992     /* 40 MHz */
9993     case 1:
9994     /* 80 MHz */
9995     case 2:
9996       switch (ng) {
9997         /* No Grouping */
9998         case 0:
9999           if (scidx == -2)
10000             scidx = 2;
10001           else
10002             scidx = scidx + 2;
10003           break;
10004         case 1:
10005           scidx = scidx + 4;
10006           break;
10007         default:
10008           if (scidx == -2)
10009             scidx = 2;
10010           else
10011             scidx = scidx + 8;
10012           break;
10013       }
10014       break;
10015     /* 160 MHz / 80+80 Mhz */
10016     case 3:
10017       switch (ng) {
10018         /* No Grouping */
10019         case 0:
10020           switch (scidx) {
10021             /* DC subcarriers, skip -4 to 4*/
10022             case -6:
10023               scidx = 6;
10024               break;
10025             /* Other subcarriers, skip -128, 128 */
10026             case -130:
10027               scidx = -126;
10028               break;
10029             case 126:
10030               scidx = 130;
10031               break;
10032             default:
10033               scidx = scidx + 2;
10034               break;
10035           }
10036           break;
10037         case 1:
10038           switch (scidx) {
10039             /* DC subcarriers, skip -4 to 4*/
10040             case -6:
10041               scidx = 6;
10042               break;
10043             default:
10044               scidx = scidx + 4;
10045               break;
10046           }
10047           break;
10048         default:
10049           switch (scidx) {
10050             case -6:
10051               scidx = 6;
10052               break;
10053             case -130:
10054               scidx = -126;
10055               break;
10056             case 126:
10057               scidx = 130;
10058               break;
10059             default:
10060               scidx = scidx + 8;
10061               break;
10062           }
10063         break;
10064       }
10065       break;
10066     default:
10067       break;
10068   }
10069   return scidx;
10070 }
10071
10072 static guint
10073 add_ff_vht_compressed_beamforming_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10074 {
10075   guint32 vht_mimo;
10076   guint8 nc;
10077   guint8 nr;
10078   guint8 chan_width;
10079   guint8 grouping;
10080   gboolean codebook_info;
10081   gboolean feedback_type;
10082   proto_item *vht_beam_item, *vht_excl_beam_item, *phi_angle, *psi_angle;
10083   proto_tree *vht_beam_tree, *subtree, *vht_excl_beam_tree, *angletree;
10084   int i, matrix_size, len, pos, ns, scidx = 0, matrix_len;
10085   guint8 phi, psi, carry;
10086   int j, ic, off_len = 0, sscidx = 0, xnsc;
10087   int ir, off_pos, angle_val;
10088   /* Table 8-53d Order of angles in the Compressed Beamforming Feedback
10089    * Matrix subfield, IEEE Std 802.11ac-2013 amendment */
10090   static const guint8 na_arr[8][8] = { {  0,  0,  0,  0,  0,  0,  0,  0 },
10091                                        {  2,  2,  0,  0,  0,  0,  0,  0 },
10092                                        {  4,  6,  6,  0,  0,  0,  0,  0 },
10093                                        {  6, 10, 12, 12,  0,  0,  0,  0 },
10094                                        {  8, 14, 18, 20, 20,  0,  0,  0 },
10095                                        { 10, 18, 24, 28, 30, 30,  0,  0 },
10096                                        { 12, 22, 30, 36, 40, 42, 42,  0 },
10097                                        { 14, 26, 36, 44, 50, 54, 56, 56 }
10098                                      };
10099   /* Table 8-53g Subcarriers for which a Compressed Beamforming Feedback Matrix
10100    * subfield is sent back. IEEE Std 802.11ac-2013 amendment */
10101   static const int ns_arr[4][3] = { {  52,  30,  16 },
10102                                     { 108,  58,  30 },
10103                                     { 234, 122,  62 },
10104                                     { 468, 244, 124 }
10105                                   };
10106
10107   /* Table 8-53j, no of Subcarriers for which the Delta SNR subfield is sent back to the beamformer.
10108    * IEEE Std 802.11ac-2013 amendment */
10109   static const int delta_ns_arr[4][3] = { {  30,  16,  10 },
10110                                           {  58,  30,  16 },
10111                                           { 122,  62,  32 },
10112                                           { 244, 124,  64 }
10113                                         };
10114
10115   vht_mimo = tvb_get_letoh24(tvb, offset);
10116   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_vht_mimo_cntrl,
10117                         ett_ff_vhtmimo_cntrl, hf_ieee80211_ff_vht_mimo_cntrl_fields, ENC_LITTLE_ENDIAN);
10118   offset += 3;
10119
10120   /* Extract values for beamforming use */
10121   nc = (vht_mimo & 0x7) + 1;
10122   nr = ((vht_mimo & 0x38) >> 3) + 1;
10123   chan_width = (vht_mimo & 0xC0) >> 6;
10124   grouping = ((vht_mimo & 0x300) >> 8);
10125   codebook_info = (vht_mimo & 0x400) >> 10;
10126   feedback_type = (vht_mimo & 0x800) >> 11;
10127
10128   if (feedback_type) {
10129     if (codebook_info) {
10130       psi = 7; phi = 9;
10131     } else {
10132       psi = 5; phi = 7;
10133     }
10134   } else {
10135     if (codebook_info) {
10136       psi = 4; phi = 6;
10137     } else {
10138       psi = 2; phi = 4;
10139     }
10140   }
10141
10142   vht_beam_item = proto_tree_add_item(tree, hf_ieee80211_vht_compressed_beamforming_report, tvb,
10143                                   offset, -1, ENC_NA);
10144   vht_beam_tree = proto_item_add_subtree(vht_beam_item, ett_ff_vhtmimo_beamforming_report);
10145
10146   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, nc,
10147                         ett_ff_vhtmimo_beamforming_report_snr, NULL, "Average Signal to Noise Ratio");
10148
10149   for (i = 1; i <= nc; i++)
10150   {
10151     gint8 snr;
10152     char edge_sign;
10153
10154     snr = (gint8) tvb_get_guint8(tvb, offset);
10155
10156     switch(snr) {
10157       case -128:
10158         edge_sign = '<';
10159         break;
10160       case 127:
10161         edge_sign = '>';
10162         break;
10163       default:
10164         edge_sign = ' ';
10165         break;
10166     }
10167
10168     proto_tree_add_int_format(subtree, hf_ieee80211_vht_compressed_beamforming_report_snr, tvb, offset, 1,
10169                                snr, "Stream %d - Signal to Noise Ratio: %c%3.2fdB", i, edge_sign,snr/4.0+22.0);
10170
10171     offset += 1;
10172   }
10173
10174   matrix_size = na_arr[nr - 1][nc -1] * (psi + phi)/2;
10175   if (matrix_size % 8) {
10176     carry = 1;
10177   } else {
10178     carry = 0;
10179   }
10180   off_len = (matrix_size/8) + carry;
10181   angletree = proto_tree_add_subtree_format(vht_beam_tree, tvb, offset, off_len,
10182                         ett_ff_vhtmimo_beamforming_angle, NULL,"PHI and PSI Angle Decode");
10183
10184   off_pos = offset*8;
10185   phi_angle = proto_tree_add_none_format(angletree, hf_ieee80211_vht_compressed_beamforming_phi_angle, tvb, offset, 0, "PHI(%u bits):    ", phi);
10186   for (ic = 1; ic <= nc; ic++) {
10187       for (ir = 1; ir < nr; ir++) {
10188           if (ir >= ic) {
10189               angle_val = (int) tvb_get_bits16(tvb, off_pos, phi, ENC_BIG_ENDIAN);
10190               if ((ir+1 < nr) || (ic+1 <= nc))
10191                 proto_item_append_text(phi_angle, "PHI%d%d: %d, ", ir, ic, angle_val);
10192               else
10193                 proto_item_append_text(phi_angle, "PHI%d%d: %d", ir, ic, angle_val);
10194               off_pos = off_pos + phi;
10195           }
10196       }
10197   }
10198
10199   psi_angle = proto_tree_add_none_format(angletree, hf_ieee80211_vht_compressed_beamforming_psi_angle, tvb, offset, 0, "PSI(%u bits):    ", psi);
10200   for (ic = 1; ic <= nc; ic++)
10201       for (ir = 2; ir <= nr; ir++)
10202           if (ir > ic) {
10203               angle_val = (int) tvb_get_bits8(tvb, off_pos, psi);
10204               if ((ir+1 <= nr) || (ic+1 <= nc))
10205                 proto_item_append_text(psi_angle, "PSI%d%d: %d, ", ir, ic, angle_val);
10206               else
10207                 proto_item_append_text(psi_angle, "PSI%d%d: %d", ir, ic, angle_val);
10208               off_pos = off_pos + psi;
10209           }
10210
10211   /* Table 8-53c Subfields of the VHT MIMO Control field (802.11ac-2013)
10212    * reserves value 3 of the Grouping subfield. */
10213   if (grouping == 3) {
10214     expert_add_info_format(pinfo, vht_beam_item, &ei_ieee80211_inv_val,
10215                            "Grouping subfield value 3 is reserved");
10216     return offset;
10217   }
10218
10219   ns = ns_arr[chan_width][grouping];
10220   if (((matrix_size)*(ns)) % 8)
10221       matrix_len = (((matrix_size) * (ns)) / (8)) + 1;
10222   else
10223       matrix_len = (((matrix_size) * (ns)) / (8));
10224   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, matrix_len,
10225                         ett_ff_vhtmimo_beamforming_report_feedback_matrices, NULL, "Beamforming Feedback Matrix");
10226
10227
10228   switch(chan_width) {
10229     case 0:
10230       scidx = -28;
10231       break;
10232     case 1:
10233       scidx = -58;
10234       break;
10235     case 2:
10236       scidx = -122;
10237       break;
10238     case 3:
10239       /* This is -122 for 80+80MHz Channel Width but vht_mimo_control does not allow us
10240        * to differentiate between 160MHz and 80+80Mhz */
10241       scidx = -250;
10242       break;
10243   }
10244
10245   pos = 0;
10246   for (i = 0; i < ns; i++) {
10247     if (pos % 8)
10248       carry = 1;
10249     else
10250       carry = 0;
10251     len = roundup2((pos + matrix_size), 8)/8 - roundup2(pos, 8)/8;
10252     scidx = vht_compressed_skip_scidx(chan_width, grouping, scidx);
10253
10254     /* TODO : For certain values from na_arr, there is always going be a carry over or overflow from the previous or
10255        into the next octet. The largest of possible unaligned values can be 41 bytes long, and masking and shifting
10256        whole buffers to show correct values with padding and overflow bits is hence skipped, we only mark the bytes
10257        of interest instead */
10258     proto_tree_add_none_format(subtree, hf_ieee80211_vht_compressed_beamforming_feedback_matrix, tvb,
10259                                     offset - carry, len + carry, "Compressed Beamforming Feedback Matrix for subcarrier %d", scidx++);
10260     offset += len;
10261     pos += matrix_size;
10262   }
10263
10264   if (feedback_type) {
10265     xnsc = delta_ns_arr[chan_width][grouping];
10266     if ((nc * xnsc *4) % 8)
10267         off_len = (nc * xnsc *4) / 8 + 1;
10268     else
10269         off_len = (nc * xnsc *4) / 8;
10270     switch(chan_width) {
10271       case 0:
10272         sscidx = -28;
10273         break;
10274       case 1:
10275         sscidx = -58;
10276         break;
10277       case 2:
10278         sscidx = -122;
10279         break;
10280       case 3:
10281         sscidx = -250;
10282         break;
10283     }
10284     vht_excl_beam_item = proto_tree_add_item(tree, hf_ieee80211_vht_mu_exclusive_beamforming_report, tvb, offset, off_len, ENC_NA);
10285     vht_excl_beam_tree = proto_item_add_subtree(vht_excl_beam_item, ett_ff_vhtmu_exclusive_beamforming_report_matrices);
10286
10287     carry = 1;
10288     for (j = 1; j <= xnsc; j++) {
10289       for (ic = 1; ic <= nc; ic++) {
10290         if (carry % 2){
10291           pos = 0;
10292           len = 1;
10293         }
10294         else
10295         {
10296           pos = 1;
10297           len = 0;
10298         }
10299         proto_tree_add_none_format(vht_excl_beam_tree, hf_ieee80211_vht_mu_Exclusive_beamforming_delta_snr, tvb,
10300                                       offset - pos, 1, "Delta SNR for space-time stream %d for subcarrier %d", ic, sscidx);
10301         offset += len;
10302         carry ++;
10303       }
10304       sscidx = vht_exclusive_skip_scidx(chan_width, grouping, sscidx);
10305     }
10306   }
10307
10308   return offset;
10309 }
10310
10311 static guint
10312 add_ff_action_vht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10313 {
10314   guint start = offset;
10315   guint8 vht_action, field_val;
10316   guint64 msa_value;
10317   guint64 upa_value;
10318   int m;
10319   proto_item *ti;
10320   proto_tree *ti_tree;
10321   proto_item *msa, *upa;
10322   proto_tree *msa_tree, *upa_tree;
10323
10324   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10325
10326   vht_action = tvb_get_guint8(tvb, offset);
10327   offset += add_ff_vht_action(tree, tvb, pinfo, offset);
10328
10329   switch(vht_action){
10330     case VHT_ACT_VHT_COMPRESSED_BEAMFORMING:{
10331       offset = add_ff_vht_compressed_beamforming_report(tree, tvb, pinfo, offset);
10332       offset += tvb_reported_length_remaining(tvb, offset);
10333     }
10334     break;
10335     case VHT_ACT_GROUP_ID_MANAGEMENT:{
10336       ti = proto_tree_add_item(tree, hf_ieee80211_vht_group_id_management, tvb,
10337                           offset, -1, ENC_NA);
10338       ti_tree = proto_item_add_subtree(ti, ett_vht_grpidmgmt);
10339
10340       msa_value = tvb_get_letoh64(tvb, offset);
10341       msa = proto_tree_add_item(ti_tree, hf_ieee80211_vht_membership_status_array, tvb,
10342                                 offset, 8, ENC_NA);
10343       msa_tree = proto_item_add_subtree(msa, ett_vht_msa);
10344       for (m = 0; m < 64; m++) {
10345           if (msa_value & (G_GINT64_CONSTANT(1) << m))
10346               proto_tree_add_uint_format(msa_tree, hf_ieee80211_vht_membership_status_field,
10347                                                tvb, offset + (m/8), 1, 1, "Membership Status in Group ID %d: 1", m);
10348       }
10349       offset += 8;
10350
10351       upa = proto_tree_add_item(ti_tree, hf_ieee80211_vht_user_position_array, tvb,
10352                                       offset, 16, ENC_NA);
10353       upa_tree = proto_item_add_subtree(upa, ett_vht_upa);
10354
10355       upa_value = tvb_get_letoh64(tvb, offset);
10356       for (m = 0; m < 32; m++) {
10357           if (msa_value & (G_GINT64_CONSTANT(1) << m)) {
10358               field_val = (guint8) ((upa_value >> m*2) & 0x3);
10359               proto_tree_add_uint_format(upa_tree, hf_ieee80211_vht_user_position_field,
10360                                                tvb, offset + (m/4), 1, field_val, "User Position in Group ID %d: %u", m, field_val);
10361           }
10362       }
10363       upa_value = tvb_get_letoh64(tvb, offset+8);
10364       for (m = 0; m < 32; m++) {
10365           if (msa_value & (G_GINT64_CONSTANT(1) << (32+m))) {
10366               field_val = (guint8) ((upa_value >> m*2) & 0x3);
10367               proto_tree_add_uint_format(upa_tree, hf_ieee80211_vht_user_position_field,
10368                                                tvb, (offset + 8) + (m/4), 1, field_val, "User Position in Group ID %d: %u", m, field_val);
10369           }
10370       }
10371       offset += tvb_reported_length_remaining(tvb, offset);
10372     }
10373     break;
10374     case VHT_ACT_OPERATION_MODE_NOTIFICATION:{
10375       ti = proto_tree_add_item(tree, hf_ieee80211_vht_operation_mode_notification, tvb,
10376                           offset, -1, ENC_NA);
10377       expert_add_info(pinfo, ti, &ei_ieee80211_vht_action);
10378       offset += tvb_reported_length_remaining(tvb, offset);
10379     }
10380     break;
10381     default:
10382     break;
10383   }
10384
10385
10386   return offset - start;
10387 }
10388
10389 #define HE_COMPRESSED_BEAMFORMING_AND_CQI 0
10390 #define HE_QUIET_TIME_PERIOD              1
10391
10392 static const value_string he_action_vals[] = {
10393   { HE_COMPRESSED_BEAMFORMING_AND_CQI, "HE Compressed Beamforming And CQI" },
10394   { HE_QUIET_TIME_PERIOD,              "Quiet Time Period" },
10395   { 0, NULL }
10396 };
10397
10398 static guint
10399 add_ff_he_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
10400   int offset)
10401 {
10402   guint8 he_action = tvb_get_guint8(tvb, offset);
10403
10404   proto_tree_add_uint_format(tree, hf_ieee80211_ff_he_action, tvb, offset, 1,
10405                       he_action, "%s", val_to_str(he_action, he_action_vals,
10406                                                 "Reserved"));
10407   return 1;
10408 }
10409
10410 static const int *he_mimo_control_headers[] = {
10411   &hf_he_mimo_control_nc_index,
10412   &hf_he_mimo_control_nr_index,
10413   &hf_he_mimo_control_bw,
10414   &hf_he_mimo_control_grouping,
10415   &hf_he_mimo_control_codebook_info,
10416   &hf_he_mimo_control_feedback_type,
10417   &hf_he_mimo_control_remaining_feedback_segs,
10418   &hf_he_mimo_control_first_feedback_seg,
10419   &hf_he_mimo_control_ru_start_index,
10420   &hf_he_mimo_control_ru_end_index,
10421   &hf_he_mimo_control_sounding_dialog_token_num,
10422   &hf_he_mimo_control_reserved,
10423   NULL
10424 };
10425
10426 static guint
10427 add_ff_action_he(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10428 {
10429   guint start = offset;
10430   guint8 he_action;
10431
10432   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10433
10434   he_action = tvb_get_guint8(tvb, offset);
10435   offset += add_ff_he_action(tree, tvb, pinfo, offset);
10436
10437   switch (he_action) {
10438   case HE_COMPRESSED_BEAMFORMING_AND_CQI:
10439     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
10440                         hf_ieee80211_he_mimo_control_field, ett_he_mimo_control,
10441                         he_mimo_control_headers, ENC_LITTLE_ENDIAN,
10442                         BMT_NO_APPEND);
10443     offset += 5;
10444     break;
10445   case HE_QUIET_TIME_PERIOD:
10446
10447     break;
10448   default:
10449     break;
10450   }
10451   return offset - start;
10452 }
10453
10454 static guint
10455 add_ff_action_fst(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10456 {
10457   guint8 code;
10458   guint  start = offset;
10459
10460   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10461   code    = tvb_get_guint8(tvb, offset);
10462   offset += add_ff_fst_action_code(tree, tvb, pinfo, offset);
10463   switch (code) {
10464     case FST_SETUP_REQUEST:
10465       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10466       offset += add_ff_llt(tree, tvb, pinfo, offset);
10467       break;
10468     case FST_SETUP_RESPONSE:
10469       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10470       offset += add_ff_status_code(tree, tvb, pinfo, offset);
10471       break;
10472     case FST_TEAR_DOWN:
10473       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
10474       break;
10475     case FST_ACK_REQUEST:
10476       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10477       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
10478       break;
10479     case FST_ACK_RESPONSE:
10480       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10481       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
10482       break;
10483     case FST_ON_CHANNEL_TUNNEL_REQUEST:
10484       offset += add_ff_oct_mmpdu(tree, tvb, pinfo, offset);
10485       break;
10486   }
10487   return offset - start;
10488 }
10489
10490 static guint
10491 add_ff_action_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10492 {
10493   guint8 code;
10494   guint  start = offset;
10495   int left_offset;
10496
10497   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10498   code    = tvb_get_guint8(tvb, offset);
10499   offset += add_ff_dmg_action_code(tree, tvb, pinfo, offset);
10500   switch (code) {
10501     case DMG_ACTION_PWR_SAVE_CONFIG_REQ:
10502       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10503       offset += add_ff_dmg_pwr_mgmt(tree, tvb, pinfo, offset);
10504       break;
10505     case DMG_ACTION_PWR_SAVE_CONFIG_RES:
10506       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10507       offset += add_ff_status_code(tree, tvb, pinfo, offset);
10508       break;
10509     case DMG_ACTION_INFO_REQ:
10510       offset += add_ff_subject_address(tree, tvb, pinfo, offset);
10511       break;
10512     case DMG_ACTION_INFO_RES:
10513       offset += add_ff_subject_address(tree, tvb, pinfo, offset);
10514       break;
10515     case DMG_ACTION_HANDOVER_REQ:
10516       offset += add_ff_handover_reason(tree, tvb, pinfo, offset);
10517       offset += add_ff_handover_remaining_bi(tree, tvb, pinfo, offset);
10518       break;
10519     case DMG_ACTION_HANDOVER_RES:
10520       offset += add_ff_handover_result(tree, tvb, pinfo, offset);
10521       offset += add_ff_handover_reject_reason(tree, tvb, pinfo, offset);
10522       break;
10523     case DMG_ACTION_DTP_REQ:
10524       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10525       break;
10526     case DMG_ACTION_DTP_RES:
10527       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10528       break;
10529     case DMG_ACTION_RELAY_SEARCH_REQ:
10530       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10531       offset += add_ff_destination_reds_aid(tree, tvb, pinfo, offset);
10532       break;
10533     case DMG_ACTION_RELAY_SEARCH_RES:
10534       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10535       offset += add_ff_status_code(tree, tvb, pinfo, offset);
10536       break;
10537     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ:
10538       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10539       break;
10540     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES:
10541       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10542       left_offset =
10543           tvb_reported_length_remaining(tvb, offset);
10544       while(left_offset > 0) {
10545         proto_tree_add_item(tree, hf_ieee80211_ff_peer_sta_aid, tvb, offset, 1, ENC_NA);
10546         proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset+1, 1, ENC_NA);
10547         proto_tree_add_item(tree, hf_ieee80211_ff_internal_angle, tvb, offset+2, 1, ENC_NA);
10548         proto_tree_add_item(tree, hf_ieee80211_ff_recommend, tvb, offset+2, 1, ENC_NA);
10549         /* another reserved byte */
10550         offset += 4;
10551         left_offset -= 4;
10552       }
10553       break;
10554     case DMG_ACTION_RLS_REQ:
10555       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10556       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
10557       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
10558       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
10559       break;
10560     case DMG_ACTION_RLS_RES:
10561       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10562       break;
10563     case DMG_ACTION_RLS_ANNOUNCE:
10564       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10565       offset += add_ff_status_code(tree, tvb, pinfo, offset);
10566       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
10567       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
10568       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
10569       break;
10570     case DMG_ACTION_RLS_TEARDOWN:
10571       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
10572       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
10573       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
10574       break;
10575     case DMG_ACTION_RELAY_ACK_REQ:
10576     case DMG_ACTION_RELAY_ACK_RES:
10577       break;
10578     case DMG_ACTION_TPA_REQ:
10579       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10580       offset += add_ff_timing_offset(tree, tvb, pinfo, offset);
10581       offset += add_ff_sampling_frequency_offset(tree, tvb, pinfo, offset);
10582       break;
10583     case DMG_ACTION_TPA_RES:
10584       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10585       break;
10586     case DMG_ACTION_TPA_REP:
10587       offset += add_ff_status_code(tree, tvb, pinfo, offset);
10588       break;
10589     case DMG_ACTION_ROC_REQ:
10590       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10591       offset += add_ff_relay_operation_type(tree, tvb, pinfo, offset);
10592       break;
10593     case DMG_ACTION_ROC_RES:
10594       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10595       offset += add_ff_status_code(tree, tvb, pinfo, offset);
10596       break;
10597   }
10598   return offset - start;
10599 }
10600
10601 static guint
10602 add_ff_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10603 {
10604   switch (tvb_get_guint8(tvb, offset) & 0x7f) {
10605   case CAT_SPECTRUM_MGMT: /* 0 */
10606     return add_ff_action_spectrum_mgmt(tree, tvb, pinfo, offset);
10607   case CAT_QOS: /* 1 */
10608     return add_ff_action_qos(tree, tvb, pinfo, offset);
10609   case CAT_DLS: /* 2 */
10610     return add_ff_action_dls(tree, tvb, pinfo, offset);
10611   case CAT_BLOCK_ACK: /* 3 */
10612     return add_ff_action_block_ack(tree, tvb, pinfo, offset);
10613   case CAT_PUBLIC: /* 4 */
10614     return add_ff_action_public(tree, tvb, pinfo, offset);
10615   case CAT_RADIO_MEASUREMENT: /* 5 */
10616     return add_ff_action_radio_measurement(tree, tvb, pinfo, offset);
10617   case CAT_FAST_BSS_TRANSITION: /* 6 */
10618     return add_ff_action_fast_bss_transition(tree, tvb, pinfo, offset);
10619   case CAT_HT: /* 7 */
10620     return add_ff_action_ht(tree, tvb, pinfo, offset);
10621   case CAT_SA_QUERY: /* 8 */
10622     return add_ff_action_sa_query(tree, tvb, pinfo, offset);
10623   case CAT_PUBLIC_PROTECTED: /* 9 */
10624     return add_ff_action_protected_public(tree, tvb, pinfo, offset);
10625   case CAT_WNM: /* 10 */
10626     return add_ff_action_wnm(tree, tvb, pinfo, offset);
10627   case CAT_UNPROTECTED_WNM: /* 11 */
10628     return add_ff_action_unprotected_wnm(tree, tvb, pinfo, offset);
10629   case CAT_TDLS: /* 12 */
10630     return add_ff_action_tdls(tree, tvb, pinfo, offset);
10631   case CAT_MESH: /* 13 */
10632     return add_ff_action_mesh(tree, tvb, pinfo, offset);
10633   case CAT_MULTIHOP: /* 14 */
10634     return add_ff_action_multihop(tree, tvb, pinfo, offset);
10635   case CAT_SELF_PROTECTED: /* 15 */
10636     return add_ff_action_self_protected(tree, tvb, pinfo, offset);
10637   case CAT_DMG: /* 16 */
10638     return add_ff_action_dmg(tree, tvb, pinfo, offset);
10639   case CAT_MGMT_NOTIFICATION:  /* Management notification frame - 17 */
10640     return add_ff_action_mgmt_notification(tree, tvb, pinfo, offset);
10641   case CAT_FAST_SESSION_TRANSFER: /* 18 */
10642     return add_ff_action_fst(tree, tvb, pinfo, offset);
10643 /* case CAT_ROBUST_AV_STREAMING:  19 */
10644 /*   return add_ff_action_robust_av_streaming(tree, tvb, pinfo, offset); */
10645   case CAT_UNPROTECTED_DMG: /* 20 */
10646     return add_ff_action_unprotected_dmg(tree, tvb, pinfo, offset);
10647   case CAT_VHT: /* 21 */
10648     return add_ff_action_vht(tree, tvb, pinfo, offset);
10649   case CAT_HE:
10650     return add_ff_action_he(tree, tvb, pinfo, offset);
10651 /*  case CAT_VENDOR_SPECIFIC_PROTECTED:   Vendor Specific Protected Category - 126 */
10652 /*    return add_ff_action_vendor_specific_protected(tree, tvb, pinfo, offset);*/
10653   case CAT_VENDOR_SPECIFIC:  /* Vendor Specific Protected Category - 127 */
10654     return add_ff_action_vendor_specific(tree, tvb, pinfo, offset);
10655   default:
10656     add_ff_category_code(tree, tvb, pinfo, offset);
10657     return 1;
10658   }
10659 }
10660
10661 static const value_string ieee80211_rsn_cipher_vals[] = {
10662   {0, "NONE"},
10663   {1, "WEP (40-bit)"},
10664   {2, "TKIP"},
10665   {3, "AES (OCB)"},
10666   {4, "AES (CCM)"},
10667   {5, "WEP (104-bit)"},
10668   {6, "BIP"},
10669   {7, "Group addressed traffic not allowed"},
10670   {8, "GCMP"},
10671   {0, NULL}
10672 };
10673
10674 static const value_string ieee80211_rsn_keymgmt_vals[] = {
10675   {0, "NONE"},
10676   {1, "WPA"},
10677   {2, "PSK"},
10678   {3, "FT over IEEE 802.1X"},
10679   {4, "FT using PSK"},
10680   {5, "WPA (SHA256)"},
10681   {6, "PSK (SHA256)"},
10682   {7, "TDLS / TPK Handshake"},
10683   {0, NULL}
10684 };
10685
10686 static void
10687 oui_base_custom(gchar *result, guint32 oui)
10688 {
10689   guint8       p_oui[3];
10690   const gchar *manuf_name;
10691
10692   p_oui[0] = oui >> 16 & 0xFF;
10693   p_oui[1] = oui >> 8 & 0xFF;
10694   p_oui[2] = oui & 0xFF;
10695
10696   /* Attempt an OUI lookup. */
10697   manuf_name = uint_get_manuf_name_if_known(oui);
10698   if (manuf_name == NULL) {
10699     /* Could not find an OUI. */
10700     g_snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x", p_oui[0], p_oui[1], p_oui[2]);
10701   }
10702   else {
10703    /* Found an address string. */
10704     g_snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x (%s)", p_oui[0], p_oui[1], p_oui[2], manuf_name);
10705   }
10706 }
10707
10708 static void
10709 rsn_gcs_base_custom(gchar *result, guint32 gcs)
10710 {
10711   gchar oui_result[SHORT_STR];
10712   gchar *tmp_str;
10713
10714   oui_result[0] = '\0';
10715   oui_base_custom(oui_result, gcs >> 8);
10716   tmp_str = val_to_str_wmem(NULL, gcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
10717   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
10718   wmem_free(NULL, tmp_str);
10719 }
10720
10721 static void
10722 rsn_pcs_base_custom(gchar *result, guint32 pcs)
10723 {
10724   gchar oui_result[SHORT_STR];
10725   gchar *tmp_str;
10726
10727   oui_result[0] = '\0';
10728   oui_base_custom(oui_result, pcs >> 8);
10729   tmp_str = val_to_str_wmem(NULL, pcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
10730   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
10731   wmem_free(NULL, tmp_str);
10732
10733 }
10734 static void
10735 rsn_akms_base_custom(gchar *result, guint32 akms)
10736 {
10737   gchar oui_result[SHORT_STR];
10738   gchar *tmp_str;
10739
10740   oui_result[0] = '\0';
10741   oui_base_custom(oui_result, akms >> 8);
10742   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_rsn_keymgmt_vals, "Unknown %d");
10743   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
10744   wmem_free(NULL, tmp_str);
10745 }
10746
10747 static gchar *
10748 rsn_pcs_return(guint32 pcs)
10749 {
10750   gchar *result;
10751
10752   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
10753   result[0] = '\0';
10754   rsn_pcs_base_custom(result, pcs);
10755
10756   return result;
10757 }
10758
10759 static gchar *
10760 rsn_akms_return(guint32 akms)
10761 {
10762   gchar *result;
10763
10764   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
10765   result[0] = '\0';
10766   rsn_akms_base_custom(result, akms);
10767
10768   return result;
10769 }
10770
10771 static void
10772 rsn_gmcs_base_custom(gchar *result, guint32 gmcs)
10773 {
10774   gchar oui_result[SHORT_STR];
10775   gchar *tmp_str;
10776
10777   oui_result[0] = '\0';
10778   oui_base_custom(oui_result, gmcs >> 8);
10779   tmp_str = val_to_str_wmem(NULL, gmcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
10780   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
10781   wmem_free(NULL, tmp_str);
10782 }
10783
10784 static void
10785 rsni_base_custom(gchar *result, guint32 rsni)
10786 {
10787   double temp_double;
10788
10789   temp_double = (double)rsni;
10790   g_snprintf(result, ITEM_LABEL_LENGTH, "%f dB", (temp_double / 2));
10791 }
10792
10793 static void
10794 vht_tpe_custom(gchar *result, guint8 txpwr)
10795 {
10796   gint8 txpwr_db;
10797
10798   txpwr_db = (gint8)(txpwr);
10799   g_snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm", (txpwr_db/2.0));
10800 }
10801
10802 static void
10803 channel_number_custom(gchar *result, guint8 channel_number)
10804 {
10805   switch(channel_number){
10806     case 0:
10807       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels in the specified Operating Class)", channel_number);
10808     break;
10809     case 255:
10810       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels listed in the AP Channel Report)", channel_number);
10811     break;
10812     default :
10813       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on that Channel Number)", channel_number);
10814     break;
10815   }
10816 }
10817
10818 /* WPA / WME */
10819 static const value_string ieee802111_wfa_ie_type_vals[] = {
10820   { 1, "WPA Information Element" },
10821   { 2, "WMM/WME" },
10822   { 4, "WPS" },
10823   { 0, NULL }
10824 };
10825
10826 static const value_string ieee80211_wfa_ie_wpa_cipher_vals[] = {
10827   { 0, "NONE" },
10828   { 1, "WEP (40-bit)" },
10829   { 2, "TKIP" },
10830   { 3, "AES (OCB)" },
10831   { 4, "AES (CCM)" },
10832   { 5, "WEP (104-bit)" },
10833   { 6, "BIP" },
10834   { 7, "Group addressed traffic not allowed" },
10835   { 0, NULL }
10836 };
10837
10838 static const value_string ieee80211_wfa_ie_wpa_keymgmt_vals[] = {
10839   { 0, "NONE" },
10840   { 1, "WPA" },
10841   { 2, "PSK" },
10842   { 3, "FT over IEEE 802.1X" },
10843   { 4, "FT using PSK" },
10844   { 5, "WPA (SHA256)" },
10845   { 6, "PSK (SHA256)" },
10846   { 7, "TDLS / TPK Handshake" },
10847   { 0, NULL }
10848 };
10849
10850 static const value_string ieee80211_wfa_ie_wme_acs_vals[] = {
10851   { 0, "Best Effort" },
10852   { 1, "Background" },
10853   { 2, "Video" },
10854   { 3, "Voice" },
10855   { 0, NULL }
10856 };
10857
10858 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals[] = {
10859   { 0, "Uplink" },
10860   { 1, "Downlink" },
10861   { 2, "Direct link" },
10862   { 3, "Bidirectional link" },
10863   { 0, NULL }
10864 };
10865
10866 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals[] = {
10867   { 0, "Legacy" },
10868   { 1, "U-APSD" },
10869   { 0, NULL }
10870 };
10871
10872 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals[] = {
10873   { 0, "Best Effort" },
10874   { 1, "Background" },
10875   { 2, "Spare" },
10876   { 3, "Excellent Effort" },
10877   { 4, "Controlled Load" },
10878   { 5, "Video" },
10879   { 6, "Voice" },
10880   { 7, "Network Control" },
10881   { 0, NULL }
10882 };
10883
10884 static const value_string ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals[] = {
10885   { 0, "WMM AP may deliver all buffered frames (MSDUs and MMPDUs)" },
10886   { 1, "WMM AP may deliver a maximum of 2 buffered frames (MSDUs and MMPDUs) per USP" },
10887   { 2, "WMM AP may deliver a maximum of 4 buffered frames (MSDUs and MMPDUs) per USP" },
10888   { 3, "WMM AP may deliver a maximum of 6 buffered frames (MSDUs and MMPDUs) per USP" },
10889   { 0, NULL}
10890 };
10891 static const true_false_string ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs = {
10892   "WMM delivery and trigger enabled",
10893   "non-WMM PS"
10894 };
10895
10896 static void
10897 wpa_mcs_base_custom(gchar *result, guint32 mcs)
10898 {
10899   gchar oui_result[SHORT_STR];
10900   gchar *tmp_str;
10901
10902   oui_result[0] = '\0';
10903   oui_base_custom(oui_result, mcs >> 8);
10904   tmp_str = val_to_str_wmem(NULL, mcs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
10905   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
10906   wmem_free(NULL, tmp_str);
10907 }
10908
10909 static void
10910 wpa_ucs_base_custom(gchar *result, guint32 ucs)
10911 {
10912   gchar oui_result[SHORT_STR];
10913   gchar *tmp_str;
10914
10915   oui_result[0] = '\0';
10916   oui_base_custom(oui_result, ucs >> 8);
10917   tmp_str = val_to_str_wmem(NULL, ucs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
10918   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
10919   wmem_free(NULL, tmp_str);
10920 }
10921 static void
10922 wpa_akms_base_custom(gchar *result, guint32 akms)
10923 {
10924   gchar oui_result[SHORT_STR];
10925   gchar *tmp_str;
10926
10927   oui_result[0] = '\0';
10928   oui_base_custom(oui_result, akms >> 8);
10929   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_wfa_ie_wpa_keymgmt_vals, "Unknown %d");
10930   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
10931   wmem_free(NULL, tmp_str);
10932 }
10933
10934 static gchar *
10935 wpa_ucs_return(guint32 ucs)
10936 {
10937   gchar *result;
10938
10939   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
10940   result[0] = '\0';
10941   wpa_ucs_base_custom(result, ucs);
10942
10943   return result;
10944 }
10945
10946 static gchar *
10947 wpa_akms_return(guint32 akms)
10948 {
10949   gchar *result;
10950
10951   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
10952   result[0] = '\0';
10953   wpa_akms_base_custom(result, akms);
10954
10955   return result;
10956 }
10957
10958 /* For each Field */
10959 static const value_string ieee80211_wapi_suite_type[] = {
10960   {0, "Reserved"},
10961   {1, "WAI Certificate Authentication and Key Management"},
10962   {2, "WAI Preshared Key Authentication and Key Management"},
10963   {0, NULL},
10964 };
10965 /* For Summary Tag Information */
10966 static const value_string ieee80211_wapi_suite_type_short[] = {
10967   {0, "Reserved"},
10968   {1, "WAI-CERT"},
10969   {2, "WAI-PSK"},
10970   {0, NULL},
10971 };
10972
10973 static const value_string ieee80211_wapi_cipher_type[] = {
10974   {0, "Reserved"},
10975   {1, "WPI-SMS4"},
10976   {0, NULL},
10977 };
10978
10979 static const value_string ieee802111_wfa_ie_wme_type[] = {
10980   { 0, "Information Element" },
10981   { 1, "Parameter Element" },
10982   { 2, "TSPEC Element" },
10983   { 0, NULL}
10984 };
10985
10986 static const value_string ft_subelem_id_vals[] = {
10987   {0, "Reserved"},
10988   {1, "PMK-R1 key holder identifier (R1KH-ID)"},
10989   {2, "GTK subelement"},
10990   {3, "PMK-R0 key holder identifier (R0KH-ID)"},
10991   {4, "IGTK"},
10992   {0, NULL}
10993 };
10994
10995 static int
10996 dissect_wme_qos_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
10997 {
10998   proto_item *wme_qos_info_item;
10999
11000   static const int *ieee80211_mgt_req[] = {
11001     &hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
11002     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
11003     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
11004     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
11005     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
11006     &hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
11007     NULL
11008   };
11009
11010   static const int *ieee80211_mgt_resp[] = {
11011     &hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
11012     &hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
11013     &hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
11014     NULL
11015   };
11016
11017   switch (ftype) {
11018     case MGT_ASSOC_REQ:
11019     case MGT_PROBE_REQ:
11020     case MGT_REASSOC_REQ:
11021     {
11022       /* To AP so decode as per WMM standard Figure 7 QoS Info field when sent from WMM STA*/
11023       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_qos_info,
11024                                     ett_wme_qos_info, ieee80211_mgt_req,
11025                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11026       break;
11027     }
11028     case MGT_BEACON:
11029     case MGT_PROBE_RESP:
11030     case MGT_ASSOC_RESP:
11031     case MGT_REASSOC_RESP:
11032     {
11033       /* From AP so decode as per WMM standard Figure 6 QoS Info field when sent from WMM AP */
11034       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_qos_info,
11035                                     ett_wme_qos_info, ieee80211_mgt_resp,
11036                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11037       break;
11038     }
11039     default:
11040         wme_qos_info_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_qos_info, tvb, offset, 1, ENC_NA);
11041         expert_add_info_format(pinfo, wme_qos_info_item, &ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype, "Could not deduce direction to decode correctly, ftype %u", ftype);
11042       break;
11043     }
11044
11045   offset += 1;
11046   return offset;
11047 }
11048
11049 static int
11050 decode_qos_parameter_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
11051 {
11052   int i;
11053   /* WME QoS Info Field */
11054   offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
11055   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_reserved, tvb, offset, 1, ENC_NA);
11056   offset += 1;
11057   /* AC Parameters */
11058   for (i = 0; i < 4; i++)
11059   {
11060     proto_item *ac_item, *aci_aifsn_item, *ecw_item;
11061     proto_tree *ac_tree, *ecw_tree;
11062     guint8 aci_aifsn, ecw, ecwmin, ecwmax;
11063     guint16 cwmin, cwmax;
11064     static const int *ieee80211_wfa_ie_wme[] = {
11065         &hf_ieee80211_wfa_ie_wme_acp_aci,
11066         &hf_ieee80211_wfa_ie_wme_acp_acm,
11067         &hf_ieee80211_wfa_ie_wme_acp_aifsn,
11068         &hf_ieee80211_wfa_ie_wme_acp_reserved,
11069         NULL
11070     };
11071
11072     ac_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_ac_parameters, tvb, offset, 4, ENC_NA);
11073     ac_tree = proto_item_add_subtree(ac_item, ett_wme_ac);
11074
11075     /* ACI/AIFSN Field */
11076     aci_aifsn_item = proto_tree_add_bitmask_with_flags(ac_tree, tvb, offset, hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
11077                             ett_wme_aci_aifsn, ieee80211_wfa_ie_wme,
11078                             ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11079     aci_aifsn = tvb_get_guint8(tvb, offset);
11080     /* 802.11-2012, 8.4.2.31 EDCA Parameter Set element */
11081     if (aci_aifsn < 2) {
11082        expert_add_info_format(pinfo, aci_aifsn_item, &ei_ieee80211_qos_bad_aifsn,
11083          "The minimum value for the AIFSN subfield is 2 (found %u).", aci_aifsn);
11084     }
11085     proto_item_append_text(ac_item, " ACI %u (%s), ACM %s, AIFSN %u",
11086       (aci_aifsn & 0x60) >> 5, try_val_to_str((aci_aifsn & 0x60) >> 5, ieee80211_wfa_ie_wme_acs_vals),
11087       (aci_aifsn & 0x10) ? "yes" : "no", aci_aifsn & 0x0f);
11088     offset += 1;
11089
11090     /* ECWmin/ECWmax field */
11091     ecw_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_ecw, tvb, offset, 1, ENC_NA);
11092     ecw_tree = proto_item_add_subtree(ecw_item, ett_wme_ecw);
11093     ecw = tvb_get_guint8(tvb, offset);
11094     ecwmin = ecw & 0x0f;
11095     ecwmax = (ecw & 0xf0) >> 4;
11096     cwmin= (1 << ecwmin) - 1;
11097     cwmax= (1 << ecwmax) - 1;
11098     proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_max, tvb, offset, 1, ENC_NA);
11099     proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_min, tvb, offset, 1, ENC_NA);
11100     proto_tree_add_uint(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_cw_max, tvb, offset, 1, cwmax);
11101     proto_tree_add_uint(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_cw_min, tvb, offset, 1, cwmin);
11102     proto_item_append_text(ac_item, ", ECWmin/max %u/%u (CWmin/max %u/%u)", ecwmin, ecwmax, cwmin, cwmax);
11103     offset += 1;
11104
11105     /* TXOP Limit */
11106     proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_txop_limit, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11107     proto_item_append_text(ac_item, ", TXOP %u", tvb_get_letohs(tvb, offset));
11108     offset += 2;
11109   }
11110
11111   return offset;
11112 }
11113
11114 static int
11115 dissect_vendor_ie_wpawme(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 tag_len, int ftype)
11116 {
11117   guint8 type;
11118
11119   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_type, tvb, offset, 1, ENC_NA);
11120   type = tvb_get_guint8(tvb, offset);
11121   proto_item_append_text(tree, ": %s", val_to_str(type, ieee802111_wfa_ie_type_vals, "Unknown %d"));
11122   offset += 1;
11123
11124   switch (type) {
11125     case 1:   /* Wi-Fi Protected Access (WPA) */
11126     {
11127       proto_item *wpa_mcs_item, *wpa_ucs_item, *wpa_akms_item;
11128       proto_item *wpa_sub_ucs_item, *wpa_sub_akms_item;
11129       proto_tree *wpa_mcs_tree, *wpa_ucs_tree, *wpa_akms_tree;
11130       proto_tree *wpa_sub_ucs_tree, *wpa_sub_akms_tree;
11131       guint16 ucs_count, akms_count;
11132       guint ii;
11133
11134       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11135       offset += 2;
11136
11137       /* Multicast Cipher Suite */
11138       wpa_mcs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_mcs, tvb, offset, 4, ENC_BIG_ENDIAN);
11139       wpa_mcs_tree = proto_item_add_subtree(wpa_mcs_item, ett_wpa_mcs_tree);
11140       proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11141
11142       /* Check if OUI is 00:50:F2 (WFA) */
11143       if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
11144       {
11145         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_wfa_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11146       } else {
11147         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11148       }
11149       offset += 4;
11150
11151       /* Unicast Cipher Suites */
11152       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11153       ucs_count = tvb_get_letohs(tvb, offset);
11154       offset += 2;
11155
11156       wpa_ucs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_list, tvb, offset, ucs_count * 4, ENC_NA);
11157       wpa_ucs_tree = proto_item_add_subtree(wpa_ucs_item, ett_wpa_ucs_tree);
11158       for (ii = 0; ii < ucs_count; ii++)
11159       {
11160         wpa_sub_ucs_item = proto_tree_add_item(wpa_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs, tvb, offset, 4, ENC_BIG_ENDIAN);
11161         wpa_sub_ucs_tree = proto_item_add_subtree(wpa_sub_ucs_item, ett_wpa_sub_ucs_tree);
11162         proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11163
11164         /* Check if OUI is 00:50:F2 (WFA) */
11165         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
11166         {
11167           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11168           proto_item_append_text(wpa_ucs_item, " %s", wpa_ucs_return(tvb_get_ntohl(tvb, offset)));
11169         } else {
11170           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11171         }
11172         offset += 4;
11173       }
11174
11175       /* Authenticated Key Management Suites */
11176       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11177       akms_count = tvb_get_letohs(tvb, offset);
11178       offset += 2;
11179
11180       wpa_akms_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_list, tvb, offset, akms_count * 4, ENC_NA);
11181       wpa_akms_tree = proto_item_add_subtree(wpa_akms_item, ett_wpa_akms_tree);
11182       for (ii = 0; ii < akms_count; ii++)
11183       {
11184         wpa_sub_akms_item = proto_tree_add_item(wpa_akms_tree, hf_ieee80211_wfa_ie_wpa_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
11185         wpa_sub_akms_tree = proto_item_add_subtree(wpa_sub_akms_item, ett_wpa_sub_akms_tree);
11186         proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11187
11188         /* Check if OUI is 00:50:F2 (WFA) */
11189         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
11190         {
11191           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11192           proto_item_append_text(wpa_akms_item, " %s", wpa_akms_return(tvb_get_ntohl(tvb, offset)));
11193         } else {
11194           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11195         }
11196         offset += 4;
11197       }
11198       break;
11199     }
11200     case 2:   /* Wireless Multimedia Enhancements (WME) */
11201     {
11202       guint8 subtype;
11203
11204       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_subtype, tvb, offset, 1, ENC_NA);
11205       subtype = tvb_get_guint8(tvb, offset);
11206       proto_item_append_text(tree, ": %s", val_to_str(subtype, ieee802111_wfa_ie_wme_type, "Unknown %d"));
11207       offset += 1;
11208       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_version, tvb, offset, 1, ENC_NA);
11209       offset += 1;
11210       switch (subtype) {
11211         case 0: /* WME Information Element */
11212         {
11213           /* WME QoS Info Field */
11214           offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
11215           break;
11216         }
11217         case 1: /* WME Parameter Element */
11218         {
11219           offset = decode_qos_parameter_set(tree, tvb, pinfo, offset, ftype);
11220           break;
11221         }
11222         case 2:   /* WME TSPEC Element */
11223         {
11224             static const int *ieee80211_wfa_ie_wme_tspec_tsinfo[] = {
11225               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
11226               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
11227               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
11228               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
11229               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
11230               NULL
11231             };
11232
11233             proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
11234                                     ett_tsinfo_tree, ieee80211_wfa_ie_wme_tspec_tsinfo,
11235                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11236             offset += 3;
11237
11238             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11239             offset += 2;
11240
11241             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11242             offset += 2;
11243
11244             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11245             offset += 4;
11246
11247             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11248             offset += 4;
11249
11250             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11251             offset += 4;
11252
11253             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11254             offset += 4;
11255
11256             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11257             offset += 4;
11258
11259             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11260             offset += 4;
11261
11262             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11263             offset += 4;
11264
11265             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11266             offset += 4;
11267
11268             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11269             offset += 4;
11270
11271             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11272             offset += 4;
11273
11274             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11275             offset += 4;
11276
11277             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11278             offset += 2;
11279
11280             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11281             offset += 2;
11282
11283           break;
11284         }
11285         default:
11286           /* No default Action */
11287         break;
11288       } /* End switch (subtype) */
11289       break;
11290     }
11291     case 4: /* WPS: Wifi Protected Setup */
11292     {
11293       dissect_wps_tlvs(tree, tvb, offset, tag_len-1, NULL);
11294     }
11295     break;
11296     default:
11297       /* No default Action...*/
11298     break;
11299   } /* End switch (type) */
11300
11301   return offset;
11302 }
11303
11304 static const value_string hs20_indication_release_number_vals[] = {
11305   { 0, "Release 1" },
11306   { 1, "Release 2" },
11307   { 0, NULL }
11308 };
11309
11310 static int
11311 dissect_hs20_indication(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
11312 {
11313   static const int *ieee80211_hs20_indication[] = {
11314     &hf_hs20_indication_dgaf_disabled,
11315     &hf_hs20_indication_pps_mo_id_present,
11316     &hf_hs20_indication_anqp_domain_id_present,
11317     &hf_hs20_indication_release_number,
11318     NULL
11319   };
11320
11321   proto_tree_add_bitmask_list(tree, tvb, 0, 1, ieee80211_hs20_indication, ENC_LITTLE_ENDIAN);
11322   return tvb_captured_length(tvb);
11323 }
11324
11325 static void
11326 dissect_vendor_ie_wfa(packet_info *pinfo, proto_item *item, tvbuff_t *tag_tvb)
11327 {
11328   gint tag_len = tvb_reported_length(tag_tvb);
11329   guint8 subtype;
11330   int offset = 0;
11331   tvbuff_t *vendor_tvb;
11332
11333   if (tag_len < 4)
11334     return;
11335
11336   subtype = tvb_get_guint8(tag_tvb, 3);
11337   proto_item_append_text(item, ": %s", val_to_str_const(subtype, wfa_subtype_vals, "Unknown"));
11338   vendor_tvb = tvb_new_subset_length(tag_tvb, offset + 4, tag_len - 4);
11339   dissector_try_uint_new(wifi_alliance_ie_table, subtype, vendor_tvb, pinfo, item, FALSE, NULL);
11340 }
11341
11342 static void
11343 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
11344 {
11345
11346   switch(tvb_get_guint8(tvb, offset)){
11347     case 4:
11348     {
11349       /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
11350        * This is only used within EAPOL-Key frame Key Data. */
11351       offset += 1;
11352       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_pmkid, tvb, offset, 16, ENC_NA);
11353     }
11354     break;
11355     default:
11356       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_unknown, tvb, offset, tag_len, ENC_NA);
11357     break;
11358   }
11359
11360   proto_item_append_text(item, ": RSN");
11361
11362 }
11363
11364 typedef enum {
11365   MARVELL_IE_MESH = 4
11366 } marvell_ie_type_t;
11367
11368 static void
11369 dissect_vendor_ie_marvell(proto_item *item _U_, proto_tree *ietree,
11370                           tvbuff_t *tvb, int offset, guint32 tag_len)
11371 {
11372   guint8 type;
11373
11374   type = tvb_get_guint8(tvb, offset);
11375   proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11376   offset += 1;
11377
11378   switch (type) {
11379   case MARVELL_IE_MESH:
11380     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_subtype, tvb,
11381                          offset++, 1, ENC_LITTLE_ENDIAN);
11382     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_version, tvb,
11383                          offset++, 1, ENC_LITTLE_ENDIAN);
11384     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_active_proto_id, tvb,
11385                          offset++, 1, ENC_LITTLE_ENDIAN);
11386     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_active_metric_id, tvb,
11387                          offset++, 1, ENC_LITTLE_ENDIAN);
11388     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_cap, tvb,
11389                          offset++, 1, ENC_LITTLE_ENDIAN);
11390     break;
11391
11392   default:
11393     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_data, tvb, offset,
11394       tag_len - 1, ENC_NA);
11395     break;
11396   }
11397 }
11398
11399 typedef enum {
11400   ATHEROS_IE_ADVCAP = 1,
11401   ATHEROS_IE_XR = 3
11402 } atheros_ie_type_t;
11403
11404 typedef enum {
11405   ATHEROS_IE_ADVCAP_S = 1
11406 } atheros_ie_advcap_subtype_t;
11407
11408 typedef enum {
11409   ATHEROS_IE_XR_S = 1
11410 } atheros_ie_xr_subtype_t;
11411
11412 typedef enum {
11413   ATHEROS_IE_CAP_TURBOP = 0x01,
11414   ATHEROS_IE_CAP_COMP   = 0x02,
11415   ATHEROS_IE_CAP_FF     = 0x04,
11416   ATHEROS_IE_CAP_XR     = 0x08,
11417   ATHEROS_IE_CAP_AR     = 0x10,
11418   ATHEROS_IE_CAP_BURST  = 0x20,
11419   ATHEROS_IE_CAP_WME    = 0x40,
11420   ATHEROS_IE_CAP_BOOST  = 0x80
11421 } atheros_ie_cap_t;
11422
11423 static const value_string atheros_ie_type_vals[] = {
11424   { ATHEROS_IE_ADVCAP, "Advanced Capability"},
11425   { ATHEROS_IE_XR,     "eXtended Range"},
11426   { 0,                 NULL }
11427 };
11428
11429 static const int *ieee80211_atheros_ie_cap[] = {
11430   &hf_ieee80211_atheros_ie_cap_f_turbop,
11431   &hf_ieee80211_atheros_ie_cap_f_comp,
11432   &hf_ieee80211_atheros_ie_cap_f_ff,
11433   &hf_ieee80211_atheros_ie_cap_f_xr,
11434   &hf_ieee80211_atheros_ie_cap_f_ar,
11435   &hf_ieee80211_atheros_ie_cap_f_burst,
11436   &hf_ieee80211_atheros_ie_cap_f_wme,
11437   &hf_ieee80211_atheros_ie_cap_f_boost,
11438   NULL
11439 };
11440
11441 static void
11442 dissect_vendor_ie_atheros(proto_item *item _U_, proto_tree *ietree,
11443                           tvbuff_t *tvb, int offset, guint tag_len,
11444                           packet_info *pinfo, proto_item *ti_len)
11445 {
11446   guint8      type;
11447   guint8      subtype;
11448   guint8      version;
11449
11450   if (tag_len <= 3) {
11451         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 6", tag_len+3); /* Add length of OUI to tag_length */
11452         return;
11453   }
11454   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_type, tvb, offset, 1, ENC_NA);
11455   type = tvb_get_guint8(tvb, offset);
11456   proto_item_append_text(item, ": %s", val_to_str_const(type, atheros_ie_type_vals, "Unknown"));
11457   offset  += 1;
11458   tag_len -= 1;
11459
11460   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_subtype, tvb, offset, 1, ENC_NA);
11461   subtype  = tvb_get_guint8(tvb, offset);
11462   offset  += 1;
11463   tag_len -= 1;
11464
11465   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_version, tvb, offset, 1, ENC_NA);
11466   version  = tvb_get_guint8(tvb, offset);
11467   offset  += 1;
11468   tag_len -= 1;
11469
11470   if (version == 0)
11471   {
11472     switch (type) {
11473       case ATHEROS_IE_ADVCAP:
11474       {
11475         switch (subtype) {
11476           case ATHEROS_IE_ADVCAP_S:
11477           {
11478             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_advcap_cap,
11479                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
11480                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11481             offset   += 1;
11482             tag_len  -= 1;
11483
11484             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_defkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11485             offset  += 2;
11486             tag_len -= 2;
11487             break;
11488           }
11489           default:
11490           /* No default Action */
11491           break;
11492         } /* End switch (subtype) */
11493         break;
11494       }
11495       case ATHEROS_IE_XR:
11496       {
11497         switch (subtype) {
11498           case ATHEROS_IE_XR_S:
11499           {
11500             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_info, tvb, offset, 1, ENC_NA);
11501             offset  += 1;
11502             tag_len -= 1;
11503
11504             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_bssid, tvb, offset, 6, ENC_NA);
11505             offset  += 6;
11506             tag_len -= 6;
11507
11508             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_bssid, tvb, offset, 6, ENC_NA);
11509             offset  += 6;
11510             tag_len -= 6;
11511
11512             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11513             offset  += 2;
11514             tag_len -= 2;
11515
11516             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_xr_base_cap,
11517                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
11518                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11519             offset   += 1;
11520             tag_len  -= 1;
11521
11522             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_xr_xr_cap,
11523                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
11524                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11525             offset   += 1;
11526             tag_len  -= 1;
11527             break;
11528           }
11529           default:
11530           /* No default Action */
11531           break;
11532         } /* End switch (subtype) */
11533         break;
11534         default:
11535         /* No default Action */
11536         break;
11537       } /* End switch (type) */
11538
11539     }
11540   }
11541   if (tag_len > 0) {
11542     proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_data, tvb, offset, tag_len, ENC_NA);
11543   }
11544 }
11545
11546 typedef enum {
11547   AIRONET_IE_DTPC = 0,
11548   AIRONET_IE_UNKNOWN1 = 1,
11549   AIRONET_IE_VERSION = 3,
11550   AIRONET_IE_QOS,
11551   AIRONET_IE_UNKNOWN11 = 11,
11552   AIRONET_IE_QBSS_V2 = 14,
11553   AIRONET_IE_CLIENT_MFP = 20
11554 } aironet_ie_type_t;
11555
11556 static const value_string aironet_ie_type_vals[] = {
11557   { AIRONET_IE_DTPC,      "DTPC"},
11558   { AIRONET_IE_UNKNOWN1,  "Unknown (1)"},
11559   { AIRONET_IE_VERSION,   "CCX version"},
11560   { AIRONET_IE_QOS,       "Qos"},
11561   { AIRONET_IE_UNKNOWN11, "Unknown (11)"},
11562   { AIRONET_IE_QBSS_V2,   "QBSS V2 - CCA"},
11563   { AIRONET_IE_CLIENT_MFP, "Client MFP"},
11564   { 0,                    NULL }
11565 };
11566
11567 static const value_string aironet_mfp_vals[] = {
11568   { 0,      "Disabled"},
11569   { 1,      "Enabled"},
11570   { 0,      NULL }
11571 };
11572
11573 static void
11574 dissect_vendor_ie_aironet(proto_item *aironet_item, proto_tree *ietree,
11575                           tvbuff_t *tvb, int offset, guint32 tag_len)
11576 {
11577   guint8  type;
11578   int i;
11579   gboolean dont_change = FALSE; /* Don't change the IE item text to default */
11580
11581   type = tvb_get_guint8(tvb, offset);
11582   proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11583   offset += 1;
11584
11585   switch (type) {
11586   case AIRONET_IE_DTPC:
11587     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_dtpc, tvb, offset, 1, ENC_NA);
11588     proto_item_append_text(aironet_item, ": Aironet DTPC Powerlevel %ddBm", tvb_get_guint8(tvb, offset));
11589     offset += 1;
11590     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_dtpc_unknown, tvb, offset, 1, ENC_NA);
11591     dont_change = TRUE;
11592     break;
11593   case AIRONET_IE_VERSION:
11594     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11595     proto_item_append_text(aironet_item, ": Aironet CCX version = %d", tvb_get_guint8(tvb, offset));
11596     dont_change = TRUE;
11597     break;
11598   case AIRONET_IE_QOS:
11599     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_qos_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11600     offset += 1;
11601     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_qos_paramset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11602     offset += 1;
11603
11604     /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
11605      *  need to be swapped. Also, the "TXOP" may be TXOP - or not.
11606      */
11607     for (i = 0; i < 4; i++) {
11608       guint8 byte1, byte2;
11609       guint16 txop;
11610       byte1 = tvb_get_guint8(tvb, offset);
11611       byte2 = tvb_get_guint8(tvb, offset + 1);
11612       txop = tvb_get_letohs(tvb, offset + 2);
11613       proto_tree_add_bytes_format(ietree, hf_ieee80211_aironet_ie_qos_val, tvb, offset, 4, NULL,
11614           "CCX QoS Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
11615         (byte1 & 0x60) >> 5, val_to_str((byte1 & 0x60) >> 5, wme_acs, "(Unknown: %d)"),
11616         (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
11617         byte2 & 0x0f, (byte2 & 0xf0) >> 4,
11618         txop);
11619       offset += 4;
11620     }
11621     break;
11622   case AIRONET_IE_QBSS_V2:
11623     /* Extract Values */
11624     proto_tree_add_item(ietree, hf_ieee80211_qbss2_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11625     proto_tree_add_item(ietree, hf_ieee80211_qbss2_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
11626     proto_tree_add_item(ietree, hf_ieee80211_qbss2_cal, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11627     proto_tree_add_item(ietree, hf_ieee80211_qbss2_gl, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
11628     break;
11629   case AIRONET_IE_CLIENT_MFP:
11630     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_clientmfp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11631     proto_item_append_text(aironet_item, ": Aironet Client MFP %s",
11632       val_to_str_const(1 & tvb_get_guint8(tvb, offset), aironet_mfp_vals, "Unknown"));
11633     dont_change = TRUE;
11634     break;
11635   default:
11636     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_data, tvb, offset,
11637       tag_len - 1, ENC_NA);
11638     break;
11639   }
11640   if (!dont_change) {
11641     proto_item_append_text(aironet_item, ": Aironet %s (%d)",
11642       val_to_str_const(type, aironet_ie_type_vals, "Unknown"), type);
11643   }
11644 }
11645
11646 #define ARUBA_APNAME  3
11647 static const value_string ieee80211_vs_aruba_subtype_vals[] = {
11648   { ARUBA_APNAME, "AP Name"},
11649   { 0,                 NULL }
11650 };
11651 static void
11652 dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree,
11653                           tvbuff_t *tvb, int offset, guint32 tag_len)
11654 {
11655   guint8 type;
11656   const guint8* name;
11657
11658   offset += 1; /* VS OUI Type */
11659   tag_len -= 1;
11660
11661   type = tvb_get_guint8(tvb, offset);
11662   proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_subtype, tvb, offset, 1, ENC_NA);
11663   proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aruba_subtype_vals, "Unknown"));
11664   offset += 1;
11665   tag_len -= 1;
11666
11667   switch (type) {
11668   case ARUBA_APNAME:
11669     offset += 1;
11670     tag_len -= 1;
11671
11672     proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aruba_apname, tvb,
11673                          offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name);
11674     proto_item_append_text(item, " (%s)", name);
11675     break;
11676
11677   default:
11678     proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_data, tvb, offset,
11679       tag_len, ENC_NA);
11680     proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len));
11681     break;
11682   }
11683 }
11684
11685 static void
11686 dissect_vendor_ie_mikrotik(proto_item *item _U_, proto_tree *ietree,
11687                           tvbuff_t *tvb, int offset, guint32 tag_len)
11688 {
11689   guint8 type, length;
11690   proto_item *subitem;
11691   proto_tree *subtree;
11692
11693   offset += 1; /* VS OUI Type */
11694   tag_len -= 1;
11695   /* FIXME: Make sure we have at least 2 bytes left */
11696   proto_tree_add_item(ietree, hf_ieee80211_vs_mikrotik_unknown, tvb, offset, 2, ENC_NA);
11697
11698   offset += 2;
11699   tag_len -= 2;
11700
11701   while (tag_len >= 2) {
11702     type = tvb_get_guint8(tvb, offset);
11703     length = tvb_get_guint8(tvb, offset+1);
11704     subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_mikrotik_subitem, tvb, offset, length+2, ENC_NA);
11705     subtree = proto_item_add_subtree(subitem, ett_mikrotik);
11706     proto_item_set_text(subitem, "Sub IE (T/L: %d/%d)", type, length);
11707
11708     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_subtype, tvb, offset, 1, ENC_NA);
11709     offset += 1;
11710     tag_len -= 1;
11711
11712     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_sublength, tvb, offset, 1, ENC_NA);
11713     offset += 1;
11714     tag_len -= 1;
11715
11716     if (tag_len < length)
11717       /* FIXME: warn about this */
11718       length = tag_len;
11719     if (length == 0) {
11720       break;
11721     }
11722
11723     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_subdata, tvb, offset, length, ENC_NA);
11724     offset += length;
11725     tag_len -= length;
11726   }
11727 }
11728
11729 enum vs_nintendo_type {
11730   NINTENDO_SERVICES = 0x11,
11731   NINTENDO_CONSOLEID = 0xF0
11732 };
11733
11734 static const value_string ieee80211_vs_nintendo_type_vals[] = {
11735   { NINTENDO_SERVICES,  "Services"},
11736   { NINTENDO_CONSOLEID, "ConsoleID"},
11737   { 0, NULL }
11738 };
11739
11740 static proto_tree*
11741 dissect_vendor_ie_nintendo_tlv(const int hfindex, proto_tree *ietree,
11742                           tvbuff_t *tvb, int offset, guint32 sublen)
11743 {
11744   proto_item *nintendo_item;
11745   proto_tree *nintendo_tree;
11746
11747   nintendo_item = proto_tree_add_item(ietree, hfindex, tvb, offset, sublen, ENC_NA);
11748   nintendo_tree = proto_item_add_subtree(nintendo_item, ett_nintendo);
11749
11750   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_type, tvb, offset, 1, ENC_NA);
11751   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_length, tvb, offset + 1,  1, ENC_NA);
11752
11753   return nintendo_tree;
11754 }
11755
11756 static void
11757 dissect_vendor_ie_nintendo(proto_item *item _U_, proto_tree *ietree,
11758                           tvbuff_t *tvb, int offset, guint32 tag_len)
11759 {
11760   proto_tree *nintendo_tree;
11761
11762   guint8      subtype;
11763   guint8      sublength;
11764   guint32     length = tag_len;
11765
11766   /* Skip OUI type for now - the code is for type 1 (StreetPass) only */
11767   /* http://3dbrew.org/wiki/StreetPass */
11768   offset += 1;
11769   length -= 1;
11770
11771   while(length > 0 && length < 256) { /* otherwise we are < 0 but on unsigned */
11772     subtype = tvb_get_guint8(tvb, offset);
11773     sublength = tvb_get_guint8(tvb, offset + 1);
11774
11775     switch(subtype) {
11776     case NINTENDO_SERVICES:
11777       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_servicelist, ietree, tvb, offset, sublength + 2);
11778       offset += 2;
11779       length -= 2;
11780
11781       while (sublength > 4) {
11782
11783         proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_service, tvb, offset, 5, ENC_NA);
11784         offset += 5;
11785         length -= 5;
11786         sublength -= 5;
11787       }
11788       break;
11789     case NINTENDO_CONSOLEID:
11790       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_consoleid, ietree, tvb, offset, sublength + 2);
11791       offset += + 2;
11792       length -= + 2;
11793
11794       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_consoleid, tvb, offset, sublength, ENC_NA);
11795       offset += sublength;
11796       length -= sublength;
11797       break;
11798     default:
11799       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_unknown, ietree, tvb, offset, sublength + 2);
11800       offset += + 2;
11801       length -= + 2;
11802
11803       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_unknown, tvb, offset, sublength, ENC_NA);
11804       offset += sublength;
11805       length -= sublength;
11806       break;
11807     }
11808   }
11809 }
11810
11811 static void
11812 dissect_vendor_ie_meru(proto_item *item _U_, proto_tree *ietree,
11813                        tvbuff_t *tvb, int offset, guint32 tag_len,
11814                        packet_info *pinfo)
11815 {
11816   guint32 type, length;
11817   proto_item *subitem, *ti_len;
11818   proto_tree *subtree;
11819
11820   while (tag_len >= 2) {
11821     subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_meru_subitem, tvb, offset, 2, ENC_NA);
11822     subtree = proto_item_add_subtree(subitem, ett_meru);
11823
11824     proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_subtype, tvb, offset, 1, ENC_NA, &type);
11825     offset += 1;
11826     tag_len -= 1;
11827
11828     ti_len = proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_sublength, tvb, offset, 1, ENC_NA, &length);
11829     offset += 1;
11830     tag_len -= 1;
11831
11832     if (tag_len < length) {
11833       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < Sub Length");
11834       length = tag_len;
11835     }
11836
11837     proto_item_append_text(subitem, " (t=%d, l=%d)", type, length);
11838     proto_item_set_len(subitem, 2+length);
11839
11840     proto_tree_add_item(subtree, hf_ieee80211_vs_meru_subdata, tvb, offset, length, ENC_NA);
11841     offset += length;
11842     tag_len -= length;
11843
11844   }
11845 }
11846
11847 static const value_string ieee80211_vs_extreme_subtype_vals[] = {
11848   { 1, "AP Name"},
11849   { 0, NULL }
11850 };
11851
11852 static void
11853 dissect_vendor_ie_extreme(proto_item *item _U_, proto_tree *ietree,
11854                           tvbuff_t *tvb, int offset, guint32 tag_len,
11855                           packet_info *pinfo)
11856 {
11857   guint32 type, length;
11858   proto_item *ti_len;
11859
11860   proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_extreme_subtype, tvb, offset, 1, ENC_NA, &type);
11861   offset += 1;
11862   tag_len -= 1;
11863
11864   proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_subdata, tvb, offset, tag_len, ENC_NA);
11865
11866   switch(type){
11867     case 1: /* Unknown (7 bytes) + AP Name Length (1 byte) + AP Name */
11868
11869       proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_unknown, tvb, offset, 7, ENC_NA);
11870       offset += 7;
11871       tag_len -= 1;
11872
11873       ti_len = proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_extreme_ap_length, tvb, offset, 1, ENC_NA, &length);
11874       offset += 1;
11875       tag_len -= 1;
11876
11877       if (tag_len < length) {
11878         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < AP Length");
11879         length = tag_len;
11880       }
11881
11882     proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA);
11883
11884     break;
11885     default:
11886     /* Expert info ? */
11887     break;
11888   }
11889 }
11890
11891 /* 802.11-2012 8.4.2.37 QoS Capability element */
11892 static int
11893 dissect_qos_capability(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
11894 {
11895   switch (ftype) {
11896     case MGT_ASSOC_REQ:
11897     case MGT_PROBE_REQ:
11898     case MGT_REASSOC_REQ:
11899     {
11900       /* To AP so decode Qos Info as STA */
11901       offset += add_ff_qos_info_sta(tree, tvb, pinfo, offset);
11902       break;
11903     }
11904
11905     case MGT_BEACON:
11906     case MGT_PROBE_RESP:
11907     case MGT_ASSOC_RESP:
11908     case MGT_REASSOC_RESP:
11909     {
11910       /* From AP so decode QoS Info as AP */
11911       offset += add_ff_qos_info_ap(tree, tvb, pinfo, offset);
11912       break;
11913     }
11914
11915     default:
11916       expert_add_info_format(pinfo, proto_tree_get_parent(tree), &ei_ieee80211_qos_info_bad_ftype,
11917                              "Could not deduce direction to decode correctly, ftype %u", ftype);
11918       break;
11919   }
11920
11921   return offset;
11922 }
11923
11924 /* 7.3.2.25 RSN information element */
11925 static int
11926 dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
11927                int offset, guint32 tag_len, association_sanity_check_t *association_sanity_check)
11928 {
11929   proto_item *rsn_gcs_item, *rsn_pcs_item, *rsn_akms_item, *rsn_pmkid_item, *rsn_gmcs_item;
11930   proto_item *rsn_sub_pcs_item, *rsn_sub_akms_item;
11931   proto_item *rsn_pcs_count, *rsn_akms_count, *rsn_pmkid_count;
11932   proto_tree *rsn_gcs_tree, *rsn_pcs_tree, *rsn_akms_tree, *rsn_pmkid_tree, *rsn_gmcs_tree;
11933   proto_tree *rsn_sub_pcs_tree, *rsn_sub_akms_tree;
11934   guint16     pcs_count, akms_count, pmkid_count;
11935   guint       ii;
11936   int         tag_end = offset + tag_len;
11937   static const int *ieee80211_rsn_cap[] = {
11938     &hf_ieee80211_rsn_cap_preauth,
11939     &hf_ieee80211_rsn_cap_no_pairwise,
11940     &hf_ieee80211_rsn_cap_ptksa_replay_counter,
11941     &hf_ieee80211_rsn_cap_gtksa_replay_counter,
11942     &hf_ieee80211_rsn_cap_mfpr,
11943     &hf_ieee80211_rsn_cap_mfpc,
11944     &hf_ieee80211_rsn_cap_jmr,
11945     &hf_ieee80211_rsn_cap_peerkey,
11946     NULL
11947   };
11948
11949   proto_tree_add_item(tree, hf_ieee80211_rsn_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11950   offset += 2;
11951
11952   /* 7.3.2.25.1 Group Cipher suites */
11953   rsn_gcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gcs, tvb, offset, 4, ENC_BIG_ENDIAN);
11954   rsn_gcs_tree = proto_item_add_subtree(rsn_gcs_item, ett_rsn_gcs_tree);
11955   proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11956
11957     /* Check if OUI is 00:0F:AC (ieee80211) */
11958   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
11959   {
11960     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11961   } else {
11962     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11963   }
11964   offset += 4;
11965
11966   /* 7.3.2.25.2 Pairwise Cipher suites */
11967   rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11968   pcs_count = tvb_get_letohs(tvb, offset);
11969   offset += 2;
11970
11971   if (offset + (pcs_count * 4) > tag_end)
11972   {
11973     expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
11974         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
11975     pcs_count = (tag_end - offset) / 4;
11976   }
11977
11978   rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
11979   rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
11980   for (ii = 0; ii < pcs_count; ii++)
11981   {
11982     rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
11983     rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
11984     proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11985
11986     /* Check if OUI is 00:0F:AC (ieee80211) */
11987     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
11988     {
11989       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11990       proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
11991     } else {
11992       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11993     }
11994     offset += 4;
11995   }
11996
11997   if (offset >= tag_end)
11998   {
11999     return offset;
12000   }
12001
12002   /* 7.3.2.25.2 AKM suites */
12003   rsn_akms_count = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12004   akms_count = tvb_get_letohs(tvb, offset);
12005   offset += 2;
12006
12007   if (offset + (akms_count * 4) > tag_end)
12008   {
12009     expert_add_info_format(pinfo, rsn_akms_count, &ei_ieee80211_rsn_pmkid_count,
12010         "Auth Key Management (AKM) Suite Count too large, 4*%u > %d", akms_count, tag_end - offset);
12011     akms_count = (tag_end - offset) / 4;
12012   }
12013
12014   rsn_akms_item = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_list, tvb, offset, akms_count * 4, ENC_NA);
12015   rsn_akms_tree = proto_item_add_subtree(rsn_akms_item, ett_rsn_akms_tree);
12016   for (ii = 0; ii < akms_count; ii++)
12017   {
12018     rsn_sub_akms_item = proto_tree_add_item(rsn_akms_tree, hf_ieee80211_rsn_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
12019     rsn_sub_akms_tree = proto_item_add_subtree(rsn_sub_akms_item, ett_rsn_sub_akms_tree);
12020     proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
12021
12022     /* Check if OUI is 00:0F:AC (ieee80211) */
12023     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
12024     {
12025       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
12026       proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(tvb_get_ntohl(tvb, offset)));
12027
12028       if (association_sanity_check) {
12029         guint32 akm_suite = tvb_get_ntohl(tvb, offset);
12030         if (akm_suite == 0x000FAC03 || akm_suite == 0x000FAC04 || akm_suite == 0x000FAC09) {
12031           /* This is an FT AKM suite */
12032           association_sanity_check->has_ft_akm_suite = TRUE;
12033           if (association_sanity_check->rsn_first_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
12034             association_sanity_check->rsn_first_ft_akm_suite = rsn_sub_akms_tree->last_child;
12035           }
12036         } else {
12037           /* This is a non-FT AKM suite */
12038           association_sanity_check->has_non_ft_akm_suite = TRUE;
12039           if (association_sanity_check->rsn_first_non_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
12040             association_sanity_check->rsn_first_non_ft_akm_suite = rsn_sub_akms_tree->last_child;
12041           }
12042         }
12043       }
12044     } else {
12045       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
12046     }
12047     offset += 4;
12048   }
12049
12050   /* 7.3.2.25.3 RSN capabilities */
12051   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_rsn_cap,
12052                                     ett_rsn_cap_tree, ieee80211_rsn_cap,
12053                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12054   offset += 2;
12055   if (offset >= tag_end)
12056   {
12057     return offset;
12058   }
12059   /* 7.3.2.25.4 PMKID */
12060   rsn_pmkid_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12061   pmkid_count = tvb_get_letohs(tvb, offset);
12062   offset += 2;
12063
12064   if (offset + (pmkid_count * 16) > tag_end)
12065   {
12066     expert_add_info_format(pinfo, rsn_pmkid_count, &ei_ieee80211_pmkid_count_too_large,
12067         "PMKID Count too large, 16*%u > %d", pmkid_count, tag_end - offset);
12068     pmkid_count = (tag_end - offset) / 16;
12069   }
12070
12071   rsn_pmkid_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_list, tvb, offset, pmkid_count * 16, ENC_NA);
12072   rsn_pmkid_tree = proto_item_add_subtree(rsn_pmkid_item, ett_rsn_pmkid_tree);
12073   for (ii = 0; ii < pmkid_count; ii++)
12074   {
12075     proto_tree_add_item(rsn_pmkid_tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
12076     offset += 16;
12077   }
12078
12079   if (offset >= tag_end)
12080   {
12081     return offset;
12082   }
12083   /* Group Management Cipher Suite (802.11w)*/
12084   rsn_gmcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gmcs, tvb, offset, 4, ENC_BIG_ENDIAN);
12085   rsn_gmcs_tree = proto_item_add_subtree(rsn_gmcs_item, ett_rsn_gmcs_tree);
12086   proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
12087   /* Check if OUI is 00:0F:AC (ieee80211) */
12088   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
12089   {
12090     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
12091   } else {
12092     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
12093   }
12094   offset += 4;
12095
12096   return offset;
12097 }
12098
12099 /* 7.3.2.27 Extended Capabilities information element (127) */
12100 static int
12101 dissect_extended_capabilities_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12102 {
12103   int tag_len = tvb_reported_length(tvb);
12104   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12105   int offset = 0;
12106   proto_item *ti_ex_cap;
12107   static const int *ieee80211_tag_extended_capabilities_byte1[] = {
12108     &hf_ieee80211_tag_extended_capabilities_b0,
12109     &hf_ieee80211_tag_extended_capabilities_b1,
12110     &hf_ieee80211_tag_extended_capabilities_b2,
12111     &hf_ieee80211_tag_extended_capabilities_b3,
12112     &hf_ieee80211_tag_extended_capabilities_b4,
12113     &hf_ieee80211_tag_extended_capabilities_b5,
12114     &hf_ieee80211_tag_extended_capabilities_b6,
12115     &hf_ieee80211_tag_extended_capabilities_b7,
12116     NULL
12117   };
12118   static const int *ieee80211_tag_extended_capabilities_byte2[] = {
12119     &hf_ieee80211_tag_extended_capabilities_b8,
12120     &hf_ieee80211_tag_extended_capabilities_b9,
12121     &hf_ieee80211_tag_extended_capabilities_b10,
12122     &hf_ieee80211_tag_extended_capabilities_b11,
12123     &hf_ieee80211_tag_extended_capabilities_b12,
12124     &hf_ieee80211_tag_extended_capabilities_b13,
12125     &hf_ieee80211_tag_extended_capabilities_b14,
12126     &hf_ieee80211_tag_extended_capabilities_b15,
12127     NULL
12128   };
12129   static const int *ieee80211_tag_extended_capabilities_byte3[] = {
12130     &hf_ieee80211_tag_extended_capabilities_b16,
12131     &hf_ieee80211_tag_extended_capabilities_b17,
12132     &hf_ieee80211_tag_extended_capabilities_b18,
12133     &hf_ieee80211_tag_extended_capabilities_b19,
12134     &hf_ieee80211_tag_extended_capabilities_b20,
12135     &hf_ieee80211_tag_extended_capabilities_b21,
12136     &hf_ieee80211_tag_extended_capabilities_b22,
12137     &hf_ieee80211_tag_extended_capabilities_b23,
12138     NULL
12139   };
12140   static const int *ieee80211_tag_extended_capabilities_byte4[] = {
12141     &hf_ieee80211_tag_extended_capabilities_b24,
12142     &hf_ieee80211_tag_extended_capabilities_b25,
12143     &hf_ieee80211_tag_extended_capabilities_b26,
12144     &hf_ieee80211_tag_extended_capabilities_b27,
12145     &hf_ieee80211_tag_extended_capabilities_b28,
12146     &hf_ieee80211_tag_extended_capabilities_b29,
12147     &hf_ieee80211_tag_extended_capabilities_b30,
12148     &hf_ieee80211_tag_extended_capabilities_b31,
12149     NULL
12150   };
12151   static const int *ieee80211_tag_extended_capabilities_byte5[] = {
12152     &hf_ieee80211_tag_extended_capabilities_b32,
12153     &hf_ieee80211_tag_extended_capabilities_b33,
12154     &hf_ieee80211_tag_extended_capabilities_b34,
12155     &hf_ieee80211_tag_extended_capabilities_b35,
12156     &hf_ieee80211_tag_extended_capabilities_b36,
12157     &hf_ieee80211_tag_extended_capabilities_b37,
12158     &hf_ieee80211_tag_extended_capabilities_b38,
12159     &hf_ieee80211_tag_extended_capabilities_b39,
12160     NULL
12161   };
12162   static const int *ieee80211_tag_extended_capabilities_byte6[] = {
12163     &hf_ieee80211_tag_extended_capabilities_b40,
12164     &hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
12165     &hf_ieee80211_tag_extended_capabilities_b44,
12166     &hf_ieee80211_tag_extended_capabilities_b45,
12167     &hf_ieee80211_tag_extended_capabilities_b46,
12168     &hf_ieee80211_tag_extended_capabilities_b47,
12169     NULL
12170   };
12171   static const int *ieee80211_tag_extended_capabilities_byte7[] = {
12172     &hf_ieee80211_tag_extended_capabilities_b48,
12173     &hf_ieee80211_tag_extended_capabilities_b49,
12174     &hf_ieee80211_tag_extended_capabilities_b50,
12175     &hf_ieee80211_tag_extended_capabilities_b51,
12176     &hf_ieee80211_tag_extended_capabilities_b52,
12177     &hf_ieee80211_tag_extended_capabilities_b53,
12178     &hf_ieee80211_tag_extended_capabilities_b54,
12179     &hf_ieee80211_tag_extended_capabilities_b55,
12180     NULL
12181   };
12182
12183   static const int *ieee80211_tag_extended_capabilities_byte8[] = {
12184     &hf_ieee80211_tag_extended_capabilities_b56,
12185     &hf_ieee80211_tag_extended_capabilities_b57,
12186     &hf_ieee80211_tag_extended_capabilities_b58,
12187     &hf_ieee80211_tag_extended_capabilities_b59,
12188     &hf_ieee80211_tag_extended_capabilities_b60,
12189     &hf_ieee80211_tag_extended_capabilities_b61,
12190     &hf_ieee80211_tag_extended_capabilities_b62,
12191     &hf_ieee80211_tag_extended_capabilities_b63,
12192     NULL
12193   };
12194
12195   static const int *ieee80211_tag_extended_capabilities_bytes89[] = {
12196     &hf_ieee80211_tag_extended_capabilities_b56_2,
12197     &hf_ieee80211_tag_extended_capabilities_b57_2,
12198     &hf_ieee80211_tag_extended_capabilities_b58_2,
12199     &hf_ieee80211_tag_extended_capabilities_b59_2,
12200     &hf_ieee80211_tag_extended_capabilities_b60_2,
12201     &hf_ieee80211_tag_extended_capabilities_b61_2,
12202     &hf_ieee80211_tag_extended_capabilities_b62_2,
12203     &hf_ieee80211_tag_extended_capabilities_max_num_msdus,
12204     &hf_ieee80211_tag_extended_capabilities_b65_2,
12205     &hf_ieee80211_tag_extended_capabilities_b66_2,
12206     &hf_ieee80211_tag_extended_capabilities_b67_2,
12207     &hf_ieee80211_tag_extended_capabilities_b68_2,
12208     &hf_ieee80211_tag_extended_capabilities_b69_2,
12209     &hf_ieee80211_tag_extended_capabilities_b70_2,
12210     &hf_ieee80211_tag_extended_capabilities_b71_2,
12211     NULL
12212   };
12213
12214   static const int *ieee80211_tag_extended_capabilities_byte10[] = {
12215     &hf_ieee80211_tag_extended_capabilities_b72,
12216     &hf_ieee80211_tag_extended_capabilities_b73,
12217     &hf_ieee80211_tag_extended_capabilities_b74,
12218     &hf_ieee80211_tag_extended_capabilities_b75,
12219     &hf_ieee80211_tag_extended_capabilities_b76,
12220     &hf_ieee80211_tag_extended_capabilities_b77,
12221     &hf_ieee80211_tag_extended_capabilities_b78,
12222     &hf_ieee80211_tag_extended_capabilities_b79,
12223     NULL
12224   };
12225
12226   if (tag_len < 1)
12227   {
12228     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be greater than 0", tag_len);
12229     return 1;
12230   }
12231   proto_item_append_text(field_data->item_tag, " (%u octet%s)", tag_len, plurality(tag_len, "", "s"));
12232
12233   /* Extended Capability octet 1 */
12234   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12235                                     ett_tag_ex_cap1, ieee80211_tag_extended_capabilities_byte1,
12236                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12237   proto_item_append_text(ti_ex_cap, " (octet 1)");
12238   offset += 1;
12239
12240   /* Extended Capability octet 2 */
12241   if (offset >= tag_len) {
12242     return offset;
12243   }
12244   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12245                                     ett_tag_ex_cap2, ieee80211_tag_extended_capabilities_byte2,
12246                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12247   proto_item_append_text(ti_ex_cap, " (octet 2)");
12248   offset += 1;
12249
12250   /* Extended Capability octet 3 */
12251   if (offset >= tag_len) {
12252     return offset;
12253   }
12254   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12255                                     ett_tag_ex_cap3, ieee80211_tag_extended_capabilities_byte3,
12256                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12257   proto_item_append_text(ti_ex_cap, " (octet 3)");
12258   offset += 1;
12259
12260   /* Extended Capability octet 4 */
12261   if (offset >= tag_len) {
12262     return offset;
12263   }
12264   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12265                                     ett_tag_ex_cap4, ieee80211_tag_extended_capabilities_byte4,
12266                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12267   proto_item_append_text(ti_ex_cap, " (octet 4)");
12268   offset += 1;
12269
12270   /* Extended Capability octet 5 */
12271   if (offset >= tag_len) {
12272     return offset;
12273   }
12274   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12275                                     ett_tag_ex_cap5, ieee80211_tag_extended_capabilities_byte5,
12276                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12277   proto_item_append_text(ti_ex_cap, " (octet 5)");
12278   offset += 1;
12279
12280   /* Extended Capability octet 6 */
12281   if (offset >= tag_len) {
12282     return offset;
12283   }
12284
12285   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12286                                     ett_tag_ex_cap6, ieee80211_tag_extended_capabilities_byte6,
12287                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12288   proto_item_append_text(ti_ex_cap, " (octet 6)");
12289   offset += 1;
12290
12291
12292   /* Extended Capability octet 7 */
12293   if (offset >= tag_len) {
12294     return offset;
12295   }
12296   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12297                                     ett_tag_ex_cap7, ieee80211_tag_extended_capabilities_byte7,
12298                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12299   proto_item_append_text(ti_ex_cap, " (octet 7)");
12300   offset += 1;
12301
12302   /* Extended Capability octet 8 & 9 since two bits cross the boundary */
12303   if (offset >= tag_len) {
12304     return offset;
12305   }
12306
12307   /* If only the first of the two bytes is present, do the best we can */
12308   if (offset == tag_len - 1) {
12309     ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12310                                     ett_tag_ex_cap8, ieee80211_tag_extended_capabilities_byte8,
12311                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12312     proto_item_append_text(ti_ex_cap, " (octet 8)");
12313     offset += 1;
12314   } else { /* Both bytes are there */
12315     ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities_2,
12316                                     ett_tag_ex_cap89, ieee80211_tag_extended_capabilities_bytes89,
12317                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12318     proto_item_append_text(ti_ex_cap, " (octets 8 & 9)");
12319     offset += 2;
12320   }
12321
12322   if (offset >= tag_len) {
12323     return offset;
12324   }
12325
12326   /* Extended Capability octet 10 */
12327   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
12328                                     ett_tag_ex_cap10, ieee80211_tag_extended_capabilities_byte10,
12329                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12330   proto_item_append_text(ti_ex_cap, " (octet 10)");
12331   offset += 1;
12332
12333   return offset;
12334 }
12335 static int
12336 dissect_vht_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset)
12337 {
12338   proto_item *ti;
12339   proto_tree *mcs_tree;
12340   static const int *ieee80211_vht_mcsset_rx_max_mcs[] = {
12341     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
12342     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
12343     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
12344     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
12345     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
12346     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
12347     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
12348     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
12349     NULL
12350   };
12351   static const int *ieee80211_vht_mcsset_tx_max_mcs[] = {
12352     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
12353     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
12354     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
12355     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
12356     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
12357     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
12358     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
12359     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
12360     NULL
12361   };
12362
12363   /* 8 byte Supported MCS set */
12364   ti = proto_tree_add_item(tree, hf_ieee80211_vht_mcsset, tvb, offset, 8, ENC_NA);
12365
12366   mcs_tree = proto_item_add_subtree(ti, ett_vht_mcsset_tree);
12367
12368   /* B0 - B15 */
12369   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_vht_mcsset_rx_mcs_map,
12370                                     ett_vht_rx_mcsbit_tree, ieee80211_vht_mcsset_rx_max_mcs,
12371                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12372   offset += 2;
12373
12374   /* B16 - B28 13 bits*/
12375   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12376
12377   /* B29 - B31 2 reserved bits*/
12378
12379   offset += 2;
12380
12381   /* B32 - B47 */
12382   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_vht_mcsset_tx_mcs_map,
12383                                     ett_vht_tx_mcsbit_tree, ieee80211_vht_mcsset_tx_max_mcs,
12384                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12385   offset += 2;
12386   /* B48 - B60 13 bits */
12387   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12388   /* B61 - B63 2 reserved bits*/
12389
12390   offset += 2;
12391   return offset;
12392 }
12393
12394 static int
12395 dissect_vht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12396 {
12397   int tag_len = tvb_reported_length(tvb);
12398   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12399   int offset = 0;
12400   static const int *ieee80211_vht_caps[] = {
12401     &hf_ieee80211_vht_max_mpdu_length,
12402     &hf_ieee80211_vht_supported_chan_width_set,
12403     &hf_ieee80211_vht_rx_ldpc,
12404     &hf_ieee80211_vht_short_gi_for_80,
12405     &hf_ieee80211_vht_short_gi_for_160,
12406     &hf_ieee80211_vht_tx_stbc,
12407     /* End of first byte */
12408     &hf_ieee80211_vht_rx_stbc,
12409     &hf_ieee80211_vht_su_beamformer_cap,
12410     &hf_ieee80211_vht_su_beamformee_cap,
12411     &hf_ieee80211_vht_beamformer_antennas,
12412     /* End of second byte */
12413     &hf_ieee80211_vht_sounding_dimensions,
12414     &hf_ieee80211_vht_mu_beamformer_cap,
12415     &hf_ieee80211_vht_mu_beamformee_cap,
12416     &hf_ieee80211_vht_txop_ps,
12417     &hf_ieee80211_vht_var_htc_field,
12418     &hf_ieee80211_vht_max_ampdu,
12419     &hf_ieee80211_vht_link_adaptation_cap,
12420     &hf_ieee80211_vht_rx_pattern,
12421     &hf_ieee80211_vht_tx_pattern,
12422     &hf_ieee80211_vht_ext_nss_bw_support,
12423     NULL
12424   };
12425
12426   if (tag_len != 12) {
12427     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12428                            "VHT Capabilities IE length %u wrong, must be = 12", tag_len);
12429     return 1;
12430   }
12431
12432   /* 4 byte VHT Capabilities  Info*/
12433   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_vht_cap,
12434                                     ett_vht_cap_tree, ieee80211_vht_caps,
12435                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12436   offset += 4;
12437
12438   /* 8 byte MCS set */
12439   offset = dissect_vht_mcs_set(tree, tvb, offset);
12440
12441   return offset;
12442 }
12443
12444 static int
12445 dissect_vht_operation_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12446 {
12447   int tag_len = tvb_reported_length(tvb);
12448   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12449   int offset = 0;
12450   proto_item *op_item;
12451   proto_tree *op_tree;
12452   static const int *ieee80211_vht_op_max_basic_mcs[] = {
12453     &hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
12454     &hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
12455     &hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
12456     &hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
12457     &hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
12458     &hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
12459     &hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
12460     &hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
12461     NULL
12462   };
12463
12464   if (tag_len != 5) {
12465     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12466                            "VHT Operation IE length %u wrong, must be = 5", tag_len);
12467     return 1;
12468   }
12469
12470   /* 3 byte VHT Operation Info*/
12471   op_item = proto_tree_add_item(tree, hf_ieee80211_vht_op, tvb, offset, 3, ENC_NA);
12472   op_tree = proto_item_add_subtree(op_item, ett_vht_op_tree);
12473   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12474   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center0, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
12475   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center1, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
12476
12477   offset += 3;
12478   /* VHT Basic MCS Set */
12479   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_vht_op_basic_mcs_map,
12480                                     ett_vht_basic_mcsbit_tree, ieee80211_vht_op_max_basic_mcs,
12481                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12482   offset += 2;
12483
12484   return offset;
12485 }
12486
12487 static int
12488 dissect_vht_tx_pwr_envelope(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12489 {
12490   int tag_len = tvb_reported_length(tvb);
12491   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12492   int offset = 0;
12493   proto_item *tx_pwr_item, *ti;
12494   proto_tree *tx_pwr_info_tree;
12495   guint8 opt_ie_cnt=0;
12496   guint8 i;
12497
12498   if (tag_len < 2 || tag_len > 5) {
12499     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12500                            "VHT TX PWR Envelope IE length %u wrong, must be >= 2 and <= 5", tag_len);
12501     return 1;
12502   }
12503
12504   tx_pwr_item = proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_info, tvb, offset, 1, ENC_NA);
12505   tx_pwr_info_tree =  proto_item_add_subtree(tx_pwr_item, ett_vht_tpe_info_tree);
12506
12507   ti = proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12508   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_unit, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12509   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12510
12511   opt_ie_cnt = tvb_get_guint8(tvb, offset) & 0x07;
12512
12513   offset += 1;
12514
12515   /* Power Constraint info is mandatory only for 20MHz, others are optional*/
12516   /* Power is expressed in terms of 0.5dBm from -64 to 63 and is encoded
12517    * as 8-bit 2's compliment */
12518   for (i = 0; i <= opt_ie_cnt; i++) {
12519     switch(i) {
12520     case 0:
12521       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_20, tvb, offset, 1, ENC_NA);
12522       offset += 1;
12523       break;
12524     case 1:
12525       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_40, tvb, offset, 1, ENC_NA);
12526       offset += 1;
12527       break;
12528     case 2:
12529       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_80, tvb, offset, 1, ENC_NA);
12530       offset += 1;
12531       break;
12532     case 3:
12533       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_160, tvb, offset, 1, ENC_NA);
12534       offset += 1;
12535       break;
12536     default:
12537       expert_add_info(pinfo, ti, &ei_ieee80211_vht_tpe_pwr_info_count);
12538       offset += 1;
12539       break;
12540     }
12541   }
12542
12543   return offset;
12544 }
12545
12546 static int
12547 dissect_mobility_domain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12548 {
12549   int tag_len = tvb_reported_length(tvb);
12550   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12551   int offset = 0;
12552
12553   if (field_data->sanity_check != NULL) {
12554     field_data->sanity_check->association_has_mobility_domain_element = TRUE;
12555   }
12556
12557   if (tag_len < 3) {
12558     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12559                           "MDIE content length must be at least 3 bytes");
12560     return 1;
12561   }
12562
12563   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_mdid,
12564                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12565   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab,
12566                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
12567   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
12568                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
12569   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
12570                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
12571   return tvb_captured_length(tvb);
12572 }
12573
12574 static int
12575 dissect_fast_bss_transition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12576 {
12577   int tag_len = tvb_reported_length(tvb);
12578   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12579   int offset = 0;
12580   if (tag_len < 82) {
12581     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12582                           "FTIE content length must be at least 82 bytes");
12583     return 1;
12584   }
12585
12586   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic_control,
12587                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12588   proto_tree_add_item(tree, hf_ieee80211_tag_ft_element_count,
12589                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12590   offset += 2;
12591   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic,
12592                       tvb, offset, 16, ENC_NA);
12593   offset += 16;
12594   proto_tree_add_item(tree, hf_ieee80211_tag_ft_anonce,
12595                       tvb, offset, 32, ENC_NA);
12596   offset += 32;
12597   proto_tree_add_item(tree, hf_ieee80211_tag_ft_snonce,
12598                       tvb, offset, 32, ENC_NA);
12599   offset += 32;
12600
12601   while (offset + 2 <= tag_len) {
12602     guint8 id, len;
12603     int s_end;
12604     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_id,
12605                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12606     id = tvb_get_guint8(tvb, offset);
12607     offset += 1;
12608
12609     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_len,
12610                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12611     len = tvb_get_guint8(tvb, offset);
12612     offset += 1;
12613
12614     if (offset + len > tag_len) {
12615       proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset,
12616                             tag_len - offset, "Invalid FTIE subelement");
12617       return offset;
12618     }
12619
12620     s_end = offset + len;
12621     switch (id) {
12622     case 1:
12623       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r1kh_id,
12624                           tvb, offset, len, ENC_NA);
12625       break;
12626     case 2:
12627       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_info,
12628                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
12629       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_id,
12630                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
12631       offset += 2;
12632       if (offset > s_end)
12633         break;
12634       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_length,
12635                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
12636       offset += 1;
12637       if (offset > s_end)
12638         break;
12639       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_rsc,
12640                           tvb, offset, 8, ENC_NA);
12641       offset += 8;
12642       if (offset > s_end)
12643         break;
12644       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key,
12645                           tvb, offset, s_end - offset, ENC_NA);
12646       break;
12647     case 3:
12648       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r0kh_id,
12649                           tvb, offset, len, ENC_NA);
12650       break;
12651     case 4:
12652       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_id,
12653                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
12654       offset += 2;
12655       if (offset > s_end)
12656         break;
12657       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_ipn,
12658                           tvb, offset, 6, ENC_NA);
12659       offset += 6;
12660       if (offset > s_end)
12661         break;
12662       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_length,
12663                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
12664       offset += 1;
12665       if (offset > s_end)
12666         break;
12667       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key,
12668                           tvb, offset, 24, ENC_NA);
12669       break;
12670     default:
12671       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_data,
12672                           tvb, offset, len, ENC_NA);
12673       break;
12674     }
12675     offset = s_end;
12676   }
12677
12678   return tvb_captured_length(tvb);
12679 }
12680
12681 static int
12682 dissect_mmie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12683 {
12684   int tag_len = tvb_reported_length(tvb);
12685   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12686   int offset = 0;
12687
12688   if (tag_len < 16) {
12689     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12690                           "MMIE content length must be at least 16 bytes");
12691     return 1;
12692   }
12693
12694   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12695   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
12696                       ENC_NA);
12697   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
12698                       ENC_NA);
12699   return tvb_captured_length(tvb);
12700 }
12701
12702 static int
12703 dissect_ssid_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
12704 {
12705   int tag_len = tvb_reported_length(tvb);
12706   int offset = 0;
12707   proto_tree *entry;
12708   gboolean first = TRUE;
12709
12710   while (offset + 1 <= tag_len) {
12711     guint8 len = tvb_get_guint8(tvb, offset + 1);
12712     guint8 *str;
12713
12714     if (offset + 2 + len > tag_len)
12715       break;
12716
12717     str = tvb_format_text(tvb, offset + 2, len);
12718     proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
12719     first = FALSE;
12720     entry = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len, ett_ssid_list, NULL, "SSID: %s", str);
12721     proto_tree_add_item(entry, hf_ieee80211_tag_number, tvb, offset, 1,
12722                         ENC_LITTLE_ENDIAN);
12723     offset++;
12724     proto_tree_add_uint(entry, hf_ieee80211_tag_length, tvb, offset, 1, len);
12725     offset++;
12726     proto_tree_add_item(entry, hf_ieee80211_tag_ssid, tvb, offset, len,
12727                         ENC_ASCII|ENC_NA);
12728     offset += len;
12729   }
12730
12731   return tvb_captured_length(tvb);
12732 }
12733
12734 static int
12735 dissect_link_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12736 {
12737   int tag_len = tvb_reported_length(tvb);
12738   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12739   int offset = 0;
12740
12741   if (tag_len < 18) {
12742     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12743                           "Link Identifier content length must be at least "
12744                           "18 bytes");
12745     return tvb_captured_length(tvb);
12746   }
12747
12748   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_bssid, tvb,
12749                       offset, 6, ENC_NA);
12750   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_init_sta, tvb,
12751                       offset + 6, 6, ENC_NA);
12752   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_resp_sta, tvb,
12753                       offset + 12, 6, ENC_NA);
12754   return tvb_captured_length(tvb);
12755 }
12756
12757 static int
12758 dissect_wakeup_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12759 {
12760   int tag_len = tvb_reported_length(tvb);
12761   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12762   int offset = 0;
12763
12764   if (tag_len < 18) {
12765     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12766                           "Wakeup Schedule content length must be at least "
12767                           "18 bytes");
12768     return tvb_captured_length(tvb);
12769   }
12770
12771   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_offset, tvb,
12772                       offset, 4, ENC_LITTLE_ENDIAN);
12773   offset += 4;
12774
12775   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_interval, tvb,
12776                       offset, 4, ENC_LITTLE_ENDIAN);
12777   offset += 4;
12778
12779   proto_tree_add_item(tree,
12780                       hf_ieee80211_tag_wakeup_schedule_awake_window_slots, tvb,
12781                       offset, 4, ENC_LITTLE_ENDIAN);
12782   offset += 4;
12783
12784   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
12785                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
12786   offset += 4;
12787
12788   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_idle_count, tvb,
12789                       offset, 2, ENC_LITTLE_ENDIAN);
12790   return tvb_captured_length(tvb);
12791 }
12792
12793 static int
12794 dissect_channel_switch_timing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12795 {
12796   int tag_len = tvb_reported_length(tvb);
12797   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12798   int offset = 0;
12799
12800   if (tag_len < 4) {
12801     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12802                           "Channel Switch Timing content length must be at "
12803                           "least 4 bytes");
12804     return tvb_captured_length(tvb);
12805   }
12806
12807   proto_tree_add_item(tree, hf_ieee80211_tag_channel_switch_timing_switch_time,
12808                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12809   offset += 2;
12810
12811   proto_tree_add_item(tree,
12812                       hf_ieee80211_tag_channel_switch_timing_switch_timeout,
12813                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12814   return tvb_captured_length(tvb);
12815 }
12816
12817 static int
12818 dissect_pti_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12819 {
12820   int tag_len = tvb_reported_length(tvb);
12821   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12822   int offset = 0;
12823
12824   if (tag_len < 3) {
12825     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "PTI Control content length must be at least 3 bytes");
12826     return tvb_captured_length(tvb);
12827   }
12828
12829   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_tid, tvb,
12830                       offset, 1, ENC_LITTLE_ENDIAN);
12831   offset += 1;
12832
12833   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_sequence_control, tvb,
12834                       offset, 2, ENC_LITTLE_ENDIAN);
12835   return tvb_captured_length(tvb);
12836 }
12837
12838 static int
12839 dissect_pu_buffer_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12840 {
12841   int tag_len = tvb_reported_length(tvb);
12842   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12843   int offset = 0;
12844   static const int *ieee80211_pu_buffer_status[] = {
12845     &hf_ieee80211_tag_pu_buffer_status_ac_bk,
12846     &hf_ieee80211_tag_pu_buffer_status_ac_be,
12847     &hf_ieee80211_tag_pu_buffer_status_ac_vi,
12848     &hf_ieee80211_tag_pu_buffer_status_ac_vo,
12849     NULL
12850   };
12851
12852   if (tag_len < 1) {
12853     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "PU Buffer Status content length must be at least 1 byte");
12854     return tvb_captured_length(tvb);
12855   }
12856
12857   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_pu_buffer_status, ENC_LITTLE_ENDIAN);
12858   return tvb_captured_length(tvb);
12859 }
12860
12861 static int
12862 dissect_timeout_interval(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
12863 {
12864   int tag_len = tvb_reported_length(tvb);
12865   int offset = 0;
12866   proto_item *pi;
12867
12868   pi = proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_type, tvb,
12869                            offset, 1, ENC_LITTLE_ENDIAN);
12870   if (tag_len < 5) {
12871     expert_add_info_format(pinfo, pi, &ei_ieee80211_tag_length,
12872                            "Timeout Interval content length must be at least "
12873                           "5 bytes");
12874     return 1;
12875   }
12876
12877   proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_value, tvb,
12878                       offset + 1, 4, ENC_LITTLE_ENDIAN);
12879   return tvb_captured_length(tvb);
12880 }
12881
12882 static int
12883 dissect_ric_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12884 {
12885   int tag_len = tvb_reported_length(tvb);
12886   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12887   int offset = 0;
12888   proto_tree  *sub_tree;
12889   guint8       desc_cnt = 0;
12890   guint32      next_ie;
12891   int          offset_r = 0;
12892   const guint8 ids[] = { TAG_RIC_DESCRIPTOR };
12893
12894   if (tag_len != 4)  {
12895     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12896                            "RIC Data Length must be 4 bytes");
12897     return 0;
12898   }
12899
12900   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_id, tvb,
12901                            offset, 1, ENC_LITTLE_ENDIAN);
12902   offset += 1;
12903
12904   desc_cnt = tvb_get_guint8(tvb, offset);
12905   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_desc_cnt, tvb,
12906                            offset, 1, ENC_LITTLE_ENDIAN);
12907   offset += 1;
12908
12909   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_status_code, tvb,
12910                            offset, 2, ENC_LITTLE_ENDIAN);
12911   offset += 2;
12912
12913   /* Our Design is such that all the Resource request IE's part of the RIC
12914    * must be in the sub tree of RIC for better readability
12915    * Even omnipeek does the same way.
12916    */
12917   sub_tree = proto_item_add_subtree(tree, ett_tag_ric_data_desc_ie);
12918
12919   proto_item_append_text(field_data->item_tag, " :Resource Descriptor List");
12920   if (desc_cnt == 0) {
12921     proto_item_append_text(field_data->item_tag, " :0 (Weird?)");
12922   }
12923
12924   while ( desc_cnt != 0 ) {
12925
12926     next_ie = tvb_get_guint8(tvb, offset);
12927     proto_item_append_text(field_data->item_tag, " :(%d:%s)", desc_cnt, val_to_str_ext(next_ie, &tag_num_vals_ext, "Reserved (%d)"));
12928     /* Recursive call to avoid duplication of code*/
12929     offset_r = add_tagged_field(pinfo, sub_tree, tvb, offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
12930     if (offset_r == 0 )/* should never happen, returns a min of 2*/
12931       break;
12932     /* This will ensure that the IE after RIC is processed
12933      * only once. This gives us a good looking RIC IE :-)
12934      */
12935     tag_len += offset_r;
12936     desc_cnt--;
12937   }
12938
12939   return tvb_captured_length(tvb);
12940 }
12941
12942 /* Overlapping BSS Scan Parameters (74) */
12943 static int
12944 dissect_overlap_bss_scan_par(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12945 {
12946   int offset = 0;
12947   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12948   int tag_len = tvb_reported_length(tvb);
12949
12950   if (tag_len != 14)  {
12951     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12952                            "OBSS Length must be 14 bytes");
12953     return 1;
12954   }
12955
12956   proto_tree_add_item(tree, hf_ieee80211_tag_obss_spd, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12957   offset += 2;
12958
12959   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sad, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12960   offset += 2;
12961
12962   proto_tree_add_item(tree, hf_ieee80211_tag_obss_cwtsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12963   offset += 2;
12964
12965   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sptpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12966   offset += 2;
12967
12968   proto_tree_add_item(tree, hf_ieee80211_tag_obss_satpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12969   offset += 2;
12970
12971   proto_tree_add_item(tree, hf_ieee80211_tag_obss_wctdf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12972   offset += 2;
12973
12974   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sat, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12975   offset += 2;
12976
12977   return offset;
12978 }
12979
12980 /* RIC Descriptor (75) */
12981 static int
12982 dissect_ric_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
12983 {
12984   int offset = 0;
12985   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
12986   int tag_len = tvb_reported_length(tvb);
12987   guint8       rsrc_type = 0;
12988
12989   if (tag_len < 1)  {
12990     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
12991                            "RIC Data Length must be at least 1 byte");
12992     return 1;
12993   }
12994
12995   rsrc_type = tvb_get_guint8(tvb, offset);
12996   proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_rsrc_type, tvb,
12997                            offset, 1, ENC_LITTLE_ENDIAN);
12998   offset += 1;
12999
13000   if (rsrc_type == 1) {
13001     /* Block ACK params
13002      * 802.11-2012: 8.4.2.53 RIC Descriptor element
13003      * Block Ack parameter set as defined in 8.4.1.14,
13004      * Block Ack timeout value as defined in 8.4.1.15, and
13005      * Block Ack starting sequence control as defined in 8.3.1.8
13006      */
13007     /* TODO: Still figuring out how to parse these ones,
13008      * need a sample capture with at least HEX Dump
13009      */
13010     proto_item_append_text(field_data->item_tag, " : Block ACK Params");
13011     proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_var_params, tvb,
13012                         offset, tag_len-1, ENC_NA);
13013     offset += tag_len -1;
13014   }else {
13015     /* 0, 2-255 are reserved*/
13016     proto_item_append_text(field_data->item_tag, " :Reserved (type != 1)");
13017   }
13018
13019   return offset;
13020 }
13021
13022 static int
13023 dissect_ext_bss_load(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13024 {
13025   int offset = 0;
13026   proto_tree_add_item(tree, hf_ieee80211_ext_bss_mu_mimo_capable_sta_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13027   offset += 2;
13028   proto_tree_add_item(tree, hf_ieee80211_ext_bss_ss_underutilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13029   offset += 1;
13030   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_20mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13031   offset += 1;
13032   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_40mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13033   offset += 1;
13034   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_80mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13035   offset += 1;
13036
13037   return offset;
13038 }
13039
13040 static int
13041 dissect_wide_bw_channel_switch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13042 {
13043   int offset = 0;
13044
13045   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13046   offset += 1;
13047   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13048   offset += 1;
13049   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13050   offset += 1;
13051
13052   return offset;
13053 }
13054
13055 static int
13056 dissect_channel_switch_wrapper(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13057 {
13058   int tag_len = tvb_reported_length(tvb);
13059   int offset = 0;
13060   int tmp_sublen;
13061   const guint8 ids[] = { TAG_COUNTRY_INFO, TAG_WIDE_BW_CHANNEL_SWITCH,
13062     TAG_VHT_TX_PWR_ENVELOPE };
13063
13064   /*
13065   Decode three subelement in IE-196(Channel Switch Wrapper element):
13066         (1) New Country subelement
13067         (2) Wide Bandwidth Channel Switch subelement
13068         (3) New VHT Transmit Power Envelope subelement
13069   */
13070   while (tag_len > 0){
13071     tmp_sublen = tvb_get_guint8(tvb, offset + 1);
13072     if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
13073       break;
13074     }
13075     tag_len -= (tmp_sublen + 2);
13076     offset += (tmp_sublen + 2);
13077   }
13078   return offset;
13079 }
13080
13081 static int
13082 dissect_operating_mode_notification(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13083 {
13084   int offset = 0;
13085   static const int *ieee80211_operat_mode_field[] = {
13086     &hf_ieee80211_operat_mode_field_channel_width,
13087     &hf_ieee80211_operat_mode_field_reserved,
13088     &hf_ieee80211_operat_mode_field_rxnss,
13089     &hf_ieee80211_operat_mode_field_rxnsstype,
13090     NULL
13091   };
13092
13093   /* Operating Mode field */
13094   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_operat_notification_mode,
13095                                     ett_mcsbit_tree, ieee80211_operat_mode_field,
13096                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13097   offset += 1;
13098   return offset;
13099 }
13100
13101 static int
13102 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vendorspecific)
13103 {
13104   proto_item *ti;
13105   proto_tree *mcs_tree, *bit_tree;
13106   guint8 rx_nss, tx_nss; /* 0-4 for HT and 0-8 for VHT*/
13107   guint32 value_mcs_0_31, value_mcs_32_52, value_mcs_53_76;
13108   guint16 tx_mcs_set;
13109   rx_nss = tx_nss = 8;
13110   /* 16 byte Supported MCS set */
13111   if (vendorspecific)
13112   {
13113     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset_vs, tvb, offset, 16,
13114       basic ? "Basic MCS Set" : "MCS Set");
13115   } else
13116   {
13117     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset, tvb, offset, 16,
13118       basic ? "Basic MCS Set" : "MCS Set");
13119   }
13120   mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
13121
13122   /* Rx MCS Bitmask */
13123   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_rx_bitmask, tvb, offset, 10, ENC_NA);
13124   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
13125
13126   /* Bits 0 - 31 */
13127   value_mcs_0_31 = tvb_get_letohl(tvb, offset);
13128
13129   /* Handle all zeroes/ff's case..*/
13130   if (value_mcs_0_31 != 0x0)
13131   {
13132     if (!(value_mcs_0_31 & (0xffffff00))) {
13133       /*
13134        * At least one MCS from 0-7 is supported, but no MCS from 8-31 are
13135        * supported, so only 1 spatial stream is supported.
13136        */
13137       rx_nss = 0;
13138     } else if (!(value_mcs_0_31 & (0xffff0000))) {
13139       /*
13140        * At least one MCS from 8-15 is supported, but no MCS from 16-31 are
13141        * supported, so only 2 spatial streams are supported.
13142        */
13143       rx_nss = 1;
13144     } else if (!(value_mcs_0_31 & (0xff000000))) {
13145       /*
13146        * At least one MCS from 16-23 is supported, but no MCS from 24-31 are
13147        * supported, so only 3 spatial streams are supported.
13148        */
13149       rx_nss = 2;
13150     } else {
13151       /*
13152        * At least one MCS from 24-31 is supported, so 4 spatial streams
13153        * are supported.
13154        */
13155       rx_nss = 3;
13156     }
13157   }
13158
13159   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_0to7, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13160   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_8to15, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13161   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_16to23, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13162   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_24to31, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13163   offset += 4;
13164
13165   /* Should be we check UEQM Supported?*/
13166   /* Bits 32 - 52 */
13167   value_mcs_32_52 = tvb_get_letohl(tvb, offset);
13168   if (!(value_mcs_32_52 & (0x1ffffe))) {
13169     /*
13170      * MCS 33-52 aren't supported, so the number of spatial streams we get
13171      * from whichever MCSes from 0-31 that we support is the total number
13172      * of spatial streams we support.
13173      */
13174     ;
13175   } else if (!(value_mcs_32_52 & (0x1fff80))) {
13176     /*
13177      * At least one MCS from 33-38 is supported, but no MCS from 39-52 is
13178      * supported, so we have at least 2 spatial streams, but none of the
13179      * MCSs in that range give us any more.
13180      */
13181     rx_nss = MAX(1, rx_nss);
13182   } else {
13183     /*
13184      * At least one MCS from 39-52 is supported, so we have at least 3
13185      * spatial streams.
13186      */
13187     rx_nss = MAX(2, rx_nss);
13188   }
13189
13190   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_32, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13191   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_33to38, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13192   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_39to52, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13193   offset += 2;
13194
13195   /* Bits 53 - 76 */
13196   value_mcs_53_76 = tvb_get_letohl(tvb, offset);
13197   if ((value_mcs_53_76 & (0x1fffffe0))) {
13198     /*
13199      * At least one MCS from 53-76 is supported, so we have at least 4
13200      * spatial streams.
13201      */
13202     rx_nss = MAX(3, rx_nss);
13203   }
13204
13205   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_53to76, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13206   offset += 4;
13207
13208   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_highest_data_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13209   offset += 2;
13210
13211   /* Follow table 8-126 from 802.11-2012 */
13212   tx_mcs_set = tvb_get_letohs(tvb, offset);
13213
13214   if (!(tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
13215   {
13216     /* TX MCS Set is not defined
13217      * so there is no interpretation for Max Tx Spatial Streams
13218      */
13219      tx_nss = 4; /* Not Defined*/
13220   }
13221
13222   if ((tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
13223   {
13224     /* TX MCS Set is defined to be equal to Rx MCS Set
13225      * So, get the Max Spatial Streams from Rx
13226      * MCS set
13227      */
13228      tx_nss = rx_nss;
13229   }
13230   proto_item_append_text(ti, ": %s", val_to_str(rx_nss, mcsset_tx_max_spatial_streams_flags, "Reserved:%d" ) );
13231
13232   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_mcs_set_defined, tvb, offset, 1,
13233       ENC_LITTLE_ENDIAN);
13234   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal, tvb, offset, 1,
13235       ENC_LITTLE_ENDIAN);
13236   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_max_spatial_streams, tvb, offset, 1,
13237       ENC_LITTLE_ENDIAN);
13238   proto_item_append_text(ti, ", %s", val_to_str(tx_nss, mcsset_tx_max_spatial_streams_flags, "Reserved:%d" ) );
13239   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_unequal_modulation, tvb, offset, 1,
13240       ENC_LITTLE_ENDIAN);
13241   offset += 1;
13242
13243   offset += 3;
13244   return offset;
13245 }
13246
13247 /*  802.11n D1.10 - HT Information IE  */
13248 static int
13249 dissect_ht_info_ie_1_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13250 {
13251   int tag_len = tvb_reported_length(tvb);
13252   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13253   int offset = 0;
13254   static const int *ieee80211_ht_info1_field[] = {
13255     &hf_ieee80211_ht_info_secondary_channel_offset,
13256     &hf_ieee80211_ht_info_channel_width,
13257     &hf_ieee80211_ht_info_rifs_mode,
13258     &hf_ieee80211_ht_info_psmp_stas_only,
13259     &hf_ieee80211_ht_info_service_interval_granularity,
13260     NULL
13261   };
13262
13263   static const int *ieee80211_ht_info2_field[] = {
13264     &hf_ieee80211_ht_info_operating_mode,
13265     &hf_ieee80211_ht_info_non_greenfield_sta_present,
13266     &hf_ieee80211_ht_info_transmit_burst_limit,
13267     &hf_ieee80211_ht_info_obss_non_ht_stas_present,
13268     &hf_ieee80211_ht_info_reserved_1,
13269     NULL
13270   };
13271
13272   static const int *ieee80211_ht_info3_field[] = {
13273     &hf_ieee80211_ht_info_reserved_2,
13274     &hf_ieee80211_ht_info_dual_beacon,
13275     &hf_ieee80211_ht_info_dual_cts_protection,
13276     &hf_ieee80211_ht_info_secondary_beacon,
13277     &hf_ieee80211_ht_info_lsig_txop_protection_full_support,
13278     &hf_ieee80211_ht_info_pco_active,
13279     &hf_ieee80211_ht_info_pco_phase,
13280     &hf_ieee80211_ht_info_reserved_3,
13281     NULL
13282   };
13283
13284   if (tag_len < 22) {
13285     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13286                            "HT Information IE content length %u wrong, must be at least 22 bytes", tag_len);
13287     return 1;
13288   }
13289
13290   proto_tree_add_item(tree, hf_ieee80211_ht_info_primary_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13291   offset += 1;
13292
13293   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter1,
13294                                     ett_ht_info_delimiter1_tree, ieee80211_ht_info1_field,
13295                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13296   offset += 1;
13297
13298
13299   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter2,
13300                                     ett_ht_info_delimiter2_tree, ieee80211_ht_info2_field,
13301                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13302   offset += 2;
13303
13304   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter3,
13305                                     ett_ht_info_delimiter3_tree, ieee80211_ht_info3_field,
13306                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13307   offset += 2;
13308
13309   offset = dissect_mcs_set(tree, tvb, offset, TRUE, FALSE);
13310
13311   return offset;
13312 }
13313
13314
13315 static int
13316 dissect_wapi_param_set(tvbuff_t *tvb, packet_info *pinfo,
13317                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
13318                           proto_item *ti, int ftype)
13319 {
13320   /* Parse the WAPI Parameter Set IE Here*/
13321   proto_item *item;
13322   proto_tree *subtree;
13323   guint16 loop_cnt, version, akm_cnt  = 1, ucast_cnt = 1, bkid_cnt = 1;
13324   guint8  akm_suite_type = 0, ucast_cipher_type = 0, mcast_cipher_type = 0;
13325   static const int *ieee80211_tag_wapi_param_set[] = {
13326     &hf_ieee80211_tag_wapi_param_set_capab_preauth,
13327     &hf_ieee80211_tag_wapi_param_set_capab_rsvd,
13328     NULL
13329   };
13330
13331   version = tvb_get_letohs(tvb, offset);
13332   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13333   offset += 2;
13334
13335   /*MIN: 2 + (2+4)+ (2+4) + 4 + 2 + 0 (BKID CNT and LIST)  =20*/
13336   if (tag_len < 20) {
13337       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13338                 "tag_len is  %d, it's neither WAPI not BSS-AC-Access-Delay", tag_len);
13339     return offset;
13340   }
13341
13342   if (version != 1) {
13343     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13344                            "Version of WAPI protocol is %d, must be = 1", version);
13345     return offset;
13346   }
13347
13348   /* AKM Suites: list can't be 0*/
13349   akm_cnt = tvb_get_letohs(tvb, offset);
13350   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_akm_suite_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13351   offset += 2;
13352   if (akm_cnt != 0) {
13353     proto_item_append_text(ti, " : AKM Suite List:");
13354     for (loop_cnt = 0; loop_cnt < akm_cnt; loop_cnt++) {
13355       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_akm_tree);
13356       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_oui, tvb, offset, 3, ENC_NA);
13357       offset += 3;
13358       akm_suite_type = tvb_get_guint8(tvb, offset);
13359       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13360       offset += 1;
13361       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(akm_suite_type,
13362       ieee80211_wapi_suite_type_short, "Reserved: %d"));
13363     }
13364     proto_item_append_text(ti, " /");
13365   } else {
13366     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of AKM suites is 0, must be min 1");
13367     return offset;
13368
13369   }
13370   /* Unicast Cipher Suites: list can't be 0*/
13371   ucast_cnt = tvb_get_letohs(tvb, offset);
13372   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
13373                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13374   offset += 2;
13375   if (ucast_cnt != 0) {
13376     proto_item_append_text(ti, " Unicast Cipher List:");
13377     for (loop_cnt = 0; loop_cnt < ucast_cnt; loop_cnt++) {
13378       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_ucast_tree);
13379       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
13380       offset += 3;
13381       ucast_cipher_type = tvb_get_guint8(tvb, offset);
13382       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13383       offset += 1;
13384       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(ucast_cipher_type, ieee80211_wapi_cipher_type, "Reserved: %d"));
13385     }
13386   proto_item_append_text(ti, " /");
13387   } else {
13388     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of Unicast Cipher suites is 0, must be min 1");
13389     return offset;
13390
13391   }
13392
13393   /* Multicast Cipher Suites*/
13394   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
13395   offset += 3;
13396   mcast_cipher_type = tvb_get_guint8(tvb, offset);
13397   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13398   offset += 1;
13399   proto_item_append_text(ti, " Multicast Cipher: %s", val_to_str(mcast_cipher_type, ieee80211_wapi_cipher_type, "Reserved: %d"));
13400
13401   /* WAPI capability */
13402   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_wapi_param_set_capab,
13403                                     ett_tag_wapi_param_set_preauth_tree, ieee80211_tag_wapi_param_set,
13404                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13405   offset += 2;
13406
13407   /* BKID List: The list can be 0
13408    * Applicable only for assoc/re-assoc
13409    */
13410   if (ftype == MGT_ASSOC_REQ || ftype == MGT_REASSOC_REQ ) {
13411     bkid_cnt = tvb_get_letohs(tvb, offset);
13412     proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13413     offset += 2;
13414     if (bkid_cnt != 0) {
13415       for (loop_cnt = 0; loop_cnt < bkid_cnt; loop_cnt++) {
13416         proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_list, tvb, offset, 16, ENC_NA);
13417         offset += 16;
13418       }
13419     }
13420   }
13421   return offset;
13422 }
13423
13424 static int
13425 dissect_bss_max_idle_period(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13426 {
13427   int offset = 0;
13428   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_period,
13429                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13430   offset += 2;
13431   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_options_protected,
13432                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13433   offset++;
13434   return offset;
13435 }
13436
13437 enum tfs_request_subelem_id {
13438   TFS_REQ_SUBELEM_TFS = 1,
13439   TFS_REQ_SUBELEM_VENDOR_SPECIFIC = 221
13440 };
13441
13442 static const value_string tfs_request_subelem_ids[] = {
13443   { TFS_REQ_SUBELEM_TFS, "TFS subelement" },
13444   { TFS_REQ_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
13445   { 0, NULL }
13446 };
13447
13448 static int
13449 dissect_tfs_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13450 {
13451   int tag_len = tvb_reported_length(tvb);
13452   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13453   int offset = 0;
13454   const guint8 ids[] = {
13455     1, /* TFS Subelement */
13456     TAG_VENDOR_SPECIFIC_IE
13457   };
13458
13459   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_id,
13460                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13461   offset++;
13462   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_delete_after_match,
13463                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13464   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_notify,
13465                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13466   offset++;
13467   if (offset + 1 >= tag_len) {
13468     expert_add_info_format(pinfo, tree, &ei_ieee80211_missing_data,
13469                            "No TFS Request subelements in TFS Request");
13470     return tvb_captured_length(tvb);
13471   }
13472
13473   while (offset + 1 < tag_len) {
13474     guint8 id, len;
13475     int s_offset, s_end;
13476
13477     id = tvb_get_guint8(tvb, offset);
13478     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_id,
13479                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13480     offset++;
13481     len = tvb_get_guint8(tvb, offset);
13482     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_len,
13483                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13484     offset++;
13485     if (offset + len > tag_len) {
13486       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
13487                              "Not enough data for TFS Request subelement");
13488       return tvb_captured_length(tvb);
13489     }
13490     switch (id) {
13491     case TFS_REQ_SUBELEM_TFS:
13492       s_offset = offset;
13493       s_end = offset + len;
13494       while (s_offset < s_end) {
13495         /* TODO 1 is interpreted as TAG_SUPP_RATES, fix this! */
13496         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
13497         if (tlen==0)
13498           break;
13499         s_offset += tlen;
13500       }
13501       break;
13502     default:
13503       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem,
13504                           tvb, offset, len, ENC_NA);
13505       break;
13506     }
13507     offset += len;
13508   }
13509
13510   if (offset < tag_len) {
13511     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
13512                            tvb, offset, tag_len - offset, "Extra data after TFS Subelements");
13513   }
13514
13515   return tvb_captured_length(tvb);
13516 }
13517
13518 enum tfs_response_subelem_id {
13519   TFS_RESP_SUBELEM_TFS_STATUS = 1,
13520   TFS_RESP_SUBELEM_TFS = 2,
13521   TFS_RESP_SUBELEM_VENDOR_SPECIFIC = 221
13522 };
13523
13524 static const value_string tfs_response_subelem_ids[] = {
13525   { TFS_RESP_SUBELEM_TFS_STATUS, "TFS Status subelement" },
13526   { TFS_RESP_SUBELEM_TFS, "TFS subelement" },
13527   { TFS_RESP_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
13528   { 0, NULL }
13529 };
13530
13531 static int
13532 dissect_tfs_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13533 {
13534   int tag_len = tvb_reported_length(tvb);
13535   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13536   int offset = 0;
13537   const guint8 ids[] = {
13538     1, /* TFS Status subelement*/
13539     2, /* TFS subelement */
13540     TAG_VENDOR_SPECIFIC_IE
13541   };
13542
13543   while (offset + 3 <= tag_len) {
13544     guint8 id, len;
13545     int s_offset, s_end;
13546
13547     id = tvb_get_guint8(tvb, offset);
13548     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_id,
13549                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13550     offset++;
13551     len = tvb_get_guint8(tvb, offset);
13552     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_len,
13553                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13554     offset++;
13555     if (offset + len > tag_len) {
13556       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
13557                              "Not enough data for TFS Request subelement");
13558       return tvb_captured_length(tvb);
13559     }
13560     switch (id) {
13561     case TFS_RESP_SUBELEM_TFS_STATUS:
13562       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_status,
13563                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13564       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_id,
13565                           tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
13566       break;
13567     case TFS_RESP_SUBELEM_TFS:
13568       s_offset = offset;
13569       s_end = offset + len;
13570       while (s_offset < s_end) {
13571         /* TODO Element IDs 1 and 2 are misinterpreted! */
13572         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
13573         if (tlen==0)
13574           break;
13575         s_offset += tlen;
13576       }
13577       break;
13578     default:
13579       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem,
13580                           tvb, offset, len, ENC_NA);
13581       break;
13582     }
13583
13584     offset += len;
13585   }
13586
13587   if (offset < tag_len) {
13588     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
13589                            tvb, offset, tag_len - offset, "Extra data after TFS Subelements");
13590   }
13591
13592   return tvb_captured_length(tvb);
13593 }
13594
13595 static const value_string wnm_sleep_mode_action_types[] = {
13596   { 0, "Enter WNM-Sleep Mode" },
13597   { 1, "Exit WNM-Sleep Mode" },
13598   { 0, NULL }
13599 };
13600
13601 static const value_string wnm_sleep_mode_response_status_vals[] = {
13602   { 0, "Enter/Exit WNM-Sleep Mode Accept" },
13603   { 1, "Exit WNM-Sleep Mode Accept, GTK/IGTK update required" },
13604   { 2, "Denied. The AP is unable to perform the requested action." },
13605   { 3, "Denied temporarily. The AP is unable to perform the requested action "
13606     "at the current time. The request can be submitted again at a later time."
13607   },
13608   { 4, "Denied. Due to the pending key expiration." },
13609   { 5, "Denied. The requested action was not granted due to other WNM services "
13610     "in use by the requesting STA." },
13611   { 0, NULL }
13612 };
13613
13614 static int
13615 dissect_wnm_sleep_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13616 {
13617   int offset = 0;
13618   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_action_type,
13619                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13620   offset++;
13621   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_response_status,
13622                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13623   offset++;
13624   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_interval,
13625                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13626   offset += 2;
13627   return offset;
13628 }
13629
13630 static const value_string time_adv_timing_capab_vals[] = {
13631   { 0, "No standardized external time source" },
13632   { 1, "Timestamp offset based on UTC" },
13633   { 2, "UTC time at which the TSF timer is 0" },
13634   { 0, NULL }
13635 };
13636
13637 static int
13638 dissect_time_adv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13639 {
13640   int offset = 0;
13641   guint8 capab;
13642   proto_item *item;
13643   proto_tree *subtree;
13644   struct tm tm, *now;
13645   time_t t;
13646
13647   capab = tvb_get_guint8(tvb, offset);
13648   proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_timing_capab,
13649                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13650   offset += 1;
13651
13652   switch (capab) {
13653   case 1:
13654     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
13655                         tvb, offset, 10, ENC_NA);
13656     offset += 10;
13657
13658     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
13659                         tvb, offset, 5, ENC_NA);
13660     offset += 5;
13661     break;
13662   case 2:
13663     item = proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
13664                                tvb, offset, 10, ENC_NA);
13665     subtree = proto_item_add_subtree(item, ett_tag_time_adv_tree);
13666     memset(&tm, 0, sizeof(tm));
13667     tm.tm_year = tvb_get_letohs(tvb, offset) - 1900;
13668     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_year,
13669                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
13670     offset += 2;
13671     tm.tm_mon = tvb_get_guint8(tvb, offset) - 1;
13672     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_month,
13673                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13674     offset += 1;
13675     tm.tm_mday = tvb_get_guint8(tvb, offset);
13676     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_day,
13677                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13678     offset += 1;
13679     tm.tm_hour = tvb_get_guint8(tvb, offset);
13680     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_hours,
13681                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13682     offset += 1;
13683     tm.tm_min = tvb_get_guint8(tvb, offset);
13684     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_minutes,
13685                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13686     offset += 1;
13687     tm.tm_sec = tvb_get_guint8(tvb, offset);
13688     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_seconds,
13689                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13690     offset += 1;
13691     proto_tree_add_item(subtree,
13692                         hf_ieee80211_tag_time_adv_time_value_milliseconds,
13693                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
13694     offset += 2;
13695     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_reserved,
13696                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13697     offset += 1;
13698
13699     tm.tm_isdst = -1;
13700     t = mktime(&tm);
13701     if (t != -1) {
13702       t += (time_t)(last_timestamp / 1000000);
13703       now = localtime(&t);
13704       if (now)
13705         proto_item_append_text(item,
13706                                ": current time=%u-%02u-%02u %02u:%02u:%02u",
13707                                now->tm_year + 1900, now->tm_mon + 1,
13708                                now->tm_mday, now->tm_hour, now->tm_min,
13709                                now->tm_sec);
13710     }
13711
13712     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
13713                         tvb, offset, 5, ENC_NA);
13714     offset += 5;
13715
13716     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_update_counter,
13717                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13718     offset += 1;
13719     break;
13720   }
13721
13722   return offset;
13723 }
13724
13725 static int
13726 dissect_time_zone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13727 {
13728   int tag_len = tvb_reported_length(tvb);
13729   int offset = 0;
13730
13731   proto_tree_add_item(tree, hf_ieee80211_tag_time_zone, tvb, offset, tag_len,
13732                       ENC_ASCII|ENC_NA);
13733   return tvb_captured_length(tvb);
13734 }
13735
13736 static int
13737 dissect_ap_channel_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13738 {
13739   int tag_len = tvb_reported_length(tvb);
13740   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13741   int offset = 0;
13742
13743   if (tag_len < 1) {
13744     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13745                            "AP Channel Report length %u wrong, must be > 1", tag_len);
13746     return tvb_captured_length(tvb);
13747   }
13748
13749   proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_operating_class, tvb,
13750                       offset, 1, ENC_LITTLE_ENDIAN);
13751   proto_item_append_text(field_data->item_tag, ": Operating Class %u, Channel List :", tvb_get_guint8(tvb, offset));
13752   offset += 1;
13753
13754   while (offset < tag_len)
13755   {
13756     proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_channel_list, tvb, offset, 1, ENC_NA);
13757     proto_item_append_text(field_data->item_tag, " %u,", tvb_get_guint8(tvb, offset));
13758     offset += 1;
13759   }
13760   return tvb_captured_length(tvb);
13761 }
13762
13763 static int
13764 dissect_secondary_channel_offset_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13765 {
13766   int tag_len = tvb_reported_length(tvb);
13767   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13768   int offset = 0;
13769   if (tag_len != 1) {
13770     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13771                            "Secondary Channel Offset length %u wrong, must be = 1", tag_len);
13772     return 1;
13773   }
13774
13775   proto_tree_add_item(tree, hf_ieee80211_tag_secondary_channel_offset, tvb,
13776                       offset, 1, ENC_LITTLE_ENDIAN);
13777   return tvb_captured_length(tvb);
13778 }
13779
13780 /* BSS Average Access Delay element (63) */
13781 static int
13782 dissect_bss_avg_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13783 {
13784   int tag_len = tvb_reported_length(tvb);
13785   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13786   int offset = 0;
13787   if (tag_len != 1) {
13788     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13789                            "BSS Average Access Delay length %u wrong, must be = 1", tag_len);
13790     return 1;
13791   }
13792
13793   proto_tree_add_item(tree, hf_ieee80211_tag_bss_ap_avg_access_delay, tvb,
13794                       offset, 1, ENC_LITTLE_ENDIAN);
13795   return tvb_captured_length(tvb);
13796 }
13797
13798 static int
13799 dissect_antenna_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13800 {
13801   int tag_len = tvb_reported_length(tvb);
13802   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13803   int offset = 0;
13804
13805   if (tag_len != 1) {
13806     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13807                            "Antenna length %u wrong, must be = 1", tag_len);
13808     return 1;
13809   }
13810
13811   proto_tree_add_item(tree, hf_ieee80211_tag_antenna_id, tvb,
13812                       offset, 1, ENC_LITTLE_ENDIAN);
13813
13814   return tvb_captured_length(tvb);
13815 }
13816
13817 static int
13818 dissect_rsni_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13819 {
13820   int tag_len = tvb_reported_length(tvb);
13821   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13822   int offset = 0;
13823
13824   if (tag_len != 1) {
13825     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13826                            "RSNI length %u wrong, must be = 1", tag_len);
13827     return 1;
13828   }
13829
13830   proto_tree_add_item(tree, hf_ieee80211_tag_rsni, tvb,
13831                       offset, 1, ENC_LITTLE_ENDIAN);
13832
13833   return tvb_captured_length(tvb);
13834 }
13835
13836 static int
13837 dissect_measurement_pilot_trans_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13838 {
13839   int tag_len = tvb_reported_length(tvb);
13840   int offset = 0;
13841   const guint8 ids[] = { TAG_VENDOR_SPECIFIC_IE };
13842
13843   /* The tag len can be 1 or more if there are sub-elements */
13844
13845   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
13846                       1, ENC_NA);
13847
13848   tag_len--;
13849   offset++;
13850
13851   /* Also handle the optional sub-elements */
13852
13853   if (tag_len > 0) {
13854     while (tag_len > 0) {
13855       guint8 elt_len;
13856
13857       elt_len = tvb_get_guint8(tvb, offset + 1);
13858
13859       if(add_tagged_field(pinfo, tree, tvb, offset + 2, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
13860         /* TODO: Add an expert info here and skip the field. */
13861         break;
13862       }
13863
13864       tag_len -= elt_len + 2;
13865       offset += elt_len + 2;
13866     }
13867   }
13868
13869   return tvb_captured_length(tvb);
13870 }
13871
13872 static int
13873 dissect_bss_available_admission_capacity_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13874 {
13875   int tag_len = tvb_reported_length(tvb);
13876   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13877   int offset = 0;
13878   guint16 bitmask;
13879   static const int *ieee80211_tag_bss_avb_adm_cap_bitmask[] = {
13880     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
13881     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
13882     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
13883     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
13884     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
13885     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
13886     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
13887     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
13888     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
13889     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
13890     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
13891     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
13892     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
13893     NULL
13894   };
13895
13896   if (tag_len < 2) {
13897     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13898                            "BSS Available Admission Capacity length %u wrong, must > = 2", tag_len);
13899     return offset;
13900   }
13901
13902   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
13903                                     ett_tag_bss_bitmask_tree, ieee80211_tag_bss_avb_adm_cap_bitmask,
13904                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13905   bitmask = tvb_get_letohs(tvb, offset);
13906   offset += 2;
13907
13908   if(bitmask & BSS_BITMASK_UP0)
13909   {
13910     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13911     offset += 2;
13912   }
13913   if(bitmask & BSS_BITMASK_UP1)
13914   {
13915     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13916     offset += 2;
13917   }
13918   if(bitmask & BSS_BITMASK_UP2)
13919   {
13920     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13921     offset += 2;
13922   }
13923   if(bitmask & BSS_BITMASK_UP3)
13924   {
13925     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13926     offset += 2;
13927   }
13928   if(bitmask & BSS_BITMASK_UP4)
13929   {
13930     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13931     offset += 2;
13932   }
13933   if(bitmask & BSS_BITMASK_UP5)
13934   {
13935     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13936     offset += 2;
13937   }
13938   if(bitmask & BSS_BITMASK_UP6)
13939   {
13940     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13941     offset += 2;
13942   }
13943   if(bitmask & BSS_BITMASK_UP7)
13944   {
13945     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13946     offset += 2;
13947   }
13948   if(bitmask & BSS_BITMASK_AC0)
13949   {
13950     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13951     offset += 2;
13952   }
13953   if(bitmask & BSS_BITMASK_AC1)
13954   {
13955     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13956     offset += 2;
13957   }
13958   if(bitmask & BSS_BITMASK_AC2)
13959   {
13960     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13961     offset += 2;
13962   }
13963   if(bitmask & BSS_BITMASK_AC3)
13964   {
13965     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13966     offset += 2;
13967   }
13968   return offset;
13969 }
13970
13971 static int
13972 dissect_bss_ac_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
13973                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
13974 {
13975
13976   if (tag_len != 4) {
13977     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13978                            "BSS AC Access Delay length %u wrong, must = 4", tag_len);
13979     return offset;
13980   }
13981
13982   /* TODO: Display the scaled representation of the average
13983     medium access delay (a big (precalculed) value_string ?)
13984     See 8.4.2.46 BSS AC Access Delay element ... */
13985
13986   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_be, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13987   offset += 1;
13988   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_bk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13989   offset += 1;
13990   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13991   offset += 1;
13992   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vo, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13993   offset += 1;
13994
13995   return offset;
13996 }
13997
13998 /* RM Enabled Capabilities (70) */
13999 static int
14000 dissect_rm_enabled_capabilities_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14001 {
14002   int tag_len = tvb_reported_length(tvb);
14003   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14004   int offset = 0;
14005   proto_item *ti_ex_cap;
14006   static const int *ieee80211_tag_rm_enabled_capabilities_octet1[] = {
14007     &hf_ieee80211_tag_rm_enabled_capabilities_b0,
14008     &hf_ieee80211_tag_rm_enabled_capabilities_b1,
14009     &hf_ieee80211_tag_rm_enabled_capabilities_b2,
14010     &hf_ieee80211_tag_rm_enabled_capabilities_b3,
14011     &hf_ieee80211_tag_rm_enabled_capabilities_b4,
14012     &hf_ieee80211_tag_rm_enabled_capabilities_b5,
14013     &hf_ieee80211_tag_rm_enabled_capabilities_b6,
14014     &hf_ieee80211_tag_rm_enabled_capabilities_b7,
14015     NULL
14016   };
14017
14018   static const int *ieee80211_tag_rm_enabled_capabilities_octet2[] = {
14019     &hf_ieee80211_tag_rm_enabled_capabilities_b8,
14020     &hf_ieee80211_tag_rm_enabled_capabilities_b9,
14021     &hf_ieee80211_tag_rm_enabled_capabilities_b10,
14022     &hf_ieee80211_tag_rm_enabled_capabilities_b11,
14023     &hf_ieee80211_tag_rm_enabled_capabilities_b12,
14024     &hf_ieee80211_tag_rm_enabled_capabilities_b13,
14025     &hf_ieee80211_tag_rm_enabled_capabilities_b14,
14026     &hf_ieee80211_tag_rm_enabled_capabilities_b15,
14027     NULL
14028   };
14029
14030   static const int *ieee80211_tag_rm_enabled_capabilities_octet3[] = {
14031     &hf_ieee80211_tag_rm_enabled_capabilities_b16,
14032     &hf_ieee80211_tag_rm_enabled_capabilities_b17,
14033     &hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
14034     &hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
14035     NULL
14036   };
14037
14038   static const int *ieee80211_tag_rm_enabled_capabilities_octet4[] = {
14039     &hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
14040     &hf_ieee80211_tag_rm_enabled_capabilities_b27,
14041     &hf_ieee80211_tag_rm_enabled_capabilities_b28,
14042     &hf_ieee80211_tag_rm_enabled_capabilities_b29,
14043     &hf_ieee80211_tag_rm_enabled_capabilities_b30,
14044     &hf_ieee80211_tag_rm_enabled_capabilities_b31,
14045     NULL
14046   };
14047
14048   static const int *ieee80211_tag_rm_enabled_capabilities_octet5[] = {
14049     &hf_ieee80211_tag_rm_enabled_capabilities_b32,
14050     &hf_ieee80211_tag_rm_enabled_capabilities_b33,
14051     &hf_ieee80211_tag_rm_enabled_capabilities_o5,
14052     NULL
14053   };
14054
14055   if (tag_len != 5)
14056   {
14057     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "RM Enabled Capabilities length %u wrong, must = 5", tag_len);
14058     return 1;
14059   }
14060   proto_item_append_text(field_data->item_tag, " (%d octets)", tag_len);
14061
14062   /* RM Enabled Capability octet 1 */
14063   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
14064                                     ett_tag_rm_cap1, ieee80211_tag_rm_enabled_capabilities_octet1,
14065                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14066   proto_item_append_text(ti_ex_cap, " (octet 1)");
14067   offset += 1;
14068
14069   /* RM Enabled Capability octet 2 */
14070   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
14071                                     ett_tag_rm_cap2, ieee80211_tag_rm_enabled_capabilities_octet2,
14072                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14073   proto_item_append_text(ti_ex_cap, " (octet 2)");
14074   offset += 1;
14075
14076   /* RM Enabled Capability octet 3 */
14077   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
14078                                     ett_tag_rm_cap3, ieee80211_tag_rm_enabled_capabilities_octet3,
14079                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14080   proto_item_append_text(ti_ex_cap, " (octet 3)");
14081   offset += 1;
14082
14083   /* RM Enabled Capability octet 4 */
14084   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
14085                                     ett_tag_rm_cap4, ieee80211_tag_rm_enabled_capabilities_octet4,
14086                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14087   proto_item_append_text(ti_ex_cap, " (octet 4)");
14088   offset += 1;
14089
14090   /* RM Enabled Capability octet 5 */
14091   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
14092                                     ett_tag_rm_cap5, ieee80211_tag_rm_enabled_capabilities_octet5,
14093                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14094   proto_item_append_text(ti_ex_cap, " (octet 5)");
14095   offset += 1;
14096
14097   return offset;
14098 }
14099
14100 /* 20/40 BSS Coexistence (72) */
14101 static int
14102 dissect_20_40_bss_coexistence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14103 {
14104   int tag_len = tvb_reported_length(tvb);
14105   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14106   int offset = 0;
14107   static const int *ieee80211_20_40_bss_coexistence_fields[] = {
14108     &hf_ieee80211_tag_20_40_bc_information_request,
14109     &hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant,
14110     &hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request,
14111     &hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request,
14112     &hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant,
14113     &hf_ieee80211_tag_20_40_bc_reserved,
14114     NULL
14115   };
14116
14117   if (tag_len != 1)
14118   {
14119     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "20/40 BSS Coexistence length %u wrong, must = 1", tag_len);
14120     return 1;
14121   }
14122
14123   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_20_40_bc,
14124                                     ett_tag_20_40_bc, ieee80211_20_40_bss_coexistence_fields,
14125                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14126
14127   offset += 1;
14128
14129   return offset;
14130 }
14131
14132 static int
14133 dissect_ht_capability_ie_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
14134                          guint32 tag_len, proto_item *ti_len, gboolean vendorspecific)
14135 {
14136   proto_item *cap_item, *ti;
14137   proto_tree *cap_tree;
14138   static const int *ieee80211_ht[] = {
14139     &hf_ieee80211_ht_ldpc_coding,
14140     &hf_ieee80211_ht_chan_width,
14141     &hf_ieee80211_ht_sm_pwsave,
14142     &hf_ieee80211_ht_green,
14143     &hf_ieee80211_ht_short20,
14144     &hf_ieee80211_ht_short40,
14145     &hf_ieee80211_ht_tx_stbc,
14146     &hf_ieee80211_ht_rx_stbc,
14147     &hf_ieee80211_ht_delayed_block_ack,
14148     &hf_ieee80211_ht_max_amsdu,
14149     &hf_ieee80211_ht_dss_cck_40,
14150     &hf_ieee80211_ht_psmp,
14151     &hf_ieee80211_ht_40_mhz_intolerant,
14152     &hf_ieee80211_ht_l_sig,
14153     NULL
14154   };
14155
14156   static const int *ieee80211_htex[] = {
14157     &hf_ieee80211_htex_pco,
14158     &hf_ieee80211_htex_transtime,
14159     &hf_ieee80211_htex_mcs,
14160     &hf_ieee80211_htex_htc_support,
14161     &hf_ieee80211_htex_rd_responder,
14162     NULL
14163   };
14164
14165   static const int *ieee80211_txbf[] = {
14166     &hf_ieee80211_txbf_cap,
14167     &hf_ieee80211_txbf_rcv_ssc,
14168     &hf_ieee80211_txbf_tx_ssc,
14169     &hf_ieee80211_txbf_rcv_ndp,
14170     &hf_ieee80211_txbf_tx_ndp,
14171     &hf_ieee80211_txbf_impl_txbf,
14172     &hf_ieee80211_txbf_calib,
14173     &hf_ieee80211_txbf_expl_csi,
14174     &hf_ieee80211_txbf_expl_uncomp_fm,
14175     &hf_ieee80211_txbf_expl_comp_fm,
14176     &hf_ieee80211_txbf_expl_bf_csi,
14177     &hf_ieee80211_txbf_expl_uncomp_fm_feed,
14178     &hf_ieee80211_txbf_expl_comp_fm_feed,
14179     &hf_ieee80211_txbf_min_group,
14180     &hf_ieee80211_txbf_csi_num_bf_ant,
14181     &hf_ieee80211_txbf_uncomp_sm_bf_ant,
14182     &hf_ieee80211_txbf_comp_sm_bf_ant,
14183     &hf_ieee80211_txbf_csi_max_rows_bf,
14184     &hf_ieee80211_txbf_chan_est,
14185     &hf_ieee80211_txbf_resrv,
14186     NULL
14187   };
14188
14189   static const int *ieee80211_antsel[] = {
14190     &hf_ieee80211_antsel_b0,
14191     &hf_ieee80211_antsel_b1,
14192     &hf_ieee80211_antsel_b2,
14193     &hf_ieee80211_antsel_b3,
14194     &hf_ieee80211_antsel_b4,
14195     &hf_ieee80211_antsel_b5,
14196     &hf_ieee80211_antsel_b6,
14197     &hf_ieee80211_antsel_b7,
14198     NULL
14199   };
14200
14201   if (tag_len != 26) {
14202     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
14203                            "HT Capabilities IE length %u wrong, must be = 26", tag_len);
14204     return (offset > 0) ? offset : 1;
14205   }
14206
14207   if (wlan_ignore_draft_ht && vendorspecific)
14208     return (offset > 0) ? offset : 1;
14209
14210   /* 2 byte HT Capabilities  Info*/
14211   if (vendorspecific)
14212   {
14213     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_vs_cap,
14214                                     ett_ht_cap_tree, ieee80211_ht,
14215                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14216   }
14217   else
14218   {
14219     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_cap,
14220                                     ett_ht_cap_tree, ieee80211_ht,
14221                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14222   }
14223   offset += 2;
14224
14225   /* 1 byte A-MPDU Parameters */
14226   if (vendorspecific)
14227   {
14228     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14229   } else
14230   {
14231     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14232   }
14233   cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
14234   ti = proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14235   proto_item_append_text(ti, " (%04.0f[Bytes])", pow(2, 13+(tvb_get_guint8(tvb, offset) & 0x3))-1);
14236   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu_start_spacing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14237   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14238   offset += 1;
14239
14240   /* 16 byte MCS set */
14241   offset = dissect_mcs_set(tree, tvb, offset, FALSE, vendorspecific);
14242
14243
14244   /* 2 byte HT Extended Capabilities */
14245   if (vendorspecific)
14246   {
14247     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_htex_vs_cap,
14248                                     ett_htex_cap_tree, ieee80211_htex,
14249                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14250   } else {
14251     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_htex_cap,
14252                                     ett_htex_cap_tree, ieee80211_htex,
14253                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14254   }
14255   offset += 2;
14256
14257
14258   /* 4 byte TxBF capabilities */
14259   if (vendorspecific)
14260   {
14261     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_txbf_vs,
14262                                     ett_txbf_tree, ieee80211_txbf,
14263                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14264   } else {
14265     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_txbf,
14266                                     ett_txbf_tree, ieee80211_txbf,
14267                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14268   }
14269   offset += 4;
14270
14271   /* 1 byte Antenna Selection (ASEL) capabilities */
14272   if (vendorspecific)
14273   {
14274     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_antsel_vs,
14275                                     ett_antsel_tree, ieee80211_antsel,
14276                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14277   }
14278   else
14279   {
14280     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_antsel,
14281                                     ett_antsel_tree, ieee80211_antsel,
14282                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14283   }
14284   offset += 1;
14285
14286   return offset;
14287 }
14288
14289 static int
14290 dissect_ht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14291 {
14292   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14293
14294   return dissect_ht_capability_ie_common(tvb, pinfo, tree, 0, tvb_reported_length(tvb),
14295             field_data->item_tag_length, FALSE);
14296 }
14297
14298 static int
14299 dissect_ht_info_ie_1_0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
14300                        guint32 tag_len, proto_item *ti_len)
14301 {
14302   static const int *ieee80211_hta1[] = {
14303     &hf_ieee80211_hta_ext_chan_offset,
14304     &hf_ieee80211_hta_rec_tx_width,
14305     &hf_ieee80211_hta_rifs_mode,
14306     &hf_ieee80211_hta_controlled_access,
14307     &hf_ieee80211_hta_service_interval,
14308     NULL
14309   };
14310
14311   static const int *ieee80211_hta2[] = {
14312     &hf_ieee80211_hta_operating_mode,
14313     &hf_ieee80211_hta_non_gf_devices,
14314     NULL
14315   };
14316
14317   static const int *ieee80211_hta3[] = {
14318     &hf_ieee80211_hta_basic_stbc_mcs,
14319     &hf_ieee80211_hta_dual_stbc_protection,
14320     &hf_ieee80211_hta_secondary_beacon,
14321     &hf_ieee80211_hta_lsig_txop_protection,
14322     &hf_ieee80211_hta_pco_active,
14323     &hf_ieee80211_hta_pco_phase,
14324     NULL
14325   };
14326
14327   if (tag_len != 22) {
14328     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
14329                            "Tag length %u wrong, must be = 22", tag_len);
14330     return offset;
14331   }
14332
14333   if (wlan_ignore_draft_ht)
14334     return offset;
14335
14336   /* 1 HT Control Channel */
14337   proto_tree_add_item(tree, hf_ieee80211_hta_cc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14338   offset += 1;
14339
14340   /* 1 byte HT additional capabilities */
14341   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap1,
14342                                     ett_hta_cap_tree, ieee80211_hta1,
14343                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14344   offset += 1;
14345
14346   /* 2 byte HT additional capabilities */
14347   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap2,
14348                                     ett_hta_cap1_tree, ieee80211_hta2,
14349                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14350   offset += 2;
14351
14352   /* 2 byte HT additional capabilities */
14353   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap2,
14354                                     ett_hta_cap2_tree, ieee80211_hta3,
14355                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14356   offset += 2;
14357
14358   /* 16 byte Supported MCS set */
14359   offset = dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
14360
14361   return offset;
14362 }
14363
14364 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
14365
14366 /*
14367  * 8.2.4.1.10 "Order field" says:
14368  *
14369  *  The Order field is 1 bit in length. It is used for two purposes:
14370  *
14371  *    -- It is set to 1 in a non-QoS data frame transmitted by a non-QoS
14372  *       STA to indicate that the frame contains an MSDU, or fragment
14373  *       thereof, that is being transferred using the StrictlyOrdered
14374  *       service class.
14375  *
14376  *    -- It is set to 1 in a QoS data or management frame transmitted
14377  *       with a value of HT_GF or HT_MF for the FORMAT parameter of the
14378  *       TXVECTOR to indicate that the frame contains an HT Control field.
14379  *
14380  * 802.11ac changes the second of those clauses to say "HT_GF, HT_MF,
14381  * or VHT", indicates that bit B0 of the field is 0 for HT and 1 for
14382  * VHT (stealing a reserved bit from the Link Adaptation Control field),
14383  * and that everything except for "AC Constraint" and "RDG/More Cowbell^W
14384  * PPDU" is different for the VHT version.
14385  *
14386  *  802.11ax changes the meaning of the first two bits:
14387  *
14388  *     B0 = 0         means High Throughput
14389  *     B0 = 1, B1 = 0 means Very High Throughput
14390  *     B0 = 1, B1 = 1 means High Efficiency
14391  *
14392  * I read the second clause of 8.2.4.1.10 "Order field", as modified by
14393  * 802.11ac, as meaning that, for QoS data and management frames, the
14394  * Order field will *only* be set to 1 for HT or VHT frames, and therefore
14395  * that we do *not* have to determine, from radio metadata, whether the
14396  * frame was transmitted as an HT or VHT frame.
14397  *
14398  * (See bug 11351, in which a frame with an HT Control field, with a
14399  * radiotap header, lacks the MCS or VHT fields in the radiotap header,
14400  * so Wireshark has no clue that it's an HT or VHT field, and misdissected
14401  * the packet.  Omnipeek, which also appeared to have no clue that it was
14402  * an HT or VHT field - it called it an 802.11b frame - *did* dissect the
14403  * HT Control field.)
14404  *
14405  * 802.11ax changes the reserved bit to differentiate between the HE version
14406  * and the VHT version, and adds different types of Aggregate Control info.
14407  */
14408 #define A_CONTROL_UMRS 0
14409 #define A_CONTROL_OM   1
14410 #define A_CONTROL_HLA  2
14411 #define A_CONTROL_BSR  3
14412 #define A_CONTROL_UPH  4
14413 #define A_CONTROL_BQR  5
14414 #define A_CONTROL_CCI  6
14415 #define A_CONTROL_BQR_REV 0x0A
14416
14417 static const value_string a_control_control_id_vals[] = {
14418   { A_CONTROL_UMRS, "UL MU response scheduling" },
14419   { A_CONTROL_OM,   "Operating mode" },
14420   { A_CONTROL_HLA,  "HE link adaptation" },
14421   { A_CONTROL_BSR,  "Buffer status report" },
14422   { A_CONTROL_UPH,  "UL power headroom" },
14423   { A_CONTROL_BQR,  "Bandwidth query report" },
14424   { A_CONTROL_CCI,  "Command Control Indication" },
14425   { A_CONTROL_BQR_REV, "Bandwidth Query Report (reversed bits)" },
14426   { 0, NULL }
14427 };
14428
14429 /*
14430  * Print the UL target RSSI field as per the spec.
14431  *  0->30 map to -90 to -30 dBm.
14432  *  31 maps to Max ransmit power
14433  */
14434 static void
14435 ul_target_rssi_base_custom(gchar *result, guint32 target_rssi)
14436 {
14437   if (target_rssi <= 30) {
14438     g_snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -90 + (2 * target_rssi));
14439   } else if (target_rssi == 31) {
14440     g_snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power");
14441   }
14442 }
14443
14444 static void
14445 dissect_a_control_umrs(proto_tree *tree, tvbuff_t *tvb, int offset,
14446   guint32 bits _U_, guint32 start_bit)
14447 {
14448   start_bit += offset * 8;
14449   proto_tree_add_bits_item(tree, hf_ieee80211_he_umrs_he_tb_ppdu_len, tvb,
14450                         start_bit, 5, ENC_LITTLE_ENDIAN);
14451   proto_tree_add_bits_item(tree, hf_ieee80211_he_umrs_ru_allocation, tvb,
14452                         start_bit + 5, 8, ENC_LITTLE_ENDIAN);
14453   proto_tree_add_bits_item(tree, hf_ieee80211_he_dl_tx_power, tvb,
14454                         start_bit + 13, 5, ENC_LITTLE_ENDIAN);
14455   proto_tree_add_bits_item(tree, hf_ieee80211_he_ul_target_rssi, tvb,
14456                         start_bit + 18, 5, ENC_LITTLE_ENDIAN);
14457   proto_tree_add_bits_item(tree, hf_ieee80211_he_ul_mcs, tvb,
14458                         start_bit + 23, 2, ENC_LITTLE_ENDIAN);
14459 }
14460
14461 static void
14462 dissect_a_control_om(proto_tree *tree, tvbuff_t *tvb, int offset,
14463   guint32 bits _U_, guint32 start_bit)
14464 {
14465   start_bit += offset * 8;
14466   proto_tree_add_bits_item(tree, hf_ieee80211_he_om_rx_nss, tvb, start_bit, 3,
14467                         ENC_LITTLE_ENDIAN);
14468   proto_tree_add_bits_item(tree, hf_ieee80211_he_om_channel_width, tvb,
14469                         start_bit + 3, 2, ENC_LITTLE_ENDIAN);
14470   proto_tree_add_bits_item(tree, hf_ieee80211_he_om_ul_mu_disable, tvb,
14471                         start_bit + 5, 1, ENC_LITTLE_ENDIAN);
14472   proto_tree_add_bits_item(tree, hf_ieee80211_he_om_tx_nsts, tvb, start_bit + 6,
14473                         3, ENC_LITTLE_ENDIAN);
14474 }
14475
14476 static void
14477 dissect_a_control_hla(proto_tree *tree, tvbuff_t *tvb, int offset,
14478   guint32 bits _U_, guint32 start_bit)
14479 {
14480   start_bit += offset * 8;
14481   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_unsolicited_mfb, tvb,
14482                         start_bit, 1, ENC_LITTLE_ENDIAN);
14483   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_mrq, tvb,
14484                         start_bit + 1, 1, ENC_LITTLE_ENDIAN);
14485   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_nss, tvb,
14486                         start_bit + 2, 3, ENC_LITTLE_ENDIAN);
14487   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_he_mcs, tvb,
14488                         start_bit + 5, 4, ENC_LITTLE_ENDIAN);
14489   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_dcm, tvb,
14490                         start_bit +9, 1, ENC_LITTLE_ENDIAN);
14491   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_ru, tvb,
14492                         start_bit + 10, 8, ENC_LITTLE_ENDIAN);
14493   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_bw, tvb,
14494                         start_bit + 18, 2, ENC_LITTLE_ENDIAN);
14495   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_msi_ppdu_type, tvb,
14496                         start_bit + 20, 3, ENC_LITTLE_ENDIAN);
14497   proto_tree_add_bits_item(tree, hf_ieee80211_he_hla_tx_bf, tvb,
14498                         start_bit + 23, 1, ENC_LITTLE_ENDIAN);
14499 }
14500
14501 static void
14502 dissect_a_control_bsr(proto_tree *tree, tvbuff_t *tvb, int offset,
14503   guint32 bits _U_, guint32 start_bit)
14504 {
14505   start_bit += offset * 8;
14506   proto_tree_add_bits_item(tree, hf_ieee80211_he_bsr_aci_bitmap, tvb,
14507                         start_bit, 4, ENC_LITTLE_ENDIAN);
14508   proto_tree_add_bits_item(tree, hf_ieee80211_he_bsr_delta_tid, tvb,
14509                         start_bit + 4, 2, ENC_LITTLE_ENDIAN);
14510   proto_tree_add_bits_item(tree, hf_ieee80211_he_bsr_aci_high, tvb,
14511                         start_bit + 6, 2, ENC_LITTLE_ENDIAN);
14512   proto_tree_add_bits_item(tree, hf_ieee80211_he_bsr_scaling_factor, tvb,
14513                         start_bit + 8, 2, ENC_LITTLE_ENDIAN);
14514   proto_tree_add_bits_item(tree, hf_ieee80211_he_bsr_queue_size_high, tvb,
14515                         start_bit + 10, 8, ENC_LITTLE_ENDIAN);
14516   proto_tree_add_bits_item(tree, hf_ieee80211_he_bsr_queue_size_all, tvb,
14517                         start_bit + 26, 8, ENC_LITTLE_ENDIAN);
14518
14519 }
14520
14521 static void
14522 dissect_a_control_uph(proto_tree *tree, tvbuff_t *tvb, int offset,
14523   guint32 bits _U_, guint32 start_bit)
14524 {
14525   start_bit += offset * 8;
14526   proto_tree_add_bits_item(tree, hf_ieee80211_he_uph_ul_power_headroom, tvb,
14527                         start_bit, 5, ENC_LITTLE_ENDIAN);
14528   proto_tree_add_bits_item(tree, hf_ieee80211_he_uph_ul_min_transmit_power_flag,
14529                         tvb, start_bit + 5, 1, ENC_LITTLE_ENDIAN);
14530
14531 }
14532
14533 static void
14534 dissect_a_control_bqr(proto_tree *tree, tvbuff_t *tvb, int offset,
14535   guint32 bits _U_, guint32 start_bit)
14536 {
14537   start_bit += offset * 8;
14538   proto_tree_add_bits_item(tree, hf_ieee80211_he_btc_avail_chan, tvb, start_bit,
14539                         8, ENC_LITTLE_ENDIAN);
14540   proto_tree_add_bits_item(tree, hf_ieee80211_he_btc_reserved, tvb,
14541                         start_bit + 8, 2, ENC_LITTLE_ENDIAN);
14542 }
14543
14544 static void
14545 dissect_a_control_cci(proto_tree *tree, tvbuff_t *tvb, int offset,
14546   guint32 bits _U_, guint32 start_bit)
14547 {
14548   start_bit += offset * 8;
14549   proto_tree_add_bits_item(tree, hf_ieee80211_he_cci_ac_constraint, tvb,
14550                         start_bit, 1, ENC_LITTLE_ENDIAN);
14551   proto_tree_add_bits_item(tree, hf_ieee80211_he_cci_rdg_more_ppdu, tvb,
14552                         start_bit + 1, 1, ENC_LITTLE_ENDIAN);
14553   proto_tree_add_bits_item(tree, hf_ieee80211_he_cci_sr_ppdu_indic, tvb,
14554                         start_bit + 2, 1, ENC_LITTLE_ENDIAN);
14555
14556 }
14557
14558 static void
14559 dissect_ht_control(proto_tree *tree, tvbuff_t *tvb, int offset)
14560 {
14561   proto_item *ti;
14562   proto_tree *htc_tree, *lac_subtree, *mfb_subtree;
14563   guint32 htc;
14564
14565   htc = tvb_get_letohl(tvb, offset);
14566
14567   ti = proto_tree_add_item(tree, hf_ieee80211_htc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14568   htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
14569
14570   /* Check the HT vs. VHT bit. */
14571   proto_tree_add_item(htc_tree, hf_ieee80211_htc_vht, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14572   if (htc & HTC_VHT) {
14573     /* VHT or HE */
14574     proto_tree_add_item(htc_tree, hf_ieee80211_htc_he, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14575     if (htc & HTC_HE) {
14576       /*
14577        * We have a 30-bit field, of which the first is a 4-bit Control ID which
14578        * determines how the rest is handled. There can be multiple fields.
14579        */
14580       proto_tree *a_control_tree = NULL;
14581       proto_item *pi = NULL;
14582       guint8 start_bit_offset = 2;
14583
14584       a_control_tree = proto_tree_add_subtree(htc_tree, tvb, offset, 4,
14585                                 ett_htc_he_a_control, NULL, "Aggregate Control");
14586       while (start_bit_offset < 32) {
14587         guint8 control_id = (htc >> start_bit_offset) & 0x0F;
14588         start_bit_offset += 4;
14589         pi = proto_tree_add_uint(a_control_tree, hf_ieee80211_htc_he_ctrl_id,
14590                         tvb, offset, 4, control_id);
14591         proto_item_append_text(pi, ": %s",
14592                         val_to_str(control_id, a_control_control_id_vals,
14593                                         "Reserved (%u)"));
14594         switch (control_id) {
14595         case A_CONTROL_UMRS:
14596           dissect_a_control_umrs(a_control_tree, tvb, offset, htc, start_bit_offset);
14597           start_bit_offset += 26;
14598           break;
14599         case A_CONTROL_OM:
14600           dissect_a_control_om(a_control_tree, tvb, offset, htc, start_bit_offset);
14601           start_bit_offset += 12;
14602           break;
14603         case A_CONTROL_HLA:
14604           dissect_a_control_hla(a_control_tree, tvb, offset, htc, start_bit_offset);
14605           start_bit_offset += 26;
14606           break;
14607         case A_CONTROL_BSR:
14608           dissect_a_control_bsr(a_control_tree, tvb, offset, htc, start_bit_offset);
14609           start_bit_offset += 26;
14610           break;
14611         case A_CONTROL_UPH:
14612           dissect_a_control_uph(a_control_tree, tvb, offset, htc, start_bit_offset);
14613           start_bit_offset += 8;
14614           break;
14615         case A_CONTROL_BQR:
14616         case A_CONTROL_BQR_REV:
14617           dissect_a_control_bqr(a_control_tree, tvb, offset, htc, start_bit_offset);
14618           start_bit_offset += 10;
14619           break;
14620         case A_CONTROL_CCI:
14621           dissect_a_control_cci(a_control_tree, tvb, offset, htc, start_bit_offset);
14622           start_bit_offset += 8;
14623           break;
14624         default:
14625           /* Add an expert info ... */
14626           start_bit_offset += 32;  /* Abandon */
14627           break;
14628         }
14629       }
14630     } else {
14631       proto_tree_add_item(htc_tree, hf_ieee80211_htc_mrq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14632       if (!(htc & HTC_UNSOLICITED_MFB)) {
14633         if (htc & HTC_MRQ) {
14634           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14635         } else {
14636           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14637         }
14638         proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfsi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14639       } else {
14640         if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
14641           proto_tree_add_item(htc_tree, hf_ieee80211_htc_compressed_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14642           proto_tree_add_item(htc_tree, hf_ieee80211_htc_ppdu_stbc_encoded, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14643         } else {
14644           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14645         }
14646         proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_l, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14647       }
14648       ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14649       mfb_subtree = proto_item_add_subtree(ti, ett_mfb_subtree);
14650       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_num_sts, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14651       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_vht_mcs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14652       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_bw, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14653       /* This should be converted to dB by adding 22  */
14654       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_snr, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14655       if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
14656         proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14657         proto_tree_add_item(htc_tree, hf_ieee80211_htc_coding_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14658         proto_tree_add_item(htc_tree, hf_ieee80211_htc_fb_tx_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14659       } else {
14660         proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14661       }
14662       proto_tree_add_item(htc_tree, hf_ieee80211_htc_unsolicited_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14663     }
14664   } else {
14665     /* Start: Link Adaptation Control */
14666     ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_ht_lac, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14667     lac_subtree = proto_item_add_subtree(ti, ett_lac_subtree);
14668     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_trq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14669
14670     if (HTC_IS_ASELI(htc)) {
14671       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_aseli, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14672     } else {
14673       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_mrq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14674       if (HTC_LAC_MAI_MRQ(htc)) {
14675         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_msi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14676       } else {
14677         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14678       }
14679     }
14680
14681     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14682
14683     if (HTC_IS_ASELI(htc)) {
14684       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14685       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_data, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14686     } else {
14687       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14688     }
14689     /* End: Link Adaptation Control */
14690
14691     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_pos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14692     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_seq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14693     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14694     proto_tree_add_item(htc_tree, hf_ieee80211_htc_csi_steering, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14695
14696     proto_tree_add_item(htc_tree, hf_ieee80211_htc_ndp_announcement, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14697     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14698   }
14699
14700   /*
14701    * These bits are part of the Aggregate Control field for 802.11ax
14702    */
14703   if (!(htc & HTC_HE)) {
14704     proto_tree_add_item(htc_tree, hf_ieee80211_htc_ac_constraint, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14705     proto_tree_add_item(htc_tree, hf_ieee80211_htc_rdg_more_ppdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14706   }
14707
14708   /* offset += 2; */
14709 }
14710
14711 #define IEEE80211_COMMON_OPT_BROKEN_FC         0x00000001
14712 #define IEEE80211_COMMON_OPT_IS_CENTRINO       0x00000002
14713 #define IEEE80211_COMMON_OPT_NORMAL_QOS        0x00000004
14714
14715 static void
14716 dissect_frame_control(proto_tree *tree, tvbuff_t *tvb, guint32 option_flags,
14717                       guint32 offset, packet_info *pinfo)
14718 {
14719   guint16 fcf, flags, frame_type_subtype;
14720   proto_tree *fc_tree, *flag_tree;
14721   proto_item *fc_item, *flag_item, *hidden_item, *ti;
14722
14723   fcf = FETCH_FCF(offset);
14724
14725   flags = FCF_FLAGS(fcf);
14726   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
14727
14728   /* Swap offset... */
14729   if(option_flags & IEEE80211_COMMON_OPT_BROKEN_FC)
14730   {
14731     offset += 1;
14732   }
14733
14734   proto_tree_add_uint(tree, hf_ieee80211_fc_frame_type_subtype, tvb, offset, 1, frame_type_subtype);
14735
14736   fc_item = proto_tree_add_item(tree, hf_ieee80211_fc_field, tvb, offset, 2, ENC_BIG_ENDIAN);
14737
14738   fc_tree = proto_item_add_subtree(fc_item, ett_fc_tree);
14739
14740   proto_tree_add_item(fc_tree, hf_ieee80211_fc_proto_version, tvb, offset, 1, ENC_NA);
14741   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_type, tvb, offset, 1, ENC_NA);
14742   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_subtype, tvb, offset, 1, ENC_NA);
14743   /* Changing control frame extension for extension frames */
14744   if(IS_FRAME_EXTENSION(fcf) == 1) {
14745     proto_tree_add_uint(fc_tree, hf_ieee80211_fc_frame_extension, tvb, offset, 1, FCF_FRAME_EXTENSION(fcf));
14746   }
14747   offset += 1;
14748
14749   /* Reswap offset...*/
14750   if(option_flags & IEEE80211_COMMON_OPT_BROKEN_FC)
14751   {
14752     offset -= 1;
14753     proto_item_append_text(fc_item, "(Swapped)");
14754   }
14755
14756   /* Flags */
14757   flag_item = proto_tree_add_item(fc_tree, hf_ieee80211_fc_flags, tvb, offset, 1, ENC_NA);
14758   flag_tree = proto_item_add_subtree(flag_item, ett_proto_flags);
14759   /* Changing control frame flags for extension frames */
14760   if(IS_FRAME_EXTENSION(fcf) == 0) {
14761     proto_tree_add_item(flag_tree, hf_ieee80211_fc_data_ds, tvb, offset, 1, ENC_NA);
14762     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_to_ds, tvb, offset, 1, ENC_NA);
14763     PROTO_ITEM_SET_HIDDEN(hidden_item);
14764     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_from_ds, tvb, offset, 1, ENC_NA);
14765     PROTO_ITEM_SET_HIDDEN(hidden_item);
14766     proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_frag, tvb, offset, 1, ENC_NA);
14767     ti = proto_tree_add_item(flag_tree, hf_ieee80211_fc_retry, tvb, offset, 1, ENC_NA);
14768     if( IS_RETRY(flags) )
14769     {
14770       expert_add_info(pinfo, ti, &ei_ieee80211_fc_retry);
14771       wlan_stats.fc_retry = 1;
14772     }
14773   }
14774   proto_tree_add_item(flag_tree, hf_ieee80211_fc_pwr_mgt, tvb, offset, 1, ENC_NA);
14775   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_data, tvb, offset, 1, ENC_NA);
14776   /* Changing control frame flags for extension frames */
14777   if(IS_FRAME_EXTENSION(fcf) == 0) {
14778     proto_tree_add_item(flag_tree, hf_ieee80211_fc_protected, tvb, offset, 1, ENC_NA);
14779   }
14780   proto_tree_add_item(flag_tree, hf_ieee80211_fc_order, tvb, offset, 1, ENC_NA);
14781 }
14782
14783 static void
14784 dissect_durid(proto_tree *hdr_tree, tvbuff_t *tvb, guint16 fts, gint offset)
14785 {
14786   guint16 durid = tvb_get_letohs(tvb, offset);
14787
14788   if (durid < 0x8000) {
14789     proto_tree_add_uint_format_value(hdr_tree, hf_ieee80211_did_duration, tvb,
14790       offset, 2, durid, "%u microseconds", durid);
14791   } else if (((durid & 0xC000) == 0xC000) &&
14792              ((durid & 0x3FFF) > 0) && ((durid & 0x3FFF) <= 2007) &&
14793              (fts == CTRL_PS_POLL)) {
14794     proto_tree_add_item(hdr_tree, hf_ieee80211_assoc_id, tvb, offset, 2,
14795       ENC_LITTLE_ENDIAN);
14796   } else if (durid == 0x8000) {
14797     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
14798       offset, 2, durid, "Duration/ID: %u", durid);
14799   } else {
14800     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
14801       offset, 2, durid, "Duration/ID: %u (reserved)", durid & 0x3FFF);
14802   }
14803 }
14804
14805
14806 static void
14807 dissect_vendor_ie_ht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
14808                     guint offset, proto_item *item, proto_item *ti_len, gint tag_len)
14809 {
14810
14811   guint8 type;
14812
14813   proto_tree_add_item(tree, hf_ieee80211_ht_pren_type, tvb, offset, 1, ENC_NA);
14814   type = tvb_get_guint8(tvb, offset);
14815   offset += 1;
14816   tag_len -= 1;
14817
14818
14819   switch(type){
14820     case 51:
14821       dissect_ht_capability_ie_common(tvb, pinfo, tree, offset, tag_len, ti_len, TRUE);
14822       proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
14823     break;
14824
14825     case 52:
14826       dissect_ht_info_ie_1_0(tvb, pinfo, tree, offset, tag_len, ti_len);
14827       proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
14828     break;
14829
14830     default:
14831       proto_tree_add_item(tree, hf_ieee80211_ht_pren_unknown, tvb, offset, tag_len, ENC_NA);
14832     break;
14833   }
14834
14835 }
14836
14837 static int
14838 dissect_interworking(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14839 {
14840   int tag_len = tvb_reported_length(tvb);
14841   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14842   int offset = 0;
14843   static const int *ieee80211_tag_interworking[] = {
14844     &hf_ieee80211_tag_interworking_access_network_type,
14845     &hf_ieee80211_tag_interworking_internet,
14846     &hf_ieee80211_tag_interworking_asra,
14847     &hf_ieee80211_tag_interworking_esr,
14848     &hf_ieee80211_tag_interworking_uesa,
14849     NULL
14850   };
14851
14852   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_interworking, ENC_LITTLE_ENDIAN);
14853   offset += 1;
14854
14855   if ((tag_len == (1 + 2)) || (tag_len == (1 + 2 + 6))) {
14856     dissect_venue_info(tree, tvb, offset);
14857     offset += 2;
14858   }
14859
14860   if ((tag_len == (1 + 6)) || (tag_len == (1 + 2 + 6))) {
14861     proto_tree_add_item(tree, hf_ieee80211_tag_interworking_hessid,
14862                         tvb, offset, 6, ENC_NA);
14863     offset += 6;
14864   }
14865
14866   if ((tag_len != 1) && (tag_len != (1 + 2)) && (tag_len != (1 + 6)) && (tag_len != (1 + 2 + 6))) {
14867     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14868                            "Invalid Interworking element length");
14869   }
14870
14871   return offset;
14872 }
14873
14874 static int
14875 dissect_qos_map_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14876 {
14877   int tag_len = tvb_reported_length(tvb);
14878   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14879   int offset = 0;
14880   guint8 left;
14881   guint8 val, val2;
14882   int i;
14883   proto_item *dscp_item, *item;
14884   proto_tree *dscp_tree;
14885
14886   if (tag_len < 16 || tag_len & 1) {
14887     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_bad_length,
14888                                 "Truncated QoS Map Set element");
14889     return tvb_captured_length(tvb);
14890   }
14891
14892   left = tag_len - 16;
14893   while (left >= 2) {
14894     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_dscp_exc,
14895                                     tvb, offset, 2, ENC_NA);
14896     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
14897
14898     item = proto_tree_add_item(dscp_tree,
14899                                hf_ieee80211_tag_qos_map_set_dscp_exc_val,
14900                                tvb, offset, 1, ENC_NA);
14901     val = tvb_get_guint8(tvb, offset);
14902     if (val > 63 && val != 255) {
14903       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
14904                                   "Invalid DSCP Value");
14905     }
14906     offset++;
14907
14908     item = proto_tree_add_item(dscp_tree,
14909                                hf_ieee80211_tag_qos_map_set_dscp_exc_up,
14910                                tvb, offset, 1, ENC_NA);
14911     val2 = tvb_get_guint8(tvb, offset);
14912     if (val2 > 7) {
14913       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
14914                                   "Invalid User Priority");
14915     }
14916     offset++;
14917
14918     proto_item_append_text(dscp_item, " (0x%02x: UP %u)", val, val2);
14919
14920     left -= 2;
14921   }
14922
14923   for (i = 0; i < 8; i++) {
14924     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_range,
14925                                     tvb, offset, 2, ENC_NA);
14926     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
14927
14928     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_low,
14929                                tvb, offset, 1, ENC_NA);
14930     val = tvb_get_guint8(tvb, offset);
14931     if (val > 63 && val != 255) {
14932       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
14933                                   "Invalid DSCP Value");
14934     }
14935     offset++;
14936
14937     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_high,
14938                                tvb, offset, 1, ENC_NA);
14939     val2 = tvb_get_guint8(tvb, offset);
14940     if ((val2 > 63 && val2 != 255) || val2 < val ||
14941         (val == 255 && val2 != 255) || (val != 255 && val2 == 255)) {
14942       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
14943                                   "Invalid DSCP Value");
14944     }
14945     offset++;
14946
14947     if (val == 255 && val2 == 255) {
14948       proto_item_append_text(dscp_item, " (UP %u not in use)", i);
14949     } else {
14950       proto_item_append_text(dscp_item, " (0x%02x-0x%02x: UP %u)",
14951                              val, val2, i);
14952     }
14953   }
14954
14955   return tvb_captured_length(tvb);
14956 }
14957
14958 static int
14959 dissect_roaming_consortium(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14960 {
14961   int tag_len = tvb_reported_length(tvb);
14962   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14963   int offset = 0;
14964   proto_item* item;
14965   guint8 oi_lens, oi1_len, oi2_len;
14966
14967   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
14968                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14969   offset += 1;
14970
14971   oi_lens = tvb_get_guint8(tvb, offset);
14972   oi1_len = oi_lens & 0x0f;
14973   oi2_len = (oi_lens & 0xf0) >> 4;
14974   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1_len,
14975                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14976   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2_len,
14977                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14978   offset += 1;
14979
14980   if (offset + oi1_len > tag_len) {
14981     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14982                            "Truncated Roaming Consortium element");
14983     return tvb_captured_length(tvb);
14984   }
14985
14986   item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1,
14987                              tvb, offset, oi1_len, ENC_NA);
14988   add_manuf(item, tvb, offset);
14989   offset += oi1_len;
14990
14991   if (offset + oi2_len > tag_len) {
14992     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14993                            "Truncated Roaming Consortium element");
14994     return tvb_captured_length(tvb);
14995   }
14996
14997   if (oi2_len > 0) {
14998     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2,
14999                         tvb, offset, oi2_len, ENC_NA);
15000     offset += oi2_len;
15001   }
15002
15003   if (tag_len > offset) {
15004     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi3,
15005                         tvb, offset, tag_len - offset, ENC_NA);
15006   }
15007
15008   return tvb_captured_length(tvb);
15009 }
15010
15011
15012 /* ************************************************************************* */
15013 /*           Dissect and add tagged (optional) fields to proto tree          */
15014 /* ************************************************************************* */
15015
15016 static int beacon_padding = 0; /* beacon padding bug */
15017
15018 static int
15019 ieee80211_tag_ssid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15020 {
15021   int tag_len = tvb_reported_length(tvb);
15022   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15023   int offset = 0;
15024   /* 7.3.2.1 SSID element (0) */
15025   gchar *ssid; /* The SSID may consist of arbitrary bytes */
15026   gint ssid_len = tag_len;
15027
15028   if (beacon_padding != 0) /* padding bug */
15029     return offset;
15030
15031   if (ssid_len > MAX_SSID_LEN) {
15032     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15033                            "SSID length (%u) greater than maximum (%u)",
15034                            ssid_len, MAX_SSID_LEN);
15035     ssid_len = MAX_SSID_LEN;
15036   }
15037
15038   /*
15039    * XXX - the 802.11 specs aren't particularly clear on how the SSID
15040    * is to be interpreted.
15041    *
15042    * IEEE Std 802.11-1999, section 7.3.2.2 "Service Set Identity (SSID)
15043    * element" says just
15044    *
15045    *    The length of the SSID information field is between 0 and 32
15046    *    octets. A 0 length information field indicates the broadcast SSID.
15047    *
15048    * with no indication that those octets encode a string.
15049    *
15050    * IEEE Std 802.11-2012, section 8.4.2.2 "SSID element", says that *but*
15051    * says after it
15052    *
15053    *    When the UTF-8 SSID subfield of the Extended Capabilities element
15054    *    is equal to 1 in the frame that includes the SSID element, the
15055    *    SSID is interpreted using UTF-8 encoding.
15056    *
15057    *    NOTE -- This is true for Beacon and Probe Response frames when the
15058    *    MLME-START.request primitive was issued with the SSIDEncoding
15059    *    parameter equal to UTF-8.
15060    *
15061    * and the SSIDEncoding parameter can either be UNSPECIFIED or UTF-8.
15062    *
15063    * So I *guess* that means that, if the UTF-8 SSID subfield isn't
15064    * equal to 1, the SSID is, in theory, just a bunch of octets, but
15065    * in practice, *probably* ASCII as that's the typical convention,
15066    * and, if it is equal to 1, it's a UTF-8 string.  (Of course, a
15067    * host can put anything there it wants to, so we shouldn't just
15068    * assume that it's *valid* ASCII or *valid* UTF-8.)
15069    *
15070    * So we really should extract it as an array of ssid_len bytes,
15071    * pass those bytes to Dot11DecryptSetLastSSID(), and:
15072    *
15073    *    If the UTF-8 SSID subfield isn't set to 1, put the SSID in
15074    *    as an ENC_ASCII string;
15075    *
15076    *    If the UTF-8 SSID subfield is set to 1, put it in as an
15077    *    ENC_UTF_8 string;
15078    *
15079    * and rely on the libwireshark core code to somehow deal with
15080    * non-ASCII characters or invalid UTF-8 sequences or valid-but-
15081    * not-all-printable ASCII or UTF-8 strings in the protocol tree
15082    * display.  I'm not sure we can currently rely on it to handle
15083    * invalid UTF-8 or non-printable characters in UTF-8 strings,
15084    * however, so we just treat it as ASCII for now.
15085    *
15086    * We also need a better way of getting the display format of a
15087    * string value, so we can do something other than run it through
15088    * format_text(), which won't handle UTF-8.
15089    *
15090    * Addendum: 802.11 2012 points out that a Zero-length SSID means
15091    * the Wildcard SSID. Make it so. From 8.4.2.2 of 802.11 2012:
15092    *
15093    * "The length of the SSID field is between 0 and 32 octets. A SSID
15094    *  field of length 0 is used within Probe Request management frames to
15095    *  indicate the wildcard SSID. The wildcard SSID is also used in
15096    *  Beacon and Probe Response frames transmitted by mesh STAs."
15097    *
15098    * Also, we have to return a non-zero value here to prevent an ugly
15099    * undissected field warning. Since this code is only called from
15100    * one place and is used in call to dissector_try_uint_new, it is
15101    * OK to do so.
15102    */
15103   ssid = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, ssid_len, ENC_ASCII);
15104   if (ssid_len == (gint)tag_len) {
15105     Dot11DecryptSetLastSSID(&dot11decrypt_ctx, (CHAR *) ssid, ssid_len);
15106   }
15107   proto_tree_add_item(tree, hf_ieee80211_tag_ssid, tvb, offset, tag_len,
15108                       ENC_ASCII|ENC_NA);
15109
15110   if (ssid_len > 0) {
15111     gchar* s = format_text(wmem_packet_scope(), ssid, ssid_len);
15112     proto_item_append_text(field_data->item_tag, ": %s", s);
15113
15114     col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", s);
15115
15116     /* Wlan Stats */
15117     memcpy(wlan_stats.ssid, ssid, MIN(ssid_len, MAX_SSID_LEN));
15118     wlan_stats.ssid_len = ssid_len;
15119   } else {
15120     proto_item_append_text(field_data->item_tag, ": Wildcard SSID");
15121
15122     col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Wildcard (Broadcast)");
15123     offset += 1; // Make sure we return non-zero
15124   }
15125
15126   beacon_padding += 1; /* padding bug */
15127
15128   return offset + tag_len;
15129 }
15130
15131 static void
15132 dissect_he_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
15133   int offset, int len);
15134
15135 static void
15136 dissect_he_operation(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
15137   int offset, int len _U_);
15138
15139 static int
15140 dissect_neighbor_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15141 {
15142   int tag_len = tvb_reported_length(tvb);
15143   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15144   int offset = 0;
15145   guint8 sub_tag_id;
15146   guint32 sub_tag_length;
15147   proto_item *parent_item;
15148   proto_tree *bssid_info_subtree, *bssid_info_cap_subtree, *sub_tag_tree;
15149   tvbuff_t *sub_tag_tvb = NULL;
15150
15151   if (tag_len < 13) {
15152     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15153                            "Neighbor Report length %u wrong, must be > 13", tag_len);
15154     return tvb_captured_length(tvb);
15155   }
15156
15157   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid, tvb, offset, 6, ENC_NA);
15158   offset += 6;
15159
15160   /*** Begin: BSSID Information ***/
15161
15162   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid_info, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15163   bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
15164
15165   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reachability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15166   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_security, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15167   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15168   parent_item = proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15169   bssid_info_cap_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_capability_tree);
15170   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15171   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15172   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15173   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15174   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15175   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15176   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15177   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15178   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_very_high_throughput, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15179   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_ftm, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15180   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_efficiency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15181   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_er_bss, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15182   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15183   offset += 4;
15184
15185   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_ope_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15186   offset += 1;
15187
15188   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15189   offset += 1;
15190
15191   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15192   offset += 1;
15193
15194   /* The Optional Subelements field format contains zero or more subelements */
15195   if (tag_len == 13){ /* tag_len == 13 => no Subelements */
15196     return tvb_captured_length(tvb);
15197   }
15198
15199   while (offset < tag_len)
15200   {
15201
15202     sub_tag_id = tvb_get_guint8(tvb, offset);
15203     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15204     offset += 1;
15205
15206     sub_tag_length = tvb_get_guint8(tvb, offset);
15207     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15208     offset += 1;
15209     sub_tag_tvb = tvb_new_subset_length(tvb, offset, sub_tag_length);
15210
15211     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_data, tvb, offset, sub_tag_length, ENC_NA);
15212
15213     switch (sub_tag_id) {
15214       case NR_SUB_ID_TSF_INFO:
15215         /* TODO */
15216         break;
15217       case NR_SUB_ID_MEASUREMENT_PILOT_INFO:
15218         /* TODO */
15219         break;
15220       case NR_SUB_ID_BSS_TRN_CAN_PREF:
15221         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_trn_can_pref, tvb, offset, 1, ENC_NA);
15222         break;
15223       case NR_SUB_ID_BSS_TER_DUR:
15224         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_ter_tsf, tvb, offset, 8, ENC_NA);
15225
15226         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_dur, tvb, offset+8, 2, ENC_NA);
15227         break;
15228       case NR_SUB_ID_HT_CAPABILITIES:
15229         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
15230                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Capabilities");
15231         dissect_ht_capability_ie_common(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, field_data->item_tag_length, FALSE);
15232         break;
15233       case NR_SUB_ID_HT_OPERATION:
15234         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
15235                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Information");
15236         dissect_ht_info_ie_1_1(sub_tag_tvb, pinfo, sub_tag_tree, data);
15237         break;
15238       case NR_SUB_ID_SEC_CHANNEL_OFFSET:
15239         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
15240                             ett_tag_neighbor_report_sub_tag_tree, NULL, "Secondary Channel Offset");
15241         dissect_secondary_channel_offset_ie(sub_tag_tvb, pinfo, sub_tag_tree, data);
15242         break;
15243       case NR_SUB_ID_HE_CAPABILITIES:
15244         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
15245                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HE Capabilities");
15246         dissect_he_capabilities(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length);
15247         break;
15248       case NR_SUB_ID_HE_OPERATION:
15249         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
15250                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HE Operation");
15251         dissect_he_operation(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length);
15252         break;
15253       case NR_SUB_ID_VENDOR_SPECIFIC:
15254       default:
15255         break;
15256     }
15257
15258     offset += sub_tag_length;
15259   }
15260
15261   return offset;
15262 }
15263
15264 static int
15265 ieee80211_tag_supp_rates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15266 {
15267   int tag_len = tvb_reported_length(tvb);
15268   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15269   int offset = 0;
15270   /* 7.3.2.2 Supported Rates element (1) */
15271   if (tag_len < 1) {
15272     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15273                            "Tag length %u too short, must be greater than 0",
15274                            tag_len);
15275     return offset;
15276   }
15277
15278   while (offset < tag_len) {
15279     proto_tree_add_item(tree, hf_ieee80211_tag_supp_rates, tvb, offset, 1,
15280                         ENC_LITTLE_ENDIAN);
15281     proto_item_append_text(field_data->item_tag, " %s,",
15282                            val_to_str_ext_const(tvb_get_guint8(tvb, offset),
15283                                                 &ieee80211_supported_rates_vals_ext,
15284                                                 "Unknown Rate"));
15285     offset += 1;
15286   }
15287
15288   proto_item_append_text(field_data->item_tag, " [Mbit/sec]");
15289
15290   return offset;
15291 }
15292
15293 static int
15294 ieee80211_tag_fh_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15295 {
15296   int tag_len = tvb_reported_length(tvb);
15297   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15298   int offset = 0;
15299   /* 7.3.2.3 FH Parameter Set element (2) */
15300   if (tag_len < 5) {
15301     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15302                            "Tag length %u too short, must be >= 5", tag_len);
15303     return 1;
15304   }
15305
15306   proto_tree_add_item(tree, hf_ieee80211_tag_fh_dwell_time,
15307                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
15308   offset += 2;
15309
15310   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_set,
15311                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15312   offset += 1;
15313
15314   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_pattern,
15315                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15316   offset += 1;
15317
15318   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_index,
15319                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15320   offset += 1;
15321
15322   return offset;
15323 }
15324
15325 static int
15326 ieee80211_tag_ds_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15327 {
15328   int tag_len = tvb_reported_length(tvb);
15329   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15330   int offset = 0;
15331   /* 7.3.2.4 DS Parameter Set element (3) */
15332   if (tag_len != 1) {
15333     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15334         "Tag length %u wrong, must be = 1", tag_len);
15335     return 1;
15336   }
15337
15338   proto_tree_add_item(tree, hf_ieee80211_tag_ds_param_channel,
15339         tvb, offset, 1, ENC_LITTLE_ENDIAN);
15340
15341   proto_item_append_text(field_data->item_tag, ": Current Channel: %u",
15342                          tvb_get_guint8(tvb, offset));
15343
15344   wlan_stats.channel = tvb_get_guint8(tvb, offset);
15345   offset += 1;
15346
15347   return offset;
15348 }
15349
15350 static int
15351 ieee80211_tag_cf_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15352 {
15353   int tag_len = tvb_reported_length(tvb);
15354   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15355   int offset = 0;
15356   /* 7.3.2.5 CF Parameter Set element (4) */
15357   if (tag_len != 6) {
15358     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15359                            "Tag length %u wrong, must be = 6", tag_len);
15360     return offset;
15361   }
15362
15363   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_count,
15364                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15365   proto_item_append_text(field_data->item_tag, ": CFP count %u", tvb_get_guint8(tvb, offset));
15366   offset += 1;
15367
15368   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_period,
15369                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15370   proto_item_append_text(field_data->item_tag, ": CFP Period %u", tvb_get_guint8(tvb, offset));
15371   offset += 1;
15372
15373   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_max_duration,
15374                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
15375   proto_item_append_text(field_data->item_tag, ": CFP Max Duration %u",
15376                          tvb_get_letohs(tvb, offset));
15377   offset += 2;
15378
15379   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_dur_remaining,
15380                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
15381   proto_item_append_text(field_data->item_tag, ": CFP Dur Remaining %u",
15382                          tvb_get_letohs(tvb, offset));
15383   offset += 1;
15384
15385   return offset;
15386 }
15387
15388 static int
15389 ieee80211_tag_tim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15390 {
15391   int tag_len = tvb_reported_length(tvb);
15392   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15393   int offset = 0;
15394   guint aid, pvb_len, n1, i, j, byte;
15395   static const int *ieee80211_tim_bmapctl[] = {
15396     &hf_ieee80211_tim_bmapctl_mcast,
15397     &hf_ieee80211_tim_bmapctl_offset,
15398     NULL
15399   };
15400
15401   /* 802.11-2012: 8.4.2.7 TIM element (5) */
15402   if (tag_len < 4) {
15403     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15404                            "Tag length %u too short, must be >= 4", tag_len);
15405     return 1;
15406   }
15407
15408   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_count,
15409                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15410   proto_item_append_text(field_data->item_tag, ": DTIM %u of", tvb_get_guint8(tvb, offset));
15411   offset += 1;
15412
15413   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_period,
15414                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15415   proto_item_append_text(field_data->item_tag, " %u bitmap", tvb_get_guint8(tvb, offset + 1));
15416   offset += 1;
15417
15418   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tim_bmapctl,
15419                                     ett_tag_bmapctl_tree, ieee80211_tim_bmapctl,
15420                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15421   pvb_len = tag_len - 3;
15422   n1 = tvb_get_guint8(tvb, offset) & 0xFE;
15423   offset += 1;
15424
15425   proto_tree_add_item(tree, hf_ieee80211_tim_partial_virtual_bitmap,
15426                       tvb, offset, pvb_len, ENC_NA);
15427   /* FIXME: Handles dot11MgmtOptionMultiBSSIDActivated = false only */
15428   for (i = 0; i < pvb_len; i++) {
15429     byte = tvb_get_guint8(tvb, offset + i);
15430     for (j = 0; j < 8; j++) {
15431       if (byte & (1 << j)) {
15432         aid = 8*n1 + 8*i + j;
15433         proto_tree_add_uint(tree, hf_ieee80211_tim_aid, tvb, offset + i, 1, aid);
15434       }
15435     }
15436   }
15437   offset += pvb_len;
15438
15439   return offset;
15440 }
15441
15442 static int
15443 ieee80211_tag_ibss_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15444 {
15445   int tag_len = tvb_reported_length(tvb);
15446   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15447   int offset = 0;
15448   /* 7.3.2.7 IBSS Parameter Set element (6) */
15449
15450   if (tag_len != 2) {
15451     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15452                            "Tag length %u wrong, must be = 2", tag_len);
15453     return 1;
15454   }
15455
15456   proto_tree_add_item(tree, hf_ieee80211_tag_ibss_atim_window,
15457                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
15458   proto_item_append_text(field_data->item_tag, ": ATIM window 0x%x",
15459                          tvb_get_letohs(tvb, offset));
15460   offset += 2;
15461
15462   return offset;
15463 }
15464
15465 static const value_string environment_vals[] = {
15466   { 0x20, "Any" },
15467   { 0x4f, "Outdoor" },
15468   { 0x49, "Indoor" },
15469   { 0,    NULL }
15470 };
15471
15472 static int
15473 ieee80211_tag_country_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15474 {
15475   int tag_len = tvb_reported_length(tvb);
15476   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15477   int offset = 0;
15478   /* 7.3.2.9 Country information element (7) */
15479   proto_tree *sub_tree;
15480   proto_item *sub_item;
15481   const guint8* country_code;
15482
15483   if (tag_len < 6) {
15484     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15485                            "Tag length %u too short, must be >= 6", tag_len);
15486     return 1;
15487   }
15488
15489   proto_tree_add_item_ret_string(tree, hf_ieee80211_tag_country_info_code,
15490                       tvb, offset, 2, ENC_ASCII|ENC_NA, wmem_packet_scope(), &country_code);
15491   proto_item_append_text(field_data->item_tag, ": Country Code %s", country_code);
15492   offset += 2;
15493
15494   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_env,
15495                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15496   proto_item_append_text(field_data->item_tag, ", Environment %s",
15497                          val_to_str(tvb_get_guint8(tvb, offset),
15498                                     environment_vals, "Unknown (0x%02x)"));
15499   offset += 1;
15500
15501   while (offset < tag_len) {
15502     /* Padding ? */
15503     if ((tag_len - offset) < 3) {
15504       proto_tree_add_item(tree, hf_ieee80211_tag_country_info_pad,
15505                           tvb, offset, 1, ENC_NA);
15506       offset += 1;
15507       continue;
15508     }
15509     if (tvb_get_guint8(tvb, offset) <= 200) { /* 802.11d */
15510       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_fnm,
15511                                      tvb, offset, 3, ENC_NA);
15512       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_fnm_tree);
15513
15514       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_fcn,
15515                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
15516       proto_item_append_text(sub_item, ": First Channel Number: %d",
15517                              tvb_get_guint8(tvb, offset));
15518       offset += 1;
15519       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_nc,
15520                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
15521       proto_item_append_text(sub_item, ", Number of Channels: %d",
15522                              tvb_get_guint8(tvb, offset));
15523       offset += 1;
15524       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_mtpl,
15525                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
15526       proto_item_append_text(sub_item,
15527                              ", Maximum Transmit Power Level: %d dBm",
15528                              tvb_get_guint8(tvb, offset));
15529       offset += 1;
15530     } else { /* 802.11j */
15531       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_rrc,
15532                                      tvb, offset, 3, ENC_NA);
15533       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_rcc_tree);
15534
15535       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oei,
15536                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
15537       proto_item_append_text(sub_item,
15538                              ": Operating Extension Identifier: %d",
15539                              tvb_get_guint8(tvb, offset));
15540       offset += 1;
15541       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oc,
15542                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
15543       proto_item_append_text(sub_item, ", Operating Class: %d",
15544                              tvb_get_guint8(tvb, offset));
15545       offset += 1;
15546       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_cc,
15547                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
15548       proto_item_append_text(sub_item, ", Coverage Class: %d",
15549                              tvb_get_guint8(tvb, offset));
15550       offset += 1;
15551     }
15552   }
15553
15554   return offset;
15555 }
15556
15557 static int
15558 ieee80211_tag_fh_hopping_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15559 {
15560   int tag_len = tvb_reported_length(tvb);
15561   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15562   int offset = 0;
15563
15564   /* 7.3.2.10 Hopping Pattern Parameters information element (8) */
15565   if (tag_len < 2) {
15566     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15567                            "Tag length %u too short, must be >= 2", tag_len);
15568     return 1;
15569   }
15570
15571   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
15572                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15573   proto_item_append_text(field_data->item_tag, ": Prime Radix: %u", tvb_get_guint8(tvb, offset));
15574   offset += 1;
15575
15576   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
15577                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15578   proto_item_append_text(field_data->item_tag, ", Number of Channels: %u",
15579                          tvb_get_guint8(tvb, offset));
15580   offset += 1;
15581
15582   return offset;
15583 }
15584
15585 static int
15586 ieee80211_tag_fh_hopping_table(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15587 {
15588   int tag_len = tvb_reported_length(tvb);
15589   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15590   int offset = 0;
15591
15592   /* 7.3.2.11 Hopping Pattern Table information element (9) */
15593   if (tag_len < 4) {
15594     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15595                            "Tag length %u too short, must be >= 4", tag_len);
15596     return 1;
15597   }
15598
15599   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_flag,
15600                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15601   offset += 1;
15602
15603   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_number_of_sets,
15604                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15605   offset += 1;
15606
15607   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_modulus,
15608                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15609   offset += 1;
15610
15611   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_offset,
15612                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
15613   offset += 1;
15614
15615   while (offset < tag_len) {
15616     proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_random_table,
15617                         tvb, offset, 2, ENC_BIG_ENDIAN);
15618     offset += 2;
15619   }
15620
15621   return offset;
15622 }
15623
15624 int
15625 add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype,
15626                  const guint8 *valid_element_ids, guint valid_element_ids_count,
15627                  association_sanity_check_t *association_sanity_check)
15628 {
15629   tvbuff_t     *tag_tvb;
15630   guint32       tag_no, tag_len;
15631   guint32       ext_tag_no, ext_tag_len;
15632   proto_tree   *orig_tree = tree;
15633   proto_item   *ti        = NULL;
15634   proto_item   *ti_len, *ti_tag;
15635   ieee80211_tagged_field_data_t field_data;
15636   gboolean      isDMG;
15637
15638   isDMG = GPOINTER_TO_INT(p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY));
15639
15640   tag_no  = tvb_get_guint8(tvb, offset);
15641   tag_len = tvb_get_guint8(tvb, offset + 1);
15642
15643   if (tree) {
15644     if (tag_no == TAG_ELEMENT_ID_EXTENSION) {
15645       ext_tag_no  = tvb_get_guint8(tvb, offset + 2);
15646       ti = proto_tree_add_item(orig_tree, hf_ieee80211_ext_tag, tvb, offset + 2, tag_len , ENC_NA);
15647       proto_item_append_text(ti, ": %s", val_to_str_ext(ext_tag_no, &tag_num_vals_eid_ext_ext, "Reserved (%d)"));
15648     } else {
15649       ti = proto_tree_add_item(orig_tree, hf_ieee80211_tag, tvb, offset, 2 + tag_len , ENC_NA);
15650       proto_item_append_text(ti, ": %s", val_to_str_ext(tag_no, &tag_num_vals_ext, "Reserved (%d)"));
15651     }
15652
15653     tree = proto_item_add_subtree(ti, ett_80211_mgt_ie);
15654
15655   }
15656
15657   if (tag_no == TAG_ELEMENT_ID_EXTENSION) {
15658     ext_tag_len = tag_len - 1;
15659     ti_tag = proto_tree_add_item(tree, hf_ieee80211_ext_tag_number, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
15660     ti_len = proto_tree_add_uint(tree, hf_ieee80211_ext_tag_length, tvb, offset + 1, 1, ext_tag_len);
15661   } else {
15662     ti_tag = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15663     ti_len = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
15664   }
15665   if (tag_len > (guint)tvb_reported_length_remaining(tvb, offset)) {
15666     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
15667                            "Tag Length is longer than remaining payload");
15668   }
15669
15670   /* If the list of valid elements is restricted, require an Element ID to be
15671    * present in that list. Otherwise stop decoding the value to prevent possible
15672    * infinite recursions due to unexpected elements. */
15673   if (valid_element_ids_count) {
15674     gboolean valid_tag_no = FALSE;
15675     guint i;
15676
15677     for (i = 0; i < valid_element_ids_count; i++) {
15678       valid_tag_no = valid_element_ids[i] == tag_no;
15679       if (valid_tag_no)
15680         break;
15681     }
15682     if (!valid_tag_no) {
15683       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_number,
15684           "Unexpected Element ID %d", tag_no);
15685         return tag_len + 1 + 1;
15686     }
15687   }
15688
15689   tag_tvb = tvb_new_subset_length(tvb, offset+2, tag_len);
15690   field_data.sanity_check = association_sanity_check;
15691   field_data.ftype = ftype;
15692   field_data.isDMG = isDMG;
15693   field_data.item_tag = ti;
15694   field_data.item_tag_length = ti_len;
15695   if (!dissector_try_uint_new(tagged_field_table, tag_no, tag_tvb, pinfo, tree, FALSE, &field_data))
15696   {
15697       proto_tree_add_item(tree, hf_ieee80211_tag_data, tvb, offset + 1 + 1, tag_len, ENC_NA);
15698       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_data,
15699                              "Dissector for 802.11 IE Tag"
15700                              " (%s) code not implemented, Contact"
15701                              " Wireshark developers if you want this supported", val_to_str_ext(tag_no,
15702                                             &tag_num_vals_ext, "(%d)"));
15703       proto_item_append_text(ti, ": Undecoded");
15704   }
15705
15706   return tag_len + 1 + 1;
15707 }
15708
15709 /* 7.3.2.12 Request information element (10) */
15710 static int
15711 ieee80211_tag_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
15712 {
15713   int tag_len = tvb_reported_length(tvb);
15714   int offset = 0;
15715
15716   while (offset < tag_len)
15717   {
15718     proto_tree_add_item(tree, hf_ieee80211_tag_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15719     offset += 1;
15720   }
15721   return ((tag_len > 0) ? tag_len : 1);
15722 }
15723
15724 /* 7.3.2.28 BSS Load element (11) */
15725 /* 8.4.2.30 in 802.11-2012 */
15726 static int
15727 ieee80211_tag_qbss_load(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15728 {
15729   int tag_len = tvb_reported_length(tvb);
15730   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15731   int offset = 0;
15732
15733   if ((tag_len < 4) || (tag_len > 5))
15734   {
15735     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4 or 5", tag_len);
15736     return tvb_captured_length(tvb);
15737   }
15738
15739   if (tag_len == 4)
15740   {
15741     /* QBSS Version 1 */
15742     proto_item_append_text(field_data->item_tag, " Cisco QBSS Version 1 - non CCA");
15743
15744     /* Extract Values */
15745     proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset, tag_len, 1);
15746     proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15747     proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
15748     proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
15749   }
15750   else if (tag_len == 5)
15751   {
15752     proto_item *base_item;
15753
15754     /* QBSS Version 2 */
15755     proto_item_append_text(field_data->item_tag, " 802.11e CCA Version");
15756
15757     /* Extract Values */
15758     proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset, tag_len, 2);
15759     proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15760     base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
15761     proto_item_append_text(base_item, " (%d%%)", 100*tvb_get_guint8(tvb, offset + 2)/255);
15762     base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 3, 2, ENC_LITTLE_ENDIAN);
15763     proto_item_append_text(base_item, " (%d us/s)", tvb_get_letohs(tvb, offset + 3)*32);
15764   }
15765
15766   return tvb_captured_length(tvb);
15767 }
15768
15769 /* 8.4.2.31 in 802-11-2012 */
15770 static int
15771 ieee80211_tag_edca_param_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15772 {
15773   int tag_len = tvb_reported_length(tvb);
15774   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15775   int offset = 0;
15776
15777   if ((tag_len != 18))
15778   {
15779     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 18", tag_len);
15780     return tvb_captured_length(tvb);
15781   }
15782
15783   decode_qos_parameter_set(tree, tvb, pinfo, offset, field_data->ftype);
15784
15785   return tvb_captured_length(tvb);
15786 }
15787
15788 /* TSPEC element (13) */
15789 static int
15790 ieee80211_tag_tspec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15791 {
15792   int tag_len = tvb_reported_length(tvb);
15793   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15794   int offset = 0;
15795
15796   if (field_data->isDMG == FALSE && tag_len != 55)
15797   {
15798     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 55", tag_len);
15799     return tvb_captured_length(tvb);
15800   }
15801   if (field_data->isDMG == TRUE && tag_len != 57)
15802   {
15803     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 57", tag_len);
15804     return tvb_captured_length(tvb);
15805   }
15806
15807   add_ff_qos_ts_info(tree, tvb, pinfo, offset);
15808   offset += 3;
15809
15810   proto_tree_add_item(tree, hf_ieee80211_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15811   offset += 2;
15812
15813   proto_tree_add_item(tree, hf_ieee80211_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15814   offset += 2;
15815
15816   proto_tree_add_item(tree, hf_ieee80211_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15817   offset += 4;
15818
15819   proto_tree_add_item(tree, hf_ieee80211_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15820   offset += 4;
15821
15822   proto_tree_add_item(tree, hf_ieee80211_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15823   offset += 4;
15824
15825   proto_tree_add_item(tree, hf_ieee80211_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15826   offset += 4;
15827
15828   proto_tree_add_item(tree, hf_ieee80211_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15829   offset += 4;
15830
15831   proto_tree_add_item(tree, hf_ieee80211_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15832   offset += 4;
15833
15834   proto_tree_add_item(tree, hf_ieee80211_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15835   offset += 4;
15836
15837   proto_tree_add_item(tree, hf_ieee80211_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15838   offset += 4;
15839
15840   proto_tree_add_item(tree, hf_ieee80211_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15841   offset += 4;
15842
15843   proto_tree_add_item(tree, hf_ieee80211_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15844   offset += 4;
15845
15846   proto_tree_add_item(tree, hf_ieee80211_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15847   offset += 4;
15848
15849   proto_tree_add_item(tree, hf_ieee80211_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15850   offset += 2;
15851
15852   proto_tree_add_item(tree, hf_ieee80211_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15853   offset += 2;
15854
15855   if(field_data->isDMG == TRUE) {
15856     proto_tree_add_item(tree, hf_ieee80211_tspec_dmg, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15857     /*offset +=2;*/
15858   }
15859
15860   return tvb_captured_length(tvb);
15861 }
15862
15863 /* 7.3.2.31 TCLAS element (14) */
15864 static int
15865 ieee80211_tag_tclas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15866 {
15867   int tag_len = tvb_reported_length(tvb);
15868   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15869   int offset = 0;
15870   guint8 type;
15871   guint8 version;
15872   static const int *ieee80211_tclas_class_mask0[] = {
15873     &hf_ieee80211_tclas_class_mask0_src_addr,
15874     &hf_ieee80211_tclas_class_mask0_dst_addr,
15875     &hf_ieee80211_tclas_class_mask0_type,
15876     NULL
15877   };
15878
15879   static const int *ieee80211_tclas_class_mask1[] = {
15880     &hf_ieee80211_tclas_class_mask1_ver,
15881     &hf_ieee80211_tclas_class_mask1_src_ip,
15882     &hf_ieee80211_tclas_class_mask1_dst_ip,
15883     &hf_ieee80211_tclas_class_mask1_src_port,
15884     &hf_ieee80211_tclas_class_mask1_dst_port,
15885     &hf_ieee80211_tclas_class_mask1_ipv6_flow,
15886     NULL
15887   };
15888
15889   static const int *ieee80211_tclas_class_mask1_4[] = {
15890     &hf_ieee80211_tclas_class_mask1_ver,
15891     &hf_ieee80211_tclas_class_mask1_src_ip,
15892     &hf_ieee80211_tclas_class_mask1_dst_ip,
15893     &hf_ieee80211_tclas_class_mask1_src_port,
15894     &hf_ieee80211_tclas_class_mask1_dst_port,
15895     &hf_ieee80211_tclas_class_mask1_ipv4_dscp,
15896     &hf_ieee80211_tclas_class_mask1_ipv4_proto,
15897     NULL
15898   };
15899
15900   static const int *ieee80211_tclas_class_mask2[] = {
15901     &hf_ieee80211_tclas_class_mask2_tci,
15902     NULL
15903   };
15904
15905   if (tag_len < 5)
15906   {
15907     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 5", tag_len);
15908     return 1;
15909   }
15910
15911   proto_tree_add_item(tree, hf_ieee80211_tclas_up, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15912   offset += 1;
15913
15914   type = tvb_get_guint8(tvb, offset);
15915   proto_tree_add_item(tree, hf_ieee80211_tclas_class_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15916   offset += 1;
15917
15918   switch (type)
15919   {
15920   case 0:
15921     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
15922                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask0,
15923                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15924     offset++;
15925
15926     proto_tree_add_item(tree, hf_ieee80211_tclas_src_mac_addr, tvb, offset, 6, ENC_NA);
15927     offset += 6;
15928
15929     proto_tree_add_item(tree, hf_ieee80211_tclas_dst_mac_addr, tvb, offset, 6, ENC_NA);
15930     offset += 6;
15931
15932     proto_tree_add_item(tree, hf_ieee80211_tclas_ether_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15933     /*offset += 2;*/
15934     break;
15935
15936   case 1:
15937     version = tvb_get_guint8(tvb, offset+1);
15938     if (version == 4) {
15939       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
15940                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask1_4,
15941                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15942     } else {
15943       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
15944                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask1,
15945                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15946     }
15947     offset += 1;
15948
15949     proto_tree_add_item(tree, hf_ieee80211_tclas_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15950     offset += 1;
15951     if (version == 4)
15952     {
15953       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
15954       offset += 4;
15955       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
15956       offset += 4;
15957       proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
15958       offset += 2;
15959       proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
15960       offset += 2;
15961       proto_tree_add_item(tree, hf_ieee80211_tclas_dscp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15962       offset += 1;
15963       proto_tree_add_item(tree, hf_ieee80211_tclas_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15964       /*offset += 1;*/
15965     }
15966     else if (version == 6)
15967     {
15968       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_src, tvb, offset, 16, ENC_NA);
15969       offset += 16;
15970       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_dst, tvb, offset, 16, ENC_NA);
15971       offset += 16;
15972       proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
15973       offset += 2;
15974       proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
15975       offset += 2;
15976       proto_tree_add_item(tree, hf_ieee80211_tclas_flow, tvb, offset, 3, ENC_BIG_ENDIAN);
15977       /*offset += 3;*/
15978     }
15979     break;
15980
15981   case 2:
15982     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
15983                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask2,
15984                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15985     offset++;
15986
15987     proto_tree_add_item(tree, hf_ieee80211_tclas_tag_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15988     /*offset += 2;*/
15989     break;
15990
15991   default:
15992     break;
15993   }
15994
15995   return tvb_captured_length(tvb);
15996 }
15997
15998 /* 7.3.2.34 Schedule element (15) */
15999 static int
16000 ieee80211_tag_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16001 {
16002   int tag_len = tvb_reported_length(tvb);
16003   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16004   int offset = 0;
16005   if (tag_len != 14)
16006   {
16007     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 14", tag_len);
16008     return 1;
16009   }
16010
16011   add_ff_schedule_info(tree, tvb, pinfo, offset);
16012   offset += 2;
16013
16014   proto_tree_add_item(tree, hf_ieee80211_sched_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16015   offset += 4;
16016
16017   proto_tree_add_item(tree, hf_ieee80211_sched_srv_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16018   offset += 4;
16019
16020   proto_tree_add_item(tree, hf_ieee80211_sched_spec_int, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16021   return tvb_captured_length(tvb);
16022 }
16023
16024 /* 7.3.2.8 Challenge Text element (16) */
16025 static int
16026 ieee80211_tag_challenge_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
16027 {
16028   int tag_len = tvb_reported_length(tvb);
16029   int offset = 0;
16030
16031   proto_tree_add_item(tree, hf_ieee80211_tag_challenge_text, tvb, offset, tag_len, ENC_NA);
16032
16033   return ((tag_len > 0) ? tag_len : 1);
16034 }
16035
16036 /* 7.3.2.15 Power Constraint element (32) */
16037 static int
16038 ieee80211_tag_power_constraint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16039 {
16040   int tag_len = tvb_reported_length(tvb);
16041   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16042   int offset = 0;
16043   if (tag_len != 1)
16044   {
16045     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
16046     return 1;
16047   }
16048
16049   proto_tree_add_item(tree, hf_ieee80211_tag_power_constraint_local, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16050   proto_item_append_text(field_data->item_tag, ": %d", tvb_get_guint8(tvb, offset));
16051   return tvb_captured_length(tvb);
16052 }
16053
16054 /* 7.3.2.16 Power Capability element (33) */
16055 static int
16056 ieee80211_tag_power_capability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16057 {
16058   int tag_len = tvb_reported_length(tvb);
16059   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16060   int offset = 0;
16061   if (tag_len != 2)
16062   {
16063     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
16064     return 1;
16065   }
16066
16067   proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_min, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16068   proto_item_append_text(field_data->item_tag, " Min: %d", tvb_get_guint8(tvb, offset));
16069   offset += 1;
16070
16071   proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_max, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16072   proto_item_append_text(field_data->item_tag, ", Max :%d", tvb_get_guint8(tvb, offset));
16073   return tvb_captured_length(tvb);
16074 }
16075
16076 /* 7.3.2.18 TPC Request element (34) */
16077 static int
16078 ieee80211_tag_tpc_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void* data)
16079 {
16080   int tag_len = tvb_reported_length(tvb);
16081   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16082   if (tag_len != 0)
16083   {
16084     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 0", tag_len);
16085     return 1; /* Even with no data, we can't return 0 */
16086   }
16087
16088   return 1; /* Even with no data, we can't return 0 */
16089 }
16090
16091 /* 7.3.2.18 TPC Report element (35) */
16092 static int
16093 ieee80211_tag_tpc_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16094 {
16095   int tag_len = tvb_reported_length(tvb);
16096   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16097   int offset = 0;
16098
16099   if (tag_len != 2)
16100   {
16101     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
16102     return 1;
16103   }
16104
16105   proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_trsmt_pow, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16106   proto_item_append_text(field_data->item_tag, " Transmit Power: %d", tvb_get_guint8(tvb, offset));
16107   offset += 1;
16108
16109   proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_link_mrg, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16110   proto_item_append_text(field_data->item_tag, ", Link Margin: %d", tvb_get_guint8(tvb, offset));
16111   return tvb_captured_length(tvb);
16112 }
16113
16114 /* 7.3.2.19 Supported Channels element (36) */
16115 static int
16116 ieee80211_tag_supported_channels(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16117 {
16118   int tag_len = tvb_reported_length(tvb);
16119   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16120   int offset = 0;
16121
16122   proto_item *chan_item;
16123   proto_tree *chan_tree;
16124   guint       i = 1;
16125
16126   if (tag_len % 2 == 1) {
16127     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u must be even", tag_len);
16128     return tvb_captured_length(tvb);
16129   }
16130
16131   while (offset < tag_len)
16132   {
16133     chan_item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_channels, tvb, offset, 2, ENC_NA);
16134     proto_item_append_text(chan_item, " #%d", i);
16135     i += 1;
16136
16137     chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
16138
16139     proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_first, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16140     proto_item_append_text(chan_item, " First: %d", tvb_get_guint8(tvb, offset));
16141     offset += 1;
16142
16143     proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_range, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16144     proto_item_append_text(chan_item, ", Range: %d ", tvb_get_guint8(tvb, offset));
16145     offset += 1;
16146
16147   }
16148   return tvb_captured_length(tvb);
16149 }
16150
16151 /* 7.3.2.20 Channel Switch Announcement element (37) */
16152 static int
16153 ieee80211_tag_switch_ann(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16154 {
16155   int tag_len = tvb_reported_length(tvb);
16156   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16157   int offset = 0;
16158   if (tag_len != 3)
16159   {
16160     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 3", tag_len);
16161     return 1;
16162   }
16163
16164   proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16165   proto_item_append_text(field_data->item_tag, " Mode: %d", tvb_get_guint8(tvb, offset));
16166   offset += 1;
16167
16168   proto_tree_add_item(tree, hf_ieee80211_csa_new_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16169   proto_item_append_text(field_data->item_tag, ", Number: %d ", tvb_get_guint8(tvb, offset));
16170   offset += 1;
16171
16172   proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16173   proto_item_append_text(field_data->item_tag, ", Count: %d ", tvb_get_guint8(tvb, offset));
16174   return tvb_captured_length(tvb);
16175 }
16176
16177 /* 7.3.2.21 Measurement Request element (38) with update from 802.11k-2008 */
16178 static int
16179 ieee80211_tag_measure_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16180 {
16181   int tag_len = tvb_reported_length(tvb);
16182   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16183   int offset = 0;
16184   guint8 request_type;
16185   proto_item *parent_item;
16186   proto_tree *sub_tree;
16187   static const int *ieee80211_tag_measure_request_mode[] = {
16188     &hf_ieee80211_tag_measure_request_mode_parallel,
16189     &hf_ieee80211_tag_measure_request_mode_enable,
16190     &hf_ieee80211_tag_measure_request_mode_request,
16191     &hf_ieee80211_tag_measure_request_mode_report,
16192     &hf_ieee80211_tag_measure_request_mode_duration_mandatory,
16193     &hf_ieee80211_tag_measure_request_mode_reserved,
16194     NULL
16195   };
16196
16197   if (tag_len < 3)
16198   {
16199     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
16200     return tvb_captured_length(tvb);
16201   }
16202   proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_token, tvb, offset, 1, ENC_NA);
16203   offset += 1;
16204
16205   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_request_mode,
16206                                     ett_tag_measure_request_mode_tree, ieee80211_tag_measure_request_mode,
16207                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
16208   offset += 1;
16209
16210   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_type, tvb, offset, 1, ENC_NA);
16211   sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_type_tree);
16212   request_type = tvb_get_guint8(tvb, offset);
16213   offset += 1;
16214
16215   switch (request_type) {
16216     case 0: /* Basic Request */
16217     case 1: /* Clear channel assessment (CCA) request */
16218     case 2: /* Receive power indication (RPI) histogram request */
16219     {
16220       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
16221       offset += 1;
16222
16223       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16224       offset += 8;
16225
16226       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16227       offset += 2;
16228       break;
16229     }
16230     case 3: /* Channel Load Request */
16231     {
16232       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
16233       offset += 1;
16234
16235       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
16236       offset += 1;
16237
16238       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16239       offset += 2;
16240
16241       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16242       offset += 2;
16243
16244       while (offset < tag_len)
16245       {
16246         guint8 sub_id;
16247         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_id, tvb, offset, 1, ENC_NA);
16248         sub_id = tvb_get_guint8(tvb, offset);
16249         offset += 1;
16250
16251         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
16252         offset += 1;
16253
16254         switch (sub_id) {
16255           case MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO: /* Channel Load Reporting Information (1) */
16256             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition, tvb, offset, 1, ENC_NA);
16257             offset += 1;
16258             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref, tvb, offset, 1, ENC_NA);
16259             offset += 1;
16260             break;
16261           default:
16262             /* no default action */
16263             break;
16264           }
16265      }
16266      break;
16267    }
16268    case 4: /* Noise Histogram Request */
16269    {
16270      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
16271      offset += 1;
16272
16273      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
16274      offset += 1;
16275
16276      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16277      offset += 2;
16278
16279      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16280      offset += 2;
16281
16282      while (offset < tag_len)
16283      {
16284        guint8 sub_id;
16285        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_id, tvb, offset, 1, ENC_NA);
16286        sub_id = tvb_get_guint8(tvb, offset);
16287        offset += 1;
16288
16289        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
16290        offset += 1;
16291
16292        switch (sub_id) {
16293          case MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO: /* Noise Histogram Reporting Information (1) */
16294            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition, tvb, offset, 1, ENC_NA);
16295            offset += 1;
16296            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref, tvb, offset, 1, ENC_NA);
16297            offset += 1;
16298            break;
16299          default:
16300            /* no default action */
16301            break;
16302        }
16303      }
16304      break;
16305    }
16306    case 5: /* Beacon Request */
16307    {
16308      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
16309      offset += 1;
16310
16311      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
16312      offset += 1;
16313
16314      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16315      offset += 2;
16316
16317      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16318      offset += 2;
16319
16320      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_measurement_mode, tvb, offset, 1, ENC_NA);
16321      offset += 1;
16322
16323      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_bssid, tvb, offset, 6, ENC_NA);
16324      offset += 6;
16325
16326      while (offset < tag_len)
16327      {
16328        guint8 sub_id, sub_length, sub_tag_end;
16329        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_id, tvb, offset, 1, ENC_NA);
16330        sub_id = tvb_get_guint8(tvb, offset);
16331        offset += 1;
16332
16333        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
16334        sub_length = tvb_get_guint8(tvb, offset);
16335        offset += 1;
16336        sub_tag_end = offset + sub_length;
16337
16338        switch (sub_id) {
16339          case MEASURE_REQ_BEACON_SUB_SSID: /* SSID (0) */
16340            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_ssid, tvb, offset, sub_length, ENC_ASCII|ENC_NA);
16341            offset += sub_length;
16342            break;
16343          case MEASURE_REQ_BEACON_SUB_BRI: /* Beacon Reporting Information (1) */
16344            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16345            offset += 1;
16346            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16347            offset += 1;
16348            break;
16349          case MEASURE_REQ_BEACON_SUB_RD: /* Reporting Detail (2) */
16350            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16351            offset += 1;
16352            break;
16353          case MEASURE_REQ_BEACON_SUB_REQUEST: /* Request (10) */
16354            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16355            offset += 1;
16356            break;
16357          case MEASURE_REQ_BEACON_SUB_APCP: /* AP Channel Report (51) */
16358            /* TODO */
16359            break;
16360          default:
16361            /* no default action */
16362            break;
16363        }
16364        if (offset < sub_tag_end)
16365        {
16366          proto_item *tix;
16367          tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_unknown, tvb, offset, sub_tag_end - offset, ENC_NA);
16368          expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_beacon_unknown);
16369          offset = sub_tag_end;
16370        }
16371      }
16372
16373      break;
16374    }
16375    case 6: /* Frame Request */
16376    {
16377      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
16378      offset += 1;
16379
16380      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
16381      offset += 1;
16382
16383      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16384      offset += 2;
16385
16386      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16387      offset += 2;
16388
16389      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_frame_request_type, tvb, offset, 1, ENC_NA);
16390      offset += 1;
16391
16392      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mac_address, tvb, offset, 6, ENC_NA);
16393      offset += 6;
16394
16395      /* TODO Add Optional Subelements */
16396      break;
16397    }
16398    case 7: /* BSTA Statistics Request */
16399    {
16400      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_peer_mac_address, tvb, offset, 6, ENC_NA);
16401      offset += 6;
16402
16403      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16404      offset += 2;
16405
16406      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16407      offset += 2;
16408
16409      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_group_id, tvb, offset, 1, ENC_NA);
16410      offset += 1;
16411
16412      /* TODO Add Optional Subelements */
16413      break;
16414    }
16415    case 8: /* Location Configuration Indication (LCI) Request */
16416     /* TODO */
16417    case 9: /* Transmit Stream Measurement Request */
16418     /* TODO */
16419    case 10: /* Multicast diagnostics request */
16420     /* TODO */
16421    case 11: /* Location Civic request */
16422     /* TODO */
16423    case 12: /* Location Identifier request */
16424     /* TODO */
16425    case 13: /* Directional channel quality request */
16426     /* TODO */
16427    case 14: /* Directional measurement request */
16428     /* TODO */
16429    case 15: /* Directional statistics request */
16430     /* TODO */
16431    case 255: /* Measurement Pause Request*/
16432     /* TODO */
16433    default: /* unknown */
16434     break;
16435   }
16436   if (offset < tag_len)
16437   {
16438     proto_item *tix;
16439     tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_unknown, tvb, offset, tag_len - offset, ENC_NA);
16440     expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_unknown);
16441   }
16442
16443   return tvb_captured_length(tvb);
16444 }
16445
16446 /* 7.3.2.22 Measurement Report element (39) with update from 802.11k-2008 */
16447 static int
16448 ieee80211_tag_measure_rep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16449 {
16450   int tag_len = tvb_reported_length(tvb);
16451   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16452   int offset = 0;
16453   proto_item *parent_item;
16454   proto_tree *sub_tree;
16455   guint8 report_type;
16456   static const int *ieee80211_tag_measure_report_mode[] = {
16457     &hf_ieee80211_tag_measure_report_mode_late,
16458     &hf_ieee80211_tag_measure_report_mode_incapable,
16459     &hf_ieee80211_tag_measure_report_mode_refused,
16460     &hf_ieee80211_tag_measure_report_mode_reserved,
16461     NULL
16462   };
16463   static const int *ieee80211_tag_measure_map_field[] = {
16464     &hf_ieee80211_tag_measure_map_field_bss,
16465     &hf_ieee80211_tag_measure_map_field_odfm,
16466     &hf_ieee80211_tag_measure_map_field_unident_signal,
16467     &hf_ieee80211_tag_measure_map_field_radar,
16468     &hf_ieee80211_tag_measure_map_field_unmeasured,
16469     &hf_ieee80211_tag_measure_map_field_reserved,
16470     NULL
16471   };
16472   static const int *ieee80211_tag_measure_report_frame_info[] = {
16473     &hf_ieee80211_tag_measure_report_frame_info_phy_type,
16474     &hf_ieee80211_tag_measure_report_frame_info_frame_type,
16475     NULL
16476   };
16477
16478   if (tag_len < 3)
16479   {
16480     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
16481     return tvb_captured_length(tvb);
16482   }
16483   proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_measurement_token, tvb, offset, 1, ENC_NA);
16484   offset += 1;
16485
16486   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_report_mode,
16487                                     ett_tag_measure_report_mode_tree, ieee80211_tag_measure_report_mode,
16488                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
16489   offset += 1;
16490
16491   report_type = tvb_get_guint8(tvb, offset);
16492   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16493   sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_type_tree);
16494   offset += 1;
16495
16496   if (tag_len == 3)
16497     return tvb_captured_length(tvb);
16498
16499   switch (report_type) {
16500   case 0: /* Basic Report */
16501   {
16502     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
16503     offset += 1;
16504
16505     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16506     offset += 8;
16507
16508     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16509     offset += 2;
16510
16511     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_basic_map_field,
16512                                     ett_tag_measure_report_basic_map_tree, ieee80211_tag_measure_map_field,
16513                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
16514     break;
16515   }
16516   case 1: /* Clear channel assessment (CCA) report */
16517     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
16518     offset += 1;
16519
16520     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16521     offset += 8;
16522
16523     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16524     offset += 2;
16525
16526     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_cca_busy_fraction, tvb, offset, 1, ENC_NA);
16527     offset += 1;
16528     break;
16529   case 2: /* Receive power indication (RPI) histogram report */
16530     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
16531     offset += 1;
16532
16533     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16534     offset += 8;
16535
16536     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16537     offset += 2;
16538
16539     parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report, tvb, offset, 8, ENC_NA);
16540     sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_rpi_tree);
16541
16542     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_0, tvb, offset, 1, ENC_NA);
16543     offset += 1;
16544
16545     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_1, tvb, offset, 1, ENC_NA);
16546     offset += 1;
16547
16548     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_2, tvb, offset, 1, ENC_NA);
16549     offset += 1;
16550
16551     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_3, tvb, offset, 1, ENC_NA);
16552     offset += 1;
16553
16554     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_4, tvb, offset, 1, ENC_NA);
16555     offset += 1;
16556
16557     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_5, tvb, offset, 1, ENC_NA);
16558     offset += 1;
16559
16560     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_6, tvb, offset, 1, ENC_NA);
16561     offset += 1;
16562
16563     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_7, tvb, offset, 1, ENC_NA);
16564     offset += 1;
16565     break;
16566   case 3: /* Channel Load Report */
16567   {
16568     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
16569     offset += 1;
16570
16571     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
16572     offset += 1;
16573
16574     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16575     offset += 8;
16576
16577     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16578     offset += 2;
16579
16580     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_load, tvb, offset, 1, ENC_NA);
16581     offset += 1;
16582
16583     /* TODO Add Optional Subelements */
16584     break;
16585   }
16586   case 4: /* Noise Histogram Report */
16587     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
16588     offset += 1;
16589
16590     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
16591     offset += 1;
16592
16593     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16594     offset += 8;
16595
16596     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16597     offset += 2;
16598
16599     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
16600     offset += 1;
16601
16602     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_anpi, tvb, offset, 1, ENC_NA);
16603     offset += 1;
16604
16605     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_0, tvb, offset, 1, ENC_NA);
16606     offset += 1;
16607
16608     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_1, tvb, offset, 1, ENC_NA);
16609     offset += 1;
16610
16611     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_2, tvb, offset, 1, ENC_NA);
16612     offset += 1;
16613
16614     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_3, tvb, offset, 1, ENC_NA);
16615     offset += 1;
16616
16617     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_4, tvb, offset, 1, ENC_NA);
16618     offset += 1;
16619
16620     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_5, tvb, offset, 1, ENC_NA);
16621     offset += 1;
16622
16623     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_6, tvb, offset, 1, ENC_NA);
16624     offset += 1;
16625
16626     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_7, tvb, offset, 1, ENC_NA);
16627     offset += 1;
16628
16629     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_8, tvb, offset, 1, ENC_NA);
16630     offset += 1;
16631
16632     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_9, tvb, offset, 1, ENC_NA);
16633     offset += 1;
16634
16635     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_10, tvb, offset, 1, ENC_NA);
16636     offset += 1;
16637
16638     /* TODO Add Optional Subelements */
16639     break;
16640   case 5: /* Beacon Report */
16641   {
16642     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
16643     offset += 1;
16644
16645     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
16646     offset += 1;
16647
16648     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16649     offset += 8;
16650
16651     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16652     offset += 2;
16653
16654     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_report_frame_info,
16655                                     ett_tag_measure_report_frame_tree, ieee80211_tag_measure_report_frame_info,
16656                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
16657     offset += 1;
16658
16659     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rcpi, tvb, offset, 1, ENC_NA);
16660     offset += 1;
16661
16662     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rsni, tvb, offset, 1, ENC_NA);
16663     offset += 1;
16664
16665     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_bssid, tvb, offset, 6, ENC_NA);
16666     offset += 6;
16667
16668     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
16669     offset += 1;
16670
16671     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_parent_tsf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16672     offset += 4;
16673
16674     while (offset < tag_len)
16675     {
16676       guint8 sub_id, sub_length;
16677       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_beacon_sub_id, tvb, offset, 1, ENC_NA);
16678       sub_id = tvb_get_guint8(tvb, offset);
16679       offset += 1;
16680
16681       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_subelement_length, tvb, offset, 1, ENC_NA);
16682       sub_length = tvb_get_guint8(tvb, offset);
16683       offset += 1;
16684
16685       switch (sub_id) {
16686         case MEASURE_REP_REPORTED_FRAME_BODY: /* Reported Frame Body (1) */
16687         {
16688           proto_tree *rep_tree;
16689
16690           rep_tree = proto_tree_add_subtree(sub_tree, tvb, offset, sub_length, ett_tag_measure_reported_frame_tree, NULL, "Reported Frame Body");
16691
16692           add_ff_timestamp(rep_tree, tvb, pinfo, 0);
16693           add_ff_beacon_interval(rep_tree, tvb, pinfo, 8);
16694           add_ff_cap_info(rep_tree, tvb, pinfo, 10);
16695           offset += 12;
16696
16697           ieee_80211_add_tagged_parameters(tvb, offset, pinfo, rep_tree, sub_length - 12, MGT_PROBE_RESP, NULL);
16698           offset += (sub_length - 12);
16699         }
16700         break;
16701         default:
16702           /* no default action */
16703           break;
16704       }
16705     }
16706     break;
16707   }
16708   case 6: /* Frame Report */
16709     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
16710     offset += 1;
16711
16712     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
16713     offset += 1;
16714
16715     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16716     offset += 8;
16717
16718     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16719     offset += 2;
16720
16721     /* TODO Add Optional Subelements */
16722     break;
16723   case 7: /* BSTA Statistics Report */
16724     /* TODO */
16725   case 8: /* Location Configuration Information Report element */
16726     /* TODO */
16727   case 9: /* Transmit Stream Measurement Report */
16728     /* TODO */
16729   case 10: /* Multicast diagnostics Report */
16730     /* TODO */
16731   case 11: /* Location Civic Report */
16732     /* TODO */
16733   case 12: /* Location Identifier Report */
16734     /* TODO */
16735   case 13: /* Directional channel quality Report */
16736     /* TODO */
16737   case 14: /* Directional measurement Report */
16738     /* TODO */
16739   case 15: /* Directional statistics Report */
16740     /* TODO */
16741   default: /* unknown */
16742     break;
16743   }
16744   if (offset < tag_len)
16745   {
16746     proto_item *tix;
16747     tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_unknown, tvb, offset, tag_len - offset, ENC_NA);
16748     expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_report_unknown);
16749   }
16750   return tvb_captured_length(tvb);
16751 }
16752
16753 /* 7.3.2.23 Quiet element (40) */
16754 static int
16755 ieee80211_tag_quiet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16756 {
16757   int tag_len = tvb_reported_length(tvb);
16758   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16759   int offset = 0;
16760   if (tag_len != 6)
16761   {
16762     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
16763     return tvb_captured_length(tvb);
16764   }
16765
16766   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_count, tvb, offset, 1, ENC_NA);
16767   proto_item_append_text(field_data->item_tag, " Count: %d", tvb_get_guint8(tvb, offset));
16768   offset += 1;
16769
16770   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_period, tvb, offset, 1, ENC_NA);
16771   proto_item_append_text(field_data->item_tag, " Period: %d", tvb_get_guint8(tvb, offset));
16772   offset += 1;
16773
16774   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16775   proto_item_append_text(field_data->item_tag, " Duration: %d", tvb_get_letohs(tvb, offset));
16776   offset += 2;
16777
16778   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16779   proto_item_append_text(field_data->item_tag, " Offset: %d", tvb_get_letohs(tvb, offset));
16780
16781   return tvb_captured_length(tvb);
16782 }
16783
16784 /* 7.3.2.24 IBSS DFS element (41) */
16785 static int
16786 ieee80211_tag_ibss_dfs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16787 {
16788   int tag_len = tvb_reported_length(tvb);
16789   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16790   int offset = 0;
16791   proto_item *ti_sup_map;
16792   proto_tree *sub_map_tree;
16793   if (tag_len < 7)
16794   {
16795     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 7", tag_len);
16796     return tvb_captured_length(tvb);
16797   }
16798
16799   proto_tree_add_item(tree, hf_ieee80211_tag_dfs_owner, tvb, offset, 6, ENC_NA);
16800   proto_item_append_text(field_data->item_tag, " Owner: %s", tvb_ether_to_str(tvb, offset));
16801   offset += 6;
16802
16803   proto_tree_add_item(tree, hf_ieee80211_tag_dfs_recovery_interval, tvb, offset, 1, ENC_NA);
16804   offset += 1;
16805
16806   while (offset < tag_len)
16807   {
16808     ti_sup_map = proto_tree_add_item(tree, hf_ieee80211_tag_dfs_channel_map, tvb, offset, 2, ENC_NA);
16809     sub_map_tree = proto_item_add_subtree(ti_sup_map, ett_tag_dfs_map_tree);
16810     proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_channel_number, tvb, offset, 1, ENC_NA);
16811     proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_map, tvb, offset, 1, ENC_NA);
16812     offset += 2;
16813   }
16814   return tvb_captured_length(tvb);
16815 }
16816
16817 /* 7.3.2.13 ERP Information element (42) */
16818 static int
16819 ieee80211_tag_erp_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16820 {
16821   int tag_len = tvb_reported_length(tvb);
16822   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16823   int offset = 0;
16824   static const int *ieee80211_tag_erp_info_flags[] = {
16825     &hf_ieee80211_tag_erp_info_erp_present,
16826     &hf_ieee80211_tag_erp_info_use_protection,
16827     &hf_ieee80211_tag_erp_info_barker_preamble_mode,
16828     &hf_ieee80211_tag_erp_info_reserved,
16829     NULL
16830   };
16831
16832   if (tag_len != 1)
16833   {
16834     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
16835     return tvb_captured_length(tvb);
16836   }
16837
16838   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_erp_info,
16839                                     ett_tag_erp_info_tree, ieee80211_tag_erp_info_flags,
16840                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
16841
16842   return tvb_captured_length(tvb);
16843 }
16844
16845 /* 7.3.2.32 TS Delay element (43) */
16846 static int
16847 ieee80211_tag_ts_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16848 {
16849   int tag_len = tvb_reported_length(tvb);
16850   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16851   int offset = 0;
16852   if (tag_len != 4)
16853   {
16854     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
16855     return tvb_captured_length(tvb);
16856   }
16857
16858   proto_tree_add_item(tree, hf_ieee80211_ts_delay, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16859   proto_item_append_text(field_data->item_tag, " : %d", tvb_get_ntohl(tvb, offset));
16860   return tvb_captured_length(tvb);
16861 }
16862
16863 /* 7.3.2.33 TCLAS Processing element (44) */
16864 static int
16865 ieee80211_tag_tclas_process(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16866 {
16867   int tag_len = tvb_reported_length(tvb);
16868   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16869   int offset = 0;
16870   if (tag_len != 1)
16871   {
16872     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
16873     return tvb_captured_length(tvb);
16874   }
16875
16876   proto_tree_add_item(tree, hf_ieee80211_tclas_process, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16877   proto_item_append_text(field_data->item_tag, " : %s", val_to_str(tvb_get_guint8(tvb, offset), ieee80211_tclas_process_flag, "Unknown %d"));
16878   return tvb_captured_length(tvb);
16879 }
16880
16881 /* 802.11-2012 8.4.2.37 QoS Capability element (46) */
16882 static int
16883 ieee80211_tag_qos_capability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16884 {
16885   int tag_len = tvb_reported_length(tvb);
16886   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16887   int offset = 0;
16888   if (tag_len != 1)
16889   {
16890     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
16891     return tvb_captured_length(tvb);
16892   }
16893   dissect_qos_capability(tree, tvb, pinfo, offset, field_data->ftype);
16894   return tvb_captured_length(tvb);
16895 }
16896
16897 static int
16898 ieee80211_tag_rsn_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16899 {
16900   int tag_len = tvb_reported_length(tvb);
16901   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16902   int offset = 0;
16903   if (tag_len < 18)
16904   {
16905     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 18", tag_len);
16906     return tvb_captured_length(tvb);
16907   }
16908
16909   dissect_rsn_ie(pinfo, tree, tvb, offset, tag_len, field_data->sanity_check);
16910   return tvb_captured_length(tvb);
16911 }
16912
16913 /* 7.3.2.14 Extended Supported Rates element (50) */
16914 static int
16915 ieee80211_tag_ext_supp_rates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16916 {
16917   int tag_len = tvb_reported_length(tvb);
16918   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16919   int offset = 0;
16920   if (tag_len < 1)
16921   {
16922     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be greater than 0", tag_len);
16923     return tvb_captured_length(tvb);
16924   }
16925
16926   while (offset < tag_len)
16927   {
16928     proto_tree_add_item(tree, hf_ieee80211_tag_ext_supp_rates, tvb, offset, 1, ENC_NA);
16929     proto_item_append_text(field_data->item_tag, " %s,", val_to_str_ext_const(tvb_get_guint8(tvb, offset), &ieee80211_supported_rates_vals_ext, "Unknown Rate"));
16930     offset += 1;
16931   }
16932   proto_item_append_text(field_data->item_tag, " [Mbit/sec]");
16933   return tvb_captured_length(tvb);
16934 }
16935
16936 static int
16937 ieee80211_tag_cisco_ccx1_ckip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16938 {
16939   int tag_len = tvb_reported_length(tvb);
16940   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16941   int offset = 0;
16942   /* From WCS manual:
16943    * If Aironet IE support is enabled, the access point sends an Aironet
16944    * IE 0x85 (which contains the access point name, load, number of
16945    * associated clients, and so on) in the beacon and probe responses of
16946    * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
16947    * (which contains the management IP address of the controller and
16948    * the IP address of the access point) in the reassociation response
16949    * if it receives Aironet IE 0x85 in the reassociation request.
16950    */
16951
16952   if (tag_len < 26)
16953   {
16954     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u too short, must be >= 26", tag_len);
16955     return tvb_captured_length(tvb);
16956   }
16957   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown, tvb, offset, 10, ENC_NA);
16958   offset += 10;
16959
16960   /* The Name of the sending device starts at offset 10 and is up to
16961      15 or 16 bytes in length, \0 padded */
16962   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_name, tvb, offset, 16, ENC_ASCII|ENC_NA);
16963   offset += 16;
16964
16965   /* Total number off associated clients and repeater access points */
16966   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_clients, tvb, offset, 1, ENC_NA);
16967   offset += 1;
16968   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown2, tvb, offset, 3, ENC_NA);
16969   return tvb_captured_length(tvb);
16970 }
16971
16972 static int
16973 ieee80211_tag_vendor_specific_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16974 {
16975   int tag_len = tvb_reported_length(tvb);
16976   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16977   int offset = 0;
16978   guint32 tag_vs_len = tag_len;
16979   guint32       oui;
16980
16981   if (tag_len < 3)
16982   {
16983     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len);
16984     return tvb_captured_length(tvb);
16985   }
16986
16987   proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
16988   proto_item_append_text(field_data->item_tag, ": %s", uint_get_manuf_name_if_known(oui));
16989   offset += 3;
16990   tag_vs_len -= 3;
16991
16992   if (tag_len > 0) {
16993     proto_tree_add_item(field_data->item_tag, hf_ieee80211_tag_vendor_oui_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16994   }
16995
16996   switch (oui) {
16997     /* 802.11 specific vendor ids */
16998     case OUI_WPAWME:
16999       dissect_vendor_ie_wpawme(tree, tvb, pinfo, offset, tag_vs_len, field_data->ftype);
17000       break;
17001     case OUI_RSN:
17002       dissect_vendor_ie_rsn(field_data->item_tag, tree, tvb, offset, tag_vs_len);
17003       break;
17004     case OUI_PRE11N:
17005       dissect_vendor_ie_ht(tvb, pinfo, tree, offset, field_data->item_tag, field_data->item_tag_length, tag_vs_len);
17006       break;
17007     case OUI_WFA:
17008       dissect_vendor_ie_wfa(pinfo, field_data->item_tag, tvb);
17009       break;
17010
17011     /* Normal IEEE vendor ids (from oui.h) */
17012     case OUI_CISCOWL:  /* Cisco Wireless (Aironet) */
17013       dissect_vendor_ie_aironet(field_data->item_tag, tree, tvb, offset, tag_vs_len);
17014       break;
17015     case OUI_MARVELL:
17016       dissect_vendor_ie_marvell(field_data->item_tag, tree, tvb, offset, tag_vs_len);
17017       break;
17018     case OUI_ATHEROS:
17019       dissect_vendor_ie_atheros(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo, field_data->item_tag_length);
17020       break;
17021     case OUI_ARUBA:
17022       dissect_vendor_ie_aruba(field_data->item_tag, tree, tvb, offset, tag_vs_len);
17023       break;
17024     case OUI_NINTENDO:
17025       dissect_vendor_ie_nintendo(field_data->item_tag, tree, tvb, offset, tag_vs_len);
17026       break;
17027     case OUI_MIKROTIK:
17028       dissect_vendor_ie_mikrotik(field_data->item_tag, tree, tvb, offset, tag_vs_len);
17029       break;
17030     case OUI_MERU:
17031       dissect_vendor_ie_meru(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
17032       break;
17033     case OUI_ZEBRA_EXTREME:
17034       dissect_vendor_ie_extreme(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
17035       break;
17036     default:
17037       proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA);
17038       break;
17039   }
17040
17041   return tvb_captured_length(tvb);
17042 }
17043
17044 #define HE_HTC_HE_SUPPORT                0x00000001
17045 #define HE_FRAGMENTATION_SUPPORT         0x00000018
17046 #define HE_ALL_ACK_SUPPORT               0x00000200
17047 #define HE_UMRS_SUPPORT                  0x00000400
17048 #define HE_BSR_SUPPORT                   0x00000800
17049
17050 static const val64_string he_fragmentation_support_vals[] = {
17051   { 0, "No support for dynamic fragmentation" },
17052   { 1, "Support for dynamic fragments in MPDUs or S-MPDUs" },
17053   { 2, "Support for dynamic fragments in MPDUs and S-MPDUs and up to 1 dyn frag in MSDUs..." },
17054   { 3, "Support for all types of dynamic fragments" },
17055   { 0, NULL }
17056 };
17057
17058 static const val64_string he_minimum_fragmentation_size_vals[] = {
17059   { 0, "No restriction on minimum payload size" },
17060   { 1, "Minimum payload size of 128 bytes" },
17061   { 2, "Minimum payload size of 256 bytes" },
17062   { 3, "Minimum payload size of 512 bytes" },
17063   { 0, NULL }
17064 };
17065
17066 static const val64_string he_link_adaptation_support_vals[] = {
17067   { 0, "No feedback if the STA does not provide HE MFB" },
17068   { 1, "Reserved" },
17069   { 2, "Unsolicited if the STA can receive and provide only unsolicited HE MFB" },
17070   { 3, "Both" },
17071   { 0, NULL }
17072 };
17073
17074 static const int *he_mac_headers[] = {
17075   &hf_he_htc_he_support,                           /* 0 */
17076   &hf_he_twt_requester_support,                    /* 1 */
17077   &hf_he_twt_responder_support,                    /* 2 */
17078   &hf_he_fragmentation_support,                    /* 3 */
17079   &hf_he_max_number_fragmented_msdus,              /* 4 */
17080   &hf_he_min_fragment_size,                        /* 5 */
17081   &hf_he_trigger_frame_mac_padding_dur,            /* 6 */
17082   &hf_he_multi_tid_aggregation_support,            /* 7 */
17083   &hf_he_he_link_adaptation_support,               /* 8 */
17084   &hf_he_all_ack_support,                          /* 9 */
17085   &hf_he_umrs_support,                             /* 10 */
17086   &hf_he_bsr_support,                              /* 11 */
17087   &hf_he_broadcast_twt_support,                    /* 12 */
17088   &hf_he_32_bit_ba_bitmap_support,                 /* 13 */
17089   &hf_he_mu_cascading_support,                     /* 14 */
17090   &hf_he_ack_enabled_aggregation_support,          /* 15 */
17091   &hf_he_group_addressed_multi_sta_blkack_support, /* 16 */
17092   &hf_he_om_control_support,                       /* 17 */
17093   &hf_he_ofdma_ra_support,                         /* 18 */
17094   &hf_he_max_a_mpdu_length_exponent,               /* 19 */
17095   &hf_he_a_msdu_fragmentation_support,             /* 20 */
17096   &hf_he_flexible_twt_schedule_support,            /* 21 */
17097   &hf_he_rx_control_frame_to_multibss,             /* 22 */
17098   &hf_he_bsrp_bqrp_a_mpdu_aggregation,             /* 23 */
17099   &hf_he_qtp_support,                              /* 24 */
17100   &hf_he_bqr_support,                              /* 25 */
17101   &hf_he_sr_responder,                             /* 26 */
17102   &hf_he_ndp_feedback_report_support,              /* 27 */
17103   &hf_he_ops_support,                              /* 28 */
17104   &hf_he_a_msdu_in_a_mpdu_support,                 /* 29 */
17105   &hf_he_reserved,                                 /* 30 */
17106   NULL
17107 };
17108
17109 static const int *he_phy_first_byte_headers[] = {
17110   &hf_he_phy_cap_dual_band_support,
17111   NULL,
17112 };
17113
17114 static const int *he_phy_channel_width_set_headers[] _U_ = {
17115   &hf_he_40mhz_channel_2_4ghz,
17116   &hf_he_40_and_80_mhz_5ghz,
17117   &hf_he_160_mhz_5ghz,
17118   &hf_he_160_80_plus_80_mhz_5ghz,
17119   &hf_he_242_tone_rus_in_2_4ghz,
17120   &hf_he_242_tone_rus_in_5ghz,
17121   &hf_he_chan_width_reserved,
17122   NULL
17123 };
17124
17125 static const int *he_phy_b8_to_b23_headers[] = {
17126   &hf_he_phy_cap_punctured_preamble_rx,
17127   &hf_he_phy_cap_device_class,
17128   &hf_he_phy_cap_ldpc_coding_in_payload,
17129   &hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us,
17130   &hf_he_phy_cap_midamble_rx_max_nsts,
17131   &hf_he_phy_cap_ndp_with_4x_he_ltf_32us,
17132   &hf_he_phy_cap_stbc_tx_lt_80mhz,
17133   &hf_he_phy_cap_stbc_rx_lt_80mhz,
17134   &hf_he_phy_cap_doppler_tx,
17135   &hf_he_phy_cap_doppler_rx,
17136   &hf_he_phy_cap_full_bw_ul_mu_mimo,
17137   &hf_he_phy_cap_partial_bw_ul_mu_mimo,
17138   NULL
17139 };
17140
17141 static const int *he_phy_b24_to_b39_headers[] = {
17142   &hf_he_phy_cap_dcm_max_constellation_tx,
17143   &hf_he_phy_cap_dcm_max_nss_tx,
17144   &hf_he_phy_cap_dcm_max_constellation_rx,
17145   &hf_he_phy_cap_dcm_max_nss_rx,
17146   &hf_he_phy_cap_rx_he_muppdu_from_non_ap,
17147   &hf_he_phy_cap_su_beamformer,
17148   &hf_he_phy_cap_su_beamformee,
17149   &hf_he_phy_cap_mu_beamformer,
17150   &hf_he_phy_cap_beamformer_sts_lte_80mhz,
17151   &hf_he_phy_cap_beamformer_sts_gt_80mhz,
17152   NULL
17153 };
17154
17155 static const int *he_phy_b40_to_b55_headers[] = {
17156   &hf_he_phy_cap_number_of_sounding_dims_lte_80,
17157   &hf_he_phy_cap_number_of_sounding_dims_gt_80,
17158   &hf_he_phy_cap_ng_eq_16_su_fb,
17159   &hf_he_phy_cap_ng_eq_16_mu_fb,
17160   &hf_he_phy_cap_codebook_size_eq_4_2_fb,
17161   &hf_he_phy_cap_codebook_size_eq_7_5_fb,
17162   &hf_he_phy_cap_triggered_su_beamforming_fb,
17163   &hf_he_phy_cap_triggered_mu_beamforming_fb,
17164   &hf_he_phy_cap_triggered_cqi_fb,
17165   &hf_he_phy_cap_partial_bw_extended_range,
17166   &hf_he_phy_cap_partial_bw_dl_mu_mimo,
17167   &hf_he_phy_cap_ppe_threshold_present,
17168   NULL
17169 };
17170
17171 static const int *he_phy_b56_to_b71_headers[] = {
17172   &hf_he_phy_cap_srp_based_sr_support,
17173   &hf_he_phy_cap_power_boost_factor_ar_support,
17174   &hf_he_phy_cap_he_su_ppdu_etc_gi,
17175   &hf_he_phy_cap_max_nc,
17176   &hf_he_phy_cap_stbc_tx_gt_80_mhz,
17177   &hf_he_phy_cap_stbc_rx_gt_80_mhz,
17178   &hf_he_phy_cap_he_er_su_ppdu_4xxx_gi,
17179   &hf_he_phy_cap_20mhz_in_40mhz_24ghz_band,
17180   &hf_he_phy_cap_20mhz_in_160_80p80_ppdu,
17181   &hf_he_phy_cap_80mgz_in_160_80p80_ppdu,
17182   &hf_he_phy_cap_he_er_su_ppdu_1xxx_gi,
17183   &hf_he_phy_cap_midamble_rx_2x_xxx_ltf,
17184   &hf_he_phy_cap_b70_b71_reserved,
17185   NULL
17186 };
17187
17188 static const int *he_mcs_map_headers [] = {
17189   &hf_he_mcs_max_he_mcs_1_ss,
17190   &hf_he_mcs_max_he_mcs_2_ss,
17191   &hf_he_mcs_max_he_mcs_3_ss,
17192   &hf_he_mcs_max_he_mcs_4_ss,
17193   &hf_he_mcs_max_he_mcs_5_ss,
17194   &hf_he_mcs_max_he_mcs_6_ss,
17195   &hf_he_mcs_max_he_mcs_7_ss,
17196   &hf_he_mcs_max_he_mcs_8_ss,
17197   NULL
17198 };
17199
17200 static const value_string ru_alloc_vals[] = {
17201   { 0, "242" },
17202   { 1, "484" },
17203   { 2, "996" },
17204   { 3, "2x996" },
17205   { 0, NULL }
17206 };
17207
17208 static const value_string constellation_vals[] = {
17209   { 0, "BPSK" },
17210   { 1, "QPSK" },
17211   { 2, "16-QAM" },
17212   { 3, "64-QAM" },
17213   { 4, "256-QAM" },
17214   { 5, "1024-QAM" },
17215   { 6, "Reserved" },
17216   { 7, "None" },
17217   { 0, NULL }
17218 };
17219
17220 #define HE_CHANNEL_WIDTH_SET_B2 0x04
17221 #define HE_CHANNEL_WIDTH_SET_B3 0x08
17222
17223 static void
17224 dissect_he_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
17225   int offset, int len)
17226 {
17227   guint64 he_mac_caps = tvb_get_letoh40(tvb, offset);
17228   guint8 phy_channel_width_set = 0;
17229   proto_tree *phy_cap_tree = NULL;
17230   guint he_mcs_and_nss_len = 4;
17231   proto_tree *sup_he_mcs_and_nss_tree = NULL;
17232   proto_tree *rx_tx_he_mcs_map_80 = NULL;
17233   proto_tree *rx_tx_he_mcs_map_160 = NULL;
17234   proto_tree *rx_tx_he_mcs_map_80_80 = NULL;
17235
17236   /* Change some header fields depending on HE_HTC_HE_SUPPORT and FRAGMENTATION */
17237   if (!(he_mac_caps & HE_HTC_HE_SUPPORT)) {
17238     he_mac_headers[8] = &hf_he_reserved_bits_15_16;
17239     he_mac_headers[10] = &hf_he_reserved_bit_18;
17240     he_mac_headers[11] = &hf_he_reserved_bit_19;
17241     he_mac_headers[17] = &hf_he_reserved_bit_25;
17242   }
17243   if (!(he_mac_caps & HE_FRAGMENTATION_SUPPORT)) {
17244     he_mac_headers[4] = &hf_he_reserved_bits_5_7;
17245     he_mac_headers[5] = &hf_he_reserved_bits_8_9;
17246   }
17247
17248   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_mac_capabilities,
17249                         ett_he_mac_capabilities, he_mac_headers,
17250                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17251   offset += 5;
17252
17253   /* Get and isolate the phy channel witdth set */
17254   phy_channel_width_set = tvb_get_guint8(tvb, offset) >> 1;
17255   phy_cap_tree = proto_tree_add_subtree(tree, tvb, offset, 9, ett_he_phy_capabilities,
17256                         NULL,
17257                         "HE Phy Capabilities Information");
17258   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
17259                         hf_he_phy_dual_band_support, ett_he_phy_cap_first_byte,
17260                         he_phy_first_byte_headers, ENC_NA, BMT_NO_APPEND);
17261   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
17262                         hf_he_phy_chan_width_set,  ett_he_phy_cap_chan_width_set,
17263                         he_phy_channel_width_set_headers, ENC_NA, BMT_NO_APPEND);
17264   offset++;
17265   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
17266                         hf_he_phy_b8_to_b23, ett_he_phy_cap_b8_to_b23,
17267                         he_phy_b8_to_b23_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17268   offset += 2;
17269   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
17270                         hf_he_phy_b24_to_b39, ett_he_phy_cap_b24_to_b39,
17271                         he_phy_b24_to_b39_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17272   offset += 2;
17273   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
17274                         hf_he_phy_b40_to_b55, ett_he_phy_cap_b40_to_b55,
17275                         he_phy_b40_to_b55_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17276   offset += 2;
17277   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
17278                         hf_he_phy_b56_to_b71, ett_he_phy_cap_b56_to_b71,
17279                         he_phy_b56_to_b71_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17280   offset += 2;
17281
17282   /* Need the length first */
17283   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B2)
17284     he_mcs_and_nss_len += 4;
17285
17286   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B3)
17287     he_mcs_and_nss_len += 4;
17288
17289   sup_he_mcs_and_nss_tree = proto_tree_add_subtree(tree, tvb, offset,
17290                         he_mcs_and_nss_len, ett_he_mcs_and_nss_set, NULL,
17291                         "Tx Rx HE-MCS NSS Support");
17292   rx_tx_he_mcs_map_80 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree, tvb,
17293                         offset, 4, ett_he_rx_tx_he_mcs_map_lte_80, NULL,
17294                         "Rx and Tx MCS Maps <= 80 MHz");
17295   proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80, tvb, offset,
17296                         hf_he_rx_he_mcs_map_lte_80,
17297                         ett_he_rx_mcs_map_lte_80, he_mcs_map_headers,
17298                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17299   offset += 2;
17300   proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80, tvb, offset,
17301                         hf_he_tx_he_mcs_map_lte_80,
17302                         ett_he_tx_mcs_map_lte_80, he_mcs_map_headers,
17303                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17304   offset += 2;
17305
17306   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B2) {
17307     rx_tx_he_mcs_map_160 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree,
17308                         tvb, offset, 4, ett_he_rx_tx_he_mcs_map_160, NULL,
17309                         "Rx and Tx MCS Maps 160 MHz");
17310     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_160, tvb, offset,
17311                         hf_he_rx_he_mcs_map_160,
17312                         ett_he_rx_mcs_map_160, he_mcs_map_headers,
17313                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17314     offset += 2;
17315     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_160, tvb, offset,
17316                         hf_he_tx_he_mcs_map_160,
17317                         ett_he_tx_mcs_map_160, he_mcs_map_headers,
17318                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17319     offset += 2;
17320   }
17321
17322   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B3) {
17323     rx_tx_he_mcs_map_80_80 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree,
17324                         tvb, offset, 4, ett_he_rx_tx_he_mcs_map_80_80, NULL,
17325                         "Rx and Tx MCS Maps 80+80 MHz");
17326     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80_80, tvb, offset,
17327                         hf_he_rx_he_mcs_map_80_80,
17328                         ett_he_rx_mcs_map_80_80, he_mcs_map_headers,
17329                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17330     offset += 2;
17331     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80_80, tvb, offset,
17332                         hf_he_tx_he_mcs_map_80_80,
17333                         ett_he_tx_mcs_map_80_80, he_mcs_map_headers,
17334                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17335     offset += 2;
17336   }
17337
17338   if (offset < len) {
17339     guint8 ppe_thresholds_field = tvb_get_guint8(tvb, offset);
17340     guint8 nss_count = ppe_thresholds_field & 0x07, nss_index = 0;
17341     guint8 ru_index_bitmask = (ppe_thresholds_field >> 3) & 0x0F;
17342     proto_tree *ppe_tree = NULL;
17343     int i = 0;
17344     int bit_offset = 7;  /* How many bits we are into the bytes */
17345
17346     ppe_tree = proto_tree_add_subtree(tree, tvb, offset, len - offset + 1,
17347                         ett_he_ppe_threshold, NULL,
17348                         "PPE Thresholds");
17349     proto_tree_add_item(ppe_tree, hf_he_ppe_thresholds_nss, tvb, offset,
17350                         1, ENC_NA);
17351     proto_tree_add_item(ppe_tree, hf_he_ppe_thresholds_ru_index_bitmask, tvb,
17352                         offset, 1, ENC_NA);
17353
17354     /* Now, for each of the nss values, add a sub-tree with its thresholds */
17355     while (nss_index < nss_count) {
17356       int start_offset = 0;
17357       proto_tree *nss_tree = NULL;
17358       proto_item *nssti = NULL;
17359       guint8 l_ru_bitmask = ru_index_bitmask;
17360
17361       nss_tree = proto_tree_add_subtree_format(ppe_tree, tvb, offset, -1,
17362                         ett_he_ppe_nss, &nssti, "NSS %d", nss_index);
17363       start_offset = offset;
17364
17365       for (i = 0; i < 4; i++) {
17366         if (l_ru_bitmask & 0x01) {
17367           int bits_avail = 8 - bit_offset, bits_needed = 6 - bits_avail;
17368           guint8 the_bits = 0;
17369           int ru_start_offset = offset;
17370           proto_tree *ru_alloc_tree = NULL;
17371           proto_item *rualti = NULL;
17372
17373           ru_alloc_tree = proto_tree_add_subtree_format(nss_tree, tvb, offset,
17374                                         -1, ett_he_ppe_ru_alloc, &rualti,
17375                                         "RU allocation: %s",
17376                                         val_to_str(i, ru_alloc_vals, "Unk"));
17377
17378           /*
17379            * Assemble the bits we require ... we need 6, or 2x3
17380            */
17381           if (bits_avail >= 6) { /* We can use the current byte */
17382             the_bits = (tvb_get_guint8(tvb, offset) >> bit_offset) & 0x3F;
17383           } else { /* We need two adjacent bytes */
17384             the_bits = (tvb_get_guint8(tvb, offset) >> bit_offset);
17385             offset++;
17386             the_bits = the_bits >> bit_offset |
17387                         ((tvb_get_guint8(tvb, offset) &
17388                                 ((1 << bits_needed) - 1)) << (6 - bits_needed));
17389           }
17390           /*
17391            * Now we have two three bit fields, use them.
17392            */
17393           proto_tree_add_uint(ru_alloc_tree, hf_he_ppe_ppet16, tvb, ru_start_offset,
17394                               offset - ru_start_offset + 1, the_bits & 0x07);
17395           proto_tree_add_uint(ru_alloc_tree, hf_he_ppe_ppet8, tvb, ru_start_offset,
17396                               offset - ru_start_offset + 1, the_bits >> 3);
17397
17398           bit_offset = (bit_offset + 6) % 8;
17399           proto_item_set_len(rualti, offset - ru_start_offset + 1);
17400         }
17401         l_ru_bitmask = l_ru_bitmask >> 1;
17402       }
17403
17404
17405       proto_item_set_len(nssti, offset - start_offset);
17406       nss_index++;
17407     }
17408   }
17409
17410   /* Add an Expert Info about extra bytes ... */
17411
17412 }
17413
17414 static const int *he_operation_headers[] = {
17415   &hf_he_operation_bss_color,
17416   &hf_he_operation_default_pe_duration,
17417   &hf_he_operation_twt_required,
17418   &hf_he_operation_txop_duration_rts_threshold,
17419   &hf_he_operation_partial_bss_color,
17420   &hf_he_operation_vht_operation_information_present,
17421   &hf_he_operation_reserved_b22_b27,
17422   &hf_he_operation_multiple_bssid_ap,
17423   &hf_he_operation_txbssid_indicator,
17424   &hf_he_operation_bss_color_disabled,
17425   &hf_he_operation_reserved_b31,
17426   NULL
17427 };
17428
17429 static const value_string he_mcs_map_vals[] = {
17430   { 0, "Support for HE-MCS 0-7" },
17431   { 1, "Support for HE-MCS 0-9" },
17432   { 2, "Support for HE-MCS 0-11" },
17433   { 3, "Not supported for HE PPDUs" },
17434   { 0, NULL }
17435 };
17436
17437 static const int *he_basic_he_mcs_header[] = {
17438   &hf_he_oper_max_he_mcs_for_1_ss,
17439   &hf_he_oper_max_he_mcs_for_2_ss,
17440   &hf_he_oper_max_he_mcs_for_3_ss,
17441   &hf_he_oper_max_he_mcs_for_4_ss,
17442   &hf_he_oper_max_he_mcs_for_5_ss,
17443   &hf_he_oper_max_he_mcs_for_6_ss,
17444   &hf_he_oper_max_he_mcs_for_7_ss,
17445   &hf_he_oper_max_he_mcs_for_8_ss,
17446   NULL
17447 };
17448
17449 #define VHT_OPERATION_INFORMATION_PRESENT 0x00200000
17450 #define MULTIPLE_BSSID_AP                 0x10000000
17451
17452 static const value_string channel_width_vals[] = {
17453   { 0, "20 MHz or 40 MHz BSS Bandwidth" },
17454   { 1, "80 MHz, 160 MHz or 80+80 MHz BSS Bandwidth" },
17455   { 2, "160 MHz BSS Bandwidth (deprecated)" },
17456   { 3, "Non-contiguous 80+80 MHz BSS Bandwidth (deprecated)" },
17457   { 0, NULL }
17458 };
17459
17460 static void
17461 dissect_he_operation(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
17462   int offset, int len _U_)
17463 {
17464     guint32 op_params = tvb_get_letohl(tvb, offset);
17465
17466     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
17467                         hf_he_operation_parameter, ett_he_operation_params,
17468                         he_operation_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17469     offset += 4;
17470
17471     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
17472                         hf_he_operation_basic_mcs, ett_he_oper_basic_mcs,
17473                         he_basic_he_mcs_header, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17474     offset += 2;
17475
17476     if (op_params & VHT_OPERATION_INFORMATION_PRESENT) {
17477       proto_tree *vht_op_info = NULL;
17478       proto_item *pi = NULL;
17479
17480       vht_op_info = proto_tree_add_subtree(tree, tvb, offset, 3,
17481                         ett_he_operation_vht_op_info, NULL,
17482                         "VHT Operation Information");
17483       pi = proto_tree_add_item(vht_op_info, hf_he_operation_channel_width, tvb,
17484                         offset, 1, ENC_NA);
17485       proto_item_append_text(pi, ": %s",
17486                         val_to_str(tvb_get_guint8(tvb, offset),
17487                                 channel_width_vals,
17488                                 "Reserved %u"));
17489       offset++;
17490
17491       proto_tree_add_item(vht_op_info, hf_he_operation_channel_center_freq_0,
17492                         tvb, offset, 1, ENC_NA);
17493       offset++;
17494
17495       proto_tree_add_item(vht_op_info, hf_he_operation_channel_center_freq_1,
17496                         tvb, offset, 1, ENC_NA);
17497       offset++;
17498     }
17499
17500     if (op_params & MULTIPLE_BSSID_AP) {
17501       proto_tree_add_item(tree, hf_he_operation_max_bssid_indicator, tvb, offset,
17502                         1, ENC_NA);
17503       offset++;
17504     }
17505 }
17506
17507 static const int *uora_headers[] = {
17508   &hf_he_uora_eocwmin,
17509   &hf_he_uora_owcwmax,
17510   &hf_he_uora_reserved,
17511   NULL
17512 };
17513
17514 static void
17515 dissect_uora_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
17516   int offset)
17517 {
17518   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
17519                         hf_he_uora_field, ett_he_uora_tree, uora_headers,
17520                         ENC_NA, BMT_NO_APPEND);
17521   offset++;
17522 }
17523
17524 static int
17525 dissect_muac_param_record(tvbuff_t *tvb, proto_tree *tree, int offset)
17526 {
17527   proto_tree_add_item(tree, hf_he_muac_aci_aifsn, tvb, offset, 1, ENC_NA);
17528   offset++;
17529
17530   proto_tree_add_item(tree, hf_he_muac_ecwmin_ecwmax, tvb, offset, 1, ENC_NA);
17531   offset++;
17532
17533   proto_tree_add_item(tree, hf_he_mu_edca_timer, tvb, offset, 1, ENC_NA);
17534   offset++;
17535
17536   return offset;
17537 }
17538
17539 static int
17540 dissect_mu_edca_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
17541   int offset, int len _U_)
17542 {
17543   proto_tree *param_tree = NULL;
17544
17545   /* Is this from an AP or an STA? */
17546   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
17547                                     ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
17548                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17549   offset++;
17550
17551   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
17552                         NULL, "MUAC_BE Parameter Record");
17553   offset = dissect_muac_param_record(tvb, param_tree, offset);
17554
17555   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
17556                         NULL, "MUAC_BK Parameter Record");
17557   offset = dissect_muac_param_record(tvb, param_tree, offset);
17558
17559   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
17560                         NULL, "MUAC_VI Parameter Record");
17561   offset = dissect_muac_param_record(tvb, param_tree, offset);
17562
17563   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
17564                         NULL, "MUAC_VO Parameter Record");
17565   offset = dissect_muac_param_record(tvb, param_tree, offset);
17566
17567   return offset;
17568 }
17569
17570 #define SRP_DISALLOWED                     0x01
17571 #define NON_SRG_OBSS_PD_SR_DISALLOWED      0x02
17572 #define NON_SRG_OFFSET_PRESENT             0x04
17573 #define SRG_INFORMATION_PRESENT            0x08
17574 #define HESIGA_SPATIAL_REUSE_VAL15_ALLOWED 0x10
17575
17576 static const int *sr_control_field_headers[] = {
17577   &hf_he_srp_disallowed,
17578   &hf_he_non_srg_obss_pd_sr_disallowed,
17579   &hf_he_non_srg_offset_present,
17580   &hf_he_srg_information_present,
17581   &hf_he_hesiga_spatial_reuse_value15_allowed,
17582   &hf_he_sr_control_reserved,
17583   NULL
17584 };
17585
17586 static int
17587 dissect_spatial_reuse_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_,
17588   proto_tree *tree, int offset, int len _U_)
17589 {
17590   guint8 sr_control = tvb_get_guint8(tvb, offset);
17591
17592   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_spatial_reuse_sr_control,
17593                                     ett_he_spatial_reuse_control,
17594                                     sr_control_field_headers,
17595                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17596   offset++;
17597
17598   if (sr_control & NON_SRG_OFFSET_PRESENT) {
17599     proto_tree_add_item(tree, hf_he_spatial_non_srg_obss_pd_max_offset,
17600                         tvb, offset, 1, ENC_NA);
17601     offset++;
17602   }
17603
17604   if (sr_control & SRG_INFORMATION_PRESENT) {
17605     proto_tree_add_item(tree, hf_he_spatial_srg_obss_pd_min_offset, tvb,
17606                         offset, 1, ENC_NA);
17607     offset++;
17608     proto_tree_add_item(tree, hf_he_spatial_srg_obss_pd_max_offset, tvb,
17609                         offset, 1, ENC_NA);
17610     offset++;
17611     proto_tree_add_item(tree, hf_he_spatial_srg_bss_color_bitmap, tvb,
17612                         offset, 8, ENC_NA);
17613     offset += 8;
17614     proto_tree_add_item(tree, hf_he_spatial_srg_partial_bssid_bitmap,
17615                         tvb, offset, 8, ENC_NA);
17616     offset += 8;
17617   }
17618
17619   return offset;
17620 }
17621
17622 static void
17623 dissect_ndp_feedback_report_set(tvbuff_t *tvb, packet_info *pinfo _U_,
17624   proto_tree *tree, int offset, int len _U_)
17625 {
17626   proto_tree_add_item(tree, hf_he_resource_request_buffer_thresh, tvb, offset,
17627                         1, ENC_NA);
17628 }
17629
17630 static const int *bss_new_color_headers[] = {
17631   &hf_he_new_bss_color_info_color,
17632   &hf_he_new_bss_color_info_reserved,
17633   NULL
17634 };
17635
17636 static void
17637 dissect_bss_color_change(tvbuff_t *tvb, packet_info *pinfo _U_,
17638   proto_tree *tree, int offset, int len _U_)
17639 {
17640   proto_tree_add_item(tree, hf_he_bss_color_change_switch_countdown, tvb, offset,
17641                         1, ENC_NA);
17642   offset++;
17643
17644   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
17645                                 hf_he_bss_color_change_new_color_info,
17646                                 ett_he_bss_new_color_info, bss_new_color_headers,
17647                                 ENC_NA, BMT_NO_APPEND);
17648 }
17649
17650 static const int *ess_info_field_headers[] = {
17651   &hf_he_ess_report_planned_ess,
17652   &hf_he_ess_report_edge_of_ess,
17653   NULL
17654 };
17655
17656 static void
17657 dissect_ess_report(tvbuff_t *tvb, packet_info *pinfo _U_,
17658   proto_tree *tree, int offset, int len _U_)
17659 {
17660   guint8 bss_trans_thresh = tvb_get_guint8(tvb, offset) >> 2;
17661
17662
17663   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_ess_report_info_field,
17664                                     ett_he_ess_report_info_field,
17665                                     ess_info_field_headers,
17666                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17667   if (bss_trans_thresh == 63)
17668     proto_tree_add_int_format(tree, hf_he_ess_report_recommend_transition_thresh, tvb,
17669                         offset, 1, bss_trans_thresh, " (%ddBm)",
17670                         -100 + bss_trans_thresh);
17671   else
17672     proto_tree_add_int_format(tree, hf_he_ess_report_recommend_transition_thresh,
17673                         tvb, offset, 1, bss_trans_thresh, " (No recommendation)");
17674 }
17675
17676 /*
17677  * There will be from 1 to 4 24-bit fields in the order of AC=BK, AC=BE,
17678  * AC=VI and AC=VO.
17679  */
17680
17681 static const int *esp_headers[] = {
17682   &hf_ieee80211_esp_access_category,
17683   &hf_ieee80211_esp_reserved,
17684   &hf_ieee80211_esp_data_format,
17685   &hf_ieee80211_esp_ba_windows_size,
17686   &hf_ieee80211_esp_est_air_time_frac,
17687   &hf_ieee80211_esp_data_ppdu_duration_target,
17688   NULL
17689 };
17690
17691 static const value_string esp_access_category_vals[] = {
17692   { 0, "AC=BK" },
17693   { 1, "AC=BE" },
17694   { 2, "AC=VI" },
17695   { 3, "AC=VO" },
17696   { 0, NULL }
17697 };
17698
17699 static const value_string esp_data_format_vals[] = {
17700   { 0, "No aggregation is expected to be performed" },
17701   { 1, "A-MSDU aggregation is expected but not A-MPDUs when type is data" },
17702   { 2, "A-MSDU aggregation is NOT expected but A-MPDUs aggregation is when type is data" },
17703   { 3, "A-MSDU aggregation is expected and A-MPDU aggregation is when type is data" },
17704   { 0, NULL }
17705 };
17706
17707 static const value_string esp_ba_window_size_vals[] = {
17708   { 0, "Block Ack not expected to be used" },
17709   { 1, "2" },
17710   { 2, "4" },
17711   { 3, "6" },
17712   { 4, "8" },
17713   { 5, "16" },
17714   { 6, "32" },
17715   { 7, "64" },
17716   { 0, NULL }
17717 };
17718
17719 static int
17720 dissect_estimated_service_params(tvbuff_t *tvb, packet_info *pinfo _U_,
17721   proto_tree *tree, int offset, int len)
17722 {
17723   while (len > 0) {
17724     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
17725                         hf_ieee80211_estimated_service_params, ett_ieee80211_esp,
17726                         esp_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17727     offset += 3;
17728     len -= 3;
17729   }
17730
17731   return offset;
17732 }
17733
17734 static int
17735 dissect_future_channel_guidance(tvbuff_t *tvb, packet_info *pinfo _U_,
17736   proto_tree *tree, int offset, int len _U_)
17737 {
17738   proto_tree_add_item(tree, hf_ieee80211_fcg_new_channel_number, tvb, offset,
17739                         4, ENC_LITTLE_ENDIAN);
17740   offset += 4;
17741
17742   if (len - 4 > 0) {
17743     proto_tree_add_item(tree, hf_ieee80211_fcg_extra_info, tvb, offset, len - 4,
17744                         ENC_NA);
17745     offset += len - 4;
17746   }
17747
17748   return offset;
17749 }
17750
17751 static int
17752 ieee80211_tag_element_id_extension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17753 {
17754   int tag_len = tvb_reported_length(tvb);
17755   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17756   int offset = 0;
17757   int ext_tag_len;
17758   guint8 ext_tag_no;
17759
17760   if (tag_len < 1)
17761   {
17762     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 1", tag_len);
17763     return tvb_captured_length(tvb);
17764   }
17765   ext_tag_no = tvb_get_guint8(tvb, offset++);
17766   ext_tag_len = tag_len - 1;
17767
17768   switch (ext_tag_no) {
17769     case ETAG_FILS_SESSION:
17770       proto_tree_add_item(tree, hf_ieee80211_fils_session, tvb, offset, ext_tag_len, ENC_NA);
17771       break;
17772     case ETAG_FILS_WRAPPED_DATA:
17773       proto_tree_add_item(tree, hf_ieee80211_fils_wrapped_data, tvb, offset, ext_tag_len, ENC_NA);
17774       break;
17775     case ETAG_FILS_NONCE:
17776       proto_tree_add_item(tree, hf_ieee80211_fils_nonce, tvb, offset, ext_tag_len, ENC_NA);
17777       break;
17778     case ETAG_ESTIMATED_SERVICE_PARAM:
17779       dissect_estimated_service_params(tvb, pinfo, tree, offset, ext_tag_len);
17780       break;
17781     case ETAG_FUTURE_CHANNEL_GUIDANCE:
17782       dissect_future_channel_guidance(tvb, pinfo, tree, offset, ext_tag_len);
17783       break;
17784     case ETAG_HE_CAPABILITIES:
17785       dissect_he_capabilities(tvb, pinfo, tree, offset, ext_tag_len);
17786       break;
17787     case ETAG_HE_OPERATION:
17788       dissect_he_operation(tvb, pinfo, tree, offset, ext_tag_len);
17789       break;
17790     case ETAG_UORA_PARAMETER_SET:
17791       dissect_uora_parameter_set(tvb, pinfo, tree, offset);
17792       break;
17793     case ETAG_MU_EDCA_PARAMETER_SET:
17794       dissect_mu_edca_parameter_set(tvb, pinfo, tree, offset, ext_tag_len);
17795       break;
17796     case ETAG_SPATIAL_REUSE_PARAMETER_SET:
17797       dissect_spatial_reuse_parameter_set(tvb, pinfo, tree, offset, ext_tag_len);
17798       break;
17799     case ETAG_NDP_FEEDBACK_REPORT_PARAMETER_SET:
17800       dissect_ndp_feedback_report_set(tvb, pinfo, tree, offset, ext_tag_len);
17801       break;
17802     case ETAG_BSS_COLOR_CHANGE_ANNOUNCEMENT:
17803       dissect_bss_color_change(tvb, pinfo, tree, offset, ext_tag_len);
17804       break;
17805     case ETAG_QUIET_TIME_PERIOD_SETUP:
17806
17807       break;
17808     case ETAG_ESS_REPORT:
17809       dissect_ess_report(tvb, pinfo, tree, offset, ext_tag_len);
17810       break;
17811     default:
17812       break;
17813   }
17814
17815   return tvb_captured_length(tvb);
17816 }
17817
17818 /* Conflict: WAPI Vs. IEEE */
17819 static int
17820 ieee80211_tag_ie_68_conflict(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17821 {
17822   int tag_len = tvb_reported_length(tvb);
17823   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17824   if (tag_len >= 20) { /* It Might be WAPI*/
17825     dissect_wapi_param_set(tvb, pinfo, tree, 0, tag_len, field_data->item_tag_length, field_data->item_tag, field_data->ftype);
17826   }
17827   else { /* BSS AC Access Delay (68) */
17828      dissect_bss_ac_access_delay_ie(tvb, pinfo, tree, 0, tag_len, field_data->item_tag_length);
17829   }
17830   return tvb_captured_length(tvb);
17831 }
17832
17833 static int
17834 ieee80211_tag_mesh_peering_mgmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
17835 {
17836   int tag_len = tvb_reported_length(tvb);
17837   int offset = 0;
17838
17839   proto_tree_add_item(tree, hf_ieee80211_mesh_peering_proto, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17840   offset += 2;
17841   proto_tree_add_item(tree, hf_ieee80211_mesh_peering_local_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17842   offset += 2;
17843   switch (tvb_get_guint8(tvb, 1))
17844   {                                         /* Self-protected action field */
17845     case SELFPROT_ACTION_MESH_PEERING_OPEN:
17846       break;
17847
17848     case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
17849       proto_tree_add_item(tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17850       break;
17851
17852     case SELFPROT_ACTION_MESH_PEERING_CLOSE:
17853       if ((tag_len == 8) || (tag_len == 24))
17854       {
17855         proto_tree_add_item(tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17856         offset += 2;
17857       }
17858       add_ff_reason_code(tree, tvb, pinfo, offset);
17859       break;
17860
17861       /* unexpected values */
17862     default:
17863       proto_tree_add_expert(tree, pinfo, &ei_ieee80211_mesh_peering_unexpected , tvb, offset, tag_len);
17864       break;
17865   }
17866   if (tag_len - offset == 16)
17867   {
17868     proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
17869   }
17870   return tvb_captured_length(tvb);
17871 }
17872
17873 static int
17874 ieee80211_tag_mesh_configuration(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
17875 {
17876   int offset = 0;
17877   proto_item *item;
17878   proto_tree *subtree;
17879   static const int *ieee80211_mesh_config_cap[] = {
17880     &hf_ieee80211_mesh_config_cap_accepting,
17881     &hf_ieee80211_mesh_config_cap_mcca_support,
17882     &hf_ieee80211_mesh_config_cap_mcca_enabled,
17883     &hf_ieee80211_mesh_config_cap_forwarding,
17884     &hf_ieee80211_mesh_config_cap_mbca_enabled,
17885     &hf_ieee80211_mesh_config_cap_tbtt_adjusting,
17886     &hf_ieee80211_mesh_config_cap_power_save_level,
17887     NULL
17888   };
17889
17890   proto_tree_add_item(tree, hf_ieee80211_mesh_config_path_sel_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17891   proto_tree_add_item(tree, hf_ieee80211_mesh_config_path_sel_metric, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
17892   proto_tree_add_item(tree, hf_ieee80211_mesh_config_congestion_control, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
17893   proto_tree_add_item(tree, hf_ieee80211_mesh_config_sync_method, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
17894   proto_tree_add_item(tree, hf_ieee80211_mesh_config_auth_protocol, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
17895   item = proto_tree_add_item(tree, hf_ieee80211_mesh_config_formation_info, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
17896   subtree = proto_item_add_subtree(item, ett_mesh_formation_info_tree);
17897   proto_tree_add_item(subtree, hf_ieee80211_mesh_form_info_num_of_peerings, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
17898
17899   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_mesh_config_capability,
17900                                     ett_mesh_config_cap_tree, ieee80211_mesh_config_cap,
17901                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17902   return tvb_captured_length(tvb);
17903 }
17904
17905 static int
17906 ieee80211_tag_mesh_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17907 {
17908   int offset = 0;
17909   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17910   int tag_len = tvb_reported_length(tvb);
17911   const guint8* mesh_id;
17912
17913   proto_tree_add_item_ret_string(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &mesh_id);
17914   if (tag_len > 0) {
17915     gchar* s = format_text(wmem_packet_scope(), mesh_id, tag_len);
17916     col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", s);
17917     proto_item_append_text(field_data->item_tag, ": %s", s);
17918   }
17919   /* Make sure dissector is accepted */
17920   return ((tag_len > 0) ? tag_len : 1);
17921 }
17922
17923 static int
17924 ieee80211_tag_mesh_preq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
17925 {
17926   int offset = 0;
17927
17928   guint32 flags;
17929   guint8 targs, i;
17930
17931   proto_tree_add_item_ret_uint(tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN, &flags);
17932   offset += 1;
17933   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17934   offset += 1;
17935   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17936   offset += 1;
17937   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_pdid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17938   offset += 4;
17939   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
17940   offset += 6;
17941   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17942   offset += 4;
17943
17944   if (flags & (1<<6)) {
17945     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_ext, tvb, offset, 6, ENC_NA);
17946     offset += 6;
17947   }
17948   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17949   offset += 4;
17950   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17951   offset += 4;
17952   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17953   targs = tvb_get_guint8(tvb, offset);
17954   offset += 1;
17955   for (i = 0; i < targs; i++) {
17956     const int * targ_flags[] = {
17957       &hf_ieee80211_ff_hwmp_targ_to_flags,
17958       &hf_ieee80211_ff_hwmp_targ_usn_flags,
17959       NULL
17960     };
17961
17962     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_hwmp_targ_flags,
17963                                    ett_hwmp_targ_flags_tree, targ_flags, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17964
17965     offset += 1;
17966     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
17967     offset += 6;
17968     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17969     offset += 4;
17970   }
17971
17972   return tvb_captured_length(tvb);
17973 }
17974
17975 static int
17976 ieee80211_tag_mesh_prep(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
17977 {
17978   int offset = 0;
17979
17980   guint32 flags;
17981   proto_tree_add_item_ret_uint(tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN, &flags);
17982   offset += 1;
17983   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17984   offset += 1;
17985   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset , 1, ENC_LITTLE_ENDIAN);
17986   offset += 1;
17987   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
17988   offset += 6;
17989   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17990   offset += 4;
17991   if (flags & (1<<6)) {
17992     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
17993     offset += 6;
17994   }
17995   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17996   offset += 4;
17997   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17998   offset += 4;
17999   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
18000   offset += 6;
18001   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18002   return tvb_captured_length(tvb);
18003 }
18004
18005 static int
18006 ieee80211_tag_mesh_perr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18007 {
18008   int offset = 0;
18009   guint8 targs, i;
18010
18011   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18012   offset += 1;
18013   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18014   targs = tvb_get_guint8(tvb, offset);
18015   offset += 1;
18016   for (i = 0; i < targs; i++) {
18017     guint8 flags = tvb_get_guint8(tvb, offset);
18018
18019     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18020     offset += 1;
18021     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
18022     offset += 6;
18023     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18024     offset += 4;
18025     if (flags & (1<<6)) {
18026       proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
18027       offset += 6;
18028     }
18029     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
18030   }
18031   return tvb_captured_length(tvb);
18032 }
18033
18034 static int
18035 ieee80211_tag_rann(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
18036 {
18037   int offset = 0;
18038   proto_tree_add_item(tree, hf_ieee80211_rann_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18039   offset += 1;
18040   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18041   offset += 1;
18042   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18043   offset += 1;
18044   proto_tree_add_item(tree, hf_ieee80211_rann_root_sta, tvb, offset, 6, ENC_NA);
18045   offset += 6;
18046   proto_tree_add_item(tree, hf_ieee80211_rann_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18047   offset += 4;
18048   proto_tree_add_item(tree, hf_ieee80211_rann_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18049   offset += 4;
18050   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18051   return tvb_captured_length(tvb);
18052 }
18053
18054 /* Mesh Channel Switch Parameters (118) */
18055 static int
18056 ieee80211_tag_mesh_channel_switch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18057 {
18058   int tag_len = tvb_reported_length(tvb);
18059   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18060   int offset = 0;
18061   static const int * ieee80211_mesh_chswitch_flag[] = {
18062     &hf_ieee80211_mesh_chswitch_flag_initiator,
18063     &hf_ieee80211_mesh_chswitch_flag_txrestrict,
18064     NULL
18065   };
18066
18067   if (tag_len != 6)
18068   {
18069     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
18070     return tvb_captured_length(tvb);
18071   }
18072
18073   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18074   proto_item_append_text(field_data->item_tag, " TTL: %d", tvb_get_guint8(tvb, offset));
18075   offset += 1;
18076
18077   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_mesh_channel_switch_flag,
18078                                    ett_mesh_chswitch_flag_tree, ieee80211_mesh_chswitch_flag, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18079   offset += 1;
18080
18081   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_reason_code, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18082   offset += 2;
18083
18084   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_precedence_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18085   return tvb_captured_length(tvb);
18086 }
18087
18088 /* Mesh Awake Window Parameters (119) */
18089 static int
18090 ieee80211_tag_mesh_awake_window(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18091 {
18092   int tag_len = tvb_reported_length(tvb);
18093   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18094   int offset = 0;
18095
18096   if (tag_len != 2) {
18097     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
18098         "Tag length %u wrong, must be = 2", tag_len);
18099     return tvb_captured_length(tvb);
18100   }
18101
18102   proto_tree_add_item(tree, hf_ieee80211_mesh_awake_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18103   return tvb_captured_length(tvb);
18104 }
18105
18106 static int
18107 ieee80211_tag_channel_switch_announcement(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18108 {
18109   int tag_len = tvb_reported_length(tvb);
18110   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18111   int offset = 0;
18112   if (tag_len != 4)
18113   {
18114     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
18115     return tvb_captured_length(tvb);
18116   }
18117
18118   add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
18119   return tvb_captured_length(tvb);
18120 }
18121
18122 static int
18123 ieee80211_tag_supported_operating_classes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18124 {
18125   int tag_len = tvb_reported_length(tvb);
18126   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18127   int offset = 0;
18128   proto_item* item = NULL;
18129   guint8 i;
18130   guint8 field_len = 0;
18131   guint8 alt_op_class_field[256];
18132
18133   if (tag_len < 2) {
18134     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 2", tag_len);
18135     return tvb_captured_length(tvb);
18136   } else if (tag_len > 255) {
18137     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, uint8 <= 255", tag_len);
18138     return tvb_captured_length(tvb);
18139   }
18140
18141   proto_tree_add_item(tree, hf_ieee80211_tag_supported_ope_classes_current, tvb, offset++, 1, ENC_NA);
18142
18143   for (i = offset; i < tag_len; i++) {
18144     guint8 op_class =  tvb_get_guint8(tvb, i);
18145     /* Field terminates immediately before OneHundredAndThirty or Zero delimiter */
18146     if (op_class == 130 || op_class == 0) {
18147       break;
18148     }
18149     alt_op_class_field[field_len++] = op_class;
18150   }
18151   if (field_len) {
18152     item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_ope_classes_alternate, tvb, offset, field_len, ENC_NA);
18153   }
18154   for (i = 0; i < field_len; i++) {
18155     proto_item_append_text(item, i == 0 ? ": %d":", %d", alt_op_class_field[i]);
18156   }
18157
18158   /* TODO parse optional Current Operating Class Extension Sequence field */
18159   /* TODO parse optional Operating Class Duple Sequence field */
18160   return tvb_captured_length(tvb);
18161 }
18162
18163 static int
18164 ieee80211_tag_bss_parameter_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18165 {
18166   int tag_len = tvb_reported_length(tvb);
18167   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18168   int offset = 0;
18169   gboolean size;
18170   if (tag_len != 7)
18171   {
18172     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 7", tag_len);
18173     return tvb_captured_length(tvb);
18174   }
18175   size = (tvb_get_guint8(tvb, offset) & 0x02) >> 1;
18176   proto_tree_add_item(tree, hf_ieee80211_tag_move, tvb, offset, 1, ENC_NA);
18177   proto_tree_add_item(tree, hf_ieee80211_tag_size, tvb, offset, 1, ENC_NA);
18178   offset += 1;
18179   proto_tree_add_item(tree, hf_ieee80211_tag_tbtt_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18180   offset += 4;
18181   if(size == TRUE) { /* if size bit is 0, the field is reserved. */
18182     proto_tree_add_item(tree, hf_ieee80211_tag_bi_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18183   }
18184   return tvb_captured_length(tvb);
18185 }
18186
18187 static int
18188 ieee80211_tag_dmg_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18189 {
18190   int tag_len = tvb_reported_length(tvb);
18191   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18192   int offset = 0;
18193   static const int * ieee80211_tag_dmg_cap1[] = {
18194     &hf_ieee80211_tag_reverse_direction,
18195     &hf_ieee80211_tag_hlts,
18196     &hf_ieee80211_tag_tpc,
18197     &hf_ieee80211_tag_spsh,
18198     &hf_ieee80211_tag_rx_antenna,
18199     &hf_ieee80211_tag_fast_link,
18200     &hf_ieee80211_tag_num_sectors,
18201     &hf_ieee80211_tag_rxss_length,
18202     &hf_ieee80211_tag_reciprocity,
18203     &hf_ieee80211_tag_max_ampdu_exp,
18204     NULL
18205   };
18206
18207   static const int * ieee80211_tag_dmg_cap2[] = {
18208     &hf_ieee80211_tag_min_mpdu_spacing,
18209     &hf_ieee80211_tag_ba_flow_control,
18210     &hf_ieee80211_tag_max_sc_rx_mcs,
18211     &hf_ieee80211_tag_max_ofdm_rx_mcs,
18212     &hf_ieee80211_tag_max_sc_tx_mcs,
18213     &hf_ieee80211_tag_max_ofdm_tx_mcs,
18214     NULL
18215   };
18216
18217   static const int * ieee80211_tag_dmg_cap3[] = {
18218     &hf_ieee80211_tag_low_power_supported,
18219     &hf_ieee80211_tag_code_rate,
18220     &hf_ieee80211_tag_dtp,
18221     &hf_ieee80211_tag_appdu_supp,
18222     &hf_ieee80211_tag_heartbeat,
18223     &hf_ieee80211_tag_other_aid,
18224     &hf_ieee80211_tag_pattern_recip,
18225     &hf_ieee80211_tag_heartbeat_elapsed,
18226     &hf_ieee80211_tag_grant_ack_supp,
18227     &hf_ieee80211_tag_RXSSTxRate_supp,
18228     NULL
18229   };
18230
18231   static const int * ieee80211_tag_dmg_cap4[] = {
18232     &hf_ieee80211_tag_pcp_tddti,
18233     &hf_ieee80211_tag_pcp_PSA,
18234     &hf_ieee80211_tag_pcp_handover,
18235     &hf_ieee80211_tag_pcp_max_assoc,
18236     &hf_ieee80211_tag_pcp_power_src,
18237     &hf_ieee80211_tag_pcp_decenter,
18238     &hf_ieee80211_tag_pcp_forwarding,
18239     &hf_ieee80211_tag_pcp_center,
18240     NULL
18241   };
18242
18243   if (tag_len != 17)
18244   {
18245     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 17", tag_len);
18246     return tvb_captured_length(tvb);
18247   }
18248   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_sta_addr, tvb, offset, 6, ENC_NA);
18249   offset += 6;
18250   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_aid, tvb, offset, 1, ENC_NA);
18251   offset += 1;
18252   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_dmg_cap1, ENC_LITTLE_ENDIAN);
18253   offset += 3;
18254   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_dmg_cap2, ENC_LITTLE_ENDIAN);
18255   offset += 3;
18256   proto_tree_add_bitmask_list(tree, tvb, offset, 2, ieee80211_tag_dmg_cap3, ENC_LITTLE_ENDIAN);
18257   offset += 2;
18258   proto_tree_add_bitmask_list(tree, tvb, offset, 2, ieee80211_tag_dmg_cap4, ENC_LITTLE_ENDIAN);
18259   return tvb_captured_length(tvb);
18260 }
18261
18262 static int
18263 ieee80211_tag_dmg_operation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18264 {
18265   int tag_len = tvb_reported_length(tvb);
18266   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18267   int offset = 0;
18268   static const int * ieee80211_tag_dmg_operation_flags[] = {
18269     &hf_ieee80211_tag_pcp_tddti,
18270     &hf_ieee80211_tag_pcp_PSA,
18271     &hf_ieee80211_tag_pcp_handover,
18272     NULL
18273   };
18274
18275   if (tag_len != 10)
18276   {
18277     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 10", tag_len);
18278     return tvb_captured_length(tvb);
18279   }
18280   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_dmg_operation_flags, ENC_LITTLE_ENDIAN);
18281   offset += 2;
18282   proto_tree_add_item(tree, hf_ieee80211_tag_PSRSI, tvb, offset, 1, ENC_NA);
18283   offset += 1;
18284   proto_tree_add_item(tree, hf_ieee80211_tag_min_BHI_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18285   offset += 2;
18286   proto_tree_add_item(tree, hf_ieee80211_tag_brdct_sta_info_dur, tvb, offset, 1, ENC_NA);
18287   offset += 1;
18288   proto_tree_add_item(tree, hf_ieee80211_tag_assoc_resp_confirm_time, tvb, offset, 1, ENC_NA);
18289   offset += 1;
18290   proto_tree_add_item(tree, hf_ieee80211_tag_min_pp_duration, tvb, offset, 1, ENC_NA);
18291   offset += 1;
18292   proto_tree_add_item(tree, hf_ieee80211_tag_SP_idle_timeout, tvb, offset, 1, ENC_NA);
18293   offset += 1;
18294   proto_tree_add_item(tree, hf_ieee80211_tag_max_lost_beacons, tvb, offset, 1, ENC_NA);
18295   return tvb_captured_length(tvb);
18296 }
18297
18298 static int
18299 ieee80211_tag_antenna_section_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18300 {
18301   int tag_len = tvb_reported_length(tvb);
18302   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18303   int offset = 0;
18304   static const int * ieee80211_tag_antenna[] = {
18305     &hf_ieee80211_tag_type,
18306     &hf_ieee80211_tag_tap1,
18307     &hf_ieee80211_tag_state1,
18308     &hf_ieee80211_tag_tap2,
18309     &hf_ieee80211_tag_state2,
18310     NULL
18311   };
18312
18313   if (tag_len != 4)
18314   {
18315     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
18316     return tvb_captured_length(tvb);
18317   }
18318   proto_tree_add_bitmask_list(tree, tvb, offset, 4, ieee80211_tag_antenna, ENC_LITTLE_ENDIAN);
18319   return tvb_captured_length(tvb);
18320 }
18321
18322 static int
18323 ieee80211_tag_extended_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18324 {
18325   int tag_len = tvb_reported_length(tvb);
18326   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18327   int offset = 0;
18328   int i;
18329   gboolean isGrant;
18330   proto_tree * alloc_tree;
18331   if ((tag_len%15) != 0)
18332   {
18333     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be N*15 where 0<=N<=17", tag_len);
18334     return tvb_captured_length(tvb);
18335   }
18336   isGrant = ((field_data->ftype==CTRL_GRANT)||(field_data->ftype==CTRL_GRANT_ACK));
18337   for(i=0; i < tag_len; i+=15) {
18338     alloc_tree = proto_tree_add_subtree_format(tree, tvb, offset, 15, ett_allocation_tree, NULL, "Allocation %d", i/15);
18339     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18340     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18341     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pseudo_static, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18342     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_truncatable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18343     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_extendable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18344     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pcp_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18345     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_lp_sc_used, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18346     offset += 2;
18347     offset += add_ff_beamforming_ctrl(alloc_tree, tvb, pinfo, offset, isGrant);
18348     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_src_aid, tvb, offset, 1, ENC_NA);
18349     offset += 1;
18350     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_dest_aid, tvb, offset, 1, ENC_NA);
18351     offset += 1;
18352     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18353     offset += 4;
18354     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18355     offset += 2;
18356     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_num_blocks, tvb, offset, 1, ENC_NA);
18357     offset += 1;
18358     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18359     offset += 2;
18360   }
18361   return tvb_captured_length(tvb);
18362 }
18363
18364 static int
18365 ieee80211_tag_sta_availability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18366 {
18367   int tag_len = tvb_reported_length(tvb);
18368   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18369   int offset = 0;
18370   int i;
18371   proto_tree * sta_info_tree;
18372   if ((tag_len%2) != 0)
18373   {
18374     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be N*2 where N>=0", tag_len);
18375     return tvb_captured_length(tvb);
18376   }
18377   for(i=0; i < tag_len; i+=2) {
18378     sta_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 2, ett_sta_info, NULL, "STA Info %d", i/2);
18379     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18380     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_cbap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18381     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_pp_avail, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18382     offset += 2;
18383   }
18384   return tvb_captured_length(tvb);
18385 }
18386
18387 static int
18388 ieee80211_tag_next_dmg_ati(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18389 {
18390   int tag_len = tvb_reported_length(tvb);
18391   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18392   int offset = 0;
18393   if (tag_len != 6)
18394   {
18395     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
18396     return tvb_captured_length(tvb);
18397   }
18398   proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18399   offset += 4;
18400   proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18401   return tvb_captured_length(tvb);
18402 }
18403
18404 static int
18405 ieee80211_tag_nextpcp_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18406 {
18407   int tag_len = tvb_reported_length(tvb);
18408   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18409   int offset = 0;
18410   int i;
18411   if (tag_len < 1)
18412   {
18413     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 1", tag_len);
18414     return tvb_captured_length(tvb);
18415   }
18416   proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_token, tvb, offset, 1, ENC_NA);
18417   offset += 1;
18418   for(i=0; i < tag_len-1; i+=1) {
18419     proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_list, tvb, offset, 1, ENC_NA);
18420     offset += 1;
18421   }
18422   return tvb_captured_length(tvb);
18423 }
18424
18425 static int
18426 ieee80211_tag_pcp_handover(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18427 {
18428   int tag_len = tvb_reported_length(tvb);
18429   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18430   int offset = 0;
18431   if (tag_len != 13)
18432   {
18433     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 13", tag_len);
18434     return tvb_captured_length(tvb);
18435   }
18436   proto_tree_add_item(tree, hf_ieee80211_tag_old_bssid, tvb, offset, 6, ENC_NA);
18437   offset += 6;
18438   proto_tree_add_item(tree, hf_ieee80211_tag_new_pcp_addr, tvb, offset, 6, ENC_NA);
18439   offset += 6;
18440   proto_tree_add_item(tree, hf_ieee80211_tag_reamaining_BI, tvb, offset, 1, ENC_NA);
18441   return tvb_captured_length(tvb);
18442 }
18443
18444 static int
18445 ieee80211_tag_beamlink_maintenance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18446 {
18447   int tag_len = tvb_reported_length(tvb);
18448   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18449   int offset = 0;
18450   if (tag_len != 1)
18451   {
18452     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
18453     return tvb_captured_length(tvb);
18454   }
18455   add_ff_beamformed_link(tree, tvb, pinfo, offset);
18456   return tvb_captured_length(tvb);
18457 }
18458
18459 static int
18460 ieee80211_tag_quiet_period_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18461 {
18462   int tag_len = tvb_reported_length(tvb);
18463   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18464   int offset = 0;
18465   if (tag_len != 10)
18466   {
18467     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 10", tag_len);
18468     return tvb_captured_length(tvb);
18469   }
18470   proto_tree_add_item(tree, hf_ieee80211_tag_request_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18471   offset += 2;
18472   proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
18473   offset += 6;
18474   add_ff_sta_address(tree, tvb, pinfo, offset);
18475   return tvb_captured_length(tvb);
18476 }
18477
18478 static int
18479 ieee80211_tag_relay_transfer_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18480 {
18481   int tag_len = tvb_reported_length(tvb);
18482   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18483   int offset = 0;
18484
18485   if (tag_len != 8)
18486   {
18487     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
18488     return tvb_captured_length(tvb);
18489   }
18490   proto_tree_add_item(tree, hf_ieee80211_tag_duplex_relay, tvb, offset, 1, ENC_NA);
18491   proto_tree_add_item(tree, hf_ieee80211_tag_cooperation_relay, tvb, offset, 1, ENC_NA);
18492   proto_tree_add_item(tree, hf_ieee80211_tag_tx_mode, tvb, offset, 1, ENC_NA);
18493   proto_tree_add_item(tree, hf_ieee80211_tag_link_change_interval, tvb, offset+1, 1, ENC_NA);
18494   proto_tree_add_item(tree, hf_ieee80211_tag_data_sensing_time, tvb, offset+2, 1, ENC_NA);
18495   proto_tree_add_item(tree, hf_ieee80211_tag_first_period, tvb, offset+3, 2, ENC_LITTLE_ENDIAN);
18496   proto_tree_add_item(tree, hf_ieee80211_tag_second_period, tvb, offset+5, 2, ENC_LITTLE_ENDIAN);
18497   return tvb_captured_length(tvb);
18498 }
18499
18500 static int
18501 ieee80211_tag_dmg_beam_refinement(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18502 {
18503   int tag_len = tvb_reported_length(tvb);
18504   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18505   int offset = 0;
18506   static const int * ieee80211_dmg_beam_refinement_fields[] = {
18507     &hf_ieee80211_tag_initiator,
18508     &hf_ieee80211_tag_tx_train_res,
18509     &hf_ieee80211_tag_rx_train_res,
18510     &hf_ieee80211_tag_tx_trn_ok,
18511     &hf_ieee80211_tag_txss_fbck_req,
18512     &hf_ieee80211_tag_bs_fbck,
18513     &hf_ieee80211_tag_bs_fbck_antenna_id,
18514     &hf_ieee80211_tag_snr_requested,
18515     &hf_ieee80211_tag_channel_measurement_requested,
18516     &hf_ieee80211_tag_number_of_taps_requested,
18517     &hf_ieee80211_tag_sector_id_order_req,
18518     &hf_ieee80211_tag_snr_present,
18519     &hf_ieee80211_tag_channel_measurement_present,
18520     &hf_ieee80211_tag_tap_delay_present,
18521     &hf_ieee80211_tag_number_of_taps_present,
18522     &hf_ieee80211_tag_number_of_measurement,
18523     &hf_ieee80211_tag_sector_id_order_present,
18524     &hf_ieee80211_tag_number_of_beams,
18525     &hf_ieee80211_tag_mid_extension,
18526     &hf_ieee80211_tag_capability_request,
18527     &hf_ieee80211_tag_beam_refine_reserved,
18528     NULL
18529   };
18530
18531   if (tag_len != 5)
18532   {
18533     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
18534     return tvb_captured_length(tvb);
18535   }
18536
18537   proto_tree_add_bitmask_list(tree, tvb, offset, 5, ieee80211_dmg_beam_refinement_fields, ENC_LITTLE_ENDIAN);
18538   return tvb_captured_length(tvb);
18539 }
18540
18541 static int
18542 ieee80211_tag_wakeup_schedule_ad(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18543 {
18544   int tag_len = tvb_reported_length(tvb);
18545   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18546   int offset = 0;
18547
18548   if (tag_len != 8)
18549   {
18550     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
18551     return tvb_captured_length(tvb);
18552   }
18553   proto_tree_add_item(tree, hf_ieee80211_tag_bi_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18554   offset += 4;
18555   proto_tree_add_item(tree, hf_ieee80211_tag_sleep_cycle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18556   offset += 2;
18557   proto_tree_add_item(tree, hf_ieee80211_tag_num_awake_bis, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18558   return tvb_captured_length(tvb);
18559 }
18560
18561 static int
18562 ieee80211_tag_dmg_tspec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18563 {
18564   int tag_len = tvb_reported_length(tvb);
18565   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18566   int offset = 0;
18567
18568   gboolean isGrant;
18569   int num_constraints;
18570   if (tag_len < 14)
18571   {
18572     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 14", tag_len);
18573     return tvb_captured_length(tvb);
18574   }
18575   static const int * ieee80211_tag_tspec_flags[] = {
18576     &hf_ieee80211_tag_tspec_allocation_id,
18577     &hf_ieee80211_tag_tspec_allocation_type,
18578     &hf_ieee80211_tag_tspec_allocation_format,
18579     &hf_ieee80211_tag_tspec_pseudo_static,
18580     &hf_ieee80211_tag_tspec_truncatable,
18581     &hf_ieee80211_tag_tspec_extendable,
18582     &hf_ieee80211_tag_tspec_lp_sc_used,
18583     &hf_ieee80211_tag_tspec_up,
18584     &hf_ieee80211_tag_tap2,
18585     &hf_ieee80211_tag_tspec_dest_aid,
18586     NULL
18587   };
18588
18589   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_tspec_flags, ENC_LITTLE_ENDIAN);
18590   offset += 3;
18591   isGrant = ((field_data->ftype==CTRL_GRANT)||(field_data->ftype==CTRL_GRANT_ACK));
18592   offset += add_ff_beamforming_ctrl(tree, tvb, pinfo, 2, isGrant);
18593   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18594   offset += 2;
18595   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18596   offset += 2;
18597   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_max_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18598   offset += 2;
18599   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18600   offset += 2;
18601   num_constraints = tvb_get_guint8(tvb, offset);
18602   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_num_of_constraints, tvb, offset, 1, ENC_NA);
18603   offset += 1;
18604   while(num_constraints > 0) {
18605     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18606     offset += 4;
18607     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18608     offset += 2;
18609     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18610     offset += 2;
18611     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_interferer_mac, tvb, offset, 2, ENC_NA);
18612     offset += 6;
18613     num_constraints--;
18614   }
18615   return tvb_captured_length(tvb);
18616 }
18617
18618 static int
18619 ieee80211_tag_channel_measurement_fb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18620 {
18621   int tag_len = tvb_reported_length(tvb);
18622   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18623   int offset = 0;
18624
18625   int num_measurement;
18626   if (tag_len%5 != 0)
18627   {
18628     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be multiple of 5", tag_len);
18629     return tvb_captured_length(tvb);
18630   }
18631   num_measurement = tvb_get_guint8(tvb, offset+1);
18632   offset += 2;
18633   while(num_measurement > 0) {
18634     proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
18635     offset += 1;
18636     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_I, tvb, offset, 1, ENC_NA);
18637     offset += 1;
18638     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_Q, tvb, offset, 1, ENC_NA);
18639     offset += 1;
18640     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_tap_delay, tvb, offset, 1, ENC_NA);
18641     offset += 1;
18642     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_sector_id, tvb, offset, 1, ENC_NA);
18643     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_antenna_id, tvb, offset, 1, ENC_NA);
18644     offset += 1;
18645     num_measurement--;
18646   }
18647   return tvb_captured_length(tvb);
18648 }
18649
18650 static int
18651 ieee80211_tag_awake_window(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18652 {
18653   int tag_len = tvb_reported_length(tvb);
18654   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18655
18656   if (tag_len != 2)
18657   {
18658     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 2", tag_len);
18659   }
18660   else
18661   {
18662     proto_tree_add_item(tree, hf_ieee80211_tag_awake_window, tvb, 0, 2, ENC_LITTLE_ENDIAN);
18663   }
18664   return tvb_captured_length(tvb);
18665 }
18666
18667 static int
18668 ieee80211_tag_addba_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18669 {
18670   int tag_len = tvb_reported_length(tvb);
18671   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18672
18673   if (tag_len != 1)
18674   {
18675     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
18676   }
18677   else
18678   {
18679     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_no_frag, tvb, 0, 1, ENC_NA);
18680     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_he_fragmentation_operation, tvb, 0, 1, ENC_NA);
18681     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_reserved, tvb, 0, 1, ENC_NA);
18682   }
18683   return tvb_captured_length(tvb);
18684 }
18685
18686 static int
18687 ieee80211_tag_multi_band(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18688 {
18689   int tag_len = tvb_reported_length(tvb);
18690   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18691   int offset = 0;
18692   gboolean chiper_present, addr_present;
18693   static const int * ieee80211_tag_multi_band_ctrl[] = {
18694     &hf_ieee80211_tag_multi_band_ctrl_sta_role,
18695     &hf_ieee80211_tag_multi_band_ctrl_addr_present,
18696     &hf_ieee80211_tag_multi_band_ctrl_cipher_present,
18697     NULL
18698   };
18699   static const int * ieee80211_tag_multi_band_conn[] = {
18700     &hf_ieee80211_tag_multi_band_conn_ap,
18701     &hf_ieee80211_tag_multi_band_conn_pcp,
18702     &hf_ieee80211_tag_multi_band_conn_dls,
18703     &hf_ieee80211_tag_multi_band_conn_tdls,
18704     &hf_ieee80211_tag_multi_band_conn_ibss,
18705     NULL
18706   };
18707
18708   if (tag_len < 22)
18709   {
18710     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 22", tag_len);
18711     return tvb_captured_length(tvb);
18712   }
18713   chiper_present = (tvb_get_letohs(tvb, offset) & 0x08) >> 3;
18714   addr_present = (tvb_get_letohs(tvb, offset) & 0x10) >> 4;
18715   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_multi_band_ctrl, ENC_NA);
18716   offset += 1;
18717   offset += add_ff_band_id(tree, tvb, pinfo, 1);
18718   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_oper_class, tvb, offset, 1, ENC_NA);
18719   offset += 1;
18720   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_channel_number, tvb, offset, 1, ENC_NA);
18721   offset += 1;
18722   proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
18723   offset += 6;
18724   offset += add_ff_beacon_interval(tree, tvb, pinfo, 2);
18725   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_tsf_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
18726   offset += 8;
18727
18728   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_multi_band_conn, ENC_NA);
18729   offset += 1;
18730   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_fst_timeout, tvb, offset, 1, ENC_NA);
18731   offset += 1;
18732   if(addr_present)
18733   {
18734     proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_sta_mac, tvb, offset, 6, ENC_NA);
18735     offset += 6;
18736   }
18737   if(chiper_present)
18738   {
18739     proto_item *rsn_pcs_count, *rsn_pcs_item, *rsn_sub_pcs_item;
18740     proto_tree *rsn_pcs_tree, *rsn_sub_pcs_tree;
18741     gint ii;
18742     guint16     pcs_count;
18743     int tag_end = tvb_reported_length(tvb);
18744     rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
18745     pcs_count = tvb_get_letohs(tvb, offset);
18746     offset += 2;
18747
18748     if (offset + (pcs_count * 4) > tag_end)
18749     {
18750         expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
18751         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
18752         pcs_count = (tag_end - offset) / 4;
18753     }
18754
18755     rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
18756     rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
18757     for (ii = 0; ii < pcs_count; ii++)
18758     {
18759       rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
18760       rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
18761       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
18762
18763       /* Check if OUI is 00:0F:AC (ieee80211) */
18764       if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
18765       {
18766         proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
18767         proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
18768       } else {
18769         proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
18770       }
18771       offset += 4;
18772     }
18773   }
18774
18775   return tvb_captured_length(tvb);
18776 }
18777
18778 static int
18779 ieee80211_tag_dmg_link_margin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18780 {
18781   int tag_len = tvb_reported_length(tvb);
18782   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18783   int offset = 0;
18784
18785   if (tag_len != 8)
18786   {
18787     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
18788     return tvb_captured_length(tvb);
18789   }
18790   proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
18791   offset += 1;
18792   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_mcs, tvb, offset, 1, ENC_NA);
18793   offset += 1;
18794   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_link_margin, tvb, offset, 1, ENC_NA);
18795   offset += 1;
18796   proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
18797   offset += 1;
18798   proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
18799   return tvb_captured_length(tvb);
18800 }
18801
18802 static int
18803 ieee80211_tag_dmg_link_adaption_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18804 {
18805   int tag_len = tvb_reported_length(tvb);
18806   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18807   int offset = 0;
18808
18809   if (tag_len != 5)
18810   {
18811     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
18812     return tvb_captured_length(tvb);
18813   }
18814   proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
18815   offset += 1;
18816   proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
18817   return tvb_captured_length(tvb);
18818 }
18819
18820 static int
18821 ieee80211_tag_switching_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18822 {
18823   int tag_len = tvb_reported_length(tvb);
18824   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18825   int offset = 0;
18826   static const int * ieee80211_tag_switching_stream_flags[] = {
18827     &hf_ieee80211_tag_switching_stream_old_tid,
18828     &hf_ieee80211_tag_switching_stream_old_direction,
18829     &hf_ieee80211_tag_switching_stream_new_tid,
18830     &hf_ieee80211_tag_switching_stream_new_direction,
18831     &hf_ieee80211_tag_switching_stream_new_valid_id,
18832     &hf_ieee80211_tag_switching_stream_llt_type,
18833     NULL
18834   };
18835
18836   int param_num;
18837   if (tag_len < 4)
18838   {
18839     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 4", tag_len);
18840     return tvb_captured_length(tvb);
18841   }
18842   offset += add_ff_band_id(tree, tvb, pinfo, 1);
18843   offset += add_ff_band_id(tree, tvb, pinfo, 1);
18844   proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_non_qos, tvb, offset, 1, ENC_NA);
18845   offset += 1;
18846   param_num = tvb_get_letohs(tvb, offset);
18847   proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_param_num, tvb, offset, 1, ENC_NA);
18848   offset += 1;
18849   while(param_num > 0)
18850   {
18851     proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_switching_stream_flags, ENC_NA);
18852     param_num--;
18853     offset += 2;
18854   }
18855   return tvb_captured_length(tvb);
18856 }
18857
18858 static void
18859 ieee_80211_add_tagged_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
18860                                   proto_tree *tree, int tagged_parameters_len, int ftype,
18861                                   association_sanity_check_t *association_sanity_check)
18862 {
18863   int next_len;
18864   beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
18865   while (tagged_parameters_len > 0) {
18866     /* TODO make callers optionally specify the list of valid IE IDs? */
18867     if ((next_len=add_tagged_field (pinfo, tree, tvb, offset, ftype, NULL, 0, association_sanity_check)) == 0)
18868       break;
18869     if (next_len > tagged_parameters_len) {
18870       /* XXX - flag this as an error? */
18871       next_len = tagged_parameters_len;
18872     }
18873     offset                += next_len;
18874     tagged_parameters_len -= next_len;
18875   }
18876 }
18877
18878 static void
18879 ieee_80211_do_association_sanity_check(packet_info *pinfo, association_sanity_check_t *sanity_check)
18880 {
18881   /* Given a [re-]association request frame, consider it in its totality and
18882      add expert information as appropriate */
18883
18884   if (sanity_check->association_has_mobility_domain_element) {
18885     /* This is an FT association, warn about any non-FT AKM suites */
18886     if (sanity_check->has_non_ft_akm_suite) {
18887       expert_add_info_format(pinfo, sanity_check->rsn_first_non_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
18888                              "Non-FT AKM suite is prohibited for FT association request");
18889     }
18890   } else {
18891     /* This is a non-FT association, warn about any FT AKM suites */
18892     if (sanity_check->has_ft_akm_suite) {
18893       expert_add_info_format(pinfo, sanity_check->rsn_first_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
18894                              "FT AKM suite is prohibited for non-FT association request");
18895     }
18896   }
18897 }
18898
18899 /* ************************************************************************* */
18900 /*                     Dissect 802.11 management frame                       */
18901 /* ************************************************************************* */
18902 static void
18903 dissect_ieee80211_mgt(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
18904 {
18905   proto_item *ti;
18906   proto_tree *mgt_tree;
18907   proto_tree *fixed_tree;
18908   proto_tree *tagged_tree;
18909   int         offset = 0;
18910   int         tagged_parameter_tree_len;
18911
18912   association_sanity_check_t association_sanity_check;
18913   memset(&association_sanity_check, 0, sizeof(association_sanity_check));
18914
18915   ieee80211_tvb_invalid = FALSE;
18916
18917   ti = proto_tree_add_item(tree, proto_wlan, tvb, 0, -1, ENC_NA);
18918   mgt_tree = proto_item_add_subtree(ti, ett_80211_mgt);
18919
18920   switch (COMPOSE_FRAME_TYPE(fcf))
18921   {
18922
18923     case MGT_ASSOC_REQ:
18924       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 4);
18925       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
18926       add_ff_listen_ival(fixed_tree, tvb, pinfo, 2);
18927       offset = 4;  /* Size of fixed fields */
18928
18929       tagged_parameter_tree_len =
18930           tvb_reported_length_remaining(tvb, offset);
18931       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
18932                  tagged_parameter_tree_len);
18933       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
18934           tagged_parameter_tree_len, MGT_ASSOC_REQ, &association_sanity_check);
18935       ieee_80211_do_association_sanity_check(pinfo, &association_sanity_check);
18936       break;
18937
18938
18939     case MGT_ASSOC_RESP:
18940       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
18941       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
18942       add_ff_status_code(fixed_tree, tvb, pinfo, 2);
18943       add_ff_assoc_id(fixed_tree, tvb, pinfo, 4);
18944       offset = 6;  /* Size of fixed fields */
18945
18946       tagged_parameter_tree_len =
18947           tvb_reported_length_remaining(tvb, offset);
18948       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
18949                  tagged_parameter_tree_len);
18950       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
18951           tagged_parameter_tree_len, MGT_ASSOC_RESP, NULL);
18952       break;
18953
18954
18955     case MGT_REASSOC_REQ:
18956       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 10);
18957       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
18958       add_ff_listen_ival(fixed_tree, tvb, pinfo, 2);
18959       add_ff_current_ap_addr(fixed_tree, tvb, pinfo, 4);
18960       offset = 10;  /* Size of fixed fields */
18961
18962       tagged_parameter_tree_len =
18963           tvb_reported_length_remaining(tvb, offset);
18964       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
18965                  tagged_parameter_tree_len);
18966       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
18967           tagged_parameter_tree_len, MGT_REASSOC_REQ, &association_sanity_check);
18968       ieee_80211_do_association_sanity_check(pinfo, &association_sanity_check);
18969       break;
18970
18971     case MGT_REASSOC_RESP:
18972       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
18973       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
18974       add_ff_status_code(fixed_tree, tvb, pinfo, 2);
18975       add_ff_assoc_id(fixed_tree, tvb, pinfo, 4);
18976       offset = 6;  /* Size of fixed fields */
18977
18978       tagged_parameter_tree_len =
18979           tvb_reported_length_remaining(tvb, offset);
18980       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
18981                  tagged_parameter_tree_len);
18982       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
18983           tagged_parameter_tree_len, MGT_REASSOC_RESP, NULL);
18984       break;
18985
18986
18987     case MGT_PROBE_REQ:
18988       offset = 0;
18989       tagged_parameter_tree_len =
18990           tvb_reported_length_remaining(tvb, offset);
18991       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
18992                  tagged_parameter_tree_len);
18993       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
18994           tagged_parameter_tree_len, MGT_PROBE_REQ, NULL);
18995       break;
18996
18997     case MGT_PROBE_RESP:
18998     {
18999       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
19000       add_ff_timestamp(fixed_tree, tvb, pinfo, 0);
19001       add_ff_beacon_interval(fixed_tree, tvb, pinfo, 8);
19002       add_ff_cap_info(fixed_tree, tvb, pinfo, 10);
19003       offset = 12;  /* Size of fixed fields */
19004
19005       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
19006       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset, tagged_parameter_tree_len);
19007       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_PROBE_RESP, NULL);
19008       break;
19009     }
19010     case MGT_MEASUREMENT_PILOT:
19011     {
19012       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
19013       offset += add_ff_timestamp(fixed_tree, tvb, pinfo, offset);
19014       offset += add_ff_measurement_pilot_int(fixed_tree, tvb, pinfo, offset);
19015       offset += add_ff_beacon_interval(fixed_tree, tvb, pinfo, offset);
19016       offset += add_ff_cap_info(fixed_tree, tvb, pinfo, offset);
19017       offset += add_ff_country_str(fixed_tree, tvb, pinfo, offset);
19018       offset += add_ff_max_reg_pwr(fixed_tree, tvb, pinfo, offset);
19019       offset += add_ff_max_tx_pwr(fixed_tree, tvb, pinfo, offset);
19020       offset += add_ff_tx_pwr_used(fixed_tree, tvb, pinfo, offset);
19021       offset += add_ff_transceiver_noise_floor(fixed_tree, tvb, pinfo, offset);
19022       /* TODO DS Parameter Set ??? */
19023
19024       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
19025       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset, tagged_parameter_tree_len);
19026       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_MEASUREMENT_PILOT, NULL);
19027       break;
19028     }
19029     case MGT_BEACON:    /* Dissect protocol payload fields  */
19030       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
19031       add_ff_timestamp(fixed_tree, tvb, pinfo, 0);
19032       add_ff_beacon_interval(fixed_tree, tvb, pinfo, 8);
19033       add_ff_cap_info(fixed_tree, tvb, pinfo, 10);
19034       offset = 12;  /* Size of fixed fields */
19035
19036       tagged_parameter_tree_len =
19037           tvb_reported_length_remaining(tvb, offset);
19038       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
19039       tagged_parameter_tree_len);
19040       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
19041       tagged_parameter_tree_len, MGT_BEACON, NULL);
19042       break;
19043
19044     case MGT_ATIM:
19045       break;
19046
19047     case MGT_DISASS:
19048       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 2);
19049       add_ff_reason_code(fixed_tree, tvb, pinfo, 0);
19050       offset = 2; /* Size of fixed fields */
19051       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
19052       if (tagged_parameter_tree_len > 0) {
19053         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
19054                                                 tagged_parameter_tree_len);
19055         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
19056                                          tagged_parameter_tree_len, MGT_DISASS, NULL);
19057       }
19058       break;
19059
19060     case MGT_AUTHENTICATION:
19061       offset = 6;  /* Size of fixed fields */
19062       offset += get_ff_auth_sae_len(tvb);
19063
19064       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, offset);
19065       add_ff_auth_alg(fixed_tree, tvb, pinfo, 0);
19066       add_ff_auth_trans_seq(fixed_tree, tvb, pinfo, 2);
19067       add_ff_status_code(fixed_tree, tvb, pinfo, 4);
19068       add_ff_auth_sae(fixed_tree, tvb);
19069
19070       tagged_parameter_tree_len =
19071         tvb_reported_length_remaining(tvb, offset);
19072       if (tagged_parameter_tree_len > 0)
19073       {
19074         tagged_tree = get_tagged_parameter_tree(mgt_tree,
19075             tvb,
19076             offset,
19077             tagged_parameter_tree_len);
19078         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
19079         tagged_parameter_tree_len, MGT_AUTHENTICATION, NULL);
19080       }
19081       break;
19082
19083     case MGT_DEAUTHENTICATION:
19084       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 2);
19085       add_ff_reason_code(fixed_tree, tvb, pinfo, 0);
19086       offset = 2; /* Size of fixed fields */
19087       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
19088       if (tagged_parameter_tree_len > 0) {
19089         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
19090                                                 tagged_parameter_tree_len);
19091         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
19092                                          tagged_parameter_tree_len, MGT_DEAUTHENTICATION, NULL);
19093       }
19094       break;
19095
19096     case MGT_ACTION:
19097     {
19098       proto_item *lcl_fixed_hdr;
19099       proto_tree *lcl_fixed_tree;
19100       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
19101       offset += add_ff_action(lcl_fixed_tree, tvb, pinfo, 0);
19102
19103       proto_item_set_len(lcl_fixed_hdr, offset);
19104       if (ieee80211_tvb_invalid)
19105         break; /* Buffer not available for further processing */
19106       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
19107       if (tagged_parameter_tree_len > 0)
19108       {
19109         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
19110           tagged_parameter_tree_len);
19111         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
19112           tagged_parameter_tree_len, MGT_ACTION, NULL);
19113       }
19114       break;
19115     }
19116     case MGT_ACTION_NO_ACK:
19117     {
19118       proto_item *lcl_fixed_hdr;
19119       proto_tree *lcl_fixed_tree;
19120       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
19121
19122       offset += add_ff_action(lcl_fixed_tree, tvb, pinfo, 0);
19123
19124       proto_item_set_len(lcl_fixed_hdr, offset);
19125       if (ieee80211_tvb_invalid)
19126         break; /* Buffer not available for further processing */
19127       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
19128       if (tagged_parameter_tree_len > 0)
19129       {
19130         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
19131           tagged_parameter_tree_len);
19132         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
19133           tagged_parameter_tree_len, MGT_ACTION_NO_ACK, NULL);
19134       }
19135       break;
19136     }
19137     case MGT_ARUBA_WLAN:
19138     {
19139       proto_tree *aruba_tree;
19140       guint16 type;
19141       type = tvb_get_ntohs(tvb, offset);
19142
19143       aruba_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, NULL, "Aruba Management");
19144
19145       proto_tree_add_item(aruba_tree, hf_ieee80211_aruba, tvb, offset, 2, ENC_BIG_ENDIAN);
19146       offset += 2;
19147       switch(type){
19148         case 0x0003: /* MTU Size */
19149           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_mtu, tvb, offset, 2, ENC_BIG_ENDIAN);
19150         break;
19151         case 0x0005: /* HeartBeat Sequence */
19152           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_hb_seq, tvb, offset, 8, ENC_BIG_ENDIAN);
19153         break;
19154       }
19155       break;
19156     }
19157   }
19158 }
19159
19160 /*
19161  * Dissect a Block Ack request (which is also used in Trigger frames).
19162  */
19163 static const int *block_ack_control_headers[] = {
19164   &hf_ieee80211_block_ack_control_ack_policy,
19165   &hf_ieee80211_block_ack_control_type,
19166   &hf_ieee80211_block_ack_control_reserved,
19167   &hf_ieee80211_block_ack_control_tid_info,
19168   NULL
19169 };
19170
19171 /*
19172  * These bits are shown in reverse order in the spec.
19173  */
19174 #define BASIC_BLOCK_ACK               0x0
19175 #define EXTENDED_COMPRESSED_BLOCK_ACK 0x1
19176 #define COMPRESSED_BLOCK_ACK          0x2
19177 #define MULTI_TID_BLOCK_ACK           0x3
19178 #define GCR_BLOCK_ACK                 0x6
19179 #define GLK_GCR_BLOCK_ACK             0xA
19180 #define MULTI_STA_BLOCK_ACK           0xB
19181
19182 static const value_string block_ack_type_vals[] = {
19183   { BASIC_BLOCK_ACK,               "Basic BlockAck" },
19184   { EXTENDED_COMPRESSED_BLOCK_ACK, "Extended Compressed BlockAck" },
19185   { COMPRESSED_BLOCK_ACK,          "Compressed BlockAck" },
19186   { MULTI_TID_BLOCK_ACK,           "Multi-TID BlockAck" },
19187   { GCR_BLOCK_ACK,                 "GCR BlockAck" },
19188   { GLK_GCR_BLOCK_ACK,             "GLK-GCR BlockAck" },
19189   { MULTI_STA_BLOCK_ACK,           "Multi-STA BlockAck" },
19190   { 0, NULL }
19191 };
19192
19193 static int
19194 dissect_ieee80211_block_ack_details(tvbuff_t *tvb, packet_info *pinfo _U_,
19195   proto_tree *tree, int offset, gboolean isDMG, gboolean is_req)
19196 {
19197   proto_item     *pi;
19198   guint16         ba_control;
19199   guint8          block_ack_type;
19200   proto_tree     *ba_tree;
19201   guint8          tid_count, frag_num;
19202   guint           i;
19203   proto_tree     *ba_mtid_tree, *ba_mtid_sub_tree;
19204   guint16         ssn;
19205   guint64         bmap;
19206   int             f;
19207   proto_item     *ba_bitmap_item;
19208   proto_tree     *ba_bitmap_tree;
19209
19210   ba_control = tvb_get_letohs(tvb, offset);
19211   block_ack_type = (ba_control & 0x001E) >> 1;
19212   ba_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_block_ack,
19213                         &pi, is_req ? "%s Request" : "%s Response",
19214                         val_to_str(block_ack_type, block_ack_type_vals,
19215                                 "Reserved (%d)"));
19216   proto_tree_add_bitmask_with_flags(ba_tree, tvb, offset,
19217                         hf_ieee80211_block_ack_control,
19218                         ett_block_ack_request_control,
19219                         block_ack_control_headers,
19220                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19221   offset += 2;
19222
19223   switch (block_ack_type) {
19224   case BASIC_BLOCK_ACK:
19225     if (isDMG == TRUE) {
19226       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
19227                         "DMG STAs shouldn't transmit BlockAckReq frames "
19228                         "with Basic BlockAckReqs");
19229     }
19230
19231     /* Both request and response have an SSC */
19232     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
19233
19234     if (!is_req) {
19235       proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_bitmap, tvb, offset,
19236                         128, ENC_NA);
19237       offset += 128;
19238     }
19239     break;
19240
19241   case COMPRESSED_BLOCK_ACK:
19242     /*
19243      * FIXME: For 802.11ax, the block ack bitmap can be 8 or 32 bytes
19244      * depending on the values of the fragment number subfield in the
19245      * SSC! All values other that 0 and 2 in bits B1 & B2 are reserved.
19246      */
19247     frag_num = tvb_get_guint8(tvb, offset) & 0x0F;
19248     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
19249
19250     if (!is_req) {
19251       ssn = tvb_get_letohs(tvb, offset);
19252       ssn >>= 4;
19253
19254       if ((frag_num & 0x06) == 0) {
19255         bmap = tvb_get_letoh64(tvb, offset);
19256         ba_bitmap_item = proto_tree_add_item(ba_tree,
19257                           hf_ieee80211_block_ack_bitmap,
19258                           tvb, offset, 8, ENC_NA);
19259         ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item,
19260                           ett_block_ack_bitmap);
19261         for (f = 0; f < 64; f++) {
19262           if (bmap & (G_GUINT64_CONSTANT(1) << f))
19263             continue;
19264           proto_tree_add_uint_format_value(ba_bitmap_tree,
19265                           hf_ieee80211_block_ack_bitmap_missing_frame,
19266                           tvb, offset + (f/8), 1, ssn + f, "%u",
19267                           (ssn + f) & 0x0fff);
19268         }
19269         offset += 8;
19270       } else if ((frag_num & 0x06) == 2) {
19271
19272         proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_bitmap, tvb,
19273                         offset, 32, ENC_NA);
19274         offset += 32;
19275       } else {
19276         /* Reserved ... */
19277       }
19278     }
19279     break;
19280
19281   case EXTENDED_COMPRESSED_BLOCK_ACK:
19282     if (isDMG == FALSE) {
19283       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
19284                         "Non-DMG STAs shouldn't transmit BlockAckReq "
19285                         "frames with Extended Compressed BlockAckReqs");
19286     }
19287
19288     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
19289
19290     if (!is_req) {
19291       ssn = tvb_get_letohs(tvb, offset);
19292       ssn >>= 4;
19293
19294       bmap = tvb_get_letoh64(tvb, offset);
19295       ba_bitmap_item = proto_tree_add_item(ba_tree,
19296                         hf_ieee80211_block_ack_bitmap,
19297                         tvb, offset, 8, ENC_NA);
19298       ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item,
19299                         ett_block_ack_bitmap);
19300       for (f = 0; f < 64; f++) {
19301         if (bmap & (G_GUINT64_CONSTANT(1) << f))
19302           continue;
19303         proto_tree_add_uint(ba_bitmap_tree,
19304                         hf_ieee80211_block_ack_bitmap_missing_frame,
19305                         tvb, offset + (f/8), 1, ssn + f);
19306       }
19307       offset += 8;
19308       proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_RBUFCAP, tvb, offset,
19309                         1, ENC_LITTLE_ENDIAN);
19310       offset += 1;
19311     }
19312     break;
19313
19314   case MULTI_TID_BLOCK_ACK:
19315
19316     if (isDMG == TRUE) {
19317       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
19318                         "DMG STAs shouldn't transmit BlockAckReq frames "
19319                         "with Multi-TID BlockAckReqs");
19320     }
19321
19322     tid_count = ((ba_control & 0xF000) >> 12) + 1;
19323     if (is_req) {
19324       ba_mtid_tree = proto_tree_add_subtree(ba_tree, tvb, offset, tid_count*4,
19325                 ett_block_ack, NULL, "TID List");
19326       for (i = 0; i < tid_count; i++) {
19327         guint8 tid = tvb_get_guint8(tvb, offset) & 0x0F;
19328         ba_mtid_sub_tree = proto_tree_add_subtree_format(ba_mtid_tree, tvb,
19329                                 offset, 4, ett_block_ack_tid, NULL,
19330                                 "TID %u details", tid);
19331
19332         proto_tree_add_item(ba_mtid_sub_tree,
19333                 hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2,
19334                 ENC_LITTLE_ENDIAN);
19335         proto_tree_add_item(ba_mtid_sub_tree,
19336                 hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2,
19337                 ENC_LITTLE_ENDIAN);
19338         offset += 2;
19339
19340         offset += add_ff_block_ack_ssc(ba_mtid_sub_tree, tvb, pinfo, offset);
19341       }
19342     } else {
19343       ba_mtid_tree = proto_tree_add_subtree(ba_tree, tvb, offset, tid_count*4,
19344                 ett_block_ack, NULL, "TID List");
19345       for (i = 0; i < tid_count; i++) {
19346         guint8 tid = tvb_get_guint8(tvb, offset) & 0x0F;
19347         ba_mtid_sub_tree = proto_tree_add_subtree_format(ba_mtid_tree, tvb,
19348                                 offset, 4, ett_block_ack_tid, NULL,
19349                                 "TID %u details", tid);
19350
19351         proto_tree_add_item(ba_mtid_sub_tree,
19352                         hf_ieee80211_block_ack_multi_tid_reserved,
19353                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
19354         proto_tree_add_item(ba_mtid_sub_tree,
19355                         hf_ieee80211_block_ack_multi_tid_value, tvb,
19356                         offset, 2, ENC_LITTLE_ENDIAN);
19357         offset += 2;
19358
19359         offset += add_ff_block_ack_ssc(ba_mtid_sub_tree, tvb, pinfo, offset);
19360         proto_tree_add_item(ba_mtid_sub_tree,
19361                         hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
19362         offset += 8;
19363       }
19364     }
19365     break;
19366
19367   case GCR_BLOCK_ACK:
19368     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
19369
19370     proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_gcr_addr, tvb,
19371                         offset, 6, ENC_NA);
19372     offset += 6;
19373
19374     if (!is_req) {
19375       proto_tree_add_item(ba_tree,
19376                         hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
19377       offset += 8;
19378     }
19379     break;
19380   }
19381   proto_item_set_len(pi, offset);
19382
19383   return offset;
19384 }
19385
19386 static void
19387 dissect_ieee80211_block_ack(tvbuff_t *tvb, packet_info *pinfo _U_,
19388   proto_tree *tree, int offset, gboolean isDMG, gboolean is_req)
19389 {
19390   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
19391   proto_item     *hidden_item;
19392
19393   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
19394   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved, tvb,
19395                         offset, 6, ether_name);
19396   PROTO_ITEM_SET_HIDDEN(hidden_item);
19397   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
19398                         ENC_NA);
19399   PROTO_ITEM_SET_HIDDEN(hidden_item);
19400   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
19401                         offset, 6, ether_name);
19402   PROTO_ITEM_SET_HIDDEN(hidden_item);
19403   offset += 6;
19404
19405   dissect_ieee80211_block_ack_details(tvb, pinfo, tree, offset, isDMG, is_req);
19406 }
19407
19408 /*
19409  * Dissect an 802.11ax HE Trigger frame and return the actual len including
19410  * padding!
19411  */
19412
19413 #define TRIGGER_TYPE_BASIC      0
19414 #define TRIGGER_TYPE_BRP        1
19415 #define TRIGGER_TYPE_MU_BAR     2
19416 #define TRIGGER_TYPE_MU_RTS     3
19417 #define TRIGGER_TYPE_BSRP       4
19418 #define TRIGGER_TYPE_GCR_MU_BAR 5
19419 #define TRIGGER_TYPE_BQRP       6
19420 #define TRIGGER_TYPE_NFRP       7
19421
19422 static const value_string trigger_type_vals[] = {
19423   { 0, "Basic" },
19424   { 1, "Beamforming Report Poll (BRP)" },
19425   { 2, "MU-BAR" },
19426   { 3, "MU-RTS" },
19427   { 4, "Buffer Status Report Poll (BSRP)" },
19428   { 5, "GCR MU-BAR" },
19429   { 6, "Bandwidth Query Report Poll (BQRP)" },
19430   { 7, "NDP Feedback Report Poll (NFRP)" },
19431   { 0, NULL }
19432 };
19433
19434 static const value_string bw_subfield_vals[] = {
19435   { 0, "20 MHz" },
19436   { 1, "40 MHz" },
19437   { 2, "80 MHz" },
19438   { 3, "80+80 MHz or 160 MHz" },
19439   { 0, NULL }
19440 };
19441
19442 static const value_string gi_and_ltf_type_subfield_vals[] = {
19443   { 0, "1x LTF + 1.6 us GI" },
19444   { 1, "2x LTF + 1.6 us GI" },
19445   { 2, "4x LTF + 3.2 us GI" },
19446   { 3, "Reserved" },
19447   { 0, NULL }
19448 };
19449
19450 static const true_false_string mu_mimo_ltf_mode_tfs = {
19451   "HE masked HE LTF sequence mode",
19452   "HE single stream pilot HE LTF mode"
19453 };
19454
19455 static const int *he_trig_frm_bar_ctrl_fields[] = {
19456   &hf_ieee80211_he_trigger_bar_ctrl_ba_ack_policy,
19457   &hf_ieee80211_he_trigger_bar_ctrl_ba_type,
19458   &hf_ieee80211_he_trigger_bar_ctrl_reserved,
19459   &hf_ieee80211_he_trigger_bar_ctrl_tid_info,
19460   NULL
19461 };
19462
19463 static const int *he_trig_frm_bar_info_fields[] = {
19464   &hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl,
19465   NULL
19466 };
19467
19468 static void
19469 add_gcr_mu_bar_trigger_frame_common_info(proto_tree *tree, tvbuff_t *tvb,
19470   int offset)
19471 {
19472
19473   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
19474                         hf_ieee80211_he_trigger_bar_ctrl,
19475                         ett_he_trigger_bar_ctrl,
19476                         he_trig_frm_bar_ctrl_fields,
19477                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19478   offset += 2;
19479
19480   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
19481                         hf_ieee80211_he_trigger_bar_info,
19482                         ett_he_trigger_bar_info,
19483                         he_trig_frm_bar_info_fields,
19484                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19485 }
19486
19487 static const int *common_info_headers[] = {
19488   &hf_ieee80211_he_trigger_type,
19489   &hf_ieee80211_he_trigger_length,
19490   &hf_ieee80211_he_trigger_cascade_indication,
19491   &hf_ieee80211_he_trigger_cs_required,
19492   &hf_ieee80211_he_trigger_bw,
19493   &hf_ieee80211_he_trigger_gi_and_ltf_type,
19494   &hf_ieee80211_he_trigger_mu_mimo_ltf_mode,
19495   &hf_ieee80211_he_trigger_num_he_ltf_syms_etc,
19496   &hf_ieee80211_he_trigger_stbc,
19497   &hf_ieee80211_he_trigger_ldpc_extra_sym_seg,
19498   &hf_ieee80211_he_trigger_ap_tx_power,
19499   &hf_ieee80211_he_trigger_packet_extension,
19500   &hf_ieee80211_he_trigger_spatial_reuse,
19501   &hf_ieee80211_he_trigger_doppler,
19502   &hf_ieee80211_he_trigger_he_sig_a_reserved,
19503   &hf_ieee80211_he_trigger_reserved,
19504   NULL
19505 };
19506
19507 static int
19508 add_he_trigger_common_info(proto_tree *tree, tvbuff_t *tvb, int offset,
19509   packet_info *pinfo _U_, guint8 trigger_type, int *frame_len)
19510 {
19511   proto_item     *pi = NULL;
19512   proto_tree     *common_info = NULL;
19513   int            length = 0;
19514   int            start_offset = offset;
19515
19516   common_info = proto_tree_add_subtree(tree, tvb, offset, -1,
19517                         ett_he_trigger_common_info, &pi, "Common Info");
19518
19519   proto_tree_add_bitmask_with_flags(common_info, tvb, offset,
19520                         hf_ieee80211_he_trigger_common_info,
19521                         ett_he_trigger_base_common_info,
19522                         common_info_headers,
19523                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19524   offset += 8;
19525   length += 8;
19526
19527   /*
19528    * Handle the trigger dependent common info
19529    */
19530   switch (trigger_type) {
19531     case TRIGGER_TYPE_GCR_MU_BAR: /* Actually two uint16 fields */
19532       add_gcr_mu_bar_trigger_frame_common_info(common_info, tvb, offset);
19533       offset += 4;
19534       length += 4;
19535       break;
19536     default: /* No other type has a trigger dependent common info subfield */
19537       break;
19538   }
19539   proto_item_set_len(pi, offset - start_offset);
19540
19541   *frame_len += length;
19542   return length;
19543 }
19544
19545 static const true_false_string he_trigger_coding_type_tfs = {
19546   "LDPC",
19547   "BCC"
19548 };
19549
19550 static const value_string preferred_ac_vals[] = {
19551   { 0, "AC_BK" },
19552   { 1, "AC_BE" },
19553   { 2, "AC_VI" },
19554   { 3, "AC_VO" },
19555   { 0, NULL }
19556 };
19557
19558 static const int *basic_trigger_dependent_user_headers[] = {
19559   &hf_ieee80211_he_trigger_mpdu_mu_spacing,
19560   &hf_ieee80211_he_trigger_tid_aggregation_limit,
19561   &hf_ieee80211_he_trigger_dependent_reserved1,
19562   &hf_ieee80211_he_trigger_preferred_ac,
19563   NULL
19564 };
19565
19566 static void
19567 add_basic_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
19568   int offset)
19569 {
19570   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
19571                         hf_ieee80211_he_trigger_dep_basic_user_info,
19572                         ett_he_trigger_dep_basic_user_info,
19573                         basic_trigger_dependent_user_headers,
19574                         ENC_NA, BMT_NO_APPEND);
19575 }
19576
19577 static void
19578 add_brp_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
19579   int offset)
19580 {
19581   proto_tree_add_item(tree, hf_ieee80211_he_trigger_feedback_seg_retrans_bm,
19582                         tvb, offset, 1, ENC_NA);
19583 }
19584
19585 static int
19586 add_mu_bar_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
19587   int offset, packet_info *pinfo, int *frame_len)
19588 {
19589   int start_offset = offset;
19590
19591   /*
19592    * It's a request and not DMG, I think. Also, it is only supposed to be
19593    * a compressed block ack or a multi-tid block ack request.
19594    */
19595   offset = dissect_ieee80211_block_ack_details(tvb, pinfo, tree, offset,
19596                         FALSE, TRUE);
19597
19598   *frame_len += offset - start_offset;
19599
19600   return offset;
19601 }
19602
19603
19604 static const int *nfrp_trigger_dependent_user_headers[] = {
19605   &hf_ieee80211_he_trigger_starting_aid,
19606   &hf_ieee80211_he_trigger_dependent_reserved2,
19607   &hf_ieee80211_he_trigger_feedback_type,
19608   &hf_ieee80211_he_trigger_dependent_reserved3,
19609   &hf_ieee80211_he_trigger_nfrp_target_rssi,
19610   &hf_ieee80211_he_trigger_multiplexing_flag,
19611   NULL
19612 };
19613
19614 static void
19615 add_nfrp_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
19616   int offset)
19617 {
19618   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
19619                         hf_ieee80211_he_trigger_dep_nfrp_user_info,
19620                         ett_he_trigger_dep_nfrp_user_info,
19621                         nfrp_trigger_dependent_user_headers,
19622                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19623 }
19624
19625 /*
19626  * Print the target RSSI field as per the spec.
19627  *  0->90 map to -110 to -20 dBm.
19628  *  127 maps to Max ransmit power for assigned MCS
19629  *  rest are reserved.
19630  */
19631 static void
19632 target_rssi_base_custom(gchar *result, guint32 target_rssi)
19633 {
19634   if (target_rssi <= 90) {
19635     g_snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -110 + target_rssi);
19636   } else if (target_rssi == 127) {
19637     g_snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power");
19638   } else {
19639     g_snprintf(result, ITEM_LABEL_LENGTH, "Reserved");
19640   }
19641 }
19642
19643 static const int *user_info_headers[] = {
19644   &hf_ieee80211_he_trigger_aid12,
19645   &hf_ieee80211_he_trigger_ru_allocation,
19646   &hf_ieee80211_he_trigger_coding_type,
19647   &hf_ieee80211_he_trigger_mcs,
19648   &hf_ieee80211_he_trigger_dcm,
19649   &hf_ieee80211_he_trigger_ss_allocation,
19650   &hf_ieee80211_he_trigger_target_rssi,
19651   &hf_ieee80211_he_trigger_user_reserved,
19652   NULL
19653 };
19654
19655 static int
19656 add_he_trigger_user_info(proto_tree *tree, tvbuff_t *tvb, int offset,
19657   packet_info *pinfo, guint8 trigger_type, int *frame_len)
19658 {
19659   proto_item     *pi = NULL;
19660   proto_tree     *user_info = NULL;
19661   int            length = 0;
19662   int            start_offset = offset;
19663   guint16         aid12_subfield = 0;
19664
19665   /*
19666    * If the AID12 subfield has the value 4095 it indicates the start of
19667    * the padding field.
19668    */
19669   user_info = proto_tree_add_subtree(tree, tvb, offset, -1,
19670                         ett_he_trigger_user_info, &pi, "User Info");
19671   aid12_subfield = tvb_get_letohs(tvb, offset) >> 4;
19672
19673   while (aid12_subfield != 4095) {
19674     proto_tree_add_bitmask_with_flags(user_info, tvb, offset,
19675                         hf_ieee80211_he_trigger_user_info,
19676                         ett_he_trigger_base_user_info,
19677                         user_info_headers,
19678                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19679     offset += 5;
19680     length += 5;
19681
19682     /*
19683      * Handle the trigger dependent user info
19684      */
19685     switch (trigger_type) {
19686       case TRIGGER_TYPE_BASIC:
19687         add_basic_trigger_dependent_user_info(user_info, tvb, offset);
19688         offset++;
19689         length++;
19690         break;
19691       case TRIGGER_TYPE_BRP:
19692         add_brp_trigger_dependent_user_info(user_info, tvb, offset);
19693         offset++;
19694         length++;
19695         break;
19696       case TRIGGER_TYPE_MU_BAR:
19697         /* This is variable length so we need it to update the length */
19698         offset += add_mu_bar_trigger_dependent_user_info(user_info, tvb,
19699                                 offset, pinfo, &length);
19700         break;
19701       case TRIGGER_TYPE_NFRP:
19702         add_nfrp_trigger_dependent_user_info(user_info, tvb, offset);
19703         offset += 5;
19704         length += 5;
19705         break;
19706       default:
19707         break;
19708     }
19709
19710     aid12_subfield = tvb_get_letohs(tvb, offset) >> 4;
19711   }
19712
19713   proto_item_set_len(pi, offset - start_offset);
19714
19715   *frame_len += length;
19716   return length;
19717 }
19718
19719 static int
19720 dissect_ieee80211_he_trigger(tvbuff_t *tvb, packet_info *pinfo _U_,
19721   proto_tree *tree, int offset)
19722 {
19723   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
19724   proto_item      *hidden_item;
19725   guint8          trigger_type = 0;
19726   int             length = 0;
19727
19728   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
19729   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved,
19730                         tvb, offset, 6, ether_name);
19731   PROTO_ITEM_SET_HIDDEN(hidden_item);
19732   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
19733                         ENC_NA);
19734   PROTO_ITEM_SET_HIDDEN(hidden_item);
19735   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
19736                         offset, 6, ether_name);
19737   PROTO_ITEM_SET_HIDDEN(hidden_item);
19738
19739   offset += 6;
19740   length += 6;
19741
19742   trigger_type = tvb_get_guint8(tvb, offset) & 0x0F;
19743   col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
19744                 val_to_str(trigger_type, trigger_type_vals, "Reserved"));
19745   /*
19746    * Deal with the common Info and then any user info after that.
19747    */
19748   offset += add_he_trigger_common_info(tree, tvb, offset, pinfo,
19749                         trigger_type, &length);
19750
19751   /*
19752    * Now the User Info field.
19753    */
19754   /*offset +=*/ add_he_trigger_user_info(tree, tvb, offset, pinfo,
19755                         trigger_type, &length);
19756
19757   /*
19758    *  Padding should commence here ... TODO, deal with it.
19759    */
19760
19761   return length;
19762 }
19763
19764 /*
19765  * Dissect a VHT or an HE NDP accouncement frame. They differ past
19766  * the sounding dialog token with a bit in the SDT indicating VHT vs HE.
19767  */
19768 #define NDP_ANNC_VHT_HE 0x02
19769
19770 static const true_false_string he_ndp_annc_he_subfield_vals = {
19771   "HE NDP Announcement frame",
19772   "VHT NDP Anncouncement frame"
19773 };
19774
19775 static const int *vht_ndp_headers[] = {
19776   &hf_ieee80211_vht_ndp_annc_token_number,
19777   &hf_ieee80211_vht_ndp_annc_he_subfield,
19778   &hf_ieee80211_vht_ndp_annc_token_reserved,
19779   NULL
19780 };
19781
19782 static int
19783 dissect_ieee80211_vht_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
19784   proto_tree *tree, int offset, gboolean has_fcs)
19785 {
19786   guint16          sta_info;
19787   guint8           len_fcs = 0;
19788   proto_tree      *sta_info_tree;
19789   proto_item      *sta_info_item;
19790
19791   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
19792                         hf_ieee80211_vht_ndp_annc_token, ett_vht_ndp_annc,
19793                         vht_ndp_headers, ENC_NA, BMT_NO_APPEND);
19794   offset++;
19795
19796   if (has_fcs){
19797     len_fcs = 4;
19798   }
19799
19800   while (tvb_reported_length_remaining(tvb, offset) > len_fcs) {
19801     sta_info_item = proto_tree_add_item(tree, hf_ieee80211_vht_ndp_annc_sta_info,
19802                                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
19803     sta_info_tree = proto_item_add_subtree(sta_info_item, ett_vht_ndp_annc_sta_info_tree);
19804     proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_aid12,
19805                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
19806     proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
19807                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
19808
19809     sta_info = tvb_get_letohs(tvb, offset);
19810
19811     if (sta_info & 0x1000)
19812        proto_tree_add_uint(sta_info_tree,
19813                            hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
19814                            tvb, offset, 2, sta_info);
19815     else
19816        proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_reserved,
19817                            tvb, offset, 2, ENC_LITTLE_ENDIAN);
19818     offset += 2;
19819   }
19820
19821   return offset;
19822 }
19823
19824 /*
19825  * Format the partial BW as two 7 bit fields.
19826  */
19827 static void
19828 partial_bw_info_base_custom(gchar *result, guint32 partial_bw)
19829 {
19830     g_snprintf(result, ITEM_LABEL_LENGTH,
19831                 "RU Start Index:0x%0x, RU End Index:0x%0x",
19832                 partial_bw >> 7, partial_bw & 0x7F);
19833 }
19834
19835 static const int *he_ndp_headers[] = {
19836   &hf_he_ndp_sounding_dialog_token_number,
19837   &hf_he_ndp_annc_he_subfield,
19838   &hf_he_ndp_annc_reserved,
19839   NULL
19840 };
19841
19842 static const int *he_ndp_sta_headers[] = {
19843   &hf_he_ndp_annc_aid11,
19844   &hf_he_ndp_annc_partial_bw_info,
19845   &hf_he_ndp_annc_feedback_type_and_ng,
19846   &hf_he_ndp_annc_disambiguation,
19847   &hf_he_ndp_annc_codebook_size,
19848   &hf_he_ndp_annc_nc,
19849   NULL
19850 };
19851
19852 static int
19853 dissect_ieee80211_he_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
19854   proto_tree *tree, int offset, gboolean has_fcs)
19855 {
19856   guint8           len_fcs = 0;
19857   proto_tree      *sta_list;
19858   proto_item      *pi;
19859   int              saved_offset;
19860   int              sta_index = 0;
19861
19862   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
19863                         hf_ieee80211_he_ndp_annc_token, ett_he_ndp_annc,
19864                         he_ndp_headers, ENC_NA, BMT_NO_APPEND);
19865   offset++;
19866
19867   if (has_fcs){
19868     len_fcs = 4;
19869   }
19870
19871   saved_offset = offset;
19872   sta_list = proto_tree_add_subtree(tree, tvb, offset, -1,
19873                         ett_he_ndp_annc_sta_list, &pi, "STA list");
19874
19875   while (tvb_reported_length_remaining(tvb, offset) > len_fcs) {
19876     proto_tree *sta_item;
19877
19878     sta_item = proto_tree_add_subtree_format(sta_list, tvb, offset, 4,
19879                         ett_he_ndp_annc_sta_item, NULL, "STA %d", sta_index++);
19880     proto_tree_add_bitmask_with_flags(sta_item, tvb, offset,
19881                         hf_ieee80211_he_ndp_annc_sta, ett_he_ndp_annc_sta_info,
19882                         he_ndp_sta_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19883
19884     offset += 4;
19885   }
19886
19887   proto_item_set_len(pi, offset - saved_offset);
19888   return offset;
19889 }
19890
19891 static int
19892 dissect_ieee80211_vht_he_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
19893   proto_tree *tree, int offset, gboolean has_fcs)
19894 {
19895   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
19896   proto_item      *hidden_item;
19897   guint8           dialog_token;
19898
19899   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
19900   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved, tvb,
19901                         offset, 6, ether_name);
19902   PROTO_ITEM_SET_HIDDEN(hidden_item);
19903   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
19904                         ENC_NA);
19905   PROTO_ITEM_SET_HIDDEN(hidden_item);
19906   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
19907                         offset, 6, ether_name);
19908   PROTO_ITEM_SET_HIDDEN(hidden_item);
19909   offset += 6;
19910
19911   dialog_token = tvb_get_guint8(tvb, offset);
19912
19913   /*
19914    * Is it VHT or HE?
19915    */
19916   if (dialog_token & NDP_ANNC_VHT_HE) {
19917     return dissect_ieee80211_he_ndp_annc(tvb, pinfo, tree, offset, has_fcs);
19918   } else {
19919     return dissect_ieee80211_vht_ndp_annc(tvb, pinfo, tree, offset, has_fcs);
19920   }
19921 }
19922
19923 static void
19924 set_src_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
19925 {
19926   address      ether_addr;
19927
19928   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
19929
19930   col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
19931         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
19932 }
19933
19934 static void
19935 set_dst_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
19936 {
19937   address      ether_addr;
19938
19939   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
19940
19941   col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
19942         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
19943 }
19944
19945 static guint32
19946 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
19947 {
19948   guint32 c_crc;
19949
19950   c_crc = crc32_ccitt_tvb(tvb, hdr_len);
19951   c_crc = crc32_ccitt_tvb_offset_seed(tvb, hdr_size, len, ~c_crc);
19952
19953   return (c_crc);
19954 }
19955
19956 typedef enum {
19957     ENCAP_802_2,
19958     ENCAP_IPX,
19959     ENCAP_ETHERNET
19960 } encap_t;
19961
19962 /* ************************************************************************* */
19963 /*                          Dissect 802.11 frame                             */
19964 /* ************************************************************************* */
19965 /*
19966  * The 802.11n specification makes some fairly significant changes to the
19967  * layout of the MAC header.  The first two bits of the MAC header are the
19968  * protocol version.  You'd think that the 802.11 committee would have
19969  * bumped the version to indicate a different MAC layout, but NOOOO -- we
19970  * have to go digging for bits in various locations instead.
19971  */
19972 static int
19973 dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
19974                           proto_tree *tree, guint32 option_flags,
19975                           struct ieee_802_11_phdr *phdr)
19976 {
19977   guint16          fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
19978   guint16          cw_fcf;
19979   guint16          seq_control;
19980   guint32          seq_number, frag_number;
19981   gboolean         more_frags;
19982   proto_item      *ti          = NULL;
19983   proto_item      *cw_item     = NULL;
19984   proto_item      *hidden_item;
19985   proto_tree      *cw_tree     = NULL;
19986   guint16          hdr_len, ohdr_len;
19987   guint16          htc_len     = 0;
19988   gboolean         has_fcs;
19989   gint             len, reported_len, ivlen;
19990   gint             sta_addr_offset = 0;
19991   const gchar     *station_name;
19992   gboolean         is_amsdu    = 0;
19993   gboolean         save_fragmented;
19994   guint32          addr_type;
19995   guint8           octet1, octet2;
19996   char             out_buff[SHORT_STR];
19997   gint             is_iv_bad;
19998   guchar           iv_buff[4];
19999   const char      *addr1_str   = "RA";
20000   guint            offset;
20001   const gchar     *fts_str;
20002   gchar            flag_str[]  = "opmPRMFTC";
20003   gint             ii;
20004   guint16          qosoff      = 0;
20005   guint16          qos_control = 0;
20006   gint             meshctl_len = 0;
20007   guint8           mesh_flags;
20008   guint16          meshoff     = 0;
20009   static wlan_hdr_t whdrs[4];
20010   gboolean         retransmitted;
20011   gboolean         isDMG = (phdr->has_frequency ?
20012                                 IS_80211AD(phdr->frequency) :
20013                                 FALSE);
20014
20015   encap_t     encap_type;
20016   proto_tree *hdr_tree = NULL;
20017   tvbuff_t   *next_tvb = NULL;
20018   wlan_hdr_t *whdr;
20019
20020   DOT11DECRYPT_KEY_ITEM  used_key;
20021
20022   p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY, GINT_TO_POINTER(isDMG));
20023
20024   whdr= &whdrs[0];
20025
20026   col_set_str(pinfo->cinfo, COL_PROTOCOL, "802.11");
20027   col_clear(pinfo->cinfo, COL_INFO);
20028
20029   fcf = FETCH_FCF(0);
20030   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
20031   whdr->type = frame_type_subtype;
20032   if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
20033     ctrl_fcf = FETCH_FCF(10);
20034   else
20035     ctrl_fcf = 0;
20036
20037   fts_str = val_to_str_ext_const(frame_type_subtype, &frame_type_subtype_vals_ext,
20038                                  "Unrecognized (Reserved frame)");
20039   col_set_str(pinfo->cinfo, COL_INFO, fts_str);
20040
20041
20042 # define FROM_TO_DS 3
20043   flags = FCF_FLAGS(fcf);
20044   more_frags = HAVE_FRAGMENTS(flags);
20045
20046   for (ii = 0; ii < 8; ii++) {
20047     if (! (flags & 0x80 >> ii)) {
20048       flag_str[ii] = '.';
20049     }
20050   }
20051
20052   switch (FCF_FRAME_TYPE (fcf)) {
20053
20054   case MGT_FRAME:
20055     hdr_len = MGT_FRAME_HDR_LEN;
20056     if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
20057       /*
20058        * Management frames with the Order bit set have an HT Control field;
20059        * see 8.2.4.1.10 "Order field".  If they're not HT frames, they should
20060        * never have the Order bit set.
20061        */
20062       hdr_len += 4;
20063       htc_len = 4;
20064     }
20065     break;
20066
20067   case CONTROL_FRAME:
20068     if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
20069       hdr_len = 6;
20070       cw_fcf = ctrl_fcf;
20071     } else {
20072       hdr_len = 0;
20073       cw_fcf = fcf;
20074     }
20075     switch (COMPOSE_FRAME_TYPE (cw_fcf)) {
20076
20077     case CTRL_TRIGGER:
20078       /*
20079        * This is a variable length frame ... we set the real length below
20080        * and since the common info is variable, just set the hdr len to
20081        * the fixed portion, 16. There can also be one or more user-info
20082        * sections, followed by padding.
20083        */
20084       hdr_len = 16;
20085       break;
20086
20087     case CTRL_BEAMFORM_RPT_POLL:
20088       hdr_len += 17;
20089       break;
20090
20091     case CTRL_VHT_NDP_ANNC:
20092       hdr_len += 17;
20093       /* TODO: for now we only consider a single STA, add support for more */
20094       hdr_len += 2;
20095       break;
20096
20097     case CTRL_CTS:
20098     case CTRL_ACKNOWLEDGEMENT:
20099       hdr_len += 10;
20100       break;
20101
20102     case CTRL_POLL:
20103       hdr_len += 18;
20104       break;
20105
20106     case CTRL_SPR:
20107     case CTRL_GRANT:
20108     case CTRL_GRANT_ACK:
20109       hdr_len += 23;
20110       break;
20111
20112     case CTRL_DMG_CTS:
20113       hdr_len += 16;
20114       break;
20115
20116     case CTRL_DMG_DTS:
20117     case CTRL_SSW:
20118       hdr_len += 22;
20119       break;
20120
20121     case CTRL_SSW_FEEDBACK:
20122     case CTRL_SSW_ACK:
20123       hdr_len += 24;
20124       break;
20125
20126     case CTRL_RTS:
20127     case CTRL_PS_POLL:
20128     case CTRL_CFP_END:
20129     case CTRL_CFP_ENDACK:
20130     case CTRL_BLOCK_ACK_REQ:
20131     case CTRL_BLOCK_ACK:
20132       hdr_len += 16;
20133       break;
20134
20135     default:
20136       hdr_len += 4;  /* XXX */
20137       break;
20138     }
20139     break;
20140
20141   case DATA_FRAME:
20142     hdr_len = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
20143
20144     if ((option_flags & IEEE80211_COMMON_OPT_NORMAL_QOS) && DATA_FRAME_IS_QOS(frame_type_subtype)) {
20145       /* QoS frame */
20146       qosoff = hdr_len;
20147       hdr_len += 2; /* Include the QoS field in the header length */
20148
20149       if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
20150         /*
20151          * QoS data frames with the Order bit set have an HT Control field;
20152          * see 8.2.4.1.10 "Order field".  If they're not HT frames, they
20153          * should never have the Order bit set.
20154          */
20155         hdr_len += 4;
20156         htc_len = 4;
20157       }
20158
20159       /*
20160        * Does it look as if we have a mesh header?
20161        * Look at the Mesh Control subfield of the QoS field and at the
20162        * purported mesh flag fields.
20163        */
20164       qos_control = tvb_get_letohs(tvb, qosoff);
20165       if (tvb_bytes_exist(tvb, hdr_len, 1)) {
20166         meshoff = hdr_len;
20167         mesh_flags = tvb_get_guint8(tvb, meshoff);
20168         if (has_mesh_control(fcf, qos_control, mesh_flags)) {
20169           /* Yes, add the length of that in as well. */
20170           meshctl_len = find_mesh_control_length(mesh_flags);
20171           hdr_len += meshctl_len;
20172         }
20173       }
20174     }
20175     break;
20176
20177   case EXTENSION_FRAME:
20178     hdr_len = 10;
20179     break;
20180
20181   default:
20182     hdr_len = 4;  /* XXX */
20183     break;
20184   }
20185
20186   /*
20187    * Some portions of this code calculate offsets relative to the end of the
20188    * header.  But when the header has been padded to align the data this must
20189    * be done relative to true header size, not the padded/aligned value.  To
20190    * simplify this work we stash the original header size in ohdr_len instead
20191    * of recalculating it every time we need it.
20192    */
20193   ohdr_len = hdr_len;
20194   if (phdr->datapad) {
20195     /*
20196      * Add in Atheros padding between the 802.11 header and body.
20197      *
20198      * XXX - would the mesh header be part of the header or the body
20199      * from the point of view of the Atheros adapters that insert
20200      * the padding, assuming they even recognize a mesh header?
20201      */
20202     hdr_len = roundup2(hdr_len, 4);
20203   }
20204
20205   /* Add the FC and duration/id to the current tree */
20206   ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
20207                                            "IEEE 802.11 %s", fts_str);
20208   hdr_tree = proto_item_add_subtree(ti, ett_80211);
20209
20210   dissect_frame_control(hdr_tree, tvb, option_flags, 0, pinfo);
20211   dissect_durid(hdr_tree, tvb, frame_type_subtype, 2);
20212
20213   switch (phdr->fcs_len)
20214     {
20215       case 0: /* Definitely has no FCS */
20216         has_fcs = FALSE;
20217         break;
20218
20219       case 4: /* Definitely has an FCS */
20220         has_fcs = TRUE;
20221         break;
20222
20223       case -2: /* Data frames have no FCS, other frames may have an FCS */
20224                /* XXX: -2 currently used only in wiretap/netmon.c       */
20225         if (FCF_FRAME_TYPE (fcf) == DATA_FRAME)
20226           has_fcs = FALSE;
20227         else /* Management, Control, Extension */
20228           has_fcs = wlan_check_fcs;
20229         break;
20230
20231       default: /* Don't know - use "wlan_check_fcs" */
20232         has_fcs = wlan_check_fcs;
20233         break;
20234     }
20235
20236   /*
20237    * Decode the part of the frame header that isn't the same for all
20238    * frame types.
20239    */
20240   seq_control = 0;
20241   frag_number = 0;
20242   seq_number = 0;
20243
20244   /* all frames have address 1 = RA */
20245   if (tree) {
20246     const gchar *ether_name = tvb_get_ether_name(tvb, 4);
20247     proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
20248     hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ra_resolved, tvb, 4, 6, ether_name);
20249     PROTO_ITEM_SET_HIDDEN(hidden_item);
20250     hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
20251     PROTO_ITEM_SET_HIDDEN(hidden_item);
20252     hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 4, 6, ether_name);
20253     PROTO_ITEM_SET_HIDDEN(hidden_item);
20254   }
20255
20256   switch (FCF_FRAME_TYPE (fcf))
20257   {
20258
20259     case MGT_FRAME:
20260       /*
20261        * All management frame types have the same header.
20262        */
20263       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, 10);
20264       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
20265       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, 4);
20266       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
20267
20268       /* for tap */
20269       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, 16);
20270       copy_address_shallow(&whdr->src, &pinfo->dl_src);
20271       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
20272
20273       seq_control = tvb_get_letohs(tvb, 22);
20274       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
20275       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
20276
20277       col_append_fstr(pinfo->cinfo, COL_INFO,
20278             ", SN=%d", seq_number);
20279
20280       col_append_fstr(pinfo->cinfo, COL_INFO,
20281             ", FN=%d", frag_number);
20282
20283       if (tree)
20284       {
20285         const gchar *ra_da_name, *ta_sa_name, *bssid_name;
20286
20287         ra_da_name = tvb_get_ether_name(tvb, 4);
20288         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
20289         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, 4, 6, ra_da_name);
20290         PROTO_ITEM_SET_HIDDEN(hidden_item);
20291         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
20292         ta_sa_name = tvb_get_ether_name(tvb, 10);
20293         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, 10, 6, ta_sa_name);
20294         PROTO_ITEM_SET_HIDDEN(hidden_item);
20295         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
20296         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, 10, 6, ta_sa_name);
20297         PROTO_ITEM_SET_HIDDEN(hidden_item);
20298         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
20299         bssid_name = tvb_get_ether_name(tvb, 16);
20300         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, 16, 6, bssid_name);
20301         PROTO_ITEM_SET_HIDDEN(hidden_item);
20302
20303         /* FIXME: With mgmt frames FROM_TO_DS is always 0, perhaps compare address to bssid instead? */
20304         if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
20305           sta_addr_offset = 4;
20306         } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
20307           sta_addr_offset = 10;
20308         }
20309         if (sta_addr_offset > 0) {
20310           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
20311           station_name = tvb_get_ether_name(tvb, sta_addr_offset);
20312           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
20313           PROTO_ITEM_SET_HIDDEN(hidden_item);
20314         }
20315         /* add items for wlan.addr filter */
20316         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
20317         PROTO_ITEM_SET_HIDDEN(hidden_item);
20318         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 10, 6, ta_sa_name);
20319         PROTO_ITEM_SET_HIDDEN(hidden_item);
20320         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
20321         PROTO_ITEM_SET_HIDDEN(hidden_item);
20322         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 16, 6, bssid_name);
20323         PROTO_ITEM_SET_HIDDEN(hidden_item);
20324         proto_tree_add_item(hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
20325         proto_tree_add_item(hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
20326       }
20327       break;
20328
20329     case CONTROL_FRAME:
20330     {
20331       /*
20332        * Control Wrapper frames insert themselves between address 1
20333        * and address 2 in a normal control frame.  Process address 1
20334        * first, then handle the rest of the frame in dissect_control.
20335        */
20336       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
20337         offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
20338         ctrl_fcf = FETCH_FCF(10);
20339         ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
20340       } else {
20341         offset = 10; /* FC + D/ID + Address 1 */
20342         ctrl_type_subtype = frame_type_subtype;
20343       }
20344       /* Added to disallow DMG STA to transfer packets of certain forbidden types. */
20345       switch (ctrl_type_subtype)
20346       {
20347         case CTRL_PS_POLL:
20348         case CTRL_CTS:
20349         case CTRL_CFP_ENDACK:
20350         if(isDMG == TRUE) {
20351           expert_add_info_format(pinfo, hdr_tree, &ei_ieee80211_dmg_subtype,
20352               "DMG STA shouldn't transmit control frame of type contention-free period end+ack");
20353         }
20354         break;
20355         default:
20356           break;
20357       }
20358
20359       if (ctrl_type_subtype == CTRL_PS_POLL) {
20360         addr1_str = "BSSID";
20361         if (tree) {
20362           const gchar *ether_name = tvb_get_ether_name(tvb, 4);
20363           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
20364           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, 4, 6, ether_name);
20365           PROTO_ITEM_SET_HIDDEN(hidden_item);
20366         }
20367       }
20368
20369       /* Add address 1 */
20370       set_dst_addr_cols(pinfo, tvb, 4, addr1_str);
20371
20372       /*
20373        * Start shoving in other fields if needed.
20374        */
20375       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
20376         /* if (tree) */
20377         {
20378           cw_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
20379                       ett_cntrl_wrapper_fc, NULL, "Contained Frame Control");
20380           dissect_frame_control(cw_tree, tvb, 0, offset, pinfo);
20381           dissect_ht_control(hdr_tree, tvb, offset + 2);
20382           offset += 6;
20383           hdr_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
20384                       ett_cntrl_wrapper_fc, &cw_item, "Carried Frame");
20385           if (isDMG) {
20386             expert_add_info_format(pinfo, cw_item, &ei_ieee80211_dmg_subtype,
20387                                    "DMG STA shouldn't transmit Control Wrapper frame");
20388           }
20389         }
20390       }
20391
20392       switch (ctrl_type_subtype)
20393       {
20394         case CTRL_PS_POLL:
20395         case CTRL_CFP_ENDACK:
20396         {
20397           set_src_addr_cols(pinfo, tvb, offset, "TA");
20398           /* if (tree) */
20399           {
20400             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
20401             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
20402             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
20403             PROTO_ITEM_SET_HIDDEN(hidden_item);
20404             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
20405             PROTO_ITEM_SET_HIDDEN(hidden_item);
20406             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
20407             PROTO_ITEM_SET_HIDDEN(hidden_item);
20408             offset += 6;
20409           }
20410           break;
20411         }
20412
20413         case CTRL_CFP_END:
20414         {
20415           if (isDMG)
20416             set_src_addr_cols(pinfo, tvb, offset, "TA");
20417           else
20418             set_src_addr_cols(pinfo, tvb, offset, "BSSID");
20419           /* if (tree) */
20420           {
20421             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
20422             if (isDMG) {
20423               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
20424               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
20425               PROTO_ITEM_SET_HIDDEN(hidden_item);
20426             } else {
20427               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, offset, 6, ENC_NA);
20428               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, offset, 6, ether_name);
20429               PROTO_ITEM_SET_HIDDEN(hidden_item);
20430             }
20431             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
20432             PROTO_ITEM_SET_HIDDEN(hidden_item);
20433             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
20434             PROTO_ITEM_SET_HIDDEN(hidden_item);
20435             offset += 6;
20436           }
20437           break;
20438         }
20439
20440         case CTRL_TRIGGER:
20441           set_src_addr_cols(pinfo, tvb, offset, "TA");
20442           /*
20443            * The len returned will be adjusted to include any padding required
20444            */
20445           hdr_len = dissect_ieee80211_he_trigger(tvb, pinfo, hdr_tree, offset);
20446           ohdr_len = hdr_len;
20447           has_fcs = FALSE;  /* Not sure at this stage */
20448           break;
20449
20450         case CTRL_BEAMFORM_RPT_POLL:
20451         {
20452           set_src_addr_cols(pinfo, tvb, offset, "TA");
20453           /* if (tree) */
20454           {
20455             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
20456
20457             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
20458             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
20459             PROTO_ITEM_SET_HIDDEN(hidden_item);
20460             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
20461             PROTO_ITEM_SET_HIDDEN(hidden_item);
20462             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
20463             PROTO_ITEM_SET_HIDDEN(hidden_item);
20464             offset += 6;
20465
20466             proto_tree_add_item(hdr_tree, hf_ieee80211_beamform_feedback_seg_retrans_bitmap, tvb, offset, 1, ENC_NA);
20467           }
20468         break;
20469         }
20470
20471         case CTRL_VHT_NDP_ANNC:
20472           set_src_addr_cols(pinfo, tvb, offset, "TA");
20473
20474           dissect_ieee80211_vht_he_ndp_annc(tvb, pinfo, tree, offset, has_fcs);
20475           break;
20476
20477         case CTRL_GRANT_ACK:
20478         case CTRL_SSW:
20479         case CTRL_SSW_FEEDBACK:
20480         case CTRL_SSW_ACK:
20481         case CTRL_DMG_CTS:
20482         case CTRL_GRANT:
20483         case CTRL_SPR:
20484         case CTRL_POLL:
20485         case CTRL_RTS:
20486         {
20487           set_src_addr_cols(pinfo, tvb, offset, "TA");
20488           /* if (tree) */
20489           {
20490             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
20491             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
20492             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
20493             PROTO_ITEM_SET_HIDDEN(hidden_item);
20494             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
20495             PROTO_ITEM_SET_HIDDEN(hidden_item);
20496             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
20497             PROTO_ITEM_SET_HIDDEN(hidden_item);
20498             offset += 6;
20499           }
20500           break;
20501         }
20502
20503         case CTRL_CONTROL_WRAPPER:
20504           /* XXX - We shouldn't see this.  Should we throw an error? */
20505           break;
20506
20507         case CTRL_BLOCK_ACK_REQ:
20508           set_src_addr_cols(pinfo, tvb, offset, "TA");
20509
20510           dissect_ieee80211_block_ack(tvb, pinfo, hdr_tree, offset, isDMG, TRUE);
20511           break;
20512
20513         case CTRL_BLOCK_ACK:
20514           set_src_addr_cols(pinfo, tvb, offset, "TA");
20515
20516           dissect_ieee80211_block_ack(tvb, pinfo, hdr_tree, offset, isDMG, FALSE);
20517           break;
20518       }
20519 /*
20520  * 802.11ad : Used for extension types.
20521  */
20522       switch (ctrl_type_subtype) {
20523         case CTRL_POLL: {
20524                 proto_tree_add_item(hdr_tree, hf_ieee80211_cf_response_offset,
20525                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
20526
20527                 break;
20528         }
20529         case CTRL_GRANT:
20530         case CTRL_GRANT_ACK:
20531         case CTRL_SPR: {
20532           gboolean isGrant;
20533           if(ctrl_type_subtype != CTRL_GRANT_ACK) {
20534             offset += add_ff_dynamic_allocation(hdr_tree, tvb, pinfo, offset);
20535           } else { /* CTRL_GRANT_ACK have 5 octets that are reserved*/
20536             proto_tree_add_item(hdr_tree, hf_ieee80211_grant_ack_reserved, tvb, offset, 5, ENC_NA);
20537             offset += 5;
20538           }
20539           isGrant = ((ctrl_type_subtype==CTRL_GRANT)||(ctrl_type_subtype==CTRL_GRANT_ACK));
20540           add_ff_beamforming_ctrl(hdr_tree, tvb, pinfo, offset, isGrant);
20541           /* offset += 2; */
20542           break;
20543         }
20544         case CTRL_SSW: {
20545           guint32 sector_sweep;
20546
20547           sector_sweep = tvb_get_letoh24(tvb, offset);
20548           offset += add_ff_sector_sweep(hdr_tree, tvb, pinfo, offset);
20549           /* if Sector Sweep Direction = Responder, use SW Feedback field format when not transmitted as part of an ISS */
20550           if(sector_sweep & 0x00001) {
20551             add_ff_sector_sweep_feedback_to_iss(hdr_tree, tvb, pinfo, offset);
20552           } else {
20553             add_ff_sector_sweep_feedback_from_iss(hdr_tree, tvb, pinfo, offset);
20554           }
20555           /* offset += 3; */
20556           break;
20557         }
20558         case CTRL_SSW_ACK:
20559         case CTRL_SSW_FEEDBACK: {
20560           offset += add_ff_sector_sweep_feedback_to_iss(hdr_tree, tvb, pinfo, offset);
20561           offset += add_ff_BRP_request(hdr_tree, tvb, pinfo, offset);
20562           add_ff_beamformed_link(hdr_tree, tvb, pinfo, offset);
20563           /* offset += 1; */
20564           break;
20565         }
20566         case CTRL_DMG_DTS: {
20567           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_sa, tvb, offset, 6, ENC_NA);
20568           offset += 6;
20569           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_da, tvb, offset, 6, ENC_NA);
20570           /* offset += 6; */
20571           break;
20572         }
20573         default:
20574                 break;
20575       }
20576       break;
20577     }
20578
20579     case DATA_FRAME:
20580     {
20581       guint32 da_offset, sa_offset, ta_offset = 10, bssid_offset;
20582       addr_type = FCF_ADDR_SELECTOR(fcf);
20583
20584       /* In order to show src/dst address we must always do the following */
20585       switch (addr_type)
20586       {
20587
20588         case DATA_ADDR_T1:
20589           da_offset = 4;
20590           sa_offset = 10;
20591           bssid_offset = 16;
20592           break;
20593
20594         case DATA_ADDR_T2:
20595           da_offset = 4;
20596           sa_offset = 16;
20597           bssid_offset = 10;
20598           break;
20599
20600         case DATA_ADDR_T3:
20601           da_offset = 16;
20602           sa_offset = 10;
20603           bssid_offset = 4;
20604           break;
20605
20606         case DATA_ADDR_T4:
20607           da_offset = 16;
20608           sa_offset = 24;
20609           bssid_offset = 10;
20610           break;
20611
20612         default:
20613           /* Should never happen? */
20614           da_offset = 0;
20615           sa_offset = 0;
20616           ta_offset = 0;
20617           bssid_offset = 0;
20618           break;
20619       }
20620
20621
20622
20623       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, sa_offset);
20624       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
20625       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, da_offset);
20626       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
20627
20628       /* for tap */
20629       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, bssid_offset);
20630
20631       copy_address_shallow(&whdr->src, &pinfo->dl_src);
20632       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
20633
20634       seq_control = tvb_get_letohs(tvb, 22);
20635       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
20636       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
20637
20638       col_append_fstr(pinfo->cinfo, COL_INFO,
20639             ", SN=%d, FN=%d", seq_number, frag_number);
20640
20641       /* Now if we have a tree we start adding stuff */
20642       if (tree)
20643       {
20644         const gchar *ta_name, *sa_name, *da_name, *bssid_name = NULL;
20645
20646         switch (addr_type)
20647         {
20648           case DATA_ADDR_T1:
20649           case DATA_ADDR_T2:
20650           case DATA_ADDR_T3:
20651           case DATA_ADDR_T4:
20652             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, ta_offset, 6, ENC_NA);
20653             ta_name = tvb_get_ether_name(tvb, ta_offset);
20654             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, ta_offset, 6, ta_name);
20655             PROTO_ITEM_SET_HIDDEN(hidden_item);
20656             /* TA is always in the wlan.addr filter */
20657             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, ta_offset, 6, ENC_NA);
20658             PROTO_ITEM_SET_HIDDEN(hidden_item);
20659             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, ta_offset, 6, ta_name);
20660             PROTO_ITEM_SET_HIDDEN(hidden_item);
20661
20662             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_da, tvb, da_offset, 6, ENC_NA);
20663             da_name = tvb_get_ether_name(tvb, da_offset);
20664             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, da_offset, 6, da_name);
20665             PROTO_ITEM_SET_HIDDEN(hidden_item);
20666
20667             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_sa, tvb, sa_offset, 6, ENC_NA);
20668             sa_name = tvb_get_ether_name(tvb, sa_offset);
20669             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, sa_offset, 6, sa_name);
20670             PROTO_ITEM_SET_HIDDEN(hidden_item);
20671
20672             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, bssid_offset, 6, ENC_NA);
20673             bssid_name = tvb_get_ether_name(tvb, bssid_offset);
20674             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, bssid_offset, 6, bssid_name);
20675             PROTO_ITEM_SET_HIDDEN(hidden_item);
20676
20677             if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
20678               sta_addr_offset = 4;
20679             } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
20680               sta_addr_offset = ta_offset;
20681             }
20682             if (sta_addr_offset > 0) {
20683               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
20684               station_name = tvb_get_ether_name(tvb, sta_addr_offset);
20685               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
20686               PROTO_ITEM_SET_HIDDEN(hidden_item);
20687             }
20688             proto_tree_add_item(hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
20689             proto_tree_add_item(hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
20690
20691             /* add 3rd and 4th address for wlan.addr filter */
20692             if (sa_offset != 4 && sa_offset != 10) {
20693               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, sa_offset, 6, ENC_NA);
20694               PROTO_ITEM_SET_HIDDEN(hidden_item);
20695               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, sa_offset, 6, sa_name);
20696               PROTO_ITEM_SET_HIDDEN(hidden_item);
20697             }
20698             if (da_offset != 4 && da_offset != 10 && da_offset != sa_offset) {
20699               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, da_offset, 6, ENC_NA);
20700               PROTO_ITEM_SET_HIDDEN(hidden_item);
20701               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, da_offset, 6, da_name);
20702               PROTO_ITEM_SET_HIDDEN(hidden_item);
20703             }
20704             if (bssid_offset != 4 && bssid_offset != 10 && bssid_offset != sa_offset && bssid_offset != da_offset) {
20705               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, bssid_offset, 6, ENC_NA);
20706               PROTO_ITEM_SET_HIDDEN(hidden_item);
20707               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, bssid_offset, 6, bssid_name);
20708               PROTO_ITEM_SET_HIDDEN(hidden_item);
20709             }
20710             break;
20711         }
20712
20713       }
20714       break;
20715       }
20716     case EXTENSION_FRAME: {
20717       switch (frame_type_subtype) {
20718         case EXTENSION_DMG_BEACON: {
20719           set_dst_addr_cols(pinfo, tvb, 4, "BSSID");
20720           if (tree) {
20721             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
20722             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
20723             PROTO_ITEM_SET_HIDDEN(hidden_item);
20724           }
20725           break;
20726         }
20727       }
20728     }
20729   }
20730
20731   len = tvb_captured_length_remaining(tvb, hdr_len);
20732   reported_len = tvb_reported_length_remaining(tvb, hdr_len);
20733
20734   if (has_fcs)
20735     {
20736       /*
20737        * Well, this packet should, in theory, have an FCS.
20738        * Do we have the entire packet, and does it have enough data for
20739        * the FCS?
20740        */
20741       if (reported_len < 4)
20742       {
20743         /*
20744          * The packet is claimed not to even have enough data for a 4-byte
20745          * FCS.
20746          * Pretend it doesn't have an FCS.
20747          */
20748         ;
20749       }
20750       else if (len < reported_len)
20751       {
20752         /*
20753          * The packet is claimed to have enough data for a 4-byte FCS, but
20754          * we didn't capture all of the packet.
20755          * Slice off the 4-byte FCS from the reported length, and trim the
20756          * captured length so it's no more than the reported length; that
20757          * will slice off what of the FCS, if any, is in the captured
20758          * length.
20759          */
20760         reported_len -= 4;
20761         if (len > reported_len)
20762             len = reported_len;
20763       }
20764       else
20765       {
20766         /*
20767          * We have the entire packet, and it includes a 4-byte FCS.
20768          * Slice it off, and put it into the tree.
20769          */
20770         len          -= 4;
20771         reported_len -= 4;
20772         if (wlan_check_checksum)
20773         {
20774           guint32 sent_fcs = tvb_get_letohl(tvb, hdr_len + len);
20775           guint32 fcs;
20776
20777           if (phdr->datapad)
20778             fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
20779           else
20780             fcs = crc32_ccitt_tvb(tvb, hdr_len + len);
20781           if (fcs != sent_fcs) {
20782             flag_str[8] = '.';
20783           }
20784
20785           proto_tree_add_checksum(hdr_tree, tvb, hdr_len + len, hf_ieee80211_fcs, hf_ieee80211_fcs_status, &ei_ieee80211_fcs, pinfo, fcs, ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_VERIFY);
20786         } else {
20787           proto_tree_add_checksum(hdr_tree, tvb, hdr_len + len, hf_ieee80211_fcs, hf_ieee80211_fcs_status, &ei_ieee80211_fcs, pinfo, 0, ENC_LITTLE_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
20788         }
20789       }
20790     }
20791   else
20792     {
20793       flag_str[8] = '\0';
20794     }
20795
20796   proto_item_append_text(ti, ", Flags: %s", flag_str);
20797   col_append_fstr(pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
20798
20799
20800   /*
20801    * Only management and data frames have a body, so we don't have
20802    * anything more to do for other types of frames.
20803    */
20804   switch (FCF_FRAME_TYPE (fcf))
20805     {
20806
20807     case MGT_FRAME:
20808       if (htc_len == 4) {
20809         dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
20810       }
20811       break;
20812
20813     case DATA_FRAME:
20814       if ((option_flags & IEEE80211_COMMON_OPT_NORMAL_QOS) && tree && DATA_FRAME_IS_QOS(frame_type_subtype))
20815       {
20816         proto_item *qos_fields, *qos_ti;
20817         proto_tree *qos_tree;
20818
20819         guint16 qos_eosp;
20820         guint16 qos_field_content;
20821
20822         qos_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_qos, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20823         qos_tree = proto_item_add_subtree(qos_fields, ett_qos_parameters);
20824
20825         qos_eosp = QOS_EOSP(qos_control);
20826         qos_field_content = QOS_FIELD_CONTENT(qos_control);
20827
20828         proto_tree_add_item(qos_tree, hf_ieee80211_qos_tid, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20829
20830         qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_priority, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20831         PROTO_ITEM_SET_GENERATED(qos_ti);
20832
20833         if (FLAGS_DS_STATUS(flags) == (FLAG_FROM_DS|FLAG_TO_DS)) {
20834           /* mesh frame */
20835           proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20836         } else {
20837           if (flags & FLAG_TO_DS) {
20838             proto_tree_add_item(qos_tree, hf_ieee80211_qos_bit4, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20839           } else {
20840             proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20841           }
20842         }
20843
20844         proto_tree_add_item(qos_tree, hf_ieee80211_qos_ack_policy, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20845
20846         if (flags & FLAG_FROM_DS) {
20847           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
20848             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20849             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
20850           }
20851           if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
20852             /* txop limit */
20853               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_limit, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20854             if (qos_field_content == 0) {
20855               proto_item_append_text(qos_ti, " (transmit one frame immediately)");
20856             }
20857           } else {
20858             /* qap ps buffer state */
20859             proto_item *qos_ps_buf_state_fields;
20860             proto_tree *qos_ps_buf_state_tree;
20861
20862             qos_ps_buf_state_fields = proto_tree_add_item(qos_tree, hf_ieee80211_qos_ps_buf_state, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20863             qos_ps_buf_state_tree = proto_item_add_subtree(qos_ps_buf_state_fields, ett_qos_ps_buf_state);
20864
20865             proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_buf_state_indicated, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20866
20867             if (QOS_PS_BUF_STATE_INDICATED(qos_field_content)) {
20868               proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_highest_pri_buf_ac, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20869               qos_ti = proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_qap_buf_load, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20870               switch (QOS_PS_QAP_BUF_LOAD(qos_field_content)) {
20871
20872               case 0:
20873                 proto_item_append_text(qos_ti, " (no buffered traffic)");
20874                 break;
20875
20876               default:
20877                 proto_item_append_text(qos_ti, " (%d octets)", QOS_PS_QAP_BUF_LOAD(qos_field_content)*4096);
20878                 break;
20879
20880               case 15:
20881                 proto_item_append_text(qos_ti, " (greater than 57344 octets)");
20882                 break;
20883               }
20884
20885             }
20886           }
20887         } else {
20888           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
20889             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20890             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
20891           }
20892           if (qos_eosp) {
20893             /* queue size */
20894             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_queue_size, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20895             switch (qos_field_content) {
20896             case 0:
20897               proto_item_append_text(qos_ti, " (no buffered traffic in the queue)");
20898               break;
20899
20900             default:
20901               proto_item_append_text(qos_ti, " (%u bytes)", qos_field_content*256);
20902               break;
20903
20904             case 254:
20905               proto_item_append_text(qos_ti, " (more than 64768 octets)");
20906               break;
20907
20908             case 255:
20909               proto_item_append_text(qos_ti, " (unspecified or unknown)");
20910               break;
20911             }
20912           } else {
20913             /* txop duration requested */
20914             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_dur_req,
20915                                    tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
20916             if (qos_field_content == 0) {
20917               proto_item_append_text(qos_ti, " (no TXOP requested)");
20918             }
20919           }
20920         }
20921
20922         /* Do we have +HTC? */
20923         if (htc_len == 4) {
20924           dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
20925         }
20926
20927         if (meshctl_len != 0) {
20928           proto_item *msh_fields;
20929           proto_tree *msh_tree;
20930
20931           msh_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_mesh_control_field, tvb, meshoff, meshctl_len, ENC_NA);
20932           msh_tree = proto_item_add_subtree(msh_fields, ett_msh_control);
20933           add_ff_mesh_control(msh_tree, tvb, pinfo, meshoff);
20934         }
20935
20936       } /* end of qos control field */
20937       if (enable_decryption && !pinfo->fd->flags.visited) {
20938         const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
20939         /* The processing will take care of 4-way handshake sessions for WPA and WPA2 decryption */
20940         Dot11DecryptPacketProcess(&dot11decrypt_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE);
20941
20942       }
20943       /*
20944        * No-data frames don't have a body.
20945        */
20946       if (DATA_FRAME_IS_NULL(frame_type_subtype))
20947         goto end_of_wlan;
20948
20949       if (!wlan_subdissector) {
20950         guint fnum = 0;
20951
20952         /* key: bssid:src
20953          * data: last seq_control seen and frame number
20954          */
20955         retransmitted = FALSE;
20956         if (!pinfo->fd->flags.visited) {
20957           retransmit_key key;
20958           retransmit_key *result;
20959
20960           memcpy(key.bssid, whdr->bssid.data, 6);
20961           memcpy(key.src, whdr->src.data, 6);
20962           key.seq_control = 0;
20963           result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
20964           if (result && (result->seq_control == seq_control)) {
20965             /* keep a pointer to the first seen frame, could be done with proto data? */
20966             fnum = result->fnum;
20967             g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER(pinfo->num),
20968                                 GINT_TO_POINTER(fnum));
20969             retransmitted = TRUE;
20970           } else {
20971             /* first time or new seq*/
20972             if (!result) {
20973               result = wmem_new(wmem_file_scope(), retransmit_key);
20974               *result = key;
20975               g_hash_table_insert(fc_analyse_retransmit_table, result, result);
20976             }
20977             result->seq_control = seq_control;
20978             result->fnum =  pinfo->num;
20979           }
20980         }
20981         else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER(pinfo->num))))) {
20982           retransmitted = TRUE;
20983         }
20984
20985         if (retransmitted) {
20986           col_append_str(pinfo->cinfo, COL_INFO, " [retransmitted]");
20987           if (tree) {
20988             proto_item *item;
20989
20990             item=proto_tree_add_none_format(hdr_tree, hf_ieee80211_fc_analysis_retransmission, tvb, 0, 0,
20991                                             "Retransmitted frame");
20992             PROTO_ITEM_SET_GENERATED(item);
20993             item=proto_tree_add_uint(hdr_tree, hf_ieee80211_fc_analysis_retransmission_frame, tvb, 0, 0, fnum);
20994             PROTO_ITEM_SET_GENERATED(item);
20995           }
20996           next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
20997           call_data_dissector(next_tvb, pinfo, tree);
20998           goto end_of_wlan;
20999         }
21000       }
21001
21002       break;
21003
21004     case CONTROL_FRAME:
21005       goto end_of_wlan;
21006
21007     case EXTENSION_FRAME:
21008       break;
21009
21010     default:
21011       goto end_of_wlan;
21012     }
21013
21014   if (IS_PROTECTED(FCF_FLAGS(fcf))
21015       && !phdr->decrypted
21016       && (wlan_ignore_prot != WLAN_IGNORE_PROT_WO_IV)) {
21017     /*
21018      * It's a WEP or WPA encrypted frame, and it hasn't already been
21019      * decrypted; dissect the protections parameters and decrypt the data,
21020      * if we have a matching key. Otherwise display it as data.
21021      */
21022     gboolean    can_decrypt = FALSE;
21023     proto_tree *wep_tree    = NULL;
21024     guint32     iv;
21025     guint8      key, keybyte;
21026
21027 #define PROTECTION_ALG_WEP  DOT11DECRYPT_KEY_TYPE_WEP
21028 #define PROTECTION_ALG_TKIP  DOT11DECRYPT_KEY_TYPE_TKIP
21029 #define PROTECTION_ALG_CCMP  DOT11DECRYPT_KEY_TYPE_CCMP
21030 #define PROTECTION_ALG_RSNA  PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
21031     guint8 algorithm=G_MAXUINT8;
21032 #define IS_TKIP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 1) == \
21033   ((tvb_get_guint8(tvb, hdr_len) | 0x20) & 0x7f))
21034 #define IS_CCMP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 2) == 0)
21035     guint32 sec_header=0;
21036     guint32 sec_trailer=0;
21037
21038     next_tvb = try_decrypt(tvb, pinfo, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer, &used_key);
21039
21040     keybyte = tvb_get_guint8(tvb, hdr_len + 3);
21041     key = KEY_OCTET_WEP_KEY(keybyte);
21042     if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
21043       /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
21044       if (tree) {
21045         if (algorithm==PROTECTION_ALG_TKIP)
21046           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
21047               ett_wep_parameters, NULL, "TKIP parameters");
21048         else if (algorithm==PROTECTION_ALG_CCMP)
21049           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
21050             ett_wep_parameters, NULL, "CCMP parameters");
21051         else {
21052           if (IS_TKIP(tvb, hdr_len)) {
21053             algorithm=PROTECTION_ALG_TKIP;
21054             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
21055                 ett_wep_parameters, NULL, "TKIP parameters");
21056           } else if (IS_CCMP(tvb, hdr_len)) {
21057             algorithm=PROTECTION_ALG_CCMP;
21058             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
21059                 ett_wep_parameters, NULL, "CCMP parameters");
21060           } else
21061             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
21062                 ett_wep_parameters, NULL, "TKIP/CCMP parameters");
21063         }
21064         proto_item_set_len(ti, hdr_len + 8);
21065
21066         if (algorithm==PROTECTION_ALG_TKIP) {
21067           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
21068               tvb_get_letohl(tvb, hdr_len + 4),
21069               tvb_get_guint8(tvb, hdr_len),
21070               tvb_get_guint8(tvb, hdr_len + 2));
21071           proto_tree_add_string(wep_tree, hf_ieee80211_tkip_extiv, tvb, hdr_len,
21072               EXTIV_LEN, out_buff);
21073         } else if (algorithm==PROTECTION_ALG_CCMP) {
21074           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
21075               tvb_get_letohl(tvb, hdr_len + 4),
21076               tvb_get_guint8(tvb, hdr_len + 1),
21077               tvb_get_guint8(tvb, hdr_len));
21078           proto_tree_add_string(wep_tree, hf_ieee80211_ccmp_extiv, tvb, hdr_len,
21079               EXTIV_LEN, out_buff);
21080         }
21081
21082         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
21083       }
21084
21085       /* Subtract out the length of the IV. */
21086       len          -= EXTIV_LEN;
21087       reported_len -= EXTIV_LEN;
21088       ivlen         = EXTIV_LEN;
21089       /* It is unknown whether this is TKIP or CCMP, so let's not even try to
21090        * parse TKIP Michael MIC+ICV or CCMP MIC. */
21091
21092       /* checking for the trailer                            */
21093       if (next_tvb!=NULL) {
21094         if (reported_len < (gint) sec_trailer) {
21095           /* There is no space for a trailer, ignore it and don't decrypt  */
21096           ;
21097         } else if (len < reported_len) {
21098           /* There is space for a trailer, but we haven't capture all the  */
21099           /* packet. Slice off the trailer, but don't try to decrypt      */
21100           reported_len -= sec_trailer;
21101           if (len > reported_len)
21102             len = reported_len;
21103         } else {
21104           /* Ok, we have a trailer and the whole packet. Decrypt it!      */
21105           /* TODO: At the moment we won't add the trailer to the tree,    */
21106           /* so don't remove the trailer from the packet                  */
21107           len          -= sec_trailer;
21108           reported_len -= sec_trailer;
21109           can_decrypt   = TRUE;
21110
21111           /* Add Key information to packet */
21112           bytes_to_hexstr(out_buff, used_key.KeyData.Wpa.Ptk+32, DOT11DECRYPT_TK_LEN); /* TK is stored in PTK at offset 32 bytes and 16 bytes long */
21113           out_buff[2*DOT11DECRYPT_TK_LEN] = '\0';
21114
21115           if (key == 0) { /* encrypted with pairwise key */
21116             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_tk, tvb, 0, 0, out_buff);
21117             PROTO_ITEM_SET_GENERATED(ti);
21118
21119             /* Also add the PMK used to to decrypt the packet. (PMK==PSK) */
21120             bytes_to_hexstr(out_buff, used_key.KeyData.Wpa.Psk, DOT11DECRYPT_WPA_PSK_LEN); /* 32 bytes */
21121             out_buff[2*DOT11DECRYPT_WPA_PSK_LEN] = '\0';
21122             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_pmk, tvb, 0, 0, out_buff);
21123             PROTO_ITEM_SET_GENERATED(ti);
21124
21125           } else { /* Encrypted with Group Key */
21126             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_gtk, tvb, 0, 0, out_buff); /* GTK is stored in PTK at offset 32 bytes and 16 bytes long */
21127             PROTO_ITEM_SET_GENERATED(ti);
21128           }
21129         }
21130       }
21131     } else {
21132       /* No Ext. IV - WEP packet */
21133       /*
21134        * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
21135        * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
21136        * them itself.
21137        *
21138        * Also, just pass the data *following* the WEP parameters as the
21139        * buffer to decrypt.
21140        */
21141       iv = tvb_get_ntoh24(tvb, hdr_len);
21142       if (tree) {
21143         wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 4,
21144             ett_wep_parameters, NULL, "WEP parameters");
21145
21146         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_iv, tvb, hdr_len, 3, iv);
21147         tvb_memcpy(tvb, iv_buff, hdr_len, 3);
21148         is_iv_bad = weak_iv(iv_buff);
21149         if (is_iv_bad != -1) {
21150           proto_tree_add_boolean_format (wep_tree, hf_ieee80211_wep_iv_weak,
21151               tvb, 0, 0, TRUE,
21152               "Weak IV for key byte %d",
21153               is_iv_bad);
21154         }
21155       }
21156       if (tree)
21157         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
21158
21159       /* Subtract out the length of the IV. */
21160       len          -= 4;
21161       reported_len -= 4;
21162       ivlen         = 4;
21163
21164       /* Even if the decryption was not successful, set the algorithm */
21165       algorithm=PROTECTION_ALG_WEP;
21166
21167       /*
21168        * Well, this packet should, in theory, have an ICV.
21169        * Do we have the entire packet, and does it have enough data for
21170        * the ICV?
21171        */
21172       if (reported_len < 4) {
21173         /*
21174          * The packet is claimed not to even have enough data for a
21175          * 4-byte ICV.
21176          * Pretend it doesn't have an ICV.
21177          */
21178         ;
21179       } else if (len < reported_len) {
21180         /*
21181          * The packet is claimed to have enough data for a 4-byte ICV,
21182          * but we didn't capture all of the packet.
21183          * Slice off the 4-byte ICV from the reported length, and trim
21184          * the captured length so it's no more than the reported length;
21185          * that will slice off what of the ICV, if any, is in the
21186          * captured length.
21187          */
21188         reported_len -= 4;
21189         if (len > reported_len)
21190           len         = reported_len;
21191       } else {
21192         /*
21193          * We have the entire packet, and it includes a 4-byte ICV.
21194          * Slice it off, and put it into the tree.
21195          *
21196          * We only support decrypting if we have the the ICV.
21197          *
21198          * XXX - the ICV is encrypted; we're putting the encrypted
21199          * value, not the decrypted value, into the tree.
21200          */
21201         len          -= 4;
21202         reported_len -= 4;
21203         can_decrypt   = TRUE;
21204       }
21205     }
21206
21207     if (algorithm == PROTECTION_ALG_WEP) {
21208       g_strlcpy(wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
21209     } else if (algorithm == PROTECTION_ALG_TKIP) {
21210       g_strlcpy(wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
21211     } else if (algorithm == PROTECTION_ALG_CCMP) {
21212       g_strlcpy(wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
21213     } else {
21214       g_strlcpy(wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
21215     }
21216
21217     /* protection header                                  */
21218     if (!can_decrypt || (next_tvb == NULL)) {
21219       /*
21220        * WEP decode impossible or failed, treat payload as raw data
21221        * and don't attempt fragment reassembly or further dissection.
21222        */
21223       next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len + ivlen, len, reported_len);
21224
21225       if (tree) {
21226         if (algorithm == PROTECTION_ALG_WEP) {
21227           if (can_decrypt)
21228             proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
21229                 hdr_len + ivlen + len, 4,
21230                 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
21231                 "0x%08x (not verified)",
21232                 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
21233         } else if (algorithm == PROTECTION_ALG_CCMP) {
21234         } else if (algorithm == PROTECTION_ALG_TKIP) {
21235         }
21236       }
21237
21238       if ((!(option_flags & IEEE80211_COMMON_OPT_IS_CENTRINO)) && (wlan_ignore_prot == WLAN_IGNORE_PROT_NO)) {
21239         /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
21240         call_data_dissector(next_tvb, pinfo, tree);
21241         goto end_of_wlan;
21242       }
21243     } else {
21244       if (algorithm == PROTECTION_ALG_WEP) {
21245         if (tree)
21246           proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
21247               hdr_len + ivlen + len, 4,
21248               tvb_get_ntohl(tvb, hdr_len + ivlen + len),
21249               "0x%08x (correct)",
21250               tvb_get_ntohl(tvb, hdr_len + ivlen + len));
21251
21252         add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
21253       } else if (algorithm==PROTECTION_ALG_CCMP) {
21254         add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
21255       } else if (algorithm==PROTECTION_ALG_TKIP) {
21256         add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
21257       }
21258 #undef IS_TKIP
21259 #undef IS_CCMP
21260 #undef PROTECTION_ALG_CCMP
21261 #undef PROTECTION_ALG_TKIP
21262 #undef PROTECTION_ALG_WEP
21263     }
21264
21265     /*
21266      * WEP decryption successful!
21267      *
21268      * Use the tvbuff we got back from the decryption; the data starts at
21269      * the beginning.  The lengths are already correct for the decoded WEP
21270      * payload.
21271      */
21272     hdr_len = 0;
21273
21274   } else {
21275     /*
21276      * Not a WEP-encrypted frame; just use the data from the tvbuff
21277      * handed to us.
21278      *
21279      * The payload starts at "hdr_len" (i.e., just past the 802.11
21280      * MAC header), the length of data in the tvbuff following the
21281      * 802.11 header is "len", and the length of data in the packet
21282      * following the 802.11 header is "reported_len".
21283      */
21284     next_tvb = tvb;
21285   }
21286
21287   /*
21288    * Do defragmentation if "wlan_defragment" is true, and we have more
21289    * fragments or this isn't the first fragment.
21290    *
21291    * We have to do some special handling to catch frames that
21292    * have the "More Fragments" indicator not set but that
21293    * don't show up as reassembled and don't have any other
21294    * fragments present.  Some networking interfaces appear
21295    * to do reassembly even when you're capturing raw packets
21296    * *and* show the reassembled packet without the "More
21297    * Fragments" indicator set *but* with a non-zero fragment
21298    * number.
21299    *
21300    * "fragment_add_seq_802_11()" handles that; we want to call it
21301    * even if we have a short frame, so that it does those checks - if
21302    * the frame is short, it doesn't do reassembly on it.
21303    *
21304    * (This could get some false positives if we really *did* only
21305    * capture the last fragment of a fragmented packet, but that's
21306    * life.)
21307    */
21308   save_fragmented = pinfo->fragmented;
21309   if (wlan_defragment && (more_frags || (frag_number != 0))) {
21310     fragment_head *fd_head;
21311
21312     /*
21313      * If we've already seen this frame, look it up in the
21314      * table of reassembled packets, otherwise add it to
21315      * whatever reassembly is in progress, if any, and see
21316      * if it's done.
21317      */
21318     if (reported_len < 0)
21319       THROW(ReportedBoundsError);
21320     fd_head = fragment_add_seq_802_11(&wlan_reassembly_table,
21321         next_tvb, hdr_len, pinfo, seq_number, NULL,
21322         frag_number,
21323         reported_len,
21324         more_frags);
21325     next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
21326         "Reassembled 802.11", fd_head,
21327         &frag_items, NULL, hdr_tree);
21328   } else {
21329     /*
21330      * If this is the first fragment, dissect its contents, otherwise
21331      * just show it as a fragment.
21332      */
21333     if (frag_number != 0) {
21334       /* Not the first fragment - don't dissect it. */
21335       next_tvb = NULL;
21336     } else {
21337       /* First fragment, or not fragmented.  Dissect what we have here. */
21338
21339       /* Get a tvbuff for the payload. */
21340       next_tvb = tvb_new_subset_length_caplen(next_tvb, hdr_len, len, reported_len);
21341
21342       /*
21343        * If this is the first fragment, but not the only fragment,
21344        * tell the next protocol that.
21345        */
21346       if (more_frags)
21347         pinfo->fragmented = TRUE;
21348       else
21349         pinfo->fragmented = FALSE;
21350     }
21351   }
21352
21353   if (next_tvb == NULL) {
21354     /* Just show this as an incomplete fragment. */
21355     col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
21356     next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
21357     call_data_dissector(next_tvb, pinfo, tree);
21358     pinfo->fragmented = save_fragmented;
21359     goto end_of_wlan;
21360   }
21361
21362   switch (FCF_FRAME_TYPE (fcf))
21363     {
21364
21365     case MGT_FRAME:
21366       dissect_ieee80211_mgt(fcf, next_tvb, pinfo, tree);
21367       break;
21368
21369     case DATA_FRAME:
21370       if (is_amsdu && (tvb_reported_length_remaining(next_tvb, 0) > 4)) {
21371         proto_item   *parent_item;
21372         proto_tree   *mpdu_tree;
21373         guint32       msdu_offset = 0;
21374         guint         i           = 1;
21375
21376         parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
21377                                     tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
21378         mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
21379
21380         do {
21381           tvbuff_t           *msdu_tvb;
21382           guint16             msdu_length;
21383           proto_tree         *subframe_tree;
21384           const gchar *resolve_name;
21385
21386           /*
21387            * IEEE Std 802.11-2012 says, in section 8.3.2.2 "A-MSDU format":
21388            *
21389            *  The A-MSDU subframe header contains three fields: DA, SA, and
21390            *  Length. The order of these fields and the bits within these
21391            *  fields are the same as the IEEE 802.3 frame format.
21392            *
21393            * which means that the length field is big-endian, not
21394            * little-endian.
21395            */
21396           msdu_length = tvb_get_ntohs(next_tvb, msdu_offset+12);
21397
21398           parent_item = proto_tree_add_item(mpdu_tree, hf_ieee80211_amsdu_subframe, next_tvb,
21399                             msdu_offset, roundup2(msdu_offset+14+msdu_length, 4), ENC_NA);
21400           proto_item_append_text(parent_item, " #%u", i);
21401           subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
21402           i += 1;
21403
21404           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_da, next_tvb, msdu_offset, 6, ENC_NA);
21405           resolve_name = tvb_get_ether_name(tvb, msdu_offset);
21406           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, msdu_offset, 6,
21407             resolve_name);
21408           PROTO_ITEM_SET_HIDDEN(hidden_item);
21409           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_sa, next_tvb, msdu_offset+6, 6, ENC_NA);
21410           resolve_name = tvb_get_ether_name(tvb, msdu_offset+6);
21411           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, msdu_offset+6, 6,
21412             resolve_name);
21413           PROTO_ITEM_SET_HIDDEN(hidden_item);
21414           proto_tree_add_item(subframe_tree, hf_ieee80211_amsdu_length, next_tvb, msdu_offset+12, 2, ENC_BIG_ENDIAN);
21415
21416           msdu_offset += 14;
21417           msdu_tvb = tvb_new_subset_length(next_tvb, msdu_offset, msdu_length);
21418           call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
21419           msdu_offset = roundup2(msdu_offset+msdu_length, 4);
21420         } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
21421
21422         break;
21423       }
21424       /* I guess some bridges take Netware Ethernet_802_3 frames,
21425          which are 802.3 frames (with a length field rather than
21426          a type field, but with no 802.2 header in the payload),
21427          and just stick the payload into an 802.11 frame.  I've seen
21428          captures that show frames of that sort.
21429
21430          We also handle some odd form of encapsulation in which a
21431          complete Ethernet frame is encapsulated within an 802.11
21432          data frame, with no 802.2 header.  This has been seen
21433          from some hardware.
21434
21435          On top of that, at least at some point it appeared that
21436          the OLPC XO sent out frames with two bytes of 0 between
21437          the "end" of the 802.11 header and the beginning of
21438          the payload. Something similar has also been observed
21439          with Atheros chipsets. There the sequence control field
21440          seems repeated.
21441
21442          So, if the packet doesn't start with 0xaa 0xaa:
21443
21444            we first use the same scheme that linux-wlan-ng does to detect
21445            those encapsulated Ethernet frames, namely looking to see whether
21446            the frame either starts with 6 octets that match the destination
21447            address from the 802.11 header or has 6 octets that match the
21448            source address from the 802.11 header following the first 6 octets,
21449            and, if so, treat it as an encapsulated Ethernet frame;
21450
21451            otherwise, we use the same scheme that we use in the Ethernet
21452            dissector to recognize Netware 802.3 frames, namely checking
21453            whether the packet starts with 0xff 0xff and, if so, treat it
21454            as an encapsulated IPX frame, and then check whether the
21455            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
21456            frame, or check the packet starts with the repetition of the
21457            sequence control field and, if so, treat it as an Atheros frame. */
21458       encap_type = ENCAP_802_2;
21459       if (tvb_bytes_exist(next_tvb, 0, 2)) {
21460         octet1 = tvb_get_guint8(next_tvb, 0);
21461         octet2 = tvb_get_guint8(next_tvb, 1);
21462         if ((octet1 != 0xaa) || (octet2 != 0xaa)) {
21463           if ((tvb_memeql(next_tvb, 6, (const guint8 *)pinfo->dl_src.data, 6) == 0) ||
21464               (tvb_memeql(next_tvb, 0, (const guint8 *)pinfo->dl_dst.data, 6) == 0))
21465             encap_type = ENCAP_ETHERNET;
21466           else if ((octet1 == 0xff) && (octet2 == 0xff))
21467             encap_type = ENCAP_IPX;
21468           else if (((octet1 == 0x00) && (octet2 == 0x00)) ||
21469                    (((octet2 << 8) | octet1) == seq_control)) {
21470             proto_tree_add_item(tree, hf_ieee80211_mysterious_olpc_stuff, next_tvb, 0, 2, ENC_NA);
21471             next_tvb = tvb_new_subset_remaining(next_tvb, 2);
21472           }
21473         }
21474       }
21475
21476       switch (encap_type) {
21477
21478       case ENCAP_802_2:
21479         call_dissector(llc_handle, next_tvb, pinfo, tree);
21480         break;
21481
21482       case ENCAP_ETHERNET:
21483         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
21484         break;
21485
21486       case ENCAP_IPX:
21487         call_dissector(ipx_handle, next_tvb, pinfo, tree);
21488         break;
21489       }
21490       break;
21491
21492     case EXTENSION_FRAME:
21493     {
21494       dissect_ieee80211_extension(fcf, next_tvb, pinfo, tree);
21495       break;
21496     }
21497   }
21498   pinfo->fragmented = save_fragmented;
21499
21500 end_of_wlan:
21501   whdr->stats = wlan_stats;
21502   tap_queue_packet(wlan_tap, pinfo, whdr);
21503   memset(&wlan_stats, 0, sizeof wlan_stats);
21504
21505   return tvb_captured_length(tvb);
21506 }
21507
21508 /*
21509  * Dissect 802.11 with a variable-length link-layer header and with the FCS
21510  * presence or absence indicated by the pseudo-header, if there is one.
21511  */
21512 static int
21513 dissect_ieee80211(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
21514 {
21515   struct ieee_802_11_phdr *phdr = (struct ieee_802_11_phdr *)data;
21516   struct ieee_802_11_phdr ourphdr;
21517
21518   if (phdr == NULL) {
21519     /*
21520      * Fake a pseudo-header.
21521      * XXX - what are we supposed to do if the FCS length is unknown?
21522      */
21523     memset(&ourphdr, 0, sizeof(ourphdr));
21524     ourphdr.fcs_len = -1;
21525     ourphdr.decrypted = FALSE;
21526     ourphdr.datapad = FALSE;
21527     ourphdr.phy = PHDR_802_11_PHY_UNKNOWN;
21528     phdr = &ourphdr;
21529   }
21530   return dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, phdr);
21531 }
21532
21533 /*
21534  * Dissect 802.11 with a variable-length link-layer header and with an
21535  * FCS, but no pseudo-header.
21536  */
21537 static int
21538 dissect_ieee80211_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
21539 {
21540   struct ieee_802_11_phdr phdr;
21541
21542   /* Construct a pseudo-header to hand to the common code. */
21543   memset(&phdr, 0, sizeof(phdr));
21544   phdr.fcs_len = 4;
21545   phdr.decrypted = FALSE;
21546   phdr.datapad = FALSE;
21547   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
21548   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
21549   return tvb_captured_length(tvb);
21550 }
21551
21552 /*
21553  * Dissect 802.11 with a variable-length link-layer header and without an
21554  * FCS, but no pseudo-header.
21555  */
21556 static int
21557 dissect_ieee80211_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
21558 {
21559   struct ieee_802_11_phdr phdr;
21560
21561   /* Construct a pseudo-header to hand to the common code. */
21562   memset(&phdr, 0, sizeof(phdr));
21563   phdr.decrypted = FALSE;
21564   phdr.datapad = FALSE;
21565   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
21566   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
21567   return tvb_captured_length(tvb);
21568 }
21569
21570 /*
21571  * Dissect 802.11 from an Intel 2200BG adapter in a Centrino laptop
21572  * running Windows XP.
21573  *
21574  * From
21575  *
21576  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00184.html
21577  *
21578  * and
21579  *
21580  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00393.html:
21581  *
21582  *  I tried capturing from a Centrino laptop with the Intel 2200BG 802.11g
21583  *  chipset. I saw a lot of "Ethernet II" frames with 0x2452 as ethertype.
21584  *
21585  *    ...
21586  *
21587  *  This behaviour has been observed on Windows XP. In my opinion it is
21588  *  a "proprietary" behaviour of either the Centrino driver or the Centrino
21589  *  hardware. Currently I have no Linux distro installed on the machine to
21590  *  verify whether it is also the case.
21591  *
21592  *  These packets are seen only in a promiscuous capture:
21593  *    - Packets normally received by the Centrino computer have the normal
21594  *      structure (no 802.11/LLC header but directly IP header).
21595  *    - Packets that are supposed to be received by another computer have
21596  *      the 802.11/LLC headers. ... Also I noticed that when WEP is enabled,
21597  *      the 802.11 header has the flag "WEP" set to true, but the packet
21598  *      is already decrypted. I added a test in the code to accomodate this.
21599  *      For TKIP it seems to stay encrypted.
21600  */
21601 static int
21602 dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
21603 {
21604   struct ieee_802_11_phdr phdr;
21605
21606   /* Construct a pseudo-header to hand to the common code. */
21607   memset(&phdr, 0, sizeof(phdr));
21608   phdr.decrypted = FALSE;
21609   phdr.datapad = FALSE;
21610   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
21611   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_IS_CENTRINO|IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
21612   return tvb_captured_length(tvb);
21613 }
21614
21615 /*
21616  * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
21617  * control field and with no FCS (some hardware sends out LWAPP-encapsulated
21618  * 802.11 packets with the control field byte swapped).
21619  */
21620 static int
21621 dissect_ieee80211_bsfc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
21622 {
21623   struct ieee_802_11_phdr phdr;
21624
21625   /* Construct a pseudo-header to hand to the common code. */
21626   memset(&phdr, 0, sizeof(phdr));
21627   phdr.decrypted = FALSE;
21628   phdr.datapad = FALSE;
21629   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
21630   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_BROKEN_FC|IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
21631   return tvb_captured_length(tvb);
21632 }
21633
21634 /*
21635  * Dissect 802.11 with a variable-length link-layer header without qos elements
21636  * in data+qos frames and with no FCS (sent as WIDS frames by Cisco standalone
21637  * APs).
21638  */
21639 static int
21640 dissect_ieee80211_noqos(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
21641 {
21642   struct ieee_802_11_phdr phdr;
21643
21644   /* Construct a pseudo-header to hand to the common code. */
21645   memset(&phdr, 0, sizeof(phdr));
21646   phdr.decrypted = FALSE;
21647   phdr.datapad = FALSE;
21648   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
21649   dissect_ieee80211_common(tvb, pinfo, tree, 0, &phdr);
21650   return tvb_captured_length(tvb);
21651 }
21652
21653
21654 /* ------------- */
21655 static guint
21656 retransmit_hash(gconstpointer k)
21657 {
21658   const retransmit_key *key = (const retransmit_key *)k;
21659   guint hash_val;
21660   int   i;
21661
21662   hash_val = 0;
21663   for (i = 0; i < 6; i++)
21664     hash_val += key->bssid[i];
21665
21666   for (i = 0; i < 6; i++)
21667     hash_val += key->src[i];
21668
21669   return hash_val;
21670 }
21671
21672 static gint
21673 retransmit_equal(gconstpointer k1, gconstpointer k2)
21674 {
21675   const retransmit_key *key1 = (const retransmit_key *)k1;
21676   const retransmit_key *key2 = (const retransmit_key *)k2;
21677
21678   return ((!memcmp(key1->bssid, key2->bssid, 6) && !memcmp(key1->src, key2->src, 6)) ? TRUE:FALSE);
21679 }
21680
21681 static guint
21682 frame_hash(gconstpointer k)
21683 {
21684   guint32 frame = GPOINTER_TO_UINT(k);
21685
21686   return frame;
21687 }
21688
21689 static gint
21690 frame_equal(gconstpointer k1, gconstpointer k2)
21691 {
21692   guint32 frame1 = GPOINTER_TO_UINT(k1);
21693   guint32 frame2 = GPOINTER_TO_UINT(k2);
21694
21695   return frame1==frame2;
21696 }
21697
21698 /*
21699  * EAPOL key description dissectors.
21700  */
21701 #define KEY_INFO_KEYDES_VERSION_MASK        0x0007
21702 #define KEY_INFO_KEY_TYPE_MASK              0x0008
21703 #define KEY_INFO_KEY_INDEX_MASK             0x0030
21704 #define KEY_INFO_INSTALL_MASK               0x0040
21705 #define KEY_INFO_KEY_ACK_MASK               0x0080
21706 #define KEY_INFO_KEY_MIC_MASK               0x0100
21707 #define KEY_INFO_SECURE_MASK                0x0200
21708 #define KEY_INFO_ERROR_MASK                 0x0400
21709 #define KEY_INFO_REQUEST_MASK               0x0800
21710 #define KEY_INFO_ENCRYPTED_KEY_DATA_MASK    0x1000
21711 #define KEY_INFO_SMK_MESSAGE_MASK           0x2000
21712
21713 #define KEYDES_VER_TYPE1        0x01
21714 #define KEYDES_VER_TYPE2        0x02
21715 #define KEYDES_VER_TYPE3        0x03
21716
21717 static const value_string keydes_version_vals[] = {
21718   { KEYDES_VER_TYPE1,     "RC4 Cipher, HMAC-MD5 MIC" },
21719   { KEYDES_VER_TYPE2,     "AES Cipher, HMAC-SHA1 MIC" },
21720   { KEYDES_VER_TYPE3,     "AES Cipher, AES-128-CMAC MIC" },
21721   { 0, NULL }
21722 };
21723
21724 static int proto_wlan_rsna_eapol = -1;
21725
21726 static int hf_wlan_rsna_eapol_wpa_keydes_msgnr = -1;
21727 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo = -1;
21728 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version = -1;
21729 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type = -1;
21730 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index = -1;
21731 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install = -1;
21732 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack = -1;
21733 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic = -1;
21734 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure = -1;
21735 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error = -1;
21736 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request = -1;
21737 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data = -1;
21738 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message = -1;
21739 static int hf_wlan_rsna_eapol_keydes_key_len = -1;
21740 static int hf_wlan_rsna_eapol_keydes_replay_counter = -1;
21741 static int hf_wlan_rsna_eapol_keydes_key_iv = -1;
21742 static int hf_wlan_rsna_eapol_wpa_keydes_nonce = -1;
21743 static int hf_wlan_rsna_eapol_wpa_keydes_rsc = -1;
21744 static int hf_wlan_rsna_eapol_wpa_keydes_id = -1;
21745 static int hf_wlan_rsna_eapol_wpa_keydes_mic = -1;
21746 static int hf_wlan_rsna_eapol_wpa_keydes_data_len = -1;
21747 static int hf_wlan_rsna_eapol_wpa_keydes_data = -1;
21748
21749 static gint ett_keyinfo = -1;
21750 static gint ett_wlan_rsna_eapol_keydes_data = -1;
21751
21752 static const true_false_string keyinfo_key_type_tfs = { "Pairwise Key", "Group Key" };
21753
21754 static int
21755 dissect_wlan_rsna_eapol_wpa_or_rsn_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
21756 {
21757   int         offset = 0;
21758   guint16     keyinfo;
21759   guint16     eapol_data_len;
21760   proto_tree *keydes_tree;
21761   proto_tree *ti = NULL;
21762   static const int * wlan_rsna_eapol_wpa_keydes_keyinfo[] = {
21763     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version,
21764     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type,
21765     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index,
21766     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install,
21767     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack,
21768     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic,
21769     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure,
21770     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error,
21771     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request,
21772     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data,
21773     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
21774     NULL
21775   };
21776   guint16 eapol_data_offset = 76;  /* 92 - 16 */
21777   guint16 eapol_key_mic_len = 0;
21778
21779   if (wlan_key_mic_len) {
21780     eapol_data_offset += wlan_key_mic_len;
21781     eapol_key_mic_len = wlan_key_mic_len;
21782   } else {
21783     eapol_data_offset = 92;
21784     eapol_key_mic_len = 16;
21785   }
21786
21787   /*
21788    * RSNA key descriptors.
21789    */
21790   eapol_data_len = tvb_get_ntohs(tvb, offset+eapol_data_offset);
21791   keyinfo = tvb_get_ntohs(tvb, offset);
21792   if (keyinfo & KEY_INFO_REQUEST_MASK) {
21793     col_set_str(pinfo->cinfo, COL_INFO, "Key (Request)");
21794     if (keyinfo & KEY_INFO_ERROR_MASK)
21795       col_set_str(pinfo->cinfo, COL_INFO, "Key (Request, Error)");
21796   } else if (keyinfo & KEY_INFO_KEY_TYPE_MASK) {
21797     guint16 masked;
21798     /* Windows is setting the Secure Bit on message 2 when rekeying, so we'll ignore it */
21799     masked = keyinfo &
21800       (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK);
21801
21802     switch (masked) {
21803     case KEY_INFO_KEY_ACK_MASK:
21804     {
21805       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 1);
21806
21807       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 1 of 4)");
21808       break;
21809     }
21810     case KEY_INFO_KEY_MIC_MASK:
21811       /* We check the key length to differentiate between message 2 and 4 and just hope that
21812       there are no strange implementations with key data and non-zero key length in message 4.
21813       According to the IEEE specification, sections 11.6.6.3 and 11.6.6.5 we should
21814       use the Secure Bit and/or the Nonce, but there are implementations ignoring the spec.
21815       The Secure Bit is incorrectly set on rekeys for Windows clients for Message 2 and the Nonce is non-zero
21816       in Message 4 in Bug 11994 (Apple?) */
21817       if (eapol_data_len) {
21818         ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 2);
21819
21820         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 2 of 4)");
21821       } else {
21822         ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 4);
21823
21824         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 4 of 4)");
21825       }
21826       break;
21827
21828     case (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK):
21829     {
21830       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 3);
21831
21832       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 3 of 4)");
21833       break;
21834     }
21835     }
21836   } else {
21837     if (keyinfo & KEY_INFO_KEY_ACK_MASK) {
21838       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 1);
21839
21840       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 1 of 2)");
21841     } else {
21842       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 2);
21843
21844       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 2 of 2)");
21845     }
21846   }
21847
21848   PROTO_ITEM_SET_GENERATED(ti);
21849
21850   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_wlan_rsna_eapol_wpa_keydes_keyinfo,
21851                                     ett_keyinfo, wlan_rsna_eapol_wpa_keydes_keyinfo,
21852                                     ENC_BIG_ENDIAN, BMT_NO_APPEND);
21853   offset += 2;
21854
21855   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_len, tvb, offset,
21856                       2, ENC_BIG_ENDIAN);
21857   offset += 2;
21858   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_replay_counter, tvb,
21859                       offset, 8, ENC_BIG_ENDIAN);
21860   offset += 8;
21861   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_nonce, tvb, offset,
21862                       32, ENC_NA);
21863   offset += 32;
21864   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_iv, tvb,
21865                       offset, 16, ENC_NA);
21866   offset += 16;
21867   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_rsc, tvb, offset,
21868                       8, ENC_NA);
21869   offset += 8;
21870   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_id, tvb, offset, 8,
21871                       ENC_NA);
21872   offset += 8;
21873   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_mic, tvb, offset,
21874                       eapol_key_mic_len, ENC_NA);
21875   offset += eapol_key_mic_len;
21876   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data_len, tvb,
21877                       offset, 2, ENC_BIG_ENDIAN);
21878   offset += 2;
21879   if (eapol_data_len != 0) {
21880     ti = proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data,
21881                              tvb, offset, eapol_data_len, ENC_NA);
21882     if ((keyinfo & KEY_INFO_ENCRYPTED_KEY_DATA_MASK) ||
21883         !(keyinfo & KEY_INFO_KEY_TYPE_MASK)) {
21884       /* RSN: EAPOL-Key Key Data is encrypted.
21885        * WPA: Group Keys use encrypted Key Data.
21886        * Cannot parse this without knowing the key.
21887        * IEEE 802.11i-2004 8.5.2.
21888        */
21889     } else {
21890       keydes_tree = proto_item_add_subtree(ti, ett_wlan_rsna_eapol_keydes_data);
21891       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, keydes_tree,
21892                                        tvb_reported_length_remaining(tvb, offset),
21893                                        -1, NULL);
21894     }
21895   }
21896   return tvb_captured_length(tvb);
21897 }
21898
21899 /* It returns the algorithm used for decryption and the header and trailer lengths. */
21900 static tvbuff_t *
21901 try_decrypt(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer, PDOT11DECRYPT_KEY_ITEM used_key)
21902 {
21903   const guint8      *enc_data;
21904   tvbuff_t          *decr_tvb = NULL;
21905   guint32            dec_caplen;
21906   guchar             dec_data[DOT11DECRYPT_MAX_CAPLEN];
21907
21908   if (!enable_decryption)
21909     return NULL;
21910
21911   /* get the entire packet                                  */
21912   enc_data = tvb_get_ptr(tvb, 0, len+offset);
21913
21914   /*  process packet with Dot11Decrypt                              */
21915   if (Dot11DecryptPacketProcess(&dot11decrypt_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen,
21916                             used_key, FALSE)==DOT11DECRYPT_RET_SUCCESS)
21917   {
21918     guint8 *tmp;
21919     *algorithm=used_key->KeyType;
21920     switch (*algorithm) {
21921       case DOT11DECRYPT_KEY_TYPE_WEP:
21922         *sec_header=DOT11DECRYPT_WEP_HEADER;
21923         *sec_trailer=DOT11DECRYPT_WEP_TRAILER;
21924         break;
21925       case DOT11DECRYPT_KEY_TYPE_CCMP:
21926         *sec_header=DOT11DECRYPT_RSNA_HEADER;
21927         *sec_trailer=DOT11DECRYPT_CCMP_TRAILER;
21928         break;
21929       case DOT11DECRYPT_KEY_TYPE_TKIP:
21930         *sec_header=DOT11DECRYPT_RSNA_HEADER;
21931         *sec_trailer=DOT11DECRYPT_TKIP_TRAILER;
21932         break;
21933       default:
21934         return NULL;
21935     }
21936
21937     /* allocate buffer for decrypted payload                      */
21938     tmp = (guint8 *)wmem_memdup(pinfo->pool, dec_data+offset, dec_caplen-offset);
21939
21940     len = dec_caplen-offset;
21941
21942     /* decrypt successful, let's set up a new data tvb.              */
21943     decr_tvb = tvb_new_child_real_data(tvb, tmp, len, len);
21944   }
21945
21946   return decr_tvb;
21947 }
21948
21949 /* Collect our WEP and WPA keys */
21950 static void
21951 set_dot11decrypt_keys(void)
21952 {
21953   guint                     i;
21954   DOT11DECRYPT_KEYS_COLLECTION  *keys = g_new(DOT11DECRYPT_KEYS_COLLECTION, 1);
21955   GByteArray                *bytes = NULL;
21956
21957   keys->nKeys = 0;
21958
21959   for (i = 0; (uat_wep_key_records != NULL) && (i < num_wepkeys_uat) && (i < MAX_ENCRYPTION_KEYS); i++)
21960   {
21961     decryption_key_t *dk;
21962     dk = parse_key_string(uat_wep_key_records[i].string, uat_wep_key_records[i].key);
21963
21964     if (dk != NULL)
21965     {
21966       DOT11DECRYPT_KEY_ITEM          key;
21967       if (dk->type == DOT11DECRYPT_KEY_TYPE_WEP)
21968       {
21969         gboolean res;
21970         key.KeyType = DOT11DECRYPT_KEY_TYPE_WEP;
21971
21972         bytes = g_byte_array_new();
21973         res = hex_str_to_bytes(dk->key->str, bytes, FALSE);
21974
21975         if (dk->key->str && res && (bytes->len > 0) && (bytes->len <= DOT11DECRYPT_WEP_KEY_MAXLEN))
21976         {
21977           /*
21978            * WEP key is correct (well, the can be even or odd, so it is not
21979            * a real check, I think... is a check performed somewhere in the
21980            * Dot11Decrypt function???)
21981            */
21982           memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
21983           key.KeyData.Wep.WepKeyLen = bytes->len;
21984           keys->Keys[keys->nKeys] = key;
21985           keys->nKeys += 1;
21986         }
21987       }
21988       else if (dk->type == DOT11DECRYPT_KEY_TYPE_WPA_PWD)
21989       {
21990         key.KeyType = DOT11DECRYPT_KEY_TYPE_WPA_PWD;
21991
21992         /* XXX - This just lops the end if the key off if it's too long.
21993          *       Should we handle this more gracefully? */
21994         g_strlcpy(key.UserPwd.Passphrase, dk->key->str, DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN+1);
21995
21996         key.UserPwd.SsidLen = 0;
21997         if ((dk->ssid != NULL) && (dk->ssid->len <= DOT11DECRYPT_WPA_SSID_MAX_LEN))
21998         {
21999           memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
22000           key.UserPwd.SsidLen = dk->ssid->len;
22001         }
22002
22003         keys->Keys[keys->nKeys] = key;
22004         keys->nKeys += 1;
22005       }
22006       else if (dk->type == DOT11DECRYPT_KEY_TYPE_WPA_PSK)
22007       {
22008         key.KeyType = DOT11DECRYPT_KEY_TYPE_WPA_PSK;
22009
22010         bytes = g_byte_array_new();
22011         hex_str_to_bytes(dk->key->str, bytes, FALSE);
22012
22013         /* XXX - Pass the correct array of bytes... */
22014         if (bytes->len <= DOT11DECRYPT_WPA_PSK_LEN) {
22015           memcpy(key.KeyData.Wpa.Psk, bytes->data, bytes->len);
22016
22017           keys->Keys[keys->nKeys] = key;
22018           keys->nKeys += 1;
22019         }
22020       }
22021       free_key_string(dk);
22022       if (bytes) {
22023         g_byte_array_free(bytes, TRUE);
22024         bytes = NULL;
22025       }
22026     }
22027   }
22028
22029   /* Now set the keys */
22030   Dot11DecryptSetKeys(&dot11decrypt_ctx, keys->Keys, keys->nKeys);
22031   g_free(keys);
22032 }
22033
22034 static void
22035 init_wepkeys(void)
22036 {
22037
22038   /*
22039    * XXX - Dot11Decrypt - That God sends it to us beautiful (che dio ce la mandi bona)
22040    * The next lines will add a key to the Dot11Decrypt context. The keystring will be added
22041    * to the old WEP array too, but we don't care, because the packets will come here
22042    * already decrypted... One of these days we will fix this too
22043    */
22044   set_dot11decrypt_keys();
22045 }
22046
22047 /*
22048  * This code had been taken from AirSnort crack.c function classify()
22049  * Permission granted by snax <at> shmoo dot com
22050  * weak_iv - determine which key byte an iv is useful in resolving
22051  * parm     - p, pointer to the first byte of an IV
22052  * return   -  n - this IV is weak for byte n of a WEP key
22053  *            -1 - this IV is not weak for any key bytes
22054  *
22055  * This function tests for IVs that are known to satisfy the criteria
22056  * for a weak IV as specified in FMS section 7.1
22057  *
22058  */
22059 static int
22060 weak_iv(guchar *iv)
22061 {
22062   guchar sum, k;
22063
22064   if ((iv[1] == 255) && (iv[0] > 2) && (iv[0] < 16)) {
22065     return iv[0] -3;
22066   }
22067
22068   sum = iv[0] + iv[1];
22069   if (sum == 1) {
22070     if (iv[2] <= 0x0a) {
22071       return iv[2] +2;
22072     }
22073     else if (iv[2] == 0xff) {
22074       return 0;
22075     }
22076   }
22077   k = 0xfe - iv[2];
22078   if ((sum == k)  && ((iv[2] >= 0xf2) && (iv[2] <= 0xfe) && (iv[2] != 0xfd))) {
22079     return k;
22080   }
22081   return -1;
22082 }
22083
22084 static void
22085 wlan_retransmit_init(void)
22086 {
22087   if (fc_analyse_retransmit_table) {
22088     g_hash_table_destroy(fc_analyse_retransmit_table);
22089     fc_analyse_retransmit_table = NULL;
22090   }
22091
22092   if (fc_first_frame_table) {
22093     g_hash_table_destroy(fc_first_frame_table);
22094     fc_first_frame_table = NULL;
22095   }
22096
22097   if (wlan_subdissector)
22098     return;
22099
22100   fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
22101   fc_first_frame_table = g_hash_table_new(frame_hash, frame_equal);
22102
22103 }
22104
22105 static int
22106 dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22107 {
22108   int         offset = 0;
22109   guint8      type;
22110   int         tagged_parameter_tree_len;
22111   proto_tree *tagged_tree;
22112
22113   type = tvb_get_guint8(tvb, offset);
22114   proto_tree_add_item(tree, hf_ieee80211_data_encap_payload_type, tvb, offset,
22115                       1, ENC_LITTLE_ENDIAN);
22116   offset += 1;
22117   switch (type) {
22118   case 1:
22119     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRB");
22120     /* TODO: IEEE 802.11r */
22121     break;
22122   case 2:
22123     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
22124     col_clear(pinfo->cinfo, COL_INFO);
22125     offset += add_ff_action(tree, tvb, pinfo, offset);
22126     tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
22127     if (tagged_parameter_tree_len > 0) {
22128       tagged_tree = get_tagged_parameter_tree(tree, tvb, offset,
22129                                               tagged_parameter_tree_len);
22130       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
22131                                        tagged_parameter_tree_len, -1, NULL);
22132     }
22133     break;
22134   }
22135   return tvb_captured_length(tvb);
22136 }
22137
22138 void
22139 proto_register_ieee80211(void)
22140 {
22141
22142   static hf_register_info hf[] = {
22143     {&hf_ieee80211_fc_field,
22144      {"Frame Control Field", "wlan.fc",
22145       FT_UINT16, BASE_HEX, NULL, 0,
22146       "MAC Frame control", HFILL }},
22147
22148     {&hf_ieee80211_fc_proto_version,
22149      {"Version", "wlan.fc.version",
22150       FT_UINT8, BASE_DEC, NULL, 0x03,
22151       "MAC Protocol version", HFILL }},  /* 0 */
22152
22153     {&hf_ieee80211_fc_frame_type,
22154      {"Type", "wlan.fc.type",
22155       FT_UINT8, BASE_DEC, VALS(frame_type), 0x0C,
22156       "Frame type", HFILL }},
22157
22158     {&hf_ieee80211_fc_frame_subtype,
22159      {"Subtype", "wlan.fc.subtype",
22160       FT_UINT8, BASE_DEC, NULL, 0xF0,
22161       "Frame subtype", HFILL }},  /* 2 */
22162
22163     {&hf_ieee80211_fc_frame_type_subtype,
22164      {"Type/Subtype", "wlan.fc.type_subtype",
22165       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &frame_type_subtype_vals_ext, 0x0,
22166       "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
22167
22168     {&hf_ieee80211_fc_frame_extension,
22169      {"Control Frame Extension", "wlan.fc.extension",
22170       FT_UINT8, BASE_DEC, NULL, 0,
22171       NULL, HFILL }},
22172
22173     {&hf_ieee80211_fc_flags,
22174      {"Flags", "wlan.flags",
22175       FT_UINT8, BASE_HEX, NULL, 0,
22176       NULL, HFILL }},
22177
22178     {&hf_ieee80211_fc_data_ds,
22179      {"DS status", "wlan.fc.ds",
22180       FT_UINT8, BASE_HEX, VALS(tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
22181       "Data-frame DS-traversal status", HFILL }},  /* 3 */
22182
22183     {&hf_ieee80211_fc_to_ds,
22184      {"To DS", "wlan.fc.tods",
22185       FT_BOOLEAN, 8, TFS(&tods_flag), FLAG_TO_DS,
22186       "To DS flag", HFILL }},    /* 4 */
22187
22188     {&hf_ieee80211_fc_from_ds,
22189      {"From DS", "wlan.fc.fromds",
22190       FT_BOOLEAN, 8, TFS(&fromds_flag), FLAG_FROM_DS,
22191       "From DS flag", HFILL }},    /* 5 */
22192
22193     {&hf_ieee80211_fc_more_frag,
22194      {"More Fragments", "wlan.fc.frag",
22195       FT_BOOLEAN, 8, TFS(&more_fragments), FLAG_MORE_FRAGMENTS,
22196       "More Fragments flag", HFILL }},  /* 6 */
22197
22198     {&hf_ieee80211_fc_retry,
22199      {"Retry", "wlan.fc.retry",
22200       FT_BOOLEAN, 8, TFS(&retry_flags), FLAG_RETRY,
22201       "Retransmission flag", HFILL }},
22202
22203     { &hf_ieee80211_fc_analysis_retransmission,
22204      {"Retransmission", "wlan.analysis.retransmission",
22205       FT_NONE, BASE_NONE, NULL, 0x0,
22206       "This frame is a suspected wireless retransmission", HFILL }},
22207
22208     { &hf_ieee80211_fc_analysis_retransmission_frame,
22209      {"Retransmission of frame", "wlan.analysis.retransmission_frame",
22210       FT_FRAMENUM, BASE_NONE, NULL, 0x0,
22211       "This is a retransmission of frame #", HFILL }},
22212
22213     {&hf_ieee80211_fc_pwr_mgt,
22214      {"PWR MGT", "wlan.fc.pwrmgt",
22215       FT_BOOLEAN, 8, TFS(&pm_flags), FLAG_POWER_MGT,
22216       "Power management status", HFILL }},
22217
22218     {&hf_ieee80211_fc_more_data,
22219      {"More Data", "wlan.fc.moredata",
22220       FT_BOOLEAN, 8, TFS(&md_flags), FLAG_MORE_DATA,
22221       "More data flag", HFILL }},
22222
22223     {&hf_ieee80211_fc_protected,
22224      {"Protected flag", "wlan.fc.protected",
22225       FT_BOOLEAN, 8, TFS(&protected_flags), FLAG_PROTECTED,
22226       NULL, HFILL }},
22227
22228     {&hf_ieee80211_fc_order,
22229      {"Order flag", "wlan.fc.order",
22230       FT_BOOLEAN, 8, TFS(&order_flags), FLAG_ORDER,
22231       "Strictly ordered flag", HFILL }},
22232
22233     {&hf_ieee80211_assoc_id,
22234      {"Association ID", "wlan.aid",
22235       FT_UINT16, BASE_DEC, NULL, 0x3FFF,
22236       NULL, HFILL }},
22237
22238     {&hf_ieee80211_did_duration,
22239      {"Duration", "wlan.duration",
22240       FT_UINT16, BASE_DEC, NULL, 0x7FFF,
22241       NULL, HFILL }},
22242
22243     {&hf_ieee80211_addr_da,
22244      {"Destination address", "wlan.da",
22245       FT_ETHER, BASE_NONE, NULL, 0,
22246       "Destination Hardware Address", HFILL }},
22247
22248     { &hf_ieee80211_addr_da_resolved,
22249       {"Destination address (resolved)", "wlan.da_resolved", FT_STRING,
22250         BASE_NONE, NULL, 0x0,
22251         "Destination Hardware Address (resolved)", HFILL }},
22252
22253     {&hf_ieee80211_addr_sa,
22254      {"Source address", "wlan.sa",
22255       FT_ETHER, BASE_NONE, NULL, 0,
22256       "Source Hardware Address", HFILL }},
22257
22258     { &hf_ieee80211_addr_sa_resolved,
22259       {"Source address (resolved)", "wlan.sa_resolved", FT_STRING,
22260        BASE_NONE, NULL, 0x0,
22261        "Source Hardware Address (resolved)", HFILL }},
22262
22263     { &hf_ieee80211_addr,
22264       {"Hardware address", "wlan.addr",
22265        FT_ETHER, BASE_NONE, NULL, 0,
22266        "SA, DA, BSSID, RA or TA Hardware Address", HFILL }},
22267
22268     { &hf_ieee80211_addr_resolved,
22269       { "Hardware address (resolved)", "wlan.addr_resolved", FT_STRING,
22270         BASE_NONE, NULL, 0x0,
22271         "SA, DA, BSSID, RA or TA Hardware Address (resolved)", HFILL }},
22272
22273     {&hf_ieee80211_addr_ra,
22274      {"Receiver address", "wlan.ra",
22275       FT_ETHER, BASE_NONE, NULL, 0,
22276       "Receiving Station Hardware Address", HFILL }},
22277
22278     { &hf_ieee80211_addr_ra_resolved,
22279       {"Receiver address (resolved)", "wlan.ra_resolved", FT_STRING, BASE_NONE,
22280         NULL, 0x0, "Receiving Station Hardware Address (resolved)", HFILL }},
22281
22282     {&hf_ieee80211_addr_ta,
22283      {"Transmitter address", "wlan.ta",
22284       FT_ETHER, BASE_NONE, NULL, 0,
22285       "Transmitting Station Hardware Address", HFILL }},
22286
22287     { &hf_ieee80211_addr_ta_resolved,
22288       {"Transmitter address (resolved)", "wlan.ta_resolved", FT_STRING,
22289         BASE_NONE, NULL, 0x0,
22290         "Transmitting Station Hardware Address (resolved)", HFILL }},
22291
22292     {&hf_ieee80211_addr_bssid,
22293      {"BSS Id", "wlan.bssid",
22294       FT_ETHER, BASE_NONE, NULL, 0,
22295       "Basic Service Set ID", HFILL }},
22296
22297     { &hf_ieee80211_addr_bssid_resolved,
22298       {"BSS Id (resolved)", "wlan.bssid_resolved", FT_STRING, BASE_NONE, NULL,
22299         0x0, "Basic Service Set ID (resolved)", HFILL }},
22300
22301     {&hf_ieee80211_addr_staa,
22302      {"STA address", "wlan.staa",
22303       FT_ETHER, BASE_NONE, NULL, 0,
22304       "Station Hardware Address", HFILL }},
22305
22306     { &hf_ieee80211_addr_staa_resolved,
22307       {"STA address (resolved)", "wlan.staa_resolved", FT_STRING, BASE_NONE, NULL,
22308         0x0, "Station Hardware Address (resolved)", HFILL }},
22309
22310     {&hf_ieee80211_frag_number,
22311      {"Fragment number", "wlan.frag",
22312       FT_UINT16, BASE_DEC, NULL, 0x000F,
22313       NULL, HFILL }},
22314
22315     {&hf_ieee80211_seq_number,
22316      {"Sequence number", "wlan.seq",
22317       FT_UINT16, BASE_DEC, NULL, 0xFFF0,
22318       NULL, HFILL }},
22319
22320     {&hf_ieee80211_mesh_control_field,
22321      {"Mesh Control Field", "wlan.mesh.control_field",
22322       FT_NONE, BASE_NONE, NULL, 0,
22323       NULL, HFILL }},
22324
22325     {&hf_ieee80211_qos,
22326      {"Qos Control", "wlan.qos",
22327       FT_UINT16, BASE_HEX, NULL, 0,
22328       NULL, HFILL }},
22329
22330     {&hf_ieee80211_qos_tid,
22331      {"TID", "wlan.qos.tid",
22332       FT_UINT16, BASE_DEC, NULL, 0x000F,
22333       NULL, HFILL }},
22334
22335     {&hf_ieee80211_qos_priority,
22336      {"Priority", "wlan.qos.priority",
22337       FT_UINT16, BASE_DEC, VALS(ieee80211_qos_tags_acs), 0x0007,
22338       "802.1D Tag", HFILL }},
22339
22340     {&hf_ieee80211_qos_eosp,
22341      {"EOSP", "wlan.qos.eosp",
22342       FT_BOOLEAN, 16, TFS(&eosp_flag), QOS_FLAG_EOSP,
22343       "EOSP Field", HFILL }},
22344
22345     {&hf_ieee80211_qos_bit4,
22346      {"QoS bit 4", "wlan.qos.bit4",
22347       FT_BOOLEAN, 16, TFS(&bit4_flag), QOS_FLAG_EOSP,
22348       NULL, HFILL }},
22349
22350     {&hf_ieee80211_qos_ack_policy,
22351      {"Ack Policy", "wlan.qos.ack",
22352       FT_UINT16, BASE_HEX,  VALS(ack_policy), 0x0060,
22353       NULL, HFILL }},
22354
22355     {&hf_ieee80211_qos_amsdu_present,
22356      {"Payload Type", "wlan.qos.amsdupresent",
22357       FT_BOOLEAN, 16, TFS(&ieee80211_qos_amsdu_present_flag), 0x0080,
22358       NULL, HFILL }},
22359
22360     {&hf_ieee80211_qos_txop_limit,
22361      {"TXOP Limit", "wlan.qos.txop_limit",
22362       FT_UINT16, BASE_DEC, NULL, 0xFF00,
22363       NULL, HFILL }},
22364
22365     {&hf_ieee80211_qos_ps_buf_state,
22366      {"QAP PS Buffer State", "wlan.qos.ps_buf_state",
22367       FT_UINT16, BASE_HEX, NULL, 0xFF00,
22368       NULL, HFILL }},
22369
22370     {&hf_ieee80211_qos_buf_state_indicated,
22371      {"Buffer State Indicated", "wlan.qos.buf_state_indicated",
22372       FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
22373       NULL, HFILL }},
22374
22375     {&hf_ieee80211_qos_highest_pri_buf_ac,
22376      {"Highest-Priority Buffered AC", "wlan.qos.highest_pri_buf_ac",
22377        FT_UINT16, BASE_DEC, VALS(wme_acs), 0x0C00,
22378       NULL, HFILL }},
22379
22380     {&hf_ieee80211_qos_qap_buf_load,
22381      {"QAP Buffered Load", "wlan.qos.qap_buf_load",
22382       FT_UINT16, BASE_DEC, NULL, 0xF000,
22383       NULL, HFILL }},
22384
22385     {&hf_ieee80211_qos_txop_dur_req,
22386      {"TXOP Duration Requested", "wlan.qos.txop_dur_req",
22387       FT_UINT16, BASE_DEC, NULL, 0xFF00,
22388       NULL, HFILL }},
22389
22390     {&hf_ieee80211_qos_queue_size,
22391      {"Queue Size", "wlan.qos.queue_size",
22392       FT_UINT16, BASE_DEC, NULL, 0xFF00,
22393       NULL, HFILL }},
22394
22395     {&hf_ieee80211_fcs,
22396      {"Frame check sequence", "wlan.fcs",
22397       FT_UINT32, BASE_HEX, NULL, 0,
22398       "Frame Check Sequence (FCS)", HFILL }},
22399
22400     {&hf_ieee80211_fcs_status,
22401      {"FCS Status", "wlan.fcs.status",
22402       FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0,
22403       NULL, HFILL }},
22404
22405     {&hf_ieee80211_fragment_overlap,
22406       {"Fragment overlap", "wlan.fragment.overlap",
22407        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
22408        "Fragment overlaps with other fragments", HFILL }},
22409
22410     {&hf_ieee80211_fragment_overlap_conflict,
22411       {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
22412        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
22413        "Overlapping fragments contained conflicting data", HFILL }},
22414
22415     {&hf_ieee80211_fragment_multiple_tails,
22416       {"Multiple tail fragments found", "wlan.fragment.multipletails",
22417        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
22418        "Several tails were found when defragmenting the packet", HFILL }},
22419
22420     {&hf_ieee80211_fragment_too_long_fragment,
22421       {"Fragment too long", "wlan.fragment.toolongfragment",
22422        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
22423        "Fragment contained data past end of packet", HFILL }},
22424
22425     {&hf_ieee80211_fragment_error,
22426       {"Defragmentation error", "wlan.fragment.error",
22427        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
22428        "Defragmentation error due to illegal fragments", HFILL }},
22429
22430     {&hf_ieee80211_fragment_count,
22431       {"Fragment count", "wlan.fragment.count",
22432        FT_UINT32, BASE_DEC, NULL, 0x0,
22433        NULL, HFILL }},
22434
22435     {&hf_ieee80211_fragment,
22436       {"802.11 Fragment", "wlan.fragment",
22437        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
22438        NULL, HFILL }},
22439
22440     {&hf_ieee80211_fragments,
22441       {"802.11 Fragments", "wlan.fragments",
22442        FT_NONE, BASE_NONE, NULL, 0x0,
22443        NULL, HFILL }},
22444
22445     {&hf_ieee80211_reassembled_in,
22446       {"Reassembled 802.11 in frame", "wlan.reassembled_in",
22447        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
22448        "This 802.11 packet is reassembled in this frame", HFILL }},
22449
22450     {&hf_ieee80211_reassembled_length,
22451       {"Reassembled 802.11 length", "wlan.reassembled.length",
22452        FT_UINT32, BASE_DEC, NULL, 0x0,
22453        "The total length of the reassembled payload", HFILL }},
22454
22455     {&hf_ieee80211_wep_iv,
22456      {"Initialization Vector", "wlan.wep.iv",
22457       FT_UINT24, BASE_HEX, NULL, 0,
22458       NULL, HFILL }},
22459
22460     {&hf_ieee80211_wep_iv_weak,
22461      {"Weak IV", "wlan.wep.weakiv",
22462       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
22463        NULL, HFILL}},
22464
22465     {&hf_ieee80211_tkip_extiv,
22466      {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv",
22467       FT_STRING, BASE_NONE, NULL, 0,
22468       "TKIP Extended Initialization Vector", HFILL }},
22469
22470     {&hf_ieee80211_ccmp_extiv,
22471      {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv",
22472       FT_STRING, BASE_NONE, NULL, 0,
22473       "CCMP Extended Initialization Vector", HFILL }},
22474
22475     {&hf_ieee80211_wep_key,
22476      {"Key Index", "wlan.wep.key",
22477       FT_UINT8, BASE_DEC, NULL, 0,
22478       NULL, HFILL }},
22479
22480     {&hf_ieee80211_wep_icv,
22481      {"WEP ICV", "wlan.wep.icv",
22482       FT_UINT32, BASE_HEX, NULL, 0,
22483       NULL, HFILL }},
22484
22485     {&hf_ieee80211_fc_analysis_pmk,
22486      {"PMK", "wlan.analysis.pmk",
22487       FT_STRING, BASE_NONE, NULL, 0x0,
22488       NULL, HFILL }},
22489
22490     {&hf_ieee80211_fc_analysis_tk,
22491      {"TK", "wlan.analysis.tk",
22492       FT_STRING, BASE_NONE, NULL, 0x0,
22493       NULL, HFILL }},
22494
22495     {&hf_ieee80211_fc_analysis_gtk,
22496      {"GTK", "wlan.analysis.gtk",
22497       FT_STRING, BASE_NONE, NULL, 0x0,
22498       NULL, HFILL }},
22499
22500     {&hf_ieee80211_block_ack_control,
22501      {"Block Ack Control", "wlan.ba.control",
22502       FT_UINT16, BASE_HEX, NULL, 0,
22503       NULL, HFILL }},
22504
22505     {&hf_ieee80211_block_ack_control_ack_policy,
22506      {"BA Ack Policy", "wlan.ba.control.ackpolicy",
22507       FT_BOOLEAN, 16, TFS(&ieee80211_block_ack_control_ack_policy_flag), 0x01,
22508       "Block Ack Request (BAR) Ack Policy", HFILL }},
22509
22510     {&hf_ieee80211_block_ack_control_type,
22511      {"BA Type", "wlan.ba.control.ba_type",
22512       FT_UINT16, BASE_HEX, VALS(block_ack_type_vals), 0x001e, NULL, HFILL }},
22513
22514     {&hf_ieee80211_block_ack_control_reserved,
22515      {"Reserved", "wlan.ba.control.reserved",
22516       FT_UINT16, BASE_HEX, NULL, 0x0fe0,
22517       NULL, HFILL }},
22518
22519     {&hf_ieee80211_block_ack_control_tid_info,
22520      {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
22521       FT_UINT16, BASE_HEX, NULL, 0xf000,
22522       "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
22523
22524     {&hf_ieee80211_block_ack_multi_tid_reserved,
22525      {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
22526       FT_UINT16, BASE_HEX, 0, 0x0fff,
22527       NULL, HFILL }},
22528
22529     {&hf_ieee80211_block_ack_multi_tid_value,
22530      {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
22531       FT_UINT16, BASE_HEX, 0, 0xf000,
22532       NULL, HFILL }},
22533
22534     {&hf_ieee80211_block_ack_bitmap,
22535      {"Block Ack Bitmap", "wlan.ba.bm",
22536       FT_BYTES, BASE_NONE, NULL, 0,
22537       NULL, HFILL }},
22538
22539     /* Used for Extended compressed BlockAck */
22540     {&hf_ieee80211_block_ack_RBUFCAP,
22541      {"Block Ack RBUFCAP", "wlan.ba.RBUFCAP",
22542       FT_BOOLEAN, BASE_DEC, NULL, 0,
22543       NULL, HFILL }},
22544
22545     {&hf_ieee80211_block_ack_bitmap_missing_frame,
22546      {"Missing frame", "wlan.ba.bm.missing_frame",
22547       FT_UINT32, BASE_DEC, NULL, 0,
22548       NULL, HFILL }},
22549
22550     {&hf_ieee80211_block_ack_gcr_addr,
22551      {"GCR Group Address", "wlan.ba.gcr_group_addr",
22552       FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
22553
22554     {&hf_ieee80211_beamform_feedback_seg_retrans_bitmap,
22555      {"Feedback segment Retansmission Bitmap", "wlan.beamform.feedback_seg_retrans_bitmap",
22556       FT_UINT8, BASE_HEX, NULL, 0,
22557       NULL, HFILL }},
22558
22559     {&hf_ieee80211_vht_ndp_annc_token,
22560      {"Sounding Dialog Token", "wlan.vht_ndp.token",
22561       FT_UINT8, BASE_HEX, NULL, 0,
22562       NULL, HFILL }},
22563
22564     {&hf_ieee80211_vht_ndp_annc_token_number,
22565      {"Sounding Dialog Token Number", "wlan.vht_ndp.token.number",
22566       FT_UINT8, BASE_DEC, NULL, 0xFC,
22567       NULL, HFILL }},
22568
22569     {&hf_ieee80211_vht_ndp_annc_he_subfield,
22570      {"HE", "wlan.vht_ndp.token.he",
22571       FT_BOOLEAN, 8, TFS(&he_ndp_annc_he_subfield_vals), 0x02, NULL, HFILL }},
22572
22573     {&hf_ieee80211_vht_ndp_annc_token_reserved,
22574      {"Reserved", "wlan.vht_ndp.token.reserved",
22575       FT_UINT8, BASE_HEX, NULL, 0x01,
22576       NULL, HFILL }},
22577
22578     {&hf_ieee80211_vht_ndp_annc_sta_info,
22579      {"STA Info", "wlan.vht_ndp.sta_info",
22580       FT_UINT16, BASE_HEX, NULL, 0,
22581       NULL, HFILL }},
22582
22583     {&hf_ieee80211_vht_ndp_annc_sta_info_aid12,
22584      {"AID12", "wlan.vht_ndp.sta_info.aid12",
22585       FT_UINT16, BASE_HEX, NULL, 0x0FFF,
22586       "12 least significant bits of the AID of the target STA", HFILL }},
22587
22588     {&hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
22589      {"Feedback Type", "wlan.vht_ndp.sta_info.feedback_type",
22590       FT_BOOLEAN, 16, TFS(&vht_ndp_annc_sta_info_feedback_type), 0x1000,
22591       NULL, HFILL }},
22592
22593     {&hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
22594      {"Nc Index", "wlan.vht_ndp.sta_info.nc_index",
22595       FT_UINT16, BASE_DEC, VALS(num_plus_one_3bit_flag), 0xE000,
22596       NULL, HFILL }},
22597
22598     {&hf_ieee80211_vht_ndp_annc_sta_info_reserved,
22599      {"Reserved", "wlan.vht_ndp.sta_info.reserved",
22600       FT_UINT16, BASE_HEX, NULL, 0xE000,
22601       NULL, HFILL }},
22602
22603     {&hf_ieee80211_data_encap_payload_type,
22604      {"Payload Type", "wlan.data_encap.payload_type",
22605       FT_UINT8, BASE_DEC, VALS(ieee80211_data_encap_payload_types), 0,
22606       NULL, HFILL }},
22607
22608     {&hf_ieee80211_ff_tdls_action_code,
22609      {"Action code", "wlan.fixed.action_code",
22610       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tdls_action_codes_ext, 0,
22611       "Management action code", HFILL }},
22612
22613     {&hf_ieee80211_ff_target_channel,
22614      {"Target Channel", "wlan.fixed.target_channel",
22615       FT_UINT8, BASE_DEC, NULL, 0,
22616       NULL, HFILL }},
22617
22618     {&hf_ieee80211_ff_operating_class,
22619      {"Operating Class", "wlan.fixed.operating_class",
22620       FT_UINT8, BASE_DEC, NULL, 0,
22621       NULL, HFILL }},
22622
22623     {&hf_ieee80211_ff_wnm_action_code,
22624      {"Action code", "wlan.fixed.action_code",
22625       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_action_codes_ext, 0,
22626       "Management action code", HFILL }},
22627
22628     {&hf_ieee80211_ff_unprotected_wnm_action_code,
22629      {"Action code", "wlan.fixed.action_code",
22630       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &unprotected_wnm_action_codes_ext, 0,
22631       "Management action code", HFILL }},
22632
22633     {&hf_ieee80211_ff_key_data,
22634      {"Key Data", "wlan.fixed.key_data",
22635       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
22636
22637     {&hf_ieee80211_ff_key_data_length,
22638      {"Key Data Length", "wlan.fixed.key_data_length",
22639       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22640
22641     {&hf_ieee80211_ff_wnm_notification_type,
22642      {"WNM-Notification type", "wlan.fixed.wnm_notification_type",
22643       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_notification_types_ext, 0,
22644       NULL, HFILL }},
22645
22646     {&hf_ieee80211_ff_rm_action_code,
22647      {"Action code", "wlan.rm.action_code",
22648       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &rm_action_codes_ext, 0,
22649       "Radio Measurement Action", HFILL }},
22650
22651     {&hf_ieee80211_ff_rm_dialog_token,
22652      {"Dialog token", "wlan.rm.dialog_token",
22653       FT_UINT8, BASE_DEC, NULL, 0,
22654       "Non-zero Dialog Token identifies request/report transaction", HFILL }},
22655
22656     {&hf_ieee80211_ff_rm_repetitions,
22657      {"Repetitions", "wlan.rm.repetitions",
22658       FT_UINT16, BASE_DEC, NULL, 0,
22659       "Numer of Repetitions, 65535 indicates repeat until cancellation", HFILL }},
22660
22661     {&hf_ieee80211_ff_rm_tx_power,
22662      {"Transmit Power Used", "wlan.rm.tx_power",
22663       FT_INT8, BASE_DEC, NULL, 0,
22664       NULL, HFILL }},
22665
22666     {&hf_ieee80211_ff_rm_max_tx_power,
22667      {"Max Transmit Power", "wlan.rm.max_tx_power",
22668       FT_INT8, BASE_DEC, NULL, 0,
22669       NULL, HFILL }},
22670
22671     {&hf_ieee80211_ff_tpc,
22672      {"TPC Report", "wlan.rm.tpc",
22673       FT_NONE, BASE_NONE, NULL, 0,
22674       NULL, HFILL }},
22675
22676     {&hf_ieee80211_ff_tpc_element_id,
22677      {"TPC Element ID", "wlan.rm.tpc.element_id",
22678       FT_UINT8, BASE_DEC, NULL, 0,
22679       NULL, HFILL }},
22680
22681     {&hf_ieee80211_ff_tpc_length,
22682      {"TPC Length", "wlan.rm.tpc.length",
22683       FT_UINT8, BASE_DEC, NULL, 0,
22684       "Length of TPC Report element (always 2)", HFILL }},
22685
22686     {&hf_ieee80211_ff_tpc_tx_power,
22687      {"TPC Transmit Power", "wlan.rm.tpc.tx_power",
22688       FT_INT8, BASE_DEC, NULL, 0,
22689       NULL, HFILL }},
22690
22691     {&hf_ieee80211_ff_tpc_link_margin,
22692      {"TPC Link Margin", "wlan.rm.tpc.link_margin",
22693       FT_INT8, BASE_DEC, NULL, 0,
22694       NULL, HFILL }},
22695
22696     {&hf_ieee80211_ff_rm_rx_antenna_id,
22697      {"Receive Antenna ID", "wlan.rm.rx_antenna_id",
22698       FT_UINT8, BASE_DEC, NULL, 0,
22699       NULL, HFILL }},
22700
22701     {&hf_ieee80211_ff_rm_tx_antenna_id,
22702      {"Transmit Antenna ID", "wlan.rm.tx_antenna_id",
22703       FT_UINT8, BASE_DEC, NULL, 0,
22704       NULL, HFILL }},
22705
22706     {&hf_ieee80211_ff_rm_rcpi,
22707      {"Received Channel Power", "wlan.rm.rcpi",
22708       FT_UINT8, BASE_DEC, NULL, 0,
22709       NULL, HFILL }},
22710
22711     {&hf_ieee80211_ff_rm_rsni,
22712      {"Received Signal to noise indication", "wlan.rm.rsni",
22713       FT_UINT8, BASE_DEC, NULL, 0,
22714       NULL, HFILL }},
22715
22716     {&hf_ieee80211_ff_request_mode_pref_cand,
22717      {"Preferred Candidate List Included", "wlan.fixed.request_mode.pref_cand",
22718       FT_UINT8, BASE_DEC, NULL, 0x01,
22719       NULL, HFILL }},
22720
22721     {&hf_ieee80211_ff_request_mode_abridged,
22722      {"Abridged", "wlan.fixed.request_mode.abridged",
22723       FT_UINT8, BASE_DEC, NULL, 0x02,
22724       NULL, HFILL }},
22725
22726     {&hf_ieee80211_ff_request_mode_disassoc_imminent,
22727      {"Disassociation Imminent", "wlan.fixed.request_mode.disassoc_imminent",
22728       FT_UINT8, BASE_DEC, NULL, 0x04,
22729       NULL, HFILL }},
22730
22731     {&hf_ieee80211_ff_request_mode_bss_term_included,
22732      {"BSS Termination Included", "wlan.fixed.request_mode.bss_term_included",
22733       FT_UINT8, BASE_DEC, NULL, 0x08,
22734       NULL, HFILL }},
22735
22736     {&hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
22737      {"ESS Disassociation Imminent", "wlan.fixed.request_mode.ess_disassoc_imminent",
22738       FT_UINT8, BASE_DEC, NULL, 0x10,
22739       NULL, HFILL }},
22740
22741     {&hf_ieee80211_ff_disassoc_timer,
22742      {"Disassociation Timer", "wlan.fixed.disassoc_timer",
22743       FT_UINT16, BASE_DEC, NULL, 0,
22744       NULL, HFILL }},
22745
22746     {&hf_ieee80211_ff_bss_termination_delay,
22747      {"BSS Termination Delay", "wlan.fixed.bss_termination_delay",
22748       FT_UINT8, BASE_DEC, NULL, 0,
22749       NULL, HFILL }},
22750
22751     {&hf_ieee80211_ff_bss_transition_status_code,
22752      {"BSS Transition Status Code", "wlan.fixed.bss_transition_status_code",
22753       FT_UINT8, BASE_DEC, NULL, 0,
22754       NULL, HFILL }},
22755
22756     {&hf_ieee80211_ff_validity_interval,
22757      {"Validity Interval", "wlan.fixed.validity_interval",
22758       FT_UINT8, BASE_DEC, NULL, 0,
22759       NULL, HFILL }},
22760
22761     {&hf_ieee80211_ff_bss_termination_duration,
22762      {"BSS Termination Duration", "wlan.fixed.bss_termination_duration",
22763       FT_BYTES, BASE_NONE, NULL, 0,
22764       NULL, HFILL }},
22765
22766     {&hf_ieee80211_ff_url_len,
22767      {"Session Information URL Length",
22768       "wlan.fixed.session_information.url_length",
22769       FT_UINT8, BASE_DEC, NULL, 0,
22770       NULL, HFILL }},
22771
22772     {&hf_ieee80211_ff_url,
22773      {"Session Information URL", "wlan.fixed.session_information.url",
22774       FT_STRING, BASE_NONE, NULL, 0,
22775       NULL, HFILL }},
22776
22777     {&hf_ieee80211_ff_target_bss,
22778      {"BSS Transition Target BSS", "wlan.fixed.bss_transition_target_bss",
22779       FT_ETHER, BASE_NONE, NULL, 0,
22780       NULL, HFILL }},
22781
22782     {&hf_ieee80211_ff_bss_transition_query_reason,
22783      {"BSS Transition Query Reason", "wlan.fixed.bss_transition_query_reason",
22784       FT_UINT8, BASE_DEC, VALS(ieee80211_transition_reasons), 0,
22785       NULL, HFILL }},
22786
22787     {&hf_ieee80211_ff_bss_transition_candidate_list_entries,
22788      {"BSS Transition Candidate List Entries", "wlan.fixed.bss_transition_candidate_list_entries",
22789       FT_BYTES, BASE_NONE, NULL, 0,
22790       NULL, HFILL }},
22791
22792 /* 802.11ad */
22793     {&hf_ieee80211_cf_response_offset,
22794      {"Response Offset", "wlan.res_offset",
22795       FT_UINT16, BASE_DEC, NULL, 0,
22796       NULL, HFILL }},
22797
22798     {&hf_ieee80211_grant_ack_reserved,
22799      {"Reserved", "wlan.grant_ack.reserved",
22800       FT_BYTES, BASE_NONE, NULL, 0,
22801       NULL, HFILL }},
22802
22803     {&hf_ieee80211_ff_dynamic_allocation,
22804      {"Dynamic Allocation", "wlan.dynamic_allocation",
22805       FT_UINT40, BASE_HEX, NULL, 0,
22806       NULL, HFILL }},
22807
22808     {&hf_ieee80211_ff_TID,
22809      {"TID", "wlan.dynamic_allocation.tid",
22810       FT_UINT40, BASE_DEC, NULL, 0x000000000F,
22811       NULL, HFILL }},
22812
22813     {&hf_ieee80211_ff_alloc_type,
22814      {"Allocation Type", "wlan.dynamic_allocation.alloc_type",
22815       FT_UINT40, BASE_DEC, NULL, 0x000000070,
22816       NULL, HFILL }},
22817
22818     {&hf_ieee80211_ff_src_aid,
22819      {"Source AID", "wlan.dynamic_allocation.src_aid",
22820       FT_UINT40, BASE_DEC, NULL, 0x0000007F80,
22821       NULL, HFILL }},
22822
22823     {&hf_ieee80211_ff_dest_aid,
22824      {"Destination AID", "wlan.dynamic_allocation.dest_aid",
22825       FT_UINT40, BASE_DEC, NULL, 0x00007f8000,
22826       NULL, HFILL }},
22827
22828     {&hf_ieee80211_ff_alloc_duration,
22829      {"Allocation Duration", "wlan.dynamic_allocation.alloc_duration",
22830       FT_UINT40, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0x7FFF800000,
22831       NULL, HFILL }},
22832
22833     {&hf_ieee80211_ff_b39,
22834      {"Reserved (b39)", "wlan.dynamic_allocation.b39",
22835       FT_UINT40, BASE_HEX, NULL, 0x8000000000,
22836       NULL, HFILL }},
22837
22838     {&hf_ieee80211_ff_ssw,
22839      {"Sector Sweep", "wlan.ssw",
22840       FT_UINT24, BASE_HEX, NULL, 0,
22841       NULL, HFILL }},
22842
22843     {&hf_ieee80211_ff_ssw_direction,
22844      {"Sector Sweep Direction", "wlan.ssw.direction",
22845       FT_BOOLEAN, 24, TFS(&ieee80211_cf_ssw_direction), 0x000001,
22846       NULL, HFILL}},
22847
22848     {&hf_ieee80211_ff_ssw_cdown,
22849      {"Sector Sweep CDOWN", "wlan.ssw.cdown",
22850       FT_UINT24, BASE_DEC, NULL, 0x0003fe,
22851       NULL, HFILL }},
22852
22853     {&hf_ieee80211_ff_ssw_sector_id,
22854      {"Sector Sweep Sector ID", "wlan.ssw.sector_id",
22855       FT_UINT24, BASE_DEC, NULL, 0x00fc00,
22856       NULL, HFILL }},
22857
22858     {&hf_ieee80211_ff_ssw_dmg_ant_id,
22859      {"Sector Sweep DMG Antenna ID", "wlan.ssw.dmg_ant_id",
22860       FT_UINT24, BASE_DEC, NULL, 0x030000,
22861       NULL, HFILL }},
22862
22863     {&hf_ieee80211_ff_ssw_rxss_len,
22864      {"Sector Sweep RXSS Length", "wlan.ssw.rxss_len",
22865       FT_UINT24, BASE_DEC, NULL, 0xfc0000,
22866       NULL, HFILL }},
22867
22868     {&hf_ieee80211_ff_bf,
22869      {"Beam Forming", "wlan.bf",
22870       FT_UINT16, BASE_HEX, NULL, 0,
22871       NULL, HFILL }},
22872
22873     {&hf_ieee80211_ff_bf_train,
22874      {"Beam Forming Training", "wlan.bf.train",
22875       FT_BOOLEAN, 16, NULL, 0x0001,
22876       NULL, HFILL }},
22877
22878     {&hf_ieee80211_ff_bf_is_init,
22879      {"Beam Forming Is InitiatorTXSS", "wlan.bf.isInit",
22880       FT_BOOLEAN, 16, NULL, 0x0002,
22881       NULL, HFILL }},
22882
22883     {&hf_ieee80211_ff_bf_is_resp,
22884      {"Beam Forming Is ResponderTXSS", "wlan.bf.isResp",
22885       FT_BOOLEAN, 16, NULL, 0x0004,
22886       NULL, HFILL }},
22887
22888     {&hf_ieee80211_ff_bf_rxss_len,
22889      {"Beam Forming RXSS Length", "wlan.bf.rxss_len",
22890       FT_UINT16, BASE_DEC, NULL, 0x01f8,
22891       NULL, HFILL }},
22892
22893     {&hf_ieee80211_ff_bf_rxss_rate,
22894      {"Beam Forming RXSS Rate", "wlan.bf.rxss_rate",
22895       FT_BOOLEAN, 16, NULL, 0x0200,
22896       NULL, HFILL }},
22897
22898     {&hf_ieee80211_ff_bf_b10b15,
22899      {"Reserved (B10-B15)", "wlan.bf.reserved",
22900       FT_UINT16, BASE_DEC, NULL, 0xFC00,
22901       NULL, HFILL }},
22902
22903     {&hf_ieee80211_ff_bf_num_sectors,
22904      {"Beam Forming Total Number of Sectors", "wlan.bf.num_sectors",
22905       FT_UINT16, BASE_DEC, NULL, 0x03f8,
22906       NULL, HFILL }},
22907
22908     {&hf_ieee80211_ff_bf_num_rx_dmg_ants,
22909      {"Beam Forming Number of DMG Antennas", "wlan.bf.num_dmg_ants",
22910       FT_UINT16, BASE_DEC, NULL, 0x0c00,
22911       NULL, HFILL }},
22912
22913     {&hf_ieee80211_ff_bf_b12b15,
22914      {"Reserved (B12-B15)", "wlan.bf.reserved",
22915       FT_UINT16, BASE_DEC, NULL, 0xF000,
22916       NULL, HFILL }},
22917
22918     {&hf_ieee80211_addr_nav_da,
22919      {"Destination address of STA that caused NAV update", "wlan.nav_da",
22920       FT_ETHER, BASE_NONE, NULL, 0,
22921       "DMG Destination Hardware Address", HFILL }},
22922
22923     {&hf_ieee80211_addr_nav_sa,
22924      {"Source address of STA that caused NAV update", "wlan.nav_sa",
22925       FT_ETHER, BASE_NONE, NULL, 0,
22926       "DMG Source Hardware Address", HFILL }},
22927
22928     {&hf_ieee80211_ff_sswf,
22929      {"Sector Sweep Feedback", "wlan.sswf",
22930       FT_UINT24, BASE_HEX, NULL, 0,
22931       NULL, HFILL }},
22932
22933     {&hf_ieee80211_ff_sswf_total_sectors,
22934      {"Sector Sweep Feedback total number of sectors", "wlan.sswf.num_sectors",
22935       FT_UINT24, BASE_DEC, NULL, 0x0001ff,
22936       NULL, HFILL }},
22937
22938     {&hf_ieee80211_ff_sswf_num_rx_dmg_ants,
22939      {"Sector Sweep Feedback Number of receive DMG Antennas", "wlan.sswf.num_dmg_ants",
22940       FT_UINT24, BASE_DEC, NULL, 0x000600,
22941       NULL, HFILL }},
22942
22943     {&hf_ieee80211_ff_sswf_poll_required,
22944      {"Sector Sweep Feedback Poll required", "wlan.sswf.poll",
22945       FT_BOOLEAN, 24, NULL, 0x010000,
22946       NULL, HFILL }},
22947
22948     {&hf_ieee80211_ff_sswf_reserved1,
22949      {"Sector Sweep Feedback Reserved", "wlan.sswf.reserved",
22950       FT_UINT24, BASE_HEX, NULL, 0x00F800,
22951       NULL, HFILL }},
22952
22953     {&hf_ieee80211_ff_sswf_reserved2,
22954      {"Sector Sweep Feedback Reserved", "wlan.sswf.reserved",
22955       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
22956       NULL, HFILL }},
22957
22958     {&hf_ieee80211_ff_sswf_sector_select,
22959      {"Sector Sweep Feedback Sector Select", "wlan.sswf.sector_select",
22960       FT_UINT24, BASE_DEC, NULL, 0x00003F,
22961       NULL, HFILL }},
22962
22963     {&hf_ieee80211_ff_sswf_dmg_antenna_select,
22964      {"Sector Sweep Feedback DMG Antenna Select", "wlan.sswf.dmg_antenna_select",
22965       FT_UINT24, BASE_DEC, NULL, 0x0000C0,
22966       NULL, HFILL }},
22967
22968     {&hf_ieee80211_ff_sswf_snr_report,
22969      {"Sector Sweep Feedback SNR Report", "wlan.sswf.snr_report",
22970       FT_UINT24, BASE_DEC, NULL, 0x00FF00,
22971       NULL, HFILL }},
22972
22973
22974     {&hf_ieee80211_ff_brp,
22975      {"BRP Request", "wlan.brp",
22976       FT_UINT32, BASE_HEX, NULL, 0,
22977       NULL, HFILL }},
22978
22979     {&hf_ieee80211_ff_brp_L_RX,
22980      {"BRP Request L-RX", "wlan.brp.l_rx",
22981       FT_UINT32, BASE_DEC, NULL, 0x0000001f,
22982       NULL, HFILL }},
22983
22984     {&hf_ieee80211_ff_brp_TX_TRN_REQ,
22985      {"BRP Request TX-TRN-REQ", "wlan.brp.tx_trn_req",
22986       FT_BOOLEAN, 32, NULL, 0x00000020,
22987       NULL, HFILL }},
22988
22989     {&hf_ieee80211_ff_brp_MID_REQ,
22990      {"BRP Request MID-REQ", "wlan.brp.mid_req",
22991       FT_BOOLEAN, 32, NULL, 0x00000040,
22992       NULL, HFILL }},
22993
22994     {&hf_ieee80211_ff_brp_BC_REQ,
22995      {"BRP Request BC-REQ", "wlan.brp.bc_req",
22996       FT_BOOLEAN, 32, NULL, 0x00000080,
22997       NULL, HFILL }},
22998
22999     {&hf_ieee80211_ff_brp_MID_GRANT,
23000      {"BRP Request MID-GRANT", "wlan.brp.mid_grant",
23001       FT_BOOLEAN, 32, NULL, 0x00000100,
23002       NULL, HFILL }},
23003
23004     {&hf_ieee80211_ff_brp_BC_GRANT,
23005      {"BRP Request BC-GRANT", "wlan.brp.bc_grant",
23006       FT_BOOLEAN, 32, NULL, 0x00000200,
23007       NULL, HFILL }},
23008
23009     {&hf_ieee80211_ff_brp_chan_FBCK_CAP,
23010      {"BRP Request Chan FBCK-CAP", "wlan.brp.chan_fbck_cap",
23011       FT_BOOLEAN, 32, NULL, 0x00000400,
23012       NULL, HFILL }},
23013
23014     {&hf_ieee80211_ff_brp_tx_sector,
23015      {"BRP Request TX Sector ID", "wlan.brp.tx_sector_id",
23016       FT_UINT32, BASE_DEC, NULL, 0x0001f800,
23017       NULL, HFILL }},
23018
23019     {&hf_ieee80211_ff_brp_other_aid,
23020      {"BRP Request Other AID", "wlan.brp.other_aid",
23021       FT_UINT32, BASE_DEC, NULL, 0x01fe0000,
23022       NULL, HFILL }},
23023
23024     {&hf_ieee80211_ff_brp_tx_antenna,
23025      {"BRP Request TX Antenna ID", "wlan.brp.tx_antenna_id",
23026       FT_UINT32, BASE_DEC, NULL, 0x06000000,
23027       NULL, HFILL }},
23028
23029     {&hf_ieee80211_ff_brp_reserved,
23030      {"BRP Request Reserved", "wlan.brp.reserved",
23031       FT_UINT32, BASE_HEX, NULL, 0xF8000000,
23032       NULL, HFILL }},
23033
23034     {&hf_ieee80211_ff_blm,
23035      {"Beamformed Link Maintenance", "wlan.blm",
23036       FT_UINT8, BASE_HEX, NULL, 0,
23037       NULL, HFILL }},
23038
23039     {&hf_ieee80211_ff_blm_unit_index,
23040      {"BeamLink Maintenance Uint Index", "wlan.blm.uint_index",
23041       FT_BOOLEAN, 8, NULL, 0x01,
23042       NULL, HFILL }},
23043
23044     {&hf_ieee80211_ff_blm_maint_value,
23045      {"BeamLink Maintenance Value", "wlan.blm.value",
23046       FT_UINT8, BASE_DEC, NULL, 0x7e,
23047       NULL, HFILL }},
23048
23049     {&hf_ieee80211_ff_blm_is_master,
23050      {"BeamLink Is Master", "wlan.blm.is_master",
23051       FT_BOOLEAN, 8, NULL, 0x80,
23052       NULL, HFILL }},
23053
23054     {&hf_ieee80211_ff_bic,
23055      {"Beacon Interval Control", "wlan.bic",
23056       FT_UINT48, BASE_HEX, NULL, 0,
23057       NULL, HFILL }},
23058
23059     {&hf_ieee80211_ff_bic_cc_present,
23060      {"Clustering Control Present", "wlan.bic.cc",
23061       FT_BOOLEAN, 48, NULL, 0x000000000001,
23062       NULL, HFILL }},
23063
23064     {&hf_ieee80211_ff_bic_discovery_mode,
23065      {"Discovery Mode", "wlan.bic.discovery_mode",
23066       FT_BOOLEAN, 48, NULL, 0x000000000002,
23067       NULL, HFILL }},
23068
23069     {&hf_ieee80211_ff_bic_next_beacon,
23070      {"Next Beacon", "wlan.bic.next_beacon",
23071       FT_UINT48, BASE_DEC, NULL, 0x00000000003c,
23072
23073       NULL, HFILL }},
23074
23075     {&hf_ieee80211_ff_bic_ati_present,
23076      {"ATI Present", "wlan.bic.ati",
23077       FT_BOOLEAN, 48, NULL, 0x000000000040,
23078       NULL, HFILL }},
23079
23080     {&hf_ieee80211_ff_bic_abft_len,
23081      {"A-BFT length", "wlan.bic.abft_len",
23082       FT_UINT48, BASE_DEC, NULL, 0x000000000380,
23083       NULL, HFILL }},
23084
23085     {&hf_ieee80211_ff_bic_fss,
23086      {"FSS", "wlan.bic.fss",
23087       FT_UINT48, BASE_DEC, NULL, 0x000000003c00,
23088       NULL, HFILL }},
23089
23090     {&hf_ieee80211_ff_bic_is_resp,
23091      {"Is TXSS Responder", "wlan.bic.is_responder",
23092       FT_BOOLEAN, 48, NULL, 0x000000004000,
23093       NULL, HFILL }},
23094
23095     {&hf_ieee80211_ff_bic_next_abft,
23096      {"Next A-BFT", "wlan.bic.next_abft",
23097       FT_UINT48, BASE_DEC, NULL, 0x000000078000,
23098       NULL, HFILL }},
23099
23100     {&hf_ieee80211_ff_bic_frag_txss,
23101      {"Fragmented TXSS", "wlan.bic.frag_txss",
23102       FT_BOOLEAN, 48, NULL, 0x000000080000,
23103       NULL, HFILL }},
23104
23105     {&hf_ieee80211_ff_bic_txss_span,
23106      {"TXSS span", "wlan.bic.txss_span",
23107       FT_UINT48, BASE_DEC, NULL, 0x000007f00000,
23108       NULL, HFILL }},
23109
23110     {&hf_ieee80211_ff_bic_NBI_abft,
23111      {"Number of Beacon Intervals that are needed to allocate A-BFT", "wlan.bic.NBI_abft",
23112       FT_UINT48, BASE_DEC, NULL, 0x00078000000,
23113       NULL, HFILL }},
23114
23115     {&hf_ieee80211_ff_bic_abft_count,
23116      {"A-BFT Count", "wlan.bic.abft_count",
23117       FT_UINT48, BASE_DEC, NULL, 0x001f80000000,
23118       NULL, HFILL }},
23119
23120     {&hf_ieee80211_ff_bic_nabft,
23121      {"Number of A-BFT's received from each Antenna", "wlan.bic.nabft",
23122       FT_UINT48, BASE_DEC, NULL, 0x07e000000000,
23123       NULL, HFILL }},
23124
23125     {&hf_ieee80211_ff_bic_pcp,
23126      {"PCP Association Ready", "wlan.bic.pcp",
23127       FT_BOOLEAN, 48, NULL, 0x080000000000,
23128       NULL, HFILL }},
23129
23130     {&hf_ieee80211_ff_bic_reserved,
23131      {"Reserved", "wlan.bic.reserved",
23132       FT_UINT48, BASE_HEX, NULL, 0xF00000000000,
23133       NULL, HFILL }},
23134
23135     {&hf_ieee80211_ff_dmg_params,
23136      {"DMG Parameters", "wlan.dmg_params",
23137       FT_UINT8, BASE_HEX , NULL, 0,
23138       NULL, HFILL }},
23139
23140     {&hf_ieee80211_ff_dmg_params_bss,
23141      {"BSS Type", "wlan.dmg_params.bss",
23142       FT_UINT8, BASE_DEC, VALS(bss_type), 0x03,
23143       NULL, HFILL }},
23144
23145     {&hf_ieee80211_ff_dmg_params_cbap_only,
23146      {"CBAP Only", "wlan.dmp_params.cbap_only",
23147       FT_BOOLEAN, 8, NULL, 0x04,
23148       NULL, HFILL }},
23149
23150     {&hf_ieee80211_ff_dmg_params_cbap_src,
23151      {"CBAP Source", "wlan.dmp_params.cbap_src",
23152       FT_BOOLEAN, 8, NULL, 0x08,
23153       NULL, HFILL }},
23154
23155     {&hf_ieee80211_ff_dmg_params_privacy,
23156      {"DMG Privacy", "wlan.dmp_params.privacy",
23157       FT_BOOLEAN, 8, NULL, 0x10,
23158       NULL, HFILL }},
23159
23160     {&hf_ieee80211_ff_dmg_params_policy,
23161      {"ECPAC Policy Enforced", "wlan.dmp_params.policy",
23162       FT_BOOLEAN, 8, NULL, 0x20,
23163       NULL, HFILL }},
23164
23165     {&hf_ieee80211_ff_cc,
23166      {"Clustering Control", "wlan.cc",
23167       FT_UINT64, BASE_HEX , NULL, 0,
23168       NULL, HFILL }},
23169
23170     {&hf_ieee80211_ff_cc_abft_resp_addr,
23171      {"A-BFT Responder Address", "wlan.cc.abft_resp_addr",
23172       FT_ETHER, BASE_NONE , NULL, 0,
23173       NULL, HFILL }},
23174
23175     {&hf_ieee80211_ff_cc_sp_duration,
23176      {"Beacon SP Duration", "wlan.cc.sp_duration",
23177       FT_UINT8, BASE_DEC , NULL, 0,
23178       NULL, HFILL }},
23179
23180     {&hf_ieee80211_ff_cc_cluster_id,
23181      {"Cluster ID", "wlan.cc.cluster_id",
23182       FT_UINT64, BASE_DEC , NULL, 0,
23183       NULL, HFILL }},
23184
23185     {&hf_ieee80211_ff_cc_role,
23186      {"Cluster Member Role", "wlan.cc.rold",
23187       FT_UINT8, BASE_DEC , NULL, 0,
23188       NULL, HFILL }},
23189
23190     {&hf_ieee80211_ff_cc_max_mem,
23191      {"Cluster MaxMem", "wlan.cc.max_mem",
23192       FT_UINT8, BASE_DEC , NULL, 0,
23193       NULL, HFILL }},
23194
23195     {&hf_ieee80211_tag_relay_support,
23196      {"Relay Supportability", "wlan.relay_capabilities.relay_support",
23197       FT_BOOLEAN, 8, NULL, 0x01,
23198       NULL, HFILL }},
23199
23200     {&hf_ieee80211_tag_relay_use,
23201      {"Relay Usability", "wlan.relay_capabilities.relay_use",
23202       FT_BOOLEAN, 8, NULL, 0x02,
23203       NULL, HFILL }},
23204
23205     {&hf_ieee80211_tag_relay_permission,
23206      {"Relay Permission", "wlan.relay_capabilities.relay_permission",
23207       FT_BOOLEAN, 8, NULL, 0x04,
23208       NULL, HFILL }},
23209
23210     {&hf_ieee80211_tag_AC_power,
23211      {"A/C Power", "wlan.relay_capabilities.AC_power",
23212       FT_BOOLEAN, 8, NULL, 0x08,
23213       NULL, HFILL }},
23214
23215     {&hf_ieee80211_tag_relay_prefer,
23216      {"Relay Preference", "wlan.relay_capabilities.relay_prefer",
23217       FT_BOOLEAN, 8, NULL, 0x10,
23218       NULL, HFILL }},
23219
23220     {&hf_ieee80211_tag_duplex,
23221      {"Duplex", "wlan.relay_capabilities.duplex",
23222       FT_UINT8, BASE_DEC, NULL, 0x60,
23223       NULL, HFILL }},
23224
23225     {&hf_ieee80211_tag_cooperation,
23226      {"Cooperation", "wlan.relay_capabilities.cooperation",
23227       FT_BOOLEAN, 8, NULL, 0x80,
23228       NULL, HFILL }},
23229
23230 #if 0
23231     {&hf_ieee80211_ff_rcsi,
23232      {"Relay Capable STA Info", "wlan.rcsi",
23233       FT_UINT24, BASE_HEX, NULL, 0,
23234       NULL, HFILL }},
23235
23236     {&hf_ieee80211_ff_rcsi_aid,
23237      {"AID", "wlan.rcsi.aid",
23238       FT_UINT8, BASE_DEC, NULL, 0xff,
23239       NULL, HFILL }},
23240 #endif
23241
23242     {&hf_ieee80211_ff_band_id,
23243      {"Band ID", "wlan.band_id",
23244       FT_UINT8, BASE_DEC, VALS(band_id), 0xff,
23245       NULL, HFILL }},
23246
23247     {&hf_ieee80211_tag_move,
23248      {"Move", "wlan.dmg_bss_param_change.move",
23249       FT_BOOLEAN, 8, NULL, 0x01,
23250       NULL, HFILL }},
23251
23252     {&hf_ieee80211_tag_size,
23253      {"Size", "wlan.dmg_bss_param_change.size",
23254       FT_BOOLEAN, 8, NULL, 0x02,
23255       NULL, HFILL }},
23256
23257     {&hf_ieee80211_tag_tbtt_offset,
23258      {"TBTT Offset", "wlan.dmg_bss_param_change.tbtt_offset",
23259       FT_UINT32, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xffffffff,
23260       NULL, HFILL }},
23261
23262     {&hf_ieee80211_tag_bi_duration,
23263      {"BI Duration", "wlan.dmg_bss_param_change.bi_duration",
23264       FT_UINT16, BASE_DEC, NULL, 0xffff,
23265       NULL, HFILL }},
23266
23267     {&hf_ieee80211_tag_dmg_capa_sta_addr,
23268      {"STA Address", "wlan.dmg_capa.sta_addr",
23269       FT_ETHER, BASE_NONE, NULL, 0,
23270       "STA_Address", HFILL }},
23271
23272     {&hf_ieee80211_tag_dmg_capa_aid,
23273      {"AID", "wlan.dmg_capa.aid",
23274       FT_UINT16, BASE_DEC, NULL, 0,
23275       NULL, HFILL }},
23276 /* 8.4.2.127.2 DMG STA Capability Information field */
23277     {&hf_ieee80211_tag_reverse_direction, /* DMG STA capa, bits [0] */
23278      {"Reverse Direction", "wlan.dmg_capa.reverse_direction",
23279       FT_BOOLEAN, 24, NULL, GENMASK(0, 0),
23280       NULL, HFILL }},
23281
23282     {&hf_ieee80211_tag_hlts, /* DMG STA capa, bits [1] */
23283      {"Higher Layer Timer Synchronization", "wlan.dmg_capa.htls",
23284       FT_BOOLEAN, 24, NULL, GENMASK(1, 1),
23285       NULL, HFILL }},
23286
23287     {&hf_ieee80211_tag_tpc, /* DMG STA capa, bits [2] */
23288      {"TPC", "wlan.dmg_capa.tpc",
23289       FT_BOOLEAN, 24, NULL, GENMASK(2, 2),
23290       NULL, HFILL }},
23291
23292     {&hf_ieee80211_tag_spsh, /* DMG STA capa, bits [3] */
23293      {"SPSH and Interference Mitigation", "wlan.dmg_capa.spsh",
23294       FT_BOOLEAN, 24, NULL, GENMASK(3, 3),
23295       NULL, HFILL }},
23296
23297     {&hf_ieee80211_tag_rx_antenna, /* DMG STA capa, bits [4..5] */
23298      {"Number of RX DMG Antennas", "wlan.dmg_capa.num_rx",
23299       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(5, 4),
23300       NULL, HFILL }},
23301
23302     {&hf_ieee80211_tag_fast_link, /* DMG STA capa, bits [6] */
23303      {"Fast Link Adaptation", "wlan.dmg_capa.fast_link",
23304       FT_BOOLEAN, 24, NULL, GENMASK(6, 6),
23305       NULL, HFILL }},
23306
23307     {&hf_ieee80211_tag_num_sectors, /* DMG STA capa, bits [7..13] */
23308      {"Total Number of Sectors", "wlan.dmg_capa.num_sectors",
23309       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(13, 7),
23310       NULL, HFILL }},
23311
23312     {&hf_ieee80211_tag_rxss_length, /* DMG STA capa, bits [14..19] */
23313      {"RXSS Length", "wlan.dmg_capa.rxss_len",
23314       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_mul_two_base_custom), GENMASK(19, 14),
23315       NULL, HFILL }},
23316
23317     {&hf_ieee80211_tag_reciprocity, /* DMG STA capa, bits [20] */
23318      {"DMG Antenna Reciprocity", "wlan.dmg_capa.reciprocity",
23319       FT_BOOLEAN, 24, NULL, GENMASK(20, 20),
23320       NULL, HFILL }},
23321 /* DMG STA capa, A-MPDU params, bits [21..26] */
23322     {&hf_ieee80211_tag_max_ampdu_exp, /* DMG STA capa, bits [21..23] */
23323      {"Maximum A-MPDU Length Exponent", "wlan.dmg_capa.max_ampdu_exp",
23324       FT_UINT24, BASE_DEC, NULL, GENMASK(23, 21),
23325       NULL, HFILL }},
23326
23327     {&hf_ieee80211_tag_min_mpdu_spacing, /* DMG STA capa, bits [24..26] */
23328      {"Minimum MPDU Start Spacing", "wlan.dmg_capa.min_mpdu_spacing",
23329       FT_UINT24, BASE_DEC, NULL, GENMASK(26-24, 24-24),
23330       NULL, HFILL }},
23331
23332     {&hf_ieee80211_tag_ba_flow_control , /* DMG STA capa, bits [27] */
23333      {"BA with Flow Control", "wlan.dmg_capa.bs_flow_ctrl",
23334       FT_BOOLEAN, 24, NULL, GENMASK(27-24, 27-24),
23335       NULL, HFILL }},
23336 /* DMG STA capa, supported MCS set, bits [28..51] */
23337     {&hf_ieee80211_tag_max_sc_rx_mcs, /* DMG STA capa, bits [28..32] */
23338      {"Maximum SC Rx MCS", "wlan.dmg_capa.max_sc_rx_mcs",
23339       FT_UINT24, BASE_DEC, NULL, GENMASK(32-24, 28-24),
23340       NULL, HFILL }},
23341
23342     {&hf_ieee80211_tag_max_ofdm_rx_mcs, /* DMG STA capa, bits [33..37] */
23343      {"Maximum OFDM Rx MCS", "wlan.dmg_capa.max_ofdm_rx_mcs",
23344       FT_UINT24, BASE_DEC, NULL, GENMASK(37-24, 33-24),
23345       NULL, HFILL }},
23346
23347     {&hf_ieee80211_tag_max_sc_tx_mcs, /* DMG STA capa, bits [38..42] */
23348      {"Maximum SC Tx MCS", "wlan.dmg_capa.max_sc_tx_mcs",
23349       FT_UINT24, BASE_DEC, NULL, GENMASK(42-24, 38-24),
23350       NULL, HFILL }},
23351
23352     {&hf_ieee80211_tag_max_ofdm_tx_mcs, /* DMG STA capa, bits [43..47] */
23353      {"Maximum OFDM Tx MCS", "wlan.dmg_capa.max_ofdm_tx_mcs",
23354       FT_UINT24, BASE_DEC, NULL, GENMASK(47-24, 43-24),
23355       NULL, HFILL }},
23356
23357     {&hf_ieee80211_tag_low_power_supported, /* DMG STA capa, bits [48] */
23358      {"Low Power SC PHY Supported", "wlan.dmg_capa.low_power_suuported",
23359       FT_BOOLEAN, 16, NULL, GENMASK(48-48, 48-48),
23360       NULL, HFILL }},
23361
23362     {&hf_ieee80211_tag_code_rate, /* DMG STA capa, bits [49] */
23363      {"Code Rate 13/16", "wlan.dmg_capa.code_rate",
23364       FT_BOOLEAN, 16, NULL, GENMASK(49-48, 49-48),
23365       NULL, HFILL }},
23366
23367     {&hf_ieee80211_tag_dtp, /* DMG STA capa, bits [52] */
23368      {"DTP Supported", "wlan.dmg_capa.dtp",
23369       FT_BOOLEAN, 16, NULL, GENMASK(52-48, 52-48),
23370       NULL, HFILL }},
23371
23372     {&hf_ieee80211_tag_appdu_supp, /* DMG STA capa, bits [53] */
23373      {"A-PPDU Supported", "wlan.dmg_capa.appdu_supp",
23374       FT_BOOLEAN, 16, NULL, GENMASK(53-48, 53-48),
23375       NULL, HFILL }},
23376
23377     {&hf_ieee80211_tag_heartbeat, /* DMG STA capa, bits [54] */
23378      {"HeartBeat", "wlan.dmg_capa.heartbeat",
23379       FT_BOOLEAN, 16, NULL, GENMASK(54-48, 54-48),
23380       NULL, HFILL }},
23381
23382     {&hf_ieee80211_tag_other_aid, /* DMG STA capa, bits [55] */
23383      {"Supports Other_AID", "wlan.dmg_capa.other_aid",
23384       FT_BOOLEAN, 16, NULL, GENMASK(55-48, 55-48),
23385       NULL, HFILL }},
23386
23387     {&hf_ieee80211_tag_pattern_recip, /* DMG STA capa, bits [56] */
23388      {"Antenna Pattern Reciprocity", "wlan.dmg_capa.pattern_recip",
23389       FT_BOOLEAN, 16, NULL, GENMASK(56-48, 56-48),
23390       NULL, HFILL }},
23391
23392     {&hf_ieee80211_tag_heartbeat_elapsed, /* DMG STA capa, bits [57..59] */
23393      {"Heartbeat Elapsed Indication", "wlan.dmg_capa.heartbeat_elapsed",
23394       FT_UINT16, BASE_DEC, NULL, GENMASK(59-48, 57-48),
23395       NULL, HFILL }},
23396
23397     {&hf_ieee80211_tag_grant_ack_supp, /* DMG STA capa, bits [60] */
23398      {"Grant ACK Supported", "wlan.dmg_capa.grant_ack_supp",
23399       FT_BOOLEAN, 16, NULL, GENMASK(60-48, 60-48),
23400       NULL, HFILL }},
23401
23402     {&hf_ieee80211_tag_RXSSTxRate_supp, /* DMG STA capa, bits [61] */
23403      {"RXSSTxRate Supported", "wlan.dmg_capa.RXSSTxRate",
23404       FT_BOOLEAN, 16, NULL, GENMASK(61-48, 61-48),
23405       NULL, HFILL }},
23406 /* 8.4.2.127.3 DMG PCP/AP Capability Information field */
23407     {&hf_ieee80211_tag_pcp_tddti, /* DMG PCP/AP capa, bits [0] */
23408      {"TDDTI", "wlan.dmg_capa.pcp_tdtti",
23409       FT_BOOLEAN, 16, NULL, GENMASK(0, 0),
23410       NULL, HFILL }},
23411
23412     {&hf_ieee80211_tag_pcp_PSA, /* DMG PCP/AP capa, bits [1] */
23413      {"Pseudo-static Allocations", "wlan.dmg_capa.pcp_psa",
23414       FT_BOOLEAN, 16, NULL, GENMASK(1, 1),
23415       NULL, HFILL }},
23416
23417     {&hf_ieee80211_tag_pcp_handover, /* DMG PCP/AP capa, bits [2] */
23418      {"PDP Handover", "wlan.dmg_capa.pcp_handover",
23419       FT_BOOLEAN, 16, NULL, GENMASK(2, 2),
23420       NULL, HFILL }},
23421
23422     {&hf_ieee80211_tag_pcp_max_assoc, /* DMG PCP/AP capa, bits [3..10] */
23423      {"Max Associated STA Number", "wlan.dmg_capa.pcp_max_assoc",
23424       FT_UINT16, BASE_DEC, NULL, GENMASK(10, 3),
23425       NULL, HFILL }},
23426
23427     {&hf_ieee80211_tag_pcp_power_src, /* DMG PCP/AP capa, bits [11] */
23428      {"Power Source", "wlan.dmg_capa.pcp_power_src",
23429       FT_BOOLEAN, 16, NULL, GENMASK(11, 11),
23430       NULL, HFILL }},
23431
23432     {&hf_ieee80211_tag_pcp_decenter, /* DMG PCP/AP capa, bits [12] */
23433      {"Decentralized PCP/AP Clustering", "wlan.dmg_capa.pcp_decenter",
23434       FT_BOOLEAN, 16, NULL, GENMASK(12, 12),
23435       NULL, HFILL }},
23436
23437     {&hf_ieee80211_tag_pcp_forwarding, /* DMG PCP/AP capa, bits [13] */
23438      {"PCP Forwarding", "wlan.dmg_capa.pcp_forwarding",
23439       FT_BOOLEAN, 16, NULL, GENMASK(13, 13),
23440       NULL, HFILL }},
23441
23442     {&hf_ieee80211_tag_pcp_center, /* DMG PCP/AP capa, bits [14] */
23443      {"Centralized PCP/AP Clustering", "wlan.dmg_capa.pcp_center",
23444       FT_BOOLEAN, 16, NULL, GENMASK(14, 14),
23445       NULL, HFILL }},
23446
23447     {&hf_ieee80211_tag_PSRSI,
23448      {"PS Request Suspension Interval", "wlan.dmg_oper.psrsi",
23449       FT_UINT8, BASE_DEC, NULL, 0,
23450       NULL, HFILL }},
23451
23452     {&hf_ieee80211_tag_min_BHI_duration,
23453      {"Min BHI Duration", "wlan.dmg_oper.min_BHI_duration",
23454       FT_UINT16, BASE_DEC, NULL, 0,
23455       NULL, HFILL }},
23456
23457     {&hf_ieee80211_tag_brdct_sta_info_dur,
23458      {"Broadcast STA Info Duration", "wlan.dmg_oper.brdcst_sta_info_dur",
23459       FT_UINT8, BASE_DEC, NULL, 0,
23460       NULL, HFILL }},
23461
23462     {&hf_ieee80211_tag_assoc_resp_confirm_time,
23463      {"Associated Response Confirm Time", "wlan.dmg_oper.assoc_resp_confirm_time",
23464       FT_UINT8, BASE_DEC, NULL, 0,
23465       NULL, HFILL }},
23466
23467     {&hf_ieee80211_tag_min_pp_duration,
23468      {"Min PP Duration", "wlan.dmg_oper.min_pp_duration",
23469       FT_UINT8, BASE_DEC, NULL, 0,
23470       NULL, HFILL }},
23471
23472     {&hf_ieee80211_tag_SP_idle_timeout,
23473      {"SP Idle Timeout", "wlan.dmg_oper.SP_idle_timeout",
23474       FT_UINT8, BASE_DEC, NULL, 0,
23475       NULL, HFILL }},
23476
23477     {&hf_ieee80211_tag_max_lost_beacons,
23478      {"Max Lost Beacons", "wlan.dmg_oper.max_lost_beacons",
23479       FT_UINT8, BASE_DEC, NULL, 0,
23480       NULL, HFILL }},
23481
23482     {&hf_ieee80211_tag_type,
23483      {"Type", "wlan.sctor_id.type",
23484       FT_UINT32, BASE_HEX, NULL, 0x0000000f,
23485       NULL, HFILL }},
23486
23487     {&hf_ieee80211_tag_tap1,
23488      {"Tap 1", "wlan.sctor_id.tap1",
23489       FT_UINT32, BASE_HEX, NULL, 0x000003f0,
23490       NULL, HFILL }},
23491
23492     {&hf_ieee80211_tag_state1,
23493      {"State 1", "wlan.sctor_id.state1",
23494       FT_UINT32, BASE_HEX, NULL, 0x0000fc00,
23495       NULL, HFILL }},
23496
23497     {&hf_ieee80211_tag_tap2,
23498      {"Tap 2", "wlan.sctor_id.tap2",
23499       FT_UINT32, BASE_HEX, NULL, 0x00ff0000,
23500       NULL, HFILL }},
23501
23502     {&hf_ieee80211_tag_state2,
23503      {"State 2", "wlan.sctor_id.state2",
23504       FT_UINT32, BASE_HEX, NULL, 0xff000000,
23505       NULL, HFILL }},
23506
23507     {&hf_ieee80211_tag_allocation_id,
23508      {"Allocation ID", "wlan.ext_sched.alloc_id",
23509       FT_UINT16, BASE_DEC, NULL, 0x000f,
23510       NULL, HFILL }},
23511
23512     {&hf_ieee80211_tag_allocation_type,
23513      {"Allocation Type", "wlan.ext_sched.alloc_type",
23514       FT_UINT16, BASE_DEC, VALS(allocation_type), 0x0070,
23515       NULL, HFILL }},
23516
23517     {&hf_ieee80211_tag_pseudo_static,
23518      {"Pseudo-static", "wlan.ext_sched.p_static",
23519       FT_BOOLEAN, 16, NULL, 0x0080,
23520       NULL, HFILL }},
23521
23522     {&hf_ieee80211_tag_truncatable,
23523      {"Truncatable", "wlan.ext_sched.truncatable",
23524       FT_BOOLEAN, 16, NULL, 0x0100,
23525       NULL, HFILL }},
23526
23527     {&hf_ieee80211_tag_extendable,
23528      {"Extenedable", "wlan.ext_sched.extendable",
23529       FT_BOOLEAN, 16, NULL, 0x0200,
23530       NULL, HFILL }},
23531
23532     {&hf_ieee80211_tag_pcp_active,
23533      {"PCP Active", "wlan.ext_sched.pcp_active",
23534       FT_BOOLEAN, 16, NULL, 0x0400,
23535       NULL, HFILL }},
23536
23537     {&hf_ieee80211_tag_lp_sc_used,
23538      {"LP SC Used", "wlan.ext_sched.lp_sc_used",
23539       FT_BOOLEAN, 16, NULL, 0x0800,
23540       NULL, HFILL }},
23541
23542     {&hf_ieee80211_tag_src_aid,
23543      {"Source AID", "wlan.ext_sched.src_id",
23544       FT_UINT8, BASE_DEC, NULL, 0xff,
23545       NULL, HFILL }},
23546
23547     {&hf_ieee80211_tag_dest_aid,
23548      {"Destination AID", "wlan.ext_sched.dest_id",
23549       FT_UINT8, BASE_DEC, NULL, 0xff,
23550       NULL, HFILL }},
23551
23552     {&hf_ieee80211_tag_alloc_start,
23553      {"Allocation Start", "wlan.ext_sched.alloc_start",
23554       FT_UINT32, BASE_DEC, NULL, 0,
23555       NULL, HFILL }},
23556
23557     {&hf_ieee80211_tag_alloc_block_duration,
23558      {"Allocation Block Duration", "wlan.ext_sched.block_duration",
23559       FT_UINT16, BASE_DEC, NULL, 0xffff,
23560       NULL, HFILL }},
23561
23562     {&hf_ieee80211_tag_num_blocks,
23563      {"Number of Blocks", "wlan.ext_sched.num_blocks",
23564       FT_UINT8, BASE_DEC, NULL, 0xff,
23565       NULL, HFILL }},
23566
23567     {&hf_ieee80211_tag_alloc_block_period,
23568      {"Allocation Block Period", "wlan.ext_sched.alloc_block_period",
23569       FT_UINT16, BASE_DEC, NULL, 0xffff,
23570       NULL, HFILL }},
23571
23572     {&hf_ieee80211_tag_aid,
23573      {"AID", "wlan.sta_avail.aid",
23574       FT_UINT16, BASE_DEC, NULL, 0x00ff,
23575       NULL, HFILL }},
23576
23577     {&hf_ieee80211_tag_cbap,
23578      {"CBAP", "wlan.sta_avail.cbap",
23579       FT_BOOLEAN, 16, NULL, 0x0100,
23580       NULL, HFILL }},
23581
23582     {&hf_ieee80211_tag_pp_avail,
23583      {"PP Available", "wlan.sta_avail.pp_avail",
23584       FT_BOOLEAN, 16, NULL, 0x0200,
23585       NULL, HFILL }},
23586
23587     {&hf_ieee80211_tag_next_ati_start_time,
23588      {"Start Time", "wlan.next_ati.start_time",
23589       FT_UINT32, BASE_DEC, NULL, 0,
23590       NULL, HFILL }},
23591
23592     {&hf_ieee80211_tag_next_ati_duration,
23593      {"ATI Duration", "wlan.next_ati.duration",
23594       FT_UINT16, BASE_DEC, NULL, 0xffff,
23595       NULL, HFILL }},
23596
23597     {&hf_ieee80211_tag_old_bssid,
23598      {"Old BSSID", "wlan.pcp_handover.old_bssid",
23599       FT_ETHER, BASE_NONE, NULL, 0,
23600       "OLD_BSSID", HFILL }},
23601
23602     {&hf_ieee80211_tag_new_pcp_addr,
23603      {"New PCP Address", "wlan.pcp_handover.new_pcp_addr",
23604       FT_ETHER, BASE_NONE, NULL, 0,
23605       "New_PCP_Address", HFILL }},
23606
23607     {&hf_ieee80211_tag_bssid,
23608      {"BSSID", "wlan.quiet_res.bssid",
23609       FT_ETHER, BASE_NONE, NULL, 0,
23610       "BSS-ID", HFILL }},
23611
23612     {&hf_ieee80211_tag_duplex_relay,
23613      {"Duplex", "wlan.relay_capabilities.duplex",
23614       FT_UINT8, BASE_DEC, NULL, 0x01,
23615       NULL, HFILL }},
23616
23617     {&hf_ieee80211_tag_cooperation_relay,
23618      {"Cooperation", "wlan.relay_capabilities.cooperation",
23619       FT_BOOLEAN, 8, NULL, 0x02,
23620       NULL, HFILL }},
23621
23622     {&hf_ieee80211_tag_tx_mode,
23623      {"TX-Mode", "wlan.realy_trans_param.tx_mode",
23624       FT_BOOLEAN, 8, NULL, 0x04,
23625       NULL, HFILL }},
23626
23627     {&hf_ieee80211_tag_link_change_interval,
23628      {"Link Change Interval", "wlan.realy_trans_param.link_change_interval",
23629       FT_UINT8, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xff,
23630       NULL, HFILL }},
23631
23632     {&hf_ieee80211_tag_data_sensing_time,
23633      {"Data Sensing Time", "wlan.realy_trans_param.data_sensing_time",
23634       FT_UINT8, BASE_DEC, NULL, 0xff,
23635       NULL, HFILL }},
23636
23637     {&hf_ieee80211_tag_first_period,
23638      {"First Period", "wlan.realy_trans_param.first_period",
23639       FT_UINT16, BASE_DEC, NULL, 0xffff,
23640       NULL, HFILL }},
23641
23642     {&hf_ieee80211_tag_second_period,
23643      {"Second Period", "wlan.realy_trans_param.second_period",
23644       FT_UINT16, BASE_DEC, NULL, 0xffff,
23645       NULL, HFILL }},
23646
23647     {&hf_ieee80211_tag_initiator,
23648      {"Initiator", "wlan.beam_refine.initiator",
23649       FT_BOOLEAN, 40, NULL, 0x0000000001,
23650       NULL, HFILL }},
23651
23652     {&hf_ieee80211_tag_tx_train_res,
23653      {"TX-train-response", "wlan.beam_refine.tx_train_res",
23654       FT_BOOLEAN, 40, NULL, 0x0000000002,
23655       NULL, HFILL }},
23656
23657     {&hf_ieee80211_tag_rx_train_res,
23658      {"RX-train-response", "wlan.beam_refine.rx_train_res",
23659       FT_BOOLEAN, 40, NULL, 0x0000000004,
23660       NULL, HFILL }},
23661
23662     {&hf_ieee80211_tag_tx_trn_ok,
23663      {"TX-TRN-OK", "wlan.beam_refine.tx_trn_ok",
23664       FT_BOOLEAN, 40, NULL, 0x0000000008,
23665       NULL, HFILL }},
23666
23667     {&hf_ieee80211_tag_txss_fbck_req,
23668      {"TXSS-FBCK-REQ", "wlan.beam_refine.txss_fbck_req",
23669       FT_BOOLEAN, 40, NULL, 0x0000000010,
23670       NULL, HFILL }},
23671
23672     {&hf_ieee80211_tag_bs_fbck,
23673      {"BS-FBCK", "wlan.beam_refine.bs_fbck",
23674       FT_UINT40, BASE_DEC, NULL, 0x00000007e0,
23675       NULL, HFILL }},
23676
23677     {&hf_ieee80211_tag_bs_fbck_antenna_id,
23678      {"BS-FBCK Anetenna ID", "wlan.beam_refine.bs_fbck_antenna_id",
23679       FT_UINT40, BASE_DEC, NULL, 0x0000001800,
23680       NULL, HFILL }},
23681
23682     {&hf_ieee80211_tag_snr_requested,
23683      {"SNR Requested", "wlan.beam_refine.snr_req",
23684       FT_BOOLEAN, 40, NULL, 0x0000002000,
23685       NULL, HFILL }},
23686
23687     {&hf_ieee80211_tag_channel_measurement_requested,
23688      {"Channel Measurement Requested", "wlan.beam_refine.ch_measure_req",
23689       FT_BOOLEAN, 40, NULL, 0x0000004000,
23690       NULL, HFILL }},
23691
23692     {&hf_ieee80211_tag_number_of_taps_requested,
23693      {"Number of Taps Requested", "wlan.beam_refine.taps_req",
23694       FT_UINT40, BASE_DEC | BASE_VAL64_STRING, VALS64(number_of_taps_values), 0x0000018000,
23695       NULL, HFILL }},
23696
23697     {&hf_ieee80211_tag_sector_id_order_req,
23698      {"Sector ID Order Requested", "wlan.beam_refine.sector_id_req",
23699       FT_BOOLEAN, 40, NULL, 0x0000020000,
23700       NULL, HFILL }},
23701
23702     {&hf_ieee80211_tag_snr_present,
23703      {"SNR Present", "wlan.beam_refine.snr_present",
23704       FT_BOOLEAN, 40, NULL, 0x0000040000,
23705       NULL, HFILL }},
23706
23707     {&hf_ieee80211_tag_channel_measurement_present,
23708      {"Channel Measurement Present", "wlan.beam_refine.ch_measure_present",
23709       FT_BOOLEAN, 40, NULL, 0x0000080000,
23710       NULL, HFILL }},
23711
23712     {&hf_ieee80211_tag_tap_delay_present,
23713      {"Tap Delay Present", "wlan.beam_refine.tap_delay_present",
23714       FT_BOOLEAN, 40, NULL, 0x0000100000,
23715       NULL, HFILL }},
23716
23717     {&hf_ieee80211_tag_number_of_taps_present,
23718      {"Number of Taps Present", "wlan.beam_refine.taps_present",
23719       FT_UINT40, BASE_DEC | BASE_VAL64_STRING, VALS64(number_of_taps_values), 0x0000600000,
23720       NULL, HFILL }},
23721
23722     {&hf_ieee80211_tag_number_of_measurement,
23723      {"Number of Measurements", "wlan.beam_refine.num_measurement",
23724       FT_UINT40, BASE_DEC, NULL, 0x003f800000,
23725       NULL, HFILL }},
23726
23727     {&hf_ieee80211_tag_sector_id_order_present,
23728      {"Sector ID Order Present", "wlan.beam_refine.sector_id_present",
23729       FT_BOOLEAN, 40, NULL, 0x0040000000,
23730       NULL, HFILL }},
23731
23732     {&hf_ieee80211_tag_number_of_beams,
23733      {"Number of Beams", "wlan.beam_refine.num_beams",
23734       FT_UINT40, BASE_DEC, NULL, 0x0f80000000,
23735       NULL, HFILL }},
23736
23737     {&hf_ieee80211_tag_mid_extension,
23738      {"MID Extension", "wlan.beam_refine.mid_ext",
23739       FT_BOOLEAN, 40, NULL, 0x1000000000,
23740       NULL, HFILL }},
23741
23742     {&hf_ieee80211_tag_capability_request,
23743      {"Capability Request", "wlan.beam_refine.cap_req",
23744       FT_BOOLEAN, 40, NULL, 0x2000000000,
23745       NULL, HFILL }},
23746
23747     {&hf_ieee80211_tag_beam_refine_reserved,
23748      {"Reserved", "wlan.beam_refine.reserved",
23749       FT_UINT40, BASE_DEC, NULL, 0xc000000000,
23750       NULL, HFILL }},
23751
23752     {&hf_ieee80211_tag_nextpcp_list,
23753       {"AID of NextPCP", "wlan.next_pcp.list",
23754        FT_UINT8, BASE_DEC, NULL, 0,
23755        NULL, HFILL }},
23756
23757     {&hf_ieee80211_tag_nextpcp_token,
23758       {"NextPCP List Token", "wlan.next_pcp.token",
23759        FT_UINT8, BASE_DEC, NULL, 0,
23760        NULL, HFILL }},
23761
23762     {&hf_ieee80211_tag_reamaining_BI,
23763       {"Remaining BI's", "wlan.pcp_handover.remaining_BIs",
23764        FT_UINT8, BASE_DEC, NULL, 0,
23765        NULL, HFILL }},
23766
23767     {&hf_ieee80211_tag_request_token,
23768       {"Request Token", "wlan.request_token",
23769        FT_UINT16, BASE_DEC, NULL, 0,
23770        NULL, HFILL }},
23771
23772     {&hf_ieee80211_tag_bi_start_time,
23773       {"BI Start Time", "wlan.bi_start_time",
23774        FT_UINT32, BASE_DEC, NULL, 0,
23775        NULL, HFILL }},
23776
23777     {&hf_ieee80211_tag_sleep_cycle,
23778       {"Sleep Cycle", "wlan.sleep_cycle",
23779        FT_UINT16, BASE_DEC, NULL, 0,
23780        NULL, HFILL }},
23781
23782     {&hf_ieee80211_tag_num_awake_bis,
23783       {"Number of Awake/Doze BIs", "wlan.num_awake_bis",
23784        FT_UINT16, BASE_DEC, NULL, 0,
23785        NULL, HFILL }},
23786
23787     {&hf_ieee80211_ff_dmg_action_code,
23788      {"DMG Action", "wlan.fixed.dmg_act",
23789       FT_UINT8, BASE_HEX, VALS(ff_dmg_action_flags), 0,
23790       "Action Code", HFILL }},
23791
23792     {&hf_ieee80211_ff_unprotected_dmg_action_code,
23793      {"Unprotected DMG Action", "wlan.fixed.unprotected_dmg_act",
23794       FT_UINT8, BASE_HEX, VALS(ff_unprotected_dmg_action_flags), 0,
23795       "Action Code", HFILL }},
23796
23797     {&hf_ieee80211_ff_dmg_pwr_mgmt,
23798       {"DMG Power Management", "wlan.dmg.pwr_mgmt",
23799        FT_BOOLEAN, 8, NULL, 0x01,
23800        NULL, HFILL }},
23801
23802     {&hf_ieee80211_ff_subject_address,
23803       {"Subject Address", "wlan.dmg.subject_addr",
23804        FT_ETHER, BASE_NONE, NULL, 0,
23805        "MAC address of requested STA", HFILL }},
23806
23807     {&hf_ieee80211_ff_handover_reason,
23808       {"Handover Reason", "wlan.dmg.handover_reason",
23809        FT_UINT8, BASE_DEC, NULL, 0x03,
23810        NULL, HFILL }},
23811
23812     {&hf_ieee80211_ff_handover_remaining_bi,
23813       {"Handover Remaining BI", "wlan.dmg.handover_remaining_bi",
23814        FT_UINT8, BASE_DEC, NULL, 0x01,
23815        NULL, HFILL }},
23816
23817     {&hf_ieee80211_ff_handover_result,
23818       {"Handover Result", "wlan.dmg.handover_result",
23819        FT_UINT8, BASE_DEC, NULL, 0x01,
23820        NULL, HFILL }},
23821
23822     {&hf_ieee80211_ff_handover_reject_reason,
23823       {"Handover Reject Reason", "wlan.dmg.handover_reject_reason",
23824        FT_UINT8, BASE_DEC, NULL, 0x03,
23825        NULL, HFILL }},
23826
23827     {&hf_ieee80211_ff_destination_reds_aid,
23828       {"Destination REDS AID", "wlan.dmg.destination_reds_aid",
23829        FT_UINT16, BASE_DEC, NULL, 0,
23830        NULL, HFILL }},
23831
23832     {&hf_ieee80211_ff_destination_aid,
23833       {"Destination AID", "wlan.dmg.destination_aid",
23834        FT_UINT16, BASE_DEC, NULL, 0,
23835        NULL, HFILL }},
23836
23837     {&hf_ieee80211_ff_realy_aid,
23838       {"Relay AID", "wlan.dmg.realy_aid",
23839        FT_UINT16, BASE_DEC, NULL, 0,
23840        NULL, HFILL }},
23841
23842     {&hf_ieee80211_ff_source_aid,
23843       {"Source AID", "wlan.dmg.source_aid",
23844        FT_UINT16, BASE_DEC, NULL, 0,
23845        NULL, HFILL }},
23846
23847     {&hf_ieee80211_ff_timing_offset,
23848       {"Timing Offset", "wlan.dmg.timing_offset",
23849        FT_UINT16, BASE_DEC, NULL, 0,
23850        NULL, HFILL }},
23851
23852     {&hf_ieee80211_ff_sampling_frequency_offset,
23853       {"Sampling Frequency Offset", "wlan.dmg.sampling_frequency_offset",
23854        FT_UINT16, BASE_DEC, NULL, 0,
23855        NULL, HFILL }},
23856
23857     {&hf_ieee80211_ff_relay_operation_type,
23858       {"Relay Operation Type", "wlan.dmg.relay_operation_type",
23859        FT_UINT8, BASE_DEC, NULL, 0x03,
23860        NULL, HFILL }},
23861
23862     {&hf_ieee80211_ff_peer_sta_aid,
23863       {"Peer STA AID", "wlan.dmg.peer_sta_aid",
23864        FT_UINT8, BASE_DEC, NULL, 0,
23865        NULL, HFILL }},
23866
23867     {&hf_ieee80211_ff_snr,
23868       {"SNR", "wlan.dmg.snr",
23869        FT_UINT8, BASE_DEC, NULL, 0,
23870        NULL, HFILL }},
23871
23872     {&hf_ieee80211_ff_internal_angle,
23873       {"Internal Angle", "wlan.dmg.internal_angle",
23874        FT_UINT8, BASE_DEC, NULL, 0xfe,
23875        NULL, HFILL }},
23876
23877     {&hf_ieee80211_ff_recommend,
23878       {"Recommend", "wlan.dmg.recommend",
23879        FT_UINT8, BASE_DEC, NULL, 0x01,
23880        NULL, HFILL }},
23881
23882     {&hf_ieee80211_ff_fst_action_code,
23883       {"FST Action Code", "wlan.fst.action_code",
23884        FT_UINT8, BASE_HEX, VALS(ff_fst_action_flags), 0,
23885        "Action Code", HFILL }},
23886
23887     {&hf_ieee80211_ff_llt,
23888       {"Link Loss Timeout", "wlan.fst.llt",
23889        FT_UINT32, BASE_DEC, NULL, 0,
23890        NULL, HFILL }},
23891
23892     {&hf_ieee80211_ff_fsts_id,
23893       {"FSTS ID", "wlan.session_trans.fsts_id",
23894        FT_UINT32, BASE_DEC, NULL, 0,
23895        NULL, HFILL }},
23896
23897     {&hf_ieee80211_ff_mmpdu_len,
23898       {"MMPDU Length", "wlan.fst.mmpdu_length",
23899        FT_UINT16, BASE_DEC, NULL, 0,
23900        NULL, HFILL }},
23901
23902     {&hf_ieee80211_ff_mmpdu_ctrl,
23903       {"MMPDU Control", "wlan.fst.mmpdu_ctrl",
23904        FT_UINT16, BASE_HEX, NULL, 0,
23905        NULL, HFILL }},
23906
23907     {&hf_ieee80211_ff_oct_mmpdu,
23908       {"OCT MMPDU", "wlan.fst.oct_mmpdu",
23909        FT_BYTES, BASE_NONE, NULL, 0,
23910        NULL, HFILL }},
23911
23912     {&hf_ieee80211_ff_vht_mimo_cntrl,
23913      {"VHT MIMO Control", "wlan.vht.mimo_control.control",
23914       FT_UINT24, BASE_HEX, NULL, 0x0,
23915       NULL, HFILL }},
23916
23917     {&hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
23918      {"Nc Index", "wlan.vht.mimo_control.ncindex",
23919       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nc_index_vals), 0x000007,
23920       "Number of Columns Less One", HFILL }},
23921
23922     {&hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
23923      {"Nr Index", "wlan.vht.mimo_control.nrindex",
23924       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nr_index_vals), 0x000038,
23925       "Number of Rows Less One", HFILL }},
23926
23927     {&hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
23928      {"Channel Width", "wlan.vht.mimo_control.chanwidth",
23929       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_channel_width_vals), 0x0000C0,
23930       NULL, HFILL }},
23931
23932     {&hf_ieee80211_ff_vht_mimo_cntrl_grouping,
23933      {"Grouping (Ng)", "wlan.vht.mimo_control.grouping",
23934       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_grouping_vals), 0x000300,
23935       NULL, HFILL }},
23936
23937     {&hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
23938      {"Codebook Information", "wlan.vht.mimo_control.codebookinfo",
23939       FT_UINT24, BASE_HEX, NULL, 0x000400,
23940       NULL, HFILL }},
23941
23942     {&hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
23943      {"Feedback Type", "wlan.vht.mimo_control.feedbacktype",
23944       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_feedback_vals), 0x000800,
23945       NULL, HFILL }},
23946
23947     {&hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
23948      {"Remaining Feedback Segments", "wlan.vht.mimo_control.remainingfeedbackseg",
23949       FT_UINT24, BASE_HEX, NULL, 0x007000,
23950       NULL, HFILL }},
23951
23952     {&hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
23953      {"First Feedback Segments", "wlan.vht.mimo_control.firstfeedbackseg",
23954       FT_UINT24, BASE_HEX, NULL, 0x008000,
23955       NULL, HFILL }},
23956
23957     {&hf_ieee80211_ff_vht_mimo_cntrl_reserved,
23958      {"Reserved", "wlan.vht.mimo_control.reserved",
23959       FT_UINT24, BASE_HEX, NULL, 0x030000,
23960       NULL, HFILL }},
23961
23962     {&hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
23963      {"Sounding Dialog Token Number", "wlan.vht.mimo_control.sounding_dialog_tocken_nbr",
23964       FT_UINT24, BASE_HEX, NULL, 0xFC0000,
23965       NULL, HFILL }},
23966
23967     {&hf_ieee80211_ff_vht_action,
23968       {"VHT Action", "wlan.vht.action",
23969        FT_UINT8, BASE_DEC, VALS(vht_action_vals), 0,
23970        NULL, HFILL }},
23971
23972     {&hf_ieee80211_vht_compressed_beamforming_report,
23973       {"VHT Compressed Beamforming Report", "wlan.vht.compressed_beamforming_report",
23974        FT_BYTES, BASE_NONE, NULL, 0,
23975        NULL, HFILL }},
23976
23977     {&hf_ieee80211_vht_mu_exclusive_beamforming_report,
23978       {"VHT MU Exclusive Beamforming Report","wlan.vht.exclusive_beamforming_report",
23979        FT_BYTES, BASE_NONE, NULL, 0,
23980        NULL, HFILL }},
23981
23982     {&hf_ieee80211_vht_compressed_beamforming_report_snr,
23983       {"Signal to Noise Ratio (SNR)", "wlan.vht.compressed_beamforming_report.snr",
23984        FT_INT8, BASE_DEC, NULL, 0,
23985        NULL, HFILL }},
23986
23987     {&hf_ieee80211_vht_compressed_beamforming_phi_angle,
23988       {"PHI", "wlan.vht.compressed_beamforming_report.phi",
23989        FT_NONE, BASE_NONE, NULL, 0,
23990        NULL, HFILL }},
23991
23992     {&hf_ieee80211_vht_compressed_beamforming_psi_angle,
23993       {"PSI", "wlan.vht.compressed_beamforming_report.psi",
23994        FT_NONE, BASE_NONE, NULL, 0,
23995        NULL, HFILL }},
23996
23997     {&hf_ieee80211_vht_compressed_beamforming_feedback_matrix,
23998       {"Compressed Beamforming Feedback Matrix", "wlan.vht.compressed_beamforming_report.feedback_matrix",
23999        FT_NONE, BASE_NONE, NULL, 0,
24000        NULL, HFILL }},
24001
24002     {&hf_ieee80211_vht_mu_Exclusive_beamforming_delta_snr,
24003       {"Delta SNR for space-time stream Nc for subcarrier k", "wlan.vht.exclusive_beamforming_report.delta_snr",
24004        FT_NONE, BASE_NONE, NULL, 0,
24005        NULL, HFILL }},
24006
24007     {&hf_ieee80211_vht_group_id_management,
24008       {"Group ID Management", "wlan.vht.group_id_management",
24009        FT_BYTES, BASE_NONE, NULL, 0,
24010        NULL, HFILL }},
24011
24012     {&hf_ieee80211_vht_membership_status_array,
24013       {"Membership Status Array", "wlan.vht.membership_status_array",
24014        FT_BYTES, BASE_NONE, NULL, 0,
24015        NULL, HFILL }},
24016
24017       {&hf_ieee80211_vht_user_position_array,
24018         {"User Position Array", "wlan.vht.user_position_array",
24019          FT_BYTES, BASE_NONE, NULL, 0,
24020          NULL, HFILL }},
24021
24022       {&hf_ieee80211_vht_membership_status_field,
24023         {"Membership Status Field", "wlan.vht.membership_status_array.field",
24024          FT_UINT8, BASE_DEC, NULL, 0,
24025          NULL, HFILL }},
24026
24027       {&hf_ieee80211_vht_user_position_field,
24028         {"User Position Field", "wlan.vht.user_position_array.field",
24029          FT_UINT8, BASE_DEC, NULL, 0,
24030          NULL, HFILL }},
24031
24032     {&hf_ieee80211_vht_operation_mode_notification,
24033       {"Operation Mode Notification", "wlan.vht.operation_mode_notification",
24034        FT_BYTES, BASE_NONE, NULL, 0,
24035        NULL, HFILL }},
24036
24037     {&hf_ieee80211_ff_he_action,
24038       {"HE Action", "wlan.he.action",
24039        FT_UINT8, BASE_DEC, VALS(he_action_vals), 0,
24040        NULL, HFILL }},
24041
24042     {&hf_he_mimo_control_nc_index,
24043      {"Nc Index", "wlan.he.mimo.nc_index",
24044       FT_UINT40, BASE_DEC, NULL, 0x0000000007, NULL, HFILL }},
24045
24046     {&hf_he_mimo_control_nr_index,
24047      {"Nr Index", "wlan.he.mimo.nr_index",
24048       FT_UINT40, BASE_DEC, NULL, 0x0000000038, NULL, HFILL }},
24049
24050     {&hf_he_mimo_control_bw,
24051      {"BW", "wlan.he.mimo.bw",
24052       FT_UINT40, BASE_DEC, NULL, 0x00000000C0, NULL, HFILL }},
24053
24054     {&hf_he_mimo_control_grouping,
24055      {"Grouping", "wlan.he.mimo.grouping",
24056       FT_UINT40, BASE_DEC, NULL, 0x0000000100, NULL, HFILL }},
24057
24058     {&hf_he_mimo_control_codebook_info,
24059      {"Codebook Information", "wlan.he.mimo.codebook_info",
24060       FT_UINT40, BASE_DEC, NULL, 0x0000000200, NULL, HFILL }},
24061
24062     {&hf_he_mimo_control_feedback_type,
24063      {"Feedback Type", "wlan.he.mimo.feedback_type",
24064       FT_UINT40, BASE_DEC, NULL, 0x0000000C00, NULL, HFILL }},
24065
24066     {&hf_he_mimo_control_remaining_feedback_segs,
24067      {"Remaining Feedback Segments", "wlan.he.mimo.remaining_feedback_segs",
24068       FT_UINT40, BASE_DEC, NULL, 0x0000007000, NULL, HFILL }},
24069
24070     {&hf_he_mimo_control_first_feedback_seg,
24071      {"First Feedback Segment", "wlan.he.mimo.first_feedback_seg",
24072       FT_UINT40, BASE_DEC, NULL, 0x0000008000, NULL, HFILL }},
24073
24074     {&hf_he_mimo_control_ru_start_index,
24075      {"RU Start Index", "wlan.he.mimo.ru_start_index",
24076       FT_UINT40, BASE_HEX, NULL, 0x00007F0000, NULL, HFILL }},
24077
24078     {&hf_he_mimo_control_ru_end_index,
24079      {"RU End Index", "wlan.he.mimo.ru_end_index",
24080       FT_UINT40, BASE_HEX, NULL, 0x003F800000, NULL, HFILL }},
24081
24082     {&hf_he_mimo_control_sounding_dialog_token_num,
24083      {"Sounding Dialog Token Number", "wlan.he.mimo.sounding_dialog_token_num",
24084       FT_UINT40, BASE_DEC, NULL, 0x0FC0000000, NULL, HFILL }},
24085
24086     {&hf_he_mimo_control_reserved,
24087      {"Reserved", "wlan.he.mimo.reserved",
24088       FT_UINT40, BASE_DEC, NULL, 0xF000000000, NULL, HFILL }},
24089
24090     {&hf_ieee80211_he_mimo_control_field,
24091      {"HE MIMO Control", "wlan.he.action.he_mimo_control",
24092       FT_UINT40, BASE_HEX, NULL, 0x0, NULL, HFILL }},
24093
24094     {&hf_ieee80211_tag_tspec_allocation_id,
24095       {"Allocation ID", "wlan.dmg_tspec.allocation_id",
24096        FT_UINT24, BASE_DEC, NULL, 0x00000f,
24097        NULL, HFILL }},
24098
24099     {&hf_ieee80211_tag_tspec_allocation_type,
24100       {"Allocation Type", "wlan.dmg_tspec.allocation_type",
24101        FT_UINT24, BASE_DEC, NULL, 0x000070,
24102        NULL, HFILL }},
24103
24104     {&hf_ieee80211_tag_tspec_allocation_format,
24105       {"Allocation Format", "wlan.dmg_tspec.allocation_format",
24106        FT_BOOLEAN, 24, NULL, 0x000080,
24107        NULL, HFILL }},
24108
24109     {&hf_ieee80211_tag_tspec_pseudo_static,
24110       {"Pseudo Static", "wlan.dmg_tspec.pseudo_static",
24111        FT_BOOLEAN, 24, NULL, 0x000100,
24112        NULL, HFILL }},
24113
24114     {&hf_ieee80211_tag_tspec_truncatable,
24115       {"Truncatable", "wlan.dmg_tspec.truncatable",
24116        FT_BOOLEAN, 24, NULL, 0x000200,
24117        NULL, HFILL }},
24118
24119     {&hf_ieee80211_tag_tspec_extendable,
24120       {"Extendable", "wlan.dmg_tspec.extendable",
24121        FT_BOOLEAN, 24, NULL, 0x000400,
24122        NULL, HFILL }},
24123
24124     {&hf_ieee80211_tag_tspec_lp_sc_used,
24125       {"LP SC Usec", "wlan.dmg_tspec.lp_sc_used",
24126        FT_BOOLEAN, 24, NULL, 0x000800,
24127        NULL, HFILL }},
24128
24129     {&hf_ieee80211_tag_tspec_up,
24130       {"UP", "wlan.dmg_tspec.up",
24131        FT_UINT24, BASE_HEX, NULL, 0x007000,
24132        NULL, HFILL }},
24133
24134     {&hf_ieee80211_tag_tspec_dest_aid,
24135       {"Destination AID", "wlan.dmg_tspec.dest_aid",
24136        FT_UINT24, BASE_HEX, NULL, 0x7f8000,
24137        NULL, HFILL }},
24138
24139     {&hf_ieee80211_tag_tspec_allocation_period,
24140       {"Allocation Period", "wlan.dmg_tspec.allocation_period",
24141        FT_UINT16, BASE_DEC, NULL, 0,
24142        NULL, HFILL }},
24143
24144     {&hf_ieee80211_tag_tspec_min_allocation,
24145       {"Minimal Allocation", "wlan.dmg_tspec.min_allocation",
24146        FT_UINT16, BASE_DEC, NULL, 0,
24147        NULL, HFILL }},
24148
24149     {&hf_ieee80211_tag_tspec_max_allocation,
24150       {"Maximal Allocation", "wlan.dmg_tspec.max_allocation",
24151        FT_UINT16, BASE_DEC, NULL, 0,
24152        NULL, HFILL }},
24153
24154     {&hf_ieee80211_tag_tspec_min_duration,
24155       {"Minimal Duration", "wlan.dmg_tspec.min_duration",
24156        FT_UINT16, BASE_DEC, NULL, 0,
24157        NULL, HFILL }},
24158
24159     {&hf_ieee80211_tag_tspec_num_of_constraints,
24160       {"Number Of Constraints", "wlan.dmg_tspec.num_of_constraints",
24161        FT_UINT8, BASE_DEC, NULL, 0,
24162        NULL, HFILL }},
24163
24164     {&hf_ieee80211_tag_tspec_tsconst_start_time,
24165       {"TS Constraint Start Time", "wlan.dmg_tspec.tsconst.start_time",
24166        FT_UINT32, BASE_DEC, NULL, 0,
24167        NULL, HFILL }},
24168
24169     {&hf_ieee80211_tag_tspec_tsconst_duration,
24170       {"TS Constraint Duration", "wlan.dmg_tspec.tsconst.duration",
24171        FT_UINT16, BASE_DEC, NULL, 0,
24172        NULL, HFILL }},
24173
24174     {&hf_ieee80211_tag_tspec_tsconst_period,
24175       {"TS Constraint Period", "wlan.dmg_tspec.tsconst.period",
24176        FT_UINT16, BASE_DEC, NULL, 0,
24177        NULL, HFILL }},
24178
24179     {&hf_ieee80211_tag_tspec_tsconst_interferer_mac,
24180       {"TS Constraint Interferer MAC Address", "wlan.dmg_tspec.tsconst.interferer_mac",
24181        FT_ETHER, BASE_NONE, NULL, 0,
24182        NULL, HFILL }},
24183
24184     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_I,
24185       {"Channel Measurement Feedback Relative I", "wlan.ch_meas_fb.realtive_I",
24186        FT_UINT8, BASE_DEC, NULL, 0,
24187        NULL, HFILL }},
24188
24189     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_Q,
24190       {"Channel Measurement Feedback Relative Q", "wlan.ch_meas_fb.realtive_Q",
24191        FT_UINT8, BASE_DEC, NULL, 0,
24192        NULL, HFILL }},
24193
24194     {&hf_ieee80211_tag_channel_measurement_feedback_tap_delay,
24195       {"Channel Measurement Feedback Tap Delay", "wlan.ch_meas_fb.tap_delay",
24196        FT_UINT8, BASE_DEC, NULL, 0,
24197        NULL, HFILL }},
24198
24199     {&hf_ieee80211_tag_channel_measurement_feedback_sector_id,
24200       {"Channel Measurement Feedback Secotr ID", "wlan.ch_meas_fb.sector_id",
24201        FT_UINT8, BASE_DEC, NULL, 0xfc,
24202        NULL, HFILL }},
24203
24204     {&hf_ieee80211_tag_channel_measurement_feedback_antenna_id,
24205       {"Channel Measurement Feedback Antenna ID", "wlan.ch_meas_fb.antenna_id",
24206        FT_UINT8, BASE_DEC, NULL, 0x03,
24207        NULL, HFILL }},
24208
24209     {&hf_ieee80211_tag_awake_window,
24210       {"Awake Window", "wlan.awake_window",
24211        FT_UINT16, BASE_DEC, NULL, 0,
24212        NULL, HFILL }},
24213
24214     {&hf_ieee80211_tag_addba_ext_no_frag,
24215       {"ADDBA No Fragmentation", "wlan.addba.no_frag",
24216        FT_BOOLEAN, 8, NULL, 0x01,
24217        NULL, HFILL }},
24218
24219     {&hf_ieee80211_tag_addba_ext_he_fragmentation_operation,
24220       {"ADDBA HE Fragmentation Operation", "wlan.addba.he_frag_oper",
24221        FT_UINT8, BASE_HEX, NULL, 0x06,
24222        NULL, HFILL }},
24223
24224     {&hf_ieee80211_tag_addba_ext_reserved,
24225       {"Reserved", "wlan.addba.he_frag_oper",
24226        FT_UINT8, BASE_HEX, NULL, 0xF8,
24227        NULL, HFILL }},
24228
24229     {&hf_ieee80211_tag_multi_band_ctrl_sta_role,
24230       {"STA Rold", "wlan.multi_band.ctrl_sta_role",
24231        FT_UINT8, BASE_DEC, NULL, 0xe0,
24232        NULL, HFILL }},
24233
24234     {&hf_ieee80211_tag_multi_band_ctrl_addr_present,
24235       {"STA MAC Address Present", "wlan.multi_band.ctrl_addr_present",
24236        FT_BOOLEAN, 8, NULL, 0x10,
24237        NULL, HFILL }},
24238
24239     {&hf_ieee80211_tag_multi_band_ctrl_cipher_present,
24240       {"PCS Present", "wlan.multi_band.ctrl_cipher_present",
24241        FT_BOOLEAN, 8, NULL, 0x08,
24242        NULL, HFILL }},
24243
24244     {&hf_ieee80211_tag_multi_band_oper_class,
24245       {"Operating Class", "wlan.multi_band.oper_class",
24246        FT_UINT8, BASE_DEC, NULL, 0,
24247        NULL, HFILL }},
24248
24249     {&hf_ieee80211_tag_multi_band_channel_number,
24250       {"Channel Number", "wlan.multi_band.channel_number",
24251        FT_UINT8, BASE_DEC, NULL, 0,
24252        NULL, HFILL }},
24253
24254     {&hf_ieee80211_tag_multi_band_tsf_offset,
24255       {"TSF Offset", "wlan.multi_band.tsf_offset",
24256        FT_UINT64, BASE_DEC, NULL, 0,
24257        NULL, HFILL }},
24258
24259     {&hf_ieee80211_tag_multi_band_conn_ap,
24260       {"Connection Capability AP", "wlan.multi_band.conn_ap",
24261        FT_BOOLEAN, 8, NULL, 0x80,
24262        NULL, HFILL }},
24263
24264     {&hf_ieee80211_tag_multi_band_conn_pcp,
24265       {"Connection Capability PCP", "wlan.multi_band.conn_pcp",
24266        FT_BOOLEAN, 8, NULL, 0x40,
24267        NULL, HFILL }},
24268
24269     {&hf_ieee80211_tag_multi_band_conn_dls,
24270       {"Connection Capability DLS", "wlan.multi_band.conn_dls",
24271        FT_BOOLEAN, 8, NULL, 0x20,
24272        NULL, HFILL }},
24273
24274     {&hf_ieee80211_tag_multi_band_conn_tdls,
24275       {"Connection Capability TDLS", "wlan.multi_band.conn_tdls",
24276        FT_BOOLEAN, 8, NULL, 0x10,
24277        NULL, HFILL }},
24278
24279     {&hf_ieee80211_tag_multi_band_conn_ibss,
24280       {"Connection Capability IBSS", "wlan.multi_band.conn_ibss",
24281        FT_BOOLEAN, 8, NULL, 0x08,
24282        NULL, HFILL }},
24283
24284     {&hf_ieee80211_tag_multi_band_fst_timeout,
24285       {"FST Session Timeout", "wlan.multi_band.fst_timeout",
24286        FT_UINT8, BASE_DEC, NULL, 0,
24287        NULL, HFILL }},
24288
24289     {&hf_ieee80211_tag_multi_band_sta_mac,
24290       {"Transmitting STA MAC Address", "wlan.multi_band.sta_mac",
24291        FT_ETHER, BASE_NONE, NULL, 0,
24292        NULL, HFILL }},
24293
24294     {&hf_ieee80211_tag_activity,
24295       {"Activity", "wlan.activity",
24296        FT_UINT8, BASE_DEC, NULL, 0,
24297        NULL, HFILL }},
24298
24299     {&hf_ieee80211_tag_dmg_link_adapt_mcs,
24300       {"MCS", "wlan.dmg_link_adapt.mcs",
24301        FT_UINT8, BASE_DEC, NULL, 0,
24302        NULL, HFILL }},
24303
24304     {&hf_ieee80211_tag_dmg_link_adapt_link_margin,
24305       {"Link Margin", "wlan.dmg_link_adapt.link_margin",
24306        FT_UINT8, BASE_DEC, NULL, 0,
24307        NULL, HFILL }},
24308
24309     {&hf_ieee80211_tag_ref_timestamp,
24310       {"Reference Timestamp", "wlan.ref_timestamp",
24311        FT_UINT32, BASE_DEC, NULL, 0,
24312        NULL, HFILL }},
24313
24314     {&hf_ieee80211_tag_switching_stream_non_qos,
24315       {"Non-Qos Data Frames", "wlan.switching_stream.non_qos",
24316        FT_BOOLEAN, 8, NULL, 0,
24317        NULL, HFILL }},
24318
24319     {&hf_ieee80211_tag_switching_stream_param_num,
24320       {"Number Of Switching Stream Elements", "wlan.switching_stream.param_num",
24321        FT_UINT8, BASE_DEC, NULL, 0,
24322        NULL, HFILL }},
24323
24324     {&hf_ieee80211_tag_switching_stream_old_tid,
24325       {"Old Band TID", "wlan.switching_stream.old_tid",
24326        FT_UINT16, BASE_DEC, NULL, 0xf000,
24327        NULL, HFILL }},
24328
24329     {&hf_ieee80211_tag_switching_stream_old_direction,
24330       {"Old Band Direction", "wlan.switching_stream.old_direction",
24331        FT_BOOLEAN, 16, NULL, 0x0800,
24332        NULL, HFILL }},
24333
24334     {&hf_ieee80211_tag_switching_stream_new_tid,
24335       {"New Band TID", "wlan.switching_stream.new_tid",
24336        FT_UINT16, BASE_DEC, NULL, 0x0780,
24337        NULL, HFILL }},
24338
24339     {&hf_ieee80211_tag_switching_stream_new_direction,
24340       {"New Band Direction", "wlan.switching_stream.new_direction",
24341        FT_BOOLEAN, 16, NULL, 0x0040,
24342        NULL, HFILL }},
24343
24344     {&hf_ieee80211_tag_switching_stream_new_valid_id,
24345       {"Stream ID in New Band Valid", "wlan.switching_stream.new_valid_id",
24346        FT_BOOLEAN, 16, NULL, 0x0020,
24347        NULL, HFILL }},
24348
24349     {&hf_ieee80211_tag_switching_stream_llt_type,
24350       {"LLT Type", "wlan.switching_stream.llt_type",
24351        FT_BOOLEAN, 16, NULL, 0x0010,
24352        NULL, HFILL }},
24353
24354     {&hf_ieee80211_ff_timestamp,
24355      {"Timestamp", "wlan.fixed.timestamp",
24356       FT_UINT64, BASE_HEX, NULL, 0,
24357       NULL, HFILL }},
24358
24359     {&hf_ieee80211_ff_auth_alg,
24360      {"Authentication Algorithm", "wlan.fixed.auth.alg",
24361       FT_UINT16, BASE_DEC, VALS(auth_alg), 0,
24362       NULL, HFILL }},
24363
24364     {&hf_ieee80211_ff_beacon_interval,
24365      {"Beacon Interval", "wlan.fixed.beacon",
24366       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
24367       NULL, HFILL }},
24368
24369     {&hf_ieee80211_fixed_parameters,
24370      {"Fixed parameters", "wlan.fixed.all",
24371       FT_NONE, BASE_NONE, NULL, 0,
24372       NULL, HFILL }},
24373
24374     {&hf_ieee80211_tagged_parameters,
24375      {"Tagged parameters", "wlan.tagged.all",
24376       FT_NONE, BASE_NONE, NULL, 0,
24377       NULL, HFILL }},
24378
24379     {&hf_ieee80211_tag_ssid,
24380      {"SSID", "wlan.ssid",
24381       FT_STRING, BASE_NONE, NULL, 0,
24382       "Indicates the identity of an ESS or IBSS", HFILL }},
24383
24384     {&hf_ieee80211_tag_supp_rates,
24385      {"Supported Rates", "wlan.supported_rates",
24386       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
24387       "In Mbit/sec, (B) for Basic Rates", HFILL }},
24388
24389     {&hf_ieee80211_tag_fh_dwell_time,
24390      {"Dwell Time", "wlan.fh.dwell_time",
24391       FT_UINT16, BASE_HEX, NULL, 0x0,
24392       "In Time Unit (TU)", HFILL }},
24393
24394     {&hf_ieee80211_tag_fh_hop_set,
24395      {"Hop Set", "wlan.fh.hop_set",
24396       FT_UINT8, BASE_DEC, NULL, 0x0,
24397       NULL, HFILL }},
24398
24399     {&hf_ieee80211_tag_fh_hop_pattern,
24400      {"Hop Pattern", "wlan.fh.hop_pattern",
24401       FT_UINT8, BASE_DEC, NULL, 0x0,
24402       NULL, HFILL }},
24403
24404     {&hf_ieee80211_tag_fh_hop_index,
24405      {"Hop Index", "wlan.fh.hop_index",
24406       FT_UINT8, BASE_DEC, NULL, 0x0,
24407       NULL, HFILL }},
24408
24409     {&hf_ieee80211_ff_block_ack_params,
24410      {"Block Ack Parameters", "wlan.fixed.baparams",
24411       FT_UINT16, BASE_HEX, NULL, 0,
24412       NULL, HFILL }},
24413
24414     {&hf_ieee80211_ff_block_ack_params_amsdu_permitted,
24415      {"A-MSDUs", "wlan.fixed.baparams.amsdu",
24416       FT_BOOLEAN, 16, TFS(&ff_block_ack_params_amsdu_permitted_flag), 0x0001,
24417       "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
24418
24419     {&hf_ieee80211_ff_block_ack_params_policy,
24420      {"Block Ack Policy", "wlan.fixed.baparams.policy",
24421       FT_BOOLEAN, 16, TFS(&ff_block_ack_params_policy_flag), 0x0002,
24422       NULL, HFILL }},
24423
24424     {&hf_ieee80211_ff_block_ack_params_tid,
24425      {"Traffic Identifier", "wlan.fixed.baparams.tid",
24426       FT_UINT16, BASE_HEX, NULL, 0x003C,
24427       NULL, HFILL }},
24428
24429     {&hf_ieee80211_ff_block_ack_params_buffer_size,
24430      {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan.fixed.baparams.buffersize",
24431       FT_UINT16, BASE_DEC, NULL, 0xFFC0,
24432       "Number of Buffers", HFILL }},
24433
24434     {&hf_ieee80211_ff_block_ack_timeout,
24435      {"Block Ack Timeout", "wlan.fixed.batimeout",
24436       FT_UINT16, BASE_HEX, NULL, 0,
24437       NULL, HFILL }},
24438
24439     {&hf_ieee80211_ff_block_ack_ssc,
24440      {"Block Ack Starting Sequence Control (SSC)", "wlan.fixed.ssc",
24441       FT_UINT16, BASE_HEX, 0, 0,
24442       NULL, HFILL }},
24443
24444     {&hf_ieee80211_ff_block_ack_ssc_fragment,
24445      {"Fragment", "wlan.fixed.ssc.fragment",
24446       FT_UINT16, BASE_DEC, 0, 0x000f,
24447       NULL, HFILL }},
24448
24449     {&hf_ieee80211_ff_block_ack_ssc_sequence,
24450      {"Starting Sequence Number", "wlan.fixed.ssc.sequence",
24451       FT_UINT16, BASE_DEC, 0, 0xfff0,
24452       NULL, HFILL }},
24453
24454     {&hf_ieee80211_ff_delba_param,
24455      {"Delete Block Ack (DELBA) Parameter Set", "wlan.fixed.delba.param",
24456       FT_UINT16, BASE_HEX, 0, 0,
24457       NULL, HFILL }},
24458
24459     {&hf_ieee80211_ff_delba_param_reserved,
24460      {"Reserved", "wlan.fixed.delba.param.reserved",
24461       FT_UINT16, BASE_HEX, 0, 0x07ff,
24462       NULL, HFILL }},
24463
24464     {&hf_ieee80211_ff_delba_param_init,
24465      {"Initiator", "wlan.fixed.delba.param.initiator",
24466       FT_BOOLEAN, 16, 0, 0x0800,
24467       NULL, HFILL }},
24468
24469     {&hf_ieee80211_ff_delba_param_tid,
24470      {"TID", "wlan.fixed.delba.param.tid",
24471       FT_UINT16, BASE_HEX, 0, 0xf000,
24472       "Traffic Identifier (TID)", HFILL }},
24473
24474     {&hf_ieee80211_ff_max_reg_pwr,
24475      {"Maximum Regulation Power", "wlan.fixed.maxregpwr",
24476       FT_UINT16, BASE_HEX, 0, 0,
24477       NULL, HFILL }},
24478
24479     {&hf_ieee80211_ff_measurement_pilot_int,
24480      {"Measurement Pilot Interval", "wlan.fixed.msmtpilotint",
24481       FT_UINT8, BASE_HEX, 0, 0,
24482       "Measurement Pilot Interval Fixed Field", HFILL }},
24483
24484     {&hf_ieee80211_ff_country_str,
24485      {"Country String", "wlan.fixed.country",
24486       FT_STRING, BASE_NONE, 0, 0,
24487       NULL, HFILL }},
24488
24489     {&hf_ieee80211_ff_max_tx_pwr,
24490      {"Maximum Transmit Power", "wlan.fixed.maxtxpwr",
24491       FT_UINT8, BASE_HEX, 0, 0,
24492       NULL, HFILL }},
24493
24494     {&hf_ieee80211_ff_tx_pwr_used,
24495      {"Transmit Power Used", "wlan.fixed.txpwr",
24496       FT_UINT8, BASE_HEX, 0, 0,
24497       NULL, HFILL }},
24498
24499     {&hf_ieee80211_ff_transceiver_noise_floor,
24500      {"Transceiver Noise Floor", "wlan.fixed.tnoisefloor",
24501       FT_UINT8, BASE_HEX, 0, 0,
24502       NULL, HFILL }},
24503
24504     {&hf_ieee80211_ff_channel_width,
24505      {"Supported Channel Width", "wlan.fixed.chanwidth",
24506       FT_UINT8, BASE_HEX, VALS(ff_channel_width_vals), 0,
24507       NULL, HFILL }},
24508
24509     {&hf_ieee80211_ff_qos_info_ap,
24510      {"QoS Information (AP)", "wlan.fixed.qosinfo.ap",
24511       FT_UINT8, BASE_HEX, NULL, 0,
24512       NULL, HFILL }},
24513
24514     {&hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
24515      {"EDCA Parameter Set Update Count", "wlan.fixed.qosinfo.ap.edcaupdate",
24516       FT_UINT8, BASE_HEX, NULL, 0x0F,
24517       "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
24518
24519     {&hf_ieee80211_ff_qos_info_ap_q_ack,
24520      {"Q-Ack", "wlan.fixed.qosinfo.ap.qack",
24521       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_q_ack_flag), 0x10,
24522       "QoS Ack", HFILL }},
24523
24524     {&hf_ieee80211_ff_qos_info_ap_queue_req,
24525      {"Queue Request", "wlan.fixed.qosinfo.ap.queue_req",
24526       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_queue_req_flag), 0x20,
24527       NULL, HFILL }},
24528
24529     {&hf_ieee80211_ff_qos_info_ap_txop_request,
24530      {"TXOP Request", "wlan.fixed.qosinfo.ap.txopreq",
24531       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_txop_request_flag), 0x40,
24532       "Transmit Opportunity (TXOP) Request", HFILL }},
24533
24534     {&hf_ieee80211_ff_qos_info_ap_reserved,
24535      {"Reserved", "wlan.fixed.qosinfo.ap.reserved",
24536       FT_BOOLEAN, 8, NULL, 0x80,
24537       NULL, HFILL }},
24538
24539     {&hf_ieee80211_ff_qos_info_sta,
24540      {"QoS Information (STA)", "wlan.fixed.qosinfo.sta",
24541       FT_UINT8, BASE_HEX, NULL, 0,
24542       "TCLAS Processing", HFILL }},
24543
24544     {&hf_ieee80211_ff_qos_info_sta_ac_vo,
24545      {"AC_VO U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_vo",
24546       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x01,
24547       NULL, HFILL }},
24548
24549     {&hf_ieee80211_ff_qos_info_sta_ac_vi,
24550      {"AC_VI U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_vi",
24551       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x02,
24552       NULL, HFILL }},
24553
24554     {&hf_ieee80211_ff_qos_info_sta_ac_bk,
24555      {"AC_BK U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_bk",
24556       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x04,
24557       NULL, HFILL }},
24558
24559     {&hf_ieee80211_ff_qos_info_sta_ac_be,
24560      {"AC_BE U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_be",
24561       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x08,
24562       NULL, HFILL }},
24563
24564     {&hf_ieee80211_ff_qos_info_sta_q_ack,
24565      {"Q-Ack", "wlan.fixed.qosinfo.sta.qack",
24566       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_q_ack_flag), 0x10,
24567       "QoS Ack", HFILL }},
24568
24569     {&hf_ieee80211_ff_qos_info_sta_max_sp_length,
24570      {"Max SP Length", "wlan.fixed.qosinfo.sta.max_sp_length",
24571       FT_UINT8, BASE_HEX, VALS(ff_qos_info_sta_max_sp_len_flags) , 0x60,
24572       NULL, HFILL }},
24573
24574     {&hf_ieee80211_ff_qos_info_sta_more_data_ack,
24575      {"More Data Ack", "wlan.fixed.qosinfo.sta.more_data_ack",
24576       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_more_data_ack_flag), 0x80,
24577       NULL, HFILL }},
24578
24579     {&hf_ieee80211_ff_sm_pwr_save,
24580      {"Spatial Multiplexing (SM) Power Control", "wlan.fixed.sm.powercontrol",
24581       FT_UINT8, BASE_HEX, NULL, 0,
24582       NULL, HFILL }},
24583
24584     {&hf_ieee80211_ff_sm_pwr_save_enabled,
24585      {"SM Power Save", "wlan.fixed.sm.powercontrol.enabled",
24586       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24587       "Spatial Multiplexing (SM) Power Save", HFILL }},
24588
24589     {&hf_ieee80211_ff_sm_pwr_save_sm_mode,
24590      {"SM Mode", "wlan.fixed.sm.powercontrol.mode",
24591       FT_BOOLEAN, 8, TFS(&ff_sm_pwr_save_sm_mode_flag), 0x02,
24592       "Spatial Multiplexing (SM) Mode", HFILL }},
24593
24594     {&hf_ieee80211_ff_sm_pwr_save_reserved,
24595      {"Reserved", "wlan.fixed.sm.powercontrol.reserved",
24596       FT_UINT8, BASE_HEX, NULL, 0xFC,
24597       NULL, HFILL }},
24598
24599     {&hf_ieee80211_ff_pco_phase_cntrl,
24600      {"Phased Coexistence Operation (PCO) Phase Control", "wlan.fixed.pco.phasecntrl",
24601       FT_BOOLEAN, BASE_NONE, TFS(&ff_pco_phase_cntrl_flag), 0x0,
24602       NULL, HFILL }},
24603
24604     {&hf_ieee80211_ff_psmp_param_set,
24605      {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan.fixed.psmp.paramset",
24606       FT_UINT16, BASE_HEX, 0, 0,
24607       NULL, HFILL }},
24608
24609     {&hf_ieee80211_ff_psmp_param_set_n_sta,
24610      {"Number of STA Info Fields Present", "wlan.fixed.psmp.paramset.nsta",
24611       FT_UINT16, BASE_HEX, 0, 0x000F,
24612       NULL, HFILL }},
24613
24614     {&hf_ieee80211_ff_psmp_param_set_more_psmp,
24615      {"More PSMP", "wlan.fixed.psmp.paramset.more",
24616       FT_BOOLEAN, 16, TFS(&ff_psmp_param_set_more_psmp_flag), 0x0010,
24617       "More Power Save Multi-Poll (PSMP)", HFILL }},
24618
24619     {&hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
24620      {"PSMP Sequence Duration [us]", "wlan.fixed.psmp.paramset.seqduration",
24621       FT_UINT16, BASE_DEC, 0, 0xFFE0,
24622       "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
24623
24624     {&hf_ieee80211_ff_mimo_cntrl,
24625      {"MIMO Control", "wlan.fixed.mimo.control",
24626       FT_BYTES, BASE_NONE, 0, 0x0,
24627       NULL, HFILL }},
24628
24629     {&hf_ieee80211_ff_mimo_cntrl_nc_index,
24630      {"Nc Index", "wlan.fixed.mimo.control.ncindex",
24631       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nc_index_flags), 0x0003,
24632       "Number of Columns Less One", HFILL }},
24633
24634     {&hf_ieee80211_ff_mimo_cntrl_nr_index,
24635      {"Nr Index", "wlan.fixed.mimo.control.nrindex",
24636       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nr_index_flags), 0x000C,
24637       "Number of Rows Less One", HFILL }},
24638
24639     {&hf_ieee80211_ff_mimo_cntrl_channel_width,
24640      {"Channel Width", "wlan.fixed.mimo.control.chanwidth",
24641       FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010,
24642       NULL, HFILL }},
24643
24644     {&hf_ieee80211_ff_mimo_cntrl_grouping,
24645      {"Grouping (Ng)", "wlan.fixed.mimo.control.grouping",
24646       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_grouping_flags), 0x0060,
24647       NULL, HFILL }},
24648
24649     {&hf_ieee80211_ff_mimo_cntrl_coefficient_size,
24650      {"Coefficient Size (Nb)", "wlan.fixed.mimo.control.cosize",
24651       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_coefficient_size_flags), 0x0180,
24652       NULL, HFILL }},
24653
24654     {&hf_ieee80211_ff_mimo_cntrl_codebook_info,
24655      {"Codebook Information", "wlan.fixed.mimo.control.codebookinfo",
24656       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_codebook_info_flags), 0x0600,
24657       NULL, HFILL }},
24658
24659     {&hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
24660      {"Remaining Matrix Segment", "wlan.fixed.mimo.control.matrixseg",
24661       FT_UINT16, BASE_HEX, 0, 0x3800,
24662       NULL, HFILL }},
24663
24664     {&hf_ieee80211_ff_mimo_cntrl_reserved,
24665      {"Reserved", "wlan.fixed.mimo.control.reserved",
24666       FT_UINT16, BASE_HEX, 0, 0xC000,
24667       NULL, HFILL }},
24668
24669     {&hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
24670      {"Sounding Timestamp", "wlan.fixed.mimo.control.soundingtime",
24671       FT_UINT32, BASE_HEX, 0, 0,
24672       NULL, HFILL }},
24673
24674     {&hf_ieee80211_ff_psmp_sta_info,
24675      {"Power Save Multi-Poll (PSMP) Station Information", "wlan.fixed.psmp.stainfo",
24676       FT_UINT64, BASE_HEX, 0, 0,
24677       NULL, HFILL }},
24678
24679     {&hf_ieee80211_ff_psmp_sta_info_type,
24680      {"Sta Info Type", "wlan.fixed.psmp.stainfo.type",
24681       FT_UINT32, BASE_HEX, VALS(ff_psmp_sta_info_flags), PSMP_STA_INFO_FLAG_TYPE,
24682       NULL, HFILL }},
24683
24684     {&hf_ieee80211_ff_psmp_sta_info_dtt_start_offset,
24685      {"DTT Start Offset", "wlan.fixed.psmp.stainfo.dttstart",
24686       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_START,
24687       NULL, HFILL }},
24688
24689     {&hf_ieee80211_ff_psmp_sta_info_dtt_duration,
24690      {"DTT Duration", "wlan.fixed.psmp.stainfo.dttduration",
24691       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_DURATION,
24692       NULL, HFILL }},
24693
24694     {&hf_ieee80211_ff_psmp_sta_info_sta_id,
24695      {"Target Station ID", "wlan.fixed.psmp.stainfo.staid",
24696       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_STA_ID,
24697       NULL, HFILL }},
24698
24699     {&hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
24700      {"UTT Start Offset", "wlan.fixed.psmp.stainfo.uttstart",
24701       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_START,
24702       NULL, HFILL }},
24703
24704     {&hf_ieee80211_ff_psmp_sta_info_utt_duration,
24705      {"UTT Duration", "wlan.fixed.psmp.stainfo.uttduration",
24706       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_DURATION,
24707       NULL, HFILL }},
24708
24709     {&hf_ieee80211_ff_psmp_sta_info_reserved_small,
24710      {"Reserved", "wlan.fixed.psmp.stainfo.reserved",
24711       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_IA_RESERVED,
24712       NULL, HFILL }},
24713
24714     {&hf_ieee80211_ff_psmp_sta_info_reserved_large,
24715      {"Reserved", "wlan.fixed.psmp.stainfo.reserved64",
24716       FT_UINT64, BASE_HEX, 0, 0,
24717       NULL, HFILL }},
24718
24719     {&hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
24720      {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan.fixed.psmp.stainfo.multicastid",
24721       FT_UINT64, BASE_HEX, 0, 0,
24722       NULL, HFILL }},
24723
24724     {&hf_ieee80211_ff_ant_selection,
24725      {"Antenna Selection", "wlan.fixed.antsel",
24726       FT_UINT8, BASE_HEX, 0, 0,
24727       NULL, HFILL }},
24728
24729     {&hf_ieee80211_ff_ant_selection_0,
24730      {"Antenna 0", "wlan.fixed.antsel.ant0",
24731       FT_UINT8, BASE_HEX, 0, 0x01,
24732       NULL, HFILL }},
24733
24734     {&hf_ieee80211_ff_ant_selection_1,
24735      {"Antenna 1", "wlan.fixed.antsel.ant1",
24736       FT_UINT8, BASE_HEX, 0, 0x02,
24737       NULL, HFILL }},
24738
24739     {&hf_ieee80211_ff_ant_selection_2,
24740      {"Antenna 2", "wlan.fixed.antsel.ant2",
24741       FT_UINT8, BASE_HEX, 0, 0x04,
24742       NULL, HFILL }},
24743
24744     {&hf_ieee80211_ff_ant_selection_3,
24745      {"Antenna 3", "wlan.fixed.antsel.ant3",
24746       FT_UINT8, BASE_HEX, 0, 0x08,
24747       NULL, HFILL }},
24748
24749     {&hf_ieee80211_ff_ant_selection_4,
24750      {"Antenna 4", "wlan.fixed.antsel.ant4",
24751       FT_UINT8, BASE_HEX, 0, 0x10,
24752       NULL, HFILL }},
24753
24754     {&hf_ieee80211_ff_ant_selection_5,
24755      {"Antenna 5", "wlan.fixed.antsel.ant5",
24756       FT_UINT8, BASE_HEX, 0, 0x20,
24757       NULL, HFILL }},
24758
24759     {&hf_ieee80211_ff_ant_selection_6,
24760      {"Antenna 6", "wlan.fixed.antsel.ant6",
24761       FT_UINT8, BASE_HEX, 0, 0x40,
24762       NULL, HFILL }},
24763
24764     {&hf_ieee80211_ff_ant_selection_7,
24765      {"Antenna 7", "wlan.fixed.antsel.ant7",
24766       FT_UINT8, BASE_HEX, 0, 0x80,
24767       NULL, HFILL }},
24768
24769     {&hf_ieee80211_ff_ext_channel_switch_announcement,
24770      {"Extended Channel Switch Announcement", "wlan.fixed.extchansw",
24771       FT_UINT32, BASE_HEX, 0, 0,
24772       NULL, HFILL }},
24773
24774     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
24775      {"Channel Switch Mode", "wlan.fixed.extchansw.switchmode",
24776       FT_UINT32, BASE_HEX, VALS(ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags), 0x000000FF,
24777       NULL, HFILL }},
24778
24779     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
24780      {"New Operating Class", "wlan.fixed.extchansw.new.opeclass",
24781       FT_UINT32, BASE_HEX, NULL, 0x0000FF00,
24782       NULL, HFILL }},
24783
24784     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
24785      {"New Channel Number", "wlan.fixed.extchansw.new.channumber",
24786       FT_UINT32, BASE_HEX, NULL, 0x00FF0000,
24787       NULL, HFILL }},
24788
24789     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
24790      {"Channel Switch Count", "wlan.extchanswitch.switchcount",
24791       FT_UINT32, BASE_HEX, NULL, 0xFF000000,
24792       NULL, HFILL }},
24793
24794     {&hf_ieee80211_ff_ht_info,
24795      {"HT Information", "wlan.fixed.extchansw",
24796       FT_UINT8, BASE_HEX, 0, 0,
24797       "HT Information Fixed Field", HFILL }},
24798
24799     {&hf_ieee80211_ff_ht_info_information_request,
24800      {"Information Request", "wlan.fixed.mimo.control.chanwidth",
24801       FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01,
24802       NULL, HFILL }},
24803
24804     {&hf_ieee80211_ff_ht_info_40_mhz_intolerant,
24805      {"40 MHz Intolerant", "wlan.fixed.mimo.control.chanwidth",
24806       FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02,
24807       NULL, HFILL }},
24808
24809     {&hf_ieee80211_ff_ht_info_sta_chan_width,
24810      {"Station Channel Width", "wlan.fixed.mimo.control.chanwidth",
24811       FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04,
24812       NULL, HFILL }},
24813
24814     {&hf_ieee80211_ff_ht_info_reserved,
24815      {"Reserved", "wlan.fixed.extchansw",
24816       FT_UINT8, BASE_HEX, 0, 0xF8,
24817       "Reserved Field", HFILL }},
24818
24819     {&hf_ieee80211_ff_ht_action,
24820      {"HT Action", "wlan.fixed.htact",
24821       FT_UINT8, BASE_HEX, VALS(ff_ht_action_flags), 0,
24822       "HT Action Code", HFILL }},
24823
24824     {&hf_ieee80211_ff_mimo_csi_snr,
24825      {"Signal to Noise Ratio (SNR)", "wlan.mimo.csimatrices.snr",
24826       FT_UINT8, BASE_HEX, NULL, 0,
24827       NULL, HFILL }},
24828
24829     {&hf_ieee80211_ff_mimo_csi_matrices,
24830      {"CSI Matrices", "wlan.mimo.csimatrices",
24831       FT_NONE, BASE_NONE, NULL, 0,
24832       NULL, HFILL }},
24833
24834     {&hf_ieee80211_ff_mimo_csi_bf_matrices,
24835      {"Beamforming Feedback Matrices", "wlan.mimo.csimatrices.bf",
24836       FT_NONE, BASE_NONE, NULL, 0,
24837       NULL, HFILL }},
24838
24839     {&hf_ieee80211_ff_mimo_csi_cbf_matrices,
24840      {"Compressed Beamforming Feedback Matrices", "wlan.mimo.csimatrices.cbf",
24841       FT_NONE, BASE_NONE, NULL, 0,
24842       NULL, HFILL }},
24843     {&hf_ieee80211_ff_public_action,
24844      {"Public Action", "wlan.fixed.publicact",
24845       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_pa_action_codes_ext, 0,
24846       "Public Action Code", HFILL }},
24847
24848     {&hf_ieee80211_ff_protected_public_action,
24849      {"Protected Public Action", "wlan.fixed.publicact",
24850       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_ppa_action_codes_ext, 0,
24851       "Protected Public Action Code", HFILL }},
24852
24853     {&hf_ieee80211_ff_capture,
24854      {"Capabilities Information", "wlan.fixed.capabilities",
24855       FT_UINT16, BASE_HEX, NULL, 0,
24856       "Capability information", HFILL }},
24857
24858     {&hf_ieee80211_ff_cf_ess,
24859      {"ESS capabilities", "wlan.fixed.capabilities.ess",
24860       FT_BOOLEAN, 16, TFS(&cf_ess_flags), 0x0001,
24861       NULL, HFILL }},
24862
24863     {&hf_ieee80211_ff_cf_ibss,
24864      {"IBSS status", "wlan.fixed.capabilities.ibss",
24865       FT_BOOLEAN, 16, TFS(&cf_ibss_flags), 0x0002,
24866       "IBSS participation", HFILL }},
24867
24868     {&hf_ieee80211_ff_cf_sta_poll,
24869      {"CFP participation capabilities", "wlan.fixed.capabilities.cfpoll.sta",
24870       FT_UINT16, BASE_HEX, VALS(sta_cf_pollable), 0x020C,
24871       "CF-Poll capabilities for a STA", HFILL }},
24872
24873     {&hf_ieee80211_ff_cf_ap_poll,
24874      {"CFP participation capabilities", "wlan.fixed.capabilities.cfpoll.ap",
24875       FT_UINT16, BASE_HEX, VALS(ap_cf_pollable), 0x020C,
24876       "CF-Poll capabilities for an AP", HFILL }},
24877
24878     {&hf_ieee80211_ff_cf_privacy,
24879      {"Privacy", "wlan.fixed.capabilities.privacy",
24880       FT_BOOLEAN, 16, TFS(&cf_privacy_flags), 0x0010,
24881       "WEP support", HFILL }},
24882
24883     {&hf_ieee80211_ff_cf_preamble,
24884      {"Short Preamble", "wlan.fixed.capabilities.preamble",
24885       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0020,
24886       NULL, HFILL }},
24887
24888     {&hf_ieee80211_ff_cf_pbcc,
24889      {"PBCC", "wlan.fixed.capabilities.pbcc",
24890       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0040,
24891       "PBCC Modulation", HFILL }},
24892
24893     {&hf_ieee80211_ff_cf_agility,
24894      {"Channel Agility", "wlan.fixed.capabilities.agility",
24895       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0080,
24896       NULL, HFILL }},
24897
24898     {&hf_ieee80211_ff_cf_spec_man,
24899      {"Spectrum Management", "wlan.fixed.capabilities.spec_man",
24900       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0100,
24901       NULL, HFILL }},
24902
24903     {&hf_ieee80211_ff_short_slot_time,
24904      {"Short Slot Time", "wlan.fixed.capabilities.short_slot_time",
24905       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0400,
24906       NULL, HFILL }},
24907
24908     {&hf_ieee80211_ff_cf_apsd,
24909      {"Automatic Power Save Delivery", "wlan.fixed.capabilities.apsd",
24910       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0800,
24911       NULL, HFILL }},
24912
24913     {&hf_ieee80211_ff_radio_measurement,
24914      {"Radio Measurement", "wlan.fixed.capabilities.radio_measurement",
24915       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x1000,
24916       NULL, HFILL }},
24917
24918     {&hf_ieee80211_ff_dsss_ofdm,
24919      {"DSSS-OFDM", "wlan.fixed.capabilities.dsss_ofdm",
24920       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x2000,
24921       "DSSS-OFDM Modulation", HFILL }},
24922
24923     {&hf_ieee80211_ff_cf_del_blk_ack,
24924      {"Delayed Block Ack", "wlan.fixed.capabilities.del_blk_ack",
24925       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x4000,
24926       NULL, HFILL }},
24927
24928     {&hf_ieee80211_ff_cf_imm_blk_ack,
24929      {"Immediate Block Ack", "wlan.fixed.capabilities.imm_blk_ack",
24930       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x8000,
24931       NULL, HFILL }},
24932
24933     {&hf_ieee80211_ff_auth_seq,
24934      {"Authentication SEQ", "wlan.fixed.auth_seq",
24935       FT_UINT16, BASE_HEX, NULL, 0,
24936       "Authentication Sequence Number", HFILL }},
24937
24938     {&hf_ieee80211_ff_assoc_id,
24939      {"Association ID", "wlan.fixed.aid",
24940       FT_UINT16, BASE_HEX, NULL, 0x3FFF,
24941       NULL, HFILL }},
24942
24943     {&hf_ieee80211_ff_listen_ival,
24944      {"Listen Interval", "wlan.fixed.listen_ival",
24945       FT_UINT16, BASE_HEX, NULL, 0,
24946       NULL, HFILL }},
24947
24948     {&hf_ieee80211_ff_current_ap,
24949      {"Current AP", "wlan.fixed.current_ap",
24950       FT_ETHER, BASE_NONE, NULL, 0,
24951       "MAC address of current AP", HFILL }},
24952
24953     {&hf_ieee80211_ff_reason,
24954      {"Reason code", "wlan.fixed.reason_code",
24955       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
24956       "Reason for unsolicited notification", HFILL }},
24957
24958     {&hf_ieee80211_ff_status_code,
24959      {"Status code", "wlan.fixed.status_code",
24960       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
24961       "Status of requested event", HFILL }},
24962
24963     {&hf_ieee80211_ff_category_code,
24964      {"Category code", "wlan.fixed.category_code",
24965       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &category_codes_ext, 0,
24966       "Management action category", HFILL }},
24967
24968     {&hf_ieee80211_ff_action_code,
24969      {"Action code", "wlan.fixed.action_code",
24970       FT_UINT16, BASE_DEC, VALS(action_codes), 0,
24971       "Management action code", HFILL }},
24972
24973     {&hf_ieee80211_ff_dialog_token,
24974      {"Dialog token", "wlan.fixed.dialog_token",
24975       FT_UINT8, BASE_HEX, NULL, 0,
24976       "Management action dialog token", HFILL }},
24977
24978     {&hf_ieee80211_ff_followup_dialog_token,
24979      {"Followup Dialog token", "wlan.fixed.followup_dialog_token",
24980       FT_UINT8, BASE_HEX, NULL, 0,
24981       "Management action followup dialog token", HFILL }},
24982
24983     {&hf_ieee80211_ff_marvell_action_type,
24984      {"Marvell Action type", "wlan.fixed.mrvl_action_type",
24985       FT_UINT8, BASE_DEC, VALS(vendor_action_types_mrvl), 0,
24986       "Vendor Specific Action Type (Marvell)", HFILL }},
24987
24988     {&hf_ieee80211_ff_marvell_mesh_mgt_action_code,
24989      {"Mesh action(Marvell)", "wlan.fixed.mrvl_mesh_action",
24990       FT_UINT8, BASE_HEX, VALS(mesh_mgt_action_codes_mrvl), 0,
24991       "Mesh action code(Marvell)", HFILL }},
24992
24993     {&hf_ieee80211_ff_marvell_mesh_mgt_length,
24994      {"Message Length", "wlan.fixed.length",
24995       FT_UINT8, BASE_DEC, NULL, 0,
24996       NULL, HFILL }},
24997
24998     {&hf_ieee80211_ff_marvell_mesh_mgt_mode,
24999      {"Message Mode", "wlan.fixed.mode",
25000       FT_UINT8, BASE_HEX, NULL, 0,
25001       NULL, HFILL }},
25002
25003     {&hf_ieee80211_ff_marvell_mesh_mgt_ttl,
25004      {"Message TTL", "wlan.fixed.ttl",
25005       FT_UINT8, BASE_DEC, NULL, 0,
25006       NULL, HFILL }},
25007
25008     {&hf_ieee80211_ff_marvell_mesh_mgt_dstcount,
25009      {"Destination Count", "wlan.fixed.dstcount",
25010       FT_UINT8, BASE_DEC, NULL, 0,
25011       NULL, HFILL }},
25012
25013     {&hf_ieee80211_ff_marvell_mesh_mgt_hopcount,
25014      {"Hop Count", "wlan.fixed.hopcount",
25015       FT_UINT8, BASE_DEC, NULL, 0,
25016       NULL, HFILL }},
25017
25018     {&hf_ieee80211_ff_marvell_mesh_mgt_rreqid,
25019      {"RREQ ID", "wlan.fixed.rreqid",
25020       FT_UINT32, BASE_DEC, NULL, 0,
25021       NULL, HFILL }},
25022
25023     {&hf_ieee80211_ff_marvell_mesh_mgt_sa,
25024      {"Source Address", "wlan.fixed.sa",
25025       FT_ETHER, BASE_NONE, NULL, 0,
25026       "Source MAC address", HFILL }},
25027
25028     {&hf_ieee80211_ff_marvell_mesh_mgt_ssn,
25029      {"SSN", "wlan.fixed.ssn",
25030       FT_UINT32, BASE_DEC, NULL, 0,
25031       "Source Sequence Number", HFILL }},
25032
25033     {&hf_ieee80211_ff_marvell_mesh_mgt_metric,
25034      {"Metric", "wlan.fixed.metric",
25035       FT_UINT32, BASE_DEC, NULL, 0,
25036       "Route Metric", HFILL }},
25037
25038     {&hf_ieee80211_ff_marvell_mesh_mgt_flags,
25039      {"RREQ Flags", "wlan.fixed.hopcount",
25040       FT_UINT8, BASE_HEX, NULL, 0,
25041       NULL, HFILL }},
25042
25043     {&hf_ieee80211_ff_marvell_mesh_mgt_da,
25044      {"Destination Address", "wlan.fixed.da",
25045       FT_ETHER, BASE_NONE, NULL, 0,
25046       "Destination MAC address", HFILL }},
25047
25048     {&hf_ieee80211_ff_marvell_mesh_mgt_dsn,
25049      {"DSN", "wlan.fixed.dsn",
25050       FT_UINT32, BASE_DEC, NULL, 0,
25051       "Destination Sequence Number", HFILL }},
25052
25053     {&hf_ieee80211_ff_marvell_mesh_mgt_lifetime,
25054      {"Lifetime", "wlan.fixed.lifetime",
25055       FT_UINT32, BASE_DEC, NULL, 0,
25056       "Route Lifetime", HFILL }},
25057
25058     {&hf_ieee80211_ff_wme_action_code,
25059      {"Action code", "wlan.fixed.action_code",
25060       FT_UINT16, BASE_HEX, VALS(wme_action_codes), 0,
25061       "Management notification action code", HFILL }},
25062
25063     {&hf_ieee80211_ff_wme_status_code,
25064      {"Status code", "wlan.fixed.status_code",
25065       FT_UINT16, BASE_HEX, VALS(wme_status_codes), 0,
25066       "Management notification setup response status code", HFILL }},
25067
25068     {&hf_ieee80211_ff_mesh_action,
25069      {"Mesh Action code", "wlan.fixed.mesh_action",
25070       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &mesh_action_ext, 0,
25071       NULL, HFILL }},
25072
25073     {&hf_ieee80211_ff_multihop_action,
25074      {"Multihop Action code", "wlan.fixed.multihop_action",
25075       FT_UINT8, BASE_HEX, VALS(multihop_action), 0,
25076       NULL, HFILL }},
25077
25078     {&hf_ieee80211_ff_mesh_flags,
25079      {"Mesh Flags", "wlan.fixed.mesh_flags",
25080       FT_UINT8, BASE_HEX, NULL, 0,
25081       NULL, HFILL }},
25082
25083     {&hf_ieee80211_ff_mesh_ttl,
25084      {"Mesh TTL", "wlan.fixed.mesh_ttl",
25085       FT_UINT8, BASE_HEX, NULL, 0,
25086       NULL, HFILL }},
25087
25088     {&hf_ieee80211_ff_mesh_sequence,
25089      {"Sequence Number", "wlan.fixed.mesh_sequence",
25090       FT_UINT32, BASE_HEX, NULL, 0,
25091       NULL, HFILL }},
25092
25093     {&hf_ieee80211_ff_mesh_addr4,
25094      {"Mesh Extended Address 4", "wlan.fixed.mesh_addr4",
25095       FT_ETHER, BASE_NONE, NULL, 0,
25096       NULL, HFILL }},
25097
25098     {&hf_ieee80211_ff_mesh_addr5,
25099      {"Mesh Extended Address 5", "wlan.fixed.mesh_addr5",
25100       FT_ETHER, BASE_NONE, NULL, 0,
25101       NULL, HFILL }},
25102
25103     {&hf_ieee80211_ff_mesh_addr6,
25104      {"Mesh Extended Address 6", "wlan.fixed.mesh_addr6",
25105       FT_ETHER, BASE_NONE, NULL, 0,
25106       NULL, HFILL }},
25107
25108     {&hf_ieee80211_ff_selfprot_action,
25109      {"Self-protected Action code", "wlan.fixed.selfprot_action",
25110       FT_UINT8, BASE_HEX, VALS(selfprot_action), 0,
25111       NULL, HFILL }},
25112
25113     {&hf_ieee80211_mesh_peering_proto,
25114      {"Mesh Peering Protocol ID", "wlan.peering.proto",
25115       FT_UINT16, BASE_HEX, VALS(mesh_peering_proto_ids), 0,
25116       NULL, HFILL }},
25117
25118     {&hf_ieee80211_mesh_peering_local_link_id,
25119      {"Local Link ID", "wlan.peering.local_id",
25120       FT_UINT16, BASE_HEX, NULL, 0,
25121       "Mesh Peering Management Local Link ID", HFILL }},
25122
25123     {&hf_ieee80211_mesh_peering_peer_link_id,
25124      {"Peer Link ID", "wlan.peering.peer_id",
25125       FT_UINT16, BASE_HEX, NULL, 0,
25126       "Mesh Peering Management Peer Link ID", HFILL }},
25127
25128     {&hf_ieee80211_ff_hwmp_flags,
25129      {"HWMP Flags", "wlan.hwmp.flags",
25130       FT_UINT8, BASE_HEX, NULL, 0,
25131       NULL, HFILL }},
25132
25133     {&hf_ieee80211_ff_hwmp_hopcount,
25134      {"HWMP Hop Count", "wlan.hwmp.hopcount",
25135       FT_UINT8, BASE_DEC, NULL, 0,
25136       NULL, HFILL }},
25137
25138     {&hf_ieee80211_ff_hwmp_ttl,
25139      {"HWMP TTL", "wlan.hwmp.ttl",
25140       FT_UINT8, BASE_DEC, NULL, 0,
25141       NULL, HFILL }},
25142
25143     {&hf_ieee80211_ff_hwmp_pdid,
25144      {"HWMP Path Discovery ID", "wlan.hwmp.pdid",
25145       FT_UINT32, BASE_DEC, NULL, 0,
25146       NULL, HFILL }},
25147
25148     {&hf_ieee80211_ff_hwmp_orig_sta,
25149      {"Originator STA Address", "wlan.hwmp.orig_sta",
25150       FT_ETHER, BASE_NONE, NULL, 0,
25151       NULL, HFILL }},
25152
25153     {&hf_ieee80211_ff_hwmp_orig_sn,
25154      {"HWMP Originator Sequence Number", "wlan.hwmp.orig_sn",
25155       FT_UINT32, BASE_DEC, NULL, 0,
25156       NULL, HFILL}},
25157
25158     {&hf_ieee80211_ff_hwmp_orig_ext,
25159      {"Originator External Address", "wlan.hwmp.orig_ext",
25160       FT_ETHER, BASE_NONE, NULL, 0,
25161       NULL, HFILL }},
25162
25163     {&hf_ieee80211_ff_hwmp_lifetime,
25164      {"HWMP Lifetime", "wlan.hwmp.lifetime",
25165       FT_UINT32, BASE_DEC, NULL, 0,
25166       NULL, HFILL }},
25167
25168     {&hf_ieee80211_ff_hwmp_metric,
25169      {"HWMP Metric", "wlan.hwmp.metric",
25170       FT_UINT32, BASE_DEC, NULL, 0,
25171       NULL, HFILL }},
25172
25173     {&hf_ieee80211_ff_hwmp_targ_count,
25174      {"HWMP Target Count", "wlan.hwmp.targ_count",
25175       FT_UINT8, BASE_DEC, NULL, 0,
25176       NULL, HFILL }},
25177
25178     {&hf_ieee80211_ff_hwmp_targ_flags,
25179      {"HWMP Per-Target Flags", "wlan.hwmp.targ_flags",
25180       FT_UINT8, BASE_HEX, NULL, 0,
25181       NULL, HFILL }},
25182
25183     {&hf_ieee80211_ff_hwmp_targ_to_flags,
25184      {"TO Flag", "wlan.hwmp.to_flag",
25185       FT_BOOLEAN, 8, TFS(&hwmp_targ_to_flags), 0x01,
25186       "Target Only Flag", HFILL }},
25187
25188     {&hf_ieee80211_ff_hwmp_targ_usn_flags,
25189      {"USN Flag", "wlan.hwmp.usn_flag",
25190       FT_BOOLEAN, 8, TFS(&hwmp_targ_usn_flags), 0x04,
25191       "Unknown Target HWMP Sequence Number Flag", HFILL }},
25192
25193     {&hf_ieee80211_ff_hwmp_targ_sta,
25194      {"Target STA Address", "wlan.hwmp.targ_sta",
25195       FT_ETHER, BASE_NONE, NULL, 0,
25196       NULL, HFILL }},
25197
25198     {&hf_ieee80211_ff_hwmp_targ_ext,
25199      {"Target External Address", "wlan.hwmp.targ_ext",
25200       FT_ETHER, BASE_NONE, NULL, 0,
25201       NULL, HFILL }},
25202
25203     {&hf_ieee80211_ff_hwmp_targ_sn,
25204      {"Target HWMP Sequence Number", "wlan.hwmp.targ_sn",
25205       FT_UINT32, BASE_DEC, NULL, 0,
25206       NULL, HFILL }},
25207
25208     {&hf_ieee80211_mesh_config_path_sel_protocol,
25209      {"Path Selection Protocol", "wlan.mesh.config.ps_protocol",
25210       FT_UINT8, BASE_HEX, NULL, 0,
25211       "Mesh Configuration Path Selection Protocol", HFILL }},
25212
25213     {&hf_ieee80211_mesh_config_path_sel_metric,
25214      {"Path Selection Metric", "wlan.mesh.config.ps_metric",
25215       FT_UINT8, BASE_HEX, NULL, 0,
25216       "Mesh Configuration Path Selection Metric", HFILL }},
25217
25218     {&hf_ieee80211_mesh_config_congestion_control,
25219      {"Congestion Control", "wlan.mesh.config.cong_ctl",
25220       FT_UINT8, BASE_HEX, NULL, 0,
25221       "Mesh Configuration Congestion Control", HFILL }},
25222
25223     {&hf_ieee80211_mesh_config_sync_method,
25224      {"Synchronization Method", "wlan.mesh.config.sync_method",
25225       FT_UINT8, BASE_HEX, NULL, 0,
25226       "Mesh Configuration Synchronization Method", HFILL }},
25227
25228     {&hf_ieee80211_mesh_config_auth_protocol,
25229      {"Authentication Protocol", "wlan.mesh.config.auth_protocol",
25230       FT_UINT8, BASE_HEX, NULL, 0,
25231       "Mesh Configuration Authentication Protocol", HFILL }},
25232
25233     {&hf_ieee80211_mesh_config_formation_info,
25234      {"Formation Info", "wlan.mesh.config.formation_info",
25235       FT_UINT8, BASE_HEX, NULL, 0,
25236       "Mesh Configuration Formation Info", HFILL }},
25237
25238     {&hf_ieee80211_mesh_form_info_num_of_peerings,
25239      {"Number of Peerings", "wlan.mesh.config.formation_info.num_peers",
25240       FT_UINT8, BASE_DEC, NULL, 0x7E,
25241       NULL, HFILL }},
25242
25243     {&hf_ieee80211_mesh_config_capability,
25244      {"Capability", "wlan.mesh.config.cap",
25245       FT_UINT8, BASE_HEX, NULL, 0,
25246       "Mesh Configuration Capability", HFILL }},
25247
25248     {&hf_ieee80211_mesh_config_cap_accepting,
25249      {"Accepting Additional Mesh Peerings", "wlan.mesh.config.cap.accept",
25250       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
25251       NULL, HFILL }},
25252
25253     {&hf_ieee80211_mesh_config_cap_mcca_support,
25254      {"MCCA Support", "wlan.mesh.config.cap.mcca_support",
25255       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
25256       NULL, HFILL }},
25257
25258     {&hf_ieee80211_mesh_config_cap_mcca_enabled,
25259      {"MCCA Enabled", "wlan.mesh.config.cap.mcca_enabled",
25260       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
25261       NULL, HFILL }},
25262
25263     {&hf_ieee80211_mesh_config_cap_forwarding,
25264      {"Mesh Forwarding", "wlan.mesh.config.cap.forwarding",
25265       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08,
25266       NULL, HFILL }},
25267
25268     {&hf_ieee80211_mesh_config_cap_mbca_enabled,
25269      {"MBCA Enabled", "wlan.mesh.config.cap.mbca_enabled",
25270       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
25271       NULL, HFILL }},
25272
25273     {&hf_ieee80211_mesh_config_cap_tbtt_adjusting,
25274      {"TBTT Adjustment", "wlan.mesh.config.cap.tbtt_adjusting",
25275       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20,
25276       NULL, HFILL }},
25277
25278     {&hf_ieee80211_mesh_config_cap_power_save_level,
25279      {"Power Save", "wlan.mesh.config.cap.power_save_level",
25280       FT_BOOLEAN, 8, TFS(&mesh_config_cap_power_save_level_flags), 0x40,
25281       NULL, HFILL }},
25282
25283     {&hf_ieee80211_mesh_id,
25284      {"Mesh ID", "wlan.mesh.id",
25285       FT_STRING, BASE_NONE, NULL, 0,
25286       NULL, HFILL }},
25287
25288     {&hf_ieee80211_rann_flags,
25289      {"RANN Flags", "wlan.rann.flags",
25290       FT_UINT8, BASE_HEX, NULL, 0,
25291       "Root Announcement Flags", HFILL }},
25292
25293     {&hf_ieee80211_rann_root_sta,
25294      {"Root STA Address", "wlan.rann.root_sta", FT_ETHER, BASE_NONE, NULL, 0,
25295       "Root Mesh STA Address", HFILL }},
25296
25297     {&hf_ieee80211_rann_sn,
25298      {"Root STA Sequence Number", "wlan.rann.rann_sn",
25299       FT_UINT32, BASE_DEC, NULL, 0,
25300       "Root Mesh STA Sequence Number", HFILL }},
25301
25302     {&hf_ieee80211_rann_interval,
25303      {"RANN Interval", "wlan.rann.interval",
25304       FT_UINT32, BASE_DEC, NULL, 0,
25305       "Root Announcement Interval", HFILL }},
25306
25307     {&hf_ieee80211_ff_qos_action_code,
25308      {"Action code", "wlan.fixed.action_code",
25309       FT_UINT16, BASE_HEX, VALS(qos_action_codes), 0,
25310       "QoS management action code", HFILL }},
25311
25312     {&hf_ieee80211_ff_ba_action,
25313      {"Action code", "wlan.fixed.action_code",
25314       FT_UINT8, BASE_HEX, VALS(ba_action_codes), 0,
25315       "Block Ack action code", HFILL }},
25316
25317     {&hf_ieee80211_ff_check_beacon,
25318      {"Check Beacon", "wlan.fixed.check_beacon",
25319       FT_UINT8, BASE_DEC, NULL, 0,
25320       "Unprotected WNM Check Beacon", HFILL }},
25321
25322     {&hf_ieee80211_ff_tod,
25323      {"TOD", "wlan.fixed.tod",
25324       FT_UINT32, BASE_DEC, NULL, 0,
25325       "Previous TS of transmit antenna port", HFILL }},
25326
25327     {&hf_ieee80211_ff_toa,
25328      {"TOA", "wlan.fixed.toa",
25329       FT_UINT32, BASE_DEC, NULL, 0,
25330       "Previous TS of receive antenna port", HFILL }},
25331
25332     {&hf_ieee80211_ff_max_tod_err,
25333      {"MAX TOD ERROR", "wlan.fixed.max_tod_err",
25334       FT_UINT8, BASE_DEC, NULL, 0,
25335       "Maximal Error at Previous TS of transmit antenna port", HFILL }},
25336
25337     {&hf_ieee80211_ff_max_toa_err,
25338      {"MAX TOA ERROR", "wlan.fixed.max_toa_err",
25339       FT_UINT8, BASE_DEC, NULL, 0,
25340       "Maximal Error at Previous TS of receive antenna port", HFILL }},
25341
25342     {&hf_ieee80211_ff_dls_action_code,
25343      {"Action code", "wlan.fixed.action_code",
25344       FT_UINT16, BASE_HEX, VALS(dls_action_codes), 0,
25345       "DLS management action code", HFILL }},
25346
25347     {&hf_ieee80211_ff_dst_mac_addr,
25348      {"Destination address", "wlan.fixed.dst_mac_addr",
25349       FT_ETHER, BASE_NONE, NULL, 0,
25350       "Destination MAC address", HFILL }},
25351
25352     {&hf_ieee80211_ff_src_mac_addr,
25353      {"Source address", "wlan.fixed.src_mac_addr",
25354       FT_ETHER, BASE_NONE, NULL, 0,
25355       "Source MAC address", HFILL }},
25356
25357     {&hf_ieee80211_ff_req_ap_addr,
25358      {"RequesterAP address", "wlan.fixed.req_ap_addr",
25359       FT_ETHER, BASE_NONE, NULL, 0,
25360       NULL, HFILL }},
25361
25362     {&hf_ieee80211_ff_res_ap_addr,
25363      {"ResponderAP address", "wlan.fixed.res_ap_addr",
25364       FT_ETHER, BASE_NONE, NULL, 0,
25365       NULL, HFILL }},
25366
25367     {&hf_ieee80211_ff_ft_action_code,
25368      {"Action code", "wlan.fixed.action_code",
25369       FT_UINT8, BASE_DEC, VALS(ft_action_codes), 0,
25370       "Management action code", HFILL }},
25371
25372     {&hf_ieee80211_ff_sta_address,
25373      {"STA Address", "wlan.fixed.sta_address",
25374       FT_ETHER, BASE_NONE, NULL, 0,
25375       NULL, HFILL }},
25376
25377     {&hf_ieee80211_ff_target_ap_address,
25378      {"Target AP Address", "wlan.fixed.target_ap_address",
25379       FT_ETHER, BASE_NONE, NULL, 0,
25380       "Target AP MAC address", HFILL }},
25381
25382     {&hf_ieee80211_ff_gas_comeback_delay,
25383      {"GAS Comeback Delay", "wlan.fixed.gas_comeback_delay",
25384       FT_UINT16, BASE_DEC, NULL, 0,
25385       NULL, HFILL }},
25386
25387     {&hf_ieee80211_ff_gas_fragment_id,
25388      {"GAS Query Response Fragment ID", "wlan.fixed.gas_fragment_id",
25389       FT_UINT8, BASE_DEC, NULL, 0x7f,
25390       NULL, HFILL }},
25391
25392     {&hf_ieee80211_ff_more_gas_fragments,
25393      {"More GAS Fragments", "wlan.fixed.more_gas_fragments",
25394       FT_UINT8, BASE_DEC, NULL, 0x80,
25395       NULL, HFILL }},
25396
25397     {&hf_ieee80211_ff_query_request_length,
25398      {"Query Request Length", "wlan.fixed.query_request_length",
25399       FT_UINT16, BASE_DEC, NULL, 0,
25400       NULL, HFILL }},
25401
25402     {&hf_ieee80211_ff_query_request,
25403      {"Query Request", "wlan.fixed.query_request",
25404       FT_BYTES, BASE_NONE, NULL, 0,
25405       NULL, HFILL }},
25406
25407     {&hf_ieee80211_ff_query_response_length,
25408      {"Query Response Length", "wlan.fixed.query_response_length",
25409       FT_UINT16, BASE_DEC, NULL, 0,
25410       NULL, HFILL }},
25411
25412     {&hf_ieee80211_ff_query_response,
25413      {"Query Response", "wlan.fixed.query_response",
25414       FT_BYTES, BASE_NONE, NULL, 0,
25415       NULL, HFILL }},
25416
25417     {&hf_ieee80211_gas_resp_fragments,
25418      {"GAS Query Response fragments", "wlan.fixed.fragments",
25419       FT_NONE, BASE_NONE, NULL, 0x00,
25420       NULL, HFILL } },
25421
25422     {&hf_ieee80211_gas_resp_fragment,
25423      {"GAS Query Response fragment", "wlan.fixed.fragment",
25424       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
25425       NULL, HFILL } },
25426
25427     {&hf_ieee80211_gas_resp_fragment_overlap,
25428      {"GAS Query Response fragment overlap", "wlan.fixed.fragment.overlap",
25429       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
25430       NULL, HFILL } },
25431
25432     {&hf_ieee80211_gas_resp_fragment_overlap_conflict,
25433      {"GAS Query Response fragment overlapping with conflicting data", "wlan.fixed.fragment.overlap.conflicts",
25434       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
25435       NULL, HFILL } },
25436
25437     {&hf_ieee80211_gas_resp_fragment_multiple_tails,
25438      {"GAS Query Response has multiple tail fragments",  "wlan.fixed.fragment.multiple_tails",
25439       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
25440       NULL, HFILL } },
25441
25442     {&hf_ieee80211_gas_resp_fragment_too_long_fragment,
25443      {"GAS Query Response fragment too long", "wlan.fixed.fragment.too_long_fragment",
25444       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
25445       NULL, HFILL } },
25446
25447     {&hf_ieee80211_gas_resp_fragment_error,
25448      {"GAS Query Response reassembly error", "wlan.fixed.fragment.error",
25449       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
25450       NULL, HFILL } },
25451
25452     {&hf_ieee80211_gas_resp_fragment_count,
25453      {"GAS Query Response fragment count", "wlan.fixed.fragment.count",
25454       FT_UINT32, BASE_DEC, NULL, 0x00,
25455       NULL, HFILL } },
25456
25457     {&hf_ieee80211_gas_resp_reassembled_in,
25458      {"Reassembled in", "wlan.fixed.reassembled.in",
25459       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
25460       NULL, HFILL } },
25461
25462     {&hf_ieee80211_gas_resp_reassembled_length,
25463      {"Reassembled length", "wlan.fixed.reassembled.length",
25464       FT_UINT32, BASE_DEC, NULL, 0x00,
25465       NULL, HFILL } },
25466
25467     {&hf_ieee80211_ff_anqp_info_id,
25468      {"Info ID", "wlan.fixed.anqp.info_id",
25469       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
25470       "Access Network Query Protocol Info ID", HFILL }},
25471
25472     {&hf_ieee80211_ff_anqp_info_length,
25473      {"Length", "wlan.fixed.anqp.info_length",
25474       FT_UINT16, BASE_DEC, NULL, 0,
25475       "Access Network Query Protocol Length", HFILL }},
25476
25477     {&hf_ieee80211_ff_anqp_info,
25478      {"Information", "wlan.fixed.anqp.info",
25479       FT_BYTES, BASE_NONE, NULL, 0,
25480       "Access Network Query Protocol Information", HFILL }},
25481
25482     {&hf_ieee80211_ff_anqp_query_id,
25483      {"ANQP Query ID", "wlan.fixed.anqp.query_id",
25484       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
25485       "Access Network Query Protocol Query ID", HFILL }},
25486
25487     {&hf_ieee80211_ff_anqp_capability,
25488      {"ANQP Capability", "wlan.fixed.anqp.capability",
25489       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
25490       "Access Network Query Protocol Query ID", HFILL }},
25491
25492     {&hf_ieee80211_ff_anqp_capability_vlen,
25493      {"Vendor-specific Capability Length", "wlan.fixed.anqp.capability_vlen",
25494       FT_UINT16, BASE_DEC, NULL, 0,
25495       NULL, HFILL }},
25496
25497     {&hf_ieee80211_ff_anqp_capability_vendor,
25498      {"Vendor-specific Capability", "wlan.fixed.anqp.capability_vendor",
25499       FT_BYTES, BASE_NONE, NULL, 0,
25500       NULL, HFILL }},
25501
25502     {&hf_ieee80211_ff_venue_info_group,
25503      {"Venue Group", "wlan.fixed.venue_info.group",
25504       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &venue_group_vals_ext, 0,
25505       NULL, HFILL }},
25506
25507     {&hf_ieee80211_ff_venue_info_type,
25508      {"Venue Type", "wlan.fixed.venue_info.type",
25509       FT_UINT8, BASE_DEC, NULL, 0,
25510       NULL, HFILL }},
25511
25512     {&hf_ieee80211_ff_anqp_venue_length,
25513      {"Venue Name Duple Length", "wlan.fixed.anqp.venue.length",
25514       FT_UINT8, BASE_DEC, NULL, 0,
25515       NULL, HFILL }},
25516
25517     {&hf_ieee80211_ff_anqp_venue_language,
25518      {"Language Code", "wlan.fixed.anqp.venue.language",
25519       FT_STRING, BASE_NONE, NULL, 0,
25520       "Venue Name Language Code", HFILL }},
25521
25522     {&hf_ieee80211_ff_anqp_venue_name,
25523      {"Venue Name", "wlan.fixed.anqp.venue.name",
25524       FT_STRING, BASE_NONE, NULL, 0,
25525       NULL, HFILL }},
25526
25527     {&hf_ieee80211_ff_anqp_nw_auth_type_indicator,
25528      {"Network Authentication Type Indicator", "wlan.fixed.anqp.nw_auth_type.indicator",
25529       FT_UINT8, BASE_DEC, VALS(nw_auth_type_vals), 0,
25530       NULL, HFILL }},
25531
25532     {&hf_ieee80211_ff_anqp_nw_auth_type_url_len,
25533      {"Re-direct URL Length", "wlan.fixed.anqp.nw_auth_type.url_len",
25534       FT_UINT16, BASE_DEC, NULL, 0,
25535       NULL, HFILL }},
25536
25537     {&hf_ieee80211_ff_anqp_nw_auth_type_url,
25538      {"Re-direct URL", "wlan.fixed.anqp.nw_auth_type_url",
25539       FT_STRING, BASE_NONE, NULL, 0,
25540       NULL, HFILL }},
25541
25542     {&hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
25543      {"OI Length", "wlan.fixed.anqp.roaming_consortium.oi_len",
25544       FT_UINT8, BASE_DEC, NULL, 0,
25545       "Roaming Consortium OI Length", HFILL }},
25546
25547     {&hf_ieee80211_ff_anqp_roaming_consortium_oi,
25548      {"OI", "wlan.fixed.anqp.roaming_consortium.oi",
25549       FT_BYTES, BASE_NONE, NULL, 0,
25550       "Roaming Consortium OI", HFILL }},
25551
25552     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
25553      {"IPv6 Address", "wlan.fixed.anqp.ip_addr_availability.ipv6",
25554       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv6_vals), 0x03,
25555       "IP Address Type Availability information for IPv6", HFILL }},
25556
25557     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
25558      {"IPv4 Address", "wlan.fixed.anqp.ip_addr_availability.ipv4",
25559       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv4_vals), 0xfc,
25560       "IP Address Type Availability information for IPv4", HFILL }},
25561
25562     {&hf_ieee80211_ff_anqp_nai_realm_count,
25563      {"NAI Realm Count", "wlan.fixed.anqp.nai_realm_list.count",
25564       FT_UINT16, BASE_DEC, NULL, 0,
25565       NULL, HFILL }},
25566
25567     {&hf_ieee80211_ff_anqp_nai_field_len,
25568      {"NAI Realm Data Field Length", "wlan.fixed.anqp.nai_realm_list.field_len",
25569       FT_UINT16, BASE_DEC, NULL, 0,
25570       NULL, HFILL }},
25571
25572     {&hf_ieee80211_ff_anqp_nai_realm_encoding,
25573      {"NAI Realm Encoding", "wlan.fixed.naqp_nai_realm_list.encoding",
25574       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals), 0x01,
25575       NULL, HFILL }},
25576
25577     {&hf_ieee80211_ff_anqp_nai_realm_length,
25578      {"NAI Realm Length", "wlan.fixed.naqp_nai_realm_list.realm_length",
25579       FT_UINT8, BASE_DEC, NULL, 0,
25580       NULL, HFILL }},
25581
25582     {&hf_ieee80211_ff_anqp_nai_realm,
25583      {"NAI Realm", "wlan.fixed.naqp_nai_realm_list.realm",
25584       FT_STRING, BASE_NONE, NULL, 0,
25585       NULL, HFILL }},
25586
25587     {&hf_ieee80211_ff_anqp_nai_realm_eap_count,
25588      {"EAP Method Count", "wlan.fixed.naqp_nai_realm_list.eap_method_count",
25589       FT_UINT8, BASE_DEC, NULL, 0,
25590       NULL, HFILL }},
25591
25592     {&hf_ieee80211_ff_anqp_nai_realm_eap_len,
25593      {"EAP Method subfield Length", "wlan.fixed.naqp_nai_realm_list.eap_method_len",
25594       FT_UINT8, BASE_DEC, NULL, 0,
25595       NULL, HFILL }},
25596
25597     {&hf_ieee80211_ff_anqp_nai_realm_eap_method,
25598      {"EAP Method", "wlan.fixed.naqp_nai_realm_list.eap_method",
25599       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &eap_type_vals_ext, 0,
25600       NULL, HFILL }},
25601
25602     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
25603      {"Authentication Parameter Count", "wlan.fixed.naqp_nai_realm_list.auth_param_count",
25604       FT_UINT8, BASE_DEC, NULL, 0,
25605       NULL, HFILL }},
25606
25607     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
25608      {"Authentication Parameter ID", "wlan.fixed.naqp_nai_realm_list.auth_param_id",
25609       FT_UINT8, BASE_DEC, VALS(nai_realm_auth_param_id_vals), 0,
25610       NULL, HFILL }},
25611
25612     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
25613      {"Authentication Parameter Length", "wlan.fixed.naqp_nai_realm_list.auth_param_len",
25614       FT_UINT8, BASE_DEC, NULL, 0,
25615       NULL, HFILL }},
25616
25617     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
25618      {"Authentication Parameter Value", "wlan.fixed.naqp_nai_realm_list.auth_param_value",
25619       FT_BYTES, BASE_NONE, NULL, 0,
25620       NULL, HFILL }},
25621
25622     {&hf_ieee80211_3gpp_gc_gud,
25623      {"GUD", "wlan.fixed.anqp.3gpp_cellular_info.gud",
25624       FT_UINT8, BASE_DEC, NULL, 0,
25625       "Generic container User Data", HFILL }},
25626
25627     {&hf_ieee80211_3gpp_gc_udhl,
25628      {"UDHL", "wlan.fixed.anqp.3gpp_cellular_info.udhl",
25629       FT_UINT8, BASE_DEC, NULL, 0,
25630       "User Data Header Length", HFILL }},
25631
25632     {&hf_ieee80211_3gpp_gc_iei,
25633      {"IEI", "wlan.fixed.anqp.3gpp_cellular_info.iei",
25634       FT_UINT8, BASE_DEC, NULL, 0,
25635       "Information Element Identity", HFILL }},
25636
25637     {&hf_ieee80211_3gpp_gc_plmn_len,
25638      {"PLMN Length", "wlan.fixed.anqp.3gpp_cellular_info.plmn_len",
25639       FT_UINT8, BASE_DEC, NULL, 0,
25640       "Length of PLMN List value contents", HFILL }},
25641
25642     {&hf_ieee80211_3gpp_gc_num_plmns,
25643      {"Number of PLMNs", "wlan.fixed.anqp.3gpp_cellular_info.num_plmns",
25644       FT_UINT8, BASE_DEC, NULL, 0,
25645       NULL, HFILL }},
25646
25647     {&hf_ieee80211_ff_anqp_domain_name_len,
25648      {"Domain Name Length", "wlan.fixed.anqp.domain_name_list.len",
25649       FT_UINT8, BASE_DEC, NULL, 0,
25650       NULL, HFILL }},
25651
25652     {&hf_ieee80211_ff_anqp_domain_name,
25653      {"Domain Name", "wlan.fixed.anqp.domain_name_list.name",
25654       FT_STRING, BASE_NONE, NULL, 0,
25655       NULL, HFILL }},
25656
25657     {&hf_ieee80211_ff_anqp_venue_url_len,
25658      {"Length", "wlan.fixed.anqp.venue_url_list.len",
25659       FT_UINT8, BASE_DEC, NULL, 0,
25660       NULL, HFILL }},
25661
25662     {&hf_ieee80211_ff_anqp_venue_url_number,
25663      {"Venue Number", "wlan.fixed.anqp.venue_url_list.venue_number",
25664       FT_UINT8, BASE_DEC, NULL, 0,
25665       NULL, HFILL }},
25666
25667     {&hf_ieee80211_ff_anqp_venue_url,
25668      {"Venue URL", "wlan.fixed.anqp.venue_url_list.venue_url",
25669       FT_STRING, BASE_NONE, NULL, 0,
25670       NULL, HFILL }},
25671
25672     {&hf_ieee80211_ff_dls_timeout,
25673      {"DLS timeout", "wlan.fixed.dls_timeout",
25674       FT_UINT16, BASE_HEX, NULL, 0,
25675       "DLS timeout value", HFILL }},
25676
25677     {&hf_ieee80211_ff_sa_query_action_code,
25678      {"Action code", "wlan.fixed.action_code",
25679       FT_UINT8, BASE_DEC, VALS(sa_query_action_codes), 0,
25680       "Management action code", HFILL }},
25681
25682     {&hf_ieee80211_ff_transaction_id,
25683      {"Transaction Id", "wlan.fixed.transaction_id",
25684       FT_UINT16, BASE_HEX, NULL, 0,
25685       NULL, HFILL }},
25686
25687     {&hf_ieee80211_ff_send_confirm,
25688      {"Send-Confirm", "wlan.fixed.send_confirm",
25689       FT_UINT16, BASE_DEC, NULL, 0,
25690       NULL, HFILL }},
25691
25692     {&hf_ieee80211_ff_anti_clogging_token,
25693      {"Anti-Clogging Token", "wlan.fixed.anti_clogging_token",
25694       FT_BYTES, BASE_NONE, NULL, 0,
25695       NULL, HFILL }},
25696
25697     {&hf_ieee80211_ff_scalar,
25698      {"Scalar", "wlan.fixed.scalar",
25699       FT_BYTES, BASE_NONE, NULL, 0,
25700       NULL, HFILL }},
25701
25702     {&hf_ieee80211_ff_finite_field_element,
25703      {"Finite Field Element", "wlan.fixed.finite_field_element",
25704       FT_BYTES, BASE_NONE, NULL, 0,
25705       NULL, HFILL }},
25706
25707     {&hf_ieee80211_ff_confirm,
25708      {"Confirm", "wlan.fixed.confirm",
25709       FT_BYTES, BASE_NONE, NULL, 0,
25710       NULL, HFILL }},
25711
25712     {&hf_ieee80211_ff_finite_cyclic_group,
25713      {"Group Id", "wlan.fixed.finite_cyclic_group",
25714       FT_UINT16, BASE_DEC, NULL, 0,
25715       NULL, HFILL }},
25716
25717     {&hf_ieee80211_anqp_wfa_subtype,
25718      {"WFA Subtype", "wlan.anqp.wfa.subtype",
25719       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }},
25720
25721     {&hf_ieee80211_dpp_subtype,
25722      {"DPP Subtype", "wlan.wfa.dpp.subtype",
25723       FT_UINT8, BASE_DEC, VALS(dpp_subtype_vals), 0, NULL, HFILL }},
25724
25725     {&hf_hs20_indication_dgaf_disabled,
25726      {"DGAF Disabled", "wlan.hs20.indication.dgaf_disabled",
25727       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
25728
25729     {&hf_hs20_indication_pps_mo_id_present,
25730      {"PPS MO ID Present", "wlan.hs20.indication.pps_mo_id_present",
25731       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
25732
25733     {&hf_hs20_indication_anqp_domain_id_present,
25734      {"ANQP Domain ID Present", "wlan.hs20.indication.anqp_domain_id_present",
25735       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
25736
25737     {&hf_hs20_indication_release_number,
25738      {"Release Number", "wlan.hs20.indication.release_number",
25739       FT_UINT8, BASE_DEC, VALS(hs20_indication_release_number_vals), 0xF0, NULL, HFILL }},
25740
25741     {&hf_hs20_anqp_subtype,
25742      {"Subtype", "wlan.hs20.anqp.subtype",
25743       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
25744       "Hotspot 2.0 ANQP Subtype", HFILL }},
25745
25746     {&hf_hs20_anqp_reserved,
25747      {"Reserved", "wlan.hs20.anqp.reserved",
25748       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
25749
25750     {&hf_hs20_anqp_payload,
25751      {"Payload", "wlan.hs20.anqp.payload",
25752       FT_BYTES, BASE_NONE, NULL, 0,
25753       "Hotspot 2.0 ANQP Payload", HFILL }},
25754
25755     {&hf_hs20_anqp_hs_query_list,
25756      {"Queried Subtype", "wlan.hs20.anqp.hs_query_list",
25757       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
25758       "Queried HS 2.0 Element Subtype", HFILL }},
25759
25760     {&hf_hs20_anqp_hs_capability_list,
25761      {"Capability", "wlan.hs20.anqp.hs_capability_list",
25762       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
25763       "Hotspot 2.0 ANQP Subtype Capability", HFILL }},
25764
25765     {&hf_hs20_anqp_ofn_length,
25766      {"Length", "wlan.hs20.anqp.ofn.length",
25767       FT_UINT8, BASE_DEC, NULL, 0,
25768       "Operator Friendly Name Length", HFILL }},
25769
25770     {&hf_hs20_anqp_ofn_language,
25771      {"Language Code", "wlan.hs20.anqp.ofn.language",
25772       FT_STRING, BASE_NONE, NULL, 0,
25773       "Operator Friendly Name Language Code", HFILL }},
25774
25775     {&hf_hs20_anqp_ofn_name,
25776      {"Operator Friendly Name", "wlan.hs20.anqp.ofn.name",
25777       FT_STRING, BASE_NONE, NULL, 0,
25778       NULL, HFILL }},
25779
25780     {&hf_hs20_anqp_wan_metrics_link_status,
25781      {"Link Status", "wlan.hs20.anqp.wan_metrics.link_status",
25782       FT_UINT8, BASE_DEC, VALS(hs20_wm_link_status_vals), 0x03, NULL, HFILL }},
25783
25784     {&hf_hs20_anqp_wan_metrics_symmetric_link,
25785      {"Symmetric Link", "wlan.hs20.anqp.wan_metrics.symmetric_link",
25786       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
25787
25788     {&hf_hs20_anqp_wan_metrics_at_capacity,
25789      {"At Capacity", "wlan.hs20.anqp.wan_metrics.at_capacity",
25790       FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
25791
25792     {&hf_hs20_anqp_wan_metrics_reserved,
25793      {"Reserved", "wlan.hs20.anqp.wan_metrics.reserved",
25794       FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }},
25795
25796     {&hf_hs20_anqp_wan_metrics_downlink_speed,
25797      {"Downlink Speed", "wlan.hs20.anqp.wan_metrics.downlink_speed",
25798       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
25799
25800     {&hf_hs20_anqp_wan_metrics_uplink_speed,
25801      {"Uplink Speed", "wlan.hs20.anqp.wan_metrics.uplink_speed",
25802       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
25803
25804     {&hf_hs20_anqp_wan_metrics_downlink_load,
25805      {"Downlink Load", "wlan.hs20.anqp.wan_metrics.downlink_load",
25806       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
25807
25808     {&hf_hs20_anqp_wan_metrics_uplink_load,
25809      {"Uplink Load", "wlan.hs20.anqp.wan_metrics.uplink_load",
25810       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
25811
25812     {&hf_hs20_anqp_wan_metrics_lmd,
25813      {"LMD", "wlan.hs20.anqp.wan_metrics.lmd",
25814       FT_UINT16, BASE_DEC, NULL, 0, "Load Measurement Duration", HFILL }},
25815
25816     {&hf_hs20_anqp_cc_proto_ip_proto,
25817      {"IP Protocol", "wlan.hs20.anqp.cc.ip_proto",
25818       FT_UINT8, BASE_DEC, NULL, 0,
25819       "ProtoPort Tuple - IP Protocol", HFILL }},
25820
25821     {&hf_hs20_anqp_cc_proto_port_num,
25822      {"Port Number", "wlan.hs20.anqp.cc.port_num",
25823       FT_UINT16, BASE_DEC, NULL, 0,
25824       "ProtoPort Tuple - Port Number", HFILL }},
25825
25826     {&hf_hs20_anqp_cc_proto_status,
25827      {"Status", "wlan.hs20.anqp.cc.status",
25828       FT_UINT8, BASE_DEC, VALS(hs20_cc_status_vals), 0,
25829       "ProtoPort Tuple - Status", HFILL }},
25830
25831     {&hf_hs20_anqp_nai_hrq_count,
25832      {"NAI Home Realm Count", "wlan.hs20.anqp.nai_hrq.count",
25833       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
25834
25835     {&hf_hs20_anqp_nai_hrq_encoding_type,
25836      {"NAI Home Realm Encoding Type",
25837       "wlan.hs20.anqp.nai_hrq.encoding_type",
25838       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals),
25839       0x01, NULL, HFILL }},
25840
25841     {&hf_hs20_anqp_nai_hrq_length,
25842      {"NAI Home Realm Name Length", "wlan.hs20.anqp.nai_hrq.length",
25843       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
25844
25845     {&hf_hs20_anqp_nai_hrq_realm_name,
25846      {"NAI Home Realm Name", "wlan.hs20.anqp.nai_hrq.name",
25847       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
25848
25849     {&hf_hs20_anqp_oper_class_indic,
25850      {"Operating Class", "wlan.hs20.anqp.oper_class_indic.oper_class",
25851       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
25852
25853     {&hf_ieee80211_tag,
25854      {"Tag", "wlan.tag",
25855       FT_NONE, BASE_NONE, 0x0, 0,
25856       NULL, HFILL }},
25857
25858     {&hf_ieee80211_tag_number,
25859      {"Tag Number", "wlan.tag.number",
25860       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
25861       "Element ID", HFILL }},
25862
25863     {&hf_ieee80211_tag_length,
25864      {"Tag length", "wlan.tag.length",
25865       FT_UINT32, BASE_DEC, NULL, 0,
25866       "Length of tag", HFILL }},
25867
25868     {&hf_ieee80211_tag_interpretation,
25869      {"Tag interpretation", "wlan.tag.interpretation",
25870       FT_STRING, BASE_NONE, NULL, 0,
25871       "Interpretation of tag", HFILL }},
25872
25873     {&hf_ieee80211_tag_data,
25874      {"Tag Data", "wlan.tag.data",
25875       FT_BYTES, BASE_NONE, NULL, 0,
25876       "Data Interpretation of tag", HFILL }},
25877
25878     {&hf_ieee80211_tag_oui,
25879      {"OUI", "wlan.tag.oui",
25880       FT_UINT24, BASE_OUI, NULL, 0,
25881       "OUI of vendor specific IE", HFILL }},
25882
25883     {&hf_ieee80211_tag_oui_wfa_subtype,
25884      {"WFA Subtype", "wlan.tag.oui.wfa_subtype",
25885       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0,
25886       NULL, HFILL }},
25887
25888     {&hf_ieee80211_tag_ds_param_channel,
25889      {"Current Channel", "wlan.ds.current_channel",
25890       FT_UINT8, BASE_DEC, NULL, 0,
25891       "DS Parameter Set - Current Channel", HFILL }},
25892
25893     {&hf_ieee80211_tag_cfp_count,
25894      {"CFP Count", "wlan.cfp.count",
25895       FT_UINT8, BASE_DEC, NULL, 0,
25896       "Indicates how many delivery traffic indication messages (DTIMs)", HFILL }},
25897
25898     {&hf_ieee80211_tag_cfp_period,
25899      {"CFP Period", "wlan.cfp.period",
25900       FT_UINT8, BASE_DEC, NULL, 0,
25901       "Indicates the number of DTIM intervals between the start of CFPs", HFILL }},
25902
25903     {&hf_ieee80211_tag_cfp_max_duration,
25904      {"CFP Max Duration", "wlan.cfp.max_duration",
25905       FT_UINT16, BASE_DEC, NULL, 0,
25906       "Indicates the maximum duration (in TU) of the CFP that may be generated by this PCF", HFILL }},
25907
25908     {&hf_ieee80211_tag_cfp_dur_remaining,
25909      {"CFP Dur Remaining", "wlan.cfp.dur_remaining",
25910       FT_UINT16, BASE_DEC, NULL, 0,
25911       "Indicates the maximum time (in TU) remaining in the present CFP", HFILL }},
25912
25913     {&hf_ieee80211_tag_vendor_oui_type,
25914      {"Vendor Specific OUI Type", "wlan.tag.vendor.oui.type",
25915       FT_UINT8, BASE_DEC, NULL, 0,
25916       NULL, HFILL }},
25917
25918     {&hf_ieee80211_tag_vendor_data,
25919      {"Vendor Specific Data", "wlan.tag.vendor.data",
25920       FT_BYTES, BASE_NONE, NULL, 0,
25921       "Unknown/undecoded Vendor Specific Data", HFILL }},
25922
25923     {&hf_ieee80211_tim_dtim_count,
25924      {"DTIM count", "wlan.tim.dtim_count",
25925       FT_UINT8, BASE_DEC, NULL, 0,
25926       "Indicates how many Beacon frames (including the current frame) appear before the next DTIM", HFILL }},
25927
25928     {&hf_ieee80211_tim_dtim_period,
25929      {"DTIM period", "wlan.tim.dtim_period",
25930       FT_UINT8, BASE_DEC, NULL, 0,
25931       "Indicates the number of beacon intervals between successive DTIMs", HFILL }},
25932
25933     {&hf_ieee80211_tim_bmapctl,
25934      {"Bitmap control", "wlan.tim.bmapctl",
25935       FT_UINT8, BASE_HEX, NULL, 0,
25936       NULL, HFILL }},
25937
25938     {&hf_ieee80211_tim_bmapctl_mcast,
25939      {"Multicast", "wlan.tim.bmapctl.multicast",
25940       FT_BOOLEAN, 8, NULL, 0x1,
25941       "Contains the Traffic Indicator bit associated with Association ID 0", HFILL }},
25942
25943     {&hf_ieee80211_tim_bmapctl_offset,
25944      {"Bitmap Offset", "wlan.tim.bmapctl.offset",
25945       FT_UINT8, BASE_HEX, NULL, 0xFE,
25946       NULL, HFILL }},
25947
25948     {&hf_ieee80211_tim_partial_virtual_bitmap,
25949      {"Partial Virtual Bitmap", "wlan.tim.partial_virtual_bitmap",
25950       FT_BYTES, BASE_NONE, NULL, 0x0,
25951       NULL, HFILL }},
25952
25953     {&hf_ieee80211_tim_aid,
25954      {"Association ID", "wlan.tim.aid",
25955       FT_UINT8, BASE_HEX, NULL, 0x0,
25956       NULL, HFILL }},
25957
25958     {&hf_ieee80211_tag_ibss_atim_window,
25959      {"Atim Windows", "wlan.ibss.atim_windows",
25960       FT_UINT16, BASE_HEX, NULL, 0x0,
25961       "Contains the ATIM Window length in TU", HFILL }},
25962
25963     {&hf_ieee80211_tag_country_info_code,
25964      {"Code", "wlan.country_info.code",
25965       FT_STRING, BASE_NONE, NULL, 0x0,
25966       NULL, HFILL }},
25967
25968     {&hf_ieee80211_tag_country_info_env,
25969      {"Environment", "wlan.country_info.environment",
25970       FT_UINT8, BASE_HEX, VALS(environment_vals), 0x0,
25971       NULL, HFILL }},
25972
25973     {&hf_ieee80211_tag_country_info_pad,
25974      {"Padding", "wlan.country_info.padding",
25975       FT_BYTES, BASE_NONE, NULL, 0x0,
25976       NULL, HFILL }},
25977
25978     {&hf_ieee80211_tag_country_info_fnm,
25979      {"Country Info", "wlan.country_info.fnm",
25980       FT_NONE, BASE_NONE, NULL, 0x0,
25981       NULL, HFILL }},
25982
25983     {&hf_ieee80211_tag_country_info_fnm_fcn,
25984      {"First Channel Number", "wlan.country_info.fnm.fcn",
25985       FT_UINT8, BASE_DEC, NULL, 0x0,
25986       NULL, HFILL }},
25987
25988     {&hf_ieee80211_tag_country_info_fnm_nc,
25989      {"Number of Channels", "wlan.country_info.fnm.nc",
25990       FT_UINT8, BASE_DEC, NULL, 0x0,
25991       NULL, HFILL }},
25992
25993     {&hf_ieee80211_tag_country_info_fnm_mtpl,
25994      {"Maximum Transmit Power Level (in dBm)", "wlan.country_info.fnm.mtpl",
25995       FT_UINT8, BASE_DEC, NULL, 0x0,
25996       NULL, HFILL }},
25997
25998     {&hf_ieee80211_tag_country_info_rrc,
25999      {"Country Info", "wlan.country_info.rrc",
26000       FT_NONE, BASE_NONE, NULL, 0x0,
26001       NULL, HFILL }},
26002
26003     {&hf_ieee80211_tag_country_info_rrc_oei,
26004      {"Operating Extension Identifier", "wlan.country_info.rrc.oei",
26005       FT_UINT8, BASE_DEC, NULL, 0x0,
26006       NULL, HFILL }},
26007
26008     {&hf_ieee80211_tag_country_info_rrc_oc,
26009      {"Operating Class", "wlan.country_info.rrc.oc",
26010       FT_UINT8, BASE_DEC, NULL, 0x0,
26011       NULL, HFILL }},
26012
26013     {&hf_ieee80211_tag_country_info_rrc_cc,
26014      {"Coverage Class", "wlan.country_info.rrc.cc",
26015       FT_UINT8, BASE_DEC, NULL, 0x0,
26016       NULL, HFILL }},
26017
26018     {&hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
26019      {"Prime Radix", "wlan.fh_hopping.parameter.prime_radix",
26020       FT_UINT8, BASE_DEC, NULL, 0x0,
26021       NULL, HFILL }},
26022
26023     {&hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
26024      {"Number of Channels", "wlan.fh_hopping.parameter.nb_channels",
26025       FT_UINT8, BASE_DEC, NULL, 0x0,
26026       NULL, HFILL }},
26027
26028     {&hf_ieee80211_tag_fh_hopping_table_flag,
26029      {"Flag", "wlan.fh_hopping.table.flag",
26030       FT_UINT8, BASE_HEX, NULL, 0x0,
26031       "Indicates that a Random Table is present when the value is 1", HFILL }},
26032
26033     {&hf_ieee80211_tag_fh_hopping_table_number_of_sets,
26034      {"Number of Sets", "wlan.fh_hopping.table.number_of_sets",
26035       FT_UINT8, BASE_DEC, NULL, 0x0,
26036       "Indicates the total number of sets within the hopping patterns", HFILL }},
26037
26038     {&hf_ieee80211_tag_fh_hopping_table_modulus,
26039      {"Modulus", "wlan.fh_hopping.table.modulus",
26040       FT_UINT8, BASE_HEX, NULL, 0x0,
26041       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
26042
26043     {&hf_ieee80211_tag_fh_hopping_table_offset,
26044      {"Offset", "wlan.fh_hopping.table.offset",
26045       FT_UINT8, BASE_HEX, NULL, 0x0,
26046       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
26047
26048     {&hf_ieee80211_tag_fh_hopping_random_table,
26049      {"Random Table", "wlan.fh_hopping.table.random_table",
26050       FT_UINT16, BASE_HEX, NULL, 0x0,
26051       "It is a vector of single octet values that indicate the random sequence to be followed during a hopping sequence", HFILL }},
26052
26053     {&hf_ieee80211_tag_request,
26054      {"Requested Element ID", "wlan.tag.request",
26055       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
26056       "The list of elements that are to be included in the responding STA Probe Response frame", HFILL }},
26057
26058     {&hf_ieee80211_tclas_up,
26059      {"User Priority", "wlan.tclas.user_priority",
26060       FT_UINT8, BASE_DEC, NULL, 0,
26061       "Contains the value of the UP of the associated MSDUs", HFILL }},
26062
26063     {&hf_ieee80211_tclas_class_type,
26064      {"Classifier Type", "wlan.tclas.class_type",
26065       FT_UINT8, BASE_DEC, VALS(classifier_type), 0,
26066       "Specifies the type of classifier parameters", HFILL }},
26067
26068     {&hf_ieee80211_tclas_class_mask,
26069      {"Classifier Mask", "wlan.tclas.class_mask",
26070       FT_UINT8, BASE_HEX,  NULL, 0,
26071       "Specifies a bitmap where bits that are set to 1 identify a subset of the classifier parameters", HFILL }},
26072
26073     {&hf_ieee80211_tclas_class_mask0_src_addr,
26074      {"Source Address", "wlan.tclas.class_mask.src_addr",
26075       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
26076
26077     {&hf_ieee80211_tclas_class_mask0_dst_addr,
26078      {"Destination Address", "wlan.tclas.class_mask.dst_addr",
26079       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
26080
26081     {&hf_ieee80211_tclas_class_mask0_type,
26082      {"Type", "wlan.tclas.class_mask.type",
26083       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
26084
26085     {&hf_ieee80211_tclas_class_mask1_ver,
26086      {"Version", "wlan.tclas.class_mask.version",
26087       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
26088
26089     {&hf_ieee80211_tclas_class_mask1_src_ip,
26090      {"Source IP Address", "wlan.tclas.class_mask.src_ip",
26091       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
26092
26093     {&hf_ieee80211_tclas_class_mask1_dst_ip,
26094      {"Destination IP Address", "wlan.tclas.class_mask.dst_ip",
26095       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
26096
26097     {&hf_ieee80211_tclas_class_mask1_src_port,
26098      {"Source Port", "wlan.tclas.class_mask.src_port",
26099       FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL }},
26100
26101     {&hf_ieee80211_tclas_class_mask1_dst_port,
26102      {"Destination Port", "wlan.tclas.class_mask.dst_port",
26103       FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL }},
26104
26105     {&hf_ieee80211_tclas_class_mask1_ipv4_dscp,
26106      {"DSCP", "wlan.tclas.class_mask.dscp",
26107       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
26108
26109     {&hf_ieee80211_tclas_class_mask1_ipv4_proto,
26110      {"Protocol", "wlan.tclas.class_mask.proto",
26111       FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL }},
26112
26113     {&hf_ieee80211_tclas_class_mask1_ipv6_flow,
26114      {"Flow Label", "wlan.tclas.class_mask.flow_label",
26115       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
26116
26117     {&hf_ieee80211_tclas_class_mask2_tci,
26118      {"802.1Q CLAN TCI", "wlan.tclas.class_mask.tci",
26119       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
26120
26121     {&hf_ieee80211_tclas_src_mac_addr,
26122      {"Source address", "wlan.tclas.src_mac_addr",
26123       FT_ETHER, BASE_NONE, NULL, 0,
26124       "Classifier Parameters Ethernet Type", HFILL }},
26125
26126     {&hf_ieee80211_tclas_dst_mac_addr,
26127      {"Destination address", "wlan.tclas.dat_mac_addr",
26128       FT_ETHER, BASE_NONE, NULL, 0,
26129       NULL, HFILL }},
26130
26131     {&hf_ieee80211_tclas_ether_type,
26132      {"Ethernet Type", "wlan.tclas.ether_type",
26133       FT_UINT8, BASE_DEC, NULL, 0,
26134       NULL, HFILL }},
26135
26136     {&hf_ieee80211_tclas_version,
26137      {"IP Version", "wlan.tclas.version",
26138       FT_UINT8, BASE_DEC, NULL, 0,
26139       NULL, HFILL }},
26140
26141     {&hf_ieee80211_tclas_ipv4_src,
26142      {"IPv4 Src Addr", "wlan.tclas.ipv4_src",
26143       FT_IPv4, BASE_NONE, NULL, 0,
26144       NULL, HFILL }},
26145
26146     {&hf_ieee80211_tclas_ipv4_dst,
26147      {"IPv4 Dst Addr", "wlan.tclas.ipv4_dst",
26148       FT_IPv4, BASE_NONE, NULL, 0,
26149       NULL, HFILL }},
26150
26151     {&hf_ieee80211_tclas_src_port,
26152      {"Source Port", "wlan.tclas.src_port",
26153       FT_UINT16, BASE_DEC, NULL, 0,
26154       NULL, HFILL }},
26155
26156     {&hf_ieee80211_tclas_dst_port,
26157      {"Destination Port", "wlan.tclas.dst_port",
26158       FT_UINT16, BASE_DEC, NULL, 0,
26159       NULL, HFILL }},
26160
26161     {&hf_ieee80211_tclas_dscp,
26162      {"IPv4 DSCP", "wlan.tclas.dscp",
26163       FT_UINT8, BASE_HEX, NULL, 0,
26164       "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
26165
26166     {&hf_ieee80211_tclas_protocol,
26167      {"Protocol", "wlan.tclas.protocol",
26168       FT_UINT8, BASE_HEX, NULL, 0,
26169       "IPv4 Protocol", HFILL }},
26170
26171     {&hf_ieee80211_tclas_ipv6_src,
26172      {"IPv6 Src Addr", "wlan.tclas.ipv6_src",
26173       FT_IPv6, BASE_NONE, NULL, 0,
26174       NULL, HFILL }},
26175
26176     {&hf_ieee80211_tclas_ipv6_dst,
26177      {"IPv6 Dst Addr", "wlan.tclas.ipv6_dst",
26178       FT_IPv6, BASE_NONE, NULL, 0,
26179       NULL, HFILL }},
26180
26181     {&hf_ieee80211_tclas_flow,
26182      {"Flow Label", "wlan.tclas.flow",
26183       FT_UINT24, BASE_HEX, NULL, 0,
26184       "IPv6 Flow Label", HFILL }},
26185
26186     {&hf_ieee80211_tclas_tag_type,
26187      {"802.1Q Tag Type", "wlan.tclas.tag_type",
26188       FT_UINT16, BASE_HEX, NULL, 0,
26189       NULL, HFILL }},
26190
26191     {&hf_ieee80211_tag_challenge_text,
26192      {"Challenge Text", "wlan.tag.challenge_text",
26193       FT_BYTES, BASE_NONE, NULL, 0,
26194       NULL, HFILL }},
26195
26196     {&hf_ieee80211_rsn_version,
26197      {"RSN Version", "wlan.rsn.version",
26198       FT_UINT16, BASE_DEC, NULL, 0,
26199       "Indicates the version number of the RSNA protocol", HFILL }},
26200
26201     {&hf_ieee80211_rsn_gcs,
26202      {"Group Cipher Suite", "wlan.rsn.gcs",
26203       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gcs_base_custom), 0,
26204       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
26205
26206     {&hf_ieee80211_rsn_gcs_oui,
26207      {"Group Cipher Suite OUI", "wlan.rsn.gcs.oui",
26208       FT_UINT24, BASE_OUI, NULL, 0,
26209       NULL, HFILL }},
26210
26211     {&hf_ieee80211_rsn_gcs_type,
26212      {"Group Cipher Suite type", "wlan.rsn.gcs.type",
26213       FT_UINT8, BASE_DEC, NULL, 0,
26214       NULL, HFILL }},
26215
26216     {&hf_ieee80211_rsn_gcs_80211_type,
26217      {"Group Cipher Suite type", "wlan.rsn.gcs.type",
26218       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
26219       NULL, HFILL }},
26220
26221     {&hf_ieee80211_rsn_pcs_count,
26222      {"Pairwise Cipher Suite Count", "wlan.rsn.pcs.count",
26223       FT_UINT16, BASE_DEC,  NULL, 0,
26224       "Indicates the number of pairwise cipher suite selectors that are contained in the Pairwise Cipher Suite List", HFILL }},
26225
26226     {&hf_ieee80211_rsn_pcs_list,
26227      {"Pairwise Cipher Suite List", "wlan.rsn.pcs.list",
26228       FT_NONE, BASE_NONE, NULL, 0,
26229       "Contains a series of cipher suite selectors that indicate the pairwisecipher suites", HFILL }},
26230
26231     {&hf_ieee80211_rsn_pcs,
26232      {"Pairwise Cipher Suite", "wlan.rsn.pcs",
26233       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_pcs_base_custom), 0,
26234       NULL, HFILL }},
26235
26236     {&hf_ieee80211_rsn_pcs_oui,
26237      {"Pairwise Cipher Suite OUI", "wlan.rsn.pcs.oui",
26238       FT_UINT24, BASE_OUI, NULL, 0,
26239       NULL, HFILL }},
26240
26241     {&hf_ieee80211_rsn_pcs_type,
26242      {"Pairwise Cipher Suite type", "wlan.rsn.pcs.type",
26243       FT_UINT8, BASE_DEC, NULL, 0,
26244       NULL, HFILL }},
26245
26246     {&hf_ieee80211_rsn_pcs_80211_type,
26247      {"Pairwise Cipher Suite type", "wlan.rsn.pcs.type",
26248       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
26249       NULL, HFILL }},
26250
26251     {&hf_ieee80211_rsn_akms_count,
26252      {"Auth Key Management (AKM) Suite Count", "wlan.rsn.akms.count",
26253       FT_UINT16, BASE_DEC, NULL, 0,
26254       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
26255
26256     {&hf_ieee80211_rsn_akms_list,
26257      {"Auth Key Management (AKM) List", "wlan.rsn.akms.list",
26258       FT_NONE, BASE_NONE, NULL, 0,
26259       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
26260
26261     {&hf_ieee80211_rsn_akms,
26262      {"Auth Key Management (AKM) Suite", "wlan.rsn.akms",
26263       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_akms_base_custom), 0,
26264       NULL, HFILL }},
26265
26266     {&hf_ieee80211_rsn_akms_oui,
26267      {"Auth Key Management (AKM) OUI", "wlan.rsn.akms.oui",
26268       FT_UINT24, BASE_OUI, NULL, 0,
26269       NULL, HFILL }},
26270
26271     {&hf_ieee80211_rsn_akms_type,
26272      {"Auth Key Management (AKM) type", "wlan.rsn.akms.type",
26273       FT_UINT8, BASE_DEC, NULL, 0,
26274       NULL, HFILL }},
26275
26276     {&hf_ieee80211_rsn_akms_80211_type,
26277      {"Auth Key Management (AKM) type", "wlan.rsn.akms.type",
26278       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_keymgmt_vals), 0,
26279       NULL, HFILL }},
26280
26281     {&hf_ieee80211_rsn_cap,
26282      {"RSN Capabilities", "wlan.rsn.capabilities",
26283       FT_UINT16, BASE_HEX, NULL, 0,
26284       "RSN Capability information", HFILL }},
26285
26286     {&hf_ieee80211_rsn_cap_preauth,
26287      {"RSN Pre-Auth capabilities", "wlan.rsn.capabilities.preauth",
26288       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001,
26289       NULL, HFILL }},
26290
26291     {&hf_ieee80211_rsn_cap_no_pairwise,
26292      {"RSN No Pairwise capabilities", "wlan.rsn.capabilities.no_pairwise",
26293       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002,
26294       NULL, HFILL }},
26295
26296     {&hf_ieee80211_rsn_cap_ptksa_replay_counter,
26297      {"RSN PTKSA Replay Counter capabilities", "wlan.rsn.capabilities.ptksa_replay_counter",
26298       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C,
26299       NULL, HFILL }},
26300
26301     {&hf_ieee80211_rsn_cap_gtksa_replay_counter,
26302      {"RSN GTKSA Replay Counter capabilities", "wlan.rsn.capabilities.gtksa_replay_counter",
26303       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030,
26304       NULL, HFILL }},
26305
26306     {&hf_ieee80211_rsn_cap_mfpr,
26307      {"Management Frame Protection Required", "wlan.rsn.capabilities.mfpr",
26308       FT_BOOLEAN, 16, NULL, 0x0040,
26309       NULL, HFILL }},
26310
26311     {&hf_ieee80211_rsn_cap_mfpc,
26312      {"Management Frame Protection Capable", "wlan.rsn.capabilities.mfpc",
26313       FT_BOOLEAN, 16, NULL, 0x0080,
26314       NULL, HFILL }},
26315
26316     {&hf_ieee80211_rsn_cap_jmr,
26317      {"Joint Multi-band RSNA", "wlan.rsn.capabilities.jmr",
26318       FT_BOOLEAN, 16, NULL, 0x0100,
26319       NULL, HFILL }},
26320
26321     {&hf_ieee80211_rsn_cap_peerkey,
26322      {"PeerKey Enabled", "wlan.rsn.capabilities.peerkey",
26323       FT_BOOLEAN, 16, NULL, 0x0200,
26324       NULL, HFILL }},
26325
26326     {&hf_ieee80211_rsn_pmkid_count,
26327      {"PMKID Count", "wlan.rsn.pmkid.count",
26328       FT_UINT16, BASE_DEC, NULL, 0,
26329       "Indicates the number of PMKID  selectors that are contained in the PMKID Suite List", HFILL }},
26330
26331     {&hf_ieee80211_rsn_pmkid_list,
26332      {"PMKID List", "wlan.rsn.pmkid.list",
26333       FT_NONE, BASE_NONE, NULL, 0,
26334       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
26335
26336     {&hf_ieee80211_rsn_pmkid,
26337      {"PMKID", "wlan.pmkid.akms",
26338       FT_BYTES, BASE_NONE, NULL, 0,
26339       NULL, HFILL }},
26340
26341     {&hf_ieee80211_rsn_gmcs,
26342      {"Group Management Cipher Suite", "wlan.rsn.gmcs",
26343       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gmcs_base_custom), 0,
26344       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
26345
26346     {&hf_ieee80211_rsn_gmcs_oui,
26347      {"Group Management Cipher Suite OUI", "wlan.rsn.gmcs.oui",
26348       FT_UINT24, BASE_OUI, NULL, 0,
26349       NULL, HFILL }},
26350
26351     {&hf_ieee80211_rsn_gmcs_type,
26352      {"Group Management Cipher Suite type", "wlan.rsn.gmcs.type",
26353       FT_UINT8, BASE_DEC, NULL, 0,
26354       NULL, HFILL }},
26355
26356     {&hf_ieee80211_rsn_gmcs_80211_type,
26357      {"Group Management Cipher Suite type", "wlan.rsn.gmcs.type",
26358       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
26359       NULL, HFILL }},
26360
26361     {&hf_ieee80211_ht_pren_type,
26362      {"802.11n (Pre) Type", "wlan.vs.pren.type",
26363       FT_UINT8, BASE_DEC, VALS(ieee80211_ht_pren_type_vals), 0,
26364       "Vendor Specific HT Type", HFILL }},
26365     {&hf_ieee80211_ht_pren_unknown,
26366      {"802.11n (Pre) Unknown Data", "wlan.vs.pren.unknown_data",
26367       FT_BYTES, BASE_NONE, NULL, 0,
26368       NULL, HFILL }},
26369
26370     {&hf_ieee80211_ht_cap,
26371      {"HT Capabilities Info", "wlan.ht.capabilities",
26372       FT_UINT16, BASE_HEX, NULL, 0,
26373       "HT Capabilities information", HFILL }},
26374
26375     {&hf_ieee80211_ht_vs_cap,
26376      {"HT Capabilities Info (VS)", "wlan.vs.ht.capabilities",
26377       FT_UINT16, BASE_HEX, NULL, 0,
26378       "Vendor Specific HT Capabilities information", HFILL }},
26379
26380     {&hf_ieee80211_ht_ldpc_coding,
26381      {"HT LDPC coding capability", "wlan.ht.capabilities.ldpccoding",
26382       FT_BOOLEAN, 16, TFS(&ht_ldpc_coding_flag), 0x0001,
26383       NULL, HFILL }},
26384
26385     {&hf_ieee80211_ht_chan_width,
26386      {"HT Support channel width", "wlan.ht.capabilities.width",
26387       FT_BOOLEAN, 16, TFS(&ht_chan_width_flag), 0x0002,
26388       NULL, HFILL }},
26389
26390     {&hf_ieee80211_ht_sm_pwsave,
26391      {"HT SM Power Save", "wlan.ht.capabilities.sm",
26392       FT_UINT16, BASE_HEX, VALS(ht_sm_pwsave_flag), 0x000c,
26393       NULL, HFILL }},
26394
26395     {&hf_ieee80211_ht_green,
26396      {"HT Green Field", "wlan.ht.capabilities.green",
26397       FT_BOOLEAN, 16, TFS(&ht_green_flag), 0x0010,
26398       NULL, HFILL }},
26399
26400     {&hf_ieee80211_ht_short20,
26401      {"HT Short GI for 20MHz", "wlan.ht.capabilities.short20",
26402       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0020,
26403       NULL, HFILL }},
26404
26405     {&hf_ieee80211_ht_short40,
26406      {"HT Short GI for 40MHz", "wlan.ht.capabilities.short40",
26407       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040,
26408       NULL, HFILL }},
26409
26410     {&hf_ieee80211_ht_tx_stbc,
26411      {"HT Tx STBC", "wlan.ht.capabilities.txstbc",
26412       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080,
26413       NULL, HFILL }},
26414
26415     {&hf_ieee80211_ht_rx_stbc,
26416      {"HT Rx STBC", "wlan.ht.capabilities.rxstbc",
26417       FT_UINT16, BASE_HEX, VALS(ht_rx_stbc_flag), 0x0300,
26418       "HT Tx STBC", HFILL }},
26419
26420     {&hf_ieee80211_ht_delayed_block_ack,
26421      {"HT Delayed Block ACK", "wlan.ht.capabilities.delayedblockack",
26422       FT_BOOLEAN, 16, TFS(&ht_delayed_block_ack_flag), 0x0400,
26423       NULL, HFILL }},
26424
26425     {&hf_ieee80211_ht_max_amsdu,
26426      {"HT Max A-MSDU length", "wlan.ht.capabilities.amsdu",
26427       FT_BOOLEAN, 16, TFS(&ht_max_amsdu_flag), 0x0800,
26428       NULL, HFILL }},
26429
26430     {&hf_ieee80211_ht_dss_cck_40,
26431      {"HT DSSS/CCK mode in 40MHz", "wlan.ht.capabilities.dsscck",
26432       FT_BOOLEAN, 16, TFS(&ht_dss_cck_40_flag), 0x1000,
26433       "HT DSS/CCK mode in 40MHz", HFILL }},
26434
26435     {&hf_ieee80211_ht_psmp,
26436      {"HT PSMP Support", "wlan.ht.capabilities.psmp",
26437       FT_BOOLEAN, 16, TFS(&ht_psmp_flag), 0x2000,
26438       NULL, HFILL }},
26439
26440     {&hf_ieee80211_ht_40_mhz_intolerant,
26441      {"HT Forty MHz Intolerant", "wlan.ht.capabilities.40mhzintolerant",
26442       FT_BOOLEAN, 16, TFS(&ht_40_mhz_intolerant_flag), 0x4000,
26443       NULL, HFILL }},
26444
26445     {&hf_ieee80211_ht_l_sig,
26446      {"HT L-SIG TXOP Protection support", "wlan.ht.capabilities.lsig",
26447       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000,
26448       NULL, HFILL }},
26449
26450     {&hf_ieee80211_ext_bss_mu_mimo_capable_sta_count,
26451      {"MU-MIMO Capable STA Count", "wlan.ext_bss.mu_mimo_capable_sta_count",
26452       FT_UINT16, BASE_DEC, NULL, 0,
26453       NULL, HFILL }},
26454
26455     {&hf_ieee80211_ext_bss_ss_underutilization,
26456      {"Spatial Stream Underutilization", "wlan.ext_bss.ss_underutilization",
26457       FT_UINT8, BASE_HEX, NULL, 0,
26458       NULL, HFILL }},
26459
26460     {&hf_ieee80211_ext_bss_observable_sec_20mhz_utilization,
26461      {"Observable Secondary 20MHz Utilization", "wlan.ext_bss.observable_sec_20mhz_utilization",
26462       FT_UINT8, BASE_HEX, NULL, 0,
26463       NULL, HFILL }},
26464
26465     {&hf_ieee80211_ext_bss_observable_sec_40mhz_utilization,
26466      {"Observable Secondary 40MHz Utilization", "wlan.ext_bss.observable_sec_40mhz_utilization",
26467       FT_UINT8, BASE_HEX, NULL, 0,
26468       NULL, HFILL }},
26469
26470     {&hf_ieee80211_ext_bss_observable_sec_80mhz_utilization,
26471      {"Observable Secondary 80MHz Utilization", "wlan.ext_bss.observable_sec_80mhz_utilization",
26472       FT_UINT8, BASE_HEX, NULL, 0,
26473       NULL, HFILL }},
26474
26475     {&hf_ieee80211_wide_bw_new_channel_width,
26476      {"New Channel Width", "wlan.wide_bw.new_channel_width",
26477       FT_UINT8, BASE_HEX, VALS(vht_operation_info_channel_width), 0x0,
26478       NULL, HFILL }},
26479
26480     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment0,
26481      {"New Channel Center Frequency Segment 0", "wlan.wide_bw.new_channel_center_freq_segment0",
26482       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
26483       NULL, HFILL }},
26484
26485     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment1,
26486      {"New Channel Center Frequency Segment 1", "wlan.wide_bw.new_channel_center_freq_segment1",
26487       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
26488       NULL, HFILL }},
26489
26490     {&hf_ieee80211_operat_notification_mode,
26491      {"Operating Mode Notification", "wlan.operat_notification_mode",
26492       FT_UINT8, BASE_HEX, NULL, 0x0,
26493       NULL, HFILL }},
26494
26495     {&hf_ieee80211_operat_mode_field_channel_width,
26496      {"Channel Width", "wlan.operat_mode_field.channelwidth",
26497       FT_UINT8, BASE_HEX, VALS(operating_mode_field_channel_width), 0x03,
26498       NULL, HFILL }},
26499
26500     {&hf_ieee80211_operat_mode_field_reserved,
26501      {"Reserved", "wlan.operat_mode_field.reserved",
26502       FT_UINT8, BASE_HEX, NULL, 0x0C,
26503       NULL, HFILL }},
26504
26505     {&hf_ieee80211_operat_mode_field_rxnss,
26506      {"Rx NSS", "wlan.operat_mode_field.rxnss",
26507       FT_UINT8, BASE_HEX, VALS(operat_mode_field_rxnss), 0x70,
26508       NULL, HFILL }},
26509
26510     {&hf_ieee80211_operat_mode_field_rxnsstype,
26511      {"Rx NSS Type", "wlan.operat_mode_field.rxnsstype",
26512       FT_UINT8, BASE_HEX, NULL, 0x80,
26513       "Indicate that the Rx NSS subfield carries the maximum number of spatial streams that the STA can receive", HFILL }},
26514
26515     {&hf_ieee80211_ampduparam,
26516      {"A-MPDU Parameters", "wlan.ht.ampduparam",
26517       FT_UINT8, BASE_HEX, NULL, 0,
26518       NULL, HFILL }},
26519
26520     {&hf_ieee80211_ampduparam_vs,
26521      {"A-MPDU Parameters (VS)", "wlan.vs.ht.ampduparam",
26522       FT_UINT8, BASE_HEX, NULL, 0,
26523       "Vendor Specific A-MPDU Parameters", HFILL }},
26524
26525     {&hf_ieee80211_ampduparam_mpdu,
26526      {"Maximum Rx A-MPDU Length", "wlan.ht.ampduparam.maxlength",
26527       FT_UINT8, BASE_HEX, 0, 0x03,
26528       NULL, HFILL }},
26529
26530     {&hf_ieee80211_ampduparam_mpdu_start_spacing,
26531      {"MPDU Density", "wlan.ht.ampduparam.mpdudensity",
26532       FT_UINT8, BASE_HEX, VALS(ampduparam_mpdu_start_spacing_flags), 0x1c,
26533       NULL, HFILL }},
26534
26535     {&hf_ieee80211_ampduparam_reserved,
26536      {"Reserved", "wlan.ht.ampduparam.reserved",
26537       FT_UINT8, BASE_HEX, NULL, 0xE0,
26538       NULL, HFILL }},
26539
26540     {&hf_ieee80211_mcsset,
26541      {"Rx Supported Modulation and Coding Scheme Set", "wlan.ht.mcsset",
26542       FT_STRING, BASE_NONE, NULL, 0,
26543       NULL, HFILL }},
26544
26545     {&hf_ieee80211_mcsset_vs,
26546      {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan.vs.ht.mcsset",
26547       FT_STRING, BASE_NONE, NULL, 0,
26548       "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
26549
26550     {&hf_ieee80211_mcsset_rx_bitmask,
26551      {"Rx Modulation and Coding Scheme (One bit per modulation)", "wlan.ht.mcsset.rxbitmask",
26552       FT_NONE, BASE_NONE, NULL, 0,
26553       "One bit per modulation", HFILL }},
26554
26555     {&hf_ieee80211_mcsset_rx_bitmask_0to7,
26556      {"Rx Bitmask Bits 0-7", "wlan.ht.mcsset.rxbitmask.0to7",
26557       FT_UINT32, BASE_HEX, 0, 0x000000ff,
26558       NULL, HFILL }},
26559
26560     {&hf_ieee80211_mcsset_rx_bitmask_8to15,
26561      {"Rx Bitmask Bits 8-15", "wlan.ht.mcsset.rxbitmask.8to15",
26562       FT_UINT32, BASE_HEX, 0, 0x0000ff00,
26563       NULL, HFILL }},
26564
26565     {&hf_ieee80211_mcsset_rx_bitmask_16to23,
26566      {"Rx Bitmask Bits 16-23", "wlan.ht.mcsset.rxbitmask.16to23",
26567       FT_UINT32, BASE_HEX, 0, 0x00ff0000,
26568       NULL, HFILL }},
26569
26570     {&hf_ieee80211_mcsset_rx_bitmask_24to31,
26571      {"Rx Bitmask Bits 24-31", "wlan.ht.mcsset.rxbitmask.24to31",
26572       FT_UINT32, BASE_HEX, 0, 0xff000000,
26573       NULL, HFILL }},
26574
26575     {&hf_ieee80211_mcsset_rx_bitmask_32,
26576      {"Rx Bitmask Bit 32", "wlan.ht.mcsset.rxbitmask.32",
26577       FT_UINT32, BASE_HEX, 0, 0x000001,
26578       NULL, HFILL }},
26579
26580     {&hf_ieee80211_mcsset_rx_bitmask_33to38,
26581      {"Rx Bitmask Bits 33-38", "wlan.ht.mcsset.rxbitmask.33to38",
26582       FT_UINT32, BASE_HEX, 0, 0x00007e,
26583       NULL, HFILL }},
26584
26585     {&hf_ieee80211_mcsset_rx_bitmask_39to52,
26586      {"Rx Bitmask Bits 39-52", "wlan.ht.mcsset.rxbitmask.39to52",
26587       FT_UINT32, BASE_HEX, 0, 0x1fff80,
26588       NULL, HFILL }},
26589
26590     {&hf_ieee80211_mcsset_rx_bitmask_53to76,
26591      {"Rx Bitmask Bits 53-76", "wlan.ht.mcsset.rxbitmask.53to76",
26592       FT_UINT32, BASE_HEX, 0, 0x1fffffe0,
26593       NULL, HFILL }},
26594
26595     {&hf_ieee80211_mcsset_highest_data_rate,
26596      {"Highest Supported Data Rate", "wlan.ht.mcsset.highestdatarate",
26597       FT_UINT16, BASE_HEX, 0, 0x03ff,
26598       NULL, HFILL }},
26599
26600     {&hf_ieee80211_mcsset_tx_mcs_set_defined,
26601      {"Tx Supported MCS Set", "wlan.ht.mcsset.txsetdefined",
26602       FT_BOOLEAN, 16, TFS(&tfs_defined_not_defined), 0x0001,
26603       NULL, HFILL }},
26604
26605     {&hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal,
26606      {"Tx and Rx MCS Set", "wlan.ht.mcsset.txrxmcsnotequal",
26607       FT_BOOLEAN, 16, TFS(&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
26608       NULL, HFILL }},
26609
26610     {&hf_ieee80211_mcsset_tx_max_spatial_streams,
26611      {"Maximum Number of Tx Spatial Streams Supported", "wlan.ht.mcsset.txmaxss",
26612       FT_UINT16, BASE_HEX, 0 , 0x000c,
26613       NULL, HFILL }},
26614
26615     {&hf_ieee80211_mcsset_tx_unequal_modulation,
26616      {"Unequal Modulation", "wlan.ht.mcsset.txunequalmod",
26617       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0010,
26618       NULL, HFILL }},
26619
26620     {&hf_ieee80211_htex_cap,
26621      {"HT Extended Capabilities", "wlan.htex.capabilities",
26622       FT_UINT16, BASE_HEX, NULL, 0,
26623       "HT Extended Capability information", HFILL }},
26624
26625     {&hf_ieee80211_htex_vs_cap,
26626      {"HT Extended Capabilities (VS)", "wlan.vs.htex.capabilities",
26627       FT_UINT16, BASE_HEX, NULL, 0,
26628       "Vendor Specific HT Extended Capability information", HFILL }},
26629
26630     {&hf_ieee80211_htex_pco,
26631      {"Transmitter supports PCO", "wlan.htex.capabilities.pco",
26632       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
26633       NULL, HFILL }},
26634
26635     {&hf_ieee80211_htex_transtime,
26636      {"Time needed to transition between 20MHz and 40MHz", "wlan.htex.capabilities.transtime",
26637       FT_UINT16, BASE_HEX, VALS(htex_transtime_flags), 0x0006,
26638       NULL, HFILL }},
26639
26640     {&hf_ieee80211_htex_mcs,
26641      {"MCS Feedback capability", "wlan.htex.capabilities.mcs",
26642       FT_UINT16, BASE_HEX, VALS(htex_mcs_flags), 0x0300,
26643       NULL, HFILL }},
26644
26645     {&hf_ieee80211_htex_htc_support,
26646      {"High Throughput", "wlan.htex.capabilities.htc",
26647       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400,
26648       NULL, HFILL }},
26649
26650     {&hf_ieee80211_htex_rd_responder,
26651      {"Reverse Direction Responder", "wlan.htex.capabilities.rdresponder",
26652       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800,
26653       NULL, HFILL }},
26654
26655     {&hf_ieee80211_txbf,
26656      {"Transmit Beam Forming (TxBF) Capabilities", "wlan.txbf",
26657       FT_UINT32, BASE_HEX, NULL, 0,
26658       NULL, HFILL }},
26659
26660     {&hf_ieee80211_txbf_vs,
26661      {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan.vs.txbf",
26662       FT_UINT32, BASE_HEX, NULL, 0,
26663       "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
26664
26665     {&hf_ieee80211_txbf_cap,
26666      {"Transmit Beamforming", "wlan.txbf.txbf",
26667       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
26668       NULL, HFILL }},
26669
26670     {&hf_ieee80211_txbf_rcv_ssc,
26671      {"Receive Staggered Sounding", "wlan.txbf.rxss",
26672       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
26673       NULL, HFILL }},
26674
26675     {&hf_ieee80211_txbf_tx_ssc,
26676      {"Transmit Staggered Sounding", "wlan.txbf.txss",
26677       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
26678       NULL, HFILL }},
26679
26680     {&hf_ieee80211_txbf_rcv_ndp,
26681      {"Receive Null Data packet (NDP)", "wlan.txbf.rxndp",
26682       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
26683       NULL, HFILL }},
26684
26685     {&hf_ieee80211_txbf_tx_ndp,
26686      {"Transmit Null Data packet (NDP)", "wlan.txbf.txndp",
26687       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
26688       NULL, HFILL }},
26689
26690     {&hf_ieee80211_txbf_impl_txbf,
26691      {"Implicit TxBF capable", "wlan.txbf.impltxbf",
26692       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
26693       "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
26694
26695     {&hf_ieee80211_txbf_calib,
26696      {"Calibration", "wlan.txbf.calibration",
26697       FT_UINT32, BASE_HEX, VALS(txbf_calib_flag), 0x000000c0,
26698       NULL, HFILL }},
26699
26700     {&hf_ieee80211_txbf_expl_csi,
26701      {"STA can apply TxBF using CSI explicit feedback", "wlan.txbf.csi",
26702       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
26703       "Station can apply TxBF using CSI explicit feedback", HFILL }},
26704
26705     {&hf_ieee80211_txbf_expl_uncomp_fm,
26706      {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan.txbf.fm.uncompressed.tbf",
26707       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
26708       "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
26709
26710     {&hf_ieee80211_txbf_expl_comp_fm,
26711      {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan.txbf.fm.compressed.tbf",
26712       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
26713       "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
26714
26715     {&hf_ieee80211_txbf_expl_bf_csi,
26716      {"Receiver can return explicit CSI feedback", "wlan.txbf.rcsi",
26717       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00001800,
26718       NULL, HFILL }},
26719
26720     {&hf_ieee80211_txbf_expl_uncomp_fm_feed,
26721      {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan.txbf.fm.uncompressed.rbf",
26722       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00006000,
26723       NULL, HFILL }},
26724
26725     {&hf_ieee80211_txbf_expl_comp_fm_feed,
26726      {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan.txbf.fm.compressed.bf",
26727       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00018000,
26728       "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
26729
26730     {&hf_ieee80211_txbf_min_group,
26731      {"Minimal grouping used for explicit feedback reports", "wlan.txbf.mingroup",
26732       FT_UINT32, BASE_HEX, VALS(txbf_min_group_flags), 0x00060000,
26733       NULL, HFILL }},
26734
26735     {&hf_ieee80211_vht_cap,
26736      {"VHT Capabilities Info", "wlan.vht.capabilities",
26737       FT_UINT32, BASE_HEX, NULL, 0,
26738       "VHT Capabilities information", HFILL }},
26739
26740     {&hf_ieee80211_vht_max_mpdu_length,
26741      {"Maximum MPDU Length", "wlan.vht.capabilities.maxmpdulength",
26742       FT_UINT32, BASE_HEX, VALS(vht_max_mpdu_length_flag), 0x00000003,
26743       "In Octets unit", HFILL }},
26744
26745     {&hf_ieee80211_vht_supported_chan_width_set,
26746      {"Supported Channel Width Set", "wlan.vht.capabilities.supportedchanwidthset",
26747       FT_UINT32, BASE_HEX, VALS(vht_supported_chan_width_set_flag), 0x0000000c,
26748       NULL, HFILL }},
26749
26750     {&hf_ieee80211_vht_rx_ldpc,
26751      {"Rx LDPC", "wlan.vht.capabilities.rxldpc",
26752       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
26753       NULL, HFILL }},
26754
26755     {&hf_ieee80211_vht_short_gi_for_80,
26756      {"Short GI for 80MHz/TVHT_MODE_4C", "wlan.vht.capabilities.short80",
26757       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
26758       NULL, HFILL }},
26759
26760     {&hf_ieee80211_vht_short_gi_for_160,
26761      {"Short GI for 160MHz and 80+80MHz", "wlan.vht.capabilities.short160",
26762       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
26763       NULL, HFILL }},
26764
26765     {&hf_ieee80211_vht_tx_stbc,
26766      {"Tx STBC", "wlan.vht.capabilities.txstbc",
26767       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
26768       NULL, HFILL }},
26769
26770     {&hf_ieee80211_vht_rx_stbc,
26771      {"Rx STBC", "wlan.vht.capabilities.rxstbc",
26772       FT_UINT32, BASE_HEX, VALS(vht_rx_stbc_flag), 0x00000700,
26773       NULL, HFILL }},
26774
26775     {&hf_ieee80211_vht_su_beamformer_cap,
26776      {"SU Beamformer Capable", "wlan.vht.capabilities.subeamformer",
26777       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
26778       NULL, HFILL }},
26779
26780     {&hf_ieee80211_vht_su_beamformee_cap,
26781      {"SU Beamformee Capable", "wlan.vht.capabilities.subeamformee",
26782       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
26783       NULL, HFILL }},
26784
26785     {&hf_ieee80211_vht_beamformer_antennas,
26786      {"Beamformee STS Capability", "wlan.vht.capabilities.beamformee_sts_cap",
26787       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x0000e000,
26788       NULL, HFILL }},
26789
26790     {&hf_ieee80211_vht_sounding_dimensions,
26791      {"Number of Sounding Dimensions", "wlan.vht.capabilities.soundingdimensions",
26792       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x00070000,
26793       NULL, HFILL }},
26794
26795     {&hf_ieee80211_vht_mu_beamformer_cap,
26796      {"MU Beamformer Capable", "wlan.vht.capabilities.mubeamformer",
26797       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
26798       NULL, HFILL }},
26799
26800     {&hf_ieee80211_vht_mu_beamformee_cap,
26801      {"MU Beamformee Capable", "wlan.vht.capabilities.mubeamformee",
26802       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
26803       NULL, HFILL }},
26804
26805     {&hf_ieee80211_vht_txop_ps,
26806      {"TXOP PS", "wlan.vht.capabilities.vhttxopps",
26807       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
26808       NULL, HFILL }},
26809
26810     {&hf_ieee80211_vht_var_htc_field,
26811      {"+HTC-VHT Capable", "wlan.vht.capabilities.vhthtc",
26812       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
26813       NULL, HFILL }},
26814
26815     {&hf_ieee80211_vht_max_ampdu,
26816      {"Max A-MPDU Length Exponent", "wlan.vht.capabilities.maxampdu",
26817       FT_UINT32, BASE_HEX, VALS(vht_max_ampdu_flag), 0x03800000,
26818       "In Octets unit", HFILL }},
26819
26820     {&hf_ieee80211_vht_link_adaptation_cap,
26821      {"VHT Link Adaptation", "wlan.vht.capabilities.linkadapt",
26822       FT_UINT32, BASE_HEX, VALS(vht_link_adapt_flag), 0x0c000000,
26823       NULL, HFILL }},
26824
26825     {&hf_ieee80211_vht_rx_pattern,
26826      {"Rx Antenna Pattern Consistency", "wlan.vht.capabilities.rxpatconsist",
26827       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x10000000,
26828       NULL, HFILL }},
26829
26830     {&hf_ieee80211_vht_tx_pattern,
26831      {"Tx Antenna Pattern Consistency", "wlan.vht.capabilities.txpatconsist",
26832       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x20000000,
26833       NULL, HFILL }},
26834
26835     {&hf_ieee80211_vht_ext_nss_bw_support,
26836      {"Extended NSS BW Support", "wlan.vht.capabilities.ext_nss_bw_support",
26837       FT_UINT32, BASE_HEX, NULL, 0xc0000000,
26838       NULL, HFILL }},
26839
26840     {&hf_ieee80211_vht_mcsset,
26841      {"VHT Supported MCS Set", "wlan.vht.mcsset",
26842       FT_NONE, BASE_NONE, NULL, 0,
26843       NULL, HFILL }},
26844
26845     {&hf_ieee80211_vht_mcsset_rx_mcs_map,
26846      {"Rx MCS Map", "wlan.vht.mcsset.rxmcsmap",
26847       FT_UINT16, BASE_HEX, NULL, 0,
26848       NULL, HFILL }},
26849
26850     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
26851      {"Rx 1 SS", "wlan.vht.mcsset.rxmcsmap.ss1",
26852       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
26853       NULL, HFILL }},
26854
26855     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
26856      {"Rx 2 SS", "wlan.vht.mcsset.rxmcsmap.ss2",
26857       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
26858       NULL, HFILL }},
26859
26860     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
26861      {"Rx 3 SS", "wlan.vht.mcsset.rxmcsmap.ss3",
26862       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
26863       NULL, HFILL }},
26864
26865     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
26866      {"Rx 4 SS", "wlan.vht.mcsset.rxmcsmap.ss4",
26867       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
26868       NULL, HFILL }},
26869
26870     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
26871      {"Rx 5 SS", "wlan.vht.mcsset.rxmcsmap.ss5",
26872       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
26873       NULL, HFILL }},
26874
26875     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
26876      {"Rx 6 SS", "wlan.vht.mcsset.rxmcsmap.ss6",
26877       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
26878       NULL, HFILL }},
26879
26880     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
26881      {"Rx 7 SS", "wlan.vht.mcsset.rxmcsmap.ss7",
26882       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
26883       NULL, HFILL }},
26884
26885     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
26886      {"Rx 8 SS", "wlan.vht.mcsset.rxmcsmap.ss8",
26887       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
26888       NULL, HFILL }},
26889
26890     {&hf_ieee80211_vht_mcsset_rx_highest_long_gi,
26891      {"Rx Highest Long GI Data Rate (in Mb/s, 0 = subfield not in use)", "wlan.vht.mcsset.rxhighestlonggirate",
26892       FT_UINT16, BASE_HEX, NULL, 0x1fff,
26893       NULL, HFILL }},
26894
26895     {&hf_ieee80211_vht_mcsset_tx_mcs_map,
26896      {"Tx MCS Map", "wlan.vht.mcsset.txmcsmap",
26897       FT_UINT16, BASE_HEX, NULL, 0,
26898       NULL, HFILL }},
26899
26900     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
26901      {"Tx 1 SS", "wlan.vht.mcsset.txmcsmap.ss1",
26902       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
26903       NULL, HFILL }},
26904
26905     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
26906      {"Tx 2 SS", "wlan.vht.mcsset.txmcsmap.ss2",
26907       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
26908       NULL, HFILL }},
26909
26910     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
26911      {"Tx 3 SS", "wlan.vht.mcsset.txmcsmap.ss3",
26912       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
26913       NULL, HFILL }},
26914
26915     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
26916      {"Tx 4 SS", "wlan.vht.mcsset.txmcsmap.ss4",
26917       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
26918       NULL, HFILL }},
26919
26920     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
26921      {"Tx 5 SS", "wlan.vht.mcsset.txmcsmap.ss5",
26922       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
26923       NULL, HFILL }},
26924
26925     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
26926      {"Tx 6 SS", "wlan.vht.mcsset.txmcsmap.ss6",
26927       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
26928       NULL, HFILL }},
26929
26930     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
26931      {"Tx 7 SS", "wlan.vht.mcsset.txmcsmap.ss7",
26932       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
26933       NULL, HFILL }},
26934
26935     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
26936      {"Tx 8 SS", "wlan.vht.mcsset.txmcsmap.ss8",
26937       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
26938       NULL, HFILL }},
26939
26940     {&hf_ieee80211_vht_mcsset_tx_highest_long_gi,
26941      {"Tx Highest Long GI Data Rate  (in Mb/s, 0 = subfield not in use)", "wlan.vht.mcsset.txhighestlonggirate",
26942       FT_UINT16, BASE_HEX, NULL, 0x1fff,
26943       NULL, HFILL }},
26944
26945     {&hf_ieee80211_vht_op,
26946      {"VHT Operation Info", "wlan.vht.op",
26947       FT_NONE, BASE_NONE, NULL, 0,
26948       NULL, HFILL }},
26949
26950     {&hf_ieee80211_vht_op_channel_width,
26951      {"Channel Width", "wlan.vht.op.channelwidth",
26952       FT_UINT8, BASE_HEX, VALS(vht_op_channel_width_flag), 0,
26953       NULL, HFILL }},
26954
26955     {&hf_ieee80211_vht_op_channel_center0,
26956      {"Channel Center Segment 0", "wlan.vht.op.channelcenter0",
26957       FT_UINT8, BASE_DEC, NULL, 0,
26958       NULL, HFILL }},
26959
26960     {&hf_ieee80211_vht_op_channel_center1,
26961      {"Channel Center Segment 1", "wlan.vht.op.channelcenter1",
26962       FT_UINT8, BASE_DEC, NULL, 0,
26963       NULL, HFILL }},
26964
26965     {&hf_ieee80211_vht_op_basic_mcs_map,
26966      {"Basic MCS Map", "wlan.vht.op.basicmcsmap",
26967       FT_UINT16, BASE_HEX, NULL, 0,
26968       NULL, HFILL }},
26969
26970     {&hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
26971      {"Basic 1 SS", "wlan.vht.op.basicmcsmap.ss1",
26972       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
26973       NULL, HFILL }},
26974
26975     {&hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
26976      {"Basic 2 SS", "wlan.vht.op.basicmcsmap.ss2",
26977       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
26978       NULL, HFILL }},
26979
26980     {&hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
26981      {"Basic 3 SS", "wlan.vht.op.basicmcsmap.ss3",
26982       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
26983       NULL, HFILL }},
26984
26985     {&hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
26986      {"Basic 4 SS", "wlan.vht.op.basicmcsmap.ss4",
26987       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
26988       NULL, HFILL }},
26989
26990     {&hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
26991      {"Basic 5 SS", "wlan.vht.op.basicmcsmap.ss5",
26992       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
26993       NULL, HFILL }},
26994
26995     {&hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
26996      {"Basic 6 SS", "wlan.vht.op.basicmcsmap.ss6",
26997       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
26998       NULL, HFILL }},
26999
27000     {&hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
27001      {"Basic 7 SS", "wlan.vht.op.basicmcsmap.ss7",
27002       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
27003       NULL, HFILL }},
27004
27005     {&hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
27006      {"Basic 8 SS", "wlan.vht.op.basicmcsmap.ss8",
27007       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
27008       NULL, HFILL }},
27009
27010     {&hf_ieee80211_vht_tpe_pwr_info,
27011      {"Tx Pwr Info", "wlan.vht.tpe.pwr_info",
27012       FT_UINT8, BASE_HEX, NULL, 0,
27013       NULL, HFILL }},
27014
27015     {&hf_ieee80211_vht_tpe_pwr_info_count,
27016      {"Max Tx Pwr Count", "wlan.vht.tpe.pwr_info.count",
27017       FT_UINT8, BASE_DEC, NULL , 0x07,
27018       NULL, HFILL }},
27019
27020     {&hf_ieee80211_vht_tpe_pwr_info_unit,
27021      {"Max Tx Pwr Unit Interpretation", "wlan.vht.tpe.pwr_info.unit",
27022       FT_UINT8, BASE_DEC, VALS(vht_tpe_pwr_units) , 0x38,
27023       NULL, HFILL }},
27024
27025     {&hf_ieee80211_vht_tpe_pwr_info_reserved,
27026      {"Reserved", "wlan.vht.tpe.pwr_info.reserved",
27027       FT_UINT8, BASE_DEC, NULL , 0xC0,
27028       NULL, HFILL }},
27029
27030     {&hf_ieee80211_vht_tpe_pwr_constr_20,
27031      {"Local Max Tx Pwr Constraint 20MHz", "wlan.vht.tpe.pwr_constr_20",
27032       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
27033       NULL, HFILL }},
27034
27035     {&hf_ieee80211_vht_tpe_pwr_constr_40,
27036      {"Local Max Tx Pwr Constraint 40MHz", "wlan.vht.tpe.pwr_constr_40",
27037       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
27038       NULL, HFILL }},
27039
27040     {&hf_ieee80211_vht_tpe_pwr_constr_80,
27041      {"Local Max Tx Pwr Constraint 80MHz", "wlan.vht.tpe.pwr_constr_80",
27042       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
27043       NULL, HFILL }},
27044
27045     {&hf_ieee80211_vht_tpe_pwr_constr_160,
27046      {"Local Max Tx Pwr Constraint 160MHz/80+80 MHz", "wlan.vht.tpe.pwr_constr_160",
27047       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
27048       NULL, HFILL }},
27049
27050     {&hf_ieee80211_txbf_csi_num_bf_ant,
27051      {"Max antennae STA can support when CSI feedback required", "wlan.txbf.csinumant",
27052       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00180000,
27053       "Max antennae station can support when CSI feedback required", HFILL }},
27054
27055     {&hf_ieee80211_txbf_uncomp_sm_bf_ant,
27056      {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan.txbf.fm.uncompressed.maxant",
27057       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00600000,
27058       "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
27059
27060     {&hf_ieee80211_txbf_comp_sm_bf_ant,
27061      {"Max antennae STA can support when compressed Beamforming feedback required", "wlan.txbf.fm.compressed.maxant",
27062       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x01800000,
27063       "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
27064
27065     {&hf_ieee80211_txbf_csi_max_rows_bf,
27066      {"Maximum number of rows of CSI explicit feedback", "wlan.txbf.csi.maxrows",
27067       FT_UINT32, BASE_HEX, VALS(txbf_csi_max_rows_bf_flags), 0x06000000,
27068       NULL, HFILL }},
27069
27070     {&hf_ieee80211_txbf_chan_est,
27071      {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan.txbf.channelest",
27072       FT_UINT32, BASE_HEX, VALS(txbf_chan_est_flags), 0x18000000,
27073       NULL, HFILL }},
27074
27075     {&hf_ieee80211_txbf_resrv,
27076      {"Reserved", "wlan.txbf.reserved",
27077       FT_UINT32, BASE_HEX, NULL, 0xe0000000,
27078       NULL, HFILL }},
27079
27080     {&hf_ieee80211_hta_cc,
27081      {"HT Control Channel", "wlan.hta.control_channel",
27082       FT_UINT8, BASE_DEC, NULL, 0,
27083       NULL, HFILL }},
27084
27085     {&hf_ieee80211_hta_cap1,
27086      {"HT Additional Capabilities", "wlan.hta.capabilities",
27087       FT_UINT8, BASE_HEX, NULL, 0,
27088       "HT Additional Capability information", HFILL }},
27089
27090     {&hf_ieee80211_hta_cap2,
27091      {"HT Additional Capabilities", "wlan.hta.capabilities",
27092       FT_UINT16, BASE_HEX, NULL, 0,
27093       "HT Additional Capability information", HFILL }},
27094
27095     {&hf_ieee80211_hta_ext_chan_offset,
27096      {"Extension Channel Offset", "wlan.hta.capabilities.ext_chan_offset",
27097       FT_UINT16, BASE_HEX, VALS(hta_ext_chan_offset_flag), 0x0003,
27098       NULL, HFILL }},
27099
27100     {&hf_ieee80211_hta_rec_tx_width,
27101      {"Recommended Tx Channel Width", "wlan.hta.capabilities.rec_tx_width",
27102       FT_BOOLEAN, 16, TFS(&hta_rec_tx_width_flag), 0x0004,
27103       "Recommended Transmit Channel Width", HFILL }},
27104
27105     {&hf_ieee80211_hta_rifs_mode,
27106      {"Reduced Interframe Spacing (RIFS) Mode", "wlan.hta.capabilities.rifs_mode",
27107       FT_BOOLEAN, 16, TFS(&hta_rifs_mode_flag), 0x0008,
27108       NULL, HFILL }},
27109
27110     {&hf_ieee80211_hta_controlled_access,
27111      {"Controlled Access Only", "wlan.hta.capabilities.controlled_access",
27112       FT_BOOLEAN, 16, TFS(&hta_controlled_access_flag), 0x0010,
27113       NULL, HFILL }},
27114
27115     {&hf_ieee80211_hta_service_interval,
27116      {"Service Interval Granularity", "wlan.hta.capabilities.service_interval",
27117       FT_UINT16, BASE_HEX, VALS(hta_service_interval_flag), 0x00E0,
27118       NULL, HFILL }},
27119
27120     {&hf_ieee80211_hta_operating_mode,
27121      {"Operating Mode", "wlan.hta.capabilities.operating_mode",
27122       FT_UINT16, BASE_HEX, VALS(hta_operating_mode_flag), 0x0003,
27123       NULL, HFILL }},
27124
27125     {&hf_ieee80211_hta_non_gf_devices,
27126      {"Non Greenfield (GF) devices Present", "wlan.hta.capabilities.non_gf_devices",
27127       FT_BOOLEAN, 16, TFS(&hta_non_gf_devices_flag), 0x0004,
27128       "on Greenfield (GF) devices Present", HFILL }},
27129
27130     {&hf_ieee80211_hta_basic_stbc_mcs,
27131      {"Basic STB Modulation and Coding Scheme (MCS)", "wlan.hta.capabilities.basic_stbc_mcs",
27132       FT_UINT16, BASE_HEX, NULL , 0x007f,
27133       NULL, HFILL }},
27134
27135     {&hf_ieee80211_hta_dual_stbc_protection,
27136      {"Dual Clear To Send (CTS) Protection", "wlan.hta.capabilities.dual_stbc_protection",
27137       FT_BOOLEAN, 16, TFS(&hta_dual_stbc_protection_flag), 0x0080,
27138       NULL, HFILL }},
27139
27140     {&hf_ieee80211_hta_secondary_beacon,
27141      {"Secondary Beacon", "wlan.hta.capabilities.secondary_beacon",
27142       FT_BOOLEAN, 16, TFS(&hta_secondary_beacon_flag), 0x0100,
27143       NULL, HFILL }},
27144
27145     {&hf_ieee80211_hta_lsig_txop_protection,
27146      {"L-SIG TXOP Protection Support", "wlan.hta.capabilities.lsig_txop_protection",
27147       FT_BOOLEAN, 16, TFS(&hta_lsig_txop_protection_flag), 0x0200,
27148       NULL, HFILL }},
27149
27150     {&hf_ieee80211_hta_pco_active,
27151      {"Phased Coexistence Operation (PCO) Active", "wlan.hta.capabilities.pco_active",
27152       FT_BOOLEAN, 16, TFS(&hta_pco_active_flag), 0x0400,
27153       NULL, HFILL }},
27154
27155     {&hf_ieee80211_hta_pco_phase,
27156      {"Phased Coexistence Operation (PCO) Phase", "wlan.hta.capabilities.pco_phase",
27157       FT_BOOLEAN, 16, TFS(&hta_pco_phase_flag), 0x0800,
27158       NULL, HFILL }},
27159
27160     {&hf_ieee80211_antsel,
27161      {"Antenna Selection (ASEL) Capabilities", "wlan.asel",
27162       FT_UINT8, BASE_HEX, NULL, 0,
27163       NULL, HFILL }},
27164
27165     {&hf_ieee80211_antsel_vs,
27166      {"Antenna Selection (ASEL) Capabilities (VS)", "wlan.vs.asel",
27167       FT_UINT8, BASE_HEX, NULL, 0,
27168       "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
27169
27170     {&hf_ieee80211_antsel_b0,
27171      {"Antenna Selection Capable", "wlan.asel.capable",
27172       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
27173       NULL, HFILL }},
27174
27175     {&hf_ieee80211_antsel_b1,
27176      {"Explicit CSI Feedback Based Tx ASEL", "wlan.asel.txcsi",
27177       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
27178       NULL, HFILL }},
27179
27180     {&hf_ieee80211_antsel_b2,
27181      {"Antenna Indices Feedback Based Tx ASEL", "wlan.asel.txif",
27182       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
27183       NULL, HFILL }},
27184
27185     {&hf_ieee80211_antsel_b3,
27186      {"Explicit CSI Feedback", "wlan.asel.csi",
27187       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
27188       NULL, HFILL }},
27189
27190     {&hf_ieee80211_antsel_b4,
27191      {"Antenna Indices Feedback", "wlan.asel.if",
27192       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
27193       NULL, HFILL }},
27194
27195     {&hf_ieee80211_antsel_b5,
27196      {"Rx ASEL", "wlan.asel.rx",
27197       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
27198       NULL, HFILL }},
27199
27200     {&hf_ieee80211_antsel_b6,
27201      {"Tx Sounding PPDUs", "wlan.asel.sppdu",
27202       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
27203       NULL, HFILL }},
27204
27205     {&hf_ieee80211_antsel_b7,
27206      {"Reserved", "wlan.asel.reserved",
27207       FT_UINT8, BASE_HEX, NULL, 0x80,
27208       NULL, HFILL }},
27209
27210     {&hf_ieee80211_ht_info_delimiter1,
27211      {"HT Information Subset (1 of 3)", "wlan.ht.info.delim1",
27212       FT_UINT8, BASE_HEX, NULL, 0,
27213       NULL, HFILL }},
27214
27215     {&hf_ieee80211_ht_info_primary_channel,
27216      {"Primary Channel", "wlan.ht.info.primarychannel",
27217       FT_UINT8, BASE_DEC, NULL, 0,
27218       NULL, HFILL }},
27219
27220     {&hf_ieee80211_ht_info_secondary_channel_offset,
27221      {"Secondary channel offset", "wlan.ht.info.secchanoffset",
27222       FT_UINT8, BASE_HEX, VALS(ht_info_secondary_channel_offset_flags), 0x03,
27223       NULL, HFILL }},
27224
27225     {&hf_ieee80211_ht_info_channel_width,
27226      {"Supported channel width", "wlan.ht.info.chanwidth",
27227       FT_BOOLEAN, 8, TFS(&ht_info_channel_width_flag), 0x04,
27228       NULL, HFILL }},
27229
27230     {&hf_ieee80211_ht_info_rifs_mode,
27231      {"Reduced Interframe Spacing (RIFS)", "wlan.ht.info.rifs",
27232       FT_BOOLEAN, 8, TFS(&ht_info_rifs_mode_flag), 0x08,
27233       NULL, HFILL }},
27234
27235     {&hf_ieee80211_ht_info_psmp_stas_only,
27236      {"Power Save Multi-Poll (PSMP) stations only", "wlan.ht.info.psmponly",
27237       FT_BOOLEAN, 8, TFS(&ht_info_psmp_stas_only_flag), 0x10,
27238       NULL, HFILL }},
27239
27240     {&hf_ieee80211_ht_info_service_interval_granularity,
27241      {"Shortest service interval", "wlan.ht.info",
27242       FT_UINT8, BASE_HEX, VALS(ht_info_service_interval_granularity_flags), 0xe0,
27243       NULL, HFILL }},
27244
27245     {&hf_ieee80211_ht_info_delimiter2,
27246      {"HT Information Subset (2 of 3)", "wlan.ht.info.delim2",
27247       FT_UINT16, BASE_HEX, NULL, 0,
27248       NULL, HFILL }},
27249
27250     {&hf_ieee80211_ht_info_operating_mode,
27251      {"Operating mode of BSS", "wlan.ht.info.operatingmode",
27252       FT_UINT16, BASE_HEX, VALS(ht_info_operating_mode_flags), 0x0003,
27253       NULL, HFILL }},
27254
27255     {&hf_ieee80211_ht_info_non_greenfield_sta_present,
27256      {"Non-greenfield STAs present", "wlan.ht.info.greenfield",
27257       FT_BOOLEAN, 16, TFS(&ht_info_non_greenfield_sta_present_flag), 0x0004,
27258       NULL, HFILL }},
27259
27260     {&hf_ieee80211_ht_info_transmit_burst_limit,
27261      {"Transmit burst limit", "wlan.ht.info.burstlim",
27262       FT_BOOLEAN, 16, TFS(&ht_info_transmit_burst_limit_flag), 0x0008,
27263       NULL, HFILL }},
27264
27265     {&hf_ieee80211_ht_info_obss_non_ht_stas_present,
27266      {"OBSS non-HT STAs present", "wlan.ht.info.obssnonht",
27267       FT_BOOLEAN, 16, TFS(&ht_info_obss_non_ht_stas_present_flag), 0x0010,
27268       NULL, HFILL }},
27269
27270     {&hf_ieee80211_ht_info_reserved_1,
27271      {"Reserved", "wlan.ht.info.reserved1",
27272       FT_UINT16, BASE_HEX, NULL, 0xffe0,
27273       NULL, HFILL }},
27274
27275     {&hf_ieee80211_ht_info_delimiter3,
27276      {"HT Information Subset (3 of 3)", "wlan.ht.info.delim3",
27277       FT_UINT16, BASE_HEX, NULL, 0,
27278       NULL, HFILL }},
27279
27280     {&hf_ieee80211_ht_info_reserved_2,
27281      {"Reserved", "wlan.ht.info.reserved2",
27282       FT_UINT16, BASE_HEX, NULL, 0x003f,
27283       NULL, HFILL }},
27284
27285     {&hf_ieee80211_ht_info_dual_beacon,
27286      {"Dual beacon", "wlan.ht.info.dualbeacon",
27287       FT_BOOLEAN, 16, TFS(&ht_info_dual_beacon_flag), 0x0040,
27288       NULL, HFILL }},
27289
27290     {&hf_ieee80211_ht_info_dual_cts_protection,
27291      {"Dual Clear To Send (CTS) protection", "wlan.ht.info.dualcts",
27292       FT_BOOLEAN, 16, TFS(&ht_info_dual_cts_protection_flag), 0x0080,
27293       NULL, HFILL }},
27294
27295     {&hf_ieee80211_ht_info_secondary_beacon,
27296      {"Beacon ID", "wlan.ht.info.secondarybeacon",
27297       FT_BOOLEAN, 16, TFS(&ht_info_secondary_beacon_flag), 0x0100,
27298       NULL, HFILL }},
27299
27300     {&hf_ieee80211_ht_info_lsig_txop_protection_full_support,
27301      {"L-SIG TXOP Protection Full Support", "wlan.ht.info.lsigprotsupport",
27302       FT_BOOLEAN, 16, TFS(&ht_info_lsig_txop_protection_full_support_flag), 0x0200,
27303       NULL, HFILL }},
27304
27305     {&hf_ieee80211_ht_info_pco_active,
27306      {"Phased Coexistence Operation (PCO)", "wlan.ht.info.pco.active",
27307       FT_BOOLEAN, 16, TFS(&tfs_active_inactive), 0x0400,
27308       NULL, HFILL }},
27309
27310     {&hf_ieee80211_ht_info_pco_phase,
27311      {"Phased Coexistence Operation (PCO) Phase", "wlan.ht.info.pco.phase",
27312       FT_BOOLEAN, 16, TFS(&ht_info_pco_phase_flag), 0x0800,
27313       NULL, HFILL }},
27314
27315     {&hf_ieee80211_ht_info_reserved_3,
27316      {"Reserved", "wlan.ht.info.reserved3",
27317       FT_UINT16, BASE_HEX, NULL, 0xf000,
27318       NULL, HFILL }},
27319
27320     {&hf_ieee80211_tag_ap_channel_report_operating_class,
27321      {"Operating Class", "wlan.ap_channel_report.operating_class",
27322       FT_UINT8, BASE_DEC, NULL, 0,
27323       NULL, HFILL }},
27324
27325     {&hf_ieee80211_tag_ap_channel_report_channel_list,
27326      {"Channel List", "wlan.ap_channel_report.channel_list",
27327       FT_UINT8, BASE_DEC, NULL, 0,
27328       NULL, HFILL }},
27329
27330     {&hf_ieee80211_tag_secondary_channel_offset,
27331      {"Secondary Channel Offset", "wlan.secchanoffset",
27332       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_secondary_channel_offset_flags), 0,
27333       NULL, HFILL }},
27334
27335     {&hf_ieee80211_tag_bss_ap_avg_access_delay,
27336      {"AP Average Access Delay", "wlan.bss_ap_avg_access_delay",
27337       FT_UINT8, BASE_DEC, NULL, 0x0,
27338       NULL, HFILL }},
27339
27340     {&hf_ieee80211_tag_antenna_id,
27341      {"Antenna ID", "wlan.antenna.id",
27342       FT_UINT8, BASE_DEC, NULL, 0x0,
27343       NULL, HFILL }},
27344
27345     {&hf_ieee80211_tag_rsni,
27346      {"RSNI", "wlan.rsni",
27347       FT_UINT8, BASE_CUSTOM, CF_FUNC(rsni_base_custom), 0x0,
27348       NULL, HFILL }},
27349
27350     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
27351      {"Available Admission Capacity Bitmask", "wlan.bss_avb_adm_cap.bitmask",
27352       FT_UINT16, BASE_HEX, NULL, 0,
27353       NULL, HFILL }},
27354     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
27355      {"UP0 (bit0)", "wlan.bss_avb_adm_cap.bitmask.up0",
27356       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP0,
27357       NULL, HFILL }},
27358     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
27359      {"UP1 (bit1)", "wlan.bss_avb_adm_cap.bitmask.up1",
27360       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP1,
27361       NULL, HFILL }},
27362     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
27363      {"UP2 (bit2)", "wlan.bss_avb_adm_cap.bitmask.up2",
27364       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP2,
27365       NULL, HFILL }},
27366     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
27367      {"UP3 (bit3)", "wlan.bss_avb_adm_cap.bitmask.up3",
27368       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP3,
27369       NULL, HFILL }},
27370     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
27371      {"UP4 (bit4)", "wlan.bss_avb_adm_cap.bitmask.up4",
27372       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP4,
27373       NULL, HFILL }},
27374     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
27375      {"UP5 (bit5)", "wlan.bss_avb_adm_cap.bitmask.up5",
27376       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP5,
27377       NULL, HFILL }},
27378     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
27379      {"UP0 (bit6)", "wlan.bss_avb_adm_cap.bitmask.up6",
27380       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP6,
27381       NULL, HFILL }},
27382     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
27383      {"UP7 (bit7)", "wlan.bss_avb_adm_cap.bitmask.up7",
27384       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP7,
27385       NULL, HFILL }},
27386     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
27387      {"AC0 (bit8)", "wlan.bss_avb_adm_cap.bitmask.ac0",
27388       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC0,
27389       NULL, HFILL }},
27390     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
27391      {"AC1 (bit9)", "wlan.bss_avb_adm_cap.bitmask.AC1",
27392       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC1,
27393       NULL, HFILL }},
27394     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
27395      {"AC2 (bit10)", "wlan.bss_avb_adm_cap.bitmask.ac2",
27396       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC2,
27397       NULL, HFILL }},
27398     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
27399      {"AC3 (bit11)", "wlan.bss_avb_adm_cap.bitmask.ac3",
27400       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC3,
27401       NULL, HFILL }},
27402     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
27403      {"Reserved", "wlan.bss_avb_adm_cap.bitmask.rsv",
27404       FT_UINT16, BASE_HEX, NULL, BSS_BITMASK_RSV,
27405       NULL, HFILL }},
27406     {&hf_ieee80211_tag_bss_avb_adm_cap_up0,
27407      {"UP0", "wlan.bss_avb_adm_cap.up0",
27408       FT_UINT16, BASE_DEC, NULL, 0x0,
27409       NULL, HFILL }},
27410     {&hf_ieee80211_tag_bss_avb_adm_cap_up1,
27411      {"UP1", "wlan.bss_avb_adm_cap.up1",
27412       FT_UINT16, BASE_DEC, NULL, 0x0,
27413       NULL, HFILL }},
27414     {&hf_ieee80211_tag_bss_avb_adm_cap_up2,
27415      {"UP2", "wlan.bss_avb_adm_cap.up2",
27416       FT_UINT16, BASE_DEC, NULL, 0x0,
27417       NULL, HFILL }},
27418     {&hf_ieee80211_tag_bss_avb_adm_cap_up3,
27419      {"UP3", "wlan.bss_avb_adm_cap.up3",
27420       FT_UINT16, BASE_DEC, NULL, 0x0,
27421       NULL, HFILL }},
27422     {&hf_ieee80211_tag_bss_avb_adm_cap_up4,
27423      {"UP4", "wlan.bss_avb_adm_cap.up4",
27424       FT_UINT16, BASE_DEC, NULL, 0x0,
27425       NULL, HFILL }},
27426     {&hf_ieee80211_tag_bss_avb_adm_cap_up5,
27427      {"UP5", "wlan.bss_avb_adm_cap.up5",
27428       FT_UINT16, BASE_DEC, NULL, 0x0,
27429       NULL, HFILL }},
27430     {&hf_ieee80211_tag_bss_avb_adm_cap_up6,
27431      {"UP6", "wlan.bss_avb_adm_cap.up6",
27432       FT_UINT16, BASE_DEC, NULL, 0x0,
27433       NULL, HFILL }},
27434     {&hf_ieee80211_tag_bss_avb_adm_cap_up7,
27435      {"UP7", "wlan.bss_avb_adm_cap.up7",
27436       FT_UINT16, BASE_DEC, NULL, 0x0,
27437       NULL, HFILL }},
27438     {&hf_ieee80211_tag_bss_avb_adm_cap_ac0,
27439      {"AC0", "wlan.bss_avb_adm_cap.ac0",
27440       FT_UINT16, BASE_DEC, NULL, 0x0,
27441       NULL, HFILL }},
27442     {&hf_ieee80211_tag_bss_avb_adm_cap_ac1,
27443      {"AC1", "wlan.bss_avb_adm_cap.ac1",
27444       FT_UINT16, BASE_DEC, NULL, 0x0,
27445       NULL, HFILL }},
27446     {&hf_ieee80211_tag_bss_avb_adm_cap_ac2,
27447      {"AC2", "wlan.bss_avb_adm_cap.ac2",
27448       FT_UINT16, BASE_DEC, NULL, 0x0,
27449       NULL, HFILL }},
27450     {&hf_ieee80211_tag_bss_avb_adm_cap_ac3,
27451      {"AC3", "wlan.bss_avb_adm_cap.ac3",
27452       FT_UINT16, BASE_DEC, NULL, 0x0,
27453       NULL, HFILL }},
27454
27455     {&hf_ieee80211_tag_bss_avg_ac_access_delay_be,
27456      {"AC Average Access Delay for Best Effort", "wlan.bss_avg_ac_access_delay.be",
27457       FT_UINT8, BASE_DEC, NULL, 0x0,
27458       NULL, HFILL }},
27459     {&hf_ieee80211_tag_bss_avg_ac_access_delay_bk,
27460      {"AC Average Access Delay for Best Background", "wlan.bss_avg_ac_access_delay.bk",
27461       FT_UINT8, BASE_DEC, NULL, 0x0,
27462       NULL, HFILL }},
27463     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vi,
27464      {"AC Average Access Delay for Video", "wlan.bss_avg_ac_access_delay_vi",
27465       FT_UINT8, BASE_DEC, NULL, 0x0,
27466       NULL, HFILL }},
27467     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vo,
27468      {"AC Average Access Delay for Voice", "wlan.bss_avg_ac_access_delay_vo",
27469       FT_UINT8, BASE_DEC, NULL, 0x0,
27470       NULL, HFILL }},
27471
27472
27473     /* 802.11-2012 Table 8-119-RM Enabled Capabilities definition */
27474     {&hf_ieee80211_tag_rm_enabled_capabilities,
27475      {"RM Capabilities", "wlan.rmcap",
27476       FT_UINT8, BASE_HEX, NULL, 0,
27477       "Signals support for radio measurements in a device", HFILL }},
27478
27479     /* RM Enabled Capability octet 1 */
27480     {&hf_ieee80211_tag_rm_enabled_capabilities_b0,
27481      {"Link Measurement", "wlan.rmcap.b0",
27482       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
27483       NULL, HFILL }},
27484     {&hf_ieee80211_tag_rm_enabled_capabilities_b1,
27485      {"Neighbor Report", "wlan.rmcap.b1",
27486       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
27487       NULL, HFILL }},
27488     {&hf_ieee80211_tag_rm_enabled_capabilities_b2,
27489      {"Parallel Measurements", "wlan.rmcap.b2",
27490       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
27491       NULL, HFILL }},
27492     {&hf_ieee80211_tag_rm_enabled_capabilities_b3,
27493      {"Repeated Measurements", "wlan.rmcap.b3",
27494       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
27495       NULL, HFILL }},
27496     {&hf_ieee80211_tag_rm_enabled_capabilities_b4,
27497      {"Beacon Passive Measurement", "wlan.rmcap.b4",
27498       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
27499       NULL, HFILL }},
27500     {&hf_ieee80211_tag_rm_enabled_capabilities_b5,
27501      {"Beacon Active Measurement", "wlan.rmcap.b5",
27502       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
27503       NULL, HFILL }},
27504     {&hf_ieee80211_tag_rm_enabled_capabilities_b6,
27505      {"Beacon Table Measurement", "wlan.rmcap.b6",
27506       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
27507       NULL, HFILL }},
27508     {&hf_ieee80211_tag_rm_enabled_capabilities_b7,
27509      {"Beacon Measurement Reporting Conditions", "wlan.rmcap.b7",
27510       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
27511       NULL, HFILL }},
27512
27513     /* RM Enabled Capability octet 2 */
27514     {&hf_ieee80211_tag_rm_enabled_capabilities_b8,
27515      {"Frame Measurement", "wlan.rmcap.b8",
27516       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
27517       NULL, HFILL }},
27518     {&hf_ieee80211_tag_rm_enabled_capabilities_b9,
27519      {"Channel Load Measurement", "wlan.rmcap.b9",
27520       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
27521       NULL, HFILL }},
27522     {&hf_ieee80211_tag_rm_enabled_capabilities_b10,
27523      {"Noise Histogram Measurement", "wlan.rmcap.b10",
27524       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
27525       NULL, HFILL }},
27526     {&hf_ieee80211_tag_rm_enabled_capabilities_b11,
27527      {"Statistics Measurement", "wlan.rmcap.b11",
27528       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
27529       NULL, HFILL }},
27530     {&hf_ieee80211_tag_rm_enabled_capabilities_b12,
27531      {"LCI Measurement", "wlan.rmcap.b12",
27532       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
27533       NULL, HFILL }},
27534     {&hf_ieee80211_tag_rm_enabled_capabilities_b13,
27535      {"LCI Azimuth capability", "wlan.rmcap.b13",
27536       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
27537       NULL, HFILL }},
27538     {&hf_ieee80211_tag_rm_enabled_capabilities_b14,
27539      {"Transmit Stream/Category Measurement", "wlan.rmcap.b14",
27540       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
27541       NULL, HFILL }},
27542     {&hf_ieee80211_tag_rm_enabled_capabilities_b15,
27543      {"Triggered Transmit Stream/Category Measurement", "wlan.rmcap.b15",
27544       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
27545       NULL, HFILL }},
27546
27547     /* RM Enabled Capability octet 3 */
27548     {&hf_ieee80211_tag_rm_enabled_capabilities_b16,
27549      {"AP Channel Report capability", "wlan.rmcap.b16",
27550       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
27551       NULL, HFILL }},
27552     {&hf_ieee80211_tag_rm_enabled_capabilities_b17,
27553      {"RM MIB capability", "wlan.rmcap.b17",
27554       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
27555       NULL, HFILL }},
27556     {&hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
27557      {"Operating Channel Max Measurement Duration", "wlan.rmcap.b18to20",
27558       FT_UINT8, BASE_DEC, NULL, 0x1C,
27559       NULL, HFILL }},
27560     {&hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
27561      {"Nonoperating Channel Max Measurement Duration", "wlan.rmcap.b21to23",
27562       FT_UINT8, BASE_DEC, NULL, 0xE0,
27563       NULL, HFILL }},
27564
27565     /* RM Enabled Capability octet 4 */
27566     {&hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
27567      {"Measurement Pilotcapability", "wlan.rmcap.b24to26",
27568       FT_UINT8, BASE_DEC, NULL, 0x07,
27569       NULL, HFILL }},
27570     {&hf_ieee80211_tag_rm_enabled_capabilities_b27,
27571      {"Measurement Pilot Transmission Information", "wlan.rmcap.b27",
27572       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
27573       NULL, HFILL }},
27574     {&hf_ieee80211_tag_rm_enabled_capabilities_b28,
27575      {"Neighbor Report TSF Offset", "wlan.rmcap.b28",
27576       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
27577       NULL, HFILL }},
27578     {&hf_ieee80211_tag_rm_enabled_capabilities_b29,
27579      {"RCPI Measurement capability", "wlan.rmcap.b29",
27580       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
27581       NULL, HFILL }},
27582     {&hf_ieee80211_tag_rm_enabled_capabilities_b30,
27583      {"RSNI Measurement capability", "wlan.rmcap.b30",
27584       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
27585       NULL, HFILL }},
27586     {&hf_ieee80211_tag_rm_enabled_capabilities_b31,
27587      {"BSS Average Access Delay capability", "wlan.rmcap.b31",
27588       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
27589       NULL, HFILL }},
27590
27591     /* RM Enabled Capability octet 5 */
27592     {&hf_ieee80211_tag_rm_enabled_capabilities_b32,
27593      {"BSS Available Admission Capacity capability", "wlan.rmcap.b32",
27594       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
27595       NULL, HFILL }},
27596     {&hf_ieee80211_tag_rm_enabled_capabilities_b33,
27597      {"Antenna capability", "wlan.rmcap.b33",
27598       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
27599       NULL, HFILL }},
27600     {&hf_ieee80211_tag_rm_enabled_capabilities_o5,
27601      {"Reserved", "wlan.rmcap.o5",
27602       FT_UINT8, BASE_HEX, NULL, 0xFC,
27603       "Must be zero", HFILL }},
27604
27605     /* 20/40 BSS Coexistence */
27606     {&hf_ieee80211_tag_20_40_bc,
27607      {"20/40 BSS Coexistence Flags", "wlan.20_40_bc",
27608       FT_UINT8, BASE_HEX, NULL, 0x0,
27609       NULL, HFILL }},
27610     {&hf_ieee80211_tag_20_40_bc_information_request,
27611      {"Information Request", "wlan.20_40_bc.information_request",
27612       FT_BOOLEAN, 8, NULL, 0x01,
27613       NULL, HFILL }},
27614     {&hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant,
27615      {"Forty MHz Intolerant", "wlan.20_40_bc.forty_mhz_intolerant",
27616       FT_BOOLEAN, 8, NULL, 0x02,
27617       NULL, HFILL }},
27618     {&hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request,
27619      {"20 MHz BSS Witdh Request", "wlan.20_40_bc.20_mhz_bss_witdh_request",
27620       FT_BOOLEAN, 8, NULL, 0x04,
27621       NULL, HFILL }},
27622     {&hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request,
27623      {"OBSS Scanning Exemption Request", "wlan.20_40_bc.obss_scanning_exemption_request",
27624       FT_BOOLEAN, 8, NULL, 0x08,
27625       NULL, HFILL }},
27626     {&hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant,
27627      {"OBSS Scanning Exemption Grant", "wlan.20_40_bc.obss_scanning_exemption_grant",
27628       FT_BOOLEAN, 8, NULL, 0x10,
27629       NULL, HFILL }},
27630     {&hf_ieee80211_tag_20_40_bc_reserved,
27631      {"Reserved", "wlan.20_40_bc.reserved",
27632       FT_UINT8, BASE_HEX, NULL, 0xE0,
27633       "Must be zero", HFILL }},
27634
27635
27636     {&hf_ieee80211_tag_power_constraint_local,
27637      {"Local Power Constraint", "wlan.powercon.local",
27638       FT_UINT8, BASE_DEC, NULL, 0,
27639       "Value that allows the mitigation requirements to be satisfied in the current channel", HFILL }},
27640
27641     {&hf_ieee80211_tag_power_capability_min,
27642      {"Minimum Transmit Power", "wlan.powercap.min",
27643       FT_UINT8, BASE_DEC_HEX, NULL, 0,
27644       "The nominal minimum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
27645
27646     {&hf_ieee80211_tag_power_capability_max,
27647      {"Maximum Transmit Power", "wlan.powercap.max",
27648       FT_UINT8, BASE_DEC_HEX, NULL, 0,
27649       "The nominal maximum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
27650
27651     {&hf_ieee80211_tag_tpc_report_trsmt_pow,
27652      {"Transmit Power", "wlan.tcprep.trsmt_pow",
27653       FT_INT8, BASE_DEC, NULL, 0,
27654       NULL, HFILL }},
27655
27656     {&hf_ieee80211_tag_tpc_report_link_mrg,
27657      {"Link Margin", "wlan.tcprep.link_mrg",
27658       FT_INT8, BASE_DEC, NULL, 0,
27659       NULL, HFILL }},
27660
27661     {&hf_ieee80211_tag_supported_channels,
27662      {"Supported Channels Set", "wlan.supchan",
27663       FT_NONE, BASE_NONE, NULL, 0,
27664       NULL, HFILL }},
27665
27666     {&hf_ieee80211_tag_supported_channels_first,
27667      {"First Supported Channel", "wlan.supchan.first",
27668       FT_UINT8, BASE_DEC, NULL, 0,
27669       NULL, HFILL }},
27670
27671     {&hf_ieee80211_tag_supported_channels_range,
27672      {"Supported Channel Range", "wlan.supchan.range",
27673       FT_UINT8, BASE_DEC, NULL, 0,
27674       NULL, HFILL }},
27675
27676     {&hf_ieee80211_csa_channel_switch_mode,
27677      {"Channel Switch Mode", "wlan.csa.channel_switch_mode",
27678       FT_UINT8, BASE_HEX, NULL, 0,
27679       "Indicates any restrictions on transmission until a channel switch", HFILL }},
27680
27681     {&hf_ieee80211_csa_new_channel_number,
27682      {"New Channel Number", "wlan.csa.new_channel_number",
27683       FT_UINT8, BASE_HEX, NULL, 0,
27684       "Set to the number of the channel to which the STA is moving", HFILL }},
27685
27686     {&hf_ieee80211_csa_channel_switch_count,
27687      {"Channel Switch Count", "wlan.csa.channel_switch.count",
27688       FT_UINT8, BASE_DEC, NULL, 0,
27689       "Set to the number of TBTTs until the STA sending the Channel Switch Announcement element switches to the new channel or shall be set to 0", HFILL }},
27690
27691     {&hf_ieee80211_mesh_channel_switch_ttl,
27692      {"Mesh Channel Switch TTL", "wlan.csa.mesh_channel_switch.ttl",
27693       FT_UINT8, BASE_DEC, NULL, 0,
27694       NULL, HFILL }},
27695
27696     {&hf_ieee80211_mesh_channel_switch_flag,
27697      {"Mesh Channel Switch Flag", "wlan.csa.mesh_channel_switch.flag",
27698       FT_UINT8, BASE_HEX, NULL, 0,
27699       NULL, HFILL }},
27700
27701     {&hf_ieee80211_mesh_chswitch_flag_txrestrict,
27702      {"CSA Tx Restrict", "wlan.csa.mesh_channel_switch.flag.txrestrict",
27703       FT_BOOLEAN, 16, TFS(&csa_txrestrict_flags), 0x0001,
27704       NULL, HFILL }},
27705
27706     {&hf_ieee80211_mesh_chswitch_flag_initiator,
27707      {"CSA Initiator", "wlan.csa.mesh_channel_switch.flag.initiator",
27708       FT_BOOLEAN, 16, TFS(&csa_initiator_flags), 0x0002,
27709       NULL, HFILL }},
27710
27711     {&hf_ieee80211_mesh_channel_switch_reason_code,
27712      {"Mesh Channel Switch Reason Code", "wlan.csa.mesh_channel_switch.reason_code",
27713       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
27714       NULL, HFILL }},
27715
27716     {&hf_ieee80211_mesh_channel_switch_precedence_value,
27717      {"Mesh Channel Switch Precedence Value", "wlan.csa.mesh_channel_switch.pre_value",
27718       FT_UINT16, BASE_DEC, NULL, 0,
27719       NULL, HFILL }},
27720
27721     {&hf_ieee80211_mesh_awake_window,
27722      {"Mesh Awake Window", "wlan.mesh.mesh_awake_window",
27723       FT_UINT16, BASE_CUSTOM, CF_FUNC(mesh_active_window_base_custom), 0,
27724       NULL, HFILL }},
27725
27726     {&hf_ieee80211_tag_measure_request_token,
27727      {"Measurement Token", "wlan.measure.req.token",
27728       FT_UINT8, BASE_HEX, NULL, 0xff,
27729       NULL, HFILL }},
27730
27731     {&hf_ieee80211_tag_measure_request_mode,
27732      {"Measurement Request Mode", "wlan.measure.req.mode",
27733       FT_UINT8, BASE_HEX, NULL, 0xff,
27734       NULL, HFILL }},
27735
27736     {&hf_ieee80211_tag_measure_request_mode_parallel,
27737      {"Parallel", "wlan.measure.req.reqmode.parallel",
27738       FT_BOOLEAN, 8, NULL, 0x01,
27739       NULL, HFILL }},
27740
27741     {&hf_ieee80211_tag_measure_request_mode_enable,
27742      {"Measurement Request Mode Field", "wlan.measure.req.reqmode.enable",
27743       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
27744       NULL, HFILL }},
27745
27746     {&hf_ieee80211_tag_measure_request_mode_request,
27747      {"Measurement Reports", "wlan.measure.req.reqmode.request",
27748       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x04,
27749       NULL, HFILL }},
27750
27751     {&hf_ieee80211_tag_measure_request_mode_report,
27752      {"Autonomous Measurement Reports", "wlan.measure.req.reqmode.report",
27753       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x08,
27754       NULL, HFILL }},
27755
27756     {&hf_ieee80211_tag_measure_request_mode_duration_mandatory,
27757      {"Duration Mandatory", "wlan.measure.req.reqmode.duration_mandatory",
27758       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x10,
27759       NULL, HFILL }},
27760
27761     {&hf_ieee80211_tag_measure_request_mode_reserved,
27762      {"Reserved", "wlan.measure.req.reqmode.reserved",
27763       FT_UINT8, BASE_HEX, NULL, 0xE0,
27764       NULL, HFILL }},
27765
27766     {&hf_ieee80211_tag_measure_request_type,
27767      {"Measurement Request Type", "wlan.measure.req.reqtype",
27768       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_type_flags_ext, 0x00,
27769       NULL, HFILL }},
27770
27771     {&hf_ieee80211_tag_measure_request_channel_number,
27772      {"Measurement Channel Number", "wlan.measure.req.channelnumber",
27773       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
27774       NULL, HFILL }},
27775
27776     {&hf_ieee80211_tag_measure_request_start_time,
27777      {"Measurement Start Time", "wlan.measure.req.starttime",
27778       FT_UINT64, BASE_HEX, NULL, 0,
27779       NULL, HFILL }},
27780
27781     {&hf_ieee80211_tag_measure_request_duration,
27782      {"Measurement Duration", "wlan.measure.req.channelnumber",
27783       FT_UINT16, BASE_HEX, NULL, 0,
27784       "in TU (1 TU = 1024 us)", HFILL }},
27785
27786     {&hf_ieee80211_tag_measure_request_operating_class,
27787      {"Operating Class", "wlan.measure.req.operatingclass",
27788       FT_UINT8, BASE_DEC, NULL, 0,
27789       NULL, HFILL }},
27790
27791     {&hf_ieee80211_tag_measure_request_randomization_interval,
27792      {"Randomization Interval", "wlan.measure.req.randint",
27793       FT_UINT16, BASE_HEX, NULL, 0,
27794       "in TU (1 TU = 1024 us)", HFILL }},
27795
27796     {&hf_ieee80211_tag_measure_request_measurement_mode,
27797      {"Measurement Mode", "wlan.measure.req.measurementmode",
27798       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_measurement_mode_flags), 0,
27799       NULL, HFILL }},
27800
27801     {&hf_ieee80211_tag_measure_request_bssid,
27802      {"BSSID", "wlan.measure.req.bssid",
27803       FT_ETHER, BASE_NONE, NULL, 0,
27804       NULL, HFILL }},
27805
27806     {&hf_ieee80211_tag_measure_request_subelement_length,
27807      {"Length", "wlan.measure.req.sub.length",
27808       FT_UINT8, BASE_DEC, NULL, 0,
27809       NULL, HFILL }},
27810
27811     {&hf_ieee80211_tag_measure_request_beacon_sub_id,
27812      {"SubElement ID", "wlan.measure.req.beacon.sub.id",
27813       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_beacon_sub_id_flags), 0,
27814       NULL, HFILL }},
27815
27816     {&hf_ieee80211_tag_measure_request_beacon_sub_ssid,
27817      {"SSID", "wlan.measure.req.beacon.sub.ssid",
27818       FT_STRING, BASE_NONE, 0, 0,
27819       NULL, HFILL }},
27820
27821     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition,
27822      {"Reporting Condition", "wlan.measure.req.beacon.sub.bri.repcond",
27823       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags), 0,
27824       NULL, HFILL }},
27825
27826     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset,
27827      {"Threshold/Offset", "wlan.measure.req.beacon.sub.bri.threshold_offset",
27828       FT_UINT8, BASE_HEX, NULL, 0,
27829       NULL, HFILL }},
27830
27831     {&hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail,
27832      {"Reporting Detail", "wlan.measure.req.beacon.sub.bri.reporting_detail",
27833       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags), 0,
27834       NULL, HFILL }},
27835
27836     {&hf_ieee80211_tag_measure_request_beacon_sub_request,
27837      {"Request", "wlan.measure.req.beacon.sub.request",
27838       FT_UINT8, BASE_DEC, 0, 0,
27839       NULL, HFILL }},
27840
27841     {&hf_ieee80211_tag_measure_request_beacon_unknown,
27842      {"Unknown Data", "wlan.measure.req.beacon.unknown",
27843       FT_BYTES, BASE_NONE, NULL, 0,
27844       "(not interpreted)", HFILL }},
27845
27846     {&hf_ieee80211_tag_measure_request_channel_load_sub_id,
27847      {"SubElement ID", "wlan.measure.req.channel_load.sub.id",
27848       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_channel_load_sub_id_vals), 0,
27849       NULL, HFILL }},
27850
27851     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition,
27852      {"Reporting Condition", "wlan.measure.req.channel_load.sub.repcond",
27853       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals), 0,
27854       NULL, HFILL }},
27855
27856     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref,
27857      {"Reference Value", "wlan.measure.req.channel_load.sub.ref",
27858       FT_UINT8, BASE_HEX, NULL, 0,
27859       NULL, HFILL }},
27860
27861
27862     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_id,
27863      {"SubElement ID", "wlan.measure.req.noise_histogram.sub.id",
27864       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_noise_histogram_sub_id_vals), 0,
27865       NULL, HFILL }},
27866
27867     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition,
27868      {"Reporting Condition", "wlan.measure.reqnoise_histogram.sub.repcond",
27869       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals), 0,
27870       NULL, HFILL }},
27871
27872     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref,
27873      {"ANPI Reference Value", "wlan.measure.req.noise_histogram.sub.anpiref",
27874       FT_UINT8, BASE_HEX, NULL, 0,
27875       NULL, HFILL }},
27876
27877
27878     {&hf_ieee80211_tag_measure_request_frame_request_type,
27879      {"Frame Request Type", "wlan.measure.req.frame_request_type",
27880       FT_UINT8, BASE_HEX, NULL, 0,
27881       NULL, HFILL }},
27882
27883     {&hf_ieee80211_tag_measure_request_mac_address,
27884      {"MAC Address", "wlan.measure.req.mac_address",
27885       FT_BYTES, BASE_NONE, NULL, 0,
27886       NULL, HFILL }},
27887
27888     {&hf_ieee80211_tag_measure_request_peer_mac_address,
27889      {"Peer MAC Address", "wlan.measure.req.peer_mac_address",
27890       FT_BYTES, BASE_NONE, NULL, 0,
27891       NULL, HFILL }},
27892
27893     {&hf_ieee80211_tag_measure_request_group_id,
27894      {"Group ID", "wlan.measure.req.groupid",
27895       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_group_id_flags_ext, 0,
27896       NULL, HFILL }},
27897
27898     {&hf_ieee80211_tag_measure_request_unknown,
27899      {"Unknown Data", "wlan.measure.req.unknown",
27900       FT_BYTES, BASE_NONE, NULL, 0,
27901       "(not interpreted)", HFILL }},
27902
27903     {&hf_ieee80211_tag_measure_report_measurement_token,
27904      {"Measurement Token", "wlan.measure.req.token",
27905       FT_UINT8, BASE_HEX, NULL, 0,
27906       NULL, HFILL }},
27907
27908     {&hf_ieee80211_tag_measure_report_mode,
27909      {"Measurement Report Mode", "wlan.measure.req.mode",
27910       FT_UINT8, BASE_HEX, NULL, 0,
27911       NULL, HFILL }},
27912
27913     {&hf_ieee80211_tag_measure_report_mode_late,
27914      {"Measurement Report Mode Field", "wlan.measure.rep.repmode.late",
27915       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
27916       NULL, HFILL }},
27917
27918     {&hf_ieee80211_tag_measure_report_mode_incapable,
27919      {"Measurement Reports", "wlan.measure.rep.repmode.incapable",
27920       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x02,
27921       NULL, HFILL }},
27922
27923     {&hf_ieee80211_tag_measure_report_mode_refused,
27924      {"Autonomous Measurement Reports", "wlan.measure.rep.repmode.refused",
27925       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x04,
27926       NULL, HFILL }},
27927
27928     {&hf_ieee80211_tag_measure_report_mode_reserved,
27929      {"Reserved", "wlan.measure.rep.repmode.reserved",
27930       FT_UINT8, BASE_HEX, NULL, 0xf8,
27931       NULL, HFILL }},
27932
27933     {&hf_ieee80211_tag_measure_report_type,
27934      {"Measurement Report Type", "wlan.measure.rep.reptype",
27935       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_report_type_flags_ext, 0x00,
27936       NULL, HFILL }},
27937
27938     {&hf_ieee80211_tag_measure_report_channel_number,
27939      {"Measurement Channel Number", "wlan.measure.rep.channelnumber",
27940       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
27941       NULL, HFILL }},
27942
27943     {&hf_ieee80211_tag_measure_report_start_time,
27944      {"Measurement Start Time", "wlan.measure.rep.starttime",
27945       FT_UINT64, BASE_HEX, NULL, 0,
27946       NULL, HFILL }},
27947
27948     {&hf_ieee80211_tag_measure_report_duration,
27949      {"Measurement Duration", "wlan.measure.rep.channelnumber",
27950       FT_UINT16, BASE_HEX, NULL, 0,
27951       NULL, HFILL }},
27952
27953     {&hf_ieee80211_tag_measure_cca_busy_fraction,
27954      {"CCA Busy Fraction", "wlan.measure.rep.ccabusy",
27955       FT_UINT8, BASE_HEX, NULL, 0,
27956       NULL, HFILL }},
27957
27958     {&hf_ieee80211_tag_measure_basic_map_field,
27959      {"Map Field", "wlan.measure.rep.mapfield",
27960       FT_UINT8, BASE_HEX, NULL, 0,
27961       NULL, HFILL }},
27962
27963     {&hf_ieee80211_tag_measure_map_field_bss,
27964      {"BSS", "wlan.measure.rep.repmode.mapfield.bss",
27965       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_map_field_bss_flag), 0x01,
27966       NULL, HFILL }},
27967
27968     {&hf_ieee80211_tag_measure_map_field_odfm,
27969      {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan.measure.rep.repmode.mapfield.bss",
27970       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x02,
27971       NULL, HFILL }},
27972
27973     {&hf_ieee80211_tag_measure_map_field_unident_signal,
27974      {"Unidentified Signal", "wlan.measure.rep.repmode.mapfield.unidentsig",
27975       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x04,
27976       NULL, HFILL }},
27977
27978     {&hf_ieee80211_tag_measure_map_field_radar,
27979      {"Radar", "wlan.measure.rep.repmode.mapfield.radar",
27980       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x08,
27981       NULL, HFILL }},
27982
27983     {&hf_ieee80211_tag_measure_map_field_unmeasured,
27984      {"Unmeasured", "wlan.measure.rep.repmode.mapfield.unmeasured",
27985       FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x10,
27986       NULL, HFILL }},
27987
27988     {&hf_ieee80211_tag_measure_map_field_reserved,
27989      {"Reserved", "wlan.measure.rep.repmode.mapfield.reserved",
27990       FT_UINT8, BASE_HEX, NULL, 0xe0,
27991       NULL, HFILL }},
27992
27993     {&hf_ieee80211_tag_measure_rpi_histogram_report,
27994      {"Receive Power Indicator (RPI) Histogram Report", "wlan.measure.rep.rpi.histogram_report",
27995       FT_BYTES, BASE_NONE, NULL, 0,
27996       NULL, HFILL }},
27997
27998     {&hf_ieee80211_tag_measure_rpi_histogram_report_0,
27999      {"RPI 0 Density", "wlan.measure.rep.rpi.rpi0density",
28000       FT_UINT8, BASE_HEX, NULL, 0,
28001       "Receive Power Indicator (RPI) 0 Density", HFILL }},
28002
28003     {&hf_ieee80211_tag_measure_rpi_histogram_report_1,
28004      {"RPI 1 Density", "wlan.measure.rep.rpi.rpi1density",
28005       FT_UINT8, BASE_HEX, NULL, 0,
28006       "Receive Power Indicator (RPI) 1 Density", HFILL }},
28007
28008     {&hf_ieee80211_tag_measure_rpi_histogram_report_2,
28009      {"RPI 2 Density", "wlan.measure.rep.rpi.rpi2density",
28010       FT_UINT8, BASE_HEX, NULL, 0,
28011       "Receive Power Indicator (RPI) 2 Density", HFILL }},
28012
28013     {&hf_ieee80211_tag_measure_rpi_histogram_report_3,
28014      {"RPI 3 Density", "wlan.measure.rep.rpi.rpi3density",
28015       FT_UINT8, BASE_HEX, NULL, 0,
28016       "Receive Power Indicator (RPI) 3 Density", HFILL }},
28017
28018     {&hf_ieee80211_tag_measure_rpi_histogram_report_4,
28019      {"RPI 4 Density", "wlan.measure.rep.rpi.rpi4density",
28020       FT_UINT8, BASE_HEX, NULL, 0,
28021       "Receive Power Indicator (RPI) 4 Density", HFILL }},
28022
28023     {&hf_ieee80211_tag_measure_rpi_histogram_report_5,
28024      {"RPI 5 Density", "wlan.measure.rep.rpi.rpi5density",
28025       FT_UINT8, BASE_HEX, NULL, 0,
28026       "Receive Power Indicator (RPI) 5 Density", HFILL }},
28027
28028     {&hf_ieee80211_tag_measure_rpi_histogram_report_6,
28029      {"RPI 6 Density", "wlan.measure.rep.rpi.rpi6density",
28030       FT_UINT8, BASE_HEX, NULL, 0,
28031       "Receive Power Indicator (RPI) 6 Density", HFILL }},
28032
28033     {&hf_ieee80211_tag_measure_rpi_histogram_report_7,
28034      {"RPI 7 Density", "wlan.measure.rep.rpi.rpi7density",
28035       FT_UINT8, BASE_HEX, NULL, 0,
28036       "Receive Power Indicator (RPI) 7 Density", HFILL }},
28037
28038     {&hf_ieee80211_tag_measure_report_operating_class,
28039      {"Operating Class", "wlan.measure.rep.operatingclass",
28040       FT_UINT8, BASE_DEC, NULL, 0,
28041       NULL, HFILL }},
28042
28043     {&hf_ieee80211_tag_measure_report_channel_load,
28044      {"Channel Load", "wlan.measure.rep.chanload",
28045       FT_UINT8, BASE_HEX, NULL, 0,
28046       NULL, HFILL }},
28047
28048     {&hf_ieee80211_tag_measure_report_frame_info,
28049      {"Reported Frame Information", "wlan.measure.rep.frameinfo",
28050       FT_UINT8, BASE_HEX, NULL, 0,
28051       NULL, HFILL }},
28052
28053     {&hf_ieee80211_tag_measure_report_frame_info_phy_type,
28054      {"Condensed PHY", "wlan.measure.rep.frameinfo.phytype",
28055       FT_UINT8, BASE_HEX, NULL, 0x7F,
28056       NULL, HFILL }},
28057
28058     {&hf_ieee80211_tag_measure_report_frame_info_frame_type,
28059      {"Reported Frame Type", "wlan.measure.rep.frameinfo.frametype",
28060       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_report_frame_info_frame_type_flag), 0x80,
28061       NULL, HFILL }},
28062
28063     {&hf_ieee80211_tag_measure_report_rcpi,
28064      {"Received Channel Power Indicator (RCPI)", "wlan.measure.rep.rcpi",
28065       FT_UINT8, BASE_HEX, NULL, 0,
28066       "in dBm", HFILL }},
28067
28068     {&hf_ieee80211_tag_measure_report_rsni,
28069      {"Received Signal to Noise Indicator (RSNI)", "wlan.measure.rep.rsni",
28070       FT_UINT8, BASE_HEX, NULL, 0,
28071       "in dB", HFILL }},
28072
28073     {&hf_ieee80211_tag_measure_report_bssid,
28074      {"BSSID Being Reported", "wlan.measure.rep.bssid",
28075       FT_ETHER, BASE_NONE, NULL, 0,
28076       NULL, HFILL }},
28077
28078     {&hf_ieee80211_tag_measure_report_ant_id,
28079      {"Antenna ID", "wlan.measure.rep.antid",
28080       FT_UINT8, BASE_HEX, NULL, 0,
28081       NULL, HFILL }},
28082
28083     {&hf_ieee80211_tag_measure_report_anpi,
28084      {"ANPI", "wlan.measure.rep.anpi",
28085       FT_UINT8, BASE_HEX, NULL, 0,
28086       NULL, HFILL }},
28087
28088     {&hf_ieee80211_tag_measure_report_ipi_density_0,
28089      {"IPI Density 0", "wlan.measure.rep.ipi_density0",
28090       FT_UINT8, BASE_HEX, NULL, 0,
28091       NULL, HFILL }},
28092
28093     {&hf_ieee80211_tag_measure_report_ipi_density_1,
28094      {"IPI Density 1", "wlan.measure.rep.ipi_density1",
28095       FT_UINT8, BASE_HEX, NULL, 0,
28096       NULL, HFILL }},
28097
28098     {&hf_ieee80211_tag_measure_report_ipi_density_2,
28099      {"IPI Density 2", "wlan.measure.rep.ipi_density2",
28100       FT_UINT8, BASE_HEX, NULL, 0,
28101       NULL, HFILL }},
28102
28103     {&hf_ieee80211_tag_measure_report_ipi_density_3,
28104      {"IPI Density 3", "wlan.measure.rep.ipi_density3",
28105       FT_UINT8, BASE_HEX, NULL, 0,
28106       NULL, HFILL }},
28107
28108     {&hf_ieee80211_tag_measure_report_ipi_density_4,
28109      {"IPI Density 4", "wlan.measure.rep.ipi_density4",
28110       FT_UINT8, BASE_HEX, NULL, 0,
28111       NULL, HFILL }},
28112
28113     {&hf_ieee80211_tag_measure_report_ipi_density_5,
28114      {"IPI Density 5", "wlan.measure.rep.ipi_density5",
28115       FT_UINT8, BASE_HEX, NULL, 0,
28116       NULL, HFILL }},
28117
28118     {&hf_ieee80211_tag_measure_report_ipi_density_6,
28119      {"IPI Density 6", "wlan.measure.rep.ipi_density6",
28120       FT_UINT8, BASE_HEX, NULL, 0,
28121       NULL, HFILL }},
28122
28123     {&hf_ieee80211_tag_measure_report_ipi_density_7,
28124      {"IPI Density 7", "wlan.measure.rep.ipi_density7",
28125       FT_UINT8, BASE_HEX, NULL, 0,
28126       NULL, HFILL }},
28127
28128     {&hf_ieee80211_tag_measure_report_ipi_density_8,
28129      {"IPI Density 8", "wlan.measure.rep.ipi_density8",
28130       FT_UINT8, BASE_HEX, NULL, 0,
28131       NULL, HFILL }},
28132
28133     {&hf_ieee80211_tag_measure_report_ipi_density_9,
28134      {"IPI Density 9", "wlan.measure.rep.ipi_density9",
28135       FT_UINT8, BASE_HEX, NULL, 0,
28136       NULL, HFILL }},
28137
28138     {&hf_ieee80211_tag_measure_report_ipi_density_10,
28139      {"IPI Density 10", "wlan.measure.rep.ipi_density10",
28140       FT_UINT8, BASE_HEX, NULL, 0,
28141       NULL, HFILL }},
28142
28143     {&hf_ieee80211_tag_measure_report_parent_tsf,
28144      {"Parent Timing Synchronization Function (TSF)", "wlan.measure.rep.parenttsf",
28145       FT_UINT32, BASE_HEX, NULL, 0,
28146       NULL, HFILL }},
28147
28148     {&hf_ieee80211_tag_measure_report_subelement_length,
28149      {"Length", "wlan.measure.req.sub.length",
28150       FT_UINT8, BASE_DEC, NULL, 0,
28151       NULL, HFILL }},
28152
28153     {&hf_ieee80211_tag_measure_report_beacon_sub_id,
28154      {"SubElement ID", "wlan.measure.req.beacon.sub.id",
28155       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_report_beacon_sub_id_vals), 0,
28156       NULL, HFILL }},
28157
28158     {&hf_ieee80211_tag_measure_report_unknown,
28159      {"Unknown Data", "wlan.measure.rep.unknown",
28160       FT_BYTES, BASE_NONE, NULL, 0,
28161       "(not interpreted)", HFILL }},
28162
28163     {&hf_ieee80211_tag_quiet_count,
28164      {"Count", "wlan.quiet.count",
28165       FT_UINT8, BASE_DEC, NULL, 0,
28166       "Set to the number of TBTTs until the beacon interval during which the next quiet interval shall start", HFILL }},
28167
28168     {&hf_ieee80211_tag_quiet_period,
28169      {"Period", "wlan.quiet.period",
28170       FT_UINT8, BASE_DEC, NULL, 0,
28171       "Set to the number of beacon intervals between the start of regularly scheduled quiet intervals", HFILL }},
28172
28173     {&hf_ieee80211_tag_quiet_duration,
28174      {"Duration", "wlan.quiet.duration",
28175       FT_UINT16, BASE_DEC, NULL, 0,
28176       "Set to the duration of the quiet interval", HFILL }},
28177
28178     {&hf_ieee80211_tag_quiet_offset,
28179      {"Offset", "wlan.quiet.offset",
28180       FT_UINT16, BASE_DEC, NULL, 0,
28181       "Set to the offset of the start of the quiet interval from the TBTT", HFILL }},
28182
28183     {&hf_ieee80211_tag_dfs_owner,
28184      {"Owner", "wlan.dfs.owner",
28185       FT_ETHER, BASE_NONE, NULL, 0,
28186       "Set to the individual IEEE MAC address of the STA that is the currently known DFS Owner in the IBSS", HFILL  }},
28187
28188     {&hf_ieee80211_tag_dfs_recovery_interval,
28189      {"Recovery Interval", "wlan.dfs.recovery_interval",
28190       FT_UINT8, BASE_DEC, NULL, 0,
28191       "Indicates the time interval that shall be used for DFS owner recovery", HFILL  }},
28192
28193     {&hf_ieee80211_tag_dfs_channel_map,
28194      {"Channel Map", "wlan.dfs.channel_map",
28195       FT_NONE, BASE_NONE, NULL, 0,
28196       NULL, HFILL  }},
28197
28198     {&hf_ieee80211_tag_dfs_channel_number,
28199      {"Channel Number", "wlan.dfs.channel_number",
28200       FT_UINT8, BASE_DEC, NULL, 0,
28201       NULL, HFILL  }},
28202
28203     {&hf_ieee80211_tag_dfs_map,
28204      {"Map", "wlan.dfs.map",
28205       FT_UINT8, BASE_HEX, NULL, 0,
28206       NULL, HFILL  }},
28207
28208     {&hf_ieee80211_tag_erp_info,
28209      {"ERP Information", "wlan.erp_info",
28210       FT_UINT8, BASE_HEX, NULL, 0,
28211       NULL, HFILL  }},
28212
28213     {&hf_ieee80211_tag_erp_info_erp_present,
28214      {"Non ERP Present", "wlan.erp_info.erp_present",
28215       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
28216       NULL, HFILL  }},
28217
28218     {&hf_ieee80211_tag_erp_info_use_protection,
28219      {"Use Protection", "wlan.erp_info.use_protection",
28220       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
28221       NULL, HFILL  }},
28222
28223     {&hf_ieee80211_tag_erp_info_barker_preamble_mode,
28224      {"Barker Preamble Mode", "wlan.erp_info.barker_preamble_mode",
28225       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
28226       NULL, HFILL  }},
28227
28228     {&hf_ieee80211_tag_erp_info_reserved,
28229      {"Reserved", "wlan.erp_info.reserved",
28230       FT_UINT8, BASE_HEX, NULL, 0xF8,
28231       NULL, HFILL  }},
28232
28233     /* IEEE Std 802.11 2016 */
28234     /* Table 9-135-Extended Capabilities field */
28235     {&hf_ieee80211_tag_extended_capabilities,
28236      {"Extended Capabilities", "wlan.extcap",
28237       FT_UINT8, BASE_HEX, NULL, 0,
28238       NULL, HFILL }},
28239
28240     /* Extended Capability octet 1 */
28241     {&hf_ieee80211_tag_extended_capabilities_b0,
28242      {"20/40 BSS Coexistence Management Support", "wlan.extcap.b0",
28243       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28244       "HT Information Exchange Support", HFILL }},
28245
28246     {&hf_ieee80211_tag_extended_capabilities_b1,
28247      {"Reserved (was On-demand beacon)", "wlan.extcap.b1",
28248       FT_UINT8, BASE_HEX, NULL, 0x02,
28249       "Must be zero", HFILL }},
28250
28251     {&hf_ieee80211_tag_extended_capabilities_b2,
28252      {"Extended Channel Switching", "wlan.extcap.b2",
28253       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
28254       NULL, HFILL }},
28255
28256     {&hf_ieee80211_tag_extended_capabilities_b3,
28257      {"Reserved (was WAVE indication)", "wlan.extcap.b3",
28258       FT_UINT8, BASE_HEX, NULL, 0x08,
28259       "Must be zero", HFILL }},
28260
28261     {&hf_ieee80211_tag_extended_capabilities_b4,
28262      {"PSMP Capability", "wlan.extcap.b4",
28263       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
28264       NULL, HFILL }},
28265
28266     {&hf_ieee80211_tag_extended_capabilities_b5,
28267      {"Reserved", "wlan.extcap.b5",
28268       FT_UINT8, BASE_HEX, NULL, 0x20,
28269       "Must be zero", HFILL }},
28270
28271     {&hf_ieee80211_tag_extended_capabilities_b6,
28272      {"S-PSMP Support", "wlan.extcap.b6",
28273       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28274       NULL, HFILL }},
28275
28276     {&hf_ieee80211_tag_extended_capabilities_b7,
28277      {"Event", "wlan.extcap.b7",
28278       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
28279       NULL, HFILL }},
28280
28281
28282     /* Extended Capability octet 2 */
28283     {&hf_ieee80211_tag_extended_capabilities_b8,
28284      {"Diagnostics", "wlan.extcap.b8",
28285       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28286       NULL, HFILL }},
28287
28288     {&hf_ieee80211_tag_extended_capabilities_b9,
28289      {"Multicast Diagnostics", "wlan.extcap.b9",
28290       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
28291       NULL, HFILL }},
28292
28293     {&hf_ieee80211_tag_extended_capabilities_b10,
28294      {"Location Tracking", "wlan.extcap.b10",
28295       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
28296       NULL, HFILL }},
28297
28298     {&hf_ieee80211_tag_extended_capabilities_b11,
28299      {"FMS", "wlan.extcap.b11",
28300       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
28301       NULL, HFILL }},
28302
28303     {&hf_ieee80211_tag_extended_capabilities_b12,
28304      {"Proxy ARP Service", "wlan.extcap.b12",
28305       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
28306       NULL, HFILL }},
28307
28308     {&hf_ieee80211_tag_extended_capabilities_b13,
28309      {"Collocated Interference Reporting", "wlan.extcap.b13",
28310       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
28311       NULL, HFILL }},
28312
28313     {&hf_ieee80211_tag_extended_capabilities_b14,
28314      {"Civic Location", "wlan.extcap.b14",
28315       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28316       NULL, HFILL }},
28317
28318     {&hf_ieee80211_tag_extended_capabilities_b15,
28319      {"Geospatial Location", "wlan.extcap.b15",
28320       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
28321       NULL, HFILL }},
28322
28323
28324     /* Extended Capability octet 3 */
28325     {&hf_ieee80211_tag_extended_capabilities_b16,
28326      {"TFS", "wlan.extcap.b16",
28327       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28328       NULL, HFILL }},
28329
28330     {&hf_ieee80211_tag_extended_capabilities_b17,
28331      {"WNM Sleep Mode", "wlan.extcap.b17",
28332       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
28333       NULL, HFILL }},
28334
28335     {&hf_ieee80211_tag_extended_capabilities_b18,
28336      {"TIM Broadcast", "wlan.extcap.b18",
28337       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
28338       NULL, HFILL }},
28339
28340     {&hf_ieee80211_tag_extended_capabilities_b19,
28341      {"BSS Transition", "wlan.extcap.b19",
28342       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
28343       NULL, HFILL }},
28344
28345     {&hf_ieee80211_tag_extended_capabilities_b20,
28346      {"QoS Traffic Capability", "wlan.extcap.b20",
28347       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
28348       NULL, HFILL }},
28349
28350     {&hf_ieee80211_tag_extended_capabilities_b21,
28351      {"AC Station Count", "wlan.extcap.b21",
28352       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
28353       NULL, HFILL }},
28354
28355     {&hf_ieee80211_tag_extended_capabilities_b22,
28356      {"Multiple BSSID", "wlan.extcap.b22",
28357       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28358       NULL, HFILL }},
28359
28360     {&hf_ieee80211_tag_extended_capabilities_b23,
28361      {"Timing Measurement", "wlan.extcap.b23",
28362       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
28363       NULL, HFILL }},
28364
28365
28366     /* Extended Capability octet 4 */
28367     {&hf_ieee80211_tag_extended_capabilities_b24,
28368      {"Channel Usage", "wlan.extcap.b24",
28369       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28370       NULL, HFILL }},
28371
28372     {&hf_ieee80211_tag_extended_capabilities_b25,
28373      {"SSID List", "wlan.extcap.b25",
28374       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
28375       NULL, HFILL }},
28376
28377     {&hf_ieee80211_tag_extended_capabilities_b26,
28378      {"DMS", "wlan.extcap.b26",
28379       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
28380       NULL, HFILL }},
28381
28382     {&hf_ieee80211_tag_extended_capabilities_b27,
28383      {"UTC TSF Offset", "wlan.extcap.b27",
28384       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
28385       NULL, HFILL }},
28386
28387     {&hf_ieee80211_tag_extended_capabilities_b28,
28388      {"TPU Buffer STA Support", "wlan.extcap.b28",
28389       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
28390       NULL, HFILL }},
28391
28392     {&hf_ieee80211_tag_extended_capabilities_b29,
28393      {"TDLS Peer PSM Support", "wlan.extcap.b29",
28394       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
28395       NULL, HFILL }},
28396
28397     {&hf_ieee80211_tag_extended_capabilities_b30,
28398      {"TDLS channel switching", "wlan.extcap.b30",
28399       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28400       NULL, HFILL }},
28401
28402     {&hf_ieee80211_tag_extended_capabilities_b31,
28403      {"Interworking", "wlan.extcap.b31",
28404       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
28405       NULL, HFILL }},
28406
28407
28408     /* Extended Capability octet 5 */
28409     {&hf_ieee80211_tag_extended_capabilities_b32,
28410      {"QoS Map", "wlan.extcap.b32",
28411       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28412       NULL, HFILL }},
28413
28414     {&hf_ieee80211_tag_extended_capabilities_b33,
28415      {"EBR", "wlan.extcap.b33",
28416       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
28417       NULL, HFILL }},
28418
28419     {&hf_ieee80211_tag_extended_capabilities_b34,
28420      {"SSPN Interface", "wlan.extcap.b34",
28421       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
28422       NULL, HFILL }},
28423
28424     {&hf_ieee80211_tag_extended_capabilities_b35,
28425      {"Reserved", "wlan.extcap.b35",
28426       FT_UINT8, BASE_HEX, NULL, 0x08,
28427       "Must be zero", HFILL }},
28428
28429     {&hf_ieee80211_tag_extended_capabilities_b36,
28430      {"MSGCF Capability", "wlan.extcap.b36",
28431       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
28432       NULL, HFILL }},
28433
28434     {&hf_ieee80211_tag_extended_capabilities_b37,
28435      {"TDLS Support", "wlan.extcap.b37",
28436       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
28437       NULL, HFILL }},
28438
28439     {&hf_ieee80211_tag_extended_capabilities_b38,
28440      {"TDLS Prohibited", "wlan.extcap.b38",
28441       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28442       NULL, HFILL }},
28443
28444     {&hf_ieee80211_tag_extended_capabilities_b39,
28445      {"TDLS Channel Switching Prohibited", "wlan.extcap.b39",
28446       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
28447       NULL, HFILL }},
28448
28449     /* Extended Capability octet 6 */
28450     {&hf_ieee80211_tag_extended_capabilities_b40,
28451      {"Reject Unadmitted Frame", "wlan.extcap.b40",
28452       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28453       NULL, HFILL }},
28454
28455     {&hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
28456      {"Service Interval Granularity",
28457       "wlan.extcap.serv_int_granularity",
28458       FT_UINT8, BASE_DEC, VALS(service_interval_granularity_vals), 0x0e,
28459       NULL, HFILL }},
28460
28461     {&hf_ieee80211_tag_extended_capabilities_b44,
28462      {"Identifier Location", "wlan.extcap.b44",
28463       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
28464       NULL, HFILL }},
28465
28466     {&hf_ieee80211_tag_extended_capabilities_b45,
28467      {"U-APSD Coexistence", "wlan.extcap.b45",
28468       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
28469       NULL, HFILL }},
28470
28471     {&hf_ieee80211_tag_extended_capabilities_b46,
28472      {"WNM Notification", "wlan.extcap.b46",
28473       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28474       NULL, HFILL }},
28475
28476     {&hf_ieee80211_tag_extended_capabilities_b47,
28477      {"QAB Capability", "wlan.extcap.b47",
28478       FT_UINT8, BASE_HEX, NULL, 0x80,
28479       "AP supports QAB", HFILL }},
28480
28481     /* Extended Capability octet 7 */
28482     {&hf_ieee80211_tag_extended_capabilities_b48,
28483      {"UTF-8 SSID", "wlan.extcap.b48",
28484       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28485       "The SSID in this BSS is interpreted using UTF-8 encoding", HFILL }},
28486
28487     {&hf_ieee80211_tag_extended_capabilities_b49,
28488      {"QMFActivated", "wlan.extcap.b49",
28489       FT_BOOLEAN, 8, NULL, 0x02,
28490       NULL, HFILL }},
28491
28492     {&hf_ieee80211_tag_extended_capabilities_b50,
28493      {"QMFReconfigurationActivated", "wlan.extcap.b50",
28494       FT_BOOLEAN, 8, NULL, 0x04,
28495       NULL, HFILL }},
28496
28497     {&hf_ieee80211_tag_extended_capabilities_b51,
28498      {"Robust AV Streaming", "wlan.extcap.b51",
28499       FT_BOOLEAN, 8, NULL, 0x08,
28500       NULL, HFILL }},
28501
28502     {&hf_ieee80211_tag_extended_capabilities_b52,
28503      {"Advanced GCR", "wlan.extcap.b52",
28504       FT_BOOLEAN, 8, NULL, 0x10,
28505       NULL, HFILL }},
28506
28507     {&hf_ieee80211_tag_extended_capabilities_b53,
28508      {"Mesh GCR", "wlan.extcap.b53",
28509       FT_BOOLEAN, 8, NULL, 0x20,
28510       NULL, HFILL }},
28511
28512     {&hf_ieee80211_tag_extended_capabilities_b54,
28513      {"SCS", "wlan.extcap.b54",
28514       FT_BOOLEAN, 8, NULL, 0x40,
28515       NULL, HFILL }},
28516
28517     {&hf_ieee80211_tag_extended_capabilities_b55,
28518      {"QLoad Report", "wlan.extcap.b55",
28519       FT_BOOLEAN, 8, NULL, 0x80,
28520       NULL, HFILL }},
28521
28522     /* Extended Capability octet 8 */
28523     {&hf_ieee80211_tag_extended_capabilities_b56,
28524      {"Alternate EDCA", "wlan.extcap.b56",
28525       FT_BOOLEAN, 8, NULL, 0x01,
28526       NULL, HFILL }},
28527
28528     {&hf_ieee80211_tag_extended_capabilities_b57,
28529      {"Unprotected TXOP Negotiation", "wlan.extcap.b57",
28530       FT_BOOLEAN, 8, NULL, 0x02,
28531       NULL, HFILL }},
28532
28533     {&hf_ieee80211_tag_extended_capabilities_b58,
28534      {"Protected TXOP Negotiation", "wlan.extcap.b58",
28535       FT_BOOLEAN, 8, NULL, 0x04,
28536       NULL, HFILL }},
28537
28538     {&hf_ieee80211_tag_extended_capabilities_b59,
28539      {"Reserved", "wlan.extcap.b59",
28540       FT_UINT8, BASE_HEX, NULL, 0x08,
28541       NULL, HFILL }},
28542
28543     {&hf_ieee80211_tag_extended_capabilities_b60,
28544      {"Protected QLoad Report", "wlan.extcap.b61",
28545       FT_BOOLEAN, 8, NULL, 0x10,
28546       NULL, HFILL }},
28547
28548     {&hf_ieee80211_tag_extended_capabilities_b61,
28549      {"TDLS Wider Bandwidth", "wlan.extcap.b61",
28550       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
28551       NULL, HFILL }},
28552
28553     {&hf_ieee80211_tag_extended_capabilities_b62,
28554      {"Operating Mode Notification", "wlan.extcap.b62",
28555       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28556       NULL, HFILL }},
28557
28558     {&hf_ieee80211_tag_extended_capabilities_b63,
28559      {"Max Number Of MSDUs In A-MSDU", "wlan.extcap.b63",
28560       FT_UINT8, BASE_DEC, NULL, 0x80,
28561       "Part 1 (bit63)", HFILL }},
28562
28563     /* Extended Capability octets 8 & 9 */
28564     {&hf_ieee80211_tag_extended_capabilities_2,
28565      {"Extended Capabilities", "wlan.extcap",
28566       FT_UINT16, BASE_HEX, NULL, 0,
28567       NULL, HFILL }},
28568
28569     {&hf_ieee80211_tag_extended_capabilities_b56_2,
28570      {"Alternate EDCA", "wlan.extcap.b56",
28571       FT_BOOLEAN, 16, NULL, 0x01,
28572       NULL, HFILL }},
28573
28574     {&hf_ieee80211_tag_extended_capabilities_b57_2,
28575      {"Unprotected TXOP Negotiation", "wlan.extcap.b57",
28576       FT_BOOLEAN, 16, NULL, 0x02,
28577       NULL, HFILL }},
28578
28579     {&hf_ieee80211_tag_extended_capabilities_b58_2,
28580      {"Protected TXOP Negotiation", "wlan.extcap.b58",
28581       FT_BOOLEAN, 16, NULL, 0x04,
28582       NULL, HFILL }},
28583
28584     {&hf_ieee80211_tag_extended_capabilities_b59_2,
28585      {"Reserved", "wlan.extcap.b59",
28586       FT_UINT16, BASE_HEX, NULL, 0x08,
28587       NULL, HFILL }},
28588
28589     {&hf_ieee80211_tag_extended_capabilities_b60_2,
28590      {"Protected QLoad Report", "wlan.extcap.b61",
28591       FT_BOOLEAN, 16, NULL, 0x10,
28592       NULL, HFILL }},
28593
28594     {&hf_ieee80211_tag_extended_capabilities_b61_2,
28595      {"TDLS Wider Bandwidth", "wlan.extcap.b61",
28596       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x20,
28597       NULL, HFILL }},
28598
28599     {&hf_ieee80211_tag_extended_capabilities_b62_2,
28600      {"Operating Mode Notification", "wlan.extcap.b62",
28601       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x40,
28602       NULL, HFILL }},
28603
28604     {&hf_ieee80211_tag_extended_capabilities_max_num_msdus,
28605      {"Max Number Of MSDUs In A-MSDU", "wlan.extcap.b63",
28606       FT_UINT16, BASE_DEC, VALS(vht_max_mpdu_in_amsdu), 0x0180,
28607       NULL, HFILL }},
28608
28609     {&hf_ieee80211_tag_extended_capabilities_b65_2,
28610      {"Channel Schedule Management", "wlan.extcap.b65",
28611       FT_BOOLEAN, 16, NULL, 0x0200,
28612       NULL, HFILL }},
28613
28614     {&hf_ieee80211_tag_extended_capabilities_b66_2,
28615      {"Geodatabase Inband Enabling Signal", "wlan.extcap.b66",
28616       FT_BOOLEAN, 16, NULL, 0x0400,
28617       NULL, HFILL }},
28618
28619     {&hf_ieee80211_tag_extended_capabilities_b67_2,
28620      {"Network Channel Control", "wlan.extcap.b67",
28621       FT_BOOLEAN, 16, NULL, 0x0800,
28622       NULL, HFILL }},
28623
28624     {&hf_ieee80211_tag_extended_capabilities_b68_2,
28625      {"White Space Map", "wlan.extcap.b68",
28626       FT_BOOLEAN, 16, NULL, 0x1000,
28627       NULL, HFILL }},
28628
28629     {&hf_ieee80211_tag_extended_capabilities_b69_2,
28630      {"Channel Availability Query", "wlan.extcap.b69",
28631       FT_BOOLEAN, 16, NULL, 0x2000,
28632       NULL, HFILL }},
28633
28634     {&hf_ieee80211_tag_extended_capabilities_b70_2,
28635      {"Fine Timing Measurement Responder", "wlan.extcap.b70",
28636       FT_BOOLEAN, 16, NULL, 0x4000,
28637       NULL, HFILL }},
28638
28639     {&hf_ieee80211_tag_extended_capabilities_b71_2,
28640      {"Fine Timing Measurement Initiator", "wlan.extcap.b71",
28641       FT_BOOLEAN, 16, NULL, 0x8000,
28642       NULL, HFILL }},
28643
28644     /* Extended Capability Octet 10 */
28645     {&hf_ieee80211_tag_extended_capabilities_b72,
28646      {"Reserved", "wlan.extcap.b72",
28647       FT_UINT8, BASE_HEX, NULL, 0x01,
28648       NULL, HFILL }},
28649
28650     {&hf_ieee80211_tag_extended_capabilities_b73,
28651      {"Extended Spectrum Management Capable", "wlan.extcap.b73",
28652       FT_BOOLEAN, 8, NULL, 0x02,
28653       NULL, HFILL }},
28654
28655     {&hf_ieee80211_tag_extended_capabilities_b74,
28656      {"Future Channel Capable", "wlan.extcap.b74",
28657       FT_BOOLEAN, 8, NULL, 0x04,
28658       NULL, HFILL }},
28659
28660     {&hf_ieee80211_tag_extended_capabilities_b75,
28661      {"Reserved", "wlan.extcap.b75",
28662       FT_UINT8, BASE_HEX, NULL, 0x08,
28663       NULL, HFILL }},
28664
28665     {&hf_ieee80211_tag_extended_capabilities_b76,
28666      {"Reserved", "wlan.extcap.b76",
28667       FT_UINT8, BASE_HEX, NULL, 0x10,
28668       NULL, HFILL }},
28669
28670     {&hf_ieee80211_tag_extended_capabilities_b77,
28671      {"TWT Requester Support", "wlan.extcap.b77",
28672       FT_BOOLEAN, 16, NULL, 0x20,
28673       NULL, HFILL }},
28674
28675     {&hf_ieee80211_tag_extended_capabilities_b78,
28676      {"TWT Responder Support", "wlan.extcap.b78",
28677       FT_BOOLEAN, 16, NULL, 0x40,
28678       NULL, HFILL }},
28679
28680     {&hf_ieee80211_tag_extended_capabilities_b79,
28681      {"OBSS Narrow Bandwidth RU in UL OFDMA Tolerance Support", "wlan.extcap.b79",
28682       FT_BOOLEAN, 16, NULL, 0x80,
28683       NULL, HFILL }},
28684
28685
28686     {&hf_ieee80211_tag_cisco_ccx1_unknown,
28687      {"Unknown", "wlan.cisco.ccx1.unknown",
28688       FT_BYTES, BASE_NONE, NULL, 0,
28689       NULL, HFILL }},
28690
28691     {&hf_ieee80211_tag_cisco_ccx1_name,
28692      {"Name", "wlan.cisco.ccx1.name",
28693       FT_STRING, BASE_NONE, NULL, 0,
28694       NULL, HFILL }},
28695
28696     {&hf_ieee80211_tag_cisco_ccx1_clients,
28697      {"Clients", "wlan.cisco.ccx1.clients",
28698       FT_UINT8, BASE_DEC, NULL, 0,
28699       NULL, HFILL }},
28700
28701     {&hf_ieee80211_tag_cisco_ccx1_unknown2,
28702      {"Unknown2", "wlan.cisco.ccx1.unknown2",
28703       FT_BYTES, BASE_NONE, NULL, 0,
28704       NULL, HFILL }},
28705
28706     {&hf_ieee80211_tag_neighbor_report_bssid,
28707      {"BSSID", "wlan.nreport.bssid",
28708       FT_ETHER, BASE_NONE, NULL, 0,
28709       NULL, HFILL }},
28710
28711     {&hf_ieee80211_tag_neighbor_report_bssid_info,
28712      {"BSSID Information", "wlan.nreport.bssid.info",
28713       FT_UINT32, BASE_HEX, NULL, 0,
28714       NULL, HFILL }},
28715
28716     {&hf_ieee80211_tag_neighbor_report_bssid_info_reachability,
28717      {"AP Reachability", "wlan.nreport.bssid.info.reachability",
28718       FT_UINT32, BASE_HEX, VALS(ieee80211_neighbor_report_bssid_info_reachability_vals), 0x00000003,
28719       "Indicates whether the AP identified by this BSSID is reachable by the STA that requested the neighbor report", HFILL }},
28720
28721     {&hf_ieee80211_tag_neighbor_report_bssid_info_security,
28722      {"Security", "wlan.nreport.bssid.info.security",
28723       FT_BOOLEAN, 32, NULL, 0x00000004,
28724       "Indicates that the AP identified by this BSSID supports the same security provisioning as used by the STA in its current association", HFILL }},
28725
28726     {&hf_ieee80211_tag_neighbor_report_bssid_info_key_scope,
28727      {"Key Scope", "wlan.nreport.bssid.info.keyscope",
28728       FT_BOOLEAN, 32, NULL, 0x00000008,
28729       "indicates the AP indicated by this BSSID has the same authenticator as the AP sending the report", HFILL }},
28730
28731     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability,
28732      {"Capability", "wlan.nreport.bssid.info.capability",
28733       FT_UINT32, BASE_HEX, NULL, 0x000003F0,
28734       "Contains selected capability information for the AP indicated by this BSSID", HFILL }},
28735
28736     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng,
28737      {"Spectrum Management", "wlan.nreport.bssid.info.capability.specmngt",
28738       FT_BOOLEAN, 32, NULL, 0x00000010,
28739       NULL, HFILL }},
28740
28741     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos,
28742      {"QoS", "wlan.nreport.bssid.info.capability.qos",
28743       FT_BOOLEAN, 32, NULL, 0x00000020,
28744       NULL, HFILL }},
28745
28746     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd,
28747      {"APSD", "wlan.nreport.bssid.info.capability.apsd",
28748       FT_BOOLEAN, 32, NULL, 0x00000040,
28749       NULL, HFILL }},
28750
28751     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt,
28752      {"Radio Measurement", "wlan.nreport.bssid.info.capability.radiomsnt",
28753       FT_BOOLEAN, 32, NULL, 0x00000080,
28754       NULL, HFILL }},
28755
28756     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback,
28757      {"Delayed Block Ack", "wlan.nreport.bssid.info.capability.dback",
28758       FT_BOOLEAN, 32, NULL, 0x000000100,
28759       NULL, HFILL }},
28760
28761     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback,
28762      {"Immediate Block Ack", "wlan.nreport.bssid.info.capability.iback",
28763       FT_BOOLEAN, 32, NULL, 0x00000200,
28764       NULL, HFILL }},
28765
28766     {&hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain,
28767      {"Mobility Domain", "wlan.nreport.bssid.info.mobilitydomain",
28768       FT_BOOLEAN, 32, NULL, 0x00000400,
28769       "", HFILL }},
28770
28771     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput,
28772      {"High Throughput Control (+HTC)", "wlan.nreport.bssid.info.hthoughput",
28773       FT_BOOLEAN, 32, NULL, 0x00000800,
28774       NULL, HFILL }},
28775
28776     {&hf_ieee80211_tag_neighbor_report_bssid_info_very_high_throughput,
28777      {"Very High Throughput (+VHT)", "wlan.nreport.bssid.info.vht",
28778       FT_BOOLEAN, 32, NULL, 0x00001000,
28779       NULL, HFILL }},
28780
28781     {&hf_ieee80211_tag_neighbor_report_bssid_info_ftm,
28782      {"Fine Timing Measurement (FTM)", "wlan.nreport.bssid.info.ftm",
28783       FT_BOOLEAN, 32, NULL, 0x00002000,
28784       NULL, HFILL }},
28785
28786     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_efficiency,
28787      {"High Efficiency (HE AP)", "wlan.nreport.bssid.info.he",
28788       FT_BOOLEAN, 32, NULL, 0x00004000,
28789       NULL, HFILL }},
28790
28791     {&hf_ieee80211_tag_neighbor_report_bssid_info_er_bss,
28792      {"Extended Range BSS", "wlan.nreport.bssid.info.er_bss",
28793       FT_BOOLEAN, 32, NULL, 0x00008000,
28794       NULL, HFILL }},
28795
28796     {&hf_ieee80211_tag_neighbor_report_bssid_info_reserved,
28797      {"Reserved", "wlan.nreport.bssid.info.reserved",
28798       FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
28799       "Must be zero", HFILL }},
28800
28801     {&hf_ieee80211_tag_neighbor_report_ope_class,
28802      {"Operating Class", "wlan.nreport.opeclass",
28803       FT_UINT8, BASE_DEC, NULL, 0,
28804       NULL, HFILL }},
28805
28806     {&hf_ieee80211_tag_neighbor_report_channel_number,
28807      {"Channel Number", "wlan.nreport.channumber",
28808       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
28809       NULL, HFILL }},
28810
28811     {&hf_ieee80211_tag_neighbor_report_phy_type,
28812      {"PHY Type", "wlan.nreport.phytype",
28813       FT_UINT8, BASE_HEX, NULL, 0,
28814       NULL, HFILL }},
28815
28816     {&hf_ieee80211_tag_neighbor_report_subelement_id,
28817      {"Subelement ID", "wlan.nreport.subelement_id",
28818       FT_UINT8, BASE_HEX, VALS(ieee80211_neighbor_report_subelement_id_vals), 0,
28819       NULL, HFILL }},
28820
28821     {&hf_ieee80211_tag_neighbor_report_subelement_length,
28822      {"Length", "wlan.nreport.subelement_length",
28823       FT_UINT8, BASE_HEX, NULL, 0,
28824       NULL, HFILL }},
28825
28826     {&hf_ieee80211_tag_neighbor_report_subelement_data,
28827      {"Subelement Data", "wlan.nreport.subelement_data",
28828       FT_BYTES, BASE_NONE, NULL, 0,
28829       NULL, HFILL }},
28830
28831     {&hf_ieee80211_tag_neighbor_report_subelement_bss_trn_can_pref,
28832      {"Preference", "wlan.nreport.subelement.bss_trn_can_pref",
28833       FT_UINT8, BASE_DEC, NULL, 0,
28834       NULL, HFILL }},
28835
28836     {&hf_ieee80211_tag_neighbor_report_subelement_bss_ter_tsf,
28837      {"BSS Termination TSF", "wlan.nreport.subelement.bss_ter_tsf",
28838       FT_UINT64, BASE_DEC, NULL, 0,
28839       NULL, HFILL }},
28840
28841     {&hf_ieee80211_tag_neighbor_report_subelement_bss_dur,
28842      {"Duration", "wlan.nreport.subelement.bss_dur",
28843       FT_UINT16, BASE_DEC, NULL, 0,
28844       NULL, HFILL }},
28845
28846     {&hf_ieee80211_tag_supported_ope_classes_current,
28847      {"Current Operating Class", "wlan.supopeclass.current",
28848       FT_UINT8, BASE_DEC, NULL, 0,
28849       NULL, HFILL }},
28850
28851     {&hf_ieee80211_tag_supported_ope_classes_alternate,
28852      {"Alternate Operating Classes", "wlan.supopeclass.alt",
28853       FT_NONE, BASE_NONE, 0x0, 0,
28854       NULL, HFILL }},
28855
28856     {&hf_ieee80211_wfa_ie_type,
28857      {"Type", "wlan.wfa.ie.type",
28858       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_type_vals), 0,
28859       NULL, HFILL }},
28860
28861     {&hf_ieee80211_wfa_ie_wpa_version,
28862      {"WPA Version", "wlan.wfa.ie.wpa.version",
28863       FT_UINT16, BASE_DEC, NULL, 0,
28864       NULL, HFILL }},
28865
28866     {&hf_ieee80211_wfa_ie_wpa_mcs,
28867      {"Multicast Cipher Suite", "wlan.wfa.ie.wpa.mcs",
28868       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_mcs_base_custom), 0,
28869       "Contains the cipher suite selector used by the BSS to protect broadcast/multicasttraffic", HFILL }},
28870
28871     {&hf_ieee80211_wfa_ie_wpa_mcs_oui,
28872      {"Multicast Cipher Suite OUI", "wlan.wfa.ie.wpa.mcs.oui",
28873       FT_UINT24, BASE_OUI, NULL, 0,
28874       NULL, HFILL }},
28875
28876     {&hf_ieee80211_wfa_ie_wpa_mcs_type,
28877      {"Multicast Cipher Suite type", "wlan.wfa.ie.wpa.mcs.type",
28878       FT_UINT8, BASE_DEC, NULL, 0,
28879       NULL, HFILL }},
28880
28881     {&hf_ieee80211_wfa_ie_wpa_mcs_wfa_type,
28882      {"Multicast Cipher Suite type", "wlan.wfa.ie.wpa.mcs.type",
28883       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
28884       NULL, HFILL }},
28885
28886     {&hf_ieee80211_wfa_ie_wpa_ucs_count,
28887      {"Unicast Cipher Suite Count", "wlan.wfa.ie.wpa.ucs.count",
28888       FT_UINT16, BASE_DEC, NULL, 0,
28889       "Indicates the number of pairwise cipher suite selectors that are contained in the Unicast Cipher Suite List", HFILL }},
28890
28891     {&hf_ieee80211_wfa_ie_wpa_ucs_list,
28892      {"Unicast Cipher Suite List", "wlan.wfa.ie.wpa.ucs.list",
28893       FT_NONE, BASE_NONE, NULL, 0,
28894       "Contains a series of cipher suite selectors that indicate the Unicast cipher suites", HFILL }},
28895
28896     {&hf_ieee80211_wfa_ie_wpa_ucs,
28897      {"Unicast Cipher Suite", "wlan.wfa.ie.wpa.ucs",
28898       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_ucs_base_custom), 0,
28899       NULL, HFILL }},
28900
28901     {&hf_ieee80211_wfa_ie_wpa_ucs_oui,
28902      {"Unicast Cipher Suite OUI", "wlan.wfa.ie.wpau.cs.oui",
28903       FT_UINT24, BASE_OUI, NULL, 0,
28904       NULL, HFILL }},
28905
28906     {&hf_ieee80211_wfa_ie_wpa_ucs_type,
28907      {"Unicast Cipher Suite type", "wlan.wfa.ie.wpa.ucs.type",
28908       FT_UINT8, BASE_DEC, NULL, 0,
28909       NULL, HFILL }},
28910
28911     {&hf_ieee80211_wfa_ie_wpa_ucs_wfa_type,
28912      {"Unicast Cipher Suite type", "wlan.wfa.ie.wpa.ucs.type",
28913       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
28914       NULL, HFILL }},
28915
28916     {&hf_ieee80211_wfa_ie_wpa_akms_count,
28917      {"Auth Key Management (AKM) Suite Count", "wlan.wfa.ie.wpa.akms.count",
28918       FT_UINT16, BASE_DEC, NULL, 0,
28919       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
28920
28921     {&hf_ieee80211_wfa_ie_wpa_akms_list,
28922      {"Auth Key Management (AKM) List", "wlan.wfa.ie.wpa.akms.list",
28923       FT_NONE, BASE_NONE, NULL, 0,
28924       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
28925
28926     {&hf_ieee80211_wfa_ie_wpa_akms,
28927      {"Auth Key Management (AKM) Suite", "wlan.wfa.ie.wpa.akms",
28928       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_akms_base_custom), 0,
28929       NULL, HFILL }},
28930
28931     {&hf_ieee80211_wfa_ie_wpa_akms_oui,
28932      {"Auth Key Management (AKM) OUI", "wlan.wfa.ie.wpa.akms.oui",
28933       FT_UINT24, BASE_OUI, NULL, 0,
28934       NULL, HFILL }},
28935
28936     {&hf_ieee80211_wfa_ie_wpa_akms_type,
28937      {"Auth Key Management (AKM) type", "wlan.wfa.ie.wpa.akms.type",
28938       FT_UINT8, BASE_DEC, NULL, 0,
28939       NULL, HFILL }},
28940
28941     {&hf_ieee80211_wfa_ie_wpa_akms_wfa_type,
28942      {"Auth Key Management (AKM) type", "wlan.wfa.ie.wpa.type",
28943       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_keymgmt_vals), 0,
28944       NULL, HFILL }},
28945
28946     {&hf_ieee80211_wfa_ie_wme_subtype,
28947      {"WME Subtype", "wlan.wfa.ie.wme.subtype",
28948       FT_UINT8, BASE_DEC, VALS(ieee802111_wfa_ie_wme_type), 0,
28949       NULL, HFILL }},
28950
28951     {&hf_ieee80211_wfa_ie_wme_version,
28952      {"WME Version", "wlan.wfa.ie.wme.version",
28953       FT_UINT8, BASE_DEC, NULL, 0,
28954       NULL, HFILL }},
28955
28956     {&hf_ieee80211_wfa_ie_wme_qos_info,
28957      {"WME QoS Info", "wlan.wfa.ie.wme.qos_info",
28958       FT_UINT8, BASE_HEX, NULL, 0,
28959       NULL, HFILL }},
28960
28961     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
28962      {"Max SP Length", "wlan.wfa.ie.wme.qos_info.sta.max_sp_length",
28963       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals), 0x60,
28964       NULL, HFILL }},
28965
28966     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
28967      {"AC_BE", "wlan.wfa.ie.wme.qos_info.sta.ac_be",
28968       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x08,
28969       NULL, HFILL }},
28970
28971     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
28972      {"AC_BK", "wlan.wfa.ie.wme.qos_info.sta.ac_bk",
28973       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x04,
28974       NULL, HFILL }},
28975
28976     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
28977      {"AC_VI", "wlan.wfa.ie.wme.qos_info.sta.ac_vi",
28978       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x02,
28979       NULL, HFILL }},
28980
28981     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
28982      {"AC_VO", "wlan.wfa.ie.wme.qos_info.sta.ac_vo",
28983       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x01,
28984       NULL, HFILL }},
28985
28986     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
28987      {"Reserved", "wlan.wfa.ie.wme.qos_info.sta.reserved",
28988       FT_UINT8, BASE_HEX, NULL, 0x90,
28989       "Must Be Zero", HFILL }},
28990
28991     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
28992      {"U-APSD", "wlan.wfa.ie.wme.qos_info.ap.u_apsd",
28993       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
28994       "Indicates the WMM AP is currently supporting unscheduled automatic power save delivery", HFILL }},
28995
28996     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
28997      {"Parameter Set Count", "wlan.wfa.ie.wme.qos_info.ap.parameter_set_count",
28998       FT_UINT8, BASE_HEX, NULL, 0x0F,
28999       NULL, HFILL }},
29000
29001     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
29002      {"Reserved", "wlan.wfa.ie.wme.qos_info.ap.reserved",
29003       FT_UINT8, BASE_HEX, NULL, 0x70,
29004       "Must Be Zero", HFILL }},
29005
29006     {&hf_ieee80211_wfa_ie_wme_reserved,
29007      {"Reserved", "wlan.wfa.ie.wme.reserved",
29008       FT_BYTES, BASE_NONE, NULL, 0,
29009       "Must Be Zero", HFILL }},
29010
29011     {&hf_ieee80211_wfa_ie_wme_ac_parameters,
29012      {"Ac Parameters", "wlan.wfa.ie.wme.acp",
29013       FT_NONE, BASE_NONE, NULL, 0,
29014       NULL, HFILL }},
29015
29016     {&hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
29017      {"ACI / AIFSN Field", "wlan.wfa.ie.wme.acp.aci_aifsn",
29018       FT_UINT8, BASE_HEX, NULL, 0,
29019       NULL, HFILL }},
29020
29021     {&hf_ieee80211_wfa_ie_wme_acp_aci,
29022      {"ACI", "wlan.wfa.ie.wme.acp.aci",
29023       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wme_acs_vals), 0x60,
29024       NULL, HFILL }},
29025
29026     {&hf_ieee80211_wfa_ie_wme_acp_acm,
29027      {"Admission Control Mandatory", "wlan.wfa.ie.wme.acp.acm",
29028       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
29029       NULL, HFILL }},
29030
29031     {&hf_ieee80211_wfa_ie_wme_acp_aifsn,
29032      {"AIFSN", "wlan.wfa.ie.wme.acp.aifsn",
29033       FT_UINT8, BASE_DEC, NULL, 0x0F,
29034       NULL, HFILL }},
29035
29036     {&hf_ieee80211_wfa_ie_wme_acp_reserved,
29037      {"Reserved", "wlan.wfa.ie.wme.acp.reserved",
29038       FT_UINT8, BASE_DEC, NULL, 0x80,
29039       "Must be Zero", HFILL }},
29040
29041     {&hf_ieee80211_wfa_ie_wme_acp_ecw,
29042      {"ECW", "wlan.wfa.ie.wme.acp.ecw",
29043       FT_UINT8, BASE_HEX, NULL, 0x00,
29044       NULL, HFILL }},
29045
29046     {&hf_ieee80211_wfa_ie_wme_acp_ecw_max,
29047      {"ECW Max", "wlan.wfa.ie.wme.acp.ecw.max",
29048       FT_UINT8, BASE_DEC, NULL, 0xF0,
29049       NULL, HFILL }},
29050
29051     {&hf_ieee80211_wfa_ie_wme_acp_ecw_min,
29052      {"ECW Min", "wlan.wfa.ie.wme.acp.ecw.min",
29053       FT_UINT8, BASE_DEC, NULL, 0x0F,
29054       NULL, HFILL }},
29055
29056     {&hf_ieee80211_wfa_ie_wme_acp_cw_max,
29057      {"CW Max", "wlan.wfa.ie.wme.acp.cw.max",
29058       FT_UINT8, BASE_DEC, NULL, 0,
29059       NULL, HFILL }},
29060
29061     {&hf_ieee80211_wfa_ie_wme_acp_cw_min,
29062      {"CW Min", "wlan.wfa.ie.wme.acp.cw.min",
29063       FT_UINT8, BASE_DEC, NULL, 0,
29064       NULL, HFILL }},
29065
29066     {&hf_ieee80211_wfa_ie_wme_acp_txop_limit,
29067      {"TXOP Limit", "wlan.wfa.ie.wme.acp.txop_limit",
29068       FT_UINT16, BASE_DEC, NULL, 0x00,
29069       NULL, HFILL }},
29070
29071     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
29072      {"TS Info", "wlan.wfa.ie.wme.tspec.ts_info",
29073       FT_UINT24, BASE_HEX, NULL, 0,
29074       "Traffic Stream (TS) Info", HFILL }},
29075
29076     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
29077      {"TID", "wlan.wfa.ie.wme.tspec.ts_info.tid",
29078       FT_UINT24, BASE_DEC, NULL, 0x00001E,
29079       "Traffic Stream Info ID (TID)", HFILL }},
29080
29081     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
29082      {"Direction", "wlan.wfa.ie.wme.tspec.ts_info.dir",
29083       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals), 0x000060,
29084       "Traffic Stream (TS) Info Direction", HFILL }},
29085
29086     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
29087      {"PSB", "wlan.wfa.ie.wme.tspec.ts_info.psb",
29088       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals), 0x000400,
29089       "Traffic Stream (TS) Info Power Save Behavior (PSB)", HFILL }},
29090
29091     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
29092      {"UP", "wlan.wfa.ie.wme.tspec.ts_info.up",
29093       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals), 0x003800,
29094       "Traffic Stream (TS) Info User Priority (UP)", HFILL }},
29095
29096     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
29097      {"Reserved", "wlan.wfa.ie.wme.tspec.ts_info.reserved",
29098       FT_UINT24, BASE_HEX, NULL, 0xFFC381,
29099       "Must be Zero", HFILL }},
29100
29101     {&hf_ieee80211_wfa_ie_wme_tspec_nor_msdu,
29102      {"Normal MSDU Size", "wlan.wfa.ie.wme.tspec.nor_msdu",
29103       FT_UINT16, BASE_DEC, NULL, 0,
29104       NULL, HFILL }},
29105
29106     {&hf_ieee80211_wfa_ie_wme_tspec_max_msdu,
29107      {"Maximum MSDU Size", "wlan.wfa.ie.wme.tspec.max_msdu",
29108       FT_UINT16, BASE_DEC, NULL, 0,
29109       NULL, HFILL }},
29110
29111     {&hf_ieee80211_wfa_ie_wme_tspec_min_srv,
29112      {"Minimum Service Interval", "wlan.wfa.ie.wme.tspec.min_srv",
29113       FT_UINT32, BASE_DEC, NULL, 0,
29114       NULL, HFILL }},
29115
29116     {&hf_ieee80211_wfa_ie_wme_tspec_max_srv,
29117      {"Maximum Service Interval", "wlan.wfa.ie.wme.tspec.max_srv",
29118       FT_UINT32, BASE_DEC, NULL, 0,
29119       NULL, HFILL }},
29120
29121     {&hf_ieee80211_wfa_ie_wme_tspec_inact_int,
29122      {"Inactivity Interval", "wlan.wfa.ie.wme.tspec.inact_int",
29123       FT_UINT32, BASE_DEC, NULL, 0,
29124       NULL, HFILL }},
29125
29126     {&hf_ieee80211_wfa_ie_wme_tspec_susp_int,
29127      {"Suspension Interval", "wlan.wfa.ie.wme.tspec.susp_int",
29128       FT_UINT32, BASE_DEC, NULL, 0,
29129       NULL, HFILL }},
29130
29131     {&hf_ieee80211_wfa_ie_wme_tspec_srv_start,
29132      {"Service Start Time", "wlan.wfa.ie.wme.tspec.srv_start",
29133       FT_UINT32, BASE_DEC, NULL, 0,
29134       NULL, HFILL }},
29135
29136     {&hf_ieee80211_wfa_ie_wme_tspec_min_data,
29137      {"Minimum Data Rate", "wlan.wfa.ie.wme.tspec.min_data",
29138       FT_UINT32, BASE_DEC, NULL, 0,
29139       NULL, HFILL }},
29140
29141     {&hf_ieee80211_wfa_ie_wme_tspec_mean_data,
29142      {"Mean Data Rate", "wlan.wfa.ie.wme.tspec.mean_data",
29143       FT_UINT32, BASE_DEC, NULL, 0,
29144       NULL, HFILL }},
29145
29146     {&hf_ieee80211_wfa_ie_wme_tspec_peak_data,
29147      {"Peak Data Rate", "wlan.wfa.ie.wme.tspec.peak_data",
29148       FT_UINT32, BASE_DEC, NULL, 0,
29149       NULL, HFILL }},
29150
29151     {&hf_ieee80211_wfa_ie_wme_tspec_burst_size,
29152      {"Burst Size", "wlan.wfa.ie.wme.tspec.burst_size",
29153       FT_UINT32, BASE_DEC, NULL, 0,
29154       NULL, HFILL }},
29155
29156     {&hf_ieee80211_wfa_ie_wme_tspec_delay_bound,
29157      {"Delay Bound", "wlan.wfa.ie.wme.tspec.delay_bound",
29158       FT_UINT32, BASE_DEC, NULL, 0,
29159       NULL, HFILL }},
29160
29161     {&hf_ieee80211_wfa_ie_wme_tspec_min_phy,
29162      {"Minimum PHY Rate", "wlan.wfa.ie.wme.tspec.min_phy",
29163       FT_UINT32, BASE_DEC, NULL, 0,
29164       NULL, HFILL }},
29165
29166     {&hf_ieee80211_wfa_ie_wme_tspec_surplus,
29167      {"Surplus Bandwidth Allowance", "wlan.wfa.ie.wme.tspec.surplus",
29168       FT_UINT16, BASE_DEC, NULL, 0,
29169       NULL, HFILL }},
29170
29171     {&hf_ieee80211_wfa_ie_wme_tspec_medium,
29172      {"Medium Time", "wlan.wfa.ie.wme.tspec.medium",
29173       FT_UINT16, BASE_DEC, NULL, 0,
29174       NULL, HFILL }},
29175
29176     {&hf_ieee80211_rsn_ie_pmkid,
29177      {"RSN PMKID", "wlan.rsn.ie.pmkid",
29178       FT_BYTES, BASE_NONE, NULL, 0,
29179       NULL, HFILL }},
29180
29181     {&hf_ieee80211_rsn_ie_unknown,
29182      {"RSN Unknown", "wlan.rsn.ie.unknown",
29183       FT_BYTES, BASE_NONE, NULL, 0,
29184       NULL, HFILL }},
29185
29186     {&hf_ieee80211_marvell_ie_type,
29187      {"Type", "wlan.marvell.ie.type",
29188       FT_UINT8, BASE_HEX, NULL, 0,
29189       NULL, HFILL }},
29190
29191     {&hf_ieee80211_marvell_ie_mesh_subtype,
29192      {"Subtype", "wlan.marvell.ie.subtype",
29193       FT_UINT8, BASE_HEX, NULL, 0,
29194       NULL, HFILL }},
29195
29196     {&hf_ieee80211_marvell_ie_mesh_version,
29197      {"Version", "wlan.marvell.ie.version",
29198       FT_UINT8, BASE_HEX, NULL, 0,
29199       NULL, HFILL }},
29200
29201     {&hf_ieee80211_marvell_ie_mesh_active_proto_id,
29202      {"Path Selection Protocol", "wlan.marvell.ie.proto_id",
29203       FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0,
29204       NULL, HFILL }},
29205
29206     {&hf_ieee80211_marvell_ie_mesh_active_metric_id,
29207      {"Path Selection Metric", "wlan.marvell.ie.metric_id",
29208       FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0,
29209       NULL, HFILL }},
29210
29211     {&hf_ieee80211_marvell_ie_mesh_cap,
29212      {"Mesh Capabilities", "wlan.marvell.ie.cap",
29213       FT_UINT8, BASE_HEX, NULL, 0,
29214       NULL, HFILL }},
29215
29216     {&hf_ieee80211_marvell_ie_data,
29217      { "Marvell IE data", "wlan.marvell.data",
29218        FT_BYTES, BASE_NONE, NULL, 0x0,
29219        NULL, HFILL }},
29220
29221     {&hf_ieee80211_atheros_ie_type,
29222      {"Type", "wlan.atheros.ie.type",
29223       FT_UINT8, BASE_HEX, VALS(atheros_ie_type_vals), 0,
29224       NULL, HFILL }},
29225
29226     {&hf_ieee80211_atheros_ie_subtype,
29227      {"Subtype", "wlan.atheros.ie.subtype",
29228       FT_UINT8, BASE_HEX, NULL, 0,
29229       NULL, HFILL }},
29230
29231     {&hf_ieee80211_atheros_ie_version,
29232      {"Version", "wlan.atheros.ie.version",
29233       FT_UINT8, BASE_HEX, NULL, 0,
29234       NULL, HFILL }},
29235
29236     {&hf_ieee80211_atheros_ie_cap_f_turbop,
29237      {"Turbo Prime", "wlan.ie.atheros.capabilities.turbop",
29238       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_TURBOP,
29239       NULL, HFILL }},
29240
29241     {&hf_ieee80211_atheros_ie_cap_f_comp,
29242      {"Compression", "wlan.ie.atheros.capabilities.comp",
29243       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_COMP,
29244       NULL, HFILL }},
29245
29246     {&hf_ieee80211_atheros_ie_cap_f_ff,
29247      {"Fast Frames", "wlan.ie.atheros.capabilities.ff",
29248       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_FF,
29249       NULL, HFILL }},
29250
29251     {&hf_ieee80211_atheros_ie_cap_f_xr,
29252      {"eXtended Range", "wlan.ie.atheros.capabilities.xr",
29253       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_XR,
29254       NULL, HFILL }},
29255
29256     {&hf_ieee80211_atheros_ie_cap_f_ar,
29257      {"Advanced Radar", "wlan.ie.atheros.capabilities.ar",
29258       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_AR,
29259       NULL, HFILL }},
29260
29261     {&hf_ieee80211_atheros_ie_cap_f_burst,
29262      {"Burst", "wlan.ie.atheros.capabilities.burst",
29263       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BURST,
29264       NULL, HFILL }},
29265
29266     {&hf_ieee80211_atheros_ie_cap_f_wme,
29267      {"CWMin tuning", "wlan.ie.atheros.capabilities.wme",
29268       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_WME,
29269       NULL, HFILL }},
29270
29271     {&hf_ieee80211_atheros_ie_cap_f_boost,
29272      {"Boost", "wlan.ie.atheros.capabilities.boost",
29273       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BOOST,
29274       NULL, HFILL }},
29275
29276     {&hf_ieee80211_atheros_ie_advcap_cap,
29277      {"Capabilities", "wlan.atheros.ie.advcap.cap",
29278       FT_UINT8, BASE_HEX, NULL, 0,
29279       NULL, HFILL }},
29280
29281     {&hf_ieee80211_atheros_ie_advcap_defkey,
29282      {"Default key index", "wlan.atheros.ie.advcap.defkey",
29283       FT_UINT16, BASE_HEX, NULL, 0,
29284       NULL, HFILL }},
29285
29286     {&hf_ieee80211_atheros_ie_xr_info,
29287      {"Info", "wlan.atheros.ie.xr.info",
29288       FT_UINT8, BASE_HEX, NULL, 0,
29289       NULL, HFILL }},
29290
29291     {&hf_ieee80211_atheros_ie_xr_base_bssid,
29292      {"Base BSS Id", "wlan.atheros.ie.xr.base_bssid",
29293       FT_ETHER, BASE_NONE, NULL, 0,
29294       NULL, HFILL }},
29295
29296     {&hf_ieee80211_atheros_ie_xr_xr_bssid,
29297      {"XR BSS Id", "wlan.atheros.ie.xr.xr_bssid",
29298       FT_ETHER, BASE_NONE, NULL, 0,
29299       NULL, HFILL }},
29300
29301     {&hf_ieee80211_atheros_ie_xr_xr_beacon,
29302      {"XR Beacon Interval", "wlan.atheros.ie.xr.xr_beacon",
29303       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
29304       NULL, HFILL }},
29305
29306     {&hf_ieee80211_atheros_ie_xr_base_cap,
29307      {"Base capabilities", "wlan.atheros.ie.xr.base_cap",
29308       FT_UINT8, BASE_HEX, NULL, 0,
29309       NULL, HFILL }},
29310
29311     {&hf_ieee80211_atheros_ie_xr_xr_cap,
29312      {"XR capabilities", "wlan.atheros.ie.xr.xr_cap",
29313       FT_UINT8, BASE_HEX, NULL, 0,
29314       NULL, HFILL }},
29315
29316     {&hf_ieee80211_atheros_ie_data,
29317      {"Atheros IE data", "wlan.atheros.data",
29318       FT_BYTES, BASE_NONE, NULL, 0,
29319       NULL, HFILL }},
29320
29321     {&hf_ieee80211_aironet_ie_type,
29322      {"Aironet IE type", "wlan.aironet.type",
29323       FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0,
29324       NULL, HFILL }},
29325
29326     {&hf_ieee80211_aironet_ie_dtpc,
29327      {"Aironet IE CCX DTCP", "wlan.aironet.dtpc",
29328       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
29329       NULL, HFILL }},
29330
29331     {&hf_ieee80211_aironet_ie_dtpc_unknown,
29332      {"Aironet IE CCX DTCP Unknown", "wlan.aironet.dtpc_unknown",
29333       FT_BYTES, BASE_NONE, NULL, 0,
29334       NULL, HFILL }},
29335
29336     {&hf_ieee80211_aironet_ie_version,
29337      {"Aironet IE CCX version", "wlan.aironet.version",
29338       FT_UINT8, BASE_DEC, NULL, 0,
29339       NULL, HFILL }},
29340
29341     {&hf_ieee80211_aironet_ie_data,
29342      { "Aironet IE data", "wlan.aironet.data",
29343        FT_BYTES, BASE_NONE, NULL, 0x0,
29344        NULL, HFILL }},
29345
29346     {&hf_ieee80211_qbss_version,
29347      {"QBSS Version", "wlan.qbss.version",
29348       FT_UINT8, BASE_DEC, NULL, 0,
29349       NULL, HFILL }},
29350
29351     {&hf_ieee80211_qbss_scount,
29352      {"Station Count", "wlan.qbss.scount",
29353       FT_UINT16, BASE_DEC, NULL, 0,
29354       NULL, HFILL }},
29355
29356     {&hf_ieee80211_qbss_cu,
29357      {"Channel Utilization", "wlan.qbss.cu",
29358       FT_UINT8, BASE_DEC, NULL, 0,
29359       NULL, HFILL }},
29360
29361     {&hf_ieee80211_qbss_adc,
29362      {"Available Admission Capacity", "wlan.qbss.adc",
29363       FT_UINT8, BASE_DEC, NULL, 0,
29364       NULL, HFILL }},
29365
29366     {&hf_ieee80211_qbss2_cu,
29367      {"Channel Utilization", "wlan.qbss2.cu",
29368       FT_UINT8, BASE_DEC, NULL, 0,
29369       NULL, HFILL }},
29370
29371     {&hf_ieee80211_qbss2_gl,
29372      {"G.711 CU Quantum", "wlan.qbss2.glimit",
29373       FT_UINT8, BASE_DEC, NULL, 0,
29374       NULL, HFILL }},
29375
29376     {&hf_ieee80211_qbss2_cal,
29377      {"Call Admission Limit", "wlan.qbss2.cal",
29378       FT_UINT8, BASE_DEC, NULL, 0,
29379       NULL, HFILL }},
29380
29381     {&hf_ieee80211_qbss2_scount,
29382      {"Station Count", "wlan.qbss2.scount",
29383       FT_UINT16, BASE_DEC, NULL, 0,
29384       NULL, HFILL }},
29385
29386     {&hf_ieee80211_aironet_ie_qos_reserved,
29387      {"Aironet IE QoS reserved", "wlan.aironet.qos.reserved",
29388       FT_UINT8, BASE_HEX, NULL, 0,
29389       NULL, HFILL }},
29390
29391     {&hf_ieee80211_aironet_ie_qos_paramset,
29392      {"Aironet IE QoS paramset", "wlan.aironet.qos.paramset",
29393       FT_UINT8, BASE_DEC, NULL, 0,
29394       NULL, HFILL }},
29395
29396     {&hf_ieee80211_aironet_ie_qos_val,
29397      {"Aironet IE QoS valueset", "wlan.aironet.qos.val",
29398       FT_BYTES, BASE_NONE, NULL, 0,
29399       NULL, HFILL }},
29400
29401     {&hf_ieee80211_aironet_ie_clientmfp,
29402      {"Aironet IE Client MFP", "wlan.aironet.clientmfp",
29403       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29404       NULL, HFILL }},
29405
29406     /* Vendor Specific : Nintendo */
29407     {&hf_ieee80211_vs_nintendo_type,
29408      {"Type", "wlan.vs.nintendo.type",
29409       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_nintendo_type_vals), 0,
29410       NULL, HFILL }},
29411
29412     {&hf_ieee80211_vs_nintendo_length,
29413      {"Length", "wlan.vs.nintendo.length",
29414       FT_UINT8, BASE_DEC, NULL, 0,
29415       NULL, HFILL }},
29416
29417     {&hf_ieee80211_vs_nintendo_servicelist,
29418      {"Servicelist", "wlan.vs.nintendo.servicelist",
29419       FT_BYTES, BASE_NONE, NULL, 0,
29420       NULL, HFILL }},
29421
29422     {&hf_ieee80211_vs_nintendo_service,
29423      {"Service", "wlan.vs.nintendo.service",
29424       FT_BYTES, BASE_NONE, NULL, 0,
29425       NULL, HFILL }},
29426
29427     {&hf_ieee80211_vs_nintendo_consoleid,
29428      {"Console ID", "wlan.vs.nintendo.consoleid",
29429       FT_BYTES, BASE_NONE, NULL, 0,
29430       NULL, HFILL }},
29431
29432     {&hf_ieee80211_vs_nintendo_unknown,
29433      {"Unknown", "wlan.vs.nintendo.unknown",
29434       FT_BYTES, BASE_NONE, NULL, 0,
29435       NULL, HFILL }},
29436
29437     /* Vendor Specific : Aruba Networks */
29438     {&hf_ieee80211_vs_aruba_subtype,
29439      {"Subtype", "wlan.vs.aruba.subtype",
29440       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_aruba_subtype_vals), 0,
29441       NULL, HFILL }},
29442
29443     {&hf_ieee80211_vs_aruba_apname,
29444      {"AP Name", "wlan.vs.aruba.ap_name",
29445       FT_STRINGZ, BASE_NONE, NULL, 0,
29446       NULL, HFILL }},
29447
29448     {&hf_ieee80211_vs_aruba_data,
29449      {"Data", "wlan.vs.aruba.data",
29450       FT_BYTES, BASE_NONE, NULL, 0,
29451       NULL, HFILL }},
29452
29453     {&hf_ieee80211_vs_mikrotik_unknown,
29454      {"Unknown", "wlan.vs.mikrotik.unknown",
29455       FT_BYTES, BASE_NONE, NULL, 0,
29456       NULL, HFILL }},
29457
29458     {&hf_ieee80211_vs_mikrotik_subitem,
29459      {"Sub IE", "wlan.vs.mikrotik.unknown",
29460       FT_BYTES, BASE_NONE, NULL, 0,
29461       NULL, HFILL }},
29462
29463     {&hf_ieee80211_vs_mikrotik_subtype,
29464      {"Subtype", "wlan.vs.mikrotik.subtype",
29465       FT_UINT8, BASE_DEC, NULL, 0,
29466       NULL, HFILL }},
29467
29468     {&hf_ieee80211_vs_mikrotik_sublength,
29469      {"Sublength", "wlan.vs.mikrotik.sublength",
29470       FT_UINT8, BASE_DEC, NULL, 0,
29471       NULL, HFILL }},
29472
29473     {&hf_ieee80211_vs_mikrotik_subdata,
29474      {"Subdata", "wlan.vs.mikrotik.subdata",
29475       FT_BYTES, BASE_NONE, NULL, 0,
29476       NULL, HFILL }},
29477
29478     /* Vendor Specific : Meru (Fortinet) */
29479     {&hf_ieee80211_vs_meru_subitem,
29480      {"Sub IE", "wlan.vs.meru.unknown",
29481       FT_NONE, BASE_NONE, NULL, 0,
29482       NULL, HFILL }},
29483
29484     {&hf_ieee80211_vs_meru_subtype,
29485      {"Subtype", "wlan.vs.meru.subtype",
29486       FT_UINT8, BASE_DEC, NULL, 0,
29487       NULL, HFILL }},
29488
29489     {&hf_ieee80211_vs_meru_sublength,
29490      {"Sublength", "wlan.vs.meru.sublength",
29491       FT_UINT8, BASE_DEC, NULL, 0,
29492       NULL, HFILL }},
29493
29494     {&hf_ieee80211_vs_meru_subdata,
29495      {"Subdata", "wlan.vs.meru.subdata",
29496       FT_BYTES, BASE_NONE, NULL, 0,
29497       NULL, HFILL }},
29498
29499     /* Vendor Specific : Extreme (Zebra) */
29500     {&hf_ieee80211_vs_extreme_subtype,
29501      {"Subtype", "wlan.vs.extreme.subtype",
29502       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_extreme_subtype_vals), 0,
29503       NULL, HFILL }},
29504
29505     {&hf_ieee80211_vs_extreme_subdata,
29506      {"Subdata", "wlan.vs.extreme.subdata",
29507       FT_BYTES, BASE_NONE, NULL, 0,
29508       NULL, HFILL }},
29509
29510     {&hf_ieee80211_vs_extreme_unknown,
29511      {"Unknown", "wlan.vs.extreme.unknown",
29512       FT_BYTES, BASE_NONE, NULL, 0,
29513       NULL, HFILL }},
29514
29515     {&hf_ieee80211_vs_extreme_ap_length,
29516      {"AP Length", "wlan.vs.extreme.ap_length",
29517       FT_UINT8, BASE_DEC, NULL, 0,
29518       NULL, HFILL }},
29519
29520     {&hf_ieee80211_vs_extreme_ap_name,
29521      {"AP Name", "wlan.vs.extreme.ap_name",
29522       FT_STRING, BASE_NONE, NULL, 0,
29523       NULL, HFILL }},
29524
29525     {&hf_ieee80211_tsinfo,
29526      {"Traffic Stream (TS) Info", "wlan.ts_info",
29527       FT_UINT24, BASE_HEX, NULL, 0,
29528       "Traffic Stream (TS) Info field", HFILL }},
29529
29530     {&hf_ieee80211_tsinfo_type,
29531      {"Traffic Type", "wlan.ts_info.type",
29532       FT_UINT24, BASE_DEC, VALS(tsinfo_type), 0x000001,
29533       "Traffic Stream (TS) Info Traffic Type", HFILL }},
29534
29535     {&hf_ieee80211_tsinfo_tsid,
29536      {"Traffic Stream ID (TSID)", "wlan.ts_info.tsid",
29537       FT_UINT24, BASE_DEC, NULL, 0x00001E,
29538       "Traffic Stream ID (TSID) Info TSID", HFILL }},
29539
29540     {&hf_ieee80211_tsinfo_dir,
29541      {"Direction", "wlan.ts_info.dir",
29542       FT_UINT24, BASE_DEC, VALS(tsinfo_direction), 0x000060,
29543       "Traffic Stream (TS) Info Direction", HFILL }},
29544
29545     {&hf_ieee80211_tsinfo_access,
29546      {"Access Policy", "wlan.ts_info.dir",
29547       FT_UINT24, BASE_DEC, VALS(tsinfo_access), 0x000180,
29548       "Traffic Stream (TS) Info Access Policy", HFILL }},
29549
29550     {&hf_ieee80211_tsinfo_agg,
29551      {"Aggregation", "wlan.ts_info.agg",
29552       FT_UINT24, BASE_DEC, NULL, 0x000200,
29553       "Traffic Stream (TS) Info Access Policy", HFILL }},
29554
29555     {&hf_ieee80211_tsinfo_apsd,
29556      {"Automatic Power-Save Delivery (APSD)", "wlan.ts_info.apsd",
29557       FT_UINT24, BASE_DEC, NULL, 0x000400,
29558       "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
29559
29560     {&hf_ieee80211_tsinfo_up,
29561      {"User Priority", "wlan.ts_info.up",
29562       FT_UINT24, BASE_DEC, VALS(qos_up), 0x003800,
29563       "Traffic Stream (TS) Info User Priority", HFILL }},
29564
29565     {&hf_ieee80211_tsinfo_ack,
29566      {"Ack Policy", "wlan.ts_info.ack",
29567       FT_UINT24, BASE_DEC, VALS(ack_policy), 0x00C000,
29568       "Traffic Stream (TS) Info Ack Policy", HFILL }},
29569
29570     {&hf_ieee80211_tsinfo_sched,
29571      {"Schedule", "wlan.ts_info.sched",
29572       FT_UINT24, BASE_DEC, NULL, 0x010000,
29573       "Traffic Stream (TS) Info Schedule", HFILL }},
29574
29575     {&hf_ieee80211_tsinfo_rsv,
29576      {"Reserved", "wlan.ts_info.rsv",
29577       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
29578       "Must be Zero", HFILL }},
29579
29580     {&hf_ieee80211_tspec_nor_msdu,
29581      {"Normal MSDU Size", "wlan.tspec.nor_msdu",
29582       FT_UINT16, BASE_DEC, NULL, 0,
29583       NULL, HFILL }},
29584
29585     {&hf_ieee80211_tspec_max_msdu,
29586      {"Maximum MSDU Size", "wlan.tspec.max_msdu",
29587       FT_UINT16, BASE_DEC, NULL, 0,
29588       NULL, HFILL }},
29589
29590     {&hf_ieee80211_tspec_min_srv,
29591      {"Minimum Service Interval", "wlan.tspec.min_srv",
29592       FT_UINT32, BASE_DEC, NULL, 0,
29593       NULL, HFILL }},
29594
29595     {&hf_ieee80211_tspec_max_srv,
29596      {"Maximum Service Interval", "wlan.tspec.max_srv",
29597       FT_UINT32, BASE_DEC, NULL, 0,
29598       NULL, HFILL }},
29599
29600     {&hf_ieee80211_tspec_inact_int,
29601      {"Inactivity Interval", "wlan.tspec.inact_int",
29602       FT_UINT32, BASE_DEC, NULL, 0,
29603       NULL, HFILL }},
29604
29605     {&hf_ieee80211_tspec_susp_int,
29606      {"Suspension Interval", "wlan.tspec.susp_int",
29607       FT_UINT32, BASE_DEC, NULL, 0,
29608       NULL, HFILL }},
29609
29610     {&hf_ieee80211_tspec_srv_start,
29611      {"Service Start Time", "wlan.tspec.srv_start",
29612       FT_UINT32, BASE_DEC, NULL, 0,
29613       NULL, HFILL }},
29614
29615     {&hf_ieee80211_tspec_min_data,
29616      {"Minimum Data Rate", "wlan.tspec.min_data",
29617       FT_UINT32, BASE_DEC, NULL, 0,
29618       NULL, HFILL }},
29619
29620     {&hf_ieee80211_tspec_mean_data,
29621      {"Mean Data Rate", "wlan.tspec.mean_data",
29622       FT_UINT32, BASE_DEC, NULL, 0,
29623       NULL, HFILL }},
29624
29625     {&hf_ieee80211_tspec_peak_data,
29626      {"Peak Data Rate", "wlan.tspec.peak_data",
29627       FT_UINT32, BASE_DEC, NULL, 0,
29628       NULL, HFILL }},
29629
29630     {&hf_ieee80211_tspec_burst_size,
29631      {"Burst Size", "wlan.tspec.burst_size",
29632       FT_UINT32, BASE_DEC, NULL, 0,
29633       NULL, HFILL }},
29634
29635     {&hf_ieee80211_tspec_delay_bound,
29636      {"Delay Bound", "wlan.tspec.delay_bound",
29637       FT_UINT32, BASE_DEC, NULL, 0,
29638       NULL, HFILL }},
29639
29640     {&hf_ieee80211_tspec_min_phy,
29641      {"Minimum PHY Rate", "wlan.tspec.min_phy",
29642       FT_UINT32, BASE_DEC, NULL, 0,
29643       NULL, HFILL }},
29644
29645     {&hf_ieee80211_tspec_surplus,
29646      {"Surplus Bandwidth Allowance", "wlan.tspec.surplus",
29647       FT_UINT16, BASE_DEC, NULL, 0,
29648       NULL, HFILL }},
29649
29650     {&hf_ieee80211_tspec_medium,
29651      {"Medium Time", "wlan.tspec.medium",
29652       FT_UINT16, BASE_DEC, NULL, 0,
29653       NULL, HFILL }},
29654
29655     {&hf_ieee80211_tspec_dmg,
29656      {"DMG attributes", "wlan.tspec.dmg",
29657       FT_UINT16, BASE_DEC, NULL, 0,
29658       NULL, HFILL }},
29659
29660     {&hf_ieee80211_ts_delay,
29661      {"Traffic Stream (TS) Delay", "wlan.ts_delay",
29662       FT_UINT32, BASE_DEC, NULL, 0,
29663       NULL, HFILL }},
29664
29665     {&hf_ieee80211_tclas_process,
29666      {"Processing", "wlan.tclas_proc.processing",
29667       FT_UINT8, BASE_DEC, VALS(ieee80211_tclas_process_flag), 0,
29668       NULL, HFILL }},
29669
29670     {&hf_ieee80211_tag_ext_supp_rates,
29671      {"Extended Supported Rates", "wlan.extended_supported_rates",
29672       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
29673       "In Mbit/sec, (B) for Basic Rates", HFILL }},
29674
29675     {&hf_ieee80211_sched_info,
29676      {"Schedule Info", "wlan.sched.sched_info",
29677       FT_UINT16, BASE_HEX, NULL, 0,
29678       "Schedule Info field", HFILL }},
29679
29680     {&hf_ieee80211_sched_info_agg,
29681      {"Schedule Aggregation", "wlan.sched_info.agg",
29682       FT_UINT16, BASE_DEC, NULL, 0x0001,
29683       "Traffic Stream (TS) Info Access Policy", HFILL }},
29684
29685     {&hf_ieee80211_sched_info_tsid,
29686      {"Schedule Traffic Stream ID (TSID)", "wlan.sched_info.tsid",
29687       FT_UINT16, BASE_DEC, NULL, 0x001E,
29688       "Traffic Stream ID (TSID) Info TSID", HFILL }},
29689
29690     {&hf_ieee80211_sched_info_dir,
29691      {"Schedule Direction", "wlan.sched_info.dir",
29692       FT_UINT16, BASE_DEC, VALS(tsinfo_direction), 0x0060,
29693       "Traffic Stream (TS) Info Direction", HFILL }},
29694
29695     {&hf_ieee80211_sched_srv_start,
29696      {"Service Start Time", "wlan.sched.srv_start",
29697       FT_UINT32, BASE_HEX, NULL, 0,
29698       NULL, HFILL }},
29699
29700     {&hf_ieee80211_sched_srv_int,
29701      {"Service Interval", "wlan.sched.srv_int",
29702       FT_UINT32, BASE_HEX, NULL, 0,
29703       NULL, HFILL }},
29704
29705     {&hf_ieee80211_sched_spec_int,
29706      {"Specification Interval", "wlan.sched.spec_int",
29707       FT_UINT16, BASE_HEX, NULL, 0,
29708       NULL, HFILL }},
29709
29710     {&hf_ieee80211_aruba,
29711      {"Aruba Type", "wlan.aruba.type",
29712       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &aruba_mgt_typevals_ext, 0,
29713       "Aruba Management", HFILL }},
29714
29715     {&hf_ieee80211_aruba_hb_seq,
29716      {"Aruba Heartbeat Sequence", "wlan.aruba.heartbeat_sequence",
29717       FT_UINT64, BASE_DEC, NULL, 0,
29718       NULL, HFILL }},
29719
29720     {&hf_ieee80211_aruba_mtu,
29721      {"Aruba MTU Size", "wlan.aruba.mtu_size",
29722       FT_UINT16, BASE_DEC, NULL, 0,
29723       NULL, HFILL }},
29724
29725     /* Start: HT Control (+HTC) */
29726     {&hf_ieee80211_htc,
29727      {"HT Control (+HTC)", "wlan.htc",
29728       FT_UINT32, BASE_HEX, NULL, 0,
29729       "High Throughput Control (+HTC)", HFILL }},
29730
29731     {&hf_ieee80211_htc_vht,
29732      {"VHT", "wlan.htc.vht",
29733       FT_BOOLEAN, 32, NULL, HTC_VHT,
29734       "High Throughput Control HT/VHT flag", HFILL }},
29735
29736     {&hf_ieee80211_htc_he,
29737      {"HE", "wlan.htc.he",
29738       FT_BOOLEAN, 32, NULL, HTC_HE,
29739       "High Efficiency Control HE flag", HFILL }},
29740
29741     {&hf_ieee80211_htc_he_ctrl_id,
29742      {"Control ID", "wlan.htc.he.a_control.ctrl_id",
29743       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
29744
29745     {&hf_ieee80211_he_umrs_he_tb_ppdu_len,
29746      {"HE TB PPDU Length", "wlan.htc.he.a_control.umrs.he_tb_ppdu_len",
29747       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29748
29749     {&hf_ieee80211_he_umrs_ru_allocation,
29750      {"RU Allocation", "wlan.htc.he.a_control.umrs.ru_allocation",
29751       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29752
29753     {&hf_ieee80211_he_dl_tx_power,
29754      {"DL Tx Power", "wlan.htc.he.a_control.umrs.dl_tx_power",
29755       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29756
29757     {&hf_ieee80211_he_ul_target_rssi,
29758      {"UL Target RSSI", "wlan.htc.he.a_control.umrs.ul_target_rssi",
29759       FT_UINT8, BASE_CUSTOM, CF_FUNC(ul_target_rssi_base_custom), 0x0,
29760        NULL, HFILL }},
29761
29762     {&hf_ieee80211_he_ul_mcs,
29763      {"UL MCS", "wlan.htc.he.a_control.umrs.ul_mcs",
29764       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29765
29766     {&hf_ieee80211_he_om_rx_nss,
29767      {"Rx NSS", "wlan.htc.he.a_control.om.rx_nss",
29768       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29769
29770     {&hf_ieee80211_he_om_channel_width,
29771      {"Channel Width", "wlan.htc.he.a_control.om.channel_width",
29772       FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL }},
29773
29774     {&hf_ieee80211_he_om_ul_mu_disable,
29775      {"UL MU Disable", "wlan.htc.he.a_control.om.ul_mu_disable",
29776       FT_BOOLEAN, 1, NULL, 0x0, NULL, HFILL }},
29777
29778     {&hf_ieee80211_he_om_tx_nsts,
29779      {"Tx NSTS", "wlan.htc.he.a_control.om.tx_nsts",
29780       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29781
29782     {&hf_ieee80211_he_hla_unsolicited_mfb,
29783      {"Unsolicited MFB", "wlan.htc.he.a_control.hla.unsolicited_mrq",
29784       FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL }},
29785
29786     {&hf_ieee80211_he_hla_mrq,
29787      {"MRQ", "wlan.htc.he.a_control.hla.mrq",
29788       FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL }},
29789
29790     {&hf_ieee80211_he_hla_nss,
29791      {"NSS", "wlan.htc.he.a_control.hla.NSS",
29792       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29793
29794     {&hf_ieee80211_he_hla_he_mcs,
29795      {"HE-MCS", "wlan.htc.he.a_control.hla.he_mcs",
29796       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29797
29798     {&hf_ieee80211_he_hla_dcm,
29799      {"DCM", "wlan.htc.he.a_control.hla.dcm",
29800       FT_BOOLEAN, 8, NULL, 0x0, NULL, HFILL }},
29801
29802     {&hf_ieee80211_he_hla_ru,
29803      {"RU", "wlan.htc.he.a_control.hla.ru",
29804       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29805
29806     {&hf_ieee80211_he_hla_bw,
29807      {"BW", "wlan.htc.he.a_control.hla.bw",
29808       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29809
29810     {&hf_ieee80211_he_hla_msi_ppdu_type,
29811      {"MSI/PPDU Type", "wlan.htc.he.a_control.hla.msi_ppdu_type",
29812       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29813
29814     {&hf_ieee80211_he_hla_tx_bf,
29815      {"Tx BF", "wlan.htc.he.a_control.hla.tx_bf",
29816       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29817
29818     {&hf_ieee80211_he_bsr_aci_bitmap,
29819      {"ACI Bitmap", "wlan.htc.he.a_control.bsr.aci_bitmap",
29820       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29821
29822     {&hf_ieee80211_he_bsr_delta_tid,
29823      {"Delta TID", "wlan.htc.he.a_control.bsr.delta_tid",
29824       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29825
29826     {&hf_ieee80211_he_bsr_aci_high,
29827      {"ACI High", "wlan.htc.he.a_control.bsr.aci_high",
29828       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29829
29830     {&hf_ieee80211_he_bsr_scaling_factor,
29831      {"Scaling Factor", "wlan.htc.he.a_control.bsr.scaling_factor",
29832       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29833
29834     {&hf_ieee80211_he_bsr_queue_size_high,
29835      {"Queue Size High", "wlan.htc.he.a_control.bsr.queue_size_high",
29836       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29837
29838     {&hf_ieee80211_he_bsr_queue_size_all,
29839      {"Queue Size All", "wlan.htc.he.a_control.bsr.queue_size_all",
29840       FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29841
29842     {&hf_ieee80211_he_uph_ul_power_headroom,
29843      {"UL Power Headroom", "wlan.htc.he.a_control.uph.ul_power_headroom",
29844       FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
29845
29846     {&hf_ieee80211_he_uph_ul_min_transmit_power_flag,
29847      {"Minimum Transmit Power Flag", "wlan.htc.he.a_control.uph.min_transmit_power_flag",
29848       FT_BOOLEAN, 1, NULL, 0x0, NULL, HFILL }},
29849
29850     {&hf_ieee80211_he_cci_ac_constraint,
29851      {"AC Constraint", "wlan.htc.he.a_control.cci.ac_constraint",
29852       FT_BOOLEAN, 1, NULL, 0x0, NULL, HFILL }},
29853
29854     {&hf_ieee80211_he_cci_rdg_more_ppdu,
29855      {"RDG/More PPDU", "wlan.htc.he.a_control.cci.rdg_more_ppdu",
29856       FT_BOOLEAN, 1, NULL, 0x0, NULL, HFILL }},
29857
29858     {&hf_ieee80211_he_cci_sr_ppdu_indic,
29859      {"SR PPDU Indication", "wlan.htc.he.a_control.cci.sr_ppdu_indic",
29860       FT_BOOLEAN, 1, NULL, 0x0, NULL, HFILL }},
29861
29862     {&hf_ieee80211_he_btc_avail_chan,
29863      {"Available Channel Bitmap", "wlan.htc.he.a_control.bqr.avail_chan_bitmap",
29864       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
29865
29866     {&hf_ieee80211_he_btc_reserved,
29867      {"Reserved", "wlan.htc.he.a_control.bqr.reserved",
29868       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
29869
29870     {&hf_ieee80211_he_trigger_common_info,
29871      {"HE Trigger Common Info", "wlan.trigger.he.common_info",
29872       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
29873
29874     {&hf_ieee80211_he_trigger_type,
29875      {"Trigger Type", "wlan.trigger.he.trigger_type",
29876       FT_UINT64, BASE_DEC, VALS(trigger_type_vals),
29877         0x000000000000000F, NULL, HFILL }},
29878
29879     {&hf_ieee80211_he_trigger_length,
29880      {"L-SIG Length", "wlan.trigger.he.l_sig_length",
29881       FT_UINT64, BASE_DEC, NULL, 0x000000000000FFF0, NULL, HFILL }},
29882
29883     {&hf_ieee80211_he_trigger_cascade_indication,
29884      {"Cascade Indication", "wlan.trigger.he.cascade_indication",
29885       FT_BOOLEAN, 64, NULL, 0x0000000000010000, NULL, HFILL }},
29886
29887     {&hf_ieee80211_he_trigger_cs_required,
29888      {"CS Required", "wlan.trigger.he.cs_required",
29889       FT_BOOLEAN, 64, NULL, 0x0000000000020000, NULL, HFILL }},
29890
29891     {&hf_ieee80211_he_trigger_bw,
29892      {"BW", "wlan.trigger.he.bw",
29893       FT_UINT64, BASE_DEC, VALS(bw_subfield_vals), 0x00000000000C0000, NULL, HFILL }},
29894
29895     {&hf_ieee80211_he_trigger_gi_and_ltf_type,
29896      {"GI And LTF Type", "wlan.trigger.he.gi_and_ltf_type",
29897       FT_UINT64, BASE_DEC, VALS(gi_and_ltf_type_subfield_vals), 0x0000000000300000,
29898         NULL, HFILL }},
29899
29900     {&hf_ieee80211_he_trigger_mu_mimo_ltf_mode,
29901      {"MU-MIMO LTF Mode", "wlan.trigger.he.mu_mimo_ltf_mode",
29902       FT_BOOLEAN, 64, TFS(&mu_mimo_ltf_mode_tfs), 0x0000000000400000, NULL, HFILL }},
29903
29904     {&hf_ieee80211_he_trigger_num_he_ltf_syms_etc,
29905      {"Number of HE-LTF Symbols and Midamble Periodicity",
29906         "wlan.trigger.he.num_he_ltf_syms_and_midamble_per",
29907       FT_UINT64, BASE_HEX, NULL, 0x0000000003800000, NULL, HFILL }},
29908
29909     {&hf_ieee80211_he_trigger_stbc,
29910      {"STBC", "wlan.trigger.he.stbc",
29911       FT_BOOLEAN, 64, NULL, 0x0000000004000000, NULL, HFILL }},
29912
29913     {&hf_ieee80211_he_trigger_ldpc_extra_sym_seg,
29914      {"LDPC Extra Symbol Segment", "wlan.trigger.he.ldpc_extra_symbol_segment",
29915       FT_BOOLEAN, 64, NULL, 0x0000000008000000, NULL, HFILL }},
29916
29917     {&hf_ieee80211_he_trigger_ap_tx_power,
29918      {"AP TX Power", "wlan.trigger.he.ap_tx_power",
29919       FT_UINT64, BASE_DEC, NULL, 0x00000003F0000000, NULL, HFILL }},
29920
29921     {&hf_ieee80211_he_trigger_packet_extension,
29922      {"Packet Extension", "wlan.trigger.he.packet_extension",
29923       FT_UINT64, BASE_HEX, NULL, 0x0000001C00000000, NULL, HFILL }},
29924
29925     {&hf_ieee80211_he_trigger_spatial_reuse,
29926      {"Spatial Reuse", "wlan.trigger.he.spatial_reuse",
29927       FT_UINT64, BASE_HEX, NULL, 0x001FFFE000000000, NULL, HFILL }},
29928
29929     {&hf_ieee80211_he_trigger_doppler,
29930      {"Doppler", "wlan.trigger.he.doppler",
29931       FT_BOOLEAN, 64, NULL, 0x0020000000000000, NULL, HFILL }},
29932
29933     {&hf_ieee80211_he_trigger_he_sig_a_reserved,
29934      {"HE-SIG-A Reserved", "wlan.trigger.he.he_sig_a_reserved",
29935       FT_UINT64, BASE_HEX, NULL, 0x7FC0000000000000, NULL, HFILL }},
29936
29937     {&hf_ieee80211_he_trigger_reserved,
29938      {"Reserved", "wlan.trigger.he.reserved",
29939       FT_UINT64, BASE_HEX, NULL, 0x8000000000000000, NULL, HFILL }},
29940
29941     {&hf_ieee80211_he_trigger_bar_ctrl,
29942      {"BAR Control", "wlan.trigger.he.common_info.bar_ctrl",
29943       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29944
29945     {&hf_ieee80211_he_trigger_bar_ctrl_ba_ack_policy,
29946      {"BA Ack Policy", "wlan.trigger.he.common_info.bar_ctrl.ba_ack_policy",
29947       FT_BOOLEAN, 16, TFS(&ieee80211_block_ack_control_ack_policy_flag), 0x0001,
29948        NULL, HFILL }},
29949
29950     {&hf_ieee80211_he_trigger_bar_ctrl_ba_type,
29951      {"BA Type", "wlan.trigger.he.common_info.bar_ctrl.ba_type",
29952       FT_UINT16, BASE_HEX, VALS(block_ack_type_vals), 0x001e, NULL, HFILL }},
29953
29954     {&hf_ieee80211_he_trigger_bar_ctrl_reserved,
29955      {"Reserved", "wlan.trigger.he.common_info.bar_ctrl.reserved",
29956       FT_UINT16, BASE_HEX, NULL, 0x0FE0, NULL, HFILL }},
29957
29958     {&hf_ieee80211_he_trigger_bar_ctrl_tid_info,
29959      {"TID_INFO", "wlan.trigger.he.common_info.bar_ctrl.tid_info",
29960       FT_UINT16, BASE_HEX, NULL, 0xF000, NULL, HFILL }},
29961
29962     {&hf_ieee80211_he_trigger_bar_info,
29963      {"BAR Information", "wlan.trigger.he.common_info.bar_info",
29964       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
29965
29966     {&hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl,
29967      {"Block Ack Starting Sequence Control",
29968       "wlan.trigger.he.common_info.bar_info.blk_ack_starting_seq_ctrl",
29969       FT_UINT16, BASE_HEX, NULL, 0xFFFF, NULL, HFILL }},
29970
29971     {&hf_ieee80211_he_trigger_user_info,
29972      {"User Info", "wlan.trigger.he.user_info",
29973       FT_UINT40, BASE_HEX, NULL, 0, NULL, HFILL }},
29974
29975     {&hf_ieee80211_he_trigger_mpdu_mu_spacing,
29976      {"MPDU MU Spacing Factor", "wlan.trigger.he.mpdu_mu_spacing_factor",
29977       FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL }},
29978
29979     {&hf_ieee80211_he_trigger_tid_aggregation_limit,
29980      {"TID Aggregation Limit", "wlan.trigger.he.tid_aggregation_limit",
29981       FT_UINT8, BASE_DEC, NULL, 0x1C, NULL, HFILL }},
29982
29983     {&hf_ieee80211_he_trigger_dependent_reserved1,
29984      {"Reserved", "wlan.trigger.he.reserved1",
29985       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
29986
29987     {&hf_ieee80211_he_trigger_preferred_ac,
29988      {"Preferred AC", "wlan.trigger.he.preferred_ac",
29989       FT_UINT8, BASE_HEX, VALS(preferred_ac_vals), 0xC0, NULL, HFILL }},
29990
29991     {&hf_ieee80211_he_trigger_dep_basic_user_info,
29992      {"Basic Trigger Dependent User Info", "wlan.trigger.he.basic_user_info",
29993       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
29994
29995     {&hf_ieee80211_he_trigger_starting_aid,
29996      {"Starting AID", "wlan.trigger.he.starting_aid",
29997       FT_UINT40, BASE_HEX, NULL, 0x0000000FFF, NULL, HFILL }},
29998
29999     {&hf_ieee80211_he_trigger_dependent_reserved2,
30000      {"Reserved", "wlan.trigger.he.reserved2",
30001       FT_UINT40, BASE_HEX, NULL, 0x00001FF000, NULL, HFILL }},
30002
30003     {&hf_ieee80211_he_trigger_feedback_type,
30004      {"Feedback Type", "wlan.trigger.he.feedback_type",
30005       FT_UINT40, BASE_HEX, NULL, 0x0001E00000, NULL, HFILL }},
30006
30007     {&hf_ieee80211_he_trigger_dependent_reserved3,
30008      {"Reserved", "wlan.trigger.he.reserved3",
30009       FT_UINT40, BASE_HEX, NULL, 0x00FE000000, NULL, HFILL }},
30010
30011     {&hf_ieee80211_he_trigger_nfrp_target_rssi,
30012      {"Target RSSI", "wlan.trigger.he.target_rssi",
30013       FT_UINT40, BASE_CUSTOM, CF_FUNC(target_rssi_base_custom), 0x7F00000000,
30014        NULL, HFILL }},
30015
30016     {&hf_ieee80211_he_trigger_multiplexing_flag,
30017      {"Multiplexing Flag", "wlan.trigger.he.multiplexing_flag",
30018       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
30019
30020     {&hf_ieee80211_he_trigger_dep_nfrp_user_info,
30021      {"NFRP Trigger Dependent User Unfo", "wlan.trigger.he.nfrp_user_info",
30022       FT_UINT40, BASE_HEX, NULL, 0, NULL, HFILL }},
30023
30024     {&hf_ieee80211_he_trigger_feedback_seg_retrans_bm,
30025      {"Feedback Segment Retransmission Bitmap", "wlan.trigger.he.feedback_bm",
30026       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
30027
30028     {&hf_ieee80211_he_trigger_aid12,
30029      {"AID12", "wlan.trigger.he.user_info.aid12",
30030       FT_UINT40, BASE_HEX, NULL, 0x0000000FFF, NULL, HFILL }},
30031
30032     {&hf_ieee80211_he_trigger_ru_allocation,
30033      {"RU Allocation", "wlan.trigger.he.ru_allocation",
30034       FT_UINT40, BASE_HEX, NULL, 0x00000FF000, NULL, HFILL }},
30035
30036     {&hf_ieee80211_he_trigger_coding_type,
30037      {"Coding Type", "wlan.trigger.he.coding_type",
30038       FT_BOOLEAN, 40, TFS(&he_trigger_coding_type_tfs), 0x0000100000,
30039         NULL, HFILL }},
30040
30041     {&hf_ieee80211_he_trigger_mcs,
30042      {"MCS", "wlan.trigger.he.mcs",
30043       FT_UINT40, BASE_HEX, NULL, 0x0001E00000, NULL, HFILL }},
30044
30045     {&hf_ieee80211_he_trigger_dcm,
30046      {"DCM", "wlan.trigger.he.dcm",
30047       FT_BOOLEAN, 40, NULL, 0x0002000000, NULL, HFILL }},
30048
30049     {&hf_ieee80211_he_trigger_ss_allocation,
30050      {"SS Alloc/Random Access RU Info", "wlan.trigger.he.ss_alloc",
30051       FT_UINT40, BASE_HEX, NULL, 0x00FC000000, NULL, HFILL }},
30052
30053     {&hf_ieee80211_he_trigger_target_rssi,
30054      {"Target RSSI", "wlan.trigger.he.target_rssi",
30055       FT_UINT40, BASE_CUSTOM, CF_FUNC(target_rssi_base_custom), 0x7F00000000,
30056        NULL, HFILL }},
30057
30058     {&hf_ieee80211_he_trigger_user_reserved,
30059      {"Reserved", "wlan.trigger.he.user_reserved",
30060       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
30061
30062     {&hf_he_ndp_sounding_dialog_token_number,
30063      {"Sounding Dialog Token Number", "wlan.he_ndp.token.number",
30064       FT_UINT8, BASE_DEC, NULL, 0xFC,
30065       NULL, HFILL }},
30066
30067     {&hf_he_ndp_annc_he_subfield,
30068      {"HE", "wlan.vht_he.token.he",
30069       FT_BOOLEAN, 8, TFS(&he_ndp_annc_he_subfield_vals), 0x02, NULL, HFILL }},
30070
30071     {&hf_he_ndp_annc_reserved,
30072      {"Reserved", "wlan.he_ndp.token.reserved",
30073       FT_UINT8, BASE_HEX, NULL, 0x01,
30074       NULL, HFILL }},
30075
30076     {&hf_ieee80211_he_ndp_annc_token,
30077      {"Sounding Dialog Token", "wlan.he_ndp.token",
30078       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
30079
30080     {&hf_ieee80211_he_ndp_annc_sta,
30081      {"STA Info", "wlan.he_ndp.sta_info",
30082       FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
30083
30084     {&hf_he_ndp_annc_aid11,
30085      {"AID11", "wlan.he_ndp.sta_info.aid11",
30086       FT_UINT32, BASE_HEX, NULL, 0x000007FF, NULL, HFILL }},
30087
30088     {&hf_he_ndp_annc_partial_bw_info,
30089      {"Partial BW Info", "wlan.he_ndp.sta_info.partial_bw_info",
30090       FT_UINT32, BASE_CUSTOM, CF_FUNC(partial_bw_info_base_custom), 0x01FFF800,
30091        NULL, HFILL }},
30092
30093     {&hf_he_ndp_annc_feedback_type_and_ng,
30094      {"Feedback Type and Ng", "wlan.he.sta_info.feedback_type_and_ng",
30095       FT_UINT32, BASE_HEX, NULL, 0x06000000, NULL, HFILL }},
30096
30097     {&hf_he_ndp_annc_disambiguation,
30098      {"Disambiguation", "wlan.he_ndp.sta_info.disambiguation",
30099       FT_UINT32, BASE_HEX, NULL, 0x08000000, NULL, HFILL }},
30100
30101     {&hf_he_ndp_annc_codebook_size,
30102      {"Codebook Size", "wlan.he_ndp.sta_info.codebook_size",
30103       FT_UINT32, BASE_HEX, NULL, 0x10000000, NULL, HFILL }},
30104
30105     {&hf_he_ndp_annc_nc,
30106      {"Nc", "wlan.he_ndp.sta_info.nc",
30107       FT_UINT32, BASE_HEX, NULL, 0xE0000000, NULL, HFILL }},
30108
30109     {&hf_ieee80211_htc_ht_lac,
30110      {"Link Adaptation Control (LAC)", "wlan.htc.lac",
30111       FT_UINT32, BASE_HEX, NULL, 0x0000FFFE,
30112       "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
30113
30114     {&hf_ieee80211_htc_lac_trq,
30115      {"Training Request (TRQ)", "wlan.htc.lac.trq",
30116       FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002,
30117       "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
30118
30119     {&hf_ieee80211_htc_lac_mai_aseli,
30120      {"Antenna Selection Indication (ASELI)", "wlan.htc.lac.mai.aseli",
30121       FT_UINT16, BASE_HEX, NULL, 0x003C,
30122       "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
30123
30124     {&hf_ieee80211_htc_lac_mai_mrq,
30125      {"MCS Request (MRQ)", "wlan.htc.lac.mai.mrq",
30126       FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004,
30127       "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
30128
30129     {&hf_ieee80211_htc_lac_mai_msi,
30130      {"MCS Request Sequence Identifier (MSI)", "wlan.htc.lac.mai.msi",
30131       FT_UINT16, BASE_HEX, NULL, 0x0038,
30132       "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
30133
30134     {&hf_ieee80211_htc_lac_mai_reserved,
30135      {"Reserved", "wlan.htc.lac.mai.reserved",
30136       FT_UINT16, BASE_HEX, NULL, 0x0038,
30137       "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
30138
30139     {&hf_ieee80211_htc_lac_mfsi,
30140      {"MCS Feedback Sequence Identifier (MFSI)", "wlan.htc.lac.mfsi",
30141       FT_UINT16, BASE_DEC, NULL, 0x01C0,
30142       "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
30143
30144     {&hf_ieee80211_htc_lac_asel_command,
30145      {"Antenna Selection (ASEL) Command", "wlan.htc.lac.asel.command",
30146       FT_UINT16, BASE_HEX, VALS(ieee80211_htc_lac_asel_command_flags), 0x0E00,
30147       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
30148
30149     {&hf_ieee80211_htc_lac_asel_data,
30150      {"Antenna Selection (ASEL) Data", "wlan.htc.lac.asel.data",
30151       FT_UINT16, BASE_HEX, NULL, 0xF000,
30152       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
30153
30154     {&hf_ieee80211_htc_lac_mfb,
30155      {"MCS Feedback (MFB)", "wlan.htc.lac.mfb",
30156       FT_UINT16, BASE_HEX, NULL, 0xFE00,
30157       "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
30158
30159     {&hf_ieee80211_htc_cal_pos,
30160      {"Calibration Position", "wlan.htc.cal.pos",
30161       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_cal_pos_flags), 0x00030000,
30162       "High Throughput Control Calibration Position", HFILL }},
30163
30164     {&hf_ieee80211_htc_cal_seq,
30165      {"Calibration Sequence Identifier", "wlan.htc.cal.seq",
30166       FT_UINT32, BASE_DEC, NULL, 0x000C0000,
30167       "High Throughput Control Calibration Sequence Identifier", HFILL }},
30168
30169     {&hf_ieee80211_htc_reserved1,
30170      {"Reserved", "wlan.htc.reserved1",
30171       FT_UINT32, BASE_HEX, NULL, 0x00300000,
30172       "High Throughput Control Reserved", HFILL }},
30173
30174     {&hf_ieee80211_htc_csi_steering,
30175      {"CSI/Steering", "wlan.htc.csi_steering",
30176       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_csi_steering_flags), 0x00C00000,
30177       "High Throughput Control CSI/Steering", HFILL }},
30178
30179     {&hf_ieee80211_htc_ndp_announcement,
30180      {"NDP Announcement", "wlan.htc.ndp_announcement",
30181       FT_BOOLEAN, 32, TFS(&ieee80211_htc_ndp_announcement_flag), 0x01000000,
30182       "High Throughput Control NDP Announcement", HFILL }},
30183
30184     {&hf_ieee80211_htc_reserved2,
30185      {"Reserved", "wlan.htc.reserved2",
30186       FT_UINT32, BASE_HEX, NULL, 0x3E000000,
30187       "High Throughput Control Reserved", HFILL }},
30188
30189     {&hf_ieee80211_htc_mrq,
30190      {"MRQ", "wlan.htc.mrq",
30191       FT_BOOLEAN, 32, NULL, HTC_MRQ,
30192       "VHT-MCS feedback request", HFILL }},
30193
30194     {&hf_ieee80211_htc_msi,
30195      {"MSI", "wlan.htc.msi",
30196       FT_UINT32, BASE_DEC, NULL, 0x00000038,
30197       "MRQ sequence number", HFILL }},
30198
30199     {&hf_ieee80211_htc_msi_stbc_reserved,
30200      {"Reserved", "wlan.htc.msi_stbc_reserved",
30201       FT_UINT32, BASE_HEX, NULL, 0x00000038,
30202       NULL, HFILL }},
30203
30204     {&hf_ieee80211_htc_compressed_msi,
30205      {"Compressed MSI", "wlan.htc.compressed_msi",
30206       FT_UINT32, BASE_DEC, NULL, 0x00000018,
30207       NULL, HFILL }},
30208
30209     {&hf_ieee80211_htc_ppdu_stbc_encoded,
30210      {"PPDU was STBC encoded", "wlan.htc.ppdu_stbc_encoded",
30211       FT_BOOLEAN, 32, NULL, 0x00000020,
30212       NULL, HFILL }},
30213
30214     {&hf_ieee80211_htc_mfsi,
30215      {"MFSI", "wlan.htc.mfsi",
30216       FT_BOOLEAN, 32, NULL, 0x000001C0,
30217       "MFB sequence identifier", HFILL }},
30218
30219     {&hf_ieee80211_htc_gid_l,
30220      {"GID-L", "wlan.htc.gid_l",
30221       FT_BOOLEAN, 32, NULL, 0x000001C0,
30222       "LSBs of group ID", HFILL }},
30223
30224     {&hf_ieee80211_htc_mfb,
30225      {"MFB", "wlan.htc.mfb",
30226       FT_UINT32, BASE_HEX, NULL, 0x00FFFE00,
30227       "Recommended MFB", HFILL }},
30228
30229     {&hf_ieee80211_htc_num_sts,
30230      {"NUM_STS", "wlan.htc.num_sts",
30231       FT_UINT32, BASE_DEC, NULL, 0x00000E00,
30232       "Recommended NUM_STS", HFILL }},
30233
30234     {&hf_ieee80211_htc_vht_mcs,
30235      {"VHT-MCS", "wlan.htc.vht_mcs",
30236       FT_UINT32, BASE_DEC, NULL, 0x0000F000,
30237       "Recommended VHT-MCS", HFILL }},
30238
30239     {&hf_ieee80211_htc_bw,
30240      {"BW", "wlan.htc.bw",
30241       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_bw_recommended_vht_mcs_vals), 0x00030000,
30242       "Bandwidth for recommended VHT-MCS", HFILL }},
30243
30244     {&hf_ieee80211_htc_snr,
30245      {"SNR", "wlan.htc.snr",
30246       FT_INT32, BASE_DEC, NULL, 0x00FC0000,
30247       "Average SNR + 22", HFILL }},
30248
30249     {&hf_ieee80211_htc_reserved3,
30250      {"Reserved", "wlan.htc.reserved3",
30251       FT_UINT32, BASE_HEX, NULL, 0x1F000000,
30252       NULL, HFILL }},
30253
30254     {&hf_ieee80211_htc_gid_h,
30255      {"GID-H", "wlan.htc.gid_h",
30256       FT_UINT32, BASE_DEC, NULL, 0x07000000,
30257       NULL, HFILL }},
30258
30259     {&hf_ieee80211_htc_coding_type,
30260      {"Coding type", "wlan.htc.coding_type",
30261       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_coding_type_vals), 0x08000000,
30262       NULL, HFILL }},
30263
30264     {&hf_ieee80211_htc_fb_tx_type,
30265      {"FB Tx type", "wlan.htc.fb_tx_type",
30266       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_fb_tx_type_vals), 0x10000000,
30267       NULL, HFILL }},
30268
30269     {&hf_ieee80211_htc_unsolicited_mfb,
30270      {"Unsolicited MFB", "wlan.htc.unsolicited_mfb",
30271       FT_BOOLEAN, 32, NULL, HTC_UNSOLICITED_MFB,
30272       "High Throughput Control Unsolicited MFB", HFILL }},
30273
30274     {&hf_ieee80211_htc_ac_constraint,
30275      {"AC Constraint", "wlan.htc.ac_constraint",
30276       FT_BOOLEAN, 32, NULL, 0x40000000,
30277       "High Throughput Control AC Constraint", HFILL }},
30278
30279     {&hf_ieee80211_htc_rdg_more_ppdu,
30280      {"RDG/More PPDU", "wlan.htc.rdg_more_ppdu",
30281       FT_BOOLEAN, 32, NULL, 0x80000000,
30282       "High Throughput Control RDG/More PPDU", HFILL }},
30283     /* End: HT Control (+HTC) */
30284
30285     /* MDIE */
30286     {&hf_ieee80211_tag_mobility_domain_mdid,
30287      {"Mobility Domain Identifier", "wlan.mobility_domain.mdid",
30288       FT_UINT16, BASE_HEX, NULL, 0,
30289       NULL, HFILL }},
30290
30291     {&hf_ieee80211_tag_mobility_domain_ft_capab,
30292      {"FT Capability and Policy", "wlan.mobility_domain.ft_capab",
30293       FT_UINT8, BASE_HEX, NULL, 0,
30294       NULL, HFILL }},
30295
30296     {&hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
30297      {"Fast BSS Transition over DS",
30298       "wlan.mobility_domain.ft_capab.ft_over_ds",
30299       FT_UINT8, BASE_HEX, NULL, 0x01,
30300       NULL, HFILL }},
30301
30302     {&hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
30303      {"Resource Request Protocol Capability",
30304       "wlan.mobility_domain.ft_capab.resource_req",
30305       FT_UINT8, BASE_HEX, NULL, 0x02,
30306       NULL, HFILL }},
30307
30308     /* FTIE */
30309     {&hf_ieee80211_tag_ft_mic_control,
30310      {"MIC Control", "wlan.ft.mic_control",
30311       FT_UINT16, BASE_HEX, NULL, 0,
30312       NULL, HFILL }},
30313
30314     {&hf_ieee80211_tag_ft_element_count,
30315      {"Element Count", "wlan.ft.element_count",
30316       FT_UINT16, BASE_DEC, NULL, 0xff00,
30317       NULL, HFILL }},
30318
30319     {&hf_ieee80211_tag_ft_mic,
30320      {"MIC", "wlan.ft.mic",
30321       FT_BYTES, BASE_NONE, NULL, 0,
30322       NULL, HFILL }},
30323
30324     {&hf_ieee80211_tag_ft_anonce,
30325      {"ANonce", "wlan.ft.anonce",
30326       FT_BYTES, BASE_NONE, NULL, 0,
30327       NULL, HFILL }},
30328
30329     {&hf_ieee80211_tag_ft_snonce,
30330      {"SNonce", "wlan.ft.snonce",
30331       FT_BYTES, BASE_NONE, NULL, 0,
30332       NULL, HFILL }},
30333
30334     {&hf_ieee80211_tag_ft_subelem_id,
30335      {"Subelement ID", "wlan.ft.subelem.id",
30336       FT_UINT8, BASE_DEC, VALS(ft_subelem_id_vals), 0,
30337       NULL, HFILL }},
30338
30339     {&hf_ieee80211_tag_ft_subelem_len,
30340      {"Length", "wlan.ft.subelem.len",
30341       FT_UINT8, BASE_DEC, NULL, 0,
30342       NULL, HFILL }},
30343
30344     {&hf_ieee80211_tag_ft_subelem_data,
30345      {"Data", "wlan.ft.subelem.data",
30346       FT_BYTES, BASE_NONE, NULL, 0,
30347       NULL, HFILL }},
30348
30349     {&hf_ieee80211_tag_ft_subelem_r1kh_id,
30350      {"PMK-R1 key holder identifier (R1KH-ID)", "wlan.ft.subelem.r1kh_id",
30351       FT_BYTES, BASE_NONE, NULL, 0,
30352       NULL, HFILL }},
30353
30354     {&hf_ieee80211_tag_ft_subelem_gtk_key_info,
30355      {"Key Info", "wlan.ft.subelem.gtk.key_info",
30356       FT_UINT16, BASE_HEX, NULL, 0,
30357       NULL, HFILL }},
30358
30359     {&hf_ieee80211_tag_ft_subelem_gtk_key_id,
30360      {"Key ID", "wlan.ft.subelem.gtk.key_id",
30361       FT_UINT16, BASE_DEC, NULL, 0x0003,
30362       NULL, HFILL }},
30363
30364     {&hf_ieee80211_tag_ft_subelem_gtk_key_length,
30365      {"Key Length", "wlan.ft.subelem.gtk.key_length",
30366       FT_UINT8, BASE_HEX, NULL, 0,
30367       NULL, HFILL }},
30368
30369     {&hf_ieee80211_tag_ft_subelem_gtk_rsc,
30370      {"RSC", "wlan.ft.subelem.gtk.rsc",
30371       FT_BYTES, BASE_NONE, NULL, 0,
30372       NULL, HFILL }},
30373
30374     {&hf_ieee80211_tag_ft_subelem_gtk_key,
30375      {"GTK", "wlan.ft.subelem.gtk.key",
30376       FT_BYTES, BASE_NONE, NULL, 0,
30377       NULL, HFILL }},
30378
30379     {&hf_ieee80211_tag_ft_subelem_r0kh_id,
30380      {"PMK-R0 key holder identifier (R0KH-ID)", "wlan.ft.subelem.r0kh_id",
30381       FT_BYTES, BASE_NONE, NULL, 0,
30382       NULL, HFILL }},
30383
30384     {&hf_ieee80211_tag_ft_subelem_igtk_key_id,
30385      {"Key ID", "wlan.ft.subelem.igtk.key_id",
30386       FT_UINT16, BASE_DEC, NULL, 0,
30387       NULL, HFILL }},
30388
30389     {&hf_ieee80211_tag_ft_subelem_igtk_ipn,
30390      {"IPN", "wlan.ft.subelem.igtk.ipn",
30391       FT_BYTES, BASE_NONE, NULL, 0,
30392       NULL, HFILL }},
30393
30394     {&hf_ieee80211_tag_ft_subelem_igtk_key_length,
30395      {"Key Length", "wlan.ft.subelem.igtk.key_length",
30396       FT_UINT8, BASE_HEX, NULL, 0,
30397       NULL, HFILL }},
30398
30399     {&hf_ieee80211_tag_ft_subelem_igtk_key,
30400      {"Wrapped Key (IGTK)", "wlan.ft.subelem.igtk.key",
30401       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
30402
30403     /* RIC Data IE: 802.11-2012: 8.4.2.52 */
30404     {&hf_ieee80211_tag_ric_data_id,
30405      {"Resource Handshake Identifier", "wlan.ric_data.id",
30406       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
30407
30408     {&hf_ieee80211_tag_ric_data_desc_cnt,
30409      {"Resource Descriptor Count", "wlan.ric_data.desc_cnt",
30410       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
30411
30412     {&hf_ieee80211_tag_ric_data_status_code,
30413      {"Status Code", "wlan.ric_data.status_code",
30414       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
30415       "Status of requested Resource", HFILL }},
30416
30417     /* OBSS IE: 802.11-2012: 8.4.2.61 */
30418     {&hf_ieee80211_tag_obss_spd,
30419      {"Scan Passive Dwell", "wlan.obss.spd",
30420       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30421
30422     {&hf_ieee80211_tag_obss_sad,
30423      {"Scan Active Dwell", "wlan.obss.sad",
30424       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30425
30426     {&hf_ieee80211_tag_obss_cwtsi,
30427      {"Channel Width Trigger Scan Interval", "wlan.obss.cwtsi",
30428       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30429
30430     {&hf_ieee80211_tag_obss_sptpc,
30431      {"Scan Passive Total Per Channel", "wlan.obss.sptpc",
30432       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30433
30434     {&hf_ieee80211_tag_obss_satpc,
30435      {"Scan Active Total Per Channel", "wlan.obss.satpc",
30436       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30437
30438     {&hf_ieee80211_tag_obss_wctdf,
30439      {"Width Channel Transition Delay Factor", "wlan.obss.wctdf",
30440       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30441
30442     {&hf_ieee80211_tag_obss_sat,
30443      {"Scan Activity Threshold", "wlan.obss.sat",
30444       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30445
30446     /* RIC Descriptor IE: 802.11-2012: 8.4.2.53 */
30447     {&hf_ieee80211_tag_ric_desc_rsrc_type,
30448      {"Resource Type", "wlan.ric_desc.rsrc_type",
30449       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
30450
30451     {&hf_ieee80211_tag_ric_desc_var_params,
30452      {"Variable Params", "wlan.ric_desc.var_params",
30453       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
30454
30455     /* MMIE */
30456     {&hf_ieee80211_tag_mmie_keyid,
30457      {"KeyID", "wlan.mmie.keyid",
30458       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30459
30460     {&hf_ieee80211_tag_mmie_ipn,
30461      {"IPN", "wlan.mmie.ipn",
30462       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
30463
30464     {&hf_ieee80211_tag_mmie_mic,
30465      {"MIC", "wlan.mmie.mic",
30466       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
30467
30468     /* WAPI Parameter Set*/
30469     {&hf_ieee80211_tag_wapi_param_set_version,
30470      {"Version", "wlan.wapi.version",
30471       FT_UINT16, BASE_DEC, NULL, 0,
30472       NULL, HFILL }},
30473
30474     {&hf_ieee80211_tag_wapi_param_set_akm_suite_count,
30475      {"AKM Suite Count", "wlan.wapi.akm_suite.count",
30476       FT_UINT16, BASE_DEC, NULL, 0,
30477       NULL, HFILL }},
30478
30479     {&hf_ieee80211_tag_wapi_param_set_akm_suite_oui,
30480      {"AKM Suite OUI", "wlan.wapi.akm_suite.oui",
30481       FT_UINT24, BASE_OUI, NULL, 0,
30482       NULL, HFILL }},
30483
30484     {&hf_ieee80211_tag_wapi_param_set_akm_suite_type,
30485      {"AKM Suite Type", "wlan.wapi.akm_suite.type",
30486       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_suite_type) , 0,
30487       NULL, HFILL }},
30488
30489     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
30490      {"Unicast Cipher Suite Count", "wlan.wapi.unicast_cipher.suite.count",
30491       FT_UINT16, BASE_DEC, NULL, 0,
30492       NULL, HFILL }},
30493
30494     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui,
30495      {"Unicast Cipher Suite OUI", "wlan.wapi.unicast_cipher.suite.oui",
30496       FT_UINT24, BASE_OUI, NULL, 0,
30497       NULL, HFILL }},
30498
30499     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type,
30500      {"Unicast Cipher Suite Type", "wlan.wapi.unicast_cipher.suite.type",
30501       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
30502       NULL, HFILL }},
30503
30504     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui,
30505      {"Multicast Cipher Suite OUI", "wlan.wapi.multicast_cipher.suite.oui",
30506       FT_UINT24, BASE_OUI, NULL, 0,
30507       NULL, HFILL }},
30508
30509     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type,
30510      {"Multicast Cipher Suite Type", "wlan.wapi.multicast_cipher.suite.type",
30511       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
30512       NULL, HFILL }},
30513
30514     {&hf_ieee80211_tag_wapi_param_set_capab,
30515      {"WAPI Capability Info", "wlan.wapi.capab",
30516       FT_UINT16, BASE_HEX, NULL, 0,
30517       NULL, HFILL }},
30518
30519     {&hf_ieee80211_tag_wapi_param_set_capab_preauth,
30520      {"Supports Preauthentication?", "wlan.wapi.capab.preauth",
30521       FT_BOOLEAN, 16 , NULL, 0x0001,
30522       NULL, HFILL }},
30523
30524     {&hf_ieee80211_tag_wapi_param_set_capab_rsvd,
30525      {"Reserved", "wlan.wapi.capab.rsvd",
30526       FT_UINT16, BASE_DEC , NULL, 0xFFFE,
30527       NULL, HFILL }},
30528
30529     {&hf_ieee80211_tag_wapi_param_set_bkid_count,
30530      {"No of BKID's", "wlan.wapi.bkid.count",
30531       FT_UINT16, BASE_DEC, NULL, 0,
30532       NULL, HFILL }},
30533
30534     {&hf_ieee80211_tag_wapi_param_set_bkid_list,
30535      {"BKID", "wlan.wapi.bkid",
30536       FT_BYTES, BASE_NONE, NULL, 0,
30537       NULL, HFILL }},
30538
30539     /* BSS Max Idle Period */
30540     {&hf_ieee80211_tag_bss_max_idle_period,
30541      {"BSS Max Idle Period (1000 TUs)", "wlan.bss_max_idle.period",
30542       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30543
30544     {&hf_ieee80211_tag_bss_max_idle_options_protected,
30545      {"BSS Max Idle Period Options: Protected Keep-Alive Required",
30546       "wlan.bss_max_idle.options.protected",
30547       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
30548
30549     /* TFS Request */
30550     {&hf_ieee80211_tag_tfs_request_id,
30551      {"TFS ID", "wlan.tfs_request.id",
30552       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
30553
30554     {&hf_ieee80211_tag_tfs_request_ac_delete_after_match,
30555      {"TFS Action Code - Delete after match",
30556       "wlan.tfs_request.action_code.delete_after_match",
30557       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
30558
30559     {&hf_ieee80211_tag_tfs_request_ac_notify,
30560      {"TFS Action Code - Notify",
30561       "wlan.tfs_request.action_code.notify",
30562       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
30563
30564     {&hf_ieee80211_tag_tfs_request_subelem_id,
30565      {"Subelement ID", "wlan.tfs_request.subelem.id",
30566       FT_UINT8, BASE_DEC, VALS(tfs_request_subelem_ids), 0,
30567       "TFS Request Subelement ID", HFILL }},
30568
30569     {&hf_ieee80211_tag_tfs_request_subelem_len,
30570      {"Length", "wlan.tfs_request.subelem.len",
30571       FT_UINT8, BASE_DEC, NULL, 0,
30572       "TFS Request Subelement Length", HFILL }},
30573
30574     {&hf_ieee80211_tag_tfs_request_subelem,
30575      {"Subelement Data", "wlan.tfs_request.subelem",
30576       FT_BYTES, BASE_NONE, NULL, 0,
30577       "TFS Request Subelement Data", HFILL }},
30578
30579     /* TFS Response */
30580     {&hf_ieee80211_tag_tfs_response_subelem_id,
30581      {"Subelement ID", "wlan.tfs_response.subelem.id",
30582       FT_UINT8, BASE_DEC, VALS(tfs_response_subelem_ids), 0,
30583       "TFS Response Subelement ID", HFILL }},
30584
30585     {&hf_ieee80211_tag_tfs_response_subelem_len,
30586      {"Length", "wlan.tfs_response.subelem.len",
30587       FT_UINT8, BASE_DEC, NULL, 0,
30588       "TFS Response Subelement Length", HFILL }},
30589
30590     {&hf_ieee80211_tag_tfs_response_subelem,
30591      {"Subelement Data", "wlan.tfs_response.subelem",
30592       FT_BYTES, BASE_NONE, NULL, 0,
30593       "TFS Response Subelement Data", HFILL }},
30594
30595     {&hf_ieee80211_tag_tfs_response_status,
30596      {"TFS Response Status", "wlan.tfs_response.status",
30597       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
30598
30599     {&hf_ieee80211_tag_tfs_response_id,
30600      {"TFS ID", "wlan.tfs_response.tfs_id",
30601       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
30602
30603     /* WNM-Sleep Mode */
30604     {&hf_ieee80211_tag_wnm_sleep_mode_action_type,
30605      {"Action Type", "wlan.wnm_sleep_mode.action_type",
30606       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_action_types), 0,
30607       "WNM-Sleep Mode Action Type", HFILL }},
30608
30609     {&hf_ieee80211_tag_wnm_sleep_mode_response_status,
30610      {"WNM-Sleep Mode Response Status",
30611       "wlan.wnm_sleep_mode.response_status",
30612       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_response_status_vals), 0, NULL,
30613       HFILL }},
30614
30615     {&hf_ieee80211_tag_wnm_sleep_mode_interval,
30616      {"WNM-Sleep Interval", "wlan.wnm_sleep_mode.interval",
30617       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
30618
30619     /* Time Advertisement */
30620     {&hf_ieee80211_tag_time_adv_timing_capab,
30621      {"Timing capabilities", "wlan.time_adv.timing_capab",
30622       FT_UINT8, BASE_DEC, VALS(time_adv_timing_capab_vals), 0,
30623       NULL, HFILL }},
30624
30625     {&hf_ieee80211_tag_time_adv_time_value,
30626      {"Time Value", "wlan.time_adv.time_value",
30627       FT_BYTES, BASE_NONE, NULL, 0,
30628       NULL, HFILL }},
30629
30630     {&hf_ieee80211_tag_time_adv_time_value_year,
30631      {"Time Value: Year", "wlan.time_adv.time_value.year",
30632       FT_UINT16, BASE_DEC, NULL, 0,
30633       NULL, HFILL }},
30634
30635     {&hf_ieee80211_tag_time_adv_time_value_month,
30636      {"Time Value: Month", "wlan.time_adv.time_value.month",
30637       FT_UINT8, BASE_DEC, NULL, 0,
30638       NULL, HFILL }},
30639
30640     {&hf_ieee80211_tag_time_adv_time_value_day,
30641      {"Time Value: Day", "wlan.time_adv.time_value.month",
30642       FT_UINT8, BASE_DEC, NULL, 0,
30643       NULL, HFILL }},
30644
30645     {&hf_ieee80211_tag_time_adv_time_value_hours,
30646      {"Time Value: Hours", "wlan.time_adv.time_value.hours",
30647       FT_UINT8, BASE_DEC, NULL, 0,
30648       NULL, HFILL }},
30649
30650     {&hf_ieee80211_tag_time_adv_time_value_minutes,
30651      {"Time Value: Minutes", "wlan.time_adv.time_value.minutes",
30652       FT_UINT8, BASE_DEC, NULL, 0,
30653       NULL, HFILL }},
30654
30655     {&hf_ieee80211_tag_time_adv_time_value_seconds,
30656      {"Time Value: Seconds", "wlan.time_adv.time_value.seconds",
30657       FT_UINT8, BASE_DEC, NULL, 0,
30658       NULL, HFILL }},
30659
30660     {&hf_ieee80211_tag_time_adv_time_value_milliseconds,
30661      {"Time Value: Milliseconds", "wlan.time_adv.time_value.milliseconds",
30662       FT_UINT16, BASE_DEC, NULL, 0,
30663       NULL, HFILL }},
30664
30665     {&hf_ieee80211_tag_time_adv_time_value_reserved,
30666      {"Time Value: Reserved", "wlan.time_adv.time_value.reserved",
30667       FT_UINT8, BASE_DEC, NULL, 0,
30668       NULL, HFILL }},
30669
30670     {&hf_ieee80211_tag_time_adv_time_error,
30671      {"Time Error", "wlan.time_adv.time_error",
30672       FT_BYTES, BASE_NONE, NULL, 0,
30673       NULL, HFILL }},
30674
30675     {&hf_ieee80211_tag_time_adv_time_update_counter,
30676      {"Time Update Counter", "wlan.time_adv.time_update_counter",
30677       FT_UINT8, BASE_DEC, NULL, 0,
30678       NULL, HFILL }},
30679
30680     /* Time Zone */
30681     {&hf_ieee80211_tag_time_zone,
30682      {"Time Zone", "wlan.time_zone",
30683       FT_STRING, BASE_NONE, NULL, 0,
30684       NULL, HFILL }},
30685
30686     /* Interworking */
30687     {&hf_ieee80211_tag_interworking_access_network_type,
30688      {"Access Network Type", "wlan.interworking.access_network_type",
30689       FT_UINT8, BASE_DEC, VALS(access_network_type_vals), 0x0f,
30690       NULL, HFILL }},
30691
30692     {&hf_ieee80211_tag_interworking_internet,
30693      {"Internet", "wlan.interworking.internet",
30694       FT_UINT8, BASE_DEC, NULL, 0x10,
30695       NULL, HFILL }},
30696
30697     {&hf_ieee80211_tag_interworking_asra,
30698      {"ASRA", "wlan.interworking.asra",
30699       FT_UINT8, BASE_DEC, NULL, 0x20,
30700       "Additional Step Required for Access", HFILL }},
30701
30702     {&hf_ieee80211_tag_interworking_esr,
30703      {"ESR", "wlan.interworking.esr",
30704       FT_UINT8, BASE_DEC, NULL, 0x40,
30705       "Emergency services reachable", HFILL }},
30706
30707     {&hf_ieee80211_tag_interworking_uesa,
30708      {"UESA", "wlan.interworking.uesa",
30709       FT_UINT8, BASE_DEC, NULL, 0x80,
30710       "Unauthenticated emergency service accessible", HFILL }},
30711
30712     {&hf_ieee80211_tag_interworking_hessid,
30713      {"HESSID", "wlan.interworking.hessid",
30714       FT_ETHER, BASE_NONE, NULL, 0,
30715       "Homogeneous ESS identifier", HFILL }},
30716
30717     /* QoS Map Set element */
30718     {&hf_ieee80211_tag_qos_map_set_dscp_exc,
30719      {"DSCP Exception", "wlan.qos_map_set.dscp_exception",
30720       FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
30721
30722     {&hf_ieee80211_tag_qos_map_set_dscp_exc_val,
30723      {"DSCP Value", "wlan.qos_map_set.dscp_value",
30724       FT_UINT8, BASE_DEC, NULL, 0,
30725       "DSCP Exception - DSCP Value", HFILL }},
30726
30727     {&hf_ieee80211_tag_qos_map_set_dscp_exc_up,
30728      {"User Priority", "wlan.qos_map_set.up",
30729       FT_UINT8, BASE_DEC, NULL, 0,
30730       "DSCP Exception - User Priority", HFILL }},
30731
30732     {&hf_ieee80211_tag_qos_map_set_range,
30733      {"DSCP Range description", "wlan.qos_map_set.range",
30734       FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
30735
30736     {&hf_ieee80211_tag_qos_map_set_low,
30737      {"DSCP Low Value", "wlan.qos_map_set.dscp_low_value",
30738       FT_UINT8, BASE_DEC, NULL, 0,
30739       "DSCP Range description - DSCP Low Value", HFILL }},
30740
30741     {&hf_ieee80211_tag_qos_map_set_high,
30742      {"DSCP High Value", "wlan.qos_map_set.dscp_high_value",
30743       FT_UINT8, BASE_DEC, NULL, 0,
30744       "DSCP Range description - DSCP High Value", HFILL }},
30745
30746     /* Advertisement Protocol */
30747     {&hf_ieee80211_tag_adv_proto_resp_len_limit,
30748      {"Query Response Length Limit", "wlan.adv_proto.resp_len_limit",
30749       FT_UINT8, BASE_DEC, NULL, 0x7f,
30750       NULL, HFILL }},
30751
30752     {&hf_ieee80211_tag_adv_proto_pame_bi,
30753      {"PAME-BI", "wlan.adv_proto.pame_bi",
30754       FT_UINT8, BASE_DEC, NULL, 0x80,
30755       "Pre-Association Message Xchange BSSID Independent (PAME-BI)", HFILL }},
30756
30757     {&hf_ieee80211_tag_adv_proto_id,
30758      {"Advertisement Protocol ID", "wlan.adv_proto.id",
30759       FT_UINT8, BASE_DEC, VALS(adv_proto_id_vals), 0,
30760       NULL, HFILL }},
30761
30762     {&hf_ieee80211_tag_adv_vs_len,
30763      {"Advertisement Protocol Vendor Specific length", "wlan.adv_proto.vs_len",
30764       FT_UINT8, BASE_DEC, NULL, 0,
30765       NULL, HFILL}},
30766 #if 0
30767     {&hf_ieee80211_tag_adv_proto_vs_info,
30768      {"Advertisement Protocol Vendor Specific info", "wlan.adv_proto.vs_info",
30769       FT_NONE, BASE_NONE, NULL, 0,
30770       NULL, HFILL }},
30771 #endif
30772
30773     /* Roaming Consortium */
30774     {&hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
30775      {"Number of ANQP OIs", "wlan.roaming_consortium.num_anqp_oi",
30776       FT_UINT8, BASE_DEC, NULL, 0,
30777       NULL, HFILL }},
30778
30779     {&hf_ieee80211_tag_roaming_consortium_oi1_len,
30780      {"OI #1 Length", "wlan.roaming_consortium.oi1_len",
30781       FT_UINT8, BASE_DEC, NULL, 0x0f,
30782       NULL, HFILL }},
30783
30784     {&hf_ieee80211_tag_roaming_consortium_oi2_len,
30785      {"OI #2 Length", "wlan.roaming_consortium.oi2_len",
30786       FT_UINT8, BASE_DEC, NULL, 0xf0,
30787       NULL, HFILL }},
30788
30789     {&hf_ieee80211_tag_roaming_consortium_oi1,
30790      {"OI #1", "wlan.roaming_consortium.oi1",
30791       FT_BYTES, BASE_NONE, NULL, 0,
30792       NULL, HFILL }},
30793
30794     {&hf_ieee80211_tag_roaming_consortium_oi2,
30795      {"OI #2", "wlan.roaming_consortium.oi2",
30796       FT_BYTES, BASE_NONE, NULL, 0,
30797       NULL, HFILL }},
30798
30799     {&hf_ieee80211_tag_roaming_consortium_oi3,
30800      {"OI #3", "wlan.roaming_consortium.oi3",
30801       FT_BYTES, BASE_NONE, NULL, 0,
30802       NULL, HFILL }},
30803
30804     /* Timeout Interval */
30805     {&hf_ieee80211_tag_timeout_int_type,
30806      {"Timeout Interval Type", "wlan.timeout_int.type",
30807       FT_UINT8, BASE_DEC, VALS(timeout_int_types), 0,
30808       NULL, HFILL }},
30809
30810     {&hf_ieee80211_tag_timeout_int_value,
30811      {"Timeout Interval Value", "wlan.timeout_int.value",
30812       FT_UINT32, BASE_DEC, NULL, 0,
30813       NULL, HFILL }},
30814
30815     /* Link Identifier */
30816     {&hf_ieee80211_tag_link_id_bssid,
30817      {"BSSID", "wlan.link_id.bssid",
30818       FT_ETHER, BASE_NONE, NULL, 0,
30819       NULL, HFILL }},
30820
30821     {&hf_ieee80211_tag_link_id_init_sta,
30822      {"TDLS initiator STA Address", "wlan.link_id.init_sta",
30823       FT_ETHER, BASE_NONE, NULL, 0,
30824       NULL, HFILL }},
30825
30826     {&hf_ieee80211_tag_link_id_resp_sta,
30827      {"TDLS responder STA Address", "wlan.link_id.resp_sta",
30828       FT_ETHER, BASE_NONE, NULL, 0,
30829       NULL, HFILL }},
30830
30831     /* Wakeup Schedule */
30832     {&hf_ieee80211_tag_wakeup_schedule_offset,
30833      {"Offset", "wlan.wakeup_schedule.offset",
30834       FT_UINT32, BASE_DEC, NULL, 0,
30835       NULL, HFILL }},
30836
30837     {&hf_ieee80211_tag_wakeup_schedule_interval,
30838      {"Interval", "wlan.wakeup_schedule.interval",
30839       FT_UINT32, BASE_DEC, NULL, 0,
30840       NULL, HFILL }},
30841
30842     {&hf_ieee80211_tag_wakeup_schedule_awake_window_slots,
30843      {"Awake Window Slots", "wlan.wakeup_schedule.awake_window_slots",
30844       FT_UINT32, BASE_DEC, NULL, 0,
30845       NULL, HFILL }},
30846
30847     {&hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
30848      {"Maximum Awake Window Duration", "wlan.wakeup_schedule.max_awake_dur",
30849       FT_UINT32, BASE_DEC, NULL, 0,
30850       NULL, HFILL }},
30851
30852     {&hf_ieee80211_tag_wakeup_schedule_idle_count,
30853      {"Idle Count", "wlan.wakeup_schedule.idle_count",
30854       FT_UINT16, BASE_DEC, NULL, 0,
30855       NULL, HFILL }},
30856
30857     /* Channel Switch Timing */
30858     {&hf_ieee80211_tag_channel_switch_timing_switch_time,
30859      {"Switch Time", "wlan.channel_switch_timing.switch_time",
30860       FT_UINT16, BASE_DEC, NULL, 0,
30861       NULL, HFILL }},
30862
30863     {&hf_ieee80211_tag_channel_switch_timing_switch_timeout,
30864      {"Switch Timeout", "wlan.channel_switch_timing.switch_timeout",
30865       FT_UINT16, BASE_DEC, NULL, 0,
30866       NULL, HFILL }},
30867
30868     /* PTI Control */
30869     {&hf_ieee80211_tag_pti_control_tid,
30870      {"TID", "wlan.pti_control.tid",
30871       FT_UINT8, BASE_DEC, NULL, 0,
30872       NULL, HFILL }},
30873
30874     {&hf_ieee80211_tag_pti_control_sequence_control,
30875      {"Sequence Control", "wlan.pti_control.sequence_control",
30876       FT_UINT16, BASE_HEX, NULL, 0,
30877       NULL, HFILL }},
30878
30879     /* PU Buffer Status */
30880     {&hf_ieee80211_tag_pu_buffer_status_ac_bk,
30881      {"AC_BK traffic available", "wlan.pu_buffer_status.ac_bk",
30882       FT_UINT8, BASE_DEC, NULL, 0x01,
30883       NULL, HFILL }},
30884
30885     {&hf_ieee80211_tag_pu_buffer_status_ac_be,
30886      {"AC_BE traffic available", "wlan.pu_buffer_status.ac_be",
30887       FT_UINT8, BASE_DEC, NULL, 0x02,
30888       NULL, HFILL }},
30889
30890     {&hf_ieee80211_tag_pu_buffer_status_ac_vi,
30891      {"AC_VI traffic available", "wlan.pu_buffer_status.ac_vi",
30892       FT_UINT8, BASE_DEC, NULL, 0x04,
30893       NULL, HFILL }},
30894
30895     {&hf_ieee80211_tag_pu_buffer_status_ac_vo,
30896      {"AC_VO traffic available", "wlan.pu_buffer_status.ac_vo",
30897       FT_UINT8, BASE_DEC, NULL, 0x08,
30898       NULL, HFILL }},
30899
30900     {&hf_ieee80211_mysterious_olpc_stuff,
30901      {"Mysterious OLPC stuff", "wlan.mysterious_olpc_stuff",
30902       FT_NONE, BASE_NONE, NULL, 0x0,
30903       NULL, HFILL }},
30904
30905     {&hf_ieee80211_estimated_service_params,
30906      {"Estimated Service Parameters", "wlan.ext_tag.estimated_service_params",
30907       FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
30908
30909     {&hf_ieee80211_esp_access_category,
30910      {"Access Category", "wlan.ext_tag.estimated_service_params.access_category",
30911       FT_UINT24, BASE_DEC, VALS(esp_access_category_vals), 0x000003,
30912        NULL, HFILL }},
30913
30914     {&hf_ieee80211_esp_reserved,
30915      {"Reserved", "wlan.ext_tag.estimated_service_params.reserved",
30916       FT_UINT24, BASE_HEX, NULL, 0x000004, NULL, HFILL }},
30917
30918     {&hf_ieee80211_esp_data_format,
30919      {"Data Format", "wlan.ext_tag.estimated_service_params.data_format",
30920       FT_UINT24, BASE_DEC, VALS(esp_data_format_vals), 0x000018,
30921        NULL, HFILL }},
30922
30923     {&hf_ieee80211_esp_ba_windows_size,
30924      {"BA Window Size", "wlan.ext_tag.estimated_service_params.ba_window_size",
30925       FT_UINT24, BASE_DEC, VALS(esp_ba_window_size_vals), 0x0000E0,
30926        NULL, HFILL }},
30927
30928     {&hf_ieee80211_esp_est_air_time_frac,
30929      {"Estimated Air Time Fraction", "wlan.ext_tag.estimated_service_params.air_time_frac",
30930       FT_UINT24, BASE_DEC, NULL, 0x00FF00, NULL, HFILL }},
30931
30932     {&hf_ieee80211_esp_data_ppdu_duration_target,
30933      {"Data PPDU Duration Target", "wlan.ext_tag.estimated_service_params.data_ppdu_dur_target",
30934       FT_UINT24, BASE_DEC, NULL, 0x00FF00, NULL, HFILL }},
30935
30936     {&hf_ieee80211_fcg_new_channel_number,
30937      {"New Channel Number", "wlan.ext_tag.future_channel_guidance.new_chan_num",
30938       FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
30939
30940     {&hf_ieee80211_fcg_extra_info,
30941      {"Extra bytes", "wlan.ext_tag.future_channel_guidance.extra_bytes",
30942       FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
30943
30944     {&hf_ieee80211_ext_tag,
30945      {"Ext Tag", "wlan.ext_tag",
30946       FT_NONE, BASE_NONE, 0x0, 0,
30947       NULL, HFILL }},
30948
30949     {&hf_ieee80211_ext_tag_number,
30950      {"Ext Tag Number", "wlan.ext_tag.number",
30951       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_eid_ext_ext, 0,
30952       "Element ID", HFILL }},
30953
30954     {&hf_ieee80211_ext_tag_length,
30955      {"Ext Tag length", "wlan.ext_tag.length",
30956       FT_UINT32, BASE_DEC, NULL, 0,
30957       "Length of tag", HFILL }},
30958
30959     {&hf_ieee80211_fils_session,
30960      {"FILS Session", "wlan.ext_tag.fils.session",
30961       FT_BYTES, BASE_NONE, NULL, 0x0,
30962       NULL, HFILL }},
30963
30964     {&hf_ieee80211_fils_wrapped_data,
30965      {"FILS Wrapped Data", "wlan.ext_tag.fils.wrapped_data",
30966       FT_BYTES, BASE_NONE, NULL, 0x0,
30967       NULL, HFILL }},
30968
30969     {&hf_ieee80211_fils_nonce,
30970      {"FILS Nonce", "wlan.ext_tag.fils.nonce",
30971       FT_BYTES, BASE_NONE, NULL, 0x0,
30972       NULL, HFILL }},
30973
30974     {&hf_he_mac_capabilities,
30975      {"HE MAC Capabilities Information", "wlan.ext_tag.he_mac_caps",
30976       FT_UINT40, BASE_HEX, NULL, 0x0, NULL, HFILL }},
30977
30978     {&hf_he_htc_he_support,
30979      {"+HTC HE Support", "wlan.ext_tag.he_mac_cap.htc_he_support",
30980       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000001,
30981       NULL, HFILL }},
30982
30983     {&hf_he_twt_requester_support,
30984      {"TWT Requester Support", "wlan.ext_tag.he_mac_cap.twt_req_support",
30985       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000002,
30986       NULL, HFILL }},
30987
30988     {&hf_he_twt_responder_support,
30989      {"TWT Responder Support", "wlan.ext_tag.he_mac_cap.twt_rsp_support",
30990       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000004,
30991       NULL, HFILL }},
30992
30993     {&hf_he_fragmentation_support,
30994      {"Fragmentation Support", "wlan.ext_tag.he_mac_cap.fragmentation_support",
30995       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
30996       VALS64(he_fragmentation_support_vals), 0x0000000018,
30997       NULL, HFILL }},
30998
30999     {&hf_he_max_number_fragmented_msdus,
31000      {"Maximum Number of Fragmented MSDUs", "wlan.ext_tag.he_mac_cap.max_frag_msdus",
31001       FT_UINT40, BASE_DEC, NULL, 0x00000000E0,
31002       NULL, HFILL }},
31003
31004     {&hf_he_min_fragment_size,
31005      {"Minimum Fragment Size", "wlan.ext_tag.he_mac_cap.min_frag_size",
31006       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
31007       VALS64(he_minimum_fragmentation_size_vals), 0x0000000300,
31008       NULL, HFILL }},
31009
31010     {&hf_he_trigger_frame_mac_padding_dur,
31011      {"Trigger Frame MAC Padding Duration", "wlan.ext_tag.he_mac_cap.trig_frm_mac_padding_dur",
31012       FT_UINT40, BASE_DEC, NULL, 0x0000000C00, NULL, HFILL }},
31013
31014     {&hf_he_multi_tid_aggregation_support,
31015      {"Multi-TID Aggregation Support", "wlan.ext_tag.he_mac_cap.multi_tid_agg_support",
31016       FT_UINT40, BASE_DEC, NULL, 0x0000007000, NULL, HFILL }},
31017
31018     {&hf_he_he_link_adaptation_support,
31019      {"HE Link Adaptation Support", "wlan.ext_tag.he_mac_cap.he_link_adaptation_support",
31020       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
31021       VALS64(he_link_adaptation_support_vals), 0x0000018000,
31022       NULL, HFILL }},
31023
31024     {&hf_he_all_ack_support,
31025      {"All Ack Support", "wlan.ext_tag.he_mac_cap.all_ack_support",
31026       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000020000,
31027       NULL, HFILL }},
31028
31029     {&hf_he_umrs_support,
31030      {"UMRS Support", "wlan.ext_tag.he_mac_cap.umrs_support",
31031       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000040000,
31032       NULL, HFILL }},
31033
31034     {&hf_he_bsr_support,
31035      {"BSR Support", "wlan.ext_tag.he_mac_cap.bsr_support",
31036       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000080000,
31037       NULL, HFILL }},
31038
31039     {&hf_he_broadcast_twt_support,
31040      {"Broadcast TWT Support", "wlan.ext_tag.he_mac_cap.broadcast_twt_support",
31041       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000100000,
31042       NULL, HFILL }},
31043
31044     {&hf_he_32_bit_ba_bitmap_support,
31045      {"32-bit BA Bitmap Support", "wlan.ext_tag.he_mac_cap.32_bit_ba_bitmap_support",
31046       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000200000,
31047       NULL, HFILL }},
31048
31049     {&hf_he_mu_cascading_support,
31050      {"MU Cascading Support", "wlan.ext_tag.he_mac_cap.mu_cascading_support",
31051       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000400000,
31052       NULL, HFILL }},
31053
31054     {&hf_he_ack_enabled_aggregation_support,
31055      {"Ack-Enabled Aggregation Support", "wlan.ext_tag.he_mac_cap.ack_enabled_agg_support",
31056       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000800000,
31057       NULL, HFILL }},
31058
31059     {&hf_he_group_addressed_multi_sta_blkack_support,
31060      {"Group Addressed Multi-STA BlockAck in DL MU Support", "wlan.ext_tag.he_mac_cap.i_give_up",
31061       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0001000000,
31062       NULL, HFILL }},
31063
31064     {&hf_he_om_control_support,
31065      {"OM Control Support", "wlan.ext_tag.he_mac_cap.om_control_support",
31066       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0002000000,
31067       NULL, HFILL }},
31068
31069     {&hf_he_ofdma_ra_support,
31070      {"OFDMA RA Support", "wlan.ext_tag.he_mac_cap.ofdma_ra_support",
31071       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0004000000,
31072       NULL, HFILL }},
31073
31074     {&hf_he_max_a_mpdu_length_exponent,
31075      {"Maximum A-MPDU Length Exponent", "wlan.ext_tag.he_mac_cap.max_a_mpdu_len_exp",
31076       FT_UINT40, BASE_DEC, NULL, 0x0018000000, NULL, HFILL }},
31077
31078     {&hf_he_a_msdu_fragmentation_support,
31079      {"A-MSDU Fragmentation Support", "wlan.ext_tag.he_mac_cap.a_msdu_frag_support",
31080       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0020000000,
31081       NULL, HFILL }},
31082
31083     {&hf_he_flexible_twt_schedule_support,
31084      {"Flexible TWT Schedule Support", "wlan.ext_tag.he_mac_cap.flexible_twt_sched_support",
31085       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0040000000,
31086       NULL, HFILL }},
31087
31088     {&hf_he_rx_control_frame_to_multibss,
31089      {"Rx Control Frame to MultiBSS", "wlan.ext_tag.he_mac_cap.rx_ctl_frm_multibss",
31090       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0080000000,
31091       NULL, HFILL }},
31092
31093     {&hf_he_bsrp_bqrp_a_mpdu_aggregation,
31094      {"BSRP BQRP A-MPDU Aggregation", "wlan.ext_tag.he_mac_cap.bsrp_bqrp_a_mpdu_agg",
31095       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0100000000,
31096       NULL, HFILL }},
31097
31098     {&hf_he_qtp_support,
31099      {"QTP Support", "wlan.ext_tag.he_mac_cap.qtp_support",
31100       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0200000000,
31101       NULL, HFILL }},
31102
31103     {&hf_he_bqr_support,
31104      {"BQR Support", "wlan.ext_tag.he_mac_cap.bqr_support",
31105       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0400000000,
31106       NULL, HFILL }},
31107
31108     {&hf_he_sr_responder,
31109      {"SR Responder Role", "wlan.ext_tag.he_mac_cap.sr_responder",
31110       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0800000000,
31111       NULL, HFILL }},
31112
31113     {&hf_he_ndp_feedback_report_support,
31114      {"NDP Feedback Report Support", "wlan.ext_tag.he_mac_cap.ndp_feedback_report_support",
31115       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x1000000000,
31116       NULL, HFILL }},
31117
31118     {&hf_he_ops_support,
31119      {"OPS Support", "wlan.ext_tag.he_mac_cap.ops_support",
31120       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x2000000000,
31121       NULL, HFILL }},
31122
31123     {&hf_he_a_msdu_in_a_mpdu_support,
31124      {"A-MSDU in A-MPDU Support", "wlan.ext_tag.he_mac_cap.a_msdu_in_a_mpdu_support",
31125       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x4000000000,
31126       NULL, HFILL }},
31127
31128     {&hf_he_reserved,
31129      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_39",
31130       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
31131
31132     {&hf_he_reserved_bits_5_7,
31133      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_5_7",
31134       FT_UINT40, BASE_HEX, NULL, 0x00000000E0, NULL, HFILL }},
31135
31136     {&hf_he_reserved_bits_8_9,
31137      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_8_9",
31138       FT_UINT40, BASE_HEX, NULL, 0x0000000300, NULL, HFILL }},
31139
31140     {&hf_he_reserved_bits_15_16,
31141      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_15_16",
31142       FT_UINT40, BASE_HEX, NULL, 0x0000018000, NULL, HFILL }},
31143
31144     {&hf_he_reserved_bit_18,
31145      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_18",
31146       FT_UINT40, BASE_HEX, NULL, 0x0000040000, NULL, HFILL }},
31147
31148     {&hf_he_reserved_bit_19,
31149      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_19",
31150       FT_UINT40, BASE_HEX, NULL, 0x0000080000, NULL, HFILL }},
31151
31152     {&hf_he_reserved_bit_25,
31153      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_25",
31154       FT_UINT40, BASE_HEX, NULL, 0x0002000000, NULL, HFILL }},
31155
31156     {&hf_he_phy_dual_band_support,
31157      {"Dual Band Support", "wlan.ext_tag.he_phy_cap.fbytes",
31158       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
31159
31160     {&hf_he_phy_cap_dual_band_support,
31161      {"Dual Band Support", "wlan.ext_tag.he_phy_cap.fbyte.dbs",
31162       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
31163       NULL, HFILL }},
31164
31165     {&hf_he_phy_chan_width_set,
31166      {"Channel Width Set", "wlan.ext_tag.he_phy_cap.fbytes",
31167       FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL }},
31168
31169     {&hf_he_40mhz_channel_2_4ghz,
31170      {"40MHz in 2.4GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.40mhz_in_2_4ghz",
31171       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }},
31172
31173     {&hf_he_40_and_80_mhz_5ghz,
31174      {"40 & 80MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.40_80_in_5ghz",
31175       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL }},
31176
31177     {&hf_he_160_mhz_5ghz,
31178      {"160MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.160_in_5ghz",
31179       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08, NULL, HFILL }},
31180
31181     {&hf_he_160_80_plus_80_mhz_5ghz,
31182      {"160/80+80MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.160_80_80_in_5ghz",
31183       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10, NULL, HFILL }},
31184
31185     {&hf_he_242_tone_rus_in_2_4ghz,
31186      {"242 tone RUs in the 2.4GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.242_tone_in_2_4ghz",
31187       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20, NULL, HFILL }},
31188
31189     {&hf_he_242_tone_rus_in_5ghz,
31190      {"242 tone RUs in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.242_tone_in_5ghz",
31191       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40, NULL, HFILL }},
31192
31193     {&hf_he_chan_width_reserved,
31194      {"Reserved", "wlan.ext_tag.he_phy_cap.chan_width_set.reserved",
31195       FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }},
31196
31197     {&hf_he_phy_b8_to_b23,
31198      {"Bits 8 to 23", "wlan.ext_tag.he_phy_cap.bits_8_to_23",
31199       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31200
31201     {&hf_he_phy_cap_punctured_preamble_rx,
31202      {"Punctured Preamble RX", "wlan.ext_tag.he_phy_cap.nbytes.punc_preamble_rx",
31203       FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL }},
31204
31205     {&hf_he_phy_cap_device_class,
31206      {"Device Class", "wlan.ext_tag.he_phy_cap.nbytes.device_class",
31207       FT_UINT16, BASE_HEX, NULL, 0x0010, NULL, HFILL }},
31208
31209     {&hf_he_phy_cap_ldpc_coding_in_payload,
31210      {"LDPC Coding In Payload", "wlan.ext_tag.he_phy_cap.nbytes.ldpc_coding_in_payload",
31211       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0020, NULL, HFILL }},
31212
31213     {&hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us,
31214      {"HE SU PPDU With 1x HE-LTF and 0.8us GI",
31215       "wlan.ext_tag.he_phy_cap.nbytes.he_su_ppdu_with_1x_he_ltf_08us",
31216       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
31217
31218     {&hf_he_phy_cap_midamble_rx_max_nsts,
31219      {"Midamble Rx Max NSTS", "wlan.ext_tag.he_phy_cap.mbytes.midamble_rx_max_nsts",
31220       FT_UINT16, BASE_HEX, NULL, 0x0180, NULL, HFILL }},
31221
31222     {&hf_he_phy_cap_ndp_with_4x_he_ltf_32us,
31223      {"NDP With 4x HE-LTF and 3.2us GI",
31224       "wlan.ext_tag.he_phy_cap.nbytes.ndp_with_4x_he_ltf_4x_3.2us",
31225       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
31226
31227     {&hf_he_phy_cap_stbc_tx_lt_80mhz,
31228      {"STBC Tx <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_tx_lt_80mhz",
31229       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
31230
31231     {&hf_he_phy_cap_stbc_rx_lt_80mhz,
31232      {"STBC Rx <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_rx_lt_80mhz",
31233       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
31234
31235     {&hf_he_phy_cap_doppler_tx,
31236      {"Doppler Tx", "wlan.ext_tag.he_phy_cap.nbytes.doppler_tx",
31237       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
31238
31239     {&hf_he_phy_cap_doppler_rx,
31240      {"Doppler Rx", "wlan.ext_tag.he_phy_cap.nbytes.doppler_rx",
31241       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
31242
31243     {&hf_he_phy_cap_full_bw_ul_mu_mimo,
31244      {"Full Bandwidth UL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.full_bw_ul_mu_mimo",
31245       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }},
31246
31247     {&hf_he_phy_cap_partial_bw_ul_mu_mimo,
31248      {"Partial Bandwidth UL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_ul_mu_mimo",
31249       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL }},
31250
31251     {&hf_he_phy_b24_to_b39,
31252      {"Bits 24 to 39", "wlan.ext_tag.he_phy_cap.bits_24_to_39",
31253       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31254
31255     {&hf_he_phy_cap_dcm_max_constellation_tx,
31256      {"DCM Max Constellation Tx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_const_tx",
31257       FT_UINT16, BASE_HEX, NULL, 0x0003, NULL, HFILL }},
31258
31259     {&hf_he_phy_cap_dcm_max_nss_tx,
31260      {"DCM Max NSS Tx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_nss_tx",
31261       FT_UINT16, BASE_HEX, NULL, 0x0004, NULL, HFILL }},
31262
31263     {&hf_he_phy_cap_dcm_max_constellation_rx,
31264      {"DCM Max Constellation Rx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_const_rx",
31265       FT_UINT16, BASE_HEX, NULL, 0x0018, NULL, HFILL }},
31266
31267     {&hf_he_phy_cap_dcm_max_nss_rx,
31268      {"DCM Max NSS Rx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_nss_tx",
31269       FT_UINT16, BASE_HEX, NULL, 0x0020, NULL, HFILL }},
31270
31271     {&hf_he_phy_cap_rx_he_muppdu_from_non_ap,
31272      {"Rx HE MU PPDU from Non-AP STA", "wlan.ext_tag.he_phy_cap.nbytes.rx_he_mu_ppdu",
31273       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
31274
31275     {&hf_he_phy_cap_su_beamformer,
31276      {"SU Beamformer", "wlan.ext_tag.he_phy_cap.nbytes.su_beamformer",
31277       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
31278
31279     {&hf_he_phy_cap_su_beamformee,
31280      {"SU Beamformee", "wlan.ext_tag.he_phy_cap.nbytes.su_beamformee",
31281       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
31282
31283     {&hf_he_phy_cap_mu_beamformer,
31284      {"MU Beamformer", "wlan.ext_tag.he_phy_cap.nbytes.mu_beamformer",
31285       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
31286
31287     {&hf_he_phy_cap_beamformer_sts_lte_80mhz,
31288      {"Beamformee STS <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.beamformee_sts_lte_80mhz",
31289       FT_UINT16, BASE_HEX, NULL, 0x1C00, NULL, HFILL }},
31290
31291     {&hf_he_phy_cap_beamformer_sts_gt_80mhz,
31292      {"Beamformee STS > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.beamformee_sts_gt_80mhz",
31293       FT_UINT16, BASE_HEX, NULL, 0xE000, NULL, HFILL }},
31294
31295     {&hf_he_phy_b40_to_b55,
31296      {"Bits 40 to 55", "wlan.ext_tag.he_phy_cap.bits_40_to_55",
31297       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31298
31299     {&hf_he_phy_cap_number_of_sounding_dims_lte_80,
31300      {"Number Of Sounding Dimensions <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.no_sounding_dims_lte_80",
31301       FT_UINT16, BASE_DEC, NULL, 0x0007, NULL, HFILL }},
31302
31303     {&hf_he_phy_cap_number_of_sounding_dims_gt_80,
31304      {"Number Of Sounding Dimensions > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.no_sounding_dims_gt_80",
31305       FT_UINT16, BASE_DEC, NULL, 0x0038, NULL, HFILL }},
31306
31307     {&hf_he_phy_cap_ng_eq_16_su_fb,
31308      {"Ng = 16 SU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.ng_eq_16_su_fb",
31309       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
31310
31311     {&hf_he_phy_cap_ng_eq_16_mu_fb,
31312      {"Ng = 16 MU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.ng_eq_16_mu_fb",
31313       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
31314
31315     {&hf_he_phy_cap_codebook_size_eq_4_2_fb,
31316      {"Codebook Size SU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.codebook_size_su_fb",
31317       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
31318
31319     {&hf_he_phy_cap_codebook_size_eq_7_5_fb,
31320      {"Codebook Size MU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.codebook_size_mu_fb",
31321       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
31322
31323     {&hf_he_phy_cap_triggered_su_beamforming_fb,
31324      {"Triggered SU Beamforming Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_su_bf_fb",
31325       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
31326
31327     {&hf_he_phy_cap_triggered_mu_beamforming_fb,
31328      {"Triggered MU Beamforming Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_mu_bf_fb",
31329       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
31330
31331     {&hf_he_phy_cap_triggered_cqi_fb,
31332      {"Triggered CQI Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_cqi_fb",
31333       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
31334
31335     {&hf_he_phy_cap_partial_bw_extended_range,
31336      {"Partial Bandwidth Extended Range", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_er",
31337       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
31338
31339     {&hf_he_phy_cap_partial_bw_dl_mu_mimo,
31340      {"Partial Bandwidth DL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_dl_mu_mimo",
31341       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }},
31342
31343     {&hf_he_phy_cap_ppe_threshold_present,
31344      {"PPE Threshold Present", "wlan.ext_tag.he_phy_cap.nbytes.ppe_thres_present",
31345       FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL }},
31346
31347     {&hf_he_phy_b56_to_b71,
31348      {"Bits 56 to 71", "wlan.ext_tag.he_phy_cap.bits_56_to_71",
31349       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31350
31351     {&hf_he_phy_cap_srp_based_sr_support,
31352      {"SRP-based SR Support", "wlan.ext_tag.he_phy_cap.nbytes.srp_based_sr_sup",
31353       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001, NULL, HFILL }},
31354
31355     {&hf_he_phy_cap_power_boost_factor_ar_support,
31356      {"Power Boost Factor ar Support", "wlan.ext_tag.he_phy_cap.nbytes.pwr_bst_factor_ar_sup",
31357       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002, NULL, HFILL }},
31358
31359     {&hf_he_phy_cap_he_su_ppdu_etc_gi,
31360      {"HE SU PPDU & HE MU PPDU w 4x HE-LTF & 0.8us GI", "wlan.ext_tag.he_phy_cap.nbytes.he_su_ppdu_etc_gi",
31361       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004, NULL, HFILL }},
31362
31363     {&hf_he_phy_cap_max_nc,
31364      {"Max Nc", "wlan.ext_tag.he_phy_cap.nbytes.max_nc",
31365       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0038, NULL, HFILL }},
31366
31367     {&hf_he_phy_cap_stbc_tx_gt_80_mhz,
31368      {"STBC Tx > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_tx_gt_80_mhz",
31369       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
31370
31371     {&hf_he_phy_cap_stbc_rx_gt_80_mhz,
31372      {"STBC Rx > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_rx_gt_80_mhz",
31373       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
31374
31375     {&hf_he_phy_cap_he_er_su_ppdu_4xxx_gi,
31376      {"HE ER SU PPDU W 4x HE-LTF & 0.8us GI", "wlan.ext_tag.he_phy_cap.nbytes.he_er_su_ppdu_4xxx_gi",
31377       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
31378
31379     {&hf_he_phy_cap_20mhz_in_40mhz_24ghz_band,
31380      {"20 MHz In 40 MHz HE PPDU In 2.4GHz Band", "wlan.ext_tag.he_phy_cap.nbytes.20_mhz_in_40_in_2_4ghz",
31381       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
31382
31383     {&hf_he_phy_cap_20mhz_in_160_80p80_ppdu,
31384      {"20 MHz In 160/80+80 MHz HE PPDU", "wlan.ext_tag.he_phy_cap.nbytes.20_mhz_in_160_80p80_ppdu",
31385       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
31386
31387     {&hf_he_phy_cap_80mgz_in_160_80p80_ppdu,
31388      {"80 MHz In 160/80+80 MHz HE PPDU", "wlan.ext_tag.he_phy_cap.nbytes.80_mhz_in_160_80p80_ppdu",
31389       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
31390
31391     {&hf_he_phy_cap_he_er_su_ppdu_1xxx_gi,
31392      {"HE ER SU PPDU W 1x HE-LTF & 0.8us GI", "wlan.ext_tag.he_phy_cap.nbytes.he_er_su_ppdu_1xxx_gi",
31393       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
31394
31395     {&hf_he_phy_cap_midamble_rx_2x_xxx_ltf,
31396      {"Midamble Rx 2x & 1x HE-LTF", "wlan.ext_tag.he_phy_cap.nbytes.midamble_rx_2x_1x_he_ltf",
31397       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
31398
31399     {&hf_he_phy_cap_b70_b71_reserved,
31400      {"Reserved", "wlan.ext_tag.he_phy_cap.nbytes.reserved_b70_b71",
31401       FT_UINT16, BASE_HEX, NULL, 0xC000, NULL, HFILL }},
31402
31403     {&hf_he_mcs_max_he_mcs_1_ss,
31404      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_for_1_ss",
31405       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
31406
31407     {&hf_he_mcs_max_he_mcs_2_ss,
31408      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_for_2_ss",
31409       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
31410
31411     {&hf_he_mcs_max_he_mcs_3_ss,
31412      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_for_3_ss",
31413       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
31414
31415     {&hf_he_mcs_max_he_mcs_4_ss,
31416      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_for_4_ss",
31417       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
31418
31419     {&hf_he_mcs_max_he_mcs_5_ss,
31420      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_for_5_ss",
31421       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
31422
31423     {&hf_he_mcs_max_he_mcs_6_ss,
31424      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_for_6_ss",
31425       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
31426
31427     {&hf_he_mcs_max_he_mcs_7_ss,
31428      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_for_7_ss",
31429       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
31430
31431     {&hf_he_mcs_max_he_mcs_8_ss,
31432      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_for_8_ss",
31433       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
31434
31435     {&hf_he_rx_he_mcs_map_lte_80,
31436      {"Rx HEX-MCS Map <= 80 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_lte_80",
31437      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31438
31439     {&hf_he_tx_he_mcs_map_lte_80,
31440      {"Tx HEX-MCS Map <= 80 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_lte_80",
31441      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31442
31443     {&hf_he_rx_he_mcs_map_160,
31444      {"Rx HEX-MCS Map 160 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_160",
31445      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31446
31447     {&hf_he_tx_he_mcs_map_160,
31448      {"Tx HEX-MCS Map 160 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_160",
31449      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31450
31451     {&hf_he_rx_he_mcs_map_80_80,
31452      {"Rx HEX-MCS Map 80+80 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_80_80",
31453      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31454
31455     {&hf_he_tx_he_mcs_map_80_80,
31456      {"Tx HEX-MCS Map 80+80 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_80_80",
31457      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31458
31459     {&hf_he_ppe_thresholds_nss,
31460      {"NSS", "wlan.ext_tag.he_ppe_thresholds.nss",
31461       FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
31462
31463     {&hf_he_ppe_thresholds_ru_index_bitmask,
31464      {"RU Index Bitmask", "wlan.ext_tag.he_ppe_thresholds.ru_index_bitmask",
31465       FT_UINT8, BASE_HEX, NULL, 0x78, NULL, HFILL }},
31466
31467     {&hf_he_ppe_ppet16,
31468      {"PPET16","wlan.ext_tag.he_ppe_thresholds.ppet16",
31469       FT_UINT8, BASE_HEX, VALS(constellation_vals), 0x0, NULL, HFILL }},
31470
31471     {&hf_he_ppe_ppet8,
31472      {"PPET8","wlan.ext_tag.he_ppe_thresholds.ppet8",
31473       FT_UINT8, BASE_HEX, VALS(constellation_vals), 0x0, NULL, HFILL }},
31474
31475     {&hf_he_operation_parameter,
31476      {"HE Operation Parameters", "wlan.ext_tag.he_operation.params",
31477       FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
31478
31479     {&hf_he_operation_bss_color,
31480      {"BSS Color", "wlan.ext_tag.he_operation.he_color",
31481       FT_UINT32, BASE_DEC, NULL, 0x0000003f, NULL, HFILL }},
31482
31483     {&hf_he_operation_default_pe_duration,
31484      {"Default PE Duration", "wlan.ext_tag.he_operation.default_pe_duration",
31485       FT_UINT32, BASE_DEC, NULL, 0x000001C0, NULL, HFILL }},
31486
31487     {&hf_he_operation_twt_required,
31488      {"TWT Required", "wlan.ext_tag.he_operation.twt_required",
31489       FT_BOOLEAN, 32, TFS(&tfs_required_not_required), 0x00000200, NULL, HFILL }},
31490
31491     {&hf_he_operation_txop_duration_rts_threshold,
31492      {"TXOP Duration RTS Threshold", "wlan.ext_tag.he_operation.txop_duration_rts_thresh",
31493       FT_UINT32, BASE_DEC, NULL, 0x000FFC00, NULL, HFILL }},
31494
31495     {&hf_he_operation_partial_bss_color,
31496      {"Partial BSS Color", "wlan.ext_tag.he_operation.partial_bss_color",
31497       FT_BOOLEAN, 32, NULL, 0x00100000, NULL, HFILL }},
31498
31499     {&hf_he_operation_vht_operation_information_present,
31500      {"VHT Operation Information Present", "wlan.ext_tag.he_operation.vht_op_info_present",
31501       FT_BOOLEAN, 32, NULL, 0x00200000, NULL, HFILL }},
31502
31503     {&hf_he_operation_reserved_b22_b27,
31504      {"Reserved", "wlan.ext_tag.he_operation.reserved_b22_b27",
31505       FT_UINT32, BASE_HEX, NULL, 0x0FC00000, NULL, HFILL }},
31506
31507     {&hf_he_operation_multiple_bssid_ap,
31508      {"Multiple BSSID AP", "wlan.ext_tag.he_operation.multiple_bssid_ap",
31509       FT_BOOLEAN, 32, NULL, 0x10000000, NULL, HFILL }},
31510
31511     {&hf_he_operation_txbssid_indicator,
31512      {"TX BSSID Indicator", "wlan.ext_tag.he_operation.tx_bssid_indicator",
31513       FT_BOOLEAN, 32, NULL, 0x20000000, NULL, HFILL }},
31514
31515     {&hf_he_operation_bss_color_disabled,
31516      {"BSS Color Disabled", "wlan.ext_tag.he_operation.bss_color_disabled",
31517       FT_BOOLEAN, 32, TFS(&tfs_disabled_enabled), 0x40000000, NULL, HFILL }},
31518
31519     {&hf_he_operation_reserved_b31,
31520      {"Reserved", "wlan.ext_tag.he_operation.reserved_b31",
31521       FT_UINT32, BASE_HEX, NULL, 0x80000000, NULL, HFILL }},
31522
31523     {&hf_he_operation_basic_mcs,
31524      {"Basic HE-MCS and NSS Set", "wlan.ext_tag.he_operation.basic_he_mcs_and_nss",
31525       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
31526
31527     {&hf_he_oper_max_he_mcs_for_1_ss,
31528      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_1_ss",
31529       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
31530
31531     {&hf_he_oper_max_he_mcs_for_2_ss,
31532      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_2_ss",
31533       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
31534
31535     {&hf_he_oper_max_he_mcs_for_3_ss,
31536      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_3_ss",
31537       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
31538
31539     {&hf_he_oper_max_he_mcs_for_4_ss,
31540      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_4_ss",
31541       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
31542
31543     {&hf_he_oper_max_he_mcs_for_5_ss,
31544      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_5_ss",
31545       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
31546
31547     {&hf_he_oper_max_he_mcs_for_6_ss,
31548      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_6_ss",
31549       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
31550
31551     {&hf_he_oper_max_he_mcs_for_7_ss,
31552      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_7_ss",
31553       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
31554
31555     {&hf_he_oper_max_he_mcs_for_8_ss,
31556      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_8_ss",
31557       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
31558
31559     {&hf_he_operation_channel_width,
31560      {"channel Width", "wlan.ext_tag.he_operation.vht_op_info.channel_width",
31561       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31562
31563     {&hf_he_operation_channel_center_freq_0,
31564      {"Channel Center Frequency Segment 0", "wlan.ext_tag.he_operatoon.vht_op_info.chan_center_freq_seg_0",
31565       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31566
31567     {&hf_he_operation_channel_center_freq_1,
31568      {"Channel Center Frequency Segment 1", "wlan.ext_tag.he_operatoon.vht_op_info.chan_center_freq_seg_1",
31569       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31570
31571     {&hf_he_operation_max_bssid_indicator,
31572      {"MaxBSSID Indicator", "wlan.ext_tag.he_operation.maxbssid_indicator",
31573       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31574
31575     {&hf_he_muac_aci_aifsn,
31576      {"AIC/AIFSN","wlan.ext_tag.mu_edca_parameter_set.aic_aifsn",
31577       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31578
31579     {&hf_he_mu_edca_timer,
31580      {"MU EDCA Timer","wlan.ext_tag.mu_edca_parameter_set.mu_edca_timer",
31581       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31582
31583     {&hf_he_muac_ecwmin_ecwmax,
31584      {"ECWmin/ECWmax","wlan.ext_tag.mu_edca_parameter_set.ecwmin_ecwmax",
31585       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31586
31587     {&hf_he_spatial_reuse_sr_control,
31588      {"SR Control", "wlan.ext_tag.spatial_reuse.sr_control",
31589       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31590
31591     {&hf_he_srp_disallowed,
31592      {"SRP Disallowed", "wlan.ext_tag.spatial_reuse.sr_control.srp_dis",
31593       FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
31594
31595     {&hf_he_non_srg_obss_pd_sr_disallowed,
31596      {"NON-SRG OBSS PD SR Disallowed", "wlan.ext_tag.spatial_reuse.sr_control.non_srg_obss_pd_sr_dis",
31597       FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
31598
31599     {&hf_he_non_srg_offset_present,
31600      {"Non-SRG Offset Present", "wlan.ext_tag.spatial_reuse.sr_control.non_srg_ofs_present",
31601       FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
31602
31603     {&hf_he_srg_information_present,
31604      {"SRG Information Present", "wlan.ext_tag.spatial_reuse.sr_control.srg_info_present",
31605      FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
31606
31607     {&hf_he_hesiga_spatial_reuse_value15_allowed,
31608      {"HESIGA Spatial Reuse value 15 allowed", "wlan.ext_tag.spatial_reuse.sr_control.hesiga_val_15_allowed",
31609       FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
31610
31611     {&hf_he_sr_control_reserved,
31612      {"Reserved", "wlan.ext_tag.spatial_reuse.sr_control.reserved",
31613       FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL }},
31614
31615     {&hf_he_spatial_non_srg_obss_pd_max_offset,
31616      {"Non-SRG OBSS PD Max Offset", "wlan.ext_tag.spatial_reuse.non_srg_obss_pd_max_offset",
31617       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31618
31619     {&hf_he_spatial_srg_obss_pd_min_offset,
31620      {"SRG OBSS PD Min Offset", "wlan.ext_tag.spatial_reuse.srg_obss_pd_min_offset",
31621       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31622
31623     {&hf_he_spatial_srg_obss_pd_max_offset,
31624      {"SRG OBSS PD Max Offset", "wlan.ext_tag.spatial_reuse.srg_obss_pd_max_offset",
31625       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31626
31627     {&hf_he_spatial_srg_bss_color_bitmap,
31628      {"SRG BSS Color Bitmap", "wlan.ext_tag.spatial_reuse.srg_bss_color_bitmap",
31629       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
31630
31631     {&hf_he_spatial_srg_partial_bssid_bitmap,
31632      {"SRG Partial BSSID Bitmap", "wlan.ext_tag.spatial_reuse.srg_partial_bssid_bitmap",
31633       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
31634
31635     {&hf_he_resource_request_buffer_thresh,
31636      {"Resource Request Buffer Threshold Exponent", "wlan.ext_tag.ndp_feedback.res_req_buf_thresh_exp",
31637       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31638
31639     {&hf_he_bss_color_change_new_color_info,
31640      {"New BSS Color Info", "wlan.ext_tag.bss_color_change.new_color_info",
31641       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31642
31643     {&hf_he_new_bss_color_info_color,
31644      {"New BSS Color", "wlan.ext_tag.bss_color_change.new_bss_color",
31645       FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL }},
31646
31647     {&hf_he_new_bss_color_info_reserved,
31648      {"Reserved", "wlan.ext_tag.bss_color_change.new_color_reserved",
31649       FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL }},
31650
31651     {&hf_he_bss_color_change_switch_countdown,
31652      {"BSS Color Switch Countdown", "wlan.ext_tag.bss_color_change.color_switch_countdown",
31653       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31654
31655     {&hf_he_ess_report_planned_ess,
31656      {"Planned ESS", "wlan.ext_tag.ess_report.ess_info.planned_ess",
31657       FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
31658
31659     {&hf_he_ess_report_edge_of_ess,
31660      {"Edge of ESS", "wlan.ext_tag.ess_report.ess_info.edge_of_ess",
31661       FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
31662
31663     {&hf_he_ess_report_info_field,
31664      {"ESS Information field", "wlan.ext_tag.ess_report.ess_info.field",
31665      FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }},
31666
31667     {&hf_he_ess_report_recommend_transition_thresh,
31668      {"Recommended BSS Transition Threshold", "wlan.ext_tag.ess_report.ess_info.thresh",
31669      FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL }},
31670
31671     {&hf_he_uora_field,
31672      {"UL OFDMA-based Random Access Parameter SET", "wlan.ext_tag.uora_parameter_set.field",
31673       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31674
31675     {&hf_he_uora_eocwmin,
31676      {"EOCWmin", "wlan.ext_tag.uora_parameter_set.eocwmin",
31677       FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
31678
31679     {&hf_he_uora_owcwmax,
31680      {"EOCWmax", "wlan.ext_tag.uora_parameter_set.eocwmax",
31681       FT_UINT8, BASE_DEC, NULL, 0x38, NULL, HFILL }},
31682
31683     {&hf_he_uora_reserved,
31684      {"Reserved", "wlan.ext_tag.uora_parameter_set.reserved",
31685       FT_UINT8, BASE_DEC, NULL, 0xC0, NULL, HFILL }},
31686   };
31687
31688   static hf_register_info aggregate_fields[] = {
31689     {&hf_ieee80211_amsdu_subframe,
31690      {"A-MSDU Subframe", "wlan_aggregate.a_mdsu.subframe",
31691       FT_NONE, BASE_NONE, NULL, 0x0,
31692       "Aggregate MAC Service Data Unit (MSDU) Subframe", HFILL }},
31693
31694     {&hf_ieee80211_amsdu_length,
31695      {"A-MSDU Length", "wlan_aggregate.a_mdsu.length",
31696       FT_UINT16, BASE_DEC, NULL, 0x0,
31697       NULL, HFILL }}
31698   };
31699
31700   static uat_field_t wep_uat_flds[] = {
31701
31702       UAT_FLD_VS(uat_wep_key_records, key, "Key type", wep_type_vals,
31703                         "Decryption key type used"),
31704       UAT_FLD_CSTRING(uat_wep_key_records, string, "Key",
31705                         "wep:<wep hexadecimal key>\n"
31706                         "wpa-pwd:<passphrase>[:<ssid>]\n"
31707                         "wpa-psk:<wpa hexadecimal key>"),
31708       UAT_END_FIELDS
31709     };
31710
31711   static gint *tree_array[] = {
31712     &ett_80211,
31713     &ett_proto_flags,
31714     &ett_cap_tree,
31715     &ett_fc_tree,
31716     &ett_cntrl_wrapper_fc,
31717     &ett_cntrl_wrapper_payload,
31718     &ett_fragments,
31719     &ett_fragment,
31720     &ett_block_ack,
31721     &ett_block_ack_tid,
31722     &ett_block_ack_request_control,
31723     &ett_block_ack_bitmap,
31724     &ett_ath_cap_tree,
31725
31726     &ett_80211_mgt,
31727     &ett_fixed_parameters,
31728     &ett_tagged_parameters,
31729     &ett_tag_bmapctl_tree,
31730     &ett_tag_country_fnm_tree,
31731     &ett_tag_country_rcc_tree,
31732     &ett_qos_parameters,
31733     &ett_qos_ps_buf_state,
31734     &ett_wep_parameters,
31735     &ett_msh_control,
31736     &ett_hwmp_targ_flags_tree,
31737     &ett_mesh_chswitch_flag_tree,
31738     &ett_mesh_config_cap_tree,
31739     &ett_mesh_formation_info_tree,
31740
31741     &ett_rsn_gcs_tree,
31742     &ett_rsn_pcs_tree,
31743     &ett_rsn_sub_pcs_tree,
31744     &ett_rsn_akms_tree,
31745     &ett_rsn_sub_akms_tree,
31746     &ett_rsn_cap_tree,
31747     &ett_rsn_pmkid_tree,
31748     &ett_rsn_gmcs_tree,
31749
31750     &ett_wpa_mcs_tree,
31751     &ett_wpa_ucs_tree,
31752     &ett_wpa_sub_ucs_tree,
31753     &ett_wpa_akms_tree,
31754     &ett_wpa_sub_akms_tree,
31755     &ett_wme_ac,
31756     &ett_wme_aci_aifsn,
31757     &ett_wme_ecw,
31758     &ett_wme_qos_info,
31759
31760     &ett_ht_cap_tree,
31761     &ett_ampduparam_tree,
31762     &ett_mcsset_tree,
31763     &ett_mcsbit_tree,
31764     &ett_htex_cap_tree,
31765     &ett_txbf_tree,
31766     &ett_antsel_tree,
31767     &ett_hta_cap_tree,
31768     &ett_hta_cap1_tree,
31769     &ett_hta_cap2_tree,
31770
31771     &ett_htc_tree,
31772     &ett_htc_he_a_control,
31773     &ett_mfb_subtree,
31774     &ett_lac_subtree,
31775
31776     &ett_vht_cap_tree,
31777     &ett_vht_mcsset_tree,
31778     &ett_vht_rx_mcsbit_tree,
31779     &ett_vht_tx_mcsbit_tree,
31780     &ett_vht_basic_mcsbit_tree,
31781     &ett_vht_op_tree,
31782     &ett_vht_tpe_info_tree,
31783
31784     &ett_vht_ndp_annc,
31785     &ett_vht_ndp_annc_sta_info_tree,
31786
31787     &ett_he_mimo_control,
31788
31789     &ett_ff_vhtmimo_cntrl,
31790     &ett_ff_vhtmimo_beamforming_report,
31791     &ett_ff_vhtmimo_beamforming_report_snr,
31792     &ett_ff_vhtmimo_beamforming_angle,
31793     &ett_ff_vhtmimo_beamforming_report_feedback_matrices,
31794     &ett_ff_vhtmu_exclusive_beamforming_report_matrices,
31795
31796     &ett_vht_grpidmgmt,
31797     &ett_vht_msa,
31798     &ett_vht_upa,
31799
31800     &ett_ht_info_delimiter1_tree,
31801     &ett_ht_info_delimiter2_tree,
31802     &ett_ht_info_delimiter3_tree,
31803
31804     &ett_tag_measure_request_mode_tree,
31805     &ett_tag_measure_request_type_tree,
31806     &ett_tag_measure_report_mode_tree,
31807     &ett_tag_measure_report_type_tree,
31808     &ett_tag_measure_report_basic_map_tree,
31809     &ett_tag_measure_report_rpi_tree,
31810     &ett_tag_measure_report_frame_tree,
31811     &ett_tag_measure_reported_frame_tree,
31812     &ett_tag_bss_bitmask_tree,
31813     &ett_tag_dfs_map_tree,
31814     &ett_tag_erp_info_tree,
31815     &ett_tag_ex_cap1,
31816     &ett_tag_ex_cap2,
31817     &ett_tag_ex_cap3,
31818     &ett_tag_ex_cap4,
31819     &ett_tag_ex_cap5,
31820     &ett_tag_ex_cap6,
31821     &ett_tag_ex_cap7,
31822     &ett_tag_ex_cap8,
31823     &ett_tag_ex_cap89,
31824     &ett_tag_ex_cap10,
31825
31826     &ett_tag_rm_cap1,
31827     &ett_tag_rm_cap2,
31828     &ett_tag_rm_cap3,
31829     &ett_tag_rm_cap4,
31830     &ett_tag_rm_cap5,
31831
31832     &ett_tag_20_40_bc,
31833
31834     &ett_tag_tclas_mask_tree,
31835
31836     &ett_tag_supported_channels,
31837
31838     &ett_tag_neighbor_report_bssid_info_tree,
31839     &ett_tag_neighbor_report_bssid_info_capability_tree,
31840     &ett_tag_neighbor_report_sub_tag_tree,
31841
31842     &ett_tag_wapi_param_set_akm_tree,
31843     &ett_tag_wapi_param_set_ucast_tree,
31844     &ett_tag_wapi_param_set_mcast_tree,
31845     &ett_tag_wapi_param_set_preauth_tree,
31846
31847     &ett_tag_time_adv_tree,
31848
31849     &ett_ff_ba_param_tree,
31850     &ett_ff_ba_ssc_tree,
31851     &ett_ff_delba_param_tree,
31852     &ett_ff_qos_info,
31853     &ett_ff_psmp_param_set,
31854     &ett_ff_mimo_cntrl,
31855     &ett_ff_ant_sel,
31856     &ett_mimo_report,
31857     &ett_ff_sm_pwr_save,
31858     &ett_ff_chan_switch_announce,
31859     &ett_ff_ht_info,
31860     &ett_ff_psmp_sta_info,
31861
31862     &ett_tpc,
31863
31864     &ett_msdu_aggregation_parent_tree,
31865     &ett_msdu_aggregation_subframe_tree,
31866
31867     &ett_80211_mgt_ie,
31868     &ett_tsinfo_tree,
31869     &ett_sched_tree,
31870
31871     &ett_fcs,
31872
31873     &ett_adv_proto,
31874     &ett_adv_proto_tuple,
31875     &ett_gas_query,
31876     &ett_gas_anqp,
31877     &ett_nai_realm,
31878     &ett_nai_realm_eap,
31879     &ett_tag_ric_data_desc_ie,
31880     &ett_anqp_vendor_capab,
31881
31882     &ett_hs20_cc_proto_port_tuple,
31883
31884     &ett_ssid_list,
31885
31886     &ett_nintendo,
31887
31888     &ett_mikrotik,
31889
31890     &ett_meru,
31891
31892     &ett_qos_map_set_exception,
31893     &ett_qos_map_set_range,
31894
31895     /* 802.11ad trees */
31896     &ett_dynamic_alloc_tree,
31897     &ett_ssw_tree,
31898     &ett_bf_tree,
31899     &ett_sswf_tree,
31900     &ett_brp_tree,
31901     &ett_blm_tree,
31902     &ett_bic_tree,
31903     &ett_dmg_params_tree,
31904     &ett_cc_tree,
31905     &ett_rcsi_tree,
31906     &ett_80211_ext,
31907     &ett_allocation_tree,
31908     &ett_sta_info,
31909
31910     &ett_ieee80211_esp,
31911
31912     &ett_gas_resp_fragment,
31913     &ett_gas_resp_fragments,
31914
31915     /* 802.11ax trees */
31916     &ett_he_mac_capabilities,
31917     &ett_he_phy_capabilities,
31918     &ett_he_phy_cap_first_byte,
31919     &ett_he_phy_cap_chan_width_set,
31920     &ett_he_phy_cap_b8_to_b23,
31921     &ett_he_phy_cap_b24_to_b39,
31922     &ett_he_phy_cap_b40_to_b55,
31923     &ett_he_phy_cap_b56_to_b71,
31924     &ett_he_mcs_and_nss_set,
31925     &ett_he_rx_tx_he_mcs_map_lte_80,
31926     &ett_he_rx_mcs_map_lte_80,
31927     &ett_he_tx_mcs_map_lte_80,
31928     &ett_he_rx_tx_he_mcs_map_160,
31929     &ett_he_rx_mcs_map_160,
31930     &ett_he_tx_mcs_map_160,
31931     &ett_he_rx_tx_he_mcs_map_80_80,
31932     &ett_he_rx_mcs_map_80_80,
31933     &ett_he_tx_mcs_map_80_80,
31934     &ett_he_ppe_threshold,
31935     &ett_he_ppe_nss,
31936     &ett_he_ppe_ru_alloc,
31937     &ett_he_operation_params,
31938     &ett_he_oper_basic_mcs,
31939     &ett_he_operation_vht_op_info,
31940     &ett_he_mu_edca_param,
31941     &ett_he_uora_tree,
31942     &ett_he_spatial_reuse_control,
31943     &ett_he_ess_report_info_field,
31944     &ett_he_bss_new_color_info,
31945     &ett_he_trigger_common_info,
31946     &ett_he_trigger_base_common_info,
31947     &ett_he_trigger_bar_ctrl,
31948     &ett_he_trigger_bar_info,
31949     &ett_he_trigger_user_info,
31950     &ett_he_trigger_base_user_info,
31951     &ett_he_trigger_dep_basic_user_info,
31952     &ett_he_trigger_dep_nfrp_user_info,
31953     &ett_he_ndp_annc,
31954     &ett_he_ndp_annc_sta_list,
31955     &ett_he_ndp_annc_sta_item,
31956     &ett_he_ndp_annc_sta_info,
31957   };
31958
31959   static ei_register_info ei[] = {
31960     { &ei_ieee80211_bad_length,
31961       { "ieee80211.bad_length", PI_MALFORMED, PI_ERROR,
31962         "Wrong length indicated", EXPFILL }},
31963
31964     { &ei_ieee80211_inv_val,
31965       { "ieee80211.invalid_value", PI_MALFORMED, PI_WARN,
31966         "Invalid value", EXPFILL }},
31967
31968     { &ei_ieee80211_tag_number,
31969       { "wlan.tag.number.unexpected_ie", PI_MALFORMED, PI_ERROR,
31970         "Unexpected Information Element ID", EXPFILL }},
31971
31972     { &ei_ieee80211_tag_length,
31973       { "wlan.tag.length.bad", PI_MALFORMED, PI_ERROR,
31974         "Bad tag length", EXPFILL }},
31975
31976     { &ei_ieee80211_extra_data,
31977       { "ieee80211.extra_data", PI_MALFORMED, PI_WARN,
31978         "Unexpected extra data in the end", EXPFILL }},
31979
31980     { &ei_ieee80211_ff_anqp_capability,
31981       { "wlan.fixed.anqp.capability.invalid", PI_MALFORMED, PI_ERROR,
31982         "Invalid vendor-specific ANQP capability", EXPFILL }},
31983
31984     { &ei_ieee80211_ff_anqp_venue_length,
31985       { "wlan.fixed.anqp.venue.length.invalid", PI_MALFORMED, PI_ERROR,
31986         "Invalid Venue Name Duple length", EXPFILL }},
31987
31988     { &ei_ieee80211_ff_anqp_roaming_consortium_oi_len,
31989       { "wlan.fixed.anqp.roaming_consortium.oi_len.invalid", PI_MALFORMED, PI_ERROR,
31990         "Invalid Roaming Consortium OI", EXPFILL }},
31991
31992     { &ei_ieee80211_ff_anqp_nai_field_len,
31993       { "wlan.fixed.anqp.nai_realm_list.field_len.invalid", PI_MALFORMED, PI_ERROR,
31994         "Invalid NAI Realm List", EXPFILL }},
31995
31996     { &ei_ieee80211_ff_anqp_nai_realm_eap_len,
31997       { "wlan.fixed.naqp_nai_realm_list.eap_method_len.invalid", PI_MALFORMED, PI_ERROR,
31998         "Invalid EAP Method subfield", EXPFILL }},
31999
32000     { &ei_hs20_anqp_ofn_length,
32001       { "wlan.hs20.anqp.ofn.length.invalid", PI_MALFORMED, PI_ERROR,
32002         "Invalid Operator Friendly Name Duple length", EXPFILL }},
32003
32004     { &ei_hs20_anqp_nai_hrq_length,
32005       { "wlan.hs20.anqp.nai_hrq.length.invalid", PI_MALFORMED, PI_ERROR,
32006         "Invalid NAI Home Realm Query length", EXPFILL }},
32007
32008     { &ei_ieee80211_ff_anqp_info_length,
32009       { "wlan.fixed.anqp.info_length.invalid", PI_MALFORMED, PI_ERROR,
32010         "Invalid ANQP Info length", EXPFILL }},
32011
32012     { &ei_ieee80211_not_enough_room_for_anqp_header,
32013       { "wlan.fixed.query_length_invalid", PI_MALFORMED, PI_ERROR,
32014         "Not enough room for ANQP header", EXPFILL }},
32015
32016     { &ei_ieee80211_ff_query_request_length,
32017       { "wlan.fixed.query_request_length.invalid", PI_MALFORMED, PI_ERROR,
32018         "Invalid Query Request Length", EXPFILL }},
32019
32020     { &ei_ieee80211_ff_query_response_length,
32021       { "wlan.fixed.query_response_length.invalid", PI_MALFORMED, PI_ERROR,
32022         "Invalid Query Response Length", EXPFILL }},
32023
32024     { &ei_ieee80211_tag_wnm_sleep_mode_no_key_data,
32025       { "wlan.wnm_sleep_mode.no_key_data", PI_MALFORMED, PI_ERROR,
32026         "WNM-Sleep Mode Response is not long enough to include Key Data", EXPFILL }},
32027
32028     { &ei_ieee80211_tdls_setup_response_malformed,
32029       { "wlan.tdls_setup_response_malformed", PI_MALFORMED, PI_ERROR,
32030         "TDLS Setup Response (success) does not include mandatory fields", EXPFILL }},
32031
32032     { &ei_ieee80211_tdls_setup_confirm_malformed,
32033       { "wlan.tdls_setup_confirm_malformed", PI_MALFORMED, PI_ERROR,
32034         "TDLS Setup Confirm (success) does not include mandatory fields", EXPFILL }},
32035
32036     { &ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype,
32037       { "wlan.wfa.ie.wme.qos_info.bad_ftype", PI_UNDECODED, PI_WARN,
32038         "Could not deduce direction to decode correctly", EXPFILL }},
32039
32040     { &ei_ieee80211_qos_info_bad_ftype,
32041       { "wlan.qos_info.bad_ftype", PI_UNDECODED, PI_WARN,
32042         "Could not deduce direction to decode correctly", EXPFILL }},
32043
32044     { &ei_ieee80211_qos_bad_aifsn,
32045       { "wlan.qos_info.bad_aifsn", PI_MALFORMED, PI_WARN,
32046         "Invalid AIFSN", EXPFILL }},
32047
32048     { &ei_ieee80211_rsn_pcs_count,
32049       { "wlan.rsn.pcs.count.invalid", PI_MALFORMED, PI_ERROR,
32050         "Pairwise Cipher Suite Count too large", EXPFILL }},
32051
32052     { &ei_ieee80211_rsn_pmkid_count,
32053       { "wlan.rsn.akms.count.invalid", PI_MALFORMED, PI_ERROR,
32054         "Auth Key Management (AKM) Suite Count too large", EXPFILL }},
32055
32056     { &ei_ieee80211_pmkid_count_too_large,
32057       { "wlan.rsn.pmkid.count.invalid", PI_MALFORMED, PI_ERROR,
32058         "PMKID Count too large", EXPFILL }},
32059
32060     { &ei_ieee80211_vht_tpe_pwr_info_count,
32061       { "wlan.vht.tpe.pwr_info.count.invalid", PI_MALFORMED, PI_ERROR,
32062         "Max Tx Pwr Count is Incorrect, should be 0-7", EXPFILL }},
32063
32064     { &ei_ieee80211_missing_data,
32065       { "ieee80211.missing_data", PI_MALFORMED, PI_WARN,
32066         "No Request subelements in TFS Request", EXPFILL }},
32067
32068     { &ei_ieee80211_fc_retry,
32069       { "wlan.fc.retry.expert", PI_SEQUENCE, PI_NOTE,
32070         "Retransmission (retry)", EXPFILL }},
32071
32072     { &ei_ieee80211_tag_measure_request_unknown,
32073       { "wlan.measure.req.unknown.expert", PI_UNDECODED, PI_WARN,
32074         "Undecoded Measurement Request type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
32075
32076     { &ei_ieee80211_tag_measure_request_beacon_unknown,
32077       { "wlan.measure.req.beacon.unknown.expert", PI_UNDECODED, PI_WARN,
32078         "Unknown Data (not interpreted)", EXPFILL }},
32079
32080     { &ei_ieee80211_tag_measure_report_unknown,
32081       { "wlan.measure.req.unknown.expert", PI_UNDECODED, PI_WARN,
32082         "Undecoded Measurement Report type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
32083
32084     { &ei_ieee80211_tag_data,
32085       { "wlan.tag.data.undecoded", PI_UNDECODED, PI_NOTE,
32086         "Dissector for 802.11 IE Tag code not implemented, Contact Wireshark developers if you want this supported", EXPFILL }},
32087
32088     { &ei_ieee80211_dmg_subtype,
32089       { "wlan.dmg_subtype.bad", PI_MALFORMED, PI_ERROR,
32090         "Bad DMG type/subtype", EXPFILL }},
32091
32092     { &ei_ieee80211_vht_action,
32093       { "wlan.vht.action.undecoded", PI_UNDECODED, PI_NOTE,
32094         "All subtype of VHT Action is not yet supported by Wireshark", EXPFILL }},
32095
32096     { &ei_ieee80211_mesh_peering_unexpected,
32097       { "wlan.peering.unexpected", PI_MALFORMED, PI_ERROR,
32098         "Unexpected Self-protected action", EXPFILL }},
32099
32100     { &ei_ieee80211_fcs,
32101       { "wlan.fcs.bad_checksum", PI_MALFORMED, PI_ERROR,
32102         "Bad checksum", EXPFILL }},
32103
32104     { &ei_ieee80211_mismatched_akm_suite,
32105       { "wlan.rsn.akms.mismatched", PI_PROTOCOL, PI_ERROR,
32106         "Mismatched AKMS", EXPFILL }},
32107   };
32108
32109   expert_module_t *expert_ieee80211;
32110
32111   module_t *wlan_module;
32112
32113   memset(&wlan_stats, 0, sizeof wlan_stats);
32114
32115   proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
32116       "IEEE 802.11 Aggregate Data", "wlan_aggregate");
32117   proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
32118
32119   proto_wlan = proto_register_protocol("IEEE 802.11 wireless LAN", "IEEE 802.11", "wlan");
32120   /* Created to remove Decode As confusion */
32121   proto_centrino = proto_register_protocol("IEEE 802.11 wireless LAN (Centrino)", "IEEE 802.11 (Centrino)", "wlan_centrino");
32122   proto_register_field_array(proto_wlan, hf, array_length(hf));
32123
32124   proto_wlan_ext = proto_register_protocol("IEEE 802.11 wireless LAN extension frame",
32125       "IEEE 802.11 EXT", "wlan_ext");
32126
32127   proto_register_subtree_array(tree_array, array_length(tree_array));
32128
32129   expert_ieee80211 = expert_register_protocol(proto_wlan);
32130   expert_register_field_array(expert_ieee80211, ei, array_length(ei));
32131
32132   ieee80211_handle = register_dissector("wlan", dissect_ieee80211,                    proto_wlan);
32133   register_dissector("wlan_withfcs",            dissect_ieee80211_withfcs,            proto_wlan);
32134   wlan_withoutfcs_handle = register_dissector("wlan_withoutfcs", dissect_ieee80211_withoutfcs, proto_wlan);
32135   register_dissector("wlan_bsfc",               dissect_ieee80211_bsfc,               proto_wlan);
32136   register_dissector("wlan_noqos",              dissect_ieee80211_noqos,              proto_wlan);
32137
32138   register_capture_dissector("ieee80211", capture_ieee80211, proto_wlan);
32139   register_capture_dissector("ieee80211_datapad", capture_ieee80211_datapad, proto_wlan);
32140
32141   reassembly_table_register(&wlan_reassembly_table,
32142                         &addresses_reassembly_table_functions);
32143   register_init_routine(wlan_retransmit_init);
32144   reassembly_table_register(&gas_reassembly_table,
32145                         &addresses_reassembly_table_functions);
32146
32147   wlan_tap = register_tap("wlan");
32148   register_conversation_table(proto_wlan, TRUE, wlan_conversation_packet, wlan_hostlist_packet);
32149
32150   wlan_address_type = address_type_dissector_register("AT_ETHER_WLAN", "WLAN Address", ether_to_str, ether_str_len, NULL, wlan_col_filter_str,
32151                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
32152   wlan_bssid_address_type = address_type_dissector_register("AT_ETHER_BSSID", "WLAN BSSID Address", ether_to_str, ether_str_len, NULL, wlan_bssid_col_filter_str,
32153                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
32154   set_address(&bssid_broadcast, wlan_bssid_address_type, 6, bssid_broadcast_data);
32155
32156   tagged_field_table = register_dissector_table("wlan.tag.number", "IEEE 802.11 Fields", proto_wlan, FT_UINT8, BASE_DEC);
32157   vendor_specific_action_table = register_dissector_table("wlan.action.vendor_specific", "IEEE802.11 Vendor Specific Action", proto_wlan, FT_UINT24, BASE_HEX);
32158   wifi_alliance_action_subtype_table = register_dissector_table("wlan.action.wifi_alliance.subtype", "Wi-Fi Alliance Action Subtype", proto_wlan, FT_UINT8, BASE_HEX);
32159   vendor_specific_anqp_info_table = register_dissector_table("wlan.anqp.vendor_specific", "IEEE802.11 ANQP information Vendor Specific", proto_wlan, FT_UINT24, BASE_HEX);
32160   wifi_alliance_anqp_info_table = register_dissector_table("wlan.anqp.wifi_alliance.subtype", "Wi-Fi Alliance ANQP Subtype", proto_wlan, FT_UINT8, BASE_HEX);
32161   wifi_alliance_ie_table = register_dissector_table("wlan.ie.wifi_alliance.subtype", "Wi-Fi Alliance IE Subtype", proto_wlan, FT_UINT8, BASE_HEX);
32162   wifi_alliance_public_action_table = register_dissector_table("wlan.pa.wifi_alliance.subtype", "Wi-Fi Alliance PA Subtype", proto_wlan, FT_UINT8, BASE_HEX);
32163
32164   /* Register configuration options */
32165   wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
32166   prefs_register_bool_preference(wlan_module, "defragment",
32167     "Reassemble fragmented 802.11 datagrams",
32168     "Whether fragmented 802.11 datagrams should be reassembled",
32169      &wlan_defragment);
32170
32171   prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
32172     "Ignore vendor-specific HT elements",
32173     "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
32174     &wlan_ignore_draft_ht);
32175
32176   prefs_register_bool_preference(wlan_module, "retransmitted",
32177     "Call subdissector for retransmitted 802.11 frames",
32178     "Whether retransmitted 802.11 frames should be subdissected",
32179     &wlan_subdissector);
32180
32181   prefs_register_bool_preference(wlan_module, "check_fcs",
32182     "Assume packets have FCS",
32183     "Some 802.11 cards include the FCS at the end of a packet, others do not.",
32184     &wlan_check_fcs);
32185
32186   prefs_register_bool_preference(wlan_module, "check_checksum",
32187     "Validate the FCS checksum if possible",
32188     "Whether to validate the FCS checksum or not.",
32189     &wlan_check_checksum);
32190
32191   prefs_register_enum_preference(wlan_module, "ignore_wep",
32192     "Ignore the Protection bit",
32193     "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
32194     "and some also leave the IV (initialization vector).",
32195     &wlan_ignore_prot, wlan_ignore_prot_options, TRUE);
32196
32197   prefs_register_uint_preference(wlan_module, "wpa_key_mic_len",
32198     "WPA Key MIC Length override",
32199     "Some Key MIC lengths are greater than 16 bytes, so set the length you require",
32200     10, &wlan_key_mic_len);
32201
32202   prefs_register_obsolete_preference(wlan_module, "wep_keys");
32203
32204   prefs_register_bool_preference(wlan_module, "enable_decryption",
32205     "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
32206     &enable_decryption);
32207
32208   wep_uat = uat_new("WEP and WPA Decryption Keys",
32209             sizeof(uat_wep_key_record_t), /* record size */
32210             "80211_keys",                 /* filename */
32211             TRUE,                         /* from_profile */
32212             &uat_wep_key_records,         /* data_ptr */
32213             &num_wepkeys_uat,             /* numitems_ptr */
32214             UAT_AFFECTS_DISSECTION,       /* affects dissection of packets, but not set of named fields */
32215             NULL,                         /* help. XXX Needs chapter in WSUG */
32216             uat_wep_key_record_copy_cb,   /* copy callback */
32217             uat_wep_key_record_update_cb, /* update callback */
32218             uat_wep_key_record_free_cb,   /* free callback */
32219             init_wepkeys,                 /* post update callback - update the WEP/WPA keys */
32220             NULL,                         /* reset callback */
32221             wep_uat_flds);                /* UAT field definitions */
32222
32223   prefs_register_uat_preference(wlan_module,
32224                                 "wep_key_table",
32225                                 "Decryption keys",
32226                                 "WEP and pre-shared WPA keys\n"
32227                                 "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
32228                                 "010203040506070809101111213 (104/128-bit WEP),\n"
32229                                 "MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
32230                                 "0102030405...6061626364 (WPA + 256-bit key)."
32231                                 "Invalid keys will be ignored.",
32232                                 wep_uat);
32233 }
32234
32235 void
32236 proto_register_wlan_rsna_eapol(void)
32237 {
32238
32239   static hf_register_info hf[] = {
32240     {&hf_wlan_rsna_eapol_wpa_keydes_msgnr,
32241      {"Message number", "wlan_rsna_eapol.keydes.msgnr",
32242       FT_UINT8, BASE_DEC, NULL, 0x0,
32243       NULL, HFILL }},
32244
32245     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo,
32246      {"Key Information", "wlan_rsna_eapol.keydes.key_info",
32247       FT_UINT16, BASE_HEX, NULL, 0x0,
32248       NULL, HFILL }},
32249
32250     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version,
32251      {"Key Descriptor Version", "wlan_rsna_eapol.keydes.key_info.keydes_version",
32252       FT_UINT16, BASE_DEC, VALS(keydes_version_vals), KEY_INFO_KEYDES_VERSION_MASK,
32253       NULL, HFILL }},
32254
32255     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type,
32256      {"Key Type", "wlan_rsna_eapol.keydes.key_info.key_type",
32257       FT_BOOLEAN, 16, TFS(&keyinfo_key_type_tfs), KEY_INFO_KEY_TYPE_MASK,
32258       NULL, HFILL }},
32259
32260     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index,
32261      {"Key Index", "wlan_rsna_eapol.keydes.key_info.key_index",
32262       FT_UINT16, BASE_DEC, NULL, KEY_INFO_KEY_INDEX_MASK,
32263       NULL, HFILL }},
32264
32265     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install,
32266      {"Install", "wlan_rsna_eapol.keydes.key_info.install",
32267       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_INSTALL_MASK,
32268       NULL, HFILL }},
32269
32270     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack,
32271      {"Key ACK", "wlan_rsna_eapol.keydes.key_info.key_ack",
32272       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_ACK_MASK,
32273       NULL, HFILL }},
32274
32275     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic,
32276      {"Key MIC", "wlan_rsna_eapol.keydes.key_info.key_mic",
32277       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_MIC_MASK,
32278       NULL, HFILL }},
32279
32280     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure,
32281      {"Secure", "wlan_rsna_eapol.keydes.key_info.secure",
32282       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_SECURE_MASK,
32283       NULL, HFILL }},
32284
32285     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error,
32286      {"Error", "wlan_rsna_eapol.keydes.key_info.error",
32287       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ERROR_MASK,
32288       NULL, HFILL }},
32289
32290     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request,
32291      {"Request", "wlan_rsna_eapol.keydes.key_info.request",
32292       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_REQUEST_MASK,
32293       NULL, HFILL }},
32294
32295     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data,
32296      {"Encrypted Key Data", "wlan_rsna_eapol.keydes.key_info.encrypted_key_data",
32297       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ENCRYPTED_KEY_DATA_MASK,
32298       NULL, HFILL }},
32299
32300     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
32301      {"SMK Message", "wlan_rsna_eapol.keydes.key_info.smk_message",
32302       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_SMK_MESSAGE_MASK,
32303       NULL, HFILL }},
32304
32305     {&hf_wlan_rsna_eapol_keydes_key_len,
32306      {"Key Length", "eapol.keydes.key_len",
32307       FT_UINT16, BASE_DEC, NULL, 0x0,
32308       NULL, HFILL }},
32309
32310     {&hf_wlan_rsna_eapol_keydes_replay_counter,
32311      {"Replay Counter", "eapol.keydes.replay_counter",
32312       FT_UINT64, BASE_DEC, NULL, 0x0,
32313       NULL, HFILL }},
32314
32315     {&hf_wlan_rsna_eapol_keydes_key_iv,
32316      {"Key IV", "eapol.keydes.key_iv",
32317       FT_BYTES, BASE_NONE, NULL, 0x0,
32318       NULL, HFILL }},
32319
32320     {&hf_wlan_rsna_eapol_wpa_keydes_nonce,
32321      {"WPA Key Nonce", "wlan_rsna_eapol.keydes.nonce",
32322       FT_BYTES, BASE_NONE, NULL, 0x0,
32323       NULL, HFILL }},
32324
32325     {&hf_wlan_rsna_eapol_wpa_keydes_rsc,
32326      {"WPA Key RSC", "wlan_rsna_eapol.keydes.rsc",
32327       FT_BYTES, BASE_NONE, NULL, 0x0,
32328       NULL, HFILL }},
32329
32330     {&hf_wlan_rsna_eapol_wpa_keydes_id,
32331      {"WPA Key ID", "wlan_rsna_eapol.keydes.id",
32332       FT_BYTES, BASE_NONE, NULL, 0x0,
32333       NULL, HFILL }},
32334
32335     {&hf_wlan_rsna_eapol_wpa_keydes_mic,
32336      {"WPA Key MIC", "wlan_rsna_eapol.keydes.mic",
32337       FT_BYTES, BASE_NONE, NULL, 0x0,
32338       NULL, HFILL }},
32339
32340     {&hf_wlan_rsna_eapol_wpa_keydes_data_len,
32341      {"WPA Key Data Length", "wlan_rsna_eapol.keydes.data_len",
32342       FT_UINT16, BASE_DEC, NULL, 0x0,
32343       NULL, HFILL }},
32344
32345     {&hf_wlan_rsna_eapol_wpa_keydes_data,
32346      {"WPA Key Data", "wlan_rsna_eapol.keydes.data",
32347       FT_BYTES, BASE_NONE, NULL, 0x0,
32348       NULL, HFILL }},
32349   };
32350
32351   static gint *tree_array[] = {
32352     &ett_keyinfo,
32353     &ett_wlan_rsna_eapol_keydes_data,
32354   };
32355
32356   proto_wlan_rsna_eapol = proto_register_protocol("IEEE 802.11 RSNA EAPOL key",
32357       "802.11 RSNA EAPOL", "wlan_rsna_eapol");
32358   proto_register_field_array(proto_wlan_rsna_eapol, hf, array_length(hf));
32359
32360   proto_register_subtree_array(tree_array, array_length(tree_array));
32361 }
32362
32363 void
32364 proto_reg_handoff_ieee80211(void)
32365 {
32366   dissector_handle_t data_encap_handle, centrino_handle;
32367   dissector_handle_t wlan_rsna_eapol_wpa_key_handle, wlan_rsna_eapol_rsn_key_handle;
32368   capture_dissector_handle_t ieee80211_cap_handle;
32369
32370   /*
32371    * Get handles for the LLC, IPX and Ethernet  dissectors.
32372    */
32373   llc_handle            = find_dissector_add_dependency("llc", proto_wlan);
32374   ipx_handle            = find_dissector_add_dependency("ipx", proto_wlan);
32375   eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_wlan);
32376
32377   llc_cap_handle = find_capture_dissector("llc");
32378   ipx_cap_handle = find_capture_dissector("ipx");
32379
32380   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
32381
32382   centrino_handle = create_dissector_handle( dissect_ieee80211_centrino, proto_centrino );
32383   dissector_add_uint("ethertype", ETHERTYPE_CENTRINO_PROMISC, centrino_handle);
32384
32385   ieee80211_cap_handle = find_capture_dissector("ieee80211");
32386   capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_cap_handle);
32387   capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_WITH_RADIO, ieee80211_cap_handle);
32388   capture_dissector_add_uint("ppi", 105 /* DLT_DLT_IEEE802_11 */, ieee80211_cap_handle);
32389
32390   /* Register handoff to Aruba GRE */
32391   dissector_add_uint("gre.proto", GRE_ARUBA_8200, ieee80211_handle);
32392   dissector_add_uint("gre.proto", GRE_ARUBA_8210, ieee80211_handle);
32393   dissector_add_uint("gre.proto", GRE_ARUBA_8220, ieee80211_handle);
32394   dissector_add_uint("gre.proto", GRE_ARUBA_8230, ieee80211_handle);
32395   dissector_add_uint("gre.proto", GRE_ARUBA_8240, ieee80211_handle);
32396   dissector_add_uint("gre.proto", GRE_ARUBA_8250, ieee80211_handle);
32397   dissector_add_uint("gre.proto", GRE_ARUBA_8260, ieee80211_handle);
32398   dissector_add_uint("gre.proto", GRE_ARUBA_8270, ieee80211_handle);
32399   dissector_add_uint("gre.proto", GRE_ARUBA_8280, ieee80211_handle);
32400   dissector_add_uint("gre.proto", GRE_ARUBA_8290, ieee80211_handle);
32401   dissector_add_uint("gre.proto", GRE_ARUBA_82A0, ieee80211_handle);
32402   dissector_add_uint("gre.proto", GRE_ARUBA_82B0, ieee80211_handle);
32403   dissector_add_uint("gre.proto", GRE_ARUBA_82C0, ieee80211_handle);
32404   dissector_add_uint("gre.proto", GRE_ARUBA_82D0, ieee80211_handle);
32405   dissector_add_uint("gre.proto", GRE_ARUBA_82E0, ieee80211_handle);
32406   dissector_add_uint("gre.proto", GRE_ARUBA_82F0, ieee80211_handle);
32407   dissector_add_uint("gre.proto", GRE_ARUBA_8300, ieee80211_handle);
32408   dissector_add_uint("gre.proto", GRE_ARUBA_8310, ieee80211_handle);
32409   dissector_add_uint("gre.proto", GRE_ARUBA_8320, ieee80211_handle);
32410   dissector_add_uint("gre.proto", GRE_ARUBA_8330, ieee80211_handle);
32411   dissector_add_uint("gre.proto", GRE_ARUBA_8340, ieee80211_handle);
32412   dissector_add_uint("gre.proto", GRE_ARUBA_8350, ieee80211_handle);
32413   dissector_add_uint("gre.proto", GRE_ARUBA_8360, ieee80211_handle);
32414   dissector_add_uint("gre.proto", GRE_ARUBA_8370, ieee80211_handle);
32415
32416   data_encap_handle = create_dissector_handle(dissect_data_encap, proto_wlan);
32417   dissector_add_uint("ethertype", ETHERTYPE_IEEE80211_DATA_ENCAP,
32418                 data_encap_handle);
32419
32420   /*
32421    * EAPOL key descriptor types.
32422    */
32423   wlan_rsna_eapol_wpa_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
32424                                                                proto_wlan_rsna_eapol);
32425   dissector_add_uint("eapol.keydes.type", EAPOL_WPA_KEY, wlan_rsna_eapol_wpa_key_handle);
32426   wlan_rsna_eapol_rsn_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
32427                                                                proto_wlan_rsna_eapol);
32428   dissector_add_uint("eapol.keydes.type", EAPOL_RSN_KEY, wlan_rsna_eapol_rsn_key_handle);
32429
32430   dissector_add_uint("sflow_245.header_protocol", SFLOW_5_HEADER_80211_MAC, wlan_withoutfcs_handle);
32431
32432   /* Tagged fields */
32433   /* XXX - for now, do it without pinos so the protocol is -1 */
32434   dissector_add_uint("wlan.tag.number", TAG_SSID, create_dissector_handle(ieee80211_tag_ssid, -1));
32435   dissector_add_uint("wlan.tag.number", TAG_SUPP_RATES, create_dissector_handle(ieee80211_tag_supp_rates, -1));
32436   dissector_add_uint("wlan.tag.number", TAG_FH_PARAMETER, create_dissector_handle(ieee80211_tag_fh_parameter, -1));
32437   dissector_add_uint("wlan.tag.number", TAG_DS_PARAMETER, create_dissector_handle(ieee80211_tag_ds_parameter, -1));
32438   dissector_add_uint("wlan.tag.number", TAG_CF_PARAMETER, create_dissector_handle(ieee80211_tag_cf_parameter, -1));
32439   dissector_add_uint("wlan.tag.number", TAG_TIM, create_dissector_handle(ieee80211_tag_tim, -1));
32440   dissector_add_uint("wlan.tag.number", TAG_IBSS_PARAMETER, create_dissector_handle(ieee80211_tag_ibss_parameter, -1));
32441   dissector_add_uint("wlan.tag.number", TAG_COUNTRY_INFO, create_dissector_handle(ieee80211_tag_country_info, -1));
32442   dissector_add_uint("wlan.tag.number", TAG_FH_HOPPING_PARAMETER, create_dissector_handle(ieee80211_tag_fh_hopping_parameter, -1));
32443   dissector_add_uint("wlan.tag.number", TAG_FH_HOPPING_TABLE, create_dissector_handle(ieee80211_tag_fh_hopping_table, -1));
32444   dissector_add_uint("wlan.tag.number", TAG_REQUEST, create_dissector_handle(ieee80211_tag_request, -1));
32445   dissector_add_uint("wlan.tag.number", TAG_QBSS_LOAD, create_dissector_handle(ieee80211_tag_qbss_load, -1));
32446   dissector_add_uint("wlan.tag.number", TAG_EDCA_PARAM_SET, create_dissector_handle(ieee80211_tag_edca_param_set, -1));
32447   dissector_add_uint("wlan.tag.number", TAG_TSPEC, create_dissector_handle(ieee80211_tag_tspec, -1));
32448   dissector_add_uint("wlan.tag.number", TAG_TCLAS, create_dissector_handle(ieee80211_tag_tclas, -1));
32449   dissector_add_uint("wlan.tag.number", TAG_SCHEDULE, create_dissector_handle(ieee80211_tag_schedule, -1));
32450   dissector_add_uint("wlan.tag.number", TAG_CHALLENGE_TEXT, create_dissector_handle(ieee80211_tag_challenge_text, -1));
32451   dissector_add_uint("wlan.tag.number", TAG_POWER_CONSTRAINT, create_dissector_handle(ieee80211_tag_power_constraint, -1));
32452   dissector_add_uint("wlan.tag.number", TAG_POWER_CAPABILITY, create_dissector_handle(ieee80211_tag_power_capability, -1));
32453   dissector_add_uint("wlan.tag.number", TAG_TPC_REQUEST, create_dissector_handle(ieee80211_tag_tpc_request, -1));
32454   dissector_add_uint("wlan.tag.number", TAG_TPC_REPORT, create_dissector_handle(ieee80211_tag_tpc_report, -1));
32455   dissector_add_uint("wlan.tag.number", TAG_SUPPORTED_CHANNELS, create_dissector_handle(ieee80211_tag_supported_channels, -1));
32456   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_ANN, create_dissector_handle(ieee80211_tag_switch_ann, -1));
32457   dissector_add_uint("wlan.tag.number", TAG_MEASURE_REQ, create_dissector_handle(ieee80211_tag_measure_req, -1));
32458   dissector_add_uint("wlan.tag.number", TAG_MEASURE_REP, create_dissector_handle(ieee80211_tag_measure_rep, -1));
32459   dissector_add_uint("wlan.tag.number", TAG_QUIET, create_dissector_handle(ieee80211_tag_quiet, -1));
32460   dissector_add_uint("wlan.tag.number", TAG_IBSS_DFS, create_dissector_handle(ieee80211_tag_ibss_dfs, -1));
32461   dissector_add_uint("wlan.tag.number", TAG_ERP_INFO, create_dissector_handle(ieee80211_tag_erp_info, -1));
32462   dissector_add_uint("wlan.tag.number", TAG_ERP_INFO_OLD, create_dissector_handle(ieee80211_tag_erp_info, -1));
32463   dissector_add_uint("wlan.tag.number", TAG_TS_DELAY, create_dissector_handle(ieee80211_tag_ts_delay, -1));
32464   dissector_add_uint("wlan.tag.number", TAG_TCLAS_PROCESS, create_dissector_handle(ieee80211_tag_tclas_process, -1));
32465   dissector_add_uint("wlan.tag.number", TAG_QOS_CAPABILITY, create_dissector_handle(ieee80211_tag_qos_capability, -1));
32466   dissector_add_uint("wlan.tag.number", TAG_RSN_IE, create_dissector_handle(ieee80211_tag_rsn_ie, -1));
32467   dissector_add_uint("wlan.tag.number", TAG_EXT_SUPP_RATES, create_dissector_handle(ieee80211_tag_ext_supp_rates, -1));
32468   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_CAPABILITIES, create_dissector_handle(dissect_extended_capabilities_ie, -1));
32469   dissector_add_uint("wlan.tag.number", TAG_CISCO_CCX1_CKIP, create_dissector_handle(ieee80211_tag_cisco_ccx1_ckip, -1));
32470   dissector_add_uint("wlan.tag.number", TAG_VHT_CAPABILITY, create_dissector_handle(dissect_vht_capability_ie, -1));
32471   dissector_add_uint("wlan.tag.number", TAG_VHT_OPERATION, create_dissector_handle(dissect_vht_operation_ie, -1));
32472   dissector_add_uint("wlan.tag.number", TAG_EXT_BSS_LOAD, create_dissector_handle(dissect_ext_bss_load, -1));
32473   dissector_add_uint("wlan.tag.number", TAG_WIDE_BW_CHANNEL_SWITCH, create_dissector_handle(dissect_wide_bw_channel_switch, -1));
32474   dissector_add_uint("wlan.tag.number", TAG_VHT_TX_PWR_ENVELOPE, create_dissector_handle(dissect_vht_tx_pwr_envelope, -1));
32475   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_WRAPPER, create_dissector_handle(dissect_channel_switch_wrapper, -1));
32476   dissector_add_uint("wlan.tag.number", TAG_OPERATING_MODE_NOTIFICATION, create_dissector_handle(dissect_operating_mode_notification, -1));
32477   /* 7.3.2.26 Vendor Specific information element (221) */
32478   dissector_add_uint("wlan.tag.number", TAG_VENDOR_SPECIFIC_IE, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
32479   /* This Cisco proprietary IE seems to mimic 221 */
32480   dissector_add_uint("wlan.tag.number", TAG_CISCO_VENDOR_SPECIFIC, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
32481   /* This Symbol proprietary IE seems to mimic 221 */
32482   dissector_add_uint("wlan.tag.number", TAG_SYMBOL_PROPRIETARY, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
32483   dissector_add_uint("wlan.tag.number", TAG_MOBILITY_DOMAIN, create_dissector_handle(dissect_mobility_domain, -1));
32484   dissector_add_uint("wlan.tag.number", TAG_FAST_BSS_TRANSITION, create_dissector_handle(dissect_fast_bss_transition, -1));
32485   dissector_add_uint("wlan.tag.number", TAG_MMIE, create_dissector_handle(dissect_mmie, -1));
32486   dissector_add_uint("wlan.tag.number", TAG_SSID_LIST, create_dissector_handle(dissect_ssid_list, -1));
32487   dissector_add_uint("wlan.tag.number", TAG_TIME_ZONE, create_dissector_handle(dissect_time_zone, -1));
32488   dissector_add_uint("wlan.tag.number", TAG_TIMEOUT_INTERVAL, create_dissector_handle(dissect_timeout_interval, -1));
32489   dissector_add_uint("wlan.tag.number", TAG_RIC_DATA, create_dissector_handle(dissect_ric_data, -1));
32490   dissector_add_uint("wlan.tag.number", TAG_LINK_IDENTIFIER, create_dissector_handle(dissect_link_identifier, -1));
32491   dissector_add_uint("wlan.tag.number", TAG_WAKEUP_SCHEDULE, create_dissector_handle(dissect_wakeup_schedule, -1));
32492   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_TIMING, create_dissector_handle(dissect_channel_switch_timing, -1));
32493   dissector_add_uint("wlan.tag.number", TAG_PTI_CONTROL, create_dissector_handle(dissect_pti_control, -1));
32494   dissector_add_uint("wlan.tag.number", TAG_PU_BUFFER_STATUS, create_dissector_handle(dissect_pu_buffer_status, -1));
32495   dissector_add_uint("wlan.tag.number", TAG_HT_CAPABILITY, create_dissector_handle(dissect_ht_capability_ie, -1));
32496   dissector_add_uint("wlan.tag.number", TAG_HT_INFO, create_dissector_handle(dissect_ht_info_ie_1_1, -1));
32497   dissector_add_uint("wlan.tag.number", TAG_SECONDARY_CHANNEL_OFFSET, create_dissector_handle(dissect_secondary_channel_offset_ie, -1));
32498   dissector_add_uint("wlan.tag.number", TAG_BSS_AVG_ACCESS_DELAY, create_dissector_handle(dissect_bss_avg_access_delay_ie, -1));
32499   dissector_add_uint("wlan.tag.number", TAG_ANTENNA, create_dissector_handle(dissect_antenna_ie, -1));
32500   dissector_add_uint("wlan.tag.number", TAG_RSNI, create_dissector_handle(dissect_rsni_ie, -1));
32501   dissector_add_uint("wlan.tag.number", TAG_MEASURE_PILOT_TRANS, create_dissector_handle(dissect_measurement_pilot_trans_ie, -1));
32502   dissector_add_uint("wlan.tag.number", TAG_BSS_AVB_ADM_CAPACITY, create_dissector_handle(dissect_bss_available_admission_capacity_ie, -1));
32503   dissector_add_uint("wlan.tag.number", TAG_IE_68_CONFLICT, create_dissector_handle(ieee80211_tag_ie_68_conflict, -1));
32504   dissector_add_uint("wlan.tag.number", TAG_BSS_MAX_IDLE_PERIOD, create_dissector_handle(dissect_bss_max_idle_period, -1));
32505   dissector_add_uint("wlan.tag.number", TAG_TFS_REQUEST, create_dissector_handle(dissect_tfs_request, -1));
32506   dissector_add_uint("wlan.tag.number", TAG_TFS_RESPONSE, create_dissector_handle(dissect_tfs_response, -1));
32507   dissector_add_uint("wlan.tag.number", TAG_WNM_SLEEP_MODE, create_dissector_handle(dissect_wnm_sleep_mode, -1));
32508   dissector_add_uint("wlan.tag.number", TAG_TIME_ADV, create_dissector_handle(dissect_time_adv, -1));
32509   dissector_add_uint("wlan.tag.number", TAG_RM_ENABLED_CAPABILITY, create_dissector_handle(dissect_rm_enabled_capabilities_ie, -1));
32510   dissector_add_uint("wlan.tag.number", TAG_20_40_BSS_CO_EX, create_dissector_handle(dissect_20_40_bss_coexistence, -1));
32511   dissector_add_uint("wlan.tag.number", TAG_OVERLAP_BSS_SCAN_PAR, create_dissector_handle(dissect_overlap_bss_scan_par, -1));
32512   dissector_add_uint("wlan.tag.number", TAG_RIC_DESCRIPTOR, create_dissector_handle(dissect_ric_descriptor, -1));
32513   dissector_add_uint("wlan.tag.number", TAG_MESH_PEERING_MGMT, create_dissector_handle(ieee80211_tag_mesh_peering_mgmt, -1));
32514   dissector_add_uint("wlan.tag.number", TAG_MESH_CONFIGURATION, create_dissector_handle(ieee80211_tag_mesh_configuration, -1));
32515   dissector_add_uint("wlan.tag.number", TAG_MESH_ID, create_dissector_handle(ieee80211_tag_mesh_id, -1));
32516   dissector_add_uint("wlan.tag.number", TAG_MESH_PREQ, create_dissector_handle(ieee80211_tag_mesh_preq, -1));
32517   dissector_add_uint("wlan.tag.number", TAG_MESH_PREP, create_dissector_handle(ieee80211_tag_mesh_prep, -1));
32518   dissector_add_uint("wlan.tag.number", TAG_MESH_PERR, create_dissector_handle(ieee80211_tag_mesh_perr, -1));
32519   dissector_add_uint("wlan.tag.number", TAG_RANN, create_dissector_handle(ieee80211_tag_rann, -1));
32520   dissector_add_uint("wlan.tag.number", TAG_MESH_CHANNEL_SWITCH, create_dissector_handle(ieee80211_tag_mesh_channel_switch, -1));
32521   dissector_add_uint("wlan.tag.number", TAG_INTERWORKING, create_dissector_handle(dissect_interworking, -1));
32522   dissector_add_uint("wlan.tag.number", TAG_ADVERTISEMENT_PROTOCOL, create_dissector_handle(dissect_advertisement_protocol, -1));
32523   dissector_add_uint("wlan.tag.number", TAG_QOS_MAP_SET, create_dissector_handle(dissect_qos_map_set, -1));
32524   dissector_add_uint("wlan.tag.number", TAG_ROAMING_CONSORTIUM, create_dissector_handle(dissect_roaming_consortium, -1));
32525   dissector_add_uint("wlan.tag.number", TAG_AP_CHANNEL_REPORT, create_dissector_handle(dissect_ap_channel_report, -1));
32526   dissector_add_uint("wlan.tag.number", TAG_NEIGHBOR_REPORT, create_dissector_handle(dissect_neighbor_report, -1));
32527   dissector_add_uint("wlan.tag.number", TAG_MESH_AWAKE_WINDOW, create_dissector_handle(ieee80211_tag_mesh_awake_window, -1));
32528   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, create_dissector_handle(ieee80211_tag_channel_switch_announcement, -1));
32529   dissector_add_uint("wlan.tag.number", TAG_SUPPORTED_OPERATING_CLASSES, create_dissector_handle(ieee80211_tag_supported_operating_classes, -1));
32530   dissector_add_uint("wlan.tag.number", TAG_RELAY_CAPABILITIES, create_dissector_handle(add_tag_relay_capabilities, -1));
32531   dissector_add_uint("wlan.tag.number", TAG_DMG_BSS_PARAMETER_CHANGE, create_dissector_handle(ieee80211_tag_bss_parameter_change, -1));
32532   dissector_add_uint("wlan.tag.number", TAG_DMG_CAPABILITIES, create_dissector_handle(ieee80211_tag_dmg_capabilities, -1));
32533   dissector_add_uint("wlan.tag.number", TAG_DMG_OPERATION, create_dissector_handle(ieee80211_tag_dmg_operation, -1));
32534   dissector_add_uint("wlan.tag.number", TAG_ANTENNA_SECTOR_ID, create_dissector_handle(ieee80211_tag_antenna_section_id, -1));
32535   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_SCHEDULE, create_dissector_handle(ieee80211_tag_extended_schedule, -1));
32536   dissector_add_uint("wlan.tag.number", TAG_STA_AVAILABILITY, create_dissector_handle(ieee80211_tag_sta_availability, -1));
32537   dissector_add_uint("wlan.tag.number", TAG_NEXT_DMG_ATI, create_dissector_handle(ieee80211_tag_next_dmg_ati, -1));
32538   dissector_add_uint("wlan.tag.number", TAG_NEXTPCP_LIST, create_dissector_handle(ieee80211_tag_nextpcp_list, -1));
32539   dissector_add_uint("wlan.tag.number", TAG_PCP_HANDOVER, create_dissector_handle(ieee80211_tag_pcp_handover, -1));
32540   dissector_add_uint("wlan.tag.number", TAG_BEAMLINK_MAINTENANCE, create_dissector_handle(ieee80211_tag_beamlink_maintenance, -1));
32541   dissector_add_uint("wlan.tag.number", TAG_QUIET_PERIOD_RES, create_dissector_handle(ieee80211_tag_quiet_period_res, -1));
32542   dissector_add_uint("wlan.tag.number", TAG_RELAY_TRANSFER_PARAM, create_dissector_handle(ieee80211_tag_relay_transfer_param, -1));
32543   dissector_add_uint("wlan.tag.number", TAG_DMG_BEAM_REFINEMENT, create_dissector_handle(ieee80211_tag_dmg_beam_refinement, -1));
32544   dissector_add_uint("wlan.tag.number", TAG_WAKEUP_SCHEDULE_AD, create_dissector_handle(ieee80211_tag_wakeup_schedule_ad, -1));
32545   dissector_add_uint("wlan.tag.number", TAG_DMG_TSPEC, create_dissector_handle(ieee80211_tag_dmg_tspec, -1));
32546   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_MEASURMENT_FB, create_dissector_handle(ieee80211_tag_channel_measurement_fb, -1));
32547   dissector_add_uint("wlan.tag.number", TAG_AWAKE_WINDOW, create_dissector_handle(ieee80211_tag_awake_window, -1));
32548   dissector_add_uint("wlan.tag.number", TAG_ADDBA_EXT, create_dissector_handle(ieee80211_tag_addba_ext, -1));
32549   dissector_add_uint("wlan.tag.number", TAG_MULTI_BAND, create_dissector_handle(ieee80211_tag_multi_band, -1));
32550   dissector_add_uint("wlan.tag.number", TAG_DMG_LINK_MARGIN, create_dissector_handle(ieee80211_tag_dmg_link_margin, -1));
32551   dissector_add_uint("wlan.tag.number", TAG_DMG_LINK_ADAPTION_ACK, create_dissector_handle(ieee80211_tag_dmg_link_adaption_ack, -1));
32552   dissector_add_uint("wlan.tag.number", TAG_SWITCHING_STREAM, create_dissector_handle(ieee80211_tag_switching_stream, -1));
32553   dissector_add_uint("wlan.tag.number", TAG_ELEMENT_ID_EXTENSION, create_dissector_handle(ieee80211_tag_element_id_extension, -1));
32554
32555   /* Vendor specific actions */
32556   dissector_add_uint("wlan.action.vendor_specific", OUI_MARVELL, create_dissector_handle(dissect_vendor_action_marvell, -1));
32557   dissector_add_uint("wlan.action.vendor_specific", OUI_WFA, create_dissector_handle(dissect_vendor_action_wifi_alliance, -1));
32558
32559   dissector_add_uint("wlan.anqp.vendor_specific", OUI_WFA, create_dissector_handle(dissect_vendor_wifi_alliance_anqp, -1));
32560   dissector_add_uint("wlan.anqp.wifi_alliance.subtype", WFA_SUBTYPE_HS20_ANQP, create_dissector_handle(dissect_hs20_anqp, -1));
32561   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_HS20_INDICATION, create_dissector_handle(dissect_hs20_indication, -1));
32562 }
32563
32564 /*
32565  * Editor modelines
32566  *
32567  * Local Variables:
32568  * c-basic-offset: 2
32569  * tab-width: 8
32570  * indent-tabs-mode: nil
32571  * End:
32572  *
32573  * ex: set shiftwidth=2 tabstop=8 expandtab:
32574  * :indentSize=2:tabSize=8:noTabs=true:
32575  */