Fix 802.11ax fields.
[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_vs_aerohive_unknown = -1;
4643 static int hf_ieee80211_vs_aerohive_hostname_length = -1;
4644 static int hf_ieee80211_vs_aerohive_hostname = -1;
4645 static int hf_ieee80211_vs_aerohive_data = -1;
4646
4647 static int hf_ieee80211_rsn_ie_pmkid = -1;
4648 static int hf_ieee80211_rsn_ie_unknown = -1;
4649
4650 static int hf_ieee80211_marvell_ie_type = -1;
4651 static int hf_ieee80211_marvell_ie_mesh_subtype = -1;
4652 static int hf_ieee80211_marvell_ie_mesh_version = -1;
4653 static int hf_ieee80211_marvell_ie_mesh_active_proto_id = -1;
4654 static int hf_ieee80211_marvell_ie_mesh_active_metric_id = -1;
4655 static int hf_ieee80211_marvell_ie_mesh_cap = -1;
4656 static int hf_ieee80211_marvell_ie_data = -1;
4657
4658 static int hf_ieee80211_atheros_ie_type = -1;
4659 static int hf_ieee80211_atheros_ie_subtype = -1;
4660 static int hf_ieee80211_atheros_ie_version = -1;
4661 static int hf_ieee80211_atheros_ie_cap_f_turbop = -1;
4662 static int hf_ieee80211_atheros_ie_cap_f_comp = -1;
4663 static int hf_ieee80211_atheros_ie_cap_f_ff = -1;
4664 static int hf_ieee80211_atheros_ie_cap_f_xr = -1;
4665 static int hf_ieee80211_atheros_ie_cap_f_ar = -1;
4666 static int hf_ieee80211_atheros_ie_cap_f_burst = -1;
4667 static int hf_ieee80211_atheros_ie_cap_f_wme = -1;
4668 static int hf_ieee80211_atheros_ie_cap_f_boost = -1;
4669 static int hf_ieee80211_atheros_ie_advcap_cap = -1;
4670 static int hf_ieee80211_atheros_ie_advcap_defkey = -1;
4671 static int hf_ieee80211_atheros_ie_xr_info = -1;
4672 static int hf_ieee80211_atheros_ie_xr_base_bssid = -1;
4673 static int hf_ieee80211_atheros_ie_xr_xr_bssid = -1;
4674 static int hf_ieee80211_atheros_ie_xr_xr_beacon = -1;
4675 static int hf_ieee80211_atheros_ie_xr_base_cap = -1;
4676 static int hf_ieee80211_atheros_ie_xr_xr_cap = -1;
4677 static int hf_ieee80211_atheros_ie_data = -1;
4678
4679 /*QBSS - Version 1,2,802.11e*/
4680
4681 static int hf_ieee80211_qbss2_cal = -1;
4682 static int hf_ieee80211_qbss2_gl = -1;
4683 static int hf_ieee80211_qbss_cu = -1;
4684 static int hf_ieee80211_qbss2_cu = -1;
4685 static int hf_ieee80211_qbss_scount = -1;
4686 static int hf_ieee80211_qbss2_scount = -1;
4687 static int hf_ieee80211_qbss_version = -1;
4688 static int hf_ieee80211_qbss_adc = -1;
4689
4690 static int hf_ieee80211_tsinfo = -1;
4691 static int hf_ieee80211_tsinfo_type = -1;
4692 static int hf_ieee80211_tsinfo_tsid = -1;
4693 static int hf_ieee80211_tsinfo_dir = -1;
4694 static int hf_ieee80211_tsinfo_access = -1;
4695 static int hf_ieee80211_tsinfo_agg = -1;
4696 static int hf_ieee80211_tsinfo_apsd = -1;
4697 static int hf_ieee80211_tsinfo_up = -1;
4698 static int hf_ieee80211_tsinfo_ack = -1;
4699 static int hf_ieee80211_tsinfo_sched = -1;
4700 static int hf_ieee80211_tsinfo_rsv = -1;
4701
4702 static const int *ieee80211_tsinfo_fields[] = {
4703   &hf_ieee80211_tsinfo_type,
4704   &hf_ieee80211_tsinfo_tsid,
4705   &hf_ieee80211_tsinfo_dir,
4706   &hf_ieee80211_tsinfo_access,
4707   &hf_ieee80211_tsinfo_agg,
4708   &hf_ieee80211_tsinfo_apsd,
4709   &hf_ieee80211_tsinfo_up,
4710   &hf_ieee80211_tsinfo_ack,
4711   &hf_ieee80211_tsinfo_sched,
4712   &hf_ieee80211_tsinfo_rsv,
4713   NULL
4714 };
4715
4716 static int hf_ieee80211_tspec_nor_msdu = -1;
4717 static int hf_ieee80211_tspec_max_msdu = -1;
4718 static int hf_ieee80211_tspec_min_srv = -1;
4719 static int hf_ieee80211_tspec_max_srv = -1;
4720 static int hf_ieee80211_tspec_inact_int = -1;
4721 static int hf_ieee80211_tspec_susp_int = -1;
4722 static int hf_ieee80211_tspec_srv_start = -1;
4723 static int hf_ieee80211_tspec_min_data = -1;
4724 static int hf_ieee80211_tspec_mean_data = -1;
4725 static int hf_ieee80211_tspec_peak_data = -1;
4726 static int hf_ieee80211_tspec_burst_size = -1;
4727 static int hf_ieee80211_tspec_delay_bound = -1;
4728 static int hf_ieee80211_tspec_min_phy = -1;
4729 static int hf_ieee80211_tspec_surplus = -1;
4730 static int hf_ieee80211_tspec_medium = -1;
4731 static int hf_ieee80211_tspec_dmg = -1;
4732 static int hf_ieee80211_ts_delay = -1;
4733 static int hf_ieee80211_tclas_process = -1;
4734 static int hf_ieee80211_tag_ext_supp_rates = -1;
4735 static int hf_ieee80211_sched_info = -1;
4736 static int hf_ieee80211_sched_info_agg = -1;
4737 static int hf_ieee80211_sched_info_tsid = -1;
4738 static int hf_ieee80211_sched_info_dir = -1;
4739 static int hf_ieee80211_sched_srv_start = -1;
4740 static int hf_ieee80211_sched_srv_int = -1;
4741 static int hf_ieee80211_sched_spec_int = -1;
4742 static int hf_ieee80211_tclas_up = -1;
4743 static int hf_ieee80211_tclas_class_type = -1;
4744 static int hf_ieee80211_tclas_class_mask = -1;
4745 static int hf_ieee80211_tclas_class_mask0_src_addr = -1;
4746 static int hf_ieee80211_tclas_class_mask0_dst_addr = -1;
4747 static int hf_ieee80211_tclas_class_mask0_type = -1;
4748 static int hf_ieee80211_tclas_class_mask1_ver = -1;
4749 static int hf_ieee80211_tclas_class_mask1_src_ip = -1;
4750 static int hf_ieee80211_tclas_class_mask1_dst_ip = -1;
4751 static int hf_ieee80211_tclas_class_mask1_src_port = -1;
4752 static int hf_ieee80211_tclas_class_mask1_dst_port = -1;
4753 static int hf_ieee80211_tclas_class_mask1_ipv4_dscp = -1;
4754 static int hf_ieee80211_tclas_class_mask1_ipv4_proto = -1;
4755 static int hf_ieee80211_tclas_class_mask1_ipv6_flow = -1;
4756 static int hf_ieee80211_tclas_class_mask2_tci = -1;
4757 static int hf_ieee80211_tclas_src_mac_addr = -1;
4758 static int hf_ieee80211_tclas_dst_mac_addr = -1;
4759 static int hf_ieee80211_tclas_ether_type = -1;
4760 static int hf_ieee80211_tclas_version = -1;
4761 static int hf_ieee80211_tclas_ipv4_src = -1;
4762 static int hf_ieee80211_tclas_ipv4_dst = -1;
4763 static int hf_ieee80211_tclas_src_port = -1;
4764 static int hf_ieee80211_tclas_dst_port = -1;
4765 static int hf_ieee80211_tclas_dscp = -1;
4766 static int hf_ieee80211_tclas_protocol = -1;
4767 static int hf_ieee80211_tclas_ipv6_src = -1;
4768 static int hf_ieee80211_tclas_ipv6_dst = -1;
4769 static int hf_ieee80211_tclas_flow = -1;
4770 static int hf_ieee80211_tclas_tag_type = -1;
4771
4772 static int hf_ieee80211_aruba = -1;
4773 static int hf_ieee80211_aruba_hb_seq = -1;
4774 static int hf_ieee80211_aruba_mtu = -1;
4775
4776 static int hf_ieee80211_tag_vendor_oui_type = -1;
4777 static int hf_ieee80211_tag_vendor_data = -1;
4778
4779 /* IEEE Std 802.11z-2010 7.3.2.62 */
4780 static int hf_ieee80211_tag_link_id_bssid = -1;
4781 static int hf_ieee80211_tag_link_id_init_sta = -1;
4782 static int hf_ieee80211_tag_link_id_resp_sta = -1;
4783
4784 /* IEEE Std 802.11z-2010 7.3.2.63 */
4785 static int hf_ieee80211_tag_wakeup_schedule_offset = -1;
4786 static int hf_ieee80211_tag_wakeup_schedule_interval = -1;
4787 static int hf_ieee80211_tag_wakeup_schedule_awake_window_slots = -1;
4788 static int hf_ieee80211_tag_wakeup_schedule_max_awake_dur = -1;
4789 static int hf_ieee80211_tag_wakeup_schedule_idle_count = -1;
4790
4791 /* IEEE Std 802.11z-2010 7.3.2.64 */
4792 static int hf_ieee80211_tag_channel_switch_timing_switch_time = -1;
4793 static int hf_ieee80211_tag_channel_switch_timing_switch_timeout = -1;
4794
4795 /* IEEE Std 802.11z-2010 7.3.2.65 */
4796 static int hf_ieee80211_tag_pti_control_tid = -1;
4797 static int hf_ieee80211_tag_pti_control_sequence_control = -1;
4798
4799 /* IEEE Std 802.11z-2010 7.3.2.66 */
4800 static int hf_ieee80211_tag_pu_buffer_status_ac_bk = -1;
4801 static int hf_ieee80211_tag_pu_buffer_status_ac_be = -1;
4802 static int hf_ieee80211_tag_pu_buffer_status_ac_vi = -1;
4803 static int hf_ieee80211_tag_pu_buffer_status_ac_vo = -1;
4804
4805 /* IEEE Std 802.11r-2008 7.3.2.49 */
4806 static int hf_ieee80211_tag_timeout_int_type = -1;
4807 static int hf_ieee80211_tag_timeout_int_value = -1;
4808
4809 /* Ethertype 89-0d */
4810 static int hf_ieee80211_data_encap_payload_type = -1;
4811
4812 static int hf_ieee80211_anqp_wfa_subtype = -1;
4813
4814 static int hf_ieee80211_dpp_subtype = -1;
4815
4816 /* Hotspot 2.0 */
4817 static int hf_hs20_indication_dgaf_disabled = -1;
4818 static int hf_hs20_indication_pps_mo_id_present = -1;
4819 static int hf_hs20_indication_anqp_domain_id_present = -1;
4820 static int hf_hs20_reserved = -1;
4821 static int hf_hs20_indication_release_number = -1;
4822 static int hf_hs20_indication_pps_mo_id = -1;
4823 static int hf_hs20_indication_anqp_domain_id = -1;
4824
4825 static int hf_hs20_anqp_subtype = -1;
4826 static int hf_hs20_anqp_reserved = -1;
4827 static int hf_hs20_anqp_payload = -1;
4828 static int hf_hs20_anqp_hs_query_list = -1;
4829 static int hf_hs20_anqp_hs_capability_list = -1;
4830 static int hf_hs20_anqp_ofn_length = -1;
4831 static int hf_hs20_anqp_ofn_language = -1;
4832 static int hf_hs20_anqp_ofn_name = -1;
4833 static int hf_hs20_anqp_wan_metrics_link_status = -1;
4834 static int hf_hs20_anqp_wan_metrics_symmetric_link = -1;
4835 static int hf_hs20_anqp_wan_metrics_at_capacity = -1;
4836 static int hf_hs20_anqp_wan_metrics_reserved = -1;
4837 static int hf_hs20_anqp_wan_metrics_downlink_speed = -1;
4838 static int hf_hs20_anqp_wan_metrics_uplink_speed = -1;
4839 static int hf_hs20_anqp_wan_metrics_downlink_load = -1;
4840 static int hf_hs20_anqp_wan_metrics_uplink_load = -1;
4841 static int hf_hs20_anqp_wan_metrics_lmd = -1;
4842 static int hf_hs20_anqp_cc_proto_ip_proto = -1;
4843 static int hf_hs20_anqp_cc_proto_port_num = -1;
4844 static int hf_hs20_anqp_cc_proto_status = -1;
4845 static int hf_hs20_anqp_nai_hrq_count = -1;
4846 static int hf_hs20_anqp_nai_hrq_encoding_type = -1;
4847 static int hf_hs20_anqp_nai_hrq_length = -1;
4848 static int hf_hs20_anqp_nai_hrq_realm_name = -1;
4849 static int hf_hs20_anqp_oper_class_indic = -1;
4850 static int hf_hs20_osu_friendly_names_len = -1;
4851 static int hf_hs20_osu_friendly_name_length = -1;
4852 static int hf_hs20_osu_friendly_name_language = -1;
4853 static int hf_hs20_osu_friendly_name_name = -1;
4854 static int hf_hs20_osu_server_uri_len = -1;
4855 static int hf_hs20_osu_server_uri = -1;
4856 static int hf_hs20_osu_method_list_len = -1;
4857 static int hf_hs20_osu_method_val = -1;
4858 static int hf_hs20_icons_avail_len = -1;
4859 static int hf_hs20_osu_providers_list_ssid_len = -1;
4860 static int hf_hs20_osu_providers_ssid = -1;
4861 static int hf_hs20_osu_providers_count = -1;
4862 static int hf_hs20_osu_prov_length = -1;
4863 static int hf_hs20_icon_request_filename = -1;
4864 static int hf_hs20_icon_binary_file_status = -1;
4865 static int hf_hs20_icon_type_length = -1;
4866 static int hf_hs20_icon_type = -1;
4867 static int hf_hs20_icon_binary_data_len = -1;
4868 static int hf_hs20_icon_binary_data = -1;
4869 static int hf_osu_icon_avail_width = -1;
4870 static int hf_osu_icon_avail_height = -1;
4871 static int hf_osu_icon_avail_lang_code = -1;
4872 static int hf_osu_icon_avail_icon_type_len = -1;
4873 static int hf_osu_icon_avail_icon_type = -1;
4874 static int hf_osu_icon_avail_filename_len = -1;
4875 static int hf_osu_icon_avail_filename = -1;
4876 static int hf_hs20_osu_nai_len = -1;
4877 static int hf_hs20_osu_nai = -1;
4878 static int hf_hs20_osu_service_desc_len = -1;
4879 static int hf_hs20_osu_service_desc_duple_len = -1;
4880 static int hf_hs20_osu_service_desc_lang = -1;
4881 static int hf_hs20_osu_service_desc = -1;
4882 static int hf_hs20_anqp_venue_url_length = -1;
4883 static int hf_hs20_anqp_venue_number = -1;
4884 static int hf_hs20_anqp_venue_url = -1;
4885 static int hf_hs20_anqp_advice_of_charge_length = -1;
4886 static int hf_hs20_anqp_advice_of_charge_type = -1;
4887 static int hf_hs20_anqp_aoc_nai_realm_encoding = -1;
4888 static int hf_hs20_anqp_aoc_nai_realm_len = -1;
4889 static int hf_hs20_anqp_aoc_nai_realm = -1;
4890 static int hf_hs20_anqp_aoc_plan_len = -1;
4891 static int hf_hs20_anqp_aoc_plan_lang = -1;
4892 static int hf_hs20_anqp_aoc_plan_curcy = -1;
4893 static int hf_hs20_anqp_aoc_plan_information = -1;
4894
4895 static int hf_hs20_subscription_remediation_url_len = -1;
4896 static int hf_hs20_subscription_remediation_server_url = -1;
4897 static int hf_hs20_subscription_remediation_server_method = -1;
4898 static int hf_hs20_deauth_reason_code = -1;
4899 static int hf_hs20_reauth_delay = -1;
4900 static int hf_hs20_deauth_reason_url_len = -1;
4901 static int hf_hs20_deauth_imminent_reason_url = -1;
4902
4903 /* IEEE Std 802.11ad */
4904 static int hf_ieee80211_block_ack_RBUFCAP = -1;
4905 static int hf_ieee80211_cf_response_offset = -1;
4906 static int hf_ieee80211_grant_ack_reserved = -1;
4907 static int hf_ieee80211_ff_dynamic_allocation = -1;
4908 static int hf_ieee80211_ff_TID = -1;
4909 static int hf_ieee80211_ff_alloc_type = -1;
4910 static int hf_ieee80211_ff_src_aid = -1;
4911 static int hf_ieee80211_ff_dest_aid = -1;
4912 static int hf_ieee80211_ff_alloc_duration = -1;
4913 static int hf_ieee80211_ff_b39 = -1;
4914 static int hf_ieee80211_ff_ssw = -1;
4915 static int hf_ieee80211_ff_ssw_direction = -1;
4916 static int hf_ieee80211_ff_ssw_cdown = -1;
4917 static int hf_ieee80211_ff_ssw_sector_id = -1;
4918 static int hf_ieee80211_ff_ssw_dmg_ant_id = -1;
4919 static int hf_ieee80211_ff_ssw_rxss_len = -1;
4920 static int hf_ieee80211_ff_bf = -1;
4921 static int hf_ieee80211_ff_bf_train = -1;
4922 static int hf_ieee80211_ff_bf_is_init = -1;
4923 static int hf_ieee80211_ff_bf_is_resp = -1;
4924 static int hf_ieee80211_ff_bf_num_sectors = -1;
4925 static int hf_ieee80211_ff_bf_num_rx_dmg_ants = -1;
4926 static int hf_ieee80211_ff_bf_b12b15 = -1;
4927 static int hf_ieee80211_ff_bf_rxss_len = -1;
4928 static int hf_ieee80211_ff_bf_rxss_rate = -1;
4929 static int hf_ieee80211_ff_bf_b10b15 = -1;
4930 static int hf_ieee80211_addr_nav_da = -1;
4931 static int hf_ieee80211_addr_nav_sa = -1;
4932 static int hf_ieee80211_ff_sswf = -1;
4933 static int hf_ieee80211_ff_sswf_num_rx_dmg_ants = -1;
4934 static int hf_ieee80211_ff_sswf_poll_required = -1;
4935 static int hf_ieee80211_ff_sswf_total_sectors = -1;
4936 static int hf_ieee80211_ff_sswf_reserved1 = -1;
4937 static int hf_ieee80211_ff_sswf_reserved2 = -1;
4938 static int hf_ieee80211_ff_sswf_sector_select = -1;
4939 static int hf_ieee80211_ff_sswf_dmg_antenna_select = -1;
4940 static int hf_ieee80211_ff_sswf_snr_report = -1;
4941 static int hf_ieee80211_ff_brp = -1;
4942 static int hf_ieee80211_ff_brp_L_RX = -1;
4943 static int hf_ieee80211_ff_brp_TX_TRN_REQ = -1;
4944 static int hf_ieee80211_ff_brp_MID_REQ = -1;
4945 static int hf_ieee80211_ff_brp_BC_REQ = -1;
4946 static int hf_ieee80211_ff_brp_MID_GRANT = -1;
4947 static int hf_ieee80211_ff_brp_BC_GRANT = -1;
4948 static int hf_ieee80211_ff_brp_chan_FBCK_CAP = -1;
4949 static int hf_ieee80211_ff_brp_tx_sector = -1;
4950 static int hf_ieee80211_ff_brp_other_aid = -1;
4951 static int hf_ieee80211_ff_brp_tx_antenna = -1;
4952 static int hf_ieee80211_ff_brp_reserved = -1;
4953 static int hf_ieee80211_ff_blm = -1;
4954 static int hf_ieee80211_ff_blm_unit_index = -1;
4955 static int hf_ieee80211_ff_blm_maint_value = -1;
4956 static int hf_ieee80211_ff_blm_is_master = -1;
4957 static int hf_ieee80211_ff_bic = -1;
4958 static int hf_ieee80211_ff_bic_cc_present = -1;
4959 static int hf_ieee80211_ff_bic_discovery_mode = -1;
4960 static int hf_ieee80211_ff_bic_next_beacon = -1;
4961 static int hf_ieee80211_ff_bic_ati_present = -1;
4962 static int hf_ieee80211_ff_bic_abft_len = -1;
4963 static int hf_ieee80211_ff_bic_fss = -1;
4964 static int hf_ieee80211_ff_bic_is_resp = -1;
4965 static int hf_ieee80211_ff_bic_next_abft = -1;
4966 static int hf_ieee80211_ff_bic_frag_txss = -1;
4967 static int hf_ieee80211_ff_bic_txss_span = -1;
4968 static int hf_ieee80211_ff_bic_NBI_abft = -1;
4969 static int hf_ieee80211_ff_bic_abft_count = -1;
4970 static int hf_ieee80211_ff_bic_nabft = -1;
4971 static int hf_ieee80211_ff_bic_pcp = -1;
4972 static int hf_ieee80211_ff_bic_reserved = -1;
4973 static const int *ieee80211_ff_bic_fields[] = {
4974   &hf_ieee80211_ff_bic_cc_present,
4975   &hf_ieee80211_ff_bic_discovery_mode,
4976   &hf_ieee80211_ff_bic_next_beacon,
4977   &hf_ieee80211_ff_bic_ati_present,
4978   &hf_ieee80211_ff_bic_abft_len,
4979   &hf_ieee80211_ff_bic_fss,
4980   &hf_ieee80211_ff_bic_is_resp,
4981   &hf_ieee80211_ff_bic_next_abft,
4982   &hf_ieee80211_ff_bic_frag_txss,
4983   &hf_ieee80211_ff_bic_txss_span,
4984   &hf_ieee80211_ff_bic_NBI_abft,
4985   &hf_ieee80211_ff_bic_abft_count,
4986   &hf_ieee80211_ff_bic_nabft,
4987   &hf_ieee80211_ff_bic_pcp,
4988   &hf_ieee80211_ff_bic_reserved,
4989   NULL
4990 };
4991 static int hf_ieee80211_ff_dmg_params = -1;
4992 static int hf_ieee80211_ff_dmg_params_bss = -1;
4993 static int hf_ieee80211_ff_dmg_params_cbap_only = -1;
4994 static int hf_ieee80211_ff_dmg_params_cbap_src = -1;
4995 static int hf_ieee80211_ff_dmg_params_privacy = -1;
4996 static int hf_ieee80211_ff_dmg_params_policy = -1;
4997 static int hf_ieee80211_ff_cc = -1;
4998 static int hf_ieee80211_ff_cc_abft_resp_addr = -1;
4999 static int hf_ieee80211_ff_cc_sp_duration = -1;
5000 static int hf_ieee80211_ff_cc_cluster_id = -1;
5001 static int hf_ieee80211_ff_cc_role = -1;
5002 static int hf_ieee80211_ff_cc_max_mem = -1;
5003 static int hf_ieee80211_ff_dmg_action_code = -1;
5004 static int hf_ieee80211_ff_dmg_pwr_mgmt = -1;
5005 static int hf_ieee80211_ff_subject_address = -1;
5006 static int hf_ieee80211_ff_handover_reason = -1;
5007 static int hf_ieee80211_ff_handover_remaining_bi = -1;
5008 static int hf_ieee80211_ff_handover_result = -1;
5009 static int hf_ieee80211_ff_handover_reject_reason = -1;
5010 static int hf_ieee80211_ff_destination_reds_aid = -1;
5011 static int hf_ieee80211_ff_destination_aid = -1;
5012 static int hf_ieee80211_ff_realy_aid = -1;
5013 static int hf_ieee80211_ff_source_aid = -1;
5014 static int hf_ieee80211_ff_timing_offset = -1;
5015 static int hf_ieee80211_ff_sampling_frequency_offset = -1;
5016 static int hf_ieee80211_ff_relay_operation_type = -1;
5017 static int hf_ieee80211_ff_peer_sta_aid = -1;
5018 static int hf_ieee80211_ff_snr = -1;
5019 static int hf_ieee80211_ff_internal_angle = -1;
5020 static int hf_ieee80211_ff_recommend = -1;
5021 static int hf_ieee80211_ff_unprotected_dmg_action_code = -1;
5022 static int hf_ieee80211_ff_fst_action_code = -1;
5023 static int hf_ieee80211_ff_llt = -1;
5024 static int hf_ieee80211_ff_fsts_id = -1;
5025 static int hf_ieee80211_ff_mmpdu_len = -1;
5026 static int hf_ieee80211_ff_mmpdu_ctrl = -1;
5027 static int hf_ieee80211_ff_oct_mmpdu = -1;
5028 #if 0
5029 static int hf_ieee80211_ff_rcsi = -1;
5030 static int hf_ieee80211_ff_rcsi_aid = -1;
5031 #endif
5032 static int hf_ieee80211_ff_band_id = -1;
5033 static int hf_ieee80211_tag_relay_support = -1;
5034 static int hf_ieee80211_tag_relay_use = -1;
5035 static int hf_ieee80211_tag_relay_permission = -1;
5036 static int hf_ieee80211_tag_AC_power = -1;
5037 static int hf_ieee80211_tag_relay_prefer = -1;
5038 static int hf_ieee80211_tag_duplex = -1;
5039 static int hf_ieee80211_tag_cooperation = -1;
5040 static int hf_ieee80211_tag_move = -1;
5041 static int hf_ieee80211_tag_size = -1;
5042 static int hf_ieee80211_tag_tbtt_offset = -1;
5043 static int hf_ieee80211_tag_bi_duration = -1;
5044 static int hf_ieee80211_tag_dmg_capa_sta_addr = -1;
5045 static int hf_ieee80211_tag_dmg_capa_aid = -1;
5046 static int hf_ieee80211_tag_reverse_direction = -1;
5047 static int hf_ieee80211_tag_hlts = -1;
5048 static int hf_ieee80211_tag_tpc = -1;
5049 static int hf_ieee80211_tag_spsh = -1;
5050 static int hf_ieee80211_tag_rx_antenna = -1;
5051 static int hf_ieee80211_tag_fast_link = -1;
5052 static int hf_ieee80211_tag_num_sectors = -1;
5053 static int hf_ieee80211_tag_rxss_length = -1;
5054 static int hf_ieee80211_tag_reciprocity = -1;
5055 static int hf_ieee80211_tag_max_ampdu_exp = -1;
5056 static int hf_ieee80211_tag_min_mpdu_spacing = -1;
5057 static int hf_ieee80211_tag_ba_flow_control = -1;
5058 static int hf_ieee80211_tag_max_sc_rx_mcs = -1;
5059 static int hf_ieee80211_tag_max_ofdm_rx_mcs = -1;
5060 static int hf_ieee80211_tag_max_sc_tx_mcs = -1;
5061 static int hf_ieee80211_tag_max_ofdm_tx_mcs = -1;
5062 static int hf_ieee80211_tag_low_power_supported = -1;
5063 static int hf_ieee80211_tag_code_rate = -1;
5064 static int hf_ieee80211_tag_dtp = -1;
5065 static int hf_ieee80211_tag_appdu_supp = -1;
5066 static int hf_ieee80211_tag_heartbeat = -1;
5067 static int hf_ieee80211_tag_other_aid = -1;
5068 static int hf_ieee80211_tag_pattern_recip = -1;
5069 static int hf_ieee80211_tag_heartbeat_elapsed = -1;
5070 static int hf_ieee80211_tag_grant_ack_supp = -1;
5071 static int hf_ieee80211_tag_RXSSTxRate_supp = -1;
5072 static int hf_ieee80211_tag_pcp_tddti = -1;
5073 static int hf_ieee80211_tag_pcp_PSA = -1;
5074 static int hf_ieee80211_tag_pcp_handover = -1;
5075 static int hf_ieee80211_tag_pcp_max_assoc = -1;
5076 static int hf_ieee80211_tag_pcp_power_src = -1;
5077 static int hf_ieee80211_tag_pcp_decenter = -1;
5078 static int hf_ieee80211_tag_pcp_forwarding = -1;
5079 static int hf_ieee80211_tag_pcp_center = -1;
5080 static int hf_ieee80211_tag_sta_beam_track = -1;
5081 static int hf_ieee80211_tag_ext_sc_mcs_max_tx = -1;
5082 static int hf_ieee80211_tag_ext_sc_mcs_tx_code_7_8 = -1;
5083 static int hf_ieee80211_tag_ext_sc_mcs_max_rx = -1;
5084 static int hf_ieee80211_tag_ext_sc_mcs_rx_code_7_8 = -1;
5085 static int hf_ieee80211_tag_max_basic_sf_amsdu = -1;
5086 static int hf_ieee80211_tag_max_short_sf_amsdu = -1;
5087 static int hf_ieee80211_tag_PSRSI = -1;
5088 static int hf_ieee80211_tag_min_BHI_duration = -1;
5089 static int hf_ieee80211_tag_brdct_sta_info_dur = -1;
5090 static int hf_ieee80211_tag_assoc_resp_confirm_time = -1;
5091 static int hf_ieee80211_tag_min_pp_duration = -1;
5092 static int hf_ieee80211_tag_SP_idle_timeout = -1;
5093 static int hf_ieee80211_tag_max_lost_beacons = -1;
5094 static int hf_ieee80211_tag_type = -1;
5095 static int hf_ieee80211_tag_tap1 = -1;
5096 static int hf_ieee80211_tag_state1 = -1;
5097 static int hf_ieee80211_tag_tap2 = -1;
5098 static int hf_ieee80211_tag_state2 = -1;
5099 static int hf_ieee80211_tag_allocation_id = -1;
5100 static int hf_ieee80211_tag_allocation_type = -1;
5101 static int hf_ieee80211_tag_pseudo_static = -1;
5102 static int hf_ieee80211_tag_truncatable = -1;
5103 static int hf_ieee80211_tag_extendable = -1;
5104 static int hf_ieee80211_tag_pcp_active = -1;
5105 static int hf_ieee80211_tag_lp_sc_used = -1;
5106 static int hf_ieee80211_tag_src_aid = -1;
5107 static int hf_ieee80211_tag_dest_aid = -1;
5108 static int hf_ieee80211_tag_alloc_start = -1;
5109 static int hf_ieee80211_tag_alloc_block_duration = -1;
5110 static int hf_ieee80211_tag_num_blocks = -1;
5111 static int hf_ieee80211_tag_alloc_block_period = -1;
5112 static int hf_ieee80211_tag_aid = -1;
5113 static int hf_ieee80211_tag_cbap = -1;
5114 static int hf_ieee80211_tag_pp_avail = -1;
5115 static int hf_ieee80211_tag_next_ati_start_time = -1;
5116 static int hf_ieee80211_tag_next_ati_duration = -1;
5117 static int hf_ieee80211_tag_old_bssid = -1;
5118 static int hf_ieee80211_tag_new_pcp_addr = -1;
5119 static int hf_ieee80211_tag_bssid = -1;
5120 static int hf_ieee80211_tag_duplex_relay = -1;
5121 static int hf_ieee80211_tag_cooperation_relay = -1;
5122 static int hf_ieee80211_tag_tx_mode = -1;
5123 static int hf_ieee80211_tag_link_change_interval = -1;
5124 static int hf_ieee80211_tag_data_sensing_time = -1;
5125 static int hf_ieee80211_tag_first_period = -1;
5126 static int hf_ieee80211_tag_second_period = -1;
5127 static int hf_ieee80211_tag_initiator = -1;
5128 static int hf_ieee80211_tag_tx_train_res = -1;
5129 static int hf_ieee80211_tag_rx_train_res = -1;
5130 static int hf_ieee80211_tag_tx_trn_ok = -1;
5131 static int hf_ieee80211_tag_txss_fbck_req = -1;
5132 static int hf_ieee80211_tag_bs_fbck = -1;
5133 static int hf_ieee80211_tag_bs_fbck_antenna_id = -1;
5134 static int hf_ieee80211_tag_snr_requested = -1;
5135 static int hf_ieee80211_tag_channel_measurement_requested = -1;
5136 static int hf_ieee80211_tag_number_of_taps_requested = -1;
5137 static int hf_ieee80211_tag_sector_id_order_req = -1;
5138 static int hf_ieee80211_tag_snr_present = -1;
5139 static int hf_ieee80211_tag_channel_measurement_present = -1;
5140 static int hf_ieee80211_tag_tap_delay_present = -1;
5141 static int hf_ieee80211_tag_number_of_taps_present = -1;
5142 static int hf_ieee80211_tag_number_of_measurement = -1;
5143 static int hf_ieee80211_tag_sector_id_order_present = -1;
5144 static int hf_ieee80211_tag_number_of_beams = -1;
5145 static int hf_ieee80211_tag_mid_extension = -1;
5146 static int hf_ieee80211_tag_capability_request = -1;
5147 static int hf_ieee80211_tag_beam_refine_reserved = -1;
5148 static int hf_ieee80211_tag_nextpcp_list = -1;
5149 static int hf_ieee80211_tag_nextpcp_token = -1;
5150 static int hf_ieee80211_tag_reamaining_BI = -1;
5151 static int hf_ieee80211_tag_request_token = -1;
5152 static int hf_ieee80211_tag_bi_start_time = -1;
5153 static int hf_ieee80211_tag_sleep_cycle = -1;
5154 static int hf_ieee80211_tag_num_awake_bis = -1;
5155 static int hf_ieee80211_tag_tspec_allocation_id = -1;
5156 static int hf_ieee80211_tag_tspec_allocation_type = -1;
5157 static int hf_ieee80211_tag_tspec_allocation_format = -1;
5158 static int hf_ieee80211_tag_tspec_pseudo_static = -1;
5159 static int hf_ieee80211_tag_tspec_truncatable = -1;
5160 static int hf_ieee80211_tag_tspec_extendable = -1;
5161 static int hf_ieee80211_tag_tspec_lp_sc_used = -1;
5162 static int hf_ieee80211_tag_tspec_up = -1;
5163 static int hf_ieee80211_tag_tspec_dest_aid = -1;
5164 static int hf_ieee80211_tag_tspec_allocation_period = -1;
5165 static int hf_ieee80211_tag_tspec_min_allocation = -1;
5166 static int hf_ieee80211_tag_tspec_max_allocation = -1;
5167 static int hf_ieee80211_tag_tspec_min_duration = -1;
5168 static int hf_ieee80211_tag_tspec_num_of_constraints = -1;
5169 static int hf_ieee80211_tag_tspec_tsconst_start_time = -1;
5170 static int hf_ieee80211_tag_tspec_tsconst_duration = -1;
5171 static int hf_ieee80211_tag_tspec_tsconst_period = -1;
5172 static int hf_ieee80211_tag_tspec_tsconst_interferer_mac = -1;
5173 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_I = -1;
5174 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_Q = -1;
5175 static int hf_ieee80211_tag_channel_measurement_feedback_tap_delay = -1;
5176 static int hf_ieee80211_tag_channel_measurement_feedback_sector_id = -1;
5177 static int hf_ieee80211_tag_channel_measurement_feedback_antenna_id = -1;
5178 static int hf_ieee80211_tag_awake_window = -1;
5179 static int hf_ieee80211_tag_addba_ext_no_frag = -1;
5180 static int hf_ieee80211_tag_addba_ext_he_fragmentation_operation = -1;
5181 static int hf_ieee80211_tag_addba_ext_reserved = -1;
5182 static int hf_ieee80211_tag_multi_band_ctrl_sta_role = -1;
5183 static int hf_ieee80211_tag_multi_band_ctrl_addr_present = -1;
5184 static int hf_ieee80211_tag_multi_band_ctrl_cipher_present = -1;
5185 static int hf_ieee80211_tag_multi_band_oper_class = -1;
5186 static int hf_ieee80211_tag_multi_band_channel_number = -1;
5187 static int hf_ieee80211_tag_multi_band_tsf_offset = -1;
5188 static int hf_ieee80211_tag_multi_band_conn_ap = -1;
5189 static int hf_ieee80211_tag_multi_band_conn_pcp = -1;
5190 static int hf_ieee80211_tag_multi_band_conn_dls = -1;
5191 static int hf_ieee80211_tag_multi_band_conn_tdls = -1;
5192 static int hf_ieee80211_tag_multi_band_conn_ibss = -1;
5193 static int hf_ieee80211_tag_multi_band_fst_timeout = -1;
5194 static int hf_ieee80211_tag_multi_band_sta_mac = -1;
5195 static int hf_ieee80211_tag_activity = -1;
5196 static int hf_ieee80211_tag_dmg_link_adapt_mcs = -1;
5197 static int hf_ieee80211_tag_dmg_link_adapt_link_margin = -1;
5198 static int hf_ieee80211_tag_ref_timestamp = -1;
5199 static int hf_ieee80211_tag_switching_stream_non_qos = -1;
5200 static int hf_ieee80211_tag_switching_stream_param_num = -1;
5201 static int hf_ieee80211_tag_switching_stream_old_tid = -1;
5202 static int hf_ieee80211_tag_switching_stream_old_direction = -1;
5203 static int hf_ieee80211_tag_switching_stream_new_tid = -1;
5204 static int hf_ieee80211_tag_switching_stream_new_direction = -1;
5205 static int hf_ieee80211_tag_switching_stream_new_valid_id = -1;
5206 static int hf_ieee80211_tag_switching_stream_llt_type = -1;
5207
5208 static int hf_ieee80211_mysterious_olpc_stuff = -1;
5209
5210 static int hf_ieee80211_esp_access_category = -1;
5211 static int hf_ieee80211_esp_reserved = -1;
5212 static int hf_ieee80211_esp_data_format = -1;
5213 static int hf_ieee80211_esp_ba_windows_size = -1;
5214 static int hf_ieee80211_esp_est_air_time_frac = -1;
5215 static int hf_ieee80211_esp_data_ppdu_duration_target = -1;
5216 static int hf_ieee80211_estimated_service_params = -1;
5217
5218 static int hf_ieee80211_fcg_new_channel_number = -1;
5219 static int hf_ieee80211_fcg_extra_info = -1;
5220
5221 static int hf_ieee80211_ext_tag = -1;
5222 static int hf_ieee80211_ext_tag_number = -1;
5223 static int hf_ieee80211_ext_tag_length = -1;
5224 static int hf_ieee80211_fils_session = -1;
5225 static int hf_ieee80211_fils_wrapped_data = -1;
5226 static int hf_ieee80211_fils_nonce = -1;
5227
5228 /* ************************************************************************* */
5229 /*                              802.11AX fields                              */
5230 /* ************************************************************************* */
5231 static int hf_he_mac_capabilities = -1;
5232 static int hf_he_htc_he_support = -1;
5233 static int hf_he_twt_requester_support = -1;
5234 static int hf_he_twt_responder_support = -1;
5235 static int hf_he_fragmentation_support = -1;
5236 static int hf_he_max_number_fragmented_msdus = -1;
5237 static int hf_he_min_fragment_size = -1;
5238 static int hf_he_trigger_frame_mac_padding_dur = -1;
5239 static int hf_he_multi_tid_aggregation_support = -1;
5240 static int hf_he_he_link_adaptation_support = -1;
5241 static int hf_he_all_ack_support = -1;
5242 static int hf_he_umrs_support = -1;
5243 static int hf_he_bsr_support = -1;
5244 static int hf_he_broadcast_twt_support = -1;
5245 static int hf_he_32_bit_ba_bitmap_support = -1;
5246 static int hf_he_mu_cascading_support = -1;
5247 static int hf_he_ack_enabled_aggregation_support = -1;
5248 static int hf_he_group_addressed_multi_sta_blkack_support = -1;
5249 static int hf_he_om_control_support = -1;
5250 static int hf_he_ofdma_ra_support = -1;
5251 static int hf_he_max_a_mpdu_length_exponent = -1;
5252 static int hf_he_a_msdu_fragmentation_support = -1;
5253 static int hf_he_flexible_twt_schedule_support = -1;
5254 static int hf_he_rx_control_frame_to_multibss = -1;
5255 static int hf_he_bsrp_bqrp_a_mpdu_aggregation = -1;
5256 static int hf_he_qtp_support = -1;
5257 static int hf_he_bqr_support = -1;
5258 static int hf_he_sr_responder = -1;
5259 static int hf_he_ndp_feedback_report_support = -1;
5260 static int hf_he_ops_support = -1;
5261 static int hf_he_a_msdu_in_a_mpdu_support = -1;
5262 static int hf_he_reserved = -1;
5263 static int hf_he_reserved_bit_18 = -1;
5264 static int hf_he_reserved_bit_19 = -1;
5265 static int hf_he_reserved_bit_25 = -1;
5266 static int hf_he_reserved_bits_5_7 = -1;
5267 static int hf_he_reserved_bits_8_9 = -1;
5268 static int hf_he_reserved_bits_15_16 = -1;
5269 static int hf_he_phy_chan_width_set = -1;
5270 static int hf_he_40mhz_channel_2_4ghz = -1;
5271 static int hf_he_40_and_80_mhz_5ghz = -1;
5272 static int hf_he_160_mhz_5ghz = -1;
5273 static int hf_he_160_80_plus_80_mhz_5ghz = -1;
5274 static int hf_he_242_tone_rus_in_2_4ghz = -1;
5275 static int hf_he_242_tone_rus_in_5ghz = -1;
5276 static int hf_he_chan_width_reserved = -1;
5277 static int hf_he_mcs_max_he_mcs_80_rx_1_ss = -1;
5278 static int hf_he_mcs_max_he_mcs_80_rx_2_ss = -1;
5279 static int hf_he_mcs_max_he_mcs_80_rx_3_ss = -1;
5280 static int hf_he_mcs_max_he_mcs_80_rx_4_ss = -1;
5281 static int hf_he_mcs_max_he_mcs_80_rx_5_ss = -1;
5282 static int hf_he_mcs_max_he_mcs_80_rx_6_ss = -1;
5283 static int hf_he_mcs_max_he_mcs_80_rx_7_ss = -1;
5284 static int hf_he_mcs_max_he_mcs_80_rx_8_ss = -1;
5285 static int hf_he_mcs_max_he_mcs_80_tx_1_ss = -1;
5286 static int hf_he_mcs_max_he_mcs_80_tx_2_ss = -1;
5287 static int hf_he_mcs_max_he_mcs_80_tx_3_ss = -1;
5288 static int hf_he_mcs_max_he_mcs_80_tx_4_ss = -1;
5289 static int hf_he_mcs_max_he_mcs_80_tx_5_ss = -1;
5290 static int hf_he_mcs_max_he_mcs_80_tx_6_ss = -1;
5291 static int hf_he_mcs_max_he_mcs_80_tx_7_ss = -1;
5292 static int hf_he_mcs_max_he_mcs_80_tx_8_ss = -1;
5293 static int hf_he_mcs_max_he_mcs_80p80_rx_1_ss = -1;
5294 static int hf_he_mcs_max_he_mcs_80p80_rx_2_ss = -1;
5295 static int hf_he_mcs_max_he_mcs_80p80_rx_3_ss = -1;
5296 static int hf_he_mcs_max_he_mcs_80p80_rx_4_ss = -1;
5297 static int hf_he_mcs_max_he_mcs_80p80_rx_5_ss = -1;
5298 static int hf_he_mcs_max_he_mcs_80p80_rx_6_ss = -1;
5299 static int hf_he_mcs_max_he_mcs_80p80_rx_7_ss = -1;
5300 static int hf_he_mcs_max_he_mcs_80p80_rx_8_ss = -1;
5301 static int hf_he_mcs_max_he_mcs_80p80_tx_1_ss = -1;
5302 static int hf_he_mcs_max_he_mcs_80p80_tx_2_ss = -1;
5303 static int hf_he_mcs_max_he_mcs_80p80_tx_3_ss = -1;
5304 static int hf_he_mcs_max_he_mcs_80p80_tx_4_ss = -1;
5305 static int hf_he_mcs_max_he_mcs_80p80_tx_5_ss = -1;
5306 static int hf_he_mcs_max_he_mcs_80p80_tx_6_ss = -1;
5307 static int hf_he_mcs_max_he_mcs_80p80_tx_7_ss = -1;
5308 static int hf_he_mcs_max_he_mcs_80p80_tx_8_ss = -1;
5309 static int hf_he_mcs_max_he_mcs_160_rx_1_ss = -1;
5310 static int hf_he_mcs_max_he_mcs_160_rx_2_ss = -1;
5311 static int hf_he_mcs_max_he_mcs_160_rx_3_ss = -1;
5312 static int hf_he_mcs_max_he_mcs_160_rx_4_ss = -1;
5313 static int hf_he_mcs_max_he_mcs_160_rx_5_ss = -1;
5314 static int hf_he_mcs_max_he_mcs_160_rx_6_ss = -1;
5315 static int hf_he_mcs_max_he_mcs_160_rx_7_ss = -1;
5316 static int hf_he_mcs_max_he_mcs_160_rx_8_ss = -1;
5317 static int hf_he_mcs_max_he_mcs_160_tx_1_ss = -1;
5318 static int hf_he_mcs_max_he_mcs_160_tx_2_ss = -1;
5319 static int hf_he_mcs_max_he_mcs_160_tx_3_ss = -1;
5320 static int hf_he_mcs_max_he_mcs_160_tx_4_ss = -1;
5321 static int hf_he_mcs_max_he_mcs_160_tx_5_ss = -1;
5322 static int hf_he_mcs_max_he_mcs_160_tx_6_ss = -1;
5323 static int hf_he_mcs_max_he_mcs_160_tx_7_ss = -1;
5324 static int hf_he_mcs_max_he_mcs_160_tx_8_ss = -1;
5325 static int hf_he_rx_he_mcs_map_lte_80 = -1;
5326 static int hf_he_tx_he_mcs_map_lte_80 = -1;
5327 static int hf_he_rx_he_mcs_map_160 = -1;
5328 static int hf_he_tx_he_mcs_map_160 = -1;
5329 static int hf_he_rx_he_mcs_map_80_80 = -1;
5330 static int hf_he_tx_he_mcs_map_80_80 = -1;
5331 static int hf_he_ppe_thresholds_nss = -1;
5332 static int hf_he_ppe_thresholds_ru_index_bitmask = -1;
5333 static int hf_he_ppe_ppet16 = -1;
5334 static int hf_he_ppe_ppet8 = -1;
5335 static int hf_he_phy_dual_band_support = -1;
5336 static int hf_he_phy_cap_dual_band_support = -1;
5337 static int hf_he_phy_b8_to_b23 = -1;
5338 static int hf_he_phy_cap_punctured_preamble_rx = -1;
5339 static int hf_he_phy_cap_device_class = -1;
5340 static int hf_he_phy_cap_ldpc_coding_in_payload = -1;
5341 static int hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us = -1;
5342 static int hf_he_phy_cap_midamble_rx_max_nsts = -1;
5343 static int hf_he_phy_cap_ndp_with_4x_he_ltf_32us = -1;
5344 static int hf_he_phy_cap_stbc_tx_lt_80mhz = -1;
5345 static int hf_he_phy_cap_stbc_rx_lt_80mhz = -1;
5346 static int hf_he_phy_cap_doppler_tx = -1;
5347 static int hf_he_phy_cap_doppler_rx = -1;
5348 static int hf_he_phy_cap_full_bw_ul_mu_mimo = -1;
5349 static int hf_he_phy_cap_partial_bw_ul_mu_mimo = -1;
5350 static int hf_he_phy_b24_to_b39 = -1;
5351 static int hf_he_phy_cap_dcm_max_constellation_tx = -1;
5352 static int hf_he_phy_cap_dcm_max_nss_tx = -1;
5353 static int hf_he_phy_cap_dcm_max_constellation_rx = -1;
5354 static int hf_he_phy_cap_dcm_max_nss_rx = -1;
5355 static int hf_he_phy_cap_rx_he_muppdu_from_non_ap = -1;
5356 static int hf_he_phy_cap_su_beamformer = -1;
5357 static int hf_he_phy_cap_su_beamformee = -1;
5358 static int hf_he_phy_cap_mu_beamformer = -1;
5359 static int hf_he_phy_cap_beamformer_sts_lte_80mhz = -1;
5360 static int hf_he_phy_cap_beamformer_sts_gt_80mhz = -1;
5361 static int hf_he_phy_b40_to_b55 = -1;
5362 static int hf_he_phy_cap_number_of_sounding_dims_lte_80 = -1;
5363 static int hf_he_phy_cap_number_of_sounding_dims_gt_80 = -1;
5364 static int hf_he_phy_cap_ng_eq_16_su_fb = -1;
5365 static int hf_he_phy_cap_ng_eq_16_mu_fb = -1;
5366 static int hf_he_phy_cap_codebook_size_eq_4_2_fb = -1;
5367 static int hf_he_phy_cap_codebook_size_eq_7_5_fb = -1;
5368 static int hf_he_phy_cap_triggered_su_beamforming_fb = -1;
5369 static int hf_he_phy_cap_triggered_mu_beamforming_fb = -1;
5370 static int hf_he_phy_cap_triggered_cqi_fb = -1;
5371 static int hf_he_phy_cap_partial_bw_extended_range = -1;
5372 static int hf_he_phy_cap_partial_bw_dl_mu_mimo = -1;
5373 static int hf_he_phy_cap_ppe_threshold_present = -1;
5374 static int hf_he_phy_b56_to_b71 = -1;
5375 static int hf_he_phy_cap_srp_based_sr_support = -1;
5376 static int hf_he_phy_cap_power_boost_factor_ar_support = -1;
5377 static int hf_he_phy_cap_he_su_ppdu_etc_gi = -1;
5378 static int hf_he_phy_cap_max_nc = -1;
5379 static int hf_he_phy_cap_stbc_tx_gt_80_mhz = -1;
5380 static int hf_he_phy_cap_stbc_rx_gt_80_mhz = -1;
5381 static int hf_he_phy_cap_he_er_su_ppdu_4xxx_gi = -1;
5382 static int hf_he_phy_cap_20mhz_in_40mhz_24ghz_band = -1;
5383 static int hf_he_phy_cap_20mhz_in_160_80p80_ppdu = -1;
5384 static int hf_he_phy_cap_80mgz_in_160_80p80_ppdu = -1;
5385 static int hf_he_phy_cap_he_er_su_ppdu_1xxx_gi = -1;
5386 static int hf_he_phy_cap_midamble_rx_2x_xxx_ltf = -1;
5387 static int hf_he_phy_cap_b70_b71_reserved = -1;
5388 static int hf_he_operation_parameter = -1;
5389 static int hf_he_operation_bss_color = -1;
5390 static int hf_he_operation_default_pe_duration = -1;
5391 static int hf_he_operation_twt_required = -1;
5392 static int hf_he_operation_txop_duration_rts_threshold = -1;
5393 static int hf_he_operation_partial_bss_color = -1;
5394 static int hf_he_operation_vht_operation_information_present = -1;
5395 static int hf_he_operation_reserved_b22_b27 = -1;
5396 static int hf_he_operation_multiple_bssid_ap = -1;
5397 static int hf_he_operation_txbssid_indicator = -1;
5398 static int hf_he_operation_bss_color_disabled = -1;
5399 static int hf_he_operation_reserved_b31 = -1;
5400 static int hf_he_operation_basic_mcs = -1;
5401 static int hf_he_oper_max_he_mcs_for_1_ss = -1;
5402 static int hf_he_oper_max_he_mcs_for_2_ss = -1;
5403 static int hf_he_oper_max_he_mcs_for_3_ss = -1;
5404 static int hf_he_oper_max_he_mcs_for_4_ss = -1;
5405 static int hf_he_oper_max_he_mcs_for_5_ss = -1;
5406 static int hf_he_oper_max_he_mcs_for_6_ss = -1;
5407 static int hf_he_oper_max_he_mcs_for_7_ss = -1;
5408 static int hf_he_oper_max_he_mcs_for_8_ss = -1;
5409 static int hf_he_operation_channel_width = -1;
5410 static int hf_he_operation_channel_center_freq_0 = -1;
5411 static int hf_he_operation_channel_center_freq_1 = -1;
5412 static int hf_he_operation_max_bssid_indicator = -1;
5413 static int hf_he_muac_aci_aifsn = -1;
5414 static int hf_he_mu_edca_timer = -1;
5415 static int hf_he_muac_ecwmin_ecwmax = -1;
5416 static int hf_he_srp_disallowed = -1;
5417 static int hf_he_non_srg_obss_pd_sr_disallowed = -1;
5418 static int hf_he_non_srg_offset_present = -1;
5419 static int hf_he_srg_information_present = -1;
5420 static int hf_he_hesiga_spatial_reuse_value15_allowed = -1;
5421 static int hf_he_sr_control_reserved = -1;
5422 static int hf_he_spatial_reuse_sr_control = -1;
5423 static int hf_he_spatial_non_srg_obss_pd_max_offset = -1;
5424 static int hf_he_spatial_srg_obss_pd_min_offset = -1;
5425 static int hf_he_spatial_srg_obss_pd_max_offset = -1;
5426 static int hf_he_spatial_srg_bss_color_bitmap = -1;
5427 static int hf_he_spatial_srg_partial_bssid_bitmap = -1;
5428 static int hf_he_ess_report_planned_ess = -1;
5429 static int hf_he_ess_report_edge_of_ess = -1;
5430 static int hf_he_resource_request_buffer_thresh = -1;
5431 static int hf_he_bss_color_change_new_color_info = -1;
5432 static int hf_he_new_bss_color_info_color = -1;
5433 static int hf_he_new_bss_color_info_reserved = -1;
5434 static int hf_he_bss_color_change_switch_countdown = -1;
5435 static int hf_he_ess_report_info_field = -1;
5436 static int hf_he_ess_report_recommend_transition_thresh = -1;
5437 static int hf_he_uora_field = -1;
5438 static int hf_he_uora_eocwmin = -1;
5439 static int hf_he_uora_owcwmax = -1;
5440 static int hf_he_uora_reserved = -1;
5441
5442 /* ************************************************************************* */
5443 /*                               Protocol trees                              */
5444 /* ************************************************************************* */
5445 static gint ett_80211 = -1;
5446 static gint ett_proto_flags = -1;
5447 static gint ett_cap_tree = -1;
5448 static gint ett_fc_tree = -1;
5449 static gint ett_cntrl_wrapper_fc = -1;
5450 static gint ett_cntrl_wrapper_payload = -1;
5451 static gint ett_fragments = -1;
5452 static gint ett_fragment = -1;
5453 static gint ett_block_ack = -1;
5454 static gint ett_block_ack_tid = -1;
5455 static gint ett_block_ack_request_control = -1;
5456 static gint ett_block_ack_bitmap = -1;
5457 static gint ett_block_ack_request_multi_sta_aid_tid = -1;
5458 static gint ett_multi_sta_block_ack = -1;
5459 static gint ett_ath_cap_tree = -1;
5460
5461 static gint ett_80211_mgt = -1;
5462 static gint ett_fixed_parameters = -1;
5463 static gint ett_tagged_parameters = -1;
5464 static gint ett_tag_bmapctl_tree = -1;
5465 static gint ett_tag_country_fnm_tree = -1;
5466 static gint ett_tag_country_rcc_tree = -1;
5467 static gint ett_qos_parameters = -1;
5468 static gint ett_qos_ps_buf_state = -1;
5469 static gint ett_wep_parameters = -1;
5470 static gint ett_msh_control = -1;
5471 static gint ett_hwmp_targ_flags_tree = -1;
5472 static gint ett_mesh_chswitch_flag_tree = -1;
5473 static gint ett_mesh_config_cap_tree = -1;
5474 static gint ett_mesh_formation_info_tree = -1;
5475
5476 static gint ett_rsn_gcs_tree = -1;
5477 static gint ett_rsn_pcs_tree = -1;
5478 static gint ett_rsn_sub_pcs_tree = -1;
5479 static gint ett_rsn_akms_tree = -1;
5480 static gint ett_rsn_sub_akms_tree = -1;
5481 static gint ett_rsn_cap_tree = -1;
5482 static gint ett_rsn_pmkid_tree = -1;
5483 static gint ett_rsn_gmcs_tree = -1;
5484
5485 static gint ett_wpa_mcs_tree = -1;
5486 static gint ett_wpa_ucs_tree = -1;
5487 static gint ett_wpa_sub_ucs_tree = -1;
5488 static gint ett_wpa_akms_tree = -1;
5489 static gint ett_wpa_sub_akms_tree = -1;
5490 static gint ett_wme_ac = -1;
5491 static gint ett_wme_aci_aifsn = -1;
5492 static gint ett_wme_ecw = -1;
5493 static gint ett_wme_qos_info = -1;
5494
5495 static gint ett_ht_cap_tree = -1;
5496 static gint ett_ampduparam_tree = -1;
5497 static gint ett_mcsset_tree = -1;
5498 static gint ett_mcsbit_tree = -1;
5499 static gint ett_htex_cap_tree = -1;
5500 static gint ett_txbf_tree = -1;
5501 static gint ett_antsel_tree = -1;
5502 static gint ett_hta_cap_tree = -1;
5503 static gint ett_hta_cap1_tree = -1;
5504 static gint ett_hta_cap2_tree = -1;
5505
5506 static gint ett_htc_tree = -1;
5507 static gint ett_htc_he_a_control = -1;
5508 static gint ett_mfb_subtree = -1;
5509 static gint ett_lac_subtree = -1;
5510 static gint ett_ieee80211_umrs_control = -1;
5511 static gint ett_ieee80211_om_control = -1;
5512 static gint ett_ieee80211_hla_control = -1;
5513 static gint ett_ieee80211_buffer_status_report = -1;
5514 static gint ett_ieee80211_control_uph = -1;
5515 static gint ett_ieee80211_bqr_control = -1;
5516 static gint ett_ieee80211_control_cci = -1;
5517
5518 static gint ett_vht_cap_tree = -1;
5519 static gint ett_vht_mcsset_tree = -1;
5520 static gint ett_vht_rx_mcsbit_tree = -1;
5521 static gint ett_vht_tx_mcsbit_tree = -1;
5522 static gint ett_vht_basic_mcsbit_tree = -1;
5523 static gint ett_vht_op_tree = -1;
5524 static gint ett_vht_tpe_info_tree = -1;
5525
5526 static gint ett_vht_ndp_annc = -1;
5527 static gint ett_vht_ndp_annc_sta_info_tree = -1;
5528 static gint ett_vht_ndp_annc_sta_list = -1;
5529
5530 static gint ett_he_mimo_control = -1;
5531
5532 static gint ett_ff_vhtmimo_cntrl = -1;
5533 static gint ett_ff_vhtmimo_beamforming_report = -1;
5534 static gint ett_ff_vhtmimo_beamforming_report_snr = -1;
5535 static gint ett_ff_vhtmimo_beamforming_angle = -1;
5536 static gint ett_ff_vhtmimo_beamforming_report_feedback_matrices = -1;
5537 static gint ett_ff_vhtmu_exclusive_beamforming_report_matrices = -1;
5538
5539 static gint ett_vht_grpidmgmt = -1;
5540 static gint ett_vht_msa = -1;
5541 static gint ett_vht_upa = -1;
5542
5543 static gint ett_ht_info_delimiter1_tree = -1;
5544 static gint ett_ht_info_delimiter2_tree = -1;
5545 static gint ett_ht_info_delimiter3_tree = -1;
5546
5547 static gint ett_tag_measure_request_mode_tree = -1;
5548 static gint ett_tag_measure_request_type_tree = -1;
5549 static gint ett_tag_measure_report_mode_tree = -1;
5550 static gint ett_tag_measure_report_type_tree = -1;
5551 static gint ett_tag_measure_report_basic_map_tree = -1;
5552 static gint ett_tag_measure_report_rpi_tree = -1;
5553 static gint ett_tag_measure_report_frame_tree = -1;
5554 static gint ett_tag_measure_reported_frame_tree = -1;
5555 static gint ett_tag_bss_bitmask_tree = -1;
5556 static gint ett_tag_dfs_map_tree = -1;
5557 static gint ett_tag_erp_info_tree = -1;
5558 static gint ett_tag_ex_cap1 = -1;
5559 static gint ett_tag_ex_cap2 = -1;
5560 static gint ett_tag_ex_cap3 = -1;
5561 static gint ett_tag_ex_cap4 = -1;
5562 static gint ett_tag_ex_cap5 = -1;
5563 static gint ett_tag_ex_cap6 = -1;
5564 static gint ett_tag_ex_cap7 = -1;
5565 static gint ett_tag_ex_cap8 = -1;
5566 static gint ett_tag_ex_cap89 = -1;
5567 static gint ett_tag_ex_cap10 = -1;
5568
5569 static gint ett_tag_rm_cap1 = -1;
5570 static gint ett_tag_rm_cap2 = -1;
5571 static gint ett_tag_rm_cap3 = -1;
5572 static gint ett_tag_rm_cap4 = -1;
5573 static gint ett_tag_rm_cap5 = -1;
5574
5575 static gint ett_tag_20_40_bc = -1;
5576
5577 static gint ett_tag_tclas_mask_tree = -1;
5578
5579 static gint ett_tag_supported_channels = -1;
5580
5581 static gint ett_tag_neighbor_report_bssid_info_tree = -1;
5582 static gint ett_tag_neighbor_report_bssid_info_capability_tree = -1;
5583 static gint ett_tag_neighbor_report_sub_tag_tree = -1;
5584
5585 static gint ett_tag_wapi_param_set_akm_tree = -1;
5586 static gint ett_tag_wapi_param_set_ucast_tree = -1;
5587 static gint ett_tag_wapi_param_set_mcast_tree = -1;
5588 static gint ett_tag_wapi_param_set_preauth_tree = -1;
5589
5590 static gint ett_tag_time_adv_tree = -1;
5591
5592 static gint ett_ff_ba_param_tree = -1;
5593 static gint ett_ff_ba_ssc_tree = -1;
5594 static gint ett_ff_delba_param_tree = -1;
5595 static gint ett_ff_qos_info = -1;
5596 static gint ett_ff_sm_pwr_save = -1;
5597 static gint ett_ff_psmp_param_set = -1;
5598 static gint ett_ff_mimo_cntrl = -1;
5599 static gint ett_ff_ant_sel = -1;
5600 static gint ett_mimo_report = -1;
5601 static gint ett_ff_chan_switch_announce = -1;
5602 static gint ett_ff_ht_info = -1;
5603 static gint ett_ff_psmp_sta_info = -1;
5604
5605 static gint ett_tpc = -1;
5606
5607 static gint ett_msdu_aggregation_parent_tree = -1;
5608 static gint ett_msdu_aggregation_subframe_tree = -1;
5609
5610 static gint ett_80211_mgt_ie = -1;
5611 static gint ett_tsinfo_tree = -1;
5612 static gint ett_sched_tree = -1;
5613
5614 static gint ett_fcs = -1;
5615
5616 static gint ett_hs20_osu_providers_list = -1;
5617 static gint ett_hs20_osu_provider_tree = -1;
5618 static gint ett_hs20_friendly_names_list = -1;
5619 static gint ett_hs20_friendly_name_tree = -1;
5620 static gint ett_hs20_osu_provider_method_list = -1;
5621 static gint ett_osu_icons_avail_list = -1;
5622 static gint ett_hs20_osu_icon_tree = -1;
5623 static gint ett_hs20_osu_service_desc_list = -1;
5624 static gint ett_hs20_osu_service_desc_tree = -1;
5625 static gint ett_hs20_venue_url = -1;
5626 static gint ett_hs20_advice_of_charge = -1;
5627 static gint ett_hs20_aoc_plan = -1;
5628
5629 static gint ett_hs20_ofn_tree = -1;
5630
5631 static gint ett_adv_proto = -1;
5632 static gint ett_adv_proto_tuple = -1;
5633 static gint ett_gas_query = -1;
5634 static gint ett_gas_anqp = -1;
5635 static gint ett_nai_realm = -1;
5636 static gint ett_nai_realm_eap = -1;
5637 static gint ett_tag_ric_data_desc_ie = -1;
5638 static gint ett_anqp_vendor_capab = -1;
5639
5640 static gint ett_osen_group_data_cipher_suite = -1;
5641 static gint ett_osen_pairwise_cipher_suites = -1;
5642 static gint ett_osen_pairwise_cipher_suite = -1;
5643 static gint ett_osen_akm_cipher_suites = -1;
5644 static gint ett_osen_akm_cipher_suite = -1;
5645 static gint ett_osen_rsn_cap_tree = -1;
5646 static gint ett_osen_pmkid_list = -1;
5647 static gint ett_osen_pmkid_tree = -1;
5648 static gint ett_osen_group_management_cipher_suite = -1;
5649
5650 static gint ett_hs20_cc_proto_port_tuple = -1;
5651
5652 static gint ett_ssid_list = -1;
5653
5654 static gint ett_nintendo = -1;
5655
5656 static gint ett_mikrotik = -1;
5657
5658 static gint ett_meru = -1;
5659
5660 static gint ett_qos_map_set_exception = -1;
5661 static gint ett_qos_map_set_range = -1;
5662
5663 static gint ett_wnm_notif_subelt = -1;
5664
5665 static gint ett_ieee80211_3gpp_plmn = -1;
5666
5667 static expert_field ei_ieee80211_bad_length = EI_INIT;
5668 static expert_field ei_ieee80211_inv_val = EI_INIT;
5669 static expert_field ei_ieee80211_vht_tpe_pwr_info_count = EI_INIT;
5670 static expert_field ei_ieee80211_ff_query_response_length = EI_INIT;
5671 static expert_field ei_ieee80211_ff_anqp_nai_realm_eap_len = EI_INIT;
5672 static expert_field ei_hs20_anqp_nai_hrq_length = EI_INIT;
5673 static expert_field ei_ieee80211_extra_data = EI_INIT;
5674 static expert_field ei_ieee80211_tag_data = EI_INIT;
5675 static expert_field ei_ieee80211_tdls_setup_confirm_malformed = EI_INIT;
5676 static expert_field ei_ieee80211_ff_anqp_nai_field_len = EI_INIT;
5677 static expert_field ei_ieee80211_rsn_pcs_count = EI_INIT;
5678 static expert_field ei_ieee80211_tag_measure_request_unknown = EI_INIT;
5679 static expert_field ei_ieee80211_tag_measure_request_beacon_unknown = EI_INIT;
5680 static expert_field ei_ieee80211_tag_measure_report_unknown = EI_INIT;
5681 static expert_field ei_ieee80211_tag_number = EI_INIT;
5682 static expert_field ei_ieee80211_ff_anqp_info_length = EI_INIT;
5683 static expert_field ei_hs20_anqp_ofn_length = EI_INIT;
5684 static expert_field ei_ieee80211_tdls_setup_response_malformed = EI_INIT;
5685 static expert_field ei_ieee80211_ff_anqp_capability = EI_INIT;
5686 static expert_field ei_ieee80211_not_enough_room_for_anqp_header = EI_INIT;
5687 static expert_field ei_ieee80211_ff_query_request_length = EI_INIT;
5688 static expert_field ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype = EI_INIT;
5689 static expert_field ei_ieee80211_qos_info_bad_ftype = EI_INIT;
5690 static expert_field ei_ieee80211_qos_bad_aifsn = EI_INIT;
5691 static expert_field ei_ieee80211_pmkid_count_too_large = EI_INIT;
5692 static expert_field ei_ieee80211_ff_anqp_venue_length = EI_INIT;
5693 static expert_field ei_ieee80211_ff_anqp_roaming_consortium_oi_len = EI_INIT;
5694 static expert_field ei_ieee80211_tag_length = EI_INIT;
5695 static expert_field ei_ieee80211_missing_data = EI_INIT;
5696 static expert_field ei_ieee80211_rsn_pmkid_count = EI_INIT;
5697 static expert_field ei_ieee80211_fc_retry = EI_INIT;
5698 static expert_field ei_ieee80211_tag_wnm_sleep_mode_no_key_data = EI_INIT;
5699 static expert_field ei_ieee80211_dmg_subtype = EI_INIT;
5700 static expert_field ei_ieee80211_vht_action = EI_INIT;
5701 static expert_field ei_ieee80211_mesh_peering_unexpected = EI_INIT;
5702 static expert_field ei_ieee80211_fcs = EI_INIT;
5703 static expert_field ei_ieee80211_mismatched_akm_suite = EI_INIT;
5704
5705 /* 802.11ad trees */
5706 static gint ett_dynamic_alloc_tree = -1;
5707 static gint ett_ssw_tree = -1;
5708 static gint ett_bf_tree = -1;
5709 static gint ett_sswf_tree = -1;
5710 static gint ett_brp_tree = -1;
5711 static gint ett_blm_tree = -1;
5712 static gint ett_bic_tree = -1;
5713 static gint ett_dmg_params_tree = -1;
5714 static gint ett_cc_tree = -1;
5715 static gint ett_rcsi_tree = -1;
5716 static gint ett_80211_ext = -1;
5717 static gint ett_allocation_tree = -1;
5718 static gint ett_sta_info = -1;
5719
5720 static gint ett_ieee80211_esp = -1;
5721
5722 /* 802.11ax trees */
5723 static gint ett_he_mac_capabilities = -1;
5724 static gint ett_he_phy_capabilities = -1;
5725 static gint ett_he_phy_cap_first_byte = -1;
5726 static gint ett_he_phy_cap_chan_width_set = -1;
5727 static gint ett_he_phy_cap_b8_to_b23 = -1;
5728 static gint ett_he_phy_cap_b24_to_b39 = -1;
5729 static gint ett_he_phy_cap_b40_to_b55 = -1;
5730 static gint ett_he_phy_cap_b56_to_b71 = -1;
5731 static gint ett_he_mcs_and_nss_set = -1;
5732 static gint ett_he_rx_tx_he_mcs_map_lte_80 = -1;
5733 static gint ett_he_rx_mcs_map_lte_80 = -1;
5734 static gint ett_he_tx_mcs_map_lte_80 = -1;
5735 static gint ett_he_rx_tx_he_mcs_map_160 = -1;
5736 static gint ett_he_rx_mcs_map_160 = -1;
5737 static gint ett_he_tx_mcs_map_160 = -1;
5738 static gint ett_he_rx_tx_he_mcs_map_80_80 = -1;
5739 static gint ett_he_rx_mcs_map_80_80 = -1;
5740 static gint ett_he_tx_mcs_map_80_80 = -1;
5741 static gint ett_he_ppe_threshold = -1;
5742 static gint ett_he_ppe_nss = -1;
5743 static gint ett_he_ppe_ru_alloc = -1;
5744 static gint ett_he_uora_tree = -1;
5745 static gint ett_he_spatial_reuse_control = -1;
5746 static gint ett_he_bss_new_color_info = -1;
5747 static gint ett_he_ess_report_info_field = -1;
5748 static gint ett_he_operation_params = -1;
5749 static gint ett_he_oper_basic_mcs = -1;
5750 static gint ett_he_operation_vht_op_info = -1;
5751 static gint ett_he_mu_edca_param = -1;
5752 static gint ett_he_trigger_common_info = -1;
5753 static gint ett_he_trigger_base_common_info = -1;
5754 static gint ett_he_trigger_bar_ctrl = -1;
5755 static gint ett_he_trigger_bar_info = -1;
5756 static gint ett_he_trigger_user_info = -1;
5757 static gint ett_he_trigger_base_user_info = -1;
5758 static gint ett_he_trigger_dep_basic_user_info = -1;
5759 static gint ett_he_trigger_dep_nfrp_user_info = -1;
5760 static gint ett_he_ndp_annc = -1;
5761 static gint ett_he_ndp_annc_sta_list = -1;
5762 static gint ett_he_ndp_annc_sta_item = -1;
5763 static gint ett_he_ndp_annc_sta_info = -1;
5764
5765 static const fragment_items frag_items = {
5766   &ett_fragment,
5767   &ett_fragments,
5768   &hf_ieee80211_fragments,
5769   &hf_ieee80211_fragment,
5770   &hf_ieee80211_fragment_overlap,
5771   &hf_ieee80211_fragment_overlap_conflict,
5772   &hf_ieee80211_fragment_multiple_tails,
5773   &hf_ieee80211_fragment_too_long_fragment,
5774   &hf_ieee80211_fragment_error,
5775   &hf_ieee80211_fragment_count,
5776   &hf_ieee80211_reassembled_in,
5777   &hf_ieee80211_reassembled_length,
5778   /* Reassembled data field */
5779   NULL,
5780   "fragments"
5781 };
5782
5783 static const enum_val_t wlan_ignore_prot_options[] = {
5784   { "no",         "No",               WLAN_IGNORE_PROT_NO    },
5785   { "without_iv", "Yes - without IV", WLAN_IGNORE_PROT_WO_IV },
5786   { "with_iv",    "Yes - with IV",    WLAN_IGNORE_PROT_W_IV  },
5787   { NULL,         NULL,               0                     }
5788 };
5789
5790 static int wlan_address_type = -1;
5791 static int wlan_bssid_address_type = -1;
5792
5793 static const unsigned char bssid_broadcast_data[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
5794 static address bssid_broadcast;
5795 gboolean
5796 is_broadcast_bssid(const address *bssid) {
5797   return addresses_equal(&bssid_broadcast, bssid);
5798 }
5799
5800 static heur_dissector_list_t heur_subdissector_list;
5801
5802 static dissector_handle_t ieee80211_handle;
5803 static dissector_handle_t wlan_withoutfcs_handle;
5804 static dissector_handle_t llc_handle;
5805 static dissector_handle_t ipx_handle;
5806 static dissector_handle_t eth_withoutfcs_handle;
5807
5808 static capture_dissector_handle_t llc_cap_handle;
5809 static capture_dissector_handle_t ipx_cap_handle;
5810
5811 static dissector_table_t tagged_field_table;
5812 static dissector_table_t vendor_specific_action_table;
5813 static dissector_table_t wifi_alliance_action_subtype_table;
5814 static dissector_table_t vendor_specific_anqp_info_table;
5815 static dissector_table_t wifi_alliance_anqp_info_table;
5816 static dissector_table_t wifi_alliance_ie_table;
5817 static dissector_table_t wifi_alliance_public_action_table;
5818
5819 static int wlan_tap = -1;
5820
5821 static const value_string access_network_type_vals[] = {
5822   {  0, "Private network" },
5823   {  1, "Private network with guest access" },
5824   {  2, "Chargeable public network" },
5825   {  3, "Free public network" },
5826   {  4, "Personal device network" },
5827   {  5, "Emergency services only network" },
5828   { 14, "Test or experimental" },
5829   { 15, "Wildcard" },
5830   { 0, NULL }
5831 };
5832
5833 static const value_string adv_proto_id_vals[] = {
5834   {  0, "Access Network Query Protocol"},
5835   {  1, "MIH Information Service"},
5836   {  2, "MIH Command and Event Services Capability Discovery"},
5837   {  3, "Emergency Alert System (EAS)"},
5838   {  4, "Location-to-Service Translation Protocol"},
5839   {221, "Vendor Specific"},
5840   {0, NULL}
5841 };
5842
5843 static const value_string timeout_int_types[] = {
5844   {1, "Reassociation deadline interval (TUs)"},
5845   {2, "Key lifetime interval (seconds)"},
5846   {3, "Association Comeback time (TUs)"},
5847   {4, "Time to start (TUs)"},
5848   {0, NULL}
5849 };
5850
5851 static const value_string tdls_action_codes[] = {
5852   {TDLS_SETUP_REQUEST,           "TDLS Setup Request"},
5853   {TDLS_SETUP_RESPONSE,          "TDLS Setup Response"},
5854   {TDLS_SETUP_CONFIRM,           "TDLS Setup Confirm"},
5855   {TDLS_TEARDOWN,                "TDLS Teardown"},
5856   {TDLS_PEER_TRAFFIC_INDICATION, "TDLS Peer Traffic Indication"},
5857   {TDLS_CHANNEL_SWITCH_REQUEST,  "TDLS Channel Switch Request"},
5858   {TDLS_CHANNEL_SWITCH_RESPONSE, "TDLS Channel Switch Response"},
5859   {TDLS_PEER_PSM_REQUEST,        "TDLS Peer PSM Request"},
5860   {TDLS_PEER_PSM_RESPONSE,       "TDLS Peer PSM Response"},
5861   {TDLS_PEER_TRAFFIC_RESPONSE,   "TDLS Peer Traffic Response"},
5862   {TDLS_DISCOVERY_REQUEST,       "TDLS Discovery Request"},
5863   {0, NULL}
5864 };
5865 static value_string_ext tdls_action_codes_ext = VALUE_STRING_EXT_INIT(tdls_action_codes);
5866
5867 static const value_string rm_action_codes[] = {
5868   {RM_ACTION_RADIO_MEASUREMENT_REQUEST,   "Radio Measurement Request"},
5869   {RM_ACTION_RADIO_MEASUREMENT_REPORT,    "Radio Measurement Report"},
5870   {RM_ACTION_LINK_MEASUREMENT_REQUEST,    "Link Measurement Request"},
5871   {RM_ACTION_LINK_MEASUREMENT_REPORT,     "Link Measurement Report"},
5872   {RM_ACTION_NEIGHBOR_REPORT_REQUEST,     "Neighbor Report Request"},
5873   {RM_ACTION_NEIGHBOR_REPORT_RESPONSE,    "Neighbor Report Response"},
5874   {0, NULL}
5875 };
5876 static value_string_ext rm_action_codes_ext = VALUE_STRING_EXT_INIT(rm_action_codes);
5877
5878 static const val64_string number_of_taps_values[] = {
5879   {0x0, "1 tap"},
5880   {0x1, "5 taps"},
5881   {0x2, "15 taps"},
5882   {0x3, "63 taps"},
5883   {0, NULL}
5884 };
5885
5886 DOT11DECRYPT_CONTEXT dot11decrypt_ctx;
5887
5888 #define PSMP_STA_INFO_BROADCAST 0
5889 #define PSMP_STA_INFO_MULTICAST 1
5890 #define PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED 2
5891
5892 #define PSMP_STA_INFO_FLAG_TYPE         0x00000003
5893 #define PSMP_STA_INFO_FLAG_DTT_START    0x00001FFC
5894 #define PSMP_STA_INFO_FLAG_DTT_DURATION 0x001FE000
5895
5896 #define PSMP_STA_INFO_FLAG_STA_ID       0x001FFFE0
5897
5898 #define PSMP_STA_INFO_FLAG_UTT_START    0x0000FFE0
5899 #define PSMP_STA_INFO_FLAG_UTT_DURATION 0x03FF0000
5900
5901 #define PSMP_STA_INFO_FLAG_IA_RESERVED  0xFC000000
5902
5903 static const value_string ff_psmp_sta_info_flags[] = {
5904   { PSMP_STA_INFO_BROADCAST,              "Broadcast"},
5905   { PSMP_STA_INFO_MULTICAST,              "Multicast"},
5906   { PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED, "Individually Addressed"},
5907   {0, NULL}
5908 };
5909
5910 static const char*
5911 wlan_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter)
5912 {
5913     if ((filter == CONV_FT_SRC_ADDRESS) && (conv->src_address.type == wlan_address_type))
5914         return "wlan.sa";
5915
5916     if ((filter == CONV_FT_DST_ADDRESS) && (conv->dst_address.type == wlan_address_type))
5917         return "wlan.da";
5918
5919     if ((filter == CONV_FT_ANY_ADDRESS) && (conv->src_address.type == wlan_address_type))
5920         return "wlan.addr";
5921
5922     return CONV_FILTER_INVALID;
5923 }
5924
5925 static ct_dissector_info_t wlan_ct_dissector_info = {&wlan_conv_get_filter_type};
5926
5927 static int
5928 wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5929 {
5930   conv_hash_t *hash = (conv_hash_t*) pct;
5931   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5932
5933   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);
5934
5935   return 1;
5936 }
5937
5938 static const char*
5939 wlan_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
5940 {
5941   if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == wlan_address_type))
5942     return "wlan.addr";
5943
5944   return CONV_FILTER_INVALID;
5945 }
5946
5947 static hostlist_dissector_info_t wlan_host_dissector_info = {&wlan_host_get_filter_type};
5948
5949 static int
5950 wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5951 {
5952   conv_hash_t *hash = (conv_hash_t*) pit;
5953   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5954
5955   /* Take two "add" passes per packet, adding for each direction, ensures that all
5956   packets are counted properly (even if address is sending to itself)
5957   XXX - this could probably be done more efficiently inside hostlist_table */
5958   add_hostlist_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
5959   add_hostlist_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, ENDPOINT_NONE);
5960
5961   return 1;
5962 }
5963
5964 static const char*
5965 wlan_col_filter_str(const address* addr _U_, gboolean is_src)
5966 {
5967   if (is_src)
5968     return "wlan.sa";
5969
5970   return "wlan.da";
5971 }
5972
5973 static const char*
5974 wlan_bssid_col_filter_str(const address* addr _U_, gboolean is_src _U_)
5975 {
5976   return "wlan.bssid";
5977 }
5978
5979
5980 static void
5981 beacon_interval_base_custom(gchar *result, guint32 beacon_interval)
5982 {
5983   double temp_double;
5984
5985   temp_double = (double)beacon_interval;
5986   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double * 1024 / 1000000));
5987 }
5988
5989 static void
5990 allocation_duration_base_custom(gchar *result, guint32 allocation_duration)
5991 {
5992   double temp_double;
5993
5994   temp_double = (double)allocation_duration;
5995   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double / 1000000));
5996 }
5997
5998 static void
5999 extra_one_base_custom(gchar *result, guint32 value)
6000 {
6001   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1);
6002 }
6003
6004 static void
6005 extra_one_mul_two_base_custom(gchar *result, guint32 value)
6006 {
6007   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", (value+1)*2);
6008 }
6009
6010 /* ************************************************************************* */
6011 /* Mesh Control field helper functions
6012  *
6013  * Per IEEE 802.11s Draft 12.0 section 7.2.2.1:
6014  *
6015  * The frame body consists of either:
6016  * The MSDU (or a fragment thereof), the Mesh Control field (if and only if the
6017  * frame is transmitted by a mesh STA and the Mesh Control Present subfield of
6018  * the QoS Control field is 1)...
6019  *
6020  * 8.2.4.5.1 "QoS Control field structure", table 8-4, in 802.11-2012,
6021  * seems to indicate that the bit that means "Mesh Control Present" in
6022  * frames sent by mesh STAs in a mesh BSS is part of the TXOP Limit field,
6023  * the AP PS Buffer State field, the TXOP Duration Requested field, or the
6024  * Queue Size field in some data frames in non-mesh BSSes.
6025  *
6026  * We need a statefull sniffer for that.  For now, use heuristics.
6027  *
6028  * Notably, only mesh data frames contain the Mesh Control field in the header.
6029  * Other frames that contain mesh control (i.e., multihop action frames) have
6030  * it deeper in the frame body where it can be definitively identified.
6031  * Further, mesh data frames always have to-ds and from-ds either 11 or 01.  We
6032  * use these facts to make our heuristics more reliable.
6033  * ************************************************************************* */
6034 static int
6035 has_mesh_control(guint16 fcf, guint16 qos_ctl, guint8 mesh_flags)
6036 {
6037   /* assume mesh control present if the QOS field's Mesh Control Present bit is
6038    * set, all reserved bits in the mesh_flags field are zero, and the address
6039    * extension mode is not a reserved value.
6040    */
6041   return (((FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) || (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2)) &&
6042           (QOS_MESH_CONTROL_PRESENT(qos_ctl)) &&
6043           ((mesh_flags & ~MESH_FLAGS_ADDRESS_EXTENSION) == 0) &&
6044           ((mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION) != MESH_FLAGS_ADDRESS_EXTENSION));
6045 }
6046
6047 static int
6048 find_mesh_control_length(guint8 mesh_flags)
6049 {
6050   return 6 + 6*(mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION);
6051 }
6052
6053 static mimo_control_t
6054 get_mimo_control(tvbuff_t *tvb, int offset)
6055 {
6056   guint16        mimo;
6057   mimo_control_t output;
6058
6059   mimo = tvb_get_letohs(tvb, offset);
6060
6061   output.nc = (mimo & 0x0003) + 1;
6062   output.nr = ((mimo & 0x000C) >> 2) + 1;
6063   output.chan_width = (mimo & 0x0010) >> 4;
6064   output.coefficient_size = 4; /* XXX - Is this a good default? */
6065
6066   switch ((mimo & 0x0060) >> 5)
6067     {
6068       case 0:
6069         output.grouping = 1;
6070         break;
6071
6072       case 1:
6073         output.grouping = 2;
6074         break;
6075
6076       case 2:
6077         output.grouping = 4;
6078         break;
6079
6080       default:
6081         output.grouping = 1;
6082         break;
6083     }
6084
6085   switch ((mimo & 0x0180) >> 7)
6086     {
6087       case 0:
6088         output.coefficient_size = 4;
6089         break;
6090
6091       case 1:
6092         output.coefficient_size = 5;
6093         break;
6094
6095       case 2:
6096         output.coefficient_size = 6;
6097         break;
6098
6099       case 3:
6100         output.coefficient_size = 8;
6101         break;
6102     }
6103
6104   output.codebook_info = (mimo & 0x0600) >> 9;
6105   output.remaining_matrix_segment = (mimo & 0x3800) >> 11;
6106
6107   return output;
6108 }
6109
6110 static int
6111 get_mimo_na(guint8 nr, guint8 nc)
6112 {
6113   if ((nr == 2) && (nc == 1)) {
6114     return 2;
6115   } else if ((nr == 2) && (nc == 2)) {
6116     return 2;
6117   } else if ((nr == 3) && (nc == 1)) {
6118     return 4;
6119   } else if ((nr == 3) && (nc == 2)) {
6120     return 6;
6121   } else if ((nr == 3) && (nc == 3)) {
6122     return 6;
6123   } else if ((nr == 4) && (nc == 1)) {
6124     return 6;
6125   } else if ((nr == 4) && (nc == 2)) {
6126     return 10;
6127   } else if ((nr == 4) && (nc == 3)) {
6128     return 12;
6129   } else if ((nr == 4) && (nc == 4)) {
6130     return 12;
6131   } else{
6132     return 0;
6133   }
6134 }
6135
6136 static int
6137 get_mimo_ns(gboolean chan_width, guint8 output_grouping)
6138 {
6139   int ns = 0;
6140
6141   if (chan_width)
6142   {
6143     switch (output_grouping)
6144       {
6145         case 1:
6146           ns = 114;
6147           break;
6148
6149           case 2:
6150             ns = 58;
6151             break;
6152
6153           case 4:
6154             ns = 30;
6155             break;
6156
6157           default:
6158             ns = 0;
6159       }
6160   } else {
6161     switch (output_grouping)
6162       {
6163         case 1:
6164           ns = 56;
6165           break;
6166
6167         case 2:
6168           ns = 30;
6169           break;
6170
6171         case 4:
6172           ns = 16;
6173           break;
6174
6175         default:
6176           ns = 0;
6177       }
6178   }
6179
6180   return ns;
6181 }
6182
6183 static int
6184 add_mimo_csi_matrices_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
6185 {
6186   proto_tree *snr_tree;
6187   int         csi_matrix_size, start_offset;
6188   int         ns, i;
6189
6190   start_offset = offset;
6191   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
6192                         ett_mimo_report, NULL, "Signal to Noise Ratio");
6193
6194   for (i = 1; i <= mimo_cntrl.nr; i++)
6195   {
6196     guint8 snr;
6197
6198     snr = tvb_get_guint8(tvb, offset);
6199     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
6200                                snr, "Channel %d - Signal to Noise Ratio: 0x%02X", i, snr);
6201     offset += 1;
6202   }
6203
6204   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6205   csi_matrix_size = ns*(3+(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size));
6206   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6207   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6208   offset += csi_matrix_size;
6209   return offset - start_offset;
6210 }
6211
6212 static int
6213 add_mimo_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
6214 {
6215   proto_tree *snr_tree;
6216   int         csi_matrix_size, start_offset;
6217   int         ns, i;
6218
6219   start_offset = offset;
6220   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc, ett_mimo_report, NULL, "Signal to Noise Ratio");
6221
6222   for (i = 1; i <= mimo_cntrl.nc; i++)
6223   {
6224     guint8 snr;
6225
6226     snr = tvb_get_guint8(tvb, offset);
6227     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
6228                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
6229     offset += 1;
6230   }
6231
6232   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6233   csi_matrix_size = ns*(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size);
6234   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6235   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_bf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6236   offset += csi_matrix_size;
6237   return offset - start_offset;
6238 }
6239
6240 static int
6241 add_mimo_compressed_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
6242 {
6243   proto_tree *snr_tree;
6244   int         csi_matrix_size, start_offset;
6245   int         ns, na, i;
6246
6247   start_offset = offset;
6248   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
6249                         ett_mimo_report, NULL, "Signal to Noise Ratio");
6250
6251   for (i = 1; i <= mimo_cntrl.nc; i++)
6252   {
6253     gint8 snr;
6254     char edge_sign;
6255
6256     snr = tvb_get_gint8(tvb, offset);
6257
6258     switch(snr) {
6259       case -128:
6260         edge_sign = '<';
6261         break;
6262       case 127:
6263         edge_sign = '>';
6264         break;
6265       default:
6266         edge_sign = ' ';
6267         break;
6268     }
6269     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
6270                                snr, "Stream %d - Signal to Noise Ratio: %c%3.2fdB", i, edge_sign,snr/4.0+22.0);
6271     offset += 1;
6272   }
6273
6274   na = get_mimo_na(mimo_cntrl.nr, mimo_cntrl.nc);
6275   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
6276   csi_matrix_size = ns*(na*((mimo_cntrl.codebook_info+1)*2 + 2)/2);
6277   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
6278   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_cbf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
6279   offset += csi_matrix_size;
6280   return offset - start_offset;
6281 }
6282
6283 static void
6284 mesh_active_window_base_custom(gchar *result, guint32 mesh_active_window)
6285 {
6286   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (mesh_active_window * 1024.0 / 1000000));
6287 }
6288
6289 /* ************************************************************************* */
6290 /*          This is the capture function used to update packet counts        */
6291 /* ************************************************************************* */
6292 static gboolean
6293 capture_ieee80211_common(const guchar * pd, int offset, int len,
6294                           capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_, gboolean datapad)
6295 {
6296   guint16 fcf, hdr_length;
6297
6298   if (!BYTES_ARE_IN_FRAME(offset, len, 2))
6299     return FALSE;
6300
6301   fcf = pletoh16(&pd[offset]);
6302
6303   if (IS_PROTECTED(FCF_FLAGS(fcf)) && (wlan_ignore_prot == WLAN_IGNORE_PROT_NO))
6304     return FALSE;
6305
6306   switch (COMPOSE_FRAME_TYPE (fcf)) {
6307
6308     case DATA:
6309     case DATA_CF_ACK:
6310     case DATA_CF_POLL:
6311     case DATA_CF_ACK_POLL:
6312     case DATA_QOS_DATA:
6313     case DATA_QOS_DATA_CF_ACK:
6314     case DATA_QOS_DATA_CF_POLL:
6315     case DATA_QOS_DATA_CF_ACK_POLL:
6316     {
6317       /* These are data frames that actually contain *data*. */
6318       hdr_length = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
6319
6320       if (DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
6321         /* QoS frame, so the header includes a QoS field */
6322         guint16 qosoff;  /* Offset of the 2-byte QoS field */
6323         guint8 mesh_flags;
6324
6325         qosoff = hdr_length;
6326         hdr_length += 2; /* Include the QoS field in the header length */
6327
6328         if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
6329           /* Frame has a 4-byte HT Control field */
6330           hdr_length += 4;
6331         }
6332
6333         /*
6334          * Does it look as if we have a mesh header?
6335          * Look at the Mesh Control subfield of the QoS field and at the
6336          * purported mesh flag fields.
6337          */
6338         if (!BYTES_ARE_IN_FRAME(offset, hdr_length, 1))
6339           return FALSE;
6340
6341         mesh_flags = pd[hdr_length];
6342         if (has_mesh_control(fcf, pletoh16(&pd[qosoff]), mesh_flags)) {
6343           /* Yes, add the length of that in as well. */
6344           hdr_length += find_mesh_control_length(mesh_flags);
6345         }
6346
6347         if (datapad) {
6348           /*
6349            * Include the padding between the 802.11 header and the body,
6350            * as "helpfully" provided by some Atheros adapters.
6351            *
6352            * XXX - would the mesh header be part of the header or the body
6353            * from the point of view of the Atheros adapters that insert
6354            * the padding, assuming they even recognize a mesh header?
6355            */
6356           hdr_length = roundup2(hdr_length, 4);
6357         }
6358       }
6359       /* I guess some bridges take Netware Ethernet_802_3 frames,
6360          which are 802.3 frames (with a length field rather than
6361          a type field, but with no 802.2 header in the payload),
6362          and just stick the payload into an 802.11 frame.  I've seen
6363          captures that show frames of that sort.
6364
6365          We also handle some odd form of encapsulation in which a
6366          complete Ethernet frame is encapsulated within an 802.11
6367          data frame, with no 802.2 header.  This has been seen
6368          from some hardware.
6369
6370          On top of that, at least at some point it appeared that
6371          the OLPC XO sent out frames with two bytes of 0 between
6372          the "end" of the 802.11 header and the beginning of
6373          the payload.
6374
6375          So, if the packet doesn't start with 0xaa 0xaa:
6376
6377            we first use the same scheme that linux-wlan-ng does to detect
6378            those encapsulated Ethernet frames, namely looking to see whether
6379            the frame either starts with 6 octets that match the destination
6380            address from the 802.11 header or has 6 octets that match the
6381            source address from the 802.11 header following the first 6 octets,
6382            and, if so, treat it as an encapsulated Ethernet frame;
6383
6384            otherwise, we use the same scheme that we use in the Ethernet
6385            dissector to recognize Netware 802.3 frames, namely checking
6386            whether the packet starts with 0xff 0xff and, if so, treat it
6387            as an encapsulated IPX frame, and then check whether the
6388            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
6389            frame. */
6390       if (!BYTES_ARE_IN_FRAME(offset+hdr_length, len, 2))
6391         return FALSE;
6392
6393       if ((pd[offset+hdr_length] != 0xaa) && (pd[offset+hdr_length+1] != 0xaa)) {
6394 #if 0
6395         /* XXX - this requires us to parse the header to find the source
6396            and destination addresses. */
6397         if (BYTES_ARE_IN_FRAME(offset+hdr_length, len, 12)) {
6398           /* We have two MAC addresses after the header. */
6399           if ((memcmp(&pd[offset+hdr_length+6], pinfo->dl_src.data, 6) == 0) ||
6400               (memcmp(&pd[offset+hdr_length+6], pinfo->dl_dst.data, 6) == 0)) {
6401             return capture_eth (pd, offset + hdr_length, len, cpinfo, pseudo_header);
6402           }
6403         }
6404 #endif
6405         if ((pd[offset+hdr_length] == 0xff) && (pd[offset+hdr_length+1] == 0xff))
6406           return call_capture_dissector (ipx_cap_handle, pd, offset+hdr_length, len, cpinfo, pseudo_header);
6407         else if ((pd[offset+hdr_length] == 0x00) && (pd[offset+hdr_length+1] == 0x00))
6408           return call_capture_dissector (llc_cap_handle, pd, offset + hdr_length + 2, len, cpinfo, pseudo_header);
6409       }
6410       else {
6411         return call_capture_dissector (llc_cap_handle, pd, offset + hdr_length, len, cpinfo, pseudo_header);
6412       }
6413       break;
6414     }
6415   }
6416
6417   return FALSE;
6418 }
6419
6420 /*
6421  * Handle 802.11 with a variable-length link-layer header.
6422  */
6423 static gboolean
6424 capture_ieee80211(const guchar * pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
6425 {
6426   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, FALSE);
6427 }
6428
6429 /*
6430  * Handle 802.11 with a variable-length link-layer header and data padding.
6431  */
6432 static gboolean
6433 capture_ieee80211_datapad(const guchar * pd, int offset, int len,
6434                            capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
6435 {
6436   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, TRUE);
6437 }
6438
6439
6440 /* ************************************************************************* */
6441 /*          Add the subtree used to store the fixed parameters               */
6442 /* ************************************************************************* */
6443 static proto_tree *
6444 get_fixed_parameter_tree(proto_tree * tree, tvbuff_t *tvb, int start, int size)
6445 {
6446   proto_item *fixed_fields;
6447
6448   fixed_fields = proto_tree_add_item(tree, hf_ieee80211_fixed_parameters, tvb, start, size, ENC_NA);
6449   proto_item_append_text(fixed_fields, " (%d bytes)", size);
6450
6451   return proto_item_add_subtree(fixed_fields, ett_fixed_parameters);
6452 }
6453
6454
6455 /* ************************************************************************* */
6456 /*            Add the subtree used to store tagged parameters                */
6457 /* ************************************************************************* */
6458 static proto_tree *
6459 get_tagged_parameter_tree(proto_tree * tree, tvbuff_t *tvb, int start, int size)
6460 {
6461   proto_item *tagged_fields;
6462
6463   tagged_fields = proto_tree_add_item(tree, hf_ieee80211_tagged_parameters, tvb, start, -1, ENC_NA);
6464   proto_item_append_text(tagged_fields, " (%d bytes)", size);
6465
6466   return proto_item_add_subtree(tagged_fields, ett_tagged_parameters);
6467 }
6468
6469
6470 static int
6471 dissect_vendor_action_marvell(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
6472 {
6473   guint8 octet;
6474   int offset = 0;
6475
6476   octet = tvb_get_guint8(tvb, offset);
6477   proto_tree_add_item(tree, hf_ieee80211_ff_marvell_action_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6478   offset += 1;
6479   switch (octet)
6480     {
6481       case MRVL_ACTION_MESH_MANAGEMENT:
6482         octet = tvb_get_guint8(tvb, offset);
6483         proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6484         offset += 1;
6485         switch (octet)
6486           {
6487             case MRVL_MESH_MGMT_ACTION_RREQ:
6488               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6489               offset += 1;
6490               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6491               offset += 1;
6492               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6493               offset += 1;
6494               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6495               offset += 1;
6496               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_rreqid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6497               offset += 4;
6498               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
6499               offset += 6;
6500               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6501               offset += 4;
6502               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6503               offset += 4;
6504               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6505               offset += 4;
6506               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6507               offset += 1;
6508               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6509               offset += 1;
6510               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6511               offset += 6;
6512               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6513               offset += 4;
6514               break;
6515             case MRVL_MESH_MGMT_ACTION_RREP:
6516               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6517               offset += 1;
6518               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6519               offset += 1;
6520               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6521               offset += 1;
6522               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6523               offset += 1;
6524               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6525               offset += 6;
6526               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6527               offset += 4;
6528               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6529               offset += 4;
6530               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6531               offset += 4;
6532               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
6533               offset += 6;
6534               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6535               offset += 4;
6536               break;
6537             case MRVL_MESH_MGMT_ACTION_RERR:
6538               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6539               offset += 1;
6540               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6541               offset += 1;
6542               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6543               offset += 1;
6544               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
6545               offset += 6;
6546               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
6547               offset += 4;
6548               break;
6549             default:
6550               break;
6551           }
6552         break;
6553       default:
6554         break;
6555     }
6556
6557   return offset;
6558 }
6559
6560 static int
6561 dissect_vendor_action_wifi_alliance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
6562 {
6563   guint8 subtype;
6564   int offset = 0;
6565   int dissected;
6566   tvbuff_t *subtvb;
6567
6568   subtype = tvb_get_guint8(tvb, offset);
6569   proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
6570   offset += 1;
6571
6572   subtvb = tvb_new_subset_remaining(tvb, offset);
6573   dissected = dissector_try_uint_new(wifi_alliance_action_subtype_table, subtype, subtvb, pinfo, tree, FALSE, NULL);
6574   if (dissected <= 0)
6575   {
6576       call_data_dissector(subtvb, pinfo, tree);
6577       dissected = tvb_reported_length(subtvb);
6578   }
6579
6580   offset += dissected;
6581
6582   return offset;
6583 }
6584
6585 /*
6586  * This function is called from two different places. In one case it is called
6587  * without the tag and length. In other cases, it is called with those and
6588  * is asked to return the type and subtype. We know the difference because
6589  * type and subtype will be NULL in the first case.
6590  */
6591 static guint
6592 dissect_advertisement_protocol_common(packet_info *pinfo, proto_tree *tree,
6593                                tvbuff_t *tvb, int offset, guint *type,
6594                                guint *subtype)
6595 {
6596   guint8      tag_no = 0, tag_len, left;
6597   proto_item *item = NULL, *adv_item;
6598   proto_tree *adv_tree, *adv_tuple_tree;
6599
6600   if (type)
6601     *type = 0xff; // Last reserved value
6602   if (subtype)
6603     *subtype = 0xff;
6604   tag_no = tvb_get_guint8(tvb, offset);
6605   if (type)
6606     item = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6607
6608   /*
6609    * If we have the tag and len, use the len in the tvb, otherwise ask
6610    * for the length of the tvb.
6611    */
6612   if (type)
6613     tag_len = tvb_get_guint8(tvb, offset + 1);
6614   else
6615     tag_len = tvb_reported_length_remaining(tvb, 0);
6616
6617   if (type && tag_no != TAG_ADVERTISEMENT_PROTOCOL) {
6618     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_number,
6619                            "Unexpected IE %d (expected Advertisement "
6620                            "Protocol)", tag_no);
6621     return 2 + tag_len;
6622   }
6623   if (type)
6624     item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
6625   if (tag_len < 2) {
6626     if (!type)
6627       item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
6628     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
6629                            "Advertisement Protocol: IE must be at least 2 "
6630                            "octets long");
6631     return 2 + tag_len;
6632   }
6633
6634   left = tag_len;
6635   if (type) /* Skip past the header if there ... */
6636     offset += 2;
6637   adv_tree = proto_tree_add_subtree(tree, tvb, offset, left,
6638                                  ett_adv_proto, &adv_item, "Advertisement Protocol element");
6639
6640   while (left >= 2) {
6641     guint8 id;
6642
6643     id = tvb_get_guint8(tvb, offset + 1);
6644     if (id == 0)
6645       proto_item_append_text(adv_item, ": ANQP");
6646     adv_tuple_tree = proto_tree_add_subtree_format(adv_tree, tvb, offset, 2, ett_adv_proto_tuple, &item,
6647                                "Advertisement Protocol Tuple: %s",
6648                                val_to_str(id, adv_proto_id_vals,
6649                                           "Unknown (%d)"));
6650
6651     proto_tree_add_item(adv_tuple_tree,
6652                         hf_ieee80211_tag_adv_proto_resp_len_limit, tvb,
6653                         offset, 1, ENC_LITTLE_ENDIAN);
6654     proto_tree_add_item(adv_tuple_tree,
6655                         hf_ieee80211_tag_adv_proto_pame_bi, tvb,
6656                         offset, 1, ENC_LITTLE_ENDIAN);
6657     offset += 1;
6658     left--;
6659     proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_proto_id, tvb,
6660                         offset, 1, ENC_LITTLE_ENDIAN);
6661     offset += 1;
6662     left--;
6663
6664     if ((id == 0) && type)
6665       *type = ADV_PROTO_ID_ANQP;
6666
6667     if (id == 221) {
6668       /* Vendor specific */
6669       guint8 len = tvb_get_guint8(tvb, offset);
6670       guint oui;
6671       guint8 wfa_subtype;
6672       proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_vs_len, tvb, offset, 1, ENC_NA);
6673       offset += 1;
6674       left   -= 1;
6675       if (type)
6676         *type = ADV_PROTO_ID_VS;
6677       if (len > left) {
6678         expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
6679                                "Vendor specific info length error");
6680         return 2 + tag_len;
6681       }
6682       proto_tree_add_item_ret_uint(adv_tuple_tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
6683       offset += 3;
6684       left   -= 3;
6685       wfa_subtype = tvb_get_guint8(tvb, offset);
6686       proto_tree_add_item(adv_tuple_tree, hf_ieee80211_anqp_wfa_subtype, tvb,
6687                         offset, 1, ENC_NA);
6688       offset += 1;
6689       left   -= 1;
6690       if (oui == OUI_WFA) {
6691         proto_tree_add_item(adv_tuple_tree, hf_ieee80211_dpp_subtype, tvb, offset, 1, ENC_NA);
6692         if (subtype && wfa_subtype == WFA_SUBTYPE_DPP) {
6693           *subtype = WFA_SUBTYPE_DPP;
6694           *subtype |= (tvb_get_guint8(tvb, offset) << 8);
6695         }
6696         offset++;
6697         left--;
6698       }
6699     }
6700   }
6701
6702   if (left) {
6703     expert_add_info_format(pinfo, item, &ei_ieee80211_extra_data,
6704                            "Unexpected extra data in the end");
6705   }
6706
6707   return 2 + tag_len;
6708 }
6709
6710 static int
6711 dissect_advertisement_protocol(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
6712 {
6713   return dissect_advertisement_protocol_common(pinfo, tree, tvb, 0, NULL, NULL);
6714 }
6715
6716 static void
6717 dissect_anqp_query_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6718 {
6719   while (offset + 2 <= end) {
6720     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_query_id,
6721                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6722     offset += 2;
6723   }
6724   if (offset != end) {
6725     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
6726                            "Unexpected ANQP Query list format");
6727   }
6728 }
6729
6730 static void
6731 dissect_hs20_anqp_hs_capability_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6732 {
6733   while (offset < end) {
6734     proto_tree_add_item(tree, hf_hs20_anqp_hs_capability_list,
6735                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6736     offset++;
6737   }
6738 }
6739
6740 static void
6741 dissect_anqp_capab_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6742 {
6743   guint16     id, len;
6744   proto_item *item;
6745   proto_tree *vtree;
6746   guint32     oui;
6747   guint8      subtype;
6748
6749   while (offset + 2 <= end) {
6750     id = tvb_get_letohs(tvb, offset);
6751     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_capability,
6752                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6753     offset += 2;
6754     if (id == ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
6755       vtree = proto_item_add_subtree(item, ett_anqp_vendor_capab);
6756       len = tvb_get_letohs(tvb, offset);
6757       proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vlen,
6758                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
6759       offset += 2;
6760       if ((len < 3) || ((offset + len) > end)) {
6761         expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_capability);
6762         return;
6763       }
6764       proto_tree_add_item_ret_uint(vtree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
6765       offset += 3;
6766       len    -= 3;
6767
6768       switch (oui) {
6769       case OUI_WFA:
6770         if (len == 0)
6771           break;
6772         subtype = tvb_get_guint8(tvb, offset);
6773         proto_item_append_text(vtree, " - WFA - %s",
6774                                val_to_str(subtype, wfa_subtype_vals,
6775                                           "Unknown (%u)"));
6776         proto_tree_add_item(vtree, hf_ieee80211_anqp_wfa_subtype,
6777                             tvb, offset, 1, ENC_NA);
6778         offset++;
6779         len--;
6780         switch (subtype) {
6781         case WFA_SUBTYPE_HS20_ANQP:
6782           dissect_hs20_anqp_hs_capability_list(vtree, tvb, offset, end);
6783           break;
6784         default:
6785           proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
6786                               tvb, offset, len, ENC_NA);
6787           break;
6788         }
6789         break;
6790       default:
6791         proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
6792                             tvb, offset, len, ENC_NA);
6793         break;
6794       }
6795
6796       offset += len;
6797     }
6798   }
6799   if (offset != end) {
6800     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
6801                            "Unexpected ANQP Capability list format");
6802   }
6803 }
6804
6805 static const value_string venue_group_vals[] = {
6806   {  0, "Unspecified" },
6807   {  1, "Assembly" },
6808   {  2, "Business" },
6809   {  3, "Educational" },
6810   {  4, "Factory and Industrial" },
6811   {  5, "Institutional" },
6812   {  6, "Mercantile" },
6813   {  7, "Residential" },
6814   {  8, "Storage" },
6815   {  9, "Utility and Miscellaneous" },
6816   { 10, "Vehicular" },
6817   { 11, "Outdoor" },
6818   { 0, NULL }
6819 };
6820 static value_string_ext venue_group_vals_ext = VALUE_STRING_EXT_INIT(venue_group_vals);
6821
6822 static void
6823 dissect_venue_info(proto_tree *tree, tvbuff_t *tvb, int offset)
6824 {
6825   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_group,
6826                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6827   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_type,
6828                       tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
6829 }
6830
6831 static void
6832 dissect_venue_name_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6833 {
6834   proto_item *item;
6835
6836   dissect_venue_info(tree, tvb, offset);
6837   offset += 2;
6838   while (offset + 4 <= end) {
6839     guint8 vlen = tvb_get_guint8(tvb, offset);
6840     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_length,
6841                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6842     offset += 1;
6843     if ((vlen > (end - offset)) || (vlen < 3)) {
6844       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_venue_length);
6845       break;
6846     }
6847     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_language,
6848                         tvb, offset, 3, ENC_ASCII|ENC_NA);
6849     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_name,
6850                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
6851     offset += vlen;
6852   }
6853 }
6854
6855 static const value_string nw_auth_type_vals[] = {
6856   { 0, "Acceptance of terms and conditions" },
6857   { 1, "On-line enrollment supported" },
6858   { 2, "http/https redirection" },
6859   { 3, "DNS redirection" },
6860   { 0, NULL }
6861 };
6862
6863 static void
6864 dissect_network_auth_type(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6865 {
6866   while (offset + 3 <= end) {
6867     guint16 len;
6868     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_indicator,
6869                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6870     offset += 1;
6871     len = tvb_get_letohs(tvb, offset);
6872     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url_len,
6873                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6874     offset += 2;
6875     if (len)
6876       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url,
6877                           tvb, offset, len, ENC_ASCII|ENC_NA);
6878     offset += len;
6879   }
6880 }
6881
6882 static void
6883 add_manuf(proto_item *item, tvbuff_t *tvb, int offset)
6884 {
6885   const gchar *manuf_name;
6886
6887   manuf_name = tvb_get_manuf_name_if_known(tvb, offset);
6888   if (manuf_name == NULL)
6889     return;
6890   proto_item_append_text(item, " - %s", manuf_name);
6891 }
6892
6893 static void
6894 dissect_roaming_consortium_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6895                                 int end)
6896 {
6897   proto_item *item;
6898   guint8      len;
6899
6900   while (offset < end) {
6901     len = tvb_get_guint8(tvb, offset);
6902     item = proto_tree_add_item(tree,
6903                                hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
6904                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6905     offset += 1;
6906     if ((len > (end - offset)) || (len < 3)) {
6907       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_roaming_consortium_oi_len);
6908       break;
6909     }
6910     item = proto_tree_add_item(tree,
6911                                hf_ieee80211_ff_anqp_roaming_consortium_oi,
6912                                tvb, offset, len, ENC_NA);
6913     add_manuf(item, tvb, offset);
6914     offset += len;
6915   }
6916 }
6917
6918 static const value_string ip_addr_avail_ipv6_vals[] = {
6919   { 0, "Address type not available" },
6920   { 1, "Address type available" },
6921   { 2, "Availability of the address type not known" },
6922   { 0, NULL }
6923 };
6924
6925 static const value_string ip_addr_avail_ipv4_vals[] = {
6926   { 0, "Address type not available" },
6927   { 1, "Public IPv4 address available" },
6928   { 2, "Port-restricted IPv4 address available" },
6929   { 3, "Single NATed private IPv4 address available" },
6930   { 4, "Double NATed private IPv4 address available" },
6931   { 5, "Port-restricted IPv4 address and single NATed IPv4 address available" },
6932   { 6, "Port-restricted IPv4 address and double NATed IPv4 address available" },
6933   { 7, "Availability of the address type is not known" },
6934   { 0, NULL }
6935 };
6936
6937 static void
6938 dissect_ip_addr_type_availability_info(proto_tree *tree, tvbuff_t *tvb,
6939                                        int offset)
6940 {
6941   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
6942                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6943   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
6944                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6945 }
6946
6947 static const value_string nai_realm_encoding_vals[] = {
6948   { 0, "Formatted in accordance with RFC 4282" },
6949   { 1, "UTF-8 formatted that is not formatted in accordance with RFC 4282" },
6950   { 0, NULL }
6951 };
6952
6953 static const value_string nai_realm_auth_param_id_vals[] = {
6954   {   1, "Expanded EAP Method" },
6955   {   2, "Non-EAP Inner Authentication Type" },
6956   {   3, "Inner Authentication EAP Method Type" },
6957   {   4, "Expanded Inner EAP Method" },
6958   {   5, "Credential Type" },
6959   {   6, "Tunneled EAP Method Credential Type" },
6960   { 221, "Vendor Specific" },
6961   { 0, NULL }
6962 };
6963
6964 static void
6965 dissect_nai_realm_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6966 {
6967   guint16       count, len;
6968   proto_item   *item, *r_item;
6969   int           f_end, eap_end;
6970   guint8        nai_len, eap_count, eap_len, auth_param_count, auth_param_len;
6971   guint8        auth_param_id;
6972   proto_tree   *realm_tree, *eap_tree;
6973   const guint8 *realm;
6974
6975   count = tvb_get_letohs(tvb, offset);
6976   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nai_realm_count,
6977                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6978   offset += 2;
6979   while (count > 0) {
6980     len = tvb_get_letohs(tvb, offset);
6981     realm_tree = proto_tree_add_subtree(tree, tvb, offset, 2 + len, ett_nai_realm, &r_item, "NAI Realm Data");
6982
6983     item = proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_field_len,
6984                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6985     offset += 2;
6986     if (offset + len > end) {
6987       expert_add_info_format(pinfo, item, &ei_ieee80211_ff_anqp_nai_field_len,
6988                              "Invalid NAI Realm List");
6989       break;
6990     }
6991     f_end = offset + len;
6992     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_encoding,
6993                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6994     offset += 1;
6995     nai_len = tvb_get_guint8(tvb, offset);
6996     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_length,
6997                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6998     offset += 1;
6999     if (offset + nai_len > f_end) {
7000       expert_add_info_format(pinfo, r_item, &ei_ieee80211_ff_anqp_nai_field_len,
7001                              "Invalid NAI Realm Data");
7002       break;
7003     }
7004     proto_tree_add_item_ret_string(realm_tree, hf_ieee80211_ff_anqp_nai_realm,
7005                         tvb, offset, nai_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &realm);
7006     if (realm) {
7007       proto_item_append_text(r_item, " (%s)", realm);
7008     }
7009     offset += nai_len;
7010     eap_count = tvb_get_guint8(tvb, offset);
7011     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_eap_count,
7012                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7013     offset += 1;
7014
7015     while (eap_count > 0) {
7016       eap_len = tvb_get_guint8(tvb, offset);
7017       eap_end = offset + 1 + eap_len;
7018       eap_tree = proto_tree_add_subtree(realm_tree, tvb, offset, 1 + eap_len,
7019                                  ett_nai_realm_eap, NULL, "EAP Method");
7020
7021       item = proto_tree_add_item(eap_tree,
7022                                  hf_ieee80211_ff_anqp_nai_realm_eap_len,
7023                                  tvb, offset, 1, ENC_LITTLE_ENDIAN);
7024       offset += 1;
7025       if (offset + eap_len > f_end) {
7026         expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_nai_realm_eap_len);
7027         break;
7028       }
7029
7030       proto_item_append_text(eap_tree, ": %s",
7031                              val_to_str_ext(tvb_get_guint8(tvb, offset),
7032                                             &eap_type_vals_ext, "Unknown (%d)"));
7033       proto_tree_add_item(eap_tree, hf_ieee80211_ff_anqp_nai_realm_eap_method,
7034                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
7035       offset += 1;
7036       auth_param_count = tvb_get_guint8(tvb, offset);
7037       proto_tree_add_item(eap_tree,
7038                           hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
7039                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
7040       offset += 1;
7041
7042       while (auth_param_count > 0) {
7043         auth_param_id = tvb_get_guint8(tvb, offset);
7044         proto_tree_add_item(eap_tree,
7045                             hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
7046                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
7047         offset += 1;
7048         auth_param_len = tvb_get_guint8(tvb, offset);
7049         proto_tree_add_item(eap_tree,
7050                             hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
7051                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
7052         offset += 1;
7053         item = proto_tree_add_item(
7054           eap_tree, hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
7055           tvb, offset, auth_param_len, ENC_NA);
7056         if ((auth_param_id == 3) && (auth_param_len == 1)) {
7057           guint8 inner_method = tvb_get_guint8(tvb, offset);
7058           const char *str;
7059           str = val_to_str_ext(inner_method, &eap_type_vals_ext, "Unknown (%d)");
7060
7061           proto_item_append_text(eap_tree, " / %s", str);
7062           proto_item_append_text(item, " - %s", str);
7063         }
7064         offset += auth_param_len;
7065
7066         auth_param_count--;
7067       }
7068
7069       offset = eap_end;
7070       eap_count--;
7071     }
7072
7073     offset = f_end;
7074     count--;
7075   }
7076 }
7077
7078 static void
7079 dissect_3gpp_cellular_network_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7080 {
7081   guint8      iei, num, plmn_idx = 0;
7082   proto_item *item;
7083
7084   /* See Annex A of 3GPP TS 24.234 v8.1.0 for description */
7085   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_gud, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7086   offset += 1;
7087   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_udhl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7088   offset += 1;
7089   iei = tvb_get_guint8(tvb, offset);
7090   item = proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_iei, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7091   if (iei == 0)
7092     proto_item_append_text(item, " (PLMN List)");
7093   else
7094     return;
7095   offset += 1;
7096   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_plmn_len, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7097   offset += 1;
7098   num = tvb_get_guint8(tvb, offset);
7099   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_num_plmns, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7100   offset += 1;
7101   while (num > 0) {
7102     proto_item *plmn_item = NULL;
7103     proto_tree *plmn_tree = NULL;
7104     guint plmn_val = 0;
7105
7106     if (tvb_reported_length_remaining(tvb, offset) < 3)
7107       break;
7108     plmn_val = tvb_get_letoh24(tvb, offset);
7109     plmn_item = proto_tree_add_uint_format(tree, hf_ieee80211_3gpp_gc_plmn,
7110                                 tvb, offset, 3, plmn_val, "PLMN %d (0x%x)",
7111                                 plmn_idx++, plmn_val);
7112     plmn_tree = proto_item_add_subtree(plmn_item, ett_ieee80211_3gpp_plmn);
7113     dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, plmn_tree, offset, E212_NONE, TRUE);
7114     num--;
7115     offset += 3;
7116   }
7117 }
7118
7119 static void
7120 dissect_domain_name_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7121 {
7122   guint8 len;
7123
7124   while (offset < end) {
7125     len = tvb_get_guint8(tvb, offset);
7126     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name_len,
7127                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7128     offset += 1;
7129     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name,
7130                         tvb, offset, len, ENC_ASCII|ENC_NA);
7131     offset += len;
7132   }
7133 }
7134
7135 static int
7136 dissect_hs20_subscription_remediation(tvbuff_t *tvb, packet_info *pinfo _U_,
7137   proto_tree *tree, void *data _U_)
7138 {
7139   int offset = 0;
7140   guint8 url_len = tvb_get_guint8(tvb, offset);
7141   proto_item *pi = NULL;
7142
7143   proto_tree_add_item(tree, hf_hs20_subscription_remediation_url_len, tvb, offset,
7144                         1, ENC_NA);
7145   offset++;
7146   if (tvb_reported_length_remaining(tvb, offset) >= url_len) {
7147     pi = proto_tree_add_item(tree, hf_hs20_subscription_remediation_server_url,
7148                         tvb, offset, url_len, ENC_ASCII|ENC_NA);
7149     offset += url_len;
7150     PROTO_ITEM_SET_URL(pi);
7151     proto_tree_add_item(tree, hf_hs20_subscription_remediation_server_method,
7152                         tvb, offset, 1, ENC_NA);
7153     offset++;
7154   }
7155
7156   return offset;
7157 }
7158
7159 static int
7160 dissect_hs20_deauthentication_imminent(tvbuff_t *tvb, packet_info *pinfo _U_,
7161   proto_tree *tree, void *data _U_)
7162 {
7163   int offset = 0;
7164   guint8 url_len = 0;
7165   proto_item *pi = NULL;
7166
7167   proto_tree_add_item(tree, hf_hs20_deauth_reason_code, tvb, offset, 1, ENC_NA);
7168   offset++;
7169
7170   proto_tree_add_item(tree, hf_hs20_reauth_delay, tvb, offset, 2,
7171                         ENC_LITTLE_ENDIAN);
7172   offset += 2;
7173
7174   url_len = tvb_get_guint8(tvb, offset);
7175   proto_tree_add_item(tree, hf_hs20_deauth_reason_url_len, tvb, offset, 1,
7176                         ENC_NA);
7177   offset++;
7178
7179   if (tvb_reported_length_remaining(tvb, offset) >= url_len) {
7180     pi = proto_tree_add_item(tree, hf_hs20_deauth_imminent_reason_url,
7181                         tvb, offset, url_len, ENC_ASCII|ENC_NA);
7182     offset += url_len;
7183     PROTO_ITEM_SET_URL(pi);
7184   }
7185   return offset;
7186 }
7187
7188 #define HS20_ANQP_HS_QUERY_LIST              1
7189 #define HS20_ANQP_HS_CAPABILITY_LIST         2
7190 #define HS20_ANQP_OPERATOR_FRIENDLY_NAME     3
7191 #define HS20_ANQP_WAN_METRICS                4
7192 #define HS20_ANQP_CONNECTION_CAPABILITY      5
7193 #define HS20_ANQP_NAI_HOME_REALM_QUERY       6
7194 #define HS20_ANQP_OPERATING_CLASS_INDICATION 7
7195 #define HS20_ANQP_OSU_PROVIDERS_LIST         8
7196 /* 9 is reserved */
7197 #define HS20_ANQP_ICON_REQUEST               10
7198 #define HS20_ANQP_ICON_BINARY_FILE           11
7199 #define HS20_ANQP_OPERATOR_ICON_METADATA     12
7200 #define HS20_ANQP_ADVICE_OF_CHARGE           13
7201
7202 static const value_string hs20_anqp_subtype_vals[] = {
7203   { HS20_ANQP_HS_QUERY_LIST, "HS Query list" },
7204   { HS20_ANQP_HS_CAPABILITY_LIST, "HS Capability List" },
7205   { HS20_ANQP_OPERATOR_FRIENDLY_NAME, "Operator Friendly Name" },
7206   { HS20_ANQP_WAN_METRICS, "WAN Metrics" },
7207   { HS20_ANQP_CONNECTION_CAPABILITY, "Connection Capability" },
7208   { HS20_ANQP_NAI_HOME_REALM_QUERY, "NAI Home Realm Query" },
7209   { HS20_ANQP_OPERATING_CLASS_INDICATION, "Operating Class Indication" },
7210   { HS20_ANQP_OSU_PROVIDERS_LIST, "OSU Providers List" },
7211   { HS20_ANQP_ICON_REQUEST, "Icon Request" },
7212   { HS20_ANQP_ICON_BINARY_FILE, "Icon Binary File" },
7213   { HS20_ANQP_OPERATOR_ICON_METADATA, "Operator Icon Metadata" },
7214   { HS20_ANQP_ADVICE_OF_CHARGE, "Advice of Charge" },
7215   { 0, NULL }
7216 };
7217
7218 static void
7219 dissect_hs20_anqp_hs_query_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7220 {
7221   while (offset < end) {
7222     proto_tree_add_item(tree, hf_hs20_anqp_hs_query_list,
7223                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7224     offset++;
7225   }
7226 }
7227
7228 static void
7229 dissect_hs20_anqp_operator_friendly_name(proto_tree *tree, tvbuff_t *tvb,
7230                                          packet_info *pinfo, int offset,
7231                                          int end, int hf_array[],
7232                                          gint ett_val)
7233 {
7234   int ofn_index = 0;
7235
7236   while (offset + 4 <= end) {
7237     guint8 vlen = tvb_get_guint8(tvb, offset);
7238     proto_tree *ofn_tree = NULL;
7239     proto_item *item = NULL, *pi = NULL;
7240     int start_offset = offset;
7241
7242     ofn_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_val,
7243                                         &pi, "Friendly Name %d", ofn_index);
7244
7245     item = proto_tree_add_item(ofn_tree, hf_array[0],
7246                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
7247     offset++;
7248     if (vlen > end - offset || vlen < 3) {
7249       expert_add_info(pinfo, item, &ei_hs20_anqp_ofn_length);
7250       break;
7251     }
7252     proto_tree_add_item(tree, hf_array[1],
7253                         tvb, offset, 3, ENC_ASCII|ENC_NA);
7254     proto_tree_add_item(tree, hf_array[2],
7255                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
7256     offset += vlen;
7257
7258     proto_item_set_len(pi, offset - start_offset);
7259     ofn_index++;
7260   }
7261 }
7262
7263 static const value_string hs20_wm_link_status_vals[] = {
7264   { 0, "Reserved" },
7265   { 1, "Link up" },
7266   { 2, "Link down" },
7267   { 3, "Link in test state" },
7268   { 0, NULL }
7269 };
7270
7271 static void
7272 dissect_hs20_anqp_wan_metrics(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean request)
7273 {
7274   if (request)
7275     return;
7276
7277   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_link_status,
7278                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7279   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_symmetric_link,
7280                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7281   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_at_capacity,
7282                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7283   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_reserved,
7284                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7285   offset++;
7286
7287   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_speed,
7288                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
7289   offset += 4;
7290
7291   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_speed,
7292                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
7293   offset += 4;
7294
7295   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_load,
7296                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7297   offset++;
7298
7299   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_load,
7300                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7301   offset++;
7302
7303   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_lmd,
7304                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7305 }
7306
7307 static const value_string hs20_cc_status_vals[] = {
7308   { 0, "Closed" },
7309   { 1, "Open" },
7310   { 2, "Unknown" },
7311   { 0, NULL }
7312 };
7313
7314 static void
7315 dissect_hs20_anqp_connection_capability(proto_tree *tree, tvbuff_t *tvb,
7316                                         int offset, int end)
7317 {
7318   proto_tree *tuple;
7319   while (offset + 4 <= end) {
7320     guint8 ip_proto, status;
7321     guint16 port_num;
7322
7323     ip_proto = tvb_get_guint8(tvb, offset);
7324     port_num = tvb_get_letohs(tvb, offset + 1);
7325     status = tvb_get_guint8(tvb, offset + 3);
7326
7327     tuple = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_hs20_cc_proto_port_tuple, NULL,
7328                                "ProtoPort Tuple - ip_proto=%u port_num=%u status=%s",
7329                                ip_proto, port_num,
7330                                val_to_str(status, hs20_cc_status_vals,
7331                                           "Reserved (%u)"));
7332     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_ip_proto,
7333                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7334     offset++;
7335     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_port_num,
7336                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
7337     offset += 2;
7338     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_status,
7339                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7340     offset++;
7341   }
7342 }
7343
7344 static void
7345 dissect_hs20_anqp_nai_home_realm_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
7346                                        int offset, int end)
7347 {
7348   guint8 len;
7349   proto_item *item;
7350
7351   proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_count,
7352                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
7353   offset++;
7354
7355   while (offset + 2 <= end) {
7356     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_encoding_type,
7357                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7358     offset++;
7359     len = tvb_get_guint8(tvb, offset);
7360     item = proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_length,
7361                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
7362     offset++;
7363     if (offset + len > end) {
7364       expert_add_info(pinfo, item, &ei_hs20_anqp_nai_hrq_length);
7365       break;
7366     }
7367     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_realm_name,
7368                         tvb, offset, len, ENC_ASCII|ENC_NA);
7369     offset += len;
7370   }
7371 }
7372
7373 static void
7374 dissect_hs20_anqp_oper_class_indic(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7375 {
7376   while (offset < end) {
7377     proto_tree_add_item(tree, hf_hs20_anqp_oper_class_indic,
7378                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
7379     offset++;
7380   }
7381 }
7382
7383 static int
7384 dissect_hs20_osu_friendly_names(proto_tree *tree, tvbuff_t *tvb,
7385   packet_info *pinfo, int offset, int end _U_)
7386 {
7387   int osu_fn_hf_array[3] = {hf_hs20_osu_friendly_name_length,
7388                             hf_hs20_osu_friendly_name_language,
7389                             hf_hs20_osu_friendly_name_name };
7390   guint16 osu_fn_count = tvb_get_letohs(tvb, offset);
7391   proto_tree *fn_tree = NULL;
7392
7393   proto_tree_add_item(tree, hf_hs20_osu_friendly_names_len, tvb, offset, 2,
7394                         ENC_LITTLE_ENDIAN);
7395   offset += 2;
7396
7397   fn_tree = proto_tree_add_subtree(tree, tvb, offset, osu_fn_count,
7398                         ett_hs20_friendly_names_list, NULL,
7399                         "Friendly Names List");
7400
7401   dissect_hs20_anqp_operator_friendly_name(fn_tree, tvb, pinfo, offset,
7402                         offset + osu_fn_count,
7403                         osu_fn_hf_array, ett_hs20_friendly_name_tree);
7404
7405   return offset + osu_fn_count;
7406 }
7407
7408 static int
7409 dissect_hs20_osu_icon_available(proto_tree *tree, tvbuff_t *tvb,
7410   packet_info *pinfo _U_, int offset, int end _U_, guint16 icon_index)
7411 {
7412   proto_tree *icon_avail = NULL;
7413   proto_item *pi = NULL;
7414   int start_offset = offset;
7415   guint8 icon_type_len = 0, icon_filename_len = 0;
7416
7417   icon_avail = proto_tree_add_subtree_format(tree, tvb, offset, -1,
7418                         ett_hs20_osu_icon_tree, &pi,
7419                         "Icon Available %d", icon_index);
7420
7421   proto_tree_add_item(icon_avail, hf_osu_icon_avail_width, tvb, offset, 2,
7422                         ENC_LITTLE_ENDIAN);
7423   offset += 2;
7424
7425   proto_tree_add_item(icon_avail, hf_osu_icon_avail_height, tvb, offset, 2,
7426                         ENC_LITTLE_ENDIAN);
7427   offset += 2;
7428
7429   proto_tree_add_item(icon_avail, hf_osu_icon_avail_lang_code, tvb, offset, 3,
7430                         ENC_ASCII|ENC_NA);
7431   offset += 3;
7432
7433   icon_type_len = tvb_get_guint8(tvb, offset);
7434   proto_tree_add_item(icon_avail, hf_osu_icon_avail_icon_type_len, tvb, offset,
7435                         1, ENC_NA);
7436   offset++;
7437
7438   proto_tree_add_item(icon_avail, hf_osu_icon_avail_icon_type, tvb, offset,
7439                         icon_type_len, ENC_ASCII|ENC_NA);
7440   offset += icon_type_len;
7441
7442   icon_filename_len = tvb_get_guint8(tvb, offset);
7443   proto_tree_add_item(icon_avail, hf_osu_icon_avail_filename_len, tvb, offset,
7444                         1, ENC_NA);
7445   offset++;
7446
7447   proto_tree_add_item(icon_avail, hf_osu_icon_avail_filename, tvb, offset,
7448                         icon_filename_len, ENC_ASCII|ENC_NA);
7449   offset += icon_filename_len;
7450
7451   proto_item_set_len(pi, offset - start_offset);
7452
7453   return offset;
7454 }
7455
7456 static const value_string osu_method_vals[] = {
7457   { 0, "OMA DM" },
7458   { 1, "SOAP XML SPP" },
7459   { 0, NULL },
7460 };
7461
7462 static int
7463 dissect_hs20_osu_provider(proto_tree *tree, tvbuff_t *tvb,
7464   packet_info *pinfo, int offset, int end, guint8 provider_index)
7465 {
7466   proto_tree *prov_tree = NULL;
7467   proto_item *osupi = NULL, *uri_pi = NULL;
7468   int start_offset = offset;
7469   guint8 osu_server_uri_len = 0;
7470   guint8 osu_method_list_len = 0;
7471   guint16 icons_avail = 0, icons_index = 0;
7472   guint8 osu_nai_len = 0;
7473   guint16 osu_service_desc_len = 0;
7474
7475   prov_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
7476                         ett_hs20_osu_provider_tree, &osupi,
7477                         "OSU Provider %d", provider_index);
7478
7479   proto_tree_add_item(prov_tree, hf_hs20_osu_prov_length, tvb, offset, 2,
7480                         ENC_LITTLE_ENDIAN);
7481   offset += 2;
7482
7483   offset = dissect_hs20_osu_friendly_names(prov_tree, tvb, pinfo, offset, end);
7484
7485   proto_item_set_len(osupi, offset - start_offset);
7486
7487   osu_server_uri_len = tvb_get_guint8(tvb, offset);
7488   proto_tree_add_item(prov_tree, hf_hs20_osu_server_uri_len, tvb, offset, 1,
7489                         ENC_NA);
7490   offset++;
7491
7492   uri_pi = proto_tree_add_item(prov_tree, hf_hs20_osu_server_uri, tvb, offset,
7493                         osu_server_uri_len, ENC_ASCII|ENC_NA);
7494   offset += osu_server_uri_len;
7495   PROTO_ITEM_SET_URL(uri_pi);
7496
7497   osu_method_list_len = tvb_get_guint8(tvb, offset);
7498   proto_tree_add_item(prov_tree, hf_hs20_osu_method_list_len, tvb, offset, 1,
7499                         ENC_NA);
7500   offset++;
7501
7502   if (osu_method_list_len > 0) {
7503     proto_tree *osu_method_list = NULL;
7504     guint8 osu_method_list_index = 0;
7505
7506     osu_method_list = proto_tree_add_subtree(prov_tree, tvb, offset,
7507                                 osu_method_list_len,
7508                                 ett_hs20_osu_provider_method_list,
7509                                 NULL, "OSU Method List");
7510     while (osu_method_list_len > osu_method_list_index) {
7511       proto_item *pi = NULL;
7512       guint8 method = tvb_get_guint8(tvb, offset);
7513
7514       pi = proto_tree_add_item(osu_method_list, hf_hs20_osu_method_val, tvb,
7515                         offset, 1, ENC_NA);
7516       proto_item_append_text(pi, ": %s",
7517                                 val_to_str(method, osu_method_vals,
7518                                         "Reserved"));
7519       offset++;
7520       osu_method_list_index++;
7521     }
7522   }
7523
7524   icons_avail = tvb_get_letohs(tvb, offset);
7525   proto_tree_add_item(prov_tree, hf_hs20_icons_avail_len, tvb, offset, 2,
7526                         ENC_LITTLE_ENDIAN);
7527   offset += 2;
7528
7529   if (icons_avail > 0) {
7530     proto_tree *icon_list = NULL;
7531     proto_item *pi = NULL;
7532
7533     start_offset = offset;
7534
7535     icon_list = proto_tree_add_subtree(prov_tree, tvb, offset, -1,
7536                                 ett_osu_icons_avail_list, &pi,
7537                                 "Icons Available");
7538
7539     while ((offset - start_offset) < icons_avail) {
7540       offset = dissect_hs20_osu_icon_available(icon_list, tvb, pinfo, offset,
7541                                 end, icons_index);
7542       icons_index++;
7543     }
7544
7545     proto_item_set_len(pi, offset - start_offset);
7546   }
7547
7548   osu_nai_len = tvb_get_guint8(tvb, offset);
7549   proto_tree_add_item(prov_tree, hf_hs20_osu_nai_len, tvb, offset, 1, ENC_NA);
7550   offset++;
7551
7552   if (osu_nai_len > 0) {
7553     proto_tree_add_item(prov_tree, hf_hs20_osu_nai, tvb, offset,
7554                         osu_nai_len, ENC_NA);
7555     offset += osu_nai_len;
7556   }
7557
7558   osu_service_desc_len = tvb_get_letohs(tvb, offset);
7559   proto_tree_add_item(prov_tree, hf_hs20_osu_service_desc_len, tvb, offset, 2,
7560                         ENC_LITTLE_ENDIAN);
7561   offset += 2;
7562
7563   if (osu_service_desc_len > 0) {
7564     proto_tree *desc_tree = NULL;
7565     proto_item *pi = NULL;
7566     guint8 service_desc_index = 0;
7567
7568     start_offset = offset;
7569     desc_tree = proto_tree_add_subtree(prov_tree, tvb, offset, -1,
7570                                 ett_hs20_osu_service_desc_list, &pi,
7571                                 "OSU Service Description List");
7572
7573     while ((offset - start_offset) < osu_service_desc_len) {
7574       proto_tree *desc_duple = NULL;
7575       guint8 serv_desc_len = tvb_get_guint8(tvb, offset);
7576
7577       desc_duple = proto_tree_add_subtree_format(desc_tree, tvb, offset,
7578                                 1 + serv_desc_len,
7579                                 ett_hs20_osu_service_desc_tree, NULL,
7580                                 "OSU Service Description Duple %d",
7581                                 service_desc_index);
7582
7583       proto_tree_add_item(desc_duple, hf_hs20_osu_service_desc_duple_len, tvb,
7584                                 offset, 1, ENC_NA);
7585       offset++;
7586
7587       proto_tree_add_item(desc_duple, hf_hs20_osu_service_desc_lang, tvb, offset,
7588                                 3, ENC_ASCII|ENC_NA);
7589       offset += 3;
7590
7591       proto_tree_add_item(desc_duple, hf_hs20_osu_service_desc, tvb, offset,
7592                                 serv_desc_len - 3, ENC_ASCII|ENC_NA);
7593       offset += serv_desc_len - 3;
7594
7595       service_desc_index++;
7596     }
7597
7598     proto_item_set_len(pi, offset - start_offset);
7599   }
7600
7601   return end;
7602 }
7603
7604 static void
7605 dissect_hs20_anqp_osu_providers_list(proto_tree *tree, tvbuff_t *tvb,
7606   packet_info *pinfo, int offset, int end)
7607 {
7608   guint8 ssid_len = tvb_get_guint8(tvb, offset);
7609   guint8 osu_prov_count = 0, osu_prov_index = 0;
7610
7611   proto_tree_add_item(tree, hf_hs20_osu_providers_list_ssid_len, tvb, offset, 1,
7612                         ENC_NA);
7613   offset++;
7614
7615   proto_tree_add_item(tree, hf_hs20_osu_providers_ssid, tvb, offset, ssid_len,
7616                         ENC_UTF_8|ENC_NA);
7617   offset += ssid_len;
7618
7619   osu_prov_count = tvb_get_guint8(tvb, offset);
7620   proto_tree_add_item(tree, hf_hs20_osu_providers_count, tvb, offset, 1,
7621                         ENC_NA);
7622   offset++;
7623
7624   if (osu_prov_count > 0) {
7625     int start_offset = offset;
7626     proto_item *pi = NULL;
7627     proto_tree *osu_prov_list = NULL;
7628
7629     osu_prov_list = proto_tree_add_subtree(tree, tvb, offset, -1,
7630                         ett_hs20_osu_providers_list, &pi,
7631                         "OSU Providers List");
7632     while (offset < end && osu_prov_count > osu_prov_index) {
7633       offset = dissect_hs20_osu_provider(osu_prov_list, tvb, pinfo, offset, end,
7634                         osu_prov_index);
7635       osu_prov_index++;
7636     }
7637
7638     proto_item_set_len(pi, offset - start_offset);
7639   }
7640 }
7641
7642 static void
7643 dissect_hs20_anqp_icon_request(proto_tree *tree, tvbuff_t *tvb, int offset,
7644   int end)
7645 {
7646   proto_tree_add_item(tree, hf_hs20_icon_request_filename, tvb, offset,
7647                         end - offset, ENC_UTF_8|ENC_NA);
7648 }
7649
7650 static const value_string hs20_icon_download_status_vals[] = {
7651   { 0, "Success" },
7652   { 1, "File not found" },
7653   { 2, "Unspecified file error" },
7654   { 0, NULL }
7655 };
7656
7657 static void
7658 dissect_hs20_anqp_icon_binary_file(proto_tree *tree, tvbuff_t *tvb, int offset,
7659   int end _U_)
7660 {
7661   guint8 icon_download_status = tvb_get_guint8(tvb, offset);
7662   proto_item *pi = NULL;
7663   guint8 icon_type_len = 0;
7664   guint16 icon_binary_data_len = 0;
7665
7666   pi = proto_tree_add_item(tree, hf_hs20_icon_binary_file_status, tvb, offset, 1,
7667                         ENC_NA);
7668   offset++;
7669   proto_item_append_text(pi, ": %s",
7670                          val_to_str(icon_download_status,
7671                                     hs20_icon_download_status_vals,
7672                                     "Reserved (%u)"));
7673
7674   icon_type_len = tvb_get_guint8(tvb, offset);
7675   proto_tree_add_item(tree, hf_hs20_icon_type_length, tvb, offset, 1, ENC_NA);
7676   offset++;
7677
7678   proto_tree_add_item(tree, hf_hs20_icon_type, tvb, offset, icon_type_len,
7679                         ENC_UTF_8|ENC_NA);
7680   offset += icon_type_len;
7681
7682   icon_binary_data_len = tvb_get_letohs(tvb, offset);
7683   proto_tree_add_item(tree, hf_hs20_icon_binary_data_len, tvb, offset, 2,
7684                         ENC_BIG_ENDIAN);
7685   offset += 2;
7686
7687   proto_tree_add_item(tree, hf_hs20_icon_binary_data, tvb, offset,
7688                         icon_binary_data_len, ENC_NA);
7689 }
7690
7691 static void
7692 dissect_hs20_anqp_operator_icon_metadata(proto_tree *tree, tvbuff_t *tvb,
7693   int offset, int end _U_)
7694 {
7695   proto_item *pi = NULL;
7696   int start_offset = offset;
7697   guint8 icon_type_len = 0, icon_filename_len = 0;
7698
7699   proto_tree_add_item(tree, hf_osu_icon_avail_width, tvb, offset, 2,
7700                         ENC_LITTLE_ENDIAN);
7701   offset += 2;
7702
7703   proto_tree_add_item(tree, hf_osu_icon_avail_height, tvb, offset, 2,
7704                         ENC_LITTLE_ENDIAN);
7705   offset += 2;
7706
7707   proto_tree_add_item(tree, hf_osu_icon_avail_lang_code, tvb, offset, 3,
7708                         ENC_ASCII|ENC_NA);
7709   offset += 3;
7710
7711   icon_type_len = tvb_get_guint8(tvb, offset);
7712   proto_tree_add_item(tree, hf_osu_icon_avail_icon_type_len, tvb, offset,
7713                         1, ENC_NA);
7714   offset++;
7715
7716   proto_tree_add_item(tree, hf_osu_icon_avail_icon_type, tvb, offset,
7717                         icon_type_len, ENC_ASCII|ENC_NA);
7718   offset += icon_type_len;
7719
7720   icon_filename_len = tvb_get_guint8(tvb, offset);
7721   proto_tree_add_item(tree, hf_osu_icon_avail_filename_len, tvb, offset,
7722                         1, ENC_NA);
7723   offset++;
7724
7725   proto_tree_add_item(tree, hf_osu_icon_avail_filename, tvb, offset,
7726                         icon_filename_len, ENC_ASCII|ENC_NA);
7727   offset += icon_filename_len;
7728
7729   proto_item_set_len(pi, offset - start_offset);
7730 }
7731
7732 static void
7733 dissect_anqp_venue_url(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
7734 {
7735   guint16 url_duple_index = 0;
7736
7737   while (offset < end) {
7738     proto_tree *venue_url = NULL;
7739     proto_item *url_pi = NULL;
7740     guint8 url_duple_len = tvb_get_guint8(tvb, offset);
7741
7742     venue_url = proto_tree_add_subtree_format(tree, tvb, offset,
7743                         url_duple_len + 1, ett_hs20_venue_url, NULL,
7744                         "Venue URL Duple %d", url_duple_index);
7745
7746     proto_tree_add_item(venue_url, hf_hs20_anqp_venue_url_length, tvb, offset,
7747                         1, ENC_NA);
7748     offset++;
7749
7750     proto_tree_add_item(venue_url, hf_hs20_anqp_venue_number, tvb, offset, 1,
7751                         ENC_NA);
7752     offset++;
7753
7754     url_pi = proto_tree_add_item(venue_url, hf_hs20_anqp_venue_url, tvb, offset,
7755                         url_duple_len -1, ENC_ASCII|ENC_NA);
7756     PROTO_ITEM_SET_URL(url_pi);
7757
7758     offset += (url_duple_len - 1);
7759
7760     url_duple_index++;
7761   }
7762 }
7763
7764 static const value_string advice_of_charge_type_vals[] = {
7765   { 0, "Time-based" },
7766   { 1, "Data-volume-based" },
7767   { 2, "Time-and-data-volume-based" },
7768   { 3, "Unlimited" },
7769   { 0, NULL }
7770 };
7771
7772 static void
7773 dissect_hs20_anqp_advice_of_charge(proto_tree *tree, tvbuff_t *tvb, int offset,
7774   int end _U_)
7775 {
7776   guint16 toc_index = 0;
7777
7778   while (offset < end) {
7779     guint16 adv_charge_len = tvb_get_letohs(tvb, offset);
7780     proto_tree *aoc_tree = NULL;
7781     proto_tree *plan_info_tree = NULL;
7782     proto_item *pi = NULL, *tpi = NULL;
7783     int start_offset = offset;
7784     guint8 aoc_type = 0, nai_realm_len = 0;
7785     guint8 plan_index = 0;
7786     guint16 plan_tot_len = 0;
7787     int plan_offset = 0;
7788
7789     aoc_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
7790                         ett_hs20_advice_of_charge, &pi,
7791                         "Advice of Charge Duple %d", toc_index);
7792     proto_tree_add_item(aoc_tree, hf_hs20_anqp_advice_of_charge_length, tvb,
7793                         offset, 2, ENC_LITTLE_ENDIAN);
7794     offset += 2;
7795
7796     aoc_type = tvb_get_guint8(tvb, offset);
7797     tpi = proto_tree_add_item(aoc_tree, hf_hs20_anqp_advice_of_charge_type, tvb,
7798                         offset, 1, ENC_NA);
7799     offset++;
7800     proto_item_append_text(tpi, ": %s",
7801                                 val_to_str(aoc_type,
7802                                         advice_of_charge_type_vals,
7803                                         "Reserved (%u)"));
7804
7805     proto_tree_add_item(aoc_tree, hf_hs20_anqp_aoc_nai_realm_encoding, tvb,
7806                         offset, 1, ENC_NA);
7807     offset++;
7808
7809     nai_realm_len = tvb_get_guint8(tvb, offset);
7810     proto_tree_add_item(aoc_tree, hf_hs20_anqp_aoc_nai_realm_len, tvb, offset,
7811                         1, ENC_NA);
7812     offset++;
7813
7814     proto_tree_add_item(aoc_tree, hf_hs20_anqp_aoc_nai_realm, tvb, offset,
7815                         nai_realm_len, ENC_UTF_8|ENC_NA);
7816     offset += nai_realm_len;
7817
7818     plan_tot_len = adv_charge_len - 3 - nai_realm_len;
7819     plan_offset = offset;
7820
7821     while (offset < (plan_offset + plan_tot_len)) {
7822         guint16 plan_len = tvb_get_letohs(tvb, offset);
7823
7824         plan_info_tree = proto_tree_add_subtree_format(aoc_tree, tvb, offset,
7825                                 plan_len + 2, ett_hs20_aoc_plan, NULL,
7826                                 "Plan #%u", plan_index);
7827
7828         proto_tree_add_item(plan_info_tree, hf_hs20_anqp_aoc_plan_len, tvb,
7829                         offset, 2, ENC_LITTLE_ENDIAN);
7830         offset += 2;
7831
7832         proto_tree_add_item(plan_info_tree, hf_hs20_anqp_aoc_plan_lang, tvb,
7833                         offset, 3, ENC_ASCII|ENC_NA);
7834         offset += 3;
7835
7836         proto_tree_add_item(plan_info_tree, hf_hs20_anqp_aoc_plan_curcy, tvb,
7837                         offset, 3, ENC_ASCII|ENC_NA);
7838         offset += 3;
7839
7840         proto_tree_add_item(plan_info_tree, hf_hs20_anqp_aoc_plan_information,
7841                         tvb, offset, plan_len - 6, ENC_UTF_8|ENC_NA);
7842         offset += plan_len - 6;
7843
7844         plan_index++;
7845     }
7846
7847     proto_item_set_len(pi, offset - start_offset);
7848
7849     toc_index++;
7850   }
7851 }
7852
7853 static int
7854 dissect_hs20_anqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
7855 {
7856   guint8 subtype;
7857   int ofn_hf_array[3] = {hf_hs20_anqp_ofn_length,
7858                          hf_hs20_anqp_ofn_language,
7859                          hf_hs20_anqp_ofn_name };
7860
7861   int end = tvb_reported_length(tvb);
7862   int offset = 0;
7863   anqp_info_dissector_data_t* anqp_data = (anqp_info_dissector_data_t*)data;
7864
7865   DISSECTOR_ASSERT(anqp_data);
7866
7867   subtype = tvb_get_guint8(tvb, offset);
7868   proto_item_append_text(tree, " - HS 2.0 %s",
7869                          val_to_str(subtype, hs20_anqp_subtype_vals,
7870                                     "Reserved (%u)"));
7871   if (anqp_data->idx == 0) {
7872     col_append_fstr(pinfo->cinfo, COL_INFO, " HS 2.0 %s",
7873                     val_to_str(subtype, hs20_anqp_subtype_vals,
7874                                "Reserved (%u)"));
7875   } else if (anqp_data->idx == 1) {
7876     col_append_str(pinfo->cinfo, COL_INFO, ", ..");
7877   }
7878   proto_tree_add_item(tree, hf_hs20_anqp_subtype, tvb, offset, 1,
7879                       ENC_LITTLE_ENDIAN);
7880   offset++;
7881
7882   proto_tree_add_item(tree, hf_hs20_anqp_reserved, tvb, offset, 1,
7883                       ENC_LITTLE_ENDIAN);
7884   offset++;
7885
7886   switch (subtype) {
7887   case HS20_ANQP_HS_QUERY_LIST:
7888     dissect_hs20_anqp_hs_query_list(tree, tvb, offset, end);
7889     break;
7890   case HS20_ANQP_HS_CAPABILITY_LIST:
7891     dissect_hs20_anqp_hs_capability_list(tree, tvb, offset, end);
7892     break;
7893   case HS20_ANQP_OPERATOR_FRIENDLY_NAME:
7894     dissect_hs20_anqp_operator_friendly_name(tree, tvb, pinfo, offset, end,
7895                                 ofn_hf_array, ett_hs20_ofn_tree);
7896     break;
7897   case HS20_ANQP_WAN_METRICS:
7898     dissect_hs20_anqp_wan_metrics(tree, tvb, offset, anqp_data->request);
7899     break;
7900   case HS20_ANQP_CONNECTION_CAPABILITY:
7901     dissect_hs20_anqp_connection_capability(tree, tvb, offset, end);
7902     break;
7903   case HS20_ANQP_NAI_HOME_REALM_QUERY:
7904     dissect_hs20_anqp_nai_home_realm_query(tree, tvb, pinfo, offset, end);
7905     break;
7906   case HS20_ANQP_OPERATING_CLASS_INDICATION:
7907     dissect_hs20_anqp_oper_class_indic(tree, tvb, offset, end);
7908     break;
7909   case HS20_ANQP_OSU_PROVIDERS_LIST:
7910     dissect_hs20_anqp_osu_providers_list(tree, tvb, pinfo, offset, end);
7911     break;
7912   case HS20_ANQP_ICON_REQUEST:
7913     dissect_hs20_anqp_icon_request(tree, tvb, offset, end);
7914     break;
7915   case HS20_ANQP_ICON_BINARY_FILE:
7916     dissect_hs20_anqp_icon_binary_file(tree, tvb, offset, end);
7917     break;
7918   case HS20_ANQP_OPERATOR_ICON_METADATA:
7919     dissect_hs20_anqp_operator_icon_metadata(tree, tvb, offset, end);
7920     break;
7921   case HS20_ANQP_ADVICE_OF_CHARGE:
7922     dissect_hs20_anqp_advice_of_charge(tree, tvb, offset, end);
7923     break;
7924   default:
7925     if (offset == end)
7926       break;
7927     proto_tree_add_item(tree, hf_hs20_anqp_payload, tvb, offset,
7928                         end - offset, ENC_NA);
7929     break;
7930   }
7931
7932   return tvb_captured_length(tvb);
7933 }
7934
7935 static int
7936 dissect_vendor_wifi_alliance_anqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
7937 {
7938   guint8 subtype;
7939   int offset = 0;
7940   tvbuff_t *subtvb;
7941
7942   subtype = tvb_get_guint8(tvb, offset);
7943   proto_tree_add_item(tree, hf_ieee80211_anqp_wfa_subtype, tvb, offset, 1, ENC_NA);
7944   offset += 1;
7945
7946   subtvb = tvb_new_subset_remaining(tvb, offset);
7947   if (!dissector_try_uint_new(wifi_alliance_anqp_info_table, subtype, subtvb, pinfo, tree, FALSE, data))
7948       call_data_dissector(subtvb, pinfo, tree);
7949
7950   return tvb_captured_length(tvb);
7951 }
7952
7953
7954 static int
7955 dissect_neighbor_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data);
7956
7957 static int
7958 dissect_anqp_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
7959                   gboolean request, int idx)
7960 {
7961   guint16     id, len;
7962   guint32     oui;
7963   proto_item *item, *item_len;
7964   tvbuff_t *vendor_tvb;
7965   anqp_info_dissector_data_t anqp_info;
7966
7967   item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_id,
7968                              tvb, offset, 2, ENC_LITTLE_ENDIAN);
7969   id = tvb_get_letohs(tvb, offset);
7970   if (id != ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
7971     if (idx == 0) {
7972       proto_item_append_text(tree, " - %s",
7973                              val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
7974       col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
7975                       val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
7976     } else if (idx == 1) {
7977       proto_item_append_text(tree, ", ..");
7978       col_append_str(pinfo->cinfo, COL_INFO, ", ..");
7979     }
7980   }
7981   tree = proto_item_add_subtree(item, ett_gas_anqp);
7982   offset += 2;
7983   item_len = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_length,
7984                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7985   len = tvb_get_letohs(tvb, offset);
7986   offset += 2;
7987   if (tvb_reported_length_remaining(tvb, offset) < len) {
7988     expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_info_length);
7989     return 4 + len;
7990   }
7991   switch (id)
7992   {
7993   case ANQP_INFO_ANQP_QUERY_LIST:
7994     dissect_anqp_query_list(tree, tvb, pinfo, offset, offset + len);
7995     break;
7996   case ANQP_INFO_ANQP_CAPAB_LIST:
7997     dissect_anqp_capab_list(tree, tvb, pinfo, offset, offset + len);
7998     break;
7999   case ANQP_INFO_VENUE_NAME_INFO:
8000     dissect_venue_name_info(tree, tvb, pinfo, offset, offset + len);
8001     break;
8002   case ANQP_INFO_NETWORK_AUTH_TYPE_INFO:
8003     dissect_network_auth_type(tree, tvb, offset, offset + len);
8004     break;
8005   case ANQP_INFO_ROAMING_CONSORTIUM_LIST:
8006     dissect_roaming_consortium_list(tree, tvb, pinfo, offset, offset + len);
8007     break;
8008   case ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO:
8009     dissect_ip_addr_type_availability_info(tree, tvb, offset);
8010     break;
8011   case ANQP_INFO_NAI_REALM_LIST:
8012     dissect_nai_realm_list(tree, tvb, pinfo, offset, offset + len);
8013     break;
8014   case ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO:
8015     dissect_3gpp_cellular_network_info(tree, tvb, pinfo, offset);
8016     break;
8017   case ANQP_INFO_DOMAIN_NAME_LIST:
8018     dissect_domain_name_list(tree, tvb, offset, offset + len);
8019     break;
8020   case ANQP_INFO_NEIGHBOR_REPORT:
8021     {
8022       tvbuff_t *report_tvb;
8023       ieee80211_tagged_field_data_t field_data;
8024
8025       report_tvb = tvb_new_subset_length(tvb, offset, len);
8026       field_data.item_tag = item;
8027       field_data.item_tag_length = item_len;
8028       dissect_neighbor_report(report_tvb, pinfo, tree, &field_data);
8029     }
8030     break;
8031   case ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST:
8032     proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
8033     offset += 3;
8034     vendor_tvb = tvb_new_subset_length(tvb, offset, len);
8035
8036     anqp_info.request = request;
8037     anqp_info.idx = idx;
8038     if (!dissector_try_uint_new(vendor_specific_anqp_info_table, oui, vendor_tvb, pinfo, tree, FALSE, &anqp_info))
8039     {
8040       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info, tvb, offset, len, ENC_NA);
8041     }
8042     break;
8043   case ANQP_INFO_VENUE_URL:
8044     dissect_anqp_venue_url(tree, tvb, offset, offset + len);
8045     break;
8046   case ANQP_INFO_ADVICE_OF_CHARGE:
8047     dissect_hs20_anqp_advice_of_charge(tree, tvb, offset, offset + len);
8048     break;
8049   default:
8050     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
8051                         tvb, offset, len, ENC_NA);
8052     break;
8053   }
8054
8055   return 4 + len;
8056 }
8057
8058 static void
8059 dissect_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, gboolean request)
8060 {
8061   int idx = 0;
8062
8063   proto_item_append_text(tree, ": ANQP ");
8064   proto_item_append_text(tree, request ? "Request" : "Response");
8065   if (tvb_reported_length_remaining(tvb, offset) < 4) {
8066     expert_add_info_format(pinfo, tree, &ei_ieee80211_not_enough_room_for_anqp_header,
8067                            "Not enough room for ANQP header");
8068     return;
8069   }
8070   col_append_fstr(pinfo->cinfo, COL_INFO, ", ANQP %s",
8071                   request ? "Req" : "Resp");
8072   while (tvb_reported_length_remaining(tvb, offset) > 0) {
8073     offset += dissect_anqp_info(tree, tvb, pinfo, offset, request, idx);
8074     idx += 1;
8075   }
8076 }
8077
8078 static guint
8079 dissect_gas_initial_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
8080                             guint type, guint subtype)
8081 {
8082   guint16     req_len;
8083   int         start = offset;
8084   proto_item *item;
8085   proto_tree *query;
8086
8087   /* Query Request Length (2 octets) */
8088   req_len = tvb_get_letohs(tvb, offset);
8089
8090   query = proto_tree_add_subtree(tree, tvb, offset, 2 + req_len, ett_gas_query, &item, "Query Request");
8091   if (tvb_reported_length_remaining(tvb, offset) < 2 + req_len) {
8092     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_request_length);
8093     return tvb_reported_length_remaining(tvb, offset);
8094   }
8095
8096   proto_tree_add_item(query, hf_ieee80211_ff_query_request_length,
8097                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8098   offset += 2;
8099   /*
8100    * Query Request (GAS query; formatted per protocol specified in the
8101    * Advertisement Protocol IE)
8102    */
8103   switch (type) {
8104   case ADV_PROTO_ID_ANQP:
8105     dissect_anqp(query, tvb, pinfo, offset, TRUE);
8106     break;
8107   case ADV_PROTO_ID_VS:
8108     if (subtype == ((DPP_CONFIGURATION_PROTOCOL << 8) | WFA_SUBTYPE_DPP)) {
8109        col_append_fstr(pinfo->cinfo, COL_INFO, ", DPP - %s",
8110                        val_to_str(subtype >> 8, dpp_subtype_vals, "Unknown (%u)"));
8111       dissect_wifi_dpp_config_proto(pinfo, query, tvb, offset);
8112     }
8113     break;
8114   default:
8115     proto_tree_add_item(query, hf_ieee80211_ff_query_request,
8116                         tvb, offset, req_len, ENC_NA);
8117   }
8118   offset += req_len;
8119
8120   return offset - start;
8121 }
8122
8123 static guint
8124 dissect_gas_initial_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
8125                              guint type, guint subtype)
8126 {
8127   guint16     resp_len;
8128   int         start = offset;
8129   proto_item *item;
8130   proto_tree *query;
8131
8132   /* Query Response Length (2 octets) */
8133   resp_len = tvb_get_letohs(tvb, offset);
8134
8135   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
8136                              ett_gas_query, &item, "Query Response");
8137   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
8138     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
8139     return tvb_reported_length_remaining(tvb, offset);
8140   }
8141
8142   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
8143                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8144   offset += 2;
8145   /* Query Response (optional) */
8146   if (resp_len) {
8147     switch (type) {
8148     case ADV_PROTO_ID_ANQP:
8149       dissect_anqp(query, tvb, pinfo, offset, FALSE);
8150       break;
8151     case ADV_PROTO_ID_VS:
8152       if (subtype == ((DPP_CONFIGURATION_PROTOCOL << 8) | WFA_SUBTYPE_DPP)) {
8153          col_append_fstr(pinfo->cinfo, COL_INFO, ", DPP - %s",
8154                          val_to_str(subtype >> 8, dpp_subtype_vals, "Unknown (%u)"));
8155         dissect_wifi_dpp_config_proto(pinfo, query, tvb, offset);
8156       }
8157       break;
8158     default:
8159       proto_tree_add_item(query, hf_ieee80211_ff_query_response,
8160                           tvb, offset, resp_len, ENC_NA);
8161     }
8162     offset += resp_len;
8163   }
8164
8165   return offset - start;
8166 }
8167
8168 static reassembly_table gas_reassembly_table;
8169
8170 static gint ett_gas_resp_fragment = -1;
8171 static gint ett_gas_resp_fragments = -1;
8172
8173 static int hf_ieee80211_gas_resp_fragments = -1;
8174 static int hf_ieee80211_gas_resp_fragment = -1;
8175 static int hf_ieee80211_gas_resp_fragment_overlap = -1;
8176 static int hf_ieee80211_gas_resp_fragment_overlap_conflict = -1;
8177 static int hf_ieee80211_gas_resp_fragment_multiple_tails = -1;
8178 static int hf_ieee80211_gas_resp_fragment_too_long_fragment = -1;
8179 static int hf_ieee80211_gas_resp_fragment_error = -1;
8180 static int hf_ieee80211_gas_resp_fragment_count = -1;
8181 static int hf_ieee80211_gas_resp_reassembled_in = -1;
8182 static int hf_ieee80211_gas_resp_reassembled_length = -1;
8183
8184 static const fragment_items gas_resp_frag_items = {
8185   &ett_gas_resp_fragment,
8186   &ett_gas_resp_fragments,
8187   &hf_ieee80211_gas_resp_fragments,
8188   &hf_ieee80211_gas_resp_fragment,
8189   &hf_ieee80211_gas_resp_fragment_overlap,
8190   &hf_ieee80211_gas_resp_fragment_overlap_conflict,
8191   &hf_ieee80211_gas_resp_fragment_multiple_tails,
8192   &hf_ieee80211_gas_resp_fragment_too_long_fragment,
8193   &hf_ieee80211_gas_resp_fragment_error,
8194   &hf_ieee80211_gas_resp_fragment_count,
8195   &hf_ieee80211_gas_resp_reassembled_in,
8196   &hf_ieee80211_gas_resp_reassembled_length,
8197   /* Reassembled data field */
8198   NULL,
8199   "GAS Response fragments"
8200 };
8201
8202 static guint
8203 dissect_gas_comeback_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
8204                               guint type, guint subtype _U_, guint8 frag, gboolean more,
8205                               guint8 dialog_token)
8206 {
8207   guint16     resp_len;
8208   int         start = offset;
8209   proto_item *item;
8210   proto_tree *query;
8211
8212   /* Query Response Length (2 octets) */
8213   resp_len = tvb_get_letohs(tvb, offset);
8214
8215   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
8216                              ett_gas_query, &item, "Query Response");
8217   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
8218     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
8219     return tvb_reported_length_remaining(tvb, offset);
8220   }
8221
8222   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
8223                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8224   offset += 2;
8225   /* Query Response (optional) */
8226   if (resp_len) {
8227     if (type == ADV_PROTO_ID_ANQP && (frag == 0) && !more)
8228       dissect_anqp(query, tvb, pinfo, offset, FALSE);
8229     else {
8230       fragment_head *frag_msg;
8231       gboolean save_fragmented;
8232       tvbuff_t *new_tvb;
8233
8234       save_fragmented = pinfo->fragmented;
8235       pinfo->fragmented = TRUE;
8236       frag_msg = fragment_add_seq_check(&gas_reassembly_table, tvb, offset,
8237                                         pinfo, dialog_token, NULL,
8238                                         frag, resp_len, more);
8239       new_tvb = process_reassembled_data(tvb, offset, pinfo,
8240                                          "Reassembled GAS Query Response",
8241                                          frag_msg, &gas_resp_frag_items,
8242                                          NULL, tree);
8243       if (new_tvb) {
8244         if (type == ADV_PROTO_ID_ANQP)
8245           dissect_anqp(query, new_tvb, pinfo, 0, FALSE);
8246         else
8247           proto_tree_add_item(query, hf_ieee80211_ff_query_response,
8248                               new_tvb, 0,
8249                               tvb_reported_length_remaining(new_tvb, 0),
8250                               ENC_NA);
8251       }
8252
8253       /* The old tvb cannot be used anymore */
8254       ieee80211_tvb_invalid = TRUE;
8255
8256       pinfo->fragmented = save_fragmented;
8257     }
8258     offset += resp_len;
8259   }
8260
8261   return offset - start;
8262 }
8263
8264 /* ************************************************************************* */
8265 /*              Dissect and add fixed mgmt fields to protocol tree           */
8266 /* ************************************************************************* */
8267
8268 static guint64 last_timestamp;
8269
8270 static guint
8271 add_ff_timestamp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8272 {
8273   last_timestamp = tvb_get_letoh64(tvb, offset);
8274   proto_tree_add_item(tree, hf_ieee80211_ff_timestamp, tvb, offset, 8,
8275                       ENC_LITTLE_ENDIAN);
8276   return 8;
8277 }
8278
8279 static guint
8280 add_ff_beacon_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8281 {
8282   proto_tree_add_item(tree, hf_ieee80211_ff_beacon_interval, tvb, offset, 2,
8283                       ENC_LITTLE_ENDIAN);
8284   col_append_fstr(pinfo->cinfo, COL_INFO, ", BI=%d",
8285                   tvb_get_letohs(tvb, offset));
8286   return 2;
8287 }
8288
8289 static guint
8290 add_ff_cap_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8291 {
8292   static const int *ieee80211_ap_fields[] = {
8293     &hf_ieee80211_ff_cf_ess,
8294     &hf_ieee80211_ff_cf_ibss,
8295     &hf_ieee80211_ff_cf_ap_poll,
8296     &hf_ieee80211_ff_cf_privacy,
8297     &hf_ieee80211_ff_cf_preamble,
8298     &hf_ieee80211_ff_cf_pbcc,
8299     &hf_ieee80211_ff_cf_agility,
8300     &hf_ieee80211_ff_cf_spec_man,
8301     &hf_ieee80211_ff_short_slot_time,
8302     &hf_ieee80211_ff_cf_apsd,
8303     &hf_ieee80211_ff_radio_measurement,
8304     &hf_ieee80211_ff_dsss_ofdm,
8305     &hf_ieee80211_ff_cf_del_blk_ack,
8306     &hf_ieee80211_ff_cf_imm_blk_ack,
8307     NULL
8308   };
8309
8310   static const int *ieee80211_sta_fields[] = {
8311     &hf_ieee80211_ff_cf_ess,
8312     &hf_ieee80211_ff_cf_ibss,
8313     &hf_ieee80211_ff_cf_sta_poll,
8314     &hf_ieee80211_ff_cf_privacy,
8315     &hf_ieee80211_ff_cf_preamble,
8316     &hf_ieee80211_ff_cf_pbcc,
8317     &hf_ieee80211_ff_cf_agility,
8318     &hf_ieee80211_ff_cf_spec_man,
8319     &hf_ieee80211_ff_short_slot_time,
8320     &hf_ieee80211_ff_cf_apsd,
8321     &hf_ieee80211_ff_radio_measurement,
8322     &hf_ieee80211_ff_dsss_ofdm,
8323     &hf_ieee80211_ff_cf_del_blk_ack,
8324     &hf_ieee80211_ff_cf_imm_blk_ack,
8325     NULL
8326   };
8327
8328   if ((tvb_get_letohs(tvb, offset) & 0x0001) != 0) {
8329     /* This is an AP */
8330     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_capture,
8331                                     ett_cap_tree, ieee80211_ap_fields,
8332                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8333     p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_AP_KEY, GINT_TO_POINTER(TRUE));
8334   } else {
8335     /* This is a STA */
8336     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_capture,
8337                                     ett_cap_tree, ieee80211_sta_fields,
8338                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8339   }
8340
8341   return 2;
8342 }
8343
8344 static guint
8345 add_ff_auth_alg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8346 {
8347   proto_tree_add_item(tree, hf_ieee80211_ff_auth_alg, tvb, offset, 2,
8348                       ENC_LITTLE_ENDIAN);
8349   return 2;
8350 }
8351
8352 static guint
8353 add_ff_auth_trans_seq(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8354 {
8355   proto_tree_add_item(tree, hf_ieee80211_ff_auth_seq, tvb, offset, 2,
8356                       ENC_LITTLE_ENDIAN);
8357   return 2;
8358 }
8359
8360 static guint
8361 add_ff_current_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8362 {
8363   proto_tree_add_item(tree, hf_ieee80211_ff_current_ap, tvb, offset, 6,
8364                       ENC_NA);
8365   return 6;
8366 }
8367
8368 static guint
8369 add_ff_listen_ival(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8370 {
8371   proto_tree_add_item(tree, hf_ieee80211_ff_listen_ival, tvb, offset, 2,
8372                       ENC_LITTLE_ENDIAN);
8373   return 2;
8374 }
8375
8376 static guint
8377 add_ff_reason_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8378 {
8379   proto_tree_add_item(tree, hf_ieee80211_ff_reason, tvb, offset, 2,
8380                       ENC_LITTLE_ENDIAN);
8381   return 2;
8382 }
8383
8384 static guint
8385 add_ff_assoc_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8386 {
8387   proto_tree_add_item(tree, hf_ieee80211_ff_assoc_id, tvb, offset, 2,
8388                       ENC_LITTLE_ENDIAN);
8389   return 2;
8390 }
8391
8392 static guint
8393 add_ff_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8394 {
8395   proto_tree_add_item(tree, hf_ieee80211_ff_status_code, tvb, offset, 2,
8396                       ENC_LITTLE_ENDIAN);
8397   return 2;
8398 }
8399
8400 static guint
8401 add_ff_category_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8402 {
8403   proto_tree_add_item(tree, hf_ieee80211_ff_category_code, tvb, offset, 1,
8404                       ENC_LITTLE_ENDIAN);
8405   return 1;
8406 }
8407
8408 static guint
8409 add_ff_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8410 {
8411   proto_tree_add_item(tree, hf_ieee80211_ff_action_code, tvb, offset, 1,
8412                       ENC_LITTLE_ENDIAN);
8413   return 1;
8414 }
8415
8416 static guint
8417 add_ff_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8418 {
8419   proto_tree_add_item(tree, hf_ieee80211_ff_dialog_token, tvb, offset, 1,
8420                       ENC_LITTLE_ENDIAN);
8421   return 1;
8422 }
8423
8424 static guint
8425 add_ff_followup_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8426 {
8427   proto_tree_add_item(tree, hf_ieee80211_ff_followup_dialog_token, tvb, offset, 1,
8428                       ENC_LITTLE_ENDIAN);
8429   return 1;
8430 }
8431
8432 static guint
8433 add_ff_wme_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8434 {
8435   proto_tree_add_item(tree, hf_ieee80211_ff_wme_action_code, tvb, offset, 1,
8436                       ENC_LITTLE_ENDIAN);
8437   return 1;
8438 }
8439
8440 static guint
8441 add_ff_wme_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8442 {
8443   proto_tree_add_item(tree, hf_ieee80211_ff_wme_status_code, tvb, offset, 1,
8444                       ENC_LITTLE_ENDIAN);
8445   return 1;
8446 }
8447
8448 static guint
8449 add_ff_qos_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8450 {
8451   proto_tree_add_item(tree, hf_ieee80211_ff_qos_action_code, tvb, offset, 1,
8452                       ENC_LITTLE_ENDIAN);
8453   return 1;
8454 }
8455
8456 static guint
8457 add_ff_block_ack_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8458 {
8459   proto_tree_add_item(tree, hf_ieee80211_ff_ba_action, tvb, offset, 1,
8460                       ENC_LITTLE_ENDIAN);
8461   return 1;
8462 }
8463
8464 static guint
8465 add_ff_block_ack_param(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8466 {
8467   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_params,
8468                          ett_ff_ba_param_tree,
8469                          ieee80211_ff_block_ack_params_fields,
8470                          ENC_LITTLE_ENDIAN);
8471   return 2;
8472 }
8473
8474 static guint
8475 add_ff_block_ack_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8476 {
8477   proto_tree_add_item(tree, hf_ieee80211_ff_block_ack_timeout, tvb, offset, 2,
8478                       ENC_LITTLE_ENDIAN);
8479   return 2;
8480 }
8481
8482 static guint
8483 add_ff_block_ack_ssc(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8484 {
8485   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_ssc,
8486                          ett_ff_ba_ssc_tree, ieee80211_ff_block_ack_ssc_fields,
8487                          ENC_LITTLE_ENDIAN);
8488   return 2;
8489 }
8490
8491 static guint
8492 add_ff_qos_ts_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8493 {
8494   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_tsinfo,
8495                          ett_tsinfo_tree, ieee80211_tsinfo_fields,
8496                          ENC_LITTLE_ENDIAN);
8497   return 3;
8498 }
8499
8500 static guint
8501 add_ff_mesh_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8502 {
8503   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_action, tvb, offset, 1,
8504                       ENC_LITTLE_ENDIAN);
8505   return 1;
8506 }
8507
8508 static guint
8509 add_ff_multihop_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8510 {
8511   proto_tree_add_item(tree, hf_ieee80211_ff_multihop_action, tvb, offset, 1,
8512                       ENC_LITTLE_ENDIAN);
8513   return 1;
8514 }
8515
8516 static guint
8517 add_ff_mesh_control(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8518 {
8519   int    start = offset;
8520   guint8 flags;
8521
8522   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_flags, tvb, offset, 1,
8523                       ENC_LITTLE_ENDIAN);
8524   flags = tvb_get_guint8(tvb, offset);
8525   offset += 1;
8526   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_ttl, tvb, offset, 1,
8527                       ENC_LITTLE_ENDIAN);
8528   offset += 1;
8529   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_sequence, tvb, offset, 4,
8530                       ENC_LITTLE_ENDIAN);
8531   offset += 4;
8532
8533   switch (flags & 0x03) {
8534   case 1:
8535     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr4, tvb, offset, 6,
8536                         ENC_NA);
8537     offset += 6;
8538     break;
8539   case 2:
8540     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr5, tvb, offset, 6,
8541                         ENC_NA);
8542     offset += 6;
8543     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr6, tvb, offset, 6,
8544                         ENC_NA);
8545     offset += 6;
8546     break;
8547   case 3:
8548     proto_item_append_text(tree, " Unknown Address Extension Mode");
8549     break;
8550   default:
8551     /* no default action */
8552     break;
8553   }
8554
8555   return offset - start;
8556 }
8557
8558 static guint
8559 add_ff_selfprot_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8560 {
8561   proto_tree_add_item(tree, hf_ieee80211_ff_selfprot_action, tvb, offset, 1,
8562                       ENC_LITTLE_ENDIAN);
8563   return 1;
8564 }
8565
8566 static guint
8567 add_ff_dls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8568 {
8569   proto_tree_add_item(tree, hf_ieee80211_ff_dls_action_code, tvb, offset, 1,
8570                       ENC_LITTLE_ENDIAN);
8571   return 1;
8572 }
8573
8574 static guint
8575 add_ff_dst_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8576 {
8577   proto_tree_add_item(tree, hf_ieee80211_ff_dst_mac_addr, tvb, offset, 6,
8578                       ENC_NA);
8579   return 6;
8580 }
8581
8582 static guint
8583 add_ff_src_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8584 {
8585   proto_tree_add_item(tree, hf_ieee80211_ff_src_mac_addr, tvb, offset, 6,
8586                       ENC_NA);
8587   return 6;
8588 }
8589
8590 static guint
8591 add_ff_req_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8592 {
8593   proto_tree_add_item(tree, hf_ieee80211_ff_req_ap_addr, tvb, offset, 6,
8594                       ENC_NA);
8595   return 6;
8596 }
8597
8598 static guint
8599 add_ff_res_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8600 {
8601   proto_tree_add_item(tree, hf_ieee80211_ff_res_ap_addr, tvb, offset, 6,
8602                       ENC_NA);
8603   return 6;
8604 }
8605
8606 static guint
8607 add_ff_check_beacon(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8608 {
8609   proto_tree_add_item(tree, hf_ieee80211_ff_check_beacon, tvb, offset, 1,
8610                       ENC_NA);
8611   return 1;
8612 }
8613
8614 static guint
8615 add_ff_tod(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8616 {
8617   proto_tree_add_item(tree, hf_ieee80211_ff_tod, tvb, offset, 4,
8618                      ENC_NA);
8619   return 4;
8620 }
8621
8622 static guint
8623 add_ff_toa(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8624 {
8625   proto_tree_add_item(tree, hf_ieee80211_ff_toa, tvb, offset, 4,
8626                       ENC_NA);
8627   return 4;
8628 }
8629
8630 static guint
8631 add_ff_max_tod_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8632 {
8633   proto_tree_add_item(tree, hf_ieee80211_ff_max_tod_err, tvb, offset, 1,
8634                       ENC_NA);
8635   return 1;
8636 }
8637
8638 static guint
8639 add_ff_max_toa_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8640 {
8641   proto_tree_add_item(tree, hf_ieee80211_ff_max_toa_err, tvb, offset, 1,
8642                       ENC_NA);
8643   return 1;
8644 }
8645
8646 static guint
8647 add_ff_dls_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8648 {
8649   proto_tree_add_item(tree, hf_ieee80211_ff_dls_timeout, tvb, offset, 2,
8650                       ENC_LITTLE_ENDIAN);
8651   return 2;
8652 }
8653
8654 static guint
8655 add_ff_delba_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8656 {
8657   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_delba_param,
8658                          ett_ff_ba_param_tree, ieee80211_ff_delba_param_fields,
8659                          ENC_LITTLE_ENDIAN);
8660   return 2;
8661 }
8662
8663 static guint
8664 add_ff_max_reg_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8665 {
8666   proto_tree_add_item(tree, hf_ieee80211_ff_max_reg_pwr, tvb, offset, 2,
8667                       ENC_LITTLE_ENDIAN);
8668   return 2;
8669 }
8670
8671 static guint
8672 add_ff_measurement_pilot_int(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8673 {
8674   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
8675                       1, ENC_NA);
8676   return 1;
8677 }
8678
8679 static guint
8680 add_ff_country_str(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8681 {
8682   proto_tree_add_item(tree, hf_ieee80211_ff_country_str, tvb, offset, 3,
8683                       ENC_ASCII|ENC_NA);
8684   return 3;
8685 }
8686
8687 static guint
8688 add_ff_max_tx_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8689 {
8690   proto_tree_add_item(tree, hf_ieee80211_ff_max_tx_pwr, tvb, offset, 1,
8691                       ENC_LITTLE_ENDIAN);
8692   return 1;
8693 }
8694
8695 static guint
8696 add_ff_tx_pwr_used(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8697 {
8698   proto_tree_add_item(tree, hf_ieee80211_ff_tx_pwr_used, tvb, offset, 1,
8699                       ENC_LITTLE_ENDIAN);
8700   return 1;
8701 }
8702
8703 static guint
8704 add_ff_transceiver_noise_floor(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8705 {
8706   proto_tree_add_item(tree, hf_ieee80211_ff_transceiver_noise_floor, tvb,
8707                       offset, 1, ENC_LITTLE_ENDIAN);
8708   return 1;
8709 }
8710
8711 static guint
8712 add_ff_channel_width(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8713 {
8714   proto_tree_add_item(tree, hf_ieee80211_ff_channel_width, tvb, offset, 1,
8715                       ENC_LITTLE_ENDIAN);
8716   return 1;
8717 }
8718
8719 /* QoS Info:  802.11-2012 8.4.1.17 */
8720 static guint
8721 add_ff_qos_info_ap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8722 {
8723   /* From AP so decode as AP: Figure 8-51-QoS Info field when sent by a AP */
8724   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
8725                                     ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
8726                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8727   return 1;
8728 }
8729
8730
8731 /* QoS Info:  802.11-2012 8.4.1.17 */
8732 static guint
8733 add_ff_qos_info_sta(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8734 {
8735   /* To AP so decode as STA: Figure 8-52-QoS Info field when set by a non-AP STA */
8736   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_sta,
8737                                     ett_ff_qos_info, ieee80211_ff_qos_info_sta_fields,
8738                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8739   return 1;
8740 }
8741
8742 static guint
8743 add_ff_sm_pwr_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8744 {
8745   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_sm_pwr_save,
8746                          ett_ff_sm_pwr_save, ieee80211_ff_sw_pwr_save_fields,
8747                          ENC_LITTLE_ENDIAN);
8748   return 1;
8749 }
8750
8751 static guint
8752 add_ff_pco_phase_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8753 {
8754   proto_tree_add_item(tree, hf_ieee80211_ff_pco_phase_cntrl, tvb, offset, 1,
8755                       ENC_LITTLE_ENDIAN);
8756   return 1;
8757 }
8758
8759 static guint
8760 add_ff_psmp_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8761 {
8762   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_psmp_param_set,
8763                          ett_ff_psmp_param_set,
8764                          ieee80211_ff_psmp_param_set_fields,
8765                          ENC_LITTLE_ENDIAN);
8766   return 2;
8767 }
8768
8769 static guint
8770 add_ff_mimo_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8771 {
8772   proto_item *mimo_item;
8773   proto_tree *mimo_tree;
8774   static const int *ieee80211_mimo_fields[] = {
8775     &hf_ieee80211_ff_mimo_cntrl_nc_index,
8776     &hf_ieee80211_ff_mimo_cntrl_nr_index,
8777     &hf_ieee80211_ff_mimo_cntrl_channel_width,
8778     &hf_ieee80211_ff_mimo_cntrl_grouping,
8779     &hf_ieee80211_ff_mimo_cntrl_coefficient_size,
8780     &hf_ieee80211_ff_mimo_cntrl_codebook_info,
8781     &hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
8782     &hf_ieee80211_ff_mimo_cntrl_reserved,
8783     NULL
8784   };
8785
8786   mimo_item = proto_tree_add_item(tree, hf_ieee80211_ff_mimo_cntrl, tvb,
8787                                   offset, 6, ENC_NA);
8788   mimo_tree = proto_item_add_subtree(mimo_item, ett_ff_mimo_cntrl);
8789
8790   proto_tree_add_bitmask_list(mimo_tree, tvb, offset, 2, ieee80211_mimo_fields, ENC_LITTLE_ENDIAN);
8791   offset += 2;
8792   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
8793                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
8794
8795   return 6;
8796 }
8797
8798 static guint
8799 add_ff_ant_selection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8800 {
8801   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ant_selection,
8802                          ett_ff_ant_sel, ieee80211_ff_ant_selection_fields,
8803                          ENC_LITTLE_ENDIAN);
8804   return 1;
8805 }
8806
8807 static guint
8808 add_ff_extended_channel_switch_announcement(proto_tree *tree, tvbuff_t *tvb,
8809                                             packet_info *pinfo _U_, int offset)
8810 {
8811   proto_tree_add_bitmask(tree, tvb, offset,
8812                          hf_ieee80211_ff_ext_channel_switch_announcement,
8813                          ett_ff_chan_switch_announce,
8814                          ieee80211_ff_ext_channel_switch_announcement_fields,
8815                          ENC_LITTLE_ENDIAN);
8816   return 4;
8817 }
8818
8819 static guint
8820 add_ff_ht_information(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8821 {
8822   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ht_info,
8823                          ett_ff_ht_info, ieee80211_ff_ht_info_fields,
8824                          ENC_LITTLE_ENDIAN);
8825   return 1;
8826 }
8827
8828 static guint
8829 add_ff_ht_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8830 {
8831   proto_tree_add_item(tree, hf_ieee80211_ff_ht_action, tvb, offset, 1,
8832                       ENC_LITTLE_ENDIAN);
8833   return 1;
8834 }
8835
8836 static guint
8837 add_ff_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8838 {
8839   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_action_code, tvb, offset, 1,
8840                       ENC_LITTLE_ENDIAN);
8841   return 1;
8842 }
8843
8844 static guint
8845 add_ff_dmg_pwr_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8846 {
8847   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_pwr_mgmt, tvb, offset, 1,
8848                       ENC_LITTLE_ENDIAN);
8849   return 1;
8850 }
8851
8852 static guint
8853 add_ff_psmp_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8854 {
8855   proto_item *psmp_item;
8856   proto_tree *psmp_tree;
8857
8858   psmp_item = proto_tree_add_item(tree, hf_ieee80211_ff_psmp_sta_info, tvb,
8859                                   offset, 8, ENC_LITTLE_ENDIAN);
8860   psmp_tree = proto_item_add_subtree(psmp_item, ett_ff_psmp_sta_info);
8861
8862   proto_tree_add_item(psmp_item, hf_ieee80211_ff_psmp_sta_info_type, tvb,
8863                       offset, 4, ENC_LITTLE_ENDIAN);
8864
8865   switch (tvb_get_letohl(tvb, offset) & PSMP_STA_INFO_FLAG_TYPE) {
8866   case PSMP_STA_INFO_BROADCAST:
8867     proto_tree_add_item(psmp_tree,
8868                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8869                         offset, 4, ENC_LITTLE_ENDIAN);
8870     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8871                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8872     /* Missing 64 bit bitmask... */
8873     proto_tree_add_uint64(psmp_tree,
8874                           hf_ieee80211_ff_psmp_sta_info_reserved_large,
8875                           tvb, offset, 8,
8876                           (tvb_get_letoh64(tvb, offset) &
8877                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
8878     break;
8879   case PSMP_STA_INFO_MULTICAST:
8880     proto_tree_add_item(psmp_tree,
8881                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8882                         offset, 4, ENC_LITTLE_ENDIAN);
8883     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8884                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8885     /* Missing 64 bit bitmask... */
8886     proto_tree_add_uint64(psmp_tree,
8887                           hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
8888                           tvb, offset, 6,
8889                           (tvb_get_letoh64(tvb, offset) &
8890                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
8891     break;
8892   case PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED:
8893     proto_tree_add_item(psmp_tree,
8894                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
8895                         offset, 4, ENC_LITTLE_ENDIAN);
8896     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
8897                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8898     offset += 2;
8899     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_sta_id, tvb,
8900                         offset, 4, ENC_LITTLE_ENDIAN);
8901     offset += 2;
8902
8903     proto_tree_add_item(psmp_tree,
8904                         hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
8905                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8906     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_utt_duration,
8907                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
8908     proto_tree_add_item(psmp_tree,
8909                         hf_ieee80211_ff_psmp_sta_info_reserved_small, tvb,
8910                         offset, 4, ENC_LITTLE_ENDIAN);
8911     break;
8912   }
8913
8914   return 8;
8915 }
8916
8917 static guint
8918 add_ff_schedule_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8919 {
8920   static const int *ieee80211_schedule_info_fields1[] = {
8921     &hf_ieee80211_sched_info_agg,
8922     NULL
8923   };
8924   static const int *ieee80211_schedule_info_fields2[] = {
8925     &hf_ieee80211_sched_info_agg,
8926     &hf_ieee80211_sched_info_tsid,
8927     &hf_ieee80211_sched_info_dir,
8928     NULL
8929   };
8930
8931   if (tvb_get_letohs(tvb, offset) & 0x0001) {
8932     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_sched_info,
8933                                     ett_sched_tree, ieee80211_schedule_info_fields2,
8934                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8935   } else {
8936     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_sched_info,
8937                                     ett_sched_tree, ieee80211_schedule_info_fields1,
8938                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
8939   }
8940
8941   return 2;
8942 }
8943
8944 static guint
8945 add_ff_pa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8946 {
8947   proto_tree_add_item(tree, hf_ieee80211_ff_public_action, tvb, offset, 1,
8948                       ENC_LITTLE_ENDIAN);
8949   return 1;
8950 }
8951
8952 static guint
8953 add_ff_ppa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8954 {
8955   proto_tree_add_item(tree, hf_ieee80211_ff_protected_public_action, tvb, offset, 1,
8956                       ENC_LITTLE_ENDIAN);
8957   return 1;
8958 }
8959
8960 static guint
8961 add_ff_ft_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8962 {
8963   proto_tree_add_item(tree, hf_ieee80211_ff_ft_action_code, tvb, offset, 1,
8964                       ENC_LITTLE_ENDIAN);
8965   return 1;
8966 }
8967
8968 static guint
8969 add_ff_sta_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8970 {
8971   proto_tree_add_item(tree, hf_ieee80211_ff_sta_address, tvb, offset, 6,
8972                       ENC_NA);
8973   return 6;
8974 }
8975
8976 static guint
8977 add_ff_target_ap_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8978 {
8979   proto_tree_add_item(tree, hf_ieee80211_ff_target_ap_address, tvb, offset, 6,
8980                       ENC_NA);
8981   return 6;
8982 }
8983
8984 static guint
8985 add_ff_gas_comeback_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8986 {
8987   proto_tree_add_item(tree, hf_ieee80211_ff_gas_comeback_delay, tvb, offset, 2,
8988                       ENC_LITTLE_ENDIAN);
8989   return 2;
8990 }
8991
8992 static guint
8993 add_ff_gas_fragment_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8994 {
8995   proto_tree_add_item(tree, hf_ieee80211_ff_gas_fragment_id, tvb, offset, 1,
8996                       ENC_LITTLE_ENDIAN);
8997   proto_tree_add_item(tree, hf_ieee80211_ff_more_gas_fragments, tvb, offset, 1,
8998                       ENC_LITTLE_ENDIAN);
8999   return 1;
9000 }
9001
9002 static guint
9003 add_ff_sa_query_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9004 {
9005   proto_tree_add_item(tree, hf_ieee80211_ff_sa_query_action_code, tvb, offset,
9006                       1, ENC_LITTLE_ENDIAN);
9007   return 1;
9008 }
9009
9010 static guint
9011 add_ff_transaction_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9012 {
9013   proto_tree_add_item(tree, hf_ieee80211_ff_transaction_id, tvb, offset, 2,
9014                       ENC_LITTLE_ENDIAN);
9015   return 2;
9016 }
9017
9018 static guint
9019 add_ff_tdls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9020 {
9021   guint8 code;
9022   code = tvb_get_guint8(tvb, offset);
9023   col_set_str(pinfo->cinfo, COL_INFO,
9024               val_to_str_ext_const(code, &tdls_action_codes_ext,
9025                                    "Unknown TDLS Action"));
9026   proto_tree_add_item(tree, hf_ieee80211_ff_tdls_action_code, tvb, offset, 1,
9027                       ENC_LITTLE_ENDIAN);
9028   return 1;
9029 }
9030
9031 static guint
9032 add_ff_target_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9033 {
9034   proto_tree_add_item(tree, hf_ieee80211_ff_target_channel, tvb, offset, 1,
9035                       ENC_LITTLE_ENDIAN);
9036   return 1;
9037 }
9038
9039 static guint
9040 add_ff_operating_class(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9041 {
9042   proto_tree_add_item(tree, hf_ieee80211_ff_operating_class, tvb, offset, 1,
9043                       ENC_LITTLE_ENDIAN);
9044   return 1;
9045 }
9046
9047 static guint
9048 add_ff_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9049 {
9050   guint8 code;
9051
9052   code = tvb_get_guint8(tvb, offset);
9053   col_set_str(pinfo->cinfo, COL_INFO,
9054               val_to_str_ext_const(code, &wnm_action_codes_ext, "Unknown WNM Action"));
9055   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9056   return 1;
9057 }
9058
9059 static guint
9060 add_ff_unprotected_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9061 {
9062   guint8 code;
9063
9064   code = tvb_get_guint8(tvb, offset);
9065   col_set_str(pinfo->cinfo, COL_INFO,
9066               val_to_str_ext_const(code, &unprotected_wnm_action_codes_ext, "Unknown Unprotected WNM Action"));
9067   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9068   return 1;
9069 }
9070
9071 static guint
9072 add_ff_unprotected_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9073 {
9074   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_dmg_action_code, tvb, offset, 1, ENC_NA);
9075   return 1;
9076 }
9077
9078 static guint
9079 add_ff_key_data_length(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9080 {
9081   proto_tree_add_item(tree, hf_ieee80211_ff_key_data_length, tvb, offset, 2,
9082                       ENC_LITTLE_ENDIAN);
9083   return 2;
9084 }
9085
9086 static guint
9087 add_ff_wnm_notification_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9088 {
9089   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_notification_type,
9090                       tvb, offset, 1, ENC_NA);
9091   return 1;
9092 }
9093
9094 /* Action frame: Radio Measurement actions */
9095 static guint
9096 add_ff_rm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9097 {
9098   proto_tree_add_item(tree, hf_ieee80211_ff_rm_action_code, tvb, offset, 1, ENC_NA);
9099   return 1;
9100 }
9101
9102 static guint
9103 add_ff_rm_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9104 {
9105   proto_tree_add_item(tree, hf_ieee80211_ff_rm_dialog_token, tvb, offset, 1, ENC_NA);
9106   return 1;
9107 }
9108
9109 /* Radio Measurement Request frame, Action fields */
9110 static guint
9111 add_ff_rm_repetitions(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9112 {
9113   /* Note: 65535 means repeated until cancelled or superseded */
9114   proto_tree_add_item(tree, hf_ieee80211_ff_rm_repetitions, tvb, offset, 2,
9115                       ENC_BIG_ENDIAN);
9116   return 2;
9117 }
9118
9119 /* Link Measurement Request frame, Action fields*/
9120 static guint
9121 add_ff_rm_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9122 {
9123   /* In dBm, see 8.4.1.20 */
9124   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_power, tvb, offset, 1, ENC_NA);
9125   return 1;
9126 }
9127
9128 static guint
9129 add_ff_rm_max_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9130 {
9131   /* In dBm, see 8.4.1.19 */
9132   proto_tree_add_item(tree, hf_ieee80211_ff_rm_max_tx_power, tvb, offset, 1, ENC_NA);
9133   return 1;
9134 }
9135
9136 /* Link Measurement Report frame, Action fields */
9137 static guint
9138 add_ff_rm_tpc_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9139 {
9140   proto_tree *tpc_tree;
9141   proto_item *tpc_item;
9142
9143   /* 8.4.2.19 TPC Report element */
9144   tpc_item = proto_tree_add_item(tree, hf_ieee80211_ff_tpc, tvb, offset, 4, ENC_NA);
9145   tpc_tree = proto_item_add_subtree(tpc_item, ett_tpc);
9146   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_element_id, tvb, offset, 1, ENC_NA);
9147   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_length, tvb, offset + 1, 1, ENC_NA);
9148   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_tx_power, tvb, offset + 2, 1, ENC_NA);
9149   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_link_margin, tvb, offset + 3, 1, ENC_NA);
9150   return 4;
9151 }
9152
9153 static guint
9154 add_ff_rm_rx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9155 {
9156   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
9157   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rx_antenna_id, tvb, offset, 1, ENC_NA);
9158   return 1;
9159 }
9160
9161 static guint
9162 add_ff_rm_tx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9163 {
9164   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
9165   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_antenna_id, tvb, offset, 1, ENC_NA);
9166   return 1;
9167 }
9168
9169 static guint
9170 add_ff_rm_rcpi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9171 {
9172   /* 8.4.2.40: RCPI as specified for certain PHYs */
9173   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rcpi, tvb, offset, 1, ENC_NA);
9174   return 1;
9175 }
9176
9177 static guint
9178 add_ff_rm_rsni(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9179 {
9180   /* 8.4.2.43: RSNI in steps of 0.5 dB, calculated as:
9181    * RSNI = (10 * log10((RCPI_{power} - ANPI_{power}) / ANPI_{power}) + 20)*2 */
9182   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rsni, tvb, offset, 1, ENC_NA);
9183   return 1;
9184 }
9185
9186 static guint
9187 add_ff_bss_transition_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9188 {
9189   proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_status_code, tvb, offset, 1,
9190                       ENC_LITTLE_ENDIAN);
9191   return 1;
9192 }
9193
9194 static guint
9195 add_ff_bss_termination_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9196 {
9197   proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_delay, tvb, offset, 1,
9198                       ENC_LITTLE_ENDIAN);
9199   return 1;
9200 }
9201
9202 static guint
9203 add_ff_action_spectrum_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9204 {
9205     switch (tvb_get_guint8(tvb, offset + 1)) {
9206     case SM_ACTION_MEASUREMENT_REQUEST:
9207     case SM_ACTION_MEASUREMENT_REPORT:
9208     case SM_ACTION_TPC_REQUEST:
9209     case SM_ACTION_TPC_REPORT:
9210       add_ff_category_code(tree, tvb, pinfo, offset);
9211       add_ff_action_code(tree, tvb, pinfo, offset + 1);
9212       add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
9213       return 3;
9214     case SM_ACTION_CHAN_SWITCH_ANNC:
9215     case SM_ACTION_EXT_CHAN_SWITCH_ANNC:
9216       add_ff_category_code(tree, tvb, pinfo, offset);
9217       add_ff_action_code(tree, tvb, pinfo, offset + 1);
9218       return 2;
9219     default:
9220       add_ff_category_code(tree, tvb, pinfo, offset);
9221       add_ff_action_code(tree, tvb, pinfo, offset + 1);
9222       return 2;
9223     }
9224 }
9225
9226 static guint
9227 add_ff_action_qos(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9228 {
9229   switch (tvb_get_guint8(tvb, offset + 1)) {
9230   case QOS_ACTION_ADDTS_REQUEST:
9231     add_ff_category_code(tree, tvb, pinfo, offset);
9232     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9233     add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
9234     return 3;
9235   case QOS_ACTION_ADDTS_RESPONSE:
9236     add_ff_category_code(tree, tvb, pinfo, offset);
9237     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9238     add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
9239     add_ff_status_code(tree, tvb, pinfo, offset + 3);
9240     return 5;
9241   case QOS_ACTION_DELTS:
9242     add_ff_category_code(tree, tvb, pinfo, offset);
9243     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9244     add_ff_qos_ts_info(tree, tvb, pinfo, offset + 2);
9245     add_ff_reason_code(tree, tvb, pinfo, offset + 5);
9246     return 7;
9247   case QOS_ACTION_SCHEDULE:
9248     add_ff_category_code(tree, tvb, pinfo, offset);
9249     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9250     return 2;
9251   case QOS_ACTION_MAP_CONFIGURE:
9252     add_ff_category_code(tree, tvb, pinfo, offset);
9253     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
9254     return 2;
9255   default:
9256     add_ff_category_code(tree, tvb, pinfo, offset);
9257     return 2;
9258   }
9259 }
9260
9261 static guint
9262 add_ff_action_dls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9263 {
9264   switch (tvb_get_guint8(tvb, offset + 1)) {
9265   case DLS_ACTION_REQUEST:
9266     add_ff_category_code(tree, tvb, pinfo, offset);
9267     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
9268     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  2);
9269     add_ff_src_mac_addr(tree, tvb, pinfo, offset +  8);
9270     add_ff_cap_info(tree, tvb, pinfo, offset + 14);
9271     add_ff_dls_timeout(tree, tvb, pinfo, offset + 16);
9272     return 18;
9273   case DLS_ACTION_RESPONSE:
9274     add_ff_category_code(tree, tvb, pinfo, offset);
9275     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
9276     add_ff_status_code(tree, tvb, pinfo, offset +  2);
9277     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  4);
9278     add_ff_src_mac_addr(tree, tvb, pinfo, offset + 10);
9279     if (!hf_ieee80211_ff_status_code) {
9280       add_ff_cap_info(tree, tvb, pinfo, offset + 16);
9281     }
9282     return 16;
9283   case DLS_ACTION_TEARDOWN:
9284     add_ff_category_code(tree, tvb, pinfo, offset);
9285     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
9286     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  2);
9287     add_ff_src_mac_addr(tree, tvb, pinfo, offset +  8);
9288     add_ff_reason_code(tree, tvb, pinfo, offset + 14);
9289     return 16;
9290   default:
9291     add_ff_category_code(tree, tvb, pinfo, offset);
9292     return 2;
9293   }
9294 }
9295
9296 static guint
9297 add_ff_action_block_ack(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9298 {
9299   guint start = offset;
9300
9301   switch (tvb_get_guint8(tvb, offset + 1)) {
9302   case BA_ADD_BLOCK_ACK_REQUEST:
9303     offset += add_ff_category_code(tree, tvb, pinfo, offset);
9304     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
9305     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9306     offset += add_ff_block_ack_param(tree, tvb, pinfo, offset);
9307     offset += add_ff_block_ack_timeout(tree, tvb, pinfo, offset);
9308     offset += add_ff_block_ack_ssc(tree, tvb, pinfo, offset);
9309     break;
9310   case BA_ADD_BLOCK_ACK_RESPONSE:
9311     offset += add_ff_category_code(tree, tvb, pinfo, offset);
9312     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
9313     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9314     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9315     offset += add_ff_block_ack_param(tree, tvb, pinfo, offset);
9316     offset += add_ff_block_ack_timeout(tree, tvb, pinfo, offset);
9317     break;
9318   case BA_DELETE_BLOCK_ACK:
9319     offset += add_ff_category_code(tree, tvb, pinfo, offset);
9320     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
9321     offset += add_ff_delba_param_set(tree, tvb, pinfo, offset);
9322     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
9323     break;
9324   }
9325
9326   return offset - start;  /* Size of fixed fields */
9327 }
9328
9329 static guint
9330 add_ff_action_public_fields(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint8 code)
9331 {
9332   guint32  oui;
9333   guint    type;
9334   guint    subtype;
9335   guint8   dialog_token;
9336   guint8   frag;
9337   gboolean more;
9338   tvbuff_t *vendor_tvb;
9339   int dissected;
9340
9341   guint start = offset;
9342
9343   switch (code) {
9344   case PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT:
9345     offset += add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
9346     break;
9347   case PA_VENDOR_SPECIFIC:
9348     proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
9349     offset += 3;
9350     switch (oui) {
9351     case OUI_WFA:
9352       subtype = tvb_get_guint8(tvb, offset);
9353       proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
9354       offset += 1;
9355       vendor_tvb = tvb_new_subset_remaining(tvb, offset);
9356       dissected = dissector_try_uint_new(wifi_alliance_public_action_table, subtype, vendor_tvb, pinfo, tree, FALSE, NULL);
9357       offset += dissected;
9358       break;
9359     default:
9360       /* Don't know how to handle this vendor */
9361       break;
9362     }
9363     break;
9364   case PA_GAS_INITIAL_REQUEST:
9365     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9366     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
9367                                              &type, &subtype);
9368     offset += dissect_gas_initial_request(tree, tvb, pinfo, offset, type,
9369                                           subtype);
9370     break;
9371   case PA_GAS_INITIAL_RESPONSE:
9372     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9373     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9374     offset += add_ff_gas_comeback_delay(tree, tvb, pinfo, offset);
9375     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
9376                                              &type, &subtype);
9377     offset += dissect_gas_initial_response(tree, tvb, pinfo, offset, type,
9378                                            subtype);
9379     break;
9380   case PA_GAS_COMEBACK_REQUEST:
9381     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9382     break;
9383   case PA_GAS_COMEBACK_RESPONSE:
9384     dialog_token = tvb_get_guint8(tvb, offset);
9385     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9386     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9387     frag = tvb_get_guint8(tvb, offset) & 0x7f;
9388     more = (tvb_get_guint8(tvb, offset) & 0x80) != 0;
9389     offset += add_ff_gas_fragment_id(tree, tvb, pinfo, offset);
9390     offset += add_ff_gas_comeback_delay(tree, tvb, pinfo, offset);
9391     offset += dissect_advertisement_protocol_common(pinfo, tree, tvb, offset,
9392                                              &type, &subtype);
9393     offset += dissect_gas_comeback_response(tree, tvb, pinfo, offset, type,
9394                                             subtype, frag, more, dialog_token);
9395     break;
9396   case PA_TDLS_DISCOVERY_RESPONSE:
9397     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
9398     col_set_str(pinfo->cinfo, COL_INFO, "TDLS Discovery Response");
9399     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9400     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
9401     break;
9402   case PA_QAB_REQUEST:
9403   case PA_QAB_RESPONSE:
9404     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9405     offset += add_ff_req_ap_addr(tree, tvb, pinfo, offset);
9406     offset += add_ff_res_ap_addr(tree, tvb, pinfo, offset);
9407     break;
9408   }
9409
9410   return offset - start;  /* Size of fixed fields */
9411 }
9412
9413 static guint
9414 add_ff_action_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9415 {
9416   guint8 code;
9417   guint start = offset;
9418   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9419   code    = tvb_get_guint8(tvb, offset);
9420   offset += add_ff_pa_action_code(tree, tvb, pinfo, offset);
9421   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
9422   return offset - start;
9423 }
9424
9425 static guint
9426 add_ff_action_protected_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9427 {
9428   guint8 code;
9429   guint start = offset;
9430   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9431   code    = tvb_get_guint8(tvb, offset);
9432   offset += add_ff_ppa_action_code(tree, tvb, pinfo, offset);
9433   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
9434   return offset - start;
9435 }
9436
9437 static guint
9438 add_ff_action_radio_measurement(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9439 {
9440   guint  start = offset;
9441   guint8 code;
9442
9443   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9444   code = tvb_get_guint8(tvb, offset);
9445   offset += add_ff_rm_action_code(tree, tvb, pinfo, offset);
9446
9447   switch (code) {
9448   case RM_ACTION_RADIO_MEASUREMENT_REQUEST:
9449     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9450     offset += add_ff_rm_repetitions(tree, tvb, pinfo, offset);
9451     /* Followed by Measurement Request Elements */
9452     break;
9453   case RM_ACTION_RADIO_MEASUREMENT_REPORT:
9454     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9455     /* Followed by Measurement Report Elements */
9456     break;
9457   case RM_ACTION_LINK_MEASUREMENT_REQUEST:
9458     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9459     offset += add_ff_rm_tx_power(tree, tvb, pinfo, offset);
9460     offset += add_ff_rm_max_tx_power(tree, tvb, pinfo, offset);
9461     /* Followed by Optional Subelements */
9462     break;
9463   case RM_ACTION_LINK_MEASUREMENT_REPORT:
9464     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9465     offset += add_ff_rm_tpc_report(tree, tvb, pinfo, offset);
9466     offset += add_ff_rm_rx_antenna_id(tree, tvb, pinfo, offset);
9467     offset += add_ff_rm_tx_antenna_id(tree, tvb, pinfo, offset);
9468     offset += add_ff_rm_rcpi(tree, tvb, pinfo, offset);
9469     offset += add_ff_rm_rsni(tree, tvb, pinfo, offset);
9470     /* Followed by Optional Subelements */
9471     break;
9472   case RM_ACTION_NEIGHBOR_REPORT_REQUEST:
9473     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9474     /* Followed by Optional Subelements */
9475     break;
9476   case RM_ACTION_NEIGHBOR_REPORT_RESPONSE:
9477     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
9478     /* Followed by Neighbor Report Elements */
9479     break;
9480   }
9481
9482   return offset - start;  /* Size of fixed fields */
9483 }
9484
9485 static guint
9486 add_ff_action_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9487 {
9488   guint  start = offset;
9489   guint8 code;
9490
9491   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9492   code    = tvb_get_guint8(tvb, offset);
9493   offset += add_ff_ft_action_code(tree, tvb, pinfo, offset);
9494
9495   switch (code) {
9496   case FT_ACTION_REQUEST:
9497     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
9498     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
9499     /* Followed by FT Request frame body (IEs) */
9500     break;
9501   case FT_ACTION_RESPONSE:
9502     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
9503     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
9504     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9505     /* Followed by FT Response frame body (IEs) */
9506     break;
9507   case FT_ACTION_CONFIRM:
9508     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
9509     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
9510     /* Followed by FT Confirm frame body (IEs) */
9511     break;
9512   case FT_ACTION_ACK:
9513     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
9514     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
9515     offset += add_ff_status_code(tree, tvb, pinfo, offset);
9516     /* Followed by FT Ack frame body (IEs) */
9517     break;
9518   }
9519
9520   return offset - start;  /* Size of fixed fields */
9521 }
9522
9523 static guint
9524 add_ff_action_sa_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9525 {
9526   guint  start = offset;
9527   guint8 code;
9528
9529   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9530   code    = tvb_get_guint8(tvb, offset);
9531   offset += add_ff_sa_query_action_code(tree, tvb, pinfo, offset);
9532
9533   switch (code) {
9534   case SA_QUERY_REQUEST:
9535     offset += add_ff_transaction_id(tree, tvb, pinfo, offset);
9536     break;
9537   case SA_QUERY_RESPONSE:
9538     offset += add_ff_transaction_id(tree, tvb, pinfo, offset);
9539     break;
9540   }
9541
9542   return offset - start;  /* Size of fixed fields */
9543 }
9544
9545 static guint
9546 add_ff_action_mesh(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9547 {
9548   guint length;
9549
9550   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9551   offset += add_ff_mesh_action(tree, tvb, pinfo, offset);
9552   /* The only fixed fields are the category and mesh action.  The rest are IEs.
9553    */
9554   length = 2;
9555   if (tvb_get_guint8(tvb, 1) == MESH_ACTION_TBTT_ADJ_RESPONSE) {
9556     /* ..except for the TBTT Adjustment Response, which has a status code field
9557      */
9558     length += add_ff_status_code(tree, tvb, pinfo, offset);
9559   }
9560   return length;
9561 }
9562
9563 static guint
9564 add_ff_action_multihop(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9565 {
9566   guint start = offset;
9567
9568   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9569   offset += add_ff_multihop_action(tree, tvb, pinfo, offset);
9570   offset += add_ff_mesh_control(tree, tvb, pinfo, offset);
9571   return offset - start;
9572 }
9573
9574 static guint
9575 add_ff_action_self_protected(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9576 {
9577   guint start = offset;
9578
9579   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9580   offset += add_ff_selfprot_action(tree, tvb, pinfo, offset);
9581
9582   switch (tvb_get_guint8(tvb, start + 1)) {
9583   case SELFPROT_ACTION_MESH_PEERING_OPEN:
9584     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
9585     break;
9586   case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
9587     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
9588     offset += add_ff_assoc_id(tree, tvb, pinfo, offset);
9589     break;
9590   }
9591
9592   return offset - start;
9593 }
9594
9595 static guint
9596 add_ff_vht_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9597 {
9598   proto_tree_add_item(tree, hf_ieee80211_ff_vht_action, tvb, offset, 1,
9599                       ENC_LITTLE_ENDIAN);
9600   return 1;
9601 }
9602
9603 static guint
9604 get_ff_auth_sae_len(tvbuff_t *tvb)
9605 {
9606   guint alg, seq, status_code;
9607   alg = tvb_get_letohs(tvb, 0);
9608
9609   /* SAE authentication is alg 3 (cf auth_alg) */
9610   if (alg != 3)
9611     return 0;
9612
9613   seq = tvb_get_letohs(tvb, 2);
9614   status_code = tvb_get_letohs(tvb, 4);
9615
9616   /* 82: Rejected with Suggested BSS Transition (cf ieee80211_status_code) */
9617   if ((seq == 2) && (status_code == 82))
9618     return 0;
9619
9620   /* everything is fixed size fields */
9621   return tvb_reported_length_remaining(tvb, 6);
9622 }
9623
9624 static void
9625 add_ff_auth_sae(proto_tree *tree, tvbuff_t *tvb)
9626 {
9627   guint alg, seq, status_code, len;
9628   alg = tvb_get_letohs(tvb, 0);
9629
9630   /* SAE authentication is alg 3 (cf auth_alg) */
9631   if (alg != 3)
9632     return;
9633
9634   seq = tvb_get_letohs(tvb, 2);
9635   status_code = tvb_get_letohs(tvb, 4);
9636
9637   if (seq == 1)
9638   {
9639     /* 76: Authentication is rejected because an Anti-Clogging Token is required (cf ieee80211_status_code) */
9640     if (status_code == 76)
9641     {
9642       proto_tree_add_item(tree, hf_ieee80211_ff_finite_cyclic_group, tvb, 6, 2,
9643                           ENC_LITTLE_ENDIAN);
9644       len = tvb_reported_length_remaining(tvb, 8);
9645       proto_tree_add_item(tree, hf_ieee80211_ff_anti_clogging_token, tvb, 8, len,
9646                           ENC_NA);
9647     }
9648     else if (status_code == 0)
9649     {
9650       guint group = tvb_get_letohs(tvb, 6);
9651       guint sc_len, elt_len, offset;
9652       proto_tree_add_item(tree, hf_ieee80211_ff_finite_cyclic_group, tvb, 6, 2,
9653                           ENC_LITTLE_ENDIAN);
9654       offset = 8;
9655       len = tvb_reported_length_remaining(tvb, offset);
9656       switch (group)
9657       {
9658         /* Diffie-Hellman groups */
9659         case 1:
9660           sc_len = elt_len = 96;
9661           break;
9662         case 2:
9663           sc_len = elt_len = 128;
9664           break;
9665         case 5:
9666           sc_len = elt_len = 192;
9667           break;
9668         case 14:
9669           sc_len = elt_len = 256;
9670           break;
9671         case 15:
9672           sc_len = elt_len = 384;
9673           break;
9674         case 16:
9675           sc_len = elt_len = 512;
9676           break;
9677         case 17:
9678           sc_len = elt_len = 768;
9679           break;
9680         case 18:
9681           sc_len = elt_len = 1024;
9682           break;
9683         case 22:
9684           sc_len = 20;
9685           elt_len = 128;
9686           break;
9687         case 23:
9688           sc_len = 28;
9689           elt_len = 256;
9690           break;
9691         case 24:
9692           sc_len = 32;
9693           elt_len = 256;
9694           break;
9695         /* ECC groups */
9696         case 19:
9697         case 28:
9698           sc_len = 32;
9699           elt_len = 64;
9700           break;
9701         case 20:
9702         case 29:
9703           sc_len = 48;
9704           elt_len = 96;
9705           break;
9706         case 21:
9707           sc_len = 66;
9708           elt_len = 132;
9709           break;
9710         case 25:
9711           sc_len = 24;
9712           elt_len = 48;
9713           break;
9714         case 26:
9715           sc_len = 28;
9716           elt_len = 56;
9717           break;
9718         case 30:
9719           sc_len = 64;
9720           elt_len = 128;
9721           break;
9722         default:
9723           /* assume no anti-clogging token */
9724           if (!(len % 3))
9725           {
9726             sc_len = len / 3;
9727           }
9728           else
9729           {
9730             sc_len = len / 2;
9731           }
9732           elt_len = len - sc_len;
9733           break;
9734       }
9735
9736       if ((sc_len + elt_len) < len)
9737       {
9738         len = len - (sc_len + elt_len);
9739         proto_tree_add_item(tree, hf_ieee80211_ff_anti_clogging_token, tvb, offset,
9740                             len, ENC_NA);
9741         offset += len;
9742       }
9743       proto_tree_add_item(tree, hf_ieee80211_ff_scalar, tvb, offset,
9744                           sc_len, ENC_NA);
9745       offset += sc_len;
9746       proto_tree_add_item(tree, hf_ieee80211_ff_finite_field_element, tvb, offset,
9747                           elt_len, ENC_NA);
9748     }
9749   }
9750   /* 82: Rejected with Suggested BSS Transition (cf ieee80211_status_code) */
9751   else if ((seq == 2) && (status_code != 82))
9752   {
9753     proto_tree_add_item(tree, hf_ieee80211_ff_send_confirm, tvb, 6, 2,
9754                         ENC_LITTLE_ENDIAN);
9755     len = tvb_reported_length_remaining(tvb, 8);
9756     proto_tree_add_item(tree, hf_ieee80211_ff_confirm, tvb, 8, len,
9757                         ENC_NA);
9758   };
9759 }
9760
9761 static guint
9762 wnm_bss_trans_mgmt_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9763 {
9764   int    start = offset;
9765   gint   left;
9766   int tmp_sublen;
9767   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
9768
9769
9770   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9771
9772   proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_query_reason, tvb, offset, 1,
9773                       ENC_NA);
9774   offset += 1;
9775
9776   left = tvb_reported_length_remaining(tvb, offset);
9777   if (left > 0) {
9778     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9779                         tvb, offset, left, ENC_NA);
9780
9781     while (left > 0){
9782       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9783       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9784         break;
9785       }
9786       left -= (tmp_sublen + 2);
9787       offset += (tmp_sublen + 2);
9788     }
9789   }
9790
9791   return offset - start;
9792 }
9793
9794
9795 static guint
9796 wnm_bss_trans_mgmt_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9797 {
9798   int    start = offset;
9799   guint8 mode;
9800   gint   left;
9801   int tmp_sublen;
9802   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
9803
9804   static const int *ieee80211_ff_request_flags[] = {
9805     &hf_ieee80211_ff_request_mode_pref_cand,
9806     &hf_ieee80211_ff_request_mode_abridged,
9807     &hf_ieee80211_ff_request_mode_disassoc_imminent,
9808     &hf_ieee80211_ff_request_mode_bss_term_included,
9809     &hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
9810     NULL
9811   };
9812
9813   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9814
9815   mode = tvb_get_guint8(tvb, offset);
9816   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_ff_request_flags, ENC_LITTLE_ENDIAN);
9817   offset += 1;
9818
9819   proto_tree_add_item(tree, hf_ieee80211_ff_disassoc_timer, tvb, offset, 2,
9820                       ENC_LITTLE_ENDIAN);
9821   offset += 2;
9822
9823   proto_tree_add_item(tree, hf_ieee80211_ff_validity_interval, tvb, offset, 1,
9824                       ENC_LITTLE_ENDIAN);
9825   offset += 1;
9826
9827   if (mode & 0x08) {
9828     proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_duration,
9829                         tvb, offset, 8, ENC_NA);
9830     offset += 8;
9831   }
9832
9833   if (mode & 0x10) {
9834     guint8 url_len;
9835     url_len = tvb_get_guint8(tvb, offset);
9836     proto_tree_add_item(tree, hf_ieee80211_ff_url_len, tvb, offset, 1,
9837                         ENC_LITTLE_ENDIAN);
9838     offset += 1;
9839     proto_tree_add_item(tree, hf_ieee80211_ff_url, tvb, offset, url_len,
9840                         ENC_ASCII|ENC_NA);
9841     offset += url_len;
9842   }
9843
9844   left = tvb_reported_length_remaining(tvb, offset);
9845   if (left > 0) {
9846     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9847                         tvb, offset, left, ENC_NA);
9848
9849     while (left > 0){
9850       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9851       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9852         break;
9853       }
9854       left -= (tmp_sublen + 2);
9855       offset += (tmp_sublen + 2);
9856     }
9857   }
9858
9859   return offset - start;
9860 }
9861
9862
9863 static guint
9864 wnm_bss_trans_mgmt_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9865 {
9866   int    start = offset;
9867   guint8 code;
9868   gint   left;
9869   int tmp_sublen;
9870   const guint8 ids[] = { TAG_NEIGHBOR_REPORT };
9871
9872   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9873   code = tvb_get_guint8(tvb, offset);
9874   offset += add_ff_bss_transition_status_code(tree, tvb, pinfo, offset);
9875   offset += add_ff_bss_termination_delay(tree, tvb, pinfo, offset);
9876   if (!code) {
9877     proto_tree_add_item(tree, hf_ieee80211_ff_target_bss,
9878                         tvb, offset, 6, ENC_NA);
9879     offset += 6;
9880   }
9881   left = tvb_reported_length_remaining(tvb, offset);
9882   if (left > 0) {
9883     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
9884                         tvb, offset, left, ENC_NA);
9885     while (left > 0){
9886       tmp_sublen = tvb_get_guint8(tvb, offset + 1);
9887       if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
9888         break;
9889       }
9890       left -= (tmp_sublen + 2);
9891       offset += (tmp_sublen + 2);
9892     }
9893   }
9894
9895   return offset - start;
9896 }
9897
9898 static guint
9899 wnm_sleep_mode_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9900 {
9901   int start = offset;
9902   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9903   return offset - start;
9904 }
9905
9906 static guint
9907 wnm_sleep_mode_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9908 {
9909   int start = offset;
9910   guint16 key_data_len;
9911   gint left;
9912
9913   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9914   key_data_len = tvb_get_letohs(tvb, offset);
9915   offset += add_ff_key_data_length(tree, tvb, pinfo, offset);
9916   left = tvb_reported_length_remaining(tvb, offset);
9917   if (left < key_data_len) {
9918     expert_add_info(pinfo, tree, &ei_ieee80211_tag_wnm_sleep_mode_no_key_data);
9919     return offset - start;
9920   }
9921   proto_tree_add_item(tree, hf_ieee80211_ff_key_data, tvb, offset,
9922                       key_data_len, ENC_NA);
9923   offset += key_data_len;
9924   return offset - start;
9925 }
9926
9927 static guint
9928 wnm_tfs_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9929 {
9930   int start = offset;
9931   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9932   return offset - start;
9933 }
9934
9935 static guint
9936 wnm_tfs_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9937 {
9938   int start = offset;
9939   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9940   return offset - start;
9941 }
9942
9943 #define AP_DESCRIPTOR            0
9944 #define FIRMWARE_VERSION_CURRENT 1
9945 #define FIRMWARE_VERSION_NEW     2
9946
9947 static guint
9948 dissect_wnm_subelements(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
9949   int offset) {
9950   guint sub_elt_id = tvb_get_guint8(tvb, offset);
9951   guint sub_elt_len = tvb_get_guint8(tvb, offset + 1);
9952
9953   proto_tree_add_item(tree, hf_ieee80211_wnm_sub_elt_id, tvb, offset, 1, ENC_NA);
9954   offset++;
9955
9956   proto_tree_add_item(tree, hf_ieee80211_wnm_sub_elt_len, tvb, offset, 1, ENC_NA);
9957   offset++;
9958
9959   switch (sub_elt_id) {
9960   case AP_DESCRIPTOR:
9961
9962     break;
9963
9964   case FIRMWARE_VERSION_CURRENT:
9965
9966     break;
9967
9968   case FIRMWARE_VERSION_NEW:
9969
9970     break;
9971   }
9972
9973   offset += sub_elt_len;
9974   return offset;
9975 }
9976
9977 static guint
9978 wnm_notification_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9979 {
9980   int start = offset;
9981   int len = 0;
9982   guint8 wnm_type = 0;
9983   guint8 wnm_sub_elt = 0;
9984
9985   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9986   wnm_type = tvb_get_guint8(tvb, offset);
9987   offset += add_ff_wnm_notification_type(tree, tvb, pinfo, offset);
9988   len = tvb_reported_length_remaining(tvb, offset);
9989
9990   if (wnm_type == 0) {
9991     int offset_end = offset + len;
9992     while (offset < offset_end) {
9993       int start_offset = offset;
9994       proto_tree *wnm_list = NULL;
9995       proto_item *wnm_item = NULL;
9996       wnm_list = proto_tree_add_subtree_format(tree, tvb, offset, -1,
9997                         ett_wnm_notif_subelt,
9998                         &wnm_item, "WNM Subelement %d", wnm_sub_elt);
9999       offset = dissect_wnm_subelements(wnm_list, tvb, pinfo, offset);
10000       proto_item_set_len(wnm_item, offset - start_offset);
10001     }
10002   }
10003   return offset - start;
10004 }
10005
10006 static guint
10007 add_ff_action_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10008 {
10009   guint8 code;
10010   guint  start = offset;
10011
10012   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10013   code    = tvb_get_guint8(tvb, offset);
10014   offset += add_ff_wnm_action_code(tree, tvb, pinfo, offset);
10015   switch (code) {
10016   case WNM_BSS_TRANS_MGMT_QUERY:
10017     offset += wnm_bss_trans_mgmt_query(tree, tvb, pinfo, offset);
10018     break;
10019   case WNM_BSS_TRANS_MGMT_REQ:
10020     offset += wnm_bss_trans_mgmt_req(tree, tvb, pinfo, offset);
10021     break;
10022   case WNM_BSS_TRANS_MGMT_RESP:
10023     offset += wnm_bss_trans_mgmt_resp(tree, tvb, pinfo, offset);
10024     break;
10025   case WNM_TFS_REQ:
10026     offset += wnm_tfs_req(tree, tvb, pinfo, offset);
10027     break;
10028   case WNM_TFS_RESP:
10029     offset += wnm_tfs_resp(tree, tvb, pinfo, offset);
10030     break;
10031   case WNM_SLEEP_MODE_REQ:
10032     offset += wnm_sleep_mode_req(tree, tvb, pinfo, offset);
10033     break;
10034   case WNM_SLEEP_MODE_RESP:
10035     offset += wnm_sleep_mode_resp(tree, tvb, pinfo, offset);
10036     break;
10037   case WNM_NOTIFICATION_REQ:
10038     offset += wnm_notification_req(tree, tvb, pinfo, offset);
10039     break;
10040   }
10041
10042   return offset - start;  /* Size of fixed fields */
10043 }
10044
10045 static guint
10046 add_ff_action_unprotected_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10047 {
10048   guint8 code;
10049   guint  start = offset;
10050
10051   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10052   code    = tvb_get_guint8(tvb, offset);
10053   offset += add_ff_unprotected_wnm_action_code(tree, tvb, pinfo, offset);
10054
10055   switch (code) {
10056   case UNPROTECTED_WNM_TIM:
10057     offset += add_ff_check_beacon(tree, tvb, pinfo, offset);
10058     offset += add_ff_timestamp(tree, tvb, pinfo, offset);
10059     offset += add_ff_tod(tree, tvb, pinfo, offset);
10060     offset += add_ff_toa(tree, tvb, pinfo, offset);
10061     offset += add_ff_max_tod_err(tree, tvb, pinfo, offset);
10062     offset += add_ff_max_toa_err(tree, tvb, pinfo, offset);
10063     break;
10064   case UNPROTECTED_WNM_TIMING_MEASUREMENT:
10065     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10066     offset += add_ff_followup_dialog_token(tree, tvb, pinfo, offset);
10067     break;
10068   }
10069
10070   return offset - start;  /* Size of fixed fields */
10071 }
10072
10073 static guint
10074 add_ff_action_tdls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10075 {
10076   guint8  code;
10077   guint16 status;
10078   guint   start = offset;
10079
10080   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10081   code = tvb_get_guint8(tvb, offset);
10082   offset += add_ff_tdls_action_code(tree, tvb, pinfo, offset);
10083   switch (code) {
10084   case TDLS_SETUP_REQUEST:
10085     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10086     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
10087     break;
10088   case TDLS_SETUP_RESPONSE:
10089     status = tvb_get_letohs(tvb, offset);
10090     offset += add_ff_status_code(tree, tvb, pinfo, offset);
10091     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10092     if (tvb_reported_length_remaining(tvb, offset) < 2) {
10093       if (status == 0) {
10094         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_response_malformed);
10095       }
10096       break;
10097     }
10098     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
10099     break;
10100   case TDLS_SETUP_CONFIRM:
10101     status = tvb_get_letohs(tvb, offset);
10102     offset += add_ff_status_code(tree, tvb, pinfo, offset);
10103     if (tvb_reported_length_remaining(tvb, offset) < 1) {
10104       if (status == 0) {
10105         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_confirm_malformed);
10106       }
10107       break;
10108     }
10109     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10110     break;
10111   case TDLS_TEARDOWN:
10112     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
10113     break;
10114   case TDLS_PEER_TRAFFIC_INDICATION:
10115     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10116     break;
10117   case TDLS_CHANNEL_SWITCH_REQUEST:
10118     offset += add_ff_target_channel(tree, tvb, pinfo, offset);
10119     offset += add_ff_operating_class(tree, tvb, pinfo, offset);
10120     break;
10121   case TDLS_CHANNEL_SWITCH_RESPONSE:
10122     offset += add_ff_status_code(tree, tvb, pinfo, offset);
10123     break;
10124   case TDLS_PEER_PSM_REQUEST:
10125     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10126     break;
10127   case TDLS_PEER_PSM_RESPONSE:
10128     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10129     offset += add_ff_status_code(tree, tvb, pinfo, offset);
10130     break;
10131   case TDLS_PEER_TRAFFIC_RESPONSE:
10132     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10133     break;
10134   case TDLS_DISCOVERY_REQUEST:
10135     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10136     break;
10137   }
10138
10139   return offset - start;  /* Size of fixed fields */
10140 }
10141
10142 static guint
10143 add_ff_action_mgmt_notification(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10144 {
10145   guint start = offset;
10146
10147   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10148   offset += add_ff_wme_action_code(tree, tvb, pinfo, offset);
10149   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10150   offset += add_ff_wme_status_code(tree, tvb, pinfo, offset);
10151
10152   return offset - start;  /* Size of fixed fields */
10153 }
10154
10155 static guint
10156 add_ff_action_vendor_specific(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10157 {
10158   guint   start = offset;
10159   guint32 oui;
10160   tvbuff_t *vendor_tvb;
10161   int dissected;
10162
10163   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10164   proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
10165   offset += 3;
10166
10167   vendor_tvb = tvb_new_subset_remaining(tvb, offset);
10168   dissected = dissector_try_uint_new(vendor_specific_action_table, oui, vendor_tvb, pinfo, tree, FALSE, NULL);
10169   if (dissected <= 0)
10170   {
10171       call_data_dissector(vendor_tvb, pinfo, tree);
10172       /* don't advance the dissector pointer as this will probably cause more malformed packets
10173          if vendor is unknown. It also matches previous behavior (before dissection table implementation) */
10174       dissected = 0;
10175   }
10176
10177   offset += dissected;
10178
10179   return offset - start;  /* Size of fixed fields */
10180 }
10181
10182 static guint
10183 add_ff_action_ht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10184 {
10185   guint  start = offset;
10186   guint8 n_sta, i;
10187   mimo_control_t mimo_cntrl;
10188
10189   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10190   offset += add_ff_ht_action_code(tree, tvb, pinfo, offset);
10191
10192   switch (tvb_get_guint8(tvb, offset - 1)) {
10193   case HT_ACTION_NOTIFY_CHAN_WIDTH:
10194     offset += add_ff_channel_width(tree, tvb, pinfo, offset);
10195     break;
10196   case HT_ACTION_SM_PWR_SAVE:
10197     offset += add_ff_sm_pwr_cntrl(tree, tvb, pinfo, offset);
10198     break;
10199   case HT_ACTION_PSMP_ACTION:
10200     n_sta = tvb_get_guint8(tvb, offset);
10201     offset += add_ff_psmp_param_set(tree, tvb, pinfo, offset);
10202     for (i = 0; i < (n_sta & 0x0F); i++) {
10203       offset += add_ff_psmp_sta_info(tree, tvb, pinfo, offset);
10204     }
10205     break;
10206   case HT_ACTION_SET_PCO_PHASE:
10207     offset += add_ff_pco_phase_cntrl(tree, tvb, pinfo, offset);
10208     break;
10209   case HT_ACTION_MIMO_CSI:
10210     mimo_cntrl = get_mimo_control(tvb, offset);
10211     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
10212     offset += add_mimo_csi_matrices_report(tree, tvb, offset, mimo_cntrl);
10213     break;
10214   case HT_ACTION_MIMO_BEAMFORMING:
10215     mimo_cntrl = get_mimo_control(tvb, offset);
10216     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
10217     offset += add_mimo_beamforming_feedback_report(tree, tvb, offset,
10218                                                    mimo_cntrl);
10219     break;
10220   case HT_ACTION_MIMO_COMPRESSED_BEAMFORMING:
10221     mimo_cntrl = get_mimo_control(tvb, offset);
10222     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
10223     offset += add_mimo_compressed_beamforming_feedback_report(tree, tvb,
10224                                                               offset,
10225                                                               mimo_cntrl);
10226     break;
10227   case HT_ACTION_ANT_SEL_FEEDBACK:
10228     offset += add_ff_ant_selection(tree, tvb, pinfo, offset);
10229     break;
10230   case HT_ACTION_HT_INFO_EXCHANGE:
10231     offset += add_ff_ht_information(tree, tvb, pinfo, offset);
10232     break;
10233   }
10234
10235   return offset - start;
10236 }
10237
10238 static guint
10239 add_ff_beacon_interval_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10240 {
10241   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bic,
10242                                     ett_bic_tree, ieee80211_ff_bic_fields,
10243                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10244
10245   return 6;
10246 }
10247
10248 static guint
10249 add_ff_beamforming_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset, gboolean isGrant)
10250 {
10251   guint16 bf_field = tvb_get_letohs(tvb, offset);
10252   gboolean isInit = (bf_field & 0x2) >> 1;
10253   gboolean isResp = (bf_field & 0x4) >> 2;
10254   static const int *ieee80211_ff_beamforming_ctrl[] = {
10255     &hf_ieee80211_ff_bf_train,
10256     &hf_ieee80211_ff_bf_is_init,
10257     &hf_ieee80211_ff_bf_is_resp,
10258     &hf_ieee80211_ff_bf_rxss_len,
10259     &hf_ieee80211_ff_bf_rxss_rate,
10260     &hf_ieee80211_ff_bf_b10b15,
10261     NULL
10262   };
10263
10264   static const int *ieee80211_ff_beamforming_ctrl_grant[] = {
10265     &hf_ieee80211_ff_bf_train,
10266     &hf_ieee80211_ff_bf_is_init,
10267     &hf_ieee80211_ff_bf_is_resp,
10268     &hf_ieee80211_ff_bf_num_sectors,
10269     &hf_ieee80211_ff_bf_num_rx_dmg_ants,
10270     &hf_ieee80211_ff_bf_b12b15,
10271     NULL
10272   };
10273
10274   if((isInit==TRUE) && (isResp==TRUE) && isGrant) {
10275     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bf,
10276                                     ett_bf_tree, ieee80211_ff_beamforming_ctrl_grant,
10277                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10278   } else {
10279     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_bf,
10280                                     ett_bf_tree, ieee80211_ff_beamforming_ctrl,
10281                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10282   }
10283   return 2;
10284 }
10285
10286 static guint
10287 add_ff_dynamic_allocation(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10288 {
10289   static const int *ieee80211_ff_dynamic_allocation[] = {
10290     &hf_ieee80211_ff_TID,
10291     &hf_ieee80211_ff_alloc_type,
10292     &hf_ieee80211_ff_src_aid,
10293     &hf_ieee80211_ff_dest_aid,
10294     &hf_ieee80211_ff_alloc_duration,
10295     &hf_ieee80211_ff_b39,
10296     NULL
10297   };
10298
10299   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_dynamic_allocation,
10300                                     ett_dynamic_alloc_tree, ieee80211_ff_dynamic_allocation,
10301                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10302
10303   return 5;
10304 }
10305
10306 static guint
10307 add_ff_beamformed_link(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10308 {
10309   static const int *ieee80211_ff_beamformed_link[] = {
10310     &hf_ieee80211_ff_blm_unit_index,
10311     &hf_ieee80211_ff_blm_maint_value,
10312     &hf_ieee80211_ff_blm_is_master,
10313     NULL
10314   };
10315
10316   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_blm,
10317                                     ett_blm_tree, ieee80211_ff_beamformed_link,
10318                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10319   return 1;
10320 }
10321
10322 static guint
10323 add_ff_BRP_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10324 {
10325   static const int *ieee80211_ff_BRP_request[] = {
10326     &hf_ieee80211_ff_brp_L_RX,
10327     &hf_ieee80211_ff_brp_TX_TRN_REQ,
10328     &hf_ieee80211_ff_brp_MID_REQ,
10329     &hf_ieee80211_ff_brp_BC_REQ,
10330     &hf_ieee80211_ff_brp_MID_GRANT,
10331     &hf_ieee80211_ff_brp_BC_GRANT,
10332     &hf_ieee80211_ff_brp_chan_FBCK_CAP,
10333     &hf_ieee80211_ff_brp_tx_sector,
10334     &hf_ieee80211_ff_brp_other_aid,
10335     &hf_ieee80211_ff_brp_tx_antenna,
10336     &hf_ieee80211_ff_brp_reserved,
10337     NULL
10338   };
10339
10340   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_brp,
10341                                     ett_brp_tree, ieee80211_ff_BRP_request,
10342                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10343   return 4;
10344 }
10345
10346 static guint
10347 add_ff_sector_sweep_feedback_from_iss(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10348 {
10349   static const int *ieee80211_ff_sector_sweep_feedback_from_iss[] = {
10350     &hf_ieee80211_ff_sswf_total_sectors,
10351     &hf_ieee80211_ff_sswf_num_rx_dmg_ants,
10352     &hf_ieee80211_ff_sswf_reserved1,
10353     &hf_ieee80211_ff_sswf_poll_required,
10354     &hf_ieee80211_ff_sswf_reserved2,
10355     NULL
10356   };
10357
10358   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_sswf,
10359                                     ett_sswf_tree, ieee80211_ff_sector_sweep_feedback_from_iss,
10360                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10361   return 3;
10362 }
10363
10364 static guint
10365 add_ff_sector_sweep_feedback_to_iss(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10366 {
10367   static const int *ieee80211_ff_sector_sweep_feedback_to_iss[] = {
10368     &hf_ieee80211_ff_sswf_sector_select,
10369     &hf_ieee80211_ff_sswf_dmg_antenna_select,
10370     &hf_ieee80211_ff_sswf_snr_report,
10371     &hf_ieee80211_ff_sswf_poll_required,
10372     &hf_ieee80211_ff_sswf_reserved2,
10373     NULL
10374   };
10375
10376   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_sswf,
10377                                     ett_sswf_tree, ieee80211_ff_sector_sweep_feedback_to_iss,
10378                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10379   return 3;
10380 }
10381
10382 static guint
10383 add_ff_sector_sweep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10384 {
10385   static const int *ieee80211_ff_sector_sweep[] = {
10386     &hf_ieee80211_ff_ssw_direction,
10387     &hf_ieee80211_ff_ssw_cdown,
10388     &hf_ieee80211_ff_ssw_sector_id,
10389     &hf_ieee80211_ff_ssw_dmg_ant_id,
10390     &hf_ieee80211_ff_ssw_rxss_len,
10391     NULL
10392   };
10393
10394   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_ssw,
10395                                     ett_ssw_tree, ieee80211_ff_sector_sweep,
10396                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10397   return 3;
10398 }
10399
10400 static guint
10401 add_ff_dmg_params(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10402 {
10403   static const int *ieee80211_ff_dmg_params[] = {
10404     &hf_ieee80211_ff_dmg_params_bss,
10405     &hf_ieee80211_ff_dmg_params_cbap_only,
10406     &hf_ieee80211_ff_dmg_params_cbap_src,
10407     &hf_ieee80211_ff_dmg_params_privacy,
10408     &hf_ieee80211_ff_dmg_params_policy,
10409     NULL
10410   };
10411
10412   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_dmg_params,
10413                                     ett_dmg_params_tree, ieee80211_ff_dmg_params,
10414                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
10415   return 1;
10416 }
10417
10418 static guint
10419 add_ff_cc_field(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean dis)
10420 {
10421   proto_item *cc_item = proto_tree_add_item(tree, hf_ieee80211_ff_cc, tvb, offset, 8, ENC_LITTLE_ENDIAN);
10422   proto_tree *cc_tree = proto_item_add_subtree(cc_item, ett_cc_tree);
10423   guint64 cc_field;
10424   if(dis) {
10425     proto_tree_add_item(cc_tree, hf_ieee80211_ff_cc_abft_resp_addr, tvb, offset, 6, ENC_NA);
10426   } else {
10427     cc_field = tvb_get_letoh64(tvb, offset);
10428     /*TODO : Add support of bitmask for FT_(U)INT64 */
10429     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_sp_duration, tvb, offset, 1, (guint32)(cc_field & 0xff));
10430     proto_tree_add_uint64(cc_tree, hf_ieee80211_ff_cc_cluster_id, tvb, offset+1, 6, (guint64)((cc_field & G_GUINT64_CONSTANT(0x00ffffffffffff00)) >> 8));
10431     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_role, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x0300000000000000)) >> 56));
10432     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_max_mem, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x7c00000000000000)) >> 58));
10433   }
10434   return 8;
10435 }
10436
10437
10438 static guint
10439 add_ff_band_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10440 {
10441   proto_tree_add_item(tree, hf_ieee80211_ff_band_id, tvb, offset, 1, ENC_NA);
10442   return 1;
10443 }
10444
10445 static guint
10446 add_ff_subject_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10447 {
10448   proto_tree_add_item(tree, hf_ieee80211_ff_subject_address, tvb, offset, 6, ENC_NA);
10449   return 6;
10450 }
10451
10452 static guint
10453 add_ff_handover_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10454 {
10455   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reason, tvb, offset, 1, ENC_NA);
10456   return 1;
10457 }
10458
10459 static guint
10460 add_ff_handover_remaining_bi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10461 {
10462   proto_tree_add_item(tree, hf_ieee80211_ff_handover_remaining_bi, tvb, offset, 1, ENC_NA);
10463   return 1;
10464 }
10465
10466 static guint
10467 add_ff_handover_result(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10468 {
10469   proto_tree_add_item(tree, hf_ieee80211_ff_handover_result, tvb, offset, 1, ENC_NA);
10470   return 1;
10471 }
10472
10473 static guint
10474 add_ff_handover_reject_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10475 {
10476   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reject_reason, tvb, offset, 1, ENC_NA);
10477   return 1;
10478 }
10479
10480 static guint
10481 add_ff_destination_reds_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10482 {
10483   proto_tree_add_item(tree, hf_ieee80211_ff_destination_reds_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10484   return 2;
10485 }
10486
10487 static guint
10488 add_ff_destination_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10489 {
10490   proto_tree_add_item(tree, hf_ieee80211_ff_destination_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10491   return 2;
10492 }
10493
10494 static guint
10495 add_ff_realy_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10496 {
10497   proto_tree_add_item(tree, hf_ieee80211_ff_realy_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10498   return 2;
10499 }
10500
10501 static guint
10502 add_ff_source_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10503 {
10504   proto_tree_add_item(tree, hf_ieee80211_ff_source_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10505   return 2;
10506 }
10507
10508 static guint
10509 add_ff_timing_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10510 {
10511   proto_tree_add_item(tree, hf_ieee80211_ff_timing_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10512   return 2;
10513 }
10514
10515 static guint
10516 add_ff_sampling_frequency_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10517 {
10518   proto_tree_add_item(tree, hf_ieee80211_ff_sampling_frequency_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10519   return 2;
10520 }
10521
10522 static guint
10523 add_ff_relay_operation_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10524 {
10525   proto_tree_add_item(tree, hf_ieee80211_ff_relay_operation_type, tvb, offset, 1, ENC_NA);
10526   return 1;
10527 }
10528
10529 static guint
10530 add_ff_fst_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10531 {
10532   proto_tree_add_item(tree, hf_ieee80211_ff_fst_action_code, tvb, offset, 1, ENC_NA);
10533   return 1;
10534 }
10535
10536 static guint
10537 add_ff_llt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10538 {
10539   proto_tree_add_item(tree, hf_ieee80211_ff_llt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10540   return 4;
10541 }
10542
10543 static guint
10544 add_ff_fsts_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10545 {
10546   proto_tree_add_item(tree, hf_ieee80211_ff_fsts_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10547   return 4;
10548 }
10549
10550 static guint
10551 add_ff_oct_mmpdu(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10552 {
10553   guint start = offset;
10554   guint len = tvb_get_letohs(tvb, offset);
10555   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10556   offset += 2;
10557   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_ctrl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10558   offset += 2;
10559   proto_tree_add_item(tree, hf_ieee80211_ff_oct_mmpdu, tvb, offset, len, ENC_NA);
10560   offset += len;
10561   return offset - start;
10562 }
10563
10564 static int
10565 add_tag_relay_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
10566 {
10567   int tag_len = tvb_reported_length(tvb);
10568   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
10569   int offset = 0;
10570   static const int *ieee80211_tag_relay_capabilities[] = {
10571     &hf_ieee80211_tag_relay_support,
10572     &hf_ieee80211_tag_relay_use,
10573     &hf_ieee80211_tag_relay_permission,
10574     &hf_ieee80211_tag_AC_power,
10575     &hf_ieee80211_tag_relay_prefer,
10576     &hf_ieee80211_tag_duplex,
10577     &hf_ieee80211_tag_cooperation,
10578     NULL
10579   };
10580
10581   if (tag_len < 2) {
10582     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length must be 2");
10583     return 1;
10584   }
10585
10586   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_relay_capabilities, ENC_NA);
10587   return tvb_captured_length(tvb);
10588 }
10589
10590 #if 0
10591 static guint
10592 add_ff_relay_capable_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10593 {
10594   proto_item *rcsi_item = proto_tree_add_item(tree, hf_ieee80211_ff_rcsi, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10595   proto_tree *rcsi_tree = proto_item_add_subtree(rcsi_item, ett_rcsi_tree);
10596   proto_tree_add_item(rcsi_tree, hf_ieee80211_ff_rcsi_aid, tvb, offset, 1, ENC_NA);
10597   offset += 1;
10598   add_tag_relay_capabilities(pinfo, rcsi_item, 2, rcsi_tree, tvb, &offset);
10599   return 3;
10600 }
10601 #endif
10602
10603 static void
10604 dissect_ieee80211_extension(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
10605 {
10606   proto_item *ti;
10607   proto_tree *ext_tree;
10608   proto_tree *fixed_tree;
10609   proto_tree *tagged_tree;
10610
10611   int offset = 0;
10612   int tagged_parameter_tree_len;
10613
10614   ti = proto_tree_add_item(tree, proto_wlan_ext, tvb, offset, -1, ENC_NA);
10615   ext_tree = proto_item_add_subtree(ti, ett_80211_ext);
10616
10617   switch (COMPOSE_FRAME_TYPE(fcf))
10618   {
10619     case EXTENSION_DMG_BEACON:
10620     {
10621       gboolean cc, dis;
10622       guint16 bic_field;
10623       fixed_tree = get_fixed_parameter_tree(ext_tree, tvb, offset, 20);
10624       offset += add_ff_timestamp(fixed_tree, tvb, pinfo, offset);
10625       offset += add_ff_sector_sweep(fixed_tree, tvb, pinfo, offset);
10626       offset += add_ff_beacon_interval(fixed_tree, tvb, pinfo, offset);
10627       bic_field = tvb_get_letohs(tvb, offset);
10628       cc = (bic_field & 0x1);
10629       dis  = (bic_field & 0x2) >> 1;
10630       offset += add_ff_beacon_interval_ctrl(fixed_tree, tvb, pinfo, offset);
10631       offset += add_ff_dmg_params(fixed_tree, tvb, pinfo, offset);
10632       if(cc) {
10633         offset += add_ff_cc_field(fixed_tree, tvb, offset, dis);
10634       }
10635       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
10636
10637       /*
10638        * The tagged params are optional here. See Table 8.33a of the 2012
10639        * version of the standard.
10640        */
10641       if (tagged_parameter_tree_len) {
10642         tagged_tree = get_tagged_parameter_tree(ext_tree, tvb, offset, tagged_parameter_tree_len);
10643         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, EXTENSION_DMG_BEACON, NULL);
10644       }
10645       break;
10646     }
10647   }
10648 }
10649
10650 static guint
10651 add_ff_action_unprotected_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
10652 {
10653   guint8 code;
10654   guint  start = offset;
10655
10656   offset += add_ff_category_code(tree, tvb, pinfo, offset);
10657   code    = tvb_get_guint8(tvb, offset);
10658   offset += add_ff_unprotected_dmg_action_code(tree, tvb, pinfo, offset);
10659   switch (code) {
10660     case UNPROTECTED_DMG_ANNOUNCE:
10661       offset += add_ff_timestamp(tree, tvb, pinfo, offset);
10662       offset += add_ff_beacon_interval(tree, tvb, pinfo, offset);
10663       break;
10664     case UNPROTECTED_DMG_BRP:
10665       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
10666       offset += add_ff_BRP_request(tree, tvb, pinfo, offset);
10667       break;
10668   }
10669   return offset - start;
10670 }
10671
10672 /* There is no easy way to skip all these subcarrier indices that must not
10673  * be displayed when showing compressed beamforming feedback matrices
10674  * Table 8-53g IEEE Std 802.11ac-2013 amendment.
10675  *
10676  * The irregular use of case statements in this function is to improve
10677  * readability in what is otherwise a large funtion that does very little.
10678  */
10679 static inline int
10680 vht_compressed_skip_scidx(guint8 nchan_width, guint8 ng, int scidx)
10681 {
10682   switch(nchan_width) {
10683     /* 20 MHz */
10684     case 0:
10685       /* No Grouping */
10686       if (ng == 0)
10687         switch (scidx) {
10688           /* Pilot subcarriers */
10689           case -21: case -7: case 7: case 21:
10690           /* DC subcarrier */
10691           case 0:
10692             scidx++;
10693           default:
10694             break;
10695         }
10696       break;
10697     /* 40 MHz */
10698     case 1:
10699       /* No Grouping */
10700       if (ng == 0)
10701         switch (scidx) {
10702           /* Pilot subcarriers */
10703           case -53: case -25: case -11: case 11: case 25: case 53:
10704             scidx++;
10705             break;
10706           /* DC subcarriers */
10707           case -1: case 0: case 1:
10708             scidx = 2;
10709           default:
10710             break;
10711         }
10712       break;
10713     /* 80 MHz */
10714     case 2:
10715       /* No Grouping */
10716       if (ng == 0)
10717         switch (scidx) {
10718           /* Pilot subcarriers */
10719           case -103: case -75: case -39: case -11: case 11: case 39: case 75: case 103:
10720             scidx++;
10721             break;
10722           /* DC subcarriers, skip -1, 0, 1 */
10723           case -1:
10724             scidx = 2;
10725           default:
10726             break;
10727         }
10728       break;
10729     /* 160 MHz / 80+80 Mhz
10730      * Skip values here assume 160 MHz, as vht_mimo_control does not let us differentiate
10731      * between 160 MHz & 80-80MHz */
10732     case 3:
10733       switch (ng) {
10734         /* No Grouping */
10735         case 0:
10736           /* DC subcarriers, skip -5 to 5*/
10737           if (scidx == -5) {
10738             scidx = 6;
10739             break;
10740           }
10741           switch (scidx) {
10742             /* Pilot subcarriers */
10743             case -231: case -203: case -167: case -139: case -117: case -89: case -53: case -25:
10744             case 25: case 53: case 89: case 117: case 139: case 167: case 203: case 231:
10745               scidx++;
10746               break;
10747             /* Other subcarriers, skip -129 to -127, 127 to 129 */
10748             case -129:
10749               scidx = -126;
10750               break;
10751             case 127:
10752               scidx = 130;
10753               break;
10754             default:
10755               break;
10756           }
10757           break;
10758         /* Grouping of 2 */
10759         case 1:
10760           switch (scidx) {
10761             /* DC subcarriers */
10762             case -128: case -4: case -2: case 0: case 2: case 4: case 128:
10763               scidx++;
10764             default:
10765               break;
10766           }
10767           break;
10768         /* Grouping of 4 */
10769         case 2:
10770           if (scidx == -2 || scidx == 2)
10771             scidx++;
10772           break;
10773       }
10774       break;
10775     default:
10776       break;
10777   }
10778
10779   return scidx;
10780 }
10781
10782 static inline int vht_exclusive_skip_scidx(guint8 nchan_width, guint8 ng, int scidx)
10783 {
10784   switch (nchan_width) {
10785     /* 20 MHz */
10786     case 0:
10787       switch (ng) {
10788         /* No Grouping */
10789         case 0:
10790           if (scidx == -2 || scidx == 1)
10791               scidx++;
10792           else
10793               scidx = scidx + 2;
10794           break;
10795         case 1:
10796           switch (scidx) {
10797             case -4: case 1:
10798               scidx = scidx + 3;
10799               break;
10800             case -1:
10801               scidx = 1;
10802               break;
10803             default:
10804               scidx = scidx + 4;
10805               break;
10806           }
10807           break;
10808         default:
10809           switch (scidx) {
10810             case -4: case 1:
10811               scidx = scidx + 3;
10812               break;
10813             case -1:
10814               scidx = 1;
10815               break;
10816             default:
10817               scidx = scidx + 8;
10818               break;
10819           }
10820           break;
10821       }
10822       break;
10823     /* 40 MHz */
10824     case 1:
10825     /* 80 MHz */
10826     case 2:
10827       switch (ng) {
10828         /* No Grouping */
10829         case 0:
10830           if (scidx == -2)
10831             scidx = 2;
10832           else
10833             scidx = scidx + 2;
10834           break;
10835         case 1:
10836           scidx = scidx + 4;
10837           break;
10838         default:
10839           if (scidx == -2)
10840             scidx = 2;
10841           else
10842             scidx = scidx + 8;
10843           break;
10844       }
10845       break;
10846     /* 160 MHz / 80+80 Mhz */
10847     case 3:
10848       switch (ng) {
10849         /* No Grouping */
10850         case 0:
10851           switch (scidx) {
10852             /* DC subcarriers, skip -4 to 4*/
10853             case -6:
10854               scidx = 6;
10855               break;
10856             /* Other subcarriers, skip -128, 128 */
10857             case -130:
10858               scidx = -126;
10859               break;
10860             case 126:
10861               scidx = 130;
10862               break;
10863             default:
10864               scidx = scidx + 2;
10865               break;
10866           }
10867           break;
10868         case 1:
10869           switch (scidx) {
10870             /* DC subcarriers, skip -4 to 4*/
10871             case -6:
10872               scidx = 6;
10873               break;
10874             default:
10875               scidx = scidx + 4;
10876               break;
10877           }
10878           break;
10879         default:
10880           switch (scidx) {
10881             case -6:
10882               scidx = 6;
10883               break;
10884             case -130:
10885               scidx = -126;
10886               break;
10887             case 126:
10888               scidx = 130;
10889               break;
10890             default:
10891               scidx = scidx + 8;
10892               break;
10893           }
10894         break;
10895       }
10896       break;
10897     default:
10898       break;
10899   }
10900   return scidx;
10901 }
10902
10903 static guint
10904 add_ff_vht_compressed_beamforming_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
10905 {
10906   guint32 vht_mimo;
10907   guint8 nc;
10908   guint8 nr;
10909   guint8 chan_width;
10910   guint8 grouping;
10911   gboolean codebook_info;
10912   gboolean feedback_type;
10913   proto_item *vht_beam_item, *vht_excl_beam_item, *phi_angle, *psi_angle;
10914   proto_tree *vht_beam_tree, *subtree, *vht_excl_beam_tree, *angletree;
10915   int i, matrix_size, len, pos, ns, scidx = 0, matrix_len;
10916   guint8 phi, psi, carry;
10917   int j, ic, off_len = 0, sscidx = 0, xnsc;
10918   int ir, off_pos, angle_val;
10919   /* Table 8-53d Order of angles in the Compressed Beamforming Feedback
10920    * Matrix subfield, IEEE Std 802.11ac-2013 amendment */
10921   static const guint8 na_arr[8][8] = { {  0,  0,  0,  0,  0,  0,  0,  0 },
10922                                        {  2,  2,  0,  0,  0,  0,  0,  0 },
10923                                        {  4,  6,  6,  0,  0,  0,  0,  0 },
10924                                        {  6, 10, 12, 12,  0,  0,  0,  0 },
10925                                        {  8, 14, 18, 20, 20,  0,  0,  0 },
10926                                        { 10, 18, 24, 28, 30, 30,  0,  0 },
10927                                        { 12, 22, 30, 36, 40, 42, 42,  0 },
10928                                        { 14, 26, 36, 44, 50, 54, 56, 56 }
10929                                      };
10930   /* Table 8-53g Subcarriers for which a Compressed Beamforming Feedback Matrix
10931    * subfield is sent back. IEEE Std 802.11ac-2013 amendment */
10932   static const int ns_arr[4][3] = { {  52,  30,  16 },
10933                                     { 108,  58,  30 },
10934                                     { 234, 122,  62 },
10935                                     { 468, 244, 124 }
10936                                   };
10937
10938   /* Table 8-53j, no of Subcarriers for which the Delta SNR subfield is sent back to the beamformer.
10939    * IEEE Std 802.11ac-2013 amendment */
10940   static const int delta_ns_arr[4][3] = { {  30,  16,  10 },
10941                                           {  58,  30,  16 },
10942                                           { 122,  62,  32 },
10943                                           { 244, 124,  64 }
10944                                         };
10945
10946   vht_mimo = tvb_get_letoh24(tvb, offset);
10947   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_vht_mimo_cntrl,
10948                         ett_ff_vhtmimo_cntrl, hf_ieee80211_ff_vht_mimo_cntrl_fields, ENC_LITTLE_ENDIAN);
10949   offset += 3;
10950
10951   /* Extract values for beamforming use */
10952   nc = (vht_mimo & 0x7) + 1;
10953   nr = ((vht_mimo & 0x38) >> 3) + 1;
10954   chan_width = (vht_mimo & 0xC0) >> 6;
10955   grouping = ((vht_mimo & 0x300) >> 8);
10956   codebook_info = (vht_mimo & 0x400) >> 10;
10957   feedback_type = (vht_mimo & 0x800) >> 11;
10958
10959   if (feedback_type) {
10960     if (codebook_info) {
10961       psi = 7; phi = 9;
10962     } else {
10963       psi = 5; phi = 7;
10964     }
10965   } else {
10966     if (codebook_info) {
10967       psi = 4; phi = 6;
10968     } else {
10969       psi = 2; phi = 4;
10970     }
10971   }
10972
10973   vht_beam_item = proto_tree_add_item(tree, hf_ieee80211_vht_compressed_beamforming_report, tvb,
10974                                   offset, -1, ENC_NA);
10975   vht_beam_tree = proto_item_add_subtree(vht_beam_item, ett_ff_vhtmimo_beamforming_report);
10976
10977   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, nc,
10978                         ett_ff_vhtmimo_beamforming_report_snr, NULL, "Average Signal to Noise Ratio");
10979
10980   for (i = 1; i <= nc; i++)
10981   {
10982     gint8 snr;
10983     char edge_sign;
10984
10985     snr = tvb_get_gint8(tvb, offset);
10986
10987     switch(snr) {
10988       case -128:
10989         edge_sign = '<';
10990         break;
10991       case 127:
10992         edge_sign = '>';
10993         break;
10994       default:
10995         edge_sign = ' ';
10996         break;
10997     }
10998
10999     proto_tree_add_int_format(subtree, hf_ieee80211_vht_compressed_beamforming_report_snr, tvb, offset, 1,
11000                                snr, "Stream %d - Signal to Noise Ratio: %c%3.2fdB", i, edge_sign,snr/4.0+22.0);
11001
11002     offset += 1;
11003   }
11004
11005   matrix_size = na_arr[nr - 1][nc -1] * (psi + phi)/2;
11006   if (matrix_size % 8) {
11007     carry = 1;
11008   } else {
11009     carry = 0;
11010   }
11011   off_len = (matrix_size/8) + carry;
11012   angletree = proto_tree_add_subtree_format(vht_beam_tree, tvb, offset, off_len,
11013                         ett_ff_vhtmimo_beamforming_angle, NULL,"PHI and PSI Angle Decode");
11014
11015   off_pos = offset*8;
11016   phi_angle = proto_tree_add_none_format(angletree, hf_ieee80211_vht_compressed_beamforming_phi_angle, tvb, offset, 0, "PHI(%u bits):    ", phi);
11017   for (ic = 1; ic <= nc; ic++) {
11018       for (ir = 1; ir < nr; ir++) {
11019           if (ir >= ic) {
11020               angle_val = (int) tvb_get_bits16(tvb, off_pos, phi, ENC_BIG_ENDIAN);
11021               if ((ir+1 < nr) || (ic+1 <= nc))
11022                 proto_item_append_text(phi_angle, "PHI%d%d: %d, ", ir, ic, angle_val);
11023               else
11024                 proto_item_append_text(phi_angle, "PHI%d%d: %d", ir, ic, angle_val);
11025               off_pos = off_pos + phi;
11026           }
11027       }
11028   }
11029
11030   psi_angle = proto_tree_add_none_format(angletree, hf_ieee80211_vht_compressed_beamforming_psi_angle, tvb, offset, 0, "PSI(%u bits):    ", psi);
11031   for (ic = 1; ic <= nc; ic++)
11032       for (ir = 2; ir <= nr; ir++)
11033           if (ir > ic) {
11034               angle_val = (int) tvb_get_bits8(tvb, off_pos, psi);
11035               if ((ir+1 <= nr) || (ic+1 <= nc))
11036                 proto_item_append_text(psi_angle, "PSI%d%d: %d, ", ir, ic, angle_val);
11037               else
11038                 proto_item_append_text(psi_angle, "PSI%d%d: %d", ir, ic, angle_val);
11039               off_pos = off_pos + psi;
11040           }
11041
11042   /* Table 8-53c Subfields of the VHT MIMO Control field (802.11ac-2013)
11043    * reserves value 3 of the Grouping subfield. */
11044   if (grouping == 3) {
11045     expert_add_info_format(pinfo, vht_beam_item, &ei_ieee80211_inv_val,
11046                            "Grouping subfield value 3 is reserved");
11047     return offset;
11048   }
11049
11050   ns = ns_arr[chan_width][grouping];
11051   if (((matrix_size)*(ns)) % 8)
11052       matrix_len = (((matrix_size) * (ns)) / (8)) + 1;
11053   else
11054       matrix_len = (((matrix_size) * (ns)) / (8));
11055   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, matrix_len,
11056                         ett_ff_vhtmimo_beamforming_report_feedback_matrices, NULL, "Beamforming Feedback Matrix");
11057
11058
11059   switch(chan_width) {
11060     case 0:
11061       scidx = -28;
11062       break;
11063     case 1:
11064       scidx = -58;
11065       break;
11066     case 2:
11067       scidx = -122;
11068       break;
11069     case 3:
11070       /* This is -122 for 80+80MHz Channel Width but vht_mimo_control does not allow us
11071        * to differentiate between 160MHz and 80+80Mhz */
11072       scidx = -250;
11073       break;
11074   }
11075
11076   pos = 0;
11077   for (i = 0; i < ns; i++) {
11078     if (pos % 8)
11079       carry = 1;
11080     else
11081       carry = 0;
11082     len = roundup2((pos + matrix_size), 8)/8 - roundup2(pos, 8)/8;
11083     scidx = vht_compressed_skip_scidx(chan_width, grouping, scidx);
11084
11085     /* TODO : For certain values from na_arr, there is always going be a carry over or overflow from the previous or
11086        into the next octet. The largest of possible unaligned values can be 41 bytes long, and masking and shifting
11087        whole buffers to show correct values with padding and overflow bits is hence skipped, we only mark the bytes
11088        of interest instead */
11089     proto_tree_add_none_format(subtree, hf_ieee80211_vht_compressed_beamforming_feedback_matrix, tvb,
11090                                     offset - carry, len + carry, "Compressed Beamforming Feedback Matrix for subcarrier %d", scidx++);
11091     offset += len;
11092     pos += matrix_size;
11093   }
11094
11095   if (feedback_type) {
11096     xnsc = delta_ns_arr[chan_width][grouping];
11097     if ((nc * xnsc *4) % 8)
11098         off_len = (nc * xnsc *4) / 8 + 1;
11099     else
11100         off_len = (nc * xnsc *4) / 8;
11101     switch(chan_width) {
11102       case 0:
11103         sscidx = -28;
11104         break;
11105       case 1:
11106         sscidx = -58;
11107         break;
11108       case 2:
11109         sscidx = -122;
11110         break;
11111       case 3:
11112         sscidx = -250;
11113         break;
11114     }
11115     vht_excl_beam_item = proto_tree_add_item(tree, hf_ieee80211_vht_mu_exclusive_beamforming_report, tvb, offset, off_len, ENC_NA);
11116     vht_excl_beam_tree = proto_item_add_subtree(vht_excl_beam_item, ett_ff_vhtmu_exclusive_beamforming_report_matrices);
11117
11118     carry = 1;
11119     for (j = 1; j <= xnsc; j++) {
11120       for (ic = 1; ic <= nc; ic++) {
11121         if (carry % 2){
11122           pos = 0;
11123           len = 1;
11124         }
11125         else
11126         {
11127           pos = 1;
11128           len = 0;
11129         }
11130         proto_tree_add_none_format(vht_excl_beam_tree, hf_ieee80211_vht_mu_Exclusive_beamforming_delta_snr, tvb,
11131                                       offset - pos, 1, "Delta SNR for space-time stream %d for subcarrier %d", ic, sscidx);
11132         offset += len;
11133         carry ++;
11134       }
11135       sscidx = vht_exclusive_skip_scidx(chan_width, grouping, sscidx);
11136     }
11137   }
11138
11139   return offset;
11140 }
11141
11142 static guint
11143 add_ff_action_vht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11144 {
11145   guint start = offset;
11146   guint8 vht_action, field_val;
11147   guint64 msa_value;
11148   guint64 upa_value;
11149   int m;
11150   proto_item *ti;
11151   proto_tree *ti_tree;
11152   proto_item *msa, *upa;
11153   proto_tree *msa_tree, *upa_tree;
11154
11155   offset += add_ff_category_code(tree, tvb, pinfo, offset);
11156
11157   vht_action = tvb_get_guint8(tvb, offset);
11158   offset += add_ff_vht_action(tree, tvb, pinfo, offset);
11159
11160   switch(vht_action){
11161     case VHT_ACT_VHT_COMPRESSED_BEAMFORMING:{
11162       offset = add_ff_vht_compressed_beamforming_report(tree, tvb, pinfo, offset);
11163       offset += tvb_reported_length_remaining(tvb, offset);
11164     }
11165     break;
11166     case VHT_ACT_GROUP_ID_MANAGEMENT:{
11167       ti = proto_tree_add_item(tree, hf_ieee80211_vht_group_id_management, tvb,
11168                           offset, -1, ENC_NA);
11169       ti_tree = proto_item_add_subtree(ti, ett_vht_grpidmgmt);
11170
11171       msa_value = tvb_get_letoh64(tvb, offset);
11172       msa = proto_tree_add_item(ti_tree, hf_ieee80211_vht_membership_status_array, tvb,
11173                                 offset, 8, ENC_NA);
11174       msa_tree = proto_item_add_subtree(msa, ett_vht_msa);
11175       for (m = 0; m < 64; m++) {
11176           if (msa_value & (G_GINT64_CONSTANT(1) << m))
11177               proto_tree_add_uint_format(msa_tree, hf_ieee80211_vht_membership_status_field,
11178                                                tvb, offset + (m/8), 1, 1, "Membership Status in Group ID %d: 1", m);
11179       }
11180       offset += 8;
11181
11182       upa = proto_tree_add_item(ti_tree, hf_ieee80211_vht_user_position_array, tvb,
11183                                       offset, 16, ENC_NA);
11184       upa_tree = proto_item_add_subtree(upa, ett_vht_upa);
11185
11186       upa_value = tvb_get_letoh64(tvb, offset);
11187       for (m = 0; m < 32; m++) {
11188           if (msa_value & (G_GINT64_CONSTANT(1) << m)) {
11189               field_val = (guint8) ((upa_value >> m*2) & 0x3);
11190               proto_tree_add_uint_format(upa_tree, hf_ieee80211_vht_user_position_field,
11191                                                tvb, offset + (m/4), 1, field_val, "User Position in Group ID %d: %u", m, field_val);
11192           }
11193       }
11194       upa_value = tvb_get_letoh64(tvb, offset+8);
11195       for (m = 0; m < 32; m++) {
11196           if (msa_value & (G_GINT64_CONSTANT(1) << (32+m))) {
11197               field_val = (guint8) ((upa_value >> m*2) & 0x3);
11198               proto_tree_add_uint_format(upa_tree, hf_ieee80211_vht_user_position_field,
11199                                                tvb, (offset + 8) + (m/4), 1, field_val, "User Position in Group ID %d: %u", m, field_val);
11200           }
11201       }
11202       offset += tvb_reported_length_remaining(tvb, offset);
11203     }
11204     break;
11205     case VHT_ACT_OPERATION_MODE_NOTIFICATION:{
11206       ti = proto_tree_add_item(tree, hf_ieee80211_vht_operation_mode_notification, tvb,
11207                           offset, -1, ENC_NA);
11208       expert_add_info(pinfo, ti, &ei_ieee80211_vht_action);
11209       offset += tvb_reported_length_remaining(tvb, offset);
11210     }
11211     break;
11212     default:
11213     break;
11214   }
11215
11216
11217   return offset - start;
11218 }
11219
11220 #define HE_COMPRESSED_BEAMFORMING_AND_CQI 0
11221 #define HE_QUIET_TIME_PERIOD              1
11222
11223 static const value_string he_action_vals[] = {
11224   { HE_COMPRESSED_BEAMFORMING_AND_CQI, "HE Compressed Beamforming And CQI" },
11225   { HE_QUIET_TIME_PERIOD,              "Quiet Time Period" },
11226   { 0, NULL }
11227 };
11228
11229 static guint
11230 add_ff_he_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_,
11231   int offset)
11232 {
11233   guint8 he_action = tvb_get_guint8(tvb, offset);
11234
11235   proto_tree_add_uint_format(tree, hf_ieee80211_ff_he_action, tvb, offset, 1,
11236                       he_action, "%s", val_to_str(he_action, he_action_vals,
11237                                                 "Reserved"));
11238   return 1;
11239 }
11240
11241 static const int *he_mimo_control_headers[] = {
11242   &hf_he_mimo_control_nc_index,
11243   &hf_he_mimo_control_nr_index,
11244   &hf_he_mimo_control_bw,
11245   &hf_he_mimo_control_grouping,
11246   &hf_he_mimo_control_codebook_info,
11247   &hf_he_mimo_control_feedback_type,
11248   &hf_he_mimo_control_remaining_feedback_segs,
11249   &hf_he_mimo_control_first_feedback_seg,
11250   &hf_he_mimo_control_ru_start_index,
11251   &hf_he_mimo_control_ru_end_index,
11252   &hf_he_mimo_control_sounding_dialog_token_num,
11253   &hf_he_mimo_control_reserved,
11254   NULL
11255 };
11256
11257 static guint
11258 add_ff_action_he(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11259 {
11260   guint start = offset;
11261   guint8 he_action;
11262
11263   offset += add_ff_category_code(tree, tvb, pinfo, offset);
11264
11265   he_action = tvb_get_guint8(tvb, offset);
11266   offset += add_ff_he_action(tree, tvb, pinfo, offset);
11267
11268   switch (he_action) {
11269   case HE_COMPRESSED_BEAMFORMING_AND_CQI:
11270     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
11271                         hf_ieee80211_he_mimo_control_field, ett_he_mimo_control,
11272                         he_mimo_control_headers, ENC_LITTLE_ENDIAN,
11273                         BMT_NO_APPEND);
11274     offset += 5;
11275     break;
11276   case HE_QUIET_TIME_PERIOD:
11277
11278     break;
11279   default:
11280     break;
11281   }
11282   return offset - start;
11283 }
11284
11285 static guint
11286 add_ff_action_fst(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11287 {
11288   guint8 code;
11289   guint  start = offset;
11290
11291   offset += add_ff_category_code(tree, tvb, pinfo, offset);
11292   code    = tvb_get_guint8(tvb, offset);
11293   offset += add_ff_fst_action_code(tree, tvb, pinfo, offset);
11294   switch (code) {
11295     case FST_SETUP_REQUEST:
11296       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11297       offset += add_ff_llt(tree, tvb, pinfo, offset);
11298       break;
11299     case FST_SETUP_RESPONSE:
11300       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11301       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11302       break;
11303     case FST_TEAR_DOWN:
11304       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
11305       break;
11306     case FST_ACK_REQUEST:
11307       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11308       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
11309       break;
11310     case FST_ACK_RESPONSE:
11311       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11312       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
11313       break;
11314     case FST_ON_CHANNEL_TUNNEL_REQUEST:
11315       offset += add_ff_oct_mmpdu(tree, tvb, pinfo, offset);
11316       break;
11317   }
11318   return offset - start;
11319 }
11320
11321 static guint
11322 add_ff_action_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11323 {
11324   guint8 code;
11325   guint  start = offset;
11326   int left_offset;
11327
11328   offset += add_ff_category_code(tree, tvb, pinfo, offset);
11329   code    = tvb_get_guint8(tvb, offset);
11330   offset += add_ff_dmg_action_code(tree, tvb, pinfo, offset);
11331   switch (code) {
11332     case DMG_ACTION_PWR_SAVE_CONFIG_REQ:
11333       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11334       offset += add_ff_dmg_pwr_mgmt(tree, tvb, pinfo, offset);
11335       break;
11336     case DMG_ACTION_PWR_SAVE_CONFIG_RES:
11337       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11338       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11339       break;
11340     case DMG_ACTION_INFO_REQ:
11341       offset += add_ff_subject_address(tree, tvb, pinfo, offset);
11342       break;
11343     case DMG_ACTION_INFO_RES:
11344       offset += add_ff_subject_address(tree, tvb, pinfo, offset);
11345       break;
11346     case DMG_ACTION_HANDOVER_REQ:
11347       offset += add_ff_handover_reason(tree, tvb, pinfo, offset);
11348       offset += add_ff_handover_remaining_bi(tree, tvb, pinfo, offset);
11349       break;
11350     case DMG_ACTION_HANDOVER_RES:
11351       offset += add_ff_handover_result(tree, tvb, pinfo, offset);
11352       offset += add_ff_handover_reject_reason(tree, tvb, pinfo, offset);
11353       break;
11354     case DMG_ACTION_DTP_REQ:
11355       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11356       break;
11357     case DMG_ACTION_DTP_RES:
11358       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11359       break;
11360     case DMG_ACTION_RELAY_SEARCH_REQ:
11361       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11362       offset += add_ff_destination_reds_aid(tree, tvb, pinfo, offset);
11363       break;
11364     case DMG_ACTION_RELAY_SEARCH_RES:
11365       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11366       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11367       break;
11368     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ:
11369       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11370       break;
11371     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES:
11372       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11373       left_offset =
11374           tvb_reported_length_remaining(tvb, offset);
11375       while(left_offset > 0) {
11376         proto_tree_add_item(tree, hf_ieee80211_ff_peer_sta_aid, tvb, offset, 1, ENC_NA);
11377         proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset+1, 1, ENC_NA);
11378         proto_tree_add_item(tree, hf_ieee80211_ff_internal_angle, tvb, offset+2, 1, ENC_NA);
11379         proto_tree_add_item(tree, hf_ieee80211_ff_recommend, tvb, offset+2, 1, ENC_NA);
11380         /* another reserved byte */
11381         offset += 4;
11382         left_offset -= 4;
11383       }
11384       break;
11385     case DMG_ACTION_RLS_REQ:
11386       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11387       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
11388       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
11389       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
11390       break;
11391     case DMG_ACTION_RLS_RES:
11392       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11393       break;
11394     case DMG_ACTION_RLS_ANNOUNCE:
11395       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11396       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11397       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
11398       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
11399       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
11400       break;
11401     case DMG_ACTION_RLS_TEARDOWN:
11402       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
11403       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
11404       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
11405       break;
11406     case DMG_ACTION_RELAY_ACK_REQ:
11407     case DMG_ACTION_RELAY_ACK_RES:
11408       break;
11409     case DMG_ACTION_TPA_REQ:
11410       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11411       offset += add_ff_timing_offset(tree, tvb, pinfo, offset);
11412       offset += add_ff_sampling_frequency_offset(tree, tvb, pinfo, offset);
11413       break;
11414     case DMG_ACTION_TPA_RES:
11415       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11416       break;
11417     case DMG_ACTION_TPA_REP:
11418       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11419       break;
11420     case DMG_ACTION_ROC_REQ:
11421       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11422       offset += add_ff_relay_operation_type(tree, tvb, pinfo, offset);
11423       break;
11424     case DMG_ACTION_ROC_RES:
11425       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
11426       offset += add_ff_status_code(tree, tvb, pinfo, offset);
11427       break;
11428   }
11429   return offset - start;
11430 }
11431
11432 static guint
11433 add_ff_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
11434 {
11435   switch (tvb_get_guint8(tvb, offset) & 0x7f) {
11436   case CAT_SPECTRUM_MGMT: /* 0 */
11437     return add_ff_action_spectrum_mgmt(tree, tvb, pinfo, offset);
11438   case CAT_QOS: /* 1 */
11439     return add_ff_action_qos(tree, tvb, pinfo, offset);
11440   case CAT_DLS: /* 2 */
11441     return add_ff_action_dls(tree, tvb, pinfo, offset);
11442   case CAT_BLOCK_ACK: /* 3 */
11443     return add_ff_action_block_ack(tree, tvb, pinfo, offset);
11444   case CAT_PUBLIC: /* 4 */
11445     return add_ff_action_public(tree, tvb, pinfo, offset);
11446   case CAT_RADIO_MEASUREMENT: /* 5 */
11447     return add_ff_action_radio_measurement(tree, tvb, pinfo, offset);
11448   case CAT_FAST_BSS_TRANSITION: /* 6 */
11449     return add_ff_action_fast_bss_transition(tree, tvb, pinfo, offset);
11450   case CAT_HT: /* 7 */
11451     return add_ff_action_ht(tree, tvb, pinfo, offset);
11452   case CAT_SA_QUERY: /* 8 */
11453     return add_ff_action_sa_query(tree, tvb, pinfo, offset);
11454   case CAT_PUBLIC_PROTECTED: /* 9 */
11455     return add_ff_action_protected_public(tree, tvb, pinfo, offset);
11456   case CAT_WNM: /* 10 */
11457     return add_ff_action_wnm(tree, tvb, pinfo, offset);
11458   case CAT_UNPROTECTED_WNM: /* 11 */
11459     return add_ff_action_unprotected_wnm(tree, tvb, pinfo, offset);
11460   case CAT_TDLS: /* 12 */
11461     return add_ff_action_tdls(tree, tvb, pinfo, offset);
11462   case CAT_MESH: /* 13 */
11463     return add_ff_action_mesh(tree, tvb, pinfo, offset);
11464   case CAT_MULTIHOP: /* 14 */
11465     return add_ff_action_multihop(tree, tvb, pinfo, offset);
11466   case CAT_SELF_PROTECTED: /* 15 */
11467     return add_ff_action_self_protected(tree, tvb, pinfo, offset);
11468   case CAT_DMG: /* 16 */
11469     return add_ff_action_dmg(tree, tvb, pinfo, offset);
11470   case CAT_MGMT_NOTIFICATION:  /* Management notification frame - 17 */
11471     return add_ff_action_mgmt_notification(tree, tvb, pinfo, offset);
11472   case CAT_FAST_SESSION_TRANSFER: /* 18 */
11473     return add_ff_action_fst(tree, tvb, pinfo, offset);
11474 /* case CAT_ROBUST_AV_STREAMING:  19 */
11475 /*   return add_ff_action_robust_av_streaming(tree, tvb, pinfo, offset); */
11476   case CAT_UNPROTECTED_DMG: /* 20 */
11477     return add_ff_action_unprotected_dmg(tree, tvb, pinfo, offset);
11478   case CAT_VHT: /* 21 */
11479     return add_ff_action_vht(tree, tvb, pinfo, offset);
11480   case CAT_HE:
11481     return add_ff_action_he(tree, tvb, pinfo, offset);
11482 /*  case CAT_VENDOR_SPECIFIC_PROTECTED:   Vendor Specific Protected Category - 126 */
11483 /*    return add_ff_action_vendor_specific_protected(tree, tvb, pinfo, offset);*/
11484   case CAT_VENDOR_SPECIFIC:  /* Vendor Specific Protected Category - 127 */
11485     return add_ff_action_vendor_specific(tree, tvb, pinfo, offset);
11486   default:
11487     add_ff_category_code(tree, tvb, pinfo, offset);
11488     return 1;
11489   }
11490 }
11491
11492 static const value_string ieee80211_rsn_cipher_vals[] = {
11493   {0, "NONE"},
11494   {1, "WEP (40-bit)"},
11495   {2, "TKIP"},
11496   {3, "AES (OCB)"},
11497   {4, "AES (CCM)"},
11498   {5, "WEP (104-bit)"},
11499   {6, "BIP"},
11500   {7, "Group addressed traffic not allowed"},
11501   {8, "GCMP"},
11502   {0, NULL}
11503 };
11504
11505 static const value_string ieee80211_rsn_keymgmt_vals[] = {
11506   {0, "NONE"},
11507   {1, "WPA"},
11508   {2, "PSK"},
11509   {3, "FT over IEEE 802.1X"},
11510   {4, "FT using PSK"},
11511   {5, "WPA (SHA256)"},
11512   {6, "PSK (SHA256)"},
11513   {7, "TDLS / TPK Handshake"},
11514   {0, NULL}
11515 };
11516
11517 static void
11518 oui_base_custom(gchar *result, guint32 oui)
11519 {
11520   guint8       p_oui[3];
11521   const gchar *manuf_name;
11522
11523   p_oui[0] = oui >> 16 & 0xFF;
11524   p_oui[1] = oui >> 8 & 0xFF;
11525   p_oui[2] = oui & 0xFF;
11526
11527   /* Attempt an OUI lookup. */
11528   manuf_name = uint_get_manuf_name_if_known(oui);
11529   if (manuf_name == NULL) {
11530     /* Could not find an OUI. */
11531     g_snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x", p_oui[0], p_oui[1], p_oui[2]);
11532   }
11533   else {
11534    /* Found an address string. */
11535     g_snprintf(result, ITEM_LABEL_LENGTH, "%02x:%02x:%02x (%s)", p_oui[0], p_oui[1], p_oui[2], manuf_name);
11536   }
11537 }
11538
11539 static void
11540 rsn_gcs_base_custom(gchar *result, guint32 gcs)
11541 {
11542   gchar oui_result[SHORT_STR];
11543   gchar *tmp_str;
11544
11545   oui_result[0] = '\0';
11546   oui_base_custom(oui_result, gcs >> 8);
11547   tmp_str = val_to_str_wmem(NULL, gcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
11548   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11549   wmem_free(NULL, tmp_str);
11550 }
11551
11552 static void
11553 rsn_pcs_base_custom(gchar *result, guint32 pcs)
11554 {
11555   gchar oui_result[SHORT_STR];
11556   gchar *tmp_str;
11557
11558   oui_result[0] = '\0';
11559   oui_base_custom(oui_result, pcs >> 8);
11560   tmp_str = val_to_str_wmem(NULL, pcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
11561   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11562   wmem_free(NULL, tmp_str);
11563
11564 }
11565 static void
11566 rsn_akms_base_custom(gchar *result, guint32 akms)
11567 {
11568   gchar oui_result[SHORT_STR];
11569   gchar *tmp_str;
11570
11571   oui_result[0] = '\0';
11572   oui_base_custom(oui_result, akms >> 8);
11573   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_rsn_keymgmt_vals, "Unknown %d");
11574   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11575   wmem_free(NULL, tmp_str);
11576 }
11577
11578 static gchar *
11579 rsn_pcs_return(guint32 pcs)
11580 {
11581   gchar *result;
11582
11583   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
11584   result[0] = '\0';
11585   rsn_pcs_base_custom(result, pcs);
11586
11587   return result;
11588 }
11589
11590 static gchar *
11591 rsn_akms_return(guint32 akms)
11592 {
11593   gchar *result;
11594
11595   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
11596   result[0] = '\0';
11597   rsn_akms_base_custom(result, akms);
11598
11599   return result;
11600 }
11601
11602 static void
11603 rsn_gmcs_base_custom(gchar *result, guint32 gmcs)
11604 {
11605   gchar oui_result[SHORT_STR];
11606   gchar *tmp_str;
11607
11608   oui_result[0] = '\0';
11609   oui_base_custom(oui_result, gmcs >> 8);
11610   tmp_str = val_to_str_wmem(NULL, gmcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
11611   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11612   wmem_free(NULL, tmp_str);
11613 }
11614
11615 static void
11616 rsni_base_custom(gchar *result, guint32 rsni)
11617 {
11618   double temp_double;
11619
11620   temp_double = (double)rsni;
11621   g_snprintf(result, ITEM_LABEL_LENGTH, "%f dB", (temp_double / 2));
11622 }
11623
11624 static void
11625 vht_tpe_custom(gchar *result, guint8 txpwr)
11626 {
11627   gint8 txpwr_db;
11628
11629   txpwr_db = (gint8)(txpwr);
11630   g_snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm", (txpwr_db/2.0));
11631 }
11632
11633 static void
11634 channel_number_custom(gchar *result, guint8 channel_number)
11635 {
11636   switch(channel_number){
11637     case 0:
11638       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels in the specified Operating Class)", channel_number);
11639     break;
11640     case 255:
11641       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels listed in the AP Channel Report)", channel_number);
11642     break;
11643     default :
11644       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on that Channel Number)", channel_number);
11645     break;
11646   }
11647 }
11648
11649 /* WPA / WME */
11650 static const value_string ieee802111_wfa_ie_type_vals[] = {
11651   { 1, "WPA Information Element" },
11652   { 2, "WMM/WME" },
11653   { 4, "WPS" },
11654   { 0, NULL }
11655 };
11656
11657 static const value_string ieee80211_wfa_ie_wpa_cipher_vals[] = {
11658   { 0, "NONE" },
11659   { 1, "WEP (40-bit)" },
11660   { 2, "TKIP" },
11661   { 3, "AES (OCB)" },
11662   { 4, "AES (CCM)" },
11663   { 5, "WEP (104-bit)" },
11664   { 6, "BIP" },
11665   { 7, "Group addressed traffic not allowed" },
11666   { 0, NULL }
11667 };
11668
11669 static const value_string ieee80211_wfa_ie_wpa_keymgmt_vals[] = {
11670   { 0, "NONE" },
11671   { 1, "WPA" },
11672   { 2, "PSK" },
11673   { 3, "FT over IEEE 802.1X" },
11674   { 4, "FT using PSK" },
11675   { 5, "WPA (SHA256)" },
11676   { 6, "PSK (SHA256)" },
11677   { 7, "TDLS / TPK Handshake" },
11678   { 0, NULL }
11679 };
11680
11681 static const value_string ieee80211_wfa_ie_wme_acs_vals[] = {
11682   { 0, "Best Effort" },
11683   { 1, "Background" },
11684   { 2, "Video" },
11685   { 3, "Voice" },
11686   { 0, NULL }
11687 };
11688
11689 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals[] = {
11690   { 0, "Uplink" },
11691   { 1, "Downlink" },
11692   { 2, "Direct link" },
11693   { 3, "Bidirectional link" },
11694   { 0, NULL }
11695 };
11696
11697 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals[] = {
11698   { 0, "Legacy" },
11699   { 1, "U-APSD" },
11700   { 0, NULL }
11701 };
11702
11703 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals[] = {
11704   { 0, "Best Effort" },
11705   { 1, "Background" },
11706   { 2, "Spare" },
11707   { 3, "Excellent Effort" },
11708   { 4, "Controlled Load" },
11709   { 5, "Video" },
11710   { 6, "Voice" },
11711   { 7, "Network Control" },
11712   { 0, NULL }
11713 };
11714
11715 static const value_string ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals[] = {
11716   { 0, "WMM AP may deliver all buffered frames (MSDUs and MMPDUs)" },
11717   { 1, "WMM AP may deliver a maximum of 2 buffered frames (MSDUs and MMPDUs) per USP" },
11718   { 2, "WMM AP may deliver a maximum of 4 buffered frames (MSDUs and MMPDUs) per USP" },
11719   { 3, "WMM AP may deliver a maximum of 6 buffered frames (MSDUs and MMPDUs) per USP" },
11720   { 0, NULL}
11721 };
11722 static const true_false_string ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs = {
11723   "WMM delivery and trigger enabled",
11724   "non-WMM PS"
11725 };
11726
11727 static void
11728 wpa_mcs_base_custom(gchar *result, guint32 mcs)
11729 {
11730   gchar oui_result[SHORT_STR];
11731   gchar *tmp_str;
11732
11733   oui_result[0] = '\0';
11734   oui_base_custom(oui_result, mcs >> 8);
11735   tmp_str = val_to_str_wmem(NULL, mcs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
11736   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11737   wmem_free(NULL, tmp_str);
11738 }
11739
11740 static void
11741 wpa_ucs_base_custom(gchar *result, guint32 ucs)
11742 {
11743   gchar oui_result[SHORT_STR];
11744   gchar *tmp_str;
11745
11746   oui_result[0] = '\0';
11747   oui_base_custom(oui_result, ucs >> 8);
11748   tmp_str = val_to_str_wmem(NULL, ucs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
11749   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11750   wmem_free(NULL, tmp_str);
11751 }
11752 static void
11753 wpa_akms_base_custom(gchar *result, guint32 akms)
11754 {
11755   gchar oui_result[SHORT_STR];
11756   gchar *tmp_str;
11757
11758   oui_result[0] = '\0';
11759   oui_base_custom(oui_result, akms >> 8);
11760   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_wfa_ie_wpa_keymgmt_vals, "Unknown %d");
11761   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
11762   wmem_free(NULL, tmp_str);
11763 }
11764
11765 static gchar *
11766 wpa_ucs_return(guint32 ucs)
11767 {
11768   gchar *result;
11769
11770   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
11771   result[0] = '\0';
11772   wpa_ucs_base_custom(result, ucs);
11773
11774   return result;
11775 }
11776
11777 static gchar *
11778 wpa_akms_return(guint32 akms)
11779 {
11780   gchar *result;
11781
11782   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
11783   result[0] = '\0';
11784   wpa_akms_base_custom(result, akms);
11785
11786   return result;
11787 }
11788
11789 /* For each Field */
11790 static const value_string ieee80211_wapi_suite_type[] = {
11791   {0, "Reserved"},
11792   {1, "WAI Certificate Authentication and Key Management"},
11793   {2, "WAI Preshared Key Authentication and Key Management"},
11794   {0, NULL},
11795 };
11796 /* For Summary Tag Information */
11797 static const value_string ieee80211_wapi_suite_type_short[] = {
11798   {0, "Reserved"},
11799   {1, "WAI-CERT"},
11800   {2, "WAI-PSK"},
11801   {0, NULL},
11802 };
11803
11804 static const value_string ieee80211_wapi_cipher_type[] = {
11805   {0, "Reserved"},
11806   {1, "WPI-SMS4"},
11807   {0, NULL},
11808 };
11809
11810 static const value_string ieee802111_wfa_ie_wme_type[] = {
11811   { 0, "Information Element" },
11812   { 1, "Parameter Element" },
11813   { 2, "TSPEC Element" },
11814   { 0, NULL}
11815 };
11816
11817 static const value_string ft_subelem_id_vals[] = {
11818   {0, "Reserved"},
11819   {1, "PMK-R1 key holder identifier (R1KH-ID)"},
11820   {2, "GTK subelement"},
11821   {3, "PMK-R0 key holder identifier (R0KH-ID)"},
11822   {4, "IGTK"},
11823   {0, NULL}
11824 };
11825
11826 static int
11827 dissect_wme_qos_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
11828 {
11829   proto_item *wme_qos_info_item;
11830
11831   static const int *ieee80211_mgt_req[] = {
11832     &hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
11833     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
11834     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
11835     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
11836     &hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
11837     &hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
11838     NULL
11839   };
11840
11841   static const int *ieee80211_mgt_resp[] = {
11842     &hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
11843     &hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
11844     &hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
11845     NULL
11846   };
11847
11848   switch (ftype) {
11849     case MGT_ASSOC_REQ:
11850     case MGT_PROBE_REQ:
11851     case MGT_REASSOC_REQ:
11852     {
11853       /* To AP so decode as per WMM standard Figure 7 QoS Info field when sent from WMM STA*/
11854       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_qos_info,
11855                                     ett_wme_qos_info, ieee80211_mgt_req,
11856                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11857       break;
11858     }
11859     case MGT_BEACON:
11860     case MGT_PROBE_RESP:
11861     case MGT_ASSOC_RESP:
11862     case MGT_REASSOC_RESP:
11863     {
11864       /* From AP so decode as per WMM standard Figure 6 QoS Info field when sent from WMM AP */
11865       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_qos_info,
11866                                     ett_wme_qos_info, ieee80211_mgt_resp,
11867                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11868       break;
11869     }
11870     default:
11871         wme_qos_info_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_qos_info, tvb, offset, 1, ENC_NA);
11872         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);
11873       break;
11874     }
11875
11876   offset += 1;
11877   return offset;
11878 }
11879
11880 static int
11881 decode_qos_parameter_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
11882 {
11883   int i;
11884   /* WME QoS Info Field */
11885   offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
11886   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_reserved, tvb, offset, 1, ENC_NA);
11887   offset += 1;
11888   /* AC Parameters */
11889   for (i = 0; i < 4; i++)
11890   {
11891     proto_item *ac_item, *aci_aifsn_item, *ecw_item;
11892     proto_tree *ac_tree, *ecw_tree;
11893     guint8 aci_aifsn, ecw, ecwmin, ecwmax;
11894     guint16 cwmin, cwmax;
11895     static const int *ieee80211_wfa_ie_wme[] = {
11896         &hf_ieee80211_wfa_ie_wme_acp_aci,
11897         &hf_ieee80211_wfa_ie_wme_acp_acm,
11898         &hf_ieee80211_wfa_ie_wme_acp_aifsn,
11899         &hf_ieee80211_wfa_ie_wme_acp_reserved,
11900         NULL
11901     };
11902
11903     ac_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_ac_parameters, tvb, offset, 4, ENC_NA);
11904     ac_tree = proto_item_add_subtree(ac_item, ett_wme_ac);
11905
11906     /* ACI/AIFSN Field */
11907     aci_aifsn_item = proto_tree_add_bitmask_with_flags(ac_tree, tvb, offset, hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
11908                             ett_wme_aci_aifsn, ieee80211_wfa_ie_wme,
11909                             ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
11910     aci_aifsn = tvb_get_guint8(tvb, offset);
11911     /* 802.11-2012, 8.4.2.31 EDCA Parameter Set element */
11912     if (aci_aifsn < 2) {
11913        expert_add_info_format(pinfo, aci_aifsn_item, &ei_ieee80211_qos_bad_aifsn,
11914          "The minimum value for the AIFSN subfield is 2 (found %u).", aci_aifsn);
11915     }
11916     proto_item_append_text(ac_item, " ACI %u (%s), ACM %s, AIFSN %u",
11917       (aci_aifsn & 0x60) >> 5, try_val_to_str((aci_aifsn & 0x60) >> 5, ieee80211_wfa_ie_wme_acs_vals),
11918       (aci_aifsn & 0x10) ? "yes" : "no", aci_aifsn & 0x0f);
11919     offset += 1;
11920
11921     /* ECWmin/ECWmax field */
11922     ecw_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_ecw, tvb, offset, 1, ENC_NA);
11923     ecw_tree = proto_item_add_subtree(ecw_item, ett_wme_ecw);
11924     ecw = tvb_get_guint8(tvb, offset);
11925     ecwmin = ecw & 0x0f;
11926     ecwmax = (ecw & 0xf0) >> 4;
11927     cwmin= (1 << ecwmin) - 1;
11928     cwmax= (1 << ecwmax) - 1;
11929     proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_max, tvb, offset, 1, ENC_NA);
11930     proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_min, tvb, offset, 1, ENC_NA);
11931     proto_tree_add_uint(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_cw_max, tvb, offset, 1, cwmax);
11932     proto_tree_add_uint(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_cw_min, tvb, offset, 1, cwmin);
11933     proto_item_append_text(ac_item, ", ECWmin/max %u/%u (CWmin/max %u/%u)", ecwmin, ecwmax, cwmin, cwmax);
11934     offset += 1;
11935
11936     /* TXOP Limit */
11937     proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_txop_limit, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11938     proto_item_append_text(ac_item, ", TXOP %u", tvb_get_letohs(tvb, offset));
11939     offset += 2;
11940   }
11941
11942   return offset;
11943 }
11944
11945 static int
11946 dissect_vendor_ie_wpawme(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 tag_len, int ftype)
11947 {
11948   guint8 type;
11949
11950   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_type, tvb, offset, 1, ENC_NA);
11951   type = tvb_get_guint8(tvb, offset);
11952   proto_item_append_text(tree, ": %s", val_to_str(type, ieee802111_wfa_ie_type_vals, "Unknown %d"));
11953   offset += 1;
11954
11955   switch (type) {
11956     case 1:   /* Wi-Fi Protected Access (WPA) */
11957     {
11958       proto_item *wpa_mcs_item, *wpa_ucs_item, *wpa_akms_item;
11959       proto_item *wpa_sub_ucs_item, *wpa_sub_akms_item;
11960       proto_tree *wpa_mcs_tree, *wpa_ucs_tree, *wpa_akms_tree;
11961       proto_tree *wpa_sub_ucs_tree, *wpa_sub_akms_tree;
11962       guint16 ucs_count, akms_count;
11963       guint ii;
11964
11965       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11966       offset += 2;
11967
11968       /* Multicast Cipher Suite */
11969       wpa_mcs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_mcs, tvb, offset, 4, ENC_BIG_ENDIAN);
11970       wpa_mcs_tree = proto_item_add_subtree(wpa_mcs_item, ett_wpa_mcs_tree);
11971       proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11972
11973       /* Check if OUI is 00:50:F2 (WFA) */
11974       if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
11975       {
11976         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_wfa_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11977       } else {
11978         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
11979       }
11980       offset += 4;
11981
11982       /* Unicast Cipher Suites */
11983       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11984       ucs_count = tvb_get_letohs(tvb, offset);
11985       offset += 2;
11986
11987       wpa_ucs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_list, tvb, offset, ucs_count * 4, ENC_NA);
11988       wpa_ucs_tree = proto_item_add_subtree(wpa_ucs_item, ett_wpa_ucs_tree);
11989       for (ii = 0; ii < ucs_count; ii++)
11990       {
11991         wpa_sub_ucs_item = proto_tree_add_item(wpa_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs, tvb, offset, 4, ENC_BIG_ENDIAN);
11992         wpa_sub_ucs_tree = proto_item_add_subtree(wpa_sub_ucs_item, ett_wpa_sub_ucs_tree);
11993         proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
11994
11995         /* Check if OUI is 00:50:F2 (WFA) */
11996         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
11997         {
11998           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
11999           proto_item_append_text(wpa_ucs_item, " %s", wpa_ucs_return(tvb_get_ntohl(tvb, offset)));
12000         } else {
12001           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
12002         }
12003         offset += 4;
12004       }
12005
12006       /* Authenticated Key Management Suites */
12007       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12008       akms_count = tvb_get_letohs(tvb, offset);
12009       offset += 2;
12010
12011       wpa_akms_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_list, tvb, offset, akms_count * 4, ENC_NA);
12012       wpa_akms_tree = proto_item_add_subtree(wpa_akms_item, ett_wpa_akms_tree);
12013       for (ii = 0; ii < akms_count; ii++)
12014       {
12015         wpa_sub_akms_item = proto_tree_add_item(wpa_akms_tree, hf_ieee80211_wfa_ie_wpa_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
12016         wpa_sub_akms_tree = proto_item_add_subtree(wpa_sub_akms_item, ett_wpa_sub_akms_tree);
12017         proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
12018
12019         /* Check if OUI is 00:50:F2 (WFA) */
12020         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
12021         {
12022           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
12023           proto_item_append_text(wpa_akms_item, " %s", wpa_akms_return(tvb_get_ntohl(tvb, offset)));
12024         } else {
12025           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
12026         }
12027         offset += 4;
12028       }
12029       break;
12030     }
12031     case 2:   /* Wireless Multimedia Enhancements (WME) */
12032     {
12033       guint8 subtype;
12034
12035       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_subtype, tvb, offset, 1, ENC_NA);
12036       subtype = tvb_get_guint8(tvb, offset);
12037       proto_item_append_text(tree, ": %s", val_to_str(subtype, ieee802111_wfa_ie_wme_type, "Unknown %d"));
12038       offset += 1;
12039       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_version, tvb, offset, 1, ENC_NA);
12040       offset += 1;
12041       switch (subtype) {
12042         case 0: /* WME Information Element */
12043         {
12044           /* WME QoS Info Field */
12045           offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
12046           break;
12047         }
12048         case 1: /* WME Parameter Element */
12049         {
12050           offset = decode_qos_parameter_set(tree, tvb, pinfo, offset, ftype);
12051           break;
12052         }
12053         case 2:   /* WME TSPEC Element */
12054         {
12055             static const int *ieee80211_wfa_ie_wme_tspec_tsinfo[] = {
12056               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
12057               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
12058               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
12059               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
12060               &hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
12061               NULL
12062             };
12063
12064             proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
12065                                     ett_tsinfo_tree, ieee80211_wfa_ie_wme_tspec_tsinfo,
12066                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12067             offset += 3;
12068
12069             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12070             offset += 2;
12071
12072             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12073             offset += 2;
12074
12075             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12076             offset += 4;
12077
12078             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12079             offset += 4;
12080
12081             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12082             offset += 4;
12083
12084             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12085             offset += 4;
12086
12087             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12088             offset += 4;
12089
12090             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12091             offset += 4;
12092
12093             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12094             offset += 4;
12095
12096             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12097             offset += 4;
12098
12099             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12100             offset += 4;
12101
12102             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12103             offset += 4;
12104
12105             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12106             offset += 4;
12107
12108             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12109             offset += 2;
12110
12111             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12112             offset += 2;
12113
12114           break;
12115         }
12116         default:
12117           /* No default Action */
12118         break;
12119       } /* End switch (subtype) */
12120       break;
12121     }
12122     case 4: /* WPS: Wifi Protected Setup */
12123     {
12124       dissect_wps_tlvs(tree, tvb, offset, tag_len-1, NULL);
12125     }
12126     break;
12127     default:
12128       /* No default Action...*/
12129     break;
12130   } /* End switch (type) */
12131
12132   return offset;
12133 }
12134
12135 /*
12136  * Dissect a group data cipher suite which consists of an OUI and a one-byte
12137  * selector: IEEE802.11 2012 Figure 9-256.
12138  *
12139  * Accepts a two entry array of header fields so we can use this elsewhere.
12140  */
12141 static int dissect_group_data_cipher_suite(tvbuff_t *tvb, packet_info *pinfo _U_,
12142     proto_tree *tree, int offset, int *hf_array, gint ett_val, char *label)
12143 {
12144   proto_tree *gdcs_tree = NULL;
12145
12146   gdcs_tree = proto_tree_add_subtree(tree, tvb, offset, 4, ett_val, NULL,
12147                          label);
12148   proto_tree_add_item(gdcs_tree, hf_array[0], tvb, offset, 3, ENC_BIG_ENDIAN);
12149   offset += 3;
12150   proto_tree_add_item(gdcs_tree, hf_array[1], tvb, offset, 1, ENC_NA);
12151   offset += 1;
12152
12153   return offset;
12154 }
12155
12156 /*
12157  * Handle the HS 2.0 rev 2 OSU Server-only authenticated layer 2 Encryption
12158  * Network element. This is almost the same format as the RSNE so maybe some
12159  * common code can be used.
12160  */
12161 static int
12162 dissect_hs20_osen(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
12163 {
12164   int offset = 0;
12165   int hf_array[2] = { hf_group_data_cipher_suite_oui,
12166                        hf_group_data_cipher_suite_type };
12167   proto_tree *pwc_list = NULL;
12168   proto_item *pwcsi = NULL;
12169   guint16 pwc_count = 0, pwc_index = 0;
12170   guint16 akms_count = 0, akms_index = 0;
12171   static const int *osen_rsn_cap[] = {
12172     &hf_osen_rsn_cap_preauth,
12173     &hf_osen_rsn_cap_no_pairwise,
12174     &hf_osen_rsn_cap_ptksa_replay_counter,
12175     &hf_osen_rsn_cap_gtksa_replay_counter,
12176     &hf_osen_rsn_cap_mfpr,
12177     &hf_osen_rsn_cap_mfpc,
12178     &hf_osen_rsn_cap_jmr,
12179     &hf_osen_rsn_cap_peerkey,
12180     &hf_osen_rsn_spp_a_msdu_capable,
12181     &hf_osen_rsn_spp_a_msdu_required,
12182     &hf_osen_rsn_pbac,
12183     &hf_osen_extended_key_id_iaf,
12184     &hf_osen_reserved,
12185     NULL
12186   };
12187   guint16 pmkid_count = 0, pmkid_index = 0;
12188   int gmcs_array[2] = { hf_osen_group_management_cipher_suite_oui,
12189                         hf_osen_group_management_cipher_suite_type };
12190
12191   offset = dissect_group_data_cipher_suite(tvb, pinfo, tree, offset, hf_array,
12192                         ett_osen_group_data_cipher_suite,
12193                         "OSEN Group Data Cipher Suite");
12194
12195   pwc_count = tvb_get_letohs(tvb, offset);
12196   proto_tree_add_item(tree, hf_osen_pcs_count, tvb, offset,
12197                       2, ENC_LITTLE_ENDIAN);
12198   offset += 2;
12199
12200   if (pwc_count > 0) {
12201     int start_offset = offset;
12202     pwc_list = proto_tree_add_subtree(tree, tvb, offset, -1,
12203                         ett_osen_pairwise_cipher_suites, &pwcsi,
12204                         "OSEN Pairwise Cipher Suite List");
12205
12206     while (pwc_count > 0) {
12207       if (tvb_reported_length_remaining(tvb, offset) >= 4) {
12208         int hf_array2[2] = { hf_osen_pairwise_cipher_suite_oui,
12209                             hf_osen_pairwise_cipher_suite_type };
12210         char label[128];
12211
12212         g_snprintf(label, sizeof(label), "OSEN Pairwise Cipher Suite %d", pwc_index);
12213         offset = dissect_group_data_cipher_suite(tvb, pinfo, pwc_list,
12214                         offset, hf_array2, ett_osen_pairwise_cipher_suite,
12215                         label);
12216         pwc_index++;
12217         pwc_count--;
12218       } else {
12219         /* Insert the remaining? Expert Info? */
12220         offset += tvb_reported_length_remaining(tvb, offset);
12221         break;
12222       }
12223     }
12224
12225     proto_item_set_len(pwcsi, offset - start_offset);
12226   }
12227
12228   if (tvb_reported_length_remaining(tvb, offset) == 0) {
12229     return tvb_captured_length(tvb);
12230   }
12231
12232   /* Now handle the AKM Suites */
12233   akms_count = tvb_get_letohs(tvb, offset);
12234   proto_tree_add_item(tree, hf_osen_akm_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12235   offset += 2;
12236
12237   if (akms_count > 0) {
12238     int start_offset = offset;
12239     proto_tree *akm_list = NULL;
12240     proto_item *akmcsi = NULL;
12241
12242     akm_list = proto_tree_add_subtree(tree, tvb, offset, -1,
12243                         ett_osen_akm_cipher_suites, &akmcsi,
12244                         "OSEN AKM Cipher Suite List");
12245
12246     while (akms_count > 0) {
12247       if (tvb_reported_length_remaining(tvb, offset) >= 4) {
12248         int hf_array3[2] = { hf_osen_akm_cipher_suite_oui,
12249                              hf_osen_akm_cipher_suite_type};
12250         char label[128];
12251
12252         g_snprintf(label, sizeof(label), "OSEN AKM Cipher Suite %d", akms_index);
12253         offset = dissect_group_data_cipher_suite(tvb, pinfo, akm_list,
12254                           offset, hf_array3, ett_osen_akm_cipher_suite,
12255                           label);
12256         akms_index++;
12257         akms_count--;
12258       } else {
12259         /* Expert info? */
12260         offset += tvb_reported_length_remaining(tvb, offset);
12261         break;
12262       }
12263     }
12264     proto_item_set_len(akmcsi, offset - start_offset);
12265   }
12266
12267   /* Any more? */
12268   if (tvb_reported_length_remaining(tvb, offset) == 0) {
12269     return tvb_captured_length(tvb);
12270   }
12271
12272   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_osen_rsn_cap_flags,
12273                                     ett_osen_rsn_cap_tree, osen_rsn_cap,
12274                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12275   offset += 2;
12276
12277   /* Any more? */
12278   if (tvb_reported_length_remaining(tvb, offset) == 0) {
12279     return tvb_captured_length(tvb);
12280   }
12281
12282   pmkid_count = tvb_get_letohs(tvb, offset);
12283   proto_tree_add_item(tree, hf_osen_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12284   offset += 2;
12285
12286   if (pmkid_count > 0) {
12287     proto_tree *pmkid_list = NULL;
12288
12289     pmkid_list = proto_tree_add_subtree(tree, tvb, offset, pmkid_count * 16,
12290                                 ett_osen_pmkid_list, NULL,
12291                                 "OSEN PKMID List");
12292
12293     while (pmkid_count > 0) {
12294       proto_tree *pmkid_tree = NULL;
12295
12296       pmkid_tree = proto_tree_add_subtree_format(pmkid_list, tvb,offset, 16,
12297                                 ett_osen_pmkid_tree, NULL,
12298                                 "OSEN PKMID %d", pmkid_index);
12299       proto_tree_add_item(pmkid_tree, hf_osen_pmkid, tvb, offset, 16,
12300                           ENC_NA);
12301       offset += 16;
12302       pmkid_index++;
12303       pmkid_count--;
12304     }
12305   }
12306
12307   offset = dissect_group_data_cipher_suite(tvb, pinfo, tree, offset, gmcs_array,
12308                         ett_osen_group_management_cipher_suite,
12309                         "OSEN Group Management Cipher Suite");
12310
12311   return offset;
12312 }
12313
12314 static const value_string hs20_indication_release_number_vals[] = {
12315   { 0, "Release 1" },
12316   { 1, "Release 2" },
12317   { 0, NULL }
12318 };
12319
12320 static int
12321 dissect_hs20_indication(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
12322 {
12323   static const int *ieee80211_hs20_indication[] = {
12324     &hf_hs20_indication_dgaf_disabled,
12325     &hf_hs20_indication_pps_mo_id_present,
12326     &hf_hs20_indication_anqp_domain_id_present,
12327     &hf_hs20_reserved,
12328     &hf_hs20_indication_release_number,
12329     NULL
12330   };
12331   int len = tvb_captured_length(tvb);
12332   int offset = 0;
12333   guint8 indic = tvb_get_guint8(tvb, offset);
12334
12335   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_hs20_indication,
12336                               ENC_NA);
12337   offset++;
12338
12339   if (len >= 3 && (indic & 0x02)) { /* Contains a PPS MO ID field ... display it. */
12340       proto_tree_add_item(tree, hf_hs20_indication_pps_mo_id, tvb, offset,
12341                           2, ENC_LITTLE_ENDIAN);
12342       offset += 2;
12343   }
12344
12345   if ((len >= (offset + 2)) && (indic & 0x04)) {
12346      proto_tree_add_item(tree, hf_hs20_indication_anqp_domain_id, tvb, offset,
12347                          2, ENC_LITTLE_ENDIAN);
12348      offset += 2;
12349   }
12350
12351   return offset;
12352 }
12353
12354 static void
12355 dissect_vendor_ie_wfa(packet_info *pinfo, proto_item *item, tvbuff_t *tag_tvb)
12356 {
12357   gint tag_len = tvb_reported_length(tag_tvb);
12358   guint8 subtype;
12359   int offset = 0;
12360   tvbuff_t *vendor_tvb;
12361
12362   if (tag_len < 4)
12363     return;
12364
12365   subtype = tvb_get_guint8(tag_tvb, 3);
12366   proto_item_append_text(item, ": %s", val_to_str_const(subtype, wfa_subtype_vals, "Unknown"));
12367   vendor_tvb = tvb_new_subset_length(tag_tvb, offset + 4, tag_len - 4);
12368   dissector_try_uint_new(wifi_alliance_ie_table, subtype, vendor_tvb, pinfo, item, FALSE, NULL);
12369 }
12370
12371 static void
12372 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
12373 {
12374
12375   switch(tvb_get_guint8(tvb, offset)){
12376     case 4:
12377     {
12378       /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
12379        * This is only used within EAPOL-Key frame Key Data. */
12380       offset += 1;
12381       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_pmkid, tvb, offset, 16, ENC_NA);
12382     }
12383     break;
12384     default:
12385       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_unknown, tvb, offset, tag_len, ENC_NA);
12386     break;
12387   }
12388
12389   proto_item_append_text(item, ": RSN");
12390
12391 }
12392
12393 typedef enum {
12394   MARVELL_IE_MESH = 4
12395 } marvell_ie_type_t;
12396
12397 static void
12398 dissect_vendor_ie_marvell(proto_item *item _U_, proto_tree *ietree,
12399                           tvbuff_t *tvb, int offset, guint32 tag_len)
12400 {
12401   guint8 type;
12402
12403   type = tvb_get_guint8(tvb, offset);
12404   proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12405   offset += 1;
12406
12407   switch (type) {
12408   case MARVELL_IE_MESH:
12409     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_subtype, tvb,
12410                          offset++, 1, ENC_LITTLE_ENDIAN);
12411     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_version, tvb,
12412                          offset++, 1, ENC_LITTLE_ENDIAN);
12413     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_active_proto_id, tvb,
12414                          offset++, 1, ENC_LITTLE_ENDIAN);
12415     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_active_metric_id, tvb,
12416                          offset++, 1, ENC_LITTLE_ENDIAN);
12417     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_cap, tvb,
12418                          offset++, 1, ENC_LITTLE_ENDIAN);
12419     break;
12420
12421   default:
12422     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_data, tvb, offset,
12423       tag_len - 1, ENC_NA);
12424     break;
12425   }
12426 }
12427
12428 typedef enum {
12429   ATHEROS_IE_ADVCAP = 1,
12430   ATHEROS_IE_XR = 3
12431 } atheros_ie_type_t;
12432
12433 typedef enum {
12434   ATHEROS_IE_ADVCAP_S = 1
12435 } atheros_ie_advcap_subtype_t;
12436
12437 typedef enum {
12438   ATHEROS_IE_XR_S = 1
12439 } atheros_ie_xr_subtype_t;
12440
12441 typedef enum {
12442   ATHEROS_IE_CAP_TURBOP = 0x01,
12443   ATHEROS_IE_CAP_COMP   = 0x02,
12444   ATHEROS_IE_CAP_FF     = 0x04,
12445   ATHEROS_IE_CAP_XR     = 0x08,
12446   ATHEROS_IE_CAP_AR     = 0x10,
12447   ATHEROS_IE_CAP_BURST  = 0x20,
12448   ATHEROS_IE_CAP_WME    = 0x40,
12449   ATHEROS_IE_CAP_BOOST  = 0x80
12450 } atheros_ie_cap_t;
12451
12452 static const value_string atheros_ie_type_vals[] = {
12453   { ATHEROS_IE_ADVCAP, "Advanced Capability"},
12454   { ATHEROS_IE_XR,     "eXtended Range"},
12455   { 0,                 NULL }
12456 };
12457
12458 static const int *ieee80211_atheros_ie_cap[] = {
12459   &hf_ieee80211_atheros_ie_cap_f_turbop,
12460   &hf_ieee80211_atheros_ie_cap_f_comp,
12461   &hf_ieee80211_atheros_ie_cap_f_ff,
12462   &hf_ieee80211_atheros_ie_cap_f_xr,
12463   &hf_ieee80211_atheros_ie_cap_f_ar,
12464   &hf_ieee80211_atheros_ie_cap_f_burst,
12465   &hf_ieee80211_atheros_ie_cap_f_wme,
12466   &hf_ieee80211_atheros_ie_cap_f_boost,
12467   NULL
12468 };
12469
12470 static void
12471 dissect_vendor_ie_atheros(proto_item *item _U_, proto_tree *ietree,
12472                           tvbuff_t *tvb, int offset, guint tag_len,
12473                           packet_info *pinfo, proto_item *ti_len)
12474 {
12475   guint8      type;
12476   guint8      subtype;
12477   guint8      version;
12478
12479   if (tag_len <= 3) {
12480         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 */
12481         return;
12482   }
12483   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_type, tvb, offset, 1, ENC_NA);
12484   type = tvb_get_guint8(tvb, offset);
12485   proto_item_append_text(item, ": %s", val_to_str_const(type, atheros_ie_type_vals, "Unknown"));
12486   offset  += 1;
12487   tag_len -= 1;
12488
12489   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_subtype, tvb, offset, 1, ENC_NA);
12490   subtype  = tvb_get_guint8(tvb, offset);
12491   offset  += 1;
12492   tag_len -= 1;
12493
12494   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_version, tvb, offset, 1, ENC_NA);
12495   version  = tvb_get_guint8(tvb, offset);
12496   offset  += 1;
12497   tag_len -= 1;
12498
12499   if (version == 0)
12500   {
12501     switch (type) {
12502       case ATHEROS_IE_ADVCAP:
12503       {
12504         switch (subtype) {
12505           case ATHEROS_IE_ADVCAP_S:
12506           {
12507             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_advcap_cap,
12508                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
12509                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12510             offset   += 1;
12511             tag_len  -= 1;
12512
12513             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_defkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12514             offset  += 2;
12515             tag_len -= 2;
12516             break;
12517           }
12518           default:
12519           /* No default Action */
12520           break;
12521         } /* End switch (subtype) */
12522         break;
12523       }
12524       case ATHEROS_IE_XR:
12525       {
12526         switch (subtype) {
12527           case ATHEROS_IE_XR_S:
12528           {
12529             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_info, tvb, offset, 1, ENC_NA);
12530             offset  += 1;
12531             tag_len -= 1;
12532
12533             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_bssid, tvb, offset, 6, ENC_NA);
12534             offset  += 6;
12535             tag_len -= 6;
12536
12537             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_bssid, tvb, offset, 6, ENC_NA);
12538             offset  += 6;
12539             tag_len -= 6;
12540
12541             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12542             offset  += 2;
12543             tag_len -= 2;
12544
12545             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_xr_base_cap,
12546                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
12547                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12548             offset   += 1;
12549             tag_len  -= 1;
12550
12551             proto_tree_add_bitmask_with_flags(ietree, tvb, offset, hf_ieee80211_atheros_ie_xr_xr_cap,
12552                                     ett_ath_cap_tree, ieee80211_atheros_ie_cap,
12553                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12554             offset   += 1;
12555             tag_len  -= 1;
12556             break;
12557           }
12558           default:
12559           /* No default Action */
12560           break;
12561         } /* End switch (subtype) */
12562         break;
12563         default:
12564         /* No default Action */
12565         break;
12566       } /* End switch (type) */
12567
12568     }
12569   }
12570   if (tag_len > 0) {
12571     proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_data, tvb, offset, tag_len, ENC_NA);
12572   }
12573 }
12574
12575 typedef enum {
12576   AIRONET_IE_DTPC = 0,
12577   AIRONET_IE_UNKNOWN1 = 1,
12578   AIRONET_IE_VERSION = 3,
12579   AIRONET_IE_QOS,
12580   AIRONET_IE_UNKNOWN11 = 11,
12581   AIRONET_IE_QBSS_V2 = 14,
12582   AIRONET_IE_CLIENT_MFP = 20
12583 } aironet_ie_type_t;
12584
12585 static const value_string aironet_ie_type_vals[] = {
12586   { AIRONET_IE_DTPC,      "DTPC"},
12587   { AIRONET_IE_UNKNOWN1,  "Unknown (1)"},
12588   { AIRONET_IE_VERSION,   "CCX version"},
12589   { AIRONET_IE_QOS,       "Qos"},
12590   { AIRONET_IE_UNKNOWN11, "Unknown (11)"},
12591   { AIRONET_IE_QBSS_V2,   "QBSS V2 - CCA"},
12592   { AIRONET_IE_CLIENT_MFP, "Client MFP"},
12593   { 0,                    NULL }
12594 };
12595
12596 static const value_string aironet_mfp_vals[] = {
12597   { 0,      "Disabled"},
12598   { 1,      "Enabled"},
12599   { 0,      NULL }
12600 };
12601
12602 static void
12603 dissect_vendor_ie_aironet(proto_item *aironet_item, proto_tree *ietree,
12604                           tvbuff_t *tvb, int offset, guint32 tag_len)
12605 {
12606   guint8  type;
12607   int i;
12608   gboolean dont_change = FALSE; /* Don't change the IE item text to default */
12609
12610   type = tvb_get_guint8(tvb, offset);
12611   proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12612   offset += 1;
12613
12614   switch (type) {
12615   case AIRONET_IE_DTPC:
12616     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_dtpc, tvb, offset, 1, ENC_NA);
12617     proto_item_append_text(aironet_item, ": Aironet DTPC Powerlevel %ddBm", tvb_get_guint8(tvb, offset));
12618     offset += 1;
12619     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_dtpc_unknown, tvb, offset, 1, ENC_NA);
12620     dont_change = TRUE;
12621     break;
12622   case AIRONET_IE_VERSION:
12623     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12624     proto_item_append_text(aironet_item, ": Aironet CCX version = %d", tvb_get_guint8(tvb, offset));
12625     dont_change = TRUE;
12626     break;
12627   case AIRONET_IE_QOS:
12628     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_qos_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12629     offset += 1;
12630     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_qos_paramset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12631     offset += 1;
12632
12633     /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
12634      *  need to be swapped. Also, the "TXOP" may be TXOP - or not.
12635      */
12636     for (i = 0; i < 4; i++) {
12637       guint8 byte1, byte2;
12638       guint16 txop;
12639       byte1 = tvb_get_guint8(tvb, offset);
12640       byte2 = tvb_get_guint8(tvb, offset + 1);
12641       txop = tvb_get_letohs(tvb, offset + 2);
12642       proto_tree_add_bytes_format(ietree, hf_ieee80211_aironet_ie_qos_val, tvb, offset, 4, NULL,
12643           "CCX QoS Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
12644         (byte1 & 0x60) >> 5, val_to_str((byte1 & 0x60) >> 5, wme_acs, "(Unknown: %d)"),
12645         (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
12646         byte2 & 0x0f, (byte2 & 0xf0) >> 4,
12647         txop);
12648       offset += 4;
12649     }
12650     break;
12651   case AIRONET_IE_QBSS_V2:
12652     /* Extract Values */
12653     proto_tree_add_item(ietree, hf_ieee80211_qbss2_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12654     proto_tree_add_item(ietree, hf_ieee80211_qbss2_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
12655     proto_tree_add_item(ietree, hf_ieee80211_qbss2_cal, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
12656     proto_tree_add_item(ietree, hf_ieee80211_qbss2_gl, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
12657     break;
12658   case AIRONET_IE_CLIENT_MFP:
12659     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_clientmfp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12660     proto_item_append_text(aironet_item, ": Aironet Client MFP %s",
12661       val_to_str_const(1 & tvb_get_guint8(tvb, offset), aironet_mfp_vals, "Unknown"));
12662     dont_change = TRUE;
12663     break;
12664   default:
12665     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_data, tvb, offset,
12666       tag_len - 1, ENC_NA);
12667     break;
12668   }
12669   if (!dont_change) {
12670     proto_item_append_text(aironet_item, ": Aironet %s (%d)",
12671       val_to_str_const(type, aironet_ie_type_vals, "Unknown"), type);
12672   }
12673 }
12674
12675 #define ARUBA_APNAME  3
12676 static const value_string ieee80211_vs_aruba_subtype_vals[] = {
12677   { ARUBA_APNAME, "AP Name"},
12678   { 0,                 NULL }
12679 };
12680 static void
12681 dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree,
12682                           tvbuff_t *tvb, int offset, guint32 tag_len)
12683 {
12684   guint8 type;
12685   const guint8* name;
12686
12687   offset += 1; /* VS OUI Type */
12688   tag_len -= 1;
12689
12690   type = tvb_get_guint8(tvb, offset);
12691   proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_subtype, tvb, offset, 1, ENC_NA);
12692   proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aruba_subtype_vals, "Unknown"));
12693   offset += 1;
12694   tag_len -= 1;
12695
12696   switch (type) {
12697   case ARUBA_APNAME:
12698     offset += 1;
12699     tag_len -= 1;
12700
12701     proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aruba_apname, tvb,
12702                          offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name);
12703     proto_item_append_text(item, " (%s)", name);
12704     break;
12705
12706   default:
12707     proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_data, tvb, offset,
12708       tag_len, ENC_NA);
12709     proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len));
12710     break;
12711   }
12712 }
12713
12714 static void
12715 dissect_vendor_ie_mikrotik(proto_item *item _U_, proto_tree *ietree,
12716                           tvbuff_t *tvb, int offset, guint32 tag_len)
12717 {
12718   guint8 type, length;
12719   proto_item *subitem;
12720   proto_tree *subtree;
12721
12722   offset += 1; /* VS OUI Type */
12723   tag_len -= 1;
12724   /* FIXME: Make sure we have at least 2 bytes left */
12725   proto_tree_add_item(ietree, hf_ieee80211_vs_mikrotik_unknown, tvb, offset, 2, ENC_NA);
12726
12727   offset += 2;
12728   tag_len -= 2;
12729
12730   while (tag_len >= 2) {
12731     type = tvb_get_guint8(tvb, offset);
12732     length = tvb_get_guint8(tvb, offset+1);
12733     subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_mikrotik_subitem, tvb, offset, length+2, ENC_NA);
12734     subtree = proto_item_add_subtree(subitem, ett_mikrotik);
12735     proto_item_set_text(subitem, "Sub IE (T/L: %d/%d)", type, length);
12736
12737     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_subtype, tvb, offset, 1, ENC_NA);
12738     offset += 1;
12739     tag_len -= 1;
12740
12741     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_sublength, tvb, offset, 1, ENC_NA);
12742     offset += 1;
12743     tag_len -= 1;
12744
12745     if (tag_len < length)
12746       /* FIXME: warn about this */
12747       length = tag_len;
12748     if (length == 0) {
12749       break;
12750     }
12751
12752     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_subdata, tvb, offset, length, ENC_NA);
12753     offset += length;
12754     tag_len -= length;
12755   }
12756 }
12757
12758 #define AEROHIVE_HOSTNAME 33
12759 static const value_string ieee80211_vs_aerohive_type_vals[] = {
12760   { AEROHIVE_HOSTNAME, "Host Name"},
12761   { 0,                 NULL }
12762 };
12763 static void
12764 dissect_vendor_ie_aerohive(proto_item *item _U_, proto_tree *ietree,
12765                           tvbuff_t *tvb, int offset, guint32 tag_len, packet_info *pinfo)
12766 {
12767   guint32 type, length;
12768   const guint8* hostname;
12769   proto_item *ti_len;
12770
12771   /* VS OUI Type */
12772   type = tvb_get_guint8(tvb, offset);
12773   offset += 1;
12774   tag_len -= 1;
12775
12776   switch(type){
12777     case AEROHIVE_HOSTNAME: /* Unknown (2 bytes) + Host Name Length (1 byte) + Host Name */
12778
12779       proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aerohive_type_vals, "Unknown"));
12780
12781       proto_tree_add_item(ietree, hf_ieee80211_vs_aerohive_unknown, tvb, offset, 2, ENC_NA);
12782       offset += 2;
12783       tag_len -= 2;
12784
12785       ti_len = proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_aerohive_hostname_length, tvb, offset, 1, ENC_NA, &length);
12786       offset += 1;
12787       tag_len -= 1;
12788
12789       if (tag_len < length) {
12790         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < Host Name Length");
12791         length = tag_len;
12792       }
12793
12794       proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aerohive_hostname, tvb, offset, length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &hostname);
12795       proto_item_append_text(item, " (%s)", hostname);
12796
12797     break;
12798
12799     default:
12800       proto_tree_add_item(ietree, hf_ieee80211_vs_aerohive_data, tvb, offset, tag_len, ENC_NA);
12801     break;
12802   }
12803 }
12804
12805 enum vs_nintendo_type {
12806   NINTENDO_SERVICES = 0x11,
12807   NINTENDO_CONSOLEID = 0xF0
12808 };
12809
12810 static const value_string ieee80211_vs_nintendo_type_vals[] = {
12811   { NINTENDO_SERVICES,  "Services"},
12812   { NINTENDO_CONSOLEID, "ConsoleID"},
12813   { 0, NULL }
12814 };
12815
12816 static proto_tree*
12817 dissect_vendor_ie_nintendo_tlv(const int hfindex, proto_tree *ietree,
12818                           tvbuff_t *tvb, int offset, guint32 sublen)
12819 {
12820   proto_item *nintendo_item;
12821   proto_tree *nintendo_tree;
12822
12823   nintendo_item = proto_tree_add_item(ietree, hfindex, tvb, offset, sublen, ENC_NA);
12824   nintendo_tree = proto_item_add_subtree(nintendo_item, ett_nintendo);
12825
12826   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_type, tvb, offset, 1, ENC_NA);
12827   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_length, tvb, offset + 1,  1, ENC_NA);
12828
12829   return nintendo_tree;
12830 }
12831
12832 static void
12833 dissect_vendor_ie_nintendo(proto_item *item _U_, proto_tree *ietree,
12834                           tvbuff_t *tvb, int offset, guint32 tag_len)
12835 {
12836   proto_tree *nintendo_tree;
12837
12838   guint8      subtype;
12839   guint8      sublength;
12840   guint32     length = tag_len;
12841
12842   /* Skip OUI type for now - the code is for type 1 (StreetPass) only */
12843   /* http://3dbrew.org/wiki/StreetPass */
12844   offset += 1;
12845   length -= 1;
12846
12847   while(length > 0 && length < 256) { /* otherwise we are < 0 but on unsigned */
12848     subtype = tvb_get_guint8(tvb, offset);
12849     sublength = tvb_get_guint8(tvb, offset + 1);
12850
12851     switch(subtype) {
12852     case NINTENDO_SERVICES:
12853       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_servicelist, ietree, tvb, offset, sublength + 2);
12854       offset += 2;
12855       length -= 2;
12856
12857       while (sublength > 4) {
12858
12859         proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_service, tvb, offset, 5, ENC_NA);
12860         offset += 5;
12861         length -= 5;
12862         sublength -= 5;
12863       }
12864       break;
12865     case NINTENDO_CONSOLEID:
12866       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_consoleid, ietree, tvb, offset, sublength + 2);
12867       offset += + 2;
12868       length -= + 2;
12869
12870       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_consoleid, tvb, offset, sublength, ENC_NA);
12871       offset += sublength;
12872       length -= sublength;
12873       break;
12874     default:
12875       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_unknown, ietree, tvb, offset, sublength + 2);
12876       offset += + 2;
12877       length -= + 2;
12878
12879       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_unknown, tvb, offset, sublength, ENC_NA);
12880       offset += sublength;
12881       length -= sublength;
12882       break;
12883     }
12884   }
12885 }
12886
12887 static void
12888 dissect_vendor_ie_meru(proto_item *item _U_, proto_tree *ietree,
12889                        tvbuff_t *tvb, int offset, guint32 tag_len,
12890                        packet_info *pinfo)
12891 {
12892   guint32 type, length;
12893   proto_item *subitem, *ti_len;
12894   proto_tree *subtree;
12895
12896   while (tag_len >= 2) {
12897     subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_meru_subitem, tvb, offset, 2, ENC_NA);
12898     subtree = proto_item_add_subtree(subitem, ett_meru);
12899
12900     proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_subtype, tvb, offset, 1, ENC_NA, &type);
12901     offset += 1;
12902     tag_len -= 1;
12903
12904     ti_len = proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_sublength, tvb, offset, 1, ENC_NA, &length);
12905     offset += 1;
12906     tag_len -= 1;
12907
12908     if (tag_len < length) {
12909       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < Sub Length");
12910       length = tag_len;
12911     }
12912
12913     proto_item_append_text(subitem, " (t=%d, l=%d)", type, length);
12914     proto_item_set_len(subitem, 2+length);
12915
12916     proto_tree_add_item(subtree, hf_ieee80211_vs_meru_subdata, tvb, offset, length, ENC_NA);
12917     offset += length;
12918     tag_len -= length;
12919
12920   }
12921 }
12922
12923 static const value_string ieee80211_vs_extreme_subtype_vals[] = {
12924   { 1, "AP Name"},
12925   { 0, NULL }
12926 };
12927
12928 static void
12929 dissect_vendor_ie_extreme(proto_item *item _U_, proto_tree *ietree,
12930                           tvbuff_t *tvb, int offset, guint32 tag_len,
12931                           packet_info *pinfo)
12932 {
12933   guint32 type, length;
12934   proto_item *ti_len;
12935
12936   proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_extreme_subtype, tvb, offset, 1, ENC_NA, &type);
12937   offset += 1;
12938   tag_len -= 1;
12939
12940   proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_subdata, tvb, offset, tag_len, ENC_NA);
12941
12942   switch(type){
12943     case 1: /* Unknown (7 bytes) + AP Name Length (1 byte) + AP Name */
12944
12945       proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_unknown, tvb, offset, 7, ENC_NA);
12946       offset += 7;
12947       tag_len -= 1;
12948
12949       ti_len = proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_extreme_ap_length, tvb, offset, 1, ENC_NA, &length);
12950       offset += 1;
12951       tag_len -= 1;
12952
12953       if (tag_len < length) {
12954         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < AP Length");
12955         length = tag_len;
12956       }
12957
12958     proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA);
12959
12960     break;
12961     default:
12962     /* Expert info ? */
12963     break;
12964   }
12965 }
12966
12967 /* 802.11-2012 8.4.2.37 QoS Capability element */
12968 static int
12969 dissect_qos_capability(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
12970 {
12971   switch (ftype) {
12972     case MGT_ASSOC_REQ:
12973     case MGT_PROBE_REQ:
12974     case MGT_REASSOC_REQ:
12975     {
12976       /* To AP so decode Qos Info as STA */
12977       offset += add_ff_qos_info_sta(tree, tvb, pinfo, offset);
12978       break;
12979     }
12980
12981     case MGT_BEACON:
12982     case MGT_PROBE_RESP:
12983     case MGT_ASSOC_RESP:
12984     case MGT_REASSOC_RESP:
12985     {
12986       /* From AP so decode QoS Info as AP */
12987       offset += add_ff_qos_info_ap(tree, tvb, pinfo, offset);
12988       break;
12989     }
12990
12991     default:
12992       expert_add_info_format(pinfo, proto_tree_get_parent(tree), &ei_ieee80211_qos_info_bad_ftype,
12993                              "Could not deduce direction to decode correctly, ftype %u", ftype);
12994       break;
12995   }
12996
12997   return offset;
12998 }
12999
13000 /*
13001  * 7.3.2.25 RSNE information element. Common format with OSEN except the
13002  * verison... should refactor
13003  */
13004 static int
13005 dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
13006                int offset, guint32 tag_len, association_sanity_check_t *association_sanity_check)
13007 {
13008   proto_item *rsn_gcs_item, *rsn_pcs_item, *rsn_akms_item, *rsn_pmkid_item, *rsn_gmcs_item;
13009   proto_item *rsn_sub_pcs_item, *rsn_sub_akms_item;
13010   proto_item *rsn_pcs_count, *rsn_akms_count, *rsn_pmkid_count;
13011   proto_tree *rsn_gcs_tree, *rsn_pcs_tree, *rsn_akms_tree, *rsn_pmkid_tree, *rsn_gmcs_tree;
13012   proto_tree *rsn_sub_pcs_tree, *rsn_sub_akms_tree;
13013   guint16     pcs_count, akms_count, pmkid_count;
13014   guint       ii;
13015   int         tag_end = offset + tag_len;
13016   static const int *ieee80211_rsn_cap[] = {
13017     &hf_ieee80211_rsn_cap_preauth,
13018     &hf_ieee80211_rsn_cap_no_pairwise,
13019     &hf_ieee80211_rsn_cap_ptksa_replay_counter,
13020     &hf_ieee80211_rsn_cap_gtksa_replay_counter,
13021     &hf_ieee80211_rsn_cap_mfpr,
13022     &hf_ieee80211_rsn_cap_mfpc,
13023     &hf_ieee80211_rsn_cap_jmr,
13024     &hf_ieee80211_rsn_cap_peerkey,
13025     NULL
13026   };
13027
13028   proto_tree_add_item(tree, hf_ieee80211_rsn_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13029   offset += 2;
13030
13031   /* 7.3.2.25.1 Group Cipher suites */
13032   rsn_gcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gcs, tvb, offset, 4, ENC_BIG_ENDIAN);
13033   rsn_gcs_tree = proto_item_add_subtree(rsn_gcs_item, ett_rsn_gcs_tree);
13034   proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
13035
13036     /* Check if OUI is 00:0F:AC (ieee80211) */
13037   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
13038   {
13039     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
13040   } else {
13041     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
13042   }
13043   offset += 4;
13044
13045   /* 7.3.2.25.2 Pairwise Cipher suites */
13046   rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13047   pcs_count = tvb_get_letohs(tvb, offset);
13048   offset += 2;
13049
13050   if (offset + (pcs_count * 4) > tag_end)
13051   {
13052     expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
13053         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
13054     pcs_count = (tag_end - offset) / 4;
13055   }
13056
13057   rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
13058   rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
13059   for (ii = 0; ii < pcs_count; ii++)
13060   {
13061     rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
13062     rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
13063     proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
13064
13065     /* Check if OUI is 00:0F:AC (ieee80211) */
13066     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
13067     {
13068       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
13069       proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
13070     } else {
13071       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
13072     }
13073     offset += 4;
13074   }
13075
13076   if (offset >= tag_end)
13077   {
13078     return offset;
13079   }
13080
13081   /* 7.3.2.25.2 AKM suites */
13082   rsn_akms_count = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13083   akms_count = tvb_get_letohs(tvb, offset);
13084   offset += 2;
13085
13086   if (offset + (akms_count * 4) > tag_end)
13087   {
13088     expert_add_info_format(pinfo, rsn_akms_count, &ei_ieee80211_rsn_pmkid_count,
13089         "Auth Key Management (AKM) Suite Count too large, 4*%u > %d", akms_count, tag_end - offset);
13090     akms_count = (tag_end - offset) / 4;
13091   }
13092
13093   rsn_akms_item = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_list, tvb, offset, akms_count * 4, ENC_NA);
13094   rsn_akms_tree = proto_item_add_subtree(rsn_akms_item, ett_rsn_akms_tree);
13095   for (ii = 0; ii < akms_count; ii++)
13096   {
13097     rsn_sub_akms_item = proto_tree_add_item(rsn_akms_tree, hf_ieee80211_rsn_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
13098     rsn_sub_akms_tree = proto_item_add_subtree(rsn_sub_akms_item, ett_rsn_sub_akms_tree);
13099     proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
13100
13101     /* Check if OUI is 00:0F:AC (ieee80211) */
13102     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
13103     {
13104       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
13105       proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(tvb_get_ntohl(tvb, offset)));
13106
13107       if (association_sanity_check) {
13108         guint32 akm_suite = tvb_get_ntohl(tvb, offset);
13109         if (akm_suite == 0x000FAC03 || akm_suite == 0x000FAC04 || akm_suite == 0x000FAC09) {
13110           /* This is an FT AKM suite */
13111           association_sanity_check->has_ft_akm_suite = TRUE;
13112           if (association_sanity_check->rsn_first_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
13113             association_sanity_check->rsn_first_ft_akm_suite = rsn_sub_akms_tree->last_child;
13114           }
13115         } else {
13116           /* This is a non-FT AKM suite */
13117           association_sanity_check->has_non_ft_akm_suite = TRUE;
13118           if (association_sanity_check->rsn_first_non_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
13119             association_sanity_check->rsn_first_non_ft_akm_suite = rsn_sub_akms_tree->last_child;
13120           }
13121         }
13122       }
13123     } else {
13124       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
13125     }
13126     offset += 4;
13127   }
13128
13129   /* 7.3.2.25.3 RSN capabilities */
13130   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_rsn_cap,
13131                                     ett_rsn_cap_tree, ieee80211_rsn_cap,
13132                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13133   offset += 2;
13134   if (offset >= tag_end)
13135   {
13136     return offset;
13137   }
13138   /* 7.3.2.25.4 PMKID */
13139   rsn_pmkid_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13140   pmkid_count = tvb_get_letohs(tvb, offset);
13141   offset += 2;
13142
13143   if (offset + (pmkid_count * 16) > tag_end)
13144   {
13145     expert_add_info_format(pinfo, rsn_pmkid_count, &ei_ieee80211_pmkid_count_too_large,
13146         "PMKID Count too large, 16*%u > %d", pmkid_count, tag_end - offset);
13147     pmkid_count = (tag_end - offset) / 16;
13148   }
13149
13150   rsn_pmkid_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_list, tvb, offset, pmkid_count * 16, ENC_NA);
13151   rsn_pmkid_tree = proto_item_add_subtree(rsn_pmkid_item, ett_rsn_pmkid_tree);
13152   for (ii = 0; ii < pmkid_count; ii++)
13153   {
13154     proto_tree_add_item(rsn_pmkid_tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
13155     offset += 16;
13156   }
13157
13158   if (offset >= tag_end)
13159   {
13160     return offset;
13161   }
13162   /* Group Management Cipher Suite (802.11w)*/
13163   rsn_gmcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gmcs, tvb, offset, 4, ENC_BIG_ENDIAN);
13164   rsn_gmcs_tree = proto_item_add_subtree(rsn_gmcs_item, ett_rsn_gmcs_tree);
13165   proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
13166   /* Check if OUI is 00:0F:AC (ieee80211) */
13167   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
13168   {
13169     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
13170   } else {
13171     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
13172   }
13173   offset += 4;
13174
13175   return offset;
13176 }
13177
13178 /* 7.3.2.27 Extended Capabilities information element (127) */
13179 static int
13180 dissect_extended_capabilities_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13181 {
13182   int tag_len = tvb_reported_length(tvb);
13183   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13184   int offset = 0;
13185   proto_item *ti_ex_cap;
13186   static const int *ieee80211_tag_extended_capabilities_byte1[] = {
13187     &hf_ieee80211_tag_extended_capabilities_b0,
13188     &hf_ieee80211_tag_extended_capabilities_b1,
13189     &hf_ieee80211_tag_extended_capabilities_b2,
13190     &hf_ieee80211_tag_extended_capabilities_b3,
13191     &hf_ieee80211_tag_extended_capabilities_b4,
13192     &hf_ieee80211_tag_extended_capabilities_b5,
13193     &hf_ieee80211_tag_extended_capabilities_b6,
13194     &hf_ieee80211_tag_extended_capabilities_b7,
13195     NULL
13196   };
13197   static const int *ieee80211_tag_extended_capabilities_byte2[] = {
13198     &hf_ieee80211_tag_extended_capabilities_b8,
13199     &hf_ieee80211_tag_extended_capabilities_b9,
13200     &hf_ieee80211_tag_extended_capabilities_b10,
13201     &hf_ieee80211_tag_extended_capabilities_b11,
13202     &hf_ieee80211_tag_extended_capabilities_b12,
13203     &hf_ieee80211_tag_extended_capabilities_b13,
13204     &hf_ieee80211_tag_extended_capabilities_b14,
13205     &hf_ieee80211_tag_extended_capabilities_b15,
13206     NULL
13207   };
13208   static const int *ieee80211_tag_extended_capabilities_byte3[] = {
13209     &hf_ieee80211_tag_extended_capabilities_b16,
13210     &hf_ieee80211_tag_extended_capabilities_b17,
13211     &hf_ieee80211_tag_extended_capabilities_b18,
13212     &hf_ieee80211_tag_extended_capabilities_b19,
13213     &hf_ieee80211_tag_extended_capabilities_b20,
13214     &hf_ieee80211_tag_extended_capabilities_b21,
13215     &hf_ieee80211_tag_extended_capabilities_b22,
13216     &hf_ieee80211_tag_extended_capabilities_b23,
13217     NULL
13218   };
13219   static const int *ieee80211_tag_extended_capabilities_byte4[] = {
13220     &hf_ieee80211_tag_extended_capabilities_b24,
13221     &hf_ieee80211_tag_extended_capabilities_b25,
13222     &hf_ieee80211_tag_extended_capabilities_b26,
13223     &hf_ieee80211_tag_extended_capabilities_b27,
13224     &hf_ieee80211_tag_extended_capabilities_b28,
13225     &hf_ieee80211_tag_extended_capabilities_b29,
13226     &hf_ieee80211_tag_extended_capabilities_b30,
13227     &hf_ieee80211_tag_extended_capabilities_b31,
13228     NULL
13229   };
13230   static const int *ieee80211_tag_extended_capabilities_byte5[] = {
13231     &hf_ieee80211_tag_extended_capabilities_b32,
13232     &hf_ieee80211_tag_extended_capabilities_b33,
13233     &hf_ieee80211_tag_extended_capabilities_b34,
13234     &hf_ieee80211_tag_extended_capabilities_b35,
13235     &hf_ieee80211_tag_extended_capabilities_b36,
13236     &hf_ieee80211_tag_extended_capabilities_b37,
13237     &hf_ieee80211_tag_extended_capabilities_b38,
13238     &hf_ieee80211_tag_extended_capabilities_b39,
13239     NULL
13240   };
13241   static const int *ieee80211_tag_extended_capabilities_byte6[] = {
13242     &hf_ieee80211_tag_extended_capabilities_b40,
13243     &hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
13244     &hf_ieee80211_tag_extended_capabilities_b44,
13245     &hf_ieee80211_tag_extended_capabilities_b45,
13246     &hf_ieee80211_tag_extended_capabilities_b46,
13247     &hf_ieee80211_tag_extended_capabilities_b47,
13248     NULL
13249   };
13250   static const int *ieee80211_tag_extended_capabilities_byte7[] = {
13251     &hf_ieee80211_tag_extended_capabilities_b48,
13252     &hf_ieee80211_tag_extended_capabilities_b49,
13253     &hf_ieee80211_tag_extended_capabilities_b50,
13254     &hf_ieee80211_tag_extended_capabilities_b51,
13255     &hf_ieee80211_tag_extended_capabilities_b52,
13256     &hf_ieee80211_tag_extended_capabilities_b53,
13257     &hf_ieee80211_tag_extended_capabilities_b54,
13258     &hf_ieee80211_tag_extended_capabilities_b55,
13259     NULL
13260   };
13261
13262   static const int *ieee80211_tag_extended_capabilities_byte8[] = {
13263     &hf_ieee80211_tag_extended_capabilities_b56,
13264     &hf_ieee80211_tag_extended_capabilities_b57,
13265     &hf_ieee80211_tag_extended_capabilities_b58,
13266     &hf_ieee80211_tag_extended_capabilities_b59,
13267     &hf_ieee80211_tag_extended_capabilities_b60,
13268     &hf_ieee80211_tag_extended_capabilities_b61,
13269     &hf_ieee80211_tag_extended_capabilities_b62,
13270     &hf_ieee80211_tag_extended_capabilities_b63,
13271     NULL
13272   };
13273
13274   static const int *ieee80211_tag_extended_capabilities_bytes89[] = {
13275     &hf_ieee80211_tag_extended_capabilities_b56_2,
13276     &hf_ieee80211_tag_extended_capabilities_b57_2,
13277     &hf_ieee80211_tag_extended_capabilities_b58_2,
13278     &hf_ieee80211_tag_extended_capabilities_b59_2,
13279     &hf_ieee80211_tag_extended_capabilities_b60_2,
13280     &hf_ieee80211_tag_extended_capabilities_b61_2,
13281     &hf_ieee80211_tag_extended_capabilities_b62_2,
13282     &hf_ieee80211_tag_extended_capabilities_max_num_msdus,
13283     &hf_ieee80211_tag_extended_capabilities_b65_2,
13284     &hf_ieee80211_tag_extended_capabilities_b66_2,
13285     &hf_ieee80211_tag_extended_capabilities_b67_2,
13286     &hf_ieee80211_tag_extended_capabilities_b68_2,
13287     &hf_ieee80211_tag_extended_capabilities_b69_2,
13288     &hf_ieee80211_tag_extended_capabilities_b70_2,
13289     &hf_ieee80211_tag_extended_capabilities_b71_2,
13290     NULL
13291   };
13292
13293   static const int *ieee80211_tag_extended_capabilities_byte10[] = {
13294     &hf_ieee80211_tag_extended_capabilities_b72,
13295     &hf_ieee80211_tag_extended_capabilities_b73,
13296     &hf_ieee80211_tag_extended_capabilities_b74,
13297     &hf_ieee80211_tag_extended_capabilities_b75,
13298     &hf_ieee80211_tag_extended_capabilities_b76,
13299     &hf_ieee80211_tag_extended_capabilities_b77,
13300     &hf_ieee80211_tag_extended_capabilities_b78,
13301     &hf_ieee80211_tag_extended_capabilities_b79,
13302     NULL
13303   };
13304
13305   if (tag_len < 1)
13306   {
13307     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);
13308     return 1;
13309   }
13310   proto_item_append_text(field_data->item_tag, " (%u octet%s)", tag_len, plurality(tag_len, "", "s"));
13311
13312   /* Extended Capability octet 1 */
13313   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13314                                     ett_tag_ex_cap1, ieee80211_tag_extended_capabilities_byte1,
13315                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13316   proto_item_append_text(ti_ex_cap, " (octet 1)");
13317   offset += 1;
13318
13319   /* Extended Capability octet 2 */
13320   if (offset >= tag_len) {
13321     return offset;
13322   }
13323   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13324                                     ett_tag_ex_cap2, ieee80211_tag_extended_capabilities_byte2,
13325                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13326   proto_item_append_text(ti_ex_cap, " (octet 2)");
13327   offset += 1;
13328
13329   /* Extended Capability octet 3 */
13330   if (offset >= tag_len) {
13331     return offset;
13332   }
13333   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13334                                     ett_tag_ex_cap3, ieee80211_tag_extended_capabilities_byte3,
13335                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13336   proto_item_append_text(ti_ex_cap, " (octet 3)");
13337   offset += 1;
13338
13339   /* Extended Capability octet 4 */
13340   if (offset >= tag_len) {
13341     return offset;
13342   }
13343   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13344                                     ett_tag_ex_cap4, ieee80211_tag_extended_capabilities_byte4,
13345                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13346   proto_item_append_text(ti_ex_cap, " (octet 4)");
13347   offset += 1;
13348
13349   /* Extended Capability octet 5 */
13350   if (offset >= tag_len) {
13351     return offset;
13352   }
13353   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13354                                     ett_tag_ex_cap5, ieee80211_tag_extended_capabilities_byte5,
13355                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13356   proto_item_append_text(ti_ex_cap, " (octet 5)");
13357   offset += 1;
13358
13359   /* Extended Capability octet 6 */
13360   if (offset >= tag_len) {
13361     return offset;
13362   }
13363
13364   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13365                                     ett_tag_ex_cap6, ieee80211_tag_extended_capabilities_byte6,
13366                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13367   proto_item_append_text(ti_ex_cap, " (octet 6)");
13368   offset += 1;
13369
13370
13371   /* Extended Capability octet 7 */
13372   if (offset >= tag_len) {
13373     return offset;
13374   }
13375   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13376                                     ett_tag_ex_cap7, ieee80211_tag_extended_capabilities_byte7,
13377                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13378   proto_item_append_text(ti_ex_cap, " (octet 7)");
13379   offset += 1;
13380
13381   /* Extended Capability octet 8 & 9 since two bits cross the boundary */
13382   if (offset >= tag_len) {
13383     return offset;
13384   }
13385
13386   /* If only the first of the two bytes is present, do the best we can */
13387   if (offset == tag_len - 1) {
13388     ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13389                                     ett_tag_ex_cap8, ieee80211_tag_extended_capabilities_byte8,
13390                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13391     proto_item_append_text(ti_ex_cap, " (octet 8)");
13392     offset += 1;
13393   } else { /* Both bytes are there */
13394     ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities_2,
13395                                     ett_tag_ex_cap89, ieee80211_tag_extended_capabilities_bytes89,
13396                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13397     proto_item_append_text(ti_ex_cap, " (octets 8 & 9)");
13398     offset += 2;
13399   }
13400
13401   if (offset >= tag_len) {
13402     return offset;
13403   }
13404
13405   /* Extended Capability octet 10 */
13406   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_extended_capabilities,
13407                                     ett_tag_ex_cap10, ieee80211_tag_extended_capabilities_byte10,
13408                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13409   proto_item_append_text(ti_ex_cap, " (octet 10)");
13410   offset += 1;
13411
13412   return offset;
13413 }
13414 static int
13415 dissect_vht_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset)
13416 {
13417   proto_item *ti;
13418   proto_tree *mcs_tree;
13419   static const int *ieee80211_vht_mcsset_rx_max_mcs[] = {
13420     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
13421     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
13422     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
13423     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
13424     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
13425     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
13426     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
13427     &hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
13428     NULL
13429   };
13430   static const int *ieee80211_vht_mcsset_tx_max_mcs[] = {
13431     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
13432     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
13433     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
13434     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
13435     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
13436     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
13437     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
13438     &hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
13439     NULL
13440   };
13441
13442   /* 8 byte Supported MCS set */
13443   ti = proto_tree_add_item(tree, hf_ieee80211_vht_mcsset, tvb, offset, 8, ENC_NA);
13444
13445   mcs_tree = proto_item_add_subtree(ti, ett_vht_mcsset_tree);
13446
13447   /* B0 - B15 */
13448   proto_tree_add_bitmask_with_flags(mcs_tree, tvb, offset, hf_ieee80211_vht_mcsset_rx_mcs_map,
13449                                     ett_vht_rx_mcsbit_tree, ieee80211_vht_mcsset_rx_max_mcs,
13450                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13451   offset += 2;
13452
13453   /* B16 - B28 13 bits*/
13454   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13455
13456   /* B29 - B31 Max NSTS Total*/
13457   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_max_nsts_total, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13458
13459   offset += 2;
13460
13461   /* B32 - B47 */
13462   proto_tree_add_bitmask_with_flags(mcs_tree, tvb, offset, hf_ieee80211_vht_mcsset_tx_mcs_map,
13463                                     ett_vht_tx_mcsbit_tree, ieee80211_vht_mcsset_tx_max_mcs,
13464                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13465   offset += 2;
13466   /* B48 - B60 13 bits */
13467   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13468
13469   /* B61 */
13470   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_ext_nss_bw_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13471
13472   /* B62 - B63 2 reserved bits*/
13473   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13474
13475   offset += 2;
13476   return offset;
13477 }
13478
13479 static int
13480 dissect_vht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13481 {
13482   int tag_len = tvb_reported_length(tvb);
13483   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13484   int offset = 0;
13485   static const int *ieee80211_vht_caps[] = {
13486     &hf_ieee80211_vht_max_mpdu_length,
13487     &hf_ieee80211_vht_supported_chan_width_set,
13488     &hf_ieee80211_vht_rx_ldpc,
13489     &hf_ieee80211_vht_short_gi_for_80,
13490     &hf_ieee80211_vht_short_gi_for_160,
13491     &hf_ieee80211_vht_tx_stbc,
13492     /* End of first byte */
13493     &hf_ieee80211_vht_rx_stbc,
13494     &hf_ieee80211_vht_su_beamformer_cap,
13495     &hf_ieee80211_vht_su_beamformee_cap,
13496     &hf_ieee80211_vht_beamformer_antennas,
13497     /* End of second byte */
13498     &hf_ieee80211_vht_sounding_dimensions,
13499     &hf_ieee80211_vht_mu_beamformer_cap,
13500     &hf_ieee80211_vht_mu_beamformee_cap,
13501     &hf_ieee80211_vht_txop_ps,
13502     &hf_ieee80211_vht_var_htc_field,
13503     &hf_ieee80211_vht_max_ampdu,
13504     &hf_ieee80211_vht_link_adaptation_cap,
13505     &hf_ieee80211_vht_rx_pattern,
13506     &hf_ieee80211_vht_tx_pattern,
13507     &hf_ieee80211_vht_ext_nss_bw_support,
13508     NULL
13509   };
13510
13511   if (tag_len != 12) {
13512     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13513                            "VHT Capabilities IE length %u wrong, must be = 12", tag_len);
13514     return 1;
13515   }
13516
13517   /* 4 byte VHT Capabilities  Info*/
13518   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_vht_cap,
13519                                     ett_vht_cap_tree, ieee80211_vht_caps,
13520                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13521   offset += 4;
13522
13523   /* 8 byte MCS set */
13524   offset = dissect_vht_mcs_set(tree, tvb, offset);
13525
13526   return offset;
13527 }
13528
13529 static int
13530 dissect_vht_operation_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13531 {
13532   int tag_len = tvb_reported_length(tvb);
13533   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13534   int offset = 0;
13535   proto_item *op_item;
13536   proto_tree *op_tree;
13537   static const int *ieee80211_vht_op_max_basic_mcs[] = {
13538     &hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
13539     &hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
13540     &hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
13541     &hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
13542     &hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
13543     &hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
13544     &hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
13545     &hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
13546     NULL
13547   };
13548
13549   if (tag_len != 5) {
13550     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13551                            "VHT Operation IE length %u wrong, must be = 5", tag_len);
13552     return 1;
13553   }
13554
13555   /* 3 byte VHT Operation Info*/
13556   op_item = proto_tree_add_item(tree, hf_ieee80211_vht_op, tvb, offset, 3, ENC_NA);
13557   op_tree = proto_item_add_subtree(op_item, ett_vht_op_tree);
13558   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13559   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center0, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
13560   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center1, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
13561
13562   offset += 3;
13563   /* VHT Basic MCS Set */
13564   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_vht_op_basic_mcs_map,
13565                                     ett_vht_basic_mcsbit_tree, ieee80211_vht_op_max_basic_mcs,
13566                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
13567   offset += 2;
13568
13569   return offset;
13570 }
13571
13572 static int
13573 dissect_vht_tx_pwr_envelope(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13574 {
13575   int tag_len = tvb_reported_length(tvb);
13576   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13577   int offset = 0;
13578   proto_item *tx_pwr_item, *ti;
13579   proto_tree *tx_pwr_info_tree;
13580   guint8 opt_ie_cnt=0;
13581   guint8 i;
13582
13583   if (tag_len < 2 || tag_len > 5) {
13584     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13585                            "VHT TX PWR Envelope IE length %u wrong, must be >= 2 and <= 5", tag_len);
13586     return 1;
13587   }
13588
13589   tx_pwr_item = proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_info, tvb, offset, 1, ENC_NA);
13590   tx_pwr_info_tree =  proto_item_add_subtree(tx_pwr_item, ett_vht_tpe_info_tree);
13591
13592   ti = proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13593   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_unit, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13594   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13595
13596   opt_ie_cnt = tvb_get_guint8(tvb, offset) & 0x07;
13597
13598   offset += 1;
13599
13600   /* Power Constraint info is mandatory only for 20MHz, others are optional*/
13601   /* Power is expressed in terms of 0.5dBm from -64 to 63 and is encoded
13602    * as 8-bit 2's compliment */
13603   for (i = 0; i <= opt_ie_cnt; i++) {
13604     switch(i) {
13605     case 0:
13606       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_20, tvb, offset, 1, ENC_NA);
13607       offset += 1;
13608       break;
13609     case 1:
13610       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_40, tvb, offset, 1, ENC_NA);
13611       offset += 1;
13612       break;
13613     case 2:
13614       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_80, tvb, offset, 1, ENC_NA);
13615       offset += 1;
13616       break;
13617     case 3:
13618       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_160, tvb, offset, 1, ENC_NA);
13619       offset += 1;
13620       break;
13621     default:
13622       expert_add_info(pinfo, ti, &ei_ieee80211_vht_tpe_pwr_info_count);
13623       offset += 1;
13624       break;
13625     }
13626   }
13627
13628   return offset;
13629 }
13630
13631 static int
13632 dissect_mobility_domain(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13633 {
13634   int tag_len = tvb_reported_length(tvb);
13635   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13636   int offset = 0;
13637
13638   if (field_data->sanity_check != NULL) {
13639     field_data->sanity_check->association_has_mobility_domain_element = TRUE;
13640   }
13641
13642   if (tag_len < 3) {
13643     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13644                           "MDIE content length must be at least 3 bytes");
13645     return 1;
13646   }
13647
13648   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_mdid,
13649                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13650   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab,
13651                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
13652   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
13653                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
13654   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
13655                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
13656   return tvb_captured_length(tvb);
13657 }
13658
13659 static int
13660 dissect_fast_bss_transition(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13661 {
13662   int tag_len = tvb_reported_length(tvb);
13663   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13664   int offset = 0;
13665   if (tag_len < 82) {
13666     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13667                           "FTIE content length must be at least 82 bytes");
13668     return 1;
13669   }
13670
13671   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic_control,
13672                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13673   proto_tree_add_item(tree, hf_ieee80211_tag_ft_element_count,
13674                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13675   offset += 2;
13676   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic,
13677                       tvb, offset, 16, ENC_NA);
13678   offset += 16;
13679   proto_tree_add_item(tree, hf_ieee80211_tag_ft_anonce,
13680                       tvb, offset, 32, ENC_NA);
13681   offset += 32;
13682   proto_tree_add_item(tree, hf_ieee80211_tag_ft_snonce,
13683                       tvb, offset, 32, ENC_NA);
13684   offset += 32;
13685
13686   while (offset + 2 <= tag_len) {
13687     guint8 id, len;
13688     int s_end;
13689     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_id,
13690                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13691     id = tvb_get_guint8(tvb, offset);
13692     offset += 1;
13693
13694     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_len,
13695                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13696     len = tvb_get_guint8(tvb, offset);
13697     offset += 1;
13698
13699     if (offset + len > tag_len) {
13700       proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset,
13701                             tag_len - offset, "Invalid FTIE subelement");
13702       return offset;
13703     }
13704
13705     s_end = offset + len;
13706     switch (id) {
13707     case 1:
13708       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r1kh_id,
13709                           tvb, offset, len, ENC_NA);
13710       break;
13711     case 2:
13712       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_info,
13713                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
13714       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_id,
13715                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
13716       offset += 2;
13717       if (offset > s_end)
13718         break;
13719       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_length,
13720                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13721       offset += 1;
13722       if (offset > s_end)
13723         break;
13724       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_rsc,
13725                           tvb, offset, 8, ENC_NA);
13726       offset += 8;
13727       if (offset > s_end)
13728         break;
13729       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key,
13730                           tvb, offset, s_end - offset, ENC_NA);
13731       break;
13732     case 3:
13733       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r0kh_id,
13734                           tvb, offset, len, ENC_NA);
13735       break;
13736     case 4:
13737       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_id,
13738                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
13739       offset += 2;
13740       if (offset > s_end)
13741         break;
13742       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_ipn,
13743                           tvb, offset, 6, ENC_NA);
13744       offset += 6;
13745       if (offset > s_end)
13746         break;
13747       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_length,
13748                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13749       offset += 1;
13750       if (offset > s_end)
13751         break;
13752       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key,
13753                           tvb, offset, 24, ENC_NA);
13754       break;
13755     default:
13756       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_data,
13757                           tvb, offset, len, ENC_NA);
13758       break;
13759     }
13760     offset = s_end;
13761   }
13762
13763   return tvb_captured_length(tvb);
13764 }
13765
13766 static int
13767 dissect_mmie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13768 {
13769   int tag_len = tvb_reported_length(tvb);
13770   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13771   int offset = 0;
13772
13773   if (tag_len < 16) {
13774     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13775                           "MMIE content length must be at least 16 bytes");
13776     return 1;
13777   }
13778
13779   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13780   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
13781                       ENC_NA);
13782   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
13783                       ENC_NA);
13784   return tvb_captured_length(tvb);
13785 }
13786
13787 static int
13788 dissect_ssid_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
13789 {
13790   int tag_len = tvb_reported_length(tvb);
13791   int offset = 0;
13792   proto_tree *entry;
13793   gboolean first = TRUE;
13794
13795   while (offset + 1 <= tag_len) {
13796     guint8 len = tvb_get_guint8(tvb, offset + 1);
13797     guint8 *str;
13798
13799     if (offset + 2 + len > tag_len)
13800       break;
13801
13802     str = tvb_format_text(tvb, offset + 2, len);
13803     proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
13804     first = FALSE;
13805     entry = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len, ett_ssid_list, NULL, "SSID: %s", str);
13806     proto_tree_add_item(entry, hf_ieee80211_tag_number, tvb, offset, 1,
13807                         ENC_LITTLE_ENDIAN);
13808     offset++;
13809     proto_tree_add_uint(entry, hf_ieee80211_tag_length, tvb, offset, 1, len);
13810     offset++;
13811     proto_tree_add_item(entry, hf_ieee80211_tag_ssid, tvb, offset, len,
13812                         ENC_ASCII|ENC_NA);
13813     offset += len;
13814   }
13815
13816   return tvb_captured_length(tvb);
13817 }
13818
13819 static int
13820 dissect_link_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13821 {
13822   int tag_len = tvb_reported_length(tvb);
13823   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13824   int offset = 0;
13825
13826   if (tag_len < 18) {
13827     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13828                           "Link Identifier content length must be at least "
13829                           "18 bytes");
13830     return tvb_captured_length(tvb);
13831   }
13832
13833   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_bssid, tvb,
13834                       offset, 6, ENC_NA);
13835   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_init_sta, tvb,
13836                       offset + 6, 6, ENC_NA);
13837   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_resp_sta, tvb,
13838                       offset + 12, 6, ENC_NA);
13839   return tvb_captured_length(tvb);
13840 }
13841
13842 static int
13843 dissect_wakeup_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13844 {
13845   int tag_len = tvb_reported_length(tvb);
13846   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13847   int offset = 0;
13848
13849   if (tag_len < 18) {
13850     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13851                           "Wakeup Schedule content length must be at least "
13852                           "18 bytes");
13853     return tvb_captured_length(tvb);
13854   }
13855
13856   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_offset, tvb,
13857                       offset, 4, ENC_LITTLE_ENDIAN);
13858   offset += 4;
13859
13860   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_interval, tvb,
13861                       offset, 4, ENC_LITTLE_ENDIAN);
13862   offset += 4;
13863
13864   proto_tree_add_item(tree,
13865                       hf_ieee80211_tag_wakeup_schedule_awake_window_slots, tvb,
13866                       offset, 4, ENC_LITTLE_ENDIAN);
13867   offset += 4;
13868
13869   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
13870                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
13871   offset += 4;
13872
13873   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_idle_count, tvb,
13874                       offset, 2, ENC_LITTLE_ENDIAN);
13875   return tvb_captured_length(tvb);
13876 }
13877
13878 static int
13879 dissect_channel_switch_timing(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13880 {
13881   int tag_len = tvb_reported_length(tvb);
13882   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13883   int offset = 0;
13884
13885   if (tag_len < 4) {
13886     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13887                           "Channel Switch Timing content length must be at "
13888                           "least 4 bytes");
13889     return tvb_captured_length(tvb);
13890   }
13891
13892   proto_tree_add_item(tree, hf_ieee80211_tag_channel_switch_timing_switch_time,
13893                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13894   offset += 2;
13895
13896   proto_tree_add_item(tree,
13897                       hf_ieee80211_tag_channel_switch_timing_switch_timeout,
13898                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13899   return tvb_captured_length(tvb);
13900 }
13901
13902 static int
13903 dissect_pti_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13904 {
13905   int tag_len = tvb_reported_length(tvb);
13906   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13907   int offset = 0;
13908
13909   if (tag_len < 3) {
13910     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "PTI Control content length must be at least 3 bytes");
13911     return tvb_captured_length(tvb);
13912   }
13913
13914   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_tid, tvb,
13915                       offset, 1, ENC_LITTLE_ENDIAN);
13916   offset += 1;
13917
13918   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_sequence_control, tvb,
13919                       offset, 2, ENC_LITTLE_ENDIAN);
13920   return tvb_captured_length(tvb);
13921 }
13922
13923 static int
13924 dissect_pu_buffer_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13925 {
13926   int tag_len = tvb_reported_length(tvb);
13927   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13928   int offset = 0;
13929   static const int *ieee80211_pu_buffer_status[] = {
13930     &hf_ieee80211_tag_pu_buffer_status_ac_bk,
13931     &hf_ieee80211_tag_pu_buffer_status_ac_be,
13932     &hf_ieee80211_tag_pu_buffer_status_ac_vi,
13933     &hf_ieee80211_tag_pu_buffer_status_ac_vo,
13934     NULL
13935   };
13936
13937   if (tag_len < 1) {
13938     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");
13939     return tvb_captured_length(tvb);
13940   }
13941
13942   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_pu_buffer_status, ENC_LITTLE_ENDIAN);
13943   return tvb_captured_length(tvb);
13944 }
13945
13946 static int
13947 dissect_timeout_interval(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
13948 {
13949   int tag_len = tvb_reported_length(tvb);
13950   int offset = 0;
13951   proto_item *pi;
13952
13953   pi = proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_type, tvb,
13954                            offset, 1, ENC_LITTLE_ENDIAN);
13955   if (tag_len < 5) {
13956     expert_add_info_format(pinfo, pi, &ei_ieee80211_tag_length,
13957                            "Timeout Interval content length must be at least "
13958                           "5 bytes");
13959     return 1;
13960   }
13961
13962   proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_value, tvb,
13963                       offset + 1, 4, ENC_LITTLE_ENDIAN);
13964   return tvb_captured_length(tvb);
13965 }
13966
13967 static int
13968 dissect_ric_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
13969 {
13970   int tag_len = tvb_reported_length(tvb);
13971   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
13972   int offset = 0;
13973   proto_tree  *sub_tree;
13974   guint8       desc_cnt = 0;
13975   guint32      next_ie;
13976   int          offset_r = 0;
13977   const guint8 ids[] = { TAG_RIC_DESCRIPTOR };
13978
13979   if (tag_len != 4)  {
13980     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
13981                            "RIC Data Length must be 4 bytes");
13982     return 0;
13983   }
13984
13985   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_id, tvb,
13986                            offset, 1, ENC_LITTLE_ENDIAN);
13987   offset += 1;
13988
13989   desc_cnt = tvb_get_guint8(tvb, offset);
13990   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_desc_cnt, tvb,
13991                            offset, 1, ENC_LITTLE_ENDIAN);
13992   offset += 1;
13993
13994   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_status_code, tvb,
13995                            offset, 2, ENC_LITTLE_ENDIAN);
13996   offset += 2;
13997
13998   /* Our Design is such that all the Resource request IE's part of the RIC
13999    * must be in the sub tree of RIC for better readability
14000    * Even omnipeek does the same way.
14001    */
14002   sub_tree = proto_item_add_subtree(tree, ett_tag_ric_data_desc_ie);
14003
14004   proto_item_append_text(field_data->item_tag, " :Resource Descriptor List");
14005   if (desc_cnt == 0) {
14006     proto_item_append_text(field_data->item_tag, " :0 (Weird?)");
14007   }
14008
14009   while ( desc_cnt != 0 ) {
14010
14011     next_ie = tvb_get_guint8(tvb, offset);
14012     proto_item_append_text(field_data->item_tag, " :(%d:%s)", desc_cnt, val_to_str_ext(next_ie, &tag_num_vals_ext, "Reserved (%d)"));
14013     /* Recursive call to avoid duplication of code*/
14014     offset_r = add_tagged_field(pinfo, sub_tree, tvb, offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
14015     if (offset_r == 0 )/* should never happen, returns a min of 2*/
14016       break;
14017     /* This will ensure that the IE after RIC is processed
14018      * only once. This gives us a good looking RIC IE :-)
14019      */
14020     tag_len += offset_r;
14021     desc_cnt--;
14022   }
14023
14024   return tvb_captured_length(tvb);
14025 }
14026
14027 /* Overlapping BSS Scan Parameters (74) */
14028 static int
14029 dissect_overlap_bss_scan_par(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14030 {
14031   int offset = 0;
14032   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14033   int tag_len = tvb_reported_length(tvb);
14034
14035   if (tag_len != 14)  {
14036     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14037                            "OBSS Length must be 14 bytes");
14038     return 1;
14039   }
14040
14041   proto_tree_add_item(tree, hf_ieee80211_tag_obss_spd, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14042   offset += 2;
14043
14044   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sad, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14045   offset += 2;
14046
14047   proto_tree_add_item(tree, hf_ieee80211_tag_obss_cwtsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14048   offset += 2;
14049
14050   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sptpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14051   offset += 2;
14052
14053   proto_tree_add_item(tree, hf_ieee80211_tag_obss_satpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14054   offset += 2;
14055
14056   proto_tree_add_item(tree, hf_ieee80211_tag_obss_wctdf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14057   offset += 2;
14058
14059   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sat, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14060   offset += 2;
14061
14062   return offset;
14063 }
14064
14065 /* RIC Descriptor (75) */
14066 static int
14067 dissect_ric_descriptor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14068 {
14069   int offset = 0;
14070   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14071   int tag_len = tvb_reported_length(tvb);
14072   guint8       rsrc_type = 0;
14073
14074   if (tag_len < 1)  {
14075     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14076                            "RIC Data Length must be at least 1 byte");
14077     return 1;
14078   }
14079
14080   rsrc_type = tvb_get_guint8(tvb, offset);
14081   proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_rsrc_type, tvb,
14082                            offset, 1, ENC_LITTLE_ENDIAN);
14083   offset += 1;
14084
14085   if (rsrc_type == 1) {
14086     /* Block ACK params
14087      * 802.11-2012: 8.4.2.53 RIC Descriptor element
14088      * Block Ack parameter set as defined in 8.4.1.14,
14089      * Block Ack timeout value as defined in 8.4.1.15, and
14090      * Block Ack starting sequence control as defined in 8.3.1.8
14091      */
14092     /* TODO: Still figuring out how to parse these ones,
14093      * need a sample capture with at least HEX Dump
14094      */
14095     proto_item_append_text(field_data->item_tag, " : Block ACK Params");
14096     proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_var_params, tvb,
14097                         offset, tag_len-1, ENC_NA);
14098     offset += tag_len -1;
14099   }else {
14100     /* 0, 2-255 are reserved*/
14101     proto_item_append_text(field_data->item_tag, " :Reserved (type != 1)");
14102   }
14103
14104   return offset;
14105 }
14106
14107 static int
14108 dissect_ext_bss_load(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14109 {
14110   int offset = 0;
14111   proto_tree_add_item(tree, hf_ieee80211_ext_bss_mu_mimo_capable_sta_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14112   offset += 2;
14113   proto_tree_add_item(tree, hf_ieee80211_ext_bss_ss_underutilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14114   offset += 1;
14115   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_20mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14116   offset += 1;
14117   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_40mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14118   offset += 1;
14119   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_80mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14120   offset += 1;
14121
14122   return offset;
14123 }
14124
14125 static int
14126 dissect_wide_bw_channel_switch(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14127 {
14128   int offset = 0;
14129
14130   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14131   offset += 1;
14132   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14133   offset += 1;
14134   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14135   offset += 1;
14136
14137   return offset;
14138 }
14139
14140 static int
14141 dissect_channel_switch_wrapper(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14142 {
14143   int tag_len = tvb_reported_length(tvb);
14144   int offset = 0;
14145   int tmp_sublen;
14146   const guint8 ids[] = { TAG_COUNTRY_INFO, TAG_WIDE_BW_CHANNEL_SWITCH,
14147     TAG_VHT_TX_PWR_ENVELOPE };
14148
14149   /*
14150   Decode three subelement in IE-196(Channel Switch Wrapper element):
14151         (1) New Country subelement
14152         (2) Wide Bandwidth Channel Switch subelement
14153         (3) New VHT Transmit Power Envelope subelement
14154   */
14155   while (tag_len > 0){
14156     tmp_sublen = tvb_get_guint8(tvb, offset + 1);
14157     if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
14158       break;
14159     }
14160     tag_len -= (tmp_sublen + 2);
14161     offset += (tmp_sublen + 2);
14162   }
14163   return offset;
14164 }
14165
14166 static int
14167 dissect_operating_mode_notification(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14168 {
14169   int offset = 0;
14170   static const int *ieee80211_operat_mode_field[] = {
14171     &hf_ieee80211_operat_mode_field_channel_width,
14172     &hf_ieee80211_operat_mode_field_reserved,
14173     &hf_ieee80211_operat_mode_field_rxnss,
14174     &hf_ieee80211_operat_mode_field_rxnsstype,
14175     NULL
14176   };
14177
14178   /* Operating Mode field */
14179   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_operat_notification_mode,
14180                                     ett_mcsbit_tree, ieee80211_operat_mode_field,
14181                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14182   offset += 1;
14183   return offset;
14184 }
14185
14186 static int
14187 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vendorspecific)
14188 {
14189   proto_item *ti;
14190   proto_tree *mcs_tree, *bit_tree;
14191   guint8 rx_nss, tx_nss; /* 0-4 for HT and 0-8 for VHT*/
14192   guint32 value_mcs_0_31, value_mcs_32_52, value_mcs_53_76;
14193   guint16 tx_mcs_set;
14194   rx_nss = tx_nss = 8;
14195   /* 16 byte Supported MCS set */
14196   if (vendorspecific)
14197   {
14198     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset_vs, tvb, offset, 16,
14199       basic ? "Basic MCS Set" : "MCS Set");
14200   } else
14201   {
14202     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset, tvb, offset, 16,
14203       basic ? "Basic MCS Set" : "MCS Set");
14204   }
14205   mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
14206
14207   /* Rx MCS Bitmask */
14208   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_rx_bitmask, tvb, offset, 10, ENC_NA);
14209   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
14210
14211   /* Bits 0 - 31 */
14212   value_mcs_0_31 = tvb_get_letohl(tvb, offset);
14213
14214   /* Handle all zeroes/ff's case..*/
14215   if (value_mcs_0_31 != 0x0)
14216   {
14217     if (!(value_mcs_0_31 & (0xffffff00))) {
14218       /*
14219        * At least one MCS from 0-7 is supported, but no MCS from 8-31 are
14220        * supported, so only 1 spatial stream is supported.
14221        */
14222       rx_nss = 0;
14223     } else if (!(value_mcs_0_31 & (0xffff0000))) {
14224       /*
14225        * At least one MCS from 8-15 is supported, but no MCS from 16-31 are
14226        * supported, so only 2 spatial streams are supported.
14227        */
14228       rx_nss = 1;
14229     } else if (!(value_mcs_0_31 & (0xff000000))) {
14230       /*
14231        * At least one MCS from 16-23 is supported, but no MCS from 24-31 are
14232        * supported, so only 3 spatial streams are supported.
14233        */
14234       rx_nss = 2;
14235     } else {
14236       /*
14237        * At least one MCS from 24-31 is supported, so 4 spatial streams
14238        * are supported.
14239        */
14240       rx_nss = 3;
14241     }
14242   }
14243
14244   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_0to7, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14245   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_8to15, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14246   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_16to23, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14247   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_24to31, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14248   offset += 4;
14249
14250   /* Should be we check UEQM Supported?*/
14251   /* Bits 32 - 52 */
14252   value_mcs_32_52 = tvb_get_letohl(tvb, offset);
14253   if (!(value_mcs_32_52 & (0x1ffffe))) {
14254     /*
14255      * MCS 33-52 aren't supported, so the number of spatial streams we get
14256      * from whichever MCSes from 0-31 that we support is the total number
14257      * of spatial streams we support.
14258      */
14259     ;
14260   } else if (!(value_mcs_32_52 & (0x1fff80))) {
14261     /*
14262      * At least one MCS from 33-38 is supported, but no MCS from 39-52 is
14263      * supported, so we have at least 2 spatial streams, but none of the
14264      * MCSs in that range give us any more.
14265      */
14266     rx_nss = MAX(1, rx_nss);
14267   } else {
14268     /*
14269      * At least one MCS from 39-52 is supported, so we have at least 3
14270      * spatial streams.
14271      */
14272     rx_nss = MAX(2, rx_nss);
14273   }
14274
14275   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_32, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14276   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_33to38, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14277   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_39to52, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14278   offset += 2;
14279
14280   /* Bits 53 - 76 */
14281   value_mcs_53_76 = tvb_get_letohl(tvb, offset);
14282   if ((value_mcs_53_76 & (0x1fffffe0))) {
14283     /*
14284      * At least one MCS from 53-76 is supported, so we have at least 4
14285      * spatial streams.
14286      */
14287     rx_nss = MAX(3, rx_nss);
14288   }
14289
14290   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_53to76, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14291   offset += 4;
14292
14293   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_highest_data_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14294   offset += 2;
14295
14296   /* Follow table 8-126 from 802.11-2012 */
14297   tx_mcs_set = tvb_get_letohs(tvb, offset);
14298
14299   if (!(tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
14300   {
14301     /* TX MCS Set is not defined
14302      * so there is no interpretation for Max Tx Spatial Streams
14303      */
14304      tx_nss = 4; /* Not Defined*/
14305   }
14306
14307   if ((tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
14308   {
14309     /* TX MCS Set is defined to be equal to Rx MCS Set
14310      * So, get the Max Spatial Streams from Rx
14311      * MCS set
14312      */
14313      tx_nss = rx_nss;
14314   }
14315   proto_item_append_text(ti, ": %s", val_to_str(rx_nss, mcsset_tx_max_spatial_streams_flags, "Reserved:%d" ) );
14316
14317   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_mcs_set_defined, tvb, offset, 1,
14318       ENC_LITTLE_ENDIAN);
14319   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal, tvb, offset, 1,
14320       ENC_LITTLE_ENDIAN);
14321   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_max_spatial_streams, tvb, offset, 1,
14322       ENC_LITTLE_ENDIAN);
14323   proto_item_append_text(ti, ", %s", val_to_str(tx_nss, mcsset_tx_max_spatial_streams_flags, "Reserved:%d" ) );
14324   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_unequal_modulation, tvb, offset, 1,
14325       ENC_LITTLE_ENDIAN);
14326   offset += 1;
14327
14328   offset += 3;
14329   return offset;
14330 }
14331
14332 /*  802.11n D1.10 - HT Information IE  */
14333 static int
14334 dissect_ht_info_ie_1_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14335 {
14336   int tag_len = tvb_reported_length(tvb);
14337   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14338   int offset = 0;
14339   static const int *ieee80211_ht_info1_field[] = {
14340     &hf_ieee80211_ht_info_secondary_channel_offset,
14341     &hf_ieee80211_ht_info_sta_channel_width,
14342     &hf_ieee80211_ht_info_rifs_mode,
14343     &hf_ieee80211_ht_info_reserved_b4_b7,
14344     NULL
14345   };
14346
14347   static const int *ieee80211_ht_info2_field[] = {
14348     &hf_ieee80211_ht_info_protection,
14349     &hf_ieee80211_ht_info_non_greenfield_sta_present,
14350     &hf_ieee80211_ht_info_reserved_b11,
14351     &hf_ieee80211_ht_info_obss_non_ht_stas_present,
14352     &hf_ieee80211_ht_info_channel_center_freq_seg_2,
14353     &hf_ieee80211_ht_info_reserved_b21_b23,
14354     NULL
14355   };
14356
14357   static const int *ieee80211_ht_info3_field[] = {
14358     &hf_ieee80211_ht_info_reserved_b24_b29,
14359     &hf_ieee80211_ht_info_dual_beacon,
14360     &hf_ieee80211_ht_info_dual_cts_protection,
14361     &hf_ieee80211_ht_info_secondary_beacon,
14362     &hf_ieee80211_ht_info_lsig_txop_protection_full_support,
14363     &hf_ieee80211_ht_info_pco_active,
14364     &hf_ieee80211_ht_info_pco_phase,
14365     &hf_ieee80211_ht_info_reserved_b36_b39,
14366     NULL
14367   };
14368
14369   if (tag_len < 22) {
14370     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14371                            "HT Information IE content length %u wrong, must be at least 22 bytes", tag_len);
14372     return 1;
14373   }
14374
14375   proto_tree_add_item(tree, hf_ieee80211_ht_info_primary_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14376   offset += 1;
14377
14378   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter1,
14379                                     ett_ht_info_delimiter1_tree, ieee80211_ht_info1_field,
14380                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14381   offset += 1;
14382
14383
14384   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter2,
14385                                     ett_ht_info_delimiter2_tree, ieee80211_ht_info2_field,
14386                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14387   offset += 2;
14388
14389   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_info_delimiter3,
14390                                     ett_ht_info_delimiter3_tree, ieee80211_ht_info3_field,
14391                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14392   offset += 2;
14393
14394   offset = dissect_mcs_set(tree, tvb, offset, TRUE, FALSE);
14395
14396   return offset;
14397 }
14398
14399
14400 static int
14401 dissect_wapi_param_set(tvbuff_t *tvb, packet_info *pinfo,
14402                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
14403                           proto_item *ti, int ftype)
14404 {
14405   /* Parse the WAPI Parameter Set IE Here*/
14406   proto_item *item;
14407   proto_tree *subtree;
14408   guint16 loop_cnt, version, akm_cnt  = 1, ucast_cnt = 1, bkid_cnt = 1;
14409   guint8  akm_suite_type = 0, ucast_cipher_type = 0, mcast_cipher_type = 0;
14410   static const int *ieee80211_tag_wapi_param_set[] = {
14411     &hf_ieee80211_tag_wapi_param_set_capab_preauth,
14412     &hf_ieee80211_tag_wapi_param_set_capab_rsvd,
14413     NULL
14414   };
14415
14416   version = tvb_get_letohs(tvb, offset);
14417   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14418   offset += 2;
14419
14420   /*MIN: 2 + (2+4)+ (2+4) + 4 + 2 + 0 (BKID CNT and LIST)  =20*/
14421   if (tag_len < 20) {
14422       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
14423                 "tag_len is  %d, it's neither WAPI not BSS-AC-Access-Delay", tag_len);
14424     return offset;
14425   }
14426
14427   if (version != 1) {
14428     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
14429                            "Version of WAPI protocol is %d, must be = 1", version);
14430     return offset;
14431   }
14432
14433   /* AKM Suites: list can't be 0*/
14434   akm_cnt = tvb_get_letohs(tvb, offset);
14435   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_akm_suite_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14436   offset += 2;
14437   if (akm_cnt != 0) {
14438     proto_item_append_text(ti, " : AKM Suite List:");
14439     for (loop_cnt = 0; loop_cnt < akm_cnt; loop_cnt++) {
14440       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_akm_tree);
14441       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_oui, tvb, offset, 3, ENC_NA);
14442       offset += 3;
14443       akm_suite_type = tvb_get_guint8(tvb, offset);
14444       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14445       offset += 1;
14446       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(akm_suite_type,
14447       ieee80211_wapi_suite_type_short, "Reserved: %d"));
14448     }
14449     proto_item_append_text(ti, " /");
14450   } else {
14451     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of AKM suites is 0, must be min 1");
14452     return offset;
14453
14454   }
14455   /* Unicast Cipher Suites: list can't be 0*/
14456   ucast_cnt = tvb_get_letohs(tvb, offset);
14457   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
14458                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
14459   offset += 2;
14460   if (ucast_cnt != 0) {
14461     proto_item_append_text(ti, " Unicast Cipher List:");
14462     for (loop_cnt = 0; loop_cnt < ucast_cnt; loop_cnt++) {
14463       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_ucast_tree);
14464       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
14465       offset += 3;
14466       ucast_cipher_type = tvb_get_guint8(tvb, offset);
14467       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14468       offset += 1;
14469       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(ucast_cipher_type, ieee80211_wapi_cipher_type, "Reserved: %d"));
14470     }
14471   proto_item_append_text(ti, " /");
14472   } else {
14473     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of Unicast Cipher suites is 0, must be min 1");
14474     return offset;
14475
14476   }
14477
14478   /* Multicast Cipher Suites*/
14479   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
14480   offset += 3;
14481   mcast_cipher_type = tvb_get_guint8(tvb, offset);
14482   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14483   offset += 1;
14484   proto_item_append_text(ti, " Multicast Cipher: %s", val_to_str(mcast_cipher_type, ieee80211_wapi_cipher_type, "Reserved: %d"));
14485
14486   /* WAPI capability */
14487   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_wapi_param_set_capab,
14488                                     ett_tag_wapi_param_set_preauth_tree, ieee80211_tag_wapi_param_set,
14489                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14490   offset += 2;
14491
14492   /* BKID List: The list can be 0
14493    * Applicable only for assoc/re-assoc
14494    */
14495   if (ftype == MGT_ASSOC_REQ || ftype == MGT_REASSOC_REQ ) {
14496     bkid_cnt = tvb_get_letohs(tvb, offset);
14497     proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14498     offset += 2;
14499     if (bkid_cnt != 0) {
14500       for (loop_cnt = 0; loop_cnt < bkid_cnt; loop_cnt++) {
14501         proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_list, tvb, offset, 16, ENC_NA);
14502         offset += 16;
14503       }
14504     }
14505   }
14506   return offset;
14507 }
14508
14509 static int
14510 dissect_bss_max_idle_period(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14511 {
14512   int offset = 0;
14513   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_period,
14514                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
14515   offset += 2;
14516   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_options_protected,
14517                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14518   offset++;
14519   return offset;
14520 }
14521
14522 enum tfs_request_subelem_id {
14523   TFS_REQ_SUBELEM_TFS = 1,
14524   TFS_REQ_SUBELEM_VENDOR_SPECIFIC = 221
14525 };
14526
14527 static const value_string tfs_request_subelem_ids[] = {
14528   { TFS_REQ_SUBELEM_TFS, "TFS subelement" },
14529   { TFS_REQ_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
14530   { 0, NULL }
14531 };
14532
14533 static int
14534 dissect_tfs_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14535 {
14536   int tag_len = tvb_reported_length(tvb);
14537   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14538   int offset = 0;
14539   const guint8 ids[] = {
14540     1, /* TFS Subelement */
14541     TAG_VENDOR_SPECIFIC_IE
14542   };
14543
14544   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_id,
14545                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14546   offset++;
14547   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_delete_after_match,
14548                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14549   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_notify,
14550                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14551   offset++;
14552   if (offset + 1 >= tag_len) {
14553     expert_add_info_format(pinfo, tree, &ei_ieee80211_missing_data,
14554                            "No TFS Request subelements in TFS Request");
14555     return tvb_captured_length(tvb);
14556   }
14557
14558   while (offset + 1 < tag_len) {
14559     guint8 id, len;
14560     int s_offset, s_end;
14561
14562     id = tvb_get_guint8(tvb, offset);
14563     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_id,
14564                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14565     offset++;
14566     len = tvb_get_guint8(tvb, offset);
14567     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_len,
14568                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14569     offset++;
14570     if (offset + len > tag_len) {
14571       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
14572                              "Not enough data for TFS Request subelement");
14573       return tvb_captured_length(tvb);
14574     }
14575     switch (id) {
14576     case TFS_REQ_SUBELEM_TFS:
14577       s_offset = offset;
14578       s_end = offset + len;
14579       while (s_offset < s_end) {
14580         /* TODO 1 is interpreted as TAG_SUPP_RATES, fix this! */
14581         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
14582         if (tlen==0)
14583           break;
14584         s_offset += tlen;
14585       }
14586       break;
14587     default:
14588       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem,
14589                           tvb, offset, len, ENC_NA);
14590       break;
14591     }
14592     offset += len;
14593   }
14594
14595   if (offset < tag_len) {
14596     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
14597                            tvb, offset, tag_len - offset, "Extra data after TFS Subelements");
14598   }
14599
14600   return tvb_captured_length(tvb);
14601 }
14602
14603 enum tfs_response_subelem_id {
14604   TFS_RESP_SUBELEM_TFS_STATUS = 1,
14605   TFS_RESP_SUBELEM_TFS = 2,
14606   TFS_RESP_SUBELEM_VENDOR_SPECIFIC = 221
14607 };
14608
14609 static const value_string tfs_response_subelem_ids[] = {
14610   { TFS_RESP_SUBELEM_TFS_STATUS, "TFS Status subelement" },
14611   { TFS_RESP_SUBELEM_TFS, "TFS subelement" },
14612   { TFS_RESP_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
14613   { 0, NULL }
14614 };
14615
14616 static int
14617 dissect_tfs_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14618 {
14619   int tag_len = tvb_reported_length(tvb);
14620   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14621   int offset = 0;
14622   const guint8 ids[] = {
14623     1, /* TFS Status subelement*/
14624     2, /* TFS subelement */
14625     TAG_VENDOR_SPECIFIC_IE
14626   };
14627
14628   while (offset + 3 <= tag_len) {
14629     guint8 id, len;
14630     int s_offset, s_end;
14631
14632     id = tvb_get_guint8(tvb, offset);
14633     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_id,
14634                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14635     offset++;
14636     len = tvb_get_guint8(tvb, offset);
14637     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_len,
14638                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14639     offset++;
14640     if (offset + len > tag_len) {
14641       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
14642                              "Not enough data for TFS Request subelement");
14643       return tvb_captured_length(tvb);
14644     }
14645     switch (id) {
14646     case TFS_RESP_SUBELEM_TFS_STATUS:
14647       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_status,
14648                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
14649       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_id,
14650                           tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
14651       break;
14652     case TFS_RESP_SUBELEM_TFS:
14653       s_offset = offset;
14654       s_end = offset + len;
14655       while (s_offset < s_end) {
14656         /* TODO Element IDs 1 and 2 are misinterpreted! */
14657         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, field_data->ftype, ids, G_N_ELEMENTS(ids), NULL);
14658         if (tlen==0)
14659           break;
14660         s_offset += tlen;
14661       }
14662       break;
14663     default:
14664       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem,
14665                           tvb, offset, len, ENC_NA);
14666       break;
14667     }
14668
14669     offset += len;
14670   }
14671
14672   if (offset < tag_len) {
14673     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
14674                            tvb, offset, tag_len - offset, "Extra data after TFS Subelements");
14675   }
14676
14677   return tvb_captured_length(tvb);
14678 }
14679
14680 static const value_string wnm_sleep_mode_action_types[] = {
14681   { 0, "Enter WNM-Sleep Mode" },
14682   { 1, "Exit WNM-Sleep Mode" },
14683   { 0, NULL }
14684 };
14685
14686 static const value_string wnm_sleep_mode_response_status_vals[] = {
14687   { 0, "Enter/Exit WNM-Sleep Mode Accept" },
14688   { 1, "Exit WNM-Sleep Mode Accept, GTK/IGTK update required" },
14689   { 2, "Denied. The AP is unable to perform the requested action." },
14690   { 3, "Denied temporarily. The AP is unable to perform the requested action "
14691     "at the current time. The request can be submitted again at a later time."
14692   },
14693   { 4, "Denied. Due to the pending key expiration." },
14694   { 5, "Denied. The requested action was not granted due to other WNM services "
14695     "in use by the requesting STA." },
14696   { 0, NULL }
14697 };
14698
14699 static int
14700 dissect_wnm_sleep_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14701 {
14702   int offset = 0;
14703   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_action_type,
14704                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14705   offset++;
14706   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_response_status,
14707                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14708   offset++;
14709   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_interval,
14710                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
14711   offset += 2;
14712   return offset;
14713 }
14714
14715 static const value_string time_adv_timing_capab_vals[] = {
14716   { 0, "No standardized external time source" },
14717   { 1, "Timestamp offset based on UTC" },
14718   { 2, "UTC time at which the TSF timer is 0" },
14719   { 0, NULL }
14720 };
14721
14722 static int
14723 dissect_time_adv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14724 {
14725   int offset = 0;
14726   guint8 capab;
14727   proto_item *item;
14728   proto_tree *subtree;
14729   struct tm tm, *now;
14730   time_t t;
14731
14732   capab = tvb_get_guint8(tvb, offset);
14733   proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_timing_capab,
14734                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
14735   offset += 1;
14736
14737   switch (capab) {
14738   case 1:
14739     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
14740                         tvb, offset, 10, ENC_NA);
14741     offset += 10;
14742
14743     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
14744                         tvb, offset, 5, ENC_NA);
14745     offset += 5;
14746     break;
14747   case 2:
14748     item = proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
14749                                tvb, offset, 10, ENC_NA);
14750     subtree = proto_item_add_subtree(item, ett_tag_time_adv_tree);
14751     memset(&tm, 0, sizeof(tm));
14752     tm.tm_year = tvb_get_letohs(tvb, offset) - 1900;
14753     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_year,
14754                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
14755     offset += 2;
14756     tm.tm_mon = tvb_get_guint8(tvb, offset) - 1;
14757     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_month,
14758                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14759     offset += 1;
14760     tm.tm_mday = tvb_get_guint8(tvb, offset);
14761     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_day,
14762                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14763     offset += 1;
14764     tm.tm_hour = tvb_get_guint8(tvb, offset);
14765     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_hours,
14766                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14767     offset += 1;
14768     tm.tm_min = tvb_get_guint8(tvb, offset);
14769     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_minutes,
14770                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14771     offset += 1;
14772     tm.tm_sec = tvb_get_guint8(tvb, offset);
14773     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_seconds,
14774                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14775     offset += 1;
14776     proto_tree_add_item(subtree,
14777                         hf_ieee80211_tag_time_adv_time_value_milliseconds,
14778                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
14779     offset += 2;
14780     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_reserved,
14781                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14782     offset += 1;
14783
14784     tm.tm_isdst = -1;
14785     t = mktime(&tm);
14786     if (t != -1) {
14787       t += (time_t)(last_timestamp / 1000000);
14788       now = localtime(&t);
14789       if (now)
14790         proto_item_append_text(item,
14791                                ": current time=%u-%02u-%02u %02u:%02u:%02u",
14792                                now->tm_year + 1900, now->tm_mon + 1,
14793                                now->tm_mday, now->tm_hour, now->tm_min,
14794                                now->tm_sec);
14795     }
14796
14797     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
14798                         tvb, offset, 5, ENC_NA);
14799     offset += 5;
14800
14801     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_update_counter,
14802                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
14803     offset += 1;
14804     break;
14805   }
14806
14807   return offset;
14808 }
14809
14810 static int
14811 dissect_time_zone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14812 {
14813   int tag_len = tvb_reported_length(tvb);
14814   int offset = 0;
14815
14816   proto_tree_add_item(tree, hf_ieee80211_tag_time_zone, tvb, offset, tag_len,
14817                       ENC_ASCII|ENC_NA);
14818   return tvb_captured_length(tvb);
14819 }
14820
14821 static int
14822 dissect_ap_channel_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14823 {
14824   int tag_len = tvb_reported_length(tvb);
14825   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14826   int offset = 0;
14827
14828   if (tag_len < 1) {
14829     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14830                            "AP Channel Report length %u wrong, must be > 1", tag_len);
14831     return tvb_captured_length(tvb);
14832   }
14833
14834   proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_operating_class, tvb,
14835                       offset, 1, ENC_LITTLE_ENDIAN);
14836   proto_item_append_text(field_data->item_tag, ": Operating Class %u, Channel List :", tvb_get_guint8(tvb, offset));
14837   offset += 1;
14838
14839   while (offset < tag_len)
14840   {
14841     proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_channel_list, tvb, offset, 1, ENC_NA);
14842     proto_item_append_text(field_data->item_tag, " %u,", tvb_get_guint8(tvb, offset));
14843     offset += 1;
14844   }
14845   return tvb_captured_length(tvb);
14846 }
14847
14848 static int
14849 dissect_secondary_channel_offset_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   if (tag_len != 1) {
14855     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14856                            "Secondary Channel Offset length %u wrong, must be = 1", tag_len);
14857     return 1;
14858   }
14859
14860   proto_tree_add_item(tree, hf_ieee80211_tag_secondary_channel_offset, tvb,
14861                       offset, 1, ENC_LITTLE_ENDIAN);
14862   return tvb_captured_length(tvb);
14863 }
14864
14865 /* BSS Average Access Delay element (63) */
14866 static int
14867 dissect_bss_avg_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14868 {
14869   int tag_len = tvb_reported_length(tvb);
14870   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14871   int offset = 0;
14872   if (tag_len != 1) {
14873     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14874                            "BSS Average Access Delay length %u wrong, must be = 1", tag_len);
14875     return 1;
14876   }
14877
14878   proto_tree_add_item(tree, hf_ieee80211_tag_bss_ap_avg_access_delay, tvb,
14879                       offset, 1, ENC_LITTLE_ENDIAN);
14880   return tvb_captured_length(tvb);
14881 }
14882
14883 static int
14884 dissect_antenna_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14885 {
14886   int tag_len = tvb_reported_length(tvb);
14887   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14888   int offset = 0;
14889
14890   if (tag_len != 1) {
14891     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14892                            "Antenna length %u wrong, must be = 1", tag_len);
14893     return 1;
14894   }
14895
14896   proto_tree_add_item(tree, hf_ieee80211_tag_antenna_id, tvb,
14897                       offset, 1, ENC_LITTLE_ENDIAN);
14898
14899   return tvb_captured_length(tvb);
14900 }
14901
14902 static int
14903 dissect_rsni_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14904 {
14905   int tag_len = tvb_reported_length(tvb);
14906   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14907   int offset = 0;
14908
14909   if (tag_len != 1) {
14910     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14911                            "RSNI length %u wrong, must be = 1", tag_len);
14912     return 1;
14913   }
14914
14915   proto_tree_add_item(tree, hf_ieee80211_tag_rsni, tvb,
14916                       offset, 1, ENC_LITTLE_ENDIAN);
14917
14918   return tvb_captured_length(tvb);
14919 }
14920
14921 static int
14922 dissect_measurement_pilot_trans_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
14923 {
14924   int tag_len = tvb_reported_length(tvb);
14925   int offset = 0;
14926   const guint8 ids[] = { TAG_VENDOR_SPECIFIC_IE };
14927
14928   /* The tag len can be 1 or more if there are sub-elements */
14929
14930   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
14931                       1, ENC_NA);
14932
14933   tag_len--;
14934   offset++;
14935
14936   /* Also handle the optional sub-elements */
14937
14938   if (tag_len > 0) {
14939     while (tag_len > 0) {
14940       guint8 elt_len;
14941
14942       elt_len = tvb_get_guint8(tvb, offset + 1);
14943
14944       if(add_tagged_field(pinfo, tree, tvb, offset + 2, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
14945         /* TODO: Add an expert info here and skip the field. */
14946         break;
14947       }
14948
14949       tag_len -= elt_len + 2;
14950       offset += elt_len + 2;
14951     }
14952   }
14953
14954   return tvb_captured_length(tvb);
14955 }
14956
14957 static int
14958 dissect_bss_available_admission_capacity_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
14959 {
14960   int tag_len = tvb_reported_length(tvb);
14961   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
14962   int offset = 0;
14963   guint16 bitmask;
14964   static const int *ieee80211_tag_bss_avb_adm_cap_bitmask[] = {
14965     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
14966     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
14967     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
14968     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
14969     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
14970     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
14971     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
14972     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
14973     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
14974     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
14975     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
14976     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
14977     &hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
14978     NULL
14979   };
14980
14981   if (tag_len < 2) {
14982     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
14983                            "BSS Available Admission Capacity length %u wrong, must > = 2", tag_len);
14984     return offset;
14985   }
14986
14987   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
14988                                     ett_tag_bss_bitmask_tree, ieee80211_tag_bss_avb_adm_cap_bitmask,
14989                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
14990   bitmask = tvb_get_letohs(tvb, offset);
14991   offset += 2;
14992
14993   if(bitmask & BSS_BITMASK_UP0)
14994   {
14995     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14996     offset += 2;
14997   }
14998   if(bitmask & BSS_BITMASK_UP1)
14999   {
15000     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15001     offset += 2;
15002   }
15003   if(bitmask & BSS_BITMASK_UP2)
15004   {
15005     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15006     offset += 2;
15007   }
15008   if(bitmask & BSS_BITMASK_UP3)
15009   {
15010     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15011     offset += 2;
15012   }
15013   if(bitmask & BSS_BITMASK_UP4)
15014   {
15015     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15016     offset += 2;
15017   }
15018   if(bitmask & BSS_BITMASK_UP5)
15019   {
15020     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15021     offset += 2;
15022   }
15023   if(bitmask & BSS_BITMASK_UP6)
15024   {
15025     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15026     offset += 2;
15027   }
15028   if(bitmask & BSS_BITMASK_UP7)
15029   {
15030     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15031     offset += 2;
15032   }
15033   if(bitmask & BSS_BITMASK_AC0)
15034   {
15035     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15036     offset += 2;
15037   }
15038   if(bitmask & BSS_BITMASK_AC1)
15039   {
15040     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15041     offset += 2;
15042   }
15043   if(bitmask & BSS_BITMASK_AC2)
15044   {
15045     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15046     offset += 2;
15047   }
15048   if(bitmask & BSS_BITMASK_AC3)
15049   {
15050     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15051     offset += 2;
15052   }
15053   return offset;
15054 }
15055
15056 static int
15057 dissect_bss_ac_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
15058                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
15059 {
15060
15061   if (tag_len != 4) {
15062     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
15063                            "BSS AC Access Delay length %u wrong, must = 4", tag_len);
15064     return offset;
15065   }
15066
15067   /* TODO: Display the scaled representation of the average
15068     medium access delay (a big (precalculed) value_string ?)
15069     See 8.4.2.46 BSS AC Access Delay element ... */
15070
15071   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_be, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15072   offset += 1;
15073   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_bk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15074   offset += 1;
15075   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15076   offset += 1;
15077   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vo, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15078   offset += 1;
15079
15080   return offset;
15081 }
15082
15083 /* RM Enabled Capabilities (70) */
15084 static int
15085 dissect_rm_enabled_capabilities_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15086 {
15087   int tag_len = tvb_reported_length(tvb);
15088   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15089   int offset = 0;
15090   proto_item *ti_ex_cap;
15091   static const int *ieee80211_tag_rm_enabled_capabilities_octet1[] = {
15092     &hf_ieee80211_tag_rm_enabled_capabilities_b0,
15093     &hf_ieee80211_tag_rm_enabled_capabilities_b1,
15094     &hf_ieee80211_tag_rm_enabled_capabilities_b2,
15095     &hf_ieee80211_tag_rm_enabled_capabilities_b3,
15096     &hf_ieee80211_tag_rm_enabled_capabilities_b4,
15097     &hf_ieee80211_tag_rm_enabled_capabilities_b5,
15098     &hf_ieee80211_tag_rm_enabled_capabilities_b6,
15099     &hf_ieee80211_tag_rm_enabled_capabilities_b7,
15100     NULL
15101   };
15102
15103   static const int *ieee80211_tag_rm_enabled_capabilities_octet2[] = {
15104     &hf_ieee80211_tag_rm_enabled_capabilities_b8,
15105     &hf_ieee80211_tag_rm_enabled_capabilities_b9,
15106     &hf_ieee80211_tag_rm_enabled_capabilities_b10,
15107     &hf_ieee80211_tag_rm_enabled_capabilities_b11,
15108     &hf_ieee80211_tag_rm_enabled_capabilities_b12,
15109     &hf_ieee80211_tag_rm_enabled_capabilities_b13,
15110     &hf_ieee80211_tag_rm_enabled_capabilities_b14,
15111     &hf_ieee80211_tag_rm_enabled_capabilities_b15,
15112     NULL
15113   };
15114
15115   static const int *ieee80211_tag_rm_enabled_capabilities_octet3[] = {
15116     &hf_ieee80211_tag_rm_enabled_capabilities_b16,
15117     &hf_ieee80211_tag_rm_enabled_capabilities_b17,
15118     &hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
15119     &hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
15120     NULL
15121   };
15122
15123   static const int *ieee80211_tag_rm_enabled_capabilities_octet4[] = {
15124     &hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
15125     &hf_ieee80211_tag_rm_enabled_capabilities_b27,
15126     &hf_ieee80211_tag_rm_enabled_capabilities_b28,
15127     &hf_ieee80211_tag_rm_enabled_capabilities_b29,
15128     &hf_ieee80211_tag_rm_enabled_capabilities_b30,
15129     &hf_ieee80211_tag_rm_enabled_capabilities_b31,
15130     NULL
15131   };
15132
15133   static const int *ieee80211_tag_rm_enabled_capabilities_octet5[] = {
15134     &hf_ieee80211_tag_rm_enabled_capabilities_b32,
15135     &hf_ieee80211_tag_rm_enabled_capabilities_b33,
15136     &hf_ieee80211_tag_rm_enabled_capabilities_o5,
15137     NULL
15138   };
15139
15140   if (tag_len != 5)
15141   {
15142     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "RM Enabled Capabilities length %u wrong, must = 5", tag_len);
15143     return 1;
15144   }
15145   proto_item_append_text(field_data->item_tag, " (%d octets)", tag_len);
15146
15147   /* RM Enabled Capability octet 1 */
15148   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15149                                     ett_tag_rm_cap1, ieee80211_tag_rm_enabled_capabilities_octet1,
15150                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15151   proto_item_append_text(ti_ex_cap, " (octet 1)");
15152   offset += 1;
15153
15154   /* RM Enabled Capability octet 2 */
15155   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15156                                     ett_tag_rm_cap2, ieee80211_tag_rm_enabled_capabilities_octet2,
15157                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15158   proto_item_append_text(ti_ex_cap, " (octet 2)");
15159   offset += 1;
15160
15161   /* RM Enabled Capability octet 3 */
15162   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15163                                     ett_tag_rm_cap3, ieee80211_tag_rm_enabled_capabilities_octet3,
15164                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15165   proto_item_append_text(ti_ex_cap, " (octet 3)");
15166   offset += 1;
15167
15168   /* RM Enabled Capability octet 4 */
15169   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15170                                     ett_tag_rm_cap4, ieee80211_tag_rm_enabled_capabilities_octet4,
15171                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15172   proto_item_append_text(ti_ex_cap, " (octet 4)");
15173   offset += 1;
15174
15175   /* RM Enabled Capability octet 5 */
15176   ti_ex_cap = proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_rm_enabled_capabilities,
15177                                     ett_tag_rm_cap5, ieee80211_tag_rm_enabled_capabilities_octet5,
15178                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15179   proto_item_append_text(ti_ex_cap, " (octet 5)");
15180   offset += 1;
15181
15182   return offset;
15183 }
15184
15185 /* 20/40 BSS Coexistence (72) */
15186 static int
15187 dissect_20_40_bss_coexistence(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15188 {
15189   int tag_len = tvb_reported_length(tvb);
15190   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15191   int offset = 0;
15192   static const int *ieee80211_20_40_bss_coexistence_fields[] = {
15193     &hf_ieee80211_tag_20_40_bc_information_request,
15194     &hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant,
15195     &hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request,
15196     &hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request,
15197     &hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant,
15198     &hf_ieee80211_tag_20_40_bc_reserved,
15199     NULL
15200   };
15201
15202   if (tag_len != 1)
15203   {
15204     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);
15205     return 1;
15206   }
15207
15208   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_20_40_bc,
15209                                     ett_tag_20_40_bc, ieee80211_20_40_bss_coexistence_fields,
15210                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15211
15212   offset += 1;
15213
15214   return offset;
15215 }
15216
15217 static int
15218 dissect_ht_capability_ie_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
15219                          guint32 tag_len, proto_item *ti_len, gboolean vendorspecific)
15220 {
15221   proto_item *cap_item, *ti;
15222   proto_tree *cap_tree;
15223   static const int *ieee80211_ht[] = {
15224     &hf_ieee80211_ht_ldpc_coding,
15225     &hf_ieee80211_ht_chan_width,
15226     &hf_ieee80211_ht_sm_pwsave,
15227     &hf_ieee80211_ht_green,
15228     &hf_ieee80211_ht_short20,
15229     &hf_ieee80211_ht_short40,
15230     &hf_ieee80211_ht_tx_stbc,
15231     &hf_ieee80211_ht_rx_stbc,
15232     &hf_ieee80211_ht_delayed_block_ack,
15233     &hf_ieee80211_ht_max_amsdu,
15234     &hf_ieee80211_ht_dss_cck_40,
15235     &hf_ieee80211_ht_psmp,
15236     &hf_ieee80211_ht_40_mhz_intolerant,
15237     &hf_ieee80211_ht_l_sig,
15238     NULL
15239   };
15240
15241   static const int *ieee80211_htex[] = {
15242     &hf_ieee80211_htex_pco,
15243     &hf_ieee80211_htex_transtime,
15244     &hf_ieee80211_htex_mcs,
15245     &hf_ieee80211_htex_htc_support,
15246     &hf_ieee80211_htex_rd_responder,
15247     NULL
15248   };
15249
15250   static const int *ieee80211_txbf[] = {
15251     &hf_ieee80211_txbf_cap,
15252     &hf_ieee80211_txbf_rcv_ssc,
15253     &hf_ieee80211_txbf_tx_ssc,
15254     &hf_ieee80211_txbf_rcv_ndp,
15255     &hf_ieee80211_txbf_tx_ndp,
15256     &hf_ieee80211_txbf_impl_txbf,
15257     &hf_ieee80211_txbf_calib,
15258     &hf_ieee80211_txbf_expl_csi,
15259     &hf_ieee80211_txbf_expl_uncomp_fm,
15260     &hf_ieee80211_txbf_expl_comp_fm,
15261     &hf_ieee80211_txbf_expl_bf_csi,
15262     &hf_ieee80211_txbf_expl_uncomp_fm_feed,
15263     &hf_ieee80211_txbf_expl_comp_fm_feed,
15264     &hf_ieee80211_txbf_min_group,
15265     &hf_ieee80211_txbf_csi_num_bf_ant,
15266     &hf_ieee80211_txbf_uncomp_sm_bf_ant,
15267     &hf_ieee80211_txbf_comp_sm_bf_ant,
15268     &hf_ieee80211_txbf_csi_max_rows_bf,
15269     &hf_ieee80211_txbf_chan_est,
15270     &hf_ieee80211_txbf_resrv,
15271     NULL
15272   };
15273
15274   static const int *ieee80211_antsel[] = {
15275     &hf_ieee80211_antsel_b0,
15276     &hf_ieee80211_antsel_b1,
15277     &hf_ieee80211_antsel_b2,
15278     &hf_ieee80211_antsel_b3,
15279     &hf_ieee80211_antsel_b4,
15280     &hf_ieee80211_antsel_b5,
15281     &hf_ieee80211_antsel_b6,
15282     &hf_ieee80211_antsel_b7,
15283     NULL
15284   };
15285
15286   if (tag_len != 26) {
15287     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
15288                            "HT Capabilities IE length %u wrong, must be = 26", tag_len);
15289     return (offset > 0) ? offset : 1;
15290   }
15291
15292   if (wlan_ignore_draft_ht && vendorspecific)
15293     return (offset > 0) ? offset : 1;
15294
15295   /* 2 byte HT Capabilities  Info*/
15296   if (vendorspecific)
15297   {
15298     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_vs_cap,
15299                                     ett_ht_cap_tree, ieee80211_ht,
15300                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15301   }
15302   else
15303   {
15304     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ht_cap,
15305                                     ett_ht_cap_tree, ieee80211_ht,
15306                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15307   }
15308   offset += 2;
15309
15310   /* 1 byte A-MPDU Parameters */
15311   if (vendorspecific)
15312   {
15313     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15314   } else
15315   {
15316     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15317   }
15318   cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
15319   ti = proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15320   proto_item_append_text(ti, " (%04.0f[Bytes])", pow(2, 13+(tvb_get_guint8(tvb, offset) & 0x3))-1);
15321   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu_start_spacing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15322   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15323   offset += 1;
15324
15325   /* 16 byte MCS set */
15326   offset = dissect_mcs_set(tree, tvb, offset, FALSE, vendorspecific);
15327
15328
15329   /* 2 byte HT Extended Capabilities */
15330   if (vendorspecific)
15331   {
15332     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_htex_vs_cap,
15333                                     ett_htex_cap_tree, ieee80211_htex,
15334                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15335   } else {
15336     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_htex_cap,
15337                                     ett_htex_cap_tree, ieee80211_htex,
15338                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15339   }
15340   offset += 2;
15341
15342
15343   /* 4 byte TxBF capabilities */
15344   if (vendorspecific)
15345   {
15346     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_txbf_vs,
15347                                     ett_txbf_tree, ieee80211_txbf,
15348                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15349   } else {
15350     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_txbf,
15351                                     ett_txbf_tree, ieee80211_txbf,
15352                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15353   }
15354   offset += 4;
15355
15356   /* 1 byte Antenna Selection (ASEL) capabilities */
15357   if (vendorspecific)
15358   {
15359     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_antsel_vs,
15360                                     ett_antsel_tree, ieee80211_antsel,
15361                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15362   }
15363   else
15364   {
15365     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_antsel,
15366                                     ett_antsel_tree, ieee80211_antsel,
15367                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15368   }
15369   offset += 1;
15370
15371   return offset;
15372 }
15373
15374 static int
15375 dissect_ht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15376 {
15377   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15378
15379   return dissect_ht_capability_ie_common(tvb, pinfo, tree, 0, tvb_reported_length(tvb),
15380             field_data->item_tag_length, FALSE);
15381 }
15382
15383 static int
15384 dissect_ht_info_ie_1_0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
15385                        guint32 tag_len, proto_item *ti_len)
15386 {
15387   static const int *ieee80211_hta1[] = {
15388     &hf_ieee80211_hta_ext_chan_offset,
15389     &hf_ieee80211_hta_rec_tx_width,
15390     &hf_ieee80211_hta_rifs_mode,
15391     &hf_ieee80211_hta_controlled_access,
15392     &hf_ieee80211_hta_service_interval,
15393     NULL
15394   };
15395
15396   static const int *ieee80211_hta2[] = {
15397     &hf_ieee80211_hta_operating_mode,
15398     &hf_ieee80211_hta_non_gf_devices,
15399     NULL
15400   };
15401
15402   static const int *ieee80211_hta3[] = {
15403     &hf_ieee80211_hta_basic_stbc_mcs,
15404     &hf_ieee80211_hta_dual_stbc_protection,
15405     &hf_ieee80211_hta_secondary_beacon,
15406     &hf_ieee80211_hta_lsig_txop_protection,
15407     &hf_ieee80211_hta_pco_active,
15408     &hf_ieee80211_hta_pco_phase,
15409     NULL
15410   };
15411
15412   if (tag_len != 22) {
15413     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
15414                            "Tag length %u wrong, must be = 22", tag_len);
15415     return offset;
15416   }
15417
15418   if (wlan_ignore_draft_ht)
15419     return offset;
15420
15421   /* 1 HT Control Channel */
15422   proto_tree_add_item(tree, hf_ieee80211_hta_cc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15423   offset += 1;
15424
15425   /* 1 byte HT additional capabilities */
15426   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap1,
15427                                     ett_hta_cap_tree, ieee80211_hta1,
15428                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15429   offset += 1;
15430
15431   /* 2 byte HT additional capabilities */
15432   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap2,
15433                                     ett_hta_cap1_tree, ieee80211_hta2,
15434                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15435   offset += 2;
15436
15437   /* 2 byte HT additional capabilities */
15438   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_hta_cap2,
15439                                     ett_hta_cap2_tree, ieee80211_hta3,
15440                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15441   offset += 2;
15442
15443   /* 16 byte Supported MCS set */
15444   offset = dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
15445
15446   return offset;
15447 }
15448
15449 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
15450
15451 /*
15452  * 8.2.4.1.10 "Order field" says:
15453  *
15454  *  The Order field is 1 bit in length. It is used for two purposes:
15455  *
15456  *    -- It is set to 1 in a non-QoS data frame transmitted by a non-QoS
15457  *       STA to indicate that the frame contains an MSDU, or fragment
15458  *       thereof, that is being transferred using the StrictlyOrdered
15459  *       service class.
15460  *
15461  *    -- It is set to 1 in a QoS data or management frame transmitted
15462  *       with a value of HT_GF or HT_MF for the FORMAT parameter of the
15463  *       TXVECTOR to indicate that the frame contains an HT Control field.
15464  *
15465  * 802.11ac changes the second of those clauses to say "HT_GF, HT_MF,
15466  * or VHT", indicates that bit B0 of the field is 0 for HT and 1 for
15467  * VHT (stealing a reserved bit from the Link Adaptation Control field),
15468  * and that everything except for "AC Constraint" and "RDG/More Cowbell^W
15469  * PPDU" is different for the VHT version.
15470  *
15471  *  802.11ax changes the meaning of the first two bits:
15472  *
15473  *     B0 = 0         means High Throughput
15474  *     B0 = 1, B1 = 0 means Very High Throughput
15475  *     B0 = 1, B1 = 1 means High Efficiency
15476  *
15477  * I read the second clause of 8.2.4.1.10 "Order field", as modified by
15478  * 802.11ac, as meaning that, for QoS data and management frames, the
15479  * Order field will *only* be set to 1 for HT or VHT frames, and therefore
15480  * that we do *not* have to determine, from radio metadata, whether the
15481  * frame was transmitted as an HT or VHT frame.
15482  *
15483  * (See bug 11351, in which a frame with an HT Control field, with a
15484  * radiotap header, lacks the MCS or VHT fields in the radiotap header,
15485  * so Wireshark has no clue that it's an HT or VHT field, and misdissected
15486  * the packet.  Omnipeek, which also appeared to have no clue that it was
15487  * an HT or VHT field - it called it an 802.11b frame - *did* dissect the
15488  * HT Control field.)
15489  *
15490  * 802.11ax changes the reserved bit to differentiate between the HE version
15491  * and the VHT version, and adds different types of Aggregate Control info.
15492  */
15493 #define A_CONTROL_UMRS 0
15494 #define A_CONTROL_OM   1
15495 #define A_CONTROL_HLA  2
15496 #define A_CONTROL_BSR  3
15497 #define A_CONTROL_UPH  4
15498 #define A_CONTROL_BQR  5
15499 #define A_CONTROL_CCI  6
15500 #define A_CONTROL_BQR_REV 0x0A
15501
15502 static const value_string a_control_control_id_vals[] = {
15503   { A_CONTROL_UMRS, "UL MU response scheduling" },
15504   { A_CONTROL_OM,   "Operating mode" },
15505   { A_CONTROL_HLA,  "HE link adaptation" },
15506   { A_CONTROL_BSR,  "Buffer status report" },
15507   { A_CONTROL_UPH,  "UL power headroom" },
15508   { A_CONTROL_BQR,  "Bandwidth query report" },
15509   { A_CONTROL_CCI,  "Command Control Indication" },
15510   { A_CONTROL_BQR_REV, "Bandwidth Query Report (reversed bits)" },
15511   { 0, NULL }
15512 };
15513
15514 /*
15515  * Print the UL target RSSI field as per the spec.
15516  *  0->30 map to -90 to -30 dBm.
15517  *  31 maps to Max ransmit power
15518  */
15519 static void
15520 ul_target_rssi_base_custom(gchar *result, guint32 target_rssi)
15521 {
15522   if (target_rssi <= 30) {
15523     g_snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -90 + (2 * target_rssi));
15524   } else if (target_rssi == 31) {
15525     g_snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power");
15526   }
15527 }
15528
15529 static void
15530 dissect_a_control_umrs(proto_tree *tree, tvbuff_t *tvb, int offset,
15531   guint32 bits _U_, guint32 start_bit)
15532 {
15533   proto_tree *umrs_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   umrs_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15540                                 ett_ieee80211_umrs_control,
15541                                 NULL, "UMRS Control: 0x%08x", the_bits);
15542
15543   proto_tree_add_uint(umrs_tree, hf_ieee80211_he_umrs_he_tb_ppdu_len, tvb,
15544                         offset, 4, the_bits);
15545   proto_tree_add_uint(umrs_tree, hf_ieee80211_he_umrs_ru_allocation, tvb,
15546                         offset, 4, the_bits);
15547   proto_tree_add_uint(umrs_tree, hf_ieee80211_he_dl_tx_power, tvb,
15548                         offset, 4, the_bits);
15549   proto_tree_add_uint(umrs_tree, hf_ieee80211_he_ul_target_rssi, tvb,
15550                         offset, 4, the_bits);
15551   proto_tree_add_uint(umrs_tree, hf_ieee80211_he_ul_mcs, tvb,
15552                         offset, 4, the_bits);
15553   proto_tree_add_uint(umrs_tree, hf_ieee80211_he_ul_reserved, tvb,
15554                         offset, 4, the_bits);
15555 }
15556
15557 static void
15558 dissect_a_control_om(proto_tree *tree, tvbuff_t *tvb, int offset,
15559   guint32 bits _U_, guint32 start_bit)
15560 {
15561   proto_tree *om_tree = NULL;
15562   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x000000FFF;
15563
15564   /*
15565    * We isolated the bits and moved them to the bottom ... so display them
15566    */
15567   om_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15568                                 ett_ieee80211_om_control,
15569                                 NULL, "OM Control: 0x%04x", the_bits);
15570
15571   proto_tree_add_uint(om_tree, hf_ieee80211_he_om_rx_nss, tvb,
15572                         offset, 4, the_bits);
15573   proto_tree_add_uint(om_tree, hf_ieee80211_he_om_channel_width, tvb,
15574                         offset, 4, the_bits);
15575   proto_tree_add_boolean(om_tree, hf_ieee80211_he_om_ul_mu_disable, tvb,
15576                         offset, 4, the_bits);
15577   proto_tree_add_uint(om_tree, hf_ieee80211_he_om_tx_nsts, tvb,
15578                         offset, 4, the_bits);
15579   proto_tree_add_uint(om_tree, hf_ieee80211_he_om_reserved, tvb,
15580                         offset, 4, the_bits);
15581 }
15582
15583 static void
15584 dissect_a_control_hla(proto_tree *tree, tvbuff_t *tvb, int offset,
15585   guint32 bits _U_, guint32 start_bit)
15586 {
15587   proto_tree *hla_tree = NULL;
15588   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
15589
15590   /*
15591    * We isolated the bits and moved them to the bottom ... so display them
15592    */
15593   hla_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15594                                 ett_ieee80211_hla_control,
15595                                 NULL, "HLA Control: 0x%08x", the_bits);
15596
15597   proto_tree_add_boolean(hla_tree, hf_ieee80211_he_hla_unsolicited_mfb, tvb,
15598                         offset, 4, the_bits);
15599   proto_tree_add_boolean(hla_tree, hf_ieee80211_he_hla_mrq, tvb,
15600                         offset, 4, the_bits);
15601   proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_nss, tvb,
15602                         offset, 4, the_bits);
15603   proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_he_mcs, tvb,
15604                         offset, 4, the_bits);
15605   proto_tree_add_boolean(hla_tree, hf_ieee80211_he_hla_dcm, tvb,
15606                         offset, 4, the_bits);
15607   proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_ru, tvb,
15608                         offset, 4, the_bits);
15609   proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_bw, tvb,
15610                         offset, 4, the_bits);
15611   proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_msi_ppdu_type, tvb,
15612                         offset, 4, the_bits);
15613   proto_tree_add_boolean(hla_tree, hf_ieee80211_he_hla_tx_bf, tvb,
15614                         offset, 4, the_bits);
15615   proto_tree_add_uint(hla_tree, hf_ieee80211_he_hla_reserved, tvb,
15616                         offset, 4, the_bits);
15617 }
15618
15619 static void
15620 dissect_a_control_bsr(proto_tree *tree, tvbuff_t *tvb, int offset,
15621   guint32 bits _U_, guint32 start_bit)
15622 {
15623   proto_tree *bsr_tree = NULL;
15624   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x03FFFFFF;
15625
15626   /*
15627    * We isolated the bits and moved them to the bottom ... so display them
15628    */
15629   bsr_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15630                                 ett_ieee80211_buffer_status_report,
15631                                 NULL, "Buffer Status Report: 0x%08x", the_bits);
15632
15633   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_aci_bitmap, tvb,
15634                         offset, 4, the_bits);
15635   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_delta_tid, tvb,
15636                         offset, 4, the_bits);
15637   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_aci_high, tvb,
15638                         offset, 4, the_bits);
15639   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_scaling_factor, tvb,
15640                         offset, 4, the_bits);
15641   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_queue_size_high, tvb,
15642                         offset, 4, the_bits);
15643   proto_tree_add_uint(bsr_tree, hf_ieee80211_he_bsr_queue_size_all, tvb,
15644                         offset, 4, the_bits);
15645 }
15646
15647 static void
15648 dissect_a_control_uph(proto_tree *tree, tvbuff_t *tvb, int offset,
15649   guint32 bits _U_, guint32 start_bit)
15650 {
15651   proto_tree *uph_tree = NULL;
15652   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x000000FF;
15653
15654   /*
15655    * We isolated the bits and moved them to the bottom ... so display them
15656    */
15657   uph_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15658                                 ett_ieee80211_control_uph,
15659                                 NULL, "UPH Control: 0x%02x", the_bits);
15660
15661   proto_tree_add_uint(uph_tree, hf_ieee80211_he_uph_ul_power_headroom, tvb,
15662                         offset, 4, the_bits);
15663   proto_tree_add_boolean(uph_tree, hf_ieee80211_he_uph_ul_min_transmit_power_flag,
15664                         tvb, offset, 4, the_bits);
15665   proto_tree_add_uint(uph_tree, hf_ieee80211_he_uph_reserved,
15666                         tvb, offset, 4, the_bits);
15667 }
15668
15669 static void
15670 dissect_a_control_bqr(proto_tree *tree, tvbuff_t *tvb, int offset,
15671   guint32 bits _U_, guint32 start_bit)
15672 {
15673   proto_tree *bqr_tree = NULL;
15674   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x000003FF;
15675
15676   /*
15677    * We isolated the bits and moved them to the bottom ... so display them
15678    */
15679   bqr_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15680                                 ett_ieee80211_bqr_control,
15681                                 NULL, "BQR Control: 0x%04x", the_bits);
15682
15683   proto_tree_add_uint(bqr_tree, hf_ieee80211_he_btc_avail_chan, tvb,
15684                         offset, 4, the_bits);
15685   proto_tree_add_uint(bqr_tree, hf_ieee80211_he_btc_reserved, tvb,
15686                         offset, 4, the_bits);
15687 }
15688
15689 static void
15690 dissect_a_control_cci(proto_tree *tree, tvbuff_t *tvb, int offset,
15691   guint32 bits _U_, guint32 start_bit)
15692 {
15693   proto_tree *cci_tree = NULL;
15694   guint the_bits = (tvb_get_letohl(tvb, offset) >> start_bit) & 0x000000FF;
15695
15696   /*
15697    * We isolated the bits and moved them to the bottom ... so display them
15698    */
15699   cci_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
15700                                 ett_ieee80211_control_cci,
15701                                 NULL, "Command Control Indication: 0x%02x", the_bits);
15702
15703   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_ac_constraint, tvb,
15704                         offset, 4, the_bits);
15705   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_rdg_more_ppdu, tvb,
15706                         offset, 4, the_bits);
15707   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_sr_ppdu_indic, tvb,
15708                         offset, 4, the_bits);
15709   proto_tree_add_uint(cci_tree, hf_ieee80211_he_cci_reserved, tvb,
15710                         offset, 4, the_bits);
15711 }
15712
15713 static void
15714 dissect_ht_control(proto_tree *tree, tvbuff_t *tvb, int offset)
15715 {
15716   proto_item *ti;
15717   proto_tree *htc_tree, *lac_subtree, *mfb_subtree;
15718   guint32 htc;
15719
15720   htc = tvb_get_letohl(tvb, offset);
15721
15722   ti = proto_tree_add_item(tree, hf_ieee80211_htc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15723   htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
15724
15725   /* Check the HT vs. VHT bit. */
15726   proto_tree_add_item(htc_tree, hf_ieee80211_htc_vht, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15727   if (htc & HTC_VHT) {
15728     /* VHT or HE */
15729     proto_tree_add_item(htc_tree, hf_ieee80211_htc_he, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15730     if (htc & HTC_HE) {
15731       /*
15732        * We have a 30-bit field, of which the first is a 4-bit Control ID which
15733        * determines how the rest is handled. There can be multiple fields.
15734        */
15735       proto_tree *a_control_tree = NULL;
15736       proto_item *pi = NULL;
15737       guint8 start_bit_offset = 2;
15738
15739       a_control_tree = proto_tree_add_subtree_format(htc_tree, tvb, offset, 4,
15740                                 ett_htc_he_a_control, NULL,
15741                                 "Aggregate Control: 0x%0x", htc >> 2);
15742       while (start_bit_offset < 32) {
15743         guint8 control_id = (htc >> start_bit_offset) & 0x0F;
15744         start_bit_offset += 4;
15745         pi = proto_tree_add_uint(a_control_tree, hf_ieee80211_htc_he_ctrl_id,
15746                         tvb, offset, 4, control_id);
15747         proto_item_append_text(pi, ": %s",
15748                         val_to_str(control_id, a_control_control_id_vals,
15749                                         "Reserved (%u)"));
15750         switch (control_id) {
15751         case A_CONTROL_UMRS:
15752           dissect_a_control_umrs(a_control_tree, tvb, offset, htc, start_bit_offset);
15753           start_bit_offset += 26;
15754           break;
15755         case A_CONTROL_OM:
15756           dissect_a_control_om(a_control_tree, tvb, offset, htc, start_bit_offset);
15757           start_bit_offset += 12;
15758           break;
15759         case A_CONTROL_HLA:
15760           dissect_a_control_hla(a_control_tree, tvb, offset, htc, start_bit_offset);
15761           start_bit_offset += 26;
15762           break;
15763         case A_CONTROL_BSR:
15764           dissect_a_control_bsr(a_control_tree, tvb, offset, htc, start_bit_offset);
15765           start_bit_offset += 26;
15766           break;
15767         case A_CONTROL_UPH:
15768           dissect_a_control_uph(a_control_tree, tvb, offset, htc, start_bit_offset);
15769           start_bit_offset += 8;
15770           break;
15771         case A_CONTROL_BQR:
15772         case A_CONTROL_BQR_REV:
15773           dissect_a_control_bqr(a_control_tree, tvb, offset, htc, start_bit_offset);
15774           start_bit_offset += 10;
15775           break;
15776         case A_CONTROL_CCI:
15777           dissect_a_control_cci(a_control_tree, tvb, offset, htc, start_bit_offset);
15778           start_bit_offset += 8;
15779           break;
15780         default:
15781           /* Add an expert info ... */
15782           start_bit_offset += 32;  /* Abandon */
15783           break;
15784         }
15785       }
15786     } else {
15787       proto_tree_add_item(htc_tree, hf_ieee80211_htc_mrq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15788       if (!(htc & HTC_UNSOLICITED_MFB)) {
15789         if (htc & HTC_MRQ) {
15790           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15791         } else {
15792           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15793         }
15794         proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfsi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15795       } else {
15796         if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
15797           proto_tree_add_item(htc_tree, hf_ieee80211_htc_compressed_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15798           proto_tree_add_item(htc_tree, hf_ieee80211_htc_ppdu_stbc_encoded, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15799         } else {
15800           proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15801         }
15802         proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_l, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15803       }
15804       ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15805       mfb_subtree = proto_item_add_subtree(ti, ett_mfb_subtree);
15806       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_num_sts, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15807       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_vht_mcs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15808       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_bw, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15809       /* This should be converted to dB by adding 22  */
15810       proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_snr, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15811       if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
15812         proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15813         proto_tree_add_item(htc_tree, hf_ieee80211_htc_coding_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15814         proto_tree_add_item(htc_tree, hf_ieee80211_htc_fb_tx_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15815       } else {
15816         proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15817       }
15818       proto_tree_add_item(htc_tree, hf_ieee80211_htc_unsolicited_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15819     }
15820   } else {
15821     /* Start: Link Adaptation Control */
15822     ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_ht_lac, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15823     lac_subtree = proto_item_add_subtree(ti, ett_lac_subtree);
15824     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_trq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15825
15826     if (HTC_IS_ASELI(htc)) {
15827       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_aseli, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15828     } else {
15829       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_mrq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15830       if (HTC_LAC_MAI_MRQ(htc)) {
15831         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_msi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15832       } else {
15833         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15834       }
15835     }
15836
15837     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15838
15839     if (HTC_IS_ASELI(htc)) {
15840       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15841       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_data, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15842     } else {
15843       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15844     }
15845     /* End: Link Adaptation Control */
15846
15847     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_pos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15848     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_seq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15849     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15850     proto_tree_add_item(htc_tree, hf_ieee80211_htc_csi_steering, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15851
15852     proto_tree_add_item(htc_tree, hf_ieee80211_htc_ndp_announcement, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15853     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15854   }
15855
15856   /*
15857    * These bits are part of the Aggregate Control field for 802.11ax
15858    */
15859   if (!(htc & HTC_HE)) {
15860     proto_tree_add_item(htc_tree, hf_ieee80211_htc_ac_constraint, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15861     proto_tree_add_item(htc_tree, hf_ieee80211_htc_rdg_more_ppdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15862   }
15863
15864   /* offset += 2; */
15865 }
15866
15867 #define IEEE80211_COMMON_OPT_BROKEN_FC         0x00000001
15868 #define IEEE80211_COMMON_OPT_IS_CENTRINO       0x00000002
15869 #define IEEE80211_COMMON_OPT_NORMAL_QOS        0x00000004
15870
15871 static void
15872 dissect_frame_control(proto_tree *tree, tvbuff_t *tvb, guint32 option_flags,
15873                       guint32 offset, packet_info *pinfo)
15874 {
15875   guint16 fcf, flags, frame_type_subtype;
15876   proto_tree *fc_tree, *flag_tree;
15877   proto_item *fc_item, *flag_item, *hidden_item, *ti;
15878
15879   fcf = FETCH_FCF(offset);
15880
15881   flags = FCF_FLAGS(fcf);
15882   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
15883
15884   /* Swap offset... */
15885   if(option_flags & IEEE80211_COMMON_OPT_BROKEN_FC)
15886   {
15887     offset += 1;
15888   }
15889
15890   proto_tree_add_uint(tree, hf_ieee80211_fc_frame_type_subtype, tvb, offset, 1, frame_type_subtype);
15891
15892   fc_item = proto_tree_add_item(tree, hf_ieee80211_fc_field, tvb, offset, 2, ENC_BIG_ENDIAN);
15893
15894   fc_tree = proto_item_add_subtree(fc_item, ett_fc_tree);
15895
15896   proto_tree_add_item(fc_tree, hf_ieee80211_fc_proto_version, tvb, offset, 1, ENC_NA);
15897   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_type, tvb, offset, 1, ENC_NA);
15898   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_subtype, tvb, offset, 1, ENC_NA);
15899   /* Changing control frame extension for extension frames */
15900   if(IS_FRAME_EXTENSION(fcf) == 1) {
15901     proto_tree_add_uint(fc_tree, hf_ieee80211_fc_frame_extension, tvb, offset, 1, FCF_FRAME_EXTENSION(fcf));
15902   }
15903   offset += 1;
15904
15905   /* Reswap offset...*/
15906   if(option_flags & IEEE80211_COMMON_OPT_BROKEN_FC)
15907   {
15908     offset -= 1;
15909     proto_item_append_text(fc_item, "(Swapped)");
15910   }
15911
15912   /* Flags */
15913   flag_item = proto_tree_add_item(fc_tree, hf_ieee80211_fc_flags, tvb, offset, 1, ENC_NA);
15914   flag_tree = proto_item_add_subtree(flag_item, ett_proto_flags);
15915   /* Changing control frame flags for extension frames */
15916   if(IS_FRAME_EXTENSION(fcf) == 0) {
15917     proto_tree_add_item(flag_tree, hf_ieee80211_fc_data_ds, tvb, offset, 1, ENC_NA);
15918     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_to_ds, tvb, offset, 1, ENC_NA);
15919     PROTO_ITEM_SET_HIDDEN(hidden_item);
15920     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_from_ds, tvb, offset, 1, ENC_NA);
15921     PROTO_ITEM_SET_HIDDEN(hidden_item);
15922     proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_frag, tvb, offset, 1, ENC_NA);
15923     ti = proto_tree_add_item(flag_tree, hf_ieee80211_fc_retry, tvb, offset, 1, ENC_NA);
15924     if( IS_RETRY(flags) )
15925     {
15926       expert_add_info(pinfo, ti, &ei_ieee80211_fc_retry);
15927       wlan_stats.fc_retry = 1;
15928     }
15929   }
15930   proto_tree_add_item(flag_tree, hf_ieee80211_fc_pwr_mgt, tvb, offset, 1, ENC_NA);
15931   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_data, tvb, offset, 1, ENC_NA);
15932   /* Changing control frame flags for extension frames */
15933   if(IS_FRAME_EXTENSION(fcf) == 0) {
15934     proto_tree_add_item(flag_tree, hf_ieee80211_fc_protected, tvb, offset, 1, ENC_NA);
15935   }
15936   proto_tree_add_item(flag_tree, hf_ieee80211_fc_order, tvb, offset, 1, ENC_NA);
15937 }
15938
15939 static void
15940 dissect_durid(proto_tree *hdr_tree, tvbuff_t *tvb, guint16 fts, gint offset)
15941 {
15942   guint16 durid = tvb_get_letohs(tvb, offset);
15943
15944   if (durid < 0x8000) {
15945     proto_tree_add_uint_format_value(hdr_tree, hf_ieee80211_did_duration, tvb,
15946       offset, 2, durid, "%u microseconds", durid);
15947   } else if (((durid & 0xC000) == 0xC000) &&
15948              ((durid & 0x3FFF) > 0) && ((durid & 0x3FFF) <= 2007) &&
15949              (fts == CTRL_PS_POLL)) {
15950     proto_tree_add_item(hdr_tree, hf_ieee80211_assoc_id, tvb, offset, 2,
15951       ENC_LITTLE_ENDIAN);
15952   } else if (durid == 0x8000) {
15953     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
15954       offset, 2, durid, "Duration/ID: %u", durid);
15955   } else {
15956     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
15957       offset, 2, durid, "Duration/ID: %u (reserved)", durid & 0x3FFF);
15958   }
15959 }
15960
15961
15962 static void
15963 dissect_vendor_ie_ht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
15964                     guint offset, proto_item *item, proto_item *ti_len, gint tag_len)
15965 {
15966
15967   guint8 type;
15968
15969   proto_tree_add_item(tree, hf_ieee80211_ht_pren_type, tvb, offset, 1, ENC_NA);
15970   type = tvb_get_guint8(tvb, offset);
15971   offset += 1;
15972   tag_len -= 1;
15973
15974
15975   switch(type){
15976     case 51:
15977       dissect_ht_capability_ie_common(tvb, pinfo, tree, offset, tag_len, ti_len, TRUE);
15978       proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
15979     break;
15980
15981     case 52:
15982       dissect_ht_info_ie_1_0(tvb, pinfo, tree, offset, tag_len, ti_len);
15983       proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
15984     break;
15985
15986     default:
15987       proto_tree_add_item(tree, hf_ieee80211_ht_pren_unknown, tvb, offset, tag_len, ENC_NA);
15988     break;
15989   }
15990
15991 }
15992
15993 static int
15994 dissect_interworking(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
15995 {
15996   int tag_len = tvb_reported_length(tvb);
15997   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
15998   int offset = 0;
15999   static const int *ieee80211_tag_interworking[] = {
16000     &hf_ieee80211_tag_interworking_access_network_type,
16001     &hf_ieee80211_tag_interworking_internet,
16002     &hf_ieee80211_tag_interworking_asra,
16003     &hf_ieee80211_tag_interworking_esr,
16004     &hf_ieee80211_tag_interworking_uesa,
16005     NULL
16006   };
16007
16008   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_interworking, ENC_LITTLE_ENDIAN);
16009   offset += 1;
16010
16011   if ((tag_len == (1 + 2)) || (tag_len == (1 + 2 + 6))) {
16012     dissect_venue_info(tree, tvb, offset);
16013     offset += 2;
16014   }
16015
16016   if ((tag_len == (1 + 6)) || (tag_len == (1 + 2 + 6))) {
16017     proto_tree_add_item(tree, hf_ieee80211_tag_interworking_hessid,
16018                         tvb, offset, 6, ENC_NA);
16019     offset += 6;
16020   }
16021
16022   if ((tag_len != 1) && (tag_len != (1 + 2)) && (tag_len != (1 + 6)) && (tag_len != (1 + 2 + 6))) {
16023     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16024                            "Invalid Interworking element length");
16025   }
16026
16027   return offset;
16028 }
16029
16030 static int
16031 dissect_qos_map_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16032 {
16033   int tag_len = tvb_reported_length(tvb);
16034   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16035   int offset = 0;
16036   guint8 left;
16037   guint8 val, val2;
16038   int i;
16039   proto_item *dscp_item, *item;
16040   proto_tree *dscp_tree;
16041
16042   if (tag_len < 16 || tag_len & 1) {
16043     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_bad_length,
16044                                 "Truncated QoS Map Set element");
16045     return tvb_captured_length(tvb);
16046   }
16047
16048   left = tag_len - 16;
16049   while (left >= 2) {
16050     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_dscp_exc,
16051                                     tvb, offset, 2, ENC_LITTLE_ENDIAN);
16052     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
16053
16054     item = proto_tree_add_item(dscp_tree,
16055                                hf_ieee80211_tag_qos_map_set_dscp_exc_val,
16056                                tvb, offset, 1, ENC_NA);
16057     val = tvb_get_guint8(tvb, offset);
16058     if (val > 63 && val != 255) {
16059       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
16060                                   "Invalid DSCP Value");
16061     }
16062     offset++;
16063
16064     item = proto_tree_add_item(dscp_tree,
16065                                hf_ieee80211_tag_qos_map_set_dscp_exc_up,
16066                                tvb, offset, 1, ENC_NA);
16067     val2 = tvb_get_guint8(tvb, offset);
16068     if (val2 > 7) {
16069       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
16070                                   "Invalid User Priority");
16071     }
16072     offset++;
16073
16074     proto_item_append_text(dscp_item, " (0x%02x: UP %u)", val, val2);
16075
16076     left -= 2;
16077   }
16078
16079   for (i = 0; i < 8; i++) {
16080     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_range,
16081                                     tvb, offset, 2, ENC_NA);
16082     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
16083
16084     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_low,
16085                                tvb, offset, 1, ENC_NA);
16086     val = tvb_get_guint8(tvb, offset);
16087     if (val > 63 && val != 255) {
16088       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
16089                                   "Invalid DSCP Value");
16090     }
16091     offset++;
16092
16093     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_high,
16094                                tvb, offset, 1, ENC_NA);
16095     val2 = tvb_get_guint8(tvb, offset);
16096     if ((val2 > 63 && val2 != 255) || val2 < val ||
16097         (val == 255 && val2 != 255) || (val != 255 && val2 == 255)) {
16098       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
16099                                   "Invalid DSCP Value");
16100     }
16101     offset++;
16102
16103     if (val == 255 && val2 == 255) {
16104       proto_item_append_text(dscp_item, " (UP %u not in use)", i);
16105     } else {
16106       proto_item_append_text(dscp_item, " (0x%02x-0x%02x: UP %u)",
16107                              val, val2, i);
16108     }
16109   }
16110
16111   return tvb_captured_length(tvb);
16112 }
16113
16114 static int
16115 dissect_roaming_consortium(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16116 {
16117   int tag_len = tvb_reported_length(tvb);
16118   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16119   int offset = 0;
16120   proto_item* item;
16121   guint8 oi_lens, oi1_len, oi2_len;
16122
16123   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
16124                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16125   offset += 1;
16126
16127   oi_lens = tvb_get_guint8(tvb, offset);
16128   oi1_len = oi_lens & 0x0f;
16129   oi2_len = (oi_lens & 0xf0) >> 4;
16130   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1_len,
16131                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16132   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2_len,
16133                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16134   offset += 1;
16135
16136   if (offset + oi1_len > tag_len) {
16137     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16138                            "Truncated Roaming Consortium element");
16139     return tvb_captured_length(tvb);
16140   }
16141
16142   item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1,
16143                              tvb, offset, oi1_len, ENC_NA);
16144   add_manuf(item, tvb, offset);
16145   offset += oi1_len;
16146
16147   if (offset + oi2_len > tag_len) {
16148     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16149                            "Truncated Roaming Consortium element");
16150     return tvb_captured_length(tvb);
16151   }
16152
16153   if (oi2_len > 0) {
16154     item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2,
16155                         tvb, offset, oi2_len, ENC_NA);
16156     add_manuf(item, tvb, offset);
16157     offset += oi2_len;
16158   }
16159
16160   if (tag_len > offset) {
16161     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi3,
16162                         tvb, offset, tag_len - offset, ENC_NA);
16163   }
16164
16165   return tvb_captured_length(tvb);
16166 }
16167
16168
16169 /* ************************************************************************* */
16170 /*           Dissect and add tagged (optional) fields to proto tree          */
16171 /* ************************************************************************* */
16172
16173 static int beacon_padding = 0; /* beacon padding bug */
16174
16175 static int
16176 ieee80211_tag_ssid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16177 {
16178   int tag_len = tvb_reported_length(tvb);
16179   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16180   int offset = 0;
16181   /* 7.3.2.1 SSID element (0) */
16182   gchar *ssid; /* The SSID may consist of arbitrary bytes */
16183   gint ssid_len = tag_len;
16184
16185   if (beacon_padding != 0) /* padding bug */
16186     return offset;
16187
16188   if (ssid_len > MAX_SSID_LEN) {
16189     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16190                            "SSID length (%u) greater than maximum (%u)",
16191                            ssid_len, MAX_SSID_LEN);
16192     ssid_len = MAX_SSID_LEN;
16193   }
16194
16195   /*
16196    * XXX - the 802.11 specs aren't particularly clear on how the SSID
16197    * is to be interpreted.
16198    *
16199    * IEEE Std 802.11-1999, section 7.3.2.2 "Service Set Identity (SSID)
16200    * element" says just
16201    *
16202    *    The length of the SSID information field is between 0 and 32
16203    *    octets. A 0 length information field indicates the broadcast SSID.
16204    *
16205    * with no indication that those octets encode a string.
16206    *
16207    * IEEE Std 802.11-2012, section 8.4.2.2 "SSID element", says that *but*
16208    * says after it
16209    *
16210    *    When the UTF-8 SSID subfield of the Extended Capabilities element
16211    *    is equal to 1 in the frame that includes the SSID element, the
16212    *    SSID is interpreted using UTF-8 encoding.
16213    *
16214    *    NOTE -- This is true for Beacon and Probe Response frames when the
16215    *    MLME-START.request primitive was issued with the SSIDEncoding
16216    *    parameter equal to UTF-8.
16217    *
16218    * and the SSIDEncoding parameter can either be UNSPECIFIED or UTF-8.
16219    *
16220    * So I *guess* that means that, if the UTF-8 SSID subfield isn't
16221    * equal to 1, the SSID is, in theory, just a bunch of octets, but
16222    * in practice, *probably* ASCII as that's the typical convention,
16223    * and, if it is equal to 1, it's a UTF-8 string.  (Of course, a
16224    * host can put anything there it wants to, so we shouldn't just
16225    * assume that it's *valid* ASCII or *valid* UTF-8.)
16226    *
16227    * So we really should extract it as an array of ssid_len bytes,
16228    * pass those bytes to Dot11DecryptSetLastSSID(), and:
16229    *
16230    *    If the UTF-8 SSID subfield isn't set to 1, put the SSID in
16231    *    as an ENC_ASCII string;
16232    *
16233    *    If the UTF-8 SSID subfield is set to 1, put it in as an
16234    *    ENC_UTF_8 string;
16235    *
16236    * and rely on the libwireshark core code to somehow deal with
16237    * non-ASCII characters or invalid UTF-8 sequences or valid-but-
16238    * not-all-printable ASCII or UTF-8 strings in the protocol tree
16239    * display.  I'm not sure we can currently rely on it to handle
16240    * invalid UTF-8 or non-printable characters in UTF-8 strings,
16241    * however, so we just treat it as ASCII for now.
16242    *
16243    * We also need a better way of getting the display format of a
16244    * string value, so we can do something other than run it through
16245    * format_text(), which won't handle UTF-8.
16246    *
16247    * Addendum: 802.11 2012 points out that a Zero-length SSID means
16248    * the Wildcard SSID. Make it so. From 8.4.2.2 of 802.11 2012:
16249    *
16250    * "The length of the SSID field is between 0 and 32 octets. A SSID
16251    *  field of length 0 is used within Probe Request management frames to
16252    *  indicate the wildcard SSID. The wildcard SSID is also used in
16253    *  Beacon and Probe Response frames transmitted by mesh STAs."
16254    *
16255    * Also, we have to return a non-zero value here to prevent an ugly
16256    * undissected field warning. Since this code is only called from
16257    * one place and is used in call to dissector_try_uint_new, it is
16258    * OK to do so.
16259    */
16260   ssid = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, ssid_len, ENC_ASCII);
16261   if (ssid_len == (gint)tag_len) {
16262     Dot11DecryptSetLastSSID(&dot11decrypt_ctx, (CHAR *) ssid, ssid_len);
16263   }
16264   proto_tree_add_item(tree, hf_ieee80211_tag_ssid, tvb, offset, tag_len,
16265                       ENC_ASCII|ENC_NA);
16266
16267   if (ssid_len > 0) {
16268     gchar* s = format_text(wmem_packet_scope(), ssid, ssid_len);
16269     proto_item_append_text(field_data->item_tag, ": %s", s);
16270
16271     col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", s);
16272
16273     /* Wlan Stats */
16274     memcpy(wlan_stats.ssid, ssid, MIN(ssid_len, MAX_SSID_LEN));
16275     wlan_stats.ssid_len = ssid_len;
16276   } else {
16277     proto_item_append_text(field_data->item_tag, ": Wildcard SSID");
16278
16279     col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Wildcard (Broadcast)");
16280     offset += 1; // Make sure we return non-zero
16281   }
16282
16283   beacon_padding += 1; /* padding bug */
16284
16285   return offset + tag_len;
16286 }
16287
16288 static void
16289 dissect_he_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
16290   int offset, int len);
16291
16292 static void
16293 dissect_he_operation(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
16294   int offset, int len _U_);
16295
16296 static int
16297 dissect_neighbor_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16298 {
16299   int tag_len = tvb_reported_length(tvb);
16300   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16301   int offset = 0;
16302   guint8 sub_tag_id;
16303   guint32 sub_tag_length;
16304   proto_item *parent_item;
16305   proto_tree *bssid_info_subtree, *bssid_info_cap_subtree, *sub_tag_tree;
16306   tvbuff_t *sub_tag_tvb = NULL;
16307
16308   if (tag_len < 13) {
16309     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16310                            "Neighbor Report length %u wrong, must be > 13", tag_len);
16311     return tvb_captured_length(tvb);
16312   }
16313
16314   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid, tvb, offset, 6, ENC_NA);
16315   offset += 6;
16316
16317   /*** Begin: BSSID Information ***/
16318
16319   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid_info, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16320   bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
16321
16322   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reachability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16323   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_security, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16324   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16325   parent_item = proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16326   bssid_info_cap_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_capability_tree);
16327   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16328   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16329   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16330   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16331   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16332   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16333   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16334   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16335   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_very_high_throughput, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16336   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_ftm, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16337   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_efficiency, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16338   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_er_bss, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16339   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16340   offset += 4;
16341
16342   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_ope_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16343   offset += 1;
16344
16345   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16346   offset += 1;
16347
16348   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16349   offset += 1;
16350
16351   /* The Optional Subelements field format contains zero or more subelements */
16352   if (tag_len == 13){ /* tag_len == 13 => no Subelements */
16353     return tvb_captured_length(tvb);
16354   }
16355
16356   while (offset < tag_len)
16357   {
16358
16359     sub_tag_id = tvb_get_guint8(tvb, offset);
16360     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16361     offset += 1;
16362
16363     sub_tag_length = tvb_get_guint8(tvb, offset);
16364     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16365     offset += 1;
16366     sub_tag_tvb = tvb_new_subset_length(tvb, offset, sub_tag_length);
16367
16368     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_data, tvb, offset, sub_tag_length, ENC_NA);
16369
16370     switch (sub_tag_id) {
16371       case NR_SUB_ID_TSF_INFO:
16372         /* TODO */
16373         break;
16374       case NR_SUB_ID_MEASUREMENT_PILOT_INFO:
16375         /* TODO */
16376         break;
16377       case NR_SUB_ID_BSS_TRN_CAN_PREF:
16378         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_trn_can_pref, tvb, offset, 1, ENC_NA);
16379         break;
16380       case NR_SUB_ID_BSS_TER_DUR:
16381         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_ter_tsf, tvb, offset, 8, ENC_NA);
16382
16383         proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_bss_dur, tvb, offset+8, 2, ENC_NA);
16384         break;
16385       case NR_SUB_ID_HT_CAPABILITIES:
16386         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16387                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Capabilities");
16388         dissect_ht_capability_ie_common(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, field_data->item_tag_length, FALSE);
16389         break;
16390       case NR_SUB_ID_HT_OPERATION:
16391         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16392                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Information");
16393         dissect_ht_info_ie_1_1(sub_tag_tvb, pinfo, sub_tag_tree, data);
16394         break;
16395       case NR_SUB_ID_SEC_CHANNEL_OFFSET:
16396         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16397                             ett_tag_neighbor_report_sub_tag_tree, NULL, "Secondary Channel Offset");
16398         dissect_secondary_channel_offset_ie(sub_tag_tvb, pinfo, sub_tag_tree, data);
16399         break;
16400       case NR_SUB_ID_HE_CAPABILITIES:
16401         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16402                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HE Capabilities");
16403         dissect_he_capabilities(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length);
16404         break;
16405       case NR_SUB_ID_HE_OPERATION:
16406         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
16407                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HE Operation");
16408         dissect_he_operation(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length);
16409         break;
16410       case NR_SUB_ID_VENDOR_SPECIFIC:
16411       default:
16412         break;
16413     }
16414
16415     offset += sub_tag_length;
16416   }
16417
16418   return offset;
16419 }
16420
16421 static int
16422 ieee80211_tag_supp_rates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16423 {
16424   int tag_len = tvb_reported_length(tvb);
16425   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16426   int offset = 0;
16427   /* 7.3.2.2 Supported Rates element (1) */
16428   if (tag_len < 1) {
16429     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16430                            "Tag length %u too short, must be greater than 0",
16431                            tag_len);
16432     return offset;
16433   }
16434
16435   while (offset < tag_len) {
16436     proto_tree_add_item(tree, hf_ieee80211_tag_supp_rates, tvb, offset, 1,
16437                         ENC_LITTLE_ENDIAN);
16438     proto_item_append_text(field_data->item_tag, " %s,",
16439                            val_to_str_ext_const(tvb_get_guint8(tvb, offset),
16440                                                 &ieee80211_supported_rates_vals_ext,
16441                                                 "Unknown Rate"));
16442     offset += 1;
16443   }
16444
16445   proto_item_append_text(field_data->item_tag, " [Mbit/sec]");
16446
16447   return offset;
16448 }
16449
16450 static int
16451 ieee80211_tag_fh_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16452 {
16453   int tag_len = tvb_reported_length(tvb);
16454   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16455   int offset = 0;
16456   /* 7.3.2.3 FH Parameter Set element (2) */
16457   if (tag_len < 5) {
16458     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16459                            "Tag length %u too short, must be >= 5", tag_len);
16460     return 1;
16461   }
16462
16463   proto_tree_add_item(tree, hf_ieee80211_tag_fh_dwell_time,
16464                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
16465   offset += 2;
16466
16467   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_set,
16468                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16469   offset += 1;
16470
16471   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_pattern,
16472                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16473   offset += 1;
16474
16475   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_index,
16476                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16477   offset += 1;
16478
16479   return offset;
16480 }
16481
16482 static int
16483 ieee80211_tag_ds_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16484 {
16485   int tag_len = tvb_reported_length(tvb);
16486   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16487   int offset = 0;
16488   /* 7.3.2.4 DS Parameter Set element (3) */
16489   if (tag_len != 1) {
16490     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16491         "Tag length %u wrong, must be = 1", tag_len);
16492     return 1;
16493   }
16494
16495   proto_tree_add_item(tree, hf_ieee80211_tag_ds_param_channel,
16496         tvb, offset, 1, ENC_LITTLE_ENDIAN);
16497
16498   proto_item_append_text(field_data->item_tag, ": Current Channel: %u",
16499                          tvb_get_guint8(tvb, offset));
16500
16501   wlan_stats.channel = tvb_get_guint8(tvb, offset);
16502   offset += 1;
16503
16504   return offset;
16505 }
16506
16507 static int
16508 ieee80211_tag_cf_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16509 {
16510   int tag_len = tvb_reported_length(tvb);
16511   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16512   int offset = 0;
16513   /* 7.3.2.5 CF Parameter Set element (4) */
16514   if (tag_len != 6) {
16515     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16516                            "Tag length %u wrong, must be = 6", tag_len);
16517     return offset;
16518   }
16519
16520   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_count,
16521                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16522   proto_item_append_text(field_data->item_tag, ": CFP count %u", tvb_get_guint8(tvb, offset));
16523   offset += 1;
16524
16525   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_period,
16526                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16527   proto_item_append_text(field_data->item_tag, ": CFP Period %u", tvb_get_guint8(tvb, offset));
16528   offset += 1;
16529
16530   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_max_duration,
16531                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
16532   proto_item_append_text(field_data->item_tag, ": CFP Max Duration %u",
16533                          tvb_get_letohs(tvb, offset));
16534   offset += 2;
16535
16536   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_dur_remaining,
16537                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
16538   proto_item_append_text(field_data->item_tag, ": CFP Dur Remaining %u",
16539                          tvb_get_letohs(tvb, offset));
16540   offset += 1;
16541
16542   return offset;
16543 }
16544
16545 static int
16546 ieee80211_tag_tim(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   guint aid, pvb_len, n1, i, j, byte;
16552   static const int *ieee80211_tim_bmapctl[] = {
16553     &hf_ieee80211_tim_bmapctl_mcast,
16554     &hf_ieee80211_tim_bmapctl_offset,
16555     NULL
16556   };
16557
16558   /* 802.11-2012: 8.4.2.7 TIM element (5) */
16559   if (tag_len < 4) {
16560     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16561                            "Tag length %u too short, must be >= 4", tag_len);
16562     return 1;
16563   }
16564
16565   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_count,
16566                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16567   proto_item_append_text(field_data->item_tag, ": DTIM %u of", tvb_get_guint8(tvb, offset));
16568   offset += 1;
16569
16570   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_period,
16571                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16572   proto_item_append_text(field_data->item_tag, " %u bitmap", tvb_get_guint8(tvb, offset + 1));
16573   offset += 1;
16574
16575   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tim_bmapctl,
16576                                     ett_tag_bmapctl_tree, ieee80211_tim_bmapctl,
16577                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
16578   pvb_len = tag_len - 3;
16579   n1 = tvb_get_guint8(tvb, offset) & 0xFE;
16580   offset += 1;
16581
16582   proto_tree_add_item(tree, hf_ieee80211_tim_partial_virtual_bitmap,
16583                       tvb, offset, pvb_len, ENC_NA);
16584   /* FIXME: Handles dot11MgmtOptionMultiBSSIDActivated = false only */
16585   for (i = 0; i < pvb_len; i++) {
16586     byte = tvb_get_guint8(tvb, offset + i);
16587     for (j = 0; j < 8; j++) {
16588       if (byte & (1 << j)) {
16589         aid = 8*n1 + 8*i + j;
16590         proto_tree_add_uint(tree, hf_ieee80211_tim_aid, tvb, offset + i, 1, aid);
16591       }
16592     }
16593   }
16594   offset += pvb_len;
16595
16596   return offset;
16597 }
16598
16599 static int
16600 ieee80211_tag_ibss_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16601 {
16602   int tag_len = tvb_reported_length(tvb);
16603   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16604   int offset = 0;
16605   /* 7.3.2.7 IBSS Parameter Set element (6) */
16606
16607   if (tag_len != 2) {
16608     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16609                            "Tag length %u wrong, must be = 2", tag_len);
16610     return 1;
16611   }
16612
16613   proto_tree_add_item(tree, hf_ieee80211_tag_ibss_atim_window,
16614                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
16615   proto_item_append_text(field_data->item_tag, ": ATIM window 0x%x",
16616                          tvb_get_letohs(tvb, offset));
16617   offset += 2;
16618
16619   return offset;
16620 }
16621
16622 static const value_string environment_vals[] = {
16623   { 0x20, "Any" },
16624   { 0x4f, "Outdoor" },
16625   { 0x49, "Indoor" },
16626   { 0,    NULL }
16627 };
16628
16629 static int
16630 ieee80211_tag_country_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16631 {
16632   int tag_len = tvb_reported_length(tvb);
16633   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16634   int offset = 0;
16635   /* 7.3.2.9 Country information element (7) */
16636   proto_tree *sub_tree;
16637   proto_item *sub_item;
16638   const guint8* country_code;
16639
16640   if (tag_len < 6) {
16641     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16642                            "Tag length %u too short, must be >= 6", tag_len);
16643     return 1;
16644   }
16645
16646   proto_tree_add_item_ret_string(tree, hf_ieee80211_tag_country_info_code,
16647                       tvb, offset, 2, ENC_ASCII|ENC_NA, wmem_packet_scope(), &country_code);
16648   proto_item_append_text(field_data->item_tag, ": Country Code %s", country_code);
16649   offset += 2;
16650
16651   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_env,
16652                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16653   proto_item_append_text(field_data->item_tag, ", Environment %s",
16654                          val_to_str(tvb_get_guint8(tvb, offset),
16655                                     environment_vals, "Unknown (0x%02x)"));
16656   offset += 1;
16657
16658   while (offset < tag_len) {
16659     /* Padding ? */
16660     if ((tag_len - offset) < 3) {
16661       proto_tree_add_item(tree, hf_ieee80211_tag_country_info_pad,
16662                           tvb, offset, 1, ENC_NA);
16663       offset += 1;
16664       continue;
16665     }
16666     if (tvb_get_guint8(tvb, offset) <= 200) { /* 802.11d */
16667       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_fnm,
16668                                      tvb, offset, 3, ENC_NA);
16669       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_fnm_tree);
16670
16671       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_fcn,
16672                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16673       proto_item_append_text(sub_item, ": First Channel Number: %u",
16674                              tvb_get_guint8(tvb, offset));
16675       offset += 1;
16676       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_nc,
16677                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16678       proto_item_append_text(sub_item, ", Number of Channels: %u",
16679                              tvb_get_guint8(tvb, offset));
16680       offset += 1;
16681       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_mtpl,
16682                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16683       proto_item_append_text(sub_item,
16684                              ", Maximum Transmit Power Level: %d dBm",
16685                              tvb_get_guint8(tvb, offset));
16686       offset += 1;
16687     } else { /* 802.11j */
16688       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_rrc,
16689                                      tvb, offset, 3, ENC_NA);
16690       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_rcc_tree);
16691
16692       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oei,
16693                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16694       proto_item_append_text(sub_item,
16695                              ": Operating Extension Identifier: %u",
16696                              tvb_get_guint8(tvb, offset));
16697       offset += 1;
16698       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oc,
16699                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16700       proto_item_append_text(sub_item, ", Operating Class: %u",
16701                              tvb_get_guint8(tvb, offset));
16702       offset += 1;
16703       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_cc,
16704                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
16705       proto_item_append_text(sub_item, ", Coverage Class: %u",
16706                              tvb_get_guint8(tvb, offset));
16707       offset += 1;
16708     }
16709   }
16710
16711   return offset;
16712 }
16713
16714 static int
16715 ieee80211_tag_fh_hopping_parameter(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16716 {
16717   int tag_len = tvb_reported_length(tvb);
16718   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16719   int offset = 0;
16720
16721   /* 7.3.2.10 Hopping Pattern Parameters information element (8) */
16722   if (tag_len < 2) {
16723     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16724                            "Tag length %u too short, must be >= 2", tag_len);
16725     return 1;
16726   }
16727
16728   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
16729                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16730   proto_item_append_text(field_data->item_tag, ": Prime Radix: %u", tvb_get_guint8(tvb, offset));
16731   offset += 1;
16732
16733   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
16734                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16735   proto_item_append_text(field_data->item_tag, ", Number of Channels: %u",
16736                          tvb_get_guint8(tvb, offset));
16737   offset += 1;
16738
16739   return offset;
16740 }
16741
16742 static int
16743 ieee80211_tag_fh_hopping_table(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16744 {
16745   int tag_len = tvb_reported_length(tvb);
16746   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16747   int offset = 0;
16748
16749   /* 7.3.2.11 Hopping Pattern Table information element (9) */
16750   if (tag_len < 4) {
16751     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
16752                            "Tag length %u too short, must be >= 4", tag_len);
16753     return 1;
16754   }
16755
16756   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_flag,
16757                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16758   offset += 1;
16759
16760   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_number_of_sets,
16761                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16762   offset += 1;
16763
16764   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_modulus,
16765                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16766   offset += 1;
16767
16768   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_offset,
16769                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
16770   offset += 1;
16771
16772   while (offset < tag_len) {
16773     proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_random_table,
16774                         tvb, offset, 2, ENC_BIG_ENDIAN);
16775     offset += 2;
16776   }
16777
16778   return offset;
16779 }
16780
16781 int
16782 add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype,
16783                  const guint8 *valid_element_ids, guint valid_element_ids_count,
16784                  association_sanity_check_t *association_sanity_check)
16785 {
16786   tvbuff_t     *tag_tvb;
16787   guint32       tag_no, tag_len;
16788   guint32       ext_tag_no, ext_tag_len;
16789   proto_tree   *orig_tree = tree;
16790   proto_item   *ti        = NULL;
16791   proto_item   *ti_len, *ti_tag;
16792   ieee80211_tagged_field_data_t field_data;
16793   gboolean      isDMG;
16794
16795   isDMG = GPOINTER_TO_INT(p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY));
16796
16797   tag_no  = tvb_get_guint8(tvb, offset);
16798   tag_len = tvb_get_guint8(tvb, offset + 1);
16799
16800   if (tree) {
16801     if (tag_no == TAG_ELEMENT_ID_EXTENSION) {
16802       ext_tag_no  = tvb_get_guint8(tvb, offset + 2);
16803       ti = proto_tree_add_item(orig_tree, hf_ieee80211_ext_tag, tvb, offset + 2, tag_len , ENC_NA);
16804       proto_item_append_text(ti, ": %s", val_to_str_ext(ext_tag_no, &tag_num_vals_eid_ext_ext, "Reserved (%d)"));
16805     } else {
16806       ti = proto_tree_add_item(orig_tree, hf_ieee80211_tag, tvb, offset, 2 + tag_len , ENC_NA);
16807       proto_item_append_text(ti, ": %s", val_to_str_ext(tag_no, &tag_num_vals_ext, "Reserved (%d)"));
16808     }
16809
16810     tree = proto_item_add_subtree(ti, ett_80211_mgt_ie);
16811
16812   }
16813
16814   if (tag_no == TAG_ELEMENT_ID_EXTENSION) {
16815     ext_tag_len = tag_len - 1;
16816     ti_tag = proto_tree_add_item(tree, hf_ieee80211_ext_tag_number, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
16817     ti_len = proto_tree_add_uint(tree, hf_ieee80211_ext_tag_length, tvb, offset + 1, 1, ext_tag_len);
16818   } else {
16819     ti_tag = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16820     ti_len = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
16821   }
16822   if (tag_len > (guint)tvb_reported_length_remaining(tvb, offset)) {
16823     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
16824                            "Tag Length is longer than remaining payload");
16825   }
16826
16827   /* If the list of valid elements is restricted, require an Element ID to be
16828    * present in that list. Otherwise stop decoding the value to prevent possible
16829    * infinite recursions due to unexpected elements. */
16830   if (valid_element_ids_count) {
16831     gboolean valid_tag_no = FALSE;
16832     guint i;
16833
16834     for (i = 0; i < valid_element_ids_count; i++) {
16835       valid_tag_no = valid_element_ids[i] == tag_no;
16836       if (valid_tag_no)
16837         break;
16838     }
16839     if (!valid_tag_no) {
16840       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_number,
16841           "Unexpected Element ID %d", tag_no);
16842         return tag_len + 1 + 1;
16843     }
16844   }
16845
16846   tag_tvb = tvb_new_subset_length(tvb, offset+2, tag_len);
16847   field_data.sanity_check = association_sanity_check;
16848   field_data.ftype = ftype;
16849   field_data.isDMG = isDMG;
16850   field_data.item_tag = ti;
16851   field_data.item_tag_length = ti_len;
16852   if (!dissector_try_uint_new(tagged_field_table, tag_no, tag_tvb, pinfo, tree, FALSE, &field_data))
16853   {
16854       proto_tree_add_item(tree, hf_ieee80211_tag_data, tvb, offset + 1 + 1, tag_len, ENC_NA);
16855       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_data,
16856                              "Dissector for 802.11 IE Tag"
16857                              " (%s) code not implemented, Contact"
16858                              " Wireshark developers if you want this supported", val_to_str_ext(tag_no,
16859                                             &tag_num_vals_ext, "(%d)"));
16860       proto_item_append_text(ti, ": Undecoded");
16861   }
16862
16863   return tag_len + 1 + 1;
16864 }
16865
16866 /* 7.3.2.12 Request information element (10) */
16867 static int
16868 ieee80211_tag_request(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
16869 {
16870   int tag_len = tvb_reported_length(tvb);
16871   int offset = 0;
16872
16873   while (offset < tag_len)
16874   {
16875     proto_tree_add_item(tree, hf_ieee80211_tag_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
16876     offset += 1;
16877   }
16878   return ((tag_len > 0) ? tag_len : 1);
16879 }
16880
16881 /* 7.3.2.28 BSS Load element (11) */
16882 /* 8.4.2.30 in 802.11-2012 */
16883 static int
16884 ieee80211_tag_qbss_load(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16885 {
16886   int tag_len = tvb_reported_length(tvb);
16887   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16888   int offset = 0;
16889
16890   if ((tag_len < 4) || (tag_len > 5))
16891   {
16892     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);
16893     return tvb_captured_length(tvb);
16894   }
16895
16896   if (tag_len == 4)
16897   {
16898     /* QBSS Version 1 */
16899     proto_item_append_text(field_data->item_tag, " Cisco QBSS Version 1 - non CCA");
16900
16901     /* Extract Values */
16902     proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset, tag_len, 1);
16903     proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16904     proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
16905     proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
16906   }
16907   else if (tag_len == 5)
16908   {
16909     proto_item *base_item;
16910
16911     /* QBSS Version 2 */
16912     proto_item_append_text(field_data->item_tag, " 802.11e CCA Version");
16913
16914     /* Extract Values */
16915     proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset, tag_len, 2);
16916     proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16917     base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
16918     proto_item_append_text(base_item, " (%d%%)", 100*tvb_get_guint8(tvb, offset + 2)/255);
16919     base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 3, 2, ENC_LITTLE_ENDIAN);
16920     proto_item_append_text(base_item, " (%d us/s)", tvb_get_letohs(tvb, offset + 3)*32);
16921   }
16922
16923   return tvb_captured_length(tvb);
16924 }
16925
16926 /* 8.4.2.31 in 802-11-2012 */
16927 static int
16928 ieee80211_tag_edca_param_set(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16929 {
16930   int tag_len = tvb_reported_length(tvb);
16931   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16932   int offset = 0;
16933
16934   if ((tag_len != 18))
16935   {
16936     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 18", tag_len);
16937     return tvb_captured_length(tvb);
16938   }
16939
16940   decode_qos_parameter_set(tree, tvb, pinfo, offset, field_data->ftype);
16941
16942   return tvb_captured_length(tvb);
16943 }
16944
16945 /* TSPEC element (13) */
16946 static int
16947 ieee80211_tag_tspec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
16948 {
16949   int tag_len = tvb_reported_length(tvb);
16950   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
16951   int offset = 0;
16952
16953   if (field_data->isDMG == FALSE && tag_len != 55)
16954   {
16955     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 55", tag_len);
16956     return tvb_captured_length(tvb);
16957   }
16958   if (field_data->isDMG == TRUE && tag_len != 57)
16959   {
16960     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 57", tag_len);
16961     return tvb_captured_length(tvb);
16962   }
16963
16964   add_ff_qos_ts_info(tree, tvb, pinfo, offset);
16965   offset += 3;
16966
16967   proto_tree_add_item(tree, hf_ieee80211_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16968   offset += 2;
16969
16970   proto_tree_add_item(tree, hf_ieee80211_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16971   offset += 2;
16972
16973   proto_tree_add_item(tree, hf_ieee80211_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16974   offset += 4;
16975
16976   proto_tree_add_item(tree, hf_ieee80211_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16977   offset += 4;
16978
16979   proto_tree_add_item(tree, hf_ieee80211_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16980   offset += 4;
16981
16982   proto_tree_add_item(tree, hf_ieee80211_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16983   offset += 4;
16984
16985   proto_tree_add_item(tree, hf_ieee80211_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16986   offset += 4;
16987
16988   proto_tree_add_item(tree, hf_ieee80211_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16989   offset += 4;
16990
16991   proto_tree_add_item(tree, hf_ieee80211_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16992   offset += 4;
16993
16994   proto_tree_add_item(tree, hf_ieee80211_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16995   offset += 4;
16996
16997   proto_tree_add_item(tree, hf_ieee80211_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16998   offset += 4;
16999
17000   proto_tree_add_item(tree, hf_ieee80211_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17001   offset += 4;
17002
17003   proto_tree_add_item(tree, hf_ieee80211_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17004   offset += 4;
17005
17006   proto_tree_add_item(tree, hf_ieee80211_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17007   offset += 2;
17008
17009   proto_tree_add_item(tree, hf_ieee80211_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17010   offset += 2;
17011
17012   if(field_data->isDMG == TRUE) {
17013     proto_tree_add_item(tree, hf_ieee80211_tspec_dmg, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17014     /*offset +=2;*/
17015   }
17016
17017   return tvb_captured_length(tvb);
17018 }
17019
17020 /* 7.3.2.31 TCLAS element (14) */
17021 static int
17022 ieee80211_tag_tclas(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17023 {
17024   int tag_len = tvb_reported_length(tvb);
17025   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17026   int offset = 0;
17027   guint8 type;
17028   guint8 version;
17029   static const int *ieee80211_tclas_class_mask0[] = {
17030     &hf_ieee80211_tclas_class_mask0_src_addr,
17031     &hf_ieee80211_tclas_class_mask0_dst_addr,
17032     &hf_ieee80211_tclas_class_mask0_type,
17033     NULL
17034   };
17035
17036   static const int *ieee80211_tclas_class_mask1[] = {
17037     &hf_ieee80211_tclas_class_mask1_ver,
17038     &hf_ieee80211_tclas_class_mask1_src_ip,
17039     &hf_ieee80211_tclas_class_mask1_dst_ip,
17040     &hf_ieee80211_tclas_class_mask1_src_port,
17041     &hf_ieee80211_tclas_class_mask1_dst_port,
17042     &hf_ieee80211_tclas_class_mask1_ipv6_flow,
17043     NULL
17044   };
17045
17046   static const int *ieee80211_tclas_class_mask1_4[] = {
17047     &hf_ieee80211_tclas_class_mask1_ver,
17048     &hf_ieee80211_tclas_class_mask1_src_ip,
17049     &hf_ieee80211_tclas_class_mask1_dst_ip,
17050     &hf_ieee80211_tclas_class_mask1_src_port,
17051     &hf_ieee80211_tclas_class_mask1_dst_port,
17052     &hf_ieee80211_tclas_class_mask1_ipv4_dscp,
17053     &hf_ieee80211_tclas_class_mask1_ipv4_proto,
17054     NULL
17055   };
17056
17057   static const int *ieee80211_tclas_class_mask2[] = {
17058     &hf_ieee80211_tclas_class_mask2_tci,
17059     NULL
17060   };
17061
17062   if (tag_len < 5)
17063   {
17064     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 5", tag_len);
17065     return 1;
17066   }
17067
17068   proto_tree_add_item(tree, hf_ieee80211_tclas_up, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17069   offset += 1;
17070
17071   type = tvb_get_guint8(tvb, offset);
17072   proto_tree_add_item(tree, hf_ieee80211_tclas_class_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17073   offset += 1;
17074
17075   switch (type)
17076   {
17077   case 0:
17078     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
17079                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask0,
17080                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17081     offset++;
17082
17083     proto_tree_add_item(tree, hf_ieee80211_tclas_src_mac_addr, tvb, offset, 6, ENC_NA);
17084     offset += 6;
17085
17086     proto_tree_add_item(tree, hf_ieee80211_tclas_dst_mac_addr, tvb, offset, 6, ENC_NA);
17087     offset += 6;
17088
17089     proto_tree_add_item(tree, hf_ieee80211_tclas_ether_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17090     /*offset += 2;*/
17091     break;
17092
17093   case 1:
17094     version = tvb_get_guint8(tvb, offset+1);
17095     if (version == 4) {
17096       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
17097                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask1_4,
17098                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17099     } else {
17100       proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
17101                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask1,
17102                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17103     }
17104     offset += 1;
17105
17106     proto_tree_add_item(tree, hf_ieee80211_tclas_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17107     offset += 1;
17108     if (version == 4)
17109     {
17110       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
17111       offset += 4;
17112       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
17113       offset += 4;
17114       proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
17115       offset += 2;
17116       proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
17117       offset += 2;
17118       proto_tree_add_item(tree, hf_ieee80211_tclas_dscp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17119       offset += 1;
17120       proto_tree_add_item(tree, hf_ieee80211_tclas_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17121       /*offset += 1;*/
17122     }
17123     else if (version == 6)
17124     {
17125       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_src, tvb, offset, 16, ENC_NA);
17126       offset += 16;
17127       proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_dst, tvb, offset, 16, ENC_NA);
17128       offset += 16;
17129       proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
17130       offset += 2;
17131       proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
17132       offset += 2;
17133       proto_tree_add_item(tree, hf_ieee80211_tclas_flow, tvb, offset, 3, ENC_BIG_ENDIAN);
17134       /*offset += 3;*/
17135     }
17136     break;
17137
17138   case 2:
17139     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tclas_class_mask,
17140                                     ett_tag_tclas_mask_tree, ieee80211_tclas_class_mask2,
17141                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17142     offset++;
17143
17144     proto_tree_add_item(tree, hf_ieee80211_tclas_tag_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17145     /*offset += 2;*/
17146     break;
17147
17148   default:
17149     break;
17150   }
17151
17152   return tvb_captured_length(tvb);
17153 }
17154
17155 /* 7.3.2.34 Schedule element (15) */
17156 static int
17157 ieee80211_tag_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17158 {
17159   int tag_len = tvb_reported_length(tvb);
17160   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17161   int offset = 0;
17162   if (tag_len != 14)
17163   {
17164     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 14", tag_len);
17165     return 1;
17166   }
17167
17168   add_ff_schedule_info(tree, tvb, pinfo, offset);
17169   offset += 2;
17170
17171   proto_tree_add_item(tree, hf_ieee80211_sched_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17172   offset += 4;
17173
17174   proto_tree_add_item(tree, hf_ieee80211_sched_srv_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17175   offset += 4;
17176
17177   proto_tree_add_item(tree, hf_ieee80211_sched_spec_int, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17178   return tvb_captured_length(tvb);
17179 }
17180
17181 /* 7.3.2.8 Challenge Text element (16) */
17182 static int
17183 ieee80211_tag_challenge_text(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
17184 {
17185   int tag_len = tvb_reported_length(tvb);
17186   int offset = 0;
17187
17188   proto_tree_add_item(tree, hf_ieee80211_tag_challenge_text, tvb, offset, tag_len, ENC_NA);
17189
17190   return ((tag_len > 0) ? tag_len : 1);
17191 }
17192
17193 /* 7.3.2.15 Power Constraint element (32) */
17194 static int
17195 ieee80211_tag_power_constraint(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17196 {
17197   int tag_len = tvb_reported_length(tvb);
17198   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17199   int offset = 0;
17200   if (tag_len != 1)
17201   {
17202     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
17203     return 1;
17204   }
17205
17206   proto_tree_add_item(tree, hf_ieee80211_tag_power_constraint_local, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17207   proto_item_append_text(field_data->item_tag, ": %d", tvb_get_guint8(tvb, offset));
17208   return tvb_captured_length(tvb);
17209 }
17210
17211 /* 7.3.2.16 Power Capability element (33) */
17212 static int
17213 ieee80211_tag_power_capability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17214 {
17215   int tag_len = tvb_reported_length(tvb);
17216   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17217   int offset = 0;
17218   if (tag_len != 2)
17219   {
17220     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
17221     return 1;
17222   }
17223
17224   proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_min, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17225   proto_item_append_text(field_data->item_tag, " Min: %d", tvb_get_gint8(tvb, offset));
17226   offset += 1;
17227
17228   proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_max, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17229   proto_item_append_text(field_data->item_tag, ", Max: %d", tvb_get_gint8(tvb, offset));
17230   return tvb_captured_length(tvb);
17231 }
17232
17233 /* 7.3.2.18 TPC Request element (34) */
17234 static int
17235 ieee80211_tag_tpc_request(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, void* data)
17236 {
17237   int tag_len = tvb_reported_length(tvb);
17238   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17239   if (tag_len != 0)
17240   {
17241     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 0", tag_len);
17242     return 1; /* Even with no data, we can't return 0 */
17243   }
17244
17245   return 1; /* Even with no data, we can't return 0 */
17246 }
17247
17248 /* 7.3.2.18 TPC Report element (35) */
17249 static int
17250 ieee80211_tag_tpc_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17251 {
17252   int tag_len = tvb_reported_length(tvb);
17253   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17254   int offset = 0;
17255
17256   if (tag_len != 2)
17257   {
17258     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
17259     return 1;
17260   }
17261
17262   proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_trsmt_pow, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17263   proto_item_append_text(field_data->item_tag, " Transmit Power: %d", tvb_get_guint8(tvb, offset));
17264   offset += 1;
17265
17266   proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_link_mrg, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17267   proto_item_append_text(field_data->item_tag, ", Link Margin: %d", tvb_get_guint8(tvb, offset));
17268   return tvb_captured_length(tvb);
17269 }
17270
17271 /* 7.3.2.19 Supported Channels element (36) */
17272 static int
17273 ieee80211_tag_supported_channels(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17274 {
17275   int tag_len = tvb_reported_length(tvb);
17276   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17277   int offset = 0;
17278
17279   proto_item *chan_item;
17280   proto_tree *chan_tree;
17281   guint       i = 1;
17282
17283   if (tag_len % 2 == 1) {
17284     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u must be even", tag_len);
17285     return tvb_captured_length(tvb);
17286   }
17287
17288   while (offset < tag_len)
17289   {
17290     chan_item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_channels, tvb, offset, 2, ENC_NA);
17291     proto_item_append_text(chan_item, " #%d", i);
17292     i += 1;
17293
17294     chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
17295
17296     proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_first, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17297     proto_item_append_text(chan_item, " First: %d", tvb_get_guint8(tvb, offset));
17298     offset += 1;
17299
17300     proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_range, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17301     proto_item_append_text(chan_item, ", Range: %d ", tvb_get_guint8(tvb, offset));
17302     offset += 1;
17303
17304   }
17305   return tvb_captured_length(tvb);
17306 }
17307
17308 /* 7.3.2.20 Channel Switch Announcement element (37) */
17309 static int
17310 ieee80211_tag_switch_ann(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17311 {
17312   int tag_len = tvb_reported_length(tvb);
17313   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17314   int offset = 0;
17315   if (tag_len != 3)
17316   {
17317     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 3", tag_len);
17318     return 1;
17319   }
17320
17321   proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17322   proto_item_append_text(field_data->item_tag, " Mode: %d", tvb_get_guint8(tvb, offset));
17323   offset += 1;
17324
17325   proto_tree_add_item(tree, hf_ieee80211_csa_new_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17326   proto_item_append_text(field_data->item_tag, ", Number: %d ", tvb_get_guint8(tvb, offset));
17327   offset += 1;
17328
17329   proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17330   proto_item_append_text(field_data->item_tag, ", Count: %d ", tvb_get_guint8(tvb, offset));
17331   return tvb_captured_length(tvb);
17332 }
17333
17334 /* 7.3.2.21 Measurement Request element (38) with update from 802.11k-2008 */
17335 static int
17336 ieee80211_tag_measure_req(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17337 {
17338   int tag_len = tvb_reported_length(tvb);
17339   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17340   int offset = 0;
17341   guint8 request_type;
17342   proto_item *parent_item;
17343   proto_tree *sub_tree;
17344   static const int *ieee80211_tag_measure_request_mode[] = {
17345     &hf_ieee80211_tag_measure_request_mode_parallel,
17346     &hf_ieee80211_tag_measure_request_mode_enable,
17347     &hf_ieee80211_tag_measure_request_mode_request,
17348     &hf_ieee80211_tag_measure_request_mode_report,
17349     &hf_ieee80211_tag_measure_request_mode_duration_mandatory,
17350     &hf_ieee80211_tag_measure_request_mode_reserved,
17351     NULL
17352   };
17353
17354   if (tag_len < 3)
17355   {
17356     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
17357     return tvb_captured_length(tvb);
17358   }
17359   proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_token, tvb, offset, 1, ENC_NA);
17360   offset += 1;
17361
17362   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_request_mode,
17363                                     ett_tag_measure_request_mode_tree, ieee80211_tag_measure_request_mode,
17364                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17365   offset += 1;
17366
17367   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_type, tvb, offset, 1, ENC_NA);
17368   sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_type_tree);
17369   request_type = tvb_get_guint8(tvb, offset);
17370   offset += 1;
17371
17372   switch (request_type) {
17373     case 0: /* Basic Request */
17374     case 1: /* Clear channel assessment (CCA) request */
17375     case 2: /* Receive power indication (RPI) histogram request */
17376     {
17377       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17378       offset += 1;
17379
17380       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17381       offset += 8;
17382
17383       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17384       offset += 2;
17385       break;
17386     }
17387     case 3: /* Channel Load Request */
17388     {
17389       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
17390       offset += 1;
17391
17392       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17393       offset += 1;
17394
17395       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17396       offset += 2;
17397
17398       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17399       offset += 2;
17400
17401       while (offset < tag_len)
17402       {
17403         guint8 sub_id;
17404         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_id, tvb, offset, 1, ENC_NA);
17405         sub_id = tvb_get_guint8(tvb, offset);
17406         offset += 1;
17407
17408         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
17409         offset += 1;
17410
17411         switch (sub_id) {
17412           case MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO: /* Channel Load Reporting Information (1) */
17413             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition, tvb, offset, 1, ENC_NA);
17414             offset += 1;
17415             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref, tvb, offset, 1, ENC_NA);
17416             offset += 1;
17417             break;
17418           default:
17419             /* no default action */
17420             break;
17421           }
17422      }
17423      break;
17424    }
17425    case 4: /* Noise Histogram Request */
17426    {
17427      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
17428      offset += 1;
17429
17430      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17431      offset += 1;
17432
17433      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17434      offset += 2;
17435
17436      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17437      offset += 2;
17438
17439      while (offset < tag_len)
17440      {
17441        guint8 sub_id;
17442        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_id, tvb, offset, 1, ENC_NA);
17443        sub_id = tvb_get_guint8(tvb, offset);
17444        offset += 1;
17445
17446        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
17447        offset += 1;
17448
17449        switch (sub_id) {
17450          case MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO: /* Noise Histogram Reporting Information (1) */
17451            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition, tvb, offset, 1, ENC_NA);
17452            offset += 1;
17453            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref, tvb, offset, 1, ENC_NA);
17454            offset += 1;
17455            break;
17456          default:
17457            /* no default action */
17458            break;
17459        }
17460      }
17461      break;
17462    }
17463    case 5: /* Beacon Request */
17464    {
17465      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
17466      offset += 1;
17467
17468      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17469      offset += 1;
17470
17471      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17472      offset += 2;
17473
17474      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17475      offset += 2;
17476
17477      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_measurement_mode, tvb, offset, 1, ENC_NA);
17478      offset += 1;
17479
17480      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_bssid, tvb, offset, 6, ENC_NA);
17481      offset += 6;
17482
17483      while (offset < tag_len)
17484      {
17485        guint8 sub_id, sub_length, sub_tag_end;
17486        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_id, tvb, offset, 1, ENC_NA);
17487        sub_id = tvb_get_guint8(tvb, offset);
17488        offset += 1;
17489
17490        proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
17491        sub_length = tvb_get_guint8(tvb, offset);
17492        offset += 1;
17493        sub_tag_end = offset + sub_length;
17494
17495        switch (sub_id) {
17496          case MEASURE_REQ_BEACON_SUB_SSID: /* SSID (0) */
17497            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_ssid, tvb, offset, sub_length, ENC_ASCII|ENC_NA);
17498            offset += sub_length;
17499            break;
17500          case MEASURE_REQ_BEACON_SUB_BRI: /* Beacon Reporting Information (1) */
17501            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17502            offset += 1;
17503            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17504            offset += 1;
17505            break;
17506          case MEASURE_REQ_BEACON_SUB_RD: /* Reporting Detail (2) */
17507            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17508            offset += 1;
17509            break;
17510          case MEASURE_REQ_BEACON_SUB_REQUEST: /* Request (10) */
17511            proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17512            offset += 1;
17513            break;
17514          case MEASURE_REQ_BEACON_SUB_APCP: /* AP Channel Report (51) */
17515            /* TODO */
17516            break;
17517          default:
17518            /* no default action */
17519            break;
17520        }
17521        if (offset < sub_tag_end)
17522        {
17523          proto_item *tix;
17524          tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_unknown, tvb, offset, sub_tag_end - offset, ENC_NA);
17525          expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_beacon_unknown);
17526          offset = sub_tag_end;
17527        }
17528      }
17529
17530      break;
17531    }
17532    case 6: /* Frame Request */
17533    {
17534      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
17535      offset += 1;
17536
17537      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
17538      offset += 1;
17539
17540      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17541      offset += 2;
17542
17543      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17544      offset += 2;
17545
17546      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_frame_request_type, tvb, offset, 1, ENC_NA);
17547      offset += 1;
17548
17549      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mac_address, tvb, offset, 6, ENC_NA);
17550      offset += 6;
17551
17552      /* TODO Add Optional Subelements */
17553      break;
17554    }
17555    case 7: /* BSTA Statistics Request */
17556    {
17557      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_peer_mac_address, tvb, offset, 6, ENC_NA);
17558      offset += 6;
17559
17560      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17561      offset += 2;
17562
17563      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17564      offset += 2;
17565
17566      proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_group_id, tvb, offset, 1, ENC_NA);
17567      offset += 1;
17568
17569      /* TODO Add Optional Subelements */
17570      break;
17571    }
17572    case 8: /* Location Configuration Indication (LCI) Request */
17573     /* TODO */
17574    case 9: /* Transmit Stream Measurement Request */
17575     /* TODO */
17576    case 10: /* Multicast diagnostics request */
17577     /* TODO */
17578    case 11: /* Location Civic request */
17579     /* TODO */
17580    case 12: /* Location Identifier request */
17581     /* TODO */
17582    case 13: /* Directional channel quality request */
17583     /* TODO */
17584    case 14: /* Directional measurement request */
17585     /* TODO */
17586    case 15: /* Directional statistics request */
17587     /* TODO */
17588    case 255: /* Measurement Pause Request*/
17589     /* TODO */
17590    default: /* unknown */
17591     break;
17592   }
17593   if (offset < tag_len)
17594   {
17595     proto_item *tix;
17596     tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_unknown, tvb, offset, tag_len - offset, ENC_NA);
17597     expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_unknown);
17598   }
17599
17600   return tvb_captured_length(tvb);
17601 }
17602
17603 /* 7.3.2.22 Measurement Report element (39) with update from 802.11k-2008 */
17604 static int
17605 ieee80211_tag_measure_rep(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17606 {
17607   int tag_len = tvb_reported_length(tvb);
17608   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17609   int offset = 0;
17610   proto_item *parent_item;
17611   proto_tree *sub_tree;
17612   guint8 report_type;
17613   static const int *ieee80211_tag_measure_report_mode[] = {
17614     &hf_ieee80211_tag_measure_report_mode_late,
17615     &hf_ieee80211_tag_measure_report_mode_incapable,
17616     &hf_ieee80211_tag_measure_report_mode_refused,
17617     &hf_ieee80211_tag_measure_report_mode_reserved,
17618     NULL
17619   };
17620   static const int *ieee80211_tag_measure_map_field[] = {
17621     &hf_ieee80211_tag_measure_map_field_bss,
17622     &hf_ieee80211_tag_measure_map_field_odfm,
17623     &hf_ieee80211_tag_measure_map_field_unident_signal,
17624     &hf_ieee80211_tag_measure_map_field_radar,
17625     &hf_ieee80211_tag_measure_map_field_unmeasured,
17626     &hf_ieee80211_tag_measure_map_field_reserved,
17627     NULL
17628   };
17629   static const int *ieee80211_tag_measure_report_frame_info[] = {
17630     &hf_ieee80211_tag_measure_report_frame_info_phy_type,
17631     &hf_ieee80211_tag_measure_report_frame_info_frame_type,
17632     NULL
17633   };
17634
17635   if (tag_len < 3)
17636   {
17637     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
17638     return tvb_captured_length(tvb);
17639   }
17640   proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_measurement_token, tvb, offset, 1, ENC_NA);
17641   offset += 1;
17642
17643   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_report_mode,
17644                                     ett_tag_measure_report_mode_tree, ieee80211_tag_measure_report_mode,
17645                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17646   offset += 1;
17647
17648   report_type = tvb_get_guint8(tvb, offset);
17649   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17650   sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_type_tree);
17651   offset += 1;
17652
17653   if (tag_len == 3)
17654     return tvb_captured_length(tvb);
17655
17656   switch (report_type) {
17657   case 0: /* Basic Report */
17658   {
17659     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17660     offset += 1;
17661
17662     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17663     offset += 8;
17664
17665     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17666     offset += 2;
17667
17668     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_basic_map_field,
17669                                     ett_tag_measure_report_basic_map_tree, ieee80211_tag_measure_map_field,
17670                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17671     break;
17672   }
17673   case 1: /* Clear channel assessment (CCA) report */
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_cca_busy_fraction, tvb, offset, 1, ENC_NA);
17684     offset += 1;
17685     break;
17686   case 2: /* Receive power indication (RPI) histogram report */
17687     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17688     offset += 1;
17689
17690     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17691     offset += 8;
17692
17693     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17694     offset += 2;
17695
17696     parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report, tvb, offset, 8, ENC_NA);
17697     sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_rpi_tree);
17698
17699     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_0, tvb, offset, 1, ENC_NA);
17700     offset += 1;
17701
17702     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_1, tvb, offset, 1, ENC_NA);
17703     offset += 1;
17704
17705     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_2, tvb, offset, 1, ENC_NA);
17706     offset += 1;
17707
17708     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_3, tvb, offset, 1, ENC_NA);
17709     offset += 1;
17710
17711     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_4, tvb, offset, 1, ENC_NA);
17712     offset += 1;
17713
17714     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_5, tvb, offset, 1, ENC_NA);
17715     offset += 1;
17716
17717     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_6, tvb, offset, 1, ENC_NA);
17718     offset += 1;
17719
17720     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_7, tvb, offset, 1, ENC_NA);
17721     offset += 1;
17722     break;
17723   case 3: /* Channel Load Report */
17724   {
17725     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
17726     offset += 1;
17727
17728     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17729     offset += 1;
17730
17731     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17732     offset += 8;
17733
17734     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17735     offset += 2;
17736
17737     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_load, tvb, offset, 1, ENC_NA);
17738     offset += 1;
17739
17740     /* TODO Add Optional Subelements */
17741     break;
17742   }
17743   case 4: /* Noise Histogram Report */
17744     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
17745     offset += 1;
17746
17747     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17748     offset += 1;
17749
17750     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17751     offset += 8;
17752
17753     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17754     offset += 2;
17755
17756     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
17757     offset += 1;
17758
17759     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_anpi, tvb, offset, 1, ENC_NA);
17760     offset += 1;
17761
17762     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_0, tvb, offset, 1, ENC_NA);
17763     offset += 1;
17764
17765     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_1, tvb, offset, 1, ENC_NA);
17766     offset += 1;
17767
17768     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_2, tvb, offset, 1, ENC_NA);
17769     offset += 1;
17770
17771     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_3, tvb, offset, 1, ENC_NA);
17772     offset += 1;
17773
17774     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_4, tvb, offset, 1, ENC_NA);
17775     offset += 1;
17776
17777     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_5, tvb, offset, 1, ENC_NA);
17778     offset += 1;
17779
17780     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_6, tvb, offset, 1, ENC_NA);
17781     offset += 1;
17782
17783     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_7, tvb, offset, 1, ENC_NA);
17784     offset += 1;
17785
17786     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_8, tvb, offset, 1, ENC_NA);
17787     offset += 1;
17788
17789     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_9, tvb, offset, 1, ENC_NA);
17790     offset += 1;
17791
17792     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_10, tvb, offset, 1, ENC_NA);
17793     offset += 1;
17794
17795     /* TODO Add Optional Subelements */
17796     break;
17797   case 5: /* Beacon Report */
17798   {
17799     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
17800     offset += 1;
17801
17802     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17803     offset += 1;
17804
17805     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17806     offset += 8;
17807
17808     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17809     offset += 2;
17810
17811     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_measure_report_frame_info,
17812                                     ett_tag_measure_report_frame_tree, ieee80211_tag_measure_report_frame_info,
17813                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17814     offset += 1;
17815
17816     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rcpi, tvb, offset, 1, ENC_NA);
17817     offset += 1;
17818
17819     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rsni, tvb, offset, 1, ENC_NA);
17820     offset += 1;
17821
17822     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_bssid, tvb, offset, 6, ENC_NA);
17823     offset += 6;
17824
17825     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
17826     offset += 1;
17827
17828     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_parent_tsf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
17829     offset += 4;
17830
17831     while (offset < tag_len)
17832     {
17833       guint8 sub_id, sub_length;
17834       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_beacon_sub_id, tvb, offset, 1, ENC_NA);
17835       sub_id = tvb_get_guint8(tvb, offset);
17836       offset += 1;
17837
17838       proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_subelement_length, tvb, offset, 1, ENC_NA);
17839       sub_length = tvb_get_guint8(tvb, offset);
17840       offset += 1;
17841
17842       switch (sub_id) {
17843         case MEASURE_REP_REPORTED_FRAME_BODY: /* Reported Frame Body (1) */
17844         {
17845           proto_tree *rep_tree;
17846
17847           rep_tree = proto_tree_add_subtree(sub_tree, tvb, offset, sub_length, ett_tag_measure_reported_frame_tree, NULL, "Reported Frame Body");
17848
17849           add_ff_timestamp(rep_tree, tvb, pinfo, 0);
17850           add_ff_beacon_interval(rep_tree, tvb, pinfo, 8);
17851           add_ff_cap_info(rep_tree, tvb, pinfo, 10);
17852           offset += 12;
17853
17854           ieee_80211_add_tagged_parameters(tvb, offset, pinfo, rep_tree, sub_length - 12, MGT_PROBE_RESP, NULL);
17855           offset += (sub_length - 12);
17856         }
17857         break;
17858         default:
17859           /* no default action */
17860           break;
17861       }
17862     }
17863     break;
17864   }
17865   case 6: /* Frame Report */
17866     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
17867     offset += 1;
17868
17869     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
17870     offset += 1;
17871
17872     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
17873     offset += 8;
17874
17875     proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17876     offset += 2;
17877
17878     /* TODO Add Optional Subelements */
17879     break;
17880   case 7: /* BSTA Statistics Report */
17881     /* TODO */
17882   case 8: /* Location Configuration Information Report element */
17883     /* TODO */
17884   case 9: /* Transmit Stream Measurement Report */
17885     /* TODO */
17886   case 10: /* Multicast diagnostics Report */
17887     /* TODO */
17888   case 11: /* Location Civic Report */
17889     /* TODO */
17890   case 12: /* Location Identifier Report */
17891     /* TODO */
17892   case 13: /* Directional channel quality Report */
17893     /* TODO */
17894   case 14: /* Directional measurement Report */
17895     /* TODO */
17896   case 15: /* Directional statistics Report */
17897     /* TODO */
17898   default: /* unknown */
17899     break;
17900   }
17901   if (offset < tag_len)
17902   {
17903     proto_item *tix;
17904     tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_unknown, tvb, offset, tag_len - offset, ENC_NA);
17905     expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_report_unknown);
17906   }
17907   return tvb_captured_length(tvb);
17908 }
17909
17910 /* 7.3.2.23 Quiet element (40) */
17911 static int
17912 ieee80211_tag_quiet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17913 {
17914   int tag_len = tvb_reported_length(tvb);
17915   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17916   int offset = 0;
17917   if (tag_len != 6)
17918   {
17919     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
17920     return tvb_captured_length(tvb);
17921   }
17922
17923   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_count, tvb, offset, 1, ENC_NA);
17924   proto_item_append_text(field_data->item_tag, " Count: %d", tvb_get_guint8(tvb, offset));
17925   offset += 1;
17926
17927   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_period, tvb, offset, 1, ENC_NA);
17928   proto_item_append_text(field_data->item_tag, " Period: %d", tvb_get_guint8(tvb, offset));
17929   offset += 1;
17930
17931   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17932   proto_item_append_text(field_data->item_tag, " Duration: %d", tvb_get_letohs(tvb, offset));
17933   offset += 2;
17934
17935   proto_tree_add_item(tree, hf_ieee80211_tag_quiet_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17936   proto_item_append_text(field_data->item_tag, " Offset: %d", tvb_get_letohs(tvb, offset));
17937
17938   return tvb_captured_length(tvb);
17939 }
17940
17941 /* 7.3.2.24 IBSS DFS element (41) */
17942 static int
17943 ieee80211_tag_ibss_dfs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17944 {
17945   int tag_len = tvb_reported_length(tvb);
17946   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17947   int offset = 0;
17948   proto_item *ti_sup_map;
17949   proto_tree *sub_map_tree;
17950   if (tag_len < 7)
17951   {
17952     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 7", tag_len);
17953     return tvb_captured_length(tvb);
17954   }
17955
17956   proto_tree_add_item(tree, hf_ieee80211_tag_dfs_owner, tvb, offset, 6, ENC_NA);
17957   proto_item_append_text(field_data->item_tag, " Owner: %s", tvb_ether_to_str(tvb, offset));
17958   offset += 6;
17959
17960   proto_tree_add_item(tree, hf_ieee80211_tag_dfs_recovery_interval, tvb, offset, 1, ENC_NA);
17961   offset += 1;
17962
17963   while (offset < tag_len)
17964   {
17965     ti_sup_map = proto_tree_add_item(tree, hf_ieee80211_tag_dfs_channel_map, tvb, offset, 2, ENC_NA);
17966     sub_map_tree = proto_item_add_subtree(ti_sup_map, ett_tag_dfs_map_tree);
17967     proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_channel_number, tvb, offset, 1, ENC_NA);
17968     proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_map, tvb, offset, 1, ENC_NA);
17969     offset += 2;
17970   }
17971   return tvb_captured_length(tvb);
17972 }
17973
17974 /* 7.3.2.13 ERP Information element (42) */
17975 static int
17976 ieee80211_tag_erp_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
17977 {
17978   int tag_len = tvb_reported_length(tvb);
17979   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
17980   int offset = 0;
17981   static const int *ieee80211_tag_erp_info_flags[] = {
17982     &hf_ieee80211_tag_erp_info_erp_present,
17983     &hf_ieee80211_tag_erp_info_use_protection,
17984     &hf_ieee80211_tag_erp_info_barker_preamble_mode,
17985     &hf_ieee80211_tag_erp_info_reserved,
17986     NULL
17987   };
17988
17989   if (tag_len != 1)
17990   {
17991     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
17992     return tvb_captured_length(tvb);
17993   }
17994
17995   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_erp_info,
17996                                     ett_tag_erp_info_tree, ieee80211_tag_erp_info_flags,
17997                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
17998
17999   return tvb_captured_length(tvb);
18000 }
18001
18002 /* 7.3.2.32 TS Delay element (43) */
18003 static int
18004 ieee80211_tag_ts_delay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18005 {
18006   int tag_len = tvb_reported_length(tvb);
18007   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18008   int offset = 0;
18009   if (tag_len != 4)
18010   {
18011     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
18012     return tvb_captured_length(tvb);
18013   }
18014
18015   proto_tree_add_item(tree, hf_ieee80211_ts_delay, tvb, offset, 4, ENC_LITTLE_ENDIAN);
18016   proto_item_append_text(field_data->item_tag, " : %d", tvb_get_ntohl(tvb, offset));
18017   return tvb_captured_length(tvb);
18018 }
18019
18020 /* 7.3.2.33 TCLAS Processing element (44) */
18021 static int
18022 ieee80211_tag_tclas_process(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18023 {
18024   int tag_len = tvb_reported_length(tvb);
18025   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18026   int offset = 0;
18027   if (tag_len != 1)
18028   {
18029     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
18030     return tvb_captured_length(tvb);
18031   }
18032
18033   proto_tree_add_item(tree, hf_ieee80211_tclas_process, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18034   proto_item_append_text(field_data->item_tag, " : %s", val_to_str(tvb_get_guint8(tvb, offset), ieee80211_tclas_process_flag, "Unknown %d"));
18035   return tvb_captured_length(tvb);
18036 }
18037
18038 /* 802.11-2012 8.4.2.37 QoS Capability element (46) */
18039 static int
18040 ieee80211_tag_qos_capability(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   if (tag_len != 1)
18046   {
18047     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
18048     return tvb_captured_length(tvb);
18049   }
18050   dissect_qos_capability(tree, tvb, pinfo, offset, field_data->ftype);
18051   return tvb_captured_length(tvb);
18052 }
18053
18054 static int
18055 ieee80211_tag_rsn_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18056 {
18057   int tag_len = tvb_reported_length(tvb);
18058   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18059   int offset = 0;
18060   if (tag_len < 18)
18061   {
18062     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 18", tag_len);
18063     return tvb_captured_length(tvb);
18064   }
18065
18066   dissect_rsn_ie(pinfo, tree, tvb, offset, tag_len, field_data->sanity_check);
18067   return tvb_captured_length(tvb);
18068 }
18069
18070 /* 7.3.2.14 Extended Supported Rates element (50) */
18071 static int
18072 ieee80211_tag_ext_supp_rates(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18073 {
18074   int tag_len = tvb_reported_length(tvb);
18075   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18076   int offset = 0;
18077   if (tag_len < 1)
18078   {
18079     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);
18080     return tvb_captured_length(tvb);
18081   }
18082
18083   while (offset < tag_len)
18084   {
18085     proto_tree_add_item(tree, hf_ieee80211_tag_ext_supp_rates, tvb, offset, 1, ENC_NA);
18086     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"));
18087     offset += 1;
18088   }
18089   proto_item_append_text(field_data->item_tag, " [Mbit/sec]");
18090   return tvb_captured_length(tvb);
18091 }
18092
18093 static int
18094 ieee80211_tag_cisco_ccx1_ckip(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18095 {
18096   int tag_len = tvb_reported_length(tvb);
18097   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18098   int offset = 0;
18099   /* From WCS manual:
18100    * If Aironet IE support is enabled, the access point sends an Aironet
18101    * IE 0x85 (which contains the access point name, load, number of
18102    * associated clients, and so on) in the beacon and probe responses of
18103    * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
18104    * (which contains the management IP address of the controller and
18105    * the IP address of the access point) in the reassociation response
18106    * if it receives Aironet IE 0x85 in the reassociation request.
18107    */
18108
18109   if (tag_len < 26)
18110   {
18111     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u too short, must be >= 26", tag_len);
18112     return tvb_captured_length(tvb);
18113   }
18114   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown, tvb, offset, 10, ENC_NA);
18115   offset += 10;
18116
18117   /* The Name of the sending device starts at offset 10 and is up to
18118      15 or 16 bytes in length, \0 padded */
18119   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_name, tvb, offset, 16, ENC_ASCII|ENC_NA);
18120   offset += 16;
18121
18122   /* Total number off associated clients and repeater access points */
18123   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_clients, tvb, offset, 1, ENC_NA);
18124   offset += 1;
18125   proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown2, tvb, offset, 3, ENC_NA);
18126   return tvb_captured_length(tvb);
18127 }
18128
18129 static int
18130 ieee80211_tag_vendor_specific_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18131 {
18132   int tag_len = tvb_reported_length(tvb);
18133   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18134   int offset = 0;
18135   guint32 tag_vs_len = tag_len;
18136   guint32       oui;
18137
18138   if (tag_len < 3)
18139   {
18140     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len);
18141     return tvb_captured_length(tvb);
18142   }
18143
18144   proto_tree_add_item_ret_uint(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_BIG_ENDIAN, &oui);
18145   proto_item_append_text(field_data->item_tag, ": %s", uint_get_manuf_name_if_known(oui));
18146   offset += 3;
18147   tag_vs_len -= 3;
18148
18149   if (tag_len > 0) {
18150     proto_tree_add_item(field_data->item_tag, hf_ieee80211_tag_vendor_oui_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
18151   }
18152
18153   switch (oui) {
18154     /* 802.11 specific vendor ids */
18155     case OUI_WPAWME:
18156       dissect_vendor_ie_wpawme(tree, tvb, pinfo, offset, tag_vs_len, field_data->ftype);
18157       break;
18158     case OUI_RSN:
18159       dissect_vendor_ie_rsn(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18160       break;
18161     case OUI_PRE11N:
18162       dissect_vendor_ie_ht(tvb, pinfo, tree, offset, field_data->item_tag, field_data->item_tag_length, tag_vs_len);
18163       break;
18164     case OUI_WFA:
18165       dissect_vendor_ie_wfa(pinfo, field_data->item_tag, tvb);
18166       break;
18167
18168     /* Normal IEEE vendor ids (from oui.h) */
18169     case OUI_CISCOWL:  /* Cisco Wireless (Aironet) */
18170       dissect_vendor_ie_aironet(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18171       break;
18172     case OUI_MARVELL:
18173       dissect_vendor_ie_marvell(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18174       break;
18175     case OUI_ATHEROS:
18176       dissect_vendor_ie_atheros(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo, field_data->item_tag_length);
18177       break;
18178     case OUI_ARUBA:
18179       dissect_vendor_ie_aruba(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18180       break;
18181     case OUI_NINTENDO:
18182       dissect_vendor_ie_nintendo(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18183       break;
18184     case OUI_MIKROTIK:
18185       dissect_vendor_ie_mikrotik(field_data->item_tag, tree, tvb, offset, tag_vs_len);
18186       break;
18187     case OUI_MERU:
18188       dissect_vendor_ie_meru(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
18189       break;
18190     case OUI_ZEBRA_EXTREME:
18191       dissect_vendor_ie_extreme(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
18192       break;
18193     case OUI_AEROHIVE:
18194       dissect_vendor_ie_aerohive(field_data->item_tag, tree, tvb, offset, tag_vs_len, pinfo);
18195       break;
18196     default:
18197       proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA);
18198       break;
18199   }
18200
18201   return tvb_captured_length(tvb);
18202 }
18203
18204 #define HE_HTC_HE_SUPPORT                0x00000001
18205 #define HE_FRAGMENTATION_SUPPORT         0x00000018
18206 #define HE_ALL_ACK_SUPPORT               0x00000200
18207 #define HE_UMRS_SUPPORT                  0x00000400
18208 #define HE_BSR_SUPPORT                   0x00000800
18209
18210 static const val64_string he_fragmentation_support_vals[] = {
18211   { 0, "No support for dynamic fragmentation" },
18212   { 1, "Support for dynamic fragments in MPDUs or S-MPDUs" },
18213   { 2, "Support for dynamic fragments in MPDUs and S-MPDUs and up to 1 dyn frag in MSDUs..." },
18214   { 3, "Support for all types of dynamic fragments" },
18215   { 0, NULL }
18216 };
18217
18218 static const val64_string he_minimum_fragmentation_size_vals[] = {
18219   { 0, "No restriction on minimum payload size" },
18220   { 1, "Minimum payload size of 128 bytes" },
18221   { 2, "Minimum payload size of 256 bytes" },
18222   { 3, "Minimum payload size of 512 bytes" },
18223   { 0, NULL }
18224 };
18225
18226 static const val64_string he_link_adaptation_support_vals[] = {
18227   { 0, "No feedback if the STA does not provide HE MFB" },
18228   { 1, "Reserved" },
18229   { 2, "Unsolicited if the STA can receive and provide only unsolicited HE MFB" },
18230   { 3, "Both" },
18231   { 0, NULL }
18232 };
18233
18234 static const int *he_mac_headers[] = {
18235   &hf_he_htc_he_support,                           /* 0 */
18236   &hf_he_twt_requester_support,                    /* 1 */
18237   &hf_he_twt_responder_support,                    /* 2 */
18238   &hf_he_fragmentation_support,                    /* 3 */
18239   &hf_he_max_number_fragmented_msdus,              /* 4 */
18240   &hf_he_min_fragment_size,                        /* 5 */
18241   &hf_he_trigger_frame_mac_padding_dur,            /* 6 */
18242   &hf_he_multi_tid_aggregation_support,            /* 7 */
18243   &hf_he_he_link_adaptation_support,               /* 8 */
18244   &hf_he_all_ack_support,                          /* 9 */
18245   &hf_he_umrs_support,                             /* 10 */
18246   &hf_he_bsr_support,                              /* 11 */
18247   &hf_he_broadcast_twt_support,                    /* 12 */
18248   &hf_he_32_bit_ba_bitmap_support,                 /* 13 */
18249   &hf_he_mu_cascading_support,                     /* 14 */
18250   &hf_he_ack_enabled_aggregation_support,          /* 15 */
18251   &hf_he_group_addressed_multi_sta_blkack_support, /* 16 */
18252   &hf_he_om_control_support,                       /* 17 */
18253   &hf_he_ofdma_ra_support,                         /* 18 */
18254   &hf_he_max_a_mpdu_length_exponent,               /* 19 */
18255   &hf_he_a_msdu_fragmentation_support,             /* 20 */
18256   &hf_he_flexible_twt_schedule_support,            /* 21 */
18257   &hf_he_rx_control_frame_to_multibss,             /* 22 */
18258   &hf_he_bsrp_bqrp_a_mpdu_aggregation,             /* 23 */
18259   &hf_he_qtp_support,                              /* 24 */
18260   &hf_he_bqr_support,                              /* 25 */
18261   &hf_he_sr_responder,                             /* 26 */
18262   &hf_he_ndp_feedback_report_support,              /* 27 */
18263   &hf_he_ops_support,                              /* 28 */
18264   &hf_he_a_msdu_in_a_mpdu_support,                 /* 29 */
18265   &hf_he_reserved,                                 /* 30 */
18266   NULL
18267 };
18268
18269 static const int *he_phy_first_byte_headers[] = {
18270   &hf_he_phy_cap_dual_band_support,
18271   NULL,
18272 };
18273
18274 static const int *he_phy_channel_width_set_headers[] _U_ = {
18275   &hf_he_40mhz_channel_2_4ghz,
18276   &hf_he_40_and_80_mhz_5ghz,
18277   &hf_he_160_mhz_5ghz,
18278   &hf_he_160_80_plus_80_mhz_5ghz,
18279   &hf_he_242_tone_rus_in_2_4ghz,
18280   &hf_he_242_tone_rus_in_5ghz,
18281   &hf_he_chan_width_reserved,
18282   NULL
18283 };
18284
18285 static const int *he_phy_b8_to_b23_headers[] = {
18286   &hf_he_phy_cap_punctured_preamble_rx,
18287   &hf_he_phy_cap_device_class,
18288   &hf_he_phy_cap_ldpc_coding_in_payload,
18289   &hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us,
18290   &hf_he_phy_cap_midamble_rx_max_nsts,
18291   &hf_he_phy_cap_ndp_with_4x_he_ltf_32us,
18292   &hf_he_phy_cap_stbc_tx_lt_80mhz,
18293   &hf_he_phy_cap_stbc_rx_lt_80mhz,
18294   &hf_he_phy_cap_doppler_tx,
18295   &hf_he_phy_cap_doppler_rx,
18296   &hf_he_phy_cap_full_bw_ul_mu_mimo,
18297   &hf_he_phy_cap_partial_bw_ul_mu_mimo,
18298   NULL
18299 };
18300
18301 static const int *he_phy_b24_to_b39_headers[] = {
18302   &hf_he_phy_cap_dcm_max_constellation_tx,
18303   &hf_he_phy_cap_dcm_max_nss_tx,
18304   &hf_he_phy_cap_dcm_max_constellation_rx,
18305   &hf_he_phy_cap_dcm_max_nss_rx,
18306   &hf_he_phy_cap_rx_he_muppdu_from_non_ap,
18307   &hf_he_phy_cap_su_beamformer,
18308   &hf_he_phy_cap_su_beamformee,
18309   &hf_he_phy_cap_mu_beamformer,
18310   &hf_he_phy_cap_beamformer_sts_lte_80mhz,
18311   &hf_he_phy_cap_beamformer_sts_gt_80mhz,
18312   NULL
18313 };
18314
18315 static const int *he_phy_b40_to_b55_headers[] = {
18316   &hf_he_phy_cap_number_of_sounding_dims_lte_80,
18317   &hf_he_phy_cap_number_of_sounding_dims_gt_80,
18318   &hf_he_phy_cap_ng_eq_16_su_fb,
18319   &hf_he_phy_cap_ng_eq_16_mu_fb,
18320   &hf_he_phy_cap_codebook_size_eq_4_2_fb,
18321   &hf_he_phy_cap_codebook_size_eq_7_5_fb,
18322   &hf_he_phy_cap_triggered_su_beamforming_fb,
18323   &hf_he_phy_cap_triggered_mu_beamforming_fb,
18324   &hf_he_phy_cap_triggered_cqi_fb,
18325   &hf_he_phy_cap_partial_bw_extended_range,
18326   &hf_he_phy_cap_partial_bw_dl_mu_mimo,
18327   &hf_he_phy_cap_ppe_threshold_present,
18328   NULL
18329 };
18330
18331 static const int *he_phy_b56_to_b71_headers[] = {
18332   &hf_he_phy_cap_srp_based_sr_support,
18333   &hf_he_phy_cap_power_boost_factor_ar_support,
18334   &hf_he_phy_cap_he_su_ppdu_etc_gi,
18335   &hf_he_phy_cap_max_nc,
18336   &hf_he_phy_cap_stbc_tx_gt_80_mhz,
18337   &hf_he_phy_cap_stbc_rx_gt_80_mhz,
18338   &hf_he_phy_cap_he_er_su_ppdu_4xxx_gi,
18339   &hf_he_phy_cap_20mhz_in_40mhz_24ghz_band,
18340   &hf_he_phy_cap_20mhz_in_160_80p80_ppdu,
18341   &hf_he_phy_cap_80mgz_in_160_80p80_ppdu,
18342   &hf_he_phy_cap_he_er_su_ppdu_1xxx_gi,
18343   &hf_he_phy_cap_midamble_rx_2x_xxx_ltf,
18344   &hf_he_phy_cap_b70_b71_reserved,
18345   NULL
18346 };
18347
18348 static const int *he_mcs_map_80_rx_headers [] = {
18349   &hf_he_mcs_max_he_mcs_80_rx_1_ss,
18350   &hf_he_mcs_max_he_mcs_80_rx_2_ss,
18351   &hf_he_mcs_max_he_mcs_80_rx_3_ss,
18352   &hf_he_mcs_max_he_mcs_80_rx_4_ss,
18353   &hf_he_mcs_max_he_mcs_80_rx_5_ss,
18354   &hf_he_mcs_max_he_mcs_80_rx_6_ss,
18355   &hf_he_mcs_max_he_mcs_80_rx_7_ss,
18356   &hf_he_mcs_max_he_mcs_80_rx_8_ss,
18357   NULL
18358 };
18359
18360 static const int *he_mcs_map_80_tx_headers [] = {
18361   &hf_he_mcs_max_he_mcs_80_tx_1_ss,
18362   &hf_he_mcs_max_he_mcs_80_tx_2_ss,
18363   &hf_he_mcs_max_he_mcs_80_tx_3_ss,
18364   &hf_he_mcs_max_he_mcs_80_tx_4_ss,
18365   &hf_he_mcs_max_he_mcs_80_tx_5_ss,
18366   &hf_he_mcs_max_he_mcs_80_tx_6_ss,
18367   &hf_he_mcs_max_he_mcs_80_tx_7_ss,
18368   &hf_he_mcs_max_he_mcs_80_tx_8_ss,
18369   NULL
18370 };
18371
18372 static const int *he_mcs_map_80p80_rx_headers [] = {
18373   &hf_he_mcs_max_he_mcs_80p80_rx_1_ss,
18374   &hf_he_mcs_max_he_mcs_80p80_rx_2_ss,
18375   &hf_he_mcs_max_he_mcs_80p80_rx_3_ss,
18376   &hf_he_mcs_max_he_mcs_80p80_rx_4_ss,
18377   &hf_he_mcs_max_he_mcs_80p80_rx_5_ss,
18378   &hf_he_mcs_max_he_mcs_80p80_rx_6_ss,
18379   &hf_he_mcs_max_he_mcs_80p80_rx_7_ss,
18380   &hf_he_mcs_max_he_mcs_80p80_rx_8_ss,
18381   NULL
18382 };
18383
18384 static const int *he_mcs_map_80p80_tx_headers [] = {
18385   &hf_he_mcs_max_he_mcs_80p80_tx_1_ss,
18386   &hf_he_mcs_max_he_mcs_80p80_tx_2_ss,
18387   &hf_he_mcs_max_he_mcs_80p80_tx_3_ss,
18388   &hf_he_mcs_max_he_mcs_80p80_tx_4_ss,
18389   &hf_he_mcs_max_he_mcs_80p80_tx_5_ss,
18390   &hf_he_mcs_max_he_mcs_80p80_tx_6_ss,
18391   &hf_he_mcs_max_he_mcs_80p80_tx_7_ss,
18392   &hf_he_mcs_max_he_mcs_80p80_tx_8_ss,
18393   NULL
18394 };
18395
18396 static const int *he_mcs_map_160_rx_headers [] = {
18397   &hf_he_mcs_max_he_mcs_160_rx_1_ss,
18398   &hf_he_mcs_max_he_mcs_160_rx_2_ss,
18399   &hf_he_mcs_max_he_mcs_160_rx_3_ss,
18400   &hf_he_mcs_max_he_mcs_160_rx_4_ss,
18401   &hf_he_mcs_max_he_mcs_160_rx_5_ss,
18402   &hf_he_mcs_max_he_mcs_160_rx_6_ss,
18403   &hf_he_mcs_max_he_mcs_160_rx_7_ss,
18404   &hf_he_mcs_max_he_mcs_160_rx_8_ss,
18405   NULL
18406 };
18407
18408 static const int *he_mcs_map_160_tx_headers [] = {
18409   &hf_he_mcs_max_he_mcs_160_tx_1_ss,
18410   &hf_he_mcs_max_he_mcs_160_tx_2_ss,
18411   &hf_he_mcs_max_he_mcs_160_tx_3_ss,
18412   &hf_he_mcs_max_he_mcs_160_tx_4_ss,
18413   &hf_he_mcs_max_he_mcs_160_tx_5_ss,
18414   &hf_he_mcs_max_he_mcs_160_tx_6_ss,
18415   &hf_he_mcs_max_he_mcs_160_tx_7_ss,
18416   &hf_he_mcs_max_he_mcs_160_tx_8_ss,
18417   NULL
18418 };
18419
18420 static const value_string ru_alloc_vals[] = {
18421   { 0, "242" },
18422   { 1, "484" },
18423   { 2, "996" },
18424   { 3, "2x996" },
18425   { 0, NULL }
18426 };
18427
18428 static const value_string constellation_vals[] = {
18429   { 0, "BPSK" },
18430   { 1, "QPSK" },
18431   { 2, "16-QAM" },
18432   { 3, "64-QAM" },
18433   { 4, "256-QAM" },
18434   { 5, "1024-QAM" },
18435   { 6, "Reserved" },
18436   { 7, "None" },
18437   { 0, NULL }
18438 };
18439
18440 #define HE_CHANNEL_WIDTH_SET_B2 0x04
18441 #define HE_CHANNEL_WIDTH_SET_B3 0x08
18442
18443 static void
18444 dissect_he_capabilities(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
18445   int offset, int len)
18446 {
18447   guint64 he_mac_caps = tvb_get_letoh40(tvb, offset);
18448   guint8 phy_channel_width_set = 0;
18449   proto_tree *phy_cap_tree = NULL;
18450   guint he_mcs_and_nss_len = 4;
18451   proto_tree *sup_he_mcs_and_nss_tree = NULL;
18452   proto_tree *rx_tx_he_mcs_map_80 = NULL;
18453   proto_tree *rx_tx_he_mcs_map_160 = NULL;
18454   proto_tree *rx_tx_he_mcs_map_80_80 = NULL;
18455
18456   /* Change some header fields depending on HE_HTC_HE_SUPPORT and FRAGMENTATION */
18457   if (!(he_mac_caps & HE_HTC_HE_SUPPORT)) {
18458     he_mac_headers[8] = &hf_he_reserved_bits_15_16;
18459     he_mac_headers[10] = &hf_he_reserved_bit_18;
18460     he_mac_headers[11] = &hf_he_reserved_bit_19;
18461     he_mac_headers[17] = &hf_he_reserved_bit_25;
18462   }
18463   if (!(he_mac_caps & HE_FRAGMENTATION_SUPPORT)) {
18464     he_mac_headers[4] = &hf_he_reserved_bits_5_7;
18465     he_mac_headers[5] = &hf_he_reserved_bits_8_9;
18466   }
18467
18468   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_mac_capabilities,
18469                         ett_he_mac_capabilities, he_mac_headers,
18470                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18471   offset += 5;
18472
18473   /* Get and isolate the phy channel witdth set */
18474   phy_channel_width_set = tvb_get_guint8(tvb, offset) >> 1;
18475   phy_cap_tree = proto_tree_add_subtree(tree, tvb, offset, 9, ett_he_phy_capabilities,
18476                         NULL,
18477                         "HE Phy Capabilities Information");
18478   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18479                         hf_he_phy_dual_band_support, ett_he_phy_cap_first_byte,
18480                         he_phy_first_byte_headers, ENC_NA, BMT_NO_APPEND);
18481   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18482                         hf_he_phy_chan_width_set,  ett_he_phy_cap_chan_width_set,
18483                         he_phy_channel_width_set_headers, ENC_NA, BMT_NO_APPEND);
18484   offset++;
18485   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18486                         hf_he_phy_b8_to_b23, ett_he_phy_cap_b8_to_b23,
18487                         he_phy_b8_to_b23_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18488   offset += 2;
18489   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18490                         hf_he_phy_b24_to_b39, ett_he_phy_cap_b24_to_b39,
18491                         he_phy_b24_to_b39_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18492   offset += 2;
18493   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18494                         hf_he_phy_b40_to_b55, ett_he_phy_cap_b40_to_b55,
18495                         he_phy_b40_to_b55_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18496   offset += 2;
18497   proto_tree_add_bitmask_with_flags(phy_cap_tree, tvb, offset,
18498                         hf_he_phy_b56_to_b71, ett_he_phy_cap_b56_to_b71,
18499                         he_phy_b56_to_b71_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18500   offset += 2;
18501
18502   /* Need the length first */
18503   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B2)
18504     he_mcs_and_nss_len += 4;
18505
18506   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B3)
18507     he_mcs_and_nss_len += 4;
18508
18509   sup_he_mcs_and_nss_tree = proto_tree_add_subtree(tree, tvb, offset,
18510                         he_mcs_and_nss_len, ett_he_mcs_and_nss_set, NULL,
18511                         "Tx Rx HE-MCS NSS Support");
18512   rx_tx_he_mcs_map_80 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree, tvb,
18513                         offset, 4, ett_he_rx_tx_he_mcs_map_lte_80, NULL,
18514                         "Rx and Tx MCS Maps <= 80 MHz");
18515   proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80, tvb, offset,
18516                         hf_he_rx_he_mcs_map_lte_80,
18517                         ett_he_rx_mcs_map_lte_80, he_mcs_map_80_rx_headers,
18518                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18519   offset += 2;
18520   proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80, tvb, offset,
18521                         hf_he_tx_he_mcs_map_lte_80,
18522                         ett_he_tx_mcs_map_lte_80, he_mcs_map_80_tx_headers,
18523                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18524   offset += 2;
18525
18526   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B2) {
18527     rx_tx_he_mcs_map_160 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree,
18528                         tvb, offset, 4, ett_he_rx_tx_he_mcs_map_160, NULL,
18529                         "Rx and Tx MCS Maps 160 MHz");
18530     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_160, tvb, offset,
18531                         hf_he_rx_he_mcs_map_160,
18532                         ett_he_rx_mcs_map_160, he_mcs_map_160_rx_headers,
18533                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18534     offset += 2;
18535     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_160, tvb, offset,
18536                         hf_he_tx_he_mcs_map_160,
18537                         ett_he_tx_mcs_map_160, he_mcs_map_160_tx_headers,
18538                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18539     offset += 2;
18540   }
18541
18542   if (phy_channel_width_set & HE_CHANNEL_WIDTH_SET_B3) {
18543     rx_tx_he_mcs_map_80_80 = proto_tree_add_subtree(sup_he_mcs_and_nss_tree,
18544                         tvb, offset, 4, ett_he_rx_tx_he_mcs_map_80_80, NULL,
18545                         "Rx and Tx MCS Maps 80+80 MHz");
18546     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80_80, tvb, offset,
18547                         hf_he_rx_he_mcs_map_80_80,
18548                         ett_he_rx_mcs_map_80_80, he_mcs_map_80p80_rx_headers,
18549                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18550     offset += 2;
18551     proto_tree_add_bitmask_with_flags(rx_tx_he_mcs_map_80_80, tvb, offset,
18552                         hf_he_tx_he_mcs_map_80_80,
18553                         ett_he_tx_mcs_map_80_80, he_mcs_map_80p80_tx_headers,
18554                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18555     offset += 2;
18556   }
18557
18558   if (offset < len) {
18559     guint8 ppe_thresholds_field = tvb_get_guint8(tvb, offset);
18560     guint8 nss_count = ppe_thresholds_field & 0x07, nss_index = 0;
18561     guint8 ru_index_bitmask = (ppe_thresholds_field >> 3) & 0x0F;
18562     proto_tree *ppe_tree = NULL;
18563     int i = 0;
18564     int bit_offset = 7;  /* How many bits we are into the bytes */
18565
18566     ppe_tree = proto_tree_add_subtree(tree, tvb, offset, len - offset + 1,
18567                         ett_he_ppe_threshold, NULL,
18568                         "PPE Thresholds");
18569     proto_tree_add_item(ppe_tree, hf_he_ppe_thresholds_nss, tvb, offset,
18570                         1, ENC_NA);
18571     proto_tree_add_item(ppe_tree, hf_he_ppe_thresholds_ru_index_bitmask, tvb,
18572                         offset, 1, ENC_NA);
18573
18574     /*
18575      * Now, for each of the nss values, add a sub-tree with its thresholds.
18576      * The actual count is one more than the number in the first three bits.
18577      */
18578     while (nss_index < nss_count + 1) {
18579       int start_offset = 0;
18580       proto_tree *nss_tree = NULL;
18581       proto_item *nssti = NULL;
18582       guint8 l_ru_bitmask = ru_index_bitmask;
18583
18584       nss_tree = proto_tree_add_subtree_format(ppe_tree, tvb, offset, -1,
18585                         ett_he_ppe_nss, &nssti, "NSS %d", nss_index);
18586       start_offset = offset;
18587
18588       for (i = 0; i < 4; i++) {
18589         if (l_ru_bitmask & 0x01) {
18590           int bits_avail = 8 - bit_offset, bits_needed = 6 - bits_avail;
18591           guint8 the_bits = 0;
18592           int ru_start_offset = offset;
18593           proto_tree *ru_alloc_tree = NULL;
18594           proto_item *rualti = NULL;
18595
18596           ru_alloc_tree = proto_tree_add_subtree_format(nss_tree, tvb, offset,
18597                                         -1, ett_he_ppe_ru_alloc, &rualti,
18598                                         "RU allocation: %s",
18599                                         val_to_str(i, ru_alloc_vals, "Unk"));
18600
18601           /*
18602            * Assemble the bits we require ... we need 6, or 2x3
18603            */
18604           if (bits_avail >= 6) { /* We can use the current byte */
18605             the_bits = (tvb_get_guint8(tvb, offset) >> bit_offset) & 0x3F;
18606           } else { /* We need two adjacent bytes */
18607             the_bits = (tvb_get_guint8(tvb, offset) >> bit_offset);
18608             offset++;
18609             the_bits = the_bits |
18610                         ((tvb_get_guint8(tvb, offset) &
18611                                 ((1 << bits_needed) - 1)) << bits_avail);
18612           }
18613           /*
18614            * Now we have two three bit fields, use them.
18615            */
18616           proto_tree_add_uint(ru_alloc_tree, hf_he_ppe_ppet16, tvb, ru_start_offset,
18617                               offset - ru_start_offset + 1, the_bits & 0x07);
18618           proto_tree_add_uint(ru_alloc_tree, hf_he_ppe_ppet8, tvb, ru_start_offset,
18619                               offset - ru_start_offset + 1, the_bits >> 3);
18620
18621           bit_offset = (bit_offset + 6) % 8;
18622           proto_item_set_len(rualti, offset - ru_start_offset + 1);
18623         }
18624         l_ru_bitmask = l_ru_bitmask >> 1;
18625       }
18626
18627
18628       proto_item_set_len(nssti, offset - start_offset);
18629       nss_index++;
18630     }
18631   }
18632
18633   /* Add an Expert Info about extra bytes ... */
18634
18635 }
18636
18637 static const int *he_operation_headers[] = {
18638   &hf_he_operation_bss_color,
18639   &hf_he_operation_default_pe_duration,
18640   &hf_he_operation_twt_required,
18641   &hf_he_operation_txop_duration_rts_threshold,
18642   &hf_he_operation_partial_bss_color,
18643   &hf_he_operation_vht_operation_information_present,
18644   &hf_he_operation_reserved_b22_b27,
18645   &hf_he_operation_multiple_bssid_ap,
18646   &hf_he_operation_txbssid_indicator,
18647   &hf_he_operation_bss_color_disabled,
18648   &hf_he_operation_reserved_b31,
18649   NULL
18650 };
18651
18652 static const value_string he_mcs_map_vals[] = {
18653   { 0, "Support for HE-MCS 0-7" },
18654   { 1, "Support for HE-MCS 0-9" },
18655   { 2, "Support for HE-MCS 0-11" },
18656   { 3, "Not supported for HE PPDUs" },
18657   { 0, NULL }
18658 };
18659
18660 static const int *he_basic_he_mcs_header[] = {
18661   &hf_he_oper_max_he_mcs_for_1_ss,
18662   &hf_he_oper_max_he_mcs_for_2_ss,
18663   &hf_he_oper_max_he_mcs_for_3_ss,
18664   &hf_he_oper_max_he_mcs_for_4_ss,
18665   &hf_he_oper_max_he_mcs_for_5_ss,
18666   &hf_he_oper_max_he_mcs_for_6_ss,
18667   &hf_he_oper_max_he_mcs_for_7_ss,
18668   &hf_he_oper_max_he_mcs_for_8_ss,
18669   NULL
18670 };
18671
18672 #define VHT_OPERATION_INFORMATION_PRESENT 0x00200000
18673 #define MULTIPLE_BSSID_AP                 0x10000000
18674
18675 static const value_string channel_width_vals[] = {
18676   { 0, "20 MHz or 40 MHz BSS Bandwidth" },
18677   { 1, "80 MHz, 160 MHz or 80+80 MHz BSS Bandwidth" },
18678   { 2, "160 MHz BSS Bandwidth (deprecated)" },
18679   { 3, "Non-contiguous 80+80 MHz BSS Bandwidth (deprecated)" },
18680   { 0, NULL }
18681 };
18682
18683 static void
18684 dissect_he_operation(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
18685   int offset, int len _U_)
18686 {
18687     guint32 op_params = tvb_get_letohl(tvb, offset);
18688
18689     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18690                         hf_he_operation_parameter, ett_he_operation_params,
18691                         he_operation_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18692     offset += 4;
18693
18694     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18695                         hf_he_operation_basic_mcs, ett_he_oper_basic_mcs,
18696                         he_basic_he_mcs_header, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18697     offset += 2;
18698
18699     if (op_params & VHT_OPERATION_INFORMATION_PRESENT) {
18700       proto_tree *vht_op_info = NULL;
18701       proto_item *pi = NULL;
18702
18703       vht_op_info = proto_tree_add_subtree(tree, tvb, offset, 3,
18704                         ett_he_operation_vht_op_info, NULL,
18705                         "VHT Operation Information");
18706       pi = proto_tree_add_item(vht_op_info, hf_he_operation_channel_width, tvb,
18707                         offset, 1, ENC_NA);
18708       proto_item_append_text(pi, ": %s",
18709                         val_to_str(tvb_get_guint8(tvb, offset),
18710                                 channel_width_vals,
18711                                 "Reserved %u"));
18712       offset++;
18713
18714       proto_tree_add_item(vht_op_info, hf_he_operation_channel_center_freq_0,
18715                         tvb, offset, 1, ENC_NA);
18716       offset++;
18717
18718       proto_tree_add_item(vht_op_info, hf_he_operation_channel_center_freq_1,
18719                         tvb, offset, 1, ENC_NA);
18720       offset++;
18721     }
18722
18723     if (op_params & MULTIPLE_BSSID_AP) {
18724       proto_tree_add_item(tree, hf_he_operation_max_bssid_indicator, tvb, offset,
18725                         1, ENC_NA);
18726       offset++;
18727     }
18728 }
18729
18730 static const int *uora_headers[] = {
18731   &hf_he_uora_eocwmin,
18732   &hf_he_uora_owcwmax,
18733   &hf_he_uora_reserved,
18734   NULL
18735 };
18736
18737 static void
18738 dissect_uora_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
18739   int offset)
18740 {
18741   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18742                         hf_he_uora_field, ett_he_uora_tree, uora_headers,
18743                         ENC_NA, BMT_NO_APPEND);
18744   offset++;
18745 }
18746
18747 static int
18748 dissect_muac_param_record(tvbuff_t *tvb, proto_tree *tree, int offset)
18749 {
18750   proto_tree_add_item(tree, hf_he_muac_aci_aifsn, tvb, offset, 1, ENC_NA);
18751   offset++;
18752
18753   proto_tree_add_item(tree, hf_he_muac_ecwmin_ecwmax, tvb, offset, 1, ENC_NA);
18754   offset++;
18755
18756   proto_tree_add_item(tree, hf_he_mu_edca_timer, tvb, offset, 1, ENC_NA);
18757   offset++;
18758
18759   return offset;
18760 }
18761
18762 static int
18763 dissect_mu_edca_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
18764   int offset, int len _U_)
18765 {
18766   proto_tree *param_tree = NULL;
18767
18768   /* Is this from an AP or an STA? */
18769   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
18770                                     ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
18771                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18772   offset++;
18773
18774   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
18775                         NULL, "MUAC_BE Parameter Record");
18776   offset = dissect_muac_param_record(tvb, param_tree, offset);
18777
18778   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
18779                         NULL, "MUAC_BK Parameter Record");
18780   offset = dissect_muac_param_record(tvb, param_tree, offset);
18781
18782   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
18783                         NULL, "MUAC_VI Parameter Record");
18784   offset = dissect_muac_param_record(tvb, param_tree, offset);
18785
18786   param_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_he_mu_edca_param,
18787                         NULL, "MUAC_VO Parameter Record");
18788   offset = dissect_muac_param_record(tvb, param_tree, offset);
18789
18790   return offset;
18791 }
18792
18793 #define SRP_DISALLOWED                     0x01
18794 #define NON_SRG_OBSS_PD_SR_DISALLOWED      0x02
18795 #define NON_SRG_OFFSET_PRESENT             0x04
18796 #define SRG_INFORMATION_PRESENT            0x08
18797 #define HESIGA_SPATIAL_REUSE_VAL15_ALLOWED 0x10
18798
18799 static const int *sr_control_field_headers[] = {
18800   &hf_he_srp_disallowed,
18801   &hf_he_non_srg_obss_pd_sr_disallowed,
18802   &hf_he_non_srg_offset_present,
18803   &hf_he_srg_information_present,
18804   &hf_he_hesiga_spatial_reuse_value15_allowed,
18805   &hf_he_sr_control_reserved,
18806   NULL
18807 };
18808
18809 static int
18810 dissect_spatial_reuse_parameter_set(tvbuff_t *tvb, packet_info *pinfo _U_,
18811   proto_tree *tree, int offset, int len _U_)
18812 {
18813   guint8 sr_control = tvb_get_guint8(tvb, offset);
18814
18815   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_spatial_reuse_sr_control,
18816                                     ett_he_spatial_reuse_control,
18817                                     sr_control_field_headers,
18818                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18819   offset++;
18820
18821   if (sr_control & NON_SRG_OFFSET_PRESENT) {
18822     proto_tree_add_item(tree, hf_he_spatial_non_srg_obss_pd_max_offset,
18823                         tvb, offset, 1, ENC_NA);
18824     offset++;
18825   }
18826
18827   if (sr_control & SRG_INFORMATION_PRESENT) {
18828     proto_tree_add_item(tree, hf_he_spatial_srg_obss_pd_min_offset, tvb,
18829                         offset, 1, ENC_NA);
18830     offset++;
18831     proto_tree_add_item(tree, hf_he_spatial_srg_obss_pd_max_offset, tvb,
18832                         offset, 1, ENC_NA);
18833     offset++;
18834     proto_tree_add_item(tree, hf_he_spatial_srg_bss_color_bitmap, tvb,
18835                         offset, 8, ENC_NA);
18836     offset += 8;
18837     proto_tree_add_item(tree, hf_he_spatial_srg_partial_bssid_bitmap,
18838                         tvb, offset, 8, ENC_NA);
18839     offset += 8;
18840   }
18841
18842   return offset;
18843 }
18844
18845 static void
18846 dissect_ndp_feedback_report_set(tvbuff_t *tvb, packet_info *pinfo _U_,
18847   proto_tree *tree, int offset, int len _U_)
18848 {
18849   proto_tree_add_item(tree, hf_he_resource_request_buffer_thresh, tvb, offset,
18850                         1, ENC_NA);
18851 }
18852
18853 static const int *bss_new_color_headers[] = {
18854   &hf_he_new_bss_color_info_color,
18855   &hf_he_new_bss_color_info_reserved,
18856   NULL
18857 };
18858
18859 static void
18860 dissect_bss_color_change(tvbuff_t *tvb, packet_info *pinfo _U_,
18861   proto_tree *tree, int offset, int len _U_)
18862 {
18863   proto_tree_add_item(tree, hf_he_bss_color_change_switch_countdown, tvb, offset,
18864                         1, ENC_NA);
18865   offset++;
18866
18867   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18868                                 hf_he_bss_color_change_new_color_info,
18869                                 ett_he_bss_new_color_info, bss_new_color_headers,
18870                                 ENC_NA, BMT_NO_APPEND);
18871 }
18872
18873 static const int *ess_info_field_headers[] = {
18874   &hf_he_ess_report_planned_ess,
18875   &hf_he_ess_report_edge_of_ess,
18876   NULL
18877 };
18878
18879 static void
18880 dissect_ess_report(tvbuff_t *tvb, packet_info *pinfo _U_,
18881   proto_tree *tree, int offset, int len _U_)
18882 {
18883   guint8 bss_trans_thresh = tvb_get_guint8(tvb, offset) >> 2;
18884
18885
18886   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_he_ess_report_info_field,
18887                                     ett_he_ess_report_info_field,
18888                                     ess_info_field_headers,
18889                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18890   if (bss_trans_thresh == 63)
18891     proto_tree_add_int_format(tree, hf_he_ess_report_recommend_transition_thresh, tvb,
18892                         offset, 1, bss_trans_thresh, " (%ddBm)",
18893                         -100 + bss_trans_thresh);
18894   else
18895     proto_tree_add_int_format(tree, hf_he_ess_report_recommend_transition_thresh,
18896                         tvb, offset, 1, bss_trans_thresh, " (No recommendation)");
18897 }
18898
18899 /*
18900  * There will be from 1 to 4 24-bit fields in the order of AC=BK, AC=BE,
18901  * AC=VI and AC=VO.
18902  */
18903
18904 static const int *esp_headers[] = {
18905   &hf_ieee80211_esp_access_category,
18906   &hf_ieee80211_esp_reserved,
18907   &hf_ieee80211_esp_data_format,
18908   &hf_ieee80211_esp_ba_windows_size,
18909   &hf_ieee80211_esp_est_air_time_frac,
18910   &hf_ieee80211_esp_data_ppdu_duration_target,
18911   NULL
18912 };
18913
18914 static const value_string esp_access_category_vals[] = {
18915   { 0, "AC=BK" },
18916   { 1, "AC=BE" },
18917   { 2, "AC=VI" },
18918   { 3, "AC=VO" },
18919   { 0, NULL }
18920 };
18921
18922 static const value_string esp_data_format_vals[] = {
18923   { 0, "No aggregation is expected to be performed" },
18924   { 1, "A-MSDU aggregation is expected but not A-MPDUs when type is data" },
18925   { 2, "A-MSDU aggregation is NOT expected but A-MPDUs aggregation is when type is data" },
18926   { 3, "A-MSDU aggregation is expected and A-MPDU aggregation is when type is data" },
18927   { 0, NULL }
18928 };
18929
18930 static const value_string esp_ba_window_size_vals[] = {
18931   { 0, "Block Ack not expected to be used" },
18932   { 1, "2" },
18933   { 2, "4" },
18934   { 3, "6" },
18935   { 4, "8" },
18936   { 5, "16" },
18937   { 6, "32" },
18938   { 7, "64" },
18939   { 0, NULL }
18940 };
18941
18942 static int
18943 dissect_estimated_service_params(tvbuff_t *tvb, packet_info *pinfo _U_,
18944   proto_tree *tree, int offset, int len)
18945 {
18946   while (len > 0) {
18947     proto_tree_add_bitmask_with_flags(tree, tvb, offset,
18948                         hf_ieee80211_estimated_service_params, ett_ieee80211_esp,
18949                         esp_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
18950     offset += 3;
18951     len -= 3;
18952   }
18953
18954   return offset;
18955 }
18956
18957 static int
18958 dissect_future_channel_guidance(tvbuff_t *tvb, packet_info *pinfo _U_,
18959   proto_tree *tree, int offset, int len _U_)
18960 {
18961   proto_tree_add_item(tree, hf_ieee80211_fcg_new_channel_number, tvb, offset,
18962                         4, ENC_LITTLE_ENDIAN);
18963   offset += 4;
18964
18965   if (len - 4 > 0) {
18966     proto_tree_add_item(tree, hf_ieee80211_fcg_extra_info, tvb, offset, len - 4,
18967                         ENC_NA);
18968     offset += len - 4;
18969   }
18970
18971   return offset;
18972 }
18973
18974 static int
18975 ieee80211_tag_element_id_extension(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
18976 {
18977   int tag_len = tvb_reported_length(tvb);
18978   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
18979   int offset = 0;
18980   int ext_tag_len;
18981   guint8 ext_tag_no;
18982
18983   if (tag_len < 1)
18984   {
18985     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 1", tag_len);
18986     return tvb_captured_length(tvb);
18987   }
18988   ext_tag_no = tvb_get_guint8(tvb, offset++);
18989   ext_tag_len = tag_len - 1;
18990
18991   switch (ext_tag_no) {
18992     case ETAG_FILS_SESSION:
18993       proto_tree_add_item(tree, hf_ieee80211_fils_session, tvb, offset, ext_tag_len, ENC_NA);
18994       break;
18995     case ETAG_FILS_WRAPPED_DATA:
18996       proto_tree_add_item(tree, hf_ieee80211_fils_wrapped_data, tvb, offset, ext_tag_len, ENC_NA);
18997       break;
18998     case ETAG_FILS_NONCE:
18999       proto_tree_add_item(tree, hf_ieee80211_fils_nonce, tvb, offset, ext_tag_len, ENC_NA);
19000       break;
19001     case ETAG_ESTIMATED_SERVICE_PARAM:
19002       dissect_estimated_service_params(tvb, pinfo, tree, offset, ext_tag_len);
19003       break;
19004     case ETAG_FUTURE_CHANNEL_GUIDANCE:
19005       dissect_future_channel_guidance(tvb, pinfo, tree, offset, ext_tag_len);
19006       break;
19007     case ETAG_HE_CAPABILITIES:
19008       dissect_he_capabilities(tvb, pinfo, tree, offset, ext_tag_len);
19009       break;
19010     case ETAG_HE_OPERATION:
19011       dissect_he_operation(tvb, pinfo, tree, offset, ext_tag_len);
19012       break;
19013     case ETAG_UORA_PARAMETER_SET:
19014       dissect_uora_parameter_set(tvb, pinfo, tree, offset);
19015       break;
19016     case ETAG_MU_EDCA_PARAMETER_SET:
19017       dissect_mu_edca_parameter_set(tvb, pinfo, tree, offset, ext_tag_len);
19018       break;
19019     case ETAG_SPATIAL_REUSE_PARAMETER_SET:
19020       dissect_spatial_reuse_parameter_set(tvb, pinfo, tree, offset, ext_tag_len);
19021       break;
19022     case ETAG_NDP_FEEDBACK_REPORT_PARAMETER_SET:
19023       dissect_ndp_feedback_report_set(tvb, pinfo, tree, offset, ext_tag_len);
19024       break;
19025     case ETAG_BSS_COLOR_CHANGE_ANNOUNCEMENT:
19026       dissect_bss_color_change(tvb, pinfo, tree, offset, ext_tag_len);
19027       break;
19028     case ETAG_QUIET_TIME_PERIOD_SETUP:
19029
19030       break;
19031     case ETAG_ESS_REPORT:
19032       dissect_ess_report(tvb, pinfo, tree, offset, ext_tag_len);
19033       break;
19034     default:
19035       break;
19036   }
19037
19038   return tvb_captured_length(tvb);
19039 }
19040
19041 /* Conflict: WAPI Vs. IEEE */
19042 static int
19043 ieee80211_tag_ie_68_conflict(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19044 {
19045   int tag_len = tvb_reported_length(tvb);
19046   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19047   if (tag_len >= 20) { /* It Might be WAPI*/
19048     dissect_wapi_param_set(tvb, pinfo, tree, 0, tag_len, field_data->item_tag_length, field_data->item_tag, field_data->ftype);
19049   }
19050   else { /* BSS AC Access Delay (68) */
19051      dissect_bss_ac_access_delay_ie(tvb, pinfo, tree, 0, tag_len, field_data->item_tag_length);
19052   }
19053   return tvb_captured_length(tvb);
19054 }
19055
19056 static int
19057 ieee80211_tag_mesh_peering_mgmt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
19058 {
19059   int tag_len = tvb_reported_length(tvb);
19060   int offset = 0;
19061
19062   proto_tree_add_item(tree, hf_ieee80211_mesh_peering_proto, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19063   offset += 2;
19064   proto_tree_add_item(tree, hf_ieee80211_mesh_peering_local_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19065   offset += 2;
19066   switch (tvb_get_guint8(tvb, 1))
19067   {                                         /* Self-protected action field */
19068     case SELFPROT_ACTION_MESH_PEERING_OPEN:
19069       break;
19070
19071     case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
19072       proto_tree_add_item(tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19073       break;
19074
19075     case SELFPROT_ACTION_MESH_PEERING_CLOSE:
19076       if ((tag_len == 8) || (tag_len == 24))
19077       {
19078         proto_tree_add_item(tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19079         offset += 2;
19080       }
19081       add_ff_reason_code(tree, tvb, pinfo, offset);
19082       break;
19083
19084       /* unexpected values */
19085     default:
19086       proto_tree_add_expert(tree, pinfo, &ei_ieee80211_mesh_peering_unexpected , tvb, offset, tag_len);
19087       break;
19088   }
19089   if (tag_len - offset == 16)
19090   {
19091     proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
19092   }
19093   return tvb_captured_length(tvb);
19094 }
19095
19096 static int
19097 ieee80211_tag_mesh_configuration(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
19098 {
19099   int offset = 0;
19100   proto_item *item;
19101   proto_tree *subtree;
19102   static const int *ieee80211_mesh_config_cap[] = {
19103     &hf_ieee80211_mesh_config_cap_accepting,
19104     &hf_ieee80211_mesh_config_cap_mcca_support,
19105     &hf_ieee80211_mesh_config_cap_mcca_enabled,
19106     &hf_ieee80211_mesh_config_cap_forwarding,
19107     &hf_ieee80211_mesh_config_cap_mbca_enabled,
19108     &hf_ieee80211_mesh_config_cap_tbtt_adjusting,
19109     &hf_ieee80211_mesh_config_cap_power_save_level,
19110     NULL
19111   };
19112
19113   proto_tree_add_item(tree, hf_ieee80211_mesh_config_path_sel_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19114   proto_tree_add_item(tree, hf_ieee80211_mesh_config_path_sel_metric, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
19115   proto_tree_add_item(tree, hf_ieee80211_mesh_config_congestion_control, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
19116   proto_tree_add_item(tree, hf_ieee80211_mesh_config_sync_method, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
19117   proto_tree_add_item(tree, hf_ieee80211_mesh_config_auth_protocol, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
19118   item = proto_tree_add_item(tree, hf_ieee80211_mesh_config_formation_info, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
19119   subtree = proto_item_add_subtree(item, ett_mesh_formation_info_tree);
19120   proto_tree_add_item(subtree, hf_ieee80211_mesh_form_info_num_of_peerings, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
19121
19122   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_mesh_config_capability,
19123                                     ett_mesh_config_cap_tree, ieee80211_mesh_config_cap,
19124                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19125   return tvb_captured_length(tvb);
19126 }
19127
19128 static int
19129 ieee80211_tag_mesh_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19130 {
19131   int offset = 0;
19132   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19133   int tag_len = tvb_reported_length(tvb);
19134   const guint8* mesh_id;
19135
19136   proto_tree_add_item_ret_string(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &mesh_id);
19137   if (tag_len > 0) {
19138     gchar* s = format_text(wmem_packet_scope(), mesh_id, tag_len);
19139     col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", s);
19140     proto_item_append_text(field_data->item_tag, ": %s", s);
19141   }
19142   /* Make sure dissector is accepted */
19143   return ((tag_len > 0) ? tag_len : 1);
19144 }
19145
19146 static int
19147 ieee80211_tag_mesh_preq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
19148 {
19149   int offset = 0;
19150
19151   guint32 flags;
19152   guint8 targs, i;
19153
19154   proto_tree_add_item_ret_uint(tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN, &flags);
19155   offset += 1;
19156   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19157   offset += 1;
19158   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19159   offset += 1;
19160   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_pdid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19161   offset += 4;
19162   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
19163   offset += 6;
19164   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19165   offset += 4;
19166
19167   if (flags & (1<<6)) {
19168     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_ext, tvb, offset, 6, ENC_NA);
19169     offset += 6;
19170   }
19171   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19172   offset += 4;
19173   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19174   offset += 4;
19175   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19176   targs = tvb_get_guint8(tvb, offset);
19177   offset += 1;
19178   for (i = 0; i < targs; i++) {
19179     const int * targ_flags[] = {
19180       &hf_ieee80211_ff_hwmp_targ_to_flags,
19181       &hf_ieee80211_ff_hwmp_targ_usn_flags,
19182       NULL
19183     };
19184
19185     proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_hwmp_targ_flags,
19186                                    ett_hwmp_targ_flags_tree, targ_flags, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19187
19188     offset += 1;
19189     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
19190     offset += 6;
19191     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19192     offset += 4;
19193   }
19194
19195   return tvb_captured_length(tvb);
19196 }
19197
19198 static int
19199 ieee80211_tag_mesh_prep(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
19200 {
19201   int offset = 0;
19202
19203   guint32 flags;
19204   proto_tree_add_item_ret_uint(tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN, &flags);
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_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
19211   offset += 6;
19212   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19213   offset += 4;
19214   if (flags & (1<<6)) {
19215     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
19216     offset += 6;
19217   }
19218   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19219   offset += 4;
19220   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19221   offset += 4;
19222   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
19223   offset += 6;
19224   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19225   return tvb_captured_length(tvb);
19226 }
19227
19228 static int
19229 ieee80211_tag_mesh_perr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
19230 {
19231   int offset = 0;
19232   guint8 targs, i;
19233
19234   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19235   offset += 1;
19236   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19237   targs = tvb_get_guint8(tvb, offset);
19238   offset += 1;
19239   for (i = 0; i < targs; i++) {
19240     guint8 flags = tvb_get_guint8(tvb, offset);
19241
19242     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19243     offset += 1;
19244     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
19245     offset += 6;
19246     proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19247     offset += 4;
19248     if (flags & (1<<6)) {
19249       proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
19250       offset += 6;
19251     }
19252     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
19253   }
19254   return tvb_captured_length(tvb);
19255 }
19256
19257 static int
19258 ieee80211_tag_rann(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void* data _U_)
19259 {
19260   int offset = 0;
19261   proto_tree_add_item(tree, hf_ieee80211_rann_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19262   offset += 1;
19263   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19264   offset += 1;
19265   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19266   offset += 1;
19267   proto_tree_add_item(tree, hf_ieee80211_rann_root_sta, tvb, offset, 6, ENC_NA);
19268   offset += 6;
19269   proto_tree_add_item(tree, hf_ieee80211_rann_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19270   offset += 4;
19271   proto_tree_add_item(tree, hf_ieee80211_rann_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19272   offset += 4;
19273   proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19274   return tvb_captured_length(tvb);
19275 }
19276
19277 /* Mesh Channel Switch Parameters (118) */
19278 static int
19279 ieee80211_tag_mesh_channel_switch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19280 {
19281   int tag_len = tvb_reported_length(tvb);
19282   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19283   int offset = 0;
19284   static const int * ieee80211_mesh_chswitch_flag[] = {
19285     &hf_ieee80211_mesh_chswitch_flag_initiator,
19286     &hf_ieee80211_mesh_chswitch_flag_txrestrict,
19287     NULL
19288   };
19289
19290   if (tag_len != 6)
19291   {
19292     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
19293     return tvb_captured_length(tvb);
19294   }
19295
19296   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
19297   proto_item_append_text(field_data->item_tag, " TTL: %d", tvb_get_guint8(tvb, offset));
19298   offset += 1;
19299
19300   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_mesh_channel_switch_flag,
19301                                    ett_mesh_chswitch_flag_tree, ieee80211_mesh_chswitch_flag, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
19302   offset += 1;
19303
19304   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_reason_code, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19305   offset += 2;
19306
19307   proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_precedence_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19308   return tvb_captured_length(tvb);
19309 }
19310
19311 /* Mesh Awake Window Parameters (119) */
19312 static int
19313 ieee80211_tag_mesh_awake_window(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19314 {
19315   int tag_len = tvb_reported_length(tvb);
19316   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19317   int offset = 0;
19318
19319   if (tag_len != 2) {
19320     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length,
19321         "Tag length %u wrong, must be = 2", tag_len);
19322     return tvb_captured_length(tvb);
19323   }
19324
19325   proto_tree_add_item(tree, hf_ieee80211_mesh_awake_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19326   return tvb_captured_length(tvb);
19327 }
19328
19329 static int
19330 ieee80211_tag_channel_switch_announcement(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   if (tag_len != 4)
19336   {
19337     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
19338     return tvb_captured_length(tvb);
19339   }
19340
19341   add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
19342   return tvb_captured_length(tvb);
19343 }
19344
19345 static int
19346 ieee80211_tag_supported_operating_classes(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19347 {
19348   int tag_len = tvb_reported_length(tvb);
19349   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19350   int offset = 0;
19351   proto_item* item = NULL;
19352   guint8 i;
19353   guint8 field_len = 0;
19354   guint8 alt_op_class_field[256];
19355
19356   if (tag_len < 2) {
19357     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 2", tag_len);
19358     return tvb_captured_length(tvb);
19359   } else if (tag_len > 255) {
19360     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, uint8 <= 255", tag_len);
19361     return tvb_captured_length(tvb);
19362   }
19363
19364   proto_tree_add_item(tree, hf_ieee80211_tag_supported_ope_classes_current, tvb, offset++, 1, ENC_NA);
19365
19366   for (i = offset; i < tag_len; i++) {
19367     guint8 op_class =  tvb_get_guint8(tvb, i);
19368     /* Field terminates immediately before OneHundredAndThirty or Zero delimiter */
19369     if (op_class == 130 || op_class == 0) {
19370       break;
19371     }
19372     alt_op_class_field[field_len++] = op_class;
19373   }
19374   if (field_len) {
19375     item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_ope_classes_alternate, tvb, offset, field_len, ENC_NA);
19376   }
19377   for (i = 0; i < field_len; i++) {
19378     proto_item_append_text(item, i == 0 ? ": %d":", %d", alt_op_class_field[i]);
19379   }
19380
19381   /* TODO parse optional Current Operating Class Extension Sequence field */
19382   /* TODO parse optional Operating Class Duple Sequence field */
19383   return tvb_captured_length(tvb);
19384 }
19385
19386 static int
19387 ieee80211_tag_bss_parameter_change(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19388 {
19389   int tag_len = tvb_reported_length(tvb);
19390   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19391   int offset = 0;
19392   gboolean size;
19393   if (tag_len != 7)
19394   {
19395     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 7", tag_len);
19396     return tvb_captured_length(tvb);
19397   }
19398   size = (tvb_get_guint8(tvb, offset) & 0x02) >> 1;
19399   proto_tree_add_item(tree, hf_ieee80211_tag_move, tvb, offset, 1, ENC_NA);
19400   proto_tree_add_item(tree, hf_ieee80211_tag_size, tvb, offset, 1, ENC_NA);
19401   offset += 1;
19402   proto_tree_add_item(tree, hf_ieee80211_tag_tbtt_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19403   offset += 4;
19404   if(size == TRUE) { /* if size bit is 0, the field is reserved. */
19405     proto_tree_add_item(tree, hf_ieee80211_tag_bi_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19406   }
19407   return tvb_captured_length(tvb);
19408 }
19409
19410 static int
19411 ieee80211_tag_dmg_capabilities(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19412 {
19413   int tag_len = tvb_reported_length(tvb);
19414   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19415   int offset = 0;
19416
19417   static const int * ieee80211_tag_dmg_cap1[] = {
19418     &hf_ieee80211_tag_reverse_direction,
19419     &hf_ieee80211_tag_hlts,
19420     &hf_ieee80211_tag_tpc,
19421     &hf_ieee80211_tag_spsh,
19422     &hf_ieee80211_tag_rx_antenna,
19423     &hf_ieee80211_tag_fast_link,
19424     &hf_ieee80211_tag_num_sectors,
19425     &hf_ieee80211_tag_rxss_length,
19426     &hf_ieee80211_tag_reciprocity,
19427     &hf_ieee80211_tag_max_ampdu_exp,
19428     NULL
19429   };
19430
19431   static const int * ieee80211_tag_dmg_cap2[] = {
19432     &hf_ieee80211_tag_min_mpdu_spacing,
19433     &hf_ieee80211_tag_ba_flow_control,
19434     &hf_ieee80211_tag_max_sc_rx_mcs,
19435     &hf_ieee80211_tag_max_ofdm_rx_mcs,
19436     &hf_ieee80211_tag_max_sc_tx_mcs,
19437     &hf_ieee80211_tag_max_ofdm_tx_mcs,
19438     NULL
19439   };
19440
19441   static const int * ieee80211_tag_dmg_cap3[] = {
19442     &hf_ieee80211_tag_low_power_supported,
19443     &hf_ieee80211_tag_code_rate,
19444     &hf_ieee80211_tag_dtp,
19445     &hf_ieee80211_tag_appdu_supp,
19446     &hf_ieee80211_tag_heartbeat,
19447     &hf_ieee80211_tag_other_aid,
19448     &hf_ieee80211_tag_pattern_recip,
19449     &hf_ieee80211_tag_heartbeat_elapsed,
19450     &hf_ieee80211_tag_grant_ack_supp,
19451     &hf_ieee80211_tag_RXSSTxRate_supp,
19452     NULL
19453   };
19454
19455   static const int * ieee80211_tag_dmg_cap4[] = {
19456     &hf_ieee80211_tag_pcp_tddti,
19457     &hf_ieee80211_tag_pcp_PSA,
19458     &hf_ieee80211_tag_pcp_handover,
19459     &hf_ieee80211_tag_pcp_max_assoc,
19460     &hf_ieee80211_tag_pcp_power_src,
19461     &hf_ieee80211_tag_pcp_decenter,
19462     &hf_ieee80211_tag_pcp_forwarding,
19463     &hf_ieee80211_tag_pcp_center,
19464     NULL
19465   };
19466
19467   static const int * ieee80211_tag_dmg_cap5[] = {
19468     &hf_ieee80211_tag_ext_sc_mcs_max_tx,
19469     &hf_ieee80211_tag_ext_sc_mcs_tx_code_7_8,
19470     &hf_ieee80211_tag_ext_sc_mcs_max_rx,
19471     &hf_ieee80211_tag_ext_sc_mcs_rx_code_7_8,
19472     NULL
19473   };
19474
19475   /*
19476    * Plenty of devices still do not conform to the older version of this
19477    * field. So, it must be at least 17 bytes in length.
19478    */
19479   if (tag_len < 17)
19480   {
19481     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must contain at least 17 bytes", tag_len);
19482     return tvb_captured_length(tvb);
19483   }
19484
19485   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_sta_addr, tvb, offset, 6, ENC_NA);
19486   offset += 6;
19487   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_aid, tvb, offset, 1, ENC_NA);
19488   offset += 1;
19489   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_dmg_cap1, ENC_LITTLE_ENDIAN);
19490   offset += 3;
19491   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_dmg_cap2, ENC_LITTLE_ENDIAN);
19492   offset += 3;
19493   proto_tree_add_bitmask_list(tree, tvb, offset, 2, ieee80211_tag_dmg_cap3, ENC_LITTLE_ENDIAN);
19494   offset += 2;
19495   proto_tree_add_bitmask_list(tree, tvb, offset, 2, ieee80211_tag_dmg_cap4, ENC_LITTLE_ENDIAN);
19496   offset += 2;
19497
19498   /*
19499    * There are many captures out there that do not conform to the 2016
19500    * version, so give them a malformed IE message now after we have dissected
19501    * the above
19502    */
19503   if (tag_len != 22)
19504   {
19505     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u does not conform to IEEE802.11-2016, should contain 22 bytes", tag_len);
19506     return tvb_captured_length(tvb);
19507   }
19508
19509   proto_tree_add_item(tree, hf_ieee80211_tag_sta_beam_track, tvb, offset, 2, ENC_NA);
19510   offset += 2;
19511   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_dmg_cap5, ENC_LITTLE_ENDIAN);
19512   offset += 1;
19513   proto_tree_add_item(tree, hf_ieee80211_tag_max_basic_sf_amsdu, tvb, offset, 1, ENC_NA);
19514   offset += 1;
19515   proto_tree_add_item(tree, hf_ieee80211_tag_max_short_sf_amsdu, tvb, offset, 1, ENC_NA);
19516
19517   return tvb_captured_length(tvb);
19518 }
19519
19520 static int
19521 ieee80211_tag_dmg_operation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19522 {
19523   int tag_len = tvb_reported_length(tvb);
19524   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19525   int offset = 0;
19526   static const int * ieee80211_tag_dmg_operation_flags[] = {
19527     &hf_ieee80211_tag_pcp_tddti,
19528     &hf_ieee80211_tag_pcp_PSA,
19529     &hf_ieee80211_tag_pcp_handover,
19530     NULL
19531   };
19532
19533   if (tag_len != 10)
19534   {
19535     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 10", tag_len);
19536     return tvb_captured_length(tvb);
19537   }
19538   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_dmg_operation_flags, ENC_LITTLE_ENDIAN);
19539   offset += 2;
19540   proto_tree_add_item(tree, hf_ieee80211_tag_PSRSI, tvb, offset, 1, ENC_NA);
19541   offset += 1;
19542   proto_tree_add_item(tree, hf_ieee80211_tag_min_BHI_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19543   offset += 2;
19544   proto_tree_add_item(tree, hf_ieee80211_tag_brdct_sta_info_dur, tvb, offset, 1, ENC_NA);
19545   offset += 1;
19546   proto_tree_add_item(tree, hf_ieee80211_tag_assoc_resp_confirm_time, tvb, offset, 1, ENC_NA);
19547   offset += 1;
19548   proto_tree_add_item(tree, hf_ieee80211_tag_min_pp_duration, tvb, offset, 1, ENC_NA);
19549   offset += 1;
19550   proto_tree_add_item(tree, hf_ieee80211_tag_SP_idle_timeout, tvb, offset, 1, ENC_NA);
19551   offset += 1;
19552   proto_tree_add_item(tree, hf_ieee80211_tag_max_lost_beacons, tvb, offset, 1, ENC_NA);
19553   return tvb_captured_length(tvb);
19554 }
19555
19556 static int
19557 ieee80211_tag_antenna_section_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19558 {
19559   int tag_len = tvb_reported_length(tvb);
19560   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19561   int offset = 0;
19562   static const int * ieee80211_tag_antenna[] = {
19563     &hf_ieee80211_tag_type,
19564     &hf_ieee80211_tag_tap1,
19565     &hf_ieee80211_tag_state1,
19566     &hf_ieee80211_tag_tap2,
19567     &hf_ieee80211_tag_state2,
19568     NULL
19569   };
19570
19571   if (tag_len != 4)
19572   {
19573     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
19574     return tvb_captured_length(tvb);
19575   }
19576   proto_tree_add_bitmask_list(tree, tvb, offset, 4, ieee80211_tag_antenna, ENC_LITTLE_ENDIAN);
19577   return tvb_captured_length(tvb);
19578 }
19579
19580 static int
19581 ieee80211_tag_extended_schedule(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19582 {
19583   int tag_len = tvb_reported_length(tvb);
19584   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19585   int offset = 0;
19586   int i;
19587   gboolean isGrant;
19588   proto_tree * alloc_tree;
19589   if ((tag_len%15) != 0)
19590   {
19591     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);
19592     return tvb_captured_length(tvb);
19593   }
19594   isGrant = ((field_data->ftype==CTRL_GRANT)||(field_data->ftype==CTRL_GRANT_ACK));
19595   for(i=0; i < tag_len; i+=15) {
19596     alloc_tree = proto_tree_add_subtree_format(tree, tvb, offset, 15, ett_allocation_tree, NULL, "Allocation %d", i/15);
19597     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19598     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19599     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pseudo_static, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19600     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_truncatable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19601     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_extendable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19602     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pcp_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19603     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_lp_sc_used, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19604     offset += 2;
19605     offset += add_ff_beamforming_ctrl(alloc_tree, tvb, pinfo, offset, isGrant);
19606     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_src_aid, tvb, offset, 1, ENC_NA);
19607     offset += 1;
19608     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_dest_aid, tvb, offset, 1, ENC_NA);
19609     offset += 1;
19610     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19611     offset += 4;
19612     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19613     offset += 2;
19614     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_num_blocks, tvb, offset, 1, ENC_NA);
19615     offset += 1;
19616     proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19617     offset += 2;
19618   }
19619   return tvb_captured_length(tvb);
19620 }
19621
19622 static int
19623 ieee80211_tag_sta_availability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19624 {
19625   int tag_len = tvb_reported_length(tvb);
19626   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19627   int offset = 0;
19628   int i;
19629   proto_tree * sta_info_tree;
19630   if ((tag_len%2) != 0)
19631   {
19632     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);
19633     return tvb_captured_length(tvb);
19634   }
19635   for(i=0; i < tag_len; i+=2) {
19636     sta_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 2, ett_sta_info, NULL, "STA Info %d", i/2);
19637     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19638     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_cbap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19639     proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_pp_avail, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19640     offset += 2;
19641   }
19642   return tvb_captured_length(tvb);
19643 }
19644
19645 static int
19646 ieee80211_tag_next_dmg_ati(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 != 6)
19652   {
19653     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
19654     return tvb_captured_length(tvb);
19655   }
19656   proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19657   offset += 4;
19658   proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19659   return tvb_captured_length(tvb);
19660 }
19661
19662 static int
19663 ieee80211_tag_nextpcp_list(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19664 {
19665   int tag_len = tvb_reported_length(tvb);
19666   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19667   int offset = 0;
19668   int i;
19669   if (tag_len < 1)
19670   {
19671     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);
19672     return tvb_captured_length(tvb);
19673   }
19674   proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_token, tvb, offset, 1, ENC_NA);
19675   offset += 1;
19676   for(i=0; i < tag_len-1; i+=1) {
19677     proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_list, tvb, offset, 1, ENC_NA);
19678     offset += 1;
19679   }
19680   return tvb_captured_length(tvb);
19681 }
19682
19683 static int
19684 ieee80211_tag_pcp_handover(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19685 {
19686   int tag_len = tvb_reported_length(tvb);
19687   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19688   int offset = 0;
19689   if (tag_len != 13)
19690   {
19691     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 13", tag_len);
19692     return tvb_captured_length(tvb);
19693   }
19694   proto_tree_add_item(tree, hf_ieee80211_tag_old_bssid, tvb, offset, 6, ENC_NA);
19695   offset += 6;
19696   proto_tree_add_item(tree, hf_ieee80211_tag_new_pcp_addr, tvb, offset, 6, ENC_NA);
19697   offset += 6;
19698   proto_tree_add_item(tree, hf_ieee80211_tag_reamaining_BI, tvb, offset, 1, ENC_NA);
19699   return tvb_captured_length(tvb);
19700 }
19701
19702 static int
19703 ieee80211_tag_beamlink_maintenance(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19704 {
19705   int tag_len = tvb_reported_length(tvb);
19706   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19707   int offset = 0;
19708   if (tag_len != 1)
19709   {
19710     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
19711     return tvb_captured_length(tvb);
19712   }
19713   add_ff_beamformed_link(tree, tvb, pinfo, offset);
19714   return tvb_captured_length(tvb);
19715 }
19716
19717 static int
19718 ieee80211_tag_quiet_period_res(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19719 {
19720   int tag_len = tvb_reported_length(tvb);
19721   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19722   int offset = 0;
19723   if (tag_len != 10)
19724   {
19725     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 10", tag_len);
19726     return tvb_captured_length(tvb);
19727   }
19728   proto_tree_add_item(tree, hf_ieee80211_tag_request_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19729   offset += 2;
19730   proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
19731   offset += 6;
19732   add_ff_sta_address(tree, tvb, pinfo, offset);
19733   return tvb_captured_length(tvb);
19734 }
19735
19736 static int
19737 ieee80211_tag_relay_transfer_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19738 {
19739   int tag_len = tvb_reported_length(tvb);
19740   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19741   int offset = 0;
19742
19743   if (tag_len != 8)
19744   {
19745     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
19746     return tvb_captured_length(tvb);
19747   }
19748   proto_tree_add_item(tree, hf_ieee80211_tag_duplex_relay, tvb, offset, 1, ENC_NA);
19749   proto_tree_add_item(tree, hf_ieee80211_tag_cooperation_relay, tvb, offset, 1, ENC_NA);
19750   proto_tree_add_item(tree, hf_ieee80211_tag_tx_mode, tvb, offset, 1, ENC_NA);
19751   proto_tree_add_item(tree, hf_ieee80211_tag_link_change_interval, tvb, offset+1, 1, ENC_NA);
19752   proto_tree_add_item(tree, hf_ieee80211_tag_data_sensing_time, tvb, offset+2, 1, ENC_NA);
19753   proto_tree_add_item(tree, hf_ieee80211_tag_first_period, tvb, offset+3, 2, ENC_LITTLE_ENDIAN);
19754   proto_tree_add_item(tree, hf_ieee80211_tag_second_period, tvb, offset+5, 2, ENC_LITTLE_ENDIAN);
19755   return tvb_captured_length(tvb);
19756 }
19757
19758 static int
19759 ieee80211_tag_dmg_beam_refinement(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19760 {
19761   int tag_len = tvb_reported_length(tvb);
19762   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19763   int offset = 0;
19764   static const int * ieee80211_dmg_beam_refinement_fields[] = {
19765     &hf_ieee80211_tag_initiator,
19766     &hf_ieee80211_tag_tx_train_res,
19767     &hf_ieee80211_tag_rx_train_res,
19768     &hf_ieee80211_tag_tx_trn_ok,
19769     &hf_ieee80211_tag_txss_fbck_req,
19770     &hf_ieee80211_tag_bs_fbck,
19771     &hf_ieee80211_tag_bs_fbck_antenna_id,
19772     &hf_ieee80211_tag_snr_requested,
19773     &hf_ieee80211_tag_channel_measurement_requested,
19774     &hf_ieee80211_tag_number_of_taps_requested,
19775     &hf_ieee80211_tag_sector_id_order_req,
19776     &hf_ieee80211_tag_snr_present,
19777     &hf_ieee80211_tag_channel_measurement_present,
19778     &hf_ieee80211_tag_tap_delay_present,
19779     &hf_ieee80211_tag_number_of_taps_present,
19780     &hf_ieee80211_tag_number_of_measurement,
19781     &hf_ieee80211_tag_sector_id_order_present,
19782     &hf_ieee80211_tag_number_of_beams,
19783     &hf_ieee80211_tag_mid_extension,
19784     &hf_ieee80211_tag_capability_request,
19785     &hf_ieee80211_tag_beam_refine_reserved,
19786     NULL
19787   };
19788
19789   if (tag_len != 5)
19790   {
19791     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
19792     return tvb_captured_length(tvb);
19793   }
19794
19795   proto_tree_add_bitmask_list(tree, tvb, offset, 5, ieee80211_dmg_beam_refinement_fields, ENC_LITTLE_ENDIAN);
19796   return tvb_captured_length(tvb);
19797 }
19798
19799 static int
19800 ieee80211_tag_wakeup_schedule_ad(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19801 {
19802   int tag_len = tvb_reported_length(tvb);
19803   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19804   int offset = 0;
19805
19806   if (tag_len != 8)
19807   {
19808     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
19809     return tvb_captured_length(tvb);
19810   }
19811   proto_tree_add_item(tree, hf_ieee80211_tag_bi_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19812   offset += 4;
19813   proto_tree_add_item(tree, hf_ieee80211_tag_sleep_cycle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19814   offset += 2;
19815   proto_tree_add_item(tree, hf_ieee80211_tag_num_awake_bis, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19816   return tvb_captured_length(tvb);
19817 }
19818
19819 static int
19820 ieee80211_tag_dmg_tspec(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19821 {
19822   int tag_len = tvb_reported_length(tvb);
19823   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19824   int offset = 0;
19825
19826   gboolean isGrant;
19827   int num_constraints;
19828   if (tag_len < 14)
19829   {
19830     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);
19831     return tvb_captured_length(tvb);
19832   }
19833   static const int * ieee80211_tag_tspec_flags[] = {
19834     &hf_ieee80211_tag_tspec_allocation_id,
19835     &hf_ieee80211_tag_tspec_allocation_type,
19836     &hf_ieee80211_tag_tspec_allocation_format,
19837     &hf_ieee80211_tag_tspec_pseudo_static,
19838     &hf_ieee80211_tag_tspec_truncatable,
19839     &hf_ieee80211_tag_tspec_extendable,
19840     &hf_ieee80211_tag_tspec_lp_sc_used,
19841     &hf_ieee80211_tag_tspec_up,
19842     &hf_ieee80211_tag_tap2,
19843     &hf_ieee80211_tag_tspec_dest_aid,
19844     NULL
19845   };
19846
19847   proto_tree_add_bitmask_list(tree, tvb, offset, 3, ieee80211_tag_tspec_flags, ENC_LITTLE_ENDIAN);
19848   offset += 3;
19849   isGrant = ((field_data->ftype==CTRL_GRANT)||(field_data->ftype==CTRL_GRANT_ACK));
19850   offset += add_ff_beamforming_ctrl(tree, tvb, pinfo, 2, isGrant);
19851   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19852   offset += 2;
19853   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19854   offset += 2;
19855   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_max_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19856   offset += 2;
19857   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19858   offset += 2;
19859   num_constraints = tvb_get_guint8(tvb, offset);
19860   proto_tree_add_item(tree, hf_ieee80211_tag_tspec_num_of_constraints, tvb, offset, 1, ENC_NA);
19861   offset += 1;
19862   while(num_constraints > 0) {
19863     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
19864     offset += 4;
19865     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19866     offset += 2;
19867     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
19868     offset += 2;
19869     proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_interferer_mac, tvb, offset, 2, ENC_NA);
19870     offset += 6;
19871     num_constraints--;
19872   }
19873   return tvb_captured_length(tvb);
19874 }
19875
19876 static int
19877 ieee80211_tag_channel_measurement_fb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19878 {
19879   int tag_len = tvb_reported_length(tvb);
19880   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19881   int offset = 0;
19882
19883   int num_measurement;
19884   if (tag_len%5 != 0)
19885   {
19886     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);
19887     return tvb_captured_length(tvb);
19888   }
19889   num_measurement = tvb_get_guint8(tvb, offset+1);
19890   offset += 2;
19891   while(num_measurement > 0) {
19892     proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
19893     offset += 1;
19894     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_I, tvb, offset, 1, ENC_NA);
19895     offset += 1;
19896     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_Q, tvb, offset, 1, ENC_NA);
19897     offset += 1;
19898     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_tap_delay, tvb, offset, 1, ENC_NA);
19899     offset += 1;
19900     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_sector_id, tvb, offset, 1, ENC_NA);
19901     proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_antenna_id, tvb, offset, 1, ENC_NA);
19902     offset += 1;
19903     num_measurement--;
19904   }
19905   return tvb_captured_length(tvb);
19906 }
19907
19908 static int
19909 ieee80211_tag_awake_window(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19910 {
19911   int tag_len = tvb_reported_length(tvb);
19912   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19913
19914   if (tag_len != 2)
19915   {
19916     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 2", tag_len);
19917   }
19918   else
19919   {
19920     proto_tree_add_item(tree, hf_ieee80211_tag_awake_window, tvb, 0, 2, ENC_LITTLE_ENDIAN);
19921   }
19922   return tvb_captured_length(tvb);
19923 }
19924
19925 static int
19926 ieee80211_tag_addba_ext(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19927 {
19928   int tag_len = tvb_reported_length(tvb);
19929   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19930
19931   if (tag_len != 1)
19932   {
19933     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
19934   }
19935   else
19936   {
19937     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_no_frag, tvb, 0, 1, ENC_NA);
19938     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_he_fragmentation_operation, tvb, 0, 1, ENC_NA);
19939     proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_reserved, tvb, 0, 1, ENC_NA);
19940   }
19941   return tvb_captured_length(tvb);
19942 }
19943
19944 static int
19945 ieee80211_tag_multi_band(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
19946 {
19947   int tag_len = tvb_reported_length(tvb);
19948   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
19949   int offset = 0;
19950   gboolean chiper_present, addr_present;
19951   static const int * ieee80211_tag_multi_band_ctrl[] = {
19952     &hf_ieee80211_tag_multi_band_ctrl_sta_role,
19953     &hf_ieee80211_tag_multi_band_ctrl_addr_present,
19954     &hf_ieee80211_tag_multi_band_ctrl_cipher_present,
19955     NULL
19956   };
19957   static const int * ieee80211_tag_multi_band_conn[] = {
19958     &hf_ieee80211_tag_multi_band_conn_ap,
19959     &hf_ieee80211_tag_multi_band_conn_pcp,
19960     &hf_ieee80211_tag_multi_band_conn_dls,
19961     &hf_ieee80211_tag_multi_band_conn_tdls,
19962     &hf_ieee80211_tag_multi_band_conn_ibss,
19963     NULL
19964   };
19965
19966   if (tag_len < 22)
19967   {
19968     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);
19969     return tvb_captured_length(tvb);
19970   }
19971   chiper_present = (tvb_get_letohs(tvb, offset) & 0x08) >> 3;
19972   addr_present = (tvb_get_letohs(tvb, offset) & 0x10) >> 4;
19973   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_multi_band_ctrl, ENC_NA);
19974   offset += 1;
19975   offset += add_ff_band_id(tree, tvb, pinfo, 1);
19976   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_oper_class, tvb, offset, 1, ENC_NA);
19977   offset += 1;
19978   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_channel_number, tvb, offset, 1, ENC_NA);
19979   offset += 1;
19980   proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
19981   offset += 6;
19982   offset += add_ff_beacon_interval(tree, tvb, pinfo, 2);
19983   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_tsf_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
19984   offset += 8;
19985
19986   proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_multi_band_conn, ENC_NA);
19987   offset += 1;
19988   proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_fst_timeout, tvb, offset, 1, ENC_NA);
19989   offset += 1;
19990   if(addr_present)
19991   {
19992     proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_sta_mac, tvb, offset, 6, ENC_NA);
19993     offset += 6;
19994   }
19995   if(chiper_present)
19996   {
19997     proto_item *rsn_pcs_count, *rsn_pcs_item, *rsn_sub_pcs_item;
19998     proto_tree *rsn_pcs_tree, *rsn_sub_pcs_tree;
19999     gint ii;
20000     guint16     pcs_count;
20001     int tag_end = tvb_reported_length(tvb);
20002     rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
20003     pcs_count = tvb_get_letohs(tvb, offset);
20004     offset += 2;
20005
20006     if (offset + (pcs_count * 4) > tag_end)
20007     {
20008         expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
20009         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
20010         pcs_count = (tag_end - offset) / 4;
20011     }
20012
20013     rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
20014     rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
20015     for (ii = 0; ii < pcs_count; ii++)
20016     {
20017       rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
20018       rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
20019       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
20020
20021       /* Check if OUI is 00:0F:AC (ieee80211) */
20022       if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
20023       {
20024         proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
20025         proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
20026       } else {
20027         proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
20028       }
20029       offset += 4;
20030     }
20031   }
20032
20033   return tvb_captured_length(tvb);
20034 }
20035
20036 static int
20037 ieee80211_tag_dmg_link_margin(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
20038 {
20039   int tag_len = tvb_reported_length(tvb);
20040   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
20041   int offset = 0;
20042
20043   if (tag_len != 8)
20044   {
20045     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
20046     return tvb_captured_length(tvb);
20047   }
20048   proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
20049   offset += 1;
20050   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_mcs, tvb, offset, 1, ENC_NA);
20051   offset += 1;
20052   proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_link_margin, tvb, offset, 1, ENC_NA);
20053   offset += 1;
20054   proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
20055   offset += 1;
20056   proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
20057   return tvb_captured_length(tvb);
20058 }
20059
20060 static int
20061 ieee80211_tag_dmg_link_adaption_ack(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
20062 {
20063   int tag_len = tvb_reported_length(tvb);
20064   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
20065   int offset = 0;
20066
20067   if (tag_len != 5)
20068   {
20069     expert_add_info_format(pinfo, field_data->item_tag_length, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
20070     return tvb_captured_length(tvb);
20071   }
20072   proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
20073   offset += 1;
20074   proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
20075   return tvb_captured_length(tvb);
20076 }
20077
20078 static int
20079 ieee80211_tag_switching_stream(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
20080 {
20081   int tag_len = tvb_reported_length(tvb);
20082   ieee80211_tagged_field_data_t* field_data = (ieee80211_tagged_field_data_t*)data;
20083   int offset = 0;
20084   static const int * ieee80211_tag_switching_stream_flags[] = {
20085     &hf_ieee80211_tag_switching_stream_old_tid,
20086     &hf_ieee80211_tag_switching_stream_old_direction,
20087     &hf_ieee80211_tag_switching_stream_new_tid,
20088     &hf_ieee80211_tag_switching_stream_new_direction,
20089     &hf_ieee80211_tag_switching_stream_new_valid_id,
20090     &hf_ieee80211_tag_switching_stream_llt_type,
20091     NULL
20092   };
20093
20094   int param_num;
20095   if (tag_len < 4)
20096   {
20097     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);
20098     return tvb_captured_length(tvb);
20099   }
20100   offset += add_ff_band_id(tree, tvb, pinfo, 1);
20101   offset += add_ff_band_id(tree, tvb, pinfo, 1);
20102   proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_non_qos, tvb, offset, 1, ENC_NA);
20103   offset += 1;
20104   param_num = tvb_get_letohs(tvb, offset);
20105   proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_param_num, tvb, offset, 1, ENC_NA);
20106   offset += 1;
20107   while(param_num > 0)
20108   {
20109     proto_tree_add_bitmask_list(tree, tvb, offset, 1, ieee80211_tag_switching_stream_flags, ENC_NA);
20110     param_num--;
20111     offset += 2;
20112   }
20113   return tvb_captured_length(tvb);
20114 }
20115
20116 static void
20117 ieee_80211_add_tagged_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
20118                                   proto_tree *tree, int tagged_parameters_len, int ftype,
20119                                   association_sanity_check_t *association_sanity_check)
20120 {
20121   int next_len;
20122   beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
20123   while (tagged_parameters_len > 0) {
20124     /* TODO make callers optionally specify the list of valid IE IDs? */
20125     if ((next_len=add_tagged_field (pinfo, tree, tvb, offset, ftype, NULL, 0, association_sanity_check)) == 0)
20126       break;
20127     if (next_len > tagged_parameters_len) {
20128       /* XXX - flag this as an error? */
20129       next_len = tagged_parameters_len;
20130     }
20131     offset                += next_len;
20132     tagged_parameters_len -= next_len;
20133   }
20134 }
20135
20136 static void
20137 ieee_80211_do_association_sanity_check(packet_info *pinfo, association_sanity_check_t *sanity_check)
20138 {
20139   /* Given a [re-]association request frame, consider it in its totality and
20140      add expert information as appropriate */
20141
20142   if (sanity_check->association_has_mobility_domain_element) {
20143     /* This is an FT association, warn about any non-FT AKM suites */
20144     if (sanity_check->has_non_ft_akm_suite) {
20145       expert_add_info_format(pinfo, sanity_check->rsn_first_non_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
20146                              "Non-FT AKM suite is prohibited for FT association request");
20147     }
20148   } else {
20149     /* This is a non-FT association, warn about any FT AKM suites */
20150     if (sanity_check->has_ft_akm_suite) {
20151       expert_add_info_format(pinfo, sanity_check->rsn_first_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
20152                              "FT AKM suite is prohibited for non-FT association request");
20153     }
20154   }
20155 }
20156
20157 /* ************************************************************************* */
20158 /*                     Dissect 802.11 management frame                       */
20159 /* ************************************************************************* */
20160 static void
20161 dissect_ieee80211_mgt(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
20162 {
20163   proto_item *ti;
20164   proto_tree *mgt_tree;
20165   proto_tree *fixed_tree;
20166   proto_tree *tagged_tree;
20167   int         offset = 0;
20168   int         tagged_parameter_tree_len;
20169
20170   association_sanity_check_t association_sanity_check;
20171   memset(&association_sanity_check, 0, sizeof(association_sanity_check));
20172
20173   ieee80211_tvb_invalid = FALSE;
20174
20175   ti = proto_tree_add_item(tree, proto_wlan, tvb, 0, -1, ENC_NA);
20176   mgt_tree = proto_item_add_subtree(ti, ett_80211_mgt);
20177
20178   switch (COMPOSE_FRAME_TYPE(fcf))
20179   {
20180
20181     case MGT_ASSOC_REQ:
20182       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 4);
20183       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
20184       add_ff_listen_ival(fixed_tree, tvb, pinfo, 2);
20185       offset = 4;  /* Size of fixed fields */
20186
20187       tagged_parameter_tree_len =
20188           tvb_reported_length_remaining(tvb, offset);
20189       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20190                  tagged_parameter_tree_len);
20191       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20192           tagged_parameter_tree_len, MGT_ASSOC_REQ, &association_sanity_check);
20193       ieee_80211_do_association_sanity_check(pinfo, &association_sanity_check);
20194       break;
20195
20196
20197     case MGT_ASSOC_RESP:
20198       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
20199       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
20200       add_ff_status_code(fixed_tree, tvb, pinfo, 2);
20201       add_ff_assoc_id(fixed_tree, tvb, pinfo, 4);
20202       offset = 6;  /* Size of fixed fields */
20203
20204       tagged_parameter_tree_len =
20205           tvb_reported_length_remaining(tvb, offset);
20206       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20207                  tagged_parameter_tree_len);
20208       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20209           tagged_parameter_tree_len, MGT_ASSOC_RESP, NULL);
20210       break;
20211
20212
20213     case MGT_REASSOC_REQ:
20214       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 10);
20215       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
20216       add_ff_listen_ival(fixed_tree, tvb, pinfo, 2);
20217       add_ff_current_ap_addr(fixed_tree, tvb, pinfo, 4);
20218       offset = 10;  /* Size of fixed fields */
20219
20220       tagged_parameter_tree_len =
20221           tvb_reported_length_remaining(tvb, offset);
20222       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20223                  tagged_parameter_tree_len);
20224       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20225           tagged_parameter_tree_len, MGT_REASSOC_REQ, &association_sanity_check);
20226       ieee_80211_do_association_sanity_check(pinfo, &association_sanity_check);
20227       break;
20228
20229     case MGT_REASSOC_RESP:
20230       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
20231       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
20232       add_ff_status_code(fixed_tree, tvb, pinfo, 2);
20233       add_ff_assoc_id(fixed_tree, tvb, pinfo, 4);
20234       offset = 6;  /* Size of fixed fields */
20235
20236       tagged_parameter_tree_len =
20237           tvb_reported_length_remaining(tvb, offset);
20238       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20239                  tagged_parameter_tree_len);
20240       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20241           tagged_parameter_tree_len, MGT_REASSOC_RESP, NULL);
20242       break;
20243
20244
20245     case MGT_PROBE_REQ:
20246       offset = 0;
20247       tagged_parameter_tree_len =
20248           tvb_reported_length_remaining(tvb, offset);
20249       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20250                  tagged_parameter_tree_len);
20251       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20252           tagged_parameter_tree_len, MGT_PROBE_REQ, NULL);
20253       break;
20254
20255     case MGT_PROBE_RESP:
20256     {
20257       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
20258       add_ff_timestamp(fixed_tree, tvb, pinfo, 0);
20259       add_ff_beacon_interval(fixed_tree, tvb, pinfo, 8);
20260       add_ff_cap_info(fixed_tree, tvb, pinfo, 10);
20261       offset = 12;  /* Size of fixed fields */
20262
20263       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20264       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset, tagged_parameter_tree_len);
20265       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_PROBE_RESP, NULL);
20266       break;
20267     }
20268     case MGT_MEASUREMENT_PILOT:
20269     {
20270       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
20271       offset += add_ff_timestamp(fixed_tree, tvb, pinfo, offset);
20272       offset += add_ff_measurement_pilot_int(fixed_tree, tvb, pinfo, offset);
20273       offset += add_ff_beacon_interval(fixed_tree, tvb, pinfo, offset);
20274       offset += add_ff_cap_info(fixed_tree, tvb, pinfo, offset);
20275       offset += add_ff_country_str(fixed_tree, tvb, pinfo, offset);
20276       offset += add_ff_max_reg_pwr(fixed_tree, tvb, pinfo, offset);
20277       offset += add_ff_max_tx_pwr(fixed_tree, tvb, pinfo, offset);
20278       offset += add_ff_tx_pwr_used(fixed_tree, tvb, pinfo, offset);
20279       offset += add_ff_transceiver_noise_floor(fixed_tree, tvb, pinfo, offset);
20280       /* TODO DS Parameter Set ??? */
20281
20282       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20283       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset, tagged_parameter_tree_len);
20284       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_MEASUREMENT_PILOT, NULL);
20285       break;
20286     }
20287     case MGT_BEACON:    /* Dissect protocol payload fields  */
20288       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
20289       add_ff_timestamp(fixed_tree, tvb, pinfo, 0);
20290       add_ff_beacon_interval(fixed_tree, tvb, pinfo, 8);
20291       add_ff_cap_info(fixed_tree, tvb, pinfo, 10);
20292       offset = 12;  /* Size of fixed fields */
20293
20294       tagged_parameter_tree_len =
20295           tvb_reported_length_remaining(tvb, offset);
20296       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20297       tagged_parameter_tree_len);
20298       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20299       tagged_parameter_tree_len, MGT_BEACON, NULL);
20300       break;
20301
20302     case MGT_ATIM:
20303       break;
20304
20305     case MGT_DISASS:
20306       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 2);
20307       add_ff_reason_code(fixed_tree, tvb, pinfo, 0);
20308       offset = 2; /* Size of fixed fields */
20309       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20310       if (tagged_parameter_tree_len > 0) {
20311         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20312                                                 tagged_parameter_tree_len);
20313         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20314                                          tagged_parameter_tree_len, MGT_DISASS, NULL);
20315       }
20316       break;
20317
20318     case MGT_AUTHENTICATION:
20319       offset = 6;  /* Size of fixed fields */
20320       offset += get_ff_auth_sae_len(tvb);
20321
20322       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, offset);
20323       add_ff_auth_alg(fixed_tree, tvb, pinfo, 0);
20324       add_ff_auth_trans_seq(fixed_tree, tvb, pinfo, 2);
20325       add_ff_status_code(fixed_tree, tvb, pinfo, 4);
20326       add_ff_auth_sae(fixed_tree, tvb);
20327
20328       tagged_parameter_tree_len =
20329         tvb_reported_length_remaining(tvb, offset);
20330       if (tagged_parameter_tree_len > 0)
20331       {
20332         tagged_tree = get_tagged_parameter_tree(mgt_tree,
20333             tvb,
20334             offset,
20335             tagged_parameter_tree_len);
20336         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20337         tagged_parameter_tree_len, MGT_AUTHENTICATION, NULL);
20338       }
20339       break;
20340
20341     case MGT_DEAUTHENTICATION:
20342       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 2);
20343       add_ff_reason_code(fixed_tree, tvb, pinfo, 0);
20344       offset = 2; /* Size of fixed fields */
20345       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20346       if (tagged_parameter_tree_len > 0) {
20347         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20348                                                 tagged_parameter_tree_len);
20349         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20350                                          tagged_parameter_tree_len, MGT_DEAUTHENTICATION, NULL);
20351       }
20352       break;
20353
20354     case MGT_ACTION:
20355     {
20356       proto_item *lcl_fixed_hdr;
20357       proto_tree *lcl_fixed_tree;
20358       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
20359       offset += add_ff_action(lcl_fixed_tree, tvb, pinfo, 0);
20360
20361       proto_item_set_len(lcl_fixed_hdr, offset);
20362       if (ieee80211_tvb_invalid)
20363         break; /* Buffer not available for further processing */
20364       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20365       if (tagged_parameter_tree_len > 0)
20366       {
20367         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20368           tagged_parameter_tree_len);
20369         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20370           tagged_parameter_tree_len, MGT_ACTION, NULL);
20371       }
20372       break;
20373     }
20374     case MGT_ACTION_NO_ACK:
20375     {
20376       proto_item *lcl_fixed_hdr;
20377       proto_tree *lcl_fixed_tree;
20378       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
20379
20380       offset += add_ff_action(lcl_fixed_tree, tvb, pinfo, 0);
20381
20382       proto_item_set_len(lcl_fixed_hdr, offset);
20383       if (ieee80211_tvb_invalid)
20384         break; /* Buffer not available for further processing */
20385       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
20386       if (tagged_parameter_tree_len > 0)
20387       {
20388         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
20389           tagged_parameter_tree_len);
20390         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
20391           tagged_parameter_tree_len, MGT_ACTION_NO_ACK, NULL);
20392       }
20393       break;
20394     }
20395     case MGT_ARUBA_WLAN:
20396     {
20397       proto_tree *aruba_tree;
20398       guint16 type;
20399       type = tvb_get_ntohs(tvb, offset);
20400
20401       aruba_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, NULL, "Aruba Management");
20402
20403       proto_tree_add_item(aruba_tree, hf_ieee80211_aruba, tvb, offset, 2, ENC_BIG_ENDIAN);
20404       offset += 2;
20405       switch(type){
20406         case 0x0003: /* MTU Size */
20407           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_mtu, tvb, offset, 2, ENC_BIG_ENDIAN);
20408         break;
20409         case 0x0005: /* HeartBeat Sequence */
20410           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_hb_seq, tvb, offset, 8, ENC_BIG_ENDIAN);
20411         break;
20412       }
20413       break;
20414     }
20415   }
20416 }
20417
20418 /*
20419  * Dissect a Block Ack request (which is also used in Trigger frames).
20420  */
20421 static const int *block_ack_control_headers[] = {
20422   &hf_ieee80211_block_ack_control_ack_policy,
20423   &hf_ieee80211_block_ack_control_type,
20424   &hf_ieee80211_block_ack_control_reserved,
20425   &hf_ieee80211_block_ack_control_tid_info,
20426   NULL
20427 };
20428
20429 static const int *multi_sta_aid_tid_headers[] = {
20430   &hf_ieee80211_block_ack_multi_sta_aid11,
20431   &hf_ieee80211_block_ack_multi_sta_ack_type,
20432   &hf_ieee80211_block_ack_multi_sta_tid,
20433  NULL
20434 };
20435
20436 /*
20437  * These bits are shown in reverse order in the spec.
20438  */
20439 #define BASIC_BLOCK_ACK               0x0
20440 #define EXTENDED_COMPRESSED_BLOCK_ACK 0x1
20441 #define COMPRESSED_BLOCK_ACK          0x2
20442 #define MULTI_TID_BLOCK_ACK           0x3
20443 #define GCR_BLOCK_ACK                 0x6
20444 #define GLK_GCR_BLOCK_ACK             0xA
20445 #define MULTI_STA_BLOCK_ACK           0xB
20446
20447 static const value_string block_ack_type_vals[] = {
20448   { BASIC_BLOCK_ACK,               "Basic BlockAck" },
20449   { EXTENDED_COMPRESSED_BLOCK_ACK, "Extended Compressed BlockAck" },
20450   { COMPRESSED_BLOCK_ACK,          "Compressed BlockAck" },
20451   { MULTI_TID_BLOCK_ACK,           "Multi-TID BlockAck" },
20452   { GCR_BLOCK_ACK,                 "GCR BlockAck" },
20453   { GLK_GCR_BLOCK_ACK,             "GLK-GCR BlockAck" },
20454   { MULTI_STA_BLOCK_ACK,           "Multi-STA BlockAck" },
20455   { 0, NULL }
20456 };
20457
20458 static int
20459 dissect_ieee80211_block_ack_details(tvbuff_t *tvb, packet_info *pinfo _U_,
20460   proto_tree *tree, int offset, gboolean isDMG, gboolean is_req, gboolean has_fcs)
20461 {
20462   proto_item     *pi;
20463   guint16         ba_control;
20464   guint8          block_ack_type;
20465   proto_tree     *ba_tree;
20466   guint8          tid_count, frag_num;
20467   guint           i;
20468   proto_tree     *ba_mtid_tree, *ba_mtid_sub_tree;
20469   guint16         ssn;
20470   guint64         bmap;
20471   int             f;
20472   proto_item     *ba_bitmap_item;
20473   proto_tree     *ba_bitmap_tree;
20474   guint16         aid_tid;
20475   proto_tree     *ba_multi_sta_tree;
20476   int             ba_start = offset;
20477
20478   ba_control = tvb_get_letohs(tvb, offset);
20479   block_ack_type = (ba_control & 0x001E) >> 1;
20480   ba_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_block_ack,
20481                         &pi, is_req ? "%s Request" : "%s Response",
20482                         val_to_str(block_ack_type, block_ack_type_vals,
20483                                 "Reserved (%d)"));
20484   proto_tree_add_bitmask_with_flags(ba_tree, tvb, offset,
20485                         hf_ieee80211_block_ack_control,
20486                         ett_block_ack_request_control,
20487                         block_ack_control_headers,
20488                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20489   offset += 2;
20490
20491   switch (block_ack_type) {
20492   case BASIC_BLOCK_ACK:
20493     if (isDMG == TRUE) {
20494       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
20495                         "DMG STAs shouldn't transmit BlockAckReq frames "
20496                         "with Basic BlockAckReqs");
20497     }
20498
20499     /* Both request and response have an SSC */
20500     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
20501
20502     if (!is_req) {
20503       proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_bitmap, tvb, offset,
20504                         128, ENC_NA);
20505       offset += 128;
20506     }
20507     break;
20508
20509   case COMPRESSED_BLOCK_ACK:
20510     /*
20511      * FIXME: For 802.11ax, the block ack bitmap can be 8 or 32 bytes
20512      * depending on the values of the fragment number subfield in the
20513      * SSC! All values other that 0 and 2 in bits B1 & B2 are reserved.
20514      */
20515     ssn = tvb_get_letohs(tvb, offset);
20516     frag_num = ssn & 0x0F;
20517     ssn >>= 4;
20518     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
20519
20520     if (!is_req) {
20521       if ((frag_num & 0x06) == 0) {
20522         bmap = tvb_get_letoh64(tvb, offset);
20523         ba_bitmap_item = proto_tree_add_item(ba_tree,
20524                           hf_ieee80211_block_ack_bitmap,
20525                           tvb, offset, 8, ENC_NA);
20526         ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item,
20527                           ett_block_ack_bitmap);
20528         for (f = 0; f < 64; f++) {
20529           if (bmap & (G_GUINT64_CONSTANT(1) << f))
20530             continue;
20531           proto_tree_add_uint_format_value(ba_bitmap_tree,
20532                           hf_ieee80211_block_ack_bitmap_missing_frame,
20533                           tvb, offset + (f/8), 1, ssn + f, "%u",
20534                           (ssn + f) & 0x0fff);
20535         }
20536         offset += 8;
20537       } else if ((frag_num & 0x06) == 2) {
20538
20539         proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_bitmap, tvb,
20540                         offset, 32, ENC_NA);
20541         offset += 32;
20542       } else {
20543         /* Reserved ... */
20544       }
20545     }
20546     break;
20547
20548   case EXTENDED_COMPRESSED_BLOCK_ACK:
20549     if (isDMG == FALSE) {
20550       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
20551                         "Non-DMG STAs shouldn't transmit BlockAckReq "
20552                         "frames with Extended Compressed BlockAckReqs");
20553     }
20554
20555     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
20556
20557     if (!is_req) {
20558       ssn = tvb_get_letohs(tvb, offset);
20559       ssn >>= 4;
20560
20561       bmap = tvb_get_letoh64(tvb, offset);
20562       ba_bitmap_item = proto_tree_add_item(ba_tree,
20563                         hf_ieee80211_block_ack_bitmap,
20564                         tvb, offset, 8, ENC_NA);
20565       ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item,
20566                         ett_block_ack_bitmap);
20567       for (f = 0; f < 64; f++) {
20568         if (bmap & (G_GUINT64_CONSTANT(1) << f))
20569           continue;
20570         proto_tree_add_uint(ba_bitmap_tree,
20571                         hf_ieee80211_block_ack_bitmap_missing_frame,
20572                         tvb, offset + (f/8), 1, ssn + f);
20573       }
20574       offset += 8;
20575       proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_RBUFCAP, tvb, offset,
20576                         1, ENC_LITTLE_ENDIAN);
20577       offset += 1;
20578     }
20579     break;
20580
20581   case MULTI_TID_BLOCK_ACK:
20582
20583     if (isDMG == TRUE) {
20584       expert_add_info_format(pinfo, ba_tree, &ei_ieee80211_dmg_subtype,
20585                         "DMG STAs shouldn't transmit BlockAckReq frames "
20586                         "with Multi-TID BlockAckReqs");
20587     }
20588
20589     tid_count = ((ba_control & 0xF000) >> 12) + 1;
20590     if (is_req) {
20591       ba_mtid_tree = proto_tree_add_subtree(ba_tree, tvb, offset, tid_count*4,
20592                 ett_block_ack, NULL, "TID List");
20593       for (i = 0; i < tid_count; i++) {
20594         guint8 tid = tvb_get_guint8(tvb, offset) & 0x0F;
20595         ba_mtid_sub_tree = proto_tree_add_subtree_format(ba_mtid_tree, tvb,
20596                                 offset, 4, ett_block_ack_tid, NULL,
20597                                 "TID %u details", tid);
20598
20599         proto_tree_add_item(ba_mtid_sub_tree,
20600                 hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2,
20601                 ENC_LITTLE_ENDIAN);
20602         proto_tree_add_item(ba_mtid_sub_tree,
20603                 hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2,
20604                 ENC_LITTLE_ENDIAN);
20605         offset += 2;
20606
20607         offset += add_ff_block_ack_ssc(ba_mtid_sub_tree, tvb, pinfo, offset);
20608       }
20609     } else {
20610       ba_mtid_tree = proto_tree_add_subtree(ba_tree, tvb, offset, tid_count*4,
20611                 ett_block_ack, NULL, "TID List");
20612       for (i = 0; i < tid_count; i++) {
20613         guint8 tid = tvb_get_guint8(tvb, offset) & 0x0F;
20614         ba_mtid_sub_tree = proto_tree_add_subtree_format(ba_mtid_tree, tvb,
20615                                 offset, 4, ett_block_ack_tid, NULL,
20616                                 "TID %u details", tid);
20617
20618         proto_tree_add_item(ba_mtid_sub_tree,
20619                         hf_ieee80211_block_ack_multi_tid_reserved,
20620                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
20621         proto_tree_add_item(ba_mtid_sub_tree,
20622                         hf_ieee80211_block_ack_multi_tid_value, tvb,
20623                         offset, 2, ENC_LITTLE_ENDIAN);
20624         offset += 2;
20625
20626         offset += add_ff_block_ack_ssc(ba_mtid_sub_tree, tvb, pinfo, offset);
20627         proto_tree_add_item(ba_mtid_sub_tree,
20628                         hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
20629         offset += 8;
20630       }
20631     }
20632     break;
20633
20634   case GCR_BLOCK_ACK:
20635     offset += add_ff_block_ack_ssc(ba_tree, tvb, pinfo, offset);
20636
20637     proto_tree_add_item(ba_tree, hf_ieee80211_block_ack_gcr_addr, tvb,
20638                         offset, 6, ENC_NA);
20639     offset += 6;
20640
20641     if (!is_req) {
20642       proto_tree_add_item(ba_tree,
20643                         hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
20644       offset += 8;
20645     }
20646     break;
20647
20648   case MULTI_STA_BLOCK_ACK:
20649     while (tvb_reported_length_remaining(tvb, offset) > (has_fcs ? 4 : 0)) {
20650         int start = offset;
20651         proto_item *msta_ti = NULL;
20652         aid_tid = tvb_get_letohs(tvb, offset);
20653         ba_multi_sta_tree = proto_tree_add_subtree_format(ba_tree, tvb, offset, -1,
20654                                 ett_multi_sta_block_ack, &msta_ti,
20655                                 "Per AID TID Info: 0x%0x", aid_tid & 0x07ff);
20656         proto_tree_add_bitmask_with_flags(ba_multi_sta_tree, tvb, offset,
20657                         hf_ieee80211_block_ack_multi_sta_aid_tid,
20658                         ett_block_ack_request_multi_sta_aid_tid,
20659                         multi_sta_aid_tid_headers,
20660                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20661         offset += 2;
20662
20663         if ((aid_tid & 0x07ff) != 2045) {
20664           if (((aid_tid & 0x0800) == 0) && (aid_tid & 0xf000) <= 7) {
20665             guint8 bitmap_size;
20666             frag_num = tvb_get_guint8(tvb, offset);
20667             offset += add_ff_block_ack_ssc(ba_multi_sta_tree, tvb, pinfo, offset);
20668             bitmap_size = ((frag_num + 2) & 0x6) >> 1;  /* Turn into an exponent */
20669             bitmap_size = 4 << bitmap_size;  /* It goes 4, 8, 16, 32 */
20670             proto_tree_add_item(ba_multi_sta_tree, hf_ieee80211_block_ack_bitmap, tvb,
20671                         offset, bitmap_size, ENC_NA);
20672             offset += bitmap_size;
20673           }
20674         } else {
20675           offset += add_ff_block_ack_ssc(ba_multi_sta_tree, tvb, pinfo, offset);
20676           proto_tree_add_item(ba_multi_sta_tree, hf_ieee80211_block_ack_multi_sta_reserved,
20677                                 tvb, offset, 2, ENC_LITTLE_ENDIAN);
20678           offset += 2;
20679           proto_tree_add_item(ba_multi_sta_tree, hf_ieee80211_block_ack_multi_sta_ra,
20680                                 tvb, offset, 6, ENC_NA);
20681           offset += 6;
20682         }
20683         proto_item_set_len(msta_ti, offset - start);
20684     }
20685     break;
20686   }
20687   proto_item_set_len(pi, offset - ba_start);
20688
20689   return offset;
20690 }
20691
20692 static int
20693 dissect_ieee80211_block_ack(tvbuff_t *tvb, packet_info *pinfo _U_,
20694   proto_tree *tree, int offset, gboolean isDMG, gboolean is_req, gboolean has_fcs)
20695 {
20696   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
20697   proto_item     *hidden_item;
20698
20699   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
20700   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved, tvb,
20701                         offset, 6, ether_name);
20702   PROTO_ITEM_SET_HIDDEN(hidden_item);
20703   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
20704                         ENC_NA);
20705   PROTO_ITEM_SET_HIDDEN(hidden_item);
20706   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
20707                         offset, 6, ether_name);
20708   PROTO_ITEM_SET_HIDDEN(hidden_item);
20709   offset += 6;
20710
20711   return dissect_ieee80211_block_ack_details(tvb, pinfo, tree, offset, isDMG, is_req, has_fcs);
20712 }
20713
20714 /*
20715  * Dissect an 802.11ax HE Trigger frame and return the actual len including
20716  * padding!
20717  */
20718
20719 #define TRIGGER_TYPE_BASIC      0
20720 #define TRIGGER_TYPE_BRP        1
20721 #define TRIGGER_TYPE_MU_BAR     2
20722 #define TRIGGER_TYPE_MU_RTS     3
20723 #define TRIGGER_TYPE_BSRP       4
20724 #define TRIGGER_TYPE_GCR_MU_BAR 5
20725 #define TRIGGER_TYPE_BQRP       6
20726 #define TRIGGER_TYPE_NFRP       7
20727
20728 static const val64_string trigger_type_vals[] = {
20729   { 0, "Basic" },
20730   { 1, "Beamforming Report Poll (BRP)" },
20731   { 2, "MU-BAR" },
20732   { 3, "MU-RTS" },
20733   { 4, "Buffer Status Report Poll (BSRP)" },
20734   { 5, "GCR MU-BAR" },
20735   { 6, "Bandwidth Query Report Poll (BQRP)" },
20736   { 7, "NDP Feedback Report Poll (NFRP)" },
20737   { 0, NULL }
20738 };
20739
20740 static const val64_string bw_subfield_vals[] = {
20741   { 0, "20 MHz" },
20742   { 1, "40 MHz" },
20743   { 2, "80 MHz" },
20744   { 3, "80+80 MHz or 160 MHz" },
20745   { 0, NULL }
20746 };
20747
20748 static const val64_string gi_and_ltf_type_subfield_vals[] = {
20749   { 0, "1x LTF + 1.6 us GI" },
20750   { 1, "2x LTF + 1.6 us GI" },
20751   { 2, "4x LTF + 3.2 us GI" },
20752   { 3, "Reserved" },
20753   { 0, NULL }
20754 };
20755
20756 static const true_false_string mu_mimo_ltf_mode_tfs = {
20757   "HE masked HE LTF sequence mode",
20758   "HE single stream pilot HE LTF mode"
20759 };
20760
20761 static const int *he_trig_frm_bar_ctrl_fields[] = {
20762   &hf_ieee80211_he_trigger_bar_ctrl_ba_ack_policy,
20763   &hf_ieee80211_he_trigger_bar_ctrl_ba_type,
20764   &hf_ieee80211_he_trigger_bar_ctrl_reserved,
20765   &hf_ieee80211_he_trigger_bar_ctrl_tid_info,
20766   NULL
20767 };
20768
20769 static const int *he_trig_frm_bar_info_fields[] = {
20770   &hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl,
20771   NULL
20772 };
20773
20774 static void
20775 add_gcr_mu_bar_trigger_frame_common_info(proto_tree *tree, tvbuff_t *tvb,
20776   int offset)
20777 {
20778
20779   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
20780                         hf_ieee80211_he_trigger_bar_ctrl,
20781                         ett_he_trigger_bar_ctrl,
20782                         he_trig_frm_bar_ctrl_fields,
20783                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20784   offset += 2;
20785
20786   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
20787                         hf_ieee80211_he_trigger_bar_info,
20788                         ett_he_trigger_bar_info,
20789                         he_trig_frm_bar_info_fields,
20790                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20791 }
20792
20793 static const int *common_info_headers[] = {
20794   &hf_ieee80211_he_trigger_type,
20795   &hf_ieee80211_he_trigger_length,
20796   &hf_ieee80211_he_trigger_cascade_indication,
20797   &hf_ieee80211_he_trigger_cs_required,
20798   &hf_ieee80211_he_trigger_bw,
20799   &hf_ieee80211_he_trigger_gi_and_ltf_type,
20800   &hf_ieee80211_he_trigger_mu_mimo_ltf_mode,
20801   &hf_ieee80211_he_trigger_num_he_ltf_syms_etc,
20802   &hf_ieee80211_he_trigger_stbc,
20803   &hf_ieee80211_he_trigger_ldpc_extra_sym_seg,
20804   &hf_ieee80211_he_trigger_ap_tx_power,
20805   &hf_ieee80211_he_trigger_packet_extension,
20806   &hf_ieee80211_he_trigger_spatial_reuse,
20807   &hf_ieee80211_he_trigger_doppler,
20808   &hf_ieee80211_he_trigger_he_sig_a_reserved,
20809   &hf_ieee80211_he_trigger_reserved,
20810   NULL
20811 };
20812
20813 static int
20814 add_he_trigger_common_info(proto_tree *tree, tvbuff_t *tvb, int offset,
20815   packet_info *pinfo _U_, guint8 trigger_type, int *frame_len)
20816 {
20817   proto_item     *pi = NULL;
20818   proto_tree     *common_info = NULL;
20819   int            length = 0;
20820   int            start_offset = offset;
20821
20822   common_info = proto_tree_add_subtree(tree, tvb, offset, -1,
20823                         ett_he_trigger_common_info, &pi, "Common Info");
20824
20825   proto_tree_add_bitmask_with_flags(common_info, tvb, offset,
20826                         hf_ieee80211_he_trigger_common_info,
20827                         ett_he_trigger_base_common_info,
20828                         common_info_headers,
20829                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20830   offset += 8;
20831   length += 8;
20832
20833   /*
20834    * Handle the trigger dependent common info
20835    */
20836   switch (trigger_type) {
20837     case TRIGGER_TYPE_GCR_MU_BAR: /* Actually two uint16 fields */
20838       add_gcr_mu_bar_trigger_frame_common_info(common_info, tvb, offset);
20839       offset += 4;
20840       length += 4;
20841       break;
20842     default: /* No other type has a trigger dependent common info subfield */
20843       break;
20844   }
20845   proto_item_set_len(pi, offset - start_offset);
20846
20847   *frame_len += length;
20848   return length;
20849 }
20850
20851 static const true_false_string he_trigger_coding_type_tfs = {
20852   "LDPC",
20853   "BCC"
20854 };
20855
20856 static const value_string preferred_ac_vals[] = {
20857   { 0, "AC_BK" },
20858   { 1, "AC_BE" },
20859   { 2, "AC_VI" },
20860   { 3, "AC_VO" },
20861   { 0, NULL }
20862 };
20863
20864 static const int *basic_trigger_dependent_user_headers[] = {
20865   &hf_ieee80211_he_trigger_mpdu_mu_spacing,
20866   &hf_ieee80211_he_trigger_tid_aggregation_limit,
20867   &hf_ieee80211_he_trigger_dependent_reserved1,
20868   &hf_ieee80211_he_trigger_preferred_ac,
20869   NULL
20870 };
20871
20872 static void
20873 add_basic_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
20874   int offset)
20875 {
20876   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
20877                         hf_ieee80211_he_trigger_dep_basic_user_info,
20878                         ett_he_trigger_dep_basic_user_info,
20879                         basic_trigger_dependent_user_headers,
20880                         ENC_NA, BMT_NO_APPEND);
20881 }
20882
20883 static void
20884 add_brp_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
20885   int offset)
20886 {
20887   proto_tree_add_item(tree, hf_ieee80211_he_trigger_feedback_seg_retrans_bm,
20888                         tvb, offset, 1, ENC_NA);
20889 }
20890
20891 static int
20892 add_mu_bar_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
20893   int offset, packet_info *pinfo, int *frame_len)
20894 {
20895   int start_offset = offset;
20896
20897   /*
20898    * It's a request and not DMG, I think. Also, it is only supposed to be
20899    * a compressed block ack or a multi-tid block ack request.
20900    */
20901   offset = dissect_ieee80211_block_ack_details(tvb, pinfo, tree, offset,
20902                         FALSE, TRUE, FALSE);
20903
20904   *frame_len += offset - start_offset;
20905
20906   return offset;
20907 }
20908
20909
20910 static const int *nfrp_trigger_dependent_user_headers[] = {
20911   &hf_ieee80211_he_trigger_starting_aid,
20912   &hf_ieee80211_he_trigger_dependent_reserved2,
20913   &hf_ieee80211_he_trigger_feedback_type,
20914   &hf_ieee80211_he_trigger_dependent_reserved3,
20915   &hf_ieee80211_he_trigger_nfrp_target_rssi,
20916   &hf_ieee80211_he_trigger_multiplexing_flag,
20917   NULL
20918 };
20919
20920 static void
20921 add_nfrp_trigger_dependent_user_info(proto_tree *tree, tvbuff_t *tvb,
20922   int offset)
20923 {
20924   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
20925                         hf_ieee80211_he_trigger_dep_nfrp_user_info,
20926                         ett_he_trigger_dep_nfrp_user_info,
20927                         nfrp_trigger_dependent_user_headers,
20928                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20929 }
20930
20931 /*
20932  * Print the target RSSI field as per the spec.
20933  *  0->90 map to -110 to -20 dBm.
20934  *  127 maps to Max ransmit power for assigned MCS
20935  *  rest are reserved.
20936  */
20937 static void
20938 target_rssi_base_custom(gchar *result, guint32 target_rssi)
20939 {
20940   if (target_rssi <= 90) {
20941     g_snprintf(result, ITEM_LABEL_LENGTH, "%ddBm", -110 + target_rssi);
20942   } else if (target_rssi == 127) {
20943     g_snprintf(result, ITEM_LABEL_LENGTH, "Max transmit power");
20944   } else {
20945     g_snprintf(result, ITEM_LABEL_LENGTH, "Reserved");
20946   }
20947 }
20948
20949 static const int *user_info_headers[] = {
20950   &hf_ieee80211_he_trigger_aid12,
20951   &hf_ieee80211_he_trigger_ru_allocation,
20952   &hf_ieee80211_he_trigger_coding_type,
20953   &hf_ieee80211_he_trigger_mcs,
20954   &hf_ieee80211_he_trigger_dcm,
20955   &hf_ieee80211_he_trigger_ss_allocation,
20956   &hf_ieee80211_he_trigger_target_rssi,
20957   &hf_ieee80211_he_trigger_user_reserved,
20958   NULL
20959 };
20960
20961 static int
20962 add_he_trigger_user_info(proto_tree *tree, tvbuff_t *tvb, int offset,
20963   packet_info *pinfo, guint8 trigger_type, int *frame_len)
20964 {
20965   proto_item     *pi = NULL;
20966   proto_tree     *user_info = NULL;
20967   int            length = 0;
20968   int            start_offset = offset;
20969   guint16         aid12_subfield = 0;
20970
20971   /*
20972    * If the AID12 subfield has the value 4095 it indicates the start of
20973    * the padding field.
20974    */
20975   user_info = proto_tree_add_subtree(tree, tvb, offset, -1,
20976                         ett_he_trigger_user_info, &pi, "User Info");
20977   aid12_subfield = tvb_get_letohs(tvb, offset) >> 4;
20978
20979   while (aid12_subfield != 4095) {
20980     proto_tree_add_bitmask_with_flags(user_info, tvb, offset,
20981                         hf_ieee80211_he_trigger_user_info,
20982                         ett_he_trigger_base_user_info,
20983                         user_info_headers,
20984                         ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
20985     offset += 5;
20986     length += 5;
20987
20988     /*
20989      * Handle the trigger dependent user info
20990      */
20991     switch (trigger_type) {
20992       case TRIGGER_TYPE_BASIC:
20993         add_basic_trigger_dependent_user_info(user_info, tvb, offset);
20994         offset++;
20995         length++;
20996         break;
20997       case TRIGGER_TYPE_BRP:
20998         add_brp_trigger_dependent_user_info(user_info, tvb, offset);
20999         offset++;
21000         length++;
21001         break;
21002       case TRIGGER_TYPE_MU_BAR:
21003         /* This is variable length so we need it to update the length */
21004         offset += add_mu_bar_trigger_dependent_user_info(user_info, tvb,
21005                                 offset, pinfo, &length);
21006         break;
21007       case TRIGGER_TYPE_NFRP:
21008         add_nfrp_trigger_dependent_user_info(user_info, tvb, offset);
21009         offset += 5;
21010         length += 5;
21011         break;
21012       default:
21013         break;
21014     }
21015
21016     aid12_subfield = tvb_get_letohs(tvb, offset) >> 4;
21017   }
21018
21019   proto_item_set_len(pi, offset - start_offset);
21020
21021   *frame_len += length;
21022   return length;
21023 }
21024
21025 static int
21026 dissect_ieee80211_he_trigger(tvbuff_t *tvb, packet_info *pinfo _U_,
21027   proto_tree *tree, int offset)
21028 {
21029   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21030   proto_item      *hidden_item;
21031   guint8          trigger_type = 0;
21032   int             length = 0;
21033
21034   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21035   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved,
21036                         tvb, offset, 6, ether_name);
21037   PROTO_ITEM_SET_HIDDEN(hidden_item);
21038   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
21039                         ENC_NA);
21040   PROTO_ITEM_SET_HIDDEN(hidden_item);
21041   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
21042                         offset, 6, ether_name);
21043   PROTO_ITEM_SET_HIDDEN(hidden_item);
21044
21045   offset += 6;
21046   length += 6;
21047
21048   trigger_type = tvb_get_guint8(tvb, offset) & 0x0F;
21049   col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
21050                 val64_to_str(trigger_type, trigger_type_vals, "Reserved"));
21051   /*
21052    * Deal with the common Info and then any user info after that.
21053    */
21054   offset += add_he_trigger_common_info(tree, tvb, offset, pinfo,
21055                         trigger_type, &length);
21056
21057   /*
21058    * Now the User Info field.
21059    */
21060   /*offset +=*/ add_he_trigger_user_info(tree, tvb, offset, pinfo,
21061                         trigger_type, &length);
21062
21063   /*
21064    *  Padding should commence here ... TODO, deal with it.
21065    */
21066
21067   return length;
21068 }
21069
21070 /*
21071  * Dissect a VHT or an HE NDP accouncement frame. They differ past
21072  * the sounding dialog token with a bit in the SDT indicating VHT vs HE.
21073  */
21074 #define NDP_ANNC_VHT_HE 0x02
21075
21076 static const true_false_string he_ndp_annc_he_subfield_vals = {
21077   "HE NDP Announcement frame",
21078   "VHT NDP Announcement frame"
21079 };
21080
21081 static const int *vht_ndp_headers[] = {
21082   &hf_ieee80211_vht_ndp_annc_token_reserved,
21083   &hf_ieee80211_vht_ndp_annc_he_subfield,
21084   &hf_ieee80211_vht_ndp_annc_token_number,
21085   NULL
21086 };
21087
21088 static int
21089 dissect_ieee80211_vht_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
21090   proto_tree *tree, int offset, gboolean has_fcs)
21091 {
21092   guint16          sta_info;
21093   guint8           len_fcs = 0;
21094   proto_tree      *sta_list;
21095   proto_item      *sta_info_item, *pi;
21096   int              saved_offset = 0;
21097   int              sta_index = 0;
21098
21099   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
21100                         hf_ieee80211_vht_ndp_annc_token, ett_vht_ndp_annc,
21101                         vht_ndp_headers, ENC_NA, BMT_NO_APPEND);
21102   offset++;
21103
21104   if (has_fcs){
21105     len_fcs = 4;
21106   }
21107
21108   sta_list = proto_tree_add_subtree(tree, tvb, offset, -1,
21109                         ett_vht_ndp_annc_sta_list, &pi, "STA list");
21110   saved_offset = offset;
21111
21112   while (tvb_reported_length_remaining(tvb, offset) > len_fcs) {
21113     sta_info_item = proto_tree_add_subtree_format(sta_list, tvb, offset, 2,
21114                         ett_vht_ndp_annc_sta_info_tree, NULL, "STA %d",
21115                         sta_index++);
21116     proto_tree_add_item(sta_info_item, hf_ieee80211_vht_ndp_annc_sta_info_aid12,
21117                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
21118     proto_tree_add_item(sta_info_item, hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
21119                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
21120
21121     sta_info = tvb_get_letohs(tvb, offset);
21122
21123     if (sta_info & 0x1000)
21124        proto_tree_add_uint(sta_info_item,
21125                            hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
21126                            tvb, offset, 2, sta_info);
21127     else
21128        proto_tree_add_item(sta_info_item, hf_ieee80211_vht_ndp_annc_sta_info_reserved,
21129                            tvb, offset, 2, ENC_LITTLE_ENDIAN);
21130     offset += 2;
21131   }
21132
21133   proto_item_set_len(pi, offset - saved_offset);
21134   return offset;
21135 }
21136
21137 /*
21138  * Format the partial BW as two 7 bit fields.
21139  */
21140 static void
21141 partial_bw_info_base_custom(gchar *result, guint32 partial_bw)
21142 {
21143     g_snprintf(result, ITEM_LABEL_LENGTH,
21144                 "RU Start Index:0x%0x, RU End Index:0x%0x",
21145                 partial_bw >> 7, partial_bw & 0x7F);
21146 }
21147
21148 static const int *he_ndp_headers[] = {
21149   &hf_he_ndp_annc_reserved,
21150   &hf_he_ndp_annc_he_subfield,
21151   &hf_he_ndp_sounding_dialog_token_number,
21152   NULL
21153 };
21154
21155 static const int *he_ndp_sta_headers[] = {
21156   &hf_he_ndp_annc_aid11,
21157   &hf_he_ndp_annc_partial_bw_info,
21158   &hf_he_ndp_annc_feedback_type_and_ng,
21159   &hf_he_ndp_annc_disambiguation,
21160   &hf_he_ndp_annc_codebook_size,
21161   &hf_he_ndp_annc_nc,
21162   NULL
21163 };
21164
21165 static int
21166 dissect_ieee80211_he_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
21167   proto_tree *tree, int offset, gboolean has_fcs)
21168 {
21169   guint8           len_fcs = 0;
21170   proto_tree      *sta_list;
21171   proto_item      *pi;
21172   int              saved_offset;
21173   int              sta_index = 0;
21174
21175   proto_tree_add_bitmask_with_flags(tree, tvb, offset,
21176                         hf_ieee80211_he_ndp_annc_token, ett_he_ndp_annc,
21177                         he_ndp_headers, ENC_NA, BMT_NO_APPEND);
21178   offset++;
21179
21180   if (has_fcs){
21181     len_fcs = 4;
21182   }
21183
21184   saved_offset = offset;
21185   sta_list = proto_tree_add_subtree(tree, tvb, offset, -1,
21186                         ett_he_ndp_annc_sta_list, &pi, "STA list");
21187
21188   while (tvb_reported_length_remaining(tvb, offset) > len_fcs) {
21189     proto_tree *sta_item;
21190
21191     sta_item = proto_tree_add_subtree_format(sta_list, tvb, offset, 4,
21192                         ett_he_ndp_annc_sta_item, NULL, "STA %d", sta_index++);
21193     proto_tree_add_bitmask_with_flags(sta_item, tvb, offset,
21194                         hf_ieee80211_he_ndp_annc_sta, ett_he_ndp_annc_sta_info,
21195                         he_ndp_sta_headers, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
21196
21197     offset += 4;
21198   }
21199
21200   proto_item_set_len(pi, offset - saved_offset);
21201   return offset;
21202 }
21203
21204 static int
21205 dissect_ieee80211_vht_he_ndp_annc(tvbuff_t *tvb, packet_info *pinfo _U_,
21206   proto_tree *tree, int offset, gboolean has_fcs)
21207 {
21208   const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21209   proto_item      *hidden_item;
21210   guint8           dialog_token;
21211
21212   proto_tree_add_item(tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21213   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_ta_resolved, tvb,
21214                         offset, 6, ether_name);
21215   PROTO_ITEM_SET_HIDDEN(hidden_item);
21216   hidden_item = proto_tree_add_item(tree, hf_ieee80211_addr, tvb, offset, 6,
21217                         ENC_NA);
21218   PROTO_ITEM_SET_HIDDEN(hidden_item);
21219   hidden_item = proto_tree_add_string(tree, hf_ieee80211_addr_resolved, tvb,
21220                         offset, 6, ether_name);
21221   PROTO_ITEM_SET_HIDDEN(hidden_item);
21222   offset += 6;
21223
21224   dialog_token = tvb_get_guint8(tvb, offset);
21225
21226   /*
21227    * Is it VHT or HE?
21228    */
21229   if (dialog_token & NDP_ANNC_VHT_HE) {
21230     return dissect_ieee80211_he_ndp_annc(tvb, pinfo, tree, offset, has_fcs);
21231   } else {
21232     return dissect_ieee80211_vht_ndp_annc(tvb, pinfo, tree, offset, has_fcs);
21233   }
21234 }
21235
21236 static void
21237 set_src_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
21238 {
21239   address      ether_addr;
21240
21241   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
21242
21243   col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
21244         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
21245 }
21246
21247 static void
21248 set_dst_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
21249 {
21250   address      ether_addr;
21251
21252   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
21253
21254   col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
21255         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
21256 }
21257
21258 static guint32
21259 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
21260 {
21261   guint32 c_crc;
21262
21263   c_crc = crc32_ccitt_tvb(tvb, hdr_len);
21264   c_crc = crc32_ccitt_tvb_offset_seed(tvb, hdr_size, len, ~c_crc);
21265
21266   return (c_crc);
21267 }
21268
21269 typedef enum {
21270     ENCAP_802_2,
21271     ENCAP_IPX,
21272     ENCAP_ETHERNET
21273 } encap_t;
21274
21275 /* ************************************************************************* */
21276 /*                          Dissect 802.11 frame                             */
21277 /* ************************************************************************* */
21278 /*
21279  * The 802.11n specification makes some fairly significant changes to the
21280  * layout of the MAC header.  The first two bits of the MAC header are the
21281  * protocol version.  You'd think that the 802.11 committee would have
21282  * bumped the version to indicate a different MAC layout, but NOOOO -- we
21283  * have to go digging for bits in various locations instead.
21284  */
21285 static int
21286 dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
21287                           proto_tree *tree, guint32 option_flags,
21288                           struct ieee_802_11_phdr *phdr)
21289 {
21290   guint16          fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
21291   guint16          cw_fcf;
21292   guint16          seq_control;
21293   guint32          seq_number, frag_number;
21294   gboolean         more_frags;
21295   proto_item      *ti          = NULL;
21296   proto_item      *cw_item     = NULL;
21297   proto_item      *hidden_item;
21298   proto_tree      *cw_tree     = NULL;
21299   guint16          hdr_len, ohdr_len;
21300   guint16          htc_len     = 0;
21301   gboolean         has_fcs;
21302   gint             len, reported_len, ivlen;
21303   gint             sta_addr_offset = 0;
21304   const gchar     *station_name;
21305   gboolean         is_amsdu    = 0;
21306   gboolean         save_fragmented;
21307   guint32          addr_type;
21308   guint8           octet1, octet2;
21309   char             out_buff[SHORT_STR];
21310   gint             is_iv_bad;
21311   guchar           iv_buff[4];
21312   const char      *addr1_str   = "RA";
21313   guint            offset;
21314   const gchar     *fts_str;
21315   gchar            flag_str[]  = "opmPRMFTC";
21316   gint             ii;
21317   guint16          qosoff      = 0;
21318   guint16          qos_control = 0;
21319   gint             meshctl_len = 0;
21320   guint8           mesh_flags;
21321   guint16          meshoff     = 0;
21322   static wlan_hdr_t whdrs[4];
21323   gboolean         retransmitted;
21324   gboolean         isDMG = (phdr->has_frequency ?
21325                                 IS_80211AD(phdr->frequency) :
21326                                 FALSE);
21327
21328   encap_t     encap_type;
21329   proto_tree *hdr_tree = NULL;
21330   tvbuff_t   *next_tvb = NULL;
21331   wlan_hdr_t *whdr;
21332
21333   DOT11DECRYPT_KEY_ITEM  used_key;
21334
21335   p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY, GINT_TO_POINTER(isDMG));
21336
21337   whdr= &whdrs[0];
21338
21339   col_set_str(pinfo->cinfo, COL_PROTOCOL, "802.11");
21340   col_clear(pinfo->cinfo, COL_INFO);
21341
21342   fcf = FETCH_FCF(0);
21343   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
21344   whdr->type = frame_type_subtype;
21345   if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
21346     ctrl_fcf = FETCH_FCF(10);
21347   else
21348     ctrl_fcf = 0;
21349
21350   fts_str = val_to_str_ext_const(frame_type_subtype, &frame_type_subtype_vals_ext,
21351                                  "Unrecognized (Reserved frame)");
21352   col_set_str(pinfo->cinfo, COL_INFO, fts_str);
21353
21354
21355 # define FROM_TO_DS 3
21356   flags = FCF_FLAGS(fcf);
21357   more_frags = HAVE_FRAGMENTS(flags);
21358
21359   for (ii = 0; ii < 8; ii++) {
21360     if (! (flags & 0x80 >> ii)) {
21361       flag_str[ii] = '.';
21362     }
21363   }
21364
21365   switch (FCF_FRAME_TYPE (fcf)) {
21366
21367   case MGT_FRAME:
21368     hdr_len = MGT_FRAME_HDR_LEN;
21369     if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
21370       /*
21371        * Management frames with the Order bit set have an HT Control field;
21372        * see 8.2.4.1.10 "Order field".  If they're not HT frames, they should
21373        * never have the Order bit set.
21374        */
21375       hdr_len += 4;
21376       htc_len = 4;
21377     }
21378     break;
21379
21380   case CONTROL_FRAME:
21381     if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
21382       hdr_len = 6;
21383       cw_fcf = ctrl_fcf;
21384     } else {
21385       hdr_len = 0;
21386       cw_fcf = fcf;
21387     }
21388     switch (COMPOSE_FRAME_TYPE (cw_fcf)) {
21389
21390     case CTRL_TRIGGER:
21391       /*
21392        * This is a variable length frame ... we set the real length below
21393        * and since the common info is variable, just set the hdr len to
21394        * the fixed portion, 16. There can also be one or more user-info
21395        * sections, followed by padding.
21396        */
21397       hdr_len = 16;
21398       break;
21399
21400     case CTRL_BEAMFORM_RPT_POLL:
21401       hdr_len += 17;
21402       break;
21403
21404     case CTRL_VHT_NDP_ANNC:
21405       hdr_len += 17;
21406       /* TODO: for now we only consider a single STA, add support for more */
21407       hdr_len += 2;
21408       break;
21409
21410     case CTRL_CTS:
21411     case CTRL_ACKNOWLEDGEMENT:
21412       hdr_len += 10;
21413       break;
21414
21415     case CTRL_POLL:
21416       hdr_len += 18;
21417       break;
21418
21419     case CTRL_SPR:
21420     case CTRL_GRANT:
21421     case CTRL_GRANT_ACK:
21422       hdr_len += 23;
21423       break;
21424
21425     case CTRL_DMG_CTS:
21426       hdr_len += 16;
21427       break;
21428
21429     case CTRL_DMG_DTS:
21430     case CTRL_SSW:
21431       hdr_len += 22;
21432       break;
21433
21434     case CTRL_SSW_FEEDBACK:
21435     case CTRL_SSW_ACK:
21436       hdr_len += 24;
21437       break;
21438
21439     case CTRL_RTS:
21440     case CTRL_PS_POLL:
21441     case CTRL_CFP_END:
21442     case CTRL_CFP_ENDACK:
21443     case CTRL_BLOCK_ACK_REQ:
21444     case CTRL_BLOCK_ACK:
21445       hdr_len += 16;
21446       break;
21447
21448     default:
21449       hdr_len += 4;  /* XXX */
21450       break;
21451     }
21452     break;
21453
21454   case DATA_FRAME:
21455     hdr_len = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
21456
21457     if ((option_flags & IEEE80211_COMMON_OPT_NORMAL_QOS) && DATA_FRAME_IS_QOS(frame_type_subtype)) {
21458       /* QoS frame */
21459       qosoff = hdr_len;
21460       hdr_len += 2; /* Include the QoS field in the header length */
21461
21462       if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
21463         /*
21464          * QoS data frames with the Order bit set have an HT Control field;
21465          * see 8.2.4.1.10 "Order field".  If they're not HT frames, they
21466          * should never have the Order bit set.
21467          */
21468         hdr_len += 4;
21469         htc_len = 4;
21470       }
21471
21472       /*
21473        * Does it look as if we have a mesh header?
21474        * Look at the Mesh Control subfield of the QoS field and at the
21475        * purported mesh flag fields.
21476        */
21477       qos_control = tvb_get_letohs(tvb, qosoff);
21478       if (tvb_bytes_exist(tvb, hdr_len, 1)) {
21479         meshoff = hdr_len;
21480         mesh_flags = tvb_get_guint8(tvb, meshoff);
21481         if (has_mesh_control(fcf, qos_control, mesh_flags)) {
21482           /* Yes, add the length of that in as well. */
21483           meshctl_len = find_mesh_control_length(mesh_flags);
21484           hdr_len += meshctl_len;
21485         }
21486       }
21487     }
21488     break;
21489
21490   case EXTENSION_FRAME:
21491     hdr_len = 10;
21492     break;
21493
21494   default:
21495     hdr_len = 4;  /* XXX */
21496     break;
21497   }
21498
21499   /*
21500    * Some portions of this code calculate offsets relative to the end of the
21501    * header.  But when the header has been padded to align the data this must
21502    * be done relative to true header size, not the padded/aligned value.  To
21503    * simplify this work we stash the original header size in ohdr_len instead
21504    * of recalculating it every time we need it.
21505    */
21506   ohdr_len = hdr_len;
21507   if (phdr->datapad) {
21508     /*
21509      * Add in Atheros padding between the 802.11 header and body.
21510      *
21511      * XXX - would the mesh header be part of the header or the body
21512      * from the point of view of the Atheros adapters that insert
21513      * the padding, assuming they even recognize a mesh header?
21514      */
21515     hdr_len = roundup2(hdr_len, 4);
21516   }
21517
21518   /* Add the FC and duration/id to the current tree */
21519   ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
21520                                            "IEEE 802.11 %s", fts_str);
21521   hdr_tree = proto_item_add_subtree(ti, ett_80211);
21522
21523   dissect_frame_control(hdr_tree, tvb, option_flags, 0, pinfo);
21524   dissect_durid(hdr_tree, tvb, frame_type_subtype, 2);
21525
21526   switch (phdr->fcs_len)
21527     {
21528       case 0: /* Definitely has no FCS */
21529         has_fcs = FALSE;
21530         break;
21531
21532       case 4: /* Definitely has an FCS */
21533         has_fcs = TRUE;
21534         break;
21535
21536       case -2: /* Data frames have no FCS, other frames may have an FCS */
21537                /* XXX: -2 currently used only in wiretap/netmon.c       */
21538         if (FCF_FRAME_TYPE (fcf) == DATA_FRAME)
21539           has_fcs = FALSE;
21540         else /* Management, Control, Extension */
21541           has_fcs = wlan_check_fcs;
21542         break;
21543
21544       default: /* Don't know - use "wlan_check_fcs" */
21545         has_fcs = wlan_check_fcs;
21546         break;
21547     }
21548
21549   /*
21550    * Decode the part of the frame header that isn't the same for all
21551    * frame types.
21552    */
21553   seq_control = 0;
21554   frag_number = 0;
21555   seq_number = 0;
21556
21557   /* all frames have address 1 = RA */
21558   if (tree) {
21559     const gchar *ether_name = tvb_get_ether_name(tvb, 4);
21560     proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
21561     hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ra_resolved, tvb, 4, 6, ether_name);
21562     PROTO_ITEM_SET_HIDDEN(hidden_item);
21563     hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
21564     PROTO_ITEM_SET_HIDDEN(hidden_item);
21565     hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 4, 6, ether_name);
21566     PROTO_ITEM_SET_HIDDEN(hidden_item);
21567   }
21568
21569   switch (FCF_FRAME_TYPE (fcf))
21570   {
21571
21572     case MGT_FRAME:
21573       /*
21574        * All management frame types have the same header.
21575        */
21576       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, 10);
21577       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
21578       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, 4);
21579       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
21580
21581       /* for tap */
21582       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, 16);
21583       copy_address_shallow(&whdr->src, &pinfo->dl_src);
21584       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
21585
21586       seq_control = tvb_get_letohs(tvb, 22);
21587       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
21588       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
21589
21590       col_append_fstr(pinfo->cinfo, COL_INFO,
21591             ", SN=%d", seq_number);
21592
21593       col_append_fstr(pinfo->cinfo, COL_INFO,
21594             ", FN=%d", frag_number);
21595
21596       if (tree)
21597       {
21598         const gchar *ra_da_name, *ta_sa_name, *bssid_name;
21599
21600         ra_da_name = tvb_get_ether_name(tvb, 4);
21601         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
21602         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, 4, 6, ra_da_name);
21603         PROTO_ITEM_SET_HIDDEN(hidden_item);
21604         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
21605         ta_sa_name = tvb_get_ether_name(tvb, 10);
21606         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, 10, 6, ta_sa_name);
21607         PROTO_ITEM_SET_HIDDEN(hidden_item);
21608         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
21609         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, 10, 6, ta_sa_name);
21610         PROTO_ITEM_SET_HIDDEN(hidden_item);
21611         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
21612         bssid_name = tvb_get_ether_name(tvb, 16);
21613         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, 16, 6, bssid_name);
21614         PROTO_ITEM_SET_HIDDEN(hidden_item);
21615
21616         /* FIXME: With mgmt frames FROM_TO_DS is always 0, perhaps compare address to bssid instead? */
21617         if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
21618           sta_addr_offset = 4;
21619         } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
21620           sta_addr_offset = 10;
21621         }
21622         if (sta_addr_offset > 0) {
21623           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
21624           station_name = tvb_get_ether_name(tvb, sta_addr_offset);
21625           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
21626           PROTO_ITEM_SET_HIDDEN(hidden_item);
21627         }
21628         /* add items for wlan.addr filter */
21629         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
21630         PROTO_ITEM_SET_HIDDEN(hidden_item);
21631         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 10, 6, ta_sa_name);
21632         PROTO_ITEM_SET_HIDDEN(hidden_item);
21633         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
21634         PROTO_ITEM_SET_HIDDEN(hidden_item);
21635         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 16, 6, bssid_name);
21636         PROTO_ITEM_SET_HIDDEN(hidden_item);
21637         proto_tree_add_item(hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
21638         proto_tree_add_item(hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
21639       }
21640       break;
21641
21642     case CONTROL_FRAME:
21643     {
21644       /*
21645        * Control Wrapper frames insert themselves between address 1
21646        * and address 2 in a normal control frame.  Process address 1
21647        * first, then handle the rest of the frame in dissect_control.
21648        */
21649       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
21650         offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
21651         ctrl_fcf = FETCH_FCF(10);
21652         ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
21653       } else {
21654         offset = 10; /* FC + D/ID + Address 1 */
21655         ctrl_type_subtype = frame_type_subtype;
21656       }
21657       /* Added to disallow DMG STA to transfer packets of certain forbidden types. */
21658       switch (ctrl_type_subtype)
21659       {
21660         case CTRL_PS_POLL:
21661         case CTRL_CTS:
21662         case CTRL_CFP_ENDACK:
21663         if(isDMG == TRUE) {
21664           expert_add_info_format(pinfo, hdr_tree, &ei_ieee80211_dmg_subtype,
21665               "DMG STA shouldn't transmit control frame of type contention-free period end+ack");
21666         }
21667         break;
21668         default:
21669           break;
21670       }
21671
21672       if (ctrl_type_subtype == CTRL_PS_POLL) {
21673         addr1_str = "BSSID";
21674         if (tree) {
21675           const gchar *ether_name = tvb_get_ether_name(tvb, 4);
21676           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
21677           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, 4, 6, ether_name);
21678           PROTO_ITEM_SET_HIDDEN(hidden_item);
21679         }
21680       }
21681
21682       /* Add address 1 */
21683       set_dst_addr_cols(pinfo, tvb, 4, addr1_str);
21684
21685       /*
21686        * Start shoving in other fields if needed.
21687        */
21688       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
21689         /* if (tree) */
21690         {
21691           cw_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
21692                       ett_cntrl_wrapper_fc, NULL, "Contained Frame Control");
21693           dissect_frame_control(cw_tree, tvb, 0, offset, pinfo);
21694           dissect_ht_control(hdr_tree, tvb, offset + 2);
21695           offset += 6;
21696           hdr_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
21697                       ett_cntrl_wrapper_fc, &cw_item, "Carried Frame");
21698           if (isDMG) {
21699             expert_add_info_format(pinfo, cw_item, &ei_ieee80211_dmg_subtype,
21700                                    "DMG STA shouldn't transmit Control Wrapper frame");
21701           }
21702         }
21703       }
21704
21705       switch (ctrl_type_subtype)
21706       {
21707         case CTRL_PS_POLL:
21708         case CTRL_CFP_ENDACK:
21709         {
21710           set_src_addr_cols(pinfo, tvb, offset, "TA");
21711           /* if (tree) */
21712           {
21713             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21714             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21715             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
21716             PROTO_ITEM_SET_HIDDEN(hidden_item);
21717             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
21718             PROTO_ITEM_SET_HIDDEN(hidden_item);
21719             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
21720             PROTO_ITEM_SET_HIDDEN(hidden_item);
21721             offset += 6;
21722           }
21723           break;
21724         }
21725
21726         case CTRL_CFP_END:
21727         {
21728           if (isDMG)
21729             set_src_addr_cols(pinfo, tvb, offset, "TA");
21730           else
21731             set_src_addr_cols(pinfo, tvb, offset, "BSSID");
21732           /* if (tree) */
21733           {
21734             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21735             if (isDMG) {
21736               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21737               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
21738               PROTO_ITEM_SET_HIDDEN(hidden_item);
21739             } else {
21740               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, offset, 6, ENC_NA);
21741               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, offset, 6, ether_name);
21742               PROTO_ITEM_SET_HIDDEN(hidden_item);
21743             }
21744             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
21745             PROTO_ITEM_SET_HIDDEN(hidden_item);
21746             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
21747             PROTO_ITEM_SET_HIDDEN(hidden_item);
21748             offset += 6;
21749           }
21750           break;
21751         }
21752
21753         case CTRL_TRIGGER:
21754           set_src_addr_cols(pinfo, tvb, offset, "TA");
21755           /*
21756            * The len returned will be adjusted to include any padding required
21757            */
21758           hdr_len = dissect_ieee80211_he_trigger(tvb, pinfo, hdr_tree, offset);
21759           ohdr_len = hdr_len;
21760           has_fcs = FALSE;  /* Not sure at this stage */
21761           break;
21762
21763         case CTRL_BEAMFORM_RPT_POLL:
21764         {
21765           set_src_addr_cols(pinfo, tvb, offset, "TA");
21766           /* if (tree) */
21767           {
21768             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21769
21770             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21771             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
21772             PROTO_ITEM_SET_HIDDEN(hidden_item);
21773             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
21774             PROTO_ITEM_SET_HIDDEN(hidden_item);
21775             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
21776             PROTO_ITEM_SET_HIDDEN(hidden_item);
21777             offset += 6;
21778
21779             proto_tree_add_item(hdr_tree, hf_ieee80211_beamform_feedback_seg_retrans_bitmap, tvb, offset, 1, ENC_NA);
21780           }
21781         break;
21782         }
21783
21784         case CTRL_VHT_NDP_ANNC:
21785           set_src_addr_cols(pinfo, tvb, offset, "TA");
21786
21787           dissect_ieee80211_vht_he_ndp_annc(tvb, pinfo, hdr_tree, offset, has_fcs);
21788           break;
21789
21790         case CTRL_GRANT_ACK:
21791         case CTRL_SSW:
21792         case CTRL_SSW_FEEDBACK:
21793         case CTRL_SSW_ACK:
21794         case CTRL_DMG_CTS:
21795         case CTRL_GRANT:
21796         case CTRL_SPR:
21797         case CTRL_POLL:
21798         case CTRL_RTS:
21799         {
21800           set_src_addr_cols(pinfo, tvb, offset, "TA");
21801           /* if (tree) */
21802           {
21803             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
21804             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
21805             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
21806             PROTO_ITEM_SET_HIDDEN(hidden_item);
21807             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
21808             PROTO_ITEM_SET_HIDDEN(hidden_item);
21809             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
21810             PROTO_ITEM_SET_HIDDEN(hidden_item);
21811             offset += 6;
21812           }
21813           break;
21814         }
21815
21816         case CTRL_CONTROL_WRAPPER:
21817           /* XXX - We shouldn't see this.  Should we throw an error? */
21818           break;
21819
21820         case CTRL_BLOCK_ACK_REQ:
21821           set_src_addr_cols(pinfo, tvb, offset, "TA");
21822
21823           offset = dissect_ieee80211_block_ack(tvb, pinfo, hdr_tree, offset, isDMG, TRUE, has_fcs);
21824           break;
21825
21826         case CTRL_BLOCK_ACK:
21827           set_src_addr_cols(pinfo, tvb, offset, "TA");
21828
21829           offset = dissect_ieee80211_block_ack(tvb, pinfo, hdr_tree, offset, isDMG, FALSE, has_fcs);
21830           break;
21831       }
21832 /*
21833  * 802.11ad : Used for extension types.
21834  */
21835       switch (ctrl_type_subtype) {
21836         case CTRL_POLL: {
21837                 proto_tree_add_item(hdr_tree, hf_ieee80211_cf_response_offset,
21838                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
21839
21840                 break;
21841         }
21842         case CTRL_GRANT:
21843         case CTRL_GRANT_ACK:
21844         case CTRL_SPR: {
21845           gboolean isGrant;
21846           if(ctrl_type_subtype != CTRL_GRANT_ACK) {
21847             offset += add_ff_dynamic_allocation(hdr_tree, tvb, pinfo, offset);
21848           } else { /* CTRL_GRANT_ACK have 5 octets that are reserved*/
21849             proto_tree_add_item(hdr_tree, hf_ieee80211_grant_ack_reserved, tvb, offset, 5, ENC_NA);
21850             offset += 5;
21851           }
21852           isGrant = ((ctrl_type_subtype==CTRL_GRANT)||(ctrl_type_subtype==CTRL_GRANT_ACK));
21853           add_ff_beamforming_ctrl(hdr_tree, tvb, pinfo, offset, isGrant);
21854           /* offset += 2; */
21855           break;
21856         }
21857         case CTRL_SSW: {
21858           guint32 sector_sweep;
21859
21860           sector_sweep = tvb_get_letoh24(tvb, offset);
21861           offset += add_ff_sector_sweep(hdr_tree, tvb, pinfo, offset);
21862           /* if Sector Sweep Direction = Responder, use SW Feedback field format when not transmitted as part of an ISS */
21863           if(sector_sweep & 0x00001) {
21864             add_ff_sector_sweep_feedback_to_iss(hdr_tree, tvb, pinfo, offset);
21865           } else {
21866             add_ff_sector_sweep_feedback_from_iss(hdr_tree, tvb, pinfo, offset);
21867           }
21868           /* offset += 3; */
21869           break;
21870         }
21871         case CTRL_SSW_ACK:
21872         case CTRL_SSW_FEEDBACK: {
21873           offset += add_ff_sector_sweep_feedback_to_iss(hdr_tree, tvb, pinfo, offset);
21874           offset += add_ff_BRP_request(hdr_tree, tvb, pinfo, offset);
21875           add_ff_beamformed_link(hdr_tree, tvb, pinfo, offset);
21876           /* offset += 1; */
21877           break;
21878         }
21879         case CTRL_DMG_DTS: {
21880           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_sa, tvb, offset, 6, ENC_NA);
21881           offset += 6;
21882           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_da, tvb, offset, 6, ENC_NA);
21883           /* offset += 6; */
21884           break;
21885         }
21886         default:
21887                 break;
21888       }
21889       break;
21890     }
21891
21892     case DATA_FRAME:
21893     {
21894       guint32 da_offset, sa_offset, ta_offset = 10, bssid_offset;
21895       addr_type = FCF_ADDR_SELECTOR(fcf);
21896
21897       /* In order to show src/dst address we must always do the following */
21898       switch (addr_type)
21899       {
21900
21901         case DATA_ADDR_T1:
21902           da_offset = 4;
21903           sa_offset = 10;
21904           bssid_offset = 16;
21905           break;
21906
21907         case DATA_ADDR_T2:
21908           da_offset = 4;
21909           sa_offset = 16;
21910           bssid_offset = 10;
21911           break;
21912
21913         case DATA_ADDR_T3:
21914           da_offset = 16;
21915           sa_offset = 10;
21916           bssid_offset = 4;
21917           break;
21918
21919         case DATA_ADDR_T4:
21920           da_offset = 16;
21921           sa_offset = 24;
21922           bssid_offset = 10;
21923           break;
21924
21925         default:
21926           /* Should never happen? */
21927           da_offset = 0;
21928           sa_offset = 0;
21929           ta_offset = 0;
21930           bssid_offset = 0;
21931           break;
21932       }
21933
21934
21935
21936       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, sa_offset);
21937       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
21938       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, da_offset);
21939       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
21940
21941       /* for tap */
21942       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, bssid_offset);
21943
21944       copy_address_shallow(&whdr->src, &pinfo->dl_src);
21945       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
21946
21947       seq_control = tvb_get_letohs(tvb, 22);
21948       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
21949       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
21950
21951       col_append_fstr(pinfo->cinfo, COL_INFO,
21952             ", SN=%d, FN=%d", seq_number, frag_number);
21953
21954       /* Now if we have a tree we start adding stuff */
21955       if (tree)
21956       {
21957         const gchar *ta_name, *sa_name, *da_name, *bssid_name = NULL;
21958
21959         switch (addr_type)
21960         {
21961           case DATA_ADDR_T1:
21962           case DATA_ADDR_T2:
21963           case DATA_ADDR_T3:
21964           case DATA_ADDR_T4:
21965             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, ta_offset, 6, ENC_NA);
21966             ta_name = tvb_get_ether_name(tvb, ta_offset);
21967             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, ta_offset, 6, ta_name);
21968             PROTO_ITEM_SET_HIDDEN(hidden_item);
21969             /* TA is always in the wlan.addr filter */
21970             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, ta_offset, 6, ENC_NA);
21971             PROTO_ITEM_SET_HIDDEN(hidden_item);
21972             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, ta_offset, 6, ta_name);
21973             PROTO_ITEM_SET_HIDDEN(hidden_item);
21974
21975             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_da, tvb, da_offset, 6, ENC_NA);
21976             da_name = tvb_get_ether_name(tvb, da_offset);
21977             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, da_offset, 6, da_name);
21978             PROTO_ITEM_SET_HIDDEN(hidden_item);
21979
21980             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_sa, tvb, sa_offset, 6, ENC_NA);
21981             sa_name = tvb_get_ether_name(tvb, sa_offset);
21982             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, sa_offset, 6, sa_name);
21983             PROTO_ITEM_SET_HIDDEN(hidden_item);
21984
21985             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, bssid_offset, 6, ENC_NA);
21986             bssid_name = tvb_get_ether_name(tvb, bssid_offset);
21987             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, bssid_offset, 6, bssid_name);
21988             PROTO_ITEM_SET_HIDDEN(hidden_item);
21989
21990             if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
21991               sta_addr_offset = 4;
21992             } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
21993               sta_addr_offset = ta_offset;
21994             }
21995             if (sta_addr_offset > 0) {
21996               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
21997               station_name = tvb_get_ether_name(tvb, sta_addr_offset);
21998               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
21999               PROTO_ITEM_SET_HIDDEN(hidden_item);
22000             }
22001             proto_tree_add_item(hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
22002             proto_tree_add_item(hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
22003
22004             /* add 3rd and 4th address for wlan.addr filter */
22005             if (sa_offset != 4 && sa_offset != 10) {
22006               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, sa_offset, 6, ENC_NA);
22007               PROTO_ITEM_SET_HIDDEN(hidden_item);
22008               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, sa_offset, 6, sa_name);
22009               PROTO_ITEM_SET_HIDDEN(hidden_item);
22010             }
22011             if (da_offset != 4 && da_offset != 10 && da_offset != sa_offset) {
22012               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, da_offset, 6, ENC_NA);
22013               PROTO_ITEM_SET_HIDDEN(hidden_item);
22014               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, da_offset, 6, da_name);
22015               PROTO_ITEM_SET_HIDDEN(hidden_item);
22016             }
22017             if (bssid_offset != 4 && bssid_offset != 10 && bssid_offset != sa_offset && bssid_offset != da_offset) {
22018               hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, bssid_offset, 6, ENC_NA);
22019               PROTO_ITEM_SET_HIDDEN(hidden_item);
22020               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, bssid_offset, 6, bssid_name);
22021               PROTO_ITEM_SET_HIDDEN(hidden_item);
22022             }
22023             break;
22024         }
22025
22026       }
22027       break;
22028       }
22029     case EXTENSION_FRAME: {
22030       switch (frame_type_subtype) {
22031         case EXTENSION_DMG_BEACON: {
22032           set_dst_addr_cols(pinfo, tvb, 4, "BSSID");
22033           if (tree) {
22034             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
22035             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
22036             PROTO_ITEM_SET_HIDDEN(hidden_item);
22037           }
22038           break;
22039         }
22040       }
22041     }
22042   }
22043
22044   len = tvb_captured_length_remaining(tvb, hdr_len);
22045   reported_len = tvb_reported_length_remaining(tvb, hdr_len);
22046
22047   if (has_fcs)
22048     {
22049       /*
22050        * Well, this packet should, in theory, have an FCS.
22051        * Do we have the entire packet, and does it have enough data for
22052        * the FCS?
22053        */
22054       if (reported_len < 4)
22055       {
22056         /*
22057          * The packet is claimed not to even have enough data for a 4-byte
22058          * FCS.
22059          * Pretend it doesn't have an FCS.
22060          */
22061         ;
22062       }
22063       else if (len < reported_len)
22064       {
22065         /*
22066          * The packet is claimed to have enough data for a 4-byte FCS, but
22067          * we didn't capture all of the packet.
22068          * Slice off the 4-byte FCS from the reported length, and trim the
22069          * captured length so it's no more than the reported length; that
22070          * will slice off what of the FCS, if any, is in the captured
22071          * length.
22072          */
22073         reported_len -= 4;
22074         if (len > reported_len)
22075             len = reported_len;
22076       }
22077       else
22078       {
22079         /*
22080          * We have the entire packet, and it includes a 4-byte FCS.
22081          * Slice it off, and put it into the tree.
22082          */
22083         len          -= 4;
22084         reported_len -= 4;
22085         if (wlan_check_checksum)
22086         {
22087           guint32 sent_fcs = tvb_get_letohl(tvb, hdr_len + len);
22088           guint32 fcs;
22089
22090           if (phdr->datapad)
22091             fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
22092           else
22093             fcs = crc32_ccitt_tvb(tvb, hdr_len + len);
22094           if (fcs != sent_fcs) {
22095             flag_str[8] = '.';
22096           }
22097
22098           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);
22099         } else {
22100           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);
22101         }
22102       }
22103     }
22104   else
22105     {
22106       flag_str[8] = '\0';
22107     }
22108
22109   proto_item_append_text(ti, ", Flags: %s", flag_str);
22110   col_append_fstr(pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
22111
22112
22113   /*
22114    * Only management and data frames have a body, so we don't have
22115    * anything more to do for other types of frames.
22116    */
22117   switch (FCF_FRAME_TYPE (fcf))
22118     {
22119
22120     case MGT_FRAME:
22121       if (htc_len == 4) {
22122         dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
22123       }
22124       break;
22125
22126     case DATA_FRAME:
22127       if ((option_flags & IEEE80211_COMMON_OPT_NORMAL_QOS) && tree && DATA_FRAME_IS_QOS(frame_type_subtype))
22128       {
22129         proto_item *qos_fields, *qos_ti;
22130         proto_tree *qos_tree;
22131
22132         guint16 qos_eosp;
22133         guint16 qos_field_content;
22134
22135         qos_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_qos, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22136         qos_tree = proto_item_add_subtree(qos_fields, ett_qos_parameters);
22137
22138         qos_eosp = QOS_EOSP(qos_control);
22139         qos_field_content = QOS_FIELD_CONTENT(qos_control);
22140
22141         proto_tree_add_item(qos_tree, hf_ieee80211_qos_tid, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22142
22143         qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_priority, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22144         PROTO_ITEM_SET_GENERATED(qos_ti);
22145
22146         if (FLAGS_DS_STATUS(flags) == (FLAG_FROM_DS|FLAG_TO_DS)) {
22147           /* mesh frame */
22148           proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22149         } else {
22150           if (flags & FLAG_TO_DS) {
22151             proto_tree_add_item(qos_tree, hf_ieee80211_qos_bit4, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22152           } else {
22153             proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22154           }
22155         }
22156
22157         proto_tree_add_item(qos_tree, hf_ieee80211_qos_ack_policy, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22158
22159         if (flags & FLAG_FROM_DS) {
22160           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
22161             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22162             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
22163           }
22164           if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
22165             /* txop limit */
22166               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_limit, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22167             if (qos_field_content == 0) {
22168               proto_item_append_text(qos_ti, " (transmit one frame immediately)");
22169             }
22170           } else {
22171             /* qap ps buffer state */
22172             proto_item *qos_ps_buf_state_fields;
22173             proto_tree *qos_ps_buf_state_tree;
22174
22175             qos_ps_buf_state_fields = proto_tree_add_item(qos_tree, hf_ieee80211_qos_ps_buf_state, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22176             qos_ps_buf_state_tree = proto_item_add_subtree(qos_ps_buf_state_fields, ett_qos_ps_buf_state);
22177
22178             proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_buf_state_indicated, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22179
22180             if (QOS_PS_BUF_STATE_INDICATED(qos_field_content)) {
22181               proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_highest_pri_buf_ac, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22182               qos_ti = proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_qap_buf_load, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22183               switch (QOS_PS_QAP_BUF_LOAD(qos_field_content)) {
22184
22185               case 0:
22186                 proto_item_append_text(qos_ti, " (no buffered traffic)");
22187                 break;
22188
22189               default:
22190                 proto_item_append_text(qos_ti, " (%d octets)", QOS_PS_QAP_BUF_LOAD(qos_field_content)*4096);
22191                 break;
22192
22193               case 15:
22194                 proto_item_append_text(qos_ti, " (greater than 57344 octets)");
22195                 break;
22196               }
22197
22198             }
22199           }
22200         } else {
22201           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
22202             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22203             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
22204           }
22205           /*
22206            * Only QoS Data, Qos CF-ACK and NULL frames To-DS have a Queue Size
22207            * field.
22208            */
22209           if ((DATA_FRAME_IS_NULL(frame_type_subtype) ||
22210                (frame_type_subtype & 0x7) == 0 ||
22211                DATA_FRAME_IS_CF_ACK(frame_type_subtype))) {
22212             if (qos_eosp) {
22213               /* queue size */
22214               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_queue_size, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22215               switch (qos_field_content) {
22216               case 0:
22217                 proto_item_append_text(qos_ti, " (no buffered traffic in the queue)");
22218                 break;
22219
22220               default:
22221                 proto_item_append_text(qos_ti, " (%u bytes)", qos_field_content*256);
22222                 break;
22223
22224               case 254:
22225                 proto_item_append_text(qos_ti, " (more than 64768 octets)");
22226                 break;
22227
22228               case 255:
22229                 proto_item_append_text(qos_ti, " (unspecified or unknown)");
22230                 break;
22231               }
22232             } else {
22233               /* txop duration requested */
22234               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_dur_req,
22235                                    tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
22236               if (qos_field_content == 0) {
22237                 proto_item_append_text(qos_ti, " (no TXOP requested)");
22238               }
22239             }
22240           }
22241         }
22242
22243         /* Do we have +HTC? */
22244         if (htc_len == 4) {
22245           dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
22246         }
22247
22248         if (meshctl_len != 0) {
22249           proto_item *msh_fields;
22250           proto_tree *msh_tree;
22251
22252           msh_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_mesh_control_field, tvb, meshoff, meshctl_len, ENC_NA);
22253           msh_tree = proto_item_add_subtree(msh_fields, ett_msh_control);
22254           add_ff_mesh_control(msh_tree, tvb, pinfo, meshoff);
22255         }
22256
22257       } /* end of qos control field */
22258       if (enable_decryption && !pinfo->fd->flags.visited) {
22259         const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
22260         /* The processing will take care of 4-way handshake sessions for WPA and WPA2 decryption */
22261         Dot11DecryptPacketProcess(&dot11decrypt_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE);
22262
22263       }
22264       /*
22265        * No-data frames don't have a body.
22266        */
22267       if (DATA_FRAME_IS_NULL(frame_type_subtype))
22268         goto end_of_wlan;
22269
22270       if (!wlan_subdissector) {
22271         guint fnum = 0;
22272
22273         /* key: bssid:src
22274          * data: last seq_control seen and frame number
22275          */
22276         retransmitted = FALSE;
22277         if (!pinfo->fd->flags.visited) {
22278           retransmit_key key;
22279           retransmit_key *result;
22280
22281           memcpy(key.bssid, whdr->bssid.data, 6);
22282           memcpy(key.src, whdr->src.data, 6);
22283           key.seq_control = 0;
22284           result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
22285           if (result && (result->seq_control == seq_control)) {
22286             /* keep a pointer to the first seen frame, could be done with proto data? */
22287             fnum = result->fnum;
22288             g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER(pinfo->num),
22289                                 GINT_TO_POINTER(fnum));
22290             retransmitted = TRUE;
22291           } else {
22292             /* first time or new seq*/
22293             if (!result) {
22294               result = wmem_new(wmem_file_scope(), retransmit_key);
22295               *result = key;
22296               g_hash_table_insert(fc_analyse_retransmit_table, result, result);
22297             }
22298             result->seq_control = seq_control;
22299             result->fnum =  pinfo->num;
22300           }
22301         }
22302         else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER(pinfo->num))))) {
22303           retransmitted = TRUE;
22304         }
22305
22306         if (retransmitted) {
22307           col_append_str(pinfo->cinfo, COL_INFO, " [retransmitted]");
22308           if (tree) {
22309             proto_item *item;
22310
22311             item=proto_tree_add_none_format(hdr_tree, hf_ieee80211_fc_analysis_retransmission, tvb, 0, 0,
22312                                             "Retransmitted frame");
22313             PROTO_ITEM_SET_GENERATED(item);
22314             item=proto_tree_add_uint(hdr_tree, hf_ieee80211_fc_analysis_retransmission_frame, tvb, 0, 0, fnum);
22315             PROTO_ITEM_SET_GENERATED(item);
22316           }
22317           next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
22318           call_data_dissector(next_tvb, pinfo, tree);
22319           goto end_of_wlan;
22320         }
22321       }
22322
22323       break;
22324
22325     case CONTROL_FRAME:
22326       goto end_of_wlan;
22327
22328     case EXTENSION_FRAME:
22329       break;
22330
22331     default:
22332       goto end_of_wlan;
22333     }
22334
22335   if (IS_PROTECTED(FCF_FLAGS(fcf))
22336       && !phdr->decrypted
22337       && (wlan_ignore_prot != WLAN_IGNORE_PROT_WO_IV)) {
22338     /*
22339      * It's a WEP or WPA encrypted frame, and it hasn't already been
22340      * decrypted; dissect the protections parameters and decrypt the data,
22341      * if we have a matching key. Otherwise display it as data.
22342      */
22343     gboolean    can_decrypt = FALSE;
22344     proto_tree *wep_tree    = NULL;
22345     guint32     iv;
22346     guint8      key, keybyte;
22347
22348 #define PROTECTION_ALG_WEP  DOT11DECRYPT_KEY_TYPE_WEP
22349 #define PROTECTION_ALG_TKIP  DOT11DECRYPT_KEY_TYPE_TKIP
22350 #define PROTECTION_ALG_CCMP  DOT11DECRYPT_KEY_TYPE_CCMP
22351 #define PROTECTION_ALG_RSNA  PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
22352     guint8 algorithm=G_MAXUINT8;
22353 #define IS_TKIP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 1) == \
22354   ((tvb_get_guint8(tvb, hdr_len) | 0x20) & 0x7f))
22355 #define IS_CCMP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 2) == 0)
22356     guint32 sec_header=0;
22357     guint32 sec_trailer=0;
22358
22359     next_tvb = try_decrypt(tvb, pinfo, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer, &used_key);
22360
22361     keybyte = tvb_get_guint8(tvb, hdr_len + 3);
22362     key = KEY_OCTET_WEP_KEY(keybyte);
22363     if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
22364       /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
22365       if (tree) {
22366         if (algorithm==PROTECTION_ALG_TKIP)
22367           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22368               ett_wep_parameters, NULL, "TKIP parameters");
22369         else if (algorithm==PROTECTION_ALG_CCMP)
22370           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22371             ett_wep_parameters, NULL, "CCMP parameters");
22372         else {
22373           if (IS_TKIP(tvb, hdr_len)) {
22374             algorithm=PROTECTION_ALG_TKIP;
22375             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22376                 ett_wep_parameters, NULL, "TKIP parameters");
22377           } else if (IS_CCMP(tvb, hdr_len)) {
22378             algorithm=PROTECTION_ALG_CCMP;
22379             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22380                 ett_wep_parameters, NULL, "CCMP parameters");
22381           } else
22382             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
22383                 ett_wep_parameters, NULL, "TKIP/CCMP parameters");
22384         }
22385         proto_item_set_len(ti, hdr_len + 8);
22386
22387         if (algorithm==PROTECTION_ALG_TKIP) {
22388           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
22389               tvb_get_letohl(tvb, hdr_len + 4),
22390               tvb_get_guint8(tvb, hdr_len),
22391               tvb_get_guint8(tvb, hdr_len + 2));
22392           proto_tree_add_string(wep_tree, hf_ieee80211_tkip_extiv, tvb, hdr_len,
22393               EXTIV_LEN, out_buff);
22394         } else if (algorithm==PROTECTION_ALG_CCMP) {
22395           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
22396               tvb_get_letohl(tvb, hdr_len + 4),
22397               tvb_get_guint8(tvb, hdr_len + 1),
22398               tvb_get_guint8(tvb, hdr_len));
22399           proto_tree_add_string(wep_tree, hf_ieee80211_ccmp_extiv, tvb, hdr_len,
22400               EXTIV_LEN, out_buff);
22401         }
22402
22403         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
22404       }
22405
22406       /* Subtract out the length of the IV. */
22407       len          -= EXTIV_LEN;
22408       reported_len -= EXTIV_LEN;
22409       ivlen         = EXTIV_LEN;
22410       /* It is unknown whether this is TKIP or CCMP, so let's not even try to
22411        * parse TKIP Michael MIC+ICV or CCMP MIC. */
22412
22413       /* checking for the trailer                            */
22414       if (next_tvb!=NULL) {
22415         if (reported_len < (gint) sec_trailer) {
22416           /* There is no space for a trailer, ignore it and don't decrypt  */
22417           ;
22418         } else if (len < reported_len) {
22419           /* There is space for a trailer, but we haven't capture all the  */
22420           /* packet. Slice off the trailer, but don't try to decrypt      */
22421           reported_len -= sec_trailer;
22422           if (len > reported_len)
22423             len = reported_len;
22424         } else {
22425           /* Ok, we have a trailer and the whole packet. Decrypt it!      */
22426           /* TODO: At the moment we won't add the trailer to the tree,    */
22427           /* so don't remove the trailer from the packet                  */
22428           len          -= sec_trailer;
22429           reported_len -= sec_trailer;
22430           can_decrypt   = TRUE;
22431
22432           /* Add Key information to packet */
22433           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 */
22434           out_buff[2*DOT11DECRYPT_TK_LEN] = '\0';
22435
22436           if (key == 0) { /* encrypted with pairwise key */
22437             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_tk, tvb, 0, 0, out_buff);
22438             PROTO_ITEM_SET_GENERATED(ti);
22439
22440             /* Also add the PMK used to to decrypt the packet. (PMK==PSK) */
22441             bytes_to_hexstr(out_buff, used_key.KeyData.Wpa.Psk, DOT11DECRYPT_WPA_PSK_LEN); /* 32 bytes */
22442             out_buff[2*DOT11DECRYPT_WPA_PSK_LEN] = '\0';
22443             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_pmk, tvb, 0, 0, out_buff);
22444             PROTO_ITEM_SET_GENERATED(ti);
22445
22446           } else { /* Encrypted with Group Key */
22447             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 */
22448             PROTO_ITEM_SET_GENERATED(ti);
22449           }
22450         }
22451       }
22452     } else {
22453       /* No Ext. IV - WEP packet */
22454       /*
22455        * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
22456        * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
22457        * them itself.
22458        *
22459        * Also, just pass the data *following* the WEP parameters as the
22460        * buffer to decrypt.
22461        */
22462       iv = tvb_get_ntoh24(tvb, hdr_len);
22463       if (tree) {
22464         wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 4,
22465             ett_wep_parameters, NULL, "WEP parameters");
22466
22467         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_iv, tvb, hdr_len, 3, iv);
22468         tvb_memcpy(tvb, iv_buff, hdr_len, 3);
22469         is_iv_bad = weak_iv(iv_buff);
22470         if (is_iv_bad != -1) {
22471           proto_tree_add_boolean_format (wep_tree, hf_ieee80211_wep_iv_weak,
22472               tvb, 0, 0, TRUE,
22473               "Weak IV for key byte %d",
22474               is_iv_bad);
22475         }
22476       }
22477       if (tree)
22478         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
22479
22480       /* Subtract out the length of the IV. */
22481       len          -= 4;
22482       reported_len -= 4;
22483       ivlen         = 4;
22484
22485       /* Even if the decryption was not successful, set the algorithm */
22486       algorithm=PROTECTION_ALG_WEP;
22487
22488       /*
22489        * Well, this packet should, in theory, have an ICV.
22490        * Do we have the entire packet, and does it have enough data for
22491        * the ICV?
22492        */
22493       if (reported_len < 4) {
22494         /*
22495          * The packet is claimed not to even have enough data for a
22496          * 4-byte ICV.
22497          * Pretend it doesn't have an ICV.
22498          */
22499         ;
22500       } else if (len < reported_len) {
22501         /*
22502          * The packet is claimed to have enough data for a 4-byte ICV,
22503          * but we didn't capture all of the packet.
22504          * Slice off the 4-byte ICV from the reported length, and trim
22505          * the captured length so it's no more than the reported length;
22506          * that will slice off what of the ICV, if any, is in the
22507          * captured length.
22508          */
22509         reported_len -= 4;
22510         if (len > reported_len)
22511           len         = reported_len;
22512       } else {
22513         /*
22514          * We have the entire packet, and it includes a 4-byte ICV.
22515          * Slice it off, and put it into the tree.
22516          *
22517          * We only support decrypting if we have the the ICV.
22518          *
22519          * XXX - the ICV is encrypted; we're putting the encrypted
22520          * value, not the decrypted value, into the tree.
22521          */
22522         len          -= 4;
22523         reported_len -= 4;
22524         can_decrypt   = TRUE;
22525       }
22526     }
22527
22528     if (algorithm == PROTECTION_ALG_WEP) {
22529       g_strlcpy(wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
22530     } else if (algorithm == PROTECTION_ALG_TKIP) {
22531       g_strlcpy(wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
22532     } else if (algorithm == PROTECTION_ALG_CCMP) {
22533       g_strlcpy(wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
22534     } else {
22535       g_strlcpy(wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
22536     }
22537
22538     /* protection header                                  */
22539     if (!can_decrypt || (next_tvb == NULL)) {
22540       /*
22541        * WEP decode impossible or failed, treat payload as raw data
22542        * and don't attempt fragment reassembly or further dissection.
22543        */
22544       next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len + ivlen, len, reported_len);
22545
22546       if (tree) {
22547         if (algorithm == PROTECTION_ALG_WEP) {
22548           if (can_decrypt)
22549             proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
22550                 hdr_len + ivlen + len, 4,
22551                 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
22552                 "0x%08x (not verified)",
22553                 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
22554         } else if (algorithm == PROTECTION_ALG_CCMP) {
22555         } else if (algorithm == PROTECTION_ALG_TKIP) {
22556         }
22557       }
22558
22559       if ((!(option_flags & IEEE80211_COMMON_OPT_IS_CENTRINO)) && (wlan_ignore_prot == WLAN_IGNORE_PROT_NO)) {
22560         /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
22561         call_data_dissector(next_tvb, pinfo, tree);
22562         goto end_of_wlan;
22563       }
22564     } else {
22565       if (algorithm == PROTECTION_ALG_WEP) {
22566         if (tree)
22567           proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
22568               hdr_len + ivlen + len, 4,
22569               tvb_get_ntohl(tvb, hdr_len + ivlen + len),
22570               "0x%08x (correct)",
22571               tvb_get_ntohl(tvb, hdr_len + ivlen + len));
22572
22573         add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
22574       } else if (algorithm==PROTECTION_ALG_CCMP) {
22575         add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
22576       } else if (algorithm==PROTECTION_ALG_TKIP) {
22577         add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
22578       }
22579 #undef IS_TKIP
22580 #undef IS_CCMP
22581 #undef PROTECTION_ALG_CCMP
22582 #undef PROTECTION_ALG_TKIP
22583 #undef PROTECTION_ALG_WEP
22584     }
22585
22586     /*
22587      * WEP decryption successful!
22588      *
22589      * Use the tvbuff we got back from the decryption; the data starts at
22590      * the beginning.  The lengths are already correct for the decoded WEP
22591      * payload.
22592      */
22593     hdr_len = 0;
22594
22595   } else {
22596     /*
22597      * Not a WEP-encrypted frame; just use the data from the tvbuff
22598      * handed to us.
22599      *
22600      * The payload starts at "hdr_len" (i.e., just past the 802.11
22601      * MAC header), the length of data in the tvbuff following the
22602      * 802.11 header is "len", and the length of data in the packet
22603      * following the 802.11 header is "reported_len".
22604      */
22605     next_tvb = tvb;
22606   }
22607
22608   /*
22609    * Do defragmentation if "wlan_defragment" is true, and we have more
22610    * fragments or this isn't the first fragment.
22611    *
22612    * We have to do some special handling to catch frames that
22613    * have the "More Fragments" indicator not set but that
22614    * don't show up as reassembled and don't have any other
22615    * fragments present.  Some networking interfaces appear
22616    * to do reassembly even when you're capturing raw packets
22617    * *and* show the reassembled packet without the "More
22618    * Fragments" indicator set *but* with a non-zero fragment
22619    * number.
22620    *
22621    * "fragment_add_seq_802_11()" handles that; we want to call it
22622    * even if we have a short frame, so that it does those checks - if
22623    * the frame is short, it doesn't do reassembly on it.
22624    *
22625    * (This could get some false positives if we really *did* only
22626    * capture the last fragment of a fragmented packet, but that's
22627    * life.)
22628    */
22629   save_fragmented = pinfo->fragmented;
22630   if (wlan_defragment && (more_frags || (frag_number != 0))) {
22631     fragment_head *fd_head;
22632
22633     /*
22634      * If we've already seen this frame, look it up in the
22635      * table of reassembled packets, otherwise add it to
22636      * whatever reassembly is in progress, if any, and see
22637      * if it's done.
22638      */
22639     if (reported_len < 0)
22640       THROW(ReportedBoundsError);
22641     fd_head = fragment_add_seq_802_11(&wlan_reassembly_table,
22642         next_tvb, hdr_len, pinfo, seq_number, NULL,
22643         frag_number,
22644         reported_len,
22645         more_frags);
22646     next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
22647         "Reassembled 802.11", fd_head,
22648         &frag_items, NULL, hdr_tree);
22649   } else {
22650     /*
22651      * If this is the first fragment, dissect its contents, otherwise
22652      * just show it as a fragment.
22653      */
22654     if (frag_number != 0) {
22655       /* Not the first fragment - don't dissect it. */
22656       next_tvb = NULL;
22657     } else {
22658       /* First fragment, or not fragmented.  Dissect what we have here. */
22659
22660       /* Get a tvbuff for the payload. */
22661       next_tvb = tvb_new_subset_length_caplen(next_tvb, hdr_len, len, reported_len);
22662
22663       /*
22664        * If this is the first fragment, but not the only fragment,
22665        * tell the next protocol that.
22666        */
22667       if (more_frags)
22668         pinfo->fragmented = TRUE;
22669       else
22670         pinfo->fragmented = FALSE;
22671     }
22672   }
22673
22674   if (next_tvb == NULL) {
22675     /* Just show this as an incomplete fragment. */
22676     col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
22677     next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
22678     call_data_dissector(next_tvb, pinfo, tree);
22679     pinfo->fragmented = save_fragmented;
22680     goto end_of_wlan;
22681   }
22682
22683   switch (FCF_FRAME_TYPE (fcf))
22684     {
22685
22686     case MGT_FRAME:
22687       dissect_ieee80211_mgt(fcf, next_tvb, pinfo, tree);
22688       break;
22689
22690     case DATA_FRAME:
22691       if (is_amsdu && (tvb_reported_length_remaining(next_tvb, 0) > 4)) {
22692         proto_item   *parent_item;
22693         proto_tree   *mpdu_tree;
22694         guint32       msdu_offset = 0;
22695         guint         i           = 1;
22696
22697         parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
22698                                     tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
22699         mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
22700
22701         do {
22702           tvbuff_t           *msdu_tvb;
22703           guint16             msdu_length;
22704           proto_tree         *subframe_tree;
22705           const gchar *resolve_name;
22706
22707           /*
22708            * IEEE Std 802.11-2012 says, in section 8.3.2.2 "A-MSDU format":
22709            *
22710            *  The A-MSDU subframe header contains three fields: DA, SA, and
22711            *  Length. The order of these fields and the bits within these
22712            *  fields are the same as the IEEE 802.3 frame format.
22713            *
22714            * which means that the length field is big-endian, not
22715            * little-endian.
22716            */
22717           msdu_length = tvb_get_ntohs(next_tvb, msdu_offset+12);
22718
22719           parent_item = proto_tree_add_item(mpdu_tree, hf_ieee80211_amsdu_subframe, next_tvb,
22720                             msdu_offset, roundup2(msdu_offset+14+msdu_length, 4), ENC_NA);
22721           proto_item_append_text(parent_item, " #%u", i);
22722           subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
22723           i += 1;
22724
22725           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_da, next_tvb, msdu_offset, 6, ENC_NA);
22726           resolve_name = tvb_get_ether_name(tvb, msdu_offset);
22727           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, msdu_offset, 6,
22728             resolve_name);
22729           PROTO_ITEM_SET_HIDDEN(hidden_item);
22730           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_sa, next_tvb, msdu_offset+6, 6, ENC_NA);
22731           resolve_name = tvb_get_ether_name(tvb, msdu_offset+6);
22732           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, msdu_offset+6, 6,
22733             resolve_name);
22734           PROTO_ITEM_SET_HIDDEN(hidden_item);
22735           proto_tree_add_item(subframe_tree, hf_ieee80211_amsdu_length, next_tvb, msdu_offset+12, 2, ENC_BIG_ENDIAN);
22736
22737           msdu_offset += 14;
22738           msdu_tvb = tvb_new_subset_length(next_tvb, msdu_offset, msdu_length);
22739           call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
22740           msdu_offset = roundup2(msdu_offset+msdu_length, 4);
22741         } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
22742
22743         break;
22744       }
22745       /* I guess some bridges take Netware Ethernet_802_3 frames,
22746          which are 802.3 frames (with a length field rather than
22747          a type field, but with no 802.2 header in the payload),
22748          and just stick the payload into an 802.11 frame.  I've seen
22749          captures that show frames of that sort.
22750
22751          We also handle some odd form of encapsulation in which a
22752          complete Ethernet frame is encapsulated within an 802.11
22753          data frame, with no 802.2 header.  This has been seen
22754          from some hardware.
22755
22756          On top of that, at least at some point it appeared that
22757          the OLPC XO sent out frames with two bytes of 0 between
22758          the "end" of the 802.11 header and the beginning of
22759          the payload. Something similar has also been observed
22760          with Atheros chipsets. There the sequence control field
22761          seems repeated.
22762
22763          So, if the packet doesn't start with 0xaa 0xaa:
22764
22765            we first use the same scheme that linux-wlan-ng does to detect
22766            those encapsulated Ethernet frames, namely looking to see whether
22767            the frame either starts with 6 octets that match the destination
22768            address from the 802.11 header or has 6 octets that match the
22769            source address from the 802.11 header following the first 6 octets,
22770            and, if so, treat it as an encapsulated Ethernet frame;
22771
22772            otherwise, we use the same scheme that we use in the Ethernet
22773            dissector to recognize Netware 802.3 frames, namely checking
22774            whether the packet starts with 0xff 0xff and, if so, treat it
22775            as an encapsulated IPX frame, and then check whether the
22776            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
22777            frame, or check the packet starts with the repetition of the
22778            sequence control field and, if so, treat it as an Atheros frame. */
22779       heur_dtbl_entry_t  *hdtbl_entry;
22780       if (dissector_try_heuristic(heur_subdissector_list, next_tvb, pinfo, tree, &hdtbl_entry, NULL)) {
22781         pinfo->fragmented = save_fragmented;
22782         goto end_of_wlan; /* heuristics dissector handled it. */
22783       }
22784       encap_type = ENCAP_802_2;
22785       if (tvb_bytes_exist(next_tvb, 0, 2)) {
22786         octet1 = tvb_get_guint8(next_tvb, 0);
22787         octet2 = tvb_get_guint8(next_tvb, 1);
22788         if ((octet1 != 0xaa) || (octet2 != 0xaa)) {
22789           if ((tvb_memeql(next_tvb, 6, (const guint8 *)pinfo->dl_src.data, 6) == 0) ||
22790               (tvb_memeql(next_tvb, 0, (const guint8 *)pinfo->dl_dst.data, 6) == 0))
22791             encap_type = ENCAP_ETHERNET;
22792           else if ((octet1 == 0xff) && (octet2 == 0xff))
22793             encap_type = ENCAP_IPX;
22794           else if (((octet1 == 0x00) && (octet2 == 0x00)) ||
22795                    (((octet2 << 8) | octet1) == seq_control)) {
22796             proto_tree_add_item(tree, hf_ieee80211_mysterious_olpc_stuff, next_tvb, 0, 2, ENC_NA);
22797             next_tvb = tvb_new_subset_remaining(next_tvb, 2);
22798           }
22799         }
22800       }
22801
22802       switch (encap_type) {
22803
22804       case ENCAP_802_2:
22805         call_dissector(llc_handle, next_tvb, pinfo, tree);
22806         break;
22807
22808       case ENCAP_ETHERNET:
22809         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
22810         break;
22811
22812       case ENCAP_IPX:
22813         call_dissector(ipx_handle, next_tvb, pinfo, tree);
22814         break;
22815       }
22816       break;
22817
22818     case EXTENSION_FRAME:
22819     {
22820       dissect_ieee80211_extension(fcf, next_tvb, pinfo, tree);
22821       break;
22822     }
22823   }
22824   pinfo->fragmented = save_fragmented;
22825
22826 end_of_wlan:
22827   whdr->stats = wlan_stats;
22828   tap_queue_packet(wlan_tap, pinfo, whdr);
22829   memset(&wlan_stats, 0, sizeof wlan_stats);
22830
22831   return tvb_captured_length(tvb);
22832 }
22833
22834 /*
22835  * Dissect 802.11 with a variable-length link-layer header and with the FCS
22836  * presence or absence indicated by the pseudo-header, if there is one.
22837  */
22838 static int
22839 dissect_ieee80211(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
22840 {
22841   struct ieee_802_11_phdr *phdr = (struct ieee_802_11_phdr *)data;
22842   struct ieee_802_11_phdr ourphdr;
22843
22844   if (phdr == NULL) {
22845     /*
22846      * Fake a pseudo-header.
22847      * XXX - what are we supposed to do if the FCS length is unknown?
22848      */
22849     memset(&ourphdr, 0, sizeof(ourphdr));
22850     ourphdr.fcs_len = -1;
22851     ourphdr.decrypted = FALSE;
22852     ourphdr.datapad = FALSE;
22853     ourphdr.phy = PHDR_802_11_PHY_UNKNOWN;
22854     phdr = &ourphdr;
22855   }
22856   return dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, phdr);
22857 }
22858
22859 /*
22860  * Dissect 802.11 with a variable-length link-layer header and with an
22861  * FCS, but no pseudo-header.
22862  */
22863 static int
22864 dissect_ieee80211_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22865 {
22866   struct ieee_802_11_phdr phdr;
22867
22868   /* Construct a pseudo-header to hand to the common code. */
22869   memset(&phdr, 0, sizeof(phdr));
22870   phdr.fcs_len = 4;
22871   phdr.decrypted = FALSE;
22872   phdr.datapad = FALSE;
22873   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22874   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
22875   return tvb_captured_length(tvb);
22876 }
22877
22878 /*
22879  * Dissect 802.11 with a variable-length link-layer header and without an
22880  * FCS, but no pseudo-header.
22881  */
22882 static int
22883 dissect_ieee80211_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22884 {
22885   struct ieee_802_11_phdr phdr;
22886
22887   /* Construct a pseudo-header to hand to the common code. */
22888   memset(&phdr, 0, sizeof(phdr));
22889   phdr.decrypted = FALSE;
22890   phdr.datapad = FALSE;
22891   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22892   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
22893   return tvb_captured_length(tvb);
22894 }
22895
22896 /*
22897  * Dissect 802.11 from an Intel 2200BG adapter in a Centrino laptop
22898  * running Windows XP.
22899  *
22900  * From
22901  *
22902  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00184.html
22903  *
22904  * and
22905  *
22906  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00393.html:
22907  *
22908  *  I tried capturing from a Centrino laptop with the Intel 2200BG 802.11g
22909  *  chipset. I saw a lot of "Ethernet II" frames with 0x2452 as ethertype.
22910  *
22911  *    ...
22912  *
22913  *  This behaviour has been observed on Windows XP. In my opinion it is
22914  *  a "proprietary" behaviour of either the Centrino driver or the Centrino
22915  *  hardware. Currently I have no Linux distro installed on the machine to
22916  *  verify whether it is also the case.
22917  *
22918  *  These packets are seen only in a promiscuous capture:
22919  *    - Packets normally received by the Centrino computer have the normal
22920  *      structure (no 802.11/LLC header but directly IP header).
22921  *    - Packets that are supposed to be received by another computer have
22922  *      the 802.11/LLC headers. ... Also I noticed that when WEP is enabled,
22923  *      the 802.11 header has the flag "WEP" set to true, but the packet
22924  *      is already decrypted. I added a test in the code to accomodate this.
22925  *      For TKIP it seems to stay encrypted.
22926  */
22927 static int
22928 dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22929 {
22930   struct ieee_802_11_phdr phdr;
22931
22932   /* Construct a pseudo-header to hand to the common code. */
22933   memset(&phdr, 0, sizeof(phdr));
22934   phdr.decrypted = FALSE;
22935   phdr.datapad = FALSE;
22936   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22937   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_IS_CENTRINO|IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
22938   return tvb_captured_length(tvb);
22939 }
22940
22941 /*
22942  * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
22943  * control field and with no FCS (some hardware sends out LWAPP-encapsulated
22944  * 802.11 packets with the control field byte swapped).
22945  */
22946 static int
22947 dissect_ieee80211_bsfc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22948 {
22949   struct ieee_802_11_phdr phdr;
22950
22951   /* Construct a pseudo-header to hand to the common code. */
22952   memset(&phdr, 0, sizeof(phdr));
22953   phdr.decrypted = FALSE;
22954   phdr.datapad = FALSE;
22955   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22956   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_BROKEN_FC|IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
22957   return tvb_captured_length(tvb);
22958 }
22959
22960 /*
22961  * Dissect 802.11 with a variable-length link-layer header without qos elements
22962  * in data+qos frames and with no FCS (sent as WIDS frames by Cisco standalone
22963  * APs).
22964  */
22965 static int
22966 dissect_ieee80211_noqos(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
22967 {
22968   struct ieee_802_11_phdr phdr;
22969
22970   /* Construct a pseudo-header to hand to the common code. */
22971   memset(&phdr, 0, sizeof(phdr));
22972   phdr.decrypted = FALSE;
22973   phdr.datapad = FALSE;
22974   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
22975   dissect_ieee80211_common(tvb, pinfo, tree, 0, &phdr);
22976   return tvb_captured_length(tvb);
22977 }
22978
22979
22980 /* ------------- */
22981 static guint
22982 retransmit_hash(gconstpointer k)
22983 {
22984   const retransmit_key *key = (const retransmit_key *)k;
22985   guint hash_val;
22986   int   i;
22987
22988   hash_val = 0;
22989   for (i = 0; i < 6; i++)
22990     hash_val += key->bssid[i];
22991
22992   for (i = 0; i < 6; i++)
22993     hash_val += key->src[i];
22994
22995   return hash_val;
22996 }
22997
22998 static gint
22999 retransmit_equal(gconstpointer k1, gconstpointer k2)
23000 {
23001   const retransmit_key *key1 = (const retransmit_key *)k1;
23002   const retransmit_key *key2 = (const retransmit_key *)k2;
23003
23004   return ((!memcmp(key1->bssid, key2->bssid, 6) && !memcmp(key1->src, key2->src, 6)) ? TRUE:FALSE);
23005 }
23006
23007 static guint
23008 frame_hash(gconstpointer k)
23009 {
23010   guint32 frame = GPOINTER_TO_UINT(k);
23011
23012   return frame;
23013 }
23014
23015 static gint
23016 frame_equal(gconstpointer k1, gconstpointer k2)
23017 {
23018   guint32 frame1 = GPOINTER_TO_UINT(k1);
23019   guint32 frame2 = GPOINTER_TO_UINT(k2);
23020
23021   return frame1==frame2;
23022 }
23023
23024 /*
23025  * EAPOL key description dissectors.
23026  */
23027 #define KEY_INFO_KEYDES_VERSION_MASK        0x0007
23028 #define KEY_INFO_KEY_TYPE_MASK              0x0008
23029 #define KEY_INFO_KEY_INDEX_MASK             0x0030
23030 #define KEY_INFO_INSTALL_MASK               0x0040
23031 #define KEY_INFO_KEY_ACK_MASK               0x0080
23032 #define KEY_INFO_KEY_MIC_MASK               0x0100
23033 #define KEY_INFO_SECURE_MASK                0x0200
23034 #define KEY_INFO_ERROR_MASK                 0x0400
23035 #define KEY_INFO_REQUEST_MASK               0x0800
23036 #define KEY_INFO_ENCRYPTED_KEY_DATA_MASK    0x1000
23037 #define KEY_INFO_SMK_MESSAGE_MASK           0x2000
23038
23039 #define KEYDES_VER_TYPE1        0x01
23040 #define KEYDES_VER_TYPE2        0x02
23041 #define KEYDES_VER_TYPE3        0x03
23042
23043 static const value_string keydes_version_vals[] = {
23044   { KEYDES_VER_TYPE1,     "RC4 Cipher, HMAC-MD5 MIC" },
23045   { KEYDES_VER_TYPE2,     "AES Cipher, HMAC-SHA1 MIC" },
23046   { KEYDES_VER_TYPE3,     "AES Cipher, AES-128-CMAC MIC" },
23047   { 0, NULL }
23048 };
23049
23050 static int proto_wlan_rsna_eapol = -1;
23051
23052 static int hf_wlan_rsna_eapol_wpa_keydes_msgnr = -1;
23053 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo = -1;
23054 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version = -1;
23055 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type = -1;
23056 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index = -1;
23057 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install = -1;
23058 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack = -1;
23059 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic = -1;
23060 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure = -1;
23061 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error = -1;
23062 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request = -1;
23063 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data = -1;
23064 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message = -1;
23065 static int hf_wlan_rsna_eapol_keydes_key_len = -1;
23066 static int hf_wlan_rsna_eapol_keydes_replay_counter = -1;
23067 static int hf_wlan_rsna_eapol_keydes_key_iv = -1;
23068 static int hf_wlan_rsna_eapol_wpa_keydes_nonce = -1;
23069 static int hf_wlan_rsna_eapol_wpa_keydes_rsc = -1;
23070 static int hf_wlan_rsna_eapol_wpa_keydes_id = -1;
23071 static int hf_wlan_rsna_eapol_wpa_keydes_mic = -1;
23072 static int hf_wlan_rsna_eapol_wpa_keydes_data_len = -1;
23073 static int hf_wlan_rsna_eapol_wpa_keydes_data = -1;
23074
23075 static gint ett_keyinfo = -1;
23076 static gint ett_wlan_rsna_eapol_keydes_data = -1;
23077
23078 static const true_false_string keyinfo_key_type_tfs = { "Pairwise Key", "Group Key" };
23079
23080 static int
23081 dissect_wlan_rsna_eapol_wpa_or_rsn_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
23082 {
23083   int         offset = 0;
23084   guint16     keyinfo;
23085   guint16     eapol_data_len;
23086   proto_tree *keydes_tree;
23087   proto_tree *ti = NULL;
23088   static const int * wlan_rsna_eapol_wpa_keydes_keyinfo[] = {
23089     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version,
23090     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type,
23091     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index,
23092     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install,
23093     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack,
23094     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic,
23095     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure,
23096     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error,
23097     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request,
23098     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data,
23099     &hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
23100     NULL
23101   };
23102   guint16 eapol_data_offset = 76;  /* 92 - 16 */
23103   guint16 eapol_key_mic_len = 0;
23104
23105   if (wlan_key_mic_len) {
23106     eapol_data_offset += wlan_key_mic_len;
23107     eapol_key_mic_len = wlan_key_mic_len;
23108   } else {
23109     eapol_data_offset = 92;
23110     eapol_key_mic_len = 16;
23111   }
23112
23113   /*
23114    * RSNA key descriptors.
23115    */
23116   eapol_data_len = tvb_get_ntohs(tvb, offset+eapol_data_offset);
23117   keyinfo = tvb_get_ntohs(tvb, offset);
23118   if (keyinfo & KEY_INFO_REQUEST_MASK) {
23119     col_set_str(pinfo->cinfo, COL_INFO, "Key (Request)");
23120     if (keyinfo & KEY_INFO_ERROR_MASK)
23121       col_set_str(pinfo->cinfo, COL_INFO, "Key (Request, Error)");
23122   } else if (keyinfo & KEY_INFO_KEY_TYPE_MASK) {
23123     guint16 masked;
23124     /* Windows is setting the Secure Bit on message 2 when rekeying, so we'll ignore it */
23125     masked = keyinfo &
23126       (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK);
23127
23128     switch (masked) {
23129     case KEY_INFO_KEY_ACK_MASK:
23130     {
23131       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 1);
23132
23133       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 1 of 4)");
23134       break;
23135     }
23136     case KEY_INFO_KEY_MIC_MASK:
23137       /* We check the key length to differentiate between message 2 and 4 and just hope that
23138       there are no strange implementations with key data and non-zero key length in message 4.
23139       According to the IEEE specification, sections 11.6.6.3 and 11.6.6.5 we should
23140       use the Secure Bit and/or the Nonce, but there are implementations ignoring the spec.
23141       The Secure Bit is incorrectly set on rekeys for Windows clients for Message 2 and the Nonce is non-zero
23142       in Message 4 in Bug 11994 (Apple?) */
23143       if (eapol_data_len) {
23144         ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 2);
23145
23146         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 2 of 4)");
23147       } else {
23148         ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 4);
23149
23150         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 4 of 4)");
23151       }
23152       break;
23153
23154     case (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK):
23155     {
23156       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 3);
23157
23158       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 3 of 4)");
23159       break;
23160     }
23161     }
23162   } else {
23163     if (keyinfo & KEY_INFO_KEY_ACK_MASK) {
23164       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 1);
23165
23166       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 1 of 2)");
23167     } else {
23168       ti = proto_tree_add_uint(tree, hf_wlan_rsna_eapol_wpa_keydes_msgnr, tvb, offset, 0, 2);
23169
23170       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 2 of 2)");
23171     }
23172   }
23173
23174   PROTO_ITEM_SET_GENERATED(ti);
23175
23176   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_wlan_rsna_eapol_wpa_keydes_keyinfo,
23177                                     ett_keyinfo, wlan_rsna_eapol_wpa_keydes_keyinfo,
23178                                     ENC_BIG_ENDIAN, BMT_NO_APPEND);
23179   offset += 2;
23180
23181   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_len, tvb, offset,
23182                       2, ENC_BIG_ENDIAN);
23183   offset += 2;
23184   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_replay_counter, tvb,
23185                       offset, 8, ENC_BIG_ENDIAN);
23186   offset += 8;
23187   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_nonce, tvb, offset,
23188                       32, ENC_NA);
23189   offset += 32;
23190   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_iv, tvb,
23191                       offset, 16, ENC_NA);
23192   offset += 16;
23193   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_rsc, tvb, offset,
23194                       8, ENC_NA);
23195   offset += 8;
23196   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_id, tvb, offset, 8,
23197                       ENC_NA);
23198   offset += 8;
23199   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_mic, tvb, offset,
23200                       eapol_key_mic_len, ENC_NA);
23201   offset += eapol_key_mic_len;
23202   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data_len, tvb,
23203                       offset, 2, ENC_BIG_ENDIAN);
23204   offset += 2;
23205   if (eapol_data_len != 0) {
23206     ti = proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data,
23207                              tvb, offset, eapol_data_len, ENC_NA);
23208     if ((keyinfo & KEY_INFO_ENCRYPTED_KEY_DATA_MASK) ||
23209         !(keyinfo & KEY_INFO_KEY_TYPE_MASK)) {
23210       /* RSN: EAPOL-Key Key Data is encrypted.
23211        * WPA: Group Keys use encrypted Key Data.
23212        * Cannot parse this without knowing the key.
23213        * IEEE 802.11i-2004 8.5.2.
23214        */
23215     } else {
23216       keydes_tree = proto_item_add_subtree(ti, ett_wlan_rsna_eapol_keydes_data);
23217       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, keydes_tree,
23218                                        tvb_reported_length_remaining(tvb, offset),
23219                                        -1, NULL);
23220     }
23221   }
23222   return tvb_captured_length(tvb);
23223 }
23224
23225 /* It returns the algorithm used for decryption and the header and trailer lengths. */
23226 static tvbuff_t *
23227 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)
23228 {
23229   const guint8      *enc_data;
23230   tvbuff_t          *decr_tvb = NULL;
23231   guint32            dec_caplen;
23232   guchar             dec_data[DOT11DECRYPT_MAX_CAPLEN];
23233
23234   if (!enable_decryption)
23235     return NULL;
23236
23237   /* get the entire packet                                  */
23238   enc_data = tvb_get_ptr(tvb, 0, len+offset);
23239
23240   /*  process packet with Dot11Decrypt                              */
23241   if (Dot11DecryptPacketProcess(&dot11decrypt_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen,
23242                             used_key, FALSE)==DOT11DECRYPT_RET_SUCCESS)
23243   {
23244     guint8 *tmp;
23245     *algorithm=used_key->KeyType;
23246     switch (*algorithm) {
23247       case DOT11DECRYPT_KEY_TYPE_WEP:
23248         *sec_header=DOT11DECRYPT_WEP_HEADER;
23249         *sec_trailer=DOT11DECRYPT_WEP_TRAILER;
23250         break;
23251       case DOT11DECRYPT_KEY_TYPE_CCMP:
23252         *sec_header=DOT11DECRYPT_RSNA_HEADER;
23253         *sec_trailer=DOT11DECRYPT_CCMP_TRAILER;
23254         break;
23255       case DOT11DECRYPT_KEY_TYPE_TKIP:
23256         *sec_header=DOT11DECRYPT_RSNA_HEADER;
23257         *sec_trailer=DOT11DECRYPT_TKIP_TRAILER;
23258         break;
23259       default:
23260         return NULL;
23261     }
23262
23263     /* allocate buffer for decrypted payload                      */
23264     tmp = (guint8 *)wmem_memdup(pinfo->pool, dec_data+offset, dec_caplen-offset);
23265
23266     len = dec_caplen-offset;
23267
23268     /* decrypt successful, let's set up a new data tvb.              */
23269     decr_tvb = tvb_new_child_real_data(tvb, tmp, len, len);
23270   }
23271
23272   return decr_tvb;
23273 }
23274
23275 /* Collect our WEP and WPA keys */
23276 static void
23277 set_dot11decrypt_keys(void)
23278 {
23279   guint                     i;
23280   DOT11DECRYPT_KEYS_COLLECTION  *keys = g_new(DOT11DECRYPT_KEYS_COLLECTION, 1);
23281   GByteArray                *bytes = NULL;
23282
23283   keys->nKeys = 0;
23284
23285   for (i = 0; (uat_wep_key_records != NULL) && (i < num_wepkeys_uat) && (i < MAX_ENCRYPTION_KEYS); i++)
23286   {
23287     decryption_key_t *dk;
23288     dk = parse_key_string(uat_wep_key_records[i].string, uat_wep_key_records[i].key);
23289
23290     if (dk != NULL)
23291     {
23292       DOT11DECRYPT_KEY_ITEM          key;
23293       if (dk->type == DOT11DECRYPT_KEY_TYPE_WEP)
23294       {
23295         gboolean res;
23296         key.KeyType = DOT11DECRYPT_KEY_TYPE_WEP;
23297
23298         bytes = g_byte_array_new();
23299         res = hex_str_to_bytes(dk->key->str, bytes, FALSE);
23300
23301         if (dk->key->str && res && (bytes->len > 0) && (bytes->len <= DOT11DECRYPT_WEP_KEY_MAXLEN))
23302         {
23303           /*
23304            * WEP key is correct (well, the can be even or odd, so it is not
23305            * a real check, I think... is a check performed somewhere in the
23306            * Dot11Decrypt function???)
23307            */
23308           memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
23309           key.KeyData.Wep.WepKeyLen = bytes->len;
23310           keys->Keys[keys->nKeys] = key;
23311           keys->nKeys += 1;
23312         }
23313       }
23314       else if (dk->type == DOT11DECRYPT_KEY_TYPE_WPA_PWD)
23315       {
23316         key.KeyType = DOT11DECRYPT_KEY_TYPE_WPA_PWD;
23317
23318         /* XXX - This just lops the end if the key off if it's too long.
23319          *       Should we handle this more gracefully? */
23320         g_strlcpy(key.UserPwd.Passphrase, dk->key->str, DOT11DECRYPT_WPA_PASSPHRASE_MAX_LEN+1);
23321
23322         key.UserPwd.SsidLen = 0;
23323         if ((dk->ssid != NULL) && (dk->ssid->len <= DOT11DECRYPT_WPA_SSID_MAX_LEN))
23324         {
23325           memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
23326           key.UserPwd.SsidLen = dk->ssid->len;
23327         }
23328
23329         keys->Keys[keys->nKeys] = key;
23330         keys->nKeys += 1;
23331       }
23332       else if (dk->type == DOT11DECRYPT_KEY_TYPE_WPA_PSK)
23333       {
23334         key.KeyType = DOT11DECRYPT_KEY_TYPE_WPA_PSK;
23335
23336         bytes = g_byte_array_new();
23337         hex_str_to_bytes(dk->key->str, bytes, FALSE);
23338
23339         /* XXX - Pass the correct array of bytes... */
23340         if (bytes->len <= DOT11DECRYPT_WPA_PSK_LEN) {
23341           memcpy(key.KeyData.Wpa.Psk, bytes->data, bytes->len);
23342
23343           keys->Keys[keys->nKeys] = key;
23344           keys->nKeys += 1;
23345         }
23346       }
23347       free_key_string(dk);
23348       if (bytes) {
23349         g_byte_array_free(bytes, TRUE);
23350         bytes = NULL;
23351       }
23352     }
23353   }
23354
23355   /* Now set the keys */
23356   Dot11DecryptSetKeys(&dot11decrypt_ctx, keys->Keys, keys->nKeys);
23357   g_free(keys);
23358 }
23359
23360 static void
23361 init_wepkeys(void)
23362 {
23363
23364   /*
23365    * XXX - Dot11Decrypt - That God sends it to us beautiful (che dio ce la mandi bona)
23366    * The next lines will add a key to the Dot11Decrypt context. The keystring will be added
23367    * to the old WEP array too, but we don't care, because the packets will come here
23368    * already decrypted... One of these days we will fix this too
23369    */
23370   set_dot11decrypt_keys();
23371 }
23372
23373 /*
23374  * This code had been taken from AirSnort crack.c function classify()
23375  * Permission granted by snax <at> shmoo dot com
23376  * weak_iv - determine which key byte an iv is useful in resolving
23377  * parm     - p, pointer to the first byte of an IV
23378  * return   -  n - this IV is weak for byte n of a WEP key
23379  *            -1 - this IV is not weak for any key bytes
23380  *
23381  * This function tests for IVs that are known to satisfy the criteria
23382  * for a weak IV as specified in FMS section 7.1
23383  *
23384  */
23385 static int
23386 weak_iv(guchar *iv)
23387 {
23388   guchar sum, k;
23389
23390   if ((iv[1] == 255) && (iv[0] > 2) && (iv[0] < 16)) {
23391     return iv[0] -3;
23392   }
23393
23394   sum = iv[0] + iv[1];
23395   if (sum == 1) {
23396     if (iv[2] <= 0x0a) {
23397       return iv[2] +2;
23398     }
23399     else if (iv[2] == 0xff) {
23400       return 0;
23401     }
23402   }
23403   k = 0xfe - iv[2];
23404   if ((sum == k)  && ((iv[2] >= 0xf2) && (iv[2] <= 0xfe) && (iv[2] != 0xfd))) {
23405     return k;
23406   }
23407   return -1;
23408 }
23409
23410 static void
23411 wlan_retransmit_init(void)
23412 {
23413   if (fc_analyse_retransmit_table) {
23414     g_hash_table_destroy(fc_analyse_retransmit_table);
23415     fc_analyse_retransmit_table = NULL;
23416   }
23417
23418   if (fc_first_frame_table) {
23419     g_hash_table_destroy(fc_first_frame_table);
23420     fc_first_frame_table = NULL;
23421   }
23422
23423   if (wlan_subdissector)
23424     return;
23425
23426   fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
23427   fc_first_frame_table = g_hash_table_new(frame_hash, frame_equal);
23428
23429 }
23430
23431 static int
23432 dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
23433 {
23434   int         offset = 0;
23435   guint8      type;
23436   int         tagged_parameter_tree_len;
23437   proto_tree *tagged_tree;
23438
23439   type = tvb_get_guint8(tvb, offset);
23440   proto_tree_add_item(tree, hf_ieee80211_data_encap_payload_type, tvb, offset,
23441                       1, ENC_LITTLE_ENDIAN);
23442   offset += 1;
23443   switch (type) {
23444   case 1:
23445     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRB");
23446     /* TODO: IEEE 802.11r */
23447     break;
23448   case 2:
23449     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
23450     col_clear(pinfo->cinfo, COL_INFO);
23451     offset += add_ff_action(tree, tvb, pinfo, offset);
23452     tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
23453     if (tagged_parameter_tree_len > 0) {
23454       tagged_tree = get_tagged_parameter_tree(tree, tvb, offset,
23455                                               tagged_parameter_tree_len);
23456       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
23457                                        tagged_parameter_tree_len, -1, NULL);
23458     }
23459     break;
23460   }
23461   return tvb_captured_length(tvb);
23462 }
23463
23464 void
23465 proto_register_ieee80211(void)
23466 {
23467
23468   static hf_register_info hf[] = {
23469     {&hf_ieee80211_fc_field,
23470      {"Frame Control Field", "wlan.fc",
23471       FT_UINT16, BASE_HEX, NULL, 0,
23472       "MAC Frame control", HFILL }},
23473
23474     {&hf_ieee80211_fc_proto_version,
23475      {"Version", "wlan.fc.version",
23476       FT_UINT8, BASE_DEC, NULL, 0x03,
23477       "MAC Protocol version", HFILL }},  /* 0 */
23478
23479     {&hf_ieee80211_fc_frame_type,
23480      {"Type", "wlan.fc.type",
23481       FT_UINT8, BASE_DEC, VALS(frame_type), 0x0C,
23482       "Frame type", HFILL }},
23483
23484     {&hf_ieee80211_fc_frame_subtype,
23485      {"Subtype", "wlan.fc.subtype",
23486       FT_UINT8, BASE_DEC, NULL, 0xF0,
23487       "Frame subtype", HFILL }},  /* 2 */
23488
23489     {&hf_ieee80211_fc_frame_type_subtype,
23490      {"Type/Subtype", "wlan.fc.type_subtype",
23491       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &frame_type_subtype_vals_ext, 0x0,
23492       "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
23493
23494     {&hf_ieee80211_fc_frame_extension,
23495      {"Control Frame Extension", "wlan.fc.extension",
23496       FT_UINT8, BASE_DEC, NULL, 0,
23497       NULL, HFILL }},
23498
23499     {&hf_ieee80211_fc_flags,
23500      {"Flags", "wlan.flags",
23501       FT_UINT8, BASE_HEX, NULL, 0,
23502       NULL, HFILL }},
23503
23504     {&hf_ieee80211_fc_data_ds,
23505      {"DS status", "wlan.fc.ds",
23506       FT_UINT8, BASE_HEX, VALS(tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
23507       "Data-frame DS-traversal status", HFILL }},  /* 3 */
23508
23509     {&hf_ieee80211_fc_to_ds,
23510      {"To DS", "wlan.fc.tods",
23511       FT_BOOLEAN, 8, TFS(&tods_flag), FLAG_TO_DS,
23512       "To DS flag", HFILL }},    /* 4 */
23513
23514     {&hf_ieee80211_fc_from_ds,
23515      {"From DS", "wlan.fc.fromds",
23516       FT_BOOLEAN, 8, TFS(&fromds_flag), FLAG_FROM_DS,
23517       "From DS flag", HFILL }},    /* 5 */
23518
23519     {&hf_ieee80211_fc_more_frag,
23520      {"More Fragments", "wlan.fc.frag",
23521       FT_BOOLEAN, 8, TFS(&more_fragments), FLAG_MORE_FRAGMENTS,
23522       "More Fragments flag", HFILL }},  /* 6 */
23523
23524     {&hf_ieee80211_fc_retry,
23525      {"Retry", "wlan.fc.retry",
23526       FT_BOOLEAN, 8, TFS(&retry_flags), FLAG_RETRY,
23527       "Retransmission flag", HFILL }},
23528
23529     {&hf_ieee80211_fc_analysis_retransmission,
23530      {"Retransmission", "wlan.analysis.retransmission",
23531       FT_NONE, BASE_NONE, NULL, 0x0,
23532       "This frame is a suspected wireless retransmission", HFILL }},
23533
23534     {&hf_ieee80211_fc_analysis_retransmission_frame,
23535      {"Retransmission of frame", "wlan.analysis.retransmission_frame",
23536       FT_FRAMENUM, BASE_NONE, NULL, 0x0,
23537       "This is a retransmission of frame #", HFILL }},
23538
23539     {&hf_ieee80211_fc_pwr_mgt,
23540      {"PWR MGT", "wlan.fc.pwrmgt",
23541       FT_BOOLEAN, 8, TFS(&pm_flags), FLAG_POWER_MGT,
23542       "Power management status", HFILL }},
23543
23544     {&hf_ieee80211_fc_more_data,
23545      {"More Data", "wlan.fc.moredata",
23546       FT_BOOLEAN, 8, TFS(&md_flags), FLAG_MORE_DATA,
23547       "More data flag", HFILL }},
23548
23549     {&hf_ieee80211_fc_protected,
23550      {"Protected flag", "wlan.fc.protected",
23551       FT_BOOLEAN, 8, TFS(&protected_flags), FLAG_PROTECTED,
23552       NULL, HFILL }},
23553
23554     {&hf_ieee80211_fc_order,
23555      {"Order flag", "wlan.fc.order",
23556       FT_BOOLEAN, 8, TFS(&order_flags), FLAG_ORDER,
23557       "Strictly ordered flag", HFILL }},
23558
23559     {&hf_ieee80211_assoc_id,
23560      {"Association ID", "wlan.aid",
23561       FT_UINT16, BASE_DEC, NULL, 0x3FFF,
23562       NULL, HFILL }},
23563
23564     {&hf_ieee80211_did_duration,
23565      {"Duration", "wlan.duration",
23566       FT_UINT16, BASE_DEC, NULL, 0x7FFF,
23567       NULL, HFILL }},
23568
23569     {&hf_ieee80211_addr_da,
23570      {"Destination address", "wlan.da",
23571       FT_ETHER, BASE_NONE, NULL, 0,
23572       "Destination Hardware Address", HFILL }},
23573
23574     {&hf_ieee80211_addr_da_resolved,
23575       {"Destination address (resolved)", "wlan.da_resolved", FT_STRING,
23576         BASE_NONE, NULL, 0x0,
23577         "Destination Hardware Address (resolved)", HFILL }},
23578
23579     {&hf_ieee80211_addr_sa,
23580      {"Source address", "wlan.sa",
23581       FT_ETHER, BASE_NONE, NULL, 0,
23582       "Source Hardware Address", HFILL }},
23583
23584     {&hf_ieee80211_addr_sa_resolved,
23585       {"Source address (resolved)", "wlan.sa_resolved", FT_STRING,
23586        BASE_NONE, NULL, 0x0,
23587        "Source Hardware Address (resolved)", HFILL }},
23588
23589     {&hf_ieee80211_addr,
23590       {"Hardware address", "wlan.addr",
23591        FT_ETHER, BASE_NONE, NULL, 0,
23592        "SA, DA, BSSID, RA or TA Hardware Address", HFILL }},
23593
23594     {&hf_ieee80211_addr_resolved,
23595       { "Hardware address (resolved)", "wlan.addr_resolved", FT_STRING,
23596         BASE_NONE, NULL, 0x0,
23597         "SA, DA, BSSID, RA or TA Hardware Address (resolved)", HFILL }},
23598
23599     {&hf_ieee80211_addr_ra,
23600      {"Receiver address", "wlan.ra",
23601       FT_ETHER, BASE_NONE, NULL, 0,
23602       "Receiving Station Hardware Address", HFILL }},
23603
23604     {&hf_ieee80211_addr_ra_resolved,
23605       {"Receiver address (resolved)", "wlan.ra_resolved", FT_STRING, BASE_NONE,
23606         NULL, 0x0, "Receiving Station Hardware Address (resolved)", HFILL }},
23607
23608     {&hf_ieee80211_addr_ta,
23609      {"Transmitter address", "wlan.ta",
23610       FT_ETHER, BASE_NONE, NULL, 0,
23611       "Transmitting Station Hardware Address", HFILL }},
23612
23613     {&hf_ieee80211_addr_ta_resolved,
23614       {"Transmitter address (resolved)", "wlan.ta_resolved", FT_STRING,
23615         BASE_NONE, NULL, 0x0,
23616         "Transmitting Station Hardware Address (resolved)", HFILL }},
23617
23618     {&hf_ieee80211_addr_bssid,
23619      {"BSS Id", "wlan.bssid",
23620       FT_ETHER, BASE_NONE, NULL, 0,
23621       "Basic Service Set ID", HFILL }},
23622
23623     {&hf_ieee80211_addr_bssid_resolved,
23624       {"BSS Id (resolved)", "wlan.bssid_resolved", FT_STRING, BASE_NONE, NULL,
23625         0x0, "Basic Service Set ID (resolved)", HFILL }},
23626
23627     {&hf_ieee80211_addr_staa,
23628      {"STA address", "wlan.staa",
23629       FT_ETHER, BASE_NONE, NULL, 0,
23630       "Station Hardware Address", HFILL }},
23631
23632     {&hf_ieee80211_addr_staa_resolved,
23633       {"STA address (resolved)", "wlan.staa_resolved", FT_STRING, BASE_NONE, NULL,
23634         0x0, "Station Hardware Address (resolved)", HFILL }},
23635
23636     {&hf_ieee80211_frag_number,
23637      {"Fragment number", "wlan.frag",
23638       FT_UINT16, BASE_DEC, NULL, 0x000F,
23639       NULL, HFILL }},
23640
23641     {&hf_ieee80211_seq_number,
23642      {"Sequence number", "wlan.seq",
23643       FT_UINT16, BASE_DEC, NULL, 0xFFF0,
23644       NULL, HFILL }},
23645
23646     {&hf_ieee80211_mesh_control_field,
23647      {"Mesh Control Field", "wlan.mesh.control_field",
23648       FT_NONE, BASE_NONE, NULL, 0,
23649       NULL, HFILL }},
23650
23651     {&hf_ieee80211_qos,
23652      {"Qos Control", "wlan.qos",
23653       FT_UINT16, BASE_HEX, NULL, 0,
23654       NULL, HFILL }},
23655
23656     {&hf_ieee80211_qos_tid,
23657      {"TID", "wlan.qos.tid",
23658       FT_UINT16, BASE_DEC, NULL, 0x000F,
23659       NULL, HFILL }},
23660
23661     {&hf_ieee80211_qos_priority,
23662      {"Priority", "wlan.qos.priority",
23663       FT_UINT16, BASE_DEC, VALS(ieee80211_qos_tags_acs), 0x0007,
23664       "802.1D Tag", HFILL }},
23665
23666     {&hf_ieee80211_qos_eosp,
23667      {"EOSP", "wlan.qos.eosp",
23668       FT_BOOLEAN, 16, TFS(&eosp_flag), QOS_FLAG_EOSP,
23669       "EOSP Field", HFILL }},
23670
23671     {&hf_ieee80211_qos_bit4,
23672      {"QoS bit 4", "wlan.qos.bit4",
23673       FT_BOOLEAN, 16, TFS(&bit4_flag), QOS_FLAG_EOSP,
23674       NULL, HFILL }},
23675
23676     {&hf_ieee80211_qos_ack_policy,
23677      {"Ack Policy", "wlan.qos.ack",
23678       FT_UINT16, BASE_HEX,  VALS(ack_policy), 0x0060,
23679       NULL, HFILL }},
23680
23681     {&hf_ieee80211_qos_amsdu_present,
23682      {"Payload Type", "wlan.qos.amsdupresent",
23683       FT_BOOLEAN, 16, TFS(&ieee80211_qos_amsdu_present_flag), 0x0080,
23684       NULL, HFILL }},
23685
23686     {&hf_ieee80211_qos_txop_limit,
23687      {"TXOP Limit", "wlan.qos.txop_limit",
23688       FT_UINT16, BASE_DEC, NULL, 0xFF00,
23689       NULL, HFILL }},
23690
23691     {&hf_ieee80211_qos_ps_buf_state,
23692      {"QAP PS Buffer State", "wlan.qos.ps_buf_state",
23693       FT_UINT16, BASE_HEX, NULL, 0xFF00,
23694       NULL, HFILL }},
23695
23696     {&hf_ieee80211_qos_buf_state_indicated,
23697      {"Buffer State Indicated", "wlan.qos.buf_state_indicated",
23698       FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
23699       NULL, HFILL }},
23700
23701     {&hf_ieee80211_qos_highest_pri_buf_ac,
23702      {"Highest-Priority Buffered AC", "wlan.qos.highest_pri_buf_ac",
23703        FT_UINT16, BASE_DEC, VALS(wme_acs), 0x0C00,
23704       NULL, HFILL }},
23705
23706     {&hf_ieee80211_qos_qap_buf_load,
23707      {"QAP Buffered Load", "wlan.qos.qap_buf_load",
23708       FT_UINT16, BASE_DEC, NULL, 0xF000,
23709       NULL, HFILL }},
23710
23711     {&hf_ieee80211_qos_txop_dur_req,
23712      {"TXOP Duration Requested", "wlan.qos.txop_dur_req",
23713       FT_UINT16, BASE_DEC, NULL, 0xFF00,
23714       NULL, HFILL }},
23715
23716     {&hf_ieee80211_qos_queue_size,
23717      {"Queue Size", "wlan.qos.queue_size",
23718       FT_UINT16, BASE_DEC, NULL, 0xFF00,
23719       NULL, HFILL }},
23720
23721     {&hf_ieee80211_fcs,
23722      {"Frame check sequence", "wlan.fcs",
23723       FT_UINT32, BASE_HEX, NULL, 0,
23724       "Frame Check Sequence (FCS)", HFILL }},
23725
23726     {&hf_ieee80211_fcs_status,
23727      {"FCS Status", "wlan.fcs.status",
23728       FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0,
23729       NULL, HFILL }},
23730
23731     {&hf_ieee80211_fragment_overlap,
23732       {"Fragment overlap", "wlan.fragment.overlap",
23733        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23734        "Fragment overlaps with other fragments", HFILL }},
23735
23736     {&hf_ieee80211_fragment_overlap_conflict,
23737       {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
23738        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23739        "Overlapping fragments contained conflicting data", HFILL }},
23740
23741     {&hf_ieee80211_fragment_multiple_tails,
23742       {"Multiple tail fragments found", "wlan.fragment.multipletails",
23743        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23744        "Several tails were found when defragmenting the packet", HFILL }},
23745
23746     {&hf_ieee80211_fragment_too_long_fragment,
23747       {"Fragment too long", "wlan.fragment.toolongfragment",
23748        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23749        "Fragment contained data past end of packet", HFILL }},
23750
23751     {&hf_ieee80211_fragment_error,
23752       {"Defragmentation error", "wlan.fragment.error",
23753        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
23754        "Defragmentation error due to illegal fragments", HFILL }},
23755
23756     {&hf_ieee80211_fragment_count,
23757       {"Fragment count", "wlan.fragment.count",
23758        FT_UINT32, BASE_DEC, NULL, 0x0,
23759        NULL, HFILL }},
23760
23761     {&hf_ieee80211_fragment,
23762       {"802.11 Fragment", "wlan.fragment",
23763        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
23764        NULL, HFILL }},
23765
23766     {&hf_ieee80211_fragments,
23767       {"802.11 Fragments", "wlan.fragments",
23768        FT_NONE, BASE_NONE, NULL, 0x0,
23769        NULL, HFILL }},
23770
23771     {&hf_ieee80211_reassembled_in,
23772       {"Reassembled 802.11 in frame", "wlan.reassembled_in",
23773        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
23774        "This 802.11 packet is reassembled in this frame", HFILL }},
23775
23776     {&hf_ieee80211_reassembled_length,
23777       {"Reassembled 802.11 length", "wlan.reassembled.length",
23778        FT_UINT32, BASE_DEC, NULL, 0x0,
23779        "The total length of the reassembled payload", HFILL }},
23780
23781     {&hf_ieee80211_wep_iv,
23782      {"Initialization Vector", "wlan.wep.iv",
23783       FT_UINT24, BASE_HEX, NULL, 0,
23784       NULL, HFILL }},
23785
23786     {&hf_ieee80211_wep_iv_weak,
23787      {"Weak IV", "wlan.wep.weakiv",
23788       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
23789        NULL, HFILL}},
23790
23791     {&hf_ieee80211_tkip_extiv,
23792      {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv",
23793       FT_STRING, BASE_NONE, NULL, 0,
23794       "TKIP Extended Initialization Vector", HFILL }},
23795
23796     {&hf_ieee80211_ccmp_extiv,
23797      {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv",
23798       FT_STRING, BASE_NONE, NULL, 0,
23799       "CCMP Extended Initialization Vector", HFILL }},
23800
23801     {&hf_ieee80211_wep_key,
23802      {"Key Index", "wlan.wep.key",
23803       FT_UINT8, BASE_DEC, NULL, 0,
23804       NULL, HFILL }},
23805
23806     {&hf_ieee80211_wep_icv,
23807      {"WEP ICV", "wlan.wep.icv",
23808       FT_UINT32, BASE_HEX, NULL, 0,
23809       NULL, HFILL }},
23810
23811     {&hf_ieee80211_fc_analysis_pmk,
23812      {"PMK", "wlan.analysis.pmk",
23813       FT_STRING, BASE_NONE, NULL, 0x0,
23814       NULL, HFILL }},
23815
23816     {&hf_ieee80211_fc_analysis_tk,
23817      {"TK", "wlan.analysis.tk",
23818       FT_STRING, BASE_NONE, NULL, 0x0,
23819       NULL, HFILL }},
23820
23821     {&hf_ieee80211_fc_analysis_gtk,
23822      {"GTK", "wlan.analysis.gtk",
23823       FT_STRING, BASE_NONE, NULL, 0x0,
23824       NULL, HFILL }},
23825
23826     {&hf_ieee80211_block_ack_control,
23827      {"Block Ack Control", "wlan.ba.control",
23828       FT_UINT16, BASE_HEX, NULL, 0,
23829       NULL, HFILL }},
23830
23831     {&hf_ieee80211_block_ack_control_ack_policy,
23832      {"BA Ack Policy", "wlan.ba.control.ackpolicy",
23833       FT_BOOLEAN, 16, TFS(&ieee80211_block_ack_control_ack_policy_flag), 0x01,
23834       "Block Ack Request (BAR) Ack Policy", HFILL }},
23835
23836     {&hf_ieee80211_block_ack_control_type,
23837      {"BA Type", "wlan.ba.control.ba_type",
23838       FT_UINT16, BASE_HEX, VALS(block_ack_type_vals), 0x001e, NULL, HFILL }},
23839
23840     {&hf_ieee80211_block_ack_control_reserved,
23841      {"Reserved", "wlan.ba.control.reserved",
23842       FT_UINT16, BASE_HEX, NULL, 0x0fe0,
23843       NULL, HFILL }},
23844
23845     {&hf_ieee80211_block_ack_control_tid_info,
23846      {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
23847       FT_UINT16, BASE_HEX, NULL, 0xf000,
23848       "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
23849
23850     {&hf_ieee80211_block_ack_multi_sta_aid11,
23851      {"AID11", "wlan.ba.multi_sta.aid11",
23852       FT_UINT16, BASE_HEX, NULL, 0x07ff, NULL, HFILL }},
23853
23854     {&hf_ieee80211_block_ack_multi_sta_ack_type,
23855      {"Ack Type", "wlan.ba.multi_sta.ack_type",
23856       FT_UINT16, BASE_HEX, NULL, 0x0800, NULL, HFILL }},
23857
23858     {&hf_ieee80211_block_ack_multi_sta_tid,
23859      {"TID", "wlan.ba.multi_sta.tid",
23860       FT_UINT16, BASE_HEX, NULL, 0xf000, NULL, HFILL }},
23861
23862     {&hf_ieee80211_block_ack_multi_sta_aid_tid,
23863      {"AID TID Info", "wlan.ba.multi_sta.aid_tid_info",
23864       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
23865
23866     {&hf_ieee80211_block_ack_multi_sta_reserved,
23867      {"Reserved", "wlan.ba.multi_sta.reserved",
23868       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
23869
23870     {&hf_ieee80211_block_ack_multi_sta_ra,
23871      {"RA", "wlan.ba.multi_sta.ra",
23872       FT_ETHER, BASE_NONE, NULL, 0x0, NULL, HFILL }},
23873
23874     {&hf_ieee80211_block_ack_multi_tid_reserved,
23875      {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
23876       FT_UINT16, BASE_HEX, 0, 0x0fff,
23877       NULL, HFILL }},
23878
23879     {&hf_ieee80211_block_ack_multi_tid_value,
23880      {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
23881       FT_UINT16, BASE_HEX, 0, 0xf000,
23882       NULL, HFILL }},
23883
23884     {&hf_ieee80211_block_ack_bitmap,
23885      {"Block Ack Bitmap", "wlan.ba.bm",
23886       FT_BYTES, BASE_NONE, NULL, 0,
23887       NULL, HFILL }},
23888
23889     /* Used for Extended compressed BlockAck */
23890     {&hf_ieee80211_block_ack_RBUFCAP,
23891      {"Block Ack RBUFCAP", "wlan.ba.RBUFCAP",
23892       FT_BOOLEAN, BASE_DEC, NULL, 0,
23893       NULL, HFILL }},
23894
23895     {&hf_ieee80211_block_ack_bitmap_missing_frame,
23896      {"Missing frame", "wlan.ba.bm.missing_frame",
23897       FT_UINT32, BASE_DEC, NULL, 0,
23898       NULL, HFILL }},
23899
23900     {&hf_ieee80211_block_ack_gcr_addr,
23901      {"GCR Group Address", "wlan.ba.gcr_group_addr",
23902       FT_ETHER, BASE_NONE, NULL, 0, NULL, HFILL }},
23903
23904     {&hf_ieee80211_beamform_feedback_seg_retrans_bitmap,
23905      {"Feedback segment Retansmission Bitmap", "wlan.beamform.feedback_seg_retrans_bitmap",
23906       FT_UINT8, BASE_HEX, NULL, 0,
23907       NULL, HFILL }},
23908
23909     {&hf_ieee80211_vht_ndp_annc_token,
23910      {"Sounding Dialog Token", "wlan.vht_ndp.token",
23911       FT_UINT8, BASE_HEX, NULL, 0,
23912       NULL, HFILL }},
23913
23914     {&hf_ieee80211_vht_ndp_annc_token_number,
23915      {"Sounding Dialog Token Number", "wlan.vht_ndp.token.number",
23916       FT_UINT8, BASE_DEC, NULL, 0xFC,
23917       NULL, HFILL }},
23918
23919     {&hf_ieee80211_vht_ndp_annc_he_subfield,
23920      {"HE", "wlan.vht_ndp.token.he",
23921       FT_BOOLEAN, 8, TFS(&he_ndp_annc_he_subfield_vals), 0x02, NULL, HFILL }},
23922
23923     {&hf_ieee80211_vht_ndp_annc_token_reserved,
23924      {"Reserved", "wlan.vht_ndp.token.reserved",
23925       FT_UINT8, BASE_HEX, NULL, 0x01,
23926       NULL, HFILL }},
23927
23928     {&hf_ieee80211_vht_ndp_annc_sta_info_aid12,
23929      {"AID12", "wlan.vht_ndp.sta_info.aid12",
23930       FT_UINT16, BASE_HEX, NULL, 0x0FFF,
23931       "12 least significant bits of the AID of the target STA", HFILL }},
23932
23933     {&hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
23934      {"Feedback Type", "wlan.vht_ndp.sta_info.feedback_type",
23935       FT_BOOLEAN, 16, TFS(&vht_ndp_annc_sta_info_feedback_type), 0x1000,
23936       NULL, HFILL }},
23937
23938     {&hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
23939      {"Nc Index", "wlan.vht_ndp.sta_info.nc_index",
23940       FT_UINT16, BASE_DEC, VALS(num_plus_one_3bit_flag), 0xE000,
23941       NULL, HFILL }},
23942
23943     {&hf_ieee80211_vht_ndp_annc_sta_info_reserved,
23944      {"Reserved", "wlan.vht_ndp.sta_info.reserved",
23945       FT_UINT16, BASE_HEX, NULL, 0xE000,
23946       NULL, HFILL }},
23947
23948     {&hf_ieee80211_data_encap_payload_type,
23949      {"Payload Type", "wlan.data_encap.payload_type",
23950       FT_UINT8, BASE_DEC, VALS(ieee80211_data_encap_payload_types), 0,
23951       NULL, HFILL }},
23952
23953     {&hf_ieee80211_ff_tdls_action_code,
23954      {"Action code", "wlan.fixed.action_code",
23955       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tdls_action_codes_ext, 0,
23956       "Management action code", HFILL }},
23957
23958     {&hf_ieee80211_ff_target_channel,
23959      {"Target Channel", "wlan.fixed.target_channel",
23960       FT_UINT8, BASE_DEC, NULL, 0,
23961       NULL, HFILL }},
23962
23963     {&hf_ieee80211_ff_operating_class,
23964      {"Operating Class", "wlan.fixed.operating_class",
23965       FT_UINT8, BASE_DEC, NULL, 0,
23966       NULL, HFILL }},
23967
23968     {&hf_ieee80211_ff_wnm_action_code,
23969      {"Action code", "wlan.fixed.action_code",
23970       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_action_codes_ext, 0,
23971       "Management action code", HFILL }},
23972
23973     {&hf_ieee80211_ff_unprotected_wnm_action_code,
23974      {"Action code", "wlan.fixed.action_code",
23975       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &unprotected_wnm_action_codes_ext, 0,
23976       "Management action code", HFILL }},
23977
23978     {&hf_ieee80211_ff_key_data,
23979      {"Key Data", "wlan.fixed.key_data",
23980       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
23981
23982     {&hf_ieee80211_ff_key_data_length,
23983      {"Key Data Length", "wlan.fixed.key_data_length",
23984       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
23985
23986     {&hf_ieee80211_ff_wnm_notification_type,
23987      {"WNM-Notification type", "wlan.fixed.wnm_notification_type",
23988       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_notification_types_ext, 0,
23989       NULL, HFILL }},
23990
23991     {&hf_ieee80211_ff_rm_action_code,
23992      {"Action code", "wlan.rm.action_code",
23993       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &rm_action_codes_ext, 0,
23994       "Radio Measurement Action", HFILL }},
23995
23996     {&hf_ieee80211_ff_rm_dialog_token,
23997      {"Dialog token", "wlan.rm.dialog_token",
23998       FT_UINT8, BASE_DEC, NULL, 0,
23999       "Non-zero Dialog Token identifies request/report transaction", HFILL }},
24000
24001     {&hf_ieee80211_ff_rm_repetitions,
24002      {"Repetitions", "wlan.rm.repetitions",
24003       FT_UINT16, BASE_DEC, NULL, 0,
24004       "Numer of Repetitions, 65535 indicates repeat until cancellation", HFILL }},
24005
24006     {&hf_ieee80211_ff_rm_tx_power,
24007      {"Transmit Power Used", "wlan.rm.tx_power",
24008       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
24009       NULL, HFILL }},
24010
24011     {&hf_ieee80211_ff_rm_max_tx_power,
24012      {"Max Transmit Power", "wlan.rm.max_tx_power",
24013       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
24014       NULL, HFILL }},
24015
24016     {&hf_ieee80211_ff_tpc,
24017      {"TPC Report", "wlan.rm.tpc",
24018       FT_NONE, BASE_NONE, NULL, 0,
24019       NULL, HFILL }},
24020
24021     {&hf_ieee80211_ff_tpc_element_id,
24022      {"TPC Element ID", "wlan.rm.tpc.element_id",
24023       FT_UINT8, BASE_DEC, NULL, 0,
24024       NULL, HFILL }},
24025
24026     {&hf_ieee80211_ff_tpc_length,
24027      {"TPC Length", "wlan.rm.tpc.length",
24028       FT_UINT8, BASE_DEC, NULL, 0,
24029       "Length of TPC Report element (always 2)", HFILL }},
24030
24031     {&hf_ieee80211_ff_tpc_tx_power,
24032      {"TPC Transmit Power", "wlan.rm.tpc.tx_power",
24033       FT_INT8, BASE_DEC, NULL, 0,
24034       NULL, HFILL }},
24035
24036     {&hf_ieee80211_ff_tpc_link_margin,
24037      {"TPC Link Margin", "wlan.rm.tpc.link_margin",
24038       FT_INT8, BASE_DEC, NULL, 0,
24039       NULL, HFILL }},
24040
24041     {&hf_ieee80211_ff_rm_rx_antenna_id,
24042      {"Receive Antenna ID", "wlan.rm.rx_antenna_id",
24043       FT_UINT8, BASE_DEC, NULL, 0,
24044       NULL, HFILL }},
24045
24046     {&hf_ieee80211_ff_rm_tx_antenna_id,
24047      {"Transmit Antenna ID", "wlan.rm.tx_antenna_id",
24048       FT_UINT8, BASE_DEC, NULL, 0,
24049       NULL, HFILL }},
24050
24051     {&hf_ieee80211_ff_rm_rcpi,
24052      {"Received Channel Power", "wlan.rm.rcpi",
24053       FT_UINT8, BASE_DEC, NULL, 0,
24054       NULL, HFILL }},
24055
24056     {&hf_ieee80211_ff_rm_rsni,
24057      {"Received Signal to noise indication", "wlan.rm.rsni",
24058       FT_UINT8, BASE_DEC, NULL, 0,
24059       NULL, HFILL }},
24060
24061     {&hf_ieee80211_ff_request_mode_pref_cand,
24062      {"Preferred Candidate List Included", "wlan.fixed.request_mode.pref_cand",
24063       FT_UINT8, BASE_DEC, NULL, 0x01,
24064       NULL, HFILL }},
24065
24066     {&hf_ieee80211_ff_request_mode_abridged,
24067      {"Abridged", "wlan.fixed.request_mode.abridged",
24068       FT_UINT8, BASE_DEC, NULL, 0x02,
24069       NULL, HFILL }},
24070
24071     {&hf_ieee80211_ff_request_mode_disassoc_imminent,
24072      {"Disassociation Imminent", "wlan.fixed.request_mode.disassoc_imminent",
24073       FT_UINT8, BASE_DEC, NULL, 0x04,
24074       NULL, HFILL }},
24075
24076     {&hf_ieee80211_ff_request_mode_bss_term_included,
24077      {"BSS Termination Included", "wlan.fixed.request_mode.bss_term_included",
24078       FT_UINT8, BASE_DEC, NULL, 0x08,
24079       NULL, HFILL }},
24080
24081     {&hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
24082      {"ESS Disassociation Imminent", "wlan.fixed.request_mode.ess_disassoc_imminent",
24083       FT_UINT8, BASE_DEC, NULL, 0x10,
24084       NULL, HFILL }},
24085
24086     {&hf_ieee80211_ff_disassoc_timer,
24087      {"Disassociation Timer", "wlan.fixed.disassoc_timer",
24088       FT_UINT16, BASE_DEC, NULL, 0,
24089       NULL, HFILL }},
24090
24091     {&hf_ieee80211_ff_bss_termination_delay,
24092      {"BSS Termination Delay", "wlan.fixed.bss_termination_delay",
24093       FT_UINT8, BASE_DEC, NULL, 0,
24094       NULL, HFILL }},
24095
24096     {&hf_ieee80211_ff_bss_transition_status_code,
24097      {"BSS Transition Status Code", "wlan.fixed.bss_transition_status_code",
24098       FT_UINT8, BASE_DEC, NULL, 0,
24099       NULL, HFILL }},
24100
24101     {&hf_ieee80211_ff_validity_interval,
24102      {"Validity Interval", "wlan.fixed.validity_interval",
24103       FT_UINT8, BASE_DEC, NULL, 0,
24104       NULL, HFILL }},
24105
24106     {&hf_ieee80211_ff_bss_termination_duration,
24107      {"BSS Termination Duration", "wlan.fixed.bss_termination_duration",
24108       FT_BYTES, BASE_NONE, NULL, 0,
24109       NULL, HFILL }},
24110
24111     {&hf_ieee80211_ff_url_len,
24112      {"Session Information URL Length",
24113       "wlan.fixed.session_information.url_length",
24114       FT_UINT8, BASE_DEC, NULL, 0,
24115       NULL, HFILL }},
24116
24117     {&hf_ieee80211_ff_url,
24118      {"Session Information URL", "wlan.fixed.session_information.url",
24119       FT_STRING, BASE_NONE, NULL, 0,
24120       NULL, HFILL }},
24121
24122     {&hf_ieee80211_ff_target_bss,
24123      {"BSS Transition Target BSS", "wlan.fixed.bss_transition_target_bss",
24124       FT_ETHER, BASE_NONE, NULL, 0,
24125       NULL, HFILL }},
24126
24127     {&hf_ieee80211_ff_bss_transition_query_reason,
24128      {"BSS Transition Query Reason", "wlan.fixed.bss_transition_query_reason",
24129       FT_UINT8, BASE_DEC, VALS(ieee80211_transition_reasons), 0,
24130       NULL, HFILL }},
24131
24132     {&hf_ieee80211_ff_bss_transition_candidate_list_entries,
24133      {"BSS Transition Candidate List Entries", "wlan.fixed.bss_transition_candidate_list_entries",
24134       FT_BYTES, BASE_NONE, NULL, 0,
24135       NULL, HFILL }},
24136
24137 /* 802.11ad */
24138     {&hf_ieee80211_cf_response_offset,
24139      {"Response Offset", "wlan.res_offset",
24140       FT_UINT16, BASE_DEC, NULL, 0,
24141       NULL, HFILL }},
24142
24143     {&hf_ieee80211_grant_ack_reserved,
24144      {"Reserved", "wlan.grant_ack.reserved",
24145       FT_BYTES, BASE_NONE, NULL, 0,
24146       NULL, HFILL }},
24147
24148     {&hf_ieee80211_ff_dynamic_allocation,
24149      {"Dynamic Allocation", "wlan.dynamic_allocation",
24150       FT_UINT40, BASE_HEX, NULL, 0,
24151       NULL, HFILL }},
24152
24153     {&hf_ieee80211_ff_TID,
24154      {"TID", "wlan.dynamic_allocation.tid",
24155       FT_UINT40, BASE_DEC, NULL, 0x000000000F,
24156       NULL, HFILL }},
24157
24158     {&hf_ieee80211_ff_alloc_type,
24159      {"Allocation Type", "wlan.dynamic_allocation.alloc_type",
24160       FT_UINT40, BASE_DEC, NULL, 0x000000070,
24161       NULL, HFILL }},
24162
24163     {&hf_ieee80211_ff_src_aid,
24164      {"Source AID", "wlan.dynamic_allocation.src_aid",
24165       FT_UINT40, BASE_DEC, NULL, 0x0000007F80,
24166       NULL, HFILL }},
24167
24168     {&hf_ieee80211_ff_dest_aid,
24169      {"Destination AID", "wlan.dynamic_allocation.dest_aid",
24170       FT_UINT40, BASE_DEC, NULL, 0x00007f8000,
24171       NULL, HFILL }},
24172
24173     {&hf_ieee80211_ff_alloc_duration,
24174      {"Allocation Duration", "wlan.dynamic_allocation.alloc_duration",
24175       FT_UINT40, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0x7FFF800000,
24176       NULL, HFILL }},
24177
24178     {&hf_ieee80211_ff_b39,
24179      {"Reserved (b39)", "wlan.dynamic_allocation.b39",
24180       FT_UINT40, BASE_HEX, NULL, 0x8000000000,
24181       NULL, HFILL }},
24182
24183     {&hf_ieee80211_ff_ssw,
24184      {"Sector Sweep", "wlan.ssw",
24185       FT_UINT24, BASE_HEX, NULL, 0,
24186       NULL, HFILL }},
24187
24188     {&hf_ieee80211_ff_ssw_direction,
24189      {"Sector Sweep Direction", "wlan.ssw.direction",
24190       FT_BOOLEAN, 24, TFS(&ieee80211_cf_ssw_direction), 0x000001,
24191       NULL, HFILL}},
24192
24193     {&hf_ieee80211_ff_ssw_cdown,
24194      {"Sector Sweep CDOWN", "wlan.ssw.cdown",
24195       FT_UINT24, BASE_DEC, NULL, 0x0003fe,
24196       NULL, HFILL }},
24197
24198     {&hf_ieee80211_ff_ssw_sector_id,
24199      {"Sector Sweep Sector ID", "wlan.ssw.sector_id",
24200       FT_UINT24, BASE_DEC, NULL, 0x00fc00,
24201       NULL, HFILL }},
24202
24203     {&hf_ieee80211_ff_ssw_dmg_ant_id,
24204      {"Sector Sweep DMG Antenna ID", "wlan.ssw.dmg_ant_id",
24205       FT_UINT24, BASE_DEC, NULL, 0x030000,
24206       NULL, HFILL }},
24207
24208     {&hf_ieee80211_ff_ssw_rxss_len,
24209      {"Sector Sweep RXSS Length", "wlan.ssw.rxss_len",
24210       FT_UINT24, BASE_DEC, NULL, 0xfc0000,
24211       NULL, HFILL }},
24212
24213     {&hf_ieee80211_ff_bf,
24214      {"Beam Forming", "wlan.bf",
24215       FT_UINT16, BASE_HEX, NULL, 0,
24216       NULL, HFILL }},
24217
24218     {&hf_ieee80211_ff_bf_train,
24219      {"Beam Forming Training", "wlan.bf.train",
24220       FT_BOOLEAN, 16, NULL, 0x0001,
24221       NULL, HFILL }},
24222
24223     {&hf_ieee80211_ff_bf_is_init,
24224      {"Beam Forming Is InitiatorTXSS", "wlan.bf.isInit",
24225       FT_BOOLEAN, 16, NULL, 0x0002,
24226       NULL, HFILL }},
24227
24228     {&hf_ieee80211_ff_bf_is_resp,
24229      {"Beam Forming Is ResponderTXSS", "wlan.bf.isResp",
24230       FT_BOOLEAN, 16, NULL, 0x0004,
24231       NULL, HFILL }},
24232
24233     {&hf_ieee80211_ff_bf_rxss_len,
24234      {"Beam Forming RXSS Length", "wlan.bf.rxss_len",
24235       FT_UINT16, BASE_DEC, NULL, 0x01f8,
24236       NULL, HFILL }},
24237
24238     {&hf_ieee80211_ff_bf_rxss_rate,
24239      {"Beam Forming RXSS Rate", "wlan.bf.rxss_rate",
24240       FT_BOOLEAN, 16, NULL, 0x0200,
24241       NULL, HFILL }},
24242
24243     {&hf_ieee80211_ff_bf_b10b15,
24244      {"Reserved (B10-B15)", "wlan.bf.reserved",
24245       FT_UINT16, BASE_DEC, NULL, 0xFC00,
24246       NULL, HFILL }},
24247
24248     {&hf_ieee80211_ff_bf_num_sectors,
24249      {"Beam Forming Total Number of Sectors", "wlan.bf.num_sectors",
24250       FT_UINT16, BASE_DEC, NULL, 0x03f8,
24251       NULL, HFILL }},
24252
24253     {&hf_ieee80211_ff_bf_num_rx_dmg_ants,
24254      {"Beam Forming Number of DMG Antennas", "wlan.bf.num_dmg_ants",
24255       FT_UINT16, BASE_DEC, NULL, 0x0c00,
24256       NULL, HFILL }},
24257
24258     {&hf_ieee80211_ff_bf_b12b15,
24259      {"Reserved (B12-B15)", "wlan.bf.reserved",
24260       FT_UINT16, BASE_DEC, NULL, 0xF000,
24261       NULL, HFILL }},
24262
24263     {&hf_ieee80211_addr_nav_da,
24264      {"Destination address of STA that caused NAV update", "wlan.nav_da",
24265       FT_ETHER, BASE_NONE, NULL, 0,
24266       "DMG Destination Hardware Address", HFILL }},
24267
24268     {&hf_ieee80211_addr_nav_sa,
24269      {"Source address of STA that caused NAV update", "wlan.nav_sa",
24270       FT_ETHER, BASE_NONE, NULL, 0,
24271       "DMG Source Hardware Address", HFILL }},
24272
24273     {&hf_ieee80211_ff_sswf,
24274      {"Sector Sweep Feedback", "wlan.sswf",
24275       FT_UINT24, BASE_HEX, NULL, 0,
24276       NULL, HFILL }},
24277
24278     {&hf_ieee80211_ff_sswf_total_sectors,
24279      {"Sector Sweep Feedback total number of sectors", "wlan.sswf.num_sectors",
24280       FT_UINT24, BASE_DEC, NULL, 0x0001ff,
24281       NULL, HFILL }},
24282
24283     {&hf_ieee80211_ff_sswf_num_rx_dmg_ants,
24284      {"Sector Sweep Feedback Number of receive DMG Antennas", "wlan.sswf.num_dmg_ants",
24285       FT_UINT24, BASE_DEC, NULL, 0x000600,
24286       NULL, HFILL }},
24287
24288     {&hf_ieee80211_ff_sswf_poll_required,
24289      {"Sector Sweep Feedback Poll required", "wlan.sswf.poll",
24290       FT_BOOLEAN, 24, NULL, 0x010000,
24291       NULL, HFILL }},
24292
24293     {&hf_ieee80211_ff_sswf_reserved1,
24294      {"Sector Sweep Feedback Reserved", "wlan.sswf.reserved",
24295       FT_UINT24, BASE_HEX, NULL, 0x00F800,
24296       NULL, HFILL }},
24297
24298     {&hf_ieee80211_ff_sswf_reserved2,
24299      {"Sector Sweep Feedback Reserved", "wlan.sswf.reserved",
24300       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
24301       NULL, HFILL }},
24302
24303     {&hf_ieee80211_ff_sswf_sector_select,
24304      {"Sector Sweep Feedback Sector Select", "wlan.sswf.sector_select",
24305       FT_UINT24, BASE_DEC, NULL, 0x00003F,
24306       NULL, HFILL }},
24307
24308     {&hf_ieee80211_ff_sswf_dmg_antenna_select,
24309      {"Sector Sweep Feedback DMG Antenna Select", "wlan.sswf.dmg_antenna_select",
24310       FT_UINT24, BASE_DEC, NULL, 0x0000C0,
24311       NULL, HFILL }},
24312
24313     {&hf_ieee80211_ff_sswf_snr_report,
24314      {"Sector Sweep Feedback SNR Report", "wlan.sswf.snr_report",
24315       FT_UINT24, BASE_DEC, NULL, 0x00FF00,
24316       NULL, HFILL }},
24317
24318
24319     {&hf_ieee80211_ff_brp,
24320      {"BRP Request", "wlan.brp",
24321       FT_UINT32, BASE_HEX, NULL, 0,
24322       NULL, HFILL }},
24323
24324     {&hf_ieee80211_ff_brp_L_RX,
24325      {"BRP Request L-RX", "wlan.brp.l_rx",
24326       FT_UINT32, BASE_DEC, NULL, 0x0000001f,
24327       NULL, HFILL }},
24328
24329     {&hf_ieee80211_ff_brp_TX_TRN_REQ,
24330      {"BRP Request TX-TRN-REQ", "wlan.brp.tx_trn_req",
24331       FT_BOOLEAN, 32, NULL, 0x00000020,
24332       NULL, HFILL }},
24333
24334     {&hf_ieee80211_ff_brp_MID_REQ,
24335      {"BRP Request MID-REQ", "wlan.brp.mid_req",
24336       FT_BOOLEAN, 32, NULL, 0x00000040,
24337       NULL, HFILL }},
24338
24339     {&hf_ieee80211_ff_brp_BC_REQ,
24340      {"BRP Request BC-REQ", "wlan.brp.bc_req",
24341       FT_BOOLEAN, 32, NULL, 0x00000080,
24342       NULL, HFILL }},
24343
24344     {&hf_ieee80211_ff_brp_MID_GRANT,
24345      {"BRP Request MID-GRANT", "wlan.brp.mid_grant",
24346       FT_BOOLEAN, 32, NULL, 0x00000100,
24347       NULL, HFILL }},
24348
24349     {&hf_ieee80211_ff_brp_BC_GRANT,
24350      {"BRP Request BC-GRANT", "wlan.brp.bc_grant",
24351       FT_BOOLEAN, 32, NULL, 0x00000200,
24352       NULL, HFILL }},
24353
24354     {&hf_ieee80211_ff_brp_chan_FBCK_CAP,
24355      {"BRP Request Chan FBCK-CAP", "wlan.brp.chan_fbck_cap",
24356       FT_BOOLEAN, 32, NULL, 0x00000400,
24357       NULL, HFILL }},
24358
24359     {&hf_ieee80211_ff_brp_tx_sector,
24360      {"BRP Request TX Sector ID", "wlan.brp.tx_sector_id",
24361       FT_UINT32, BASE_DEC, NULL, 0x0001f800,
24362       NULL, HFILL }},
24363
24364     {&hf_ieee80211_ff_brp_other_aid,
24365      {"BRP Request Other AID", "wlan.brp.other_aid",
24366       FT_UINT32, BASE_DEC, NULL, 0x01fe0000,
24367       NULL, HFILL }},
24368
24369     {&hf_ieee80211_ff_brp_tx_antenna,
24370      {"BRP Request TX Antenna ID", "wlan.brp.tx_antenna_id",
24371       FT_UINT32, BASE_DEC, NULL, 0x06000000,
24372       NULL, HFILL }},
24373
24374     {&hf_ieee80211_ff_brp_reserved,
24375      {"BRP Request Reserved", "wlan.brp.reserved",
24376       FT_UINT32, BASE_HEX, NULL, 0xF8000000,
24377       NULL, HFILL }},
24378
24379     {&hf_ieee80211_ff_blm,
24380      {"Beamformed Link Maintenance", "wlan.blm",
24381       FT_UINT8, BASE_HEX, NULL, 0,
24382       NULL, HFILL }},
24383
24384     {&hf_ieee80211_ff_blm_unit_index,
24385      {"BeamLink Maintenance Uint Index", "wlan.blm.uint_index",
24386       FT_BOOLEAN, 8, NULL, 0x01,
24387       NULL, HFILL }},
24388
24389     {&hf_ieee80211_ff_blm_maint_value,
24390      {"BeamLink Maintenance Value", "wlan.blm.value",
24391       FT_UINT8, BASE_DEC, NULL, 0x7e,
24392       NULL, HFILL }},
24393
24394     {&hf_ieee80211_ff_blm_is_master,
24395      {"BeamLink Is Master", "wlan.blm.is_master",
24396       FT_BOOLEAN, 8, NULL, 0x80,
24397       NULL, HFILL }},
24398
24399     {&hf_ieee80211_ff_bic,
24400      {"Beacon Interval Control", "wlan.bic",
24401       FT_UINT48, BASE_HEX, NULL, 0,
24402       NULL, HFILL }},
24403
24404     {&hf_ieee80211_ff_bic_cc_present,
24405      {"Clustering Control Present", "wlan.bic.cc",
24406       FT_BOOLEAN, 48, NULL, 0x000000000001,
24407       NULL, HFILL }},
24408
24409     {&hf_ieee80211_ff_bic_discovery_mode,
24410      {"Discovery Mode", "wlan.bic.discovery_mode",
24411       FT_BOOLEAN, 48, NULL, 0x000000000002,
24412       NULL, HFILL }},
24413
24414     {&hf_ieee80211_ff_bic_next_beacon,
24415      {"Next Beacon", "wlan.bic.next_beacon",
24416       FT_UINT48, BASE_DEC, NULL, 0x00000000003c,
24417
24418       NULL, HFILL }},
24419
24420     {&hf_ieee80211_ff_bic_ati_present,
24421      {"ATI Present", "wlan.bic.ati",
24422       FT_BOOLEAN, 48, NULL, 0x000000000040,
24423       NULL, HFILL }},
24424
24425     {&hf_ieee80211_ff_bic_abft_len,
24426      {"A-BFT length", "wlan.bic.abft_len",
24427       FT_UINT48, BASE_DEC, NULL, 0x000000000380,
24428       NULL, HFILL }},
24429
24430     {&hf_ieee80211_ff_bic_fss,
24431      {"FSS", "wlan.bic.fss",
24432       FT_UINT48, BASE_DEC, NULL, 0x000000003c00,
24433       NULL, HFILL }},
24434
24435     {&hf_ieee80211_ff_bic_is_resp,
24436      {"Is TXSS Responder", "wlan.bic.is_responder",
24437       FT_BOOLEAN, 48, NULL, 0x000000004000,
24438       NULL, HFILL }},
24439
24440     {&hf_ieee80211_ff_bic_next_abft,
24441      {"Next A-BFT", "wlan.bic.next_abft",
24442       FT_UINT48, BASE_DEC, NULL, 0x000000078000,
24443       NULL, HFILL }},
24444
24445     {&hf_ieee80211_ff_bic_frag_txss,
24446      {"Fragmented TXSS", "wlan.bic.frag_txss",
24447       FT_BOOLEAN, 48, NULL, 0x000000080000,
24448       NULL, HFILL }},
24449
24450     {&hf_ieee80211_ff_bic_txss_span,
24451      {"TXSS span", "wlan.bic.txss_span",
24452       FT_UINT48, BASE_DEC, NULL, 0x000007f00000,
24453       NULL, HFILL }},
24454
24455     {&hf_ieee80211_ff_bic_NBI_abft,
24456      {"Number of Beacon Intervals that are needed to allocate A-BFT", "wlan.bic.NBI_abft",
24457       FT_UINT48, BASE_DEC, NULL, 0x00078000000,
24458       NULL, HFILL }},
24459
24460     {&hf_ieee80211_ff_bic_abft_count,
24461      {"A-BFT Count", "wlan.bic.abft_count",
24462       FT_UINT48, BASE_DEC, NULL, 0x001f80000000,
24463       NULL, HFILL }},
24464
24465     {&hf_ieee80211_ff_bic_nabft,
24466      {"Number of A-BFT's received from each Antenna", "wlan.bic.nabft",
24467       FT_UINT48, BASE_DEC, NULL, 0x07e000000000,
24468       NULL, HFILL }},
24469
24470     {&hf_ieee80211_ff_bic_pcp,
24471      {"PCP Association Ready", "wlan.bic.pcp",
24472       FT_BOOLEAN, 48, NULL, 0x080000000000,
24473       NULL, HFILL }},
24474
24475     {&hf_ieee80211_ff_bic_reserved,
24476      {"Reserved", "wlan.bic.reserved",
24477       FT_UINT48, BASE_HEX, NULL, 0xF00000000000,
24478       NULL, HFILL }},
24479
24480     {&hf_ieee80211_ff_dmg_params,
24481      {"DMG Parameters", "wlan.dmg_params",
24482       FT_UINT8, BASE_HEX , NULL, 0,
24483       NULL, HFILL }},
24484
24485     {&hf_ieee80211_ff_dmg_params_bss,
24486      {"BSS Type", "wlan.dmg_params.bss",
24487       FT_UINT8, BASE_DEC, VALS(bss_type), 0x03,
24488       NULL, HFILL }},
24489
24490     {&hf_ieee80211_ff_dmg_params_cbap_only,
24491      {"CBAP Only", "wlan.dmg_params.cbap_only",
24492       FT_BOOLEAN, 8, NULL, 0x04,
24493       NULL, HFILL }},
24494
24495     {&hf_ieee80211_ff_dmg_params_cbap_src,
24496      {"CBAP Source", "wlan.dmg_params.cbap_src",
24497       FT_BOOLEAN, 8, NULL, 0x08,
24498       NULL, HFILL }},
24499
24500     {&hf_ieee80211_ff_dmg_params_privacy,
24501      {"DMG Privacy", "wlan.dmg_params.privacy",
24502       FT_BOOLEAN, 8, NULL, 0x10,
24503       NULL, HFILL }},
24504
24505     {&hf_ieee80211_ff_dmg_params_policy,
24506      {"ECAPC Policy Enforced", "wlan.dmg_params.policy",
24507       FT_BOOLEAN, 8, NULL, 0x20,
24508       NULL, HFILL }},
24509
24510     {&hf_ieee80211_ff_cc,
24511      {"Clustering Control", "wlan.cc",
24512       FT_UINT64, BASE_HEX , NULL, 0,
24513       NULL, HFILL }},
24514
24515     {&hf_ieee80211_ff_cc_abft_resp_addr,
24516      {"A-BFT Responder Address", "wlan.cc.abft_resp_addr",
24517       FT_ETHER, BASE_NONE , NULL, 0,
24518       NULL, HFILL }},
24519
24520     {&hf_ieee80211_ff_cc_sp_duration,
24521      {"Beacon SP Duration", "wlan.cc.sp_duration",
24522       FT_UINT8, BASE_DEC , NULL, 0,
24523       NULL, HFILL }},
24524
24525     {&hf_ieee80211_ff_cc_cluster_id,
24526      {"Cluster ID", "wlan.cc.cluster_id",
24527       FT_UINT64, BASE_DEC , NULL, 0,
24528       NULL, HFILL }},
24529
24530     {&hf_ieee80211_ff_cc_role,
24531      {"Cluster Member Role", "wlan.cc.rold",
24532       FT_UINT8, BASE_DEC , NULL, 0,
24533       NULL, HFILL }},
24534
24535     {&hf_ieee80211_ff_cc_max_mem,
24536      {"Cluster MaxMem", "wlan.cc.max_mem",
24537       FT_UINT8, BASE_DEC , NULL, 0,
24538       NULL, HFILL }},
24539
24540     {&hf_ieee80211_tag_relay_support,
24541      {"Relay Supportability", "wlan.relay_capabilities.relay_support",
24542       FT_BOOLEAN, 8, NULL, 0x01,
24543       NULL, HFILL }},
24544
24545     {&hf_ieee80211_tag_relay_use,
24546      {"Relay Usability", "wlan.relay_capabilities.relay_use",
24547       FT_BOOLEAN, 8, NULL, 0x02,
24548       NULL, HFILL }},
24549
24550     {&hf_ieee80211_tag_relay_permission,
24551      {"Relay Permission", "wlan.relay_capabilities.relay_permission",
24552       FT_BOOLEAN, 8, NULL, 0x04,
24553       NULL, HFILL }},
24554
24555     {&hf_ieee80211_tag_AC_power,
24556      {"A/C Power", "wlan.relay_capabilities.AC_power",
24557       FT_BOOLEAN, 8, NULL, 0x08,
24558       NULL, HFILL }},
24559
24560     {&hf_ieee80211_tag_relay_prefer,
24561      {"Relay Preference", "wlan.relay_capabilities.relay_prefer",
24562       FT_BOOLEAN, 8, NULL, 0x10,
24563       NULL, HFILL }},
24564
24565     {&hf_ieee80211_tag_duplex,
24566      {"Duplex", "wlan.relay_capabilities.duplex",
24567       FT_UINT8, BASE_DEC, NULL, 0x60,
24568       NULL, HFILL }},
24569
24570     {&hf_ieee80211_tag_cooperation,
24571      {"Cooperation", "wlan.relay_capabilities.cooperation",
24572       FT_BOOLEAN, 8, NULL, 0x80,
24573       NULL, HFILL }},
24574
24575 #if 0
24576     {&hf_ieee80211_ff_rcsi,
24577      {"Relay Capable STA Info", "wlan.rcsi",
24578       FT_UINT24, BASE_HEX, NULL, 0,
24579       NULL, HFILL }},
24580
24581     {&hf_ieee80211_ff_rcsi_aid,
24582      {"AID", "wlan.rcsi.aid",
24583       FT_UINT8, BASE_DEC, NULL, 0xff,
24584       NULL, HFILL }},
24585 #endif
24586
24587     {&hf_ieee80211_ff_band_id,
24588      {"Band ID", "wlan.band_id",
24589       FT_UINT8, BASE_DEC, VALS(band_id), 0xff,
24590       NULL, HFILL }},
24591
24592     {&hf_ieee80211_tag_move,
24593      {"Move", "wlan.dmg_bss_param_change.move",
24594       FT_BOOLEAN, 8, NULL, 0x01,
24595       NULL, HFILL }},
24596
24597     {&hf_ieee80211_tag_size,
24598      {"Size", "wlan.dmg_bss_param_change.size",
24599       FT_BOOLEAN, 8, NULL, 0x02,
24600       NULL, HFILL }},
24601
24602     {&hf_ieee80211_tag_tbtt_offset,
24603      {"TBTT Offset", "wlan.dmg_bss_param_change.tbtt_offset",
24604       FT_UINT32, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xffffffff,
24605       NULL, HFILL }},
24606
24607     {&hf_ieee80211_tag_bi_duration,
24608      {"BI Duration", "wlan.dmg_bss_param_change.bi_duration",
24609       FT_UINT16, BASE_DEC, NULL, 0xffff,
24610       NULL, HFILL }},
24611
24612     {&hf_ieee80211_tag_dmg_capa_sta_addr,
24613      {"STA Address", "wlan.dmg_capa.sta_addr",
24614       FT_ETHER, BASE_NONE, NULL, 0,
24615       "STA_Address", HFILL }},
24616
24617     {&hf_ieee80211_tag_dmg_capa_aid,
24618      {"AID", "wlan.dmg_capa.aid",
24619       FT_UINT16, BASE_DEC, NULL, 0,
24620       NULL, HFILL }},
24621 /* 8.4.2.127.2 DMG STA Capability Information field */
24622     {&hf_ieee80211_tag_reverse_direction, /* DMG STA capa, bits [0] */
24623      {"Reverse Direction", "wlan.dmg_capa.reverse_direction",
24624       FT_BOOLEAN, 24, NULL, GENMASK(0, 0),
24625       NULL, HFILL }},
24626
24627     {&hf_ieee80211_tag_hlts, /* DMG STA capa, bits [1] */
24628      {"Higher Layer Timer Synchronization", "wlan.dmg_capa.htls",
24629       FT_BOOLEAN, 24, NULL, GENMASK(1, 1),
24630       NULL, HFILL }},
24631
24632     {&hf_ieee80211_tag_tpc, /* DMG STA capa, bits [2] */
24633      {"TPC", "wlan.dmg_capa.tpc",
24634       FT_BOOLEAN, 24, NULL, GENMASK(2, 2),
24635       NULL, HFILL }},
24636
24637     {&hf_ieee80211_tag_spsh, /* DMG STA capa, bits [3] */
24638      {"SPSH and Interference Mitigation", "wlan.dmg_capa.spsh",
24639       FT_BOOLEAN, 24, NULL, GENMASK(3, 3),
24640       NULL, HFILL }},
24641
24642     {&hf_ieee80211_tag_rx_antenna, /* DMG STA capa, bits [4..5] */
24643      {"Number of RX DMG Antennas", "wlan.dmg_capa.num_rx",
24644       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(5, 4),
24645       NULL, HFILL }},
24646
24647     {&hf_ieee80211_tag_fast_link, /* DMG STA capa, bits [6] */
24648      {"Fast Link Adaptation", "wlan.dmg_capa.fast_link",
24649       FT_BOOLEAN, 24, NULL, GENMASK(6, 6),
24650       NULL, HFILL }},
24651
24652     {&hf_ieee80211_tag_num_sectors, /* DMG STA capa, bits [7..13] */
24653      {"Total Number of Sectors", "wlan.dmg_capa.num_sectors",
24654       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(13, 7),
24655       NULL, HFILL }},
24656
24657     {&hf_ieee80211_tag_rxss_length, /* DMG STA capa, bits [14..19] */
24658      {"RXSS Length", "wlan.dmg_capa.rxss_len",
24659       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_mul_two_base_custom), GENMASK(19, 14),
24660       NULL, HFILL }},
24661
24662     {&hf_ieee80211_tag_reciprocity, /* DMG STA capa, bits [20] */
24663      {"DMG Antenna Reciprocity", "wlan.dmg_capa.reciprocity",
24664       FT_BOOLEAN, 24, NULL, GENMASK(20, 20),
24665       NULL, HFILL }},
24666 /* DMG STA capa, A-MPDU params, bits [21..26] */
24667     {&hf_ieee80211_tag_max_ampdu_exp, /* DMG STA capa, bits [21..23] */
24668      {"Maximum A-MPDU Length Exponent", "wlan.dmg_capa.max_ampdu_exp",
24669       FT_UINT24, BASE_DEC, NULL, GENMASK(23, 21),
24670       NULL, HFILL }},
24671
24672     {&hf_ieee80211_tag_min_mpdu_spacing, /* DMG STA capa, bits [24..26] */
24673      {"Minimum MPDU Start Spacing", "wlan.dmg_capa.min_mpdu_spacing",
24674       FT_UINT24, BASE_DEC, NULL, GENMASK(26-24, 24-24),
24675       NULL, HFILL }},
24676
24677     {&hf_ieee80211_tag_ba_flow_control , /* DMG STA capa, bits [27] */
24678      {"BA with Flow Control", "wlan.dmg_capa.bs_flow_ctrl",
24679       FT_BOOLEAN, 24, NULL, GENMASK(27-24, 27-24),
24680       NULL, HFILL }},
24681 /* DMG STA capa, supported MCS set, bits [28..51] */
24682     {&hf_ieee80211_tag_max_sc_rx_mcs, /* DMG STA capa, bits [28..32] */
24683      {"Maximum SC Rx MCS", "wlan.dmg_capa.max_sc_rx_mcs",
24684       FT_UINT24, BASE_DEC, NULL, GENMASK(32-24, 28-24),
24685       NULL, HFILL }},
24686
24687     {&hf_ieee80211_tag_max_ofdm_rx_mcs, /* DMG STA capa, bits [33..37] */
24688      {"Maximum OFDM Rx MCS", "wlan.dmg_capa.max_ofdm_rx_mcs",
24689       FT_UINT24, BASE_DEC, NULL, GENMASK(37-24, 33-24),
24690       NULL, HFILL }},
24691
24692     {&hf_ieee80211_tag_max_sc_tx_mcs, /* DMG STA capa, bits [38..42] */
24693      {"Maximum SC Tx MCS", "wlan.dmg_capa.max_sc_tx_mcs",
24694       FT_UINT24, BASE_DEC, NULL, GENMASK(42-24, 38-24),
24695       NULL, HFILL }},
24696
24697     {&hf_ieee80211_tag_max_ofdm_tx_mcs, /* DMG STA capa, bits [43..47] */
24698      {"Maximum OFDM Tx MCS", "wlan.dmg_capa.max_ofdm_tx_mcs",
24699       FT_UINT24, BASE_DEC, NULL, GENMASK(47-24, 43-24),
24700       NULL, HFILL }},
24701
24702     {&hf_ieee80211_tag_low_power_supported, /* DMG STA capa, bits [48] */
24703      {"Low Power SC PHY Supported", "wlan.dmg_capa.low_power_suuported",
24704       FT_BOOLEAN, 16, NULL, GENMASK(48-48, 48-48),
24705       NULL, HFILL }},
24706
24707     {&hf_ieee80211_tag_code_rate, /* DMG STA capa, bits [49] */
24708      {"Code Rate 13/16", "wlan.dmg_capa.code_rate",
24709       FT_BOOLEAN, 16, NULL, GENMASK(49-48, 49-48),
24710       NULL, HFILL }},
24711
24712     {&hf_ieee80211_tag_dtp, /* DMG STA capa, bits [52] */
24713      {"DTP Supported", "wlan.dmg_capa.dtp",
24714       FT_BOOLEAN, 16, NULL, GENMASK(52-48, 52-48),
24715       NULL, HFILL }},
24716
24717     {&hf_ieee80211_tag_appdu_supp, /* DMG STA capa, bits [53] */
24718      {"A-PPDU Supported", "wlan.dmg_capa.appdu_supp",
24719       FT_BOOLEAN, 16, NULL, GENMASK(53-48, 53-48),
24720       NULL, HFILL }},
24721
24722     {&hf_ieee80211_tag_heartbeat, /* DMG STA capa, bits [54] */
24723      {"HeartBeat", "wlan.dmg_capa.heartbeat",
24724       FT_BOOLEAN, 16, NULL, GENMASK(54-48, 54-48),
24725       NULL, HFILL }},
24726
24727     {&hf_ieee80211_tag_other_aid, /* DMG STA capa, bits [55] */
24728      {"Supports Other_AID", "wlan.dmg_capa.other_aid",
24729       FT_BOOLEAN, 16, NULL, GENMASK(55-48, 55-48),
24730       NULL, HFILL }},
24731
24732     {&hf_ieee80211_tag_pattern_recip, /* DMG STA capa, bits [56] */
24733      {"Antenna Pattern Reciprocity", "wlan.dmg_capa.pattern_recip",
24734       FT_BOOLEAN, 16, NULL, GENMASK(56-48, 56-48),
24735       NULL, HFILL }},
24736
24737     {&hf_ieee80211_tag_heartbeat_elapsed, /* DMG STA capa, bits [57..59] */
24738      {"Heartbeat Elapsed Indication", "wlan.dmg_capa.heartbeat_elapsed",
24739       FT_UINT16, BASE_DEC, NULL, GENMASK(59-48, 57-48),
24740       NULL, HFILL }},
24741
24742     {&hf_ieee80211_tag_grant_ack_supp, /* DMG STA capa, bits [60] */
24743      {"Grant ACK Supported", "wlan.dmg_capa.grant_ack_supp",
24744       FT_BOOLEAN, 16, NULL, GENMASK(60-48, 60-48),
24745       NULL, HFILL }},
24746
24747     {&hf_ieee80211_tag_RXSSTxRate_supp, /* DMG STA capa, bits [61] */
24748      {"RXSSTxRate Supported", "wlan.dmg_capa.RXSSTxRate",
24749       FT_BOOLEAN, 16, NULL, GENMASK(61-48, 61-48),
24750       NULL, HFILL }},
24751 /* 8.4.2.127.3 DMG PCP/AP Capability Information field */
24752     {&hf_ieee80211_tag_pcp_tddti, /* DMG PCP/AP capa, bits [0] */
24753      {"TDDTI", "wlan.dmg_capa.pcp_tdtti",
24754       FT_BOOLEAN, 16, NULL, GENMASK(0, 0),
24755       NULL, HFILL }},
24756
24757     {&hf_ieee80211_tag_pcp_PSA, /* DMG PCP/AP capa, bits [1] */
24758      {"Pseudo-static Allocations", "wlan.dmg_capa.pcp_psa",
24759       FT_BOOLEAN, 16, NULL, GENMASK(1, 1),
24760       NULL, HFILL }},
24761
24762     {&hf_ieee80211_tag_pcp_handover, /* DMG PCP/AP capa, bits [2] */
24763      {"PDP Handover", "wlan.dmg_capa.pcp_handover",
24764       FT_BOOLEAN, 16, NULL, GENMASK(2, 2),
24765       NULL, HFILL }},
24766
24767     {&hf_ieee80211_tag_pcp_max_assoc, /* DMG PCP/AP capa, bits [3..10] */
24768      {"Max Associated STA Number", "wlan.dmg_capa.pcp_max_assoc",
24769       FT_UINT16, BASE_DEC, NULL, GENMASK(10, 3),
24770       NULL, HFILL }},
24771
24772     {&hf_ieee80211_tag_pcp_power_src, /* DMG PCP/AP capa, bits [11] */
24773      {"Power Source", "wlan.dmg_capa.pcp_power_src",
24774       FT_BOOLEAN, 16, NULL, GENMASK(11, 11),
24775       NULL, HFILL }},
24776
24777     {&hf_ieee80211_tag_pcp_decenter, /* DMG PCP/AP capa, bits [12] */
24778      {"Decentralized PCP/AP Clustering", "wlan.dmg_capa.pcp_decenter",
24779       FT_BOOLEAN, 16, NULL, GENMASK(12, 12),
24780       NULL, HFILL }},
24781
24782     {&hf_ieee80211_tag_pcp_forwarding, /* DMG PCP/AP capa, bits [13] */
24783      {"PCP Forwarding", "wlan.dmg_capa.pcp_forwarding",
24784       FT_BOOLEAN, 16, NULL, GENMASK(13, 13),
24785       NULL, HFILL }},
24786
24787     {&hf_ieee80211_tag_pcp_center, /* DMG PCP/AP capa, bits [14] */
24788      {"Centralized PCP/AP Clustering", "wlan.dmg_capa.pcp_center",
24789       FT_BOOLEAN, 16, NULL, GENMASK(14, 14),
24790       NULL, HFILL }},
24791
24792     {&hf_ieee80211_tag_sta_beam_track, /* DMG STA beam track capa*/
24793      {"STA Beam Tracking Time Limit", "wlan.dmg_capa.beam_track",
24794       FT_UINT16, BASE_DEC | BASE_UNIT_STRING, &units_microseconds, 0,
24795       NULL, HFILL }},
24796
24797     {&hf_ieee80211_tag_ext_sc_mcs_max_tx, /* DMG STA Ext SC MCS Capa: Max TX*/
24798      {"Extended SC Max Tx MCS Name", "wlan.dmg_capa.ext_sc_mcs_capa_max_tx",
24799       FT_UINT8, BASE_DEC, VALS(extended_sc_mcs), GENMASK(2, 0),
24800       NULL, HFILL }},
24801
24802     {&hf_ieee80211_tag_ext_sc_mcs_tx_code_7_8, /* DMG STA Ext SC MCS Capa: Tx code rate 7/8*/
24803      {"Extended SC Tx MCS code rate 7/8", "wlan.dmg_capa.ext_sc_mcs_tx_code_7_8",
24804       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), GENMASK(3, 3),
24805       NULL, HFILL }},
24806
24807     {&hf_ieee80211_tag_ext_sc_mcs_max_rx, /* DMG STA Ext SC MCS Capa: Max RX*/
24808      {"Extended SC Max Rx MCS Name", "wlan.dmg_capa.ext_sc_mcs_capa_max_rx",
24809       FT_UINT8, BASE_DEC, VALS(extended_sc_mcs), GENMASK(6, 4),
24810       NULL, HFILL }},
24811
24812     {&hf_ieee80211_tag_ext_sc_mcs_rx_code_7_8, /* DMG STA Ext SC MCS Capa: Rx code rate 7/8*/
24813      {"Extended SC Rx MCS code rate 7/8", "wlan.dmg_capa.ext_sc_mcs_rx_code_7_8",
24814       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), GENMASK(7, 7),
24815       NULL, HFILL }},
24816
24817     {&hf_ieee80211_tag_max_basic_sf_amsdu, /* DMG Max Number of Basic Subframes in an A-MSDU*/
24818      {"Max Number of Basic Subframes in an A-MSDU", "wlan.dmg_capa.max_basic_sf_amsdu",
24819       FT_UINT8, BASE_RANGE_STRING | BASE_DEC, RVALS(max_basic_sf_amsdu), 0,
24820       NULL, HFILL }},
24821
24822     {&hf_ieee80211_tag_max_short_sf_amsdu, /* DMG Max Number of short Subframes in an A-MSDU*/
24823      {"Max Number of short Subframes in an A-MSDU", "wlan.dmg_capa.max_short_sf_amsdu",
24824       FT_UINT8, BASE_RANGE_STRING | BASE_DEC, RVALS(max_short_sf_amsdu), 0,
24825       NULL, HFILL }},
24826
24827     {&hf_ieee80211_tag_PSRSI,
24828      {"PS Request Suspension Interval", "wlan.dmg_oper.psrsi",
24829       FT_UINT8, BASE_DEC, NULL, 0,
24830       NULL, HFILL }},
24831
24832     {&hf_ieee80211_tag_min_BHI_duration,
24833      {"Min BHI Duration", "wlan.dmg_oper.min_BHI_duration",
24834       FT_UINT16, BASE_DEC, NULL, 0,
24835       NULL, HFILL }},
24836
24837     {&hf_ieee80211_tag_brdct_sta_info_dur,
24838      {"Broadcast STA Info Duration", "wlan.dmg_oper.brdcst_sta_info_dur",
24839       FT_UINT8, BASE_DEC, NULL, 0,
24840       NULL, HFILL }},
24841
24842     {&hf_ieee80211_tag_assoc_resp_confirm_time,
24843      {"Associated Response Confirm Time", "wlan.dmg_oper.assoc_resp_confirm_time",
24844       FT_UINT8, BASE_DEC, NULL, 0,
24845       NULL, HFILL }},
24846
24847     {&hf_ieee80211_tag_min_pp_duration,
24848      {"Min PP Duration", "wlan.dmg_oper.min_pp_duration",
24849       FT_UINT8, BASE_DEC, NULL, 0,
24850       NULL, HFILL }},
24851
24852     {&hf_ieee80211_tag_SP_idle_timeout,
24853      {"SP Idle Timeout", "wlan.dmg_oper.SP_idle_timeout",
24854       FT_UINT8, BASE_DEC, NULL, 0,
24855       NULL, HFILL }},
24856
24857     {&hf_ieee80211_tag_max_lost_beacons,
24858      {"Max Lost Beacons", "wlan.dmg_oper.max_lost_beacons",
24859       FT_UINT8, BASE_DEC, NULL, 0,
24860       NULL, HFILL }},
24861
24862     {&hf_ieee80211_tag_type,
24863      {"Type", "wlan.sctor_id.type",
24864       FT_UINT32, BASE_HEX, NULL, 0x0000000f,
24865       NULL, HFILL }},
24866
24867     {&hf_ieee80211_tag_tap1,
24868      {"Tap 1", "wlan.sctor_id.tap1",
24869       FT_UINT32, BASE_HEX, NULL, 0x000003f0,
24870       NULL, HFILL }},
24871
24872     {&hf_ieee80211_tag_state1,
24873      {"State 1", "wlan.sctor_id.state1",
24874       FT_UINT32, BASE_HEX, NULL, 0x0000fc00,
24875       NULL, HFILL }},
24876
24877     {&hf_ieee80211_tag_tap2,
24878      {"Tap 2", "wlan.sctor_id.tap2",
24879       FT_UINT32, BASE_HEX, NULL, 0x00ff0000,
24880       NULL, HFILL }},
24881
24882     {&hf_ieee80211_tag_state2,
24883      {"State 2", "wlan.sctor_id.state2",
24884       FT_UINT32, BASE_HEX, NULL, 0xff000000,
24885       NULL, HFILL }},
24886
24887     {&hf_ieee80211_tag_allocation_id,
24888      {"Allocation ID", "wlan.ext_sched.alloc_id",
24889       FT_UINT16, BASE_DEC, NULL, 0x000f,
24890       NULL, HFILL }},
24891
24892     {&hf_ieee80211_tag_allocation_type,
24893      {"Allocation Type", "wlan.ext_sched.alloc_type",
24894       FT_UINT16, BASE_DEC, VALS(allocation_type), 0x0070,
24895       NULL, HFILL }},
24896
24897     {&hf_ieee80211_tag_pseudo_static,
24898      {"Pseudo-static", "wlan.ext_sched.p_static",
24899       FT_BOOLEAN, 16, NULL, 0x0080,
24900       NULL, HFILL }},
24901
24902     {&hf_ieee80211_tag_truncatable,
24903      {"Truncatable", "wlan.ext_sched.truncatable",
24904       FT_BOOLEAN, 16, NULL, 0x0100,
24905       NULL, HFILL }},
24906
24907     {&hf_ieee80211_tag_extendable,
24908      {"Extenedable", "wlan.ext_sched.extendable",
24909       FT_BOOLEAN, 16, NULL, 0x0200,
24910       NULL, HFILL }},
24911
24912     {&hf_ieee80211_tag_pcp_active,
24913      {"PCP Active", "wlan.ext_sched.pcp_active",
24914       FT_BOOLEAN, 16, NULL, 0x0400,
24915       NULL, HFILL }},
24916
24917     {&hf_ieee80211_tag_lp_sc_used,
24918      {"LP SC Used", "wlan.ext_sched.lp_sc_used",
24919       FT_BOOLEAN, 16, NULL, 0x0800,
24920       NULL, HFILL }},
24921
24922     {&hf_ieee80211_tag_src_aid,
24923      {"Source AID", "wlan.ext_sched.src_id",
24924       FT_UINT8, BASE_DEC, NULL, 0xff,
24925       NULL, HFILL }},
24926
24927     {&hf_ieee80211_tag_dest_aid,
24928      {"Destination AID", "wlan.ext_sched.dest_id",
24929       FT_UINT8, BASE_DEC, NULL, 0xff,
24930       NULL, HFILL }},
24931
24932     {&hf_ieee80211_tag_alloc_start,
24933      {"Allocation Start", "wlan.ext_sched.alloc_start",
24934       FT_UINT32, BASE_DEC, NULL, 0,
24935       NULL, HFILL }},
24936
24937     {&hf_ieee80211_tag_alloc_block_duration,
24938      {"Allocation Block Duration", "wlan.ext_sched.block_duration",
24939       FT_UINT16, BASE_DEC, NULL, 0xffff,
24940       NULL, HFILL }},
24941
24942     {&hf_ieee80211_tag_num_blocks,
24943      {"Number of Blocks", "wlan.ext_sched.num_blocks",
24944       FT_UINT8, BASE_DEC, NULL, 0xff,
24945       NULL, HFILL }},
24946
24947     {&hf_ieee80211_tag_alloc_block_period,
24948      {"Allocation Block Period", "wlan.ext_sched.alloc_block_period",
24949       FT_UINT16, BASE_DEC, NULL, 0xffff,
24950       NULL, HFILL }},
24951
24952     {&hf_ieee80211_tag_aid,
24953      {"AID", "wlan.sta_avail.aid",
24954       FT_UINT16, BASE_DEC, NULL, 0x00ff,
24955       NULL, HFILL }},
24956
24957     {&hf_ieee80211_tag_cbap,
24958      {"CBAP", "wlan.sta_avail.cbap",
24959       FT_BOOLEAN, 16, NULL, 0x0100,
24960       NULL, HFILL }},
24961
24962     {&hf_ieee80211_tag_pp_avail,
24963      {"PP Available", "wlan.sta_avail.pp_avail",
24964       FT_BOOLEAN, 16, NULL, 0x0200,
24965       NULL, HFILL }},
24966
24967     {&hf_ieee80211_tag_next_ati_start_time,
24968      {"Start Time", "wlan.next_ati.start_time",
24969       FT_UINT32, BASE_DEC, NULL, 0,
24970       NULL, HFILL }},
24971
24972     {&hf_ieee80211_tag_next_ati_duration,
24973      {"ATI Duration", "wlan.next_ati.duration",
24974       FT_UINT16, BASE_DEC, NULL, 0xffff,
24975       NULL, HFILL }},
24976
24977     {&hf_ieee80211_tag_old_bssid,
24978      {"Old BSSID", "wlan.pcp_handover.old_bssid",
24979       FT_ETHER, BASE_NONE, NULL, 0,
24980       "OLD_BSSID", HFILL }},
24981
24982     {&hf_ieee80211_tag_new_pcp_addr,
24983      {"New PCP Address", "wlan.pcp_handover.new_pcp_addr",
24984       FT_ETHER, BASE_NONE, NULL, 0,
24985       "New_PCP_Address", HFILL }},
24986
24987     {&hf_ieee80211_tag_bssid,
24988      {"BSSID", "wlan.quiet_res.bssid",
24989       FT_ETHER, BASE_NONE, NULL, 0,
24990       "BSS-ID", HFILL }},
24991
24992     {&hf_ieee80211_tag_duplex_relay,
24993      {"Duplex", "wlan.relay_capabilities.duplex",
24994       FT_UINT8, BASE_DEC, NULL, 0x01,
24995       NULL, HFILL }},
24996
24997     {&hf_ieee80211_tag_cooperation_relay,
24998      {"Cooperation", "wlan.relay_capabilities.cooperation",
24999       FT_BOOLEAN, 8, NULL, 0x02,
25000       NULL, HFILL }},
25001
25002     {&hf_ieee80211_tag_tx_mode,
25003      {"TX-Mode", "wlan.realy_trans_param.tx_mode",
25004       FT_BOOLEAN, 8, NULL, 0x04,
25005       NULL, HFILL }},
25006
25007     {&hf_ieee80211_tag_link_change_interval,
25008      {"Link Change Interval", "wlan.realy_trans_param.link_change_interval",
25009       FT_UINT8, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xff,
25010       NULL, HFILL }},
25011
25012     {&hf_ieee80211_tag_data_sensing_time,
25013      {"Data Sensing Time", "wlan.realy_trans_param.data_sensing_time",
25014       FT_UINT8, BASE_DEC, NULL, 0xff,
25015       NULL, HFILL }},
25016
25017     {&hf_ieee80211_tag_first_period,
25018      {"First Period", "wlan.realy_trans_param.first_period",
25019       FT_UINT16, BASE_DEC, NULL, 0xffff,
25020       NULL, HFILL }},
25021
25022     {&hf_ieee80211_tag_second_period,
25023      {"Second Period", "wlan.realy_trans_param.second_period",
25024       FT_UINT16, BASE_DEC, NULL, 0xffff,
25025       NULL, HFILL }},
25026
25027     {&hf_ieee80211_tag_initiator,
25028      {"Initiator", "wlan.beam_refine.initiator",
25029       FT_BOOLEAN, 40, NULL, 0x0000000001,
25030       NULL, HFILL }},
25031
25032     {&hf_ieee80211_tag_tx_train_res,
25033      {"TX-train-response", "wlan.beam_refine.tx_train_res",
25034       FT_BOOLEAN, 40, NULL, 0x0000000002,
25035       NULL, HFILL }},
25036
25037     {&hf_ieee80211_tag_rx_train_res,
25038      {"RX-train-response", "wlan.beam_refine.rx_train_res",
25039       FT_BOOLEAN, 40, NULL, 0x0000000004,
25040       NULL, HFILL }},
25041
25042     {&hf_ieee80211_tag_tx_trn_ok,
25043      {"TX-TRN-OK", "wlan.beam_refine.tx_trn_ok",
25044       FT_BOOLEAN, 40, NULL, 0x0000000008,
25045       NULL, HFILL }},
25046
25047     {&hf_ieee80211_tag_txss_fbck_req,
25048      {"TXSS-FBCK-REQ", "wlan.beam_refine.txss_fbck_req",
25049       FT_BOOLEAN, 40, NULL, 0x0000000010,
25050       NULL, HFILL }},
25051
25052     {&hf_ieee80211_tag_bs_fbck,
25053      {"BS-FBCK", "wlan.beam_refine.bs_fbck",
25054       FT_UINT40, BASE_DEC, NULL, 0x00000007e0,
25055       NULL, HFILL }},
25056
25057     {&hf_ieee80211_tag_bs_fbck_antenna_id,
25058      {"BS-FBCK Anetenna ID", "wlan.beam_refine.bs_fbck_antenna_id",
25059       FT_UINT40, BASE_DEC, NULL, 0x0000001800,
25060       NULL, HFILL }},
25061
25062     {&hf_ieee80211_tag_snr_requested,
25063      {"SNR Requested", "wlan.beam_refine.snr_req",
25064       FT_BOOLEAN, 40, NULL, 0x0000002000,
25065       NULL, HFILL }},
25066
25067     {&hf_ieee80211_tag_channel_measurement_requested,
25068      {"Channel Measurement Requested", "wlan.beam_refine.ch_measure_req",
25069       FT_BOOLEAN, 40, NULL, 0x0000004000,
25070       NULL, HFILL }},
25071
25072     {&hf_ieee80211_tag_number_of_taps_requested,
25073      {"Number of Taps Requested", "wlan.beam_refine.taps_req",
25074       FT_UINT40, BASE_DEC | BASE_VAL64_STRING, VALS64(number_of_taps_values), 0x0000018000,
25075       NULL, HFILL }},
25076
25077     {&hf_ieee80211_tag_sector_id_order_req,
25078      {"Sector ID Order Requested", "wlan.beam_refine.sector_id_req",
25079       FT_BOOLEAN, 40, NULL, 0x0000020000,
25080       NULL, HFILL }},
25081
25082     {&hf_ieee80211_tag_snr_present,
25083      {"SNR Present", "wlan.beam_refine.snr_present",
25084       FT_BOOLEAN, 40, NULL, 0x0000040000,
25085       NULL, HFILL }},
25086
25087     {&hf_ieee80211_tag_channel_measurement_present,
25088      {"Channel Measurement Present", "wlan.beam_refine.ch_measure_present",
25089       FT_BOOLEAN, 40, NULL, 0x0000080000,
25090       NULL, HFILL }},
25091
25092     {&hf_ieee80211_tag_tap_delay_present,
25093      {"Tap Delay Present", "wlan.beam_refine.tap_delay_present",
25094       FT_BOOLEAN, 40, NULL, 0x0000100000,
25095       NULL, HFILL }},
25096
25097     {&hf_ieee80211_tag_number_of_taps_present,
25098      {"Number of Taps Present", "wlan.beam_refine.taps_present",
25099       FT_UINT40, BASE_DEC | BASE_VAL64_STRING, VALS64(number_of_taps_values), 0x0000600000,
25100       NULL, HFILL }},
25101
25102     {&hf_ieee80211_tag_number_of_measurement,
25103      {"Number of Measurements", "wlan.beam_refine.num_measurement",
25104       FT_UINT40, BASE_DEC, NULL, 0x003f800000,
25105       NULL, HFILL }},
25106
25107     {&hf_ieee80211_tag_sector_id_order_present,
25108      {"Sector ID Order Present", "wlan.beam_refine.sector_id_present",
25109       FT_BOOLEAN, 40, NULL, 0x0040000000,
25110       NULL, HFILL }},
25111
25112     {&hf_ieee80211_tag_number_of_beams,
25113      {"Number of Beams", "wlan.beam_refine.num_beams",
25114       FT_UINT40, BASE_DEC, NULL, 0x0f80000000,
25115       NULL, HFILL }},
25116
25117     {&hf_ieee80211_tag_mid_extension,
25118      {"MID Extension", "wlan.beam_refine.mid_ext",
25119       FT_BOOLEAN, 40, NULL, 0x1000000000,
25120       NULL, HFILL }},
25121
25122     {&hf_ieee80211_tag_capability_request,
25123      {"Capability Request", "wlan.beam_refine.cap_req",
25124       FT_BOOLEAN, 40, NULL, 0x2000000000,
25125       NULL, HFILL }},
25126
25127     {&hf_ieee80211_tag_beam_refine_reserved,
25128      {"Reserved", "wlan.beam_refine.reserved",
25129       FT_UINT40, BASE_DEC, NULL, 0xc000000000,
25130       NULL, HFILL }},
25131
25132     {&hf_ieee80211_tag_nextpcp_list,
25133       {"AID of NextPCP", "wlan.next_pcp.list",
25134        FT_UINT8, BASE_DEC, NULL, 0,
25135        NULL, HFILL }},
25136
25137     {&hf_ieee80211_tag_nextpcp_token,
25138       {"NextPCP List Token", "wlan.next_pcp.token",
25139        FT_UINT8, BASE_DEC, NULL, 0,
25140        NULL, HFILL }},
25141
25142     {&hf_ieee80211_tag_reamaining_BI,
25143       {"Remaining BI's", "wlan.pcp_handover.remaining_BIs",
25144        FT_UINT8, BASE_DEC, NULL, 0,
25145        NULL, HFILL }},
25146
25147     {&hf_ieee80211_tag_request_token,
25148       {"Request Token", "wlan.request_token",
25149        FT_UINT16, BASE_DEC, NULL, 0,
25150        NULL, HFILL }},
25151
25152     {&hf_ieee80211_tag_bi_start_time,
25153       {"BI Start Time", "wlan.bi_start_time",
25154        FT_UINT32, BASE_DEC, NULL, 0,
25155        NULL, HFILL }},
25156
25157     {&hf_ieee80211_tag_sleep_cycle,
25158       {"Sleep Cycle", "wlan.sleep_cycle",
25159        FT_UINT16, BASE_DEC, NULL, 0,
25160        NULL, HFILL }},
25161
25162     {&hf_ieee80211_tag_num_awake_bis,
25163       {"Number of Awake/Doze BIs", "wlan.num_awake_bis",
25164        FT_UINT16, BASE_DEC, NULL, 0,
25165        NULL, HFILL }},
25166
25167     {&hf_ieee80211_ff_dmg_action_code,
25168      {"DMG Action", "wlan.fixed.dmg_act",
25169       FT_UINT8, BASE_HEX, VALS(ff_dmg_action_flags), 0,
25170       "Action Code", HFILL }},
25171
25172     {&hf_ieee80211_ff_unprotected_dmg_action_code,
25173      {"Unprotected DMG Action", "wlan.fixed.unprotected_dmg_act",
25174       FT_UINT8, BASE_HEX, VALS(ff_unprotected_dmg_action_flags), 0,
25175       "Action Code", HFILL }},
25176
25177     {&hf_ieee80211_ff_dmg_pwr_mgmt,
25178       {"DMG Power Management", "wlan.dmg.pwr_mgmt",
25179        FT_BOOLEAN, 8, NULL, 0x01,
25180        NULL, HFILL }},
25181
25182     {&hf_ieee80211_ff_subject_address,
25183       {"Subject Address", "wlan.dmg.subject_addr",
25184        FT_ETHER, BASE_NONE, NULL, 0,
25185        "MAC address of requested STA", HFILL }},
25186
25187     {&hf_ieee80211_ff_handover_reason,
25188       {"Handover Reason", "wlan.dmg.handover_reason",
25189        FT_UINT8, BASE_DEC, NULL, 0x03,
25190        NULL, HFILL }},
25191
25192     {&hf_ieee80211_ff_handover_remaining_bi,
25193       {"Handover Remaining BI", "wlan.dmg.handover_remaining_bi",
25194        FT_UINT8, BASE_DEC, NULL, 0x01,
25195        NULL, HFILL }},
25196
25197     {&hf_ieee80211_ff_handover_result,
25198       {"Handover Result", "wlan.dmg.handover_result",
25199        FT_UINT8, BASE_DEC, NULL, 0x01,
25200        NULL, HFILL }},
25201
25202     {&hf_ieee80211_ff_handover_reject_reason,
25203       {"Handover Reject Reason", "wlan.dmg.handover_reject_reason",
25204        FT_UINT8, BASE_DEC, NULL, 0x03,
25205        NULL, HFILL }},
25206
25207     {&hf_ieee80211_ff_destination_reds_aid,
25208       {"Destination REDS AID", "wlan.dmg.destination_reds_aid",
25209        FT_UINT16, BASE_DEC, NULL, 0,
25210        NULL, HFILL }},
25211
25212     {&hf_ieee80211_ff_destination_aid,
25213       {"Destination AID", "wlan.dmg.destination_aid",
25214        FT_UINT16, BASE_DEC, NULL, 0,
25215        NULL, HFILL }},
25216
25217     {&hf_ieee80211_ff_realy_aid,
25218       {"Relay AID", "wlan.dmg.realy_aid",
25219        FT_UINT16, BASE_DEC, NULL, 0,
25220        NULL, HFILL }},
25221
25222     {&hf_ieee80211_ff_source_aid,
25223       {"Source AID", "wlan.dmg.source_aid",
25224        FT_UINT16, BASE_DEC, NULL, 0,
25225        NULL, HFILL }},
25226
25227     {&hf_ieee80211_ff_timing_offset,
25228       {"Timing Offset", "wlan.dmg.timing_offset",
25229        FT_UINT16, BASE_DEC, NULL, 0,
25230        NULL, HFILL }},
25231
25232     {&hf_ieee80211_ff_sampling_frequency_offset,
25233       {"Sampling Frequency Offset", "wlan.dmg.sampling_frequency_offset",
25234        FT_UINT16, BASE_DEC, NULL, 0,
25235        NULL, HFILL }},
25236
25237     {&hf_ieee80211_ff_relay_operation_type,
25238       {"Relay Operation Type", "wlan.dmg.relay_operation_type",
25239        FT_UINT8, BASE_DEC, NULL, 0x03,
25240        NULL, HFILL }},
25241
25242     {&hf_ieee80211_ff_peer_sta_aid,
25243       {"Peer STA AID", "wlan.dmg.peer_sta_aid",
25244        FT_UINT8, BASE_DEC, NULL, 0,
25245        NULL, HFILL }},
25246
25247     {&hf_ieee80211_ff_snr,
25248       {"SNR", "wlan.dmg.snr",
25249        FT_UINT8, BASE_DEC, NULL, 0,
25250        NULL, HFILL }},
25251
25252     {&hf_ieee80211_ff_internal_angle,
25253       {"Internal Angle", "wlan.dmg.internal_angle",
25254        FT_UINT8, BASE_DEC, NULL, 0xfe,
25255        NULL, HFILL }},
25256
25257     {&hf_ieee80211_ff_recommend,
25258       {"Recommend", "wlan.dmg.recommend",
25259        FT_UINT8, BASE_DEC, NULL, 0x01,
25260        NULL, HFILL }},
25261
25262     {&hf_ieee80211_ff_fst_action_code,
25263       {"FST Action Code", "wlan.fst.action_code",
25264        FT_UINT8, BASE_HEX, VALS(ff_fst_action_flags), 0,
25265        "Action Code", HFILL }},
25266
25267     {&hf_ieee80211_ff_llt,
25268       {"Link Loss Timeout", "wlan.fst.llt",
25269        FT_UINT32, BASE_DEC, NULL, 0,
25270        NULL, HFILL }},
25271
25272     {&hf_ieee80211_ff_fsts_id,
25273       {"FSTS ID", "wlan.session_trans.fsts_id",
25274        FT_UINT32, BASE_DEC, NULL, 0,
25275        NULL, HFILL }},
25276
25277     {&hf_ieee80211_ff_mmpdu_len,
25278       {"MMPDU Length", "wlan.fst.mmpdu_length",
25279        FT_UINT16, BASE_DEC, NULL, 0,
25280        NULL, HFILL }},
25281
25282     {&hf_ieee80211_ff_mmpdu_ctrl,
25283       {"MMPDU Control", "wlan.fst.mmpdu_ctrl",
25284        FT_UINT16, BASE_HEX, NULL, 0,
25285        NULL, HFILL }},
25286
25287     {&hf_ieee80211_ff_oct_mmpdu,
25288       {"OCT MMPDU", "wlan.fst.oct_mmpdu",
25289        FT_BYTES, BASE_NONE, NULL, 0,
25290        NULL, HFILL }},
25291
25292     {&hf_ieee80211_ff_vht_mimo_cntrl,
25293      {"VHT MIMO Control", "wlan.vht.mimo_control.control",
25294       FT_UINT24, BASE_HEX, NULL, 0x0,
25295       NULL, HFILL }},
25296
25297     {&hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
25298      {"Nc Index", "wlan.vht.mimo_control.ncindex",
25299       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nc_index_vals), 0x000007,
25300       "Number of Columns Less One", HFILL }},
25301
25302     {&hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
25303      {"Nr Index", "wlan.vht.mimo_control.nrindex",
25304       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nr_index_vals), 0x000038,
25305       "Number of Rows Less One", HFILL }},
25306
25307     {&hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
25308      {"Channel Width", "wlan.vht.mimo_control.chanwidth",
25309       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_channel_width_vals), 0x0000C0,
25310       NULL, HFILL }},
25311
25312     {&hf_ieee80211_ff_vht_mimo_cntrl_grouping,
25313      {"Grouping (Ng)", "wlan.vht.mimo_control.grouping",
25314       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_grouping_vals), 0x000300,
25315       NULL, HFILL }},
25316
25317     {&hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
25318      {"Codebook Information", "wlan.vht.mimo_control.codebookinfo",
25319       FT_UINT24, BASE_HEX, NULL, 0x000400,
25320       NULL, HFILL }},
25321
25322     {&hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
25323      {"Feedback Type", "wlan.vht.mimo_control.feedbacktype",
25324       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_feedback_vals), 0x000800,
25325       NULL, HFILL }},
25326
25327     {&hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
25328      {"Remaining Feedback Segments", "wlan.vht.mimo_control.remainingfeedbackseg",
25329       FT_UINT24, BASE_HEX, NULL, 0x007000,
25330       NULL, HFILL }},
25331
25332     {&hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
25333      {"First Feedback Segments", "wlan.vht.mimo_control.firstfeedbackseg",
25334       FT_UINT24, BASE_HEX, NULL, 0x008000,
25335       NULL, HFILL }},
25336
25337     {&hf_ieee80211_ff_vht_mimo_cntrl_reserved,
25338      {"Reserved", "wlan.vht.mimo_control.reserved",
25339       FT_UINT24, BASE_HEX, NULL, 0x030000,
25340       NULL, HFILL }},
25341
25342     {&hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
25343      {"Sounding Dialog Token Number", "wlan.vht.mimo_control.sounding_dialog_tocken_nbr",
25344       FT_UINT24, BASE_HEX, NULL, 0xFC0000,
25345       NULL, HFILL }},
25346
25347     {&hf_ieee80211_ff_vht_action,
25348       {"VHT Action", "wlan.vht.action",
25349        FT_UINT8, BASE_DEC, VALS(vht_action_vals), 0,
25350        NULL, HFILL }},
25351
25352     {&hf_ieee80211_vht_compressed_beamforming_report,
25353       {"VHT Compressed Beamforming Report", "wlan.vht.compressed_beamforming_report",
25354        FT_BYTES, BASE_NONE, NULL, 0,
25355        NULL, HFILL }},
25356
25357     {&hf_ieee80211_vht_mu_exclusive_beamforming_report,
25358       {"VHT MU Exclusive Beamforming Report","wlan.vht.exclusive_beamforming_report",
25359        FT_BYTES, BASE_NONE, NULL, 0,
25360        NULL, HFILL }},
25361
25362     {&hf_ieee80211_vht_compressed_beamforming_report_snr,
25363       {"Signal to Noise Ratio (SNR)", "wlan.vht.compressed_beamforming_report.snr",
25364        FT_INT8, BASE_DEC, NULL, 0,
25365        NULL, HFILL }},
25366
25367     {&hf_ieee80211_vht_compressed_beamforming_phi_angle,
25368       {"PHI", "wlan.vht.compressed_beamforming_report.phi",
25369        FT_NONE, BASE_NONE, NULL, 0,
25370        NULL, HFILL }},
25371
25372     {&hf_ieee80211_vht_compressed_beamforming_psi_angle,
25373       {"PSI", "wlan.vht.compressed_beamforming_report.psi",
25374        FT_NONE, BASE_NONE, NULL, 0,
25375        NULL, HFILL }},
25376
25377     {&hf_ieee80211_vht_compressed_beamforming_feedback_matrix,
25378       {"Compressed Beamforming Feedback Matrix", "wlan.vht.compressed_beamforming_report.feedback_matrix",
25379        FT_NONE, BASE_NONE, NULL, 0,
25380        NULL, HFILL }},
25381
25382     {&hf_ieee80211_vht_mu_Exclusive_beamforming_delta_snr,
25383       {"Delta SNR for space-time stream Nc for subcarrier k", "wlan.vht.exclusive_beamforming_report.delta_snr",
25384        FT_NONE, BASE_NONE, NULL, 0,
25385        NULL, HFILL }},
25386
25387     {&hf_ieee80211_vht_group_id_management,
25388       {"Group ID Management", "wlan.vht.group_id_management",
25389        FT_BYTES, BASE_NONE, NULL, 0,
25390        NULL, HFILL }},
25391
25392     {&hf_ieee80211_vht_membership_status_array,
25393       {"Membership Status Array", "wlan.vht.membership_status_array",
25394        FT_BYTES, BASE_NONE, NULL, 0,
25395        NULL, HFILL }},
25396
25397       {&hf_ieee80211_vht_user_position_array,
25398         {"User Position Array", "wlan.vht.user_position_array",
25399          FT_BYTES, BASE_NONE, NULL, 0,
25400          NULL, HFILL }},
25401
25402       {&hf_ieee80211_vht_membership_status_field,
25403         {"Membership Status Field", "wlan.vht.membership_status_array.field",
25404          FT_UINT8, BASE_DEC, NULL, 0,
25405          NULL, HFILL }},
25406
25407       {&hf_ieee80211_vht_user_position_field,
25408         {"User Position Field", "wlan.vht.user_position_array.field",
25409          FT_UINT8, BASE_DEC, NULL, 0,
25410          NULL, HFILL }},
25411
25412     {&hf_ieee80211_vht_operation_mode_notification,
25413       {"Operation Mode Notification", "wlan.vht.operation_mode_notification",
25414        FT_BYTES, BASE_NONE, NULL, 0,
25415        NULL, HFILL }},
25416
25417     {&hf_ieee80211_ff_he_action,
25418       {"HE Action", "wlan.he.action",
25419        FT_UINT8, BASE_DEC, VALS(he_action_vals), 0,
25420        NULL, HFILL }},
25421
25422     {&hf_he_mimo_control_nc_index,
25423      {"Nc Index", "wlan.he.mimo.nc_index",
25424       FT_UINT40, BASE_DEC, NULL, 0x0000000007, NULL, HFILL }},
25425
25426     {&hf_he_mimo_control_nr_index,
25427      {"Nr Index", "wlan.he.mimo.nr_index",
25428       FT_UINT40, BASE_DEC, NULL, 0x0000000038, NULL, HFILL }},
25429
25430     {&hf_he_mimo_control_bw,
25431      {"BW", "wlan.he.mimo.bw",
25432       FT_UINT40, BASE_DEC, NULL, 0x00000000C0, NULL, HFILL }},
25433
25434     {&hf_he_mimo_control_grouping,
25435      {"Grouping", "wlan.he.mimo.grouping",
25436       FT_UINT40, BASE_DEC, NULL, 0x0000000100, NULL, HFILL }},
25437
25438     {&hf_he_mimo_control_codebook_info,
25439      {"Codebook Information", "wlan.he.mimo.codebook_info",
25440       FT_UINT40, BASE_DEC, NULL, 0x0000000200, NULL, HFILL }},
25441
25442     {&hf_he_mimo_control_feedback_type,
25443      {"Feedback Type", "wlan.he.mimo.feedback_type",
25444       FT_UINT40, BASE_DEC, NULL, 0x0000000C00, NULL, HFILL }},
25445
25446     {&hf_he_mimo_control_remaining_feedback_segs,
25447      {"Remaining Feedback Segments", "wlan.he.mimo.remaining_feedback_segs",
25448       FT_UINT40, BASE_DEC, NULL, 0x0000007000, NULL, HFILL }},
25449
25450     {&hf_he_mimo_control_first_feedback_seg,
25451      {"First Feedback Segment", "wlan.he.mimo.first_feedback_seg",
25452       FT_UINT40, BASE_DEC, NULL, 0x0000008000, NULL, HFILL }},
25453
25454     {&hf_he_mimo_control_ru_start_index,
25455      {"RU Start Index", "wlan.he.mimo.ru_start_index",
25456       FT_UINT40, BASE_HEX, NULL, 0x00007F0000, NULL, HFILL }},
25457
25458     {&hf_he_mimo_control_ru_end_index,
25459      {"RU End Index", "wlan.he.mimo.ru_end_index",
25460       FT_UINT40, BASE_HEX, NULL, 0x003F800000, NULL, HFILL }},
25461
25462     {&hf_he_mimo_control_sounding_dialog_token_num,
25463      {"Sounding Dialog Token Number", "wlan.he.mimo.sounding_dialog_token_num",
25464       FT_UINT40, BASE_DEC, NULL, 0x0FC0000000, NULL, HFILL }},
25465
25466     {&hf_he_mimo_control_reserved,
25467      {"Reserved", "wlan.he.mimo.reserved",
25468       FT_UINT40, BASE_DEC, NULL, 0xF000000000, NULL, HFILL }},
25469
25470     {&hf_ieee80211_he_mimo_control_field,
25471      {"HE MIMO Control", "wlan.he.action.he_mimo_control",
25472       FT_UINT40, BASE_HEX, NULL, 0x0, NULL, HFILL }},
25473
25474     {&hf_ieee80211_tag_tspec_allocation_id,
25475       {"Allocation ID", "wlan.dmg_tspec.allocation_id",
25476        FT_UINT24, BASE_DEC, NULL, 0x00000f,
25477        NULL, HFILL }},
25478
25479     {&hf_ieee80211_tag_tspec_allocation_type,
25480       {"Allocation Type", "wlan.dmg_tspec.allocation_type",
25481        FT_UINT24, BASE_DEC, NULL, 0x000070,
25482        NULL, HFILL }},
25483
25484     {&hf_ieee80211_tag_tspec_allocation_format,
25485       {"Allocation Format", "wlan.dmg_tspec.allocation_format",
25486        FT_BOOLEAN, 24, NULL, 0x000080,
25487        NULL, HFILL }},
25488
25489     {&hf_ieee80211_tag_tspec_pseudo_static,
25490       {"Pseudo Static", "wlan.dmg_tspec.pseudo_static",
25491        FT_BOOLEAN, 24, NULL, 0x000100,
25492        NULL, HFILL }},
25493
25494     {&hf_ieee80211_tag_tspec_truncatable,
25495       {"Truncatable", "wlan.dmg_tspec.truncatable",
25496        FT_BOOLEAN, 24, NULL, 0x000200,
25497        NULL, HFILL }},
25498
25499     {&hf_ieee80211_tag_tspec_extendable,
25500       {"Extendable", "wlan.dmg_tspec.extendable",
25501        FT_BOOLEAN, 24, NULL, 0x000400,
25502        NULL, HFILL }},
25503
25504     {&hf_ieee80211_tag_tspec_lp_sc_used,
25505       {"LP SC Usec", "wlan.dmg_tspec.lp_sc_used",
25506        FT_BOOLEAN, 24, NULL, 0x000800,
25507        NULL, HFILL }},
25508
25509     {&hf_ieee80211_tag_tspec_up,
25510       {"UP", "wlan.dmg_tspec.up",
25511        FT_UINT24, BASE_HEX, NULL, 0x007000,
25512        NULL, HFILL }},
25513
25514     {&hf_ieee80211_tag_tspec_dest_aid,
25515       {"Destination AID", "wlan.dmg_tspec.dest_aid",
25516        FT_UINT24, BASE_HEX, NULL, 0x7f8000,
25517        NULL, HFILL }},
25518
25519     {&hf_ieee80211_tag_tspec_allocation_period,
25520       {"Allocation Period", "wlan.dmg_tspec.allocation_period",
25521        FT_UINT16, BASE_DEC, NULL, 0,
25522        NULL, HFILL }},
25523
25524     {&hf_ieee80211_tag_tspec_min_allocation,
25525       {"Minimal Allocation", "wlan.dmg_tspec.min_allocation",
25526        FT_UINT16, BASE_DEC, NULL, 0,
25527        NULL, HFILL }},
25528
25529     {&hf_ieee80211_tag_tspec_max_allocation,
25530       {"Maximal Allocation", "wlan.dmg_tspec.max_allocation",
25531        FT_UINT16, BASE_DEC, NULL, 0,
25532        NULL, HFILL }},
25533
25534     {&hf_ieee80211_tag_tspec_min_duration,
25535       {"Minimal Duration", "wlan.dmg_tspec.min_duration",
25536        FT_UINT16, BASE_DEC, NULL, 0,
25537        NULL, HFILL }},
25538
25539     {&hf_ieee80211_tag_tspec_num_of_constraints,
25540       {"Number Of Constraints", "wlan.dmg_tspec.num_of_constraints",
25541        FT_UINT8, BASE_DEC, NULL, 0,
25542        NULL, HFILL }},
25543
25544     {&hf_ieee80211_tag_tspec_tsconst_start_time,
25545       {"TS Constraint Start Time", "wlan.dmg_tspec.tsconst.start_time",
25546        FT_UINT32, BASE_DEC, NULL, 0,
25547        NULL, HFILL }},
25548
25549     {&hf_ieee80211_tag_tspec_tsconst_duration,
25550       {"TS Constraint Duration", "wlan.dmg_tspec.tsconst.duration",
25551        FT_UINT16, BASE_DEC, NULL, 0,
25552        NULL, HFILL }},
25553
25554     {&hf_ieee80211_tag_tspec_tsconst_period,
25555       {"TS Constraint Period", "wlan.dmg_tspec.tsconst.period",
25556        FT_UINT16, BASE_DEC, NULL, 0,
25557        NULL, HFILL }},
25558
25559     {&hf_ieee80211_tag_tspec_tsconst_interferer_mac,
25560       {"TS Constraint Interferer MAC Address", "wlan.dmg_tspec.tsconst.interferer_mac",
25561        FT_ETHER, BASE_NONE, NULL, 0,
25562        NULL, HFILL }},
25563
25564     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_I,
25565       {"Channel Measurement Feedback Relative I", "wlan.ch_meas_fb.realtive_I",
25566        FT_UINT8, BASE_DEC, NULL, 0,
25567        NULL, HFILL }},
25568
25569     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_Q,
25570       {"Channel Measurement Feedback Relative Q", "wlan.ch_meas_fb.realtive_Q",
25571        FT_UINT8, BASE_DEC, NULL, 0,
25572        NULL, HFILL }},
25573
25574     {&hf_ieee80211_tag_channel_measurement_feedback_tap_delay,
25575       {"Channel Measurement Feedback Tap Delay", "wlan.ch_meas_fb.tap_delay",
25576        FT_UINT8, BASE_DEC, NULL, 0,
25577        NULL, HFILL }},
25578
25579     {&hf_ieee80211_tag_channel_measurement_feedback_sector_id,
25580       {"Channel Measurement Feedback Secotr ID", "wlan.ch_meas_fb.sector_id",
25581        FT_UINT8, BASE_DEC, NULL, 0xfc,
25582        NULL, HFILL }},
25583
25584     {&hf_ieee80211_tag_channel_measurement_feedback_antenna_id,
25585       {"Channel Measurement Feedback Antenna ID", "wlan.ch_meas_fb.antenna_id",
25586        FT_UINT8, BASE_DEC, NULL, 0x03,
25587        NULL, HFILL }},
25588
25589     {&hf_ieee80211_tag_awake_window,
25590       {"Awake Window", "wlan.awake_window",
25591        FT_UINT16, BASE_DEC, NULL, 0,
25592        NULL, HFILL }},
25593
25594     {&hf_ieee80211_tag_addba_ext_no_frag,
25595       {"ADDBA No Fragmentation", "wlan.addba.no_frag",
25596        FT_BOOLEAN, 8, NULL, 0x01,
25597        NULL, HFILL }},
25598
25599     {&hf_ieee80211_tag_addba_ext_he_fragmentation_operation,
25600       {"ADDBA HE Fragmentation Operation", "wlan.addba.he_frag_oper",
25601        FT_UINT8, BASE_HEX, NULL, 0x06,
25602        NULL, HFILL }},
25603
25604     {&hf_ieee80211_tag_addba_ext_reserved,
25605       {"Reserved", "wlan.addba.he_frag_oper",
25606        FT_UINT8, BASE_HEX, NULL, 0xF8,
25607        NULL, HFILL }},
25608
25609     {&hf_ieee80211_tag_multi_band_ctrl_sta_role,
25610       {"STA Rold", "wlan.multi_band.ctrl_sta_role",
25611        FT_UINT8, BASE_DEC, NULL, 0xe0,
25612        NULL, HFILL }},
25613
25614     {&hf_ieee80211_tag_multi_band_ctrl_addr_present,
25615       {"STA MAC Address Present", "wlan.multi_band.ctrl_addr_present",
25616        FT_BOOLEAN, 8, NULL, 0x10,
25617        NULL, HFILL }},
25618
25619     {&hf_ieee80211_tag_multi_band_ctrl_cipher_present,
25620       {"PCS Present", "wlan.multi_band.ctrl_cipher_present",
25621        FT_BOOLEAN, 8, NULL, 0x08,
25622        NULL, HFILL }},
25623
25624     {&hf_ieee80211_tag_multi_band_oper_class,
25625       {"Operating Class", "wlan.multi_band.oper_class",
25626        FT_UINT8, BASE_DEC, NULL, 0,
25627        NULL, HFILL }},
25628
25629     {&hf_ieee80211_tag_multi_band_channel_number,
25630       {"Channel Number", "wlan.multi_band.channel_number",
25631        FT_UINT8, BASE_DEC, NULL, 0,
25632        NULL, HFILL }},
25633
25634     {&hf_ieee80211_tag_multi_band_tsf_offset,
25635       {"TSF Offset", "wlan.multi_band.tsf_offset",
25636        FT_UINT64, BASE_DEC, NULL, 0,
25637        NULL, HFILL }},
25638
25639     {&hf_ieee80211_tag_multi_band_conn_ap,
25640       {"Connection Capability AP", "wlan.multi_band.conn_ap",
25641        FT_BOOLEAN, 8, NULL, 0x80,
25642        NULL, HFILL }},
25643
25644     {&hf_ieee80211_tag_multi_band_conn_pcp,
25645       {"Connection Capability PCP", "wlan.multi_band.conn_pcp",
25646        FT_BOOLEAN, 8, NULL, 0x40,
25647        NULL, HFILL }},
25648
25649     {&hf_ieee80211_tag_multi_band_conn_dls,
25650       {"Connection Capability DLS", "wlan.multi_band.conn_dls",
25651        FT_BOOLEAN, 8, NULL, 0x20,
25652        NULL, HFILL }},
25653
25654     {&hf_ieee80211_tag_multi_band_conn_tdls,
25655       {"Connection Capability TDLS", "wlan.multi_band.conn_tdls",
25656        FT_BOOLEAN, 8, NULL, 0x10,
25657        NULL, HFILL }},
25658
25659     {&hf_ieee80211_tag_multi_band_conn_ibss,
25660       {"Connection Capability IBSS", "wlan.multi_band.conn_ibss",
25661        FT_BOOLEAN, 8, NULL, 0x08,
25662        NULL, HFILL }},
25663
25664     {&hf_ieee80211_tag_multi_band_fst_timeout,
25665       {"FST Session Timeout", "wlan.multi_band.fst_timeout",
25666        FT_UINT8, BASE_DEC, NULL, 0,
25667        NULL, HFILL }},
25668
25669     {&hf_ieee80211_tag_multi_band_sta_mac,
25670       {"Transmitting STA MAC Address", "wlan.multi_band.sta_mac",
25671        FT_ETHER, BASE_NONE, NULL, 0,
25672        NULL, HFILL }},
25673
25674     {&hf_ieee80211_tag_activity,
25675       {"Activity", "wlan.activity",
25676        FT_UINT8, BASE_DEC, NULL, 0,
25677        NULL, HFILL }},
25678
25679     {&hf_ieee80211_tag_dmg_link_adapt_mcs,
25680       {"MCS", "wlan.dmg_link_adapt.mcs",
25681        FT_UINT8, BASE_DEC, NULL, 0,
25682        NULL, HFILL }},
25683
25684     {&hf_ieee80211_tag_dmg_link_adapt_link_margin,
25685       {"Link Margin", "wlan.dmg_link_adapt.link_margin",
25686        FT_UINT8, BASE_DEC, NULL, 0,
25687        NULL, HFILL }},
25688
25689     {&hf_ieee80211_tag_ref_timestamp,
25690       {"Reference Timestamp", "wlan.ref_timestamp",
25691        FT_UINT32, BASE_DEC, NULL, 0,
25692        NULL, HFILL }},
25693
25694     {&hf_ieee80211_tag_switching_stream_non_qos,
25695       {"Non-Qos Data Frames", "wlan.switching_stream.non_qos",
25696        FT_BOOLEAN, 8, NULL, 0,
25697        NULL, HFILL }},
25698
25699     {&hf_ieee80211_tag_switching_stream_param_num,
25700       {"Number Of Switching Stream Elements", "wlan.switching_stream.param_num",
25701        FT_UINT8, BASE_DEC, NULL, 0,
25702        NULL, HFILL }},
25703
25704     {&hf_ieee80211_tag_switching_stream_old_tid,
25705       {"Old Band TID", "wlan.switching_stream.old_tid",
25706        FT_UINT16, BASE_DEC, NULL, 0xf000,
25707        NULL, HFILL }},
25708
25709     {&hf_ieee80211_tag_switching_stream_old_direction,
25710       {"Old Band Direction", "wlan.switching_stream.old_direction",
25711        FT_BOOLEAN, 16, NULL, 0x0800,
25712        NULL, HFILL }},
25713
25714     {&hf_ieee80211_tag_switching_stream_new_tid,
25715       {"New Band TID", "wlan.switching_stream.new_tid",
25716        FT_UINT16, BASE_DEC, NULL, 0x0780,
25717        NULL, HFILL }},
25718
25719     {&hf_ieee80211_tag_switching_stream_new_direction,
25720       {"New Band Direction", "wlan.switching_stream.new_direction",
25721        FT_BOOLEAN, 16, NULL, 0x0040,
25722        NULL, HFILL }},
25723
25724     {&hf_ieee80211_tag_switching_stream_new_valid_id,
25725       {"Stream ID in New Band Valid", "wlan.switching_stream.new_valid_id",
25726        FT_BOOLEAN, 16, NULL, 0x0020,
25727        NULL, HFILL }},
25728
25729     {&hf_ieee80211_tag_switching_stream_llt_type,
25730       {"LLT Type", "wlan.switching_stream.llt_type",
25731        FT_BOOLEAN, 16, NULL, 0x0010,
25732        NULL, HFILL }},
25733
25734     {&hf_ieee80211_ff_timestamp,
25735      {"Timestamp", "wlan.fixed.timestamp",
25736       FT_UINT64, BASE_HEX, NULL, 0,
25737       NULL, HFILL }},
25738
25739     {&hf_ieee80211_ff_auth_alg,
25740      {"Authentication Algorithm", "wlan.fixed.auth.alg",
25741       FT_UINT16, BASE_DEC, VALS(auth_alg), 0,
25742       NULL, HFILL }},
25743
25744     {&hf_ieee80211_ff_beacon_interval,
25745      {"Beacon Interval", "wlan.fixed.beacon",
25746       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
25747       NULL, HFILL }},
25748
25749     {&hf_ieee80211_fixed_parameters,
25750      {"Fixed parameters", "wlan.fixed.all",
25751       FT_NONE, BASE_NONE, NULL, 0,
25752       NULL, HFILL }},
25753
25754     {&hf_ieee80211_tagged_parameters,
25755      {"Tagged parameters", "wlan.tagged.all",
25756       FT_NONE, BASE_NONE, NULL, 0,
25757       NULL, HFILL }},
25758
25759     {&hf_ieee80211_tag_ssid,
25760      {"SSID", "wlan.ssid",
25761       FT_STRING, BASE_NONE, NULL, 0,
25762       "Indicates the identity of an ESS or IBSS", HFILL }},
25763
25764     {&hf_ieee80211_tag_supp_rates,
25765      {"Supported Rates", "wlan.supported_rates",
25766       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
25767       "In Mbit/sec, (B) for Basic Rates", HFILL }},
25768
25769     {&hf_ieee80211_tag_fh_dwell_time,
25770      {"Dwell Time", "wlan.fh.dwell_time",
25771       FT_UINT16, BASE_HEX, NULL, 0x0,
25772       "In Time Unit (TU)", HFILL }},
25773
25774     {&hf_ieee80211_tag_fh_hop_set,
25775      {"Hop Set", "wlan.fh.hop_set",
25776       FT_UINT8, BASE_DEC, NULL, 0x0,
25777       NULL, HFILL }},
25778
25779     {&hf_ieee80211_tag_fh_hop_pattern,
25780      {"Hop Pattern", "wlan.fh.hop_pattern",
25781       FT_UINT8, BASE_DEC, NULL, 0x0,
25782       NULL, HFILL }},
25783
25784     {&hf_ieee80211_tag_fh_hop_index,
25785      {"Hop Index", "wlan.fh.hop_index",
25786       FT_UINT8, BASE_DEC, NULL, 0x0,
25787       NULL, HFILL }},
25788
25789     {&hf_ieee80211_ff_block_ack_params,
25790      {"Block Ack Parameters", "wlan.fixed.baparams",
25791       FT_UINT16, BASE_HEX, NULL, 0,
25792       NULL, HFILL }},
25793
25794     {&hf_ieee80211_ff_block_ack_params_amsdu_permitted,
25795      {"A-MSDUs", "wlan.fixed.baparams.amsdu",
25796       FT_BOOLEAN, 16, TFS(&ff_block_ack_params_amsdu_permitted_flag), 0x0001,
25797       "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
25798
25799     {&hf_ieee80211_ff_block_ack_params_policy,
25800      {"Block Ack Policy", "wlan.fixed.baparams.policy",
25801       FT_BOOLEAN, 16, TFS(&ff_block_ack_params_policy_flag), 0x0002,
25802       NULL, HFILL }},
25803
25804     {&hf_ieee80211_ff_block_ack_params_tid,
25805      {"Traffic Identifier", "wlan.fixed.baparams.tid",
25806       FT_UINT16, BASE_HEX, NULL, 0x003C,
25807       NULL, HFILL }},
25808
25809     {&hf_ieee80211_ff_block_ack_params_buffer_size,
25810      {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan.fixed.baparams.buffersize",
25811       FT_UINT16, BASE_DEC, NULL, 0xFFC0,
25812       "Number of Buffers", HFILL }},
25813
25814     {&hf_ieee80211_ff_block_ack_timeout,
25815      {"Block Ack Timeout", "wlan.fixed.batimeout",
25816       FT_UINT16, BASE_HEX, NULL, 0,
25817       NULL, HFILL }},
25818
25819     {&hf_ieee80211_ff_block_ack_ssc,
25820      {"Block Ack Starting Sequence Control (SSC)", "wlan.fixed.ssc",
25821       FT_UINT16, BASE_HEX, 0, 0,
25822       NULL, HFILL }},
25823
25824     {&hf_ieee80211_ff_block_ack_ssc_fragment,
25825      {"Fragment", "wlan.fixed.ssc.fragment",
25826       FT_UINT16, BASE_DEC, 0, 0x000f,
25827       NULL, HFILL }},
25828
25829     {&hf_ieee80211_ff_block_ack_ssc_sequence,
25830      {"Starting Sequence Number", "wlan.fixed.ssc.sequence",
25831       FT_UINT16, BASE_DEC, 0, 0xfff0,
25832       NULL, HFILL }},
25833
25834     {&hf_ieee80211_ff_delba_param,
25835      {"Delete Block Ack (DELBA) Parameter Set", "wlan.fixed.delba.param",
25836       FT_UINT16, BASE_HEX, 0, 0,
25837       NULL, HFILL }},
25838
25839     {&hf_ieee80211_ff_delba_param_reserved,
25840      {"Reserved", "wlan.fixed.delba.param.reserved",
25841       FT_UINT16, BASE_HEX, 0, 0x07ff,
25842       NULL, HFILL }},
25843
25844     {&hf_ieee80211_ff_delba_param_init,
25845      {"Initiator", "wlan.fixed.delba.param.initiator",
25846       FT_BOOLEAN, 16, 0, 0x0800,
25847       NULL, HFILL }},
25848
25849     {&hf_ieee80211_ff_delba_param_tid,
25850      {"TID", "wlan.fixed.delba.param.tid",
25851       FT_UINT16, BASE_HEX, 0, 0xf000,
25852       "Traffic Identifier (TID)", HFILL }},
25853
25854     {&hf_ieee80211_ff_max_reg_pwr,
25855      {"Maximum Regulation Power", "wlan.fixed.maxregpwr",
25856       FT_UINT16, BASE_HEX, 0, 0,
25857       NULL, HFILL }},
25858
25859     {&hf_ieee80211_ff_measurement_pilot_int,
25860      {"Measurement Pilot Interval", "wlan.fixed.msmtpilotint",
25861       FT_UINT8, BASE_HEX, 0, 0,
25862       "Measurement Pilot Interval Fixed Field", HFILL }},
25863
25864     {&hf_ieee80211_ff_country_str,
25865      {"Country String", "wlan.fixed.country",
25866       FT_STRING, BASE_NONE, 0, 0,
25867       NULL, HFILL }},
25868
25869     {&hf_ieee80211_ff_max_tx_pwr,
25870      {"Maximum Transmit Power", "wlan.fixed.maxtxpwr",
25871       FT_UINT8, BASE_HEX, 0, 0,
25872       NULL, HFILL }},
25873
25874     {&hf_ieee80211_ff_tx_pwr_used,
25875      {"Transmit Power Used", "wlan.fixed.txpwr",
25876       FT_UINT8, BASE_HEX, 0, 0,
25877       NULL, HFILL }},
25878
25879     {&hf_ieee80211_ff_transceiver_noise_floor,
25880      {"Transceiver Noise Floor", "wlan.fixed.tnoisefloor",
25881       FT_UINT8, BASE_HEX, 0, 0,
25882       NULL, HFILL }},
25883
25884     {&hf_ieee80211_ff_channel_width,
25885      {"Supported Channel Width", "wlan.fixed.chanwidth",
25886       FT_UINT8, BASE_HEX, VALS(ff_channel_width_vals), 0,
25887       NULL, HFILL }},
25888
25889     {&hf_ieee80211_ff_qos_info_ap,
25890      {"QoS Information (AP)", "wlan.fixed.qosinfo.ap",
25891       FT_UINT8, BASE_HEX, NULL, 0,
25892       NULL, HFILL }},
25893
25894     {&hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
25895      {"EDCA Parameter Set Update Count", "wlan.fixed.qosinfo.ap.edcaupdate",
25896       FT_UINT8, BASE_HEX, NULL, 0x0F,
25897       "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
25898
25899     {&hf_ieee80211_ff_qos_info_ap_q_ack,
25900      {"Q-Ack", "wlan.fixed.qosinfo.ap.qack",
25901       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_q_ack_flag), 0x10,
25902       "QoS Ack", HFILL }},
25903
25904     {&hf_ieee80211_ff_qos_info_ap_queue_req,
25905      {"Queue Request", "wlan.fixed.qosinfo.ap.queue_req",
25906       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_queue_req_flag), 0x20,
25907       NULL, HFILL }},
25908
25909     {&hf_ieee80211_ff_qos_info_ap_txop_request,
25910      {"TXOP Request", "wlan.fixed.qosinfo.ap.txopreq",
25911       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_txop_request_flag), 0x40,
25912       "Transmit Opportunity (TXOP) Request", HFILL }},
25913
25914     {&hf_ieee80211_ff_qos_info_ap_reserved,
25915      {"Reserved", "wlan.fixed.qosinfo.ap.reserved",
25916       FT_BOOLEAN, 8, NULL, 0x80,
25917       NULL, HFILL }},
25918
25919     {&hf_ieee80211_ff_qos_info_sta,
25920      {"QoS Information (STA)", "wlan.fixed.qosinfo.sta",
25921       FT_UINT8, BASE_HEX, NULL, 0,
25922       "TCLAS Processing", HFILL }},
25923
25924     {&hf_ieee80211_ff_qos_info_sta_ac_vo,
25925      {"AC_VO U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_vo",
25926       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x01,
25927       NULL, HFILL }},
25928
25929     {&hf_ieee80211_ff_qos_info_sta_ac_vi,
25930      {"AC_VI U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_vi",
25931       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x02,
25932       NULL, HFILL }},
25933
25934     {&hf_ieee80211_ff_qos_info_sta_ac_bk,
25935      {"AC_BK U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_bk",
25936       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x04,
25937       NULL, HFILL }},
25938
25939     {&hf_ieee80211_ff_qos_info_sta_ac_be,
25940      {"AC_BE U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_be",
25941       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x08,
25942       NULL, HFILL }},
25943
25944     {&hf_ieee80211_ff_qos_info_sta_q_ack,
25945      {"Q-Ack", "wlan.fixed.qosinfo.sta.qack",
25946       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_q_ack_flag), 0x10,
25947       "QoS Ack", HFILL }},
25948
25949     {&hf_ieee80211_ff_qos_info_sta_max_sp_length,
25950      {"Max SP Length", "wlan.fixed.qosinfo.sta.max_sp_length",
25951       FT_UINT8, BASE_HEX, VALS(ff_qos_info_sta_max_sp_len_flags) , 0x60,
25952       NULL, HFILL }},
25953
25954     {&hf_ieee80211_ff_qos_info_sta_more_data_ack,
25955      {"More Data Ack", "wlan.fixed.qosinfo.sta.more_data_ack",
25956       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_more_data_ack_flag), 0x80,
25957       NULL, HFILL }},
25958
25959     {&hf_ieee80211_ff_sm_pwr_save,
25960      {"Spatial Multiplexing (SM) Power Control", "wlan.fixed.sm.powercontrol",
25961       FT_UINT8, BASE_HEX, NULL, 0,
25962       NULL, HFILL }},
25963
25964     {&hf_ieee80211_ff_sm_pwr_save_enabled,
25965      {"SM Power Save", "wlan.fixed.sm.powercontrol.enabled",
25966       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
25967       "Spatial Multiplexing (SM) Power Save", HFILL }},
25968
25969     {&hf_ieee80211_ff_sm_pwr_save_sm_mode,
25970      {"SM Mode", "wlan.fixed.sm.powercontrol.mode",
25971       FT_BOOLEAN, 8, TFS(&ff_sm_pwr_save_sm_mode_flag), 0x02,
25972       "Spatial Multiplexing (SM) Mode", HFILL }},
25973
25974     {&hf_ieee80211_ff_sm_pwr_save_reserved,
25975      {"Reserved", "wlan.fixed.sm.powercontrol.reserved",
25976       FT_UINT8, BASE_HEX, NULL, 0xFC,
25977       NULL, HFILL }},
25978
25979     {&hf_ieee80211_ff_pco_phase_cntrl,
25980      {"Phased Coexistence Operation (PCO) Phase Control", "wlan.fixed.pco.phasecntrl",
25981       FT_BOOLEAN, BASE_NONE, TFS(&ff_pco_phase_cntrl_flag), 0x0,
25982       NULL, HFILL }},
25983
25984     {&hf_ieee80211_ff_psmp_param_set,
25985      {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan.fixed.psmp.paramset",
25986       FT_UINT16, BASE_HEX, 0, 0,
25987       NULL, HFILL }},
25988
25989     {&hf_ieee80211_ff_psmp_param_set_n_sta,
25990      {"Number of STA Info Fields Present", "wlan.fixed.psmp.paramset.nsta",
25991       FT_UINT16, BASE_HEX, 0, 0x000F,
25992       NULL, HFILL }},
25993
25994     {&hf_ieee80211_ff_psmp_param_set_more_psmp,
25995      {"More PSMP", "wlan.fixed.psmp.paramset.more",
25996       FT_BOOLEAN, 16, TFS(&ff_psmp_param_set_more_psmp_flag), 0x0010,
25997       "More Power Save Multi-Poll (PSMP)", HFILL }},
25998
25999     {&hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
26000      {"PSMP Sequence Duration [us]", "wlan.fixed.psmp.paramset.seqduration",
26001       FT_UINT16, BASE_DEC, 0, 0xFFE0,
26002       "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
26003
26004     {&hf_ieee80211_ff_mimo_cntrl,
26005      {"MIMO Control", "wlan.fixed.mimo.control",
26006       FT_BYTES, BASE_NONE, 0, 0x0,
26007       NULL, HFILL }},
26008
26009     {&hf_ieee80211_ff_mimo_cntrl_nc_index,
26010      {"Nc Index", "wlan.fixed.mimo.control.ncindex",
26011       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nc_index_flags), 0x0003,
26012       "Number of Columns Less One", HFILL }},
26013
26014     {&hf_ieee80211_ff_mimo_cntrl_nr_index,
26015      {"Nr Index", "wlan.fixed.mimo.control.nrindex",
26016       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nr_index_flags), 0x000C,
26017       "Number of Rows Less One", HFILL }},
26018
26019     {&hf_ieee80211_ff_mimo_cntrl_channel_width,
26020      {"Channel Width", "wlan.fixed.mimo.control.chanwidth",
26021       FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010,
26022       NULL, HFILL }},
26023
26024     {&hf_ieee80211_ff_mimo_cntrl_grouping,
26025      {"Grouping (Ng)", "wlan.fixed.mimo.control.grouping",
26026       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_grouping_flags), 0x0060,
26027       NULL, HFILL }},
26028
26029     {&hf_ieee80211_ff_mimo_cntrl_coefficient_size,
26030      {"Coefficient Size (Nb)", "wlan.fixed.mimo.control.cosize",
26031       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_coefficient_size_flags), 0x0180,
26032       NULL, HFILL }},
26033
26034     {&hf_ieee80211_ff_mimo_cntrl_codebook_info,
26035      {"Codebook Information", "wlan.fixed.mimo.control.codebookinfo",
26036       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_codebook_info_flags), 0x0600,
26037       NULL, HFILL }},
26038
26039     {&hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
26040      {"Remaining Matrix Segment", "wlan.fixed.mimo.control.matrixseg",
26041       FT_UINT16, BASE_HEX, 0, 0x3800,
26042       NULL, HFILL }},
26043
26044     {&hf_ieee80211_ff_mimo_cntrl_reserved,
26045      {"Reserved", "wlan.fixed.mimo.control.reserved",
26046       FT_UINT16, BASE_HEX, 0, 0xC000,
26047       NULL, HFILL }},
26048
26049     {&hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
26050      {"Sounding Timestamp", "wlan.fixed.mimo.control.soundingtime",
26051       FT_UINT32, BASE_HEX, 0, 0,
26052       NULL, HFILL }},
26053
26054     {&hf_ieee80211_ff_psmp_sta_info,
26055      {"Power Save Multi-Poll (PSMP) Station Information", "wlan.fixed.psmp.stainfo",
26056       FT_UINT64, BASE_HEX, 0, 0,
26057       NULL, HFILL }},
26058
26059     {&hf_ieee80211_ff_psmp_sta_info_type,
26060      {"Sta Info Type", "wlan.fixed.psmp.stainfo.type",
26061       FT_UINT32, BASE_HEX, VALS(ff_psmp_sta_info_flags), PSMP_STA_INFO_FLAG_TYPE,
26062       NULL, HFILL }},
26063
26064     {&hf_ieee80211_ff_psmp_sta_info_dtt_start_offset,
26065      {"DTT Start Offset", "wlan.fixed.psmp.stainfo.dttstart",
26066       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_START,
26067       NULL, HFILL }},
26068
26069     {&hf_ieee80211_ff_psmp_sta_info_dtt_duration,
26070      {"DTT Duration", "wlan.fixed.psmp.stainfo.dttduration",
26071       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_DURATION,
26072       NULL, HFILL }},
26073
26074     {&hf_ieee80211_ff_psmp_sta_info_sta_id,
26075      {"Target Station ID", "wlan.fixed.psmp.stainfo.staid",
26076       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_STA_ID,
26077       NULL, HFILL }},
26078
26079     {&hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
26080      {"UTT Start Offset", "wlan.fixed.psmp.stainfo.uttstart",
26081       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_START,
26082       NULL, HFILL }},
26083
26084     {&hf_ieee80211_ff_psmp_sta_info_utt_duration,
26085      {"UTT Duration", "wlan.fixed.psmp.stainfo.uttduration",
26086       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_DURATION,
26087       NULL, HFILL }},
26088
26089     {&hf_ieee80211_ff_psmp_sta_info_reserved_small,
26090      {"Reserved", "wlan.fixed.psmp.stainfo.reserved",
26091       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_IA_RESERVED,
26092       NULL, HFILL }},
26093
26094     {&hf_ieee80211_ff_psmp_sta_info_reserved_large,
26095      {"Reserved", "wlan.fixed.psmp.stainfo.reserved64",
26096       FT_UINT64, BASE_HEX, 0, 0,
26097       NULL, HFILL }},
26098
26099     {&hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
26100      {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan.fixed.psmp.stainfo.multicastid",
26101       FT_UINT64, BASE_HEX, 0, 0,
26102       NULL, HFILL }},
26103
26104     {&hf_ieee80211_ff_ant_selection,
26105      {"Antenna Selection", "wlan.fixed.antsel",
26106       FT_UINT8, BASE_HEX, 0, 0,
26107       NULL, HFILL }},
26108
26109     {&hf_ieee80211_ff_ant_selection_0,
26110      {"Antenna 0", "wlan.fixed.antsel.ant0",
26111       FT_UINT8, BASE_HEX, 0, 0x01,
26112       NULL, HFILL }},
26113
26114     {&hf_ieee80211_ff_ant_selection_1,
26115      {"Antenna 1", "wlan.fixed.antsel.ant1",
26116       FT_UINT8, BASE_HEX, 0, 0x02,
26117       NULL, HFILL }},
26118
26119     {&hf_ieee80211_ff_ant_selection_2,
26120      {"Antenna 2", "wlan.fixed.antsel.ant2",
26121       FT_UINT8, BASE_HEX, 0, 0x04,
26122       NULL, HFILL }},
26123
26124     {&hf_ieee80211_ff_ant_selection_3,
26125      {"Antenna 3", "wlan.fixed.antsel.ant3",
26126       FT_UINT8, BASE_HEX, 0, 0x08,
26127       NULL, HFILL }},
26128
26129     {&hf_ieee80211_ff_ant_selection_4,
26130      {"Antenna 4", "wlan.fixed.antsel.ant4",
26131       FT_UINT8, BASE_HEX, 0, 0x10,
26132       NULL, HFILL }},
26133
26134     {&hf_ieee80211_ff_ant_selection_5,
26135      {"Antenna 5", "wlan.fixed.antsel.ant5",
26136       FT_UINT8, BASE_HEX, 0, 0x20,
26137       NULL, HFILL }},
26138
26139     {&hf_ieee80211_ff_ant_selection_6,
26140      {"Antenna 6", "wlan.fixed.antsel.ant6",
26141       FT_UINT8, BASE_HEX, 0, 0x40,
26142       NULL, HFILL }},
26143
26144     {&hf_ieee80211_ff_ant_selection_7,
26145      {"Antenna 7", "wlan.fixed.antsel.ant7",
26146       FT_UINT8, BASE_HEX, 0, 0x80,
26147       NULL, HFILL }},
26148
26149     {&hf_ieee80211_ff_ext_channel_switch_announcement,
26150      {"Extended Channel Switch Announcement", "wlan.fixed.extchansw",
26151       FT_UINT32, BASE_HEX, 0, 0,
26152       NULL, HFILL }},
26153
26154     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
26155      {"Channel Switch Mode", "wlan.fixed.extchansw.switchmode",
26156       FT_UINT32, BASE_HEX, VALS(ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags), 0x000000FF,
26157       NULL, HFILL }},
26158
26159     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
26160      {"New Operating Class", "wlan.fixed.extchansw.new.opeclass",
26161       FT_UINT32, BASE_HEX, NULL, 0x0000FF00,
26162       NULL, HFILL }},
26163
26164     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
26165      {"New Channel Number", "wlan.fixed.extchansw.new.channumber",
26166       FT_UINT32, BASE_HEX, NULL, 0x00FF0000,
26167       NULL, HFILL }},
26168
26169     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
26170      {"Channel Switch Count", "wlan.extchanswitch.switchcount",
26171       FT_UINT32, BASE_HEX, NULL, 0xFF000000,
26172       NULL, HFILL }},
26173
26174     {&hf_ieee80211_ff_ht_info,
26175      {"HT Information", "wlan.fixed.extchansw",
26176       FT_UINT8, BASE_HEX, 0, 0,
26177       "HT Information Fixed Field", HFILL }},
26178
26179     {&hf_ieee80211_ff_ht_info_information_request,
26180      {"Information Request", "wlan.fixed.mimo.control.chanwidth",
26181       FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01,
26182       NULL, HFILL }},
26183
26184     {&hf_ieee80211_ff_ht_info_40_mhz_intolerant,
26185      {"40 MHz Intolerant", "wlan.fixed.mimo.control.chanwidth",
26186       FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02,
26187       NULL, HFILL }},
26188
26189     {&hf_ieee80211_ff_ht_info_sta_chan_width,
26190      {"Station Channel Width", "wlan.fixed.mimo.control.chanwidth",
26191       FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04,
26192       NULL, HFILL }},
26193
26194     {&hf_ieee80211_ff_ht_info_reserved,
26195      {"Reserved", "wlan.fixed.extchansw",
26196       FT_UINT8, BASE_HEX, 0, 0xF8,
26197       "Reserved Field", HFILL }},
26198
26199     {&hf_ieee80211_ff_ht_action,
26200      {"HT Action", "wlan.fixed.htact",
26201       FT_UINT8, BASE_HEX, VALS(ff_ht_action_flags), 0,
26202       "HT Action Code", HFILL }},
26203
26204     {&hf_ieee80211_ff_mimo_csi_snr,
26205      {"Signal to Noise Ratio (SNR)", "wlan.mimo.csimatrices.snr",
26206       FT_UINT8, BASE_HEX, NULL, 0,
26207       NULL, HFILL }},
26208
26209     {&hf_ieee80211_ff_mimo_csi_matrices,
26210      {"CSI Matrices", "wlan.mimo.csimatrices",
26211       FT_NONE, BASE_NONE, NULL, 0,
26212       NULL, HFILL }},
26213
26214     {&hf_ieee80211_ff_mimo_csi_bf_matrices,
26215      {"Beamforming Feedback Matrices", "wlan.mimo.csimatrices.bf",
26216       FT_NONE, BASE_NONE, NULL, 0,
26217       NULL, HFILL }},
26218
26219     {&hf_ieee80211_ff_mimo_csi_cbf_matrices,
26220      {"Compressed Beamforming Feedback Matrices", "wlan.mimo.csimatrices.cbf",
26221       FT_NONE, BASE_NONE, NULL, 0,
26222       NULL, HFILL }},
26223     {&hf_ieee80211_ff_public_action,
26224      {"Public Action", "wlan.fixed.publicact",
26225       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_pa_action_codes_ext, 0,
26226       "Public Action Code", HFILL }},
26227
26228     {&hf_ieee80211_ff_protected_public_action,
26229      {"Protected Public Action", "wlan.fixed.publicact",
26230       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_ppa_action_codes_ext, 0,
26231       "Protected Public Action Code", HFILL }},
26232
26233     {&hf_ieee80211_ff_capture,
26234      {"Capabilities Information", "wlan.fixed.capabilities",
26235       FT_UINT16, BASE_HEX, NULL, 0,
26236       "Capability information", HFILL }},
26237
26238     {&hf_ieee80211_ff_cf_ess,
26239      {"ESS capabilities", "wlan.fixed.capabilities.ess",
26240       FT_BOOLEAN, 16, TFS(&cf_ess_flags), 0x0001,
26241       NULL, HFILL }},
26242
26243     {&hf_ieee80211_ff_cf_ibss,
26244      {"IBSS status", "wlan.fixed.capabilities.ibss",
26245       FT_BOOLEAN, 16, TFS(&cf_ibss_flags), 0x0002,
26246       "IBSS participation", HFILL }},
26247
26248     {&hf_ieee80211_ff_cf_sta_poll,
26249      {"CFP participation capabilities", "wlan.fixed.capabilities.cfpoll.sta",
26250       FT_UINT16, BASE_HEX, VALS(sta_cf_pollable), 0x020C,
26251       "CF-Poll capabilities for a STA", HFILL }},
26252
26253     {&hf_ieee80211_ff_cf_ap_poll,
26254      {"CFP participation capabilities", "wlan.fixed.capabilities.cfpoll.ap",
26255       FT_UINT16, BASE_HEX, VALS(ap_cf_pollable), 0x020C,
26256       "CF-Poll capabilities for an AP", HFILL }},
26257
26258     {&hf_ieee80211_ff_cf_privacy,
26259      {"Privacy", "wlan.fixed.capabilities.privacy",
26260       FT_BOOLEAN, 16, TFS(&cf_privacy_flags), 0x0010,
26261       "WEP support", HFILL }},
26262
26263     {&hf_ieee80211_ff_cf_preamble,
26264      {"Short Preamble", "wlan.fixed.capabilities.preamble",
26265       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0020,
26266       NULL, HFILL }},
26267
26268     {&hf_ieee80211_ff_cf_pbcc,
26269      {"PBCC", "wlan.fixed.capabilities.pbcc",
26270       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0040,
26271       "PBCC Modulation", HFILL }},
26272
26273     {&hf_ieee80211_ff_cf_agility,
26274      {"Channel Agility", "wlan.fixed.capabilities.agility",
26275       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0080,
26276       NULL, HFILL }},
26277
26278     {&hf_ieee80211_ff_cf_spec_man,
26279      {"Spectrum Management", "wlan.fixed.capabilities.spec_man",
26280       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0100,
26281       NULL, HFILL }},
26282
26283     {&hf_ieee80211_ff_short_slot_time,
26284      {"Short Slot Time", "wlan.fixed.capabilities.short_slot_time",
26285       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0400,
26286       NULL, HFILL }},
26287
26288     {&hf_ieee80211_ff_cf_apsd,
26289      {"Automatic Power Save Delivery", "wlan.fixed.capabilities.apsd",
26290       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0800,
26291       NULL, HFILL }},
26292
26293     {&hf_ieee80211_ff_radio_measurement,
26294      {"Radio Measurement", "wlan.fixed.capabilities.radio_measurement",
26295       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x1000,
26296       NULL, HFILL }},
26297
26298     {&hf_ieee80211_ff_dsss_ofdm,
26299      {"DSSS-OFDM", "wlan.fixed.capabilities.dsss_ofdm",
26300       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x2000,
26301       "DSSS-OFDM Modulation", HFILL }},
26302
26303     {&hf_ieee80211_ff_cf_del_blk_ack,
26304      {"Delayed Block Ack", "wlan.fixed.capabilities.del_blk_ack",
26305       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x4000,
26306       NULL, HFILL }},
26307
26308     {&hf_ieee80211_ff_cf_imm_blk_ack,
26309      {"Immediate Block Ack", "wlan.fixed.capabilities.imm_blk_ack",
26310       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x8000,
26311       NULL, HFILL }},
26312
26313     {&hf_ieee80211_ff_auth_seq,
26314      {"Authentication SEQ", "wlan.fixed.auth_seq",
26315       FT_UINT16, BASE_HEX, NULL, 0,
26316       "Authentication Sequence Number", HFILL }},
26317
26318     {&hf_ieee80211_ff_assoc_id,
26319      {"Association ID", "wlan.fixed.aid",
26320       FT_UINT16, BASE_HEX, NULL, 0x3FFF,
26321       NULL, HFILL }},
26322
26323     {&hf_ieee80211_ff_listen_ival,
26324      {"Listen Interval", "wlan.fixed.listen_ival",
26325       FT_UINT16, BASE_HEX, NULL, 0,
26326       NULL, HFILL }},
26327
26328     {&hf_ieee80211_ff_current_ap,
26329      {"Current AP", "wlan.fixed.current_ap",
26330       FT_ETHER, BASE_NONE, NULL, 0,
26331       "MAC address of current AP", HFILL }},
26332
26333     {&hf_ieee80211_ff_reason,
26334      {"Reason code", "wlan.fixed.reason_code",
26335       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
26336       "Reason for unsolicited notification", HFILL }},
26337
26338     {&hf_ieee80211_ff_status_code,
26339      {"Status code", "wlan.fixed.status_code",
26340       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
26341       "Status of requested event", HFILL }},
26342
26343     {&hf_ieee80211_ff_category_code,
26344      {"Category code", "wlan.fixed.category_code",
26345       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &category_codes_ext, 0,
26346       "Management action category", HFILL }},
26347
26348     {&hf_ieee80211_ff_action_code,
26349      {"Action code", "wlan.fixed.action_code",
26350       FT_UINT16, BASE_DEC, VALS(action_codes), 0,
26351       "Management action code", HFILL }},
26352
26353     {&hf_ieee80211_ff_dialog_token,
26354      {"Dialog token", "wlan.fixed.dialog_token",
26355       FT_UINT8, BASE_HEX, NULL, 0,
26356       "Management action dialog token", HFILL }},
26357
26358     {&hf_ieee80211_ff_followup_dialog_token,
26359      {"Followup Dialog token", "wlan.fixed.followup_dialog_token",
26360       FT_UINT8, BASE_HEX, NULL, 0,
26361       "Management action followup dialog token", HFILL }},
26362
26363     {&hf_ieee80211_ff_marvell_action_type,
26364      {"Marvell Action type", "wlan.fixed.mrvl_action_type",
26365       FT_UINT8, BASE_DEC, VALS(vendor_action_types_mrvl), 0,
26366       "Vendor Specific Action Type (Marvell)", HFILL }},
26367
26368     {&hf_ieee80211_ff_marvell_mesh_mgt_action_code,
26369      {"Mesh action(Marvell)", "wlan.fixed.mrvl_mesh_action",
26370       FT_UINT8, BASE_HEX, VALS(mesh_mgt_action_codes_mrvl), 0,
26371       "Mesh action code(Marvell)", HFILL }},
26372
26373     {&hf_ieee80211_ff_marvell_mesh_mgt_length,
26374      {"Message Length", "wlan.fixed.length",
26375       FT_UINT8, BASE_DEC, NULL, 0,
26376       NULL, HFILL }},
26377
26378     {&hf_ieee80211_ff_marvell_mesh_mgt_mode,
26379      {"Message Mode", "wlan.fixed.mode",
26380       FT_UINT8, BASE_HEX, NULL, 0,
26381       NULL, HFILL }},
26382
26383     {&hf_ieee80211_ff_marvell_mesh_mgt_ttl,
26384      {"Message TTL", "wlan.fixed.ttl",
26385       FT_UINT8, BASE_DEC, NULL, 0,
26386       NULL, HFILL }},
26387
26388     {&hf_ieee80211_ff_marvell_mesh_mgt_dstcount,
26389      {"Destination Count", "wlan.fixed.dstcount",
26390       FT_UINT8, BASE_DEC, NULL, 0,
26391       NULL, HFILL }},
26392
26393     {&hf_ieee80211_ff_marvell_mesh_mgt_hopcount,
26394      {"Hop Count", "wlan.fixed.hopcount",
26395       FT_UINT8, BASE_DEC, NULL, 0,
26396       NULL, HFILL }},
26397
26398     {&hf_ieee80211_ff_marvell_mesh_mgt_rreqid,
26399      {"RREQ ID", "wlan.fixed.rreqid",
26400       FT_UINT32, BASE_DEC, NULL, 0,
26401       NULL, HFILL }},
26402
26403     {&hf_ieee80211_ff_marvell_mesh_mgt_sa,
26404      {"Source Address", "wlan.fixed.sa",
26405       FT_ETHER, BASE_NONE, NULL, 0,
26406       "Source MAC address", HFILL }},
26407
26408     {&hf_ieee80211_ff_marvell_mesh_mgt_ssn,
26409      {"SSN", "wlan.fixed.ssn",
26410       FT_UINT32, BASE_DEC, NULL, 0,
26411       "Source Sequence Number", HFILL }},
26412
26413     {&hf_ieee80211_ff_marvell_mesh_mgt_metric,
26414      {"Metric", "wlan.fixed.metric",
26415       FT_UINT32, BASE_DEC, NULL, 0,
26416       "Route Metric", HFILL }},
26417
26418     {&hf_ieee80211_ff_marvell_mesh_mgt_flags,
26419      {"RREQ Flags", "wlan.fixed.hopcount",
26420       FT_UINT8, BASE_HEX, NULL, 0,
26421       NULL, HFILL }},
26422
26423     {&hf_ieee80211_ff_marvell_mesh_mgt_da,
26424      {"Destination Address", "wlan.fixed.da",
26425       FT_ETHER, BASE_NONE, NULL, 0,
26426       "Destination MAC address", HFILL }},
26427
26428     {&hf_ieee80211_ff_marvell_mesh_mgt_dsn,
26429      {"DSN", "wlan.fixed.dsn",
26430       FT_UINT32, BASE_DEC, NULL, 0,
26431       "Destination Sequence Number", HFILL }},
26432
26433     {&hf_ieee80211_ff_marvell_mesh_mgt_lifetime,
26434      {"Lifetime", "wlan.fixed.lifetime",
26435       FT_UINT32, BASE_DEC, NULL, 0,
26436       "Route Lifetime", HFILL }},
26437
26438     {&hf_ieee80211_ff_wme_action_code,
26439      {"Action code", "wlan.fixed.action_code",
26440       FT_UINT16, BASE_HEX, VALS(wme_action_codes), 0,
26441       "Management notification action code", HFILL }},
26442
26443     {&hf_ieee80211_ff_wme_status_code,
26444      {"Status code", "wlan.fixed.status_code",
26445       FT_UINT16, BASE_HEX, VALS(wme_status_codes), 0,
26446       "Management notification setup response status code", HFILL }},
26447
26448     {&hf_ieee80211_ff_mesh_action,
26449      {"Mesh Action code", "wlan.fixed.mesh_action",
26450       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &mesh_action_ext, 0,
26451       NULL, HFILL }},
26452
26453     {&hf_ieee80211_ff_multihop_action,
26454      {"Multihop Action code", "wlan.fixed.multihop_action",
26455       FT_UINT8, BASE_HEX, VALS(multihop_action), 0,
26456       NULL, HFILL }},
26457
26458     {&hf_ieee80211_ff_mesh_flags,
26459      {"Mesh Flags", "wlan.fixed.mesh_flags",
26460       FT_UINT8, BASE_HEX, NULL, 0,
26461       NULL, HFILL }},
26462
26463     {&hf_ieee80211_ff_mesh_ttl,
26464      {"Mesh TTL", "wlan.fixed.mesh_ttl",
26465       FT_UINT8, BASE_HEX, NULL, 0,
26466       NULL, HFILL }},
26467
26468     {&hf_ieee80211_ff_mesh_sequence,
26469      {"Sequence Number", "wlan.fixed.mesh_sequence",
26470       FT_UINT32, BASE_HEX, NULL, 0,
26471       NULL, HFILL }},
26472
26473     {&hf_ieee80211_ff_mesh_addr4,
26474      {"Mesh Extended Address 4", "wlan.fixed.mesh_addr4",
26475       FT_ETHER, BASE_NONE, NULL, 0,
26476       NULL, HFILL }},
26477
26478     {&hf_ieee80211_ff_mesh_addr5,
26479      {"Mesh Extended Address 5", "wlan.fixed.mesh_addr5",
26480       FT_ETHER, BASE_NONE, NULL, 0,
26481       NULL, HFILL }},
26482
26483     {&hf_ieee80211_ff_mesh_addr6,
26484      {"Mesh Extended Address 6", "wlan.fixed.mesh_addr6",
26485       FT_ETHER, BASE_NONE, NULL, 0,
26486       NULL, HFILL }},
26487
26488     {&hf_ieee80211_ff_selfprot_action,
26489      {"Self-protected Action code", "wlan.fixed.selfprot_action",
26490       FT_UINT8, BASE_HEX, VALS(selfprot_action), 0,
26491       NULL, HFILL }},
26492
26493     {&hf_ieee80211_mesh_peering_proto,
26494      {"Mesh Peering Protocol ID", "wlan.peering.proto",
26495       FT_UINT16, BASE_HEX, VALS(mesh_peering_proto_ids), 0,
26496       NULL, HFILL }},
26497
26498     {&hf_ieee80211_mesh_peering_local_link_id,
26499      {"Local Link ID", "wlan.peering.local_id",
26500       FT_UINT16, BASE_HEX, NULL, 0,
26501       "Mesh Peering Management Local Link ID", HFILL }},
26502
26503     {&hf_ieee80211_mesh_peering_peer_link_id,
26504      {"Peer Link ID", "wlan.peering.peer_id",
26505       FT_UINT16, BASE_HEX, NULL, 0,
26506       "Mesh Peering Management Peer Link ID", HFILL }},
26507
26508     {&hf_ieee80211_ff_hwmp_flags,
26509      {"HWMP Flags", "wlan.hwmp.flags",
26510       FT_UINT8, BASE_HEX, NULL, 0,
26511       NULL, HFILL }},
26512
26513     {&hf_ieee80211_ff_hwmp_hopcount,
26514      {"HWMP Hop Count", "wlan.hwmp.hopcount",
26515       FT_UINT8, BASE_DEC, NULL, 0,
26516       NULL, HFILL }},
26517
26518     {&hf_ieee80211_ff_hwmp_ttl,
26519      {"HWMP TTL", "wlan.hwmp.ttl",
26520       FT_UINT8, BASE_DEC, NULL, 0,
26521       NULL, HFILL }},
26522
26523     {&hf_ieee80211_ff_hwmp_pdid,
26524      {"HWMP Path Discovery ID", "wlan.hwmp.pdid",
26525       FT_UINT32, BASE_DEC, NULL, 0,
26526       NULL, HFILL }},
26527
26528     {&hf_ieee80211_ff_hwmp_orig_sta,
26529      {"Originator STA Address", "wlan.hwmp.orig_sta",
26530       FT_ETHER, BASE_NONE, NULL, 0,
26531       NULL, HFILL }},
26532
26533     {&hf_ieee80211_ff_hwmp_orig_sn,
26534      {"HWMP Originator Sequence Number", "wlan.hwmp.orig_sn",
26535       FT_UINT32, BASE_DEC, NULL, 0,
26536       NULL, HFILL}},
26537
26538     {&hf_ieee80211_ff_hwmp_orig_ext,
26539      {"Originator External Address", "wlan.hwmp.orig_ext",
26540       FT_ETHER, BASE_NONE, NULL, 0,
26541       NULL, HFILL }},
26542
26543     {&hf_ieee80211_ff_hwmp_lifetime,
26544      {"HWMP Lifetime", "wlan.hwmp.lifetime",
26545       FT_UINT32, BASE_DEC, NULL, 0,
26546       NULL, HFILL }},
26547
26548     {&hf_ieee80211_ff_hwmp_metric,
26549      {"HWMP Metric", "wlan.hwmp.metric",
26550       FT_UINT32, BASE_DEC, NULL, 0,
26551       NULL, HFILL }},
26552
26553     {&hf_ieee80211_ff_hwmp_targ_count,
26554      {"HWMP Target Count", "wlan.hwmp.targ_count",
26555       FT_UINT8, BASE_DEC, NULL, 0,
26556       NULL, HFILL }},
26557
26558     {&hf_ieee80211_ff_hwmp_targ_flags,
26559      {"HWMP Per-Target Flags", "wlan.hwmp.targ_flags",
26560       FT_UINT8, BASE_HEX, NULL, 0,
26561       NULL, HFILL }},
26562
26563     {&hf_ieee80211_ff_hwmp_targ_to_flags,
26564      {"TO Flag", "wlan.hwmp.to_flag",
26565       FT_BOOLEAN, 8, TFS(&hwmp_targ_to_flags), 0x01,
26566       "Target Only Flag", HFILL }},
26567
26568     {&hf_ieee80211_ff_hwmp_targ_usn_flags,
26569      {"USN Flag", "wlan.hwmp.usn_flag",
26570       FT_BOOLEAN, 8, TFS(&hwmp_targ_usn_flags), 0x04,
26571       "Unknown Target HWMP Sequence Number Flag", HFILL }},
26572
26573     {&hf_ieee80211_ff_hwmp_targ_sta,
26574      {"Target STA Address", "wlan.hwmp.targ_sta",
26575       FT_ETHER, BASE_NONE, NULL, 0,
26576       NULL, HFILL }},
26577
26578     {&hf_ieee80211_ff_hwmp_targ_ext,
26579      {"Target External Address", "wlan.hwmp.targ_ext",
26580       FT_ETHER, BASE_NONE, NULL, 0,
26581       NULL, HFILL }},
26582
26583     {&hf_ieee80211_ff_hwmp_targ_sn,
26584      {"Target HWMP Sequence Number", "wlan.hwmp.targ_sn",
26585       FT_UINT32, BASE_DEC, NULL, 0,
26586       NULL, HFILL }},
26587
26588     {&hf_ieee80211_mesh_config_path_sel_protocol,
26589      {"Path Selection Protocol", "wlan.mesh.config.ps_protocol",
26590       FT_UINT8, BASE_HEX, NULL, 0,
26591       "Mesh Configuration Path Selection Protocol", HFILL }},
26592
26593     {&hf_ieee80211_mesh_config_path_sel_metric,
26594      {"Path Selection Metric", "wlan.mesh.config.ps_metric",
26595       FT_UINT8, BASE_HEX, NULL, 0,
26596       "Mesh Configuration Path Selection Metric", HFILL }},
26597
26598     {&hf_ieee80211_mesh_config_congestion_control,
26599      {"Congestion Control", "wlan.mesh.config.cong_ctl",
26600       FT_UINT8, BASE_HEX, NULL, 0,
26601       "Mesh Configuration Congestion Control", HFILL }},
26602
26603     {&hf_ieee80211_mesh_config_sync_method,
26604      {"Synchronization Method", "wlan.mesh.config.sync_method",
26605       FT_UINT8, BASE_HEX, NULL, 0,
26606       "Mesh Configuration Synchronization Method", HFILL }},
26607
26608     {&hf_ieee80211_mesh_config_auth_protocol,
26609      {"Authentication Protocol", "wlan.mesh.config.auth_protocol",
26610       FT_UINT8, BASE_HEX, NULL, 0,
26611       "Mesh Configuration Authentication Protocol", HFILL }},
26612
26613     {&hf_ieee80211_mesh_config_formation_info,
26614      {"Formation Info", "wlan.mesh.config.formation_info",
26615       FT_UINT8, BASE_HEX, NULL, 0,
26616       "Mesh Configuration Formation Info", HFILL }},
26617
26618     {&hf_ieee80211_mesh_form_info_num_of_peerings,
26619      {"Number of Peerings", "wlan.mesh.config.formation_info.num_peers",
26620       FT_UINT8, BASE_DEC, NULL, 0x7E,
26621       NULL, HFILL }},
26622
26623     {&hf_ieee80211_mesh_config_capability,
26624      {"Capability", "wlan.mesh.config.cap",
26625       FT_UINT8, BASE_HEX, NULL, 0,
26626       "Mesh Configuration Capability", HFILL }},
26627
26628     {&hf_ieee80211_mesh_config_cap_accepting,
26629      {"Accepting Additional Mesh Peerings", "wlan.mesh.config.cap.accept",
26630       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
26631       NULL, HFILL }},
26632
26633     {&hf_ieee80211_mesh_config_cap_mcca_support,
26634      {"MCCA Support", "wlan.mesh.config.cap.mcca_support",
26635       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
26636       NULL, HFILL }},
26637
26638     {&hf_ieee80211_mesh_config_cap_mcca_enabled,
26639      {"MCCA Enabled", "wlan.mesh.config.cap.mcca_enabled",
26640       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
26641       NULL, HFILL }},
26642
26643     {&hf_ieee80211_mesh_config_cap_forwarding,
26644      {"Mesh Forwarding", "wlan.mesh.config.cap.forwarding",
26645       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08,
26646       NULL, HFILL }},
26647
26648     {&hf_ieee80211_mesh_config_cap_mbca_enabled,
26649      {"MBCA Enabled", "wlan.mesh.config.cap.mbca_enabled",
26650       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
26651       NULL, HFILL }},
26652
26653     {&hf_ieee80211_mesh_config_cap_tbtt_adjusting,
26654      {"TBTT Adjustment", "wlan.mesh.config.cap.tbtt_adjusting",
26655       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20,
26656       NULL, HFILL }},
26657
26658     {&hf_ieee80211_mesh_config_cap_power_save_level,
26659      {"Power Save", "wlan.mesh.config.cap.power_save_level",
26660       FT_BOOLEAN, 8, TFS(&mesh_config_cap_power_save_level_flags), 0x40,
26661       NULL, HFILL }},
26662
26663     {&hf_ieee80211_mesh_id,
26664      {"Mesh ID", "wlan.mesh.id",
26665       FT_STRING, BASE_NONE, NULL, 0,
26666       NULL, HFILL }},
26667
26668     {&hf_ieee80211_rann_flags,
26669      {"RANN Flags", "wlan.rann.flags",
26670       FT_UINT8, BASE_HEX, NULL, 0,
26671       "Root Announcement Flags", HFILL }},
26672
26673     {&hf_ieee80211_rann_root_sta,
26674      {"Root STA Address", "wlan.rann.root_sta", FT_ETHER, BASE_NONE, NULL, 0,
26675       "Root Mesh STA Address", HFILL }},
26676
26677     {&hf_ieee80211_rann_sn,
26678      {"Root STA Sequence Number", "wlan.rann.rann_sn",
26679       FT_UINT32, BASE_DEC, NULL, 0,
26680       "Root Mesh STA Sequence Number", HFILL }},
26681
26682     {&hf_ieee80211_rann_interval,
26683      {"RANN Interval", "wlan.rann.interval",
26684       FT_UINT32, BASE_DEC, NULL, 0,
26685       "Root Announcement Interval", HFILL }},
26686
26687     {&hf_ieee80211_ff_qos_action_code,
26688      {"Action code", "wlan.fixed.action_code",
26689       FT_UINT16, BASE_HEX, VALS(qos_action_codes), 0,
26690       "QoS management action code", HFILL }},
26691
26692     {&hf_ieee80211_ff_ba_action,
26693      {"Action code", "wlan.fixed.action_code",
26694       FT_UINT8, BASE_HEX, VALS(ba_action_codes), 0,
26695       "Block Ack action code", HFILL }},
26696
26697     {&hf_ieee80211_ff_check_beacon,
26698      {"Check Beacon", "wlan.fixed.check_beacon",
26699       FT_UINT8, BASE_DEC, NULL, 0,
26700       "Unprotected WNM Check Beacon", HFILL }},
26701
26702     {&hf_ieee80211_ff_tod,
26703      {"TOD", "wlan.fixed.tod",
26704       FT_UINT32, BASE_DEC, NULL, 0,
26705       "Previous TS of transmit antenna port", HFILL }},
26706
26707     {&hf_ieee80211_ff_toa,
26708      {"TOA", "wlan.fixed.toa",
26709       FT_UINT32, BASE_DEC, NULL, 0,
26710       "Previous TS of receive antenna port", HFILL }},
26711
26712     {&hf_ieee80211_ff_max_tod_err,
26713      {"MAX TOD ERROR", "wlan.fixed.max_tod_err",
26714       FT_UINT8, BASE_DEC, NULL, 0,
26715       "Maximal Error at Previous TS of transmit antenna port", HFILL }},
26716
26717     {&hf_ieee80211_ff_max_toa_err,
26718      {"MAX TOA ERROR", "wlan.fixed.max_toa_err",
26719       FT_UINT8, BASE_DEC, NULL, 0,
26720       "Maximal Error at Previous TS of receive antenna port", HFILL }},
26721
26722     {&hf_ieee80211_ff_dls_action_code,
26723      {"Action code", "wlan.fixed.action_code",
26724       FT_UINT16, BASE_HEX, VALS(dls_action_codes), 0,
26725       "DLS management action code", HFILL }},
26726
26727     {&hf_ieee80211_ff_dst_mac_addr,
26728      {"Destination address", "wlan.fixed.dst_mac_addr",
26729       FT_ETHER, BASE_NONE, NULL, 0,
26730       "Destination MAC address", HFILL }},
26731
26732     {&hf_ieee80211_ff_src_mac_addr,
26733      {"Source address", "wlan.fixed.src_mac_addr",
26734       FT_ETHER, BASE_NONE, NULL, 0,
26735       "Source MAC address", HFILL }},
26736
26737     {&hf_ieee80211_ff_req_ap_addr,
26738      {"RequesterAP address", "wlan.fixed.req_ap_addr",
26739       FT_ETHER, BASE_NONE, NULL, 0,
26740       NULL, HFILL }},
26741
26742     {&hf_ieee80211_ff_res_ap_addr,
26743      {"ResponderAP address", "wlan.fixed.res_ap_addr",
26744       FT_ETHER, BASE_NONE, NULL, 0,
26745       NULL, HFILL }},
26746
26747     {&hf_ieee80211_ff_ft_action_code,
26748      {"Action code", "wlan.fixed.action_code",
26749       FT_UINT8, BASE_DEC, VALS(ft_action_codes), 0,
26750       "Management action code", HFILL }},
26751
26752     {&hf_ieee80211_ff_sta_address,
26753      {"STA Address", "wlan.fixed.sta_address",
26754       FT_ETHER, BASE_NONE, NULL, 0,
26755       NULL, HFILL }},
26756
26757     {&hf_ieee80211_ff_target_ap_address,
26758      {"Target AP Address", "wlan.fixed.target_ap_address",
26759       FT_ETHER, BASE_NONE, NULL, 0,
26760       "Target AP MAC address", HFILL }},
26761
26762     {&hf_ieee80211_ff_gas_comeback_delay,
26763      {"GAS Comeback Delay", "wlan.fixed.gas_comeback_delay",
26764       FT_UINT16, BASE_DEC, NULL, 0,
26765       NULL, HFILL }},
26766
26767     {&hf_ieee80211_ff_gas_fragment_id,
26768      {"GAS Query Response Fragment ID", "wlan.fixed.gas_fragment_id",
26769       FT_UINT8, BASE_DEC, NULL, 0x7f,
26770       NULL, HFILL }},
26771
26772     {&hf_ieee80211_ff_more_gas_fragments,
26773      {"More GAS Fragments", "wlan.fixed.more_gas_fragments",
26774       FT_UINT8, BASE_DEC, NULL, 0x80,
26775       NULL, HFILL }},
26776
26777     {&hf_ieee80211_ff_query_request_length,
26778      {"Query Request Length", "wlan.fixed.query_request_length",
26779       FT_UINT16, BASE_DEC, NULL, 0,
26780       NULL, HFILL }},
26781
26782     {&hf_ieee80211_ff_query_request,
26783      {"Query Request", "wlan.fixed.query_request",
26784       FT_BYTES, BASE_NONE, NULL, 0,
26785       NULL, HFILL }},
26786
26787     {&hf_ieee80211_ff_query_response_length,
26788      {"Query Response Length", "wlan.fixed.query_response_length",
26789       FT_UINT16, BASE_DEC, NULL, 0,
26790       NULL, HFILL }},
26791
26792     {&hf_ieee80211_ff_query_response,
26793      {"Query Response", "wlan.fixed.query_response",
26794       FT_BYTES, BASE_NONE, NULL, 0,
26795       NULL, HFILL }},
26796
26797     {&hf_ieee80211_gas_resp_fragments,
26798      {"GAS Query Response fragments", "wlan.fixed.fragments",
26799       FT_NONE, BASE_NONE, NULL, 0x00,
26800       NULL, HFILL } },
26801
26802     {&hf_ieee80211_gas_resp_fragment,
26803      {"GAS Query Response fragment", "wlan.fixed.fragment",
26804       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
26805       NULL, HFILL } },
26806
26807     {&hf_ieee80211_gas_resp_fragment_overlap,
26808      {"GAS Query Response fragment overlap", "wlan.fixed.fragment.overlap",
26809       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
26810       NULL, HFILL } },
26811
26812     {&hf_ieee80211_gas_resp_fragment_overlap_conflict,
26813      {"GAS Query Response fragment overlapping with conflicting data", "wlan.fixed.fragment.overlap.conflicts",
26814       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
26815       NULL, HFILL } },
26816
26817     {&hf_ieee80211_gas_resp_fragment_multiple_tails,
26818      {"GAS Query Response has multiple tail fragments",  "wlan.fixed.fragment.multiple_tails",
26819       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
26820       NULL, HFILL } },
26821
26822     {&hf_ieee80211_gas_resp_fragment_too_long_fragment,
26823      {"GAS Query Response fragment too long", "wlan.fixed.fragment.too_long_fragment",
26824       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
26825       NULL, HFILL } },
26826
26827     {&hf_ieee80211_gas_resp_fragment_error,
26828      {"GAS Query Response reassembly error", "wlan.fixed.fragment.error",
26829       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
26830       NULL, HFILL } },
26831
26832     {&hf_ieee80211_gas_resp_fragment_count,
26833      {"GAS Query Response fragment count", "wlan.fixed.fragment.count",
26834       FT_UINT32, BASE_DEC, NULL, 0x00,
26835       NULL, HFILL } },
26836
26837     {&hf_ieee80211_gas_resp_reassembled_in,
26838      {"Reassembled in", "wlan.fixed.reassembled.in",
26839       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
26840       NULL, HFILL } },
26841
26842     {&hf_ieee80211_gas_resp_reassembled_length,
26843      {"Reassembled length", "wlan.fixed.reassembled.length",
26844       FT_UINT32, BASE_DEC, NULL, 0x00,
26845       NULL, HFILL } },
26846
26847     {&hf_ieee80211_ff_anqp_info_id,
26848      {"Info ID", "wlan.fixed.anqp.info_id",
26849       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
26850       "Access Network Query Protocol Info ID", HFILL }},
26851
26852     {&hf_ieee80211_ff_anqp_info_length,
26853      {"Length", "wlan.fixed.anqp.info_length",
26854       FT_UINT16, BASE_DEC, NULL, 0,
26855       "Access Network Query Protocol Length", HFILL }},
26856
26857     {&hf_ieee80211_ff_anqp_info,
26858      {"Information", "wlan.fixed.anqp.info",
26859       FT_BYTES, BASE_NONE, NULL, 0,
26860       "Access Network Query Protocol Information", HFILL }},
26861
26862     {&hf_ieee80211_ff_anqp_query_id,
26863      {"ANQP Query ID", "wlan.fixed.anqp.query_id",
26864       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
26865       "Access Network Query Protocol Query ID", HFILL }},
26866
26867     {&hf_ieee80211_ff_anqp_capability,
26868      {"ANQP Capability", "wlan.fixed.anqp.capability",
26869       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
26870       "Access Network Query Protocol Query ID", HFILL }},
26871
26872     {&hf_ieee80211_ff_anqp_capability_vlen,
26873      {"Vendor-specific Capability Length", "wlan.fixed.anqp.capability_vlen",
26874       FT_UINT16, BASE_DEC, NULL, 0,
26875       NULL, HFILL }},
26876
26877     {&hf_ieee80211_ff_anqp_capability_vendor,
26878      {"Vendor-specific Capability", "wlan.fixed.anqp.capability_vendor",
26879       FT_BYTES, BASE_NONE, NULL, 0,
26880       NULL, HFILL }},
26881
26882     {&hf_ieee80211_ff_venue_info_group,
26883      {"Venue Group", "wlan.fixed.venue_info.group",
26884       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &venue_group_vals_ext, 0,
26885       NULL, HFILL }},
26886
26887     {&hf_ieee80211_ff_venue_info_type,
26888      {"Venue Type", "wlan.fixed.venue_info.type",
26889       FT_UINT8, BASE_DEC, NULL, 0,
26890       NULL, HFILL }},
26891
26892     {&hf_ieee80211_ff_anqp_venue_length,
26893      {"Venue Name Duple Length", "wlan.fixed.anqp.venue.length",
26894       FT_UINT8, BASE_DEC, NULL, 0,
26895       NULL, HFILL }},
26896
26897     {&hf_ieee80211_ff_anqp_venue_language,
26898      {"Language Code", "wlan.fixed.anqp.venue.language",
26899       FT_STRING, BASE_NONE, NULL, 0,
26900       "Venue Name Language Code", HFILL }},
26901
26902     {&hf_ieee80211_ff_anqp_venue_name,
26903      {"Venue Name", "wlan.fixed.anqp.venue.name",
26904       FT_STRING, BASE_NONE, NULL, 0,
26905       NULL, HFILL }},
26906
26907     {&hf_ieee80211_ff_anqp_nw_auth_type_indicator,
26908      {"Network Authentication Type Indicator", "wlan.fixed.anqp.nw_auth_type.indicator",
26909       FT_UINT8, BASE_DEC, VALS(nw_auth_type_vals), 0,
26910       NULL, HFILL }},
26911
26912     {&hf_ieee80211_ff_anqp_nw_auth_type_url_len,
26913      {"Re-direct URL Length", "wlan.fixed.anqp.nw_auth_type.url_len",
26914       FT_UINT16, BASE_DEC, NULL, 0,
26915       NULL, HFILL }},
26916
26917     {&hf_ieee80211_ff_anqp_nw_auth_type_url,
26918      {"Re-direct URL", "wlan.fixed.anqp.nw_auth_type_url",
26919       FT_STRING, BASE_NONE, NULL, 0,
26920       NULL, HFILL }},
26921
26922     {&hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
26923      {"OI Length", "wlan.fixed.anqp.roaming_consortium.oi_len",
26924       FT_UINT8, BASE_DEC, NULL, 0,
26925       "Roaming Consortium OI Length", HFILL }},
26926
26927     {&hf_ieee80211_ff_anqp_roaming_consortium_oi,
26928      {"OI", "wlan.fixed.anqp.roaming_consortium.oi",
26929       FT_BYTES, BASE_NONE, NULL, 0,
26930       "Roaming Consortium OI", HFILL }},
26931
26932     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
26933      {"IPv6 Address", "wlan.fixed.anqp.ip_addr_availability.ipv6",
26934       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv6_vals), 0x03,
26935       "IP Address Type Availability information for IPv6", HFILL }},
26936
26937     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
26938      {"IPv4 Address", "wlan.fixed.anqp.ip_addr_availability.ipv4",
26939       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv4_vals), 0xfc,
26940       "IP Address Type Availability information for IPv4", HFILL }},
26941
26942     {&hf_ieee80211_ff_anqp_nai_realm_count,
26943      {"NAI Realm Count", "wlan.fixed.anqp.nai_realm_list.count",
26944       FT_UINT16, BASE_DEC, NULL, 0,
26945       NULL, HFILL }},
26946
26947     {&hf_ieee80211_ff_anqp_nai_field_len,
26948      {"NAI Realm Data Field Length", "wlan.fixed.anqp.nai_realm_list.field_len",
26949       FT_UINT16, BASE_DEC, NULL, 0,
26950       NULL, HFILL }},
26951
26952     {&hf_ieee80211_ff_anqp_nai_realm_encoding,
26953      {"NAI Realm Encoding", "wlan.fixed.naqp_nai_realm_list.encoding",
26954       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals), 0x01,
26955       NULL, HFILL }},
26956
26957     {&hf_ieee80211_ff_anqp_nai_realm_length,
26958      {"NAI Realm Length", "wlan.fixed.naqp_nai_realm_list.realm_length",
26959       FT_UINT8, BASE_DEC, NULL, 0,
26960       NULL, HFILL }},
26961
26962     {&hf_ieee80211_ff_anqp_nai_realm,
26963      {"NAI Realm", "wlan.fixed.naqp_nai_realm_list.realm",
26964       FT_STRING, BASE_NONE, NULL, 0,
26965       NULL, HFILL }},
26966
26967     {&hf_ieee80211_ff_anqp_nai_realm_eap_count,
26968      {"EAP Method Count", "wlan.fixed.naqp_nai_realm_list.eap_method_count",
26969       FT_UINT8, BASE_DEC, NULL, 0,
26970       NULL, HFILL }},
26971
26972     {&hf_ieee80211_ff_anqp_nai_realm_eap_len,
26973      {"EAP Method subfield Length", "wlan.fixed.naqp_nai_realm_list.eap_method_len",
26974       FT_UINT8, BASE_DEC, NULL, 0,
26975       NULL, HFILL }},
26976
26977     {&hf_ieee80211_ff_anqp_nai_realm_eap_method,
26978      {"EAP Method", "wlan.fixed.naqp_nai_realm_list.eap_method",
26979       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &eap_type_vals_ext, 0,
26980       NULL, HFILL }},
26981
26982     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
26983      {"Authentication Parameter Count", "wlan.fixed.naqp_nai_realm_list.auth_param_count",
26984       FT_UINT8, BASE_DEC, NULL, 0,
26985       NULL, HFILL }},
26986
26987     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
26988      {"Authentication Parameter ID", "wlan.fixed.naqp_nai_realm_list.auth_param_id",
26989       FT_UINT8, BASE_DEC, VALS(nai_realm_auth_param_id_vals), 0,
26990       NULL, HFILL }},
26991
26992     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
26993      {"Authentication Parameter Length", "wlan.fixed.naqp_nai_realm_list.auth_param_len",
26994       FT_UINT8, BASE_DEC, NULL, 0,
26995       NULL, HFILL }},
26996
26997     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
26998      {"Authentication Parameter Value", "wlan.fixed.naqp_nai_realm_list.auth_param_value",
26999       FT_BYTES, BASE_NONE, NULL, 0,
27000       NULL, HFILL }},
27001
27002     {&hf_ieee80211_3gpp_gc_gud,
27003      {"GUD", "wlan.fixed.anqp.3gpp_cellular_info.gud",
27004       FT_UINT8, BASE_DEC, NULL, 0,
27005       "Generic container User Data", HFILL }},
27006
27007     {&hf_ieee80211_3gpp_gc_udhl,
27008      {"UDHL", "wlan.fixed.anqp.3gpp_cellular_info.udhl",
27009       FT_UINT8, BASE_DEC, NULL, 0,
27010       "User Data Header Length", HFILL }},
27011
27012     {&hf_ieee80211_3gpp_gc_iei,
27013      {"IEI", "wlan.fixed.anqp.3gpp_cellular_info.iei",
27014       FT_UINT8, BASE_DEC, NULL, 0,
27015       "Information Element Identity", HFILL }},
27016
27017     {&hf_ieee80211_3gpp_gc_plmn_len,
27018      {"PLMN Length", "wlan.fixed.anqp.3gpp_cellular_info.plmn_len",
27019       FT_UINT8, BASE_DEC, NULL, 0,
27020       "Length of PLMN List value contents", HFILL }},
27021
27022     {&hf_ieee80211_3gpp_gc_num_plmns,
27023      {"Number of PLMNs", "wlan.fixed.anqp.3gpp_cellular_info.num_plmns",
27024       FT_UINT8, BASE_DEC, NULL, 0,
27025       NULL, HFILL }},
27026
27027     {&hf_ieee80211_3gpp_gc_plmn,
27028      {"PLMN", "wlan.fixed.anqp.3gpp_cellular_info.plmn_info",
27029       FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
27030
27031     {&hf_ieee80211_ff_anqp_domain_name_len,
27032      {"Domain Name Length", "wlan.fixed.anqp.domain_name_list.len",
27033       FT_UINT8, BASE_DEC, NULL, 0,
27034       NULL, HFILL }},
27035
27036     {&hf_ieee80211_ff_anqp_domain_name,
27037      {"Domain Name", "wlan.fixed.anqp.domain_name_list.name",
27038       FT_STRING, BASE_NONE, NULL, 0,
27039       NULL, HFILL }},
27040
27041     {&hf_ieee80211_ff_dls_timeout,
27042      {"DLS timeout", "wlan.fixed.dls_timeout",
27043       FT_UINT16, BASE_HEX, NULL, 0,
27044       "DLS timeout value", HFILL }},
27045
27046     {&hf_ieee80211_ff_sa_query_action_code,
27047      {"Action code", "wlan.fixed.action_code",
27048       FT_UINT8, BASE_DEC, VALS(sa_query_action_codes), 0,
27049       "Management action code", HFILL }},
27050
27051     {&hf_ieee80211_ff_transaction_id,
27052      {"Transaction Id", "wlan.fixed.transaction_id",
27053       FT_UINT16, BASE_HEX, NULL, 0,
27054       NULL, HFILL }},
27055
27056     {&hf_ieee80211_ff_send_confirm,
27057      {"Send-Confirm", "wlan.fixed.send_confirm",
27058       FT_UINT16, BASE_DEC, NULL, 0,
27059       NULL, HFILL }},
27060
27061     {&hf_ieee80211_ff_anti_clogging_token,
27062      {"Anti-Clogging Token", "wlan.fixed.anti_clogging_token",
27063       FT_BYTES, BASE_NONE, NULL, 0,
27064       NULL, HFILL }},
27065
27066     {&hf_ieee80211_ff_scalar,
27067      {"Scalar", "wlan.fixed.scalar",
27068       FT_BYTES, BASE_NONE, NULL, 0,
27069       NULL, HFILL }},
27070
27071     {&hf_ieee80211_ff_finite_field_element,
27072      {"Finite Field Element", "wlan.fixed.finite_field_element",
27073       FT_BYTES, BASE_NONE, NULL, 0,
27074       NULL, HFILL }},
27075
27076     {&hf_ieee80211_ff_confirm,
27077      {"Confirm", "wlan.fixed.confirm",
27078       FT_BYTES, BASE_NONE, NULL, 0,
27079       NULL, HFILL }},
27080
27081     {&hf_ieee80211_ff_finite_cyclic_group,
27082      {"Group Id", "wlan.fixed.finite_cyclic_group",
27083       FT_UINT16, BASE_DEC, NULL, 0,
27084       NULL, HFILL }},
27085
27086     {&hf_ieee80211_anqp_wfa_subtype,
27087      {"WFA Subtype", "wlan.anqp.wfa.subtype",
27088       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }},
27089
27090     {&hf_ieee80211_dpp_subtype,
27091      {"DPP Subtype", "wlan.wfa.dpp.subtype",
27092       FT_UINT8, BASE_DEC, VALS(dpp_subtype_vals), 0, NULL, HFILL }},
27093
27094     {&hf_hs20_indication_dgaf_disabled,
27095      {"DGAF Disabled", "wlan.hs20.indication.dgaf_disabled",
27096       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
27097
27098     {&hf_hs20_indication_pps_mo_id_present,
27099      {"PPS MO ID Present", "wlan.hs20.indication.pps_mo_id_present",
27100       FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02, NULL, HFILL }},
27101
27102     {&hf_hs20_indication_anqp_domain_id_present,
27103      {"ANQP Domain ID Present", "wlan.hs20.indication.anqp_domain_id_present",
27104       FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL }},
27105
27106     {&hf_hs20_reserved,
27107       { "Reserved", "wlan.hs20.indication.reserved",
27108        FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL }},
27109
27110     {&hf_hs20_indication_release_number,
27111      {"Release Number", "wlan.hs20.indication.release_number",
27112       FT_UINT8, BASE_DEC, VALS(hs20_indication_release_number_vals), 0xF0, NULL, HFILL }},
27113
27114     {&hf_hs20_indication_pps_mo_id,
27115      {"PPS MO ID", "wlan.hs20.indication.pps_mo_id",
27116       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27117
27118     {&hf_hs20_indication_anqp_domain_id,
27119      {"ANQP Domain ID", "wlan.hs20.indication.domain_id",
27120       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27121
27122     {&hf_hs20_anqp_subtype,
27123      {"Subtype", "wlan.hs20.anqp.subtype",
27124       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
27125       "Hotspot 2.0 ANQP Subtype", HFILL }},
27126
27127     {&hf_hs20_anqp_reserved,
27128      {"Reserved", "wlan.hs20.anqp.reserved",
27129       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27130
27131     {&hf_hs20_anqp_payload,
27132      {"Payload", "wlan.hs20.anqp.payload",
27133       FT_BYTES, BASE_NONE, NULL, 0,
27134       "Hotspot 2.0 ANQP Payload", HFILL }},
27135
27136     {&hf_hs20_anqp_hs_query_list,
27137      {"Queried Subtype", "wlan.hs20.anqp.hs_query_list",
27138       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
27139       "Queried HS 2.0 Element Subtype", HFILL }},
27140
27141     {&hf_hs20_anqp_hs_capability_list,
27142      {"Capability", "wlan.hs20.anqp.hs_capability_list",
27143       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
27144       "Hotspot 2.0 ANQP Subtype Capability", HFILL }},
27145
27146     {&hf_hs20_anqp_ofn_length,
27147      {"Length", "wlan.hs20.anqp.ofn.length",
27148       FT_UINT8, BASE_DEC, NULL, 0,
27149       "Operator Friendly Name Length", HFILL }},
27150
27151     {&hf_hs20_anqp_ofn_language,
27152      {"Language Code", "wlan.hs20.anqp.ofn.language",
27153       FT_STRING, BASE_NONE, NULL, 0,
27154       "Operator Friendly Name Language Code", HFILL }},
27155
27156     {&hf_hs20_anqp_ofn_name,
27157      {"Operator Friendly Name", "wlan.hs20.anqp.ofn.name",
27158       FT_STRING, BASE_NONE, NULL, 0,
27159       NULL, HFILL }},
27160
27161     {&hf_hs20_anqp_wan_metrics_link_status,
27162      {"Link Status", "wlan.hs20.anqp.wan_metrics.link_status",
27163       FT_UINT8, BASE_DEC, VALS(hs20_wm_link_status_vals), 0x03, NULL, HFILL }},
27164
27165     {&hf_hs20_anqp_wan_metrics_symmetric_link,
27166      {"Symmetric Link", "wlan.hs20.anqp.wan_metrics.symmetric_link",
27167       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
27168
27169     {&hf_hs20_anqp_wan_metrics_at_capacity,
27170      {"At Capacity", "wlan.hs20.anqp.wan_metrics.at_capacity",
27171       FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
27172
27173     {&hf_hs20_anqp_wan_metrics_reserved,
27174      {"Reserved", "wlan.hs20.anqp.wan_metrics.reserved",
27175       FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }},
27176
27177     {&hf_hs20_anqp_wan_metrics_downlink_speed,
27178      {"Downlink Speed", "wlan.hs20.anqp.wan_metrics.downlink_speed",
27179       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
27180
27181     {&hf_hs20_anqp_wan_metrics_uplink_speed,
27182      {"Uplink Speed", "wlan.hs20.anqp.wan_metrics.uplink_speed",
27183       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
27184
27185     {&hf_hs20_anqp_wan_metrics_downlink_load,
27186      {"Downlink Load", "wlan.hs20.anqp.wan_metrics.downlink_load",
27187       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27188
27189     {&hf_hs20_anqp_wan_metrics_uplink_load,
27190      {"Uplink Load", "wlan.hs20.anqp.wan_metrics.uplink_load",
27191       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27192
27193     {&hf_hs20_anqp_wan_metrics_lmd,
27194      {"LMD", "wlan.hs20.anqp.wan_metrics.lmd",
27195       FT_UINT16, BASE_DEC, NULL, 0, "Load Measurement Duration", HFILL }},
27196
27197     {&hf_hs20_anqp_cc_proto_ip_proto,
27198      {"IP Protocol", "wlan.hs20.anqp.cc.ip_proto",
27199       FT_UINT8, BASE_DEC, NULL, 0,
27200       "ProtoPort Tuple - IP Protocol", HFILL }},
27201
27202     {&hf_hs20_anqp_cc_proto_port_num,
27203      {"Port Number", "wlan.hs20.anqp.cc.port_num",
27204       FT_UINT16, BASE_DEC, NULL, 0,
27205       "ProtoPort Tuple - Port Number", HFILL }},
27206
27207     {&hf_hs20_anqp_cc_proto_status,
27208      {"Status", "wlan.hs20.anqp.cc.status",
27209       FT_UINT8, BASE_DEC, VALS(hs20_cc_status_vals), 0,
27210       "ProtoPort Tuple - Status", HFILL }},
27211
27212     {&hf_hs20_anqp_nai_hrq_count,
27213      {"NAI Home Realm Count", "wlan.hs20.anqp.nai_hrq.count",
27214       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27215
27216     {&hf_hs20_anqp_nai_hrq_encoding_type,
27217      {"NAI Home Realm Encoding Type",
27218       "wlan.hs20.anqp.nai_hrq.encoding_type",
27219       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals),
27220       0x01, NULL, HFILL }},
27221
27222     {&hf_hs20_anqp_nai_hrq_length,
27223      {"NAI Home Realm Name Length", "wlan.hs20.anqp.nai_hrq.length",
27224       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27225
27226     {&hf_hs20_anqp_nai_hrq_realm_name,
27227      {"NAI Home Realm Name", "wlan.hs20.anqp.nai_hrq.name",
27228       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27229
27230     {&hf_hs20_anqp_oper_class_indic,
27231      {"Operating Class", "wlan.hs20.anqp.oper_class_indic.oper_class",
27232       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27233
27234     {&hf_hs20_osu_friendly_names_len,
27235      {"OSU Friendly Name Length", "wlan.hs20.osu_friendly_names_len",
27236       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27237
27238     {&hf_hs20_osu_friendly_name_length,
27239      {"Length", "wlan.hs20.osu_friendly_name.len",
27240       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27241
27242     {&hf_hs20_osu_friendly_name_language,
27243      {"Language Code", "wlan.hs20.osu_friendly_name.language",
27244       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27245
27246     {&hf_hs20_osu_friendly_name_name,
27247      {"OSU Friendly Name", "wlan.hs20.osu_friendly_name.name",
27248      FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27249
27250     {&hf_hs20_osu_server_uri_len,
27251      {"OSU Server URI Length", "wlan.hs20.osu_server_uri_len",
27252       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27253
27254     {&hf_hs20_osu_server_uri,
27255      {"OSU Server URI", "wlan.hs20.osu_server_uri",
27256       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27257
27258     {&hf_hs20_osu_method_list_len,
27259      {"OSU Method List Length", "wlan.hs20.osu_method_list_len",
27260       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27261
27262     {&hf_hs20_osu_method_val,
27263      {"OSU Method", "wlan.hs20.osu_method_list.method",
27264       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27265
27266     {&hf_hs20_icons_avail_len,
27267      {"Icons Available Length", "wlan.hs20.osu_icons_avail_len",
27268       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27269
27270     {&hf_hs20_osu_providers_list_ssid_len,
27271      {"SSID Length", "wlan.hs20.anqp_osu_prov_list.ssid_len",
27272       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27273
27274     {&hf_hs20_osu_providers_ssid,
27275      {"SSID", "wlan.hs20.anqp_osu_prov_list.ssid",
27276       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27277
27278     {&hf_hs20_osu_providers_count,
27279      {"Number of OSU Providers", "wlan.hs20.anqp_osu_prov_list.number",
27280       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27281
27282     {&hf_hs20_osu_prov_length,
27283      {"OSU Provider Length", "wlan.hs20.anqp_osu_prov.len",
27284       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27285
27286     {&hf_hs20_icon_request_filename,
27287      {"Icon Filename", "wlan.hs20.anqp_icon_request.icon_filename",
27288       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27289
27290     {&hf_osu_icon_avail_width,
27291      {"Icon Width", "wlan.hs20.osu_icons_avail.icon_width",
27292       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27293
27294     {&hf_osu_icon_avail_height,
27295      {"Icon Height", "wlan.hs20.osu_icons_avail.icon_height",
27296       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27297
27298     {&hf_osu_icon_avail_lang_code,
27299      {"Language Code", "wlan.hs20.osu_icons_avail.lang_code",
27300       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27301
27302     {&hf_osu_icon_avail_icon_type_len,
27303      {"Icon Type Length", "wlan.hs20.osu_icons_avail.icon_type_len",
27304       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27305
27306     {&hf_osu_icon_avail_icon_type,
27307      {"Icon Type", "wlan.hs20.osu_icons_avail.icon_type",
27308       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27309
27310     {&hf_osu_icon_avail_filename_len,
27311      {"Icon Filename Length", "wlan.hs20.osu_icons_avail.icon_filename_len",
27312       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27313
27314     {&hf_osu_icon_avail_filename,
27315      {"Icon Filename", "wlan.hs20.osu_icons_avail.icon_filename",
27316       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27317
27318     {&hf_hs20_osu_nai_len,
27319      {"OSU_NAI Length", "wlan.hs20.osu_nai.len",
27320       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27321
27322     {&hf_hs20_osu_nai,
27323      {"OSU_NAI", "wlan.hs20.osu_nai",
27324       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
27325
27326     {&hf_hs20_osu_service_desc_len,
27327      {"OSU Service Desctription Length", "wlan.hs20.osu_service_desc_len",
27328       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27329
27330     {&hf_hs20_osu_service_desc_duple_len,
27331      {"Length", "wlan.hs20.osu_service_desc.duple.len",
27332       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27333
27334     {&hf_hs20_osu_service_desc_lang,
27335      {"Language Code", "wlan.hs20.osu_service_desc.duple.lang",
27336       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27337
27338     {&hf_hs20_osu_service_desc,
27339      {"OSU Service Description", "wlan.hs20.osu_service_desc.duple.desc",
27340       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27341
27342     {&hf_hs20_icon_binary_file_status,
27343      {"Download Status Code", "wlan.hs20.anqp_icon_request.download_status",
27344       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27345
27346     {&hf_hs20_icon_type_length,
27347      {"Icon Type Length", "wlan.hs20.anqp_icon_request.icon_type_len",
27348       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27349
27350     {&hf_hs20_icon_type,
27351      {"Icon Type", "wlan.hs20.anqp_icon_request.icon_type",
27352       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27353
27354     {&hf_hs20_icon_binary_data_len,
27355      {"Icon Binary Data Length", "wlan.anqp_icon_request.icon_binary_data_len",
27356       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27357
27358     {&hf_hs20_icon_binary_data,
27359      {"Icon Binary Data", "wlan.h220.anqp_icon_request.icon_binary_data",
27360       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
27361
27362     {&hf_hs20_subscription_remediation_url_len,
27363      {"Server URL Length", "wlan.hs20.subs_remediation.server_url_len",
27364       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27365
27366     {&hf_hs20_subscription_remediation_server_url,
27367      {"Server URL", "wlan.hs20.subs_remediation.server_url",
27368       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27369
27370     {&hf_hs20_subscription_remediation_server_method,
27371      {"Server Method", "wlan.hs20.subs_remediation.server_method",
27372       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27373
27374     {&hf_hs20_deauth_reason_code,
27375      {"De-Auth Reason Code", "wlan.hs20.deauth.reason_code",
27376       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27377
27378     {&hf_hs20_reauth_delay,
27379      {"Re-Auth Delay", "wlan.hs20.deauth.reauth_delay",
27380       FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_seconds, 0, NULL, HFILL }},
27381
27382     {&hf_hs20_deauth_reason_url_len,
27383      {"Reason URL Length", "wlan.hs20.deauth.reason_url_len",
27384       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27385
27386     {&hf_hs20_deauth_imminent_reason_url,
27387      {"Reason URL", "wlan.hs20.deauth.reason_url",
27388       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27389
27390     {&hf_hs20_anqp_venue_url_length,
27391      {"Length", "wlan.hs20.venue_url.len",
27392       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27393
27394     {&hf_hs20_anqp_venue_number,
27395      {"Venue number", "wlan.hs20.venue_url.venue_num",
27396       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27397
27398     {&hf_hs20_anqp_venue_url,
27399      {"Venue URL", "wlan.hs20.venue_url.url",
27400       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27401
27402     {&hf_hs20_anqp_advice_of_charge_length,
27403      {"Length", "wlan.hs20.advice_of_charge.len",
27404       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27405
27406     {&hf_hs20_anqp_advice_of_charge_type,
27407      {"Advice of Charge Type", "wlan.hs20.advice_of_charge.type",
27408       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27409
27410     {&hf_hs20_anqp_aoc_nai_realm_encoding,
27411      {"NAI Realm Encoding", "wlan.hs20.advice_of_charge.nai_realm_enc",
27412       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
27413
27414     {&hf_hs20_anqp_aoc_nai_realm_len,
27415      {"NAI Realm Length", "wlan.hs20.advice_of_charge.nai_realm_len",
27416       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
27417
27418     {&hf_hs20_anqp_aoc_nai_realm,
27419      {"NAI Realm", "wlan.hs20.advice_of_charge.nai_realm",
27420       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27421
27422     {&hf_hs20_anqp_aoc_plan_len,
27423      {"Plan length", "wlan.hs20.advice_of_charge.plan_info_tuples.plan_len",
27424       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
27425
27426     {&hf_hs20_anqp_aoc_plan_lang,
27427      {"Plan language", "wlan.hs20.advice_of_charge.plan_info_tuples.plan_lang",
27428       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27429
27430     {&hf_hs20_anqp_aoc_plan_curcy,
27431      {"Plan currency", "wlan.hs20.advice_of_charge.plan_info_tuples.plan_curcy",
27432       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27433
27434     {&hf_hs20_anqp_aoc_plan_information,
27435      {"Plan information", "wlan.hs20.advice_of_charge.plan_info_tuples.info",
27436       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
27437
27438     {&hf_ieee80211_tag,
27439      {"Tag", "wlan.tag",
27440       FT_NONE, BASE_NONE, 0x0, 0,
27441       NULL, HFILL }},
27442
27443     {&hf_ieee80211_tag_number,
27444      {"Tag Number", "wlan.tag.number",
27445       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
27446       "Element ID", HFILL }},
27447
27448     {&hf_ieee80211_tag_length,
27449      {"Tag length", "wlan.tag.length",
27450       FT_UINT32, BASE_DEC, NULL, 0,
27451       "Length of tag", HFILL }},
27452
27453     {&hf_ieee80211_tag_interpretation,
27454      {"Tag interpretation", "wlan.tag.interpretation",
27455       FT_STRING, BASE_NONE, NULL, 0,
27456       "Interpretation of tag", HFILL }},
27457
27458     {&hf_ieee80211_tag_data,
27459      {"Tag Data", "wlan.tag.data",
27460       FT_BYTES, BASE_NONE, NULL, 0,
27461       "Data Interpretation of tag", HFILL }},
27462
27463     {&hf_ieee80211_tag_oui,
27464      {"OUI", "wlan.tag.oui",
27465       FT_UINT24, BASE_OUI, NULL, 0,
27466       "OUI of vendor specific IE", HFILL }},
27467
27468     {&hf_ieee80211_tag_oui_wfa_subtype,
27469      {"WFA Subtype", "wlan.tag.oui.wfa_subtype",
27470       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0,
27471       NULL, HFILL }},
27472
27473     {&hf_ieee80211_tag_ds_param_channel,
27474      {"Current Channel", "wlan.ds.current_channel",
27475       FT_UINT8, BASE_DEC, NULL, 0,
27476       "DS Parameter Set - Current Channel", HFILL }},
27477
27478     {&hf_ieee80211_tag_cfp_count,
27479      {"CFP Count", "wlan.cfp.count",
27480       FT_UINT8, BASE_DEC, NULL, 0,
27481       "Indicates how many delivery traffic indication messages (DTIMs)", HFILL }},
27482
27483     {&hf_ieee80211_tag_cfp_period,
27484      {"CFP Period", "wlan.cfp.period",
27485       FT_UINT8, BASE_DEC, NULL, 0,
27486       "Indicates the number of DTIM intervals between the start of CFPs", HFILL }},
27487
27488     {&hf_ieee80211_tag_cfp_max_duration,
27489      {"CFP Max Duration", "wlan.cfp.max_duration",
27490       FT_UINT16, BASE_DEC, NULL, 0,
27491       "Indicates the maximum duration (in TU) of the CFP that may be generated by this PCF", HFILL }},
27492
27493     {&hf_ieee80211_tag_cfp_dur_remaining,
27494      {"CFP Dur Remaining", "wlan.cfp.dur_remaining",
27495       FT_UINT16, BASE_DEC, NULL, 0,
27496       "Indicates the maximum time (in TU) remaining in the present CFP", HFILL }},
27497
27498     {&hf_ieee80211_tag_vendor_oui_type,
27499      {"Vendor Specific OUI Type", "wlan.tag.vendor.oui.type",
27500       FT_UINT8, BASE_DEC, NULL, 0,
27501       NULL, HFILL }},
27502
27503     {&hf_ieee80211_tag_vendor_data,
27504      {"Vendor Specific Data", "wlan.tag.vendor.data",
27505       FT_BYTES, BASE_NONE, NULL, 0,
27506       "Unknown/undecoded Vendor Specific Data", HFILL }},
27507
27508     {&hf_ieee80211_tim_dtim_count,
27509      {"DTIM count", "wlan.tim.dtim_count",
27510       FT_UINT8, BASE_DEC, NULL, 0,
27511       "Indicates how many Beacon frames (including the current frame) appear before the next DTIM", HFILL }},
27512
27513     {&hf_ieee80211_tim_dtim_period,
27514      {"DTIM period", "wlan.tim.dtim_period",
27515       FT_UINT8, BASE_DEC, NULL, 0,
27516       "Indicates the number of beacon intervals between successive DTIMs", HFILL }},
27517
27518     {&hf_ieee80211_tim_bmapctl,
27519      {"Bitmap control", "wlan.tim.bmapctl",
27520       FT_UINT8, BASE_HEX, NULL, 0,
27521       NULL, HFILL }},
27522
27523     {&hf_ieee80211_tim_bmapctl_mcast,
27524      {"Multicast", "wlan.tim.bmapctl.multicast",
27525       FT_BOOLEAN, 8, NULL, 0x1,
27526       "Contains the Traffic Indicator bit associated with Association ID 0", HFILL }},
27527
27528     {&hf_ieee80211_tim_bmapctl_offset,
27529      {"Bitmap Offset", "wlan.tim.bmapctl.offset",
27530       FT_UINT8, BASE_HEX, NULL, 0xFE,
27531       NULL, HFILL }},
27532
27533     {&hf_ieee80211_tim_partial_virtual_bitmap,
27534      {"Partial Virtual Bitmap", "wlan.tim.partial_virtual_bitmap",
27535       FT_BYTES, BASE_NONE, NULL, 0x0,
27536       NULL, HFILL }},
27537
27538     {&hf_ieee80211_tim_aid,
27539      {"Association ID", "wlan.tim.aid",
27540       FT_UINT8, BASE_HEX, NULL, 0x0,
27541       NULL, HFILL }},
27542
27543     {&hf_ieee80211_tag_ibss_atim_window,
27544      {"Atim Windows", "wlan.ibss.atim_windows",
27545       FT_UINT16, BASE_HEX, NULL, 0x0,
27546       "Contains the ATIM Window length in TU", HFILL }},
27547
27548     {&hf_ieee80211_tag_country_info_code,
27549      {"Code", "wlan.country_info.code",
27550       FT_STRING, BASE_NONE, NULL, 0x0,
27551       NULL, HFILL }},
27552
27553     {&hf_ieee80211_tag_country_info_env,
27554      {"Environment", "wlan.country_info.environment",
27555       FT_UINT8, BASE_HEX, VALS(environment_vals), 0x0,
27556       NULL, HFILL }},
27557
27558     {&hf_ieee80211_tag_country_info_pad,
27559      {"Padding", "wlan.country_info.padding",
27560       FT_BYTES, BASE_NONE, NULL, 0x0,
27561       NULL, HFILL }},
27562
27563     {&hf_ieee80211_tag_country_info_fnm,
27564      {"Country Info", "wlan.country_info.fnm",
27565       FT_NONE, BASE_NONE, NULL, 0x0,
27566       NULL, HFILL }},
27567
27568     {&hf_ieee80211_tag_country_info_fnm_fcn,
27569      {"First Channel Number", "wlan.country_info.fnm.fcn",
27570       FT_UINT8, BASE_DEC, NULL, 0x0,
27571       NULL, HFILL }},
27572
27573     {&hf_ieee80211_tag_country_info_fnm_nc,
27574      {"Number of Channels", "wlan.country_info.fnm.nc",
27575       FT_UINT8, BASE_DEC, NULL, 0x0,
27576       NULL, HFILL }},
27577
27578     {&hf_ieee80211_tag_country_info_fnm_mtpl,
27579      {"Maximum Transmit Power Level", "wlan.country_info.fnm.mtpl",
27580       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
27581       NULL, HFILL }},
27582
27583     {&hf_ieee80211_tag_country_info_rrc,
27584      {"Country Info", "wlan.country_info.rrc",
27585       FT_NONE, BASE_NONE, NULL, 0x0,
27586       NULL, HFILL }},
27587
27588     {&hf_ieee80211_tag_country_info_rrc_oei,
27589      {"Operating Extension Identifier", "wlan.country_info.rrc.oei",
27590       FT_UINT8, BASE_DEC, NULL, 0x0,
27591       NULL, HFILL }},
27592
27593     {&hf_ieee80211_tag_country_info_rrc_oc,
27594      {"Operating Class", "wlan.country_info.rrc.oc",
27595       FT_UINT8, BASE_DEC, NULL, 0x0,
27596       NULL, HFILL }},
27597
27598     {&hf_ieee80211_tag_country_info_rrc_cc,
27599      {"Coverage Class", "wlan.country_info.rrc.cc",
27600       FT_UINT8, BASE_DEC, NULL, 0x0,
27601       NULL, HFILL }},
27602
27603     {&hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
27604      {"Prime Radix", "wlan.fh_hopping.parameter.prime_radix",
27605       FT_UINT8, BASE_DEC, NULL, 0x0,
27606       NULL, HFILL }},
27607
27608     {&hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
27609      {"Number of Channels", "wlan.fh_hopping.parameter.nb_channels",
27610       FT_UINT8, BASE_DEC, NULL, 0x0,
27611       NULL, HFILL }},
27612
27613     {&hf_ieee80211_tag_fh_hopping_table_flag,
27614      {"Flag", "wlan.fh_hopping.table.flag",
27615       FT_UINT8, BASE_HEX, NULL, 0x0,
27616       "Indicates that a Random Table is present when the value is 1", HFILL }},
27617
27618     {&hf_ieee80211_tag_fh_hopping_table_number_of_sets,
27619      {"Number of Sets", "wlan.fh_hopping.table.number_of_sets",
27620       FT_UINT8, BASE_DEC, NULL, 0x0,
27621       "Indicates the total number of sets within the hopping patterns", HFILL }},
27622
27623     {&hf_ieee80211_tag_fh_hopping_table_modulus,
27624      {"Modulus", "wlan.fh_hopping.table.modulus",
27625       FT_UINT8, BASE_HEX, NULL, 0x0,
27626       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
27627
27628     {&hf_ieee80211_tag_fh_hopping_table_offset,
27629      {"Offset", "wlan.fh_hopping.table.offset",
27630       FT_UINT8, BASE_HEX, NULL, 0x0,
27631       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
27632
27633     {&hf_ieee80211_tag_fh_hopping_random_table,
27634      {"Random Table", "wlan.fh_hopping.table.random_table",
27635       FT_UINT16, BASE_HEX, NULL, 0x0,
27636       "It is a vector of single octet values that indicate the random sequence to be followed during a hopping sequence", HFILL }},
27637
27638     {&hf_ieee80211_tag_request,
27639      {"Requested Element ID", "wlan.tag.request",
27640       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
27641       "The list of elements that are to be included in the responding STA Probe Response frame", HFILL }},
27642
27643     {&hf_ieee80211_tclas_up,
27644      {"User Priority", "wlan.tclas.user_priority",
27645       FT_UINT8, BASE_DEC, NULL, 0,
27646       "Contains the value of the UP of the associated MSDUs", HFILL }},
27647
27648     {&hf_ieee80211_tclas_class_type,
27649      {"Classifier Type", "wlan.tclas.class_type",
27650       FT_UINT8, BASE_DEC, VALS(classifier_type), 0,
27651       "Specifies the type of classifier parameters", HFILL }},
27652
27653     {&hf_ieee80211_tclas_class_mask,
27654      {"Classifier Mask", "wlan.tclas.class_mask",
27655       FT_UINT8, BASE_HEX,  NULL, 0,
27656       "Specifies a bitmap where bits that are set to 1 identify a subset of the classifier parameters", HFILL }},
27657
27658     {&hf_ieee80211_tclas_class_mask0_src_addr,
27659      {"Source Address", "wlan.tclas.class_mask.src_addr",
27660       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
27661
27662     {&hf_ieee80211_tclas_class_mask0_dst_addr,
27663      {"Destination Address", "wlan.tclas.class_mask.dst_addr",
27664       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
27665
27666     {&hf_ieee80211_tclas_class_mask0_type,
27667      {"Type", "wlan.tclas.class_mask.type",
27668       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
27669
27670     {&hf_ieee80211_tclas_class_mask1_ver,
27671      {"Version", "wlan.tclas.class_mask.version",
27672       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
27673
27674     {&hf_ieee80211_tclas_class_mask1_src_ip,
27675      {"Source IP Address", "wlan.tclas.class_mask.src_ip",
27676       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
27677
27678     {&hf_ieee80211_tclas_class_mask1_dst_ip,
27679      {"Destination IP Address", "wlan.tclas.class_mask.dst_ip",
27680       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
27681
27682     {&hf_ieee80211_tclas_class_mask1_src_port,
27683      {"Source Port", "wlan.tclas.class_mask.src_port",
27684       FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL }},
27685
27686     {&hf_ieee80211_tclas_class_mask1_dst_port,
27687      {"Destination Port", "wlan.tclas.class_mask.dst_port",
27688       FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL }},
27689
27690     {&hf_ieee80211_tclas_class_mask1_ipv4_dscp,
27691      {"DSCP", "wlan.tclas.class_mask.dscp",
27692       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
27693
27694     {&hf_ieee80211_tclas_class_mask1_ipv4_proto,
27695      {"Protocol", "wlan.tclas.class_mask.proto",
27696       FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL }},
27697
27698     {&hf_ieee80211_tclas_class_mask1_ipv6_flow,
27699      {"Flow Label", "wlan.tclas.class_mask.flow_label",
27700       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
27701
27702     {&hf_ieee80211_tclas_class_mask2_tci,
27703      {"802.1Q CLAN TCI", "wlan.tclas.class_mask.tci",
27704       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
27705
27706     {&hf_ieee80211_tclas_src_mac_addr,
27707      {"Source address", "wlan.tclas.src_mac_addr",
27708       FT_ETHER, BASE_NONE, NULL, 0,
27709       "Classifier Parameters Ethernet Type", HFILL }},
27710
27711     {&hf_ieee80211_tclas_dst_mac_addr,
27712      {"Destination address", "wlan.tclas.dat_mac_addr",
27713       FT_ETHER, BASE_NONE, NULL, 0,
27714       NULL, HFILL }},
27715
27716     {&hf_ieee80211_tclas_ether_type,
27717      {"Ethernet Type", "wlan.tclas.ether_type",
27718       FT_UINT8, BASE_DEC, NULL, 0,
27719       NULL, HFILL }},
27720
27721     {&hf_ieee80211_tclas_version,
27722      {"IP Version", "wlan.tclas.version",
27723       FT_UINT8, BASE_DEC, NULL, 0,
27724       NULL, HFILL }},
27725
27726     {&hf_ieee80211_tclas_ipv4_src,
27727      {"IPv4 Src Addr", "wlan.tclas.ipv4_src",
27728       FT_IPv4, BASE_NONE, NULL, 0,
27729       NULL, HFILL }},
27730
27731     {&hf_ieee80211_tclas_ipv4_dst,
27732      {"IPv4 Dst Addr", "wlan.tclas.ipv4_dst",
27733       FT_IPv4, BASE_NONE, NULL, 0,
27734       NULL, HFILL }},
27735
27736     {&hf_ieee80211_tclas_src_port,
27737      {"Source Port", "wlan.tclas.src_port",
27738       FT_UINT16, BASE_DEC, NULL, 0,
27739       NULL, HFILL }},
27740
27741     {&hf_ieee80211_tclas_dst_port,
27742      {"Destination Port", "wlan.tclas.dst_port",
27743       FT_UINT16, BASE_DEC, NULL, 0,
27744       NULL, HFILL }},
27745
27746     {&hf_ieee80211_tclas_dscp,
27747      {"IPv4 DSCP", "wlan.tclas.dscp",
27748       FT_UINT8, BASE_HEX, NULL, 0,
27749       "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
27750
27751     {&hf_ieee80211_tclas_protocol,
27752      {"Protocol", "wlan.tclas.protocol",
27753       FT_UINT8, BASE_HEX, NULL, 0,
27754       "IPv4 Protocol", HFILL }},
27755
27756     {&hf_ieee80211_tclas_ipv6_src,
27757      {"IPv6 Src Addr", "wlan.tclas.ipv6_src",
27758       FT_IPv6, BASE_NONE, NULL, 0,
27759       NULL, HFILL }},
27760
27761     {&hf_ieee80211_tclas_ipv6_dst,
27762      {"IPv6 Dst Addr", "wlan.tclas.ipv6_dst",
27763       FT_IPv6, BASE_NONE, NULL, 0,
27764       NULL, HFILL }},
27765
27766     {&hf_ieee80211_tclas_flow,
27767      {"Flow Label", "wlan.tclas.flow",
27768       FT_UINT24, BASE_HEX, NULL, 0,
27769       "IPv6 Flow Label", HFILL }},
27770
27771     {&hf_ieee80211_tclas_tag_type,
27772      {"802.1Q Tag Type", "wlan.tclas.tag_type",
27773       FT_UINT16, BASE_HEX, NULL, 0,
27774       NULL, HFILL }},
27775
27776     {&hf_ieee80211_tag_challenge_text,
27777      {"Challenge Text", "wlan.tag.challenge_text",
27778       FT_BYTES, BASE_NONE, NULL, 0,
27779       NULL, HFILL }},
27780
27781     {&hf_ieee80211_rsn_version,
27782      {"RSN Version", "wlan.rsn.version",
27783       FT_UINT16, BASE_DEC, NULL, 0,
27784       "Indicates the version number of the RSNA protocol", HFILL }},
27785
27786     {&hf_ieee80211_rsn_gcs,
27787      {"Group Cipher Suite", "wlan.rsn.gcs",
27788       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gcs_base_custom), 0,
27789       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
27790
27791     {&hf_ieee80211_rsn_gcs_oui,
27792      {"Group Cipher Suite OUI", "wlan.rsn.gcs.oui",
27793       FT_UINT24, BASE_OUI, NULL, 0,
27794       NULL, HFILL }},
27795
27796     {&hf_ieee80211_rsn_gcs_type,
27797      {"Group Cipher Suite type", "wlan.rsn.gcs.type",
27798       FT_UINT8, BASE_DEC, NULL, 0,
27799       NULL, HFILL }},
27800
27801     {&hf_ieee80211_rsn_gcs_80211_type,
27802      {"Group Cipher Suite type", "wlan.rsn.gcs.type",
27803       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
27804       NULL, HFILL }},
27805
27806     {&hf_ieee80211_rsn_pcs_count,
27807      {"Pairwise Cipher Suite Count", "wlan.rsn.pcs.count",
27808       FT_UINT16, BASE_DEC,  NULL, 0,
27809       "Indicates the number of pairwise cipher suite selectors that are contained in the Pairwise Cipher Suite List", HFILL }},
27810
27811     {&hf_ieee80211_rsn_pcs_list,
27812      {"Pairwise Cipher Suite List", "wlan.rsn.pcs.list",
27813       FT_NONE, BASE_NONE, NULL, 0,
27814       "Contains a series of cipher suite selectors that indicate the pairwisecipher suites", HFILL }},
27815
27816     {&hf_ieee80211_rsn_pcs,
27817      {"Pairwise Cipher Suite", "wlan.rsn.pcs",
27818       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_pcs_base_custom), 0,
27819       NULL, HFILL }},
27820
27821     {&hf_ieee80211_rsn_pcs_oui,
27822      {"Pairwise Cipher Suite OUI", "wlan.rsn.pcs.oui",
27823       FT_UINT24, BASE_OUI, NULL, 0,
27824       NULL, HFILL }},
27825
27826     {&hf_ieee80211_rsn_pcs_type,
27827      {"Pairwise Cipher Suite type", "wlan.rsn.pcs.type",
27828       FT_UINT8, BASE_DEC, NULL, 0,
27829       NULL, HFILL }},
27830
27831     {&hf_ieee80211_rsn_pcs_80211_type,
27832      {"Pairwise Cipher Suite type", "wlan.rsn.pcs.type",
27833       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
27834       NULL, HFILL }},
27835
27836     {&hf_ieee80211_rsn_akms_count,
27837      {"Auth Key Management (AKM) Suite Count", "wlan.rsn.akms.count",
27838       FT_UINT16, BASE_DEC, NULL, 0,
27839       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
27840
27841     {&hf_ieee80211_rsn_akms_list,
27842      {"Auth Key Management (AKM) List", "wlan.rsn.akms.list",
27843       FT_NONE, BASE_NONE, NULL, 0,
27844       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
27845
27846     {&hf_ieee80211_rsn_akms,
27847      {"Auth Key Management (AKM) Suite", "wlan.rsn.akms",
27848       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_akms_base_custom), 0,
27849       NULL, HFILL }},
27850
27851     {&hf_ieee80211_rsn_akms_oui,
27852      {"Auth Key Management (AKM) OUI", "wlan.rsn.akms.oui",
27853       FT_UINT24, BASE_OUI, NULL, 0,
27854       NULL, HFILL }},
27855
27856     {&hf_ieee80211_rsn_akms_type,
27857      {"Auth Key Management (AKM) type", "wlan.rsn.akms.type",
27858       FT_UINT8, BASE_DEC, NULL, 0,
27859       NULL, HFILL }},
27860
27861     {&hf_ieee80211_rsn_akms_80211_type,
27862      {"Auth Key Management (AKM) type", "wlan.rsn.akms.type",
27863       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_keymgmt_vals), 0,
27864       NULL, HFILL }},
27865
27866     {&hf_ieee80211_rsn_cap,
27867      {"RSN Capabilities", "wlan.rsn.capabilities",
27868       FT_UINT16, BASE_HEX, NULL, 0,
27869       "RSN Capability information", HFILL }},
27870
27871     {&hf_ieee80211_rsn_cap_preauth,
27872      {"RSN Pre-Auth capabilities", "wlan.rsn.capabilities.preauth",
27873       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001,
27874       NULL, HFILL }},
27875
27876     {&hf_ieee80211_rsn_cap_no_pairwise,
27877      {"RSN No Pairwise capabilities", "wlan.rsn.capabilities.no_pairwise",
27878       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002,
27879       NULL, HFILL }},
27880
27881     {&hf_ieee80211_rsn_cap_ptksa_replay_counter,
27882      {"RSN PTKSA Replay Counter capabilities", "wlan.rsn.capabilities.ptksa_replay_counter",
27883       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C,
27884       NULL, HFILL }},
27885
27886     {&hf_ieee80211_rsn_cap_gtksa_replay_counter,
27887      {"RSN GTKSA Replay Counter capabilities", "wlan.rsn.capabilities.gtksa_replay_counter",
27888       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030,
27889       NULL, HFILL }},
27890
27891     {&hf_ieee80211_rsn_cap_mfpr,
27892      {"Management Frame Protection Required", "wlan.rsn.capabilities.mfpr",
27893       FT_BOOLEAN, 16, NULL, 0x0040,
27894       NULL, HFILL }},
27895
27896     {&hf_ieee80211_rsn_cap_mfpc,
27897      {"Management Frame Protection Capable", "wlan.rsn.capabilities.mfpc",
27898       FT_BOOLEAN, 16, NULL, 0x0080,
27899       NULL, HFILL }},
27900
27901     {&hf_ieee80211_rsn_cap_jmr,
27902      {"Joint Multi-band RSNA", "wlan.rsn.capabilities.jmr",
27903       FT_BOOLEAN, 16, NULL, 0x0100,
27904       NULL, HFILL }},
27905
27906     {&hf_ieee80211_rsn_cap_peerkey,
27907      {"PeerKey Enabled", "wlan.rsn.capabilities.peerkey",
27908       FT_BOOLEAN, 16, NULL, 0x0200,
27909       NULL, HFILL }},
27910
27911     {&hf_ieee80211_rsn_pmkid_count,
27912      {"PMKID Count", "wlan.rsn.pmkid.count",
27913       FT_UINT16, BASE_DEC, NULL, 0,
27914       "Indicates the number of PMKID  selectors that are contained in the PMKID Suite List", HFILL }},
27915
27916     {&hf_ieee80211_rsn_pmkid_list,
27917      {"PMKID List", "wlan.rsn.pmkid.list",
27918       FT_NONE, BASE_NONE, NULL, 0,
27919       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
27920
27921     {&hf_ieee80211_rsn_pmkid,
27922      {"PMKID", "wlan.pmkid.akms",
27923       FT_BYTES, BASE_NONE, NULL, 0,
27924       NULL, HFILL }},
27925
27926     {&hf_ieee80211_rsn_gmcs,
27927      {"Group Management Cipher Suite", "wlan.rsn.gmcs",
27928       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gmcs_base_custom), 0,
27929       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
27930
27931     {&hf_ieee80211_rsn_gmcs_oui,
27932      {"Group Management Cipher Suite OUI", "wlan.rsn.gmcs.oui",
27933       FT_UINT24, BASE_OUI, NULL, 0,
27934       NULL, HFILL }},
27935
27936     {&hf_ieee80211_rsn_gmcs_type,
27937      {"Group Management Cipher Suite type", "wlan.rsn.gmcs.type",
27938       FT_UINT8, BASE_DEC, NULL, 0,
27939       NULL, HFILL }},
27940
27941     {&hf_ieee80211_rsn_gmcs_80211_type,
27942      {"Group Management Cipher Suite type", "wlan.rsn.gmcs.type",
27943       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
27944       NULL, HFILL }},
27945
27946     {&hf_ieee80211_ht_pren_type,
27947      {"802.11n (Pre) Type", "wlan.vs.pren.type",
27948       FT_UINT8, BASE_DEC, VALS(ieee80211_ht_pren_type_vals), 0,
27949       "Vendor Specific HT Type", HFILL }},
27950     {&hf_ieee80211_ht_pren_unknown,
27951      {"802.11n (Pre) Unknown Data", "wlan.vs.pren.unknown_data",
27952       FT_BYTES, BASE_NONE, NULL, 0,
27953       NULL, HFILL }},
27954
27955     {&hf_ieee80211_ht_cap,
27956      {"HT Capabilities Info", "wlan.ht.capabilities",
27957       FT_UINT16, BASE_HEX, NULL, 0,
27958       "HT Capabilities information", HFILL }},
27959
27960     {&hf_ieee80211_ht_vs_cap,
27961      {"HT Capabilities Info (VS)", "wlan.vs.ht.capabilities",
27962       FT_UINT16, BASE_HEX, NULL, 0,
27963       "Vendor Specific HT Capabilities information", HFILL }},
27964
27965     {&hf_ieee80211_ht_ldpc_coding,
27966      {"HT LDPC coding capability", "wlan.ht.capabilities.ldpccoding",
27967       FT_BOOLEAN, 16, TFS(&ht_ldpc_coding_flag), 0x0001,
27968       NULL, HFILL }},
27969
27970     {&hf_ieee80211_ht_chan_width,
27971      {"HT Support channel width", "wlan.ht.capabilities.width",
27972       FT_BOOLEAN, 16, TFS(&ht_chan_width_flag), 0x0002,
27973       NULL, HFILL }},
27974
27975     {&hf_ieee80211_ht_sm_pwsave,
27976      {"HT SM Power Save", "wlan.ht.capabilities.sm",
27977       FT_UINT16, BASE_HEX, VALS(ht_sm_pwsave_flag), 0x000c,
27978       NULL, HFILL }},
27979
27980     {&hf_ieee80211_ht_green,
27981      {"HT Green Field", "wlan.ht.capabilities.green",
27982       FT_BOOLEAN, 16, TFS(&ht_green_flag), 0x0010,
27983       NULL, HFILL }},
27984
27985     {&hf_ieee80211_ht_short20,
27986      {"HT Short GI for 20MHz", "wlan.ht.capabilities.short20",
27987       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0020,
27988       NULL, HFILL }},
27989
27990     {&hf_ieee80211_ht_short40,
27991      {"HT Short GI for 40MHz", "wlan.ht.capabilities.short40",
27992       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040,
27993       NULL, HFILL }},
27994
27995     {&hf_ieee80211_ht_tx_stbc,
27996      {"HT Tx STBC", "wlan.ht.capabilities.txstbc",
27997       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080,
27998       NULL, HFILL }},
27999
28000     {&hf_ieee80211_ht_rx_stbc,
28001      {"HT Rx STBC", "wlan.ht.capabilities.rxstbc",
28002       FT_UINT16, BASE_HEX, VALS(ht_rx_stbc_flag), 0x0300,
28003       "HT Tx STBC", HFILL }},
28004
28005     {&hf_ieee80211_ht_delayed_block_ack,
28006      {"HT Delayed Block ACK", "wlan.ht.capabilities.delayedblockack",
28007       FT_BOOLEAN, 16, TFS(&ht_delayed_block_ack_flag), 0x0400,
28008       NULL, HFILL }},
28009
28010     {&hf_ieee80211_ht_max_amsdu,
28011      {"HT Max A-MSDU length", "wlan.ht.capabilities.amsdu",
28012       FT_BOOLEAN, 16, TFS(&ht_max_amsdu_flag), 0x0800,
28013       NULL, HFILL }},
28014
28015     {&hf_ieee80211_ht_dss_cck_40,
28016      {"HT DSSS/CCK mode in 40MHz", "wlan.ht.capabilities.dsscck",
28017       FT_BOOLEAN, 16, TFS(&ht_dss_cck_40_flag), 0x1000,
28018       "HT DSS/CCK mode in 40MHz", HFILL }},
28019
28020     {&hf_ieee80211_ht_psmp,
28021      {"HT PSMP Support", "wlan.ht.capabilities.psmp",
28022       FT_BOOLEAN, 16, TFS(&ht_psmp_flag), 0x2000,
28023       NULL, HFILL }},
28024
28025     {&hf_ieee80211_ht_40_mhz_intolerant,
28026      {"HT Forty MHz Intolerant", "wlan.ht.capabilities.40mhzintolerant",
28027       FT_BOOLEAN, 16, TFS(&ht_40_mhz_intolerant_flag), 0x4000,
28028       NULL, HFILL }},
28029
28030     {&hf_ieee80211_ht_l_sig,
28031      {"HT L-SIG TXOP Protection support", "wlan.ht.capabilities.lsig",
28032       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000,
28033       NULL, HFILL }},
28034
28035     {&hf_ieee80211_ext_bss_mu_mimo_capable_sta_count,
28036      {"MU-MIMO Capable STA Count", "wlan.ext_bss.mu_mimo_capable_sta_count",
28037       FT_UINT16, BASE_DEC, NULL, 0,
28038       NULL, HFILL }},
28039
28040     {&hf_ieee80211_ext_bss_ss_underutilization,
28041      {"Spatial Stream Underutilization", "wlan.ext_bss.ss_underutilization",
28042       FT_UINT8, BASE_HEX, NULL, 0,
28043       NULL, HFILL }},
28044
28045     {&hf_ieee80211_ext_bss_observable_sec_20mhz_utilization,
28046      {"Observable Secondary 20MHz Utilization", "wlan.ext_bss.observable_sec_20mhz_utilization",
28047       FT_UINT8, BASE_HEX, NULL, 0,
28048       NULL, HFILL }},
28049
28050     {&hf_ieee80211_ext_bss_observable_sec_40mhz_utilization,
28051      {"Observable Secondary 40MHz Utilization", "wlan.ext_bss.observable_sec_40mhz_utilization",
28052       FT_UINT8, BASE_HEX, NULL, 0,
28053       NULL, HFILL }},
28054
28055     {&hf_ieee80211_ext_bss_observable_sec_80mhz_utilization,
28056      {"Observable Secondary 80MHz Utilization", "wlan.ext_bss.observable_sec_80mhz_utilization",
28057       FT_UINT8, BASE_HEX, NULL, 0,
28058       NULL, HFILL }},
28059
28060     {&hf_ieee80211_wide_bw_new_channel_width,
28061      {"New Channel Width", "wlan.wide_bw.new_channel_width",
28062       FT_UINT8, BASE_HEX, VALS(vht_operation_info_channel_width), 0x0,
28063       NULL, HFILL }},
28064
28065     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment0,
28066      {"New Channel Center Frequency Segment 0", "wlan.wide_bw.new_channel_center_freq_segment0",
28067       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
28068       NULL, HFILL }},
28069
28070     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment1,
28071      {"New Channel Center Frequency Segment 1", "wlan.wide_bw.new_channel_center_freq_segment1",
28072       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
28073       NULL, HFILL }},
28074
28075     {&hf_ieee80211_operat_notification_mode,
28076      {"Operating Mode Notification", "wlan.operat_notification_mode",
28077       FT_UINT8, BASE_HEX, NULL, 0x0,
28078       NULL, HFILL }},
28079
28080     {&hf_ieee80211_operat_mode_field_channel_width,
28081      {"Channel Width", "wlan.operat_mode_field.channelwidth",
28082       FT_UINT8, BASE_HEX, VALS(operating_mode_field_channel_width), 0x03,
28083       NULL, HFILL }},
28084
28085     {&hf_ieee80211_operat_mode_field_reserved,
28086      {"Reserved", "wlan.operat_mode_field.reserved",
28087       FT_UINT8, BASE_HEX, NULL, 0x0C,
28088       NULL, HFILL }},
28089
28090     {&hf_ieee80211_operat_mode_field_rxnss,
28091      {"Rx NSS", "wlan.operat_mode_field.rxnss",
28092       FT_UINT8, BASE_HEX, VALS(operat_mode_field_rxnss), 0x70,
28093       NULL, HFILL }},
28094
28095     {&hf_ieee80211_operat_mode_field_rxnsstype,
28096      {"Rx NSS Type", "wlan.operat_mode_field.rxnsstype",
28097       FT_UINT8, BASE_HEX, NULL, 0x80,
28098       "Indicate that the Rx NSS subfield carries the maximum number of spatial streams that the STA can receive", HFILL }},
28099
28100     {&hf_ieee80211_ampduparam,
28101      {"A-MPDU Parameters", "wlan.ht.ampduparam",
28102       FT_UINT8, BASE_HEX, NULL, 0,
28103       NULL, HFILL }},
28104
28105     {&hf_ieee80211_ampduparam_vs,
28106      {"A-MPDU Parameters (VS)", "wlan.vs.ht.ampduparam",
28107       FT_UINT8, BASE_HEX, NULL, 0,
28108       "Vendor Specific A-MPDU Parameters", HFILL }},
28109
28110     {&hf_ieee80211_ampduparam_mpdu,
28111      {"Maximum Rx A-MPDU Length", "wlan.ht.ampduparam.maxlength",
28112       FT_UINT8, BASE_HEX, 0, 0x03,
28113       NULL, HFILL }},
28114
28115     {&hf_ieee80211_ampduparam_mpdu_start_spacing,
28116      {"MPDU Density", "wlan.ht.ampduparam.mpdudensity",
28117       FT_UINT8, BASE_HEX, VALS(ampduparam_mpdu_start_spacing_flags), 0x1c,
28118       NULL, HFILL }},
28119
28120     {&hf_ieee80211_ampduparam_reserved,
28121      {"Reserved", "wlan.ht.ampduparam.reserved",
28122       FT_UINT8, BASE_HEX, NULL, 0xE0,
28123       NULL, HFILL }},
28124
28125     {&hf_ieee80211_mcsset,
28126      {"Rx Supported Modulation and Coding Scheme Set", "wlan.ht.mcsset",
28127       FT_STRING, BASE_NONE, NULL, 0,
28128       NULL, HFILL }},
28129
28130     {&hf_ieee80211_mcsset_vs,
28131      {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan.vs.ht.mcsset",
28132       FT_STRING, BASE_NONE, NULL, 0,
28133       "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
28134
28135     {&hf_ieee80211_mcsset_rx_bitmask,
28136      {"Rx Modulation and Coding Scheme (One bit per modulation)", "wlan.ht.mcsset.rxbitmask",
28137       FT_NONE, BASE_NONE, NULL, 0,
28138       "One bit per modulation", HFILL }},
28139
28140     {&hf_ieee80211_mcsset_rx_bitmask_0to7,
28141      {"Rx Bitmask Bits 0-7", "wlan.ht.mcsset.rxbitmask.0to7",
28142       FT_UINT32, BASE_HEX, 0, 0x000000ff,
28143       NULL, HFILL }},
28144
28145     {&hf_ieee80211_mcsset_rx_bitmask_8to15,
28146      {"Rx Bitmask Bits 8-15", "wlan.ht.mcsset.rxbitmask.8to15",
28147       FT_UINT32, BASE_HEX, 0, 0x0000ff00,
28148       NULL, HFILL }},
28149
28150     {&hf_ieee80211_mcsset_rx_bitmask_16to23,
28151      {"Rx Bitmask Bits 16-23", "wlan.ht.mcsset.rxbitmask.16to23",
28152       FT_UINT32, BASE_HEX, 0, 0x00ff0000,
28153       NULL, HFILL }},
28154
28155     {&hf_ieee80211_mcsset_rx_bitmask_24to31,
28156      {"Rx Bitmask Bits 24-31", "wlan.ht.mcsset.rxbitmask.24to31",
28157       FT_UINT32, BASE_HEX, 0, 0xff000000,
28158       NULL, HFILL }},
28159
28160     {&hf_ieee80211_mcsset_rx_bitmask_32,
28161      {"Rx Bitmask Bit 32", "wlan.ht.mcsset.rxbitmask.32",
28162       FT_UINT32, BASE_HEX, 0, 0x000001,
28163       NULL, HFILL }},
28164
28165     {&hf_ieee80211_mcsset_rx_bitmask_33to38,
28166      {"Rx Bitmask Bits 33-38", "wlan.ht.mcsset.rxbitmask.33to38",
28167       FT_UINT32, BASE_HEX, 0, 0x00007e,
28168       NULL, HFILL }},
28169
28170     {&hf_ieee80211_mcsset_rx_bitmask_39to52,
28171      {"Rx Bitmask Bits 39-52", "wlan.ht.mcsset.rxbitmask.39to52",
28172       FT_UINT32, BASE_HEX, 0, 0x1fff80,
28173       NULL, HFILL }},
28174
28175     {&hf_ieee80211_mcsset_rx_bitmask_53to76,
28176      {"Rx Bitmask Bits 53-76", "wlan.ht.mcsset.rxbitmask.53to76",
28177       FT_UINT32, BASE_HEX, 0, 0x1fffffe0,
28178       NULL, HFILL }},
28179
28180     {&hf_ieee80211_mcsset_highest_data_rate,
28181      {"Highest Supported Data Rate", "wlan.ht.mcsset.highestdatarate",
28182       FT_UINT16, BASE_HEX, 0, 0x03ff,
28183       NULL, HFILL }},
28184
28185     {&hf_ieee80211_mcsset_tx_mcs_set_defined,
28186      {"Tx Supported MCS Set", "wlan.ht.mcsset.txsetdefined",
28187       FT_BOOLEAN, 16, TFS(&tfs_defined_not_defined), 0x0001,
28188       NULL, HFILL }},
28189
28190     {&hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal,
28191      {"Tx and Rx MCS Set", "wlan.ht.mcsset.txrxmcsnotequal",
28192       FT_BOOLEAN, 16, TFS(&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
28193       NULL, HFILL }},
28194
28195     {&hf_ieee80211_mcsset_tx_max_spatial_streams,
28196      {"Maximum Number of Tx Spatial Streams Supported", "wlan.ht.mcsset.txmaxss",
28197       FT_UINT16, BASE_HEX, 0 , 0x000c,
28198       NULL, HFILL }},
28199
28200     {&hf_ieee80211_mcsset_tx_unequal_modulation,
28201      {"Unequal Modulation", "wlan.ht.mcsset.txunequalmod",
28202       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0010,
28203       NULL, HFILL }},
28204
28205     {&hf_ieee80211_htex_cap,
28206      {"HT Extended Capabilities", "wlan.htex.capabilities",
28207       FT_UINT16, BASE_HEX, NULL, 0,
28208       "HT Extended Capability information", HFILL }},
28209
28210     {&hf_ieee80211_htex_vs_cap,
28211      {"HT Extended Capabilities (VS)", "wlan.vs.htex.capabilities",
28212       FT_UINT16, BASE_HEX, NULL, 0,
28213       "Vendor Specific HT Extended Capability information", HFILL }},
28214
28215     {&hf_ieee80211_htex_pco,
28216      {"Transmitter supports PCO", "wlan.htex.capabilities.pco",
28217       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
28218       NULL, HFILL }},
28219
28220     {&hf_ieee80211_htex_transtime,
28221      {"Time needed to transition between 20MHz and 40MHz", "wlan.htex.capabilities.transtime",
28222       FT_UINT16, BASE_HEX, VALS(htex_transtime_flags), 0x0006,
28223       NULL, HFILL }},
28224
28225     {&hf_ieee80211_htex_mcs,
28226      {"MCS Feedback capability", "wlan.htex.capabilities.mcs",
28227       FT_UINT16, BASE_HEX, VALS(htex_mcs_flags), 0x0300,
28228       NULL, HFILL }},
28229
28230     {&hf_ieee80211_htex_htc_support,
28231      {"High Throughput", "wlan.htex.capabilities.htc",
28232       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400,
28233       NULL, HFILL }},
28234
28235     {&hf_ieee80211_htex_rd_responder,
28236      {"Reverse Direction Responder", "wlan.htex.capabilities.rdresponder",
28237       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800,
28238       NULL, HFILL }},
28239
28240     {&hf_ieee80211_txbf,
28241      {"Transmit Beam Forming (TxBF) Capabilities", "wlan.txbf",
28242       FT_UINT32, BASE_HEX, NULL, 0,
28243       NULL, HFILL }},
28244
28245     {&hf_ieee80211_txbf_vs,
28246      {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan.vs.txbf",
28247       FT_UINT32, BASE_HEX, NULL, 0,
28248       "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
28249
28250     {&hf_ieee80211_txbf_cap,
28251      {"Transmit Beamforming", "wlan.txbf.txbf",
28252       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
28253       NULL, HFILL }},
28254
28255     {&hf_ieee80211_txbf_rcv_ssc,
28256      {"Receive Staggered Sounding", "wlan.txbf.rxss",
28257       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
28258       NULL, HFILL }},
28259
28260     {&hf_ieee80211_txbf_tx_ssc,
28261      {"Transmit Staggered Sounding", "wlan.txbf.txss",
28262       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
28263       NULL, HFILL }},
28264
28265     {&hf_ieee80211_txbf_rcv_ndp,
28266      {"Receive Null Data packet (NDP)", "wlan.txbf.rxndp",
28267       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
28268       NULL, HFILL }},
28269
28270     {&hf_ieee80211_txbf_tx_ndp,
28271      {"Transmit Null Data packet (NDP)", "wlan.txbf.txndp",
28272       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
28273       NULL, HFILL }},
28274
28275     {&hf_ieee80211_txbf_impl_txbf,
28276      {"Implicit TxBF capable", "wlan.txbf.impltxbf",
28277       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
28278       "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
28279
28280     {&hf_ieee80211_txbf_calib,
28281      {"Calibration", "wlan.txbf.calibration",
28282       FT_UINT32, BASE_HEX, VALS(txbf_calib_flag), 0x000000c0,
28283       NULL, HFILL }},
28284
28285     {&hf_ieee80211_txbf_expl_csi,
28286      {"STA can apply TxBF using CSI explicit feedback", "wlan.txbf.csi",
28287       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
28288       "Station can apply TxBF using CSI explicit feedback", HFILL }},
28289
28290     {&hf_ieee80211_txbf_expl_uncomp_fm,
28291      {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan.txbf.fm.uncompressed.tbf",
28292       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
28293       "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
28294
28295     {&hf_ieee80211_txbf_expl_comp_fm,
28296      {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan.txbf.fm.compressed.tbf",
28297       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
28298       "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
28299
28300     {&hf_ieee80211_txbf_expl_bf_csi,
28301      {"Receiver can return explicit CSI feedback", "wlan.txbf.rcsi",
28302       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00001800,
28303       NULL, HFILL }},
28304
28305     {&hf_ieee80211_txbf_expl_uncomp_fm_feed,
28306      {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan.txbf.fm.uncompressed.rbf",
28307       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00006000,
28308       NULL, HFILL }},
28309
28310     {&hf_ieee80211_txbf_expl_comp_fm_feed,
28311      {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan.txbf.fm.compressed.bf",
28312       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00018000,
28313       "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
28314
28315     {&hf_ieee80211_txbf_min_group,
28316      {"Minimal grouping used for explicit feedback reports", "wlan.txbf.mingroup",
28317       FT_UINT32, BASE_HEX, VALS(txbf_min_group_flags), 0x00060000,
28318       NULL, HFILL }},
28319
28320     {&hf_ieee80211_vht_cap,
28321      {"VHT Capabilities Info", "wlan.vht.capabilities",
28322       FT_UINT32, BASE_HEX, NULL, 0,
28323       "VHT Capabilities information", HFILL }},
28324
28325     {&hf_ieee80211_vht_max_mpdu_length,
28326      {"Maximum MPDU Length", "wlan.vht.capabilities.maxmpdulength",
28327       FT_UINT32, BASE_HEX, VALS(vht_max_mpdu_length_flag), 0x00000003,
28328       "In Octets unit", HFILL }},
28329
28330     {&hf_ieee80211_vht_supported_chan_width_set,
28331      {"Supported Channel Width Set", "wlan.vht.capabilities.supportedchanwidthset",
28332       FT_UINT32, BASE_HEX, VALS(vht_supported_chan_width_set_flag), 0x0000000c,
28333       NULL, HFILL }},
28334
28335     {&hf_ieee80211_vht_rx_ldpc,
28336      {"Rx LDPC", "wlan.vht.capabilities.rxldpc",
28337       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
28338       NULL, HFILL }},
28339
28340     {&hf_ieee80211_vht_short_gi_for_80,
28341      {"Short GI for 80MHz/TVHT_MODE_4C", "wlan.vht.capabilities.short80",
28342       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
28343       NULL, HFILL }},
28344
28345     {&hf_ieee80211_vht_short_gi_for_160,
28346      {"Short GI for 160MHz and 80+80MHz", "wlan.vht.capabilities.short160",
28347       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
28348       NULL, HFILL }},
28349
28350     {&hf_ieee80211_vht_tx_stbc,
28351      {"Tx STBC", "wlan.vht.capabilities.txstbc",
28352       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
28353       NULL, HFILL }},
28354
28355     {&hf_ieee80211_vht_rx_stbc,
28356      {"Rx STBC", "wlan.vht.capabilities.rxstbc",
28357       FT_UINT32, BASE_HEX, VALS(vht_rx_stbc_flag), 0x00000700,
28358       NULL, HFILL }},
28359
28360     {&hf_ieee80211_vht_su_beamformer_cap,
28361      {"SU Beamformer Capable", "wlan.vht.capabilities.subeamformer",
28362       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
28363       NULL, HFILL }},
28364
28365     {&hf_ieee80211_vht_su_beamformee_cap,
28366      {"SU Beamformee Capable", "wlan.vht.capabilities.subeamformee",
28367       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
28368       NULL, HFILL }},
28369
28370     {&hf_ieee80211_vht_beamformer_antennas,
28371      {"Beamformee STS Capability", "wlan.vht.capabilities.beamformee_sts_cap",
28372       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x0000e000,
28373       NULL, HFILL }},
28374
28375     {&hf_ieee80211_vht_sounding_dimensions,
28376      {"Number of Sounding Dimensions", "wlan.vht.capabilities.soundingdimensions",
28377       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x00070000,
28378       NULL, HFILL }},
28379
28380     {&hf_ieee80211_vht_mu_beamformer_cap,
28381      {"MU Beamformer Capable", "wlan.vht.capabilities.mubeamformer",
28382       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
28383       NULL, HFILL }},
28384
28385     {&hf_ieee80211_vht_mu_beamformee_cap,
28386      {"MU Beamformee Capable", "wlan.vht.capabilities.mubeamformee",
28387       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
28388       NULL, HFILL }},
28389
28390     {&hf_ieee80211_vht_txop_ps,
28391      {"TXOP PS", "wlan.vht.capabilities.vhttxopps",
28392       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
28393       NULL, HFILL }},
28394
28395     {&hf_ieee80211_vht_var_htc_field,
28396      {"+HTC-VHT Capable", "wlan.vht.capabilities.vhthtc",
28397       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
28398       NULL, HFILL }},
28399
28400     {&hf_ieee80211_vht_max_ampdu,
28401      {"Max A-MPDU Length Exponent", "wlan.vht.capabilities.maxampdu",
28402       FT_UINT32, BASE_HEX, VALS(vht_max_ampdu_flag), 0x03800000,
28403       "In Octets unit", HFILL }},
28404
28405     {&hf_ieee80211_vht_link_adaptation_cap,
28406      {"VHT Link Adaptation", "wlan.vht.capabilities.linkadapt",
28407       FT_UINT32, BASE_HEX, VALS(vht_link_adapt_flag), 0x0c000000,
28408       NULL, HFILL }},
28409
28410     {&hf_ieee80211_vht_rx_pattern,
28411      {"Rx Antenna Pattern Consistency", "wlan.vht.capabilities.rxpatconsist",
28412       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x10000000,
28413       NULL, HFILL }},
28414
28415     {&hf_ieee80211_vht_tx_pattern,
28416      {"Tx Antenna Pattern Consistency", "wlan.vht.capabilities.txpatconsist",
28417       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x20000000,
28418       NULL, HFILL }},
28419
28420     {&hf_ieee80211_vht_ext_nss_bw_support,
28421      {"Extended NSS BW Support", "wlan.vht.capabilities.ext_nss_bw_support",
28422       FT_UINT32, BASE_HEX, NULL, 0xc0000000,
28423       NULL, HFILL }},
28424
28425     {&hf_ieee80211_vht_mcsset,
28426      {"VHT Supported MCS Set", "wlan.vht.mcsset",
28427       FT_NONE, BASE_NONE, NULL, 0,
28428       NULL, HFILL }},
28429
28430     {&hf_ieee80211_vht_mcsset_rx_mcs_map,
28431      {"Rx MCS Map", "wlan.vht.mcsset.rxmcsmap",
28432       FT_UINT16, BASE_HEX, NULL, 0,
28433       NULL, HFILL }},
28434
28435     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
28436      {"Rx 1 SS", "wlan.vht.mcsset.rxmcsmap.ss1",
28437       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
28438       NULL, HFILL }},
28439
28440     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
28441      {"Rx 2 SS", "wlan.vht.mcsset.rxmcsmap.ss2",
28442       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
28443       NULL, HFILL }},
28444
28445     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
28446      {"Rx 3 SS", "wlan.vht.mcsset.rxmcsmap.ss3",
28447       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
28448       NULL, HFILL }},
28449
28450     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
28451      {"Rx 4 SS", "wlan.vht.mcsset.rxmcsmap.ss4",
28452       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
28453       NULL, HFILL }},
28454
28455     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
28456      {"Rx 5 SS", "wlan.vht.mcsset.rxmcsmap.ss5",
28457       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
28458       NULL, HFILL }},
28459
28460     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
28461      {"Rx 6 SS", "wlan.vht.mcsset.rxmcsmap.ss6",
28462       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
28463       NULL, HFILL }},
28464
28465     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
28466      {"Rx 7 SS", "wlan.vht.mcsset.rxmcsmap.ss7",
28467       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
28468       NULL, HFILL }},
28469
28470     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
28471      {"Rx 8 SS", "wlan.vht.mcsset.rxmcsmap.ss8",
28472       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
28473       NULL, HFILL }},
28474
28475     {&hf_ieee80211_vht_mcsset_max_nsts_total,
28476      {"MaX NSTS Total", "wlan.vht.mcsset.max_nsts_total",
28477       FT_UINT16, BASE_DEC, NULL, 0xe000, NULL, HFILL }},
28478
28479     {&hf_ieee80211_vht_mcsset_rx_highest_long_gi,
28480      {"Rx Highest Long GI Data Rate (in Mb/s, 0 = subfield not in use)", "wlan.vht.mcsset.rxhighestlonggirate",
28481       FT_UINT16, BASE_HEX, NULL, 0x1fff,
28482       NULL, HFILL }},
28483
28484     {&hf_ieee80211_vht_mcsset_tx_mcs_map,
28485      {"Tx MCS Map", "wlan.vht.mcsset.txmcsmap",
28486       FT_UINT16, BASE_HEX, NULL, 0,
28487       NULL, HFILL }},
28488
28489     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
28490      {"Tx 1 SS", "wlan.vht.mcsset.txmcsmap.ss1",
28491       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
28492       NULL, HFILL }},
28493
28494     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
28495      {"Tx 2 SS", "wlan.vht.mcsset.txmcsmap.ss2",
28496       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
28497       NULL, HFILL }},
28498
28499     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
28500      {"Tx 3 SS", "wlan.vht.mcsset.txmcsmap.ss3",
28501       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
28502       NULL, HFILL }},
28503
28504     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
28505      {"Tx 4 SS", "wlan.vht.mcsset.txmcsmap.ss4",
28506       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
28507       NULL, HFILL }},
28508
28509     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
28510      {"Tx 5 SS", "wlan.vht.mcsset.txmcsmap.ss5",
28511       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
28512       NULL, HFILL }},
28513
28514     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
28515      {"Tx 6 SS", "wlan.vht.mcsset.txmcsmap.ss6",
28516       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
28517       NULL, HFILL }},
28518
28519     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
28520      {"Tx 7 SS", "wlan.vht.mcsset.txmcsmap.ss7",
28521       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
28522       NULL, HFILL }},
28523
28524     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
28525      {"Tx 8 SS", "wlan.vht.mcsset.txmcsmap.ss8",
28526       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
28527       NULL, HFILL }},
28528
28529     {&hf_ieee80211_vht_mcsset_tx_highest_long_gi,
28530      {"Tx Highest Long GI Data Rate  (in Mb/s, 0 = subfield not in use)", "wlan.vht.mcsset.txhighestlonggirate",
28531       FT_UINT16, BASE_HEX, NULL, 0x1fff,
28532       NULL, HFILL }},
28533
28534     {&hf_ieee80211_vht_mcsset_ext_nss_bw_cap,
28535      {"Extended NSS BW Capable", "wlan.vht.ncsset.ext_nss_bw_cap",
28536       FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x2000, NULL, HFILL }},
28537
28538     {&hf_ieee80211_vht_mcsset_reserved,
28539      {"Reserved", "wlan.vht.ncsset.reserved",
28540       FT_UINT16, BASE_HEX, NULL, 0xc000, NULL, HFILL }},
28541
28542     {&hf_ieee80211_vht_op,
28543      {"VHT Operation Info", "wlan.vht.op",
28544       FT_NONE, BASE_NONE, NULL, 0,
28545       NULL, HFILL }},
28546
28547     {&hf_ieee80211_vht_op_channel_width,
28548      {"Channel Width", "wlan.vht.op.channelwidth",
28549       FT_UINT8, BASE_HEX, VALS(vht_op_channel_width_flag), 0,
28550       NULL, HFILL }},
28551
28552     {&hf_ieee80211_vht_op_channel_center0,
28553      {"Channel Center Segment 0", "wlan.vht.op.channelcenter0",
28554       FT_UINT8, BASE_DEC, NULL, 0,
28555       NULL, HFILL }},
28556
28557     {&hf_ieee80211_vht_op_channel_center1,
28558      {"Channel Center Segment 1", "wlan.vht.op.channelcenter1",
28559       FT_UINT8, BASE_DEC, NULL, 0,
28560       NULL, HFILL }},
28561
28562     {&hf_ieee80211_vht_op_basic_mcs_map,
28563      {"Basic MCS Map", "wlan.vht.op.basicmcsmap",
28564       FT_UINT16, BASE_HEX, NULL, 0,
28565       NULL, HFILL }},
28566
28567     {&hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
28568      {"Basic 1 SS", "wlan.vht.op.basicmcsmap.ss1",
28569       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
28570       NULL, HFILL }},
28571
28572     {&hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
28573      {"Basic 2 SS", "wlan.vht.op.basicmcsmap.ss2",
28574       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
28575       NULL, HFILL }},
28576
28577     {&hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
28578      {"Basic 3 SS", "wlan.vht.op.basicmcsmap.ss3",
28579       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
28580       NULL, HFILL }},
28581
28582     {&hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
28583      {"Basic 4 SS", "wlan.vht.op.basicmcsmap.ss4",
28584       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
28585       NULL, HFILL }},
28586
28587     {&hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
28588      {"Basic 5 SS", "wlan.vht.op.basicmcsmap.ss5",
28589       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
28590       NULL, HFILL }},
28591
28592     {&hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
28593      {"Basic 6 SS", "wlan.vht.op.basicmcsmap.ss6",
28594       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
28595       NULL, HFILL }},
28596
28597     {&hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
28598      {"Basic 7 SS", "wlan.vht.op.basicmcsmap.ss7",
28599       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
28600       NULL, HFILL }},
28601
28602     {&hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
28603      {"Basic 8 SS", "wlan.vht.op.basicmcsmap.ss8",
28604       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
28605       NULL, HFILL }},
28606
28607     {&hf_ieee80211_vht_tpe_pwr_info,
28608      {"Tx Pwr Info", "wlan.vht.tpe.pwr_info",
28609       FT_UINT8, BASE_HEX, NULL, 0,
28610       NULL, HFILL }},
28611
28612     {&hf_ieee80211_vht_tpe_pwr_info_count,
28613      {"Max Tx Pwr Count", "wlan.vht.tpe.pwr_info.count",
28614       FT_UINT8, BASE_DEC, NULL , 0x07,
28615       NULL, HFILL }},
28616
28617     {&hf_ieee80211_vht_tpe_pwr_info_unit,
28618      {"Max Tx Pwr Unit Interpretation", "wlan.vht.tpe.pwr_info.unit",
28619       FT_UINT8, BASE_DEC, VALS(vht_tpe_pwr_units) , 0x38,
28620       NULL, HFILL }},
28621
28622     {&hf_ieee80211_vht_tpe_pwr_info_reserved,
28623      {"Reserved", "wlan.vht.tpe.pwr_info.reserved",
28624       FT_UINT8, BASE_DEC, NULL , 0xC0,
28625       NULL, HFILL }},
28626
28627     {&hf_ieee80211_vht_tpe_pwr_constr_20,
28628      {"Local Max Tx Pwr Constraint 20MHz", "wlan.vht.tpe.pwr_constr_20",
28629       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
28630       NULL, HFILL }},
28631
28632     {&hf_ieee80211_vht_tpe_pwr_constr_40,
28633      {"Local Max Tx Pwr Constraint 40MHz", "wlan.vht.tpe.pwr_constr_40",
28634       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
28635       NULL, HFILL }},
28636
28637     {&hf_ieee80211_vht_tpe_pwr_constr_80,
28638      {"Local Max Tx Pwr Constraint 80MHz", "wlan.vht.tpe.pwr_constr_80",
28639       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
28640       NULL, HFILL }},
28641
28642     {&hf_ieee80211_vht_tpe_pwr_constr_160,
28643      {"Local Max Tx Pwr Constraint 160MHz/80+80 MHz", "wlan.vht.tpe.pwr_constr_160",
28644       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
28645       NULL, HFILL }},
28646
28647     {&hf_ieee80211_txbf_csi_num_bf_ant,
28648      {"Max antennae STA can support when CSI feedback required", "wlan.txbf.csinumant",
28649       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00180000,
28650       "Max antennae station can support when CSI feedback required", HFILL }},
28651
28652     {&hf_ieee80211_txbf_uncomp_sm_bf_ant,
28653      {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan.txbf.fm.uncompressed.maxant",
28654       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00600000,
28655       "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
28656
28657     {&hf_ieee80211_txbf_comp_sm_bf_ant,
28658      {"Max antennae STA can support when compressed Beamforming feedback required", "wlan.txbf.fm.compressed.maxant",
28659       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x01800000,
28660       "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
28661
28662     {&hf_ieee80211_txbf_csi_max_rows_bf,
28663      {"Maximum number of rows of CSI explicit feedback", "wlan.txbf.csi.maxrows",
28664       FT_UINT32, BASE_HEX, VALS(txbf_csi_max_rows_bf_flags), 0x06000000,
28665       NULL, HFILL }},
28666
28667     {&hf_ieee80211_txbf_chan_est,
28668      {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan.txbf.channelest",
28669       FT_UINT32, BASE_HEX, VALS(txbf_chan_est_flags), 0x18000000,
28670       NULL, HFILL }},
28671
28672     {&hf_ieee80211_txbf_resrv,
28673      {"Reserved", "wlan.txbf.reserved",
28674       FT_UINT32, BASE_HEX, NULL, 0xe0000000,
28675       NULL, HFILL }},
28676
28677     {&hf_ieee80211_hta_cc,
28678      {"HT Control Channel", "wlan.hta.control_channel",
28679       FT_UINT8, BASE_DEC, NULL, 0,
28680       NULL, HFILL }},
28681
28682     {&hf_ieee80211_hta_cap1,
28683      {"HT Additional Capabilities", "wlan.hta.capabilities",
28684       FT_UINT8, BASE_HEX, NULL, 0,
28685       "HT Additional Capability information", HFILL }},
28686
28687     {&hf_ieee80211_hta_cap2,
28688      {"HT Additional Capabilities", "wlan.hta.capabilities",
28689       FT_UINT16, BASE_HEX, NULL, 0,
28690       "HT Additional Capability information", HFILL }},
28691
28692     {&hf_ieee80211_hta_ext_chan_offset,
28693      {"Extension Channel Offset", "wlan.hta.capabilities.ext_chan_offset",
28694       FT_UINT16, BASE_HEX, VALS(hta_ext_chan_offset_flag), 0x0003,
28695       NULL, HFILL }},
28696
28697     {&hf_ieee80211_hta_rec_tx_width,
28698      {"Recommended Tx Channel Width", "wlan.hta.capabilities.rec_tx_width",
28699       FT_BOOLEAN, 16, TFS(&hta_rec_tx_width_flag), 0x0004,
28700       "Recommended Transmit Channel Width", HFILL }},
28701
28702     {&hf_ieee80211_hta_rifs_mode,
28703      {"Reduced Interframe Spacing (RIFS) Mode", "wlan.hta.capabilities.rifs_mode",
28704       FT_BOOLEAN, 16, TFS(&hta_rifs_mode_flag), 0x0008,
28705       NULL, HFILL }},
28706
28707     {&hf_ieee80211_hta_controlled_access,
28708      {"Controlled Access Only", "wlan.hta.capabilities.controlled_access",
28709       FT_BOOLEAN, 16, TFS(&hta_controlled_access_flag), 0x0010,
28710       NULL, HFILL }},
28711
28712     {&hf_ieee80211_hta_service_interval,
28713      {"Service Interval Granularity", "wlan.hta.capabilities.service_interval",
28714       FT_UINT16, BASE_HEX, VALS(hta_service_interval_flag), 0x00E0,
28715       NULL, HFILL }},
28716
28717     {&hf_ieee80211_hta_operating_mode,
28718      {"Operating Mode", "wlan.hta.capabilities.operating_mode",
28719       FT_UINT16, BASE_HEX, VALS(hta_operating_mode_flag), 0x0003,
28720       NULL, HFILL }},
28721
28722     {&hf_ieee80211_hta_non_gf_devices,
28723      {"Non Greenfield (GF) devices Present", "wlan.hta.capabilities.non_gf_devices",
28724       FT_BOOLEAN, 16, TFS(&hta_non_gf_devices_flag), 0x0004,
28725       "on Greenfield (GF) devices Present", HFILL }},
28726
28727     {&hf_ieee80211_hta_basic_stbc_mcs,
28728      {"Basic STB Modulation and Coding Scheme (MCS)", "wlan.hta.capabilities.basic_stbc_mcs",
28729       FT_UINT16, BASE_HEX, NULL , 0x007f,
28730       NULL, HFILL }},
28731
28732     {&hf_ieee80211_hta_dual_stbc_protection,
28733      {"Dual Clear To Send (CTS) Protection", "wlan.hta.capabilities.dual_stbc_protection",
28734       FT_BOOLEAN, 16, TFS(&hta_dual_stbc_protection_flag), 0x0080,
28735       NULL, HFILL }},
28736
28737     {&hf_ieee80211_hta_secondary_beacon,
28738      {"Secondary Beacon", "wlan.hta.capabilities.secondary_beacon",
28739       FT_BOOLEAN, 16, TFS(&hta_secondary_beacon_flag), 0x0100,
28740       NULL, HFILL }},
28741
28742     {&hf_ieee80211_hta_lsig_txop_protection,
28743      {"L-SIG TXOP Protection Support", "wlan.hta.capabilities.lsig_txop_protection",
28744       FT_BOOLEAN, 16, TFS(&hta_lsig_txop_protection_flag), 0x0200,
28745       NULL, HFILL }},
28746
28747     {&hf_ieee80211_hta_pco_active,
28748      {"Phased Coexistence Operation (PCO) Active", "wlan.hta.capabilities.pco_active",
28749       FT_BOOLEAN, 16, TFS(&hta_pco_active_flag), 0x0400,
28750       NULL, HFILL }},
28751
28752     {&hf_ieee80211_hta_pco_phase,
28753      {"Phased Coexistence Operation (PCO) Phase", "wlan.hta.capabilities.pco_phase",
28754       FT_BOOLEAN, 16, TFS(&hta_pco_phase_flag), 0x0800,
28755       NULL, HFILL }},
28756
28757     {&hf_ieee80211_antsel,
28758      {"Antenna Selection (ASEL) Capabilities", "wlan.asel",
28759       FT_UINT8, BASE_HEX, NULL, 0,
28760       NULL, HFILL }},
28761
28762     {&hf_ieee80211_antsel_vs,
28763      {"Antenna Selection (ASEL) Capabilities (VS)", "wlan.vs.asel",
28764       FT_UINT8, BASE_HEX, NULL, 0,
28765       "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
28766
28767     {&hf_ieee80211_antsel_b0,
28768      {"Antenna Selection Capable", "wlan.asel.capable",
28769       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
28770       NULL, HFILL }},
28771
28772     {&hf_ieee80211_antsel_b1,
28773      {"Explicit CSI Feedback Based Tx ASEL", "wlan.asel.txcsi",
28774       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
28775       NULL, HFILL }},
28776
28777     {&hf_ieee80211_antsel_b2,
28778      {"Antenna Indices Feedback Based Tx ASEL", "wlan.asel.txif",
28779       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
28780       NULL, HFILL }},
28781
28782     {&hf_ieee80211_antsel_b3,
28783      {"Explicit CSI Feedback", "wlan.asel.csi",
28784       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
28785       NULL, HFILL }},
28786
28787     {&hf_ieee80211_antsel_b4,
28788      {"Antenna Indices Feedback", "wlan.asel.if",
28789       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
28790       NULL, HFILL }},
28791
28792     {&hf_ieee80211_antsel_b5,
28793      {"Rx ASEL", "wlan.asel.rx",
28794       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
28795       NULL, HFILL }},
28796
28797     {&hf_ieee80211_antsel_b6,
28798      {"Tx Sounding PPDUs", "wlan.asel.sppdu",
28799       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
28800       NULL, HFILL }},
28801
28802     {&hf_ieee80211_antsel_b7,
28803      {"Reserved", "wlan.asel.reserved",
28804       FT_UINT8, BASE_HEX, NULL, 0x80,
28805       NULL, HFILL }},
28806
28807     {&hf_ieee80211_ht_info_delimiter1,
28808      {"HT Information Subset (1 of 3)", "wlan.ht.info.delim1",
28809       FT_UINT8, BASE_HEX, NULL, 0,
28810       NULL, HFILL }},
28811
28812     {&hf_ieee80211_ht_info_primary_channel,
28813      {"Primary Channel", "wlan.ht.info.primarychannel",
28814       FT_UINT8, BASE_DEC, NULL, 0,
28815       NULL, HFILL }},
28816
28817     {&hf_ieee80211_ht_info_secondary_channel_offset,
28818      {"Secondary channel offset", "wlan.ht.info.secchanoffset",
28819       FT_UINT8, BASE_HEX, VALS(ht_info_secondary_channel_offset_flags), 0x03,
28820       NULL, HFILL }},
28821
28822     {&hf_ieee80211_ht_info_sta_channel_width,
28823      {"Supported channel width", "wlan.ht.info.chanwidth",
28824       FT_BOOLEAN, 8, TFS(&ht_info_channel_sta_width_flag), 0x04,
28825       NULL, HFILL }},
28826
28827     {&hf_ieee80211_ht_info_rifs_mode,
28828      {"Reduced Interframe Spacing (RIFS)", "wlan.ht.info.rifs",
28829       FT_BOOLEAN, 8, TFS(&ht_info_rifs_mode_flag), 0x08,
28830       NULL, HFILL }},
28831
28832     {&hf_ieee80211_ht_info_reserved_b4_b7,
28833      {"Reserved", "wlan.ht.info.reserved_b4_b7",
28834       FT_UINT8, BASE_HEX, NULL, 0xf0, NULL, HFILL }},
28835
28836     {&hf_ieee80211_ht_info_delimiter2,
28837      {"HT Information Subset (2 of 3)", "wlan.ht.info.delim2",
28838       FT_UINT16, BASE_HEX, NULL, 0,
28839       NULL, HFILL }},
28840
28841     {&hf_ieee80211_ht_info_protection,
28842      {"HT Protection", "wlan.ht.info.ht_protection",
28843       FT_UINT16, BASE_HEX, VALS(ht_info_operating_protection_mode_flags), 0x0003,
28844       NULL, HFILL }},
28845
28846     {&hf_ieee80211_ht_info_non_greenfield_sta_present,
28847      {"Non-greenfield STAs present", "wlan.ht.info.greenfield",
28848       FT_BOOLEAN, 16, TFS(&ht_info_non_greenfield_sta_present_flag), 0x0004,
28849       NULL, HFILL }},
28850
28851     {&hf_ieee80211_ht_info_reserved_b11,
28852      {"Reserved", "wlan.ht.info.reserved_b11",
28853       FT_UINT16, BASE_HEX, NULL, 0x0008, NULL, HFILL }},
28854
28855     {&hf_ieee80211_ht_info_obss_non_ht_stas_present,
28856      {"OBSS non-HT STAs present", "wlan.ht.info.obssnonht",
28857       FT_BOOLEAN, 16, TFS(&ht_info_obss_non_ht_stas_present_flag), 0x0010,
28858       NULL, HFILL }},
28859
28860     {&hf_ieee80211_ht_info_channel_center_freq_seg_2,
28861      {"Channel Center Frequency Segment 2", "wlan.ht.info.chan_center_freq_seg_2",
28862       FT_UINT16, BASE_DEC, NULL, 0x1fe0, NULL, HFILL }},
28863
28864     {&hf_ieee80211_ht_info_reserved_b21_b23,
28865      {"Reserved", "wlan.ht.info.reserved_b21_b23",
28866       FT_UINT16, BASE_HEX, NULL, 0xe000,
28867       NULL, HFILL }},
28868
28869     {&hf_ieee80211_ht_info_delimiter3,
28870      {"HT Information Subset (3 of 3)", "wlan.ht.info.delim3",
28871       FT_UINT16, BASE_HEX, NULL, 0,
28872       NULL, HFILL }},
28873
28874     {&hf_ieee80211_ht_info_reserved_b24_b29,
28875      {"Reserved", "wlan.ht.info.reserved_b24_b29",
28876       FT_UINT16, BASE_HEX, NULL, 0x003f, NULL, HFILL }},
28877
28878     {&hf_ieee80211_ht_info_dual_beacon,
28879      {"Dual beacon", "wlan.ht.info.dualbeacon",
28880       FT_BOOLEAN, 16, TFS(&ht_info_dual_beacon_flag), 0x0040,
28881       NULL, HFILL }},
28882
28883     {&hf_ieee80211_ht_info_dual_cts_protection,
28884      {"Dual Clear To Send (CTS) protection", "wlan.ht.info.dualcts",
28885       FT_BOOLEAN, 16, TFS(&tfs_required_not_required), 0x0080,
28886       NULL, HFILL }},
28887
28888     {&hf_ieee80211_ht_info_secondary_beacon,
28889      {"Beacon ID", "wlan.ht.info.secondarybeacon",
28890       FT_BOOLEAN, 16, TFS(&ht_info_secondary_beacon_flag), 0x0100,
28891       NULL, HFILL }},
28892
28893     {&hf_ieee80211_ht_info_lsig_txop_protection_full_support,
28894      {"L-SIG TXOP Protection Full Support", "wlan.ht.info.lsigprotsupport",
28895       FT_BOOLEAN, 16, TFS(&ht_info_lsig_txop_protection_full_support_flag), 0x0200,
28896       NULL, HFILL }},
28897
28898     {&hf_ieee80211_ht_info_pco_active,
28899      {"Phased Coexistence Operation (PCO)", "wlan.ht.info.pco.active",
28900       FT_BOOLEAN, 16, TFS(&tfs_active_inactive), 0x0400,
28901       NULL, HFILL }},
28902
28903     {&hf_ieee80211_ht_info_pco_phase,
28904      {"Phased Coexistence Operation (PCO) Phase", "wlan.ht.info.pco.phase",
28905       FT_BOOLEAN, 16, TFS(&ht_info_pco_phase_flag), 0x0800,
28906       NULL, HFILL }},
28907
28908     {&hf_ieee80211_ht_info_reserved_b36_b39,
28909      {"Reserved", "wlan.ht.info.reserved_b36_b39",
28910       FT_UINT16, BASE_HEX, NULL, 0xf000,
28911       NULL, HFILL }},
28912
28913     {&hf_ieee80211_tag_ap_channel_report_operating_class,
28914      {"Operating Class", "wlan.ap_channel_report.operating_class",
28915       FT_UINT8, BASE_DEC, NULL, 0,
28916       NULL, HFILL }},
28917
28918     {&hf_ieee80211_tag_ap_channel_report_channel_list,
28919      {"Channel List", "wlan.ap_channel_report.channel_list",
28920       FT_UINT8, BASE_DEC, NULL, 0,
28921       NULL, HFILL }},
28922
28923     {&hf_ieee80211_tag_secondary_channel_offset,
28924      {"Secondary Channel Offset", "wlan.secchanoffset",
28925       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_secondary_channel_offset_flags), 0,
28926       NULL, HFILL }},
28927
28928     {&hf_ieee80211_tag_bss_ap_avg_access_delay,
28929      {"AP Average Access Delay", "wlan.bss_ap_avg_access_delay",
28930       FT_UINT8, BASE_DEC, NULL, 0x0,
28931       NULL, HFILL }},
28932
28933     {&hf_ieee80211_tag_antenna_id,
28934      {"Antenna ID", "wlan.antenna.id",
28935       FT_UINT8, BASE_DEC, NULL, 0x0,
28936       NULL, HFILL }},
28937
28938     {&hf_ieee80211_tag_rsni,
28939      {"RSNI", "wlan.rsni",
28940       FT_UINT8, BASE_CUSTOM, CF_FUNC(rsni_base_custom), 0x0,
28941       NULL, HFILL }},
28942
28943     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
28944      {"Available Admission Capacity Bitmask", "wlan.bss_avb_adm_cap.bitmask",
28945       FT_UINT16, BASE_HEX, NULL, 0,
28946       NULL, HFILL }},
28947     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
28948      {"UP0 (bit0)", "wlan.bss_avb_adm_cap.bitmask.up0",
28949       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP0,
28950       NULL, HFILL }},
28951     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
28952      {"UP1 (bit1)", "wlan.bss_avb_adm_cap.bitmask.up1",
28953       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP1,
28954       NULL, HFILL }},
28955     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
28956      {"UP2 (bit2)", "wlan.bss_avb_adm_cap.bitmask.up2",
28957       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP2,
28958       NULL, HFILL }},
28959     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
28960      {"UP3 (bit3)", "wlan.bss_avb_adm_cap.bitmask.up3",
28961       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP3,
28962       NULL, HFILL }},
28963     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
28964      {"UP4 (bit4)", "wlan.bss_avb_adm_cap.bitmask.up4",
28965       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP4,
28966       NULL, HFILL }},
28967     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
28968      {"UP5 (bit5)", "wlan.bss_avb_adm_cap.bitmask.up5",
28969       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP5,
28970       NULL, HFILL }},
28971     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
28972      {"UP0 (bit6)", "wlan.bss_avb_adm_cap.bitmask.up6",
28973       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP6,
28974       NULL, HFILL }},
28975     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
28976      {"UP7 (bit7)", "wlan.bss_avb_adm_cap.bitmask.up7",
28977       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP7,
28978       NULL, HFILL }},
28979     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
28980      {"AC0 (bit8)", "wlan.bss_avb_adm_cap.bitmask.ac0",
28981       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC0,
28982       NULL, HFILL }},
28983     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
28984      {"AC1 (bit9)", "wlan.bss_avb_adm_cap.bitmask.AC1",
28985       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC1,
28986       NULL, HFILL }},
28987     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
28988      {"AC2 (bit10)", "wlan.bss_avb_adm_cap.bitmask.ac2",
28989       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC2,
28990       NULL, HFILL }},
28991     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
28992      {"AC3 (bit11)", "wlan.bss_avb_adm_cap.bitmask.ac3",
28993       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC3,
28994       NULL, HFILL }},
28995     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
28996      {"Reserved", "wlan.bss_avb_adm_cap.bitmask.rsv",
28997       FT_UINT16, BASE_HEX, NULL, BSS_BITMASK_RSV,
28998       NULL, HFILL }},
28999     {&hf_ieee80211_tag_bss_avb_adm_cap_up0,
29000      {"UP0", "wlan.bss_avb_adm_cap.up0",
29001       FT_UINT16, BASE_DEC, NULL, 0x0,
29002       NULL, HFILL }},
29003     {&hf_ieee80211_tag_bss_avb_adm_cap_up1,
29004      {"UP1", "wlan.bss_avb_adm_cap.up1",
29005       FT_UINT16, BASE_DEC, NULL, 0x0,
29006       NULL, HFILL }},
29007     {&hf_ieee80211_tag_bss_avb_adm_cap_up2,
29008      {"UP2", "wlan.bss_avb_adm_cap.up2",
29009       FT_UINT16, BASE_DEC, NULL, 0x0,
29010       NULL, HFILL }},
29011     {&hf_ieee80211_tag_bss_avb_adm_cap_up3,
29012      {"UP3", "wlan.bss_avb_adm_cap.up3",
29013       FT_UINT16, BASE_DEC, NULL, 0x0,
29014       NULL, HFILL }},
29015     {&hf_ieee80211_tag_bss_avb_adm_cap_up4,
29016      {"UP4", "wlan.bss_avb_adm_cap.up4",
29017       FT_UINT16, BASE_DEC, NULL, 0x0,
29018       NULL, HFILL }},
29019     {&hf_ieee80211_tag_bss_avb_adm_cap_up5,
29020      {"UP5", "wlan.bss_avb_adm_cap.up5",
29021       FT_UINT16, BASE_DEC, NULL, 0x0,
29022       NULL, HFILL }},
29023     {&hf_ieee80211_tag_bss_avb_adm_cap_up6,
29024      {"UP6", "wlan.bss_avb_adm_cap.up6",
29025       FT_UINT16, BASE_DEC, NULL, 0x0,
29026       NULL, HFILL }},
29027     {&hf_ieee80211_tag_bss_avb_adm_cap_up7,
29028      {"UP7", "wlan.bss_avb_adm_cap.up7",
29029       FT_UINT16, BASE_DEC, NULL, 0x0,
29030       NULL, HFILL }},
29031     {&hf_ieee80211_tag_bss_avb_adm_cap_ac0,
29032      {"AC0", "wlan.bss_avb_adm_cap.ac0",
29033       FT_UINT16, BASE_DEC, NULL, 0x0,
29034       NULL, HFILL }},
29035     {&hf_ieee80211_tag_bss_avb_adm_cap_ac1,
29036      {"AC1", "wlan.bss_avb_adm_cap.ac1",
29037       FT_UINT16, BASE_DEC, NULL, 0x0,
29038       NULL, HFILL }},
29039     {&hf_ieee80211_tag_bss_avb_adm_cap_ac2,
29040      {"AC2", "wlan.bss_avb_adm_cap.ac2",
29041       FT_UINT16, BASE_DEC, NULL, 0x0,
29042       NULL, HFILL }},
29043     {&hf_ieee80211_tag_bss_avb_adm_cap_ac3,
29044      {"AC3", "wlan.bss_avb_adm_cap.ac3",
29045       FT_UINT16, BASE_DEC, NULL, 0x0,
29046       NULL, HFILL }},
29047
29048     {&hf_ieee80211_tag_bss_avg_ac_access_delay_be,
29049      {"AC Average Access Delay for Best Effort", "wlan.bss_avg_ac_access_delay.be",
29050       FT_UINT8, BASE_DEC, NULL, 0x0,
29051       NULL, HFILL }},
29052     {&hf_ieee80211_tag_bss_avg_ac_access_delay_bk,
29053      {"AC Average Access Delay for Best Background", "wlan.bss_avg_ac_access_delay.bk",
29054       FT_UINT8, BASE_DEC, NULL, 0x0,
29055       NULL, HFILL }},
29056     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vi,
29057      {"AC Average Access Delay for Video", "wlan.bss_avg_ac_access_delay_vi",
29058       FT_UINT8, BASE_DEC, NULL, 0x0,
29059       NULL, HFILL }},
29060     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vo,
29061      {"AC Average Access Delay for Voice", "wlan.bss_avg_ac_access_delay_vo",
29062       FT_UINT8, BASE_DEC, NULL, 0x0,
29063       NULL, HFILL }},
29064
29065
29066     /* 802.11-2012 Table 8-119-RM Enabled Capabilities definition */
29067     {&hf_ieee80211_tag_rm_enabled_capabilities,
29068      {"RM Capabilities", "wlan.rmcap",
29069       FT_UINT8, BASE_HEX, NULL, 0,
29070       "Signals support for radio measurements in a device", HFILL }},
29071
29072     /* RM Enabled Capability octet 1 */
29073     {&hf_ieee80211_tag_rm_enabled_capabilities_b0,
29074      {"Link Measurement", "wlan.rmcap.b0",
29075       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29076       NULL, HFILL }},
29077     {&hf_ieee80211_tag_rm_enabled_capabilities_b1,
29078      {"Neighbor Report", "wlan.rmcap.b1",
29079       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29080       NULL, HFILL }},
29081     {&hf_ieee80211_tag_rm_enabled_capabilities_b2,
29082      {"Parallel Measurements", "wlan.rmcap.b2",
29083       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
29084       NULL, HFILL }},
29085     {&hf_ieee80211_tag_rm_enabled_capabilities_b3,
29086      {"Repeated Measurements", "wlan.rmcap.b3",
29087       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
29088       NULL, HFILL }},
29089     {&hf_ieee80211_tag_rm_enabled_capabilities_b4,
29090      {"Beacon Passive Measurement", "wlan.rmcap.b4",
29091       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
29092       NULL, HFILL }},
29093     {&hf_ieee80211_tag_rm_enabled_capabilities_b5,
29094      {"Beacon Active Measurement", "wlan.rmcap.b5",
29095       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
29096       NULL, HFILL }},
29097     {&hf_ieee80211_tag_rm_enabled_capabilities_b6,
29098      {"Beacon Table Measurement", "wlan.rmcap.b6",
29099       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29100       NULL, HFILL }},
29101     {&hf_ieee80211_tag_rm_enabled_capabilities_b7,
29102      {"Beacon Measurement Reporting Conditions", "wlan.rmcap.b7",
29103       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
29104       NULL, HFILL }},
29105
29106     /* RM Enabled Capability octet 2 */
29107     {&hf_ieee80211_tag_rm_enabled_capabilities_b8,
29108      {"Frame Measurement", "wlan.rmcap.b8",
29109       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29110       NULL, HFILL }},
29111     {&hf_ieee80211_tag_rm_enabled_capabilities_b9,
29112      {"Channel Load Measurement", "wlan.rmcap.b9",
29113       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29114       NULL, HFILL }},
29115     {&hf_ieee80211_tag_rm_enabled_capabilities_b10,
29116      {"Noise Histogram Measurement", "wlan.rmcap.b10",
29117       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
29118       NULL, HFILL }},
29119     {&hf_ieee80211_tag_rm_enabled_capabilities_b11,
29120      {"Statistics Measurement", "wlan.rmcap.b11",
29121       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
29122       NULL, HFILL }},
29123     {&hf_ieee80211_tag_rm_enabled_capabilities_b12,
29124      {"LCI Measurement", "wlan.rmcap.b12",
29125       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
29126       NULL, HFILL }},
29127     {&hf_ieee80211_tag_rm_enabled_capabilities_b13,
29128      {"LCI Azimuth capability", "wlan.rmcap.b13",
29129       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
29130       NULL, HFILL }},
29131     {&hf_ieee80211_tag_rm_enabled_capabilities_b14,
29132      {"Transmit Stream/Category Measurement", "wlan.rmcap.b14",
29133       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29134       NULL, HFILL }},
29135     {&hf_ieee80211_tag_rm_enabled_capabilities_b15,
29136      {"Triggered Transmit Stream/Category Measurement", "wlan.rmcap.b15",
29137       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
29138       NULL, HFILL }},
29139
29140     /* RM Enabled Capability octet 3 */
29141     {&hf_ieee80211_tag_rm_enabled_capabilities_b16,
29142      {"AP Channel Report capability", "wlan.rmcap.b16",
29143       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29144       NULL, HFILL }},
29145     {&hf_ieee80211_tag_rm_enabled_capabilities_b17,
29146      {"RM MIB capability", "wlan.rmcap.b17",
29147       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29148       NULL, HFILL }},
29149     {&hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
29150      {"Operating Channel Max Measurement Duration", "wlan.rmcap.b18to20",
29151       FT_UINT8, BASE_DEC, NULL, 0x1C,
29152       NULL, HFILL }},
29153     {&hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
29154      {"Nonoperating Channel Max Measurement Duration", "wlan.rmcap.b21to23",
29155       FT_UINT8, BASE_DEC, NULL, 0xE0,
29156       NULL, HFILL }},
29157
29158     /* RM Enabled Capability octet 4 */
29159     {&hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
29160      {"Measurement Pilotcapability", "wlan.rmcap.b24to26",
29161       FT_UINT8, BASE_DEC, NULL, 0x07,
29162       NULL, HFILL }},
29163     {&hf_ieee80211_tag_rm_enabled_capabilities_b27,
29164      {"Measurement Pilot Transmission Information", "wlan.rmcap.b27",
29165       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
29166       NULL, HFILL }},
29167     {&hf_ieee80211_tag_rm_enabled_capabilities_b28,
29168      {"Neighbor Report TSF Offset", "wlan.rmcap.b28",
29169       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
29170       NULL, HFILL }},
29171     {&hf_ieee80211_tag_rm_enabled_capabilities_b29,
29172      {"RCPI Measurement capability", "wlan.rmcap.b29",
29173       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
29174       NULL, HFILL }},
29175     {&hf_ieee80211_tag_rm_enabled_capabilities_b30,
29176      {"RSNI Measurement capability", "wlan.rmcap.b30",
29177       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29178       NULL, HFILL }},
29179     {&hf_ieee80211_tag_rm_enabled_capabilities_b31,
29180      {"BSS Average Access Delay capability", "wlan.rmcap.b31",
29181       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
29182       NULL, HFILL }},
29183
29184     /* RM Enabled Capability octet 5 */
29185     {&hf_ieee80211_tag_rm_enabled_capabilities_b32,
29186      {"BSS Available Admission Capacity capability", "wlan.rmcap.b32",
29187       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29188       NULL, HFILL }},
29189     {&hf_ieee80211_tag_rm_enabled_capabilities_b33,
29190      {"Antenna capability", "wlan.rmcap.b33",
29191       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29192       NULL, HFILL }},
29193     {&hf_ieee80211_tag_rm_enabled_capabilities_o5,
29194      {"Reserved", "wlan.rmcap.o5",
29195       FT_UINT8, BASE_HEX, NULL, 0xFC,
29196       "Must be zero", HFILL }},
29197
29198     /* 20/40 BSS Coexistence */
29199     {&hf_ieee80211_tag_20_40_bc,
29200      {"20/40 BSS Coexistence Flags", "wlan.20_40_bc",
29201       FT_UINT8, BASE_HEX, NULL, 0x0,
29202       NULL, HFILL }},
29203     {&hf_ieee80211_tag_20_40_bc_information_request,
29204      {"Information Request", "wlan.20_40_bc.information_request",
29205       FT_BOOLEAN, 8, NULL, 0x01,
29206       NULL, HFILL }},
29207     {&hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant,
29208      {"Forty MHz Intolerant", "wlan.20_40_bc.forty_mhz_intolerant",
29209       FT_BOOLEAN, 8, NULL, 0x02,
29210       NULL, HFILL }},
29211     {&hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request,
29212      {"20 MHz BSS Witdh Request", "wlan.20_40_bc.20_mhz_bss_witdh_request",
29213       FT_BOOLEAN, 8, NULL, 0x04,
29214       NULL, HFILL }},
29215     {&hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request,
29216      {"OBSS Scanning Exemption Request", "wlan.20_40_bc.obss_scanning_exemption_request",
29217       FT_BOOLEAN, 8, NULL, 0x08,
29218       NULL, HFILL }},
29219     {&hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant,
29220      {"OBSS Scanning Exemption Grant", "wlan.20_40_bc.obss_scanning_exemption_grant",
29221       FT_BOOLEAN, 8, NULL, 0x10,
29222       NULL, HFILL }},
29223     {&hf_ieee80211_tag_20_40_bc_reserved,
29224      {"Reserved", "wlan.20_40_bc.reserved",
29225       FT_UINT8, BASE_HEX, NULL, 0xE0,
29226       "Must be zero", HFILL }},
29227
29228
29229     {&hf_ieee80211_tag_power_constraint_local,
29230      {"Local Power Constraint", "wlan.powercon.local",
29231       FT_UINT8, BASE_DEC, NULL, 0,
29232       "Value that allows the mitigation requirements to be satisfied in the current channel", HFILL }},
29233
29234     {&hf_ieee80211_tag_power_capability_min,
29235      {"Minimum Transmit Power", "wlan.powercap.min",
29236       FT_INT8, BASE_DEC, NULL, 0,
29237       "The nominal minimum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
29238
29239     {&hf_ieee80211_tag_power_capability_max,
29240      {"Maximum Transmit Power", "wlan.powercap.max",
29241       FT_INT8, BASE_DEC, NULL, 0,
29242       "The nominal maximum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
29243
29244     {&hf_ieee80211_tag_tpc_report_trsmt_pow,
29245      {"Transmit Power", "wlan.tcprep.trsmt_pow",
29246       FT_INT8, BASE_DEC, NULL, 0,
29247       NULL, HFILL }},
29248
29249     {&hf_ieee80211_tag_tpc_report_link_mrg,
29250      {"Link Margin", "wlan.tcprep.link_mrg",
29251       FT_INT8, BASE_DEC, NULL, 0,
29252       NULL, HFILL }},
29253
29254     {&hf_ieee80211_tag_supported_channels,
29255      {"Supported Channels Set", "wlan.supchan",
29256       FT_NONE, BASE_NONE, NULL, 0,
29257       NULL, HFILL }},
29258
29259     {&hf_ieee80211_tag_supported_channels_first,
29260      {"First Supported Channel", "wlan.supchan.first",
29261       FT_UINT8, BASE_DEC, NULL, 0,
29262       NULL, HFILL }},
29263
29264     {&hf_ieee80211_tag_supported_channels_range,
29265      {"Supported Channel Range", "wlan.supchan.range",
29266       FT_UINT8, BASE_DEC, NULL, 0,
29267       NULL, HFILL }},
29268
29269     {&hf_ieee80211_csa_channel_switch_mode,
29270      {"Channel Switch Mode", "wlan.csa.channel_switch_mode",
29271       FT_UINT8, BASE_HEX, NULL, 0,
29272       "Indicates any restrictions on transmission until a channel switch", HFILL }},
29273
29274     {&hf_ieee80211_csa_new_channel_number,
29275      {"New Channel Number", "wlan.csa.new_channel_number",
29276       FT_UINT8, BASE_HEX, NULL, 0,
29277       "Set to the number of the channel to which the STA is moving", HFILL }},
29278
29279     {&hf_ieee80211_csa_channel_switch_count,
29280      {"Channel Switch Count", "wlan.csa.channel_switch.count",
29281       FT_UINT8, BASE_DEC, NULL, 0,
29282       "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 }},
29283
29284     {&hf_ieee80211_mesh_channel_switch_ttl,
29285      {"Mesh Channel Switch TTL", "wlan.csa.mesh_channel_switch.ttl",
29286       FT_UINT8, BASE_DEC, NULL, 0,
29287       NULL, HFILL }},
29288
29289     {&hf_ieee80211_mesh_channel_switch_flag,
29290      {"Mesh Channel Switch Flag", "wlan.csa.mesh_channel_switch.flag",
29291       FT_UINT8, BASE_HEX, NULL, 0,
29292       NULL, HFILL }},
29293
29294     {&hf_ieee80211_mesh_chswitch_flag_txrestrict,
29295      {"CSA Tx Restrict", "wlan.csa.mesh_channel_switch.flag.txrestrict",
29296       FT_BOOLEAN, 16, TFS(&csa_txrestrict_flags), 0x0001,
29297       NULL, HFILL }},
29298
29299     {&hf_ieee80211_mesh_chswitch_flag_initiator,
29300      {"CSA Initiator", "wlan.csa.mesh_channel_switch.flag.initiator",
29301       FT_BOOLEAN, 16, TFS(&csa_initiator_flags), 0x0002,
29302       NULL, HFILL }},
29303
29304     {&hf_ieee80211_mesh_channel_switch_reason_code,
29305      {"Mesh Channel Switch Reason Code", "wlan.csa.mesh_channel_switch.reason_code",
29306       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
29307       NULL, HFILL }},
29308
29309     {&hf_ieee80211_mesh_channel_switch_precedence_value,
29310      {"Mesh Channel Switch Precedence Value", "wlan.csa.mesh_channel_switch.pre_value",
29311       FT_UINT16, BASE_DEC, NULL, 0,
29312       NULL, HFILL }},
29313
29314     {&hf_ieee80211_mesh_awake_window,
29315      {"Mesh Awake Window", "wlan.mesh.mesh_awake_window",
29316       FT_UINT16, BASE_CUSTOM, CF_FUNC(mesh_active_window_base_custom), 0,
29317       NULL, HFILL }},
29318
29319     {&hf_ieee80211_tag_measure_request_token,
29320      {"Measurement Token", "wlan.measure.req.token",
29321       FT_UINT8, BASE_HEX, NULL, 0xff,
29322       NULL, HFILL }},
29323
29324     {&hf_ieee80211_tag_measure_request_mode,
29325      {"Measurement Request Mode", "wlan.measure.req.mode",
29326       FT_UINT8, BASE_HEX, NULL, 0xff,
29327       NULL, HFILL }},
29328
29329     {&hf_ieee80211_tag_measure_request_mode_parallel,
29330      {"Parallel", "wlan.measure.req.reqmode.parallel",
29331       FT_BOOLEAN, 8, NULL, 0x01,
29332       NULL, HFILL }},
29333
29334     {&hf_ieee80211_tag_measure_request_mode_enable,
29335      {"Measurement Request Mode Field", "wlan.measure.req.reqmode.enable",
29336       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
29337       NULL, HFILL }},
29338
29339     {&hf_ieee80211_tag_measure_request_mode_request,
29340      {"Measurement Reports", "wlan.measure.req.reqmode.request",
29341       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x04,
29342       NULL, HFILL }},
29343
29344     {&hf_ieee80211_tag_measure_request_mode_report,
29345      {"Autonomous Measurement Reports", "wlan.measure.req.reqmode.report",
29346       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x08,
29347       NULL, HFILL }},
29348
29349     {&hf_ieee80211_tag_measure_request_mode_duration_mandatory,
29350      {"Duration Mandatory", "wlan.measure.req.reqmode.duration_mandatory",
29351       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x10,
29352       NULL, HFILL }},
29353
29354     {&hf_ieee80211_tag_measure_request_mode_reserved,
29355      {"Reserved", "wlan.measure.req.reqmode.reserved",
29356       FT_UINT8, BASE_HEX, NULL, 0xE0,
29357       NULL, HFILL }},
29358
29359     {&hf_ieee80211_tag_measure_request_type,
29360      {"Measurement Request Type", "wlan.measure.req.reqtype",
29361       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_type_flags_ext, 0x00,
29362       NULL, HFILL }},
29363
29364     {&hf_ieee80211_tag_measure_request_channel_number,
29365      {"Measurement Channel Number", "wlan.measure.req.channelnumber",
29366       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
29367       NULL, HFILL }},
29368
29369     {&hf_ieee80211_tag_measure_request_start_time,
29370      {"Measurement Start Time", "wlan.measure.req.starttime",
29371       FT_UINT64, BASE_HEX, NULL, 0,
29372       NULL, HFILL }},
29373
29374     {&hf_ieee80211_tag_measure_request_duration,
29375      {"Measurement Duration", "wlan.measure.req.channelnumber",
29376       FT_UINT16, BASE_HEX, NULL, 0,
29377       "in TU (1 TU = 1024 us)", HFILL }},
29378
29379     {&hf_ieee80211_tag_measure_request_operating_class,
29380      {"Operating Class", "wlan.measure.req.operatingclass",
29381       FT_UINT8, BASE_DEC, NULL, 0,
29382       NULL, HFILL }},
29383
29384     {&hf_ieee80211_tag_measure_request_randomization_interval,
29385      {"Randomization Interval", "wlan.measure.req.randint",
29386       FT_UINT16, BASE_HEX, NULL, 0,
29387       "in TU (1 TU = 1024 us)", HFILL }},
29388
29389     {&hf_ieee80211_tag_measure_request_measurement_mode,
29390      {"Measurement Mode", "wlan.measure.req.measurementmode",
29391       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_measurement_mode_flags), 0,
29392       NULL, HFILL }},
29393
29394     {&hf_ieee80211_tag_measure_request_bssid,
29395      {"BSSID", "wlan.measure.req.bssid",
29396       FT_ETHER, BASE_NONE, NULL, 0,
29397       NULL, HFILL }},
29398
29399     {&hf_ieee80211_tag_measure_request_subelement_length,
29400      {"Length", "wlan.measure.req.sub.length",
29401       FT_UINT8, BASE_DEC, NULL, 0,
29402       NULL, HFILL }},
29403
29404     {&hf_ieee80211_tag_measure_request_beacon_sub_id,
29405      {"SubElement ID", "wlan.measure.req.beacon.sub.id",
29406       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_beacon_sub_id_flags), 0,
29407       NULL, HFILL }},
29408
29409     {&hf_ieee80211_tag_measure_request_beacon_sub_ssid,
29410      {"SSID", "wlan.measure.req.beacon.sub.ssid",
29411       FT_STRING, BASE_NONE, 0, 0,
29412       NULL, HFILL }},
29413
29414     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition,
29415      {"Reporting Condition", "wlan.measure.req.beacon.sub.bri.repcond",
29416       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags), 0,
29417       NULL, HFILL }},
29418
29419     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset,
29420      {"Threshold/Offset", "wlan.measure.req.beacon.sub.bri.threshold_offset",
29421       FT_UINT8, BASE_HEX, NULL, 0,
29422       NULL, HFILL }},
29423
29424     {&hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail,
29425      {"Reporting Detail", "wlan.measure.req.beacon.sub.bri.reporting_detail",
29426       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags), 0,
29427       NULL, HFILL }},
29428
29429     {&hf_ieee80211_tag_measure_request_beacon_sub_request,
29430      {"Request", "wlan.measure.req.beacon.sub.request",
29431       FT_UINT8, BASE_DEC, 0, 0,
29432       NULL, HFILL }},
29433
29434     {&hf_ieee80211_tag_measure_request_beacon_unknown,
29435      {"Unknown Data", "wlan.measure.req.beacon.unknown",
29436       FT_BYTES, BASE_NONE, NULL, 0,
29437       "(not interpreted)", HFILL }},
29438
29439     {&hf_ieee80211_tag_measure_request_channel_load_sub_id,
29440      {"SubElement ID", "wlan.measure.req.channel_load.sub.id",
29441       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_channel_load_sub_id_vals), 0,
29442       NULL, HFILL }},
29443
29444     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition,
29445      {"Reporting Condition", "wlan.measure.req.channel_load.sub.repcond",
29446       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals), 0,
29447       NULL, HFILL }},
29448
29449     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref,
29450      {"Reference Value", "wlan.measure.req.channel_load.sub.ref",
29451       FT_UINT8, BASE_HEX, NULL, 0,
29452       NULL, HFILL }},
29453
29454
29455     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_id,
29456      {"SubElement ID", "wlan.measure.req.noise_histogram.sub.id",
29457       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_noise_histogram_sub_id_vals), 0,
29458       NULL, HFILL }},
29459
29460     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition,
29461      {"Reporting Condition", "wlan.measure.reqnoise_histogram.sub.repcond",
29462       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals), 0,
29463       NULL, HFILL }},
29464
29465     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref,
29466      {"ANPI Reference Value", "wlan.measure.req.noise_histogram.sub.anpiref",
29467       FT_UINT8, BASE_HEX, NULL, 0,
29468       NULL, HFILL }},
29469
29470
29471     {&hf_ieee80211_tag_measure_request_frame_request_type,
29472      {"Frame Request Type", "wlan.measure.req.frame_request_type",
29473       FT_UINT8, BASE_HEX, NULL, 0,
29474       NULL, HFILL }},
29475
29476     {&hf_ieee80211_tag_measure_request_mac_address,
29477      {"MAC Address", "wlan.measure.req.mac_address",
29478       FT_BYTES, BASE_NONE, NULL, 0,
29479       NULL, HFILL }},
29480
29481     {&hf_ieee80211_tag_measure_request_peer_mac_address,
29482      {"Peer MAC Address", "wlan.measure.req.peer_mac_address",
29483       FT_BYTES, BASE_NONE, NULL, 0,
29484       NULL, HFILL }},
29485
29486     {&hf_ieee80211_tag_measure_request_group_id,
29487      {"Group ID", "wlan.measure.req.groupid",
29488       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_group_id_flags_ext, 0,
29489       NULL, HFILL }},
29490
29491     {&hf_ieee80211_tag_measure_request_unknown,
29492      {"Unknown Data", "wlan.measure.req.unknown",
29493       FT_BYTES, BASE_NONE, NULL, 0,
29494       "(not interpreted)", HFILL }},
29495
29496     {&hf_ieee80211_tag_measure_report_measurement_token,
29497      {"Measurement Token", "wlan.measure.req.token",
29498       FT_UINT8, BASE_HEX, NULL, 0,
29499       NULL, HFILL }},
29500
29501     {&hf_ieee80211_tag_measure_report_mode,
29502      {"Measurement Report Mode", "wlan.measure.req.mode",
29503       FT_UINT8, BASE_HEX, NULL, 0,
29504       NULL, HFILL }},
29505
29506     {&hf_ieee80211_tag_measure_report_mode_late,
29507      {"Measurement Report Mode Field", "wlan.measure.rep.repmode.late",
29508       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
29509       NULL, HFILL }},
29510
29511     {&hf_ieee80211_tag_measure_report_mode_incapable,
29512      {"Measurement Reports", "wlan.measure.rep.repmode.incapable",
29513       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x02,
29514       NULL, HFILL }},
29515
29516     {&hf_ieee80211_tag_measure_report_mode_refused,
29517      {"Autonomous Measurement Reports", "wlan.measure.rep.repmode.refused",
29518       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x04,
29519       NULL, HFILL }},
29520
29521     {&hf_ieee80211_tag_measure_report_mode_reserved,
29522      {"Reserved", "wlan.measure.rep.repmode.reserved",
29523       FT_UINT8, BASE_HEX, NULL, 0xf8,
29524       NULL, HFILL }},
29525
29526     {&hf_ieee80211_tag_measure_report_type,
29527      {"Measurement Report Type", "wlan.measure.rep.reptype",
29528       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_report_type_flags_ext, 0x00,
29529       NULL, HFILL }},
29530
29531     {&hf_ieee80211_tag_measure_report_channel_number,
29532      {"Measurement Channel Number", "wlan.measure.rep.channelnumber",
29533       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
29534       NULL, HFILL }},
29535
29536     {&hf_ieee80211_tag_measure_report_start_time,
29537      {"Measurement Start Time", "wlan.measure.rep.starttime",
29538       FT_UINT64, BASE_HEX, NULL, 0,
29539       NULL, HFILL }},
29540
29541     {&hf_ieee80211_tag_measure_report_duration,
29542      {"Measurement Duration", "wlan.measure.rep.channelnumber",
29543       FT_UINT16, BASE_HEX, NULL, 0,
29544       NULL, HFILL }},
29545
29546     {&hf_ieee80211_tag_measure_cca_busy_fraction,
29547      {"CCA Busy Fraction", "wlan.measure.rep.ccabusy",
29548       FT_UINT8, BASE_HEX, NULL, 0,
29549       NULL, HFILL }},
29550
29551     {&hf_ieee80211_tag_measure_basic_map_field,
29552      {"Map Field", "wlan.measure.rep.mapfield",
29553       FT_UINT8, BASE_HEX, NULL, 0,
29554       NULL, HFILL }},
29555
29556     {&hf_ieee80211_tag_measure_map_field_bss,
29557      {"BSS", "wlan.measure.rep.repmode.mapfield.bss",
29558       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_map_field_bss_flag), 0x01,
29559       NULL, HFILL }},
29560
29561     {&hf_ieee80211_tag_measure_map_field_odfm,
29562      {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan.measure.rep.repmode.mapfield.bss",
29563       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x02,
29564       NULL, HFILL }},
29565
29566     {&hf_ieee80211_tag_measure_map_field_unident_signal,
29567      {"Unidentified Signal", "wlan.measure.rep.repmode.mapfield.unidentsig",
29568       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x04,
29569       NULL, HFILL }},
29570
29571     {&hf_ieee80211_tag_measure_map_field_radar,
29572      {"Radar", "wlan.measure.rep.repmode.mapfield.radar",
29573       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x08,
29574       NULL, HFILL }},
29575
29576     {&hf_ieee80211_tag_measure_map_field_unmeasured,
29577      {"Unmeasured", "wlan.measure.rep.repmode.mapfield.unmeasured",
29578       FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x10,
29579       NULL, HFILL }},
29580
29581     {&hf_ieee80211_tag_measure_map_field_reserved,
29582      {"Reserved", "wlan.measure.rep.repmode.mapfield.reserved",
29583       FT_UINT8, BASE_HEX, NULL, 0xe0,
29584       NULL, HFILL }},
29585
29586     {&hf_ieee80211_tag_measure_rpi_histogram_report,
29587      {"Receive Power Indicator (RPI) Histogram Report", "wlan.measure.rep.rpi.histogram_report",
29588       FT_BYTES, BASE_NONE, NULL, 0,
29589       NULL, HFILL }},
29590
29591     {&hf_ieee80211_tag_measure_rpi_histogram_report_0,
29592      {"RPI 0 Density", "wlan.measure.rep.rpi.rpi0density",
29593       FT_UINT8, BASE_HEX, NULL, 0,
29594       "Receive Power Indicator (RPI) 0 Density", HFILL }},
29595
29596     {&hf_ieee80211_tag_measure_rpi_histogram_report_1,
29597      {"RPI 1 Density", "wlan.measure.rep.rpi.rpi1density",
29598       FT_UINT8, BASE_HEX, NULL, 0,
29599       "Receive Power Indicator (RPI) 1 Density", HFILL }},
29600
29601     {&hf_ieee80211_tag_measure_rpi_histogram_report_2,
29602      {"RPI 2 Density", "wlan.measure.rep.rpi.rpi2density",
29603       FT_UINT8, BASE_HEX, NULL, 0,
29604       "Receive Power Indicator (RPI) 2 Density", HFILL }},
29605
29606     {&hf_ieee80211_tag_measure_rpi_histogram_report_3,
29607      {"RPI 3 Density", "wlan.measure.rep.rpi.rpi3density",
29608       FT_UINT8, BASE_HEX, NULL, 0,
29609       "Receive Power Indicator (RPI) 3 Density", HFILL }},
29610
29611     {&hf_ieee80211_tag_measure_rpi_histogram_report_4,
29612      {"RPI 4 Density", "wlan.measure.rep.rpi.rpi4density",
29613       FT_UINT8, BASE_HEX, NULL, 0,
29614       "Receive Power Indicator (RPI) 4 Density", HFILL }},
29615
29616     {&hf_ieee80211_tag_measure_rpi_histogram_report_5,
29617      {"RPI 5 Density", "wlan.measure.rep.rpi.rpi5density",
29618       FT_UINT8, BASE_HEX, NULL, 0,
29619       "Receive Power Indicator (RPI) 5 Density", HFILL }},
29620
29621     {&hf_ieee80211_tag_measure_rpi_histogram_report_6,
29622      {"RPI 6 Density", "wlan.measure.rep.rpi.rpi6density",
29623       FT_UINT8, BASE_HEX, NULL, 0,
29624       "Receive Power Indicator (RPI) 6 Density", HFILL }},
29625
29626     {&hf_ieee80211_tag_measure_rpi_histogram_report_7,
29627      {"RPI 7 Density", "wlan.measure.rep.rpi.rpi7density",
29628       FT_UINT8, BASE_HEX, NULL, 0,
29629       "Receive Power Indicator (RPI) 7 Density", HFILL }},
29630
29631     {&hf_ieee80211_tag_measure_report_operating_class,
29632      {"Operating Class", "wlan.measure.rep.operatingclass",
29633       FT_UINT8, BASE_DEC, NULL, 0,
29634       NULL, HFILL }},
29635
29636     {&hf_ieee80211_tag_measure_report_channel_load,
29637      {"Channel Load", "wlan.measure.rep.chanload",
29638       FT_UINT8, BASE_HEX, NULL, 0,
29639       NULL, HFILL }},
29640
29641     {&hf_ieee80211_tag_measure_report_frame_info,
29642      {"Reported Frame Information", "wlan.measure.rep.frameinfo",
29643       FT_UINT8, BASE_HEX, NULL, 0,
29644       NULL, HFILL }},
29645
29646     {&hf_ieee80211_tag_measure_report_frame_info_phy_type,
29647      {"Condensed PHY", "wlan.measure.rep.frameinfo.phytype",
29648       FT_UINT8, BASE_HEX, NULL, 0x7F,
29649       NULL, HFILL }},
29650
29651     {&hf_ieee80211_tag_measure_report_frame_info_frame_type,
29652      {"Reported Frame Type", "wlan.measure.rep.frameinfo.frametype",
29653       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_report_frame_info_frame_type_flag), 0x80,
29654       NULL, HFILL }},
29655
29656     {&hf_ieee80211_tag_measure_report_rcpi,
29657      {"Received Channel Power Indicator (RCPI)", "wlan.measure.rep.rcpi",
29658       FT_UINT8, BASE_HEX, NULL, 0,
29659       "in dBm", HFILL }},
29660
29661     {&hf_ieee80211_tag_measure_report_rsni,
29662      {"Received Signal to Noise Indicator (RSNI)", "wlan.measure.rep.rsni",
29663       FT_UINT8, BASE_HEX, NULL, 0,
29664       "in dB", HFILL }},
29665
29666     {&hf_ieee80211_tag_measure_report_bssid,
29667      {"BSSID Being Reported", "wlan.measure.rep.bssid",
29668       FT_ETHER, BASE_NONE, NULL, 0,
29669       NULL, HFILL }},
29670
29671     {&hf_ieee80211_tag_measure_report_ant_id,
29672      {"Antenna ID", "wlan.measure.rep.antid",
29673       FT_UINT8, BASE_HEX, NULL, 0,
29674       NULL, HFILL }},
29675
29676     {&hf_ieee80211_tag_measure_report_anpi,
29677      {"ANPI", "wlan.measure.rep.anpi",
29678       FT_UINT8, BASE_HEX, NULL, 0,
29679       NULL, HFILL }},
29680
29681     {&hf_ieee80211_tag_measure_report_ipi_density_0,
29682      {"IPI Density 0", "wlan.measure.rep.ipi_density0",
29683       FT_UINT8, BASE_HEX, NULL, 0,
29684       NULL, HFILL }},
29685
29686     {&hf_ieee80211_tag_measure_report_ipi_density_1,
29687      {"IPI Density 1", "wlan.measure.rep.ipi_density1",
29688       FT_UINT8, BASE_HEX, NULL, 0,
29689       NULL, HFILL }},
29690
29691     {&hf_ieee80211_tag_measure_report_ipi_density_2,
29692      {"IPI Density 2", "wlan.measure.rep.ipi_density2",
29693       FT_UINT8, BASE_HEX, NULL, 0,
29694       NULL, HFILL }},
29695
29696     {&hf_ieee80211_tag_measure_report_ipi_density_3,
29697      {"IPI Density 3", "wlan.measure.rep.ipi_density3",
29698       FT_UINT8, BASE_HEX, NULL, 0,
29699       NULL, HFILL }},
29700
29701     {&hf_ieee80211_tag_measure_report_ipi_density_4,
29702      {"IPI Density 4", "wlan.measure.rep.ipi_density4",
29703       FT_UINT8, BASE_HEX, NULL, 0,
29704       NULL, HFILL }},
29705
29706     {&hf_ieee80211_tag_measure_report_ipi_density_5,
29707      {"IPI Density 5", "wlan.measure.rep.ipi_density5",
29708       FT_UINT8, BASE_HEX, NULL, 0,
29709       NULL, HFILL }},
29710
29711     {&hf_ieee80211_tag_measure_report_ipi_density_6,
29712      {"IPI Density 6", "wlan.measure.rep.ipi_density6",
29713       FT_UINT8, BASE_HEX, NULL, 0,
29714       NULL, HFILL }},
29715
29716     {&hf_ieee80211_tag_measure_report_ipi_density_7,
29717      {"IPI Density 7", "wlan.measure.rep.ipi_density7",
29718       FT_UINT8, BASE_HEX, NULL, 0,
29719       NULL, HFILL }},
29720
29721     {&hf_ieee80211_tag_measure_report_ipi_density_8,
29722      {"IPI Density 8", "wlan.measure.rep.ipi_density8",
29723       FT_UINT8, BASE_HEX, NULL, 0,
29724       NULL, HFILL }},
29725
29726     {&hf_ieee80211_tag_measure_report_ipi_density_9,
29727      {"IPI Density 9", "wlan.measure.rep.ipi_density9",
29728       FT_UINT8, BASE_HEX, NULL, 0,
29729       NULL, HFILL }},
29730
29731     {&hf_ieee80211_tag_measure_report_ipi_density_10,
29732      {"IPI Density 10", "wlan.measure.rep.ipi_density10",
29733       FT_UINT8, BASE_HEX, NULL, 0,
29734       NULL, HFILL }},
29735
29736     {&hf_ieee80211_tag_measure_report_parent_tsf,
29737      {"Parent Timing Synchronization Function (TSF)", "wlan.measure.rep.parenttsf",
29738       FT_UINT32, BASE_HEX, NULL, 0,
29739       NULL, HFILL }},
29740
29741     {&hf_ieee80211_tag_measure_report_subelement_length,
29742      {"Length", "wlan.measure.req.sub.length",
29743       FT_UINT8, BASE_DEC, NULL, 0,
29744       NULL, HFILL }},
29745
29746     {&hf_ieee80211_tag_measure_report_beacon_sub_id,
29747      {"SubElement ID", "wlan.measure.req.beacon.sub.id",
29748       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_report_beacon_sub_id_vals), 0,
29749       NULL, HFILL }},
29750
29751     {&hf_ieee80211_tag_measure_report_unknown,
29752      {"Unknown Data", "wlan.measure.rep.unknown",
29753       FT_BYTES, BASE_NONE, NULL, 0,
29754       "(not interpreted)", HFILL }},
29755
29756     {&hf_ieee80211_tag_quiet_count,
29757      {"Count", "wlan.quiet.count",
29758       FT_UINT8, BASE_DEC, NULL, 0,
29759       "Set to the number of TBTTs until the beacon interval during which the next quiet interval shall start", HFILL }},
29760
29761     {&hf_ieee80211_tag_quiet_period,
29762      {"Period", "wlan.quiet.period",
29763       FT_UINT8, BASE_DEC, NULL, 0,
29764       "Set to the number of beacon intervals between the start of regularly scheduled quiet intervals", HFILL }},
29765
29766     {&hf_ieee80211_tag_quiet_duration,
29767      {"Duration", "wlan.quiet.duration",
29768       FT_UINT16, BASE_DEC, NULL, 0,
29769       "Set to the duration of the quiet interval", HFILL }},
29770
29771     {&hf_ieee80211_tag_quiet_offset,
29772      {"Offset", "wlan.quiet.offset",
29773       FT_UINT16, BASE_DEC, NULL, 0,
29774       "Set to the offset of the start of the quiet interval from the TBTT", HFILL }},
29775
29776     {&hf_ieee80211_tag_dfs_owner,
29777      {"Owner", "wlan.dfs.owner",
29778       FT_ETHER, BASE_NONE, NULL, 0,
29779       "Set to the individual IEEE MAC address of the STA that is the currently known DFS Owner in the IBSS", HFILL  }},
29780
29781     {&hf_ieee80211_tag_dfs_recovery_interval,
29782      {"Recovery Interval", "wlan.dfs.recovery_interval",
29783       FT_UINT8, BASE_DEC, NULL, 0,
29784       "Indicates the time interval that shall be used for DFS owner recovery", HFILL  }},
29785
29786     {&hf_ieee80211_tag_dfs_channel_map,
29787      {"Channel Map", "wlan.dfs.channel_map",
29788       FT_NONE, BASE_NONE, NULL, 0,
29789       NULL, HFILL  }},
29790
29791     {&hf_ieee80211_tag_dfs_channel_number,
29792      {"Channel Number", "wlan.dfs.channel_number",
29793       FT_UINT8, BASE_DEC, NULL, 0,
29794       NULL, HFILL  }},
29795
29796     {&hf_ieee80211_tag_dfs_map,
29797      {"Map", "wlan.dfs.map",
29798       FT_UINT8, BASE_HEX, NULL, 0,
29799       NULL, HFILL  }},
29800
29801     {&hf_ieee80211_tag_erp_info,
29802      {"ERP Information", "wlan.erp_info",
29803       FT_UINT8, BASE_HEX, NULL, 0,
29804       NULL, HFILL  }},
29805
29806     {&hf_ieee80211_tag_erp_info_erp_present,
29807      {"Non ERP Present", "wlan.erp_info.erp_present",
29808       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
29809       NULL, HFILL  }},
29810
29811     {&hf_ieee80211_tag_erp_info_use_protection,
29812      {"Use Protection", "wlan.erp_info.use_protection",
29813       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
29814       NULL, HFILL  }},
29815
29816     {&hf_ieee80211_tag_erp_info_barker_preamble_mode,
29817      {"Barker Preamble Mode", "wlan.erp_info.barker_preamble_mode",
29818       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
29819       NULL, HFILL  }},
29820
29821     {&hf_ieee80211_tag_erp_info_reserved,
29822      {"Reserved", "wlan.erp_info.reserved",
29823       FT_UINT8, BASE_HEX, NULL, 0xF8,
29824       NULL, HFILL  }},
29825
29826     /* IEEE Std 802.11 2016 */
29827     /* Table 9-135-Extended Capabilities field */
29828     {&hf_ieee80211_tag_extended_capabilities,
29829      {"Extended Capabilities", "wlan.extcap",
29830       FT_UINT8, BASE_HEX, NULL, 0,
29831       NULL, HFILL }},
29832
29833     /* Extended Capability octet 1 */
29834     {&hf_ieee80211_tag_extended_capabilities_b0,
29835      {"20/40 BSS Coexistence Management Support", "wlan.extcap.b0",
29836       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29837       "HT Information Exchange Support", HFILL }},
29838
29839     {&hf_ieee80211_tag_extended_capabilities_b1,
29840      {"Reserved (was On-demand beacon)", "wlan.extcap.b1",
29841       FT_UINT8, BASE_HEX, NULL, 0x02,
29842       "Must be zero", HFILL }},
29843
29844     {&hf_ieee80211_tag_extended_capabilities_b2,
29845      {"Extended Channel Switching", "wlan.extcap.b2",
29846       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29847       NULL, HFILL }},
29848
29849     {&hf_ieee80211_tag_extended_capabilities_b3,
29850      {"Reserved (was WAVE indication)", "wlan.extcap.b3",
29851       FT_UINT8, BASE_HEX, NULL, 0x08,
29852       "Must be zero", HFILL }},
29853
29854     {&hf_ieee80211_tag_extended_capabilities_b4,
29855      {"PSMP Capability", "wlan.extcap.b4",
29856       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29857       NULL, HFILL }},
29858
29859     {&hf_ieee80211_tag_extended_capabilities_b5,
29860      {"Reserved", "wlan.extcap.b5",
29861       FT_UINT8, BASE_HEX, NULL, 0x20,
29862       "Must be zero", HFILL }},
29863
29864     {&hf_ieee80211_tag_extended_capabilities_b6,
29865      {"S-PSMP Support", "wlan.extcap.b6",
29866       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29867       NULL, HFILL }},
29868
29869     {&hf_ieee80211_tag_extended_capabilities_b7,
29870      {"Event", "wlan.extcap.b7",
29871       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29872       NULL, HFILL }},
29873
29874
29875     /* Extended Capability octet 2 */
29876     {&hf_ieee80211_tag_extended_capabilities_b8,
29877      {"Diagnostics", "wlan.extcap.b8",
29878       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29879       NULL, HFILL }},
29880
29881     {&hf_ieee80211_tag_extended_capabilities_b9,
29882      {"Multicast Diagnostics", "wlan.extcap.b9",
29883       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
29884       NULL, HFILL }},
29885
29886     {&hf_ieee80211_tag_extended_capabilities_b10,
29887      {"Location Tracking", "wlan.extcap.b10",
29888       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29889       NULL, HFILL }},
29890
29891     {&hf_ieee80211_tag_extended_capabilities_b11,
29892      {"FMS", "wlan.extcap.b11",
29893       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
29894       NULL, HFILL }},
29895
29896     {&hf_ieee80211_tag_extended_capabilities_b12,
29897      {"Proxy ARP Service", "wlan.extcap.b12",
29898       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29899       NULL, HFILL }},
29900
29901     {&hf_ieee80211_tag_extended_capabilities_b13,
29902      {"Collocated Interference Reporting", "wlan.extcap.b13",
29903       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
29904       NULL, HFILL }},
29905
29906     {&hf_ieee80211_tag_extended_capabilities_b14,
29907      {"Civic Location", "wlan.extcap.b14",
29908       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29909       NULL, HFILL }},
29910
29911     {&hf_ieee80211_tag_extended_capabilities_b15,
29912      {"Geospatial Location", "wlan.extcap.b15",
29913       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29914       NULL, HFILL }},
29915
29916
29917     /* Extended Capability octet 3 */
29918     {&hf_ieee80211_tag_extended_capabilities_b16,
29919      {"TFS", "wlan.extcap.b16",
29920       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29921       NULL, HFILL }},
29922
29923     {&hf_ieee80211_tag_extended_capabilities_b17,
29924      {"WNM Sleep Mode", "wlan.extcap.b17",
29925       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
29926       NULL, HFILL }},
29927
29928     {&hf_ieee80211_tag_extended_capabilities_b18,
29929      {"TIM Broadcast", "wlan.extcap.b18",
29930       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29931       NULL, HFILL }},
29932
29933     {&hf_ieee80211_tag_extended_capabilities_b19,
29934      {"BSS Transition", "wlan.extcap.b19",
29935       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
29936       NULL, HFILL }},
29937
29938     {&hf_ieee80211_tag_extended_capabilities_b20,
29939      {"QoS Traffic Capability", "wlan.extcap.b20",
29940       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29941       NULL, HFILL }},
29942
29943     {&hf_ieee80211_tag_extended_capabilities_b21,
29944      {"AC Station Count", "wlan.extcap.b21",
29945       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
29946       NULL, HFILL }},
29947
29948     {&hf_ieee80211_tag_extended_capabilities_b22,
29949      {"Multiple BSSID", "wlan.extcap.b22",
29950       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29951       NULL, HFILL }},
29952
29953     {&hf_ieee80211_tag_extended_capabilities_b23,
29954      {"Timing Measurement", "wlan.extcap.b23",
29955       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29956       NULL, HFILL }},
29957
29958
29959     /* Extended Capability octet 4 */
29960     {&hf_ieee80211_tag_extended_capabilities_b24,
29961      {"Channel Usage", "wlan.extcap.b24",
29962       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
29963       NULL, HFILL }},
29964
29965     {&hf_ieee80211_tag_extended_capabilities_b25,
29966      {"SSID List", "wlan.extcap.b25",
29967       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
29968       NULL, HFILL }},
29969
29970     {&hf_ieee80211_tag_extended_capabilities_b26,
29971      {"DMS", "wlan.extcap.b26",
29972       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
29973       NULL, HFILL }},
29974
29975     {&hf_ieee80211_tag_extended_capabilities_b27,
29976      {"UTC TSF Offset", "wlan.extcap.b27",
29977       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
29978       NULL, HFILL }},
29979
29980     {&hf_ieee80211_tag_extended_capabilities_b28,
29981      {"TPU Buffer STA Support", "wlan.extcap.b28",
29982       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
29983       NULL, HFILL }},
29984
29985     {&hf_ieee80211_tag_extended_capabilities_b29,
29986      {"TDLS Peer PSM Support", "wlan.extcap.b29",
29987       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
29988       NULL, HFILL }},
29989
29990     {&hf_ieee80211_tag_extended_capabilities_b30,
29991      {"TDLS channel switching", "wlan.extcap.b30",
29992       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
29993       NULL, HFILL }},
29994
29995     {&hf_ieee80211_tag_extended_capabilities_b31,
29996      {"Interworking", "wlan.extcap.b31",
29997       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
29998       NULL, HFILL }},
29999
30000
30001     /* Extended Capability octet 5 */
30002     {&hf_ieee80211_tag_extended_capabilities_b32,
30003      {"QoS Map", "wlan.extcap.b32",
30004       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
30005       NULL, HFILL }},
30006
30007     {&hf_ieee80211_tag_extended_capabilities_b33,
30008      {"EBR", "wlan.extcap.b33",
30009       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
30010       NULL, HFILL }},
30011
30012     {&hf_ieee80211_tag_extended_capabilities_b34,
30013      {"SSPN Interface", "wlan.extcap.b34",
30014       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
30015       NULL, HFILL }},
30016
30017     {&hf_ieee80211_tag_extended_capabilities_b35,
30018      {"Reserved", "wlan.extcap.b35",
30019       FT_UINT8, BASE_HEX, NULL, 0x08,
30020       "Must be zero", HFILL }},
30021
30022     {&hf_ieee80211_tag_extended_capabilities_b36,
30023      {"MSGCF Capability", "wlan.extcap.b36",
30024       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
30025       NULL, HFILL }},
30026
30027     {&hf_ieee80211_tag_extended_capabilities_b37,
30028      {"TDLS Support", "wlan.extcap.b37",
30029       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
30030       NULL, HFILL }},
30031
30032     {&hf_ieee80211_tag_extended_capabilities_b38,
30033      {"TDLS Prohibited", "wlan.extcap.b38",
30034       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
30035       NULL, HFILL }},
30036
30037     {&hf_ieee80211_tag_extended_capabilities_b39,
30038      {"TDLS Channel Switching Prohibited", "wlan.extcap.b39",
30039       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
30040       NULL, HFILL }},
30041
30042     /* Extended Capability octet 6 */
30043     {&hf_ieee80211_tag_extended_capabilities_b40,
30044      {"Reject Unadmitted Frame", "wlan.extcap.b40",
30045       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
30046       NULL, HFILL }},
30047
30048     {&hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
30049      {"Service Interval Granularity",
30050       "wlan.extcap.serv_int_granularity",
30051       FT_UINT8, BASE_DEC, VALS(service_interval_granularity_vals), 0x0e,
30052       NULL, HFILL }},
30053
30054     {&hf_ieee80211_tag_extended_capabilities_b44,
30055      {"Identifier Location", "wlan.extcap.b44",
30056       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
30057       NULL, HFILL }},
30058
30059     {&hf_ieee80211_tag_extended_capabilities_b45,
30060      {"U-APSD Coexistence", "wlan.extcap.b45",
30061       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
30062       NULL, HFILL }},
30063
30064     {&hf_ieee80211_tag_extended_capabilities_b46,
30065      {"WNM Notification", "wlan.extcap.b46",
30066       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
30067       NULL, HFILL }},
30068
30069     {&hf_ieee80211_tag_extended_capabilities_b47,
30070      {"QAB Capability", "wlan.extcap.b47",
30071       FT_UINT8, BASE_HEX, NULL, 0x80,
30072       "AP supports QAB", HFILL }},
30073
30074     /* Extended Capability octet 7 */
30075     {&hf_ieee80211_tag_extended_capabilities_b48,
30076      {"UTF-8 SSID", "wlan.extcap.b48",
30077       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
30078       "The SSID in this BSS is interpreted using UTF-8 encoding", HFILL }},
30079
30080     {&hf_ieee80211_tag_extended_capabilities_b49,
30081      {"QMFActivated", "wlan.extcap.b49",
30082       FT_BOOLEAN, 8, NULL, 0x02,
30083       NULL, HFILL }},
30084
30085     {&hf_ieee80211_tag_extended_capabilities_b50,
30086      {"QMFReconfigurationActivated", "wlan.extcap.b50",
30087       FT_BOOLEAN, 8, NULL, 0x04,
30088       NULL, HFILL }},
30089
30090     {&hf_ieee80211_tag_extended_capabilities_b51,
30091      {"Robust AV Streaming", "wlan.extcap.b51",
30092       FT_BOOLEAN, 8, NULL, 0x08,
30093       NULL, HFILL }},
30094
30095     {&hf_ieee80211_tag_extended_capabilities_b52,
30096      {"Advanced GCR", "wlan.extcap.b52",
30097       FT_BOOLEAN, 8, NULL, 0x10,
30098       NULL, HFILL }},
30099
30100     {&hf_ieee80211_tag_extended_capabilities_b53,
30101      {"Mesh GCR", "wlan.extcap.b53",
30102       FT_BOOLEAN, 8, NULL, 0x20,
30103       NULL, HFILL }},
30104
30105     {&hf_ieee80211_tag_extended_capabilities_b54,
30106      {"SCS", "wlan.extcap.b54",
30107       FT_BOOLEAN, 8, NULL, 0x40,
30108       NULL, HFILL }},
30109
30110     {&hf_ieee80211_tag_extended_capabilities_b55,
30111      {"QLoad Report", "wlan.extcap.b55",
30112       FT_BOOLEAN, 8, NULL, 0x80,
30113       NULL, HFILL }},
30114
30115     /* Extended Capability octet 8 */
30116     {&hf_ieee80211_tag_extended_capabilities_b56,
30117      {"Alternate EDCA", "wlan.extcap.b56",
30118       FT_BOOLEAN, 8, NULL, 0x01,
30119       NULL, HFILL }},
30120
30121     {&hf_ieee80211_tag_extended_capabilities_b57,
30122      {"Unprotected TXOP Negotiation", "wlan.extcap.b57",
30123       FT_BOOLEAN, 8, NULL, 0x02,
30124       NULL, HFILL }},
30125
30126     {&hf_ieee80211_tag_extended_capabilities_b58,
30127      {"Protected TXOP Negotiation", "wlan.extcap.b58",
30128       FT_BOOLEAN, 8, NULL, 0x04,
30129       NULL, HFILL }},
30130
30131     {&hf_ieee80211_tag_extended_capabilities_b59,
30132      {"Reserved", "wlan.extcap.b59",
30133       FT_UINT8, BASE_HEX, NULL, 0x08,
30134       NULL, HFILL }},
30135
30136     {&hf_ieee80211_tag_extended_capabilities_b60,
30137      {"Protected QLoad Report", "wlan.extcap.b61",
30138       FT_BOOLEAN, 8, NULL, 0x10,
30139       NULL, HFILL }},
30140
30141     {&hf_ieee80211_tag_extended_capabilities_b61,
30142      {"TDLS Wider Bandwidth", "wlan.extcap.b61",
30143       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
30144       NULL, HFILL }},
30145
30146     {&hf_ieee80211_tag_extended_capabilities_b62,
30147      {"Operating Mode Notification", "wlan.extcap.b62",
30148       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
30149       NULL, HFILL }},
30150
30151     {&hf_ieee80211_tag_extended_capabilities_b63,
30152      {"Max Number Of MSDUs In A-MSDU", "wlan.extcap.b63",
30153       FT_UINT8, BASE_DEC, NULL, 0x80,
30154       "Part 1 (bit63)", HFILL }},
30155
30156     /* Extended Capability octets 8 & 9 */
30157     {&hf_ieee80211_tag_extended_capabilities_2,
30158      {"Extended Capabilities", "wlan.extcap",
30159       FT_UINT16, BASE_HEX, NULL, 0,
30160       NULL, HFILL }},
30161
30162     {&hf_ieee80211_tag_extended_capabilities_b56_2,
30163      {"Alternate EDCA", "wlan.extcap.b56",
30164       FT_BOOLEAN, 16, NULL, 0x01,
30165       NULL, HFILL }},
30166
30167     {&hf_ieee80211_tag_extended_capabilities_b57_2,
30168      {"Unprotected TXOP Negotiation", "wlan.extcap.b57",
30169       FT_BOOLEAN, 16, NULL, 0x02,
30170       NULL, HFILL }},
30171
30172     {&hf_ieee80211_tag_extended_capabilities_b58_2,
30173      {"Protected TXOP Negotiation", "wlan.extcap.b58",
30174       FT_BOOLEAN, 16, NULL, 0x04,
30175       NULL, HFILL }},
30176
30177     {&hf_ieee80211_tag_extended_capabilities_b59_2,
30178      {"Reserved", "wlan.extcap.b59",
30179       FT_UINT16, BASE_HEX, NULL, 0x08,
30180       NULL, HFILL }},
30181
30182     {&hf_ieee80211_tag_extended_capabilities_b60_2,
30183      {"Protected QLoad Report", "wlan.extcap.b61",
30184       FT_BOOLEAN, 16, NULL, 0x10,
30185       NULL, HFILL }},
30186
30187     {&hf_ieee80211_tag_extended_capabilities_b61_2,
30188      {"TDLS Wider Bandwidth", "wlan.extcap.b61",
30189       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x20,
30190       NULL, HFILL }},
30191
30192     {&hf_ieee80211_tag_extended_capabilities_b62_2,
30193      {"Operating Mode Notification", "wlan.extcap.b62",
30194       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x40,
30195       NULL, HFILL }},
30196
30197     {&hf_ieee80211_tag_extended_capabilities_max_num_msdus,
30198      {"Max Number Of MSDUs In A-MSDU", "wlan.extcap.b63",
30199       FT_UINT16, BASE_DEC, VALS(vht_max_mpdu_in_amsdu), 0x0180,
30200       NULL, HFILL }},
30201
30202     {&hf_ieee80211_tag_extended_capabilities_b65_2,
30203      {"Channel Schedule Management", "wlan.extcap.b65",
30204       FT_BOOLEAN, 16, NULL, 0x0200,
30205       NULL, HFILL }},
30206
30207     {&hf_ieee80211_tag_extended_capabilities_b66_2,
30208      {"Geodatabase Inband Enabling Signal", "wlan.extcap.b66",
30209       FT_BOOLEAN, 16, NULL, 0x0400,
30210       NULL, HFILL }},
30211
30212     {&hf_ieee80211_tag_extended_capabilities_b67_2,
30213      {"Network Channel Control", "wlan.extcap.b67",
30214       FT_BOOLEAN, 16, NULL, 0x0800,
30215       NULL, HFILL }},
30216
30217     {&hf_ieee80211_tag_extended_capabilities_b68_2,
30218      {"White Space Map", "wlan.extcap.b68",
30219       FT_BOOLEAN, 16, NULL, 0x1000,
30220       NULL, HFILL }},
30221
30222     {&hf_ieee80211_tag_extended_capabilities_b69_2,
30223      {"Channel Availability Query", "wlan.extcap.b69",
30224       FT_BOOLEAN, 16, NULL, 0x2000,
30225       NULL, HFILL }},
30226
30227     {&hf_ieee80211_tag_extended_capabilities_b70_2,
30228      {"Fine Timing Measurement Responder", "wlan.extcap.b70",
30229       FT_BOOLEAN, 16, NULL, 0x4000,
30230       NULL, HFILL }},
30231
30232     {&hf_ieee80211_tag_extended_capabilities_b71_2,
30233      {"Fine Timing Measurement Initiator", "wlan.extcap.b71",
30234       FT_BOOLEAN, 16, NULL, 0x8000,
30235       NULL, HFILL }},
30236
30237     /* Extended Capability Octet 10 */
30238     {&hf_ieee80211_tag_extended_capabilities_b72,
30239      {"Reserved", "wlan.extcap.b72",
30240       FT_UINT8, BASE_HEX, NULL, 0x01,
30241       NULL, HFILL }},
30242
30243     {&hf_ieee80211_tag_extended_capabilities_b73,
30244      {"Extended Spectrum Management Capable", "wlan.extcap.b73",
30245       FT_BOOLEAN, 8, NULL, 0x02,
30246       NULL, HFILL }},
30247
30248     {&hf_ieee80211_tag_extended_capabilities_b74,
30249      {"Future Channel Capable", "wlan.extcap.b74",
30250       FT_BOOLEAN, 8, NULL, 0x04,
30251       NULL, HFILL }},
30252
30253     {&hf_ieee80211_tag_extended_capabilities_b75,
30254      {"Reserved", "wlan.extcap.b75",
30255       FT_UINT8, BASE_HEX, NULL, 0x08,
30256       NULL, HFILL }},
30257
30258     {&hf_ieee80211_tag_extended_capabilities_b76,
30259      {"Reserved", "wlan.extcap.b76",
30260       FT_UINT8, BASE_HEX, NULL, 0x10,
30261       NULL, HFILL }},
30262
30263     {&hf_ieee80211_tag_extended_capabilities_b77,
30264      {"TWT Requester Support", "wlan.extcap.b77",
30265       FT_BOOLEAN, 16, NULL, 0x20,
30266       NULL, HFILL }},
30267
30268     {&hf_ieee80211_tag_extended_capabilities_b78,
30269      {"TWT Responder Support", "wlan.extcap.b78",
30270       FT_BOOLEAN, 16, NULL, 0x40,
30271       NULL, HFILL }},
30272
30273     {&hf_ieee80211_tag_extended_capabilities_b79,
30274      {"OBSS Narrow Bandwidth RU in UL OFDMA Tolerance Support", "wlan.extcap.b79",
30275       FT_BOOLEAN, 16, NULL, 0x80,
30276       NULL, HFILL }},
30277
30278
30279     {&hf_ieee80211_tag_cisco_ccx1_unknown,
30280      {"Unknown", "wlan.cisco.ccx1.unknown",
30281       FT_BYTES, BASE_NONE, NULL, 0,
30282       NULL, HFILL }},
30283
30284     {&hf_ieee80211_tag_cisco_ccx1_name,
30285      {"Name", "wlan.cisco.ccx1.name",
30286       FT_STRING, BASE_NONE, NULL, 0,
30287       NULL, HFILL }},
30288
30289     {&hf_ieee80211_tag_cisco_ccx1_clients,
30290      {"Clients", "wlan.cisco.ccx1.clients",
30291       FT_UINT8, BASE_DEC, NULL, 0,
30292       NULL, HFILL }},
30293
30294     {&hf_ieee80211_tag_cisco_ccx1_unknown2,
30295      {"Unknown2", "wlan.cisco.ccx1.unknown2",
30296       FT_BYTES, BASE_NONE, NULL, 0,
30297       NULL, HFILL }},
30298
30299     {&hf_ieee80211_tag_neighbor_report_bssid,
30300      {"BSSID", "wlan.nreport.bssid",
30301       FT_ETHER, BASE_NONE, NULL, 0,
30302       NULL, HFILL }},
30303
30304     {&hf_ieee80211_tag_neighbor_report_bssid_info,
30305      {"BSSID Information", "wlan.nreport.bssid.info",
30306       FT_UINT32, BASE_HEX, NULL, 0,
30307       NULL, HFILL }},
30308
30309     {&hf_ieee80211_tag_neighbor_report_bssid_info_reachability,
30310      {"AP Reachability", "wlan.nreport.bssid.info.reachability",
30311       FT_UINT32, BASE_HEX, VALS(ieee80211_neighbor_report_bssid_info_reachability_vals), 0x00000003,
30312       "Indicates whether the AP identified by this BSSID is reachable by the STA that requested the neighbor report", HFILL }},
30313
30314     {&hf_ieee80211_tag_neighbor_report_bssid_info_security,
30315      {"Security", "wlan.nreport.bssid.info.security",
30316       FT_BOOLEAN, 32, NULL, 0x00000004,
30317       "Indicates that the AP identified by this BSSID supports the same security provisioning as used by the STA in its current association", HFILL }},
30318
30319     {&hf_ieee80211_tag_neighbor_report_bssid_info_key_scope,
30320      {"Key Scope", "wlan.nreport.bssid.info.keyscope",
30321       FT_BOOLEAN, 32, NULL, 0x00000008,
30322       "indicates the AP indicated by this BSSID has the same authenticator as the AP sending the report", HFILL }},
30323
30324     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability,
30325      {"Capability", "wlan.nreport.bssid.info.capability",
30326       FT_UINT32, BASE_HEX, NULL, 0x000003F0,
30327       "Contains selected capability information for the AP indicated by this BSSID", HFILL }},
30328
30329     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng,
30330      {"Spectrum Management", "wlan.nreport.bssid.info.capability.specmngt",
30331       FT_BOOLEAN, 32, NULL, 0x00000010,
30332       NULL, HFILL }},
30333
30334     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos,
30335      {"QoS", "wlan.nreport.bssid.info.capability.qos",
30336       FT_BOOLEAN, 32, NULL, 0x00000020,
30337       NULL, HFILL }},
30338
30339     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd,
30340      {"APSD", "wlan.nreport.bssid.info.capability.apsd",
30341       FT_BOOLEAN, 32, NULL, 0x00000040,
30342       NULL, HFILL }},
30343
30344     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt,
30345      {"Radio Measurement", "wlan.nreport.bssid.info.capability.radiomsnt",
30346       FT_BOOLEAN, 32, NULL, 0x00000080,
30347       NULL, HFILL }},
30348
30349     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback,
30350      {"Delayed Block Ack", "wlan.nreport.bssid.info.capability.dback",
30351       FT_BOOLEAN, 32, NULL, 0x000000100,
30352       NULL, HFILL }},
30353
30354     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback,
30355      {"Immediate Block Ack", "wlan.nreport.bssid.info.capability.iback",
30356       FT_BOOLEAN, 32, NULL, 0x00000200,
30357       NULL, HFILL }},
30358
30359     {&hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain,
30360      {"Mobility Domain", "wlan.nreport.bssid.info.mobilitydomain",
30361       FT_BOOLEAN, 32, NULL, 0x00000400,
30362       "", HFILL }},
30363
30364     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput,
30365      {"High Throughput Control (+HTC)", "wlan.nreport.bssid.info.hthoughput",
30366       FT_BOOLEAN, 32, NULL, 0x00000800,
30367       NULL, HFILL }},
30368
30369     {&hf_ieee80211_tag_neighbor_report_bssid_info_very_high_throughput,
30370      {"Very High Throughput (+VHT)", "wlan.nreport.bssid.info.vht",
30371       FT_BOOLEAN, 32, NULL, 0x00001000,
30372       NULL, HFILL }},
30373
30374     {&hf_ieee80211_tag_neighbor_report_bssid_info_ftm,
30375      {"Fine Timing Measurement (FTM)", "wlan.nreport.bssid.info.ftm",
30376       FT_BOOLEAN, 32, NULL, 0x00002000,
30377       NULL, HFILL }},
30378
30379     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_efficiency,
30380      {"High Efficiency (HE AP)", "wlan.nreport.bssid.info.he",
30381       FT_BOOLEAN, 32, NULL, 0x00004000,
30382       NULL, HFILL }},
30383
30384     {&hf_ieee80211_tag_neighbor_report_bssid_info_er_bss,
30385      {"Extended Range BSS", "wlan.nreport.bssid.info.er_bss",
30386       FT_BOOLEAN, 32, NULL, 0x00008000,
30387       NULL, HFILL }},
30388
30389     {&hf_ieee80211_tag_neighbor_report_bssid_info_reserved,
30390      {"Reserved", "wlan.nreport.bssid.info.reserved",
30391       FT_UINT32, BASE_HEX, NULL, 0xFFFF0000,
30392       "Must be zero", HFILL }},
30393
30394     {&hf_ieee80211_tag_neighbor_report_ope_class,
30395      {"Operating Class", "wlan.nreport.opeclass",
30396       FT_UINT8, BASE_DEC, NULL, 0,
30397       NULL, HFILL }},
30398
30399     {&hf_ieee80211_tag_neighbor_report_channel_number,
30400      {"Channel Number", "wlan.nreport.channumber",
30401       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
30402       NULL, HFILL }},
30403
30404     {&hf_ieee80211_tag_neighbor_report_phy_type,
30405      {"PHY Type", "wlan.nreport.phytype",
30406       FT_UINT8, BASE_HEX, NULL, 0,
30407       NULL, HFILL }},
30408
30409     {&hf_ieee80211_tag_neighbor_report_subelement_id,
30410      {"Subelement ID", "wlan.nreport.subelement_id",
30411       FT_UINT8, BASE_HEX, VALS(ieee80211_neighbor_report_subelement_id_vals), 0,
30412       NULL, HFILL }},
30413
30414     {&hf_ieee80211_tag_neighbor_report_subelement_length,
30415      {"Length", "wlan.nreport.subelement_length",
30416       FT_UINT8, BASE_HEX, NULL, 0,
30417       NULL, HFILL }},
30418
30419     {&hf_ieee80211_tag_neighbor_report_subelement_data,
30420      {"Subelement Data", "wlan.nreport.subelement_data",
30421       FT_BYTES, BASE_NONE, NULL, 0,
30422       NULL, HFILL }},
30423
30424     {&hf_ieee80211_tag_neighbor_report_subelement_bss_trn_can_pref,
30425      {"Preference", "wlan.nreport.subelement.bss_trn_can_pref",
30426       FT_UINT8, BASE_DEC, NULL, 0,
30427       NULL, HFILL }},
30428
30429     {&hf_ieee80211_tag_neighbor_report_subelement_bss_ter_tsf,
30430      {"BSS Termination TSF", "wlan.nreport.subelement.bss_ter_tsf",
30431       FT_UINT64, BASE_DEC, NULL, 0,
30432       NULL, HFILL }},
30433
30434     {&hf_ieee80211_tag_neighbor_report_subelement_bss_dur,
30435      {"Duration", "wlan.nreport.subelement.bss_dur",
30436       FT_UINT16, BASE_DEC, NULL, 0,
30437       NULL, HFILL }},
30438
30439     {&hf_ieee80211_tag_supported_ope_classes_current,
30440      {"Current Operating Class", "wlan.supopeclass.current",
30441       FT_UINT8, BASE_DEC, NULL, 0,
30442       NULL, HFILL }},
30443
30444     {&hf_ieee80211_tag_supported_ope_classes_alternate,
30445      {"Alternate Operating Classes", "wlan.supopeclass.alt",
30446       FT_NONE, BASE_NONE, 0x0, 0,
30447       NULL, HFILL }},
30448
30449     {&hf_ieee80211_wfa_ie_type,
30450      {"Type", "wlan.wfa.ie.type",
30451       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_type_vals), 0,
30452       NULL, HFILL }},
30453
30454     {&hf_ieee80211_wfa_ie_wpa_version,
30455      {"WPA Version", "wlan.wfa.ie.wpa.version",
30456       FT_UINT16, BASE_DEC, NULL, 0,
30457       NULL, HFILL }},
30458
30459     {&hf_ieee80211_wfa_ie_wpa_mcs,
30460      {"Multicast Cipher Suite", "wlan.wfa.ie.wpa.mcs",
30461       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_mcs_base_custom), 0,
30462       "Contains the cipher suite selector used by the BSS to protect broadcast/multicasttraffic", HFILL }},
30463
30464     {&hf_ieee80211_wfa_ie_wpa_mcs_oui,
30465      {"Multicast Cipher Suite OUI", "wlan.wfa.ie.wpa.mcs.oui",
30466       FT_UINT24, BASE_OUI, NULL, 0,
30467       NULL, HFILL }},
30468
30469     {&hf_ieee80211_wfa_ie_wpa_mcs_type,
30470      {"Multicast Cipher Suite type", "wlan.wfa.ie.wpa.mcs.type",
30471       FT_UINT8, BASE_DEC, NULL, 0,
30472       NULL, HFILL }},
30473
30474     {&hf_ieee80211_wfa_ie_wpa_mcs_wfa_type,
30475      {"Multicast Cipher Suite type", "wlan.wfa.ie.wpa.mcs.type",
30476       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
30477       NULL, HFILL }},
30478
30479     {&hf_ieee80211_wfa_ie_wpa_ucs_count,
30480      {"Unicast Cipher Suite Count", "wlan.wfa.ie.wpa.ucs.count",
30481       FT_UINT16, BASE_DEC, NULL, 0,
30482       "Indicates the number of pairwise cipher suite selectors that are contained in the Unicast Cipher Suite List", HFILL }},
30483
30484     {&hf_ieee80211_wfa_ie_wpa_ucs_list,
30485      {"Unicast Cipher Suite List", "wlan.wfa.ie.wpa.ucs.list",
30486       FT_NONE, BASE_NONE, NULL, 0,
30487       "Contains a series of cipher suite selectors that indicate the Unicast cipher suites", HFILL }},
30488
30489     {&hf_ieee80211_wfa_ie_wpa_ucs,
30490      {"Unicast Cipher Suite", "wlan.wfa.ie.wpa.ucs",
30491       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_ucs_base_custom), 0,
30492       NULL, HFILL }},
30493
30494     {&hf_ieee80211_wfa_ie_wpa_ucs_oui,
30495      {"Unicast Cipher Suite OUI", "wlan.wfa.ie.wpau.cs.oui",
30496       FT_UINT24, BASE_OUI, NULL, 0,
30497       NULL, HFILL }},
30498
30499     {&hf_ieee80211_wfa_ie_wpa_ucs_type,
30500      {"Unicast Cipher Suite type", "wlan.wfa.ie.wpa.ucs.type",
30501       FT_UINT8, BASE_DEC, NULL, 0,
30502       NULL, HFILL }},
30503
30504     {&hf_ieee80211_wfa_ie_wpa_ucs_wfa_type,
30505      {"Unicast Cipher Suite type", "wlan.wfa.ie.wpa.ucs.type",
30506       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
30507       NULL, HFILL }},
30508
30509     {&hf_ieee80211_wfa_ie_wpa_akms_count,
30510      {"Auth Key Management (AKM) Suite Count", "wlan.wfa.ie.wpa.akms.count",
30511       FT_UINT16, BASE_DEC, NULL, 0,
30512       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
30513
30514     {&hf_ieee80211_wfa_ie_wpa_akms_list,
30515      {"Auth Key Management (AKM) List", "wlan.wfa.ie.wpa.akms.list",
30516       FT_NONE, BASE_NONE, NULL, 0,
30517       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
30518
30519     {&hf_ieee80211_wfa_ie_wpa_akms,
30520      {"Auth Key Management (AKM) Suite", "wlan.wfa.ie.wpa.akms",
30521       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_akms_base_custom), 0,
30522       NULL, HFILL }},
30523
30524     {&hf_ieee80211_wfa_ie_wpa_akms_oui,
30525      {"Auth Key Management (AKM) OUI", "wlan.wfa.ie.wpa.akms.oui",
30526       FT_UINT24, BASE_OUI, NULL, 0,
30527       NULL, HFILL }},
30528
30529     {&hf_ieee80211_wfa_ie_wpa_akms_type,
30530      {"Auth Key Management (AKM) type", "wlan.wfa.ie.wpa.akms.type",
30531       FT_UINT8, BASE_DEC, NULL, 0,
30532       NULL, HFILL }},
30533
30534     {&hf_ieee80211_wfa_ie_wpa_akms_wfa_type,
30535      {"Auth Key Management (AKM) type", "wlan.wfa.ie.wpa.type",
30536       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_keymgmt_vals), 0,
30537       NULL, HFILL }},
30538
30539     {&hf_ieee80211_wfa_ie_wme_subtype,
30540      {"WME Subtype", "wlan.wfa.ie.wme.subtype",
30541       FT_UINT8, BASE_DEC, VALS(ieee802111_wfa_ie_wme_type), 0,
30542       NULL, HFILL }},
30543
30544     {&hf_ieee80211_wfa_ie_wme_version,
30545      {"WME Version", "wlan.wfa.ie.wme.version",
30546       FT_UINT8, BASE_DEC, NULL, 0,
30547       NULL, HFILL }},
30548
30549     {&hf_ieee80211_wfa_ie_wme_qos_info,
30550      {"WME QoS Info", "wlan.wfa.ie.wme.qos_info",
30551       FT_UINT8, BASE_HEX, NULL, 0,
30552       NULL, HFILL }},
30553
30554     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
30555      {"Max SP Length", "wlan.wfa.ie.wme.qos_info.sta.max_sp_length",
30556       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals), 0x60,
30557       NULL, HFILL }},
30558
30559     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
30560      {"AC_BE", "wlan.wfa.ie.wme.qos_info.sta.ac_be",
30561       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x08,
30562       NULL, HFILL }},
30563
30564     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
30565      {"AC_BK", "wlan.wfa.ie.wme.qos_info.sta.ac_bk",
30566       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x04,
30567       NULL, HFILL }},
30568
30569     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
30570      {"AC_VI", "wlan.wfa.ie.wme.qos_info.sta.ac_vi",
30571       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x02,
30572       NULL, HFILL }},
30573
30574     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
30575      {"AC_VO", "wlan.wfa.ie.wme.qos_info.sta.ac_vo",
30576       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x01,
30577       NULL, HFILL }},
30578
30579     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
30580      {"Reserved", "wlan.wfa.ie.wme.qos_info.sta.reserved",
30581       FT_UINT8, BASE_HEX, NULL, 0x90,
30582       "Must Be Zero", HFILL }},
30583
30584     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
30585      {"U-APSD", "wlan.wfa.ie.wme.qos_info.ap.u_apsd",
30586       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
30587       "Indicates the WMM AP is currently supporting unscheduled automatic power save delivery", HFILL }},
30588
30589     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
30590      {"Parameter Set Count", "wlan.wfa.ie.wme.qos_info.ap.parameter_set_count",
30591       FT_UINT8, BASE_HEX, NULL, 0x0F,
30592       NULL, HFILL }},
30593
30594     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
30595      {"Reserved", "wlan.wfa.ie.wme.qos_info.ap.reserved",
30596       FT_UINT8, BASE_HEX, NULL, 0x70,
30597       "Must Be Zero", HFILL }},
30598
30599     {&hf_ieee80211_wfa_ie_wme_reserved,
30600      {"Reserved", "wlan.wfa.ie.wme.reserved",
30601       FT_BYTES, BASE_NONE, NULL, 0,
30602       "Must Be Zero", HFILL }},
30603
30604     {&hf_ieee80211_wfa_ie_wme_ac_parameters,
30605      {"Ac Parameters", "wlan.wfa.ie.wme.acp",
30606       FT_NONE, BASE_NONE, NULL, 0,
30607       NULL, HFILL }},
30608
30609     {&hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
30610      {"ACI / AIFSN Field", "wlan.wfa.ie.wme.acp.aci_aifsn",
30611       FT_UINT8, BASE_HEX, NULL, 0,
30612       NULL, HFILL }},
30613
30614     {&hf_ieee80211_wfa_ie_wme_acp_aci,
30615      {"ACI", "wlan.wfa.ie.wme.acp.aci",
30616       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wme_acs_vals), 0x60,
30617       NULL, HFILL }},
30618
30619     {&hf_ieee80211_wfa_ie_wme_acp_acm,
30620      {"Admission Control Mandatory", "wlan.wfa.ie.wme.acp.acm",
30621       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
30622       NULL, HFILL }},
30623
30624     {&hf_ieee80211_wfa_ie_wme_acp_aifsn,
30625      {"AIFSN", "wlan.wfa.ie.wme.acp.aifsn",
30626       FT_UINT8, BASE_DEC, NULL, 0x0F,
30627       NULL, HFILL }},
30628
30629     {&hf_ieee80211_wfa_ie_wme_acp_reserved,
30630      {"Reserved", "wlan.wfa.ie.wme.acp.reserved",
30631       FT_UINT8, BASE_DEC, NULL, 0x80,
30632       "Must be Zero", HFILL }},
30633
30634     {&hf_ieee80211_wfa_ie_wme_acp_ecw,
30635      {"ECW", "wlan.wfa.ie.wme.acp.ecw",
30636       FT_UINT8, BASE_HEX, NULL, 0x00,
30637       NULL, HFILL }},
30638
30639     {&hf_ieee80211_wfa_ie_wme_acp_ecw_max,
30640      {"ECW Max", "wlan.wfa.ie.wme.acp.ecw.max",
30641       FT_UINT8, BASE_DEC, NULL, 0xF0,
30642       NULL, HFILL }},
30643
30644     {&hf_ieee80211_wfa_ie_wme_acp_ecw_min,
30645      {"ECW Min", "wlan.wfa.ie.wme.acp.ecw.min",
30646       FT_UINT8, BASE_DEC, NULL, 0x0F,
30647       NULL, HFILL }},
30648
30649     {&hf_ieee80211_wfa_ie_wme_acp_cw_max,
30650      {"CW Max", "wlan.wfa.ie.wme.acp.cw.max",
30651       FT_UINT8, BASE_DEC, NULL, 0,
30652       NULL, HFILL }},
30653
30654     {&hf_ieee80211_wfa_ie_wme_acp_cw_min,
30655      {"CW Min", "wlan.wfa.ie.wme.acp.cw.min",
30656       FT_UINT8, BASE_DEC, NULL, 0,
30657       NULL, HFILL }},
30658
30659     {&hf_ieee80211_wfa_ie_wme_acp_txop_limit,
30660      {"TXOP Limit", "wlan.wfa.ie.wme.acp.txop_limit",
30661       FT_UINT16, BASE_DEC, NULL, 0x00,
30662       NULL, HFILL }},
30663
30664     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
30665      {"TS Info", "wlan.wfa.ie.wme.tspec.ts_info",
30666       FT_UINT24, BASE_HEX, NULL, 0,
30667       "Traffic Stream (TS) Info", HFILL }},
30668
30669     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
30670      {"TID", "wlan.wfa.ie.wme.tspec.ts_info.tid",
30671       FT_UINT24, BASE_DEC, NULL, 0x00001E,
30672       "Traffic Stream Info ID (TID)", HFILL }},
30673
30674     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
30675      {"Direction", "wlan.wfa.ie.wme.tspec.ts_info.dir",
30676       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals), 0x000060,
30677       "Traffic Stream (TS) Info Direction", HFILL }},
30678
30679     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
30680      {"PSB", "wlan.wfa.ie.wme.tspec.ts_info.psb",
30681       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals), 0x000400,
30682       "Traffic Stream (TS) Info Power Save Behavior (PSB)", HFILL }},
30683
30684     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
30685      {"UP", "wlan.wfa.ie.wme.tspec.ts_info.up",
30686       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals), 0x003800,
30687       "Traffic Stream (TS) Info User Priority (UP)", HFILL }},
30688
30689     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
30690      {"Reserved", "wlan.wfa.ie.wme.tspec.ts_info.reserved",
30691       FT_UINT24, BASE_HEX, NULL, 0xFFC381,
30692       "Must be Zero", HFILL }},
30693
30694     {&hf_ieee80211_wfa_ie_wme_tspec_nor_msdu,
30695      {"Normal MSDU Size", "wlan.wfa.ie.wme.tspec.nor_msdu",
30696       FT_UINT16, BASE_DEC, NULL, 0,
30697       NULL, HFILL }},
30698
30699     {&hf_ieee80211_wfa_ie_wme_tspec_max_msdu,
30700      {"Maximum MSDU Size", "wlan.wfa.ie.wme.tspec.max_msdu",
30701       FT_UINT16, BASE_DEC, NULL, 0,
30702       NULL, HFILL }},
30703
30704     {&hf_ieee80211_wfa_ie_wme_tspec_min_srv,
30705      {"Minimum Service Interval", "wlan.wfa.ie.wme.tspec.min_srv",
30706       FT_UINT32, BASE_DEC, NULL, 0,
30707       NULL, HFILL }},
30708
30709     {&hf_ieee80211_wfa_ie_wme_tspec_max_srv,
30710      {"Maximum Service Interval", "wlan.wfa.ie.wme.tspec.max_srv",
30711       FT_UINT32, BASE_DEC, NULL, 0,
30712       NULL, HFILL }},
30713
30714     {&hf_ieee80211_wfa_ie_wme_tspec_inact_int,
30715      {"Inactivity Interval", "wlan.wfa.ie.wme.tspec.inact_int",
30716       FT_UINT32, BASE_DEC, NULL, 0,
30717       NULL, HFILL }},
30718
30719     {&hf_ieee80211_wfa_ie_wme_tspec_susp_int,
30720      {"Suspension Interval", "wlan.wfa.ie.wme.tspec.susp_int",
30721       FT_UINT32, BASE_DEC, NULL, 0,
30722       NULL, HFILL }},
30723
30724     {&hf_ieee80211_wfa_ie_wme_tspec_srv_start,
30725      {"Service Start Time", "wlan.wfa.ie.wme.tspec.srv_start",
30726       FT_UINT32, BASE_DEC, NULL, 0,
30727       NULL, HFILL }},
30728
30729     {&hf_ieee80211_wfa_ie_wme_tspec_min_data,
30730      {"Minimum Data Rate", "wlan.wfa.ie.wme.tspec.min_data",
30731       FT_UINT32, BASE_DEC, NULL, 0,
30732       NULL, HFILL }},
30733
30734     {&hf_ieee80211_wfa_ie_wme_tspec_mean_data,
30735      {"Mean Data Rate", "wlan.wfa.ie.wme.tspec.mean_data",
30736       FT_UINT32, BASE_DEC, NULL, 0,
30737       NULL, HFILL }},
30738
30739     {&hf_ieee80211_wfa_ie_wme_tspec_peak_data,
30740      {"Peak Data Rate", "wlan.wfa.ie.wme.tspec.peak_data",
30741       FT_UINT32, BASE_DEC, NULL, 0,
30742       NULL, HFILL }},
30743
30744     {&hf_ieee80211_wfa_ie_wme_tspec_burst_size,
30745      {"Burst Size", "wlan.wfa.ie.wme.tspec.burst_size",
30746       FT_UINT32, BASE_DEC, NULL, 0,
30747       NULL, HFILL }},
30748
30749     {&hf_ieee80211_wfa_ie_wme_tspec_delay_bound,
30750      {"Delay Bound", "wlan.wfa.ie.wme.tspec.delay_bound",
30751       FT_UINT32, BASE_DEC, NULL, 0,
30752       NULL, HFILL }},
30753
30754     {&hf_ieee80211_wfa_ie_wme_tspec_min_phy,
30755      {"Minimum PHY Rate", "wlan.wfa.ie.wme.tspec.min_phy",
30756       FT_UINT32, BASE_DEC, NULL, 0,
30757       NULL, HFILL }},
30758
30759     {&hf_ieee80211_wfa_ie_wme_tspec_surplus,
30760      {"Surplus Bandwidth Allowance", "wlan.wfa.ie.wme.tspec.surplus",
30761       FT_UINT16, BASE_DEC, NULL, 0,
30762       NULL, HFILL }},
30763
30764     {&hf_ieee80211_wfa_ie_wme_tspec_medium,
30765      {"Medium Time", "wlan.wfa.ie.wme.tspec.medium",
30766       FT_UINT16, BASE_DEC, NULL, 0,
30767       NULL, HFILL }},
30768
30769     {&hf_ieee80211_rsn_ie_pmkid,
30770      {"RSN PMKID", "wlan.rsn.ie.pmkid",
30771       FT_BYTES, BASE_NONE, NULL, 0,
30772       NULL, HFILL }},
30773
30774     {&hf_ieee80211_rsn_ie_unknown,
30775      {"RSN Unknown", "wlan.rsn.ie.unknown",
30776       FT_BYTES, BASE_NONE, NULL, 0,
30777       NULL, HFILL }},
30778
30779     {&hf_ieee80211_marvell_ie_type,
30780      {"Type", "wlan.marvell.ie.type",
30781       FT_UINT8, BASE_HEX, NULL, 0,
30782       NULL, HFILL }},
30783
30784     {&hf_ieee80211_marvell_ie_mesh_subtype,
30785      {"Subtype", "wlan.marvell.ie.subtype",
30786       FT_UINT8, BASE_HEX, NULL, 0,
30787       NULL, HFILL }},
30788
30789     {&hf_ieee80211_marvell_ie_mesh_version,
30790      {"Version", "wlan.marvell.ie.version",
30791       FT_UINT8, BASE_HEX, NULL, 0,
30792       NULL, HFILL }},
30793
30794     {&hf_ieee80211_marvell_ie_mesh_active_proto_id,
30795      {"Path Selection Protocol", "wlan.marvell.ie.proto_id",
30796       FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0,
30797       NULL, HFILL }},
30798
30799     {&hf_ieee80211_marvell_ie_mesh_active_metric_id,
30800      {"Path Selection Metric", "wlan.marvell.ie.metric_id",
30801       FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0,
30802       NULL, HFILL }},
30803
30804     {&hf_ieee80211_marvell_ie_mesh_cap,
30805      {"Mesh Capabilities", "wlan.marvell.ie.cap",
30806       FT_UINT8, BASE_HEX, NULL, 0,
30807       NULL, HFILL }},
30808
30809     {&hf_ieee80211_marvell_ie_data,
30810      { "Marvell IE data", "wlan.marvell.data",
30811        FT_BYTES, BASE_NONE, NULL, 0x0,
30812        NULL, HFILL }},
30813
30814     {&hf_ieee80211_atheros_ie_type,
30815      {"Type", "wlan.atheros.ie.type",
30816       FT_UINT8, BASE_HEX, VALS(atheros_ie_type_vals), 0,
30817       NULL, HFILL }},
30818
30819     {&hf_ieee80211_atheros_ie_subtype,
30820      {"Subtype", "wlan.atheros.ie.subtype",
30821       FT_UINT8, BASE_HEX, NULL, 0,
30822       NULL, HFILL }},
30823
30824     {&hf_ieee80211_atheros_ie_version,
30825      {"Version", "wlan.atheros.ie.version",
30826       FT_UINT8, BASE_HEX, NULL, 0,
30827       NULL, HFILL }},
30828
30829     {&hf_ieee80211_atheros_ie_cap_f_turbop,
30830      {"Turbo Prime", "wlan.ie.atheros.capabilities.turbop",
30831       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_TURBOP,
30832       NULL, HFILL }},
30833
30834     {&hf_ieee80211_atheros_ie_cap_f_comp,
30835      {"Compression", "wlan.ie.atheros.capabilities.comp",
30836       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_COMP,
30837       NULL, HFILL }},
30838
30839     {&hf_ieee80211_atheros_ie_cap_f_ff,
30840      {"Fast Frames", "wlan.ie.atheros.capabilities.ff",
30841       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_FF,
30842       NULL, HFILL }},
30843
30844     {&hf_ieee80211_atheros_ie_cap_f_xr,
30845      {"eXtended Range", "wlan.ie.atheros.capabilities.xr",
30846       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_XR,
30847       NULL, HFILL }},
30848
30849     {&hf_ieee80211_atheros_ie_cap_f_ar,
30850      {"Advanced Radar", "wlan.ie.atheros.capabilities.ar",
30851       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_AR,
30852       NULL, HFILL }},
30853
30854     {&hf_ieee80211_atheros_ie_cap_f_burst,
30855      {"Burst", "wlan.ie.atheros.capabilities.burst",
30856       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BURST,
30857       NULL, HFILL }},
30858
30859     {&hf_ieee80211_atheros_ie_cap_f_wme,
30860      {"CWMin tuning", "wlan.ie.atheros.capabilities.wme",
30861       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_WME,
30862       NULL, HFILL }},
30863
30864     {&hf_ieee80211_atheros_ie_cap_f_boost,
30865      {"Boost", "wlan.ie.atheros.capabilities.boost",
30866       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BOOST,
30867       NULL, HFILL }},
30868
30869     {&hf_ieee80211_atheros_ie_advcap_cap,
30870      {"Capabilities", "wlan.atheros.ie.advcap.cap",
30871       FT_UINT8, BASE_HEX, NULL, 0,
30872       NULL, HFILL }},
30873
30874     {&hf_ieee80211_atheros_ie_advcap_defkey,
30875      {"Default key index", "wlan.atheros.ie.advcap.defkey",
30876       FT_UINT16, BASE_HEX, NULL, 0,
30877       NULL, HFILL }},
30878
30879     {&hf_ieee80211_atheros_ie_xr_info,
30880      {"Info", "wlan.atheros.ie.xr.info",
30881       FT_UINT8, BASE_HEX, NULL, 0,
30882       NULL, HFILL }},
30883
30884     {&hf_ieee80211_atheros_ie_xr_base_bssid,
30885      {"Base BSS Id", "wlan.atheros.ie.xr.base_bssid",
30886       FT_ETHER, BASE_NONE, NULL, 0,
30887       NULL, HFILL }},
30888
30889     {&hf_ieee80211_atheros_ie_xr_xr_bssid,
30890      {"XR BSS Id", "wlan.atheros.ie.xr.xr_bssid",
30891       FT_ETHER, BASE_NONE, NULL, 0,
30892       NULL, HFILL }},
30893
30894     {&hf_ieee80211_atheros_ie_xr_xr_beacon,
30895      {"XR Beacon Interval", "wlan.atheros.ie.xr.xr_beacon",
30896       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
30897       NULL, HFILL }},
30898
30899     {&hf_ieee80211_atheros_ie_xr_base_cap,
30900      {"Base capabilities", "wlan.atheros.ie.xr.base_cap",
30901       FT_UINT8, BASE_HEX, NULL, 0,
30902       NULL, HFILL }},
30903
30904     {&hf_ieee80211_atheros_ie_xr_xr_cap,
30905      {"XR capabilities", "wlan.atheros.ie.xr.xr_cap",
30906       FT_UINT8, BASE_HEX, NULL, 0,
30907       NULL, HFILL }},
30908
30909     {&hf_ieee80211_atheros_ie_data,
30910      {"Atheros IE data", "wlan.atheros.data",
30911       FT_BYTES, BASE_NONE, NULL, 0,
30912       NULL, HFILL }},
30913
30914     {&hf_ieee80211_aironet_ie_type,
30915      {"Aironet IE type", "wlan.aironet.type",
30916       FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0,
30917       NULL, HFILL }},
30918
30919     {&hf_ieee80211_aironet_ie_dtpc,
30920      {"Aironet IE CCX DTCP", "wlan.aironet.dtpc",
30921       FT_INT8, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0,
30922       NULL, HFILL }},
30923
30924     {&hf_ieee80211_aironet_ie_dtpc_unknown,
30925      {"Aironet IE CCX DTCP Unknown", "wlan.aironet.dtpc_unknown",
30926       FT_BYTES, BASE_NONE, NULL, 0,
30927       NULL, HFILL }},
30928
30929     {&hf_ieee80211_aironet_ie_version,
30930      {"Aironet IE CCX version", "wlan.aironet.version",
30931       FT_UINT8, BASE_DEC, NULL, 0,
30932       NULL, HFILL }},
30933
30934     {&hf_ieee80211_aironet_ie_data,
30935      { "Aironet IE data", "wlan.aironet.data",
30936        FT_BYTES, BASE_NONE, NULL, 0x0,
30937        NULL, HFILL }},
30938
30939     {&hf_ieee80211_qbss_version,
30940      {"QBSS Version", "wlan.qbss.version",
30941       FT_UINT8, BASE_DEC, NULL, 0,
30942       NULL, HFILL }},
30943
30944     {&hf_ieee80211_qbss_scount,
30945      {"Station Count", "wlan.qbss.scount",
30946       FT_UINT16, BASE_DEC, NULL, 0,
30947       NULL, HFILL }},
30948
30949     {&hf_ieee80211_qbss_cu,
30950      {"Channel Utilization", "wlan.qbss.cu",
30951       FT_UINT8, BASE_DEC, NULL, 0,
30952       NULL, HFILL }},
30953
30954     {&hf_ieee80211_qbss_adc,
30955      {"Available Admission Capacity", "wlan.qbss.adc",
30956       FT_UINT8, BASE_DEC, NULL, 0,
30957       NULL, HFILL }},
30958
30959     {&hf_ieee80211_qbss2_cu,
30960      {"Channel Utilization", "wlan.qbss2.cu",
30961       FT_UINT8, BASE_DEC, NULL, 0,
30962       NULL, HFILL }},
30963
30964     {&hf_ieee80211_qbss2_gl,
30965      {"G.711 CU Quantum", "wlan.qbss2.glimit",
30966       FT_UINT8, BASE_DEC, NULL, 0,
30967       NULL, HFILL }},
30968
30969     {&hf_ieee80211_qbss2_cal,
30970      {"Call Admission Limit", "wlan.qbss2.cal",
30971       FT_UINT8, BASE_DEC, NULL, 0,
30972       NULL, HFILL }},
30973
30974     {&hf_ieee80211_qbss2_scount,
30975      {"Station Count", "wlan.qbss2.scount",
30976       FT_UINT16, BASE_DEC, NULL, 0,
30977       NULL, HFILL }},
30978
30979     {&hf_ieee80211_aironet_ie_qos_reserved,
30980      {"Aironet IE QoS reserved", "wlan.aironet.qos.reserved",
30981       FT_UINT8, BASE_HEX, NULL, 0,
30982       NULL, HFILL }},
30983
30984     {&hf_ieee80211_aironet_ie_qos_paramset,
30985      {"Aironet IE QoS paramset", "wlan.aironet.qos.paramset",
30986       FT_UINT8, BASE_DEC, NULL, 0,
30987       NULL, HFILL }},
30988
30989     {&hf_ieee80211_aironet_ie_qos_val,
30990      {"Aironet IE QoS valueset", "wlan.aironet.qos.val",
30991       FT_BYTES, BASE_NONE, NULL, 0,
30992       NULL, HFILL }},
30993
30994     {&hf_ieee80211_aironet_ie_clientmfp,
30995      {"Aironet IE Client MFP", "wlan.aironet.clientmfp",
30996       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
30997       NULL, HFILL }},
30998
30999     /* Vendor Specific : Nintendo */
31000     {&hf_ieee80211_vs_nintendo_type,
31001      {"Type", "wlan.vs.nintendo.type",
31002       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_nintendo_type_vals), 0,
31003       NULL, HFILL }},
31004
31005     {&hf_ieee80211_vs_nintendo_length,
31006      {"Length", "wlan.vs.nintendo.length",
31007       FT_UINT8, BASE_DEC, NULL, 0,
31008       NULL, HFILL }},
31009
31010     {&hf_ieee80211_vs_nintendo_servicelist,
31011      {"Servicelist", "wlan.vs.nintendo.servicelist",
31012       FT_BYTES, BASE_NONE, NULL, 0,
31013       NULL, HFILL }},
31014
31015     {&hf_ieee80211_vs_nintendo_service,
31016      {"Service", "wlan.vs.nintendo.service",
31017       FT_BYTES, BASE_NONE, NULL, 0,
31018       NULL, HFILL }},
31019
31020     {&hf_ieee80211_vs_nintendo_consoleid,
31021      {"Console ID", "wlan.vs.nintendo.consoleid",
31022       FT_BYTES, BASE_NONE, NULL, 0,
31023       NULL, HFILL }},
31024
31025     {&hf_ieee80211_vs_nintendo_unknown,
31026      {"Unknown", "wlan.vs.nintendo.unknown",
31027       FT_BYTES, BASE_NONE, NULL, 0,
31028       NULL, HFILL }},
31029
31030     /* Vendor Specific : Aruba Networks */
31031     {&hf_ieee80211_vs_aruba_subtype,
31032      {"Subtype", "wlan.vs.aruba.subtype",
31033       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_aruba_subtype_vals), 0,
31034       NULL, HFILL }},
31035
31036     {&hf_ieee80211_vs_aruba_apname,
31037      {"AP Name", "wlan.vs.aruba.ap_name",
31038       FT_STRINGZ, BASE_NONE, NULL, 0,
31039       NULL, HFILL }},
31040
31041     {&hf_ieee80211_vs_aruba_data,
31042      {"Data", "wlan.vs.aruba.data",
31043       FT_BYTES, BASE_NONE, NULL, 0,
31044       NULL, HFILL }},
31045
31046     {&hf_ieee80211_vs_mikrotik_unknown,
31047      {"Unknown", "wlan.vs.mikrotik.unknown",
31048       FT_BYTES, BASE_NONE, NULL, 0,
31049       NULL, HFILL }},
31050
31051     {&hf_ieee80211_vs_mikrotik_subitem,
31052      {"Sub IE", "wlan.vs.mikrotik.unknown",
31053       FT_BYTES, BASE_NONE, NULL, 0,
31054       NULL, HFILL }},
31055
31056     {&hf_ieee80211_vs_mikrotik_subtype,
31057      {"Subtype", "wlan.vs.mikrotik.subtype",
31058       FT_UINT8, BASE_DEC, NULL, 0,
31059       NULL, HFILL }},
31060
31061     {&hf_ieee80211_vs_mikrotik_sublength,
31062      {"Sublength", "wlan.vs.mikrotik.sublength",
31063       FT_UINT8, BASE_DEC, NULL, 0,
31064       NULL, HFILL }},
31065
31066     {&hf_ieee80211_vs_mikrotik_subdata,
31067      {"Subdata", "wlan.vs.mikrotik.subdata",
31068       FT_BYTES, BASE_NONE, NULL, 0,
31069       NULL, HFILL }},
31070
31071     /* Vendor Specific : Meru (Fortinet) */
31072     {&hf_ieee80211_vs_meru_subitem,
31073      {"Sub IE", "wlan.vs.meru.unknown",
31074       FT_NONE, BASE_NONE, NULL, 0,
31075       NULL, HFILL }},
31076
31077     {&hf_ieee80211_vs_meru_subtype,
31078      {"Subtype", "wlan.vs.meru.subtype",
31079       FT_UINT8, BASE_DEC, NULL, 0,
31080       NULL, HFILL }},
31081
31082     {&hf_ieee80211_vs_meru_sublength,
31083      {"Sublength", "wlan.vs.meru.sublength",
31084       FT_UINT8, BASE_DEC, NULL, 0,
31085       NULL, HFILL }},
31086
31087     {&hf_ieee80211_vs_meru_subdata,
31088      {"Subdata", "wlan.vs.meru.subdata",
31089       FT_BYTES, BASE_NONE, NULL, 0,
31090       NULL, HFILL }},
31091
31092     /* Vendor Specific : Extreme (Zebra) */
31093     {&hf_ieee80211_vs_extreme_subtype,
31094      {"Subtype", "wlan.vs.extreme.subtype",
31095       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_extreme_subtype_vals), 0,
31096       NULL, HFILL }},
31097
31098     {&hf_ieee80211_vs_extreme_subdata,
31099      {"Subdata", "wlan.vs.extreme.subdata",
31100       FT_BYTES, BASE_NONE, NULL, 0,
31101       NULL, HFILL }},
31102
31103     {&hf_ieee80211_vs_extreme_unknown,
31104      {"Unknown", "wlan.vs.extreme.unknown",
31105       FT_BYTES, BASE_NONE, NULL, 0,
31106       NULL, HFILL }},
31107
31108     {&hf_ieee80211_vs_extreme_ap_length,
31109      {"AP Length", "wlan.vs.extreme.ap_length",
31110       FT_UINT8, BASE_DEC, NULL, 0,
31111       NULL, HFILL }},
31112
31113     {&hf_ieee80211_vs_extreme_ap_name,
31114      {"AP Name", "wlan.vs.extreme.ap_name",
31115       FT_STRING, BASE_NONE, NULL, 0,
31116       NULL, HFILL }},
31117
31118     /* Vendor Specific : Aerohive */
31119     {&hf_ieee80211_vs_aerohive_unknown,
31120      {"Unknown", "wlan.vs.aerohive.unknown",
31121       FT_BYTES, BASE_NONE, NULL, 0,
31122       NULL, HFILL }},
31123
31124     {&hf_ieee80211_vs_aerohive_hostname_length,
31125      {"Host Name Length", "wlan.vs.aerohive.hostname_length",
31126       FT_UINT8, BASE_DEC, NULL, 0,
31127       NULL, HFILL }},
31128
31129     {&hf_ieee80211_vs_aerohive_hostname,
31130      {"Host Name", "wlan.vs.aerohive.hostname",
31131       FT_STRING, BASE_NONE, NULL, 0,
31132       NULL, HFILL }},
31133
31134     {&hf_ieee80211_vs_aerohive_data,
31135      {"Data", "wlan.vs.aerohive.data",
31136       FT_BYTES, BASE_NONE, NULL, 0,
31137       NULL, HFILL }},
31138
31139     {&hf_ieee80211_tsinfo,
31140      {"Traffic Stream (TS) Info", "wlan.ts_info",
31141       FT_UINT24, BASE_HEX, NULL, 0,
31142       "Traffic Stream (TS) Info field", HFILL }},
31143
31144     {&hf_ieee80211_tsinfo_type,
31145      {"Traffic Type", "wlan.ts_info.type",
31146       FT_UINT24, BASE_DEC, VALS(tsinfo_type), 0x000001,
31147       "Traffic Stream (TS) Info Traffic Type", HFILL }},
31148
31149     {&hf_ieee80211_tsinfo_tsid,
31150      {"Traffic Stream ID (TSID)", "wlan.ts_info.tsid",
31151       FT_UINT24, BASE_DEC, NULL, 0x00001E,
31152       "Traffic Stream ID (TSID) Info TSID", HFILL }},
31153
31154     {&hf_ieee80211_tsinfo_dir,
31155      {"Direction", "wlan.ts_info.dir",
31156       FT_UINT24, BASE_DEC, VALS(tsinfo_direction), 0x000060,
31157       "Traffic Stream (TS) Info Direction", HFILL }},
31158
31159     {&hf_ieee80211_tsinfo_access,
31160      {"Access Policy", "wlan.ts_info.dir",
31161       FT_UINT24, BASE_DEC, VALS(tsinfo_access), 0x000180,
31162       "Traffic Stream (TS) Info Access Policy", HFILL }},
31163
31164     {&hf_ieee80211_tsinfo_agg,
31165      {"Aggregation", "wlan.ts_info.agg",
31166       FT_UINT24, BASE_DEC, NULL, 0x000200,
31167       "Traffic Stream (TS) Info Access Policy", HFILL }},
31168
31169     {&hf_ieee80211_tsinfo_apsd,
31170      {"Automatic Power-Save Delivery (APSD)", "wlan.ts_info.apsd",
31171       FT_UINT24, BASE_DEC, NULL, 0x000400,
31172       "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
31173
31174     {&hf_ieee80211_tsinfo_up,
31175      {"User Priority", "wlan.ts_info.up",
31176       FT_UINT24, BASE_DEC, VALS(qos_up), 0x003800,
31177       "Traffic Stream (TS) Info User Priority", HFILL }},
31178
31179     {&hf_ieee80211_tsinfo_ack,
31180      {"Ack Policy", "wlan.ts_info.ack",
31181       FT_UINT24, BASE_DEC, VALS(ack_policy), 0x00C000,
31182       "Traffic Stream (TS) Info Ack Policy", HFILL }},
31183
31184     {&hf_ieee80211_tsinfo_sched,
31185      {"Schedule", "wlan.ts_info.sched",
31186       FT_UINT24, BASE_DEC, NULL, 0x010000,
31187       "Traffic Stream (TS) Info Schedule", HFILL }},
31188
31189     {&hf_ieee80211_tsinfo_rsv,
31190      {"Reserved", "wlan.ts_info.rsv",
31191       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
31192       "Must be Zero", HFILL }},
31193
31194     {&hf_ieee80211_tspec_nor_msdu,
31195      {"Normal MSDU Size", "wlan.tspec.nor_msdu",
31196       FT_UINT16, BASE_DEC, NULL, 0,
31197       NULL, HFILL }},
31198
31199     {&hf_ieee80211_tspec_max_msdu,
31200      {"Maximum MSDU Size", "wlan.tspec.max_msdu",
31201       FT_UINT16, BASE_DEC, NULL, 0,
31202       NULL, HFILL }},
31203
31204     {&hf_ieee80211_tspec_min_srv,
31205      {"Minimum Service Interval", "wlan.tspec.min_srv",
31206       FT_UINT32, BASE_DEC, NULL, 0,
31207       NULL, HFILL }},
31208
31209     {&hf_ieee80211_tspec_max_srv,
31210      {"Maximum Service Interval", "wlan.tspec.max_srv",
31211       FT_UINT32, BASE_DEC, NULL, 0,
31212       NULL, HFILL }},
31213
31214     {&hf_ieee80211_tspec_inact_int,
31215      {"Inactivity Interval", "wlan.tspec.inact_int",
31216       FT_UINT32, BASE_DEC, NULL, 0,
31217       NULL, HFILL }},
31218
31219     {&hf_ieee80211_tspec_susp_int,
31220      {"Suspension Interval", "wlan.tspec.susp_int",
31221       FT_UINT32, BASE_DEC, NULL, 0,
31222       NULL, HFILL }},
31223
31224     {&hf_ieee80211_tspec_srv_start,
31225      {"Service Start Time", "wlan.tspec.srv_start",
31226       FT_UINT32, BASE_DEC, NULL, 0,
31227       NULL, HFILL }},
31228
31229     {&hf_ieee80211_tspec_min_data,
31230      {"Minimum Data Rate", "wlan.tspec.min_data",
31231       FT_UINT32, BASE_DEC, NULL, 0,
31232       NULL, HFILL }},
31233
31234     {&hf_ieee80211_tspec_mean_data,
31235      {"Mean Data Rate", "wlan.tspec.mean_data",
31236       FT_UINT32, BASE_DEC, NULL, 0,
31237       NULL, HFILL }},
31238
31239     {&hf_ieee80211_tspec_peak_data,
31240      {"Peak Data Rate", "wlan.tspec.peak_data",
31241       FT_UINT32, BASE_DEC, NULL, 0,
31242       NULL, HFILL }},
31243
31244     {&hf_ieee80211_tspec_burst_size,
31245      {"Burst Size", "wlan.tspec.burst_size",
31246       FT_UINT32, BASE_DEC, NULL, 0,
31247       NULL, HFILL }},
31248
31249     {&hf_ieee80211_tspec_delay_bound,
31250      {"Delay Bound", "wlan.tspec.delay_bound",
31251       FT_UINT32, BASE_DEC, NULL, 0,
31252       NULL, HFILL }},
31253
31254     {&hf_ieee80211_tspec_min_phy,
31255      {"Minimum PHY Rate", "wlan.tspec.min_phy",
31256       FT_UINT32, BASE_DEC, NULL, 0,
31257       NULL, HFILL }},
31258
31259     {&hf_ieee80211_tspec_surplus,
31260      {"Surplus Bandwidth Allowance", "wlan.tspec.surplus",
31261       FT_UINT16, BASE_DEC, NULL, 0,
31262       NULL, HFILL }},
31263
31264     {&hf_ieee80211_tspec_medium,
31265      {"Medium Time", "wlan.tspec.medium",
31266       FT_UINT16, BASE_DEC, NULL, 0,
31267       NULL, HFILL }},
31268
31269     {&hf_ieee80211_tspec_dmg,
31270      {"DMG attributes", "wlan.tspec.dmg",
31271       FT_UINT16, BASE_DEC, NULL, 0,
31272       NULL, HFILL }},
31273
31274     {&hf_ieee80211_ts_delay,
31275      {"Traffic Stream (TS) Delay", "wlan.ts_delay",
31276       FT_UINT32, BASE_DEC, NULL, 0,
31277       NULL, HFILL }},
31278
31279     {&hf_ieee80211_tclas_process,
31280      {"Processing", "wlan.tclas_proc.processing",
31281       FT_UINT8, BASE_DEC, VALS(ieee80211_tclas_process_flag), 0,
31282       NULL, HFILL }},
31283
31284     {&hf_ieee80211_tag_ext_supp_rates,
31285      {"Extended Supported Rates", "wlan.extended_supported_rates",
31286       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
31287       "In Mbit/sec, (B) for Basic Rates", HFILL }},
31288
31289     {&hf_ieee80211_sched_info,
31290      {"Schedule Info", "wlan.sched.sched_info",
31291       FT_UINT16, BASE_HEX, NULL, 0,
31292       "Schedule Info field", HFILL }},
31293
31294     {&hf_ieee80211_sched_info_agg,
31295      {"Schedule Aggregation", "wlan.sched_info.agg",
31296       FT_UINT16, BASE_DEC, NULL, 0x0001,
31297       "Traffic Stream (TS) Info Access Policy", HFILL }},
31298
31299     {&hf_ieee80211_sched_info_tsid,
31300      {"Schedule Traffic Stream ID (TSID)", "wlan.sched_info.tsid",
31301       FT_UINT16, BASE_DEC, NULL, 0x001E,
31302       "Traffic Stream ID (TSID) Info TSID", HFILL }},
31303
31304     {&hf_ieee80211_sched_info_dir,
31305      {"Schedule Direction", "wlan.sched_info.dir",
31306       FT_UINT16, BASE_DEC, VALS(tsinfo_direction), 0x0060,
31307       "Traffic Stream (TS) Info Direction", HFILL }},
31308
31309     {&hf_ieee80211_sched_srv_start,
31310      {"Service Start Time", "wlan.sched.srv_start",
31311       FT_UINT32, BASE_HEX, NULL, 0,
31312       NULL, HFILL }},
31313
31314     {&hf_ieee80211_sched_srv_int,
31315      {"Service Interval", "wlan.sched.srv_int",
31316       FT_UINT32, BASE_HEX, NULL, 0,
31317       NULL, HFILL }},
31318
31319     {&hf_ieee80211_sched_spec_int,
31320      {"Specification Interval", "wlan.sched.spec_int",
31321       FT_UINT16, BASE_HEX, NULL, 0,
31322       NULL, HFILL }},
31323
31324     {&hf_ieee80211_aruba,
31325      {"Aruba Type", "wlan.aruba.type",
31326       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &aruba_mgt_typevals_ext, 0,
31327       "Aruba Management", HFILL }},
31328
31329     {&hf_ieee80211_aruba_hb_seq,
31330      {"Aruba Heartbeat Sequence", "wlan.aruba.heartbeat_sequence",
31331       FT_UINT64, BASE_DEC, NULL, 0,
31332       NULL, HFILL }},
31333
31334     {&hf_ieee80211_aruba_mtu,
31335      {"Aruba MTU Size", "wlan.aruba.mtu_size",
31336       FT_UINT16, BASE_DEC, NULL, 0,
31337       NULL, HFILL }},
31338
31339     /* Start: HT Control (+HTC) */
31340     {&hf_ieee80211_htc,
31341      {"HT Control (+HTC)", "wlan.htc",
31342       FT_UINT32, BASE_HEX, NULL, 0,
31343       "High Throughput Control (+HTC)", HFILL }},
31344
31345     {&hf_ieee80211_htc_vht,
31346      {"VHT", "wlan.htc.vht",
31347       FT_BOOLEAN, 32, NULL, HTC_VHT,
31348       "High Throughput Control HT/VHT flag", HFILL }},
31349
31350     {&hf_ieee80211_htc_he,
31351      {"HE", "wlan.htc.he",
31352       FT_BOOLEAN, 32, NULL, HTC_HE,
31353       "High Efficiency Control HE flag", HFILL }},
31354
31355     {&hf_ieee80211_htc_he_ctrl_id,
31356      {"Control ID", "wlan.htc.he.a_control.ctrl_id",
31357       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
31358
31359     {&hf_ieee80211_he_umrs_he_tb_ppdu_len,
31360      {"HE TB PPDU Length", "wlan.htc.he.a_control.umrs.he_tb_ppdu_len",
31361       FT_UINT32, BASE_DEC, NULL, 0x0000001f, NULL, HFILL }},
31362
31363     {&hf_ieee80211_he_umrs_ru_allocation,
31364      {"RU Allocation", "wlan.htc.he.a_control.umrs.ru_allocation",
31365       FT_UINT32, BASE_HEX, NULL, 0x00001fe0, NULL, HFILL }},
31366
31367     {&hf_ieee80211_he_dl_tx_power,
31368      {"DL Tx Power", "wlan.htc.he.a_control.umrs.dl_tx_power",
31369       FT_UINT32, BASE_HEX, NULL, 0x0003e000, NULL, HFILL }},
31370
31371     {&hf_ieee80211_he_ul_target_rssi,
31372      {"UL Target RSSI", "wlan.htc.he.a_control.umrs.ul_target_rssi",
31373       FT_UINT32, BASE_CUSTOM, CF_FUNC(ul_target_rssi_base_custom),
31374       0x007c0000, NULL, HFILL }},
31375
31376     {&hf_ieee80211_he_ul_mcs,
31377      {"UL MCS", "wlan.htc.he.a_control.umrs.ul_mcs",
31378       FT_UINT32, BASE_HEX, NULL, 0x01800000, NULL, HFILL }},
31379
31380     {&hf_ieee80211_he_ul_reserved,
31381      {"reserved", "wlan.htc.he.a_control.umrs.reserved",
31382       FT_UINT32, BASE_HEX, NULL, 0x02000000, NULL, HFILL }},
31383
31384     {&hf_ieee80211_he_om_rx_nss,
31385      {"Rx NSS", "wlan.htc.he.a_control.om.rx_nss",
31386       FT_UINT16, BASE_DEC, NULL, 0x0007, NULL, HFILL }},
31387
31388     {&hf_ieee80211_he_om_channel_width,
31389      {"Channel Width", "wlan.htc.he.a_control.om.channel_width",
31390       FT_UINT16, BASE_DEC, NULL, 0x0018, NULL, HFILL }},
31391
31392     {&hf_ieee80211_he_om_ul_mu_disable,
31393      {"UL MU Disable", "wlan.htc.he.a_control.om.ul_mu_disable",
31394       FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL }},
31395
31396     {&hf_ieee80211_he_om_tx_nsts,
31397      {"Tx NSTS", "wlan.htc.he.a_control.om.tx_nsts",
31398       FT_UINT16, BASE_DEC, NULL, 0x01c0, NULL, HFILL }},
31399
31400     {&hf_ieee80211_he_om_reserved,
31401      {"Reserved", "wlan.htc.he.a_control.om.reserved",
31402       FT_UINT16, BASE_HEX, NULL, 0x0e00, NULL, HFILL }},
31403
31404     {&hf_ieee80211_he_hla_unsolicited_mfb,
31405      {"Unsolicited MFB", "wlan.htc.he.a_control.hla.unsolicited_mfb",
31406       FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL }},
31407
31408     {&hf_ieee80211_he_hla_mrq,
31409      {"MRQ", "wlan.htc.he.a_control.hla.mrq",
31410       FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL }},
31411
31412     {&hf_ieee80211_he_hla_nss,
31413      {"NSS", "wlan.htc.he.a_control.hla.NSS",
31414       FT_UINT32, BASE_DEC, NULL, 0x0000001c, NULL, HFILL }},
31415
31416     {&hf_ieee80211_he_hla_he_mcs,
31417      {"HE-MCS", "wlan.htc.he.a_control.hla.he_mcs",
31418       FT_UINT32, BASE_DEC, NULL, 0x000001e0, NULL, HFILL }},
31419
31420     {&hf_ieee80211_he_hla_dcm,
31421      {"DCM", "wlan.htc.he.a_control.hla.dcm",
31422       FT_BOOLEAN, 32, NULL, 0x00000200, NULL, HFILL }},
31423
31424     {&hf_ieee80211_he_hla_ru,
31425      {"RU", "wlan.htc.he.a_control.hla.ru",
31426       FT_UINT32, BASE_DEC, NULL, 0x0003fc00, NULL, HFILL }},
31427
31428     {&hf_ieee80211_he_hla_bw,
31429      {"BW", "wlan.htc.he.a_control.hla.bw",
31430       FT_UINT32, BASE_DEC, NULL, 0x000c0000, NULL, HFILL }},
31431
31432     {&hf_ieee80211_he_hla_msi_ppdu_type,
31433      {"MSI/PPDU Type", "wlan.htc.he.a_control.hla.msi_ppdu_type",
31434       FT_UINT32, BASE_DEC, NULL, 0x00700000, NULL, HFILL }},
31435
31436     {&hf_ieee80211_he_hla_tx_bf,
31437      {"Tx BF", "wlan.htc.he.a_control.hla.tx_bf",
31438       FT_BOOLEAN, 32, NULL, 0x00800000, NULL, HFILL }},
31439
31440     {&hf_ieee80211_he_hla_reserved,
31441      {"Reserved", "wlan.htc.he.a_control.hla.reserved",
31442       FT_UINT32, BASE_HEX, NULL, 0x03000000, NULL, HFILL }},
31443
31444     {&hf_ieee80211_he_bsr_aci_bitmap,
31445      {"ACI Bitmap", "wlan.htc.he.a_control.bsr.aci_bitmap",
31446       FT_UINT32, BASE_HEX, NULL, 0x0000000f, NULL, HFILL }},
31447
31448     {&hf_ieee80211_he_bsr_delta_tid,
31449      {"Delta TID", "wlan.htc.he.a_control.bsr.delta_tid",
31450       FT_UINT32, BASE_HEX, NULL, 0x00000030, NULL, HFILL }},
31451
31452     {&hf_ieee80211_he_bsr_aci_high,
31453      {"ACI High", "wlan.htc.he.a_control.bsr.aci_high",
31454       FT_UINT32, BASE_HEX, NULL, 0x000000c0, NULL, HFILL }},
31455
31456     {&hf_ieee80211_he_bsr_scaling_factor,
31457      {"Scaling Factor", "wlan.htc.he.a_control.bsr.scaling_factor",
31458       FT_UINT32, BASE_HEX, NULL, 0x00000300, NULL, HFILL }},
31459
31460     {&hf_ieee80211_he_bsr_queue_size_high,
31461      {"Queue Size High", "wlan.htc.he.a_control.bsr.queue_size_high",
31462       FT_UINT32, BASE_HEX, NULL, 0x0003fc00, NULL, HFILL }},
31463
31464     {&hf_ieee80211_he_bsr_queue_size_all,
31465      {"Queue Size All", "wlan.htc.he.a_control.bsr.queue_size_all",
31466       FT_UINT32, BASE_HEX, NULL, 0x03fc0000, NULL, HFILL }},
31467
31468     {&hf_ieee80211_he_uph_ul_power_headroom,
31469      {"UL Power Headroom", "wlan.htc.he.a_control.uph.ul_power_headroom",
31470       FT_UINT8, BASE_DEC, NULL, 0x00000001f, NULL, HFILL }},
31471
31472     {&hf_ieee80211_he_uph_ul_min_transmit_power_flag,
31473      {"Minimum Transmit Power Flag", "wlan.htc.he.a_control.uph.min_transmit_power_flag",
31474       FT_BOOLEAN, 8, NULL, 0x00000020, NULL, HFILL }},
31475
31476     {&hf_ieee80211_he_uph_reserved,
31477      {"Reserved", "wlan.htc.he.a_control.uph.reserved",
31478       FT_UINT8, BASE_HEX, NULL, 0x000000c0, NULL, HFILL }},
31479
31480     {&hf_ieee80211_he_btc_avail_chan,
31481      {"Available Channel Bitmap", "wlan.htc.he.a_control.bqr.avail_chan_bitmap",
31482       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
31483
31484     {&hf_ieee80211_he_btc_reserved,
31485      {"Reserved", "wlan.htc.he.a_control.bqr.reserved",
31486       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
31487
31488     {&hf_ieee80211_he_cci_ac_constraint,
31489      {"AC Constraint", "wlan.htc.he.a_control.cci.ac_constraint",
31490       FT_BOOLEAN, 32, NULL, 0x01, NULL, HFILL }},
31491
31492     {&hf_ieee80211_he_cci_rdg_more_ppdu,
31493      {"RDG/More PPDU", "wlan.htc.he.a_control.cci.rdg_more_ppdu",
31494       FT_BOOLEAN,32, NULL, 0x02, NULL, HFILL }},
31495
31496     {&hf_ieee80211_he_cci_sr_ppdu_indic,
31497      {"SR PPDU Indication", "wlan.htc.he.a_control.cci.sr_ppdu_indic",
31498       FT_BOOLEAN, 32, NULL, 0x04, NULL, HFILL }},
31499
31500     {&hf_ieee80211_he_cci_reserved,
31501      {"Reserved", "wlan.htc.htc.a_control.cci.reserved",
31502       FT_UINT32, BASE_HEX, NULL, 0xF8, NULL, HFILL }},
31503
31504     {&hf_ieee80211_he_trigger_common_info,
31505      {"HE Trigger Common Info", "wlan.trigger.he.common_info",
31506       FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }},
31507
31508     {&hf_ieee80211_he_trigger_type,
31509      {"Trigger Type", "wlan.trigger.he.trigger_type",
31510       FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(trigger_type_vals),
31511         0x000000000000000F, NULL, HFILL }},
31512
31513     {&hf_ieee80211_he_trigger_length,
31514      {"L-SIG Length", "wlan.trigger.he.l_sig_length",
31515       FT_UINT64, BASE_DEC, NULL, 0x000000000000FFF0, NULL, HFILL }},
31516
31517     {&hf_ieee80211_he_trigger_cascade_indication,
31518      {"Cascade Indication", "wlan.trigger.he.cascade_indication",
31519       FT_BOOLEAN, 64, NULL, 0x0000000000010000, NULL, HFILL }},
31520
31521     {&hf_ieee80211_he_trigger_cs_required,
31522      {"CS Required", "wlan.trigger.he.cs_required",
31523       FT_BOOLEAN, 64, NULL, 0x0000000000020000, NULL, HFILL }},
31524
31525     {&hf_ieee80211_he_trigger_bw,
31526      {"BW", "wlan.trigger.he.bw",
31527       FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(bw_subfield_vals), 0x00000000000C0000, NULL, HFILL }},
31528
31529     {&hf_ieee80211_he_trigger_gi_and_ltf_type,
31530      {"GI And LTF Type", "wlan.trigger.he.gi_and_ltf_type",
31531       FT_UINT64, BASE_DEC|BASE_VAL64_STRING, VALS64(gi_and_ltf_type_subfield_vals), 0x0000000000300000,
31532         NULL, HFILL }},
31533
31534     {&hf_ieee80211_he_trigger_mu_mimo_ltf_mode,
31535      {"MU-MIMO LTF Mode", "wlan.trigger.he.mu_mimo_ltf_mode",
31536       FT_BOOLEAN, 64, TFS(&mu_mimo_ltf_mode_tfs), 0x0000000000400000, NULL, HFILL }},
31537
31538     {&hf_ieee80211_he_trigger_num_he_ltf_syms_etc,
31539      {"Number of HE-LTF Symbols and Midamble Periodicity",
31540         "wlan.trigger.he.num_he_ltf_syms_and_midamble_per",
31541       FT_UINT64, BASE_HEX, NULL, 0x0000000003800000, NULL, HFILL }},
31542
31543     {&hf_ieee80211_he_trigger_stbc,
31544      {"STBC", "wlan.trigger.he.stbc",
31545       FT_BOOLEAN, 64, NULL, 0x0000000004000000, NULL, HFILL }},
31546
31547     {&hf_ieee80211_he_trigger_ldpc_extra_sym_seg,
31548      {"LDPC Extra Symbol Segment", "wlan.trigger.he.ldpc_extra_symbol_segment",
31549       FT_BOOLEAN, 64, NULL, 0x0000000008000000, NULL, HFILL }},
31550
31551     {&hf_ieee80211_he_trigger_ap_tx_power,
31552      {"AP TX Power", "wlan.trigger.he.ap_tx_power",
31553       FT_UINT64, BASE_DEC, NULL, 0x00000003F0000000, NULL, HFILL }},
31554
31555     {&hf_ieee80211_he_trigger_packet_extension,
31556      {"Packet Extension", "wlan.trigger.he.packet_extension",
31557       FT_UINT64, BASE_HEX, NULL, 0x0000001C00000000, NULL, HFILL }},
31558
31559     {&hf_ieee80211_he_trigger_spatial_reuse,
31560      {"Spatial Reuse", "wlan.trigger.he.spatial_reuse",
31561       FT_UINT64, BASE_HEX, NULL, 0x001FFFE000000000, NULL, HFILL }},
31562
31563     {&hf_ieee80211_he_trigger_doppler,
31564      {"Doppler", "wlan.trigger.he.doppler",
31565       FT_BOOLEAN, 64, NULL, 0x0020000000000000, NULL, HFILL }},
31566
31567     {&hf_ieee80211_he_trigger_he_sig_a_reserved,
31568      {"HE-SIG-A Reserved", "wlan.trigger.he.he_sig_a_reserved",
31569       FT_UINT64, BASE_HEX, NULL, 0x7FC0000000000000, NULL, HFILL }},
31570
31571     {&hf_ieee80211_he_trigger_reserved,
31572      {"Reserved", "wlan.trigger.he.reserved",
31573       FT_UINT64, BASE_HEX, NULL, 0x8000000000000000, NULL, HFILL }},
31574
31575     {&hf_ieee80211_he_trigger_bar_ctrl,
31576      {"BAR Control", "wlan.trigger.he.common_info.bar_ctrl",
31577       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31578
31579     {&hf_ieee80211_he_trigger_bar_ctrl_ba_ack_policy,
31580      {"BA Ack Policy", "wlan.trigger.he.common_info.bar_ctrl.ba_ack_policy",
31581       FT_BOOLEAN, 16, TFS(&ieee80211_block_ack_control_ack_policy_flag), 0x0001,
31582        NULL, HFILL }},
31583
31584     {&hf_ieee80211_he_trigger_bar_ctrl_ba_type,
31585      {"BA Type", "wlan.trigger.he.common_info.bar_ctrl.ba_type",
31586       FT_UINT16, BASE_HEX, VALS(block_ack_type_vals), 0x001e, NULL, HFILL }},
31587
31588     {&hf_ieee80211_he_trigger_bar_ctrl_reserved,
31589      {"Reserved", "wlan.trigger.he.common_info.bar_ctrl.reserved",
31590       FT_UINT16, BASE_HEX, NULL, 0x0FE0, NULL, HFILL }},
31591
31592     {&hf_ieee80211_he_trigger_bar_ctrl_tid_info,
31593      {"TID_INFO", "wlan.trigger.he.common_info.bar_ctrl.tid_info",
31594       FT_UINT16, BASE_HEX, NULL, 0xF000, NULL, HFILL }},
31595
31596     {&hf_ieee80211_he_trigger_bar_info,
31597      {"BAR Information", "wlan.trigger.he.common_info.bar_info",
31598       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
31599
31600     {&hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl,
31601      {"Block Ack Starting Sequence Control",
31602       "wlan.trigger.he.common_info.bar_info.blk_ack_starting_seq_ctrl",
31603       FT_UINT16, BASE_HEX, NULL, 0xFFFF, NULL, HFILL }},
31604
31605     {&hf_ieee80211_he_trigger_user_info,
31606      {"User Info", "wlan.trigger.he.user_info",
31607       FT_UINT40, BASE_HEX, NULL, 0, NULL, HFILL }},
31608
31609     {&hf_ieee80211_he_trigger_mpdu_mu_spacing,
31610      {"MPDU MU Spacing Factor", "wlan.trigger.he.mpdu_mu_spacing_factor",
31611       FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL }},
31612
31613     {&hf_ieee80211_he_trigger_tid_aggregation_limit,
31614      {"TID Aggregation Limit", "wlan.trigger.he.tid_aggregation_limit",
31615       FT_UINT8, BASE_DEC, NULL, 0x1C, NULL, HFILL }},
31616
31617     {&hf_ieee80211_he_trigger_dependent_reserved1,
31618      {"Reserved", "wlan.trigger.he.reserved1",
31619       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
31620
31621     {&hf_ieee80211_he_trigger_preferred_ac,
31622      {"Preferred AC", "wlan.trigger.he.preferred_ac",
31623       FT_UINT8, BASE_HEX, VALS(preferred_ac_vals), 0xC0, NULL, HFILL }},
31624
31625     {&hf_ieee80211_he_trigger_dep_basic_user_info,
31626      {"Basic Trigger Dependent User Info", "wlan.trigger.he.basic_user_info",
31627       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31628
31629     {&hf_ieee80211_he_trigger_starting_aid,
31630      {"Starting AID", "wlan.trigger.he.starting_aid",
31631       FT_UINT40, BASE_HEX, NULL, 0x0000000FFF, NULL, HFILL }},
31632
31633     {&hf_ieee80211_he_trigger_dependent_reserved2,
31634      {"Reserved", "wlan.trigger.he.reserved2",
31635       FT_UINT40, BASE_HEX, NULL, 0x00001FF000, NULL, HFILL }},
31636
31637     {&hf_ieee80211_he_trigger_feedback_type,
31638      {"Feedback Type", "wlan.trigger.he.feedback_type",
31639       FT_UINT40, BASE_HEX, NULL, 0x0001E00000, NULL, HFILL }},
31640
31641     {&hf_ieee80211_he_trigger_dependent_reserved3,
31642      {"Reserved", "wlan.trigger.he.reserved3",
31643       FT_UINT40, BASE_HEX, NULL, 0x00FE000000, NULL, HFILL }},
31644
31645     {&hf_ieee80211_he_trigger_nfrp_target_rssi,
31646      {"Target RSSI", "wlan.trigger.he.target_rssi",
31647       FT_UINT40, BASE_CUSTOM, CF_FUNC(target_rssi_base_custom), 0x7F00000000,
31648        NULL, HFILL }},
31649
31650     {&hf_ieee80211_he_trigger_multiplexing_flag,
31651      {"Multiplexing Flag", "wlan.trigger.he.multiplexing_flag",
31652       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
31653
31654     {&hf_ieee80211_he_trigger_dep_nfrp_user_info,
31655      {"NFRP Trigger Dependent User Unfo", "wlan.trigger.he.nfrp_user_info",
31656       FT_UINT40, BASE_HEX, NULL, 0, NULL, HFILL }},
31657
31658     {&hf_ieee80211_he_trigger_feedback_seg_retrans_bm,
31659      {"Feedback Segment Retransmission Bitmap", "wlan.trigger.he.feedback_bm",
31660       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31661
31662     {&hf_ieee80211_he_trigger_aid12,
31663      {"AID12", "wlan.trigger.he.user_info.aid12",
31664       FT_UINT40, BASE_HEX, NULL, 0x0000000FFF, NULL, HFILL }},
31665
31666     {&hf_ieee80211_he_trigger_ru_allocation,
31667      {"RU Allocation", "wlan.trigger.he.ru_allocation",
31668       FT_UINT40, BASE_HEX, NULL, 0x00000FF000, NULL, HFILL }},
31669
31670     {&hf_ieee80211_he_trigger_coding_type,
31671      {"Coding Type", "wlan.trigger.he.coding_type",
31672       FT_BOOLEAN, 40, TFS(&he_trigger_coding_type_tfs), 0x0000100000,
31673         NULL, HFILL }},
31674
31675     {&hf_ieee80211_he_trigger_mcs,
31676      {"MCS", "wlan.trigger.he.mcs",
31677       FT_UINT40, BASE_HEX, NULL, 0x0001E00000, NULL, HFILL }},
31678
31679     {&hf_ieee80211_he_trigger_dcm,
31680      {"DCM", "wlan.trigger.he.dcm",
31681       FT_BOOLEAN, 40, NULL, 0x0002000000, NULL, HFILL }},
31682
31683     {&hf_ieee80211_he_trigger_ss_allocation,
31684      {"SS Alloc/Random Access RU Info", "wlan.trigger.he.ss_alloc",
31685       FT_UINT40, BASE_HEX, NULL, 0x00FC000000, NULL, HFILL }},
31686
31687     {&hf_ieee80211_he_trigger_target_rssi,
31688      {"Target RSSI", "wlan.trigger.he.target_rssi",
31689       FT_UINT40, BASE_CUSTOM, CF_FUNC(target_rssi_base_custom), 0x7F00000000,
31690        NULL, HFILL }},
31691
31692     {&hf_ieee80211_he_trigger_user_reserved,
31693      {"Reserved", "wlan.trigger.he.user_reserved",
31694       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
31695
31696     {&hf_he_ndp_sounding_dialog_token_number,
31697      {"Sounding Dialog Token Number", "wlan.he_ndp.token.number",
31698       FT_UINT8, BASE_DEC, NULL, 0xFC,
31699       NULL, HFILL }},
31700
31701     {&hf_he_ndp_annc_he_subfield,
31702      {"HE", "wlan.vht_he.token.he",
31703       FT_BOOLEAN, 8, TFS(&he_ndp_annc_he_subfield_vals), 0x02, NULL, HFILL }},
31704
31705     {&hf_he_ndp_annc_reserved,
31706      {"Reserved", "wlan.he_ndp.token.reserved",
31707       FT_UINT8, BASE_HEX, NULL, 0x01,
31708       NULL, HFILL }},
31709
31710     {&hf_ieee80211_he_ndp_annc_token,
31711      {"Sounding Dialog Token", "wlan.he_ndp.token",
31712       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
31713
31714     {&hf_ieee80211_he_ndp_annc_sta,
31715      {"STA Info", "wlan.he_ndp.sta_info",
31716       FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
31717
31718     {&hf_he_ndp_annc_aid11,
31719      {"AID11", "wlan.he_ndp.sta_info.aid11",
31720       FT_UINT32, BASE_HEX, NULL, 0x000007FF, NULL, HFILL }},
31721
31722     {&hf_he_ndp_annc_partial_bw_info,
31723      {"Partial BW Info", "wlan.he_ndp.sta_info.partial_bw_info",
31724       FT_UINT32, BASE_CUSTOM, CF_FUNC(partial_bw_info_base_custom), 0x01FFF800,
31725        NULL, HFILL }},
31726
31727     {&hf_he_ndp_annc_feedback_type_and_ng,
31728      {"Feedback Type and Ng", "wlan.he_ndp.sta_info.feedback_type_and_ng",
31729       FT_UINT32, BASE_HEX, NULL, 0x06000000, NULL, HFILL }},
31730
31731     {&hf_he_ndp_annc_disambiguation,
31732      {"Disambiguation", "wlan.he_ndp.sta_info.disambiguation",
31733       FT_UINT32, BASE_HEX, NULL, 0x08000000, NULL, HFILL }},
31734
31735     {&hf_he_ndp_annc_codebook_size,
31736      {"Codebook Size", "wlan.he_ndp.sta_info.codebook_size",
31737       FT_UINT32, BASE_HEX, NULL, 0x10000000, NULL, HFILL }},
31738
31739     {&hf_he_ndp_annc_nc,
31740      {"Nc", "wlan.he_ndp.sta_info.nc",
31741       FT_UINT32, BASE_HEX, NULL, 0xE0000000, NULL, HFILL }},
31742
31743     {&hf_ieee80211_htc_ht_lac,
31744      {"Link Adaptation Control (LAC)", "wlan.htc.lac",
31745       FT_UINT32, BASE_HEX, NULL, 0x0000FFFE,
31746       "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
31747
31748     {&hf_ieee80211_htc_lac_trq,
31749      {"Training Request (TRQ)", "wlan.htc.lac.trq",
31750       FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002,
31751       "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
31752
31753     {&hf_ieee80211_htc_lac_mai_aseli,
31754      {"Antenna Selection Indication (ASELI)", "wlan.htc.lac.mai.aseli",
31755       FT_UINT16, BASE_HEX, NULL, 0x003C,
31756       "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
31757
31758     {&hf_ieee80211_htc_lac_mai_mrq,
31759      {"MCS Request (MRQ)", "wlan.htc.lac.mai.mrq",
31760       FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004,
31761       "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
31762
31763     {&hf_ieee80211_htc_lac_mai_msi,
31764      {"MCS Request Sequence Identifier (MSI)", "wlan.htc.lac.mai.msi",
31765       FT_UINT16, BASE_HEX, NULL, 0x0038,
31766       "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
31767
31768     {&hf_ieee80211_htc_lac_mai_reserved,
31769      {"Reserved", "wlan.htc.lac.mai.reserved",
31770       FT_UINT16, BASE_HEX, NULL, 0x0038,
31771       "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
31772
31773     {&hf_ieee80211_htc_lac_mfsi,
31774      {"MCS Feedback Sequence Identifier (MFSI)", "wlan.htc.lac.mfsi",
31775       FT_UINT16, BASE_DEC, NULL, 0x01C0,
31776       "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
31777
31778     {&hf_ieee80211_htc_lac_asel_command,
31779      {"Antenna Selection (ASEL) Command", "wlan.htc.lac.asel.command",
31780       FT_UINT16, BASE_HEX, VALS(ieee80211_htc_lac_asel_command_flags), 0x0E00,
31781       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
31782
31783     {&hf_ieee80211_htc_lac_asel_data,
31784      {"Antenna Selection (ASEL) Data", "wlan.htc.lac.asel.data",
31785       FT_UINT16, BASE_HEX, NULL, 0xF000,
31786       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
31787
31788     {&hf_ieee80211_htc_lac_mfb,
31789      {"MCS Feedback (MFB)", "wlan.htc.lac.mfb",
31790       FT_UINT16, BASE_HEX, NULL, 0xFE00,
31791       "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
31792
31793     {&hf_ieee80211_htc_cal_pos,
31794      {"Calibration Position", "wlan.htc.cal.pos",
31795       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_cal_pos_flags), 0x00030000,
31796       "High Throughput Control Calibration Position", HFILL }},
31797
31798     {&hf_ieee80211_htc_cal_seq,
31799      {"Calibration Sequence Identifier", "wlan.htc.cal.seq",
31800       FT_UINT32, BASE_DEC, NULL, 0x000C0000,
31801       "High Throughput Control Calibration Sequence Identifier", HFILL }},
31802
31803     {&hf_ieee80211_htc_reserved1,
31804      {"Reserved", "wlan.htc.reserved1",
31805       FT_UINT32, BASE_HEX, NULL, 0x00300000,
31806       "High Throughput Control Reserved", HFILL }},
31807
31808     {&hf_ieee80211_htc_csi_steering,
31809      {"CSI/Steering", "wlan.htc.csi_steering",
31810       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_csi_steering_flags), 0x00C00000,
31811       "High Throughput Control CSI/Steering", HFILL }},
31812
31813     {&hf_ieee80211_htc_ndp_announcement,
31814      {"NDP Announcement", "wlan.htc.ndp_announcement",
31815       FT_BOOLEAN, 32, TFS(&ieee80211_htc_ndp_announcement_flag), 0x01000000,
31816       "High Throughput Control NDP Announcement", HFILL }},
31817
31818     {&hf_ieee80211_htc_reserved2,
31819      {"Reserved", "wlan.htc.reserved2",
31820       FT_UINT32, BASE_HEX, NULL, 0x3E000000,
31821       "High Throughput Control Reserved", HFILL }},
31822
31823     {&hf_ieee80211_htc_mrq,
31824      {"MRQ", "wlan.htc.mrq",
31825       FT_BOOLEAN, 32, NULL, HTC_MRQ,
31826       "VHT-MCS feedback request", HFILL }},
31827
31828     {&hf_ieee80211_htc_msi,
31829      {"MSI", "wlan.htc.msi",
31830       FT_UINT32, BASE_DEC, NULL, 0x00000038,
31831       "MRQ sequence number", HFILL }},
31832
31833     {&hf_ieee80211_htc_msi_stbc_reserved,
31834      {"Reserved", "wlan.htc.msi_stbc_reserved",
31835       FT_UINT32, BASE_HEX, NULL, 0x00000038,
31836       NULL, HFILL }},
31837
31838     {&hf_ieee80211_htc_compressed_msi,
31839      {"Compressed MSI", "wlan.htc.compressed_msi",
31840       FT_UINT32, BASE_DEC, NULL, 0x00000018,
31841       NULL, HFILL }},
31842
31843     {&hf_ieee80211_htc_ppdu_stbc_encoded,
31844      {"PPDU was STBC encoded", "wlan.htc.ppdu_stbc_encoded",
31845       FT_BOOLEAN, 32, NULL, 0x00000020,
31846       NULL, HFILL }},
31847
31848     {&hf_ieee80211_htc_mfsi,
31849      {"MFSI", "wlan.htc.mfsi",
31850       FT_BOOLEAN, 32, NULL, 0x000001C0,
31851       "MFB sequence identifier", HFILL }},
31852
31853     {&hf_ieee80211_htc_gid_l,
31854      {"GID-L", "wlan.htc.gid_l",
31855       FT_BOOLEAN, 32, NULL, 0x000001C0,
31856       "LSBs of group ID", HFILL }},
31857
31858     {&hf_ieee80211_htc_mfb,
31859      {"MFB", "wlan.htc.mfb",
31860       FT_UINT32, BASE_HEX, NULL, 0x00FFFE00,
31861       "Recommended MFB", HFILL }},
31862
31863     {&hf_ieee80211_htc_num_sts,
31864      {"NUM_STS", "wlan.htc.num_sts",
31865       FT_UINT32, BASE_DEC, NULL, 0x00000E00,
31866       "Recommended NUM_STS", HFILL }},
31867
31868     {&hf_ieee80211_htc_vht_mcs,
31869      {"VHT-MCS", "wlan.htc.vht_mcs",
31870       FT_UINT32, BASE_DEC, NULL, 0x0000F000,
31871       "Recommended VHT-MCS", HFILL }},
31872
31873     {&hf_ieee80211_htc_bw,
31874      {"BW", "wlan.htc.bw",
31875       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_bw_recommended_vht_mcs_vals), 0x00030000,
31876       "Bandwidth for recommended VHT-MCS", HFILL }},
31877
31878     {&hf_ieee80211_htc_snr,
31879      {"SNR", "wlan.htc.snr",
31880       FT_INT32, BASE_DEC, NULL, 0x00FC0000,
31881       "Average SNR + 22", HFILL }},
31882
31883     {&hf_ieee80211_htc_reserved3,
31884      {"Reserved", "wlan.htc.reserved3",
31885       FT_UINT32, BASE_HEX, NULL, 0x1F000000,
31886       NULL, HFILL }},
31887
31888     {&hf_ieee80211_htc_gid_h,
31889      {"GID-H", "wlan.htc.gid_h",
31890       FT_UINT32, BASE_DEC, NULL, 0x07000000,
31891       NULL, HFILL }},
31892
31893     {&hf_ieee80211_htc_coding_type,
31894      {"Coding type", "wlan.htc.coding_type",
31895       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_coding_type_vals), 0x08000000,
31896       NULL, HFILL }},
31897
31898     {&hf_ieee80211_htc_fb_tx_type,
31899      {"FB Tx type", "wlan.htc.fb_tx_type",
31900       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_fb_tx_type_vals), 0x10000000,
31901       NULL, HFILL }},
31902
31903     {&hf_ieee80211_htc_unsolicited_mfb,
31904      {"Unsolicited MFB", "wlan.htc.unsolicited_mfb",
31905       FT_BOOLEAN, 32, NULL, HTC_UNSOLICITED_MFB,
31906       "High Throughput Control Unsolicited MFB", HFILL }},
31907
31908     {&hf_ieee80211_htc_ac_constraint,
31909      {"AC Constraint", "wlan.htc.ac_constraint",
31910       FT_BOOLEAN, 32, NULL, 0x40000000,
31911       "High Throughput Control AC Constraint", HFILL }},
31912
31913     {&hf_ieee80211_htc_rdg_more_ppdu,
31914      {"RDG/More PPDU", "wlan.htc.rdg_more_ppdu",
31915       FT_BOOLEAN, 32, NULL, 0x80000000,
31916       "High Throughput Control RDG/More PPDU", HFILL }},
31917     /* End: HT Control (+HTC) */
31918
31919     /* MDIE */
31920     {&hf_ieee80211_tag_mobility_domain_mdid,
31921      {"Mobility Domain Identifier", "wlan.mobility_domain.mdid",
31922       FT_UINT16, BASE_HEX, NULL, 0,
31923       NULL, HFILL }},
31924
31925     {&hf_ieee80211_tag_mobility_domain_ft_capab,
31926      {"FT Capability and Policy", "wlan.mobility_domain.ft_capab",
31927       FT_UINT8, BASE_HEX, NULL, 0,
31928       NULL, HFILL }},
31929
31930     {&hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
31931      {"Fast BSS Transition over DS",
31932       "wlan.mobility_domain.ft_capab.ft_over_ds",
31933       FT_UINT8, BASE_HEX, NULL, 0x01,
31934       NULL, HFILL }},
31935
31936     {&hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
31937      {"Resource Request Protocol Capability",
31938       "wlan.mobility_domain.ft_capab.resource_req",
31939       FT_UINT8, BASE_HEX, NULL, 0x02,
31940       NULL, HFILL }},
31941
31942     /* FTIE */
31943     {&hf_ieee80211_tag_ft_mic_control,
31944      {"MIC Control", "wlan.ft.mic_control",
31945       FT_UINT16, BASE_HEX, NULL, 0,
31946       NULL, HFILL }},
31947
31948     {&hf_ieee80211_tag_ft_element_count,
31949      {"Element Count", "wlan.ft.element_count",
31950       FT_UINT16, BASE_DEC, NULL, 0xff00,
31951       NULL, HFILL }},
31952
31953     {&hf_ieee80211_tag_ft_mic,
31954      {"MIC", "wlan.ft.mic",
31955       FT_BYTES, BASE_NONE, NULL, 0,
31956       NULL, HFILL }},
31957
31958     {&hf_ieee80211_tag_ft_anonce,
31959      {"ANonce", "wlan.ft.anonce",
31960       FT_BYTES, BASE_NONE, NULL, 0,
31961       NULL, HFILL }},
31962
31963     {&hf_ieee80211_tag_ft_snonce,
31964      {"SNonce", "wlan.ft.snonce",
31965       FT_BYTES, BASE_NONE, NULL, 0,
31966       NULL, HFILL }},
31967
31968     {&hf_ieee80211_tag_ft_subelem_id,
31969      {"Subelement ID", "wlan.ft.subelem.id",
31970       FT_UINT8, BASE_DEC, VALS(ft_subelem_id_vals), 0,
31971       NULL, HFILL }},
31972
31973     {&hf_ieee80211_tag_ft_subelem_len,
31974      {"Length", "wlan.ft.subelem.len",
31975       FT_UINT8, BASE_DEC, NULL, 0,
31976       NULL, HFILL }},
31977
31978     {&hf_ieee80211_tag_ft_subelem_data,
31979      {"Data", "wlan.ft.subelem.data",
31980       FT_BYTES, BASE_NONE, NULL, 0,
31981       NULL, HFILL }},
31982
31983     {&hf_ieee80211_tag_ft_subelem_r1kh_id,
31984      {"PMK-R1 key holder identifier (R1KH-ID)", "wlan.ft.subelem.r1kh_id",
31985       FT_BYTES, BASE_NONE, NULL, 0,
31986       NULL, HFILL }},
31987
31988     {&hf_ieee80211_tag_ft_subelem_gtk_key_info,
31989      {"Key Info", "wlan.ft.subelem.gtk.key_info",
31990       FT_UINT16, BASE_HEX, NULL, 0,
31991       NULL, HFILL }},
31992
31993     {&hf_ieee80211_tag_ft_subelem_gtk_key_id,
31994      {"Key ID", "wlan.ft.subelem.gtk.key_id",
31995       FT_UINT16, BASE_DEC, NULL, 0x0003,
31996       NULL, HFILL }},
31997
31998     {&hf_ieee80211_tag_ft_subelem_gtk_key_length,
31999      {"Key Length", "wlan.ft.subelem.gtk.key_length",
32000       FT_UINT8, BASE_HEX, NULL, 0,
32001       NULL, HFILL }},
32002
32003     {&hf_ieee80211_tag_ft_subelem_gtk_rsc,
32004      {"RSC", "wlan.ft.subelem.gtk.rsc",
32005       FT_BYTES, BASE_NONE, NULL, 0,
32006       NULL, HFILL }},
32007
32008     {&hf_ieee80211_tag_ft_subelem_gtk_key,
32009      {"GTK", "wlan.ft.subelem.gtk.key",
32010       FT_BYTES, BASE_NONE, NULL, 0,
32011       NULL, HFILL }},
32012
32013     {&hf_ieee80211_tag_ft_subelem_r0kh_id,
32014      {"PMK-R0 key holder identifier (R0KH-ID)", "wlan.ft.subelem.r0kh_id",
32015       FT_BYTES, BASE_NONE, NULL, 0,
32016       NULL, HFILL }},
32017
32018     {&hf_ieee80211_tag_ft_subelem_igtk_key_id,
32019      {"Key ID", "wlan.ft.subelem.igtk.key_id",
32020       FT_UINT16, BASE_DEC, NULL, 0,
32021       NULL, HFILL }},
32022
32023     {&hf_ieee80211_tag_ft_subelem_igtk_ipn,
32024      {"IPN", "wlan.ft.subelem.igtk.ipn",
32025       FT_BYTES, BASE_NONE, NULL, 0,
32026       NULL, HFILL }},
32027
32028     {&hf_ieee80211_tag_ft_subelem_igtk_key_length,
32029      {"Key Length", "wlan.ft.subelem.igtk.key_length",
32030       FT_UINT8, BASE_HEX, NULL, 0,
32031       NULL, HFILL }},
32032
32033     {&hf_ieee80211_tag_ft_subelem_igtk_key,
32034      {"Wrapped Key (IGTK)", "wlan.ft.subelem.igtk.key",
32035       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32036
32037     /* RIC Data IE: 802.11-2012: 8.4.2.52 */
32038     {&hf_ieee80211_tag_ric_data_id,
32039      {"Resource Handshake Identifier", "wlan.ric_data.id",
32040       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32041
32042     {&hf_ieee80211_tag_ric_data_desc_cnt,
32043      {"Resource Descriptor Count", "wlan.ric_data.desc_cnt",
32044       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32045
32046     {&hf_ieee80211_tag_ric_data_status_code,
32047      {"Status Code", "wlan.ric_data.status_code",
32048       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
32049       "Status of requested Resource", HFILL }},
32050
32051     /* OBSS IE: 802.11-2012: 8.4.2.61 */
32052     {&hf_ieee80211_tag_obss_spd,
32053      {"Scan Passive Dwell", "wlan.obss.spd",
32054       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32055
32056     {&hf_ieee80211_tag_obss_sad,
32057      {"Scan Active Dwell", "wlan.obss.sad",
32058       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32059
32060     {&hf_ieee80211_tag_obss_cwtsi,
32061      {"Channel Width Trigger Scan Interval", "wlan.obss.cwtsi",
32062       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32063
32064     {&hf_ieee80211_tag_obss_sptpc,
32065      {"Scan Passive Total Per Channel", "wlan.obss.sptpc",
32066       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32067
32068     {&hf_ieee80211_tag_obss_satpc,
32069      {"Scan Active Total Per Channel", "wlan.obss.satpc",
32070       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32071
32072     {&hf_ieee80211_tag_obss_wctdf,
32073      {"Width Channel Transition Delay Factor", "wlan.obss.wctdf",
32074       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32075
32076     {&hf_ieee80211_tag_obss_sat,
32077      {"Scan Activity Threshold", "wlan.obss.sat",
32078       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32079
32080     /* Group Data Cypher Suite: 802.11-2012: 8.4.2.25.1 */
32081     {&hf_group_data_cipher_suite_oui,
32082      {"Group Data Cypher Suite OUI", "wlan.osen.gdcs.oui",
32083       FT_UINT24, BASE_OUI, NULL, 0, NULL, HFILL }},
32084
32085     /* TODO: List the suite names ... */
32086     {&hf_group_data_cipher_suite_type,
32087      {"Group Data Cypher Suite type", "wlan.osen.gdcs.type",
32088       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32089
32090     {&hf_osen_pcs_count,
32091      {"OSEN Pairwise Cipher Suite Count", "wlan.osen.pwcs.count",
32092       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32093
32094     {&hf_osen_pairwise_cipher_suite_oui,
32095      {"OSEN Pairwise Cypher Suite OUI", "wlan.osen.pwcs.oui",
32096       FT_UINT24, BASE_OUI, NULL, 0, NULL, HFILL }},
32097
32098     {&hf_osen_pairwise_cipher_suite_type,
32099      {"OSEN Pairwise Cypher Suite type", "wlan.osen.pwcs.type",
32100       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32101
32102     {&hf_osen_akm_count,
32103      {"OSEN AKM Cipher Suite Count", "wlan.osen.akms.count",
32104       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32105
32106     {&hf_osen_akm_cipher_suite_oui,
32107      {"OSEN AKM Cipher Suite OUI", "wlan.osen.akms.oui",
32108       FT_UINT24, BASE_OUI, NULL, 0, NULL, HFILL }},
32109
32110     {&hf_osen_akm_cipher_suite_type,
32111      {"OSEN AKM Cipher Suite Type", "wlan.osen.akms.type",
32112       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32113
32114     {&hf_osen_rsn_cap_preauth,
32115      {"RSN Pre-Auth capabilities", "wlan.osen.rsn.capabilities.preauth",
32116       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001, NULL, HFILL }},
32117
32118     {&hf_osen_rsn_cap_no_pairwise,
32119      {"RSN No Pairwise capabilities", "wlan.osen.rsn.capabilities.no_pairwise",
32120       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002, NULL, HFILL }},
32121
32122     {&hf_osen_rsn_cap_ptksa_replay_counter,
32123      {"RSN PTKSA Replay Counter capabilities",
32124                 "wlan.osen.rsn.capabilities.ptksa_replay_counter",
32125       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C, NULL, HFILL }},
32126
32127     {&hf_osen_rsn_cap_gtksa_replay_counter,
32128      {"RSN GTKSA Replay Counter capabilities",
32129                 "wlan.osen.rsn.capabilities.gtksa_replay_counter",
32130       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030, NULL, HFILL }},
32131
32132     {&hf_osen_group_management_cipher_suite_oui,
32133      {"OSEN Group Management Cipher Suite OUI", "wlan.osen.gmcs.oui",
32134       FT_UINT24, BASE_OUI, NULL, 0, NULL, HFILL }},
32135
32136     {&hf_osen_group_management_cipher_suite_type,
32137      {"OSEN Group Management Cipher Suite Type", "wlan.osen.gmcs.type",
32138       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32139
32140     {&hf_osen_rsn_cap_mfpr,
32141      {"Management Frame Protection Required", "wlan.osen.rsn.capabilities.mfpr",
32142       FT_BOOLEAN, 16, TFS(&tfs_required_not_required), 0x0040, NULL, HFILL }},
32143
32144     {&hf_osen_rsn_cap_mfpc,
32145      {"Management Frame Protection Capable", "wlan.osen.rsn.capabilities.mfpc",
32146       FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x0080, NULL, HFILL }},
32147
32148     {&hf_osen_rsn_cap_jmr,
32149      {"Joint Multi-band RSNA", "wlan.osen.rsn.capabilities.jmr",
32150       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
32151
32152     {&hf_osen_rsn_cap_peerkey,
32153      {"PeerKey Enabled", "wlan.osen.rsn.capabilities.peerkey",
32154       FT_BOOLEAN, 16, TFS(&tfs_enabled_disabled), 0x200, NULL, HFILL }},
32155
32156     {&hf_osen_rsn_cap_flags,
32157      {"RSN Capability Flags", "wlan.osen.rsn.cabailities.flags",
32158       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
32159
32160     {&hf_osen_rsn_spp_a_msdu_capable,
32161      {"SPP A-MSDU Capable", "wlan.osen.rsn.capabilities.spp_a_msdu_cap",
32162       FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x0400, NULL, HFILL }},
32163
32164     {&hf_osen_rsn_spp_a_msdu_required,
32165      {"SPP A-MSDU Required", "wlan.osen.rsn.capabilities.spp_a_msdu_req",
32166       FT_BOOLEAN, 16, TFS(&tfs_required_not_required), 0x0800, NULL, HFILL }},
32167
32168     {&hf_osen_rsn_pbac,
32169      {"Protected Block Ack Agreement Capable", "wlan.osen.rsn.capabilities.pbac",
32170       FT_BOOLEAN, 16, TFS(&tfs_capable_not_capable), 0x1000, NULL, HFILL }},
32171
32172     {&hf_osen_extended_key_id_iaf,
32173      {"Extended Key ID for Individually Addressed Frames",
32174                 "wlan.osn.rsn.extended_key_id_iaf",
32175       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
32176
32177     {&hf_osen_reserved,
32178      {"Reserved", "wlan.osen.rsn.capabilities.reserved",
32179       FT_UINT16, BASE_HEX, NULL, 0xC000, NULL, HFILL }},
32180
32181     {&hf_osen_pmkid_count,
32182      {"OSEN PMKID Count", "wlan.osen.pmkid.count",
32183       FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
32184
32185     {&hf_osen_pmkid,
32186      {"OSEN PKMID", "wlan.osen.pmkid.bytes",
32187       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32188
32189     /* RIC Descriptor IE: 802.11-2012: 8.4.2.53 */
32190     {&hf_ieee80211_tag_ric_desc_rsrc_type,
32191      {"Resource Type", "wlan.ric_desc.rsrc_type",
32192       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32193
32194     {&hf_ieee80211_tag_ric_desc_var_params,
32195      {"Variable Params", "wlan.ric_desc.var_params",
32196       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32197
32198     /* MMIE */
32199     {&hf_ieee80211_tag_mmie_keyid,
32200      {"KeyID", "wlan.mmie.keyid",
32201       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32202
32203     {&hf_ieee80211_tag_mmie_ipn,
32204      {"IPN", "wlan.mmie.ipn",
32205       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32206
32207     {&hf_ieee80211_tag_mmie_mic,
32208      {"MIC", "wlan.mmie.mic",
32209       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
32210
32211     /* WAPI Parameter Set*/
32212     {&hf_ieee80211_tag_wapi_param_set_version,
32213      {"Version", "wlan.wapi.version",
32214       FT_UINT16, BASE_DEC, NULL, 0,
32215       NULL, HFILL }},
32216
32217     {&hf_ieee80211_tag_wapi_param_set_akm_suite_count,
32218      {"AKM Suite Count", "wlan.wapi.akm_suite.count",
32219       FT_UINT16, BASE_DEC, NULL, 0,
32220       NULL, HFILL }},
32221
32222     {&hf_ieee80211_tag_wapi_param_set_akm_suite_oui,
32223      {"AKM Suite OUI", "wlan.wapi.akm_suite.oui",
32224       FT_UINT24, BASE_OUI, NULL, 0,
32225       NULL, HFILL }},
32226
32227     {&hf_ieee80211_tag_wapi_param_set_akm_suite_type,
32228      {"AKM Suite Type", "wlan.wapi.akm_suite.type",
32229       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_suite_type) , 0,
32230       NULL, HFILL }},
32231
32232     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
32233      {"Unicast Cipher Suite Count", "wlan.wapi.unicast_cipher.suite.count",
32234       FT_UINT16, BASE_DEC, NULL, 0,
32235       NULL, HFILL }},
32236
32237     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui,
32238      {"Unicast Cipher Suite OUI", "wlan.wapi.unicast_cipher.suite.oui",
32239       FT_UINT24, BASE_OUI, NULL, 0,
32240       NULL, HFILL }},
32241
32242     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type,
32243      {"Unicast Cipher Suite Type", "wlan.wapi.unicast_cipher.suite.type",
32244       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
32245       NULL, HFILL }},
32246
32247     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui,
32248      {"Multicast Cipher Suite OUI", "wlan.wapi.multicast_cipher.suite.oui",
32249       FT_UINT24, BASE_OUI, NULL, 0,
32250       NULL, HFILL }},
32251
32252     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type,
32253      {"Multicast Cipher Suite Type", "wlan.wapi.multicast_cipher.suite.type",
32254       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
32255       NULL, HFILL }},
32256
32257     {&hf_ieee80211_tag_wapi_param_set_capab,
32258      {"WAPI Capability Info", "wlan.wapi.capab",
32259       FT_UINT16, BASE_HEX, NULL, 0,
32260       NULL, HFILL }},
32261
32262     {&hf_ieee80211_tag_wapi_param_set_capab_preauth,
32263      {"Supports Preauthentication?", "wlan.wapi.capab.preauth",
32264       FT_BOOLEAN, 16 , NULL, 0x0001,
32265       NULL, HFILL }},
32266
32267     {&hf_ieee80211_tag_wapi_param_set_capab_rsvd,
32268      {"Reserved", "wlan.wapi.capab.rsvd",
32269       FT_UINT16, BASE_DEC , NULL, 0xFFFE,
32270       NULL, HFILL }},
32271
32272     {&hf_ieee80211_tag_wapi_param_set_bkid_count,
32273      {"No of BKID's", "wlan.wapi.bkid.count",
32274       FT_UINT16, BASE_DEC, NULL, 0,
32275       NULL, HFILL }},
32276
32277     {&hf_ieee80211_tag_wapi_param_set_bkid_list,
32278      {"BKID", "wlan.wapi.bkid",
32279       FT_BYTES, BASE_NONE, NULL, 0,
32280       NULL, HFILL }},
32281
32282     /* BSS Max Idle Period */
32283     {&hf_ieee80211_tag_bss_max_idle_period,
32284      {"BSS Max Idle Period (1000 TUs)", "wlan.bss_max_idle.period",
32285       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32286
32287     {&hf_ieee80211_tag_bss_max_idle_options_protected,
32288      {"BSS Max Idle Period Options: Protected Keep-Alive Required",
32289       "wlan.bss_max_idle.options.protected",
32290       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
32291
32292     /* TFS Request */
32293     {&hf_ieee80211_tag_tfs_request_id,
32294      {"TFS ID", "wlan.tfs_request.id",
32295       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32296
32297     {&hf_ieee80211_tag_tfs_request_ac_delete_after_match,
32298      {"TFS Action Code - Delete after match",
32299       "wlan.tfs_request.action_code.delete_after_match",
32300       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
32301
32302     {&hf_ieee80211_tag_tfs_request_ac_notify,
32303      {"TFS Action Code - Notify",
32304       "wlan.tfs_request.action_code.notify",
32305       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
32306
32307     {&hf_ieee80211_tag_tfs_request_subelem_id,
32308      {"Subelement ID", "wlan.tfs_request.subelem.id",
32309       FT_UINT8, BASE_DEC, VALS(tfs_request_subelem_ids), 0,
32310       "TFS Request Subelement ID", HFILL }},
32311
32312     {&hf_ieee80211_tag_tfs_request_subelem_len,
32313      {"Length", "wlan.tfs_request.subelem.len",
32314       FT_UINT8, BASE_DEC, NULL, 0,
32315       "TFS Request Subelement Length", HFILL }},
32316
32317     {&hf_ieee80211_tag_tfs_request_subelem,
32318      {"Subelement Data", "wlan.tfs_request.subelem",
32319       FT_BYTES, BASE_NONE, NULL, 0,
32320       "TFS Request Subelement Data", HFILL }},
32321
32322     /* TFS Response */
32323     {&hf_ieee80211_tag_tfs_response_subelem_id,
32324      {"Subelement ID", "wlan.tfs_response.subelem.id",
32325       FT_UINT8, BASE_DEC, VALS(tfs_response_subelem_ids), 0,
32326       "TFS Response Subelement ID", HFILL }},
32327
32328     {&hf_ieee80211_tag_tfs_response_subelem_len,
32329      {"Length", "wlan.tfs_response.subelem.len",
32330       FT_UINT8, BASE_DEC, NULL, 0,
32331       "TFS Response Subelement Length", HFILL }},
32332
32333     {&hf_ieee80211_tag_tfs_response_subelem,
32334      {"Subelement Data", "wlan.tfs_response.subelem",
32335       FT_BYTES, BASE_NONE, NULL, 0,
32336       "TFS Response Subelement Data", HFILL }},
32337
32338     {&hf_ieee80211_tag_tfs_response_status,
32339      {"TFS Response Status", "wlan.tfs_response.status",
32340       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32341
32342     {&hf_ieee80211_tag_tfs_response_id,
32343      {"TFS ID", "wlan.tfs_response.tfs_id",
32344       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32345
32346     /* WNM-Sleep Mode */
32347     {&hf_ieee80211_tag_wnm_sleep_mode_action_type,
32348      {"Action Type", "wlan.wnm_sleep_mode.action_type",
32349       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_action_types), 0,
32350       "WNM-Sleep Mode Action Type", HFILL }},
32351
32352     {&hf_ieee80211_tag_wnm_sleep_mode_response_status,
32353      {"WNM-Sleep Mode Response Status",
32354       "wlan.wnm_sleep_mode.response_status",
32355       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_response_status_vals), 0, NULL,
32356       HFILL }},
32357
32358     {&hf_ieee80211_tag_wnm_sleep_mode_interval,
32359      {"WNM-Sleep Interval", "wlan.wnm_sleep_mode.interval",
32360       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
32361
32362     {&hf_ieee80211_wnm_sub_elt_id,
32363      {"Subelement ID", "wlan.wnm_subelt.id",
32364       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32365
32366     {&hf_ieee80211_wnm_sub_elt_len,
32367      {"Subelement len", "wlan.wnm_subelt.len",
32368       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
32369
32370     /* Time Advertisement */
32371     {&hf_ieee80211_tag_time_adv_timing_capab,
32372      {"Timing capabilities", "wlan.time_adv.timing_capab",
32373       FT_UINT8, BASE_DEC, VALS(time_adv_timing_capab_vals), 0,
32374       NULL, HFILL }},
32375
32376     {&hf_ieee80211_tag_time_adv_time_value,
32377      {"Time Value", "wlan.time_adv.time_value",
32378       FT_BYTES, BASE_NONE, NULL, 0,
32379       NULL, HFILL }},
32380
32381     {&hf_ieee80211_tag_time_adv_time_value_year,
32382      {"Time Value: Year", "wlan.time_adv.time_value.year",
32383       FT_UINT16, BASE_DEC, NULL, 0,
32384       NULL, HFILL }},
32385
32386     {&hf_ieee80211_tag_time_adv_time_value_month,
32387      {"Time Value: Month", "wlan.time_adv.time_value.month",
32388       FT_UINT8, BASE_DEC, NULL, 0,
32389       NULL, HFILL }},
32390
32391     {&hf_ieee80211_tag_time_adv_time_value_day,
32392      {"Time Value: Day", "wlan.time_adv.time_value.month",
32393       FT_UINT8, BASE_DEC, NULL, 0,
32394       NULL, HFILL }},
32395
32396     {&hf_ieee80211_tag_time_adv_time_value_hours,
32397      {"Time Value: Hours", "wlan.time_adv.time_value.hours",
32398       FT_UINT8, BASE_DEC, NULL, 0,
32399       NULL, HFILL }},
32400
32401     {&hf_ieee80211_tag_time_adv_time_value_minutes,
32402      {"Time Value: Minutes", "wlan.time_adv.time_value.minutes",
32403       FT_UINT8, BASE_DEC, NULL, 0,
32404       NULL, HFILL }},
32405
32406     {&hf_ieee80211_tag_time_adv_time_value_seconds,
32407      {"Time Value: Seconds", "wlan.time_adv.time_value.seconds",
32408       FT_UINT8, BASE_DEC, NULL, 0,
32409       NULL, HFILL }},
32410
32411     {&hf_ieee80211_tag_time_adv_time_value_milliseconds,
32412      {"Time Value: Milliseconds", "wlan.time_adv.time_value.milliseconds",
32413       FT_UINT16, BASE_DEC, NULL, 0,
32414       NULL, HFILL }},
32415
32416     {&hf_ieee80211_tag_time_adv_time_value_reserved,
32417      {"Time Value: Reserved", "wlan.time_adv.time_value.reserved",
32418       FT_UINT8, BASE_DEC, NULL, 0,
32419       NULL, HFILL }},
32420
32421     {&hf_ieee80211_tag_time_adv_time_error,
32422      {"Time Error", "wlan.time_adv.time_error",
32423       FT_BYTES, BASE_NONE, NULL, 0,
32424       NULL, HFILL }},
32425
32426     {&hf_ieee80211_tag_time_adv_time_update_counter,
32427      {"Time Update Counter", "wlan.time_adv.time_update_counter",
32428       FT_UINT8, BASE_DEC, NULL, 0,
32429       NULL, HFILL }},
32430
32431     /* Time Zone */
32432     {&hf_ieee80211_tag_time_zone,
32433      {"Time Zone", "wlan.time_zone",
32434       FT_STRING, BASE_NONE, NULL, 0,
32435       NULL, HFILL }},
32436
32437     /* Interworking */
32438     {&hf_ieee80211_tag_interworking_access_network_type,
32439      {"Access Network Type", "wlan.interworking.access_network_type",
32440       FT_UINT8, BASE_DEC, VALS(access_network_type_vals), 0x0f,
32441       NULL, HFILL }},
32442
32443     {&hf_ieee80211_tag_interworking_internet,
32444      {"Internet", "wlan.interworking.internet",
32445       FT_UINT8, BASE_DEC, NULL, 0x10,
32446       NULL, HFILL }},
32447
32448     {&hf_ieee80211_tag_interworking_asra,
32449      {"ASRA", "wlan.interworking.asra",
32450       FT_UINT8, BASE_DEC, NULL, 0x20,
32451       "Additional Step Required for Access", HFILL }},
32452
32453     {&hf_ieee80211_tag_interworking_esr,
32454      {"ESR", "wlan.interworking.esr",
32455       FT_UINT8, BASE_DEC, NULL, 0x40,
32456       "Emergency services reachable", HFILL }},
32457
32458     {&hf_ieee80211_tag_interworking_uesa,
32459      {"UESA", "wlan.interworking.uesa",
32460       FT_UINT8, BASE_DEC, NULL, 0x80,
32461       "Unauthenticated emergency service accessible", HFILL }},
32462
32463     {&hf_ieee80211_tag_interworking_hessid,
32464      {"HESSID", "wlan.interworking.hessid",
32465       FT_ETHER, BASE_NONE, NULL, 0,
32466       "Homogeneous ESS identifier", HFILL }},
32467
32468     /* QoS Map Set element */
32469     {&hf_ieee80211_tag_qos_map_set_dscp_exc,
32470      {"DSCP Exception", "wlan.qos_map_set.dscp_exception",
32471       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
32472
32473     {&hf_ieee80211_tag_qos_map_set_dscp_exc_val,
32474      {"DSCP Value", "wlan.qos_map_set.dscp_value",
32475       FT_UINT8, BASE_DEC, NULL, 0,
32476       "DSCP Exception - DSCP Value", HFILL }},
32477
32478     {&hf_ieee80211_tag_qos_map_set_dscp_exc_up,
32479      {"User Priority", "wlan.qos_map_set.up",
32480       FT_UINT8, BASE_DEC, NULL, 0,
32481       "DSCP Exception - User Priority", HFILL }},
32482
32483     {&hf_ieee80211_tag_qos_map_set_range,
32484      {"DSCP Range description", "wlan.qos_map_set.range",
32485       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
32486
32487     {&hf_ieee80211_tag_qos_map_set_low,
32488      {"DSCP Low Value", "wlan.qos_map_set.dscp_low_value",
32489       FT_UINT8, BASE_DEC, NULL, 0,
32490       "DSCP Range description - DSCP Low Value", HFILL }},
32491
32492     {&hf_ieee80211_tag_qos_map_set_high,
32493      {"DSCP High Value", "wlan.qos_map_set.dscp_high_value",
32494       FT_UINT8, BASE_DEC, NULL, 0,
32495       "DSCP Range description - DSCP High Value", HFILL }},
32496
32497     /* Advertisement Protocol */
32498     {&hf_ieee80211_tag_adv_proto_resp_len_limit,
32499      {"Query Response Length Limit", "wlan.adv_proto.resp_len_limit",
32500       FT_UINT8, BASE_DEC, NULL, 0x7f,
32501       NULL, HFILL }},
32502
32503     {&hf_ieee80211_tag_adv_proto_pame_bi,
32504      {"PAME-BI", "wlan.adv_proto.pame_bi",
32505       FT_UINT8, BASE_DEC, NULL, 0x80,
32506       "Pre-Association Message Xchange BSSID Independent (PAME-BI)", HFILL }},
32507
32508     {&hf_ieee80211_tag_adv_proto_id,
32509      {"Advertisement Protocol ID", "wlan.adv_proto.id",
32510       FT_UINT8, BASE_DEC, VALS(adv_proto_id_vals), 0,
32511       NULL, HFILL }},
32512
32513     {&hf_ieee80211_tag_adv_vs_len,
32514      {"Advertisement Protocol Vendor Specific length", "wlan.adv_proto.vs_len",
32515       FT_UINT8, BASE_DEC, NULL, 0,
32516       NULL, HFILL}},
32517 #if 0
32518     {&hf_ieee80211_tag_adv_proto_vs_info,
32519      {"Advertisement Protocol Vendor Specific info", "wlan.adv_proto.vs_info",
32520       FT_NONE, BASE_NONE, NULL, 0,
32521       NULL, HFILL }},
32522 #endif
32523
32524     /* Roaming Consortium */
32525     {&hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
32526      {"Number of ANQP OIs", "wlan.roaming_consortium.num_anqp_oi",
32527       FT_UINT8, BASE_DEC, NULL, 0,
32528       NULL, HFILL }},
32529
32530     {&hf_ieee80211_tag_roaming_consortium_oi1_len,
32531      {"OI #1 Length", "wlan.roaming_consortium.oi1_len",
32532       FT_UINT8, BASE_DEC, NULL, 0x0f,
32533       NULL, HFILL }},
32534
32535     {&hf_ieee80211_tag_roaming_consortium_oi2_len,
32536      {"OI #2 Length", "wlan.roaming_consortium.oi2_len",
32537       FT_UINT8, BASE_DEC, NULL, 0xf0,
32538       NULL, HFILL }},
32539
32540     {&hf_ieee80211_tag_roaming_consortium_oi1,
32541      {"OI #1", "wlan.roaming_consortium.oi1",
32542       FT_BYTES, BASE_NONE, NULL, 0,
32543       NULL, HFILL }},
32544
32545     {&hf_ieee80211_tag_roaming_consortium_oi2,
32546      {"OI #2", "wlan.roaming_consortium.oi2",
32547       FT_BYTES, BASE_NONE, NULL, 0,
32548       NULL, HFILL }},
32549
32550     {&hf_ieee80211_tag_roaming_consortium_oi3,
32551      {"OI #3", "wlan.roaming_consortium.oi3",
32552       FT_BYTES, BASE_NONE, NULL, 0,
32553       NULL, HFILL }},
32554
32555     /* Timeout Interval */
32556     {&hf_ieee80211_tag_timeout_int_type,
32557      {"Timeout Interval Type", "wlan.timeout_int.type",
32558       FT_UINT8, BASE_DEC, VALS(timeout_int_types), 0,
32559       NULL, HFILL }},
32560
32561     {&hf_ieee80211_tag_timeout_int_value,
32562      {"Timeout Interval Value", "wlan.timeout_int.value",
32563       FT_UINT32, BASE_DEC, NULL, 0,
32564       NULL, HFILL }},
32565
32566     /* Link Identifier */
32567     {&hf_ieee80211_tag_link_id_bssid,
32568      {"BSSID", "wlan.link_id.bssid",
32569       FT_ETHER, BASE_NONE, NULL, 0,
32570       NULL, HFILL }},
32571
32572     {&hf_ieee80211_tag_link_id_init_sta,
32573      {"TDLS initiator STA Address", "wlan.link_id.init_sta",
32574       FT_ETHER, BASE_NONE, NULL, 0,
32575       NULL, HFILL }},
32576
32577     {&hf_ieee80211_tag_link_id_resp_sta,
32578      {"TDLS responder STA Address", "wlan.link_id.resp_sta",
32579       FT_ETHER, BASE_NONE, NULL, 0,
32580       NULL, HFILL }},
32581
32582     /* Wakeup Schedule */
32583     {&hf_ieee80211_tag_wakeup_schedule_offset,
32584      {"Offset", "wlan.wakeup_schedule.offset",
32585       FT_UINT32, BASE_DEC, NULL, 0,
32586       NULL, HFILL }},
32587
32588     {&hf_ieee80211_tag_wakeup_schedule_interval,
32589      {"Interval", "wlan.wakeup_schedule.interval",
32590       FT_UINT32, BASE_DEC, NULL, 0,
32591       NULL, HFILL }},
32592
32593     {&hf_ieee80211_tag_wakeup_schedule_awake_window_slots,
32594      {"Awake Window Slots", "wlan.wakeup_schedule.awake_window_slots",
32595       FT_UINT32, BASE_DEC, NULL, 0,
32596       NULL, HFILL }},
32597
32598     {&hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
32599      {"Maximum Awake Window Duration", "wlan.wakeup_schedule.max_awake_dur",
32600       FT_UINT32, BASE_DEC, NULL, 0,
32601       NULL, HFILL }},
32602
32603     {&hf_ieee80211_tag_wakeup_schedule_idle_count,
32604      {"Idle Count", "wlan.wakeup_schedule.idle_count",
32605       FT_UINT16, BASE_DEC, NULL, 0,
32606       NULL, HFILL }},
32607
32608     /* Channel Switch Timing */
32609     {&hf_ieee80211_tag_channel_switch_timing_switch_time,
32610      {"Switch Time", "wlan.channel_switch_timing.switch_time",
32611       FT_UINT16, BASE_DEC, NULL, 0,
32612       NULL, HFILL }},
32613
32614     {&hf_ieee80211_tag_channel_switch_timing_switch_timeout,
32615      {"Switch Timeout", "wlan.channel_switch_timing.switch_timeout",
32616       FT_UINT16, BASE_DEC, NULL, 0,
32617       NULL, HFILL }},
32618
32619     /* PTI Control */
32620     {&hf_ieee80211_tag_pti_control_tid,
32621      {"TID", "wlan.pti_control.tid",
32622       FT_UINT8, BASE_DEC, NULL, 0,
32623       NULL, HFILL }},
32624
32625     {&hf_ieee80211_tag_pti_control_sequence_control,
32626      {"Sequence Control", "wlan.pti_control.sequence_control",
32627       FT_UINT16, BASE_HEX, NULL, 0,
32628       NULL, HFILL }},
32629
32630     /* PU Buffer Status */
32631     {&hf_ieee80211_tag_pu_buffer_status_ac_bk,
32632      {"AC_BK traffic available", "wlan.pu_buffer_status.ac_bk",
32633       FT_UINT8, BASE_DEC, NULL, 0x01,
32634       NULL, HFILL }},
32635
32636     {&hf_ieee80211_tag_pu_buffer_status_ac_be,
32637      {"AC_BE traffic available", "wlan.pu_buffer_status.ac_be",
32638       FT_UINT8, BASE_DEC, NULL, 0x02,
32639       NULL, HFILL }},
32640
32641     {&hf_ieee80211_tag_pu_buffer_status_ac_vi,
32642      {"AC_VI traffic available", "wlan.pu_buffer_status.ac_vi",
32643       FT_UINT8, BASE_DEC, NULL, 0x04,
32644       NULL, HFILL }},
32645
32646     {&hf_ieee80211_tag_pu_buffer_status_ac_vo,
32647      {"AC_VO traffic available", "wlan.pu_buffer_status.ac_vo",
32648       FT_UINT8, BASE_DEC, NULL, 0x08,
32649       NULL, HFILL }},
32650
32651     {&hf_ieee80211_mysterious_olpc_stuff,
32652      {"Mysterious OLPC stuff", "wlan.mysterious_olpc_stuff",
32653       FT_NONE, BASE_NONE, NULL, 0x0,
32654       NULL, HFILL }},
32655
32656     {&hf_ieee80211_estimated_service_params,
32657      {"Estimated Service Parameters", "wlan.ext_tag.estimated_service_params",
32658       FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL }},
32659
32660     {&hf_ieee80211_esp_access_category,
32661      {"Access Category", "wlan.ext_tag.estimated_service_params.access_category",
32662       FT_UINT24, BASE_DEC, VALS(esp_access_category_vals), 0x000003,
32663        NULL, HFILL }},
32664
32665     {&hf_ieee80211_esp_reserved,
32666      {"Reserved", "wlan.ext_tag.estimated_service_params.reserved",
32667       FT_UINT24, BASE_HEX, NULL, 0x000004, NULL, HFILL }},
32668
32669     {&hf_ieee80211_esp_data_format,
32670      {"Data Format", "wlan.ext_tag.estimated_service_params.data_format",
32671       FT_UINT24, BASE_DEC, VALS(esp_data_format_vals), 0x000018,
32672        NULL, HFILL }},
32673
32674     {&hf_ieee80211_esp_ba_windows_size,
32675      {"BA Window Size", "wlan.ext_tag.estimated_service_params.ba_window_size",
32676       FT_UINT24, BASE_DEC, VALS(esp_ba_window_size_vals), 0x0000E0,
32677        NULL, HFILL }},
32678
32679     {&hf_ieee80211_esp_est_air_time_frac,
32680      {"Estimated Air Time Fraction", "wlan.ext_tag.estimated_service_params.air_time_frac",
32681       FT_UINT24, BASE_DEC, NULL, 0x00FF00, NULL, HFILL }},
32682
32683     {&hf_ieee80211_esp_data_ppdu_duration_target,
32684      {"Data PPDU Duration Target", "wlan.ext_tag.estimated_service_params.data_ppdu_dur_target",
32685       FT_UINT24, BASE_DEC, NULL, 0x00FF00, NULL, HFILL }},
32686
32687     {&hf_ieee80211_fcg_new_channel_number,
32688      {"New Channel Number", "wlan.ext_tag.future_channel_guidance.new_chan_num",
32689       FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
32690
32691     {&hf_ieee80211_fcg_extra_info,
32692      {"Extra bytes", "wlan.ext_tag.future_channel_guidance.extra_bytes",
32693       FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
32694
32695     {&hf_ieee80211_ext_tag,
32696      {"Ext Tag", "wlan.ext_tag",
32697       FT_NONE, BASE_NONE, 0x0, 0,
32698       NULL, HFILL }},
32699
32700     {&hf_ieee80211_ext_tag_number,
32701      {"Ext Tag Number", "wlan.ext_tag.number",
32702       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_eid_ext_ext, 0,
32703       "Element ID", HFILL }},
32704
32705     {&hf_ieee80211_ext_tag_length,
32706      {"Ext Tag length", "wlan.ext_tag.length",
32707       FT_UINT32, BASE_DEC, NULL, 0,
32708       "Length of tag", HFILL }},
32709
32710     {&hf_ieee80211_fils_session,
32711      {"FILS Session", "wlan.ext_tag.fils.session",
32712       FT_BYTES, BASE_NONE, NULL, 0x0,
32713       NULL, HFILL }},
32714
32715     {&hf_ieee80211_fils_wrapped_data,
32716      {"FILS Wrapped Data", "wlan.ext_tag.fils.wrapped_data",
32717       FT_BYTES, BASE_NONE, NULL, 0x0,
32718       NULL, HFILL }},
32719
32720     {&hf_ieee80211_fils_nonce,
32721      {"FILS Nonce", "wlan.ext_tag.fils.nonce",
32722       FT_BYTES, BASE_NONE, NULL, 0x0,
32723       NULL, HFILL }},
32724
32725     {&hf_he_mac_capabilities,
32726      {"HE MAC Capabilities Information", "wlan.ext_tag.he_mac_caps",
32727       FT_UINT40, BASE_HEX, NULL, 0x0, NULL, HFILL }},
32728
32729     {&hf_he_htc_he_support,
32730      {"+HTC HE Support", "wlan.ext_tag.he_mac_cap.htc_he_support",
32731       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000001,
32732       NULL, HFILL }},
32733
32734     {&hf_he_twt_requester_support,
32735      {"TWT Requester Support", "wlan.ext_tag.he_mac_cap.twt_req_support",
32736       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000002,
32737       NULL, HFILL }},
32738
32739     {&hf_he_twt_responder_support,
32740      {"TWT Responder Support", "wlan.ext_tag.he_mac_cap.twt_rsp_support",
32741       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000000004,
32742       NULL, HFILL }},
32743
32744     {&hf_he_fragmentation_support,
32745      {"Fragmentation Support", "wlan.ext_tag.he_mac_cap.fragmentation_support",
32746       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
32747       VALS64(he_fragmentation_support_vals), 0x0000000018,
32748       NULL, HFILL }},
32749
32750     {&hf_he_max_number_fragmented_msdus,
32751      {"Maximum Number of Fragmented MSDUs", "wlan.ext_tag.he_mac_cap.max_frag_msdus",
32752       FT_UINT40, BASE_DEC, NULL, 0x00000000E0,
32753       NULL, HFILL }},
32754
32755     {&hf_he_min_fragment_size,
32756      {"Minimum Fragment Size", "wlan.ext_tag.he_mac_cap.min_frag_size",
32757       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
32758       VALS64(he_minimum_fragmentation_size_vals), 0x0000000300,
32759       NULL, HFILL }},
32760
32761     {&hf_he_trigger_frame_mac_padding_dur,
32762      {"Trigger Frame MAC Padding Duration", "wlan.ext_tag.he_mac_cap.trig_frm_mac_padding_dur",
32763       FT_UINT40, BASE_DEC, NULL, 0x0000000C00, NULL, HFILL }},
32764
32765     {&hf_he_multi_tid_aggregation_support,
32766      {"Multi-TID Aggregation Support", "wlan.ext_tag.he_mac_cap.multi_tid_agg_support",
32767       FT_UINT40, BASE_DEC, NULL, 0x0000007000, NULL, HFILL }},
32768
32769     {&hf_he_he_link_adaptation_support,
32770      {"HE Link Adaptation Support", "wlan.ext_tag.he_mac_cap.he_link_adaptation_support",
32771       FT_UINT40, BASE_DEC|BASE_VAL64_STRING,
32772       VALS64(he_link_adaptation_support_vals), 0x0000018000,
32773       NULL, HFILL }},
32774
32775     {&hf_he_all_ack_support,
32776      {"All Ack Support", "wlan.ext_tag.he_mac_cap.all_ack_support",
32777       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000020000,
32778       NULL, HFILL }},
32779
32780     {&hf_he_umrs_support,
32781      {"UMRS Support", "wlan.ext_tag.he_mac_cap.umrs_support",
32782       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000040000,
32783       NULL, HFILL }},
32784
32785     {&hf_he_bsr_support,
32786      {"BSR Support", "wlan.ext_tag.he_mac_cap.bsr_support",
32787       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000080000,
32788       NULL, HFILL }},
32789
32790     {&hf_he_broadcast_twt_support,
32791      {"Broadcast TWT Support", "wlan.ext_tag.he_mac_cap.broadcast_twt_support",
32792       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000100000,
32793       NULL, HFILL }},
32794
32795     {&hf_he_32_bit_ba_bitmap_support,
32796      {"32-bit BA Bitmap Support", "wlan.ext_tag.he_mac_cap.32_bit_ba_bitmap_support",
32797       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000200000,
32798       NULL, HFILL }},
32799
32800     {&hf_he_mu_cascading_support,
32801      {"MU Cascading Support", "wlan.ext_tag.he_mac_cap.mu_cascading_support",
32802       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000400000,
32803       NULL, HFILL }},
32804
32805     {&hf_he_ack_enabled_aggregation_support,
32806      {"Ack-Enabled Aggregation Support", "wlan.ext_tag.he_mac_cap.ack_enabled_agg_support",
32807       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0000800000,
32808       NULL, HFILL }},
32809
32810     {&hf_he_group_addressed_multi_sta_blkack_support,
32811      {"Group Addressed Multi-STA BlockAck in DL MU Support", "wlan.ext_tag.he_mac_cap.i_give_up",
32812       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0001000000,
32813       NULL, HFILL }},
32814
32815     {&hf_he_om_control_support,
32816      {"OM Control Support", "wlan.ext_tag.he_mac_cap.om_control_support",
32817       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0002000000,
32818       NULL, HFILL }},
32819
32820     {&hf_he_ofdma_ra_support,
32821      {"OFDMA RA Support", "wlan.ext_tag.he_mac_cap.ofdma_ra_support",
32822       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0004000000,
32823       NULL, HFILL }},
32824
32825     {&hf_he_max_a_mpdu_length_exponent,
32826      {"Maximum A-MPDU Length Exponent", "wlan.ext_tag.he_mac_cap.max_a_mpdu_len_exp",
32827       FT_UINT40, BASE_DEC, NULL, 0x0018000000, NULL, HFILL }},
32828
32829     {&hf_he_a_msdu_fragmentation_support,
32830      {"A-MSDU Fragmentation Support", "wlan.ext_tag.he_mac_cap.a_msdu_frag_support",
32831       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0020000000,
32832       NULL, HFILL }},
32833
32834     {&hf_he_flexible_twt_schedule_support,
32835      {"Flexible TWT Schedule Support", "wlan.ext_tag.he_mac_cap.flexible_twt_sched_support",
32836       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0040000000,
32837       NULL, HFILL }},
32838
32839     {&hf_he_rx_control_frame_to_multibss,
32840      {"Rx Control Frame to MultiBSS", "wlan.ext_tag.he_mac_cap.rx_ctl_frm_multibss",
32841       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0080000000,
32842       NULL, HFILL }},
32843
32844     {&hf_he_bsrp_bqrp_a_mpdu_aggregation,
32845      {"BSRP BQRP A-MPDU Aggregation", "wlan.ext_tag.he_mac_cap.bsrp_bqrp_a_mpdu_agg",
32846       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0100000000,
32847       NULL, HFILL }},
32848
32849     {&hf_he_qtp_support,
32850      {"QTP Support", "wlan.ext_tag.he_mac_cap.qtp_support",
32851       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0200000000,
32852       NULL, HFILL }},
32853
32854     {&hf_he_bqr_support,
32855      {"BQR Support", "wlan.ext_tag.he_mac_cap.bqr_support",
32856       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0400000000,
32857       NULL, HFILL }},
32858
32859     {&hf_he_sr_responder,
32860      {"SR Responder Role", "wlan.ext_tag.he_mac_cap.sr_responder",
32861       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x0800000000,
32862       NULL, HFILL }},
32863
32864     {&hf_he_ndp_feedback_report_support,
32865      {"NDP Feedback Report Support", "wlan.ext_tag.he_mac_cap.ndp_feedback_report_support",
32866       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x1000000000,
32867       NULL, HFILL }},
32868
32869     {&hf_he_ops_support,
32870      {"OPS Support", "wlan.ext_tag.he_mac_cap.ops_support",
32871       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x2000000000,
32872       NULL, HFILL }},
32873
32874     {&hf_he_a_msdu_in_a_mpdu_support,
32875      {"A-MSDU in A-MPDU Support", "wlan.ext_tag.he_mac_cap.a_msdu_in_a_mpdu_support",
32876       FT_BOOLEAN, 40, TFS(&tfs_supported_not_supported), 0x4000000000,
32877       NULL, HFILL }},
32878
32879     {&hf_he_reserved,
32880      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_39",
32881       FT_UINT40, BASE_HEX, NULL, 0x8000000000, NULL, HFILL }},
32882
32883     {&hf_he_reserved_bits_5_7,
32884      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_5_7",
32885       FT_UINT40, BASE_HEX, NULL, 0x00000000E0, NULL, HFILL }},
32886
32887     {&hf_he_reserved_bits_8_9,
32888      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_8_9",
32889       FT_UINT40, BASE_HEX, NULL, 0x0000000300, NULL, HFILL }},
32890
32891     {&hf_he_reserved_bits_15_16,
32892      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bits_15_16",
32893       FT_UINT40, BASE_HEX, NULL, 0x0000018000, NULL, HFILL }},
32894
32895     {&hf_he_reserved_bit_18,
32896      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_18",
32897       FT_UINT40, BASE_HEX, NULL, 0x0000040000, NULL, HFILL }},
32898
32899     {&hf_he_reserved_bit_19,
32900      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_19",
32901       FT_UINT40, BASE_HEX, NULL, 0x0000080000, NULL, HFILL }},
32902
32903     {&hf_he_reserved_bit_25,
32904      {"Reserved", "wlan.ext_tag.he_mac_cap.reserved_bit_25",
32905       FT_UINT40, BASE_HEX, NULL, 0x0002000000, NULL, HFILL }},
32906
32907     {&hf_he_phy_dual_band_support,
32908      {"Dual Band Support", "wlan.ext_tag.he_phy_cap.fbytes",
32909       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
32910
32911     {&hf_he_phy_cap_dual_band_support,
32912      {"Dual Band Support", "wlan.ext_tag.he_phy_cap.fbyte.dbs",
32913       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
32914       NULL, HFILL }},
32915
32916     {&hf_he_phy_chan_width_set,
32917      {"Channel Width Set", "wlan.ext_tag.he_phy_cap.fbytes",
32918       FT_UINT8, BASE_HEX, NULL, 0xFE, NULL, HFILL }},
32919
32920     {&hf_he_40mhz_channel_2_4ghz,
32921      {"40MHz in 2.4GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.40mhz_in_2_4ghz",
32922       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }},
32923
32924     {&hf_he_40_and_80_mhz_5ghz,
32925      {"40 & 80MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.40_80_in_5ghz",
32926       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL }},
32927
32928     {&hf_he_160_mhz_5ghz,
32929      {"160MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.160_in_5ghz",
32930       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08, NULL, HFILL }},
32931
32932     {&hf_he_160_80_plus_80_mhz_5ghz,
32933      {"160/80+80MHz in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.160_80_80_in_5ghz",
32934       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10, NULL, HFILL }},
32935
32936     {&hf_he_242_tone_rus_in_2_4ghz,
32937      {"242 tone RUs in the 2.4GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.242_tone_in_2_4ghz",
32938       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20, NULL, HFILL }},
32939
32940     {&hf_he_242_tone_rus_in_5ghz,
32941      {"242 tone RUs in the 5GHz band", "wlan.ext_tag.he_phy_cap.chan_width_set.242_tone_in_5ghz",
32942       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40, NULL, HFILL }},
32943
32944     {&hf_he_chan_width_reserved,
32945      {"Reserved", "wlan.ext_tag.he_phy_cap.chan_width_set.reserved",
32946       FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL }},
32947
32948     {&hf_he_phy_b8_to_b23,
32949      {"Bits 8 to 23", "wlan.ext_tag.he_phy_cap.bits_8_to_23",
32950       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
32951
32952     {&hf_he_phy_cap_punctured_preamble_rx,
32953      {"Punctured Preamble RX", "wlan.ext_tag.he_phy_cap.nbytes.punc_preamble_rx",
32954       FT_UINT16, BASE_HEX, NULL, 0x000F, NULL, HFILL }},
32955
32956     {&hf_he_phy_cap_device_class,
32957      {"Device Class", "wlan.ext_tag.he_phy_cap.nbytes.device_class",
32958       FT_UINT16, BASE_HEX, NULL, 0x0010, NULL, HFILL }},
32959
32960     {&hf_he_phy_cap_ldpc_coding_in_payload,
32961      {"LDPC Coding In Payload", "wlan.ext_tag.he_phy_cap.nbytes.ldpc_coding_in_payload",
32962       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0020, NULL, HFILL }},
32963
32964     {&hf_he_phy_cap_he_su_ppdu_1x_he_ltf_08us,
32965      {"HE SU PPDU With 1x HE-LTF and 0.8us GI",
32966       "wlan.ext_tag.he_phy_cap.nbytes.he_su_ppdu_with_1x_he_ltf_08us",
32967       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
32968
32969     {&hf_he_phy_cap_midamble_rx_max_nsts,
32970      {"Midamble Rx Max NSTS", "wlan.ext_tag.he_phy_cap.mbytes.midamble_rx_max_nsts",
32971       FT_UINT16, BASE_HEX, NULL, 0x0180, NULL, HFILL }},
32972
32973     {&hf_he_phy_cap_ndp_with_4x_he_ltf_32us,
32974      {"NDP With 4x HE-LTF and 3.2us GI",
32975       "wlan.ext_tag.he_phy_cap.nbytes.ndp_with_4x_he_ltf_4x_3.2us",
32976       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
32977
32978     {&hf_he_phy_cap_stbc_tx_lt_80mhz,
32979      {"STBC Tx <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_tx_lt_80mhz",
32980       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
32981
32982     {&hf_he_phy_cap_stbc_rx_lt_80mhz,
32983      {"STBC Rx <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_rx_lt_80mhz",
32984       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
32985
32986     {&hf_he_phy_cap_doppler_tx,
32987      {"Doppler Tx", "wlan.ext_tag.he_phy_cap.nbytes.doppler_tx",
32988       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
32989
32990     {&hf_he_phy_cap_doppler_rx,
32991      {"Doppler Rx", "wlan.ext_tag.he_phy_cap.nbytes.doppler_rx",
32992       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
32993
32994     {&hf_he_phy_cap_full_bw_ul_mu_mimo,
32995      {"Full Bandwidth UL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.full_bw_ul_mu_mimo",
32996       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }},
32997
32998     {&hf_he_phy_cap_partial_bw_ul_mu_mimo,
32999      {"Partial Bandwidth UL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_ul_mu_mimo",
33000       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000, NULL, HFILL }},
33001
33002     {&hf_he_phy_b24_to_b39,
33003      {"Bits 24 to 39", "wlan.ext_tag.he_phy_cap.bits_24_to_39",
33004       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33005
33006     {&hf_he_phy_cap_dcm_max_constellation_tx,
33007      {"DCM Max Constellation Tx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_const_tx",
33008       FT_UINT16, BASE_HEX, NULL, 0x0003, NULL, HFILL }},
33009
33010     {&hf_he_phy_cap_dcm_max_nss_tx,
33011      {"DCM Max NSS Tx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_nss_tx",
33012       FT_UINT16, BASE_HEX, NULL, 0x0004, NULL, HFILL }},
33013
33014     {&hf_he_phy_cap_dcm_max_constellation_rx,
33015      {"DCM Max Constellation Rx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_const_rx",
33016       FT_UINT16, BASE_HEX, NULL, 0x0018, NULL, HFILL }},
33017
33018     {&hf_he_phy_cap_dcm_max_nss_rx,
33019      {"DCM Max NSS Rx", "wlan.ext_tag.he_phy_cap.nbytes.dcm_max_nss_tx",
33020       FT_UINT16, BASE_HEX, NULL, 0x0020, NULL, HFILL }},
33021
33022     {&hf_he_phy_cap_rx_he_muppdu_from_non_ap,
33023      {"Rx HE MU PPDU from Non-AP STA", "wlan.ext_tag.he_phy_cap.nbytes.rx_he_mu_ppdu",
33024       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
33025
33026     {&hf_he_phy_cap_su_beamformer,
33027      {"SU Beamformer", "wlan.ext_tag.he_phy_cap.nbytes.su_beamformer",
33028       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
33029
33030     {&hf_he_phy_cap_su_beamformee,
33031      {"SU Beamformee", "wlan.ext_tag.he_phy_cap.nbytes.su_beamformee",
33032       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
33033
33034     {&hf_he_phy_cap_mu_beamformer,
33035      {"MU Beamformer", "wlan.ext_tag.he_phy_cap.nbytes.mu_beamformer",
33036       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
33037
33038     {&hf_he_phy_cap_beamformer_sts_lte_80mhz,
33039      {"Beamformee STS <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.beamformee_sts_lte_80mhz",
33040       FT_UINT16, BASE_HEX, NULL, 0x1C00, NULL, HFILL }},
33041
33042     {&hf_he_phy_cap_beamformer_sts_gt_80mhz,
33043      {"Beamformee STS > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.beamformee_sts_gt_80mhz",
33044       FT_UINT16, BASE_HEX, NULL, 0xE000, NULL, HFILL }},
33045
33046     {&hf_he_phy_b40_to_b55,
33047      {"Bits 40 to 55", "wlan.ext_tag.he_phy_cap.bits_40_to_55",
33048       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33049
33050     {&hf_he_phy_cap_number_of_sounding_dims_lte_80,
33051      {"Number Of Sounding Dimensions <= 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.no_sounding_dims_lte_80",
33052       FT_UINT16, BASE_DEC, NULL, 0x0007, NULL, HFILL }},
33053
33054     {&hf_he_phy_cap_number_of_sounding_dims_gt_80,
33055      {"Number Of Sounding Dimensions > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.no_sounding_dims_gt_80",
33056       FT_UINT16, BASE_DEC, NULL, 0x0038, NULL, HFILL }},
33057
33058     {&hf_he_phy_cap_ng_eq_16_su_fb,
33059      {"Ng = 16 SU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.ng_eq_16_su_fb",
33060       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
33061
33062     {&hf_he_phy_cap_ng_eq_16_mu_fb,
33063      {"Ng = 16 MU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.ng_eq_16_mu_fb",
33064       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
33065
33066     {&hf_he_phy_cap_codebook_size_eq_4_2_fb,
33067      {"Codebook Size SU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.codebook_size_su_fb",
33068       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
33069
33070     {&hf_he_phy_cap_codebook_size_eq_7_5_fb,
33071      {"Codebook Size MU Feedback", "wlan.ext_tag.he_phy_cap.nbytes.codebook_size_mu_fb",
33072       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
33073
33074     {&hf_he_phy_cap_triggered_su_beamforming_fb,
33075      {"Triggered SU Beamforming Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_su_bf_fb",
33076       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
33077
33078     {&hf_he_phy_cap_triggered_mu_beamforming_fb,
33079      {"Triggered MU Beamforming Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_mu_bf_fb",
33080       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
33081
33082     {&hf_he_phy_cap_triggered_cqi_fb,
33083      {"Triggered CQI Feedback", "wlan.ext_tag.he_phy_cap.nbytes.trig_cqi_fb",
33084       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
33085
33086     {&hf_he_phy_cap_partial_bw_extended_range,
33087      {"Partial Bandwidth Extended Range", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_er",
33088       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
33089
33090     {&hf_he_phy_cap_partial_bw_dl_mu_mimo,
33091      {"Partial Bandwidth DL MU-MIMO", "wlan.ext_tag.he_phy_cap.nbytes.partial_bw_dl_mu_mimo",
33092       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x4000, NULL, HFILL }},
33093
33094     {&hf_he_phy_cap_ppe_threshold_present,
33095      {"PPE Threshold Present", "wlan.ext_tag.he_phy_cap.nbytes.ppe_thres_present",
33096       FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL }},
33097
33098     {&hf_he_phy_b56_to_b71,
33099      {"Bits 56 to 71", "wlan.ext_tag.he_phy_cap.bits_56_to_71",
33100       FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33101
33102     {&hf_he_phy_cap_srp_based_sr_support,
33103      {"SRP-based SR Support", "wlan.ext_tag.he_phy_cap.nbytes.srp_based_sr_sup",
33104       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001, NULL, HFILL }},
33105
33106     {&hf_he_phy_cap_power_boost_factor_ar_support,
33107      {"Power Boost Factor ar Support", "wlan.ext_tag.he_phy_cap.nbytes.pwr_bst_factor_ar_sup",
33108       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0002, NULL, HFILL }},
33109
33110     {&hf_he_phy_cap_he_su_ppdu_etc_gi,
33111      {"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",
33112       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0004, NULL, HFILL }},
33113
33114     {&hf_he_phy_cap_max_nc,
33115      {"Max Nc", "wlan.ext_tag.he_phy_cap.nbytes.max_nc",
33116       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0038, NULL, HFILL }},
33117
33118     {&hf_he_phy_cap_stbc_tx_gt_80_mhz,
33119      {"STBC Tx > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_tx_gt_80_mhz",
33120       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040, NULL, HFILL }},
33121
33122     {&hf_he_phy_cap_stbc_rx_gt_80_mhz,
33123      {"STBC Rx > 80 MHz", "wlan.ext_tag.he_phy_cap.nbytes.stbc_rx_gt_80_mhz",
33124       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080, NULL, HFILL }},
33125
33126     {&hf_he_phy_cap_he_er_su_ppdu_4xxx_gi,
33127      {"HE ER SU PPDU W 4x HE-LTF & 0.8us GI", "wlan.ext_tag.he_phy_cap.nbytes.he_er_su_ppdu_4xxx_gi",
33128       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0100, NULL, HFILL }},
33129
33130     {&hf_he_phy_cap_20mhz_in_40mhz_24ghz_band,
33131      {"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",
33132       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0200, NULL, HFILL }},
33133
33134     {&hf_he_phy_cap_20mhz_in_160_80p80_ppdu,
33135      {"20 MHz In 160/80+80 MHz HE PPDU", "wlan.ext_tag.he_phy_cap.nbytes.20_mhz_in_160_80p80_ppdu",
33136       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400, NULL, HFILL }},
33137
33138     {&hf_he_phy_cap_80mgz_in_160_80p80_ppdu,
33139      {"80 MHz In 160/80+80 MHz HE PPDU", "wlan.ext_tag.he_phy_cap.nbytes.80_mhz_in_160_80p80_ppdu",
33140       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800, NULL, HFILL }},
33141
33142     {&hf_he_phy_cap_he_er_su_ppdu_1xxx_gi,
33143      {"HE ER SU PPDU W 1x HE-LTF & 0.8us GI", "wlan.ext_tag.he_phy_cap.nbytes.he_er_su_ppdu_1xxx_gi",
33144       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x1000, NULL, HFILL }},
33145
33146     {&hf_he_phy_cap_midamble_rx_2x_xxx_ltf,
33147      {"Midamble Rx 2x & 1x HE-LTF", "wlan.ext_tag.he_phy_cap.nbytes.midamble_rx_2x_1x_he_ltf",
33148       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x2000, NULL, HFILL }},
33149
33150     {&hf_he_phy_cap_b70_b71_reserved,
33151      {"Reserved", "wlan.ext_tag.he_phy_cap.nbytes.reserved_b70_b71",
33152       FT_UINT16, BASE_HEX, NULL, 0xC000, NULL, HFILL }},
33153
33154     {&hf_he_mcs_max_he_mcs_80_rx_1_ss,
33155      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_1_ss",
33156       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33157
33158     {&hf_he_mcs_max_he_mcs_80_rx_2_ss,
33159      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_2_ss",
33160       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33161
33162     {&hf_he_mcs_max_he_mcs_80_rx_3_ss,
33163      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_3_ss",
33164       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33165
33166     {&hf_he_mcs_max_he_mcs_80_rx_4_ss,
33167      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_4_ss",
33168       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33169
33170     {&hf_he_mcs_max_he_mcs_80_rx_5_ss,
33171      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_5_ss",
33172       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33173
33174     {&hf_he_mcs_max_he_mcs_80_rx_6_ss,
33175      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_6_ss",
33176       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33177
33178     {&hf_he_mcs_max_he_mcs_80_rx_7_ss,
33179      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_7_ss",
33180       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33181
33182     {&hf_he_mcs_max_he_mcs_80_rx_8_ss,
33183      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_rx_8_ss",
33184       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33185
33186     {&hf_he_mcs_max_he_mcs_80_tx_1_ss,
33187      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_1_ss",
33188       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33189
33190     {&hf_he_mcs_max_he_mcs_80_tx_2_ss,
33191      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_2_ss",
33192       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33193
33194     {&hf_he_mcs_max_he_mcs_80_tx_3_ss,
33195      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_3_ss",
33196       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33197
33198     {&hf_he_mcs_max_he_mcs_80_tx_4_ss,
33199      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_4_ss",
33200       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33201
33202     {&hf_he_mcs_max_he_mcs_80_tx_5_ss,
33203      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_5_ss",
33204       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33205
33206     {&hf_he_mcs_max_he_mcs_80_tx_6_ss,
33207      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_6_ss",
33208       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33209
33210     {&hf_he_mcs_max_he_mcs_80_tx_7_ss,
33211      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_7_ss",
33212       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33213
33214     {&hf_he_mcs_max_he_mcs_80_tx_8_ss,
33215      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80_tx_8_ss",
33216       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33217
33218     {&hf_he_mcs_max_he_mcs_80p80_rx_1_ss,
33219      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_1_ss",
33220       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33221
33222     {&hf_he_mcs_max_he_mcs_80p80_rx_2_ss,
33223      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_2_ss",
33224       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33225
33226     {&hf_he_mcs_max_he_mcs_80p80_rx_3_ss,
33227      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_3_ss",
33228       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33229
33230     {&hf_he_mcs_max_he_mcs_80p80_rx_4_ss,
33231      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_4_ss",
33232       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33233
33234     {&hf_he_mcs_max_he_mcs_80p80_rx_5_ss,
33235      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_5_ss",
33236       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33237
33238     {&hf_he_mcs_max_he_mcs_80p80_rx_6_ss,
33239      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_6_ss",
33240       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33241
33242     {&hf_he_mcs_max_he_mcs_80p80_rx_7_ss,
33243      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_7_ss",
33244       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33245
33246     {&hf_he_mcs_max_he_mcs_80p80_rx_8_ss,
33247      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_rx_8_ss",
33248       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33249
33250     {&hf_he_mcs_max_he_mcs_80p80_tx_1_ss,
33251      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_1_ss",
33252       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33253
33254     {&hf_he_mcs_max_he_mcs_80p80_tx_2_ss,
33255      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_2_ss",
33256       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33257
33258     {&hf_he_mcs_max_he_mcs_80p80_tx_3_ss,
33259      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_3_ss",
33260       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33261
33262     {&hf_he_mcs_max_he_mcs_80p80_tx_4_ss,
33263      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_4_ss",
33264       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33265
33266     {&hf_he_mcs_max_he_mcs_80p80_tx_5_ss,
33267      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_5_ss",
33268       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33269
33270     {&hf_he_mcs_max_he_mcs_80p80_tx_6_ss,
33271      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_6_ss",
33272       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33273
33274     {&hf_he_mcs_max_he_mcs_80p80_tx_7_ss,
33275      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_7_ss",
33276       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33277
33278     {&hf_he_mcs_max_he_mcs_80p80_tx_8_ss,
33279      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_80p80_tx_8_ss",
33280       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33281
33282     {&hf_he_mcs_max_he_mcs_160_rx_1_ss,
33283      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_1_ss",
33284       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33285
33286     {&hf_he_mcs_max_he_mcs_160_rx_2_ss,
33287      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_2_ss",
33288       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33289
33290     {&hf_he_mcs_max_he_mcs_160_rx_3_ss,
33291      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_3_ss",
33292       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33293
33294     {&hf_he_mcs_max_he_mcs_160_rx_4_ss,
33295      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_4_ss",
33296       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33297
33298     {&hf_he_mcs_max_he_mcs_160_rx_5_ss,
33299      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_5_ss",
33300       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33301
33302     {&hf_he_mcs_max_he_mcs_160_rx_6_ss,
33303      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_6_ss",
33304       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33305
33306     {&hf_he_mcs_max_he_mcs_160_rx_7_ss,
33307      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_7_ss",
33308       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33309
33310     {&hf_he_mcs_max_he_mcs_160_rx_8_ss,
33311      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_rx_8_ss",
33312       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33313
33314     {&hf_he_mcs_max_he_mcs_160_tx_1_ss,
33315      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_1_ss",
33316       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33317
33318     {&hf_he_mcs_max_he_mcs_160_tx_2_ss,
33319      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_2_ss",
33320       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33321
33322     {&hf_he_mcs_max_he_mcs_160_tx_3_ss,
33323      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_3_ss",
33324       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33325
33326     {&hf_he_mcs_max_he_mcs_160_tx_4_ss,
33327      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_4_ss",
33328       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33329
33330     {&hf_he_mcs_max_he_mcs_160_tx_5_ss,
33331      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_5_ss",
33332       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33333
33334     {&hf_he_mcs_max_he_mcs_160_tx_6_ss,
33335      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_6_ss",
33336       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33337
33338     {&hf_he_mcs_max_he_mcs_160_tx_7_ss,
33339      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_7_ss",
33340       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33341
33342     {&hf_he_mcs_max_he_mcs_160_tx_8_ss,
33343      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_mcs_map.max_he_mcs_160_tx_8_ss",
33344       FT_UINT16, BASE_HEX, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33345
33346     {&hf_he_rx_he_mcs_map_lte_80,
33347      {"Rx HEX-MCS Map <= 80 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_lte_80",
33348      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33349
33350     {&hf_he_tx_he_mcs_map_lte_80,
33351      {"Tx HEX-MCS Map <= 80 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_lte_80",
33352      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33353
33354     {&hf_he_rx_he_mcs_map_160,
33355      {"Rx HEX-MCS Map 160 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_160",
33356      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33357
33358     {&hf_he_tx_he_mcs_map_160,
33359      {"Tx HEX-MCS Map 160 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_160",
33360      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33361
33362     {&hf_he_rx_he_mcs_map_80_80,
33363      {"Rx HEX-MCS Map 80+80 MHz", "wlan.ext_tag.he_mcs_map.rx_he_mcs_map_80_80",
33364      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33365
33366     {&hf_he_tx_he_mcs_map_80_80,
33367      {"Tx HEX-MCS Map 80+80 MHz", "wlan.ext_tag.he_mcs_map.tx_he_mcs_map_80_80",
33368      FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
33369
33370     {&hf_he_ppe_thresholds_nss,
33371      {"NSS", "wlan.ext_tag.he_ppe_thresholds.nss",
33372       FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
33373
33374     {&hf_he_ppe_thresholds_ru_index_bitmask,
33375      {"RU Index Bitmask", "wlan.ext_tag.he_ppe_thresholds.ru_index_bitmask",
33376       FT_UINT8, BASE_HEX, NULL, 0x78, NULL, HFILL }},
33377
33378     {&hf_he_ppe_ppet16,
33379      {"PPET16","wlan.ext_tag.he_ppe_thresholds.ppet16",
33380       FT_UINT8, BASE_HEX, VALS(constellation_vals), 0x0, NULL, HFILL }},
33381
33382     {&hf_he_ppe_ppet8,
33383      {"PPET8","wlan.ext_tag.he_ppe_thresholds.ppet8",
33384       FT_UINT8, BASE_HEX, VALS(constellation_vals), 0x0, NULL, HFILL }},
33385
33386     {&hf_he_operation_parameter,
33387      {"HE Operation Parameters", "wlan.ext_tag.he_operation.params",
33388       FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
33389
33390     {&hf_he_operation_bss_color,
33391      {"BSS Color", "wlan.ext_tag.he_operation.he_color",
33392       FT_UINT32, BASE_DEC, NULL, 0x0000003f, NULL, HFILL }},
33393
33394     {&hf_he_operation_default_pe_duration,
33395      {"Default PE Duration", "wlan.ext_tag.he_operation.default_pe_duration",
33396       FT_UINT32, BASE_DEC, NULL, 0x000001C0, NULL, HFILL }},
33397
33398     {&hf_he_operation_twt_required,
33399      {"TWT Required", "wlan.ext_tag.he_operation.twt_required",
33400       FT_BOOLEAN, 32, TFS(&tfs_required_not_required), 0x00000200, NULL, HFILL }},
33401
33402     {&hf_he_operation_txop_duration_rts_threshold,
33403      {"TXOP Duration RTS Threshold", "wlan.ext_tag.he_operation.txop_duration_rts_thresh",
33404       FT_UINT32, BASE_DEC, NULL, 0x000FFC00, NULL, HFILL }},
33405
33406     {&hf_he_operation_partial_bss_color,
33407      {"Partial BSS Color", "wlan.ext_tag.he_operation.partial_bss_color",
33408       FT_BOOLEAN, 32, NULL, 0x00100000, NULL, HFILL }},
33409
33410     {&hf_he_operation_vht_operation_information_present,
33411      {"VHT Operation Information Present", "wlan.ext_tag.he_operation.vht_op_info_present",
33412       FT_BOOLEAN, 32, NULL, 0x00200000, NULL, HFILL }},
33413
33414     {&hf_he_operation_reserved_b22_b27,
33415      {"Reserved", "wlan.ext_tag.he_operation.reserved_b22_b27",
33416       FT_UINT32, BASE_HEX, NULL, 0x0FC00000, NULL, HFILL }},
33417
33418     {&hf_he_operation_multiple_bssid_ap,
33419      {"Multiple BSSID AP", "wlan.ext_tag.he_operation.multiple_bssid_ap",
33420       FT_BOOLEAN, 32, NULL, 0x10000000, NULL, HFILL }},
33421
33422     {&hf_he_operation_txbssid_indicator,
33423      {"TX BSSID Indicator", "wlan.ext_tag.he_operation.tx_bssid_indicator",
33424       FT_BOOLEAN, 32, NULL, 0x20000000, NULL, HFILL }},
33425
33426     {&hf_he_operation_bss_color_disabled,
33427      {"BSS Color Disabled", "wlan.ext_tag.he_operation.bss_color_disabled",
33428       FT_BOOLEAN, 32, TFS(&tfs_disabled_enabled), 0x40000000, NULL, HFILL }},
33429
33430     {&hf_he_operation_reserved_b31,
33431      {"Reserved", "wlan.ext_tag.he_operation.reserved_b31",
33432       FT_UINT32, BASE_HEX, NULL, 0x80000000, NULL, HFILL }},
33433
33434     {&hf_he_operation_basic_mcs,
33435      {"Basic HE-MCS and NSS Set", "wlan.ext_tag.he_operation.basic_he_mcs_and_nss",
33436       FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
33437
33438     {&hf_he_oper_max_he_mcs_for_1_ss,
33439      {"Max HE-MCS for 1 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_1_ss",
33440       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0003, NULL, HFILL }},
33441
33442     {&hf_he_oper_max_he_mcs_for_2_ss,
33443      {"Max HE-MCS for 2 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_2_ss",
33444       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x000C, NULL, HFILL }},
33445
33446     {&hf_he_oper_max_he_mcs_for_3_ss,
33447      {"Max HE-MCS for 3 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_3_ss",
33448       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0030, NULL, HFILL }},
33449
33450     {&hf_he_oper_max_he_mcs_for_4_ss,
33451      {"Max HE-MCS for 4 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_4_ss",
33452       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x00C0, NULL, HFILL }},
33453
33454     {&hf_he_oper_max_he_mcs_for_5_ss,
33455      {"Max HE-MCS for 5 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_5_ss",
33456       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0300, NULL, HFILL }},
33457
33458     {&hf_he_oper_max_he_mcs_for_6_ss,
33459      {"Max HE-MCS for 6 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_6_ss",
33460       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x0C00, NULL, HFILL }},
33461
33462     {&hf_he_oper_max_he_mcs_for_7_ss,
33463      {"Max HE-MCS for 7 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_7_ss",
33464       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0x3000, NULL, HFILL }},
33465
33466     {&hf_he_oper_max_he_mcs_for_8_ss,
33467      {"Max HE-MCS for 8 SS", "wlan.ext_tag.he_operation.max_he_mcs_for_8_ss",
33468       FT_UINT16, BASE_DEC, VALS(he_mcs_map_vals), 0xC000, NULL, HFILL }},
33469
33470     {&hf_he_operation_channel_width,
33471      {"channel Width", "wlan.ext_tag.he_operation.vht_op_info.channel_width",
33472       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33473
33474     {&hf_he_operation_channel_center_freq_0,
33475      {"Channel Center Frequency Segment 0", "wlan.ext_tag.he_operatoon.vht_op_info.chan_center_freq_seg_0",
33476       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33477
33478     {&hf_he_operation_channel_center_freq_1,
33479      {"Channel Center Frequency Segment 1", "wlan.ext_tag.he_operatoon.vht_op_info.chan_center_freq_seg_1",
33480       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33481
33482     {&hf_he_operation_max_bssid_indicator,
33483      {"MaxBSSID Indicator", "wlan.ext_tag.he_operation.maxbssid_indicator",
33484       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33485
33486     {&hf_he_muac_aci_aifsn,
33487      {"AIC/AIFSN","wlan.ext_tag.mu_edca_parameter_set.aic_aifsn",
33488       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33489
33490     {&hf_he_mu_edca_timer,
33491      {"MU EDCA Timer","wlan.ext_tag.mu_edca_parameter_set.mu_edca_timer",
33492       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33493
33494     {&hf_he_muac_ecwmin_ecwmax,
33495      {"ECWmin/ECWmax","wlan.ext_tag.mu_edca_parameter_set.ecwmin_ecwmax",
33496       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33497
33498     {&hf_he_spatial_reuse_sr_control,
33499      {"SR Control", "wlan.ext_tag.spatial_reuse.sr_control",
33500       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33501
33502     {&hf_he_srp_disallowed,
33503      {"SRP Disallowed", "wlan.ext_tag.spatial_reuse.sr_control.srp_dis",
33504       FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
33505
33506     {&hf_he_non_srg_obss_pd_sr_disallowed,
33507      {"NON-SRG OBSS PD SR Disallowed", "wlan.ext_tag.spatial_reuse.sr_control.non_srg_obss_pd_sr_dis",
33508       FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
33509
33510     {&hf_he_non_srg_offset_present,
33511      {"Non-SRG Offset Present", "wlan.ext_tag.spatial_reuse.sr_control.non_srg_ofs_present",
33512       FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
33513
33514     {&hf_he_srg_information_present,
33515      {"SRG Information Present", "wlan.ext_tag.spatial_reuse.sr_control.srg_info_present",
33516      FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
33517
33518     {&hf_he_hesiga_spatial_reuse_value15_allowed,
33519      {"HESIGA Spatial Reuse value 15 allowed", "wlan.ext_tag.spatial_reuse.sr_control.hesiga_val_15_allowed",
33520       FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
33521
33522     {&hf_he_sr_control_reserved,
33523      {"Reserved", "wlan.ext_tag.spatial_reuse.sr_control.reserved",
33524       FT_UINT8, BASE_HEX, NULL, 0xE0, NULL, HFILL }},
33525
33526     {&hf_he_spatial_non_srg_obss_pd_max_offset,
33527      {"Non-SRG OBSS PD Max Offset", "wlan.ext_tag.spatial_reuse.non_srg_obss_pd_max_offset",
33528       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33529
33530     {&hf_he_spatial_srg_obss_pd_min_offset,
33531      {"SRG OBSS PD Min Offset", "wlan.ext_tag.spatial_reuse.srg_obss_pd_min_offset",
33532       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33533
33534     {&hf_he_spatial_srg_obss_pd_max_offset,
33535      {"SRG OBSS PD Max Offset", "wlan.ext_tag.spatial_reuse.srg_obss_pd_max_offset",
33536       FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33537
33538     {&hf_he_spatial_srg_bss_color_bitmap,
33539      {"SRG BSS Color Bitmap", "wlan.ext_tag.spatial_reuse.srg_bss_color_bitmap",
33540       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
33541
33542     {&hf_he_spatial_srg_partial_bssid_bitmap,
33543      {"SRG Partial BSSID Bitmap", "wlan.ext_tag.spatial_reuse.srg_partial_bssid_bitmap",
33544       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
33545
33546     {&hf_he_resource_request_buffer_thresh,
33547      {"Resource Request Buffer Threshold Exponent", "wlan.ext_tag.ndp_feedback.res_req_buf_thresh_exp",
33548       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33549
33550     {&hf_he_bss_color_change_new_color_info,
33551      {"New BSS Color Info", "wlan.ext_tag.bss_color_change.new_color_info",
33552       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33553
33554     {&hf_he_new_bss_color_info_color,
33555      {"New BSS Color", "wlan.ext_tag.bss_color_change.new_bss_color",
33556       FT_UINT8, BASE_HEX, NULL, 0x3F, NULL, HFILL }},
33557
33558     {&hf_he_new_bss_color_info_reserved,
33559      {"Reserved", "wlan.ext_tag.bss_color_change.new_color_reserved",
33560       FT_UINT8, BASE_HEX, NULL, 0xC0, NULL, HFILL }},
33561
33562     {&hf_he_bss_color_change_switch_countdown,
33563      {"BSS Color Switch Countdown", "wlan.ext_tag.bss_color_change.color_switch_countdown",
33564       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
33565
33566     {&hf_he_ess_report_planned_ess,
33567      {"Planned ESS", "wlan.ext_tag.ess_report.ess_info.planned_ess",
33568       FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
33569
33570     {&hf_he_ess_report_edge_of_ess,
33571      {"Edge of ESS", "wlan.ext_tag.ess_report.ess_info.edge_of_ess",
33572       FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
33573
33574     {&hf_he_ess_report_info_field,
33575      {"ESS Information field", "wlan.ext_tag.ess_report.ess_info.field",
33576      FT_UINT8, BASE_HEX, NULL, 0x03, NULL, HFILL }},
33577
33578     {&hf_he_ess_report_recommend_transition_thresh,
33579      {"Recommended BSS Transition Threshold", "wlan.ext_tag.ess_report.ess_info.thresh",
33580      FT_UINT8, BASE_DEC, NULL, 0xFC, NULL, HFILL }},
33581
33582     {&hf_he_uora_field,
33583      {"UL OFDMA-based Random Access Parameter SET", "wlan.ext_tag.uora_parameter_set.field",
33584       FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
33585
33586     {&hf_he_uora_eocwmin,
33587      {"EOCWmin", "wlan.ext_tag.uora_parameter_set.eocwmin",
33588       FT_UINT8, BASE_DEC, NULL, 0x07, NULL, HFILL }},
33589
33590     {&hf_he_uora_owcwmax,
33591      {"EOCWmax", "wlan.ext_tag.uora_parameter_set.eocwmax",
33592       FT_UINT8, BASE_DEC, NULL, 0x38, NULL, HFILL }},
33593
33594     {&hf_he_uora_reserved,
33595      {"Reserved", "wlan.ext_tag.uora_parameter_set.reserved",
33596       FT_UINT8, BASE_DEC, NULL, 0xC0, NULL, HFILL }},
33597   };
33598
33599   static hf_register_info aggregate_fields[] = {
33600     {&hf_ieee80211_amsdu_subframe,
33601      {"A-MSDU Subframe", "wlan_aggregate.a_mdsu.subframe",
33602       FT_NONE, BASE_NONE, NULL, 0x0,
33603       "Aggregate MAC Service Data Unit (MSDU) Subframe", HFILL }},
33604
33605     {&hf_ieee80211_amsdu_length,
33606      {"A-MSDU Length", "wlan_aggregate.a_mdsu.length",
33607       FT_UINT16, BASE_DEC, NULL, 0x0,
33608       NULL, HFILL }}
33609   };
33610
33611   static uat_field_t wep_uat_flds[] = {
33612
33613       UAT_FLD_VS(uat_wep_key_records, key, "Key type", wep_type_vals,
33614                         "Decryption key type used"),
33615       UAT_FLD_CSTRING(uat_wep_key_records, string, "Key",
33616                         "wep:<wep hexadecimal key>\n"
33617                         "wpa-pwd:<passphrase>[:<ssid>]\n"
33618                         "wpa-psk:<wpa hexadecimal key>"),
33619       UAT_END_FIELDS
33620     };
33621
33622   static gint *tree_array[] = {
33623     &ett_80211,
33624     &ett_proto_flags,
33625     &ett_cap_tree,
33626     &ett_fc_tree,
33627     &ett_cntrl_wrapper_fc,
33628     &ett_cntrl_wrapper_payload,
33629     &ett_fragments,
33630     &ett_fragment,
33631     &ett_block_ack,
33632     &ett_block_ack_tid,
33633     &ett_block_ack_request_control,
33634     &ett_block_ack_bitmap,
33635     &ett_block_ack_request_multi_sta_aid_tid,
33636     &ett_multi_sta_block_ack,
33637     &ett_ath_cap_tree,
33638
33639     &ett_80211_mgt,
33640     &ett_fixed_parameters,
33641     &ett_tagged_parameters,
33642     &ett_tag_bmapctl_tree,
33643     &ett_tag_country_fnm_tree,
33644     &ett_tag_country_rcc_tree,
33645     &ett_qos_parameters,
33646     &ett_qos_ps_buf_state,
33647     &ett_wep_parameters,
33648     &ett_msh_control,
33649     &ett_hwmp_targ_flags_tree,
33650     &ett_mesh_chswitch_flag_tree,
33651     &ett_mesh_config_cap_tree,
33652     &ett_mesh_formation_info_tree,
33653
33654     &ett_rsn_gcs_tree,
33655     &ett_rsn_pcs_tree,
33656     &ett_rsn_sub_pcs_tree,
33657     &ett_rsn_akms_tree,
33658     &ett_rsn_sub_akms_tree,
33659     &ett_rsn_cap_tree,
33660     &ett_rsn_pmkid_tree,
33661     &ett_rsn_gmcs_tree,
33662
33663     &ett_wpa_mcs_tree,
33664     &ett_wpa_ucs_tree,
33665     &ett_wpa_sub_ucs_tree,
33666     &ett_wpa_akms_tree,
33667     &ett_wpa_sub_akms_tree,
33668     &ett_wme_ac,
33669     &ett_wme_aci_aifsn,
33670     &ett_wme_ecw,
33671     &ett_wme_qos_info,
33672
33673     &ett_ht_cap_tree,
33674     &ett_ampduparam_tree,
33675     &ett_mcsset_tree,
33676     &ett_mcsbit_tree,
33677     &ett_htex_cap_tree,
33678     &ett_txbf_tree,
33679     &ett_antsel_tree,
33680     &ett_hta_cap_tree,
33681     &ett_hta_cap1_tree,
33682     &ett_hta_cap2_tree,
33683
33684     &ett_htc_tree,
33685     &ett_htc_he_a_control,
33686     &ett_mfb_subtree,
33687     &ett_lac_subtree,
33688     &ett_ieee80211_umrs_control,
33689     &ett_ieee80211_om_control,
33690     &ett_ieee80211_hla_control,
33691     &ett_ieee80211_buffer_status_report,
33692     &ett_ieee80211_control_uph,
33693     &ett_ieee80211_bqr_control,
33694     &ett_ieee80211_control_cci,
33695
33696     &ett_vht_cap_tree,
33697     &ett_vht_mcsset_tree,
33698     &ett_vht_rx_mcsbit_tree,
33699     &ett_vht_tx_mcsbit_tree,
33700     &ett_vht_basic_mcsbit_tree,
33701     &ett_vht_op_tree,
33702     &ett_vht_tpe_info_tree,
33703
33704     &ett_vht_ndp_annc,
33705     &ett_vht_ndp_annc_sta_info_tree,
33706     &ett_vht_ndp_annc_sta_list,
33707
33708     &ett_he_mimo_control,
33709
33710     &ett_ff_vhtmimo_cntrl,
33711     &ett_ff_vhtmimo_beamforming_report,
33712     &ett_ff_vhtmimo_beamforming_report_snr,
33713     &ett_ff_vhtmimo_beamforming_angle,
33714     &ett_ff_vhtmimo_beamforming_report_feedback_matrices,
33715     &ett_ff_vhtmu_exclusive_beamforming_report_matrices,
33716
33717     &ett_vht_grpidmgmt,
33718     &ett_vht_msa,
33719     &ett_vht_upa,
33720
33721     &ett_ht_info_delimiter1_tree,
33722     &ett_ht_info_delimiter2_tree,
33723     &ett_ht_info_delimiter3_tree,
33724
33725     &ett_tag_measure_request_mode_tree,
33726     &ett_tag_measure_request_type_tree,
33727     &ett_tag_measure_report_mode_tree,
33728     &ett_tag_measure_report_type_tree,
33729     &ett_tag_measure_report_basic_map_tree,
33730     &ett_tag_measure_report_rpi_tree,
33731     &ett_tag_measure_report_frame_tree,
33732     &ett_tag_measure_reported_frame_tree,
33733     &ett_tag_bss_bitmask_tree,
33734     &ett_tag_dfs_map_tree,
33735     &ett_tag_erp_info_tree,
33736     &ett_tag_ex_cap1,
33737     &ett_tag_ex_cap2,
33738     &ett_tag_ex_cap3,
33739     &ett_tag_ex_cap4,
33740     &ett_tag_ex_cap5,
33741     &ett_tag_ex_cap6,
33742     &ett_tag_ex_cap7,
33743     &ett_tag_ex_cap8,
33744     &ett_tag_ex_cap89,
33745     &ett_tag_ex_cap10,
33746
33747     &ett_tag_rm_cap1,
33748     &ett_tag_rm_cap2,
33749     &ett_tag_rm_cap3,
33750     &ett_tag_rm_cap4,
33751     &ett_tag_rm_cap5,
33752
33753     &ett_tag_20_40_bc,
33754
33755     &ett_tag_tclas_mask_tree,
33756
33757     &ett_tag_supported_channels,
33758
33759     &ett_tag_neighbor_report_bssid_info_tree,
33760     &ett_tag_neighbor_report_bssid_info_capability_tree,
33761     &ett_tag_neighbor_report_sub_tag_tree,
33762
33763     &ett_tag_wapi_param_set_akm_tree,
33764     &ett_tag_wapi_param_set_ucast_tree,
33765     &ett_tag_wapi_param_set_mcast_tree,
33766     &ett_tag_wapi_param_set_preauth_tree,
33767
33768     &ett_tag_time_adv_tree,
33769
33770     &ett_ff_ba_param_tree,
33771     &ett_ff_ba_ssc_tree,
33772     &ett_ff_delba_param_tree,
33773     &ett_ff_qos_info,
33774     &ett_ff_psmp_param_set,
33775     &ett_ff_mimo_cntrl,
33776     &ett_ff_ant_sel,
33777     &ett_mimo_report,
33778     &ett_ff_sm_pwr_save,
33779     &ett_ff_chan_switch_announce,
33780     &ett_ff_ht_info,
33781     &ett_ff_psmp_sta_info,
33782
33783     &ett_tpc,
33784
33785     &ett_msdu_aggregation_parent_tree,
33786     &ett_msdu_aggregation_subframe_tree,
33787
33788     &ett_80211_mgt_ie,
33789     &ett_tsinfo_tree,
33790     &ett_sched_tree,
33791
33792     &ett_fcs,
33793
33794     &ett_hs20_osu_providers_list,
33795     &ett_hs20_osu_provider_tree,
33796     &ett_hs20_friendly_names_list,
33797     &ett_hs20_friendly_name_tree,
33798     &ett_hs20_osu_provider_method_list,
33799     &ett_osu_icons_avail_list,
33800     &ett_hs20_osu_icon_tree,
33801     &ett_hs20_osu_service_desc_list,
33802     &ett_hs20_osu_service_desc_tree,
33803     &ett_hs20_venue_url,
33804     &ett_hs20_advice_of_charge,
33805     &ett_hs20_aoc_plan,
33806
33807     &ett_hs20_ofn_tree,
33808
33809     &ett_adv_proto,
33810     &ett_adv_proto_tuple,
33811     &ett_gas_query,
33812     &ett_gas_anqp,
33813     &ett_nai_realm,
33814     &ett_nai_realm_eap,
33815     &ett_tag_ric_data_desc_ie,
33816     &ett_anqp_vendor_capab,
33817
33818     &ett_osen_group_data_cipher_suite,
33819     &ett_osen_pairwise_cipher_suites,
33820     &ett_osen_pairwise_cipher_suite,
33821     &ett_osen_akm_cipher_suites,
33822     &ett_osen_akm_cipher_suite,
33823     &ett_osen_rsn_cap_tree,
33824     &ett_osen_pmkid_list,
33825     &ett_osen_pmkid_tree,
33826
33827     &ett_hs20_cc_proto_port_tuple,
33828
33829     &ett_ssid_list,
33830
33831     &ett_nintendo,
33832
33833     &ett_mikrotik,
33834
33835     &ett_meru,
33836
33837     &ett_qos_map_set_exception,
33838     &ett_qos_map_set_range,
33839
33840     /* 802.11ad trees */
33841     &ett_dynamic_alloc_tree,
33842     &ett_ssw_tree,
33843     &ett_bf_tree,
33844     &ett_sswf_tree,
33845     &ett_brp_tree,
33846     &ett_blm_tree,
33847     &ett_bic_tree,
33848     &ett_dmg_params_tree,
33849     &ett_cc_tree,
33850     &ett_rcsi_tree,
33851     &ett_80211_ext,
33852     &ett_allocation_tree,
33853     &ett_sta_info,
33854
33855     &ett_ieee80211_esp,
33856
33857     &ett_gas_resp_fragment,
33858     &ett_gas_resp_fragments,
33859
33860     /* 802.11ax trees */
33861     &ett_he_mac_capabilities,
33862     &ett_he_phy_capabilities,
33863     &ett_he_phy_cap_first_byte,
33864     &ett_he_phy_cap_chan_width_set,
33865     &ett_he_phy_cap_b8_to_b23,
33866     &ett_he_phy_cap_b24_to_b39,
33867     &ett_he_phy_cap_b40_to_b55,
33868     &ett_he_phy_cap_b56_to_b71,
33869     &ett_he_mcs_and_nss_set,
33870     &ett_he_rx_tx_he_mcs_map_lte_80,
33871     &ett_he_rx_mcs_map_lte_80,
33872     &ett_he_tx_mcs_map_lte_80,
33873     &ett_he_rx_tx_he_mcs_map_160,
33874     &ett_he_rx_mcs_map_160,
33875     &ett_he_tx_mcs_map_160,
33876     &ett_he_rx_tx_he_mcs_map_80_80,
33877     &ett_he_rx_mcs_map_80_80,
33878     &ett_he_tx_mcs_map_80_80,
33879     &ett_he_ppe_threshold,
33880     &ett_he_ppe_nss,
33881     &ett_he_ppe_ru_alloc,
33882     &ett_he_operation_params,
33883     &ett_he_oper_basic_mcs,
33884     &ett_he_operation_vht_op_info,
33885     &ett_he_mu_edca_param,
33886     &ett_he_uora_tree,
33887     &ett_he_spatial_reuse_control,
33888     &ett_he_ess_report_info_field,
33889     &ett_he_bss_new_color_info,
33890     &ett_he_trigger_common_info,
33891     &ett_he_trigger_base_common_info,
33892     &ett_he_trigger_bar_ctrl,
33893     &ett_he_trigger_bar_info,
33894     &ett_he_trigger_user_info,
33895     &ett_he_trigger_base_user_info,
33896     &ett_he_trigger_dep_basic_user_info,
33897     &ett_he_trigger_dep_nfrp_user_info,
33898     &ett_he_ndp_annc,
33899     &ett_he_ndp_annc_sta_list,
33900     &ett_he_ndp_annc_sta_item,
33901     &ett_he_ndp_annc_sta_info,
33902     &ett_ieee80211_3gpp_plmn,
33903   };
33904
33905   static ei_register_info ei[] = {
33906     { &ei_ieee80211_bad_length,
33907       { "ieee80211.bad_length", PI_MALFORMED, PI_ERROR,
33908         "Wrong length indicated", EXPFILL }},
33909
33910     { &ei_ieee80211_inv_val,
33911       { "ieee80211.invalid_value", PI_MALFORMED, PI_WARN,
33912         "Invalid value", EXPFILL }},
33913
33914     { &ei_ieee80211_tag_number,
33915       { "wlan.tag.number.unexpected_ie", PI_MALFORMED, PI_ERROR,
33916         "Unexpected Information Element ID", EXPFILL }},
33917
33918     { &ei_ieee80211_tag_length,
33919       { "wlan.tag.length.bad", PI_MALFORMED, PI_ERROR,
33920         "Bad tag length", EXPFILL }},
33921
33922     { &ei_ieee80211_extra_data,
33923       { "ieee80211.extra_data", PI_MALFORMED, PI_WARN,
33924         "Unexpected extra data in the end", EXPFILL }},
33925
33926     { &ei_ieee80211_ff_anqp_capability,
33927       { "wlan.fixed.anqp.capability.invalid", PI_MALFORMED, PI_ERROR,
33928         "Invalid vendor-specific ANQP capability", EXPFILL }},
33929
33930     { &ei_ieee80211_ff_anqp_venue_length,
33931       { "wlan.fixed.anqp.venue.length.invalid", PI_MALFORMED, PI_ERROR,
33932         "Invalid Venue Name Duple length", EXPFILL }},
33933
33934     { &ei_ieee80211_ff_anqp_roaming_consortium_oi_len,
33935       { "wlan.fixed.anqp.roaming_consortium.oi_len.invalid", PI_MALFORMED, PI_ERROR,
33936         "Invalid Roaming Consortium OI", EXPFILL }},
33937
33938     { &ei_ieee80211_ff_anqp_nai_field_len,
33939       { "wlan.fixed.anqp.nai_realm_list.field_len.invalid", PI_MALFORMED, PI_ERROR,
33940         "Invalid NAI Realm List", EXPFILL }},
33941
33942     { &ei_ieee80211_ff_anqp_nai_realm_eap_len,
33943       { "wlan.fixed.naqp_nai_realm_list.eap_method_len.invalid", PI_MALFORMED, PI_ERROR,
33944         "Invalid EAP Method subfield", EXPFILL }},
33945
33946     { &ei_hs20_anqp_ofn_length,
33947       { "wlan.hs20.anqp.ofn.length.invalid", PI_MALFORMED, PI_ERROR,
33948         "Invalid Operator Friendly Name Duple length", EXPFILL }},
33949
33950     { &ei_hs20_anqp_nai_hrq_length,
33951       { "wlan.hs20.anqp.nai_hrq.length.invalid", PI_MALFORMED, PI_ERROR,
33952         "Invalid NAI Home Realm Query length", EXPFILL }},
33953
33954     { &ei_ieee80211_ff_anqp_info_length,
33955       { "wlan.fixed.anqp.info_length.invalid", PI_MALFORMED, PI_ERROR,
33956         "Invalid ANQP Info length", EXPFILL }},
33957
33958     { &ei_ieee80211_not_enough_room_for_anqp_header,
33959       { "wlan.fixed.query_length_invalid", PI_MALFORMED, PI_ERROR,
33960         "Not enough room for ANQP header", EXPFILL }},
33961
33962     { &ei_ieee80211_ff_query_request_length,
33963       { "wlan.fixed.query_request_length.invalid", PI_MALFORMED, PI_ERROR,
33964         "Invalid Query Request Length", EXPFILL }},
33965
33966     { &ei_ieee80211_ff_query_response_length,
33967       { "wlan.fixed.query_response_length.invalid", PI_MALFORMED, PI_ERROR,
33968         "Invalid Query Response Length", EXPFILL }},
33969
33970     { &ei_ieee80211_tag_wnm_sleep_mode_no_key_data,
33971       { "wlan.wnm_sleep_mode.no_key_data", PI_MALFORMED, PI_ERROR,
33972         "WNM-Sleep Mode Response is not long enough to include Key Data", EXPFILL }},
33973
33974     { &ei_ieee80211_tdls_setup_response_malformed,
33975       { "wlan.tdls_setup_response_malformed", PI_MALFORMED, PI_ERROR,
33976         "TDLS Setup Response (success) does not include mandatory fields", EXPFILL }},
33977
33978     { &ei_ieee80211_tdls_setup_confirm_malformed,
33979       { "wlan.tdls_setup_confirm_malformed", PI_MALFORMED, PI_ERROR,
33980         "TDLS Setup Confirm (success) does not include mandatory fields", EXPFILL }},
33981
33982     { &ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype,
33983       { "wlan.wfa.ie.wme.qos_info.bad_ftype", PI_UNDECODED, PI_WARN,
33984         "Could not deduce direction to decode correctly", EXPFILL }},
33985
33986     { &ei_ieee80211_qos_info_bad_ftype,
33987       { "wlan.qos_info.bad_ftype", PI_UNDECODED, PI_WARN,
33988         "Could not deduce direction to decode correctly", EXPFILL }},
33989
33990     { &ei_ieee80211_qos_bad_aifsn,
33991       { "wlan.qos_info.bad_aifsn", PI_MALFORMED, PI_WARN,
33992         "Invalid AIFSN", EXPFILL }},
33993
33994     { &ei_ieee80211_rsn_pcs_count,
33995       { "wlan.rsn.pcs.count.invalid", PI_MALFORMED, PI_ERROR,
33996         "Pairwise Cipher Suite Count too large", EXPFILL }},
33997
33998     { &ei_ieee80211_rsn_pmkid_count,
33999       { "wlan.rsn.akms.count.invalid", PI_MALFORMED, PI_ERROR,
34000         "Auth Key Management (AKM) Suite Count too large", EXPFILL }},
34001
34002     { &ei_ieee80211_pmkid_count_too_large,
34003       { "wlan.rsn.pmkid.count.invalid", PI_MALFORMED, PI_ERROR,
34004         "PMKID Count too large", EXPFILL }},
34005
34006     { &ei_ieee80211_vht_tpe_pwr_info_count,
34007       { "wlan.vht.tpe.pwr_info.count.invalid", PI_MALFORMED, PI_ERROR,
34008         "Max Tx Pwr Count is Incorrect, should be 0-7", EXPFILL }},
34009
34010     { &ei_ieee80211_missing_data,
34011       { "ieee80211.missing_data", PI_MALFORMED, PI_WARN,
34012         "No Request subelements in TFS Request", EXPFILL }},
34013
34014     { &ei_ieee80211_fc_retry,
34015       { "wlan.fc.retry.expert", PI_SEQUENCE, PI_NOTE,
34016         "Retransmission (retry)", EXPFILL }},
34017
34018     { &ei_ieee80211_tag_measure_request_unknown,
34019       { "wlan.measure.req.unknown.expert", PI_UNDECODED, PI_WARN,
34020         "Undecoded Measurement Request type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
34021
34022     { &ei_ieee80211_tag_measure_request_beacon_unknown,
34023       { "wlan.measure.req.beacon.unknown.expert", PI_UNDECODED, PI_WARN,
34024         "Unknown Data (not interpreted)", EXPFILL }},
34025
34026     { &ei_ieee80211_tag_measure_report_unknown,
34027       { "wlan.measure.req.unknown.expert", PI_UNDECODED, PI_WARN,
34028         "Undecoded Measurement Report type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
34029
34030     { &ei_ieee80211_tag_data,
34031       { "wlan.tag.data.undecoded", PI_UNDECODED, PI_NOTE,
34032         "Dissector for 802.11 IE Tag code not implemented, Contact Wireshark developers if you want this supported", EXPFILL }},
34033
34034     { &ei_ieee80211_dmg_subtype,
34035       { "wlan.dmg_subtype.bad", PI_MALFORMED, PI_ERROR,
34036         "Bad DMG type/subtype", EXPFILL }},
34037
34038     { &ei_ieee80211_vht_action,
34039       { "wlan.vht.action.undecoded", PI_UNDECODED, PI_NOTE,
34040         "All subtype of VHT Action is not yet supported by Wireshark", EXPFILL }},
34041
34042     { &ei_ieee80211_mesh_peering_unexpected,
34043       { "wlan.peering.unexpected", PI_MALFORMED, PI_ERROR,
34044         "Unexpected Self-protected action", EXPFILL }},
34045
34046     { &ei_ieee80211_fcs,
34047       { "wlan.fcs.bad_checksum", PI_MALFORMED, PI_ERROR,
34048         "Bad checksum", EXPFILL }},
34049
34050     { &ei_ieee80211_mismatched_akm_suite,
34051       { "wlan.rsn.akms.mismatched", PI_PROTOCOL, PI_ERROR,
34052         "Mismatched AKMS", EXPFILL }},
34053   };
34054
34055   expert_module_t *expert_ieee80211;
34056
34057   module_t *wlan_module;
34058
34059   memset(&wlan_stats, 0, sizeof wlan_stats);
34060
34061   proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
34062       "IEEE 802.11 Aggregate Data", "wlan_aggregate");
34063   proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
34064
34065   proto_wlan = proto_register_protocol("IEEE 802.11 wireless LAN", "IEEE 802.11", "wlan");
34066
34067   heur_subdissector_list = register_heur_dissector_list("wlan_data", proto_wlan);
34068
34069   /* Created to remove Decode As confusion */
34070   proto_centrino = proto_register_protocol("IEEE 802.11 wireless LAN (Centrino)", "IEEE 802.11 (Centrino)", "wlan_centrino");
34071   proto_register_field_array(proto_wlan, hf, array_length(hf));
34072
34073   proto_wlan_ext = proto_register_protocol("IEEE 802.11 wireless LAN extension frame",
34074       "IEEE 802.11 EXT", "wlan_ext");
34075
34076   proto_register_subtree_array(tree_array, array_length(tree_array));
34077
34078   expert_ieee80211 = expert_register_protocol(proto_wlan);
34079   expert_register_field_array(expert_ieee80211, ei, array_length(ei));
34080
34081   ieee80211_handle = register_dissector("wlan", dissect_ieee80211,                    proto_wlan);
34082   register_dissector("wlan_withfcs",            dissect_ieee80211_withfcs,            proto_wlan);
34083   wlan_withoutfcs_handle = register_dissector("wlan_withoutfcs", dissect_ieee80211_withoutfcs, proto_wlan);
34084   register_dissector("wlan_bsfc",               dissect_ieee80211_bsfc,               proto_wlan);
34085   register_dissector("wlan_noqos",              dissect_ieee80211_noqos,              proto_wlan);
34086
34087   register_capture_dissector("ieee80211", capture_ieee80211, proto_wlan);
34088   register_capture_dissector("ieee80211_datapad", capture_ieee80211_datapad, proto_wlan);
34089
34090   reassembly_table_register(&wlan_reassembly_table,
34091                         &addresses_reassembly_table_functions);
34092   register_init_routine(wlan_retransmit_init);
34093   reassembly_table_register(&gas_reassembly_table,
34094                         &addresses_reassembly_table_functions);
34095
34096   wlan_tap = register_tap("wlan");
34097   register_conversation_table(proto_wlan, TRUE, wlan_conversation_packet, wlan_hostlist_packet);
34098
34099   wlan_address_type = address_type_dissector_register("AT_ETHER_WLAN", "WLAN Address", ether_to_str, ether_str_len, NULL, wlan_col_filter_str,
34100                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
34101   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,
34102                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
34103   set_address(&bssid_broadcast, wlan_bssid_address_type, 6, bssid_broadcast_data);
34104
34105   tagged_field_table = register_dissector_table("wlan.tag.number", "IEEE 802.11 Fields", proto_wlan, FT_UINT8, BASE_DEC);
34106   vendor_specific_action_table = register_dissector_table("wlan.action.vendor_specific", "IEEE802.11 Vendor Specific Action", proto_wlan, FT_UINT24, BASE_HEX);
34107   wifi_alliance_action_subtype_table = register_dissector_table("wlan.action.wifi_alliance.subtype", "Wi-Fi Alliance Action Subtype", proto_wlan, FT_UINT8, BASE_HEX);
34108   vendor_specific_anqp_info_table = register_dissector_table("wlan.anqp.vendor_specific", "IEEE802.11 ANQP information Vendor Specific", proto_wlan, FT_UINT24, BASE_HEX);
34109   wifi_alliance_anqp_info_table = register_dissector_table("wlan.anqp.wifi_alliance.subtype", "Wi-Fi Alliance ANQP Subtype", proto_wlan, FT_UINT8, BASE_HEX);
34110   wifi_alliance_ie_table = register_dissector_table("wlan.ie.wifi_alliance.subtype", "Wi-Fi Alliance IE Subtype", proto_wlan, FT_UINT8, BASE_HEX);
34111   wifi_alliance_public_action_table = register_dissector_table("wlan.pa.wifi_alliance.subtype", "Wi-Fi Alliance PA Subtype", proto_wlan, FT_UINT8, BASE_HEX);
34112
34113   /* Register configuration options */
34114   wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
34115   prefs_register_bool_preference(wlan_module, "defragment",
34116     "Reassemble fragmented 802.11 datagrams",
34117     "Whether fragmented 802.11 datagrams should be reassembled",
34118      &wlan_defragment);
34119
34120   prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
34121     "Ignore vendor-specific HT elements",
34122     "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
34123     &wlan_ignore_draft_ht);
34124
34125   prefs_register_bool_preference(wlan_module, "retransmitted",
34126     "Call subdissector for retransmitted 802.11 frames",
34127     "Whether retransmitted 802.11 frames should be subdissected",
34128     &wlan_subdissector);
34129
34130   prefs_register_bool_preference(wlan_module, "check_fcs",
34131     "Assume packets have FCS",
34132     "Some 802.11 cards include the FCS at the end of a packet, others do not.",
34133     &wlan_check_fcs);
34134
34135   prefs_register_bool_preference(wlan_module, "check_checksum",
34136     "Validate the FCS checksum if possible",
34137     "Whether to validate the FCS checksum or not.",
34138     &wlan_check_checksum);
34139
34140   prefs_register_enum_preference(wlan_module, "ignore_wep",
34141     "Ignore the Protection bit",
34142     "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
34143     "and some also leave the IV (initialization vector).",
34144     &wlan_ignore_prot, wlan_ignore_prot_options, TRUE);
34145
34146   prefs_register_uint_preference(wlan_module, "wpa_key_mic_len",
34147     "WPA Key MIC Length override",
34148     "Some Key MIC lengths are greater than 16 bytes, so set the length you require",
34149     10, &wlan_key_mic_len);
34150
34151   prefs_register_obsolete_preference(wlan_module, "wep_keys");
34152
34153   prefs_register_bool_preference(wlan_module, "enable_decryption",
34154     "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
34155     &enable_decryption);
34156
34157   wep_uat = uat_new("WEP and WPA Decryption Keys",
34158             sizeof(uat_wep_key_record_t), /* record size */
34159             "80211_keys",                 /* filename */
34160             TRUE,                         /* from_profile */
34161             &uat_wep_key_records,         /* data_ptr */
34162             &num_wepkeys_uat,             /* numitems_ptr */
34163             UAT_AFFECTS_DISSECTION,       /* affects dissection of packets, but not set of named fields */
34164             NULL,                         /* help. XXX Needs chapter in WSUG */
34165             uat_wep_key_record_copy_cb,   /* copy callback */
34166             uat_wep_key_record_update_cb, /* update callback */
34167             uat_wep_key_record_free_cb,   /* free callback */
34168             init_wepkeys,                 /* post update callback - update the WEP/WPA keys */
34169             NULL,                         /* reset callback */
34170             wep_uat_flds);                /* UAT field definitions */
34171
34172   prefs_register_uat_preference(wlan_module,
34173                                 "wep_key_table",
34174                                 "Decryption keys",
34175                                 "WEP and pre-shared WPA keys\n"
34176                                 "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
34177                                 "010203040506070809101111213 (104/128-bit WEP),\n"
34178                                 "MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
34179                                 "0102030405...6061626364 (WPA + 256-bit key)."
34180                                 "Invalid keys will be ignored.",
34181                                 wep_uat);
34182 }
34183
34184 void
34185 proto_register_wlan_rsna_eapol(void)
34186 {
34187
34188   static hf_register_info hf[] = {
34189     {&hf_wlan_rsna_eapol_wpa_keydes_msgnr,
34190      {"Message number", "wlan_rsna_eapol.keydes.msgnr",
34191       FT_UINT8, BASE_DEC, NULL, 0x0,
34192       NULL, HFILL }},
34193
34194     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo,
34195      {"Key Information", "wlan_rsna_eapol.keydes.key_info",
34196       FT_UINT16, BASE_HEX, NULL, 0x0,
34197       NULL, HFILL }},
34198
34199     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version,
34200      {"Key Descriptor Version", "wlan_rsna_eapol.keydes.key_info.keydes_version",
34201       FT_UINT16, BASE_DEC, VALS(keydes_version_vals), KEY_INFO_KEYDES_VERSION_MASK,
34202       NULL, HFILL }},
34203
34204     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type,
34205      {"Key Type", "wlan_rsna_eapol.keydes.key_info.key_type",
34206       FT_BOOLEAN, 16, TFS(&keyinfo_key_type_tfs), KEY_INFO_KEY_TYPE_MASK,
34207       NULL, HFILL }},
34208
34209     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index,
34210      {"Key Index", "wlan_rsna_eapol.keydes.key_info.key_index",
34211       FT_UINT16, BASE_DEC, NULL, KEY_INFO_KEY_INDEX_MASK,
34212       NULL, HFILL }},
34213
34214     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install,
34215      {"Install", "wlan_rsna_eapol.keydes.key_info.install",
34216       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_INSTALL_MASK,
34217       NULL, HFILL }},
34218
34219     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack,
34220      {"Key ACK", "wlan_rsna_eapol.keydes.key_info.key_ack",
34221       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_ACK_MASK,
34222       NULL, HFILL }},
34223
34224     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic,
34225      {"Key MIC", "wlan_rsna_eapol.keydes.key_info.key_mic",
34226       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_MIC_MASK,
34227       NULL, HFILL }},
34228
34229     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure,
34230      {"Secure", "wlan_rsna_eapol.keydes.key_info.secure",
34231       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_SECURE_MASK,
34232       NULL, HFILL }},
34233
34234     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error,
34235      {"Error", "wlan_rsna_eapol.keydes.key_info.error",
34236       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ERROR_MASK,
34237       NULL, HFILL }},
34238
34239     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request,
34240      {"Request", "wlan_rsna_eapol.keydes.key_info.request",
34241       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_REQUEST_MASK,
34242       NULL, HFILL }},
34243
34244     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data,
34245      {"Encrypted Key Data", "wlan_rsna_eapol.keydes.key_info.encrypted_key_data",
34246       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ENCRYPTED_KEY_DATA_MASK,
34247       NULL, HFILL }},
34248
34249     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
34250      {"SMK Message", "wlan_rsna_eapol.keydes.key_info.smk_message",
34251       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_SMK_MESSAGE_MASK,
34252       NULL, HFILL }},
34253
34254     {&hf_wlan_rsna_eapol_keydes_key_len,
34255      {"Key Length", "eapol.keydes.key_len",
34256       FT_UINT16, BASE_DEC, NULL, 0x0,
34257       NULL, HFILL }},
34258
34259     {&hf_wlan_rsna_eapol_keydes_replay_counter,
34260      {"Replay Counter", "eapol.keydes.replay_counter",
34261       FT_UINT64, BASE_DEC, NULL, 0x0,
34262       NULL, HFILL }},
34263
34264     {&hf_wlan_rsna_eapol_keydes_key_iv,
34265      {"Key IV", "eapol.keydes.key_iv",
34266       FT_BYTES, BASE_NONE, NULL, 0x0,
34267       NULL, HFILL }},
34268
34269     {&hf_wlan_rsna_eapol_wpa_keydes_nonce,
34270      {"WPA Key Nonce", "wlan_rsna_eapol.keydes.nonce",
34271       FT_BYTES, BASE_NONE, NULL, 0x0,
34272       NULL, HFILL }},
34273
34274     {&hf_wlan_rsna_eapol_wpa_keydes_rsc,
34275      {"WPA Key RSC", "wlan_rsna_eapol.keydes.rsc",
34276       FT_BYTES, BASE_NONE, NULL, 0x0,
34277       NULL, HFILL }},
34278
34279     {&hf_wlan_rsna_eapol_wpa_keydes_id,
34280      {"WPA Key ID", "wlan_rsna_eapol.keydes.id",
34281       FT_BYTES, BASE_NONE, NULL, 0x0,
34282       NULL, HFILL }},
34283
34284     {&hf_wlan_rsna_eapol_wpa_keydes_mic,
34285      {"WPA Key MIC", "wlan_rsna_eapol.keydes.mic",
34286       FT_BYTES, BASE_NONE, NULL, 0x0,
34287       NULL, HFILL }},
34288
34289     {&hf_wlan_rsna_eapol_wpa_keydes_data_len,
34290      {"WPA Key Data Length", "wlan_rsna_eapol.keydes.data_len",
34291       FT_UINT16, BASE_DEC, NULL, 0x0,
34292       NULL, HFILL }},
34293
34294     {&hf_wlan_rsna_eapol_wpa_keydes_data,
34295      {"WPA Key Data", "wlan_rsna_eapol.keydes.data",
34296       FT_BYTES, BASE_NONE, NULL, 0x0,
34297       NULL, HFILL }},
34298   };
34299
34300   static gint *tree_array[] = {
34301     &ett_keyinfo,
34302     &ett_wlan_rsna_eapol_keydes_data,
34303   };
34304
34305   proto_wlan_rsna_eapol = proto_register_protocol("IEEE 802.11 RSNA EAPOL key",
34306       "802.11 RSNA EAPOL", "wlan_rsna_eapol");
34307   proto_register_field_array(proto_wlan_rsna_eapol, hf, array_length(hf));
34308
34309   proto_register_subtree_array(tree_array, array_length(tree_array));
34310 }
34311
34312 void
34313 proto_reg_handoff_ieee80211(void)
34314 {
34315   dissector_handle_t data_encap_handle, centrino_handle;
34316   dissector_handle_t wlan_rsna_eapol_wpa_key_handle, wlan_rsna_eapol_rsn_key_handle;
34317   capture_dissector_handle_t ieee80211_cap_handle;
34318
34319   /*
34320    * Get handles for the LLC, IPX and Ethernet  dissectors.
34321    */
34322   llc_handle            = find_dissector_add_dependency("llc", proto_wlan);
34323   ipx_handle            = find_dissector_add_dependency("ipx", proto_wlan);
34324   eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_wlan);
34325
34326   llc_cap_handle = find_capture_dissector("llc");
34327   ipx_cap_handle = find_capture_dissector("ipx");
34328
34329   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
34330
34331   centrino_handle = create_dissector_handle( dissect_ieee80211_centrino, proto_centrino );
34332   dissector_add_uint("ethertype", ETHERTYPE_CENTRINO_PROMISC, centrino_handle);
34333
34334   ieee80211_cap_handle = find_capture_dissector("ieee80211");
34335   capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_cap_handle);
34336   capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_WITH_RADIO, ieee80211_cap_handle);
34337   capture_dissector_add_uint("ppi", 105 /* DLT_DLT_IEEE802_11 */, ieee80211_cap_handle);
34338
34339   /* Register handoff to Aruba GRE */
34340   dissector_add_uint("gre.proto", GRE_ARUBA_8200, wlan_withoutfcs_handle);
34341   dissector_add_uint("gre.proto", GRE_ARUBA_8210, wlan_withoutfcs_handle);
34342   dissector_add_uint("gre.proto", GRE_ARUBA_8220, wlan_withoutfcs_handle);
34343   dissector_add_uint("gre.proto", GRE_ARUBA_8230, wlan_withoutfcs_handle);
34344   dissector_add_uint("gre.proto", GRE_ARUBA_8240, wlan_withoutfcs_handle);
34345   dissector_add_uint("gre.proto", GRE_ARUBA_8250, wlan_withoutfcs_handle);
34346   dissector_add_uint("gre.proto", GRE_ARUBA_8260, wlan_withoutfcs_handle);
34347   dissector_add_uint("gre.proto", GRE_ARUBA_8270, wlan_withoutfcs_handle);
34348   dissector_add_uint("gre.proto", GRE_ARUBA_8280, wlan_withoutfcs_handle);
34349   dissector_add_uint("gre.proto", GRE_ARUBA_8290, wlan_withoutfcs_handle);
34350   dissector_add_uint("gre.proto", GRE_ARUBA_82A0, wlan_withoutfcs_handle);
34351   dissector_add_uint("gre.proto", GRE_ARUBA_82B0, wlan_withoutfcs_handle);
34352   dissector_add_uint("gre.proto", GRE_ARUBA_82C0, wlan_withoutfcs_handle);
34353   dissector_add_uint("gre.proto", GRE_ARUBA_82D0, wlan_withoutfcs_handle);
34354   dissector_add_uint("gre.proto", GRE_ARUBA_82E0, wlan_withoutfcs_handle);
34355   dissector_add_uint("gre.proto", GRE_ARUBA_82F0, wlan_withoutfcs_handle);
34356   dissector_add_uint("gre.proto", GRE_ARUBA_8300, wlan_withoutfcs_handle);
34357   dissector_add_uint("gre.proto", GRE_ARUBA_8310, wlan_withoutfcs_handle);
34358   dissector_add_uint("gre.proto", GRE_ARUBA_8320, wlan_withoutfcs_handle);
34359   dissector_add_uint("gre.proto", GRE_ARUBA_8330, wlan_withoutfcs_handle);
34360   dissector_add_uint("gre.proto", GRE_ARUBA_8340, wlan_withoutfcs_handle);
34361   dissector_add_uint("gre.proto", GRE_ARUBA_8350, wlan_withoutfcs_handle);
34362   dissector_add_uint("gre.proto", GRE_ARUBA_8360, wlan_withoutfcs_handle);
34363   dissector_add_uint("gre.proto", GRE_ARUBA_8370, wlan_withoutfcs_handle);
34364
34365   data_encap_handle = create_dissector_handle(dissect_data_encap, proto_wlan);
34366   dissector_add_uint("ethertype", ETHERTYPE_IEEE80211_DATA_ENCAP,
34367                 data_encap_handle);
34368
34369   /*
34370    * EAPOL key descriptor types.
34371    */
34372   wlan_rsna_eapol_wpa_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
34373                                                                proto_wlan_rsna_eapol);
34374   dissector_add_uint("eapol.keydes.type", EAPOL_WPA_KEY, wlan_rsna_eapol_wpa_key_handle);
34375   wlan_rsna_eapol_rsn_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
34376                                                                proto_wlan_rsna_eapol);
34377   dissector_add_uint("eapol.keydes.type", EAPOL_RSN_KEY, wlan_rsna_eapol_rsn_key_handle);
34378
34379   dissector_add_uint("sflow_245.header_protocol", SFLOW_5_HEADER_80211_MAC, wlan_withoutfcs_handle);
34380
34381   /* Tagged fields */
34382   /* XXX - for now, do it without pinos so the protocol is -1 */
34383   dissector_add_uint("wlan.tag.number", TAG_SSID, create_dissector_handle(ieee80211_tag_ssid, -1));
34384   dissector_add_uint("wlan.tag.number", TAG_SUPP_RATES, create_dissector_handle(ieee80211_tag_supp_rates, -1));
34385   dissector_add_uint("wlan.tag.number", TAG_FH_PARAMETER, create_dissector_handle(ieee80211_tag_fh_parameter, -1));
34386   dissector_add_uint("wlan.tag.number", TAG_DS_PARAMETER, create_dissector_handle(ieee80211_tag_ds_parameter, -1));
34387   dissector_add_uint("wlan.tag.number", TAG_CF_PARAMETER, create_dissector_handle(ieee80211_tag_cf_parameter, -1));
34388   dissector_add_uint("wlan.tag.number", TAG_TIM, create_dissector_handle(ieee80211_tag_tim, -1));
34389   dissector_add_uint("wlan.tag.number", TAG_IBSS_PARAMETER, create_dissector_handle(ieee80211_tag_ibss_parameter, -1));
34390   dissector_add_uint("wlan.tag.number", TAG_COUNTRY_INFO, create_dissector_handle(ieee80211_tag_country_info, -1));
34391   dissector_add_uint("wlan.tag.number", TAG_FH_HOPPING_PARAMETER, create_dissector_handle(ieee80211_tag_fh_hopping_parameter, -1));
34392   dissector_add_uint("wlan.tag.number", TAG_FH_HOPPING_TABLE, create_dissector_handle(ieee80211_tag_fh_hopping_table, -1));
34393   dissector_add_uint("wlan.tag.number", TAG_REQUEST, create_dissector_handle(ieee80211_tag_request, -1));
34394   dissector_add_uint("wlan.tag.number", TAG_QBSS_LOAD, create_dissector_handle(ieee80211_tag_qbss_load, -1));
34395   dissector_add_uint("wlan.tag.number", TAG_EDCA_PARAM_SET, create_dissector_handle(ieee80211_tag_edca_param_set, -1));
34396   dissector_add_uint("wlan.tag.number", TAG_TSPEC, create_dissector_handle(ieee80211_tag_tspec, -1));
34397   dissector_add_uint("wlan.tag.number", TAG_TCLAS, create_dissector_handle(ieee80211_tag_tclas, -1));
34398   dissector_add_uint("wlan.tag.number", TAG_SCHEDULE, create_dissector_handle(ieee80211_tag_schedule, -1));
34399   dissector_add_uint("wlan.tag.number", TAG_CHALLENGE_TEXT, create_dissector_handle(ieee80211_tag_challenge_text, -1));
34400   dissector_add_uint("wlan.tag.number", TAG_POWER_CONSTRAINT, create_dissector_handle(ieee80211_tag_power_constraint, -1));
34401   dissector_add_uint("wlan.tag.number", TAG_POWER_CAPABILITY, create_dissector_handle(ieee80211_tag_power_capability, -1));
34402   dissector_add_uint("wlan.tag.number", TAG_TPC_REQUEST, create_dissector_handle(ieee80211_tag_tpc_request, -1));
34403   dissector_add_uint("wlan.tag.number", TAG_TPC_REPORT, create_dissector_handle(ieee80211_tag_tpc_report, -1));
34404   dissector_add_uint("wlan.tag.number", TAG_SUPPORTED_CHANNELS, create_dissector_handle(ieee80211_tag_supported_channels, -1));
34405   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_ANN, create_dissector_handle(ieee80211_tag_switch_ann, -1));
34406   dissector_add_uint("wlan.tag.number", TAG_MEASURE_REQ, create_dissector_handle(ieee80211_tag_measure_req, -1));
34407   dissector_add_uint("wlan.tag.number", TAG_MEASURE_REP, create_dissector_handle(ieee80211_tag_measure_rep, -1));
34408   dissector_add_uint("wlan.tag.number", TAG_QUIET, create_dissector_handle(ieee80211_tag_quiet, -1));
34409   dissector_add_uint("wlan.tag.number", TAG_IBSS_DFS, create_dissector_handle(ieee80211_tag_ibss_dfs, -1));
34410   dissector_add_uint("wlan.tag.number", TAG_ERP_INFO, create_dissector_handle(ieee80211_tag_erp_info, -1));
34411   dissector_add_uint("wlan.tag.number", TAG_ERP_INFO_OLD, create_dissector_handle(ieee80211_tag_erp_info, -1));
34412   dissector_add_uint("wlan.tag.number", TAG_TS_DELAY, create_dissector_handle(ieee80211_tag_ts_delay, -1));
34413   dissector_add_uint("wlan.tag.number", TAG_TCLAS_PROCESS, create_dissector_handle(ieee80211_tag_tclas_process, -1));
34414   dissector_add_uint("wlan.tag.number", TAG_QOS_CAPABILITY, create_dissector_handle(ieee80211_tag_qos_capability, -1));
34415   dissector_add_uint("wlan.tag.number", TAG_RSN_IE, create_dissector_handle(ieee80211_tag_rsn_ie, -1));
34416   dissector_add_uint("wlan.tag.number", TAG_EXT_SUPP_RATES, create_dissector_handle(ieee80211_tag_ext_supp_rates, -1));
34417   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_CAPABILITIES, create_dissector_handle(dissect_extended_capabilities_ie, -1));
34418   dissector_add_uint("wlan.tag.number", TAG_CISCO_CCX1_CKIP, create_dissector_handle(ieee80211_tag_cisco_ccx1_ckip, -1));
34419   dissector_add_uint("wlan.tag.number", TAG_VHT_CAPABILITY, create_dissector_handle(dissect_vht_capability_ie, -1));
34420   dissector_add_uint("wlan.tag.number", TAG_VHT_OPERATION, create_dissector_handle(dissect_vht_operation_ie, -1));
34421   dissector_add_uint("wlan.tag.number", TAG_EXT_BSS_LOAD, create_dissector_handle(dissect_ext_bss_load, -1));
34422   dissector_add_uint("wlan.tag.number", TAG_WIDE_BW_CHANNEL_SWITCH, create_dissector_handle(dissect_wide_bw_channel_switch, -1));
34423   dissector_add_uint("wlan.tag.number", TAG_VHT_TX_PWR_ENVELOPE, create_dissector_handle(dissect_vht_tx_pwr_envelope, -1));
34424   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_WRAPPER, create_dissector_handle(dissect_channel_switch_wrapper, -1));
34425   dissector_add_uint("wlan.tag.number", TAG_OPERATING_MODE_NOTIFICATION, create_dissector_handle(dissect_operating_mode_notification, -1));
34426   /* 7.3.2.26 Vendor Specific information element (221) */
34427   dissector_add_uint("wlan.tag.number", TAG_VENDOR_SPECIFIC_IE, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
34428   /* This Cisco proprietary IE seems to mimic 221 */
34429   dissector_add_uint("wlan.tag.number", TAG_CISCO_VENDOR_SPECIFIC, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
34430   /* This Symbol proprietary IE seems to mimic 221 */
34431   dissector_add_uint("wlan.tag.number", TAG_SYMBOL_PROPRIETARY, create_dissector_handle(ieee80211_tag_vendor_specific_ie, -1));
34432   dissector_add_uint("wlan.tag.number", TAG_MOBILITY_DOMAIN, create_dissector_handle(dissect_mobility_domain, -1));
34433   dissector_add_uint("wlan.tag.number", TAG_FAST_BSS_TRANSITION, create_dissector_handle(dissect_fast_bss_transition, -1));
34434   dissector_add_uint("wlan.tag.number", TAG_MMIE, create_dissector_handle(dissect_mmie, -1));
34435   dissector_add_uint("wlan.tag.number", TAG_SSID_LIST, create_dissector_handle(dissect_ssid_list, -1));
34436   dissector_add_uint("wlan.tag.number", TAG_TIME_ZONE, create_dissector_handle(dissect_time_zone, -1));
34437   dissector_add_uint("wlan.tag.number", TAG_TIMEOUT_INTERVAL, create_dissector_handle(dissect_timeout_interval, -1));
34438   dissector_add_uint("wlan.tag.number", TAG_RIC_DATA, create_dissector_handle(dissect_ric_data, -1));
34439   dissector_add_uint("wlan.tag.number", TAG_LINK_IDENTIFIER, create_dissector_handle(dissect_link_identifier, -1));
34440   dissector_add_uint("wlan.tag.number", TAG_WAKEUP_SCHEDULE, create_dissector_handle(dissect_wakeup_schedule, -1));
34441   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_SWITCH_TIMING, create_dissector_handle(dissect_channel_switch_timing, -1));
34442   dissector_add_uint("wlan.tag.number", TAG_PTI_CONTROL, create_dissector_handle(dissect_pti_control, -1));
34443   dissector_add_uint("wlan.tag.number", TAG_PU_BUFFER_STATUS, create_dissector_handle(dissect_pu_buffer_status, -1));
34444   dissector_add_uint("wlan.tag.number", TAG_HT_CAPABILITY, create_dissector_handle(dissect_ht_capability_ie, -1));
34445   dissector_add_uint("wlan.tag.number", TAG_HT_INFO, create_dissector_handle(dissect_ht_info_ie_1_1, -1));
34446   dissector_add_uint("wlan.tag.number", TAG_SECONDARY_CHANNEL_OFFSET, create_dissector_handle(dissect_secondary_channel_offset_ie, -1));
34447   dissector_add_uint("wlan.tag.number", TAG_BSS_AVG_ACCESS_DELAY, create_dissector_handle(dissect_bss_avg_access_delay_ie, -1));
34448   dissector_add_uint("wlan.tag.number", TAG_ANTENNA, create_dissector_handle(dissect_antenna_ie, -1));
34449   dissector_add_uint("wlan.tag.number", TAG_RSNI, create_dissector_handle(dissect_rsni_ie, -1));
34450   dissector_add_uint("wlan.tag.number", TAG_MEASURE_PILOT_TRANS, create_dissector_handle(dissect_measurement_pilot_trans_ie, -1));
34451   dissector_add_uint("wlan.tag.number", TAG_BSS_AVB_ADM_CAPACITY, create_dissector_handle(dissect_bss_available_admission_capacity_ie, -1));
34452   dissector_add_uint("wlan.tag.number", TAG_IE_68_CONFLICT, create_dissector_handle(ieee80211_tag_ie_68_conflict, -1));
34453   dissector_add_uint("wlan.tag.number", TAG_BSS_MAX_IDLE_PERIOD, create_dissector_handle(dissect_bss_max_idle_period, -1));
34454   dissector_add_uint("wlan.tag.number", TAG_TFS_REQUEST, create_dissector_handle(dissect_tfs_request, -1));
34455   dissector_add_uint("wlan.tag.number", TAG_TFS_RESPONSE, create_dissector_handle(dissect_tfs_response, -1));
34456   dissector_add_uint("wlan.tag.number", TAG_WNM_SLEEP_MODE, create_dissector_handle(dissect_wnm_sleep_mode, -1));
34457   dissector_add_uint("wlan.tag.number", TAG_TIME_ADV, create_dissector_handle(dissect_time_adv, -1));
34458   dissector_add_uint("wlan.tag.number", TAG_RM_ENABLED_CAPABILITY, create_dissector_handle(dissect_rm_enabled_capabilities_ie, -1));
34459   dissector_add_uint("wlan.tag.number", TAG_20_40_BSS_CO_EX, create_dissector_handle(dissect_20_40_bss_coexistence, -1));
34460   dissector_add_uint("wlan.tag.number", TAG_OVERLAP_BSS_SCAN_PAR, create_dissector_handle(dissect_overlap_bss_scan_par, -1));
34461   dissector_add_uint("wlan.tag.number", TAG_RIC_DESCRIPTOR, create_dissector_handle(dissect_ric_descriptor, -1));
34462   dissector_add_uint("wlan.tag.number", TAG_MESH_PEERING_MGMT, create_dissector_handle(ieee80211_tag_mesh_peering_mgmt, -1));
34463   dissector_add_uint("wlan.tag.number", TAG_MESH_CONFIGURATION, create_dissector_handle(ieee80211_tag_mesh_configuration, -1));
34464   dissector_add_uint("wlan.tag.number", TAG_MESH_ID, create_dissector_handle(ieee80211_tag_mesh_id, -1));
34465   dissector_add_uint("wlan.tag.number", TAG_MESH_PREQ, create_dissector_handle(ieee80211_tag_mesh_preq, -1));
34466   dissector_add_uint("wlan.tag.number", TAG_MESH_PREP, create_dissector_handle(ieee80211_tag_mesh_prep, -1));
34467   dissector_add_uint("wlan.tag.number", TAG_MESH_PERR, create_dissector_handle(ieee80211_tag_mesh_perr, -1));
34468   dissector_add_uint("wlan.tag.number", TAG_RANN, create_dissector_handle(ieee80211_tag_rann, -1));
34469   dissector_add_uint("wlan.tag.number", TAG_MESH_CHANNEL_SWITCH, create_dissector_handle(ieee80211_tag_mesh_channel_switch, -1));
34470   dissector_add_uint("wlan.tag.number", TAG_INTERWORKING, create_dissector_handle(dissect_interworking, -1));
34471   dissector_add_uint("wlan.tag.number", TAG_ADVERTISEMENT_PROTOCOL, create_dissector_handle(dissect_advertisement_protocol, -1));
34472   dissector_add_uint("wlan.tag.number", TAG_QOS_MAP_SET, create_dissector_handle(dissect_qos_map_set, -1));
34473   dissector_add_uint("wlan.tag.number", TAG_ROAMING_CONSORTIUM, create_dissector_handle(dissect_roaming_consortium, -1));
34474   dissector_add_uint("wlan.tag.number", TAG_AP_CHANNEL_REPORT, create_dissector_handle(dissect_ap_channel_report, -1));
34475   dissector_add_uint("wlan.tag.number", TAG_NEIGHBOR_REPORT, create_dissector_handle(dissect_neighbor_report, -1));
34476   dissector_add_uint("wlan.tag.number", TAG_MESH_AWAKE_WINDOW, create_dissector_handle(ieee80211_tag_mesh_awake_window, -1));
34477   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, create_dissector_handle(ieee80211_tag_channel_switch_announcement, -1));
34478   dissector_add_uint("wlan.tag.number", TAG_SUPPORTED_OPERATING_CLASSES, create_dissector_handle(ieee80211_tag_supported_operating_classes, -1));
34479   dissector_add_uint("wlan.tag.number", TAG_RELAY_CAPABILITIES, create_dissector_handle(add_tag_relay_capabilities, -1));
34480   dissector_add_uint("wlan.tag.number", TAG_DMG_BSS_PARAMETER_CHANGE, create_dissector_handle(ieee80211_tag_bss_parameter_change, -1));
34481   dissector_add_uint("wlan.tag.number", TAG_DMG_CAPABILITIES, create_dissector_handle(ieee80211_tag_dmg_capabilities, -1));
34482   dissector_add_uint("wlan.tag.number", TAG_DMG_OPERATION, create_dissector_handle(ieee80211_tag_dmg_operation, -1));
34483   dissector_add_uint("wlan.tag.number", TAG_ANTENNA_SECTOR_ID, create_dissector_handle(ieee80211_tag_antenna_section_id, -1));
34484   dissector_add_uint("wlan.tag.number", TAG_EXTENDED_SCHEDULE, create_dissector_handle(ieee80211_tag_extended_schedule, -1));
34485   dissector_add_uint("wlan.tag.number", TAG_STA_AVAILABILITY, create_dissector_handle(ieee80211_tag_sta_availability, -1));
34486   dissector_add_uint("wlan.tag.number", TAG_NEXT_DMG_ATI, create_dissector_handle(ieee80211_tag_next_dmg_ati, -1));
34487   dissector_add_uint("wlan.tag.number", TAG_NEXTPCP_LIST, create_dissector_handle(ieee80211_tag_nextpcp_list, -1));
34488   dissector_add_uint("wlan.tag.number", TAG_PCP_HANDOVER, create_dissector_handle(ieee80211_tag_pcp_handover, -1));
34489   dissector_add_uint("wlan.tag.number", TAG_BEAMLINK_MAINTENANCE, create_dissector_handle(ieee80211_tag_beamlink_maintenance, -1));
34490   dissector_add_uint("wlan.tag.number", TAG_QUIET_PERIOD_RES, create_dissector_handle(ieee80211_tag_quiet_period_res, -1));
34491   dissector_add_uint("wlan.tag.number", TAG_RELAY_TRANSFER_PARAM, create_dissector_handle(ieee80211_tag_relay_transfer_param, -1));
34492   dissector_add_uint("wlan.tag.number", TAG_DMG_BEAM_REFINEMENT, create_dissector_handle(ieee80211_tag_dmg_beam_refinement, -1));
34493   dissector_add_uint("wlan.tag.number", TAG_WAKEUP_SCHEDULE_AD, create_dissector_handle(ieee80211_tag_wakeup_schedule_ad, -1));
34494   dissector_add_uint("wlan.tag.number", TAG_DMG_TSPEC, create_dissector_handle(ieee80211_tag_dmg_tspec, -1));
34495   dissector_add_uint("wlan.tag.number", TAG_CHANNEL_MEASURMENT_FB, create_dissector_handle(ieee80211_tag_channel_measurement_fb, -1));
34496   dissector_add_uint("wlan.tag.number", TAG_AWAKE_WINDOW, create_dissector_handle(ieee80211_tag_awake_window, -1));
34497   dissector_add_uint("wlan.tag.number", TAG_ADDBA_EXT, create_dissector_handle(ieee80211_tag_addba_ext, -1));
34498   dissector_add_uint("wlan.tag.number", TAG_MULTI_BAND, create_dissector_handle(ieee80211_tag_multi_band, -1));
34499   dissector_add_uint("wlan.tag.number", TAG_DMG_LINK_MARGIN, create_dissector_handle(ieee80211_tag_dmg_link_margin, -1));
34500   dissector_add_uint("wlan.tag.number", TAG_DMG_LINK_ADAPTION_ACK, create_dissector_handle(ieee80211_tag_dmg_link_adaption_ack, -1));
34501   dissector_add_uint("wlan.tag.number", TAG_SWITCHING_STREAM, create_dissector_handle(ieee80211_tag_switching_stream, -1));
34502   dissector_add_uint("wlan.tag.number", TAG_ELEMENT_ID_EXTENSION, create_dissector_handle(ieee80211_tag_element_id_extension, -1));
34503
34504   /* Vendor specific actions */
34505   dissector_add_uint("wlan.action.vendor_specific", OUI_MARVELL, create_dissector_handle(dissect_vendor_action_marvell, -1));
34506   dissector_add_uint("wlan.action.vendor_specific", OUI_WFA, create_dissector_handle(dissect_vendor_action_wifi_alliance, -1));
34507
34508   dissector_add_uint("wlan.anqp.vendor_specific", OUI_WFA, create_dissector_handle(dissect_vendor_wifi_alliance_anqp, -1));
34509   dissector_add_uint("wlan.anqp.wifi_alliance.subtype", WFA_SUBTYPE_HS20_ANQP, create_dissector_handle(dissect_hs20_anqp, -1));
34510   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_SUBSCRIPTION_REMEDIATION, create_dissector_handle(dissect_hs20_subscription_remediation, -1));
34511   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_DEAUTHENTICATION_IMMINENT, create_dissector_handle(dissect_hs20_deauthentication_imminent, -1));
34512   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_HS20_INDICATION, create_dissector_handle(dissect_hs20_indication, -1));
34513   dissector_add_uint("wlan.ie.wifi_alliance.subtype", WFA_SUBTYPE_OSEN, create_dissector_handle(dissect_hs20_osen, -1));
34514 }
34515
34516 /*
34517  * Editor modelines
34518  *
34519  * Local Variables:
34520  * c-basic-offset: 2
34521  * tab-width: 8
34522  * indent-tabs-mode: nil
34523  * End:
34524  *
34525  * ex: set shiftwidth=2 tabstop=8 expandtab:
34526  * :indentSize=2:tabSize=8:noTabs=true:
34527  */