ieee80211: Make QoS DSCP Exception and Range descriptions searchable.
[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_ECAPC_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_ECAPC_POLICY,                         "ECAPC 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_SUBSCRIPTION_REMEDIATION, "Subscription Remediation" },
734   { WFA_SUBTYPE_DEAUTHENTICATION_IMMINENT, "Deauthentication Imminent" },
735   { WFA_SUBTYPE_P2P, "P2P" },
736   { WFA_SUBTYPE_HS20_INDICATION, "Hotspot 2.0 Indication" },
737   { WFA_SUBTYPE_HS20_ANQP, "Hotspot 2.0 ANQP" },
738   { WFA_SUBTYPE_OSEN, "OSU Server-only l2 Encryption Network" },
739   { WFA_SUBTYPE_DPP, "Device Provisioning Protocol" },
740   { WFA_SUBTYPE_IEEE1905_MULTI_AP, "IEEE1905 Multi-AP" },
741   { 0, NULL }
742 };
743
744 #define DPP_CONFIGURATION_PROTOCOL 0x01
745
746 static const value_string dpp_subtype_vals[] = {
747   { DPP_CONFIGURATION_PROTOCOL, "DPP Configuration Protocol" },
748   { 0, NULL }
749 };
750
751 /* ************************************************************************* */
752 /*              Supported Rates (7.3.2.2)                                    */
753 /* ************************************************************************* */
754
755 static const value_string ieee80211_supported_rates_vals[] = {
756   { 0x02, "1" },
757   { 0x03, "1.5" },
758   { 0x04, "2" },
759   { 0x05, "2.5" },
760   { 0x06, "3" },
761   { 0x09, "4.5" },
762   { 0x0B, "5.5" },
763   { 0x0C, "6" },
764   { 0x12, "9" },
765   { 0x16, "11" },
766   { 0x18, "12" },
767   { 0x1B, "13.5" },
768   { 0x24, "18" },
769   { 0x2C, "22" },
770   { 0x30, "24" },
771   { 0x36, "27" },
772   { 0x42, "33" },
773   { 0x48, "36" },
774   { 0x60, "48" },
775   { 0x6C, "54" },
776   { 0x82, "1(B)" },
777   { 0x83, "1.5(B)" },
778   { 0x84, "2(B)" },
779   { 0x85, "2.5(B)" },
780   { 0x86, "3(B)" },
781   { 0x89, "4.5(B)" },
782   { 0x8B, "5.5(B)" },
783   { 0x8C, "6(B)" },
784   { 0x92, "9(B)" },
785   { 0x96, "11(B)" },
786   { 0x98, "12(B)" },
787   { 0x9B, "13.5(B)" },
788   { 0xA4, "18(B)" },
789   { 0xAC, "22(B)" },
790   { 0xB0, "24(B)" },
791   { 0xB6, "27(B)" },
792   { 0xC2, "33(B)" },
793   { 0xC8, "36(B)" },
794   { 0xE0, "48(B)" },
795   { 0xEC, "54(B)" },
796   { 0xFF, "BSS requires support for mandatory features of HT PHY (IEEE 802.11 - Clause 20)" },
797   { 0,    NULL}
798 };
799 value_string_ext ieee80211_supported_rates_vals_ext = VALUE_STRING_EXT_INIT(ieee80211_supported_rates_vals);
800
801 /* ************************************************************************* */
802 /*                         8.4.1.7 Reason Code field                         */
803 /* ************************************************************************* */
804 static const value_string ieee80211_reason_code[] = {
805   {  1, "Unspecified reason" },
806   {  2, "Previous authentication no longer valid" },
807   {  3, "Deauthenticated because sending STA is leaving (or has left) IBSS or ESS" },
808   {  4, "Disassociated due to inactivity" },
809   {  5, "Disassociated because AP is unable to handle all currently associated STAs" },
810   {  6, "Class 2 frame received from nonauthenticated STA" },
811   {  7, "Class 3 frame received from nonassociated STA" },
812   {  8, "Disassociated because sending STA is leaving (or has left) BSS" },
813   {  9, "STA requesting (re)association is not authenticated with responding STA" },
814   { 10, "Disassociated because the information in the Power Capability element is unacceptable" },
815   { 11, "Disassociated because the information in the Supported Channels element is unacceptable" },
816   { 12, "Reserved" },
817   { 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" },
818   { 14, "Message integrity code (MIC) failure" },
819   { 15, "4-Way Handshake timeout" },
820   { 16, "Group Key Handshake timeout" },
821   { 17, "Information element in 4-Way Handshake different from (Re)Association Request/Probe Response/Beacon frame" },
822   { 18, "Invalid group cipher" },
823   { 19, "Invalid pairwise cipher" },
824   { 20, "Invalid AKMP" },
825   { 21, "Unsupported RSN information element version" },
826   { 22, "Invalid RSN information element capabilities" },
827   { 23, "IEEE 802.1X authentication failed" },
828   { 24, "Cipher suite rejected because of the security policy" },
829   { 25, "TDLS direct-link teardown due to TDLS peer STA unreachable via the TDLS direct link" },
830   { 26, "TDLS direct-link teardown for unspecified reason" },
831   { 27, "Disassociated because session terminated by SSP request" },
832   { 28, "Disassociated because of lack of SSP roaming agreement" },
833   { 29, "Requested service rejected because of SSP cipher suite or AKM requirement " },
834   { 30, "Requested service not authorized in this location" },
835   { 31, "TS deleted because QoS AP lacks sufficient bandwidth for this QoS STA due to a change in BSS service characteristics or operational mode" },
836   { 32, "Disassociated for unspecified, QoS-related reason" },
837   { 33, "Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA" },
838   { 34, "Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions" },
839   { 35, "Disassociated because STA is transmitting outside the limits of its TXOPs" },
840   { 36, "Requested from peer STA as the STA is leaving the BSS (or resetting)" },
841   { 37, "Requested from peer STA as it does not want to use the mechanism" },
842   { 38, "Requested from peer STA as the STA received frames using the mechanism for which a setup is required" },
843   { 39, "Requested from peer STA due to timeout" },
844   { 45, "Peer STA does not support the requested cipher suite" },
845   { 46, "Disassociated because authorized access limit reached" },
846   { 47, "Disassociated due to external service requirements" },
847   { 48, "Invalid FT Action frame count" },
848   { 49, "Invalid pairwise master key identifier (PMKI)" },
849   { 50, "Invalid MDE" },
850   { 51, "Invalid FTE" },
851   { 52, "SME cancels the mesh peering instance with the reason other than reaching the maximum number of peer mesh STAs" },
852   { 53, "The mesh STA has reached the supported maximum number of peer mesh STAs" },
853   { 54, "The received information violates the Mesh Configuration policy configured in the mesh STA profile" },
854   { 55, "The mesh STA has received a Mesh Peering Close message requesting to close the mesh peering" },
855   { 56, "The mesh STA has re-sent dot11MeshMaxRetries Mesh Peering Open messages, without receiving a Mesh Peering Confirm message" },
856   { 57, "The confirmTimer for the mesh peering instance times out" },
857   { 58, "The mesh STA fails to unwrap the GTK or the values in the wrapped contents do not match" },
858   { 59, "The mesh STA receives inconsistent information about the mesh parameters between Mesh Peering Management frames" },
859   { 60, "The mesh STA fails the authenticated mesh peering exchange because due to failure in selecting either the pairwise ciphersuite or group ciphersuite" },
860   { 61, "The mesh STA does not have proxy information for this external destination" },
861   { 62, "The mesh STA does not have forwarding information for this destination" },
862   { 63, "The mesh STA determines that the link to the next hop of an active path in its forwarding information is no longer usable" },
863   { 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)" },
864   { 65, "The mesh STA performs channel switch to meet regulatory requirements" },
865   { 66, "The mesh STA performs channel switch with unspecified reason" },
866   { 0,    NULL}
867 };
868 static value_string_ext ieee80211_reason_code_ext = VALUE_STRING_EXT_INIT(ieee80211_reason_code);
869
870 /* ************************************************************************* */
871 /*                         8.4.1.9 Status Code field                         */
872 /* ************************************************************************* */
873 static const value_string ieee80211_status_code[] = {
874   {  0, "Successful" },
875   {  1, "Unspecified failure" },
876   {  2, "TDLS wakeup schedule rejected but alternative schedule provided" },
877   {  3, "TDLS wakeup schedule rejected" },
878   {  4, "Reserved" },
879   {  5, "Security disabled" },
880   {  6, "Unacceptable lifetime" },
881   {  7, "Not in same BSS" },
882   {  8, "Reserved" },
883   {  9, "Reserved" },
884   { 10, "Cannot support all requested capabilities in the Capability Information field" },
885   { 11, "Reassociation denied due to inability to confirm that association exists" },
886   { 12, "Association denied due to reason outside the scope of this standard" },
887   { 13, "Responding STA does not support the specified authentication algorithm" },
888   { 14, "Received an Authentication frame with authentication transaction sequence number out of expected sequence" },
889   { 15, "Authentication rejected because of challenge failure" },
890   { 16, "Authentication rejected due to timeout waiting for next frame in sequence" },
891   { 17, "Association denied because AP is unable to handle additional associated STAs" },
892   { 18, "Association denied due to requesting STA not supporting all of the data rates in the BSSBasicRateSet parameter" },
893   { 19, "Association denied due to requesting STA not supporting the short preamble option" },
894   { 20, "Association denied due to requesting STA not supporting the PBCC modulation option" },
895   { 21, "Association denied due to requesting STA not supporting the Channel Agility option" },
896   { 22, "Association request rejected because Spectrum Management capability is required" },
897   { 23, "Association request rejected because the information in the Power Capability element is unacceptable" },
898   { 24, "Association request rejected because the information in the Supported Channels element is unacceptable" },
899   { 25, "Association denied due to requesting STA not supporting the Short Slot Time option" },
900   { 26, "Association denied due to requesting STA not supporting the DSSS-OFDM option" },
901   { 27, "Reserved Association denied because the requesting STA does not support HT features" },
902   { 28, "R0KH unreachable" },
903   { 29, "Association denied because the requesting STA does not support the phased coexistence operation (PCO) transition time required by the AP" },
904   { 30, "Association request rejected temporarily; try again later" },
905   { 31, "Robust Management frame policy violation" },
906   { 32, "Unspecified, QoS-related failure" },
907   { 33, "Association denied because QoS AP or PCP has insufficient bandwidth to handle another QoS STA" },
908   { 34, "Association denied due to excessive frame loss rates and/or poor conditions on current operating channel" },
909   { 35, "Association (with QoS BSS) denied because the requesting STA does not support the QoS facility" },
910   { 36, "Reserved" },
911   { 37, "The request has been declined" },
912   { 38, "The request has not been successful as one or more parameters have invalid values" },
913   { 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" },
914   { 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" },
915   { 41, "Invalid group cipher" },
916   { 42, "Invalid pairwise cipher" },
917   { 43, "Invalid AKMP" },
918   { 44, "Unsupported RSN information element version" },
919   { 45, "Invalid RSN information element capabilities" },
920   { 46, "Cipher suite rejected because of security policy" },
921   { 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" },
922   { 48, "Direct link is not allowed in the BSS by policy" },
923   { 49, "The Destination STA is not present within this BSS" },
924   { 50, "The Destination STA is not a QoS STA" },
925   { 51, "Association denied because the ListenInterval is too large" },
926   { 52, "Invalid FT Action frame count" },
927   { 53, "Invalid pairwise master key identifier (PMKID)" },
928   { 54, "Invalid MDIE" },
929   { 55, "Invalid FTIE" },
930   { 56, "Requested TCLAS processing is not supported by the PCP/AP" },
931   { 57, "The PCP/AP has insufficient TCLAS processing resources to satisfy the request" },
932   { 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" },
933   { 59, "GAS Advertisement Protocol not supported" },
934   { 60, "No outstanding GAS request" },
935   { 61, "GAS Response not received from the Advertisement Server" },
936   { 62, "STA timed out waiting for GAS Query Response" },
937   { 63, "GAS Response is larger than query response length limit" },
938   { 64, "Request refused because home network does not support request" },
939   { 65, "Advertisement Server in the network is not currently reachable" },
940   { 66, "Reserved" },
941   { 67, "Request refused due to permissions received via SSPN interface" },
942   { 68, "Request refused because PCP/AP does not support unauthenticated access" },
943   { 69, "Reserved" },
944   { 70, "Reserved" },
945   { 71, "Reserved" },
946   { 72, "Invalid contents of RSNIE" },
947   { 73, "U-APSD Coexistence is not supported" },
948   { 74, "Requested U-APSD Coexistence mode is not supported" },
949   { 75, "Requested Interval/Duration value cannot be supported with U-APSD Coexistence" },
950   { 76, "Authentication is rejected because an Anti-Clogging Token is required" },
951   { 77, "Authentication is rejected because the offered finite cyclic group is not supported" },
952   { 78, "The TBTT adjustment request has not been successful because the STA could not find an alternative TBTT" },
953   { 79, "Transmission failure" },
954   { 80, "Requested TCLAS Not Supported" },
955   { 81, "TCLAS Resources Exhausted" },
956   { 82, "Rejected with Suggested BSS Transition" },
957   { 83, "Reject with recommended schedule" },
958   { 84, "Reject because no wakeup schedule specified" },
959   { 85, "Success, the destination STA is in power save mode" },
960   { 86, "FST pending, in process of admitting FST session" },
961   { 87, "performing FST now" },
962   { 88, "FST pending, gap(s) in Block Ack window" },
963   { 89, "Reject because of U-PID setting" },
964   { 92, "(Re)association refused for some external reason" },
965   { 93, "(Re)association refused because of memory limits at the AP" },
966   { 94, "(Re)association refused because emergency services are not supported at the AP" },
967   { 95, "GAS query response not yet received" },
968   { 96, "Reject since the request is for transition to a frequency band subject to DSE procedures and FST initiator is a dependent STA" },
969   { 97, "Reserved" },
970   { 98, "Reserved" },
971   { 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" },
972   { 100, "The request failed due to a reservation conflict" },
973   { 101, "The request failed due to exceeded MAF limit" },
974   { 102, "The request failed due to exceeded MCCA track limit" },
975   { 103, "Association denied because the information in the Spectrum Management field is unacceptable" },
976   { 104, "Association denied because the requesting STA does not support VHT features" },
977   { 105, "Enablement denied" },
978   { 106, "Enablement denied due to restriction from an authorized GDB" },
979   { 107, "Authorization deenabled" },
980   { 0,    NULL}
981 };
982 static value_string_ext ieee80211_status_code_ext = VALUE_STRING_EXT_INIT(ieee80211_status_code);
983
984 static const value_string ieee80211_transition_reasons[] = {
985   { 0, "Unspecified" },
986   { 1, "Excessive frame loss rates and/or poor conditions" },
987   { 2, "Excessive delay for current traffic streams" },
988   { 3, "Insufficient QoS capacity for current traffic streams (TSPEC rejected)" },
989   { 4, "First association to ESS (the association initiated by an Association Request frame instead of a Reassociation Request frame)" },
990   { 5, "Load balancing" },
991   { 6, "Better AP found" },
992   { 7, "Deauthenticated or Disassociated from the previous AP" },
993   { 8, "AP failed IEEE 802.1X EAP Authentication" },
994   { 9, "AP failed 4-way handshake" },
995   { 10, "Received too many replay counter failures" },
996   { 11, "Received too many data MIC failures" },
997   { 12, "Exceeded maximum number of retransmissions" },
998   { 13, "Received too many broadcast disassociations" },
999   { 14, "Received too many broadcast deauthentications" },
1000   { 15, "Previous transition failed" },
1001   { 16, "Low RSSI" },
1002   { 17, "Roam from a non-IEEE-802.11 system" },
1003   { 18, "Transition due to received BSS Transition Request frame" },
1004   { 19, "Preferred BSS transition candidate list included" },
1005   { 20, "Leaving ESS" },
1006   { 0,    NULL}
1007 };
1008 /* ************************************************************************* */
1009 /*                         Frame types, and their names                      */
1010 /* ************************************************************************* */
1011 static const value_string frame_type_subtype_vals[] = {
1012   {MGT_ASSOC_REQ,             "Association Request"},
1013   {MGT_ASSOC_RESP,            "Association Response"},
1014   {MGT_REASSOC_REQ,           "Reassociation Request"},
1015   {MGT_REASSOC_RESP,          "Reassociation Response"},
1016   {MGT_PROBE_REQ,             "Probe Request"},
1017   {MGT_PROBE_RESP,            "Probe Response"},
1018   {MGT_MEASUREMENT_PILOT,     "Measurement Pilot"},
1019   {MGT_BEACON,                "Beacon frame"},
1020   {MGT_ATIM,                  "ATIM"},
1021   {MGT_DISASS,                "Disassociate"},
1022   {MGT_AUTHENTICATION,        "Authentication"},
1023   {MGT_DEAUTHENTICATION,      "Deauthentication"},
1024   {MGT_ACTION,                "Action"},
1025   {MGT_ACTION_NO_ACK,         "Action No Ack"},
1026   {MGT_ARUBA_WLAN,            "Aruba Management"},
1027
1028   {CTRL_TRIGGER,              "Trigger"},
1029   {CTRL_BEAMFORM_RPT_POLL,    "Beamforming Report Poll"},
1030   {CTRL_VHT_NDP_ANNC,         "VHT NDP Announcement"},
1031   {CTRL_CONTROL_WRAPPER,      "Control Wrapper"},
1032   {CTRL_BLOCK_ACK_REQ,        "802.11 Block Ack Req"},
1033   {CTRL_BLOCK_ACK,            "802.11 Block Ack"},
1034   {CTRL_PS_POLL,              "Power-Save poll"},
1035   {CTRL_RTS,                  "Request-to-send"},
1036   {CTRL_CTS,                  "Clear-to-send"},
1037   {CTRL_ACKNOWLEDGEMENT,      "Acknowledgement"},
1038   {CTRL_CFP_END,              "CF-End (Control-frame)"},
1039   {CTRL_CFP_ENDACK,           "CF-End + CF-Ack (Control-frame)"},
1040
1041   {DATA,                      "Data"},
1042   {DATA_CF_ACK,               "Data + CF-Ack"},
1043   {DATA_CF_POLL,              "Data + CF-Poll"},
1044   {DATA_CF_ACK_POLL,          "Data + CF-Ack + CF-Poll"},
1045   {DATA_NULL_FUNCTION,        "Null function (No data)"},
1046   {DATA_CF_ACK_NOD,           "Acknowledgement (No data)"},
1047   {DATA_CF_POLL_NOD,          "CF-Poll (No data)"},
1048   {DATA_CF_ACK_POLL_NOD,      "CF-Ack/Poll (No data)"},
1049   {DATA_QOS_DATA,             "QoS Data"},
1050   {DATA_QOS_DATA_CF_ACK,      "QoS Data + CF-Acknowledgment"},
1051   {DATA_QOS_DATA_CF_POLL,     "QoS Data + CF-Poll"},
1052   {DATA_QOS_DATA_CF_ACK_POLL, "QoS Data + CF-Ack + CF-Poll"},
1053   {DATA_QOS_NULL,             "QoS Null function (No data)"},
1054   {DATA_QOS_CF_POLL_NOD,      "QoS CF-Poll (No Data)"},
1055   {DATA_QOS_CF_ACK_POLL_NOD,  "QoS CF-Ack + CF-Poll (No data)"},
1056
1057   {EXTENSION_DMG_BEACON,      "DMG Beacon"},
1058
1059   {CTRL_POLL,                 "Poll"},
1060   {CTRL_SPR,                  "Service Period Request"},
1061   {CTRL_GRANT,                "Grant"},
1062   {CTRL_DMG_CTS,              "DMG Clear-to-send"},
1063   {CTRL_DMG_DTS,              "DMG Denial-to-send"},
1064   {CTRL_GRANT_ACK,            "Grant Acknowledgment"},
1065   {CTRL_SSW,                  "Sector Sweep"},
1066   {CTRL_SSW_FEEDBACK,         "Sector Sweep Feedback"},
1067   {CTRL_SSW_ACK,              "Sector Sweep Acknowledgment"},
1068
1069   {0,                         NULL}
1070 };
1071 static value_string_ext frame_type_subtype_vals_ext = VALUE_STRING_EXT_INIT(frame_type_subtype_vals);
1072
1073 /* ************************************************************************* */
1074 /*                 802.1D Tag Name (by WME Access Category Names)            */
1075 /* ************************************************************************* */
1076 static const value_string ieee80211_qos_tags_acs[] = {
1077   { 0, "Best Effort (Best Effort)" },
1078   { 1, "Background (Background)" },
1079   { 2, "Spare (Background)" },
1080   { 3, "Excellent Effort (Best Effort)" },
1081   { 4, "Controlled Load (Video)" },
1082   { 5, "Video (Video)" },
1083   { 6, "Voice (Voice)" },
1084   { 7, "Network Control (Voice)" },
1085   { 0, NULL }
1086 };
1087
1088 /* ************************************************************************* */
1089 /*                   WME Access Category Names (by WME ACI)                  */
1090 /* ************************************************************************* */
1091 static const value_string wme_acs[] = {
1092   { 0, "Best Effort" },
1093   { 1, "Background" },
1094   { 2, "Video" },
1095   { 3, "Voice" },
1096   { 0, NULL }
1097 };
1098
1099 /* ************************************************************************* */
1100 /*                  Aruba Management Type                                    */
1101 /* ************************************************************************* */
1102 static const value_string aruba_mgt_typevals[] = {
1103   { 0x0001,       "Hello" },
1104   { 0x0002,       "Probe" },
1105   { 0x0003,       "MTU" },
1106   { 0x0004,       "Ageout" },
1107   { 0x0005,       "Heartbeat" },
1108   { 0x0006,       "Deauth" },
1109   { 0x0007,       "Disassoc" },
1110   { 0x0008,       "Probe response" },
1111   { 0x0009,       "Tunnel update" },
1112   { 0x000A,       "Laser beam active" },
1113   { 0x000B,       "Client IP" },
1114   { 0x000C,       "Laser beam active v2" },
1115   { 0x000D,       "AP statistics" },
1116   { 0,            NULL }
1117 };
1118 static value_string_ext aruba_mgt_typevals_ext = VALUE_STRING_EXT_INIT(aruba_mgt_typevals);
1119
1120 /*** Begin: Action Fixed Parameter ***/
1121 #define CAT_SPECTRUM_MGMT          0
1122 #define CAT_QOS                    1
1123 #define CAT_DLS                    2
1124 #define CAT_BLOCK_ACK              3
1125 #define CAT_PUBLIC                 4
1126 #define CAT_RADIO_MEASUREMENT      5
1127 #define CAT_FAST_BSS_TRANSITION    6
1128 #define CAT_HT                     7
1129 #define CAT_SA_QUERY               8
1130 #define CAT_PUBLIC_PROTECTED       9
1131 #define CAT_WNM                   10
1132 #define CAT_UNPROTECTED_WNM       11
1133 #define CAT_TDLS                  12
1134 #define CAT_MESH                  13
1135 #define CAT_MULTIHOP              14
1136 #define CAT_SELF_PROTECTED        15
1137 #define CAT_DMG                   16
1138 #define CAT_MGMT_NOTIFICATION     17
1139 #define CAT_FAST_SESSION_TRANSFER 18
1140 #define CAT_ROBUST_AV_STREAMING   19
1141 #define CAT_UNPROTECTED_DMG       20
1142 #define CAT_VHT                   21
1143 #define CAT_HE                    30
1144 #define CAT_PROTECTED_HE          31
1145 #define CAT_VENDOR_SPECIFIC_PROTECTED 126
1146 #define CAT_VENDOR_SPECIFIC     127
1147
1148 #define CAT_MESH_LINK_METRIC               31
1149 #define CAT_MESH_PATH_SELECTION            32
1150 #define CAT_MESH_INTERWORKING              33
1151 #define CAT_MESH_RESOURCE_COORDINATION     34
1152 #define CAT_MESH_SECURITY_ARCHITECTURE     35
1153
1154 #define SM_ACTION_MEASUREMENT_REQUEST   0
1155 #define SM_ACTION_MEASUREMENT_REPORT    1
1156 #define SM_ACTION_TPC_REQUEST           2
1157 #define SM_ACTION_TPC_REPORT            3
1158 #define SM_ACTION_CHAN_SWITCH_ANNC      4
1159 #define SM_ACTION_EXT_CHAN_SWITCH_ANNC  5
1160
1161 #define QOS_ACTION_ADDTS_REQUEST     0
1162 #define QOS_ACTION_ADDTS_RESPONSE    1
1163 #define QOS_ACTION_DELTS             2
1164 #define QOS_ACTION_SCHEDULE      3
1165 #define QOS_ACTION_MAP_CONFIGURE 4
1166
1167 #define DLS_ACTION_REQUEST       0
1168 #define DLS_ACTION_RESPONSE      1
1169 #define DLS_ACTION_TEARDOWN      2
1170
1171 #define BA_ADD_BLOCK_ACK_REQUEST    0
1172 #define BA_ADD_BLOCK_ACK_RESPONSE   1
1173 #define BA_DELETE_BLOCK_ACK         2
1174
1175 /* Keep in sync with PPA_* defines */
1176 #define PA_20_40_BSS_COEXISTENCE_MANAGEMENT 0
1177 #define PA_DSE_ENABLEMENT                   1
1178 #define PA_DSE_DEENABLEMENT                 2
1179 #define PA_DSE_REG_LOC_ANNOUNCEMENT         3
1180 #define PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT  4
1181 #define PA_DSE_MEASUREMENT_REQUEST          5
1182 #define PA_DSE_MEASUREMENT_REPORT           6
1183 #define PA_MEASUREMENT_PILOT                7
1184 #define PA_DSE_POWER_CONSTRAINT             8
1185 #define PA_VENDOR_SPECIFIC                  9
1186 #define PA_GAS_INITIAL_REQUEST             10
1187 #define PA_GAS_INITIAL_RESPONSE            11
1188 #define PA_GAS_COMEBACK_REQUEST            12
1189 #define PA_GAS_COMEBACK_RESPONSE           13
1190 #define PA_TDLS_DISCOVERY_RESPONSE         14
1191 #define PA_LOCATION_TRACK_NOTIFICATION     15
1192 #define PA_QAB_REQUEST                     16
1193 #define PA_QAB_RESPONSE                    17
1194
1195 /* Keep in sync with PA_* defines */
1196 #define PPA_DSE_ENABLEMENT                   1
1197 #define PPA_DSE_DEENABLEMENT                 2
1198 #define PPA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT  4
1199 #define PPA_DSE_MEASUREMENT_REQUEST          5
1200 #define PPA_DSE_MEASUREMENT_REPORT           6
1201 #define PPA_DSE_POWER_CONSTRAINT             8
1202 #define PPA_VENDOR_SPECIFIC                  9
1203 #define PPA_GAS_INITIAL_REQUEST             10
1204 #define PPA_GAS_INITIAL_RESPONSE            11
1205 #define PPA_GAS_COMEBACK_REQUEST            12
1206 #define PPA_GAS_COMEBACK_RESPONSE           13
1207 #define PPA_QAB_REQUEST                     16
1208 #define PPA_QAB_RESPONSE                    17
1209
1210 #define HT_ACTION_NOTIFY_CHAN_WIDTH           0
1211 #define HT_ACTION_SM_PWR_SAVE                 1
1212 #define HT_ACTION_PSMP_ACTION                 2
1213 #define HT_ACTION_SET_PCO_PHASE               3
1214 #define HT_ACTION_MIMO_CSI                    4
1215 #define HT_ACTION_MIMO_BEAMFORMING            5
1216 #define HT_ACTION_MIMO_COMPRESSED_BEAMFORMING 6
1217 #define HT_ACTION_ANT_SEL_FEEDBACK            7
1218 #define HT_ACTION_HT_INFO_EXCHANGE            8
1219
1220 #define DMG_ACTION_PWR_SAVE_CONFIG_REQ           0
1221 #define DMG_ACTION_PWR_SAVE_CONFIG_RES           1
1222 #define DMG_ACTION_INFO_REQ                      2
1223 #define DMG_ACTION_INFO_RES                      3
1224 #define DMG_ACTION_HANDOVER_REQ                  4
1225 #define DMG_ACTION_HANDOVER_RES                  5
1226 #define DMG_ACTION_DTP_REQ                       6
1227 #define DMG_ACTION_DTP_RES                       7
1228 #define DMG_ACTION_RELAY_SEARCH_REQ              8
1229 #define DMG_ACTION_RELAY_SEARCH_RES              9
1230 #define DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ 10
1231 #define DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES 11
1232 #define DMG_ACTION_RLS_REQ                       12
1233 #define DMG_ACTION_RLS_RES                       13
1234 #define DMG_ACTION_RLS_ANNOUNCE                  14
1235 #define DMG_ACTION_RLS_TEARDOWN                  15
1236 #define DMG_ACTION_RELAY_ACK_REQ                 16
1237 #define DMG_ACTION_RELAY_ACK_RES                 17
1238 #define DMG_ACTION_TPA_REQ                       18
1239 #define DMG_ACTION_TPA_RES                       19
1240 #define DMG_ACTION_TPA_REP                       20
1241 #define DMG_ACTION_ROC_REQ                       21
1242 #define DMG_ACTION_ROC_RES                       22
1243
1244 #define UNPROTECTED_DMG_ANNOUNCE                 0
1245 #define UNPROTECTED_DMG_BRP                      1
1246
1247 #define FST_SETUP_REQUEST                        0
1248 #define FST_SETUP_RESPONSE                       1
1249 #define FST_TEAR_DOWN                            2
1250 #define FST_ACK_REQUEST                          3
1251 #define FST_ACK_RESPONSE                         4
1252 #define FST_ON_CHANNEL_TUNNEL_REQUEST            5
1253
1254 /* IEEE Std 802.11r-2008, 7.4.8, Table 7-57g */
1255 #define FT_ACTION_REQUEST               1
1256 #define FT_ACTION_RESPONSE              2
1257 #define FT_ACTION_CONFIRM               3
1258 #define FT_ACTION_ACK                   4
1259
1260 /* SA Query Action frame codes (IEEE 802.11w-2009, 7.4.9) */
1261 #define SA_QUERY_REQUEST                0
1262 #define SA_QUERY_RESPONSE               1
1263
1264 /* IEEE Std 802.11z-2010, 7.4.11, Table 7-57v1 */
1265 #define TDLS_SETUP_REQUEST              0
1266 #define TDLS_SETUP_RESPONSE             1
1267 #define TDLS_SETUP_CONFIRM              2
1268 #define TDLS_TEARDOWN                   3
1269 #define TDLS_PEER_TRAFFIC_INDICATION    4
1270 #define TDLS_CHANNEL_SWITCH_REQUEST     5
1271 #define TDLS_CHANNEL_SWITCH_RESPONSE    6
1272 #define TDLS_PEER_PSM_REQUEST           7
1273 #define TDLS_PEER_PSM_RESPONSE          8
1274 #define TDLS_PEER_TRAFFIC_RESPONSE      9
1275 #define TDLS_DISCOVERY_REQUEST          10
1276
1277 /* IEEE Std 802.11-2012, 8.5.7.1, Table 8-206 */
1278 #define RM_ACTION_RADIO_MEASUREMENT_REQUEST         0
1279 #define RM_ACTION_RADIO_MEASUREMENT_REPORT          1
1280 #define RM_ACTION_LINK_MEASUREMENT_REQUEST          2
1281 #define RM_ACTION_LINK_MEASUREMENT_REPORT           3
1282 #define RM_ACTION_NEIGHBOR_REPORT_REQUEST           4
1283 #define RM_ACTION_NEIGHBOR_REPORT_RESPONSE          5
1284
1285 /* 11s draft 12.0, table 7-57v30 */
1286 #define MESH_ACTION_LINK_METRIC_REPORT              0
1287 #define MESH_ACTION_HWMP                            1
1288 #define MESH_ACTION_GATE_ANNOUNCE                   2
1289 #define MESH_ACTION_CONGESTION_CTL                  3
1290 #define MESH_ACTION_MCCA_SETUP_REQUEST              4
1291 #define MESH_ACTION_MCCA_SETUP_REPLY                5
1292 #define MESH_ACTION_MCCA_ADV_REQUEST                6
1293 #define MESH_ACTION_MCCA_ADV                        7
1294 #define MESH_ACTION_MCCA_TEARDOWN                   8
1295 #define MESH_ACTION_TBTT_ADJ_REQUEST                9
1296 #define MESH_ACTION_TBTT_ADJ_RESPONSE              10
1297
1298 /* 11s draft 12.0, table 7-57v42: Multihop Action field values */
1299 #define MULTIHOP_ACTION_PROXY_UPDATE                0
1300 #define MULTIHOP_ACTION_PROXY_UPDATE_CONF           1
1301
1302 /* 11s draft 12.0, table 7-57v24: Self-protected Action field values */
1303 #define SELFPROT_ACTION_MESH_PEERING_OPEN           1
1304 #define SELFPROT_ACTION_MESH_PEERING_CONFIRM        2
1305 #define SELFPROT_ACTION_MESH_PEERING_CLOSE          3
1306 #define SELFPROT_ACTION_MESH_GROUP_KEY_INFORM       4
1307 #define SELFPROT_ACTION_MESH_GROUP_KEY_ACK          5
1308
1309 /* 11s draft 12.0, table 7-43bj6: Mesh Peering Protocol Identifier field values */
1310 #define MESH_PEERING_PROTO_MGMT                     0
1311 #define MESH_PEERING_PROTO_AMPE                     1
1312 #define MESH_PEERING_PROTO_VENDOR                 255
1313
1314 /* Vendor actions */
1315 /* MARVELL */
1316 #define MRVL_ACTION_MESH_MANAGEMENT     1
1317
1318 #define MRVL_MESH_MGMT_ACTION_RREQ      0
1319 #define MRVL_MESH_MGMT_ACTION_RREP      1
1320 #define MRVL_MESH_MGMT_ACTION_RERR      2
1321 #define MRVL_MESH_MGMT_ACTION_PLDM      3
1322
1323 #define ANQP_INFO_ANQP_QUERY_LIST                256
1324 #define ANQP_INFO_ANQP_CAPAB_LIST                257
1325 #define ANQP_INFO_VENUE_NAME_INFO                258
1326 #define ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO     259
1327 #define ANQP_INFO_NETWORK_AUTH_TYPE_INFO         260
1328 #define ANQP_INFO_ROAMING_CONSORTIUM_LIST        261
1329 #define ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO 262
1330 #define ANQP_INFO_NAI_REALM_LIST                 263
1331 #define ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO     264
1332 #define ANQP_INFO_AP_GEOSPATIAL_LOCATION         265
1333 #define ANQP_INFO_AP_CIVIC_LOCATION              266
1334 #define ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI      267
1335 #define ANQP_INFO_DOMAIN_NAME_LIST               268
1336 #define ANQP_INFO_EMERGENCY_ALERT_ID_URI         269
1337 #define ANQP_INFO_TDLS_CAPAB_INFO                270
1338 #define ANQP_INFO_EMERGENCY_NAI                  271
1339 #define ANQP_INFO_NEIGHBOR_REPORT                272
1340 #define ANQP_INFO_VENUE_URL                      277
1341 #define ANQP_INFO_ADVICE_OF_CHARGE               278
1342 #define ANQP_INFO_LOCAL_CONTENT                  279
1343 #define ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST    56797
1344
1345 /* ANQP information ID - IEEE Std 802.11u-2011 - Table 7-43bk */
1346 static const value_string anqp_info_id_vals[] = {
1347   {ANQP_INFO_ANQP_QUERY_LIST, "ANQP Query list"},
1348   {ANQP_INFO_ANQP_CAPAB_LIST, "ANQP Capability list"},
1349   {ANQP_INFO_VENUE_NAME_INFO, "Venue Name information"},
1350   {ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO, "Emergency Call Number information"},
1351   {ANQP_INFO_NETWORK_AUTH_TYPE_INFO,
1352    "Network Authentication Type information"},
1353   {ANQP_INFO_ROAMING_CONSORTIUM_LIST, "Roaming Consortium list"},
1354   {ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO,
1355    "IP Address Type Availability information"},
1356   {ANQP_INFO_NAI_REALM_LIST, "NAI Realm list"},
1357   {ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO, "3GPP Cellular Network information"},
1358   {ANQP_INFO_AP_GEOSPATIAL_LOCATION, "AP Geospatial Location"},
1359   {ANQP_INFO_AP_CIVIC_LOCATION, "AP Civic Location"},
1360   {ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI, "AP Location Public Identifier URI"},
1361   {ANQP_INFO_DOMAIN_NAME_LIST, "Domain Name list"},
1362   {ANQP_INFO_EMERGENCY_ALERT_ID_URI, "Emergency Alert Identifier URI"},
1363   {ANQP_INFO_TDLS_CAPAB_INFO, "TDLS Capability information"},
1364   {ANQP_INFO_EMERGENCY_NAI, "Emergency NAI"},
1365   {ANQP_INFO_NEIGHBOR_REPORT, "Neighbor Report"},
1366   {ANQP_INFO_VENUE_URL, "Venue URL"},
1367   {ANQP_INFO_ADVICE_OF_CHARGE, "Advice of Charge"},
1368   {ANQP_INFO_LOCAL_CONTENT, "Local Content"},
1369   {ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST, "ANQP vendor-specific list"},
1370   {0, NULL}
1371 };
1372 static value_string_ext anqp_info_id_vals_ext = VALUE_STRING_EXT_INIT(anqp_info_id_vals);
1373
1374 /* IEEE 802.11v - WNM Action field values */
1375 enum wnm_action {
1376   WNM_EVENT_REQ = 0,
1377   WNM_EVENT_REPORT = 1,
1378   WNM_DIAGNOSTIC_REQ = 2,
1379   WNM_DIAGNOSTIC_REPORT = 3,
1380   WNM_LOCATION_CFG_REQ = 4,
1381   WNM_LOCATION_CFG_RESP = 5,
1382   WNM_BSS_TRANS_MGMT_QUERY = 6,
1383   WNM_BSS_TRANS_MGMT_REQ = 7,
1384   WNM_BSS_TRANS_MGMT_RESP = 8,
1385   WNM_FMS_REQ = 9,
1386   WNM_FMS_RESP = 10,
1387   WNM_COLLOCATED_INTERFERENCE_REQ = 11,
1388   WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
1389   WNM_TFS_REQ = 13,
1390   WNM_TFS_RESP = 14,
1391   WNM_TFS_NOTIFY = 15,
1392   WNM_SLEEP_MODE_REQ = 16,
1393   WNM_SLEEP_MODE_RESP = 17,
1394   WNM_TIM_BROADCAST_REQ = 18,
1395   WNM_TIM_BROADCAST_RESP = 19,
1396   WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
1397   WNM_CHANNEL_USAGE_REQ = 21,
1398   WNM_CHANNEL_USAGE_RESP = 22,
1399   WNM_DMS_REQ = 23,
1400   WNM_DMS_RESP = 24,
1401   WNM_TIMING_MEASUREMENT_REQ = 25,
1402   WNM_NOTIFICATION_REQ = 26,
1403   WNM_NOTIFICATION_RESP = 27
1404 };
1405
1406 static const value_string wnm_action_codes[] = {
1407   { WNM_EVENT_REQ, "Event Request" },
1408   { WNM_EVENT_REPORT, "Event Report" },
1409   { WNM_DIAGNOSTIC_REQ, "Diagnostic Request" },
1410   { WNM_DIAGNOSTIC_REPORT, "Diagnostic Report" },
1411   { WNM_LOCATION_CFG_REQ, "Location Configuration Request" },
1412   { WNM_LOCATION_CFG_RESP, "Location Configuration Response" },
1413   { WNM_BSS_TRANS_MGMT_QUERY, "BSS Transition Management Query" },
1414   { WNM_BSS_TRANS_MGMT_REQ, "BSS Transition Management Request" },
1415   { WNM_BSS_TRANS_MGMT_RESP, "BSS Transition Management Response" },
1416   { WNM_FMS_REQ, "FMS Request" },
1417   { WNM_FMS_RESP, "FMS Response" },
1418   { WNM_COLLOCATED_INTERFERENCE_REQ, "Collocated Interference Request" },
1419   { WNM_COLLOCATED_INTERFERENCE_REPORT, "Collocated Interference Report" },
1420   { WNM_TFS_REQ, "TFS Request" },
1421   { WNM_TFS_RESP, "TFS Response" },
1422   { WNM_TFS_NOTIFY, "TFS Notify" },
1423   { WNM_SLEEP_MODE_REQ, "WNM-Sleep Mode Request" },
1424   { WNM_SLEEP_MODE_RESP, "WNM-Sleep Mode Response" },
1425   { WNM_TIM_BROADCAST_REQ, "TIM Broadcast Request" },
1426   { WNM_TIM_BROADCAST_RESP, "TIM Broadcast Response" },
1427   { WNM_QOS_TRAFFIC_CAPAB_UPDATE, "QoS Traffic Capability Update" },
1428   { WNM_CHANNEL_USAGE_REQ, "Channel Usage Request" },
1429   { WNM_CHANNEL_USAGE_RESP, "Channel Usage Response" },
1430   { WNM_DMS_REQ, "DMS Request" },
1431   { WNM_DMS_RESP, "DMS Response" },
1432   { WNM_TIMING_MEASUREMENT_REQ, "Timing Measurement Request" },
1433   { WNM_NOTIFICATION_REQ, "WNM-Notification Request" },
1434   { WNM_NOTIFICATION_RESP, "WNM-Notification Response" },
1435   { 0, NULL }
1436 };
1437 static value_string_ext wnm_action_codes_ext = VALUE_STRING_EXT_INIT(wnm_action_codes);
1438
1439 enum unprotected_wnm_action {
1440   UNPROTECTED_WNM_TIM = 0,
1441   UNPROTECTED_WNM_TIMING_MEASUREMENT = 1
1442 };
1443
1444 static const value_string unprotected_wnm_action_codes[] = {
1445   { UNPROTECTED_WNM_TIM, "TIM" },
1446   { UNPROTECTED_WNM_TIMING_MEASUREMENT, "Timing Measurement" },
1447   { 0, NULL }
1448 };
1449 static value_string_ext unprotected_wnm_action_codes_ext = VALUE_STRING_EXT_INIT(unprotected_wnm_action_codes);
1450
1451 static const value_string wnm_notification_types[] = {
1452   { 0, "Firmware Update Notification" },
1453   { 1, "Reserved for use by WFA" },
1454   { 221, "Vendor Specific" },
1455   { 0, NULL }
1456 };
1457
1458 static value_string_ext wnm_notification_types_ext =
1459   VALUE_STRING_EXT_INIT(wnm_notification_types);
1460
1461 /*** End: Action Fixed Parameter ***/
1462
1463 static const value_string ieee80211_tag_measure_request_type_flags[] = {
1464   {0x00, "Basic Request"},
1465   {0x01, "Clear Channel Assessment (CCA) Request"},
1466   {0x02, "Receive Power Indication (RPI) Histogram Request"},
1467   {0x03, "Channel Load Request"},
1468   {0x04, "Noise Histogram Request"},
1469   {0x05, "Beacon Request"},
1470   {0x06, "Frame Request"},
1471   {0x07, "STA Statistics Request"},
1472   {0x08, "Location Configuration Indication (LCI) Request"},
1473   {0x09, "Transmit Stream Measurement Request"},
1474   {0x0A, "Measurement Pause Request"},
1475   {0x00, NULL}
1476 };
1477 static value_string_ext ieee80211_tag_measure_request_type_flags_ext =
1478   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_type_flags);
1479
1480 static const value_string ieee80211_tag_measure_report_type_flags[] = {
1481   { 0x00, "Basic Report" },
1482   { 0x01, "Clear Channel Assessment (CCA) Report" },
1483   { 0x02, "Receive Power Indication (RPI) Histogram Report" },
1484   { 0x03, "Channel Load Report" },
1485   { 0x04, "Noise Histogram Report" },
1486   { 0x05, "Beacon Report" },
1487   { 0x06, "Frame Report" },
1488   { 0x07, "STA Statistics Report" },
1489   { 0x08, "Location Configuration Information (LCI) Report" },
1490   { 0x09, "Transmit Stream Measurement Report" },
1491   { 0x00, NULL }
1492 };
1493 static value_string_ext ieee80211_tag_measure_report_type_flags_ext =
1494   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_report_type_flags);
1495
1496 static const true_false_string ieee80211_tag_measure_report_frame_info_frame_type_flag = {
1497   "Measurement Pilot Frame",
1498   "Beacon/Probe Response Frame"
1499 };
1500
1501 static const true_false_string ieee80211_tag_measure_map_field_bss_flag = {
1502   "At least one MPDU was received by another BSS or IBSS in the measurement period.",
1503   "No MPDUs were received from another BSS or IBSS in the measurement period."
1504 };
1505
1506 static const value_string ieee80211_tag_measure_request_measurement_mode_flags[] = {
1507   { 0x00, "Passive" },
1508   { 0x01, "Active" },
1509   { 0x02, "Beacon Table" },
1510   { 0x00, NULL }
1511 };
1512
1513 #define MEASURE_REQ_BEACON_SUB_SSID 0
1514 #define MEASURE_REQ_BEACON_SUB_BRI 1
1515 #define MEASURE_REQ_BEACON_SUB_RD 2
1516 #define MEASURE_REQ_BEACON_SUB_REQUEST 10
1517 #define MEASURE_REQ_BEACON_SUB_APCP 51
1518 #define MEASURE_REQ_BEACON_SUB_VS 221
1519
1520 static const value_string ieee80211_tag_measure_request_beacon_sub_id_flags[] = {
1521   { MEASURE_REQ_BEACON_SUB_SSID, "SSID" },
1522   { MEASURE_REQ_BEACON_SUB_BRI, "Beacon Reporting Information" },
1523   { MEASURE_REQ_BEACON_SUB_RD, "Reporting Detail" },
1524   { MEASURE_REQ_BEACON_SUB_REQUEST, "Request" },
1525   { MEASURE_REQ_BEACON_SUB_APCP, "AP Channel Report" },
1526   { MEASURE_REQ_BEACON_SUB_VS, "Vendor Specific" },
1527   { 0x00, NULL}
1528 };
1529
1530 static const value_string ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags[] = {
1531   { 0x00, "Report to be issued after each measurement." },
1532   { 0x01, "The measured RCPI level is greater than an absolute threshold." },
1533   { 0x02, "The measured RCPI level is less than an absolute threshold." },
1534   { 0x03, "The measured RSNI level is greater than an absolute threshold." },
1535   { 0x04, "The measured RSNI level is less than an absolute threshold." },
1536   { 0x05, "The measured RCPI level is greater than a threshold defined by an offset from the serving AP's reference RCPI." },
1537   { 0x06, "The measured RCPI level is less than a threshold defined by an offset from the serving AP's reference RCPI." },
1538   { 0x07, "The measured RSNI level is greater than a threshold defined by an offset from the serving AP's reference RSNI." },
1539   { 0x08, "The measured RSNI level is less than a threshold defined by an offset from the serving AP's reference RSNI." },
1540   { 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." },
1541   { 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." },
1542   { 0xfe, "Report not required to be issued" },
1543   { 0x00, NULL }
1544 };
1545
1546 static const value_string ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags[] = {
1547   { 0, "No fixed length fields or elements" },
1548   { 1, "All fixed length fields and any requested elements in the Request information element if present" },
1549   { 2, "All fixed length fields and elements (default, used when Reporting Detail subelement is not included in Beacon Request" },
1550   { 0x00, NULL }
1551 };
1552
1553 static const value_string ieee80211_tag_measure_request_group_id_flags[] = {
1554   { 0x00, "STA Counters from dot11CountersTable" },
1555   { 0x01, "STA Counters from dot11MacStatistics group" },
1556   { 0x02, "QoS STA Counters for UP0 from dot11QosCountersTable" },
1557   { 0x03, "QoS STA Counters for UP1 from dot11QosCountersTable" },
1558   { 0x04, "QoS STA Counters for UP2 from dot11QosCountersTable" },
1559   { 0x05, "QoS STA Counters for UP3 from dot11QosCountersTable" },
1560   { 0x06, "QoS STA Counters for UP4 from dot11QosCountersTable" },
1561   { 0x07, "QoS STA Counters for UP5 from dot11QosCountersTable" },
1562   { 0x08, "QoS STA Counters for UP6 from dot11QosCountersTable" },
1563   { 0x09, "QoS STA Counters for UP7 from dot11QosCountersTable" },
1564   { 0x0a, "BSS Average Access Delays" },
1565   { 0x0b, "STA Counters from dot11A-MSDU Group" },
1566   { 0x0c, "STA Counters from dot11A-MPDU Group" },
1567   { 0x0d, "STA Counters from dot11 BAR, Channel Width, PSMP Group" },
1568   { 0x0e, "STA Counters from dot11Protection Group" },
1569   { 0x0f, "STBC Group" },
1570   { 0x00, NULL }
1571 };
1572 static value_string_ext ieee80211_tag_measure_request_group_id_flags_ext =
1573   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_group_id_flags);
1574
1575 static const value_string ieee80211_tclas_process_flag[] = {
1576   {0x00, "Incoming MSDU's higher layer parameters have to match to the parameters in all associated TCLAS elements."},
1577   {0x01, "Incoming MSDU's higher layer parameters have to match to at least one of the associated TCLAS elements."},
1578   {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."},
1579   {0, NULL}
1580 };
1581
1582
1583 #define MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO 1
1584
1585 static const value_string ieee80211_tag_measure_request_channel_load_sub_id_vals[] = {
1586   { MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO, "Channel Load Reporting Information" },
1587   { 221, "Vendor Specific" },
1588   { 0x00, NULL}
1589 };
1590
1591 static const value_string ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals[] = {
1592   { 0x00, "Report to be issued after each measurement (default, used when Channel Load Reporting Information subelement is not included in Channel Load Request)." },
1593   { 0x01, "Report to be issued when measured Channel Load is equal to or greater than the reference value." },
1594   { 0x02, "Report to be issued when measured Channel Load is equal to or less than the reference value." },
1595   { 0x00, NULL}
1596 };
1597
1598 #define MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO 1
1599
1600 static const value_string ieee80211_tag_measure_request_noise_histogram_sub_id_vals[] = {
1601   { MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO, "Noise Histogram Reporting Information" },
1602   { 221, "Vendor Specific" },
1603   { 0x00, NULL}
1604 };
1605
1606 static const value_string ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals[] = {
1607   { 0x00, "Report to be issued after each measurement (default, used when Noise Histogram Reporting Information subelement is not included in Noise Histogram Request)." },
1608   { 0x01, "Noise Histogram Report to be issued when measured ANPI is equal to or greater than the reference value." },
1609   { 0x02, "Noise Histogram Report to be issued when measured ANPI is equal to or less than the reference value." },
1610   { 0x00, NULL}
1611 };
1612
1613 #define MEASURE_REP_REPORTED_FRAME_BODY 1
1614
1615 static const value_string ieee80211_tag_measure_report_beacon_sub_id_vals[] = {
1616   { MEASURE_REP_REPORTED_FRAME_BODY, "Reported Frame Body" },
1617   { 221, "Vendor Specific" },
1618   { 0x00, NULL}
1619 };
1620
1621 static const value_string frame_type[] = {
1622   {MGT_FRAME,       "Management frame"},
1623   {CONTROL_FRAME,   "Control frame"},
1624   {DATA_FRAME,      "Data frame"},
1625   {EXTENSION_FRAME, "Extension frame"},
1626   {0,               NULL}
1627 };
1628
1629 static const value_string tofrom_ds[] = {
1630   {0,                     "Not leaving DS or network is operating "
1631     "in AD-HOC mode (To DS: 0 From DS: 0)"},
1632   {FLAG_TO_DS,            "Frame from STA to DS via an AP (To DS: 1 "
1633     "From DS: 0)"},
1634   {FLAG_FROM_DS,          "Frame from DS to a STA via AP(To DS: 0 "
1635     "From DS: 1)"},
1636   {FLAG_TO_DS|FLAG_FROM_DS, "WDS (AP to AP) or Mesh (MP to MP) Frame "
1637     "(To DS: 1 From DS: 1)"},
1638   {0, NULL}
1639 };
1640
1641 static const true_false_string tods_flag = {
1642   "Frame is entering DS",
1643   "Frame is not entering DS"
1644 };
1645
1646 static const true_false_string fromds_flag = {
1647   "Frame is exiting DS",
1648   "Frame is not exiting DS"
1649 };
1650
1651 static const true_false_string more_fragments = {
1652   "More fragments follow",
1653   "This is the last fragment"
1654 };
1655
1656 static const true_false_string retry_flags = {
1657   "Frame is being retransmitted",
1658   "Frame is not being retransmitted"
1659 };
1660
1661 static const true_false_string pm_flags = {
1662   "STA will go to sleep",
1663   "STA will stay up"
1664 };
1665
1666 static const true_false_string md_flags = {
1667   "Data is buffered for STA at AP",
1668   "No data buffered"
1669 };
1670
1671 static const true_false_string protected_flags = {
1672   "Data is protected",
1673   "Data is not protected"
1674 };
1675
1676 static const true_false_string order_flags = {
1677   "Strictly ordered",
1678   "Not strictly ordered"
1679 };
1680
1681 static const true_false_string cf_ess_flags = {
1682   "Transmitter is an AP",
1683   "Transmitter is a STA"
1684 };
1685
1686
1687 static const true_false_string cf_privacy_flags = {
1688   "AP/STA can support WEP",
1689   "AP/STA cannot support WEP"
1690 };
1691
1692 static const true_false_string cf_ibss_flags = {
1693   "Transmitter belongs to an IBSS",
1694   "Transmitter belongs to a BSS"
1695 };
1696
1697 static const true_false_string eosp_flag = {
1698   "End of service period",
1699   "Service period"
1700 };
1701
1702 static const true_false_string bit4_flag = {
1703   "Bits 8-15 of QoS Control field are Queue Size",
1704   "Bits 8-15 of QoS Control field are TXOP Duration Requested"
1705 };
1706
1707 static const true_false_string ieee80211_qos_amsdu_present_flag = {
1708   "A-MSDU",
1709   "MSDU"
1710 };
1711
1712 static const true_false_string csa_txrestrict_flags = {
1713   "Tx Restrict",
1714   "No Tx Restrict"
1715 };
1716
1717 static const true_false_string csa_initiator_flags = {
1718   "Initiator",
1719   "Non Initiator"
1720 };
1721
1722 static const true_false_string mesh_config_cap_power_save_level_flags = {
1723    "One of the peer-specific mesh power modes is deep sleep mode",
1724    "No one is in deep sleep mode"
1725 };
1726
1727 static const value_string sta_cf_pollable[] = {
1728   {0x00, "Station is not CF-Pollable"},
1729   {0x02, "Station is CF-Pollable, not requesting to be placed on the  CF-polling list"},
1730   {0x01, "Station is CF-Pollable, requesting to be placed on the CF-polling list"},
1731   {0x03, "Station is CF-Pollable, requesting never to be polled"},
1732   {0x80, "QSTA requesting association in QBSS"},
1733   {0x81, "Reserved"},
1734   {0x82, "Reserved"},
1735   {0x83, "Reserved"},
1736   {0, NULL}
1737 };
1738
1739 static const value_string ap_cf_pollable[] = {
1740   {0x00, "No point coordinator at AP"},
1741   {0x02, "Point coordinator at AP for delivery only (no polling)"},
1742   {0x01, "Point coordinator at AP for delivery and polling"},
1743   {0x03, "Reserved"},
1744   {0x80, "QAP (HC) does not use CFP for delivery of unicast data type frames"},
1745   {0x82, "QAP (HC) uses CFP for delivery, but does not send CF-Polls to non-QoS STAs"},
1746   {0x81, "QAP (HC) uses CFP for delivery, and sends CF-Polls to non-QoS STAs"},
1747   {0x83, "Reserved"},
1748   {0, NULL}
1749 };
1750
1751
1752 static const value_string auth_alg[] = {
1753   {0x00, "Open System"},
1754   {0x01, "Shared key"},
1755   {0x02, "Fast BSS Transition"},
1756   {0x03, "Simultaneous Authentication of Equals (SAE)"},
1757   {0x04, "FILS Shared Key authentication without PFS"},
1758   {0x05, "FILS Shared Key authentication with PFS"},
1759   {0x06, "FILS Public Key authentication"},
1760   {0x80, "Network EAP"},  /* Cisco proprietary? */
1761   {0, NULL}
1762 };
1763
1764 static const true_false_string ff_block_ack_params_amsdu_permitted_flag = {
1765   "Permitted in QoS Data MPDUs",
1766   "Not Permitted"
1767 };
1768
1769 static const true_false_string ff_block_ack_params_policy_flag = {
1770   "Immediate Block Ack",
1771   "Delayed Block Ack"
1772 };
1773
1774 static const value_string  ff_channel_width_vals[] = {
1775   {0x00, "20 MHz channel width only"},
1776   {0x01, "Any channel width in the STA's Supported Channel Width Set"},
1777   {0, NULL}
1778 };
1779
1780 static const true_false_string ff_qos_info_ap_q_ack_flag = {
1781   "APs MIB attribute dot11QAckOptionImplemented is true",
1782   "APs MIB attribute dot11QAckOptionImplemented is false"
1783 };
1784
1785 static const true_false_string ff_qos_info_ap_queue_req_flag = {
1786   "AP can process a nonzero Queue Size subfield in the QoS Control field in QoS data frames",
1787   "AP cannot process a nonzero Queue Size subfield in the QoS Control field in QoS data frames"
1788 };
1789
1790 static const true_false_string ff_qos_info_ap_txop_request_flag = {
1791   "AP can process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames",
1792   "AP cannot process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames"
1793 };
1794
1795 static const true_false_string ff_qos_info_sta_ac_flag = {
1796   "Trigger-enabled and Delivery-enabled",
1797   "Neither Trigger-enabled nor Delivery-enabled"
1798 };
1799
1800 static const true_false_string ff_qos_info_sta_q_ack_flag = {
1801   "STAs MIB attribute dot11QAckOptionImplemented is true",
1802   "STAs MIB attribute dot11QAckOptionImplemented is false"
1803 };
1804
1805 static const value_string ff_qos_info_sta_max_sp_len_flags[] = {
1806   {0x00, "AP may deliver all buffered MSDUs, A-MSDUs and MMPDUs"},
1807   {0x01, "AP may deliver a maximum of two MSDUs, A-MSDUs and MMPDUs per SP"},
1808   {0x02, "AP may deliver a maximum of four MSDUs, A-MSDUs and MMPDUs per SP"},
1809   {0x03, "AP may deliver a maximum of six MSDUs, A-MSDUs and MMPDUs per SP"},
1810   {0, NULL}
1811 };
1812
1813 static const true_false_string ff_qos_info_sta_more_data_ack_flag = {
1814   "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",
1815   "STA cannot process ACK frames with the More Data bit in the Frame Control field set to 1"
1816 };
1817
1818 static const true_false_string ff_sm_pwr_save_sm_mode_flag = {
1819   "Dynamic SM Power Save mode",
1820   "Static SM Power Save mode"
1821 };
1822
1823 static const true_false_string ff_pco_phase_cntrl_flag = {
1824   "40 MHz Phase",
1825   "20 MHz Phase"
1826 };
1827
1828 static const true_false_string ff_psmp_param_set_more_psmp_flag = {
1829   "More PSMP Sequences Follow",
1830   "No PSMP Sequences Follow"
1831 };
1832
1833 static const value_string ff_mimo_cntrl_nc_index_flags[] = {
1834   {0x00, "1 Column"},
1835   {0x01, "2 Columns"},
1836   {0x02, "3 Columns"},
1837   {0x03, "4 Columns"},
1838   {0, NULL}
1839 };
1840
1841 static const value_string ff_mimo_cntrl_nr_index_flags[] = {
1842   {0x00, "1 Row"},
1843   {0x01, "2 Rows"},
1844   {0x02, "3 Rows"},
1845   {0x03, "4 Rows"},
1846   {0, NULL}
1847 };
1848
1849 static const true_false_string ff_mimo_cntrl_channel_width_flag = {
1850   "40 MHz",
1851   "20 MHz"
1852 };
1853
1854 static const true_false_string ff_ht_info_information_request_flag = {
1855   "Requesting HT Information Exchange management action frame",
1856   "Should not send an HT Information Exchange management action frame"
1857 };
1858
1859 static const true_false_string ff_ht_info_40_mhz_intolerant_flag = {
1860   "Transmitting station is intolerant of 40 MHz operation",
1861   "Transmitting station permits 40 MHz operation"
1862 };
1863
1864 static const true_false_string ff_ht_info_sta_chan_width_flag = {
1865   "40 MHz",
1866   "20 MHz"
1867 };
1868
1869 static const value_string ff_ht_action_flags[] = {
1870   {HT_ACTION_NOTIFY_CHAN_WIDTH,           "Notify Channel Width"},
1871   {HT_ACTION_SM_PWR_SAVE,                 "Spatial Multiplexing (SM) Power Save"},
1872   {HT_ACTION_PSMP_ACTION,                 "Power Save Multi-Poll (PSMP) action frame"},
1873   {HT_ACTION_SET_PCO_PHASE,               "Set PCO Phase"},
1874   {HT_ACTION_MIMO_CSI,                    "MIMO CSI Matrices"},
1875   {HT_ACTION_MIMO_BEAMFORMING,            "MIMO Non-compressed Beamforming"},
1876   {HT_ACTION_MIMO_COMPRESSED_BEAMFORMING, "MIMO Compressed Beamforming"},
1877   {HT_ACTION_ANT_SEL_FEEDBACK,            "Antenna Selection Indices Feedback"},
1878   {HT_ACTION_HT_INFO_EXCHANGE,            "HT Information Exchange"},
1879   {0x00, NULL}
1880 };
1881
1882 static const value_string ff_fst_action_flags[] = {
1883   {FST_SETUP_REQUEST,             "FST Setup Request"},
1884   {FST_SETUP_RESPONSE,            "FST Setup Response"},
1885   {FST_TEAR_DOWN,                 "FST Tear Down"},
1886   {FST_ACK_REQUEST,               "FST Ack Request"},
1887   {FST_ACK_RESPONSE,              "FST Ack Response"},
1888   {FST_ON_CHANNEL_TUNNEL_REQUEST, "FST On-channel Tunnel Request"},
1889   {0x00, NULL}
1890 };
1891
1892 static const value_string ff_dmg_action_flags[] = {
1893   {DMG_ACTION_PWR_SAVE_CONFIG_REQ,           "Power Save Configuration Request"},
1894   {DMG_ACTION_PWR_SAVE_CONFIG_RES,           "Power Save Configuration Response"},
1895   {DMG_ACTION_INFO_REQ,                      "Information Request"},
1896   {DMG_ACTION_INFO_RES,                      "Information Response"},
1897   {DMG_ACTION_HANDOVER_REQ,                  "Handover Request"},
1898   {DMG_ACTION_HANDOVER_RES,                  "Handover Response"},
1899   {DMG_ACTION_DTP_REQ,                       "DTP Request"},
1900   {DMG_ACTION_DTP_RES,                       "DTP Response"},
1901   {DMG_ACTION_RELAY_SEARCH_REQ,              "Relay Search Request"},
1902   {DMG_ACTION_RELAY_SEARCH_RES,              "Relay Search Response"},
1903   {DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ, "Multi Relay Channel Measurement Request"},
1904   {DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES, "Multi Relay Channel Measurement Response"},
1905   {DMG_ACTION_RLS_REQ,                       "RLS Request"},
1906   {DMG_ACTION_RLS_RES,                       "RLS Response"},
1907   {DMG_ACTION_RLS_ANNOUNCE,                  "RLS Announcement"},
1908   {DMG_ACTION_RLS_TEARDOWN,                  "RLS Teardown"},
1909   {DMG_ACTION_RELAY_ACK_REQ,                 "Relay ACK Request"},
1910   {DMG_ACTION_RELAY_ACK_RES,                 "Relay ACK Response"},
1911   {DMG_ACTION_TPA_REQ,                       "TPA Request"},
1912   {DMG_ACTION_TPA_RES,                       "TPA Response"},
1913   {DMG_ACTION_TPA_REP,                       "TPA Report"},
1914   {DMG_ACTION_ROC_REQ,                       "ROC Request"},
1915   {DMG_ACTION_ROC_RES,                       "ROC Response"},
1916   {0x00, NULL}
1917 };
1918
1919 static const value_string ff_unprotected_dmg_action_flags[] = {
1920   {UNPROTECTED_DMG_ANNOUNCE,      "Announce"},
1921   {UNPROTECTED_DMG_BRP,           "BRP"},
1922   {0x00, NULL}
1923 };
1924 static const value_string ff_mimo_cntrl_grouping_flags[] = {
1925   {0x00, "No Grouping"},
1926   {0x01, "Carrier Groups of 2"},
1927   {0x02, "Carrier Groups of 4"},
1928   {0x03, "Reserved"},
1929   {0, NULL}
1930 };
1931
1932 static const value_string ff_mimo_cntrl_coefficient_size_flags[] = {
1933   {0x00, "4 Bits"},
1934   {0x01, "5 Bits"},
1935   {0x02, "6 Bits"},
1936   {0x03, "8 Bits"},
1937   {0, NULL}
1938 };
1939
1940 static const value_string ff_mimo_cntrl_codebook_info_flags[] = {
1941   {0x00, "1 bit for 'Capital Psi', 3 bits for 'Small Psi'"},
1942   {0x01, "2 bit for 'Capital Psi', 4 bits for 'Small Psi'"},
1943   {0x02, "3 bit for 'Capital Psi', 5 bits for 'Small Psi'"},
1944   {0x03, "4 bit for 'Capital Psi', 6 bits for 'Small Psi'"},
1945   {0, NULL}
1946 };
1947
1948 static const value_string ff_ppa_action_codes[] = {
1949   {PPA_DSE_ENABLEMENT,                  "Protected DSE enablement"},
1950   {PPA_DSE_DEENABLEMENT,                "Protected DSE deenablement"},
1951   {PPA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Protected Extended Channel Switch Announcement"},
1952   {PPA_DSE_MEASUREMENT_REQUEST,         "Protected DSE measurement request"},
1953   {PPA_DSE_MEASUREMENT_REPORT,          "Protected DSE measurement report"},
1954   {PPA_DSE_POWER_CONSTRAINT,            "Protected DSE power constraint"},
1955   {PPA_VENDOR_SPECIFIC,                 "Protected Vendor Specific"},
1956   {PPA_GAS_INITIAL_REQUEST,             "Protected GAS Initial Request"},
1957   {PPA_GAS_INITIAL_RESPONSE,            "Protected GAS Initial Response"},
1958   {PPA_GAS_COMEBACK_REQUEST,            "Protected GAS Comeback Request"},
1959   {PPA_GAS_COMEBACK_RESPONSE,           "Protected GAS Comeback Response"},
1960   {PPA_QAB_REQUEST,                     "Protected QAB Request"},
1961   {PPA_QAB_RESPONSE,                    "Protected QAB Response"},
1962   {0x00, NULL}
1963 };
1964 static value_string_ext ff_ppa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_ppa_action_codes);
1965
1966 static const value_string ff_pa_action_codes[] = {
1967   {PA_20_40_BSS_COEXISTENCE_MANAGEMENT, "20/40 BSS Coexistence Management"},
1968   {PA_DSE_ENABLEMENT,                  "DSE enablement"},
1969   {PA_DSE_DEENABLEMENT,                "DSE deenablement"},
1970   {PA_DSE_REG_LOC_ANNOUNCEMENT,        "DSE Registered Location Announcement"},
1971   {PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement"},
1972   {PA_DSE_MEASUREMENT_REQUEST,         "DSE measurement request"},
1973   {PA_DSE_MEASUREMENT_REPORT,          "DSE measurement report"},
1974   {PA_MEASUREMENT_PILOT,               "Measurement Pilot"},
1975   {PA_DSE_POWER_CONSTRAINT,            "DSE power constraint"},
1976   {PA_VENDOR_SPECIFIC,                 "Vendor Specific"},
1977   {PA_GAS_INITIAL_REQUEST,             "GAS Initial Request"},
1978   {PA_GAS_INITIAL_RESPONSE,            "GAS Initial Response"},
1979   {PA_GAS_COMEBACK_REQUEST,            "GAS Comeback Request"},
1980   {PA_GAS_COMEBACK_RESPONSE,           "GAS Comeback Response"},
1981   {PA_TDLS_DISCOVERY_RESPONSE,         "TDLS Discovery Response"},
1982   {PA_LOCATION_TRACK_NOTIFICATION,     "Location Track Notification"},
1983   {PA_QAB_REQUEST,                     "QAB Request"},
1984   {PA_QAB_RESPONSE,                    "QAB Response"},
1985   {0x00, NULL}
1986 };
1987 static value_string_ext ff_pa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_pa_action_codes);
1988
1989 static const value_string category_codes[] = {
1990   {CAT_SPECTRUM_MGMT,                    "Spectrum Management (SM)"},
1991   {CAT_QOS,                              "Quality of Service (QoS)"},
1992   {CAT_DLS,                              "Direct-Link Setup (DLS)"},
1993   {CAT_BLOCK_ACK,                        "Block Ack"},
1994   {CAT_PUBLIC,                           "Public Action"},
1995   {CAT_RADIO_MEASUREMENT,                "Radio Measurement"},
1996   {CAT_FAST_BSS_TRANSITION,              "Fast BSS Transition"},
1997   {CAT_HT,                               "High Throughput"},
1998   {CAT_SA_QUERY,                         "SA Query"},
1999   {CAT_PUBLIC_PROTECTED,                 "Protected Dual of Public Action"},
2000   {CAT_WNM,                              "WNM"},
2001   {CAT_UNPROTECTED_WNM,                  "Unprotected WNM"},
2002   {CAT_TDLS,                             "TDLS"},
2003   {CAT_MESH,                             "MESH"},
2004   {CAT_MULTIHOP,                         "Multihop"},
2005   {CAT_SELF_PROTECTED,                   "Self-protected"},
2006   {CAT_DMG,                              "DMG"},
2007   {CAT_MGMT_NOTIFICATION,                "Management Notification"},
2008   {CAT_FAST_SESSION_TRANSFER,            "Fast Session Transfer"},
2009   {CAT_ROBUST_AV_STREAMING,              "Robust AV Streaming"},
2010   {CAT_UNPROTECTED_DMG,                  "Unprotected DMG"},
2011   {CAT_VHT,                              "VHT"},
2012   {CAT_HE,                               "HE"},
2013   {CAT_PROTECTED_HE,                     "Protected HE"},
2014   {CAT_VENDOR_SPECIFIC_PROTECTED,        "Vendor-specific Protected"},
2015   {CAT_VENDOR_SPECIFIC,                  "Vendor Specific"},
2016
2017   {0x80 | CAT_SPECTRUM_MGMT,             "Spectrum Management (SM) (error)"},
2018   {0x80 | CAT_QOS,                       "Quality of Service (QoS (error))"},
2019   {0x80 | CAT_DLS,                       "Direct-Link Setup (DLS) (error)"},
2020   {0x80 | CAT_BLOCK_ACK,                 "Block Ack (error)"},
2021   {0x80 | CAT_PUBLIC,                    "Public Action (error)"},
2022   {0x80 | CAT_RADIO_MEASUREMENT,         "Radio Measurement (error)"},
2023   {0x80 | CAT_FAST_BSS_TRANSITION,       "Fast BSS Transition (error)"},
2024   {0x80 | CAT_HT,                        "High Throughput (error)"},
2025   {0x80 | CAT_SA_QUERY,                  "SA Query (error)"},
2026   {0x80 | CAT_PUBLIC_PROTECTED,          "Protected Dual of Public Action (error)"},
2027   {0x80 | CAT_WNM,                       "WNM (error)"},
2028   {0x80 | CAT_UNPROTECTED_WNM,           "Unprotected WNM (error)"},
2029   {0x80 | CAT_TDLS,                      "TDLS (error)"},
2030   {0x80 | CAT_MESH,                      "Mesh (error)"},
2031   {0x80 | CAT_MULTIHOP,                  "Multihop (error)"},
2032   {0x80 | CAT_SELF_PROTECTED,            "Self-protected (error)"},
2033   {0x80 | CAT_DMG,                       "DMG (error)"},
2034   {0x80 | CAT_MGMT_NOTIFICATION,         "Management Notification (error)"},
2035   {0x80 | CAT_FAST_SESSION_TRANSFER,     "Fast Session Transfer (error)"},
2036   {0x80 | CAT_ROBUST_AV_STREAMING,       "Robust AV Streaming (error)"},
2037   {0x80 | CAT_UNPROTECTED_DMG,           "Unprotected DMG (error)"},
2038   {0x80 | CAT_VHT,                       "VHT"},
2039   {0x80 | CAT_VENDOR_SPECIFIC_PROTECTED, "Vendor-specific Protected (error)"},
2040   {0x80 | CAT_VENDOR_SPECIFIC,           "Vendor Specific (error)"},
2041   {0, NULL}
2042 };
2043 static value_string_ext category_codes_ext = VALUE_STRING_EXT_INIT(category_codes);
2044
2045 #define NR_SUB_ID_TSF_INFO                 1
2046 #define NR_SUB_ID_CON_COU_STR              2
2047 #define NR_SUB_ID_BSS_TRN_CAN_PREF         3
2048 #define NR_SUB_ID_BSS_TER_DUR              4
2049 #define NR_SUB_ID_BEARING                  5
2050 #define NR_SUB_ID_WIDE_BW_CHANNEL          6
2051
2052 #define NR_SUB_ID_MEASUREMENT_REPORT       39
2053 #define NR_SUB_ID_HT_CAPABILITIES          45
2054 #define NR_SUB_ID_HT_OPERATION             61
2055 #define NR_SUB_ID_SEC_CHANNEL_OFFSET       62
2056 #define NR_SUB_ID_MEASUREMENT_PILOT_INFO   66
2057 #define NR_SUB_ID_RM_ENABLE_CAP            70
2058 #define NR_SUB_ID_HT_MULTIPLE_BSSID        71
2059 #define NR_SUB_ID_VHT_CAPABILITIES         191
2060 #define NR_SUB_ID_VHT_OPERATION            192
2061 #define NR_SUB_ID_HE_CAPABILITIES          193
2062 #define NR_SUB_ID_HE_OPERATION             194
2063
2064 #define NR_SUB_ID_VENDOR_SPECIFIC          221
2065
2066 static const value_string ieee80211_neighbor_report_subelement_id_vals[] = {
2067   {NR_SUB_ID_TSF_INFO, "TSF Information"},
2068   {NR_SUB_ID_CON_COU_STR, "Condensed Country String"},
2069   {NR_SUB_ID_BSS_TRN_CAN_PREF, "BSS Transition Candidate Preference"},
2070   {NR_SUB_ID_BSS_TER_DUR, "BSS Termination Duration"},
2071   {NR_SUB_ID_BEARING, "Bearing"},
2072   {NR_SUB_ID_WIDE_BW_CHANNEL, "Wide Bandwidth Channel"},
2073   {NR_SUB_ID_MEASUREMENT_REPORT, "Measurement Report"},
2074   {NR_SUB_ID_HT_CAPABILITIES, "HT Capabilities"},
2075   {NR_SUB_ID_HT_OPERATION, "HT Operation"},
2076   {NR_SUB_ID_SEC_CHANNEL_OFFSET, "Secondary Channel Offset"},
2077   {NR_SUB_ID_MEASUREMENT_PILOT_INFO, "Measurement Pilot Transmission"},
2078   {NR_SUB_ID_RM_ENABLE_CAP, "RM Enabled Capabilities"},
2079   {NR_SUB_ID_HT_MULTIPLE_BSSID, "Multiple BSSID"},
2080   {NR_SUB_ID_VHT_CAPABILITIES, "VHT Capabilities"},
2081   {NR_SUB_ID_VHT_OPERATION, "VHT Operation"},
2082   {NR_SUB_ID_HE_CAPABILITIES, "HE Capabilities"},
2083   {NR_SUB_ID_HE_OPERATION, "HE Operation"},
2084   {NR_SUB_ID_VENDOR_SPECIFIC, "Vendor Specific"},
2085   {0, NULL}
2086 };
2087
2088 static const value_string ieee80211_neighbor_report_bssid_info_reachability_vals[] = {
2089   {0, "Reserved"},
2090   {1, "Not Reachable"},
2091   {2, "Unknown"},
2092   {3, "Reachable"},
2093   {0, NULL}
2094 };
2095
2096 static const value_string action_codes[] = {
2097   {SM_ACTION_MEASUREMENT_REQUEST, "Measurement Request"},
2098   {SM_ACTION_MEASUREMENT_REPORT,  "Measurement Report"},
2099   {SM_ACTION_TPC_REQUEST,         "TPC Request"},
2100   {SM_ACTION_TPC_REPORT,          "TPC Report"},
2101   {SM_ACTION_CHAN_SWITCH_ANNC,    "Channel Switch Announcement"},
2102   {0, NULL}
2103 };
2104
2105 static const value_string vendor_action_types_mrvl[] = {
2106   {MRVL_ACTION_MESH_MANAGEMENT, "Mesh Management"},
2107   {0, NULL}
2108 };
2109
2110 static const value_string mesh_mgt_action_codes_mrvl[] = {
2111   {MRVL_MESH_MGMT_ACTION_RREQ, "Route Request"},
2112   {MRVL_MESH_MGMT_ACTION_RREP, "Route Response"},
2113   {MRVL_MESH_MGMT_ACTION_RERR, "Route Error"},
2114   {MRVL_MESH_MGMT_ACTION_PLDM, "Peer Link Down"},
2115   {0, NULL}
2116 };
2117
2118 static const value_string mesh_path_selection_codes[] = {
2119   {0x0, "Hybrid Wireless Mesh Protocol"},
2120   {0, NULL}
2121 };
2122
2123 static const value_string mesh_metric_codes[] = {
2124   {0x0, "Airtime Link Metric"},
2125   {0, NULL}
2126 };
2127
2128 static const value_string wme_action_codes[] = {
2129   {0x00, "Setup request"},
2130   {0x01, "Setup response"},
2131   {0x02, "Teardown"},
2132   {0x00, NULL}
2133 };
2134
2135 static const value_string wme_status_codes[] = {
2136   {0x00, "Admission accepted"},
2137   {0x01, "Invalid parameters"},
2138   {0x03, "Refused"},
2139   {0x00, NULL}
2140 };
2141
2142 static const value_string mesh_action[] = {
2143   {MESH_ACTION_LINK_METRIC_REPORT, "Mesh Link Metric Report"},
2144   {MESH_ACTION_HWMP,               "HWMP Mesh Path Selection"},
2145   {MESH_ACTION_GATE_ANNOUNCE,      "Gate Announcement"},
2146   {MESH_ACTION_CONGESTION_CTL,     "Congestion Control Notification"},
2147   {MESH_ACTION_MCCA_SETUP_REQUEST, "MCCA Setup Request"},
2148   {MESH_ACTION_MCCA_SETUP_REPLY,   "MCCA Setup Reply"},
2149   {MESH_ACTION_MCCA_ADV_REQUEST,   "MCCA Advertisement Request"},
2150   {MESH_ACTION_MCCA_ADV,           "MCCA Advertisement"},
2151   {MESH_ACTION_MCCA_TEARDOWN,      "MCCA Teardown"},
2152   {MESH_ACTION_TBTT_ADJ_REQUEST,   "TBTT Adjustment Request"},
2153   {MESH_ACTION_TBTT_ADJ_RESPONSE,  "TBTT Adjustment Response"},
2154   {0, NULL}
2155 };
2156 static value_string_ext mesh_action_ext = VALUE_STRING_EXT_INIT(mesh_action);
2157
2158 static const value_string multihop_action[] = {
2159   {MULTIHOP_ACTION_PROXY_UPDATE,      "Proxy Update"},
2160   {MULTIHOP_ACTION_PROXY_UPDATE_CONF, "Proxy Update Confirmation"},
2161   {0, NULL}
2162 };
2163
2164 static const value_string selfprot_action[] = {
2165   {SELFPROT_ACTION_MESH_PEERING_OPEN,     "Mesh Peering Open"},
2166   {SELFPROT_ACTION_MESH_PEERING_CONFIRM,  "Mesh Peering Confirm"},
2167   {SELFPROT_ACTION_MESH_PEERING_CLOSE,    "Mesh Peering Close"},
2168   {SELFPROT_ACTION_MESH_GROUP_KEY_INFORM, "Mesh Group Key Inform"},
2169   {SELFPROT_ACTION_MESH_GROUP_KEY_ACK,    "Mesh Group Key Ack"},
2170   {0, NULL}
2171 };
2172
2173 static const value_string mesh_peering_proto_ids[] = {
2174   {MESH_PEERING_PROTO_MGMT,   "Mesh peering management protocol"},
2175   {MESH_PEERING_PROTO_AMPE,   "Authenticated mesh peering exchange protocol"},
2176   {MESH_PEERING_PROTO_VENDOR, "Vendor specific"},
2177   {0, NULL}
2178 };
2179
2180 static const true_false_string hwmp_targ_usn_flags = {
2181   "[USN = 1] Target Sequence Number Unknown at Originator",
2182   "[USN = 0] Target Sequence Number Known at Originator"
2183 };
2184
2185 static const true_false_string hwmp_targ_to_flags = {
2186   "[TO = 1] Only Target Will Respond",
2187   "[TO = 0] Intermediate Nodes May Respond"
2188 };
2189
2190 static const value_string ack_policy[] = {
2191   {0x00, "Normal Ack"},
2192   {0x01, "No Ack"},
2193   {0x02, "No explicit acknowledgment"},
2194   {0x03, "Block Ack"},
2195   {0x00, NULL}
2196 };
2197
2198 static const value_string qos_action_codes[] = {
2199   {QOS_ACTION_ADDTS_REQUEST,  "ADDTS Request"},
2200   {QOS_ACTION_ADDTS_RESPONSE, "ADDTS Response"},
2201   {QOS_ACTION_DELTS,          "DELTS"},
2202   {QOS_ACTION_SCHEDULE,   "Schedule"},
2203   {QOS_ACTION_MAP_CONFIGURE, "QoS Map Configure"},
2204   {0, NULL}
2205 };
2206
2207 static const value_string ba_action_codes[] = {
2208   {BA_ADD_BLOCK_ACK_REQUEST,  "Add Block Ack Request"},
2209   {BA_ADD_BLOCK_ACK_RESPONSE, "Add Block Ack Response"},
2210   {BA_DELETE_BLOCK_ACK,       "Delete Block Ack"},
2211   {0x00, NULL}
2212 };
2213
2214 static const value_string dls_action_codes[] = {
2215   {DLS_ACTION_REQUEST,  "DLS Request"},
2216   {DLS_ACTION_RESPONSE, "DLS Response"},
2217   {DLS_ACTION_TEARDOWN, "DLS Teardown"},
2218   {0, NULL}
2219 };
2220
2221 static const value_string tsinfo_type[] = {
2222   {0x0, "Aperiodic or unspecified Traffic"},
2223   {0x1, "Periodic Traffic"},
2224   {0, NULL}
2225 };
2226
2227 static const value_string tsinfo_direction[] = {
2228   {0x00, "Uplink"},
2229   {0x01, "Downlink"},
2230   {0x02, "Direct link"},
2231   {0x03, "Bidirectional link"},
2232   {0, NULL}
2233 };
2234
2235 static const value_string tsinfo_access[] = {
2236   {0x00, "Reserved"},
2237   {0x01, "EDCA"},
2238   {0x02, "HCCA"},
2239   {0x03, "HEMM"},
2240   {0, NULL}
2241 };
2242
2243 static const value_string qos_up[] = {
2244   {0x00, "Best Effort"},
2245   {0x01, "Background"},
2246   {0x02, "Spare"},
2247   {0x03, "Excellent Effort"},
2248   {0x04, "Controlled Load"},
2249   {0x05, "Video"},
2250   {0x06, "Voice"},
2251   {0x07, "Network Control"},
2252   {0, NULL}
2253 };
2254
2255 static const value_string classifier_type[] = {
2256   {0x00, "Ethernet parameters"},
2257   {0x01, "TCP/UDP IP parameters"},
2258   {0x02, "IEEE 802.1D/Q parameters"},
2259   {0, NULL}
2260 };
2261
2262 static const true_false_string ieee80211_block_ack_control_ack_policy_flag = {
2263     "Sender Does Not Require Immediate Acknowledgement",
2264     "Immediate Acknowledgement Required"
2265 };
2266
2267 static const value_string ft_action_codes[] = {
2268   {FT_ACTION_REQUEST, "FT Request"},
2269   {FT_ACTION_RESPONSE, "FT Response"},
2270   {FT_ACTION_CONFIRM, "FT Confirm"},
2271   {FT_ACTION_ACK, "FT Ack"},
2272   {0, NULL}
2273 };
2274
2275 static const value_string sa_query_action_codes[] = {
2276   {SA_QUERY_REQUEST, "SA Query Request"},
2277   {SA_QUERY_RESPONSE, "SA Query Response"},
2278   {0, NULL}
2279 };
2280
2281 static const value_string ieee80211_data_encap_payload_types[] = {
2282   {1, "Remote Request/Response"},
2283   {2, "TDLS"},
2284   {0, NULL}
2285 };
2286
2287 static const true_false_string rsn_preauth_flags = {
2288   "Transmitter supports pre-authentication",
2289   "Transmitter does not support pre-authentication"
2290 };
2291
2292 static const true_false_string rsn_no_pairwise_flags = {
2293   "Transmitter cannot support WEP default key 0 simultaneously with "
2294   "Pairwise key",
2295   "Transmitter can support WEP default key 0 simultaneously with "
2296   "Pairwise key"
2297 };
2298
2299 static const value_string rsn_cap_replay_counter[] = {
2300   {0x00, "1 replay counter per PTKSA/GTKSA/STAKeySA"},
2301   {0x01, "2 replay counters per PTKSA/GTKSA/STAKeySA"},
2302   {0x02, "4 replay counters per PTKSA/GTKSA/STAKeySA"},
2303   {0x03, "16 replay counters per PTKSA/GTKSA/STAKeySA"},
2304   {0, NULL}
2305 };
2306
2307 static const true_false_string ht_ldpc_coding_flag = {
2308   "Transmitter supports receiving LDPC coded packets",
2309   "Transmitter does not support receiving LDPC coded packets"
2310 };
2311
2312 static const true_false_string ht_chan_width_flag = {
2313   "Transmitter supports 20MHz and 40MHz operation",
2314   "Transmitter only supports 20MHz operation"
2315 };
2316
2317 static const value_string ht_sm_pwsave_flag[] = {
2318   {0x00, "Static SM Power Save mode"},
2319   {0x01, "Dynamic SM Power Save mode"},
2320   {0x02, "Reserved"},
2321   {0x03, "SM Power Save disabled"},
2322   {0x00, NULL}
2323 };
2324
2325 static const true_false_string ht_green_flag = {
2326   "Transmitter is able to receive PPDUs with Green Field (GF) preamble",
2327   "Transmitter is not able to receive PPDUs with Green Field (GF) preamble"
2328 };
2329
2330 static const value_string ht_rx_stbc_flag[] = {
2331   {0x00, "No Rx STBC support"},
2332   {0x01, "Rx support of one spatial stream"},
2333   {0x02, "Rx support of one and two spatial streams"},
2334   {0x03, "Rx support of one, two, and three spatial streams"},
2335   {0x00, NULL}
2336 };
2337
2338   /* IEEE Stc 802.11ac-2013 8.4.2.29 Extended Capabilities element*/
2339 static const value_string vht_max_mpdu_in_amsdu[] = {
2340     {0x00, "No limit"},
2341     {0x01, "32"},
2342     {0x02, "16"},
2343     {0x03, "8"},
2344     {0, NULL}
2345 };
2346
2347   /* IEEE Stc 802.11ac/D3.1 */
2348
2349 static const value_string vht_max_mpdu_length_flag[] = {
2350   {0x00, "3 895"},
2351   {0x01, "7 991"},
2352   {0x02, "11 454"},
2353   {0x03, "Reserved"},
2354   {0x00, NULL}
2355 };
2356
2357 static const value_string vht_supported_chan_width_set_flag[] = {
2358   {0x00, "Neither 160MHz nor 80+80 supported"},
2359   {0x01, "160MHz supported"},
2360   {0x02, "160MHz and 80+80 Supported"},
2361   {0x03, "Reserved"},
2362   {0x00, NULL}
2363 };
2364
2365 static const value_string vht_rx_stbc_flag[] = {
2366   {0x00, "None"},
2367   {0x01, "1 Spatial Stream Supported"},
2368   {0x02, "1 to 2 Spatial Stream Supported"},
2369   {0x03, "1 to 3 Spatial Stream Supported"},
2370   {0x04, "1 to 4 Spatial Stream Supported"},
2371   {0x05, "Reserved"},
2372   {0x06, "Reserved"},
2373   {0x07, "Reserved"},
2374   {0x00, NULL}
2375 };
2376
2377 static const value_string num_plus_one_3bit_flag[] = {
2378   {0x00, "1"},
2379   {0x01, "2"},
2380   {0x02, "3"},
2381   {0x03, "4"},
2382   {0x04, "5"},
2383   {0x05, "6"},
2384   {0x06, "7"},
2385   {0x07, "8"},
2386   {0x00, NULL}
2387 };
2388
2389 static const value_string vht_max_ampdu_flag[] = {
2390   {0x00, "8 191"},
2391   {0x01, "16 383"},
2392   {0x02, "32 767"},
2393   {0x03, "65,535"},
2394   {0x04, "131 071"},
2395   {0x05, "262 143"},
2396   {0x06, "524 287"},
2397   {0x07, "1 048 575"},
2398   {0x00, NULL}
2399 };
2400
2401 static const value_string vht_link_adapt_flag[] = {
2402   {0x00, "No Feedback"},
2403   {0x01, "Reserved (logically only solicited feedback)"},
2404   {0x02, "Unsolicited feedback only"},
2405   {0x03, "Both (can provide unsolicited feedback and respond to VHT MRQ)"},
2406   {0x00, NULL}
2407 };
2408
2409 static const value_string vht_supported_mcs_flag[] = {
2410   {0x00, "MCS 0-7"},
2411   {0x01, "MCS 0-8"},
2412   {0x02, "MCS 0-9"},
2413   {0x03, "Not Supported"},
2414   {0x00, NULL}
2415 };
2416
2417 static const value_string vht_op_channel_width_flag[] = {
2418   {0x00, "20 MHz or 40 MHz"},
2419   {0x01, "80 MHz"},
2420   {0x02, "160 MHz"},
2421   {0x03, "80+80 MHz"},
2422   {0x00, NULL}
2423 };
2424
2425 static const value_string vht_tpe_pwr_units[] = {
2426   {0x00, "EIRP"},
2427   {0x00, NULL}
2428 };
2429
2430 static const true_false_string vht_ndp_annc_sta_info_feedback_type = {
2431   "MU feedback requested",
2432   "SU feedback requested"
2433 };
2434
2435 static const true_false_string ht_delayed_block_ack_flag = {
2436   "Transmitter supports HT-Delayed BlockAck",
2437   "Transmitter does not support HT-Delayed BlockAck"
2438 };
2439
2440 static const true_false_string ht_max_amsdu_flag = {
2441   "7935 bytes",
2442   "3839 bytes"
2443 };
2444
2445 static const true_false_string ht_dss_cck_40_flag = {
2446   "Will/Can use DSSS/CCK in 40 MHz",
2447   "Won't/Can't use of DSSS/CCK in 40 MHz"
2448 };
2449
2450 static const true_false_string ht_psmp_flag = {
2451   "Will/Can support PSMP operation",
2452   "Won't/Can't support PSMP operation"
2453 };
2454
2455 static const true_false_string ht_40_mhz_intolerant_flag = {
2456   "Use of 40 MHz transmissions restricted/disallowed",
2457   "Use of 40 MHz transmissions unrestricted/allowed"
2458 };
2459
2460 static const value_string ampduparam_mpdu_start_spacing_flags[] = {
2461   {0x00, "no restriction"},
2462   {0x01, "1/4 [usec]"},
2463   {0x02, "1/2 [usec]"},
2464   {0x03, "1 [usec]"},
2465   {0x04, "2 [usec]"},
2466   {0x05, "4 [usec]"},
2467   {0x06, "8 [usec]"},
2468   {0x07, "16 [usec]"},
2469   {0x00, NULL}
2470 };
2471
2472 static const true_false_string mcsset_tx_rx_mcs_set_not_equal_flag = {
2473   "Not Equal",
2474   "Equal",
2475 };
2476
2477 static const value_string mcsset_tx_max_spatial_streams_flags[] = {
2478   {0x00, "1 spatial stream"},
2479   {0x01, "2 spatial streams"},
2480   {0x02, "3 spatial streams"},
2481   {0x03, "4 spatial streams"},
2482   {0x04, "TX MCS Set Not Defined"},
2483   {0x00, NULL}
2484 };
2485
2486 static const value_string htex_transtime_flags[] = {
2487   {0x00, "No Transition"},
2488   {0x01, "400 usec"},
2489   {0x02, "1.5 msec"},
2490   {0x03, "5 msec"},
2491   {0x00, NULL}
2492 };
2493
2494 static const value_string htex_mcs_flags[] = {
2495   {0x00, "STA does not provide MCS feedback"},
2496   {0x01, "Reserved"},
2497   {0x02, "STA provides only unsolicited MCS feedback"},
2498   {0x03, "STA can provide MCS feedback in response to MRQ as well as unsolicited MCS feedback"},
2499   {0x00, NULL}
2500 };
2501
2502 static const value_string txbf_calib_flag[] = {
2503   {0x00, "incapable"},
2504   {0x01, "Limited involvement, cannot initiate"},
2505   {0x02, "Limited involvement, can initiate"},
2506   {0x03, "Fully capable"},
2507   {0x00, NULL}
2508 };
2509
2510 static const value_string txbf_feedback_flags[] = {
2511   {0x00, "not supported"},
2512   {0x01, "delayed feedback capable"},
2513   {0x02, "immediate feedback capable"},
2514   {0x03, "delayed and immediate feedback capable"},
2515   {0x00, NULL}
2516 };
2517
2518 static const value_string txbf_antenna_flags[] = {
2519   {0x00, "1 TX antenna sounding"},
2520   {0x01, "2 TX antenna sounding"},
2521   {0x02, "3 TX antenna sounding"},
2522   {0x03, "4 TX antenna sounding"},
2523   {0x00, NULL}
2524 };
2525
2526 static const value_string txbf_csi_max_rows_bf_flags[] = {
2527   {0x00, "1 row of CSI"},
2528   {0x01, "2 rows of CSI"},
2529   {0x02, "3 rows of CSI"},
2530   {0x03, "4 rows of CSI"},
2531   {0x00, NULL}
2532 };
2533
2534 static const value_string txbf_chan_est_flags[] = {
2535   {0x00, "1 space time stream"},
2536   {0x01, "2 space time streams"},
2537   {0x02, "3 space time streams"},
2538   {0x03, "4 space time streams"},
2539   {0x00, NULL}
2540 };
2541
2542 static const value_string txbf_min_group_flags[] = {
2543   {0x00, "No grouping supported"},
2544   {0x01, "Groups of 1, 2 supported"},
2545   {0x02, "Groups of 1, 4 supported"},
2546   {0x03, "Groups of 1, 2, 4 supported"},
2547   {0x00, NULL}
2548 };
2549
2550 static const value_string hta_ext_chan_offset_flag[] = {
2551   {0x00, "No Extension Channel"},
2552   {0x01, "Extension Channel above control channel"},
2553   {0x02, "Undefined"},
2554   {0x03, "Extension Channel below control channel"},
2555   {0x00, NULL}
2556 };
2557
2558 static const true_false_string hta_rec_tx_width_flag = {
2559   "Any channel width enabled",
2560   "Use 20MHz channel (control)"
2561 };
2562
2563 static const true_false_string hta_rifs_mode_flag = {
2564   "Use of RIFS permitted",
2565   "Use of RIFS prohibited"
2566 };
2567
2568 static const true_false_string hta_controlled_access_flag = {
2569   "Not only PSMP",
2570   "PSMP only"
2571 };
2572
2573 static const value_string hta_service_interval_flag[] = {
2574   {0x00, "5ms"},
2575   {0x01, "10ms"},
2576   {0x02, "15ms"},
2577   {0x03, "20ms"},
2578   {0x04, "25ms"},
2579   {0x05, "30ms"},
2580   {0x06, "35ms"},
2581   {0x07, "40ms"},
2582   {0x00, NULL}
2583 };
2584
2585 static const value_string hta_operating_mode_flag[] = {
2586   {0x00, "Pure HT, no protection"},
2587   {0x01, "There may be non-HT devices (control & ext channel)"},
2588   {0x02, "No non-HT is associated, but at least 1 20MHz is. protect on"},
2589   {0x03, "Mixed: no non-HT is associated, protect on"},
2590   {0x00, NULL}
2591 };
2592
2593 static const true_false_string hta_non_gf_devices_flag = {
2594   "All HT devices associated are GF capable",
2595   "One or More HT devices are not GF capable"
2596 };
2597
2598 static const true_false_string hta_dual_stbc_protection_flag = {
2599   "Dual CTS protections is used",
2600   "Regular use of RTS/CTS"
2601 };
2602
2603 static const true_false_string hta_secondary_beacon_flag = {
2604   "Secondary Beacon",
2605   "Primary Beacon"
2606 };
2607
2608 static const true_false_string hta_lsig_txop_protection_flag = {
2609   "Full Support",
2610   "Not full support"
2611 };
2612
2613 static const true_false_string hta_pco_active_flag = {
2614   "PCO is activated in the BSS",
2615   "PCO is not activated in the BSS"
2616 };
2617
2618 static const true_false_string hta_pco_phase_flag = {
2619   "Switch to 20MHz phase/keep 20MHz",
2620   "Switch to 40MHz phase/keep 40MHz"
2621 };
2622
2623 static const value_string ht_info_secondary_channel_offset_flags[] = {
2624   {0x00, "No secondary channel"},
2625   {0x01, "Secondary channel is above the primary channel"},
2626   {0x02, "Reserved"},
2627   {0x03, "Secondary channel is below the primary channel"},
2628   {0x00, NULL}
2629 };
2630
2631 static const true_false_string ht_info_channel_sta_width_flag = {
2632   "Channel of any width supported",
2633   "20 MHz channel width only"
2634 };
2635
2636 static const true_false_string ht_info_rifs_mode_flag = {
2637   "Permitted",
2638   "Prohibited"
2639 };
2640
2641 static const value_string ht_info_operating_protection_mode_flags[] = {
2642   {0x00, "No protection mode"},
2643   {0x01, "HT non-member protection mode"},
2644   {0x02, "20 MHz protection mode"},
2645   {0x03, "non-HT mixed mode"},
2646   {0x00, NULL}
2647 };
2648
2649 static const true_false_string ht_info_non_greenfield_sta_present_flag = {
2650   "One or more associated STAs are not greenfield capable",
2651   "All associated STAs are greenfield capable"
2652 };
2653
2654 static const true_false_string ht_info_obss_non_ht_stas_present_flag = {
2655   "Use of protection for non-HT STAs by overlapping BSSs is needed",
2656   "Use of protection for non-HT STAs by overlapping BSSs is not needed"
2657 };
2658
2659 static const true_false_string ht_info_dual_beacon_flag = {
2660   "AP transmits a secondary beacon",
2661   "No second beacon is transmitted"
2662 };
2663
2664 static const true_false_string ht_info_secondary_beacon_flag = {
2665   "STBC beacon",
2666   "Primary beacon"
2667 };
2668
2669 static const true_false_string ht_info_lsig_txop_protection_full_support_flag = {
2670   "All HT STAs in the BSS support L-SIG TXOP protection",
2671   "One or more HT STAs in the BSS do not support L-SIG TXOP protection"
2672 };
2673
2674 static const true_false_string ht_info_pco_phase_flag = {
2675   "Switch to or continue 40 MHz phase",
2676   "Switch to or continue 20 MHz phase"
2677 };
2678
2679 static const true_false_string htc_lac_trq_flag = {
2680   "Want sounding PPDU",
2681   "Don't want sounding PPDU"
2682 };
2683
2684 static const true_false_string htc_lac_mai_mrq_flag = {
2685   "MCS feedback requested",
2686   "No MCS feedback requested"
2687 };
2688
2689 static const value_string ieee80211_htc_lac_asel_command_flags[] = {
2690   {0x00, "Transmit Antenna Selection Sounding Indication (TXASSI)"},
2691   {0x01, "Transmit Antenna Selection Sounding Request (TXASSR)"},
2692   {0x02, "Receive Antenna Selection Sounding Indication (RXASSI)"},
2693   {0x03, "Receive Antenna Selection Sounding Request (RXASSR)"},
2694   {0x04, "Sounding Label"},
2695   {0x05, "No feedback, ASEL training failure"},
2696   {0x06, "Transmit Antenna Selection Sounding Indication (TXASSI) requesting feedback of explicit CSI"},
2697   {0x07, "Reserved"},
2698   {0x00, NULL}
2699 };
2700
2701 static const value_string ieee80211_htc_cal_pos_flags[] = {
2702   {0x00, "Not a calibration frame"},
2703   {0x01, "Calibration Start"},
2704   {0x02, "Sounding Response"},
2705   {0x03, "Sounding Complete"},
2706   {0x00, NULL}
2707 };
2708
2709 static const value_string ieee80211_htc_csi_steering_flags[] = {
2710   {0x00, "No feedback required"},
2711   {0x01, "CSI"},
2712   {0x02, "Non-compressed Beamforming Feedback Matrix"},
2713   {0x03, "Compressed Beamforming Feedback Matrix"},
2714   {0x00, NULL}
2715 };
2716
2717 static const true_false_string ieee80211_htc_ndp_announcement_flag = {
2718   "NDP will follow",
2719   "No NDP will follow"
2720 };
2721
2722 static const value_string ieee80211_htc_bw_recommended_vht_mcs_vals[] = {
2723   {0, "20 MHz"},
2724   {1, "40 MHz"},
2725   {2, "80 MHz"},
2726   {3, "160 MHz and 80+80 MHz"},
2727   {0, NULL}
2728 };
2729
2730 static const value_string ieee80211_htc_coding_type_vals[] = {
2731   {0, "BCC"},
2732   {1, "LDPC"},
2733   {0, NULL}
2734 };
2735
2736 static const value_string ieee80211_htc_fb_tx_type_vals[] = {
2737   {0, "Not beamformed"},
2738   {1, "Beamformed"},
2739   {0, NULL}
2740 };
2741
2742 static const value_string ieee80211_tag_secondary_channel_offset_flags[] = {
2743   {0x00, "No Secondary Channel"},
2744   {0x01, "Above Primary Channel"},
2745   {0x02, "Reserved"},
2746   {0x03, "Below Primary Channel"},
2747   {0x00, NULL}
2748 };
2749
2750 #define BSS_BITMASK_UP0   0x0001
2751 #define BSS_BITMASK_UP1   0x0002
2752 #define BSS_BITMASK_UP2   0x0004
2753 #define BSS_BITMASK_UP3   0x0008
2754 #define BSS_BITMASK_UP4   0x0010
2755 #define BSS_BITMASK_UP5   0x0020
2756 #define BSS_BITMASK_UP6   0x0040
2757 #define BSS_BITMASK_UP7   0x0080
2758 #define BSS_BITMASK_AC0   0x0100
2759 #define BSS_BITMASK_AC1   0x0200
2760 #define BSS_BITMASK_AC2   0x0400
2761 #define BSS_BITMASK_AC3   0x0800
2762 #define BSS_BITMASK_RSV   0xF000
2763
2764 static const value_string ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags[] = {
2765   {0x00, "Frames may be transmitted before the channel switch has been completed"},
2766   {0x01, "No more frames are to be transmitted until the channel switch has been completed"},
2767   {0x00, NULL}
2768 };
2769
2770 static const value_string service_interval_granularity_vals[] = {
2771   { 0, "5 ms" },
2772   { 1, "10 ms" },
2773   { 2, "15 ms" },
2774   { 3, "20 ms" },
2775   { 4, "25 ms" },
2776   { 5, "30 ms" },
2777   { 6, "35 ms" },
2778   { 7, "40 ms" },
2779   { 0x00, NULL }
2780 };
2781
2782 static const value_string wep_type_vals[] = {
2783   { DOT11DECRYPT_KEY_TYPE_WEP, STRING_KEY_TYPE_WEP },
2784   { DOT11DECRYPT_KEY_TYPE_WPA_PWD, STRING_KEY_TYPE_WPA_PWD },
2785   { DOT11DECRYPT_KEY_TYPE_WPA_PSK, STRING_KEY_TYPE_WPA_PSK },
2786   { 0x00, NULL }
2787 };
2788
2789 static const value_string ieee80211_ht_pren_type_vals[] = {
2790   { 51,  "HT Capabilities (802.11n D1.10)" },
2791   { 52,  "HT Additional Capabilities (802.11n D1.00)" },
2792   { 0, NULL }
2793 };
2794
2795 static const true_false_string ieee80211_cf_ssw_direction = {
2796   "Transmitted by the beamforming responder",
2797   "Transmitted by the beamforming initiator"
2798 };
2799
2800 static const value_string bss_type[] = {
2801   {0x0, "Reserved"},
2802   {0x1, "IBSS"},
2803   {0x2, "PBSS"},
2804   {0x3, "Infrastructure BSS"},
2805   {0,   NULL}
2806 };
2807
2808 static const value_string band_id[] = {
2809   {0x0, "TV white spaces"},
2810   {0x1, "Sub-1 GHZ (excluding TV white spaces)"},
2811   {0x2, "2.4 GHZ"},
2812   {0x3, "3.6 GHZ"},
2813   {0x4, "4.9 and 5 GHZ"},
2814   {0x5, "60 GHZ"},
2815   {0,   NULL}
2816 };
2817
2818 static const value_string extended_sc_mcs[] = {
2819   {0x0, "None"},
2820   {0x1, "MCS 9.1"},
2821   {0x2, "MCS 12.1"},
2822   {0x3, "MCS 12.2"},
2823   {0x4, "MCS 12.3"},
2824   {0x5, "MCS 12.4"},
2825   {0x6, "MCS 12.5"},
2826   {0x7, "MCS 12.6"},
2827   {0, NULL}
2828 };
2829
2830 static const range_string max_basic_sf_amsdu[] = {
2831   {0, 0, "No Limit"},
2832   {1, 1, "4 Basic subframes"},
2833   {2, 2, "8 Basic subframes"},
2834   {3, 3, "16 Basic subframes"},
2835   {4, 4, "32 Basic subframes"},
2836   {5, 5, "64 Basic subframes"},
2837   {6, 6, "128 Basic subframes"},
2838   {7, 7, "256 Basic subframes"},
2839   {8, 255, "reserved"},
2840   {0, 0, NULL}
2841 };
2842
2843 static const range_string max_short_sf_amsdu[] = {
2844   {0, 0, "No Limit"},
2845   {1, 1, "32 Short subframes"},
2846   {2, 2, "64 Short subframes"},
2847   {3, 3, "128 Short subframes"},
2848   {4, 4, "256 Short subframes"},
2849   {5, 5, "512 Short subframes"},
2850   {6, 6, "1024 Short subframes"},
2851   {7, 255, "reserved"},
2852   {0, 0, NULL}
2853 };
2854
2855 static const value_string allocation_type[] = {
2856   {0x0, "SP Allocation"},
2857   {0x1, "CBAP allocation"},
2858   {0,   NULL}
2859 };
2860
2861 static const value_string vht_operation_info_channel_width[] = {
2862   {0x00, "20MHz or 40MHz"},
2863   {0x01, "80MHZ"},
2864   {0x10, "160MHz"},
2865   {0x11, "80MHz+80MHz"},
2866   {0, NULL}
2867 };
2868 static const value_string operating_mode_field_channel_width[] = {
2869   {0x00, "20MHz"},
2870   {0x01, "40MHZ"},
2871   {0x02, "80MHz"},
2872   {0x03, "160MHz or 80MHz+80MHz"},
2873   {0, NULL}
2874 };
2875
2876 static const value_string operat_mode_field_rxnss[] = {
2877   {0x0, "1Nss"},
2878   {0x1, "2Nss"},
2879   {0x2, "3Nss"},
2880   {0x3, "4Nss"},
2881   {0x4, "5Nss"},
2882   {0x5, "6Nss"},
2883   {0x6, "7Nss"},
2884   {0x7, "8Nss"},
2885   {0, NULL}
2886 };
2887
2888 #define VHT_ACT_VHT_COMPRESSED_BEAMFORMING  0
2889 #define VHT_ACT_GROUP_ID_MANAGEMENT         1
2890 #define VHT_ACT_OPERATION_MODE_NOTIFICATION 2
2891
2892 static const value_string vht_action_vals[] = {
2893   {VHT_ACT_VHT_COMPRESSED_BEAMFORMING, "VHT Compressed Beamforming"},
2894   {VHT_ACT_GROUP_ID_MANAGEMENT, "Group ID Management"},
2895   {VHT_ACT_OPERATION_MODE_NOTIFICATION, "Operating Mode Notification"},
2896   {0,   NULL}
2897 };
2898
2899 static const value_string ff_vht_mimo_cntrl_nc_index_vals[] = {
2900   {0x00, "1 Column"},
2901   {0x01, "2 Columns"},
2902   {0x02, "3 Columns"},
2903   {0x03, "4 Columns"},
2904   {0x04, "5 Columns"},
2905   {0x05, "6 Columns"},
2906   {0x06, "7 Columns"},
2907   {0x07, "8 Columns"},
2908   {0, NULL}
2909 };
2910
2911 static const value_string ff_vht_mimo_cntrl_nr_index_vals[] = {
2912   {0x00, "1 Row"},
2913   {0x01, "2 Rows"},
2914   {0x02, "3 Rows"},
2915   {0x03, "4 Rows"},
2916   {0x04, "5 Rows"},
2917   {0x05, "6 Rows"},
2918   {0x06, "7 Rows"},
2919   {0x07, "8 Rows"},
2920   {0, NULL}
2921 };
2922
2923 static const value_string ff_vht_mimo_cntrl_channel_width_vals[] = {
2924   {0x00, "20 MHz"},
2925   {0x01, "40 MHz"},
2926   {0x02, "80 MHz"},
2927   {0x03, "160 MHz / 80+80 MHz"},
2928   {0, NULL}
2929 };
2930
2931 static const value_string ff_vht_mimo_cntrl_grouping_vals[] = {
2932   {0x00, "1 (No Grouping)"},
2933   {0x01, "2"},
2934   {0x02, "4"},
2935   {0x03, "Reserved"},
2936   {0, NULL}
2937 };
2938
2939 static const value_string ff_vht_mimo_cntrl_feedback_vals[] = {
2940   {0x00, "SU"},
2941   {0x01, "MU"},
2942   {0, NULL}
2943 };
2944
2945 static int proto_wlan = -1;
2946 static int proto_centrino = -1;
2947 static int proto_aggregate = -1;
2948 static gboolean ieee80211_tvb_invalid = FALSE;
2949
2950 /* ************************************************************************* */
2951 /*                Header field info values for FC-field                      */
2952 /* ************************************************************************* */
2953 static int hf_ieee80211_fc_field = -1;
2954 static int hf_ieee80211_fc_proto_version = -1;
2955 static int hf_ieee80211_fc_frame_type = -1;
2956 static int hf_ieee80211_fc_frame_subtype = -1;
2957 static int hf_ieee80211_fc_frame_extension = -1;
2958 static int hf_ieee80211_fc_frame_type_subtype = -1;
2959
2960 static int hf_ieee80211_fc_flags = -1;
2961 static int hf_ieee80211_fc_to_ds = -1;
2962 static int hf_ieee80211_fc_from_ds = -1;
2963 static int hf_ieee80211_fc_data_ds = -1;
2964
2965 static int hf_ieee80211_fc_more_frag = -1;
2966 static int hf_ieee80211_fc_retry = -1;
2967 static int hf_ieee80211_fc_pwr_mgt = -1;
2968 static int hf_ieee80211_fc_more_data = -1;
2969 static int hf_ieee80211_fc_protected = -1;
2970 static int hf_ieee80211_fc_order = -1;
2971
2972 typedef struct retransmit_key {
2973   guint8  bssid[6];
2974   guint8  src[6];
2975   guint16 seq_control;
2976   guint   fnum;
2977 } retransmit_key;
2978
2979 static GHashTable *fc_analyse_retransmit_table = NULL;
2980 static GHashTable *fc_first_frame_table = NULL;
2981
2982 static int hf_ieee80211_fc_analysis_retransmission = -1;
2983 static int hf_ieee80211_fc_analysis_retransmission_frame = -1;
2984
2985 /* ************************************************************************* */
2986 /*                   Header values for Duration/ID field                     */
2987 /* ************************************************************************* */
2988 static int hf_ieee80211_did_duration = -1;
2989 static int hf_ieee80211_assoc_id = -1;
2990
2991 /* ************************************************************************* */
2992 /*         Header values for different address-fields (all 4 of them)        */
2993 /* ************************************************************************* */
2994 static int hf_ieee80211_addr_da = -1;  /* Destination address subfield */
2995 static int hf_ieee80211_addr_da_resolved = -1;  /* Dst addr subfield resolved*/
2996 static int hf_ieee80211_addr_sa = -1;  /* Source address subfield */
2997 static int hf_ieee80211_addr_sa_resolved = -1;  /* Src addr subfield resolved*/
2998 static int hf_ieee80211_addr_ra = -1;  /* Receiver address subfield */
2999 static int hf_ieee80211_addr_ra_resolved = -1;  /* Rcv addr subfield resolved*/
3000 static int hf_ieee80211_addr_ta = -1;  /* Transmitter address subfield */
3001 static int hf_ieee80211_addr_ta_resolved = -1;  /* Txm addr subfield resolved*/
3002 static int hf_ieee80211_addr_bssid = -1;  /* address is bssid */
3003 static int hf_ieee80211_addr_bssid_resolved = -1;  /* bssid resolved*/
3004 static int hf_ieee80211_addr_staa = -1;  /* address is station address */
3005 static int hf_ieee80211_addr_staa_resolved = -1;  /* station address resolved*/
3006
3007 static int hf_ieee80211_addr = -1;  /* Source or destination address subfield */
3008 static int hf_ieee80211_addr_resolved = -1;/*Src/dst address subfield resolved*/
3009
3010 /* ************************************************************************* */
3011 /*                Header values for QoS control field                        */
3012 /* ************************************************************************* */
3013 static int hf_ieee80211_qos = -1;
3014 static int hf_ieee80211_qos_tid = -1;
3015 static int hf_ieee80211_qos_priority = -1;
3016 static int hf_ieee80211_qos_ack_policy = -1;
3017 static int hf_ieee80211_qos_amsdu_present = -1;
3018 static int hf_ieee80211_qos_eosp = -1;
3019 static int hf_ieee80211_qos_bit4 = -1;
3020 static int hf_ieee80211_qos_txop_limit = -1;
3021 static int hf_ieee80211_qos_ps_buf_state = -1;
3022 static int hf_ieee80211_qos_buf_state_indicated = -1;
3023 static int hf_ieee80211_qos_highest_pri_buf_ac = -1;
3024 static int hf_ieee80211_qos_qap_buf_load = -1;
3025 static int hf_ieee80211_qos_txop_dur_req = -1;
3026 static int hf_ieee80211_qos_queue_size = -1;
3027
3028 /* ************************************************************************* */
3029 /*                Header values for HT control field (+HTC) and HE control   */
3030 /* ************************************************************************* */
3031 /* 802.11-2012 and 802.11ac-2013 8.2.4.6 */
3032 static int hf_ieee80211_htc = -1;
3033 static int hf_ieee80211_htc_vht = -1;
3034 static int hf_ieee80211_htc_he = -1;
3035 static int hf_ieee80211_htc_he_ctrl_id = -1;
3036 static int hf_ieee80211_he_umrs_he_tb_ppdu_len = -1;
3037 static int hf_ieee80211_he_umrs_ru_allocation = -1;
3038 static int hf_ieee80211_he_dl_tx_power = -1;
3039 static int hf_ieee80211_he_ul_target_rssi = -1;
3040 static int hf_ieee80211_he_ul_mcs = -1;
3041 static int hf_ieee80211_he_ul_reserved = -1;
3042 static int hf_ieee80211_he_om_rx_nss = -1;
3043 static int hf_ieee80211_he_om_channel_width = -1;
3044 static int hf_ieee80211_he_om_ul_mu_disable = -1;
3045 static int hf_ieee80211_he_om_tx_nsts = -1;
3046 static int hf_ieee80211_he_om_reserved = -1;
3047 static int hf_ieee80211_he_hla_unsolicited_mfb = -1;
3048 static int hf_ieee80211_he_hla_mrq = -1;
3049 static int hf_ieee80211_he_hla_nss = -1;
3050 static int hf_ieee80211_he_hla_he_mcs = -1;
3051 static int hf_ieee80211_he_hla_dcm = -1;
3052 static int hf_ieee80211_he_hla_ru = -1;
3053 static int hf_ieee80211_he_hla_bw = -1;
3054 static int hf_ieee80211_he_hla_msi_ppdu_type = -1;
3055 static int hf_ieee80211_he_hla_tx_bf = -1;
3056 static int hf_ieee80211_he_hla_reserved = -1;
3057 static int hf_ieee80211_he_bsr_aci_bitmap = -1;
3058 static int hf_ieee80211_he_bsr_delta_tid = -1;
3059 static int hf_ieee80211_he_bsr_aci_high = -1;
3060 static int hf_ieee80211_he_bsr_scaling_factor = -1;
3061 static int hf_ieee80211_he_bsr_queue_size_high = -1;
3062 static int hf_ieee80211_he_bsr_queue_size_all = -1;
3063 static int hf_ieee80211_he_uph_ul_power_headroom = -1;
3064 static int hf_ieee80211_he_uph_ul_min_transmit_power_flag = -1;
3065 static int hf_ieee80211_he_uph_reserved = -1;
3066 static int hf_ieee80211_he_cci_ac_constraint = -1;
3067 static int hf_ieee80211_he_cci_rdg_more_ppdu = -1;
3068 static int hf_ieee80211_he_cci_sr_ppdu_indic = -1;
3069 static int hf_ieee80211_he_cci_reserved = -1;
3070 static int hf_ieee80211_he_btc_avail_chan = -1;
3071 static int hf_ieee80211_he_btc_reserved = -1;
3072 static int hf_ieee80211_he_trigger_common_info = -1;
3073 static int hf_ieee80211_he_trigger_type = -1;
3074 static int hf_ieee80211_he_trigger_length = -1;
3075 static int hf_ieee80211_he_trigger_cascade_indication = -1;
3076 static int hf_ieee80211_he_trigger_cs_required = -1;
3077 static int hf_ieee80211_he_trigger_bw = -1;
3078 static int hf_ieee80211_he_trigger_gi_and_ltf_type = -1;
3079 static int hf_ieee80211_he_trigger_mu_mimo_ltf_mode = -1;
3080 static int hf_ieee80211_he_trigger_num_he_ltf_syms_etc = -1;
3081 static int hf_ieee80211_he_trigger_stbc = -1;
3082 static int hf_ieee80211_he_trigger_ldpc_extra_sym_seg = -1;
3083 static int hf_ieee80211_he_trigger_ap_tx_power = -1;
3084 static int hf_ieee80211_he_trigger_packet_extension = -1;
3085 static int hf_ieee80211_he_trigger_spatial_reuse = -1;
3086 static int hf_ieee80211_he_trigger_doppler = -1;
3087 static int hf_ieee80211_he_trigger_he_sig_a_reserved = -1;
3088 static int hf_ieee80211_he_trigger_reserved = -1;
3089 static int hf_ieee80211_he_trigger_bar_ctrl = -1;
3090 static int hf_ieee80211_he_trigger_bar_ctrl_ba_ack_policy = -1;
3091 static int hf_ieee80211_he_trigger_bar_ctrl_ba_type = -1;
3092 static int hf_ieee80211_he_trigger_bar_ctrl_reserved = -1;
3093 static int hf_ieee80211_he_trigger_bar_ctrl_tid_info = -1;
3094 static int hf_ieee80211_he_trigger_bar_info = -1;
3095 static int hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl = -1;
3096 static int hf_ieee80211_he_trigger_mpdu_mu_spacing = -1;
3097 static int hf_ieee80211_he_trigger_tid_aggregation_limit = -1;
3098 static int hf_ieee80211_he_trigger_dependent_reserved1 = -1;
3099 static int hf_ieee80211_he_trigger_preferred_ac = -1;
3100 static int hf_ieee80211_he_trigger_user_info = -1;
3101 static int hf_ieee80211_he_trigger_starting_aid = -1;
3102 static int hf_ieee80211_he_trigger_dependent_reserved2 = -1;
3103 static int hf_ieee80211_he_trigger_feedback_type = -1;
3104 static int hf_ieee80211_he_trigger_dependent_reserved3 = -1;
3105 static int hf_ieee80211_he_trigger_nfrp_target_rssi = -1;
3106 static int hf_ieee80211_he_trigger_multiplexing_flag = -1;
3107 static int hf_ieee80211_he_trigger_dep_nfrp_user_info = -1;
3108 static int hf_ieee80211_he_trigger_feedback_seg_retrans_bm = -1;
3109 static int hf_ieee80211_he_trigger_aid12 = -1;
3110 static int hf_ieee80211_he_trigger_ru_allocation = -1;
3111 static int hf_ieee80211_he_trigger_coding_type = -1;
3112 static int hf_ieee80211_he_trigger_mcs = -1;
3113 static int hf_ieee80211_he_trigger_dcm = -1;
3114 static int hf_ieee80211_he_trigger_ss_allocation = -1;
3115 static int hf_ieee80211_he_trigger_target_rssi = -1;
3116 static int hf_ieee80211_he_trigger_user_reserved = -1;
3117 static int hf_ieee80211_he_trigger_dep_basic_user_info = -1;
3118 static int hf_ieee80211_he_ndp_annc_token = -1;
3119 static int hf_ieee80211_he_ndp_annc_sta = -1;
3120 static int hf_he_ndp_sounding_dialog_token_number = -1;
3121 static int hf_he_ndp_annc_he_subfield = -1;
3122 static int hf_he_ndp_annc_reserved = -1;
3123 static int hf_he_ndp_annc_aid11 = -1;
3124 static int hf_he_ndp_annc_partial_bw_info = -1;
3125 static int hf_he_ndp_annc_feedback_type_and_ng = -1;
3126 static int hf_he_ndp_annc_disambiguation = -1;
3127 static int hf_he_ndp_annc_codebook_size = -1;
3128 static int hf_he_ndp_annc_nc = -1;
3129 static int hf_ieee80211_htc_ht_lac = -1;
3130 static int hf_ieee80211_htc_lac_trq = -1;
3131 static int hf_ieee80211_htc_lac_mai_aseli = -1;
3132 static int hf_ieee80211_htc_lac_mai_mrq = -1;
3133 static int hf_ieee80211_htc_lac_mai_msi = -1;
3134 static int hf_ieee80211_htc_lac_mai_reserved = -1;
3135 static int hf_ieee80211_htc_lac_mfsi = -1;
3136 static int hf_ieee80211_htc_lac_mfb = -1;
3137 static int hf_ieee80211_htc_lac_asel_command = -1;
3138 static int hf_ieee80211_htc_lac_asel_data = -1;
3139 static int hf_ieee80211_htc_cal_pos = -1;
3140 static int hf_ieee80211_htc_cal_seq = -1;
3141 static int hf_ieee80211_htc_reserved1 = -1;
3142 static int hf_ieee80211_htc_csi_steering = -1;
3143 static int hf_ieee80211_htc_ndp_announcement = -1;
3144 static int hf_ieee80211_htc_reserved2 = -1;
3145 static int hf_ieee80211_htc_mrq = -1;
3146 static int hf_ieee80211_htc_msi = -1;
3147 static int hf_ieee80211_htc_msi_stbc_reserved = -1;
3148 static int hf_ieee80211_htc_compressed_msi = -1;
3149 static int hf_ieee80211_htc_ppdu_stbc_encoded = -1;
3150 static int hf_ieee80211_htc_mfsi = -1;
3151 static int hf_ieee80211_htc_gid_l = -1;
3152 static int hf_ieee80211_htc_mfb = -1;
3153 static int hf_ieee80211_htc_num_sts = -1;
3154 static int hf_ieee80211_htc_vht_mcs = -1;
3155 static int hf_ieee80211_htc_bw = -1;
3156 static int hf_ieee80211_htc_snr = -1;
3157 static int hf_ieee80211_htc_reserved3 = -1;
3158 static int hf_ieee80211_htc_gid_h = -1;
3159 static int hf_ieee80211_htc_coding_type = -1;
3160 static int hf_ieee80211_htc_fb_tx_type = -1;
3161 static int hf_ieee80211_htc_unsolicited_mfb = -1;
3162 static int hf_ieee80211_htc_ac_constraint = -1;
3163 static int hf_ieee80211_htc_rdg_more_ppdu = -1;
3164
3165 /* ************************************************************************* */
3166 /*                Header values for sequence number field                    */
3167 /* ************************************************************************* */
3168 static int hf_ieee80211_frag_number = -1;
3169 static int hf_ieee80211_seq_number = -1;
3170
3171 /* ************************************************************************* */
3172 /*                   Header values for Frame Check field                     */
3173 /* ************************************************************************* */
3174 static int hf_ieee80211_fcs = -1;
3175 static int hf_ieee80211_fcs_status = -1;
3176
3177 /* ************************************************************************* */
3178 /*                   Header values for reassembly                            */
3179 /* ************************************************************************* */
3180 static int hf_ieee80211_fragments = -1;
3181 static int hf_ieee80211_fragment = -1;
3182 static int hf_ieee80211_fragment_overlap = -1;
3183 static int hf_ieee80211_fragment_overlap_conflict = -1;
3184 static int hf_ieee80211_fragment_multiple_tails = -1;
3185 static int hf_ieee80211_fragment_too_long_fragment = -1;
3186 static int hf_ieee80211_fragment_error = -1;
3187 static int hf_ieee80211_fragment_count = -1;
3188 static int hf_ieee80211_reassembled_in = -1;
3189 static int hf_ieee80211_reassembled_length = -1;
3190
3191 static int proto_wlan_ext = -1;
3192
3193 /* ************************************************************************* */
3194 /*                      Fixed fields found in mgt frames                     */
3195 /* ************************************************************************* */
3196 static int hf_ieee80211_fixed_parameters = -1;  /* Protocol payload for management frames */
3197
3198 static int hf_ieee80211_ff_auth_alg = -1;            /* Authentication algorithm field            */
3199 static int hf_ieee80211_ff_auth_seq = -1;            /* Authentication transaction sequence       */
3200 static int hf_ieee80211_ff_current_ap = -1;          /* Current AP MAC address                    */
3201 static int hf_ieee80211_ff_listen_ival = -1;         /* Listen interval fixed field               */
3202 static int hf_ieee80211_ff_timestamp = -1;           /* 64 bit timestamp                          */
3203 static int hf_ieee80211_ff_beacon_interval = -1;     /* 16 bit Beacon interval                    */
3204 static int hf_ieee80211_ff_assoc_id = -1;            /* 16 bit AID field                          */
3205 static int hf_ieee80211_ff_reason = -1;              /* 16 bit reason code                        */
3206 static int hf_ieee80211_ff_status_code = -1;         /* Status code                               */
3207 static int hf_ieee80211_ff_category_code = -1;       /* 8 bit Category code */
3208 static int hf_ieee80211_ff_action_code = -1;         /* 8 bit Action code */
3209 static int hf_ieee80211_ff_dialog_token = -1;        /* 8 bit Dialog token */
3210 static int hf_ieee80211_ff_followup_dialog_token = -1;
3211 static int hf_ieee80211_ff_wme_action_code = -1;     /* Management notification action code */
3212 static int hf_ieee80211_ff_wme_status_code = -1;     /* Management notification setup response status code */
3213 static int hf_ieee80211_ff_qos_action_code = -1;
3214 static int hf_ieee80211_ff_dls_action_code = -1;
3215 static int hf_ieee80211_ff_dst_mac_addr = -1;        /* DLS destination MAC addressi */
3216 static int hf_ieee80211_ff_src_mac_addr = -1;        /* DLS source MAC addressi */
3217 static int hf_ieee80211_ff_req_ap_addr = -1;
3218 static int hf_ieee80211_ff_res_ap_addr = -1;
3219 static int hf_ieee80211_ff_check_beacon = -1;
3220 static int hf_ieee80211_ff_dls_timeout = -1;         /* DLS timeout value */
3221 static int hf_ieee80211_ff_ft_action_code = -1; /* 8 bit FT Action code */
3222 static int hf_ieee80211_ff_sta_address = -1;
3223 static int hf_ieee80211_ff_target_ap_address = -1;
3224 static int hf_ieee80211_ff_gas_comeback_delay = -1;
3225 static int hf_ieee80211_ff_gas_fragment_id = -1;
3226 static int hf_ieee80211_ff_more_gas_fragments = -1;
3227 static int hf_ieee80211_ff_query_request_length = -1;
3228 static int hf_ieee80211_ff_query_request = -1;
3229 static int hf_ieee80211_ff_query_response_length = -1;
3230 static int hf_ieee80211_ff_query_response = -1;
3231 static int hf_ieee80211_ff_anqp_info_id = -1;
3232 static int hf_ieee80211_ff_anqp_info_length = -1;
3233 static int hf_ieee80211_ff_anqp_info = -1;
3234 static int hf_ieee80211_ff_anqp_query_id = -1;
3235 static int hf_ieee80211_ff_anqp_capability = -1;
3236 static int hf_ieee80211_ff_anqp_capability_vlen = -1;
3237 static int hf_ieee80211_ff_anqp_capability_vendor = -1;
3238 static int hf_ieee80211_ff_venue_info_group = -1;
3239 static int hf_ieee80211_ff_venue_info_type = -1;
3240 static int hf_ieee80211_ff_anqp_venue_length = -1;
3241 static int hf_ieee80211_ff_anqp_venue_language = -1;
3242 static int hf_ieee80211_ff_anqp_venue_name = -1;
3243 static int hf_ieee80211_ff_anqp_nw_auth_type_indicator = -1;
3244 static int hf_ieee80211_ff_anqp_nw_auth_type_url_len = -1;
3245 static int hf_ieee80211_ff_anqp_nw_auth_type_url = -1;
3246 static int hf_ieee80211_ff_anqp_roaming_consortium_oi_len = -1;
3247 static int hf_ieee80211_ff_anqp_roaming_consortium_oi = -1;
3248 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv6 = -1;
3249 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv4 = -1;
3250 static int hf_ieee80211_ff_anqp_nai_realm_count = -1;
3251 static int hf_ieee80211_ff_anqp_nai_field_len = -1;
3252 static int hf_ieee80211_ff_anqp_nai_realm_encoding = -1;
3253 static int hf_ieee80211_ff_anqp_nai_realm_length = -1;
3254 static int hf_ieee80211_ff_anqp_nai_realm = -1;
3255 static int hf_ieee80211_ff_anqp_nai_realm_eap_count = -1;
3256 static int hf_ieee80211_ff_anqp_nai_realm_eap_len = -1;
3257 static int hf_ieee80211_ff_anqp_nai_realm_eap_method = -1;
3258 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_count = -1;
3259 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_id = -1;
3260 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_len = -1;
3261 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_value = -1;
3262 static int hf_ieee80211_3gpp_gc_gud = -1;
3263 static int hf_ieee80211_3gpp_gc_udhl = -1;
3264 static int hf_ieee80211_3gpp_gc_iei = -1;
3265 static int hf_ieee80211_3gpp_gc_num_plmns = -1;
3266 static int hf_ieee80211_3gpp_gc_plmn = -1;
3267 static int hf_ieee80211_3gpp_gc_plmn_len = -1;
3268 static int hf_ieee80211_ff_anqp_domain_name_len = -1;
3269 static int hf_ieee80211_ff_anqp_domain_name = -1;
3270 static int hf_ieee80211_ff_tdls_action_code = -1;
3271 static int hf_ieee80211_ff_target_channel = -1;
3272 static int hf_ieee80211_ff_operating_class = -1;
3273 static int hf_ieee80211_ff_wnm_action_code = -1;
3274 static int hf_ieee80211_ff_unprotected_wnm_action_code = -1;
3275 static int hf_ieee80211_ff_key_data_length = -1;
3276 static int hf_ieee80211_ff_key_data = -1;
3277 static int hf_ieee80211_ff_wnm_notification_type = -1;
3278 static int hf_ieee80211_ff_rm_action_code = -1;
3279 static int hf_ieee80211_ff_rm_dialog_token = -1;
3280 static int hf_ieee80211_ff_rm_repetitions = -1;
3281 static int hf_ieee80211_ff_rm_tx_power = -1;
3282 static int hf_ieee80211_ff_rm_max_tx_power = -1;
3283 static int hf_ieee80211_ff_tpc = -1;
3284 static int hf_ieee80211_ff_tpc_element_id = -1;
3285 static int hf_ieee80211_ff_tpc_length = -1;
3286 static int hf_ieee80211_ff_tpc_tx_power = -1;
3287 static int hf_ieee80211_ff_tpc_link_margin = -1;
3288 static int hf_ieee80211_ff_rm_rx_antenna_id = -1;
3289 static int hf_ieee80211_ff_rm_tx_antenna_id = -1;
3290 static int hf_ieee80211_ff_rm_rcpi = -1;
3291 static int hf_ieee80211_ff_rm_rsni = -1;
3292 static int hf_ieee80211_ff_request_mode_pref_cand = -1;
3293 static int hf_ieee80211_ff_request_mode_abridged = -1;
3294 static int hf_ieee80211_ff_request_mode_disassoc_imminent = -1;
3295 static int hf_ieee80211_ff_request_mode_bss_term_included = -1;
3296 static int hf_ieee80211_ff_request_mode_ess_disassoc_imminent = -1;
3297 static int hf_ieee80211_ff_disassoc_timer = -1;
3298 static int hf_ieee80211_ff_validity_interval = -1;
3299 static int hf_ieee80211_ff_bss_termination_duration = -1;
3300 static int hf_ieee80211_ff_url_len = -1;
3301 static int hf_ieee80211_ff_url = -1;
3302 static int hf_ieee80211_ff_target_bss = -1;
3303 static int hf_ieee80211_ff_bss_transition_query_reason = -1;
3304 static int hf_ieee80211_ff_bss_transition_status_code = -1;
3305 static int hf_ieee80211_ff_bss_termination_delay = -1;
3306 static int hf_ieee80211_ff_bss_transition_candidate_list_entries = -1;
3307
3308 static int hf_ieee80211_ff_sa_query_action_code = -1;
3309 static int hf_ieee80211_ff_transaction_id = -1;
3310
3311 static int hf_ieee80211_ff_send_confirm = -1;
3312 static int hf_ieee80211_ff_anti_clogging_token = -1;
3313 static int hf_ieee80211_ff_scalar = -1;
3314 static int hf_ieee80211_ff_finite_field_element = -1;
3315 static int hf_ieee80211_ff_confirm = -1;
3316 static int hf_ieee80211_ff_finite_cyclic_group = -1;
3317
3318 /* Vendor specific */
3319 static int hf_ieee80211_ff_marvell_action_type = -1;
3320 static int hf_ieee80211_ff_marvell_mesh_mgt_action_code = -1;
3321 static int hf_ieee80211_ff_marvell_mesh_mgt_length = -1;     /* Mesh Management length */
3322 static int hf_ieee80211_ff_marvell_mesh_mgt_mode = -1;       /* Mesh Management mode */
3323 static int hf_ieee80211_ff_marvell_mesh_mgt_ttl = -1;        /* Mesh Management TTL */
3324 static int hf_ieee80211_ff_marvell_mesh_mgt_dstcount = -1;   /* Mesh Management dst count */
3325 static int hf_ieee80211_ff_marvell_mesh_mgt_hopcount = -1;   /* Mesh Management hop count */
3326 static int hf_ieee80211_ff_marvell_mesh_mgt_rreqid = -1;     /* Mesh Management RREQ ID */
3327 static int hf_ieee80211_ff_marvell_mesh_mgt_sa = -1;         /* Mesh Management src addr */
3328 static int hf_ieee80211_ff_marvell_mesh_mgt_ssn = -1;        /* Mesh Management src sequence number */
3329 static int hf_ieee80211_ff_marvell_mesh_mgt_metric = -1;     /* Mesh Management metric */
3330 static int hf_ieee80211_ff_marvell_mesh_mgt_flags = -1;      /* Mesh Management RREQ flags */
3331 static int hf_ieee80211_ff_marvell_mesh_mgt_da = -1;         /* Mesh Management dst addr */
3332 static int hf_ieee80211_ff_marvell_mesh_mgt_dsn = -1;        /* Mesh Management dst sequence number */
3333 static int hf_ieee80211_ff_marvell_mesh_mgt_lifetime = -1;   /* Mesh Management lifetime */
3334
3335
3336 static int hf_ieee80211_ff_ba_action = -1;
3337
3338 static int hf_ieee80211_ff_block_ack_params = -1;
3339 static int hf_ieee80211_ff_block_ack_params_amsdu_permitted = -1;
3340 static int hf_ieee80211_ff_block_ack_params_policy = -1;
3341 static int hf_ieee80211_ff_block_ack_params_tid = -1;
3342 static int hf_ieee80211_ff_block_ack_params_buffer_size = -1;
3343
3344 static const int *ieee80211_ff_block_ack_params_fields[] = {
3345   &hf_ieee80211_ff_block_ack_params_amsdu_permitted,
3346   &hf_ieee80211_ff_block_ack_params_policy,
3347   &hf_ieee80211_ff_block_ack_params_tid,
3348   &hf_ieee80211_ff_block_ack_params_buffer_size,
3349   NULL
3350 };
3351
3352 static int hf_ieee80211_ff_block_ack_timeout = -1;
3353
3354 static int hf_ieee80211_ff_block_ack_ssc = -1;
3355 static int hf_ieee80211_ff_block_ack_ssc_fragment = -1;
3356 static int hf_ieee80211_ff_block_ack_ssc_sequence = -1;
3357
3358 static const int *ieee80211_ff_block_ack_ssc_fields[] = {
3359   &hf_ieee80211_ff_block_ack_ssc_fragment,
3360   &hf_ieee80211_ff_block_ack_ssc_sequence,
3361   NULL
3362 };
3363
3364 static int hf_ieee80211_ff_delba_param = -1;
3365 static int hf_ieee80211_ff_delba_param_reserved = -1;
3366 static int hf_ieee80211_ff_delba_param_init = -1;
3367 static int hf_ieee80211_ff_delba_param_tid = -1;
3368
3369 static const int *ieee80211_ff_delba_param_fields[] = {
3370   &hf_ieee80211_ff_delba_param_reserved,
3371   &hf_ieee80211_ff_delba_param_init,
3372   &hf_ieee80211_ff_delba_param_tid,
3373   NULL
3374 };
3375
3376 static int hf_ieee80211_ff_max_reg_pwr = -1;
3377 static int hf_ieee80211_ff_measurement_pilot_int = -1;
3378 static int hf_ieee80211_ff_country_str = -1;
3379 static int hf_ieee80211_ff_max_tx_pwr = -1;
3380 static int hf_ieee80211_ff_tx_pwr_used = -1;
3381 static int hf_ieee80211_ff_transceiver_noise_floor = -1;
3382 static int hf_ieee80211_ff_channel_width = -1;
3383
3384 static int hf_ieee80211_ff_qos_info_ap = -1;
3385 static int hf_ieee80211_ff_qos_info_ap_edca_param_set_counter = -1;
3386 static int hf_ieee80211_ff_qos_info_ap_q_ack = -1;
3387 static int hf_ieee80211_ff_qos_info_ap_queue_req = -1;
3388 static int hf_ieee80211_ff_qos_info_ap_txop_request = -1;
3389 static int hf_ieee80211_ff_qos_info_ap_reserved = -1;
3390
3391 static const int *ieee80211_ff_qos_info_ap_fields[] = {
3392   &hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
3393   &hf_ieee80211_ff_qos_info_ap_q_ack,
3394   &hf_ieee80211_ff_qos_info_ap_queue_req,
3395   &hf_ieee80211_ff_qos_info_ap_txop_request,
3396   &hf_ieee80211_ff_qos_info_ap_reserved,
3397   NULL
3398 };
3399
3400 static int hf_ieee80211_ff_qos_info_sta = -1;
3401 static int hf_ieee80211_ff_qos_info_sta_ac_vo = -1;
3402 static int hf_ieee80211_ff_qos_info_sta_ac_vi = -1;
3403 static int hf_ieee80211_ff_qos_info_sta_ac_bk = -1;
3404 static int hf_ieee80211_ff_qos_info_sta_ac_be = -1;
3405 static int hf_ieee80211_ff_qos_info_sta_q_ack = -1;
3406 static int hf_ieee80211_ff_qos_info_sta_max_sp_length = -1;
3407 static int hf_ieee80211_ff_qos_info_sta_more_data_ack = -1;
3408
3409 static const int *ieee80211_ff_qos_info_sta_fields[] = {
3410   &hf_ieee80211_ff_qos_info_sta_ac_vo,
3411   &hf_ieee80211_ff_qos_info_sta_ac_vi,
3412   &hf_ieee80211_ff_qos_info_sta_ac_bk,
3413   &hf_ieee80211_ff_qos_info_sta_ac_be,
3414   &hf_ieee80211_ff_qos_info_sta_q_ack,
3415   &hf_ieee80211_ff_qos_info_sta_max_sp_length,
3416   &hf_ieee80211_ff_qos_info_sta_more_data_ack,
3417   NULL
3418 };
3419
3420 static int hf_ieee80211_ff_sm_pwr_save = -1;
3421 static int hf_ieee80211_ff_sm_pwr_save_enabled = -1;
3422 static int hf_ieee80211_ff_sm_pwr_save_sm_mode = -1;
3423 static int hf_ieee80211_ff_sm_pwr_save_reserved = -1;
3424
3425 static const int *ieee80211_ff_sw_pwr_save_fields[] = {
3426   &hf_ieee80211_ff_sm_pwr_save_enabled,
3427   &hf_ieee80211_ff_sm_pwr_save_sm_mode,
3428   &hf_ieee80211_ff_sm_pwr_save_reserved,
3429   NULL
3430 };
3431
3432 static int hf_ieee80211_ff_pco_phase_cntrl = -1;
3433
3434 static int hf_ieee80211_ff_psmp_param_set = -1;
3435 static int hf_ieee80211_ff_psmp_param_set_n_sta = -1;
3436 static int hf_ieee80211_ff_psmp_param_set_more_psmp = -1;
3437 static int hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration = -1;
3438
3439 static const int *ieee80211_ff_psmp_param_set_fields[] = {
3440   &hf_ieee80211_ff_psmp_param_set_n_sta,
3441   &hf_ieee80211_ff_psmp_param_set_more_psmp,
3442   &hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
3443   NULL
3444 };
3445
3446 static int hf_ieee80211_ff_mimo_cntrl = -1;
3447 static int hf_ieee80211_ff_mimo_cntrl_nc_index = -1;
3448 static int hf_ieee80211_ff_mimo_cntrl_nr_index = -1;
3449 static int hf_ieee80211_ff_mimo_cntrl_channel_width = -1;
3450 static int hf_ieee80211_ff_mimo_cntrl_grouping = -1;
3451 static int hf_ieee80211_ff_mimo_cntrl_coefficient_size = -1;
3452 static int hf_ieee80211_ff_mimo_cntrl_codebook_info = -1;
3453 static int hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment = -1;
3454 static int hf_ieee80211_ff_mimo_cntrl_reserved = -1;
3455 static int hf_ieee80211_ff_mimo_cntrl_sounding_timestamp = -1;
3456
3457 static int hf_ieee80211_ff_ant_selection = -1;
3458 static int hf_ieee80211_ff_ant_selection_0 = -1;
3459 static int hf_ieee80211_ff_ant_selection_1 = -1;
3460 static int hf_ieee80211_ff_ant_selection_2 = -1;
3461 static int hf_ieee80211_ff_ant_selection_3 = -1;
3462 static int hf_ieee80211_ff_ant_selection_4 = -1;
3463 static int hf_ieee80211_ff_ant_selection_5 = -1;
3464 static int hf_ieee80211_ff_ant_selection_6 = -1;
3465 static int hf_ieee80211_ff_ant_selection_7 = -1;
3466
3467 static const int *ieee80211_ff_ant_selection_fields[] = {
3468   &hf_ieee80211_ff_ant_selection_0,
3469   &hf_ieee80211_ff_ant_selection_1,
3470   &hf_ieee80211_ff_ant_selection_2,
3471   &hf_ieee80211_ff_ant_selection_3,
3472   &hf_ieee80211_ff_ant_selection_4,
3473   &hf_ieee80211_ff_ant_selection_5,
3474   &hf_ieee80211_ff_ant_selection_6,
3475   &hf_ieee80211_ff_ant_selection_7,
3476   NULL
3477 };
3478
3479 static int hf_ieee80211_ff_ext_channel_switch_announcement = -1;
3480 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode = -1;
3481 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class = -1;
3482 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number = -1;
3483 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_count = -1;
3484
3485 static const int *ieee80211_ff_ext_channel_switch_announcement_fields[] = {
3486   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
3487   &hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
3488   &hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
3489   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
3490   NULL
3491 };
3492
3493 static int hf_ieee80211_ff_ht_info = -1;
3494 static int hf_ieee80211_ff_ht_info_information_request = -1;
3495 static int hf_ieee80211_ff_ht_info_40_mhz_intolerant = -1;
3496 static int hf_ieee80211_ff_ht_info_sta_chan_width = -1;
3497 static int hf_ieee80211_ff_ht_info_reserved = -1;
3498
3499 static const int *ieee80211_ff_ht_info_fields[] = {
3500   &hf_ieee80211_ff_ht_info_information_request,
3501   &hf_ieee80211_ff_ht_info_40_mhz_intolerant,
3502   &hf_ieee80211_ff_ht_info_sta_chan_width,
3503   &hf_ieee80211_ff_ht_info_reserved,
3504   NULL
3505 };
3506
3507 static int hf_ieee80211_ff_ht_action = -1;
3508
3509 static int hf_ieee80211_ff_psmp_sta_info = -1;
3510 static int hf_ieee80211_ff_psmp_sta_info_type = -1;
3511 static int hf_ieee80211_ff_psmp_sta_info_dtt_start_offset = -1;
3512 static int hf_ieee80211_ff_psmp_sta_info_dtt_duration = -1;
3513 static int hf_ieee80211_ff_psmp_sta_info_sta_id = -1;
3514 static int hf_ieee80211_ff_psmp_sta_info_utt_start_offset = -1;
3515 static int hf_ieee80211_ff_psmp_sta_info_utt_duration = -1;
3516 static int hf_ieee80211_ff_psmp_sta_info_reserved_small= -1;
3517 static int hf_ieee80211_ff_psmp_sta_info_reserved_large = -1;
3518 static int hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id = -1;
3519
3520 static int hf_ieee80211_ff_mimo_csi_snr = -1;
3521 static int hf_ieee80211_ff_mimo_csi_matrices = -1;
3522 static int hf_ieee80211_ff_mimo_csi_bf_matrices = -1;
3523 static int hf_ieee80211_ff_mimo_csi_cbf_matrices = -1;
3524
3525 /*** Begin: 802.11s additions ***/
3526 static int hf_ieee80211_mesh_control_field = -1;
3527
3528 static int hf_ieee80211_ff_mesh_action = -1;
3529 static int hf_ieee80211_ff_multihop_action = -1;
3530 static int hf_ieee80211_ff_mesh_flags = -1;
3531 static int hf_ieee80211_ff_mesh_ttl = -1;
3532 static int hf_ieee80211_ff_mesh_sequence = -1;
3533 static int hf_ieee80211_ff_mesh_addr4 = -1;
3534 static int hf_ieee80211_ff_mesh_addr5 = -1;
3535 static int hf_ieee80211_ff_mesh_addr6 = -1;
3536 static int hf_ieee80211_ff_selfprot_action = -1;
3537
3538 static int hf_ieee80211_mesh_peering_proto = -1;
3539 static int hf_ieee80211_mesh_peering_local_link_id = -1;
3540 static int hf_ieee80211_mesh_peering_peer_link_id = -1;
3541
3542 static int hf_ieee80211_ff_hwmp_flags = -1;
3543 static int hf_ieee80211_ff_hwmp_hopcount = -1;
3544 static int hf_ieee80211_ff_hwmp_ttl = -1;
3545 static int hf_ieee80211_ff_hwmp_pdid = -1;
3546 static int hf_ieee80211_ff_hwmp_orig_sta = -1;
3547 static int hf_ieee80211_ff_hwmp_orig_sn = -1;
3548 static int hf_ieee80211_ff_hwmp_orig_ext = -1;
3549 static int hf_ieee80211_ff_hwmp_lifetime = -1;
3550 static int hf_ieee80211_ff_hwmp_metric = -1;
3551 static int hf_ieee80211_ff_hwmp_targ_count = -1;
3552 static int hf_ieee80211_ff_hwmp_targ_flags = -1;
3553 static int hf_ieee80211_ff_hwmp_targ_to_flags = -1;
3554 static int hf_ieee80211_ff_hwmp_targ_usn_flags = -1;
3555 static int hf_ieee80211_ff_hwmp_targ_sta = -1;
3556 static int hf_ieee80211_ff_hwmp_targ_sn = -1;
3557 static int hf_ieee80211_ff_hwmp_targ_ext = -1;
3558 static int hf_ieee80211_rann_flags = -1;
3559 static int hf_ieee80211_rann_root_sta = -1;
3560 static int hf_ieee80211_rann_sn = -1;
3561 static int hf_ieee80211_rann_interval = -1;
3562
3563 static int hf_ieee80211_mesh_channel_switch_ttl = -1;
3564 static int hf_ieee80211_mesh_channel_switch_flag = -1;
3565 static int hf_ieee80211_mesh_channel_switch_reason_code = -1;
3566 static int hf_ieee80211_mesh_channel_switch_precedence_value = -1;
3567 static int hf_ieee80211_mesh_chswitch_flag_txrestrict = -1;
3568 static int hf_ieee80211_mesh_chswitch_flag_initiator = -1;
3569
3570 static int hf_ieee80211_mesh_config_path_sel_protocol = -1;
3571 static int hf_ieee80211_mesh_config_path_sel_metric = -1;
3572 static int hf_ieee80211_mesh_config_congestion_control = -1;
3573 static int hf_ieee80211_mesh_config_sync_method = -1;
3574 static int hf_ieee80211_mesh_config_auth_protocol = -1;
3575 static int hf_ieee80211_mesh_config_formation_info = -1;
3576 static int hf_ieee80211_mesh_config_capability = -1;
3577 static int hf_ieee80211_mesh_id = -1;
3578 static int hf_ieee80211_mesh_config_cap_accepting = -1;
3579 static int hf_ieee80211_mesh_config_cap_mcca_support = -1;
3580 static int hf_ieee80211_mesh_config_cap_mcca_enabled = -1;
3581 static int hf_ieee80211_mesh_config_cap_forwarding = -1;
3582 static int hf_ieee80211_mesh_config_cap_mbca_enabled = -1;
3583 static int hf_ieee80211_mesh_config_cap_tbtt_adjusting = -1;
3584 static int hf_ieee80211_mesh_config_cap_power_save_level = -1;
3585 static int hf_ieee80211_mesh_form_info_num_of_peerings = -1;
3586 static int hf_ieee80211_mesh_awake_window = -1;
3587
3588 static int hf_ieee80211_ff_public_action = -1;
3589 static int hf_ieee80211_ff_protected_public_action = -1;
3590 static int hf_ieee80211_ff_tod = -1;
3591 static int hf_ieee80211_ff_toa = -1;
3592 static int hf_ieee80211_ff_max_tod_err = -1;
3593 static int hf_ieee80211_ff_max_toa_err = -1;
3594
3595 /* ************************************************************************* */
3596 /*            Flags found in the capability field (fixed field)              */
3597 /* ************************************************************************* */
3598 static int hf_ieee80211_ff_capture = -1;
3599 static int hf_ieee80211_ff_cf_ess = -1;
3600 static int hf_ieee80211_ff_cf_ibss = -1;
3601 static int hf_ieee80211_ff_cf_sta_poll = -1; /* CF pollable status for a STA            */
3602 static int hf_ieee80211_ff_cf_ap_poll = -1;  /* CF pollable status for an AP            */
3603 static int hf_ieee80211_ff_cf_privacy = -1;
3604 static int hf_ieee80211_ff_cf_preamble = -1;
3605 static int hf_ieee80211_ff_cf_pbcc = -1;
3606 static int hf_ieee80211_ff_cf_agility = -1;
3607 static int hf_ieee80211_ff_short_slot_time = -1;
3608 static int hf_ieee80211_ff_dsss_ofdm = -1;
3609 static int hf_ieee80211_ff_cf_spec_man = -1;
3610 static int hf_ieee80211_ff_cf_apsd = -1;
3611 static int hf_ieee80211_ff_radio_measurement = -1;
3612 static int hf_ieee80211_ff_cf_del_blk_ack = -1;
3613 static int hf_ieee80211_ff_cf_imm_blk_ack = -1;
3614
3615 /* ************************************************************************* */
3616 /*                       A-MSDU fields                                       */
3617 /* ************************************************************************* */
3618 static int hf_ieee80211_amsdu_subframe = -1;
3619 static int hf_ieee80211_amsdu_length = -1;
3620
3621 /* ************************************************************************* */
3622 /*                       Tagged value format fields                          */
3623 /* ************************************************************************* */
3624 static int hf_ieee80211_tagged_parameters = -1;  /* Tagged payload item */
3625 static int hf_ieee80211_tag = -1;
3626 static int hf_ieee80211_tag_number = -1;
3627 static int hf_ieee80211_tag_length = -1;
3628 static int hf_ieee80211_tag_interpretation = -1;
3629 static int hf_ieee80211_tag_data = -1;
3630 static int hf_ieee80211_tag_oui = -1;
3631 static int hf_ieee80211_tag_oui_wfa_subtype = -1;
3632 static int hf_ieee80211_tag_ssid = -1;
3633 static int hf_ieee80211_tag_supp_rates = -1;
3634 static int hf_ieee80211_tag_fh_dwell_time = -1;
3635 static int hf_ieee80211_tag_fh_hop_set = -1;
3636 static int hf_ieee80211_tag_fh_hop_pattern = -1;
3637 static int hf_ieee80211_tag_fh_hop_index = -1;
3638 static int hf_ieee80211_tag_ds_param_channel = -1;
3639 static int hf_ieee80211_tag_cfp_count = -1;
3640 static int hf_ieee80211_tag_cfp_period = -1;
3641 static int hf_ieee80211_tag_cfp_max_duration = -1;
3642 static int hf_ieee80211_tag_cfp_dur_remaining = -1;
3643 static int hf_ieee80211_tim_dtim_count = -1;
3644 static int hf_ieee80211_tim_dtim_period = -1;
3645 static int hf_ieee80211_tim_bmapctl = -1;
3646 static int hf_ieee80211_tim_bmapctl_mcast = -1;
3647 static int hf_ieee80211_tim_bmapctl_offset = -1;
3648 static int hf_ieee80211_tim_partial_virtual_bitmap = -1;
3649 static int hf_ieee80211_tim_aid = -1;
3650 static int hf_ieee80211_tag_ibss_atim_window = -1;
3651 static int hf_ieee80211_tag_country_info_code = -1;
3652 static int hf_ieee80211_tag_country_info_env = -1;
3653 static int hf_ieee80211_tag_country_info_pad = -1;
3654 static int hf_ieee80211_tag_country_info_fnm = -1;
3655 static int hf_ieee80211_tag_country_info_fnm_fcn = -1;
3656 static int hf_ieee80211_tag_country_info_fnm_nc = -1;
3657 static int hf_ieee80211_tag_country_info_fnm_mtpl = -1;
3658 static int hf_ieee80211_tag_country_info_rrc = -1;
3659 static int hf_ieee80211_tag_country_info_rrc_oei = -1;
3660 static int hf_ieee80211_tag_country_info_rrc_oc = -1;
3661 static int hf_ieee80211_tag_country_info_rrc_cc = -1;
3662 static int hf_ieee80211_tag_fh_hopping_parameter_prime_radix = -1;
3663 static int hf_ieee80211_tag_fh_hopping_parameter_nb_channels = -1;
3664 static int hf_ieee80211_tag_fh_hopping_table_flag = -1;
3665 static int hf_ieee80211_tag_fh_hopping_table_number_of_sets = -1;
3666 static int hf_ieee80211_tag_fh_hopping_table_modulus = -1;
3667 static int hf_ieee80211_tag_fh_hopping_table_offset = -1;
3668 static int hf_ieee80211_tag_fh_hopping_random_table = -1;
3669 static int hf_ieee80211_tag_request = -1;
3670 static int hf_ieee80211_tag_challenge_text = -1;
3671
3672 static int hf_ieee80211_wep_iv = -1;
3673 static int hf_ieee80211_wep_iv_weak = -1;
3674 static int hf_ieee80211_tkip_extiv = -1;
3675 static int hf_ieee80211_ccmp_extiv = -1;
3676 static int hf_ieee80211_wep_key = -1;
3677 static int hf_ieee80211_wep_icv = -1;
3678 static int hf_ieee80211_fc_analysis_pmk = -1;
3679 static int hf_ieee80211_fc_analysis_tk = -1;
3680 static int hf_ieee80211_fc_analysis_gtk = -1;
3681
3682 static int hf_ieee80211_block_ack_control = -1;
3683 static int hf_ieee80211_block_ack_control_ack_policy = -1;
3684 static int hf_ieee80211_block_ack_control_type = -1;
3685 static int hf_ieee80211_block_ack_control_reserved = -1;
3686 static int hf_ieee80211_block_ack_control_tid_info = -1;
3687 static int hf_ieee80211_block_ack_multi_sta_aid11 = -1;
3688 static int hf_ieee80211_block_ack_multi_sta_ack_type = -1;
3689 static int hf_ieee80211_block_ack_multi_sta_tid = -1;
3690 static int hf_ieee80211_block_ack_multi_sta_aid_tid = -1;
3691 static int hf_ieee80211_block_ack_multi_sta_reserved = -1;
3692 static int hf_ieee80211_block_ack_multi_sta_ra = -1;
3693
3694 static int hf_ieee80211_block_ack_multi_tid_reserved = -1;
3695 static int hf_ieee80211_block_ack_multi_tid_value = -1;
3696 static int hf_ieee80211_block_ack_bitmap = -1;
3697 static int hf_ieee80211_block_ack_bitmap_missing_frame = -1;
3698 static int hf_ieee80211_block_ack_gcr_addr = -1;
3699
3700 static int hf_ieee80211_tag_measure_request_measurement_mode = -1;
3701 static int hf_ieee80211_tag_measure_request_bssid = -1;
3702
3703 static int hf_ieee80211_tag_measure_request_subelement_length = -1;
3704 static int hf_ieee80211_tag_measure_request_beacon_sub_id = -1;
3705 static int hf_ieee80211_tag_measure_request_beacon_sub_ssid = -1;
3706 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition = -1;
3707 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset = -1;
3708 static int hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail = -1;
3709 static int hf_ieee80211_tag_measure_request_beacon_sub_request = -1;
3710 static int hf_ieee80211_tag_measure_request_beacon_unknown = -1;
3711
3712 static int hf_ieee80211_tag_measure_request_channel_load_sub_id = -1;
3713 static int hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition = -1;
3714 static int hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref = -1;
3715
3716 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_id = -1;
3717 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition = -1;
3718 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref = -1;
3719
3720 static int hf_ieee80211_tag_measure_request_frame_request_type = -1;
3721 static int hf_ieee80211_tag_measure_request_mac_address  = -1;
3722 static int hf_ieee80211_tag_measure_request_peer_mac_address = -1;
3723 static int hf_ieee80211_tag_measure_request_group_id = -1;
3724
3725 static int hf_ieee80211_tag_measure_request_unknown = -1;
3726
3727 static int hf_ieee80211_ht_pren_type = -1;
3728 static int hf_ieee80211_ht_pren_unknown = -1;
3729
3730 static int hf_ieee80211_ht_cap = -1;
3731 static int hf_ieee80211_ht_vs_cap = -1;
3732 static int hf_ieee80211_ht_ldpc_coding = -1;
3733 static int hf_ieee80211_ht_chan_width = -1;
3734 static int hf_ieee80211_ht_sm_pwsave = -1;
3735 static int hf_ieee80211_ht_green = -1;
3736 static int hf_ieee80211_ht_short20 = -1;
3737 static int hf_ieee80211_ht_short40 = -1;
3738 static int hf_ieee80211_ht_tx_stbc = -1;
3739 static int hf_ieee80211_ht_rx_stbc = -1;
3740 static int hf_ieee80211_ht_delayed_block_ack = -1;
3741 static int hf_ieee80211_ht_max_amsdu = -1;
3742 static int hf_ieee80211_ht_dss_cck_40 = -1;
3743 static int hf_ieee80211_ht_psmp = -1;
3744 static int hf_ieee80211_ht_40_mhz_intolerant = -1;
3745 static int hf_ieee80211_ht_l_sig = -1;
3746
3747 static int hf_ieee80211_ext_bss_mu_mimo_capable_sta_count = -1;
3748 static int hf_ieee80211_ext_bss_ss_underutilization = -1;
3749 static int hf_ieee80211_ext_bss_observable_sec_20mhz_utilization = -1;
3750 static int hf_ieee80211_ext_bss_observable_sec_40mhz_utilization = -1;
3751 static int hf_ieee80211_ext_bss_observable_sec_80mhz_utilization = -1;
3752 static int hf_ieee80211_wide_bw_new_channel_width = -1;
3753 static int hf_ieee80211_wide_bw_new_channel_center_freq_segment0 = -1;
3754 static int hf_ieee80211_wide_bw_new_channel_center_freq_segment1 = -1;
3755
3756 static int hf_ieee80211_operat_notification_mode = -1;
3757 static int hf_ieee80211_operat_mode_field_channel_width = -1;
3758 static int hf_ieee80211_operat_mode_field_reserved = -1;
3759 static int hf_ieee80211_operat_mode_field_rxnss = -1;
3760 static int hf_ieee80211_operat_mode_field_rxnsstype= -1;
3761 static int hf_ieee80211_ampduparam = -1;
3762 static int hf_ieee80211_ampduparam_vs = -1;
3763 static int hf_ieee80211_ampduparam_mpdu = -1;
3764 static int hf_ieee80211_ampduparam_mpdu_start_spacing = -1;
3765 static int hf_ieee80211_ampduparam_reserved = -1;
3766
3767 static int hf_ieee80211_mcsset = -1;
3768 static int hf_ieee80211_mcsset_vs = -1;
3769 static int hf_ieee80211_mcsset_rx_bitmask = -1;
3770 static int hf_ieee80211_mcsset_rx_bitmask_0to7 = -1;
3771 static int hf_ieee80211_mcsset_rx_bitmask_8to15 = -1;
3772 static int hf_ieee80211_mcsset_rx_bitmask_16to23 = -1;
3773 static int hf_ieee80211_mcsset_rx_bitmask_24to31 = -1;
3774 static int hf_ieee80211_mcsset_rx_bitmask_32 = -1;
3775 static int hf_ieee80211_mcsset_rx_bitmask_33to38 = -1;
3776 static int hf_ieee80211_mcsset_rx_bitmask_39to52 = -1;
3777 static int hf_ieee80211_mcsset_rx_bitmask_53to76 = -1;
3778 static int hf_ieee80211_mcsset_highest_data_rate = -1;
3779 static int hf_ieee80211_mcsset_tx_mcs_set_defined = -1;
3780 static int hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal = -1;
3781 static int hf_ieee80211_mcsset_tx_max_spatial_streams = -1;
3782 static int hf_ieee80211_mcsset_tx_unequal_modulation = -1;
3783
3784 static int hf_ieee80211_htex_cap = -1;
3785 static int hf_ieee80211_htex_vs_cap = -1;
3786 static int hf_ieee80211_htex_pco = -1;
3787 static int hf_ieee80211_htex_transtime = -1;
3788 static int hf_ieee80211_htex_mcs = -1;
3789 static int hf_ieee80211_htex_htc_support = -1;
3790 static int hf_ieee80211_htex_rd_responder = -1;
3791
3792 static int hf_ieee80211_txbf = -1;
3793 static int hf_ieee80211_txbf_vs = -1;
3794 static int hf_ieee80211_txbf_cap = -1;
3795 static int hf_ieee80211_txbf_rcv_ssc = -1;
3796 static int hf_ieee80211_txbf_tx_ssc = -1;
3797 static int hf_ieee80211_txbf_rcv_ndp = -1;
3798 static int hf_ieee80211_txbf_tx_ndp = -1;
3799 static int hf_ieee80211_txbf_impl_txbf = -1;
3800 static int hf_ieee80211_txbf_calib = -1;
3801 static int hf_ieee80211_txbf_expl_csi = -1;
3802 static int hf_ieee80211_txbf_expl_uncomp_fm = -1;
3803 static int hf_ieee80211_txbf_expl_comp_fm = -1;
3804 static int hf_ieee80211_txbf_expl_bf_csi = -1;
3805 static int hf_ieee80211_txbf_expl_uncomp_fm_feed = -1;
3806 static int hf_ieee80211_txbf_expl_comp_fm_feed = -1;
3807 static int hf_ieee80211_txbf_csi_num_bf_ant = -1;
3808 static int hf_ieee80211_txbf_min_group = -1;
3809 static int hf_ieee80211_txbf_uncomp_sm_bf_ant = -1;
3810 static int hf_ieee80211_txbf_comp_sm_bf_ant = -1;
3811 static int hf_ieee80211_txbf_csi_max_rows_bf = -1;
3812 static int hf_ieee80211_txbf_chan_est = -1;
3813 static int hf_ieee80211_txbf_resrv = -1;
3814
3815 /*** Begin: 802.11n D1.10 - HT Information IE  ***/
3816 static int hf_ieee80211_ht_info_primary_channel = -1;
3817
3818 static int hf_ieee80211_ht_info_delimiter1 = -1;
3819 static int hf_ieee80211_ht_info_secondary_channel_offset = -1;
3820 static int hf_ieee80211_ht_info_sta_channel_width = -1;
3821 static int hf_ieee80211_ht_info_rifs_mode = -1;
3822 static int hf_ieee80211_ht_info_reserved_b4_b7 = -1;
3823
3824 static int hf_ieee80211_ht_info_delimiter2 = -1;
3825 static int hf_ieee80211_ht_info_protection = -1;
3826 static int hf_ieee80211_ht_info_non_greenfield_sta_present = -1;
3827 static int hf_ieee80211_ht_info_reserved_b11 = -1;
3828 static int hf_ieee80211_ht_info_obss_non_ht_stas_present = -1;
3829 static int hf_ieee80211_ht_info_channel_center_freq_seg_2 = -1;
3830 static int hf_ieee80211_ht_info_reserved_b21_b23 = -1;
3831
3832 static int hf_ieee80211_ht_info_delimiter3 = -1;
3833 static int hf_ieee80211_ht_info_reserved_b24_b29 = -1;
3834 static int hf_ieee80211_ht_info_dual_beacon = -1;
3835 static int hf_ieee80211_ht_info_dual_cts_protection = -1;
3836 static int hf_ieee80211_ht_info_secondary_beacon = -1;
3837 static int hf_ieee80211_ht_info_lsig_txop_protection_full_support = -1;
3838 static int hf_ieee80211_ht_info_pco_active = -1;
3839 static int hf_ieee80211_ht_info_pco_phase = -1;
3840 static int hf_ieee80211_ht_info_reserved_b36_b39 = -1;
3841 /*** End: 802.11n D1.10 - HT Information IE  ***/
3842
3843 static int hf_ieee80211_tag_ap_channel_report_operating_class = -1;
3844 static int hf_ieee80211_tag_ap_channel_report_channel_list = -1;
3845
3846 static int hf_ieee80211_tag_secondary_channel_offset = -1;
3847
3848 static int hf_ieee80211_tag_bss_ap_avg_access_delay = -1;
3849
3850 static int hf_ieee80211_tag_antenna_id = -1;
3851
3852 static int hf_ieee80211_tag_rsni = -1;
3853
3854 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask = -1;
3855 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0 = -1;
3856 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1 = -1;
3857 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2 = -1;
3858 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3 = -1;
3859 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4 = -1;
3860 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5 = -1;
3861 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6 = -1;
3862 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7 = -1;
3863 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0 = -1;
3864 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1 = -1;
3865 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2 = -1;
3866 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3 = -1;
3867 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv = -1;
3868 static int hf_ieee80211_tag_bss_avb_adm_cap_up0 = -1;
3869 static int hf_ieee80211_tag_bss_avb_adm_cap_up1 = -1;
3870 static int hf_ieee80211_tag_bss_avb_adm_cap_up2 = -1;
3871 static int hf_ieee80211_tag_bss_avb_adm_cap_up3 = -1;
3872 static int hf_ieee80211_tag_bss_avb_adm_cap_up4 = -1;
3873 static int hf_ieee80211_tag_bss_avb_adm_cap_up5 = -1;
3874 static int hf_ieee80211_tag_bss_avb_adm_cap_up6 = -1;
3875 static int hf_ieee80211_tag_bss_avb_adm_cap_up7 = -1;
3876 static int hf_ieee80211_tag_bss_avb_adm_cap_ac0 = -1;
3877 static int hf_ieee80211_tag_bss_avb_adm_cap_ac1 = -1;
3878 static int hf_ieee80211_tag_bss_avb_adm_cap_ac2 = -1;
3879 static int hf_ieee80211_tag_bss_avb_adm_cap_ac3 = -1;
3880
3881 static int hf_ieee80211_tag_bss_avg_ac_access_delay_be = -1;
3882 static int hf_ieee80211_tag_bss_avg_ac_access_delay_bk = -1;
3883 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vi = -1;
3884 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vo = -1;
3885
3886 static int hf_ieee80211_tag_rm_enabled_capabilities = -1;
3887 static int hf_ieee80211_tag_rm_enabled_capabilities_b0 = -1;
3888 static int hf_ieee80211_tag_rm_enabled_capabilities_b1 = -1;
3889 static int hf_ieee80211_tag_rm_enabled_capabilities_b2 = -1;
3890 static int hf_ieee80211_tag_rm_enabled_capabilities_b3 = -1;
3891 static int hf_ieee80211_tag_rm_enabled_capabilities_b4 = -1;
3892 static int hf_ieee80211_tag_rm_enabled_capabilities_b5 = -1;
3893 static int hf_ieee80211_tag_rm_enabled_capabilities_b6 = -1;
3894 static int hf_ieee80211_tag_rm_enabled_capabilities_b7 = -1;
3895 static int hf_ieee80211_tag_rm_enabled_capabilities_b8 = -1;
3896 static int hf_ieee80211_tag_rm_enabled_capabilities_b9 = -1;
3897 static int hf_ieee80211_tag_rm_enabled_capabilities_b10 = -1;
3898 static int hf_ieee80211_tag_rm_enabled_capabilities_b11 = -1;
3899 static int hf_ieee80211_tag_rm_enabled_capabilities_b12 = -1;
3900 static int hf_ieee80211_tag_rm_enabled_capabilities_b13 = -1;
3901 static int hf_ieee80211_tag_rm_enabled_capabilities_b14 = -1;
3902 static int hf_ieee80211_tag_rm_enabled_capabilities_b15 = -1;
3903 static int hf_ieee80211_tag_rm_enabled_capabilities_b16 = -1;
3904 static int hf_ieee80211_tag_rm_enabled_capabilities_b17 = -1;
3905 static int hf_ieee80211_tag_rm_enabled_capabilities_b18to20 = -1;
3906 static int hf_ieee80211_tag_rm_enabled_capabilities_b21to23 = -1;
3907 static int hf_ieee80211_tag_rm_enabled_capabilities_b24to26 = -1;
3908 static int hf_ieee80211_tag_rm_enabled_capabilities_b27 = -1;
3909 static int hf_ieee80211_tag_rm_enabled_capabilities_b28 = -1;
3910 static int hf_ieee80211_tag_rm_enabled_capabilities_b29 = -1;
3911 static int hf_ieee80211_tag_rm_enabled_capabilities_b30 = -1;
3912 static int hf_ieee80211_tag_rm_enabled_capabilities_b31 = -1;
3913 static int hf_ieee80211_tag_rm_enabled_capabilities_b32 = -1;
3914 static int hf_ieee80211_tag_rm_enabled_capabilities_b33 = -1;
3915 static int hf_ieee80211_tag_rm_enabled_capabilities_o5 = -1;
3916
3917 static int hf_ieee80211_tag_20_40_bc = -1;
3918 static int hf_ieee80211_tag_20_40_bc_information_request = -1;
3919 static int hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant = -1;
3920 static int hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request = -1;
3921 static int hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request = -1;
3922 static int hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant = -1;
3923 static int hf_ieee80211_tag_20_40_bc_reserved = -1;
3924
3925 static int hf_ieee80211_tag_power_constraint_local = -1;
3926
3927 static int hf_ieee80211_tag_power_capability_min = -1;
3928 static int hf_ieee80211_tag_power_capability_max = -1;
3929
3930 static int hf_ieee80211_tag_tpc_report_trsmt_pow = -1;
3931 static int hf_ieee80211_tag_tpc_report_link_mrg = -1;
3932
3933 static int hf_ieee80211_tag_supported_channels = -1;
3934 static int hf_ieee80211_tag_supported_channels_first = -1;
3935 static int hf_ieee80211_tag_supported_channels_range = -1;
3936
3937 static int hf_ieee80211_csa_channel_switch_mode = -1;
3938 static int hf_ieee80211_csa_new_channel_number = -1;
3939 static int hf_ieee80211_csa_channel_switch_count = -1;
3940
3941 static int hf_ieee80211_tag_measure_request_token = -1;
3942 static int hf_ieee80211_tag_measure_request_mode = -1;
3943 static int hf_ieee80211_tag_measure_request_mode_parallel = -1;
3944 static int hf_ieee80211_tag_measure_request_mode_enable = -1;
3945 static int hf_ieee80211_tag_measure_request_mode_request = -1;
3946 static int hf_ieee80211_tag_measure_request_mode_report = -1;
3947 static int hf_ieee80211_tag_measure_request_mode_duration_mandatory = -1;
3948 static int hf_ieee80211_tag_measure_request_mode_reserved = -1;
3949 static int hf_ieee80211_tag_measure_request_type = -1;
3950
3951 static int hf_ieee80211_tag_measure_request_channel_number = -1;
3952 static int hf_ieee80211_tag_measure_request_start_time = -1;
3953 static int hf_ieee80211_tag_measure_request_duration = -1;
3954
3955 static int hf_ieee80211_tag_measure_request_operating_class = -1;
3956 static int hf_ieee80211_tag_measure_request_randomization_interval = -1;
3957
3958 static int hf_ieee80211_tag_measure_report_measurement_token = -1;
3959 static int hf_ieee80211_tag_measure_report_mode = -1;
3960 static int hf_ieee80211_tag_measure_report_mode_late = -1;
3961 static int hf_ieee80211_tag_measure_report_mode_incapable = -1;
3962 static int hf_ieee80211_tag_measure_report_mode_refused = -1;
3963 static int hf_ieee80211_tag_measure_report_mode_reserved = -1;
3964 static int hf_ieee80211_tag_measure_report_type = -1;
3965 static int hf_ieee80211_tag_measure_report_channel_number = -1;
3966 static int hf_ieee80211_tag_measure_report_start_time = -1;
3967 static int hf_ieee80211_tag_measure_report_duration = -1;
3968
3969 static int hf_ieee80211_tag_measure_basic_map_field = -1;
3970 static int hf_ieee80211_tag_measure_map_field_bss = -1;
3971 static int hf_ieee80211_tag_measure_map_field_odfm = -1;
3972 static int hf_ieee80211_tag_measure_map_field_unident_signal = -1;
3973 static int hf_ieee80211_tag_measure_map_field_radar = -1;
3974 static int hf_ieee80211_tag_measure_map_field_unmeasured = -1;
3975 static int hf_ieee80211_tag_measure_map_field_reserved = -1;
3976
3977 static int hf_ieee80211_tag_measure_cca_busy_fraction = -1;
3978
3979 static int hf_ieee80211_tag_measure_rpi_histogram_report = -1;
3980 static int hf_ieee80211_tag_measure_rpi_histogram_report_0 = -1;
3981 static int hf_ieee80211_tag_measure_rpi_histogram_report_1 = -1;
3982 static int hf_ieee80211_tag_measure_rpi_histogram_report_2 = -1;
3983 static int hf_ieee80211_tag_measure_rpi_histogram_report_3 = -1;
3984 static int hf_ieee80211_tag_measure_rpi_histogram_report_4 = -1;
3985 static int hf_ieee80211_tag_measure_rpi_histogram_report_5 = -1;
3986 static int hf_ieee80211_tag_measure_rpi_histogram_report_6 = -1;
3987 static int hf_ieee80211_tag_measure_rpi_histogram_report_7 = -1;
3988
3989 static int hf_ieee80211_tag_measure_report_operating_class = -1;
3990 static int hf_ieee80211_tag_measure_report_channel_load = -1;
3991 static int hf_ieee80211_tag_measure_report_frame_info = -1;
3992 static int hf_ieee80211_tag_measure_report_frame_info_phy_type = -1;
3993 static int hf_ieee80211_tag_measure_report_frame_info_frame_type = -1;
3994 static int hf_ieee80211_tag_measure_report_rcpi = -1;
3995 static int hf_ieee80211_tag_measure_report_rsni = -1;
3996 static int hf_ieee80211_tag_measure_report_bssid = -1;
3997 static int hf_ieee80211_tag_measure_report_ant_id = -1;
3998 static int hf_ieee80211_tag_measure_report_anpi = -1;
3999 static int hf_ieee80211_tag_measure_report_ipi_density_0 = -1;
4000 static int hf_ieee80211_tag_measure_report_ipi_density_1 = -1;
4001 static int hf_ieee80211_tag_measure_report_ipi_density_2 = -1;
4002 static int hf_ieee80211_tag_measure_report_ipi_density_3 = -1;
4003 static int hf_ieee80211_tag_measure_report_ipi_density_4 = -1;
4004 static int hf_ieee80211_tag_measure_report_ipi_density_5 = -1;
4005 static int hf_ieee80211_tag_measure_report_ipi_density_6 = -1;
4006 static int hf_ieee80211_tag_measure_report_ipi_density_7 = -1;
4007 static int hf_ieee80211_tag_measure_report_ipi_density_8 = -1;
4008 static int hf_ieee80211_tag_measure_report_ipi_density_9 = -1;
4009 static int hf_ieee80211_tag_measure_report_ipi_density_10 = -1;
4010 static int hf_ieee80211_tag_measure_report_parent_tsf = -1;
4011
4012 static int hf_ieee80211_tag_measure_report_subelement_length = -1;
4013 static int hf_ieee80211_tag_measure_report_beacon_sub_id = -1;
4014
4015 static int hf_ieee80211_tag_measure_report_unknown = -1;
4016
4017 static int hf_ieee80211_tag_quiet_count = -1;
4018 static int hf_ieee80211_tag_quiet_period = -1;
4019 static int hf_ieee80211_tag_quiet_duration = -1;
4020 static int hf_ieee80211_tag_quiet_offset = -1;
4021
4022 static int hf_ieee80211_tag_dfs_owner = -1;
4023 static int hf_ieee80211_tag_dfs_recovery_interval = -1;
4024 static int hf_ieee80211_tag_dfs_channel_map = -1;
4025 static int hf_ieee80211_tag_dfs_channel_number = -1;
4026 static int hf_ieee80211_tag_dfs_map = -1;
4027
4028 static int hf_ieee80211_tag_erp_info = -1;
4029 static int hf_ieee80211_tag_erp_info_erp_present = -1;
4030 static int hf_ieee80211_tag_erp_info_use_protection = -1;
4031 static int hf_ieee80211_tag_erp_info_barker_preamble_mode = -1;
4032 static int hf_ieee80211_tag_erp_info_reserved = -1;
4033
4034 static int hf_ieee80211_tag_extended_capabilities = -1;
4035 static int hf_ieee80211_tag_extended_capabilities_b0 = -1;
4036 static int hf_ieee80211_tag_extended_capabilities_b1 = -1;
4037 static int hf_ieee80211_tag_extended_capabilities_b2 = -1;
4038 static int hf_ieee80211_tag_extended_capabilities_b3 = -1;
4039 static int hf_ieee80211_tag_extended_capabilities_b4 = -1;
4040 static int hf_ieee80211_tag_extended_capabilities_b5 = -1;
4041 static int hf_ieee80211_tag_extended_capabilities_b6 = -1;
4042 static int hf_ieee80211_tag_extended_capabilities_b7 = -1;
4043 static int hf_ieee80211_tag_extended_capabilities_b8 = -1;
4044 static int hf_ieee80211_tag_extended_capabilities_b9 = -1;
4045 static int hf_ieee80211_tag_extended_capabilities_b10 = -1;
4046 static int hf_ieee80211_tag_extended_capabilities_b11 = -1;
4047 static int hf_ieee80211_tag_extended_capabilities_b12 = -1;
4048 static int hf_ieee80211_tag_extended_capabilities_b13 = -1;
4049 static int hf_ieee80211_tag_extended_capabilities_b14 = -1;
4050 static int hf_ieee80211_tag_extended_capabilities_b15 = -1;
4051 static int hf_ieee80211_tag_extended_capabilities_b16 = -1;
4052 static int hf_ieee80211_tag_extended_capabilities_b17 = -1;
4053 static int hf_ieee80211_tag_extended_capabilities_b18 = -1;
4054 static int hf_ieee80211_tag_extended_capabilities_b19 = -1;
4055 static int hf_ieee80211_tag_extended_capabilities_b20 = -1;
4056 static int hf_ieee80211_tag_extended_capabilities_b21 = -1;
4057 static int hf_ieee80211_tag_extended_capabilities_b22 = -1;
4058 static int hf_ieee80211_tag_extended_capabilities_b23 = -1;
4059 static int hf_ieee80211_tag_extended_capabilities_b24 = -1;
4060 static int hf_ieee80211_tag_extended_capabilities_b25 = -1;
4061 static int hf_ieee80211_tag_extended_capabilities_b26 = -1;
4062 static int hf_ieee80211_tag_extended_capabilities_b27 = -1;
4063 static int hf_ieee80211_tag_extended_capabilities_b28 = -1;
4064 static int hf_ieee80211_tag_extended_capabilities_b29 = -1;
4065 static int hf_ieee80211_tag_extended_capabilities_b30 = -1;
4066 static int hf_ieee80211_tag_extended_capabilities_b31 = -1;
4067 static int hf_ieee80211_tag_extended_capabilities_b32 = -1;
4068 static int hf_ieee80211_tag_extended_capabilities_b33 = -1;
4069 static int hf_ieee80211_tag_extended_capabilities_b34 = -1;
4070 static int hf_ieee80211_tag_extended_capabilities_b35 = -1;
4071 static int hf_ieee80211_tag_extended_capabilities_b36 = -1;
4072 static int hf_ieee80211_tag_extended_capabilities_b37 = -1;
4073 static int hf_ieee80211_tag_extended_capabilities_b38 = -1;
4074 static int hf_ieee80211_tag_extended_capabilities_b39 = -1;
4075 static int hf_ieee80211_tag_extended_capabilities_b40 = -1;
4076 static int hf_ieee80211_tag_extended_capabilities_serv_int_granularity = -1;
4077 static int hf_ieee80211_tag_extended_capabilities_b44 = -1;
4078 static int hf_ieee80211_tag_extended_capabilities_b45 = -1;
4079 static int hf_ieee80211_tag_extended_capabilities_b46 = -1;
4080 static int hf_ieee80211_tag_extended_capabilities_b47 = -1;
4081 static int hf_ieee80211_tag_extended_capabilities_b48 = -1;
4082 static int hf_ieee80211_tag_extended_capabilities_b49 = -1;
4083 static int hf_ieee80211_tag_extended_capabilities_b50 = -1;
4084 static int hf_ieee80211_tag_extended_capabilities_b51 = -1;
4085 static int hf_ieee80211_tag_extended_capabilities_b52 = -1;
4086 static int hf_ieee80211_tag_extended_capabilities_b53 = -1;
4087 static int hf_ieee80211_tag_extended_capabilities_b54 = -1;
4088 static int hf_ieee80211_tag_extended_capabilities_b55 = -1;
4089 static int hf_ieee80211_tag_extended_capabilities_b56 = -1;
4090 static int hf_ieee80211_tag_extended_capabilities_b57 = -1;
4091 static int hf_ieee80211_tag_extended_capabilities_b58 = -1;
4092 static int hf_ieee80211_tag_extended_capabilities_b59 = -1;
4093 static int hf_ieee80211_tag_extended_capabilities_b60 = -1;
4094 static int hf_ieee80211_tag_extended_capabilities_b61 = -1;
4095 static int hf_ieee80211_tag_extended_capabilities_b62 = -1;
4096 static int hf_ieee80211_tag_extended_capabilities_b63 = -1;
4097 /* Used for the two-byte ext-cap field when present */
4098 static int hf_ieee80211_tag_extended_capabilities_2 = -1;
4099 static int hf_ieee80211_tag_extended_capabilities_b56_2 = -1;
4100 static int hf_ieee80211_tag_extended_capabilities_b57_2 = -1;
4101 static int hf_ieee80211_tag_extended_capabilities_b58_2 = -1;
4102 static int hf_ieee80211_tag_extended_capabilities_b59_2 = -1;
4103 static int hf_ieee80211_tag_extended_capabilities_b60_2 = -1;
4104 static int hf_ieee80211_tag_extended_capabilities_b61_2 = -1;
4105 static int hf_ieee80211_tag_extended_capabilities_b62_2 = -1;
4106 static int hf_ieee80211_tag_extended_capabilities_max_num_msdus = -1;
4107 static int hf_ieee80211_tag_extended_capabilities_b65_2 = -1;
4108 static int hf_ieee80211_tag_extended_capabilities_b66_2 = -1;
4109 static int hf_ieee80211_tag_extended_capabilities_b67_2 = -1;
4110 static int hf_ieee80211_tag_extended_capabilities_b68_2 = -1;
4111 static int hf_ieee80211_tag_extended_capabilities_b69_2 = -1;
4112 static int hf_ieee80211_tag_extended_capabilities_b70_2 = -1;
4113 static int hf_ieee80211_tag_extended_capabilities_b71_2 = -1;
4114
4115 static int hf_ieee80211_tag_extended_capabilities_b72 = -1;
4116 static int hf_ieee80211_tag_extended_capabilities_b73 = -1;
4117 static int hf_ieee80211_tag_extended_capabilities_b74 = -1;
4118 static int hf_ieee80211_tag_extended_capabilities_b75 = -1;
4119 static int hf_ieee80211_tag_extended_capabilities_b76 = -1;
4120 static int hf_ieee80211_tag_extended_capabilities_b77 = -1;
4121 static int hf_ieee80211_tag_extended_capabilities_b78 = -1;
4122 static int hf_ieee80211_tag_extended_capabilities_b79 = -1;
4123
4124 static int hf_ieee80211_tag_cisco_ccx1_unknown = -1;
4125 static int hf_ieee80211_tag_cisco_ccx1_name = -1;
4126 static int hf_ieee80211_tag_cisco_ccx1_clients = -1;
4127 static int hf_ieee80211_tag_cisco_ccx1_unknown2 = -1;
4128
4129 static int hf_ieee80211_vht_cap = -1;
4130 static int hf_ieee80211_vht_max_mpdu_length = -1;
4131 static int hf_ieee80211_vht_supported_chan_width_set = -1;
4132 static int hf_ieee80211_vht_rx_ldpc = -1;
4133 static int hf_ieee80211_vht_short_gi_for_80 = -1;
4134 static int hf_ieee80211_vht_short_gi_for_160 = -1;
4135 static int hf_ieee80211_vht_tx_stbc = -1;
4136 static int hf_ieee80211_vht_rx_stbc = -1;
4137 static int hf_ieee80211_vht_su_beamformer_cap = -1;
4138 static int hf_ieee80211_vht_su_beamformee_cap = -1;
4139 static int hf_ieee80211_vht_beamformer_antennas = -1;
4140 static int hf_ieee80211_vht_sounding_dimensions = -1;
4141 static int hf_ieee80211_vht_mu_beamformer_cap = -1;
4142 static int hf_ieee80211_vht_mu_beamformee_cap = -1;
4143 static int hf_ieee80211_vht_txop_ps = -1;
4144 static int hf_ieee80211_vht_var_htc_field = -1;
4145 static int hf_ieee80211_vht_max_ampdu = -1;
4146 static int hf_ieee80211_vht_link_adaptation_cap = -1;
4147 static int hf_ieee80211_vht_rx_pattern = -1;
4148 static int hf_ieee80211_vht_tx_pattern = -1;
4149 static int hf_ieee80211_vht_ext_nss_bw_support = -1;
4150
4151 static int hf_ieee80211_vht_mcsset = -1;
4152
4153 static int hf_ieee80211_vht_mcsset_rx_mcs_map = -1;
4154 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss = -1;
4155 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss = -1;
4156 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss = -1;
4157 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss = -1;
4158 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss = -1;
4159 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss = -1;
4160 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss = -1;
4161 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss = -1;
4162
4163 static int hf_ieee80211_vht_mcsset_max_nsts_total = -1;
4164 static int hf_ieee80211_vht_mcsset_ext_nss_bw_cap = -1;
4165 static int hf_ieee80211_vht_mcsset_reserved = -1;
4166
4167 static int hf_ieee80211_vht_mcsset_rx_highest_long_gi = -1;
4168
4169 static int hf_ieee80211_vht_mcsset_tx_mcs_map = -1;
4170 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss = -1;
4171 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss = -1;
4172 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss = -1;
4173 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss = -1;
4174 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss = -1;
4175 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss = -1;
4176 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss = -1;
4177 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss = -1;
4178
4179 static int hf_ieee80211_vht_op = -1;
4180 static int hf_ieee80211_vht_op_channel_width = -1;
4181 static int hf_ieee80211_vht_op_channel_center0 = -1;
4182 static int hf_ieee80211_vht_op_channel_center1 = -1;
4183
4184 static int hf_ieee80211_vht_op_basic_mcs_map = -1;
4185 static int hf_ieee80211_vht_op_max_basic_mcs_for_1_ss = -1;
4186 static int hf_ieee80211_vht_op_max_basic_mcs_for_2_ss = -1;
4187 static int hf_ieee80211_vht_op_max_basic_mcs_for_3_ss = -1;
4188 static int hf_ieee80211_vht_op_max_basic_mcs_for_4_ss = -1;
4189 static int hf_ieee80211_vht_op_max_basic_mcs_for_5_ss = -1;
4190 static int hf_ieee80211_vht_op_max_basic_mcs_for_6_ss = -1;
4191 static int hf_ieee80211_vht_op_max_basic_mcs_for_7_ss = -1;
4192 static int hf_ieee80211_vht_op_max_basic_mcs_for_8_ss = -1;
4193 static int hf_ieee80211_vht_mcsset_tx_highest_long_gi = -1;
4194
4195 static int hf_ieee80211_vht_tpe_pwr_info = -1;
4196 static int hf_ieee80211_vht_tpe_pwr_info_count = -1;
4197 static int hf_ieee80211_vht_tpe_pwr_info_unit = -1;
4198 static int hf_ieee80211_vht_tpe_pwr_info_reserved = -1;
4199 static int hf_ieee80211_vht_tpe_pwr_constr_20 = -1;
4200 static int hf_ieee80211_vht_tpe_pwr_constr_40 = -1;
4201 static int hf_ieee80211_vht_tpe_pwr_constr_80 = -1;
4202 static int hf_ieee80211_vht_tpe_pwr_constr_160 = -1;
4203
4204 static int hf_ieee80211_beamform_feedback_seg_retrans_bitmap = -1;
4205
4206 static int hf_ieee80211_vht_ndp_annc_token = -1;
4207 static int hf_ieee80211_vht_ndp_annc_token_number = -1;
4208 static int hf_ieee80211_vht_ndp_annc_he_subfield = -1;
4209 static int hf_ieee80211_vht_ndp_annc_token_reserved = -1;
4210 static int hf_ieee80211_vht_ndp_annc_sta_info_aid12 = -1;
4211 static int hf_ieee80211_vht_ndp_annc_sta_info_feedback_type = -1;
4212 static int hf_ieee80211_vht_ndp_annc_sta_info_nc_index = -1;
4213 static int hf_ieee80211_vht_ndp_annc_sta_info_reserved = -1;
4214
4215
4216 static int hf_ieee80211_ff_vht_action = -1;
4217 static int hf_ieee80211_ff_vht_mimo_cntrl = -1;
4218 static int hf_ieee80211_ff_vht_mimo_cntrl_nc_index = -1;
4219 static int hf_ieee80211_ff_vht_mimo_cntrl_nr_index = -1;
4220 static int hf_ieee80211_ff_vht_mimo_cntrl_channel_width = -1;
4221 static int hf_ieee80211_ff_vht_mimo_cntrl_grouping = -1;
4222 static int hf_ieee80211_ff_vht_mimo_cntrl_codebook_info = -1;
4223 static int hf_ieee80211_ff_vht_mimo_cntrl_feedback_type = -1;
4224 static int hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg = -1;
4225 static int hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg = -1;
4226 static int hf_ieee80211_ff_vht_mimo_cntrl_reserved = -1;
4227 static int hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number = -1;
4228
4229 static const int *hf_ieee80211_ff_vht_mimo_cntrl_fields[] = {
4230   &hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
4231   &hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
4232   &hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
4233   &hf_ieee80211_ff_vht_mimo_cntrl_grouping,
4234   &hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
4235   &hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
4236   &hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
4237   &hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
4238   &hf_ieee80211_ff_vht_mimo_cntrl_reserved,
4239   &hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
4240   NULL,
4241 };
4242
4243 static int hf_ieee80211_vht_compressed_beamforming_report = -1;
4244 static int hf_ieee80211_vht_compressed_beamforming_report_snr = -1;
4245 static int hf_ieee80211_vht_compressed_beamforming_feedback_matrix = -1;
4246 static int hf_ieee80211_vht_group_id_management = -1;
4247 static int hf_ieee80211_vht_membership_status_array = -1;
4248 static int hf_ieee80211_vht_user_position_array = -1;
4249 static int hf_ieee80211_vht_operation_mode_notification = -1;
4250 static int hf_ieee80211_vht_membership_status_field = -1;
4251 static int hf_ieee80211_vht_user_position_field = -1;
4252 static int hf_ieee80211_vht_mu_exclusive_beamforming_report = -1;
4253 static int hf_ieee80211_vht_mu_Exclusive_beamforming_delta_snr = -1;
4254 static int hf_ieee80211_vht_compressed_beamforming_phi_angle = -1;
4255 static int hf_ieee80211_vht_compressed_beamforming_psi_angle = -1;
4256
4257 static int hf_ieee80211_ff_he_action = -1;
4258 static int hf_he_mimo_control_nc_index = -1;
4259 static int hf_he_mimo_control_nr_index = -1;
4260 static int hf_he_mimo_control_bw = -1;
4261 static int hf_he_mimo_control_grouping = -1;
4262 static int hf_he_mimo_control_codebook_info = -1;
4263 static int hf_he_mimo_control_feedback_type = -1;
4264 static int hf_he_mimo_control_remaining_feedback_segs = -1;
4265 static int hf_he_mimo_control_first_feedback_seg = -1;
4266 static int hf_he_mimo_control_ru_start_index = -1;
4267 static int hf_he_mimo_control_ru_end_index = -1;
4268 static int hf_he_mimo_control_sounding_dialog_token_num = -1;
4269 static int hf_he_mimo_control_reserved = -1;
4270 static int hf_ieee80211_he_mimo_control_field = -1;
4271
4272 static int hf_ieee80211_tag_neighbor_report_bssid = -1;
4273 static int hf_ieee80211_tag_neighbor_report_bssid_info = -1;
4274 static int hf_ieee80211_tag_neighbor_report_bssid_info_reachability = -1;
4275 static int hf_ieee80211_tag_neighbor_report_bssid_info_security = -1;
4276 static int hf_ieee80211_tag_neighbor_report_bssid_info_key_scope = -1;
4277 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability = -1;
4278 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng = -1;
4279 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos = -1;
4280 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd = -1;
4281 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt = -1;
4282 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback = -1;
4283 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback = -1;
4284 static int hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain = -1;
4285 static int hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput = -1;
4286 static int hf_ieee80211_tag_neighbor_report_bssid_info_very_high_throughput = -1;
4287 static int hf_ieee80211_tag_neighbor_report_bssid_info_ftm = -1;
4288 static int hf_ieee80211_tag_neighbor_report_bssid_info_high_efficiency = -1;
4289 static int hf_ieee80211_tag_neighbor_report_bssid_info_er_bss = -1;
4290 static int hf_ieee80211_tag_neighbor_report_bssid_info_reserved = -1;
4291 static int hf_ieee80211_tag_neighbor_report_ope_class = -1;
4292 static int hf_ieee80211_tag_neighbor_report_channel_number = -1;
4293 static int hf_ieee80211_tag_neighbor_report_phy_type = -1;
4294 static int hf_ieee80211_tag_neighbor_report_subelement_id = -1;
4295 static int hf_ieee80211_tag_neighbor_report_subelement_length = -1;
4296 static int hf_ieee80211_tag_neighbor_report_subelement_data = -1;
4297 static int hf_ieee80211_tag_neighbor_report_subelement_bss_trn_can_pref = -1;
4298 static int hf_ieee80211_tag_neighbor_report_subelement_bss_ter_tsf = -1;
4299 static int hf_ieee80211_tag_neighbor_report_subelement_bss_dur = -1;
4300 static int hf_ieee80211_tag_supported_ope_classes_current = -1;
4301 static int hf_ieee80211_tag_supported_ope_classes_alternate = -1;
4302
4303 /* IEEE Std 802.11r-2008 7.3.2.47 */
4304 static int hf_ieee80211_tag_mobility_domain_mdid = -1;
4305 static int hf_ieee80211_tag_mobility_domain_ft_capab = -1;
4306 static int hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds = -1;
4307 static int hf_ieee80211_tag_mobility_domain_ft_capab_resource_req = -1;
4308
4309 /* IEEE Std 802.11r-2008 7.3.2.48 */
4310 static int hf_ieee80211_tag_ft_mic_control = -1;
4311 static int hf_ieee80211_tag_ft_element_count = -1;
4312 static int hf_ieee80211_tag_ft_mic = -1;
4313 static int hf_ieee80211_tag_ft_anonce = -1;
4314 static int hf_ieee80211_tag_ft_snonce = -1;
4315 static int hf_ieee80211_tag_ft_subelem_id = -1;
4316 static int hf_ieee80211_tag_ft_subelem_len = -1;
4317 static int hf_ieee80211_tag_ft_subelem_data = -1;
4318 static int hf_ieee80211_tag_ft_subelem_r1kh_id = -1;
4319 static int hf_ieee80211_tag_ft_subelem_gtk_key_info = -1;
4320 static int hf_ieee80211_tag_ft_subelem_gtk_key_id = -1;
4321 static int hf_ieee80211_tag_ft_subelem_gtk_key_length = -1;
4322 static int hf_ieee80211_tag_ft_subelem_gtk_rsc = -1;
4323 static int hf_ieee80211_tag_ft_subelem_gtk_key = -1;
4324 static int hf_ieee80211_tag_ft_subelem_r0kh_id = -1;
4325 static int hf_ieee80211_tag_ft_subelem_igtk_key_id = -1;
4326 static int hf_ieee80211_tag_ft_subelem_igtk_ipn = -1;
4327 static int hf_ieee80211_tag_ft_subelem_igtk_key_length = -1;
4328 static int hf_ieee80211_tag_ft_subelem_igtk_key = -1;
4329
4330 /* IEEE Std 802.11-2012: 11r 8.4.2.52 */
4331 static int hf_ieee80211_tag_ric_data_id = -1;
4332 static int hf_ieee80211_tag_ric_data_desc_cnt = -1;
4333 static int hf_ieee80211_tag_ric_data_status_code = -1;
4334
4335 /* IEEE Std 802.11-2012: 11r 8.4.2.53 */
4336 static int hf_ieee80211_tag_ric_desc_rsrc_type = -1;
4337 static int hf_ieee80211_tag_ric_desc_var_params = -1;
4338
4339 /* IEEE Std 802.11w-2009 7.3.2.55 */
4340 static int hf_ieee80211_tag_mmie_keyid = -1;
4341 static int hf_ieee80211_tag_mmie_ipn = -1;
4342 static int hf_ieee80211_tag_mmie_mic = -1;
4343
4344 /* IEEE Std 802.11-2012: 8.4.2.61 */
4345 static int hf_ieee80211_tag_obss_spd = -1;
4346 static int hf_ieee80211_tag_obss_sad = -1;
4347 static int hf_ieee80211_tag_obss_cwtsi = -1;
4348 static int hf_ieee80211_tag_obss_sptpc = -1;
4349 static int hf_ieee80211_tag_obss_satpc = -1;
4350 static int hf_ieee80211_tag_obss_wctdf = -1;
4351 static int hf_ieee80211_tag_obss_sat = -1;
4352
4353 /* IEEE Std 802.11-2012: 8.4.2.25.1 */
4354 static int hf_group_data_cipher_suite_oui = -1;
4355 static int hf_group_data_cipher_suite_type = -1;
4356 static int hf_osen_pairwise_cipher_suite_oui = -1;
4357 static int hf_osen_pairwise_cipher_suite_type = -1;
4358 static int hf_osen_pcs_count = -1;
4359 static int hf_osen_akm_count = -1;
4360 static int hf_osen_akm_cipher_suite_oui = -1;
4361 static int hf_osen_akm_cipher_suite_type = -1;
4362 static int hf_osen_rsn_cap_preauth = -1;
4363 static int hf_osen_rsn_cap_no_pairwise = -1;
4364 static int hf_osen_rsn_cap_ptksa_replay_counter = -1;
4365 static int hf_osen_rsn_cap_gtksa_replay_counter = -1;
4366 static int hf_osen_rsn_cap_mfpr = -1;
4367 static int hf_osen_rsn_cap_mfpc = -1;
4368 static int hf_osen_rsn_cap_jmr = -1;
4369 static int hf_osen_rsn_cap_peerkey = -1;
4370 static int hf_osen_rsn_spp_a_msdu_capable = -1;
4371 static int hf_osen_rsn_spp_a_msdu_required = -1;
4372 static int hf_osen_rsn_pbac = -1;
4373 static int hf_osen_extended_key_id_iaf = -1;
4374 static int hf_osen_reserved = -1;
4375 static int hf_osen_rsn_cap_flags = -1;
4376 static int hf_osen_pmkid_count = -1;
4377 static int hf_osen_pmkid = -1;
4378 static int hf_osen_group_management_cipher_suite_oui = -1;
4379 static int hf_osen_group_management_cipher_suite_type = -1;
4380
4381 /*WAPI-Specification 7.3.2.25 : WAPI Parameter Set*/
4382 static int hf_ieee80211_tag_wapi_param_set_version = -1;
4383
4384 static int hf_ieee80211_tag_wapi_param_set_akm_suite_count = -1;
4385 static int hf_ieee80211_tag_wapi_param_set_akm_suite_oui = -1;
4386 static int hf_ieee80211_tag_wapi_param_set_akm_suite_type = -1;
4387
4388 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count = -1;
4389 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui = -1;
4390 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type = -1;
4391
4392 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui = -1;
4393 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type = -1;
4394
4395 static int hf_ieee80211_tag_wapi_param_set_capab = -1;
4396 static int hf_ieee80211_tag_wapi_param_set_capab_preauth = -1;
4397 static int hf_ieee80211_tag_wapi_param_set_capab_rsvd = -1;
4398 static int hf_ieee80211_tag_wapi_param_set_bkid_count = -1;
4399 static int hf_ieee80211_tag_wapi_param_set_bkid_list = -1;
4400
4401 /* IEEE Std 802.11v-2011 7.3.2.61 */
4402 static int hf_ieee80211_tag_time_adv_timing_capab = -1;
4403 static int hf_ieee80211_tag_time_adv_time_value = -1;
4404 static int hf_ieee80211_tag_time_adv_time_value_year = -1;
4405 static int hf_ieee80211_tag_time_adv_time_value_month = -1;
4406 static int hf_ieee80211_tag_time_adv_time_value_day = -1;
4407 static int hf_ieee80211_tag_time_adv_time_value_hours = -1;
4408 static int hf_ieee80211_tag_time_adv_time_value_minutes = -1;
4409 static int hf_ieee80211_tag_time_adv_time_value_seconds = -1;
4410 static int hf_ieee80211_tag_time_adv_time_value_milliseconds = -1;
4411 static int hf_ieee80211_tag_time_adv_time_value_reserved = -1;
4412 static int hf_ieee80211_tag_time_adv_time_error = -1;
4413 static int hf_ieee80211_tag_time_adv_time_update_counter = -1;
4414
4415 /* IEEE Std 802.11-2012 8.4.2.81 */
4416 static int hf_ieee80211_tag_bss_max_idle_period = -1;
4417 static int hf_ieee80211_tag_bss_max_idle_options_protected = -1;
4418
4419 /* IEEE Std 802.11-2012 8.4.2.82 */
4420 static int hf_ieee80211_tag_tfs_request_id = -1;
4421 static int hf_ieee80211_tag_tfs_request_ac_delete_after_match = -1;
4422 static int hf_ieee80211_tag_tfs_request_ac_notify = -1;
4423 static int hf_ieee80211_tag_tfs_request_subelem_id = -1;
4424 static int hf_ieee80211_tag_tfs_request_subelem_len = -1;
4425 static int hf_ieee80211_tag_tfs_request_subelem = -1;
4426
4427 /* IEEE Std 802.11-2012 8.4.2.83 */
4428 static int hf_ieee80211_tag_tfs_response_subelem_id = -1;
4429 static int hf_ieee80211_tag_tfs_response_subelem_len = -1;
4430 static int hf_ieee80211_tag_tfs_response_subelem = -1;
4431 static int hf_ieee80211_tag_tfs_response_status = -1;
4432 static int hf_ieee80211_tag_tfs_response_id = -1;
4433
4434 /* IEEE Std 802.11-2012 8.4.2.84 */
4435 static int hf_ieee80211_tag_wnm_sleep_mode_action_type = -1;
4436 static int hf_ieee80211_tag_wnm_sleep_mode_response_status = -1;
4437 static int hf_ieee80211_tag_wnm_sleep_mode_interval = -1;
4438
4439 static int hf_ieee80211_wnm_sub_elt_id = -1;
4440 static int hf_ieee80211_wnm_sub_elt_len = -1;
4441
4442 /* IEEE Std 802.11v-2011 7.3.2.87 */
4443 static int hf_ieee80211_tag_time_zone = -1;
4444
4445 /* IEEE Std 802.11u-2011 7.3.2.92 */
4446 static int hf_ieee80211_tag_interworking_access_network_type = -1;
4447 static int hf_ieee80211_tag_interworking_internet = -1;
4448 static int hf_ieee80211_tag_interworking_asra = -1;
4449 static int hf_ieee80211_tag_interworking_esr = -1;
4450 static int hf_ieee80211_tag_interworking_uesa = -1;
4451 static int hf_ieee80211_tag_interworking_hessid = -1;
4452
4453 /* IEEE Std 802.11-2012, 8.4.2.97 */
4454 static int hf_ieee80211_tag_qos_map_set_dscp_exc = -1;
4455 static int hf_ieee80211_tag_qos_map_set_dscp_exc_val = -1;
4456 static int hf_ieee80211_tag_qos_map_set_dscp_exc_up = -1;
4457 static int hf_ieee80211_tag_qos_map_set_range = -1;
4458 static int hf_ieee80211_tag_qos_map_set_low = -1;
4459 static int hf_ieee80211_tag_qos_map_set_high = -1;
4460
4461 /* IEEE Std 802.11u-2011 7.3.2.93 */
4462 static int hf_ieee80211_tag_adv_proto_resp_len_limit = -1;
4463 static int hf_ieee80211_tag_adv_proto_pame_bi = -1;
4464 static int hf_ieee80211_tag_adv_proto_id = -1;
4465 static int hf_ieee80211_tag_adv_vs_len = -1;
4466 /* static int hf_ieee80211_tag_adv_proto_vs_info = -1; */
4467
4468 /* IEEE Std 802.11u-2011 7.3.2.96 */
4469 static int hf_ieee80211_tag_roaming_consortium_num_anqp_oi = -1;
4470 static int hf_ieee80211_tag_roaming_consortium_oi1_len = -1;
4471 static int hf_ieee80211_tag_roaming_consortium_oi2_len = -1;
4472 static int hf_ieee80211_tag_roaming_consortium_oi1 = -1;
4473 static int hf_ieee80211_tag_roaming_consortium_oi2 = -1;
4474 static int hf_ieee80211_tag_roaming_consortium_oi3 = -1;
4475
4476 /* 802.11n 7.3.2.48 */
4477 static int hf_ieee80211_hta_cc = -1;
4478 static int hf_ieee80211_hta_cap1 = -1;
4479 static int hf_ieee80211_hta_cap2 = -1;
4480 static int hf_ieee80211_hta_ext_chan_offset = -1;
4481 static int hf_ieee80211_hta_rec_tx_width = -1;
4482 static int hf_ieee80211_hta_rifs_mode = -1;
4483 static int hf_ieee80211_hta_controlled_access = -1;
4484 static int hf_ieee80211_hta_service_interval = -1;
4485 static int hf_ieee80211_hta_operating_mode = -1;
4486 static int hf_ieee80211_hta_non_gf_devices = -1;
4487 static int hf_ieee80211_hta_basic_stbc_mcs = -1;
4488 static int hf_ieee80211_hta_dual_stbc_protection = -1;
4489 static int hf_ieee80211_hta_secondary_beacon = -1;
4490 static int hf_ieee80211_hta_lsig_txop_protection = -1;
4491 static int hf_ieee80211_hta_pco_active = -1;
4492 static int hf_ieee80211_hta_pco_phase = -1;
4493
4494 static int hf_ieee80211_antsel = -1;
4495 static int hf_ieee80211_antsel_vs = -1;
4496 static int hf_ieee80211_antsel_b0 = -1;
4497 static int hf_ieee80211_antsel_b1 = -1;
4498 static int hf_ieee80211_antsel_b2 = -1;
4499 static int hf_ieee80211_antsel_b3 = -1;
4500 static int hf_ieee80211_antsel_b4 = -1;
4501 static int hf_ieee80211_antsel_b5 = -1;
4502 static int hf_ieee80211_antsel_b6 = -1;
4503 static int hf_ieee80211_antsel_b7 = -1;
4504
4505 static int hf_ieee80211_rsn_version = -1;
4506 static int hf_ieee80211_rsn_gcs = -1;
4507 static int hf_ieee80211_rsn_gcs_oui = -1;
4508 static int hf_ieee80211_rsn_gcs_type = -1;
4509 static int hf_ieee80211_rsn_gcs_80211_type = -1;
4510 static int hf_ieee80211_rsn_pcs_count = -1;
4511 static int hf_ieee80211_rsn_pcs_list = -1;
4512 static int hf_ieee80211_rsn_pcs = -1;
4513 static int hf_ieee80211_rsn_pcs_oui = -1;
4514 static int hf_ieee80211_rsn_pcs_80211_type = -1;
4515 static int hf_ieee80211_rsn_pcs_type = -1;
4516 static int hf_ieee80211_rsn_akms_count = -1;
4517 static int hf_ieee80211_rsn_akms_list = -1;
4518 static int hf_ieee80211_rsn_akms = -1;
4519 static int hf_ieee80211_rsn_akms_oui = -1;
4520 static int hf_ieee80211_rsn_akms_80211_type = -1;
4521 static int hf_ieee80211_rsn_akms_type = -1;
4522 static int hf_ieee80211_rsn_cap = -1;
4523 static int hf_ieee80211_rsn_cap_preauth = -1;
4524 static int hf_ieee80211_rsn_cap_no_pairwise = -1;
4525 static int hf_ieee80211_rsn_cap_ptksa_replay_counter = -1;
4526 static int hf_ieee80211_rsn_cap_gtksa_replay_counter = -1;
4527 static int hf_ieee80211_rsn_cap_mfpr = -1;
4528 static int hf_ieee80211_rsn_cap_mfpc = -1;
4529 static int hf_ieee80211_rsn_cap_jmr = -1;
4530 static int hf_ieee80211_rsn_cap_peerkey = -1;
4531 static int hf_ieee80211_rsn_pmkid_count = -1;
4532 static int hf_ieee80211_rsn_pmkid_list = -1;
4533 static int hf_ieee80211_rsn_pmkid = -1;
4534 static int hf_ieee80211_rsn_gmcs = -1;
4535 static int hf_ieee80211_rsn_gmcs_oui = -1;
4536 static int hf_ieee80211_rsn_gmcs_type = -1;
4537 static int hf_ieee80211_rsn_gmcs_80211_type = -1;
4538
4539 static int hf_ieee80211_wfa_ie_type = -1;
4540 static int hf_ieee80211_wfa_ie_wpa_version = -1;
4541 static int hf_ieee80211_wfa_ie_wpa_mcs = -1;
4542 static int hf_ieee80211_wfa_ie_wpa_mcs_oui = -1;
4543 static int hf_ieee80211_wfa_ie_wpa_mcs_type = -1;
4544 static int hf_ieee80211_wfa_ie_wpa_mcs_wfa_type = -1;
4545 static int hf_ieee80211_wfa_ie_wpa_ucs_count = -1;
4546 static int hf_ieee80211_wfa_ie_wpa_ucs_list = -1;
4547 static int hf_ieee80211_wfa_ie_wpa_ucs = -1;
4548 static int hf_ieee80211_wfa_ie_wpa_ucs_oui = -1;
4549 static int hf_ieee80211_wfa_ie_wpa_ucs_wfa_type = -1;
4550 static int hf_ieee80211_wfa_ie_wpa_ucs_type = -1;
4551 static int hf_ieee80211_wfa_ie_wpa_akms_count = -1;
4552 static int hf_ieee80211_wfa_ie_wpa_akms_list = -1;
4553 static int hf_ieee80211_wfa_ie_wpa_akms = -1;
4554 static int hf_ieee80211_wfa_ie_wpa_akms_oui = -1;
4555 static int hf_ieee80211_wfa_ie_wpa_akms_wfa_type = -1;
4556 static int hf_ieee80211_wfa_ie_wpa_akms_type = -1;
4557 static int hf_ieee80211_wfa_ie_wme_subtype = -1;
4558 static int hf_ieee80211_wfa_ie_wme_version = -1;
4559 static int hf_ieee80211_wfa_ie_wme_qos_info = -1;
4560 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length = -1;
4561 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be = -1;
4562 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk = -1;
4563 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi = -1;
4564 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo = -1;
4565 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved = -1;
4566 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd = -1;
4567 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count = -1;
4568 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved = -1;
4569 static int hf_ieee80211_wfa_ie_wme_reserved = -1;
4570 static int hf_ieee80211_wfa_ie_wme_ac_parameters = -1;
4571 static int hf_ieee80211_wfa_ie_wme_acp_aci_aifsn = -1;
4572 static int hf_ieee80211_wfa_ie_wme_acp_aci = -1;
4573 static int hf_ieee80211_wfa_ie_wme_acp_acm = -1;
4574 static int hf_ieee80211_wfa_ie_wme_acp_aifsn = -1;
4575 static int hf_ieee80211_wfa_ie_wme_acp_reserved = -1;
4576 static int hf_ieee80211_wfa_ie_wme_acp_ecw = -1;
4577 static int hf_ieee80211_wfa_ie_wme_acp_ecw_max = -1;
4578 static int hf_ieee80211_wfa_ie_wme_acp_ecw_min = -1;
4579 static int hf_ieee80211_wfa_ie_wme_acp_cw_max = -1;
4580 static int hf_ieee80211_wfa_ie_wme_acp_cw_min = -1;
4581 static int hf_ieee80211_wfa_ie_wme_acp_txop_limit = -1;
4582 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo = -1;
4583 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid = -1;
4584 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction = -1;
4585 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb = -1;
4586 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up = -1;
4587 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved = -1;
4588 static int hf_ieee80211_wfa_ie_wme_tspec_nor_msdu = -1;
4589 static int hf_ieee80211_wfa_ie_wme_tspec_max_msdu = -1;
4590 static int hf_ieee80211_wfa_ie_wme_tspec_min_srv = -1;
4591 static int hf_ieee80211_wfa_ie_wme_tspec_max_srv = -1;
4592 static int hf_ieee80211_wfa_ie_wme_tspec_inact_int = -1;
4593 static int hf_ieee80211_wfa_ie_wme_tspec_susp_int = -1;
4594 static int hf_ieee80211_wfa_ie_wme_tspec_srv_start = -1;
4595 static int hf_ieee80211_wfa_ie_wme_tspec_min_data = -1;
4596 static int hf_ieee80211_wfa_ie_wme_tspec_mean_data = -1;
4597 static int hf_ieee80211_wfa_ie_wme_tspec_peak_data = -1;
4598 static int hf_ieee80211_wfa_ie_wme_tspec_burst_size = -1;
4599 static int hf_ieee80211_wfa_ie_wme_tspec_delay_bound = -1;
4600 static int hf_ieee80211_wfa_ie_wme_tspec_min_phy = -1;
4601 static int hf_ieee80211_wfa_ie_wme_tspec_surplus = -1;
4602 static int hf_ieee80211_wfa_ie_wme_tspec_medium = -1;
4603
4604 static int hf_ieee80211_aironet_ie_type = -1;
4605 static int hf_ieee80211_aironet_ie_dtpc = -1;
4606 static int hf_ieee80211_aironet_ie_dtpc_unknown = -1;
4607 static int hf_ieee80211_aironet_ie_version = -1;
4608 static int hf_ieee80211_aironet_ie_data = -1;
4609 static int hf_ieee80211_aironet_ie_qos_reserved = -1;
4610 static int hf_ieee80211_aironet_ie_qos_paramset = -1;
4611 static int hf_ieee80211_aironet_ie_qos_val = -1;
4612 static int hf_ieee80211_aironet_ie_clientmfp = -1;
4613
4614 static int hf_ieee80211_vs_nintendo_type = -1;
4615 static int hf_ieee80211_vs_nintendo_length = -1;
4616 static int hf_ieee80211_vs_nintendo_servicelist = -1;
4617 static int hf_ieee80211_vs_nintendo_service = -1;
4618 static int hf_ieee80211_vs_nintendo_consoleid = -1;
4619 static int hf_ieee80211_vs_nintendo_unknown = -1;
4620
4621 static int hf_ieee80211_vs_aruba_subtype = -1;
4622 static int hf_ieee80211_vs_aruba_apname = -1;
4623 static int hf_ieee80211_vs_aruba_data = -1;
4624
4625 static int hf_ieee80211_vs_mikrotik_unknown = -1;
4626 static int hf_ieee80211_vs_mikrotik_subitem = -1;
4627 static int hf_ieee80211_vs_mikrotik_subtype = -1;
4628 static int hf_ieee80211_vs_mikrotik_sublength = -1;
4629 static int hf_ieee80211_vs_mikrotik_subdata = -1;
4630
4631 static int hf_ieee80211_vs_meru_subitem = -1;
4632 static int hf_ieee80211_vs_meru_subtype = -1;
4633 static int hf_ieee80211_vs_meru_sublength = -1;
4634 static int hf_ieee80211_vs_meru_subdata = -1;
4635
4636 static int hf_ieee80211_vs_extreme_subtype = -1;
4637 static int hf_ieee80211_vs_extreme_subdata = -1;
4638 static int hf_ieee80211_vs_extreme_unknown = -1;
4639 static int hf_ieee80211_vs_extreme_ap_length = -1;
4640 static int hf_ieee80211_vs_extreme_ap_name = -1;
4641
4642 static int hf_ieee80211_rsn_ie_pmkid = -1;
4643 static int hf_ieee80211_rsn_ie_unknown = -1;
4644
4645 static int hf_ieee80211_marvell_ie_type = -1;
4646 static int hf_ieee80211_marvell_ie_mesh_subtype = -1;
4647 static int hf_ieee80211_marvell_ie_mesh_version = -1;
4648 static int hf_ieee80211_marvell_ie_mesh_active_proto_id = -1;
4649 static int hf_ieee80211_marvell_ie_mesh_active_metric_id = -1;
4650 static int hf_ieee80211_marvell_ie_mesh_cap = -1;
4651 static int hf_ieee80211_marvell_ie_data = -1;
4652
4653 static int hf_ieee80211_atheros_ie_type = -1;
4654 static int hf_ieee80211_atheros_ie_subtype = -1;
4655 static int hf_ieee80211_atheros_ie_version = -1;
4656 static int hf_ieee80211_atheros_ie_cap_f_turbop = -1;
4657 static int hf_ieee80211_atheros_ie_cap_f_comp = -1;
4658 static int hf_ieee80211_atheros_ie_cap_f_ff = -1;
4659 static int hf_ieee80211_atheros_ie_cap_f_xr = -1;
4660 static int hf_ieee80211_atheros_ie_cap_f_ar = -1;
4661 static int hf_ieee80211_atheros_ie_cap_f_burst = -1;
4662 static int hf_ieee80211_atheros_ie_cap_f_wme = -1;
4663 static int hf_ieee80211_atheros_ie_cap_f_boost = -1;
4664 static int hf_ieee80211_atheros_ie_advcap_cap = -1;
4665 static int hf_ieee80211_atheros_ie_advcap_defkey = -1;
4666 static int hf_ieee80211_atheros_ie_xr_info = -1;
4667 static int hf_ieee80211_atheros_ie_xr_base_bssid = -1;
4668 static int hf_ieee80211_atheros_ie_xr_xr_bssid = -1;
4669 static int hf_ieee80211_atheros_ie_xr_xr_beacon = -1;
4670 static int hf_ieee80211_atheros_ie_xr_base_cap = -1;
4671 static int hf_ieee80211_atheros_ie_xr_xr_cap = -1;
4672 static int hf_ieee80211_atheros_ie_data = -1;
4673
4674 /*QBSS - Version 1,2,802.11e*/
4675
4676 static int hf_ieee80211_qbss2_cal = -1;
4677 static int hf_ieee80211_qbss2_gl = -1;
4678 static int hf_ieee80211_qbss_cu = -1;
4679 static int hf_ieee80211_qbss2_cu = -1;
4680 static int hf_ieee80211_qbss_scount = -1;
4681 static int hf_ieee80211_qbss2_scount = -1;
4682 static int hf_ieee80211_qbss_version = -1;
4683 static int hf_ieee80211_qbss_adc = -1;
4684
4685 static int hf_ieee80211_tsinfo = -1;
4686 static int hf_ieee80211_tsinfo_type = -1;
4687 static int hf_ieee80211_tsinfo_tsid = -1;
4688 static int hf_ieee80211_tsinfo_dir = -1;
4689 static int hf_ieee80211_tsinfo_access = -1;
4690 static int hf_ieee80211_tsinfo_agg = -1;
4691 static int hf_ieee80211_tsinfo_apsd = -1;
4692 static int hf_ieee80211_tsinfo_up = -1;
4693 static int hf_ieee80211_tsinfo_ack = -1;
4694 static int hf_ieee80211_tsinfo_sched = -1;
4695 static int hf_ieee80211_tsinfo_rsv = -1;
4696
4697 static const int *ieee80211_tsinfo_fields[] = {
4698   &hf_ieee80211_tsinfo_type,
4699   &hf_ieee80211_tsinfo_tsid,
4700   &hf_ieee80211_tsinfo_dir,
4701   &hf_ieee80211_tsinfo_access,
4702   &hf_ieee80211_tsinfo_agg,
4703   &hf_ieee80211_tsinfo_apsd,
4704   &hf_ieee80211_tsinfo_up,
4705   &hf_ieee80211_tsinfo_ack,
4706   &hf_ieee80211_tsinfo_sched,
4707   &hf_ieee80211_tsinfo_rsv,
4708   NULL
4709 };
4710
4711 static int hf_ieee80211_tspec_nor_msdu = -1;
4712 static int hf_ieee80211_tspec_max_msdu = -1;
4713 static int hf_ieee80211_tspec_min_srv = -1;
4714 static int hf_ieee80211_tspec_max_srv = -1;
4715 static int hf_ieee80211_tspec_inact_int = -1;
4716 static int hf_ieee80211_tspec_susp_int = -1;
4717 static int hf_ieee80211_tspec_srv_start = -1;
4718 static int hf_ieee80211_tspec_min_data = -1;
4719 static int hf_ieee80211_tspec_mean_data = -1;
4720 static int hf_ieee80211_tspec_peak_data = -1;
4721 static int hf_ieee80211_tspec_burst_size = -1;
4722 static int hf_ieee80211_tspec_delay_bound = -1;
4723 static int hf_ieee80211_tspec_min_phy = -1;
4724 static int hf_ieee80211_tspec_surplus = -1;
4725 static int hf_ieee80211_tspec_medium = -1;
4726 static int hf_ieee80211_tspec_dmg = -1;
4727 static int hf_ieee80211_ts_delay = -1;
4728 static int hf_ieee80211_tclas_process = -1;
4729 static int hf_ieee80211_tag_ext_supp_rates = -1;
4730 static int hf_ieee80211_sched_info = -1;
4731 static int hf_ieee80211_sched_info_agg = -1;
4732 static int hf_ieee80211_sched_info_tsid = -1;
4733 static int hf_ieee80211_sched_info_dir = -1;
4734 static int hf_ieee80211_sched_srv_start = -1;
4735 static int hf_ieee80211_sched_srv_int = -1;
4736 static int hf_ieee80211_sched_spec_int = -1;
4737 static int hf_ieee80211_tclas_up = -1;
4738 static int hf_ieee80211_tclas_class_type = -1;
4739 static int hf_ieee80211_tclas_class_mask = -1;
4740 static int hf_ieee80211_tclas_class_mask0_src_addr = -1;
4741 static int hf_ieee80211_tclas_class_mask0_dst_addr = -1;
4742 static int hf_ieee80211_tclas_class_mask0_type = -1;
4743 static int hf_ieee80211_tclas_class_mask1_ver = -1;
4744 static int hf_ieee80211_tclas_class_mask1_src_ip = -1;
4745 static int hf_ieee80211_tclas_class_mask1_dst_ip = -1;
4746 static int hf_ieee80211_tclas_class_mask1_src_port = -1;
4747 static int hf_ieee80211_tclas_class_mask1_dst_port = -1;
4748 static int hf_ieee80211_tclas_class_mask1_ipv4_dscp = -1;
4749 static int hf_ieee80211_tclas_class_mask1_ipv4_proto = -1;
4750 static int hf_ieee80211_tclas_class_mask1_ipv6_flow = -1;
4751 static int hf_ieee80211_tclas_class_mask2_tci = -1;
4752 static int hf_ieee80211_tclas_src_mac_addr = -1;
4753 static int hf_ieee80211_tclas_dst_mac_addr = -1;
4754 static int hf_ieee80211_tclas_ether_type = -1;
4755 static int hf_ieee80211_tclas_version = -1;
4756 static int hf_ieee80211_tclas_ipv4_src = -1;
4757 static int hf_ieee80211_tclas_ipv4_dst = -1;
4758 static int hf_ieee80211_tclas_src_port = -1;
4759 static int hf_ieee80211_tclas_dst_port = -1;
4760 static int hf_ieee80211_tclas_dscp = -1;
4761 static int hf_ieee80211_tclas_protocol = -1;
4762 static int hf_ieee80211_tclas_ipv6_src = -1;
4763 static int hf_ieee80211_tclas_ipv6_dst = -1;
4764 static int hf_ieee80211_tclas_flow = -1;
4765 static int hf_ieee80211_tclas_tag_type = -1;
4766
4767 static int hf_ieee80211_aruba = -1;
4768 static int hf_ieee80211_aruba_hb_seq = -1;
4769 static int hf_ieee80211_aruba_mtu = -1;
4770
4771 static int hf_ieee80211_tag_vendor_oui_type = -1;
4772 static int hf_ieee80211_tag_vendor_data = -1;
4773
4774 /* IEEE Std 802.11z-2010 7.3.2.62 */
4775 static int hf_ieee80211_tag_link_id_bssid = -1;
4776 static int hf_ieee80211_tag_link_id_init_sta = -1;
4777 static int hf_ieee80211_tag_link_id_resp_sta = -1;
4778
4779 /* IEEE Std 802.11z-2010 7.3.2.63 */
4780 static int hf_ieee80211_tag_wakeup_schedule_offset = -1;
4781 static int hf_ieee80211_tag_wakeup_schedule_interval = -1;
4782 static int hf_ieee80211_tag_wakeup_schedule_awake_window_slots = -1;
4783 static int hf_ieee80211_tag_wakeup_schedule_max_awake_dur = -1;
4784 static int hf_ieee80211_tag_wakeup_schedule_idle_count = -1;
4785
4786 /* IEEE Std 802.11z-2010 7.3.2.64 */
4787 static int hf_ieee80211_tag_channel_switch_timing_switch_time = -1;
4788 static int hf_ieee80211_tag_channel_switch_timing_switch_timeout = -1;
4789
4790 /* IEEE Std 802.11z-2010 7.3.2.65 */
4791 static int hf_ieee80211_tag_pti_control_tid = -1;
4792 static int hf_ieee80211_tag_pti_control_sequence_control = -1;
4793
4794 /* IEEE Std 802.11z-2010 7.3.2.66 */
4795 static int hf_ieee80211_tag_pu_buffer_status_ac_bk = -1;
4796 static int hf_ieee80211_tag_pu_buffer_status_ac_be = -1;
4797 static int hf_ieee80211_tag_pu_buffer_status_ac_vi = -1;
4798 static int hf_ieee80211_tag_pu_buffer_status_ac_vo = -1;
4799
4800 /* IEEE Std 802.11r-2008 7.3.2.49 */
4801 static int hf_ieee80211_tag_timeout_int_type = -1;
4802 static int hf_ieee80211_tag_timeout_int_value = -1;
4803
4804 /* Ethertype 89-0d */
4805 static int hf_ieee80211_data_encap_payload_type = -1;
4806
4807 static int hf_ieee80211_anqp_wfa_subtype = -1;
4808
4809 static int hf_ieee80211_dpp_subtype = -1;
4810
4811 /* Hotspot 2.0 */
4812 static int hf_hs20_indication_dgaf_disabled = -1;
4813 static int hf_hs20_indication_pps_mo_id_present = -1;
4814 static int hf_hs20_indication_anqp_domain_id_present = -1;
4815 static int hf_hs20_reserved = -1;
4816 static int hf_hs20_indication_release_number = -1;
4817 static int hf_hs20_indication_pps_mo_id = -1;
4818 static int hf_hs20_indication_anqp_domain_id = -1;
4819
4820 static int hf_hs20_anqp_subtype = -1;
4821 static int hf_hs20_anqp_reserved = -1;
4822 static int hf_hs20_anqp_payload = -1;
4823 static int hf_hs20_anqp_hs_query_list = -1;
4824 static int hf_hs20_anqp_hs_capability_list = -1;
4825 static int hf_hs20_anqp_ofn_length = -1;
4826 static int hf_hs20_anqp_ofn_language = -1;
4827 static int hf_hs20_anqp_ofn_name = -1;
4828 static int hf_hs20_anqp_wan_metrics_link_status = -1;
4829 static int hf_hs20_anqp_wan_metrics_symmetric_link = -1;
4830 static int hf_hs20_anqp_wan_metrics_at_capacity = -1;
4831 static int hf_hs20_anqp_wan_metrics_reserved = -1;
4832 static int hf_hs20_anqp_wan_metrics_downlink_speed = -1;
4833 static int hf_hs20_anqp_wan_metrics_uplink_speed = -1;
4834 static int hf_hs20_anqp_wan_metrics_downlink_load = -1;
4835 static int hf_hs20_anqp_wan_metrics_uplink_load = -1;
4836 static int hf_hs20_anqp_wan_metrics_lmd = -1;
4837 static int hf_hs20_anqp_cc_proto_ip_proto = -1;
4838 static int hf_hs20_anqp_cc_proto_port_num = -1;
4839 static int hf_hs20_anqp_cc_proto_status = -1;
4840 static int hf_hs20_anqp_nai_hrq_count = -1;
4841 static int hf_hs20_anqp_nai_hrq_encoding_type = -1;
4842 static int hf_hs20_anqp_nai_hrq_length = -1;
4843 static int hf_hs20_anqp_nai_hrq_realm_name = -1;
4844 static int hf_hs20_anqp_oper_class_indic = -1;
4845 static int hf_hs20_osu_friendly_names_len = -1;
4846 static int hf_hs20_osu_friendly_name_length = -1;
4847 static int hf_hs20_osu_friendly_name_language = -1;
4848 static int hf_hs20_osu_friendly_name_name = -1;
4849 static int hf_hs20_osu_server_uri_len = -1;
4850 static int hf_hs20_osu_server_uri = -1;
4851 static int hf_hs20_osu_method_list_len = -1;
4852 static int hf_hs20_osu_method_val = -1;
4853 static int hf_hs20_icons_avail_len = -1;
4854 static int hf_hs20_osu_providers_list_ssid_len = -1;
4855 static int hf_hs20_osu_providers_ssid = -1;
4856 static int hf_hs20_osu_providers_count = -1;
4857 static int hf_hs20_osu_prov_length = -1;
4858 static int hf_hs20_icon_request_filename = -1;
4859 static int hf_hs20_icon_binary_file_status = -1;
4860 static int hf_hs20_icon_type_length = -1;
4861 static int hf_hs20_icon_type = -1;
4862 static int hf_hs20_icon_binary_data_len = -1;
4863 static int hf_hs20_icon_binary_data = -1;
4864 static int hf_osu_icon_avail_width = -1;
4865 static int hf_osu_icon_avail_height = -1;
4866 static int hf_osu_icon_avail_lang_code = -1;
4867 static int hf_osu_icon_avail_icon_type_len = -1;
4868 static int hf_osu_icon_avail_icon_type = -1;
4869 static int hf_osu_icon_avail_filename_len = -1;
4870 static int hf_osu_icon_avail_filename = -1;
4871 static int hf_hs20_osu_nai_len = -1;
4872 static int hf_hs20_osu_nai = -1;
4873 static int hf_hs20_osu_service_desc_len = -1;
4874 static int hf_hs20_osu_service_desc_duple_len = -1;
4875 static int hf_hs20_osu_service_desc_lang = -1;
4876 static int hf_hs20_osu_service_desc = -1;
4877 static int hf_hs20_anqp_venue_url_length = -1;
4878 static int hf_hs20_anqp_venue_number = -1;
4879 static int hf_hs20_anqp_venue_url = -1;
4880 static int hf_hs20_anqp_advice_of_charge_length = -1;
4881 static int hf_hs20_anqp_advice_of_charge_type = -1;
4882 static int hf_hs20_anqp_aoc_nai_realm_encoding = -1;
4883 static int hf_hs20_anqp_aoc_nai_realm_len = -1;
4884 static int hf_hs20_anqp_aoc_nai_realm = -1;
4885 static int hf_hs20_anqp_aoc_plan_len = -1;
4886 static int hf_hs20_anqp_aoc_plan_lang = -1;
4887 static int hf_hs20_anqp_aoc_plan_curcy = -1;
4888 static int hf_hs20_anqp_aoc_plan_information = -1;
4889
4890 static int hf_hs20_subscription_remediation_url_len = -1;
4891 static int hf_hs20_subscription_remediation_server_url = -1;
4892 static int hf_hs20_subscription_remediation_server_method = -1;
4893 static int hf_hs20_deauth_reason_code = -1;
4894 static int hf_hs20_reauth_delay = -1;
4895 static int hf_hs20_deauth_reason_url_len = -1;
4896 static int hf_hs20_deauth_imminent_reason_url = -1;
4897
4898 /* IEEE Std 802.11ad */
4899 static int hf_ieee80211_block_ack_RBUFCAP = -1;
4900 static int hf_ieee80211_cf_response_offset = -1;
4901 static int hf_ieee80211_grant_ack_reserved = -1;
4902 static int hf_ieee80211_ff_dynamic_allocation = -1;
4903 static int hf_ieee80211_ff_TID = -1;
4904 static int hf_ieee80211_ff_alloc_type = -1;
4905 static int hf_ieee80211_ff_src_aid = -1;
4906 static int hf_ieee80211_ff_dest_aid = -1;
4907 static int hf_ieee80211_ff_alloc_duration = -1;
4908 static int hf_ieee80211_ff_b39 = -1;
4909 static int hf_ieee80211_ff_ssw = -1;
4910 static int hf_ieee80211_ff_ssw_direction = -1;
4911 static int hf_ieee80211_ff_ssw_cdown = -1;
4912 static int hf_ieee80211_ff_ssw_sector_id = -1;
4913 static int hf_ieee80211_ff_ssw_dmg_ant_id = -1;
4914 static int hf_ieee80211_ff_ssw_rxss_len = -1;
4915 static int hf_ieee80211_ff_bf = -1;
4916 static int hf_ieee80211_ff_bf_train = -1;
4917 static int hf_ieee80211_ff_bf_is_init = -1;
4918 static int hf_ieee80211_ff_bf_is_resp = -1;
4919 static int hf_ieee80211_ff_bf_num_sectors = -1;
4920 static int hf_ieee80211_ff_bf_num_rx_dmg_ants = -1;
4921 static int hf_ieee80211_ff_bf_b12b15 = -1;
4922 static int hf_ieee80211_ff_bf_rxss_len = -1;
4923 static int hf_ieee80211_ff_bf_rxss_rate = -1;
4924 static int hf_ieee80211_ff_bf_b10b15 = -1;
4925 static int hf_ieee80211_addr_nav_da = -1;
4926 static int hf_ieee80211_addr_nav_sa = -1;
4927 static int hf_ieee80211_ff_sswf = -1;
4928 static int hf_ieee80211_ff_sswf_num_rx_dmg_ants = -1;
4929 static int hf_ieee80211_ff_sswf_poll_required = -1;
4930 static int hf_ieee80211_ff_sswf_total_sectors = -1;
4931 static int hf_ieee80211_ff_sswf_reserved1 = -1;
4932 static int hf_ieee80211_ff_sswf_reserved2 = -1;
4933 static int hf_ieee80211_ff_sswf_sector_select = -1;
4934 static int hf_ieee80211_ff_sswf_dmg_antenna_select = -1;
4935 static int hf_ieee80211_ff_sswf_snr_report = -1;
4936 static int hf_ieee80211_ff_brp = -1;
4937 static int hf_ieee80211_ff_brp_L_RX = -1;
4938 static int hf_ieee80211_ff_brp_TX_TRN_REQ = -1;
4939 static int hf_ieee80211_ff_brp_MID_REQ = -1;
4940 static int hf_ieee80211_ff_brp_BC_REQ = -1;
4941 static int hf_ieee80211_ff_brp_MID_GRANT = -1;
4942 static int hf_ieee80211_ff_brp_BC_GRANT = -1;
4943 static int hf_ieee80211_ff_brp_chan_FBCK_CAP = -1;
4944 static int hf_ieee80211_ff_brp_tx_sector = -1;
4945 static int hf_ieee80211_ff_brp_other_aid = -1;
4946 static int hf_ieee80211_ff_brp_tx_antenna = -1;
4947 static int hf_ieee80211_ff_brp_reserved = -1;
4948 static int hf_ieee80211_ff_blm = -1;
4949 static int hf_ieee80211_ff_blm_unit_index = -1;
4950 static int hf_ieee80211_ff_blm_maint_value = -1;
4951 static int hf_ieee80211_ff_blm_is_master = -1;
4952 static int hf_ieee80211_ff_bic = -1;
4953 static int hf_ieee80211_ff_bic_cc_present = -1;
4954 static int hf_ieee80211_ff_bic_discovery_mode = -1;
4955 static int hf_ieee80211_ff_bic_next_beacon = -1;
4956 static int hf_ieee80211_ff_bic_ati_present = -1;
4957 static int hf_ieee80211_ff_bic_abft_len = -1;
4958 static int hf_ieee80211_ff_bic_fss = -1;
4959 static int hf_ieee80211_ff_bic_is_resp = -1;
4960 static int hf_ieee80211_ff_bic_next_abft = -1;
4961 static int hf_ieee80211_ff_bic_frag_txss = -1;
4962 static int hf_ieee80211_ff_bic_txss_span = -1;
4963 static int hf_ieee80211_ff_bic_NBI_abft = -1;
4964 static int hf_ieee80211_ff_bic_abft_count = -1;
4965 static int hf_ieee80211_ff_bic_nabft = -1;
4966 static int hf_ieee80211_ff_bic_pcp = -1;
4967 static int hf_ieee80211_ff_bic_reserved = -1;
4968 static const int *ieee80211_ff_bic_fields[] = {
4969   &hf_ieee80211_ff_bic_cc_present,
4970   &hf_ieee80211_ff_bic_discovery_mode,
4971   &hf_ieee80211_ff_bic_next_beacon,
4972   &hf_ieee80211_ff_bic_ati_present,
4973   &hf_ieee80211_ff_bic_abft_len,
4974   &hf_ieee80211_ff_bic_fss,
4975   &hf_ieee80211_ff_bic_is_resp,
4976   &hf_ieee80211_ff_bic_next_abft,
4977   &hf_ieee80211_ff_bic_frag_txss,
4978   &hf_ieee80211_ff_bic_txss_span,
4979   &hf_ieee80211_ff_bic_NBI_abft,
4980   &hf_ieee80211_ff_bic_abft_count,
4981   &hf_ieee80211_ff_bic_nabft,
4982   &hf_ieee80211_ff_bic_pcp,
4983   &hf_ieee80211_ff_bic_reserved,
4984   NULL
4985 };
4986 static int hf_ieee80211_ff_dmg_params = -1;
4987 static int hf_ieee80211_ff_dmg_params_bss = -1;
4988 static int hf_ieee80211_ff_dmg_params_cbap_only = -1;
4989 static int hf_ieee80211_ff_dmg_params_cbap_src = -1;
4990 static int hf_ieee80211_ff_dmg_params_privacy = -1;
4991 static int hf_ieee80211_ff_dmg_params_policy = -1;
4992 static int hf_ieee80211_ff_cc = -1;
4993 static int hf_ieee80211_ff_cc_abft_resp_addr = -1;
4994 static int hf_ieee80211_ff_cc_sp_duration = -1;
4995 static int hf_ieee80211_ff_cc_cluster_id = -1;
4996 static int hf_ieee80211_ff_cc_role = -1;
4997 static int hf_ieee80211_ff_cc_max_mem = -1;
4998 static int hf_ieee80211_ff_dmg_action_code = -1;
4999 static int hf_ieee80211_ff_dmg_pwr_mgmt = -1;
5000 static int hf_ieee80211_ff_subject_address = -1;
5001 static int hf_ieee80211_ff_handover_reason = -1;
5002 static int hf_ieee80211_ff_handover_remaining_bi = -1;
5003 static int hf_ieee80211_ff_handover_result = -1;
5004 static int hf_ieee80211_ff_handover_reject_reason = -1;
5005 static int hf_ieee80211_ff_destination_reds_aid = -1;
5006 static int hf_ieee80211_ff_destination_aid = -1;
5007 static int hf_ieee80211_ff_realy_aid = -1;
5008 static int hf_ieee80211_ff_source_aid = -1;
5009 static int hf_ieee80211_ff_timing_offset = -1;
5010 static int hf_ieee80211_ff_sampling_frequency_offset = -1;
5011 static int hf_ieee80211_ff_relay_operation_type = -1;
5012 static int hf_ieee80211_ff_peer_sta_aid = -1;
5013 static int hf_ieee80211_ff_snr = -1;
5014 static int hf_ieee80211_ff_internal_angle = -1;
5015 static int hf_ieee80211_ff_recommend = -1;
5016 static int hf_ieee80211_ff_unprotected_dmg_action_code = -1;
5017 static int hf_ieee80211_ff_fst_action_code = -1;
5018 static int hf_ieee80211_ff_llt = -1;
5019 static int hf_ieee80211_ff_fsts_id = -1;
5020 static int hf_ieee80211_ff_mmpdu_len = -1;
5021 static int hf_ieee80211_ff_mmpdu_ctrl = -1;
5022 static int hf_ieee80211_ff_oct_mmpdu = -1;
5023 #if 0
5024 static int hf_ieee80211_ff_rcsi = -1;
5025 static int hf_ieee80211_ff_rcsi_aid = -1;
5026 #endif
5027 static int hf_ieee80211_ff_band_id = -1;
5028 static int hf_ieee80211_tag_relay_support = -1;
5029 static int hf_ieee80211_tag_relay_use = -1;
5030 static int hf_ieee80211_tag_relay_permission = -1;
5031 static int hf_ieee80211_tag_AC_power = -1;
5032 static int hf_ieee80211_tag_relay_prefer = -1;
5033 static int hf_ieee80211_tag_duplex = -1;
5034 static int hf_ieee80211_tag_cooperation = -1;
5035 static int hf_ieee80211_tag_move = -1;
5036 static int hf_ieee80211_tag_size = -1;
5037 static int hf_ieee80211_tag_tbtt_offset = -1;
5038 static int hf_ieee80211_tag_bi_duration = -1;
5039 static int hf_ieee80211_tag_dmg_capa_sta_addr = -1;
5040 static int hf_ieee80211_tag_dmg_capa_aid = -1;
5041 static int hf_ieee80211_tag_reverse_direction = -1;
5042 static int hf_ieee80211_tag_hlts = -1;
5043 static int hf_ieee80211_tag_tpc = -1;
5044 static int hf_ieee80211_tag_spsh = -1;
5045 static int hf_ieee80211_tag_rx_antenna = -1;
5046 static int hf_ieee80211_tag_fast_link = -1;
5047 static int hf_ieee80211_tag_num_sectors = -1;
5048 static int hf_ieee80211_tag_rxss_length = -1;
5049 static int hf_ieee80211_tag_reciprocity = -1;
5050 static int hf_ieee80211_tag_max_ampdu_exp = -1;
5051 static int hf_ieee80211_tag_min_mpdu_spacing = -1;
5052 static int hf_ieee80211_tag_ba_flow_control = -1;
5053 static int hf_ieee80211_tag_max_sc_rx_mcs = -1;
5054 static int hf_ieee80211_tag_max_ofdm_rx_mcs = -1;
5055 static int hf_ieee80211_tag_max_sc_tx_mcs = -1;
5056 static int hf_ieee80211_tag_max_ofdm_tx_mcs = -1;
5057 static int hf_ieee80211_tag_low_power_supported = -1;
5058 static int hf_ieee80211_tag_code_rate = -1;
5059 static int hf_ieee80211_tag_dtp = -1;
5060 static int hf_ieee80211_tag_appdu_supp = -1;
5061 static int hf_ieee80211_tag_heartbeat = -1;
5062 static int hf_ieee80211_tag_other_aid = -1;
5063 static int hf_ieee80211_tag_pattern_recip = -1;
5064 static int hf_ieee80211_tag_heartbeat_elapsed = -1;
5065 static int hf_ieee80211_tag_grant_ack_supp = -1;
5066 static int hf_ieee80211_tag_RXSSTxRate_supp = -1;
5067 static int hf_ieee80211_tag_pcp_tddti = -1;
5068 static int hf_ieee80211_tag_pcp_PSA = -1;
5069 static int hf_ieee80211_tag_pcp_handover = -1;
5070 static int hf_ieee80211_tag_pcp_max_assoc = -1;
5071 static int hf_ieee80211_tag_pcp_power_src = -1;
5072 static int hf_ieee80211_tag_pcp_decenter = -1;
5073 static int hf_ieee80211_tag_pcp_forwarding = -1;
5074 static int hf_ieee80211_tag_pcp_center = -1;
5075 static int hf_ieee80211_tag_sta_beam_track = -1;
5076 static int hf_ieee80211_tag_ext_sc_mcs_max_tx = -1;
5077 static int hf_ieee80211_tag_ext_sc_mcs_tx_code_7_8 = -1;
5078 static int hf_ieee80211_tag_ext_sc_mcs_max_rx = -1;
5079 static int hf_ieee80211_tag_ext_sc_mcs_rx_code_7_8 = -1;
5080 static int hf_ieee80211_tag_max_basic_sf_amsdu = -1;
5081 static int hf_ieee80211_tag_max_short_sf_amsdu = -1;
5082 static int hf_ieee80211_tag_PSRSI = -1;
5083 static int hf_ieee80211_tag_min_BHI_duration = -1;
5084 static int hf_ieee80211_tag_brdct_sta_info_dur = -1;
5085 static int hf_ieee80211_tag_assoc_resp_confirm_time = -1;
5086 static int hf_ieee80211_tag_min_pp_duration = -1;
5087 static int hf_ieee80211_tag_SP_idle_timeout = -1;
5088 static int hf_ieee80211_tag_max_lost_beacons = -1;
5089 static int hf_ieee80211_tag_type = -1;
5090 static int hf_ieee80211_tag_tap1 = -1;
5091 static int hf_ieee80211_tag_state1 = -1;
5092 static int hf_ieee80211_tag_tap2 = -1;
5093 static int hf_ieee80211_tag_state2 = -1;
5094 static int hf_ieee80211_tag_allocation_id = -1;
5095 static int hf_ieee80211_tag_allocation_type = -1;
5096 static int hf_ieee80211_tag_pseudo_static = -1;
5097 static int hf_ieee80211_tag_truncatable = -1;
5098 static int hf_ieee80211_tag_extendable = -1;
5099 static int hf_ieee80211_tag_pcp_active = -1;
5100 static int hf_ieee80211_tag_lp_sc_used = -1;
5101 static int hf_ieee80211_tag_src_aid = -1;
5102 static int hf_ieee80211_tag_dest_aid = -1;
5103 static int hf_ieee80211_tag_alloc_start = -1;
5104 static int hf_ieee80211_tag_alloc_block_duration = -1;
5105 static int hf_ieee80211_tag_num_blocks = -1;
5106 static int hf_ieee80211_tag_alloc_block_period = -1;
5107 static int hf_ieee80211_tag_aid = -1;
5108 static int hf_ieee80211_tag_cbap = -1;
5109 static int hf_ieee80211_tag_pp_avail = -1;
5110 static int hf_ieee80211_tag_next_ati_start_time = -1;
5111 static int hf_ieee80211_tag_next_ati_duration = -1;
5112 static int hf_ieee80211_tag_old_bssid = -1;
5113 static int hf_ieee80211_tag_new_pcp_addr = -1;
5114 static int hf_ieee80211_tag_bssid = -1;
5115 static int hf_ieee80211_tag_duplex_relay = -1;
5116 static int hf_ieee80211_tag_cooperation_relay = -1;
5117 static int hf_ieee80211_tag_tx_mode = -1;
5118 static int hf_ieee80211_tag_link_change_interval = -1;
5119 static int hf_ieee80211_tag_data_sensing_time = -1;
5120 static int hf_ieee80211_tag_first_period = -1;
5121 static int hf_ieee80211_tag_second_period = -1;
5122 static int hf_ieee80211_tag_initiator = -1;
5123 static int hf_ieee80211_tag_tx_train_res = -1;
5124 static int hf_ieee80211_tag_rx_train_res = -1;
5125 static int hf_ieee80211_tag_tx_trn_ok = -1;
5126 static int hf_ieee80211_tag_txss_fbck_req = -1;
5127 static int hf_ieee80211_tag_bs_fbck = -1;
5128 static int hf_ieee80211_tag_bs_fbck_antenna_id = -1;
5129 static int hf_ieee80211_tag_snr_requested = -1;
5130 static int hf_ieee80211_tag_channel_measurement_requested = -1;
5131 static int hf_ieee80211_tag_number_of_taps_requested = -1;
5132 static int hf_ieee80211_tag_sector_id_order_req = -1;
5133 static int hf_ieee80211_tag_snr_present = -1;
5134 static int hf_ieee80211_tag_channel_measurement_present = -1;
5135 static int hf_ieee80211_tag_tap_delay_present = -1;
5136 static int hf_ieee80211_tag_number_of_taps_present = -1;
5137 static int hf_ieee80211_tag_number_of_measurement = -1;
5138 static int hf_ieee80211_tag_sector_id_order_present = -1;
5139 static int hf_ieee80211_tag_number_of_beams = -1;
5140 static int hf_ieee80211_tag_mid_extension = -1;
5141 static int hf_ieee80211_tag_capability_request = -1;
5142 static int hf_ieee80211_tag_beam_refine_reserved = -1;
5143 static int hf_ieee80211_tag_nextpcp_list = -1;
5144 static int hf_ieee80211_tag_nextpcp_token = -1;
5145 static int hf_ieee80211_tag_reamaining_BI = -1;
5146 static int hf_ieee80211_tag_request_token = -1;
5147 static int hf_ieee80211_tag_bi_start_time = -1;
5148 static int hf_ieee80211_tag_sleep_cycle = -1;
5149 static int hf_ieee80211_tag_num_awake_bis = -1;
5150 static int hf_ieee80211_tag_tspec_allocation_id = -1;
5151 static int hf_ieee80211_tag_tspec_allocation_type = -1;
5152 static int hf_ieee80211_tag_tspec_allocation_format = -1;
5153 static int hf_ieee80211_tag_tspec_pseudo_static = -1;
5154 static int hf_ieee80211_tag_tspec_truncatable = -1;
5155 static int hf_ieee80211_tag_tspec_extendable = -1;
5156 static int hf_ieee80211_tag_tspec_lp_sc_used = -1;
5157 static int hf_ieee80211_tag_tspec_up = -1;
5158 static int hf_ieee80211_tag_tspec_dest_aid = -1;
5159 static int hf_ieee80211_tag_tspec_allocation_period = -1;
5160 static int hf_ieee80211_tag_tspec_min_allocation = -1;
5161 static int hf_ieee80211_tag_tspec_max_allocation = -1;
5162 static int hf_ieee80211_tag_tspec_min_duration = -1;
5163 static int hf_ieee80211_tag_tspec_num_of_constraints = -1;
5164 static int hf_ieee80211_tag_tspec_tsconst_start_time = -1;
5165 static int hf_ieee80211_tag_tspec_tsconst_duration = -1;
5166 static int hf_ieee80211_tag_tspec_tsconst_period = -1;
5167 static int hf_ieee80211_tag_tspec_tsconst_interferer_mac = -1;
5168 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_I = -1;
5169 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_Q = -1;
5170 static int hf_ieee80211_tag_channel_measurement_feedback_tap_delay = -1;
5171 static int hf_ieee80211_tag_channel_measurement_feedback_sector_id = -1;
5172 static int hf_ieee80211_tag_channel_measurement_feedback_antenna_id = -1;
5173 static int hf_ieee80211_tag_awake_window = -1;
5174 static int hf_ieee80211_tag_addba_ext_no_frag = -1;
5175 static int hf_ieee80211_tag_addba_ext_he_fragmentation_operation = -1;
5176 static int hf_ieee80211_tag_addba_ext_reserved = -1;
5177 static int hf_ieee80211_tag_multi_band_ctrl_sta_role = -1;
5178 static int hf_ieee80211_tag_multi_band_ctrl_addr_present = -1;
5179 static int hf_ieee80211_tag_multi_band_ctrl_cipher_present = -1;
5180 static int hf_ieee80211_tag_multi_band_oper_class = -1;
5181 static int hf_ieee80211_tag_multi_band_channel_number = -1;
5182 static int hf_ieee80211_tag_multi_band_tsf_offset = -1;
5183 static int hf_ieee80211_tag_multi_band_conn_ap = -1;
5184 static int hf_ieee80211_tag_multi_band_conn_pcp = -1;
5185 static int hf_ieee80211_tag_multi_band_conn_dls = -1;
5186 static int hf_ieee80211_tag_multi_band_conn_tdls = -1;
5187 static int hf_ieee80211_tag_multi_band_conn_ibss = -1;
5188 static int hf_ieee80211_tag_multi_band_fst_timeout = -1;
5189 static int hf_ieee80211_tag_multi_band_sta_mac = -1;
5190 static int hf_ieee80211_tag_activity = -1;
5191 static int hf_ieee80211_tag_dmg_link_adapt_mcs = -1;
5192 static int hf_ieee80211_tag_dmg_link_adapt_link_margin = -1;
5193 static int hf_ieee80211_tag_ref_timestamp = -1;
5194 static int hf_ieee80211_tag_switching_stream_non_qos = -1;
5195 static int hf_ieee80211_tag_switching_stream_param_num = -1;
5196 static int hf_ieee80211_tag_switching_stream_old_tid = -1;
5197 static int hf_ieee80211_tag_switching_stream_old_direction = -1;
5198 static int hf_ieee80211_tag_switching_stream_new_tid = -1;
5199 static int hf_ieee80211_tag_switching_stream_new_direction = -1;
5200 static int hf_ieee80211_tag_switching_stream_new_valid_id = -1;
5201 static int hf_ieee80211_tag_switching_stream_llt_type = -1;
5202
5203 static int hf_ieee80211_mysterious_olpc_stuff = -1;
5204
5205 static int hf_ieee80211_esp_access_category = -1;
5206 static int hf_ieee80211_esp_reserved = -1;
5207 static int hf_ieee80211_esp_data_format = -1;
5208 static int hf_ieee80211_esp_ba_windows_size = -1;
5209 static int hf_ieee80211_esp_est_air_time_frac = -1;
5210 static int hf_ieee80211_esp_data_ppdu_duration_target = -1;
5211 static int hf_ieee80211_estimated_service_params = -1;
5212
5213 static int hf_ieee80211_fcg_new_channel_number = -1;
5214 static int hf_ieee80211_fcg_extra_info = -1;
5215
5216 static int hf_ieee80211_ext_tag = -1;
5217 static int hf_ieee80211_ext_tag_number = -1;
5218 static int hf_ieee80211_ext_tag_length = -1;
5219 static int hf_ieee80211_fils_session = -1;
5220 static int hf_ieee80211_fils_wrapped_data = -1;
5221 static int hf_ieee80211_fils_nonce = -1;
5222
5223 /* ************************************************************************* */
5224 /*                              802.11AX fields                              */
5225 /* ************************************************************************* */
5226 static int hf_he_mac_capabilities = -1;
5227 static int hf_he_htc_he_support = -1;
5228 static int hf_he_twt_requester_support = -1;
5229 static int hf_he_twt_responder_support = -1;
5230 static int hf_he_fragmentation_support = -1;
5231 static int hf_he_max_number_fragmented_msdus = -1;
5232 static int hf_he_min_fragment_size = -1;
5233 static int hf_he_trigger_frame_mac_padding_dur = -1;
5234 static int hf_he_multi_tid_aggregation_support = -1;
5235 static int hf_he_he_link_adaptation_support = -1;
5236 static int hf_he_all_ack_support = -1;
5237 static int hf_he_umrs_support = -1;
5238 static int hf_he_bsr_support = -1;
5239 static int hf_he_broadcast_twt_support = -1;
5240 static int hf_he_32_bit_ba_bitmap_support = -1;
5241 static int hf_he_mu_cascading_support = -1;
5242 static int hf_he_ack_enabled_aggregation_support = -1;
5243 static int hf_he_group_addressed_multi_sta_blkack_support = -1;
5244 static int hf_he_om_control_support = -1;
5245 static int hf_he_ofdma_ra_support = -1;
5246 static int hf_he_max_a_mpdu_length_exponent = -1;
5247 static int hf_he_a_msdu_fragmentation_support = -1;
5248 static int hf_he_flexible_twt_schedule_support = -1;
5249 static int hf_he_rx_control_frame_to_multibss = -1;
5250 static int hf_he_bsrp_bqrp_a_mpdu_aggregation = -1;
5251 static int hf_he_qtp_support = -1;
5252 static int hf_he_bqr_support = -1;
5253 static int hf_he_sr_responder = -1;
5254 static int hf_he_ndp_feedback_report_support = -1;
5255 static int hf_he_ops_support = -1;
5256 static int hf_he_a_msdu_in_a_mpdu_support = -1;
5257 static int hf_he_reserved = -1;
5258 static int hf_he_reserved_bit_18 = -1;
5259 static int hf_he_reserved_bit_19 = -1;
5260 static int hf_he_reserved_bit_25 = -1;
5261 static int hf_he_reserved_bits_5_7 = -1;
5262 static int hf_he_reserved_bits_8_9 = -1;
5263 static int hf_he_reserved_bits_15_16 = -1;
5264 static int hf_he_phy_chan_width_set = -1;
5265 static int hf_he_40mhz_channel_2_4ghz = -1;
5266 static int hf_he_40_and_80_mhz_5ghz = -1;
5267 static int hf_he_160_mhz_5ghz = -1;
5268 static int hf_he_160_80_plus_80_mhz_5ghz = -1;
5269 static int hf_he_242_tone_rus_in_2_4ghz = -1;
5270 static int hf_he_242_tone_rus_in_5ghz = -1;
5271 static int hf_he_chan_width_reserved = -1;
5272 static int hf_he_mcs_max_he_mcs_80_rx_1_ss = -1;
5273 static int hf_he_mcs_max_he_mcs_80_rx_2_ss = -1;
5274 static int hf_he_mcs_max_he_mcs_80_rx_3_ss = -1;
5275 static int hf_he_mcs_max_he_mcs_80_rx_4_ss = -1;
5276 static int hf_he_mcs_max_he_mcs_80_rx_5_ss = -1;
5277 static int hf_he_mcs_max_he_mcs_80_rx_6_ss = -1;
5278 static int hf_he_mcs_max_he_mcs_80_rx_7_ss = -1;
5279 static int hf_he_mcs_max_he_mcs_80_rx_8_ss = -1;
5280 static int hf_he_mcs_max_he_mcs_80_tx_1_ss = -1;
5281 static int hf_he_mcs_max_he_mcs_80_tx_2_ss = -1;
5282 static int hf_he_mcs_max_he_mcs_80_tx_3_ss = -1;
5283 static int hf_he_mcs_max_he_mcs_80_tx_4_ss = -1;
5284 static int hf_he_mcs_max_he_mcs_80_tx_5_ss = -1;
5285 static int hf_he_mcs_max_he_mcs_80_tx_6_ss = -1;
5286 static int hf_he_mcs_max_he_mcs_80_tx_7_ss = -1;
5287 static int hf_he_mcs_max_he_mcs_80_tx_8_ss = -1;
5288 static int hf_he_mcs_max_he_mcs_80p80_rx_1_ss = -1;
5289 static int hf_he_mcs_max_he_mcs_80p80_rx_2_ss = -1;
5290 static int hf_he_mcs_max_he_mcs_80p80_rx_3_ss = -1;
5291 static int hf_he_mcs_max_he_mcs_80p80_rx_4_ss = -1;
5292 static int hf_he_mcs_max_he_mcs_80p80_rx_5_ss = -1;
5293 static int hf_he_mcs_max_he_mcs_80p80_rx_6_ss = -1;
5294 static int hf_he_mcs_max_he_mcs_80p80_rx_7_ss = -1;
5295 static int hf_he_mcs_max_he_mcs_80p80_rx_8_ss = -1;
5296 static int hf_he_mcs_max_he_mcs_80p80_tx_1_ss = -1;
5297 static int hf_he_mcs_max_he_mcs_80p80_tx_2_ss = -1;
5298 static int hf_he_mcs_max_he_mcs_80p80_tx_3_ss = -1;
5299 static int hf_he_mcs_max_he_mcs_80p80_tx_4_ss = -1;
5300 static int hf_he_mcs_max_he_mcs_80p80_tx_5_ss = -1;
5301 static int hf_he_mcs_max_he_mcs_80p80_tx_6_ss = -1;
5302 static int hf_he_mcs_max_he_mcs_80p80_tx_7_ss = -1;
5303 static int hf_he_mcs_max_he_mcs_80p80_tx_8_ss = -1;
5304 static int hf_he_mcs_max_he_mcs_160_rx_1_ss = -1;
5305 static int hf_he_mcs_max_he_mcs_160_rx_2_ss = -1;
5306 static int hf_he_mcs_max_he_mcs_160_rx_3_ss = -1;
5307 static int hf_he_mcs_max_he_mcs_160_rx_4_ss = -1;
5308 static int hf_he_mcs_max_he_mcs_160_rx_5_ss = -1;
5309 static int hf_he_mcs_max_he_mcs_160_rx_6_ss = -1;
5310 static int hf_he_mcs_max_he_mcs_160_rx_7_ss = -1;
5311 static int hf_he_mcs_max_he_mcs_160_rx_8_ss = -1;
5312 static int hf_he_mcs_max_he_mcs_160_tx_1_ss = -1;
5313 static int hf_he_mcs_max_he_mcs_160_tx_2_ss = -1;
5314 static int hf_he_mcs_max_he_mcs_160_tx_3_ss = -1;
5315 static int hf_he_mcs_max_he_mcs_160_tx_4_ss = -1;
5316 static int hf_he_mcs_max_he_mcs_160_tx_5_ss = -1;
5317 static int hf_he_mcs_max_he_mcs_160_tx_6_ss = -1;
5318 static int hf_he_mcs_max_he_mcs_160_tx_7_ss = -1;
5319 static int hf_he_mcs_max_he_mcs_160_tx_8_ss = -1;
5320 static int hf_he_rx_he_mcs_map_lte_80 = -1;
5321 static int hf_he_tx_he_mcs_map_lte_80 = -1;
5322 static int hf_he_rx_he_mcs_map_160 = -1;
5323 static int hf_he_tx_he_mcs_map_160 = -1;
5324 static int hf_he_rx_he_mcs_map_80_80 = -1;
5325 static int hf_he_tx_he_mcs_map_80_80 = -1;
5326 static int hf_he_ppe_thresholds_nss = -1;
5327 static int hf_he_ppe_thresholds_ru_index_bitmask = -1;
5328 static int hf_he_ppe_ppet16 = -1;
5329 static int hf_he_ppe_ppet8 = -1;
5330 static int hf_he_phy_dual_band_support = -1;
5331 static int hf_he_phy_cap_dual_band_support = -1;
5332 static int hf_he_phy_b8_to_b23 = -1;
5333 static int hf_he_phy_cap_punctured_preamble_rx = -1;
5334 static int hf_he_phy_cap_device_class = -1;
5335 static int hf_he_phy_cap_ldpc_coding_in_payload = -1;
5336 static int hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us = -1;
5337 static int hf_he_phy_cap_midamble_rx_max_nsts = -1;
5338 static int hf_he_phy_cap_ndp_with_4x_he_ltf_32us = -1;
5339 static int hf_he_phy_cap_stbc_tx_lt_80mhz = -1;
5340 static int hf_he_phy_cap_stbc_rx_lt_80mhz = -1;
5341 static int hf_he_phy_cap_doppler_tx = -1;
5342 static int hf_he_phy_cap_doppler_rx = -1;
5343 static int hf_he_phy_cap_full_bw_ul_mu_mimo = -1;
5344 static int hf_he_phy_cap_partial_bw_ul_mu_mimo = -1;
5345 static int hf_he_phy_b24_to_b39 = -1;
5346 static int hf_he_phy_cap_dcm_max_constellation_tx = -1;
5347 static int hf_he_phy_cap_dcm_max_nss_tx = -1;
5348 static int hf_he_phy_cap_dcm_max_constellation_rx = -1;
5349 static int hf_he_phy_cap_dcm_max_nss_rx = -1;
5350 static int hf_he_phy_cap_rx_he_muppdu_from_non_ap = -1;
5351 static int hf_he_phy_cap_su_beamformer = -1;
5352 static int hf_he_phy_cap_su_beamformee = -1;
5353 static int hf_he_phy_cap_mu_beamformer = -1;
5354 static int hf_he_phy_cap_beamformer_sts_lte_80mhz = -1;
5355 static int hf_he_phy_cap_beamformer_sts_gt_80mhz = -1;
5356 static int hf_he_phy_b40_to_b55 = -1;
5357 static int hf_he_phy_cap_number_of_sounding_dims_lte_80 = -1;
5358 static int hf_he_phy_cap_number_of_sounding_dims_gt_80 = -1;
5359 static int hf_he_phy_cap_ng_eq_16_su_fb = -1;
5360 static int hf_he_phy_cap_ng_eq_16_mu_fb = -1;
5361 static int hf_he_phy_cap_codebook_size_eq_4_2_fb = -1;
5362 static int hf_he_phy_cap_codebook_size_eq_7_5_fb = -1;
5363 static int hf_he_phy_cap_triggered_su_beamforming_fb = -1;
5364 static int hf_he_phy_cap_triggered_mu_beamforming_fb = -1;
5365 static int hf_he_phy_cap_triggered_cqi_fb = -1;
5366 static int hf_he_phy_cap_partial_bw_extended_range = -1;
5367 static int hf_he_phy_cap_partial_bw_dl_mu_mimo = -1;
5368 static int hf_he_phy_cap_ppe_threshold_present = -1;
5369 static int hf_he_phy_b56_to_b71 = -1;
5370 static int hf_he_phy_cap_srp_based_sr_support = -1;
5371 static int hf_he_phy_cap_power_boost_factor_ar_support = -1;
5372 static int hf_he_phy_cap_he_su_ppdu_etc_gi = -1;
5373 static int hf_he_phy_cap_max_nc = -1;
5374 static int hf_he_phy_cap_stbc_tx_gt_80_mhz = -1;
5375 static int hf_he_phy_cap_stbc_rx_gt_80_mhz = -1;
5376 static int hf_he_phy_cap_he_er_su_ppdu_4xxx_gi = -1;
5377 static int hf_he_phy_cap_20mhz_in_40mhz_24ghz_band = -1;
5378 static int hf_he_phy_cap_20mhz_in_160_80p80_ppdu = -1;
5379 static int hf_he_phy_cap_80mgz_in_160_80p80_ppdu = -1;
5380 static int hf_he_phy_cap_he_er_su_ppdu_1xxx_gi = -1;
5381 static int hf_he_phy_cap_midamble_rx_2x_xxx_ltf = -1;
5382 static int hf_he_phy_cap_b70_b71_reserved = -1;
5383 static int hf_he_operation_parameter = -1;
5384 static int hf_he_operation_bss_color = -1;
5385 static int hf_he_operation_default_pe_duration = -1;
5386 static int hf_he_operation_twt_required = -1;
5387 static int hf_he_operation_txop_duration_rts_threshold = -1;
5388 static int hf_he_operation_partial_bss_color = -1;
5389 static int hf_he_operation_vht_operation_information_present = -1;
5390 static int hf_he_operation_reserved_b22_b27 = -1;
5391 static int hf_he_operation_multiple_bssid_ap = -1;
5392 static int hf_he_operation_txbssid_indicator = -1;
5393 static int hf_he_operation_bss_color_disabled = -1;
5394 static int hf_he_operation_reserved_b31 = -1;
5395 static int hf_he_operation_basic_mcs = -1;
5396 static int hf_he_oper_max_he_mcs_for_1_ss = -1;
5397 static int hf_he_oper_max_he_mcs_for_2_ss = -1;
5398 static int hf_he_oper_max_he_mcs_for_3_ss = -1;
5399 static int hf_he_oper_max_he_mcs_for_4_ss = -1;
5400 static int hf_he_oper_max_he_mcs_for_5_ss = -1;
5401 static int hf_he_oper_max_he_mcs_for_6_ss = -1;
5402 static int hf_he_oper_max_he_mcs_for_7_ss = -1;
5403 static int hf_he_oper_max_he_mcs_for_8_ss = -1;
5404 static int hf_he_operation_channel_width = -1;
5405 static int hf_he_operation_channel_center_freq_0 = -1;
5406 static int hf_he_operation_channel_center_freq_1 = -1;
5407 static int hf_he_operation_max_bssid_indicator = -1;
5408 static int hf_he_muac_aci_aifsn = -1;
5409 static int hf_he_mu_edca_timer = -1;
5410 static int hf_he_muac_ecwmin_ecwmax = -1;
5411 static int hf_he_srp_disallowed = -1;
5412 static int hf_he_non_srg_obss_pd_sr_disallowed = -1;
5413 static int hf_he_non_srg_offset_present = -1;
5414 static int hf_he_srg_information_present = -1;
5415 static int hf_he_hesiga_spatial_reuse_value15_allowed = -1;
5416 static int hf_he_sr_control_reserved = -1;
5417 static int hf_he_spatial_reuse_sr_control = -1;
5418 static int hf_he_spatial_non_srg_obss_pd_max_offset = -1;
5419 static int hf_he_spatial_srg_obss_pd_min_offset = -1;
5420 static int hf_he_spatial_srg_obss_pd_max_offset = -1;
5421 static int hf_he_spatial_srg_bss_color_bitmap = -1;
5422 static int hf_he_spatial_srg_partial_bssid_bitmap = -1;
5423 static int hf_he_ess_report_planned_ess = -1;
5424 static int hf_he_ess_report_edge_of_ess = -1;
5425 static int hf_he_resource_request_buffer_thresh = -1;
5426 static int hf_he_bss_color_change_new_color_info = -1;
5427 static int hf_he_new_bss_color_info_color = -1;
5428 static int hf_he_new_bss_color_info_reserved = -1;
5429 static int hf_he_bss_color_change_switch_countdown = -1;
5430 static int hf_he_ess_report_info_field = -1;
5431 static int hf_he_ess_report_recommend_transition_thresh = -1;
5432 static int hf_he_uora_field = -1;
5433 static int hf_he_uora_eocwmin = -1;
5434 static int hf_he_uora_owcwmax = -1;
5435 static int hf_he_uora_reserved = -1;
5436
5437 /* ************************************************************************* */
5438 /*                               Protocol trees                              */
5439 /* ************************************************************************* */
5440 static gint ett_80211 = -1;
5441 static gint ett_proto_flags = -1;
5442 static gint ett_cap_tree = -1;
5443 static gint ett_fc_tree = -1;
5444 static gint ett_cntrl_wrapper_fc = -1;
5445 static gint ett_cntrl_wrapper_payload = -1;
5446 static gint ett_fragments = -1;
5447 static gint ett_fragment = -1;
5448 static gint ett_block_ack = -1;
5449 static gint ett_block_ack_tid = -1;
5450 static gint ett_block_ack_request_control = -1;
5451 static gint ett_block_ack_bitmap = -1;
5452 static gint ett_block_ack_request_multi_sta_aid_tid = -1;
5453 static gint ett_multi_sta_block_ack = -1;
5454 static gint ett_ath_cap_tree = -1;
5455
5456 static gint ett_80211_mgt = -1;
5457 static gint ett_fixed_parameters = -1;
5458 static gint ett_tagged_parameters = -1;
5459 static gint ett_tag_bmapctl_tree = -1;
5460 static gint ett_tag_country_fnm_tree = -1;
5461 static gint ett_tag_country_rcc_tree = -1;
5462 static gint ett_qos_parameters = -1;
5463 static gint ett_qos_ps_buf_state = -1;
5464 static gint ett_wep_parameters = -1;
5465 static gint ett_msh_control = -1;
5466 static gint ett_hwmp_targ_flags_tree = -1;
5467 static gint ett_mesh_chswitch_flag_tree = -1;
5468 static gint ett_mesh_config_cap_tree = -1;
5469 static gint ett_mesh_formation_info_tree = -1;
5470
5471 static gint ett_rsn_gcs_tree = -1;
5472 static gint ett_rsn_pcs_tree = -1;
5473 static gint ett_rsn_sub_pcs_tree = -1;
5474 static gint ett_rsn_akms_tree = -1;
5475 static gint ett_rsn_sub_akms_tree = -1;
5476 static gint ett_rsn_cap_tree = -1;
5477 static gint ett_rsn_pmkid_tree = -1;
5478 static gint ett_rsn_gmcs_tree = -1;
5479
5480 static gint ett_wpa_mcs_tree = -1;
5481 static gint ett_wpa_ucs_tree = -1;
5482 static gint ett_wpa_sub_ucs_tree = -1;
5483 static gint ett_wpa_akms_tree = -1;
5484 static gint ett_wpa_sub_akms_tree = -1;
5485 static gint ett_wme_ac = -1;
5486 static gint ett_wme_aci_aifsn = -1;
5487 static gint ett_wme_ecw = -1;
5488 static gint ett_wme_qos_info = -1;
5489
5490 static gint ett_ht_cap_tree = -1;
5491 static gint ett_ampduparam_tree = -1;
5492 static gint ett_mcsset_tree = -1;
5493 static gint ett_mcsbit_tree = -1;
5494 static gint ett_htex_cap_tree = -1;
5495 static gint ett_txbf_tree = -1;
5496 static gint ett_antsel_tree = -1;
5497 static gint ett_hta_cap_tree = -1;
5498 static gint ett_hta_cap1_tree = -1;
5499 static gint ett_hta_cap2_tree = -1;
5500
5501 static gint ett_htc_tree = -1;
5502 static gint ett_htc_he_a_control = -1;
5503 static gint ett_mfb_subtree = -1;
5504 static gint ett_lac_subtree = -1;
5505 static gint ett_ieee80211_umrs_control = -1;
5506 static gint ett_ieee80211_om_control = -1;
5507 static gint ett_ieee80211_hla_control = -1;
5508 static gint ett_ieee80211_buffer_status_report = -1;
5509 static gint ett_ieee80211_control_uph = -1;
5510 static gint ett_ieee80211_bqr_control = -1;
5511 static gint ett_ieee80211_control_cci = -1;
5512
5513 static gint ett_vht_cap_tree = -1;
5514 static gint ett_vht_mcsset_tree = -1;
5515 static gint ett_vht_rx_mcsbit_tree = -1;
5516 static gint ett_vht_tx_mcsbit_tree = -1;
5517 static gint ett_vht_basic_mcsbit_tree = -1;
5518 static gint ett_vht_op_tree = -1;
5519 static gint ett_vht_tpe_info_tree = -1;
5520
5521 static gint ett_vht_ndp_annc = -1;
5522 static gint ett_vht_ndp_annc_sta_info_tree = -1;
5523 static gint ett_vht_ndp_annc_sta_list = -1;
5524
5525 static gint ett_he_mimo_control = -1;
5526
5527 static gint ett_ff_vhtmimo_cntrl = -1;
5528 static gint ett_ff_vhtmimo_beamforming_report = -1;
5529 static gint ett_ff_vhtmimo_beamforming_report_snr = -1;
5530 static gint ett_ff_vhtmimo_beamforming_angle = -1;
5531 static gint ett_ff_vhtmimo_beamforming_report_feedback_matrices = -1;
5532 static gint ett_ff_vhtmu_exclusive_beamforming_report_matrices = -1;
5533
5534 static gint ett_vht_grpidmgmt = -1;
5535 static gint ett_vht_msa = -1;
5536 static gint ett_vht_upa = -1;
5537
5538 static gint ett_ht_info_delimiter1_tree = -1;
5539 static gint ett_ht_info_delimiter2_tree = -1;
5540 static gint ett_ht_info_delimiter3_tree = -1;
5541
5542 static gint ett_tag_measure_request_mode_tree = -1;
5543 static gint ett_tag_measure_request_type_tree = -1;
5544 static gint ett_tag_measure_report_mode_tree = -1;
5545 static gint ett_tag_measure_report_type_tree = -1;
5546 static gint ett_tag_measure_report_basic_map_tree = -1;
5547 static gint ett_tag_measure_report_rpi_tree = -1;
5548 static gint ett_tag_measure_report_frame_tree = -1;
5549 static gint ett_tag_measure_reported_frame_tree = -1;
5550 static gint ett_tag_bss_bitmask_tree = -1;
5551 static gint ett_tag_dfs_map_tree = -1;
5552 static gint ett_tag_erp_info_tree = -1;
5553 static gint ett_tag_ex_cap1 = -1;
5554 static gint ett_tag_ex_cap2 = -1;
5555 static gint ett_tag_ex_cap3 = -1;
5556 static gint ett_tag_ex_cap4 = -1;
5557 static gint ett_tag_ex_cap5 = -1;
5558 static gint ett_tag_ex_cap6 = -1;
5559 static gint ett_tag_ex_cap7 = -1;
5560 static gint ett_tag_ex_cap8 = -1;
5561 static gint ett_tag_ex_cap89 = -1;
5562 static gint ett_tag_ex_cap10 = -1;
5563
5564 static gint ett_tag_rm_cap1 = -1;
5565 static gint ett_tag_rm_cap2 = -1;
5566 static gint ett_tag_rm_cap3 = -1;
5567 static gint ett_tag_rm_cap4 = -1;
5568 static gint ett_tag_rm_cap5 = -1;
5569
5570 static gint ett_tag_20_40_bc = -1;
5571
5572 static gint ett_tag_tclas_mask_tree = -1;
5573
5574 static gint ett_tag_supported_channels = -1;
5575
5576 static gint ett_tag_neighbor_report_bssid_info_tree = -1;
5577 static gint ett_tag_neighbor_report_bssid_info_capability_tree = -1;
5578 static gint ett_tag_neighbor_report_sub_tag_tree = -1;
5579
5580 static gint ett_tag_wapi_param_set_akm_tree = -1;
5581 static gint ett_tag_wapi_param_set_ucast_tree = -1;
5582 static gint ett_tag_wapi_param_set_mcast_tree = -1;
5583 static gint ett_tag_wapi_param_set_preauth_tree = -1;
5584
5585 static gint ett_tag_time_adv_tree = -1;
5586
5587 static gint ett_ff_ba_param_tree = -1;
5588 static gint ett_ff_ba_ssc_tree = -1;
5589 static gint ett_ff_delba_param_tree = -1;
5590 static gint ett_ff_qos_info = -1;
5591 static gint ett_ff_sm_pwr_save = -1;
5592 static gint ett_ff_psmp_param_set = -1;
5593 static gint ett_ff_mimo_cntrl = -1;
5594 static gint ett_ff_ant_sel = -1;
5595 static gint ett_mimo_report = -1;
5596 static gint ett_ff_chan_switch_announce = -1;
5597 static gint ett_ff_ht_info = -1;
5598 static gint ett_ff_psmp_sta_info = -1;
5599
5600 static gint ett_tpc = -1;
5601
5602 static gint ett_msdu_aggregation_parent_tree = -1;
5603 static gint ett_msdu_aggregation_subframe_tree = -1;
5604
5605 static gint ett_80211_mgt_ie = -1;
5606 static gint ett_tsinfo_tree = -1;
5607 static gint ett_sched_tree = -1;
5608
5609 static gint ett_fcs = -1;
5610
5611 static gint ett_hs20_osu_providers_list = -1;
5612 static gint ett_hs20_osu_provider_tree = -1;
5613 static gint ett_hs20_friendly_names_list = -1;
5614 static gint ett_hs20_friendly_name_tree = -1;
5615 static gint ett_hs20_osu_provider_method_list = -1;
5616 static gint ett_osu_icons_avail_list = -1;
5617 static gint ett_hs20_osu_icon_tree = -1;
5618 static gint ett_hs20_osu_service_desc_list = -1;
5619 static gint ett_hs20_osu_service_desc_tree = -1;
5620 static gint ett_hs20_venue_url = -1;
5621 static gint ett_hs20_advice_of_charge = -1;
5622 static gint ett_hs20_aoc_plan = -1;
5623
5624 static gint ett_hs20_ofn_tree = -1;
5625
5626 static gint ett_adv_proto = -1;
5627 static gint ett_adv_proto_tuple = -1;
5628 static gint ett_gas_query = -1;
5629 static gint ett_gas_anqp = -1;
5630 static gint ett_nai_realm = -1;
5631 static gint ett_nai_realm_eap = -1;
5632 static gint ett_tag_ric_data_desc_ie = -1;
5633 static gint ett_anqp_vendor_capab = -1;
5634
5635 static gint ett_osen_group_data_cipher_suite = -1;
5636 static gint ett_osen_pairwise_cipher_suites = -1;
5637 static gint ett_osen_pairwise_cipher_suite = -1;
5638 static gint ett_osen_akm_cipher_suites = -1;
5639 static gint ett_osen_akm_cipher_suite = -1;
5640 static gint ett_osen_rsn_cap_tree = -1;
5641 static gint ett_osen_pmkid_list = -1;
5642 static gint ett_osen_pmkid_tree = -1;
5643 static gint ett_osen_group_management_cipher_suite = -1;
5644
5645 static gint ett_hs20_cc_proto_port_tuple = -1;
5646
5647 static gint ett_ssid_list = -1;
5648
5649 static gint ett_nintendo = -1;
5650
5651 static gint ett_mikrotik = -1;
5652
5653 static gint ett_meru = -1;
5654
5655 static gint ett_qos_map_set_exception = -1;
5656 static gint ett_qos_map_set_range = -1;
5657
5658 static gint ett_wnm_notif_subelt = -1;
5659
5660 static gint ett_ieee80211_3gpp_plmn = -1;
5661
5662 static expert_field ei_ieee80211_bad_length = EI_INIT;
5663 static expert_field ei_ieee80211_inv_val = EI_INIT;
5664 static expert_field ei_ieee80211_vht_tpe_pwr_info_count = EI_INIT;
5665 static expert_field ei_ieee80211_ff_query_response_length = EI_INIT;
5666 static expert_field ei_ieee80211_ff_anqp_nai_realm_eap_len = EI_INIT;
5667 static expert_field ei_hs20_anqp_nai_hrq_length = EI_INIT;
5668 static expert_field ei_ieee80211_extra_data = EI_INIT;
5669 static expert_field ei_ieee80211_tag_data = EI_INIT;
5670 static expert_field ei_ieee80211_tdls_setup_confirm_malformed = EI_INIT;
5671 static expert_field ei_ieee80211_ff_anqp_nai_field_len = EI_INIT;
5672 static expert_field ei_ieee80211_rsn_pcs_count = EI_INIT;
5673 static expert_field ei_ieee80211_tag_measure_request_unknown = EI_INIT;
5674 static expert_field ei_ieee80211_tag_measure_request_beacon_unknown = EI_INIT;
5675 static expert_field ei_ieee80211_tag_measure_report_unknown = EI_INIT;
5676 static expert_field ei_ieee80211_tag_number = EI_INIT;
5677 static expert_field ei_ieee80211_ff_anqp_info_length = EI_INIT;
5678 static expert_field ei_hs20_anqp_ofn_length = EI_INIT;
5679 static expert_field ei_ieee80211_tdls_setup_response_malformed = EI_INIT;
5680 static expert_field ei_ieee80211_ff_anqp_capability = EI_INIT;
5681 static expert_field ei_ieee80211_not_enough_room_for_anqp_header = EI_INIT;
5682 static expert_field ei_ieee80211_ff_query_request_length = EI_INIT;
5683 static expert_field ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype = EI_INIT;
5684 static expert_field ei_ieee80211_qos_info_bad_ftype = EI_INIT;
5685 static expert_field ei_ieee80211_qos_bad_aifsn = EI_INIT;
5686 static expert_field ei_ieee80211_pmkid_count_too_large = EI_INIT;
5687 static expert_field ei_ieee80211_ff_anqp_venue_length = EI_INIT;
5688 static expert_field ei_ieee80211_ff_anqp_roaming_consortium_oi_len = EI_INIT;
5689 static expert_field ei_ieee80211_tag_length = EI_INIT;
5690 static expert_field ei_ieee80211_missing_data = EI_INIT;
5691 static expert_field ei_ieee80211_rsn_pmkid_count = EI_INIT;
5692 static expert_field ei_ieee80211_fc_retry = EI_INIT;
5693 static expert_field ei_ieee80211_tag_wnm_sleep_mode_no_key_data = EI_INIT;
5694 static expert_field ei_ieee80211_dmg_subtype = EI_INIT;
5695 static expert_field ei_ieee80211_vht_action = EI_INIT;
5696 static expert_field ei_ieee80211_mesh_peering_unexpected = EI_INIT;
5697 static expert_field ei_ieee80211_fcs = EI_INIT;
5698 static expert_field ei_ieee80211_mismatched_akm_suite = EI_INIT;
5699
5700 /* 802.11ad trees */
5701 static gint ett_dynamic_alloc_tree = -1;
5702 static gint ett_ssw_tree = -1;
5703 static gint ett_bf_tree = -1;
5704 static gint ett_sswf_tree = -1;
5705 static gint ett_brp_tree = -1;
5706 static gint ett_blm_tree = -1;
5707 static gint ett_bic_tree = -1;
5708 static gint ett_dmg_params_tree = -1;
5709 static gint ett_cc_tree = -1;
5710 static gint ett_rcsi_tree = -1;
5711 static gint ett_80211_ext = -1;
5712 static gint ett_allocation_tree = -1;
5713 static gint ett_sta_info = -1;
5714
5715 static gint ett_ieee80211_esp = -1;
5716
5717 /* 802.11ax trees */
5718 static gint ett_he_mac_capabilities = -1;
5719 static gint ett_he_phy_capabilities = -1;
5720 static gint ett_he_phy_cap_first_byte = -1;
5721 static gint ett_he_phy_cap_chan_width_set = -1;
5722 static gint ett_he_phy_cap_b8_to_b23 = -1;
5723 static gint ett_he_phy_cap_b24_to_b39 = -1;
5724 static gint ett_he_phy_cap_b40_to_b55 = -1;
5725 static gint ett_he_phy_cap_b56_to_b71 = -1;
5726 static gint ett_he_mcs_and_nss_set = -1;
5727 static gint ett_he_rx_tx_he_mcs_map_lte_80 = -1;
5728 static gint ett_he_rx_mcs_map_lte_80 = -1;
5729 static gint ett_he_tx_mcs_map_lte_80 = -1;
5730 static gint ett_he_rx_tx_he_mcs_map_160 = -1;
5731 static gint ett_he_rx_mcs_map_160 = -1;
5732 static gint ett_he_tx_mcs_map_160 = -1;
5733 static gint ett_he_rx_tx_he_mcs_map_80_80 = -1;
5734 static gint ett_he_rx_mcs_map_80_80 = -1;
5735 static gint ett_he_tx_mcs_map_80_80 = -1;
5736 static gint ett_he_ppe_threshold = -1;
5737 static gint ett_he_ppe_nss = -1;
5738 static gint ett_he_ppe_ru_alloc = -1;
5739 static gint ett_he_uora_tree = -1;
5740 static gint ett_he_spatial_reuse_control = -1;
5741 static gint ett_he_bss_new_color_info = -1;
5742 static gint ett_he_ess_report_info_field = -1;
5743 static gint ett_he_operation_params = -1;
5744 static gint ett_he_oper_basic_mcs = -1;
5745 static gint ett_he_operation_vht_op_info = -1;
5746 static gint ett_he_mu_edca_param = -1;
5747 static gint ett_he_trigger_common_info = -1;
5748 static gint ett_he_trigger_base_common_info = -1;
5749 static gint ett_he_trigger_bar_ctrl = -1;
5750 static gint ett_he_trigger_bar_info = -1;
5751 static gint ett_he_trigger_user_info = -1;
5752 static gint ett_he_trigger_base_user_info = -1;
5753 static gint ett_he_trigger_dep_basic_user_info = -1;
5754 static gint ett_he_trigger_dep_nfrp_user_info = -1;
5755 static gint ett_he_ndp_annc = -1;
5756 static gint ett_he_ndp_annc_sta_list = -1;
5757 static gint ett_he_ndp_annc_sta_item = -1;
5758 static gint ett_he_ndp_annc_sta_info = -1;
5759
5760 static const fragment_items frag_items = {
5761   &ett_fragment,
5762   &ett_fragments,
5763   &hf_ieee80211_fragments,
5764   &hf_ieee80211_fragment,
5765   &hf_ieee80211_fragment_overlap,
5766   &hf_ieee80211_fragment_overlap_conflict,
5767   &hf_ieee80211_fragment_multiple_tails,
5768   &hf_ieee80211_fragment_too_long_fragment,
5769   &hf_ieee80211_fragment_error,
5770   &hf_ieee80211_fragment_count,
5771   &hf_ieee80211_reassembled_in,
5772   &hf_ieee80211_reassembled_length,
5773   /* Reassembled data field */
5774   NULL,
5775   "fragments"
5776 };
5777
5778 static const enum_val_t wlan_ignore_prot_options[] = {
5779   { "no",         "No",               WLAN_IGNORE_PROT_NO    },
5780   { "without_iv", "Yes - without IV", WLAN_IGNORE_PROT_WO_IV },
5781   { "with_iv",    "Yes - with IV",    WLAN_IGNORE_PROT_W_IV  },
5782   { NULL,         NULL,               0                     }
5783 };
5784
5785 static int wlan_address_type = -1;
5786 static int wlan_bssid_address_type = -1;
5787
5788 static const unsigned char bssid_broadcast_data[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
5789 static address bssid_broadcast;
5790 gboolean
5791 is_broadcast_bssid(const address *bssid) {
5792   return addresses_equal(&bssid_broadcast, bssid);
5793 }
5794
5795 static dissector_handle_t ieee80211_handle;
5796 static dissector_handle_t wlan_withoutfcs_handle;
5797 static dissector_handle_t llc_handle;
5798 static dissector_handle_t ipx_handle;
5799 static dissector_handle_t eth_withoutfcs_handle;
5800
5801 static capture_dissector_handle_t llc_cap_handle;
5802 static capture_dissector_handle_t ipx_cap_handle;
5803
5804 static dissector_table_t tagged_field_table;
5805 static dissector_table_t vendor_specific_action_table;
5806 static dissector_table_t wifi_alliance_action_subtype_table;
5807 static dissector_table_t vendor_specific_anqp_info_table;
5808 static dissector_table_t wifi_alliance_anqp_info_table;
5809 static dissector_table_t wifi_alliance_ie_table;
5810 static dissector_table_t wifi_alliance_public_action_table;
5811
5812 static int wlan_tap = -1;
5813
5814 static const value_string access_network_type_vals[] = {
5815   {  0, "Private network" },
5816   {  1, "Private network with guest access" },
5817   {  2, "Chargeable public network" },
5818   {  3, "Free public network" },
5819   {  4, "Personal device network" },
5820   {  5, "Emergency services only network" },
5821   { 14, "Test or experimental" },
5822   { 15, "Wildcard" },
5823   { 0, NULL }
5824 };
5825
5826 static const value_string adv_proto_id_vals[] = {
5827   {  0, "Access Network Query Protocol"},
5828   {  1, "MIH Information Service"},
5829   {  2, "MIH Command and Event Services Capability Discovery"},
5830   {  3, "Emergency Alert System (EAS)"},
5831   {  4, "Location-to-Service Translation Protocol"},
5832   {221, "Vendor Specific"},
5833   {0, NULL}
5834 };
5835
5836 static const value_string timeout_int_types[] = {
5837   {1, "Reassociation deadline interval (TUs)"},
5838   {2, "Key lifetime interval (seconds)"},
5839   {3, "Association Comeback time (TUs)"},
5840   {4, "Time to start (TUs)"},
5841   {0, NULL}
5842 };
5843
5844 static const value_string tdls_action_codes[] = {
5845   {TDLS_SETUP_REQUEST,           "TDLS Setup Request"},
5846   {TDLS_SETUP_RESPONSE,          "TDLS Setup Response"},
5847   {TDLS_SETUP_CONFIRM,           "TDLS Setup Confirm"},
5848   {TDLS_TEARDOWN,                "TDLS Teardown"},
5849   {TDLS_PEER_TRAFFIC_INDICATION, "TDLS Peer Traffic Indication"},
5850   {TDLS_CHANNEL_SWITCH_REQUEST,  "TDLS Channel Switch Request"},
5851   {TDLS_CHANNEL_SWITCH_RESPONSE, "TDLS Channel Switch Response"},
5852   {TDLS_PEER_PSM_REQUEST,        "TDLS Peer PSM Request"},
5853   {TDLS_PEER_PSM_RESPONSE,       "TDLS Peer PSM Response"},
5854   {TDLS_PEER_TRAFFIC_RESPONSE,   "TDLS Peer Traffic Response"},
5855   {TDLS_DISCOVERY_REQUEST,       "TDLS Discovery Request"},
5856   {0, NULL}
5857 };
5858 static value_string_ext tdls_action_codes_ext = VALUE_STRING_EXT_INIT(tdls_action_codes);
5859
5860 static const value_string rm_action_codes[] = {
5861   {RM_ACTION_RADIO_MEASUREMENT_REQUEST,   "Radio Measurement Request"},
5862   {RM_ACTION_RADIO_MEASUREMENT_REPORT,    "Radio Measurement Report"},
5863   {RM_ACTION_LINK_MEASUREMENT_REQUEST,    "Link Measurement Request"},
5864   {RM_ACTION_LINK_MEASUREMENT_REPORT,     "Link Measurement Report"},
5865   {RM_ACTION_NEIGHBOR_REPORT_REQUEST,     "Neighbor Report Request"},
5866   {RM_ACTION_NEIGHBOR_REPORT_RESPONSE,    "Neighbor Report Response"},
5867   {0, NULL}
5868 };
5869 static value_string_ext rm_action_codes_ext = VALUE_STRING_EXT_INIT(rm_action_codes);
5870
5871 static const val64_string number_of_taps_values[] = {
5872   {0x0, "1 tap"},
5873   {0x1, "5 taps"},
5874   {0x2, "15 taps"},
5875   {0x3, "63 taps"},
5876   {0, NULL}
5877 };
5878
5879 DOT11DECRYPT_CONTEXT dot11decrypt_ctx;
5880
5881 #define PSMP_STA_INFO_BROADCAST 0
5882 #define PSMP_STA_INFO_MULTICAST 1
5883 #define PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED 2
5884
5885 #define PSMP_STA_INFO_FLAG_TYPE         0x00000003
5886 #define PSMP_STA_INFO_FLAG_DTT_START    0x00001FFC
5887 #define PSMP_STA_INFO_FLAG_DTT_DURATION 0x001FE000
5888
5889 #define PSMP_STA_INFO_FLAG_STA_ID       0x001FFFE0
5890
5891 #define PSMP_STA_INFO_FLAG_UTT_START    0x0000FFE0
5892 #define PSMP_STA_INFO_FLAG_UTT_DURATION 0x03FF0000
5893
5894 #define PSMP_STA_INFO_FLAG_IA_RESERVED  0xFC000000
5895
5896 static const value_string ff_psmp_sta_info_flags[] = {
5897   { PSMP_STA_INFO_BROADCAST,              "Broadcast"},
5898   { PSMP_STA_INFO_MULTICAST,              "Multicast"},
5899   { PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED, "Individually Addressed"},
5900   {0, NULL}
5901 };
5902
5903 static const char*
5904 wlan_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter)
5905 {
5906     if ((filter == CONV_FT_SRC_ADDRESS) && (conv->src_address.type == wlan_address_type))
5907         return "wlan.sa";
5908
5909     if ((filter == CONV_FT_DST_ADDRESS) && (conv->dst_address.type == wlan_address_type))
5910         return "wlan.da";
5911
5912     if ((filter == CONV_FT_ANY_ADDRESS) && (conv->src_address.type == wlan_address_type))
5913         return "wlan.addr";
5914
5915     return CONV_FILTER_INVALID;
5916 }
5917
5918 static ct_dissector_info_t wlan_ct_dissector_info = {&wlan_conv_get_filter_type};
5919
5920 static int
5921 wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5922 {
5923   conv_hash_t *hash = (conv_hash_t*) pct;
5924   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5925
5926   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);
5927
5928   return 1;
5929 }
5930
5931 static const char*
5932 wlan_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
5933 {
5934   if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == wlan_address_type))
5935     return "wlan.addr";
5936
5937   return CONV_FILTER_INVALID;
5938 }
5939
5940 static hostlist_dissector_info_t wlan_host_dissector_info = {&wlan_host_get_filter_type};
5941
5942 static int
5943 wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5944 {
5945   conv_hash_t *hash = (conv_hash_t*) pit;
5946   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5947
5948   /* Take two "add" passes per packet, adding for each direction, ensures that all
5949   packets are counted properly (even if address is sending to itself)
5950   XXX - this could probably be done more efficiently inside hostlist_table */
5951   add_hostlist_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
5952   add_hostlist_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
5953
5954   return 1;
5955 }
5956
5957 static const char*
5958 wlan_col_filter_str(const address* addr _U_, gboolean is_src)
5959 {
5960   if (is_src)
5961     return "wlan.sa";
5962
5963   return "wlan.da";
5964 }
5965
5966 static const char*
5967 wlan_bssid_col_filter_str(const address* addr _U_, gboolean is_src _U_)
5968 {
5969   return "wlan.bssid";
5970 }
5971
5972
5973 static void
5974 beacon_interval_base_custom(gchar *result, guint32 beacon_interval)
5975 {
5976   double temp_double;
5977
5978   temp_double = (double)beacon_interval;
5979   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double * 1024 / 1000000));
5980 }
5981
5982 static void
5983 allocation_duration_base_custom(gchar *result, guint32 allocation_duration)
5984 {
5985   double temp_double;
5986
5987   temp_double = (double)allocation_duration;
5988   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double / 1000000));
5989 }
5990
5991 static void
5992 extra_one_base_custom(gchar *result, guint32 value)
5993 {
5994   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1);
5995 }
5996
5997 static void
5998 extra_one_mul_two_base_custom(gchar *result, guint32 value)
5999 {
6000   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", (value+1)*2);
6001 }
6002
6003 /* ************************************************************************* */
6004 /* Mesh Control field helper functions
6005  *
6006  * Per IEEE 802.11s Draft 12.0 section 7.2.2.1:
6007  *
6008  * The frame body consists of either:
6009  * The MSDU (or a fragment thereof), the Mesh Control field (if and only if the
6010  * frame is transmitted by a mesh STA and the Mesh Control Present subfield of
6011  * the QoS Control field is 1)...
6012  *
6013  * 8.2.4.5.1 "QoS Control field structure", table 8-4, in 802.11-2012,
6014  * seems to indicate that the bit that means "Mesh Control Present" in
6015  * frames sent by mesh STAs in a mesh BSS is part of the TXOP Limit field,
6016  * the AP PS Buffer State field, the TXOP Duration Requested field, or the
6017  * Queue Size field in some data frames in non-mesh BSSes.
6018  *
6019  * We need a statefull sniffer for that.  For now, use heuristics.
6020  *
6021  * Notably, only mesh data frames contain the Mesh Control field in the header.
6022  * Other frames that contain mesh control (i.e., multihop action frames) have
6023  * it deeper in the frame body where it can be definitively identified.
6024  * Further, mesh data frames always have to-ds and from-ds either 11 or 01.  We
6025  * use these facts to make our heuristics more reliable.
6026  * ************************************************************************* */
6027 static int
6028 has_mesh_control(guint16 fcf, guint16 qos_ctl, guint8 mesh_flags)
6029 {
6030   /* assume mesh control present if the QOS field's Mesh Control Present bit is
6031    * set, all reserved bits in the mesh_flags field are zero, and the address
6032    * extension mode is not a reserved value.
6033    */
6034   return (((FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) || (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2)) &&
6035           (QOS_MESH_CONTROL_PRESENT(qos_ctl)) &&
6036           ((mesh_flags & ~MESH_FLAGS_ADDRESS_EXTENSION) == 0) &&
6037           ((mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION) != MESH_FLAGS_ADDRESS_EXTENSION));
6038 }
6039
6040 static int
6041 find_mesh_control_length(guint8 mesh_flags)
6042 {
6043   return 6 + 6*(mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION);
6044 }
6045
6046 static mimo_control_t
6047 get_mimo_control(tvbuff_t *tvb, int offset)
6048 {
6049   guint16        mimo;
6050   mimo_control_t output;
6051
6052   mimo = tvb_get_letohs(tvb, offset);
6053
6054   output.nc = (mimo & 0x0003) + 1;
6055   output.nr = ((mimo & 0x000C) >> 2) + 1;
6056   output.chan_width = (mimo & 0x0010) >> 4;
6057   output.coefficient_size = 4; /* XXX - Is this a good default? */
6058
6059   switch ((mimo & 0x0060) >> 5)
6060     {
6061       case 0:
6062         output.grouping = 1;
6063         break;
6064
6065       case 1:
6066         output.grouping = 2;
6067         break;
6068
6069       case 2:
6070         output.grouping = 4;
6071         break;
6072
6073       default:
6074         output.grouping = 1;
6075         break;
6076     }
6077
6078   switch ((mimo & 0x0180) >> 7)
6079     {
6080       case 0:
6081         output.coefficient_size = 4;
6082         break;
6083
6084       case 1:
6085         output.coefficient_size = 5;
6086         break;
6087
6088       case 2:
6089         output.coefficient_size = 6;
6090         break;
6091
6092       case 3:
6093         output.coefficient_size = 8;
6094         break;
6095     }
6096
6097   output.codebook_info = (mimo & 0x0600) >> 9;
6098   output.remaining_matrix_segment = (mimo & 0x3800) >> 11;
6099
6100   return output;
6101 }
6102
6103 static int
6104 get_mimo_na(guint8 nr, guint8 nc)
6105 {
6106   if ((nr == 2) && (nc == 1)) {
6107     return 2;
6108   } else if ((nr == 2) && (nc == 2)) {
6109     return 2;
6110   } else if ((nr == 3) && (nc == 1)) {
6111     return 4;
6112   } else if ((nr == 3) && (nc == 2)) {
6113     return 6;
6114   } else if ((nr == 3) && (nc == 3)) {
6115     return 6;
6116   } else if ((nr == 4) && (nc == 1)) {
6117     return 6;
6118   } else if ((nr == 4) && (nc == 2)) {
6119     return 10;
6120   } else if ((nr == 4) && (nc == 3)) {
6121     return 12;
6122   } else if ((nr == 4) && (nc == 4)) {
6123     return 12;
6124   } else{
6125     return 0;
6126   }
6127 }
6128
6129 static int
6130 get_mimo_ns(gboolean chan_width, guint8 output_grouping)
6131 {
6132   int ns = 0;
6133
6134   if (chan_width)
6135   {
6136     switch (output_grouping)
6137       {
6138         case 1:
6139           ns = 114;
6140           break;
6141
6142           case 2:
6143             ns = 58;
6144             break;
6145
6146           case 4:
6147             ns = 30;
6148             break;
6149
6150           default:
6151             ns = 0;
6152       }
6153   } else {
6154     switch (output_grouping)
6155       {
6156         case 1:
6157           ns = 56;
6158           break;
6159
6160         case 2:
6161           ns = 30;
6162           break;
6163
6164         case 4:
6165           ns = 16;
6166           break;
6167
6168         default:
6169           ns = 0;
6170       }
6171   }
6172
6173   return ns;
6174 }
6175
6176 static int
6177 add_mimo_csi_matrices_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
6178 {
6179   proto_tree *snr_tree;
6180   int         csi_matrix_size, start_offset;
6181   int         ns, i;
6182
6183   start_offset = offset;
6184   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
6185                         ett_mimo_report, NULL, "Signal to Noise Ratio");
6186
6187   for (i = 1; i <= mimo_cntrl.nr; i++)
6188   {
6189     guint8 snr;
6190
6191     snr = tvb_get_guint8(tvb, offset);
6192     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
6193                                snr, "Channel %d - Signal to Noise Ratio: 0x%02X", i, snr);
6194     offset += 1;
6195   }
6196
6197   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6198   csi_matrix_size = ns*(3+(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size));
6199   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6200   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6201   offset += csi_matrix_size;
6202   return offset - start_offset;
6203 }
6204
6205 static int
6206 add_mimo_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
6207 {
6208   proto_tree *snr_tree;
6209   int         csi_matrix_size, start_offset;
6210   int         ns, i;
6211
6212   start_offset = offset;
6213   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc, ett_mimo_report, NULL, "Signal to Noise Ratio");
6214
6215   for (i = 1; i <= mimo_cntrl.nc; i++)
6216   {
6217     guint8 snr;
6218
6219     snr = tvb_get_guint8(tvb, offset);
6220     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
6221                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
6222     offset += 1;
6223   }
6224
6225   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6226   csi_matrix_size = ns*(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size);
6227   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6228   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_bf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6229   offset += csi_matrix_size;
6230   return offset - start_offset;
6231 }
6232
6233 static int
6234 add_mimo_compressed_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
6235 {
6236   proto_tree *snr_tree;
6237   int         csi_matrix_size, start_offset;
6238   int         ns, na, i;
6239
6240   start_offset = offset;
6241   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
6242                         ett_mimo_report, NULL, "Signal to Noise Ratio");
6243
6244   for (i = 1; i <= mimo_cntrl.nc; i++)
6245   {
6246     gint8 snr;
6247     char edge_sign;
6248
6249     snr = tvb_get_gint8(tvb, offset);
6250
6251     switch(snr) {
6252       case -128:
6253         edge_sign = '<';
6254         break;
6255       case 127:
6256         edge_sign = '>';
6257         break;
6258       default:
6259         edge_sign = ' ';
6260         break;
6261     }
6262     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
6263                                snr, "Stream %d - Signal to Noise Ratio: %c%3.2fdB", i, edge_sign,snr/4.0+22.0);
6264     offset += 1;
6265   }
6266
6267   na = get_mimo_na(mimo_cntrl.nr, mimo_cntrl.nc);
6268   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6269   csi_matrix_size = ns*(na*((mimo_cntrl.codebook_info+1)*2 + 2)/2);
6270   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6271   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_cbf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6272   offset += csi_matrix_size;
6273   return offset - start_offset;
6274 }
6275
6276 static void
6277 mesh_active_window_base_custom(gchar *result, guint32 mesh_active_window)
6278 {
6279   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (mesh_active_window * 1024.0 / 1000000));
6280 }
6281
6282 /* ************************************************************************* */
6283 /*          This is the capture function used to update packet counts        */
6284 /* ************************************************************************* */
6285 static gboolean
6286 capture_ieee80211_common(const guchar * pd, int offset, int len,
6287                           capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_, gboolean datapad)
6288 {
6289   guint16 fcf, hdr_length;
6290
6291   if (!BYTES_ARE_IN_FRAME(offset, len, 2))
6292     return FALSE;
6293
6294   fcf = pletoh16(&pd[offset]);
6295
6296   if (IS_PROTECTED(FCF_FLAGS(fcf)) && (wlan_ignore_prot == WLAN_IGNORE_PROT_NO))
6297     return FALSE;
6298
6299   switch (COMPOSE_FRAME_TYPE (fcf)) {
6300
6301     case DATA:
6302     case DATA_CF_ACK:
6303     case DATA_CF_POLL:
6304     case DATA_CF_ACK_POLL:
6305     case DATA_QOS_DATA:
6306     case DATA_QOS_DATA_CF_ACK:
6307     case DATA_QOS_DATA_CF_POLL:
6308     case DATA_QOS_DATA_CF_ACK_POLL:
6309     {
6310       /* These are data frames that actually contain *data*. */
6311       hdr_length = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
6312
6313       if (DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
6314         /* QoS frame, so the header includes a QoS field */
6315         guint16 qosoff;  /* Offset of the 2-byte QoS field */
6316         guint8 mesh_flags;
6317
6318         qosoff = hdr_length;
6319         hdr_length += 2; /* Include the QoS field in the header length */
6320
6321         if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
6322           /* Frame has a 4-byte HT Control field */
6323           hdr_length += 4;
6324         }
6325
6326         /*
6327          * Does it look as if we have a mesh header?
6328          * Look at the Mesh Control subfield of the QoS field and at the
6329          * purported mesh flag fields.
6330          */
6331         if (!BYTES_ARE_IN_FRAME(offset, hdr_length, 1))
6332           return FALSE;
6333
6334         mesh_flags = pd[hdr_length];
6335         if (has_mesh_control(fcf, pletoh16(&pd[qosoff]), mesh_flags)) {
6336           /* Yes, add the length of that in as well. */
6337           hdr_length += find_mesh_control_length(mesh_flags);
6338         }
6339
6340         if (datapad) {
6341           /*
6342            * Include the padding between the 802.11 header and the body,
6343            * as "helpfully" provided by some Atheros adapters.
6344            *
6345            * XXX - would the mesh header be part of the header or the body
6346            * from the point of view of the Atheros adapters that insert
6347            * the padding, assuming they even recognize a mesh header?
6348            */
6349           hdr_length = roundup2(hdr_length, 4);
6350         }
6351       }
6352       /* I guess some bridges take Netware Ethernet_802_3 frames,
6353          which are 802.3 frames (with a length field rather than
6354          a type field, but with no 802.2 header in the payload),
6355          and just stick the payload into an 802.11 frame.  I've seen
6356          captures that show frames of that sort.
6357
6358          We also handle some odd form of encapsulation in which a
6359          complete Ethernet frame is encapsulated within an 802.11
6360          data frame, with no 802.2 header.  This has been seen
6361          from some hardware.
6362
6363          On top of that, at least at some point it appeared that
6364          the OLPC XO sent out frames with two bytes of 0 between
6365          the "end" of the 802.11 header and the beginning of
6366          the payload.
6367
6368          So, if the packet doesn't start with 0xaa 0xaa:
6369
6370            we first use the same scheme that linux-wlan-ng does to detect
6371            those encapsulated Ethernet frames, namely looking to see whether
6372            the frame either starts with 6 octets that match the destination
6373            address from the 802.11 header or has 6 octets that match the
6374            source address from the 802.11 header following the first 6 octets,
6375            and, if so, treat it as an encapsulated Ethernet frame;
6376
6377            otherwise, we use the same scheme that we use in the Ethernet
6378            dissector to recognize Netware 802.3 frames, namely checking
6379            whether the packet starts with 0xff 0xff and, if so, treat it
6380            as an encapsulated IPX frame, and then check whether the
6381            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
6382            frame. */
6383       if (!BYTES_ARE_IN_FRAME(offset+hdr_length, len, 2))
6384         return FALSE;
6385
6386       if ((pd[offset+hdr_length] != 0xaa) && (pd[offset+hdr_length+1] != 0xaa)) {
6387 #if 0
6388         /* XXX - this requires us to parse the header to find the source
6389            and destination addresses. */
6390         if (BYTES_ARE_IN_FRAME(offset+hdr_length, len, 12)) {
6391           /* We have two MAC addresses after the header. */
6392           if ((memcmp(&pd[offset+hdr_length+6], pinfo->dl_src.data, 6) == 0) ||
6393               (memcmp(&pd[offset+hdr_length+6], pinfo->dl_dst.data, 6) == 0)) {
6394             return capture_eth (pd, offset + hdr_length, len, cpinfo, pseudo_header);
6395           }
6396         }
6397 #endif
6398         if ((pd[offset+hdr_length] == 0xff) && (pd[offset+hdr_length+1] == 0xff))
6399           return call_capture_dissector (ipx_cap_handle, pd, offset+hdr_length, len, cpinfo, pseudo_header);
6400         else if ((pd[offset+hdr_length] == 0x00) && (pd[offset+hdr_length+1] == 0x00))
6401           return call_capture_dissector (llc_cap_handle, pd, offset + hdr_length + 2, len, cpinfo, pseudo_header);
6402       }
6403       else {
6404         return call_capture_dissector (llc_cap_handle, pd, offset + hdr_length, len, cpinfo, pseudo_header);
6405       }
6406       break;
6407     }
6408   }
6409
6410   return FALSE;
6411 }
6412
6413 /*
6414  * Handle 802.11 with a variable-length link-layer header.
6415  */
6416 static gboolean
6417 capture_ieee80211(const guchar * pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
6418 {
6419   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, FALSE);
6420 }
6421
6422 /*
6423  * Handle 802.11 with a variable-length link-layer header and data padding.
6424  */
6425 static gboolean
6426 capture_ieee80211_datapad(const guchar * pd, int offset, int len,
6427                            capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
6428 {
6429   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, TRUE);
6430 }
6431
6432
6433 /* ************************************************************************* */
6434 /*          Add the subtree used to store the fixed parameters               */
6435 /* ************************************************************************* */
6436 static proto_tree *
6437 get_fixed_parameter_tree(proto_tree * tree, tvbuff_t *tvb, int start, int size)
6438 {
6439   proto_item *fixed_fields;
6440
6441   fixed_fields = proto_tree_add_item(tree, hf_ieee80211_fixed_parameters, tvb, start, size, ENC_NA);
6442   proto_item_append_text(fixed_fields, " (%d bytes)", size);
6443
6444   return proto_item_add_subtree(fixed_fields, ett_fixed_parameters);
6445 }
6446
6447
6448 /* ************************************************************************* */
6449 /*            Add the subtree used to store tagged parameters                */
6450 /* ************************************************************************* */
6451 static proto_tree *
6452 get_tagged_parameter_tree(proto_tree * tree, tvbuff_t *tvb, int start, int size)
6453 {
6454   proto_item *tagged_fields;
6455
6456   tagged_fields = proto_tree_add_item(tree, hf_ieee80211_tagged_parameters, tvb, start, -1, ENC_NA);
6457   proto_item_append_text(tagged_fields, " (%d bytes)", size);
6458
6459   return proto_item_add_subtree(tagged_fields, ett_tagged_parameters);
6460 }
6461
6462
6463 static int
6464 dissect_vendor_action_marvell(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
6465 {
6466   guint8 octet;
6467   int offset = 0;
6468
6469   octet = tvb_get_guint8(tvb, offset);
6470   proto_tree_add_item(tree, hf_ieee80211_ff_marvell_action_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6471   offset += 1;
6472   switch (octet)
6473     {
6474       case MRVL_ACTION_MESH_MANAGEMENT:
6475         octet = tvb_get_guint8(tvb, offset);
6476         proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6477         offset += 1;
6478         switch (octet)
6479           {
6480             case MRVL_MESH_MGMT_ACTION_RREQ:
6481               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6482               offset += 1;
6483               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6484               offset += 1;
6485               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6486               offset += 1;
6487               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6488               offset += 1;
6489               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_rreqid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6490               offset += 4;
6491               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
6492               offset += 6;
6493               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6494               offset += 4;
6495               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6496               offset += 4;
6497               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6498               offset += 4;
6499               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6500               offset += 1;
6501               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6502               offset += 1;
6503               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6504               offset += 6;
6505               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6506               offset += 4;
6507               break;
6508             case MRVL_MESH_MGMT_ACTION_RREP:
6509               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6510               offset += 1;
6511               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6512               offset += 1;
6513               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6514               offset += 1;
6515               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6516               offset += 1;
6517               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6518               offset += 6;
6519               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6520               offset += 4;
6521               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6522               offset += 4;
6523               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6524               offset += 4;
6525               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
6526               offset += 6;
6527               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6528               offset += 4;
6529               break;
6530             case MRVL_MESH_MGMT_ACTION_RERR:
6531               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6532               offset += 1;
6533               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6534               offset += 1;
6535               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6536               offset += 1;
6537               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6538               offset += 6;
6539               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6540               offset += 4;
6541               break;
6542             default:
6543               break;
6544           }
6545         break;
6546       default:
6547         break;
6548     }
6549
6550   return offset;
6551 }
6552
6553 static int
6554 dissect_vendor_action_wifi_alliance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
6555 {
6556   guint8 subtype;
6557   int offset = 0;
6558   int dissected;
6559   tvbuff_t *subtvb;
6560
6561   subtype = tvb_get_guint8(tvb, offset);
6562   proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
6563   offset += 1;
6564
6565   subtvb = tvb_new_subset_remaining(tvb, offset);
6566   dissected = dissector_try_uint_new(wifi_alliance_action_subtype_table, subtype, subtvb, pinfo, tree, FALSE, NULL);
6567   if (dissected <= 0)
6568   {
6569       call_data_dissector(subtvb, pinfo, tree);
6570       dissected = tvb_reported_length(subtvb);
6571   }
6572
6573   offset += dissected;
6574
6575   return offset;
6576 }
6577
6578 /*
6579  * This function is called from two different places. In one case it is called
6580  * without the tag and length. In other cases, it is called with those and
6581  * is asked to return the type and subtype. We know the difference because
6582  * type and subtype will be NULL in the first case.
6583  */
6584 static guint
6585 dissect_advertisement_protocol_common(packet_info *pinfo, proto_tree *tree,
6586                                tvbuff_t *tvb, int offset, guint *type,
6587                                guint *subtype)
6588 {
6589   guint8      tag_no = 0, tag_len, left;
6590   proto_item *item = NULL, *adv_item;
6591   proto_tree *adv_tree, *adv_tuple_tree;
6592
6593   if (type)
6594     *type = 0xff; // Last reserved value
6595   if (subtype)
6596     *subtype = 0xff;
6597   tag_no = tvb_get_guint8(tvb, offset);
6598   if (type)
6599     item = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6600
6601   /*
6602    * If we have the tag and len, use the len in the tvb, otherwise ask
6603    * for the length of the tvb.
6604    */
6605   if (type)
6606     tag_len = tvb_get_guint8(tvb, offset + 1);
6607   else
6608     tag_len = tvb_reported_length_remaining(tvb, 0);
6609
6610   if (type && tag_no != TAG_ADVERTISEMENT_PROTOCOL) {
6611     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_number,
6612                            "Unexpected IE %d (expected Advertisement "
6613                            "Protocol)", tag_no);
6614     return 2 + tag_len;
6615   }
6616   if (type)
6617     item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
6618   if (tag_len < 2) {
6619     if (!type)
6620       item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
6621     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
6622                            "Advertisement Protocol: IE must be at least 2 "
6623                            "octets long");
6624     return 2 + tag_len;
6625   }
6626
6627   left = tag_len;
6628   if (type) /* Skip past the header if there ... */
6629     offset += 2;
6630   adv_tree = proto_tree_add_subtree(tree, tvb, offset, left,
6631                                  ett_adv_proto, &adv_item, "Advertisement Protocol element");
6632
6633   while (left >= 2) {
6634     guint8 id;
6635
6636     id = tvb_get_guint8(tvb, offset + 1);
6637     if (id == 0)
6638       proto_item_append_text(adv_item, ": ANQP");
6639     adv_tuple_tree = proto_tree_add_subtree_format(adv_tree, tvb, offset, 2, ett_adv_proto_tuple, &item,
6640                                "Advertisement Protocol Tuple: %s",
6641                                val_to_str(id, adv_proto_id_vals,
6642                                           "Unknown (%d)"));
6643
6644     proto_tree_add_item(adv_tuple_tree,
6645                         hf_ieee80211_tag_adv_proto_resp_len_limit, tvb,
6646                         offset, 1, ENC_LITTLE_ENDIAN);
6647     proto_tree_add_item(adv_tuple_tree,
6648                         hf_ieee80211_tag_adv_proto_pame_bi, tvb,
6649                         offset, 1, ENC_LITTLE_ENDIAN);
6650     offset += 1;
6651     left--;
6652     proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_proto_id, tvb,
6653                         offset, 1, ENC_LITTLE_ENDIAN);
6654     offset += 1;
6655     left--;
6656
6657     if ((id == 0) && type)
6658       *type = ADV_PROTO_ID_ANQP;
6659
6660     if (id == 221) {
6661       /* Vendor specific */
6662       guint8 len = tvb_get_guint8(tvb, offset);
6663       guint oui;
6664       guint8 wfa_subtype;
6665       proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_vs_len, tvb, offset, 1, ENC_NA);
6666       offset += 1;
6667       left   -= 1;
6668       if (type)
6669         *type = ADV_PROTO_ID_VS;
6670       if (len > left) {
6671         expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
6672                                "Vendor specific info length error");
6673         return 2 + tag_len;
6674       }
6675       proto_tree_add_item_ret_uint(adv_tuple_tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
6676       offset += 3;
6677       left   -= 3;
6678       wfa_subtype = tvb_get_guint8(tvb, offset);
6679       proto_tree_add_item(adv_tuple_tree, hf_ieee80211_anqp_wfa_subtype, tvb,
6680                         offset, 1, ENC_NA);
6681       offset += 1;
6682       left   -= 1;
6683       if (oui == OUI_WFA) {
6684         proto_tree_add_item(adv_tuple_tree, hf_ieee80211_dpp_subtype, tvb, offset, 1, ENC_NA);
6685         if (subtype && wfa_subtype == WFA_SUBTYPE_DPP) {
6686           *subtype = WFA_SUBTYPE_DPP;
6687           *subtype |= (tvb_get_guint8(tvb, offset) << 8);
6688         }
6689         offset++;
6690         left--;
6691       }
6692     }
6693   }
6694
6695   if (left) {
6696     expert_add_info_format(pinfo, item, &ei_ieee80211_extra_data,
6697                            "Unexpected extra data in the end");
6698   }
6699
6700   return 2 + tag_len;
6701 }
6702
6703 static int
6704 dissect_advertisement_protocol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
6705 {
6706   return dissect_advertisement_protocol_common(pinfo, tree, tvb, 0, NULL, NULL);
6707 }
6708
6709 static void
6710 dissect_anqp_query_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6711 {
6712   while (offset + 2 <= end) {
6713     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_query_id,
6714                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6715     offset += 2;
6716   }
6717   if (offset != end) {
6718     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
6719                            "Unexpected ANQP Query list format");
6720   }
6721 }
6722
6723 static void
6724 dissect_hs20_anqp_hs_capability_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6725 {
6726   while (offset < end) {
6727     proto_tree_add_item(tree, hf_hs20_anqp_hs_capability_list,
6728                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6729     offset++;
6730   }
6731 }
6732
6733 static void
6734 dissect_anqp_capab_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6735 {
6736   guint16     id, len;
6737   proto_item *item;
6738   proto_tree *vtree;
6739   guint32     oui;
6740   guint8      subtype;
6741
6742   while (offset + 2 <= end) {
6743     id = tvb_get_letohs(tvb, offset);
6744     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_capability,
6745                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6746     offset += 2;
6747     if (id == ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
6748       vtree = proto_item_add_subtree(item, ett_anqp_vendor_capab);
6749       len = tvb_get_letohs(tvb, offset);
6750       proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vlen,
6751                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
6752       offset += 2;
6753       if ((len < 3) || ((offset + len) > end)) {
6754         expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_capability);
6755         return;
6756       }
6757       proto_tree_add_item_ret_uint(vtree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
6758       offset += 3;
6759       len    -= 3;
6760
6761       switch (oui) {
6762       case OUI_WFA:
6763         if (len == 0)
6764           break;
6765         subtype = tvb_get_guint8(tvb, offset);
6766         proto_item_append_text(vtree, " - WFA - %s",
6767                                val_to_str(subtype, wfa_subtype_vals,
6768                                           "Unknown (%u)"));
6769         proto_tree_add_item(vtree, hf_ieee80211_anqp_wfa_subtype,
6770                             tvb, offset, 1, ENC_NA);
6771         offset++;
6772         len--;
6773         switch (subtype) {
6774         case WFA_SUBTYPE_HS20_ANQP:
6775           dissect_hs20_anqp_hs_capability_list(vtree, tvb, offset, end);
6776           break;
6777         default:
6778           proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
6779                               tvb, offset, len, ENC_NA);
6780           break;
6781         }
6782         break;
6783       default:
6784         proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
6785                             tvb, offset, len, ENC_NA);
6786         break;
6787       }
6788
6789       offset += len;
6790     }
6791   }
6792   if (offset != end) {
6793     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
6794                            "Unexpected ANQP Capability list format");
6795   }
6796 }
6797
6798 static const value_string venue_group_vals[] = {
6799   {  0, "Unspecified" },
6800   {  1, "Assembly" },
6801   {  2, "Business" },
6802   {  3, "Educational" },
6803   {  4, "Factory and Industrial" },
6804   {  5, "Institutional" },
6805   {  6, "Mercantile" },
6806   {  7, "Residential" },
6807   {  8, "Storage" },
6808   {  9, "Utility and Miscellaneous" },
6809   { 10, "Vehicular" },
6810   { 11, "Outdoor" },
6811   { 0, NULL }
6812 };
6813 static value_string_ext venue_group_vals_ext = VALUE_STRING_EXT_INIT(venue_group_vals);
6814
6815 static void
6816 dissect_venue_info(proto_tree *tree, tvbuff_t *tvb, int offset)
6817 {
6818   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_group,
6819                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6820   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_type,
6821                       tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
6822 }
6823
6824 static void
6825 dissect_venue_name_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6826 {
6827   proto_item *item;
6828
6829   dissect_venue_info(tree, tvb, offset);
6830   offset += 2;
6831   while (offset + 4 <= end) {
6832     guint8 vlen = tvb_get_guint8(tvb, offset);
6833     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_length,
6834                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6835     offset += 1;
6836     if ((vlen > (end - offset)) || (vlen < 3)) {
6837       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_venue_length);
6838       break;
6839     }
6840     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_language,
6841                         tvb, offset, 3, ENC_ASCII|ENC_NA);
6842     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_name,
6843                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
6844     offset += vlen;
6845   }
6846 }
6847
6848 static const value_string nw_auth_type_vals[] = {
6849   { 0, "Acceptance of terms and conditions" },
6850   { 1, "On-line enrollment supported" },
6851   { 2, "http/https redirection" },
6852   { 3, "DNS redirection" },
6853   { 0, NULL }
6854 };
6855
6856 static void
6857 dissect_network_auth_type(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6858 {
6859   while (offset + 3 <= end) {
6860     guint16 len;
6861     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_indicator,
6862                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6863     offset += 1;
6864     len = tvb_get_letohs(tvb, offset);
6865     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url_len,
6866                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6867     offset += 2;
6868     if (len)
6869       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url,
6870                           tvb, offset, len, ENC_ASCII|ENC_NA);
6871     offset += len;
6872   }
6873 }
6874
6875 static void
6876 add_manuf(proto_item *item, tvbuff_t *tvb, int offset)
6877 {
6878   const gchar *manuf_name;
6879
6880   manuf_name = tvb_get_manuf_name_if_known(tvb, offset);
6881   if (manuf_name == NULL)
6882     return;
6883   proto_item_append_text(item, " - %s", manuf_name);
6884 }
6885
6886 static void
6887 dissect_roaming_consortium_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6888                                 int end)
6889 {
6890   proto_item *item;
6891   guint8      len;
6892
6893   while (offset < end) {
6894     len = tvb_get_guint8(tvb, offset);
6895     item = proto_tree_add_item(tree,
6896                                hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
6897                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6898     offset += 1;
6899     if ((len > (end - offset)) || (len < 3)) {
6900       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_roaming_consortium_oi_len);
6901       break;
6902     }
6903     item = proto_tree_add_item(tree,
6904                                hf_ieee80211_ff_anqp_roaming_consortium_oi,
6905                                tvb, offset, len, ENC_NA);
6906     add_manuf(item, tvb, offset);
6907     offset += len;
6908   }
6909 }
6910
6911 static const value_string ip_addr_avail_ipv6_vals[] = {
6912   { 0, "Address type not available" },
6913   { 1, "Address type available" },
6914   { 2, "Availability of the address type not known" },
6915   { 0, NULL }
6916 };
6917
6918 static const value_string ip_addr_avail_ipv4_vals[] = {
6919   { 0, "Address type not available" },
6920   { 1, "Public IPv4 address available" },
6921   { 2, "Port-restricted IPv4 address available" },
6922   { 3, "Single NATed private IPv4 address available" },
6923   { 4, "Double NATed private IPv4 address available" },
6924   { 5, "Port-restricted IPv4 address and single NATed IPv4 address available" },
6925   { 6, "Port-restricted IPv4 address and double NATed IPv4 address available" },
6926   { 7, "Availability of the address type is not known" },
6927   { 0, NULL }
6928 };
6929
6930 static void
6931 dissect_ip_addr_type_availability_info(proto_tree *tree, tvbuff_t *tvb,
6932                                        int offset)
6933 {
6934   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
6935                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6936   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
6937                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6938 }
6939
6940 static const value_string nai_realm_encoding_vals[] = {
6941   { 0, "Formatted in accordance with RFC 4282" },
6942   { 1, "UTF-8 formatted that is not formatted in accordance with RFC 4282" },
6943   { 0, NULL }
6944 };
6945
6946 static const value_string nai_realm_auth_param_id_vals[] = {
6947   {   1, "Expanded EAP Method" },
6948   {   2, "Non-EAP Inner Authentication Type" },
6949   {   3, "Inner Authentication EAP Method Type" },
6950   {   4, "Expanded Inner EAP Method" },
6951   {   5, "Credential Type" },
6952   {   6, "Tunneled EAP Method Credential Type" },
6953   { 221, "Vendor Specific" },
6954   { 0, NULL }
6955 };
6956
6957 static void
6958 dissect_nai_realm_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6959 {
6960   guint16       count, len;
6961   proto_item   *item, *r_item;
6962   int           f_end, eap_end;
6963   guint8        nai_len, eap_count, eap_len, auth_param_count, auth_param_len;
6964   guint8        auth_param_id;
6965   proto_tree   *realm_tree, *eap_tree;
6966   const guint8 *realm;
6967
6968   count = tvb_get_letohs(tvb, offset);
6969   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nai_realm_count,
6970                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6971   offset += 2;
6972   while (count > 0) {
6973     len = tvb_get_letohs(tvb, offset);
6974     realm_tree = proto_tree_add_subtree(tree, tvb, offset, 2 + len, ett_nai_realm, &r_item, "NAI Realm Data");
6975
6976     item = proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_field_len,
6977                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6978     offset += 2;
6979     if (offset + len > end) {
6980       expert_add_info_format(pinfo, item, &ei_ieee80211_ff_anqp_nai_field_len,
6981                              "Invalid NAI Realm List");
6982       break;
6983     }
6984     f_end = offset + len;
6985     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_encoding,
6986                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6987     offset += 1;
6988     nai_len = tvb_get_guint8(tvb, offset);
6989     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_length,
6990                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6991     offset += 1;
6992     if (offset + nai_len > f_end) {
6993       expert_add_info_format(pinfo, r_item, &ei_ieee80211_ff_anqp_nai_field_len,
6994                              "Invalid NAI Realm Data");
6995       break;
6996     }
6997     proto_tree_add_item_ret_string(realm_tree, hf_ieee80211_ff_anqp_nai_realm,
6998                         tvb, offset, nai_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &realm);
6999     if (realm) {
7000       proto_item_append_text(r_item, " (%s)", realm);
7001     }
7002     offset += nai_len;
7003     eap_count = tvb_get_guint8(tvb, offset);
7004     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_eap_count,
7005                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7006     offset += 1;
7007
7008     while (eap_count > 0) {
7009       eap_len = tvb_get_guint8(tvb, offset);
7010       eap_end = offset + 1 + eap_len;
7011       eap_tree = proto_tree_add_subtree(realm_tree, tvb, offset, 1 + eap_len,
7012                                  ett_nai_realm_eap, NULL, "EAP Method");
7013
7014       item = proto_tree_add_item(eap_tree,
7015                                  hf_ieee80211_ff_anqp_nai_realm_eap_len,
7016                                  tvb, offset, 1, ENC_LITTLE_ENDIAN);
7017       offset += 1;
7018       if (offset + eap_len > f_end) {
7019         expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_nai_realm_eap_len);
7020         break;
7021       }
7022
7023       proto_item_append_text(eap_tree, ": %s",
7024                              val_to_str_ext(tvb_get_guint8(tvb, offset),
7025                                             &eap_type_vals_ext, "Unknown (%d)"));
7026       proto_tree_add_item(eap_tree, hf_ieee80211_ff_anqp_nai_realm_eap_method,
7027                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
7028       offset += 1;
7029       auth_param_count = tvb_get_guint8(tvb, offset);
7030       proto_tree_add_item(eap_tree,
7031                           hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
7032                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
7033       offset += 1;
7034
7035       while (auth_param_count > 0) {
7036         auth_param_id = tvb_get_guint8(tvb, offset);
7037         proto_tree_add_item(eap_tree,
7038                             hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
7039                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
7040         offset += 1;
7041         auth_param_len = tvb_get_guint8(tvb, offset);
7042         proto_tree_add_item(eap_tree,
7043                             hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
7044                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
7045         offset += 1;
7046         item = proto_tree_add_item(
7047           eap_tree, hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
7048           tvb, offset, auth_param_len, ENC_NA);
7049         if ((auth_param_id == 3) && (auth_param_len == 1)) {
7050           guint8 inner_method = tvb_get_guint8(tvb, offset);
7051           const char *str;
7052           str = val_to_str_ext(inner_method, &eap_type_vals_ext, "Unknown (%d)");
7053
7054           proto_item_append_text(eap_tree, " / %s", str);
7055           proto_item_append_text(item, " - %s", str);
7056         }
7057         offset += auth_param_len;
7058
7059         auth_param_count--;
7060       }
7061
7062       offset = eap_end;
7063       eap_count--;
7064     }
7065
7066     offset = f_end;
7067     count--;
7068   }
7069 }
7070
7071 static void
7072 dissect_3gpp_cellular_network_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7073 {
7074   guint8      iei, num, plmn_idx = 0;
7075   proto_item *item;
7076
7077   /* See Annex A of 3GPP TS 24.234 v8.1.0 for description */
7078   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_gud, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7079   offset += 1;
7080   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_udhl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7081   offset += 1;
7082   iei = tvb_get_guint8(tvb, offset);
7083   item = proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_iei, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7084   if (iei == 0)
7085     proto_item_append_text(item, " (PLMN List)");
7086   else
7087     return;
7088   offset += 1;
7089   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_plmn_len, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7090   offset += 1;
7091   num = tvb_get_guint8(tvb, offset);
7092   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_num_plmns, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7093   offset += 1;
7094   while (num > 0) {
7095     proto_item *plmn_item = NULL;
7096     proto_tree *plmn_tree = NULL;
7097     guint plmn_val = 0;
7098
7099     if (tvb_reported_length_remaining(tvb, offset) < 3)
7100       break;
7101     plmn_val = tvb_get_letoh24(tvb, offset);
7102     plmn_item = proto_tree_add_uint_format(tree, hf_ieee80211_3gpp_gc_plmn,
7103                                 tvb, offset, 3, plmn_val, "PLMN %d (0x%x)",
7104                                 plmn_idx++, plmn_val);
7105     plmn_tree = proto_item_add_subtree(plmn_item, ett_ieee80211_3gpp_plmn);
7106     dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, plmn_tree, offset, E212_NONE, TRUE);
7107     num--;
7108     offset += 3;
7109   }
7110 }
7111
7112 static void
7113 dissect_domain_name_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7114 {
7115   guint8 len;
7116
7117   while (offset < end) {
7118     len = tvb_get_guint8(tvb, offset);
7119     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name_len,
7120                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7121     offset += 1;
7122     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name,
7123                         tvb, offset, len, ENC_ASCII|ENC_NA);
7124     offset += len;
7125   }
7126 }
7127
7128 static int
7129 dissect_hs20_subscription_remediation(tvbuff_t *tvb, packet_info *pinfo _U_,
7130   proto_tree *tree, void *data _U_)
7131 {
7132   int offset = 0;
7133   guint8 url_len = tvb_get_guint8(tvb, offset);
7134   proto_item *pi = NULL;
7135
7136   proto_tree_add_item(tree, hf_hs20_subscription_remediation_url_len, tvb, offset,
7137                         1, ENC_NA);
7138   offset++;
7139   if (tvb_reported_length_remaining(tvb, offset) >= url_len) {
7140     pi = proto_tree_add_item(tree, hf_hs20_subscription_remediation_server_url,
7141                         tvb, offset, url_len, ENC_ASCII|ENC_NA);
7142     offset += url_len;
7143     PROTO_ITEM_SET_URL(pi);
7144     proto_tree_add_item(tree, hf_hs20_subscription_remediation_server_method,
7145                         tvb, offset, 1, ENC_NA);
7146     offset++;
7147   }
7148
7149   return offset;
7150 }
7151
7152 static int
7153 dissect_hs20_deauthentication_imminent(tvbuff_t *tvb, packet_info *pinfo _U_,
7154   proto_tree *tree, void *data _U_)
7155 {
7156   int offset = 0;
7157   guint8 url_len = 0;
7158   proto_item *pi = NULL;
7159
7160   proto_tree_add_item(tree, hf_hs20_deauth_reason_code, tvb, offset, 1, ENC_NA);
7161   offset++;
7162
7163   proto_tree_add_item(tree, hf_hs20_reauth_delay, tvb, offset, 2,
7164                         ENC_LITTLE_ENDIAN);
7165   offset += 2;
7166
7167   url_len = tvb_get_guint8(tvb, offset);
7168   proto_tree_add_item(tree, hf_hs20_deauth_reason_url_len, tvb, offset, 1,
7169                         ENC_NA);
7170   offset++;
7171
7172   if (tvb_reported_length_remaining(tvb, offset) >= url_len) {
7173     pi = proto_tree_add_item(tree, hf_hs20_deauth_imminent_reason_url,
7174                         tvb, offset, url_len, ENC_ASCII|ENC_NA);
7175     offset += url_len;
7176     PROTO_ITEM_SET_URL(pi);
7177   }
7178   return offset;
7179 }
7180
7181 #define HS20_ANQP_HS_QUERY_LIST              1
7182 #define HS20_ANQP_HS_CAPABILITY_LIST         2
7183 #define HS20_ANQP_OPERATOR_FRIENDLY_NAME     3
7184 #define HS20_ANQP_WAN_METRICS                4
7185 #define HS20_ANQP_CONNECTION_CAPABILITY      5
7186 #define HS20_ANQP_NAI_HOME_REALM_QUERY       6
7187 #define HS20_ANQP_OPERATING_CLASS_INDICATION 7
7188 #define HS20_ANQP_OSU_PROVIDERS_LIST         8
7189 /* 9 is reserved */
7190 #define HS20_ANQP_ICON_REQUEST               10
7191 #define HS20_ANQP_ICON_BINARY_FILE           11
7192 #define HS20_ANQP_OPERATOR_ICON_METADATA     12
7193 #define HS20_ANQP_ADVICE_OF_CHARGE           13
7194
7195 static const value_string hs20_anqp_subtype_vals[] = {
7196   { HS20_ANQP_HS_QUERY_LIST, "HS Query list" },
7197   { HS20_ANQP_HS_CAPABILITY_LIST, "HS Capability List" },
7198   { HS20_ANQP_OPERATOR_FRIENDLY_NAME, "Operator Friendly Name" },
7199   { HS20_ANQP_WAN_METRICS, "WAN Metrics" },
7200   { HS20_ANQP_CONNECTION_CAPABILITY, "Connection Capability" },
7201   { HS20_ANQP_NAI_HOME_REALM_QUERY, "NAI Home Realm Query" },
7202   { HS20_ANQP_OPERATING_CLASS_INDICATION, "Operating Class Indication" },
7203   { HS20_ANQP_OSU_PROVIDERS_LIST, "OSU Providers List" },
7204   { HS20_ANQP_ICON_REQUEST, "Icon Request" },
7205   { HS20_ANQP_ICON_BINARY_FILE, "Icon Binary File" },
7206   { HS20_ANQP_OPERATOR_ICON_METADATA, "Operator Icon Metadata" },
7207   { HS20_ANQP_ADVICE_OF_CHARGE, "Advice of Charge" },
7208   { 0, NULL }
7209 };
7210
7211 static void
7212 dissect_hs20_anqp_hs_query_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7213 {
7214   while (offset < end) {
7215     proto_tree_add_item(tree, hf_hs20_anqp_hs_query_list,
7216                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7217     offset++;
7218   }
7219 }
7220
7221 static void
7222 dissect_hs20_anqp_operator_friendly_name(proto_tree *tree, tvbuff_t *tvb,
7223                                          packet_info *pinfo, int offset,
7224                                          int end, int hf_array[],
7225                                          gint ett_val)
7226 {
7227   int ofn_index = 0;
7228
7229   while (offset + 4 <= end) {
7230     guint8 vlen = tvb_get_guint8(tvb, offset);
7231     proto_tree *ofn_tree = NULL;
7232     proto_item *item = NULL, *pi = NULL;
7233     int start_offset = offset;
7234
7235     ofn_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_val,
7236                                         &pi, "Friendly Name %d", ofn_index);
7237
7238     item = proto_tree_add_item(ofn_tree, hf_array[0],
7239                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
7240     offset++;
7241     if (vlen > end - offset || vlen < 3) {
7242       expert_add_info(pinfo, item, &ei_hs20_anqp_ofn_length);
7243       break;
7244     }
7245     proto_tree_add_item(tree, hf_array[1],
7246                         tvb, offset, 3, ENC_ASCII|ENC_NA);
7247     proto_tree_add_item(tree, hf_array[2],
7248                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
7249     offset += vlen;
7250
7251     proto_item_set_len(pi, offset - start_offset);
7252     ofn_index++;
7253   }
7254 }
7255
7256 static const value_string hs20_wm_link_status_vals[] = {
7257   { 0, "Reserved" },
7258   { 1, "Link up" },
7259   { 2, "Link down" },
7260   { 3, "Link in test state" },
7261   { 0, NULL }
7262 };
7263
7264 static void
7265 dissect_hs20_anqp_wan_metrics(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean request)
7266 {
7267   if (request)
7268     return;
7269
7270   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_link_status,
7271                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7272   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_symmetric_link,
7273                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7274   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_at_capacity,
7275                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7276   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_reserved,
7277                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7278   offset++;
7279
7280   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_speed,
7281                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
7282   offset += 4;
7283
7284   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_speed,
7285                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
7286   offset += 4;
7287
7288   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_load,
7289                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7290   offset++;
7291
7292   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_load,
7293                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7294   offset++;
7295
7296   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_lmd,
7297                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7298 }
7299
7300 static const value_string hs20_cc_status_vals[] = {
7301   { 0, "Closed" },
7302   { 1, "Open" },
7303   { 2, "Unknown" },
7304   { 0, NULL }
7305 };
7306
7307 static void
7308 dissect_hs20_anqp_connection_capability(proto_tree *tree, tvbuff_t *tvb,
7309                                         int offset, int end)
7310 {
7311   proto_tree *tuple;
7312   while (offset + 4 <= end) {
7313     guint8 ip_proto, status;
7314     guint16 port_num;
7315
7316     ip_proto = tvb_get_guint8(tvb, offset);
7317     port_num = tvb_get_letohs(tvb, offset + 1);
7318     status = tvb_get_guint8(tvb, offset + 3);
7319
7320     tuple = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_hs20_cc_proto_port_tuple, NULL,
7321                                "ProtoPort Tuple - ip_proto=%u port_num=%u status=%s",
7322                                ip_proto, port_num,
7323                                val_to_str(status, hs20_cc_status_vals,
7324                                           "Reserved (%u)"));
7325     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_ip_proto,
7326                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7327     offset++;
7328     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_port_num,
7329                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
7330     offset += 2;
7331     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_status,
7332                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7333     offset++;
7334   }
7335 }
7336
7337 static void
7338 dissect_hs20_anqp_nai_home_realm_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
7339                                        int offset, int end)
7340 {
7341   guint8 len;
7342   proto_item *item;
7343
7344   proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_count,
7345                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7346   offset++;
7347
7348   while (offset + 2 <= end) {
7349     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_encoding_type,
7350                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7351     offset++;
7352     len = tvb_get_guint8(tvb, offset);
7353     item = proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_length,
7354                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
7355     offset++;
7356     if (offset + len > end) {
7357       expert_add_info(pinfo, item, &ei_hs20_anqp_nai_hrq_length);
7358       break;
7359     }
7360     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_realm_name,
7361                         tvb, offset, len, ENC_ASCII|ENC_NA);
7362     offset += len;
7363   }
7364 }
7365
7366 static void
7367 dissect_hs20_anqp_oper_class_indic(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7368 {
7369   while (offset < end) {
7370     proto_tree_add_item(tree, hf_hs20_anqp_oper_class_indic,
7371                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7372     offset++;
7373   }
7374 }
7375
7376 static int
7377 dissect_hs20_osu_friendly_names(proto_tree *tree, tvbuff_t *tvb,
7378   packet_info *pinfo, int offset, int end _U_)
7379 {
7380   int osu_fn_hf_array[3] = {hf_hs20_osu_friendly_name_length,
7381                             hf_hs20_osu_friendly_name_language,
7382                             hf_hs20_osu_friendly_name_name };
7383   guint16 osu_fn_count = tvb_get_letohs(tvb, offset);
7384   proto_tree *fn_tree = NULL;
7385
7386   proto_tree_add_item(tree, hf_hs20_osu_friendly_names_len, tvb, offset, 2,
7387                         ENC_LITTLE_ENDIAN);
7388   offset += 2;
7389
7390   fn_tree = proto_tree_add_subtree(tree, tvb, offset, osu_fn_count,
7391                         ett_hs20_friendly_names_list, NULL,
7392                         "Friendly Names List");
7393
7394   dissect_hs20_anqp_operator_friendly_name(fn_tree, tvb, pinfo, offset,
7395                         offset + osu_fn_count,
7396                         osu_fn_hf_array, ett_hs20_friendly_name_tree);
7397
7398   return offset + osu_fn_count;
7399 }
7400
7401 static int
7402 dissect_hs20_osu_icon_available(proto_tree *tree, tvbuff_t *tvb,
7403   packet_info *pinfo _U_, int offset, int end _U_, guint16 icon_index)
7404 {
7405   proto_tree *icon_avail = NULL;
7406   proto_item *pi = NULL;
7407   int start_offset = offset;
7408   guint8 icon_type_len = 0, icon_filename_len = 0;
7409
7410   icon_avail = proto_tree_add_subtree_format(tree, tvb, offset, -1,
7411                         ett_hs20_osu_icon_tree, &pi,
7412                         "Icon Available %d", icon_index);
7413
7414   proto_tree_add_item(icon_avail, hf_osu_icon_avail_width, tvb, offset, 2,
7415                         ENC_LITTLE_ENDIAN);
7416   offset += 2;
7417
7418   proto_tree_add_item(icon_avail, hf_osu_icon_avail_height, tvb, offset, 2,
7419                         ENC_LITTLE_ENDIAN);
7420   offset += 2;
7421
7422   proto_tree_add_item(icon_avail, hf_osu_icon_avail_lang_code, tvb, offset, 3,
7423                         ENC_ASCII|ENC_NA);
7424   offset += 3;
7425
7426   icon_type_len = tvb_get_guint8(tvb, offset);
7427   proto_tree_add_item(icon_avail, hf_osu_icon_avail_icon_type_len, tvb, offset,
7428                         1, ENC_NA);
7429   offset++;
7430
7431   proto_tree_add_item(icon_avail, hf_osu_icon_avail_icon_type, tvb, offset,
7432                         icon_type_len, ENC_ASCII|ENC_NA);
7433   offset += icon_type_len;
7434
7435   icon_filename_len = tvb_get_guint8(tvb, offset);
7436   proto_tree_add_item(icon_avail, hf_osu_icon_avail_filename_len, tvb, offset,
7437                         1, ENC_NA);
7438   offset++;
7439
7440   proto_tree_add_item(icon_avail, hf_osu_icon_avail_filename, tvb, offset,
7441                         icon_filename_len, ENC_ASCII|ENC_NA);
7442   offset += icon_filename_len;
7443
7444   proto_item_set_len(pi, offset - start_offset);
7445
7446   return offset;
7447 }
7448
7449 static const value_string osu_method_vals[] = {
7450   { 0, "OMA DM" },
7451   { 1, "SOAP XML SPP" },
7452   { 0, NULL },
7453 };
7454
7455 static int
7456 dissect_hs20_osu_provider(proto_tree *tree, tvbuff_t *tvb,
7457   packet_info *pinfo, int offset, int end, guint8 provider_index)
7458 {
7459   proto_tree *prov_tree = NULL;
7460   proto_item *osupi = NULL, *uri_pi = NULL;
7461   int start_offset = offset;
7462   guint8 osu_server_uri_len = 0;
7463   guint8 osu_method_list_len = 0;
7464   guint16 icons_avail = 0, icons_index = 0;
7465   guint8 osu_nai_len = 0;
7466   guint16 osu_service_desc_len = 0;
7467
7468   prov_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
7469                         ett_hs20_osu_provider_tree, &osupi,
7470                         "OSU Provider %d", provider_index);
7471
7472   proto_tree_add_item(prov_tree, hf_hs20_osu_prov_length, tvb, offset, 2,
7473                         ENC_LITTLE_ENDIAN);
7474   offset += 2;
7475
7476   offset = dissect_hs20_osu_friendly_names(prov_tree, tvb, pinfo, offset, end);
7477
7478   proto_item_set_len(osupi, offset - start_offset);
7479
7480   osu_server_uri_len = tvb_get_guint8(tvb, offset);
7481   proto_tree_add_item(prov_tree, hf_hs20_osu_server_uri_len, tvb, offset, 1,
7482                         ENC_NA);
7483   offset++;
7484
7485   uri_pi = proto_tree_add_item(prov_tree, hf_hs20_osu_server_uri, tvb, offset,
7486                         osu_server_uri_len, ENC_ASCII|ENC_NA);
7487   offset += osu_server_uri_len;
7488   PROTO_ITEM_SET_URL(uri_pi);
7489
7490   osu_method_list_len = tvb_get_guint8(tvb, offset);
7491   proto_tree_add_item(prov_tree, hf_hs20_osu_method_list_len, tvb, offset, 1,
7492                         ENC_NA);
7493   offset++;
7494
7495   if (osu_method_list_len > 0) {
7496     proto_tree *osu_method_list = NULL;
7497     guint8 osu_method_list_index = 0;
7498
7499     osu_method_list = proto_tree_add_subtree(prov_tree, tvb, offset,
7500                                 osu_method_list_len,
7501                                 ett_hs20_osu_provider_method_list,
7502                                 NULL, "OSU Method List");
7503     while (osu_method_list_len > osu_method_list_index) {
7504       proto_item *pi = NULL;
7505       guint8 method = tvb_get_guint8(tvb, offset);
7506
7507       pi = proto_tree_add_item(osu_method_list, hf_hs20_osu_method_val, tvb,
7508                         offset, 1, ENC_NA);
7509       proto_item_append_text(pi, ": %s",
7510                                 val_to_str(method, osu_method_vals,
7511                                         "Reserved"));
7512       offset++;
7513       osu_method_list_index++;
7514     }
7515   }
7516
7517   icons_avail = tvb_get_letohs(tvb, offset);
7518   proto_tree_add_item(prov_tree, hf_hs20_icons_avail_len, tvb, offset, 2,
7519                         ENC_LITTLE_ENDIAN);
7520   offset += 2;
7521
7522   if (icons_avail > 0) {
7523     proto_tree *icon_list = NULL;
7524     proto_item *pi = NULL;
7525
7526     start_offset = offset;
7527
7528     icon_list = proto_tree_add_subtree(prov_tree, tvb, offset, -1,
7529                                 ett_osu_icons_avail_list, &pi,
7530                                 "Icons Available");
7531
7532     while ((offset - start_offset) < icons_avail) {
7533       offset = dissect_hs20_osu_icon_available(icon_list, tvb, pinfo, offset,
7534                                 end, icons_index);
7535       icons_index++;
7536     }
7537
7538     proto_item_set_len(pi, offset - start_offset);
7539   }
7540
7541   osu_nai_len = tvb_get_guint8(tvb, offset);
7542   proto_tree_add_item(prov_tree, hf_hs20_osu_nai_len, tvb, offset, 1, ENC_NA);
7543   offset++;
7544
7545   if (osu_nai_len > 0) {
7546     proto_tree_add_item(prov_tree, hf_hs20_osu_nai, tvb, offset,
7547                         osu_nai_len, ENC_NA);
7548     offset += osu_nai_len;
7549   }
7550
7551   osu_service_desc_len = tvb_get_letohs(tvb, offset);
7552   proto_tree_add_item(prov_tree, hf_hs20_osu_service_desc_len, tvb, offset, 2,
7553                         ENC_LITTLE_ENDIAN);
7554   offset += 2;
7555
7556   if (osu_service_desc_len > 0) {
7557     proto_tree *desc_tree = NULL;
7558     proto_item *pi = NULL;
7559     guint8 service_desc_index = 0;
7560
7561     start_offset = offset;
7562     desc_tree = proto_tree_add_subtree(prov_tree, tvb, offset, -1,
7563                                 ett_hs20_osu_service_desc_list, &pi,
7564                                 "OSU Service Description List");
7565
7566     while ((offset - start_offset) < osu_service_desc_len) {
7567       proto_tree *desc_duple = NULL;
7568       guint8 serv_desc_len = tvb_get_guint8(tvb, offset);
7569
7570       desc_duple = proto_tree_add_subtree_format(desc_tree, tvb, offset,
7571                                 1 + serv_desc_len,
7572                                 ett_hs20_osu_service_desc_tree, NULL,
7573                                 "OSU Service Description Duple %d",
7574                                 service_desc_index);
7575
7576       proto_tree_add_item(desc_duple, hf_hs20_osu_service_desc_duple_len, tvb,
7577                                 offset, 1, ENC_NA);
7578       offset++;
7579
7580       proto_tree_add_item(desc_duple, hf_hs20_osu_service_desc_lang, tvb, offset,
7581                                 3, ENC_ASCII|ENC_NA);
7582       offset += 3;
7583
7584       proto_tree_add_item(desc_duple, hf_hs20_osu_service_desc, tvb, offset,
7585                                 serv_desc_len - 3, ENC_ASCII|ENC_NA);
7586       offset += serv_desc_len - 3;
7587
7588       service_desc_index++;
7589     }
7590
7591     proto_item_set_len(pi, offset - start_offset);
7592   }
7593
7594   return end;
7595 }
7596
7597 static void
7598 dissect_hs20_anqp_osu_providers_list(proto_tree *tree, tvbuff_t *tvb,
7599   packet_info *pinfo, int offset, int end)
7600 {
7601   guint8 ssid_len = tvb_get_guint8(tvb, offset);
7602   guint8 osu_prov_count = 0, osu_prov_index = 0;
7603
7604   proto_tree_add_item(tree, hf_hs20_osu_providers_list_ssid_len, tvb, offset, 1,
7605                         ENC_NA);
7606   offset++;
7607
7608   proto_tree_add_item(tree, hf_hs20_osu_providers_ssid, tvb, offset, ssid_len,
7609                         ENC_UTF_8|ENC_NA);
7610   offset += ssid_len;
7611
7612   osu_prov_count = tvb_get_guint8(tvb, offset);
7613   proto_tree_add_item(tree, hf_hs20_osu_providers_count, tvb, offset, 1,
7614                         ENC_NA);
7615   offset++;
7616
7617   if (osu_prov_count > 0) {
7618     int start_offset = offset;
7619     proto_item *pi = NULL;
7620     proto_tree *osu_prov_list = NULL;
7621
7622     osu_prov_list = proto_tree_add_subtree(tree, tvb, offset, -1,
7623                         ett_hs20_osu_providers_list, &pi,
7624                         "OSU Providers List");
7625     while (offset < end && osu_prov_count > osu_prov_index) {
7626       offset = dissect_hs20_osu_provider(osu_prov_list, tvb, pinfo, offset, end,
7627                         osu_prov_index);
7628       osu_prov_index++;
7629     }
7630
7631     proto_item_set_len(pi, offset - start_offset);
7632   }
7633 }
7634
7635 static void
7636 dissect_hs20_anqp_icon_request(proto_tree *tree, tvbuff_t *tvb, int offset,
7637   int end)
7638 {
7639   proto_tree_add_item(tree, hf_hs20_icon_request_filename, tvb, offset,
7640                         end - offset, ENC_UTF_8|ENC_NA);
7641 }
7642
7643 static const value_string hs20_icon_download_status_vals[] = {
7644   { 0, "Success" },
7645   { 1, "File not found" },
7646   { 2, "Unspecified file error" },
7647   { 0, NULL }
7648 };
7649
7650 static void
7651 dissect_hs20_anqp_icon_binary_file(proto_tree *tree, tvbuff_t *tvb, int offset,
7652   int end _U_)
7653 {
7654   guint8 icon_download_status = tvb_get_guint8(tvb, offset);
7655   proto_item *pi = NULL;
7656   guint8 icon_type_len = 0;
7657   guint16 icon_binary_data_len = 0;
7658
7659   pi = proto_tree_add_item(tree, hf_hs20_icon_binary_file_status, tvb, offset, 1,
7660                         ENC_NA);
7661   offset++;
7662   proto_item_append_text(pi, ": %s",
7663                          val_to_str(icon_download_status,
7664                                     hs20_icon_download_status_vals,
7665                                     "Reserved (%u)"));
7666
7667   icon_type_len = tvb_get_guint8(tvb, offset);
7668   proto_tree_add_item(tree, hf_hs20_icon_type_length, tvb, offset, 1, ENC_NA);
7669   offset++;
7670
7671   proto_tree_add_item(tree, hf_hs20_icon_type, tvb, offset, icon_type_len,
7672                         ENC_UTF_8|ENC_NA);
7673   offset += icon_type_len;
7674
7675   icon_binary_data_len = tvb_get_letohs(tvb, offset);
7676   proto_tree_add_item(tree, hf_hs20_icon_binary_data_len, tvb, offset, 2,
7677                         ENC_BIG_ENDIAN);
7678   offset += 2;
7679
7680   proto_tree_add_item(tree, hf_hs20_icon_binary_data, tvb, offset,
7681                         icon_binary_data_len, ENC_NA);
7682 }
7683
7684 static void
7685 dissect_hs20_anqp_operator_icon_metadata(proto_tree *tree, tvbuff_t *tvb,
7686   int offset, int end _U_)
7687 {
7688   proto_item *pi = NULL;
7689   int start_offset = offset;
7690   guint8 icon_type_len = 0, icon_filename_len = 0;
7691
7692   proto_tree_add_item(tree, hf_osu_icon_avail_width, tvb, offset, 2,
7693                         ENC_LITTLE_ENDIAN);
7694   offset += 2;
7695
7696   proto_tree_add_item(tree, hf_osu_icon_avail_height, tvb, offset, 2,
7697                         ENC_LITTLE_ENDIAN);
7698   offset += 2;
7699
7700   proto_tree_add_item(tree, hf_osu_icon_avail_lang_code, tvb, offset, 3,
7701                         ENC_ASCII|ENC_NA);
7702   offset += 3;
7703
7704   icon_type_len = tvb_get_guint8(tvb, offset);
7705   proto_tree_add_item(tree, hf_osu_icon_avail_icon_type_len, tvb, offset,
7706                         1, ENC_NA);
7707   offset++;
7708
7709   proto_tree_add_item(tree, hf_osu_icon_avail_icon_type, tvb, offset,
7710                         icon_type_len, ENC_ASCII|ENC_NA);
7711   offset += icon_type_len;
7712
7713   icon_filename_len = tvb_get_guint8(tvb, offset);
7714   proto_tree_add_item(tree, hf_osu_icon_avail_filename_len, tvb, offset,
7715                         1, ENC_NA);
7716   offset++;
7717
7718   proto_tree_add_item(tree, hf_osu_icon_avail_filename, tvb, offset,
7719                         icon_filename_len, ENC_ASCII|ENC_NA);
7720   offset += icon_filename_len;
7721
7722   proto_item_set_len(pi, offset - start_offset);
7723 }
7724
7725 static void
7726 dissect_anqp_venue_url(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7727 {
7728   guint16 url_duple_index = 0;
7729
7730   while (offset < end) {
7731     proto_tree *venue_url = NULL;
7732     proto_item *url_pi = NULL;
7733     guint8 url_duple_len = tvb_get_guint8(tvb, offset);
7734
7735     venue_url = proto_tree_add_subtree_format(tree, tvb, offset,
7736                         url_duple_len + 1, ett_hs20_venue_url, NULL,
7737                         "Venue URL Duple %d", url_duple_index);
7738
7739     proto_tree_add_item(venue_url, hf_hs20_anqp_venue_url_length, tvb, offset,
7740                         1, ENC_NA);
7741     offset++;
7742
7743     proto_tree_add_item(venue_url, hf_hs20_anqp_venue_number, tvb, offset, 1,
7744                         ENC_NA);
7745     offset++;
7746
7747     url_pi = proto_tree_add_item(venue_url, hf_hs20_anqp_venue_url, tvb, offset,
7748                         url_duple_len -1, ENC_ASCII|ENC_NA);
7749     PROTO_ITEM_SET_URL(url_pi);
7750
7751     offset += (url_duple_len - 1);
7752
7753     url_duple_index++;
7754   }
7755 }
7756
7757 static const value_string advice_of_charge_type_vals[] = {
7758   { 0, "Time-based" },
7759   { 1, "Data-volume-based" },
7760   { 2, "Time-and-data-volume-based" },
7761   { 3, "Unlimited" },
7762   { 0, NULL }
7763 };
7764
7765 static void
7766 dissect_hs20_anqp_advice_of_charge(proto_tree *tree, tvbuff_t *tvb, int offset,
7767   int end _U_)
7768 {
7769   guint16 toc_index = 0;
7770
7771   while (offset < end) {
7772     guint16 adv_charge_len = tvb_get_letohs(tvb, offset);
7773     proto_tree *aoc_tree = NULL;
7774     proto_tree *plan_info_tree = NULL;
7775     proto_item *pi = NULL, *tpi = NULL;
7776     int start_offset = offset;
7777     guint8 aoc_type = 0, nai_realm_len = 0;
7778     guint8 plan_index = 0;
7779     guint16 plan_tot_len = 0;
7780     int plan_offset = 0;
7781
7782     aoc_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
7783                         ett_hs20_advice_of_charge, &pi,
7784                         "Advice of Charge Duple %d", toc_index);
7785     proto_tree_add_item(aoc_tree, hf_hs20_anqp_advice_of_charge_length, tvb,
7786                         offset, 2, ENC_LITTLE_ENDIAN);
7787     offset += 2;
7788
7789     aoc_type = tvb_get_guint8(tvb, offset);
7790     tpi = proto_tree_add_item(aoc_tree, hf_hs20_anqp_advice_of_charge_type, tvb,
7791                         offset, 1, ENC_NA);
7792     offset++;
7793     proto_item_append_text(tpi, ": %s",
7794                                 val_to_str(aoc_type,
7795                                         advice_of_charge_type_vals,
7796                                         "Reserved (%u)"));
7797
7798     proto_tree_add_item(aoc_tree, hf_hs20_anqp_aoc_nai_realm_encoding, tvb,
7799                         offset, 1, ENC_NA);
7800     offset++;
7801
7802     nai_realm_len = tvb_get_guint8(tvb, offset);
7803     proto_tree_add_item(aoc_tree, hf_hs20_anqp_aoc_nai_realm_len, tvb, offset,
7804                         1, ENC_NA);
7805     offset++;
7806
7807     proto_tree_add_item(aoc_tree, hf_hs20_anqp_aoc_nai_realm, tvb, offset,
7808                         nai_realm_len, ENC_UTF_8|ENC_NA);
7809     offset += nai_realm_len;
7810
7811     plan_tot_len = adv_charge_len - 3 - nai_realm_len;
7812     plan_offset = offset;
7813
7814     while (offset < (plan_offset + plan_tot_len)) {
7815         guint16 plan_len = tvb_get_letohs(tvb, offset);
7816
7817         plan_info_tree = proto_tree_add_subtree_format(aoc_tree, tvb, offset,
7818                                 plan_len + 2, ett_hs20_aoc_plan, NULL,
7819                                 "Plan #%u", plan_index);
7820
7821         proto_tree_add_item(plan_info_tree, hf_hs20_anqp_aoc_plan_len, tvb,
7822                         offset, 2, ENC_LITTLE_ENDIAN);
7823         offset += 2;
7824
7825         proto_tree_add_item(plan_info_tree, hf_hs20_anqp_aoc_plan_lang, tvb,
7826                         offset, 3, ENC_ASCII|ENC_NA);
7827         offset += 3;
7828
7829         proto_tree_add_item(plan_info_tree, hf_hs20_anqp_aoc_plan_curcy, tvb,
7830                         offset, 3, ENC_ASCII|ENC_NA);
7831         offset += 3;
7832
7833         proto_tree_add_item(plan_info_tree, hf_hs20_anqp_aoc_plan_information,
7834                         tvb, offset, plan_len - 6, ENC_UTF_8|ENC_NA);
7835         offset += plan_len - 6;
7836
7837         plan_index++;
7838     }
7839
7840     proto_item_set_len(pi, offset - start_offset);
7841
7842     toc_index++;
7843   }
7844 }
7845
7846 static int
7847 dissect_hs20_anqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
7848 {
7849   guint8 subtype;
7850   int ofn_hf_array[3] = {hf_hs20_anqp_ofn_length,
7851                          hf_hs20_anqp_ofn_language,
7852                          hf_hs20_anqp_ofn_name };
7853
7854   int end = tvb_reported_length(tvb);
7855   int offset = 0;
7856   anqp_info_dissector_data_t* anqp_data = (anqp_info_dissector_data_t*)data;
7857
7858   DISSECTOR_ASSERT(anqp_data);
7859
7860   subtype = tvb_get_guint8(tvb, offset);
7861   proto_item_append_text(tree, " - HS 2.0 %s",
7862                          val_to_str(subtype, hs20_anqp_subtype_vals,
7863                                     "Reserved (%u)"));
7864   if (anqp_data->idx == 0) {
7865     col_append_fstr(pinfo->cinfo, COL_INFO, " HS 2.0 %s",
7866                     val_to_str(subtype, hs20_anqp_subtype_vals,
7867                                "Reserved (%u)"));
7868   } else if (anqp_data->idx == 1) {
7869     col_append_str(pinfo->cinfo, COL_INFO, ", ..");
7870   }
7871   proto_tree_add_item(tree, hf_hs20_anqp_subtype, tvb, offset, 1,
7872                       ENC_LITTLE_ENDIAN);
7873   offset++;
7874
7875   proto_tree_add_item(tree, hf_hs20_anqp_reserved, tvb, offset, 1,
7876                       ENC_LITTLE_ENDIAN);
7877   offset++;
7878
7879   switch (subtype) {
7880   case HS20_ANQP_HS_QUERY_LIST:
7881     dissect_hs20_anqp_hs_query_list(tree, tvb, offset, end);
7882     break;
7883   case HS20_ANQP_HS_CAPABILITY_LIST:
7884     dissect_hs20_anqp_hs_capability_list(tree, tvb, offset, end);
7885     break;
7886   case HS20_ANQP_OPERATOR_FRIENDLY_NAME:
7887     dissect_hs20_anqp_operator_friendly_name(tree, tvb, pinfo, offset, end,
7888                                 ofn_hf_array, ett_hs20_ofn_tree);
7889     break;
7890   case HS20_ANQP_WAN_METRICS:
7891     dissect_hs20_anqp_wan_metrics(tree, tvb, offset, anqp_data->request);
7892     break;
7893   case HS20_ANQP_CONNECTION_CAPABILITY:
7894     dissect_hs20_anqp_connection_capability(tree, tvb, offset, end);
7895     break;
7896   case HS20_ANQP_NAI_HOME_REALM_QUERY:
7897     dissect_hs20_anqp_nai_home_realm_query(tree, tvb, pinfo, offset, end);
7898     break;
7899   case HS20_ANQP_OPERATING_CLASS_INDICATION:
7900     dissect_hs20_anqp_oper_class_indic(tree, tvb, offset, end);
7901     break;
7902   case HS20_ANQP_OSU_PROVIDERS_LIST:
7903     dissect_hs20_anqp_osu_providers_list(tree, tvb, pinfo, offset, end);
7904     break;
7905   case HS20_ANQP_ICON_REQUEST:
7906     dissect_hs20_anqp_icon_request(tree, tvb, offset, end);
7907     break;
7908   case HS20_ANQP_ICON_BINARY_FILE:
7909     dissect_hs20_anqp_icon_binary_file(tree, tvb, offset, end);
7910     break;
7911   case HS20_ANQP_OPERATOR_ICON_METADATA:
7912     dissect_hs20_anqp_operator_icon_metadata(tree, tvb, offset, end);
7913     break;
7914   case HS20_ANQP_ADVICE_OF_CHARGE:
7915     dissect_hs20_anqp_advice_of_charge(tree, tvb, offset, end);
7916     break;
7917   default:
7918     if (offset == end)
7919       break;
7920     proto_tree_add_item(tree, hf_hs20_anqp_payload, tvb, offset,
7921                         end - offset, ENC_NA);
7922     break;
7923   }
7924
7925   return tvb_captured_length(tvb);
7926 }
7927
7928 static int
7929 dissect_vendor_wifi_alliance_anqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
7930 {
7931   guint8 subtype;
7932   int offset = 0;
7933   tvbuff_t *subtvb;
7934
7935   subtype = tvb_get_guint8(tvb, offset);
7936   proto_tree_add_item(tree, hf_ieee80211_anqp_wfa_subtype, tvb, offset, 1, ENC_NA);
7937   offset += 1;
7938
7939   subtvb = tvb_new_subset_remaining(tvb, offset);
7940   if (!dissector_try_uint_new(wifi_alliance_anqp_info_table, subtype, subtvb, pinfo, tree, FALSE, data))
7941       call_data_dissector(subtvb, pinfo, tree);
7942
7943   return tvb_captured_length(tvb);
7944 }
7945
7946
7947 static int
7948 dissect_neighbor_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
7949
7950 static int
7951 dissect_anqp_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
7952                   gboolean request, int idx)
7953 {
7954   guint16     id, len;
7955   guint32     oui;
7956   proto_item *item, *item_len;
7957   tvbuff_t *vendor_tvb;
7958   anqp_info_dissector_data_t anqp_info;
7959
7960   item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_id,
7961                              tvb, offset, 2, ENC_LITTLE_ENDIAN);
7962   id = tvb_get_letohs(tvb, offset);
7963   if (id != ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
7964     if (idx == 0) {
7965       proto_item_append_text(tree, " - %s",
7966                              val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
7967       col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
7968                       val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
7969     } else if (idx == 1) {
7970       proto_item_append_text(tree, ", ..");
7971       col_append_str(pinfo->cinfo, COL_INFO, ", ..");
7972     }
7973   }
7974   tree = proto_item_add_subtree(item, ett_gas_anqp);
7975   offset += 2;
7976   item_len = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_length,
7977                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7978   len = tvb_get_letohs(tvb, offset);
7979   offset += 2;
7980   if (tvb_reported_length_remaining(tvb, offset) < len) {
7981     expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_info_length);
7982     return 4 + len;
7983   }
7984   switch (id)
7985   {
7986   case ANQP_INFO_ANQP_QUERY_LIST:
7987     dissect_anqp_query_list(tree, tvb, pinfo, offset, offset + len);
7988     break;
7989   case ANQP_INFO_ANQP_CAPAB_LIST:
7990     dissect_anqp_capab_list(tree, tvb, pinfo, offset, offset + len);
7991     break;
7992   case ANQP_INFO_VENUE_NAME_INFO:
7993     dissect_venue_name_info(tree, tvb, pinfo, offset, offset + len);
7994     break;
7995   case ANQP_INFO_NETWORK_AUTH_TYPE_INFO:
7996     dissect_network_auth_type(tree, tvb, offset, offset + len);
7997     break;
7998   case ANQP_INFO_ROAMING_CONSORTIUM_LIST:
7999     dissect_roaming_consortium_list(tree, tvb, pinfo, offset, offset + len);
8000     break;
8001   case ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO:
8002     dissect_ip_addr_type_availability_info(tree, tvb, offset);
8003     break;
8004   case ANQP_INFO_NAI_REALM_LIST:
8005     dissect_nai_realm_list(tree, tvb, pinfo, offset, offset + len);
8006     break;
8007   case ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO:
8008     dissect_3gpp_cellular_network_info(tree, tvb, pinfo, offset);
8009     break;
8010   case ANQP_INFO_DOMAIN_NAME_LIST:
8011     dissect_domain_name_list(tree, tvb, offset, offset + len);
8012     break;
8013   case ANQP_INFO_NEIGHBOR_REPORT:
8014     {
8015       tvbuff_t *report_tvb;
8016       ieee80211_tagged_field_data_t field_data;
8017
8018       report_tvb = tvb_new_subset_length(tvb, offset, len);
8019       field_data.item_tag = item;
8020       field_data.item_tag_length = item_len;
8021       dissect_neighbor_report(report_tvb, pinfo, tree, &field_data);
8022     }
8023     break;
8024   case ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST:
8025     proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
8026     offset += 3;
8027     vendor_tvb = tvb_new_subset_length(tvb, offset, len);
8028
8029     anqp_info.request = request;
8030     anqp_info.idx = idx;
8031     if (!dissector_try_uint_new(vendor_specific_anqp_info_table, oui, vendor_tvb, pinfo, tree, FALSE, &anqp_info))
8032     {
8033       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info, tvb, offset, len, ENC_NA);
8034     }
8035     break;
8036   case ANQP_INFO_VENUE_URL:
8037     dissect_anqp_venue_url(tree, tvb, offset, offset + len);
8038     break;
8039   case ANQP_INFO_ADVICE_OF_CHARGE:
8040     dissect_hs20_anqp_advice_of_charge(tree, tvb, offset, offset + len);
8041     break;
8042   default:
8043     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
8044                         tvb, offset, len, ENC_NA);
8045     break;
8046   }
8047
8048   return 4 + len;
8049 }
8050
8051 static void
8052 dissect_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, gboolean request)
8053 {
8054   int idx = 0;
8055
8056   proto_item_append_text(tree, ": ANQP ");
8057   proto_item_append_text(tree, request ? "Request" : "Response");
8058   if (tvb_reported_length_remaining(tvb, offset) < 4) {
8059     expert_add_info_format(pinfo, tree, &ei_ieee80211_not_enough_room_for_anqp_header,
8060                            "Not enough room for ANQP header");
8061     return;
8062   }
8063   col_append_fstr(pinfo->cinfo, COL_INFO, ", ANQP %s",
8064                   request ? "Req" : "Resp");
8065   while (tvb_reported_length_remaining(tvb, offset) > 0) {
8066     offset += dissect_anqp_info(tree, tvb, pinfo, offset, request, idx);
8067     idx += 1;
8068   }
8069 }
8070
8071 static guint
8072 dissect_gas_initial_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
8073                             guint type, guint subtype)
8074 {
8075   guint16     req_len;
8076   int         start = offset;
8077   proto_item *item;
8078   proto_tree *query;
8079
8080   /* Query Request Length (2 octets) */
8081   req_len = tvb_get_letohs(tvb, offset);
8082
8083   query = proto_tree_add_subtree(tree, tvb, offset, 2 + req_len, ett_gas_query, &item, "Query Request");
8084   if (tvb_reported_length_remaining(tvb, offset) < 2 + req_len) {
8085     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_request_length);
8086     return tvb_reported_length_remaining(tvb, offset);
8087   }
8088
8089   proto_tree_add_item(query, hf_ieee80211_ff_query_request_length,
8090                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8091   offset += 2;
8092   /*
8093    * Query Request (GAS query; formatted per protocol specified in the
8094    * Advertisement Protocol IE)
8095    */
8096   switch (type) {
8097   case ADV_PROTO_ID_ANQP:
8098     dissect_anqp(query, tvb, pinfo, offset, TRUE);
8099     break;
8100   case ADV_PROTO_ID_VS:
8101     if (subtype == ((DPP_CONFIGURATION_PROTOCOL << 8) | WFA_SUBTYPE_DPP)) {
8102        col_append_fstr(pinfo->cinfo, COL_INFO, ", DPP - %s",
8103                        val_to_str(subtype >> 8, dpp_subtype_vals, "Unknown (%u)"));
8104       dissect_wifi_dpp_config_proto(pinfo, query, tvb, offset);
8105     }
8106     break;
8107   default:
8108     proto_tree_add_item(query, hf_ieee80211_ff_query_request,
8109                         tvb, offset, req_len, ENC_NA);
8110   }
8111   offset += req_len;
8112
8113   return offset - start;
8114 }
8115
8116 static guint
8117 dissect_gas_initial_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
8118                              guint type, guint subtype)
8119 {
8120   guint16     resp_len;
8121   int         start = offset;
8122   proto_item *item;
8123   proto_tree *query;
8124
8125   /* Query Response Length (2 octets) */
8126   resp_len = tvb_get_letohs(tvb, offset);
8127
8128   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
8129                              ett_gas_query, &item, "Query Response");
8130   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
8131     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
8132     return tvb_reported_length_remaining(tvb, offset);
8133   }
8134
8135   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
8136                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8137   offset += 2;
8138   /* Query Response (optional) */
8139   if (resp_len) {
8140     switch (type) {
8141     case ADV_PROTO_ID_ANQP:
8142       dissect_anqp(query, tvb, pinfo, offset, FALSE);
8143       break;
8144     case ADV_PROTO_ID_VS:
8145       if (subtype == ((DPP_CONFIGURATION_PROTOCOL << 8) | WFA_SUBTYPE_DPP)) {
8146          col_append_fstr(pinfo->cinfo, COL_INFO, ", DPP - %s",
8147                          val_to_str(subtype >> 8, dpp_subtype_vals, "Unknown (%u)"));
8148         dissect_wifi_dpp_config_proto(pinfo, query, tvb, offset);
8149       }
8150       break;
8151     default:
8152       proto_tree_add_item(query, hf_ieee80211_ff_query_response,
8153                           tvb, offset, resp_len, ENC_NA);
8154     }
8155     offset += resp_len;
8156   }
8157
8158   return offset - start;
8159 }
8160
8161 static reassembly_table gas_reassembly_table;
8162
8163 static gint ett_gas_resp_fragment = -1;
8164 static gint ett_gas_resp_fragments = -1;
8165
8166 static int hf_ieee80211_gas_resp_fragments = -1;
8167 static int hf_ieee80211_gas_resp_fragment = -1;
8168 static int hf_ieee80211_gas_resp_fragment_overlap = -1;
8169 static int hf_ieee80211_gas_resp_fragment_overlap_conflict = -1;
8170 static int hf_ieee80211_gas_resp_fragment_multiple_tails = -1;
8171 static int hf_ieee80211_gas_resp_fragment_too_long_fragment = -1;
8172 static int hf_ieee80211_gas_resp_fragment_error = -1;
8173 static int hf_ieee80211_gas_resp_fragment_count = -1;
8174 static int hf_ieee80211_gas_resp_reassembled_in = -1;
8175 static int hf_ieee80211_gas_resp_reassembled_length = -1;
8176
8177 static const fragment_items gas_resp_frag_items = {
8178   &ett_gas_resp_fragment,
8179   &ett_gas_resp_fragments,
8180   &hf_ieee80211_gas_resp_fragments,
8181   &hf_ieee80211_gas_resp_fragment,
8182   &hf_ieee80211_gas_resp_fragment_overlap,
8183   &hf_ieee80211_gas_resp_fragment_overlap_conflict,
8184   &hf_ieee80211_gas_resp_fragment_multiple_tails,
8185   &hf_ieee80211_gas_resp_fragment_too_long_fragment,
8186   &hf_ieee80211_gas_resp_fragment_error,
8187   &hf_ieee80211_gas_resp_fragment_count,
8188   &hf_ieee80211_gas_resp_reassembled_in,
8189   &hf_ieee80211_gas_resp_reassembled_length,
8190   /* Reassembled data field */
8191   NULL,
8192   "GAS Response fragments"
8193 };
8194
8195 static guint
8196 dissect_gas_comeback_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
8197                               guint type, guint subtype _U_, guint8 frag, gboolean more,
8198                               guint8 dialog_token)
8199 {
8200   guint16     resp_len;
8201   int         start = offset;
8202   proto_item *item;
8203   proto_tree *query;
8204
8205   /* Query Response Length (2 octets) */
8206   resp_len = tvb_get_letohs(tvb, offset);
8207
8208   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
8209                              ett_gas_query, &item, "Query Response");
8210   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
8211     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
8212     return tvb_reported_length_remaining(tvb, offset);
8213   }
8214
8215   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
8216                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8217   offset += 2;
8218   /* Query Response (optional) */
8219   if (resp_len) {
8220     if (type == ADV_PROTO_ID_ANQP && (frag == 0) && !more)
8221       dissect_anqp(query, tvb, pinfo, offset, FALSE);
8222     else {
8223       fragment_head *frag_msg;
8224       gboolean save_fragmented;
8225       tvbuff_t *new_tvb;
8226
8227       save_fragmented = pinfo->fragmented;
8228       pinfo->fragmented = TRUE;
8229       frag_msg = fragment_add_seq_check(&gas_reassembly_table, tvb, offset,
8230                                         pinfo, dialog_token, NULL,
8231                                         frag, resp_len, more);
8232       new_tvb = process_reassembled_data(tvb, offset, pinfo,
8233                                          "Reassembled GAS Query Response",
8234                                          frag_msg, &gas_resp_frag_items,
8235                                          NULL, tree);
8236       if (new_tvb) {
8237         if (type == ADV_PROTO_ID_ANQP)
8238           dissect_anqp(query, new_tvb, pinfo, 0, FALSE);
8239         else
8240           proto_tree_add_item(query, hf_ieee80211_ff_query_response,
8241                               new_tvb, 0,
8242                               tvb_reported_length_remaining(new_tvb, 0),
8243                               ENC_NA);
8244       }
8245
8246       /* The old tvb cannot be used anymore */
8247       ieee80211_tvb_invalid = TRUE;
8248
8249       pinfo->fragmented = save_fragmented;
8250     }
8251     offset += resp_len;
8252   }
8253
8254   return offset - start;
8255 }
8256
8257 /* ************************************************************************* */
8258 /*              Dissect and add fixed mgmt fields to protocol tree           */
8259 /* ************************************************************************* */
8260
8261 static guint64 last_timestamp;
8262
8263 static guint
8264 add_ff_timestamp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8265 {
8266   last_timestamp = tvb_get_letoh64(tvb, offset);
8267   proto_tree_add_item(tree, hf_ieee80211_ff_timestamp, tvb, offset, 8,
8268                       ENC_LITTLE_ENDIAN);
8269   return 8;
8270 }
8271
8272 static guint
8273 add_ff_beacon_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8274 {
8275   proto_tree_add_item(tree, hf_ieee80211_ff_beacon_interval, tvb, offset, 2,
8276                       ENC_LITTLE_ENDIAN);
8277   col_append_fstr(pinfo->cinfo, COL_INFO, ", BI=%d",
8278                   tvb_get_letohs(tvb, offset));
8279   return 2;
8280 }
8281
8282 static guint
8283 add_ff_cap_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8284 {
8285   static const int *ieee80211_ap_fields[] = {
8286     &hf_ieee80211_ff_cf_ess,
8287     &hf_ieee80211_ff_cf_ibss,
8288     &hf_ieee80211_ff_cf_ap_poll,
8289     &hf_ieee80211_ff_cf_privacy,
8290     &hf_ieee80211_ff_cf_preamble,
8291     &hf_ieee80211_ff_cf_pbcc,
8292     &hf_ieee80211_ff_cf_agility,
8293     &hf_ieee80211_ff_cf_spec_man,
8294     &hf_ieee80211_ff_short_slot_time,
8295     &hf_ieee80211_ff_cf_apsd,
8296     &hf_ieee80211_ff_radio_measurement,
8297     &hf_ieee80211_ff_dsss_ofdm,
8298     &hf_ieee80211_ff_cf_del_blk_ack,
8299     &hf_ieee80211_ff_cf_imm_blk_ack,
8300     NULL
8301   };
8302
8303   static const int *ieee80211_sta_fields[] = {
8304     &hf_ieee80211_ff_cf_ess,
8305     &hf_ieee80211_ff_cf_ibss,
8306     &hf_ieee80211_ff_cf_sta_poll,
8307     &hf_ieee80211_ff_cf_privacy,
8308     &hf_ieee80211_ff_cf_preamble,
8309     &hf_ieee80211_ff_cf_pbcc,
8310     &hf_ieee80211_ff_cf_agility,
8311     &hf_ieee80211_ff_cf_spec_man,
8312     &hf_ieee80211_ff_short_slot_time,
8313     &hf_ieee80211_ff_cf_apsd,
8314     &hf_ieee80211_ff_radio_measurement,
8315     &hf_ieee80211_ff_dsss_ofdm,
8316     &hf_ieee80211_ff_cf_del_blk_ack,
8317     &hf_ieee80211_ff_cf_imm_blk_ack,
8318     NULL
8319   };
8320
8321   if ((tvb_get_letohs(tvb, offset) & 0x0001) != 0) {
8322     /* This is an AP */
8323     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_capture,
8324                                     ett_cap_tree, ieee80211_ap_fields,
8325                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8326     p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_AP_KEY, GINT_TO_POINTER(TRUE));
8327   } else {
8328     /* This is a STA */
8329     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_capture,
8330                                     ett_cap_tree, ieee80211_sta_fields,
8331                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8332   }
8333
8334   return 2;
8335 }
8336
8337 static guint
8338 add_ff_auth_alg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8339 {
8340   proto_tree_add_item(tree, hf_ieee80211_ff_auth_alg, tvb, offset, 2,
8341                       ENC_LITTLE_ENDIAN);
8342   return 2;
8343 }
8344
8345 static guint
8346 add_ff_auth_trans_seq(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8347 {
8348   proto_tree_add_item(tree, hf_ieee80211_ff_auth_seq, tvb, offset, 2,
8349                       ENC_LITTLE_ENDIAN);
8350   return 2;
8351 }
8352
8353 static guint
8354 add_ff_current_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8355 {
8356   proto_tree_add_item(tree, hf_ieee80211_ff_current_ap, tvb, offset, 6,
8357                       ENC_NA);
8358   return 6;
8359 }
8360
8361 static guint
8362 add_ff_listen_ival(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8363 {
8364   proto_tree_add_item(tree, hf_ieee80211_ff_listen_ival, tvb, offset, 2,
8365                       ENC_LITTLE_ENDIAN);
8366   return 2;
8367 }
8368
8369 static guint
8370 add_ff_reason_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8371 {
8372   proto_tree_add_item(tree, hf_ieee80211_ff_reason, tvb, offset, 2,
8373                       ENC_LITTLE_ENDIAN);
8374   return 2;
8375 }
8376
8377 static guint
8378 add_ff_assoc_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8379 {
8380   proto_tree_add_item(tree, hf_ieee80211_ff_assoc_id, tvb, offset, 2,
8381                       ENC_LITTLE_ENDIAN);
8382   return 2;
8383 }
8384
8385 static guint
8386 add_ff_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8387 {
8388   proto_tree_add_item(tree, hf_ieee80211_ff_status_code, tvb, offset, 2,
8389                       ENC_LITTLE_ENDIAN);
8390   return 2;
8391 }
8392
8393 static guint
8394 add_ff_category_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8395 {
8396   proto_tree_add_item(tree, hf_ieee80211_ff_category_code, tvb, offset, 1,
8397                       ENC_LITTLE_ENDIAN);
8398   return 1;
8399 }
8400
8401 static guint
8402 add_ff_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8403 {
8404   proto_tree_add_item(tree, hf_ieee80211_ff_action_code, tvb, offset, 1,
8405                       ENC_LITTLE_ENDIAN);
8406   return 1;
8407 }
8408
8409 static guint
8410 add_ff_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8411 {
8412   proto_tree_add_item(tree, hf_ieee80211_ff_dialog_token, tvb, offset, 1,
8413                       ENC_LITTLE_ENDIAN);
8414   return 1;
8415 }
8416
8417 static guint
8418 add_ff_followup_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8419 {
8420   proto_tree_add_item(tree, hf_ieee80211_ff_followup_dialog_token, tvb, offset, 1,
8421                       ENC_LITTLE_ENDIAN);
8422   return 1;
8423 }
8424
8425 static guint
8426 add_ff_wme_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8427 {
8428   proto_tree_add_item(tree, hf_ieee80211_ff_wme_action_code, tvb, offset, 1,
8429                       ENC_LITTLE_ENDIAN);
8430   return 1;
8431 }
8432
8433 static guint
8434 add_ff_wme_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8435 {
8436   proto_tree_add_item(tree, hf_ieee80211_ff_wme_status_code, tvb, offset, 1,
8437                       ENC_LITTLE_ENDIAN);
8438   return 1;
8439 }
8440
8441 static guint
8442 add_ff_qos_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8443 {
8444   proto_tree_add_item(tree, hf_ieee80211_ff_qos_action_code, tvb, offset, 1,
8445                       ENC_LITTLE_ENDIAN);
8446   return 1;
8447 }
8448
8449 static guint
8450 add_ff_block_ack_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8451 {
8452   proto_tree_add_item(tree, hf_ieee80211_ff_ba_action, tvb, offset, 1,
8453                       ENC_LITTLE_ENDIAN);
8454   return 1;
8455 }
8456
8457 static guint
8458 add_ff_block_ack_param(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8459 {
8460   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_params,
8461                          ett_ff_ba_param_tree,
8462                          ieee80211_ff_block_ack_params_fields,
8463                          ENC_LITTLE_ENDIAN);
8464   return 2;
8465 }
8466
8467 static guint
8468 add_ff_block_ack_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8469 {
8470   proto_tree_add_item(tree, hf_ieee80211_ff_block_ack_timeout, tvb, offset, 2,
8471                       ENC_LITTLE_ENDIAN);
8472   return 2;
8473 }
8474
8475 static guint
8476 add_ff_block_ack_ssc(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8477 {
8478   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_ssc,
8479                          ett_ff_ba_ssc_tree, ieee80211_ff_block_ack_ssc_fields,
8480                          ENC_LITTLE_ENDIAN);
8481   return 2;
8482 }
8483
8484 static guint
8485 add_ff_qos_ts_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8486 {
8487   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_tsinfo,
8488                          ett_tsinfo_tree, ieee80211_tsinfo_fields,
8489                          ENC_LITTLE_ENDIAN);
8490   return 3;
8491 }
8492
8493 static guint
8494 add_ff_mesh_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8495 {
8496   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_action, tvb, offset, 1,
8497                       ENC_LITTLE_ENDIAN);
8498   return 1;
8499 }
8500
8501 static guint
8502 add_ff_multihop_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8503 {
8504   proto_tree_add_item(tree, hf_ieee80211_ff_multihop_action, tvb, offset, 1,
8505                       ENC_LITTLE_ENDIAN);
8506   return 1;
8507 }
8508
8509 static guint
8510 add_ff_mesh_control(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8511 {
8512   int    start = offset;
8513   guint8 flags;
8514
8515   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_flags, tvb, offset, 1,
8516                       ENC_LITTLE_ENDIAN);
8517   flags = tvb_get_guint8(tvb, offset);
8518   offset += 1;
8519   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_ttl, tvb, offset, 1,
8520                       ENC_LITTLE_ENDIAN);
8521   offset += 1;
8522   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_sequence, tvb, offset, 4,
8523                       ENC_LITTLE_ENDIAN);
8524   offset += 4;
8525
8526   switch (flags & 0x03) {
8527   case 1:
8528     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr4, tvb, offset, 6,
8529                         ENC_NA);
8530     offset += 6;
8531     break;
8532   case 2:
8533     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr5, tvb, offset, 6,
8534                         ENC_NA);
8535     offset += 6;
8536     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr6, tvb, offset, 6,
8537                         ENC_NA);
8538     offset += 6;
8539     break;
8540   case 3:
8541     proto_item_append_text(tree, " Unknown Address Extension Mode");
8542     break;
8543   default:
8544     /* no default action */
8545     break;
8546   }
8547
8548   return offset - start;
8549 }
8550
8551 static guint
8552 add_ff_selfprot_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8553 {
8554   proto_tree_add_item(tree, hf_ieee80211_ff_selfprot_action, tvb, offset, 1,
8555                       ENC_LITTLE_ENDIAN);
8556   return 1;
8557 }
8558
8559 static guint
8560 add_ff_dls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8561 {
8562   proto_tree_add_item(tree, hf_ieee80211_ff_dls_action_code, tvb, offset, 1,
8563                       ENC_LITTLE_ENDIAN);
8564   return 1;
8565 }
8566
8567 static guint
8568 add_ff_dst_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8569 {
8570   proto_tree_add_item(tree, hf_ieee80211_ff_dst_mac_addr, tvb, offset, 6,
8571                       ENC_NA);
8572   return 6;
8573 }
8574
8575 static guint
8576 add_ff_src_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8577 {
8578   proto_tree_add_item(tree, hf_ieee80211_ff_src_mac_addr, tvb, offset, 6,
8579                       ENC_NA);
8580   return 6;
8581 }
8582
8583 static guint
8584 add_ff_req_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8585 {
8586   proto_tree_add_item(tree, hf_ieee80211_ff_req_ap_addr, tvb, offset, 6,
8587                       ENC_NA);
8588   return 6;
8589 }
8590
8591 static guint
8592 add_ff_res_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8593 {
8594   proto_tree_add_item(tree, hf_ieee80211_ff_res_ap_addr, tvb, offset, 6,
8595                       ENC_NA);
8596   return 6;
8597 }
8598
8599 static guint
8600 add_ff_check_beacon(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8601 {
8602   proto_tree_add_item(tree, hf_ieee80211_ff_check_beacon, tvb, offset, 1,
8603                       ENC_NA);
8604   return 1;
8605 }
8606
8607 static guint
8608 add_ff_tod(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8609 {
8610   proto_tree_add_item(tree, hf_ieee80211_ff_tod, tvb, offset, 4,
8611                      ENC_NA);
8612   return 4;
8613 }
8614
8615 static guint
8616 add_ff_toa(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8617 {
8618   proto_tree_add_item(tree, hf_ieee80211_ff_toa, tvb, offset, 4,
8619                       ENC_NA);
8620   return 4;
8621 }
8622
8623 static guint
8624 add_ff_max_tod_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8625 {
8626   proto_tree_add_item(tree, hf_ieee80211_ff_max_tod_err, tvb, offset, 1,
8627                       ENC_NA);
8628   return 1;
8629 }
8630
8631 static guint
8632 add_ff_max_toa_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8633 {
8634   proto_tree_add_item(tree, hf_ieee80211_ff_max_toa_err, tvb, offset, 1,
8635                       ENC_NA);
8636   return 1;
8637 }
8638
8639 static guint
8640 add_ff_dls_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8641 {
8642   proto_tree_add_item(tree, hf_ieee80211_ff_dls_timeout, tvb, offset, 2,
8643                       ENC_LITTLE_ENDIAN);
8644   return 2;
8645 }
8646
8647 static guint
8648 add_ff_delba_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8649 {
8650   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_delba_param,
8651                          ett_ff_ba_param_tree, ieee80211_ff_delba_param_fields,
8652                          ENC_LITTLE_ENDIAN);
8653   return 2;
8654 }
8655
8656 static guint
8657 add_ff_max_reg_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8658 {
8659   proto_tree_add_item(tree, hf_ieee80211_ff_max_reg_pwr, tvb, offset, 2,
8660                       ENC_LITTLE_ENDIAN);
8661   return 2;
8662 }
8663
8664 static guint
8665 add_ff_measurement_pilot_int(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8666 {
8667   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
8668                       1, ENC_NA);
8669   return 1;
8670 }
8671
8672 static guint
8673 add_ff_country_str(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8674 {
8675   proto_tree_add_item(tree, hf_ieee80211_ff_country_str, tvb, offset, 3,
8676                       ENC_ASCII|ENC_NA);
8677   return 3;
8678 }
8679
8680 static guint
8681 add_ff_max_tx_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8682 {
8683   proto_tree_add_item(tree, hf_ieee80211_ff_max_tx_pwr, tvb, offset, 1,
8684                       ENC_LITTLE_ENDIAN);
8685   return 1;
8686 }
8687
8688 static guint
8689 add_ff_tx_pwr_used(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8690 {
8691   proto_tree_add_item(tree, hf_ieee80211_ff_tx_pwr_used, tvb, offset, 1,
8692                       ENC_LITTLE_ENDIAN);
8693   return 1;
8694 }
8695
8696 static guint
8697 add_ff_transceiver_noise_floor(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8698 {
8699   proto_tree_add_item(tree, hf_ieee80211_ff_transceiver_noise_floor, tvb,
8700                       offset, 1, ENC_LITTLE_ENDIAN);
8701   return 1;
8702 }
8703
8704 static guint
8705 add_ff_channel_width(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8706 {
8707   proto_tree_add_item(tree, hf_ieee80211_ff_channel_width, tvb, offset, 1,
8708                       ENC_LITTLE_ENDIAN);
8709   return 1;
8710 }
8711
8712 /* QoS Info:  802.11-2012 8.4.1.17 */
8713 static guint
8714 add_ff_qos_info_ap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8715 {
8716   /* From AP so decode as AP: Figure 8-51-QoS Info field when sent by a AP */
8717   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
8718                                     ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
8719                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8720   return 1;
8721 }
8722
8723
8724 /* QoS Info:  802.11-2012 8.4.1.17 */
8725 static guint
8726 add_ff_qos_info_sta(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8727 {
8728   /* To AP so decode as STA: Figure 8-52-QoS Info field when set by a non-AP STA */
8729   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_sta,
8730                                     ett_ff_qos_info, ieee80211_ff_qos_info_sta_fields,
8731                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8732   return 1;
8733 }
8734
8735 static guint
8736 add_ff_sm_pwr_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8737 {
8738   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_sm_pwr_save,
8739                          ett_ff_sm_pwr_save, ieee80211_ff_sw_pwr_save_fields,
8740                          ENC_LITTLE_ENDIAN);
8741   return 1;
8742 }
8743
8744 static guint
8745 add_ff_pco_phase_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8746 {
8747   proto_tree_add_item(tree, hf_ieee80211_ff_pco_phase_cntrl, tvb, offset, 1,
8748                       ENC_LITTLE_ENDIAN);
8749   return 1;
8750 }
8751
8752 static guint
8753 add_ff_psmp_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8754 {
8755   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_psmp_param_set,
8756                          ett_ff_psmp_param_set,
8757                          ieee80211_ff_psmp_param_set_fields,
8758                          ENC_LITTLE_ENDIAN);
8759   return 2;
8760 }
8761
8762 static guint
8763 add_ff_mimo_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8764 {
8765   proto_item *mimo_item;
8766   proto_tree *mimo_tree;
8767   static const int *ieee80211_mimo_fields[] = {
8768     &hf_ieee80211_ff_mimo_cntrl_nc_index,
8769     &hf_ieee80211_ff_mimo_cntrl_nr_index,
8770     &hf_ieee80211_ff_mimo_cntrl_channel_width,
8771     &hf_ieee80211_ff_mimo_cntrl_grouping,
8772     &hf_ieee80211_ff_mimo_cntrl_coefficient_size,
8773     &hf_ieee80211_ff_mimo_cntrl_codebook_info,
8774     &hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
8775     &hf_ieee80211_ff_mimo_cntrl_reserved,
8776     NULL
8777   };
8778
8779   mimo_item = proto_tree_add_item(tree, hf_ieee80211_ff_mimo_cntrl, tvb,
8780                                   offset, 6, ENC_NA);
8781   mimo_tree = proto_item_add_subtree(mimo_item, ett_ff_mimo_cntrl);
8782
8783   proto_tree_add_bitmask_list(mimo_tree, tvb, offset, 2, ieee80211_mimo_fields, ENC_LITTLE_ENDIAN);
8784   offset += 2;
8785   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
8786                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
8787
8788   return 6;
8789 }
8790
8791 static guint
8792 add_ff_ant_selection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8793 {
8794   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ant_selection,
8795                          ett_ff_ant_sel, ieee80211_ff_ant_selection_fields,
8796                          ENC_LITTLE_ENDIAN);
8797   return 1;
8798 }
8799
8800 static guint
8801 add_ff_extended_channel_switch_announcement(proto_tree *tree, tvbuff_t *tvb,
8802                                             packet_info *pinfo _U_, int offset)
8803 {
8804   proto_tree_add_bitmask(tree, tvb, offset,
8805                          hf_ieee80211_ff_ext_channel_switch_announcement,
8806                          ett_ff_chan_switch_announce,
8807                          ieee80211_ff_ext_channel_switch_announcement_fields,
8808                          ENC_LITTLE_ENDIAN);
8809   return 4;
8810 }
8811
8812 static guint
8813 add_ff_ht_information(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8814 {
8815   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ht_info,
8816                          ett_ff_ht_info, ieee80211_ff_ht_info_fields,
8817                          ENC_LITTLE_ENDIAN);
8818   return 1;
8819 }
8820
8821 static guint
8822 add_ff_ht_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8823 {
8824   proto_tree_add_item(tree, hf_ieee80211_ff_ht_action, tvb, offset, 1,
8825                       ENC_LITTLE_ENDIAN);
8826   return 1;
8827 }
8828
8829 static guint
8830 add_ff_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8831 {
8832   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_action_code, tvb, offset, 1,
8833                       ENC_LITTLE_ENDIAN);
8834   return 1;
8835 }
8836
8837 static guint
8838 add_ff_dmg_pwr_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8839 {
8840   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_pwr_mgmt, tvb, offset, 1,
8841                       ENC_LITTLE_ENDIAN);
8842   return 1;
8843 }
8844
8845 static guint
8846 add_ff_psmp_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8847 {
8848   proto_item *psmp_item;
8849   proto_tree *psmp_tree;
8850
8851   psmp_item = proto_tree_add_item(tree, hf_ieee80211_ff_psmp_sta_info, tvb,
8852                                   offset, 8, ENC_LITTLE_ENDIAN);
8853   psmp_tree = proto_item_add_subtree(psmp_item, ett_ff_psmp_sta_info);
8854
8855   proto_tree_add_item(psmp_item, hf_ieee80211_ff_psmp_sta_info_type, tvb,
8856                       offset, 4, ENC_LITTLE_ENDIAN);
8857
8858   switch (tvb_get_letohl(tvb, offset) & PSMP_STA_INFO_FLAG_TYPE) {
8859   case PSMP_STA_INFO_BROADCAST:
8860     proto_tree_add_item(psmp_tree,
8861                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8862                         offset, 4, ENC_LITTLE_ENDIAN);
8863     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8864                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8865     /* Missing 64 bit bitmask... */
8866     proto_tree_add_uint64(psmp_tree,
8867                           hf_ieee80211_ff_psmp_sta_info_reserved_large,
8868                           tvb, offset, 8,
8869                           (tvb_get_letoh64(tvb, offset) &
8870                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
8871     break;
8872   case PSMP_STA_INFO_MULTICAST:
8873     proto_tree_add_item(psmp_tree,
8874                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8875                         offset, 4, ENC_LITTLE_ENDIAN);
8876     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8877                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8878     /* Missing 64 bit bitmask... */
8879     proto_tree_add_uint64(psmp_tree,
8880                           hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
8881                           tvb, offset, 6,
8882                           (tvb_get_letoh64(tvb, offset) &
8883                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
8884     break;
8885   case PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED:
8886     proto_tree_add_item(psmp_tree,
8887                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8888                         offset, 4, ENC_LITTLE_ENDIAN);
8889     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8890                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8891     offset += 2;
8892     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_sta_id, tvb,
8893                         offset, 4, ENC_LITTLE_ENDIAN);
8894     offset += 2;
8895
8896     proto_tree_add_item(psmp_tree,
8897                         hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
8898                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8899     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_utt_duration,
8900                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8901     proto_tree_add_item(psmp_tree,
8902                         hf_ieee80211_ff_psmp_sta_info_reserved_small, tvb,
8903                         offset, 4, ENC_LITTLE_ENDIAN);
8904     break;
8905   }
8906
8907   return 8;
8908 }
8909
8910 static guint
8911 add_ff_schedule_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8912 {
8913   static const int *ieee80211_schedule_info_fields1[] = {
8914     &hf_ieee80211_sched_info_agg,
8915     NULL
8916   };
8917   static const int *ieee80211_schedule_info_fields2[] = {
8918     &hf_ieee80211_sched_info_agg,
8919     &hf_ieee80211_sched_info_tsid,
8920     &hf_ieee80211_sched_info_dir,
8921     NULL
8922   };
8923
8924   if (tvb_get_letohs(tvb, offset) & 0x0001) {
8925     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_sched_info,
8926                                     ett_sched_tree, ieee80211_schedule_info_fields2,
8927                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8928   } else {
8929     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_sched_info,
8930                                     ett_sched_tree, ieee80211_schedule_info_fields1,
8931                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8932   }
8933
8934   return 2;
8935 }
8936
8937 static guint
8938 add_ff_pa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8939 {
8940   proto_tree_add_item(tree, hf_ieee80211_ff_public_action, tvb, offset, 1,
8941                       ENC_LITTLE_ENDIAN);
8942   return 1;
8943 }
8944
8945 static guint
8946 add_ff_ppa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8947 {
8948   proto_tree_add_item(tree, hf_ieee80211_ff_protected_public_action, tvb, offset, 1,
8949                       ENC_LITTLE_ENDIAN);
8950   return 1;
8951 }
8952
8953 static guint
8954 add_ff_ft_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8955 {
8956   proto_tree_add_item(tree, hf_ieee80211_ff_ft_action_code, tvb, offset, 1,
8957                       ENC_LITTLE_ENDIAN);
8958   return 1;
8959 }
8960
8961 static guint
8962 add_ff_sta_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8963 {
8964   proto_tree_add_item(tree, hf_ieee80211_ff_sta_address, tvb, offset, 6,
8965                       ENC_NA);
8966   return 6;
8967 }
8968
8969 static guint
8970 add_ff_target_ap_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8971 {
8972   proto_tree_add_item(tree, hf_ieee80211_ff_target_ap_address, tvb, offset, 6,
8973                       ENC_NA);
8974   return 6;
8975 }
8976
8977 static guint
8978 add_ff_gas_comeback_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8979 {
8980   proto_tree_add_item(tree, hf_ieee80211_ff_gas_comeback_delay, tvb, offset, 2,
8981                       ENC_LITTLE_ENDIAN);
8982   return 2;
8983 }
8984
8985 static guint
8986 add_ff_gas_fragment_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8987 {
8988   proto_tree_add_item(tree, hf_ieee80211_ff_gas_fragment_id, tvb, offset, 1,
8989                       ENC_LITTLE_ENDIAN);
8990   proto_tree_add_item(tree, hf_ieee80211_ff_more_gas_fragments, tvb, offset, 1,
8991                       ENC_LITTLE_ENDIAN);
8992   return 1;
8993 }
8994
8995 static guint
8996 add_ff_sa_query_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8997 {
8998   proto_tree_add_item(tree, hf_ieee80211_ff_sa_query_action_code, tvb, offset,
8999                       1, ENC_LITTLE_ENDIAN);
9000   return 1;
9001 }
9002
9003 static guint
9004 add_ff_transaction_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9005 {
9006   proto_tree_add_item(tree, hf_ieee80211_ff_transaction_id, tvb, offset, 2,
9007                       ENC_LITTLE_ENDIAN);
9008   return 2;
9009 }
9010
9011 static guint
9012 add_ff_tdls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9013 {
9014   guint8 code;
9015   code = tvb_get_guint8(tvb, offset);
9016   col_set_str(pinfo->cinfo, COL_INFO,
9017               val_to_str_ext_const(code, &tdls_action_codes_ext,
9018                                    "Unknown TDLS Action"));
9019   proto_tree_add_item(tree, hf_ieee80211_ff_tdls_action_code, tvb, offset, 1,
9020                       ENC_LITTLE_ENDIAN);
9021   return 1;
9022 }
9023
9024 static guint
9025 add_ff_target_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9026 {
9027   proto_tree_add_item(tree, hf_ieee80211_ff_target_channel, tvb, offset, 1,
9028                       ENC_LITTLE_ENDIAN);
9029   return 1;
9030 }
9031
9032 static guint
9033 add_ff_operating_class(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9034 {
9035   proto_tree_add_item(tree, hf_ieee80211_ff_operating_class, tvb, offset, 1,
9036                       ENC_LITTLE_ENDIAN);
9037   return 1;
9038 }
9039
9040 static guint
9041 add_ff_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9042 {
9043   guint8 code;
9044
9045   code = tvb_get_guint8(tvb, offset);
9046   col_set_str(pinfo->cinfo, COL_INFO,
9047               val_to_str_ext_const(code, &wnm_action_codes_ext, "Unknown WNM Action"));
9048   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9049   return 1;
9050 }
9051
9052 static guint
9053 add_ff_unprotected_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9054 {
9055   guint8 code;
9056
9057   code = tvb_get_guint8(tvb, offset);
9058   col_set_str(pinfo->cinfo, COL_INFO,
9059               val_to_str_ext_const(code, &unprotected_wnm_action_codes_ext, "Unknown Unprotected WNM Action"));
9060   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9061   return 1;
9062 }
9063
9064 static guint
9065 add_ff_unprotected_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9066 {
9067   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_dmg_action_code, tvb, offset, 1, ENC_NA);
9068   return 1;
9069 }
9070
9071 static guint
9072 add_ff_key_data_length(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9073 {
9074   proto_tree_add_item(tree, hf_ieee80211_ff_key_data_length, tvb, offset, 2,
9075                       ENC_LITTLE_ENDIAN);
9076   return 2;
9077 }
9078
9079 static guint
9080 add_ff_wnm_notification_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9081 {
9082   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_notification_type,
9083                       tvb, offset, 1, ENC_NA);
9084   return 1;
9085 }
9086
9087 /* Action frame: Radio Measurement actions */
9088 static guint
9089 add_ff_rm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9090 {
9091   proto_tree_add_item(tree, hf_ieee80211_ff_rm_action_code, tvb, offset, 1, ENC_NA);
9092   return 1;
9093 }
9094
9095 static guint
9096 add_ff_rm_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9097 {
9098   proto_tree_add_item(tree, hf_ieee80211_ff_rm_dialog_token, tvb, offset, 1, ENC_NA);
9099   return 1;
9100 }
9101
9102 /* Radio Measurement Request frame, Action fields */
9103 static guint
9104 add_ff_rm_repetitions(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9105 {
9106   /* Note: 65535 means repeated until cancelled or superseded */
9107   proto_tree_add_item(tree, hf_ieee80211_ff_rm_repetitions, tvb, offset, 2,
9108                       ENC_BIG_ENDIAN);
9109   return 2;
9110 }
9111
9112 /* Link Measurement Request frame, Action fields*/
9113 static guint
9114 add_ff_rm_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9115 {
9116   /* In dBm, see 8.4.1.20 */
9117   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_power, tvb, offset, 1, ENC_NA);
9118   return 1;
9119 }
9120
9121 static guint
9122 add_ff_rm_max_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9123 {
9124   /* In dBm, see 8.4.1.19 */
9125   proto_tree_add_item(tree, hf_ieee80211_ff_rm_max_tx_power, tvb, offset, 1, ENC_NA);
9126   return 1;
9127 }
9128
9129 /* Link Measurement Report frame, Action fields */
9130 static guint
9131 add_ff_rm_tpc_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9132 {
9133   proto_tree *tpc_tree;
9134   proto_item *tpc_item;
9135
9136   /* 8.4.2.19 TPC Report element */
9137   tpc_item = proto_tree_add_item(tree, hf_ieee80211_ff_tpc, tvb, offset, 4, ENC_NA);
9138   tpc_tree = proto_item_add_subtree(tpc_item, ett_tpc);
9139   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_element_id, tvb, offset, 1, ENC_NA);
9140   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_length, tvb, offset + 1, 1, ENC_NA);
9141   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_tx_power, tvb, offset + 2, 1, ENC_NA);
9142   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_link_margin, tvb, offset + 3, 1, ENC_NA);
9143   return 4;
9144 }
9145
9146 static guint
9147 add_ff_rm_rx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9148 {
9149   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
9150   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rx_antenna_id, tvb, offset, 1, ENC_NA);
9151   return 1;
9152 }
9153
9154 static guint
9155 add_ff_rm_tx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9156 {
9157   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
9158   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_antenna_id, tvb, offset, 1, ENC_NA);
9159   return 1;
9160 }
9161
9162 static guint
9163 add_ff_rm_rcpi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9164 {
9165   /* 8.4.2.40: RCPI as specified for certain PHYs */
9166   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rcpi, tvb, offset, 1, ENC_NA);
9167   return 1;
9168 }
9169
9170 static guint
9171 add_ff_rm_rsni(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9172 {
9173   /* 8.4.2.43: RSNI in steps of 0.5 dB, calculated as:
9174    * RSNI = (10 * log10((RCPI_{power} - ANPI_{power}) / ANPI_{power}) + 20)*2 */
9175   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rsni, tvb, offset, 1, ENC_NA);
9176   return 1;
9177 }
9178
9179 static guint
9180 add_ff_bss_transition_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9181 {
9182   proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_status_code, tvb, offset, 1,
9183                       ENC_LITTLE_ENDIAN);
9184   return 1;
9185 }
9186
9187 static guint
9188 add_ff_bss_termination_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9189 {
9190   proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_delay, tvb, offset, 1,
9191                       ENC_LITTLE_ENDIAN);
9192   return 1;
9193 }
9194
9195 static guint
9196 add_ff_action_spectrum_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9197 {
9198     switch (tvb_get_guint8(tvb, offset + 1)) {
9199     case SM_ACTION_MEASUREMENT_REQUEST:
9200     case SM_ACTION_MEASUREMENT_REPORT:
9201     case SM_ACTION_TPC_REQUEST:
9202     case SM_ACTION_TPC_REPORT:
9203       add_ff_category_code(tree, tvb, pinfo, offset);
9204       add_ff_action_code(tree, tvb, pinfo, offset + 1);
9205       add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
9206       return 3;
9207     case SM_ACTION_CHAN_SWITCH_ANNC:
9208     case SM_ACTION_EXT_CHAN_SWITCH_ANNC:
9209       add_ff_category_code(tree, tvb, pinfo, offset);
9210       add_ff_action_code(tree, tvb, pinfo, offset + 1);
9211       return 2;
9212     default:
9213       add_ff_category_code(tree, tvb, pinfo, offset);
9214       add_ff_action_code(tree, tvb, pinfo, offset + 1);
9215       return 2;
9216     }
9217 }
9218
9219 static guint
9220 add_ff_action_qos(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9221 {
9222   switch (tvb_get_guint8(tvb, offset + 1)) {
9223   case QOS_ACTION_ADDTS_REQUEST:
9224     add_ff_category_code(tree, tvb, pinfo, offset);
9225     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9226     add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
9227     return 3;
9228   case QOS_ACTION_ADDTS_RESPONSE:
9229     add_ff_category_code(tree, tvb, pinfo, offset);
9230     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9231     add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
9232     add_ff_status_code(tree, tvb, pinfo, offset + 3);
9233     return 5;
9234   case QOS_ACTION_DELTS:
9235     add_ff_category_code(tree, tvb, pinfo, offset);
9236     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9237     add_ff_qos_ts_info(tree, tvb, pinfo, offset + 2);
9238     add_ff_reason_code(tree, tvb, pinfo, offset + 5);
9239     return 7;
9240   case QOS_ACTION_SCHEDULE:
9241     add_ff_category_code(tree, tvb, pinfo, offset);
9242     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9243     return 2;
9244   case QOS_ACTION_MAP_CONFIGURE:
9245     add_ff_category_code(tree, tvb, pinfo, offset);
9246     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9247     return 2;
9248   default:
9249     add_ff_category_code(tree, tvb, pinfo, offset);
9250     return 2;
9251   }
9252 }
9253
9254 static guint
9255 add_ff_action_dls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9256 {
9257   switch (tvb_get_guint8(tvb, offset + 1)) {
9258   case DLS_ACTION_REQUEST:
9259     add_ff_category_code(tree, tvb, pinfo, offset);
9260     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
9261     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  2);
9262     add_ff_src_mac_addr(tree, tvb, pinfo, offset +  8);
9263     add_ff_cap_info(tree, tvb, pinfo, offset + 14);
9264     add_ff_dls_timeout(tree, tvb, pinfo, offset + 16);
9265     return 18;
9266   case DLS_ACTION_RESPONSE:
9267     add_ff_category_code(tree, tvb, pinfo, offset);
9268     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
9269     add_ff_status_code(tree, tvb, pinfo, offset +  2);
9270     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  4);
9271     add_ff_src_mac_addr(tree, tvb, pinfo, offset + 10);
9272     if (!hf_ieee80211_ff_status_code) {
9273       add_ff_cap_info(tree, tvb, pinfo, offset + 16);
9274     }
9275     return 16;
9276   case DLS_ACTION_TEARDOWN:
9277     add_ff_category_code(tree, tvb, pinfo, offset);
9278     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
9279     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  2);
9280     add_ff_src_mac_addr(tree, tvb, pinfo, offset +  8);
9281     add_ff_reason_code(tree, tvb, pinfo, offset + 14);
9282     return 16;
9283   default:
9284     add_ff_category_code(tree, tvb, pinfo, offset);
9285     return 2;
9286   }
9287 }
9288
9289 static guint
9290 add_ff_action_block_ack(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9291 {
9292   guint start = offset;
9293
9294   switch (tvb_get_guint8(tvb, offset + 1)) {
9295   case BA_ADD_BLOCK_ACK_REQUEST:
9296     offset += add_ff_category_code(tree, tvb, pinfo, offset);
9297     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
9298     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9299     offset += add_ff_block_ack_param(tree, tvb, pinfo, offset);
9300     offset += add_ff_block_ack_timeout(tree, tvb, pinfo, offset);
9301     offset += add_ff_block_ack_ssc(tree, tvb, pinfo, offset);
9302     break;
9303   case BA_ADD_BLOCK_ACK_RESPONSE:
9304     offset += add_ff_category_code(tree, tvb, pinfo, offset);
9305     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
9306     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9307     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9308     offset += add_ff_block_ack_param(tree, tvb, pinfo, offset);
9309     offset += add_ff_block_ack_timeout(tree, tvb, pinfo, offset);
9310     break;
9311   case BA_DELETE_BLOCK_ACK:
9312     offset += add_ff_category_code(tree, tvb, pinfo, offset);
9313     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
9314     offset += add_ff_delba_param_set(tree, tvb, pinfo, offset);
9315     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
9316     break;
9317   }
9318
9319   return offset - start;  /* Size of fixed fields */
9320 }
9321
9322 static guint
9323 add_ff_action_public_fields(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint8 code)
9324 {
9325   guint32  oui;
9326   guint    type;
9327   guint    subtype;
9328   guint8   dialog_token;
9329   guint8   frag;
9330   gboolean more;
9331   tvbuff_t *vendor_tvb;
9332   int dissected;
9333
9334   guint start = offset;
9335
9336   switch (code) {
9337   case PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT:
9338     offset += add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
9339     break;
9340   case PA_VENDOR_SPECIFIC:
9341     proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
9342     offset += 3;
9343     switch (oui) {
9344     case OUI_WFA:
9345       subtype = tvb_get_guint8(tvb, offset);
9346       proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
9347       offset += 1;
9348       vendor_tvb = tvb_new_subset_remaining(tvb, offset);
9349       dissected = dissector_try_uint_new(wifi_alliance_public_action_table, subtype, vendor_tvb, pinfo, tree, FALSE, NULL);
9350       offset += dissected;
9351       break;
9352     default:
9353       /* Don't know how to handle this vendor */
9354       break;
9355     }
9356     break;
9357   case PA_GAS_INITIAL_REQUEST:
9358     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9359     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
9360                                              &type, &subtype);
9361     offset += dissect_gas_initial_request(tree, tvb, pinfo, offset, type,
9362                                           subtype);
9363     break;
9364   case PA_GAS_INITIAL_RESPONSE:
9365     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9366     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9367     offset += add_ff_gas_comeback_delay(tree, tvb, pinfo, offset);
9368     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
9369                                              &type, &subtype);
9370     offset += dissect_gas_initial_response(tree, tvb, pinfo, offset, type,
9371                                            subtype);
9372     break;
9373   case PA_GAS_COMEBACK_REQUEST:
9374     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9375     break;
9376   case PA_GAS_COMEBACK_RESPONSE:
9377     dialog_token = tvb_get_guint8(tvb, offset);
9378     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9379     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9380     frag = tvb_get_guint8(tvb, offset) & 0x7f;
9381     more = (tvb_get_guint8(tvb, offset) & 0x80) != 0;
9382     offset += add_ff_gas_fragment_id(tree, tvb, pinfo, offset);
9383     offset += add_ff_gas_comeback_delay(tree, tvb, pinfo, offset);
9384     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
9385                                              &type, &subtype);
9386     offset += dissect_gas_comeback_response(tree, tvb, pinfo, offset, type,
9387                                             subtype, frag, more, dialog_token);
9388     break;
9389   case PA_TDLS_DISCOVERY_RESPONSE:
9390     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
9391     col_set_str(pinfo->cinfo, COL_INFO, "TDLS Discovery Response");
9392     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9393     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
9394     break;
9395   case PA_QAB_REQUEST:
9396   case PA_QAB_RESPONSE:
9397     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9398     offset += add_ff_req_ap_addr(tree, tvb, pinfo, offset);
9399     offset += add_ff_res_ap_addr(tree, tvb, pinfo, offset);
9400     break;
9401   }
9402
9403   return offset - start;  /* Size of fixed fields */
9404 }
9405
9406 static guint
9407 add_ff_action_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9408 {
9409   guint8 code;
9410   guint start = offset;
9411   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9412   code    = tvb_get_guint8(tvb, offset);
9413   offset += add_ff_pa_action_code(tree, tvb, pinfo, offset);
9414   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
9415   return offset - start;
9416 }
9417
9418 static guint
9419 add_ff_action_protected_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9420 {
9421   guint8 code;
9422   guint start = offset;
9423   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9424   code    = tvb_get_guint8(tvb, offset);
9425   offset += add_ff_ppa_action_code(tree, tvb, pinfo, offset);
9426   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
9427   return offset - start;
9428 }
9429
9430 static guint
9431 add_ff_action_radio_measurement(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9432 {
9433   guint  start = offset;
9434   guint8 code;
9435
9436   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9437   code = tvb_get_guint8(tvb, offset);
9438   offset += add_ff_rm_action_code(tree, tvb, pinfo, offset);
9439
9440   switch (code) {
9441   case RM_ACTION_RADIO_MEASUREMENT_REQUEST:
9442     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9443     offset += add_ff_rm_repetitions(tree, tvb, pinfo, offset);
9444     /* Followed by Measurement Request Elements */
9445     break;
9446   case RM_ACTION_RADIO_MEASUREMENT_REPORT:
9447     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9448     /* Followed by Measurement Report Elements */
9449     break;
9450   case RM_ACTION_LINK_MEASUREMENT_REQUEST:
9451     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9452     offset += add_ff_rm_tx_power(tree, tvb, pinfo, offset);
9453     offset += add_ff_rm_max_tx_power(tree, tvb, pinfo, offset);
9454     /* Followed by Optional Subelements */
9455     break;
9456   case RM_ACTION_LINK_MEASUREMENT_REPORT:
9457     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9458     offset += add_ff_rm_tpc_report(tree, tvb, pinfo, offset);
9459     offset += add_ff_rm_rx_antenna_id(tree, tvb, pinfo, offset);
9460     offset += add_ff_rm_tx_antenna_id(tree, tvb, pinfo, offset);
9461     offset += add_ff_rm_rcpi(tree, tvb, pinfo, offset);
9462     offset += add_ff_rm_rsni(tree, tvb, pinfo, offset);
9463     /* Followed by Optional Subelements */
9464     break;
9465   case RM_ACTION_NEIGHBOR_REPORT_REQUEST:
9466     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9467     /* Followed by Optional Subelements */
9468     break;
9469   case RM_ACTION_NEIGHBOR_REPORT_RESPONSE:
9470     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9471     /* Followed by Neighbor Report Elements */
9472     break;
9473   }
9474
9475   return offset - start;  /* Size of fixed fields */
9476 }
9477
9478 static guint
9479 add_ff_action_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9480 {
9481   guint  start = offset;
9482   guint8 code;
9483
9484   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9485   code    = tvb_get_guint8(tvb, offset);
9486   offset += add_ff_ft_action_code(tree, tvb, pinfo, offset);
9487
9488   switch (code) {
9489   case FT_ACTION_REQUEST:
9490     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
9491     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
9492     /* Followed by FT Request frame body (IEs) */
9493     break;
9494   case FT_ACTION_RESPONSE:
9495     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
9496     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
9497     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9498     /* Followed by FT Response frame body (IEs) */
9499     break;
9500   case FT_ACTION_CONFIRM:
9501     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
9502     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
9503     /* Followed by FT Confirm frame body (IEs) */
9504     break;
9505   case FT_ACTION_ACK:
9506     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
9507     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
9508     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9509     /* Followed by FT Ack frame body (IEs) */
9510     break;
9511   }
9512
9513   return offset - start;  /* Size of fixed fields */
9514 }
9515
9516 static guint
9517 add_ff_action_sa_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9518 {
9519   guint  start = offset;
9520   guint8 code;
9521
9522   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9523   code    = tvb_get_guint8(tvb, offset);
9524   offset += add_ff_sa_query_action_code(tree, tvb, pinfo, offset);
9525
9526   switch (code) {
9527   case SA_QUERY_REQUEST:
9528     offset += add_ff_transaction_id(tree, tvb, pinfo, offset);
9529     break;
9530   case SA_QUERY_RESPONSE:
9531     offset += add_ff_transaction_id(tree, tvb, pinfo, offset);
9532     break;
9533   }
9534
9535   return offset - start;  /* Size of fixed fields */
9536 }
9537
9538 static guint
9539 add_ff_action_mesh(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9540 {
9541   guint length;
9542
9543   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9544   offset += add_ff_mesh_action(tree, tvb, pinfo, offset);
9545   /* The only fixed fields are the category and mesh action.  The rest are IEs.
9546    */
9547   length = 2;
9548   if (tvb_get_guint8(tvb, 1) == MESH_ACTION_TBTT_ADJ_RESPONSE) {
9549     /* ..except for the TBTT Adjustment Response, which has a status code field
9550      */
9551     length += add_ff_status_code(tree, tvb, pinfo, offset);
9552   }
9553   return length;
9554 }
9555
9556 static guint
9557 add_ff_action_multihop(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9558 {
9559   guint start = offset;
9560
9561   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9562   offset += add_ff_multihop_action(tree, tvb, pinfo, offset);
9563   offset += add_ff_mesh_control(tree, tvb, pinfo, offset);
9564   return offset - start;
9565 }
9566
9567 static guint
9568 add_ff_action_self_protected(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9569 {
9570   guint start = offset;
9571
9572   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9573   offset += add_ff_selfprot_action(tree, tvb, pinfo, offset);
9574
9575   switch (tvb_get_guint8(tvb, start + 1)) {
9576   case SELFPROT_ACTION_MESH_PEERING_OPEN:
9577     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
9578     break;
9579   case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
9580     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
9581     offset += add_ff_assoc_id(tree, tvb, pinfo, offset);
9582     break;
9583   }
9584
9585   return offset - start;
9586 }
9587
9588 static guint
9589 add_ff_vht_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9590 {
9591   proto_tree_add_item(tree, hf_ieee80211_ff_vht_action, tvb, offset, 1,
9592                       ENC_LITTLE_ENDIAN);
9593   return 1;
9594 }
9595
9596 static guint
9597 get_ff_auth_sae_len(tvbuff_t *tvb)
9598 {
9599   guint alg, seq, status_code;
9600   alg = tvb_get_letohs(tvb, 0);
9601
9602   /* SAE authentication is alg 3 (cf auth_alg) */
9603   if (alg != 3)
9604     return 0;
9605
9606   seq = tvb_get_letohs(tvb, 2);
9607   status_code = tvb_get_letohs(tvb, 4);
9608
9609   /* 82: Rejected with Suggested BSS Transition (cf ieee80211_status_code) */
9610   if ((seq == 2) && (status_code == 82))
9611     return 0;
9612
9613   /* everything is fixed size fields */
9614   return tvb_reported_length_remaining(tvb, 6);
9615 }
9616
9617 static void
9618 add_ff_auth_sae(proto_tree *tree, tvbuff_t *tvb)
9619 {
9620   guint alg, seq, status_code, len;
9621   alg = tvb_get_letohs(tvb, 0);
9622
9623   /* SAE authentication is alg 3 (cf auth_alg) */
9624   if (alg != 3)
9625     return;
9626
9627   seq = tvb_get_letohs(tvb, 2);
9628   status_code = tvb_get_letohs(tvb, 4);
9629
9630   if (seq == 1)
9631   {
9632     /* 76: Authentication is rejected because an Anti-Clogging Token is required (cf ieee80211_status_code) */
9633     if (status_code == 76)
9634     {
9635       proto_tree_add_item(tree, hf_ieee80211_ff_finite_cyclic_group, tvb, 6, 2,
9636                           ENC_LITTLE_ENDIAN);
9637       len = tvb_reported_length_remaining(tvb, 8);
9638       proto_tree_add_item(tree, hf_ieee80211_ff_anti_clogging_token, tvb, 8, len,
9639                           ENC_NA);
9640     }
9641     else if (status_code == 0)
9642     {
9643       guint group = tvb_get_letohs(tvb, 6);
9644       guint sc_len, elt_len, offset;
9645       proto_tree_add_item(tree, hf_ieee80211_ff_finite_cyclic_group, tvb, 6, 2,
9646                           ENC_LITTLE_ENDIAN);
9647       offset = 8;
9648       len = tvb_reported_length_remaining(tvb, offset);
9649       switch (group)
9650       {
9651         /* Diffie-Hellman groups */
9652         case 1:
9653           sc_len = elt_len = 96;
9654           break;
9655         case 2:
9656           sc_len = elt_len = 128;
9657           break;
9658         case 5:
9659           sc_len = elt_len = 192;
9660           break;
9661         case 14:
9662           sc_len = elt_len = 256;
9663           break;
9664         case 15:
9665           sc_len = elt_len = 384;
9666           break;
9667         case 16:
9668           sc_len = elt_len = 512;
9669           break;
9670         case 17:
9671           sc_len = elt_len = 768;
9672           break;
9673         case 18:
9674           sc_len = elt_len = 1024;
9675           break;
9676         case 22:
9677           sc_len = 20;
9678           elt_len = 128;
9679           break;
9680         case 23:
9681           sc_len = 28;
9682           elt_len = 256;
9683           break;
9684         case 24:
9685           sc_len = 32;
9686           elt_len = 256;
9687           break;
9688         /* ECC groups */
9689         case 19:
9690         case 28:
9691           sc_len = 32;
9692           elt_len = 64;
9693           break;
9694         case 20:
9695         case 29:
9696           sc_len = 48;
9697           elt_len = 96;
9698           break;
9699         case 21:
9700           sc_len = 66;
9701           elt_len = 132;
9702           break;
9703         case 25:
9704           sc_len = 24;
9705           elt_len = 48;
9706           break;
9707         case 26:
9708           sc_len = 28;
9709           elt_len = 56;
9710           break;
9711         case 30:
9712           sc_len = 64;
9713           elt_len = 128;
9714           break;
9715         default:
9716           /* assume no anti-clogging token */
9717           if (!(len % 3))
9718           {
9719             sc_len = len / 3;
9720           }
9721           else
9722           {
9723             sc_len = len / 2;
9724           }
9725           elt_len = len - sc_len;
9726           break;
9727       }
9728
9729       if ((sc_len + elt_len) < len)
9730       {
9731         len = len - (sc_len + elt_len);
9732         proto_tree_add_item(tree, hf_ieee80211_ff_anti_clogging_token, tvb, offset,
9733                             len, ENC_NA);
9734         offset += len;
9735       }
9736       proto_tree_add_item(tree, hf_ieee80211_ff_scalar, tvb, offset,
9737                           sc_len, ENC_NA);
9738       offset += sc_len;
9739       proto_tree_add_item(tree, hf_ieee80211_ff_finite_field_element, tvb, offset,
9740                           elt_len, ENC_NA);
9741     }
9742   }
9743   /* 82: Rejected with Suggested BSS Transition (cf ieee80211_status_code) */
9744   else if ((seq == 2) && (status_code != 82))
9745   {
9746     proto_tree_add_item(tree, hf_ieee80211_ff_send_confirm, tvb, 6, 2,
9747                         ENC_LITTLE_ENDIAN);
9748     len = tvb_reported_length_remaining(tvb, 8);
9749     proto_tree_add_item(tree, hf_ieee80211_ff_confirm, tvb, 8, len,
9750                         ENC_NA);
9751   };
9752 }
9753
9754 static guint
9755 wnm_bss_trans_mgmt_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9756 {
9757   int    start = offset;
9758   gint   left;
9759   int tmp_sublen;
9760   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
9761
9762
9763   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9764
9765   proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_query_reason, tvb, offset, 1,
9766                       ENC_NA);
9767   offset += 1;
9768
9769   left = tvb_reported_length_remaining(tvb, offset);
9770   if (left > 0) {
9771     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9772                         tvb, offset, left, ENC_NA);
9773
9774     while (left > 0){
9775       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9776       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9777         break;
9778       }
9779       left -= (tmp_sublen + 2);
9780       offset += (tmp_sublen + 2);
9781     }
9782   }
9783
9784   return offset - start;
9785 }
9786
9787
9788 static guint
9789 wnm_bss_trans_mgmt_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9790 {
9791   int    start = offset;
9792   guint8 mode;
9793   gint   left;
9794   int tmp_sublen;
9795   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
9796
9797   static const int *ieee80211_ff_request_flags[] = {
9798     &hf_ieee80211_ff_request_mode_pref_cand,
9799     &hf_ieee80211_ff_request_mode_abridged,
9800     &hf_ieee80211_ff_request_mode_disassoc_imminent,
9801     &hf_ieee80211_ff_request_mode_bss_term_included,
9802     &hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
9803     NULL
9804   };
9805
9806   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9807
9808   mode = tvb_get_guint8(tvb, offset);
9809   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_ff_request_flags, ENC_LITTLE_ENDIAN);
9810   offset += 1;
9811
9812   proto_tree_add_item(tree, hf_ieee80211_ff_disassoc_timer, tvb, offset, 2,
9813                       ENC_LITTLE_ENDIAN);
9814   offset += 2;
9815
9816   proto_tree_add_item(tree, hf_ieee80211_ff_validity_interval, tvb, offset, 1,
9817                       ENC_LITTLE_ENDIAN);
9818   offset += 1;
9819
9820   if (mode & 0x08) {
9821     proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_duration,
9822                         tvb, offset, 8, ENC_NA);
9823     offset += 8;
9824   }
9825
9826   if (mode & 0x10) {
9827     guint8 url_len;
9828     url_len = tvb_get_guint8(tvb, offset);
9829     proto_tree_add_item(tree, hf_ieee80211_ff_url_len, tvb, offset, 1,
9830                         ENC_LITTLE_ENDIAN);
9831     offset += 1;
9832     proto_tree_add_item(tree, hf_ieee80211_ff_url, tvb, offset, url_len,
9833                         ENC_ASCII|ENC_NA);
9834     offset += url_len;
9835   }
9836
9837   left = tvb_reported_length_remaining(tvb, offset);
9838   if (left > 0) {
9839     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9840                         tvb, offset, left, ENC_NA);
9841
9842     while (left > 0){
9843       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9844       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9845         break;
9846       }
9847       left -= (tmp_sublen + 2);
9848       offset += (tmp_sublen + 2);
9849     }
9850   }
9851
9852   return offset - start;
9853 }
9854
9855
9856 static guint
9857 wnm_bss_trans_mgmt_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9858 {
9859   int    start = offset;
9860   guint8 code;
9861   gint   left;
9862   int tmp_sublen;
9863   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
9864
9865   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9866   code = tvb_get_guint8(tvb, offset);
9867   offset += add_ff_bss_transition_status_code(tree, tvb, pinfo, offset);
9868   offset += add_ff_bss_termination_delay(tree, tvb, pinfo, offset);
9869   if (!code) {
9870     proto_tree_add_item(tree, hf_ieee80211_ff_target_bss,
9871                         tvb, offset, 6, ENC_NA);
9872     offset += 6;
9873   }
9874   left = tvb_reported_length_remaining(tvb, offset);
9875   if (left > 0) {
9876     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9877                         tvb, offset, left, ENC_NA);
9878     while (left > 0){
9879       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9880       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9881         break;
9882       }
9883       left -= (tmp_sublen + 2);
9884       offset += (tmp_sublen + 2);
9885     }
9886   }
9887
9888   return offset - start;
9889 }
9890
9891 static guint
9892 wnm_sleep_mode_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9893 {
9894   int start = offset;
9895   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9896   return offset - start;
9897 }
9898
9899 static guint
9900 wnm_sleep_mode_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9901 {
9902   int start = offset;
9903   guint16 key_data_len;
9904   gint left;
9905
9906   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9907   key_data_len = tvb_get_letohs(tvb, offset);
9908   offset += add_ff_key_data_length(tree, tvb, pinfo, offset);
9909   left = tvb_reported_length_remaining(tvb, offset);
9910   if (left < key_data_len) {
9911     expert_add_info(pinfo, tree, &ei_ieee80211_tag_wnm_sleep_mode_no_key_data);
9912     return offset - start;
9913   }
9914   proto_tree_add_item(tree, hf_ieee80211_ff_key_data, tvb, offset,
9915                       key_data_len, ENC_NA);
9916   offset += key_data_len;
9917   return offset - start;
9918 }
9919
9920 static guint
9921 wnm_tfs_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9922 {
9923   int start = offset;
9924   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9925   return offset - start;
9926 }
9927
9928 static guint
9929 wnm_tfs_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9930 {
9931   int start = offset;
9932   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9933   return offset - start;
9934 }
9935
9936 #define AP_DESCRIPTOR            0
9937 #define FIRMWARE_VERSION_CURRENT 1
9938 #define FIRMWARE_VERSION_NEW     2
9939
9940 static guint
9941 dissect_wnm_subelements(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
9942   int offset) {
9943   guint sub_elt_id = tvb_get_guint8(tvb, offset);
9944   guint sub_elt_len = tvb_get_guint8(tvb, offset + 1);
9945
9946   proto_tree_add_item(tree, hf_ieee80211_wnm_sub_elt_id, tvb, offset, 1, ENC_NA);
9947   offset++;
9948
9949   proto_tree_add_item(tree, hf_ieee80211_wnm_sub_elt_len, tvb, offset, 1, ENC_NA);
9950   offset++;
9951
9952   switch (sub_elt_id) {
9953   case AP_DESCRIPTOR:
9954
9955     break;
9956
9957   case FIRMWARE_VERSION_CURRENT:
9958
9959     break;
9960
9961   case FIRMWARE_VERSION_NEW:
9962
9963     break;
9964   }
9965
9966   offset += sub_elt_len;
9967   return offset;
9968 }
9969
9970 static guint
9971 wnm_notification_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9972 {
9973   int start = offset;
9974   int len = 0;
9975   guint8 wnm_type = 0;
9976   guint8 wnm_sub_elt = 0;
9977
9978   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9979   wnm_type = tvb_get_guint8(tvb, offset);
9980   offset += add_ff_wnm_notification_type(tree, tvb, pinfo, offset);
9981   len = tvb_reported_length_remaining(tvb, offset);
9982
9983   if (wnm_type == 0) {
9984     int offset_end = offset + len;
9985     while (offset < offset_end) {
9986       int start_offset = offset;
9987       proto_tree *wnm_list = NULL;
9988       proto_item *wnm_item = NULL;
9989       wnm_list = proto_tree_add_subtree_format(tree, tvb, offset, -1,
9990                         ett_wnm_notif_subelt,
9991                         &wnm_item, "WNM Subelement %d", wnm_sub_elt);
9992       offset = dissect_wnm_subelements(wnm_list, tvb, pinfo, offset);
9993       proto_item_set_len(wnm_item, offset - start_offset);
9994     }
9995   }
9996   return offset - start;
9997 }
9998
9999 static guint
10000 add_ff_action_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10001 {
10002   guint8 code;
10003   guint  start = offset;
10004
10005   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10006   code    = tvb_get_guint8(tvb, offset);
10007   offset += add_ff_wnm_action_code(tree, tvb, pinfo, offset);
10008   switch (code) {
10009   case WNM_BSS_TRANS_MGMT_QUERY:
10010     offset += wnm_bss_trans_mgmt_query(tree, tvb, pinfo, offset);
10011     break;
10012   case WNM_BSS_TRANS_MGMT_REQ:
10013     offset += wnm_bss_trans_mgmt_req(tree, tvb, pinfo, offset);
10014     break;
10015   case WNM_BSS_TRANS_MGMT_RESP:
10016     offset += wnm_bss_trans_mgmt_resp(tree, tvb, pinfo, offset);
10017     break;
10018   case WNM_TFS_REQ:
10019     offset += wnm_tfs_req(tree, tvb, pinfo, offset);
10020     break;
10021   case WNM_TFS_RESP:
10022     offset += wnm_tfs_resp(tree, tvb, pinfo, offset);
10023     break;
10024   case WNM_SLEEP_MODE_REQ:
10025     offset += wnm_sleep_mode_req(tree, tvb, pinfo, offset);
10026     break;
10027   case WNM_SLEEP_MODE_RESP:
10028     offset += wnm_sleep_mode_resp(tree, tvb, pinfo, offset);
10029     break;
10030   case WNM_NOTIFICATION_REQ:
10031     offset += wnm_notification_req(tree, tvb, pinfo, offset);
10032     break;
10033   }
10034
10035   return offset - start;  /* Size of fixed fields */
10036 }
10037
10038 static guint
10039 add_ff_action_unprotected_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10040 {
10041   guint8 code;
10042   guint  start = offset;
10043
10044   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10045   code    = tvb_get_guint8(tvb, offset);
10046   offset += add_ff_unprotected_wnm_action_code(tree, tvb, pinfo, offset);
10047
10048   switch (code) {
10049   case UNPROTECTED_WNM_TIM:
10050     offset += add_ff_check_beacon(tree, tvb, pinfo, offset);
10051     offset += add_ff_timestamp(tree, tvb, pinfo, offset);
10052     offset += add_ff_tod(tree, tvb, pinfo, offset);
10053     offset += add_ff_toa(tree, tvb, pinfo, offset);
10054     offset += add_ff_max_tod_err(tree, tvb, pinfo, offset);
10055     offset += add_ff_max_toa_err(tree, tvb, pinfo, offset);
10056     break;
10057   case UNPROTECTED_WNM_TIMING_MEASUREMENT:
10058     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10059     offset += add_ff_followup_dialog_token(tree, tvb, pinfo, offset);
10060     break;
10061   }
10062
10063   return offset - start;  /* Size of fixed fields */
10064 }
10065
10066 static guint
10067 add_ff_action_tdls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10068 {
10069   guint8  code;
10070   guint16 status;
10071   guint   start = offset;
10072
10073   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10074   code = tvb_get_guint8(tvb, offset);
10075   offset += add_ff_tdls_action_code(tree, tvb, pinfo, offset);
10076   switch (code) {
10077   case TDLS_SETUP_REQUEST:
10078     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10079     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
10080     break;
10081   case TDLS_SETUP_RESPONSE:
10082     status = tvb_get_letohs(tvb, offset);
10083     offset += add_ff_status_code(tree, tvb, pinfo, offset);
10084     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10085     if (tvb_reported_length_remaining(tvb, offset) < 2) {
10086       if (status == 0) {
10087         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_response_malformed);
10088       }
10089       break;
10090     }
10091     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
10092     break;
10093   case TDLS_SETUP_CONFIRM:
10094     status = tvb_get_letohs(tvb, offset);
10095     offset += add_ff_status_code(tree, tvb, pinfo, offset);
10096     if (tvb_reported_length_remaining(tvb, offset) < 1) {
10097       if (status == 0) {
10098         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_confirm_malformed);
10099       }
10100       break;
10101     }
10102     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10103     break;
10104   case TDLS_TEARDOWN:
10105     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
10106     break;
10107   case TDLS_PEER_TRAFFIC_INDICATION:
10108     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10109     break;
10110   case TDLS_CHANNEL_SWITCH_REQUEST:
10111     offset += add_ff_target_channel(tree, tvb, pinfo, offset);
10112     offset += add_ff_operating_class(tree, tvb, pinfo, offset);
10113     break;
10114   case TDLS_CHANNEL_SWITCH_RESPONSE:
10115     offset += add_ff_status_code(tree, tvb, pinfo, offset);
10116     break;
10117   case TDLS_PEER_PSM_REQUEST:
10118     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10119     break;
10120   case TDLS_PEER_PSM_RESPONSE:
10121     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10122     offset += add_ff_status_code(tree, tvb, pinfo, offset);
10123     break;
10124   case TDLS_PEER_TRAFFIC_RESPONSE:
10125     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10126     break;
10127   case TDLS_DISCOVERY_REQUEST:
10128     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10129     break;
10130   }
10131
10132   return offset - start;  /* Size of fixed fields */
10133 }
10134
10135 static guint
10136 add_ff_action_mgmt_notification(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10137 {
10138   guint start = offset;
10139
10140   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10141   offset += add_ff_wme_action_code(tree, tvb, pinfo, offset);
10142   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10143   offset += add_ff_wme_status_code(tree, tvb, pinfo, offset);
10144
10145   return offset - start;  /* Size of fixed fields */
10146 }
10147
10148 static guint
10149 add_ff_action_vendor_specific(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10150 {
10151   guint   start = offset;
10152   guint32 oui;
10153   tvbuff_t *vendor_tvb;
10154   int dissected;
10155
10156   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10157   proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
10158   offset += 3;
10159
10160   vendor_tvb = tvb_new_subset_remaining(tvb, offset);
10161   dissected = dissector_try_uint_new(vendor_specific_action_table, oui, vendor_tvb, pinfo, tree, FALSE, NULL);
10162   if (dissected <= 0)
10163   {
10164       call_data_dissector(vendor_tvb, pinfo, tree);
10165       /* don't advance the dissector pointer as this will probably cause more malformed packets
10166          if vendor is unknown. It also matches previous behavior (before dissection table implementation) */
10167       dissected = 0;
10168   }
10169
10170   offset += dissected;
10171
10172   return offset - start;  /* Size of fixed fields */
10173 }
10174
10175 static guint
10176 add_ff_action_ht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10177 {
10178   guint  start = offset;
10179   guint8 n_sta, i;
10180   mimo_control_t mimo_cntrl;
10181
10182   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10183   offset += add_ff_ht_action_code(tree, tvb, pinfo, offset);
10184
10185   switch (tvb_get_guint8(tvb, offset - 1)) {
10186   case HT_ACTION_NOTIFY_CHAN_WIDTH:
10187     offset += add_ff_channel_width(tree, tvb, pinfo, offset);
10188     break;
10189   case HT_ACTION_SM_PWR_SAVE:
10190     offset += add_ff_sm_pwr_cntrl(tree, tvb, pinfo, offset);
10191     break;
10192   case HT_ACTION_PSMP_ACTION:
10193     n_sta = tvb_get_guint8(tvb, offset);
10194     offset += add_ff_psmp_param_set(tree, tvb, pinfo, offset);
10195     for (i = 0; i < (n_sta & 0x0F); i++) {
10196       offset += add_ff_psmp_sta_info(tree, tvb, pinfo, offset);
10197     }
10198     break;
10199   case HT_ACTION_SET_PCO_PHASE:
10200     offset += add_ff_pco_phase_cntrl(tree, tvb, pinfo, offset);
10201     break;
10202   case HT_ACTION_MIMO_CSI:
10203     mimo_cntrl = get_mimo_control(tvb, offset);
10204     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
10205     offset += add_mimo_csi_matrices_report(tree, tvb, offset, mimo_cntrl);
10206     break;
10207   case HT_ACTION_MIMO_BEAMFORMING:
10208     mimo_cntrl = get_mimo_control(tvb, offset);
10209     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
10210     offset += add_mimo_beamforming_feedback_report(tree, tvb, offset,
10211                                                    mimo_cntrl);
10212     break;
10213   case HT_ACTION_MIMO_COMPRESSED_BEAMFORMING:
10214     mimo_cntrl = get_mimo_control(tvb, offset);
10215     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
10216     offset += add_mimo_compressed_beamforming_feedback_report(tree, tvb,
10217                                                               offset,
10218                                                               mimo_cntrl);
10219     break;
10220   case HT_ACTION_ANT_SEL_FEEDBACK:
10221     offset += add_ff_ant_selection(tree, tvb, pinfo, offset);
10222     break;
10223   case HT_ACTION_HT_INFO_EXCHANGE:
10224     offset += add_ff_ht_information(tree, tvb, pinfo, offset);
10225     break;
10226   }
10227
10228   return offset - start;
10229 }
10230
10231 static guint
10232 add_ff_beacon_interval_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10233 {
10234   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bic,
10235                                     ett_bic_tree, ieee80211_ff_bic_fields,
10236                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10237
10238   return 6;
10239 }
10240
10241 static guint
10242 add_ff_beamforming_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset, gboolean isGrant)
10243 {
10244   guint16 bf_field = tvb_get_letohs(tvb, offset);
10245   gboolean isInit = (bf_field & 0x2) >> 1;
10246   gboolean isResp = (bf_field & 0x4) >> 2;
10247   static const int *ieee80211_ff_beamforming_ctrl[] = {
10248     &hf_ieee80211_ff_bf_train,
10249     &hf_ieee80211_ff_bf_is_init,
10250     &hf_ieee80211_ff_bf_is_resp,
10251     &hf_ieee80211_ff_bf_rxss_len,
10252     &hf_ieee80211_ff_bf_rxss_rate,
10253     &hf_ieee80211_ff_bf_b10b15,
10254     NULL
10255   };
10256
10257   static const int *ieee80211_ff_beamforming_ctrl_grant[] = {
10258     &hf_ieee80211_ff_bf_train,
10259     &hf_ieee80211_ff_bf_is_init,
10260     &hf_ieee80211_ff_bf_is_resp,
10261     &hf_ieee80211_ff_bf_num_sectors,
10262     &hf_ieee80211_ff_bf_num_rx_dmg_ants,
10263     &hf_ieee80211_ff_bf_b12b15,
10264     NULL
10265   };
10266
10267   if((isInit==TRUE) && (isResp==TRUE) && isGrant) {
10268     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bf,
10269                                     ett_bf_tree, ieee80211_ff_beamforming_ctrl_grant,
10270                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10271   } else {
10272     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bf,
10273                                     ett_bf_tree, ieee80211_ff_beamforming_ctrl,
10274                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10275   }
10276   return 2;
10277 }
10278
10279 static guint
10280 add_ff_dynamic_allocation(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10281 {
10282   static const int *ieee80211_ff_dynamic_allocation[] = {
10283     &hf_ieee80211_ff_TID,
10284     &hf_ieee80211_ff_alloc_type,
10285     &hf_ieee80211_ff_src_aid,
10286     &hf_ieee80211_ff_dest_aid,
10287     &hf_ieee80211_ff_alloc_duration,
10288     &hf_ieee80211_ff_b39,
10289     NULL
10290   };
10291
10292   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_dynamic_allocation,
10293                                     ett_dynamic_alloc_tree, ieee80211_ff_dynamic_allocation,
10294                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10295
10296   return 5;
10297 }
10298
10299 static guint
10300 add_ff_beamformed_link(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10301 {
10302   static const int *ieee80211_ff_beamformed_link[] = {
10303     &hf_ieee80211_ff_blm_unit_index,
10304     &hf_ieee80211_ff_blm_maint_value,
10305     &hf_ieee80211_ff_blm_is_master,
10306     NULL
10307   };
10308
10309   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_blm,
10310                                     ett_blm_tree, ieee80211_ff_beamformed_link,
10311                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10312   return 1;
10313 }
10314
10315 static guint
10316 add_ff_BRP_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10317 {
10318   static const int *ieee80211_ff_BRP_request[] = {
10319     &hf_ieee80211_ff_brp_L_RX,
10320     &hf_ieee80211_ff_brp_TX_TRN_REQ,
10321     &hf_ieee80211_ff_brp_MID_REQ,
10322     &hf_ieee80211_ff_brp_BC_REQ,
10323     &hf_ieee80211_ff_brp_MID_GRANT,
10324     &hf_ieee80211_ff_brp_BC_GRANT,
10325     &hf_ieee80211_ff_brp_chan_FBCK_CAP,
10326     &hf_ieee80211_ff_brp_tx_sector,
10327     &hf_ieee80211_ff_brp_other_aid,
10328     &hf_ieee80211_ff_brp_tx_antenna,
10329     &hf_ieee80211_ff_brp_reserved,
10330     NULL
10331   };
10332
10333   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_brp,
10334                                     ett_brp_tree, ieee80211_ff_BRP_request,
10335                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10336   return 4;
10337 }
10338
10339 static guint
10340 add_ff_sector_sweep_feedback_from_iss(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10341 {
10342   static const int *ieee80211_ff_sector_sweep_feedback_from_iss[] = {
10343     &hf_ieee80211_ff_sswf_total_sectors,
10344     &hf_ieee80211_ff_sswf_num_rx_dmg_ants,
10345     &hf_ieee80211_ff_sswf_reserved1,
10346     &hf_ieee80211_ff_sswf_poll_required,
10347     &hf_ieee80211_ff_sswf_reserved2,
10348     NULL
10349   };
10350
10351   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_sswf,
10352                                     ett_sswf_tree, ieee80211_ff_sector_sweep_feedback_from_iss,
10353                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10354   return 3;
10355 }
10356
10357 static guint
10358 add_ff_sector_sweep_feedback_to_iss(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10359 {
10360   static const int *ieee80211_ff_sector_sweep_feedback_to_iss[] = {
10361     &hf_ieee80211_ff_sswf_sector_select,
10362     &hf_ieee80211_ff_sswf_dmg_antenna_select,
10363     &hf_ieee80211_ff_sswf_snr_report,
10364     &hf_ieee80211_ff_sswf_poll_required,
10365     &hf_ieee80211_ff_sswf_reserved2,
10366     NULL
10367   };
10368
10369   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_sswf,
10370                                     ett_sswf_tree, ieee80211_ff_sector_sweep_feedback_to_iss,
10371                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10372   return 3;
10373 }
10374
10375 static guint
10376 add_ff_sector_sweep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10377 {
10378   static const int *ieee80211_ff_sector_sweep[] = {
10379     &hf_ieee80211_ff_ssw_direction,
10380     &hf_ieee80211_ff_ssw_cdown,
10381     &hf_ieee80211_ff_ssw_sector_id,
10382     &hf_ieee80211_ff_ssw_dmg_ant_id,
10383     &hf_ieee80211_ff_ssw_rxss_len,
10384     NULL
10385   };
10386
10387   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_ssw,
10388                                     ett_ssw_tree, ieee80211_ff_sector_sweep,
10389                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10390   return 3;
10391 }
10392
10393 static guint
10394 add_ff_dmg_params(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10395 {
10396   static const int *ieee80211_ff_dmg_params[] = {
10397     &hf_ieee80211_ff_dmg_params_bss,
10398     &hf_ieee80211_ff_dmg_params_cbap_only,
10399     &hf_ieee80211_ff_dmg_params_cbap_src,
10400     &hf_ieee80211_ff_dmg_params_privacy,
10401     &hf_ieee80211_ff_dmg_params_policy,
10402     NULL
10403   };
10404
10405   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_dmg_params,
10406                                     ett_dmg_params_tree, ieee80211_ff_dmg_params,
10407                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10408   return 1;
10409 }
10410
10411 static guint
10412 add_ff_cc_field(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean dis)
10413 {
10414   proto_item *cc_item = proto_tree_add_item(tree, hf_ieee80211_ff_cc, tvb, offset, 8, ENC_LITTLE_ENDIAN);
10415   proto_tree *cc_tree = proto_item_add_subtree(cc_item, ett_cc_tree);
10416   guint64 cc_field;
10417   if(dis) {
10418     proto_tree_add_item(cc_tree, hf_ieee80211_ff_cc_abft_resp_addr, tvb, offset, 6, ENC_NA);
10419   } else {
10420     cc_field = tvb_get_letoh64(tvb, offset);
10421     /*TODO : Add support of bitmask for FT_(U)INT64 */
10422     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_sp_duration, tvb, offset, 1, (guint32)(cc_field & 0xff));
10423     proto_tree_add_uint64(cc_tree, hf_ieee80211_ff_cc_cluster_id, tvb, offset+1, 6, (guint64)((cc_field & G_GUINT64_CONSTANT(0x00ffffffffffff00)) >> 8));
10424     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_role, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x0300000000000000)) >> 56));
10425     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_max_mem, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x7c00000000000000)) >> 58));
10426   }
10427   return 8;
10428 }
10429
10430
10431 static guint
10432 add_ff_band_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10433 {
10434   proto_tree_add_item(tree, hf_ieee80211_ff_band_id, tvb, offset, 1, ENC_NA);
10435   return 1;
10436 }
10437
10438 static guint
10439 add_ff_subject_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10440 {
10441   proto_tree_add_item(tree, hf_ieee80211_ff_subject_address, tvb, offset, 6, ENC_NA);
10442   return 6;
10443 }
10444
10445 static guint
10446 add_ff_handover_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10447 {
10448   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reason, tvb, offset, 1, ENC_NA);
10449   return 1;
10450 }
10451
10452 static guint
10453 add_ff_handover_remaining_bi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10454 {
10455   proto_tree_add_item(tree, hf_ieee80211_ff_handover_remaining_bi, tvb, offset, 1, ENC_NA);
10456   return 1;
10457 }
10458
10459 static guint
10460 add_ff_handover_result(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10461 {
10462   proto_tree_add_item(tree, hf_ieee80211_ff_handover_result, tvb, offset, 1, ENC_NA);
10463   return 1;
10464 }
10465
10466 static guint
10467 add_ff_handover_reject_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10468 {
10469   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reject_reason, tvb, offset, 1, ENC_NA);
10470   return 1;
10471 }
10472
10473 static guint
10474 add_ff_destination_reds_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10475 {
10476   proto_tree_add_item(tree, hf_ieee80211_ff_destination_reds_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10477   return 2;
10478 }
10479
10480 static guint
10481 add_ff_destination_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10482 {
10483   proto_tree_add_item(tree, hf_ieee80211_ff_destination_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10484   return 2;
10485 }
10486
10487 static guint
10488 add_ff_realy_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10489 {
10490   proto_tree_add_item(tree, hf_ieee80211_ff_realy_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10491   return 2;
10492 }
10493
10494 static guint
10495 add_ff_source_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10496 {
10497   proto_tree_add_item(tree, hf_ieee80211_ff_source_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10498   return 2;
10499 }
10500
10501 static guint
10502 add_ff_timing_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10503 {
10504   proto_tree_add_item(tree, hf_ieee80211_ff_timing_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10505   return 2;
10506 }
10507
10508 static guint
10509 add_ff_sampling_frequency_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10510 {
10511   proto_tree_add_item(tree, hf_ieee80211_ff_sampling_frequency_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10512   return 2;
10513 }
10514
10515 static guint
10516 add_ff_relay_operation_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10517 {
10518   proto_tree_add_item(tree, hf_ieee80211_ff_relay_operation_type, tvb, offset, 1, ENC_NA);
10519   return 1;
10520 }
10521
10522 static guint
10523 add_ff_fst_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10524 {
10525   proto_tree_add_item(tree, hf_ieee80211_ff_fst_action_code, tvb, offset, 1, ENC_NA);
10526   return 1;
10527 }
10528
10529 static guint
10530 add_ff_llt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10531 {
10532   proto_tree_add_item(tree, hf_ieee80211_ff_llt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10533   return 4;
10534 }
10535
10536 static guint
10537 add_ff_fsts_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10538 {
10539   proto_tree_add_item(tree, hf_ieee80211_ff_fsts_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10540   return 4;
10541 }
10542
10543 static guint
10544 add_ff_oct_mmpdu(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10545 {
10546   guint start = offset;
10547   guint len = tvb_get_letohs(tvb, offset);
10548   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10549   offset += 2;
10550   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_ctrl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10551   offset += 2;
10552   proto_tree_add_item(tree, hf_ieee80211_ff_oct_mmpdu, tvb, offset, len, ENC_NA);
10553   offset += len;
10554   return offset - start;
10555 }
10556
10557 static int
10558 add_tag_relay_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
10559 {
10560   int tag_len = tvb_reported_length(tvb);
10561   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
10562   int offset = 0;
10563   static const int *ieee80211_tag_relay_capabilities[] = {
10564     &hf_ieee80211_tag_relay_support,
10565     &hf_ieee80211_tag_relay_use,
10566     &hf_ieee80211_tag_relay_permission,
10567     &hf_ieee80211_tag_AC_power,
10568     &hf_ieee80211_tag_relay_prefer,
10569     &hf_ieee80211_tag_duplex,
10570     &hf_ieee80211_tag_cooperation,
10571     NULL
10572   };
10573
10574   if (tag_len < 2) {
10575     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length must be 2");
10576     return 1;
10577   }
10578
10579   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_relay_capabilities, ENC_NA);
10580   return tvb_captured_length(tvb);
10581 }
10582
10583 #if 0
10584 static guint
10585 add_ff_relay_capable_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10586 {
10587   proto_item *rcsi_item = proto_tree_add_item(tree, hf_ieee80211_ff_rcsi, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10588   proto_tree *rcsi_tree = proto_item_add_subtree(rcsi_item, ett_rcsi_tree);
10589   proto_tree_add_item(rcsi_tree, hf_ieee80211_ff_rcsi_aid, tvb, offset, 1, ENC_NA);
10590   offset += 1;
10591   add_tag_relay_capabilities(pinfo, rcsi_item, 2, rcsi_tree, tvb, &offset);
10592   return 3;
10593 }
10594 #endif
10595
10596 static void
10597 dissect_ieee80211_extension(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
10598 {
10599   proto_item *ti;
10600   proto_tree *ext_tree;
10601   proto_tree *fixed_tree;
10602   proto_tree *tagged_tree;
10603
10604   int offset = 0;
10605   int tagged_parameter_tree_len;
10606
10607   ti = proto_tree_add_item(tree, proto_wlan_ext, tvb, offset, -1, ENC_NA);
10608   ext_tree = proto_item_add_subtree(ti, ett_80211_ext);
10609
10610   switch (COMPOSE_FRAME_TYPE(fcf))
10611   {
10612     case EXTENSION_DMG_BEACON:
10613     {
10614       gboolean cc, dis;
10615       guint16 bic_field;
10616       fixed_tree = get_fixed_parameter_tree(ext_tree, tvb, offset, 20);
10617       offset += add_ff_timestamp(fixed_tree, tvb, pinfo, offset);
10618       offset += add_ff_sector_sweep(fixed_tree, tvb, pinfo, offset);
10619       offset += add_ff_beacon_interval(fixed_tree, tvb, pinfo, offset);
10620       bic_field = tvb_get_letohs(tvb, offset);
10621       cc = (bic_field & 0x1);
10622       dis  = (bic_field & 0x2) >> 1;
10623       offset += add_ff_beacon_interval_ctrl(fixed_tree, tvb, pinfo, offset);
10624       offset += add_ff_dmg_params(fixed_tree, tvb, pinfo, offset);
10625       if(cc) {
10626         offset += add_ff_cc_field(fixed_tree, tvb, offset, dis);
10627       }
10628       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
10629
10630       /*
10631        * The tagged params are optional here. See Table 8.33a of the 2012
10632        * version of the standard.
10633        */
10634       if (tagged_parameter_tree_len) {
10635         tagged_tree = get_tagged_parameter_tree(ext_tree, tvb, offset, tagged_parameter_tree_len);
10636         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, EXTENSION_DMG_BEACON, NULL);
10637       }
10638       break;
10639     }
10640   }
10641 }
10642
10643 static guint
10644 add_ff_action_unprotected_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10645 {
10646   guint8 code;
10647   guint  start = offset;
10648
10649   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10650   code    = tvb_get_guint8(tvb, offset);
10651   offset += add_ff_unprotected_dmg_action_code(tree, tvb, pinfo, offset);
10652   switch (code) {
10653     case UNPROTECTED_DMG_ANNOUNCE:
10654       offset += add_ff_timestamp(tree, tvb, pinfo, offset);
10655       offset += add_ff_beacon_interval(tree, tvb, pinfo, offset);
10656       break;
10657     case UNPROTECTED_DMG_BRP:
10658       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10659       offset += add_ff_BRP_request(tree, tvb, pinfo, offset);
10660       break;
10661   }
10662   return offset - start;
10663 }
10664
10665 /* There is no easy way to skip all these subcarrier indices that must not
10666  * be displayed when showing compressed beamforming feedback matrices
10667  * Table 8-53g IEEE Std 802.11ac-2013 amendment.
10668  *
10669  * The irregular use of case statements in this function is to improve
10670  * readability in what is otherwise a large funtion that does very little.
10671  */
10672 static inline int
10673 vht_compressed_skip_scidx(guint8 nchan_width, guint8 ng, int scidx)
10674 {
10675   switch(nchan_width) {
10676     /* 20 MHz */
10677     case 0:
10678       /* No Grouping */
10679       if (ng == 0)
10680         switch (scidx) {
10681           /* Pilot subcarriers */
10682           case -21: case -7: case 7: case 21:
10683           /* DC subcarrier */
10684           case 0:
10685             scidx++;
10686           default:
10687             break;
10688         }
10689       break;
10690     /* 40 MHz */
10691     case 1:
10692       /* No Grouping */
10693       if (ng == 0)
10694         switch (scidx) {
10695           /* Pilot subcarriers */
10696           case -53: case -25: case -11: case 11: case 25: case 53:
10697             scidx++;
10698             break;
10699           /* DC subcarriers */
10700           case -1: case 0: case 1:
10701             scidx = 2;
10702           default:
10703             break;
10704         }
10705       break;
10706     /* 80 MHz */
10707     case 2:
10708       /* No Grouping */
10709       if (ng == 0)
10710         switch (scidx) {
10711           /* Pilot subcarriers */
10712           case -103: case -75: case -39: case -11: case 11: case 39: case 75: case 103:
10713             scidx++;
10714             break;
10715           /* DC subcarriers, skip -1, 0, 1 */
10716           case -1:
10717             scidx = 2;
10718           default:
10719             break;
10720         }
10721       break;
10722     /* 160 MHz / 80+80 Mhz
10723      * Skip values here assume 160 MHz, as vht_mimo_control does not let us differentiate
10724      * between 160 MHz & 80-80MHz */
10725     case 3:
10726       switch (ng) {
10727         /* No Grouping */
10728         case 0:
10729           /* DC subcarriers, skip -5 to 5*/
10730           if (scidx == -5) {
10731             scidx = 6;
10732             break;
10733           }
10734           switch (scidx) {
10735             /* Pilot subcarriers */
10736             case -231: case -203: case -167: case -139: case -117: case -89: case -53: case -25:
10737             case 25: case 53: case 89: case 117: case 139: case 167: case 203: case 231:
10738               scidx++;
10739               break;
10740             /* Other subcarriers, skip -129 to -127, 127 to 129 */
10741             case -129:
10742               scidx = -126;
10743               break;
10744             case 127:
10745               scidx = 130;
10746               break;
10747             default:
10748               break;
10749           }
10750           break;
10751         /* Grouping of 2 */
10752         case 1:
10753           switch (scidx) {
10754             /* DC subcarriers */
10755             case -128: case -4: case -2: case 0: case 2: case 4: case 128:
10756               scidx++;
10757             default:
10758               break;
10759           }
10760           break;
10761         /* Grouping of 4 */
10762         case 2:
10763           if (scidx == -2 || scidx == 2)
10764             scidx++;
10765           break;
10766       }
10767       break;
10768     default:
10769       break;
10770   }
10771
10772   return scidx;
10773 }
10774
10775 static inline int vht_exclusive_skip_scidx(guint8 nchan_width, guint8 ng, int scidx)
10776 {
10777   switch (nchan_width) {
10778     /* 20 MHz */
10779     case 0:
10780       switch (ng) {
10781         /* No Grouping */
10782         case 0:
10783           if (scidx == -2 || scidx == 1)
10784               scidx++;
10785           else
10786               scidx = scidx + 2;
10787           break;
10788         case 1:
10789           switch (scidx) {
10790             case -4: case 1:
10791               scidx = scidx + 3;
10792               break;
10793             case -1:
10794               scidx = 1;
10795               break;
10796             default:
10797               scidx = scidx + 4;
10798               break;
10799           }
10800           break;
10801         default:
10802           switch (scidx) {
10803             case -4: case 1:
10804               scidx = scidx + 3;
10805               break;
10806             case -1:
10807               scidx = 1;
10808               break;
10809             default:
10810               scidx = scidx + 8;
10811               break;
10812           }
10813           break;
10814       }
10815       break;
10816     /* 40 MHz */
10817     case 1:
10818     /* 80 MHz */
10819     case 2:
10820       switch (ng) {
10821         /* No Grouping */
10822         case 0:
10823           if (scidx == -2)
10824             scidx = 2;
10825           else
10826             scidx = scidx + 2;
10827           break;
10828         case 1:
10829           scidx = scidx + 4;
10830           break;
10831         default:
10832           if (scidx == -2)
10833             scidx = 2;
10834           else
10835             scidx = scidx + 8;
10836           break;
10837       }
10838       break;
10839     /* 160 MHz / 80+80 Mhz */
10840     case 3:
10841       switch (ng) {
10842         /* No Grouping */
10843         case 0:
10844           switch (scidx) {
10845             /* DC subcarriers, skip -4 to 4*/
10846             case -6:
10847               scidx = 6;
10848               break;
10849             /* Other subcarriers, skip -128, 128 */
10850             case -130:
10851               scidx = -126;
10852               break;
10853             case 126:
10854               scidx = 130;
10855               break;
10856             default:
10857               scidx = scidx + 2;
10858               break;
10859           }
10860           break;
10861         case 1:
10862           switch (scidx) {
10863             /* DC subcarriers, skip -4 to 4*/
10864             case -6:
10865               scidx = 6;
10866               break;
10867             default:
10868               scidx = scidx + 4;
10869               break;
10870           }
10871           break;
10872         default:
10873           switch (scidx) {
10874             case -6:
10875               scidx = 6;
10876               break;
10877             case -130:
10878               scidx = -126;
10879               break;
10880             case 126:
10881               scidx = 130;
10882               break;
10883             default:
10884               scidx = scidx + 8;
10885               break;
10886           }
10887         break;
10888       }
10889       break;
10890     default:
10891       break;
10892   }
10893   return scidx;
10894 }
10895
10896 static guint
10897 add_ff_vht_compressed_beamforming_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10898 {
10899   guint32 vht_mimo;
10900   guint8 nc;
10901   guint8 nr;
10902   guint8 chan_width;
10903   guint8 grouping;
10904   gboolean codebook_info;
10905   gboolean feedback_type;
10906   proto_item *vht_beam_item, *vht_excl_beam_item, *phi_angle, *psi_angle;
10907   proto_tree *vht_beam_tree, *subtree, *vht_excl_beam_tree, *angletree;
10908   int i, matrix_size, len, pos, ns, scidx = 0, matrix_len;
10909   guint8 phi, psi, carry;
10910   int j, ic, off_len = 0, sscidx = 0, xnsc;
10911   int ir, off_pos, angle_val;
10912   /* Table 8-53d Order of angles in the Compressed Beamforming Feedback
10913    * Matrix subfield, IEEE Std 802.11ac-2013 amendment */
10914   static const guint8 na_arr[8][8] = { {  0,  0,  0,  0,  0,  0,  0,  0 },
10915                                        {  2,  2,  0,  0,  0,  0,  0,  0 },
10916                                        {  4,  6,  6,  0,  0,  0,  0,  0 },
10917                                        {  6, 10, 12, 12,  0,  0,  0,  0 },
10918                                        {  8, 14, 18, 20, 20,  0,  0,  0 },
10919                                        { 10, 18, 24, 28, 30, 30,  0,  0 },
10920                                        { 12, 22, 30, 36, 40, 42, 42,  0 },
10921                                        { 14, 26, 36, 44, 50, 54, 56, 56 }
10922                                      };
10923   /* Table 8-53g Subcarriers for which a Compressed Beamforming Feedback Matrix
10924    * subfield is sent back. IEEE Std 802.11ac-2013 amendment */
10925   static const int ns_arr[4][3] = { {  52,  30,  16 },
10926                                     { 108,  58,  30 },
10927                                     { 234, 122,  62 },
10928                                     { 468, 244, 124 }
10929                                   };
10930
10931   /* Table 8-53j, no of Subcarriers for which the Delta SNR subfield is sent back to the beamformer.
10932    * IEEE Std 802.11ac-2013 amendment */
10933   static const int delta_ns_arr[4][3] = { {  30,  16,  10 },
10934                                           {  58,  30,  16 },
10935                                           { 122,  62,  32 },
10936                                           { 244, 124,  64 }
10937                                         };
10938
10939   vht_mimo = tvb_get_letoh24(tvb, offset);
10940   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_vht_mimo_cntrl,
10941                         ett_ff_vhtmimo_cntrl, hf_ieee80211_ff_vht_mimo_cntrl_fields, ENC_LITTLE_ENDIAN);
10942   offset += 3;
10943
10944   /* Extract values for beamforming use */
10945   nc = (vht_mimo & 0x7) + 1;
10946   nr = ((vht_mimo & 0x38) >> 3) + 1;
10947   chan_width = (vht_mimo & 0xC0) >> 6;
10948   grouping = ((vht_mimo & 0x300) >> 8);
10949   codebook_info = (vht_mimo & 0x400) >> 10;
10950   feedback_type = (vht_mimo & 0x800) >> 11;
10951
10952   if (feedback_type) {
10953     if (codebook_info) {
10954       psi = 7; phi = 9;
10955     } else {
10956       psi = 5; phi = 7;
10957     }
10958   } else {
10959     if (codebook_info) {
10960       psi = 4; phi = 6;
10961     } else {
10962       psi = 2; phi = 4;
10963     }
10964   }
10965
10966   vht_beam_item = proto_tree_add_item(tree, hf_ieee80211_vht_compressed_beamforming_report, tvb,
10967                                   offset, -1, ENC_NA);
10968   vht_beam_tree = proto_item_add_subtree(vht_beam_item, ett_ff_vhtmimo_beamforming_report);
10969
10970   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, nc,
10971                         ett_ff_vhtmimo_beamforming_report_snr, NULL, "Average Signal to Noise Ratio");
10972
10973   for (i = 1; i <= nc; i++)
10974   {
10975     gint8 snr;
10976     char edge_sign;
10977
10978     snr = tvb_get_gint8(tvb, offset);
10979
10980     switch(snr) {
10981       case -128:
10982         edge_sign = '<';
10983         break;
10984       case 127:
10985         edge_sign = '>';
10986         break;
10987       default:
10988         edge_sign = ' ';
10989         break;
10990     }
10991
10992     proto_tree_add_int_format(subtree, hf_ieee80211_vht_compressed_beamforming_report_snr, tvb, offset, 1,
10993                                snr, "Stream %d - Signal to Noise Ratio: %c%3.2fdB", i, edge_sign,snr/4.0+22.0);
10994
10995     offset += 1;
10996   }
10997
10998   matrix_size = na_arr[nr - 1][nc -1] * (psi + phi)/2;
10999   if (matrix_size % 8) {
11000     carry = 1;
11001   } else {
11002     carry = 0;
11003   }
11004   off_len = (matrix_size/8) + carry;
11005   angletree = proto_tree_add_subtree_format(vht_beam_tree, tvb, offset, off_len,
11006                         ett_ff_vhtmimo_beamforming_angle, NULL,"PHI and PSI Angle Decode");
11007
11008   off_pos = offset*8;
11009   phi_angle = proto_tree_add_none_format(angletree, hf_ieee80211_vht_compressed_beamforming_phi_angle, tvb, offset, 0, "PHI(%u bits):    ", phi);
11010   for (ic = 1; ic <= nc; ic++) {
11011       for (ir = 1; ir < nr; ir++) {
11012           if (ir >= ic) {
11013               angle_val = (int) tvb_get_bits16(tvb, off_pos, phi, ENC_BIG_ENDIAN);
11014               if ((ir+1 < nr) || (ic+1 <= nc))
11015                 proto_item_append_text(phi_angle, "PHI%d%d: %d, ", ir, ic, angle_val);
11016               else
11017                 proto_item_append_text(phi_angle, "PHI%d%d: %d", ir, ic, angle_val);
11018               off_pos = off_pos + phi;
11019           }
11020       }
11021   }
11022
11023   psi_angle = proto_tree_add_none_format(angletree, hf_ieee80211_vht_compressed_beamforming_psi_angle, tvb, offset, 0, "PSI(%u bits):    ", psi);
11024   for (ic = 1; ic <= nc; ic++)
11025       for (ir = 2; ir <= nr; ir++)
11026           if (ir > ic) {
11027               angle_val = (int) tvb_get_bits8(tvb, off_pos, psi);
11028               if ((ir+1 <= nr) || (ic+1 <= nc))
11029                 proto_item_append_text(psi_angle, "PSI%d%d: %d, ", ir, ic, angle_val);
11030               else
11031                 proto_item_append_text(psi_angle, "PSI%d%d: %d", ir, ic, angle_val);
11032               off_pos = off_pos + psi;
11033           }
11034
11035   /* Table 8-53c Subfields of the VHT MIMO Control field (802.11ac-2013)
11036    * reserves value 3 of the Grouping subfield. */
11037   if (grouping == 3) {
11038     expert_add_info_format(pinfo, vht_beam_item, &ei_ieee80211_inv_val,
11039                            "Grouping subfield value 3 is reserved");
11040     return offset;
11041   }
11042
11043   ns = ns_arr[chan_width][grouping];
11044   if (((matrix_size)*(ns)) % 8)
11045       matrix_len = (((matrix_size) * (ns)) / (8)) + 1;
11046   else
11047       matrix_len = (((matrix_size) * (ns)) / (8));
11048   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, matrix_len,
11049                         ett_ff_vhtmimo_beamforming_report_feedback_matrices, NULL, "Beamforming Feedback Matrix");
11050
11051
11052   switch(chan_width) {
11053     case 0:
11054       scidx = -28;
11055       break;
11056     case 1:
11057       scidx = -58;
11058       break;
11059     case 2:
11060       scidx = -122;
11061       break;
11062     case 3:
11063       /* This is -122 for 80+80MHz Channel Width but vht_mimo_control does not allow us
11064        * to differentiate between 160MHz and 80+80Mhz */
11065       scidx = -250;
11066       break;
11067   }
11068
11069   pos = 0;
11070   for (i = 0; i < ns; i++) {
11071     if (pos % 8)
11072       carry = 1;
11073     else
11074       carry = 0;
11075     len = roundup2((pos + matrix_size), 8)/8 - roundup2(pos, 8)/8;
11076     scidx = vht_compressed_skip_scidx(chan_width, grouping, scidx);
11077
11078     /* TODO : For certain values from na_arr, there is always going be a carry over or overflow from the previous or
11079        into the next octet. The largest of possible unaligned values can be 41 bytes long, and masking and shifting
11080        whole buffers to show correct values with padding and overflow bits is hence skipped, we only mark the bytes
11081        of interest instead */
11082     proto_tree_add_none_format(subtree, hf_ieee80211_vht_compressed_beamforming_feedback_matrix, tvb,
11083                                     offset - carry, len + carry, "Compressed Beamforming Feedback Matrix for subcarrier %d", scidx++);
11084     offset += len;
11085     pos += matrix_size;
11086   }
11087
11088   if (feedback_type) {
11089     xnsc = delta_ns_arr[chan_width][grouping];
11090     if ((nc * xnsc *4) % 8)
11091         off_len = (nc * xnsc *4) / 8 + 1;
11092     else
11093         off_len = (nc * xnsc *4) / 8;
11094     switch(chan_width) {
11095       case 0:
11096         sscidx = -28;
11097         break;
11098       case 1:
11099         sscidx = -58;
11100         break;
11101       case 2:
11102         sscidx = -122;
11103         break;
11104       case 3:
11105         sscidx = -250;
11106         break;
11107     }
11108     vht_excl_beam_item = proto_tree_add_item(tree, hf_ieee80211_vht_mu_exclusive_beamforming_report, tvb, offset, off_len, ENC_NA);
11109     vht_excl_beam_tree = proto_item_add_subtree(vht_excl_beam_item, ett_ff_vhtmu_exclusive_beamforming_report_matrices);
11110
11111     carry = 1;
11112     for (j = 1; j <= xnsc; j++) {
11113       for (ic = 1; ic <= nc; ic++) {
11114         if (carry % 2){
11115           pos = 0;
11116           len = 1;
11117         }
11118         else
11119         {
11120           pos = 1;
11121           len = 0;
11122         }
11123         proto_tree_add_none_format(vht_excl_beam_tree, hf_ieee80211_vht_mu_Exclusive_beamforming_delta_snr, tvb,
11124                                       offset - pos, 1, "Delta SNR for space-time stream %d for subcarrier %d", ic, sscidx);
11125         offset += len;
11126         carry ++;
11127       }
11128       sscidx = vht_exclusive_skip_scidx(chan_width, grouping, sscidx);
11129     }
11130   }
11131
11132   return offset;
11133 }
11134
11135 static guint
11136 add_ff_action_vht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11137 {
11138   guint start = offset;
11139   guint8 vht_action, field_val;
11140   guint64 msa_value;
11141   guint64 upa_value;
11142   int m;
11143   proto_item *ti;
11144   proto_tree *ti_tree;
11145   proto_item *msa, *upa;
11146   proto_tree *msa_tree, *upa_tree;
11147
11148   offset += add_ff_category_code(tree, tvb, pinfo, offset);
11149
11150   vht_action = tvb_get_guint8(tvb, offset);
11151   offset += add_ff_vht_action(tree, tvb, pinfo, offset);
11152
11153   switch(vht_action){
11154     case VHT_ACT_VHT_COMPRESSED_BEAMFORMING:{
11155       offset = add_ff_vht_compressed_beamforming_report(tree, tvb, pinfo, offset);
11156       offset += tvb_reported_length_remaining(tvb, offset);
11157     }
11158     break;
11159     case VHT_ACT_GROUP_ID_MANAGEMENT:{
11160       ti = proto_tree_add_item(tree, hf_ieee80211_vht_group_id_management, tvb,
11161                           offset, -1, ENC_NA);
11162       ti_tree = proto_item_add_subtree(ti, ett_vht_grpidmgmt);
11163
11164       msa_value = tvb_get_letoh64(tvb, offset);
11165       msa = proto_tree_add_item(ti_tree, hf_ieee80211_vht_membership_status_array, tvb,
11166                                 offset, 8, ENC_NA);
11167       msa_tree = proto_item_add_subtree(msa, ett_vht_msa);
11168       for (m = 0; m < 64; m++) {
11169           if (msa_value & (G_GINT64_CONSTANT(1) << m))
11170               proto_tree_add_uint_format(msa_tree, hf_ieee80211_vht_membership_status_field,
11171                                                tvb, offset + (m/8), 1, 1, "Membership Status in Group ID %d: 1", m);
11172       }
11173       offset += 8;
11174
11175       upa = proto_tree_add_item(ti_tree, hf_ieee80211_vht_user_position_array, tvb,
11176                                       offset, 16, ENC_NA);
11177       upa_tree = proto_item_add_subtree(upa, ett_vht_upa);
11178
11179       upa_value = tvb_get_letoh64(tvb, offset);
11180       for (m = 0; m < 32; m++) {
11181           if (msa_value & (G_GINT64_CONSTANT(1) << m)) {
11182               field_val = (guint8) ((upa_value >> m*2) & 0x3);
11183               proto_tree_add_uint_format(upa_tree, hf_ieee80211_vht_user_position_field,
11184                                                tvb, offset + (m/4), 1, field_val, "User Position in Group ID %d: %u", m, field_val);
11185           }
11186       }
11187       upa_value = tvb_get_letoh64(tvb, offset+8);
11188       for (m = 0; m < 32; m++) {
11189           if (msa_value & (G_GINT64_CONSTANT(1) << (32+m))) {
11190               field_val = (guint8) ((upa_value >> m*2) & 0x3);
11191               proto_tree_add_uint_format(upa_tree, hf_ieee80211_vht_user_position_field,
11192                                                tvb, (offset + 8) + (m/4), 1, field_val, "User Position in Group ID %d: %u", m, field_val);
11193           }
11194       }
11195       offset += tvb_reported_length_remaining(tvb, offset);
11196     }
11197     break;
11198     case VHT_ACT_OPERATION_MODE_NOTIFICATION:{
11199       ti = proto_tree_add_item(tree, hf_ieee80211_vht_operation_mode_notification, tvb,
11200                           offset, -1, ENC_NA);
11201       expert_add_info(pinfo, ti, &ei_ieee80211_vht_action);
11202       offset += tvb_reported_length_remaining(tvb, offset);
11203     }
11204     break;
11205     default:
11206     break;
11207   }
11208
11209
11210   return offset - start;
11211 }
11212
11213 #define HE_COMPRESSED_BEAMFORMING_AND_CQI 0
11214 #define HE_QUIET_TIME_PERIOD              1
11215
11216 static const value_string he_action_vals[] = {
11217   { HE_COMPRESSED_BEAMFORMING_AND_CQI, "HE Compressed Beamforming And CQI" },
11218   { HE_QUIET_TIME_PERIOD,              "Quiet Time Period" },
11219   { 0, NULL }
11220 };
11221
11222 static guint
11223 add_ff_he_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
11224   int offset)
11225 {
11226   guint8 he_action = tvb_get_guint8(tvb, offset);
11227
11228   proto_tree_add_uint_format(tree, hf_ieee80211_ff_he_action, tvb, offset, 1,
11229                       he_action, "%s", val_to_str(he_action, he_action_vals,
11230                                                 "Reserved"));
11231   return 1;
11232 }
11233
11234 static const int *he_mimo_control_headers[] = {
11235   &hf_he_mimo_control_nc_index,
11236   &hf_he_mimo_control_nr_index,
11237   &hf_he_mimo_control_bw,
11238   &hf_he_mimo_control_grouping,
11239   &hf_he_mimo_control_codebook_info,
11240   &hf_he_mimo_control_feedback_type,
11241   &hf_he_mimo_control_remaining_feedback_segs,
11242   &hf_he_mimo_control_first_feedback_seg,
11243   &hf_he_mimo_control_ru_start_index,
11244   &hf_he_mimo_control_ru_end_index,
11245   &hf_he_mimo_control_sounding_dialog_token_num,
11246   &hf_he_mimo_control_reserved,
11247   NULL
11248 };
11249
11250 static guint
11251 add_ff_action_he(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11252 {
11253   guint start = offset;
11254   guint8 he_action;
11255
11256   offset += add_ff_category_code(tree, tvb, pinfo, offset);
11257
11258   he_action = tvb_get_guint8(tvb, offset);
11259   offset += add_ff_he_action(tree, tvb, pinfo, offset);
11260
11261   switch (he_action) {
11262   case HE_COMPRESSED_BEAMFORMING_AND_CQI:
11263     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
11264                         hf_ieee80211_he_mimo_control_field, ett_he_mimo_control,
11265                         he_mimo_control_headers, ENC_LITTLE_ENDIAN,
11266                         BMT_NO_APPEND);
11267     offset += 5;
11268     break;
11269   case HE_QUIET_TIME_PERIOD:
11270
11271     break;
11272   default:
11273     break;
11274   }
11275   return offset - start;
11276 }
11277
11278 static guint
11279 add_ff_action_fst(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11280 {
11281   guint8 code;
11282   guint  start = offset;
11283
11284   offset += add_ff_category_code(tree, tvb, pinfo, offset);
11285   code    = tvb_get_guint8(tvb, offset);
11286   offset += add_ff_fst_action_code(tree, tvb, pinfo, offset);
11287   switch (code) {
11288     case FST_SETUP_REQUEST:
11289       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11290       offset += add_ff_llt(tree, tvb, pinfo, offset);
11291       break;
11292     case FST_SETUP_RESPONSE:
11293       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11294       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11295       break;
11296     case FST_TEAR_DOWN:
11297       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
11298       break;
11299     case FST_ACK_REQUEST:
11300       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11301       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
11302       break;
11303     case FST_ACK_RESPONSE:
11304       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11305       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
11306       break;
11307     case FST_ON_CHANNEL_TUNNEL_REQUEST:
11308       offset += add_ff_oct_mmpdu(tree, tvb, pinfo, offset);
11309       break;
11310   }
11311   return offset - start;
11312 }
11313
11314 static guint
11315 add_ff_action_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11316 {
11317   guint8 code;
11318   guint  start = offset;
11319   int left_offset;
11320
11321   offset += add_ff_category_code(tree, tvb, pinfo, offset);
11322   code    = tvb_get_guint8(tvb, offset);
11323   offset += add_ff_dmg_action_code(tree, tvb, pinfo, offset);
11324   switch (code) {
11325     case DMG_ACTION_PWR_SAVE_CONFIG_REQ:
11326       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11327       offset += add_ff_dmg_pwr_mgmt(tree, tvb, pinfo, offset);
11328       break;
11329     case DMG_ACTION_PWR_SAVE_CONFIG_RES:
11330       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11331       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11332       break;
11333     case DMG_ACTION_INFO_REQ:
11334       offset += add_ff_subject_address(tree, tvb, pinfo, offset);
11335       break;
11336     case DMG_ACTION_INFO_RES:
11337       offset += add_ff_subject_address(tree, tvb, pinfo, offset);
11338       break;
11339     case DMG_ACTION_HANDOVER_REQ:
11340       offset += add_ff_handover_reason(tree, tvb, pinfo, offset);
11341       offset += add_ff_handover_remaining_bi(tree, tvb, pinfo, offset);
11342       break;
11343     case DMG_ACTION_HANDOVER_RES:
11344       offset += add_ff_handover_result(tree, tvb, pinfo, offset);
11345       offset += add_ff_handover_reject_reason(tree, tvb, pinfo, offset);
11346       break;
11347     case DMG_ACTION_DTP_REQ:
11348       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11349       break;
11350     case DMG_ACTION_DTP_RES:
11351       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11352       break;
11353     case DMG_ACTION_RELAY_SEARCH_REQ:
11354       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11355       offset += add_ff_destination_reds_aid(tree, tvb, pinfo, offset);
11356       break;
11357     case DMG_ACTION_RELAY_SEARCH_RES:
11358       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11359       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11360       break;
11361     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ:
11362       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11363       break;
11364     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES:
11365       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11366       left_offset =
11367           tvb_reported_length_remaining(tvb, offset);
11368       while(left_offset > 0) {
11369         proto_tree_add_item(tree, hf_ieee80211_ff_peer_sta_aid, tvb, offset, 1, ENC_NA);
11370         proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset+1, 1, ENC_NA);
11371         proto_tree_add_item(tree, hf_ieee80211_ff_internal_angle, tvb, offset+2, 1, ENC_NA);
11372         proto_tree_add_item(tree, hf_ieee80211_ff_recommend, tvb, offset+2, 1, ENC_NA);
11373         /* another reserved byte */
11374         offset += 4;
11375         left_offset -= 4;
11376       }
11377       break;
11378     case DMG_ACTION_RLS_REQ:
11379       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11380       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
11381       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
11382       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
11383       break;
11384     case DMG_ACTION_RLS_RES:
11385       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11386       break;
11387     case DMG_ACTION_RLS_ANNOUNCE:
11388       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11389       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11390       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
11391       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
11392       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
11393       break;
11394     case DMG_ACTION_RLS_TEARDOWN:
11395       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
11396       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
11397       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
11398       break;
11399     case DMG_ACTION_RELAY_ACK_REQ:
11400     case DMG_ACTION_RELAY_ACK_RES:
11401       break;
11402     case DMG_ACTION_TPA_REQ:
11403       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11404       offset += add_ff_timing_offset(tree, tvb, pinfo, offset);
11405       offset += add_ff_sampling_frequency_offset(tree, tvb, pinfo, offset);
11406       break;
11407     case DMG_ACTION_TPA_RES:
11408       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11409       break;
11410     case DMG_ACTION_TPA_REP:
11411       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11412       break;
11413     case DMG_ACTION_ROC_REQ:
11414       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11415       offset += add_ff_relay_operation_type(tree, tvb, pinfo, offset);
11416       break;
11417     case DMG_ACTION_ROC_RES:
11418       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11419       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11420       break;
11421   }
11422   return offset - start;
11423 }
11424
11425 static guint
11426 add_ff_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11427 {
11428   switch (tvb_get_guint8(tvb, offset) & 0x7f) {
11429   case CAT_SPECTRUM_MGMT: /* 0 */
11430     return add_ff_action_spectrum_mgmt(tree, tvb, pinfo, offset);
11431   case CAT_QOS: /* 1 */
11432     return add_ff_action_qos(tree, tvb, pinfo, offset);
11433   case CAT_DLS: /* 2 */
11434     return add_ff_action_dls(tree, tvb, pinfo, offset);
11435   case CAT_BLOCK_ACK: /* 3 */
11436     return add_ff_action_block_ack(tree, tvb, pinfo, offset);
11437   case CAT_PUBLIC: /* 4 */
11438     return add_ff_action_public(tree, tvb, pinfo, offset);
11439   case CAT_RADIO_MEASUREMENT: /* 5 */
11440     return add_ff_action_radio_measurement(tree, tvb, pinfo, offset);
11441   case CAT_FAST_BSS_TRANSITION: /* 6 */
11442     return add_ff_action_fast_bss_transition(tree, tvb, pinfo, offset);
11443   case CAT_HT: /* 7 */
11444     return add_ff_action_ht(tree, tvb, pinfo, offset);
11445   case CAT_SA_QUERY: /* 8 */
11446     return add_ff_action_sa_query(tree, tvb, pinfo, offset);
11447   case CAT_PUBLIC_PROTECTED: /* 9 */
11448     return add_ff_action_protected_public(tree, tvb, pinfo, offset);
11449   case CAT_WNM: /* 10 */
11450     return add_ff_action_wnm(tree, tvb, pinfo, offset);
11451   case CAT_UNPROTECTED_WNM: /* 11 */
11452     return add_ff_action_unprotected_wnm(tree, tvb, pinfo, offset);
11453   case CAT_TDLS: /* 12 */
11454     return add_ff_action_tdls(tree, tvb, pinfo, offset);
11455   case CAT_MESH: /* 13 */
11456     return add_ff_action_mesh(tree, tvb, pinfo, offset);
11457   case CAT_MULTIHOP: /* 14 */
11458     return add_ff_action_multihop(tree, tvb, pinfo, offset);
11459   case CAT_SELF_PROTECTED: /* 15 */
11460     return add_ff_action_self_protected(tree, tvb, pinfo, offset);
11461   case CAT_DMG: /* 16 */
11462     return add_ff_action_dmg(tree, tvb, pinfo, offset);
11463   case CAT_MGMT_NOTIFICATION:  /* Management notification frame - 17 */
11464     return add_ff_action_mgmt_notification(tree, tvb, pinfo, offset);
11465   case CAT_FAST_SESSION_TRANSFER: /* 18 */
11466     return add_ff_action_fst(tree, tvb, pinfo, offset);
11467 /* case CAT_ROBUST_AV_STREAMING:  19 */
11468 /*   return add_ff_action_robust_av_streaming(tree, tvb, pinfo, offset); */
11469   case CAT_UNPROTECTED_DMG: /* 20 */
11470     return add_ff_action_unprotected_dmg(tree, tvb, pinfo, offset);
11471   case CAT_VHT: /* 21 */
11472     return add_ff_action_vht(tree, tvb, pinfo, offset);
11473   case CAT_HE:
11474     return add_ff_action_he(tree, tvb, pinfo, offset);
11475 /*  case CAT_VENDOR_SPECIFIC_PROTECTED:   Vendor Specific Protected Category - 126 */
11476 /*    return add_ff_action_vendor_specific_protected(tree, tvb, pinfo, offset);*/
11477   case CAT_VENDOR_SPECIFIC:  /* Vendor Specific Protected Category - 127 */
11478     return add_ff_action_vendor_specific(tree, tvb, pinfo, offset);
11479   default:
11480     add_ff_category_code(tree, tvb, pinfo, offset);
11481     return 1;
11482   }
11483 }
11484
11485 static const value_string ieee80211_rsn_cipher_vals[] = {
11486   {0, "NONE"},
11487   {1, "WEP (40-bit)"},
11488   {2, "TKIP"},
11489   {3, "AES (OCB)"},
11490   {4, "AES (CCM)"},
11491   {5, "WEP (104-bit)"},
11492   {6, "BIP"},
11493   {7, "Group addressed traffic not allowed"},
11494   {8, "GCMP"},
11495   {0, NULL}
11496 };
11497
11498 static const value_string ieee80211_rsn_keymgmt_vals[] = {
11499   {0, "NONE"},
11500   {1, "WPA"},
11501   {2, "PSK"},
11502   {3, "FT over IEEE 802.1X"},
11503   {4, "FT using PSK"},
11504   {5, "WPA (SHA256)"},
11505   {6, "PSK (SHA256)"},
11506   {7, "TDLS / TPK Handshake"},
11507   {0, NULL}
11508 };
11509
11510 static void
11511 oui_base_custom(gchar *result, guint32 oui)
11512 {
11513   guint8       p_oui[3];
11514   const gchar *manuf_name;
11515
11516   p_oui[0] = oui >> 16 & 0xFF;
11517   p_oui[1] = oui >> 8 & 0xFF;
11518   p_oui[2] = oui & 0xFF;
11519
11520   /* Attempt an OUI lookup. */
11521   manuf_name = uint_get_manuf_name_if_known(oui);
11522   if (manuf_name == NULL) {
11523     /* Could not find an OUI. */
11524     g_snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x", p_oui[0], p_oui[1], p_oui[2]);
11525   }
11526   else {
11527    /* Found an address string. */
11528     g_snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x (%s)", p_oui[0], p_oui[1], p_oui[2], manuf_name);
11529   }
11530 }
11531
11532 static void
11533 rsn_gcs_base_custom(gchar *result, guint32 gcs)
11534 {
11535   gchar oui_result[SHORT_STR];
11536   gchar *tmp_str;
11537
11538   oui_result[0] = '\0';
11539   oui_base_custom(oui_result, gcs >> 8);
11540   tmp_str = val_to_str_wmem(NULL, gcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
11541   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11542   wmem_free(NULL, tmp_str);
11543 }
11544
11545 static void
11546 rsn_pcs_base_custom(gchar *result, guint32 pcs)
11547 {
11548   gchar oui_result[SHORT_STR];
11549   gchar *tmp_str;
11550
11551   oui_result[0] = '\0';
11552   oui_base_custom(oui_result, pcs >> 8);
11553   tmp_str = val_to_str_wmem(NULL, pcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
11554   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11555   wmem_free(NULL, tmp_str);
11556
11557 }
11558 static void
11559 rsn_akms_base_custom(gchar *result, guint32 akms)
11560 {
11561   gchar oui_result[SHORT_STR];
11562   gchar *tmp_str;
11563
11564   oui_result[0] = '\0';
11565   oui_base_custom(oui_result, akms >> 8);
11566   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_rsn_keymgmt_vals, "Unknown %d");
11567   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11568   wmem_free(NULL, tmp_str);
11569 }
11570
11571 static gchar *
11572 rsn_pcs_return(guint32 pcs)
11573 {
11574   gchar *result;
11575
11576   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
11577   result[0] = '\0';
11578   rsn_pcs_base_custom(result, pcs);
11579
11580   return result;
11581 }
11582
11583 static gchar *
11584 rsn_akms_return(guint32 akms)
11585 {
11586   gchar *result;
11587
11588   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
11589   result[0] = '\0';
11590   rsn_akms_base_custom(result, akms);
11591
11592   return result;
11593 }
11594
11595 static void
11596 rsn_gmcs_base_custom(gchar *result, guint32 gmcs)
11597 {
11598   gchar oui_result[SHORT_STR];
11599   gchar *tmp_str;
11600
11601   oui_result[0] = '\0';
11602   oui_base_custom(oui_result, gmcs >> 8);
11603   tmp_str = val_to_str_wmem(NULL, gmcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
11604   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11605   wmem_free(NULL, tmp_str);
11606 }
11607
11608 static void
11609 rsni_base_custom(gchar *result, guint32 rsni)
11610 {
11611   double temp_double;
11612
11613   temp_double = (double)rsni;
11614   g_snprintf(result, ITEM_LABEL_LENGTH, "%f dB", (temp_double / 2));
11615 }
11616
11617 static void
11618 vht_tpe_custom(gchar *result, guint8 txpwr)
11619 {
11620   gint8 txpwr_db;
11621
11622   txpwr_db = (gint8)(txpwr);
11623   g_snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm", (txpwr_db/2.0));
11624 }
11625
11626 static void
11627 channel_number_custom(gchar *result, guint8 channel_number)
11628 {
11629   switch(channel_number){
11630     case 0:
11631       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels in the specified Operating Class)", channel_number);
11632     break;
11633     case 255:
11634       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels listed in the AP Channel Report)", channel_number);
11635     break;
11636     default :
11637       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on that Channel Number)", channel_number);
11638     break;
11639   }
11640 }
11641
11642 /* WPA / WME */
11643 static const value_string ieee802111_wfa_ie_type_vals[] = {
11644   { 1, "WPA Information Element" },
11645   { 2, "WMM/WME" },
11646   { 4, "WPS" },
11647   { 0, NULL }
11648 };
11649
11650 static const value_string ieee80211_wfa_ie_wpa_cipher_vals[] = {
11651   { 0, "NONE" },
11652   { 1, "WEP (40-bit)" },
11653   { 2, "TKIP" },
11654   { 3, "AES (OCB)" },
11655   { 4, "AES (CCM)" },
11656   { 5, "WEP (104-bit)" },
11657   { 6, "BIP" },
11658   { 7, "Group addressed traffic not allowed" },
11659   { 0, NULL }
11660 };
11661
11662 static const value_string ieee80211_wfa_ie_wpa_keymgmt_vals[] = {
11663   { 0, "NONE" },
11664   { 1, "WPA" },
11665   { 2, "PSK" },
11666   { 3, "FT over IEEE 802.1X" },
11667   { 4, "FT using PSK" },
11668   { 5, "WPA (SHA256)" },
11669   { 6, "PSK (SHA256)" },
11670   { 7, "TDLS / TPK Handshake" },
11671   { 0, NULL }
11672 };
11673
11674 static const value_string ieee80211_wfa_ie_wme_acs_vals[] = {
11675   { 0, "Best Effort" },
11676   { 1, "Background" },
11677   { 2, "Video" },
11678   { 3, "Voice" },
11679   { 0, NULL }
11680 };
11681
11682 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals[] = {
11683   { 0, "Uplink" },
11684   { 1, "Downlink" },
11685   { 2, "Direct link" },
11686   { 3, "Bidirectional link" },
11687   { 0, NULL }
11688 };
11689
11690 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals[] = {
11691   { 0, "Legacy" },
11692   { 1, "U-APSD" },
11693   { 0, NULL }
11694 };
11695
11696 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals[] = {
11697   { 0, "Best Effort" },
11698   { 1, "Background" },
11699   { 2, "Spare" },
11700   { 3, "Excellent Effort" },
11701   { 4, "Controlled Load" },
11702   { 5, "Video" },
11703   { 6, "Voice" },
11704   { 7, "Network Control" },
11705   { 0, NULL }
11706 };
11707
11708 static const value_string ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals[] = {
11709   { 0, "WMM AP may deliver all buffered frames (MSDUs and MMPDUs)" },
11710   { 1, "WMM AP may deliver a maximum of 2 buffered frames (MSDUs and MMPDUs) per USP" },
11711   { 2, "WMM AP may deliver a maximum of 4 buffered frames (MSDUs and MMPDUs) per USP" },
11712   { 3, "WMM AP may deliver a maximum of 6 buffered frames (MSDUs and MMPDUs) per USP" },
11713   { 0, NULL}
11714 };
11715 static const true_false_string ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs = {
11716   "WMM delivery and trigger enabled",
11717   "non-WMM PS"
11718 };
11719
11720 static void
11721 wpa_mcs_base_custom(gchar *result, guint32 mcs)
11722 {
11723   gchar oui_result[SHORT_STR];
11724   gchar *tmp_str;
11725
11726   oui_result[0] = '\0';
11727   oui_base_custom(oui_result, mcs >> 8);
11728   tmp_str = val_to_str_wmem(NULL, mcs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
11729   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11730   wmem_free(NULL, tmp_str);
11731 }
11732
11733 static void
11734 wpa_ucs_base_custom(gchar *result, guint32 ucs)
11735 {
11736   gchar oui_result[SHORT_STR];
11737   gchar *tmp_str;
11738
11739   oui_result[0] = '\0';
11740   oui_base_custom(oui_result, ucs >> 8);
11741   tmp_str = val_to_str_wmem(NULL, ucs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
11742   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11743   wmem_free(NULL, tmp_str);
11744 }
11745 static void
11746 wpa_akms_base_custom(gchar *result, guint32 akms)
11747 {
11748   gchar oui_result[SHORT_STR];
11749   gchar *tmp_str;
11750
11751   oui_result[0] = '\0';
11752   oui_base_custom(oui_result, akms >> 8);
11753   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_wfa_ie_wpa_keymgmt_vals, "Unknown %d");
11754   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11755   wmem_free(NULL, tmp_str);
11756 }
11757
11758 static gchar *
11759 wpa_ucs_return(guint32 ucs)
11760 {
11761   gchar *result;
11762
11763   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
11764   result[0] = '\0';
11765   wpa_ucs_base_custom(result, ucs);
11766
11767   return result;
11768 }
11769
11770 static gchar *
11771 wpa_akms_return(guint32 akms)
11772 {
11773   gchar *result;
11774
11775   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
11776   result[0] = '\0';
11777   wpa_akms_base_custom(result, akms);
11778
11779   return result;
11780 }
11781
11782 /* For each Field */
11783 static const value_string ieee80211_wapi_suite_type[] = {
11784   {0, "Reserved"},
11785   {1, "WAI Certificate Authentication and Key Management"},
11786   {2, "WAI Preshared Key Authentication and Key Management"},
11787   {0, NULL},
11788 };
11789 /* For Summary Tag Information */
11790 static const value_string ieee80211_wapi_suite_type_short[] = {
11791   {0, "Reserved"},
11792   {1, "WAI-CERT"},
11793   {2, "WAI-PSK"},
11794   {0, NULL},
11795 };
11796
11797 static const value_string ieee80211_wapi_cipher_type[] = {
11798   {0, "Reserved"},
11799   {1, "WPI-SMS4"},
11800   {0, NULL},
11801 };
11802
11803 static const value_string ieee802111_wfa_ie_wme_type[] = {
11804   { 0, "Information Element" },
11805   { 1, "Parameter Element" },
11806   { 2, "TSPEC Element" },
11807   { 0, NULL}
11808 };
11809
11810 static const value_string ft_subelem_id_vals[] = {
11811   {0, "Reserved"},
11812   {1, "PMK-R1 key holder identifier (R1KH-ID)"},
11813   {2, "GTK subelement"},
11814   {3, "PMK-R0 key holder identifier (R0KH-ID)"},
11815   {4, "IGTK"},
11816   {0, NULL}
11817 };
11818
11819 static int
11820 dissect_wme_qos_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
11821 {
11822   proto_item *wme_qos_info_item;
11823
11824   static const int *ieee80211_mgt_req[] = {
11825     &hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
11826     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
11827     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
11828     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
11829     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
11830     &hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
11831     NULL
11832   };
11833
11834   static const int *ieee80211_mgt_resp[] = {
11835     &hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
11836     &hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
11837     &hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
11838     NULL
11839   };
11840
11841   switch (ftype) {
11842     case MGT_ASSOC_REQ:
11843     case MGT_PROBE_REQ:
11844     case MGT_REASSOC_REQ:
11845     {
11846       /* To AP so decode as per WMM standard Figure 7 QoS Info field when sent from WMM STA*/
11847       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_qos_info,
11848                                     ett_wme_qos_info, ieee80211_mgt_req,
11849                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11850       break;
11851     }
11852     case MGT_BEACON:
11853     case MGT_PROBE_RESP:
11854     case MGT_ASSOC_RESP:
11855     case MGT_REASSOC_RESP:
11856     {
11857       /* From AP so decode as per WMM standard Figure 6 QoS Info field when sent from WMM AP */
11858       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_qos_info,
11859                                     ett_wme_qos_info, ieee80211_mgt_resp,
11860                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11861       break;
11862     }
11863     default:
11864         wme_qos_info_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_qos_info, tvb, offset, 1, ENC_NA);
11865         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);
11866       break;
11867     }
11868
11869   offset += 1;
11870   return offset;
11871 }
11872
11873 static int
11874 decode_qos_parameter_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
11875 {
11876   int i;
11877   /* WME QoS Info Field */
11878   offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
11879   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_reserved, tvb, offset, 1, ENC_NA);
11880   offset += 1;
11881   /* AC Parameters */
11882   for (i = 0; i < 4; i++)
11883   {
11884     proto_item *ac_item, *aci_aifsn_item, *ecw_item;
11885     proto_tree *ac_tree, *ecw_tree;
11886     guint8 aci_aifsn, ecw, ecwmin, ecwmax;
11887     guint16 cwmin, cwmax;
11888     static const int *ieee80211_wfa_ie_wme[] = {
11889         &hf_ieee80211_wfa_ie_wme_acp_aci,
11890         &hf_ieee80211_wfa_ie_wme_acp_acm,
11891         &hf_ieee80211_wfa_ie_wme_acp_aifsn,
11892         &hf_ieee80211_wfa_ie_wme_acp_reserved,
11893         NULL
11894     };
11895
11896     ac_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_ac_parameters, tvb, offset, 4, ENC_NA);
11897     ac_tree = proto_item_add_subtree(ac_item, ett_wme_ac);
11898
11899     /* ACI/AIFSN Field */
11900     aci_aifsn_item = proto_tree_add_bitmask_with_flags(ac_tree, tvb, offset, hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
11901                             ett_wme_aci_aifsn, ieee80211_wfa_ie_wme,
11902                             ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11903     aci_aifsn = tvb_get_guint8(tvb, offset);
11904     /* 802.11-2012, 8.4.2.31 EDCA Parameter Set element */
11905     if (aci_aifsn < 2) {
11906        expert_add_info_format(pinfo, aci_aifsn_item, &ei_ieee80211_qos_bad_aifsn,
11907          "The minimum value for the AIFSN subfield is 2 (found %u).", aci_aifsn);
11908     }
11909     proto_item_append_text(ac_item, " ACI %u (%s), ACM %s, AIFSN %u",
11910       (aci_aifsn & 0x60) >> 5, try_val_to_str((aci_aifsn & 0x60) >> 5, ieee80211_wfa_ie_wme_acs_vals),
11911       (aci_aifsn & 0x10) ? "yes" : "no", aci_aifsn & 0x0f);
11912     offset += 1;
11913
11914     /* ECWmin/ECWmax field */
11915     ecw_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_ecw, tvb, offset, 1, ENC_NA);
11916     ecw_tree = proto_item_add_subtree(ecw_item, ett_wme_ecw);
11917     ecw = tvb_get_guint8(tvb, offset);
11918     ecwmin = ecw & 0x0f;
11919     ecwmax = (ecw & 0xf0) >> 4;
11920     cwmin= (1 << ecwmin) - 1;
11921     cwmax= (1 << ecwmax) - 1;
11922     proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_max, tvb, offset, 1, ENC_NA);
11923     proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_min, tvb, offset, 1, ENC_NA);
11924     proto_tree_add_uint(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_cw_max, tvb, offset, 1, cwmax);
11925     proto_tree_add_uint(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_cw_min, tvb, offset, 1, cwmin);
11926     proto_item_append_text(ac_item, ", ECWmin/max %u/%u (CWmin/max %u/%u)", ecwmin, ecwmax, cwmin, cwmax);
11927     offset += 1;
11928
11929     /* TXOP Limit */
11930     proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_txop_limit, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11931     proto_item_append_text(ac_item, ", TXOP %u", tvb_get_letohs(tvb, offset));
11932     offset += 2;
11933   }
11934
11935   return offset;
11936 }
11937
11938 static int
11939 dissect_vendor_ie_wpawme(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 tag_len, int ftype)
11940 {
11941   guint8 type;
11942
11943   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_type, tvb, offset, 1, ENC_NA);
11944   type = tvb_get_guint8(tvb, offset);
11945   proto_item_append_text(tree, ": %s", val_to_str(type, ieee802111_wfa_ie_type_vals, "Unknown %d"));
11946   offset += 1;
11947
11948   switch (type) {
11949     case 1:   /* Wi-Fi Protected Access (WPA) */
11950     {
11951       proto_item *wpa_mcs_item, *wpa_ucs_item, *wpa_akms_item;
11952       proto_item *wpa_sub_ucs_item, *wpa_sub_akms_item;
11953       proto_tree *wpa_mcs_tree, *wpa_ucs_tree, *wpa_akms_tree;
11954       proto_tree *wpa_sub_ucs_tree, *wpa_sub_akms_tree;
11955       guint16 ucs_count, akms_count;
11956       guint ii;
11957
11958       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11959       offset += 2;
11960
11961       /* Multicast Cipher Suite */
11962       wpa_mcs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_mcs, tvb, offset, 4, ENC_BIG_ENDIAN);
11963       wpa_mcs_tree = proto_item_add_subtree(wpa_mcs_item, ett_wpa_mcs_tree);
11964       proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11965
11966       /* Check if OUI is 00:50:F2 (WFA) */
11967       if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
11968       {
11969         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_wfa_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11970       } else {
11971         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11972       }
11973       offset += 4;
11974
11975       /* Unicast Cipher Suites */
11976       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11977       ucs_count = tvb_get_letohs(tvb, offset);
11978       offset += 2;
11979
11980       wpa_ucs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_list, tvb, offset, ucs_count * 4, ENC_NA);
11981       wpa_ucs_tree = proto_item_add_subtree(wpa_ucs_item, ett_wpa_ucs_tree);
11982       for (ii = 0; ii < ucs_count; ii++)
11983       {
11984         wpa_sub_ucs_item = proto_tree_add_item(wpa_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs, tvb, offset, 4, ENC_BIG_ENDIAN);
11985         wpa_sub_ucs_tree = proto_item_add_subtree(wpa_sub_ucs_item, ett_wpa_sub_ucs_tree);
11986         proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11987
11988         /* Check if OUI is 00:50:F2 (WFA) */
11989         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
11990         {
11991           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11992           proto_item_append_text(wpa_ucs_item, " %s", wpa_ucs_return(tvb_get_ntohl(tvb, offset)));
11993         } else {
11994           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11995         }
11996         offset += 4;
11997       }
11998
11999       /* Authenticated Key Management Suites */
12000       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12001       akms_count = tvb_get_letohs(tvb, offset);
12002       offset += 2;
12003
12004       wpa_akms_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_list, tvb, offset, akms_count * 4, ENC_NA);
12005       wpa_akms_tree = proto_item_add_subtree(wpa_akms_item, ett_wpa_akms_tree);
12006       for (ii = 0; ii < akms_count; ii++)
12007       {
12008         wpa_sub_akms_item = proto_tree_add_item(wpa_akms_tree, hf_ieee80211_wfa_ie_wpa_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
12009         wpa_sub_akms_tree = proto_item_add_subtree(wpa_sub_akms_item, ett_wpa_sub_akms_tree);
12010         proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
12011
12012         /* Check if OUI is 00:50:F2 (WFA) */
12013         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
12014         {
12015           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
12016           proto_item_append_text(wpa_akms_item, " %s", wpa_akms_return(tvb_get_ntohl(tvb, offset)));
12017         } else {
12018           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
12019         }
12020         offset += 4;
12021       }
12022       break;
12023     }
12024     case 2:   /* Wireless Multimedia Enhancements (WME) */
12025     {
12026       guint8 subtype;
12027
12028       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_subtype, tvb, offset, 1, ENC_NA);
12029       subtype = tvb_get_guint8(tvb, offset);
12030       proto_item_append_text(tree, ": %s", val_to_str(subtype, ieee802111_wfa_ie_wme_type, "Unknown %d"));
12031       offset += 1;
12032       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_version, tvb, offset, 1, ENC_NA);
12033       offset += 1;
12034       switch (subtype) {
12035         case 0: /* WME Information Element */
12036         {
12037           /* WME QoS Info Field */
12038           offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
12039           break;
12040         }
12041         case 1: /* WME Parameter Element */
12042         {
12043           offset = decode_qos_parameter_set(tree, tvb, pinfo, offset, ftype);
12044           break;
12045         }
12046         case 2:   /* WME TSPEC Element */
12047         {
12048             static const int *ieee80211_wfa_ie_wme_tspec_tsinfo[] = {
12049               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
12050               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
12051               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
12052               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
12053               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
12054               NULL
12055             };
12056
12057             proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
12058                                     ett_tsinfo_tree, ieee80211_wfa_ie_wme_tspec_tsinfo,
12059                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12060             offset += 3;
12061
12062             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12063             offset += 2;
12064
12065             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12066             offset += 2;
12067
12068             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12069             offset += 4;
12070
12071             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12072             offset += 4;
12073
12074             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12075             offset += 4;
12076
12077             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12078             offset += 4;
12079
12080             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12081             offset += 4;
12082
12083             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12084             offset += 4;
12085
12086             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12087             offset += 4;
12088
12089             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12090             offset += 4;
12091
12092             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12093             offset += 4;
12094
12095             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12096             offset += 4;
12097
12098             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12099             offset += 4;
12100
12101             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12102             offset += 2;
12103
12104             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12105             offset += 2;
12106
12107           break;
12108         }
12109         default:
12110           /* No default Action */
12111         break;
12112       } /* End switch (subtype) */
12113       break;
12114     }
12115     case 4: /* WPS: Wifi Protected Setup */
12116     {
12117       dissect_wps_tlvs(tree, tvb, offset, tag_len-1, NULL);
12118     }
12119     break;
12120     default:
12121       /* No default Action...*/
12122     break;
12123   } /* End switch (type) */
12124
12125   return offset;
12126 }
12127
12128 /*
12129  * Dissect a group data cipher suite which consists of an OUI and a one-byte
12130  * selector: IEEE802.11 2012 Figure 9-256.
12131  *
12132  * Accepts a two entry array of header fields so we can use this elsewhere.
12133  */
12134 static int dissect_group_data_cipher_suite(tvbuff_t *tvb, packet_info *pinfo _U_,
12135     proto_tree *tree, int offset, int *hf_array, gint ett_val, char *label)
12136 {
12137   proto_tree *gdcs_tree = NULL;
12138
12139   gdcs_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_val, NULL,
12140                          label);
12141   proto_tree_add_item(gdcs_tree, hf_array[0], tvb, offset, 3, ENC_BIG_ENDIAN);
12142   offset += 3;
12143   proto_tree_add_item(gdcs_tree, hf_array[1], tvb, offset, 1, ENC_NA);
12144   offset += 1;
12145
12146   return offset;
12147 }
12148
12149 /*
12150  * Handle the HS 2.0 rev 2 OSU Server-only authenticated layer 2 Encryption
12151  * Network element. This is almost the same format as the RSNE so maybe some
12152  * common code can be used.
12153  */
12154 static int
12155 dissect_hs20_osen(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
12156 {
12157   int offset = 0;
12158   int hf_array[2] = { hf_group_data_cipher_suite_oui,
12159                        hf_group_data_cipher_suite_type };
12160   proto_tree *pwc_list = NULL;
12161   proto_item *pwcsi = NULL;
12162   guint16 pwc_count = 0, pwc_index = 0;
12163   guint16 akms_count = 0, akms_index = 0;
12164   static const int *osen_rsn_cap[] = {
12165     &hf_osen_rsn_cap_preauth,
12166     &hf_osen_rsn_cap_no_pairwise,
12167     &hf_osen_rsn_cap_ptksa_replay_counter,
12168     &hf_osen_rsn_cap_gtksa_replay_counter,
12169     &hf_osen_rsn_cap_mfpr,
12170     &hf_osen_rsn_cap_mfpc,
12171     &hf_osen_rsn_cap_jmr,
12172     &hf_osen_rsn_cap_peerkey,
12173     &hf_osen_rsn_spp_a_msdu_capable,
12174     &hf_osen_rsn_spp_a_msdu_required,
12175     &hf_osen_rsn_pbac,
12176     &hf_osen_extended_key_id_iaf,
12177     &hf_osen_reserved,
12178     NULL
12179   };
12180   guint16 pmkid_count = 0, pmkid_index = 0;
12181   int gmcs_array[2] = { hf_osen_group_management_cipher_suite_oui,
12182                         hf_osen_group_management_cipher_suite_type };
12183
12184   offset = dissect_group_data_cipher_suite(tvb, pinfo, tree, offset, hf_array,
12185                         ett_osen_group_data_cipher_suite,
12186                         "OSEN Group Data Cipher Suite");
12187
12188   pwc_count = tvb_get_letohs(tvb, offset);
12189   proto_tree_add_item(tree, hf_osen_pcs_count, tvb, offset,
12190                       2, ENC_LITTLE_ENDIAN);
12191   offset += 2;
12192
12193   if (pwc_count > 0) {
12194     int start_offset = offset;
12195     pwc_list = proto_tree_add_subtree(tree, tvb, offset, -1,
12196                         ett_osen_pairwise_cipher_suites, &pwcsi,
12197                         "OSEN Pairwise Cipher Suite List");
12198
12199     while (pwc_count > 0) {
12200       if (tvb_reported_length_remaining(tvb, offset) >= 4) {
12201         int hf_array2[2] = { hf_osen_pairwise_cipher_suite_oui,
12202                             hf_osen_pairwise_cipher_suite_type };
12203         char label[128];
12204
12205         g_snprintf(label, sizeof(label), "OSEN Pairwise Cipher Suite %d", pwc_index);
12206         offset = dissect_group_data_cipher_suite(tvb, pinfo, pwc_list,
12207                         offset, hf_array2, ett_osen_pairwise_cipher_suite,
12208                         label);
12209         pwc_index++;
12210         pwc_count--;
12211       } else {
12212         /* Insert the remaining? Expert Info? */
12213         offset += tvb_reported_length_remaining(tvb, offset);
12214         break;
12215       }
12216     }
12217
12218     proto_item_set_len(pwcsi, offset - start_offset);
12219   }
12220
12221   if (tvb_reported_length_remaining(tvb, offset) == 0) {
12222     return tvb_captured_length(tvb);
12223   }
12224
12225   /* Now handle the AKM Suites */
12226   akms_count = tvb_get_letohs(tvb, offset);
12227   proto_tree_add_item(tree, hf_osen_akm_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12228   offset += 2;
12229
12230   if (akms_count > 0) {
12231     int start_offset = offset;
12232     proto_tree *akm_list = NULL;
12233     proto_item *akmcsi = NULL;
12234
12235     akm_list = proto_tree_add_subtree(tree, tvb, offset, -1,
12236                         ett_osen_akm_cipher_suites, &akmcsi,
12237                         "OSEN AKM Cipher Suite List");
12238
12239     while (akms_count > 0) {
12240       if (tvb_reported_length_remaining(tvb, offset) >= 4) {
12241         int hf_array3[2] = { hf_osen_akm_cipher_suite_oui,
12242                              hf_osen_akm_cipher_suite_type};
12243         char label[128];
12244
12245         g_snprintf(label, sizeof(label), "OSEN AKM Cipher Suite %d", akms_index);
12246         offset = dissect_group_data_cipher_suite(tvb, pinfo, akm_list,
12247                           offset, hf_array3, ett_osen_akm_cipher_suite,
12248                           label);
12249         akms_index++;
12250         akms_count--;
12251       } else {
12252         /* Expert info? */
12253         offset += tvb_reported_length_remaining(tvb, offset);
12254         break;
12255       }
12256     }
12257     proto_item_set_len(akmcsi, offset - start_offset);
12258   }
12259
12260   /* Any more? */
12261   if (tvb_reported_length_remaining(tvb, offset) == 0) {
12262     return tvb_captured_length(tvb);
12263   }
12264
12265   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_osen_rsn_cap_flags,
12266                                     ett_osen_rsn_cap_tree, osen_rsn_cap,
12267                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12268   offset += 2;
12269
12270   /* Any more? */
12271   if (tvb_reported_length_remaining(tvb, offset) == 0) {
12272     return tvb_captured_length(tvb);
12273   }
12274
12275   pmkid_count = tvb_get_letohs(tvb, offset);
12276   proto_tree_add_item(tree, hf_osen_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12277   offset += 2;
12278
12279   if (pmkid_count > 0) {
12280     proto_tree *pmkid_list = NULL;
12281
12282     pmkid_list = proto_tree_add_subtree(tree, tvb, offset, pmkid_count * 16,
12283                                 ett_osen_pmkid_list, NULL,
12284                                 "OSEN PKMID List");
12285
12286     while (pmkid_count > 0) {
12287       proto_tree *pmkid_tree = NULL;
12288
12289       pmkid_tree = proto_tree_add_subtree_format(pmkid_list, tvb,offset, 16,
12290                                 ett_osen_pmkid_tree, NULL,
12291                                 "OSEN PKMID %d", pmkid_index);
12292       proto_tree_add_item(pmkid_tree, hf_osen_pmkid, tvb, offset, 16,
12293                           ENC_NA);
12294       offset += 16;
12295       pmkid_index++;
12296       pmkid_count--;
12297     }
12298   }
12299
12300   offset = dissect_group_data_cipher_suite(tvb, pinfo, tree, offset, gmcs_array,
12301                         ett_osen_group_management_cipher_suite,
12302                         "OSEN Group Management Cipher Suite");
12303
12304   return offset;
12305 }
12306
12307 static const value_string hs20_indication_release_number_vals[] = {
12308   { 0, "Release 1" },
12309   { 1, "Release 2" },
12310   { 0, NULL }
12311 };
12312
12313 static int
12314 dissect_hs20_indication(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
12315 {
12316   static const int *ieee80211_hs20_indication[] = {
12317     &hf_hs20_indication_dgaf_disabled,
12318     &hf_hs20_indication_pps_mo_id_present,
12319     &hf_hs20_indication_anqp_domain_id_present,
12320     &hf_hs20_reserved,
12321     &hf_hs20_indication_release_number,
12322     NULL
12323   };
12324   int len = tvb_captured_length(tvb);
12325   int offset = 0;
12326   guint8 indic = tvb_get_guint8(tvb, offset);
12327
12328   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_hs20_indication,
12329                               ENC_NA);
12330   offset++;
12331
12332   if (len >= 3 && (indic & 0x02)) { /* Contains a PPS MO ID field ... display it. */
12333       proto_tree_add_item(tree, hf_hs20_indication_pps_mo_id, tvb, offset,
12334                           2, ENC_LITTLE_ENDIAN);
12335       offset += 2;
12336   }
12337
12338   if ((len >= (offset + 2)) && (indic & 0x04)) {
12339      proto_tree_add_item(tree, hf_hs20_indication_anqp_domain_id, tvb, offset,
12340                          2, ENC_LITTLE_ENDIAN);
12341      offset += 2;
12342   }
12343
12344   return offset;
12345 }
12346
12347 static void
12348 dissect_vendor_ie_wfa(packet_info *pinfo, proto_item *item, tvbuff_t *tag_tvb)
12349 {
12350   gint tag_len = tvb_reported_length(tag_tvb);
12351   guint8 subtype;
12352   int offset = 0;
12353   tvbuff_t *vendor_tvb;
12354
12355   if (tag_len < 4)
12356     return;
12357
12358   subtype = tvb_get_guint8(tag_tvb, 3);
12359   proto_item_append_text(item, ": %s", val_to_str_const(subtype, wfa_subtype_vals, "Unknown"));
12360   vendor_tvb = tvb_new_subset_length(tag_tvb, offset + 4, tag_len - 4);
12361   dissector_try_uint_new(wifi_alliance_ie_table, subtype, vendor_tvb, pinfo, item, FALSE, NULL);
12362 }
12363
12364 static void
12365 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
12366 {
12367
12368   switch(tvb_get_guint8(tvb, offset)){
12369     case 4:
12370     {
12371       /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
12372        * This is only used within EAPOL-Key frame Key Data. */
12373       offset += 1;
12374       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_pmkid, tvb, offset, 16, ENC_NA);
12375     }
12376     break;
12377     default:
12378       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_unknown, tvb, offset, tag_len, ENC_NA);
12379     break;
12380   }
12381
12382   proto_item_append_text(item, ": RSN");
12383
12384 }
12385
12386 typedef enum {
12387   MARVELL_IE_MESH = 4
12388 } marvell_ie_type_t;
12389
12390 static void
12391 dissect_vendor_ie_marvell(proto_item *item _U_, proto_tree *ietree,
12392                           tvbuff_t *tvb, int offset, guint32 tag_len)
12393 {
12394   guint8 type;
12395
12396   type = tvb_get_guint8(tvb, offset);
12397   proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12398   offset += 1;
12399
12400   switch (type) {
12401   case MARVELL_IE_MESH:
12402     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_subtype, tvb,
12403                          offset++, 1, ENC_LITTLE_ENDIAN);
12404     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_version, tvb,
12405                          offset++, 1, ENC_LITTLE_ENDIAN);
12406     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_active_proto_id, tvb,
12407                          offset++, 1, ENC_LITTLE_ENDIAN);
12408     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_active_metric_id, tvb,
12409                          offset++, 1, ENC_LITTLE_ENDIAN);
12410     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_cap, tvb,
12411                          offset++, 1, ENC_LITTLE_ENDIAN);
12412     break;
12413
12414   default:
12415     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_data, tvb, offset,
12416       tag_len - 1, ENC_NA);
12417     break;
12418   }
12419 }
12420
12421 typedef enum {
12422   ATHEROS_IE_ADVCAP = 1,
12423   ATHEROS_IE_XR = 3
12424 } atheros_ie_type_t;
12425
12426 typedef enum {
12427   ATHEROS_IE_ADVCAP_S = 1
12428 } atheros_ie_advcap_subtype_t;
12429
12430 typedef enum {
12431   ATHEROS_IE_XR_S = 1
12432 } atheros_ie_xr_subtype_t;
12433
12434 typedef enum {
12435   ATHEROS_IE_CAP_TURBOP = 0x01,
12436   ATHEROS_IE_CAP_COMP   = 0x02,
12437   ATHEROS_IE_CAP_FF     = 0x04,
12438   ATHEROS_IE_CAP_XR     = 0x08,
12439   ATHEROS_IE_CAP_AR     = 0x10,
12440   ATHEROS_IE_CAP_BURST  = 0x20,
12441   ATHEROS_IE_CAP_WME    = 0x40,
12442   ATHEROS_IE_CAP_BOOST  = 0x80
12443 } atheros_ie_cap_t;
12444
12445 static const value_string atheros_ie_type_vals[] = {
12446   { ATHEROS_IE_ADVCAP, "Advanced Capability"},
12447   { ATHEROS_IE_XR,     "eXtended Range"},
12448   { 0,                 NULL }
12449 };
12450
12451 static const int *ieee80211_atheros_ie_cap[] = {
12452   &hf_ieee80211_atheros_ie_cap_f_turbop,
12453   &hf_ieee80211_atheros_ie_cap_f_comp,
12454   &hf_ieee80211_atheros_ie_cap_f_ff,
12455   &hf_ieee80211_atheros_ie_cap_f_xr,
12456   &hf_ieee80211_atheros_ie_cap_f_ar,
12457   &hf_ieee80211_atheros_ie_cap_f_burst,
12458   &hf_ieee80211_atheros_ie_cap_f_wme,
12459   &hf_ieee80211_atheros_ie_cap_f_boost,
12460   NULL
12461 };
12462
12463 static void
12464 dissect_vendor_ie_atheros(proto_item *item _U_, proto_tree *ietree,
12465                           tvbuff_t *tvb, int offset, guint tag_len,
12466                           packet_info *pinfo, proto_item *ti_len)
12467 {
12468   guint8      type;
12469   guint8      subtype;
12470   guint8      version;
12471
12472   if (tag_len <= 3) {
12473         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 */
12474         return;
12475   }
12476   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_type, tvb, offset, 1, ENC_NA);
12477   type = tvb_get_guint8(tvb, offset);
12478   proto_item_append_text(item, ": %s", val_to_str_const(type, atheros_ie_type_vals, "Unknown"));
12479   offset  += 1;
12480   tag_len -= 1;
12481
12482   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_subtype, tvb, offset, 1, ENC_NA);
12483   subtype  = tvb_get_guint8(tvb, offset);
12484   offset  += 1;
12485   tag_len -= 1;
12486
12487   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_version, tvb, offset, 1, ENC_NA);
12488   version  = tvb_get_guint8(tvb, offset);
12489   offset  += 1;
12490   tag_len -= 1;
12491
12492   if (version == 0)
12493   {
12494     switch (type) {
12495       case ATHEROS_IE_ADVCAP:
12496       {
12497         switch (subtype) {
12498           case ATHEROS_IE_ADVCAP_S:
12499           {
12500             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_advcap_cap,
12501                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
12502                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12503             offset   += 1;
12504             tag_len  -= 1;
12505
12506             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_defkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12507             offset  += 2;
12508             tag_len -= 2;
12509             break;
12510           }
12511           default:
12512           /* No default Action */
12513           break;
12514         } /* End switch (subtype) */
12515         break;
12516       }
12517       case ATHEROS_IE_XR:
12518       {
12519         switch (subtype) {
12520           case ATHEROS_IE_XR_S:
12521           {
12522             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_info, tvb, offset, 1, ENC_NA);
12523             offset  += 1;
12524             tag_len -= 1;
12525
12526             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_bssid, tvb, offset, 6, ENC_NA);
12527             offset  += 6;
12528             tag_len -= 6;
12529
12530             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_bssid, tvb, offset, 6, ENC_NA);
12531             offset  += 6;
12532             tag_len -= 6;
12533
12534             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12535             offset  += 2;
12536             tag_len -= 2;
12537
12538             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_xr_base_cap,
12539                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
12540                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12541             offset   += 1;
12542             tag_len  -= 1;
12543
12544             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_xr_xr_cap,
12545                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
12546                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12547             offset   += 1;
12548             tag_len  -= 1;
12549             break;
12550           }
12551           default:
12552           /* No default Action */
12553           break;
12554         } /* End switch (subtype) */
12555         break;
12556         default:
12557         /* No default Action */
12558         break;
12559       } /* End switch (type) */
12560
12561     }
12562   }
12563   if (tag_len > 0) {
12564     proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_data, tvb, offset, tag_len, ENC_NA);
12565   }
12566 }
12567
12568 typedef enum {
12569   AIRONET_IE_DTPC = 0,
12570   AIRONET_IE_UNKNOWN1 = 1,
12571   AIRONET_IE_VERSION = 3,
12572   AIRONET_IE_QOS,
12573   AIRONET_IE_UNKNOWN11 = 11,
12574   AIRONET_IE_QBSS_V2 = 14,
12575   AIRONET_IE_CLIENT_MFP = 20
12576 } aironet_ie_type_t;
12577
12578 static const value_string aironet_ie_type_vals[] = {
12579   { AIRONET_IE_DTPC,      "DTPC"},
12580   { AIRONET_IE_UNKNOWN1,  "Unknown (1)"},
12581   { AIRONET_IE_VERSION,   "CCX version"},
12582   { AIRONET_IE_QOS,       "Qos"},
12583   { AIRONET_IE_UNKNOWN11, "Unknown (11)"},
12584   { AIRONET_IE_QBSS_V2,   "QBSS V2 - CCA"},
12585   { AIRONET_IE_CLIENT_MFP, "Client MFP"},
12586   { 0,                    NULL }
12587 };
12588
12589 static const value_string aironet_mfp_vals[] = {
12590   { 0,      "Disabled"},
12591   { 1,      "Enabled"},
12592   { 0,      NULL }
12593 };
12594
12595 static void
12596 dissect_vendor_ie_aironet(proto_item *aironet_item, proto_tree *ietree,
12597                           tvbuff_t *tvb, int offset, guint32 tag_len)
12598 {
12599   guint8  type;
12600   int i;
12601   gboolean dont_change = FALSE; /* Don't change the IE item text to default */
12602
12603   type = tvb_get_guint8(tvb, offset);
12604   proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12605   offset += 1;
12606
12607   switch (type) {
12608   case AIRONET_IE_DTPC:
12609     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_dtpc, tvb, offset, 1, ENC_NA);
12610     proto_item_append_text(aironet_item, ": Aironet DTPC Powerlevel %ddBm", tvb_get_guint8(tvb, offset));
12611     offset += 1;
12612     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_dtpc_unknown, tvb, offset, 1, ENC_NA);
12613     dont_change = TRUE;
12614     break;
12615   case AIRONET_IE_VERSION:
12616     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12617     proto_item_append_text(aironet_item, ": Aironet CCX version = %d", tvb_get_guint8(tvb, offset));
12618     dont_change = TRUE;
12619     break;
12620   case AIRONET_IE_QOS:
12621     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_qos_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12622     offset += 1;
12623     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_qos_paramset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12624     offset += 1;
12625
12626     /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
12627      *  need to be swapped. Also, the "TXOP" may be TXOP - or not.
12628      */
12629     for (i = 0; i < 4; i++) {
12630       guint8 byte1, byte2;
12631       guint16 txop;
12632       byte1 = tvb_get_guint8(tvb, offset);
12633       byte2 = tvb_get_guint8(tvb, offset + 1);
12634       txop = tvb_get_letohs(tvb, offset + 2);
12635       proto_tree_add_bytes_format(ietree, hf_ieee80211_aironet_ie_qos_val, tvb, offset, 4, NULL,
12636           "CCX QoS Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
12637         (byte1 & 0x60) >> 5, val_to_str((byte1 & 0x60) >> 5, wme_acs, "(Unknown: %d)"),
12638         (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
12639         byte2 & 0x0f, (byte2 & 0xf0) >> 4,
12640         txop);
12641       offset += 4;
12642     }
12643     break;
12644   case AIRONET_IE_QBSS_V2:
12645     /* Extract Values */
12646     proto_tree_add_item(ietree, hf_ieee80211_qbss2_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12647     proto_tree_add_item(ietree, hf_ieee80211_qbss2_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
12648     proto_tree_add_item(ietree, hf_ieee80211_qbss2_cal, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
12649     proto_tree_add_item(ietree, hf_ieee80211_qbss2_gl, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
12650     break;
12651   case AIRONET_IE_CLIENT_MFP:
12652     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_clientmfp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12653     proto_item_append_text(aironet_item, ": Aironet Client MFP %s",
12654       val_to_str_const(1 & tvb_get_guint8(tvb, offset), aironet_mfp_vals, "Unknown"));
12655     dont_change = TRUE;
12656     break;
12657   default:
12658     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_data, tvb, offset,
12659       tag_len - 1, ENC_NA);
12660     break;
12661   }
12662   if (!dont_change) {
12663     proto_item_append_text(aironet_item, ": Aironet %s (%d)",
12664       val_to_str_const(type, aironet_ie_type_vals, "Unknown"), type);
12665   }
12666 }
12667
12668 #define ARUBA_APNAME  3
12669 static const value_string ieee80211_vs_aruba_subtype_vals[] = {
12670   { ARUBA_APNAME, "AP Name"},
12671   { 0,                 NULL }
12672 };
12673 static void
12674 dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree,
12675                           tvbuff_t *tvb, int offset, guint32 tag_len)
12676 {
12677   guint8 type;
12678   const guint8* name;
12679
12680   offset += 1; /* VS OUI Type */
12681   tag_len -= 1;
12682
12683   type = tvb_get_guint8(tvb, offset);
12684   proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_subtype, tvb, offset, 1, ENC_NA);
12685   proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aruba_subtype_vals, "Unknown"));
12686   offset += 1;
12687   tag_len -= 1;
12688
12689   switch (type) {
12690   case ARUBA_APNAME:
12691     offset += 1;
12692     tag_len -= 1;
12693
12694     proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aruba_apname, tvb,
12695                          offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name);
12696     proto_item_append_text(item, " (%s)", name);
12697     break;
12698
12699   default:
12700     proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_data, tvb, offset,
12701       tag_len, ENC_NA);
12702     proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len));
12703     break;
12704   }
12705 }
12706
12707 static void
12708 dissect_vendor_ie_mikrotik(proto_item *item _U_, proto_tree *ietree,
12709                           tvbuff_t *tvb, int offset, guint32 tag_len)
12710 {
12711   guint8 type, length;
12712   proto_item *subitem;
12713   proto_tree *subtree;
12714
12715   offset += 1; /* VS OUI Type */
12716   tag_len -= 1;
12717   /* FIXME: Make sure we have at least 2 bytes left */
12718   proto_tree_add_item(ietree, hf_ieee80211_vs_mikrotik_unknown, tvb, offset, 2, ENC_NA);
12719
12720   offset += 2;
12721   tag_len -= 2;
12722
12723   while (tag_len >= 2) {
12724     type = tvb_get_guint8(tvb, offset);
12725     length = tvb_get_guint8(tvb, offset+1);
12726     subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_mikrotik_subitem, tvb, offset, length+2, ENC_NA);
12727     subtree = proto_item_add_subtree(subitem, ett_mikrotik);
12728     proto_item_set_text(subitem, "Sub IE (T/L: %d/%d)", type, length);
12729
12730     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_subtype, tvb, offset, 1, ENC_NA);
12731     offset += 1;
12732     tag_len -= 1;
12733
12734     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_sublength, tvb, offset, 1, ENC_NA);
12735     offset += 1;
12736     tag_len -= 1;
12737
12738     if (tag_len < length)
12739       /* FIXME: warn about this */
12740       length = tag_len;
12741     if (length == 0) {
12742       break;
12743     }
12744
12745     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_subdata, tvb, offset, length, ENC_NA);
12746     offset += length;
12747     tag_len -= length;
12748   }
12749 }
12750
12751 enum vs_nintendo_type {
12752   NINTENDO_SERVICES = 0x11,
12753   NINTENDO_CONSOLEID = 0xF0
12754 };
12755
12756 static const value_string ieee80211_vs_nintendo_type_vals[] = {
12757   { NINTENDO_SERVICES,  "Services"},
12758   { NINTENDO_CONSOLEID, "ConsoleID"},
12759   { 0, NULL }
12760 };
12761
12762 static proto_tree*
12763 dissect_vendor_ie_nintendo_tlv(const int hfindex, proto_tree *ietree,
12764                           tvbuff_t *tvb, int offset, guint32 sublen)
12765 {
12766   proto_item *nintendo_item;
12767   proto_tree *nintendo_tree;
12768
12769   nintendo_item = proto_tree_add_item(ietree, hfindex, tvb, offset, sublen, ENC_NA);
12770   nintendo_tree = proto_item_add_subtree(nintendo_item, ett_nintendo);
12771
12772   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_type, tvb, offset, 1, ENC_NA);
12773   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_length, tvb, offset + 1,  1, ENC_NA);
12774
12775   return nintendo_tree;
12776 }
12777
12778 static void
12779 dissect_vendor_ie_nintendo(proto_item *item _U_, proto_tree *ietree,
12780                           tvbuff_t *tvb, int offset, guint32 tag_len)
12781 {
12782   proto_tree *nintendo_tree;
12783
12784   guint8      subtype;
12785   guint8      sublength;
12786   guint32     length = tag_len;
12787
12788   /* Skip OUI type for now - the code is for type 1 (StreetPass) only */
12789   /* http://3dbrew.org/wiki/StreetPass */
12790   offset += 1;
12791   length -= 1;
12792
12793   while(length > 0 && length < 256) { /* otherwise we are < 0 but on unsigned */
12794     subtype = tvb_get_guint8(tvb, offset);
12795     sublength = tvb_get_guint8(tvb, offset + 1);
12796
12797     switch(subtype) {
12798     case NINTENDO_SERVICES:
12799       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_servicelist, ietree, tvb, offset, sublength + 2);
12800       offset += 2;
12801       length -= 2;
12802
12803       while (sublength > 4) {
12804
12805         proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_service, tvb, offset, 5, ENC_NA);
12806         offset += 5;
12807         length -= 5;
12808         sublength -= 5;
12809       }
12810       break;
12811     case NINTENDO_CONSOLEID:
12812       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_consoleid, ietree, tvb, offset, sublength + 2);
12813       offset += + 2;
12814       length -= + 2;
12815
12816       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_consoleid, tvb, offset, sublength, ENC_NA);
12817       offset += sublength;
12818       length -= sublength;
12819       break;
12820     default:
12821       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_unknown, ietree, tvb, offset, sublength + 2);
12822       offset += + 2;
12823       length -= + 2;
12824
12825       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_unknown, tvb, offset, sublength, ENC_NA);
12826       offset += sublength;
12827       length -= sublength;
12828       break;
12829     }
12830   }
12831 }
12832
12833 static void
12834 dissect_vendor_ie_meru(proto_item *item _U_, proto_tree *ietree,
12835                        tvbuff_t *tvb, int offset, guint32 tag_len,
12836                        packet_info *pinfo)
12837 {
12838   guint32 type, length;
12839   proto_item *subitem, *ti_len;
12840   proto_tree *subtree;
12841
12842   while (tag_len >= 2) {
12843     subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_meru_subitem, tvb, offset, 2, ENC_NA);
12844     subtree = proto_item_add_subtree(subitem, ett_meru);
12845
12846     proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_subtype, tvb, offset, 1, ENC_NA, &type);
12847     offset += 1;
12848     tag_len -= 1;
12849
12850     ti_len = proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_sublength, tvb, offset, 1, ENC_NA, &length);
12851     offset += 1;
12852     tag_len -= 1;
12853
12854     if (tag_len < length) {
12855       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < Sub Length");
12856       length = tag_len;
12857     }
12858
12859     proto_item_append_text(subitem, " (t=%d, l=%d)", type, length);
12860     proto_item_set_len(subitem, 2+length);
12861
12862     proto_tree_add_item(subtree, hf_ieee80211_vs_meru_subdata, tvb, offset, length, ENC_NA);
12863     offset += length;
12864     tag_len -= length;
12865
12866   }
12867 }
12868
12869 static const value_string ieee80211_vs_extreme_subtype_vals[] = {
12870   { 1, "AP Name"},
12871   { 0, NULL }
12872 };
12873
12874 static void
12875 dissect_vendor_ie_extreme(proto_item *item _U_, proto_tree *ietree,
12876                           tvbuff_t *tvb, int offset, guint32 tag_len,
12877                           packet_info *pinfo)
12878 {
12879   guint32 type, length;
12880   proto_item *ti_len;
12881
12882   proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_extreme_subtype, tvb, offset, 1, ENC_NA, &type);
12883   offset += 1;
12884   tag_len -= 1;
12885
12886   proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_subdata, tvb, offset, tag_len, ENC_NA);
12887
12888   switch(type){
12889     case 1: /* Unknown (7 bytes) + AP Name Length (1 byte) + AP Name */
12890
12891       proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_unknown, tvb, offset, 7, ENC_NA);
12892       offset += 7;
12893       tag_len -= 1;
12894
12895       ti_len = proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_extreme_ap_length, tvb, offset, 1, ENC_NA, &length);
12896       offset += 1;
12897       tag_len -= 1;
12898
12899       if (tag_len < length) {
12900         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < AP Length");
12901         length = tag_len;
12902       }
12903
12904     proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA);
12905
12906     break;
12907     default:
12908     /* Expert info ? */
12909     break;
12910   }
12911 }
12912
12913 /* 802.11-2012 8.4.2.37 QoS Capability element */
12914 static int
12915 dissect_qos_capability(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
12916 {
12917   switch (ftype) {
12918     case MGT_ASSOC_REQ:
12919     case MGT_PROBE_REQ:
12920     case MGT_REASSOC_REQ:
12921     {
12922       /* To AP so decode Qos Info as STA */
12923       offset += add_ff_qos_info_sta(tree, tvb, pinfo, offset);
12924       break;
12925     }
12926
12927     case MGT_BEACON:
12928     case MGT_PROBE_RESP:
12929     case MGT_ASSOC_RESP:
12930     case MGT_REASSOC_RESP:
12931     {
12932       /* From AP so decode QoS Info as AP */
12933       offset += add_ff_qos_info_ap(tree, tvb, pinfo, offset);
12934       break;
12935     }
12936
12937     default:
12938       expert_add_info_format(pinfo, proto_tree_get_parent(tree), &ei_ieee80211_qos_info_bad_ftype,
12939                              "Could not deduce direction to decode correctly, ftype %u", ftype);
12940       break;
12941   }
12942
12943   return offset;
12944 }
12945
12946 /*
12947  * 7.3.2.25 RSNE information element. Common format with OSEN except the
12948  * verison... should refactor
12949  */
12950 static int
12951 dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
12952                int offset, guint32 tag_len, association_sanity_check_t *association_sanity_check)
12953 {
12954   proto_item *rsn_gcs_item, *rsn_pcs_item, *rsn_akms_item, *rsn_pmkid_item, *rsn_gmcs_item;
12955   proto_item *rsn_sub_pcs_item, *rsn_sub_akms_item;
12956   proto_item *rsn_pcs_count, *rsn_akms_count, *rsn_pmkid_count;
12957   proto_tree *rsn_gcs_tree, *rsn_pcs_tree, *rsn_akms_tree, *rsn_pmkid_tree, *rsn_gmcs_tree;
12958   proto_tree *rsn_sub_pcs_tree, *rsn_sub_akms_tree;
12959   guint16     pcs_count, akms_count, pmkid_count;
12960   guint       ii;
12961   int         tag_end = offset + tag_len;
12962   static const int *ieee80211_rsn_cap[] = {
12963     &hf_ieee80211_rsn_cap_preauth,
12964     &hf_ieee80211_rsn_cap_no_pairwise,
12965     &hf_ieee80211_rsn_cap_ptksa_replay_counter,
12966     &hf_ieee80211_rsn_cap_gtksa_replay_counter,
12967     &hf_ieee80211_rsn_cap_mfpr,
12968     &hf_ieee80211_rsn_cap_mfpc,
12969     &hf_ieee80211_rsn_cap_jmr,
12970     &hf_ieee80211_rsn_cap_peerkey,
12971     NULL
12972   };
12973
12974   proto_tree_add_item(tree, hf_ieee80211_rsn_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12975   offset += 2;
12976
12977   /* 7.3.2.25.1 Group Cipher suites */
12978   rsn_gcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gcs, tvb, offset, 4, ENC_BIG_ENDIAN);
12979   rsn_gcs_tree = proto_item_add_subtree(rsn_gcs_item, ett_rsn_gcs_tree);
12980   proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
12981
12982     /* Check if OUI is 00:0F:AC (ieee80211) */
12983   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
12984   {
12985     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
12986   } else {
12987     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
12988   }
12989   offset += 4;
12990
12991   /* 7.3.2.25.2 Pairwise Cipher suites */
12992   rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12993   pcs_count = tvb_get_letohs(tvb, offset);
12994   offset += 2;
12995
12996   if (offset + (pcs_count * 4) > tag_end)
12997   {
12998     expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
12999         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
13000     pcs_count = (tag_end - offset) / 4;
13001   }
13002
13003   rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
13004   rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
13005   for (ii = 0; ii < pcs_count; ii++)
13006   {
13007     rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
13008     rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
13009     proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
13010
13011     /* Check if OUI is 00:0F:AC (ieee80211) */
13012     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
13013     {
13014       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
13015       proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
13016     } else {
13017       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
13018     }
13019     offset += 4;
13020   }
13021
13022   if (offset >= tag_end)
13023   {
13024     return offset;
13025   }
13026
13027   /* 7.3.2.25.2 AKM suites */
13028   rsn_akms_count = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13029   akms_count = tvb_get_letohs(tvb, offset);
13030   offset += 2;
13031
13032   if (offset + (akms_count * 4) > tag_end)
13033   {
13034     expert_add_info_format(pinfo, rsn_akms_count, &ei_ieee80211_rsn_pmkid_count,
13035         "Auth Key Management (AKM) Suite Count too large, 4*%u > %d", akms_count, tag_end - offset);
13036     akms_count = (tag_end - offset) / 4;
13037   }
13038
13039   rsn_akms_item = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_list, tvb, offset, akms_count * 4, ENC_NA);
13040   rsn_akms_tree = proto_item_add_subtree(rsn_akms_item, ett_rsn_akms_tree);
13041   for (ii = 0; ii < akms_count; ii++)
13042   {
13043     rsn_sub_akms_item = proto_tree_add_item(rsn_akms_tree, hf_ieee80211_rsn_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
13044     rsn_sub_akms_tree = proto_item_add_subtree(rsn_sub_akms_item, ett_rsn_sub_akms_tree);
13045     proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
13046
13047     /* Check if OUI is 00:0F:AC (ieee80211) */
13048     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
13049     {
13050       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
13051       proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(tvb_get_ntohl(tvb, offset)));
13052
13053       if (association_sanity_check) {
13054         guint32 akm_suite = tvb_get_ntohl(tvb, offset);
13055         if (akm_suite == 0x000FAC03 || akm_suite == 0x000FAC04 || akm_suite == 0x000FAC09) {
13056           /* This is an FT AKM suite */
13057           association_sanity_check->has_ft_akm_suite = TRUE;
13058           if (association_sanity_check->rsn_first_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
13059             association_sanity_check->rsn_first_ft_akm_suite = rsn_sub_akms_tree->last_child;
13060           }
13061         } else {
13062           /* This is a non-FT AKM suite */
13063           association_sanity_check->has_non_ft_akm_suite = TRUE;
13064           if (association_sanity_check->rsn_first_non_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
13065             association_sanity_check->rsn_first_non_ft_akm_suite = rsn_sub_akms_tree->last_child;
13066           }
13067         }
13068       }
13069     } else {
13070       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
13071     }
13072     offset += 4;
13073   }
13074
13075   /* 7.3.2.25.3 RSN capabilities */
13076   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_rsn_cap,
13077                                     ett_rsn_cap_tree, ieee80211_rsn_cap,
13078                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13079   offset += 2;
13080   if (offset >= tag_end)
13081   {
13082     return offset;
13083   }
13084   /* 7.3.2.25.4 PMKID */
13085   rsn_pmkid_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13086   pmkid_count = tvb_get_letohs(tvb, offset);
13087   offset += 2;
13088
13089   if (offset + (pmkid_count * 16) > tag_end)
13090   {
13091     expert_add_info_format(pinfo, rsn_pmkid_count, &ei_ieee80211_pmkid_count_too_large,
13092         "PMKID Count too large, 16*%u > %d", pmkid_count, tag_end - offset);
13093     pmkid_count = (tag_end - offset) / 16;
13094   }
13095
13096   rsn_pmkid_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_list, tvb, offset, pmkid_count * 16, ENC_NA);
13097   rsn_pmkid_tree = proto_item_add_subtree(rsn_pmkid_item, ett_rsn_pmkid_tree);
13098   for (ii = 0; ii < pmkid_count; ii++)
13099   {
13100     proto_tree_add_item(rsn_pmkid_tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
13101     offset += 16;
13102   }
13103
13104   if (offset >= tag_end)
13105   {
13106     return offset;
13107   }
13108   /* Group Management Cipher Suite (802.11w)*/
13109   rsn_gmcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gmcs, tvb, offset, 4, ENC_BIG_ENDIAN);
13110   rsn_gmcs_tree = proto_item_add_subtree(rsn_gmcs_item, ett_rsn_gmcs_tree);
13111   proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
13112   /* Check if OUI is 00:0F:AC (ieee80211) */
13113   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
13114   {
13115     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
13116   } else {
13117     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
13118   }
13119   offset += 4;
13120
13121   return offset;
13122 }
13123
13124 /* 7.3.2.27 Extended Capabilities information element (127) */
13125 static int
13126 dissect_extended_capabilities_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13127 {
13128   int tag_len = tvb_reported_length(tvb);
13129   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13130   int offset = 0;
13131   proto_item *ti_ex_cap;
13132   static const int *ieee80211_tag_extended_capabilities_byte1[] = {
13133     &hf_ieee80211_tag_extended_capabilities_b0,
13134     &hf_ieee80211_tag_extended_capabilities_b1,
13135     &hf_ieee80211_tag_extended_capabilities_b2,
13136     &hf_ieee80211_tag_extended_capabilities_b3,
13137     &hf_ieee80211_tag_extended_capabilities_b4,
13138     &hf_ieee80211_tag_extended_capabilities_b5,
13139     &hf_ieee80211_tag_extended_capabilities_b6,
13140     &hf_ieee80211_tag_extended_capabilities_b7,
13141     NULL
13142   };
13143   static const int *ieee80211_tag_extended_capabilities_byte2[] = {
13144     &hf_ieee80211_tag_extended_capabilities_b8,
13145     &hf_ieee80211_tag_extended_capabilities_b9,
13146     &hf_ieee80211_tag_extended_capabilities_b10,
13147     &hf_ieee80211_tag_extended_capabilities_b11,
13148     &hf_ieee80211_tag_extended_capabilities_b12,
13149     &hf_ieee80211_tag_extended_capabilities_b13,
13150     &hf_ieee80211_tag_extended_capabilities_b14,
13151     &hf_ieee80211_tag_extended_capabilities_b15,
13152     NULL
13153   };
13154   static const int *ieee80211_tag_extended_capabilities_byte3[] = {
13155     &hf_ieee80211_tag_extended_capabilities_b16,
13156     &hf_ieee80211_tag_extended_capabilities_b17,
13157     &hf_ieee80211_tag_extended_capabilities_b18,
13158     &hf_ieee80211_tag_extended_capabilities_b19,
13159     &hf_ieee80211_tag_extended_capabilities_b20,
13160     &hf_ieee80211_tag_extended_capabilities_b21,
13161     &hf_ieee80211_tag_extended_capabilities_b22,
13162     &hf_ieee80211_tag_extended_capabilities_b23,
13163     NULL
13164   };
13165   static const int *ieee80211_tag_extended_capabilities_byte4[] = {
13166     &hf_ieee80211_tag_extended_capabilities_b24,
13167     &hf_ieee80211_tag_extended_capabilities_b25,
13168     &hf_ieee80211_tag_extended_capabilities_b26,
13169     &hf_ieee80211_tag_extended_capabilities_b27,
13170     &hf_ieee80211_tag_extended_capabilities_b28,
13171     &hf_ieee80211_tag_extended_capabilities_b29,
13172     &hf_ieee80211_tag_extended_capabilities_b30,
13173     &hf_ieee80211_tag_extended_capabilities_b31,
13174     NULL
13175   };
13176   static const int *ieee80211_tag_extended_capabilities_byte5[] = {
13177     &hf_ieee80211_tag_extended_capabilities_b32,
13178     &hf_ieee80211_tag_extended_capabilities_b33,
13179     &hf_ieee80211_tag_extended_capabilities_b34,
13180     &hf_ieee80211_tag_extended_capabilities_b35,
13181     &hf_ieee80211_tag_extended_capabilities_b36,
13182     &hf_ieee80211_tag_extended_capabilities_b37,
13183     &hf_ieee80211_tag_extended_capabilities_b38,
13184     &hf_ieee80211_tag_extended_capabilities_b39,
13185     NULL
13186   };
13187   static const int *ieee80211_tag_extended_capabilities_byte6[] = {
13188     &hf_ieee80211_tag_extended_capabilities_b40,
13189     &hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
13190     &hf_ieee80211_tag_extended_capabilities_b44,
13191     &hf_ieee80211_tag_extended_capabilities_b45,
13192     &hf_ieee80211_tag_extended_capabilities_b46,
13193     &hf_ieee80211_tag_extended_capabilities_b47,
13194     NULL
13195   };
13196   static const int *ieee80211_tag_extended_capabilities_byte7[] = {
13197     &hf_ieee80211_tag_extended_capabilities_b48,
13198     &hf_ieee80211_tag_extended_capabilities_b49,
13199     &hf_ieee80211_tag_extended_capabilities_b50,
13200     &hf_ieee80211_tag_extended_capabilities_b51,
13201     &hf_ieee80211_tag_extended_capabilities_b52,
13202     &hf_ieee80211_tag_extended_capabilities_b53,
13203     &hf_ieee80211_tag_extended_capabilities_b54,
13204     &hf_ieee80211_tag_extended_capabilities_b55,
13205     NULL
13206   };
13207
13208   static const int *ieee80211_tag_extended_capabilities_byte8[] = {
13209     &hf_ieee80211_tag_extended_capabilities_b56,
13210     &hf_ieee80211_tag_extended_capabilities_b57,
13211     &hf_ieee80211_tag_extended_capabilities_b58,
13212     &hf_ieee80211_tag_extended_capabilities_b59,
13213     &hf_ieee80211_tag_extended_capabilities_b60,
13214     &hf_ieee80211_tag_extended_capabilities_b61,
13215     &hf_ieee80211_tag_extended_capabilities_b62,
13216     &hf_ieee80211_tag_extended_capabilities_b63,
13217     NULL
13218   };
13219
13220   static const int *ieee80211_tag_extended_capabilities_bytes89[] = {
13221     &hf_ieee80211_tag_extended_capabilities_b56_2,
13222     &hf_ieee80211_tag_extended_capabilities_b57_2,
13223     &hf_ieee80211_tag_extended_capabilities_b58_2,
13224     &hf_ieee80211_tag_extended_capabilities_b59_2,
13225     &hf_ieee80211_tag_extended_capabilities_b60_2,
13226     &hf_ieee80211_tag_extended_capabilities_b61_2,
13227     &hf_ieee80211_tag_extended_capabilities_b62_2,
13228     &hf_ieee80211_tag_extended_capabilities_max_num_msdus,
13229     &hf_ieee80211_tag_extended_capabilities_b65_2,
13230     &hf_ieee80211_tag_extended_capabilities_b66_2,
13231     &hf_ieee80211_tag_extended_capabilities_b67_2,
13232     &hf_ieee80211_tag_extended_capabilities_b68_2,
13233     &hf_ieee80211_tag_extended_capabilities_b69_2,
13234     &hf_ieee80211_tag_extended_capabilities_b70_2,
13235     &hf_ieee80211_tag_extended_capabilities_b71_2,
13236     NULL
13237   };
13238
13239   static const int *ieee80211_tag_extended_capabilities_byte10[] = {
13240     &hf_ieee80211_tag_extended_capabilities_b72,
13241     &hf_ieee80211_tag_extended_capabilities_b73,
13242     &hf_ieee80211_tag_extended_capabilities_b74,
13243     &hf_ieee80211_tag_extended_capabilities_b75,
13244     &hf_ieee80211_tag_extended_capabilities_b76,
13245     &hf_ieee80211_tag_extended_capabilities_b77,
13246     &hf_ieee80211_tag_extended_capabilities_b78,
13247     &hf_ieee80211_tag_extended_capabilities_b79,
13248     NULL
13249   };
13250
13251   if (tag_len < 1)
13252   {
13253     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);
13254     return 1;
13255   }
13256   proto_item_append_text(field_data->item_tag, " (%u octet%s)", tag_len, plurality(tag_len, "", "s"));
13257
13258   /* Extended Capability octet 1 */
13259   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13260                                     ett_tag_ex_cap1, ieee80211_tag_extended_capabilities_byte1,
13261                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13262   proto_item_append_text(ti_ex_cap, " (octet 1)");
13263   offset += 1;
13264
13265   /* Extended Capability octet 2 */
13266   if (offset >= tag_len) {
13267     return offset;
13268   }
13269   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13270                                     ett_tag_ex_cap2, ieee80211_tag_extended_capabilities_byte2,
13271                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13272   proto_item_append_text(ti_ex_cap, " (octet 2)");
13273   offset += 1;
13274
13275   /* Extended Capability octet 3 */
13276   if (offset >= tag_len) {
13277     return offset;
13278   }
13279   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13280                                     ett_tag_ex_cap3, ieee80211_tag_extended_capabilities_byte3,
13281                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13282   proto_item_append_text(ti_ex_cap, " (octet 3)");
13283   offset += 1;
13284
13285   /* Extended Capability octet 4 */
13286   if (offset >= tag_len) {
13287     return offset;
13288   }
13289   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13290                                     ett_tag_ex_cap4, ieee80211_tag_extended_capabilities_byte4,
13291                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13292   proto_item_append_text(ti_ex_cap, " (octet 4)");
13293   offset += 1;
13294
13295   /* Extended Capability octet 5 */
13296   if (offset >= tag_len) {
13297     return offset;
13298   }
13299   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13300                                     ett_tag_ex_cap5, ieee80211_tag_extended_capabilities_byte5,
13301                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13302   proto_item_append_text(ti_ex_cap, " (octet 5)");
13303   offset += 1;
13304
13305   /* Extended Capability octet 6 */
13306   if (offset >= tag_len) {
13307     return offset;
13308   }
13309
13310   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13311                                     ett_tag_ex_cap6, ieee80211_tag_extended_capabilities_byte6,
13312                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13313   proto_item_append_text(ti_ex_cap, " (octet 6)");
13314   offset += 1;
13315
13316
13317   /* Extended Capability octet 7 */
13318   if (offset >= tag_len) {
13319     return offset;
13320   }
13321   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13322                                     ett_tag_ex_cap7, ieee80211_tag_extended_capabilities_byte7,
13323                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13324   proto_item_append_text(ti_ex_cap, " (octet 7)");
13325   offset += 1;
13326
13327   /* Extended Capability octet 8 & 9 since two bits cross the boundary */
13328   if (offset >= tag_len) {
13329     return offset;
13330   }
13331
13332   /* If only the first of the two bytes is present, do the best we can */
13333   if (offset == tag_len - 1) {
13334     ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13335                                     ett_tag_ex_cap8, ieee80211_tag_extended_capabilities_byte8,
13336                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13337     proto_item_append_text(ti_ex_cap, " (octet 8)");
13338     offset += 1;
13339   } else { /* Both bytes are there */
13340     ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities_2,
13341                                     ett_tag_ex_cap89, ieee80211_tag_extended_capabilities_bytes89,
13342                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13343     proto_item_append_text(ti_ex_cap, " (octets 8 & 9)");
13344     offset += 2;
13345   }
13346
13347   if (offset >= tag_len) {
13348     return offset;
13349   }
13350
13351   /* Extended Capability octet 10 */
13352   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13353                                     ett_tag_ex_cap10, ieee80211_tag_extended_capabilities_byte10,
13354                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13355   proto_item_append_text(ti_ex_cap, " (octet 10)");
13356   offset += 1;
13357
13358   return offset;
13359 }
13360 static int
13361 dissect_vht_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset)
13362 {
13363   proto_item *ti;
13364   proto_tree *mcs_tree;
13365   static const int *ieee80211_vht_mcsset_rx_max_mcs[] = {
13366     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
13367     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
13368     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
13369     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
13370     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
13371     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
13372     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
13373     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
13374     NULL
13375   };
13376   static const int *ieee80211_vht_mcsset_tx_max_mcs[] = {
13377     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
13378     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
13379     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
13380     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
13381     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
13382     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
13383     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
13384     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
13385     NULL
13386   };
13387
13388   /* 8 byte Supported MCS set */
13389   ti = proto_tree_add_item(tree, hf_ieee80211_vht_mcsset, tvb, offset, 8, ENC_NA);
13390
13391   mcs_tree = proto_item_add_subtree(ti, ett_vht_mcsset_tree);
13392
13393   /* B0 - B15 */
13394   proto_tree_add_bitmask_with_flags(mcs_tree, tvb, offset, hf_ieee80211_vht_mcsset_rx_mcs_map,
13395                                     ett_vht_rx_mcsbit_tree, ieee80211_vht_mcsset_rx_max_mcs,
13396                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13397   offset += 2;
13398
13399   /* B16 - B28 13 bits*/
13400   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13401
13402   /* B29 - B31 Max NSTS Total*/
13403   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_max_nsts_total, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13404
13405   offset += 2;
13406
13407   /* B32 - B47 */
13408   proto_tree_add_bitmask_with_flags(mcs_tree, tvb, offset, hf_ieee80211_vht_mcsset_tx_mcs_map,
13409                                     ett_vht_tx_mcsbit_tree, ieee80211_vht_mcsset_tx_max_mcs,
13410                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13411   offset += 2;
13412   /* B48 - B60 13 bits */
13413   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13414
13415   /* B61 */
13416   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_ext_nss_bw_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13417
13418   /* B62 - B63 2 reserved bits*/
13419   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13420
13421   offset += 2;
13422   return offset;
13423 }
13424
13425 static int
13426 dissect_vht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13427 {
13428   int tag_len = tvb_reported_length(tvb);
13429   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13430   int offset = 0;
13431   static const int *ieee80211_vht_caps[] = {
13432     &hf_ieee80211_vht_max_mpdu_length,
13433     &hf_ieee80211_vht_supported_chan_width_set,
13434     &hf_ieee80211_vht_rx_ldpc,
13435     &hf_ieee80211_vht_short_gi_for_80,
13436     &hf_ieee80211_vht_short_gi_for_160,
13437     &hf_ieee80211_vht_tx_stbc,
13438     /* End of first byte */
13439     &hf_ieee80211_vht_rx_stbc,
13440     &hf_ieee80211_vht_su_beamformer_cap,
13441     &hf_ieee80211_vht_su_beamformee_cap,
13442     &hf_ieee80211_vht_beamformer_antennas,
13443     /* End of second byte */
13444     &hf_ieee80211_vht_sounding_dimensions,
13445     &hf_ieee80211_vht_mu_beamformer_cap,
13446     &hf_ieee80211_vht_mu_beamformee_cap,
13447     &hf_ieee80211_vht_txop_ps,
13448     &hf_ieee80211_vht_var_htc_field,
13449     &hf_ieee80211_vht_max_ampdu,
13450     &hf_ieee80211_vht_link_adaptation_cap,
13451     &hf_ieee80211_vht_rx_pattern,
13452     &hf_ieee80211_vht_tx_pattern,
13453     &hf_ieee80211_vht_ext_nss_bw_support,
13454     NULL
13455   };
13456
13457   if (tag_len != 12) {
13458     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13459                            "VHT Capabilities IE length %u wrong, must be = 12", tag_len);
13460     return 1;
13461   }
13462
13463   /* 4 byte VHT Capabilities  Info*/
13464   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_vht_cap,
13465                                     ett_vht_cap_tree, ieee80211_vht_caps,
13466                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13467   offset += 4;
13468
13469   /* 8 byte MCS set */
13470   offset = dissect_vht_mcs_set(tree, tvb, offset);
13471
13472   return offset;
13473 }
13474
13475 static int
13476 dissect_vht_operation_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13477 {
13478   int tag_len = tvb_reported_length(tvb);
13479   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13480   int offset = 0;
13481   proto_item *op_item;
13482   proto_tree *op_tree;
13483   static const int *ieee80211_vht_op_max_basic_mcs[] = {
13484     &hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
13485     &hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
13486     &hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
13487     &hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
13488     &hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
13489     &hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
13490     &hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
13491     &hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
13492     NULL
13493   };
13494
13495   if (tag_len != 5) {
13496     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13497                            "VHT Operation IE length %u wrong, must be = 5", tag_len);
13498     return 1;
13499   }
13500
13501   /* 3 byte VHT Operation Info*/
13502   op_item = proto_tree_add_item(tree, hf_ieee80211_vht_op, tvb, offset, 3, ENC_NA);
13503   op_tree = proto_item_add_subtree(op_item, ett_vht_op_tree);
13504   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13505   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center0, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
13506   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center1, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
13507
13508   offset += 3;
13509   /* VHT Basic MCS Set */
13510   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_vht_op_basic_mcs_map,
13511                                     ett_vht_basic_mcsbit_tree, ieee80211_vht_op_max_basic_mcs,
13512                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13513   offset += 2;
13514
13515   return offset;
13516 }
13517
13518 static int
13519 dissect_vht_tx_pwr_envelope(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13520 {
13521   int tag_len = tvb_reported_length(tvb);
13522   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13523   int offset = 0;
13524   proto_item *tx_pwr_item, *ti;
13525   proto_tree *tx_pwr_info_tree;
13526   guint8 opt_ie_cnt=0;
13527   guint8 i;
13528
13529   if (tag_len < 2 || tag_len > 5) {
13530     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13531                            "VHT TX PWR Envelope IE length %u wrong, must be >= 2 and <= 5", tag_len);
13532     return 1;
13533   }
13534
13535   tx_pwr_item = proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_info, tvb, offset, 1, ENC_NA);
13536   tx_pwr_info_tree =  proto_item_add_subtree(tx_pwr_item, ett_vht_tpe_info_tree);
13537
13538   ti = proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13539   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_unit, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13540   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13541
13542   opt_ie_cnt = tvb_get_guint8(tvb, offset) & 0x07;
13543
13544   offset += 1;
13545
13546   /* Power Constraint info is mandatory only for 20MHz, others are optional*/
13547   /* Power is expressed in terms of 0.5dBm from -64 to 63 and is encoded
13548    * as 8-bit 2's compliment */
13549   for (i = 0; i <= opt_ie_cnt; i++) {
13550     switch(i) {
13551     case 0:
13552       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_20, tvb, offset, 1, ENC_NA);
13553       offset += 1;
13554       break;
13555     case 1:
13556       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_40, tvb, offset, 1, ENC_NA);
13557       offset += 1;
13558       break;
13559     case 2:
13560       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_80, tvb, offset, 1, ENC_NA);
13561       offset += 1;
13562       break;
13563     case 3:
13564       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_160, tvb, offset, 1, ENC_NA);
13565       offset += 1;
13566       break;
13567     default:
13568       expert_add_info(pinfo, ti, &ei_ieee80211_vht_tpe_pwr_info_count);
13569       offset += 1;
13570       break;
13571     }
13572   }
13573
13574   return offset;
13575 }
13576
13577 static int
13578 dissect_mobility_domain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13579 {
13580   int tag_len = tvb_reported_length(tvb);
13581   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13582   int offset = 0;
13583
13584   if (field_data->sanity_check != NULL) {
13585     field_data->sanity_check->association_has_mobility_domain_element = TRUE;
13586   }
13587
13588   if (tag_len < 3) {
13589     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13590                           "MDIE content length must be at least 3 bytes");
13591     return 1;
13592   }
13593
13594   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_mdid,
13595                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13596   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab,
13597                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
13598   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
13599                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
13600   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
13601                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
13602   return tvb_captured_length(tvb);
13603 }
13604
13605 static int
13606 dissect_fast_bss_transition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13607 {
13608   int tag_len = tvb_reported_length(tvb);
13609   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13610   int offset = 0;
13611   if (tag_len < 82) {
13612     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13613                           "FTIE content length must be at least 82 bytes");
13614     return 1;
13615   }
13616
13617   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic_control,
13618                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13619   proto_tree_add_item(tree, hf_ieee80211_tag_ft_element_count,
13620                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13621   offset += 2;
13622   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic,
13623                       tvb, offset, 16, ENC_NA);
13624   offset += 16;
13625   proto_tree_add_item(tree, hf_ieee80211_tag_ft_anonce,
13626                       tvb, offset, 32, ENC_NA);
13627   offset += 32;
13628   proto_tree_add_item(tree, hf_ieee80211_tag_ft_snonce,
13629                       tvb, offset, 32, ENC_NA);
13630   offset += 32;
13631
13632   while (offset + 2 <= tag_len) {
13633     guint8 id, len;
13634     int s_end;
13635     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_id,
13636                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13637     id = tvb_get_guint8(tvb, offset);
13638     offset += 1;
13639
13640     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_len,
13641                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13642     len = tvb_get_guint8(tvb, offset);
13643     offset += 1;
13644
13645     if (offset + len > tag_len) {
13646       proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset,
13647                             tag_len - offset, "Invalid FTIE subelement");
13648       return offset;
13649     }
13650
13651     s_end = offset + len;
13652     switch (id) {
13653     case 1:
13654       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r1kh_id,
13655                           tvb, offset, len, ENC_NA);
13656       break;
13657     case 2:
13658       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_info,
13659                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
13660       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_id,
13661                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
13662       offset += 2;
13663       if (offset > s_end)
13664         break;
13665       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_length,
13666                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13667       offset += 1;
13668       if (offset > s_end)
13669         break;
13670       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_rsc,
13671                           tvb, offset, 8, ENC_NA);
13672       offset += 8;
13673       if (offset > s_end)
13674         break;
13675       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key,
13676                           tvb, offset, s_end - offset, ENC_NA);
13677       break;
13678     case 3:
13679       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r0kh_id,
13680                           tvb, offset, len, ENC_NA);
13681       break;
13682     case 4:
13683       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_id,
13684                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
13685       offset += 2;
13686       if (offset > s_end)
13687         break;
13688       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_ipn,
13689                           tvb, offset, 6, ENC_NA);
13690       offset += 6;
13691       if (offset > s_end)
13692         break;
13693       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_length,
13694                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13695       offset += 1;
13696       if (offset > s_end)
13697         break;
13698       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key,
13699                           tvb, offset, 24, ENC_NA);
13700       break;
13701     default:
13702       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_data,
13703                           tvb, offset, len, ENC_NA);
13704       break;
13705     }
13706     offset = s_end;
13707   }
13708
13709   return tvb_captured_length(tvb);
13710 }
13711
13712 static int
13713 dissect_mmie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13714 {
13715   int tag_len = tvb_reported_length(tvb);
13716   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13717   int offset = 0;
13718
13719   if (tag_len < 16) {
13720     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13721                           "MMIE content length must be at least 16 bytes");
13722     return 1;
13723   }
13724
13725   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13726   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
13727                       ENC_NA);
13728   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
13729                       ENC_NA);
13730   return tvb_captured_length(tvb);
13731 }
13732
13733 static int
13734 dissect_ssid_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13735 {
13736   int tag_len = tvb_reported_length(tvb);
13737   int offset = 0;
13738   proto_tree *entry;
13739   gboolean first = TRUE;
13740
13741   while (offset + 1 <= tag_len) {
13742     guint8 len = tvb_get_guint8(tvb, offset + 1);
13743     guint8 *str;
13744
13745     if (offset + 2 + len > tag_len)
13746       break;
13747
13748     str = tvb_format_text(tvb, offset + 2, len);
13749     proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
13750     first = FALSE;
13751     entry = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len, ett_ssid_list, NULL, "SSID: %s", str);
13752     proto_tree_add_item(entry, hf_ieee80211_tag_number, tvb, offset, 1,
13753                         ENC_LITTLE_ENDIAN);
13754     offset++;
13755     proto_tree_add_uint(entry, hf_ieee80211_tag_length, tvb, offset, 1, len);
13756     offset++;
13757     proto_tree_add_item(entry, hf_ieee80211_tag_ssid, tvb, offset, len,
13758                         ENC_ASCII|ENC_NA);
13759     offset += len;
13760   }
13761
13762   return tvb_captured_length(tvb);
13763 }
13764
13765 static int
13766 dissect_link_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13767 {
13768   int tag_len = tvb_reported_length(tvb);
13769   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13770   int offset = 0;
13771
13772   if (tag_len < 18) {
13773     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13774                           "Link Identifier content length must be at least "
13775                           "18 bytes");
13776     return tvb_captured_length(tvb);
13777   }
13778
13779   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_bssid, tvb,
13780                       offset, 6, ENC_NA);
13781   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_init_sta, tvb,
13782                       offset + 6, 6, ENC_NA);
13783   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_resp_sta, tvb,
13784                       offset + 12, 6, ENC_NA);
13785   return tvb_captured_length(tvb);
13786 }
13787
13788 static int
13789 dissect_wakeup_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13790 {
13791   int tag_len = tvb_reported_length(tvb);
13792   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13793   int offset = 0;
13794
13795   if (tag_len < 18) {
13796     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13797                           "Wakeup Schedule content length must be at least "
13798                           "18 bytes");
13799     return tvb_captured_length(tvb);
13800   }
13801
13802   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_offset, tvb,
13803                       offset, 4, ENC_LITTLE_ENDIAN);
13804   offset += 4;
13805
13806   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_interval, tvb,
13807                       offset, 4, ENC_LITTLE_ENDIAN);
13808   offset += 4;
13809
13810   proto_tree_add_item(tree,
13811                       hf_ieee80211_tag_wakeup_schedule_awake_window_slots, tvb,
13812                       offset, 4, ENC_LITTLE_ENDIAN);
13813   offset += 4;
13814
13815   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
13816                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
13817   offset += 4;
13818
13819   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_idle_count, tvb,
13820                       offset, 2, ENC_LITTLE_ENDIAN);
13821   return tvb_captured_length(tvb);
13822 }
13823
13824 static int
13825 dissect_channel_switch_timing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13826 {
13827   int tag_len = tvb_reported_length(tvb);
13828   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13829   int offset = 0;
13830
13831   if (tag_len < 4) {
13832     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13833                           "Channel Switch Timing content length must be at "
13834                           "least 4 bytes");
13835     return tvb_captured_length(tvb);
13836   }
13837
13838   proto_tree_add_item(tree, hf_ieee80211_tag_channel_switch_timing_switch_time,
13839                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13840   offset += 2;
13841
13842   proto_tree_add_item(tree,
13843                       hf_ieee80211_tag_channel_switch_timing_switch_timeout,
13844                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13845   return tvb_captured_length(tvb);
13846 }
13847
13848 static int
13849 dissect_pti_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13850 {
13851   int tag_len = tvb_reported_length(tvb);
13852   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13853   int offset = 0;
13854
13855   if (tag_len < 3) {
13856     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "PTI Control content length must be at least 3 bytes");
13857     return tvb_captured_length(tvb);
13858   }
13859
13860   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_tid, tvb,
13861                       offset, 1, ENC_LITTLE_ENDIAN);
13862   offset += 1;
13863
13864   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_sequence_control, tvb,
13865                       offset, 2, ENC_LITTLE_ENDIAN);
13866   return tvb_captured_length(tvb);
13867 }
13868
13869 static int
13870 dissect_pu_buffer_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13871 {
13872   int tag_len = tvb_reported_length(tvb);
13873   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13874   int offset = 0;
13875   static const int *ieee80211_pu_buffer_status[] = {
13876     &hf_ieee80211_tag_pu_buffer_status_ac_bk,
13877     &hf_ieee80211_tag_pu_buffer_status_ac_be,
13878     &hf_ieee80211_tag_pu_buffer_status_ac_vi,
13879     &hf_ieee80211_tag_pu_buffer_status_ac_vo,
13880     NULL
13881   };
13882
13883   if (tag_len < 1) {
13884     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");
13885     return tvb_captured_length(tvb);
13886   }
13887
13888   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_pu_buffer_status, ENC_LITTLE_ENDIAN);
13889   return tvb_captured_length(tvb);
13890 }
13891
13892 static int
13893 dissect_timeout_interval(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
13894 {
13895   int tag_len = tvb_reported_length(tvb);
13896   int offset = 0;
13897   proto_item *pi;
13898
13899   pi = proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_type, tvb,
13900                            offset, 1, ENC_LITTLE_ENDIAN);
13901   if (tag_len < 5) {
13902     expert_add_info_format(pinfo, pi, &ei_ieee80211_tag_length,
13903                            "Timeout Interval content length must be at least "
13904                           "5 bytes");
13905     return 1;
13906   }
13907
13908   proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_value, tvb,
13909                       offset + 1, 4, ENC_LITTLE_ENDIAN);
13910   return tvb_captured_length(tvb);
13911 }
13912
13913 static int
13914 dissect_ric_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13915 {
13916   int tag_len = tvb_reported_length(tvb);
13917   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13918   int offset = 0;
13919   proto_tree  *sub_tree;
13920   guint8       desc_cnt = 0;
13921   guint32      next_ie;
13922   int          offset_r = 0;
13923   const guint8 ids[] = { TAG_RIC_DESCRIPTOR };
13924
13925   if (tag_len != 4)  {
13926     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13927                            "RIC Data Length must be 4 bytes");
13928     return 0;
13929   }
13930
13931   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_id, tvb,
13932                            offset, 1, ENC_LITTLE_ENDIAN);
13933   offset += 1;
13934
13935   desc_cnt = tvb_get_guint8(tvb, offset);
13936   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_desc_cnt, tvb,
13937                            offset, 1, ENC_LITTLE_ENDIAN);
13938   offset += 1;
13939
13940   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_status_code, tvb,
13941                            offset, 2, ENC_LITTLE_ENDIAN);
13942   offset += 2;
13943
13944   /* Our Design is such that all the Resource request IE's part of the RIC
13945    * must be in the sub tree of RIC for better readability
13946    * Even omnipeek does the same way.
13947    */
13948   sub_tree = proto_item_add_subtree(tree, ett_tag_ric_data_desc_ie);
13949
13950   proto_item_append_text(field_data->item_tag, " :Resource Descriptor List");
13951   if (desc_cnt == 0) {
13952     proto_item_append_text(field_data->item_tag, " :0 (Weird?)");
13953   }
13954
13955   while ( desc_cnt != 0 ) {
13956
13957     next_ie = tvb_get_guint8(tvb, offset);
13958     proto_item_append_text(field_data->item_tag, " :(%d:%s)", desc_cnt, val_to_str_ext(next_ie, &tag_num_vals_ext, "Reserved (%d)"));
13959     /* Recursive call to avoid duplication of code*/
13960     offset_r = add_tagged_field(pinfo, sub_tree, tvb, offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
13961     if (offset_r == 0 )/* should never happen, returns a min of 2*/
13962       break;
13963     /* This will ensure that the IE after RIC is processed
13964      * only once. This gives us a good looking RIC IE :-)
13965      */
13966     tag_len += offset_r;
13967     desc_cnt--;
13968   }
13969
13970   return tvb_captured_length(tvb);
13971 }
13972
13973 /* Overlapping BSS Scan Parameters (74) */
13974 static int
13975 dissect_overlap_bss_scan_par(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13976 {
13977   int offset = 0;
13978   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13979   int tag_len = tvb_reported_length(tvb);
13980
13981   if (tag_len != 14)  {
13982     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13983                            "OBSS Length must be 14 bytes");
13984     return 1;
13985   }
13986
13987   proto_tree_add_item(tree, hf_ieee80211_tag_obss_spd, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13988   offset += 2;
13989
13990   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sad, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13991   offset += 2;
13992
13993   proto_tree_add_item(tree, hf_ieee80211_tag_obss_cwtsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13994   offset += 2;
13995
13996   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sptpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13997   offset += 2;
13998
13999   proto_tree_add_item(tree, hf_ieee80211_tag_obss_satpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14000   offset += 2;
14001
14002   proto_tree_add_item(tree, hf_ieee80211_tag_obss_wctdf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14003   offset += 2;
14004
14005   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sat, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14006   offset += 2;
14007
14008   return offset;
14009 }
14010
14011 /* RIC Descriptor (75) */
14012 static int
14013 dissect_ric_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14014 {
14015   int offset = 0;
14016   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14017   int tag_len = tvb_reported_length(tvb);
14018   guint8       rsrc_type = 0;
14019
14020   if (tag_len < 1)  {
14021     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14022                            "RIC Data Length must be at least 1 byte");
14023     return 1;
14024   }
14025
14026   rsrc_type = tvb_get_guint8(tvb, offset);
14027   proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_rsrc_type, tvb,
14028                            offset, 1, ENC_LITTLE_ENDIAN);
14029   offset += 1;
14030
14031   if (rsrc_type == 1) {
14032     /* Block ACK params
14033      * 802.11-2012: 8.4.2.53 RIC Descriptor element
14034      * Block Ack parameter set as defined in 8.4.1.14,
14035      * Block Ack timeout value as defined in 8.4.1.15, and
14036      * Block Ack starting sequence control as defined in 8.3.1.8
14037      */
14038     /* TODO: Still figuring out how to parse these ones,
14039      * need a sample capture with at least HEX Dump
14040      */
14041     proto_item_append_text(field_data->item_tag, " : Block ACK Params");
14042     proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_var_params, tvb,
14043                         offset, tag_len-1, ENC_NA);
14044     offset += tag_len -1;
14045   }else {
14046     /* 0, 2-255 are reserved*/
14047     proto_item_append_text(field_data->item_tag, " :Reserved (type != 1)");
14048   }
14049
14050   return offset;
14051 }
14052
14053 static int
14054 dissect_ext_bss_load(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14055 {
14056   int offset = 0;
14057   proto_tree_add_item(tree, hf_ieee80211_ext_bss_mu_mimo_capable_sta_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14058   offset += 2;
14059   proto_tree_add_item(tree, hf_ieee80211_ext_bss_ss_underutilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14060   offset += 1;
14061   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_20mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14062   offset += 1;
14063   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_40mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14064   offset += 1;
14065   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_80mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14066   offset += 1;
14067
14068   return offset;
14069 }
14070
14071 static int
14072 dissect_wide_bw_channel_switch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14073 {
14074   int offset = 0;
14075
14076   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14077   offset += 1;
14078   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14079   offset += 1;
14080   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14081   offset += 1;
14082
14083   return offset;
14084 }
14085
14086 static int
14087 dissect_channel_switch_wrapper(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14088 {
14089   int tag_len = tvb_reported_length(tvb);
14090   int offset = 0;
14091   int tmp_sublen;
14092   const guint8 ids[] = { TAG_COUNTRY_INFO, TAG_WIDE_BW_CHANNEL_SWITCH,
14093     TAG_VHT_TX_PWR_ENVELOPE };
14094
14095   /*
14096   Decode three subelement in IE-196(Channel Switch Wrapper element):
14097         (1) New Country subelement
14098         (2) Wide Bandwidth Channel Switch subelement
14099         (3) New VHT Transmit Power Envelope subelement
14100   */
14101   while (tag_len > 0){
14102     tmp_sublen = tvb_get_guint8(tvb, offset + 1);
14103     if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
14104       break;
14105     }
14106     tag_len -= (tmp_sublen + 2);
14107     offset += (tmp_sublen + 2);
14108   }
14109   return offset;
14110 }
14111
14112 static int
14113 dissect_operating_mode_notification(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14114 {
14115   int offset = 0;
14116   static const int *ieee80211_operat_mode_field[] = {
14117     &hf_ieee80211_operat_mode_field_channel_width,
14118     &hf_ieee80211_operat_mode_field_reserved,
14119     &hf_ieee80211_operat_mode_field_rxnss,
14120     &hf_ieee80211_operat_mode_field_rxnsstype,
14121     NULL
14122   };
14123
14124   /* Operating Mode field */
14125   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_operat_notification_mode,
14126                                     ett_mcsbit_tree, ieee80211_operat_mode_field,
14127                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14128   offset += 1;
14129   return offset;
14130 }
14131
14132 static int
14133 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vendorspecific)
14134 {
14135   proto_item *ti;
14136   proto_tree *mcs_tree, *bit_tree;
14137   guint8 rx_nss, tx_nss; /* 0-4 for HT and 0-8 for VHT*/
14138   guint32 value_mcs_0_31, value_mcs_32_52, value_mcs_53_76;
14139   guint16 tx_mcs_set;
14140   rx_nss = tx_nss = 8;
14141   /* 16 byte Supported MCS set */
14142   if (vendorspecific)
14143   {
14144     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset_vs, tvb, offset, 16,
14145       basic ? "Basic MCS Set" : "MCS Set");
14146   } else
14147   {
14148     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset, tvb, offset, 16,
14149       basic ? "Basic MCS Set" : "MCS Set");
14150   }
14151   mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
14152
14153   /* Rx MCS Bitmask */
14154   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_rx_bitmask, tvb, offset, 10, ENC_NA);
14155   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
14156
14157   /* Bits 0 - 31 */
14158   value_mcs_0_31 = tvb_get_letohl(tvb, offset);
14159
14160   /* Handle all zeroes/ff's case..*/
14161   if (value_mcs_0_31 != 0x0)
14162   {
14163     if (!(value_mcs_0_31 & (0xffffff00))) {
14164       /*
14165        * At least one MCS from 0-7 is supported, but no MCS from 8-31 are
14166        * supported, so only 1 spatial stream is supported.
14167        */
14168       rx_nss = 0;
14169     } else if (!(value_mcs_0_31 & (0xffff0000))) {
14170       /*
14171        * At least one MCS from 8-15 is supported, but no MCS from 16-31 are
14172        * supported, so only 2 spatial streams are supported.
14173        */
14174       rx_nss = 1;
14175     } else if (!(value_mcs_0_31 & (0xff000000))) {
14176       /*
14177        * At least one MCS from 16-23 is supported, but no MCS from 24-31 are
14178        * supported, so only 3 spatial streams are supported.
14179        */
14180       rx_nss = 2;
14181     } else {
14182       /*
14183        * At least one MCS from 24-31 is supported, so 4 spatial streams
14184        * are supported.
14185        */
14186       rx_nss = 3;
14187     }
14188   }
14189
14190   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_0to7, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14191   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_8to15, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14192   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_16to23, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14193   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_24to31, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14194   offset += 4;
14195
14196   /* Should be we check UEQM Supported?*/
14197   /* Bits 32 - 52 */
14198   value_mcs_32_52 = tvb_get_letohl(tvb, offset);
14199   if (!(value_mcs_32_52 & (0x1ffffe))) {
14200     /*
14201      * MCS 33-52 aren't supported, so the number of spatial streams we get
14202      * from whichever MCSes from 0-31 that we support is the total number
14203      * of spatial streams we support.
14204      */
14205     ;
14206   } else if (!(value_mcs_32_52 & (0x1fff80))) {
14207     /*
14208      * At least one MCS from 33-38 is supported, but no MCS from 39-52 is
14209      * supported, so we have at least 2 spatial streams, but none of the
14210      * MCSs in that range give us any more.
14211      */
14212     rx_nss = MAX(1, rx_nss);
14213   } else {
14214     /*
14215      * At least one MCS from 39-52 is supported, so we have at least 3
14216      * spatial streams.
14217      */
14218     rx_nss = MAX(2, rx_nss);
14219   }
14220
14221   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_32, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14222   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_33to38, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14223   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_39to52, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14224   offset += 2;
14225
14226   /* Bits 53 - 76 */
14227   value_mcs_53_76 = tvb_get_letohl(tvb, offset);
14228   if ((value_mcs_53_76 & (0x1fffffe0))) {
14229     /*
14230      * At least one MCS from 53-76 is supported, so we have at least 4
14231      * spatial streams.
14232      */
14233     rx_nss = MAX(3, rx_nss);
14234   }
14235
14236   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_53to76, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14237   offset += 4;
14238
14239   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_highest_data_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14240   offset += 2;
14241
14242   /* Follow table 8-126 from 802.11-2012 */
14243   tx_mcs_set = tvb_get_letohs(tvb, offset);
14244
14245   if (!(tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
14246   {
14247     /* TX MCS Set is not defined
14248      * so there is no interpretation for Max Tx Spatial Streams
14249      */
14250      tx_nss = 4; /* Not Defined*/
14251   }
14252
14253   if ((tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
14254   {
14255     /* TX MCS Set is defined to be equal to Rx MCS Set
14256      * So, get the Max Spatial Streams from Rx
14257      * MCS set
14258      */
14259      tx_nss = rx_nss;
14260   }
14261   proto_item_append_text(ti, ": %s", val_to_str(rx_nss, mcsset_tx_max_spatial_streams_flags, "Reserved:%d" ) );
14262
14263   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_mcs_set_defined, tvb, offset, 1,
14264       ENC_LITTLE_ENDIAN);
14265   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal, tvb, offset, 1,
14266       ENC_LITTLE_ENDIAN);
14267   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_max_spatial_streams, tvb, offset, 1,
14268       ENC_LITTLE_ENDIAN);
14269   proto_item_append_text(ti, ", %s", val_to_str(tx_nss, mcsset_tx_max_spatial_streams_flags, "Reserved:%d" ) );
14270   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_unequal_modulation, tvb, offset, 1,
14271       ENC_LITTLE_ENDIAN);
14272   offset += 1;
14273
14274   offset += 3;
14275   return offset;
14276 }
14277
14278 /*  802.11n D1.10 - HT Information IE  */
14279 static int
14280 dissect_ht_info_ie_1_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14281 {
14282   int tag_len = tvb_reported_length(tvb);
14283   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14284   int offset = 0;
14285   static const int *ieee80211_ht_info1_field[] = {
14286     &hf_ieee80211_ht_info_secondary_channel_offset,
14287     &hf_ieee80211_ht_info_sta_channel_width,
14288     &hf_ieee80211_ht_info_rifs_mode,
14289     &hf_ieee80211_ht_info_reserved_b4_b7,
14290     NULL
14291   };
14292
14293   static const int *ieee80211_ht_info2_field[] = {
14294     &hf_ieee80211_ht_info_protection,
14295     &hf_ieee80211_ht_info_non_greenfield_sta_present,
14296     &hf_ieee80211_ht_info_reserved_b11,
14297     &hf_ieee80211_ht_info_obss_non_ht_stas_present,
14298     &hf_ieee80211_ht_info_channel_center_freq_seg_2,
14299     &hf_ieee80211_ht_info_reserved_b21_b23,
14300     NULL
14301   };
14302
14303   static const int *ieee80211_ht_info3_field[] = {
14304     &hf_ieee80211_ht_info_reserved_b24_b29,
14305     &hf_ieee80211_ht_info_dual_beacon,
14306     &hf_ieee80211_ht_info_dual_cts_protection,
14307     &hf_ieee80211_ht_info_secondary_beacon,
14308     &hf_ieee80211_ht_info_lsig_txop_protection_full_support,
14309     &hf_ieee80211_ht_info_pco_active,
14310     &hf_ieee80211_ht_info_pco_phase,
14311     &hf_ieee80211_ht_info_reserved_b36_b39,
14312     NULL
14313   };
14314
14315   if (tag_len < 22) {
14316     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14317                            "HT Information IE content length %u wrong, must be at least 22 bytes", tag_len);
14318     return 1;
14319   }
14320
14321   proto_tree_add_item(tree, hf_ieee80211_ht_info_primary_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14322   offset += 1;
14323
14324   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter1,
14325                                     ett_ht_info_delimiter1_tree, ieee80211_ht_info1_field,
14326                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14327   offset += 1;
14328
14329
14330   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter2,
14331                                     ett_ht_info_delimiter2_tree, ieee80211_ht_info2_field,
14332                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14333   offset += 2;
14334
14335   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter3,
14336                                     ett_ht_info_delimiter3_tree, ieee80211_ht_info3_field,
14337                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14338   offset += 2;
14339
14340   offset = dissect_mcs_set(tree, tvb, offset, TRUE, FALSE);
14341
14342   return offset;
14343 }
14344
14345
14346 static int
14347 dissect_wapi_param_set(tvbuff_t *tvb, packet_info *pinfo,
14348                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
14349                           proto_item *ti, int ftype)
14350 {
14351   /* Parse the WAPI Parameter Set IE Here*/
14352   proto_item *item;
14353   proto_tree *subtree;
14354   guint16 loop_cnt, version, akm_cnt  = 1, ucast_cnt = 1, bkid_cnt = 1;
14355   guint8  akm_suite_type = 0, ucast_cipher_type = 0, mcast_cipher_type = 0;
14356   static const int *ieee80211_tag_wapi_param_set[] = {
14357     &hf_ieee80211_tag_wapi_param_set_capab_preauth,
14358     &hf_ieee80211_tag_wapi_param_set_capab_rsvd,
14359     NULL
14360   };
14361
14362   version = tvb_get_letohs(tvb, offset);
14363   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14364   offset += 2;
14365
14366   /*MIN: 2 + (2+4)+ (2+4) + 4 + 2 + 0 (BKID CNT and LIST)  =20*/
14367   if (tag_len < 20) {
14368       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
14369                 "tag_len is  %d, it's neither WAPI not BSS-AC-Access-Delay", tag_len);
14370     return offset;
14371   }
14372
14373   if (version != 1) {
14374     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
14375                            "Version of WAPI protocol is %d, must be = 1", version);
14376     return offset;
14377   }
14378
14379   /* AKM Suites: list can't be 0*/
14380   akm_cnt = tvb_get_letohs(tvb, offset);
14381   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_akm_suite_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14382   offset += 2;
14383   if (akm_cnt != 0) {
14384     proto_item_append_text(ti, " : AKM Suite List:");
14385     for (loop_cnt = 0; loop_cnt < akm_cnt; loop_cnt++) {
14386       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_akm_tree);
14387       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_oui, tvb, offset, 3, ENC_NA);
14388       offset += 3;
14389       akm_suite_type = tvb_get_guint8(tvb, offset);
14390       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14391       offset += 1;
14392       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(akm_suite_type,
14393       ieee80211_wapi_suite_type_short, "Reserved: %d"));
14394     }
14395     proto_item_append_text(ti, " /");
14396   } else {
14397     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of AKM suites is 0, must be min 1");
14398     return offset;
14399
14400   }
14401   /* Unicast Cipher Suites: list can't be 0*/
14402   ucast_cnt = tvb_get_letohs(tvb, offset);
14403   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
14404                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
14405   offset += 2;
14406   if (ucast_cnt != 0) {
14407     proto_item_append_text(ti, " Unicast Cipher List:");
14408     for (loop_cnt = 0; loop_cnt < ucast_cnt; loop_cnt++) {
14409       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_ucast_tree);
14410       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
14411       offset += 3;
14412       ucast_cipher_type = tvb_get_guint8(tvb, offset);
14413       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14414       offset += 1;
14415       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(ucast_cipher_type, ieee80211_wapi_cipher_type, "Reserved: %d"));
14416     }
14417   proto_item_append_text(ti, " /");
14418   } else {
14419     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of Unicast Cipher suites is 0, must be min 1");
14420     return offset;
14421
14422   }
14423
14424   /* Multicast Cipher Suites*/
14425   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
14426   offset += 3;
14427   mcast_cipher_type = tvb_get_guint8(tvb, offset);
14428   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14429   offset += 1;
14430   proto_item_append_text(ti, " Multicast Cipher: %s", val_to_str(mcast_cipher_type, ieee80211_wapi_cipher_type, "Reserved: %d"));
14431
14432   /* WAPI capability */
14433   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_wapi_param_set_capab,
14434                                     ett_tag_wapi_param_set_preauth_tree, ieee80211_tag_wapi_param_set,
14435                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14436   offset += 2;
14437
14438   /* BKID List: The list can be 0
14439    * Applicable only for assoc/re-assoc
14440    */
14441   if (ftype == MGT_ASSOC_REQ || ftype == MGT_REASSOC_REQ ) {
14442     bkid_cnt = tvb_get_letohs(tvb, offset);
14443     proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14444     offset += 2;
14445     if (bkid_cnt != 0) {
14446       for (loop_cnt = 0; loop_cnt < bkid_cnt; loop_cnt++) {
14447         proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_list, tvb, offset, 16, ENC_NA);
14448         offset += 16;
14449       }
14450     }
14451   }
14452   return offset;
14453 }
14454
14455 static int
14456 dissect_bss_max_idle_period(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14457 {
14458   int offset = 0;
14459   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_period,
14460                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
14461   offset += 2;
14462   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_options_protected,
14463                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14464   offset++;
14465   return offset;
14466 }
14467
14468 enum tfs_request_subelem_id {
14469   TFS_REQ_SUBELEM_TFS = 1,
14470   TFS_REQ_SUBELEM_VENDOR_SPECIFIC = 221
14471 };
14472
14473 static const value_string tfs_request_subelem_ids[] = {
14474   { TFS_REQ_SUBELEM_TFS, "TFS subelement" },
14475   { TFS_REQ_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
14476   { 0, NULL }
14477 };
14478
14479 static int
14480 dissect_tfs_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14481 {
14482   int tag_len = tvb_reported_length(tvb);
14483   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14484   int offset = 0;
14485   const guint8 ids[] = {
14486     1, /* TFS Subelement */
14487     TAG_VENDOR_SPECIFIC_IE
14488   };
14489
14490   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_id,
14491                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14492   offset++;
14493   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_delete_after_match,
14494                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14495   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_notify,
14496                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14497   offset++;
14498   if (offset + 1 >= tag_len) {
14499     expert_add_info_format(pinfo, tree, &ei_ieee80211_missing_data,
14500                            "No TFS Request subelements in TFS Request");
14501     return tvb_captured_length(tvb);
14502   }
14503
14504   while (offset + 1 < tag_len) {
14505     guint8 id, len;
14506     int s_offset, s_end;
14507
14508     id = tvb_get_guint8(tvb, offset);
14509     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_id,
14510                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14511     offset++;
14512     len = tvb_get_guint8(tvb, offset);
14513     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_len,
14514                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14515     offset++;
14516     if (offset + len > tag_len) {
14517       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
14518                              "Not enough data for TFS Request subelement");
14519       return tvb_captured_length(tvb);
14520     }
14521     switch (id) {
14522     case TFS_REQ_SUBELEM_TFS:
14523       s_offset = offset;
14524       s_end = offset + len;
14525       while (s_offset < s_end) {
14526         /* TODO 1 is interpreted as TAG_SUPP_RATES, fix this! */
14527         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
14528         if (tlen==0)
14529           break;
14530         s_offset += tlen;
14531       }
14532       break;
14533     default:
14534       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem,
14535                           tvb, offset, len, ENC_NA);
14536       break;
14537     }
14538     offset += len;
14539   }
14540
14541   if (offset < tag_len) {
14542     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
14543                            tvb, offset, tag_len - offset, "Extra data after TFS Subelements");
14544   }
14545
14546   return tvb_captured_length(tvb);
14547 }
14548
14549 enum tfs_response_subelem_id {
14550   TFS_RESP_SUBELEM_TFS_STATUS = 1,
14551   TFS_RESP_SUBELEM_TFS = 2,
14552   TFS_RESP_SUBELEM_VENDOR_SPECIFIC = 221
14553 };
14554
14555 static const value_string tfs_response_subelem_ids[] = {
14556   { TFS_RESP_SUBELEM_TFS_STATUS, "TFS Status subelement" },
14557   { TFS_RESP_SUBELEM_TFS, "TFS subelement" },
14558   { TFS_RESP_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
14559   { 0, NULL }
14560 };
14561
14562 static int
14563 dissect_tfs_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14564 {
14565   int tag_len = tvb_reported_length(tvb);
14566   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14567   int offset = 0;
14568   const guint8 ids[] = {
14569     1, /* TFS Status subelement*/
14570     2, /* TFS subelement */
14571     TAG_VENDOR_SPECIFIC_IE
14572   };
14573
14574   while (offset + 3 <= tag_len) {
14575     guint8 id, len;
14576     int s_offset, s_end;
14577
14578     id = tvb_get_guint8(tvb, offset);
14579     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_id,
14580                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14581     offset++;
14582     len = tvb_get_guint8(tvb, offset);
14583     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_len,
14584                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14585     offset++;
14586     if (offset + len > tag_len) {
14587       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
14588                              "Not enough data for TFS Request subelement");
14589       return tvb_captured_length(tvb);
14590     }
14591     switch (id) {
14592     case TFS_RESP_SUBELEM_TFS_STATUS:
14593       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_status,
14594                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
14595       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_id,
14596                           tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
14597       break;
14598     case TFS_RESP_SUBELEM_TFS:
14599       s_offset = offset;
14600       s_end = offset + len;
14601       while (s_offset < s_end) {
14602         /* TODO Element IDs 1 and 2 are misinterpreted! */
14603         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
14604         if (tlen==0)
14605           break;
14606         s_offset += tlen;
14607       }
14608       break;
14609     default:
14610       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem,
14611                           tvb, offset, len, ENC_NA);
14612       break;
14613     }
14614
14615     offset += len;
14616   }
14617
14618   if (offset < tag_len) {
14619     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
14620                            tvb, offset, tag_len - offset, "Extra data after TFS Subelements");
14621   }
14622
14623   return tvb_captured_length(tvb);
14624 }
14625
14626 static const value_string wnm_sleep_mode_action_types[] = {
14627   { 0, "Enter WNM-Sleep Mode" },
14628   { 1, "Exit WNM-Sleep Mode" },
14629   { 0, NULL }
14630 };
14631
14632 static const value_string wnm_sleep_mode_response_status_vals[] = {
14633   { 0, "Enter/Exit WNM-Sleep Mode Accept" },
14634   { 1, "Exit WNM-Sleep Mode Accept, GTK/IGTK update required" },
14635   { 2, "Denied. The AP is unable to perform the requested action." },
14636   { 3, "Denied temporarily. The AP is unable to perform the requested action "
14637     "at the current time. The request can be submitted again at a later time."
14638   },
14639   { 4, "Denied. Due to the pending key expiration." },
14640   { 5, "Denied. The requested action was not granted due to other WNM services "
14641     "in use by the requesting STA." },
14642   { 0, NULL }
14643 };
14644
14645 static int
14646 dissect_wnm_sleep_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14647 {
14648   int offset = 0;
14649   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_action_type,
14650                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14651   offset++;
14652   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_response_status,
14653                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14654   offset++;
14655   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_interval,
14656                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
14657   offset += 2;
14658   return offset;
14659 }
14660
14661 static const value_string time_adv_timing_capab_vals[] = {
14662   { 0, "No standardized external time source" },
14663   { 1, "Timestamp offset based on UTC" },
14664   { 2, "UTC time at which the TSF timer is 0" },
14665   { 0, NULL }
14666 };
14667
14668 static int
14669 dissect_time_adv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14670 {
14671   int offset = 0;
14672   guint8 capab;
14673   proto_item *item;
14674   proto_tree *subtree;
14675   struct tm tm, *now;
14676   time_t t;
14677
14678   capab = tvb_get_guint8(tvb, offset);
14679   proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_timing_capab,
14680                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14681   offset += 1;
14682
14683   switch (capab) {
14684   case 1:
14685     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
14686                         tvb, offset, 10, ENC_NA);
14687     offset += 10;
14688
14689     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
14690                         tvb, offset, 5, ENC_NA);
14691     offset += 5;
14692     break;
14693   case 2:
14694     item = proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
14695                                tvb, offset, 10, ENC_NA);
14696     subtree = proto_item_add_subtree(item, ett_tag_time_adv_tree);
14697     memset(&tm, 0, sizeof(tm));
14698     tm.tm_year = tvb_get_letohs(tvb, offset) - 1900;
14699     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_year,
14700                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
14701     offset += 2;
14702     tm.tm_mon = tvb_get_guint8(tvb, offset) - 1;
14703     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_month,
14704                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14705     offset += 1;
14706     tm.tm_mday = tvb_get_guint8(tvb, offset);
14707     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_day,
14708                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14709     offset += 1;
14710     tm.tm_hour = tvb_get_guint8(tvb, offset);
14711     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_hours,
14712                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14713     offset += 1;
14714     tm.tm_min = tvb_get_guint8(tvb, offset);
14715     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_minutes,
14716                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14717     offset += 1;
14718     tm.tm_sec = tvb_get_guint8(tvb, offset);
14719     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_seconds,
14720                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14721     offset += 1;
14722     proto_tree_add_item(subtree,
14723                         hf_ieee80211_tag_time_adv_time_value_milliseconds,
14724                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
14725     offset += 2;
14726     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_reserved,
14727                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14728     offset += 1;
14729
14730     tm.tm_isdst = -1;
14731     t = mktime(&tm);
14732     if (t != -1) {
14733       t += (time_t)(last_timestamp / 1000000);
14734       now = localtime(&t);
14735       if (now)
14736         proto_item_append_text(item,
14737                                ": current time=%u-%02u-%02u %02u:%02u:%02u",
14738                                now->tm_year + 1900, now->tm_mon + 1,
14739                                now->tm_mday, now->tm_hour, now->tm_min,
14740                                now->tm_sec);
14741     }
14742
14743     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
14744                         tvb, offset, 5, ENC_NA);
14745     offset += 5;
14746
14747     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_update_counter,
14748                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14749     offset += 1;
14750     break;
14751   }
14752
14753   return offset;
14754 }
14755
14756 static int
14757 dissect_time_zone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14758 {
14759   int tag_len = tvb_reported_length(tvb);
14760   int offset = 0;
14761
14762   proto_tree_add_item(tree, hf_ieee80211_tag_time_zone, tvb, offset, tag_len,
14763                       ENC_ASCII|ENC_NA);
14764   return tvb_captured_length(tvb);
14765 }
14766
14767 static int
14768 dissect_ap_channel_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14769 {
14770   int tag_len = tvb_reported_length(tvb);
14771   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14772   int offset = 0;
14773
14774   if (tag_len < 1) {
14775     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14776                            "AP Channel Report length %u wrong, must be > 1", tag_len);
14777     return tvb_captured_length(tvb);
14778   }
14779
14780   proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_operating_class, tvb,
14781                       offset, 1, ENC_LITTLE_ENDIAN);
14782   proto_item_append_text(field_data->item_tag, ": Operating Class %u, Channel List :", tvb_get_guint8(tvb, offset));
14783   offset += 1;
14784
14785   while (offset < tag_len)
14786   {
14787     proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_channel_list, tvb, offset, 1, ENC_NA);
14788     proto_item_append_text(field_data->item_tag, " %u,", tvb_get_guint8(tvb, offset));
14789     offset += 1;
14790   }
14791   return tvb_captured_length(tvb);
14792 }
14793
14794 static int
14795 dissect_secondary_channel_offset_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14796 {
14797   int tag_len = tvb_reported_length(tvb);
14798   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14799   int offset = 0;
14800   if (tag_len != 1) {
14801     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14802                            "Secondary Channel Offset length %u wrong, must be = 1", tag_len);
14803     return 1;
14804   }
14805
14806   proto_tree_add_item(tree, hf_ieee80211_tag_secondary_channel_offset, tvb,
14807                       offset, 1, ENC_LITTLE_ENDIAN);
14808   return tvb_captured_length(tvb);
14809 }
14810
14811 /* BSS Average Access Delay element (63) */
14812 static int
14813 dissect_bss_avg_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14814 {
14815   int tag_len = tvb_reported_length(tvb);
14816   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14817   int offset = 0;
14818   if (tag_len != 1) {
14819     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14820                            "BSS Average Access Delay length %u wrong, must be = 1", tag_len);
14821     return 1;
14822   }
14823
14824   proto_tree_add_item(tree, hf_ieee80211_tag_bss_ap_avg_access_delay, tvb,
14825                       offset, 1, ENC_LITTLE_ENDIAN);
14826   return tvb_captured_length(tvb);
14827 }
14828
14829 static int
14830 dissect_antenna_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14831 {
14832   int tag_len = tvb_reported_length(tvb);
14833   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14834   int offset = 0;
14835
14836   if (tag_len != 1) {
14837     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14838                            "Antenna length %u wrong, must be = 1", tag_len);
14839     return 1;
14840   }
14841
14842   proto_tree_add_item(tree, hf_ieee80211_tag_antenna_id, tvb,
14843                       offset, 1, ENC_LITTLE_ENDIAN);
14844
14845   return tvb_captured_length(tvb);
14846 }
14847
14848 static int
14849 dissect_rsni_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14850 {
14851   int tag_len = tvb_reported_length(tvb);
14852   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14853   int offset = 0;
14854
14855   if (tag_len != 1) {
14856     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14857                            "RSNI length %u wrong, must be = 1", tag_len);
14858     return 1;
14859   }
14860
14861   proto_tree_add_item(tree, hf_ieee80211_tag_rsni, tvb,
14862                       offset, 1, ENC_LITTLE_ENDIAN);
14863
14864   return tvb_captured_length(tvb);
14865 }
14866
14867 static int
14868 dissect_measurement_pilot_trans_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14869 {
14870   int tag_len = tvb_reported_length(tvb);
14871   int offset = 0;
14872   const guint8 ids[] = { TAG_VENDOR_SPECIFIC_IE };
14873
14874   /* The tag len can be 1 or more if there are sub-elements */
14875
14876   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
14877                       1, ENC_NA);
14878
14879   tag_len--;
14880   offset++;
14881
14882   /* Also handle the optional sub-elements */
14883
14884   if (tag_len > 0) {
14885     while (tag_len > 0) {
14886       guint8 elt_len;
14887
14888       elt_len = tvb_get_guint8(tvb, offset + 1);
14889
14890       if(add_tagged_field(pinfo, tree, tvb, offset + 2, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
14891         /* TODO: Add an expert info here and skip the field. */
14892         break;
14893       }
14894
14895       tag_len -= elt_len + 2;
14896       offset += elt_len + 2;
14897     }
14898   }
14899
14900   return tvb_captured_length(tvb);
14901 }
14902
14903 static int
14904 dissect_bss_available_admission_capacity_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14905 {
14906   int tag_len = tvb_reported_length(tvb);
14907   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14908   int offset = 0;
14909   guint16 bitmask;
14910   static const int *ieee80211_tag_bss_avb_adm_cap_bitmask[] = {
14911     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
14912     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
14913     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
14914     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
14915     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
14916     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
14917     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
14918     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
14919     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
14920     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
14921     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
14922     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
14923     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
14924     NULL
14925   };
14926
14927   if (tag_len < 2) {
14928     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14929                            "BSS Available Admission Capacity length %u wrong, must > = 2", tag_len);
14930     return offset;
14931   }
14932
14933   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
14934                                     ett_tag_bss_bitmask_tree, ieee80211_tag_bss_avb_adm_cap_bitmask,
14935                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14936   bitmask = tvb_get_letohs(tvb, offset);
14937   offset += 2;
14938
14939   if(bitmask & BSS_BITMASK_UP0)
14940   {
14941     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14942     offset += 2;
14943   }
14944   if(bitmask & BSS_BITMASK_UP1)
14945   {
14946     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14947     offset += 2;
14948   }
14949   if(bitmask & BSS_BITMASK_UP2)
14950   {
14951     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14952     offset += 2;
14953   }
14954   if(bitmask & BSS_BITMASK_UP3)
14955   {
14956     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14957     offset += 2;
14958   }
14959   if(bitmask & BSS_BITMASK_UP4)
14960   {
14961     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14962     offset += 2;
14963   }
14964   if(bitmask & BSS_BITMASK_UP5)
14965   {
14966     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14967     offset += 2;
14968   }
14969   if(bitmask & BSS_BITMASK_UP6)
14970   {
14971     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14972     offset += 2;
14973   }
14974   if(bitmask & BSS_BITMASK_UP7)
14975   {
14976     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14977     offset += 2;
14978   }
14979   if(bitmask & BSS_BITMASK_AC0)
14980   {
14981     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14982     offset += 2;
14983   }
14984   if(bitmask & BSS_BITMASK_AC1)
14985   {
14986     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14987     offset += 2;
14988   }
14989   if(bitmask & BSS_BITMASK_AC2)
14990   {
14991     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14992     offset += 2;
14993   }
14994   if(bitmask & BSS_BITMASK_AC3)
14995   {
14996     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14997     offset += 2;
14998   }
14999   return offset;
15000 }
15001
15002 static int
15003 dissect_bss_ac_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
15004                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
15005 {
15006
15007   if (tag_len != 4) {
15008     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
15009                            "BSS AC Access Delay length %u wrong, must = 4", tag_len);
15010     return offset;
15011   }
15012
15013   /* TODO: Display the scaled representation of the average
15014     medium access delay (a big (precalculed) value_string ?)
15015     See 8.4.2.46 BSS AC Access Delay element ... */
15016
15017   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_be, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15018   offset += 1;
15019   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_bk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15020   offset += 1;
15021   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15022   offset += 1;
15023   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vo, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15024   offset += 1;
15025
15026   return offset;
15027 }
15028
15029 /* RM Enabled Capabilities (70) */
15030 static int
15031 dissect_rm_enabled_capabilities_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15032 {
15033   int tag_len = tvb_reported_length(tvb);
15034   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15035   int offset = 0;
15036   proto_item *ti_ex_cap;
15037   static const int *ieee80211_tag_rm_enabled_capabilities_octet1[] = {
15038     &hf_ieee80211_tag_rm_enabled_capabilities_b0,
15039     &hf_ieee80211_tag_rm_enabled_capabilities_b1,
15040     &hf_ieee80211_tag_rm_enabled_capabilities_b2,
15041     &hf_ieee80211_tag_rm_enabled_capabilities_b3,
15042     &hf_ieee80211_tag_rm_enabled_capabilities_b4,
15043     &hf_ieee80211_tag_rm_enabled_capabilities_b5,
15044     &hf_ieee80211_tag_rm_enabled_capabilities_b6,
15045     &hf_ieee80211_tag_rm_enabled_capabilities_b7,
15046     NULL
15047   };
15048
15049   static const int *ieee80211_tag_rm_enabled_capabilities_octet2[] = {
15050     &hf_ieee80211_tag_rm_enabled_capabilities_b8,
15051     &hf_ieee80211_tag_rm_enabled_capabilities_b9,
15052     &hf_ieee80211_tag_rm_enabled_capabilities_b10,
15053     &hf_ieee80211_tag_rm_enabled_capabilities_b11,
15054     &hf_ieee80211_tag_rm_enabled_capabilities_b12,
15055     &hf_ieee80211_tag_rm_enabled_capabilities_b13,
15056     &hf_ieee80211_tag_rm_enabled_capabilities_b14,
15057     &hf_ieee80211_tag_rm_enabled_capabilities_b15,
15058     NULL
15059   };
15060
15061   static const int *ieee80211_tag_rm_enabled_capabilities_octet3[] = {
15062     &hf_ieee80211_tag_rm_enabled_capabilities_b16,
15063     &hf_ieee80211_tag_rm_enabled_capabilities_b17,
15064     &hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
15065     &hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
15066     NULL
15067   };
15068
15069   static const int *ieee80211_tag_rm_enabled_capabilities_octet4[] = {
15070     &hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
15071     &hf_ieee80211_tag_rm_enabled_capabilities_b27,
15072     &hf_ieee80211_tag_rm_enabled_capabilities_b28,
15073     &hf_ieee80211_tag_rm_enabled_capabilities_b29,
15074     &hf_ieee80211_tag_rm_enabled_capabilities_b30,
15075     &hf_ieee80211_tag_rm_enabled_capabilities_b31,
15076     NULL
15077   };
15078
15079   static const int *ieee80211_tag_rm_enabled_capabilities_octet5[] = {
15080     &hf_ieee80211_tag_rm_enabled_capabilities_b32,
15081     &hf_ieee80211_tag_rm_enabled_capabilities_b33,
15082     &hf_ieee80211_tag_rm_enabled_capabilities_o5,
15083     NULL
15084   };
15085
15086   if (tag_len != 5)
15087   {
15088     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "RM Enabled Capabilities length %u wrong, must = 5", tag_len);
15089     return 1;
15090   }
15091   proto_item_append_text(field_data->item_tag, " (%d octets)", tag_len);
15092
15093   /* RM Enabled Capability octet 1 */
15094   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15095                                     ett_tag_rm_cap1, ieee80211_tag_rm_enabled_capabilities_octet1,
15096                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15097   proto_item_append_text(ti_ex_cap, " (octet 1)");
15098   offset += 1;
15099
15100   /* RM Enabled Capability octet 2 */
15101   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15102                                     ett_tag_rm_cap2, ieee80211_tag_rm_enabled_capabilities_octet2,
15103                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15104   proto_item_append_text(ti_ex_cap, " (octet 2)");
15105   offset += 1;
15106
15107   /* RM Enabled Capability octet 3 */
15108   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15109                                     ett_tag_rm_cap3, ieee80211_tag_rm_enabled_capabilities_octet3,
15110                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15111   proto_item_append_text(ti_ex_cap, " (octet 3)");
15112   offset += 1;
15113
15114   /* RM Enabled Capability octet 4 */
15115   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15116                                     ett_tag_rm_cap4, ieee80211_tag_rm_enabled_capabilities_octet4,
15117                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15118   proto_item_append_text(ti_ex_cap, " (octet 4)");
15119   offset += 1;
15120
15121   /* RM Enabled Capability octet 5 */
15122   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15123                                     ett_tag_rm_cap5, ieee80211_tag_rm_enabled_capabilities_octet5,
15124                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15125   proto_item_append_text(ti_ex_cap, " (octet 5)");
15126   offset += 1;
15127
15128   return offset;
15129 }
15130
15131 /* 20/40 BSS Coexistence (72) */
15132 static int
15133 dissect_20_40_bss_coexistence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15134 {
15135   int tag_len = tvb_reported_length(tvb);
15136   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15137   int offset = 0;
15138   static const int *ieee80211_20_40_bss_coexistence_fields[] = {
15139     &hf_ieee80211_tag_20_40_bc_information_request,
15140     &hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant,
15141     &hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request,
15142     &hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request,
15143     &hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant,
15144     &hf_ieee80211_tag_20_40_bc_reserved,
15145     NULL
15146   };
15147
15148   if (tag_len != 1)
15149   {
15150     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);
15151     return 1;
15152   }
15153
15154   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_20_40_bc,
15155                                     ett_tag_20_40_bc, ieee80211_20_40_bss_coexistence_fields,
15156                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15157
15158   offset += 1;
15159
15160   return offset;
15161 }
15162
15163 static int
15164 dissect_ht_capability_ie_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
15165                          guint32 tag_len, proto_item *ti_len, gboolean vendorspecific)
15166 {
15167   proto_item *cap_item, *ti;
15168   proto_tree *cap_tree;
15169   static const int *ieee80211_ht[] = {
15170     &hf_ieee80211_ht_ldpc_coding,
15171     &hf_ieee80211_ht_chan_width,
15172     &hf_ieee80211_ht_sm_pwsave,
15173     &hf_ieee80211_ht_green,
15174     &hf_ieee80211_ht_short20,
15175     &hf_ieee80211_ht_short40,
15176     &hf_ieee80211_ht_tx_stbc,
15177     &hf_ieee80211_ht_rx_stbc,
15178     &hf_ieee80211_ht_delayed_block_ack,
15179     &hf_ieee80211_ht_max_amsdu,
15180     &hf_ieee80211_ht_dss_cck_40,
15181     &hf_ieee80211_ht_psmp,
15182     &hf_ieee80211_ht_40_mhz_intolerant,
15183     &hf_ieee80211_ht_l_sig,
15184     NULL
15185   };
15186
15187   static const int *ieee80211_htex[] = {
15188     &hf_ieee80211_htex_pco,
15189     &hf_ieee80211_htex_transtime,
15190     &hf_ieee80211_htex_mcs,
15191     &hf_ieee80211_htex_htc_support,
15192     &hf_ieee80211_htex_rd_responder,
15193     NULL
15194   };
15195
15196   static const int *ieee80211_txbf[] = {
15197     &hf_ieee80211_txbf_cap,
15198     &hf_ieee80211_txbf_rcv_ssc,
15199     &hf_ieee80211_txbf_tx_ssc,
15200     &hf_ieee80211_txbf_rcv_ndp,
15201     &hf_ieee80211_txbf_tx_ndp,
15202     &hf_ieee80211_txbf_impl_txbf,
15203     &hf_ieee80211_txbf_calib,
15204     &hf_ieee80211_txbf_expl_csi,
15205     &hf_ieee80211_txbf_expl_uncomp_fm,
15206     &hf_ieee80211_txbf_expl_comp_fm,
15207     &hf_ieee80211_txbf_expl_bf_csi,
15208     &hf_ieee80211_txbf_expl_uncomp_fm_feed,
15209     &hf_ieee80211_txbf_expl_comp_fm_feed,
15210     &hf_ieee80211_txbf_min_group,
15211     &hf_ieee80211_txbf_csi_num_bf_ant,
15212     &hf_ieee80211_txbf_uncomp_sm_bf_ant,
15213     &hf_ieee80211_txbf_comp_sm_bf_ant,
15214     &hf_ieee80211_txbf_csi_max_rows_bf,
15215     &hf_ieee80211_txbf_chan_est,
15216     &hf_ieee80211_txbf_resrv,
15217     NULL
15218   };
15219
15220   static const int *ieee80211_antsel[] = {
15221     &hf_ieee80211_antsel_b0,
15222     &hf_ieee80211_antsel_b1,
15223     &hf_ieee80211_antsel_b2,
15224     &hf_ieee80211_antsel_b3,
15225     &hf_ieee80211_antsel_b4,
15226     &hf_ieee80211_antsel_b5,
15227     &hf_ieee80211_antsel_b6,
15228     &hf_ieee80211_antsel_b7,
15229     NULL
15230   };
15231
15232   if (tag_len != 26) {
15233     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
15234                            "HT Capabilities IE length %u wrong, must be = 26", tag_len);
15235     return (offset > 0) ? offset : 1;
15236   }
15237
15238   if (wlan_ignore_draft_ht && vendorspecific)
15239     return (offset > 0) ? offset : 1;
15240
15241   /* 2 byte HT Capabilities  Info*/
15242   if (vendorspecific)
15243   {
15244     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_vs_cap,
15245                                     ett_ht_cap_tree, ieee80211_ht,
15246                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15247   }
15248   else
15249   {
15250     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_cap,
15251                                     ett_ht_cap_tree, ieee80211_ht,
15252                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15253   }
15254   offset += 2;
15255
15256   /* 1 byte A-MPDU Parameters */
15257   if (vendorspecific)
15258   {
15259     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15260   } else
15261   {
15262     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15263   }
15264   cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
15265   ti = proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15266   proto_item_append_text(ti, " (%04.0f[Bytes])", pow(2, 13+(tvb_get_guint8(tvb, offset) & 0x3))-1);
15267   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu_start_spacing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15268   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15269   offset += 1;
15270
15271   /* 16 byte MCS set */
15272   offset = dissect_mcs_set(tree, tvb, offset, FALSE, vendorspecific);
15273
15274
15275   /* 2 byte HT Extended Capabilities */
15276   if (vendorspecific)
15277   {
15278     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_htex_vs_cap,
15279                                     ett_htex_cap_tree, ieee80211_htex,
15280                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15281   } else {
15282     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_htex_cap,
15283                                     ett_htex_cap_tree, ieee80211_htex,
15284                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15285   }
15286   offset += 2;
15287
15288
15289   /* 4 byte TxBF capabilities */
15290   if (vendorspecific)
15291   {
15292     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_txbf_vs,
15293                                     ett_txbf_tree, ieee80211_txbf,
15294                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15295   } else {
15296     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_txbf,
15297                                     ett_txbf_tree, ieee80211_txbf,
15298                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15299   }
15300   offset += 4;
15301
15302   /* 1 byte Antenna Selection (ASEL) capabilities */
15303   if (vendorspecific)
15304   {
15305     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_antsel_vs,
15306                                     ett_antsel_tree, ieee80211_antsel,
15307                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15308   }
15309   else
15310   {
15311     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_antsel,
15312                                     ett_antsel_tree, ieee80211_antsel,
15313                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15314   }
15315   offset += 1;
15316
15317   return offset;
15318 }
15319
15320 static int
15321 dissect_ht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15322 {
15323   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15324
15325   return dissect_ht_capability_ie_common(tvb, pinfo, tree, 0, tvb_reported_length(tvb),
15326             field_data->item_tag_length, FALSE);
15327 }
15328
15329 static int
15330 dissect_ht_info_ie_1_0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
15331                        guint32 tag_len, proto_item *ti_len)
15332 {
15333   static const int *ieee80211_hta1[] = {
15334     &hf_ieee80211_hta_ext_chan_offset,
15335     &hf_ieee80211_hta_rec_tx_width,
15336     &hf_ieee80211_hta_rifs_mode,
15337     &hf_ieee80211_hta_controlled_access,
15338     &hf_ieee80211_hta_service_interval,
15339     NULL
15340   };
15341
15342   static const int *ieee80211_hta2[] = {
15343     &hf_ieee80211_hta_operating_mode,
15344     &hf_ieee80211_hta_non_gf_devices,
15345     NULL
15346   };
15347
15348   static const int *ieee80211_hta3[] = {
15349     &hf_ieee80211_hta_basic_stbc_mcs,
15350     &hf_ieee80211_hta_dual_stbc_protection,
15351     &hf_ieee80211_hta_secondary_beacon,
15352     &hf_ieee80211_hta_lsig_txop_protection,
15353     &hf_ieee80211_hta_pco_active,
15354     &hf_ieee80211_hta_pco_phase,
15355     NULL
15356   };
15357
15358   if (tag_len != 22) {
15359     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
15360                            "Tag length %u wrong, must be = 22", tag_len);
15361     return offset;
15362   }
15363
15364   if (wlan_ignore_draft_ht)
15365     return offset;
15366
15367   /* 1 HT Control Channel */
15368   proto_tree_add_item(tree, hf_ieee80211_hta_cc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15369   offset += 1;
15370
15371   /* 1 byte HT additional capabilities */
15372   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap1,
15373                                     ett_hta_cap_tree, ieee80211_hta1,
15374                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15375   offset += 1;
15376
15377   /* 2 byte HT additional capabilities */
15378   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap2,
15379                                     ett_hta_cap1_tree, ieee80211_hta2,
15380                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15381   offset += 2;
15382
15383   /* 2 byte HT additional capabilities */
15384   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap2,
15385                                     ett_hta_cap2_tree, ieee80211_hta3,
15386                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15387   offset += 2;
15388
15389   /* 16 byte Supported MCS set */
15390   offset = dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
15391
15392   return offset;
15393 }
15394
15395 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
15396
15397 /*
15398  * 8.2.4.1.10 "Order field" says:
15399  *
15400  *  The Order field is 1 bit in length. It is used for two purposes:
15401  *
15402  *    -- It is set to 1 in a non-QoS data frame transmitted by a non-QoS
15403  *       STA to indicate that the frame contains an MSDU, or fragment
15404  *       thereof, that is being transferred using the StrictlyOrdered
15405  *       service class.
15406  *
15407  *    -- It is set to 1 in a QoS data or management frame transmitted
15408  *       with a value of HT_GF or HT_MF for the FORMAT parameter of the
15409  *       TXVECTOR to indicate that the frame contains an HT Control field.
15410  *
15411  * 802.11ac changes the second of those clauses to say "HT_GF, HT_MF,
15412  * or VHT", indicates that bit B0 of the field is 0 for HT and 1 for
15413  * VHT (stealing a reserved bit from the Link Adaptation Control field),
15414  * and that everything except for "AC Constraint" and "RDG/More Cowbell^W
15415  * PPDU" is different for the VHT version.
15416  *
15417  *  802.11ax changes the meaning of the first two bits:
15418  *
15419  *     B0 = 0         means High Throughput
15420  *     B0 = 1, B1 = 0 means Very High Throughput
15421  *     B0 = 1, B1 = 1 means High Efficiency
15422  *
15423  * I read the second clause of 8.2.4.1.10 "Order field", as modified by
15424  * 802.11ac, as meaning that, for QoS data and management frames, the
15425  * Order field will *only* be set to 1 for HT or VHT frames, and therefore
15426  * that we do *not* have to determine, from radio metadata, whether the
15427  * frame was transmitted as an HT or VHT frame.
15428  *
15429  * (See bug 11351, in which a frame with an HT Control field, with a
15430  * radiotap header, lacks the MCS or VHT fields in the radiotap header,
15431  * so Wireshark has no clue that it's an HT or VHT field, and misdissected
15432  * the packet.  Omnipeek, which also appeared to have no clue that it was
15433  * an HT or VHT field - it called it an 802.11b frame - *did* dissect the
15434  * HT Control field.)
15435  *
15436  * 802.11ax changes the reserved bit to differentiate between the HE version
15437  * and the VHT version, and adds different types of Aggregate Control info.
15438  */
15439 #define A_CONTROL_UMRS 0
15440 #define A_CONTROL_OM   1
15441 #define A_CONTROL_HLA  2
15442 #define A_CONTROL_BSR  3
15443 #define A_CONTROL_UPH  4
15444 #define A_CONTROL_BQR  5
15445 #define A_CONTROL_CCI  6
15446 #define A_CONTROL_BQR_REV 0x0A
15447
15448 static const value_string a_control_control_id_vals[] = {
15449   { A_CONTROL_UMRS, "UL MU response scheduling" },
15450   { A_CONTROL_OM,   "Operating mode" },
15451   { A_CONTROL_HLA,  "HE link adaptation" },
15452   { A_CONTROL_BSR,  "Buffer status report" },
15453   { A_CONTROL_UPH,  "UL power headroom" },
15454   { A_CONTROL_BQR,  "Bandwidth query report" },
15455   { A_CONTROL_CCI,  "Command Control Indication" },
15456   { A_CONTROL_BQR_REV, "Bandwidth Query Report (reversed bits)" },
15457   { 0, NULL }
15458 };
15459
15460 /*
15461  * Print the UL target RSSI field as per the spec.
15462  *  0->30 map to -90 to -30 dBm.
15463  *  31 maps to Max ransmit power
15464  */
15465 static void
15466 ul_target_rssi_base_custom(gchar *result, guint32 target_rssi)
15467 {
15468   if (target_rssi <= 30) {
15469     g_snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -90 + (2 * target_rssi));
15470   } else if (target_rssi == 31) {
15471     g_snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power");
15472   }
15473 }
15474
15475 static void
15476 dissect_a_control_umrs(proto_tree *tree, tvbuff_t *tvb, int offset,
15477   guint32 bits _U_, guint32 start_bit)
15478 {
15479   proto_tree *umrs_tree = NULL;
15480   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
15481
15482   /*
15483    * We isolated the bits and moved them to the bottom ... so display them
15484    */
15485   umrs_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15486                                 ett_ieee80211_umrs_control,
15487                                 NULL, "UMRS Control: 0x%0x", the_bits);
15488
15489   proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_umrs_he_tb_ppdu_len, tvb,
15490                         offset, 4, the_bits);
15491   proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_umrs_ru_allocation, tvb,
15492                         offset, 4, the_bits);
15493   proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_dl_tx_power, tvb,
15494                         offset, 4, the_bits);
15495   proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_ul_target_rssi, tvb,
15496                         offset, 4, the_bits);
15497   proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_ul_mcs, tvb,
15498                         offset, 4, the_bits);
15499   proto_tree_add_bits_item(umrs_tree, hf_ieee80211_he_ul_reserved, tvb,
15500                         offset, 4, the_bits);
15501 }
15502
15503 static void
15504 dissect_a_control_om(proto_tree *tree, tvbuff_t *tvb, int offset,
15505   guint32 bits _U_, guint32 start_bit)
15506 {
15507   proto_tree *om_tree = NULL;
15508   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x0000003FF;
15509
15510   /*
15511    * We isolated the bits and moved them to the bottom ... so display them
15512    */
15513   om_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15514                                 ett_ieee80211_om_control,
15515                                 NULL, "OM Control: 0x%0x", the_bits);
15516
15517   proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_rx_nss, tvb,
15518                         offset, 4, the_bits);
15519   proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_channel_width, tvb,
15520                         offset, 4, the_bits);
15521   proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_ul_mu_disable, tvb,
15522                         offset, 4, the_bits);
15523   proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_tx_nsts, tvb,
15524                         offset, 4, the_bits);
15525   proto_tree_add_bits_item(om_tree, hf_ieee80211_he_om_reserved, tvb,
15526                         offset, 4, the_bits);
15527 }
15528
15529 static void
15530 dissect_a_control_hla(proto_tree *tree, tvbuff_t *tvb, int offset,
15531   guint32 bits _U_, guint32 start_bit)
15532 {
15533   proto_tree *hla_tree = NULL;
15534   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
15535
15536   /*
15537    * We isolated the bits and moved them to the bottom ... so display them
15538    */
15539   hla_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15540                                 ett_ieee80211_hla_control,
15541                                 NULL, "HLA Control: 0x%0x", the_bits);
15542
15543   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_unsolicited_mfb, tvb,
15544                         offset, 4, the_bits);
15545   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_mrq, tvb,
15546                         offset, 4, the_bits);
15547   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_nss, tvb,
15548                         offset, 4, the_bits);
15549   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_he_mcs, tvb,
15550                         offset, 4, the_bits);
15551   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_dcm, tvb,
15552                         offset, 4, the_bits);
15553   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_ru, tvb,
15554                         offset, 4, the_bits);
15555   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_bw, tvb,
15556                         offset, 4, the_bits);
15557   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_msi_ppdu_type, tvb,
15558                         offset, 4, the_bits);
15559   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_tx_bf, tvb,
15560                         offset, 4, the_bits);
15561   proto_tree_add_bits_item(hla_tree, hf_ieee80211_he_hla_reserved, tvb,
15562                         offset, 4, the_bits);
15563 }
15564
15565 static void
15566 dissect_a_control_bsr(proto_tree *tree, tvbuff_t *tvb, int offset,
15567   guint32 bits _U_, guint32 start_bit)
15568 {
15569   proto_tree *bsr_tree = NULL;
15570   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
15571
15572   /*
15573    * We isolated the bits and moved them to the bottom ... so display them
15574    */
15575   bsr_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15576                                 ett_ieee80211_buffer_status_report,
15577                                 NULL, "Buffer Status Report: 0x%0x", the_bits);
15578
15579   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_aci_bitmap, tvb,
15580                         offset, 4, the_bits);
15581   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_delta_tid, tvb,
15582                         offset, 4, the_bits);
15583   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_aci_high, tvb,
15584                         offset, 4, the_bits);
15585   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_scaling_factor, tvb,
15586                         offset, 4, the_bits);
15587   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_queue_size_high, tvb,
15588                         offset, 4, the_bits);
15589   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_queue_size_all, tvb,
15590                         offset, 4, the_bits);
15591 }
15592
15593 static void
15594 dissect_a_control_uph(proto_tree *tree, tvbuff_t *tvb, int offset,
15595   guint32 bits _U_, guint32 start_bit)
15596 {
15597   proto_tree *uph_tree = NULL;
15598   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
15599
15600   /*
15601    * We isolated the bits and moved them to the bottom ... so display them
15602    */
15603   uph_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15604                                 ett_ieee80211_control_uph,
15605                                 NULL, "UPH Control: 0x%0x", the_bits);
15606
15607   proto_tree_add_bits_item(uph_tree, hf_ieee80211_he_uph_ul_power_headroom, tvb,
15608                         offset, 4, the_bits);
15609   proto_tree_add_bits_item(uph_tree, hf_ieee80211_he_uph_ul_min_transmit_power_flag,
15610                         tvb, offset, 4, the_bits);
15611   proto_tree_add_bits_item(uph_tree, hf_ieee80211_he_uph_reserved,
15612                         tvb, offset, 4, the_bits);
15613 }
15614
15615 static void
15616 dissect_a_control_bqr(proto_tree *tree, tvbuff_t *tvb, int offset,
15617   guint32 bits _U_, guint32 start_bit)
15618 {
15619   proto_tree *bqr_tree = NULL;
15620   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
15621
15622   /*
15623    * We isolated the bits and moved them to the bottom ... so display them
15624    */
15625   bqr_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15626                                 ett_ieee80211_bqr_control,
15627                                 NULL, "BQR Control: 0x%0x", the_bits);
15628
15629   proto_tree_add_bits_item(bqr_tree, hf_ieee80211_he_btc_avail_chan, tvb,
15630                         offset, 4, the_bits);
15631   proto_tree_add_bits_item(bqr_tree, hf_ieee80211_he_btc_reserved, tvb,
15632                         offset, 4, the_bits);
15633 }
15634
15635 static void
15636 dissect_a_control_cci(proto_tree *tree, tvbuff_t *tvb, int offset,
15637   guint32 bits _U_, guint32 start_bit)
15638 {
15639   proto_tree *cci_tree = NULL;
15640   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
15641
15642   /*
15643    * We isolated the bits and moved them to the bottom ... so display them
15644    */
15645   cci_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15646                                 ett_ieee80211_control_cci,
15647                                 NULL, "Command Control Indication: 0x%0x", the_bits);
15648
15649   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_ac_constraint, tvb,
15650                         offset, 4, the_bits);
15651   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_rdg_more_ppdu, tvb,
15652                         offset, 4, the_bits);
15653   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_sr_ppdu_indic, tvb,
15654                         offset, 4, the_bits);
15655   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_reserved, tvb,
15656                         offset, 4, the_bits);
15657 }
15658
15659 static void
15660 dissect_ht_control(proto_tree *tree, tvbuff_t *tvb, int offset)
15661 {
15662   proto_item *ti;
15663   proto_tree *htc_tree, *lac_subtree, *mfb_subtree;
15664   guint32 htc;
15665
15666   htc = tvb_get_letohl(tvb, offset);
15667
15668   ti = proto_tree_add_item(tree, hf_ieee80211_htc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15669   htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
15670
15671   /* Check the HT vs. VHT bit. */
15672   proto_tree_add_item(htc_tree, hf_ieee80211_htc_vht, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15673   if (htc & HTC_VHT) {
15674     /* VHT or HE */
15675     proto_tree_add_item(htc_tree, hf_ieee80211_htc_he, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15676     if (htc & HTC_HE) {
15677       /*
15678        * We have a 30-bit field, of which the first is a 4-bit Control ID which
15679        * determines how the rest is handled. There can be multiple fields.
15680        */
15681       proto_tree *a_control_tree = NULL;
15682       proto_item *pi = NULL;
15683       guint8 start_bit_offset = 2;
15684
15685       a_control_tree = proto_tree_add_subtree_format(htc_tree, tvb, offset, 4,
15686                                 ett_htc_he_a_control, NULL,
15687                                 "Aggregate Control: 0x%0x", htc >> 2);
15688       while (start_bit_offset < 32) {
15689         guint8 control_id = (htc >> start_bit_offset) & 0x0F;
15690         start_bit_offset += 4;
15691         pi = proto_tree_add_uint(a_control_tree, hf_ieee80211_htc_he_ctrl_id,
15692                         tvb, offset, 4, control_id);
15693         proto_item_append_text(pi, ": %s",
15694                         val_to_str(control_id, a_control_control_id_vals,
15695                                         "Reserved (%u)"));
15696         switch (control_id) {
15697         case A_CONTROL_UMRS:
15698           dissect_a_control_umrs(a_control_tree, tvb, offset, htc, start_bit_offset);
15699           start_bit_offset += 26;
15700           break;
15701         case A_CONTROL_OM:
15702           dissect_a_control_om(a_control_tree, tvb, offset, htc, start_bit_offset);
15703           start_bit_offset += 12;
15704           break;
15705         case A_CONTROL_HLA:
15706           dissect_a_control_hla(a_control_tree, tvb, offset, htc, start_bit_offset);
15707           start_bit_offset += 26;
15708           break;
15709         case A_CONTROL_BSR:
15710           dissect_a_control_bsr(a_control_tree, tvb, offset, htc, start_bit_offset);
15711           start_bit_offset += 26;
15712           break;
15713         case A_CONTROL_UPH:
15714           dissect_a_control_uph(a_control_tree, tvb, offset, htc, start_bit_offset);
15715           start_bit_offset += 8;
15716           break;
15717         case A_CONTROL_BQR:
15718         case A_CONTROL_BQR_REV:
15719           dissect_a_control_bqr(a_control_tree, tvb, offset, htc, start_bit_offset);
15720           start_bit_offset += 10;
15721           break;
15722         case A_CONTROL_CCI:
15723           dissect_a_control_cci(a_control_tree, tvb, offset, htc, start_bit_offset);
15724           start_bit_offset += 8;
15725           break;
15726         default:
15727           /* Add an expert info ... */
15728           start_bit_offset += 32;  /* Abandon */
15729           break;
15730         }
15731       }
15732     } else {
15733       proto_tree_add_item(htc_tree, hf_ieee80211_htc_mrq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15734       if (!(htc & HTC_UNSOLICITED_MFB)) {
15735         if (htc & HTC_MRQ) {
15736           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15737         } else {
15738           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15739         }
15740         proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfsi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15741       } else {
15742         if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
15743           proto_tree_add_item(htc_tree, hf_ieee80211_htc_compressed_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15744           proto_tree_add_item(htc_tree, hf_ieee80211_htc_ppdu_stbc_encoded, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15745         } else {
15746           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15747         }
15748         proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_l, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15749       }
15750       ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15751       mfb_subtree = proto_item_add_subtree(ti, ett_mfb_subtree);
15752       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_num_sts, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15753       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_vht_mcs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15754       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_bw, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15755       /* This should be converted to dB by adding 22  */
15756       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_snr, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15757       if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
15758         proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15759         proto_tree_add_item(htc_tree, hf_ieee80211_htc_coding_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15760         proto_tree_add_item(htc_tree, hf_ieee80211_htc_fb_tx_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15761       } else {
15762         proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15763       }
15764       proto_tree_add_item(htc_tree, hf_ieee80211_htc_unsolicited_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15765     }
15766   } else {
15767     /* Start: Link Adaptation Control */
15768     ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_ht_lac, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15769     lac_subtree = proto_item_add_subtree(ti, ett_lac_subtree);
15770     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_trq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15771
15772     if (HTC_IS_ASELI(htc)) {
15773       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_aseli, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15774     } else {
15775       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_mrq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15776       if (HTC_LAC_MAI_MRQ(htc)) {
15777         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_msi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15778       } else {
15779         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15780       }
15781     }
15782
15783     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15784
15785     if (HTC_IS_ASELI(htc)) {
15786       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15787       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_data, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15788     } else {
15789       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15790     }
15791     /* End: Link Adaptation Control */
15792
15793     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_pos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15794     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_seq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15795     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15796     proto_tree_add_item(htc_tree, hf_ieee80211_htc_csi_steering, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15797
15798     proto_tree_add_item(htc_tree, hf_ieee80211_htc_ndp_announcement, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15799     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15800   }
15801
15802   /*
15803    * These bits are part of the Aggregate Control field for 802.11ax
15804    */
15805   if (!(htc & HTC_HE)) {
15806     proto_tree_add_item(htc_tree, hf_ieee80211_htc_ac_constraint, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15807     proto_tree_add_item(htc_tree, hf_ieee80211_htc_rdg_more_ppdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15808   }
15809
15810   /* offset += 2; */
15811 }
15812
15813 #define IEEE80211_COMMON_OPT_BROKEN_FC         0x00000001
15814 #define IEEE80211_COMMON_OPT_IS_CENTRINO       0x00000002
15815 #define IEEE80211_COMMON_OPT_NORMAL_QOS        0x00000004
15816
15817 static void
15818 dissect_frame_control(proto_tree *tree, tvbuff_t *tvb, guint32 option_flags,
15819                       guint32 offset, packet_info *pinfo)
15820 {
15821   guint16 fcf, flags, frame_type_subtype;
15822   proto_tree *fc_tree, *flag_tree;
15823   proto_item *fc_item, *flag_item, *hidden_item, *ti;
15824
15825   fcf = FETCH_FCF(offset);
15826
15827   flags = FCF_FLAGS(fcf);
15828   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
15829
15830   /* Swap offset... */
15831   if(option_flags & IEEE80211_COMMON_OPT_BROKEN_FC)
15832   {
15833     offset += 1;
15834   }
15835
15836   proto_tree_add_uint(tree, hf_ieee80211_fc_frame_type_subtype, tvb, offset, 1, frame_type_subtype);
15837
15838   fc_item = proto_tree_add_item(tree, hf_ieee80211_fc_field, tvb, offset, 2, ENC_BIG_ENDIAN);
15839
15840   fc_tree = proto_item_add_subtree(fc_item, ett_fc_tree);
15841
15842   proto_tree_add_item(fc_tree, hf_ieee80211_fc_proto_version, tvb, offset, 1, ENC_NA);
15843   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_type, tvb, offset, 1, ENC_NA);
15844   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_subtype, tvb, offset, 1, ENC_NA);
15845   /* Changing control frame extension for extension frames */
15846   if(IS_FRAME_EXTENSION(fcf) == 1) {
15847     proto_tree_add_uint(fc_tree, hf_ieee80211_fc_frame_extension, tvb, offset, 1, FCF_FRAME_EXTENSION(fcf));
15848   }
15849   offset += 1;
15850
15851   /* Reswap offset...*/
15852   if(option_flags & IEEE80211_COMMON_OPT_BROKEN_FC)
15853   {
15854     offset -= 1;
15855     proto_item_append_text(fc_item, "(Swapped)");
15856   }
15857
15858   /* Flags */
15859   flag_item = proto_tree_add_item(fc_tree, hf_ieee80211_fc_flags, tvb, offset, 1, ENC_NA);
15860   flag_tree = proto_item_add_subtree(flag_item, ett_proto_flags);
15861   /* Changing control frame flags for extension frames */
15862   if(IS_FRAME_EXTENSION(fcf) == 0) {
15863     proto_tree_add_item(flag_tree, hf_ieee80211_fc_data_ds, tvb, offset, 1, ENC_NA);
15864     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_to_ds, tvb, offset, 1, ENC_NA);
15865     PROTO_ITEM_SET_HIDDEN(hidden_item);
15866     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_from_ds, tvb, offset, 1, ENC_NA);
15867     PROTO_ITEM_SET_HIDDEN(hidden_item);
15868     proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_frag, tvb, offset, 1, ENC_NA);
15869     ti = proto_tree_add_item(flag_tree, hf_ieee80211_fc_retry, tvb, offset, 1, ENC_NA);
15870     if( IS_RETRY(flags) )
15871     {
15872       expert_add_info(pinfo, ti, &ei_ieee80211_fc_retry);
15873       wlan_stats.fc_retry = 1;
15874     }
15875   }
15876   proto_tree_add_item(flag_tree, hf_ieee80211_fc_pwr_mgt, tvb, offset, 1, ENC_NA);
15877   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_data, tvb, offset, 1, ENC_NA);
15878   /* Changing control frame flags for extension frames */
15879   if(IS_FRAME_EXTENSION(fcf) == 0) {
15880     proto_tree_add_item(flag_tree, hf_ieee80211_fc_protected, tvb, offset, 1, ENC_NA);
15881   }
15882   proto_tree_add_item(flag_tree, hf_ieee80211_fc_order, tvb, offset, 1, ENC_NA);
15883 }
15884
15885 static void
15886 dissect_durid(proto_tree *hdr_tree, tvbuff_t *tvb, guint16 fts, gint offset)
15887 {
15888   guint16 durid = tvb_get_letohs(tvb, offset);
15889
15890   if (durid < 0x8000) {
15891     proto_tree_add_uint_format_value(hdr_tree, hf_ieee80211_did_duration, tvb,
15892       offset, 2, durid, "%u microseconds", durid);
15893   } else if (((durid & 0xC000) == 0xC000) &&
15894              ((durid & 0x3FFF) > 0) && ((durid & 0x3FFF) <= 2007) &&
15895              (fts == CTRL_PS_POLL)) {
15896     proto_tree_add_item(hdr_tree, hf_ieee80211_assoc_id, tvb, offset, 2,
15897       ENC_LITTLE_ENDIAN);
15898   } else if (durid == 0x8000) {
15899     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
15900       offset, 2, durid, "Duration/ID: %u", durid);
15901   } else {
15902     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
15903       offset, 2, durid, "Duration/ID: %u (reserved)", durid & 0x3FFF);
15904   }
15905 }
15906
15907
15908 static void
15909 dissect_vendor_ie_ht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
15910                     guint offset, proto_item *item, proto_item *ti_len, gint tag_len)
15911 {
15912
15913   guint8 type;
15914
15915   proto_tree_add_item(tree, hf_ieee80211_ht_pren_type, tvb, offset, 1, ENC_NA);
15916   type = tvb_get_guint8(tvb, offset);
15917   offset += 1;
15918   tag_len -= 1;
15919
15920
15921   switch(type){
15922     case 51:
15923       dissect_ht_capability_ie_common(tvb, pinfo, tree, offset, tag_len, ti_len, TRUE);
15924       proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
15925     break;
15926
15927     case 52:
15928       dissect_ht_info_ie_1_0(tvb, pinfo, tree, offset, tag_len, ti_len);
15929       proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
15930     break;
15931
15932     default:
15933       proto_tree_add_item(tree, hf_ieee80211_ht_pren_unknown, tvb, offset, tag_len, ENC_NA);
15934     break;
15935   }
15936
15937 }
15938
15939 static int
15940 dissect_interworking(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15941 {
15942   int tag_len = tvb_reported_length(tvb);
15943   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15944   int offset = 0;
15945   static const int *ieee80211_tag_interworking[] = {
15946     &hf_ieee80211_tag_interworking_access_network_type,
15947     &hf_ieee80211_tag_interworking_internet,
15948     &hf_ieee80211_tag_interworking_asra,
15949     &hf_ieee80211_tag_interworking_esr,
15950     &hf_ieee80211_tag_interworking_uesa,
15951     NULL
15952   };
15953
15954   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_interworking, ENC_LITTLE_ENDIAN);
15955   offset += 1;
15956
15957   if ((tag_len == (1 + 2)) || (tag_len == (1 + 2 + 6))) {
15958     dissect_venue_info(tree, tvb, offset);
15959     offset += 2;
15960   }
15961
15962   if ((tag_len == (1 + 6)) || (tag_len == (1 + 2 + 6))) {
15963     proto_tree_add_item(tree, hf_ieee80211_tag_interworking_hessid,
15964                         tvb, offset, 6, ENC_NA);
15965     offset += 6;
15966   }
15967
15968   if ((tag_len != 1) && (tag_len != (1 + 2)) && (tag_len != (1 + 6)) && (tag_len != (1 + 2 + 6))) {
15969     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
15970                            "Invalid Interworking element length");
15971   }
15972
15973   return offset;
15974 }
15975
15976 static int
15977 dissect_qos_map_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15978 {
15979   int tag_len = tvb_reported_length(tvb);
15980   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15981   int offset = 0;
15982   guint8 left;
15983   guint8 val, val2;
15984   int i;
15985   proto_item *dscp_item, *item;
15986   proto_tree *dscp_tree;
15987
15988   if (tag_len < 16 || tag_len & 1) {
15989     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_bad_length,
15990                                 "Truncated QoS Map Set element");
15991     return tvb_captured_length(tvb);
15992   }
15993
15994   left = tag_len - 16;
15995   while (left >= 2) {
15996     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_dscp_exc,
15997                                     tvb, offset, 2, ENC_LITTLE_ENDIAN);
15998     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
15999
16000     item = proto_tree_add_item(dscp_tree,
16001                                hf_ieee80211_tag_qos_map_set_dscp_exc_val,
16002                                tvb, offset, 1, ENC_NA);
16003     val = tvb_get_guint8(tvb, offset);
16004     if (val > 63 && val != 255) {
16005       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
16006                                   "Invalid DSCP Value");
16007     }
16008     offset++;
16009
16010     item = proto_tree_add_item(dscp_tree,
16011                                hf_ieee80211_tag_qos_map_set_dscp_exc_up,
16012                                tvb, offset, 1, ENC_NA);
16013     val2 = tvb_get_guint8(tvb, offset);
16014     if (val2 > 7) {
16015       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
16016                                   "Invalid User Priority");
16017     }
16018     offset++;
16019
16020     proto_item_append_text(dscp_item, " (0x%02x: UP %u)", val, val2);
16021
16022     left -= 2;
16023   }
16024
16025   for (i = 0; i < 8; i++) {
16026     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_range,
16027                                     tvb, offset, 2, ENC_NA);
16028     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
16029
16030     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_low,
16031                                tvb, offset, 1, ENC_NA);
16032     val = tvb_get_guint8(tvb, offset);
16033     if (val > 63 && val != 255) {
16034       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
16035                                   "Invalid DSCP Value");
16036     }
16037     offset++;
16038
16039     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_high,
16040                                tvb, offset, 1, ENC_NA);
16041     val2 = tvb_get_guint8(tvb, offset);
16042     if ((val2 > 63 && val2 != 255) || val2 < val ||
16043         (val == 255 && val2 != 255) || (val != 255 && val2 == 255)) {
16044       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
16045                                   "Invalid DSCP Value");
16046     }
16047     offset++;
16048
16049     if (val == 255 && val2 == 255) {
16050       proto_item_append_text(dscp_item, " (UP %u not in use)", i);
16051     } else {
16052       proto_item_append_text(dscp_item, " (0x%02x-0x%02x: UP %u)",
16053                              val, val2, i);
16054     }
16055   }
16056
16057   return tvb_captured_length(tvb);
16058 }
16059
16060 static int
16061 dissect_roaming_consortium(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16062 {
16063   int tag_len = tvb_reported_length(tvb);
16064   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16065   int offset = 0;
16066   proto_item* item;
16067   guint8 oi_lens, oi1_len, oi2_len;
16068
16069   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
16070                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16071   offset += 1;
16072
16073   oi_lens = tvb_get_guint8(tvb, offset);
16074   oi1_len = oi_lens & 0x0f;
16075   oi2_len = (oi_lens & 0xf0) >> 4;
16076   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1_len,
16077                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16078   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2_len,
16079                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16080   offset += 1;
16081
16082   if (offset + oi1_len > tag_len) {
16083     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16084                            "Truncated Roaming Consortium element");
16085     return tvb_captured_length(tvb);
16086   }
16087
16088   item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1,
16089                              tvb, offset, oi1_len, ENC_NA);
16090   add_manuf(item, tvb, offset);
16091   offset += oi1_len;
16092
16093   if (offset + oi2_len > tag_len) {
16094     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16095                            "Truncated Roaming Consortium element");
16096     return tvb_captured_length(tvb);
16097   }
16098
16099   if (oi2_len > 0) {
16100     item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2,
16101                         tvb, offset, oi2_len, ENC_NA);
16102     add_manuf(item, tvb, offset);
16103     offset += oi2_len;
16104   }
16105
16106   if (tag_len > offset) {
16107     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi3,
16108                         tvb, offset, tag_len - offset, ENC_NA);
16109   }
16110
16111   return tvb_captured_length(tvb);
16112 }
16113
16114
16115 /* ************************************************************************* */
16116 /*           Dissect and add tagged (optional) fields to proto tree          */
16117 /* ************************************************************************* */
16118
16119 static int beacon_padding = 0; /* beacon padding bug */
16120
16121 static int
16122 ieee80211_tag_ssid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16123 {
16124   int tag_len = tvb_reported_length(tvb);
16125   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16126   int offset = 0;
16127   /* 7.3.2.1 SSID element (0) */
16128   gchar *ssid; /* The SSID may consist of arbitrary bytes */
16129   gint ssid_len = tag_len;
16130
16131   if (beacon_padding != 0) /* padding bug */
16132     return offset;
16133
16134   if (ssid_len > MAX_SSID_LEN) {
16135     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16136                            "SSID length (%u) greater than maximum (%u)",
16137                            ssid_len, MAX_SSID_LEN);
16138     ssid_len = MAX_SSID_LEN;
16139   }
16140
16141   /*
16142    * XXX - the 802.11 specs aren't particularly clear on how the SSID
16143    * is to be interpreted.
16144    *
16145    * IEEE Std 802.11-1999, section 7.3.2.2 "Service Set Identity (SSID)
16146    * element" says just
16147    *
16148    *    The length of the SSID information field is between 0 and 32
16149    *    octets. A 0 length information field indicates the broadcast SSID.
16150    *
16151    * with no indication that those octets encode a string.
16152    *
16153    * IEEE Std 802.11-2012, section 8.4.2.2 "SSID element", says that *but*
16154    * says after it
16155    *
16156    *    When the UTF-8 SSID subfield of the Extended Capabilities element
16157    *    is equal to 1 in the frame that includes the SSID element, the
16158    *    SSID is interpreted using UTF-8 encoding.
16159    *
16160    *    NOTE -- This is true for Beacon and Probe Response frames when the
16161    *    MLME-START.request primitive was issued with the SSIDEncoding
16162    *    parameter equal to UTF-8.
16163    *
16164    * and the SSIDEncoding parameter can either be UNSPECIFIED or UTF-8.
16165    *
16166    * So I *guess* that means that, if the UTF-8 SSID subfield isn't
16167    * equal to 1, the SSID is, in theory, just a bunch of octets, but
16168    * in practice, *probably* ASCII as that's the typical convention,
16169    * and, if it is equal to 1, it's a UTF-8 string.  (Of course, a
16170    * host can put anything there it wants to, so we shouldn't just
16171    * assume that it's *valid* ASCII or *valid* UTF-8.)
16172    *
16173    * So we really should extract it as an array of ssid_len bytes,
16174    * pass those bytes to Dot11DecryptSetLastSSID(), and:
16175    *
16176    *    If the UTF-8 SSID subfield isn't set to 1, put the SSID in
16177    *    as an ENC_ASCII string;
16178    *
16179    *    If the UTF-8 SSID subfield is set to 1, put it in as an
16180    *    ENC_UTF_8 string;
16181    *
16182    * and rely on the libwireshark core code to somehow deal with
16183    * non-ASCII characters or invalid UTF-8 sequences or valid-but-
16184    * not-all-printable ASCII or UTF-8 strings in the protocol tree
16185    * display.  I'm not sure we can currently rely on it to handle
16186    * invalid UTF-8 or non-printable characters in UTF-8 strings,
16187    * however, so we just treat it as ASCII for now.
16188    *
16189    * We also need a better way of getting the display format of a
16190    * string value, so we can do something other than run it through
16191    * format_text(), which won't handle UTF-8.
16192    *
16193    * Addendum: 802.11 2012 points out that a Zero-length SSID means
16194    * the Wildcard SSID. Make it so. From 8.4.2.2 of 802.11 2012:
16195    *
16196    * "The length of the SSID field is between 0 and 32 octets. A SSID
16197    *  field of length 0 is used within Probe Request management frames to
16198    *  indicate the wildcard SSID. The wildcard SSID is also used in
16199    *  Beacon and Probe Response frames transmitted by mesh STAs."
16200    *
16201    * Also, we have to return a non-zero value here to prevent an ugly
16202    * undissected field warning. Since this code is only called from
16203    * one place and is used in call to dissector_try_uint_new, it is
16204    * OK to do so.
16205    */
16206   ssid = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, ssid_len, ENC_ASCII);
16207   if (ssid_len == (gint)tag_len) {
16208     Dot11DecryptSetLastSSID(&dot11decrypt_ctx, (CHAR *) ssid, ssid_len);
16209   }
16210   proto_tree_add_item(tree, hf_ieee80211_tag_ssid, tvb, offset, tag_len,
16211                       ENC_ASCII|ENC_NA);
16212
16213   if (ssid_len > 0) {
16214     gchar* s = format_text(wmem_packet_scope(), ssid, ssid_len);
16215     proto_item_append_text(field_data->item_tag, ": %s", s);
16216
16217     col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", s);
16218
16219     /* Wlan Stats */
16220     memcpy(wlan_stats.ssid, ssid, MIN(ssid_len, MAX_SSID_LEN));
16221     wlan_stats.ssid_len = ssid_len;
16222   } else {
16223     proto_item_append_text(field_data->item_tag, ": Wildcard SSID");
16224
16225     col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Wildcard (Broadcast)");
16226     offset += 1; // Make sure we return non-zero
16227   }
16228
16229   beacon_padding += 1; /* padding bug */
16230
16231   return offset + tag_len;
16232 }
16233
16234 static void
16235 dissect_he_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
16236   int offset, int len);
16237
16238 static void
16239 dissect_he_operation(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
16240   int offset, int len _U_);
16241
16242 static int
16243 dissect_neighbor_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16244 {
16245   int tag_len = tvb_reported_length(tvb);
16246   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16247   int offset = 0;
16248   guint8 sub_tag_id;
16249   guint32 sub_tag_length;
16250   proto_item *parent_item;
16251   proto_tree *bssid_info_subtree, *bssid_info_cap_subtree, *sub_tag_tree;
16252   tvbuff_t *sub_tag_tvb = NULL;
16253
16254   if (tag_len < 13) {
16255     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16256                            "Neighbor Report length %u wrong, must be > 13", tag_len);
16257     return tvb_captured_length(tvb);
16258   }
16259
16260   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid, tvb, offset, 6, ENC_NA);
16261   offset += 6;
16262
16263   /*** Begin: BSSID Information ***/
16264
16265   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid_info, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16266   bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
16267
16268   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reachability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16269   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_security, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16270   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16271   parent_item = proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16272   bssid_info_cap_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_capability_tree);
16273   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16274   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16275   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16276   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16277   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16278   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16279   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16280   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16281   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_very_high_throughput, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16282   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_ftm, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16283   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_efficiency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16284   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_er_bss, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16285   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16286   offset += 4;
16287
16288   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_ope_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16289   offset += 1;
16290
16291   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16292   offset += 1;
16293
16294   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16295   offset += 1;
16296
16297   /* The Optional Subelements field format contains zero or more subelements */
16298   if (tag_len == 13){ /* tag_len == 13 => no Subelements */
16299     return tvb_captured_length(tvb);
16300   }
16301
16302   while (offset < tag_len)
16303   {
16304
16305     sub_tag_id = tvb_get_guint8(tvb, offset);
16306     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16307     offset += 1;
16308
16309     sub_tag_length = tvb_get_guint8(tvb, offset);
16310     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16311     offset += 1;
16312     sub_tag_tvb = tvb_new_subset_length(tvb, offset, sub_tag_length);
16313
16314     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_data, tvb, offset, sub_tag_length, ENC_NA);
16315
16316     switch (sub_tag_id) {
16317       case NR_SUB_ID_TSF_INFO:
16318         /* TODO */
16319         break;
16320       case NR_SUB_ID_MEASUREMENT_PILOT_INFO:
16321         /* TODO */
16322         break;
16323       case NR_SUB_ID_BSS_TRN_CAN_PREF:
16324         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_trn_can_pref, tvb, offset, 1, ENC_NA);
16325         break;
16326       case NR_SUB_ID_BSS_TER_DUR:
16327         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_ter_tsf, tvb, offset, 8, ENC_NA);
16328
16329         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_dur, tvb, offset+8, 2, ENC_NA);
16330         break;
16331       case NR_SUB_ID_HT_CAPABILITIES:
16332         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16333                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Capabilities");
16334         dissect_ht_capability_ie_common(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, field_data->item_tag_length, FALSE);
16335         break;
16336       case NR_SUB_ID_HT_OPERATION:
16337         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16338                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Information");
16339         dissect_ht_info_ie_1_1(sub_tag_tvb, pinfo, sub_tag_tree, data);
16340         break;
16341       case NR_SUB_ID_SEC_CHANNEL_OFFSET:
16342         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16343                             ett_tag_neighbor_report_sub_tag_tree, NULL, "Secondary Channel Offset");
16344         dissect_secondary_channel_offset_ie(sub_tag_tvb, pinfo, sub_tag_tree, data);
16345         break;
16346       case NR_SUB_ID_HE_CAPABILITIES:
16347         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16348                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HE Capabilities");
16349         dissect_he_capabilities(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length);
16350         break;
16351       case NR_SUB_ID_HE_OPERATION:
16352         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16353                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HE Operation");
16354         dissect_he_operation(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length);
16355         break;
16356       case NR_SUB_ID_VENDOR_SPECIFIC:
16357       default:
16358         break;
16359     }
16360
16361     offset += sub_tag_length;
16362   }
16363
16364   return offset;
16365 }
16366
16367 static int
16368 ieee80211_tag_supp_rates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16369 {
16370   int tag_len = tvb_reported_length(tvb);
16371   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16372   int offset = 0;
16373   /* 7.3.2.2 Supported Rates element (1) */
16374   if (tag_len < 1) {
16375     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16376                            "Tag length %u too short, must be greater than 0",
16377                            tag_len);
16378     return offset;
16379   }
16380
16381   while (offset < tag_len) {
16382     proto_tree_add_item(tree, hf_ieee80211_tag_supp_rates, tvb, offset, 1,
16383                         ENC_LITTLE_ENDIAN);
16384     proto_item_append_text(field_data->item_tag, " %s,",
16385                            val_to_str_ext_const(tvb_get_guint8(tvb, offset),
16386                                                 &ieee80211_supported_rates_vals_ext,
16387                                                 "Unknown Rate"));
16388     offset += 1;
16389   }
16390
16391   proto_item_append_text(field_data->item_tag, " [Mbit/sec]");
16392
16393   return offset;
16394 }
16395
16396 static int
16397 ieee80211_tag_fh_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16398 {
16399   int tag_len = tvb_reported_length(tvb);
16400   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16401   int offset = 0;
16402   /* 7.3.2.3 FH Parameter Set element (2) */
16403   if (tag_len < 5) {
16404     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16405                            "Tag length %u too short, must be >= 5", tag_len);
16406     return 1;
16407   }
16408
16409   proto_tree_add_item(tree, hf_ieee80211_tag_fh_dwell_time,
16410                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
16411   offset += 2;
16412
16413   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_set,
16414                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16415   offset += 1;
16416
16417   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_pattern,
16418                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16419   offset += 1;
16420
16421   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_index,
16422                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16423   offset += 1;
16424
16425   return offset;
16426 }
16427
16428 static int
16429 ieee80211_tag_ds_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16430 {
16431   int tag_len = tvb_reported_length(tvb);
16432   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16433   int offset = 0;
16434   /* 7.3.2.4 DS Parameter Set element (3) */
16435   if (tag_len != 1) {
16436     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16437         "Tag length %u wrong, must be = 1", tag_len);
16438     return 1;
16439   }
16440
16441   proto_tree_add_item(tree, hf_ieee80211_tag_ds_param_channel,
16442         tvb, offset, 1, ENC_LITTLE_ENDIAN);
16443
16444   proto_item_append_text(field_data->item_tag, ": Current Channel: %u",
16445                          tvb_get_guint8(tvb, offset));
16446
16447   wlan_stats.channel = tvb_get_guint8(tvb, offset);
16448   offset += 1;
16449
16450   return offset;
16451 }
16452
16453 static int
16454 ieee80211_tag_cf_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16455 {
16456   int tag_len = tvb_reported_length(tvb);
16457   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16458   int offset = 0;
16459   /* 7.3.2.5 CF Parameter Set element (4) */
16460   if (tag_len != 6) {
16461     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16462                            "Tag length %u wrong, must be = 6", tag_len);
16463     return offset;
16464   }
16465
16466   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_count,
16467                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16468   proto_item_append_text(field_data->item_tag, ": CFP count %u", tvb_get_guint8(tvb, offset));
16469   offset += 1;
16470
16471   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_period,
16472                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16473   proto_item_append_text(field_data->item_tag, ": CFP Period %u", tvb_get_guint8(tvb, offset));
16474   offset += 1;
16475
16476   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_max_duration,
16477                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
16478   proto_item_append_text(field_data->item_tag, ": CFP Max Duration %u",
16479                          tvb_get_letohs(tvb, offset));
16480   offset += 2;
16481
16482   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_dur_remaining,
16483                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
16484   proto_item_append_text(field_data->item_tag, ": CFP Dur Remaining %u",
16485                          tvb_get_letohs(tvb, offset));
16486   offset += 1;
16487
16488   return offset;
16489 }
16490
16491 static int
16492 ieee80211_tag_tim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16493 {
16494   int tag_len = tvb_reported_length(tvb);
16495   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16496   int offset = 0;
16497   guint aid, pvb_len, n1, i, j, byte;
16498   static const int *ieee80211_tim_bmapctl[] = {
16499     &hf_ieee80211_tim_bmapctl_mcast,
16500     &hf_ieee80211_tim_bmapctl_offset,
16501     NULL
16502   };
16503
16504   /* 802.11-2012: 8.4.2.7 TIM element (5) */
16505   if (tag_len < 4) {
16506     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16507                            "Tag length %u too short, must be >= 4", tag_len);
16508     return 1;
16509   }
16510
16511   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_count,
16512                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16513   proto_item_append_text(field_data->item_tag, ": DTIM %u of", tvb_get_guint8(tvb, offset));
16514   offset += 1;
16515
16516   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_period,
16517                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16518   proto_item_append_text(field_data->item_tag, " %u bitmap", tvb_get_guint8(tvb, offset + 1));
16519   offset += 1;
16520
16521   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tim_bmapctl,
16522                                     ett_tag_bmapctl_tree, ieee80211_tim_bmapctl,
16523                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
16524   pvb_len = tag_len - 3;
16525   n1 = tvb_get_guint8(tvb, offset) & 0xFE;
16526   offset += 1;
16527
16528   proto_tree_add_item(tree, hf_ieee80211_tim_partial_virtual_bitmap,
16529                       tvb, offset, pvb_len, ENC_NA);
16530   /* FIXME: Handles dot11MgmtOptionMultiBSSIDActivated = false only */
16531   for (i = 0; i < pvb_len; i++) {
16532     byte = tvb_get_guint8(tvb, offset + i);
16533     for (j = 0; j < 8; j++) {
16534       if (byte & (1 << j)) {
16535         aid = 8*n1 + 8*i + j;
16536         proto_tree_add_uint(tree, hf_ieee80211_tim_aid, tvb, offset + i, 1, aid);
16537       }
16538     }
16539   }
16540   offset += pvb_len;
16541
16542   return offset;
16543 }
16544
16545 static int
16546 ieee80211_tag_ibss_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16547 {
16548   int tag_len = tvb_reported_length(tvb);
16549   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16550   int offset = 0;
16551   /* 7.3.2.7 IBSS Parameter Set element (6) */
16552
16553   if (tag_len != 2) {
16554     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16555                            "Tag length %u wrong, must be = 2", tag_len);
16556     return 1;
16557   }
16558
16559   proto_tree_add_item(tree, hf_ieee80211_tag_ibss_atim_window,
16560                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
16561   proto_item_append_text(field_data->item_tag, ": ATIM window 0x%x",
16562                          tvb_get_letohs(tvb, offset));
16563   offset += 2;
16564
16565   return offset;
16566 }
16567
16568 static const value_string environment_vals[] = {
16569   { 0x20, "Any" },
16570   { 0x4f, "Outdoor" },
16571   { 0x49, "Indoor" },
16572   { 0,    NULL }
16573 };
16574
16575 static int
16576 ieee80211_tag_country_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16577 {
16578   int tag_len = tvb_reported_length(tvb);
16579   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16580   int offset = 0;
16581   /* 7.3.2.9 Country information element (7) */
16582   proto_tree *sub_tree;
16583   proto_item *sub_item;
16584   const guint8* country_code;
16585
16586   if (tag_len < 6) {
16587     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16588                            "Tag length %u too short, must be >= 6", tag_len);
16589     return 1;
16590   }
16591
16592   proto_tree_add_item_ret_string(tree, hf_ieee80211_tag_country_info_code,
16593                       tvb, offset, 2, ENC_ASCII|ENC_NA, wmem_packet_scope(), &country_code);
16594   proto_item_append_text(field_data->item_tag, ": Country Code %s", country_code);
16595   offset += 2;
16596
16597   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_env,
16598                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16599   proto_item_append_text(field_data->item_tag, ", Environment %s",
16600                          val_to_str(tvb_get_guint8(tvb, offset),
16601                                     environment_vals, "Unknown (0x%02x)"));
16602   offset += 1;
16603
16604   while (offset < tag_len) {
16605     /* Padding ? */
16606     if ((tag_len - offset) < 3) {
16607       proto_tree_add_item(tree, hf_ieee80211_tag_country_info_pad,
16608                           tvb, offset, 1, ENC_NA);
16609       offset += 1;
16610       continue;
16611     }
16612     if (tvb_get_guint8(tvb, offset) <= 200) { /* 802.11d */
16613       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_fnm,
16614                                      tvb, offset, 3, ENC_NA);
16615       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_fnm_tree);
16616
16617       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_fcn,
16618                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16619       proto_item_append_text(sub_item, ": First Channel Number: %u",
16620                              tvb_get_guint8(tvb, offset));
16621       offset += 1;
16622       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_nc,
16623                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16624       proto_item_append_text(sub_item, ", Number of Channels: %u",
16625                              tvb_get_guint8(tvb, offset));
16626       offset += 1;
16627       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_mtpl,
16628                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16629       proto_item_append_text(sub_item,
16630                              ", Maximum Transmit Power Level: %d dBm",
16631                              tvb_get_guint8(tvb, offset));
16632       offset += 1;
16633     } else { /* 802.11j */
16634       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_rrc,
16635                                      tvb, offset, 3, ENC_NA);
16636       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_rcc_tree);
16637
16638       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oei,
16639                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16640       proto_item_append_text(sub_item,
16641                              ": Operating Extension Identifier: %u",
16642                              tvb_get_guint8(tvb, offset));
16643       offset += 1;
16644       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oc,
16645                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16646       proto_item_append_text(sub_item, ", Operating Class: %u",
16647                              tvb_get_guint8(tvb, offset));
16648       offset += 1;
16649       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_cc,
16650                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16651       proto_item_append_text(sub_item, ", Coverage Class: %u",
16652                              tvb_get_guint8(tvb, offset));
16653       offset += 1;
16654     }
16655   }
16656
16657   return offset;
16658 }
16659
16660 static int
16661 ieee80211_tag_fh_hopping_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16662 {
16663   int tag_len = tvb_reported_length(tvb);
16664   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16665   int offset = 0;
16666
16667   /* 7.3.2.10 Hopping Pattern Parameters information element (8) */
16668   if (tag_len < 2) {
16669     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16670                            "Tag length %u too short, must be >= 2", tag_len);
16671     return 1;
16672   }
16673
16674   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
16675                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16676   proto_item_append_text(field_data->item_tag, ": Prime Radix: %u", tvb_get_guint8(tvb, offset));
16677   offset += 1;
16678
16679   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
16680                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16681   proto_item_append_text(field_data->item_tag, ", Number of Channels: %u",
16682                          tvb_get_guint8(tvb, offset));
16683   offset += 1;
16684
16685   return offset;
16686 }
16687
16688 static int
16689 ieee80211_tag_fh_hopping_table(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16690 {
16691   int tag_len = tvb_reported_length(tvb);
16692   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16693   int offset = 0;
16694
16695   /* 7.3.2.11 Hopping Pattern Table information element (9) */
16696   if (tag_len < 4) {
16697     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16698                            "Tag length %u too short, must be >= 4", tag_len);
16699     return 1;
16700   }
16701
16702   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_flag,
16703                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16704   offset += 1;
16705
16706   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_number_of_sets,
16707                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16708   offset += 1;
16709
16710   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_modulus,
16711                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16712   offset += 1;
16713
16714   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_offset,
16715                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16716   offset += 1;
16717
16718   while (offset < tag_len) {
16719     proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_random_table,
16720                         tvb, offset, 2, ENC_BIG_ENDIAN);
16721     offset += 2;
16722   }
16723
16724   return offset;
16725 }
16726
16727 int
16728 add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype,
16729                  const guint8 *valid_element_ids, guint valid_element_ids_count,
16730                  association_sanity_check_t *association_sanity_check)
16731 {
16732   tvbuff_t     *tag_tvb;
16733   guint32       tag_no, tag_len;
16734   guint32       ext_tag_no, ext_tag_len;
16735   proto_tree   *orig_tree = tree;
16736   proto_item   *ti        = NULL;
16737   proto_item   *ti_len, *ti_tag;
16738   ieee80211_tagged_field_data_t field_data;
16739   gboolean      isDMG;
16740
16741   isDMG = GPOINTER_TO_INT(p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY));
16742
16743   tag_no  = tvb_get_guint8(tvb, offset);
16744   tag_len = tvb_get_guint8(tvb, offset + 1);
16745
16746   if (tree) {
16747     if (tag_no == TAG_ELEMENT_ID_EXTENSION) {
16748       ext_tag_no  = tvb_get_guint8(tvb, offset + 2);
16749       ti = proto_tree_add_item(orig_tree, hf_ieee80211_ext_tag, tvb, offset + 2, tag_len , ENC_NA);
16750       proto_item_append_text(ti, ": %s", val_to_str_ext(ext_tag_no, &tag_num_vals_eid_ext_ext, "Reserved (%d)"));
16751     } else {
16752       ti = proto_tree_add_item(orig_tree, hf_ieee80211_tag, tvb, offset, 2 + tag_len , ENC_NA);
16753       proto_item_append_text(ti, ": %s", val_to_str_ext(tag_no, &tag_num_vals_ext, "Reserved (%d)"));
16754     }
16755
16756     tree = proto_item_add_subtree(ti, ett_80211_mgt_ie);
16757
16758   }
16759
16760   if (tag_no == TAG_ELEMENT_ID_EXTENSION) {
16761     ext_tag_len = tag_len - 1;
16762     ti_tag = proto_tree_add_item(tree, hf_ieee80211_ext_tag_number, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
16763     ti_len = proto_tree_add_uint(tree, hf_ieee80211_ext_tag_length, tvb, offset + 1, 1, ext_tag_len);
16764   } else {
16765     ti_tag = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16766     ti_len = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
16767   }
16768   if (tag_len > (guint)tvb_reported_length_remaining(tvb, offset)) {
16769     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
16770                            "Tag Length is longer than remaining payload");
16771   }
16772
16773   /* If the list of valid elements is restricted, require an Element ID to be
16774    * present in that list. Otherwise stop decoding the value to prevent possible
16775    * infinite recursions due to unexpected elements. */
16776   if (valid_element_ids_count) {
16777     gboolean valid_tag_no = FALSE;
16778     guint i;
16779
16780     for (i = 0; i < valid_element_ids_count; i++) {
16781       valid_tag_no = valid_element_ids[i] == tag_no;
16782       if (valid_tag_no)
16783         break;
16784     }
16785     if (!valid_tag_no) {
16786       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_number,
16787           "Unexpected Element ID %d", tag_no);
16788         return tag_len + 1 + 1;
16789     }
16790   }
16791
16792   tag_tvb = tvb_new_subset_length(tvb, offset+2, tag_len);
16793   field_data.sanity_check = association_sanity_check;
16794   field_data.ftype = ftype;
16795   field_data.isDMG = isDMG;
16796   field_data.item_tag = ti;
16797   field_data.item_tag_length = ti_len;
16798   if (!dissector_try_uint_new(tagged_field_table, tag_no, tag_tvb, pinfo, tree, FALSE, &field_data))
16799   {
16800       proto_tree_add_item(tree, hf_ieee80211_tag_data, tvb, offset + 1 + 1, tag_len, ENC_NA);
16801       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_data,
16802                              "Dissector for 802.11 IE Tag"
16803                              " (%s) code not implemented, Contact"
16804                              " Wireshark developers if you want this supported", val_to_str_ext(tag_no,
16805                                             &tag_num_vals_ext, "(%d)"));
16806       proto_item_append_text(ti, ": Undecoded");
16807   }
16808
16809   return tag_len + 1 + 1;
16810 }
16811
16812 /* 7.3.2.12 Request information element (10) */
16813 static int
16814 ieee80211_tag_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
16815 {
16816   int tag_len = tvb_reported_length(tvb);
16817   int offset = 0;
16818
16819   while (offset < tag_len)
16820   {
16821     proto_tree_add_item(tree, hf_ieee80211_tag_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16822     offset += 1;
16823   }
16824   return ((tag_len > 0) ? tag_len : 1);
16825 }
16826
16827 /* 7.3.2.28 BSS Load element (11) */
16828 /* 8.4.2.30 in 802.11-2012 */
16829 static int
16830 ieee80211_tag_qbss_load(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16831 {
16832   int tag_len = tvb_reported_length(tvb);
16833   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16834   int offset = 0;
16835
16836   if ((tag_len < 4) || (tag_len > 5))
16837   {
16838     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);
16839     return tvb_captured_length(tvb);
16840   }
16841
16842   if (tag_len == 4)
16843   {
16844     /* QBSS Version 1 */
16845     proto_item_append_text(field_data->item_tag, " Cisco QBSS Version 1 - non CCA");
16846
16847     /* Extract Values */
16848     proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset, tag_len, 1);
16849     proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16850     proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
16851     proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
16852   }
16853   else if (tag_len == 5)
16854   {
16855     proto_item *base_item;
16856
16857     /* QBSS Version 2 */
16858     proto_item_append_text(field_data->item_tag, " 802.11e CCA Version");
16859
16860     /* Extract Values */
16861     proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset, tag_len, 2);
16862     proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16863     base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
16864     proto_item_append_text(base_item, " (%d%%)", 100*tvb_get_guint8(tvb, offset + 2)/255);
16865     base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 3, 2, ENC_LITTLE_ENDIAN);
16866     proto_item_append_text(base_item, " (%d us/s)", tvb_get_letohs(tvb, offset + 3)*32);
16867   }
16868
16869   return tvb_captured_length(tvb);
16870 }
16871
16872 /* 8.4.2.31 in 802-11-2012 */
16873 static int
16874 ieee80211_tag_edca_param_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16875 {
16876   int tag_len = tvb_reported_length(tvb);
16877   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16878   int offset = 0;
16879
16880   if ((tag_len != 18))
16881   {
16882     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 18", tag_len);
16883     return tvb_captured_length(tvb);
16884   }
16885
16886   decode_qos_parameter_set(tree, tvb, pinfo, offset, field_data->ftype);
16887
16888   return tvb_captured_length(tvb);
16889 }
16890
16891 /* TSPEC element (13) */
16892 static int
16893 ieee80211_tag_tspec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16894 {
16895   int tag_len = tvb_reported_length(tvb);
16896   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16897   int offset = 0;
16898
16899   if (field_data->isDMG == FALSE && tag_len != 55)
16900   {
16901     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 55", tag_len);
16902     return tvb_captured_length(tvb);
16903   }
16904   if (field_data->isDMG == TRUE && tag_len != 57)
16905   {
16906     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 57", tag_len);
16907     return tvb_captured_length(tvb);
16908   }
16909
16910   add_ff_qos_ts_info(tree, tvb, pinfo, offset);
16911   offset += 3;
16912
16913   proto_tree_add_item(tree, hf_ieee80211_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16914   offset += 2;
16915
16916   proto_tree_add_item(tree, hf_ieee80211_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16917   offset += 2;
16918
16919   proto_tree_add_item(tree, hf_ieee80211_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16920   offset += 4;
16921
16922   proto_tree_add_item(tree, hf_ieee80211_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16923   offset += 4;
16924
16925   proto_tree_add_item(tree, hf_ieee80211_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16926   offset += 4;
16927
16928   proto_tree_add_item(tree, hf_ieee80211_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16929   offset += 4;
16930
16931   proto_tree_add_item(tree, hf_ieee80211_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16932   offset += 4;
16933
16934   proto_tree_add_item(tree, hf_ieee80211_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16935   offset += 4;
16936
16937   proto_tree_add_item(tree, hf_ieee80211_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16938   offset += 4;
16939
16940   proto_tree_add_item(tree, hf_ieee80211_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16941   offset += 4;
16942
16943   proto_tree_add_item(tree, hf_ieee80211_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16944   offset += 4;
16945
16946   proto_tree_add_item(tree, hf_ieee80211_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16947   offset += 4;
16948
16949   proto_tree_add_item(tree, hf_ieee80211_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16950   offset += 4;
16951
16952   proto_tree_add_item(tree, hf_ieee80211_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16953   offset += 2;
16954
16955   proto_tree_add_item(tree, hf_ieee80211_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16956   offset += 2;
16957
16958   if(field_data->isDMG == TRUE) {
16959     proto_tree_add_item(tree, hf_ieee80211_tspec_dmg, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16960     /*offset +=2;*/
16961   }
16962
16963   return tvb_captured_length(tvb);
16964 }
16965
16966 /* 7.3.2.31 TCLAS element (14) */
16967 static int
16968 ieee80211_tag_tclas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16969 {
16970   int tag_len = tvb_reported_length(tvb);
16971   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16972   int offset = 0;
16973   guint8 type;
16974   guint8 version;
16975   static const int *ieee80211_tclas_class_mask0[] = {
16976     &hf_ieee80211_tclas_class_mask0_src_addr,
16977     &hf_ieee80211_tclas_class_mask0_dst_addr,
16978     &hf_ieee80211_tclas_class_mask0_type,
16979     NULL
16980   };
16981
16982   static const int *ieee80211_tclas_class_mask1[] = {
16983     &hf_ieee80211_tclas_class_mask1_ver,
16984     &hf_ieee80211_tclas_class_mask1_src_ip,
16985     &hf_ieee80211_tclas_class_mask1_dst_ip,
16986     &hf_ieee80211_tclas_class_mask1_src_port,
16987     &hf_ieee80211_tclas_class_mask1_dst_port,
16988     &hf_ieee80211_tclas_class_mask1_ipv6_flow,
16989     NULL
16990   };
16991
16992   static const int *ieee80211_tclas_class_mask1_4[] = {
16993     &hf_ieee80211_tclas_class_mask1_ver,
16994     &hf_ieee80211_tclas_class_mask1_src_ip,
16995     &hf_ieee80211_tclas_class_mask1_dst_ip,
16996     &hf_ieee80211_tclas_class_mask1_src_port,
16997     &hf_ieee80211_tclas_class_mask1_dst_port,
16998     &hf_ieee80211_tclas_class_mask1_ipv4_dscp,
16999     &hf_ieee80211_tclas_class_mask1_ipv4_proto,
17000     NULL
17001   };
17002
17003   static const int *ieee80211_tclas_class_mask2[] = {
17004     &hf_ieee80211_tclas_class_mask2_tci,
17005     NULL
17006   };
17007
17008   if (tag_len < 5)
17009   {
17010     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 5", tag_len);
17011     return 1;
17012   }
17013
17014   proto_tree_add_item(tree, hf_ieee80211_tclas_up, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17015   offset += 1;
17016
17017   type = tvb_get_guint8(tvb, offset);
17018   proto_tree_add_item(tree, hf_ieee80211_tclas_class_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17019   offset += 1;
17020
17021   switch (type)
17022   {
17023   case 0:
17024     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
17025                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask0,
17026                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17027     offset++;
17028
17029     proto_tree_add_item(tree, hf_ieee80211_tclas_src_mac_addr, tvb, offset, 6, ENC_NA);
17030     offset += 6;
17031
17032     proto_tree_add_item(tree, hf_ieee80211_tclas_dst_mac_addr, tvb, offset, 6, ENC_NA);
17033     offset += 6;
17034
17035     proto_tree_add_item(tree, hf_ieee80211_tclas_ether_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17036     /*offset += 2;*/
17037     break;
17038
17039   case 1:
17040     version = tvb_get_guint8(tvb, offset+1);
17041     if (version == 4) {
17042       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
17043                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask1_4,
17044                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17045     } else {
17046       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
17047                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask1,
17048                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17049     }
17050     offset += 1;
17051
17052     proto_tree_add_item(tree, hf_ieee80211_tclas_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17053     offset += 1;
17054     if (version == 4)
17055     {
17056       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
17057       offset += 4;
17058       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
17059       offset += 4;
17060       proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
17061       offset += 2;
17062       proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
17063       offset += 2;
17064       proto_tree_add_item(tree, hf_ieee80211_tclas_dscp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17065       offset += 1;
17066       proto_tree_add_item(tree, hf_ieee80211_tclas_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17067       /*offset += 1;*/
17068     }
17069     else if (version == 6)
17070     {
17071       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_src, tvb, offset, 16, ENC_NA);
17072       offset += 16;
17073       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_dst, tvb, offset, 16, ENC_NA);
17074       offset += 16;
17075       proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
17076       offset += 2;
17077       proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
17078       offset += 2;
17079       proto_tree_add_item(tree, hf_ieee80211_tclas_flow, tvb, offset, 3, ENC_BIG_ENDIAN);
17080       /*offset += 3;*/
17081     }
17082     break;
17083
17084   case 2:
17085     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
17086                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask2,
17087                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17088     offset++;
17089
17090     proto_tree_add_item(tree, hf_ieee80211_tclas_tag_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17091     /*offset += 2;*/
17092     break;
17093
17094   default:
17095     break;
17096   }
17097
17098   return tvb_captured_length(tvb);
17099 }
17100
17101 /* 7.3.2.34 Schedule element (15) */
17102 static int
17103 ieee80211_tag_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17104 {
17105   int tag_len = tvb_reported_length(tvb);
17106   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17107   int offset = 0;
17108   if (tag_len != 14)
17109   {
17110     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 14", tag_len);
17111     return 1;
17112   }
17113
17114   add_ff_schedule_info(tree, tvb, pinfo, offset);
17115   offset += 2;
17116
17117   proto_tree_add_item(tree, hf_ieee80211_sched_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17118   offset += 4;
17119
17120   proto_tree_add_item(tree, hf_ieee80211_sched_srv_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17121   offset += 4;
17122
17123   proto_tree_add_item(tree, hf_ieee80211_sched_spec_int, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17124   return tvb_captured_length(tvb);
17125 }
17126
17127 /* 7.3.2.8 Challenge Text element (16) */
17128 static int
17129 ieee80211_tag_challenge_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
17130 {
17131   int tag_len = tvb_reported_length(tvb);
17132   int offset = 0;
17133
17134   proto_tree_add_item(tree, hf_ieee80211_tag_challenge_text, tvb, offset, tag_len, ENC_NA);
17135
17136   return ((tag_len > 0) ? tag_len : 1);
17137 }
17138
17139 /* 7.3.2.15 Power Constraint element (32) */
17140 static int
17141 ieee80211_tag_power_constraint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17142 {
17143   int tag_len = tvb_reported_length(tvb);
17144   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17145   int offset = 0;
17146   if (tag_len != 1)
17147   {
17148     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
17149     return 1;
17150   }
17151
17152   proto_tree_add_item(tree, hf_ieee80211_tag_power_constraint_local, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17153   proto_item_append_text(field_data->item_tag, ": %d", tvb_get_guint8(tvb, offset));
17154   return tvb_captured_length(tvb);
17155 }
17156
17157 /* 7.3.2.16 Power Capability element (33) */
17158 static int
17159 ieee80211_tag_power_capability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17160 {
17161   int tag_len = tvb_reported_length(tvb);
17162   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17163   int offset = 0;
17164   if (tag_len != 2)
17165   {
17166     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
17167     return 1;
17168   }
17169
17170   proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_min, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17171   proto_item_append_text(field_data->item_tag, " Min: %d", tvb_get_gint8(tvb, offset));
17172   offset += 1;
17173
17174   proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_max, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17175   proto_item_append_text(field_data->item_tag, ", Max: %d", tvb_get_gint8(tvb, offset));
17176   return tvb_captured_length(tvb);
17177 }
17178
17179 /* 7.3.2.18 TPC Request element (34) */
17180 static int
17181 ieee80211_tag_tpc_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void* data)
17182 {
17183   int tag_len = tvb_reported_length(tvb);
17184   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17185   if (tag_len != 0)
17186   {
17187     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 0", tag_len);
17188     return 1; /* Even with no data, we can't return 0 */
17189   }
17190
17191   return 1; /* Even with no data, we can't return 0 */
17192 }
17193
17194 /* 7.3.2.18 TPC Report element (35) */
17195 static int
17196 ieee80211_tag_tpc_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17197 {
17198   int tag_len = tvb_reported_length(tvb);
17199   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17200   int offset = 0;
17201
17202   if (tag_len != 2)
17203   {
17204     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
17205     return 1;
17206   }
17207
17208   proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_trsmt_pow, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17209   proto_item_append_text(field_data->item_tag, " Transmit Power: %d", tvb_get_guint8(tvb, offset));
17210   offset += 1;
17211
17212   proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_link_mrg, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17213   proto_item_append_text(field_data->item_tag, ", Link Margin: %d", tvb_get_guint8(tvb, offset));
17214   return tvb_captured_length(tvb);
17215 }
17216
17217 /* 7.3.2.19 Supported Channels element (36) */
17218 static int
17219 ieee80211_tag_supported_channels(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17220 {
17221   int tag_len = tvb_reported_length(tvb);
17222   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17223   int offset = 0;
17224
17225   proto_item *chan_item;
17226   proto_tree *chan_tree;
17227   guint       i = 1;
17228
17229   if (tag_len % 2 == 1) {
17230     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u must be even", tag_len);
17231     return tvb_captured_length(tvb);
17232   }
17233
17234   while (offset < tag_len)
17235   {
17236     chan_item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_channels, tvb, offset, 2, ENC_NA);
17237     proto_item_append_text(chan_item, " #%d", i);
17238     i += 1;
17239
17240     chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
17241
17242     proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_first, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17243     proto_item_append_text(chan_item, " First: %d", tvb_get_guint8(tvb, offset));
17244     offset += 1;
17245
17246     proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_range, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17247     proto_item_append_text(chan_item, ", Range: %d ", tvb_get_guint8(tvb, offset));
17248     offset += 1;
17249
17250   }
17251   return tvb_captured_length(tvb);
17252 }
17253
17254 /* 7.3.2.20 Channel Switch Announcement element (37) */
17255 static int
17256 ieee80211_tag_switch_ann(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17257 {
17258   int tag_len = tvb_reported_length(tvb);
17259   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17260   int offset = 0;
17261   if (tag_len != 3)
17262   {
17263     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 3", tag_len);
17264     return 1;
17265   }
17266
17267   proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17268   proto_item_append_text(field_data->item_tag, " Mode: %d", tvb_get_guint8(tvb, offset));
17269   offset += 1;
17270
17271   proto_tree_add_item(tree, hf_ieee80211_csa_new_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17272   proto_item_append_text(field_data->item_tag, ", Number: %d ", tvb_get_guint8(tvb, offset));
17273   offset += 1;
17274
17275   proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17276   proto_item_append_text(field_data->item_tag, ", Count: %d ", tvb_get_guint8(tvb, offset));
17277   return tvb_captured_length(tvb);
17278 }
17279
17280 /* 7.3.2.21 Measurement Request element (38) with update from 802.11k-2008 */
17281 static int
17282 ieee80211_tag_measure_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17283 {
17284   int tag_len = tvb_reported_length(tvb);
17285   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17286   int offset = 0;
17287   guint8 request_type;
17288   proto_item *parent_item;
17289   proto_tree *sub_tree;
17290   static const int *ieee80211_tag_measure_request_mode[] = {
17291     &hf_ieee80211_tag_measure_request_mode_parallel,
17292     &hf_ieee80211_tag_measure_request_mode_enable,
17293     &hf_ieee80211_tag_measure_request_mode_request,
17294     &hf_ieee80211_tag_measure_request_mode_report,
17295     &hf_ieee80211_tag_measure_request_mode_duration_mandatory,
17296     &hf_ieee80211_tag_measure_request_mode_reserved,
17297     NULL
17298   };
17299
17300   if (tag_len < 3)
17301   {
17302     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
17303     return tvb_captured_length(tvb);
17304   }
17305   proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_token, tvb, offset, 1, ENC_NA);
17306   offset += 1;
17307
17308   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_request_mode,
17309                                     ett_tag_measure_request_mode_tree, ieee80211_tag_measure_request_mode,
17310                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17311   offset += 1;
17312
17313   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_type, tvb, offset, 1, ENC_NA);
17314   sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_type_tree);
17315   request_type = tvb_get_guint8(tvb, offset);
17316   offset += 1;
17317
17318   switch (request_type) {
17319     case 0: /* Basic Request */
17320     case 1: /* Clear channel assessment (CCA) request */
17321     case 2: /* Receive power indication (RPI) histogram request */
17322     {
17323       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17324       offset += 1;
17325
17326       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17327       offset += 8;
17328
17329       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17330       offset += 2;
17331       break;
17332     }
17333     case 3: /* Channel Load Request */
17334     {
17335       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
17336       offset += 1;
17337
17338       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17339       offset += 1;
17340
17341       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17342       offset += 2;
17343
17344       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17345       offset += 2;
17346
17347       while (offset < tag_len)
17348       {
17349         guint8 sub_id;
17350         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_id, tvb, offset, 1, ENC_NA);
17351         sub_id = tvb_get_guint8(tvb, offset);
17352         offset += 1;
17353
17354         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
17355         offset += 1;
17356
17357         switch (sub_id) {
17358           case MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO: /* Channel Load Reporting Information (1) */
17359             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition, tvb, offset, 1, ENC_NA);
17360             offset += 1;
17361             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref, tvb, offset, 1, ENC_NA);
17362             offset += 1;
17363             break;
17364           default:
17365             /* no default action */
17366             break;
17367           }
17368      }
17369      break;
17370    }
17371    case 4: /* Noise Histogram Request */
17372    {
17373      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
17374      offset += 1;
17375
17376      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17377      offset += 1;
17378
17379      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17380      offset += 2;
17381
17382      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17383      offset += 2;
17384
17385      while (offset < tag_len)
17386      {
17387        guint8 sub_id;
17388        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_id, tvb, offset, 1, ENC_NA);
17389        sub_id = tvb_get_guint8(tvb, offset);
17390        offset += 1;
17391
17392        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
17393        offset += 1;
17394
17395        switch (sub_id) {
17396          case MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO: /* Noise Histogram Reporting Information (1) */
17397            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition, tvb, offset, 1, ENC_NA);
17398            offset += 1;
17399            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref, tvb, offset, 1, ENC_NA);
17400            offset += 1;
17401            break;
17402          default:
17403            /* no default action */
17404            break;
17405        }
17406      }
17407      break;
17408    }
17409    case 5: /* Beacon Request */
17410    {
17411      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
17412      offset += 1;
17413
17414      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17415      offset += 1;
17416
17417      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17418      offset += 2;
17419
17420      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17421      offset += 2;
17422
17423      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_measurement_mode, tvb, offset, 1, ENC_NA);
17424      offset += 1;
17425
17426      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_bssid, tvb, offset, 6, ENC_NA);
17427      offset += 6;
17428
17429      while (offset < tag_len)
17430      {
17431        guint8 sub_id, sub_length, sub_tag_end;
17432        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_id, tvb, offset, 1, ENC_NA);
17433        sub_id = tvb_get_guint8(tvb, offset);
17434        offset += 1;
17435
17436        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
17437        sub_length = tvb_get_guint8(tvb, offset);
17438        offset += 1;
17439        sub_tag_end = offset + sub_length;
17440
17441        switch (sub_id) {
17442          case MEASURE_REQ_BEACON_SUB_SSID: /* SSID (0) */
17443            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_ssid, tvb, offset, sub_length, ENC_ASCII|ENC_NA);
17444            offset += sub_length;
17445            break;
17446          case MEASURE_REQ_BEACON_SUB_BRI: /* Beacon Reporting Information (1) */
17447            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17448            offset += 1;
17449            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17450            offset += 1;
17451            break;
17452          case MEASURE_REQ_BEACON_SUB_RD: /* Reporting Detail (2) */
17453            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17454            offset += 1;
17455            break;
17456          case MEASURE_REQ_BEACON_SUB_REQUEST: /* Request (10) */
17457            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17458            offset += 1;
17459            break;
17460          case MEASURE_REQ_BEACON_SUB_APCP: /* AP Channel Report (51) */
17461            /* TODO */
17462            break;
17463          default:
17464            /* no default action */
17465            break;
17466        }
17467        if (offset < sub_tag_end)
17468        {
17469          proto_item *tix;
17470          tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_unknown, tvb, offset, sub_tag_end - offset, ENC_NA);
17471          expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_beacon_unknown);
17472          offset = sub_tag_end;
17473        }
17474      }
17475
17476      break;
17477    }
17478    case 6: /* Frame Request */
17479    {
17480      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
17481      offset += 1;
17482
17483      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17484      offset += 1;
17485
17486      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17487      offset += 2;
17488
17489      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17490      offset += 2;
17491
17492      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_frame_request_type, tvb, offset, 1, ENC_NA);
17493      offset += 1;
17494
17495      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mac_address, tvb, offset, 6, ENC_NA);
17496      offset += 6;
17497
17498      /* TODO Add Optional Subelements */
17499      break;
17500    }
17501    case 7: /* BSTA Statistics Request */
17502    {
17503      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_peer_mac_address, tvb, offset, 6, ENC_NA);
17504      offset += 6;
17505
17506      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17507      offset += 2;
17508
17509      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17510      offset += 2;
17511
17512      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_group_id, tvb, offset, 1, ENC_NA);
17513      offset += 1;
17514
17515      /* TODO Add Optional Subelements */
17516      break;
17517    }
17518    case 8: /* Location Configuration Indication (LCI) Request */
17519     /* TODO */
17520    case 9: /* Transmit Stream Measurement Request */
17521     /* TODO */
17522    case 10: /* Multicast diagnostics request */
17523     /* TODO */
17524    case 11: /* Location Civic request */
17525     /* TODO */
17526    case 12: /* Location Identifier request */
17527     /* TODO */
17528    case 13: /* Directional channel quality request */
17529     /* TODO */
17530    case 14: /* Directional measurement request */
17531     /* TODO */
17532    case 15: /* Directional statistics request */
17533     /* TODO */
17534    case 255: /* Measurement Pause Request*/
17535     /* TODO */
17536    default: /* unknown */
17537     break;
17538   }
17539   if (offset < tag_len)
17540   {
17541     proto_item *tix;
17542     tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_unknown, tvb, offset, tag_len - offset, ENC_NA);
17543     expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_unknown);
17544   }
17545
17546   return tvb_captured_length(tvb);
17547 }
17548
17549 /* 7.3.2.22 Measurement Report element (39) with update from 802.11k-2008 */
17550 static int
17551 ieee80211_tag_measure_rep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17552 {
17553   int tag_len = tvb_reported_length(tvb);
17554   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17555   int offset = 0;
17556   proto_item *parent_item;
17557   proto_tree *sub_tree;
17558   guint8 report_type;
17559   static const int *ieee80211_tag_measure_report_mode[] = {
17560     &hf_ieee80211_tag_measure_report_mode_late,
17561     &hf_ieee80211_tag_measure_report_mode_incapable,
17562     &hf_ieee80211_tag_measure_report_mode_refused,
17563     &hf_ieee80211_tag_measure_report_mode_reserved,
17564     NULL
17565   };
17566   static const int *ieee80211_tag_measure_map_field[] = {
17567     &hf_ieee80211_tag_measure_map_field_bss,
17568     &hf_ieee80211_tag_measure_map_field_odfm,
17569     &hf_ieee80211_tag_measure_map_field_unident_signal,
17570     &hf_ieee80211_tag_measure_map_field_radar,
17571     &hf_ieee80211_tag_measure_map_field_unmeasured,
17572     &hf_ieee80211_tag_measure_map_field_reserved,
17573     NULL
17574   };
17575   static const int *ieee80211_tag_measure_report_frame_info[] = {
17576     &hf_ieee80211_tag_measure_report_frame_info_phy_type,
17577     &hf_ieee80211_tag_measure_report_frame_info_frame_type,
17578     NULL
17579   };
17580
17581   if (tag_len < 3)
17582   {
17583     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
17584     return tvb_captured_length(tvb);
17585   }
17586   proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_measurement_token, tvb, offset, 1, ENC_NA);
17587   offset += 1;
17588
17589   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_report_mode,
17590                                     ett_tag_measure_report_mode_tree, ieee80211_tag_measure_report_mode,
17591                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17592   offset += 1;
17593
17594   report_type = tvb_get_guint8(tvb, offset);
17595   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17596   sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_type_tree);
17597   offset += 1;
17598
17599   if (tag_len == 3)
17600     return tvb_captured_length(tvb);
17601
17602   switch (report_type) {
17603   case 0: /* Basic Report */
17604   {
17605     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17606     offset += 1;
17607
17608     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17609     offset += 8;
17610
17611     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17612     offset += 2;
17613
17614     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_basic_map_field,
17615                                     ett_tag_measure_report_basic_map_tree, ieee80211_tag_measure_map_field,
17616                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17617     break;
17618   }
17619   case 1: /* Clear channel assessment (CCA) report */
17620     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17621     offset += 1;
17622
17623     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17624     offset += 8;
17625
17626     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17627     offset += 2;
17628
17629     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_cca_busy_fraction, tvb, offset, 1, ENC_NA);
17630     offset += 1;
17631     break;
17632   case 2: /* Receive power indication (RPI) histogram report */
17633     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17634     offset += 1;
17635
17636     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17637     offset += 8;
17638
17639     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17640     offset += 2;
17641
17642     parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report, tvb, offset, 8, ENC_NA);
17643     sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_rpi_tree);
17644
17645     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_0, tvb, offset, 1, ENC_NA);
17646     offset += 1;
17647
17648     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_1, tvb, offset, 1, ENC_NA);
17649     offset += 1;
17650
17651     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_2, tvb, offset, 1, ENC_NA);
17652     offset += 1;
17653
17654     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_3, tvb, offset, 1, ENC_NA);
17655     offset += 1;
17656
17657     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_4, tvb, offset, 1, ENC_NA);
17658     offset += 1;
17659
17660     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_5, tvb, offset, 1, ENC_NA);
17661     offset += 1;
17662
17663     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_6, tvb, offset, 1, ENC_NA);
17664     offset += 1;
17665
17666     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_7, tvb, offset, 1, ENC_NA);
17667     offset += 1;
17668     break;
17669   case 3: /* Channel Load Report */
17670   {
17671     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
17672     offset += 1;
17673
17674     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17675     offset += 1;
17676
17677     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17678     offset += 8;
17679
17680     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17681     offset += 2;
17682
17683     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_load, tvb, offset, 1, ENC_NA);
17684     offset += 1;
17685
17686     /* TODO Add Optional Subelements */
17687     break;
17688   }
17689   case 4: /* Noise Histogram Report */
17690     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
17691     offset += 1;
17692
17693     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17694     offset += 1;
17695
17696     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17697     offset += 8;
17698
17699     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17700     offset += 2;
17701
17702     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
17703     offset += 1;
17704
17705     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_anpi, tvb, offset, 1, ENC_NA);
17706     offset += 1;
17707
17708     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_0, tvb, offset, 1, ENC_NA);
17709     offset += 1;
17710
17711     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_1, tvb, offset, 1, ENC_NA);
17712     offset += 1;
17713
17714     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_2, tvb, offset, 1, ENC_NA);
17715     offset += 1;
17716
17717     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_3, tvb, offset, 1, ENC_NA);
17718     offset += 1;
17719
17720     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_4, tvb, offset, 1, ENC_NA);
17721     offset += 1;
17722
17723     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_5, tvb, offset, 1, ENC_NA);
17724     offset += 1;
17725
17726     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_6, tvb, offset, 1, ENC_NA);
17727     offset += 1;
17728
17729     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_7, tvb, offset, 1, ENC_NA);
17730     offset += 1;
17731
17732     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_8, tvb, offset, 1, ENC_NA);
17733     offset += 1;
17734
17735     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_9, tvb, offset, 1, ENC_NA);
17736     offset += 1;
17737
17738     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_10, tvb, offset, 1, ENC_NA);
17739     offset += 1;
17740
17741     /* TODO Add Optional Subelements */
17742     break;
17743   case 5: /* Beacon Report */
17744   {
17745     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
17746     offset += 1;
17747
17748     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17749     offset += 1;
17750
17751     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17752     offset += 8;
17753
17754     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17755     offset += 2;
17756
17757     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_report_frame_info,
17758                                     ett_tag_measure_report_frame_tree, ieee80211_tag_measure_report_frame_info,
17759                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17760     offset += 1;
17761
17762     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rcpi, tvb, offset, 1, ENC_NA);
17763     offset += 1;
17764
17765     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rsni, tvb, offset, 1, ENC_NA);
17766     offset += 1;
17767
17768     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_bssid, tvb, offset, 6, ENC_NA);
17769     offset += 6;
17770
17771     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
17772     offset += 1;
17773
17774     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_parent_tsf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17775     offset += 4;
17776
17777     while (offset < tag_len)
17778     {
17779       guint8 sub_id, sub_length;
17780       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_beacon_sub_id, tvb, offset, 1, ENC_NA);
17781       sub_id = tvb_get_guint8(tvb, offset);
17782       offset += 1;
17783
17784       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_subelement_length, tvb, offset, 1, ENC_NA);
17785       sub_length = tvb_get_guint8(tvb, offset);
17786       offset += 1;
17787
17788       switch (sub_id) {
17789         case MEASURE_REP_REPORTED_FRAME_BODY: /* Reported Frame Body (1) */
17790         {
17791           proto_tree *rep_tree;
17792
17793           rep_tree = proto_tree_add_subtree(sub_tree, tvb, offset, sub_length, ett_tag_measure_reported_frame_tree, NULL, "Reported Frame Body");
17794
17795           add_ff_timestamp(rep_tree, tvb, pinfo, 0);
17796           add_ff_beacon_interval(rep_tree, tvb, pinfo, 8);
17797           add_ff_cap_info(rep_tree, tvb, pinfo, 10);
17798           offset += 12;
17799
17800           ieee_80211_add_tagged_parameters(tvb, offset, pinfo, rep_tree, sub_length - 12, MGT_PROBE_RESP, NULL);
17801           offset += (sub_length - 12);
17802         }
17803         break;
17804         default:
17805           /* no default action */
17806           break;
17807       }
17808     }
17809     break;
17810   }
17811   case 6: /* Frame Report */
17812     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
17813     offset += 1;
17814
17815     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17816     offset += 1;
17817
17818     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17819     offset += 8;
17820
17821     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17822     offset += 2;
17823
17824     /* TODO Add Optional Subelements */
17825     break;
17826   case 7: /* BSTA Statistics Report */
17827     /* TODO */
17828   case 8: /* Location Configuration Information Report element */
17829     /* TODO */
17830   case 9: /* Transmit Stream Measurement Report */
17831     /* TODO */
17832   case 10: /* Multicast diagnostics Report */
17833     /* TODO */
17834   case 11: /* Location Civic Report */
17835     /* TODO */
17836   case 12: /* Location Identifier Report */
17837     /* TODO */
17838   case 13: /* Directional channel quality Report */
17839     /* TODO */
17840   case 14: /* Directional measurement Report */
17841     /* TODO */
17842   case 15: /* Directional statistics Report */
17843     /* TODO */
17844   default: /* unknown */
17845     break;
17846   }
17847   if (offset < tag_len)
17848   {
17849     proto_item *tix;
17850     tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_unknown, tvb, offset, tag_len - offset, ENC_NA);
17851     expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_report_unknown);
17852   }
17853   return tvb_captured_length(tvb);
17854 }
17855
17856 /* 7.3.2.23 Quiet element (40) */
17857 static int
17858 ieee80211_tag_quiet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17859 {
17860   int tag_len = tvb_reported_length(tvb);
17861   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17862   int offset = 0;
17863   if (tag_len != 6)
17864   {
17865     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
17866     return tvb_captured_length(tvb);
17867   }
17868
17869   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_count, tvb, offset, 1, ENC_NA);
17870   proto_item_append_text(field_data->item_tag, " Count: %d", tvb_get_guint8(tvb, offset));
17871   offset += 1;
17872
17873   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_period, tvb, offset, 1, ENC_NA);
17874   proto_item_append_text(field_data->item_tag, " Period: %d", tvb_get_guint8(tvb, offset));
17875   offset += 1;
17876
17877   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17878   proto_item_append_text(field_data->item_tag, " Duration: %d", tvb_get_letohs(tvb, offset));
17879   offset += 2;
17880
17881   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17882   proto_item_append_text(field_data->item_tag, " Offset: %d", tvb_get_letohs(tvb, offset));
17883
17884   return tvb_captured_length(tvb);
17885 }
17886
17887 /* 7.3.2.24 IBSS DFS element (41) */
17888 static int
17889 ieee80211_tag_ibss_dfs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17890 {
17891   int tag_len = tvb_reported_length(tvb);
17892   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17893   int offset = 0;
17894   proto_item *ti_sup_map;
17895   proto_tree *sub_map_tree;
17896   if (tag_len < 7)
17897   {
17898     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 7", tag_len);
17899     return tvb_captured_length(tvb);
17900   }
17901
17902   proto_tree_add_item(tree, hf_ieee80211_tag_dfs_owner, tvb, offset, 6, ENC_NA);
17903   proto_item_append_text(field_data->item_tag, " Owner: %s", tvb_ether_to_str(tvb, offset));
17904   offset += 6;
17905
17906   proto_tree_add_item(tree, hf_ieee80211_tag_dfs_recovery_interval, tvb, offset, 1, ENC_NA);
17907   offset += 1;
17908
17909   while (offset < tag_len)
17910   {
17911     ti_sup_map = proto_tree_add_item(tree, hf_ieee80211_tag_dfs_channel_map, tvb, offset, 2, ENC_NA);
17912     sub_map_tree = proto_item_add_subtree(ti_sup_map, ett_tag_dfs_map_tree);
17913     proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_channel_number, tvb, offset, 1, ENC_NA);
17914     proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_map, tvb, offset, 1, ENC_NA);
17915     offset += 2;
17916   }
17917   return tvb_captured_length(tvb);
17918 }
17919
17920 /* 7.3.2.13 ERP Information element (42) */
17921 static int
17922 ieee80211_tag_erp_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17923 {
17924   int tag_len = tvb_reported_length(tvb);
17925   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17926   int offset = 0;
17927   static const int *ieee80211_tag_erp_info_flags[] = {
17928     &hf_ieee80211_tag_erp_info_erp_present,
17929     &hf_ieee80211_tag_erp_info_use_protection,
17930     &hf_ieee80211_tag_erp_info_barker_preamble_mode,
17931     &hf_ieee80211_tag_erp_info_reserved,
17932     NULL
17933   };
17934
17935   if (tag_len != 1)
17936   {
17937     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
17938     return tvb_captured_length(tvb);
17939   }
17940
17941   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_erp_info,
17942                                     ett_tag_erp_info_tree, ieee80211_tag_erp_info_flags,
17943                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17944
17945   return tvb_captured_length(tvb);
17946 }
17947
17948 /* 7.3.2.32 TS Delay element (43) */
17949 static int
17950 ieee80211_tag_ts_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17951 {
17952   int tag_len = tvb_reported_length(tvb);
17953   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17954   int offset = 0;
17955   if (tag_len != 4)
17956   {
17957     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
17958     return tvb_captured_length(tvb);
17959   }
17960
17961   proto_tree_add_item(tree, hf_ieee80211_ts_delay, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17962   proto_item_append_text(field_data->item_tag, " : %d", tvb_get_ntohl(tvb, offset));
17963   return tvb_captured_length(tvb);
17964 }
17965
17966 /* 7.3.2.33 TCLAS Processing element (44) */
17967 static int
17968 ieee80211_tag_tclas_process(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17969 {
17970   int tag_len = tvb_reported_length(tvb);
17971   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17972   int offset = 0;
17973   if (tag_len != 1)
17974   {
17975     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
17976     return tvb_captured_length(tvb);
17977   }
17978
17979   proto_tree_add_item(tree, hf_ieee80211_tclas_process, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17980   proto_item_append_text(field_data->item_tag, " : %s", val_to_str(tvb_get_guint8(tvb, offset), ieee80211_tclas_process_flag, "Unknown %d"));
17981   return tvb_captured_length(tvb);
17982 }
17983
17984 /* 802.11-2012 8.4.2.37 QoS Capability element (46) */
17985 static int
17986 ieee80211_tag_qos_capability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17987 {
17988   int tag_len = tvb_reported_length(tvb);
17989   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17990   int offset = 0;
17991   if (tag_len != 1)
17992   {
17993     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
17994     return tvb_captured_length(tvb);
17995   }
17996   dissect_qos_capability(tree, tvb, pinfo, offset, field_data->ftype);
17997   return tvb_captured_length(tvb);
17998 }
17999
18000 static int
18001 ieee80211_tag_rsn_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18002 {
18003   int tag_len = tvb_reported_length(tvb);
18004   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18005   int offset = 0;
18006   if (tag_len < 18)
18007   {
18008     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 18", tag_len);
18009     return tvb_captured_length(tvb);
18010   }
18011
18012   dissect_rsn_ie(pinfo, tree, tvb, offset, tag_len, field_data->sanity_check);
18013   return tvb_captured_length(tvb);
18014 }
18015
18016 /* 7.3.2.14 Extended Supported Rates element (50) */
18017 static int
18018 ieee80211_tag_ext_supp_rates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18019 {
18020   int tag_len = tvb_reported_length(tvb);
18021   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18022   int offset = 0;
18023   if (tag_len < 1)
18024   {
18025     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);
18026     return tvb_captured_length(tvb);
18027   }
18028
18029   while (offset < tag_len)
18030   {
18031     proto_tree_add_item(tree, hf_ieee80211_tag_ext_supp_rates, tvb, offset, 1, ENC_NA);
18032     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"));
18033     offset += 1;
18034   }
18035   proto_item_append_text(field_data->item_tag, " [Mbit/sec]");
18036   return tvb_captured_length(tvb);
18037 }
18038
18039 static int
18040 ieee80211_tag_cisco_ccx1_ckip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18041 {
18042   int tag_len = tvb_reported_length(tvb);
18043   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18044   int offset = 0;
18045   /* From WCS manual:
18046    * If Aironet IE support is enabled, the access point sends an Aironet
18047    * IE 0x85 (which contains the access point name, load, number of
18048    * associated clients, and so on) in the beacon and probe responses of
18049    * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
18050    * (which contains the management IP address of the controller and
18051    * the IP address of the access point) in the reassociation response
18052    * if it receives Aironet IE 0x85 in the reassociation request.
18053    */
18054
18055   if (tag_len < 26)
18056   {
18057     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u too short, must be >= 26", tag_len);
18058     return tvb_captured_length(tvb);
18059   }
18060   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown, tvb, offset, 10, ENC_NA);
18061   offset += 10;
18062
18063   /* The Name of the sending device starts at offset 10 and is up to
18064      15 or 16 bytes in length, \0 padded */
18065   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_name, tvb, offset, 16, ENC_ASCII|ENC_NA);
18066   offset += 16;
18067
18068   /* Total number off associated clients and repeater access points */
18069   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_clients, tvb, offset, 1, ENC_NA);
18070   offset += 1;
18071   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown2, tvb, offset, 3, ENC_NA);
18072   return tvb_captured_length(tvb);
18073 }
18074
18075 static int
18076 ieee80211_tag_vendor_specific_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18077 {
18078   int tag_len = tvb_reported_length(tvb);
18079   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18080   int offset = 0;
18081   guint32 tag_vs_len = tag_len;
18082   guint32       oui;
18083
18084   if (tag_len < 3)
18085   {
18086     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len);
18087     return tvb_captured_length(tvb);
18088   }
18089
18090   proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
18091   proto_item_append_text(field_data->item_tag, ": %s", uint_get_manuf_name_if_known(oui));
18092   offset += 3;
18093   tag_vs_len -= 3;
18094
18095   if (tag_len > 0) {
18096     proto_tree_add_item(field_data->item_tag, hf_ieee80211_tag_vendor_oui_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18097   }
18098
18099   switch (oui) {
18100     /* 802.11 specific vendor ids */
18101     case OUI_WPAWME:
18102       dissect_vendor_ie_wpawme(tree, tvb, pinfo, offset, tag_vs_len, field_data->ftype);
18103       break;
18104     case OUI_RSN:
18105       dissect_vendor_ie_rsn(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18106       break;
18107     case OUI_PRE11N:
18108       dissect_vendor_ie_ht(tvb, pinfo, tree, offset, field_data->item_tag, field_data->item_tag_length, tag_vs_len);
18109       break;
18110     case OUI_WFA:
18111       dissect_vendor_ie_wfa(pinfo, field_data->item_tag, tvb);
18112       break;
18113
18114     /* Normal IEEE vendor ids (from oui.h) */
18115     case OUI_CISCOWL:  /* Cisco Wireless (Aironet) */
18116       dissect_vendor_ie_aironet(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18117       break;
18118     case OUI_MARVELL:
18119       dissect_vendor_ie_marvell(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18120       break;
18121     case OUI_ATHEROS:
18122       dissect_vendor_ie_atheros(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo, field_data->item_tag_length);
18123       break;
18124     case OUI_ARUBA:
18125       dissect_vendor_ie_aruba(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18126       break;
18127     case OUI_NINTENDO:
18128       dissect_vendor_ie_nintendo(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18129       break;
18130     case OUI_MIKROTIK:
18131       dissect_vendor_ie_mikrotik(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18132       break;
18133     case OUI_MERU:
18134       dissect_vendor_ie_meru(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
18135       break;
18136     case OUI_ZEBRA_EXTREME:
18137       dissect_vendor_ie_extreme(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
18138       break;
18139     default:
18140       proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA);
18141       break;
18142   }
18143
18144   return tvb_captured_length(tvb);
18145 }
18146
18147 #define HE_HTC_HE_SUPPORT                0x00000001
18148 #define HE_FRAGMENTATION_SUPPORT         0x00000018
18149 #define HE_ALL_ACK_SUPPORT               0x00000200
18150 #define HE_UMRS_SUPPORT                  0x00000400
18151 #define HE_BSR_SUPPORT                   0x00000800
18152
18153 static const val64_string he_fragmentation_support_vals[] = {
18154   { 0, "No support for dynamic fragmentation" },
18155   { 1, "Support for dynamic fragments in MPDUs or S-MPDUs" },
18156   { 2, "Support for dynamic fragments in MPDUs and S-MPDUs and up to 1 dyn frag in MSDUs..." },
18157   { 3, "Support for all types of dynamic fragments" },
18158   { 0, NULL }
18159 };
18160
18161 static const val64_string he_minimum_fragmentation_size_vals[] = {
18162   { 0, "No restriction on minimum payload size" },
18163   { 1, "Minimum payload size of 128 bytes" },
18164   { 2, "Minimum payload size of 256 bytes" },
18165   { 3, "Minimum payload size of 512 bytes" },
18166   { 0, NULL }
18167 };
18168
18169 static const val64_string he_link_adaptation_support_vals[] = {
18170   { 0, "No feedback if the STA does not provide HE MFB" },
18171   { 1, "Reserved" },
18172   { 2, "Unsolicited if the STA can receive and provide only unsolicited HE MFB" },
18173   { 3, "Both" },
18174   { 0, NULL }
18175 };
18176
18177 static const int *he_mac_headers[] = {
18178   &hf_he_htc_he_support,                           /* 0 */
18179   &hf_he_twt_requester_support,                    /* 1 */
18180   &hf_he_twt_responder_support,                    /* 2 */
18181   &hf_he_fragmentation_support,                    /* 3 */
18182   &hf_he_max_number_fragmented_msdus,              /* 4 */
18183   &hf_he_min_fragment_size,                        /* 5 */
18184   &hf_he_trigger_frame_mac_padding_dur,            /* 6 */
18185   &hf_he_multi_tid_aggregation_support,            /* 7 */
18186   &hf_he_he_link_adaptation_support,               /* 8 */
18187   &hf_he_all_ack_support,                          /* 9 */
18188   &hf_he_umrs_support,                             /* 10 */
18189   &hf_he_bsr_support,                              /* 11 */
18190   &hf_he_broadcast_twt_support,                    /* 12 */
18191   &hf_he_32_bit_ba_bitmap_support,                 /* 13 */
18192   &hf_he_mu_cascading_support,                     /* 14 */
18193   &hf_he_ack_enabled_aggregation_support,          /* 15 */
18194   &hf_he_group_addressed_multi_sta_blkack_support, /* 16 */
18195   &hf_he_om_control_support,                       /* 17 */
18196   &hf_he_ofdma_ra_support,                         /* 18 */
18197   &hf_he_max_a_mpdu_length_exponent,               /* 19 */
18198   &hf_he_a_msdu_fragmentation_support,             /* 20 */
18199   &hf_he_flexible_twt_schedule_support,            /* 21 */
18200   &hf_he_rx_control_frame_to_multibss,             /* 22 */
18201   &hf_he_bsrp_bqrp_a_mpdu_aggregation,             /* 23 */
18202   &hf_he_qtp_support,                              /* 24 */
18203   &hf_he_bqr_support,                              /* 25 */
18204   &hf_he_sr_responder,                             /* 26 */
18205   &hf_he_ndp_feedback_report_support,              /* 27 */
18206   &hf_he_ops_support,                              /* 28 */
18207   &hf_he_a_msdu_in_a_mpdu_support,                 /* 29 */
18208   &hf_he_reserved,                                 /* 30 */
18209   NULL
18210 };
18211
18212 static const int *he_phy_first_byte_headers[] = {
18213   &hf_he_phy_cap_dual_band_support,
18214   NULL,
18215 };
18216
18217 static const int *he_phy_channel_width_set_headers[] _U_ = {
18218   &hf_he_40mhz_channel_2_4ghz,
18219   &hf_he_40_and_80_mhz_5ghz,
18220   &hf_he_160_mhz_5ghz,
18221   &hf_he_160_80_plus_80_mhz_5ghz,
18222   &hf_he_242_tone_rus_in_2_4ghz,
18223   &hf_he_242_tone_rus_in_5ghz,
18224   &hf_he_chan_width_reserved,
18225   NULL
18226 };
18227
18228 static const int *he_phy_b8_to_b23_headers[] = {
18229   &hf_he_phy_cap_punctured_preamble_rx,
18230   &hf_he_phy_cap_device_class,
18231   &hf_he_phy_cap_ldpc_coding_in_payload,
18232   &hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us,
18233   &hf_he_phy_cap_midamble_rx_max_nsts,
18234   &hf_he_phy_cap_ndp_with_4x_he_ltf_32us,
18235   &hf_he_phy_cap_stbc_tx_lt_80mhz,
18236   &hf_he_phy_cap_stbc_rx_lt_80mhz,
18237   &hf_he_phy_cap_doppler_tx,
18238   &hf_he_phy_cap_doppler_rx,
18239   &hf_he_phy_cap_full_bw_ul_mu_mimo,
18240   &hf_he_phy_cap_partial_bw_ul_mu_mimo,
18241   NULL
18242 };
18243
18244 static const int *he_phy_b24_to_b39_headers[] = {
18245   &hf_he_phy_cap_dcm_max_constellation_tx,
18246   &hf_he_phy_cap_dcm_max_nss_tx,
18247   &hf_he_phy_cap_dcm_max_constellation_rx,
18248   &hf_he_phy_cap_dcm_max_nss_rx,
18249   &hf_he_phy_cap_rx_he_muppdu_from_non_ap,
18250   &hf_he_phy_cap_su_beamformer,
18251   &hf_he_phy_cap_su_beamformee,
18252   &hf_he_phy_cap_mu_beamformer,
18253   &hf_he_phy_cap_beamformer_sts_lte_80mhz,
18254   &hf_he_phy_cap_beamformer_sts_gt_80mhz,
18255   NULL
18256 };
18257
18258 static const int *he_phy_b40_to_b55_headers[] = {
18259   &hf_he_phy_cap_number_of_sounding_dims_lte_80,
18260   &hf_he_phy_cap_number_of_sounding_dims_gt_80,
18261   &hf_he_phy_cap_ng_eq_16_su_fb,
18262   &hf_he_phy_cap_ng_eq_16_mu_fb,
18263   &hf_he_phy_cap_codebook_size_eq_4_2_fb,
18264   &hf_he_phy_cap_codebook_size_eq_7_5_fb,
18265   &hf_he_phy_cap_triggered_su_beamforming_fb,
18266   &hf_he_phy_cap_triggered_mu_beamforming_fb,
18267   &hf_he_phy_cap_triggered_cqi_fb,
18268   &hf_he_phy_cap_partial_bw_extended_range,
18269   &hf_he_phy_cap_partial_bw_dl_mu_mimo,
18270   &hf_he_phy_cap_ppe_threshold_present,
18271   NULL
18272 };
18273
18274 static const int *he_phy_b56_to_b71_headers[] = {
18275   &hf_he_phy_cap_srp_based_sr_support,
18276   &hf_he_phy_cap_power_boost_factor_ar_support,
18277   &hf_he_phy_cap_he_su_ppdu_etc_gi,
18278   &hf_he_phy_cap_max_nc,
18279   &hf_he_phy_cap_stbc_tx_gt_80_mhz,
18280   &hf_he_phy_cap_stbc_rx_gt_80_mhz,
18281   &hf_he_phy_cap_he_er_su_ppdu_4xxx_gi,
18282   &hf_he_phy_cap_20mhz_in_40mhz_24ghz_band,
18283   &hf_he_phy_cap_20mhz_in_160_80p80_ppdu,
18284   &hf_he_phy_cap_80mgz_in_160_80p80_ppdu,
18285   &hf_he_phy_cap_he_er_su_ppdu_1xxx_gi,
18286   &hf_he_phy_cap_midamble_rx_2x_xxx_ltf,
18287   &hf_he_phy_cap_b70_b71_reserved,
18288   NULL
18289 };
18290
18291 static const int *he_mcs_map_80_rx_headers [] = {
18292   &hf_he_mcs_max_he_mcs_80_rx_1_ss,
18293   &hf_he_mcs_max_he_mcs_80_rx_2_ss,
18294   &hf_he_mcs_max_he_mcs_80_rx_3_ss,
18295   &hf_he_mcs_max_he_mcs_80_rx_4_ss,
18296   &hf_he_mcs_max_he_mcs_80_rx_5_ss,
18297   &hf_he_mcs_max_he_mcs_80_rx_6_ss,
18298   &hf_he_mcs_max_he_mcs_80_rx_7_ss,
18299   &hf_he_mcs_max_he_mcs_80_rx_8_ss,
18300   NULL
18301 };
18302
18303 static const int *he_mcs_map_80_tx_headers [] = {
18304   &hf_he_mcs_max_he_mcs_80_tx_1_ss,
18305   &hf_he_mcs_max_he_mcs_80_tx_2_ss,
18306   &hf_he_mcs_max_he_mcs_80_tx_3_ss,
18307   &hf_he_mcs_max_he_mcs_80_tx_4_ss,
18308   &hf_he_mcs_max_he_mcs_80_tx_5_ss,
18309   &hf_he_mcs_max_he_mcs_80_tx_6_ss,
18310   &hf_he_mcs_max_he_mcs_80_tx_7_ss,
18311   &hf_he_mcs_max_he_mcs_80_tx_8_ss,
18312   NULL
18313 };
18314
18315 static const int *he_mcs_map_80p80_rx_headers [] = {
18316   &hf_he_mcs_max_he_mcs_80p80_rx_1_ss,
18317   &hf_he_mcs_max_he_mcs_80p80_rx_2_ss,
18318   &hf_he_mcs_max_he_mcs_80p80_rx_3_ss,
18319   &hf_he_mcs_max_he_mcs_80p80_rx_4_ss,
18320   &hf_he_mcs_max_he_mcs_80p80_rx_5_ss,
18321   &hf_he_mcs_max_he_mcs_80p80_rx_6_ss,
18322   &hf_he_mcs_max_he_mcs_80p80_rx_7_ss,
18323   &hf_he_mcs_max_he_mcs_80p80_rx_8_ss,
18324   NULL
18325 };
18326
18327 static const int *he_mcs_map_80p80_tx_headers [] = {
18328   &hf_he_mcs_max_he_mcs_80p80_tx_1_ss,
18329   &hf_he_mcs_max_he_mcs_80p80_tx_2_ss,
18330   &hf_he_mcs_max_he_mcs_80p80_tx_3_ss,
18331   &hf_he_mcs_max_he_mcs_80p80_tx_4_ss,
18332   &hf_he_mcs_max_he_mcs_80p80_tx_5_ss,
18333   &hf_he_mcs_max_he_mcs_80p80_tx_6_ss,
18334   &hf_he_mcs_max_he_mcs_80p80_tx_7_ss,
18335   &hf_he_mcs_max_he_mcs_80p80_tx_8_ss,
18336   NULL
18337 };
18338
18339 static const int *he_mcs_map_160_rx_headers [] = {
18340   &hf_he_mcs_max_he_mcs_160_rx_1_ss,
18341   &hf_he_mcs_max_he_mcs_160_rx_2_ss,
18342   &hf_he_mcs_max_he_mcs_160_rx_3_ss,
18343   &hf_he_mcs_max_he_mcs_160_rx_4_ss,
18344   &hf_he_mcs_max_he_mcs_160_rx_5_ss,
18345   &hf_he_mcs_max_he_mcs_160_rx_6_ss,
18346   &hf_he_mcs_max_he_mcs_160_rx_7_ss,
18347   &hf_he_mcs_max_he_mcs_160_rx_8_ss,
18348   NULL
18349 };
18350
18351 static const int *he_mcs_map_160_tx_headers [] = {
18352   &hf_he_mcs_max_he_mcs_160_tx_1_ss,
18353   &hf_he_mcs_max_he_mcs_160_tx_2_ss,
18354   &hf_he_mcs_max_he_mcs_160_tx_3_ss,
18355   &hf_he_mcs_max_he_mcs_160_tx_4_ss,
18356   &hf_he_mcs_max_he_mcs_160_tx_5_ss,
18357   &hf_he_mcs_max_he_mcs_160_tx_6_ss,
18358   &hf_he_mcs_max_he_mcs_160_tx_7_ss,
18359   &hf_he_mcs_max_he_mcs_160_tx_8_ss,
18360   NULL
18361 };
18362
18363 static const value_string ru_alloc_vals[] = {
18364   { 0, "242" },
18365   { 1, "484" },
18366   { 2, "996" },
18367   { 3, "2x996" },
18368   { 0, NULL }
18369 };
18370
18371 static const value_string constellation_vals[] = {
18372   { 0, "BPSK" },
18373   { 1, "QPSK" },
18374   { 2, "16-QAM" },
18375   { 3, "64-QAM" },
18376   { 4, "256-QAM" },
18377   { 5, "1024-QAM" },
18378   { 6, "Reserved" },
18379   { 7, "None" },
18380   { 0, NULL }
18381 };
18382
18383 #define HE_CHANNEL_WIDTH_SET_B2 0x04
18384 #define HE_CHANNEL_WIDTH_SET_B3 0x08
18385
18386 static void
18387 dissect_he_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
18388   int offset, int len)
18389 {
18390   guint64 he_mac_caps = tvb_get_letoh40(tvb, offset);
18391   guint8 phy_channel_width_set = 0;
18392   proto_tree *phy_cap_tree = NULL;
18393   guint he_mcs_and_nss_len = 4;
18394   proto_tree *sup_he_mcs_and_nss_tree = NULL;
18395   proto_tree *rx_tx_he_mcs_map_80 = NULL;
18396   proto_tree *rx_tx_he_mcs_map_160 = NULL;
18397   proto_tree *rx_tx_he_mcs_map_80_80 = NULL;
18398
18399   /* Change some header fields depending on HE_HTC_HE_SUPPORT and FRAGMENTATION */
18400   if (!(he_mac_caps & HE_HTC_HE_SUPPORT)) {
18401     he_mac_headers[8] = &hf_he_reserved_bits_15_16;
18402     he_mac_headers[10] = &hf_he_reserved_bit_18;
18403     he_mac_headers[11] = &hf_he_reserved_bit_19;
18404     he_mac_headers[17] = &hf_he_reserved_bit_25;
18405   }
18406   if (!(he_mac_caps & HE_FRAGMENTATION_SUPPORT)) {
18407     he_mac_headers[4] = &hf_he_reserved_bits_5_7;
18408     he_mac_headers[5] = &hf_he_reserved_bits_8_9;
18409   }
18410
18411   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_mac_capabilities,
18412                         ett_he_mac_capabilities, he_mac_headers,
18413                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18414   offset += 5;
18415
18416   /* Get and isolate the phy channel witdth set */
18417   phy_channel_width_set = tvb_get_guint8(tvb, offset) >> 1;
18418   phy_cap_tree = proto_tree_add_subtree(tree, tvb, offset, 9, ett_he_phy_capabilities,
18419                         NULL,
18420                         "HE Phy Capabilities Information");
18421   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18422                         hf_he_phy_dual_band_support, ett_he_phy_cap_first_byte,
18423                         he_phy_first_byte_headers, ENC_NA, BMT_NO_APPEND);
18424   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18425                         hf_he_phy_chan_width_set,  ett_he_phy_cap_chan_width_set,
18426                         he_phy_channel_width_set_headers, ENC_NA, BMT_NO_APPEND);
18427   offset++;
18428   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18429                         hf_he_phy_b8_to_b23, ett_he_phy_cap_b8_to_b23,
18430                         he_phy_b8_to_b23_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18431   offset += 2;
18432   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18433                         hf_he_phy_b24_to_b39, ett_he_phy_cap_b24_to_b39,
18434                         he_phy_b24_to_b39_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18435   offset += 2;
18436   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18437                         hf_he_phy_b40_to_b55, ett_he_phy_cap_b40_to_b55,
18438                         he_phy_b40_to_b55_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18439   offset += 2;
18440   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18441                         hf_he_phy_b56_to_b71, ett_he_phy_cap_b56_to_b71,
18442                         he_phy_b56_to_b71_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18443   offset += 2;
18444
18445   /* Need the length first */
18446   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B2)
18447     he_mcs_and_nss_len += 4;
18448
18449   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B3)
18450     he_mcs_and_nss_len += 4;
18451
18452   sup_he_mcs_and_nss_tree = proto_tree_add_subtree(tree, tvb, offset,
18453                         he_mcs_and_nss_len, ett_he_mcs_and_nss_set, NULL,
18454                         "Tx Rx HE-MCS NSS Support");
18455   rx_tx_he_mcs_map_80 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree, tvb,
18456                         offset, 4, ett_he_rx_tx_he_mcs_map_lte_80, NULL,
18457                         "Rx and Tx MCS Maps <= 80 MHz");
18458   proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80, tvb, offset,
18459                         hf_he_rx_he_mcs_map_lte_80,
18460                         ett_he_rx_mcs_map_lte_80, he_mcs_map_80_rx_headers,
18461                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18462   offset += 2;
18463   proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80, tvb, offset,
18464                         hf_he_tx_he_mcs_map_lte_80,
18465                         ett_he_tx_mcs_map_lte_80, he_mcs_map_80_tx_headers,
18466                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18467   offset += 2;
18468
18469   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B2) {
18470     rx_tx_he_mcs_map_160 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree,
18471                         tvb, offset, 4, ett_he_rx_tx_he_mcs_map_160, NULL,
18472                         "Rx and Tx MCS Maps 160 MHz");
18473     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_160, tvb, offset,
18474                         hf_he_rx_he_mcs_map_160,
18475                         ett_he_rx_mcs_map_160, he_mcs_map_160_rx_headers,
18476                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18477     offset += 2;
18478     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_160, tvb, offset,
18479                         hf_he_tx_he_mcs_map_160,
18480                         ett_he_tx_mcs_map_160, he_mcs_map_160_tx_headers,
18481                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18482     offset += 2;
18483   }
18484
18485   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B3) {
18486     rx_tx_he_mcs_map_80_80 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree,
18487                         tvb, offset, 4, ett_he_rx_tx_he_mcs_map_80_80, NULL,
18488                         "Rx and Tx MCS Maps 80+80 MHz");
18489     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80_80, tvb, offset,
18490                         hf_he_rx_he_mcs_map_80_80,
18491                         ett_he_rx_mcs_map_80_80, he_mcs_map_80p80_rx_headers,
18492                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18493     offset += 2;
18494     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80_80, tvb, offset,
18495                         hf_he_tx_he_mcs_map_80_80,
18496                         ett_he_tx_mcs_map_80_80, he_mcs_map_80p80_tx_headers,
18497                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18498     offset += 2;
18499   }
18500
18501   if (offset < len) {
18502     guint8 ppe_thresholds_field = tvb_get_guint8(tvb, offset);
18503     guint8 nss_count = ppe_thresholds_field & 0x07, nss_index = 0;
18504     guint8 ru_index_bitmask = (ppe_thresholds_field >> 3) & 0x0F;
18505     proto_tree *ppe_tree = NULL;
18506     int i = 0;
18507     int bit_offset = 7;  /* How many bits we are into the bytes */
18508
18509     ppe_tree = proto_tree_add_subtree(tree, tvb, offset, len - offset + 1,
18510                         ett_he_ppe_threshold, NULL,
18511                         "PPE Thresholds");
18512     proto_tree_add_item(ppe_tree, hf_he_ppe_thresholds_nss, tvb, offset,
18513                         1, ENC_NA);
18514     proto_tree_add_item(ppe_tree, hf_he_ppe_thresholds_ru_index_bitmask, tvb,
18515                         offset, 1, ENC_NA);
18516
18517     /*
18518      * Now, for each of the nss values, add a sub-tree with its thresholds.
18519      * The actual count is one more than the number in the first three bits.
18520      */
18521     while (nss_index < nss_count + 1) {
18522       int start_offset = 0;
18523       proto_tree *nss_tree = NULL;
18524       proto_item *nssti = NULL;
18525       guint8 l_ru_bitmask = ru_index_bitmask;
18526
18527       nss_tree = proto_tree_add_subtree_format(ppe_tree, tvb, offset, -1,
18528                         ett_he_ppe_nss, &nssti, "NSS %d", nss_index);
18529       start_offset = offset;
18530
18531       for (i = 0; i < 4; i++) {
18532         if (l_ru_bitmask & 0x01) {
18533           int bits_avail = 8 - bit_offset, bits_needed = 6 - bits_avail;
18534           guint8 the_bits = 0;
18535           int ru_start_offset = offset;
18536           proto_tree *ru_alloc_tree = NULL;
18537           proto_item *rualti = NULL;
18538
18539           ru_alloc_tree = proto_tree_add_subtree_format(nss_tree, tvb, offset,
18540                                         -1, ett_he_ppe_ru_alloc, &rualti,
18541                                         "RU allocation: %s",
18542                                         val_to_str(i, ru_alloc_vals, "Unk"));
18543
18544           /*
18545            * Assemble the bits we require ... we need 6, or 2x3
18546            */
18547           if (bits_avail >= 6) { /* We can use the current byte */
18548             the_bits = (tvb_get_guint8(tvb, offset) >> bit_offset) & 0x3F;
18549           } else { /* We need two adjacent bytes */
18550             the_bits = (tvb_get_guint8(tvb, offset) >> bit_offset);
18551             offset++;
18552             the_bits = the_bits |
18553                         ((tvb_get_guint8(tvb, offset) &
18554                                 ((1 << bits_needed) - 1)) << bits_avail);
18555           }
18556           /*
18557            * Now we have two three bit fields, use them.
18558            */
18559           proto_tree_add_uint(ru_alloc_tree, hf_he_ppe_ppet16, tvb, ru_start_offset,
18560                               offset - ru_start_offset + 1, the_bits & 0x07);
18561           proto_tree_add_uint(ru_alloc_tree, hf_he_ppe_ppet8, tvb, ru_start_offset,
18562                               offset - ru_start_offset + 1, the_bits >> 3);
18563
18564           bit_offset = (bit_offset + 6) % 8;
18565           proto_item_set_len(rualti, offset - ru_start_offset + 1);
18566         }
18567         l_ru_bitmask = l_ru_bitmask >> 1;
18568       }
18569
18570
18571       proto_item_set_len(nssti, offset - start_offset);
18572       nss_index++;
18573     }
18574   }
18575
18576   /* Add an Expert Info about extra bytes ... */
18577
18578 }
18579
18580 static const int *he_operation_headers[] = {
18581   &hf_he_operation_bss_color,
18582   &hf_he_operation_default_pe_duration,
18583   &hf_he_operation_twt_required,
18584   &hf_he_operation_txop_duration_rts_threshold,
18585   &hf_he_operation_partial_bss_color,
18586   &hf_he_operation_vht_operation_information_present,
18587   &hf_he_operation_reserved_b22_b27,
18588   &hf_he_operation_multiple_bssid_ap,
18589   &hf_he_operation_txbssid_indicator,
18590   &hf_he_operation_bss_color_disabled,
18591   &hf_he_operation_reserved_b31,
18592   NULL
18593 };
18594
18595 static const value_string he_mcs_map_vals[] = {
18596   { 0, "Support for HE-MCS 0-7" },
18597   { 1, "Support for HE-MCS 0-9" },
18598   { 2, "Support for HE-MCS 0-11" },
18599   { 3, "Not supported for HE PPDUs" },
18600   { 0, NULL }
18601 };
18602
18603 static const int *he_basic_he_mcs_header[] = {
18604   &hf_he_oper_max_he_mcs_for_1_ss,
18605   &hf_he_oper_max_he_mcs_for_2_ss,
18606   &hf_he_oper_max_he_mcs_for_3_ss,
18607   &hf_he_oper_max_he_mcs_for_4_ss,
18608   &hf_he_oper_max_he_mcs_for_5_ss,
18609   &hf_he_oper_max_he_mcs_for_6_ss,
18610   &hf_he_oper_max_he_mcs_for_7_ss,
18611   &hf_he_oper_max_he_mcs_for_8_ss,
18612   NULL
18613 };
18614
18615 #define VHT_OPERATION_INFORMATION_PRESENT 0x00200000
18616 #define MULTIPLE_BSSID_AP                 0x10000000
18617
18618 static const value_string channel_width_vals[] = {
18619   { 0, "20 MHz or 40 MHz BSS Bandwidth" },
18620   { 1, "80 MHz, 160 MHz or 80+80 MHz BSS Bandwidth" },
18621   { 2, "160 MHz BSS Bandwidth (deprecated)" },
18622   { 3, "Non-contiguous 80+80 MHz BSS Bandwidth (deprecated)" },
18623   { 0, NULL }
18624 };
18625
18626 static void
18627 dissect_he_operation(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
18628   int offset, int len _U_)
18629 {
18630     guint32 op_params = tvb_get_letohl(tvb, offset);
18631
18632     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18633                         hf_he_operation_parameter, ett_he_operation_params,
18634                         he_operation_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18635     offset += 4;
18636
18637     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18638                         hf_he_operation_basic_mcs, ett_he_oper_basic_mcs,
18639                         he_basic_he_mcs_header, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18640     offset += 2;
18641
18642     if (op_params & VHT_OPERATION_INFORMATION_PRESENT) {
18643       proto_tree *vht_op_info = NULL;
18644       proto_item *pi = NULL;
18645
18646       vht_op_info = proto_tree_add_subtree(tree, tvb, offset, 3,
18647                         ett_he_operation_vht_op_info, NULL,
18648                         "VHT Operation Information");
18649       pi = proto_tree_add_item(vht_op_info, hf_he_operation_channel_width, tvb,
18650                         offset, 1, ENC_NA);
18651       proto_item_append_text(pi, ": %s",
18652                         val_to_str(tvb_get_guint8(tvb, offset),
18653                                 channel_width_vals,
18654                                 "Reserved %u"));
18655       offset++;
18656
18657       proto_tree_add_item(vht_op_info, hf_he_operation_channel_center_freq_0,
18658                         tvb, offset, 1, ENC_NA);
18659       offset++;
18660
18661       proto_tree_add_item(vht_op_info, hf_he_operation_channel_center_freq_1,
18662                         tvb, offset, 1, ENC_NA);
18663       offset++;
18664     }
18665
18666     if (op_params & MULTIPLE_BSSID_AP) {
18667       proto_tree_add_item(tree, hf_he_operation_max_bssid_indicator, tvb, offset,
18668                         1, ENC_NA);
18669       offset++;
18670     }
18671 }
18672
18673 static const int *uora_headers[] = {
18674   &hf_he_uora_eocwmin,
18675   &hf_he_uora_owcwmax,
18676   &hf_he_uora_reserved,
18677   NULL
18678 };
18679
18680 static void
18681 dissect_uora_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
18682   int offset)
18683 {
18684   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18685                         hf_he_uora_field, ett_he_uora_tree, uora_headers,
18686                         ENC_NA, BMT_NO_APPEND);
18687   offset++;
18688 }
18689
18690 static int
18691 dissect_muac_param_record(tvbuff_t *tvb, proto_tree *tree, int offset)
18692 {
18693   proto_tree_add_item(tree, hf_he_muac_aci_aifsn, tvb, offset, 1, ENC_NA);
18694   offset++;
18695
18696   proto_tree_add_item(tree, hf_he_muac_ecwmin_ecwmax, tvb, offset, 1, ENC_NA);
18697   offset++;
18698
18699   proto_tree_add_item(tree, hf_he_mu_edca_timer, tvb, offset, 1, ENC_NA);
18700   offset++;
18701
18702   return offset;
18703 }
18704
18705 static int
18706 dissect_mu_edca_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
18707   int offset, int len _U_)
18708 {
18709   proto_tree *param_tree = NULL;
18710
18711   /* Is this from an AP or an STA? */
18712   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
18713                                     ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
18714                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18715   offset++;
18716
18717   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
18718                         NULL, "MUAC_BE Parameter Record");
18719   offset = dissect_muac_param_record(tvb, param_tree, offset);
18720
18721   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
18722                         NULL, "MUAC_BK Parameter Record");
18723   offset = dissect_muac_param_record(tvb, param_tree, offset);
18724
18725   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
18726                         NULL, "MUAC_VI Parameter Record");
18727   offset = dissect_muac_param_record(tvb, param_tree, offset);
18728
18729   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
18730                         NULL, "MUAC_VO Parameter Record");
18731   offset = dissect_muac_param_record(tvb, param_tree, offset);
18732
18733   return offset;
18734 }
18735
18736 #define SRP_DISALLOWED                     0x01
18737 #define NON_SRG_OBSS_PD_SR_DISALLOWED      0x02
18738 #define NON_SRG_OFFSET_PRESENT             0x04
18739 #define SRG_INFORMATION_PRESENT            0x08
18740 #define HESIGA_SPATIAL_REUSE_VAL15_ALLOWED 0x10
18741
18742 static const int *sr_control_field_headers[] = {
18743   &hf_he_srp_disallowed,
18744   &hf_he_non_srg_obss_pd_sr_disallowed,
18745   &hf_he_non_srg_offset_present,
18746   &hf_he_srg_information_present,
18747   &hf_he_hesiga_spatial_reuse_value15_allowed,
18748   &hf_he_sr_control_reserved,
18749   NULL
18750 };
18751
18752 static int
18753 dissect_spatial_reuse_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_,
18754   proto_tree *tree, int offset, int len _U_)
18755 {
18756   guint8 sr_control = tvb_get_guint8(tvb, offset);
18757
18758   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_spatial_reuse_sr_control,
18759                                     ett_he_spatial_reuse_control,
18760                                     sr_control_field_headers,
18761                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18762   offset++;
18763
18764   if (sr_control & NON_SRG_OFFSET_PRESENT) {
18765     proto_tree_add_item(tree, hf_he_spatial_non_srg_obss_pd_max_offset,
18766                         tvb, offset, 1, ENC_NA);
18767     offset++;
18768   }
18769
18770   if (sr_control & SRG_INFORMATION_PRESENT) {
18771     proto_tree_add_item(tree, hf_he_spatial_srg_obss_pd_min_offset, tvb,
18772                         offset, 1, ENC_NA);
18773     offset++;
18774     proto_tree_add_item(tree, hf_he_spatial_srg_obss_pd_max_offset, tvb,
18775                         offset, 1, ENC_NA);
18776     offset++;
18777     proto_tree_add_item(tree, hf_he_spatial_srg_bss_color_bitmap, tvb,
18778                         offset, 8, ENC_NA);
18779     offset += 8;
18780     proto_tree_add_item(tree, hf_he_spatial_srg_partial_bssid_bitmap,
18781                         tvb, offset, 8, ENC_NA);
18782     offset += 8;
18783   }
18784
18785   return offset;
18786 }
18787
18788 static void
18789 dissect_ndp_feedback_report_set(tvbuff_t *tvb, packet_info *pinfo _U_,
18790   proto_tree *tree, int offset, int len _U_)
18791 {
18792   proto_tree_add_item(tree, hf_he_resource_request_buffer_thresh, tvb, offset,
18793                         1, ENC_NA);
18794 }
18795
18796 static const int *bss_new_color_headers[] = {
18797   &hf_he_new_bss_color_info_color,
18798   &hf_he_new_bss_color_info_reserved,
18799   NULL
18800 };
18801
18802 static void
18803 dissect_bss_color_change(tvbuff_t *tvb, packet_info *pinfo _U_,
18804   proto_tree *tree, int offset, int len _U_)
18805 {
18806   proto_tree_add_item(tree, hf_he_bss_color_change_switch_countdown, tvb, offset,
18807                         1, ENC_NA);
18808   offset++;
18809
18810   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18811                                 hf_he_bss_color_change_new_color_info,
18812                                 ett_he_bss_new_color_info, bss_new_color_headers,
18813                                 ENC_NA, BMT_NO_APPEND);
18814 }
18815
18816 static const int *ess_info_field_headers[] = {
18817   &hf_he_ess_report_planned_ess,
18818   &hf_he_ess_report_edge_of_ess,
18819   NULL
18820 };
18821
18822 static void
18823 dissect_ess_report(tvbuff_t *tvb, packet_info *pinfo _U_,
18824   proto_tree *tree, int offset, int len _U_)
18825 {
18826   guint8 bss_trans_thresh = tvb_get_guint8(tvb, offset) >> 2;
18827
18828
18829   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_ess_report_info_field,
18830                                     ett_he_ess_report_info_field,
18831                                     ess_info_field_headers,
18832                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18833   if (bss_trans_thresh == 63)
18834     proto_tree_add_int_format(tree, hf_he_ess_report_recommend_transition_thresh, tvb,
18835                         offset, 1, bss_trans_thresh, " (%ddBm)",
18836                         -100 + bss_trans_thresh);
18837   else
18838     proto_tree_add_int_format(tree, hf_he_ess_report_recommend_transition_thresh,
18839                         tvb, offset, 1, bss_trans_thresh, " (No recommendation)");
18840 }
18841
18842 /*
18843  * There will be from 1 to 4 24-bit fields in the order of AC=BK, AC=BE,
18844  * AC=VI and AC=VO.
18845  */
18846
18847 static const int *esp_headers[] = {
18848   &hf_ieee80211_esp_access_category,
18849   &hf_ieee80211_esp_reserved,
18850   &hf_ieee80211_esp_data_format,
18851   &hf_ieee80211_esp_ba_windows_size,
18852   &hf_ieee80211_esp_est_air_time_frac,
18853   &hf_ieee80211_esp_data_ppdu_duration_target,
18854   NULL
18855 };
18856
18857 static const value_string esp_access_category_vals[] = {
18858   { 0, "AC=BK" },
18859   { 1, "AC=BE" },
18860   { 2, "AC=VI" },
18861   { 3, "AC=VO" },
18862   { 0, NULL }
18863 };
18864
18865 static const value_string esp_data_format_vals[] = {
18866   { 0, "No aggregation is expected to be performed" },
18867   { 1, "A-MSDU aggregation is expected but not A-MPDUs when type is data" },
18868   { 2, "A-MSDU aggregation is NOT expected but A-MPDUs aggregation is when type is data" },
18869   { 3, "A-MSDU aggregation is expected and A-MPDU aggregation is when type is data" },
18870   { 0, NULL }
18871 };
18872
18873 static const value_string esp_ba_window_size_vals[] = {
18874   { 0, "Block Ack not expected to be used" },
18875   { 1, "2" },
18876   { 2, "4" },
18877   { 3, "6" },
18878   { 4, "8" },
18879   { 5, "16" },
18880   { 6, "32" },
18881   { 7, "64" },
18882   { 0, NULL }
18883 };
18884
18885 static int
18886 dissect_estimated_service_params(tvbuff_t *tvb, packet_info *pinfo _U_,
18887   proto_tree *tree, int offset, int len)
18888 {
18889   while (len > 0) {
18890     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18891                         hf_ieee80211_estimated_service_params, ett_ieee80211_esp,
18892                         esp_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18893     offset += 3;
18894     len -= 3;
18895   }
18896
18897   return offset;
18898 }
18899
18900 static int
18901 dissect_future_channel_guidance(tvbuff_t *tvb, packet_info *pinfo _U_,
18902   proto_tree *tree, int offset, int len _U_)
18903 {
18904   proto_tree_add_item(tree, hf_ieee80211_fcg_new_channel_number, tvb, offset,
18905                         4, ENC_LITTLE_ENDIAN);
18906   offset += 4;
18907
18908   if (len - 4 > 0) {
18909     proto_tree_add_item(tree, hf_ieee80211_fcg_extra_info, tvb, offset, len - 4,
18910                         ENC_NA);
18911     offset += len - 4;
18912   }
18913
18914   return offset;
18915 }
18916
18917 static int
18918 ieee80211_tag_element_id_extension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18919 {
18920   int tag_len = tvb_reported_length(tvb);
18921   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18922   int offset = 0;
18923   int ext_tag_len;
18924   guint8 ext_tag_no;
18925
18926   if (tag_len < 1)
18927   {
18928     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 1", tag_len);
18929     return tvb_captured_length(tvb);
18930   }
18931   ext_tag_no = tvb_get_guint8(tvb, offset++);
18932   ext_tag_len = tag_len - 1;
18933
18934   switch (ext_tag_no) {
18935     case ETAG_FILS_SESSION:
18936       proto_tree_add_item(tree, hf_ieee80211_fils_session, tvb, offset, ext_tag_len, ENC_NA);
18937       break;
18938     case ETAG_FILS_WRAPPED_DATA:
18939       proto_tree_add_item(tree, hf_ieee80211_fils_wrapped_data, tvb, offset, ext_tag_len, ENC_NA);
18940       break;
18941     case ETAG_FILS_NONCE:
18942       proto_tree_add_item(tree, hf_ieee80211_fils_nonce, tvb, offset, ext_tag_len, ENC_NA);
18943       break;
18944     case ETAG_ESTIMATED_SERVICE_PARAM:
18945       dissect_estimated_service_params(tvb, pinfo, tree, offset, ext_tag_len);
18946       break;
18947     case ETAG_FUTURE_CHANNEL_GUIDANCE:
18948       dissect_future_channel_guidance(tvb, pinfo, tree, offset, ext_tag_len);
18949       break;
18950     case ETAG_HE_CAPABILITIES:
18951       dissect_he_capabilities(tvb, pinfo, tree, offset, ext_tag_len);
18952       break;
18953     case ETAG_HE_OPERATION:
18954       dissect_he_operation(tvb, pinfo, tree, offset, ext_tag_len);
18955       break;
18956     case ETAG_UORA_PARAMETER_SET:
18957       dissect_uora_parameter_set(tvb, pinfo, tree, offset);
18958       break;
18959     case ETAG_MU_EDCA_PARAMETER_SET:
18960       dissect_mu_edca_parameter_set(tvb, pinfo, tree, offset, ext_tag_len);
18961       break;
18962     case ETAG_SPATIAL_REUSE_PARAMETER_SET:
18963       dissect_spatial_reuse_parameter_set(tvb, pinfo, tree, offset, ext_tag_len);
18964       break;
18965     case ETAG_NDP_FEEDBACK_REPORT_PARAMETER_SET:
18966       dissect_ndp_feedback_report_set(tvb, pinfo, tree, offset, ext_tag_len);
18967       break;
18968     case ETAG_BSS_COLOR_CHANGE_ANNOUNCEMENT:
18969       dissect_bss_color_change(tvb, pinfo, tree, offset, ext_tag_len);
18970       break;
18971     case ETAG_QUIET_TIME_PERIOD_SETUP:
18972
18973       break;
18974     case ETAG_ESS_REPORT:
18975       dissect_ess_report(tvb, pinfo, tree, offset, ext_tag_len);
18976       break;
18977     default:
18978       break;
18979   }
18980
18981   return tvb_captured_length(tvb);
18982 }
18983
18984 /* Conflict: WAPI Vs. IEEE */
18985 static int
18986 ieee80211_tag_ie_68_conflict(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18987 {
18988   int tag_len = tvb_reported_length(tvb);
18989   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18990   if (tag_len >= 20) { /* It Might be WAPI*/
18991     dissect_wapi_param_set(tvb, pinfo, tree, 0, tag_len, field_data->item_tag_length, field_data->item_tag, field_data->ftype);
18992   }
18993   else { /* BSS AC Access Delay (68) */
18994      dissect_bss_ac_access_delay_ie(tvb, pinfo, tree, 0, tag_len, field_data->item_tag_length);
18995   }
18996   return tvb_captured_length(tvb);
18997 }
18998
18999 static int
19000 ieee80211_tag_mesh_peering_mgmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
19001 {
19002   int tag_len = tvb_reported_length(tvb);
19003   int offset = 0;
19004
19005   proto_tree_add_item(tree, hf_ieee80211_mesh_peering_proto, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19006   offset += 2;
19007   proto_tree_add_item(tree, hf_ieee80211_mesh_peering_local_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19008   offset += 2;
19009   switch (tvb_get_guint8(tvb, 1))
19010   {                                         /* Self-protected action field */
19011     case SELFPROT_ACTION_MESH_PEERING_OPEN:
19012       break;
19013
19014     case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
19015       proto_tree_add_item(tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19016       break;
19017
19018     case SELFPROT_ACTION_MESH_PEERING_CLOSE:
19019       if ((tag_len == 8) || (tag_len == 24))
19020       {
19021         proto_tree_add_item(tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19022         offset += 2;
19023       }
19024       add_ff_reason_code(tree, tvb, pinfo, offset);
19025       break;
19026
19027       /* unexpected values */
19028     default:
19029       proto_tree_add_expert(tree, pinfo, &ei_ieee80211_mesh_peering_unexpected , tvb, offset, tag_len);
19030       break;
19031   }
19032   if (tag_len - offset == 16)
19033   {
19034     proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
19035   }
19036   return tvb_captured_length(tvb);
19037 }
19038
19039 static int
19040 ieee80211_tag_mesh_configuration(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
19041 {
19042   int offset = 0;
19043   proto_item *item;
19044   proto_tree *subtree;
19045   static const int *ieee80211_mesh_config_cap[] = {
19046     &hf_ieee80211_mesh_config_cap_accepting,
19047     &hf_ieee80211_mesh_config_cap_mcca_support,
19048     &hf_ieee80211_mesh_config_cap_mcca_enabled,
19049     &hf_ieee80211_mesh_config_cap_forwarding,
19050     &hf_ieee80211_mesh_config_cap_mbca_enabled,
19051     &hf_ieee80211_mesh_config_cap_tbtt_adjusting,
19052     &hf_ieee80211_mesh_config_cap_power_save_level,
19053     NULL
19054   };
19055
19056   proto_tree_add_item(tree, hf_ieee80211_mesh_config_path_sel_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19057   proto_tree_add_item(tree, hf_ieee80211_mesh_config_path_sel_metric, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
19058   proto_tree_add_item(tree, hf_ieee80211_mesh_config_congestion_control, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
19059   proto_tree_add_item(tree, hf_ieee80211_mesh_config_sync_method, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
19060   proto_tree_add_item(tree, hf_ieee80211_mesh_config_auth_protocol, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
19061   item = proto_tree_add_item(tree, hf_ieee80211_mesh_config_formation_info, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
19062   subtree = proto_item_add_subtree(item, ett_mesh_formation_info_tree);
19063   proto_tree_add_item(subtree, hf_ieee80211_mesh_form_info_num_of_peerings, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
19064
19065   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_mesh_config_capability,
19066                                     ett_mesh_config_cap_tree, ieee80211_mesh_config_cap,
19067                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19068   return tvb_captured_length(tvb);
19069 }
19070
19071 static int
19072 ieee80211_tag_mesh_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19073 {
19074   int offset = 0;
19075   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19076   int tag_len = tvb_reported_length(tvb);
19077   const guint8* mesh_id;
19078
19079   proto_tree_add_item_ret_string(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &mesh_id);
19080   if (tag_len > 0) {
19081     gchar* s = format_text(wmem_packet_scope(), mesh_id, tag_len);
19082     col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", s);
19083     proto_item_append_text(field_data->item_tag, ": %s", s);
19084   }
19085   /* Make sure dissector is accepted */
19086   return ((tag_len > 0) ? tag_len : 1);
19087 }
19088
19089 static int
19090 ieee80211_tag_mesh_preq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
19091 {
19092   int offset = 0;
19093
19094   guint32 flags;
19095   guint8 targs, i;
19096
19097   proto_tree_add_item_ret_uint(tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN, &flags);
19098   offset += 1;
19099   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19100   offset += 1;
19101   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19102   offset += 1;
19103   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_pdid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19104   offset += 4;
19105   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
19106   offset += 6;
19107   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19108   offset += 4;
19109
19110   if (flags & (1<<6)) {
19111     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_ext, tvb, offset, 6, ENC_NA);
19112     offset += 6;
19113   }
19114   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19115   offset += 4;
19116   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19117   offset += 4;
19118   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19119   targs = tvb_get_guint8(tvb, offset);
19120   offset += 1;
19121   for (i = 0; i < targs; i++) {
19122     const int * targ_flags[] = {
19123       &hf_ieee80211_ff_hwmp_targ_to_flags,
19124       &hf_ieee80211_ff_hwmp_targ_usn_flags,
19125       NULL
19126     };
19127
19128     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_hwmp_targ_flags,
19129                                    ett_hwmp_targ_flags_tree, targ_flags, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19130
19131     offset += 1;
19132     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
19133     offset += 6;
19134     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19135     offset += 4;
19136   }
19137
19138   return tvb_captured_length(tvb);
19139 }
19140
19141 static int
19142 ieee80211_tag_mesh_prep(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
19143 {
19144   int offset = 0;
19145
19146   guint32 flags;
19147   proto_tree_add_item_ret_uint(tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN, &flags);
19148   offset += 1;
19149   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19150   offset += 1;
19151   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset , 1, ENC_LITTLE_ENDIAN);
19152   offset += 1;
19153   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
19154   offset += 6;
19155   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19156   offset += 4;
19157   if (flags & (1<<6)) {
19158     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
19159     offset += 6;
19160   }
19161   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19162   offset += 4;
19163   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19164   offset += 4;
19165   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
19166   offset += 6;
19167   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19168   return tvb_captured_length(tvb);
19169 }
19170
19171 static int
19172 ieee80211_tag_mesh_perr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
19173 {
19174   int offset = 0;
19175   guint8 targs, i;
19176
19177   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19178   offset += 1;
19179   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19180   targs = tvb_get_guint8(tvb, offset);
19181   offset += 1;
19182   for (i = 0; i < targs; i++) {
19183     guint8 flags = tvb_get_guint8(tvb, offset);
19184
19185     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19186     offset += 1;
19187     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
19188     offset += 6;
19189     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19190     offset += 4;
19191     if (flags & (1<<6)) {
19192       proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
19193       offset += 6;
19194     }
19195     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
19196   }
19197   return tvb_captured_length(tvb);
19198 }
19199
19200 static int
19201 ieee80211_tag_rann(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
19202 {
19203   int offset = 0;
19204   proto_tree_add_item(tree, hf_ieee80211_rann_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19205   offset += 1;
19206   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19207   offset += 1;
19208   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19209   offset += 1;
19210   proto_tree_add_item(tree, hf_ieee80211_rann_root_sta, tvb, offset, 6, ENC_NA);
19211   offset += 6;
19212   proto_tree_add_item(tree, hf_ieee80211_rann_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19213   offset += 4;
19214   proto_tree_add_item(tree, hf_ieee80211_rann_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19215   offset += 4;
19216   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19217   return tvb_captured_length(tvb);
19218 }
19219
19220 /* Mesh Channel Switch Parameters (118) */
19221 static int
19222 ieee80211_tag_mesh_channel_switch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19223 {
19224   int tag_len = tvb_reported_length(tvb);
19225   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19226   int offset = 0;
19227   static const int * ieee80211_mesh_chswitch_flag[] = {
19228     &hf_ieee80211_mesh_chswitch_flag_initiator,
19229     &hf_ieee80211_mesh_chswitch_flag_txrestrict,
19230     NULL
19231   };
19232
19233   if (tag_len != 6)
19234   {
19235     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
19236     return tvb_captured_length(tvb);
19237   }
19238
19239   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19240   proto_item_append_text(field_data->item_tag, " TTL: %d", tvb_get_guint8(tvb, offset));
19241   offset += 1;
19242
19243   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_mesh_channel_switch_flag,
19244                                    ett_mesh_chswitch_flag_tree, ieee80211_mesh_chswitch_flag, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19245   offset += 1;
19246
19247   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_reason_code, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19248   offset += 2;
19249
19250   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_precedence_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19251   return tvb_captured_length(tvb);
19252 }
19253
19254 /* Mesh Awake Window Parameters (119) */
19255 static int
19256 ieee80211_tag_mesh_awake_window(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19257 {
19258   int tag_len = tvb_reported_length(tvb);
19259   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19260   int offset = 0;
19261
19262   if (tag_len != 2) {
19263     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
19264         "Tag length %u wrong, must be = 2", tag_len);
19265     return tvb_captured_length(tvb);
19266   }
19267
19268   proto_tree_add_item(tree, hf_ieee80211_mesh_awake_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19269   return tvb_captured_length(tvb);
19270 }
19271
19272 static int
19273 ieee80211_tag_channel_switch_announcement(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19274 {
19275   int tag_len = tvb_reported_length(tvb);
19276   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19277   int offset = 0;
19278   if (tag_len != 4)
19279   {
19280     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
19281     return tvb_captured_length(tvb);
19282   }
19283
19284   add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
19285   return tvb_captured_length(tvb);
19286 }
19287
19288 static int
19289 ieee80211_tag_supported_operating_classes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19290 {
19291   int tag_len = tvb_reported_length(tvb);
19292   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19293   int offset = 0;
19294   proto_item* item = NULL;
19295   guint8 i;
19296   guint8 field_len = 0;
19297   guint8 alt_op_class_field[256];
19298
19299   if (tag_len < 2) {
19300     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 2", tag_len);
19301     return tvb_captured_length(tvb);
19302   } else if (tag_len > 255) {
19303     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, uint8 <= 255", tag_len);
19304     return tvb_captured_length(tvb);
19305   }
19306
19307   proto_tree_add_item(tree, hf_ieee80211_tag_supported_ope_classes_current, tvb, offset++, 1, ENC_NA);
19308
19309   for (i = offset; i < tag_len; i++) {
19310     guint8 op_class =  tvb_get_guint8(tvb, i);
19311     /* Field terminates immediately before OneHundredAndThirty or Zero delimiter */
19312     if (op_class == 130 || op_class == 0) {
19313       break;
19314     }
19315     alt_op_class_field[field_len++] = op_class;
19316   }
19317   if (field_len) {
19318     item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_ope_classes_alternate, tvb, offset, field_len, ENC_NA);
19319   }
19320   for (i = 0; i < field_len; i++) {
19321     proto_item_append_text(item, i == 0 ? ": %d":", %d", alt_op_class_field[i]);
19322   }
19323
19324   /* TODO parse optional Current Operating Class Extension Sequence field */
19325   /* TODO parse optional Operating Class Duple Sequence field */
19326   return tvb_captured_length(tvb);
19327 }
19328
19329 static int
19330 ieee80211_tag_bss_parameter_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19331 {
19332   int tag_len = tvb_reported_length(tvb);
19333   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19334   int offset = 0;
19335   gboolean size;
19336   if (tag_len != 7)
19337   {
19338     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 7", tag_len);
19339     return tvb_captured_length(tvb);
19340   }
19341   size = (tvb_get_guint8(tvb, offset) & 0x02) >> 1;
19342   proto_tree_add_item(tree, hf_ieee80211_tag_move, tvb, offset, 1, ENC_NA);
19343   proto_tree_add_item(tree, hf_ieee80211_tag_size, tvb, offset, 1, ENC_NA);
19344   offset += 1;
19345   proto_tree_add_item(tree, hf_ieee80211_tag_tbtt_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19346   offset += 4;
19347   if(size == TRUE) { /* if size bit is 0, the field is reserved. */
19348     proto_tree_add_item(tree, hf_ieee80211_tag_bi_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19349   }
19350   return tvb_captured_length(tvb);
19351 }
19352
19353 static int
19354 ieee80211_tag_dmg_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19355 {
19356   int tag_len = tvb_reported_length(tvb);
19357   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19358   int offset = 0;
19359
19360   static const int * ieee80211_tag_dmg_cap1[] = {
19361     &hf_ieee80211_tag_reverse_direction,
19362     &hf_ieee80211_tag_hlts,
19363     &hf_ieee80211_tag_tpc,
19364     &hf_ieee80211_tag_spsh,
19365     &hf_ieee80211_tag_rx_antenna,
19366     &hf_ieee80211_tag_fast_link,
19367     &hf_ieee80211_tag_num_sectors,
19368     &hf_ieee80211_tag_rxss_length,
19369     &hf_ieee80211_tag_reciprocity,
19370     &hf_ieee80211_tag_max_ampdu_exp,
19371     NULL
19372   };
19373
19374   static const int * ieee80211_tag_dmg_cap2[] = {
19375     &hf_ieee80211_tag_min_mpdu_spacing,
19376     &hf_ieee80211_tag_ba_flow_control,
19377     &hf_ieee80211_tag_max_sc_rx_mcs,
19378     &hf_ieee80211_tag_max_ofdm_rx_mcs,
19379     &hf_ieee80211_tag_max_sc_tx_mcs,
19380     &hf_ieee80211_tag_max_ofdm_tx_mcs,
19381     NULL
19382   };
19383
19384   static const int * ieee80211_tag_dmg_cap3[] = {
19385     &hf_ieee80211_tag_low_power_supported,
19386     &hf_ieee80211_tag_code_rate,
19387     &hf_ieee80211_tag_dtp,
19388     &hf_ieee80211_tag_appdu_supp,
19389     &hf_ieee80211_tag_heartbeat,
19390     &hf_ieee80211_tag_other_aid,
19391     &hf_ieee80211_tag_pattern_recip,
19392     &hf_ieee80211_tag_heartbeat_elapsed,
19393     &hf_ieee80211_tag_grant_ack_supp,
19394     &hf_ieee80211_tag_RXSSTxRate_supp,
19395     NULL
19396   };
19397
19398   static const int * ieee80211_tag_dmg_cap4[] = {
19399     &hf_ieee80211_tag_pcp_tddti,
19400     &hf_ieee80211_tag_pcp_PSA,
19401     &hf_ieee80211_tag_pcp_handover,
19402     &hf_ieee80211_tag_pcp_max_assoc,
19403     &hf_ieee80211_tag_pcp_power_src,
19404     &hf_ieee80211_tag_pcp_decenter,
19405     &hf_ieee80211_tag_pcp_forwarding,
19406     &hf_ieee80211_tag_pcp_center,
19407     NULL
19408   };
19409
19410   static const int * ieee80211_tag_dmg_cap5[] = {
19411     &hf_ieee80211_tag_ext_sc_mcs_max_tx,
19412     &hf_ieee80211_tag_ext_sc_mcs_tx_code_7_8,
19413     &hf_ieee80211_tag_ext_sc_mcs_max_rx,
19414     &hf_ieee80211_tag_ext_sc_mcs_rx_code_7_8,
19415     NULL
19416   };
19417
19418   if (tag_len != 22)
19419   {
19420     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 22", tag_len);
19421     return tvb_captured_length(tvb);
19422   }
19423
19424   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_sta_addr, tvb, offset, 6, ENC_NA);
19425   offset += 6;
19426   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_aid, tvb, offset, 1, ENC_NA);
19427   offset += 1;
19428   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_dmg_cap1, ENC_LITTLE_ENDIAN);
19429   offset += 3;
19430   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_dmg_cap2, ENC_LITTLE_ENDIAN);
19431   offset += 3;
19432   proto_tree_add_bitmask_list(tree, tvb, offset, 2, ieee80211_tag_dmg_cap3, ENC_LITTLE_ENDIAN);
19433   offset += 2;
19434   proto_tree_add_bitmask_list(tree, tvb, offset, 2, ieee80211_tag_dmg_cap4, ENC_LITTLE_ENDIAN);
19435   offset += 2;
19436   proto_tree_add_item(tree, hf_ieee80211_tag_sta_beam_track, tvb, offset, 2, ENC_NA);
19437   offset += 2;
19438   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_dmg_cap5, ENC_LITTLE_ENDIAN);
19439   offset += 1;
19440   proto_tree_add_item(tree, hf_ieee80211_tag_max_basic_sf_amsdu, tvb, offset, 1, ENC_NA);
19441   offset += 1;
19442   proto_tree_add_item(tree, hf_ieee80211_tag_max_short_sf_amsdu, tvb, offset, 1, ENC_NA);
19443   offset += 1;
19444
19445   return tvb_captured_length(tvb);
19446 }
19447
19448 static int
19449 ieee80211_tag_dmg_operation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19450 {
19451   int tag_len = tvb_reported_length(tvb);
19452   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19453   int offset = 0;
19454   static const int * ieee80211_tag_dmg_operation_flags[] = {
19455     &hf_ieee80211_tag_pcp_tddti,
19456     &hf_ieee80211_tag_pcp_PSA,
19457     &hf_ieee80211_tag_pcp_handover,
19458     NULL
19459   };
19460
19461   if (tag_len != 10)
19462   {
19463     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 10", tag_len);
19464     return tvb_captured_length(tvb);
19465   }
19466   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_dmg_operation_flags, ENC_LITTLE_ENDIAN);
19467   offset += 2;
19468   proto_tree_add_item(tree, hf_ieee80211_tag_PSRSI, tvb, offset, 1, ENC_NA);
19469   offset += 1;
19470   proto_tree_add_item(tree, hf_ieee80211_tag_min_BHI_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19471   offset += 2;
19472   proto_tree_add_item(tree, hf_ieee80211_tag_brdct_sta_info_dur, tvb, offset, 1, ENC_NA);
19473   offset += 1;
19474   proto_tree_add_item(tree, hf_ieee80211_tag_assoc_resp_confirm_time, tvb, offset, 1, ENC_NA);
19475   offset += 1;
19476   proto_tree_add_item(tree, hf_ieee80211_tag_min_pp_duration, tvb, offset, 1, ENC_NA);
19477   offset += 1;
19478   proto_tree_add_item(tree, hf_ieee80211_tag_SP_idle_timeout, tvb, offset, 1, ENC_NA);
19479   offset += 1;
19480   proto_tree_add_item(tree, hf_ieee80211_tag_max_lost_beacons, tvb, offset, 1, ENC_NA);
19481   return tvb_captured_length(tvb);
19482 }
19483
19484 static int
19485 ieee80211_tag_antenna_section_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19486 {
19487   int tag_len = tvb_reported_length(tvb);
19488   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19489   int offset = 0;
19490   static const int * ieee80211_tag_antenna[] = {
19491     &hf_ieee80211_tag_type,
19492     &hf_ieee80211_tag_tap1,
19493     &hf_ieee80211_tag_state1,
19494     &hf_ieee80211_tag_tap2,
19495     &hf_ieee80211_tag_state2,
19496     NULL
19497   };
19498
19499   if (tag_len != 4)
19500   {
19501     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
19502     return tvb_captured_length(tvb);
19503   }
19504   proto_tree_add_bitmask_list(tree, tvb, offset, 4, ieee80211_tag_antenna, ENC_LITTLE_ENDIAN);
19505   return tvb_captured_length(tvb);
19506 }
19507
19508 static int
19509 ieee80211_tag_extended_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19510 {
19511   int tag_len = tvb_reported_length(tvb);
19512   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19513   int offset = 0;
19514   int i;
19515   gboolean isGrant;
19516   proto_tree * alloc_tree;
19517   if ((tag_len%15) != 0)
19518   {
19519     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);
19520     return tvb_captured_length(tvb);
19521   }
19522   isGrant = ((field_data->ftype==CTRL_GRANT)||(field_data->ftype==CTRL_GRANT_ACK));
19523   for(i=0; i < tag_len; i+=15) {
19524     alloc_tree = proto_tree_add_subtree_format(tree, tvb, offset, 15, ett_allocation_tree, NULL, "Allocation %d", i/15);
19525     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19526     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19527     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pseudo_static, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19528     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_truncatable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19529     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_extendable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19530     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pcp_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19531     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_lp_sc_used, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19532     offset += 2;
19533     offset += add_ff_beamforming_ctrl(alloc_tree, tvb, pinfo, offset, isGrant);
19534     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_src_aid, tvb, offset, 1, ENC_NA);
19535     offset += 1;
19536     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_dest_aid, tvb, offset, 1, ENC_NA);
19537     offset += 1;
19538     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19539     offset += 4;
19540     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19541     offset += 2;
19542     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_num_blocks, tvb, offset, 1, ENC_NA);
19543     offset += 1;
19544     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19545     offset += 2;
19546   }
19547   return tvb_captured_length(tvb);
19548 }
19549
19550 static int
19551 ieee80211_tag_sta_availability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19552 {
19553   int tag_len = tvb_reported_length(tvb);
19554   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19555   int offset = 0;
19556   int i;
19557   proto_tree * sta_info_tree;
19558   if ((tag_len%2) != 0)
19559   {
19560     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);
19561     return tvb_captured_length(tvb);
19562   }
19563   for(i=0; i < tag_len; i+=2) {
19564     sta_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 2, ett_sta_info, NULL, "STA Info %d", i/2);
19565     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19566     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_cbap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19567     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_pp_avail, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19568     offset += 2;
19569   }
19570   return tvb_captured_length(tvb);
19571 }
19572
19573 static int
19574 ieee80211_tag_next_dmg_ati(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19575 {
19576   int tag_len = tvb_reported_length(tvb);
19577   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19578   int offset = 0;
19579   if (tag_len != 6)
19580   {
19581     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
19582     return tvb_captured_length(tvb);
19583   }
19584   proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19585   offset += 4;
19586   proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19587   return tvb_captured_length(tvb);
19588 }
19589
19590 static int
19591 ieee80211_tag_nextpcp_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19592 {
19593   int tag_len = tvb_reported_length(tvb);
19594   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19595   int offset = 0;
19596   int i;
19597   if (tag_len < 1)
19598   {
19599     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);
19600     return tvb_captured_length(tvb);
19601   }
19602   proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_token, tvb, offset, 1, ENC_NA);
19603   offset += 1;
19604   for(i=0; i < tag_len-1; i+=1) {
19605     proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_list, tvb, offset, 1, ENC_NA);
19606     offset += 1;
19607   }
19608   return tvb_captured_length(tvb);
19609 }
19610
19611 static int
19612 ieee80211_tag_pcp_handover(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19613 {
19614   int tag_len = tvb_reported_length(tvb);
19615   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19616   int offset = 0;
19617   if (tag_len != 13)
19618   {
19619     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 13", tag_len);
19620     return tvb_captured_length(tvb);
19621   }
19622   proto_tree_add_item(tree, hf_ieee80211_tag_old_bssid, tvb, offset, 6, ENC_NA);
19623   offset += 6;
19624   proto_tree_add_item(tree, hf_ieee80211_tag_new_pcp_addr, tvb, offset, 6, ENC_NA);
19625   offset += 6;
19626   proto_tree_add_item(tree, hf_ieee80211_tag_reamaining_BI, tvb, offset, 1, ENC_NA);
19627   return tvb_captured_length(tvb);
19628 }
19629
19630 static int
19631 ieee80211_tag_beamlink_maintenance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19632 {
19633   int tag_len = tvb_reported_length(tvb);
19634   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19635   int offset = 0;
19636   if (tag_len != 1)
19637   {
19638     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
19639     return tvb_captured_length(tvb);
19640   }
19641   add_ff_beamformed_link(tree, tvb, pinfo, offset);
19642   return tvb_captured_length(tvb);
19643 }
19644
19645 static int
19646 ieee80211_tag_quiet_period_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19647 {
19648   int tag_len = tvb_reported_length(tvb);
19649   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19650   int offset = 0;
19651   if (tag_len != 10)
19652   {
19653     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 10", tag_len);
19654     return tvb_captured_length(tvb);
19655   }
19656   proto_tree_add_item(tree, hf_ieee80211_tag_request_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19657   offset += 2;
19658   proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
19659   offset += 6;
19660   add_ff_sta_address(tree, tvb, pinfo, offset);
19661   return tvb_captured_length(tvb);
19662 }
19663
19664 static int
19665 ieee80211_tag_relay_transfer_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19666 {
19667   int tag_len = tvb_reported_length(tvb);
19668   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19669   int offset = 0;
19670
19671   if (tag_len != 8)
19672   {
19673     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
19674     return tvb_captured_length(tvb);
19675   }
19676   proto_tree_add_item(tree, hf_ieee80211_tag_duplex_relay, tvb, offset, 1, ENC_NA);
19677   proto_tree_add_item(tree, hf_ieee80211_tag_cooperation_relay, tvb, offset, 1, ENC_NA);
19678   proto_tree_add_item(tree, hf_ieee80211_tag_tx_mode, tvb, offset, 1, ENC_NA);
19679   proto_tree_add_item(tree, hf_ieee80211_tag_link_change_interval, tvb, offset+1, 1, ENC_NA);
19680   proto_tree_add_item(tree, hf_ieee80211_tag_data_sensing_time, tvb, offset+2, 1, ENC_NA);
19681   proto_tree_add_item(tree, hf_ieee80211_tag_first_period, tvb, offset+3, 2, ENC_LITTLE_ENDIAN);
19682   proto_tree_add_item(tree, hf_ieee80211_tag_second_period, tvb, offset+5, 2, ENC_LITTLE_ENDIAN);
19683   return tvb_captured_length(tvb);
19684 }
19685
19686 static int
19687 ieee80211_tag_dmg_beam_refinement(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19688 {
19689   int tag_len = tvb_reported_length(tvb);
19690   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19691   int offset = 0;
19692   static const int * ieee80211_dmg_beam_refinement_fields[] = {
19693     &hf_ieee80211_tag_initiator,
19694     &hf_ieee80211_tag_tx_train_res,
19695     &hf_ieee80211_tag_rx_train_res,
19696     &hf_ieee80211_tag_tx_trn_ok,
19697     &hf_ieee80211_tag_txss_fbck_req,
19698     &hf_ieee80211_tag_bs_fbck,
19699     &hf_ieee80211_tag_bs_fbck_antenna_id,
19700     &hf_ieee80211_tag_snr_requested,
19701     &hf_ieee80211_tag_channel_measurement_requested,
19702     &hf_ieee80211_tag_number_of_taps_requested,
19703     &hf_ieee80211_tag_sector_id_order_req,
19704     &hf_ieee80211_tag_snr_present,
19705     &hf_ieee80211_tag_channel_measurement_present,
19706     &hf_ieee80211_tag_tap_delay_present,
19707     &hf_ieee80211_tag_number_of_taps_present,
19708     &hf_ieee80211_tag_number_of_measurement,
19709     &hf_ieee80211_tag_sector_id_order_present,
19710     &hf_ieee80211_tag_number_of_beams,
19711     &hf_ieee80211_tag_mid_extension,
19712     &hf_ieee80211_tag_capability_request,
19713     &hf_ieee80211_tag_beam_refine_reserved,
19714     NULL
19715   };
19716
19717   if (tag_len != 5)
19718   {
19719     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
19720     return tvb_captured_length(tvb);
19721   }
19722
19723   proto_tree_add_bitmask_list(tree, tvb, offset, 5, ieee80211_dmg_beam_refinement_fields, ENC_LITTLE_ENDIAN);
19724   return tvb_captured_length(tvb);
19725 }
19726
19727 static int
19728 ieee80211_tag_wakeup_schedule_ad(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19729 {
19730   int tag_len = tvb_reported_length(tvb);
19731   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19732   int offset = 0;
19733
19734   if (tag_len != 8)
19735   {
19736     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
19737     return tvb_captured_length(tvb);
19738   }
19739   proto_tree_add_item(tree, hf_ieee80211_tag_bi_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19740   offset += 4;
19741   proto_tree_add_item(tree, hf_ieee80211_tag_sleep_cycle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19742   offset += 2;
19743   proto_tree_add_item(tree, hf_ieee80211_tag_num_awake_bis, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19744   return tvb_captured_length(tvb);
19745 }
19746
19747 static int
19748 ieee80211_tag_dmg_tspec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19749 {
19750   int tag_len = tvb_reported_length(tvb);
19751   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19752   int offset = 0;
19753
19754   gboolean isGrant;
19755   int num_constraints;
19756   if (tag_len < 14)
19757   {
19758     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);
19759     return tvb_captured_length(tvb);
19760   }
19761   static const int * ieee80211_tag_tspec_flags[] = {
19762     &hf_ieee80211_tag_tspec_allocation_id,
19763     &hf_ieee80211_tag_tspec_allocation_type,
19764     &hf_ieee80211_tag_tspec_allocation_format,
19765     &hf_ieee80211_tag_tspec_pseudo_static,
19766     &hf_ieee80211_tag_tspec_truncatable,
19767     &hf_ieee80211_tag_tspec_extendable,
19768     &hf_ieee80211_tag_tspec_lp_sc_used,
19769     &hf_ieee80211_tag_tspec_up,
19770     &hf_ieee80211_tag_tap2,
19771     &hf_ieee80211_tag_tspec_dest_aid,
19772     NULL
19773   };
19774
19775   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_tspec_flags, ENC_LITTLE_ENDIAN);
19776   offset += 3;
19777   isGrant = ((field_data->ftype==CTRL_GRANT)||(field_data->ftype==CTRL_GRANT_ACK));
19778   offset += add_ff_beamforming_ctrl(tree, tvb, pinfo, 2, isGrant);
19779   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19780   offset += 2;
19781   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19782   offset += 2;
19783   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_max_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19784   offset += 2;
19785   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19786   offset += 2;
19787   num_constraints = tvb_get_guint8(tvb, offset);
19788   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_num_of_constraints, tvb, offset, 1, ENC_NA);
19789   offset += 1;
19790   while(num_constraints > 0) {
19791     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19792     offset += 4;
19793     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19794     offset += 2;
19795     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19796     offset += 2;
19797     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_interferer_mac, tvb, offset, 2, ENC_NA);
19798     offset += 6;
19799     num_constraints--;
19800   }
19801   return tvb_captured_length(tvb);
19802 }
19803
19804 static int
19805 ieee80211_tag_channel_measurement_fb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19806 {
19807   int tag_len = tvb_reported_length(tvb);
19808   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19809   int offset = 0;
19810
19811   int num_measurement;
19812   if (tag_len%5 != 0)
19813   {
19814     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);
19815     return tvb_captured_length(tvb);
19816   }
19817   num_measurement = tvb_get_guint8(tvb, offset+1);
19818   offset += 2;
19819   while(num_measurement > 0) {
19820     proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
19821     offset += 1;
19822     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_I, tvb, offset, 1, ENC_NA);
19823     offset += 1;
19824     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_Q, tvb, offset, 1, ENC_NA);
19825     offset += 1;
19826     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_tap_delay, tvb, offset, 1, ENC_NA);
19827     offset += 1;
19828     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_sector_id, tvb, offset, 1, ENC_NA);
19829     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_antenna_id, tvb, offset, 1, ENC_NA);
19830     offset += 1;
19831     num_measurement--;
19832   }
19833   return tvb_captured_length(tvb);
19834 }
19835
19836 static int
19837 ieee80211_tag_awake_window(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19838 {
19839   int tag_len = tvb_reported_length(tvb);
19840   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19841
19842   if (tag_len != 2)
19843   {
19844     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 2", tag_len);
19845   }
19846   else
19847   {
19848     proto_tree_add_item(tree, hf_ieee80211_tag_awake_window, tvb, 0, 2, ENC_LITTLE_ENDIAN);
19849   }
19850   return tvb_captured_length(tvb);
19851 }
19852
19853 static int
19854 ieee80211_tag_addba_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19855 {
19856   int tag_len = tvb_reported_length(tvb);
19857   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19858
19859   if (tag_len != 1)
19860   {
19861     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
19862   }
19863   else
19864   {
19865     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_no_frag, tvb, 0, 1, ENC_NA);
19866     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_he_fragmentation_operation, tvb, 0, 1, ENC_NA);
19867     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_reserved, tvb, 0, 1, ENC_NA);
19868   }
19869   return tvb_captured_length(tvb);
19870 }
19871
19872 static int
19873 ieee80211_tag_multi_band(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19874 {
19875   int tag_len = tvb_reported_length(tvb);
19876   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19877   int offset = 0;
19878   gboolean chiper_present, addr_present;
19879   static const int * ieee80211_tag_multi_band_ctrl[] = {
19880     &hf_ieee80211_tag_multi_band_ctrl_sta_role,
19881     &hf_ieee80211_tag_multi_band_ctrl_addr_present,
19882     &hf_ieee80211_tag_multi_band_ctrl_cipher_present,
19883     NULL
19884   };
19885   static const int * ieee80211_tag_multi_band_conn[] = {
19886     &hf_ieee80211_tag_multi_band_conn_ap,
19887     &hf_ieee80211_tag_multi_band_conn_pcp,
19888     &hf_ieee80211_tag_multi_band_conn_dls,
19889     &hf_ieee80211_tag_multi_band_conn_tdls,
19890     &hf_ieee80211_tag_multi_band_conn_ibss,
19891     NULL
19892   };
19893
19894   if (tag_len < 22)
19895   {
19896     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);
19897     return tvb_captured_length(tvb);
19898   }
19899   chiper_present = (tvb_get_letohs(tvb, offset) & 0x08) >> 3;
19900   addr_present = (tvb_get_letohs(tvb, offset) & 0x10) >> 4;
19901   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_multi_band_ctrl, ENC_NA);
19902   offset += 1;
19903   offset += add_ff_band_id(tree, tvb, pinfo, 1);
19904   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_oper_class, tvb, offset, 1, ENC_NA);
19905   offset += 1;
19906   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_channel_number, tvb, offset, 1, ENC_NA);
19907   offset += 1;
19908   proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
19909   offset += 6;
19910   offset += add_ff_beacon_interval(tree, tvb, pinfo, 2);
19911   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_tsf_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
19912   offset += 8;
19913
19914   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_multi_band_conn, ENC_NA);
19915   offset += 1;
19916   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_fst_timeout, tvb, offset, 1, ENC_NA);
19917   offset += 1;
19918   if(addr_present)
19919   {
19920     proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_sta_mac, tvb, offset, 6, ENC_NA);
19921     offset += 6;
19922   }
19923   if(chiper_present)
19924   {
19925     proto_item *rsn_pcs_count, *rsn_pcs_item, *rsn_sub_pcs_item;
19926     proto_tree *rsn_pcs_tree, *rsn_sub_pcs_tree;
19927     gint ii;
19928     guint16     pcs_count;
19929     int tag_end = tvb_reported_length(tvb);
19930     rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19931     pcs_count = tvb_get_letohs(tvb, offset);
19932     offset += 2;
19933
19934     if (offset + (pcs_count * 4) > tag_end)
19935     {
19936         expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
19937         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
19938         pcs_count = (tag_end - offset) / 4;
19939     }
19940
19941     rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
19942     rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
19943     for (ii = 0; ii < pcs_count; ii++)
19944     {
19945       rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
19946       rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
19947       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
19948
19949       /* Check if OUI is 00:0F:AC (ieee80211) */
19950       if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
19951       {
19952         proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
19953         proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
19954       } else {
19955         proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
19956       }
19957       offset += 4;
19958     }
19959   }
19960
19961   return tvb_captured_length(tvb);
19962 }
19963
19964 static int
19965 ieee80211_tag_dmg_link_margin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19966 {
19967   int tag_len = tvb_reported_length(tvb);
19968   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19969   int offset = 0;
19970
19971   if (tag_len != 8)
19972   {
19973     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
19974     return tvb_captured_length(tvb);
19975   }
19976   proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
19977   offset += 1;
19978   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_mcs, tvb, offset, 1, ENC_NA);
19979   offset += 1;
19980   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_link_margin, tvb, offset, 1, ENC_NA);
19981   offset += 1;
19982   proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
19983   offset += 1;
19984   proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
19985   return tvb_captured_length(tvb);
19986 }
19987
19988 static int
19989 ieee80211_tag_dmg_link_adaption_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19990 {
19991   int tag_len = tvb_reported_length(tvb);
19992   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19993   int offset = 0;
19994
19995   if (tag_len != 5)
19996   {
19997     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
19998     return tvb_captured_length(tvb);
19999   }
20000   proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
20001   offset += 1;
20002   proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
20003   return tvb_captured_length(tvb);
20004 }
20005
20006 static int
20007 ieee80211_tag_switching_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
20008 {
20009   int tag_len = tvb_reported_length(tvb);
20010   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
20011   int offset = 0;
20012   static const int * ieee80211_tag_switching_stream_flags[] = {
20013     &hf_ieee80211_tag_switching_stream_old_tid,
20014     &hf_ieee80211_tag_switching_stream_old_direction,
20015     &hf_ieee80211_tag_switching_stream_new_tid,
20016     &hf_ieee80211_tag_switching_stream_new_direction,
20017     &hf_ieee80211_tag_switching_stream_new_valid_id,
20018     &hf_ieee80211_tag_switching_stream_llt_type,
20019     NULL
20020   };
20021
20022   int param_num;
20023   if (tag_len < 4)
20024   {
20025     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);
20026     return tvb_captured_length(tvb);
20027   }
20028   offset += add_ff_band_id(tree, tvb, pinfo, 1);
20029   offset += add_ff_band_id(tree, tvb, pinfo, 1);
20030   proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_non_qos, tvb, offset, 1, ENC_NA);
20031   offset += 1;
20032   param_num = tvb_get_letohs(tvb, offset);
20033   proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_param_num, tvb, offset, 1, ENC_NA);
20034   offset += 1;
20035   while(param_num > 0)
20036   {
20037     proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_switching_stream_flags, ENC_NA);
20038     param_num--;
20039     offset += 2;
20040   }
20041   return tvb_captured_length(tvb);
20042 }
20043
20044 static void
20045 ieee_80211_add_tagged_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
20046                                   proto_tree *tree, int tagged_parameters_len, int ftype,
20047                                   association_sanity_check_t *association_sanity_check)
20048 {
20049   int next_len;
20050   beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
20051   while (tagged_parameters_len > 0) {
20052     /* TODO make callers optionally specify the list of valid IE IDs? */
20053     if ((next_len=add_tagged_field (pinfo, tree, tvb, offset, ftype, NULL, 0, association_sanity_check)) == 0)
20054       break;
20055     if (next_len > tagged_parameters_len) {
20056       /* XXX - flag this as an error? */
20057       next_len = tagged_parameters_len;
20058     }
20059     offset                += next_len;
20060     tagged_parameters_len -= next_len;
20061   }
20062 }
20063
20064 static void
20065 ieee_80211_do_association_sanity_check(packet_info *pinfo, association_sanity_check_t *sanity_check)
20066 {
20067   /* Given a [re-]association request frame, consider it in its totality and
20068      add expert information as appropriate */
20069
20070   if (sanity_check->association_has_mobility_domain_element) {
20071     /* This is an FT association, warn about any non-FT AKM suites */
20072     if (sanity_check->has_non_ft_akm_suite) {
20073       expert_add_info_format(pinfo, sanity_check->rsn_first_non_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
20074                              "Non-FT AKM suite is prohibited for FT association request");
20075     }
20076   } else {
20077     /* This is a non-FT association, warn about any FT AKM suites */
20078     if (sanity_check->has_ft_akm_suite) {
20079       expert_add_info_format(pinfo, sanity_check->rsn_first_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
20080                              "FT AKM suite is prohibited for non-FT association request");
20081     }
20082   }
20083 }
20084
20085 /* ************************************************************************* */
20086 /*                     Dissect 802.11 management frame                       */
20087 /* ************************************************************************* */
20088 static void
20089 dissect_ieee80211_mgt(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
20090 {
20091   proto_item *ti;
20092   proto_tree *mgt_tree;
20093   proto_tree *fixed_tree;
20094   proto_tree *tagged_tree;
20095   int         offset = 0;
20096   int         tagged_parameter_tree_len;
20097
20098   association_sanity_check_t association_sanity_check;
20099   memset(&association_sanity_check, 0, sizeof(association_sanity_check));
20100
20101   ieee80211_tvb_invalid = FALSE;
20102
20103   ti = proto_tree_add_item(tree, proto_wlan, tvb, 0, -1, ENC_NA);
20104   mgt_tree = proto_item_add_subtree(ti, ett_80211_mgt);
20105
20106   switch (COMPOSE_FRAME_TYPE(fcf))
20107   {
20108
20109     case MGT_ASSOC_REQ:
20110       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 4);
20111       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
20112       add_ff_listen_ival(fixed_tree, tvb, pinfo, 2);
20113       offset = 4;  /* Size of fixed fields */
20114
20115       tagged_parameter_tree_len =
20116           tvb_reported_length_remaining(tvb, offset);
20117       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20118                  tagged_parameter_tree_len);
20119       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20120           tagged_parameter_tree_len, MGT_ASSOC_REQ, &association_sanity_check);
20121       ieee_80211_do_association_sanity_check(pinfo, &association_sanity_check);
20122       break;
20123
20124
20125     case MGT_ASSOC_RESP:
20126       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
20127       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
20128       add_ff_status_code(fixed_tree, tvb, pinfo, 2);
20129       add_ff_assoc_id(fixed_tree, tvb, pinfo, 4);
20130       offset = 6;  /* Size of fixed fields */
20131
20132       tagged_parameter_tree_len =
20133           tvb_reported_length_remaining(tvb, offset);
20134       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20135                  tagged_parameter_tree_len);
20136       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20137           tagged_parameter_tree_len, MGT_ASSOC_RESP, NULL);
20138       break;
20139
20140
20141     case MGT_REASSOC_REQ:
20142       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 10);
20143       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
20144       add_ff_listen_ival(fixed_tree, tvb, pinfo, 2);
20145       add_ff_current_ap_addr(fixed_tree, tvb, pinfo, 4);
20146       offset = 10;  /* Size of fixed fields */
20147
20148       tagged_parameter_tree_len =
20149           tvb_reported_length_remaining(tvb, offset);
20150       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20151                  tagged_parameter_tree_len);
20152       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20153           tagged_parameter_tree_len, MGT_REASSOC_REQ, &association_sanity_check);
20154       ieee_80211_do_association_sanity_check(pinfo, &association_sanity_check);
20155       break;
20156
20157     case MGT_REASSOC_RESP:
20158       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
20159       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
20160       add_ff_status_code(fixed_tree, tvb, pinfo, 2);
20161       add_ff_assoc_id(fixed_tree, tvb, pinfo, 4);
20162       offset = 6;  /* Size of fixed fields */
20163
20164       tagged_parameter_tree_len =
20165           tvb_reported_length_remaining(tvb, offset);
20166       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20167                  tagged_parameter_tree_len);
20168       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20169           tagged_parameter_tree_len, MGT_REASSOC_RESP, NULL);
20170       break;
20171
20172
20173     case MGT_PROBE_REQ:
20174       offset = 0;
20175       tagged_parameter_tree_len =
20176           tvb_reported_length_remaining(tvb, offset);
20177       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20178                  tagged_parameter_tree_len);
20179       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20180           tagged_parameter_tree_len, MGT_PROBE_REQ, NULL);
20181       break;
20182
20183     case MGT_PROBE_RESP:
20184     {
20185       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
20186       add_ff_timestamp(fixed_tree, tvb, pinfo, 0);
20187       add_ff_beacon_interval(fixed_tree, tvb, pinfo, 8);
20188       add_ff_cap_info(fixed_tree, tvb, pinfo, 10);
20189       offset = 12;  /* Size of fixed fields */
20190
20191       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20192       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset, tagged_parameter_tree_len);
20193       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_PROBE_RESP, NULL);
20194       break;
20195     }
20196     case MGT_MEASUREMENT_PILOT:
20197     {
20198       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
20199       offset += add_ff_timestamp(fixed_tree, tvb, pinfo, offset);
20200       offset += add_ff_measurement_pilot_int(fixed_tree, tvb, pinfo, offset);
20201       offset += add_ff_beacon_interval(fixed_tree, tvb, pinfo, offset);
20202       offset += add_ff_cap_info(fixed_tree, tvb, pinfo, offset);
20203       offset += add_ff_country_str(fixed_tree, tvb, pinfo, offset);
20204       offset += add_ff_max_reg_pwr(fixed_tree, tvb, pinfo, offset);
20205       offset += add_ff_max_tx_pwr(fixed_tree, tvb, pinfo, offset);
20206       offset += add_ff_tx_pwr_used(fixed_tree, tvb, pinfo, offset);
20207       offset += add_ff_transceiver_noise_floor(fixed_tree, tvb, pinfo, offset);
20208       /* TODO DS Parameter Set ??? */
20209
20210       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20211       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset, tagged_parameter_tree_len);
20212       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_MEASUREMENT_PILOT, NULL);
20213       break;
20214     }
20215     case MGT_BEACON:    /* Dissect protocol payload fields  */
20216       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
20217       add_ff_timestamp(fixed_tree, tvb, pinfo, 0);
20218       add_ff_beacon_interval(fixed_tree, tvb, pinfo, 8);
20219       add_ff_cap_info(fixed_tree, tvb, pinfo, 10);
20220       offset = 12;  /* Size of fixed fields */
20221
20222       tagged_parameter_tree_len =
20223           tvb_reported_length_remaining(tvb, offset);
20224       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20225       tagged_parameter_tree_len);
20226       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20227       tagged_parameter_tree_len, MGT_BEACON, NULL);
20228       break;
20229
20230     case MGT_ATIM:
20231       break;
20232
20233     case MGT_DISASS:
20234       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 2);
20235       add_ff_reason_code(fixed_tree, tvb, pinfo, 0);
20236       offset = 2; /* Size of fixed fields */
20237       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20238       if (tagged_parameter_tree_len > 0) {
20239         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20240                                                 tagged_parameter_tree_len);
20241         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20242                                          tagged_parameter_tree_len, MGT_DISASS, NULL);
20243       }
20244       break;
20245
20246     case MGT_AUTHENTICATION:
20247       offset = 6;  /* Size of fixed fields */
20248       offset += get_ff_auth_sae_len(tvb);
20249
20250       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, offset);
20251       add_ff_auth_alg(fixed_tree, tvb, pinfo, 0);
20252       add_ff_auth_trans_seq(fixed_tree, tvb, pinfo, 2);
20253       add_ff_status_code(fixed_tree, tvb, pinfo, 4);
20254       add_ff_auth_sae(fixed_tree, tvb);
20255
20256       tagged_parameter_tree_len =
20257         tvb_reported_length_remaining(tvb, offset);
20258       if (tagged_parameter_tree_len > 0)
20259       {
20260         tagged_tree = get_tagged_parameter_tree(mgt_tree,
20261             tvb,
20262             offset,
20263             tagged_parameter_tree_len);
20264         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20265         tagged_parameter_tree_len, MGT_AUTHENTICATION, NULL);
20266       }
20267       break;
20268
20269     case MGT_DEAUTHENTICATION:
20270       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 2);
20271       add_ff_reason_code(fixed_tree, tvb, pinfo, 0);
20272       offset = 2; /* Size of fixed fields */
20273       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20274       if (tagged_parameter_tree_len > 0) {
20275         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20276                                                 tagged_parameter_tree_len);
20277         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20278                                          tagged_parameter_tree_len, MGT_DEAUTHENTICATION, NULL);
20279       }
20280       break;
20281
20282     case MGT_ACTION:
20283     {
20284       proto_item *lcl_fixed_hdr;
20285       proto_tree *lcl_fixed_tree;
20286       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
20287       offset += add_ff_action(lcl_fixed_tree, tvb, pinfo, 0);
20288
20289       proto_item_set_len(lcl_fixed_hdr, offset);
20290       if (ieee80211_tvb_invalid)
20291         break; /* Buffer not available for further processing */
20292       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20293       if (tagged_parameter_tree_len > 0)
20294       {
20295         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20296           tagged_parameter_tree_len);
20297         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20298           tagged_parameter_tree_len, MGT_ACTION, NULL);
20299       }
20300       break;
20301     }
20302     case MGT_ACTION_NO_ACK:
20303     {
20304       proto_item *lcl_fixed_hdr;
20305       proto_tree *lcl_fixed_tree;
20306       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
20307
20308       offset += add_ff_action(lcl_fixed_tree, tvb, pinfo, 0);
20309
20310       proto_item_set_len(lcl_fixed_hdr, offset);
20311       if (ieee80211_tvb_invalid)
20312         break; /* Buffer not available for further processing */
20313       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20314       if (tagged_parameter_tree_len > 0)
20315       {
20316         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20317           tagged_parameter_tree_len);
20318         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20319           tagged_parameter_tree_len, MGT_ACTION_NO_ACK, NULL);
20320       }
20321       break;
20322     }
20323     case MGT_ARUBA_WLAN:
20324     {
20325       proto_tree *aruba_tree;
20326       guint16 type;
20327       type = tvb_get_ntohs(tvb, offset);
20328
20329       aruba_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, NULL, "Aruba Management");
20330
20331       proto_tree_add_item(aruba_tree, hf_ieee80211_aruba, tvb, offset, 2, ENC_BIG_ENDIAN);
20332       offset += 2;
20333       switch(type){
20334         case 0x0003: /* MTU Size */
20335           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_mtu, tvb, offset, 2, ENC_BIG_ENDIAN);
20336         break;
20337         case 0x0005: /* HeartBeat Sequence */
20338           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_hb_seq, tvb, offset, 8, ENC_BIG_ENDIAN);
20339         break;
20340       }
20341       break;
20342     }
20343   }
20344 }
20345
20346 /*
20347  * Dissect a Block Ack request (which is also used in Trigger frames).
20348  */
20349 static const int *block_ack_control_headers[] = {
20350   &hf_ieee80211_block_ack_control_ack_policy,
20351   &hf_ieee80211_block_ack_control_type,
20352   &hf_ieee80211_block_ack_control_reserved,
20353   &hf_ieee80211_block_ack_control_tid_info,
20354   NULL
20355 };
20356
20357 static const int *multi_sta_aid_tid_headers[] = {
20358   &hf_ieee80211_block_ack_multi_sta_aid11,
20359   &hf_ieee80211_block_ack_multi_sta_ack_type,
20360   &hf_ieee80211_block_ack_multi_sta_tid,
20361  NULL
20362 };
20363
20364 /*
20365  * These bits are shown in reverse order in the spec.
20366  */
20367 #define BASIC_BLOCK_ACK               0x0
20368 #define EXTENDED_COMPRESSED_BLOCK_ACK 0x1
20369 #define COMPRESSED_BLOCK_ACK          0x2
20370 #define MULTI_TID_BLOCK_ACK           0x3
20371 #define GCR_BLOCK_ACK                 0x6
20372 #define GLK_GCR_BLOCK_ACK             0xA
20373 #define MULTI_STA_BLOCK_ACK           0xB
20374
20375 static const value_string block_ack_type_vals[] = {
20376   { BASIC_BLOCK_ACK,               "Basic BlockAck" },
20377   { EXTENDED_COMPRESSED_BLOCK_ACK, "Extended Compressed BlockAck" },
20378   { COMPRESSED_BLOCK_ACK,          "Compressed BlockAck" },
20379   { MULTI_TID_BLOCK_ACK,           "Multi-TID BlockAck" },
20380   { GCR_BLOCK_ACK,                 "GCR BlockAck" },
20381   { GLK_GCR_BLOCK_ACK,             "GLK-GCR BlockAck" },
20382   { MULTI_STA_BLOCK_ACK,           "Multi-STA BlockAck" },
20383   { 0, NULL }
20384 };
20385
20386 static int
20387 dissect_ieee80211_block_ack_details(tvbuff_t *tvb, packet_info *pinfo _U_,
20388   proto_tree *tree, int offset, gboolean isDMG, gboolean is_req, gboolean has_fcs)
20389 {
20390   proto_item     *pi;
20391   guint16         ba_control;
20392   guint8          block_ack_type;
20393   proto_tree     *ba_tree;
20394   guint8          tid_count, frag_num;
20395   guint           i;
20396   proto_tree     *ba_mtid_tree, *ba_mtid_sub_tree;
20397   guint16         ssn;
20398   guint64         bmap;
20399   int             f;
20400   proto_item     *ba_bitmap_item;
20401   proto_tree     *ba_bitmap_tree;
20402   guint16         aid_tid;
20403   proto_tree     *ba_multi_sta_tree;
20404   int             ba_start = offset;
20405
20406   ba_control = tvb_get_letohs(tvb, offset);
20407   block_ack_type = (ba_control & 0x001E) >> 1;
20408   ba_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_block_ack,
20409                         &pi, is_req ? "%s Request" : "%s Response",
20410                         val_to_str(block_ack_type, block_ack_type_vals,
20411                                 "Reserved (%d)"));
20412   proto_tree_add_bitmask_with_flags(ba_tree, tvb, offset,
20413                         hf_ieee80211_block_ack_control,
20414                         ett_block_ack_request_control,
20415                         block_ack_control_headers,
20416                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20417   offset += 2;
20418
20419   switch (block_ack_type) {
20420   case BASIC_BLOCK_ACK:
20421     if (isDMG == TRUE) {
20422       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
20423                         "DMG STAs shouldn't transmit BlockAckReq frames "
20424                         "with Basic BlockAckReqs");
20425     }
20426
20427     /* Both request and response have an SSC */
20428     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
20429
20430     if (!is_req) {
20431       proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_bitmap, tvb, offset,
20432                         128, ENC_NA);
20433       offset += 128;
20434     }
20435     break;
20436
20437   case COMPRESSED_BLOCK_ACK:
20438     /*
20439      * FIXME: For 802.11ax, the block ack bitmap can be 8 or 32 bytes
20440      * depending on the values of the fragment number subfield in the
20441      * SSC! All values other that 0 and 2 in bits B1 & B2 are reserved.
20442      */
20443     ssn = tvb_get_letohs(tvb, offset);
20444     frag_num = ssn & 0x0F;
20445     ssn >>= 4;
20446     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
20447
20448     if (!is_req) {
20449       if ((frag_num & 0x06) == 0) {
20450         bmap = tvb_get_letoh64(tvb, offset);
20451         ba_bitmap_item = proto_tree_add_item(ba_tree,
20452                           hf_ieee80211_block_ack_bitmap,
20453                           tvb, offset, 8, ENC_NA);
20454         ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item,
20455                           ett_block_ack_bitmap);
20456         for (f = 0; f < 64; f++) {
20457           if (bmap & (G_GUINT64_CONSTANT(1) << f))
20458             continue;
20459           proto_tree_add_uint_format_value(ba_bitmap_tree,
20460                           hf_ieee80211_block_ack_bitmap_missing_frame,
20461                           tvb, offset + (f/8), 1, ssn + f, "%u",
20462                           (ssn + f) & 0x0fff);
20463         }
20464         offset += 8;
20465       } else if ((frag_num & 0x06) == 2) {
20466
20467         proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_bitmap, tvb,
20468                         offset, 32, ENC_NA);
20469         offset += 32;
20470       } else {
20471         /* Reserved ... */
20472       }
20473     }
20474     break;
20475
20476   case EXTENDED_COMPRESSED_BLOCK_ACK:
20477     if (isDMG == FALSE) {
20478       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
20479                         "Non-DMG STAs shouldn't transmit BlockAckReq "
20480                         "frames with Extended Compressed BlockAckReqs");
20481     }
20482
20483     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
20484
20485     if (!is_req) {
20486       ssn = tvb_get_letohs(tvb, offset);
20487       ssn >>= 4;
20488
20489       bmap = tvb_get_letoh64(tvb, offset);
20490       ba_bitmap_item = proto_tree_add_item(ba_tree,
20491                         hf_ieee80211_block_ack_bitmap,
20492                         tvb, offset, 8, ENC_NA);
20493       ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item,
20494                         ett_block_ack_bitmap);
20495       for (f = 0; f < 64; f++) {
20496         if (bmap & (G_GUINT64_CONSTANT(1) << f))
20497           continue;
20498         proto_tree_add_uint(ba_bitmap_tree,
20499                         hf_ieee80211_block_ack_bitmap_missing_frame,
20500                         tvb, offset + (f/8), 1, ssn + f);
20501       }
20502       offset += 8;
20503       proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_RBUFCAP, tvb, offset,
20504                         1, ENC_LITTLE_ENDIAN);
20505       offset += 1;
20506     }
20507     break;
20508
20509   case MULTI_TID_BLOCK_ACK:
20510
20511     if (isDMG == TRUE) {
20512       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
20513                         "DMG STAs shouldn't transmit BlockAckReq frames "
20514                         "with Multi-TID BlockAckReqs");
20515     }
20516
20517     tid_count = ((ba_control & 0xF000) >> 12) + 1;
20518     if (is_req) {
20519       ba_mtid_tree = proto_tree_add_subtree(ba_tree, tvb, offset, tid_count*4,
20520                 ett_block_ack, NULL, "TID List");
20521       for (i = 0; i < tid_count; i++) {
20522         guint8 tid = tvb_get_guint8(tvb, offset) & 0x0F;
20523         ba_mtid_sub_tree = proto_tree_add_subtree_format(ba_mtid_tree, tvb,
20524                                 offset, 4, ett_block_ack_tid, NULL,
20525                                 "TID %u details", tid);
20526
20527         proto_tree_add_item(ba_mtid_sub_tree,
20528                 hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2,
20529                 ENC_LITTLE_ENDIAN);
20530         proto_tree_add_item(ba_mtid_sub_tree,
20531                 hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2,
20532                 ENC_LITTLE_ENDIAN);
20533         offset += 2;
20534
20535         offset += add_ff_block_ack_ssc(ba_mtid_sub_tree, tvb, pinfo, offset);
20536       }
20537     } else {
20538       ba_mtid_tree = proto_tree_add_subtree(ba_tree, tvb, offset, tid_count*4,
20539                 ett_block_ack, NULL, "TID List");
20540       for (i = 0; i < tid_count; i++) {
20541         guint8 tid = tvb_get_guint8(tvb, offset) & 0x0F;
20542         ba_mtid_sub_tree = proto_tree_add_subtree_format(ba_mtid_tree, tvb,
20543                                 offset, 4, ett_block_ack_tid, NULL,
20544                                 "TID %u details", tid);
20545
20546         proto_tree_add_item(ba_mtid_sub_tree,
20547                         hf_ieee80211_block_ack_multi_tid_reserved,
20548                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
20549         proto_tree_add_item(ba_mtid_sub_tree,
20550                         hf_ieee80211_block_ack_multi_tid_value, tvb,
20551                         offset, 2, ENC_LITTLE_ENDIAN);
20552         offset += 2;
20553
20554         offset += add_ff_block_ack_ssc(ba_mtid_sub_tree, tvb, pinfo, offset);
20555         proto_tree_add_item(ba_mtid_sub_tree,
20556                         hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
20557         offset += 8;
20558       }
20559     }
20560     break;
20561
20562   case GCR_BLOCK_ACK:
20563     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
20564
20565     proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_gcr_addr, tvb,
20566                         offset, 6, ENC_NA);
20567     offset += 6;
20568
20569     if (!is_req) {
20570       proto_tree_add_item(ba_tree,
20571                         hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
20572       offset += 8;
20573     }
20574     break;
20575
20576   case MULTI_STA_BLOCK_ACK:
20577     while (tvb_reported_length_remaining(tvb, offset) > (has_fcs ? 4 : 0)) {
20578         int start = offset;
20579         proto_item *msta_ti = NULL;
20580         aid_tid = tvb_get_letohs(tvb, offset);
20581         ba_multi_sta_tree = proto_tree_add_subtree_format(ba_tree, tvb, offset, -1,
20582                                 ett_multi_sta_block_ack, &msta_ti,
20583                                 "Per AID TID Info: 0x%0x", aid_tid & 0x07ff);
20584         proto_tree_add_bitmask_with_flags(ba_multi_sta_tree, tvb, offset,
20585                         hf_ieee80211_block_ack_multi_sta_aid_tid,
20586                         ett_block_ack_request_multi_sta_aid_tid,
20587                         multi_sta_aid_tid_headers,
20588                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20589         offset += 2;
20590
20591         if ((aid_tid & 0x07ff) != 2045) {
20592           if (((aid_tid & 0x0800) == 0) && (aid_tid & 0xf000) <= 7) {
20593             guint8 bitmap_size;
20594             frag_num = tvb_get_guint8(tvb, offset);
20595             offset += add_ff_block_ack_ssc(ba_multi_sta_tree, tvb, pinfo, offset);
20596             bitmap_size = ((frag_num + 2) & 0x6) >> 1;  /* Turn into an exponent */
20597             bitmap_size = 4 << bitmap_size;  /* It goes 4, 8, 16, 32 */
20598             proto_tree_add_item(ba_multi_sta_tree, hf_ieee80211_block_ack_bitmap, tvb,
20599                         offset, bitmap_size, ENC_NA);
20600             offset += bitmap_size;
20601           }
20602         } else {
20603           offset += add_ff_block_ack_ssc(ba_multi_sta_tree, tvb, pinfo, offset);
20604           proto_tree_add_item(ba_multi_sta_tree, hf_ieee80211_block_ack_multi_sta_reserved,
20605                                 tvb, offset, 2, ENC_LITTLE_ENDIAN);
20606           offset += 2;
20607           proto_tree_add_item(ba_multi_sta_tree, hf_ieee80211_block_ack_multi_sta_ra,
20608                                 tvb, offset, 6, ENC_NA);
20609           offset += 6;
20610         }
20611         proto_item_set_len(msta_ti, offset - start);
20612     }
20613     break;
20614   }
20615   proto_item_set_len(pi, offset - ba_start);
20616
20617   return offset;
20618 }
20619
20620 static int
20621 dissect_ieee80211_block_ack(tvbuff_t *tvb, packet_info *pinfo _U_,
20622   proto_tree *tree, int offset, gboolean isDMG, gboolean is_req, gboolean has_fcs)
20623 {
20624   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
20625   proto_item     *hidden_item;
20626
20627   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
20628   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved, tvb,
20629                         offset, 6, ether_name);
20630   PROTO_ITEM_SET_HIDDEN(hidden_item);
20631   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
20632                         ENC_NA);
20633   PROTO_ITEM_SET_HIDDEN(hidden_item);
20634   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
20635                         offset, 6, ether_name);
20636   PROTO_ITEM_SET_HIDDEN(hidden_item);
20637   offset += 6;
20638
20639   return dissect_ieee80211_block_ack_details(tvb, pinfo, tree, offset, isDMG, is_req, has_fcs);
20640 }
20641
20642 /*
20643  * Dissect an 802.11ax HE Trigger frame and return the actual len including
20644  * padding!
20645  */
20646
20647 #define TRIGGER_TYPE_BASIC      0
20648 #define TRIGGER_TYPE_BRP        1
20649 #define TRIGGER_TYPE_MU_BAR     2
20650 #define TRIGGER_TYPE_MU_RTS     3
20651 #define TRIGGER_TYPE_BSRP       4
20652 #define TRIGGER_TYPE_GCR_MU_BAR 5
20653 #define TRIGGER_TYPE_BQRP       6
20654 #define TRIGGER_TYPE_NFRP       7
20655
20656 static const val64_string trigger_type_vals[] = {
20657   { 0, "Basic" },
20658   { 1, "Beamforming Report Poll (BRP)" },
20659   { 2, "MU-BAR" },
20660   { 3, "MU-RTS" },
20661   { 4, "Buffer Status Report Poll (BSRP)" },
20662   { 5, "GCR MU-BAR" },
20663   { 6, "Bandwidth Query Report Poll (BQRP)" },
20664   { 7, "NDP Feedback Report Poll (NFRP)" },
20665   { 0, NULL }
20666 };
20667
20668 static const val64_string bw_subfield_vals[] = {
20669   { 0, "20 MHz" },
20670   { 1, "40 MHz" },
20671   { 2, "80 MHz" },
20672   { 3, "80+80 MHz or 160 MHz" },
20673   { 0, NULL }
20674 };
20675
20676 static const val64_string gi_and_ltf_type_subfield_vals[] = {
20677   { 0, "1x LTF + 1.6 us GI" },
20678   { 1, "2x LTF + 1.6 us GI" },
20679   { 2, "4x LTF + 3.2 us GI" },
20680   { 3, "Reserved" },
20681   { 0, NULL }
20682 };
20683
20684 static const true_false_string mu_mimo_ltf_mode_tfs = {
20685   "HE masked HE LTF sequence mode",
20686   "HE single stream pilot HE LTF mode"
20687 };
20688
20689 static const int *he_trig_frm_bar_ctrl_fields[] = {
20690   &hf_ieee80211_he_trigger_bar_ctrl_ba_ack_policy,
20691   &hf_ieee80211_he_trigger_bar_ctrl_ba_type,
20692   &hf_ieee80211_he_trigger_bar_ctrl_reserved,
20693   &hf_ieee80211_he_trigger_bar_ctrl_tid_info,
20694   NULL
20695 };
20696
20697 static const int *he_trig_frm_bar_info_fields[] = {
20698   &hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl,
20699   NULL
20700 };
20701
20702 static void
20703 add_gcr_mu_bar_trigger_frame_common_info(proto_tree *tree, tvbuff_t *tvb,
20704   int offset)
20705 {
20706
20707   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
20708                         hf_ieee80211_he_trigger_bar_ctrl,
20709                         ett_he_trigger_bar_ctrl,
20710                         he_trig_frm_bar_ctrl_fields,
20711                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20712   offset += 2;
20713
20714   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
20715                         hf_ieee80211_he_trigger_bar_info,
20716                         ett_he_trigger_bar_info,
20717                         he_trig_frm_bar_info_fields,
20718                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20719 }
20720
20721 static const int *common_info_headers[] = {
20722   &hf_ieee80211_he_trigger_type,
20723   &hf_ieee80211_he_trigger_length,
20724   &hf_ieee80211_he_trigger_cascade_indication,
20725   &hf_ieee80211_he_trigger_cs_required,
20726   &hf_ieee80211_he_trigger_bw,
20727   &hf_ieee80211_he_trigger_gi_and_ltf_type,
20728   &hf_ieee80211_he_trigger_mu_mimo_ltf_mode,
20729   &hf_ieee80211_he_trigger_num_he_ltf_syms_etc,
20730   &hf_ieee80211_he_trigger_stbc,
20731   &hf_ieee80211_he_trigger_ldpc_extra_sym_seg,
20732   &hf_ieee80211_he_trigger_ap_tx_power,
20733   &hf_ieee80211_he_trigger_packet_extension,
20734   &hf_ieee80211_he_trigger_spatial_reuse,
20735   &hf_ieee80211_he_trigger_doppler,
20736   &hf_ieee80211_he_trigger_he_sig_a_reserved,
20737   &hf_ieee80211_he_trigger_reserved,
20738   NULL
20739 };
20740
20741 static int
20742 add_he_trigger_common_info(proto_tree *tree, tvbuff_t *tvb, int offset,
20743   packet_info *pinfo _U_, guint8 trigger_type, int *frame_len)
20744 {
20745   proto_item     *pi = NULL;
20746   proto_tree     *common_info = NULL;
20747   int            length = 0;
20748   int            start_offset = offset;
20749
20750   common_info = proto_tree_add_subtree(tree, tvb, offset, -1,
20751                         ett_he_trigger_common_info, &pi, "Common Info");
20752
20753   proto_tree_add_bitmask_with_flags(common_info, tvb, offset,
20754                         hf_ieee80211_he_trigger_common_info,
20755                         ett_he_trigger_base_common_info,
20756                         common_info_headers,
20757                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20758   offset += 8;
20759   length += 8;
20760
20761   /*
20762    * Handle the trigger dependent common info
20763    */
20764   switch (trigger_type) {
20765     case TRIGGER_TYPE_GCR_MU_BAR: /* Actually two uint16 fields */
20766       add_gcr_mu_bar_trigger_frame_common_info(common_info, tvb, offset);
20767       offset += 4;
20768       length += 4;
20769       break;
20770     default: /* No other type has a trigger dependent common info subfield */
20771       break;
20772   }
20773   proto_item_set_len(pi, offset - start_offset);
20774
20775   *frame_len += length;
20776   return length;
20777 }
20778
20779 static const true_false_string he_trigger_coding_type_tfs = {
20780   "LDPC",
20781   "BCC"
20782 };
20783
20784 static const value_string preferred_ac_vals[] = {
20785   { 0, "AC_BK" },
20786   { 1, "AC_BE" },
20787   { 2, "AC_VI" },
20788   { 3, "AC_VO" },
20789   { 0, NULL }
20790 };
20791
20792 static const int *basic_trigger_dependent_user_headers[] = {
20793   &hf_ieee80211_he_trigger_mpdu_mu_spacing,
20794   &hf_ieee80211_he_trigger_tid_aggregation_limit,
20795   &hf_ieee80211_he_trigger_dependent_reserved1,
20796   &hf_ieee80211_he_trigger_preferred_ac,
20797   NULL
20798 };
20799
20800 static void
20801 add_basic_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
20802   int offset)
20803 {
20804   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
20805                         hf_ieee80211_he_trigger_dep_basic_user_info,
20806                         ett_he_trigger_dep_basic_user_info,
20807                         basic_trigger_dependent_user_headers,
20808                         ENC_NA, BMT_NO_APPEND);
20809 }
20810
20811 static void
20812 add_brp_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
20813   int offset)
20814 {
20815   proto_tree_add_item(tree, hf_ieee80211_he_trigger_feedback_seg_retrans_bm,
20816                         tvb, offset, 1, ENC_NA);
20817 }
20818
20819 static int
20820 add_mu_bar_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
20821   int offset, packet_info *pinfo, int *frame_len)
20822 {
20823   int start_offset = offset;
20824
20825   /*
20826    * It's a request and not DMG, I think. Also, it is only supposed to be
20827    * a compressed block ack or a multi-tid block ack request.
20828    */
20829   offset = dissect_ieee80211_block_ack_details(tvb, pinfo, tree, offset,
20830                         FALSE, TRUE, FALSE);
20831
20832   *frame_len += offset - start_offset;
20833
20834   return offset;
20835 }
20836
20837
20838 static const int *nfrp_trigger_dependent_user_headers[] = {
20839   &hf_ieee80211_he_trigger_starting_aid,
20840   &hf_ieee80211_he_trigger_dependent_reserved2,
20841   &hf_ieee80211_he_trigger_feedback_type,
20842   &hf_ieee80211_he_trigger_dependent_reserved3,
20843   &hf_ieee80211_he_trigger_nfrp_target_rssi,
20844   &hf_ieee80211_he_trigger_multiplexing_flag,
20845   NULL
20846 };
20847
20848 static void
20849 add_nfrp_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
20850   int offset)
20851 {
20852   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
20853                         hf_ieee80211_he_trigger_dep_nfrp_user_info,
20854                         ett_he_trigger_dep_nfrp_user_info,
20855                         nfrp_trigger_dependent_user_headers,
20856                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20857 }
20858
20859 /*
20860  * Print the target RSSI field as per the spec.
20861  *  0->90 map to -110 to -20 dBm.
20862  *  127 maps to Max ransmit power for assigned MCS
20863  *  rest are reserved.
20864  */
20865 static void
20866 target_rssi_base_custom(gchar *result, guint32 target_rssi)
20867 {
20868   if (target_rssi <= 90) {
20869     g_snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -110 + target_rssi);
20870   } else if (target_rssi == 127) {
20871     g_snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power");
20872   } else {
20873     g_snprintf(result, ITEM_LABEL_LENGTH, "Reserved");
20874   }
20875 }
20876
20877 static const int *user_info_headers[] = {
20878   &hf_ieee80211_he_trigger_aid12,
20879   &hf_ieee80211_he_trigger_ru_allocation,
20880   &hf_ieee80211_he_trigger_coding_type,
20881   &hf_ieee80211_he_trigger_mcs,
20882   &hf_ieee80211_he_trigger_dcm,
20883   &hf_ieee80211_he_trigger_ss_allocation,
20884   &hf_ieee80211_he_trigger_target_rssi,
20885   &hf_ieee80211_he_trigger_user_reserved,
20886   NULL
20887 };
20888
20889 static int
20890 add_he_trigger_user_info(proto_tree *tree, tvbuff_t *tvb, int offset,
20891   packet_info *pinfo, guint8 trigger_type, int *frame_len)
20892 {
20893   proto_item     *pi = NULL;
20894   proto_tree     *user_info = NULL;
20895   int            length = 0;
20896   int            start_offset = offset;
20897   guint16         aid12_subfield = 0;
20898
20899   /*
20900    * If the AID12 subfield has the value 4095 it indicates the start of
20901    * the padding field.
20902    */
20903   user_info = proto_tree_add_subtree(tree, tvb, offset, -1,
20904                         ett_he_trigger_user_info, &pi, "User Info");
20905   aid12_subfield = tvb_get_letohs(tvb, offset) >> 4;
20906
20907   while (aid12_subfield != 4095) {
20908     proto_tree_add_bitmask_with_flags(user_info, tvb, offset,
20909                         hf_ieee80211_he_trigger_user_info,
20910                         ett_he_trigger_base_user_info,
20911                         user_info_headers,
20912                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20913     offset += 5;
20914     length += 5;
20915
20916     /*
20917      * Handle the trigger dependent user info
20918      */
20919     switch (trigger_type) {
20920       case TRIGGER_TYPE_BASIC:
20921         add_basic_trigger_dependent_user_info(user_info, tvb, offset);
20922         offset++;
20923         length++;
20924         break;
20925       case TRIGGER_TYPE_BRP:
20926         add_brp_trigger_dependent_user_info(user_info, tvb, offset);
20927         offset++;
20928         length++;
20929         break;
20930       case TRIGGER_TYPE_MU_BAR:
20931         /* This is variable length so we need it to update the length */
20932         offset += add_mu_bar_trigger_dependent_user_info(user_info, tvb,
20933                                 offset, pinfo, &length);
20934         break;
20935       case TRIGGER_TYPE_NFRP:
20936         add_nfrp_trigger_dependent_user_info(user_info, tvb, offset);
20937         offset += 5;
20938         length += 5;
20939         break;
20940       default:
20941         break;
20942     }
20943
20944     aid12_subfield = tvb_get_letohs(tvb, offset) >> 4;
20945   }
20946
20947   proto_item_set_len(pi, offset - start_offset);
20948
20949   *frame_len += length;
20950   return length;
20951 }
20952
20953 static int
20954 dissect_ieee80211_he_trigger(tvbuff_t *tvb, packet_info *pinfo _U_,
20955   proto_tree *tree, int offset)
20956 {
20957   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
20958   proto_item      *hidden_item;
20959   guint8          trigger_type = 0;
20960   int             length = 0;
20961
20962   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
20963   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved,
20964                         tvb, offset, 6, ether_name);
20965   PROTO_ITEM_SET_HIDDEN(hidden_item);
20966   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
20967                         ENC_NA);
20968   PROTO_ITEM_SET_HIDDEN(hidden_item);
20969   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
20970                         offset, 6, ether_name);
20971   PROTO_ITEM_SET_HIDDEN(hidden_item);
20972
20973   offset += 6;
20974   length += 6;
20975
20976   trigger_type = tvb_get_guint8(tvb, offset) & 0x0F;
20977   col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
20978                 val64_to_str(trigger_type, trigger_type_vals, "Reserved"));
20979   /*
20980    * Deal with the common Info and then any user info after that.
20981    */
20982   offset += add_he_trigger_common_info(tree, tvb, offset, pinfo,
20983                         trigger_type, &length);
20984
20985   /*
20986    * Now the User Info field.
20987    */
20988   /*offset +=*/ add_he_trigger_user_info(tree, tvb, offset, pinfo,
20989                         trigger_type, &length);
20990
20991   /*
20992    *  Padding should commence here ... TODO, deal with it.
20993    */
20994
20995   return length;
20996 }
20997
20998 /*
20999  * Dissect a VHT or an HE NDP accouncement frame. They differ past
21000  * the sounding dialog token with a bit in the SDT indicating VHT vs HE.
21001  */
21002 #define NDP_ANNC_VHT_HE 0x02
21003
21004 static const true_false_string he_ndp_annc_he_subfield_vals = {
21005   "HE NDP Announcement frame",
21006   "VHT NDP Announcement frame"
21007 };
21008
21009 static const int *vht_ndp_headers[] = {
21010   &hf_ieee80211_vht_ndp_annc_token_reserved,
21011   &hf_ieee80211_vht_ndp_annc_he_subfield,
21012   &hf_ieee80211_vht_ndp_annc_token_number,
21013   NULL
21014 };
21015
21016 static int
21017 dissect_ieee80211_vht_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
21018   proto_tree *tree, int offset, gboolean has_fcs)
21019 {
21020   guint16          sta_info;
21021   guint8           len_fcs = 0;
21022   proto_tree      *sta_list;
21023   proto_item      *sta_info_item, *pi;
21024   int              saved_offset = 0;
21025   int              sta_index = 0;
21026
21027   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
21028                         hf_ieee80211_vht_ndp_annc_token, ett_vht_ndp_annc,
21029                         vht_ndp_headers, ENC_NA, BMT_NO_APPEND);
21030   offset++;
21031
21032   if (has_fcs){
21033     len_fcs = 4;
21034   }
21035
21036   sta_list = proto_tree_add_subtree(tree, tvb, offset, -1,
21037                         ett_vht_ndp_annc_sta_list, &pi, "STA list");
21038   saved_offset = offset;
21039
21040   while (tvb_reported_length_remaining(tvb, offset) > len_fcs) {
21041     sta_info_item = proto_tree_add_subtree_format(sta_list, tvb, offset, 2,
21042                         ett_vht_ndp_annc_sta_info_tree, NULL, "STA %d",
21043                         sta_index++);
21044     proto_tree_add_item(sta_info_item, hf_ieee80211_vht_ndp_annc_sta_info_aid12,
21045                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
21046     proto_tree_add_item(sta_info_item, hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
21047                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
21048
21049     sta_info = tvb_get_letohs(tvb, offset);
21050
21051     if (sta_info & 0x1000)
21052        proto_tree_add_uint(sta_info_item,
21053                            hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
21054                            tvb, offset, 2, sta_info);
21055     else
21056        proto_tree_add_item(sta_info_item, hf_ieee80211_vht_ndp_annc_sta_info_reserved,
21057                            tvb, offset, 2, ENC_LITTLE_ENDIAN);
21058     offset += 2;
21059   }
21060
21061   proto_item_set_len(pi, offset - saved_offset);
21062   return offset;
21063 }
21064
21065 /*
21066  * Format the partial BW as two 7 bit fields.
21067  */
21068 static void
21069 partial_bw_info_base_custom(gchar *result, guint32 partial_bw)
21070 {
21071     g_snprintf(result, ITEM_LABEL_LENGTH,
21072                 "RU Start Index:0x%0x, RU End Index:0x%0x",
21073                 partial_bw >> 7, partial_bw & 0x7F);
21074 }
21075
21076 static const int *he_ndp_headers[] = {
21077   &hf_he_ndp_annc_reserved,
21078   &hf_he_ndp_annc_he_subfield,
21079   &hf_he_ndp_sounding_dialog_token_number,
21080   NULL
21081 };
21082
21083 static const int *he_ndp_sta_headers[] = {
21084   &hf_he_ndp_annc_aid11,
21085   &hf_he_ndp_annc_partial_bw_info,
21086   &hf_he_ndp_annc_feedback_type_and_ng,
21087   &hf_he_ndp_annc_disambiguation,
21088   &hf_he_ndp_annc_codebook_size,
21089   &hf_he_ndp_annc_nc,
21090   NULL
21091 };
21092
21093 static int
21094 dissect_ieee80211_he_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
21095   proto_tree *tree, int offset, gboolean has_fcs)
21096 {
21097   guint8           len_fcs = 0;
21098   proto_tree      *sta_list;
21099   proto_item      *pi;
21100   int              saved_offset;
21101   int              sta_index = 0;
21102
21103   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
21104                         hf_ieee80211_he_ndp_annc_token, ett_he_ndp_annc,
21105                         he_ndp_headers, ENC_NA, BMT_NO_APPEND);
21106   offset++;
21107
21108   if (has_fcs){
21109     len_fcs = 4;
21110   }
21111
21112   saved_offset = offset;
21113   sta_list = proto_tree_add_subtree(tree, tvb, offset, -1,
21114                         ett_he_ndp_annc_sta_list, &pi, "STA list");
21115
21116   while (tvb_reported_length_remaining(tvb, offset) > len_fcs) {
21117     proto_tree *sta_item;
21118
21119     sta_item = proto_tree_add_subtree_format(sta_list, tvb, offset, 4,
21120                         ett_he_ndp_annc_sta_item, NULL, "STA %d", sta_index++);
21121     proto_tree_add_bitmask_with_flags(sta_item, tvb, offset,
21122                         hf_ieee80211_he_ndp_annc_sta, ett_he_ndp_annc_sta_info,
21123                         he_ndp_sta_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
21124
21125     offset += 4;
21126   }
21127
21128   proto_item_set_len(pi, offset - saved_offset);
21129   return offset;
21130 }
21131
21132 static int
21133 dissect_ieee80211_vht_he_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
21134   proto_tree *tree, int offset, gboolean has_fcs)
21135 {
21136   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21137   proto_item      *hidden_item;
21138   guint8           dialog_token;
21139
21140   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21141   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved, tvb,
21142                         offset, 6, ether_name);
21143   PROTO_ITEM_SET_HIDDEN(hidden_item);
21144   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
21145                         ENC_NA);
21146   PROTO_ITEM_SET_HIDDEN(hidden_item);
21147   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
21148                         offset, 6, ether_name);
21149   PROTO_ITEM_SET_HIDDEN(hidden_item);
21150   offset += 6;
21151
21152   dialog_token = tvb_get_guint8(tvb, offset);
21153
21154   /*
21155    * Is it VHT or HE?
21156    */
21157   if (dialog_token & NDP_ANNC_VHT_HE) {
21158     return dissect_ieee80211_he_ndp_annc(tvb, pinfo, tree, offset, has_fcs);
21159   } else {
21160     return dissect_ieee80211_vht_ndp_annc(tvb, pinfo, tree, offset, has_fcs);
21161   }
21162 }
21163
21164 static void
21165 set_src_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
21166 {
21167   address      ether_addr;
21168
21169   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
21170
21171   col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
21172         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
21173 }
21174
21175 static void
21176 set_dst_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
21177 {
21178   address      ether_addr;
21179
21180   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
21181
21182   col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
21183         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
21184 }
21185
21186 static guint32
21187 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
21188 {
21189   guint32 c_crc;
21190
21191   c_crc = crc32_ccitt_tvb(tvb, hdr_len);
21192   c_crc = crc32_ccitt_tvb_offset_seed(tvb, hdr_size, len, ~c_crc);
21193
21194   return (c_crc);
21195 }
21196
21197 typedef enum {
21198     ENCAP_802_2,
21199     ENCAP_IPX,
21200     ENCAP_ETHERNET
21201 } encap_t;
21202
21203 /* ************************************************************************* */
21204 /*                          Dissect 802.11 frame                             */
21205 /* ************************************************************************* */
21206 /*
21207  * The 802.11n specification makes some fairly significant changes to the
21208  * layout of the MAC header.  The first two bits of the MAC header are the
21209  * protocol version.  You'd think that the 802.11 committee would have
21210  * bumped the version to indicate a different MAC layout, but NOOOO -- we
21211  * have to go digging for bits in various locations instead.
21212  */
21213 static int
21214 dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
21215                           proto_tree *tree, guint32 option_flags,
21216                           struct ieee_802_11_phdr *phdr)
21217 {
21218   guint16          fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
21219   guint16          cw_fcf;
21220   guint16          seq_control;
21221   guint32          seq_number, frag_number;
21222   gboolean         more_frags;
21223   proto_item      *ti          = NULL;
21224   proto_item      *cw_item     = NULL;
21225   proto_item      *hidden_item;
21226   proto_tree      *cw_tree     = NULL;
21227   guint16          hdr_len, ohdr_len;
21228   guint16          htc_len     = 0;
21229   gboolean         has_fcs;
21230   gint             len, reported_len, ivlen;
21231   gint             sta_addr_offset = 0;
21232   const gchar     *station_name;
21233   gboolean         is_amsdu    = 0;
21234   gboolean         save_fragmented;
21235   guint32          addr_type;
21236   guint8           octet1, octet2;
21237   char             out_buff[SHORT_STR];
21238   gint             is_iv_bad;
21239   guchar           iv_buff[4];
21240   const char      *addr1_str   = "RA";
21241   guint            offset;
21242   const gchar     *fts_str;
21243   gchar            flag_str[]  = "opmPRMFTC";
21244   gint             ii;
21245   guint16          qosoff      = 0;
21246   guint16          qos_control = 0;
21247   gint             meshctl_len = 0;
21248   guint8           mesh_flags;
21249   guint16          meshoff     = 0;
21250   static wlan_hdr_t whdrs[4];
21251   gboolean         retransmitted;
21252   gboolean         isDMG = (phdr->has_frequency ?
21253                                 IS_80211AD(phdr->frequency) :
21254                                 FALSE);
21255
21256   encap_t     encap_type;
21257   proto_tree *hdr_tree = NULL;
21258   tvbuff_t   *next_tvb = NULL;
21259   wlan_hdr_t *whdr;
21260
21261   DOT11DECRYPT_KEY_ITEM  used_key;
21262
21263   p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY, GINT_TO_POINTER(isDMG));
21264
21265   whdr= &whdrs[0];
21266
21267   col_set_str(pinfo->cinfo, COL_PROTOCOL, "802.11");
21268   col_clear(pinfo->cinfo, COL_INFO);
21269
21270   fcf = FETCH_FCF(0);
21271   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
21272   whdr->type = frame_type_subtype;
21273   if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
21274     ctrl_fcf = FETCH_FCF(10);
21275   else
21276     ctrl_fcf = 0;
21277
21278   fts_str = val_to_str_ext_const(frame_type_subtype, &frame_type_subtype_vals_ext,
21279                                  "Unrecognized (Reserved frame)");
21280   col_set_str(pinfo->cinfo, COL_INFO, fts_str);
21281
21282
21283 # define FROM_TO_DS 3
21284   flags = FCF_FLAGS(fcf);
21285   more_frags = HAVE_FRAGMENTS(flags);
21286
21287   for (ii = 0; ii < 8; ii++) {
21288     if (! (flags & 0x80 >> ii)) {
21289       flag_str[ii] = '.';
21290     }
21291   }
21292
21293   switch (FCF_FRAME_TYPE (fcf)) {
21294
21295   case MGT_FRAME:
21296     hdr_len = MGT_FRAME_HDR_LEN;
21297     if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
21298       /*
21299        * Management frames with the Order bit set have an HT Control field;
21300        * see 8.2.4.1.10 "Order field".  If they're not HT frames, they should
21301        * never have the Order bit set.
21302        */
21303       hdr_len += 4;
21304       htc_len = 4;
21305     }
21306     break;
21307
21308   case CONTROL_FRAME:
21309     if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
21310       hdr_len = 6;
21311       cw_fcf = ctrl_fcf;
21312     } else {
21313       hdr_len = 0;
21314       cw_fcf = fcf;
21315     }
21316     switch (COMPOSE_FRAME_TYPE (cw_fcf)) {
21317
21318     case CTRL_TRIGGER:
21319       /*
21320        * This is a variable length frame ... we set the real length below
21321        * and since the common info is variable, just set the hdr len to
21322        * the fixed portion, 16. There can also be one or more user-info
21323        * sections, followed by padding.
21324        */
21325       hdr_len = 16;
21326       break;
21327
21328     case CTRL_BEAMFORM_RPT_POLL:
21329       hdr_len += 17;
21330       break;
21331
21332     case CTRL_VHT_NDP_ANNC:
21333       hdr_len += 17;
21334       /* TODO: for now we only consider a single STA, add support for more */
21335       hdr_len += 2;
21336       break;
21337
21338     case CTRL_CTS:
21339     case CTRL_ACKNOWLEDGEMENT:
21340       hdr_len += 10;
21341       break;
21342
21343     case CTRL_POLL:
21344       hdr_len += 18;
21345       break;
21346
21347     case CTRL_SPR:
21348     case CTRL_GRANT:
21349     case CTRL_GRANT_ACK:
21350       hdr_len += 23;
21351       break;
21352
21353     case CTRL_DMG_CTS:
21354       hdr_len += 16;
21355       break;
21356
21357     case CTRL_DMG_DTS:
21358     case CTRL_SSW:
21359       hdr_len += 22;
21360       break;
21361
21362     case CTRL_SSW_FEEDBACK:
21363     case CTRL_SSW_ACK:
21364       hdr_len += 24;
21365       break;
21366
21367     case CTRL_RTS:
21368     case CTRL_PS_POLL:
21369     case CTRL_CFP_END:
21370     case CTRL_CFP_ENDACK:
21371     case CTRL_BLOCK_ACK_REQ:
21372     case CTRL_BLOCK_ACK:
21373       hdr_len += 16;
21374       break;
21375
21376     default:
21377       hdr_len += 4;  /* XXX */
21378       break;
21379     }
21380     break;
21381
21382   case DATA_FRAME:
21383     hdr_len = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
21384
21385     if ((option_flags & IEEE80211_COMMON_OPT_NORMAL_QOS) && DATA_FRAME_IS_QOS(frame_type_subtype)) {
21386       /* QoS frame */
21387       qosoff = hdr_len;
21388       hdr_len += 2; /* Include the QoS field in the header length */
21389
21390       if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
21391         /*
21392          * QoS data frames with the Order bit set have an HT Control field;
21393          * see 8.2.4.1.10 "Order field".  If they're not HT frames, they
21394          * should never have the Order bit set.
21395          */
21396         hdr_len += 4;
21397         htc_len = 4;
21398       }
21399
21400       /*
21401        * Does it look as if we have a mesh header?
21402        * Look at the Mesh Control subfield of the QoS field and at the
21403        * purported mesh flag fields.
21404        */
21405       qos_control = tvb_get_letohs(tvb, qosoff);
21406       if (tvb_bytes_exist(tvb, hdr_len, 1)) {
21407         meshoff = hdr_len;
21408         mesh_flags = tvb_get_guint8(tvb, meshoff);
21409         if (has_mesh_control(fcf, qos_control, mesh_flags)) {
21410           /* Yes, add the length of that in as well. */
21411           meshctl_len = find_mesh_control_length(mesh_flags);
21412           hdr_len += meshctl_len;
21413         }
21414       }
21415     }
21416     break;
21417
21418   case EXTENSION_FRAME:
21419     hdr_len = 10;
21420     break;
21421
21422   default:
21423     hdr_len = 4;  /* XXX */
21424     break;
21425   }
21426
21427   /*
21428    * Some portions of this code calculate offsets relative to the end of the
21429    * header.  But when the header has been padded to align the data this must
21430    * be done relative to true header size, not the padded/aligned value.  To
21431    * simplify this work we stash the original header size in ohdr_len instead
21432    * of recalculating it every time we need it.
21433    */
21434   ohdr_len = hdr_len;
21435   if (phdr->datapad) {
21436     /*
21437      * Add in Atheros padding between the 802.11 header and body.
21438      *
21439      * XXX - would the mesh header be part of the header or the body
21440      * from the point of view of the Atheros adapters that insert
21441      * the padding, assuming they even recognize a mesh header?
21442      */
21443     hdr_len = roundup2(hdr_len, 4);
21444   }
21445
21446   /* Add the FC and duration/id to the current tree */
21447   ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
21448                                            "IEEE 802.11 %s", fts_str);
21449   hdr_tree = proto_item_add_subtree(ti, ett_80211);
21450
21451   dissect_frame_control(hdr_tree, tvb, option_flags, 0, pinfo);
21452   dissect_durid(hdr_tree, tvb, frame_type_subtype, 2);
21453
21454   switch (phdr->fcs_len)
21455     {
21456       case 0: /* Definitely has no FCS */
21457         has_fcs = FALSE;
21458         break;
21459
21460       case 4: /* Definitely has an FCS */
21461         has_fcs = TRUE;
21462         break;
21463
21464       case -2: /* Data frames have no FCS, other frames may have an FCS */
21465                /* XXX: -2 currently used only in wiretap/netmon.c       */
21466         if (FCF_FRAME_TYPE (fcf) == DATA_FRAME)
21467           has_fcs = FALSE;
21468         else /* Management, Control, Extension */
21469           has_fcs = wlan_check_fcs;
21470         break;
21471
21472       default: /* Don't know - use "wlan_check_fcs" */
21473         has_fcs = wlan_check_fcs;
21474         break;
21475     }
21476
21477   /*
21478    * Decode the part of the frame header that isn't the same for all
21479    * frame types.
21480    */
21481   seq_control = 0;
21482   frag_number = 0;
21483   seq_number = 0;
21484
21485   /* all frames have address 1 = RA */
21486   if (tree) {
21487     const gchar *ether_name = tvb_get_ether_name(tvb, 4);
21488     proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
21489     hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ra_resolved, tvb, 4, 6, ether_name);
21490     PROTO_ITEM_SET_HIDDEN(hidden_item);
21491     hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
21492     PROTO_ITEM_SET_HIDDEN(hidden_item);
21493     hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 4, 6, ether_name);
21494     PROTO_ITEM_SET_HIDDEN(hidden_item);
21495   }
21496
21497   switch (FCF_FRAME_TYPE (fcf))
21498   {
21499
21500     case MGT_FRAME:
21501       /*
21502        * All management frame types have the same header.
21503        */
21504       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, 10);
21505       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
21506       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, 4);
21507       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
21508
21509       /* for tap */
21510       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, 16);
21511       copy_address_shallow(&whdr->src, &pinfo->dl_src);
21512       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
21513
21514       seq_control = tvb_get_letohs(tvb, 22);
21515       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
21516       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
21517
21518       col_append_fstr(pinfo->cinfo, COL_INFO,
21519             ", SN=%d", seq_number);
21520
21521       col_append_fstr(pinfo->cinfo, COL_INFO,
21522             ", FN=%d", frag_number);
21523
21524       if (tree)
21525       {
21526         const gchar *ra_da_name, *ta_sa_name, *bssid_name;
21527
21528         ra_da_name = tvb_get_ether_name(tvb, 4);
21529         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
21530         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, 4, 6, ra_da_name);
21531         PROTO_ITEM_SET_HIDDEN(hidden_item);
21532         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
21533         ta_sa_name = tvb_get_ether_name(tvb, 10);
21534         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, 10, 6, ta_sa_name);
21535         PROTO_ITEM_SET_HIDDEN(hidden_item);
21536         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
21537         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, 10, 6, ta_sa_name);
21538         PROTO_ITEM_SET_HIDDEN(hidden_item);
21539         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
21540         bssid_name = tvb_get_ether_name(tvb, 16);
21541         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, 16, 6, bssid_name);
21542         PROTO_ITEM_SET_HIDDEN(hidden_item);
21543
21544         /* FIXME: With mgmt frames FROM_TO_DS is always 0, perhaps compare address to bssid instead? */
21545         if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
21546           sta_addr_offset = 4;
21547         } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
21548           sta_addr_offset = 10;
21549         }
21550         if (sta_addr_offset > 0) {
21551           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
21552           station_name = tvb_get_ether_name(tvb, sta_addr_offset);
21553           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
21554           PROTO_ITEM_SET_HIDDEN(hidden_item);
21555         }
21556         /* add items for wlan.addr filter */
21557         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
21558         PROTO_ITEM_SET_HIDDEN(hidden_item);
21559         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 10, 6, ta_sa_name);
21560         PROTO_ITEM_SET_HIDDEN(hidden_item);
21561         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
21562         PROTO_ITEM_SET_HIDDEN(hidden_item);
21563         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 16, 6, bssid_name);
21564         PROTO_ITEM_SET_HIDDEN(hidden_item);
21565         proto_tree_add_item(hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
21566         proto_tree_add_item(hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
21567       }
21568       break;
21569
21570     case CONTROL_FRAME:
21571     {
21572       /*
21573        * Control Wrapper frames insert themselves between address 1
21574        * and address 2 in a normal control frame.  Process address 1
21575        * first, then handle the rest of the frame in dissect_control.
21576        */
21577       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
21578         offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
21579         ctrl_fcf = FETCH_FCF(10);
21580         ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
21581       } else {
21582         offset = 10; /* FC + D/ID + Address 1 */
21583         ctrl_type_subtype = frame_type_subtype;
21584       }
21585       /* Added to disallow DMG STA to transfer packets of certain forbidden types. */
21586       switch (ctrl_type_subtype)
21587       {
21588         case CTRL_PS_POLL:
21589         case CTRL_CTS:
21590         case CTRL_CFP_ENDACK:
21591         if(isDMG == TRUE) {
21592           expert_add_info_format(pinfo, hdr_tree, &ei_ieee80211_dmg_subtype,
21593               "DMG STA shouldn't transmit control frame of type contention-free period end+ack");
21594         }
21595         break;
21596         default:
21597           break;
21598       }
21599
21600       if (ctrl_type_subtype == CTRL_PS_POLL) {
21601         addr1_str = "BSSID";
21602         if (tree) {
21603           const gchar *ether_name = tvb_get_ether_name(tvb, 4);
21604           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
21605           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, 4, 6, ether_name);
21606           PROTO_ITEM_SET_HIDDEN(hidden_item);
21607         }
21608       }
21609
21610       /* Add address 1 */
21611       set_dst_addr_cols(pinfo, tvb, 4, addr1_str);
21612
21613       /*
21614        * Start shoving in other fields if needed.
21615        */
21616       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
21617         /* if (tree) */
21618         {
21619           cw_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
21620                       ett_cntrl_wrapper_fc, NULL, "Contained Frame Control");
21621           dissect_frame_control(cw_tree, tvb, 0, offset, pinfo);
21622           dissect_ht_control(hdr_tree, tvb, offset + 2);
21623           offset += 6;
21624           hdr_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
21625                       ett_cntrl_wrapper_fc, &cw_item, "Carried Frame");
21626           if (isDMG) {
21627             expert_add_info_format(pinfo, cw_item, &ei_ieee80211_dmg_subtype,
21628                                    "DMG STA shouldn't transmit Control Wrapper frame");
21629           }
21630         }
21631       }
21632
21633       switch (ctrl_type_subtype)
21634       {
21635         case CTRL_PS_POLL:
21636         case CTRL_CFP_ENDACK:
21637         {
21638           set_src_addr_cols(pinfo, tvb, offset, "TA");
21639           /* if (tree) */
21640           {
21641             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21642             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21643             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
21644             PROTO_ITEM_SET_HIDDEN(hidden_item);
21645             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
21646             PROTO_ITEM_SET_HIDDEN(hidden_item);
21647             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
21648             PROTO_ITEM_SET_HIDDEN(hidden_item);
21649             offset += 6;
21650           }
21651           break;
21652         }
21653
21654         case CTRL_CFP_END:
21655         {
21656           if (isDMG)
21657             set_src_addr_cols(pinfo, tvb, offset, "TA");
21658           else
21659             set_src_addr_cols(pinfo, tvb, offset, "BSSID");
21660           /* if (tree) */
21661           {
21662             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21663             if (isDMG) {
21664               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21665               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
21666               PROTO_ITEM_SET_HIDDEN(hidden_item);
21667             } else {
21668               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, offset, 6, ENC_NA);
21669               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, offset, 6, ether_name);
21670               PROTO_ITEM_SET_HIDDEN(hidden_item);
21671             }
21672             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
21673             PROTO_ITEM_SET_HIDDEN(hidden_item);
21674             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
21675             PROTO_ITEM_SET_HIDDEN(hidden_item);
21676             offset += 6;
21677           }
21678           break;
21679         }
21680
21681         case CTRL_TRIGGER:
21682           set_src_addr_cols(pinfo, tvb, offset, "TA");
21683           /*
21684            * The len returned will be adjusted to include any padding required
21685            */
21686           hdr_len = dissect_ieee80211_he_trigger(tvb, pinfo, hdr_tree, offset);
21687           ohdr_len = hdr_len;
21688           has_fcs = FALSE;  /* Not sure at this stage */
21689           break;
21690
21691         case CTRL_BEAMFORM_RPT_POLL:
21692         {
21693           set_src_addr_cols(pinfo, tvb, offset, "TA");
21694           /* if (tree) */
21695           {
21696             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21697
21698             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21699             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
21700             PROTO_ITEM_SET_HIDDEN(hidden_item);
21701             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
21702             PROTO_ITEM_SET_HIDDEN(hidden_item);
21703             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
21704             PROTO_ITEM_SET_HIDDEN(hidden_item);
21705             offset += 6;
21706
21707             proto_tree_add_item(hdr_tree, hf_ieee80211_beamform_feedback_seg_retrans_bitmap, tvb, offset, 1, ENC_NA);
21708           }
21709         break;
21710         }
21711
21712         case CTRL_VHT_NDP_ANNC:
21713           set_src_addr_cols(pinfo, tvb, offset, "TA");
21714
21715           dissect_ieee80211_vht_he_ndp_annc(tvb, pinfo, hdr_tree, offset, has_fcs);
21716           break;
21717
21718         case CTRL_GRANT_ACK:
21719         case CTRL_SSW:
21720         case CTRL_SSW_FEEDBACK:
21721         case CTRL_SSW_ACK:
21722         case CTRL_DMG_CTS:
21723         case CTRL_GRANT:
21724         case CTRL_SPR:
21725         case CTRL_POLL:
21726         case CTRL_RTS:
21727         {
21728           set_src_addr_cols(pinfo, tvb, offset, "TA");
21729           /* if (tree) */
21730           {
21731             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21732             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21733             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
21734             PROTO_ITEM_SET_HIDDEN(hidden_item);
21735             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
21736             PROTO_ITEM_SET_HIDDEN(hidden_item);
21737             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
21738             PROTO_ITEM_SET_HIDDEN(hidden_item);
21739             offset += 6;
21740           }
21741           break;
21742         }
21743
21744         case CTRL_CONTROL_WRAPPER:
21745           /* XXX - We shouldn't see this.  Should we throw an error? */
21746           break;
21747
21748         case CTRL_BLOCK_ACK_REQ:
21749           set_src_addr_cols(pinfo, tvb, offset, "TA");
21750
21751           offset = dissect_ieee80211_block_ack(tvb, pinfo, hdr_tree, offset, isDMG, TRUE, has_fcs);
21752           break;
21753
21754         case CTRL_BLOCK_ACK:
21755           set_src_addr_cols(pinfo, tvb, offset, "TA");
21756
21757           offset = dissect_ieee80211_block_ack(tvb, pinfo, hdr_tree, offset, isDMG, FALSE, has_fcs);
21758           break;
21759       }
21760 /*
21761  * 802.11ad : Used for extension types.
21762  */
21763       switch (ctrl_type_subtype) {
21764         case CTRL_POLL: {
21765                 proto_tree_add_item(hdr_tree, hf_ieee80211_cf_response_offset,
21766                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
21767
21768                 break;
21769         }
21770         case CTRL_GRANT:
21771         case CTRL_GRANT_ACK:
21772         case CTRL_SPR: {
21773           gboolean isGrant;
21774           if(ctrl_type_subtype != CTRL_GRANT_ACK) {
21775             offset += add_ff_dynamic_allocation(hdr_tree, tvb, pinfo, offset);
21776           } else { /* CTRL_GRANT_ACK have 5 octets that are reserved*/
21777             proto_tree_add_item(hdr_tree, hf_ieee80211_grant_ack_reserved, tvb, offset, 5, ENC_NA);
21778             offset += 5;
21779           }
21780           isGrant = ((ctrl_type_subtype==CTRL_GRANT)||(ctrl_type_subtype==CTRL_GRANT_ACK));
21781           add_ff_beamforming_ctrl(hdr_tree, tvb, pinfo, offset, isGrant);
21782           /* offset += 2; */
21783           break;
21784         }
21785         case CTRL_SSW: {
21786           guint32 sector_sweep;
21787
21788           sector_sweep = tvb_get_letoh24(tvb, offset);
21789           offset += add_ff_sector_sweep(hdr_tree, tvb, pinfo, offset);
21790           /* if Sector Sweep Direction = Responder, use SW Feedback field format when not transmitted as part of an ISS */
21791           if(sector_sweep & 0x00001) {
21792             add_ff_sector_sweep_feedback_to_iss(hdr_tree, tvb, pinfo, offset);
21793           } else {
21794             add_ff_sector_sweep_feedback_from_iss(hdr_tree, tvb, pinfo, offset);
21795           }
21796           /* offset += 3; */
21797           break;
21798         }
21799         case CTRL_SSW_ACK:
21800         case CTRL_SSW_FEEDBACK: {
21801           offset += add_ff_sector_sweep_feedback_to_iss(hdr_tree, tvb, pinfo, offset);
21802           offset += add_ff_BRP_request(hdr_tree, tvb, pinfo, offset);
21803           add_ff_beamformed_link(hdr_tree, tvb, pinfo, offset);
21804           /* offset += 1; */
21805           break;
21806         }
21807         case CTRL_DMG_DTS: {
21808           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_sa, tvb, offset, 6, ENC_NA);
21809           offset += 6;
21810           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_da, tvb, offset, 6, ENC_NA);
21811           /* offset += 6; */
21812           break;
21813         }
21814         default:
21815                 break;
21816       }
21817       break;
21818     }
21819
21820     case DATA_FRAME:
21821     {
21822       guint32 da_offset, sa_offset, ta_offset = 10, bssid_offset;
21823       addr_type = FCF_ADDR_SELECTOR(fcf);
21824
21825       /* In order to show src/dst address we must always do the following */
21826       switch (addr_type)
21827       {
21828
21829         case DATA_ADDR_T1:
21830           da_offset = 4;
21831           sa_offset = 10;
21832           bssid_offset = 16;
21833           break;
21834
21835         case DATA_ADDR_T2:
21836           da_offset = 4;
21837           sa_offset = 16;
21838           bssid_offset = 10;
21839           break;
21840
21841         case DATA_ADDR_T3:
21842           da_offset = 16;
21843           sa_offset = 10;
21844           bssid_offset = 4;
21845           break;
21846
21847         case DATA_ADDR_T4:
21848           da_offset = 16;
21849           sa_offset = 24;
21850           bssid_offset = 10;
21851           break;
21852
21853         default:
21854           /* Should never happen? */
21855           da_offset = 0;
21856           sa_offset = 0;
21857           ta_offset = 0;
21858           bssid_offset = 0;
21859           break;
21860       }
21861
21862
21863
21864       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, sa_offset);
21865       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
21866       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, da_offset);
21867       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
21868
21869       /* for tap */
21870       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, bssid_offset);
21871
21872       copy_address_shallow(&whdr->src, &pinfo->dl_src);
21873       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
21874
21875       seq_control = tvb_get_letohs(tvb, 22);
21876       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
21877       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
21878
21879       col_append_fstr(pinfo->cinfo, COL_INFO,
21880             ", SN=%d, FN=%d", seq_number, frag_number);
21881
21882       /* Now if we have a tree we start adding stuff */
21883       if (tree)
21884       {
21885         const gchar *ta_name, *sa_name, *da_name, *bssid_name = NULL;
21886
21887         switch (addr_type)
21888         {
21889           case DATA_ADDR_T1:
21890           case DATA_ADDR_T2:
21891           case DATA_ADDR_T3:
21892           case DATA_ADDR_T4:
21893             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, ta_offset, 6, ENC_NA);
21894             ta_name = tvb_get_ether_name(tvb, ta_offset);
21895             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, ta_offset, 6, ta_name);
21896             PROTO_ITEM_SET_HIDDEN(hidden_item);
21897             /* TA is always in the wlan.addr filter */
21898             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, ta_offset, 6, ENC_NA);
21899             PROTO_ITEM_SET_HIDDEN(hidden_item);
21900             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, ta_offset, 6, ta_name);
21901             PROTO_ITEM_SET_HIDDEN(hidden_item);
21902
21903             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_da, tvb, da_offset, 6, ENC_NA);
21904             da_name = tvb_get_ether_name(tvb, da_offset);
21905             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, da_offset, 6, da_name);
21906             PROTO_ITEM_SET_HIDDEN(hidden_item);
21907
21908             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_sa, tvb, sa_offset, 6, ENC_NA);
21909             sa_name = tvb_get_ether_name(tvb, sa_offset);
21910             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, sa_offset, 6, sa_name);
21911             PROTO_ITEM_SET_HIDDEN(hidden_item);
21912
21913             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, bssid_offset, 6, ENC_NA);
21914             bssid_name = tvb_get_ether_name(tvb, bssid_offset);
21915             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, bssid_offset, 6, bssid_name);
21916             PROTO_ITEM_SET_HIDDEN(hidden_item);
21917
21918             if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
21919               sta_addr_offset = 4;
21920             } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
21921               sta_addr_offset = ta_offset;
21922             }
21923             if (sta_addr_offset > 0) {
21924               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
21925               station_name = tvb_get_ether_name(tvb, sta_addr_offset);
21926               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
21927               PROTO_ITEM_SET_HIDDEN(hidden_item);
21928             }
21929             proto_tree_add_item(hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
21930             proto_tree_add_item(hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
21931
21932             /* add 3rd and 4th address for wlan.addr filter */
21933             if (sa_offset != 4 && sa_offset != 10) {
21934               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, sa_offset, 6, ENC_NA);
21935               PROTO_ITEM_SET_HIDDEN(hidden_item);
21936               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, sa_offset, 6, sa_name);
21937               PROTO_ITEM_SET_HIDDEN(hidden_item);
21938             }
21939             if (da_offset != 4 && da_offset != 10 && da_offset != sa_offset) {
21940               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, da_offset, 6, ENC_NA);
21941               PROTO_ITEM_SET_HIDDEN(hidden_item);
21942               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, da_offset, 6, da_name);
21943               PROTO_ITEM_SET_HIDDEN(hidden_item);
21944             }
21945             if (bssid_offset != 4 && bssid_offset != 10 && bssid_offset != sa_offset && bssid_offset != da_offset) {
21946               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, bssid_offset, 6, ENC_NA);
21947               PROTO_ITEM_SET_HIDDEN(hidden_item);
21948               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, bssid_offset, 6, bssid_name);
21949               PROTO_ITEM_SET_HIDDEN(hidden_item);
21950             }
21951             break;
21952         }
21953
21954       }
21955       break;
21956       }
21957     case EXTENSION_FRAME: {
21958       switch (frame_type_subtype) {
21959         case EXTENSION_DMG_BEACON: {
21960           set_dst_addr_cols(pinfo, tvb, 4, "BSSID");
21961           if (tree) {
21962             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
21963             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
21964             PROTO_ITEM_SET_HIDDEN(hidden_item);
21965           }
21966           break;
21967         }
21968       }
21969     }
21970   }
21971
21972   len = tvb_captured_length_remaining(tvb, hdr_len);
21973   reported_len = tvb_reported_length_remaining(tvb, hdr_len);
21974
21975   if (has_fcs)
21976     {
21977       /*
21978        * Well, this packet should, in theory, have an FCS.
21979        * Do we have the entire packet, and does it have enough data for
21980        * the FCS?
21981        */
21982       if (reported_len < 4)
21983       {
21984         /*
21985          * The packet is claimed not to even have enough data for a 4-byte
21986          * FCS.
21987          * Pretend it doesn't have an FCS.
21988          */
21989         ;
21990       }
21991       else if (len < reported_len)
21992       {
21993         /*
21994          * The packet is claimed to have enough data for a 4-byte FCS, but
21995          * we didn't capture all of the packet.
21996          * Slice off the 4-byte FCS from the reported length, and trim the
21997          * captured length so it's no more than the reported length; that
21998          * will slice off what of the FCS, if any, is in the captured
21999          * length.
22000          */
22001         reported_len -= 4;
22002         if (len > reported_len)
22003             len = reported_len;
22004       }
22005       else
22006       {
22007         /*
22008          * We have the entire packet, and it includes a 4-byte FCS.
22009          * Slice it off, and put it into the tree.
22010          */
22011         len          -= 4;
22012         reported_len -= 4;
22013         if (wlan_check_checksum)
22014         {
22015           guint32 sent_fcs = tvb_get_letohl(tvb, hdr_len + len);
22016           guint32 fcs;
22017
22018           if (phdr->datapad)
22019             fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
22020           else
22021             fcs = crc32_ccitt_tvb(tvb, hdr_len + len);
22022           if (fcs != sent_fcs) {
22023             flag_str[8] = '.';
22024           }
22025
22026           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);
22027         } else {
22028           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);
22029         }
22030       }
22031     }
22032   else
22033     {
22034       flag_str[8] = '\0';
22035     }
22036
22037   proto_item_append_text(ti, ", Flags: %s", flag_str);
22038   col_append_fstr(pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
22039
22040
22041   /*
22042    * Only management and data frames have a body, so we don't have
22043    * anything more to do for other types of frames.
22044    */
22045   switch (FCF_FRAME_TYPE (fcf))
22046     {
22047
22048     case MGT_FRAME:
22049       if (htc_len == 4) {
22050         dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
22051       }
22052       break;
22053
22054     case DATA_FRAME:
22055       if ((option_flags & IEEE80211_COMMON_OPT_NORMAL_QOS) && tree && DATA_FRAME_IS_QOS(frame_type_subtype))
22056       {
22057         proto_item *qos_fields, *qos_ti;
22058         proto_tree *qos_tree;
22059
22060         guint16 qos_eosp;
22061         guint16 qos_field_content;
22062
22063         qos_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_qos, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22064         qos_tree = proto_item_add_subtree(qos_fields, ett_qos_parameters);
22065
22066         qos_eosp = QOS_EOSP(qos_control);
22067         qos_field_content = QOS_FIELD_CONTENT(qos_control);
22068
22069         proto_tree_add_item(qos_tree, hf_ieee80211_qos_tid, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22070
22071         qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_priority, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22072         PROTO_ITEM_SET_GENERATED(qos_ti);
22073
22074         if (FLAGS_DS_STATUS(flags) == (FLAG_FROM_DS|FLAG_TO_DS)) {
22075           /* mesh frame */
22076           proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22077         } else {
22078           if (flags & FLAG_TO_DS) {
22079             proto_tree_add_item(qos_tree, hf_ieee80211_qos_bit4, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22080           } else {
22081             proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22082           }
22083         }
22084
22085         proto_tree_add_item(qos_tree, hf_ieee80211_qos_ack_policy, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22086
22087         if (flags & FLAG_FROM_DS) {
22088           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
22089             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22090             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
22091           }
22092           if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
22093             /* txop limit */
22094               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_limit, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22095             if (qos_field_content == 0) {
22096               proto_item_append_text(qos_ti, " (transmit one frame immediately)");
22097             }
22098           } else {
22099             /* qap ps buffer state */
22100             proto_item *qos_ps_buf_state_fields;
22101             proto_tree *qos_ps_buf_state_tree;
22102
22103             qos_ps_buf_state_fields = proto_tree_add_item(qos_tree, hf_ieee80211_qos_ps_buf_state, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22104             qos_ps_buf_state_tree = proto_item_add_subtree(qos_ps_buf_state_fields, ett_qos_ps_buf_state);
22105
22106             proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_buf_state_indicated, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22107
22108             if (QOS_PS_BUF_STATE_INDICATED(qos_field_content)) {
22109               proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_highest_pri_buf_ac, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22110               qos_ti = proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_qap_buf_load, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22111               switch (QOS_PS_QAP_BUF_LOAD(qos_field_content)) {
22112
22113               case 0:
22114                 proto_item_append_text(qos_ti, " (no buffered traffic)");
22115                 break;
22116
22117               default:
22118                 proto_item_append_text(qos_ti, " (%d octets)", QOS_PS_QAP_BUF_LOAD(qos_field_content)*4096);
22119                 break;
22120
22121               case 15:
22122                 proto_item_append_text(qos_ti, " (greater than 57344 octets)");
22123                 break;
22124               }
22125
22126             }
22127           }
22128         } else {
22129           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
22130             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22131             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
22132           }
22133           /*
22134            * Only QoS Data, Qos CF-ACK and NULL frames To-DS have a Queue Size
22135            * field.
22136            */
22137           if ((DATA_FRAME_IS_NULL(frame_type_subtype) ||
22138                (frame_type_subtype & 0x7) == 0 ||
22139                DATA_FRAME_IS_CF_ACK(frame_type_subtype))) {
22140             if (qos_eosp) {
22141               /* queue size */
22142               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_queue_size, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22143               switch (qos_field_content) {
22144               case 0:
22145                 proto_item_append_text(qos_ti, " (no buffered traffic in the queue)");
22146                 break;
22147
22148               default:
22149                 proto_item_append_text(qos_ti, " (%u bytes)", qos_field_content*256);
22150                 break;
22151
22152               case 254:
22153                 proto_item_append_text(qos_ti, " (more than 64768 octets)");
22154                 break;
22155
22156               case 255:
22157                 proto_item_append_text(qos_ti, " (unspecified or unknown)");
22158                 break;
22159               }
22160             } else {
22161               /* txop duration requested */
22162               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_dur_req,
22163                                    tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22164               if (qos_field_content == 0) {
22165                 proto_item_append_text(qos_ti, " (no TXOP requested)");
22166               }
22167             }
22168           }
22169         }
22170
22171         /* Do we have +HTC? */
22172         if (htc_len == 4) {
22173           dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
22174         }
22175
22176         if (meshctl_len != 0) {
22177           proto_item *msh_fields;
22178           proto_tree *msh_tree;
22179
22180           msh_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_mesh_control_field, tvb, meshoff, meshctl_len, ENC_NA);
22181           msh_tree = proto_item_add_subtree(msh_fields, ett_msh_control);
22182           add_ff_mesh_control(msh_tree, tvb, pinfo, meshoff);
22183         }
22184
22185       } /* end of qos control field */
22186       if (enable_decryption && !pinfo->fd->flags.visited) {
22187         const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
22188         /* The processing will take care of 4-way handshake sessions for WPA and WPA2 decryption */
22189         Dot11DecryptPacketProcess(&dot11decrypt_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE);
22190
22191       }
22192       /*
22193        * No-data frames don't have a body.
22194        */
22195       if (DATA_FRAME_IS_NULL(frame_type_subtype))
22196         goto end_of_wlan;
22197
22198       if (!wlan_subdissector) {
22199         guint fnum = 0;
22200
22201         /* key: bssid:src
22202          * data: last seq_control seen and frame number
22203          */
22204         retransmitted = FALSE;
22205         if (!pinfo->fd->flags.visited) {
22206           retransmit_key key;
22207           retransmit_key *result;
22208
22209           memcpy(key.bssid, whdr->bssid.data, 6);
22210           memcpy(key.src, whdr->src.data, 6);
22211           key.seq_control = 0;
22212           result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
22213           if (result && (result->seq_control == seq_control)) {
22214             /* keep a pointer to the first seen frame, could be done with proto data? */
22215             fnum = result->fnum;
22216             g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER(pinfo->num),
22217                                 GINT_TO_POINTER(fnum));
22218             retransmitted = TRUE;
22219           } else {
22220             /* first time or new seq*/
22221             if (!result) {
22222               result = wmem_new(wmem_file_scope(), retransmit_key);
22223               *result = key;
22224               g_hash_table_insert(fc_analyse_retransmit_table, result, result);
22225             }
22226             result->seq_control = seq_control;
22227             result->fnum =  pinfo->num;
22228           }
22229         }
22230         else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER(pinfo->num))))) {
22231           retransmitted = TRUE;
22232         }
22233
22234         if (retransmitted) {
22235           col_append_str(pinfo->cinfo, COL_INFO, " [retransmitted]");
22236           if (tree) {
22237             proto_item *item;
22238
22239             item=proto_tree_add_none_format(hdr_tree, hf_ieee80211_fc_analysis_retransmission, tvb, 0, 0,
22240                                             "Retransmitted frame");
22241             PROTO_ITEM_SET_GENERATED(item);
22242             item=proto_tree_add_uint(hdr_tree, hf_ieee80211_fc_analysis_retransmission_frame, tvb, 0, 0, fnum);
22243             PROTO_ITEM_SET_GENERATED(item);
22244           }
22245           next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
22246           call_data_dissector(next_tvb, pinfo, tree);
22247           goto end_of_wlan;
22248         }
22249       }
22250
22251       break;
22252
22253     case CONTROL_FRAME:
22254       goto end_of_wlan;
22255
22256     case EXTENSION_FRAME:
22257       break;
22258
22259     default:
22260       goto end_of_wlan;
22261     }
22262
22263   if (IS_PROTECTED(FCF_FLAGS(fcf))
22264       && !phdr->decrypted
22265       && (wlan_ignore_prot != WLAN_IGNORE_PROT_WO_IV)) {
22266     /*
22267      * It's a WEP or WPA encrypted frame, and it hasn't already been
22268      * decrypted; dissect the protections parameters and decrypt the data,
22269      * if we have a matching key. Otherwise display it as data.
22270      */
22271     gboolean    can_decrypt = FALSE;
22272     proto_tree *wep_tree    = NULL;
22273     guint32     iv;
22274     guint8      key, keybyte;
22275
22276 #define PROTECTION_ALG_WEP  DOT11DECRYPT_KEY_TYPE_WEP
22277 #define PROTECTION_ALG_TKIP  DOT11DECRYPT_KEY_TYPE_TKIP
22278 #define PROTECTION_ALG_CCMP  DOT11DECRYPT_KEY_TYPE_CCMP
22279 #define PROTECTION_ALG_RSNA  PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
22280     guint8 algorithm=G_MAXUINT8;
22281 #define IS_TKIP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 1) == \
22282   ((tvb_get_guint8(tvb, hdr_len) | 0x20) & 0x7f))
22283 #define IS_CCMP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 2) == 0)
22284     guint32 sec_header=0;
22285     guint32 sec_trailer=0;
22286
22287     next_tvb = try_decrypt(tvb, pinfo, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer, &used_key);
22288
22289     keybyte = tvb_get_guint8(tvb, hdr_len + 3);
22290     key = KEY_OCTET_WEP_KEY(keybyte);
22291     if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
22292       /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
22293       if (tree) {
22294         if (algorithm==PROTECTION_ALG_TKIP)
22295           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22296               ett_wep_parameters, NULL, "TKIP parameters");
22297         else if (algorithm==PROTECTION_ALG_CCMP)
22298           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22299             ett_wep_parameters, NULL, "CCMP parameters");
22300         else {
22301           if (IS_TKIP(tvb, hdr_len)) {
22302             algorithm=PROTECTION_ALG_TKIP;
22303             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22304                 ett_wep_parameters, NULL, "TKIP parameters");
22305           } else if (IS_CCMP(tvb, hdr_len)) {
22306             algorithm=PROTECTION_ALG_CCMP;
22307             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22308                 ett_wep_parameters, NULL, "CCMP parameters");
22309           } else
22310             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22311                 ett_wep_parameters, NULL, "TKIP/CCMP parameters");
22312         }
22313         proto_item_set_len(ti, hdr_len + 8);
22314
22315         if (algorithm==PROTECTION_ALG_TKIP) {
22316           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
22317               tvb_get_letohl(tvb, hdr_len + 4),
22318               tvb_get_guint8(tvb, hdr_len),
22319               tvb_get_guint8(tvb, hdr_len + 2));
22320           proto_tree_add_string(wep_tree, hf_ieee80211_tkip_extiv, tvb, hdr_len,
22321               EXTIV_LEN, out_buff);
22322         } else if (algorithm==PROTECTION_ALG_CCMP) {
22323           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
22324               tvb_get_letohl(tvb, hdr_len + 4),
22325               tvb_get_guint8(tvb, hdr_len + 1),
22326               tvb_get_guint8(tvb, hdr_len));
22327           proto_tree_add_string(wep_tree, hf_ieee80211_ccmp_extiv, tvb, hdr_len,
22328               EXTIV_LEN, out_buff);
22329         }
22330
22331         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
22332       }
22333
22334       /* Subtract out the length of the IV. */
22335       len          -= EXTIV_LEN;
22336       reported_len -= EXTIV_LEN;
22337       ivlen         = EXTIV_LEN;
22338       /* It is unknown whether this is TKIP or CCMP, so let's not even try to
22339        * parse TKIP Michael MIC+ICV or CCMP MIC. */
22340
22341       /* checking for the trailer                            */
22342       if (next_tvb!=NULL) {
22343         if (reported_len < (gint) sec_trailer) {
22344           /* There is no space for a trailer, ignore it and don't decrypt  */
22345           ;
22346         } else if (len < reported_len) {
22347           /* There is space for a trailer, but we haven't capture all the  */
22348           /* packet. Slice off the trailer, but don't try to decrypt      */
22349           reported_len -= sec_trailer;
22350           if (len > reported_len)
22351             len = reported_len;
22352         } else {
22353           /* Ok, we have a trailer and the whole packet. Decrypt it!      */
22354           /* TODO: At the moment we won't add the trailer to the tree,    */
22355           /* so don't remove the trailer from the packet                  */
22356           len          -= sec_trailer;
22357           reported_len -= sec_trailer;
22358           can_decrypt   = TRUE;
22359
22360           /* Add Key information to packet */
22361           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 */
22362           out_buff[2*DOT11DECRYPT_TK_LEN] = '\0';
22363
22364           if (key == 0) { /* encrypted with pairwise key */
22365             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_tk, tvb, 0, 0, out_buff);
22366             PROTO_ITEM_SET_GENERATED(ti);
22367
22368             /* Also add the PMK used to to decrypt the packet. (PMK==PSK) */
22369             bytes_to_hexstr(out_buff, used_key.KeyData.Wpa.Psk, DOT11DECRYPT_WPA_PSK_LEN); /* 32 bytes */
22370             out_buff[2*DOT11DECRYPT_WPA_PSK_LEN] = '\0';
22371             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_pmk, tvb, 0, 0, out_buff);
22372             PROTO_ITEM_SET_GENERATED(ti);
22373
22374           } else { /* Encrypted with Group Key */
22375             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 */
22376             PROTO_ITEM_SET_GENERATED(ti);
22377           }
22378         }
22379       }
22380     } else {
22381       /* No Ext. IV - WEP packet */
22382       /*
22383        * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
22384        * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
22385        * them itself.
22386        *
22387        * Also, just pass the data *following* the WEP parameters as the
22388        * buffer to decrypt.
22389        */
22390       iv = tvb_get_ntoh24(tvb, hdr_len);
22391       if (tree) {
22392         wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 4,
22393             ett_wep_parameters, NULL, "WEP parameters");
22394
22395         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_iv, tvb, hdr_len, 3, iv);
22396         tvb_memcpy(tvb, iv_buff, hdr_len, 3);
22397         is_iv_bad = weak_iv(iv_buff);
22398         if (is_iv_bad != -1) {
22399           proto_tree_add_boolean_format (wep_tree, hf_ieee80211_wep_iv_weak,
22400               tvb, 0, 0, TRUE,
22401               "Weak IV for key byte %d",
22402               is_iv_bad);
22403         }
22404       }
22405       if (tree)
22406         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
22407
22408       /* Subtract out the length of the IV. */
22409       len          -= 4;
22410       reported_len -= 4;
22411       ivlen         = 4;
22412
22413       /* Even if the decryption was not successful, set the algorithm */
22414       algorithm=PROTECTION_ALG_WEP;
22415
22416       /*
22417        * Well, this packet should, in theory, have an ICV.
22418        * Do we have the entire packet, and does it have enough data for
22419        * the ICV?
22420        */
22421       if (reported_len < 4) {
22422         /*
22423          * The packet is claimed not to even have enough data for a
22424          * 4-byte ICV.
22425          * Pretend it doesn't have an ICV.
22426          */
22427         ;
22428       } else if (len < reported_len) {
22429         /*
22430          * The packet is claimed to have enough data for a 4-byte ICV,
22431          * but we didn't capture all of the packet.
22432          * Slice off the 4-byte ICV from the reported length, and trim
22433          * the captured length so it's no more than the reported length;
22434          * that will slice off what of the ICV, if any, is in the
22435          * captured length.
22436          */
22437         reported_len -= 4;
22438         if (len > reported_len)
22439           len         = reported_len;
22440       } else {
22441         /*
22442          * We have the entire packet, and it includes a 4-byte ICV.
22443          * Slice it off, and put it into the tree.
22444          *
22445          * We only support decrypting if we have the the ICV.
22446          *
22447          * XXX - the ICV is encrypted; we're putting the encrypted
22448          * value, not the decrypted value, into the tree.
22449          */
22450         len          -= 4;
22451         reported_len -= 4;
22452         can_decrypt   = TRUE;
22453       }
22454     }
22455
22456     if (algorithm == PROTECTION_ALG_WEP) {
22457       g_strlcpy(wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
22458     } else if (algorithm == PROTECTION_ALG_TKIP) {
22459       g_strlcpy(wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
22460     } else if (algorithm == PROTECTION_ALG_CCMP) {
22461       g_strlcpy(wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
22462     } else {
22463       g_strlcpy(wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
22464     }
22465
22466     /* protection header                                  */
22467     if (!can_decrypt || (next_tvb == NULL)) {
22468       /*
22469        * WEP decode impossible or failed, treat payload as raw data
22470        * and don't attempt fragment reassembly or further dissection.
22471        */
22472       next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len + ivlen, len, reported_len);
22473
22474       if (tree) {
22475         if (algorithm == PROTECTION_ALG_WEP) {
22476           if (can_decrypt)
22477             proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
22478                 hdr_len + ivlen + len, 4,
22479                 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
22480                 "0x%08x (not verified)",
22481                 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
22482         } else if (algorithm == PROTECTION_ALG_CCMP) {
22483         } else if (algorithm == PROTECTION_ALG_TKIP) {
22484         }
22485       }
22486
22487       if ((!(option_flags & IEEE80211_COMMON_OPT_IS_CENTRINO)) && (wlan_ignore_prot == WLAN_IGNORE_PROT_NO)) {
22488         /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
22489         call_data_dissector(next_tvb, pinfo, tree);
22490         goto end_of_wlan;
22491       }
22492     } else {
22493       if (algorithm == PROTECTION_ALG_WEP) {
22494         if (tree)
22495           proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
22496               hdr_len + ivlen + len, 4,
22497               tvb_get_ntohl(tvb, hdr_len + ivlen + len),
22498               "0x%08x (correct)",
22499               tvb_get_ntohl(tvb, hdr_len + ivlen + len));
22500
22501         add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
22502       } else if (algorithm==PROTECTION_ALG_CCMP) {
22503         add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
22504       } else if (algorithm==PROTECTION_ALG_TKIP) {
22505         add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
22506       }
22507 #undef IS_TKIP
22508 #undef IS_CCMP
22509 #undef PROTECTION_ALG_CCMP
22510 #undef PROTECTION_ALG_TKIP
22511 #undef PROTECTION_ALG_WEP
22512     }
22513
22514     /*
22515      * WEP decryption successful!
22516      *
22517      * Use the tvbuff we got back from the decryption; the data starts at
22518      * the beginning.  The lengths are already correct for the decoded WEP
22519      * payload.
22520      */
22521     hdr_len = 0;
22522
22523   } else {
22524     /*
22525      * Not a WEP-encrypted frame; just use the data from the tvbuff
22526      * handed to us.
22527      *
22528      * The payload starts at "hdr_len" (i.e., just past the 802.11
22529      * MAC header), the length of data in the tvbuff following the
22530      * 802.11 header is "len", and the length of data in the packet
22531      * following the 802.11 header is "reported_len".
22532      */
22533     next_tvb = tvb;
22534   }
22535
22536   /*
22537    * Do defragmentation if "wlan_defragment" is true, and we have more
22538    * fragments or this isn't the first fragment.
22539    *
22540    * We have to do some special handling to catch frames that
22541    * have the "More Fragments" indicator not set but that
22542    * don't show up as reassembled and don't have any other
22543    * fragments present.  Some networking interfaces appear
22544    * to do reassembly even when you're capturing raw packets
22545    * *and* show the reassembled packet without the "More
22546    * Fragments" indicator set *but* with a non-zero fragment
22547    * number.
22548    *
22549    * "fragment_add_seq_802_11()" handles that; we want to call it
22550    * even if we have a short frame, so that it does those checks - if
22551    * the frame is short, it doesn't do reassembly on it.
22552    *
22553    * (This could get some false positives if we really *did* only
22554    * capture the last fragment of a fragmented packet, but that's
22555    * life.)
22556    */
22557   save_fragmented = pinfo->fragmented;
22558   if (wlan_defragment && (more_frags || (frag_number != 0))) {
22559     fragment_head *fd_head;
22560
22561     /*
22562      * If we've already seen this frame, look it up in the
22563      * table of reassembled packets, otherwise add it to
22564      * whatever reassembly is in progress, if any, and see
22565      * if it's done.
22566      */
22567     if (reported_len < 0)
22568       THROW(ReportedBoundsError);
22569     fd_head = fragment_add_seq_802_11(&wlan_reassembly_table,
22570         next_tvb, hdr_len, pinfo, seq_number, NULL,
22571         frag_number,
22572         reported_len,
22573         more_frags);
22574     next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
22575         "Reassembled 802.11", fd_head,
22576         &frag_items, NULL, hdr_tree);
22577   } else {
22578     /*
22579      * If this is the first fragment, dissect its contents, otherwise
22580      * just show it as a fragment.
22581      */
22582     if (frag_number != 0) {
22583       /* Not the first fragment - don't dissect it. */
22584       next_tvb = NULL;
22585     } else {
22586       /* First fragment, or not fragmented.  Dissect what we have here. */
22587
22588       /* Get a tvbuff for the payload. */
22589       next_tvb = tvb_new_subset_length_caplen(next_tvb, hdr_len, len, reported_len);
22590
22591       /*
22592        * If this is the first fragment, but not the only fragment,
22593        * tell the next protocol that.
22594        */
22595       if (more_frags)
22596         pinfo->fragmented = TRUE;
22597       else
22598         pinfo->fragmented = FALSE;
22599     }
22600   }
22601
22602   if (next_tvb == NULL) {
22603     /* Just show this as an incomplete fragment. */
22604     col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
22605     next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
22606     call_data_dissector(next_tvb, pinfo, tree);
22607     pinfo->fragmented = save_fragmented;
22608     goto end_of_wlan;
22609   }
22610
22611   switch (FCF_FRAME_TYPE (fcf))
22612     {
22613
22614     case MGT_FRAME:
22615       dissect_ieee80211_mgt(fcf, next_tvb, pinfo, tree);
22616       break;
22617
22618     case DATA_FRAME:
22619       if (is_amsdu && (tvb_reported_length_remaining(next_tvb, 0) > 4)) {
22620         proto_item   *parent_item;
22621         proto_tree   *mpdu_tree;
22622         guint32       msdu_offset = 0;
22623         guint         i           = 1;
22624
22625         parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
22626                                     tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
22627         mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
22628
22629         do {
22630           tvbuff_t           *msdu_tvb;
22631           guint16             msdu_length;
22632           proto_tree         *subframe_tree;
22633           const gchar *resolve_name;
22634
22635           /*
22636            * IEEE Std 802.11-2012 says, in section 8.3.2.2 "A-MSDU format":
22637            *
22638            *  The A-MSDU subframe header contains three fields: DA, SA, and
22639            *  Length. The order of these fields and the bits within these
22640            *  fields are the same as the IEEE 802.3 frame format.
22641            *
22642            * which means that the length field is big-endian, not
22643            * little-endian.
22644            */
22645           msdu_length = tvb_get_ntohs(next_tvb, msdu_offset+12);
22646
22647           parent_item = proto_tree_add_item(mpdu_tree, hf_ieee80211_amsdu_subframe, next_tvb,
22648                             msdu_offset, roundup2(msdu_offset+14+msdu_length, 4), ENC_NA);
22649           proto_item_append_text(parent_item, " #%u", i);
22650           subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
22651           i += 1;
22652
22653           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_da, next_tvb, msdu_offset, 6, ENC_NA);
22654           resolve_name = tvb_get_ether_name(tvb, msdu_offset);
22655           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, msdu_offset, 6,
22656             resolve_name);
22657           PROTO_ITEM_SET_HIDDEN(hidden_item);
22658           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_sa, next_tvb, msdu_offset+6, 6, ENC_NA);
22659           resolve_name = tvb_get_ether_name(tvb, msdu_offset+6);
22660           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, msdu_offset+6, 6,
22661             resolve_name);
22662           PROTO_ITEM_SET_HIDDEN(hidden_item);
22663           proto_tree_add_item(subframe_tree, hf_ieee80211_amsdu_length, next_tvb, msdu_offset+12, 2, ENC_BIG_ENDIAN);
22664
22665           msdu_offset += 14;
22666           msdu_tvb = tvb_new_subset_length(next_tvb, msdu_offset, msdu_length);
22667           call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
22668           msdu_offset = roundup2(msdu_offset+msdu_length, 4);
22669         } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
22670
22671         break;
22672       }
22673       /* I guess some bridges take Netware Ethernet_802_3 frames,
22674          which are 802.3 frames (with a length field rather than
22675          a type field, but with no 802.2 header in the payload),
22676          and just stick the payload into an 802.11 frame.  I've seen
22677          captures that show frames of that sort.
22678
22679          We also handle some odd form of encapsulation in which a
22680          complete Ethernet frame is encapsulated within an 802.11
22681          data frame, with no 802.2 header.  This has been seen
22682          from some hardware.
22683
22684          On top of that, at least at some point it appeared that
22685          the OLPC XO sent out frames with two bytes of 0 between
22686          the "end" of the 802.11 header and the beginning of
22687          the payload. Something similar has also been observed
22688          with Atheros chipsets. There the sequence control field
22689          seems repeated.
22690
22691          So, if the packet doesn't start with 0xaa 0xaa:
22692
22693            we first use the same scheme that linux-wlan-ng does to detect
22694            those encapsulated Ethernet frames, namely looking to see whether
22695            the frame either starts with 6 octets that match the destination
22696            address from the 802.11 header or has 6 octets that match the
22697            source address from the 802.11 header following the first 6 octets,
22698            and, if so, treat it as an encapsulated Ethernet frame;
22699
22700            otherwise, we use the same scheme that we use in the Ethernet
22701            dissector to recognize Netware 802.3 frames, namely checking
22702            whether the packet starts with 0xff 0xff and, if so, treat it
22703            as an encapsulated IPX frame, and then check whether the
22704            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
22705            frame, or check the packet starts with the repetition of the
22706            sequence control field and, if so, treat it as an Atheros frame. */
22707       encap_type = ENCAP_802_2;
22708       if (tvb_bytes_exist(next_tvb, 0, 2)) {
22709         octet1 = tvb_get_guint8(next_tvb, 0);
22710         octet2 = tvb_get_guint8(next_tvb, 1);
22711         if ((octet1 != 0xaa) || (octet2 != 0xaa)) {
22712           if ((tvb_memeql(next_tvb, 6, (const guint8 *)pinfo->dl_src.data, 6) == 0) ||
22713               (tvb_memeql(next_tvb, 0, (const guint8 *)pinfo->dl_dst.data, 6) == 0))
22714             encap_type = ENCAP_ETHERNET;
22715           else if ((octet1 == 0xff) && (octet2 == 0xff))
22716             encap_type = ENCAP_IPX;
22717           else if (((octet1 == 0x00) && (octet2 == 0x00)) ||
22718                    (((octet2 << 8) | octet1) == seq_control)) {
22719             proto_tree_add_item(tree, hf_ieee80211_mysterious_olpc_stuff, next_tvb, 0, 2, ENC_NA);
22720             next_tvb = tvb_new_subset_remaining(next_tvb, 2);
22721           }
22722         }
22723       }
22724
22725       switch (encap_type) {
22726
22727       case ENCAP_802_2:
22728         call_dissector(llc_handle, next_tvb, pinfo, tree);
22729         break;
22730
22731       case ENCAP_ETHERNET:
22732         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
22733         break;
22734
22735       case ENCAP_IPX:
22736         call_dissector(ipx_handle, next_tvb, pinfo, tree);
22737         break;
22738       }
22739       break;
22740
22741     case EXTENSION_FRAME:
22742     {
22743       dissect_ieee80211_extension(fcf, next_tvb, pinfo, tree);
22744       break;
22745     }
22746   }
22747   pinfo->fragmented = save_fragmented;
22748
22749 end_of_wlan:
22750   whdr->stats = wlan_stats;
22751   tap_queue_packet(wlan_tap, pinfo, whdr);
22752   memset(&wlan_stats, 0, sizeof wlan_stats);
22753
22754   return tvb_captured_length(tvb);
22755 }
22756
22757 /*
22758  * Dissect 802.11 with a variable-length link-layer header and with the FCS
22759  * presence or absence indicated by the pseudo-header, if there is one.
22760  */
22761 static int
22762 dissect_ieee80211(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
22763 {
22764   struct ieee_802_11_phdr *phdr = (struct ieee_802_11_phdr *)data;
22765   struct ieee_802_11_phdr ourphdr;
22766
22767   if (phdr == NULL) {
22768     /*
22769      * Fake a pseudo-header.
22770      * XXX - what are we supposed to do if the FCS length is unknown?
22771      */
22772     memset(&ourphdr, 0, sizeof(ourphdr));
22773     ourphdr.fcs_len = -1;
22774     ourphdr.decrypted = FALSE;
22775     ourphdr.datapad = FALSE;
22776     ourphdr.phy = PHDR_802_11_PHY_UNKNOWN;
22777     phdr = &ourphdr;
22778   }
22779   return dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, phdr);
22780 }
22781
22782 /*
22783  * Dissect 802.11 with a variable-length link-layer header and with an
22784  * FCS, but no pseudo-header.
22785  */
22786 static int
22787 dissect_ieee80211_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22788 {
22789   struct ieee_802_11_phdr phdr;
22790
22791   /* Construct a pseudo-header to hand to the common code. */
22792   memset(&phdr, 0, sizeof(phdr));
22793   phdr.fcs_len = 4;
22794   phdr.decrypted = FALSE;
22795   phdr.datapad = FALSE;
22796   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22797   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
22798   return tvb_captured_length(tvb);
22799 }
22800
22801 /*
22802  * Dissect 802.11 with a variable-length link-layer header and without an
22803  * FCS, but no pseudo-header.
22804  */
22805 static int
22806 dissect_ieee80211_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22807 {
22808   struct ieee_802_11_phdr phdr;
22809
22810   /* Construct a pseudo-header to hand to the common code. */
22811   memset(&phdr, 0, sizeof(phdr));
22812   phdr.decrypted = FALSE;
22813   phdr.datapad = FALSE;
22814   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22815   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
22816   return tvb_captured_length(tvb);
22817 }
22818
22819 /*
22820  * Dissect 802.11 from an Intel 2200BG adapter in a Centrino laptop
22821  * running Windows XP.
22822  *
22823  * From
22824  *
22825  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00184.html
22826  *
22827  * and
22828  *
22829  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00393.html:
22830  *
22831  *  I tried capturing from a Centrino laptop with the Intel 2200BG 802.11g
22832  *  chipset. I saw a lot of "Ethernet II" frames with 0x2452 as ethertype.
22833  *
22834  *    ...
22835  *
22836  *  This behaviour has been observed on Windows XP. In my opinion it is
22837  *  a "proprietary" behaviour of either the Centrino driver or the Centrino
22838  *  hardware. Currently I have no Linux distro installed on the machine to
22839  *  verify whether it is also the case.
22840  *
22841  *  These packets are seen only in a promiscuous capture:
22842  *    - Packets normally received by the Centrino computer have the normal
22843  *      structure (no 802.11/LLC header but directly IP header).
22844  *    - Packets that are supposed to be received by another computer have
22845  *      the 802.11/LLC headers. ... Also I noticed that when WEP is enabled,
22846  *      the 802.11 header has the flag "WEP" set to true, but the packet
22847  *      is already decrypted. I added a test in the code to accomodate this.
22848  *      For TKIP it seems to stay encrypted.
22849  */
22850 static int
22851 dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22852 {
22853   struct ieee_802_11_phdr phdr;
22854
22855   /* Construct a pseudo-header to hand to the common code. */
22856   memset(&phdr, 0, sizeof(phdr));
22857   phdr.decrypted = FALSE;
22858   phdr.datapad = FALSE;
22859   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22860   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_IS_CENTRINO|IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
22861   return tvb_captured_length(tvb);
22862 }
22863
22864 /*
22865  * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
22866  * control field and with no FCS (some hardware sends out LWAPP-encapsulated
22867  * 802.11 packets with the control field byte swapped).
22868  */
22869 static int
22870 dissect_ieee80211_bsfc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22871 {
22872   struct ieee_802_11_phdr phdr;
22873
22874   /* Construct a pseudo-header to hand to the common code. */
22875   memset(&phdr, 0, sizeof(phdr));
22876   phdr.decrypted = FALSE;
22877   phdr.datapad = FALSE;
22878   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22879   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_BROKEN_FC|IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
22880   return tvb_captured_length(tvb);
22881 }
22882
22883 /*
22884  * Dissect 802.11 with a variable-length link-layer header without qos elements
22885  * in data+qos frames and with no FCS (sent as WIDS frames by Cisco standalone
22886  * APs).
22887  */
22888 static int
22889 dissect_ieee80211_noqos(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22890 {
22891   struct ieee_802_11_phdr phdr;
22892
22893   /* Construct a pseudo-header to hand to the common code. */
22894   memset(&phdr, 0, sizeof(phdr));
22895   phdr.decrypted = FALSE;
22896   phdr.datapad = FALSE;
22897   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22898   dissect_ieee80211_common(tvb, pinfo, tree, 0, &phdr);
22899   return tvb_captured_length(tvb);
22900 }
22901
22902
22903 /* ------------- */
22904 static guint
22905 retransmit_hash(gconstpointer k)
22906 {
22907   const retransmit_key *key = (const retransmit_key *)k;
22908   guint hash_val;
22909   int   i;
22910
22911   hash_val = 0;
22912   for (i = 0; i < 6; i++)
22913     hash_val += key->bssid[i];
22914
22915   for (i = 0; i < 6; i++)
22916     hash_val += key->src[i];
22917
22918   return hash_val;
22919 }
22920
22921 static gint
22922 retransmit_equal(gconstpointer k1, gconstpointer k2)
22923 {
22924   const retransmit_key *key1 = (const retransmit_key *)k1;
22925   const retransmit_key *key2 = (const retransmit_key *)k2;
22926
22927   return ((!memcmp(key1->bssid, key2->bssid, 6) && !memcmp(key1->src, key2->src, 6)) ? TRUE:FALSE);
22928 }
22929
22930 static guint
22931 frame_hash(gconstpointer k)
22932 {
22933   guint32 frame = GPOINTER_TO_UINT(k);
22934
22935   return frame;
22936 }
22937
22938 static gint
22939 frame_equal(gconstpointer k1, gconstpointer k2)
22940 {
22941   guint32 frame1 = GPOINTER_TO_UINT(k1);
22942   guint32 frame2 = GPOINTER_TO_UINT(k2);
22943
22944   return frame1==frame2;
22945 }
22946
22947 /*
22948  * EAPOL key description dissectors.
22949  */
22950 #define KEY_INFO_KEYDES_VERSION_MASK        0x0007
22951 #define KEY_INFO_KEY_TYPE_MASK              0x0008
22952 #define KEY_INFO_KEY_INDEX_MASK             0x0030
22953 #define KEY_INFO_INSTALL_MASK               0x0040
22954 #define KEY_INFO_KEY_ACK_MASK               0x0080
22955 #define KEY_INFO_KEY_MIC_MASK               0x0100
22956 #define KEY_INFO_SECURE_MASK                0x0200
22957 #define KEY_INFO_ERROR_MASK                 0x0400
22958 #define KEY_INFO_REQUEST_MASK               0x0800
22959 #define KEY_INFO_ENCRYPTED_KEY_DATA_MASK    0x1000
22960 #define KEY_INFO_SMK_MESSAGE_MASK           0x2000
22961
22962 #define KEYDES_VER_TYPE1        0x01
22963 #define KEYDES_VER_TYPE2        0x02
22964 #define KEYDES_VER_TYPE3        0x03
22965
22966 static const value_string keydes_version_vals[] = {
22967   { KEYDES_VER_TYPE1,     "RC4 Cipher, HMAC-MD5 MIC" },
22968   { KEYDES_VER_TYPE2,     "AES Cipher, HMAC-SHA1 MIC" },
22969   { KEYDES_VER_TYPE3,     "AES Cipher, AES-128-CMAC MIC" },
22970   { 0, NULL }
22971 };
22972
22973 static int proto_wlan_rsna_eapol = -1;
22974
22975 static int hf_wlan_rsna_eapol_wpa_keydes_msgnr = -1;
22976 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo = -1;
22977 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version = -1;
22978 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type = -1;
22979 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index = -1;
22980 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install = -1;
22981 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack = -1;
22982 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic = -1;
22983 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure = -1;
22984 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error = -1;
22985 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request = -1;
22986 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data = -1;
22987 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message = -1;
22988 static int hf_wlan_rsna_eapol_keydes_key_len = -1;
22989 static int hf_wlan_rsna_eapol_keydes_replay_counter = -1;
22990 static int hf_wlan_rsna_eapol_keydes_key_iv = -1;
22991 static int hf_wlan_rsna_eapol_wpa_keydes_nonce = -1;
22992 static int hf_wlan_rsna_eapol_wpa_keydes_rsc = -1;
22993 static int hf_wlan_rsna_eapol_wpa_keydes_id = -1;
22994 static int hf_wlan_rsna_eapol_wpa_keydes_mic = -1;
22995 static int hf_wlan_rsna_eapol_wpa_keydes_data_len = -1;
22996 static int hf_wlan_rsna_eapol_wpa_keydes_data = -1;
22997
22998 static gint ett_keyinfo = -1;
22999 static gint ett_wlan_rsna_eapol_keydes_data = -1;
23000
23001 static const true_false_string keyinfo_key_type_tfs = { "Pairwise Key", "Group Key" };
23002
23003 static int
23004 dissect_wlan_rsna_eapol_wpa_or_rsn_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
23005 {
23006   int         offset = 0;
23007   guint16     keyinfo;
23008   guint16     eapol_data_len;
23009   proto_tree *keydes_tree;
23010   proto_tree *ti = NULL;
23011   static const int * wlan_rsna_eapol_wpa_keydes_keyinfo[] = {
23012     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version,
23013     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type,
23014     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index,
23015     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install,
23016     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack,
23017     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic,
23018     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure,
23019     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error,
23020     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request,
23021     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data,
23022     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
23023     NULL
23024   };
23025   guint16 eapol_data_offset = 76;  /* 92 - 16 */
23026   guint16 eapol_key_mic_len = 0;
23027
23028   if (wlan_key_mic_len) {
23029     eapol_data_offset += wlan_key_mic_len;
23030     eapol_key_mic_len = wlan_key_mic_len;
23031   } else {
23032     eapol_data_offset = 92;
23033     eapol_key_mic_len = 16;
23034   }
23035
23036   /*
23037    * RSNA key descriptors.
23038    */
23039   eapol_data_len = tvb_get_ntohs(tvb, offset+eapol_data_offset);
23040   keyinfo = tvb_get_ntohs(tvb, offset);
23041   if (keyinfo & KEY_INFO_REQUEST_MASK) {
23042     col_set_str(pinfo->cinfo, COL_INFO, "Key (Request)");
23043     if (keyinfo & KEY_INFO_ERROR_MASK)
23044       col_set_str(pinfo->cinfo, COL_INFO, "Key (Request, Error)");
23045   } else if (keyinfo & KEY_INFO_KEY_TYPE_MASK) {
23046     guint16 masked;
23047     /* Windows is setting the Secure Bit on message 2 when rekeying, so we'll ignore it */
23048     masked = keyinfo &
23049       (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK);
23050
23051     switch (masked) {
23052     case KEY_INFO_KEY_ACK_MASK:
23053     {
23054       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 1);
23055
23056       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 1 of 4)");
23057       break;
23058     }
23059     case KEY_INFO_KEY_MIC_MASK:
23060       /* We check the key length to differentiate between message 2 and 4 and just hope that
23061       there are no strange implementations with key data and non-zero key length in message 4.
23062       According to the IEEE specification, sections 11.6.6.3 and 11.6.6.5 we should
23063       use the Secure Bit and/or the Nonce, but there are implementations ignoring the spec.
23064       The Secure Bit is incorrectly set on rekeys for Windows clients for Message 2 and the Nonce is non-zero
23065       in Message 4 in Bug 11994 (Apple?) */
23066       if (eapol_data_len) {
23067         ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 2);
23068
23069         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 2 of 4)");
23070       } else {
23071         ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 4);
23072
23073         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 4 of 4)");
23074       }
23075       break;
23076
23077     case (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK):
23078     {
23079       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 3);
23080
23081       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 3 of 4)");
23082       break;
23083     }
23084     }
23085   } else {
23086     if (keyinfo & KEY_INFO_KEY_ACK_MASK) {
23087       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 1);
23088
23089       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 1 of 2)");
23090     } else {
23091       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 2);
23092
23093       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 2 of 2)");
23094     }
23095   }
23096
23097   PROTO_ITEM_SET_GENERATED(ti);
23098
23099   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_wlan_rsna_eapol_wpa_keydes_keyinfo,
23100                                     ett_keyinfo, wlan_rsna_eapol_wpa_keydes_keyinfo,
23101                                     ENC_BIG_ENDIAN, BMT_NO_APPEND);
23102   offset += 2;
23103
23104   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_len, tvb, offset,
23105                       2, ENC_BIG_ENDIAN);
23106   offset += 2;
23107   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_replay_counter, tvb,
23108                       offset, 8, ENC_BIG_ENDIAN);
23109   offset += 8;
23110   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_nonce, tvb, offset,
23111                       32, ENC_NA);
23112   offset += 32;
23113   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_iv, tvb,
23114                       offset, 16, ENC_NA);
23115   offset += 16;
23116   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_rsc, tvb, offset,
23117                       8, ENC_NA);
23118   offset += 8;
23119   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_id, tvb, offset, 8,
23120                       ENC_NA);
23121   offset += 8;
23122   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_mic, tvb, offset,
23123                       eapol_key_mic_len, ENC_NA);
23124   offset += eapol_key_mic_len;
23125   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data_len, tvb,
23126                       offset, 2, ENC_BIG_ENDIAN);
23127   offset += 2;
23128   if (eapol_data_len != 0) {
23129     ti = proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data,
23130                              tvb, offset, eapol_data_len, ENC_NA);
23131     if ((keyinfo & KEY_INFO_ENCRYPTED_KEY_DATA_MASK) ||
23132         !(keyinfo & KEY_INFO_KEY_TYPE_MASK)) {
23133       /* RSN: EAPOL-Key Key Data is encrypted.
23134        * WPA: Group Keys use encrypted Key Data.
23135        * Cannot parse this without knowing the key.
23136        * IEEE 802.11i-2004 8.5.2.
23137        */
23138     } else {
23139       keydes_tree = proto_item_add_subtree(ti, ett_wlan_rsna_eapol_keydes_data);
23140       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, keydes_tree,
23141                                        tvb_reported_length_remaining(tvb, offset),
23142                                        -1, NULL);
23143     }
23144   }
23145   return tvb_captured_length(tvb);
23146 }
23147
23148 /* It returns the algorithm used for decryption and the header and trailer lengths. */
23149 static tvbuff_t *
23150 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)
23151 {
23152   const guint8      *enc_data;
23153   tvbuff_t          *decr_tvb = NULL;
23154   guint32            dec_caplen;
23155   guchar             dec_data[DOT11DECRYPT_MAX_CAPLEN];
23156
23157   if (!enable_decryption)
23158     return NULL;
23159
23160   /* get the entire packet                                  */
23161   enc_data = tvb_get_ptr(tvb, 0, len+offset);
23162
23163   /*  process packet with Dot11Decrypt                              */
23164   if (Dot11DecryptPacketProcess(&dot11decrypt_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen,
23165                             used_key, FALSE)==DOT11DECRYPT_RET_SUCCESS)
23166   {
23167     guint8 *tmp;
23168     *algorithm=used_key->KeyType;
23169     switch (*algorithm) {
23170       case DOT11DECRYPT_KEY_TYPE_WEP:
23171         *sec_header=DOT11DECRYPT_WEP_HEADER;
23172         *sec_trailer=DOT11DECRYPT_WEP_TRAILER;
23173         break;
23174       case DOT11DECRYPT_KEY_TYPE_CCMP:
23175         *sec_header=DOT11DECRYPT_RSNA_HEADER;
23176         *sec_trailer=DOT11DECRYPT_CCMP_TRAILER;
23177         break;
23178       case DOT11DECRYPT_KEY_TYPE_TKIP:
23179         *sec_header=DOT11DECRYPT_RSNA_HEADER;
23180         *sec_trailer=DOT11DECRYPT_TKIP_TRAILER;
23181         break;
23182       default:
23183         return NULL;
23184     }
23185
23186     /* allocate buffer for decrypted payload                      */
23187     tmp = (guint8 *)wmem_memdup(pinfo->pool, dec_data+offset, dec_caplen-offset);
23188
23189     len = dec_caplen-offset;
23190
23191     /* decrypt successful, let's set up a new data tvb.              */
23192     decr_tvb = tvb_new_child_real_data(tvb, tmp, len, len);
23193   }
23194
23195   return decr_tvb;
23196 }
23197
23198 /* Collect our WEP and WPA keys */
23199 static void
23200 set_dot11decrypt_keys(void)
23201 {
23202   guint                     i;
23203   DOT11DECRYPT_KEYS_COLLECTION  *keys = g_new(DOT11DECRYPT_KEYS_COLLECTION, 1);
23204   GByteArray                *bytes = NULL;
23205
23206   keys->nKeys = 0;
23207
23208   for (i = 0; (uat_wep_key_records != NULL) && (i < num_wepkeys_uat) && (i < MAX_ENCRYPTION_KEYS); i++)
23209   {
23210     decryption_key_t *dk;
23211     dk = parse_key_string(uat_wep_key_records[i].string, uat_wep_key_records[i].key);
23212
23213     if (dk != NULL)
23214     {
23215       DOT11DECRYPT_KEY_ITEM          key;
23216       if (dk->type == DOT11DECRYPT_KEY_TYPE_WEP)
23217       {
23218         gboolean res;
23219         key.KeyType = DOT11DECRYPT_KEY_TYPE_WEP;
23220
23221         bytes = g_byte_array_new();
23222         res = hex_str_to_bytes(dk->key->str, bytes, FALSE);
23223
23224         if (dk->key->str && res && (bytes->len > 0) && (bytes->len <= DOT11DECRYPT_WEP_KEY_MAXLEN))
23225         {
23226           /*
23227            * WEP key is correct (well, the can be even or odd, so it is not
23228            * a real check, I think... is a check performed somewhere in the
23229            * Dot11Decrypt function???)
23230            */
23231           memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
23232           key.KeyData.Wep.WepKeyLen = bytes->len;
23233           keys->Keys[keys->nKeys] = key;
23234           keys->nKeys += 1;
23235         }
23236       }
23237       else if (dk->type == DOT11DECRYPT_KEY_TYPE_WPA_PWD)
23238       {
23239         key.KeyType = DOT11DECRYPT_KEY_TYPE_WPA_PWD;
23240
23241         /* XXX - This just lops the end if the key off if it's too long.
23242          *       Should we handle this more gracefully? */
23243         g_strlcpy(key.UserPwd.Passphrase, dk->key->str, DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN+1);
23244
23245         key.UserPwd.SsidLen = 0;
23246         if ((dk->ssid != NULL) && (dk->ssid->len <= DOT11DECRYPT_WPA_SSID_MAX_LEN))
23247         {
23248           memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
23249           key.UserPwd.SsidLen = dk->ssid->len;
23250         }
23251
23252         keys->Keys[keys->nKeys] = key;
23253         keys->nKeys += 1;
23254       }
23255       else if (dk->type == DOT11DECRYPT_KEY_TYPE_WPA_PSK)
23256       {
23257         key.KeyType = DOT11DECRYPT_KEY_TYPE_WPA_PSK;
23258
23259         bytes = g_byte_array_new();
23260         hex_str_to_bytes(dk->key->str, bytes, FALSE);
23261
23262         /* XXX - Pass the correct array of bytes... */
23263         if (bytes->len <= DOT11DECRYPT_WPA_PSK_LEN) {
23264           memcpy(key.KeyData.Wpa.Psk, bytes->data, bytes->len);
23265
23266           keys->Keys[keys->nKeys] = key;
23267           keys->nKeys += 1;
23268         }
23269       }
23270       free_key_string(dk);
23271       if (bytes) {
23272         g_byte_array_free(bytes, TRUE);
23273         bytes = NULL;
23274       }
23275     }
23276   }
23277
23278   /* Now set the keys */
23279   Dot11DecryptSetKeys(&dot11decrypt_ctx, keys->Keys, keys->nKeys);
23280   g_free(keys);
23281 }
23282
23283 static void
23284 init_wepkeys(void)
23285 {
23286
23287   /*
23288    * XXX - Dot11Decrypt - That God sends it to us beautiful (che dio ce la mandi bona)
23289    * The next lines will add a key to the Dot11Decrypt context. The keystring will be added
23290    * to the old WEP array too, but we don't care, because the packets will come here
23291    * already decrypted... One of these days we will fix this too
23292    */
23293   set_dot11decrypt_keys();
23294 }
23295
23296 /*
23297  * This code had been taken from AirSnort crack.c function classify()
23298  * Permission granted by snax <at> shmoo dot com
23299  * weak_iv - determine which key byte an iv is useful in resolving
23300  * parm     - p, pointer to the first byte of an IV
23301  * return   -  n - this IV is weak for byte n of a WEP key
23302  *            -1 - this IV is not weak for any key bytes
23303  *
23304  * This function tests for IVs that are known to satisfy the criteria
23305  * for a weak IV as specified in FMS section 7.1
23306  *
23307  */
23308 static int
23309 weak_iv(guchar *iv)
23310 {
23311   guchar sum, k;
23312
23313   if ((iv[1] == 255) && (iv[0] > 2) && (iv[0] < 16)) {
23314     return iv[0] -3;
23315   }
23316
23317   sum = iv[0] + iv[1];
23318   if (sum == 1) {
23319     if (iv[2] <= 0x0a) {
23320       return iv[2] +2;
23321     }
23322     else if (iv[2] == 0xff) {
23323       return 0;
23324     }
23325   }
23326   k = 0xfe - iv[2];
23327   if ((sum == k)  && ((iv[2] >= 0xf2) && (iv[2] <= 0xfe) && (iv[2] != 0xfd))) {
23328     return k;
23329   }
23330   return -1;
23331 }
23332
23333 static void
23334 wlan_retransmit_init(void)
23335 {
23336   if (fc_analyse_retransmit_table) {
23337     g_hash_table_destroy(fc_analyse_retransmit_table);
23338     fc_analyse_retransmit_table = NULL;
23339   }
23340
23341   if (fc_first_frame_table) {
23342     g_hash_table_destroy(fc_first_frame_table);
23343     fc_first_frame_table = NULL;
23344   }
23345
23346   if (wlan_subdissector)
23347     return;
23348
23349   fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
23350   fc_first_frame_table = g_hash_table_new(frame_hash, frame_equal);
23351
23352 }
23353
23354 static int
23355 dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
23356 {
23357   int         offset = 0;
23358   guint8      type;
23359   int         tagged_parameter_tree_len;
23360   proto_tree *tagged_tree;
23361
23362   type = tvb_get_guint8(tvb, offset);
23363   proto_tree_add_item(tree, hf_ieee80211_data_encap_payload_type, tvb, offset,
23364                       1, ENC_LITTLE_ENDIAN);
23365   offset += 1;
23366   switch (type) {
23367   case 1:
23368     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRB");
23369     /* TODO: IEEE 802.11r */
23370     break;
23371   case 2:
23372     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
23373     col_clear(pinfo->cinfo, COL_INFO);
23374     offset += add_ff_action(tree, tvb, pinfo, offset);
23375     tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
23376     if (tagged_parameter_tree_len > 0) {
23377       tagged_tree = get_tagged_parameter_tree(tree, tvb, offset,
23378                                               tagged_parameter_tree_len);
23379       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
23380                                        tagged_parameter_tree_len, -1, NULL);
23381     }
23382     break;
23383   }
23384   return tvb_captured_length(tvb);
23385 }
23386
23387 void
23388 proto_register_ieee80211(void)
23389 {
23390
23391   static hf_register_info hf[] = {
23392     {&hf_ieee80211_fc_field,
23393      {"Frame Control Field", "wlan.fc",
23394       FT_UINT16, BASE_HEX, NULL, 0,
23395       "MAC Frame control", HFILL }},
23396
23397     {&hf_ieee80211_fc_proto_version,
23398      {"Version", "wlan.fc.version",
23399       FT_UINT8, BASE_DEC, NULL, 0x03,
23400       "MAC Protocol version", HFILL }},  /* 0 */
23401
23402     {&hf_ieee80211_fc_frame_type,
23403      {"Type", "wlan.fc.type",
23404       FT_UINT8, BASE_DEC, VALS(frame_type), 0x0C,
23405       "Frame type", HFILL }},
23406
23407     {&hf_ieee80211_fc_frame_subtype,
23408      {"Subtype", "wlan.fc.subtype",
23409       FT_UINT8, BASE_DEC, NULL, 0xF0,
23410       "Frame subtype", HFILL }},  /* 2 */
23411
23412     {&hf_ieee80211_fc_frame_type_subtype,
23413      {"Type/Subtype", "wlan.fc.type_subtype",
23414       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &frame_type_subtype_vals_ext, 0x0,
23415       "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
23416
23417     {&hf_ieee80211_fc_frame_extension,
23418      {"Control Frame Extension", "wlan.fc.extension",
23419       FT_UINT8, BASE_DEC, NULL, 0,
23420       NULL, HFILL }},
23421
23422     {&hf_ieee80211_fc_flags,
23423      {"Flags", "wlan.flags",
23424       FT_UINT8, BASE_HEX, NULL, 0,
23425       NULL, HFILL }},
23426
23427     {&hf_ieee80211_fc_data_ds,
23428      {"DS status", "wlan.fc.ds",
23429       FT_UINT8, BASE_HEX, VALS(tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
23430       "Data-frame DS-traversal status", HFILL }},  /* 3 */
23431
23432     {&hf_ieee80211_fc_to_ds,
23433      {"To DS", "wlan.fc.tods",
23434       FT_BOOLEAN, 8, TFS(&tods_flag), FLAG_TO_DS,
23435       "To DS flag", HFILL }},    /* 4 */
23436
23437     {&hf_ieee80211_fc_from_ds,
23438      {"From DS", "wlan.fc.fromds",
23439       FT_BOOLEAN, 8, TFS(&fromds_flag), FLAG_FROM_DS,
23440       "From DS flag", HFILL }},    /* 5 */
23441
23442     {&hf_ieee80211_fc_more_frag,
23443      {"More Fragments", "wlan.fc.frag",
23444       FT_BOOLEAN, 8, TFS(&more_fragments), FLAG_MORE_FRAGMENTS,
23445       "More Fragments flag", HFILL }},  /* 6 */
23446
23447     {&hf_ieee80211_fc_retry,
23448      {"Retry", "wlan.fc.retry",
23449       FT_BOOLEAN, 8, TFS(&retry_flags), FLAG_RETRY,
23450       "Retransmission flag", HFILL }},
23451
23452     {&hf_ieee80211_fc_analysis_retransmission,
23453      {"Retransmission", "wlan.analysis.retransmission",
23454       FT_NONE, BASE_NONE, NULL, 0x0,
23455       "This frame is a suspected wireless retransmission", HFILL }},
23456
23457     {&hf_ieee80211_fc_analysis_retransmission_frame,
23458      {"Retransmission of frame", "wlan.analysis.retransmission_frame",
23459       FT_FRAMENUM, BASE_NONE, NULL, 0x0,
23460       "This is a retransmission of frame #", HFILL }},
23461
23462     {&hf_ieee80211_fc_pwr_mgt,
23463      {"PWR MGT", "wlan.fc.pwrmgt",
23464       FT_BOOLEAN, 8, TFS(&pm_flags), FLAG_POWER_MGT,
23465       "Power management status", HFILL }},
23466
23467     {&hf_ieee80211_fc_more_data,
23468      {"More Data", "wlan.fc.moredata",
23469       FT_BOOLEAN, 8, TFS(&md_flags), FLAG_MORE_DATA,
23470       "More data flag", HFILL }},
23471
23472     {&hf_ieee80211_fc_protected,
23473      {"Protected flag", "wlan.fc.protected",
23474       FT_BOOLEAN, 8, TFS(&protected_flags), FLAG_PROTECTED,
23475       NULL, HFILL }},
23476
23477     {&hf_ieee80211_fc_order,
23478      {"Order flag", "wlan.fc.order",
23479       FT_BOOLEAN, 8, TFS(&order_flags), FLAG_ORDER,
23480       "Strictly ordered flag", HFILL }},
23481
23482     {&hf_ieee80211_assoc_id,
23483      {"Association ID", "wlan.aid",
23484       FT_UINT16, BASE_DEC, NULL, 0x3FFF,
23485       NULL, HFILL }},
23486
23487     {&hf_ieee80211_did_duration,
23488      {"Duration", "wlan.duration",
23489       FT_UINT16, BASE_DEC, NULL, 0x7FFF,
23490       NULL, HFILL }},
23491
23492     {&hf_ieee80211_addr_da,
23493      {"Destination address", "wlan.da",
23494       FT_ETHER, BASE_NONE, NULL, 0,
23495       "Destination Hardware Address", HFILL }},
23496
23497     {&hf_ieee80211_addr_da_resolved,
23498       {"Destination address (resolved)", "wlan.da_resolved", FT_STRING,
23499         BASE_NONE, NULL, 0x0,
23500         "Destination Hardware Address (resolved)", HFILL }},
23501
23502     {&hf_ieee80211_addr_sa,
23503      {"Source address", "wlan.sa",
23504       FT_ETHER, BASE_NONE, NULL, 0,
23505       "Source Hardware Address", HFILL }},
23506
23507     {&hf_ieee80211_addr_sa_resolved,
23508       {"Source address (resolved)", "wlan.sa_resolved", FT_STRING,
23509        BASE_NONE, NULL, 0x0,
23510        "Source Hardware Address (resolved)", HFILL }},
23511
23512     {&hf_ieee80211_addr,
23513       {"Hardware address", "wlan.addr",
23514        FT_ETHER, BASE_NONE, NULL, 0,
23515        "SA, DA, BSSID, RA or TA Hardware Address", HFILL }},
23516
23517     {&hf_ieee80211_addr_resolved,
23518       { "Hardware address (resolved)", "wlan.addr_resolved", FT_STRING,
23519         BASE_NONE, NULL, 0x0,
23520         "SA, DA, BSSID, RA or TA Hardware Address (resolved)", HFILL }},
23521
23522     {&hf_ieee80211_addr_ra,
23523      {"Receiver address", "wlan.ra",
23524       FT_ETHER, BASE_NONE, NULL, 0,
23525       "Receiving Station Hardware Address", HFILL }},
23526
23527     {&hf_ieee80211_addr_ra_resolved,
23528       {"Receiver address (resolved)", "wlan.ra_resolved", FT_STRING, BASE_NONE,
23529         NULL, 0x0, "Receiving Station Hardware Address (resolved)", HFILL }},
23530
23531     {&hf_ieee80211_addr_ta,
23532      {"Transmitter address", "wlan.ta",
23533       FT_ETHER, BASE_NONE, NULL, 0,
23534       "Transmitting Station Hardware Address", HFILL }},
23535
23536     {&hf_ieee80211_addr_ta_resolved,
23537       {"Transmitter address (resolved)", "wlan.ta_resolved", FT_STRING,
23538         BASE_NONE, NULL, 0x0,
23539         "Transmitting Station Hardware Address (resolved)", HFILL }},
23540
23541     {&hf_ieee80211_addr_bssid,
23542      {"BSS Id", "wlan.bssid",
23543       FT_ETHER, BASE_NONE, NULL, 0,
23544       "Basic Service Set ID", HFILL }},
23545
23546     {&hf_ieee80211_addr_bssid_resolved,
23547       {"BSS Id (resolved)", "wlan.bssid_resolved", FT_STRING, BASE_NONE, NULL,
23548         0x0, "Basic Service Set ID (resolved)", HFILL }},
23549
23550     {&hf_ieee80211_addr_staa,
23551      {"STA address", "wlan.staa",
23552       FT_ETHER, BASE_NONE, NULL, 0,
23553       "Station Hardware Address", HFILL }},
23554
23555     {&hf_ieee80211_addr_staa_resolved,
23556       {"STA address (resolved)", "wlan.staa_resolved", FT_STRING, BASE_NONE, NULL,
23557         0x0, "Station Hardware Address (resolved)", HFILL }},
23558
23559     {&hf_ieee80211_frag_number,
23560      {"Fragment number", "wlan.frag",
23561       FT_UINT16, BASE_DEC, NULL, 0x000F,
23562       NULL, HFILL }},
23563
23564     {&hf_ieee80211_seq_number,
23565      {"Sequence number", "wlan.seq",
23566       FT_UINT16, BASE_DEC, NULL, 0xFFF0,
23567       NULL, HFILL }},
23568
23569     {&hf_ieee80211_mesh_control_field,
23570      {"Mesh Control Field", "wlan.mesh.control_field",
23571       FT_NONE, BASE_NONE, NULL, 0,
23572       NULL, HFILL }},
23573
23574     {&hf_ieee80211_qos,
23575      {"Qos Control", "wlan.qos",
23576       FT_UINT16, BASE_HEX, NULL, 0,
23577       NULL, HFILL }},
23578
23579     {&hf_ieee80211_qos_tid,
23580      {"TID", "wlan.qos.tid",
23581       FT_UINT16, BASE_DEC, NULL, 0x000F,
23582       NULL, HFILL }},
23583
23584     {&hf_ieee80211_qos_priority,
23585      {"Priority", "wlan.qos.priority",
23586       FT_UINT16, BASE_DEC, VALS(ieee80211_qos_tags_acs), 0x0007,
23587       "802.1D Tag", HFILL }},
23588
23589     {&hf_ieee80211_qos_eosp,
23590      {"EOSP", "wlan.qos.eosp",
23591       FT_BOOLEAN, 16, TFS(&eosp_flag), QOS_FLAG_EOSP,
23592       "EOSP Field", HFILL }},
23593
23594     {&hf_ieee80211_qos_bit4,
23595      {"QoS bit 4", "wlan.qos.bit4",
23596       FT_BOOLEAN, 16, TFS(&bit4_flag), QOS_FLAG_EOSP,
23597       NULL, HFILL }},
23598
23599     {&hf_ieee80211_qos_ack_policy,
23600      {"Ack Policy", "wlan.qos.ack",
23601       FT_UINT16, BASE_HEX,  VALS(ack_policy), 0x0060,
23602       NULL, HFILL }},
23603
23604     {&hf_ieee80211_qos_amsdu_present,
23605      {"Payload Type", "wlan.qos.amsdupresent",
23606       FT_BOOLEAN, 16, TFS(&ieee80211_qos_amsdu_present_flag), 0x0080,
23607       NULL, HFILL }},
23608
23609     {&hf_ieee80211_qos_txop_limit,
23610      {"TXOP Limit", "wlan.qos.txop_limit",
23611       FT_UINT16, BASE_DEC, NULL, 0xFF00,
23612       NULL, HFILL }},
23613
23614     {&hf_ieee80211_qos_ps_buf_state,
23615      {"QAP PS Buffer State", "wlan.qos.ps_buf_state",
23616       FT_UINT16, BASE_HEX, NULL, 0xFF00,
23617       NULL, HFILL }},
23618
23619     {&hf_ieee80211_qos_buf_state_indicated,
23620      {"Buffer State Indicated", "wlan.qos.buf_state_indicated",
23621       FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
23622       NULL, HFILL }},
23623
23624     {&hf_ieee80211_qos_highest_pri_buf_ac,
23625      {"Highest-Priority Buffered AC", "wlan.qos.highest_pri_buf_ac",
23626        FT_UINT16, BASE_DEC, VALS(wme_acs), 0x0C00,
23627       NULL, HFILL }},
23628
23629     {&hf_ieee80211_qos_qap_buf_load,
23630      {"QAP Buffered Load", "wlan.qos.qap_buf_load",
23631       FT_UINT16, BASE_DEC, NULL, 0xF000,
23632       NULL, HFILL }},
23633
23634     {&hf_ieee80211_qos_txop_dur_req,
23635      {"TXOP Duration Requested", "wlan.qos.txop_dur_req",
23636       FT_UINT16, BASE_DEC, NULL, 0xFF00,
23637       NULL, HFILL }},
23638
23639     {&hf_ieee80211_qos_queue_size,
23640      {"Queue Size", "wlan.qos.queue_size",
23641       FT_UINT16, BASE_DEC, NULL, 0xFF00,
23642       NULL, HFILL }},
23643
23644     {&hf_ieee80211_fcs,
23645      {"Frame check sequence", "wlan.fcs",
23646       FT_UINT32, BASE_HEX, NULL, 0,
23647       "Frame Check Sequence (FCS)", HFILL }},
23648
23649     {&hf_ieee80211_fcs_status,
23650      {"FCS Status", "wlan.fcs.status",
23651       FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0,
23652       NULL, HFILL }},
23653
23654     {&hf_ieee80211_fragment_overlap,
23655       {"Fragment overlap", "wlan.fragment.overlap",
23656        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23657        "Fragment overlaps with other fragments", HFILL }},
23658
23659     {&hf_ieee80211_fragment_overlap_conflict,
23660       {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
23661        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23662        "Overlapping fragments contained conflicting data", HFILL }},
23663
23664     {&hf_ieee80211_fragment_multiple_tails,
23665       {"Multiple tail fragments found", "wlan.fragment.multipletails",
23666        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23667        "Several tails were found when defragmenting the packet", HFILL }},
23668
23669     {&hf_ieee80211_fragment_too_long_fragment,
23670       {"Fragment too long", "wlan.fragment.toolongfragment",
23671        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23672        "Fragment contained data past end of packet", HFILL }},
23673
23674     {&hf_ieee80211_fragment_error,
23675       {"Defragmentation error", "wlan.fragment.error",
23676        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
23677        "Defragmentation error due to illegal fragments", HFILL }},
23678
23679     {&hf_ieee80211_fragment_count,
23680       {"Fragment count", "wlan.fragment.count",
23681        FT_UINT32, BASE_DEC, NULL, 0x0,
23682        NULL, HFILL }},
23683
23684     {&hf_ieee80211_fragment,
23685       {"802.11 Fragment", "wlan.fragment",
23686        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
23687        NULL, HFILL }},
23688
23689     {&hf_ieee80211_fragments,
23690       {"802.11 Fragments", "wlan.fragments",
23691        FT_NONE, BASE_NONE, NULL, 0x0,
23692        NULL, HFILL }},
23693
23694     {&hf_ieee80211_reassembled_in,
23695       {"Reassembled 802.11 in frame", "wlan.reassembled_in",
23696        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
23697        "This 802.11 packet is reassembled in this frame", HFILL }},
23698
23699     {&hf_ieee80211_reassembled_length,
23700       {"Reassembled 802.11 length", "wlan.reassembled.length",
23701        FT_UINT32, BASE_DEC, NULL, 0x0,
23702        "The total length of the reassembled payload", HFILL }},
23703
23704     {&hf_ieee80211_wep_iv,
23705      {"Initialization Vector", "wlan.wep.iv",
23706       FT_UINT24, BASE_HEX, NULL, 0,
23707       NULL, HFILL }},
23708
23709     {&hf_ieee80211_wep_iv_weak,
23710      {"Weak IV", "wlan.wep.weakiv",
23711       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23712        NULL, HFILL}},
23713
23714     {&hf_ieee80211_tkip_extiv,
23715      {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv",
23716       FT_STRING, BASE_NONE, NULL, 0,
23717       "TKIP Extended Initialization Vector", HFILL }},
23718
23719     {&hf_ieee80211_ccmp_extiv,
23720      {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv",
23721       FT_STRING, BASE_NONE, NULL, 0,
23722       "CCMP Extended Initialization Vector", HFILL }},
23723
23724     {&hf_ieee80211_wep_key,
23725      {"Key Index", "wlan.wep.key",
23726       FT_UINT8, BASE_DEC, NULL, 0,
23727       NULL, HFILL }},
23728
23729     {&hf_ieee80211_wep_icv,
23730      {"WEP ICV", "wlan.wep.icv",
23731       FT_UINT32, BASE_HEX, NULL, 0,
23732       NULL, HFILL }},
23733
23734     {&hf_ieee80211_fc_analysis_pmk,
23735      {"PMK", "wlan.analysis.pmk",
23736       FT_STRING, BASE_NONE, NULL, 0x0,
23737       NULL, HFILL }},
23738
23739     {&hf_ieee80211_fc_analysis_tk,
23740      {"TK", "wlan.analysis.tk",
23741       FT_STRING, BASE_NONE, NULL, 0x0,
23742       NULL, HFILL }},
23743
23744     {&hf_ieee80211_fc_analysis_gtk,
23745      {"GTK", "wlan.analysis.gtk",
23746       FT_STRING, BASE_NONE, NULL, 0x0,
23747       NULL, HFILL }},
23748
23749     {&hf_ieee80211_block_ack_control,
23750      {"Block Ack Control", "wlan.ba.control",
23751       FT_UINT16, BASE_HEX, NULL, 0,
23752       NULL, HFILL }},
23753
23754     {&hf_ieee80211_block_ack_control_ack_policy,
23755      {"BA Ack Policy", "wlan.ba.control.ackpolicy",
23756       FT_BOOLEAN, 16, TFS(&ieee80211_block_ack_control_ack_policy_flag), 0x01,
23757       "Block Ack Request (BAR) Ack Policy", HFILL }},
23758
23759     {&hf_ieee80211_block_ack_control_type,
23760      {"BA Type", "wlan.ba.control.ba_type",
23761       FT_UINT16, BASE_HEX, VALS(block_ack_type_vals), 0x001e, NULL, HFILL }},
23762
23763     {&hf_ieee80211_block_ack_control_reserved,
23764      {"Reserved", "wlan.ba.control.reserved",
23765       FT_UINT16, BASE_HEX, NULL, 0x0fe0,
23766       NULL, HFILL }},
23767
23768     {&hf_ieee80211_block_ack_control_tid_info,
23769      {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
23770       FT_UINT16, BASE_HEX, NULL, 0xf000,
23771       "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
23772
23773     {&hf_ieee80211_block_ack_multi_sta_aid11,
23774      {"AID11", "wlan.ba.multi_sta.aid11",
23775       FT_UINT16, BASE_HEX, NULL, 0x07ff, NULL, HFILL }},
23776
23777     {&hf_ieee80211_block_ack_multi_sta_ack_type,
23778      {"Ack Type", "wlan.ba.multi_sta.ack_type",
23779       FT_UINT16, BASE_HEX, NULL, 0x0800, NULL, HFILL }},
23780
23781     {&hf_ieee80211_block_ack_multi_sta_tid,
23782      {"TID", "wlan.ba.multi_sta.tid",
23783       FT_UINT16, BASE_HEX, NULL, 0xf000, NULL, HFILL }},
23784
23785     {&hf_ieee80211_block_ack_multi_sta_aid_tid,
23786      {"AID TID Info", "wlan.ba.multi_sta.aid_tid_info",
23787       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
23788
23789     {&hf_ieee80211_block_ack_multi_sta_reserved,
23790      {"Reserved", "wlan.ba.multi_sta.reserved",
23791       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
23792
23793     {&hf_ieee80211_block_ack_multi_sta_ra,
23794      {"RA", "wlan.ba.multi_sta.ra",
23795       FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
23796
23797     {&hf_ieee80211_block_ack_multi_tid_reserved,
23798      {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
23799       FT_UINT16, BASE_HEX, 0, 0x0fff,
23800       NULL, HFILL }},
23801
23802     {&hf_ieee80211_block_ack_multi_tid_value,
23803      {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
23804       FT_UINT16, BASE_HEX, 0, 0xf000,
23805       NULL, HFILL }},
23806
23807     {&hf_ieee80211_block_ack_bitmap,
23808      {"Block Ack Bitmap", "wlan.ba.bm",
23809       FT_BYTES, BASE_NONE, NULL, 0,
23810       NULL, HFILL }},
23811
23812     /* Used for Extended compressed BlockAck */
23813     {&hf_ieee80211_block_ack_RBUFCAP,
23814      {"Block Ack RBUFCAP", "wlan.ba.RBUFCAP",
23815       FT_BOOLEAN, BASE_DEC, NULL, 0,
23816       NULL, HFILL }},
23817
23818     {&hf_ieee80211_block_ack_bitmap_missing_frame,
23819      {"Missing frame", "wlan.ba.bm.missing_frame",
23820       FT_UINT32, BASE_DEC, NULL, 0,
23821       NULL, HFILL }},
23822
23823     {&hf_ieee80211_block_ack_gcr_addr,
23824      {"GCR Group Address", "wlan.ba.gcr_group_addr",
23825       FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
23826
23827     {&hf_ieee80211_beamform_feedback_seg_retrans_bitmap,
23828      {"Feedback segment Retansmission Bitmap", "wlan.beamform.feedback_seg_retrans_bitmap",
23829       FT_UINT8, BASE_HEX, NULL, 0,
23830       NULL, HFILL }},
23831
23832     {&hf_ieee80211_vht_ndp_annc_token,
23833      {"Sounding Dialog Token", "wlan.vht_ndp.token",
23834       FT_UINT8, BASE_HEX, NULL, 0,
23835       NULL, HFILL }},
23836
23837     {&hf_ieee80211_vht_ndp_annc_token_number,
23838      {"Sounding Dialog Token Number", "wlan.vht_ndp.token.number",
23839       FT_UINT8, BASE_DEC, NULL, 0xFC,
23840       NULL, HFILL }},
23841
23842     {&hf_ieee80211_vht_ndp_annc_he_subfield,
23843      {"HE", "wlan.vht_ndp.token.he",
23844       FT_BOOLEAN, 8, TFS(&he_ndp_annc_he_subfield_vals), 0x02, NULL, HFILL }},
23845
23846     {&hf_ieee80211_vht_ndp_annc_token_reserved,
23847      {"Reserved", "wlan.vht_ndp.token.reserved",
23848       FT_UINT8, BASE_HEX, NULL, 0x01,
23849       NULL, HFILL }},
23850
23851     {&hf_ieee80211_vht_ndp_annc_sta_info_aid12,
23852      {"AID12", "wlan.vht_ndp.sta_info.aid12",
23853       FT_UINT16, BASE_HEX, NULL, 0x0FFF,
23854       "12 least significant bits of the AID of the target STA", HFILL }},
23855
23856     {&hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
23857      {"Feedback Type", "wlan.vht_ndp.sta_info.feedback_type",
23858       FT_BOOLEAN, 16, TFS(&vht_ndp_annc_sta_info_feedback_type), 0x1000,
23859       NULL, HFILL }},
23860
23861     {&hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
23862      {"Nc Index", "wlan.vht_ndp.sta_info.nc_index",
23863       FT_UINT16, BASE_DEC, VALS(num_plus_one_3bit_flag), 0xE000,
23864       NULL, HFILL }},
23865
23866     {&hf_ieee80211_vht_ndp_annc_sta_info_reserved,
23867      {"Reserved", "wlan.vht_ndp.sta_info.reserved",
23868       FT_UINT16, BASE_HEX, NULL, 0xE000,
23869       NULL, HFILL }},
23870
23871     {&hf_ieee80211_data_encap_payload_type,
23872      {"Payload Type", "wlan.data_encap.payload_type",
23873       FT_UINT8, BASE_DEC, VALS(ieee80211_data_encap_payload_types), 0,
23874       NULL, HFILL }},
23875
23876     {&hf_ieee80211_ff_tdls_action_code,
23877      {"Action code", "wlan.fixed.action_code",
23878       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tdls_action_codes_ext, 0,
23879       "Management action code", HFILL }},
23880
23881     {&hf_ieee80211_ff_target_channel,
23882      {"Target Channel", "wlan.fixed.target_channel",
23883       FT_UINT8, BASE_DEC, NULL, 0,
23884       NULL, HFILL }},
23885
23886     {&hf_ieee80211_ff_operating_class,
23887      {"Operating Class", "wlan.fixed.operating_class",
23888       FT_UINT8, BASE_DEC, NULL, 0,
23889       NULL, HFILL }},
23890
23891     {&hf_ieee80211_ff_wnm_action_code,
23892      {"Action code", "wlan.fixed.action_code",
23893       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_action_codes_ext, 0,
23894       "Management action code", HFILL }},
23895
23896     {&hf_ieee80211_ff_unprotected_wnm_action_code,
23897      {"Action code", "wlan.fixed.action_code",
23898       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &unprotected_wnm_action_codes_ext, 0,
23899       "Management action code", HFILL }},
23900
23901     {&hf_ieee80211_ff_key_data,
23902      {"Key Data", "wlan.fixed.key_data",
23903       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
23904
23905     {&hf_ieee80211_ff_key_data_length,
23906      {"Key Data Length", "wlan.fixed.key_data_length",
23907       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
23908
23909     {&hf_ieee80211_ff_wnm_notification_type,
23910      {"WNM-Notification type", "wlan.fixed.wnm_notification_type",
23911       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_notification_types_ext, 0,
23912       NULL, HFILL }},
23913
23914     {&hf_ieee80211_ff_rm_action_code,
23915      {"Action code", "wlan.rm.action_code",
23916       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &rm_action_codes_ext, 0,
23917       "Radio Measurement Action", HFILL }},
23918
23919     {&hf_ieee80211_ff_rm_dialog_token,
23920      {"Dialog token", "wlan.rm.dialog_token",
23921       FT_UINT8, BASE_DEC, NULL, 0,
23922       "Non-zero Dialog Token identifies request/report transaction", HFILL }},
23923
23924     {&hf_ieee80211_ff_rm_repetitions,
23925      {"Repetitions", "wlan.rm.repetitions",
23926       FT_UINT16, BASE_DEC, NULL, 0,
23927       "Numer of Repetitions, 65535 indicates repeat until cancellation", HFILL }},
23928
23929     {&hf_ieee80211_ff_rm_tx_power,
23930      {"Transmit Power Used", "wlan.rm.tx_power",
23931       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
23932       NULL, HFILL }},
23933
23934     {&hf_ieee80211_ff_rm_max_tx_power,
23935      {"Max Transmit Power", "wlan.rm.max_tx_power",
23936       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
23937       NULL, HFILL }},
23938
23939     {&hf_ieee80211_ff_tpc,
23940      {"TPC Report", "wlan.rm.tpc",
23941       FT_NONE, BASE_NONE, NULL, 0,
23942       NULL, HFILL }},
23943
23944     {&hf_ieee80211_ff_tpc_element_id,
23945      {"TPC Element ID", "wlan.rm.tpc.element_id",
23946       FT_UINT8, BASE_DEC, NULL, 0,
23947       NULL, HFILL }},
23948
23949     {&hf_ieee80211_ff_tpc_length,
23950      {"TPC Length", "wlan.rm.tpc.length",
23951       FT_UINT8, BASE_DEC, NULL, 0,
23952       "Length of TPC Report element (always 2)", HFILL }},
23953
23954     {&hf_ieee80211_ff_tpc_tx_power,
23955      {"TPC Transmit Power", "wlan.rm.tpc.tx_power",
23956       FT_INT8, BASE_DEC, NULL, 0,
23957       NULL, HFILL }},
23958
23959     {&hf_ieee80211_ff_tpc_link_margin,
23960      {"TPC Link Margin", "wlan.rm.tpc.link_margin",
23961       FT_INT8, BASE_DEC, NULL, 0,
23962       NULL, HFILL }},
23963
23964     {&hf_ieee80211_ff_rm_rx_antenna_id,
23965      {"Receive Antenna ID", "wlan.rm.rx_antenna_id",
23966       FT_UINT8, BASE_DEC, NULL, 0,
23967       NULL, HFILL }},
23968
23969     {&hf_ieee80211_ff_rm_tx_antenna_id,
23970      {"Transmit Antenna ID", "wlan.rm.tx_antenna_id",
23971       FT_UINT8, BASE_DEC, NULL, 0,
23972       NULL, HFILL }},
23973
23974     {&hf_ieee80211_ff_rm_rcpi,
23975      {"Received Channel Power", "wlan.rm.rcpi",
23976       FT_UINT8, BASE_DEC, NULL, 0,
23977       NULL, HFILL }},
23978
23979     {&hf_ieee80211_ff_rm_rsni,
23980      {"Received Signal to noise indication", "wlan.rm.rsni",
23981       FT_UINT8, BASE_DEC, NULL, 0,
23982       NULL, HFILL }},
23983
23984     {&hf_ieee80211_ff_request_mode_pref_cand,
23985      {"Preferred Candidate List Included", "wlan.fixed.request_mode.pref_cand",
23986       FT_UINT8, BASE_DEC, NULL, 0x01,
23987       NULL, HFILL }},
23988
23989     {&hf_ieee80211_ff_request_mode_abridged,
23990      {"Abridged", "wlan.fixed.request_mode.abridged",
23991       FT_UINT8, BASE_DEC, NULL, 0x02,
23992       NULL, HFILL }},
23993
23994     {&hf_ieee80211_ff_request_mode_disassoc_imminent,
23995      {"Disassociation Imminent", "wlan.fixed.request_mode.disassoc_imminent",
23996       FT_UINT8, BASE_DEC, NULL, 0x04,
23997       NULL, HFILL }},
23998
23999     {&hf_ieee80211_ff_request_mode_bss_term_included,
24000      {"BSS Termination Included", "wlan.fixed.request_mode.bss_term_included",
24001       FT_UINT8, BASE_DEC, NULL, 0x08,
24002       NULL, HFILL }},
24003
24004     {&hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
24005      {"ESS Disassociation Imminent", "wlan.fixed.request_mode.ess_disassoc_imminent",
24006       FT_UINT8, BASE_DEC, NULL, 0x10,
24007       NULL, HFILL }},
24008
24009     {&hf_ieee80211_ff_disassoc_timer,
24010      {"Disassociation Timer", "wlan.fixed.disassoc_timer",
24011       FT_UINT16, BASE_DEC, NULL, 0,
24012       NULL, HFILL }},
24013
24014     {&hf_ieee80211_ff_bss_termination_delay,
24015      {"BSS Termination Delay", "wlan.fixed.bss_termination_delay",
24016       FT_UINT8, BASE_DEC, NULL, 0,
24017       NULL, HFILL }},
24018
24019     {&hf_ieee80211_ff_bss_transition_status_code,
24020      {"BSS Transition Status Code", "wlan.fixed.bss_transition_status_code",
24021       FT_UINT8, BASE_DEC, NULL, 0,
24022       NULL, HFILL }},
24023
24024     {&hf_ieee80211_ff_validity_interval,
24025      {"Validity Interval", "wlan.fixed.validity_interval",
24026       FT_UINT8, BASE_DEC, NULL, 0,
24027       NULL, HFILL }},
24028
24029     {&hf_ieee80211_ff_bss_termination_duration,
24030      {"BSS Termination Duration", "wlan.fixed.bss_termination_duration",
24031       FT_BYTES, BASE_NONE, NULL, 0,
24032       NULL, HFILL }},
24033
24034     {&hf_ieee80211_ff_url_len,
24035      {"Session Information URL Length",
24036       "wlan.fixed.session_information.url_length",
24037       FT_UINT8, BASE_DEC, NULL, 0,
24038       NULL, HFILL }},
24039
24040     {&hf_ieee80211_ff_url,
24041      {"Session Information URL", "wlan.fixed.session_information.url",
24042       FT_STRING, BASE_NONE, NULL, 0,
24043       NULL, HFILL }},
24044
24045     {&hf_ieee80211_ff_target_bss,
24046      {"BSS Transition Target BSS", "wlan.fixed.bss_transition_target_bss",
24047       FT_ETHER, BASE_NONE, NULL, 0,
24048       NULL, HFILL }},
24049
24050     {&hf_ieee80211_ff_bss_transition_query_reason,
24051      {"BSS Transition Query Reason", "wlan.fixed.bss_transition_query_reason",
24052       FT_UINT8, BASE_DEC, VALS(ieee80211_transition_reasons), 0,
24053       NULL, HFILL }},
24054
24055     {&hf_ieee80211_ff_bss_transition_candidate_list_entries,
24056      {"BSS Transition Candidate List Entries", "wlan.fixed.bss_transition_candidate_list_entries",
24057       FT_BYTES, BASE_NONE, NULL, 0,
24058       NULL, HFILL }},
24059
24060 /* 802.11ad */
24061     {&hf_ieee80211_cf_response_offset,
24062      {"Response Offset", "wlan.res_offset",
24063       FT_UINT16, BASE_DEC, NULL, 0,
24064       NULL, HFILL }},
24065
24066     {&hf_ieee80211_grant_ack_reserved,
24067      {"Reserved", "wlan.grant_ack.reserved",
24068       FT_BYTES, BASE_NONE, NULL, 0,
24069       NULL, HFILL }},
24070
24071     {&hf_ieee80211_ff_dynamic_allocation,
24072      {"Dynamic Allocation", "wlan.dynamic_allocation",
24073       FT_UINT40, BASE_HEX, NULL, 0,
24074       NULL, HFILL }},
24075
24076     {&hf_ieee80211_ff_TID,
24077      {"TID", "wlan.dynamic_allocation.tid",
24078       FT_UINT40, BASE_DEC, NULL, 0x000000000F,
24079       NULL, HFILL }},
24080
24081     {&hf_ieee80211_ff_alloc_type,
24082      {"Allocation Type", "wlan.dynamic_allocation.alloc_type",
24083       FT_UINT40, BASE_DEC, NULL, 0x000000070,
24084       NULL, HFILL }},
24085
24086     {&hf_ieee80211_ff_src_aid,
24087      {"Source AID", "wlan.dynamic_allocation.src_aid",
24088       FT_UINT40, BASE_DEC, NULL, 0x0000007F80,
24089       NULL, HFILL }},
24090
24091     {&hf_ieee80211_ff_dest_aid,
24092      {"Destination AID", "wlan.dynamic_allocation.dest_aid",
24093       FT_UINT40, BASE_DEC, NULL, 0x00007f8000,
24094       NULL, HFILL }},
24095
24096     {&hf_ieee80211_ff_alloc_duration,
24097      {"Allocation Duration", "wlan.dynamic_allocation.alloc_duration",
24098       FT_UINT40, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0x7FFF800000,
24099       NULL, HFILL }},
24100
24101     {&hf_ieee80211_ff_b39,
24102      {"Reserved (b39)", "wlan.dynamic_allocation.b39",
24103       FT_UINT40, BASE_HEX, NULL, 0x8000000000,
24104       NULL, HFILL }},
24105
24106     {&hf_ieee80211_ff_ssw,
24107      {"Sector Sweep", "wlan.ssw",
24108       FT_UINT24, BASE_HEX, NULL, 0,
24109       NULL, HFILL }},
24110
24111     {&hf_ieee80211_ff_ssw_direction,
24112      {"Sector Sweep Direction", "wlan.ssw.direction",
24113       FT_BOOLEAN, 24, TFS(&ieee80211_cf_ssw_direction), 0x000001,
24114       NULL, HFILL}},
24115
24116     {&hf_ieee80211_ff_ssw_cdown,
24117      {"Sector Sweep CDOWN", "wlan.ssw.cdown",
24118       FT_UINT24, BASE_DEC, NULL, 0x0003fe,
24119       NULL, HFILL }},
24120
24121     {&hf_ieee80211_ff_ssw_sector_id,
24122      {"Sector Sweep Sector ID", "wlan.ssw.sector_id",
24123       FT_UINT24, BASE_DEC, NULL, 0x00fc00,
24124       NULL, HFILL }},
24125
24126     {&hf_ieee80211_ff_ssw_dmg_ant_id,
24127      {"Sector Sweep DMG Antenna ID", "wlan.ssw.dmg_ant_id",
24128       FT_UINT24, BASE_DEC, NULL, 0x030000,
24129       NULL, HFILL }},
24130
24131     {&hf_ieee80211_ff_ssw_rxss_len,
24132      {"Sector Sweep RXSS Length", "wlan.ssw.rxss_len",
24133       FT_UINT24, BASE_DEC, NULL, 0xfc0000,
24134       NULL, HFILL }},
24135
24136     {&hf_ieee80211_ff_bf,
24137      {"Beam Forming", "wlan.bf",
24138       FT_UINT16, BASE_HEX, NULL, 0,
24139       NULL, HFILL }},
24140
24141     {&hf_ieee80211_ff_bf_train,
24142      {"Beam Forming Training", "wlan.bf.train",
24143       FT_BOOLEAN, 16, NULL, 0x0001,
24144       NULL, HFILL }},
24145
24146     {&hf_ieee80211_ff_bf_is_init,
24147      {"Beam Forming Is InitiatorTXSS", "wlan.bf.isInit",
24148       FT_BOOLEAN, 16, NULL, 0x0002,
24149       NULL, HFILL }},
24150
24151     {&hf_ieee80211_ff_bf_is_resp,
24152      {"Beam Forming Is ResponderTXSS", "wlan.bf.isResp",
24153       FT_BOOLEAN, 16, NULL, 0x0004,
24154       NULL, HFILL }},
24155
24156     {&hf_ieee80211_ff_bf_rxss_len,
24157      {"Beam Forming RXSS Length", "wlan.bf.rxss_len",
24158       FT_UINT16, BASE_DEC, NULL, 0x01f8,
24159       NULL, HFILL }},
24160
24161     {&hf_ieee80211_ff_bf_rxss_rate,
24162      {"Beam Forming RXSS Rate", "wlan.bf.rxss_rate",
24163       FT_BOOLEAN, 16, NULL, 0x0200,
24164       NULL, HFILL }},
24165
24166     {&hf_ieee80211_ff_bf_b10b15,
24167      {"Reserved (B10-B15)", "wlan.bf.reserved",
24168       FT_UINT16, BASE_DEC, NULL, 0xFC00,
24169       NULL, HFILL }},
24170
24171     {&hf_ieee80211_ff_bf_num_sectors,
24172      {"Beam Forming Total Number of Sectors", "wlan.bf.num_sectors",
24173       FT_UINT16, BASE_DEC, NULL, 0x03f8,
24174       NULL, HFILL }},
24175
24176     {&hf_ieee80211_ff_bf_num_rx_dmg_ants,
24177      {"Beam Forming Number of DMG Antennas", "wlan.bf.num_dmg_ants",
24178       FT_UINT16, BASE_DEC, NULL, 0x0c00,
24179       NULL, HFILL }},
24180
24181     {&hf_ieee80211_ff_bf_b12b15,
24182      {"Reserved (B12-B15)", "wlan.bf.reserved",
24183       FT_UINT16, BASE_DEC, NULL, 0xF000,
24184       NULL, HFILL }},
24185
24186     {&hf_ieee80211_addr_nav_da,
24187      {"Destination address of STA that caused NAV update", "wlan.nav_da",
24188       FT_ETHER, BASE_NONE, NULL, 0,
24189       "DMG Destination Hardware Address", HFILL }},
24190
24191     {&hf_ieee80211_addr_nav_sa,
24192      {"Source address of STA that caused NAV update", "wlan.nav_sa",
24193       FT_ETHER, BASE_NONE, NULL, 0,
24194       "DMG Source Hardware Address", HFILL }},
24195
24196     {&hf_ieee80211_ff_sswf,
24197      {"Sector Sweep Feedback", "wlan.sswf",
24198       FT_UINT24, BASE_HEX, NULL, 0,
24199       NULL, HFILL }},
24200
24201     {&hf_ieee80211_ff_sswf_total_sectors,
24202      {"Sector Sweep Feedback total number of sectors", "wlan.sswf.num_sectors",
24203       FT_UINT24, BASE_DEC, NULL, 0x0001ff,
24204       NULL, HFILL }},
24205
24206     {&hf_ieee80211_ff_sswf_num_rx_dmg_ants,
24207      {"Sector Sweep Feedback Number of receive DMG Antennas", "wlan.sswf.num_dmg_ants",
24208       FT_UINT24, BASE_DEC, NULL, 0x000600,
24209       NULL, HFILL }},
24210
24211     {&hf_ieee80211_ff_sswf_poll_required,
24212      {"Sector Sweep Feedback Poll required", "wlan.sswf.poll",
24213       FT_BOOLEAN, 24, NULL, 0x010000,
24214       NULL, HFILL }},
24215
24216     {&hf_ieee80211_ff_sswf_reserved1,
24217      {"Sector Sweep Feedback Reserved", "wlan.sswf.reserved",
24218       FT_UINT24, BASE_HEX, NULL, 0x00F800,
24219       NULL, HFILL }},
24220
24221     {&hf_ieee80211_ff_sswf_reserved2,
24222      {"Sector Sweep Feedback Reserved", "wlan.sswf.reserved",
24223       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
24224       NULL, HFILL }},
24225
24226     {&hf_ieee80211_ff_sswf_sector_select,
24227      {"Sector Sweep Feedback Sector Select", "wlan.sswf.sector_select",
24228       FT_UINT24, BASE_DEC, NULL, 0x00003F,
24229       NULL, HFILL }},
24230
24231     {&hf_ieee80211_ff_sswf_dmg_antenna_select,
24232      {"Sector Sweep Feedback DMG Antenna Select", "wlan.sswf.dmg_antenna_select",
24233       FT_UINT24, BASE_DEC, NULL, 0x0000C0,
24234       NULL, HFILL }},
24235
24236     {&hf_ieee80211_ff_sswf_snr_report,
24237      {"Sector Sweep Feedback SNR Report", "wlan.sswf.snr_report",
24238       FT_UINT24, BASE_DEC, NULL, 0x00FF00,
24239       NULL, HFILL }},
24240
24241
24242     {&hf_ieee80211_ff_brp,
24243      {"BRP Request", "wlan.brp",
24244       FT_UINT32, BASE_HEX, NULL, 0,
24245       NULL, HFILL }},
24246
24247     {&hf_ieee80211_ff_brp_L_RX,
24248      {"BRP Request L-RX", "wlan.brp.l_rx",
24249       FT_UINT32, BASE_DEC, NULL, 0x0000001f,
24250       NULL, HFILL }},
24251
24252     {&hf_ieee80211_ff_brp_TX_TRN_REQ,
24253      {"BRP Request TX-TRN-REQ", "wlan.brp.tx_trn_req",
24254       FT_BOOLEAN, 32, NULL, 0x00000020,
24255       NULL, HFILL }},
24256
24257     {&hf_ieee80211_ff_brp_MID_REQ,
24258      {"BRP Request MID-REQ", "wlan.brp.mid_req",
24259       FT_BOOLEAN, 32, NULL, 0x00000040,
24260       NULL, HFILL }},
24261
24262     {&hf_ieee80211_ff_brp_BC_REQ,
24263      {"BRP Request BC-REQ", "wlan.brp.bc_req",
24264       FT_BOOLEAN, 32, NULL, 0x00000080,
24265       NULL, HFILL }},
24266
24267     {&hf_ieee80211_ff_brp_MID_GRANT,
24268      {"BRP Request MID-GRANT", "wlan.brp.mid_grant",
24269       FT_BOOLEAN, 32, NULL, 0x00000100,
24270       NULL, HFILL }},
24271
24272     {&hf_ieee80211_ff_brp_BC_GRANT,
24273      {"BRP Request BC-GRANT", "wlan.brp.bc_grant",
24274       FT_BOOLEAN, 32, NULL, 0x00000200,
24275       NULL, HFILL }},
24276
24277     {&hf_ieee80211_ff_brp_chan_FBCK_CAP,
24278      {"BRP Request Chan FBCK-CAP", "wlan.brp.chan_fbck_cap",
24279       FT_BOOLEAN, 32, NULL, 0x00000400,
24280       NULL, HFILL }},
24281
24282     {&hf_ieee80211_ff_brp_tx_sector,
24283      {"BRP Request TX Sector ID", "wlan.brp.tx_sector_id",
24284       FT_UINT32, BASE_DEC, NULL, 0x0001f800,
24285       NULL, HFILL }},
24286
24287     {&hf_ieee80211_ff_brp_other_aid,
24288      {"BRP Request Other AID", "wlan.brp.other_aid",
24289       FT_UINT32, BASE_DEC, NULL, 0x01fe0000,
24290       NULL, HFILL }},
24291
24292     {&hf_ieee80211_ff_brp_tx_antenna,
24293      {"BRP Request TX Antenna ID", "wlan.brp.tx_antenna_id",
24294       FT_UINT32, BASE_DEC, NULL, 0x06000000,
24295       NULL, HFILL }},
24296
24297     {&hf_ieee80211_ff_brp_reserved,
24298      {"BRP Request Reserved", "wlan.brp.reserved",
24299       FT_UINT32, BASE_HEX, NULL, 0xF8000000,
24300       NULL, HFILL }},
24301
24302     {&hf_ieee80211_ff_blm,
24303      {"Beamformed Link Maintenance", "wlan.blm",
24304       FT_UINT8, BASE_HEX, NULL, 0,
24305       NULL, HFILL }},
24306
24307     {&hf_ieee80211_ff_blm_unit_index,
24308      {"BeamLink Maintenance Uint Index", "wlan.blm.uint_index",
24309       FT_BOOLEAN, 8, NULL, 0x01,
24310       NULL, HFILL }},
24311
24312     {&hf_ieee80211_ff_blm_maint_value,
24313      {"BeamLink Maintenance Value", "wlan.blm.value",
24314       FT_UINT8, BASE_DEC, NULL, 0x7e,
24315       NULL, HFILL }},
24316
24317     {&hf_ieee80211_ff_blm_is_master,
24318      {"BeamLink Is Master", "wlan.blm.is_master",
24319       FT_BOOLEAN, 8, NULL, 0x80,
24320       NULL, HFILL }},
24321
24322     {&hf_ieee80211_ff_bic,
24323      {"Beacon Interval Control", "wlan.bic",
24324       FT_UINT48, BASE_HEX, NULL, 0,
24325       NULL, HFILL }},
24326
24327     {&hf_ieee80211_ff_bic_cc_present,
24328      {"Clustering Control Present", "wlan.bic.cc",
24329       FT_BOOLEAN, 48, NULL, 0x000000000001,
24330       NULL, HFILL }},
24331
24332     {&hf_ieee80211_ff_bic_discovery_mode,
24333      {"Discovery Mode", "wlan.bic.discovery_mode",
24334       FT_BOOLEAN, 48, NULL, 0x000000000002,
24335       NULL, HFILL }},
24336
24337     {&hf_ieee80211_ff_bic_next_beacon,
24338      {"Next Beacon", "wlan.bic.next_beacon",
24339       FT_UINT48, BASE_DEC, NULL, 0x00000000003c,
24340
24341       NULL, HFILL }},
24342
24343     {&hf_ieee80211_ff_bic_ati_present,
24344      {"ATI Present", "wlan.bic.ati",
24345       FT_BOOLEAN, 48, NULL, 0x000000000040,
24346       NULL, HFILL }},
24347
24348     {&hf_ieee80211_ff_bic_abft_len,
24349      {"A-BFT length", "wlan.bic.abft_len",
24350       FT_UINT48, BASE_DEC, NULL, 0x000000000380,
24351       NULL, HFILL }},
24352
24353     {&hf_ieee80211_ff_bic_fss,
24354      {"FSS", "wlan.bic.fss",
24355       FT_UINT48, BASE_DEC, NULL, 0x000000003c00,
24356       NULL, HFILL }},
24357
24358     {&hf_ieee80211_ff_bic_is_resp,
24359      {"Is TXSS Responder", "wlan.bic.is_responder",
24360       FT_BOOLEAN, 48, NULL, 0x000000004000,
24361       NULL, HFILL }},
24362
24363     {&hf_ieee80211_ff_bic_next_abft,
24364      {"Next A-BFT", "wlan.bic.next_abft",
24365       FT_UINT48, BASE_DEC, NULL, 0x000000078000,
24366       NULL, HFILL }},
24367
24368     {&hf_ieee80211_ff_bic_frag_txss,
24369      {"Fragmented TXSS", "wlan.bic.frag_txss",
24370       FT_BOOLEAN, 48, NULL, 0x000000080000,
24371       NULL, HFILL }},
24372
24373     {&hf_ieee80211_ff_bic_txss_span,
24374      {"TXSS span", "wlan.bic.txss_span",
24375       FT_UINT48, BASE_DEC, NULL, 0x000007f00000,
24376       NULL, HFILL }},
24377
24378     {&hf_ieee80211_ff_bic_NBI_abft,
24379      {"Number of Beacon Intervals that are needed to allocate A-BFT", "wlan.bic.NBI_abft",
24380       FT_UINT48, BASE_DEC, NULL, 0x00078000000,
24381       NULL, HFILL }},
24382
24383     {&hf_ieee80211_ff_bic_abft_count,
24384      {"A-BFT Count", "wlan.bic.abft_count",
24385       FT_UINT48, BASE_DEC, NULL, 0x001f80000000,
24386       NULL, HFILL }},
24387
24388     {&hf_ieee80211_ff_bic_nabft,
24389      {"Number of A-BFT's received from each Antenna", "wlan.bic.nabft",
24390       FT_UINT48, BASE_DEC, NULL, 0x07e000000000,
24391       NULL, HFILL }},
24392
24393     {&hf_ieee80211_ff_bic_pcp,
24394      {"PCP Association Ready", "wlan.bic.pcp",
24395       FT_BOOLEAN, 48, NULL, 0x080000000000,
24396       NULL, HFILL }},
24397
24398     {&hf_ieee80211_ff_bic_reserved,
24399      {"Reserved", "wlan.bic.reserved",
24400       FT_UINT48, BASE_HEX, NULL, 0xF00000000000,
24401       NULL, HFILL }},
24402
24403     {&hf_ieee80211_ff_dmg_params,
24404      {"DMG Parameters", "wlan.dmg_params",
24405       FT_UINT8, BASE_HEX , NULL, 0,
24406       NULL, HFILL }},
24407
24408     {&hf_ieee80211_ff_dmg_params_bss,
24409      {"BSS Type", "wlan.dmg_params.bss",
24410       FT_UINT8, BASE_DEC, VALS(bss_type), 0x03,
24411       NULL, HFILL }},
24412
24413     {&hf_ieee80211_ff_dmg_params_cbap_only,
24414      {"CBAP Only", "wlan.dmg_params.cbap_only",
24415       FT_BOOLEAN, 8, NULL, 0x04,
24416       NULL, HFILL }},
24417
24418     {&hf_ieee80211_ff_dmg_params_cbap_src,
24419      {"CBAP Source", "wlan.dmg_params.cbap_src",
24420       FT_BOOLEAN, 8, NULL, 0x08,
24421       NULL, HFILL }},
24422
24423     {&hf_ieee80211_ff_dmg_params_privacy,
24424      {"DMG Privacy", "wlan.dmg_params.privacy",
24425       FT_BOOLEAN, 8, NULL, 0x10,
24426       NULL, HFILL }},
24427
24428     {&hf_ieee80211_ff_dmg_params_policy,
24429      {"ECAPC Policy Enforced", "wlan.dmg_params.policy",
24430       FT_BOOLEAN, 8, NULL, 0x20,
24431       NULL, HFILL }},
24432
24433     {&hf_ieee80211_ff_cc,
24434      {"Clustering Control", "wlan.cc",
24435       FT_UINT64, BASE_HEX , NULL, 0,
24436       NULL, HFILL }},
24437
24438     {&hf_ieee80211_ff_cc_abft_resp_addr,
24439      {"A-BFT Responder Address", "wlan.cc.abft_resp_addr",
24440       FT_ETHER, BASE_NONE , NULL, 0,
24441       NULL, HFILL }},
24442
24443     {&hf_ieee80211_ff_cc_sp_duration,
24444      {"Beacon SP Duration", "wlan.cc.sp_duration",
24445       FT_UINT8, BASE_DEC , NULL, 0,
24446       NULL, HFILL }},
24447
24448     {&hf_ieee80211_ff_cc_cluster_id,
24449      {"Cluster ID", "wlan.cc.cluster_id",
24450       FT_UINT64, BASE_DEC , NULL, 0,
24451       NULL, HFILL }},
24452
24453     {&hf_ieee80211_ff_cc_role,
24454      {"Cluster Member Role", "wlan.cc.rold",
24455       FT_UINT8, BASE_DEC , NULL, 0,
24456       NULL, HFILL }},
24457
24458     {&hf_ieee80211_ff_cc_max_mem,
24459      {"Cluster MaxMem", "wlan.cc.max_mem",
24460       FT_UINT8, BASE_DEC , NULL, 0,
24461       NULL, HFILL }},
24462
24463     {&hf_ieee80211_tag_relay_support,
24464      {"Relay Supportability", "wlan.relay_capabilities.relay_support",
24465       FT_BOOLEAN, 8, NULL, 0x01,
24466       NULL, HFILL }},
24467
24468     {&hf_ieee80211_tag_relay_use,
24469      {"Relay Usability", "wlan.relay_capabilities.relay_use",
24470       FT_BOOLEAN, 8, NULL, 0x02,
24471       NULL, HFILL }},
24472
24473     {&hf_ieee80211_tag_relay_permission,
24474      {"Relay Permission", "wlan.relay_capabilities.relay_permission",
24475       FT_BOOLEAN, 8, NULL, 0x04,
24476       NULL, HFILL }},
24477
24478     {&hf_ieee80211_tag_AC_power,
24479      {"A/C Power", "wlan.relay_capabilities.AC_power",
24480       FT_BOOLEAN, 8, NULL, 0x08,
24481       NULL, HFILL }},
24482
24483     {&hf_ieee80211_tag_relay_prefer,
24484      {"Relay Preference", "wlan.relay_capabilities.relay_prefer",
24485       FT_BOOLEAN, 8, NULL, 0x10,
24486       NULL, HFILL }},
24487
24488     {&hf_ieee80211_tag_duplex,
24489      {"Duplex", "wlan.relay_capabilities.duplex",
24490       FT_UINT8, BASE_DEC, NULL, 0x60,
24491       NULL, HFILL }},
24492
24493     {&hf_ieee80211_tag_cooperation,
24494      {"Cooperation", "wlan.relay_capabilities.cooperation",
24495       FT_BOOLEAN, 8, NULL, 0x80,
24496       NULL, HFILL }},
24497
24498 #if 0
24499     {&hf_ieee80211_ff_rcsi,
24500      {"Relay Capable STA Info", "wlan.rcsi",
24501       FT_UINT24, BASE_HEX, NULL, 0,
24502       NULL, HFILL }},
24503
24504     {&hf_ieee80211_ff_rcsi_aid,
24505      {"AID", "wlan.rcsi.aid",
24506       FT_UINT8, BASE_DEC, NULL, 0xff,
24507       NULL, HFILL }},
24508 #endif
24509
24510     {&hf_ieee80211_ff_band_id,
24511      {"Band ID", "wlan.band_id",
24512       FT_UINT8, BASE_DEC, VALS(band_id), 0xff,
24513       NULL, HFILL }},
24514
24515     {&hf_ieee80211_tag_move,
24516      {"Move", "wlan.dmg_bss_param_change.move",
24517       FT_BOOLEAN, 8, NULL, 0x01,
24518       NULL, HFILL }},
24519
24520     {&hf_ieee80211_tag_size,
24521      {"Size", "wlan.dmg_bss_param_change.size",
24522       FT_BOOLEAN, 8, NULL, 0x02,
24523       NULL, HFILL }},
24524
24525     {&hf_ieee80211_tag_tbtt_offset,
24526      {"TBTT Offset", "wlan.dmg_bss_param_change.tbtt_offset",
24527       FT_UINT32, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xffffffff,
24528       NULL, HFILL }},
24529
24530     {&hf_ieee80211_tag_bi_duration,
24531      {"BI Duration", "wlan.dmg_bss_param_change.bi_duration",
24532       FT_UINT16, BASE_DEC, NULL, 0xffff,
24533       NULL, HFILL }},
24534
24535     {&hf_ieee80211_tag_dmg_capa_sta_addr,
24536      {"STA Address", "wlan.dmg_capa.sta_addr",
24537       FT_ETHER, BASE_NONE, NULL, 0,
24538       "STA_Address", HFILL }},
24539
24540     {&hf_ieee80211_tag_dmg_capa_aid,
24541      {"AID", "wlan.dmg_capa.aid",
24542       FT_UINT16, BASE_DEC, NULL, 0,
24543       NULL, HFILL }},
24544 /* 8.4.2.127.2 DMG STA Capability Information field */
24545     {&hf_ieee80211_tag_reverse_direction, /* DMG STA capa, bits [0] */
24546      {"Reverse Direction", "wlan.dmg_capa.reverse_direction",
24547       FT_BOOLEAN, 24, NULL, GENMASK(0, 0),
24548       NULL, HFILL }},
24549
24550     {&hf_ieee80211_tag_hlts, /* DMG STA capa, bits [1] */
24551      {"Higher Layer Timer Synchronization", "wlan.dmg_capa.htls",
24552       FT_BOOLEAN, 24, NULL, GENMASK(1, 1),
24553       NULL, HFILL }},
24554
24555     {&hf_ieee80211_tag_tpc, /* DMG STA capa, bits [2] */
24556      {"TPC", "wlan.dmg_capa.tpc",
24557       FT_BOOLEAN, 24, NULL, GENMASK(2, 2),
24558       NULL, HFILL }},
24559
24560     {&hf_ieee80211_tag_spsh, /* DMG STA capa, bits [3] */
24561      {"SPSH and Interference Mitigation", "wlan.dmg_capa.spsh",
24562       FT_BOOLEAN, 24, NULL, GENMASK(3, 3),
24563       NULL, HFILL }},
24564
24565     {&hf_ieee80211_tag_rx_antenna, /* DMG STA capa, bits [4..5] */
24566      {"Number of RX DMG Antennas", "wlan.dmg_capa.num_rx",
24567       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(5, 4),
24568       NULL, HFILL }},
24569
24570     {&hf_ieee80211_tag_fast_link, /* DMG STA capa, bits [6] */
24571      {"Fast Link Adaptation", "wlan.dmg_capa.fast_link",
24572       FT_BOOLEAN, 24, NULL, GENMASK(6, 6),
24573       NULL, HFILL }},
24574
24575     {&hf_ieee80211_tag_num_sectors, /* DMG STA capa, bits [7..13] */
24576      {"Total Number of Sectors", "wlan.dmg_capa.num_sectors",
24577       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(13, 7),
24578       NULL, HFILL }},
24579
24580     {&hf_ieee80211_tag_rxss_length, /* DMG STA capa, bits [14..19] */
24581      {"RXSS Length", "wlan.dmg_capa.rxss_len",
24582       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_mul_two_base_custom), GENMASK(19, 14),
24583       NULL, HFILL }},
24584
24585     {&hf_ieee80211_tag_reciprocity, /* DMG STA capa, bits [20] */
24586      {"DMG Antenna Reciprocity", "wlan.dmg_capa.reciprocity",
24587       FT_BOOLEAN, 24, NULL, GENMASK(20, 20),
24588       NULL, HFILL }},
24589 /* DMG STA capa, A-MPDU params, bits [21..26] */
24590     {&hf_ieee80211_tag_max_ampdu_exp, /* DMG STA capa, bits [21..23] */
24591      {"Maximum A-MPDU Length Exponent", "wlan.dmg_capa.max_ampdu_exp",
24592       FT_UINT24, BASE_DEC, NULL, GENMASK(23, 21),
24593       NULL, HFILL }},
24594
24595     {&hf_ieee80211_tag_min_mpdu_spacing, /* DMG STA capa, bits [24..26] */
24596      {"Minimum MPDU Start Spacing", "wlan.dmg_capa.min_mpdu_spacing",
24597       FT_UINT24, BASE_DEC, NULL, GENMASK(26-24, 24-24),
24598       NULL, HFILL }},
24599
24600     {&hf_ieee80211_tag_ba_flow_control , /* DMG STA capa, bits [27] */
24601      {"BA with Flow Control", "wlan.dmg_capa.bs_flow_ctrl",
24602       FT_BOOLEAN, 24, NULL, GENMASK(27-24, 27-24),
24603       NULL, HFILL }},
24604 /* DMG STA capa, supported MCS set, bits [28..51] */
24605     {&hf_ieee80211_tag_max_sc_rx_mcs, /* DMG STA capa, bits [28..32] */
24606      {"Maximum SC Rx MCS", "wlan.dmg_capa.max_sc_rx_mcs",
24607       FT_UINT24, BASE_DEC, NULL, GENMASK(32-24, 28-24),
24608       NULL, HFILL }},
24609
24610     {&hf_ieee80211_tag_max_ofdm_rx_mcs, /* DMG STA capa, bits [33..37] */
24611      {"Maximum OFDM Rx MCS", "wlan.dmg_capa.max_ofdm_rx_mcs",
24612       FT_UINT24, BASE_DEC, NULL, GENMASK(37-24, 33-24),
24613       NULL, HFILL }},
24614
24615     {&hf_ieee80211_tag_max_sc_tx_mcs, /* DMG STA capa, bits [38..42] */
24616      {"Maximum SC Tx MCS", "wlan.dmg_capa.max_sc_tx_mcs",
24617       FT_UINT24, BASE_DEC, NULL, GENMASK(42-24, 38-24),
24618       NULL, HFILL }},
24619
24620     {&hf_ieee80211_tag_max_ofdm_tx_mcs, /* DMG STA capa, bits [43..47] */
24621      {"Maximum OFDM Tx MCS", "wlan.dmg_capa.max_ofdm_tx_mcs",
24622       FT_UINT24, BASE_DEC, NULL, GENMASK(47-24, 43-24),
24623       NULL, HFILL }},
24624
24625     {&hf_ieee80211_tag_low_power_supported, /* DMG STA capa, bits [48] */
24626      {"Low Power SC PHY Supported", "wlan.dmg_capa.low_power_suuported",
24627       FT_BOOLEAN, 16, NULL, GENMASK(48-48, 48-48),
24628       NULL, HFILL }},
24629
24630     {&hf_ieee80211_tag_code_rate, /* DMG STA capa, bits [49] */
24631      {"Code Rate 13/16", "wlan.dmg_capa.code_rate",
24632       FT_BOOLEAN, 16, NULL, GENMASK(49-48, 49-48),
24633       NULL, HFILL }},
24634
24635     {&hf_ieee80211_tag_dtp, /* DMG STA capa, bits [52] */
24636      {"DTP Supported", "wlan.dmg_capa.dtp",
24637       FT_BOOLEAN, 16, NULL, GENMASK(52-48, 52-48),
24638       NULL, HFILL }},
24639
24640     {&hf_ieee80211_tag_appdu_supp, /* DMG STA capa, bits [53] */
24641      {"A-PPDU Supported", "wlan.dmg_capa.appdu_supp",
24642       FT_BOOLEAN, 16, NULL, GENMASK(53-48, 53-48),
24643       NULL, HFILL }},
24644
24645     {&hf_ieee80211_tag_heartbeat, /* DMG STA capa, bits [54] */
24646      {"HeartBeat", "wlan.dmg_capa.heartbeat",
24647       FT_BOOLEAN, 16, NULL, GENMASK(54-48, 54-48),
24648       NULL, HFILL }},
24649
24650     {&hf_ieee80211_tag_other_aid, /* DMG STA capa, bits [55] */
24651      {"Supports Other_AID", "wlan.dmg_capa.other_aid",
24652       FT_BOOLEAN, 16, NULL, GENMASK(55-48, 55-48),
24653       NULL, HFILL }},
24654
24655     {&hf_ieee80211_tag_pattern_recip, /* DMG STA capa, bits [56] */
24656      {"Antenna Pattern Reciprocity", "wlan.dmg_capa.pattern_recip",
24657       FT_BOOLEAN, 16, NULL, GENMASK(56-48, 56-48),
24658       NULL, HFILL }},
24659
24660     {&hf_ieee80211_tag_heartbeat_elapsed, /* DMG STA capa, bits [57..59] */
24661      {"Heartbeat Elapsed Indication", "wlan.dmg_capa.heartbeat_elapsed",
24662       FT_UINT16, BASE_DEC, NULL, GENMASK(59-48, 57-48),
24663       NULL, HFILL }},
24664
24665     {&hf_ieee80211_tag_grant_ack_supp, /* DMG STA capa, bits [60] */
24666      {"Grant ACK Supported", "wlan.dmg_capa.grant_ack_supp",
24667       FT_BOOLEAN, 16, NULL, GENMASK(60-48, 60-48),
24668       NULL, HFILL }},
24669
24670     {&hf_ieee80211_tag_RXSSTxRate_supp, /* DMG STA capa, bits [61] */
24671      {"RXSSTxRate Supported", "wlan.dmg_capa.RXSSTxRate",
24672       FT_BOOLEAN, 16, NULL, GENMASK(61-48, 61-48),
24673       NULL, HFILL }},
24674 /* 8.4.2.127.3 DMG PCP/AP Capability Information field */
24675     {&hf_ieee80211_tag_pcp_tddti, /* DMG PCP/AP capa, bits [0] */
24676      {"TDDTI", "wlan.dmg_capa.pcp_tdtti",
24677       FT_BOOLEAN, 16, NULL, GENMASK(0, 0),
24678       NULL, HFILL }},
24679
24680     {&hf_ieee80211_tag_pcp_PSA, /* DMG PCP/AP capa, bits [1] */
24681      {"Pseudo-static Allocations", "wlan.dmg_capa.pcp_psa",
24682       FT_BOOLEAN, 16, NULL, GENMASK(1, 1),
24683       NULL, HFILL }},
24684
24685     {&hf_ieee80211_tag_pcp_handover, /* DMG PCP/AP capa, bits [2] */
24686      {"PDP Handover", "wlan.dmg_capa.pcp_handover",
24687       FT_BOOLEAN, 16, NULL, GENMASK(2, 2),
24688       NULL, HFILL }},
24689
24690     {&hf_ieee80211_tag_pcp_max_assoc, /* DMG PCP/AP capa, bits [3..10] */
24691      {"Max Associated STA Number", "wlan.dmg_capa.pcp_max_assoc",
24692       FT_UINT16, BASE_DEC, NULL, GENMASK(10, 3),
24693       NULL, HFILL }},
24694
24695     {&hf_ieee80211_tag_pcp_power_src, /* DMG PCP/AP capa, bits [11] */
24696      {"Power Source", "wlan.dmg_capa.pcp_power_src",
24697       FT_BOOLEAN, 16, NULL, GENMASK(11, 11),
24698       NULL, HFILL }},
24699
24700     {&hf_ieee80211_tag_pcp_decenter, /* DMG PCP/AP capa, bits [12] */
24701      {"Decentralized PCP/AP Clustering", "wlan.dmg_capa.pcp_decenter",
24702       FT_BOOLEAN, 16, NULL, GENMASK(12, 12),
24703       NULL, HFILL }},
24704
24705     {&hf_ieee80211_tag_pcp_forwarding, /* DMG PCP/AP capa, bits [13] */
24706      {"PCP Forwarding", "wlan.dmg_capa.pcp_forwarding",
24707       FT_BOOLEAN, 16, NULL, GENMASK(13, 13),
24708       NULL, HFILL }},
24709
24710     {&hf_ieee80211_tag_pcp_center, /* DMG PCP/AP capa, bits [14] */
24711      {"Centralized PCP/AP Clustering", "wlan.dmg_capa.pcp_center",
24712       FT_BOOLEAN, 16, NULL, GENMASK(14, 14),
24713       NULL, HFILL }},
24714
24715     {&hf_ieee80211_tag_sta_beam_track, /* DMG STA beam track capa*/
24716      {"STA Beam Tracking Time Limit", "wlan.dmg_capa.beam_track",
24717       FT_UINT16, BASE_DEC | BASE_UNIT_STRING, &units_microseconds, 0,
24718       NULL, HFILL }},
24719
24720     {&hf_ieee80211_tag_ext_sc_mcs_max_tx, /* DMG STA Ext SC MCS Capa: Max TX*/
24721      {"Extended SC Max Tx MCS Name", "wlan.dmg_capa.ext_sc_mcs_capa_max_tx",
24722       FT_UINT8, BASE_DEC, VALS(extended_sc_mcs), GENMASK(2, 0),
24723       NULL, HFILL }},
24724
24725     {&hf_ieee80211_tag_ext_sc_mcs_tx_code_7_8, /* DMG STA Ext SC MCS Capa: Tx code rate 7/8*/
24726      {"Extended SC Tx MCS code rate 7/8 supported", "wlan.dmg_capa.ext_sc_mcs_tx_code_7_8",
24727       FT_BOOLEAN, 8, NULL, GENMASK(3, 3),
24728       NULL, HFILL }},
24729
24730     {&hf_ieee80211_tag_ext_sc_mcs_max_rx, /* DMG STA Ext SC MCS Capa: Max RX*/
24731      {"Extended SC Max Rx MCS Name", "wlan.dmg_capa.ext_sc_mcs_capa_max_rx",
24732       FT_UINT8, BASE_DEC, VALS(extended_sc_mcs), GENMASK(6, 4),
24733       NULL, HFILL }},
24734
24735     {&hf_ieee80211_tag_ext_sc_mcs_rx_code_7_8, /* DMG STA Ext SC MCS Capa: Rx code rate 7/8*/
24736      {"Extended SC Rx MCS code rate 7/8 suported", "wlan.dmg_capa.ext_sc_mcs_rx_code_7_8",
24737       FT_BOOLEAN, 8, NULL, GENMASK(7, 7),
24738       NULL, HFILL }},
24739
24740     {&hf_ieee80211_tag_max_basic_sf_amsdu, /* DMG Max Number of Basic Subframes in an A-MSDU*/
24741      {"Max Number of Basic Subframes in an A-MSDU", "wlan.dmg_capa.max_basic_sf_amsdu",
24742       FT_UINT8, BASE_RANGE_STRING | BASE_DEC, RVALS(max_basic_sf_amsdu), 0,
24743       NULL, HFILL }},
24744
24745     {&hf_ieee80211_tag_max_short_sf_amsdu, /* DMG Max Number of short Subframes in an A-MSDU*/
24746      {"Max Number of short Subframes in an A-MSDU", "wlan.dmg_capa.max_short_sf_amsdu",
24747       FT_UINT8, BASE_RANGE_STRING | BASE_DEC, RVALS(max_short_sf_amsdu), 0,
24748       NULL, HFILL }},
24749
24750     {&hf_ieee80211_tag_PSRSI,
24751      {"PS Request Suspension Interval", "wlan.dmg_oper.psrsi",
24752       FT_UINT8, BASE_DEC, NULL, 0,
24753       NULL, HFILL }},
24754
24755     {&hf_ieee80211_tag_min_BHI_duration,
24756      {"Min BHI Duration", "wlan.dmg_oper.min_BHI_duration",
24757       FT_UINT16, BASE_DEC, NULL, 0,
24758       NULL, HFILL }},
24759
24760     {&hf_ieee80211_tag_brdct_sta_info_dur,
24761      {"Broadcast STA Info Duration", "wlan.dmg_oper.brdcst_sta_info_dur",
24762       FT_UINT8, BASE_DEC, NULL, 0,
24763       NULL, HFILL }},
24764
24765     {&hf_ieee80211_tag_assoc_resp_confirm_time,
24766      {"Associated Response Confirm Time", "wlan.dmg_oper.assoc_resp_confirm_time",
24767       FT_UINT8, BASE_DEC, NULL, 0,
24768       NULL, HFILL }},
24769
24770     {&hf_ieee80211_tag_min_pp_duration,
24771      {"Min PP Duration", "wlan.dmg_oper.min_pp_duration",
24772       FT_UINT8, BASE_DEC, NULL, 0,
24773       NULL, HFILL }},
24774
24775     {&hf_ieee80211_tag_SP_idle_timeout,
24776      {"SP Idle Timeout", "wlan.dmg_oper.SP_idle_timeout",
24777       FT_UINT8, BASE_DEC, NULL, 0,
24778       NULL, HFILL }},
24779
24780     {&hf_ieee80211_tag_max_lost_beacons,
24781      {"Max Lost Beacons", "wlan.dmg_oper.max_lost_beacons",
24782       FT_UINT8, BASE_DEC, NULL, 0,
24783       NULL, HFILL }},
24784
24785     {&hf_ieee80211_tag_type,
24786      {"Type", "wlan.sctor_id.type",
24787       FT_UINT32, BASE_HEX, NULL, 0x0000000f,
24788       NULL, HFILL }},
24789
24790     {&hf_ieee80211_tag_tap1,
24791      {"Tap 1", "wlan.sctor_id.tap1",
24792       FT_UINT32, BASE_HEX, NULL, 0x000003f0,
24793       NULL, HFILL }},
24794
24795     {&hf_ieee80211_tag_state1,
24796      {"State 1", "wlan.sctor_id.state1",
24797       FT_UINT32, BASE_HEX, NULL, 0x0000fc00,
24798       NULL, HFILL }},
24799
24800     {&hf_ieee80211_tag_tap2,
24801      {"Tap 2", "wlan.sctor_id.tap2",
24802       FT_UINT32, BASE_HEX, NULL, 0x00ff0000,
24803       NULL, HFILL }},
24804
24805     {&hf_ieee80211_tag_state2,
24806      {"State 2", "wlan.sctor_id.state2",
24807       FT_UINT32, BASE_HEX, NULL, 0xff000000,
24808       NULL, HFILL }},
24809
24810     {&hf_ieee80211_tag_allocation_id,
24811      {"Allocation ID", "wlan.ext_sched.alloc_id",
24812       FT_UINT16, BASE_DEC, NULL, 0x000f,
24813       NULL, HFILL }},
24814
24815     {&hf_ieee80211_tag_allocation_type,
24816      {"Allocation Type", "wlan.ext_sched.alloc_type",
24817       FT_UINT16, BASE_DEC, VALS(allocation_type), 0x0070,
24818       NULL, HFILL }},
24819
24820     {&hf_ieee80211_tag_pseudo_static,
24821      {"Pseudo-static", "wlan.ext_sched.p_static",
24822       FT_BOOLEAN, 16, NULL, 0x0080,
24823       NULL, HFILL }},
24824
24825     {&hf_ieee80211_tag_truncatable,
24826      {"Truncatable", "wlan.ext_sched.truncatable",
24827       FT_BOOLEAN, 16, NULL, 0x0100,
24828       NULL, HFILL }},
24829
24830     {&hf_ieee80211_tag_extendable,
24831      {"Extenedable", "wlan.ext_sched.extendable",
24832       FT_BOOLEAN, 16, NULL, 0x0200,
24833       NULL, HFILL }},
24834
24835     {&hf_ieee80211_tag_pcp_active,
24836      {"PCP Active", "wlan.ext_sched.pcp_active",
24837       FT_BOOLEAN, 16, NULL, 0x0400,
24838       NULL, HFILL }},
24839
24840     {&hf_ieee80211_tag_lp_sc_used,
24841      {"LP SC Used", "wlan.ext_sched.lp_sc_used",
24842       FT_BOOLEAN, 16, NULL, 0x0800,
24843       NULL, HFILL }},
24844
24845     {&hf_ieee80211_tag_src_aid,
24846      {"Source AID", "wlan.ext_sched.src_id",
24847       FT_UINT8, BASE_DEC, NULL, 0xff,
24848       NULL, HFILL }},
24849
24850     {&hf_ieee80211_tag_dest_aid,
24851      {"Destination AID", "wlan.ext_sched.dest_id",
24852       FT_UINT8, BASE_DEC, NULL, 0xff,
24853       NULL, HFILL }},
24854
24855     {&hf_ieee80211_tag_alloc_start,
24856      {"Allocation Start", "wlan.ext_sched.alloc_start",
24857       FT_UINT32, BASE_DEC, NULL, 0,
24858       NULL, HFILL }},
24859
24860     {&hf_ieee80211_tag_alloc_block_duration,
24861      {"Allocation Block Duration", "wlan.ext_sched.block_duration",
24862       FT_UINT16, BASE_DEC, NULL, 0xffff,
24863       NULL, HFILL }},
24864
24865     {&hf_ieee80211_tag_num_blocks,
24866      {"Number of Blocks", "wlan.ext_sched.num_blocks",
24867       FT_UINT8, BASE_DEC, NULL, 0xff,
24868       NULL, HFILL }},
24869
24870     {&hf_ieee80211_tag_alloc_block_period,
24871      {"Allocation Block Period", "wlan.ext_sched.alloc_block_period",
24872       FT_UINT16, BASE_DEC, NULL, 0xffff,
24873       NULL, HFILL }},
24874
24875     {&hf_ieee80211_tag_aid,
24876      {"AID", "wlan.sta_avail.aid",
24877       FT_UINT16, BASE_DEC, NULL, 0x00ff,
24878       NULL, HFILL }},
24879
24880     {&hf_ieee80211_tag_cbap,
24881      {"CBAP", "wlan.sta_avail.cbap",
24882       FT_BOOLEAN, 16, NULL, 0x0100,
24883       NULL, HFILL }},
24884
24885     {&hf_ieee80211_tag_pp_avail,
24886      {"PP Available", "wlan.sta_avail.pp_avail",
24887       FT_BOOLEAN, 16, NULL, 0x0200,
24888       NULL, HFILL }},
24889
24890     {&hf_ieee80211_tag_next_ati_start_time,
24891      {"Start Time", "wlan.next_ati.start_time",
24892       FT_UINT32, BASE_DEC, NULL, 0,
24893       NULL, HFILL }},
24894
24895     {&hf_ieee80211_tag_next_ati_duration,
24896      {"ATI Duration", "wlan.next_ati.duration",
24897       FT_UINT16, BASE_DEC, NULL, 0xffff,
24898       NULL, HFILL }},
24899
24900     {&hf_ieee80211_tag_old_bssid,
24901      {"Old BSSID", "wlan.pcp_handover.old_bssid",
24902       FT_ETHER, BASE_NONE, NULL, 0,
24903       "OLD_BSSID", HFILL }},
24904
24905     {&hf_ieee80211_tag_new_pcp_addr,
24906      {"New PCP Address", "wlan.pcp_handover.new_pcp_addr",
24907       FT_ETHER, BASE_NONE, NULL, 0,
24908       "New_PCP_Address", HFILL }},
24909
24910     {&hf_ieee80211_tag_bssid,
24911      {"BSSID", "wlan.quiet_res.bssid",
24912       FT_ETHER, BASE_NONE, NULL, 0,
24913       "BSS-ID", HFILL }},
24914
24915     {&hf_ieee80211_tag_duplex_relay,
24916      {"Duplex", "wlan.relay_capabilities.duplex",
24917       FT_UINT8, BASE_DEC, NULL, 0x01,
24918       NULL, HFILL }},
24919
24920     {&hf_ieee80211_tag_cooperation_relay,
24921      {"Cooperation", "wlan.relay_capabilities.cooperation",
24922       FT_BOOLEAN, 8, NULL, 0x02,
24923       NULL, HFILL }},
24924
24925     {&hf_ieee80211_tag_tx_mode,
24926      {"TX-Mode", "wlan.realy_trans_param.tx_mode",
24927       FT_BOOLEAN, 8, NULL, 0x04,
24928       NULL, HFILL }},
24929
24930     {&hf_ieee80211_tag_link_change_interval,
24931      {"Link Change Interval", "wlan.realy_trans_param.link_change_interval",
24932       FT_UINT8, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xff,
24933       NULL, HFILL }},
24934
24935     {&hf_ieee80211_tag_data_sensing_time,
24936      {"Data Sensing Time", "wlan.realy_trans_param.data_sensing_time",
24937       FT_UINT8, BASE_DEC, NULL, 0xff,
24938       NULL, HFILL }},
24939
24940     {&hf_ieee80211_tag_first_period,
24941      {"First Period", "wlan.realy_trans_param.first_period",
24942       FT_UINT16, BASE_DEC, NULL, 0xffff,
24943       NULL, HFILL }},
24944
24945     {&hf_ieee80211_tag_second_period,
24946      {"Second Period", "wlan.realy_trans_param.second_period",
24947       FT_UINT16, BASE_DEC, NULL, 0xffff,
24948       NULL, HFILL }},
24949
24950     {&hf_ieee80211_tag_initiator,
24951      {"Initiator", "wlan.beam_refine.initiator",
24952       FT_BOOLEAN, 40, NULL, 0x0000000001,
24953       NULL, HFILL }},
24954
24955     {&hf_ieee80211_tag_tx_train_res,
24956      {"TX-train-response", "wlan.beam_refine.tx_train_res",
24957       FT_BOOLEAN, 40, NULL, 0x0000000002,
24958       NULL, HFILL }},
24959
24960     {&hf_ieee80211_tag_rx_train_res,
24961      {"RX-train-response", "wlan.beam_refine.rx_train_res",
24962       FT_BOOLEAN, 40, NULL, 0x0000000004,
24963       NULL, HFILL }},
24964
24965     {&hf_ieee80211_tag_tx_trn_ok,
24966      {"TX-TRN-OK", "wlan.beam_refine.tx_trn_ok",
24967       FT_BOOLEAN, 40, NULL, 0x0000000008,
24968       NULL, HFILL }},
24969
24970     {&hf_ieee80211_tag_txss_fbck_req,
24971      {"TXSS-FBCK-REQ", "wlan.beam_refine.txss_fbck_req",
24972       FT_BOOLEAN, 40, NULL, 0x0000000010,
24973       NULL, HFILL }},
24974
24975     {&hf_ieee80211_tag_bs_fbck,
24976      {"BS-FBCK", "wlan.beam_refine.bs_fbck",
24977       FT_UINT40, BASE_DEC, NULL, 0x00000007e0,
24978       NULL, HFILL }},
24979
24980     {&hf_ieee80211_tag_bs_fbck_antenna_id,
24981      {"BS-FBCK Anetenna ID", "wlan.beam_refine.bs_fbck_antenna_id",
24982       FT_UINT40, BASE_DEC, NULL, 0x0000001800,
24983       NULL, HFILL }},
24984
24985     {&hf_ieee80211_tag_snr_requested,
24986      {"SNR Requested", "wlan.beam_refine.snr_req",
24987       FT_BOOLEAN, 40, NULL, 0x0000002000,
24988       NULL, HFILL }},
24989
24990     {&hf_ieee80211_tag_channel_measurement_requested,
24991      {"Channel Measurement Requested", "wlan.beam_refine.ch_measure_req",
24992       FT_BOOLEAN, 40, NULL, 0x0000004000,
24993       NULL, HFILL }},
24994
24995     {&hf_ieee80211_tag_number_of_taps_requested,
24996      {"Number of Taps Requested", "wlan.beam_refine.taps_req",
24997       FT_UINT40, BASE_DEC | BASE_VAL64_STRING, VALS64(number_of_taps_values), 0x0000018000,
24998       NULL, HFILL }},
24999
25000     {&hf_ieee80211_tag_sector_id_order_req,
25001      {"Sector ID Order Requested", "wlan.beam_refine.sector_id_req",
25002       FT_BOOLEAN, 40, NULL, 0x0000020000,
25003       NULL, HFILL }},
25004
25005     {&hf_ieee80211_tag_snr_present,
25006      {"SNR Present", "wlan.beam_refine.snr_present",
25007       FT_BOOLEAN, 40, NULL, 0x0000040000,
25008       NULL, HFILL }},
25009
25010     {&hf_ieee80211_tag_channel_measurement_present,
25011      {"Channel Measurement Present", "wlan.beam_refine.ch_measure_present",
25012       FT_BOOLEAN, 40, NULL, 0x0000080000,
25013       NULL, HFILL }},
25014
25015     {&hf_ieee80211_tag_tap_delay_present,
25016      {"Tap Delay Present", "wlan.beam_refine.tap_delay_present",
25017       FT_BOOLEAN, 40, NULL, 0x0000100000,
25018       NULL, HFILL }},
25019
25020     {&hf_ieee80211_tag_number_of_taps_present,
25021      {"Number of Taps Present", "wlan.beam_refine.taps_present",
25022       FT_UINT40, BASE_DEC | BASE_VAL64_STRING, VALS64(number_of_taps_values), 0x0000600000,
25023       NULL, HFILL }},
25024
25025     {&hf_ieee80211_tag_number_of_measurement,
25026      {"Number of Measurements", "wlan.beam_refine.num_measurement",
25027       FT_UINT40, BASE_DEC, NULL, 0x003f800000,
25028       NULL, HFILL }},
25029
25030     {&hf_ieee80211_tag_sector_id_order_present,
25031      {"Sector ID Order Present", "wlan.beam_refine.sector_id_present",
25032       FT_BOOLEAN, 40, NULL, 0x0040000000,
25033       NULL, HFILL }},
25034
25035     {&hf_ieee80211_tag_number_of_beams,
25036      {"Number of Beams", "wlan.beam_refine.num_beams",
25037       FT_UINT40, BASE_DEC, NULL, 0x0f80000000,
25038       NULL, HFILL }},
25039
25040     {&hf_ieee80211_tag_mid_extension,
25041      {"MID Extension", "wlan.beam_refine.mid_ext",
25042       FT_BOOLEAN, 40, NULL, 0x1000000000,
25043       NULL, HFILL }},
25044
25045     {&hf_ieee80211_tag_capability_request,
25046      {"Capability Request", "wlan.beam_refine.cap_req",
25047       FT_BOOLEAN, 40, NULL, 0x2000000000,
25048       NULL, HFILL }},
25049
25050     {&hf_ieee80211_tag_beam_refine_reserved,
25051      {"Reserved", "wlan.beam_refine.reserved",
25052       FT_UINT40, BASE_DEC, NULL, 0xc000000000,
25053       NULL, HFILL }},
25054
25055     {&hf_ieee80211_tag_nextpcp_list,
25056       {"AID of NextPCP", "wlan.next_pcp.list",
25057        FT_UINT8, BASE_DEC, NULL, 0,
25058        NULL, HFILL }},
25059
25060     {&hf_ieee80211_tag_nextpcp_token,
25061       {"NextPCP List Token", "wlan.next_pcp.token",
25062        FT_UINT8, BASE_DEC, NULL, 0,
25063        NULL, HFILL }},
25064
25065     {&hf_ieee80211_tag_reamaining_BI,
25066       {"Remaining BI's", "wlan.pcp_handover.remaining_BIs",
25067        FT_UINT8, BASE_DEC, NULL, 0,
25068        NULL, HFILL }},
25069
25070     {&hf_ieee80211_tag_request_token,
25071       {"Request Token", "wlan.request_token",
25072        FT_UINT16, BASE_DEC, NULL, 0,
25073        NULL, HFILL }},
25074
25075     {&hf_ieee80211_tag_bi_start_time,
25076       {"BI Start Time", "wlan.bi_start_time",
25077        FT_UINT32, BASE_DEC, NULL, 0,
25078        NULL, HFILL }},
25079
25080     {&hf_ieee80211_tag_sleep_cycle,
25081       {"Sleep Cycle", "wlan.sleep_cycle",
25082        FT_UINT16, BASE_DEC, NULL, 0,
25083        NULL, HFILL }},
25084
25085     {&hf_ieee80211_tag_num_awake_bis,
25086       {"Number of Awake/Doze BIs", "wlan.num_awake_bis",
25087        FT_UINT16, BASE_DEC, NULL, 0,
25088        NULL, HFILL }},
25089
25090     {&hf_ieee80211_ff_dmg_action_code,
25091      {"DMG Action", "wlan.fixed.dmg_act",
25092       FT_UINT8, BASE_HEX, VALS(ff_dmg_action_flags), 0,
25093       "Action Code", HFILL }},
25094
25095     {&hf_ieee80211_ff_unprotected_dmg_action_code,
25096      {"Unprotected DMG Action", "wlan.fixed.unprotected_dmg_act",
25097       FT_UINT8, BASE_HEX, VALS(ff_unprotected_dmg_action_flags), 0,
25098       "Action Code", HFILL }},
25099
25100     {&hf_ieee80211_ff_dmg_pwr_mgmt,
25101       {"DMG Power Management", "wlan.dmg.pwr_mgmt",
25102        FT_BOOLEAN, 8, NULL, 0x01,
25103        NULL, HFILL }},
25104
25105     {&hf_ieee80211_ff_subject_address,
25106       {"Subject Address", "wlan.dmg.subject_addr",
25107        FT_ETHER, BASE_NONE, NULL, 0,
25108        "MAC address of requested STA", HFILL }},
25109
25110     {&hf_ieee80211_ff_handover_reason,
25111       {"Handover Reason", "wlan.dmg.handover_reason",
25112        FT_UINT8, BASE_DEC, NULL, 0x03,
25113        NULL, HFILL }},
25114
25115     {&hf_ieee80211_ff_handover_remaining_bi,
25116       {"Handover Remaining BI", "wlan.dmg.handover_remaining_bi",
25117        FT_UINT8, BASE_DEC, NULL, 0x01,
25118        NULL, HFILL }},
25119
25120     {&hf_ieee80211_ff_handover_result,
25121       {"Handover Result", "wlan.dmg.handover_result",
25122        FT_UINT8, BASE_DEC, NULL, 0x01,
25123        NULL, HFILL }},
25124
25125     {&hf_ieee80211_ff_handover_reject_reason,
25126       {"Handover Reject Reason", "wlan.dmg.handover_reject_reason",
25127        FT_UINT8, BASE_DEC, NULL, 0x03,
25128        NULL, HFILL }},
25129
25130     {&hf_ieee80211_ff_destination_reds_aid,
25131       {"Destination REDS AID", "wlan.dmg.destination_reds_aid",
25132        FT_UINT16, BASE_DEC, NULL, 0,
25133        NULL, HFILL }},
25134
25135     {&hf_ieee80211_ff_destination_aid,
25136       {"Destination AID", "wlan.dmg.destination_aid",
25137        FT_UINT16, BASE_DEC, NULL, 0,
25138        NULL, HFILL }},
25139
25140     {&hf_ieee80211_ff_realy_aid,
25141       {"Relay AID", "wlan.dmg.realy_aid",
25142        FT_UINT16, BASE_DEC, NULL, 0,
25143        NULL, HFILL }},
25144
25145     {&hf_ieee80211_ff_source_aid,
25146       {"Source AID", "wlan.dmg.source_aid",
25147        FT_UINT16, BASE_DEC, NULL, 0,
25148        NULL, HFILL }},
25149
25150     {&hf_ieee80211_ff_timing_offset,
25151       {"Timing Offset", "wlan.dmg.timing_offset",
25152        FT_UINT16, BASE_DEC, NULL, 0,
25153        NULL, HFILL }},
25154
25155     {&hf_ieee80211_ff_sampling_frequency_offset,
25156       {"Sampling Frequency Offset", "wlan.dmg.sampling_frequency_offset",
25157        FT_UINT16, BASE_DEC, NULL, 0,
25158        NULL, HFILL }},
25159
25160     {&hf_ieee80211_ff_relay_operation_type,
25161       {"Relay Operation Type", "wlan.dmg.relay_operation_type",
25162        FT_UINT8, BASE_DEC, NULL, 0x03,
25163        NULL, HFILL }},
25164
25165     {&hf_ieee80211_ff_peer_sta_aid,
25166       {"Peer STA AID", "wlan.dmg.peer_sta_aid",
25167        FT_UINT8, BASE_DEC, NULL, 0,
25168        NULL, HFILL }},
25169
25170     {&hf_ieee80211_ff_snr,
25171       {"SNR", "wlan.dmg.snr",
25172        FT_UINT8, BASE_DEC, NULL, 0,
25173        NULL, HFILL }},
25174
25175     {&hf_ieee80211_ff_internal_angle,
25176       {"Internal Angle", "wlan.dmg.internal_angle",
25177        FT_UINT8, BASE_DEC, NULL, 0xfe,
25178        NULL, HFILL }},
25179
25180     {&hf_ieee80211_ff_recommend,
25181       {"Recommend", "wlan.dmg.recommend",
25182        FT_UINT8, BASE_DEC, NULL, 0x01,
25183        NULL, HFILL }},
25184
25185     {&hf_ieee80211_ff_fst_action_code,
25186       {"FST Action Code", "wlan.fst.action_code",
25187        FT_UINT8, BASE_HEX, VALS(ff_fst_action_flags), 0,
25188        "Action Code", HFILL }},
25189
25190     {&hf_ieee80211_ff_llt,
25191       {"Link Loss Timeout", "wlan.fst.llt",
25192        FT_UINT32, BASE_DEC, NULL, 0,
25193        NULL, HFILL }},
25194
25195     {&hf_ieee80211_ff_fsts_id,
25196       {"FSTS ID", "wlan.session_trans.fsts_id",
25197        FT_UINT32, BASE_DEC, NULL, 0,
25198        NULL, HFILL }},
25199
25200     {&hf_ieee80211_ff_mmpdu_len,
25201       {"MMPDU Length", "wlan.fst.mmpdu_length",
25202        FT_UINT16, BASE_DEC, NULL, 0,
25203        NULL, HFILL }},
25204
25205     {&hf_ieee80211_ff_mmpdu_ctrl,
25206       {"MMPDU Control", "wlan.fst.mmpdu_ctrl",
25207        FT_UINT16, BASE_HEX, NULL, 0,
25208        NULL, HFILL }},
25209
25210     {&hf_ieee80211_ff_oct_mmpdu,
25211       {"OCT MMPDU", "wlan.fst.oct_mmpdu",
25212        FT_BYTES, BASE_NONE, NULL, 0,
25213        NULL, HFILL }},
25214
25215     {&hf_ieee80211_ff_vht_mimo_cntrl,
25216      {"VHT MIMO Control", "wlan.vht.mimo_control.control",
25217       FT_UINT24, BASE_HEX, NULL, 0x0,
25218       NULL, HFILL }},
25219
25220     {&hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
25221      {"Nc Index", "wlan.vht.mimo_control.ncindex",
25222       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nc_index_vals), 0x000007,
25223       "Number of Columns Less One", HFILL }},
25224
25225     {&hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
25226      {"Nr Index", "wlan.vht.mimo_control.nrindex",
25227       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nr_index_vals), 0x000038,
25228       "Number of Rows Less One", HFILL }},
25229
25230     {&hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
25231      {"Channel Width", "wlan.vht.mimo_control.chanwidth",
25232       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_channel_width_vals), 0x0000C0,
25233       NULL, HFILL }},
25234
25235     {&hf_ieee80211_ff_vht_mimo_cntrl_grouping,
25236      {"Grouping (Ng)", "wlan.vht.mimo_control.grouping",
25237       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_grouping_vals), 0x000300,
25238       NULL, HFILL }},
25239
25240     {&hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
25241      {"Codebook Information", "wlan.vht.mimo_control.codebookinfo",
25242       FT_UINT24, BASE_HEX, NULL, 0x000400,
25243       NULL, HFILL }},
25244
25245     {&hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
25246      {"Feedback Type", "wlan.vht.mimo_control.feedbacktype",
25247       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_feedback_vals), 0x000800,
25248       NULL, HFILL }},
25249
25250     {&hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
25251      {"Remaining Feedback Segments", "wlan.vht.mimo_control.remainingfeedbackseg",
25252       FT_UINT24, BASE_HEX, NULL, 0x007000,
25253       NULL, HFILL }},
25254
25255     {&hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
25256      {"First Feedback Segments", "wlan.vht.mimo_control.firstfeedbackseg",
25257       FT_UINT24, BASE_HEX, NULL, 0x008000,
25258       NULL, HFILL }},
25259
25260     {&hf_ieee80211_ff_vht_mimo_cntrl_reserved,
25261      {"Reserved", "wlan.vht.mimo_control.reserved",
25262       FT_UINT24, BASE_HEX, NULL, 0x030000,
25263       NULL, HFILL }},
25264
25265     {&hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
25266      {"Sounding Dialog Token Number", "wlan.vht.mimo_control.sounding_dialog_tocken_nbr",
25267       FT_UINT24, BASE_HEX, NULL, 0xFC0000,
25268       NULL, HFILL }},
25269
25270     {&hf_ieee80211_ff_vht_action,
25271       {"VHT Action", "wlan.vht.action",
25272        FT_UINT8, BASE_DEC, VALS(vht_action_vals), 0,
25273        NULL, HFILL }},
25274
25275     {&hf_ieee80211_vht_compressed_beamforming_report,
25276       {"VHT Compressed Beamforming Report", "wlan.vht.compressed_beamforming_report",
25277        FT_BYTES, BASE_NONE, NULL, 0,
25278        NULL, HFILL }},
25279
25280     {&hf_ieee80211_vht_mu_exclusive_beamforming_report,
25281       {"VHT MU Exclusive Beamforming Report","wlan.vht.exclusive_beamforming_report",
25282        FT_BYTES, BASE_NONE, NULL, 0,
25283        NULL, HFILL }},
25284
25285     {&hf_ieee80211_vht_compressed_beamforming_report_snr,
25286       {"Signal to Noise Ratio (SNR)", "wlan.vht.compressed_beamforming_report.snr",
25287        FT_INT8, BASE_DEC, NULL, 0,
25288        NULL, HFILL }},
25289
25290     {&hf_ieee80211_vht_compressed_beamforming_phi_angle,
25291       {"PHI", "wlan.vht.compressed_beamforming_report.phi",
25292        FT_NONE, BASE_NONE, NULL, 0,
25293        NULL, HFILL }},
25294
25295     {&hf_ieee80211_vht_compressed_beamforming_psi_angle,
25296       {"PSI", "wlan.vht.compressed_beamforming_report.psi",
25297        FT_NONE, BASE_NONE, NULL, 0,
25298        NULL, HFILL }},
25299
25300     {&hf_ieee80211_vht_compressed_beamforming_feedback_matrix,
25301       {"Compressed Beamforming Feedback Matrix", "wlan.vht.compressed_beamforming_report.feedback_matrix",
25302        FT_NONE, BASE_NONE, NULL, 0,
25303        NULL, HFILL }},
25304
25305     {&hf_ieee80211_vht_mu_Exclusive_beamforming_delta_snr,
25306       {"Delta SNR for space-time stream Nc for subcarrier k", "wlan.vht.exclusive_beamforming_report.delta_snr",
25307        FT_NONE, BASE_NONE, NULL, 0,
25308        NULL, HFILL }},
25309
25310     {&hf_ieee80211_vht_group_id_management,
25311       {"Group ID Management", "wlan.vht.group_id_management",
25312        FT_BYTES, BASE_NONE, NULL, 0,
25313        NULL, HFILL }},
25314
25315     {&hf_ieee80211_vht_membership_status_array,
25316       {"Membership Status Array", "wlan.vht.membership_status_array",
25317        FT_BYTES, BASE_NONE, NULL, 0,
25318        NULL, HFILL }},
25319
25320       {&hf_ieee80211_vht_user_position_array,
25321         {"User Position Array", "wlan.vht.user_position_array",
25322          FT_BYTES, BASE_NONE, NULL, 0,
25323          NULL, HFILL }},
25324
25325       {&hf_ieee80211_vht_membership_status_field,
25326         {"Membership Status Field", "wlan.vht.membership_status_array.field",
25327          FT_UINT8, BASE_DEC, NULL, 0,
25328          NULL, HFILL }},
25329
25330       {&hf_ieee80211_vht_user_position_field,
25331         {"User Position Field", "wlan.vht.user_position_array.field",
25332          FT_UINT8, BASE_DEC, NULL, 0,
25333          NULL, HFILL }},
25334
25335     {&hf_ieee80211_vht_operation_mode_notification,
25336       {"Operation Mode Notification", "wlan.vht.operation_mode_notification",
25337        FT_BYTES, BASE_NONE, NULL, 0,
25338        NULL, HFILL }},
25339
25340     {&hf_ieee80211_ff_he_action,
25341       {"HE Action", "wlan.he.action",
25342        FT_UINT8, BASE_DEC, VALS(he_action_vals), 0,
25343        NULL, HFILL }},
25344
25345     {&hf_he_mimo_control_nc_index,
25346      {"Nc Index", "wlan.he.mimo.nc_index",
25347       FT_UINT40, BASE_DEC, NULL, 0x0000000007, NULL, HFILL }},
25348
25349     {&hf_he_mimo_control_nr_index,
25350      {"Nr Index", "wlan.he.mimo.nr_index",
25351       FT_UINT40, BASE_DEC, NULL, 0x0000000038, NULL, HFILL }},
25352
25353     {&hf_he_mimo_control_bw,
25354      {"BW", "wlan.he.mimo.bw",
25355       FT_UINT40, BASE_DEC, NULL, 0x00000000C0, NULL, HFILL }},
25356
25357     {&hf_he_mimo_control_grouping,
25358      {"Grouping", "wlan.he.mimo.grouping",
25359       FT_UINT40, BASE_DEC, NULL, 0x0000000100, NULL, HFILL }},
25360
25361     {&hf_he_mimo_control_codebook_info,
25362      {"Codebook Information", "wlan.he.mimo.codebook_info",
25363       FT_UINT40, BASE_DEC, NULL, 0x0000000200, NULL, HFILL }},
25364
25365     {&hf_he_mimo_control_feedback_type,
25366      {"Feedback Type", "wlan.he.mimo.feedback_type",
25367       FT_UINT40, BASE_DEC, NULL, 0x0000000C00, NULL, HFILL }},
25368
25369     {&hf_he_mimo_control_remaining_feedback_segs,
25370      {"Remaining Feedback Segments", "wlan.he.mimo.remaining_feedback_segs",
25371       FT_UINT40, BASE_DEC, NULL, 0x0000007000, NULL, HFILL }},
25372
25373     {&hf_he_mimo_control_first_feedback_seg,
25374      {"First Feedback Segment", "wlan.he.mimo.first_feedback_seg",
25375       FT_UINT40, BASE_DEC, NULL, 0x0000008000, NULL, HFILL }},
25376
25377     {&hf_he_mimo_control_ru_start_index,
25378      {"RU Start Index", "wlan.he.mimo.ru_start_index",
25379       FT_UINT40, BASE_HEX, NULL, 0x00007F0000, NULL, HFILL }},
25380
25381     {&hf_he_mimo_control_ru_end_index,
25382      {"RU End Index", "wlan.he.mimo.ru_end_index",
25383       FT_UINT40, BASE_HEX, NULL, 0x003F800000, NULL, HFILL }},
25384
25385     {&hf_he_mimo_control_sounding_dialog_token_num,
25386      {"Sounding Dialog Token Number", "wlan.he.mimo.sounding_dialog_token_num",
25387       FT_UINT40, BASE_DEC, NULL, 0x0FC0000000, NULL, HFILL }},
25388
25389     {&hf_he_mimo_control_reserved,
25390      {"Reserved", "wlan.he.mimo.reserved",
25391       FT_UINT40, BASE_DEC, NULL, 0xF000000000, NULL, HFILL }},
25392
25393     {&hf_ieee80211_he_mimo_control_field,
25394      {"HE MIMO Control", "wlan.he.action.he_mimo_control",
25395       FT_UINT40, BASE_HEX, NULL, 0x0, NULL, HFILL }},
25396
25397     {&hf_ieee80211_tag_tspec_allocation_id,
25398       {"Allocation ID", "wlan.dmg_tspec.allocation_id",
25399        FT_UINT24, BASE_DEC, NULL, 0x00000f,
25400        NULL, HFILL }},
25401
25402     {&hf_ieee80211_tag_tspec_allocation_type,
25403       {"Allocation Type", "wlan.dmg_tspec.allocation_type",
25404        FT_UINT24, BASE_DEC, NULL, 0x000070,
25405        NULL, HFILL }},
25406
25407     {&hf_ieee80211_tag_tspec_allocation_format,
25408       {"Allocation Format", "wlan.dmg_tspec.allocation_format",
25409        FT_BOOLEAN, 24, NULL, 0x000080,
25410        NULL, HFILL }},
25411
25412     {&hf_ieee80211_tag_tspec_pseudo_static,
25413       {"Pseudo Static", "wlan.dmg_tspec.pseudo_static",
25414        FT_BOOLEAN, 24, NULL, 0x000100,
25415        NULL, HFILL }},
25416
25417     {&hf_ieee80211_tag_tspec_truncatable,
25418       {"Truncatable", "wlan.dmg_tspec.truncatable",
25419        FT_BOOLEAN, 24, NULL, 0x000200,
25420        NULL, HFILL }},
25421
25422     {&hf_ieee80211_tag_tspec_extendable,
25423       {"Extendable", "wlan.dmg_tspec.extendable",
25424        FT_BOOLEAN, 24, NULL, 0x000400,
25425        NULL, HFILL }},
25426
25427     {&hf_ieee80211_tag_tspec_lp_sc_used,
25428       {"LP SC Usec", "wlan.dmg_tspec.lp_sc_used",
25429        FT_BOOLEAN, 24, NULL, 0x000800,
25430        NULL, HFILL }},
25431
25432     {&hf_ieee80211_tag_tspec_up,
25433       {"UP", "wlan.dmg_tspec.up",
25434        FT_UINT24, BASE_HEX, NULL, 0x007000,
25435        NULL, HFILL }},
25436
25437     {&hf_ieee80211_tag_tspec_dest_aid,
25438       {"Destination AID", "wlan.dmg_tspec.dest_aid",
25439        FT_UINT24, BASE_HEX, NULL, 0x7f8000,
25440        NULL, HFILL }},
25441
25442     {&hf_ieee80211_tag_tspec_allocation_period,
25443       {"Allocation Period", "wlan.dmg_tspec.allocation_period",
25444        FT_UINT16, BASE_DEC, NULL, 0,
25445        NULL, HFILL }},
25446
25447     {&hf_ieee80211_tag_tspec_min_allocation,
25448       {"Minimal Allocation", "wlan.dmg_tspec.min_allocation",
25449        FT_UINT16, BASE_DEC, NULL, 0,
25450        NULL, HFILL }},
25451
25452     {&hf_ieee80211_tag_tspec_max_allocation,
25453       {"Maximal Allocation", "wlan.dmg_tspec.max_allocation",
25454        FT_UINT16, BASE_DEC, NULL, 0,
25455        NULL, HFILL }},
25456
25457     {&hf_ieee80211_tag_tspec_min_duration,
25458       {"Minimal Duration", "wlan.dmg_tspec.min_duration",
25459        FT_UINT16, BASE_DEC, NULL, 0,
25460        NULL, HFILL }},
25461
25462     {&hf_ieee80211_tag_tspec_num_of_constraints,
25463       {"Number Of Constraints", "wlan.dmg_tspec.num_of_constraints",
25464        FT_UINT8, BASE_DEC, NULL, 0,
25465        NULL, HFILL }},
25466
25467     {&hf_ieee80211_tag_tspec_tsconst_start_time,
25468       {"TS Constraint Start Time", "wlan.dmg_tspec.tsconst.start_time",
25469        FT_UINT32, BASE_DEC, NULL, 0,
25470        NULL, HFILL }},
25471
25472     {&hf_ieee80211_tag_tspec_tsconst_duration,
25473       {"TS Constraint Duration", "wlan.dmg_tspec.tsconst.duration",
25474        FT_UINT16, BASE_DEC, NULL, 0,
25475        NULL, HFILL }},
25476
25477     {&hf_ieee80211_tag_tspec_tsconst_period,
25478       {"TS Constraint Period", "wlan.dmg_tspec.tsconst.period",
25479        FT_UINT16, BASE_DEC, NULL, 0,
25480        NULL, HFILL }},
25481
25482     {&hf_ieee80211_tag_tspec_tsconst_interferer_mac,
25483       {"TS Constraint Interferer MAC Address", "wlan.dmg_tspec.tsconst.interferer_mac",
25484        FT_ETHER, BASE_NONE, NULL, 0,
25485        NULL, HFILL }},
25486
25487     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_I,
25488       {"Channel Measurement Feedback Relative I", "wlan.ch_meas_fb.realtive_I",
25489        FT_UINT8, BASE_DEC, NULL, 0,
25490        NULL, HFILL }},
25491
25492     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_Q,
25493       {"Channel Measurement Feedback Relative Q", "wlan.ch_meas_fb.realtive_Q",
25494        FT_UINT8, BASE_DEC, NULL, 0,
25495        NULL, HFILL }},
25496
25497     {&hf_ieee80211_tag_channel_measurement_feedback_tap_delay,
25498       {"Channel Measurement Feedback Tap Delay", "wlan.ch_meas_fb.tap_delay",
25499        FT_UINT8, BASE_DEC, NULL, 0,
25500        NULL, HFILL }},
25501
25502     {&hf_ieee80211_tag_channel_measurement_feedback_sector_id,
25503       {"Channel Measurement Feedback Secotr ID", "wlan.ch_meas_fb.sector_id",
25504        FT_UINT8, BASE_DEC, NULL, 0xfc,
25505        NULL, HFILL }},
25506
25507     {&hf_ieee80211_tag_channel_measurement_feedback_antenna_id,
25508       {"Channel Measurement Feedback Antenna ID", "wlan.ch_meas_fb.antenna_id",
25509        FT_UINT8, BASE_DEC, NULL, 0x03,
25510        NULL, HFILL }},
25511
25512     {&hf_ieee80211_tag_awake_window,
25513       {"Awake Window", "wlan.awake_window",
25514        FT_UINT16, BASE_DEC, NULL, 0,
25515        NULL, HFILL }},
25516
25517     {&hf_ieee80211_tag_addba_ext_no_frag,
25518       {"ADDBA No Fragmentation", "wlan.addba.no_frag",
25519        FT_BOOLEAN, 8, NULL, 0x01,
25520        NULL, HFILL }},
25521
25522     {&hf_ieee80211_tag_addba_ext_he_fragmentation_operation,
25523       {"ADDBA HE Fragmentation Operation", "wlan.addba.he_frag_oper",
25524        FT_UINT8, BASE_HEX, NULL, 0x06,
25525        NULL, HFILL }},
25526
25527     {&hf_ieee80211_tag_addba_ext_reserved,
25528       {"Reserved", "wlan.addba.he_frag_oper",
25529        FT_UINT8, BASE_HEX, NULL, 0xF8,
25530        NULL, HFILL }},
25531
25532     {&hf_ieee80211_tag_multi_band_ctrl_sta_role,
25533       {"STA Rold", "wlan.multi_band.ctrl_sta_role",
25534        FT_UINT8, BASE_DEC, NULL, 0xe0,
25535        NULL, HFILL }},
25536
25537     {&hf_ieee80211_tag_multi_band_ctrl_addr_present,
25538       {"STA MAC Address Present", "wlan.multi_band.ctrl_addr_present",
25539        FT_BOOLEAN, 8, NULL, 0x10,
25540        NULL, HFILL }},
25541
25542     {&hf_ieee80211_tag_multi_band_ctrl_cipher_present,
25543       {"PCS Present", "wlan.multi_band.ctrl_cipher_present",
25544        FT_BOOLEAN, 8, NULL, 0x08,
25545        NULL, HFILL }},
25546
25547     {&hf_ieee80211_tag_multi_band_oper_class,
25548       {"Operating Class", "wlan.multi_band.oper_class",
25549        FT_UINT8, BASE_DEC, NULL, 0,
25550        NULL, HFILL }},
25551
25552     {&hf_ieee80211_tag_multi_band_channel_number,
25553       {"Channel Number", "wlan.multi_band.channel_number",
25554        FT_UINT8, BASE_DEC, NULL, 0,
25555        NULL, HFILL }},
25556
25557     {&hf_ieee80211_tag_multi_band_tsf_offset,
25558       {"TSF Offset", "wlan.multi_band.tsf_offset",
25559        FT_UINT64, BASE_DEC, NULL, 0,
25560        NULL, HFILL }},
25561
25562     {&hf_ieee80211_tag_multi_band_conn_ap,
25563       {"Connection Capability AP", "wlan.multi_band.conn_ap",
25564        FT_BOOLEAN, 8, NULL, 0x80,
25565        NULL, HFILL }},
25566
25567     {&hf_ieee80211_tag_multi_band_conn_pcp,
25568       {"Connection Capability PCP", "wlan.multi_band.conn_pcp",
25569        FT_BOOLEAN, 8, NULL, 0x40,
25570        NULL, HFILL }},
25571
25572     {&hf_ieee80211_tag_multi_band_conn_dls,
25573       {"Connection Capability DLS", "wlan.multi_band.conn_dls",
25574        FT_BOOLEAN, 8, NULL, 0x20,
25575        NULL, HFILL }},
25576
25577     {&hf_ieee80211_tag_multi_band_conn_tdls,
25578       {"Connection Capability TDLS", "wlan.multi_band.conn_tdls",
25579        FT_BOOLEAN, 8, NULL, 0x10,
25580        NULL, HFILL }},
25581
25582     {&hf_ieee80211_tag_multi_band_conn_ibss,
25583       {"Connection Capability IBSS", "wlan.multi_band.conn_ibss",
25584        FT_BOOLEAN, 8, NULL, 0x08,
25585        NULL, HFILL }},
25586
25587     {&hf_ieee80211_tag_multi_band_fst_timeout,
25588       {"FST Session Timeout", "wlan.multi_band.fst_timeout",
25589        FT_UINT8, BASE_DEC, NULL, 0,
25590        NULL, HFILL }},
25591
25592     {&hf_ieee80211_tag_multi_band_sta_mac,
25593       {"Transmitting STA MAC Address", "wlan.multi_band.sta_mac",
25594        FT_ETHER, BASE_NONE, NULL, 0,
25595        NULL, HFILL }},
25596
25597     {&hf_ieee80211_tag_activity,
25598       {"Activity", "wlan.activity",
25599        FT_UINT8, BASE_DEC, NULL, 0,
25600        NULL, HFILL }},
25601
25602     {&hf_ieee80211_tag_dmg_link_adapt_mcs,
25603       {"MCS", "wlan.dmg_link_adapt.mcs",
25604        FT_UINT8, BASE_DEC, NULL, 0,
25605        NULL, HFILL }},
25606
25607     {&hf_ieee80211_tag_dmg_link_adapt_link_margin,
25608       {"Link Margin", "wlan.dmg_link_adapt.link_margin",
25609        FT_UINT8, BASE_DEC, NULL, 0,
25610        NULL, HFILL }},
25611
25612     {&hf_ieee80211_tag_ref_timestamp,
25613       {"Reference Timestamp", "wlan.ref_timestamp",
25614        FT_UINT32, BASE_DEC, NULL, 0,
25615        NULL, HFILL }},
25616
25617     {&hf_ieee80211_tag_switching_stream_non_qos,
25618       {"Non-Qos Data Frames", "wlan.switching_stream.non_qos",
25619        FT_BOOLEAN, 8, NULL, 0,
25620        NULL, HFILL }},
25621
25622     {&hf_ieee80211_tag_switching_stream_param_num,
25623       {"Number Of Switching Stream Elements", "wlan.switching_stream.param_num",
25624        FT_UINT8, BASE_DEC, NULL, 0,
25625        NULL, HFILL }},
25626
25627     {&hf_ieee80211_tag_switching_stream_old_tid,
25628       {"Old Band TID", "wlan.switching_stream.old_tid",
25629        FT_UINT16, BASE_DEC, NULL, 0xf000,
25630        NULL, HFILL }},
25631
25632     {&hf_ieee80211_tag_switching_stream_old_direction,
25633       {"Old Band Direction", "wlan.switching_stream.old_direction",
25634        FT_BOOLEAN, 16, NULL, 0x0800,
25635        NULL, HFILL }},
25636
25637     {&hf_ieee80211_tag_switching_stream_new_tid,
25638       {"New Band TID", "wlan.switching_stream.new_tid",
25639        FT_UINT16, BASE_DEC, NULL, 0x0780,
25640        NULL, HFILL }},
25641
25642     {&hf_ieee80211_tag_switching_stream_new_direction,
25643       {"New Band Direction", "wlan.switching_stream.new_direction",
25644        FT_BOOLEAN, 16, NULL, 0x0040,
25645        NULL, HFILL }},
25646
25647     {&hf_ieee80211_tag_switching_stream_new_valid_id,
25648       {"Stream ID in New Band Valid", "wlan.switching_stream.new_valid_id",
25649        FT_BOOLEAN, 16, NULL, 0x0020,
25650        NULL, HFILL }},
25651
25652     {&hf_ieee80211_tag_switching_stream_llt_type,
25653       {"LLT Type", "wlan.switching_stream.llt_type",
25654        FT_BOOLEAN, 16, NULL, 0x0010,
25655        NULL, HFILL }},
25656
25657     {&hf_ieee80211_ff_timestamp,
25658      {"Timestamp", "wlan.fixed.timestamp",
25659       FT_UINT64, BASE_HEX, NULL, 0,
25660       NULL, HFILL }},
25661
25662     {&hf_ieee80211_ff_auth_alg,
25663      {"Authentication Algorithm", "wlan.fixed.auth.alg",
25664       FT_UINT16, BASE_DEC, VALS(auth_alg), 0,
25665       NULL, HFILL }},
25666
25667     {&hf_ieee80211_ff_beacon_interval,
25668      {"Beacon Interval", "wlan.fixed.beacon",
25669       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
25670       NULL, HFILL }},
25671
25672     {&hf_ieee80211_fixed_parameters,
25673      {"Fixed parameters", "wlan.fixed.all",
25674       FT_NONE, BASE_NONE, NULL, 0,
25675       NULL, HFILL }},
25676
25677     {&hf_ieee80211_tagged_parameters,
25678      {"Tagged parameters", "wlan.tagged.all",
25679       FT_NONE, BASE_NONE, NULL, 0,
25680       NULL, HFILL }},
25681
25682     {&hf_ieee80211_tag_ssid,
25683      {"SSID", "wlan.ssid",
25684       FT_STRING, BASE_NONE, NULL, 0,
25685       "Indicates the identity of an ESS or IBSS", HFILL }},
25686
25687     {&hf_ieee80211_tag_supp_rates,
25688      {"Supported Rates", "wlan.supported_rates",
25689       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
25690       "In Mbit/sec, (B) for Basic Rates", HFILL }},
25691
25692     {&hf_ieee80211_tag_fh_dwell_time,
25693      {"Dwell Time", "wlan.fh.dwell_time",
25694       FT_UINT16, BASE_HEX, NULL, 0x0,
25695       "In Time Unit (TU)", HFILL }},
25696
25697     {&hf_ieee80211_tag_fh_hop_set,
25698      {"Hop Set", "wlan.fh.hop_set",
25699       FT_UINT8, BASE_DEC, NULL, 0x0,
25700       NULL, HFILL }},
25701
25702     {&hf_ieee80211_tag_fh_hop_pattern,
25703      {"Hop Pattern", "wlan.fh.hop_pattern",
25704       FT_UINT8, BASE_DEC, NULL, 0x0,
25705       NULL, HFILL }},
25706
25707     {&hf_ieee80211_tag_fh_hop_index,
25708      {"Hop Index", "wlan.fh.hop_index",
25709       FT_UINT8, BASE_DEC, NULL, 0x0,
25710       NULL, HFILL }},
25711
25712     {&hf_ieee80211_ff_block_ack_params,
25713      {"Block Ack Parameters", "wlan.fixed.baparams",
25714       FT_UINT16, BASE_HEX, NULL, 0,
25715       NULL, HFILL }},
25716
25717     {&hf_ieee80211_ff_block_ack_params_amsdu_permitted,
25718      {"A-MSDUs", "wlan.fixed.baparams.amsdu",
25719       FT_BOOLEAN, 16, TFS(&ff_block_ack_params_amsdu_permitted_flag), 0x0001,
25720       "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
25721
25722     {&hf_ieee80211_ff_block_ack_params_policy,
25723      {"Block Ack Policy", "wlan.fixed.baparams.policy",
25724       FT_BOOLEAN, 16, TFS(&ff_block_ack_params_policy_flag), 0x0002,
25725       NULL, HFILL }},
25726
25727     {&hf_ieee80211_ff_block_ack_params_tid,
25728      {"Traffic Identifier", "wlan.fixed.baparams.tid",
25729       FT_UINT16, BASE_HEX, NULL, 0x003C,
25730       NULL, HFILL }},
25731
25732     {&hf_ieee80211_ff_block_ack_params_buffer_size,
25733      {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan.fixed.baparams.buffersize",
25734       FT_UINT16, BASE_DEC, NULL, 0xFFC0,
25735       "Number of Buffers", HFILL }},
25736
25737     {&hf_ieee80211_ff_block_ack_timeout,
25738      {"Block Ack Timeout", "wlan.fixed.batimeout",
25739       FT_UINT16, BASE_HEX, NULL, 0,
25740       NULL, HFILL }},
25741
25742     {&hf_ieee80211_ff_block_ack_ssc,
25743      {"Block Ack Starting Sequence Control (SSC)", "wlan.fixed.ssc",
25744       FT_UINT16, BASE_HEX, 0, 0,
25745       NULL, HFILL }},
25746
25747     {&hf_ieee80211_ff_block_ack_ssc_fragment,
25748      {"Fragment", "wlan.fixed.ssc.fragment",
25749       FT_UINT16, BASE_DEC, 0, 0x000f,
25750       NULL, HFILL }},
25751
25752     {&hf_ieee80211_ff_block_ack_ssc_sequence,
25753      {"Starting Sequence Number", "wlan.fixed.ssc.sequence",
25754       FT_UINT16, BASE_DEC, 0, 0xfff0,
25755       NULL, HFILL }},
25756
25757     {&hf_ieee80211_ff_delba_param,
25758      {"Delete Block Ack (DELBA) Parameter Set", "wlan.fixed.delba.param",
25759       FT_UINT16, BASE_HEX, 0, 0,
25760       NULL, HFILL }},
25761
25762     {&hf_ieee80211_ff_delba_param_reserved,
25763      {"Reserved", "wlan.fixed.delba.param.reserved",
25764       FT_UINT16, BASE_HEX, 0, 0x07ff,
25765       NULL, HFILL }},
25766
25767     {&hf_ieee80211_ff_delba_param_init,
25768      {"Initiator", "wlan.fixed.delba.param.initiator",
25769       FT_BOOLEAN, 16, 0, 0x0800,
25770       NULL, HFILL }},
25771
25772     {&hf_ieee80211_ff_delba_param_tid,
25773      {"TID", "wlan.fixed.delba.param.tid",
25774       FT_UINT16, BASE_HEX, 0, 0xf000,
25775       "Traffic Identifier (TID)", HFILL }},
25776
25777     {&hf_ieee80211_ff_max_reg_pwr,
25778      {"Maximum Regulation Power", "wlan.fixed.maxregpwr",
25779       FT_UINT16, BASE_HEX, 0, 0,
25780       NULL, HFILL }},
25781
25782     {&hf_ieee80211_ff_measurement_pilot_int,
25783      {"Measurement Pilot Interval", "wlan.fixed.msmtpilotint",
25784       FT_UINT8, BASE_HEX, 0, 0,
25785       "Measurement Pilot Interval Fixed Field", HFILL }},
25786
25787     {&hf_ieee80211_ff_country_str,
25788      {"Country String", "wlan.fixed.country",
25789       FT_STRING, BASE_NONE, 0, 0,
25790       NULL, HFILL }},
25791
25792     {&hf_ieee80211_ff_max_tx_pwr,
25793      {"Maximum Transmit Power", "wlan.fixed.maxtxpwr",
25794       FT_UINT8, BASE_HEX, 0, 0,
25795       NULL, HFILL }},
25796
25797     {&hf_ieee80211_ff_tx_pwr_used,
25798      {"Transmit Power Used", "wlan.fixed.txpwr",
25799       FT_UINT8, BASE_HEX, 0, 0,
25800       NULL, HFILL }},
25801
25802     {&hf_ieee80211_ff_transceiver_noise_floor,
25803      {"Transceiver Noise Floor", "wlan.fixed.tnoisefloor",
25804       FT_UINT8, BASE_HEX, 0, 0,
25805       NULL, HFILL }},
25806
25807     {&hf_ieee80211_ff_channel_width,
25808      {"Supported Channel Width", "wlan.fixed.chanwidth",
25809       FT_UINT8, BASE_HEX, VALS(ff_channel_width_vals), 0,
25810       NULL, HFILL }},
25811
25812     {&hf_ieee80211_ff_qos_info_ap,
25813      {"QoS Information (AP)", "wlan.fixed.qosinfo.ap",
25814       FT_UINT8, BASE_HEX, NULL, 0,
25815       NULL, HFILL }},
25816
25817     {&hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
25818      {"EDCA Parameter Set Update Count", "wlan.fixed.qosinfo.ap.edcaupdate",
25819       FT_UINT8, BASE_HEX, NULL, 0x0F,
25820       "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
25821
25822     {&hf_ieee80211_ff_qos_info_ap_q_ack,
25823      {"Q-Ack", "wlan.fixed.qosinfo.ap.qack",
25824       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_q_ack_flag), 0x10,
25825       "QoS Ack", HFILL }},
25826
25827     {&hf_ieee80211_ff_qos_info_ap_queue_req,
25828      {"Queue Request", "wlan.fixed.qosinfo.ap.queue_req",
25829       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_queue_req_flag), 0x20,
25830       NULL, HFILL }},
25831
25832     {&hf_ieee80211_ff_qos_info_ap_txop_request,
25833      {"TXOP Request", "wlan.fixed.qosinfo.ap.txopreq",
25834       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_txop_request_flag), 0x40,
25835       "Transmit Opportunity (TXOP) Request", HFILL }},
25836
25837     {&hf_ieee80211_ff_qos_info_ap_reserved,
25838      {"Reserved", "wlan.fixed.qosinfo.ap.reserved",
25839       FT_BOOLEAN, 8, NULL, 0x80,
25840       NULL, HFILL }},
25841
25842     {&hf_ieee80211_ff_qos_info_sta,
25843      {"QoS Information (STA)", "wlan.fixed.qosinfo.sta",
25844       FT_UINT8, BASE_HEX, NULL, 0,
25845       "TCLAS Processing", HFILL }},
25846
25847     {&hf_ieee80211_ff_qos_info_sta_ac_vo,
25848      {"AC_VO U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_vo",
25849       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x01,
25850       NULL, HFILL }},
25851
25852     {&hf_ieee80211_ff_qos_info_sta_ac_vi,
25853      {"AC_VI U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_vi",
25854       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x02,
25855       NULL, HFILL }},
25856
25857     {&hf_ieee80211_ff_qos_info_sta_ac_bk,
25858      {"AC_BK U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_bk",
25859       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x04,
25860       NULL, HFILL }},
25861
25862     {&hf_ieee80211_ff_qos_info_sta_ac_be,
25863      {"AC_BE U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_be",
25864       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x08,
25865       NULL, HFILL }},
25866
25867     {&hf_ieee80211_ff_qos_info_sta_q_ack,
25868      {"Q-Ack", "wlan.fixed.qosinfo.sta.qack",
25869       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_q_ack_flag), 0x10,
25870       "QoS Ack", HFILL }},
25871
25872     {&hf_ieee80211_ff_qos_info_sta_max_sp_length,
25873      {"Max SP Length", "wlan.fixed.qosinfo.sta.max_sp_length",
25874       FT_UINT8, BASE_HEX, VALS(ff_qos_info_sta_max_sp_len_flags) , 0x60,
25875       NULL, HFILL }},
25876
25877     {&hf_ieee80211_ff_qos_info_sta_more_data_ack,
25878      {"More Data Ack", "wlan.fixed.qosinfo.sta.more_data_ack",
25879       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_more_data_ack_flag), 0x80,
25880       NULL, HFILL }},
25881
25882     {&hf_ieee80211_ff_sm_pwr_save,
25883      {"Spatial Multiplexing (SM) Power Control", "wlan.fixed.sm.powercontrol",
25884       FT_UINT8, BASE_HEX, NULL, 0,
25885       NULL, HFILL }},
25886
25887     {&hf_ieee80211_ff_sm_pwr_save_enabled,
25888      {"SM Power Save", "wlan.fixed.sm.powercontrol.enabled",
25889       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
25890       "Spatial Multiplexing (SM) Power Save", HFILL }},
25891
25892     {&hf_ieee80211_ff_sm_pwr_save_sm_mode,
25893      {"SM Mode", "wlan.fixed.sm.powercontrol.mode",
25894       FT_BOOLEAN, 8, TFS(&ff_sm_pwr_save_sm_mode_flag), 0x02,
25895       "Spatial Multiplexing (SM) Mode", HFILL }},
25896
25897     {&hf_ieee80211_ff_sm_pwr_save_reserved,
25898      {"Reserved", "wlan.fixed.sm.powercontrol.reserved",
25899       FT_UINT8, BASE_HEX, NULL, 0xFC,
25900       NULL, HFILL }},
25901
25902     {&hf_ieee80211_ff_pco_phase_cntrl,
25903      {"Phased Coexistence Operation (PCO) Phase Control", "wlan.fixed.pco.phasecntrl",
25904       FT_BOOLEAN, BASE_NONE, TFS(&ff_pco_phase_cntrl_flag), 0x0,
25905       NULL, HFILL }},
25906
25907     {&hf_ieee80211_ff_psmp_param_set,
25908      {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan.fixed.psmp.paramset",
25909       FT_UINT16, BASE_HEX, 0, 0,
25910       NULL, HFILL }},
25911
25912     {&hf_ieee80211_ff_psmp_param_set_n_sta,
25913      {"Number of STA Info Fields Present", "wlan.fixed.psmp.paramset.nsta",
25914       FT_UINT16, BASE_HEX, 0, 0x000F,
25915       NULL, HFILL }},
25916
25917     {&hf_ieee80211_ff_psmp_param_set_more_psmp,
25918      {"More PSMP", "wlan.fixed.psmp.paramset.more",
25919       FT_BOOLEAN, 16, TFS(&ff_psmp_param_set_more_psmp_flag), 0x0010,
25920       "More Power Save Multi-Poll (PSMP)", HFILL }},
25921
25922     {&hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
25923      {"PSMP Sequence Duration [us]", "wlan.fixed.psmp.paramset.seqduration",
25924       FT_UINT16, BASE_DEC, 0, 0xFFE0,
25925       "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
25926
25927     {&hf_ieee80211_ff_mimo_cntrl,
25928      {"MIMO Control", "wlan.fixed.mimo.control",
25929       FT_BYTES, BASE_NONE, 0, 0x0,
25930       NULL, HFILL }},
25931
25932     {&hf_ieee80211_ff_mimo_cntrl_nc_index,
25933      {"Nc Index", "wlan.fixed.mimo.control.ncindex",
25934       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nc_index_flags), 0x0003,
25935       "Number of Columns Less One", HFILL }},
25936
25937     {&hf_ieee80211_ff_mimo_cntrl_nr_index,
25938      {"Nr Index", "wlan.fixed.mimo.control.nrindex",
25939       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nr_index_flags), 0x000C,
25940       "Number of Rows Less One", HFILL }},
25941
25942     {&hf_ieee80211_ff_mimo_cntrl_channel_width,
25943      {"Channel Width", "wlan.fixed.mimo.control.chanwidth",
25944       FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010,
25945       NULL, HFILL }},
25946
25947     {&hf_ieee80211_ff_mimo_cntrl_grouping,
25948      {"Grouping (Ng)", "wlan.fixed.mimo.control.grouping",
25949       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_grouping_flags), 0x0060,
25950       NULL, HFILL }},
25951
25952     {&hf_ieee80211_ff_mimo_cntrl_coefficient_size,
25953      {"Coefficient Size (Nb)", "wlan.fixed.mimo.control.cosize",
25954       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_coefficient_size_flags), 0x0180,
25955       NULL, HFILL }},
25956
25957     {&hf_ieee80211_ff_mimo_cntrl_codebook_info,
25958      {"Codebook Information", "wlan.fixed.mimo.control.codebookinfo",
25959       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_codebook_info_flags), 0x0600,
25960       NULL, HFILL }},
25961
25962     {&hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
25963      {"Remaining Matrix Segment", "wlan.fixed.mimo.control.matrixseg",
25964       FT_UINT16, BASE_HEX, 0, 0x3800,
25965       NULL, HFILL }},
25966
25967     {&hf_ieee80211_ff_mimo_cntrl_reserved,
25968      {"Reserved", "wlan.fixed.mimo.control.reserved",
25969       FT_UINT16, BASE_HEX, 0, 0xC000,
25970       NULL, HFILL }},
25971
25972     {&hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
25973      {"Sounding Timestamp", "wlan.fixed.mimo.control.soundingtime",
25974       FT_UINT32, BASE_HEX, 0, 0,
25975       NULL, HFILL }},
25976
25977     {&hf_ieee80211_ff_psmp_sta_info,
25978      {"Power Save Multi-Poll (PSMP) Station Information", "wlan.fixed.psmp.stainfo",
25979       FT_UINT64, BASE_HEX, 0, 0,
25980       NULL, HFILL }},
25981
25982     {&hf_ieee80211_ff_psmp_sta_info_type,
25983      {"Sta Info Type", "wlan.fixed.psmp.stainfo.type",
25984       FT_UINT32, BASE_HEX, VALS(ff_psmp_sta_info_flags), PSMP_STA_INFO_FLAG_TYPE,
25985       NULL, HFILL }},
25986
25987     {&hf_ieee80211_ff_psmp_sta_info_dtt_start_offset,
25988      {"DTT Start Offset", "wlan.fixed.psmp.stainfo.dttstart",
25989       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_START,
25990       NULL, HFILL }},
25991
25992     {&hf_ieee80211_ff_psmp_sta_info_dtt_duration,
25993      {"DTT Duration", "wlan.fixed.psmp.stainfo.dttduration",
25994       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_DURATION,
25995       NULL, HFILL }},
25996
25997     {&hf_ieee80211_ff_psmp_sta_info_sta_id,
25998      {"Target Station ID", "wlan.fixed.psmp.stainfo.staid",
25999       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_STA_ID,
26000       NULL, HFILL }},
26001
26002     {&hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
26003      {"UTT Start Offset", "wlan.fixed.psmp.stainfo.uttstart",
26004       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_START,
26005       NULL, HFILL }},
26006
26007     {&hf_ieee80211_ff_psmp_sta_info_utt_duration,
26008      {"UTT Duration", "wlan.fixed.psmp.stainfo.uttduration",
26009       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_DURATION,
26010       NULL, HFILL }},
26011
26012     {&hf_ieee80211_ff_psmp_sta_info_reserved_small,
26013      {"Reserved", "wlan.fixed.psmp.stainfo.reserved",
26014       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_IA_RESERVED,
26015       NULL, HFILL }},
26016
26017     {&hf_ieee80211_ff_psmp_sta_info_reserved_large,
26018      {"Reserved", "wlan.fixed.psmp.stainfo.reserved64",
26019       FT_UINT64, BASE_HEX, 0, 0,
26020       NULL, HFILL }},
26021
26022     {&hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
26023      {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan.fixed.psmp.stainfo.multicastid",
26024       FT_UINT64, BASE_HEX, 0, 0,
26025       NULL, HFILL }},
26026
26027     {&hf_ieee80211_ff_ant_selection,
26028      {"Antenna Selection", "wlan.fixed.antsel",
26029       FT_UINT8, BASE_HEX, 0, 0,
26030       NULL, HFILL }},
26031
26032     {&hf_ieee80211_ff_ant_selection_0,
26033      {"Antenna 0", "wlan.fixed.antsel.ant0",
26034       FT_UINT8, BASE_HEX, 0, 0x01,
26035       NULL, HFILL }},
26036
26037     {&hf_ieee80211_ff_ant_selection_1,
26038      {"Antenna 1", "wlan.fixed.antsel.ant1",
26039       FT_UINT8, BASE_HEX, 0, 0x02,
26040       NULL, HFILL }},
26041
26042     {&hf_ieee80211_ff_ant_selection_2,
26043      {"Antenna 2", "wlan.fixed.antsel.ant2",
26044       FT_UINT8, BASE_HEX, 0, 0x04,
26045       NULL, HFILL }},
26046
26047     {&hf_ieee80211_ff_ant_selection_3,
26048      {"Antenna 3", "wlan.fixed.antsel.ant3",
26049       FT_UINT8, BASE_HEX, 0, 0x08,
26050       NULL, HFILL }},
26051
26052     {&hf_ieee80211_ff_ant_selection_4,
26053      {"Antenna 4", "wlan.fixed.antsel.ant4",
26054       FT_UINT8, BASE_HEX, 0, 0x10,
26055       NULL, HFILL }},
26056
26057     {&hf_ieee80211_ff_ant_selection_5,
26058      {"Antenna 5", "wlan.fixed.antsel.ant5",
26059       FT_UINT8, BASE_HEX, 0, 0x20,
26060       NULL, HFILL }},
26061
26062     {&hf_ieee80211_ff_ant_selection_6,
26063      {"Antenna 6", "wlan.fixed.antsel.ant6",
26064       FT_UINT8, BASE_HEX, 0, 0x40,
26065       NULL, HFILL }},
26066
26067     {&hf_ieee80211_ff_ant_selection_7,
26068      {"Antenna 7", "wlan.fixed.antsel.ant7",
26069       FT_UINT8, BASE_HEX, 0, 0x80,
26070       NULL, HFILL }},
26071
26072     {&hf_ieee80211_ff_ext_channel_switch_announcement,
26073      {"Extended Channel Switch Announcement", "wlan.fixed.extchansw",
26074       FT_UINT32, BASE_HEX, 0, 0,
26075       NULL, HFILL }},
26076
26077     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
26078      {"Channel Switch Mode", "wlan.fixed.extchansw.switchmode",
26079       FT_UINT32, BASE_HEX, VALS(ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags), 0x000000FF,
26080       NULL, HFILL }},
26081
26082     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
26083      {"New Operating Class", "wlan.fixed.extchansw.new.opeclass",
26084       FT_UINT32, BASE_HEX, NULL, 0x0000FF00,
26085       NULL, HFILL }},
26086
26087     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
26088      {"New Channel Number", "wlan.fixed.extchansw.new.channumber",
26089       FT_UINT32, BASE_HEX, NULL, 0x00FF0000,
26090       NULL, HFILL }},
26091
26092     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
26093      {"Channel Switch Count", "wlan.extchanswitch.switchcount",
26094       FT_UINT32, BASE_HEX, NULL, 0xFF000000,
26095       NULL, HFILL }},
26096
26097     {&hf_ieee80211_ff_ht_info,
26098      {"HT Information", "wlan.fixed.extchansw",
26099       FT_UINT8, BASE_HEX, 0, 0,
26100       "HT Information Fixed Field", HFILL }},
26101
26102     {&hf_ieee80211_ff_ht_info_information_request,
26103      {"Information Request", "wlan.fixed.mimo.control.chanwidth",
26104       FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01,
26105       NULL, HFILL }},
26106
26107     {&hf_ieee80211_ff_ht_info_40_mhz_intolerant,
26108      {"40 MHz Intolerant", "wlan.fixed.mimo.control.chanwidth",
26109       FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02,
26110       NULL, HFILL }},
26111
26112     {&hf_ieee80211_ff_ht_info_sta_chan_width,
26113      {"Station Channel Width", "wlan.fixed.mimo.control.chanwidth",
26114       FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04,
26115       NULL, HFILL }},
26116
26117     {&hf_ieee80211_ff_ht_info_reserved,
26118      {"Reserved", "wlan.fixed.extchansw",
26119       FT_UINT8, BASE_HEX, 0, 0xF8,
26120       "Reserved Field", HFILL }},
26121
26122     {&hf_ieee80211_ff_ht_action,
26123      {"HT Action", "wlan.fixed.htact",
26124       FT_UINT8, BASE_HEX, VALS(ff_ht_action_flags), 0,
26125       "HT Action Code", HFILL }},
26126
26127     {&hf_ieee80211_ff_mimo_csi_snr,
26128      {"Signal to Noise Ratio (SNR)", "wlan.mimo.csimatrices.snr",
26129       FT_UINT8, BASE_HEX, NULL, 0,
26130       NULL, HFILL }},
26131
26132     {&hf_ieee80211_ff_mimo_csi_matrices,
26133      {"CSI Matrices", "wlan.mimo.csimatrices",
26134       FT_NONE, BASE_NONE, NULL, 0,
26135       NULL, HFILL }},
26136
26137     {&hf_ieee80211_ff_mimo_csi_bf_matrices,
26138      {"Beamforming Feedback Matrices", "wlan.mimo.csimatrices.bf",
26139       FT_NONE, BASE_NONE, NULL, 0,
26140       NULL, HFILL }},
26141
26142     {&hf_ieee80211_ff_mimo_csi_cbf_matrices,
26143      {"Compressed Beamforming Feedback Matrices", "wlan.mimo.csimatrices.cbf",
26144       FT_NONE, BASE_NONE, NULL, 0,
26145       NULL, HFILL }},
26146     {&hf_ieee80211_ff_public_action,
26147      {"Public Action", "wlan.fixed.publicact",
26148       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_pa_action_codes_ext, 0,
26149       "Public Action Code", HFILL }},
26150
26151     {&hf_ieee80211_ff_protected_public_action,
26152      {"Protected Public Action", "wlan.fixed.publicact",
26153       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_ppa_action_codes_ext, 0,
26154       "Protected Public Action Code", HFILL }},
26155
26156     {&hf_ieee80211_ff_capture,
26157      {"Capabilities Information", "wlan.fixed.capabilities",
26158       FT_UINT16, BASE_HEX, NULL, 0,
26159       "Capability information", HFILL }},
26160
26161     {&hf_ieee80211_ff_cf_ess,
26162      {"ESS capabilities", "wlan.fixed.capabilities.ess",
26163       FT_BOOLEAN, 16, TFS(&cf_ess_flags), 0x0001,
26164       NULL, HFILL }},
26165
26166     {&hf_ieee80211_ff_cf_ibss,
26167      {"IBSS status", "wlan.fixed.capabilities.ibss",
26168       FT_BOOLEAN, 16, TFS(&cf_ibss_flags), 0x0002,
26169       "IBSS participation", HFILL }},
26170
26171     {&hf_ieee80211_ff_cf_sta_poll,
26172      {"CFP participation capabilities", "wlan.fixed.capabilities.cfpoll.sta",
26173       FT_UINT16, BASE_HEX, VALS(sta_cf_pollable), 0x020C,
26174       "CF-Poll capabilities for a STA", HFILL }},
26175
26176     {&hf_ieee80211_ff_cf_ap_poll,
26177      {"CFP participation capabilities", "wlan.fixed.capabilities.cfpoll.ap",
26178       FT_UINT16, BASE_HEX, VALS(ap_cf_pollable), 0x020C,
26179       "CF-Poll capabilities for an AP", HFILL }},
26180
26181     {&hf_ieee80211_ff_cf_privacy,
26182      {"Privacy", "wlan.fixed.capabilities.privacy",
26183       FT_BOOLEAN, 16, TFS(&cf_privacy_flags), 0x0010,
26184       "WEP support", HFILL }},
26185
26186     {&hf_ieee80211_ff_cf_preamble,
26187      {"Short Preamble", "wlan.fixed.capabilities.preamble",
26188       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0020,
26189       NULL, HFILL }},
26190
26191     {&hf_ieee80211_ff_cf_pbcc,
26192      {"PBCC", "wlan.fixed.capabilities.pbcc",
26193       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0040,
26194       "PBCC Modulation", HFILL }},
26195
26196     {&hf_ieee80211_ff_cf_agility,
26197      {"Channel Agility", "wlan.fixed.capabilities.agility",
26198       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0080,
26199       NULL, HFILL }},
26200
26201     {&hf_ieee80211_ff_cf_spec_man,
26202      {"Spectrum Management", "wlan.fixed.capabilities.spec_man",
26203       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0100,
26204       NULL, HFILL }},
26205
26206     {&hf_ieee80211_ff_short_slot_time,
26207      {"Short Slot Time", "wlan.fixed.capabilities.short_slot_time",
26208       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0400,
26209       NULL, HFILL }},
26210
26211     {&hf_ieee80211_ff_cf_apsd,
26212      {"Automatic Power Save Delivery", "wlan.fixed.capabilities.apsd",
26213       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0800,
26214       NULL, HFILL }},
26215
26216     {&hf_ieee80211_ff_radio_measurement,
26217      {"Radio Measurement", "wlan.fixed.capabilities.radio_measurement",
26218       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x1000,
26219       NULL, HFILL }},
26220
26221     {&hf_ieee80211_ff_dsss_ofdm,
26222      {"DSSS-OFDM", "wlan.fixed.capabilities.dsss_ofdm",
26223       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x2000,
26224       "DSSS-OFDM Modulation", HFILL }},
26225
26226     {&hf_ieee80211_ff_cf_del_blk_ack,
26227      {"Delayed Block Ack", "wlan.fixed.capabilities.del_blk_ack",
26228       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x4000,
26229       NULL, HFILL }},
26230
26231     {&hf_ieee80211_ff_cf_imm_blk_ack,
26232      {"Immediate Block Ack", "wlan.fixed.capabilities.imm_blk_ack",
26233       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x8000,
26234       NULL, HFILL }},
26235
26236     {&hf_ieee80211_ff_auth_seq,
26237      {"Authentication SEQ", "wlan.fixed.auth_seq",
26238       FT_UINT16, BASE_HEX, NULL, 0,
26239       "Authentication Sequence Number", HFILL }},
26240
26241     {&hf_ieee80211_ff_assoc_id,
26242      {"Association ID", "wlan.fixed.aid",
26243       FT_UINT16, BASE_HEX, NULL, 0x3FFF,
26244       NULL, HFILL }},
26245
26246     {&hf_ieee80211_ff_listen_ival,
26247      {"Listen Interval", "wlan.fixed.listen_ival",
26248       FT_UINT16, BASE_HEX, NULL, 0,
26249       NULL, HFILL }},
26250
26251     {&hf_ieee80211_ff_current_ap,
26252      {"Current AP", "wlan.fixed.current_ap",
26253       FT_ETHER, BASE_NONE, NULL, 0,
26254       "MAC address of current AP", HFILL }},
26255
26256     {&hf_ieee80211_ff_reason,
26257      {"Reason code", "wlan.fixed.reason_code",
26258       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
26259       "Reason for unsolicited notification", HFILL }},
26260
26261     {&hf_ieee80211_ff_status_code,
26262      {"Status code", "wlan.fixed.status_code",
26263       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
26264       "Status of requested event", HFILL }},
26265
26266     {&hf_ieee80211_ff_category_code,
26267      {"Category code", "wlan.fixed.category_code",
26268       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &category_codes_ext, 0,
26269       "Management action category", HFILL }},
26270
26271     {&hf_ieee80211_ff_action_code,
26272      {"Action code", "wlan.fixed.action_code",
26273       FT_UINT16, BASE_DEC, VALS(action_codes), 0,
26274       "Management action code", HFILL }},
26275
26276     {&hf_ieee80211_ff_dialog_token,
26277      {"Dialog token", "wlan.fixed.dialog_token",
26278       FT_UINT8, BASE_HEX, NULL, 0,
26279       "Management action dialog token", HFILL }},
26280
26281     {&hf_ieee80211_ff_followup_dialog_token,
26282      {"Followup Dialog token", "wlan.fixed.followup_dialog_token",
26283       FT_UINT8, BASE_HEX, NULL, 0,
26284       "Management action followup dialog token", HFILL }},
26285
26286     {&hf_ieee80211_ff_marvell_action_type,
26287      {"Marvell Action type", "wlan.fixed.mrvl_action_type",
26288       FT_UINT8, BASE_DEC, VALS(vendor_action_types_mrvl), 0,
26289       "Vendor Specific Action Type (Marvell)", HFILL }},
26290
26291     {&hf_ieee80211_ff_marvell_mesh_mgt_action_code,
26292      {"Mesh action(Marvell)", "wlan.fixed.mrvl_mesh_action",
26293       FT_UINT8, BASE_HEX, VALS(mesh_mgt_action_codes_mrvl), 0,
26294       "Mesh action code(Marvell)", HFILL }},
26295
26296     {&hf_ieee80211_ff_marvell_mesh_mgt_length,
26297      {"Message Length", "wlan.fixed.length",
26298       FT_UINT8, BASE_DEC, NULL, 0,
26299       NULL, HFILL }},
26300
26301     {&hf_ieee80211_ff_marvell_mesh_mgt_mode,
26302      {"Message Mode", "wlan.fixed.mode",
26303       FT_UINT8, BASE_HEX, NULL, 0,
26304       NULL, HFILL }},
26305
26306     {&hf_ieee80211_ff_marvell_mesh_mgt_ttl,
26307      {"Message TTL", "wlan.fixed.ttl",
26308       FT_UINT8, BASE_DEC, NULL, 0,
26309       NULL, HFILL }},
26310
26311     {&hf_ieee80211_ff_marvell_mesh_mgt_dstcount,
26312      {"Destination Count", "wlan.fixed.dstcount",
26313       FT_UINT8, BASE_DEC, NULL, 0,
26314       NULL, HFILL }},
26315
26316     {&hf_ieee80211_ff_marvell_mesh_mgt_hopcount,
26317      {"Hop Count", "wlan.fixed.hopcount",
26318       FT_UINT8, BASE_DEC, NULL, 0,
26319       NULL, HFILL }},
26320
26321     {&hf_ieee80211_ff_marvell_mesh_mgt_rreqid,
26322      {"RREQ ID", "wlan.fixed.rreqid",
26323       FT_UINT32, BASE_DEC, NULL, 0,
26324       NULL, HFILL }},
26325
26326     {&hf_ieee80211_ff_marvell_mesh_mgt_sa,
26327      {"Source Address", "wlan.fixed.sa",
26328       FT_ETHER, BASE_NONE, NULL, 0,
26329       "Source MAC address", HFILL }},
26330
26331     {&hf_ieee80211_ff_marvell_mesh_mgt_ssn,
26332      {"SSN", "wlan.fixed.ssn",
26333       FT_UINT32, BASE_DEC, NULL, 0,
26334       "Source Sequence Number", HFILL }},
26335
26336     {&hf_ieee80211_ff_marvell_mesh_mgt_metric,
26337      {"Metric", "wlan.fixed.metric",
26338       FT_UINT32, BASE_DEC, NULL, 0,
26339       "Route Metric", HFILL }},
26340
26341     {&hf_ieee80211_ff_marvell_mesh_mgt_flags,
26342      {"RREQ Flags", "wlan.fixed.hopcount",
26343       FT_UINT8, BASE_HEX, NULL, 0,
26344       NULL, HFILL }},
26345
26346     {&hf_ieee80211_ff_marvell_mesh_mgt_da,
26347      {"Destination Address", "wlan.fixed.da",
26348       FT_ETHER, BASE_NONE, NULL, 0,
26349       "Destination MAC address", HFILL }},
26350
26351     {&hf_ieee80211_ff_marvell_mesh_mgt_dsn,
26352      {"DSN", "wlan.fixed.dsn",
26353       FT_UINT32, BASE_DEC, NULL, 0,
26354       "Destination Sequence Number", HFILL }},
26355
26356     {&hf_ieee80211_ff_marvell_mesh_mgt_lifetime,
26357      {"Lifetime", "wlan.fixed.lifetime",
26358       FT_UINT32, BASE_DEC, NULL, 0,
26359       "Route Lifetime", HFILL }},
26360
26361     {&hf_ieee80211_ff_wme_action_code,
26362      {"Action code", "wlan.fixed.action_code",
26363       FT_UINT16, BASE_HEX, VALS(wme_action_codes), 0,
26364       "Management notification action code", HFILL }},
26365
26366     {&hf_ieee80211_ff_wme_status_code,
26367      {"Status code", "wlan.fixed.status_code",
26368       FT_UINT16, BASE_HEX, VALS(wme_status_codes), 0,
26369       "Management notification setup response status code", HFILL }},
26370
26371     {&hf_ieee80211_ff_mesh_action,
26372      {"Mesh Action code", "wlan.fixed.mesh_action",
26373       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &mesh_action_ext, 0,
26374       NULL, HFILL }},
26375
26376     {&hf_ieee80211_ff_multihop_action,
26377      {"Multihop Action code", "wlan.fixed.multihop_action",
26378       FT_UINT8, BASE_HEX, VALS(multihop_action), 0,
26379       NULL, HFILL }},
26380
26381     {&hf_ieee80211_ff_mesh_flags,
26382      {"Mesh Flags", "wlan.fixed.mesh_flags",
26383       FT_UINT8, BASE_HEX, NULL, 0,
26384       NULL, HFILL }},
26385
26386     {&hf_ieee80211_ff_mesh_ttl,
26387      {"Mesh TTL", "wlan.fixed.mesh_ttl",
26388       FT_UINT8, BASE_HEX, NULL, 0,
26389       NULL, HFILL }},
26390
26391     {&hf_ieee80211_ff_mesh_sequence,
26392      {"Sequence Number", "wlan.fixed.mesh_sequence",
26393       FT_UINT32, BASE_HEX, NULL, 0,
26394       NULL, HFILL }},
26395
26396     {&hf_ieee80211_ff_mesh_addr4,
26397      {"Mesh Extended Address 4", "wlan.fixed.mesh_addr4",
26398       FT_ETHER, BASE_NONE, NULL, 0,
26399       NULL, HFILL }},
26400
26401     {&hf_ieee80211_ff_mesh_addr5,
26402      {"Mesh Extended Address 5", "wlan.fixed.mesh_addr5",
26403       FT_ETHER, BASE_NONE, NULL, 0,
26404       NULL, HFILL }},
26405
26406     {&hf_ieee80211_ff_mesh_addr6,
26407      {"Mesh Extended Address 6", "wlan.fixed.mesh_addr6",
26408       FT_ETHER, BASE_NONE, NULL, 0,
26409       NULL, HFILL }},
26410
26411     {&hf_ieee80211_ff_selfprot_action,
26412      {"Self-protected Action code", "wlan.fixed.selfprot_action",
26413       FT_UINT8, BASE_HEX, VALS(selfprot_action), 0,
26414       NULL, HFILL }},
26415
26416     {&hf_ieee80211_mesh_peering_proto,
26417      {"Mesh Peering Protocol ID", "wlan.peering.proto",
26418       FT_UINT16, BASE_HEX, VALS(mesh_peering_proto_ids), 0,
26419       NULL, HFILL }},
26420
26421     {&hf_ieee80211_mesh_peering_local_link_id,
26422      {"Local Link ID", "wlan.peering.local_id",
26423       FT_UINT16, BASE_HEX, NULL, 0,
26424       "Mesh Peering Management Local Link ID", HFILL }},
26425
26426     {&hf_ieee80211_mesh_peering_peer_link_id,
26427      {"Peer Link ID", "wlan.peering.peer_id",
26428       FT_UINT16, BASE_HEX, NULL, 0,
26429       "Mesh Peering Management Peer Link ID", HFILL }},
26430
26431     {&hf_ieee80211_ff_hwmp_flags,
26432      {"HWMP Flags", "wlan.hwmp.flags",
26433       FT_UINT8, BASE_HEX, NULL, 0,
26434       NULL, HFILL }},
26435
26436     {&hf_ieee80211_ff_hwmp_hopcount,
26437      {"HWMP Hop Count", "wlan.hwmp.hopcount",
26438       FT_UINT8, BASE_DEC, NULL, 0,
26439       NULL, HFILL }},
26440
26441     {&hf_ieee80211_ff_hwmp_ttl,
26442      {"HWMP TTL", "wlan.hwmp.ttl",
26443       FT_UINT8, BASE_DEC, NULL, 0,
26444       NULL, HFILL }},
26445
26446     {&hf_ieee80211_ff_hwmp_pdid,
26447      {"HWMP Path Discovery ID", "wlan.hwmp.pdid",
26448       FT_UINT32, BASE_DEC, NULL, 0,
26449       NULL, HFILL }},
26450
26451     {&hf_ieee80211_ff_hwmp_orig_sta,
26452      {"Originator STA Address", "wlan.hwmp.orig_sta",
26453       FT_ETHER, BASE_NONE, NULL, 0,
26454       NULL, HFILL }},
26455
26456     {&hf_ieee80211_ff_hwmp_orig_sn,
26457      {"HWMP Originator Sequence Number", "wlan.hwmp.orig_sn",
26458       FT_UINT32, BASE_DEC, NULL, 0,
26459       NULL, HFILL}},
26460
26461     {&hf_ieee80211_ff_hwmp_orig_ext,
26462      {"Originator External Address", "wlan.hwmp.orig_ext",
26463       FT_ETHER, BASE_NONE, NULL, 0,
26464       NULL, HFILL }},
26465
26466     {&hf_ieee80211_ff_hwmp_lifetime,
26467      {"HWMP Lifetime", "wlan.hwmp.lifetime",
26468       FT_UINT32, BASE_DEC, NULL, 0,
26469       NULL, HFILL }},
26470
26471     {&hf_ieee80211_ff_hwmp_metric,
26472      {"HWMP Metric", "wlan.hwmp.metric",
26473       FT_UINT32, BASE_DEC, NULL, 0,
26474       NULL, HFILL }},
26475
26476     {&hf_ieee80211_ff_hwmp_targ_count,
26477      {"HWMP Target Count", "wlan.hwmp.targ_count",
26478       FT_UINT8, BASE_DEC, NULL, 0,
26479       NULL, HFILL }},
26480
26481     {&hf_ieee80211_ff_hwmp_targ_flags,
26482      {"HWMP Per-Target Flags", "wlan.hwmp.targ_flags",
26483       FT_UINT8, BASE_HEX, NULL, 0,
26484       NULL, HFILL }},
26485
26486     {&hf_ieee80211_ff_hwmp_targ_to_flags,
26487      {"TO Flag", "wlan.hwmp.to_flag",
26488       FT_BOOLEAN, 8, TFS(&hwmp_targ_to_flags), 0x01,
26489       "Target Only Flag", HFILL }},
26490
26491     {&hf_ieee80211_ff_hwmp_targ_usn_flags,
26492      {"USN Flag", "wlan.hwmp.usn_flag",
26493       FT_BOOLEAN, 8, TFS(&hwmp_targ_usn_flags), 0x04,
26494       "Unknown Target HWMP Sequence Number Flag", HFILL }},
26495
26496     {&hf_ieee80211_ff_hwmp_targ_sta,
26497      {"Target STA Address", "wlan.hwmp.targ_sta",
26498       FT_ETHER, BASE_NONE, NULL, 0,
26499       NULL, HFILL }},
26500
26501     {&hf_ieee80211_ff_hwmp_targ_ext,
26502      {"Target External Address", "wlan.hwmp.targ_ext",
26503       FT_ETHER, BASE_NONE, NULL, 0,
26504       NULL, HFILL }},
26505
26506     {&hf_ieee80211_ff_hwmp_targ_sn,
26507      {"Target HWMP Sequence Number", "wlan.hwmp.targ_sn",
26508       FT_UINT32, BASE_DEC, NULL, 0,
26509       NULL, HFILL }},
26510
26511     {&hf_ieee80211_mesh_config_path_sel_protocol,
26512      {"Path Selection Protocol", "wlan.mesh.config.ps_protocol",
26513       FT_UINT8, BASE_HEX, NULL, 0,
26514       "Mesh Configuration Path Selection Protocol", HFILL }},
26515
26516     {&hf_ieee80211_mesh_config_path_sel_metric,
26517      {"Path Selection Metric", "wlan.mesh.config.ps_metric",
26518       FT_UINT8, BASE_HEX, NULL, 0,
26519       "Mesh Configuration Path Selection Metric", HFILL }},
26520
26521     {&hf_ieee80211_mesh_config_congestion_control,
26522      {"Congestion Control", "wlan.mesh.config.cong_ctl",
26523       FT_UINT8, BASE_HEX, NULL, 0,
26524       "Mesh Configuration Congestion Control", HFILL }},
26525
26526     {&hf_ieee80211_mesh_config_sync_method,
26527      {"Synchronization Method", "wlan.mesh.config.sync_method",
26528       FT_UINT8, BASE_HEX, NULL, 0,
26529       "Mesh Configuration Synchronization Method", HFILL }},
26530
26531     {&hf_ieee80211_mesh_config_auth_protocol,
26532      {"Authentication Protocol", "wlan.mesh.config.auth_protocol",
26533       FT_UINT8, BASE_HEX, NULL, 0,
26534       "Mesh Configuration Authentication Protocol", HFILL }},
26535
26536     {&hf_ieee80211_mesh_config_formation_info,
26537      {"Formation Info", "wlan.mesh.config.formation_info",
26538       FT_UINT8, BASE_HEX, NULL, 0,
26539       "Mesh Configuration Formation Info", HFILL }},
26540
26541     {&hf_ieee80211_mesh_form_info_num_of_peerings,
26542      {"Number of Peerings", "wlan.mesh.config.formation_info.num_peers",
26543       FT_UINT8, BASE_DEC, NULL, 0x7E,
26544       NULL, HFILL }},
26545
26546     {&hf_ieee80211_mesh_config_capability,
26547      {"Capability", "wlan.mesh.config.cap",
26548       FT_UINT8, BASE_HEX, NULL, 0,
26549       "Mesh Configuration Capability", HFILL }},
26550
26551     {&hf_ieee80211_mesh_config_cap_accepting,
26552      {"Accepting Additional Mesh Peerings", "wlan.mesh.config.cap.accept",
26553       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
26554       NULL, HFILL }},
26555
26556     {&hf_ieee80211_mesh_config_cap_mcca_support,
26557      {"MCCA Support", "wlan.mesh.config.cap.mcca_support",
26558       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
26559       NULL, HFILL }},
26560
26561     {&hf_ieee80211_mesh_config_cap_mcca_enabled,
26562      {"MCCA Enabled", "wlan.mesh.config.cap.mcca_enabled",
26563       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
26564       NULL, HFILL }},
26565
26566     {&hf_ieee80211_mesh_config_cap_forwarding,
26567      {"Mesh Forwarding", "wlan.mesh.config.cap.forwarding",
26568       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08,
26569       NULL, HFILL }},
26570
26571     {&hf_ieee80211_mesh_config_cap_mbca_enabled,
26572      {"MBCA Enabled", "wlan.mesh.config.cap.mbca_enabled",
26573       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
26574       NULL, HFILL }},
26575
26576     {&hf_ieee80211_mesh_config_cap_tbtt_adjusting,
26577      {"TBTT Adjustment", "wlan.mesh.config.cap.tbtt_adjusting",
26578       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20,
26579       NULL, HFILL }},
26580
26581     {&hf_ieee80211_mesh_config_cap_power_save_level,
26582      {"Power Save", "wlan.mesh.config.cap.power_save_level",
26583       FT_BOOLEAN, 8, TFS(&mesh_config_cap_power_save_level_flags), 0x40,
26584       NULL, HFILL }},
26585
26586     {&hf_ieee80211_mesh_id,
26587      {"Mesh ID", "wlan.mesh.id",
26588       FT_STRING, BASE_NONE, NULL, 0,
26589       NULL, HFILL }},
26590
26591     {&hf_ieee80211_rann_flags,
26592      {"RANN Flags", "wlan.rann.flags",
26593       FT_UINT8, BASE_HEX, NULL, 0,
26594       "Root Announcement Flags", HFILL }},
26595
26596     {&hf_ieee80211_rann_root_sta,
26597      {"Root STA Address", "wlan.rann.root_sta", FT_ETHER, BASE_NONE, NULL, 0,
26598       "Root Mesh STA Address", HFILL }},
26599
26600     {&hf_ieee80211_rann_sn,
26601      {"Root STA Sequence Number", "wlan.rann.rann_sn",
26602       FT_UINT32, BASE_DEC, NULL, 0,
26603       "Root Mesh STA Sequence Number", HFILL }},
26604
26605     {&hf_ieee80211_rann_interval,
26606      {"RANN Interval", "wlan.rann.interval",
26607       FT_UINT32, BASE_DEC, NULL, 0,
26608       "Root Announcement Interval", HFILL }},
26609
26610     {&hf_ieee80211_ff_qos_action_code,
26611      {"Action code", "wlan.fixed.action_code",
26612       FT_UINT16, BASE_HEX, VALS(qos_action_codes), 0,
26613       "QoS management action code", HFILL }},
26614
26615     {&hf_ieee80211_ff_ba_action,
26616      {"Action code", "wlan.fixed.action_code",
26617       FT_UINT8, BASE_HEX, VALS(ba_action_codes), 0,
26618       "Block Ack action code", HFILL }},
26619
26620     {&hf_ieee80211_ff_check_beacon,
26621      {"Check Beacon", "wlan.fixed.check_beacon",
26622       FT_UINT8, BASE_DEC, NULL, 0,
26623       "Unprotected WNM Check Beacon", HFILL }},
26624
26625     {&hf_ieee80211_ff_tod,
26626      {"TOD", "wlan.fixed.tod",
26627       FT_UINT32, BASE_DEC, NULL, 0,
26628       "Previous TS of transmit antenna port", HFILL }},
26629
26630     {&hf_ieee80211_ff_toa,
26631      {"TOA", "wlan.fixed.toa",
26632       FT_UINT32, BASE_DEC, NULL, 0,
26633       "Previous TS of receive antenna port", HFILL }},
26634
26635     {&hf_ieee80211_ff_max_tod_err,
26636      {"MAX TOD ERROR", "wlan.fixed.max_tod_err",
26637       FT_UINT8, BASE_DEC, NULL, 0,
26638       "Maximal Error at Previous TS of transmit antenna port", HFILL }},
26639
26640     {&hf_ieee80211_ff_max_toa_err,
26641      {"MAX TOA ERROR", "wlan.fixed.max_toa_err",
26642       FT_UINT8, BASE_DEC, NULL, 0,
26643       "Maximal Error at Previous TS of receive antenna port", HFILL }},
26644
26645     {&hf_ieee80211_ff_dls_action_code,
26646      {"Action code", "wlan.fixed.action_code",
26647       FT_UINT16, BASE_HEX, VALS(dls_action_codes), 0,
26648       "DLS management action code", HFILL }},
26649
26650     {&hf_ieee80211_ff_dst_mac_addr,
26651      {"Destination address", "wlan.fixed.dst_mac_addr",
26652       FT_ETHER, BASE_NONE, NULL, 0,
26653       "Destination MAC address", HFILL }},
26654
26655     {&hf_ieee80211_ff_src_mac_addr,
26656      {"Source address", "wlan.fixed.src_mac_addr",
26657       FT_ETHER, BASE_NONE, NULL, 0,
26658       "Source MAC address", HFILL }},
26659
26660     {&hf_ieee80211_ff_req_ap_addr,
26661      {"RequesterAP address", "wlan.fixed.req_ap_addr",
26662       FT_ETHER, BASE_NONE, NULL, 0,
26663       NULL, HFILL }},
26664
26665     {&hf_ieee80211_ff_res_ap_addr,
26666      {"ResponderAP address", "wlan.fixed.res_ap_addr",
26667       FT_ETHER, BASE_NONE, NULL, 0,
26668       NULL, HFILL }},
26669
26670     {&hf_ieee80211_ff_ft_action_code,
26671      {"Action code", "wlan.fixed.action_code",
26672       FT_UINT8, BASE_DEC, VALS(ft_action_codes), 0,
26673       "Management action code", HFILL }},
26674
26675     {&hf_ieee80211_ff_sta_address,
26676      {"STA Address", "wlan.fixed.sta_address",
26677       FT_ETHER, BASE_NONE, NULL, 0,
26678       NULL, HFILL }},
26679
26680     {&hf_ieee80211_ff_target_ap_address,
26681      {"Target AP Address", "wlan.fixed.target_ap_address",
26682       FT_ETHER, BASE_NONE, NULL, 0,
26683       "Target AP MAC address", HFILL }},
26684
26685     {&hf_ieee80211_ff_gas_comeback_delay,
26686      {"GAS Comeback Delay", "wlan.fixed.gas_comeback_delay",
26687       FT_UINT16, BASE_DEC, NULL, 0,
26688       NULL, HFILL }},
26689
26690     {&hf_ieee80211_ff_gas_fragment_id,
26691      {"GAS Query Response Fragment ID", "wlan.fixed.gas_fragment_id",
26692       FT_UINT8, BASE_DEC, NULL, 0x7f,
26693       NULL, HFILL }},
26694
26695     {&hf_ieee80211_ff_more_gas_fragments,
26696      {"More GAS Fragments", "wlan.fixed.more_gas_fragments",
26697       FT_UINT8, BASE_DEC, NULL, 0x80,
26698       NULL, HFILL }},
26699
26700     {&hf_ieee80211_ff_query_request_length,
26701      {"Query Request Length", "wlan.fixed.query_request_length",
26702       FT_UINT16, BASE_DEC, NULL, 0,
26703       NULL, HFILL }},
26704
26705     {&hf_ieee80211_ff_query_request,
26706      {"Query Request", "wlan.fixed.query_request",
26707       FT_BYTES, BASE_NONE, NULL, 0,
26708       NULL, HFILL }},
26709
26710     {&hf_ieee80211_ff_query_response_length,
26711      {"Query Response Length", "wlan.fixed.query_response_length",
26712       FT_UINT16, BASE_DEC, NULL, 0,
26713       NULL, HFILL }},
26714
26715     {&hf_ieee80211_ff_query_response,
26716      {"Query Response", "wlan.fixed.query_response",
26717       FT_BYTES, BASE_NONE, NULL, 0,
26718       NULL, HFILL }},
26719
26720     {&hf_ieee80211_gas_resp_fragments,
26721      {"GAS Query Response fragments", "wlan.fixed.fragments",
26722       FT_NONE, BASE_NONE, NULL, 0x00,
26723       NULL, HFILL } },
26724
26725     {&hf_ieee80211_gas_resp_fragment,
26726      {"GAS Query Response fragment", "wlan.fixed.fragment",
26727       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
26728       NULL, HFILL } },
26729
26730     {&hf_ieee80211_gas_resp_fragment_overlap,
26731      {"GAS Query Response fragment overlap", "wlan.fixed.fragment.overlap",
26732       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
26733       NULL, HFILL } },
26734
26735     {&hf_ieee80211_gas_resp_fragment_overlap_conflict,
26736      {"GAS Query Response fragment overlapping with conflicting data", "wlan.fixed.fragment.overlap.conflicts",
26737       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
26738       NULL, HFILL } },
26739
26740     {&hf_ieee80211_gas_resp_fragment_multiple_tails,
26741      {"GAS Query Response has multiple tail fragments",  "wlan.fixed.fragment.multiple_tails",
26742       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
26743       NULL, HFILL } },
26744
26745     {&hf_ieee80211_gas_resp_fragment_too_long_fragment,
26746      {"GAS Query Response fragment too long", "wlan.fixed.fragment.too_long_fragment",
26747       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
26748       NULL, HFILL } },
26749
26750     {&hf_ieee80211_gas_resp_fragment_error,
26751      {"GAS Query Response reassembly error", "wlan.fixed.fragment.error",
26752       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
26753       NULL, HFILL } },
26754
26755     {&hf_ieee80211_gas_resp_fragment_count,
26756      {"GAS Query Response fragment count", "wlan.fixed.fragment.count",
26757       FT_UINT32, BASE_DEC, NULL, 0x00,
26758       NULL, HFILL } },
26759
26760     {&hf_ieee80211_gas_resp_reassembled_in,
26761      {"Reassembled in", "wlan.fixed.reassembled.in",
26762       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
26763       NULL, HFILL } },
26764
26765     {&hf_ieee80211_gas_resp_reassembled_length,
26766      {"Reassembled length", "wlan.fixed.reassembled.length",
26767       FT_UINT32, BASE_DEC, NULL, 0x00,
26768       NULL, HFILL } },
26769
26770     {&hf_ieee80211_ff_anqp_info_id,
26771      {"Info ID", "wlan.fixed.anqp.info_id",
26772       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
26773       "Access Network Query Protocol Info ID", HFILL }},
26774
26775     {&hf_ieee80211_ff_anqp_info_length,
26776      {"Length", "wlan.fixed.anqp.info_length",
26777       FT_UINT16, BASE_DEC, NULL, 0,
26778       "Access Network Query Protocol Length", HFILL }},
26779
26780     {&hf_ieee80211_ff_anqp_info,
26781      {"Information", "wlan.fixed.anqp.info",
26782       FT_BYTES, BASE_NONE, NULL, 0,
26783       "Access Network Query Protocol Information", HFILL }},
26784
26785     {&hf_ieee80211_ff_anqp_query_id,
26786      {"ANQP Query ID", "wlan.fixed.anqp.query_id",
26787       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
26788       "Access Network Query Protocol Query ID", HFILL }},
26789
26790     {&hf_ieee80211_ff_anqp_capability,
26791      {"ANQP Capability", "wlan.fixed.anqp.capability",
26792       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
26793       "Access Network Query Protocol Query ID", HFILL }},
26794
26795     {&hf_ieee80211_ff_anqp_capability_vlen,
26796      {"Vendor-specific Capability Length", "wlan.fixed.anqp.capability_vlen",
26797       FT_UINT16, BASE_DEC, NULL, 0,
26798       NULL, HFILL }},
26799
26800     {&hf_ieee80211_ff_anqp_capability_vendor,
26801      {"Vendor-specific Capability", "wlan.fixed.anqp.capability_vendor",
26802       FT_BYTES, BASE_NONE, NULL, 0,
26803       NULL, HFILL }},
26804
26805     {&hf_ieee80211_ff_venue_info_group,
26806      {"Venue Group", "wlan.fixed.venue_info.group",
26807       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &venue_group_vals_ext, 0,
26808       NULL, HFILL }},
26809
26810     {&hf_ieee80211_ff_venue_info_type,
26811      {"Venue Type", "wlan.fixed.venue_info.type",
26812       FT_UINT8, BASE_DEC, NULL, 0,
26813       NULL, HFILL }},
26814
26815     {&hf_ieee80211_ff_anqp_venue_length,
26816      {"Venue Name Duple Length", "wlan.fixed.anqp.venue.length",
26817       FT_UINT8, BASE_DEC, NULL, 0,
26818       NULL, HFILL }},
26819
26820     {&hf_ieee80211_ff_anqp_venue_language,
26821      {"Language Code", "wlan.fixed.anqp.venue.language",
26822       FT_STRING, BASE_NONE, NULL, 0,
26823       "Venue Name Language Code", HFILL }},
26824
26825     {&hf_ieee80211_ff_anqp_venue_name,
26826      {"Venue Name", "wlan.fixed.anqp.venue.name",
26827       FT_STRING, BASE_NONE, NULL, 0,
26828       NULL, HFILL }},
26829
26830     {&hf_ieee80211_ff_anqp_nw_auth_type_indicator,
26831      {"Network Authentication Type Indicator", "wlan.fixed.anqp.nw_auth_type.indicator",
26832       FT_UINT8, BASE_DEC, VALS(nw_auth_type_vals), 0,
26833       NULL, HFILL }},
26834
26835     {&hf_ieee80211_ff_anqp_nw_auth_type_url_len,
26836      {"Re-direct URL Length", "wlan.fixed.anqp.nw_auth_type.url_len",
26837       FT_UINT16, BASE_DEC, NULL, 0,
26838       NULL, HFILL }},
26839
26840     {&hf_ieee80211_ff_anqp_nw_auth_type_url,
26841      {"Re-direct URL", "wlan.fixed.anqp.nw_auth_type_url",
26842       FT_STRING, BASE_NONE, NULL, 0,
26843       NULL, HFILL }},
26844
26845     {&hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
26846      {"OI Length", "wlan.fixed.anqp.roaming_consortium.oi_len",
26847       FT_UINT8, BASE_DEC, NULL, 0,
26848       "Roaming Consortium OI Length", HFILL }},
26849
26850     {&hf_ieee80211_ff_anqp_roaming_consortium_oi,
26851      {"OI", "wlan.fixed.anqp.roaming_consortium.oi",
26852       FT_BYTES, BASE_NONE, NULL, 0,
26853       "Roaming Consortium OI", HFILL }},
26854
26855     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
26856      {"IPv6 Address", "wlan.fixed.anqp.ip_addr_availability.ipv6",
26857       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv6_vals), 0x03,
26858       "IP Address Type Availability information for IPv6", HFILL }},
26859
26860     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
26861      {"IPv4 Address", "wlan.fixed.anqp.ip_addr_availability.ipv4",
26862       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv4_vals), 0xfc,
26863       "IP Address Type Availability information for IPv4", HFILL }},
26864
26865     {&hf_ieee80211_ff_anqp_nai_realm_count,
26866      {"NAI Realm Count", "wlan.fixed.anqp.nai_realm_list.count",
26867       FT_UINT16, BASE_DEC, NULL, 0,
26868       NULL, HFILL }},
26869
26870     {&hf_ieee80211_ff_anqp_nai_field_len,
26871      {"NAI Realm Data Field Length", "wlan.fixed.anqp.nai_realm_list.field_len",
26872       FT_UINT16, BASE_DEC, NULL, 0,
26873       NULL, HFILL }},
26874
26875     {&hf_ieee80211_ff_anqp_nai_realm_encoding,
26876      {"NAI Realm Encoding", "wlan.fixed.naqp_nai_realm_list.encoding",
26877       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals), 0x01,
26878       NULL, HFILL }},
26879
26880     {&hf_ieee80211_ff_anqp_nai_realm_length,
26881      {"NAI Realm Length", "wlan.fixed.naqp_nai_realm_list.realm_length",
26882       FT_UINT8, BASE_DEC, NULL, 0,
26883       NULL, HFILL }},
26884
26885     {&hf_ieee80211_ff_anqp_nai_realm,
26886      {"NAI Realm", "wlan.fixed.naqp_nai_realm_list.realm",
26887       FT_STRING, BASE_NONE, NULL, 0,
26888       NULL, HFILL }},
26889
26890     {&hf_ieee80211_ff_anqp_nai_realm_eap_count,
26891      {"EAP Method Count", "wlan.fixed.naqp_nai_realm_list.eap_method_count",
26892       FT_UINT8, BASE_DEC, NULL, 0,
26893       NULL, HFILL }},
26894
26895     {&hf_ieee80211_ff_anqp_nai_realm_eap_len,
26896      {"EAP Method subfield Length", "wlan.fixed.naqp_nai_realm_list.eap_method_len",
26897       FT_UINT8, BASE_DEC, NULL, 0,
26898       NULL, HFILL }},
26899
26900     {&hf_ieee80211_ff_anqp_nai_realm_eap_method,
26901      {"EAP Method", "wlan.fixed.naqp_nai_realm_list.eap_method",
26902       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &eap_type_vals_ext, 0,
26903       NULL, HFILL }},
26904
26905     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
26906      {"Authentication Parameter Count", "wlan.fixed.naqp_nai_realm_list.auth_param_count",
26907       FT_UINT8, BASE_DEC, NULL, 0,
26908       NULL, HFILL }},
26909
26910     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
26911      {"Authentication Parameter ID", "wlan.fixed.naqp_nai_realm_list.auth_param_id",
26912       FT_UINT8, BASE_DEC, VALS(nai_realm_auth_param_id_vals), 0,
26913       NULL, HFILL }},
26914
26915     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
26916      {"Authentication Parameter Length", "wlan.fixed.naqp_nai_realm_list.auth_param_len",
26917       FT_UINT8, BASE_DEC, NULL, 0,
26918       NULL, HFILL }},
26919
26920     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
26921      {"Authentication Parameter Value", "wlan.fixed.naqp_nai_realm_list.auth_param_value",
26922       FT_BYTES, BASE_NONE, NULL, 0,
26923       NULL, HFILL }},
26924
26925     {&hf_ieee80211_3gpp_gc_gud,
26926      {"GUD", "wlan.fixed.anqp.3gpp_cellular_info.gud",
26927       FT_UINT8, BASE_DEC, NULL, 0,
26928       "Generic container User Data", HFILL }},
26929
26930     {&hf_ieee80211_3gpp_gc_udhl,
26931      {"UDHL", "wlan.fixed.anqp.3gpp_cellular_info.udhl",
26932       FT_UINT8, BASE_DEC, NULL, 0,
26933       "User Data Header Length", HFILL }},
26934
26935     {&hf_ieee80211_3gpp_gc_iei,
26936      {"IEI", "wlan.fixed.anqp.3gpp_cellular_info.iei",
26937       FT_UINT8, BASE_DEC, NULL, 0,
26938       "Information Element Identity", HFILL }},
26939
26940     {&hf_ieee80211_3gpp_gc_plmn_len,
26941      {"PLMN Length", "wlan.fixed.anqp.3gpp_cellular_info.plmn_len",
26942       FT_UINT8, BASE_DEC, NULL, 0,
26943       "Length of PLMN List value contents", HFILL }},
26944
26945     {&hf_ieee80211_3gpp_gc_num_plmns,
26946      {"Number of PLMNs", "wlan.fixed.anqp.3gpp_cellular_info.num_plmns",
26947       FT_UINT8, BASE_DEC, NULL, 0,
26948       NULL, HFILL }},
26949
26950     {&hf_ieee80211_3gpp_gc_plmn,
26951      {"PLMN", "wlan.fixed.anqp.3gpp_cellular_info.plmn_info",
26952       FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
26953
26954     {&hf_ieee80211_ff_anqp_domain_name_len,
26955      {"Domain Name Length", "wlan.fixed.anqp.domain_name_list.len",
26956       FT_UINT8, BASE_DEC, NULL, 0,
26957       NULL, HFILL }},
26958
26959     {&hf_ieee80211_ff_anqp_domain_name,
26960      {"Domain Name", "wlan.fixed.anqp.domain_name_list.name",
26961       FT_STRING, BASE_NONE, NULL, 0,
26962       NULL, HFILL }},
26963
26964     {&hf_ieee80211_ff_dls_timeout,
26965      {"DLS timeout", "wlan.fixed.dls_timeout",
26966       FT_UINT16, BASE_HEX, NULL, 0,
26967       "DLS timeout value", HFILL }},
26968
26969     {&hf_ieee80211_ff_sa_query_action_code,
26970      {"Action code", "wlan.fixed.action_code",
26971       FT_UINT8, BASE_DEC, VALS(sa_query_action_codes), 0,
26972       "Management action code", HFILL }},
26973
26974     {&hf_ieee80211_ff_transaction_id,
26975      {"Transaction Id", "wlan.fixed.transaction_id",
26976       FT_UINT16, BASE_HEX, NULL, 0,
26977       NULL, HFILL }},
26978
26979     {&hf_ieee80211_ff_send_confirm,
26980      {"Send-Confirm", "wlan.fixed.send_confirm",
26981       FT_UINT16, BASE_DEC, NULL, 0,
26982       NULL, HFILL }},
26983
26984     {&hf_ieee80211_ff_anti_clogging_token,
26985      {"Anti-Clogging Token", "wlan.fixed.anti_clogging_token",
26986       FT_BYTES, BASE_NONE, NULL, 0,
26987       NULL, HFILL }},
26988
26989     {&hf_ieee80211_ff_scalar,
26990      {"Scalar", "wlan.fixed.scalar",
26991       FT_BYTES, BASE_NONE, NULL, 0,
26992       NULL, HFILL }},
26993
26994     {&hf_ieee80211_ff_finite_field_element,
26995      {"Finite Field Element", "wlan.fixed.finite_field_element",
26996       FT_BYTES, BASE_NONE, NULL, 0,
26997       NULL, HFILL }},
26998
26999     {&hf_ieee80211_ff_confirm,
27000      {"Confirm", "wlan.fixed.confirm",
27001       FT_BYTES, BASE_NONE, NULL, 0,
27002       NULL, HFILL }},
27003
27004     {&hf_ieee80211_ff_finite_cyclic_group,
27005      {"Group Id", "wlan.fixed.finite_cyclic_group",
27006       FT_UINT16, BASE_DEC, NULL, 0,
27007       NULL, HFILL }},
27008
27009     {&hf_ieee80211_anqp_wfa_subtype,
27010      {"WFA Subtype", "wlan.anqp.wfa.subtype",
27011       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }},
27012
27013     {&hf_ieee80211_dpp_subtype,
27014      {"DPP Subtype", "wlan.wfa.dpp.subtype",
27015       FT_UINT8, BASE_DEC, VALS(dpp_subtype_vals), 0, NULL, HFILL }},
27016
27017     {&hf_hs20_indication_dgaf_disabled,
27018      {"DGAF Disabled", "wlan.hs20.indication.dgaf_disabled",
27019       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
27020
27021     {&hf_hs20_indication_pps_mo_id_present,
27022      {"PPS MO ID Present", "wlan.hs20.indication.pps_mo_id_present",
27023       FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02, NULL, HFILL }},
27024
27025     {&hf_hs20_indication_anqp_domain_id_present,
27026      {"ANQP Domain ID Present", "wlan.hs20.indication.anqp_domain_id_present",
27027       FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL }},
27028
27029     {&hf_hs20_reserved,
27030       { "Reserved", "wlan.hs20.indication.reserved",
27031        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
27032
27033     {&hf_hs20_indication_release_number,
27034      {"Release Number", "wlan.hs20.indication.release_number",
27035       FT_UINT8, BASE_DEC, VALS(hs20_indication_release_number_vals), 0xF0, NULL, HFILL }},
27036
27037     {&hf_hs20_indication_pps_mo_id,
27038      {"PPS MO ID", "wlan.hs20.indication.pps_mo_id",
27039       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27040
27041     {&hf_hs20_indication_anqp_domain_id,
27042      {"ANQP Domain ID", "wlan.hs20.indication.domain_id",
27043       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27044
27045     {&hf_hs20_anqp_subtype,
27046      {"Subtype", "wlan.hs20.anqp.subtype",
27047       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
27048       "Hotspot 2.0 ANQP Subtype", HFILL }},
27049
27050     {&hf_hs20_anqp_reserved,
27051      {"Reserved", "wlan.hs20.anqp.reserved",
27052       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27053
27054     {&hf_hs20_anqp_payload,
27055      {"Payload", "wlan.hs20.anqp.payload",
27056       FT_BYTES, BASE_NONE, NULL, 0,
27057       "Hotspot 2.0 ANQP Payload", HFILL }},
27058
27059     {&hf_hs20_anqp_hs_query_list,
27060      {"Queried Subtype", "wlan.hs20.anqp.hs_query_list",
27061       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
27062       "Queried HS 2.0 Element Subtype", HFILL }},
27063
27064     {&hf_hs20_anqp_hs_capability_list,
27065      {"Capability", "wlan.hs20.anqp.hs_capability_list",
27066       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
27067       "Hotspot 2.0 ANQP Subtype Capability", HFILL }},
27068
27069     {&hf_hs20_anqp_ofn_length,
27070      {"Length", "wlan.hs20.anqp.ofn.length",
27071       FT_UINT8, BASE_DEC, NULL, 0,
27072       "Operator Friendly Name Length", HFILL }},
27073
27074     {&hf_hs20_anqp_ofn_language,
27075      {"Language Code", "wlan.hs20.anqp.ofn.language",
27076       FT_STRING, BASE_NONE, NULL, 0,
27077       "Operator Friendly Name Language Code", HFILL }},
27078
27079     {&hf_hs20_anqp_ofn_name,
27080      {"Operator Friendly Name", "wlan.hs20.anqp.ofn.name",
27081       FT_STRING, BASE_NONE, NULL, 0,
27082       NULL, HFILL }},
27083
27084     {&hf_hs20_anqp_wan_metrics_link_status,
27085      {"Link Status", "wlan.hs20.anqp.wan_metrics.link_status",
27086       FT_UINT8, BASE_DEC, VALS(hs20_wm_link_status_vals), 0x03, NULL, HFILL }},
27087
27088     {&hf_hs20_anqp_wan_metrics_symmetric_link,
27089      {"Symmetric Link", "wlan.hs20.anqp.wan_metrics.symmetric_link",
27090       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
27091
27092     {&hf_hs20_anqp_wan_metrics_at_capacity,
27093      {"At Capacity", "wlan.hs20.anqp.wan_metrics.at_capacity",
27094       FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
27095
27096     {&hf_hs20_anqp_wan_metrics_reserved,
27097      {"Reserved", "wlan.hs20.anqp.wan_metrics.reserved",
27098       FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }},
27099
27100     {&hf_hs20_anqp_wan_metrics_downlink_speed,
27101      {"Downlink Speed", "wlan.hs20.anqp.wan_metrics.downlink_speed",
27102       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
27103
27104     {&hf_hs20_anqp_wan_metrics_uplink_speed,
27105      {"Uplink Speed", "wlan.hs20.anqp.wan_metrics.uplink_speed",
27106       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
27107
27108     {&hf_hs20_anqp_wan_metrics_downlink_load,
27109      {"Downlink Load", "wlan.hs20.anqp.wan_metrics.downlink_load",
27110       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27111
27112     {&hf_hs20_anqp_wan_metrics_uplink_load,
27113      {"Uplink Load", "wlan.hs20.anqp.wan_metrics.uplink_load",
27114       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27115
27116     {&hf_hs20_anqp_wan_metrics_lmd,
27117      {"LMD", "wlan.hs20.anqp.wan_metrics.lmd",
27118       FT_UINT16, BASE_DEC, NULL, 0, "Load Measurement Duration", HFILL }},
27119
27120     {&hf_hs20_anqp_cc_proto_ip_proto,
27121      {"IP Protocol", "wlan.hs20.anqp.cc.ip_proto",
27122       FT_UINT8, BASE_DEC, NULL, 0,
27123       "ProtoPort Tuple - IP Protocol", HFILL }},
27124
27125     {&hf_hs20_anqp_cc_proto_port_num,
27126      {"Port Number", "wlan.hs20.anqp.cc.port_num",
27127       FT_UINT16, BASE_DEC, NULL, 0,
27128       "ProtoPort Tuple - Port Number", HFILL }},
27129
27130     {&hf_hs20_anqp_cc_proto_status,
27131      {"Status", "wlan.hs20.anqp.cc.status",
27132       FT_UINT8, BASE_DEC, VALS(hs20_cc_status_vals), 0,
27133       "ProtoPort Tuple - Status", HFILL }},
27134
27135     {&hf_hs20_anqp_nai_hrq_count,
27136      {"NAI Home Realm Count", "wlan.hs20.anqp.nai_hrq.count",
27137       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27138
27139     {&hf_hs20_anqp_nai_hrq_encoding_type,
27140      {"NAI Home Realm Encoding Type",
27141       "wlan.hs20.anqp.nai_hrq.encoding_type",
27142       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals),
27143       0x01, NULL, HFILL }},
27144
27145     {&hf_hs20_anqp_nai_hrq_length,
27146      {"NAI Home Realm Name Length", "wlan.hs20.anqp.nai_hrq.length",
27147       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27148
27149     {&hf_hs20_anqp_nai_hrq_realm_name,
27150      {"NAI Home Realm Name", "wlan.hs20.anqp.nai_hrq.name",
27151       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27152
27153     {&hf_hs20_anqp_oper_class_indic,
27154      {"Operating Class", "wlan.hs20.anqp.oper_class_indic.oper_class",
27155       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27156
27157     {&hf_hs20_osu_friendly_names_len,
27158      {"OSU Friendly Name Length", "wlan.hs20.osu_friendly_names_len",
27159       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27160
27161     {&hf_hs20_osu_friendly_name_length,
27162      {"Length", "wlan.hs20.osu_friendly_name.len",
27163       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27164
27165     {&hf_hs20_osu_friendly_name_language,
27166      {"Language Code", "wlan.hs20.osu_friendly_name.language",
27167       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27168
27169     {&hf_hs20_osu_friendly_name_name,
27170      {"OSU Friendly Name", "wlan.hs20.osu_friendly_name.name",
27171      FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27172
27173     {&hf_hs20_osu_server_uri_len,
27174      {"OSU Server URI Length", "wlan.hs20.osu_server_uri_len",
27175       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27176
27177     {&hf_hs20_osu_server_uri,
27178      {"OSU Server URI", "wlan.hs20.osu_server_uri",
27179       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27180
27181     {&hf_hs20_osu_method_list_len,
27182      {"OSU Method List Length", "wlan.hs20.osu_method_list_len",
27183       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27184
27185     {&hf_hs20_osu_method_val,
27186      {"OSU Method", "wlan.hs20.osu_method_list.method",
27187       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27188
27189     {&hf_hs20_icons_avail_len,
27190      {"Icons Available Length", "wlan.hs20.osu_icons_avail_len",
27191       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27192
27193     {&hf_hs20_osu_providers_list_ssid_len,
27194      {"SSID Length", "wlan.hs20.anqp_osu_prov_list.ssid_len",
27195       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27196
27197     {&hf_hs20_osu_providers_ssid,
27198      {"SSID", "wlan.hs20.anqp_osu_prov_list.ssid",
27199       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27200
27201     {&hf_hs20_osu_providers_count,
27202      {"Number of OSU Providers", "wlan.hs20.anqp_osu_prov_list.number",
27203       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27204
27205     {&hf_hs20_osu_prov_length,
27206      {"OSU Provider Length", "wlan.hs20.anqp_osu_prov.len",
27207       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27208
27209     {&hf_hs20_icon_request_filename,
27210      {"Icon Filename", "wlan.hs20.anqp_icon_request.icon_filename",
27211       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27212
27213     {&hf_osu_icon_avail_width,
27214      {"Icon Width", "wlan.hs20.osu_icons_avail.icon_width",
27215       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27216
27217     {&hf_osu_icon_avail_height,
27218      {"Icon Height", "wlan.hs20.osu_icons_avail.icon_height",
27219       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27220
27221     {&hf_osu_icon_avail_lang_code,
27222      {"Language Code", "wlan.hs20.osu_icons_avail.lang_code",
27223       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27224
27225     {&hf_osu_icon_avail_icon_type_len,
27226      {"Icon Type Length", "wlan.hs20.osu_icons_avail.icon_type_len",
27227       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27228
27229     {&hf_osu_icon_avail_icon_type,
27230      {"Icon Type", "wlan.hs20.osu_icons_avail.icon_type",
27231       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27232
27233     {&hf_osu_icon_avail_filename_len,
27234      {"Icon Filename Length", "wlan.hs20.osu_icons_avail.icon_filename_len",
27235       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27236
27237     {&hf_osu_icon_avail_filename,
27238      {"Icon Filename", "wlan.hs20.osu_icons_avail.icon_filename",
27239       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27240
27241     {&hf_hs20_osu_nai_len,
27242      {"OSU_NAI Length", "wlan.hs20.osu_nai.len",
27243       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27244
27245     {&hf_hs20_osu_nai,
27246      {"OSU_NAI", "wlan.hs20.osu_nai",
27247       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
27248
27249     {&hf_hs20_osu_service_desc_len,
27250      {"OSU Service Desctription Length", "wlan.hs20.osu_service_desc_len",
27251       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27252
27253     {&hf_hs20_osu_service_desc_duple_len,
27254      {"Length", "wlan.hs20.osu_service_desc.duple.len",
27255       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27256
27257     {&hf_hs20_osu_service_desc_lang,
27258      {"Language Code", "wlan.hs20.osu_service_desc.duple.lang",
27259       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27260
27261     {&hf_hs20_osu_service_desc,
27262      {"OSU Service Description", "wlan.hs20.osu_service_desc.duple.desc",
27263       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27264
27265     {&hf_hs20_icon_binary_file_status,
27266      {"Download Status Code", "wlan.hs20.anqp_icon_request.download_status",
27267       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27268
27269     {&hf_hs20_icon_type_length,
27270      {"Icon Type Length", "wlan.hs20.anqp_icon_request.icon_type_len",
27271       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27272
27273     {&hf_hs20_icon_type,
27274      {"Icon Type", "wlan.hs20.anqp_icon_request.icon_type",
27275       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27276
27277     {&hf_hs20_icon_binary_data_len,
27278      {"Icon Binary Data Length", "wlan.anqp_icon_request.icon_binary_data_len",
27279       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27280
27281     {&hf_hs20_icon_binary_data,
27282      {"Icon Binary Data", "wlan.h220.anqp_icon_request.icon_binary_data",
27283       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
27284
27285     {&hf_hs20_subscription_remediation_url_len,
27286      {"Server URL Length", "wlan.hs20.subs_remediation.server_url_len",
27287       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27288
27289     {&hf_hs20_subscription_remediation_server_url,
27290      {"Server URL", "wlan.hs20.subs_remediation.server_url",
27291       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27292
27293     {&hf_hs20_subscription_remediation_server_method,
27294      {"Server Method", "wlan.hs20.subs_remediation.server_method",
27295       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27296
27297     {&hf_hs20_deauth_reason_code,
27298      {"De-Auth Reason Code", "wlan.hs20.deauth.reason_code",
27299       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27300
27301     {&hf_hs20_reauth_delay,
27302      {"Re-Auth Delay", "wlan.hs20.deauth.reauth_delay",
27303       FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }},
27304
27305     {&hf_hs20_deauth_reason_url_len,
27306      {"Reason URL Length", "wlan.hs20.deauth.reason_url_len",
27307       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27308
27309     {&hf_hs20_deauth_imminent_reason_url,
27310      {"Reason URL", "wlan.hs20.deauth.reason_url",
27311       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27312
27313     {&hf_hs20_anqp_venue_url_length,
27314      {"Length", "wlan.hs20.venue_url.len",
27315       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27316
27317     {&hf_hs20_anqp_venue_number,
27318      {"Venue number", "wlan.hs20.venue_url.venue_num",
27319       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27320
27321     {&hf_hs20_anqp_venue_url,
27322      {"Venue URL", "wlan.hs20.venue_url.url",
27323       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27324
27325     {&hf_hs20_anqp_advice_of_charge_length,
27326      {"Length", "wlan.hs20.advice_of_charge.len",
27327       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27328
27329     {&hf_hs20_anqp_advice_of_charge_type,
27330      {"Advice of Charge Type", "wlan.hs20.advice_of_charge.type",
27331       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27332
27333     {&hf_hs20_anqp_aoc_nai_realm_encoding,
27334      {"NAI Realm Encoding", "wlan.hs20.advice_of_charge.nai_realm_enc",
27335       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
27336
27337     {&hf_hs20_anqp_aoc_nai_realm_len,
27338      {"NAI Realm Length", "wlan.hs20.advice_of_charge.nai_realm_len",
27339       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27340
27341     {&hf_hs20_anqp_aoc_nai_realm,
27342      {"NAI Realm", "wlan.hs20.advice_of_charge.nai_realm",
27343       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27344
27345     {&hf_hs20_anqp_aoc_plan_len,
27346      {"Plan length", "wlan.hs20.advice_of_charge.plan_info_tuples.plan_len",
27347       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27348
27349     {&hf_hs20_anqp_aoc_plan_lang,
27350      {"Plan language", "wlan.hs20.advice_of_charge.plan_info_tuples.plan_lang",
27351       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27352
27353     {&hf_hs20_anqp_aoc_plan_curcy,
27354      {"Plan currency", "wlan.hs20.advice_of_charge.plan_info_tuples.plan_curcy",
27355       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27356
27357     {&hf_hs20_anqp_aoc_plan_information,
27358      {"Plan information", "wlan.hs20.advice_of_charge.plan_info_tuples.info",
27359       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27360
27361     {&hf_ieee80211_tag,
27362      {"Tag", "wlan.tag",
27363       FT_NONE, BASE_NONE, 0x0, 0,
27364       NULL, HFILL }},
27365
27366     {&hf_ieee80211_tag_number,
27367      {"Tag Number", "wlan.tag.number",
27368       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
27369       "Element ID", HFILL }},
27370
27371     {&hf_ieee80211_tag_length,
27372      {"Tag length", "wlan.tag.length",
27373       FT_UINT32, BASE_DEC, NULL, 0,
27374       "Length of tag", HFILL }},
27375
27376     {&hf_ieee80211_tag_interpretation,
27377      {"Tag interpretation", "wlan.tag.interpretation",
27378       FT_STRING, BASE_NONE, NULL, 0,
27379       "Interpretation of tag", HFILL }},
27380
27381     {&hf_ieee80211_tag_data,
27382      {"Tag Data", "wlan.tag.data",
27383       FT_BYTES, BASE_NONE, NULL, 0,
27384       "Data Interpretation of tag", HFILL }},
27385
27386     {&hf_ieee80211_tag_oui,
27387      {"OUI", "wlan.tag.oui",
27388       FT_UINT24, BASE_OUI, NULL, 0,
27389       "OUI of vendor specific IE", HFILL }},
27390
27391     {&hf_ieee80211_tag_oui_wfa_subtype,
27392      {"WFA Subtype", "wlan.tag.oui.wfa_subtype",
27393       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0,
27394       NULL, HFILL }},
27395
27396     {&hf_ieee80211_tag_ds_param_channel,
27397      {"Current Channel", "wlan.ds.current_channel",
27398       FT_UINT8, BASE_DEC, NULL, 0,
27399       "DS Parameter Set - Current Channel", HFILL }},
27400
27401     {&hf_ieee80211_tag_cfp_count,
27402      {"CFP Count", "wlan.cfp.count",
27403       FT_UINT8, BASE_DEC, NULL, 0,
27404       "Indicates how many delivery traffic indication messages (DTIMs)", HFILL }},
27405
27406     {&hf_ieee80211_tag_cfp_period,
27407      {"CFP Period", "wlan.cfp.period",
27408       FT_UINT8, BASE_DEC, NULL, 0,
27409       "Indicates the number of DTIM intervals between the start of CFPs", HFILL }},
27410
27411     {&hf_ieee80211_tag_cfp_max_duration,
27412      {"CFP Max Duration", "wlan.cfp.max_duration",
27413       FT_UINT16, BASE_DEC, NULL, 0,
27414       "Indicates the maximum duration (in TU) of the CFP that may be generated by this PCF", HFILL }},
27415
27416     {&hf_ieee80211_tag_cfp_dur_remaining,
27417      {"CFP Dur Remaining", "wlan.cfp.dur_remaining",
27418       FT_UINT16, BASE_DEC, NULL, 0,
27419       "Indicates the maximum time (in TU) remaining in the present CFP", HFILL }},
27420
27421     {&hf_ieee80211_tag_vendor_oui_type,
27422      {"Vendor Specific OUI Type", "wlan.tag.vendor.oui.type",
27423       FT_UINT8, BASE_DEC, NULL, 0,
27424       NULL, HFILL }},
27425
27426     {&hf_ieee80211_tag_vendor_data,
27427      {"Vendor Specific Data", "wlan.tag.vendor.data",
27428       FT_BYTES, BASE_NONE, NULL, 0,
27429       "Unknown/undecoded Vendor Specific Data", HFILL }},
27430
27431     {&hf_ieee80211_tim_dtim_count,
27432      {"DTIM count", "wlan.tim.dtim_count",
27433       FT_UINT8, BASE_DEC, NULL, 0,
27434       "Indicates how many Beacon frames (including the current frame) appear before the next DTIM", HFILL }},
27435
27436     {&hf_ieee80211_tim_dtim_period,
27437      {"DTIM period", "wlan.tim.dtim_period",
27438       FT_UINT8, BASE_DEC, NULL, 0,
27439       "Indicates the number of beacon intervals between successive DTIMs", HFILL }},
27440
27441     {&hf_ieee80211_tim_bmapctl,
27442      {"Bitmap control", "wlan.tim.bmapctl",
27443       FT_UINT8, BASE_HEX, NULL, 0,
27444       NULL, HFILL }},
27445
27446     {&hf_ieee80211_tim_bmapctl_mcast,
27447      {"Multicast", "wlan.tim.bmapctl.multicast",
27448       FT_BOOLEAN, 8, NULL, 0x1,
27449       "Contains the Traffic Indicator bit associated with Association ID 0", HFILL }},
27450
27451     {&hf_ieee80211_tim_bmapctl_offset,
27452      {"Bitmap Offset", "wlan.tim.bmapctl.offset",
27453       FT_UINT8, BASE_HEX, NULL, 0xFE,
27454       NULL, HFILL }},
27455
27456     {&hf_ieee80211_tim_partial_virtual_bitmap,
27457      {"Partial Virtual Bitmap", "wlan.tim.partial_virtual_bitmap",
27458       FT_BYTES, BASE_NONE, NULL, 0x0,
27459       NULL, HFILL }},
27460
27461     {&hf_ieee80211_tim_aid,
27462      {"Association ID", "wlan.tim.aid",
27463       FT_UINT8, BASE_HEX, NULL, 0x0,
27464       NULL, HFILL }},
27465
27466     {&hf_ieee80211_tag_ibss_atim_window,
27467      {"Atim Windows", "wlan.ibss.atim_windows",
27468       FT_UINT16, BASE_HEX, NULL, 0x0,
27469       "Contains the ATIM Window length in TU", HFILL }},
27470
27471     {&hf_ieee80211_tag_country_info_code,
27472      {"Code", "wlan.country_info.code",
27473       FT_STRING, BASE_NONE, NULL, 0x0,
27474       NULL, HFILL }},
27475
27476     {&hf_ieee80211_tag_country_info_env,
27477      {"Environment", "wlan.country_info.environment",
27478       FT_UINT8, BASE_HEX, VALS(environment_vals), 0x0,
27479       NULL, HFILL }},
27480
27481     {&hf_ieee80211_tag_country_info_pad,
27482      {"Padding", "wlan.country_info.padding",
27483       FT_BYTES, BASE_NONE, NULL, 0x0,
27484       NULL, HFILL }},
27485
27486     {&hf_ieee80211_tag_country_info_fnm,
27487      {"Country Info", "wlan.country_info.fnm",
27488       FT_NONE, BASE_NONE, NULL, 0x0,
27489       NULL, HFILL }},
27490
27491     {&hf_ieee80211_tag_country_info_fnm_fcn,
27492      {"First Channel Number", "wlan.country_info.fnm.fcn",
27493       FT_UINT8, BASE_DEC, NULL, 0x0,
27494       NULL, HFILL }},
27495
27496     {&hf_ieee80211_tag_country_info_fnm_nc,
27497      {"Number of Channels", "wlan.country_info.fnm.nc",
27498       FT_UINT8, BASE_DEC, NULL, 0x0,
27499       NULL, HFILL }},
27500
27501     {&hf_ieee80211_tag_country_info_fnm_mtpl,
27502      {"Maximum Transmit Power Level", "wlan.country_info.fnm.mtpl",
27503       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
27504       NULL, HFILL }},
27505
27506     {&hf_ieee80211_tag_country_info_rrc,
27507      {"Country Info", "wlan.country_info.rrc",
27508       FT_NONE, BASE_NONE, NULL, 0x0,
27509       NULL, HFILL }},
27510
27511     {&hf_ieee80211_tag_country_info_rrc_oei,
27512      {"Operating Extension Identifier", "wlan.country_info.rrc.oei",
27513       FT_UINT8, BASE_DEC, NULL, 0x0,
27514       NULL, HFILL }},
27515
27516     {&hf_ieee80211_tag_country_info_rrc_oc,
27517      {"Operating Class", "wlan.country_info.rrc.oc",
27518       FT_UINT8, BASE_DEC, NULL, 0x0,
27519       NULL, HFILL }},
27520
27521     {&hf_ieee80211_tag_country_info_rrc_cc,
27522      {"Coverage Class", "wlan.country_info.rrc.cc",
27523       FT_UINT8, BASE_DEC, NULL, 0x0,
27524       NULL, HFILL }},
27525
27526     {&hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
27527      {"Prime Radix", "wlan.fh_hopping.parameter.prime_radix",
27528       FT_UINT8, BASE_DEC, NULL, 0x0,
27529       NULL, HFILL }},
27530
27531     {&hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
27532      {"Number of Channels", "wlan.fh_hopping.parameter.nb_channels",
27533       FT_UINT8, BASE_DEC, NULL, 0x0,
27534       NULL, HFILL }},
27535
27536     {&hf_ieee80211_tag_fh_hopping_table_flag,
27537      {"Flag", "wlan.fh_hopping.table.flag",
27538       FT_UINT8, BASE_HEX, NULL, 0x0,
27539       "Indicates that a Random Table is present when the value is 1", HFILL }},
27540
27541     {&hf_ieee80211_tag_fh_hopping_table_number_of_sets,
27542      {"Number of Sets", "wlan.fh_hopping.table.number_of_sets",
27543       FT_UINT8, BASE_DEC, NULL, 0x0,
27544       "Indicates the total number of sets within the hopping patterns", HFILL }},
27545
27546     {&hf_ieee80211_tag_fh_hopping_table_modulus,
27547      {"Modulus", "wlan.fh_hopping.table.modulus",
27548       FT_UINT8, BASE_HEX, NULL, 0x0,
27549       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
27550
27551     {&hf_ieee80211_tag_fh_hopping_table_offset,
27552      {"Offset", "wlan.fh_hopping.table.offset",
27553       FT_UINT8, BASE_HEX, NULL, 0x0,
27554       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
27555
27556     {&hf_ieee80211_tag_fh_hopping_random_table,
27557      {"Random Table", "wlan.fh_hopping.table.random_table",
27558       FT_UINT16, BASE_HEX, NULL, 0x0,
27559       "It is a vector of single octet values that indicate the random sequence to be followed during a hopping sequence", HFILL }},
27560
27561     {&hf_ieee80211_tag_request,
27562      {"Requested Element ID", "wlan.tag.request",
27563       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
27564       "The list of elements that are to be included in the responding STA Probe Response frame", HFILL }},
27565
27566     {&hf_ieee80211_tclas_up,
27567      {"User Priority", "wlan.tclas.user_priority",
27568       FT_UINT8, BASE_DEC, NULL, 0,
27569       "Contains the value of the UP of the associated MSDUs", HFILL }},
27570
27571     {&hf_ieee80211_tclas_class_type,
27572      {"Classifier Type", "wlan.tclas.class_type",
27573       FT_UINT8, BASE_DEC, VALS(classifier_type), 0,
27574       "Specifies the type of classifier parameters", HFILL }},
27575
27576     {&hf_ieee80211_tclas_class_mask,
27577      {"Classifier Mask", "wlan.tclas.class_mask",
27578       FT_UINT8, BASE_HEX,  NULL, 0,
27579       "Specifies a bitmap where bits that are set to 1 identify a subset of the classifier parameters", HFILL }},
27580
27581     {&hf_ieee80211_tclas_class_mask0_src_addr,
27582      {"Source Address", "wlan.tclas.class_mask.src_addr",
27583       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
27584
27585     {&hf_ieee80211_tclas_class_mask0_dst_addr,
27586      {"Destination Address", "wlan.tclas.class_mask.dst_addr",
27587       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
27588
27589     {&hf_ieee80211_tclas_class_mask0_type,
27590      {"Type", "wlan.tclas.class_mask.type",
27591       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
27592
27593     {&hf_ieee80211_tclas_class_mask1_ver,
27594      {"Version", "wlan.tclas.class_mask.version",
27595       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
27596
27597     {&hf_ieee80211_tclas_class_mask1_src_ip,
27598      {"Source IP Address", "wlan.tclas.class_mask.src_ip",
27599       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
27600
27601     {&hf_ieee80211_tclas_class_mask1_dst_ip,
27602      {"Destination IP Address", "wlan.tclas.class_mask.dst_ip",
27603       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
27604
27605     {&hf_ieee80211_tclas_class_mask1_src_port,
27606      {"Source Port", "wlan.tclas.class_mask.src_port",
27607       FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL }},
27608
27609     {&hf_ieee80211_tclas_class_mask1_dst_port,
27610      {"Destination Port", "wlan.tclas.class_mask.dst_port",
27611       FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL }},
27612
27613     {&hf_ieee80211_tclas_class_mask1_ipv4_dscp,
27614      {"DSCP", "wlan.tclas.class_mask.dscp",
27615       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
27616
27617     {&hf_ieee80211_tclas_class_mask1_ipv4_proto,
27618      {"Protocol", "wlan.tclas.class_mask.proto",
27619       FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL }},
27620
27621     {&hf_ieee80211_tclas_class_mask1_ipv6_flow,
27622      {"Flow Label", "wlan.tclas.class_mask.flow_label",
27623       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
27624
27625     {&hf_ieee80211_tclas_class_mask2_tci,
27626      {"802.1Q CLAN TCI", "wlan.tclas.class_mask.tci",
27627       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
27628
27629     {&hf_ieee80211_tclas_src_mac_addr,
27630      {"Source address", "wlan.tclas.src_mac_addr",
27631       FT_ETHER, BASE_NONE, NULL, 0,
27632       "Classifier Parameters Ethernet Type", HFILL }},
27633
27634     {&hf_ieee80211_tclas_dst_mac_addr,
27635      {"Destination address", "wlan.tclas.dat_mac_addr",
27636       FT_ETHER, BASE_NONE, NULL, 0,
27637       NULL, HFILL }},
27638
27639     {&hf_ieee80211_tclas_ether_type,
27640      {"Ethernet Type", "wlan.tclas.ether_type",
27641       FT_UINT8, BASE_DEC, NULL, 0,
27642       NULL, HFILL }},
27643
27644     {&hf_ieee80211_tclas_version,
27645      {"IP Version", "wlan.tclas.version",
27646       FT_UINT8, BASE_DEC, NULL, 0,
27647       NULL, HFILL }},
27648
27649     {&hf_ieee80211_tclas_ipv4_src,
27650      {"IPv4 Src Addr", "wlan.tclas.ipv4_src",
27651       FT_IPv4, BASE_NONE, NULL, 0,
27652       NULL, HFILL }},
27653
27654     {&hf_ieee80211_tclas_ipv4_dst,
27655      {"IPv4 Dst Addr", "wlan.tclas.ipv4_dst",
27656       FT_IPv4, BASE_NONE, NULL, 0,
27657       NULL, HFILL }},
27658
27659     {&hf_ieee80211_tclas_src_port,
27660      {"Source Port", "wlan.tclas.src_port",
27661       FT_UINT16, BASE_DEC, NULL, 0,
27662       NULL, HFILL }},
27663
27664     {&hf_ieee80211_tclas_dst_port,
27665      {"Destination Port", "wlan.tclas.dst_port",
27666       FT_UINT16, BASE_DEC, NULL, 0,
27667       NULL, HFILL }},
27668
27669     {&hf_ieee80211_tclas_dscp,
27670      {"IPv4 DSCP", "wlan.tclas.dscp",
27671       FT_UINT8, BASE_HEX, NULL, 0,
27672       "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
27673
27674     {&hf_ieee80211_tclas_protocol,
27675      {"Protocol", "wlan.tclas.protocol",
27676       FT_UINT8, BASE_HEX, NULL, 0,
27677       "IPv4 Protocol", HFILL }},
27678
27679     {&hf_ieee80211_tclas_ipv6_src,
27680      {"IPv6 Src Addr", "wlan.tclas.ipv6_src",
27681       FT_IPv6, BASE_NONE, NULL, 0,
27682       NULL, HFILL }},
27683
27684     {&hf_ieee80211_tclas_ipv6_dst,
27685      {"IPv6 Dst Addr", "wlan.tclas.ipv6_dst",
27686       FT_IPv6, BASE_NONE, NULL, 0,
27687       NULL, HFILL }},
27688
27689     {&hf_ieee80211_tclas_flow,
27690      {"Flow Label", "wlan.tclas.flow",
27691       FT_UINT24, BASE_HEX, NULL, 0,
27692       "IPv6 Flow Label", HFILL }},
27693
27694     {&hf_ieee80211_tclas_tag_type,
27695      {"802.1Q Tag Type", "wlan.tclas.tag_type",
27696       FT_UINT16, BASE_HEX, NULL, 0,
27697       NULL, HFILL }},
27698
27699     {&hf_ieee80211_tag_challenge_text,
27700      {"Challenge Text", "wlan.tag.challenge_text",
27701       FT_BYTES, BASE_NONE, NULL, 0,
27702       NULL, HFILL }},
27703
27704     {&hf_ieee80211_rsn_version,
27705      {"RSN Version", "wlan.rsn.version",
27706       FT_UINT16, BASE_DEC, NULL, 0,
27707       "Indicates the version number of the RSNA protocol", HFILL }},
27708
27709     {&hf_ieee80211_rsn_gcs,
27710      {"Group Cipher Suite", "wlan.rsn.gcs",
27711       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gcs_base_custom), 0,
27712       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
27713
27714     {&hf_ieee80211_rsn_gcs_oui,
27715      {"Group Cipher Suite OUI", "wlan.rsn.gcs.oui",
27716       FT_UINT24, BASE_OUI, NULL, 0,
27717       NULL, HFILL }},
27718
27719     {&hf_ieee80211_rsn_gcs_type,
27720      {"Group Cipher Suite type", "wlan.rsn.gcs.type",
27721       FT_UINT8, BASE_DEC, NULL, 0,
27722       NULL, HFILL }},
27723
27724     {&hf_ieee80211_rsn_gcs_80211_type,
27725      {"Group Cipher Suite type", "wlan.rsn.gcs.type",
27726       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
27727       NULL, HFILL }},
27728
27729     {&hf_ieee80211_rsn_pcs_count,
27730      {"Pairwise Cipher Suite Count", "wlan.rsn.pcs.count",
27731       FT_UINT16, BASE_DEC,  NULL, 0,
27732       "Indicates the number of pairwise cipher suite selectors that are contained in the Pairwise Cipher Suite List", HFILL }},
27733
27734     {&hf_ieee80211_rsn_pcs_list,
27735      {"Pairwise Cipher Suite List", "wlan.rsn.pcs.list",
27736       FT_NONE, BASE_NONE, NULL, 0,
27737       "Contains a series of cipher suite selectors that indicate the pairwisecipher suites", HFILL }},
27738
27739     {&hf_ieee80211_rsn_pcs,
27740      {"Pairwise Cipher Suite", "wlan.rsn.pcs",
27741       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_pcs_base_custom), 0,
27742       NULL, HFILL }},
27743
27744     {&hf_ieee80211_rsn_pcs_oui,
27745      {"Pairwise Cipher Suite OUI", "wlan.rsn.pcs.oui",
27746       FT_UINT24, BASE_OUI, NULL, 0,
27747       NULL, HFILL }},
27748
27749     {&hf_ieee80211_rsn_pcs_type,
27750      {"Pairwise Cipher Suite type", "wlan.rsn.pcs.type",
27751       FT_UINT8, BASE_DEC, NULL, 0,
27752       NULL, HFILL }},
27753
27754     {&hf_ieee80211_rsn_pcs_80211_type,
27755      {"Pairwise Cipher Suite type", "wlan.rsn.pcs.type",
27756       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
27757       NULL, HFILL }},
27758
27759     {&hf_ieee80211_rsn_akms_count,
27760      {"Auth Key Management (AKM) Suite Count", "wlan.rsn.akms.count",
27761       FT_UINT16, BASE_DEC, NULL, 0,
27762       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
27763
27764     {&hf_ieee80211_rsn_akms_list,
27765      {"Auth Key Management (AKM) List", "wlan.rsn.akms.list",
27766       FT_NONE, BASE_NONE, NULL, 0,
27767       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
27768
27769     {&hf_ieee80211_rsn_akms,
27770      {"Auth Key Management (AKM) Suite", "wlan.rsn.akms",
27771       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_akms_base_custom), 0,
27772       NULL, HFILL }},
27773
27774     {&hf_ieee80211_rsn_akms_oui,
27775      {"Auth Key Management (AKM) OUI", "wlan.rsn.akms.oui",
27776       FT_UINT24, BASE_OUI, NULL, 0,
27777       NULL, HFILL }},
27778
27779     {&hf_ieee80211_rsn_akms_type,
27780      {"Auth Key Management (AKM) type", "wlan.rsn.akms.type",
27781       FT_UINT8, BASE_DEC, NULL, 0,
27782       NULL, HFILL }},
27783
27784     {&hf_ieee80211_rsn_akms_80211_type,
27785      {"Auth Key Management (AKM) type", "wlan.rsn.akms.type",
27786       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_keymgmt_vals), 0,
27787       NULL, HFILL }},
27788
27789     {&hf_ieee80211_rsn_cap,
27790      {"RSN Capabilities", "wlan.rsn.capabilities",
27791       FT_UINT16, BASE_HEX, NULL, 0,
27792       "RSN Capability information", HFILL }},
27793
27794     {&hf_ieee80211_rsn_cap_preauth,
27795      {"RSN Pre-Auth capabilities", "wlan.rsn.capabilities.preauth",
27796       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001,
27797       NULL, HFILL }},
27798
27799     {&hf_ieee80211_rsn_cap_no_pairwise,
27800      {"RSN No Pairwise capabilities", "wlan.rsn.capabilities.no_pairwise",
27801       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002,
27802       NULL, HFILL }},
27803
27804     {&hf_ieee80211_rsn_cap_ptksa_replay_counter,
27805      {"RSN PTKSA Replay Counter capabilities", "wlan.rsn.capabilities.ptksa_replay_counter",
27806       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C,
27807       NULL, HFILL }},
27808
27809     {&hf_ieee80211_rsn_cap_gtksa_replay_counter,
27810      {"RSN GTKSA Replay Counter capabilities", "wlan.rsn.capabilities.gtksa_replay_counter",
27811       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030,
27812       NULL, HFILL }},
27813
27814     {&hf_ieee80211_rsn_cap_mfpr,
27815      {"Management Frame Protection Required", "wlan.rsn.capabilities.mfpr",
27816       FT_BOOLEAN, 16, NULL, 0x0040,
27817       NULL, HFILL }},
27818
27819     {&hf_ieee80211_rsn_cap_mfpc,
27820      {"Management Frame Protection Capable", "wlan.rsn.capabilities.mfpc",
27821       FT_BOOLEAN, 16, NULL, 0x0080,
27822       NULL, HFILL }},
27823
27824     {&hf_ieee80211_rsn_cap_jmr,
27825      {"Joint Multi-band RSNA", "wlan.rsn.capabilities.jmr",
27826       FT_BOOLEAN, 16, NULL, 0x0100,
27827       NULL, HFILL }},
27828
27829     {&hf_ieee80211_rsn_cap_peerkey,
27830      {"PeerKey Enabled", "wlan.rsn.capabilities.peerkey",
27831       FT_BOOLEAN, 16, NULL, 0x0200,
27832       NULL, HFILL }},
27833
27834     {&hf_ieee80211_rsn_pmkid_count,
27835      {"PMKID Count", "wlan.rsn.pmkid.count",
27836       FT_UINT16, BASE_DEC, NULL, 0,
27837       "Indicates the number of PMKID  selectors that are contained in the PMKID Suite List", HFILL }},
27838
27839     {&hf_ieee80211_rsn_pmkid_list,
27840      {"PMKID List", "wlan.rsn.pmkid.list",
27841       FT_NONE, BASE_NONE, NULL, 0,
27842       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
27843
27844     {&hf_ieee80211_rsn_pmkid,
27845      {"PMKID", "wlan.pmkid.akms",
27846       FT_BYTES, BASE_NONE, NULL, 0,
27847       NULL, HFILL }},
27848
27849     {&hf_ieee80211_rsn_gmcs,
27850      {"Group Management Cipher Suite", "wlan.rsn.gmcs",
27851       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gmcs_base_custom), 0,
27852       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
27853
27854     {&hf_ieee80211_rsn_gmcs_oui,
27855      {"Group Management Cipher Suite OUI", "wlan.rsn.gmcs.oui",
27856       FT_UINT24, BASE_OUI, NULL, 0,
27857       NULL, HFILL }},
27858
27859     {&hf_ieee80211_rsn_gmcs_type,
27860      {"Group Management Cipher Suite type", "wlan.rsn.gmcs.type",
27861       FT_UINT8, BASE_DEC, NULL, 0,
27862       NULL, HFILL }},
27863
27864     {&hf_ieee80211_rsn_gmcs_80211_type,
27865      {"Group Management Cipher Suite type", "wlan.rsn.gmcs.type",
27866       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
27867       NULL, HFILL }},
27868
27869     {&hf_ieee80211_ht_pren_type,
27870      {"802.11n (Pre) Type", "wlan.vs.pren.type",
27871       FT_UINT8, BASE_DEC, VALS(ieee80211_ht_pren_type_vals), 0,
27872       "Vendor Specific HT Type", HFILL }},
27873     {&hf_ieee80211_ht_pren_unknown,
27874      {"802.11n (Pre) Unknown Data", "wlan.vs.pren.unknown_data",
27875       FT_BYTES, BASE_NONE, NULL, 0,
27876       NULL, HFILL }},
27877
27878     {&hf_ieee80211_ht_cap,
27879      {"HT Capabilities Info", "wlan.ht.capabilities",
27880       FT_UINT16, BASE_HEX, NULL, 0,
27881       "HT Capabilities information", HFILL }},
27882
27883     {&hf_ieee80211_ht_vs_cap,
27884      {"HT Capabilities Info (VS)", "wlan.vs.ht.capabilities",
27885       FT_UINT16, BASE_HEX, NULL, 0,
27886       "Vendor Specific HT Capabilities information", HFILL }},
27887
27888     {&hf_ieee80211_ht_ldpc_coding,
27889      {"HT LDPC coding capability", "wlan.ht.capabilities.ldpccoding",
27890       FT_BOOLEAN, 16, TFS(&ht_ldpc_coding_flag), 0x0001,
27891       NULL, HFILL }},
27892
27893     {&hf_ieee80211_ht_chan_width,
27894      {"HT Support channel width", "wlan.ht.capabilities.width",
27895       FT_BOOLEAN, 16, TFS(&ht_chan_width_flag), 0x0002,
27896       NULL, HFILL }},
27897
27898     {&hf_ieee80211_ht_sm_pwsave,
27899      {"HT SM Power Save", "wlan.ht.capabilities.sm",
27900       FT_UINT16, BASE_HEX, VALS(ht_sm_pwsave_flag), 0x000c,
27901       NULL, HFILL }},
27902
27903     {&hf_ieee80211_ht_green,
27904      {"HT Green Field", "wlan.ht.capabilities.green",
27905       FT_BOOLEAN, 16, TFS(&ht_green_flag), 0x0010,
27906       NULL, HFILL }},
27907
27908     {&hf_ieee80211_ht_short20,
27909      {"HT Short GI for 20MHz", "wlan.ht.capabilities.short20",
27910       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0020,
27911       NULL, HFILL }},
27912
27913     {&hf_ieee80211_ht_short40,
27914      {"HT Short GI for 40MHz", "wlan.ht.capabilities.short40",
27915       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040,
27916       NULL, HFILL }},
27917
27918     {&hf_ieee80211_ht_tx_stbc,
27919      {"HT Tx STBC", "wlan.ht.capabilities.txstbc",
27920       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080,
27921       NULL, HFILL }},
27922
27923     {&hf_ieee80211_ht_rx_stbc,
27924      {"HT Rx STBC", "wlan.ht.capabilities.rxstbc",
27925       FT_UINT16, BASE_HEX, VALS(ht_rx_stbc_flag), 0x0300,
27926       "HT Tx STBC", HFILL }},
27927
27928     {&hf_ieee80211_ht_delayed_block_ack,
27929      {"HT Delayed Block ACK", "wlan.ht.capabilities.delayedblockack",
27930       FT_BOOLEAN, 16, TFS(&ht_delayed_block_ack_flag), 0x0400,
27931       NULL, HFILL }},
27932
27933     {&hf_ieee80211_ht_max_amsdu,
27934      {"HT Max A-MSDU length", "wlan.ht.capabilities.amsdu",
27935       FT_BOOLEAN, 16, TFS(&ht_max_amsdu_flag), 0x0800,
27936       NULL, HFILL }},
27937
27938     {&hf_ieee80211_ht_dss_cck_40,
27939      {"HT DSSS/CCK mode in 40MHz", "wlan.ht.capabilities.dsscck",
27940       FT_BOOLEAN, 16, TFS(&ht_dss_cck_40_flag), 0x1000,
27941       "HT DSS/CCK mode in 40MHz", HFILL }},
27942
27943     {&hf_ieee80211_ht_psmp,
27944      {"HT PSMP Support", "wlan.ht.capabilities.psmp",
27945       FT_BOOLEAN, 16, TFS(&ht_psmp_flag), 0x2000,
27946       NULL, HFILL }},
27947
27948     {&hf_ieee80211_ht_40_mhz_intolerant,
27949      {"HT Forty MHz Intolerant", "wlan.ht.capabilities.40mhzintolerant",
27950       FT_BOOLEAN, 16, TFS(&ht_40_mhz_intolerant_flag), 0x4000,
27951       NULL, HFILL }},
27952
27953     {&hf_ieee80211_ht_l_sig,
27954      {"HT L-SIG TXOP Protection support", "wlan.ht.capabilities.lsig",
27955       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000,
27956       NULL, HFILL }},
27957
27958     {&hf_ieee80211_ext_bss_mu_mimo_capable_sta_count,
27959      {"MU-MIMO Capable STA Count", "wlan.ext_bss.mu_mimo_capable_sta_count",
27960       FT_UINT16, BASE_DEC, NULL, 0,
27961       NULL, HFILL }},
27962
27963     {&hf_ieee80211_ext_bss_ss_underutilization,
27964      {"Spatial Stream Underutilization", "wlan.ext_bss.ss_underutilization",
27965       FT_UINT8, BASE_HEX, NULL, 0,
27966       NULL, HFILL }},
27967
27968     {&hf_ieee80211_ext_bss_observable_sec_20mhz_utilization,
27969      {"Observable Secondary 20MHz Utilization", "wlan.ext_bss.observable_sec_20mhz_utilization",
27970       FT_UINT8, BASE_HEX, NULL, 0,
27971       NULL, HFILL }},
27972
27973     {&hf_ieee80211_ext_bss_observable_sec_40mhz_utilization,
27974      {"Observable Secondary 40MHz Utilization", "wlan.ext_bss.observable_sec_40mhz_utilization",
27975       FT_UINT8, BASE_HEX, NULL, 0,
27976       NULL, HFILL }},
27977
27978     {&hf_ieee80211_ext_bss_observable_sec_80mhz_utilization,
27979      {"Observable Secondary 80MHz Utilization", "wlan.ext_bss.observable_sec_80mhz_utilization",
27980       FT_UINT8, BASE_HEX, NULL, 0,
27981       NULL, HFILL }},
27982
27983     {&hf_ieee80211_wide_bw_new_channel_width,
27984      {"New Channel Width", "wlan.wide_bw.new_channel_width",
27985       FT_UINT8, BASE_HEX, VALS(vht_operation_info_channel_width), 0x0,
27986       NULL, HFILL }},
27987
27988     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment0,
27989      {"New Channel Center Frequency Segment 0", "wlan.wide_bw.new_channel_center_freq_segment0",
27990       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
27991       NULL, HFILL }},
27992
27993     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment1,
27994      {"New Channel Center Frequency Segment 1", "wlan.wide_bw.new_channel_center_freq_segment1",
27995       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
27996       NULL, HFILL }},
27997
27998     {&hf_ieee80211_operat_notification_mode,
27999      {"Operating Mode Notification", "wlan.operat_notification_mode",
28000       FT_UINT8, BASE_HEX, NULL, 0x0,
28001       NULL, HFILL }},
28002
28003     {&hf_ieee80211_operat_mode_field_channel_width,
28004      {"Channel Width", "wlan.operat_mode_field.channelwidth",
28005       FT_UINT8, BASE_HEX, VALS(operating_mode_field_channel_width), 0x03,
28006       NULL, HFILL }},
28007
28008     {&hf_ieee80211_operat_mode_field_reserved,
28009      {"Reserved", "wlan.operat_mode_field.reserved",
28010       FT_UINT8, BASE_HEX, NULL, 0x0C,
28011       NULL, HFILL }},
28012
28013     {&hf_ieee80211_operat_mode_field_rxnss,
28014      {"Rx NSS", "wlan.operat_mode_field.rxnss",
28015       FT_UINT8, BASE_HEX, VALS(operat_mode_field_rxnss), 0x70,
28016       NULL, HFILL }},
28017
28018     {&hf_ieee80211_operat_mode_field_rxnsstype,
28019      {"Rx NSS Type", "wlan.operat_mode_field.rxnsstype",
28020       FT_UINT8, BASE_HEX, NULL, 0x80,
28021       "Indicate that the Rx NSS subfield carries the maximum number of spatial streams that the STA can receive", HFILL }},
28022
28023     {&hf_ieee80211_ampduparam,
28024      {"A-MPDU Parameters", "wlan.ht.ampduparam",
28025       FT_UINT8, BASE_HEX, NULL, 0,
28026       NULL, HFILL }},
28027
28028     {&hf_ieee80211_ampduparam_vs,
28029      {"A-MPDU Parameters (VS)", "wlan.vs.ht.ampduparam",
28030       FT_UINT8, BASE_HEX, NULL, 0,
28031       "Vendor Specific A-MPDU Parameters", HFILL }},
28032
28033     {&hf_ieee80211_ampduparam_mpdu,
28034      {"Maximum Rx A-MPDU Length", "wlan.ht.ampduparam.maxlength",
28035       FT_UINT8, BASE_HEX, 0, 0x03,
28036       NULL, HFILL }},
28037
28038     {&hf_ieee80211_ampduparam_mpdu_start_spacing,
28039      {"MPDU Density", "wlan.ht.ampduparam.mpdudensity",
28040       FT_UINT8, BASE_HEX, VALS(ampduparam_mpdu_start_spacing_flags), 0x1c,
28041       NULL, HFILL }},
28042
28043     {&hf_ieee80211_ampduparam_reserved,
28044      {"Reserved", "wlan.ht.ampduparam.reserved",
28045       FT_UINT8, BASE_HEX, NULL, 0xE0,
28046       NULL, HFILL }},
28047
28048     {&hf_ieee80211_mcsset,
28049      {"Rx Supported Modulation and Coding Scheme Set", "wlan.ht.mcsset",
28050       FT_STRING, BASE_NONE, NULL, 0,
28051       NULL, HFILL }},
28052
28053     {&hf_ieee80211_mcsset_vs,
28054      {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan.vs.ht.mcsset",
28055       FT_STRING, BASE_NONE, NULL, 0,
28056       "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
28057
28058     {&hf_ieee80211_mcsset_rx_bitmask,
28059      {"Rx Modulation and Coding Scheme (One bit per modulation)", "wlan.ht.mcsset.rxbitmask",
28060       FT_NONE, BASE_NONE, NULL, 0,
28061       "One bit per modulation", HFILL }},
28062
28063     {&hf_ieee80211_mcsset_rx_bitmask_0to7,
28064      {"Rx Bitmask Bits 0-7", "wlan.ht.mcsset.rxbitmask.0to7",
28065       FT_UINT32, BASE_HEX, 0, 0x000000ff,
28066       NULL, HFILL }},
28067
28068     {&hf_ieee80211_mcsset_rx_bitmask_8to15,
28069      {"Rx Bitmask Bits 8-15", "wlan.ht.mcsset.rxbitmask.8to15",
28070       FT_UINT32, BASE_HEX, 0, 0x0000ff00,
28071       NULL, HFILL }},
28072
28073     {&hf_ieee80211_mcsset_rx_bitmask_16to23,
28074      {"Rx Bitmask Bits 16-23", "wlan.ht.mcsset.rxbitmask.16to23",
28075       FT_UINT32, BASE_HEX, 0, 0x00ff0000,
28076       NULL, HFILL }},
28077
28078     {&hf_ieee80211_mcsset_rx_bitmask_24to31,
28079      {"Rx Bitmask Bits 24-31", "wlan.ht.mcsset.rxbitmask.24to31",
28080       FT_UINT32, BASE_HEX, 0, 0xff000000,
28081       NULL, HFILL }},
28082
28083     {&hf_ieee80211_mcsset_rx_bitmask_32,
28084      {"Rx Bitmask Bit 32", "wlan.ht.mcsset.rxbitmask.32",
28085       FT_UINT32, BASE_HEX, 0, 0x000001,
28086       NULL, HFILL }},
28087
28088     {&hf_ieee80211_mcsset_rx_bitmask_33to38,
28089      {"Rx Bitmask Bits 33-38", "wlan.ht.mcsset.rxbitmask.33to38",
28090       FT_UINT32, BASE_HEX, 0, 0x00007e,
28091       NULL, HFILL }},
28092
28093     {&hf_ieee80211_mcsset_rx_bitmask_39to52,
28094      {"Rx Bitmask Bits 39-52", "wlan.ht.mcsset.rxbitmask.39to52",
28095       FT_UINT32, BASE_HEX, 0, 0x1fff80,
28096       NULL, HFILL }},
28097
28098     {&hf_ieee80211_mcsset_rx_bitmask_53to76,
28099      {"Rx Bitmask Bits 53-76", "wlan.ht.mcsset.rxbitmask.53to76",
28100       FT_UINT32, BASE_HEX, 0, 0x1fffffe0,
28101       NULL, HFILL }},
28102
28103     {&hf_ieee80211_mcsset_highest_data_rate,
28104      {"Highest Supported Data Rate", "wlan.ht.mcsset.highestdatarate",
28105       FT_UINT16, BASE_HEX, 0, 0x03ff,
28106       NULL, HFILL }},
28107
28108     {&hf_ieee80211_mcsset_tx_mcs_set_defined,
28109      {"Tx Supported MCS Set", "wlan.ht.mcsset.txsetdefined",
28110       FT_BOOLEAN, 16, TFS(&tfs_defined_not_defined), 0x0001,
28111       NULL, HFILL }},
28112
28113     {&hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal,
28114      {"Tx and Rx MCS Set", "wlan.ht.mcsset.txrxmcsnotequal",
28115       FT_BOOLEAN, 16, TFS(&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
28116       NULL, HFILL }},
28117
28118     {&hf_ieee80211_mcsset_tx_max_spatial_streams,
28119      {"Maximum Number of Tx Spatial Streams Supported", "wlan.ht.mcsset.txmaxss",
28120       FT_UINT16, BASE_HEX, 0 , 0x000c,
28121       NULL, HFILL }},
28122
28123     {&hf_ieee80211_mcsset_tx_unequal_modulation,
28124      {"Unequal Modulation", "wlan.ht.mcsset.txunequalmod",
28125       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0010,
28126       NULL, HFILL }},
28127
28128     {&hf_ieee80211_htex_cap,
28129      {"HT Extended Capabilities", "wlan.htex.capabilities",
28130       FT_UINT16, BASE_HEX, NULL, 0,
28131       "HT Extended Capability information", HFILL }},
28132
28133     {&hf_ieee80211_htex_vs_cap,
28134      {"HT Extended Capabilities (VS)", "wlan.vs.htex.capabilities",
28135       FT_UINT16, BASE_HEX, NULL, 0,
28136       "Vendor Specific HT Extended Capability information", HFILL }},
28137
28138     {&hf_ieee80211_htex_pco,
28139      {"Transmitter supports PCO", "wlan.htex.capabilities.pco",
28140       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
28141       NULL, HFILL }},
28142
28143     {&hf_ieee80211_htex_transtime,
28144      {"Time needed to transition between 20MHz and 40MHz", "wlan.htex.capabilities.transtime",
28145       FT_UINT16, BASE_HEX, VALS(htex_transtime_flags), 0x0006,
28146       NULL, HFILL }},
28147
28148     {&hf_ieee80211_htex_mcs,
28149      {"MCS Feedback capability", "wlan.htex.capabilities.mcs",
28150       FT_UINT16, BASE_HEX, VALS(htex_mcs_flags), 0x0300,
28151       NULL, HFILL }},
28152
28153     {&hf_ieee80211_htex_htc_support,
28154      {"High Throughput", "wlan.htex.capabilities.htc",
28155       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400,
28156       NULL, HFILL }},
28157
28158     {&hf_ieee80211_htex_rd_responder,
28159      {"Reverse Direction Responder", "wlan.htex.capabilities.rdresponder",
28160       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800,
28161       NULL, HFILL }},
28162
28163     {&hf_ieee80211_txbf,
28164      {"Transmit Beam Forming (TxBF) Capabilities", "wlan.txbf",
28165       FT_UINT32, BASE_HEX, NULL, 0,
28166       NULL, HFILL }},
28167
28168     {&hf_ieee80211_txbf_vs,
28169      {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan.vs.txbf",
28170       FT_UINT32, BASE_HEX, NULL, 0,
28171       "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
28172
28173     {&hf_ieee80211_txbf_cap,
28174      {"Transmit Beamforming", "wlan.txbf.txbf",
28175       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
28176       NULL, HFILL }},
28177
28178     {&hf_ieee80211_txbf_rcv_ssc,
28179      {"Receive Staggered Sounding", "wlan.txbf.rxss",
28180       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
28181       NULL, HFILL }},
28182
28183     {&hf_ieee80211_txbf_tx_ssc,
28184      {"Transmit Staggered Sounding", "wlan.txbf.txss",
28185       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
28186       NULL, HFILL }},
28187
28188     {&hf_ieee80211_txbf_rcv_ndp,
28189      {"Receive Null Data packet (NDP)", "wlan.txbf.rxndp",
28190       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
28191       NULL, HFILL }},
28192
28193     {&hf_ieee80211_txbf_tx_ndp,
28194      {"Transmit Null Data packet (NDP)", "wlan.txbf.txndp",
28195       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
28196       NULL, HFILL }},
28197
28198     {&hf_ieee80211_txbf_impl_txbf,
28199      {"Implicit TxBF capable", "wlan.txbf.impltxbf",
28200       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
28201       "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
28202
28203     {&hf_ieee80211_txbf_calib,
28204      {"Calibration", "wlan.txbf.calibration",
28205       FT_UINT32, BASE_HEX, VALS(txbf_calib_flag), 0x000000c0,
28206       NULL, HFILL }},
28207
28208     {&hf_ieee80211_txbf_expl_csi,
28209      {"STA can apply TxBF using CSI explicit feedback", "wlan.txbf.csi",
28210       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
28211       "Station can apply TxBF using CSI explicit feedback", HFILL }},
28212
28213     {&hf_ieee80211_txbf_expl_uncomp_fm,
28214      {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan.txbf.fm.uncompressed.tbf",
28215       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
28216       "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
28217
28218     {&hf_ieee80211_txbf_expl_comp_fm,
28219      {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan.txbf.fm.compressed.tbf",
28220       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
28221       "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
28222
28223     {&hf_ieee80211_txbf_expl_bf_csi,
28224      {"Receiver can return explicit CSI feedback", "wlan.txbf.rcsi",
28225       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00001800,
28226       NULL, HFILL }},
28227
28228     {&hf_ieee80211_txbf_expl_uncomp_fm_feed,
28229      {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan.txbf.fm.uncompressed.rbf",
28230       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00006000,
28231       NULL, HFILL }},
28232
28233     {&hf_ieee80211_txbf_expl_comp_fm_feed,
28234      {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan.txbf.fm.compressed.bf",
28235       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00018000,
28236       "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
28237
28238     {&hf_ieee80211_txbf_min_group,
28239      {"Minimal grouping used for explicit feedback reports", "wlan.txbf.mingroup",
28240       FT_UINT32, BASE_HEX, VALS(txbf_min_group_flags), 0x00060000,
28241       NULL, HFILL }},
28242
28243     {&hf_ieee80211_vht_cap,
28244      {"VHT Capabilities Info", "wlan.vht.capabilities",
28245       FT_UINT32, BASE_HEX, NULL, 0,
28246       "VHT Capabilities information", HFILL }},
28247
28248     {&hf_ieee80211_vht_max_mpdu_length,
28249      {"Maximum MPDU Length", "wlan.vht.capabilities.maxmpdulength",
28250       FT_UINT32, BASE_HEX, VALS(vht_max_mpdu_length_flag), 0x00000003,
28251       "In Octets unit", HFILL }},
28252
28253     {&hf_ieee80211_vht_supported_chan_width_set,
28254      {"Supported Channel Width Set", "wlan.vht.capabilities.supportedchanwidthset",
28255       FT_UINT32, BASE_HEX, VALS(vht_supported_chan_width_set_flag), 0x0000000c,
28256       NULL, HFILL }},
28257
28258     {&hf_ieee80211_vht_rx_ldpc,
28259      {"Rx LDPC", "wlan.vht.capabilities.rxldpc",
28260       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
28261       NULL, HFILL }},
28262
28263     {&hf_ieee80211_vht_short_gi_for_80,
28264      {"Short GI for 80MHz/TVHT_MODE_4C", "wlan.vht.capabilities.short80",
28265       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
28266       NULL, HFILL }},
28267
28268     {&hf_ieee80211_vht_short_gi_for_160,
28269      {"Short GI for 160MHz and 80+80MHz", "wlan.vht.capabilities.short160",
28270       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
28271       NULL, HFILL }},
28272
28273     {&hf_ieee80211_vht_tx_stbc,
28274      {"Tx STBC", "wlan.vht.capabilities.txstbc",
28275       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
28276       NULL, HFILL }},
28277
28278     {&hf_ieee80211_vht_rx_stbc,
28279      {"Rx STBC", "wlan.vht.capabilities.rxstbc",
28280       FT_UINT32, BASE_HEX, VALS(vht_rx_stbc_flag), 0x00000700,
28281       NULL, HFILL }},
28282
28283     {&hf_ieee80211_vht_su_beamformer_cap,
28284      {"SU Beamformer Capable", "wlan.vht.capabilities.subeamformer",
28285       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
28286       NULL, HFILL }},
28287
28288     {&hf_ieee80211_vht_su_beamformee_cap,
28289      {"SU Beamformee Capable", "wlan.vht.capabilities.subeamformee",
28290       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
28291       NULL, HFILL }},
28292
28293     {&hf_ieee80211_vht_beamformer_antennas,
28294      {"Beamformee STS Capability", "wlan.vht.capabilities.beamformee_sts_cap",
28295       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x0000e000,
28296       NULL, HFILL }},
28297
28298     {&hf_ieee80211_vht_sounding_dimensions,
28299      {"Number of Sounding Dimensions", "wlan.vht.capabilities.soundingdimensions",
28300       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x00070000,
28301       NULL, HFILL }},
28302
28303     {&hf_ieee80211_vht_mu_beamformer_cap,
28304      {"MU Beamformer Capable", "wlan.vht.capabilities.mubeamformer",
28305       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
28306       NULL, HFILL }},
28307
28308     {&hf_ieee80211_vht_mu_beamformee_cap,
28309      {"MU Beamformee Capable", "wlan.vht.capabilities.mubeamformee",
28310       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
28311       NULL, HFILL }},
28312
28313     {&hf_ieee80211_vht_txop_ps,
28314      {"TXOP PS", "wlan.vht.capabilities.vhttxopps",
28315       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
28316       NULL, HFILL }},
28317
28318     {&hf_ieee80211_vht_var_htc_field,
28319      {"+HTC-VHT Capable", "wlan.vht.capabilities.vhthtc",
28320       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
28321       NULL, HFILL }},
28322
28323     {&hf_ieee80211_vht_max_ampdu,
28324      {"Max A-MPDU Length Exponent", "wlan.vht.capabilities.maxampdu",
28325       FT_UINT32, BASE_HEX, VALS(vht_max_ampdu_flag), 0x03800000,
28326       "In Octets unit", HFILL }},
28327
28328     {&hf_ieee80211_vht_link_adaptation_cap,
28329      {"VHT Link Adaptation", "wlan.vht.capabilities.linkadapt",
28330       FT_UINT32, BASE_HEX, VALS(vht_link_adapt_flag), 0x0c000000,
28331       NULL, HFILL }},
28332
28333     {&hf_ieee80211_vht_rx_pattern,
28334      {"Rx Antenna Pattern Consistency", "wlan.vht.capabilities.rxpatconsist",
28335       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x10000000,
28336       NULL, HFILL }},
28337
28338     {&hf_ieee80211_vht_tx_pattern,
28339      {"Tx Antenna Pattern Consistency", "wlan.vht.capabilities.txpatconsist",
28340       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x20000000,
28341       NULL, HFILL }},
28342
28343     {&hf_ieee80211_vht_ext_nss_bw_support,
28344      {"Extended NSS BW Support", "wlan.vht.capabilities.ext_nss_bw_support",
28345       FT_UINT32, BASE_HEX, NULL, 0xc0000000,
28346       NULL, HFILL }},
28347
28348     {&hf_ieee80211_vht_mcsset,
28349      {"VHT Supported MCS Set", "wlan.vht.mcsset",
28350       FT_NONE, BASE_NONE, NULL, 0,
28351       NULL, HFILL }},
28352
28353     {&hf_ieee80211_vht_mcsset_rx_mcs_map,
28354      {"Rx MCS Map", "wlan.vht.mcsset.rxmcsmap",
28355       FT_UINT16, BASE_HEX, NULL, 0,
28356       NULL, HFILL }},
28357
28358     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
28359      {"Rx 1 SS", "wlan.vht.mcsset.rxmcsmap.ss1",
28360       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
28361       NULL, HFILL }},
28362
28363     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
28364      {"Rx 2 SS", "wlan.vht.mcsset.rxmcsmap.ss2",
28365       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
28366       NULL, HFILL }},
28367
28368     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
28369      {"Rx 3 SS", "wlan.vht.mcsset.rxmcsmap.ss3",
28370       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
28371       NULL, HFILL }},
28372
28373     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
28374      {"Rx 4 SS", "wlan.vht.mcsset.rxmcsmap.ss4",
28375       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
28376       NULL, HFILL }},
28377
28378     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
28379      {"Rx 5 SS", "wlan.vht.mcsset.rxmcsmap.ss5",
28380       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
28381       NULL, HFILL }},
28382
28383     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
28384      {"Rx 6 SS", "wlan.vht.mcsset.rxmcsmap.ss6",
28385       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
28386       NULL, HFILL }},
28387
28388     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
28389      {"Rx 7 SS", "wlan.vht.mcsset.rxmcsmap.ss7",
28390       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
28391       NULL, HFILL }},
28392
28393     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
28394      {"Rx 8 SS", "wlan.vht.mcsset.rxmcsmap.ss8",
28395       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
28396       NULL, HFILL }},
28397
28398     {&hf_ieee80211_vht_mcsset_max_nsts_total,
28399      {"MaX NSTS Total", "wlan.vht.mcsset.max_nsts_total",
28400       FT_UINT16, BASE_DEC, NULL, 0xe000, NULL, HFILL }},
28401
28402     {&hf_ieee80211_vht_mcsset_rx_highest_long_gi,
28403      {"Rx Highest Long GI Data Rate (in Mb/s, 0 = subfield not in use)", "wlan.vht.mcsset.rxhighestlonggirate",
28404       FT_UINT16, BASE_HEX, NULL, 0x1fff,
28405       NULL, HFILL }},
28406
28407     {&hf_ieee80211_vht_mcsset_tx_mcs_map,
28408      {"Tx MCS Map", "wlan.vht.mcsset.txmcsmap",
28409       FT_UINT16, BASE_HEX, NULL, 0,
28410       NULL, HFILL }},
28411
28412     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
28413      {"Tx 1 SS", "wlan.vht.mcsset.txmcsmap.ss1",
28414       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
28415       NULL, HFILL }},
28416
28417     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
28418      {"Tx 2 SS", "wlan.vht.mcsset.txmcsmap.ss2",
28419       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
28420       NULL, HFILL }},
28421
28422     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
28423      {"Tx 3 SS", "wlan.vht.mcsset.txmcsmap.ss3",
28424       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
28425       NULL, HFILL }},
28426
28427     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
28428      {"Tx 4 SS", "wlan.vht.mcsset.txmcsmap.ss4",
28429       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
28430       NULL, HFILL }},
28431
28432     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
28433      {"Tx 5 SS", "wlan.vht.mcsset.txmcsmap.ss5",
28434       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
28435       NULL, HFILL }},
28436
28437     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
28438      {"Tx 6 SS", "wlan.vht.mcsset.txmcsmap.ss6",
28439       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
28440       NULL, HFILL }},
28441
28442     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
28443      {"Tx 7 SS", "wlan.vht.mcsset.txmcsmap.ss7",
28444       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
28445       NULL, HFILL }},
28446
28447     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
28448      {"Tx 8 SS", "wlan.vht.mcsset.txmcsmap.ss8",
28449       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
28450       NULL, HFILL }},
28451
28452     {&hf_ieee80211_vht_mcsset_tx_highest_long_gi,
28453      {"Tx Highest Long GI Data Rate  (in Mb/s, 0 = subfield not in use)", "wlan.vht.mcsset.txhighestlonggirate",
28454       FT_UINT16, BASE_HEX, NULL, 0x1fff,
28455       NULL, HFILL }},
28456
28457     {&hf_ieee80211_vht_mcsset_ext_nss_bw_cap,
28458      {"Extended NSS BW Capable", "wlan.vht.ncsset.ext_nss_bw_cap",
28459       FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x2000, NULL, HFILL }},
28460
28461     {&hf_ieee80211_vht_mcsset_reserved,
28462      {"Reserved", "wlan.vht.ncsset.reserved",
28463       FT_UINT16, BASE_HEX, NULL, 0xc000, NULL, HFILL }},
28464
28465     {&hf_ieee80211_vht_op,
28466      {"VHT Operation Info", "wlan.vht.op",
28467       FT_NONE, BASE_NONE, NULL, 0,
28468       NULL, HFILL }},
28469
28470     {&hf_ieee80211_vht_op_channel_width,
28471      {"Channel Width", "wlan.vht.op.channelwidth",
28472       FT_UINT8, BASE_HEX, VALS(vht_op_channel_width_flag), 0,
28473       NULL, HFILL }},
28474
28475     {&hf_ieee80211_vht_op_channel_center0,
28476      {"Channel Center Segment 0", "wlan.vht.op.channelcenter0",
28477       FT_UINT8, BASE_DEC, NULL, 0,
28478       NULL, HFILL }},
28479
28480     {&hf_ieee80211_vht_op_channel_center1,
28481      {"Channel Center Segment 1", "wlan.vht.op.channelcenter1",
28482       FT_UINT8, BASE_DEC, NULL, 0,
28483       NULL, HFILL }},
28484
28485     {&hf_ieee80211_vht_op_basic_mcs_map,
28486      {"Basic MCS Map", "wlan.vht.op.basicmcsmap",
28487       FT_UINT16, BASE_HEX, NULL, 0,
28488       NULL, HFILL }},
28489
28490     {&hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
28491      {"Basic 1 SS", "wlan.vht.op.basicmcsmap.ss1",
28492       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
28493       NULL, HFILL }},
28494
28495     {&hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
28496      {"Basic 2 SS", "wlan.vht.op.basicmcsmap.ss2",
28497       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
28498       NULL, HFILL }},
28499
28500     {&hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
28501      {"Basic 3 SS", "wlan.vht.op.basicmcsmap.ss3",
28502       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
28503       NULL, HFILL }},
28504
28505     {&hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
28506      {"Basic 4 SS", "wlan.vht.op.basicmcsmap.ss4",
28507       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
28508       NULL, HFILL }},
28509
28510     {&hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
28511      {"Basic 5 SS", "wlan.vht.op.basicmcsmap.ss5",
28512       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
28513       NULL, HFILL }},
28514
28515     {&hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
28516      {"Basic 6 SS", "wlan.vht.op.basicmcsmap.ss6",
28517       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
28518       NULL, HFILL }},
28519
28520     {&hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
28521      {"Basic 7 SS", "wlan.vht.op.basicmcsmap.ss7",
28522       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
28523       NULL, HFILL }},
28524
28525     {&hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
28526      {"Basic 8 SS", "wlan.vht.op.basicmcsmap.ss8",
28527       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
28528       NULL, HFILL }},
28529
28530     {&hf_ieee80211_vht_tpe_pwr_info,
28531      {"Tx Pwr Info", "wlan.vht.tpe.pwr_info",
28532       FT_UINT8, BASE_HEX, NULL, 0,
28533       NULL, HFILL }},
28534
28535     {&hf_ieee80211_vht_tpe_pwr_info_count,
28536      {"Max Tx Pwr Count", "wlan.vht.tpe.pwr_info.count",
28537       FT_UINT8, BASE_DEC, NULL , 0x07,
28538       NULL, HFILL }},
28539
28540     {&hf_ieee80211_vht_tpe_pwr_info_unit,
28541      {"Max Tx Pwr Unit Interpretation", "wlan.vht.tpe.pwr_info.unit",
28542       FT_UINT8, BASE_DEC, VALS(vht_tpe_pwr_units) , 0x38,
28543       NULL, HFILL }},
28544
28545     {&hf_ieee80211_vht_tpe_pwr_info_reserved,
28546      {"Reserved", "wlan.vht.tpe.pwr_info.reserved",
28547       FT_UINT8, BASE_DEC, NULL , 0xC0,
28548       NULL, HFILL }},
28549
28550     {&hf_ieee80211_vht_tpe_pwr_constr_20,
28551      {"Local Max Tx Pwr Constraint 20MHz", "wlan.vht.tpe.pwr_constr_20",
28552       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
28553       NULL, HFILL }},
28554
28555     {&hf_ieee80211_vht_tpe_pwr_constr_40,
28556      {"Local Max Tx Pwr Constraint 40MHz", "wlan.vht.tpe.pwr_constr_40",
28557       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
28558       NULL, HFILL }},
28559
28560     {&hf_ieee80211_vht_tpe_pwr_constr_80,
28561      {"Local Max Tx Pwr Constraint 80MHz", "wlan.vht.tpe.pwr_constr_80",
28562       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
28563       NULL, HFILL }},
28564
28565     {&hf_ieee80211_vht_tpe_pwr_constr_160,
28566      {"Local Max Tx Pwr Constraint 160MHz/80+80 MHz", "wlan.vht.tpe.pwr_constr_160",
28567       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
28568       NULL, HFILL }},
28569
28570     {&hf_ieee80211_txbf_csi_num_bf_ant,
28571      {"Max antennae STA can support when CSI feedback required", "wlan.txbf.csinumant",
28572       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00180000,
28573       "Max antennae station can support when CSI feedback required", HFILL }},
28574
28575     {&hf_ieee80211_txbf_uncomp_sm_bf_ant,
28576      {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan.txbf.fm.uncompressed.maxant",
28577       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00600000,
28578       "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
28579
28580     {&hf_ieee80211_txbf_comp_sm_bf_ant,
28581      {"Max antennae STA can support when compressed Beamforming feedback required", "wlan.txbf.fm.compressed.maxant",
28582       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x01800000,
28583       "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
28584
28585     {&hf_ieee80211_txbf_csi_max_rows_bf,
28586      {"Maximum number of rows of CSI explicit feedback", "wlan.txbf.csi.maxrows",
28587       FT_UINT32, BASE_HEX, VALS(txbf_csi_max_rows_bf_flags), 0x06000000,
28588       NULL, HFILL }},
28589
28590     {&hf_ieee80211_txbf_chan_est,
28591      {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan.txbf.channelest",
28592       FT_UINT32, BASE_HEX, VALS(txbf_chan_est_flags), 0x18000000,
28593       NULL, HFILL }},
28594
28595     {&hf_ieee80211_txbf_resrv,
28596      {"Reserved", "wlan.txbf.reserved",
28597       FT_UINT32, BASE_HEX, NULL, 0xe0000000,
28598       NULL, HFILL }},
28599
28600     {&hf_ieee80211_hta_cc,
28601      {"HT Control Channel", "wlan.hta.control_channel",
28602       FT_UINT8, BASE_DEC, NULL, 0,
28603       NULL, HFILL }},
28604
28605     {&hf_ieee80211_hta_cap1,
28606      {"HT Additional Capabilities", "wlan.hta.capabilities",
28607       FT_UINT8, BASE_HEX, NULL, 0,
28608       "HT Additional Capability information", HFILL }},
28609
28610     {&hf_ieee80211_hta_cap2,
28611      {"HT Additional Capabilities", "wlan.hta.capabilities",
28612       FT_UINT16, BASE_HEX, NULL, 0,
28613       "HT Additional Capability information", HFILL }},
28614
28615     {&hf_ieee80211_hta_ext_chan_offset,
28616      {"Extension Channel Offset", "wlan.hta.capabilities.ext_chan_offset",
28617       FT_UINT16, BASE_HEX, VALS(hta_ext_chan_offset_flag), 0x0003,
28618       NULL, HFILL }},
28619
28620     {&hf_ieee80211_hta_rec_tx_width,
28621      {"Recommended Tx Channel Width", "wlan.hta.capabilities.rec_tx_width",
28622       FT_BOOLEAN, 16, TFS(&hta_rec_tx_width_flag), 0x0004,
28623       "Recommended Transmit Channel Width", HFILL }},
28624
28625     {&hf_ieee80211_hta_rifs_mode,
28626      {"Reduced Interframe Spacing (RIFS) Mode", "wlan.hta.capabilities.rifs_mode",
28627       FT_BOOLEAN, 16, TFS(&hta_rifs_mode_flag), 0x0008,
28628       NULL, HFILL }},
28629
28630     {&hf_ieee80211_hta_controlled_access,
28631      {"Controlled Access Only", "wlan.hta.capabilities.controlled_access",
28632       FT_BOOLEAN, 16, TFS(&hta_controlled_access_flag), 0x0010,
28633       NULL, HFILL }},
28634
28635     {&hf_ieee80211_hta_service_interval,
28636      {"Service Interval Granularity", "wlan.hta.capabilities.service_interval",
28637       FT_UINT16, BASE_HEX, VALS(hta_service_interval_flag), 0x00E0,
28638       NULL, HFILL }},
28639
28640     {&hf_ieee80211_hta_operating_mode,
28641      {"Operating Mode", "wlan.hta.capabilities.operating_mode",
28642       FT_UINT16, BASE_HEX, VALS(hta_operating_mode_flag), 0x0003,
28643       NULL, HFILL }},
28644
28645     {&hf_ieee80211_hta_non_gf_devices,
28646      {"Non Greenfield (GF) devices Present", "wlan.hta.capabilities.non_gf_devices",
28647       FT_BOOLEAN, 16, TFS(&hta_non_gf_devices_flag), 0x0004,
28648       "on Greenfield (GF) devices Present", HFILL }},
28649
28650     {&hf_ieee80211_hta_basic_stbc_mcs,
28651      {"Basic STB Modulation and Coding Scheme (MCS)", "wlan.hta.capabilities.basic_stbc_mcs",
28652       FT_UINT16, BASE_HEX, NULL , 0x007f,
28653       NULL, HFILL }},
28654
28655     {&hf_ieee80211_hta_dual_stbc_protection,
28656      {"Dual Clear To Send (CTS) Protection", "wlan.hta.capabilities.dual_stbc_protection",
28657       FT_BOOLEAN, 16, TFS(&hta_dual_stbc_protection_flag), 0x0080,
28658       NULL, HFILL }},
28659
28660     {&hf_ieee80211_hta_secondary_beacon,
28661      {"Secondary Beacon", "wlan.hta.capabilities.secondary_beacon",
28662       FT_BOOLEAN, 16, TFS(&hta_secondary_beacon_flag), 0x0100,
28663       NULL, HFILL }},
28664
28665     {&hf_ieee80211_hta_lsig_txop_protection,
28666      {"L-SIG TXOP Protection Support", "wlan.hta.capabilities.lsig_txop_protection",
28667       FT_BOOLEAN, 16, TFS(&hta_lsig_txop_protection_flag), 0x0200,
28668       NULL, HFILL }},
28669
28670     {&hf_ieee80211_hta_pco_active,
28671      {"Phased Coexistence Operation (PCO) Active", "wlan.hta.capabilities.pco_active",
28672       FT_BOOLEAN, 16, TFS(&hta_pco_active_flag), 0x0400,
28673       NULL, HFILL }},
28674
28675     {&hf_ieee80211_hta_pco_phase,
28676      {"Phased Coexistence Operation (PCO) Phase", "wlan.hta.capabilities.pco_phase",
28677       FT_BOOLEAN, 16, TFS(&hta_pco_phase_flag), 0x0800,
28678       NULL, HFILL }},
28679
28680     {&hf_ieee80211_antsel,
28681      {"Antenna Selection (ASEL) Capabilities", "wlan.asel",
28682       FT_UINT8, BASE_HEX, NULL, 0,
28683       NULL, HFILL }},
28684
28685     {&hf_ieee80211_antsel_vs,
28686      {"Antenna Selection (ASEL) Capabilities (VS)", "wlan.vs.asel",
28687       FT_UINT8, BASE_HEX, NULL, 0,
28688       "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
28689
28690     {&hf_ieee80211_antsel_b0,
28691      {"Antenna Selection Capable", "wlan.asel.capable",
28692       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28693       NULL, HFILL }},
28694
28695     {&hf_ieee80211_antsel_b1,
28696      {"Explicit CSI Feedback Based Tx ASEL", "wlan.asel.txcsi",
28697       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
28698       NULL, HFILL }},
28699
28700     {&hf_ieee80211_antsel_b2,
28701      {"Antenna Indices Feedback Based Tx ASEL", "wlan.asel.txif",
28702       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
28703       NULL, HFILL }},
28704
28705     {&hf_ieee80211_antsel_b3,
28706      {"Explicit CSI Feedback", "wlan.asel.csi",
28707       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
28708       NULL, HFILL }},
28709
28710     {&hf_ieee80211_antsel_b4,
28711      {"Antenna Indices Feedback", "wlan.asel.if",
28712       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
28713       NULL, HFILL }},
28714
28715     {&hf_ieee80211_antsel_b5,
28716      {"Rx ASEL", "wlan.asel.rx",
28717       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
28718       NULL, HFILL }},
28719
28720     {&hf_ieee80211_antsel_b6,
28721      {"Tx Sounding PPDUs", "wlan.asel.sppdu",
28722       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28723       NULL, HFILL }},
28724
28725     {&hf_ieee80211_antsel_b7,
28726      {"Reserved", "wlan.asel.reserved",
28727       FT_UINT8, BASE_HEX, NULL, 0x80,
28728       NULL, HFILL }},
28729
28730     {&hf_ieee80211_ht_info_delimiter1,
28731      {"HT Information Subset (1 of 3)", "wlan.ht.info.delim1",
28732       FT_UINT8, BASE_HEX, NULL, 0,
28733       NULL, HFILL }},
28734
28735     {&hf_ieee80211_ht_info_primary_channel,
28736      {"Primary Channel", "wlan.ht.info.primarychannel",
28737       FT_UINT8, BASE_DEC, NULL, 0,
28738       NULL, HFILL }},
28739
28740     {&hf_ieee80211_ht_info_secondary_channel_offset,
28741      {"Secondary channel offset", "wlan.ht.info.secchanoffset",
28742       FT_UINT8, BASE_HEX, VALS(ht_info_secondary_channel_offset_flags), 0x03,
28743       NULL, HFILL }},
28744
28745     {&hf_ieee80211_ht_info_sta_channel_width,
28746      {"Supported channel width", "wlan.ht.info.chanwidth",
28747       FT_BOOLEAN, 8, TFS(&ht_info_channel_sta_width_flag), 0x04,
28748       NULL, HFILL }},
28749
28750     {&hf_ieee80211_ht_info_rifs_mode,
28751      {"Reduced Interframe Spacing (RIFS)", "wlan.ht.info.rifs",
28752       FT_BOOLEAN, 8, TFS(&ht_info_rifs_mode_flag), 0x08,
28753       NULL, HFILL }},
28754
28755     {&hf_ieee80211_ht_info_reserved_b4_b7,
28756      {"Reserved", "wlan.ht.info.reserved_b4_b7",
28757       FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL }},
28758
28759     {&hf_ieee80211_ht_info_delimiter2,
28760      {"HT Information Subset (2 of 3)", "wlan.ht.info.delim2",
28761       FT_UINT16, BASE_HEX, NULL, 0,
28762       NULL, HFILL }},
28763
28764     {&hf_ieee80211_ht_info_protection,
28765      {"HT Protection", "wlan.ht.info.ht_protection",
28766       FT_UINT16, BASE_HEX, VALS(ht_info_operating_protection_mode_flags), 0x0003,
28767       NULL, HFILL }},
28768
28769     {&hf_ieee80211_ht_info_non_greenfield_sta_present,
28770      {"Non-greenfield STAs present", "wlan.ht.info.greenfield",
28771       FT_BOOLEAN, 16, TFS(&ht_info_non_greenfield_sta_present_flag), 0x0004,
28772       NULL, HFILL }},
28773
28774     {&hf_ieee80211_ht_info_reserved_b11,
28775      {"Reserved", "wlan.ht.info.reserved_b11",
28776       FT_UINT16, BASE_HEX, NULL, 0x0008, NULL, HFILL }},
28777
28778     {&hf_ieee80211_ht_info_obss_non_ht_stas_present,
28779      {"OBSS non-HT STAs present", "wlan.ht.info.obssnonht",
28780       FT_BOOLEAN, 16, TFS(&ht_info_obss_non_ht_stas_present_flag), 0x0010,
28781       NULL, HFILL }},
28782
28783     {&hf_ieee80211_ht_info_channel_center_freq_seg_2,
28784      {"Channel Center Frequency Segment 2", "wlan.ht.info.chan_center_freq_seg_2",
28785       FT_UINT16, BASE_DEC, NULL, 0x1fe0, NULL, HFILL }},
28786
28787     {&hf_ieee80211_ht_info_reserved_b21_b23,
28788      {"Reserved", "wlan.ht.info.reserved_b21_b23",
28789       FT_UINT16, BASE_HEX, NULL, 0xe000,
28790       NULL, HFILL }},
28791
28792     {&hf_ieee80211_ht_info_delimiter3,
28793      {"HT Information Subset (3 of 3)", "wlan.ht.info.delim3",
28794       FT_UINT16, BASE_HEX, NULL, 0,
28795       NULL, HFILL }},
28796
28797     {&hf_ieee80211_ht_info_reserved_b24_b29,
28798      {"Reserved", "wlan.ht.info.reserved_b24_b29",
28799       FT_UINT16, BASE_HEX, NULL, 0x003f, NULL, HFILL }},
28800
28801     {&hf_ieee80211_ht_info_dual_beacon,
28802      {"Dual beacon", "wlan.ht.info.dualbeacon",
28803       FT_BOOLEAN, 16, TFS(&ht_info_dual_beacon_flag), 0x0040,
28804       NULL, HFILL }},
28805
28806     {&hf_ieee80211_ht_info_dual_cts_protection,
28807      {"Dual Clear To Send (CTS) protection", "wlan.ht.info.dualcts",
28808       FT_BOOLEAN, 16, TFS(&tfs_required_not_required), 0x0080,
28809       NULL, HFILL }},
28810
28811     {&hf_ieee80211_ht_info_secondary_beacon,
28812      {"Beacon ID", "wlan.ht.info.secondarybeacon",
28813       FT_BOOLEAN, 16, TFS(&ht_info_secondary_beacon_flag), 0x0100,
28814       NULL, HFILL }},
28815
28816     {&hf_ieee80211_ht_info_lsig_txop_protection_full_support,
28817      {"L-SIG TXOP Protection Full Support", "wlan.ht.info.lsigprotsupport",
28818       FT_BOOLEAN, 16, TFS(&ht_info_lsig_txop_protection_full_support_flag), 0x0200,
28819       NULL, HFILL }},
28820
28821     {&hf_ieee80211_ht_info_pco_active,
28822      {"Phased Coexistence Operation (PCO)", "wlan.ht.info.pco.active",
28823       FT_BOOLEAN, 16, TFS(&tfs_active_inactive), 0x0400,
28824       NULL, HFILL }},
28825
28826     {&hf_ieee80211_ht_info_pco_phase,
28827      {"Phased Coexistence Operation (PCO) Phase", "wlan.ht.info.pco.phase",
28828       FT_BOOLEAN, 16, TFS(&ht_info_pco_phase_flag), 0x0800,
28829       NULL, HFILL }},
28830
28831     {&hf_ieee80211_ht_info_reserved_b36_b39,
28832      {"Reserved", "wlan.ht.info.reserved_b36_b39",
28833       FT_UINT16, BASE_HEX, NULL, 0xf000,
28834       NULL, HFILL }},
28835
28836     {&hf_ieee80211_tag_ap_channel_report_operating_class,
28837      {"Operating Class", "wlan.ap_channel_report.operating_class",
28838       FT_UINT8, BASE_DEC, NULL, 0,
28839       NULL, HFILL }},
28840
28841     {&hf_ieee80211_tag_ap_channel_report_channel_list,
28842      {"Channel List", "wlan.ap_channel_report.channel_list",
28843       FT_UINT8, BASE_DEC, NULL, 0,
28844       NULL, HFILL }},
28845
28846     {&hf_ieee80211_tag_secondary_channel_offset,
28847      {"Secondary Channel Offset", "wlan.secchanoffset",
28848       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_secondary_channel_offset_flags), 0,
28849       NULL, HFILL }},
28850
28851     {&hf_ieee80211_tag_bss_ap_avg_access_delay,
28852      {"AP Average Access Delay", "wlan.bss_ap_avg_access_delay",
28853       FT_UINT8, BASE_DEC, NULL, 0x0,
28854       NULL, HFILL }},
28855
28856     {&hf_ieee80211_tag_antenna_id,
28857      {"Antenna ID", "wlan.antenna.id",
28858       FT_UINT8, BASE_DEC, NULL, 0x0,
28859       NULL, HFILL }},
28860
28861     {&hf_ieee80211_tag_rsni,
28862      {"RSNI", "wlan.rsni",
28863       FT_UINT8, BASE_CUSTOM, CF_FUNC(rsni_base_custom), 0x0,
28864       NULL, HFILL }},
28865
28866     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
28867      {"Available Admission Capacity Bitmask", "wlan.bss_avb_adm_cap.bitmask",
28868       FT_UINT16, BASE_HEX, NULL, 0,
28869       NULL, HFILL }},
28870     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
28871      {"UP0 (bit0)", "wlan.bss_avb_adm_cap.bitmask.up0",
28872       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP0,
28873       NULL, HFILL }},
28874     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
28875      {"UP1 (bit1)", "wlan.bss_avb_adm_cap.bitmask.up1",
28876       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP1,
28877       NULL, HFILL }},
28878     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
28879      {"UP2 (bit2)", "wlan.bss_avb_adm_cap.bitmask.up2",
28880       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP2,
28881       NULL, HFILL }},
28882     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
28883      {"UP3 (bit3)", "wlan.bss_avb_adm_cap.bitmask.up3",
28884       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP3,
28885       NULL, HFILL }},
28886     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
28887      {"UP4 (bit4)", "wlan.bss_avb_adm_cap.bitmask.up4",
28888       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP4,
28889       NULL, HFILL }},
28890     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
28891      {"UP5 (bit5)", "wlan.bss_avb_adm_cap.bitmask.up5",
28892       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP5,
28893       NULL, HFILL }},
28894     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
28895      {"UP0 (bit6)", "wlan.bss_avb_adm_cap.bitmask.up6",
28896       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP6,
28897       NULL, HFILL }},
28898     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
28899      {"UP7 (bit7)", "wlan.bss_avb_adm_cap.bitmask.up7",
28900       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP7,
28901       NULL, HFILL }},
28902     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
28903      {"AC0 (bit8)", "wlan.bss_avb_adm_cap.bitmask.ac0",
28904       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC0,
28905       NULL, HFILL }},
28906     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
28907      {"AC1 (bit9)", "wlan.bss_avb_adm_cap.bitmask.AC1",
28908       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC1,
28909       NULL, HFILL }},
28910     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
28911      {"AC2 (bit10)", "wlan.bss_avb_adm_cap.bitmask.ac2",
28912       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC2,
28913       NULL, HFILL }},
28914     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
28915      {"AC3 (bit11)", "wlan.bss_avb_adm_cap.bitmask.ac3",
28916       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC3,
28917       NULL, HFILL }},
28918     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
28919      {"Reserved", "wlan.bss_avb_adm_cap.bitmask.rsv",
28920       FT_UINT16, BASE_HEX, NULL, BSS_BITMASK_RSV,
28921       NULL, HFILL }},
28922     {&hf_ieee80211_tag_bss_avb_adm_cap_up0,
28923      {"UP0", "wlan.bss_avb_adm_cap.up0",
28924       FT_UINT16, BASE_DEC, NULL, 0x0,
28925       NULL, HFILL }},
28926     {&hf_ieee80211_tag_bss_avb_adm_cap_up1,
28927      {"UP1", "wlan.bss_avb_adm_cap.up1",
28928       FT_UINT16, BASE_DEC, NULL, 0x0,
28929       NULL, HFILL }},
28930     {&hf_ieee80211_tag_bss_avb_adm_cap_up2,
28931      {"UP2", "wlan.bss_avb_adm_cap.up2",
28932       FT_UINT16, BASE_DEC, NULL, 0x0,
28933       NULL, HFILL }},
28934     {&hf_ieee80211_tag_bss_avb_adm_cap_up3,
28935      {"UP3", "wlan.bss_avb_adm_cap.up3",
28936       FT_UINT16, BASE_DEC, NULL, 0x0,
28937       NULL, HFILL }},
28938     {&hf_ieee80211_tag_bss_avb_adm_cap_up4,
28939      {"UP4", "wlan.bss_avb_adm_cap.up4",
28940       FT_UINT16, BASE_DEC, NULL, 0x0,
28941       NULL, HFILL }},
28942     {&hf_ieee80211_tag_bss_avb_adm_cap_up5,
28943      {"UP5", "wlan.bss_avb_adm_cap.up5",
28944       FT_UINT16, BASE_DEC, NULL, 0x0,
28945       NULL, HFILL }},
28946     {&hf_ieee80211_tag_bss_avb_adm_cap_up6,
28947      {"UP6", "wlan.bss_avb_adm_cap.up6",
28948       FT_UINT16, BASE_DEC, NULL, 0x0,
28949       NULL, HFILL }},
28950     {&hf_ieee80211_tag_bss_avb_adm_cap_up7,
28951      {"UP7", "wlan.bss_avb_adm_cap.up7",
28952       FT_UINT16, BASE_DEC, NULL, 0x0,
28953       NULL, HFILL }},
28954     {&hf_ieee80211_tag_bss_avb_adm_cap_ac0,
28955      {"AC0", "wlan.bss_avb_adm_cap.ac0",
28956       FT_UINT16, BASE_DEC, NULL, 0x0,
28957       NULL, HFILL }},
28958     {&hf_ieee80211_tag_bss_avb_adm_cap_ac1,
28959      {"AC1", "wlan.bss_avb_adm_cap.ac1",
28960       FT_UINT16, BASE_DEC, NULL, 0x0,
28961       NULL, HFILL }},
28962     {&hf_ieee80211_tag_bss_avb_adm_cap_ac2,
28963      {"AC2", "wlan.bss_avb_adm_cap.ac2",
28964       FT_UINT16, BASE_DEC, NULL, 0x0,
28965       NULL, HFILL }},
28966     {&hf_ieee80211_tag_bss_avb_adm_cap_ac3,
28967      {"AC3", "wlan.bss_avb_adm_cap.ac3",
28968       FT_UINT16, BASE_DEC, NULL, 0x0,
28969       NULL, HFILL }},
28970
28971     {&hf_ieee80211_tag_bss_avg_ac_access_delay_be,
28972      {"AC Average Access Delay for Best Effort", "wlan.bss_avg_ac_access_delay.be",
28973       FT_UINT8, BASE_DEC, NULL, 0x0,
28974       NULL, HFILL }},
28975     {&hf_ieee80211_tag_bss_avg_ac_access_delay_bk,
28976      {"AC Average Access Delay for Best Background", "wlan.bss_avg_ac_access_delay.bk",
28977       FT_UINT8, BASE_DEC, NULL, 0x0,
28978       NULL, HFILL }},
28979     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vi,
28980      {"AC Average Access Delay for Video", "wlan.bss_avg_ac_access_delay_vi",
28981       FT_UINT8, BASE_DEC, NULL, 0x0,
28982       NULL, HFILL }},
28983     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vo,
28984      {"AC Average Access Delay for Voice", "wlan.bss_avg_ac_access_delay_vo",
28985       FT_UINT8, BASE_DEC, NULL, 0x0,
28986       NULL, HFILL }},
28987
28988
28989     /* 802.11-2012 Table 8-119-RM Enabled Capabilities definition */
28990     {&hf_ieee80211_tag_rm_enabled_capabilities,
28991      {"RM Capabilities", "wlan.rmcap",
28992       FT_UINT8, BASE_HEX, NULL, 0,
28993       "Signals support for radio measurements in a device", HFILL }},
28994
28995     /* RM Enabled Capability octet 1 */
28996     {&hf_ieee80211_tag_rm_enabled_capabilities_b0,
28997      {"Link Measurement", "wlan.rmcap.b0",
28998       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
28999       NULL, HFILL }},
29000     {&hf_ieee80211_tag_rm_enabled_capabilities_b1,
29001      {"Neighbor Report", "wlan.rmcap.b1",
29002       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29003       NULL, HFILL }},
29004     {&hf_ieee80211_tag_rm_enabled_capabilities_b2,
29005      {"Parallel Measurements", "wlan.rmcap.b2",
29006       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
29007       NULL, HFILL }},
29008     {&hf_ieee80211_tag_rm_enabled_capabilities_b3,
29009      {"Repeated Measurements", "wlan.rmcap.b3",
29010       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
29011       NULL, HFILL }},
29012     {&hf_ieee80211_tag_rm_enabled_capabilities_b4,
29013      {"Beacon Passive Measurement", "wlan.rmcap.b4",
29014       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
29015       NULL, HFILL }},
29016     {&hf_ieee80211_tag_rm_enabled_capabilities_b5,
29017      {"Beacon Active Measurement", "wlan.rmcap.b5",
29018       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
29019       NULL, HFILL }},
29020     {&hf_ieee80211_tag_rm_enabled_capabilities_b6,
29021      {"Beacon Table Measurement", "wlan.rmcap.b6",
29022       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29023       NULL, HFILL }},
29024     {&hf_ieee80211_tag_rm_enabled_capabilities_b7,
29025      {"Beacon Measurement Reporting Conditions", "wlan.rmcap.b7",
29026       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
29027       NULL, HFILL }},
29028
29029     /* RM Enabled Capability octet 2 */
29030     {&hf_ieee80211_tag_rm_enabled_capabilities_b8,
29031      {"Frame Measurement", "wlan.rmcap.b8",
29032       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29033       NULL, HFILL }},
29034     {&hf_ieee80211_tag_rm_enabled_capabilities_b9,
29035      {"Channel Load Measurement", "wlan.rmcap.b9",
29036       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29037       NULL, HFILL }},
29038     {&hf_ieee80211_tag_rm_enabled_capabilities_b10,
29039      {"Noise Histogram Measurement", "wlan.rmcap.b10",
29040       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
29041       NULL, HFILL }},
29042     {&hf_ieee80211_tag_rm_enabled_capabilities_b11,
29043      {"Statistics Measurement", "wlan.rmcap.b11",
29044       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
29045       NULL, HFILL }},
29046     {&hf_ieee80211_tag_rm_enabled_capabilities_b12,
29047      {"LCI Measurement", "wlan.rmcap.b12",
29048       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
29049       NULL, HFILL }},
29050     {&hf_ieee80211_tag_rm_enabled_capabilities_b13,
29051      {"LCI Azimuth capability", "wlan.rmcap.b13",
29052       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
29053       NULL, HFILL }},
29054     {&hf_ieee80211_tag_rm_enabled_capabilities_b14,
29055      {"Transmit Stream/Category Measurement", "wlan.rmcap.b14",
29056       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29057       NULL, HFILL }},
29058     {&hf_ieee80211_tag_rm_enabled_capabilities_b15,
29059      {"Triggered Transmit Stream/Category Measurement", "wlan.rmcap.b15",
29060       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
29061       NULL, HFILL }},
29062
29063     /* RM Enabled Capability octet 3 */
29064     {&hf_ieee80211_tag_rm_enabled_capabilities_b16,
29065      {"AP Channel Report capability", "wlan.rmcap.b16",
29066       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29067       NULL, HFILL }},
29068     {&hf_ieee80211_tag_rm_enabled_capabilities_b17,
29069      {"RM MIB capability", "wlan.rmcap.b17",
29070       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29071       NULL, HFILL }},
29072     {&hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
29073      {"Operating Channel Max Measurement Duration", "wlan.rmcap.b18to20",
29074       FT_UINT8, BASE_DEC, NULL, 0x1C,
29075       NULL, HFILL }},
29076     {&hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
29077      {"Nonoperating Channel Max Measurement Duration", "wlan.rmcap.b21to23",
29078       FT_UINT8, BASE_DEC, NULL, 0xE0,
29079       NULL, HFILL }},
29080
29081     /* RM Enabled Capability octet 4 */
29082     {&hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
29083      {"Measurement Pilotcapability", "wlan.rmcap.b24to26",
29084       FT_UINT8, BASE_DEC, NULL, 0x07,
29085       NULL, HFILL }},
29086     {&hf_ieee80211_tag_rm_enabled_capabilities_b27,
29087      {"Measurement Pilot Transmission Information", "wlan.rmcap.b27",
29088       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
29089       NULL, HFILL }},
29090     {&hf_ieee80211_tag_rm_enabled_capabilities_b28,
29091      {"Neighbor Report TSF Offset", "wlan.rmcap.b28",
29092       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
29093       NULL, HFILL }},
29094     {&hf_ieee80211_tag_rm_enabled_capabilities_b29,
29095      {"RCPI Measurement capability", "wlan.rmcap.b29",
29096       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
29097       NULL, HFILL }},
29098     {&hf_ieee80211_tag_rm_enabled_capabilities_b30,
29099      {"RSNI Measurement capability", "wlan.rmcap.b30",
29100       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29101       NULL, HFILL }},
29102     {&hf_ieee80211_tag_rm_enabled_capabilities_b31,
29103      {"BSS Average Access Delay capability", "wlan.rmcap.b31",
29104       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
29105       NULL, HFILL }},
29106
29107     /* RM Enabled Capability octet 5 */
29108     {&hf_ieee80211_tag_rm_enabled_capabilities_b32,
29109      {"BSS Available Admission Capacity capability", "wlan.rmcap.b32",
29110       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29111       NULL, HFILL }},
29112     {&hf_ieee80211_tag_rm_enabled_capabilities_b33,
29113      {"Antenna capability", "wlan.rmcap.b33",
29114       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29115       NULL, HFILL }},
29116     {&hf_ieee80211_tag_rm_enabled_capabilities_o5,
29117      {"Reserved", "wlan.rmcap.o5",
29118       FT_UINT8, BASE_HEX, NULL, 0xFC,
29119       "Must be zero", HFILL }},
29120
29121     /* 20/40 BSS Coexistence */
29122     {&hf_ieee80211_tag_20_40_bc,
29123      {"20/40 BSS Coexistence Flags", "wlan.20_40_bc",
29124       FT_UINT8, BASE_HEX, NULL, 0x0,
29125       NULL, HFILL }},
29126     {&hf_ieee80211_tag_20_40_bc_information_request,
29127      {"Information Request", "wlan.20_40_bc.information_request",
29128       FT_BOOLEAN, 8, NULL, 0x01,
29129       NULL, HFILL }},
29130     {&hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant,
29131      {"Forty MHz Intolerant", "wlan.20_40_bc.forty_mhz_intolerant",
29132       FT_BOOLEAN, 8, NULL, 0x02,
29133       NULL, HFILL }},
29134     {&hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request,
29135      {"20 MHz BSS Witdh Request", "wlan.20_40_bc.20_mhz_bss_witdh_request",
29136       FT_BOOLEAN, 8, NULL, 0x04,
29137       NULL, HFILL }},
29138     {&hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request,
29139      {"OBSS Scanning Exemption Request", "wlan.20_40_bc.obss_scanning_exemption_request",
29140       FT_BOOLEAN, 8, NULL, 0x08,
29141       NULL, HFILL }},
29142     {&hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant,
29143      {"OBSS Scanning Exemption Grant", "wlan.20_40_bc.obss_scanning_exemption_grant",
29144       FT_BOOLEAN, 8, NULL, 0x10,
29145       NULL, HFILL }},
29146     {&hf_ieee80211_tag_20_40_bc_reserved,
29147      {"Reserved", "wlan.20_40_bc.reserved",
29148       FT_UINT8, BASE_HEX, NULL, 0xE0,
29149       "Must be zero", HFILL }},
29150
29151
29152     {&hf_ieee80211_tag_power_constraint_local,
29153      {"Local Power Constraint", "wlan.powercon.local",
29154       FT_UINT8, BASE_DEC, NULL, 0,
29155       "Value that allows the mitigation requirements to be satisfied in the current channel", HFILL }},
29156
29157     {&hf_ieee80211_tag_power_capability_min,
29158      {"Minimum Transmit Power", "wlan.powercap.min",
29159       FT_INT8, BASE_DEC, NULL, 0,
29160       "The nominal minimum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
29161
29162     {&hf_ieee80211_tag_power_capability_max,
29163      {"Maximum Transmit Power", "wlan.powercap.max",
29164       FT_INT8, BASE_DEC, NULL, 0,
29165       "The nominal maximum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
29166
29167     {&hf_ieee80211_tag_tpc_report_trsmt_pow,
29168      {"Transmit Power", "wlan.tcprep.trsmt_pow",
29169       FT_INT8, BASE_DEC, NULL, 0,
29170       NULL, HFILL }},
29171
29172     {&hf_ieee80211_tag_tpc_report_link_mrg,
29173      {"Link Margin", "wlan.tcprep.link_mrg",
29174       FT_INT8, BASE_DEC, NULL, 0,
29175       NULL, HFILL }},
29176
29177     {&hf_ieee80211_tag_supported_channels,
29178      {"Supported Channels Set", "wlan.supchan",
29179       FT_NONE, BASE_NONE, NULL, 0,
29180       NULL, HFILL }},
29181
29182     {&hf_ieee80211_tag_supported_channels_first,
29183      {"First Supported Channel", "wlan.supchan.first",
29184       FT_UINT8, BASE_DEC, NULL, 0,
29185       NULL, HFILL }},
29186
29187     {&hf_ieee80211_tag_supported_channels_range,
29188      {"Supported Channel Range", "wlan.supchan.range",
29189       FT_UINT8, BASE_DEC, NULL, 0,
29190       NULL, HFILL }},
29191
29192     {&hf_ieee80211_csa_channel_switch_mode,
29193      {"Channel Switch Mode", "wlan.csa.channel_switch_mode",
29194       FT_UINT8, BASE_HEX, NULL, 0,
29195       "Indicates any restrictions on transmission until a channel switch", HFILL }},
29196
29197     {&hf_ieee80211_csa_new_channel_number,
29198      {"New Channel Number", "wlan.csa.new_channel_number",
29199       FT_UINT8, BASE_HEX, NULL, 0,
29200       "Set to the number of the channel to which the STA is moving", HFILL }},
29201
29202     {&hf_ieee80211_csa_channel_switch_count,
29203      {"Channel Switch Count", "wlan.csa.channel_switch.count",
29204       FT_UINT8, BASE_DEC, NULL, 0,
29205       "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 }},
29206
29207     {&hf_ieee80211_mesh_channel_switch_ttl,
29208      {"Mesh Channel Switch TTL", "wlan.csa.mesh_channel_switch.ttl",
29209       FT_UINT8, BASE_DEC, NULL, 0,
29210       NULL, HFILL }},
29211
29212     {&hf_ieee80211_mesh_channel_switch_flag,
29213      {"Mesh Channel Switch Flag", "wlan.csa.mesh_channel_switch.flag",
29214       FT_UINT8, BASE_HEX, NULL, 0,
29215       NULL, HFILL }},
29216
29217     {&hf_ieee80211_mesh_chswitch_flag_txrestrict,
29218      {"CSA Tx Restrict", "wlan.csa.mesh_channel_switch.flag.txrestrict",
29219       FT_BOOLEAN, 16, TFS(&csa_txrestrict_flags), 0x0001,
29220       NULL, HFILL }},
29221
29222     {&hf_ieee80211_mesh_chswitch_flag_initiator,
29223      {"CSA Initiator", "wlan.csa.mesh_channel_switch.flag.initiator",
29224       FT_BOOLEAN, 16, TFS(&csa_initiator_flags), 0x0002,
29225       NULL, HFILL }},
29226
29227     {&hf_ieee80211_mesh_channel_switch_reason_code,
29228      {"Mesh Channel Switch Reason Code", "wlan.csa.mesh_channel_switch.reason_code",
29229       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
29230       NULL, HFILL }},
29231
29232     {&hf_ieee80211_mesh_channel_switch_precedence_value,
29233      {"Mesh Channel Switch Precedence Value", "wlan.csa.mesh_channel_switch.pre_value",
29234       FT_UINT16, BASE_DEC, NULL, 0,
29235       NULL, HFILL }},
29236
29237     {&hf_ieee80211_mesh_awake_window,
29238      {"Mesh Awake Window", "wlan.mesh.mesh_awake_window",
29239       FT_UINT16, BASE_CUSTOM, CF_FUNC(mesh_active_window_base_custom), 0,
29240       NULL, HFILL }},
29241
29242     {&hf_ieee80211_tag_measure_request_token,
29243      {"Measurement Token", "wlan.measure.req.token",
29244       FT_UINT8, BASE_HEX, NULL, 0xff,
29245       NULL, HFILL }},
29246
29247     {&hf_ieee80211_tag_measure_request_mode,
29248      {"Measurement Request Mode", "wlan.measure.req.mode",
29249       FT_UINT8, BASE_HEX, NULL, 0xff,
29250       NULL, HFILL }},
29251
29252     {&hf_ieee80211_tag_measure_request_mode_parallel,
29253      {"Parallel", "wlan.measure.req.reqmode.parallel",
29254       FT_BOOLEAN, 8, NULL, 0x01,
29255       NULL, HFILL }},
29256
29257     {&hf_ieee80211_tag_measure_request_mode_enable,
29258      {"Measurement Request Mode Field", "wlan.measure.req.reqmode.enable",
29259       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29260       NULL, HFILL }},
29261
29262     {&hf_ieee80211_tag_measure_request_mode_request,
29263      {"Measurement Reports", "wlan.measure.req.reqmode.request",
29264       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x04,
29265       NULL, HFILL }},
29266
29267     {&hf_ieee80211_tag_measure_request_mode_report,
29268      {"Autonomous Measurement Reports", "wlan.measure.req.reqmode.report",
29269       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x08,
29270       NULL, HFILL }},
29271
29272     {&hf_ieee80211_tag_measure_request_mode_duration_mandatory,
29273      {"Duration Mandatory", "wlan.measure.req.reqmode.duration_mandatory",
29274       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x10,
29275       NULL, HFILL }},
29276
29277     {&hf_ieee80211_tag_measure_request_mode_reserved,
29278      {"Reserved", "wlan.measure.req.reqmode.reserved",
29279       FT_UINT8, BASE_HEX, NULL, 0xE0,
29280       NULL, HFILL }},
29281
29282     {&hf_ieee80211_tag_measure_request_type,
29283      {"Measurement Request Type", "wlan.measure.req.reqtype",
29284       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_type_flags_ext, 0x00,
29285       NULL, HFILL }},
29286
29287     {&hf_ieee80211_tag_measure_request_channel_number,
29288      {"Measurement Channel Number", "wlan.measure.req.channelnumber",
29289       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
29290       NULL, HFILL }},
29291
29292     {&hf_ieee80211_tag_measure_request_start_time,
29293      {"Measurement Start Time", "wlan.measure.req.starttime",
29294       FT_UINT64, BASE_HEX, NULL, 0,
29295       NULL, HFILL }},
29296
29297     {&hf_ieee80211_tag_measure_request_duration,
29298      {"Measurement Duration", "wlan.measure.req.channelnumber",
29299       FT_UINT16, BASE_HEX, NULL, 0,
29300       "in TU (1 TU = 1024 us)", HFILL }},
29301
29302     {&hf_ieee80211_tag_measure_request_operating_class,
29303      {"Operating Class", "wlan.measure.req.operatingclass",
29304       FT_UINT8, BASE_DEC, NULL, 0,
29305       NULL, HFILL }},
29306
29307     {&hf_ieee80211_tag_measure_request_randomization_interval,
29308      {"Randomization Interval", "wlan.measure.req.randint",
29309       FT_UINT16, BASE_HEX, NULL, 0,
29310       "in TU (1 TU = 1024 us)", HFILL }},
29311
29312     {&hf_ieee80211_tag_measure_request_measurement_mode,
29313      {"Measurement Mode", "wlan.measure.req.measurementmode",
29314       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_measurement_mode_flags), 0,
29315       NULL, HFILL }},
29316
29317     {&hf_ieee80211_tag_measure_request_bssid,
29318      {"BSSID", "wlan.measure.req.bssid",
29319       FT_ETHER, BASE_NONE, NULL, 0,
29320       NULL, HFILL }},
29321
29322     {&hf_ieee80211_tag_measure_request_subelement_length,
29323      {"Length", "wlan.measure.req.sub.length",
29324       FT_UINT8, BASE_DEC, NULL, 0,
29325       NULL, HFILL }},
29326
29327     {&hf_ieee80211_tag_measure_request_beacon_sub_id,
29328      {"SubElement ID", "wlan.measure.req.beacon.sub.id",
29329       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_beacon_sub_id_flags), 0,
29330       NULL, HFILL }},
29331
29332     {&hf_ieee80211_tag_measure_request_beacon_sub_ssid,
29333      {"SSID", "wlan.measure.req.beacon.sub.ssid",
29334       FT_STRING, BASE_NONE, 0, 0,
29335       NULL, HFILL }},
29336
29337     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition,
29338      {"Reporting Condition", "wlan.measure.req.beacon.sub.bri.repcond",
29339       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags), 0,
29340       NULL, HFILL }},
29341
29342     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset,
29343      {"Threshold/Offset", "wlan.measure.req.beacon.sub.bri.threshold_offset",
29344       FT_UINT8, BASE_HEX, NULL, 0,
29345       NULL, HFILL }},
29346
29347     {&hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail,
29348      {"Reporting Detail", "wlan.measure.req.beacon.sub.bri.reporting_detail",
29349       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags), 0,
29350       NULL, HFILL }},
29351
29352     {&hf_ieee80211_tag_measure_request_beacon_sub_request,
29353      {"Request", "wlan.measure.req.beacon.sub.request",
29354       FT_UINT8, BASE_DEC, 0, 0,
29355       NULL, HFILL }},
29356
29357     {&hf_ieee80211_tag_measure_request_beacon_unknown,
29358      {"Unknown Data", "wlan.measure.req.beacon.unknown",
29359       FT_BYTES, BASE_NONE, NULL, 0,
29360       "(not interpreted)", HFILL }},
29361
29362     {&hf_ieee80211_tag_measure_request_channel_load_sub_id,
29363      {"SubElement ID", "wlan.measure.req.channel_load.sub.id",
29364       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_channel_load_sub_id_vals), 0,
29365       NULL, HFILL }},
29366
29367     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition,
29368      {"Reporting Condition", "wlan.measure.req.channel_load.sub.repcond",
29369       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals), 0,
29370       NULL, HFILL }},
29371
29372     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref,
29373      {"Reference Value", "wlan.measure.req.channel_load.sub.ref",
29374       FT_UINT8, BASE_HEX, NULL, 0,
29375       NULL, HFILL }},
29376
29377
29378     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_id,
29379      {"SubElement ID", "wlan.measure.req.noise_histogram.sub.id",
29380       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_noise_histogram_sub_id_vals), 0,
29381       NULL, HFILL }},
29382
29383     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition,
29384      {"Reporting Condition", "wlan.measure.reqnoise_histogram.sub.repcond",
29385       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals), 0,
29386       NULL, HFILL }},
29387
29388     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref,
29389      {"ANPI Reference Value", "wlan.measure.req.noise_histogram.sub.anpiref",
29390       FT_UINT8, BASE_HEX, NULL, 0,
29391       NULL, HFILL }},
29392
29393
29394     {&hf_ieee80211_tag_measure_request_frame_request_type,
29395      {"Frame Request Type", "wlan.measure.req.frame_request_type",
29396       FT_UINT8, BASE_HEX, NULL, 0,
29397       NULL, HFILL }},
29398
29399     {&hf_ieee80211_tag_measure_request_mac_address,
29400      {"MAC Address", "wlan.measure.req.mac_address",
29401       FT_BYTES, BASE_NONE, NULL, 0,
29402       NULL, HFILL }},
29403
29404     {&hf_ieee80211_tag_measure_request_peer_mac_address,
29405      {"Peer MAC Address", "wlan.measure.req.peer_mac_address",
29406       FT_BYTES, BASE_NONE, NULL, 0,
29407       NULL, HFILL }},
29408
29409     {&hf_ieee80211_tag_measure_request_group_id,
29410      {"Group ID", "wlan.measure.req.groupid",
29411       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_group_id_flags_ext, 0,
29412       NULL, HFILL }},
29413
29414     {&hf_ieee80211_tag_measure_request_unknown,
29415      {"Unknown Data", "wlan.measure.req.unknown",
29416       FT_BYTES, BASE_NONE, NULL, 0,
29417       "(not interpreted)", HFILL }},
29418
29419     {&hf_ieee80211_tag_measure_report_measurement_token,
29420      {"Measurement Token", "wlan.measure.req.token",
29421       FT_UINT8, BASE_HEX, NULL, 0,
29422       NULL, HFILL }},
29423
29424     {&hf_ieee80211_tag_measure_report_mode,
29425      {"Measurement Report Mode", "wlan.measure.req.mode",
29426       FT_UINT8, BASE_HEX, NULL, 0,
29427       NULL, HFILL }},
29428
29429     {&hf_ieee80211_tag_measure_report_mode_late,
29430      {"Measurement Report Mode Field", "wlan.measure.rep.repmode.late",
29431       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29432       NULL, HFILL }},
29433
29434     {&hf_ieee80211_tag_measure_report_mode_incapable,
29435      {"Measurement Reports", "wlan.measure.rep.repmode.incapable",
29436       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x02,
29437       NULL, HFILL }},
29438
29439     {&hf_ieee80211_tag_measure_report_mode_refused,
29440      {"Autonomous Measurement Reports", "wlan.measure.rep.repmode.refused",
29441       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x04,
29442       NULL, HFILL }},
29443
29444     {&hf_ieee80211_tag_measure_report_mode_reserved,
29445      {"Reserved", "wlan.measure.rep.repmode.reserved",
29446       FT_UINT8, BASE_HEX, NULL, 0xf8,
29447       NULL, HFILL }},
29448
29449     {&hf_ieee80211_tag_measure_report_type,
29450      {"Measurement Report Type", "wlan.measure.rep.reptype",
29451       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_report_type_flags_ext, 0x00,
29452       NULL, HFILL }},
29453
29454     {&hf_ieee80211_tag_measure_report_channel_number,
29455      {"Measurement Channel Number", "wlan.measure.rep.channelnumber",
29456       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
29457       NULL, HFILL }},
29458
29459     {&hf_ieee80211_tag_measure_report_start_time,
29460      {"Measurement Start Time", "wlan.measure.rep.starttime",
29461       FT_UINT64, BASE_HEX, NULL, 0,
29462       NULL, HFILL }},
29463
29464     {&hf_ieee80211_tag_measure_report_duration,
29465      {"Measurement Duration", "wlan.measure.rep.channelnumber",
29466       FT_UINT16, BASE_HEX, NULL, 0,
29467       NULL, HFILL }},
29468
29469     {&hf_ieee80211_tag_measure_cca_busy_fraction,
29470      {"CCA Busy Fraction", "wlan.measure.rep.ccabusy",
29471       FT_UINT8, BASE_HEX, NULL, 0,
29472       NULL, HFILL }},
29473
29474     {&hf_ieee80211_tag_measure_basic_map_field,
29475      {"Map Field", "wlan.measure.rep.mapfield",
29476       FT_UINT8, BASE_HEX, NULL, 0,
29477       NULL, HFILL }},
29478
29479     {&hf_ieee80211_tag_measure_map_field_bss,
29480      {"BSS", "wlan.measure.rep.repmode.mapfield.bss",
29481       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_map_field_bss_flag), 0x01,
29482       NULL, HFILL }},
29483
29484     {&hf_ieee80211_tag_measure_map_field_odfm,
29485      {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan.measure.rep.repmode.mapfield.bss",
29486       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x02,
29487       NULL, HFILL }},
29488
29489     {&hf_ieee80211_tag_measure_map_field_unident_signal,
29490      {"Unidentified Signal", "wlan.measure.rep.repmode.mapfield.unidentsig",
29491       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x04,
29492       NULL, HFILL }},
29493
29494     {&hf_ieee80211_tag_measure_map_field_radar,
29495      {"Radar", "wlan.measure.rep.repmode.mapfield.radar",
29496       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x08,
29497       NULL, HFILL }},
29498
29499     {&hf_ieee80211_tag_measure_map_field_unmeasured,
29500      {"Unmeasured", "wlan.measure.rep.repmode.mapfield.unmeasured",
29501       FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x10,
29502       NULL, HFILL }},
29503
29504     {&hf_ieee80211_tag_measure_map_field_reserved,
29505      {"Reserved", "wlan.measure.rep.repmode.mapfield.reserved",
29506       FT_UINT8, BASE_HEX, NULL, 0xe0,
29507       NULL, HFILL }},
29508
29509     {&hf_ieee80211_tag_measure_rpi_histogram_report,
29510      {"Receive Power Indicator (RPI) Histogram Report", "wlan.measure.rep.rpi.histogram_report",
29511       FT_BYTES, BASE_NONE, NULL, 0,
29512       NULL, HFILL }},
29513
29514     {&hf_ieee80211_tag_measure_rpi_histogram_report_0,
29515      {"RPI 0 Density", "wlan.measure.rep.rpi.rpi0density",
29516       FT_UINT8, BASE_HEX, NULL, 0,
29517       "Receive Power Indicator (RPI) 0 Density", HFILL }},
29518
29519     {&hf_ieee80211_tag_measure_rpi_histogram_report_1,
29520      {"RPI 1 Density", "wlan.measure.rep.rpi.rpi1density",
29521       FT_UINT8, BASE_HEX, NULL, 0,
29522       "Receive Power Indicator (RPI) 1 Density", HFILL }},
29523
29524     {&hf_ieee80211_tag_measure_rpi_histogram_report_2,
29525      {"RPI 2 Density", "wlan.measure.rep.rpi.rpi2density",
29526       FT_UINT8, BASE_HEX, NULL, 0,
29527       "Receive Power Indicator (RPI) 2 Density", HFILL }},
29528
29529     {&hf_ieee80211_tag_measure_rpi_histogram_report_3,
29530      {"RPI 3 Density", "wlan.measure.rep.rpi.rpi3density",
29531       FT_UINT8, BASE_HEX, NULL, 0,
29532       "Receive Power Indicator (RPI) 3 Density", HFILL }},
29533
29534     {&hf_ieee80211_tag_measure_rpi_histogram_report_4,
29535      {"RPI 4 Density", "wlan.measure.rep.rpi.rpi4density",
29536       FT_UINT8, BASE_HEX, NULL, 0,
29537       "Receive Power Indicator (RPI) 4 Density", HFILL }},
29538
29539     {&hf_ieee80211_tag_measure_rpi_histogram_report_5,
29540      {"RPI 5 Density", "wlan.measure.rep.rpi.rpi5density",
29541       FT_UINT8, BASE_HEX, NULL, 0,
29542       "Receive Power Indicator (RPI) 5 Density", HFILL }},
29543
29544     {&hf_ieee80211_tag_measure_rpi_histogram_report_6,
29545      {"RPI 6 Density", "wlan.measure.rep.rpi.rpi6density",
29546       FT_UINT8, BASE_HEX, NULL, 0,
29547       "Receive Power Indicator (RPI) 6 Density", HFILL }},
29548
29549     {&hf_ieee80211_tag_measure_rpi_histogram_report_7,
29550      {"RPI 7 Density", "wlan.measure.rep.rpi.rpi7density",
29551       FT_UINT8, BASE_HEX, NULL, 0,
29552       "Receive Power Indicator (RPI) 7 Density", HFILL }},
29553
29554     {&hf_ieee80211_tag_measure_report_operating_class,
29555      {"Operating Class", "wlan.measure.rep.operatingclass",
29556       FT_UINT8, BASE_DEC, NULL, 0,
29557       NULL, HFILL }},
29558
29559     {&hf_ieee80211_tag_measure_report_channel_load,
29560      {"Channel Load", "wlan.measure.rep.chanload",
29561       FT_UINT8, BASE_HEX, NULL, 0,
29562       NULL, HFILL }},
29563
29564     {&hf_ieee80211_tag_measure_report_frame_info,
29565      {"Reported Frame Information", "wlan.measure.rep.frameinfo",
29566       FT_UINT8, BASE_HEX, NULL, 0,
29567       NULL, HFILL }},
29568
29569     {&hf_ieee80211_tag_measure_report_frame_info_phy_type,
29570      {"Condensed PHY", "wlan.measure.rep.frameinfo.phytype",
29571       FT_UINT8, BASE_HEX, NULL, 0x7F,
29572       NULL, HFILL }},
29573
29574     {&hf_ieee80211_tag_measure_report_frame_info_frame_type,
29575      {"Reported Frame Type", "wlan.measure.rep.frameinfo.frametype",
29576       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_report_frame_info_frame_type_flag), 0x80,
29577       NULL, HFILL }},
29578
29579     {&hf_ieee80211_tag_measure_report_rcpi,
29580      {"Received Channel Power Indicator (RCPI)", "wlan.measure.rep.rcpi",
29581       FT_UINT8, BASE_HEX, NULL, 0,
29582       "in dBm", HFILL }},
29583
29584     {&hf_ieee80211_tag_measure_report_rsni,
29585      {"Received Signal to Noise Indicator (RSNI)", "wlan.measure.rep.rsni",
29586       FT_UINT8, BASE_HEX, NULL, 0,
29587       "in dB", HFILL }},
29588
29589     {&hf_ieee80211_tag_measure_report_bssid,
29590      {"BSSID Being Reported", "wlan.measure.rep.bssid",
29591       FT_ETHER, BASE_NONE, NULL, 0,
29592       NULL, HFILL }},
29593
29594     {&hf_ieee80211_tag_measure_report_ant_id,
29595      {"Antenna ID", "wlan.measure.rep.antid",
29596       FT_UINT8, BASE_HEX, NULL, 0,
29597       NULL, HFILL }},
29598
29599     {&hf_ieee80211_tag_measure_report_anpi,
29600      {"ANPI", "wlan.measure.rep.anpi",
29601       FT_UINT8, BASE_HEX, NULL, 0,
29602       NULL, HFILL }},
29603
29604     {&hf_ieee80211_tag_measure_report_ipi_density_0,
29605      {"IPI Density 0", "wlan.measure.rep.ipi_density0",
29606       FT_UINT8, BASE_HEX, NULL, 0,
29607       NULL, HFILL }},
29608
29609     {&hf_ieee80211_tag_measure_report_ipi_density_1,
29610      {"IPI Density 1", "wlan.measure.rep.ipi_density1",
29611       FT_UINT8, BASE_HEX, NULL, 0,
29612       NULL, HFILL }},
29613
29614     {&hf_ieee80211_tag_measure_report_ipi_density_2,
29615      {"IPI Density 2", "wlan.measure.rep.ipi_density2",
29616       FT_UINT8, BASE_HEX, NULL, 0,
29617       NULL, HFILL }},
29618
29619     {&hf_ieee80211_tag_measure_report_ipi_density_3,
29620      {"IPI Density 3", "wlan.measure.rep.ipi_density3",
29621       FT_UINT8, BASE_HEX, NULL, 0,
29622       NULL, HFILL }},
29623
29624     {&hf_ieee80211_tag_measure_report_ipi_density_4,
29625      {"IPI Density 4", "wlan.measure.rep.ipi_density4",
29626       FT_UINT8, BASE_HEX, NULL, 0,
29627       NULL, HFILL }},
29628
29629     {&hf_ieee80211_tag_measure_report_ipi_density_5,
29630      {"IPI Density 5", "wlan.measure.rep.ipi_density5",
29631       FT_UINT8, BASE_HEX, NULL, 0,
29632       NULL, HFILL }},
29633
29634     {&hf_ieee80211_tag_measure_report_ipi_density_6,
29635      {"IPI Density 6", "wlan.measure.rep.ipi_density6",
29636       FT_UINT8, BASE_HEX, NULL, 0,
29637       NULL, HFILL }},
29638
29639     {&hf_ieee80211_tag_measure_report_ipi_density_7,
29640      {"IPI Density 7", "wlan.measure.rep.ipi_density7",
29641       FT_UINT8, BASE_HEX, NULL, 0,
29642       NULL, HFILL }},
29643
29644     {&hf_ieee80211_tag_measure_report_ipi_density_8,
29645      {"IPI Density 8", "wlan.measure.rep.ipi_density8",
29646       FT_UINT8, BASE_HEX, NULL, 0,
29647       NULL, HFILL }},
29648
29649     {&hf_ieee80211_tag_measure_report_ipi_density_9,
29650      {"IPI Density 9", "wlan.measure.rep.ipi_density9",
29651       FT_UINT8, BASE_HEX, NULL, 0,
29652       NULL, HFILL }},
29653
29654     {&hf_ieee80211_tag_measure_report_ipi_density_10,
29655      {"IPI Density 10", "wlan.measure.rep.ipi_density10",
29656       FT_UINT8, BASE_HEX, NULL, 0,
29657       NULL, HFILL }},
29658
29659     {&hf_ieee80211_tag_measure_report_parent_tsf,
29660      {"Parent Timing Synchronization Function (TSF)", "wlan.measure.rep.parenttsf",
29661       FT_UINT32, BASE_HEX, NULL, 0,
29662       NULL, HFILL }},
29663
29664     {&hf_ieee80211_tag_measure_report_subelement_length,
29665      {"Length", "wlan.measure.req.sub.length",
29666       FT_UINT8, BASE_DEC, NULL, 0,
29667       NULL, HFILL }},
29668
29669     {&hf_ieee80211_tag_measure_report_beacon_sub_id,
29670      {"SubElement ID", "wlan.measure.req.beacon.sub.id",
29671       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_report_beacon_sub_id_vals), 0,
29672       NULL, HFILL }},
29673
29674     {&hf_ieee80211_tag_measure_report_unknown,
29675      {"Unknown Data", "wlan.measure.rep.unknown",
29676       FT_BYTES, BASE_NONE, NULL, 0,
29677       "(not interpreted)", HFILL }},
29678
29679     {&hf_ieee80211_tag_quiet_count,
29680      {"Count", "wlan.quiet.count",
29681       FT_UINT8, BASE_DEC, NULL, 0,
29682       "Set to the number of TBTTs until the beacon interval during which the next quiet interval shall start", HFILL }},
29683
29684     {&hf_ieee80211_tag_quiet_period,
29685      {"Period", "wlan.quiet.period",
29686       FT_UINT8, BASE_DEC, NULL, 0,
29687       "Set to the number of beacon intervals between the start of regularly scheduled quiet intervals", HFILL }},
29688
29689     {&hf_ieee80211_tag_quiet_duration,
29690      {"Duration", "wlan.quiet.duration",
29691       FT_UINT16, BASE_DEC, NULL, 0,
29692       "Set to the duration of the quiet interval", HFILL }},
29693
29694     {&hf_ieee80211_tag_quiet_offset,
29695      {"Offset", "wlan.quiet.offset",
29696       FT_UINT16, BASE_DEC, NULL, 0,
29697       "Set to the offset of the start of the quiet interval from the TBTT", HFILL }},
29698
29699     {&hf_ieee80211_tag_dfs_owner,
29700      {"Owner", "wlan.dfs.owner",
29701       FT_ETHER, BASE_NONE, NULL, 0,
29702       "Set to the individual IEEE MAC address of the STA that is the currently known DFS Owner in the IBSS", HFILL  }},
29703
29704     {&hf_ieee80211_tag_dfs_recovery_interval,
29705      {"Recovery Interval", "wlan.dfs.recovery_interval",
29706       FT_UINT8, BASE_DEC, NULL, 0,
29707       "Indicates the time interval that shall be used for DFS owner recovery", HFILL  }},
29708
29709     {&hf_ieee80211_tag_dfs_channel_map,
29710      {"Channel Map", "wlan.dfs.channel_map",
29711       FT_NONE, BASE_NONE, NULL, 0,
29712       NULL, HFILL  }},
29713
29714     {&hf_ieee80211_tag_dfs_channel_number,
29715      {"Channel Number", "wlan.dfs.channel_number",
29716       FT_UINT8, BASE_DEC, NULL, 0,
29717       NULL, HFILL  }},
29718
29719     {&hf_ieee80211_tag_dfs_map,
29720      {"Map", "wlan.dfs.map",
29721       FT_UINT8, BASE_HEX, NULL, 0,
29722       NULL, HFILL  }},
29723
29724     {&hf_ieee80211_tag_erp_info,
29725      {"ERP Information", "wlan.erp_info",
29726       FT_UINT8, BASE_HEX, NULL, 0,
29727       NULL, HFILL  }},
29728
29729     {&hf_ieee80211_tag_erp_info_erp_present,
29730      {"Non ERP Present", "wlan.erp_info.erp_present",
29731       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
29732       NULL, HFILL  }},
29733
29734     {&hf_ieee80211_tag_erp_info_use_protection,
29735      {"Use Protection", "wlan.erp_info.use_protection",
29736       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
29737       NULL, HFILL  }},
29738
29739     {&hf_ieee80211_tag_erp_info_barker_preamble_mode,
29740      {"Barker Preamble Mode", "wlan.erp_info.barker_preamble_mode",
29741       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
29742       NULL, HFILL  }},
29743
29744     {&hf_ieee80211_tag_erp_info_reserved,
29745      {"Reserved", "wlan.erp_info.reserved",
29746       FT_UINT8, BASE_HEX, NULL, 0xF8,
29747       NULL, HFILL  }},
29748
29749     /* IEEE Std 802.11 2016 */
29750     /* Table 9-135-Extended Capabilities field */
29751     {&hf_ieee80211_tag_extended_capabilities,
29752      {"Extended Capabilities", "wlan.extcap",
29753       FT_UINT8, BASE_HEX, NULL, 0,
29754       NULL, HFILL }},
29755
29756     /* Extended Capability octet 1 */
29757     {&hf_ieee80211_tag_extended_capabilities_b0,
29758      {"20/40 BSS Coexistence Management Support", "wlan.extcap.b0",
29759       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29760       "HT Information Exchange Support", HFILL }},
29761
29762     {&hf_ieee80211_tag_extended_capabilities_b1,
29763      {"Reserved (was On-demand beacon)", "wlan.extcap.b1",
29764       FT_UINT8, BASE_HEX, NULL, 0x02,
29765       "Must be zero", HFILL }},
29766
29767     {&hf_ieee80211_tag_extended_capabilities_b2,
29768      {"Extended Channel Switching", "wlan.extcap.b2",
29769       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29770       NULL, HFILL }},
29771
29772     {&hf_ieee80211_tag_extended_capabilities_b3,
29773      {"Reserved (was WAVE indication)", "wlan.extcap.b3",
29774       FT_UINT8, BASE_HEX, NULL, 0x08,
29775       "Must be zero", HFILL }},
29776
29777     {&hf_ieee80211_tag_extended_capabilities_b4,
29778      {"PSMP Capability", "wlan.extcap.b4",
29779       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29780       NULL, HFILL }},
29781
29782     {&hf_ieee80211_tag_extended_capabilities_b5,
29783      {"Reserved", "wlan.extcap.b5",
29784       FT_UINT8, BASE_HEX, NULL, 0x20,
29785       "Must be zero", HFILL }},
29786
29787     {&hf_ieee80211_tag_extended_capabilities_b6,
29788      {"S-PSMP Support", "wlan.extcap.b6",
29789       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29790       NULL, HFILL }},
29791
29792     {&hf_ieee80211_tag_extended_capabilities_b7,
29793      {"Event", "wlan.extcap.b7",
29794       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29795       NULL, HFILL }},
29796
29797
29798     /* Extended Capability octet 2 */
29799     {&hf_ieee80211_tag_extended_capabilities_b8,
29800      {"Diagnostics", "wlan.extcap.b8",
29801       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29802       NULL, HFILL }},
29803
29804     {&hf_ieee80211_tag_extended_capabilities_b9,
29805      {"Multicast Diagnostics", "wlan.extcap.b9",
29806       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
29807       NULL, HFILL }},
29808
29809     {&hf_ieee80211_tag_extended_capabilities_b10,
29810      {"Location Tracking", "wlan.extcap.b10",
29811       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29812       NULL, HFILL }},
29813
29814     {&hf_ieee80211_tag_extended_capabilities_b11,
29815      {"FMS", "wlan.extcap.b11",
29816       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
29817       NULL, HFILL }},
29818
29819     {&hf_ieee80211_tag_extended_capabilities_b12,
29820      {"Proxy ARP Service", "wlan.extcap.b12",
29821       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29822       NULL, HFILL }},
29823
29824     {&hf_ieee80211_tag_extended_capabilities_b13,
29825      {"Collocated Interference Reporting", "wlan.extcap.b13",
29826       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
29827       NULL, HFILL }},
29828
29829     {&hf_ieee80211_tag_extended_capabilities_b14,
29830      {"Civic Location", "wlan.extcap.b14",
29831       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29832       NULL, HFILL }},
29833
29834     {&hf_ieee80211_tag_extended_capabilities_b15,
29835      {"Geospatial Location", "wlan.extcap.b15",
29836       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29837       NULL, HFILL }},
29838
29839
29840     /* Extended Capability octet 3 */
29841     {&hf_ieee80211_tag_extended_capabilities_b16,
29842      {"TFS", "wlan.extcap.b16",
29843       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29844       NULL, HFILL }},
29845
29846     {&hf_ieee80211_tag_extended_capabilities_b17,
29847      {"WNM Sleep Mode", "wlan.extcap.b17",
29848       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
29849       NULL, HFILL }},
29850
29851     {&hf_ieee80211_tag_extended_capabilities_b18,
29852      {"TIM Broadcast", "wlan.extcap.b18",
29853       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29854       NULL, HFILL }},
29855
29856     {&hf_ieee80211_tag_extended_capabilities_b19,
29857      {"BSS Transition", "wlan.extcap.b19",
29858       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
29859       NULL, HFILL }},
29860
29861     {&hf_ieee80211_tag_extended_capabilities_b20,
29862      {"QoS Traffic Capability", "wlan.extcap.b20",
29863       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29864       NULL, HFILL }},
29865
29866     {&hf_ieee80211_tag_extended_capabilities_b21,
29867      {"AC Station Count", "wlan.extcap.b21",
29868       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
29869       NULL, HFILL }},
29870
29871     {&hf_ieee80211_tag_extended_capabilities_b22,
29872      {"Multiple BSSID", "wlan.extcap.b22",
29873       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29874       NULL, HFILL }},
29875
29876     {&hf_ieee80211_tag_extended_capabilities_b23,
29877      {"Timing Measurement", "wlan.extcap.b23",
29878       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29879       NULL, HFILL }},
29880
29881
29882     /* Extended Capability octet 4 */
29883     {&hf_ieee80211_tag_extended_capabilities_b24,
29884      {"Channel Usage", "wlan.extcap.b24",
29885       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29886       NULL, HFILL }},
29887
29888     {&hf_ieee80211_tag_extended_capabilities_b25,
29889      {"SSID List", "wlan.extcap.b25",
29890       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
29891       NULL, HFILL }},
29892
29893     {&hf_ieee80211_tag_extended_capabilities_b26,
29894      {"DMS", "wlan.extcap.b26",
29895       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29896       NULL, HFILL }},
29897
29898     {&hf_ieee80211_tag_extended_capabilities_b27,
29899      {"UTC TSF Offset", "wlan.extcap.b27",
29900       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
29901       NULL, HFILL }},
29902
29903     {&hf_ieee80211_tag_extended_capabilities_b28,
29904      {"TPU Buffer STA Support", "wlan.extcap.b28",
29905       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29906       NULL, HFILL }},
29907
29908     {&hf_ieee80211_tag_extended_capabilities_b29,
29909      {"TDLS Peer PSM Support", "wlan.extcap.b29",
29910       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
29911       NULL, HFILL }},
29912
29913     {&hf_ieee80211_tag_extended_capabilities_b30,
29914      {"TDLS channel switching", "wlan.extcap.b30",
29915       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29916       NULL, HFILL }},
29917
29918     {&hf_ieee80211_tag_extended_capabilities_b31,
29919      {"Interworking", "wlan.extcap.b31",
29920       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29921       NULL, HFILL }},
29922
29923
29924     /* Extended Capability octet 5 */
29925     {&hf_ieee80211_tag_extended_capabilities_b32,
29926      {"QoS Map", "wlan.extcap.b32",
29927       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29928       NULL, HFILL }},
29929
29930     {&hf_ieee80211_tag_extended_capabilities_b33,
29931      {"EBR", "wlan.extcap.b33",
29932       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
29933       NULL, HFILL }},
29934
29935     {&hf_ieee80211_tag_extended_capabilities_b34,
29936      {"SSPN Interface", "wlan.extcap.b34",
29937       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29938       NULL, HFILL }},
29939
29940     {&hf_ieee80211_tag_extended_capabilities_b35,
29941      {"Reserved", "wlan.extcap.b35",
29942       FT_UINT8, BASE_HEX, NULL, 0x08,
29943       "Must be zero", HFILL }},
29944
29945     {&hf_ieee80211_tag_extended_capabilities_b36,
29946      {"MSGCF Capability", "wlan.extcap.b36",
29947       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29948       NULL, HFILL }},
29949
29950     {&hf_ieee80211_tag_extended_capabilities_b37,
29951      {"TDLS Support", "wlan.extcap.b37",
29952       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
29953       NULL, HFILL }},
29954
29955     {&hf_ieee80211_tag_extended_capabilities_b38,
29956      {"TDLS Prohibited", "wlan.extcap.b38",
29957       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29958       NULL, HFILL }},
29959
29960     {&hf_ieee80211_tag_extended_capabilities_b39,
29961      {"TDLS Channel Switching Prohibited", "wlan.extcap.b39",
29962       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29963       NULL, HFILL }},
29964
29965     /* Extended Capability octet 6 */
29966     {&hf_ieee80211_tag_extended_capabilities_b40,
29967      {"Reject Unadmitted Frame", "wlan.extcap.b40",
29968       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29969       NULL, HFILL }},
29970
29971     {&hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
29972      {"Service Interval Granularity",
29973       "wlan.extcap.serv_int_granularity",
29974       FT_UINT8, BASE_DEC, VALS(service_interval_granularity_vals), 0x0e,
29975       NULL, HFILL }},
29976
29977     {&hf_ieee80211_tag_extended_capabilities_b44,
29978      {"Identifier Location", "wlan.extcap.b44",
29979       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29980       NULL, HFILL }},
29981
29982     {&hf_ieee80211_tag_extended_capabilities_b45,
29983      {"U-APSD Coexistence", "wlan.extcap.b45",
29984       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
29985       NULL, HFILL }},
29986
29987     {&hf_ieee80211_tag_extended_capabilities_b46,
29988      {"WNM Notification", "wlan.extcap.b46",
29989       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29990       NULL, HFILL }},
29991
29992     {&hf_ieee80211_tag_extended_capabilities_b47,
29993      {"QAB Capability", "wlan.extcap.b47",
29994       FT_UINT8, BASE_HEX, NULL, 0x80,
29995       "AP supports QAB", HFILL }},
29996
29997     /* Extended Capability octet 7 */
29998     {&hf_ieee80211_tag_extended_capabilities_b48,
29999      {"UTF-8 SSID", "wlan.extcap.b48",
30000       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
30001       "The SSID in this BSS is interpreted using UTF-8 encoding", HFILL }},
30002
30003     {&hf_ieee80211_tag_extended_capabilities_b49,
30004      {"QMFActivated", "wlan.extcap.b49",
30005       FT_BOOLEAN, 8, NULL, 0x02,
30006       NULL, HFILL }},
30007
30008     {&hf_ieee80211_tag_extended_capabilities_b50,
30009      {"QMFReconfigurationActivated", "wlan.extcap.b50",
30010       FT_BOOLEAN, 8, NULL, 0x04,
30011       NULL, HFILL }},
30012
30013     {&hf_ieee80211_tag_extended_capabilities_b51,
30014      {"Robust AV Streaming", "wlan.extcap.b51",
30015       FT_BOOLEAN, 8, NULL, 0x08,
30016       NULL, HFILL }},
30017
30018     {&hf_ieee80211_tag_extended_capabilities_b52,
30019      {"Advanced GCR", "wlan.extcap.b52",
30020       FT_BOOLEAN, 8, NULL, 0x10,
30021       NULL, HFILL }},
30022
30023     {&hf_ieee80211_tag_extended_capabilities_b53,
30024      {"Mesh GCR", "wlan.extcap.b53",
30025       FT_BOOLEAN, 8, NULL, 0x20,
30026       NULL, HFILL }},
30027
30028     {&hf_ieee80211_tag_extended_capabilities_b54,
30029      {"SCS", "wlan.extcap.b54",
30030       FT_BOOLEAN, 8, NULL, 0x40,
30031       NULL, HFILL }},
30032
30033     {&hf_ieee80211_tag_extended_capabilities_b55,
30034      {"QLoad Report", "wlan.extcap.b55",
30035       FT_BOOLEAN, 8, NULL, 0x80,
30036       NULL, HFILL }},
30037
30038     /* Extended Capability octet 8 */
30039     {&hf_ieee80211_tag_extended_capabilities_b56,
30040      {"Alternate EDCA", "wlan.extcap.b56",
30041       FT_BOOLEAN, 8, NULL, 0x01,
30042       NULL, HFILL }},
30043
30044     {&hf_ieee80211_tag_extended_capabilities_b57,
30045      {"Unprotected TXOP Negotiation", "wlan.extcap.b57",
30046       FT_BOOLEAN, 8, NULL, 0x02,
30047       NULL, HFILL }},
30048
30049     {&hf_ieee80211_tag_extended_capabilities_b58,
30050      {"Protected TXOP Negotiation", "wlan.extcap.b58",
30051       FT_BOOLEAN, 8, NULL, 0x04,
30052       NULL, HFILL }},
30053
30054     {&hf_ieee80211_tag_extended_capabilities_b59,
30055      {"Reserved", "wlan.extcap.b59",
30056       FT_UINT8, BASE_HEX, NULL, 0x08,
30057       NULL, HFILL }},
30058
30059     {&hf_ieee80211_tag_extended_capabilities_b60,
30060      {"Protected QLoad Report", "wlan.extcap.b61",
30061       FT_BOOLEAN, 8, NULL, 0x10,
30062       NULL, HFILL }},
30063
30064     {&hf_ieee80211_tag_extended_capabilities_b61,
30065      {"TDLS Wider Bandwidth", "wlan.extcap.b61",
30066       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
30067       NULL, HFILL }},
30068
30069     {&hf_ieee80211_tag_extended_capabilities_b62,
30070      {"Operating Mode Notification", "wlan.extcap.b62",
30071       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
30072       NULL, HFILL }},
30073
30074     {&hf_ieee80211_tag_extended_capabilities_b63,
30075      {"Max Number Of MSDUs In A-MSDU", "wlan.extcap.b63",
30076       FT_UINT8, BASE_DEC, NULL, 0x80,
30077       "Part 1 (bit63)", HFILL }},
30078
30079     /* Extended Capability octets 8 & 9 */
30080     {&hf_ieee80211_tag_extended_capabilities_2,
30081      {"Extended Capabilities", "wlan.extcap",
30082       FT_UINT16, BASE_HEX, NULL, 0,
30083       NULL, HFILL }},
30084
30085     {&hf_ieee80211_tag_extended_capabilities_b56_2,
30086      {"Alternate EDCA", "wlan.extcap.b56",
30087       FT_BOOLEAN, 16, NULL, 0x01,
30088       NULL, HFILL }},
30089
30090     {&hf_ieee80211_tag_extended_capabilities_b57_2,
30091      {"Unprotected TXOP Negotiation", "wlan.extcap.b57",
30092       FT_BOOLEAN, 16, NULL, 0x02,
30093       NULL, HFILL }},
30094
30095     {&hf_ieee80211_tag_extended_capabilities_b58_2,
30096      {"Protected TXOP Negotiation", "wlan.extcap.b58",
30097       FT_BOOLEAN, 16, NULL, 0x04,
30098       NULL, HFILL }},
30099
30100     {&hf_ieee80211_tag_extended_capabilities_b59_2,
30101      {"Reserved", "wlan.extcap.b59",
30102       FT_UINT16, BASE_HEX, NULL, 0x08,
30103       NULL, HFILL }},
30104
30105     {&hf_ieee80211_tag_extended_capabilities_b60_2,
30106      {"Protected QLoad Report", "wlan.extcap.b61",
30107       FT_BOOLEAN, 16, NULL, 0x10,
30108       NULL, HFILL }},
30109
30110     {&hf_ieee80211_tag_extended_capabilities_b61_2,
30111      {"TDLS Wider Bandwidth", "wlan.extcap.b61",
30112       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x20,
30113       NULL, HFILL }},
30114
30115     {&hf_ieee80211_tag_extended_capabilities_b62_2,
30116      {"Operating Mode Notification", "wlan.extcap.b62",
30117       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x40,
30118       NULL, HFILL }},
30119
30120     {&hf_ieee80211_tag_extended_capabilities_max_num_msdus,
30121      {"Max Number Of MSDUs In A-MSDU", "wlan.extcap.b63",
30122       FT_UINT16, BASE_DEC, VALS(vht_max_mpdu_in_amsdu), 0x0180,
30123       NULL, HFILL }},
30124
30125     {&hf_ieee80211_tag_extended_capabilities_b65_2,
30126      {"Channel Schedule Management", "wlan.extcap.b65",
30127       FT_BOOLEAN, 16, NULL, 0x0200,
30128       NULL, HFILL }},
30129
30130     {&hf_ieee80211_tag_extended_capabilities_b66_2,
30131      {"Geodatabase Inband Enabling Signal", "wlan.extcap.b66",
30132       FT_BOOLEAN, 16, NULL, 0x0400,
30133       NULL, HFILL }},
30134
30135     {&hf_ieee80211_tag_extended_capabilities_b67_2,
30136      {"Network Channel Control", "wlan.extcap.b67",
30137       FT_BOOLEAN, 16, NULL, 0x0800,
30138       NULL, HFILL }},
30139
30140     {&hf_ieee80211_tag_extended_capabilities_b68_2,
30141      {"White Space Map", "wlan.extcap.b68",
30142       FT_BOOLEAN, 16, NULL, 0x1000,
30143       NULL, HFILL }},
30144
30145     {&hf_ieee80211_tag_extended_capabilities_b69_2,
30146      {"Channel Availability Query", "wlan.extcap.b69",
30147       FT_BOOLEAN, 16, NULL, 0x2000,
30148       NULL, HFILL }},
30149
30150     {&hf_ieee80211_tag_extended_capabilities_b70_2,
30151      {"Fine Timing Measurement Responder", "wlan.extcap.b70",
30152       FT_BOOLEAN, 16, NULL, 0x4000,
30153       NULL, HFILL }},
30154
30155     {&hf_ieee80211_tag_extended_capabilities_b71_2,
30156      {"Fine Timing Measurement Initiator", "wlan.extcap.b71",
30157       FT_BOOLEAN, 16, NULL, 0x8000,
30158       NULL, HFILL }},
30159
30160     /* Extended Capability Octet 10 */
30161     {&hf_ieee80211_tag_extended_capabilities_b72,
30162      {"Reserved", "wlan.extcap.b72",
30163       FT_UINT8, BASE_HEX, NULL, 0x01,
30164       NULL, HFILL }},
30165
30166     {&hf_ieee80211_tag_extended_capabilities_b73,
30167      {"Extended Spectrum Management Capable", "wlan.extcap.b73",
30168       FT_BOOLEAN, 8, NULL, 0x02,
30169       NULL, HFILL }},
30170
30171     {&hf_ieee80211_tag_extended_capabilities_b74,
30172      {"Future Channel Capable", "wlan.extcap.b74",
30173       FT_BOOLEAN, 8, NULL, 0x04,
30174       NULL, HFILL }},
30175
30176     {&hf_ieee80211_tag_extended_capabilities_b75,
30177      {"Reserved", "wlan.extcap.b75",
30178       FT_UINT8, BASE_HEX, NULL, 0x08,
30179       NULL, HFILL }},
30180
30181     {&hf_ieee80211_tag_extended_capabilities_b76,
30182      {"Reserved", "wlan.extcap.b76",
30183       FT_UINT8, BASE_HEX, NULL, 0x10,
30184       NULL, HFILL }},
30185
30186     {&hf_ieee80211_tag_extended_capabilities_b77,
30187      {"TWT Requester Support", "wlan.extcap.b77",
30188       FT_BOOLEAN, 16, NULL, 0x20,
30189       NULL, HFILL }},
30190
30191     {&hf_ieee80211_tag_extended_capabilities_b78,
30192      {"TWT Responder Support", "wlan.extcap.b78",
30193       FT_BOOLEAN, 16, NULL, 0x40,
30194       NULL, HFILL }},
30195
30196     {&hf_ieee80211_tag_extended_capabilities_b79,
30197      {"OBSS Narrow Bandwidth RU in UL OFDMA Tolerance Support", "wlan.extcap.b79",
30198       FT_BOOLEAN, 16, NULL, 0x80,
30199       NULL, HFILL }},
30200
30201
30202     {&hf_ieee80211_tag_cisco_ccx1_unknown,
30203      {"Unknown", "wlan.cisco.ccx1.unknown",
30204       FT_BYTES, BASE_NONE, NULL, 0,
30205       NULL, HFILL }},
30206
30207     {&hf_ieee80211_tag_cisco_ccx1_name,
30208      {"Name", "wlan.cisco.ccx1.name",
30209       FT_STRING, BASE_NONE, NULL, 0,
30210       NULL, HFILL }},
30211
30212     {&hf_ieee80211_tag_cisco_ccx1_clients,
30213      {"Clients", "wlan.cisco.ccx1.clients",
30214       FT_UINT8, BASE_DEC, NULL, 0,
30215       NULL, HFILL }},
30216
30217     {&hf_ieee80211_tag_cisco_ccx1_unknown2,
30218      {"Unknown2", "wlan.cisco.ccx1.unknown2",
30219       FT_BYTES, BASE_NONE, NULL, 0,
30220       NULL, HFILL }},
30221
30222     {&hf_ieee80211_tag_neighbor_report_bssid,
30223      {"BSSID", "wlan.nreport.bssid",
30224       FT_ETHER, BASE_NONE, NULL, 0,
30225       NULL, HFILL }},
30226
30227     {&hf_ieee80211_tag_neighbor_report_bssid_info,
30228      {"BSSID Information", "wlan.nreport.bssid.info",
30229       FT_UINT32, BASE_HEX, NULL, 0,
30230       NULL, HFILL }},
30231
30232     {&hf_ieee80211_tag_neighbor_report_bssid_info_reachability,
30233      {"AP Reachability", "wlan.nreport.bssid.info.reachability",
30234       FT_UINT32, BASE_HEX, VALS(ieee80211_neighbor_report_bssid_info_reachability_vals), 0x00000003,
30235       "Indicates whether the AP identified by this BSSID is reachable by the STA that requested the neighbor report", HFILL }},
30236
30237     {&hf_ieee80211_tag_neighbor_report_bssid_info_security,
30238      {"Security", "wlan.nreport.bssid.info.security",
30239       FT_BOOLEAN, 32, NULL, 0x00000004,
30240       "Indicates that the AP identified by this BSSID supports the same security provisioning as used by the STA in its current association", HFILL }},
30241
30242     {&hf_ieee80211_tag_neighbor_report_bssid_info_key_scope,
30243      {"Key Scope", "wlan.nreport.bssid.info.keyscope",
30244       FT_BOOLEAN, 32, NULL, 0x00000008,
30245       "indicates the AP indicated by this BSSID has the same authenticator as the AP sending the report", HFILL }},
30246
30247     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability,
30248      {"Capability", "wlan.nreport.bssid.info.capability",
30249       FT_UINT32, BASE_HEX, NULL, 0x000003F0,
30250       "Contains selected capability information for the AP indicated by this BSSID", HFILL }},
30251
30252     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng,
30253      {"Spectrum Management", "wlan.nreport.bssid.info.capability.specmngt",
30254       FT_BOOLEAN, 32, NULL, 0x00000010,
30255       NULL, HFILL }},
30256
30257     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos,
30258      {"QoS", "wlan.nreport.bssid.info.capability.qos",
30259       FT_BOOLEAN, 32, NULL, 0x00000020,
30260       NULL, HFILL }},
30261
30262     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd,
30263      {"APSD", "wlan.nreport.bssid.info.capability.apsd",
30264       FT_BOOLEAN, 32, NULL, 0x00000040,
30265       NULL, HFILL }},
30266
30267     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt,
30268      {"Radio Measurement", "wlan.nreport.bssid.info.capability.radiomsnt",
30269       FT_BOOLEAN, 32, NULL, 0x00000080,
30270       NULL, HFILL }},
30271
30272     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback,
30273      {"Delayed Block Ack", "wlan.nreport.bssid.info.capability.dback",
30274       FT_BOOLEAN, 32, NULL, 0x000000100,
30275       NULL, HFILL }},
30276
30277     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback,
30278      {"Immediate Block Ack", "wlan.nreport.bssid.info.capability.iback",
30279       FT_BOOLEAN, 32, NULL, 0x00000200,
30280       NULL, HFILL }},
30281
30282     {&hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain,
30283      {"Mobility Domain", "wlan.nreport.bssid.info.mobilitydomain",
30284       FT_BOOLEAN, 32, NULL, 0x00000400,
30285       "", HFILL }},
30286
30287     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput,
30288      {"High Throughput Control (+HTC)", "wlan.nreport.bssid.info.hthoughput",
30289       FT_BOOLEAN, 32, NULL, 0x00000800,
30290       NULL, HFILL }},
30291
30292     {&hf_ieee80211_tag_neighbor_report_bssid_info_very_high_throughput,
30293      {"Very High Throughput (+VHT)", "wlan.nreport.bssid.info.vht",
30294       FT_BOOLEAN, 32, NULL, 0x00001000,
30295       NULL, HFILL }},
30296
30297     {&hf_ieee80211_tag_neighbor_report_bssid_info_ftm,
30298      {"Fine Timing Measurement (FTM)", "wlan.nreport.bssid.info.ftm",
30299       FT_BOOLEAN, 32, NULL, 0x00002000,
30300       NULL, HFILL }},
30301
30302     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_efficiency,
30303      {"High Efficiency (HE AP)", "wlan.nreport.bssid.info.he",
30304       FT_BOOLEAN, 32, NULL, 0x00004000,
30305       NULL, HFILL }},
30306
30307     {&hf_ieee80211_tag_neighbor_report_bssid_info_er_bss,
30308      {"Extended Range BSS", "wlan.nreport.bssid.info.er_bss",
30309       FT_BOOLEAN, 32, NULL, 0x00008000,
30310       NULL, HFILL }},
30311
30312     {&hf_ieee80211_tag_neighbor_report_bssid_info_reserved,
30313      {"Reserved", "wlan.nreport.bssid.info.reserved",
30314       FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
30315       "Must be zero", HFILL }},
30316
30317     {&hf_ieee80211_tag_neighbor_report_ope_class,
30318      {"Operating Class", "wlan.nreport.opeclass",
30319       FT_UINT8, BASE_DEC, NULL, 0,
30320       NULL, HFILL }},
30321
30322     {&hf_ieee80211_tag_neighbor_report_channel_number,
30323      {"Channel Number", "wlan.nreport.channumber",
30324       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
30325       NULL, HFILL }},
30326
30327     {&hf_ieee80211_tag_neighbor_report_phy_type,
30328      {"PHY Type", "wlan.nreport.phytype",
30329       FT_UINT8, BASE_HEX, NULL, 0,
30330       NULL, HFILL }},
30331
30332     {&hf_ieee80211_tag_neighbor_report_subelement_id,
30333      {"Subelement ID", "wlan.nreport.subelement_id",
30334       FT_UINT8, BASE_HEX, VALS(ieee80211_neighbor_report_subelement_id_vals), 0,
30335       NULL, HFILL }},
30336
30337     {&hf_ieee80211_tag_neighbor_report_subelement_length,
30338      {"Length", "wlan.nreport.subelement_length",
30339       FT_UINT8, BASE_HEX, NULL, 0,
30340       NULL, HFILL }},
30341
30342     {&hf_ieee80211_tag_neighbor_report_subelement_data,
30343      {"Subelement Data", "wlan.nreport.subelement_data",
30344       FT_BYTES, BASE_NONE, NULL, 0,
30345       NULL, HFILL }},
30346
30347     {&hf_ieee80211_tag_neighbor_report_subelement_bss_trn_can_pref,
30348      {"Preference", "wlan.nreport.subelement.bss_trn_can_pref",
30349       FT_UINT8, BASE_DEC, NULL, 0,
30350       NULL, HFILL }},
30351
30352     {&hf_ieee80211_tag_neighbor_report_subelement_bss_ter_tsf,
30353      {"BSS Termination TSF", "wlan.nreport.subelement.bss_ter_tsf",
30354       FT_UINT64, BASE_DEC, NULL, 0,
30355       NULL, HFILL }},
30356
30357     {&hf_ieee80211_tag_neighbor_report_subelement_bss_dur,
30358      {"Duration", "wlan.nreport.subelement.bss_dur",
30359       FT_UINT16, BASE_DEC, NULL, 0,
30360       NULL, HFILL }},
30361
30362     {&hf_ieee80211_tag_supported_ope_classes_current,
30363      {"Current Operating Class", "wlan.supopeclass.current",
30364       FT_UINT8, BASE_DEC, NULL, 0,
30365       NULL, HFILL }},
30366
30367     {&hf_ieee80211_tag_supported_ope_classes_alternate,
30368      {"Alternate Operating Classes", "wlan.supopeclass.alt",
30369       FT_NONE, BASE_NONE, 0x0, 0,
30370       NULL, HFILL }},
30371
30372     {&hf_ieee80211_wfa_ie_type,
30373      {"Type", "wlan.wfa.ie.type",
30374       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_type_vals), 0,
30375       NULL, HFILL }},
30376
30377     {&hf_ieee80211_wfa_ie_wpa_version,
30378      {"WPA Version", "wlan.wfa.ie.wpa.version",
30379       FT_UINT16, BASE_DEC, NULL, 0,
30380       NULL, HFILL }},
30381
30382     {&hf_ieee80211_wfa_ie_wpa_mcs,
30383      {"Multicast Cipher Suite", "wlan.wfa.ie.wpa.mcs",
30384       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_mcs_base_custom), 0,
30385       "Contains the cipher suite selector used by the BSS to protect broadcast/multicasttraffic", HFILL }},
30386
30387     {&hf_ieee80211_wfa_ie_wpa_mcs_oui,
30388      {"Multicast Cipher Suite OUI", "wlan.wfa.ie.wpa.mcs.oui",
30389       FT_UINT24, BASE_OUI, NULL, 0,
30390       NULL, HFILL }},
30391
30392     {&hf_ieee80211_wfa_ie_wpa_mcs_type,
30393      {"Multicast Cipher Suite type", "wlan.wfa.ie.wpa.mcs.type",
30394       FT_UINT8, BASE_DEC, NULL, 0,
30395       NULL, HFILL }},
30396
30397     {&hf_ieee80211_wfa_ie_wpa_mcs_wfa_type,
30398      {"Multicast Cipher Suite type", "wlan.wfa.ie.wpa.mcs.type",
30399       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
30400       NULL, HFILL }},
30401
30402     {&hf_ieee80211_wfa_ie_wpa_ucs_count,
30403      {"Unicast Cipher Suite Count", "wlan.wfa.ie.wpa.ucs.count",
30404       FT_UINT16, BASE_DEC, NULL, 0,
30405       "Indicates the number of pairwise cipher suite selectors that are contained in the Unicast Cipher Suite List", HFILL }},
30406
30407     {&hf_ieee80211_wfa_ie_wpa_ucs_list,
30408      {"Unicast Cipher Suite List", "wlan.wfa.ie.wpa.ucs.list",
30409       FT_NONE, BASE_NONE, NULL, 0,
30410       "Contains a series of cipher suite selectors that indicate the Unicast cipher suites", HFILL }},
30411
30412     {&hf_ieee80211_wfa_ie_wpa_ucs,
30413      {"Unicast Cipher Suite", "wlan.wfa.ie.wpa.ucs",
30414       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_ucs_base_custom), 0,
30415       NULL, HFILL }},
30416
30417     {&hf_ieee80211_wfa_ie_wpa_ucs_oui,
30418      {"Unicast Cipher Suite OUI", "wlan.wfa.ie.wpau.cs.oui",
30419       FT_UINT24, BASE_OUI, NULL, 0,
30420       NULL, HFILL }},
30421
30422     {&hf_ieee80211_wfa_ie_wpa_ucs_type,
30423      {"Unicast Cipher Suite type", "wlan.wfa.ie.wpa.ucs.type",
30424       FT_UINT8, BASE_DEC, NULL, 0,
30425       NULL, HFILL }},
30426
30427     {&hf_ieee80211_wfa_ie_wpa_ucs_wfa_type,
30428      {"Unicast Cipher Suite type", "wlan.wfa.ie.wpa.ucs.type",
30429       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
30430       NULL, HFILL }},
30431
30432     {&hf_ieee80211_wfa_ie_wpa_akms_count,
30433      {"Auth Key Management (AKM) Suite Count", "wlan.wfa.ie.wpa.akms.count",
30434       FT_UINT16, BASE_DEC, NULL, 0,
30435       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
30436
30437     {&hf_ieee80211_wfa_ie_wpa_akms_list,
30438      {"Auth Key Management (AKM) List", "wlan.wfa.ie.wpa.akms.list",
30439       FT_NONE, BASE_NONE, NULL, 0,
30440       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
30441
30442     {&hf_ieee80211_wfa_ie_wpa_akms,
30443      {"Auth Key Management (AKM) Suite", "wlan.wfa.ie.wpa.akms",
30444       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_akms_base_custom), 0,
30445       NULL, HFILL }},
30446
30447     {&hf_ieee80211_wfa_ie_wpa_akms_oui,
30448      {"Auth Key Management (AKM) OUI", "wlan.wfa.ie.wpa.akms.oui",
30449       FT_UINT24, BASE_OUI, NULL, 0,
30450       NULL, HFILL }},
30451
30452     {&hf_ieee80211_wfa_ie_wpa_akms_type,
30453      {"Auth Key Management (AKM) type", "wlan.wfa.ie.wpa.akms.type",
30454       FT_UINT8, BASE_DEC, NULL, 0,
30455       NULL, HFILL }},
30456
30457     {&hf_ieee80211_wfa_ie_wpa_akms_wfa_type,
30458      {"Auth Key Management (AKM) type", "wlan.wfa.ie.wpa.type",
30459       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_keymgmt_vals), 0,
30460       NULL, HFILL }},
30461
30462     {&hf_ieee80211_wfa_ie_wme_subtype,
30463      {"WME Subtype", "wlan.wfa.ie.wme.subtype",
30464       FT_UINT8, BASE_DEC, VALS(ieee802111_wfa_ie_wme_type), 0,
30465       NULL, HFILL }},
30466
30467     {&hf_ieee80211_wfa_ie_wme_version,
30468      {"WME Version", "wlan.wfa.ie.wme.version",
30469       FT_UINT8, BASE_DEC, NULL, 0,
30470       NULL, HFILL }},
30471
30472     {&hf_ieee80211_wfa_ie_wme_qos_info,
30473      {"WME QoS Info", "wlan.wfa.ie.wme.qos_info",
30474       FT_UINT8, BASE_HEX, NULL, 0,
30475       NULL, HFILL }},
30476
30477     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
30478      {"Max SP Length", "wlan.wfa.ie.wme.qos_info.sta.max_sp_length",
30479       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals), 0x60,
30480       NULL, HFILL }},
30481
30482     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
30483      {"AC_BE", "wlan.wfa.ie.wme.qos_info.sta.ac_be",
30484       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x08,
30485       NULL, HFILL }},
30486
30487     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
30488      {"AC_BK", "wlan.wfa.ie.wme.qos_info.sta.ac_bk",
30489       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x04,
30490       NULL, HFILL }},
30491
30492     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
30493      {"AC_VI", "wlan.wfa.ie.wme.qos_info.sta.ac_vi",
30494       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x02,
30495       NULL, HFILL }},
30496
30497     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
30498      {"AC_VO", "wlan.wfa.ie.wme.qos_info.sta.ac_vo",
30499       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x01,
30500       NULL, HFILL }},
30501
30502     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
30503      {"Reserved", "wlan.wfa.ie.wme.qos_info.sta.reserved",
30504       FT_UINT8, BASE_HEX, NULL, 0x90,
30505       "Must Be Zero", HFILL }},
30506
30507     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
30508      {"U-APSD", "wlan.wfa.ie.wme.qos_info.ap.u_apsd",
30509       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
30510       "Indicates the WMM AP is currently supporting unscheduled automatic power save delivery", HFILL }},
30511
30512     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
30513      {"Parameter Set Count", "wlan.wfa.ie.wme.qos_info.ap.parameter_set_count",
30514       FT_UINT8, BASE_HEX, NULL, 0x0F,
30515       NULL, HFILL }},
30516
30517     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
30518      {"Reserved", "wlan.wfa.ie.wme.qos_info.ap.reserved",
30519       FT_UINT8, BASE_HEX, NULL, 0x70,
30520       "Must Be Zero", HFILL }},
30521
30522     {&hf_ieee80211_wfa_ie_wme_reserved,
30523      {"Reserved", "wlan.wfa.ie.wme.reserved",
30524       FT_BYTES, BASE_NONE, NULL, 0,
30525       "Must Be Zero", HFILL }},
30526
30527     {&hf_ieee80211_wfa_ie_wme_ac_parameters,
30528      {"Ac Parameters", "wlan.wfa.ie.wme.acp",
30529       FT_NONE, BASE_NONE, NULL, 0,
30530       NULL, HFILL }},
30531
30532     {&hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
30533      {"ACI / AIFSN Field", "wlan.wfa.ie.wme.acp.aci_aifsn",
30534       FT_UINT8, BASE_HEX, NULL, 0,
30535       NULL, HFILL }},
30536
30537     {&hf_ieee80211_wfa_ie_wme_acp_aci,
30538      {"ACI", "wlan.wfa.ie.wme.acp.aci",
30539       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wme_acs_vals), 0x60,
30540       NULL, HFILL }},
30541
30542     {&hf_ieee80211_wfa_ie_wme_acp_acm,
30543      {"Admission Control Mandatory", "wlan.wfa.ie.wme.acp.acm",
30544       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
30545       NULL, HFILL }},
30546
30547     {&hf_ieee80211_wfa_ie_wme_acp_aifsn,
30548      {"AIFSN", "wlan.wfa.ie.wme.acp.aifsn",
30549       FT_UINT8, BASE_DEC, NULL, 0x0F,
30550       NULL, HFILL }},
30551
30552     {&hf_ieee80211_wfa_ie_wme_acp_reserved,
30553      {"Reserved", "wlan.wfa.ie.wme.acp.reserved",
30554       FT_UINT8, BASE_DEC, NULL, 0x80,
30555       "Must be Zero", HFILL }},
30556
30557     {&hf_ieee80211_wfa_ie_wme_acp_ecw,
30558      {"ECW", "wlan.wfa.ie.wme.acp.ecw",
30559       FT_UINT8, BASE_HEX, NULL, 0x00,
30560       NULL, HFILL }},
30561
30562     {&hf_ieee80211_wfa_ie_wme_acp_ecw_max,
30563      {"ECW Max", "wlan.wfa.ie.wme.acp.ecw.max",
30564       FT_UINT8, BASE_DEC, NULL, 0xF0,
30565       NULL, HFILL }},
30566
30567     {&hf_ieee80211_wfa_ie_wme_acp_ecw_min,
30568      {"ECW Min", "wlan.wfa.ie.wme.acp.ecw.min",
30569       FT_UINT8, BASE_DEC, NULL, 0x0F,
30570       NULL, HFILL }},
30571
30572     {&hf_ieee80211_wfa_ie_wme_acp_cw_max,
30573      {"CW Max", "wlan.wfa.ie.wme.acp.cw.max",
30574       FT_UINT8, BASE_DEC, NULL, 0,
30575       NULL, HFILL }},
30576
30577     {&hf_ieee80211_wfa_ie_wme_acp_cw_min,
30578      {"CW Min", "wlan.wfa.ie.wme.acp.cw.min",
30579       FT_UINT8, BASE_DEC, NULL, 0,
30580       NULL, HFILL }},
30581
30582     {&hf_ieee80211_wfa_ie_wme_acp_txop_limit,
30583      {"TXOP Limit", "wlan.wfa.ie.wme.acp.txop_limit",
30584       FT_UINT16, BASE_DEC, NULL, 0x00,
30585       NULL, HFILL }},
30586
30587     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
30588      {"TS Info", "wlan.wfa.ie.wme.tspec.ts_info",
30589       FT_UINT24, BASE_HEX, NULL, 0,
30590       "Traffic Stream (TS) Info", HFILL }},
30591
30592     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
30593      {"TID", "wlan.wfa.ie.wme.tspec.ts_info.tid",
30594       FT_UINT24, BASE_DEC, NULL, 0x00001E,
30595       "Traffic Stream Info ID (TID)", HFILL }},
30596
30597     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
30598      {"Direction", "wlan.wfa.ie.wme.tspec.ts_info.dir",
30599       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals), 0x000060,
30600       "Traffic Stream (TS) Info Direction", HFILL }},
30601
30602     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
30603      {"PSB", "wlan.wfa.ie.wme.tspec.ts_info.psb",
30604       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals), 0x000400,
30605       "Traffic Stream (TS) Info Power Save Behavior (PSB)", HFILL }},
30606
30607     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
30608      {"UP", "wlan.wfa.ie.wme.tspec.ts_info.up",
30609       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals), 0x003800,
30610       "Traffic Stream (TS) Info User Priority (UP)", HFILL }},
30611
30612     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
30613      {"Reserved", "wlan.wfa.ie.wme.tspec.ts_info.reserved",
30614       FT_UINT24, BASE_HEX, NULL, 0xFFC381,
30615       "Must be Zero", HFILL }},
30616
30617     {&hf_ieee80211_wfa_ie_wme_tspec_nor_msdu,
30618      {"Normal MSDU Size", "wlan.wfa.ie.wme.tspec.nor_msdu",
30619       FT_UINT16, BASE_DEC, NULL, 0,
30620       NULL, HFILL }},
30621
30622     {&hf_ieee80211_wfa_ie_wme_tspec_max_msdu,
30623      {"Maximum MSDU Size", "wlan.wfa.ie.wme.tspec.max_msdu",
30624       FT_UINT16, BASE_DEC, NULL, 0,
30625       NULL, HFILL }},
30626
30627     {&hf_ieee80211_wfa_ie_wme_tspec_min_srv,
30628      {"Minimum Service Interval", "wlan.wfa.ie.wme.tspec.min_srv",
30629       FT_UINT32, BASE_DEC, NULL, 0,
30630       NULL, HFILL }},
30631
30632     {&hf_ieee80211_wfa_ie_wme_tspec_max_srv,
30633      {"Maximum Service Interval", "wlan.wfa.ie.wme.tspec.max_srv",
30634       FT_UINT32, BASE_DEC, NULL, 0,
30635       NULL, HFILL }},
30636
30637     {&hf_ieee80211_wfa_ie_wme_tspec_inact_int,
30638      {"Inactivity Interval", "wlan.wfa.ie.wme.tspec.inact_int",
30639       FT_UINT32, BASE_DEC, NULL, 0,
30640       NULL, HFILL }},
30641
30642     {&hf_ieee80211_wfa_ie_wme_tspec_susp_int,
30643      {"Suspension Interval", "wlan.wfa.ie.wme.tspec.susp_int",
30644       FT_UINT32, BASE_DEC, NULL, 0,
30645       NULL, HFILL }},
30646
30647     {&hf_ieee80211_wfa_ie_wme_tspec_srv_start,
30648      {"Service Start Time", "wlan.wfa.ie.wme.tspec.srv_start",
30649       FT_UINT32, BASE_DEC, NULL, 0,
30650       NULL, HFILL }},
30651
30652     {&hf_ieee80211_wfa_ie_wme_tspec_min_data,
30653      {"Minimum Data Rate", "wlan.wfa.ie.wme.tspec.min_data",
30654       FT_UINT32, BASE_DEC, NULL, 0,
30655       NULL, HFILL }},
30656
30657     {&hf_ieee80211_wfa_ie_wme_tspec_mean_data,
30658      {"Mean Data Rate", "wlan.wfa.ie.wme.tspec.mean_data",
30659       FT_UINT32, BASE_DEC, NULL, 0,
30660       NULL, HFILL }},
30661
30662     {&hf_ieee80211_wfa_ie_wme_tspec_peak_data,
30663      {"Peak Data Rate", "wlan.wfa.ie.wme.tspec.peak_data",
30664       FT_UINT32, BASE_DEC, NULL, 0,
30665       NULL, HFILL }},
30666
30667     {&hf_ieee80211_wfa_ie_wme_tspec_burst_size,
30668      {"Burst Size", "wlan.wfa.ie.wme.tspec.burst_size",
30669       FT_UINT32, BASE_DEC, NULL, 0,
30670       NULL, HFILL }},
30671
30672     {&hf_ieee80211_wfa_ie_wme_tspec_delay_bound,
30673      {"Delay Bound", "wlan.wfa.ie.wme.tspec.delay_bound",
30674       FT_UINT32, BASE_DEC, NULL, 0,
30675       NULL, HFILL }},
30676
30677     {&hf_ieee80211_wfa_ie_wme_tspec_min_phy,
30678      {"Minimum PHY Rate", "wlan.wfa.ie.wme.tspec.min_phy",
30679       FT_UINT32, BASE_DEC, NULL, 0,
30680       NULL, HFILL }},
30681
30682     {&hf_ieee80211_wfa_ie_wme_tspec_surplus,
30683      {"Surplus Bandwidth Allowance", "wlan.wfa.ie.wme.tspec.surplus",
30684       FT_UINT16, BASE_DEC, NULL, 0,
30685       NULL, HFILL }},
30686
30687     {&hf_ieee80211_wfa_ie_wme_tspec_medium,
30688      {"Medium Time", "wlan.wfa.ie.wme.tspec.medium",
30689       FT_UINT16, BASE_DEC, NULL, 0,
30690       NULL, HFILL }},
30691
30692     {&hf_ieee80211_rsn_ie_pmkid,
30693      {"RSN PMKID", "wlan.rsn.ie.pmkid",
30694       FT_BYTES, BASE_NONE, NULL, 0,
30695       NULL, HFILL }},
30696
30697     {&hf_ieee80211_rsn_ie_unknown,
30698      {"RSN Unknown", "wlan.rsn.ie.unknown",
30699       FT_BYTES, BASE_NONE, NULL, 0,
30700       NULL, HFILL }},
30701
30702     {&hf_ieee80211_marvell_ie_type,
30703      {"Type", "wlan.marvell.ie.type",
30704       FT_UINT8, BASE_HEX, NULL, 0,
30705       NULL, HFILL }},
30706
30707     {&hf_ieee80211_marvell_ie_mesh_subtype,
30708      {"Subtype", "wlan.marvell.ie.subtype",
30709       FT_UINT8, BASE_HEX, NULL, 0,
30710       NULL, HFILL }},
30711
30712     {&hf_ieee80211_marvell_ie_mesh_version,
30713      {"Version", "wlan.marvell.ie.version",
30714       FT_UINT8, BASE_HEX, NULL, 0,
30715       NULL, HFILL }},
30716
30717     {&hf_ieee80211_marvell_ie_mesh_active_proto_id,
30718      {"Path Selection Protocol", "wlan.marvell.ie.proto_id",
30719       FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0,
30720       NULL, HFILL }},
30721
30722     {&hf_ieee80211_marvell_ie_mesh_active_metric_id,
30723      {"Path Selection Metric", "wlan.marvell.ie.metric_id",
30724       FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0,
30725       NULL, HFILL }},
30726
30727     {&hf_ieee80211_marvell_ie_mesh_cap,
30728      {"Mesh Capabilities", "wlan.marvell.ie.cap",
30729       FT_UINT8, BASE_HEX, NULL, 0,
30730       NULL, HFILL }},
30731
30732     {&hf_ieee80211_marvell_ie_data,
30733      { "Marvell IE data", "wlan.marvell.data",
30734        FT_BYTES, BASE_NONE, NULL, 0x0,
30735        NULL, HFILL }},
30736
30737     {&hf_ieee80211_atheros_ie_type,
30738      {"Type", "wlan.atheros.ie.type",
30739       FT_UINT8, BASE_HEX, VALS(atheros_ie_type_vals), 0,
30740       NULL, HFILL }},
30741
30742     {&hf_ieee80211_atheros_ie_subtype,
30743      {"Subtype", "wlan.atheros.ie.subtype",
30744       FT_UINT8, BASE_HEX, NULL, 0,
30745       NULL, HFILL }},
30746
30747     {&hf_ieee80211_atheros_ie_version,
30748      {"Version", "wlan.atheros.ie.version",
30749       FT_UINT8, BASE_HEX, NULL, 0,
30750       NULL, HFILL }},
30751
30752     {&hf_ieee80211_atheros_ie_cap_f_turbop,
30753      {"Turbo Prime", "wlan.ie.atheros.capabilities.turbop",
30754       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_TURBOP,
30755       NULL, HFILL }},
30756
30757     {&hf_ieee80211_atheros_ie_cap_f_comp,
30758      {"Compression", "wlan.ie.atheros.capabilities.comp",
30759       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_COMP,
30760       NULL, HFILL }},
30761
30762     {&hf_ieee80211_atheros_ie_cap_f_ff,
30763      {"Fast Frames", "wlan.ie.atheros.capabilities.ff",
30764       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_FF,
30765       NULL, HFILL }},
30766
30767     {&hf_ieee80211_atheros_ie_cap_f_xr,
30768      {"eXtended Range", "wlan.ie.atheros.capabilities.xr",
30769       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_XR,
30770       NULL, HFILL }},
30771
30772     {&hf_ieee80211_atheros_ie_cap_f_ar,
30773      {"Advanced Radar", "wlan.ie.atheros.capabilities.ar",
30774       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_AR,
30775       NULL, HFILL }},
30776
30777     {&hf_ieee80211_atheros_ie_cap_f_burst,
30778      {"Burst", "wlan.ie.atheros.capabilities.burst",
30779       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BURST,
30780       NULL, HFILL }},
30781
30782     {&hf_ieee80211_atheros_ie_cap_f_wme,
30783      {"CWMin tuning", "wlan.ie.atheros.capabilities.wme",
30784       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_WME,
30785       NULL, HFILL }},
30786
30787     {&hf_ieee80211_atheros_ie_cap_f_boost,
30788      {"Boost", "wlan.ie.atheros.capabilities.boost",
30789       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BOOST,
30790       NULL, HFILL }},
30791
30792     {&hf_ieee80211_atheros_ie_advcap_cap,
30793      {"Capabilities", "wlan.atheros.ie.advcap.cap",
30794       FT_UINT8, BASE_HEX, NULL, 0,
30795       NULL, HFILL }},
30796
30797     {&hf_ieee80211_atheros_ie_advcap_defkey,
30798      {"Default key index", "wlan.atheros.ie.advcap.defkey",
30799       FT_UINT16, BASE_HEX, NULL, 0,
30800       NULL, HFILL }},
30801
30802     {&hf_ieee80211_atheros_ie_xr_info,
30803      {"Info", "wlan.atheros.ie.xr.info",
30804       FT_UINT8, BASE_HEX, NULL, 0,
30805       NULL, HFILL }},
30806
30807     {&hf_ieee80211_atheros_ie_xr_base_bssid,
30808      {"Base BSS Id", "wlan.atheros.ie.xr.base_bssid",
30809       FT_ETHER, BASE_NONE, NULL, 0,
30810       NULL, HFILL }},
30811
30812     {&hf_ieee80211_atheros_ie_xr_xr_bssid,
30813      {"XR BSS Id", "wlan.atheros.ie.xr.xr_bssid",
30814       FT_ETHER, BASE_NONE, NULL, 0,
30815       NULL, HFILL }},
30816
30817     {&hf_ieee80211_atheros_ie_xr_xr_beacon,
30818      {"XR Beacon Interval", "wlan.atheros.ie.xr.xr_beacon",
30819       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
30820       NULL, HFILL }},
30821
30822     {&hf_ieee80211_atheros_ie_xr_base_cap,
30823      {"Base capabilities", "wlan.atheros.ie.xr.base_cap",
30824       FT_UINT8, BASE_HEX, NULL, 0,
30825       NULL, HFILL }},
30826
30827     {&hf_ieee80211_atheros_ie_xr_xr_cap,
30828      {"XR capabilities", "wlan.atheros.ie.xr.xr_cap",
30829       FT_UINT8, BASE_HEX, NULL, 0,
30830       NULL, HFILL }},
30831
30832     {&hf_ieee80211_atheros_ie_data,
30833      {"Atheros IE data", "wlan.atheros.data",
30834       FT_BYTES, BASE_NONE, NULL, 0,
30835       NULL, HFILL }},
30836
30837     {&hf_ieee80211_aironet_ie_type,
30838      {"Aironet IE type", "wlan.aironet.type",
30839       FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0,
30840       NULL, HFILL }},
30841
30842     {&hf_ieee80211_aironet_ie_dtpc,
30843      {"Aironet IE CCX DTCP", "wlan.aironet.dtpc",
30844       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
30845       NULL, HFILL }},
30846
30847     {&hf_ieee80211_aironet_ie_dtpc_unknown,
30848      {"Aironet IE CCX DTCP Unknown", "wlan.aironet.dtpc_unknown",
30849       FT_BYTES, BASE_NONE, NULL, 0,
30850       NULL, HFILL }},
30851
30852     {&hf_ieee80211_aironet_ie_version,
30853      {"Aironet IE CCX version", "wlan.aironet.version",
30854       FT_UINT8, BASE_DEC, NULL, 0,
30855       NULL, HFILL }},
30856
30857     {&hf_ieee80211_aironet_ie_data,
30858      { "Aironet IE data", "wlan.aironet.data",
30859        FT_BYTES, BASE_NONE, NULL, 0x0,
30860        NULL, HFILL }},
30861
30862     {&hf_ieee80211_qbss_version,
30863      {"QBSS Version", "wlan.qbss.version",
30864       FT_UINT8, BASE_DEC, NULL, 0,
30865       NULL, HFILL }},
30866
30867     {&hf_ieee80211_qbss_scount,
30868      {"Station Count", "wlan.qbss.scount",
30869       FT_UINT16, BASE_DEC, NULL, 0,
30870       NULL, HFILL }},
30871
30872     {&hf_ieee80211_qbss_cu,
30873      {"Channel Utilization", "wlan.qbss.cu",
30874       FT_UINT8, BASE_DEC, NULL, 0,
30875       NULL, HFILL }},
30876
30877     {&hf_ieee80211_qbss_adc,
30878      {"Available Admission Capacity", "wlan.qbss.adc",
30879       FT_UINT8, BASE_DEC, NULL, 0,
30880       NULL, HFILL }},
30881
30882     {&hf_ieee80211_qbss2_cu,
30883      {"Channel Utilization", "wlan.qbss2.cu",
30884       FT_UINT8, BASE_DEC, NULL, 0,
30885       NULL, HFILL }},
30886
30887     {&hf_ieee80211_qbss2_gl,
30888      {"G.711 CU Quantum", "wlan.qbss2.glimit",
30889       FT_UINT8, BASE_DEC, NULL, 0,
30890       NULL, HFILL }},
30891
30892     {&hf_ieee80211_qbss2_cal,
30893      {"Call Admission Limit", "wlan.qbss2.cal",
30894       FT_UINT8, BASE_DEC, NULL, 0,
30895       NULL, HFILL }},
30896
30897     {&hf_ieee80211_qbss2_scount,
30898      {"Station Count", "wlan.qbss2.scount",
30899       FT_UINT16, BASE_DEC, NULL, 0,
30900       NULL, HFILL }},
30901
30902     {&hf_ieee80211_aironet_ie_qos_reserved,
30903      {"Aironet IE QoS reserved", "wlan.aironet.qos.reserved",
30904       FT_UINT8, BASE_HEX, NULL, 0,
30905       NULL, HFILL }},
30906
30907     {&hf_ieee80211_aironet_ie_qos_paramset,
30908      {"Aironet IE QoS paramset", "wlan.aironet.qos.paramset",
30909       FT_UINT8, BASE_DEC, NULL, 0,
30910       NULL, HFILL }},
30911
30912     {&hf_ieee80211_aironet_ie_qos_val,
30913      {"Aironet IE QoS valueset", "wlan.aironet.qos.val",
30914       FT_BYTES, BASE_NONE, NULL, 0,
30915       NULL, HFILL }},
30916
30917     {&hf_ieee80211_aironet_ie_clientmfp,
30918      {"Aironet IE Client MFP", "wlan.aironet.clientmfp",
30919       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
30920       NULL, HFILL }},
30921
30922     /* Vendor Specific : Nintendo */
30923     {&hf_ieee80211_vs_nintendo_type,
30924      {"Type", "wlan.vs.nintendo.type",
30925       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_nintendo_type_vals), 0,
30926       NULL, HFILL }},
30927
30928     {&hf_ieee80211_vs_nintendo_length,
30929      {"Length", "wlan.vs.nintendo.length",
30930       FT_UINT8, BASE_DEC, NULL, 0,
30931       NULL, HFILL }},
30932
30933     {&hf_ieee80211_vs_nintendo_servicelist,
30934      {"Servicelist", "wlan.vs.nintendo.servicelist",
30935       FT_BYTES, BASE_NONE, NULL, 0,
30936       NULL, HFILL }},
30937
30938     {&hf_ieee80211_vs_nintendo_service,
30939      {"Service", "wlan.vs.nintendo.service",
30940       FT_BYTES, BASE_NONE, NULL, 0,
30941       NULL, HFILL }},
30942
30943     {&hf_ieee80211_vs_nintendo_consoleid,
30944      {"Console ID", "wlan.vs.nintendo.consoleid",
30945       FT_BYTES, BASE_NONE, NULL, 0,
30946       NULL, HFILL }},
30947
30948     {&hf_ieee80211_vs_nintendo_unknown,
30949      {"Unknown", "wlan.vs.nintendo.unknown",
30950       FT_BYTES, BASE_NONE, NULL, 0,
30951       NULL, HFILL }},
30952
30953     /* Vendor Specific : Aruba Networks */
30954     {&hf_ieee80211_vs_aruba_subtype,
30955      {"Subtype", "wlan.vs.aruba.subtype",
30956       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_aruba_subtype_vals), 0,
30957       NULL, HFILL }},
30958
30959     {&hf_ieee80211_vs_aruba_apname,
30960      {"AP Name", "wlan.vs.aruba.ap_name",
30961       FT_STRINGZ, BASE_NONE, NULL, 0,
30962       NULL, HFILL }},
30963
30964     {&hf_ieee80211_vs_aruba_data,
30965      {"Data", "wlan.vs.aruba.data",
30966       FT_BYTES, BASE_NONE, NULL, 0,
30967       NULL, HFILL }},
30968
30969     {&hf_ieee80211_vs_mikrotik_unknown,
30970      {"Unknown", "wlan.vs.mikrotik.unknown",
30971       FT_BYTES, BASE_NONE, NULL, 0,
30972       NULL, HFILL }},
30973
30974     {&hf_ieee80211_vs_mikrotik_subitem,
30975      {"Sub IE", "wlan.vs.mikrotik.unknown",
30976       FT_BYTES, BASE_NONE, NULL, 0,
30977       NULL, HFILL }},
30978
30979     {&hf_ieee80211_vs_mikrotik_subtype,
30980      {"Subtype", "wlan.vs.mikrotik.subtype",
30981       FT_UINT8, BASE_DEC, NULL, 0,
30982       NULL, HFILL }},
30983
30984     {&hf_ieee80211_vs_mikrotik_sublength,
30985      {"Sublength", "wlan.vs.mikrotik.sublength",
30986       FT_UINT8, BASE_DEC, NULL, 0,
30987       NULL, HFILL }},
30988
30989     {&hf_ieee80211_vs_mikrotik_subdata,
30990      {"Subdata", "wlan.vs.mikrotik.subdata",
30991       FT_BYTES, BASE_NONE, NULL, 0,
30992       NULL, HFILL }},
30993
30994     /* Vendor Specific : Meru (Fortinet) */
30995     {&hf_ieee80211_vs_meru_subitem,
30996      {"Sub IE", "wlan.vs.meru.unknown",
30997       FT_NONE, BASE_NONE, NULL, 0,
30998       NULL, HFILL }},
30999
31000     {&hf_ieee80211_vs_meru_subtype,
31001      {"Subtype", "wlan.vs.meru.subtype",
31002       FT_UINT8, BASE_DEC, NULL, 0,
31003       NULL, HFILL }},
31004
31005     {&hf_ieee80211_vs_meru_sublength,
31006      {"Sublength", "wlan.vs.meru.sublength",
31007       FT_UINT8, BASE_DEC, NULL, 0,
31008       NULL, HFILL }},
31009
31010     {&hf_ieee80211_vs_meru_subdata,
31011      {"Subdata", "wlan.vs.meru.subdata",
31012       FT_BYTES, BASE_NONE, NULL, 0,
31013       NULL, HFILL }},
31014
31015     /* Vendor Specific : Extreme (Zebra) */
31016     {&hf_ieee80211_vs_extreme_subtype,
31017      {"Subtype", "wlan.vs.extreme.subtype",
31018       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_extreme_subtype_vals), 0,
31019       NULL, HFILL }},
31020
31021     {&hf_ieee80211_vs_extreme_subdata,
31022      {"Subdata", "wlan.vs.extreme.subdata",
31023       FT_BYTES, BASE_NONE, NULL, 0,
31024       NULL, HFILL }},
31025
31026     {&hf_ieee80211_vs_extreme_unknown,
31027      {"Unknown", "wlan.vs.extreme.unknown",
31028       FT_BYTES, BASE_NONE, NULL, 0,
31029       NULL, HFILL }},
31030
31031     {&hf_ieee80211_vs_extreme_ap_length,
31032      {"AP Length", "wlan.vs.extreme.ap_length",
31033       FT_UINT8, BASE_DEC, NULL, 0,
31034       NULL, HFILL }},
31035
31036     {&hf_ieee80211_vs_extreme_ap_name,
31037      {"AP Name", "wlan.vs.extreme.ap_name",
31038       FT_STRING, BASE_NONE, NULL, 0,
31039       NULL, HFILL }},
31040
31041     {&hf_ieee80211_tsinfo,
31042      {"Traffic Stream (TS) Info", "wlan.ts_info",
31043       FT_UINT24, BASE_HEX, NULL, 0,
31044       "Traffic Stream (TS) Info field", HFILL }},
31045
31046     {&hf_ieee80211_tsinfo_type,
31047      {"Traffic Type", "wlan.ts_info.type",
31048       FT_UINT24, BASE_DEC, VALS(tsinfo_type), 0x000001,
31049       "Traffic Stream (TS) Info Traffic Type", HFILL }},
31050
31051     {&hf_ieee80211_tsinfo_tsid,
31052      {"Traffic Stream ID (TSID)", "wlan.ts_info.tsid",
31053       FT_UINT24, BASE_DEC, NULL, 0x00001E,
31054       "Traffic Stream ID (TSID) Info TSID", HFILL }},
31055
31056     {&hf_ieee80211_tsinfo_dir,
31057      {"Direction", "wlan.ts_info.dir",
31058       FT_UINT24, BASE_DEC, VALS(tsinfo_direction), 0x000060,
31059       "Traffic Stream (TS) Info Direction", HFILL }},
31060
31061     {&hf_ieee80211_tsinfo_access,
31062      {"Access Policy", "wlan.ts_info.dir",
31063       FT_UINT24, BASE_DEC, VALS(tsinfo_access), 0x000180,
31064       "Traffic Stream (TS) Info Access Policy", HFILL }},
31065
31066     {&hf_ieee80211_tsinfo_agg,
31067      {"Aggregation", "wlan.ts_info.agg",
31068       FT_UINT24, BASE_DEC, NULL, 0x000200,
31069       "Traffic Stream (TS) Info Access Policy", HFILL }},
31070
31071     {&hf_ieee80211_tsinfo_apsd,
31072      {"Automatic Power-Save Delivery (APSD)", "wlan.ts_info.apsd",
31073       FT_UINT24, BASE_DEC, NULL, 0x000400,
31074       "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
31075
31076     {&hf_ieee80211_tsinfo_up,
31077      {"User Priority", "wlan.ts_info.up",
31078       FT_UINT24, BASE_DEC, VALS(qos_up), 0x003800,
31079       "Traffic Stream (TS) Info User Priority", HFILL }},
31080
31081     {&hf_ieee80211_tsinfo_ack,
31082      {"Ack Policy", "wlan.ts_info.ack",
31083       FT_UINT24, BASE_DEC, VALS(ack_policy), 0x00C000,
31084       "Traffic Stream (TS) Info Ack Policy", HFILL }},
31085
31086     {&hf_ieee80211_tsinfo_sched,
31087      {"Schedule", "wlan.ts_info.sched",
31088       FT_UINT24, BASE_DEC, NULL, 0x010000,
31089       "Traffic Stream (TS) Info Schedule", HFILL }},
31090
31091     {&hf_ieee80211_tsinfo_rsv,
31092      {"Reserved", "wlan.ts_info.rsv",
31093       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
31094       "Must be Zero", HFILL }},
31095
31096     {&hf_ieee80211_tspec_nor_msdu,
31097      {"Normal MSDU Size", "wlan.tspec.nor_msdu",
31098       FT_UINT16, BASE_DEC, NULL, 0,
31099       NULL, HFILL }},
31100
31101     {&hf_ieee80211_tspec_max_msdu,
31102      {"Maximum MSDU Size", "wlan.tspec.max_msdu",
31103       FT_UINT16, BASE_DEC, NULL, 0,
31104       NULL, HFILL }},
31105
31106     {&hf_ieee80211_tspec_min_srv,
31107      {"Minimum Service Interval", "wlan.tspec.min_srv",
31108       FT_UINT32, BASE_DEC, NULL, 0,
31109       NULL, HFILL }},
31110
31111     {&hf_ieee80211_tspec_max_srv,
31112      {"Maximum Service Interval", "wlan.tspec.max_srv",
31113       FT_UINT32, BASE_DEC, NULL, 0,
31114       NULL, HFILL }},
31115
31116     {&hf_ieee80211_tspec_inact_int,
31117      {"Inactivity Interval", "wlan.tspec.inact_int",
31118       FT_UINT32, BASE_DEC, NULL, 0,
31119       NULL, HFILL }},
31120
31121     {&hf_ieee80211_tspec_susp_int,
31122      {"Suspension Interval", "wlan.tspec.susp_int",
31123       FT_UINT32, BASE_DEC, NULL, 0,
31124       NULL, HFILL }},
31125
31126     {&hf_ieee80211_tspec_srv_start,
31127      {"Service Start Time", "wlan.tspec.srv_start",
31128       FT_UINT32, BASE_DEC, NULL, 0,
31129       NULL, HFILL }},
31130
31131     {&hf_ieee80211_tspec_min_data,
31132      {"Minimum Data Rate", "wlan.tspec.min_data",
31133       FT_UINT32, BASE_DEC, NULL, 0,
31134       NULL, HFILL }},
31135
31136     {&hf_ieee80211_tspec_mean_data,
31137      {"Mean Data Rate", "wlan.tspec.mean_data",
31138       FT_UINT32, BASE_DEC, NULL, 0,
31139       NULL, HFILL }},
31140
31141     {&hf_ieee80211_tspec_peak_data,
31142      {"Peak Data Rate", "wlan.tspec.peak_data",
31143       FT_UINT32, BASE_DEC, NULL, 0,
31144       NULL, HFILL }},
31145
31146     {&hf_ieee80211_tspec_burst_size,
31147      {"Burst Size", "wlan.tspec.burst_size",
31148       FT_UINT32, BASE_DEC, NULL, 0,
31149       NULL, HFILL }},
31150
31151     {&hf_ieee80211_tspec_delay_bound,
31152      {"Delay Bound", "wlan.tspec.delay_bound",
31153       FT_UINT32, BASE_DEC, NULL, 0,
31154       NULL, HFILL }},
31155
31156     {&hf_ieee80211_tspec_min_phy,
31157      {"Minimum PHY Rate", "wlan.tspec.min_phy",
31158       FT_UINT32, BASE_DEC, NULL, 0,
31159       NULL, HFILL }},
31160
31161     {&hf_ieee80211_tspec_surplus,
31162      {"Surplus Bandwidth Allowance", "wlan.tspec.surplus",
31163       FT_UINT16, BASE_DEC, NULL, 0,
31164       NULL, HFILL }},
31165
31166     {&hf_ieee80211_tspec_medium,
31167      {"Medium Time", "wlan.tspec.medium",
31168       FT_UINT16, BASE_DEC, NULL, 0,
31169       NULL, HFILL }},
31170
31171     {&hf_ieee80211_tspec_dmg,
31172      {"DMG attributes", "wlan.tspec.dmg",
31173       FT_UINT16, BASE_DEC, NULL, 0,
31174       NULL, HFILL }},
31175
31176     {&hf_ieee80211_ts_delay,
31177      {"Traffic Stream (TS) Delay", "wlan.ts_delay",
31178       FT_UINT32, BASE_DEC, NULL, 0,
31179       NULL, HFILL }},
31180
31181     {&hf_ieee80211_tclas_process,
31182      {"Processing", "wlan.tclas_proc.processing",
31183       FT_UINT8, BASE_DEC, VALS(ieee80211_tclas_process_flag), 0,
31184       NULL, HFILL }},
31185
31186     {&hf_ieee80211_tag_ext_supp_rates,
31187      {"Extended Supported Rates", "wlan.extended_supported_rates",
31188       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
31189       "In Mbit/sec, (B) for Basic Rates", HFILL }},
31190
31191     {&hf_ieee80211_sched_info,
31192      {"Schedule Info", "wlan.sched.sched_info",
31193       FT_UINT16, BASE_HEX, NULL, 0,
31194       "Schedule Info field", HFILL }},
31195
31196     {&hf_ieee80211_sched_info_agg,
31197      {"Schedule Aggregation", "wlan.sched_info.agg",
31198       FT_UINT16, BASE_DEC, NULL, 0x0001,
31199       "Traffic Stream (TS) Info Access Policy", HFILL }},
31200
31201     {&hf_ieee80211_sched_info_tsid,
31202      {"Schedule Traffic Stream ID (TSID)", "wlan.sched_info.tsid",
31203       FT_UINT16, BASE_DEC, NULL, 0x001E,
31204       "Traffic Stream ID (TSID) Info TSID", HFILL }},
31205
31206     {&hf_ieee80211_sched_info_dir,
31207      {"Schedule Direction", "wlan.sched_info.dir",
31208       FT_UINT16, BASE_DEC, VALS(tsinfo_direction), 0x0060,
31209       "Traffic Stream (TS) Info Direction", HFILL }},
31210
31211     {&hf_ieee80211_sched_srv_start,
31212      {"Service Start Time", "wlan.sched.srv_start",
31213       FT_UINT32, BASE_HEX, NULL, 0,
31214       NULL, HFILL }},
31215
31216     {&hf_ieee80211_sched_srv_int,
31217      {"Service Interval", "wlan.sched.srv_int",
31218       FT_UINT32, BASE_HEX, NULL, 0,
31219       NULL, HFILL }},
31220
31221     {&hf_ieee80211_sched_spec_int,
31222      {"Specification Interval", "wlan.sched.spec_int",
31223       FT_UINT16, BASE_HEX, NULL, 0,
31224       NULL, HFILL }},
31225
31226     {&hf_ieee80211_aruba,
31227      {"Aruba Type", "wlan.aruba.type",
31228       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &aruba_mgt_typevals_ext, 0,
31229       "Aruba Management", HFILL }},
31230
31231     {&hf_ieee80211_aruba_hb_seq,
31232      {"Aruba Heartbeat Sequence", "wlan.aruba.heartbeat_sequence",
31233       FT_UINT64, BASE_DEC, NULL, 0,
31234       NULL, HFILL }},
31235
31236     {&hf_ieee80211_aruba_mtu,
31237      {"Aruba MTU Size", "wlan.aruba.mtu_size",
31238       FT_UINT16, BASE_DEC, NULL, 0,
31239       NULL, HFILL }},
31240
31241     /* Start: HT Control (+HTC) */
31242     {&hf_ieee80211_htc,
31243      {"HT Control (+HTC)", "wlan.htc",
31244       FT_UINT32, BASE_HEX, NULL, 0,
31245       "High Throughput Control (+HTC)", HFILL }},
31246
31247     {&hf_ieee80211_htc_vht,
31248      {"VHT", "wlan.htc.vht",
31249       FT_BOOLEAN, 32, NULL, HTC_VHT,
31250       "High Throughput Control HT/VHT flag", HFILL }},
31251
31252     {&hf_ieee80211_htc_he,
31253      {"HE", "wlan.htc.he",
31254       FT_BOOLEAN, 32, NULL, HTC_HE,
31255       "High Efficiency Control HE flag", HFILL }},
31256
31257     {&hf_ieee80211_htc_he_ctrl_id,
31258      {"Control ID", "wlan.htc.he.a_control.ctrl_id",
31259       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
31260
31261     {&hf_ieee80211_he_umrs_he_tb_ppdu_len,
31262      {"HE TB PPDU Length", "wlan.htc.he.a_control.umrs.he_tb_ppdu_len",
31263       FT_UINT8, BASE_DEC, NULL, 0x0000001f, NULL, HFILL }},
31264
31265     {&hf_ieee80211_he_umrs_ru_allocation,
31266      {"RU Allocation", "wlan.htc.he.a_control.umrs.ru_allocation",
31267       FT_UINT8, BASE_HEX, NULL, 0x00001fe0, NULL, HFILL }},
31268
31269     {&hf_ieee80211_he_dl_tx_power,
31270      {"DL Tx Power", "wlan.htc.he.a_control.umrs.dl_tx_power",
31271       FT_UINT8, BASE_HEX, NULL, 0x0003e000, NULL, HFILL }},
31272
31273     {&hf_ieee80211_he_ul_target_rssi,
31274      {"UL Target RSSI", "wlan.htc.he.a_control.umrs.ul_target_rssi",
31275       FT_UINT8, BASE_CUSTOM, CF_FUNC(ul_target_rssi_base_custom),
31276       0x007c0000, NULL, HFILL }},
31277
31278     {&hf_ieee80211_he_ul_mcs,
31279      {"UL MCS", "wlan.htc.he.a_control.umrs.ul_mcs",
31280       FT_UINT8, BASE_HEX, NULL, 0x018000000, NULL, HFILL }},
31281
31282     {&hf_ieee80211_he_ul_reserved,
31283      {"reserved", "wlan.htc.he.a_control.umrs.reserved",
31284       FT_UINT32, BASE_HEX, NULL, 0x02000000, NULL, HFILL }},
31285
31286     {&hf_ieee80211_he_om_rx_nss,
31287      {"Rx NSS", "wlan.htc.he.a_control.om.rx_nss",
31288       FT_UINT32, BASE_DEC, NULL, 0x00000007, NULL, HFILL }},
31289
31290     {&hf_ieee80211_he_om_channel_width,
31291      {"Channel Width", "wlan.htc.he.a_control.om.channel_width",
31292       FT_UINT32, BASE_DEC, NULL, 0x00000018, NULL, HFILL }},
31293
31294     {&hf_ieee80211_he_om_ul_mu_disable,
31295      {"UL MU Disable", "wlan.htc.he.a_control.om.ul_mu_disable",
31296       FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL }},
31297
31298     {&hf_ieee80211_he_om_tx_nsts,
31299      {"Tx NSTS", "wlan.htc.he.a_control.om.tx_nsts",
31300       FT_UINT32, BASE_DEC, NULL, 0x000001c0, NULL, HFILL }},
31301
31302     {&hf_ieee80211_he_om_reserved,
31303      {"Reserved", "wlan.htc.he.a_control.om.reserved",
31304       FT_UINT32, BASE_HEX, NULL, 0x000002c0, NULL, HFILL }},
31305
31306     {&hf_ieee80211_he_hla_unsolicited_mfb,
31307      {"Unsolicited MFB", "wlan.htc.he.a_control.hla.unsolicited_mfb",
31308       FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL }},
31309
31310     {&hf_ieee80211_he_hla_mrq,
31311      {"MRQ", "wlan.htc.he.a_control.hla.mrq",
31312       FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL }},
31313
31314     {&hf_ieee80211_he_hla_nss,
31315      {"NSS", "wlan.htc.he.a_control.hla.NSS",
31316       FT_UINT32, BASE_DEC, NULL, 0x0000001c, NULL, HFILL }},
31317
31318     {&hf_ieee80211_he_hla_he_mcs,
31319      {"HE-MCS", "wlan.htc.he.a_control.hla.he_mcs",
31320       FT_UINT32, BASE_DEC, NULL, 0x000001e0, NULL, HFILL }},
31321
31322     {&hf_ieee80211_he_hla_dcm,
31323      {"DCM", "wlan.htc.he.a_control.hla.dcm",
31324       FT_BOOLEAN, 32, NULL, 0x00000200, NULL, HFILL }},
31325
31326     {&hf_ieee80211_he_hla_ru,
31327      {"RU", "wlan.htc.he.a_control.hla.ru",
31328       FT_UINT32, BASE_DEC, NULL, 0x0003fc00, NULL, HFILL }},
31329
31330     {&hf_ieee80211_he_hla_bw,
31331      {"BW", "wlan.htc.he.a_control.hla.bw",
31332       FT_UINT32, BASE_DEC, NULL, 0x000c0000, NULL, HFILL }},
31333
31334     {&hf_ieee80211_he_hla_msi_ppdu_type,
31335      {"MSI/PPDU Type", "wlan.htc.he.a_control.hla.msi_ppdu_type",
31336       FT_UINT32, BASE_DEC, NULL, 0x00700000, NULL, HFILL }},
31337
31338     {&hf_ieee80211_he_hla_tx_bf,
31339      {"Tx BF", "wlan.htc.he.a_control.hla.tx_bf",
31340       FT_BOOLEAN, 32, NULL, 0x00800000, NULL, HFILL }},
31341
31342     {&hf_ieee80211_he_hla_reserved,
31343      {"Reserved", "wlan.htc.he.a_control.hla.reserved",
31344       FT_UINT32, BASE_HEX, NULL, 0x03000000, NULL, HFILL }},
31345
31346     {&hf_ieee80211_he_bsr_aci_bitmap,
31347      {"ACI Bitmap", "wlan.htc.he.a_control.bsr.aci_bitmap",
31348       FT_UINT32, BASE_HEX, NULL, 0x00000f, NULL, HFILL }},
31349
31350     {&hf_ieee80211_he_bsr_delta_tid,
31351      {"Delta TID", "wlan.htc.he.a_control.bsr.delta_tid",
31352       FT_UINT32, BASE_HEX, NULL, 0x000030, NULL, HFILL }},
31353
31354     {&hf_ieee80211_he_bsr_aci_high,
31355      {"ACI High", "wlan.htc.he.a_control.bsr.aci_high",
31356       FT_UINT32, BASE_HEX, NULL, 0x0000c0, NULL, HFILL }},
31357
31358     {&hf_ieee80211_he_bsr_scaling_factor,
31359      {"Scaling Factor", "wlan.htc.he.a_control.bsr.scaling_factor",
31360       FT_UINT32, BASE_HEX, NULL, 0x000300, NULL, HFILL }},
31361
31362     {&hf_ieee80211_he_bsr_queue_size_high,
31363      {"Queue Size High", "wlan.htc.he.a_control.bsr.queue_size_high",
31364       FT_UINT32, BASE_HEX, NULL, 0x03fc00, NULL, HFILL }},
31365
31366     {&hf_ieee80211_he_bsr_queue_size_all,
31367      {"Queue Size All", "wlan.htc.he.a_control.bsr.queue_size_all",
31368       FT_UINT32, BASE_HEX, NULL, 0x03fc0000, NULL, HFILL }},
31369
31370     {&hf_ieee80211_he_uph_ul_power_headroom,
31371      {"UL Power Headroom", "wlan.htc.he.a_control.uph.ul_power_headroom",
31372       FT_UINT32, BASE_DEC, NULL, 0x00000001f, NULL, HFILL }},
31373
31374     {&hf_ieee80211_he_uph_ul_min_transmit_power_flag,
31375      {"Minimum Transmit Power Flag", "wlan.htc.he.a_control.uph.min_transmit_power_flag",
31376       FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL }},
31377
31378     {&hf_ieee80211_he_uph_reserved,
31379      {"Reserved", "wlan.htc.he.a_control.uph.reserved",
31380       FT_UINT32, BASE_HEX, NULL, 0x000000c000, NULL, HFILL }},
31381
31382     {&hf_ieee80211_he_btc_avail_chan,
31383      {"Available Channel Bitmap", "wlan.htc.he.a_control.bqr.avail_chan_bitmap",
31384       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31385
31386     {&hf_ieee80211_he_btc_reserved,
31387      {"Reserved", "wlan.htc.he.a_control.bqr.reserved",
31388       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31389
31390     {&hf_ieee80211_he_cci_ac_constraint,
31391      {"AC Constraint", "wlan.htc.he.a_control.cci.ac_constraint",
31392       FT_BOOLEAN, 32, NULL, 0x01, NULL, HFILL }},
31393
31394     {&hf_ieee80211_he_cci_rdg_more_ppdu,
31395      {"RDG/More PPDU", "wlan.htc.he.a_control.cci.rdg_more_ppdu",
31396       FT_BOOLEAN,32, NULL, 0x02, NULL, HFILL }},
31397
31398     {&hf_ieee80211_he_cci_sr_ppdu_indic,
31399      {"SR PPDU Indication", "wlan.htc.he.a_control.cci.sr_ppdu_indic",
31400       FT_BOOLEAN, 32, NULL, 0x04, NULL, HFILL }},
31401
31402     {&hf_ieee80211_he_cci_reserved,
31403      {"Reserved", "wlan.htc.htc.a_control.cci.reserved",
31404       FT_UINT32, BASE_HEX, NULL, 0xF8, NULL, HFILL }},
31405
31406     {&hf_ieee80211_he_trigger_common_info,
31407      {"HE Trigger Common Info", "wlan.trigger.he.common_info",
31408       FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
31409
31410     {&hf_ieee80211_he_trigger_type,
31411      {"Trigger Type", "wlan.trigger.he.trigger_type",
31412       FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(trigger_type_vals),
31413         0x000000000000000F, NULL, HFILL }},
31414
31415     {&hf_ieee80211_he_trigger_length,
31416      {"L-SIG Length", "wlan.trigger.he.l_sig_length",
31417       FT_UINT64, BASE_DEC, NULL, 0x000000000000FFF0, NULL, HFILL }},
31418
31419     {&hf_ieee80211_he_trigger_cascade_indication,
31420      {"Cascade Indication", "wlan.trigger.he.cascade_indication",
31421       FT_BOOLEAN, 64, NULL, 0x0000000000010000, NULL, HFILL }},
31422
31423     {&hf_ieee80211_he_trigger_cs_required,
31424      {"CS Required", "wlan.trigger.he.cs_required",
31425       FT_BOOLEAN, 64, NULL, 0x0000000000020000, NULL, HFILL }},
31426
31427     {&hf_ieee80211_he_trigger_bw,
31428      {"BW", "wlan.trigger.he.bw",
31429       FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(bw_subfield_vals), 0x00000000000C0000, NULL, HFILL }},
31430
31431     {&hf_ieee80211_he_trigger_gi_and_ltf_type,
31432      {"GI And LTF Type", "wlan.trigger.he.gi_and_ltf_type",
31433       FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(gi_and_ltf_type_subfield_vals), 0x0000000000300000,
31434         NULL, HFILL }},
31435
31436     {&hf_ieee80211_he_trigger_mu_mimo_ltf_mode,
31437      {"MU-MIMO LTF Mode", "wlan.trigger.he.mu_mimo_ltf_mode",
31438       FT_BOOLEAN, 64, TFS(&mu_mimo_ltf_mode_tfs), 0x0000000000400000, NULL, HFILL }},
31439
31440     {&hf_ieee80211_he_trigger_num_he_ltf_syms_etc,
31441      {"Number of HE-LTF Symbols and Midamble Periodicity",
31442         "wlan.trigger.he.num_he_ltf_syms_and_midamble_per",
31443       FT_UINT64, BASE_HEX, NULL, 0x0000000003800000, NULL, HFILL }},
31444
31445     {&hf_ieee80211_he_trigger_stbc,
31446      {"STBC", "wlan.trigger.he.stbc",
31447       FT_BOOLEAN, 64, NULL, 0x0000000004000000, NULL, HFILL }},
31448
31449     {&hf_ieee80211_he_trigger_ldpc_extra_sym_seg,
31450      {"LDPC Extra Symbol Segment", "wlan.trigger.he.ldpc_extra_symbol_segment",
31451       FT_BOOLEAN, 64, NULL, 0x0000000008000000, NULL, HFILL }},
31452
31453     {&hf_ieee80211_he_trigger_ap_tx_power,
31454      {"AP TX Power", "wlan.trigger.he.ap_tx_power",
31455       FT_UINT64, BASE_DEC, NULL, 0x00000003F0000000, NULL, HFILL }},
31456
31457     {&hf_ieee80211_he_trigger_packet_extension,
31458      {"Packet Extension", "wlan.trigger.he.packet_extension",
31459       FT_UINT64, BASE_HEX, NULL, 0x0000001C00000000, NULL, HFILL }},
31460
31461     {&hf_ieee80211_he_trigger_spatial_reuse,
31462      {"Spatial Reuse", "wlan.trigger.he.spatial_reuse",
31463       FT_UINT64, BASE_HEX, NULL, 0x001FFFE000000000, NULL, HFILL }},
31464
31465     {&hf_ieee80211_he_trigger_doppler,
31466      {"Doppler", "wlan.trigger.he.doppler",
31467       FT_BOOLEAN, 64, NULL, 0x0020000000000000, NULL, HFILL }},
31468
31469     {&hf_ieee80211_he_trigger_he_sig_a_reserved,
31470      {"HE-SIG-A Reserved", "wlan.trigger.he.he_sig_a_reserved",
31471       FT_UINT64, BASE_HEX, NULL, 0x7FC0000000000000, NULL, HFILL }},
31472
31473     {&hf_ieee80211_he_trigger_reserved,
31474      {"Reserved", "wlan.trigger.he.reserved",
31475       FT_UINT64, BASE_HEX, NULL, 0x8000000000000000, NULL, HFILL }},
31476
31477     {&hf_ieee80211_he_trigger_bar_ctrl,
31478      {"BAR Control", "wlan.trigger.he.common_info.bar_ctrl",
31479       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31480
31481     {&hf_ieee80211_he_trigger_bar_ctrl_ba_ack_policy,
31482      {"BA Ack Policy", "wlan.trigger.he.common_info.bar_ctrl.ba_ack_policy",
31483       FT_BOOLEAN, 16, TFS(&ieee80211_block_ack_control_ack_policy_flag), 0x0001,
31484        NULL, HFILL }},
31485
31486     {&hf_ieee80211_he_trigger_bar_ctrl_ba_type,
31487      {"BA Type", "wlan.trigger.he.common_info.bar_ctrl.ba_type",
31488       FT_UINT16, BASE_HEX, VALS(block_ack_type_vals), 0x001e, NULL, HFILL }},
31489
31490     {&hf_ieee80211_he_trigger_bar_ctrl_reserved,
31491      {"Reserved", "wlan.trigger.he.common_info.bar_ctrl.reserved",
31492       FT_UINT16, BASE_HEX, NULL, 0x0FE0, NULL, HFILL }},
31493
31494     {&hf_ieee80211_he_trigger_bar_ctrl_tid_info,
31495      {"TID_INFO", "wlan.trigger.he.common_info.bar_ctrl.tid_info",
31496       FT_UINT16, BASE_HEX, NULL, 0xF000, NULL, HFILL }},
31497
31498     {&hf_ieee80211_he_trigger_bar_info,
31499      {"BAR Information", "wlan.trigger.he.common_info.bar_info",
31500       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31501
31502     {&hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl,
31503      {"Block Ack Starting Sequence Control",
31504       "wlan.trigger.he.common_info.bar_info.blk_ack_starting_seq_ctrl",
31505       FT_UINT16, BASE_HEX, NULL, 0xFFFF, NULL, HFILL }},
31506
31507     {&hf_ieee80211_he_trigger_user_info,
31508      {"User Info", "wlan.trigger.he.user_info",
31509       FT_UINT40, BASE_HEX, NULL, 0, NULL, HFILL }},
31510
31511     {&hf_ieee80211_he_trigger_mpdu_mu_spacing,
31512      {"MPDU MU Spacing Factor", "wlan.trigger.he.mpdu_mu_spacing_factor",
31513       FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL }},
31514
31515     {&hf_ieee80211_he_trigger_tid_aggregation_limit,
31516      {"TID Aggregation Limit", "wlan.trigger.he.tid_aggregation_limit",
31517       FT_UINT8, BASE_DEC, NULL, 0x1C, NULL, HFILL }},
31518
31519     {&hf_ieee80211_he_trigger_dependent_reserved1,
31520      {"Reserved", "wlan.trigger.he.reserved1",
31521       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
31522
31523     {&hf_ieee80211_he_trigger_preferred_ac,
31524      {"Preferred AC", "wlan.trigger.he.preferred_ac",
31525       FT_UINT8, BASE_HEX, VALS(preferred_ac_vals), 0xC0, NULL, HFILL }},
31526
31527     {&hf_ieee80211_he_trigger_dep_basic_user_info,
31528      {"Basic Trigger Dependent User Info", "wlan.trigger.he.basic_user_info",
31529       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31530
31531     {&hf_ieee80211_he_trigger_starting_aid,
31532      {"Starting AID", "wlan.trigger.he.starting_aid",
31533       FT_UINT40, BASE_HEX, NULL, 0x0000000FFF, NULL, HFILL }},
31534
31535     {&hf_ieee80211_he_trigger_dependent_reserved2,
31536      {"Reserved", "wlan.trigger.he.reserved2",
31537       FT_UINT40, BASE_HEX, NULL, 0x00001FF000, NULL, HFILL }},
31538
31539     {&hf_ieee80211_he_trigger_feedback_type,
31540      {"Feedback Type", "wlan.trigger.he.feedback_type",
31541       FT_UINT40, BASE_HEX, NULL, 0x0001E00000, NULL, HFILL }},
31542
31543     {&hf_ieee80211_he_trigger_dependent_reserved3,
31544      {"Reserved", "wlan.trigger.he.reserved3",
31545       FT_UINT40, BASE_HEX, NULL, 0x00FE000000, NULL, HFILL }},
31546
31547     {&hf_ieee80211_he_trigger_nfrp_target_rssi,
31548      {"Target RSSI", "wlan.trigger.he.target_rssi",
31549       FT_UINT40, BASE_CUSTOM, CF_FUNC(target_rssi_base_custom), 0x7F00000000,
31550        NULL, HFILL }},
31551
31552     {&hf_ieee80211_he_trigger_multiplexing_flag,
31553      {"Multiplexing Flag", "wlan.trigger.he.multiplexing_flag",
31554       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
31555
31556     {&hf_ieee80211_he_trigger_dep_nfrp_user_info,
31557      {"NFRP Trigger Dependent User Unfo", "wlan.trigger.he.nfrp_user_info",
31558       FT_UINT40, BASE_HEX, NULL, 0, NULL, HFILL }},
31559
31560     {&hf_ieee80211_he_trigger_feedback_seg_retrans_bm,
31561      {"Feedback Segment Retransmission Bitmap", "wlan.trigger.he.feedback_bm",
31562       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31563
31564     {&hf_ieee80211_he_trigger_aid12,
31565      {"AID12", "wlan.trigger.he.user_info.aid12",
31566       FT_UINT40, BASE_HEX, NULL, 0x0000000FFF, NULL, HFILL }},
31567
31568     {&hf_ieee80211_he_trigger_ru_allocation,
31569      {"RU Allocation", "wlan.trigger.he.ru_allocation",
31570       FT_UINT40, BASE_HEX, NULL, 0x00000FF000, NULL, HFILL }},
31571
31572     {&hf_ieee80211_he_trigger_coding_type,
31573      {"Coding Type", "wlan.trigger.he.coding_type",
31574       FT_BOOLEAN, 40, TFS(&he_trigger_coding_type_tfs), 0x0000100000,
31575         NULL, HFILL }},
31576
31577     {&hf_ieee80211_he_trigger_mcs,
31578      {"MCS", "wlan.trigger.he.mcs",
31579       FT_UINT40, BASE_HEX, NULL, 0x0001E00000, NULL, HFILL }},
31580
31581     {&hf_ieee80211_he_trigger_dcm,
31582      {"DCM", "wlan.trigger.he.dcm",
31583       FT_BOOLEAN, 40, NULL, 0x0002000000, NULL, HFILL }},
31584
31585     {&hf_ieee80211_he_trigger_ss_allocation,
31586      {"SS Alloc/Random Access RU Info", "wlan.trigger.he.ss_alloc",
31587       FT_UINT40, BASE_HEX, NULL, 0x00FC000000, NULL, HFILL }},
31588
31589     {&hf_ieee80211_he_trigger_target_rssi,
31590      {"Target RSSI", "wlan.trigger.he.target_rssi",
31591       FT_UINT40, BASE_CUSTOM, CF_FUNC(target_rssi_base_custom), 0x7F00000000,
31592        NULL, HFILL }},
31593
31594     {&hf_ieee80211_he_trigger_user_reserved,
31595      {"Reserved", "wlan.trigger.he.user_reserved",
31596       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
31597
31598     {&hf_he_ndp_sounding_dialog_token_number,
31599      {"Sounding Dialog Token Number", "wlan.he_ndp.token.number",
31600       FT_UINT8, BASE_DEC, NULL, 0xFC,
31601       NULL, HFILL }},
31602
31603     {&hf_he_ndp_annc_he_subfield,
31604      {"HE", "wlan.vht_he.token.he",
31605       FT_BOOLEAN, 8, TFS(&he_ndp_annc_he_subfield_vals), 0x02, NULL, HFILL }},
31606
31607     {&hf_he_ndp_annc_reserved,
31608      {"Reserved", "wlan.he_ndp.token.reserved",
31609       FT_UINT8, BASE_HEX, NULL, 0x01,
31610       NULL, HFILL }},
31611
31612     {&hf_ieee80211_he_ndp_annc_token,
31613      {"Sounding Dialog Token", "wlan.he_ndp.token",
31614       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31615
31616     {&hf_ieee80211_he_ndp_annc_sta,
31617      {"STA Info", "wlan.he_ndp.sta_info",
31618       FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
31619
31620     {&hf_he_ndp_annc_aid11,
31621      {"AID11", "wlan.he_ndp.sta_info.aid11",
31622       FT_UINT32, BASE_HEX, NULL, 0x000007FF, NULL, HFILL }},
31623
31624     {&hf_he_ndp_annc_partial_bw_info,
31625      {"Partial BW Info", "wlan.he_ndp.sta_info.partial_bw_info",
31626       FT_UINT32, BASE_CUSTOM, CF_FUNC(partial_bw_info_base_custom), 0x01FFF800,
31627        NULL, HFILL }},
31628
31629     {&hf_he_ndp_annc_feedback_type_and_ng,
31630      {"Feedback Type and Ng", "wlan.he_ndp.sta_info.feedback_type_and_ng",
31631       FT_UINT32, BASE_HEX, NULL, 0x06000000, NULL, HFILL }},
31632
31633     {&hf_he_ndp_annc_disambiguation,
31634      {"Disambiguation", "wlan.he_ndp.sta_info.disambiguation",
31635       FT_UINT32, BASE_HEX, NULL, 0x08000000, NULL, HFILL }},
31636
31637     {&hf_he_ndp_annc_codebook_size,
31638      {"Codebook Size", "wlan.he_ndp.sta_info.codebook_size",
31639       FT_UINT32, BASE_HEX, NULL, 0x10000000, NULL, HFILL }},
31640
31641     {&hf_he_ndp_annc_nc,
31642      {"Nc", "wlan.he_ndp.sta_info.nc",
31643       FT_UINT32, BASE_HEX, NULL, 0xE0000000, NULL, HFILL }},
31644
31645     {&hf_ieee80211_htc_ht_lac,
31646      {"Link Adaptation Control (LAC)", "wlan.htc.lac",
31647       FT_UINT32, BASE_HEX, NULL, 0x0000FFFE,
31648       "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
31649
31650     {&hf_ieee80211_htc_lac_trq,
31651      {"Training Request (TRQ)", "wlan.htc.lac.trq",
31652       FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002,
31653       "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
31654
31655     {&hf_ieee80211_htc_lac_mai_aseli,
31656      {"Antenna Selection Indication (ASELI)", "wlan.htc.lac.mai.aseli",
31657       FT_UINT16, BASE_HEX, NULL, 0x003C,
31658       "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
31659
31660     {&hf_ieee80211_htc_lac_mai_mrq,
31661      {"MCS Request (MRQ)", "wlan.htc.lac.mai.mrq",
31662       FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004,
31663       "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
31664
31665     {&hf_ieee80211_htc_lac_mai_msi,
31666      {"MCS Request Sequence Identifier (MSI)", "wlan.htc.lac.mai.msi",
31667       FT_UINT16, BASE_HEX, NULL, 0x0038,
31668       "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
31669
31670     {&hf_ieee80211_htc_lac_mai_reserved,
31671      {"Reserved", "wlan.htc.lac.mai.reserved",
31672       FT_UINT16, BASE_HEX, NULL, 0x0038,
31673       "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
31674
31675     {&hf_ieee80211_htc_lac_mfsi,
31676      {"MCS Feedback Sequence Identifier (MFSI)", "wlan.htc.lac.mfsi",
31677       FT_UINT16, BASE_DEC, NULL, 0x01C0,
31678       "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
31679
31680     {&hf_ieee80211_htc_lac_asel_command,
31681      {"Antenna Selection (ASEL) Command", "wlan.htc.lac.asel.command",
31682       FT_UINT16, BASE_HEX, VALS(ieee80211_htc_lac_asel_command_flags), 0x0E00,
31683       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
31684
31685     {&hf_ieee80211_htc_lac_asel_data,
31686      {"Antenna Selection (ASEL) Data", "wlan.htc.lac.asel.data",
31687       FT_UINT16, BASE_HEX, NULL, 0xF000,
31688       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
31689
31690     {&hf_ieee80211_htc_lac_mfb,
31691      {"MCS Feedback (MFB)", "wlan.htc.lac.mfb",
31692       FT_UINT16, BASE_HEX, NULL, 0xFE00,
31693       "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
31694
31695     {&hf_ieee80211_htc_cal_pos,
31696      {"Calibration Position", "wlan.htc.cal.pos",
31697       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_cal_pos_flags), 0x00030000,
31698       "High Throughput Control Calibration Position", HFILL }},
31699
31700     {&hf_ieee80211_htc_cal_seq,
31701      {"Calibration Sequence Identifier", "wlan.htc.cal.seq",
31702       FT_UINT32, BASE_DEC, NULL, 0x000C0000,
31703       "High Throughput Control Calibration Sequence Identifier", HFILL }},
31704
31705     {&hf_ieee80211_htc_reserved1,
31706      {"Reserved", "wlan.htc.reserved1",
31707       FT_UINT32, BASE_HEX, NULL, 0x00300000,
31708       "High Throughput Control Reserved", HFILL }},
31709
31710     {&hf_ieee80211_htc_csi_steering,
31711      {"CSI/Steering", "wlan.htc.csi_steering",
31712       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_csi_steering_flags), 0x00C00000,
31713       "High Throughput Control CSI/Steering", HFILL }},
31714
31715     {&hf_ieee80211_htc_ndp_announcement,
31716      {"NDP Announcement", "wlan.htc.ndp_announcement",
31717       FT_BOOLEAN, 32, TFS(&ieee80211_htc_ndp_announcement_flag), 0x01000000,
31718       "High Throughput Control NDP Announcement", HFILL }},
31719
31720     {&hf_ieee80211_htc_reserved2,
31721      {"Reserved", "wlan.htc.reserved2",
31722       FT_UINT32, BASE_HEX, NULL, 0x3E000000,
31723       "High Throughput Control Reserved", HFILL }},
31724
31725     {&hf_ieee80211_htc_mrq,
31726      {"MRQ", "wlan.htc.mrq",
31727       FT_BOOLEAN, 32, NULL, HTC_MRQ,
31728       "VHT-MCS feedback request", HFILL }},
31729
31730     {&hf_ieee80211_htc_msi,
31731      {"MSI", "wlan.htc.msi",
31732       FT_UINT32, BASE_DEC, NULL, 0x00000038,
31733       "MRQ sequence number", HFILL }},
31734
31735     {&hf_ieee80211_htc_msi_stbc_reserved,
31736      {"Reserved", "wlan.htc.msi_stbc_reserved",
31737       FT_UINT32, BASE_HEX, NULL, 0x00000038,
31738       NULL, HFILL }},
31739
31740     {&hf_ieee80211_htc_compressed_msi,
31741      {"Compressed MSI", "wlan.htc.compressed_msi",
31742       FT_UINT32, BASE_DEC, NULL, 0x00000018,
31743       NULL, HFILL }},
31744
31745     {&hf_ieee80211_htc_ppdu_stbc_encoded,
31746      {"PPDU was STBC encoded", "wlan.htc.ppdu_stbc_encoded",
31747       FT_BOOLEAN, 32, NULL, 0x00000020,
31748       NULL, HFILL }},
31749
31750     {&hf_ieee80211_htc_mfsi,
31751      {"MFSI", "wlan.htc.mfsi",
31752       FT_BOOLEAN, 32, NULL, 0x000001C0,
31753       "MFB sequence identifier", HFILL }},
31754
31755     {&hf_ieee80211_htc_gid_l,
31756      {"GID-L", "wlan.htc.gid_l",
31757       FT_BOOLEAN, 32, NULL, 0x000001C0,
31758       "LSBs of group ID", HFILL }},
31759
31760     {&hf_ieee80211_htc_mfb,
31761      {"MFB", "wlan.htc.mfb",
31762       FT_UINT32, BASE_HEX, NULL, 0x00FFFE00,
31763       "Recommended MFB", HFILL }},
31764
31765     {&hf_ieee80211_htc_num_sts,
31766      {"NUM_STS", "wlan.htc.num_sts",
31767       FT_UINT32, BASE_DEC, NULL, 0x00000E00,
31768       "Recommended NUM_STS", HFILL }},
31769
31770     {&hf_ieee80211_htc_vht_mcs,
31771      {"VHT-MCS", "wlan.htc.vht_mcs",
31772       FT_UINT32, BASE_DEC, NULL, 0x0000F000,
31773       "Recommended VHT-MCS", HFILL }},
31774
31775     {&hf_ieee80211_htc_bw,
31776      {"BW", "wlan.htc.bw",
31777       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_bw_recommended_vht_mcs_vals), 0x00030000,
31778       "Bandwidth for recommended VHT-MCS", HFILL }},
31779
31780     {&hf_ieee80211_htc_snr,
31781      {"SNR", "wlan.htc.snr",
31782       FT_INT32, BASE_DEC, NULL, 0x00FC0000,
31783       "Average SNR + 22", HFILL }},
31784
31785     {&hf_ieee80211_htc_reserved3,
31786      {"Reserved", "wlan.htc.reserved3",
31787       FT_UINT32, BASE_HEX, NULL, 0x1F000000,
31788       NULL, HFILL }},
31789
31790     {&hf_ieee80211_htc_gid_h,
31791      {"GID-H", "wlan.htc.gid_h",
31792       FT_UINT32, BASE_DEC, NULL, 0x07000000,
31793       NULL, HFILL }},
31794
31795     {&hf_ieee80211_htc_coding_type,
31796      {"Coding type", "wlan.htc.coding_type",
31797       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_coding_type_vals), 0x08000000,
31798       NULL, HFILL }},
31799
31800     {&hf_ieee80211_htc_fb_tx_type,
31801      {"FB Tx type", "wlan.htc.fb_tx_type",
31802       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_fb_tx_type_vals), 0x10000000,
31803       NULL, HFILL }},
31804
31805     {&hf_ieee80211_htc_unsolicited_mfb,
31806      {"Unsolicited MFB", "wlan.htc.unsolicited_mfb",
31807       FT_BOOLEAN, 32, NULL, HTC_UNSOLICITED_MFB,
31808       "High Throughput Control Unsolicited MFB", HFILL }},
31809
31810     {&hf_ieee80211_htc_ac_constraint,
31811      {"AC Constraint", "wlan.htc.ac_constraint",
31812       FT_BOOLEAN, 32, NULL, 0x40000000,
31813       "High Throughput Control AC Constraint", HFILL }},
31814
31815     {&hf_ieee80211_htc_rdg_more_ppdu,
31816      {"RDG/More PPDU", "wlan.htc.rdg_more_ppdu",
31817       FT_BOOLEAN, 32, NULL, 0x80000000,
31818       "High Throughput Control RDG/More PPDU", HFILL }},
31819     /* End: HT Control (+HTC) */
31820
31821     /* MDIE */
31822     {&hf_ieee80211_tag_mobility_domain_mdid,
31823      {"Mobility Domain Identifier", "wlan.mobility_domain.mdid",
31824       FT_UINT16, BASE_HEX, NULL, 0,
31825       NULL, HFILL }},
31826
31827     {&hf_ieee80211_tag_mobility_domain_ft_capab,
31828      {"FT Capability and Policy", "wlan.mobility_domain.ft_capab",
31829       FT_UINT8, BASE_HEX, NULL, 0,
31830       NULL, HFILL }},
31831
31832     {&hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
31833      {"Fast BSS Transition over DS",
31834       "wlan.mobility_domain.ft_capab.ft_over_ds",
31835       FT_UINT8, BASE_HEX, NULL, 0x01,
31836       NULL, HFILL }},
31837
31838     {&hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
31839      {"Resource Request Protocol Capability",
31840       "wlan.mobility_domain.ft_capab.resource_req",
31841       FT_UINT8, BASE_HEX, NULL, 0x02,
31842       NULL, HFILL }},
31843
31844     /* FTIE */
31845     {&hf_ieee80211_tag_ft_mic_control,
31846      {"MIC Control", "wlan.ft.mic_control",
31847       FT_UINT16, BASE_HEX, NULL, 0,
31848       NULL, HFILL }},
31849
31850     {&hf_ieee80211_tag_ft_element_count,
31851      {"Element Count", "wlan.ft.element_count",
31852       FT_UINT16, BASE_DEC, NULL, 0xff00,
31853       NULL, HFILL }},
31854
31855     {&hf_ieee80211_tag_ft_mic,
31856      {"MIC", "wlan.ft.mic",
31857       FT_BYTES, BASE_NONE, NULL, 0,
31858       NULL, HFILL }},
31859
31860     {&hf_ieee80211_tag_ft_anonce,
31861      {"ANonce", "wlan.ft.anonce",
31862       FT_BYTES, BASE_NONE, NULL, 0,
31863       NULL, HFILL }},
31864
31865     {&hf_ieee80211_tag_ft_snonce,
31866      {"SNonce", "wlan.ft.snonce",
31867       FT_BYTES, BASE_NONE, NULL, 0,
31868       NULL, HFILL }},
31869
31870     {&hf_ieee80211_tag_ft_subelem_id,
31871      {"Subelement ID", "wlan.ft.subelem.id",
31872       FT_UINT8, BASE_DEC, VALS(ft_subelem_id_vals), 0,
31873       NULL, HFILL }},
31874
31875     {&hf_ieee80211_tag_ft_subelem_len,
31876      {"Length", "wlan.ft.subelem.len",
31877       FT_UINT8, BASE_DEC, NULL, 0,
31878       NULL, HFILL }},
31879
31880     {&hf_ieee80211_tag_ft_subelem_data,
31881      {"Data", "wlan.ft.subelem.data",
31882       FT_BYTES, BASE_NONE, NULL, 0,
31883       NULL, HFILL }},
31884
31885     {&hf_ieee80211_tag_ft_subelem_r1kh_id,
31886      {"PMK-R1 key holder identifier (R1KH-ID)", "wlan.ft.subelem.r1kh_id",
31887       FT_BYTES, BASE_NONE, NULL, 0,
31888       NULL, HFILL }},
31889
31890     {&hf_ieee80211_tag_ft_subelem_gtk_key_info,
31891      {"Key Info", "wlan.ft.subelem.gtk.key_info",
31892       FT_UINT16, BASE_HEX, NULL, 0,
31893       NULL, HFILL }},
31894
31895     {&hf_ieee80211_tag_ft_subelem_gtk_key_id,
31896      {"Key ID", "wlan.ft.subelem.gtk.key_id",
31897       FT_UINT16, BASE_DEC, NULL, 0x0003,
31898       NULL, HFILL }},
31899
31900     {&hf_ieee80211_tag_ft_subelem_gtk_key_length,
31901      {"Key Length", "wlan.ft.subelem.gtk.key_length",
31902       FT_UINT8, BASE_HEX, NULL, 0,
31903       NULL, HFILL }},
31904
31905     {&hf_ieee80211_tag_ft_subelem_gtk_rsc,
31906      {"RSC", "wlan.ft.subelem.gtk.rsc",
31907       FT_BYTES, BASE_NONE, NULL, 0,
31908       NULL, HFILL }},
31909
31910     {&hf_ieee80211_tag_ft_subelem_gtk_key,
31911      {"GTK", "wlan.ft.subelem.gtk.key",
31912       FT_BYTES, BASE_NONE, NULL, 0,
31913       NULL, HFILL }},
31914
31915     {&hf_ieee80211_tag_ft_subelem_r0kh_id,
31916      {"PMK-R0 key holder identifier (R0KH-ID)", "wlan.ft.subelem.r0kh_id",
31917       FT_BYTES, BASE_NONE, NULL, 0,
31918       NULL, HFILL }},
31919
31920     {&hf_ieee80211_tag_ft_subelem_igtk_key_id,
31921      {"Key ID", "wlan.ft.subelem.igtk.key_id",
31922       FT_UINT16, BASE_DEC, NULL, 0,
31923       NULL, HFILL }},
31924
31925     {&hf_ieee80211_tag_ft_subelem_igtk_ipn,
31926      {"IPN", "wlan.ft.subelem.igtk.ipn",
31927       FT_BYTES, BASE_NONE, NULL, 0,
31928       NULL, HFILL }},
31929
31930     {&hf_ieee80211_tag_ft_subelem_igtk_key_length,
31931      {"Key Length", "wlan.ft.subelem.igtk.key_length",
31932       FT_UINT8, BASE_HEX, NULL, 0,
31933       NULL, HFILL }},
31934
31935     {&hf_ieee80211_tag_ft_subelem_igtk_key,
31936      {"Wrapped Key (IGTK)", "wlan.ft.subelem.igtk.key",
31937       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
31938
31939     /* RIC Data IE: 802.11-2012: 8.4.2.52 */
31940     {&hf_ieee80211_tag_ric_data_id,
31941      {"Resource Handshake Identifier", "wlan.ric_data.id",
31942       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31943
31944     {&hf_ieee80211_tag_ric_data_desc_cnt,
31945      {"Resource Descriptor Count", "wlan.ric_data.desc_cnt",
31946       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31947
31948     {&hf_ieee80211_tag_ric_data_status_code,
31949      {"Status Code", "wlan.ric_data.status_code",
31950       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
31951       "Status of requested Resource", HFILL }},
31952
31953     /* OBSS IE: 802.11-2012: 8.4.2.61 */
31954     {&hf_ieee80211_tag_obss_spd,
31955      {"Scan Passive Dwell", "wlan.obss.spd",
31956       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
31957
31958     {&hf_ieee80211_tag_obss_sad,
31959      {"Scan Active Dwell", "wlan.obss.sad",
31960       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
31961
31962     {&hf_ieee80211_tag_obss_cwtsi,
31963      {"Channel Width Trigger Scan Interval", "wlan.obss.cwtsi",
31964       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
31965
31966     {&hf_ieee80211_tag_obss_sptpc,
31967      {"Scan Passive Total Per Channel", "wlan.obss.sptpc",
31968       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
31969
31970     {&hf_ieee80211_tag_obss_satpc,
31971      {"Scan Active Total Per Channel", "wlan.obss.satpc",
31972       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
31973
31974     {&hf_ieee80211_tag_obss_wctdf,
31975      {"Width Channel Transition Delay Factor", "wlan.obss.wctdf",
31976       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
31977
31978     {&hf_ieee80211_tag_obss_sat,
31979      {"Scan Activity Threshold", "wlan.obss.sat",
31980       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
31981
31982     /* Group Data Cypher Suite: 802.11-2012: 8.4.2.25.1 */
31983     {&hf_group_data_cipher_suite_oui,
31984      {"Group Data Cypher Suite OUI", "wlan.osen.gdcs.oui",
31985       FT_UINT24, BASE_OUI, NULL, 0, NULL, HFILL }},
31986
31987     /* TODO: List the suite names ... */
31988     {&hf_group_data_cipher_suite_type,
31989      {"Group Data Cypher Suite type", "wlan.osen.gdcs.type",
31990       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
31991
31992     {&hf_osen_pcs_count,
31993      {"OSEN Pairwise Cipher Suite Count", "wlan.osen.pwcs.count",
31994       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
31995
31996     {&hf_osen_pairwise_cipher_suite_oui,
31997      {"OSEN Pairwise Cypher Suite OUI", "wlan.osen.pwcs.oui",
31998       FT_UINT24, BASE_OUI, NULL, 0, NULL, HFILL }},
31999
32000     {&hf_osen_pairwise_cipher_suite_type,
32001      {"OSEN Pairwise Cypher Suite type", "wlan.osen.pwcs.type",
32002       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32003
32004     {&hf_osen_akm_count,
32005      {"OSEN AKM Cipher Suite Count", "wlan.osen.akms.count",
32006       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32007
32008     {&hf_osen_akm_cipher_suite_oui,
32009      {"OSEN AKM Cipher Suite OUI", "wlan.osen.akms.oui",
32010       FT_UINT24, BASE_OUI, NULL, 0, NULL, HFILL }},
32011
32012     {&hf_osen_akm_cipher_suite_type,
32013      {"OSEN AKM Cipher Suite Type", "wlan.osen.akms.type",
32014       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32015
32016     {&hf_osen_rsn_cap_preauth,
32017      {"RSN Pre-Auth capabilities", "wlan.osen.rsn.capabilities.preauth",
32018       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001, NULL, HFILL }},
32019
32020     {&hf_osen_rsn_cap_no_pairwise,
32021      {"RSN No Pairwise capabilities", "wlan.osen.rsn.capabilities.no_pairwise",
32022       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002, NULL, HFILL }},
32023
32024     {&hf_osen_rsn_cap_ptksa_replay_counter,
32025      {"RSN PTKSA Replay Counter capabilities",
32026                 "wlan.osen.rsn.capabilities.ptksa_replay_counter",
32027       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C, NULL, HFILL }},
32028
32029     {&hf_osen_rsn_cap_gtksa_replay_counter,
32030      {"RSN GTKSA Replay Counter capabilities",
32031                 "wlan.osen.rsn.capabilities.gtksa_replay_counter",
32032       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030, NULL, HFILL }},
32033
32034     {&hf_osen_group_management_cipher_suite_oui,
32035      {"OSEN Group Management Cipher Suite OUI", "wlan.osen.gmcs.oui",
32036       FT_UINT24, BASE_OUI, NULL, 0, NULL, HFILL }},
32037
32038     {&hf_osen_group_management_cipher_suite_type,
32039      {"OSEN Group Management Cipher Suite Type", "wlan.osen.gmcs.type",
32040       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32041
32042     {&hf_osen_rsn_cap_mfpr,
32043      {"Management Frame Protection Required", "wlan.osen.rsn.capabilities.mfpr",
32044       FT_BOOLEAN, 16, TFS(&tfs_required_not_required), 0x0040, NULL, HFILL }},
32045
32046     {&hf_osen_rsn_cap_mfpc,
32047      {"Management Frame Protection Capable", "wlan.osen.rsn.capabilities.mfpc",
32048       FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x0080, NULL, HFILL }},
32049
32050     {&hf_osen_rsn_cap_jmr,
32051      {"Joint Multi-band RSNA", "wlan.osen.rsn.capabilities.jmr",
32052       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
32053
32054     {&hf_osen_rsn_cap_peerkey,
32055      {"PeerKey Enabled", "wlan.osen.rsn.capabilities.peerkey",
32056       FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), 0x200, NULL, HFILL }},
32057
32058     {&hf_osen_rsn_cap_flags,
32059      {"RSN Capability Flags", "wlan.osen.rsn.cabailities.flags",
32060       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
32061
32062     {&hf_osen_rsn_spp_a_msdu_capable,
32063      {"SPP A-MSDU Capable", "wlan.osen.rsn.capabilities.spp_a_msdu_cap",
32064       FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x0400, NULL, HFILL }},
32065
32066     {&hf_osen_rsn_spp_a_msdu_required,
32067      {"SPP A-MSDU Required", "wlan.osen.rsn.capabilities.spp_a_msdu_req",
32068       FT_BOOLEAN, 16, TFS(&tfs_required_not_required), 0x0800, NULL, HFILL }},
32069
32070     {&hf_osen_rsn_pbac,
32071      {"Protected Block Ack Agreement Capable", "wlan.osen.rsn.capabilities.pbac",
32072       FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x1000, NULL, HFILL }},
32073
32074     {&hf_osen_extended_key_id_iaf,
32075      {"Extended Key ID for Individually Addressed Frames",
32076                 "wlan.osn.rsn.extended_key_id_iaf",
32077       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
32078
32079     {&hf_osen_reserved,
32080      {"Reserved", "wlan.osen.rsn.capabilities.reserved",
32081       FT_UINT16, BASE_HEX, NULL, 0xC000, NULL, HFILL }},
32082
32083     {&hf_osen_pmkid_count,
32084      {"OSEN PMKID Count", "wlan.osen.pmkid.count",
32085       FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
32086
32087     {&hf_osen_pmkid,
32088      {"OSEN PKMID", "wlan.osen.pmkid.bytes",
32089       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32090
32091     /* RIC Descriptor IE: 802.11-2012: 8.4.2.53 */
32092     {&hf_ieee80211_tag_ric_desc_rsrc_type,
32093      {"Resource Type", "wlan.ric_desc.rsrc_type",
32094       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32095
32096     {&hf_ieee80211_tag_ric_desc_var_params,
32097      {"Variable Params", "wlan.ric_desc.var_params",
32098       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32099
32100     /* MMIE */
32101     {&hf_ieee80211_tag_mmie_keyid,
32102      {"KeyID", "wlan.mmie.keyid",
32103       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32104
32105     {&hf_ieee80211_tag_mmie_ipn,
32106      {"IPN", "wlan.mmie.ipn",
32107       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32108
32109     {&hf_ieee80211_tag_mmie_mic,
32110      {"MIC", "wlan.mmie.mic",
32111       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32112
32113     /* WAPI Parameter Set*/
32114     {&hf_ieee80211_tag_wapi_param_set_version,
32115      {"Version", "wlan.wapi.version",
32116       FT_UINT16, BASE_DEC, NULL, 0,
32117       NULL, HFILL }},
32118
32119     {&hf_ieee80211_tag_wapi_param_set_akm_suite_count,
32120      {"AKM Suite Count", "wlan.wapi.akm_suite.count",
32121       FT_UINT16, BASE_DEC, NULL, 0,
32122       NULL, HFILL }},
32123
32124     {&hf_ieee80211_tag_wapi_param_set_akm_suite_oui,
32125      {"AKM Suite OUI", "wlan.wapi.akm_suite.oui",
32126       FT_UINT24, BASE_OUI, NULL, 0,
32127       NULL, HFILL }},
32128
32129     {&hf_ieee80211_tag_wapi_param_set_akm_suite_type,
32130      {"AKM Suite Type", "wlan.wapi.akm_suite.type",
32131       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_suite_type) , 0,
32132       NULL, HFILL }},
32133
32134     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
32135      {"Unicast Cipher Suite Count", "wlan.wapi.unicast_cipher.suite.count",
32136       FT_UINT16, BASE_DEC, NULL, 0,
32137       NULL, HFILL }},
32138
32139     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui,
32140      {"Unicast Cipher Suite OUI", "wlan.wapi.unicast_cipher.suite.oui",
32141       FT_UINT24, BASE_OUI, NULL, 0,
32142       NULL, HFILL }},
32143
32144     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type,
32145      {"Unicast Cipher Suite Type", "wlan.wapi.unicast_cipher.suite.type",
32146       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
32147       NULL, HFILL }},
32148
32149     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui,
32150      {"Multicast Cipher Suite OUI", "wlan.wapi.multicast_cipher.suite.oui",
32151       FT_UINT24, BASE_OUI, NULL, 0,
32152       NULL, HFILL }},
32153
32154     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type,
32155      {"Multicast Cipher Suite Type", "wlan.wapi.multicast_cipher.suite.type",
32156       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
32157       NULL, HFILL }},
32158
32159     {&hf_ieee80211_tag_wapi_param_set_capab,
32160      {"WAPI Capability Info", "wlan.wapi.capab",
32161       FT_UINT16, BASE_HEX, NULL, 0,
32162       NULL, HFILL }},
32163
32164     {&hf_ieee80211_tag_wapi_param_set_capab_preauth,
32165      {"Supports Preauthentication?", "wlan.wapi.capab.preauth",
32166       FT_BOOLEAN, 16 , NULL, 0x0001,
32167       NULL, HFILL }},
32168
32169     {&hf_ieee80211_tag_wapi_param_set_capab_rsvd,
32170      {"Reserved", "wlan.wapi.capab.rsvd",
32171       FT_UINT16, BASE_DEC , NULL, 0xFFFE,
32172       NULL, HFILL }},
32173
32174     {&hf_ieee80211_tag_wapi_param_set_bkid_count,
32175      {"No of BKID's", "wlan.wapi.bkid.count",
32176       FT_UINT16, BASE_DEC, NULL, 0,
32177       NULL, HFILL }},
32178
32179     {&hf_ieee80211_tag_wapi_param_set_bkid_list,
32180      {"BKID", "wlan.wapi.bkid",
32181       FT_BYTES, BASE_NONE, NULL, 0,
32182       NULL, HFILL }},
32183
32184     /* BSS Max Idle Period */
32185     {&hf_ieee80211_tag_bss_max_idle_period,
32186      {"BSS Max Idle Period (1000 TUs)", "wlan.bss_max_idle.period",
32187       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32188
32189     {&hf_ieee80211_tag_bss_max_idle_options_protected,
32190      {"BSS Max Idle Period Options: Protected Keep-Alive Required",
32191       "wlan.bss_max_idle.options.protected",
32192       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
32193
32194     /* TFS Request */
32195     {&hf_ieee80211_tag_tfs_request_id,
32196      {"TFS ID", "wlan.tfs_request.id",
32197       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32198
32199     {&hf_ieee80211_tag_tfs_request_ac_delete_after_match,
32200      {"TFS Action Code - Delete after match",
32201       "wlan.tfs_request.action_code.delete_after_match",
32202       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
32203
32204     {&hf_ieee80211_tag_tfs_request_ac_notify,
32205      {"TFS Action Code - Notify",
32206       "wlan.tfs_request.action_code.notify",
32207       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
32208
32209     {&hf_ieee80211_tag_tfs_request_subelem_id,
32210      {"Subelement ID", "wlan.tfs_request.subelem.id",
32211       FT_UINT8, BASE_DEC, VALS(tfs_request_subelem_ids), 0,
32212       "TFS Request Subelement ID", HFILL }},
32213
32214     {&hf_ieee80211_tag_tfs_request_subelem_len,
32215      {"Length", "wlan.tfs_request.subelem.len",
32216       FT_UINT8, BASE_DEC, NULL, 0,
32217       "TFS Request Subelement Length", HFILL }},
32218
32219     {&hf_ieee80211_tag_tfs_request_subelem,
32220      {"Subelement Data", "wlan.tfs_request.subelem",
32221       FT_BYTES, BASE_NONE, NULL, 0,
32222       "TFS Request Subelement Data", HFILL }},
32223
32224     /* TFS Response */
32225     {&hf_ieee80211_tag_tfs_response_subelem_id,
32226      {"Subelement ID", "wlan.tfs_response.subelem.id",
32227       FT_UINT8, BASE_DEC, VALS(tfs_response_subelem_ids), 0,
32228       "TFS Response Subelement ID", HFILL }},
32229
32230     {&hf_ieee80211_tag_tfs_response_subelem_len,
32231      {"Length", "wlan.tfs_response.subelem.len",
32232       FT_UINT8, BASE_DEC, NULL, 0,
32233       "TFS Response Subelement Length", HFILL }},
32234
32235     {&hf_ieee80211_tag_tfs_response_subelem,
32236      {"Subelement Data", "wlan.tfs_response.subelem",
32237       FT_BYTES, BASE_NONE, NULL, 0,
32238       "TFS Response Subelement Data", HFILL }},
32239
32240     {&hf_ieee80211_tag_tfs_response_status,
32241      {"TFS Response Status", "wlan.tfs_response.status",
32242       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32243
32244     {&hf_ieee80211_tag_tfs_response_id,
32245      {"TFS ID", "wlan.tfs_response.tfs_id",
32246       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32247
32248     /* WNM-Sleep Mode */
32249     {&hf_ieee80211_tag_wnm_sleep_mode_action_type,
32250      {"Action Type", "wlan.wnm_sleep_mode.action_type",
32251       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_action_types), 0,
32252       "WNM-Sleep Mode Action Type", HFILL }},
32253
32254     {&hf_ieee80211_tag_wnm_sleep_mode_response_status,
32255      {"WNM-Sleep Mode Response Status",
32256       "wlan.wnm_sleep_mode.response_status",
32257       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_response_status_vals), 0, NULL,
32258       HFILL }},
32259
32260     {&hf_ieee80211_tag_wnm_sleep_mode_interval,
32261      {"WNM-Sleep Interval", "wlan.wnm_sleep_mode.interval",
32262       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32263
32264     {&hf_ieee80211_wnm_sub_elt_id,
32265      {"Subelement ID", "wlan.wnm_subelt.id",
32266       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32267
32268     {&hf_ieee80211_wnm_sub_elt_len,
32269      {"Subelement len", "wlan.wnm_subelt.len",
32270       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32271
32272     /* Time Advertisement */
32273     {&hf_ieee80211_tag_time_adv_timing_capab,
32274      {"Timing capabilities", "wlan.time_adv.timing_capab",
32275       FT_UINT8, BASE_DEC, VALS(time_adv_timing_capab_vals), 0,
32276       NULL, HFILL }},
32277
32278     {&hf_ieee80211_tag_time_adv_time_value,
32279      {"Time Value", "wlan.time_adv.time_value",
32280       FT_BYTES, BASE_NONE, NULL, 0,
32281       NULL, HFILL }},
32282
32283     {&hf_ieee80211_tag_time_adv_time_value_year,
32284      {"Time Value: Year", "wlan.time_adv.time_value.year",
32285       FT_UINT16, BASE_DEC, NULL, 0,
32286       NULL, HFILL }},
32287
32288     {&hf_ieee80211_tag_time_adv_time_value_month,
32289      {"Time Value: Month", "wlan.time_adv.time_value.month",
32290       FT_UINT8, BASE_DEC, NULL, 0,
32291       NULL, HFILL }},
32292
32293     {&hf_ieee80211_tag_time_adv_time_value_day,
32294      {"Time Value: Day", "wlan.time_adv.time_value.month",
32295       FT_UINT8, BASE_DEC, NULL, 0,
32296       NULL, HFILL }},
32297
32298     {&hf_ieee80211_tag_time_adv_time_value_hours,
32299      {"Time Value: Hours", "wlan.time_adv.time_value.hours",
32300       FT_UINT8, BASE_DEC, NULL, 0,
32301       NULL, HFILL }},
32302
32303     {&hf_ieee80211_tag_time_adv_time_value_minutes,
32304      {"Time Value: Minutes", "wlan.time_adv.time_value.minutes",
32305       FT_UINT8, BASE_DEC, NULL, 0,
32306       NULL, HFILL }},
32307
32308     {&hf_ieee80211_tag_time_adv_time_value_seconds,
32309      {"Time Value: Seconds", "wlan.time_adv.time_value.seconds",
32310       FT_UINT8, BASE_DEC, NULL, 0,
32311       NULL, HFILL }},
32312
32313     {&hf_ieee80211_tag_time_adv_time_value_milliseconds,
32314      {"Time Value: Milliseconds", "wlan.time_adv.time_value.milliseconds",
32315       FT_UINT16, BASE_DEC, NULL, 0,
32316       NULL, HFILL }},
32317
32318     {&hf_ieee80211_tag_time_adv_time_value_reserved,
32319      {"Time Value: Reserved", "wlan.time_adv.time_value.reserved",
32320       FT_UINT8, BASE_DEC, NULL, 0,
32321       NULL, HFILL }},
32322
32323     {&hf_ieee80211_tag_time_adv_time_error,
32324      {"Time Error", "wlan.time_adv.time_error",
32325       FT_BYTES, BASE_NONE, NULL, 0,
32326       NULL, HFILL }},
32327
32328     {&hf_ieee80211_tag_time_adv_time_update_counter,
32329      {"Time Update Counter", "wlan.time_adv.time_update_counter",
32330       FT_UINT8, BASE_DEC, NULL, 0,
32331       NULL, HFILL }},
32332
32333     /* Time Zone */
32334     {&hf_ieee80211_tag_time_zone,
32335      {"Time Zone", "wlan.time_zone",
32336       FT_STRING, BASE_NONE, NULL, 0,
32337       NULL, HFILL }},
32338
32339     /* Interworking */
32340     {&hf_ieee80211_tag_interworking_access_network_type,
32341      {"Access Network Type", "wlan.interworking.access_network_type",
32342       FT_UINT8, BASE_DEC, VALS(access_network_type_vals), 0x0f,
32343       NULL, HFILL }},
32344
32345     {&hf_ieee80211_tag_interworking_internet,
32346      {"Internet", "wlan.interworking.internet",
32347       FT_UINT8, BASE_DEC, NULL, 0x10,
32348       NULL, HFILL }},
32349
32350     {&hf_ieee80211_tag_interworking_asra,
32351      {"ASRA", "wlan.interworking.asra",
32352       FT_UINT8, BASE_DEC, NULL, 0x20,
32353       "Additional Step Required for Access", HFILL }},
32354
32355     {&hf_ieee80211_tag_interworking_esr,
32356      {"ESR", "wlan.interworking.esr",
32357       FT_UINT8, BASE_DEC, NULL, 0x40,
32358       "Emergency services reachable", HFILL }},
32359
32360     {&hf_ieee80211_tag_interworking_uesa,
32361      {"UESA", "wlan.interworking.uesa",
32362       FT_UINT8, BASE_DEC, NULL, 0x80,
32363       "Unauthenticated emergency service accessible", HFILL }},
32364
32365     {&hf_ieee80211_tag_interworking_hessid,
32366      {"HESSID", "wlan.interworking.hessid",
32367       FT_ETHER, BASE_NONE, NULL, 0,
32368       "Homogeneous ESS identifier", HFILL }},
32369
32370     /* QoS Map Set element */
32371     {&hf_ieee80211_tag_qos_map_set_dscp_exc,
32372      {"DSCP Exception", "wlan.qos_map_set.dscp_exception",
32373       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
32374
32375     {&hf_ieee80211_tag_qos_map_set_dscp_exc_val,
32376      {"DSCP Value", "wlan.qos_map_set.dscp_value",
32377       FT_UINT8, BASE_DEC, NULL, 0,
32378       "DSCP Exception - DSCP Value", HFILL }},
32379
32380     {&hf_ieee80211_tag_qos_map_set_dscp_exc_up,
32381      {"User Priority", "wlan.qos_map_set.up",
32382       FT_UINT8, BASE_DEC, NULL, 0,
32383       "DSCP Exception - User Priority", HFILL }},
32384
32385     {&hf_ieee80211_tag_qos_map_set_range,
32386      {"DSCP Range description", "wlan.qos_map_set.range",
32387       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
32388
32389     {&hf_ieee80211_tag_qos_map_set_low,
32390      {"DSCP Low Value", "wlan.qos_map_set.dscp_low_value",
32391       FT_UINT8, BASE_DEC, NULL, 0,
32392       "DSCP Range description - DSCP Low Value", HFILL }},
32393
32394     {&hf_ieee80211_tag_qos_map_set_high,
32395      {"DSCP High Value", "wlan.qos_map_set.dscp_high_value",
32396       FT_UINT8, BASE_DEC, NULL, 0,
32397       "DSCP Range description - DSCP High Value", HFILL }},
32398
32399     /* Advertisement Protocol */
32400     {&hf_ieee80211_tag_adv_proto_resp_len_limit,
32401      {"Query Response Length Limit", "wlan.adv_proto.resp_len_limit",
32402       FT_UINT8, BASE_DEC, NULL, 0x7f,
32403       NULL, HFILL }},
32404
32405     {&hf_ieee80211_tag_adv_proto_pame_bi,
32406      {"PAME-BI", "wlan.adv_proto.pame_bi",
32407       FT_UINT8, BASE_DEC, NULL, 0x80,
32408       "Pre-Association Message Xchange BSSID Independent (PAME-BI)", HFILL }},
32409
32410     {&hf_ieee80211_tag_adv_proto_id,
32411      {"Advertisement Protocol ID", "wlan.adv_proto.id",
32412       FT_UINT8, BASE_DEC, VALS(adv_proto_id_vals), 0,
32413       NULL, HFILL }},
32414
32415     {&hf_ieee80211_tag_adv_vs_len,
32416      {"Advertisement Protocol Vendor Specific length", "wlan.adv_proto.vs_len",
32417       FT_UINT8, BASE_DEC, NULL, 0,
32418       NULL, HFILL}},
32419 #if 0
32420     {&hf_ieee80211_tag_adv_proto_vs_info,
32421      {"Advertisement Protocol Vendor Specific info", "wlan.adv_proto.vs_info",
32422       FT_NONE, BASE_NONE, NULL, 0,
32423       NULL, HFILL }},
32424 #endif
32425
32426     /* Roaming Consortium */
32427     {&hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
32428      {"Number of ANQP OIs", "wlan.roaming_consortium.num_anqp_oi",
32429       FT_UINT8, BASE_DEC, NULL, 0,
32430       NULL, HFILL }},
32431
32432     {&hf_ieee80211_tag_roaming_consortium_oi1_len,
32433      {"OI #1 Length", "wlan.roaming_consortium.oi1_len",
32434       FT_UINT8, BASE_DEC, NULL, 0x0f,
32435       NULL, HFILL }},
32436
32437     {&hf_ieee80211_tag_roaming_consortium_oi2_len,
32438      {"OI #2 Length", "wlan.roaming_consortium.oi2_len",
32439       FT_UINT8, BASE_DEC, NULL, 0xf0,
32440       NULL, HFILL }},
32441
32442     {&hf_ieee80211_tag_roaming_consortium_oi1,
32443      {"OI #1", "wlan.roaming_consortium.oi1",
32444       FT_BYTES, BASE_NONE, NULL, 0,
32445       NULL, HFILL }},
32446
32447     {&hf_ieee80211_tag_roaming_consortium_oi2,
32448      {"OI #2", "wlan.roaming_consortium.oi2",
32449       FT_BYTES, BASE_NONE, NULL, 0,
32450       NULL, HFILL }},
32451
32452     {&hf_ieee80211_tag_roaming_consortium_oi3,
32453      {"OI #3", "wlan.roaming_consortium.oi3",
32454       FT_BYTES, BASE_NONE, NULL, 0,
32455       NULL, HFILL }},
32456
32457     /* Timeout Interval */
32458     {&hf_ieee80211_tag_timeout_int_type,
32459      {"Timeout Interval Type", "wlan.timeout_int.type",
32460       FT_UINT8, BASE_DEC, VALS(timeout_int_types), 0,
32461       NULL, HFILL }},
32462
32463     {&hf_ieee80211_tag_timeout_int_value,
32464      {"Timeout Interval Value", "wlan.timeout_int.value",
32465       FT_UINT32, BASE_DEC, NULL, 0,
32466       NULL, HFILL }},
32467
32468     /* Link Identifier */
32469     {&hf_ieee80211_tag_link_id_bssid,
32470      {"BSSID", "wlan.link_id.bssid",
32471       FT_ETHER, BASE_NONE, NULL, 0,
32472       NULL, HFILL }},
32473
32474     {&hf_ieee80211_tag_link_id_init_sta,
32475      {"TDLS initiator STA Address", "wlan.link_id.init_sta",
32476       FT_ETHER, BASE_NONE, NULL, 0,
32477       NULL, HFILL }},
32478
32479     {&hf_ieee80211_tag_link_id_resp_sta,
32480      {"TDLS responder STA Address", "wlan.link_id.resp_sta",
32481       FT_ETHER, BASE_NONE, NULL, 0,
32482       NULL, HFILL }},
32483
32484     /* Wakeup Schedule */
32485     {&hf_ieee80211_tag_wakeup_schedule_offset,
32486      {"Offset", "wlan.wakeup_schedule.offset",
32487       FT_UINT32, BASE_DEC, NULL, 0,
32488       NULL, HFILL }},
32489
32490     {&hf_ieee80211_tag_wakeup_schedule_interval,
32491      {"Interval", "wlan.wakeup_schedule.interval",
32492       FT_UINT32, BASE_DEC, NULL, 0,
32493       NULL, HFILL }},
32494
32495     {&hf_ieee80211_tag_wakeup_schedule_awake_window_slots,
32496      {"Awake Window Slots", "wlan.wakeup_schedule.awake_window_slots",
32497       FT_UINT32, BASE_DEC, NULL, 0,
32498       NULL, HFILL }},
32499
32500     {&hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
32501      {"Maximum Awake Window Duration", "wlan.wakeup_schedule.max_awake_dur",
32502       FT_UINT32, BASE_DEC, NULL, 0,
32503       NULL, HFILL }},
32504
32505     {&hf_ieee80211_tag_wakeup_schedule_idle_count,
32506      {"Idle Count", "wlan.wakeup_schedule.idle_count",
32507       FT_UINT16, BASE_DEC, NULL, 0,
32508       NULL, HFILL }},
32509
32510     /* Channel Switch Timing */
32511     {&hf_ieee80211_tag_channel_switch_timing_switch_time,
32512      {"Switch Time", "wlan.channel_switch_timing.switch_time",
32513       FT_UINT16, BASE_DEC, NULL, 0,
32514       NULL, HFILL }},
32515
32516     {&hf_ieee80211_tag_channel_switch_timing_switch_timeout,
32517      {"Switch Timeout", "wlan.channel_switch_timing.switch_timeout",
32518       FT_UINT16, BASE_DEC, NULL, 0,
32519       NULL, HFILL }},
32520
32521     /* PTI Control */
32522     {&hf_ieee80211_tag_pti_control_tid,
32523      {"TID", "wlan.pti_control.tid",
32524       FT_UINT8, BASE_DEC, NULL, 0,
32525       NULL, HFILL }},
32526
32527     {&hf_ieee80211_tag_pti_control_sequence_control,
32528      {"Sequence Control", "wlan.pti_control.sequence_control",
32529       FT_UINT16, BASE_HEX, NULL, 0,
32530       NULL, HFILL }},
32531
32532     /* PU Buffer Status */
32533     {&hf_ieee80211_tag_pu_buffer_status_ac_bk,
32534      {"AC_BK traffic available", "wlan.pu_buffer_status.ac_bk",
32535       FT_UINT8, BASE_DEC, NULL, 0x01,
32536       NULL, HFILL }},
32537
32538     {&hf_ieee80211_tag_pu_buffer_status_ac_be,
32539      {"AC_BE traffic available", "wlan.pu_buffer_status.ac_be",
32540       FT_UINT8, BASE_DEC, NULL, 0x02,
32541       NULL, HFILL }},
32542
32543     {&hf_ieee80211_tag_pu_buffer_status_ac_vi,
32544      {"AC_VI traffic available", "wlan.pu_buffer_status.ac_vi",
32545       FT_UINT8, BASE_DEC, NULL, 0x04,
32546       NULL, HFILL }},
32547
32548     {&hf_ieee80211_tag_pu_buffer_status_ac_vo,
32549      {"AC_VO traffic available", "wlan.pu_buffer_status.ac_vo",
32550       FT_UINT8, BASE_DEC, NULL, 0x08,
32551       NULL, HFILL }},
32552
32553     {&hf_ieee80211_mysterious_olpc_stuff,
32554      {"Mysterious OLPC stuff", "wlan.mysterious_olpc_stuff",
32555       FT_NONE, BASE_NONE, NULL, 0x0,
32556       NULL, HFILL }},
32557
32558     {&hf_ieee80211_estimated_service_params,
32559      {"Estimated Service Parameters", "wlan.ext_tag.estimated_service_params",
32560       FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
32561
32562     {&hf_ieee80211_esp_access_category,
32563      {"Access Category", "wlan.ext_tag.estimated_service_params.access_category",
32564       FT_UINT24, BASE_DEC, VALS(esp_access_category_vals), 0x000003,
32565        NULL, HFILL }},
32566
32567     {&hf_ieee80211_esp_reserved,
32568      {"Reserved", "wlan.ext_tag.estimated_service_params.reserved",
32569       FT_UINT24, BASE_HEX, NULL, 0x000004, NULL, HFILL }},
32570
32571     {&hf_ieee80211_esp_data_format,
32572      {"Data Format", "wlan.ext_tag.estimated_service_params.data_format",
32573       FT_UINT24, BASE_DEC, VALS(esp_data_format_vals), 0x000018,
32574        NULL, HFILL }},
32575
32576     {&hf_ieee80211_esp_ba_windows_size,
32577      {"BA Window Size", "wlan.ext_tag.estimated_service_params.ba_window_size",
32578       FT_UINT24, BASE_DEC, VALS(esp_ba_window_size_vals), 0x0000E0,
32579        NULL, HFILL }},
32580
32581     {&hf_ieee80211_esp_est_air_time_frac,
32582      {"Estimated Air Time Fraction", "wlan.ext_tag.estimated_service_params.air_time_frac",
32583       FT_UINT24, BASE_DEC, NULL, 0x00FF00, NULL, HFILL }},
32584
32585     {&hf_ieee80211_esp_data_ppdu_duration_target,
32586      {"Data PPDU Duration Target", "wlan.ext_tag.estimated_service_params.data_ppdu_dur_target",
32587       FT_UINT24, BASE_DEC, NULL, 0x00FF00, NULL, HFILL }},
32588
32589     {&hf_ieee80211_fcg_new_channel_number,
32590      {"New Channel Number", "wlan.ext_tag.future_channel_guidance.new_chan_num",
32591       FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
32592
32593     {&hf_ieee80211_fcg_extra_info,
32594      {"Extra bytes", "wlan.ext_tag.future_channel_guidance.extra_bytes",
32595       FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
32596
32597     {&hf_ieee80211_ext_tag,
32598      {"Ext Tag", "wlan.ext_tag",
32599       FT_NONE, BASE_NONE, 0x0, 0,
32600       NULL, HFILL }},
32601
32602     {&hf_ieee80211_ext_tag_number,
32603      {"Ext Tag Number", "wlan.ext_tag.number",
32604       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_eid_ext_ext, 0,
32605       "Element ID", HFILL }},
32606
32607     {&hf_ieee80211_ext_tag_length,
32608      {"Ext Tag length", "wlan.ext_tag.length",
32609       FT_UINT32, BASE_DEC, NULL, 0,
32610       "Length of tag", HFILL }},
32611
32612     {&hf_ieee80211_fils_session,
32613      {"FILS Session", "wlan.ext_tag.fils.session",
32614       FT_BYTES, BASE_NONE, NULL, 0x0,
32615       NULL, HFILL }},
32616
32617     {&hf_ieee80211_fils_wrapped_data,
32618      {"FILS Wrapped Data", "wlan.ext_tag.fils.wrapped_data",
32619       FT_BYTES, BASE_NONE, NULL, 0x0,
32620       NULL, HFILL }},
32621
32622     {&hf_ieee80211_fils_nonce,
32623      {"FILS Nonce", "wlan.ext_tag.fils.nonce",
32624       FT_BYTES, BASE_NONE, NULL, 0x0,
32625       NULL, HFILL }},
32626
32627     {&hf_he_mac_capabilities,
32628      {"HE MAC Capabilities Information", "wlan.ext_tag.he_mac_caps",
32629       FT_UINT40, BASE_HEX, NULL, 0x0, NULL, HFILL }},
32630
32631     {&hf_he_htc_he_support,
32632      {"+HTC HE Support", "wlan.ext_tag.he_mac_cap.htc_he_support",
32633       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000001,
32634       NULL, HFILL }},
32635
32636     {&hf_he_twt_requester_support,
32637      {"TWT Requester Support", "wlan.ext_tag.he_mac_cap.twt_req_support",
32638       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000002,
32639       NULL, HFILL }},
32640
32641     {&hf_he_twt_responder_support,
32642      {"TWT Responder Support", "wlan.ext_tag.he_mac_cap.twt_rsp_support",
32643       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000004,
32644       NULL, HFILL }},
32645
32646     {&hf_he_fragmentation_support,
32647      {"Fragmentation Support", "wlan.ext_tag.he_mac_cap.fragmentation_support",
32648       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
32649       VALS64(he_fragmentation_support_vals), 0x0000000018,
32650       NULL, HFILL }},
32651
32652     {&hf_he_max_number_fragmented_msdus,
32653      {"Maximum Number of Fragmented MSDUs", "wlan.ext_tag.he_mac_cap.max_frag_msdus",
32654       FT_UINT40, BASE_DEC, NULL, 0x00000000E0,
32655       NULL, HFILL }},
32656
32657     {&hf_he_min_fragment_size,
32658      {"Minimum Fragment Size", "wlan.ext_tag.he_mac_cap.min_frag_size",
32659       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
32660       VALS64(he_minimum_fragmentation_size_vals), 0x0000000300,
32661       NULL, HFILL }},
32662
32663     {&hf_he_trigger_frame_mac_padding_dur,
32664      {"Trigger Frame MAC Padding Duration", "wlan.ext_tag.he_mac_cap.trig_frm_mac_padding_dur",
32665       FT_UINT40, BASE_DEC, NULL, 0x0000000C00, NULL, HFILL }},
32666
32667     {&hf_he_multi_tid_aggregation_support,
32668      {"Multi-TID Aggregation Support", "wlan.ext_tag.he_mac_cap.multi_tid_agg_support",
32669       FT_UINT40, BASE_DEC, NULL, 0x0000007000, NULL, HFILL }},
32670
32671     {&hf_he_he_link_adaptation_support,
32672      {"HE Link Adaptation Support", "wlan.ext_tag.he_mac_cap.he_link_adaptation_support",
32673       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
32674       VALS64(he_link_adaptation_support_vals), 0x0000018000,
32675       NULL, HFILL }},
32676
32677     {&hf_he_all_ack_support,
32678      {"All Ack Support", "wlan.ext_tag.he_mac_cap.all_ack_support",
32679       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000020000,
32680       NULL, HFILL }},
32681
32682     {&hf_he_umrs_support,
32683      {"UMRS Support", "wlan.ext_tag.he_mac_cap.umrs_support",
32684       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000040000,
32685       NULL, HFILL }},
32686
32687     {&hf_he_bsr_support,
32688      {"BSR Support", "wlan.ext_tag.he_mac_cap.bsr_support",
32689       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000080000,
32690       NULL, HFILL }},
32691
32692     {&hf_he_broadcast_twt_support,
32693      {"Broadcast TWT Support", "wlan.ext_tag.he_mac_cap.broadcast_twt_support",
32694       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000100000,
32695       NULL, HFILL }},
32696
32697     {&hf_he_32_bit_ba_bitmap_support,
32698      {"32-bit BA Bitmap Support", "wlan.ext_tag.he_mac_cap.32_bit_ba_bitmap_support",
32699       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000200000,
32700       NULL, HFILL }},
32701
32702     {&hf_he_mu_cascading_support,
32703      {"MU Cascading Support", "wlan.ext_tag.he_mac_cap.mu_cascading_support",
32704       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000400000,
32705       NULL, HFILL }},
32706
32707     {&hf_he_ack_enabled_aggregation_support,
32708      {"Ack-Enabled Aggregation Support", "wlan.ext_tag.he_mac_cap.ack_enabled_agg_support",
32709       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000800000,
32710       NULL, HFILL }},
32711
32712     {&hf_he_group_addressed_multi_sta_blkack_support,
32713      {"Group Addressed Multi-STA BlockAck in DL MU Support", "wlan.ext_tag.he_mac_cap.i_give_up",
32714       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0001000000,
32715       NULL, HFILL }},
32716
32717     {&hf_he_om_control_support,
32718      {"OM Control Support", "wlan.ext_tag.he_mac_cap.om_control_support",
32719       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0002000000,
32720       NULL, HFILL }},
32721
32722     {&hf_he_ofdma_ra_support,
32723      {"OFDMA RA Support", "wlan.ext_tag.he_mac_cap.ofdma_ra_support",
32724       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0004000000,
32725       NULL, HFILL }},
32726
32727     {&hf_he_max_a_mpdu_length_exponent,
32728      {"Maximum A-MPDU Length Exponent", "wlan.ext_tag.he_mac_cap.max_a_mpdu_len_exp",
32729       FT_UINT40, BASE_DEC, NULL, 0x0018000000, NULL, HFILL }},
32730
32731     {&hf_he_a_msdu_fragmentation_support,
32732      {"A-MSDU Fragmentation Support", "wlan.ext_tag.he_mac_cap.a_msdu_frag_support",
32733       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0020000000,
32734       NULL, HFILL }},
32735
32736     {&hf_he_flexible_twt_schedule_support,
32737      {"Flexible TWT Schedule Support", "wlan.ext_tag.he_mac_cap.flexible_twt_sched_support",
32738       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0040000000,
32739       NULL, HFILL }},
32740
32741     {&hf_he_rx_control_frame_to_multibss,
32742      {"Rx Control Frame to MultiBSS", "wlan.ext_tag.he_mac_cap.rx_ctl_frm_multibss",
32743       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0080000000,
32744       NULL, HFILL }},
32745
32746     {&hf_he_bsrp_bqrp_a_mpdu_aggregation,
32747      {"BSRP BQRP A-MPDU Aggregation", "wlan.ext_tag.he_mac_cap.bsrp_bqrp_a_mpdu_agg",
32748       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0100000000,
32749       NULL, HFILL }},
32750
32751     {&hf_he_qtp_support,
32752      {"QTP Support", "wlan.ext_tag.he_mac_cap.qtp_support",
32753       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0200000000,
32754       NULL, HFILL }},
32755
32756     {&hf_he_bqr_support,
32757      {"BQR Support", "wlan.ext_tag.he_mac_cap.bqr_support",
32758       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0400000000,
32759       NULL, HFILL }},
32760
32761     {&hf_he_sr_responder,
32762      {"SR Responder Role", "wlan.ext_tag.he_mac_cap.sr_responder",
32763       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0800000000,
32764       NULL, HFILL }},
32765
32766     {&hf_he_ndp_feedback_report_support,
32767      {"NDP Feedback Report Support", "wlan.ext_tag.he_mac_cap.ndp_feedback_report_support",
32768       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x1000000000,
32769       NULL, HFILL }},
32770
32771     {&hf_he_ops_support,
32772      {"OPS Support", "wlan.ext_tag.he_mac_cap.ops_support",
32773       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x2000000000,
32774       NULL, HFILL }},
32775
32776     {&hf_he_a_msdu_in_a_mpdu_support,
32777      {"A-MSDU in A-MPDU Support", "wlan.ext_tag.he_mac_cap.a_msdu_in_a_mpdu_support",
32778       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x4000000000,
32779       NULL, HFILL }},
32780
32781     {&hf_he_reserved,
32782      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_39",
32783       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
32784
32785     {&hf_he_reserved_bits_5_7,
32786      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_5_7",
32787       FT_UINT40, BASE_HEX, NULL, 0x00000000E0, NULL, HFILL }},
32788
32789     {&hf_he_reserved_bits_8_9,
32790      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_8_9",
32791       FT_UINT40, BASE_HEX, NULL, 0x0000000300, NULL, HFILL }},
32792
32793     {&hf_he_reserved_bits_15_16,
32794      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_15_16",
32795       FT_UINT40, BASE_HEX, NULL, 0x0000018000, NULL, HFILL }},
32796
32797     {&hf_he_reserved_bit_18,
32798      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_18",
32799       FT_UINT40, BASE_HEX, NULL, 0x0000040000, NULL, HFILL }},
32800
32801     {&hf_he_reserved_bit_19,
32802      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_19",
32803       FT_UINT40, BASE_HEX, NULL, 0x0000080000, NULL, HFILL }},
32804
32805     {&hf_he_reserved_bit_25,
32806      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_25",
32807       FT_UINT40, BASE_HEX, NULL, 0x0002000000, NULL, HFILL }},
32808
32809     {&hf_he_phy_dual_band_support,
32810      {"Dual Band Support", "wlan.ext_tag.he_phy_cap.fbytes",
32811       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
32812
32813     {&hf_he_phy_cap_dual_band_support,
32814      {"Dual Band Support", "wlan.ext_tag.he_phy_cap.fbyte.dbs",
32815       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
32816       NULL, HFILL }},
32817
32818     {&hf_he_phy_chan_width_set,
32819      {"Channel Width Set", "wlan.ext_tag.he_phy_cap.fbytes",
32820       FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL }},
32821
32822     {&hf_he_40mhz_channel_2_4ghz,
32823      {"40MHz in 2.4GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.40mhz_in_2_4ghz",
32824       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }},
32825
32826     {&hf_he_40_and_80_mhz_5ghz,
32827      {"40 & 80MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.40_80_in_5ghz",
32828       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL }},
32829
32830     {&hf_he_160_mhz_5ghz,
32831      {"160MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.160_in_5ghz",
32832       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08, NULL, HFILL }},
32833
32834     {&hf_he_160_80_plus_80_mhz_5ghz,
32835      {"160/80+80MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.160_80_80_in_5ghz",
32836       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10, NULL, HFILL }},
32837
32838     {&hf_he_242_tone_rus_in_2_4ghz,
32839      {"242 tone RUs in the 2.4GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.242_tone_in_2_4ghz",
32840       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20, NULL, HFILL }},
32841
32842     {&hf_he_242_tone_rus_in_5ghz,
32843      {"242 tone RUs in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.242_tone_in_5ghz",
32844       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40, NULL, HFILL }},
32845
32846     {&hf_he_chan_width_reserved,
32847      {"Reserved", "wlan.ext_tag.he_phy_cap.chan_width_set.reserved",
32848       FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }},
32849
32850     {&hf_he_phy_b8_to_b23,
32851      {"Bits 8 to 23", "wlan.ext_tag.he_phy_cap.bits_8_to_23",
32852       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
32853
32854     {&hf_he_phy_cap_punctured_preamble_rx,
32855      {"Punctured Preamble RX", "wlan.ext_tag.he_phy_cap.nbytes.punc_preamble_rx",
32856       FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL }},
32857
32858     {&hf_he_phy_cap_device_class,
32859      {"Device Class", "wlan.ext_tag.he_phy_cap.nbytes.device_class",
32860       FT_UINT16, BASE_HEX, NULL, 0x0010, NULL, HFILL }},
32861
32862     {&hf_he_phy_cap_ldpc_coding_in_payload,
32863      {"LDPC Coding In Payload", "wlan.ext_tag.he_phy_cap.nbytes.ldpc_coding_in_payload",
32864       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0020, NULL, HFILL }},
32865
32866     {&hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us,
32867      {"HE SU PPDU With 1x HE-LTF and 0.8us GI",
32868       "wlan.ext_tag.he_phy_cap.nbytes.he_su_ppdu_with_1x_he_ltf_08us",
32869       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
32870
32871     {&hf_he_phy_cap_midamble_rx_max_nsts,
32872      {"Midamble Rx Max NSTS", "wlan.ext_tag.he_phy_cap.mbytes.midamble_rx_max_nsts",
32873       FT_UINT16, BASE_HEX, NULL, 0x0180, NULL, HFILL }},
32874
32875     {&hf_he_phy_cap_ndp_with_4x_he_ltf_32us,
32876      {"NDP With 4x HE-LTF and 3.2us GI",
32877       "wlan.ext_tag.he_phy_cap.nbytes.ndp_with_4x_he_ltf_4x_3.2us",
32878       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
32879
32880     {&hf_he_phy_cap_stbc_tx_lt_80mhz,
32881      {"STBC Tx <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_tx_lt_80mhz",
32882       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
32883
32884     {&hf_he_phy_cap_stbc_rx_lt_80mhz,
32885      {"STBC Rx <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_rx_lt_80mhz",
32886       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
32887
32888     {&hf_he_phy_cap_doppler_tx,
32889      {"Doppler Tx", "wlan.ext_tag.he_phy_cap.nbytes.doppler_tx",
32890       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
32891
32892     {&hf_he_phy_cap_doppler_rx,
32893      {"Doppler Rx", "wlan.ext_tag.he_phy_cap.nbytes.doppler_rx",
32894       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
32895
32896     {&hf_he_phy_cap_full_bw_ul_mu_mimo,
32897      {"Full Bandwidth UL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.full_bw_ul_mu_mimo",
32898       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }},
32899
32900     {&hf_he_phy_cap_partial_bw_ul_mu_mimo,
32901      {"Partial Bandwidth UL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_ul_mu_mimo",
32902       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL }},
32903
32904     {&hf_he_phy_b24_to_b39,
32905      {"Bits 24 to 39", "wlan.ext_tag.he_phy_cap.bits_24_to_39",
32906       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
32907
32908     {&hf_he_phy_cap_dcm_max_constellation_tx,
32909      {"DCM Max Constellation Tx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_const_tx",
32910       FT_UINT16, BASE_HEX, NULL, 0x0003, NULL, HFILL }},
32911
32912     {&hf_he_phy_cap_dcm_max_nss_tx,
32913      {"DCM Max NSS Tx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_nss_tx",
32914       FT_UINT16, BASE_HEX, NULL, 0x0004, NULL, HFILL }},
32915
32916     {&hf_he_phy_cap_dcm_max_constellation_rx,
32917      {"DCM Max Constellation Rx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_const_rx",
32918       FT_UINT16, BASE_HEX, NULL, 0x0018, NULL, HFILL }},
32919
32920     {&hf_he_phy_cap_dcm_max_nss_rx,
32921      {"DCM Max NSS Rx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_nss_tx",
32922       FT_UINT16, BASE_HEX, NULL, 0x0020, NULL, HFILL }},
32923
32924     {&hf_he_phy_cap_rx_he_muppdu_from_non_ap,
32925      {"Rx HE MU PPDU from Non-AP STA", "wlan.ext_tag.he_phy_cap.nbytes.rx_he_mu_ppdu",
32926       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
32927
32928     {&hf_he_phy_cap_su_beamformer,
32929      {"SU Beamformer", "wlan.ext_tag.he_phy_cap.nbytes.su_beamformer",
32930       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
32931
32932     {&hf_he_phy_cap_su_beamformee,
32933      {"SU Beamformee", "wlan.ext_tag.he_phy_cap.nbytes.su_beamformee",
32934       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
32935
32936     {&hf_he_phy_cap_mu_beamformer,
32937      {"MU Beamformer", "wlan.ext_tag.he_phy_cap.nbytes.mu_beamformer",
32938       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
32939
32940     {&hf_he_phy_cap_beamformer_sts_lte_80mhz,
32941      {"Beamformee STS <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.beamformee_sts_lte_80mhz",
32942       FT_UINT16, BASE_HEX, NULL, 0x1C00, NULL, HFILL }},
32943
32944     {&hf_he_phy_cap_beamformer_sts_gt_80mhz,
32945      {"Beamformee STS > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.beamformee_sts_gt_80mhz",
32946       FT_UINT16, BASE_HEX, NULL, 0xE000, NULL, HFILL }},
32947
32948     {&hf_he_phy_b40_to_b55,
32949      {"Bits 40 to 55", "wlan.ext_tag.he_phy_cap.bits_40_to_55",
32950       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
32951
32952     {&hf_he_phy_cap_number_of_sounding_dims_lte_80,
32953      {"Number Of Sounding Dimensions <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.no_sounding_dims_lte_80",
32954       FT_UINT16, BASE_DEC, NULL, 0x0007, NULL, HFILL }},
32955
32956     {&hf_he_phy_cap_number_of_sounding_dims_gt_80,
32957      {"Number Of Sounding Dimensions > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.no_sounding_dims_gt_80",
32958       FT_UINT16, BASE_DEC, NULL, 0x0038, NULL, HFILL }},
32959
32960     {&hf_he_phy_cap_ng_eq_16_su_fb,
32961      {"Ng = 16 SU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.ng_eq_16_su_fb",
32962       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
32963
32964     {&hf_he_phy_cap_ng_eq_16_mu_fb,
32965      {"Ng = 16 MU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.ng_eq_16_mu_fb",
32966       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
32967
32968     {&hf_he_phy_cap_codebook_size_eq_4_2_fb,
32969      {"Codebook Size SU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.codebook_size_su_fb",
32970       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
32971
32972     {&hf_he_phy_cap_codebook_size_eq_7_5_fb,
32973      {"Codebook Size MU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.codebook_size_mu_fb",
32974       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
32975
32976     {&hf_he_phy_cap_triggered_su_beamforming_fb,
32977      {"Triggered SU Beamforming Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_su_bf_fb",
32978       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
32979
32980     {&hf_he_phy_cap_triggered_mu_beamforming_fb,
32981      {"Triggered MU Beamforming Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_mu_bf_fb",
32982       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
32983
32984     {&hf_he_phy_cap_triggered_cqi_fb,
32985      {"Triggered CQI Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_cqi_fb",
32986       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
32987
32988     {&hf_he_phy_cap_partial_bw_extended_range,
32989      {"Partial Bandwidth Extended Range", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_er",
32990       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
32991
32992     {&hf_he_phy_cap_partial_bw_dl_mu_mimo,
32993      {"Partial Bandwidth DL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_dl_mu_mimo",
32994       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }},
32995
32996     {&hf_he_phy_cap_ppe_threshold_present,
32997      {"PPE Threshold Present", "wlan.ext_tag.he_phy_cap.nbytes.ppe_thres_present",
32998       FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL }},
32999
33000     {&hf_he_phy_b56_to_b71,
33001      {"Bits 56 to 71", "wlan.ext_tag.he_phy_cap.bits_56_to_71",
33002       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33003
33004     {&hf_he_phy_cap_srp_based_sr_support,
33005      {"SRP-based SR Support", "wlan.ext_tag.he_phy_cap.nbytes.srp_based_sr_sup",
33006       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001, NULL, HFILL }},
33007
33008     {&hf_he_phy_cap_power_boost_factor_ar_support,
33009      {"Power Boost Factor ar Support", "wlan.ext_tag.he_phy_cap.nbytes.pwr_bst_factor_ar_sup",
33010       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002, NULL, HFILL }},
33011
33012     {&hf_he_phy_cap_he_su_ppdu_etc_gi,
33013      {"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",
33014       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004, NULL, HFILL }},
33015
33016     {&hf_he_phy_cap_max_nc,
33017      {"Max Nc", "wlan.ext_tag.he_phy_cap.nbytes.max_nc",
33018       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0038, NULL, HFILL }},
33019
33020     {&hf_he_phy_cap_stbc_tx_gt_80_mhz,
33021      {"STBC Tx > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_tx_gt_80_mhz",
33022       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
33023
33024     {&hf_he_phy_cap_stbc_rx_gt_80_mhz,
33025      {"STBC Rx > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_rx_gt_80_mhz",
33026       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
33027
33028     {&hf_he_phy_cap_he_er_su_ppdu_4xxx_gi,
33029      {"HE ER SU PPDU W 4x HE-LTF & 0.8us GI", "wlan.ext_tag.he_phy_cap.nbytes.he_er_su_ppdu_4xxx_gi",
33030       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
33031
33032     {&hf_he_phy_cap_20mhz_in_40mhz_24ghz_band,
33033      {"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",
33034       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
33035
33036     {&hf_he_phy_cap_20mhz_in_160_80p80_ppdu,
33037      {"20 MHz In 160/80+80 MHz HE PPDU", "wlan.ext_tag.he_phy_cap.nbytes.20_mhz_in_160_80p80_ppdu",
33038       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
33039
33040     {&hf_he_phy_cap_80mgz_in_160_80p80_ppdu,
33041      {"80 MHz In 160/80+80 MHz HE PPDU", "wlan.ext_tag.he_phy_cap.nbytes.80_mhz_in_160_80p80_ppdu",
33042       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
33043
33044     {&hf_he_phy_cap_he_er_su_ppdu_1xxx_gi,
33045      {"HE ER SU PPDU W 1x HE-LTF & 0.8us GI", "wlan.ext_tag.he_phy_cap.nbytes.he_er_su_ppdu_1xxx_gi",
33046       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
33047
33048     {&hf_he_phy_cap_midamble_rx_2x_xxx_ltf,
33049      {"Midamble Rx 2x & 1x HE-LTF", "wlan.ext_tag.he_phy_cap.nbytes.midamble_rx_2x_1x_he_ltf",
33050       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
33051
33052     {&hf_he_phy_cap_b70_b71_reserved,
33053      {"Reserved", "wlan.ext_tag.he_phy_cap.nbytes.reserved_b70_b71",
33054       FT_UINT16, BASE_HEX, NULL, 0xC000, NULL, HFILL }},
33055
33056     {&hf_he_mcs_max_he_mcs_80_rx_1_ss,
33057      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_1_ss",
33058       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33059
33060     {&hf_he_mcs_max_he_mcs_80_rx_2_ss,
33061      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_2_ss",
33062       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33063
33064     {&hf_he_mcs_max_he_mcs_80_rx_3_ss,
33065      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_3_ss",
33066       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33067
33068     {&hf_he_mcs_max_he_mcs_80_rx_4_ss,
33069      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_4_ss",
33070       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33071
33072     {&hf_he_mcs_max_he_mcs_80_rx_5_ss,
33073      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_5_ss",
33074       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33075
33076     {&hf_he_mcs_max_he_mcs_80_rx_6_ss,
33077      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_6_ss",
33078       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33079
33080     {&hf_he_mcs_max_he_mcs_80_rx_7_ss,
33081      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_7_ss",
33082       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33083
33084     {&hf_he_mcs_max_he_mcs_80_rx_8_ss,
33085      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_8_ss",
33086       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33087
33088     {&hf_he_mcs_max_he_mcs_80_tx_1_ss,
33089      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_1_ss",
33090       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33091
33092     {&hf_he_mcs_max_he_mcs_80_tx_2_ss,
33093      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_2_ss",
33094       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33095
33096     {&hf_he_mcs_max_he_mcs_80_tx_3_ss,
33097      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_3_ss",
33098       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33099
33100     {&hf_he_mcs_max_he_mcs_80_tx_4_ss,
33101      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_4_ss",
33102       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33103
33104     {&hf_he_mcs_max_he_mcs_80_tx_5_ss,
33105      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_5_ss",
33106       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33107
33108     {&hf_he_mcs_max_he_mcs_80_tx_6_ss,
33109      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_6_ss",
33110       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33111
33112     {&hf_he_mcs_max_he_mcs_80_tx_7_ss,
33113      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_7_ss",
33114       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33115
33116     {&hf_he_mcs_max_he_mcs_80_tx_8_ss,
33117      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_8_ss",
33118       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33119
33120     {&hf_he_mcs_max_he_mcs_80p80_rx_1_ss,
33121      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_1_ss",
33122       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33123
33124     {&hf_he_mcs_max_he_mcs_80p80_rx_2_ss,
33125      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_2_ss",
33126       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33127
33128     {&hf_he_mcs_max_he_mcs_80p80_rx_3_ss,
33129      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_3_ss",
33130       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33131
33132     {&hf_he_mcs_max_he_mcs_80p80_rx_4_ss,
33133      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_4_ss",
33134       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33135
33136     {&hf_he_mcs_max_he_mcs_80p80_rx_5_ss,
33137      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_5_ss",
33138       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33139
33140     {&hf_he_mcs_max_he_mcs_80p80_rx_6_ss,
33141      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_6_ss",
33142       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33143
33144     {&hf_he_mcs_max_he_mcs_80p80_rx_7_ss,
33145      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_7_ss",
33146       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33147
33148     {&hf_he_mcs_max_he_mcs_80p80_rx_8_ss,
33149      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_8_ss",
33150       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33151
33152     {&hf_he_mcs_max_he_mcs_80p80_tx_1_ss,
33153      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_1_ss",
33154       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33155
33156     {&hf_he_mcs_max_he_mcs_80p80_tx_2_ss,
33157      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_2_ss",
33158       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33159
33160     {&hf_he_mcs_max_he_mcs_80p80_tx_3_ss,
33161      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_3_ss",
33162       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33163
33164     {&hf_he_mcs_max_he_mcs_80p80_tx_4_ss,
33165      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_4_ss",
33166       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33167
33168     {&hf_he_mcs_max_he_mcs_80p80_tx_5_ss,
33169      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_5_ss",
33170       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33171
33172     {&hf_he_mcs_max_he_mcs_80p80_tx_6_ss,
33173      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_6_ss",
33174       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33175
33176     {&hf_he_mcs_max_he_mcs_80p80_tx_7_ss,
33177      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_7_ss",
33178       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33179
33180     {&hf_he_mcs_max_he_mcs_80p80_tx_8_ss,
33181      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_8_ss",
33182       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33183
33184     {&hf_he_mcs_max_he_mcs_160_rx_1_ss,
33185      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_1_ss",
33186       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33187
33188     {&hf_he_mcs_max_he_mcs_160_rx_2_ss,
33189      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_2_ss",
33190       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33191
33192     {&hf_he_mcs_max_he_mcs_160_rx_3_ss,
33193      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_3_ss",
33194       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33195
33196     {&hf_he_mcs_max_he_mcs_160_rx_4_ss,
33197      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_4_ss",
33198       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33199
33200     {&hf_he_mcs_max_he_mcs_160_rx_5_ss,
33201      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_5_ss",
33202       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33203
33204     {&hf_he_mcs_max_he_mcs_160_rx_6_ss,
33205      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_6_ss",
33206       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33207
33208     {&hf_he_mcs_max_he_mcs_160_rx_7_ss,
33209      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_7_ss",
33210       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33211
33212     {&hf_he_mcs_max_he_mcs_160_rx_8_ss,
33213      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_8_ss",
33214       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33215
33216     {&hf_he_mcs_max_he_mcs_160_tx_1_ss,
33217      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_1_ss",
33218       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33219
33220     {&hf_he_mcs_max_he_mcs_160_tx_2_ss,
33221      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_2_ss",
33222       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33223
33224     {&hf_he_mcs_max_he_mcs_160_tx_3_ss,
33225      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_3_ss",
33226       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33227
33228     {&hf_he_mcs_max_he_mcs_160_tx_4_ss,
33229      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_4_ss",
33230       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33231
33232     {&hf_he_mcs_max_he_mcs_160_tx_5_ss,
33233      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_5_ss",
33234       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33235
33236     {&hf_he_mcs_max_he_mcs_160_tx_6_ss,
33237      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_6_ss",
33238       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33239
33240     {&hf_he_mcs_max_he_mcs_160_tx_7_ss,
33241      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_7_ss",
33242       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33243
33244     {&hf_he_mcs_max_he_mcs_160_tx_8_ss,
33245      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_8_ss",
33246       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33247
33248     {&hf_he_rx_he_mcs_map_lte_80,
33249      {"Rx HEX-MCS Map <= 80 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_lte_80",
33250      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33251
33252     {&hf_he_tx_he_mcs_map_lte_80,
33253      {"Tx HEX-MCS Map <= 80 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_lte_80",
33254      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33255
33256     {&hf_he_rx_he_mcs_map_160,
33257      {"Rx HEX-MCS Map 160 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_160",
33258      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33259
33260     {&hf_he_tx_he_mcs_map_160,
33261      {"Tx HEX-MCS Map 160 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_160",
33262      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33263
33264     {&hf_he_rx_he_mcs_map_80_80,
33265      {"Rx HEX-MCS Map 80+80 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_80_80",
33266      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33267
33268     {&hf_he_tx_he_mcs_map_80_80,
33269      {"Tx HEX-MCS Map 80+80 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_80_80",
33270      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33271
33272     {&hf_he_ppe_thresholds_nss,
33273      {"NSS", "wlan.ext_tag.he_ppe_thresholds.nss",
33274       FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
33275
33276     {&hf_he_ppe_thresholds_ru_index_bitmask,
33277      {"RU Index Bitmask", "wlan.ext_tag.he_ppe_thresholds.ru_index_bitmask",
33278       FT_UINT8, BASE_HEX, NULL, 0x78, NULL, HFILL }},
33279
33280     {&hf_he_ppe_ppet16,
33281      {"PPET16","wlan.ext_tag.he_ppe_thresholds.ppet16",
33282       FT_UINT8, BASE_HEX, VALS(constellation_vals), 0x0, NULL, HFILL }},
33283
33284     {&hf_he_ppe_ppet8,
33285      {"PPET8","wlan.ext_tag.he_ppe_thresholds.ppet8",
33286       FT_UINT8, BASE_HEX, VALS(constellation_vals), 0x0, NULL, HFILL }},
33287
33288     {&hf_he_operation_parameter,
33289      {"HE Operation Parameters", "wlan.ext_tag.he_operation.params",
33290       FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
33291
33292     {&hf_he_operation_bss_color,
33293      {"BSS Color", "wlan.ext_tag.he_operation.he_color",
33294       FT_UINT32, BASE_DEC, NULL, 0x0000003f, NULL, HFILL }},
33295
33296     {&hf_he_operation_default_pe_duration,
33297      {"Default PE Duration", "wlan.ext_tag.he_operation.default_pe_duration",
33298       FT_UINT32, BASE_DEC, NULL, 0x000001C0, NULL, HFILL }},
33299
33300     {&hf_he_operation_twt_required,
33301      {"TWT Required", "wlan.ext_tag.he_operation.twt_required",
33302       FT_BOOLEAN, 32, TFS(&tfs_required_not_required), 0x00000200, NULL, HFILL }},
33303
33304     {&hf_he_operation_txop_duration_rts_threshold,
33305      {"TXOP Duration RTS Threshold", "wlan.ext_tag.he_operation.txop_duration_rts_thresh",
33306       FT_UINT32, BASE_DEC, NULL, 0x000FFC00, NULL, HFILL }},
33307
33308     {&hf_he_operation_partial_bss_color,
33309      {"Partial BSS Color", "wlan.ext_tag.he_operation.partial_bss_color",
33310       FT_BOOLEAN, 32, NULL, 0x00100000, NULL, HFILL }},
33311
33312     {&hf_he_operation_vht_operation_information_present,
33313      {"VHT Operation Information Present", "wlan.ext_tag.he_operation.vht_op_info_present",
33314       FT_BOOLEAN, 32, NULL, 0x00200000, NULL, HFILL }},
33315
33316     {&hf_he_operation_reserved_b22_b27,
33317      {"Reserved", "wlan.ext_tag.he_operation.reserved_b22_b27",
33318       FT_UINT32, BASE_HEX, NULL, 0x0FC00000, NULL, HFILL }},
33319
33320     {&hf_he_operation_multiple_bssid_ap,
33321      {"Multiple BSSID AP", "wlan.ext_tag.he_operation.multiple_bssid_ap",
33322       FT_BOOLEAN, 32, NULL, 0x10000000, NULL, HFILL }},
33323
33324     {&hf_he_operation_txbssid_indicator,
33325      {"TX BSSID Indicator", "wlan.ext_tag.he_operation.tx_bssid_indicator",
33326       FT_BOOLEAN, 32, NULL, 0x20000000, NULL, HFILL }},
33327
33328     {&hf_he_operation_bss_color_disabled,
33329      {"BSS Color Disabled", "wlan.ext_tag.he_operation.bss_color_disabled",
33330       FT_BOOLEAN, 32, TFS(&tfs_disabled_enabled), 0x40000000, NULL, HFILL }},
33331
33332     {&hf_he_operation_reserved_b31,
33333      {"Reserved", "wlan.ext_tag.he_operation.reserved_b31",
33334       FT_UINT32, BASE_HEX, NULL, 0x80000000, NULL, HFILL }},
33335
33336     {&hf_he_operation_basic_mcs,
33337      {"Basic HE-MCS and NSS Set", "wlan.ext_tag.he_operation.basic_he_mcs_and_nss",
33338       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
33339
33340     {&hf_he_oper_max_he_mcs_for_1_ss,
33341      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_1_ss",
33342       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33343
33344     {&hf_he_oper_max_he_mcs_for_2_ss,
33345      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_2_ss",
33346       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33347
33348     {&hf_he_oper_max_he_mcs_for_3_ss,
33349      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_3_ss",
33350       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33351
33352     {&hf_he_oper_max_he_mcs_for_4_ss,
33353      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_4_ss",
33354       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33355
33356     {&hf_he_oper_max_he_mcs_for_5_ss,
33357      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_5_ss",
33358       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33359
33360     {&hf_he_oper_max_he_mcs_for_6_ss,
33361      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_6_ss",
33362       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33363
33364     {&hf_he_oper_max_he_mcs_for_7_ss,
33365      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_7_ss",
33366       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33367
33368     {&hf_he_oper_max_he_mcs_for_8_ss,
33369      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_8_ss",
33370       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33371
33372     {&hf_he_operation_channel_width,
33373      {"channel Width", "wlan.ext_tag.he_operation.vht_op_info.channel_width",
33374       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33375
33376     {&hf_he_operation_channel_center_freq_0,
33377      {"Channel Center Frequency Segment 0", "wlan.ext_tag.he_operatoon.vht_op_info.chan_center_freq_seg_0",
33378       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33379
33380     {&hf_he_operation_channel_center_freq_1,
33381      {"Channel Center Frequency Segment 1", "wlan.ext_tag.he_operatoon.vht_op_info.chan_center_freq_seg_1",
33382       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33383
33384     {&hf_he_operation_max_bssid_indicator,
33385      {"MaxBSSID Indicator", "wlan.ext_tag.he_operation.maxbssid_indicator",
33386       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33387
33388     {&hf_he_muac_aci_aifsn,
33389      {"AIC/AIFSN","wlan.ext_tag.mu_edca_parameter_set.aic_aifsn",
33390       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33391
33392     {&hf_he_mu_edca_timer,
33393      {"MU EDCA Timer","wlan.ext_tag.mu_edca_parameter_set.mu_edca_timer",
33394       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33395
33396     {&hf_he_muac_ecwmin_ecwmax,
33397      {"ECWmin/ECWmax","wlan.ext_tag.mu_edca_parameter_set.ecwmin_ecwmax",
33398       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33399
33400     {&hf_he_spatial_reuse_sr_control,
33401      {"SR Control", "wlan.ext_tag.spatial_reuse.sr_control",
33402       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33403
33404     {&hf_he_srp_disallowed,
33405      {"SRP Disallowed", "wlan.ext_tag.spatial_reuse.sr_control.srp_dis",
33406       FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
33407
33408     {&hf_he_non_srg_obss_pd_sr_disallowed,
33409      {"NON-SRG OBSS PD SR Disallowed", "wlan.ext_tag.spatial_reuse.sr_control.non_srg_obss_pd_sr_dis",
33410       FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
33411
33412     {&hf_he_non_srg_offset_present,
33413      {"Non-SRG Offset Present", "wlan.ext_tag.spatial_reuse.sr_control.non_srg_ofs_present",
33414       FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
33415
33416     {&hf_he_srg_information_present,
33417      {"SRG Information Present", "wlan.ext_tag.spatial_reuse.sr_control.srg_info_present",
33418      FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
33419
33420     {&hf_he_hesiga_spatial_reuse_value15_allowed,
33421      {"HESIGA Spatial Reuse value 15 allowed", "wlan.ext_tag.spatial_reuse.sr_control.hesiga_val_15_allowed",
33422       FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
33423
33424     {&hf_he_sr_control_reserved,
33425      {"Reserved", "wlan.ext_tag.spatial_reuse.sr_control.reserved",
33426       FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL }},
33427
33428     {&hf_he_spatial_non_srg_obss_pd_max_offset,
33429      {"Non-SRG OBSS PD Max Offset", "wlan.ext_tag.spatial_reuse.non_srg_obss_pd_max_offset",
33430       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33431
33432     {&hf_he_spatial_srg_obss_pd_min_offset,
33433      {"SRG OBSS PD Min Offset", "wlan.ext_tag.spatial_reuse.srg_obss_pd_min_offset",
33434       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33435
33436     {&hf_he_spatial_srg_obss_pd_max_offset,
33437      {"SRG OBSS PD Max Offset", "wlan.ext_tag.spatial_reuse.srg_obss_pd_max_offset",
33438       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33439
33440     {&hf_he_spatial_srg_bss_color_bitmap,
33441      {"SRG BSS Color Bitmap", "wlan.ext_tag.spatial_reuse.srg_bss_color_bitmap",
33442       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
33443
33444     {&hf_he_spatial_srg_partial_bssid_bitmap,
33445      {"SRG Partial BSSID Bitmap", "wlan.ext_tag.spatial_reuse.srg_partial_bssid_bitmap",
33446       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
33447
33448     {&hf_he_resource_request_buffer_thresh,
33449      {"Resource Request Buffer Threshold Exponent", "wlan.ext_tag.ndp_feedback.res_req_buf_thresh_exp",
33450       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33451
33452     {&hf_he_bss_color_change_new_color_info,
33453      {"New BSS Color Info", "wlan.ext_tag.bss_color_change.new_color_info",
33454       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33455
33456     {&hf_he_new_bss_color_info_color,
33457      {"New BSS Color", "wlan.ext_tag.bss_color_change.new_bss_color",
33458       FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL }},
33459
33460     {&hf_he_new_bss_color_info_reserved,
33461      {"Reserved", "wlan.ext_tag.bss_color_change.new_color_reserved",
33462       FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL }},
33463
33464     {&hf_he_bss_color_change_switch_countdown,
33465      {"BSS Color Switch Countdown", "wlan.ext_tag.bss_color_change.color_switch_countdown",
33466       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33467
33468     {&hf_he_ess_report_planned_ess,
33469      {"Planned ESS", "wlan.ext_tag.ess_report.ess_info.planned_ess",
33470       FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
33471
33472     {&hf_he_ess_report_edge_of_ess,
33473      {"Edge of ESS", "wlan.ext_tag.ess_report.ess_info.edge_of_ess",
33474       FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
33475
33476     {&hf_he_ess_report_info_field,
33477      {"ESS Information field", "wlan.ext_tag.ess_report.ess_info.field",
33478      FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }},
33479
33480     {&hf_he_ess_report_recommend_transition_thresh,
33481      {"Recommended BSS Transition Threshold", "wlan.ext_tag.ess_report.ess_info.thresh",
33482      FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL }},
33483
33484     {&hf_he_uora_field,
33485      {"UL OFDMA-based Random Access Parameter SET", "wlan.ext_tag.uora_parameter_set.field",
33486       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33487
33488     {&hf_he_uora_eocwmin,
33489      {"EOCWmin", "wlan.ext_tag.uora_parameter_set.eocwmin",
33490       FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
33491
33492     {&hf_he_uora_owcwmax,
33493      {"EOCWmax", "wlan.ext_tag.uora_parameter_set.eocwmax",
33494       FT_UINT8, BASE_DEC, NULL, 0x38, NULL, HFILL }},
33495
33496     {&hf_he_uora_reserved,
33497      {"Reserved", "wlan.ext_tag.uora_parameter_set.reserved",
33498       FT_UINT8, BASE_DEC, NULL, 0xC0, NULL, HFILL }},
33499   };
33500
33501   static hf_register_info aggregate_fields[] = {
33502     {&hf_ieee80211_amsdu_subframe,
33503      {"A-MSDU Subframe", "wlan_aggregate.a_mdsu.subframe",
33504       FT_NONE, BASE_NONE, NULL, 0x0,
33505       "Aggregate MAC Service Data Unit (MSDU) Subframe", HFILL }},
33506
33507     {&hf_ieee80211_amsdu_length,
33508      {"A-MSDU Length", "wlan_aggregate.a_mdsu.length",
33509       FT_UINT16, BASE_DEC, NULL, 0x0,
33510       NULL, HFILL }}
33511   };
33512
33513   static uat_field_t wep_uat_flds[] = {
33514
33515       UAT_FLD_VS(uat_wep_key_records, key, "Key type", wep_type_vals,
33516                         "Decryption key type used"),
33517       UAT_FLD_CSTRING(uat_wep_key_records, string, "Key",
33518                         "wep:<wep hexadecimal key>\n"
33519                         "wpa-pwd:<passphrase>[:<ssid>]\n"
33520                         "wpa-psk:<wpa hexadecimal key>"),
33521       UAT_END_FIELDS
33522     };
33523
33524   static gint *tree_array[] = {
33525     &ett_80211,
33526     &ett_proto_flags,
33527     &ett_cap_tree,
33528     &ett_fc_tree,
33529     &ett_cntrl_wrapper_fc,
33530     &ett_cntrl_wrapper_payload,
33531     &ett_fragments,
33532     &ett_fragment,
33533     &ett_block_ack,
33534     &ett_block_ack_tid,
33535     &ett_block_ack_request_control,
33536     &ett_block_ack_bitmap,
33537     &ett_block_ack_request_multi_sta_aid_tid,
33538     &ett_multi_sta_block_ack,
33539     &ett_ath_cap_tree,
33540
33541     &ett_80211_mgt,
33542     &ett_fixed_parameters,
33543     &ett_tagged_parameters,
33544     &ett_tag_bmapctl_tree,
33545     &ett_tag_country_fnm_tree,
33546     &ett_tag_country_rcc_tree,
33547     &ett_qos_parameters,
33548     &ett_qos_ps_buf_state,
33549     &ett_wep_parameters,
33550     &ett_msh_control,
33551     &ett_hwmp_targ_flags_tree,
33552     &ett_mesh_chswitch_flag_tree,
33553     &ett_mesh_config_cap_tree,
33554     &ett_mesh_formation_info_tree,
33555
33556     &ett_rsn_gcs_tree,
33557     &ett_rsn_pcs_tree,
33558     &ett_rsn_sub_pcs_tree,
33559     &ett_rsn_akms_tree,
33560     &ett_rsn_sub_akms_tree,
33561     &ett_rsn_cap_tree,
33562     &ett_rsn_pmkid_tree,
33563     &ett_rsn_gmcs_tree,
33564
33565     &ett_wpa_mcs_tree,
33566     &ett_wpa_ucs_tree,
33567     &ett_wpa_sub_ucs_tree,
33568     &ett_wpa_akms_tree,
33569     &ett_wpa_sub_akms_tree,
33570     &ett_wme_ac,
33571     &ett_wme_aci_aifsn,
33572     &ett_wme_ecw,
33573     &ett_wme_qos_info,
33574
33575     &ett_ht_cap_tree,
33576     &ett_ampduparam_tree,
33577     &ett_mcsset_tree,
33578     &ett_mcsbit_tree,
33579     &ett_htex_cap_tree,
33580     &ett_txbf_tree,
33581     &ett_antsel_tree,
33582     &ett_hta_cap_tree,
33583     &ett_hta_cap1_tree,
33584     &ett_hta_cap2_tree,
33585
33586     &ett_htc_tree,
33587     &ett_htc_he_a_control,
33588     &ett_mfb_subtree,
33589     &ett_lac_subtree,
33590     &ett_ieee80211_umrs_control,
33591     &ett_ieee80211_om_control,
33592     &ett_ieee80211_hla_control,
33593     &ett_ieee80211_buffer_status_report,
33594     &ett_ieee80211_control_uph,
33595     &ett_ieee80211_bqr_control,
33596     &ett_ieee80211_control_cci,
33597
33598     &ett_vht_cap_tree,
33599     &ett_vht_mcsset_tree,
33600     &ett_vht_rx_mcsbit_tree,
33601     &ett_vht_tx_mcsbit_tree,
33602     &ett_vht_basic_mcsbit_tree,
33603     &ett_vht_op_tree,
33604     &ett_vht_tpe_info_tree,
33605
33606     &ett_vht_ndp_annc,
33607     &ett_vht_ndp_annc_sta_info_tree,
33608     &ett_vht_ndp_annc_sta_list,
33609
33610     &ett_he_mimo_control,
33611
33612     &ett_ff_vhtmimo_cntrl,
33613     &ett_ff_vhtmimo_beamforming_report,
33614     &ett_ff_vhtmimo_beamforming_report_snr,
33615     &ett_ff_vhtmimo_beamforming_angle,
33616     &ett_ff_vhtmimo_beamforming_report_feedback_matrices,
33617     &ett_ff_vhtmu_exclusive_beamforming_report_matrices,
33618
33619     &ett_vht_grpidmgmt,
33620     &ett_vht_msa,
33621     &ett_vht_upa,
33622
33623     &ett_ht_info_delimiter1_tree,
33624     &ett_ht_info_delimiter2_tree,
33625     &ett_ht_info_delimiter3_tree,
33626
33627     &ett_tag_measure_request_mode_tree,
33628     &ett_tag_measure_request_type_tree,
33629     &ett_tag_measure_report_mode_tree,
33630     &ett_tag_measure_report_type_tree,
33631     &ett_tag_measure_report_basic_map_tree,
33632     &ett_tag_measure_report_rpi_tree,
33633     &ett_tag_measure_report_frame_tree,
33634     &ett_tag_measure_reported_frame_tree,
33635     &ett_tag_bss_bitmask_tree,
33636     &ett_tag_dfs_map_tree,
33637     &ett_tag_erp_info_tree,
33638     &ett_tag_ex_cap1,
33639     &ett_tag_ex_cap2,
33640     &ett_tag_ex_cap3,
33641     &ett_tag_ex_cap4,
33642     &ett_tag_ex_cap5,
33643     &ett_tag_ex_cap6,
33644     &ett_tag_ex_cap7,
33645     &ett_tag_ex_cap8,
33646     &ett_tag_ex_cap89,
33647     &ett_tag_ex_cap10,
33648
33649     &ett_tag_rm_cap1,
33650     &ett_tag_rm_cap2,
33651     &ett_tag_rm_cap3,
33652     &ett_tag_rm_cap4,
33653     &ett_tag_rm_cap5,
33654
33655     &ett_tag_20_40_bc,
33656
33657     &ett_tag_tclas_mask_tree,
33658
33659     &ett_tag_supported_channels,
33660
33661     &ett_tag_neighbor_report_bssid_info_tree,
33662     &ett_tag_neighbor_report_bssid_info_capability_tree,
33663     &ett_tag_neighbor_report_sub_tag_tree,
33664
33665     &ett_tag_wapi_param_set_akm_tree,
33666     &ett_tag_wapi_param_set_ucast_tree,
33667     &ett_tag_wapi_param_set_mcast_tree,
33668     &ett_tag_wapi_param_set_preauth_tree,
33669
33670     &ett_tag_time_adv_tree,
33671
33672     &ett_ff_ba_param_tree,
33673     &ett_ff_ba_ssc_tree,
33674     &ett_ff_delba_param_tree,
33675     &ett_ff_qos_info,
33676     &ett_ff_psmp_param_set,
33677     &ett_ff_mimo_cntrl,
33678     &ett_ff_ant_sel,
33679     &ett_mimo_report,
33680     &ett_ff_sm_pwr_save,
33681     &ett_ff_chan_switch_announce,
33682     &ett_ff_ht_info,
33683     &ett_ff_psmp_sta_info,
33684
33685     &ett_tpc,
33686
33687     &ett_msdu_aggregation_parent_tree,
33688     &ett_msdu_aggregation_subframe_tree,
33689
33690     &ett_80211_mgt_ie,
33691     &ett_tsinfo_tree,
33692     &ett_sched_tree,
33693
33694     &ett_fcs,
33695
33696     &ett_hs20_osu_providers_list,
33697     &ett_hs20_osu_provider_tree,
33698     &ett_hs20_friendly_names_list,
33699     &ett_hs20_friendly_name_tree,
33700     &ett_hs20_osu_provider_method_list,
33701     &ett_osu_icons_avail_list,
33702     &ett_hs20_osu_icon_tree,
33703     &ett_hs20_osu_service_desc_list,
33704     &ett_hs20_osu_service_desc_tree,
33705     &ett_hs20_venue_url,
33706     &ett_hs20_advice_of_charge,
33707     &ett_hs20_aoc_plan,
33708
33709     &ett_hs20_ofn_tree,
33710
33711     &ett_adv_proto,
33712     &ett_adv_proto_tuple,
33713     &ett_gas_query,
33714     &ett_gas_anqp,
33715     &ett_nai_realm,
33716     &ett_nai_realm_eap,
33717     &ett_tag_ric_data_desc_ie,
33718     &ett_anqp_vendor_capab,
33719
33720     &ett_osen_group_data_cipher_suite,
33721     &ett_osen_pairwise_cipher_suites,
33722     &ett_osen_pairwise_cipher_suite,
33723     &ett_osen_akm_cipher_suites,
33724     &ett_osen_akm_cipher_suite,
33725     &ett_osen_rsn_cap_tree,
33726     &ett_osen_pmkid_list,
33727     &ett_osen_pmkid_tree,
33728
33729     &ett_hs20_cc_proto_port_tuple,
33730
33731     &ett_ssid_list,
33732
33733     &ett_nintendo,
33734
33735     &ett_mikrotik,
33736
33737     &ett_meru,
33738
33739     &ett_qos_map_set_exception,
33740     &ett_qos_map_set_range,
33741
33742     /* 802.11ad trees */
33743     &ett_dynamic_alloc_tree,
33744     &ett_ssw_tree,
33745     &ett_bf_tree,
33746     &ett_sswf_tree,
33747     &ett_brp_tree,
33748     &ett_blm_tree,
33749     &ett_bic_tree,
33750     &ett_dmg_params_tree,
33751     &ett_cc_tree,
33752     &ett_rcsi_tree,
33753     &ett_80211_ext,
33754     &ett_allocation_tree,
33755     &ett_sta_info,
33756
33757     &ett_ieee80211_esp,
33758
33759     &ett_gas_resp_fragment,
33760     &ett_gas_resp_fragments,
33761
33762     /* 802.11ax trees */
33763     &ett_he_mac_capabilities,
33764     &ett_he_phy_capabilities,
33765     &ett_he_phy_cap_first_byte,
33766     &ett_he_phy_cap_chan_width_set,
33767     &ett_he_phy_cap_b8_to_b23,
33768     &ett_he_phy_cap_b24_to_b39,
33769     &ett_he_phy_cap_b40_to_b55,
33770     &ett_he_phy_cap_b56_to_b71,
33771     &ett_he_mcs_and_nss_set,
33772     &ett_he_rx_tx_he_mcs_map_lte_80,
33773     &ett_he_rx_mcs_map_lte_80,
33774     &ett_he_tx_mcs_map_lte_80,
33775     &ett_he_rx_tx_he_mcs_map_160,
33776     &ett_he_rx_mcs_map_160,
33777     &ett_he_tx_mcs_map_160,
33778     &ett_he_rx_tx_he_mcs_map_80_80,
33779     &ett_he_rx_mcs_map_80_80,
33780     &ett_he_tx_mcs_map_80_80,
33781     &ett_he_ppe_threshold,
33782     &ett_he_ppe_nss,
33783     &ett_he_ppe_ru_alloc,
33784     &ett_he_operation_params,
33785     &ett_he_oper_basic_mcs,
33786     &ett_he_operation_vht_op_info,
33787     &ett_he_mu_edca_param,
33788     &ett_he_uora_tree,
33789     &ett_he_spatial_reuse_control,
33790     &ett_he_ess_report_info_field,
33791     &ett_he_bss_new_color_info,
33792     &ett_he_trigger_common_info,
33793     &ett_he_trigger_base_common_info,
33794     &ett_he_trigger_bar_ctrl,
33795     &ett_he_trigger_bar_info,
33796     &ett_he_trigger_user_info,
33797     &ett_he_trigger_base_user_info,
33798     &ett_he_trigger_dep_basic_user_info,
33799     &ett_he_trigger_dep_nfrp_user_info,
33800     &ett_he_ndp_annc,
33801     &ett_he_ndp_annc_sta_list,
33802     &ett_he_ndp_annc_sta_item,
33803     &ett_he_ndp_annc_sta_info,
33804     &ett_ieee80211_3gpp_plmn,
33805   };
33806
33807   static ei_register_info ei[] = {
33808     { &ei_ieee80211_bad_length,
33809       { "ieee80211.bad_length", PI_MALFORMED, PI_ERROR,
33810         "Wrong length indicated", EXPFILL }},
33811
33812     { &ei_ieee80211_inv_val,
33813       { "ieee80211.invalid_value", PI_MALFORMED, PI_WARN,
33814         "Invalid value", EXPFILL }},
33815
33816     { &ei_ieee80211_tag_number,
33817       { "wlan.tag.number.unexpected_ie", PI_MALFORMED, PI_ERROR,
33818         "Unexpected Information Element ID", EXPFILL }},
33819
33820     { &ei_ieee80211_tag_length,
33821       { "wlan.tag.length.bad", PI_MALFORMED, PI_ERROR,
33822         "Bad tag length", EXPFILL }},
33823
33824     { &ei_ieee80211_extra_data,
33825       { "ieee80211.extra_data", PI_MALFORMED, PI_WARN,
33826         "Unexpected extra data in the end", EXPFILL }},
33827
33828     { &ei_ieee80211_ff_anqp_capability,
33829       { "wlan.fixed.anqp.capability.invalid", PI_MALFORMED, PI_ERROR,
33830         "Invalid vendor-specific ANQP capability", EXPFILL }},
33831
33832     { &ei_ieee80211_ff_anqp_venue_length,
33833       { "wlan.fixed.anqp.venue.length.invalid", PI_MALFORMED, PI_ERROR,
33834         "Invalid Venue Name Duple length", EXPFILL }},
33835
33836     { &ei_ieee80211_ff_anqp_roaming_consortium_oi_len,
33837       { "wlan.fixed.anqp.roaming_consortium.oi_len.invalid", PI_MALFORMED, PI_ERROR,
33838         "Invalid Roaming Consortium OI", EXPFILL }},
33839
33840     { &ei_ieee80211_ff_anqp_nai_field_len,
33841       { "wlan.fixed.anqp.nai_realm_list.field_len.invalid", PI_MALFORMED, PI_ERROR,
33842         "Invalid NAI Realm List", EXPFILL }},
33843
33844     { &ei_ieee80211_ff_anqp_nai_realm_eap_len,
33845       { "wlan.fixed.naqp_nai_realm_list.eap_method_len.invalid", PI_MALFORMED, PI_ERROR,
33846         "Invalid EAP Method subfield", EXPFILL }},
33847
33848     { &ei_hs20_anqp_ofn_length,
33849       { "wlan.hs20.anqp.ofn.length.invalid", PI_MALFORMED, PI_ERROR,
33850         "Invalid Operator Friendly Name Duple length", EXPFILL }},
33851
33852     { &ei_hs20_anqp_nai_hrq_length,
33853       { "wlan.hs20.anqp.nai_hrq.length.invalid", PI_MALFORMED, PI_ERROR,
33854         "Invalid NAI Home Realm Query length", EXPFILL }},
33855
33856     { &ei_ieee80211_ff_anqp_info_length,
33857       { "wlan.fixed.anqp.info_length.invalid", PI_MALFORMED, PI_ERROR,
33858         "Invalid ANQP Info length", EXPFILL }},
33859
33860     { &ei_ieee80211_not_enough_room_for_anqp_header,
33861       { "wlan.fixed.query_length_invalid", PI_MALFORMED, PI_ERROR,
33862         "Not enough room for ANQP header", EXPFILL }},
33863
33864     { &ei_ieee80211_ff_query_request_length,
33865       { "wlan.fixed.query_request_length.invalid", PI_MALFORMED, PI_ERROR,
33866         "Invalid Query Request Length", EXPFILL }},
33867
33868     { &ei_ieee80211_ff_query_response_length,
33869       { "wlan.fixed.query_response_length.invalid", PI_MALFORMED, PI_ERROR,
33870         "Invalid Query Response Length", EXPFILL }},
33871
33872     { &ei_ieee80211_tag_wnm_sleep_mode_no_key_data,
33873       { "wlan.wnm_sleep_mode.no_key_data", PI_MALFORMED, PI_ERROR,
33874         "WNM-Sleep Mode Response is not long enough to include Key Data", EXPFILL }},
33875
33876     { &ei_ieee80211_tdls_setup_response_malformed,
33877       { "wlan.tdls_setup_response_malformed", PI_MALFORMED, PI_ERROR,
33878         "TDLS Setup Response (success) does not include mandatory fields", EXPFILL }},
33879
33880     { &ei_ieee80211_tdls_setup_confirm_malformed,
33881       { "wlan.tdls_setup_confirm_malformed", PI_MALFORMED, PI_ERROR,
33882         "TDLS Setup Confirm (success) does not include mandatory fields", EXPFILL }},
33883
33884     { &ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype,
33885       { "wlan.wfa.ie.wme.qos_info.bad_ftype", PI_UNDECODED, PI_WARN,
33886         "Could not deduce direction to decode correctly", EXPFILL }},
33887
33888     { &ei_ieee80211_qos_info_bad_ftype,
33889       { "wlan.qos_info.bad_ftype", PI_UNDECODED, PI_WARN,
33890         "Could not deduce direction to decode correctly", EXPFILL }},
33891
33892     { &ei_ieee80211_qos_bad_aifsn,
33893       { "wlan.qos_info.bad_aifsn", PI_MALFORMED, PI_WARN,
33894         "Invalid AIFSN", EXPFILL }},
33895
33896     { &ei_ieee80211_rsn_pcs_count,
33897       { "wlan.rsn.pcs.count.invalid", PI_MALFORMED, PI_ERROR,
33898         "Pairwise Cipher Suite Count too large", EXPFILL }},
33899
33900     { &ei_ieee80211_rsn_pmkid_count,
33901       { "wlan.rsn.akms.count.invalid", PI_MALFORMED, PI_ERROR,
33902         "Auth Key Management (AKM) Suite Count too large", EXPFILL }},
33903
33904     { &ei_ieee80211_pmkid_count_too_large,
33905       { "wlan.rsn.pmkid.count.invalid", PI_MALFORMED, PI_ERROR,
33906         "PMKID Count too large", EXPFILL }},
33907
33908     { &ei_ieee80211_vht_tpe_pwr_info_count,
33909       { "wlan.vht.tpe.pwr_info.count.invalid", PI_MALFORMED, PI_ERROR,
33910         "Max Tx Pwr Count is Incorrect, should be 0-7", EXPFILL }},
33911
33912     { &ei_ieee80211_missing_data,
33913       { "ieee80211.missing_data", PI_MALFORMED, PI_WARN,
33914         "No Request subelements in TFS Request", EXPFILL }},
33915
33916     { &ei_ieee80211_fc_retry,
33917       { "wlan.fc.retry.expert", PI_SEQUENCE, PI_NOTE,
33918         "Retransmission (retry)", EXPFILL }},
33919
33920     { &ei_ieee80211_tag_measure_request_unknown,
33921       { "wlan.measure.req.unknown.expert", PI_UNDECODED, PI_WARN,
33922         "Undecoded Measurement Request type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
33923
33924     { &ei_ieee80211_tag_measure_request_beacon_unknown,
33925       { "wlan.measure.req.beacon.unknown.expert", PI_UNDECODED, PI_WARN,
33926         "Unknown Data (not interpreted)", EXPFILL }},
33927
33928     { &ei_ieee80211_tag_measure_report_unknown,
33929       { "wlan.measure.req.unknown.expert", PI_UNDECODED, PI_WARN,
33930         "Undecoded Measurement Report type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
33931
33932     { &ei_ieee80211_tag_data,
33933       { "wlan.tag.data.undecoded", PI_UNDECODED, PI_NOTE,
33934         "Dissector for 802.11 IE Tag code not implemented, Contact Wireshark developers if you want this supported", EXPFILL }},
33935
33936     { &ei_ieee80211_dmg_subtype,
33937       { "wlan.dmg_subtype.bad", PI_MALFORMED, PI_ERROR,
33938         "Bad DMG type/subtype", EXPFILL }},
33939
33940     { &ei_ieee80211_vht_action,
33941       { "wlan.vht.action.undecoded", PI_UNDECODED, PI_NOTE,
33942         "All subtype of VHT Action is not yet supported by Wireshark", EXPFILL }},
33943
33944     { &ei_ieee80211_mesh_peering_unexpected,
33945       { "wlan.peering.unexpected", PI_MALFORMED, PI_ERROR,
33946         "Unexpected Self-protected action", EXPFILL }},
33947
33948     { &ei_ieee80211_fcs,
33949       { "wlan.fcs.bad_checksum", PI_MALFORMED, PI_ERROR,
33950         "Bad checksum", EXPFILL }},
33951
33952     { &ei_ieee80211_mismatched_akm_suite,
33953       { "wlan.rsn.akms.mismatched", PI_PROTOCOL, PI_ERROR,
33954         "Mismatched AKMS", EXPFILL }},
33955   };
33956
33957   expert_module_t *expert_ieee80211;
33958
33959   module_t *wlan_module;
33960
33961   memset(&wlan_stats, 0, sizeof wlan_stats);
33962
33963   proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
33964       "IEEE 802.11 Aggregate Data", "wlan_aggregate");
33965   proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
33966
33967   proto_wlan = proto_register_protocol("IEEE 802.11 wireless LAN", "IEEE 802.11", "wlan");
33968   /* Created to remove Decode As confusion */
33969   proto_centrino = proto_register_protocol("IEEE 802.11 wireless LAN (Centrino)", "IEEE 802.11 (Centrino)", "wlan_centrino");
33970   proto_register_field_array(proto_wlan, hf, array_length(hf));
33971
33972   proto_wlan_ext = proto_register_protocol("IEEE 802.11 wireless LAN extension frame",
33973       "IEEE 802.11 EXT", "wlan_ext");
33974
33975   proto_register_subtree_array(tree_array, array_length(tree_array));
33976
33977   expert_ieee80211 = expert_register_protocol(proto_wlan);
33978   expert_register_field_array(expert_ieee80211, ei, array_length(ei));
33979
33980   ieee80211_handle = register_dissector("wlan", dissect_ieee80211,                    proto_wlan);
33981   register_dissector("wlan_withfcs",            dissect_ieee80211_withfcs,            proto_wlan);
33982   wlan_withoutfcs_handle = register_dissector("wlan_withoutfcs", dissect_ieee80211_withoutfcs, proto_wlan);
33983   register_dissector("wlan_bsfc",               dissect_ieee80211_bsfc,               proto_wlan);
33984   register_dissector("wlan_noqos",              dissect_ieee80211_noqos,              proto_wlan);
33985
33986   register_capture_dissector("ieee80211", capture_ieee80211, proto_wlan);
33987   register_capture_dissector("ieee80211_datapad", capture_ieee80211_datapad, proto_wlan);
33988
33989   reassembly_table_register(&wlan_reassembly_table,
33990                         &addresses_reassembly_table_functions);
33991   register_init_routine(wlan_retransmit_init);
33992   reassembly_table_register(&gas_reassembly_table,
33993                         &addresses_reassembly_table_functions);
33994
33995   wlan_tap = register_tap("wlan");
33996   register_conversation_table(proto_wlan, TRUE, wlan_conversation_packet, wlan_hostlist_packet);
33997
33998   wlan_address_type = address_type_dissector_register("AT_ETHER_WLAN", "WLAN Address", ether_to_str, ether_str_len, NULL, wlan_col_filter_str,
33999                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
34000   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,
34001                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
34002   set_address(&bssid_broadcast, wlan_bssid_address_type, 6, bssid_broadcast_data);
34003
34004   tagged_field_table = register_dissector_table("wlan.tag.number", "IEEE 802.11 Fields", proto_wlan, FT_UINT8, BASE_DEC);
34005   vendor_specific_action_table = register_dissector_table("wlan.action.vendor_specific", "IEEE802.11 Vendor Specific Action", proto_wlan, FT_UINT24, BASE_HEX);
34006   wifi_alliance_action_subtype_table = register_dissector_table("wlan.action.wifi_alliance.subtype", "Wi-Fi Alliance Action Subtype", proto_wlan, FT_UINT8, BASE_HEX);
34007   vendor_specific_anqp_info_table = register_dissector_table("wlan.anqp.vendor_specific", "IEEE802.11 ANQP information Vendor Specific", proto_wlan, FT_UINT24, BASE_HEX);
34008   wifi_alliance_anqp_info_table = register_dissector_table("wlan.anqp.wifi_alliance.subtype", "Wi-Fi Alliance ANQP Subtype", proto_wlan, FT_UINT8, BASE_HEX);
34009   wifi_alliance_ie_table = register_dissector_table("wlan.ie.wifi_alliance.subtype", "Wi-Fi Alliance IE Subtype", proto_wlan, FT_UINT8, BASE_HEX);
34010   wifi_alliance_public_action_table = register_dissector_table("wlan.pa.wifi_alliance.subtype", "Wi-Fi Alliance PA Subtype", proto_wlan, FT_UINT8, BASE_HEX);
34011
34012   /* Register configuration options */
34013   wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
34014   prefs_register_bool_preference(wlan_module, "defragment",
34015     "Reassemble fragmented 802.11 datagrams",
34016     "Whether fragmented 802.11 datagrams should be reassembled",
34017      &wlan_defragment);
34018
34019   prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
34020     "Ignore vendor-specific HT elements",
34021     "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
34022     &wlan_ignore_draft_ht);
34023
34024   prefs_register_bool_preference(wlan_module, "retransmitted",
34025     "Call subdissector for retransmitted 802.11 frames",
34026     "Whether retransmitted 802.11 frames should be subdissected",
34027     &wlan_subdissector);
34028
34029   prefs_register_bool_preference(wlan_module, "check_fcs",
34030     "Assume packets have FCS",
34031     "Some 802.11 cards include the FCS at the end of a packet, others do not.",
34032     &wlan_check_fcs);
34033
34034   prefs_register_bool_preference(wlan_module, "check_checksum",
34035     "Validate the FCS checksum if possible",
34036     "Whether to validate the FCS checksum or not.",
34037     &wlan_check_checksum);
34038
34039   prefs_register_enum_preference(wlan_module, "ignore_wep",
34040     "Ignore the Protection bit",
34041     "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
34042     "and some also leave the IV (initialization vector).",
34043     &wlan_ignore_prot, wlan_ignore_prot_options, TRUE);
34044
34045   prefs_register_uint_preference(wlan_module, "wpa_key_mic_len",
34046     "WPA Key MIC Length override",
34047     "Some Key MIC lengths are greater than 16 bytes, so set the length you require",
34048     10, &wlan_key_mic_len);
34049
34050   prefs_register_obsolete_preference(wlan_module, "wep_keys");
34051
34052   prefs_register_bool_preference(wlan_module, "enable_decryption",
34053     "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
34054     &enable_decryption);
34055
34056   wep_uat = uat_new("WEP and WPA Decryption Keys",
34057             sizeof(uat_wep_key_record_t), /* record size */
34058             "80211_keys",                 /* filename */
34059             TRUE,                         /* from_profile */
34060             &uat_wep_key_records,         /* data_ptr */
34061             &num_wepkeys_uat,             /* numitems_ptr */
34062             UAT_AFFECTS_DISSECTION,       /* affects dissection of packets, but not set of named fields */
34063             NULL,                         /* help. XXX Needs chapter in WSUG */
34064             uat_wep_key_record_copy_cb,   /* copy callback */
34065             uat_wep_key_record_update_cb, /* update callback */
34066             uat_wep_key_record_free_cb,   /* free callback */
34067             init_wepkeys,                 /* post update callback - update the WEP/WPA keys */
34068             NULL,                         /* reset callback */
34069             wep_uat_flds);                /* UAT field definitions */
34070
34071   prefs_register_uat_preference(wlan_module,
34072                                 "wep_key_table",
34073                                 "Decryption keys",
34074                                 "WEP and pre-shared WPA keys\n"
34075                                 "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
34076                                 "010203040506070809101111213 (104/128-bit WEP),\n"
34077                                 "MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
34078                                 "0102030405...6061626364 (WPA + 256-bit key)."
34079                                 "Invalid keys will be ignored.",
34080                                 wep_uat);
34081 }
34082
34083 void
34084 proto_register_wlan_rsna_eapol(void)
34085 {
34086
34087   static hf_register_info hf[] = {
34088     {&hf_wlan_rsna_eapol_wpa_keydes_msgnr,
34089      {"Message number", "wlan_rsna_eapol.keydes.msgnr",
34090       FT_UINT8, BASE_DEC, NULL, 0x0,
34091       NULL, HFILL }},
34092
34093     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo,
34094      {"Key Information", "wlan_rsna_eapol.keydes.key_info",
34095       FT_UINT16, BASE_HEX, NULL, 0x0,
34096       NULL, HFILL }},
34097
34098     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version,
34099      {"Key Descriptor Version", "wlan_rsna_eapol.keydes.key_info.keydes_version",
34100       FT_UINT16, BASE_DEC, VALS(keydes_version_vals), KEY_INFO_KEYDES_VERSION_MASK,
34101       NULL, HFILL }},
34102
34103     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type,
34104      {"Key Type", "wlan_rsna_eapol.keydes.key_info.key_type",
34105       FT_BOOLEAN, 16, TFS(&keyinfo_key_type_tfs), KEY_INFO_KEY_TYPE_MASK,
34106       NULL, HFILL }},
34107
34108     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index,
34109      {"Key Index", "wlan_rsna_eapol.keydes.key_info.key_index",
34110       FT_UINT16, BASE_DEC, NULL, KEY_INFO_KEY_INDEX_MASK,
34111       NULL, HFILL }},
34112
34113     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install,
34114      {"Install", "wlan_rsna_eapol.keydes.key_info.install",
34115       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_INSTALL_MASK,
34116       NULL, HFILL }},
34117
34118     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack,
34119      {"Key ACK", "wlan_rsna_eapol.keydes.key_info.key_ack",
34120       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_ACK_MASK,
34121       NULL, HFILL }},
34122
34123     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic,
34124      {"Key MIC", "wlan_rsna_eapol.keydes.key_info.key_mic",
34125       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_MIC_MASK,
34126       NULL, HFILL }},
34127
34128     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure,
34129      {"Secure", "wlan_rsna_eapol.keydes.key_info.secure",
34130       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_SECURE_MASK,
34131       NULL, HFILL }},
34132
34133     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error,
34134      {"Error", "wlan_rsna_eapol.keydes.key_info.error",
34135       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ERROR_MASK,
34136       NULL, HFILL }},
34137
34138     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request,
34139      {"Request", "wlan_rsna_eapol.keydes.key_info.request",
34140       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_REQUEST_MASK,
34141       NULL, HFILL }},
34142
34143     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data,
34144      {"Encrypted Key Data", "wlan_rsna_eapol.keydes.key_info.encrypted_key_data",
34145       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ENCRYPTED_KEY_DATA_MASK,
34146       NULL, HFILL }},
34147
34148     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
34149      {"SMK Message", "wlan_rsna_eapol.keydes.key_info.smk_message",
34150       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_SMK_MESSAGE_MASK,
34151       NULL, HFILL }},
34152
34153     {&hf_wlan_rsna_eapol_keydes_key_len,
34154      {"Key Length", "eapol.keydes.key_len",
34155       FT_UINT16, BASE_DEC, NULL, 0x0,
34156       NULL, HFILL }},
34157
34158     {&hf_wlan_rsna_eapol_keydes_replay_counter,
34159      {"Replay Counter", "eapol.keydes.replay_counter",
34160       FT_UINT64, BASE_DEC, NULL, 0x0,
34161       NULL, HFILL }},
34162
34163     {&hf_wlan_rsna_eapol_keydes_key_iv,
34164      {"Key IV", "eapol.keydes.key_iv",
34165       FT_BYTES, BASE_NONE, NULL, 0x0,
34166       NULL, HFILL }},
34167
34168     {&hf_wlan_rsna_eapol_wpa_keydes_nonce,
34169      {"WPA Key Nonce", "wlan_rsna_eapol.keydes.nonce",
34170       FT_BYTES, BASE_NONE, NULL, 0x0,
34171       NULL, HFILL }},
34172
34173     {&hf_wlan_rsna_eapol_wpa_keydes_rsc,
34174      {"WPA Key RSC", "wlan_rsna_eapol.keydes.rsc",
34175       FT_BYTES, BASE_NONE, NULL, 0x0,
34176       NULL, HFILL }},
34177
34178     {&hf_wlan_rsna_eapol_wpa_keydes_id,
34179      {"WPA Key ID", "wlan_rsna_eapol.keydes.id",
34180       FT_BYTES, BASE_NONE, NULL, 0x0,
34181       NULL, HFILL }},
34182
34183     {&hf_wlan_rsna_eapol_wpa_keydes_mic,
34184      {"WPA Key MIC", "wlan_rsna_eapol.keydes.mic",
34185       FT_BYTES, BASE_NONE, NULL, 0x0,
34186       NULL, HFILL }},
34187
34188     {&hf_wlan_rsna_eapol_wpa_keydes_data_len,
34189      {"WPA Key Data Length", "wlan_rsna_eapol.keydes.data_len",
34190       FT_UINT16, BASE_DEC, NULL, 0x0,
34191       NULL, HFILL }},
34192
34193     {&hf_wlan_rsna_eapol_wpa_keydes_data,
34194      {"WPA Key Data", "wlan_rsna_eapol.keydes.data",
34195       FT_BYTES, BASE_NONE, NULL, 0x0,
34196       NULL, HFILL }},
34197   };
34198
34199   static gint *tree_array[] = {
34200     &ett_keyinfo,
34201     &ett_wlan_rsna_eapol_keydes_data,
34202   };
34203
34204   proto_wlan_rsna_eapol = proto_register_protocol("IEEE 802.11 RSNA EAPOL key",
34205       "802.11 RSNA EAPOL", "wlan_rsna_eapol");
34206   proto_register_field_array(proto_wlan_rsna_eapol, hf, array_length(hf));
34207
34208   proto_register_subtree_array(tree_array, array_length(tree_array));
34209 }
34210
34211 void
34212 proto_reg_handoff_ieee80211(void)
34213 {
34214   dissector_handle_t data_encap_handle, centrino_handle;
34215   dissector_handle_t wlan_rsna_eapol_wpa_key_handle, wlan_rsna_eapol_rsn_key_handle;
34216   capture_dissector_handle_t ieee80211_cap_handle;
34217
34218   /*
34219    * Get handles for the LLC, IPX and Ethernet  dissectors.
34220    */
34221   llc_handle            = find_dissector_add_dependency("llc", proto_wlan);
34222   ipx_handle            = find_dissector_add_dependency("ipx", proto_wlan);
34223   eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_wlan);
34224
34225   llc_cap_handle = find_capture_dissector("llc");
34226   ipx_cap_handle = find_capture_dissector("ipx");
34227
34228   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
34229
34230   centrino_handle = create_dissector_handle( dissect_ieee80211_centrino, proto_centrino );
34231   dissector_add_uint("ethertype", ETHERTYPE_CENTRINO_PROMISC, centrino_handle);
34232
34233   ieee80211_cap_handle = find_capture_dissector("ieee80211");
34234   capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_cap_handle);
34235   capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_WITH_RADIO, ieee80211_cap_handle);
34236   capture_dissector_add_uint("ppi", 105 /* DLT_DLT_IEEE802_11 */, ieee80211_cap_handle);
34237
34238   /* Register handoff to Aruba GRE */
34239   dissector_add_uint("gre.proto", GRE_ARUBA_8200, wlan_withoutfcs_handle);
34240   dissector_add_uint("gre.proto", GRE_ARUBA_8210, wlan_withoutfcs_handle);
34241   dissector_add_uint("gre.proto", GRE_ARUBA_8220, wlan_withoutfcs_handle);
34242   dissector_add_uint("gre.proto", GRE_ARUBA_8230, wlan_withoutfcs_handle);
34243   dissector_add_uint("gre.proto", GRE_ARUBA_8240, wlan_withoutfcs_handle);
34244   dissector_add_uint("gre.proto", GRE_ARUBA_8250, wlan_withoutfcs_handle);
34245   dissector_add_uint("gre.proto", GRE_ARUBA_8260, wlan_withoutfcs_handle);
34246   dissector_add_uint("gre.proto", GRE_ARUBA_8270, wlan_withoutfcs_handle);
34247   dissector_add_uint("gre.proto", GRE_ARUBA_8280, wlan_withoutfcs_handle);
34248   dissector_add_uint("gre.proto", GRE_ARUBA_8290, wlan_withoutfcs_handle);
34249   dissector_add_uint("gre.proto", GRE_ARUBA_82A0, wlan_withoutfcs_handle);
34250   dissector_add_uint("gre.proto", GRE_ARUBA_82B0, wlan_withoutfcs_handle);
34251   dissector_add_uint("gre.proto", GRE_ARUBA_82C0, wlan_withoutfcs_handle);
34252   dissector_add_uint("gre.proto", GRE_ARUBA_82D0, wlan_withoutfcs_handle);
34253   dissector_add_uint("gre.proto", GRE_ARUBA_82E0, wlan_withoutfcs_handle);
34254   dissector_add_uint("gre.proto", GRE_ARUBA_82F0, wlan_withoutfcs_handle);
34255   dissector_add_uint("gre.proto", GRE_ARUBA_8300, wlan_withoutfcs_handle);
34256   dissector_add_uint("gre.proto", GRE_ARUBA_8310, wlan_withoutfcs_handle);
34257   dissector_add_uint("gre.proto", GRE_ARUBA_8320, wlan_withoutfcs_handle);
34258   dissector_add_uint("gre.proto", GRE_ARUBA_8330, wlan_withoutfcs_handle);
34259   dissector_add_uint("gre.proto", GRE_ARUBA_8340, wlan_withoutfcs_handle);
34260   dissector_add_uint("gre.proto", GRE_ARUBA_8350, wlan_withoutfcs_handle);
34261   dissector_add_uint("gre.proto", GRE_ARUBA_8360, wlan_withoutfcs_handle);
34262   dissector_add_uint("gre.proto", GRE_ARUBA_8370, wlan_withoutfcs_handle);
34263
34264   data_encap_handle = create_dissector_handle(dissect_data_encap, proto_wlan);
34265   dissector_add_uint("ethertype", ETHERTYPE_IEEE80211_DATA_ENCAP,
34266                 data_encap_handle);
34267
34268   /*
34269    * EAPOL key descriptor types.
34270    */
34271   wlan_rsna_eapol_wpa_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
34272                                                                proto_wlan_rsna_eapol);
34273   dissector_add_uint("eapol.keydes.type", EAPOL_WPA_KEY, wlan_rsna_eapol_wpa_key_handle);
34274   wlan_rsna_eapol_rsn_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
34275                                                                proto_wlan_rsna_eapol);
34276   dissector_add_uint("eapol.keydes.type", EAPOL_RSN_KEY, wlan_rsna_eapol_rsn_key_handle);
34277
34278   dissector_add_uint("sflow_245.header_protocol", SFLOW_5_HEADER_80211_MAC, wlan_withoutfcs_handle);
34279
34280   /* Tagged fields */
34281   /* XXX - for now, do it without pinos so the protocol is -1 */
34282   dissector_add_uint("wlan.tag.number", TAG_SSID, create_dissector_handle(ieee80211_tag_ssid, -1));
34283   dissector_add_uint("wlan.tag.number", TAG_SUPP_RATES, create_dissector_handle(ieee80211_tag_supp_rates, -1));
34284   dissector_add_uint("wlan.tag.number", TAG_FH_PARAMETER, create_dissector_handle(ieee80211_tag_fh_parameter, -1));
34285   dissector_add_uint("wlan.tag.number", TAG_DS_PARAMETER, create_dissector_handle(ieee80211_tag_ds_parameter, -1));
34286   dissector_add_uint("wlan.tag.number", TAG_CF_PARAMETER, create_dissector_handle(ieee80211_tag_cf_parameter, -1));
34287   dissector_add_uint("wlan.tag.number", TAG_TIM, create_dissector_handle(ieee80211_tag_tim, -1));
34288   dissector_add_uint("wlan.tag.number", TAG_IBSS_PARAMETER, create_dissector_handle(ieee80211_tag_ibss_parameter, -1));
34289   dissector_add_uint("wlan.tag.number", TAG_COUNTRY_INFO, create_dissector_handle(ieee80211_tag_country_info, -1));
34290   dissector_add_uint("wlan.tag.number", TAG_FH_HOPPING_PARAMETER, create_dissector_handle(ieee80211_tag_fh_hopping_parameter, -1));
34291   dissector_add_uint("wlan.tag.number", TAG_FH_HOPPING_TABLE, create_dissector_handle(ieee80211_tag_fh_hopping_table, -1));
34292   dissector_add_uint("wlan.tag.number", TAG_REQUEST, create_dissector_handle(ieee80211_tag_request, -1));
34293   dissector_add_uint("wlan.tag.number", TAG_QBSS_LOAD, create_dissector_handle(ieee80211_tag_qbss_load, -1));
34294   dissector_add_uint("wlan.tag.number", TAG_EDCA_PARAM_SET, create_dissector_handle(ieee80211_tag_edca_param_set, -1));
34295   dissector_add_uint("wlan.tag.number", TAG_TSPEC, create_dissector_handle(ieee80211_tag_tspec, -1));
34296   dissector_add_uint("wlan.tag.number", TAG_TCLAS, create_dissector_handle(ieee80211_tag_tclas, -1));
34297   dissector_add_uint("wlan.tag.number", TAG_SCHEDULE, create_dissector_handle(ieee80211_tag_schedule, -1));
34298   dissector_add_uint("wlan.tag.number", TAG_CHALLENGE_TEXT, create_dissector_handle(ieee80211_tag_challenge_text, -1));
34299   dissector_add_uint("wlan.tag.number", TAG_POWER_CONSTRAINT, create_dissector_handle(ieee80211_tag_power_constraint, -1));
34300   dissector_add_uint("wlan.tag.number", TAG_POWER_CAPABILITY, create_dissector_handle(ieee80211_tag_power_capability, -1));
34301   dissector_add_uint("wlan.tag.number", TAG_TPC_REQUEST, create_dissector_handle(ieee80211_tag_tpc_request, -1));
34302   dissector_add_uint("wlan.tag.number", TAG_TPC_REPORT, create_dissector_handle(ieee80211_tag_tpc_report, -1));
34303   dissector_add_uint("wlan.tag.number", TAG_SUPPORTED_CHANNELS, create_dissector_handle(ieee80211_tag_supported_channels, -1));
34304   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_ANN, create_dissector_handle(ieee80211_tag_switch_ann, -1));
34305   dissector_add_uint("wlan.tag.number", TAG_MEASURE_REQ, create_dissector_handle(ieee80211_tag_measure_req, -1));
34306   dissector_add_uint("wlan.tag.number", TAG_MEASURE_REP, create_dissector_handle(ieee80211_tag_measure_rep, -1));
34307   dissector_add_uint("wlan.tag.number", TAG_QUIET, create_dissector_handle(ieee80211_tag_quiet, -1));
34308   dissector_add_uint("wlan.tag.number", TAG_IBSS_DFS, create_dissector_handle(ieee80211_tag_ibss_dfs, -1));
34309   dissector_add_uint("wlan.tag.number", TAG_ERP_INFO, create_dissector_handle(ieee80211_tag_erp_info, -1));
34310   dissector_add_uint("wlan.tag.number", TAG_ERP_INFO_OLD, create_dissector_handle(ieee80211_tag_erp_info, -1));
34311   dissector_add_uint("wlan.tag.number", TAG_TS_DELAY, create_dissector_handle(ieee80211_tag_ts_delay, -1));
34312   dissector_add_uint("wlan.tag.number", TAG_TCLAS_PROCESS, create_dissector_handle(ieee80211_tag_tclas_process, -1));
34313   dissector_add_uint("wlan.tag.number", TAG_QOS_CAPABILITY, create_dissector_handle(ieee80211_tag_qos_capability, -1));
34314   dissector_add_uint("wlan.tag.number", TAG_RSN_IE, create_dissector_handle(ieee80211_tag_rsn_ie, -1));
34315   dissector_add_uint("wlan.tag.number", TAG_EXT_SUPP_RATES, create_dissector_handle(ieee80211_tag_ext_supp_rates, -1));
34316   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_CAPABILITIES, create_dissector_handle(dissect_extended_capabilities_ie, -1));
34317   dissector_add_uint("wlan.tag.number", TAG_CISCO_CCX1_CKIP, create_dissector_handle(ieee80211_tag_cisco_ccx1_ckip, -1));
34318   dissector_add_uint("wlan.tag.number", TAG_VHT_CAPABILITY, create_dissector_handle(dissect_vht_capability_ie, -1));
34319   dissector_add_uint("wlan.tag.number", TAG_VHT_OPERATION, create_dissector_handle(dissect_vht_operation_ie, -1));
34320   dissector_add_uint("wlan.tag.number", TAG_EXT_BSS_LOAD, create_dissector_handle(dissect_ext_bss_load, -1));
34321   dissector_add_uint("wlan.tag.number", TAG_WIDE_BW_CHANNEL_SWITCH, create_dissector_handle(dissect_wide_bw_channel_switch, -1));
34322   dissector_add_uint("wlan.tag.number", TAG_VHT_TX_PWR_ENVELOPE, create_dissector_handle(dissect_vht_tx_pwr_envelope, -1));
34323   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_WRAPPER, create_dissector_handle(dissect_channel_switch_wrapper, -1));
34324   dissector_add_uint("wlan.tag.number", TAG_OPERATING_MODE_NOTIFICATION, create_dissector_handle(dissect_operating_mode_notification, -1));
34325   /* 7.3.2.26 Vendor Specific information element (221) */
34326   dissector_add_uint("wlan.tag.number", TAG_VENDOR_SPECIFIC_IE, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
34327   /* This Cisco proprietary IE seems to mimic 221 */
34328   dissector_add_uint("wlan.tag.number", TAG_CISCO_VENDOR_SPECIFIC, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
34329   /* This Symbol proprietary IE seems to mimic 221 */
34330   dissector_add_uint("wlan.tag.number", TAG_SYMBOL_PROPRIETARY, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
34331   dissector_add_uint("wlan.tag.number", TAG_MOBILITY_DOMAIN, create_dissector_handle(dissect_mobility_domain, -1));
34332   dissector_add_uint("wlan.tag.number", TAG_FAST_BSS_TRANSITION, create_dissector_handle(dissect_fast_bss_transition, -1));
34333   dissector_add_uint("wlan.tag.number", TAG_MMIE, create_dissector_handle(dissect_mmie, -1));
34334   dissector_add_uint("wlan.tag.number", TAG_SSID_LIST, create_dissector_handle(dissect_ssid_list, -1));
34335   dissector_add_uint("wlan.tag.number", TAG_TIME_ZONE, create_dissector_handle(dissect_time_zone, -1));
34336   dissector_add_uint("wlan.tag.number", TAG_TIMEOUT_INTERVAL, create_dissector_handle(dissect_timeout_interval, -1));
34337   dissector_add_uint("wlan.tag.number", TAG_RIC_DATA, create_dissector_handle(dissect_ric_data, -1));
34338   dissector_add_uint("wlan.tag.number", TAG_LINK_IDENTIFIER, create_dissector_handle(dissect_link_identifier, -1));
34339   dissector_add_uint("wlan.tag.number", TAG_WAKEUP_SCHEDULE, create_dissector_handle(dissect_wakeup_schedule, -1));
34340   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_TIMING, create_dissector_handle(dissect_channel_switch_timing, -1));
34341   dissector_add_uint("wlan.tag.number", TAG_PTI_CONTROL, create_dissector_handle(dissect_pti_control, -1));
34342   dissector_add_uint("wlan.tag.number", TAG_PU_BUFFER_STATUS, create_dissector_handle(dissect_pu_buffer_status, -1));
34343   dissector_add_uint("wlan.tag.number", TAG_HT_CAPABILITY, create_dissector_handle(dissect_ht_capability_ie, -1));
34344   dissector_add_uint("wlan.tag.number", TAG_HT_INFO, create_dissector_handle(dissect_ht_info_ie_1_1, -1));
34345   dissector_add_uint("wlan.tag.number", TAG_SECONDARY_CHANNEL_OFFSET, create_dissector_handle(dissect_secondary_channel_offset_ie, -1));
34346   dissector_add_uint("wlan.tag.number", TAG_BSS_AVG_ACCESS_DELAY, create_dissector_handle(dissect_bss_avg_access_delay_ie, -1));
34347   dissector_add_uint("wlan.tag.number", TAG_ANTENNA, create_dissector_handle(dissect_antenna_ie, -1));
34348   dissector_add_uint("wlan.tag.number", TAG_RSNI, create_dissector_handle(dissect_rsni_ie, -1));
34349   dissector_add_uint("wlan.tag.number", TAG_MEASURE_PILOT_TRANS, create_dissector_handle(dissect_measurement_pilot_trans_ie, -1));
34350   dissector_add_uint("wlan.tag.number", TAG_BSS_AVB_ADM_CAPACITY, create_dissector_handle(dissect_bss_available_admission_capacity_ie, -1));
34351   dissector_add_uint("wlan.tag.number", TAG_IE_68_CONFLICT, create_dissector_handle(ieee80211_tag_ie_68_conflict, -1));
34352   dissector_add_uint("wlan.tag.number", TAG_BSS_MAX_IDLE_PERIOD, create_dissector_handle(dissect_bss_max_idle_period, -1));
34353   dissector_add_uint("wlan.tag.number", TAG_TFS_REQUEST, create_dissector_handle(dissect_tfs_request, -1));
34354   dissector_add_uint("wlan.tag.number", TAG_TFS_RESPONSE, create_dissector_handle(dissect_tfs_response, -1));
34355   dissector_add_uint("wlan.tag.number", TAG_WNM_SLEEP_MODE, create_dissector_handle(dissect_wnm_sleep_mode, -1));
34356   dissector_add_uint("wlan.tag.number", TAG_TIME_ADV, create_dissector_handle(dissect_time_adv, -1));
34357   dissector_add_uint("wlan.tag.number", TAG_RM_ENABLED_CAPABILITY, create_dissector_handle(dissect_rm_enabled_capabilities_ie, -1));
34358   dissector_add_uint("wlan.tag.number", TAG_20_40_BSS_CO_EX, create_dissector_handle(dissect_20_40_bss_coexistence, -1));
34359   dissector_add_uint("wlan.tag.number", TAG_OVERLAP_BSS_SCAN_PAR, create_dissector_handle(dissect_overlap_bss_scan_par, -1));
34360   dissector_add_uint("wlan.tag.number", TAG_RIC_DESCRIPTOR, create_dissector_handle(dissect_ric_descriptor, -1));
34361   dissector_add_uint("wlan.tag.number", TAG_MESH_PEERING_MGMT, create_dissector_handle(ieee80211_tag_mesh_peering_mgmt, -1));
34362   dissector_add_uint("wlan.tag.number", TAG_MESH_CONFIGURATION, create_dissector_handle(ieee80211_tag_mesh_configuration, -1));
34363   dissector_add_uint("wlan.tag.number", TAG_MESH_ID, create_dissector_handle(ieee80211_tag_mesh_id, -1));
34364   dissector_add_uint("wlan.tag.number", TAG_MESH_PREQ, create_dissector_handle(ieee80211_tag_mesh_preq, -1));
34365   dissector_add_uint("wlan.tag.number", TAG_MESH_PREP, create_dissector_handle(ieee80211_tag_mesh_prep, -1));
34366   dissector_add_uint("wlan.tag.number", TAG_MESH_PERR, create_dissector_handle(ieee80211_tag_mesh_perr, -1));
34367   dissector_add_uint("wlan.tag.number", TAG_RANN, create_dissector_handle(ieee80211_tag_rann, -1));
34368   dissector_add_uint("wlan.tag.number", TAG_MESH_CHANNEL_SWITCH, create_dissector_handle(ieee80211_tag_mesh_channel_switch, -1));
34369   dissector_add_uint("wlan.tag.number", TAG_INTERWORKING, create_dissector_handle(dissect_interworking, -1));
34370   dissector_add_uint("wlan.tag.number", TAG_ADVERTISEMENT_PROTOCOL, create_dissector_handle(dissect_advertisement_protocol, -1));
34371   dissector_add_uint("wlan.tag.number", TAG_QOS_MAP_SET, create_dissector_handle(dissect_qos_map_set, -1));
34372   dissector_add_uint("wlan.tag.number", TAG_ROAMING_CONSORTIUM, create_dissector_handle(dissect_roaming_consortium, -1));
34373   dissector_add_uint("wlan.tag.number", TAG_AP_CHANNEL_REPORT, create_dissector_handle(dissect_ap_channel_report, -1));
34374   dissector_add_uint("wlan.tag.number", TAG_NEIGHBOR_REPORT, create_dissector_handle(dissect_neighbor_report, -1));
34375   dissector_add_uint("wlan.tag.number", TAG_MESH_AWAKE_WINDOW, create_dissector_handle(ieee80211_tag_mesh_awake_window, -1));
34376   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, create_dissector_handle(ieee80211_tag_channel_switch_announcement, -1));
34377   dissector_add_uint("wlan.tag.number", TAG_SUPPORTED_OPERATING_CLASSES, create_dissector_handle(ieee80211_tag_supported_operating_classes, -1));
34378   dissector_add_uint("wlan.tag.number", TAG_RELAY_CAPABILITIES, create_dissector_handle(add_tag_relay_capabilities, -1));
34379   dissector_add_uint("wlan.tag.number", TAG_DMG_BSS_PARAMETER_CHANGE, create_dissector_handle(ieee80211_tag_bss_parameter_change, -1));
34380   dissector_add_uint("wlan.tag.number", TAG_DMG_CAPABILITIES, create_dissector_handle(ieee80211_tag_dmg_capabilities, -1));
34381   dissector_add_uint("wlan.tag.number", TAG_DMG_OPERATION, create_dissector_handle(ieee80211_tag_dmg_operation, -1));
34382   dissector_add_uint("wlan.tag.number", TAG_ANTENNA_SECTOR_ID, create_dissector_handle(ieee80211_tag_antenna_section_id, -1));
34383   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_SCHEDULE, create_dissector_handle(ieee80211_tag_extended_schedule, -1));
34384   dissector_add_uint("wlan.tag.number", TAG_STA_AVAILABILITY, create_dissector_handle(ieee80211_tag_sta_availability, -1));
34385   dissector_add_uint("wlan.tag.number", TAG_NEXT_DMG_ATI, create_dissector_handle(ieee80211_tag_next_dmg_ati, -1));
34386   dissector_add_uint("wlan.tag.number", TAG_NEXTPCP_LIST, create_dissector_handle(ieee80211_tag_nextpcp_list, -1));
34387   dissector_add_uint("wlan.tag.number", TAG_PCP_HANDOVER, create_dissector_handle(ieee80211_tag_pcp_handover, -1));
34388   dissector_add_uint("wlan.tag.number", TAG_BEAMLINK_MAINTENANCE, create_dissector_handle(ieee80211_tag_beamlink_maintenance, -1));
34389   dissector_add_uint("wlan.tag.number", TAG_QUIET_PERIOD_RES, create_dissector_handle(ieee80211_tag_quiet_period_res, -1));
34390   dissector_add_uint("wlan.tag.number", TAG_RELAY_TRANSFER_PARAM, create_dissector_handle(ieee80211_tag_relay_transfer_param, -1));
34391   dissector_add_uint("wlan.tag.number", TAG_DMG_BEAM_REFINEMENT, create_dissector_handle(ieee80211_tag_dmg_beam_refinement, -1));
34392   dissector_add_uint("wlan.tag.number", TAG_WAKEUP_SCHEDULE_AD, create_dissector_handle(ieee80211_tag_wakeup_schedule_ad, -1));
34393   dissector_add_uint("wlan.tag.number", TAG_DMG_TSPEC, create_dissector_handle(ieee80211_tag_dmg_tspec, -1));
34394   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_MEASURMENT_FB, create_dissector_handle(ieee80211_tag_channel_measurement_fb, -1));
34395   dissector_add_uint("wlan.tag.number", TAG_AWAKE_WINDOW, create_dissector_handle(ieee80211_tag_awake_window, -1));
34396   dissector_add_uint("wlan.tag.number", TAG_ADDBA_EXT, create_dissector_handle(ieee80211_tag_addba_ext, -1));
34397   dissector_add_uint("wlan.tag.number", TAG_MULTI_BAND, create_dissector_handle(ieee80211_tag_multi_band, -1));
34398   dissector_add_uint("wlan.tag.number", TAG_DMG_LINK_MARGIN, create_dissector_handle(ieee80211_tag_dmg_link_margin, -1));
34399   dissector_add_uint("wlan.tag.number", TAG_DMG_LINK_ADAPTION_ACK, create_dissector_handle(ieee80211_tag_dmg_link_adaption_ack, -1));
34400   dissector_add_uint("wlan.tag.number", TAG_SWITCHING_STREAM, create_dissector_handle(ieee80211_tag_switching_stream, -1));
34401   dissector_add_uint("wlan.tag.number", TAG_ELEMENT_ID_EXTENSION, create_dissector_handle(ieee80211_tag_element_id_extension, -1));
34402
34403   /* Vendor specific actions */
34404   dissector_add_uint("wlan.action.vendor_specific", OUI_MARVELL, create_dissector_handle(dissect_vendor_action_marvell, -1));
34405   dissector_add_uint("wlan.action.vendor_specific", OUI_WFA, create_dissector_handle(dissect_vendor_action_wifi_alliance, -1));
34406
34407   dissector_add_uint("wlan.anqp.vendor_specific", OUI_WFA, create_dissector_handle(dissect_vendor_wifi_alliance_anqp, -1));
34408   dissector_add_uint("wlan.anqp.wifi_alliance.subtype", WFA_SUBTYPE_HS20_ANQP, create_dissector_handle(dissect_hs20_anqp, -1));
34409   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_SUBSCRIPTION_REMEDIATION, create_dissector_handle(dissect_hs20_subscription_remediation, -1));
34410   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_DEAUTHENTICATION_IMMINENT, create_dissector_handle(dissect_hs20_deauthentication_imminent, -1));
34411   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_HS20_INDICATION, create_dissector_handle(dissect_hs20_indication, -1));
34412   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_OSEN, create_dissector_handle(dissect_hs20_osen, -1));
34413 }
34414
34415 /*
34416  * Editor modelines
34417  *
34418  * Local Variables:
34419  * c-basic-offset: 2
34420  * tab-width: 8
34421  * indent-tabs-mode: nil
34422  * End:
34423  *
34424  * ex: set shiftwidth=2 tabstop=8 expandtab:
34425  * :indentSize=2:tabSize=8:noTabs=true:
34426  */