Add format_text_wmem.
[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  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  *
23  * Credits:
24  *
25  * The following people helped me by pointing out bugs etc. Thank you!
26  *
27  * Marco Molteni
28  * Lena-Marie Nilsson
29  * Magnus Hultman-Persson
30  */
31
32 /*
33  * 10/24/2005 - Add dissection for 802.11e
34  * Zhu Yi <yi.zhu@intel.com>
35  *
36  * 04/21/2008 - Added dissection for 802.11p
37  * Arada Systems <http://www.aradasystems.com>
38  *
39  * 04/20/2013 - Added dissection of 802.11ad according to the 9th draft of the standard.
40  * Extended as a project in the Laboratory of Computer Communication & Networking (LCCN), Computer Science Department, Technion, Israel.
41  * Majd Omari    <majd.omari@outlook.com>
42  * Jalil Moraney <moraney.jalil@outlook.com>
43  */
44
45 /*
46  * Reference :
47  * The 802.11 standard is "free", 6 month after the publication.
48  *
49  * IEEE Std 802.11-2012: Revision of IEEE Std 802.11-2007
50  * include 10 amendments (802.11k,r,y,w,n,p,z,v,u,s) 802.11-2007
51  * include 8 amendments (802.11a,b,d,e,g,h,i,j) 802.11-1999
52  * http://standards.ieee.org/getieee802/download/802.11-2012.pdf
53  *
54  * WAPI (IE 68)
55  * http://isotc.iso.org/livelink/livelink/fetch/-8913189/8913214/8913250/8913253/JTC001-N-9880.pdf?nodeid=8500308&vernum=-2
56  */
57
58 #include "config.h"
59
60 #include <math.h>
61
62 #include <epan/packet.h>
63 #include <epan/capture_dissectors.h>
64 #include <epan/exceptions.h>
65 #include <wsutil/pint.h>
66 #include <wsutil/str_util.h>
67 #include <epan/addr_resolv.h>
68 #include <epan/address_types.h>
69 #include <epan/strutil.h>
70 #include <epan/prefs.h>
71 #include <epan/reassemble.h>
72 #include "packet-ipx.h"
73 #include "packet-llc.h"
74 #include "packet-ieee80211.h"
75 #include <epan/etypes.h>
76 #include <epan/oui.h>
77 #include <epan/crc32-tvb.h>
78 #include <epan/crypt/wep-wpadefs.h>
79 #include <epan/expert.h>
80 #include <epan/conversation_table.h>
81 #include <epan/uat.h>
82 #include <epan/eapol_keydes_types.h>
83 #include <epan/to_str.h>
84 #include <epan/proto_data.h>
85
86 #include "packet-wps.h"
87 #include "packet-e212.h"
88 #include "packet-sflow.h"
89 #include "packet-gre.h"
90
91 #include <epan/crypt/airpdcap_ws.h>
92
93 void proto_register_ieee80211(void);
94 void proto_reg_handoff_ieee80211(void);
95 void proto_register_wlan_rsna_eapol(void);
96
97 extern value_string_ext eap_type_vals_ext; /* from packet-eap.c */
98
99 #ifndef roundup2
100 #define roundup2(x, y)  (((x)+((y)-1))&(~((y)-1)))  /* if y is powers of two */
101 #endif
102
103 /* bitmask for bits [l..h]
104  * taken from kernel's include/linux/bitops.h
105  */
106 #define GENMASK(h, l)  (((1U << ((h) - (l) + 1)) - 1) << (l))
107
108 /* Defragment fragmented 802.11 datagrams */
109 static gboolean wlan_defragment = TRUE;
110
111 /* call subdissector for retransmitted frames */
112 static gboolean wlan_subdissector = TRUE;
113
114 /* Check for the presence of the 802.11 FCS */
115 static gboolean wlan_check_fcs = FALSE;
116
117 /* Check the FCS checksum */
118 static gboolean wlan_check_checksum = TRUE;
119
120 /* Ignore vendor-specific HT elements */
121 static gboolean wlan_ignore_draft_ht = FALSE;
122
123 /* Ignore the Protection bit; assume packet is decrypted */
124 #define WLAN_IGNORE_PROT_NO     0
125 #define WLAN_IGNORE_PROT_WO_IV  1
126 #define WLAN_IGNORE_PROT_W_IV   2
127 static gint wlan_ignore_prot = WLAN_IGNORE_PROT_NO;
128
129 /* Table for reassembly of fragments. */
130 static reassembly_table wlan_reassembly_table;
131
132 /* Statistical data */
133 static struct _wlan_stats wlan_stats;
134
135 /*-------------------------------------
136  * UAT for WEP decoder
137  *-------------------------------------
138  */
139 static uat_wep_key_record_t *uat_wep_key_records = NULL;
140 static uat_t                *wep_uat             = NULL;
141 static guint                 num_wepkeys_uat     = 0;
142
143 static void *
144 uat_wep_key_record_copy_cb(void* n, const void* o, size_t siz _U_)
145 {
146   uat_wep_key_record_t* new_key = (uat_wep_key_record_t *)n;
147   const uat_wep_key_record_t* old_key = (const uat_wep_key_record_t *)o;
148
149   if (old_key->string) {
150     new_key->string = g_strdup(old_key->string);
151   } else {
152     new_key->string = NULL;
153   }
154
155   return new_key;
156 }
157
158 static gboolean
159 uat_wep_key_record_update_cb(void* r, char** err)
160 {
161   uat_wep_key_record_t* rec = (uat_wep_key_record_t *)r;
162   decryption_key_t* dk;
163   guint dk_type;
164
165   if (rec->string == NULL) {
166     *err = g_strdup("Key can't be blank");
167     return FALSE;
168   }
169
170   g_strstrip(rec->string);
171   dk = parse_key_string(rec->string, rec->key);
172
173   if (dk != NULL) {
174     dk_type = dk->type;
175     free_key_string(dk);
176     switch (dk_type) {
177       case AIRPDCAP_KEY_TYPE_WEP:
178       case AIRPDCAP_KEY_TYPE_WEP_40:
179       case AIRPDCAP_KEY_TYPE_WEP_104:
180         if (rec->key != AIRPDCAP_KEY_TYPE_WEP) {
181           *err = g_strdup("Invalid key format");
182           return FALSE;
183         }
184         break;
185       case AIRPDCAP_KEY_TYPE_WPA_PWD:
186         if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PWD) {
187           *err = g_strdup("Invalid key format");
188           return FALSE;
189         }
190         break;
191       case AIRPDCAP_KEY_TYPE_WPA_PSK:
192         if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PSK) {
193           *err = g_strdup("Invalid key format");
194           return FALSE;
195         }
196         break;
197       default:
198         *err = g_strdup("Invalid key format");
199         return FALSE;
200         break;
201     }
202   } else {
203     *err = g_strdup("Invalid key format");
204     return FALSE;
205   }
206   return TRUE;
207 }
208
209 static void
210 uat_wep_key_record_free_cb(void*r)
211 {
212   uat_wep_key_record_t* key = (uat_wep_key_record_t *)r;
213
214   if (key->string) g_free(key->string);
215 }
216
217 UAT_VS_DEF(uat_wep_key_records, key, uat_wep_key_record_t, guint8, 0, STRING_KEY_TYPE_WEP)
218 UAT_CSTRING_CB_DEF(uat_wep_key_records, string, uat_wep_key_record_t)
219
220 /* Stuff for the WEP/WPA/WPA2 decoder */
221 static gboolean enable_decryption = TRUE;
222
223 static void
224 ieee_80211_add_tagged_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
225                                   proto_tree *tree, int tagged_parameters_len, int ftype,
226                                   association_sanity_check_t *association_sanity_check);
227
228 static tvbuff_t *try_decrypt(tvbuff_t *tvb, packet_info *pinfo, guint32 offset, guint32 len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer, PAIRPDCAP_KEY_ITEM used_key);
229
230 static int weak_iv(guchar *iv);
231
232 typedef struct mimo_control
233 {
234   guint8 nc;
235   guint8 nr;
236   gboolean chan_width;
237   guint8 grouping;
238   guint8 coefficient_size;
239   guint8 codebook_info;
240   guint8 remaining_matrix_segment;
241 } mimo_control_t;
242
243 /* ************************************************************************* */
244 /*                          Miscellaneous Constants                          */
245 /* ************************************************************************* */
246 #define SHORT_STR 256
247 #define IS_DMG_KEY 1
248 #define IS_CTRL_GRANT_OR_GRANT_ACK_KEY 2
249 /* ************************************************************************* */
250 /*  Define some very useful macros that are used to analyze frame types etc. */
251 /* ************************************************************************* */
252
253 /*
254  * Fetch the frame control field and swap it if needed.  "fcf" and "tvb"
255  * must be valid variables.
256  */
257 #define FETCH_FCF(off) ((option_flags & IEEE80211_COMMON_OPT_BROKEN_FC) ? \
258   GUINT16_SWAP_LE_BE(tvb_get_letohs(tvb, off)) : \
259   tvb_get_letohs(tvb, off))
260
261 /*
262  * Extract the fragment number and sequence number from the sequence
263  * control field.
264  */
265 #define SEQCTL_FRAGMENT_NUMBER(x) ((x) & 0x000F)
266 #define SEQCTL_SEQUENCE_NUMBER(x) (((x) & 0xFFF0) >> 4)
267
268 /*
269  * Extract subfields from the QoS control field.
270  */
271 #define QOS_TID(x)            ((x) & 0x000F)
272 #define QOS_PRIORITY(x)       ((x) & 0x0007)
273 #define QOS_EOSP(x)           (((x) & 0x0010) >> 4) /* end of service period */
274 #define QOS_ACK_POLICY(x)     (((x) & 0x0060) >> 5)
275 #define QOS_AMSDU_PRESENT(x)  (((x) & 0x0080) >> 6)
276 #define QOS_FIELD_CONTENT(x)  (((x) & 0xFF00) >> 8)
277 #define QOS_MESH_CONTROL_PRESENT(x) (((x) & 0x0100) >> 8)
278
279 #define QOS_FLAG_EOSP    0x0010
280
281 /*
282  * Extract subfields from the result of QOS_FIELD_CONTENT().
283  */
284 #define QOS_PS_BUF_STATE_INDICATED(x)  (((x) & 0x02) >> 1)
285 #define QOS_PS_HIGHEST_PRI_BUF_AC(x)   (((x) & 0x0C) >> 2)
286 #define QOS_PS_QAP_BUF_LOAD(x)         (((x) & 0xF0) >> 4)
287
288 /*
289  * Bits from the HT Control field.
290  * 802.11-2012 and 802.11ac-2013 8.2.4.6, 32 bits.
291  */
292 #define HTC_VHT              0x00000001
293 #define HTC_MRQ              0x00000004
294 #define HTC_UNSOLICITED_MFB  0x20000000
295
296 /*
297  * Extract subfields from the HT Control field.
298  */
299 #define HTC_LAC(htc)           ((htc) & 0xFE)
300 #define HTC_LAC_MAI(htc)       (((htc) >> 2) & 0xF)
301 #define HTC_IS_ASELI(htc)      (HTC_LAC_MAI(htc) == 0xE)
302 #define HTC_LAC_MAI_MRQ(htc)   ((HTC_LAC_MAI(htc))  & 0x1)
303 #define HTC_LAC_MAI_MSI(htc)   ((HTC_LAC_MAI(htc) >> 1) & 0x7)
304 #define HTC_LAC_MFSI(htc)      (((htc) >> 4) & 0x7)
305 #define HTC_LAC_ASEL_CMD(htc)  (((htc) >> 9) & 0x7)
306 #define HTC_LAC_ASEL_DATA(htc) (((htc) >> 12) & 0xF)
307 #define HTC_LAC_MFB(htc)       (((htc) >> 9) & 0x7F)
308 #define HTC_CAL_POS(htc)       (((htc) >> 16) & 0x3)
309 #define HTC_CAL_SEQ(htc)       (((htc) >> 18) & 0x3)
310 #define HTC_CSI_STEERING(htc)  (((htc) >> 22) & 0x3)
311 #define HTC_NDP_ANN(htc)       (((htc) >> 24) & 0x1)
312 #define HTC_AC_CONSTRAINT(htc) (((htc) >> 30) & 0x1)
313 #define HTC_RDG_MORE_PPDU(htc) (((htc) >> 31) & 0x1)
314
315 #define HTC_MFB(htc)           (((htc) >> 9) & 0x7FFF)
316
317 /* VHT-MCS = 15, NUM_STS = 7 */
318 #define HTC_NO_FEEDBACK_PRESENT(mfb) (((mfb) & 0x7F) == 0x7F)
319
320 /*
321  * Extract subfields from the key octet in WEP-encrypted frames.
322  */
323 #define KEY_OCTET_WEP_KEY(x)   (((x) & 0xC0) >> 6)
324
325 #define KEY_EXTIV    0x20
326 #define EXTIV_LEN    8
327
328 /*
329  * Bits from the Mesh Flags field
330  */
331 #define MESH_FLAGS_ADDRESS_EXTENSION  0x3
332
333 /* ************************************************************************* */
334 /*              Constants used to identify cooked frame types                */
335 /* ************************************************************************* */
336 #define MGT_FRAME            0x00  /* Frame type is management */
337 #define CONTROL_FRAME        0x01  /* Frame type is control */
338 #define DATA_FRAME           0x02  /* Frame type is Data */
339 #define EXTENSION_FRAME      0x03  /* Frame type is Extension */
340
341 #define DATA_SHORT_HDR_LEN     24
342 #define DATA_LONG_HDR_LEN      30
343 #define MGT_FRAME_HDR_LEN      24  /* Length of Management frame-headers */
344
345 /* ************************************************************************* */
346 /*        Logical field codes (IEEE 802.11 encoding of tags)                 */
347 /* ************************************************************************* */
348 #define TAG_SSID                       0
349 #define TAG_SUPP_RATES                 1
350 #define TAG_FH_PARAMETER               2
351 #define TAG_DS_PARAMETER               3
352 #define TAG_CF_PARAMETER               4
353 #define TAG_TIM                        5
354 #define TAG_IBSS_PARAMETER             6
355 #define TAG_COUNTRY_INFO               7
356 #define TAG_FH_HOPPING_PARAMETER       8
357 #define TAG_FH_HOPPING_TABLE           9
358 #define TAG_REQUEST                   10
359 #define TAG_QBSS_LOAD                 11
360 #define TAG_EDCA_PARAM_SET            12
361 #define TAG_TSPEC                     13
362 #define TAG_TCLAS                     14
363 #define TAG_SCHEDULE                  15
364 #define TAG_CHALLENGE_TEXT            16
365
366 #define TAG_POWER_CONSTRAINT          32
367 #define TAG_POWER_CAPABILITY          33
368 #define TAG_TPC_REQUEST               34
369 #define TAG_TPC_REPORT                35
370 #define TAG_SUPPORTED_CHANNELS        36
371 #define TAG_CHANNEL_SWITCH_ANN        37
372 #define TAG_MEASURE_REQ               38
373 #define TAG_MEASURE_REP               39
374 #define TAG_QUIET                     40
375 #define TAG_IBSS_DFS                  41
376 #define TAG_ERP_INFO                  42
377 #define TAG_TS_DELAY                  43
378 #define TAG_TCLAS_PROCESS             44
379 #define TAG_HT_CAPABILITY             45 /* IEEE Stc 802.11n/D2.0 */
380 #define TAG_QOS_CAPABILITY            46
381 #define TAG_ERP_INFO_OLD              47 /* IEEE Std 802.11g/D4.0 */
382 #define TAG_RSN_IE                    48
383 /* Reserved 49 */
384 #define TAG_EXT_SUPP_RATES            50
385 #define TAG_AP_CHANNEL_REPORT         51
386 #define TAG_NEIGHBOR_REPORT           52
387 #define TAG_RCPI                      53
388 #define TAG_MOBILITY_DOMAIN           54  /* IEEE Std 802.11r-2008 */
389 #define TAG_FAST_BSS_TRANSITION       55  /* IEEE Std 802.11r-2008 */
390 #define TAG_TIMEOUT_INTERVAL          56  /* IEEE Std 802.11r-2008 */
391 #define TAG_RIC_DATA                  57  /* IEEE Std 802.11r-2008 */
392 #define TAG_DSE_REG_LOCATION          58
393 #define TAG_SUPPORTED_OPERATING_CLASSES             59 /* IEEE Std 802.11w-2009 */
394 #define TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT    60 /* IEEE Std 802.11w-2009 */
395 #define TAG_HT_INFO                   61  /* IEEE Stc 802.11n/D2.0 */
396 #define TAG_SECONDARY_CHANNEL_OFFSET  62  /* IEEE Stc 802.11n/D1.10/D2.0 */
397 #define TAG_BSS_AVG_ACCESS_DELAY      63
398 #define TAG_ANTENNA                   64
399 #define TAG_RSNI                      65
400 #define TAG_MEASURE_PILOT_TRANS       66
401 #define TAG_BSS_AVB_ADM_CAPACITY      67
402 #define TAG_IE_68_CONFLICT            68  /* Conflict: WAPI Vs. IEEE */
403 #define TAG_WAPI_PARAM_SET            68
404 #define TAG_BSS_AC_ACCESS_DELAY       68
405 #define TAG_TIME_ADV                  69  /* IEEE Std 802.11p-2010 */
406 #define TAG_RM_ENABLED_CAPABILITY     70
407 #define TAG_MULTIPLE_BSSID            71
408 #define TAG_20_40_BSS_CO_EX           72  /* IEEE P802.11n/D6.0 */
409 #define TAG_20_40_BSS_INTOL_CH_REP    73  /* IEEE P802.11n/D6.0 */
410 #define TAG_OVERLAP_BSS_SCAN_PAR      74  /* IEEE P802.11n/D6.0 */
411 #define TAG_RIC_DESCRIPTOR            75  /* IEEE Std 802.11r-2008 */
412 #define TAG_MMIE                      76  /* IEEE Std 802.11w-2009 */
413 #define TAG_EVENT_REQUEST             78
414 #define TAG_EVENT_REPORT              79
415 #define TAG_DIAGNOSTIC_REQUEST        80
416 #define TAG_DIAGNOSTIC_REPORT         81
417 #define TAG_LOCATION_PARAMETERS       82
418 #define TAG_NO_BSSID_CAPABILITY       83
419 #define TAG_SSID_LIST                 84
420 #define TAG_MULTIPLE_BSSID_INDEX      85
421 #define TAG_FMS_DESCRIPTOR            86
422 #define TAG_FMS_REQUEST               87
423 #define TAG_FMS_RESPONSE              88
424 #define TAG_QOS_TRAFFIC_CAPABILITY    89
425 #define TAG_BSS_MAX_IDLE_PERIOD       90
426 #define TAG_TFS_REQUEST               91
427 #define TAG_TFS_RESPONSE              92
428 #define TAG_WNM_SLEEP_MODE            93
429 #define TAG_TIM_BROADCAST_REQUEST     94
430 #define TAG_TIM_BROADCAST_RESPONSE    95
431 #define TAG_COLLOCATED_INTER_REPORT   96
432 #define TAG_CHANNEL_USAGE             97
433 #define TAG_TIME_ZONE                 98  /* IEEE Std 802.11v-2011 */
434 #define TAG_DMS_REQUEST               99
435 #define TAG_DMS_RESPONSE             100
436 #define TAG_LINK_IDENTIFIER          101  /* IEEE Std 802.11z-2010 */
437 #define TAG_WAKEUP_SCHEDULE          102  /* IEEE Std 802.11z-2010 */
438 #define TAG_CHANNEL_SWITCH_TIMING    104  /* IEEE Std 802.11z-2010 */
439 #define TAG_PTI_CONTROL              105  /* IEEE Std 802.11z-2010 */
440 #define TAG_PU_BUFFER_STATUS         106  /* IEEE Std 802.11z-2010 */
441 #define TAG_INTERWORKING             107  /* IEEE Std 802.11u-2011 */
442 #define TAG_ADVERTISEMENT_PROTOCOL   108  /* IEEE Std 802.11u-2011 */
443 #define TAG_EXPIDITED_BANDWIDTH_REQ  109  /* IEEE Std 802.11u-2011 */
444 #define TAG_QOS_MAP_SET              110  /* IEEE Std 802.11u-2011 */
445 #define TAG_ROAMING_CONSORTIUM       111  /* IEEE Std 802.11u-2011 */
446 #define TAG_EMERGENCY_ALERT_ID       112  /* IEEE Std 802.11u-2011 */
447 #define TAG_MESH_CONFIGURATION       113  /* IEEE Std 802.11s-2011 */
448 #define TAG_MESH_ID                  114  /* IEEE Std 802.11s-2011 */
449 #define TAG_MESH_LINK_METRIC_REPORT  115
450 #define TAG_CONGESTION_NOTIFICATION  116
451 #define TAG_MESH_PEERING_MGMT        117  /* IEEE Std 802.11s-2011 */
452 #define TAG_MESH_CHANNEL_SWITCH      118
453 #define TAG_MESH_AWAKE_WINDOW        119
454 #define TAG_BEACON_TIMING            120
455 #define TAG_MCCAOP_SETUP_REQUEST     121
456 #define TAG_MCCAOP_SETUP_REPLY       122
457 #define TAG_MCCAOP_ADVERTISEMENT     123
458 #define TAG_MCCAOP_TEARDOWN          124
459 #define TAG_GANN                     125
460 #define TAG_RANN                     126  /* IEEE Std 802.11s-2011 */
461 #define TAG_EXTENDED_CAPABILITIES    127  /* IEEE Stc 802.11n/D1.10/D2.0 */
462 #define TAG_AGERE_PROPRIETARY        128
463 #define TAG_MESH_PREQ                130  /* IEEE Std 802.11s-2011 */
464 #define TAG_MESH_PREP                131  /* IEEE Std 802.11s-2011 */
465 #define TAG_MESH_PERR                132  /* IEEE Std 802.11s-2011 */
466 #define TAG_CISCO_CCX1_CKIP          133  /* Cisco Compatible eXtensions v1 */
467 #define TAG_CISCO_CCX2               136  /* Cisco Compatible eXtensions v2 */
468 #define TAG_PXU                      137
469 #define TAG_PXUC                     138
470 #define TAG_AUTH_MESH_PEERING_EXCH   139
471 #define TAG_MIC                      140
472 #define TAG_DESTINATION_URI          141
473 #define TAG_U_APSD_COEX              142
474 #define TAG_WAKEUP_SCHEDULE_AD       143  /* IEEE Std 802.11ad */
475 #define TAG_EXTENDED_SCHEDULE        144  /* IEEE Std 802.11ad */
476 #define TAG_STA_AVAILABILITY         145  /* IEEE Std 802.11ad */
477 #define TAG_DMG_TSPEC                146  /* IEEE Std 802.11ad */
478 #define TAG_NEXT_DMG_ATI             147  /* IEEE Std 802.11ad */
479 #define TAG_DMG_CAPABILITIES         148  /* IEEE Std 802.11ad */
480 #define TAG_CISCO_CCX3               149  /* Cisco Compatible eXtensions v3 */
481 #define TAG_CISCO_VENDOR_SPECIFIC    150  /* Cisco Compatible eXtensions */
482 #define TAG_DMG_OPERATION            151  /* IEEE Std 802.11ad */
483 #define TAG_DMG_BSS_PRAMTER_CHANGE   152  /* IEEE Std 802.11ad */
484 #define TAG_DMG_BEAM_REFINEMENT      153  /* IEEE Std 802.11ad */
485 #define TAG_CHANNEL_MEASURMENT_FB    154  /* IEEE Std 802.11ad */
486 #define TAG_AWAKE_WINDOW             157  /* IEEE Std 802.11ad */
487 #define TAG_MULTI_BAND               158  /* IEEE Std 802.11ad */
488 #define TAG_ADDBA_EXT                159  /* IEEE Std 802.11ad */
489 #define TAG_NEXTPCP_LIST             160  /* IEEE Std 802.11ad */
490 #define TAG_PCP_HANDOVER             161  /* IEEE Std 802.11ad */
491 #define TAG_DMG_LINK_MARGIN          162  /* IEEE Std 802.11ad */
492 #define TAG_SWITCHING_STREAM         163  /* IEEE Std 802.11ad */
493 #define TAG_SESSION_TRANSMISSION     164  /* IEEE Std 802.11ad */
494 #define TAG_DYN_TONE_PAIR_REP        165  /* IEEE Std 802.11ad */
495 #define TAG_CLUSTER_REP              166  /* IEEE Std 802.11ad */
496 #define TAG_RELAY_CAPABILITIES       167  /* IEEE Std 802.11ad */
497 #define TAG_RELAY_TRANSFER_PARAM     168  /* IEEE Std 802.11ad */
498 #define TAG_BEAMLINK_MAINTAINCE      169  /* IEEE Std 802.11ad */
499 #define TAG_MULTIPLE_MAC_SUBLAYERS   170  /* IEEE Std 802.11ad */
500 #define TAG_U_PID                    171  /* IEEE Std 802.11ad */
501 #define TAG_DMG_LINK_ADAPTION_ACK    172  /* IEEE Std 802.11ad */
502 #define TAG_SYMBOL_PROPRIETARY       173
503 #define TAG_MCCAOP_ADVERTISEMENT_OV  174
504 #define TAG_QUIET_PERIOD_REQ         175  /* IEEE Std 802.11ad */
505 #define TAG_QUIET_PERIOD_RES         177  /* IEEE Std 802.11ad */
506 #define TAG_ECPAC_POLICY             182  /* IEEE Std 802.11ad */
507 #define TAG_CLUSTER_TIME_OFFSET      183  /* IEEE Std 802.11ad */
508 #define TAG_ANTENNA_SECTOR_ID        190  /* IEEE Std 802.11ad */
509 #define TAG_VHT_CAPABILITY           191  /* IEEE Std 802.11ac/D3.1 */
510 #define TAG_VHT_OPERATION            192  /* IEEE Std 802.11ac/D3.1 */
511 #define TAG_EXT_BSS_LOAD             193  /* IEEE Std 802.11ac */
512 #define TAG_WIDE_BW_CHANNEL_SWITCH   194  /* IEEE Std 802.11ac */
513 #define TAG_VHT_TX_PWR_ENVELOPE      195  /* IEEE Std 802.11ac/D5.0 */
514 #define TAG_CHANNEL_SWITCH_WRAPPER   196  /* IEEE Std 802.11ac */
515 #define TAG_OPERATING_MODE_NOTIFICATION 199  /* IEEE Std 802.11ac */
516 #define TAG_VENDOR_SPECIFIC_IE       221
517
518 static const value_string tag_num_vals[] = {
519   { TAG_SSID,                                 "SSID parameter set" },
520   { TAG_SUPP_RATES,                           "Supported Rates" },
521   { TAG_FH_PARAMETER,                         "FH Parameter set" },
522   { TAG_DS_PARAMETER,                         "DS Parameter set" },
523   { TAG_CF_PARAMETER,                         "CF Parameter set" },
524   { TAG_TIM,                                  "Traffic Indication Map (TIM)" },
525   { TAG_IBSS_PARAMETER,                       "IBSS Parameter set" },
526   { TAG_COUNTRY_INFO,                         "Country Information" },
527   { TAG_FH_HOPPING_PARAMETER,                 "Hopping Pattern Parameters" },
528   { TAG_FH_HOPPING_TABLE,                     "Hopping Pattern Table" },
529   { TAG_REQUEST,                              "Request" },
530   { TAG_QBSS_LOAD,                            "QBSS Load Element" },
531   { TAG_EDCA_PARAM_SET,                       "EDCA Parameter Set" },
532   { TAG_TSPEC,                                "Traffic Specification" },
533   { TAG_TCLAS,                                "Traffic Classification" },
534   { TAG_SCHEDULE,                             "Schedule" },
535   { TAG_CHALLENGE_TEXT,                       "Challenge text" },
536   { TAG_POWER_CONSTRAINT,                     "Power Constraint" },
537   { TAG_POWER_CAPABILITY,                     "Power Capability" },
538   { TAG_TPC_REQUEST,                          "TPC Request" },
539   { TAG_TPC_REPORT,                           "TPC Report" },
540   { TAG_SUPPORTED_CHANNELS,                   "Supported Channels" },
541   { TAG_CHANNEL_SWITCH_ANN,                   "Channel Switch Announcement" },
542   { TAG_MEASURE_REQ,                          "Measurement Request" },
543   { TAG_MEASURE_REP,                          "Measurement Report" },
544   { TAG_QUIET,                                "Quiet" },
545   { TAG_IBSS_DFS,                             "IBSS DFS" },
546   { TAG_ERP_INFO,                             "ERP Information" },
547   { TAG_TS_DELAY,                             "TS Delay" },
548   { TAG_TCLAS_PROCESS,                        "TCLAS Processing" },
549   { TAG_HT_CAPABILITY,                        "HT Capabilities (802.11n D1.10)" },
550   { TAG_QOS_CAPABILITY,                       "QoS Capability" },
551   { TAG_ERP_INFO_OLD,                         "ERP Information" }, /* Reserved... */
552   { TAG_RSN_IE,                               "RSN Information" },
553   { TAG_EXT_SUPP_RATES,                       "Extended Supported Rates" },
554   { TAG_AP_CHANNEL_REPORT,                    "AP Channel Report" },
555   { TAG_NEIGHBOR_REPORT,                      "Neighbor Report" },
556   { TAG_RCPI,                                 "RCPI" },
557   { TAG_MOBILITY_DOMAIN,                      "Mobility Domain" },
558   { TAG_FAST_BSS_TRANSITION,                  "Fast BSS Transition" },
559   { TAG_TIMEOUT_INTERVAL,                     "Timeout Interval" },
560   { TAG_RIC_DATA,                             "RIC Data" },
561   { TAG_DSE_REG_LOCATION,                     "DSE Registered Location" },
562   { TAG_SUPPORTED_OPERATING_CLASSES,          "Supported Operating Classes" },
563   { TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement" },
564   { TAG_HT_INFO,                              "HT Information (802.11n D1.10)" },
565   { TAG_SECONDARY_CHANNEL_OFFSET,             "Secondary Channel Offset (802.11n D1.10)" },
566   { TAG_BSS_AVG_ACCESS_DELAY,                 "BSS Average Access Delay" },
567   { TAG_ANTENNA,                              "Antenna" },
568   { TAG_RSNI,                                 "RSNI" },
569   { TAG_MEASURE_PILOT_TRANS,                  "Measurement Pilot Transmission" },
570   { TAG_BSS_AVB_ADM_CAPACITY,                 "BSS Available Admission Capacity" },
571   { TAG_IE_68_CONFLICT,                       "BSS AC Access Delay/WAPI Parameter Set" },
572   { TAG_TIME_ADV,                             "Time Advertisement" },
573   { TAG_RM_ENABLED_CAPABILITY,                "RM Enabled Capabilities" },
574   { TAG_MULTIPLE_BSSID,                       "Multiple BSSID" },
575   { TAG_20_40_BSS_CO_EX,                      "20/40 BSS Coexistence" },
576   { TAG_20_40_BSS_INTOL_CH_REP,               "20/40 BSS Intolerant Channel Report" },   /* IEEE P802.11n/D6.0 */
577   { TAG_OVERLAP_BSS_SCAN_PAR,                 "Overlapping BSS Scan Parameters" },       /* IEEE P802.11n/D6.0 */
578   { TAG_RIC_DESCRIPTOR,                       "RIC Descriptor" },
579   { TAG_MMIE,                                 "Management MIC" },
580   { TAG_EVENT_REQUEST,                        "Event Request" },
581   { TAG_EVENT_REPORT,                         "Event Report" },
582   { TAG_DIAGNOSTIC_REQUEST,                   "Diagnostic Request" },
583   { TAG_DIAGNOSTIC_REPORT,                    "Diagnostic Report" },
584   { TAG_LOCATION_PARAMETERS,                  "Location Parameters" },
585   { TAG_NO_BSSID_CAPABILITY,                  "Non Transmitted BSSID Capability" },
586   { TAG_SSID_LIST,                            "SSID List" },
587   { TAG_MULTIPLE_BSSID_INDEX,                 "Multiple BSSID Index" },
588   { TAG_FMS_DESCRIPTOR,                       "FMS Descriptor" },
589   { TAG_FMS_REQUEST,                          "FMS Request" },
590   { TAG_FMS_RESPONSE,                         "FMS Response" },
591   { TAG_QOS_TRAFFIC_CAPABILITY,               "QoS Traffic Capability" },
592   { TAG_BSS_MAX_IDLE_PERIOD,                  "BSS Max Idle Period" },
593   { TAG_TFS_REQUEST,                          "TFS Request" },
594   { TAG_TFS_RESPONSE,                         "TFS Response" },
595   { TAG_WNM_SLEEP_MODE,                       "WNM-Sleep Mode" },
596   { TAG_TIM_BROADCAST_REQUEST,                "TIM Broadcast Request" },
597   { TAG_TIM_BROADCAST_RESPONSE,               "TIM Broadcast Response" },
598   { TAG_COLLOCATED_INTER_REPORT,              "Collocated Interference Report" },
599   { TAG_CHANNEL_USAGE,                        "Channel Usage" },
600   { TAG_TIME_ZONE,                            "Time Zone" },
601   { TAG_DMS_REQUEST,                          "DMS Request" },
602   { TAG_DMS_RESPONSE,                         "DMS Response" },
603   { TAG_LINK_IDENTIFIER,                      "Link Identifier" },
604   { TAG_WAKEUP_SCHEDULE,                      "Wakeup Schedule" },
605   { TAG_CHANNEL_SWITCH_TIMING,                "Channel Switch Timing" },
606   { TAG_PTI_CONTROL,                          "PTI Control" },
607   { TAG_PU_BUFFER_STATUS,                     "PU Buffer Status" },
608   { TAG_INTERWORKING,                         "Interworking" },
609   { TAG_ADVERTISEMENT_PROTOCOL,               "Advertisement Protocol"},
610   { TAG_EXPIDITED_BANDWIDTH_REQ,              "Expedited Bandwidth Request" },
611   { TAG_QOS_MAP_SET,                          "QoS Map Set" },
612   { TAG_ROAMING_CONSORTIUM,                   "Roaming Consortium" },
613   { TAG_EMERGENCY_ALERT_ID,                   "Emergency Alert Identifier" },
614   { TAG_MESH_CONFIGURATION,                   "Mesh Configuration" },
615   { TAG_MESH_ID,                              "Mesh ID" },
616   { TAG_MESH_LINK_METRIC_REPORT,              "Mesh Link Metric Report" },
617   { TAG_CONGESTION_NOTIFICATION,              "Congestion Notification" },
618   { TAG_MESH_PEERING_MGMT,                    "Mesh Peering Management" },
619   { TAG_MESH_CHANNEL_SWITCH,                  "Mesh Channel Switch Parameters" },
620   { TAG_MESH_AWAKE_WINDOW,                    "Mesh Awake Windows" },
621   { TAG_BEACON_TIMING,                        "Beacon Timing" },
622   { TAG_MCCAOP_SETUP_REQUEST,                 "MCCAOP Setup Request" },
623   { TAG_MCCAOP_SETUP_REPLY,                   "MCCAOP SETUP Reply" },
624   { TAG_MCCAOP_ADVERTISEMENT,                 "MCCAOP Advertisement" },
625   { TAG_MCCAOP_TEARDOWN,                      "MCCAOP Teardown" },
626   { TAG_GANN,                                 "Gate Announcement" },
627   { TAG_RANN,                                 "Root Announcement" },
628   { TAG_EXTENDED_CAPABILITIES,                "Extended Capabilities" },
629   { TAG_AGERE_PROPRIETARY,                    "Agere Proprietary" },
630   { TAG_MESH_PREQ,                            "Path Request" },
631   { TAG_MESH_PREP,                            "Path Reply" },
632   { TAG_MESH_PERR,                            "Path Error" },
633   { TAG_CISCO_CCX1_CKIP,                      "Cisco CCX1 CKIP + Device Name" },
634   { TAG_CISCO_CCX2,                           "Cisco CCX2" },
635   { TAG_PXU,                                  "Proxy Update" },
636   { TAG_PXUC,                                 "Proxy Update Confirmation"},
637   { TAG_AUTH_MESH_PEERING_EXCH,               "Auhenticated Mesh Perring Exchange" },
638   { TAG_MIC,                                  "MIC (Message Integrity Code)" },
639   { TAG_DESTINATION_URI,                      "Destination URI" },
640   { TAG_U_APSD_COEX,                          "U-APSD Coexistence" },
641   { TAG_WAKEUP_SCHEDULE_AD,                   "Wakeup Schedule 802.11ad" },
642   { TAG_EXTENDED_SCHEDULE,                    "Extended Schedule" },
643   { TAG_STA_AVAILABILITY,                     "STA Availability" },
644   { TAG_DMG_TSPEC,                            "DMG TSPEC" },
645   { TAG_NEXT_DMG_ATI,                         "Next DMG ATI" },
646   { TAG_DMG_CAPABILITIES,                     "DMG Capabilities" },
647   { TAG_CISCO_CCX3,                           "Cisco Unknown 95" },
648   { TAG_CISCO_VENDOR_SPECIFIC,                "Vendor Specific" },
649   { TAG_DMG_OPERATION,                        "DMG Operating" },
650   { TAG_DMG_BSS_PRAMTER_CHANGE,               "DMG BSS Parameter Change" },
651   { TAG_DMG_BEAM_REFINEMENT,                  "DMG Beam Refinement" },
652   { TAG_CHANNEL_MEASURMENT_FB,                "Channel Measurement Feedback" },
653   { TAG_AWAKE_WINDOW,                         "Awake Window" },
654   { TAG_MULTI_BAND,                           "Multi Band" },
655   { TAG_ADDBA_EXT,                            "ADDBA Extension" },
656   { TAG_NEXTPCP_LIST,                         "NEXTPCP List" },
657   { TAG_PCP_HANDOVER,                         "PCP Handover" },
658   { TAG_DMG_LINK_MARGIN,                      "DMG Link Margin" },
659   { TAG_SWITCHING_STREAM,                     "Switching Stream" },
660   { TAG_SESSION_TRANSMISSION,                 "Session Transmission" },
661   { TAG_DYN_TONE_PAIR_REP,                    "Dynamic Tone Pairing Report" },
662   { TAG_CLUSTER_REP,                          "Cluster Report" },
663   { TAG_RELAY_CAPABILITIES,                   "Relay Capabilities" },
664   { TAG_RELAY_TRANSFER_PARAM,                 "Relay Transfer Parameter" },
665   { TAG_BEAMLINK_MAINTAINCE,                  "Beamlink Maintenance" },
666   { TAG_MULTIPLE_MAC_SUBLAYERS,               "Multiple MAC Sublayers" },
667   { TAG_U_PID,                                "U-PID" },
668   { TAG_DMG_LINK_ADAPTION_ACK,                "DMG Link Adaption Acknowledgment" },
669   { TAG_SYMBOL_PROPRIETARY,                   "Symbol Proprietary" },
670   { TAG_MCCAOP_ADVERTISEMENT_OV,              "MCCAOP Advertisement Overview" },
671   { TAG_QUIET_PERIOD_REQ,                     "Quiet Period Request" },
672   { TAG_QUIET_PERIOD_RES,                     "Quiet Period Response" },
673   { TAG_ECPAC_POLICY,                         "ECPAC Policy" },
674   { TAG_CLUSTER_TIME_OFFSET,                  "Cluster Time Offset" },
675   { TAG_ANTENNA_SECTOR_ID,                    "Antenna Sector ID" },
676   { TAG_VHT_CAPABILITY,                       "VHT Capabilities (IEEE Std 802.11ac/D3.1)" },
677   { TAG_VHT_OPERATION,                        "VHT Operation (IEEE Std 802.11ac/D3.1)" },
678   { TAG_EXT_BSS_LOAD,                         "Extended BSS Load" },
679   { TAG_WIDE_BW_CHANNEL_SWITCH,               "Wide Bandwidth Channel Switch" },
680   { TAG_VHT_TX_PWR_ENVELOPE,                  "VHT Tx Power Envelope (IEEE Std 802.11ac/D5.0)" },
681   { TAG_CHANNEL_SWITCH_WRAPPER,               "Channel Switch Wrapper" },
682   { TAG_OPERATING_MODE_NOTIFICATION,          "Operating Mode Notification" },
683   { TAG_VENDOR_SPECIFIC_IE,                   "Vendor Specific" },
684   { 0, NULL }
685 };
686 static value_string_ext tag_num_vals_ext = VALUE_STRING_EXT_INIT(tag_num_vals);
687
688 /* WFA vendor specific subtypes */
689 #define WFA_SUBTYPE_P2P 9
690 #define WFA_SUBTYPE_WIFI_DISPLAY 10
691 #define WFA_SUBTYPE_HS20_INDICATION 16
692 #define WFA_SUBTYPE_HS20_ANQP 17
693
694 static const value_string wfa_subtype_vals[] = {
695   { WFA_SUBTYPE_P2P, "P2P" },
696   { WFA_SUBTYPE_HS20_INDICATION, "Hotspot 2.0 Indication" },
697   { WFA_SUBTYPE_HS20_ANQP, "Hotspot 2.0 ANQP" },
698   { 0, NULL }
699 };
700
701 /* ************************************************************************* */
702 /*              Supported Rates (7.3.2.2)                                    */
703 /* ************************************************************************* */
704
705 static const value_string ieee80211_supported_rates_vals[] = {
706   { 0x02, "1" },
707   { 0x03, "1.5" },
708   { 0x04, "2" },
709   { 0x05, "2.5" },
710   { 0x06, "3" },
711   { 0x09, "4.5" },
712   { 0x0B, "5.5" },
713   { 0x0C, "6" },
714   { 0x12, "9" },
715   { 0x16, "11" },
716   { 0x18, "12" },
717   { 0x1B, "13.5" },
718   { 0x24, "18" },
719   { 0x2C, "22" },
720   { 0x30, "24" },
721   { 0x36, "27" },
722   { 0x42, "33" },
723   { 0x48, "36" },
724   { 0x60, "48" },
725   { 0x6C, "54" },
726   { 0x82, "1(B)" },
727   { 0x83, "1.5(B)" },
728   { 0x84, "2(B)" },
729   { 0x85, "2.5(B)" },
730   { 0x86, "3(B)" },
731   { 0x89, "4.5(B)" },
732   { 0x8B, "5.5(B)" },
733   { 0x8C, "6(B)" },
734   { 0x92, "9(B)" },
735   { 0x96, "11(B)" },
736   { 0x98, "12(B)" },
737   { 0x9B, "13.5(B)" },
738   { 0xA4, "18(B)" },
739   { 0xAC, "22(B)" },
740   { 0xB0, "24(B)" },
741   { 0xB6, "27(B)" },
742   { 0xC2, "33(B)" },
743   { 0xC8, "36(B)" },
744   { 0xE0, "48(B)" },
745   { 0xEC, "54(B)" },
746   { 0xFF, "BSS requires support for mandatory features of HT PHY (IEEE 802.11 - Clause 20)" },
747   { 0,    NULL}
748 };
749 value_string_ext ieee80211_supported_rates_vals_ext = VALUE_STRING_EXT_INIT(ieee80211_supported_rates_vals);
750
751 /* ************************************************************************* */
752 /*                         8.4.1.7 Reason Code field                         */
753 /* ************************************************************************* */
754 static const value_string ieee80211_reason_code[] = {
755   {  1, "Unspecified reason" },
756   {  2, "Previous authentication no longer valid" },
757   {  3, "Deauthenticated because sending STA is leaving (or has left) IBSS or ESS" },
758   {  4, "Disassociated due to inactivity" },
759   {  5, "Disassociated because AP is unable to handle all currently associated STAs" },
760   {  6, "Class 2 frame received from nonauthenticated STA" },
761   {  7, "Class 3 frame received from nonassociated STA" },
762   {  8, "Disassociated because sending STA is leaving (or has left) BSS" },
763   {  9, "STA requesting (re)association is not authenticated with responding STA" },
764   { 10, "Disassociated because the information in the Power Capability element is unacceptable" },
765   { 11, "Disassociated because the information in the Supported Channels element is unacceptable" },
766   { 12, "Reserved" },
767   { 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" },
768   { 14, "Message integrity code (MIC) failure" },
769   { 15, "4-Way Handshake timeout" },
770   { 16, "Group Key Handshake timeout" },
771   { 17, "Information element in 4-Way Handshake different from (Re)Association Request/Probe Response/Beacon frame" },
772   { 18, "Invalid group cipher" },
773   { 19, "Invalid pairwise cipher" },
774   { 20, "Invalid AKMP" },
775   { 21, "Unsupported RSN information element version" },
776   { 22, "Invalid RSN information element capabilities" },
777   { 23, "IEEE 802.1X authentication failed" },
778   { 24, "Cipher suite rejected because of the security policy" },
779   { 25, "TDLS direct-link teardown due to TDLS peer STA unreachable via the TDLS direct link" },
780   { 26, "TDLS direct-link teardown for unspecified reason" },
781   { 27, "Disassociated because session terminated by SSP request" },
782   { 28, "Disassociated because of lack of SSP roaming agreement" },
783   { 29, "Requested service rejected because of SSP cipher suite or AKM requirement " },
784   { 30, "Requested service not authorized in this location" },
785   { 31, "TS deleted because QoS AP lacks sufficient bandwidth for this QoS STA due to a change in BSS service characteristics or operational mode" },
786   { 32, "Disassociated for unspecified, QoS-related reason" },
787   { 33, "Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA" },
788   { 34, "Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions" },
789   { 35, "Disassociated because STA is transmitting outside the limits of its TXOPs" },
790   { 36, "Requested from peer STA as the STA is leaving the BSS (or resetting)" },
791   { 37, "Requested from peer STA as it does not want to use the mechanism" },
792   { 38, "Requested from peer STA as the STA received frames using the mechanism for which a setup is required" },
793   { 39, "Requested from peer STA due to timeout" },
794   { 45, "Peer STA does not support the requested cipher suite" },
795   { 46, "Disassociated because authorized access limit reached" },
796   { 47, "Disassociated due to external service requirements" },
797   { 48, "Invalid FT Action frame count" },
798   { 49, "Invalid pairwise master key identifier (PMKI)" },
799   { 50, "Invalid MDE" },
800   { 51, "Invalid FTE" },
801   { 52, "SME cancels the mesh peering instance with the reason other than reaching the maximum number of peer mesh STAs" },
802   { 53, "The mesh STA has reached the supported maximum number of peer mesh STAs" },
803   { 54, "The received information violates the Mesh Configuration policy configured in the mesh STA profile" },
804   { 55, "The mesh STA has received a Mesh Peering Close message requesting to close the mesh peering" },
805   { 56, "The mesh STA has re-sent dot11MeshMaxRetries Mesh Peering Open messages, without receiving a Mesh Peering Confirm message" },
806   { 57, "The confirmTimer for the mesh peering instance times out" },
807   { 58, "The mesh STA fails to unwrap the GTK or the values in the wrapped contents do not match" },
808   { 59, "The mesh STA receives inconsistent information about the mesh parameters between Mesh Peering Management frames" },
809   { 60, "The mesh STA fails the authenticated mesh peering exchange because due to failure in selecting either the pairwise ciphersuite or group ciphersuite" },
810   { 61, "The mesh STA does not have proxy information for this external destination" },
811   { 62, "The mesh STA does not have forwarding information for this destination" },
812   { 63, "The mesh STA determines that the link to the next hop of an active path in its forwarding information is no longer usable" },
813   { 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)" },
814   { 65, "The mesh STA performs channel switch to meet regulatory requirements" },
815   { 66, "The mesh STA performs channel switch with unspecified reason" },
816   { 0,    NULL}
817 };
818 static value_string_ext ieee80211_reason_code_ext = VALUE_STRING_EXT_INIT(ieee80211_reason_code);
819
820 /* ************************************************************************* */
821 /*                         8.4.1.9 Status Code field                         */
822 /* ************************************************************************* */
823 static const value_string ieee80211_status_code[] = {
824   {  0, "Successful" },
825   {  1, "Unspecified failure" },
826   {  2, "TDLS wakeup schedule rejected but alternative schedule provided" },
827   {  3, "TDLS wakeup schedule rejected" },
828   {  4, "Reserved" },
829   {  5, "Security disabled" },
830   {  6, "Unacceptable lifetime" },
831   {  7, "Not in same BSS" },
832   {  8, "Reserved" },
833   {  9, "Reserved" },
834   { 10, "Cannot support all requested capabilities in the Capability Information field" },
835   { 11, "Reassociation denied due to inability to confirm that association exists" },
836   { 12, "Association denied due to reason outside the scope of this standard" },
837   { 13, "Responding STA does not support the specified authentication algorithm" },
838   { 14, "Received an Authentication frame with authentication transaction sequence number out of expected sequence" },
839   { 15, "Authentication rejected because of challenge failure" },
840   { 16, "Authentication rejected due to timeout waiting for next frame in sequence" },
841   { 17, "Association denied because AP is unable to handle additional associated STAs" },
842   { 18, "Association denied due to requesting STA not supporting all of the data rates in the BSSBasicRateSet parameter" },
843   { 19, "Association denied due to requesting STA not supporting the short preamble option" },
844   { 20, "Association denied due to requesting STA not supporting the PBCC modulation option" },
845   { 21, "Association denied due to requesting STA not supporting the Channel Agility option" },
846   { 22, "Association request rejected because Spectrum Management capability is required" },
847   { 23, "Association request rejected because the information in the Power Capability element is unacceptable" },
848   { 24, "Association request rejected because the information in the Supported Channels element is unacceptable" },
849   { 25, "Association denied due to requesting STA not supporting the Short Slot Time option" },
850   { 26, "Association denied due to requesting STA not supporting the DSSS-OFDM option" },
851   { 27, "Reserved Association denied because the requesting STA does not support HT features" },
852   { 28, "R0KH unreachable" },
853   { 29, "Association denied because the requesting STA does not support the phased coexistence operation (PCO) transition time required by the AP" },
854   { 30, "Association request rejected temporarily; try again later" },
855   { 31, "Robust Management frame policy violation" },
856   { 32, "Unspecified, QoS-related failure" },
857   { 33, "Association denied because QoS AP or PCP has insufficient bandwidth to handle another QoS STA" },
858   { 34, "Association denied due to excessive frame loss rates and/or poor conditions on current operating channel" },
859   { 35, "Association (with QoS BSS) denied because the requesting STA does not support the QoS facility" },
860   { 36, "Reserved" },
861   { 37, "The request has been declined" },
862   { 38, "The request has not been successful as one or more parameters have invalid values" },
863   { 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" },
864   { 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" },
865   { 41, "Invalid group cipher" },
866   { 42, "Invalid pairwise cipher" },
867   { 43, "Invalid AKMP" },
868   { 44, "Unsupported RSN information element version" },
869   { 45, "Invalid RSN information element capabilities" },
870   { 46, "Cipher suite rejected because of security policy" },
871   { 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" },
872   { 48, "Direct link is not allowed in the BSS by policy" },
873   { 49, "The Destination STA is not present within this BSS" },
874   { 50, "The Destination STA is not a QoS STA" },
875   { 51, "Association denied because the ListenInterval is too large" },
876   { 52, "Invalid FT Action frame count" },
877   { 53, "Invalid pairwise master key identifier (PMKID)" },
878   { 54, "Invalid MDIE" },
879   { 55, "Invalid FTIE" },
880   { 56, "Requested TCLAS processing is not supported by the PCP/AP" },
881   { 57, "The PCP/AP has insufficient TCLAS processing resources to satisfy the request" },
882   { 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" },
883   { 59, "GAS Advertisement Protocol not supported" },
884   { 60, "No outstanding GAS request" },
885   { 61, "GAS Response not received from the Advertisement Server" },
886   { 62, "STA timed out waiting for GAS Query Response" },
887   { 63, "GAS Response is larger than query response length limit" },
888   { 64, "Request refused because home network does not support request" },
889   { 65, "Advertisement Server in the network is not currently reachable" },
890   { 66, "Reserved" },
891   { 67, "Request refused due to permissions received via SSPN interface" },
892   { 68, "Request refused because PCP/AP does not support unauthenticated access" },
893   { 69, "Reserved" },
894   { 70, "Reserved" },
895   { 71, "Reserved" },
896   { 72, "Invalid contents of RSNIE" },
897   { 73, "U-APSD Coexistence is not supported" },
898   { 74, "Requested U-APSD Coexistence mode is not supported" },
899   { 75, "Requested Interval/Duration value cannot be supported with U-APSD Coexistence" },
900   { 76, "Authentication is rejected because an Anti-Clogging Token is required" },
901   { 77, "Authentication is rejected because the offered finite cyclic group is not supported" },
902   { 78, "The TBTT adjustment request has not been successful because the STA could not find an alternative TBTT" },
903   { 79, "Transmission failure" },
904   { 80, "Requested TCLAS Not Supported" },
905   { 81, "TCLAS Resources Exhausted" },
906   { 82, "Rejected with Suggested BSS Transition" },
907   { 83, "Reject with recommended schedule" },
908   { 84, "Reject because no wakeup schedule specified" },
909   { 85, "Success, the destination STA is in power save mode" },
910   { 86, "FST pending, in process of admitting FST session" },
911   { 87, "performing FST now" },
912   { 88, "FST pending, gap(s) in Block Ack window" },
913   { 89, "Reject because of U-PID setting" },
914   { 92, "(Re)association refused for some external reason" },
915   { 93, "(Re)association refused because of memory limits at the AP" },
916   { 94, "(Re)association refused because emergency services are not supported at the AP" },
917   { 95, "GAS query response not yet received" },
918   { 96, "Reject since the request is for transition to a frequency band subject to DSE procedures and FST initiator is a dependent STA" },
919   { 97, "Reserved" },
920   { 98, "Reserved" },
921   { 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" },
922   { 100, "The request failed due to a reservation conflict" },
923   { 101, "The request failed due to exceeded MAF limit" },
924   { 102, "The request failed due to exceeded MCCA track limit" },
925   { 103, "Association denied because the information in the Spectrum Management field is unacceptable" },
926   { 0,    NULL}
927 };
928 static value_string_ext ieee80211_status_code_ext = VALUE_STRING_EXT_INIT(ieee80211_status_code);
929
930 /* ************************************************************************* */
931 /*                         Frame types, and their names                      */
932 /* ************************************************************************* */
933 static const value_string frame_type_subtype_vals[] = {
934   {MGT_ASSOC_REQ,             "Association Request"},
935   {MGT_ASSOC_RESP,            "Association Response"},
936   {MGT_REASSOC_REQ,           "Reassociation Request"},
937   {MGT_REASSOC_RESP,          "Reassociation Response"},
938   {MGT_PROBE_REQ,             "Probe Request"},
939   {MGT_PROBE_RESP,            "Probe Response"},
940   {MGT_MEASUREMENT_PILOT,     "Measurement Pilot"},
941   {MGT_BEACON,                "Beacon frame"},
942   {MGT_ATIM,                  "ATIM"},
943   {MGT_DISASS,                "Disassociate"},
944   {MGT_AUTHENTICATION,        "Authentication"},
945   {MGT_DEAUTHENTICATION,      "Deauthentication"},
946   {MGT_ACTION,                "Action"},
947   {MGT_ACTION_NO_ACK,         "Action No Ack"},
948   {MGT_ARUBA_WLAN,            "Aruba Management"},
949
950   {CTRL_BEAMFORM_RPT_POLL,    "Beamforming Report Poll"},
951   {CTRL_VHT_NDP_ANNC,         "VHT NDP Announcement"},
952   {CTRL_CONTROL_WRAPPER,      "Control Wrapper"},
953   {CTRL_BLOCK_ACK_REQ,        "802.11 Block Ack Req"},
954   {CTRL_BLOCK_ACK,            "802.11 Block Ack"},
955   {CTRL_PS_POLL,              "Power-Save poll"},
956   {CTRL_RTS,                  "Request-to-send"},
957   {CTRL_CTS,                  "Clear-to-send"},
958   {CTRL_ACKNOWLEDGEMENT,      "Acknowledgement"},
959   {CTRL_CFP_END,              "CF-End (Control-frame)"},
960   {CTRL_CFP_ENDACK,           "CF-End + CF-Ack (Control-frame)"},
961
962   {DATA,                      "Data"},
963   {DATA_CF_ACK,               "Data + CF-Ack"},
964   {DATA_CF_POLL,              "Data + CF-Poll"},
965   {DATA_CF_ACK_POLL,          "Data + CF-Ack + CF-Poll"},
966   {DATA_NULL_FUNCTION,        "Null function (No data)"},
967   {DATA_CF_ACK_NOD,           "Acknowledgement (No data)"},
968   {DATA_CF_POLL_NOD,          "CF-Poll (No data)"},
969   {DATA_CF_ACK_POLL_NOD,      "CF-Ack/Poll (No data)"},
970   {DATA_QOS_DATA,             "QoS Data"},
971   {DATA_QOS_DATA_CF_ACK,      "QoS Data + CF-Acknowledgment"},
972   {DATA_QOS_DATA_CF_POLL,     "QoS Data + CF-Poll"},
973   {DATA_QOS_DATA_CF_ACK_POLL, "QoS Data + CF-Ack + CF-Poll"},
974   {DATA_QOS_NULL,             "QoS Null function (No data)"},
975   {DATA_QOS_CF_POLL_NOD,      "QoS CF-Poll (No Data)"},
976   {DATA_QOS_CF_ACK_POLL_NOD,  "QoS CF-Ack + CF-Poll (No data)"},
977
978   {EXTENSION_DMG_BEACON,      "DMG Beacon"},
979
980   {CTRL_POLL,                 "Poll"},
981   {CTRL_SPR,                  "Service Period Request"},
982   {CTRL_GRANT,                "Grant"},
983   {CTRL_DMG_CTS,              "DMG Clear-to-send"},
984   {CTRL_DMG_DTS,              "DMG Denial-to-send"},
985   {CTRL_GRANT_ACK,            "Grant Acknowledgment"},
986   {CTRL_SSW,                  "Sector Sweep"},
987   {CTRL_SSW_FEEDBACK,         "Sector Sweep Feedback"},
988   {CTRL_SSW_ACK,              "Sector Sweep Acknowledgment"},
989
990   {0,                         NULL}
991 };
992 static value_string_ext frame_type_subtype_vals_ext = VALUE_STRING_EXT_INIT(frame_type_subtype_vals);
993
994 /* ************************************************************************* */
995 /*                 802.1D Tag Name (by WME Access Category Names)            */
996 /* ************************************************************************* */
997 static const value_string ieee80211_qos_tags_acs[] = {
998   { 0, "Best Effort (Best Effort)" },
999   { 1, "Background (Background)" },
1000   { 2, "Spare (Background)" },
1001   { 3, "Excellent Effort (Best Effort)" },
1002   { 4, "Controlled Load (Video)" },
1003   { 5, "Video (Video)" },
1004   { 6, "Voice (Voice)" },
1005   { 7, "Network Control (Voice)" },
1006   { 0, NULL }
1007 };
1008
1009 /* ************************************************************************* */
1010 /*                   WME Access Category Names (by WME ACI)                  */
1011 /* ************************************************************************* */
1012 static const value_string wme_acs[] = {
1013   { 0, "Best Effort" },
1014   { 1, "Background" },
1015   { 2, "Video" },
1016   { 3, "Voice" },
1017   { 0, NULL }
1018 };
1019
1020 /* ************************************************************************* */
1021 /*                  Aruba Management Type                                    */
1022 /* ************************************************************************* */
1023 static const value_string aruba_mgt_typevals[] = {
1024   { 0x0001,       "Hello" },
1025   { 0x0002,       "Probe" },
1026   { 0x0003,       "MTU" },
1027   { 0x0004,       "Ageout" },
1028   { 0x0005,       "Heartbeat" },
1029   { 0x0006,       "Deauth" },
1030   { 0x0007,       "Disassoc" },
1031   { 0x0008,       "Probe response" },
1032   { 0x0009,       "Tunnel update" },
1033   { 0x000A,       "Laser beam active" },
1034   { 0x000B,       "Client IP" },
1035   { 0x000C,       "Laser beam active v2" },
1036   { 0x000D,       "AP statistics" },
1037   { 0,            NULL }
1038 };
1039 static value_string_ext aruba_mgt_typevals_ext = VALUE_STRING_EXT_INIT(aruba_mgt_typevals);
1040
1041 /*** Begin: Action Fixed Parameter ***/
1042 #define CAT_SPECTRUM_MGMT          0
1043 #define CAT_QOS                    1
1044 #define CAT_DLS                    2
1045 #define CAT_BLOCK_ACK              3
1046 #define CAT_PUBLIC                 4
1047 #define CAT_RADIO_MEASUREMENT      5
1048 #define CAT_FAST_BSS_TRANSITION    6
1049 #define CAT_HT                     7
1050 #define CAT_SA_QUERY               8
1051 #define CAT_PUBLIC_PROTECTED       9
1052 #define CAT_WNM                   10
1053 #define CAT_UNPROTECTED_WNM       11
1054 #define CAT_TDLS                  12
1055 #define CAT_MESH                  13
1056 #define CAT_MULTIHOP              14
1057 #define CAT_SELF_PROTECTED        15
1058 #define CAT_DMG                   16
1059 #define CAT_MGMT_NOTIFICATION     17
1060 #define CAT_FAST_SESSION_TRANSFER 18
1061 #define CAT_ROBUST_AV_STREAMING   19
1062 #define CAT_UNPROTECTED_DMG       20
1063 #define CAT_VHT                   21
1064 #define CAT_VENDOR_SPECIFIC_PROTECTED 126
1065 #define CAT_VENDOR_SPECIFIC     127
1066
1067 #define CAT_MESH_LINK_METRIC               31
1068 #define CAT_MESH_PATH_SELECTION            32
1069 #define CAT_MESH_INTERWORKING              33
1070 #define CAT_MESH_RESOURCE_COORDINATION     34
1071 #define CAT_MESH_SECURITY_ARCHITECTURE     35
1072
1073 #define SM_ACTION_MEASUREMENT_REQUEST   0
1074 #define SM_ACTION_MEASUREMENT_REPORT    1
1075 #define SM_ACTION_TPC_REQUEST           2
1076 #define SM_ACTION_TPC_REPORT            3
1077 #define SM_ACTION_CHAN_SWITCH_ANNC      4
1078 #define SM_ACTION_EXT_CHAN_SWITCH_ANNC  5
1079
1080 #define QOS_ACTION_ADDTS_REQUEST     0
1081 #define QOS_ACTION_ADDTS_RESPONSE    1
1082 #define QOS_ACTION_DELTS             2
1083 #define QOS_ACTION_SCHEDULE      3
1084 #define QOS_ACTION_MAP_CONFIGURE 4
1085
1086 #define DLS_ACTION_REQUEST       0
1087 #define DLS_ACTION_RESPONSE      1
1088 #define DLS_ACTION_TEARDOWN      2
1089
1090 #define BA_ADD_BLOCK_ACK_REQUEST    0
1091 #define BA_ADD_BLOCK_ACK_RESPONSE   1
1092 #define BA_DELETE_BLOCK_ACK         2
1093
1094 /* Keep in sync with PPA_* defines */
1095 #define PA_20_40_BSS_COEXISTENCE_MANAGEMENT 0
1096 #define PA_DSE_ENABLEMENT                   1
1097 #define PA_DSE_DEENABLEMENT                 2
1098 #define PA_DSE_REG_LOC_ANNOUNCEMENT         3
1099 #define PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT  4
1100 #define PA_DSE_MEASUREMENT_REQUEST          5
1101 #define PA_DSE_MEASUREMENT_REPORT           6
1102 #define PA_MEASUREMENT_PILOT                7
1103 #define PA_DSE_POWER_CONSTRAINT             8
1104 #define PA_VENDOR_SPECIFIC                  9
1105 #define PA_GAS_INITIAL_REQUEST             10
1106 #define PA_GAS_INITIAL_RESPONSE            11
1107 #define PA_GAS_COMEBACK_REQUEST            12
1108 #define PA_GAS_COMEBACK_RESPONSE           13
1109 #define PA_TDLS_DISCOVERY_RESPONSE         14
1110 #define PA_LOCATION_TRACK_NOTIFICATION     15
1111 #define PA_QAB_REQUEST                     16
1112 #define PA_QAB_RESPONSE                    17
1113
1114 /* Keep in sync with PA_* defines */
1115 #define PPA_DSE_ENABLEMENT                   1
1116 #define PPA_DSE_DEENABLEMENT                 2
1117 #define PPA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT  4
1118 #define PPA_DSE_MEASUREMENT_REQUEST          5
1119 #define PPA_DSE_MEASUREMENT_REPORT           6
1120 #define PPA_DSE_POWER_CONSTRAINT             8
1121 #define PPA_VENDOR_SPECIFIC                  9
1122 #define PPA_GAS_INITIAL_REQUEST             10
1123 #define PPA_GAS_INITIAL_RESPONSE            11
1124 #define PPA_GAS_COMEBACK_REQUEST            12
1125 #define PPA_GAS_COMEBACK_RESPONSE           13
1126 #define PPA_QAB_REQUEST                     16
1127 #define PPA_QAB_RESPONSE                    17
1128
1129 #define HT_ACTION_NOTIFY_CHAN_WIDTH           0
1130 #define HT_ACTION_SM_PWR_SAVE                 1
1131 #define HT_ACTION_PSMP_ACTION                 2
1132 #define HT_ACTION_SET_PCO_PHASE               3
1133 #define HT_ACTION_MIMO_CSI                    4
1134 #define HT_ACTION_MIMO_BEAMFORMING            5
1135 #define HT_ACTION_MIMO_COMPRESSED_BEAMFORMING 6
1136 #define HT_ACTION_ANT_SEL_FEEDBACK            7
1137 #define HT_ACTION_HT_INFO_EXCHANGE            8
1138
1139 #define DMG_ACTION_PWR_SAVE_CONFIG_REQ           0
1140 #define DMG_ACTION_PWR_SAVE_CONFIG_RES           1
1141 #define DMG_ACTION_INFO_REQ                      2
1142 #define DMG_ACTION_INFO_RES                      3
1143 #define DMG_ACTION_HANDOVER_REQ                  4
1144 #define DMG_ACTION_HANDOVER_RES                  5
1145 #define DMG_ACTION_DTP_REQ                       6
1146 #define DMG_ACTION_DTP_RES                       7
1147 #define DMG_ACTION_RELAY_SEARCH_REQ              8
1148 #define DMG_ACTION_RELAY_SEARCH_RES              9
1149 #define DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ 10
1150 #define DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES 11
1151 #define DMG_ACTION_RLS_REQ                       12
1152 #define DMG_ACTION_RLS_RES                       13
1153 #define DMG_ACTION_RLS_ANNOUNCE                  14
1154 #define DMG_ACTION_RLS_TEARDOWN                  15
1155 #define DMG_ACTION_RELAY_ACK_REQ                 16
1156 #define DMG_ACTION_RELAY_ACK_RES                 17
1157 #define DMG_ACTION_TPA_REQ                       18
1158 #define DMG_ACTION_TPA_RES                       19
1159 #define DMG_ACTION_TPA_REP                       20
1160 #define DMG_ACTION_ROC_REQ                       21
1161 #define DMG_ACTION_ROC_RES                       22
1162
1163 #define UNPROTECTED_DMG_ANNOUNCE                 0
1164 #define UNPROTECTED_DMG_BRP                      1
1165
1166 #define FST_SETUP_REQUEST                        0
1167 #define FST_SETUP_RESPONSE                       1
1168 #define FST_TEAR_DOWN                            2
1169 #define FST_ACK_REQUEST                          3
1170 #define FST_ACK_RESPONSE                         4
1171 #define FST_ON_CHANNEL_TUNNEL_REQUEST            5
1172
1173 /* IEEE Std 802.11r-2008, 7.4.8, Table 7-57g */
1174 #define FT_ACTION_REQUEST               1
1175 #define FT_ACTION_RESPONSE              2
1176 #define FT_ACTION_CONFIRM               3
1177 #define FT_ACTION_ACK                   4
1178
1179 /* SA Query Action frame codes (IEEE 802.11w-2009, 7.4.9) */
1180 #define SA_QUERY_REQUEST                0
1181 #define SA_QUERY_RESPONSE               1
1182
1183 /* IEEE Std 802.11z-2010, 7.4.11, Table 7-57v1 */
1184 #define TDLS_SETUP_REQUEST              0
1185 #define TDLS_SETUP_RESPONSE             1
1186 #define TDLS_SETUP_CONFIRM              2
1187 #define TDLS_TEARDOWN                   3
1188 #define TDLS_PEER_TRAFFIC_INDICATION    4
1189 #define TDLS_CHANNEL_SWITCH_REQUEST     5
1190 #define TDLS_CHANNEL_SWITCH_RESPONSE    6
1191 #define TDLS_PEER_PSM_REQUEST           7
1192 #define TDLS_PEER_PSM_RESPONSE          8
1193 #define TDLS_PEER_TRAFFIC_RESPONSE      9
1194 #define TDLS_DISCOVERY_REQUEST          10
1195
1196 /* IEEE Std 802.11-2012, 8.5.7.1, Table 8-206 */
1197 #define RM_ACTION_RADIO_MEASUREMENT_REQUEST         0
1198 #define RM_ACTION_RADIO_MEASUREMENT_REPORT          1
1199 #define RM_ACTION_LINK_MEASUREMENT_REQUEST          2
1200 #define RM_ACTION_LINK_MEASUREMENT_REPORT           3
1201 #define RM_ACTION_NEIGHBOR_REPORT_REQUEST           4
1202 #define RM_ACTION_NEIGHBOR_REPORT_RESPONSE          5
1203
1204 /* 11s draft 12.0, table 7-57v30 */
1205 #define MESH_ACTION_LINK_METRIC_REPORT              0
1206 #define MESH_ACTION_HWMP                            1
1207 #define MESH_ACTION_GATE_ANNOUNCE                   2
1208 #define MESH_ACTION_CONGESTION_CTL                  3
1209 #define MESH_ACTION_MCCA_SETUP_REQUEST              4
1210 #define MESH_ACTION_MCCA_SETUP_REPLY                5
1211 #define MESH_ACTION_MCCA_ADV_REQUEST                6
1212 #define MESH_ACTION_MCCA_ADV                        7
1213 #define MESH_ACTION_MCCA_TEARDOWN                   8
1214 #define MESH_ACTION_TBTT_ADJ_REQUEST                9
1215 #define MESH_ACTION_TBTT_ADJ_RESPONSE              10
1216
1217 /* 11s draft 12.0, table 7-57v42: Multihop Action field values */
1218 #define MULTIHOP_ACTION_PROXY_UPDATE                0
1219 #define MULTIHOP_ACTION_PROXY_UPDATE_CONF           1
1220
1221 /* 11s draft 12.0, table 7-57v24: Self-protected Action field values */
1222 #define SELFPROT_ACTION_MESH_PEERING_OPEN           1
1223 #define SELFPROT_ACTION_MESH_PEERING_CONFIRM        2
1224 #define SELFPROT_ACTION_MESH_PEERING_CLOSE          3
1225 #define SELFPROT_ACTION_MESH_GROUP_KEY_INFORM       4
1226 #define SELFPROT_ACTION_MESH_GROUP_KEY_ACK          5
1227
1228 /* 11s draft 12.0, table 7-43bj6: Mesh Peering Protocol Identifier field values */
1229 #define MESH_PEERING_PROTO_MGMT                     0
1230 #define MESH_PEERING_PROTO_AMPE                     1
1231 #define MESH_PEERING_PROTO_VENDOR                 255
1232
1233 /* Vendor actions */
1234 /* MARVELL */
1235 #define MRVL_ACTION_MESH_MANAGEMENT     1
1236
1237 #define MRVL_MESH_MGMT_ACTION_RREQ      0
1238 #define MRVL_MESH_MGMT_ACTION_RREP      1
1239 #define MRVL_MESH_MGMT_ACTION_RERR      2
1240 #define MRVL_MESH_MGMT_ACTION_PLDM      3
1241
1242 #define ANQP_INFO_ANQP_QUERY_LIST 256
1243 #define ANQP_INFO_ANQP_CAPAB_LIST 257
1244 #define ANQP_INFO_VENUE_NAME_INFO 258
1245 #define ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO 259
1246 #define ANQP_INFO_NETWORK_AUTH_TYPE_INFO 260
1247 #define ANQP_INFO_ROAMING_CONSORTIUM_LIST 261
1248 #define ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO 262
1249 #define ANQP_INFO_NAI_REALM_LIST 263
1250 #define ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO 264
1251 #define ANQP_INFO_AP_GEOSPATIAL_LOCATION 265
1252 #define ANQP_INFO_AP_CIVIC_LOCATION 266
1253 #define ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI 267
1254 #define ANQP_INFO_DOMAIN_NAME_LIST 268
1255 #define ANQP_INFO_EMERGENCY_ALERT_ID_URI 269
1256 #define ANQP_INFO_TDLS_CAPAB_INFO 270
1257 #define ANQP_INFO_EMERGENCY_NAI 271
1258 #define ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST 56797
1259
1260 /* ANQP information ID - IEEE Std 802.11u-2011 - Table 7-43bk */
1261 static const value_string anqp_info_id_vals[] = {
1262   {ANQP_INFO_ANQP_QUERY_LIST, "ANQP Query list"},
1263   {ANQP_INFO_ANQP_CAPAB_LIST, "ANQP Capability list"},
1264   {ANQP_INFO_VENUE_NAME_INFO, "Venue Name information"},
1265   {ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO, "Emergency Call Number information"},
1266   {ANQP_INFO_NETWORK_AUTH_TYPE_INFO,
1267    "Network Authentication Type information"},
1268   {ANQP_INFO_ROAMING_CONSORTIUM_LIST, "Roaming Consortium list"},
1269   {ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO,
1270    "IP Address Type Availability information"},
1271   {ANQP_INFO_NAI_REALM_LIST, "NAI Realm list"},
1272   {ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO, "3GPP Cellular Network information"},
1273   {ANQP_INFO_AP_GEOSPATIAL_LOCATION, "AP Geospatial Location"},
1274   {ANQP_INFO_AP_CIVIC_LOCATION, "AP Civic Location"},
1275   {ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI, "AP Location Public Identifier URI"},
1276   {ANQP_INFO_DOMAIN_NAME_LIST, "Domain Name list"},
1277   {ANQP_INFO_EMERGENCY_ALERT_ID_URI, "Emergency Alert Identifier URI"},
1278   {ANQP_INFO_TDLS_CAPAB_INFO, "TDLS Capability information"},
1279   {ANQP_INFO_EMERGENCY_NAI, "Emergency NAI"},
1280   {ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST, "ANQP vendor-specific list"},
1281   {0, NULL}
1282 };
1283 static value_string_ext anqp_info_id_vals_ext = VALUE_STRING_EXT_INIT(anqp_info_id_vals);
1284
1285 /* IEEE 802.11v - WNM Action field values */
1286 enum wnm_action {
1287   WNM_EVENT_REQ = 0,
1288   WNM_EVENT_REPORT = 1,
1289   WNM_DIAGNOSTIC_REQ = 2,
1290   WNM_DIAGNOSTIC_REPORT = 3,
1291   WNM_LOCATION_CFG_REQ = 4,
1292   WNM_LOCATION_CFG_RESP = 5,
1293   WNM_BSS_TRANS_MGMT_QUERY = 6,
1294   WNM_BSS_TRANS_MGMT_REQ = 7,
1295   WNM_BSS_TRANS_MGMT_RESP = 8,
1296   WNM_FMS_REQ = 9,
1297   WNM_FMS_RESP = 10,
1298   WNM_COLLOCATED_INTERFERENCE_REQ = 11,
1299   WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
1300   WNM_TFS_REQ = 13,
1301   WNM_TFS_RESP = 14,
1302   WNM_TFS_NOTIFY = 15,
1303   WNM_SLEEP_MODE_REQ = 16,
1304   WNM_SLEEP_MODE_RESP = 17,
1305   WNM_TIM_BROADCAST_REQ = 18,
1306   WNM_TIM_BROADCAST_RESP = 19,
1307   WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
1308   WNM_CHANNEL_USAGE_REQ = 21,
1309   WNM_CHANNEL_USAGE_RESP = 22,
1310   WNM_DMS_REQ = 23,
1311   WNM_DMS_RESP = 24,
1312   WNM_TIMING_MEASUREMENT_REQ = 25,
1313   WNM_NOTIFICATION_REQ = 26,
1314   WNM_NOTIFICATION_RESP = 27
1315 };
1316
1317 static const value_string wnm_action_codes[] = {
1318   { WNM_EVENT_REQ, "Event Request" },
1319   { WNM_EVENT_REPORT, "Event Report" },
1320   { WNM_DIAGNOSTIC_REQ, "Diagnostic Request" },
1321   { WNM_DIAGNOSTIC_REPORT, "Diagnostic Report" },
1322   { WNM_LOCATION_CFG_REQ, "Location Configuration Request" },
1323   { WNM_LOCATION_CFG_RESP, "Location Configuration Response" },
1324   { WNM_BSS_TRANS_MGMT_QUERY, "BSS Transition Management Query" },
1325   { WNM_BSS_TRANS_MGMT_REQ, "BSS Transition Management Request" },
1326   { WNM_BSS_TRANS_MGMT_RESP, "BSS Transition Management Response" },
1327   { WNM_FMS_REQ, "FMS Request" },
1328   { WNM_FMS_RESP, "FMS Response" },
1329   { WNM_COLLOCATED_INTERFERENCE_REQ, "Collocated Interference Request" },
1330   { WNM_COLLOCATED_INTERFERENCE_REPORT, "Collocated Interference Report" },
1331   { WNM_TFS_REQ, "TFS Request" },
1332   { WNM_TFS_RESP, "TFS Response" },
1333   { WNM_TFS_NOTIFY, "TFS Notify" },
1334   { WNM_SLEEP_MODE_REQ, "WNM-Sleep Mode Request" },
1335   { WNM_SLEEP_MODE_RESP, "WNM-Sleep Mode Response" },
1336   { WNM_TIM_BROADCAST_REQ, "TIM Broadcast Request" },
1337   { WNM_TIM_BROADCAST_RESP, "TIM Broadcast Response" },
1338   { WNM_QOS_TRAFFIC_CAPAB_UPDATE, "QoS Traffic Capability Update" },
1339   { WNM_CHANNEL_USAGE_REQ, "Channel Usage Request" },
1340   { WNM_CHANNEL_USAGE_RESP, "Channel Usage Response" },
1341   { WNM_DMS_REQ, "DMS Request" },
1342   { WNM_DMS_RESP, "DMS Response" },
1343   { WNM_TIMING_MEASUREMENT_REQ, "Timing Measurement Request" },
1344   { WNM_NOTIFICATION_REQ, "WNM-Notification Request" },
1345   { WNM_NOTIFICATION_RESP, "WNM-Notification Response" },
1346   { 0, NULL }
1347 };
1348 static value_string_ext wnm_action_codes_ext = VALUE_STRING_EXT_INIT(wnm_action_codes);
1349
1350 enum unprotected_wnm_action {
1351   UNPROTECTED_WNM_TIM = 0,
1352   UNPROTECTED_WNM_TIMING_MEASUREMENT = 1
1353 };
1354
1355 static const value_string unprotected_wnm_action_codes[] = {
1356   { UNPROTECTED_WNM_TIM, "TIM" },
1357   { UNPROTECTED_WNM_TIMING_MEASUREMENT, "Timing Measurement" },
1358   { 0, NULL }
1359 };
1360 static value_string_ext unprotected_wnm_action_codes_ext = VALUE_STRING_EXT_INIT(unprotected_wnm_action_codes);
1361
1362 static const value_string wnm_notification_types[] = {
1363   { 0, "Firmware Update Notification" },
1364   { 1, "Reserved for use by WFA" },
1365   { 221, "Vendor Specific" },
1366   { 0, NULL }
1367 };
1368
1369 static value_string_ext wnm_notification_types_ext =
1370   VALUE_STRING_EXT_INIT(wnm_notification_types);
1371
1372 /*** End: Action Fixed Parameter ***/
1373
1374 static const value_string ieee80211_tag_measure_request_type_flags[] = {
1375   {0x00, "Basic Request"},
1376   {0x01, "Clear Channel Assessment (CCA) Request"},
1377   {0x02, "Receive Power Indication (RPI) Histogram Request"},
1378   {0x03, "Channel Load Request"},
1379   {0x04, "Noise Histogram Request"},
1380   {0x05, "Beacon Request"},
1381   {0x06, "Frame Request"},
1382   {0x07, "STA Statistics Request"},
1383   {0x08, "Location Configuration Indication (LCI) Request"},
1384   {0x09, "Transmit Stream Measurement Request"},
1385   {0x0A, "Measurement Pause Request"},
1386   {0x00, NULL}
1387 };
1388 static value_string_ext ieee80211_tag_measure_request_type_flags_ext =
1389   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_type_flags);
1390
1391 static const value_string ieee80211_tag_measure_report_type_flags[] = {
1392   { 0x00, "Basic Report" },
1393   { 0x01, "Clear Channel Assessment (CCA) Report" },
1394   { 0x02, "Receive Power Indication (RPI) Histogram Report" },
1395   { 0x03, "Channel Load Report" },
1396   { 0x04, "Noise Histogram Report" },
1397   { 0x05, "Beacon Report" },
1398   { 0x06, "Frame Report" },
1399   { 0x07, "STA Statistics Report" },
1400   { 0x08, "Location Configuration Information (LCI) Report" },
1401   { 0x09, "Transmit Stream Measurement Report" },
1402   { 0x00, NULL }
1403 };
1404 static value_string_ext ieee80211_tag_measure_report_type_flags_ext =
1405   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_report_type_flags);
1406
1407 static const true_false_string ieee80211_tag_measure_report_frame_info_frame_type_flag = {
1408   "Measurement Pilot Frame",
1409   "Beacon/Probe Response Frame"
1410 };
1411
1412 static const true_false_string ieee80211_tag_measure_map_field_bss_flag = {
1413   "At least one MPDU was received by another BSS or IBSS in the measurement period.",
1414   "No MPDUs were received from another BSS or IBSS in the measurement period."
1415 };
1416
1417 static const value_string ieee80211_tag_measure_request_measurement_mode_flags[] = {
1418   { 0x00, "Passive" },
1419   { 0x01, "Active" },
1420   { 0x02, "Beacon Table" },
1421   { 0x00, NULL }
1422 };
1423
1424 #define MEASURE_REQ_BEACON_SUB_SSID 0
1425 #define MEASURE_REQ_BEACON_SUB_BRI 1
1426 #define MEASURE_REQ_BEACON_SUB_RD 2
1427 #define MEASURE_REQ_BEACON_SUB_REQUEST 10
1428 #define MEASURE_REQ_BEACON_SUB_APCP 51
1429 #define MEASURE_REQ_BEACON_SUB_VS 221
1430
1431 static const value_string ieee80211_tag_measure_request_beacon_sub_id_flags[] = {
1432   { MEASURE_REQ_BEACON_SUB_SSID, "SSID" },
1433   { MEASURE_REQ_BEACON_SUB_BRI, "Beacon Reporting Information" },
1434   { MEASURE_REQ_BEACON_SUB_RD, "Reporting Detail" },
1435   { MEASURE_REQ_BEACON_SUB_REQUEST, "Request" },
1436   { MEASURE_REQ_BEACON_SUB_APCP, "AP Channel Report" },
1437   { MEASURE_REQ_BEACON_SUB_VS, "Vendor Specific" },
1438   { 0x00, NULL}
1439 };
1440
1441 static const value_string ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags[] = {
1442   { 0x00, "Report to be issued after each measurement." },
1443   { 0x01, "The measured RCPI level is greater than an absolute threshold." },
1444   { 0x02, "The measured RCPI level is less than an absolute threshold." },
1445   { 0x03, "The measured RSNI level is greater than an absolute threshold." },
1446   { 0x04, "The measured RSNI level is less than an absolute threshold." },
1447   { 0x05, "The measured RCPI level is greater than a threshold defined by an offset from the serving AP's reference RCPI." },
1448   { 0x06, "The measured RCPI level is less than a threshold defined by an offset from the serving AP's reference RCPI." },
1449   { 0x07, "The measured RSNI level is greater than a threshold defined by an offset from the serving AP's reference RSNI." },
1450   { 0x08, "The measured RSNI level is less than a threshold defined by an offset from the serving AP's reference RSNI." },
1451   { 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." },
1452   { 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." },
1453   { 0xfe, "Report not required to be issued" },
1454   { 0x00, NULL }
1455 };
1456
1457 static const value_string ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags[] = {
1458   { 0, "No fixed length fields or elements" },
1459   { 1, "All fixed length fields and any requested elements in the Request information element if present" },
1460   { 2, "All fixed length fields and elements (default, used when Reporting Detail subelement is not included in Beacon Request" },
1461   { 0x00, NULL }
1462 };
1463
1464 static const value_string ieee80211_tag_measure_request_group_id_flags[] = {
1465   { 0x00, "STA Counters from dot11CountersTable" },
1466   { 0x01, "STA Counters from dot11MacStatistics group" },
1467   { 0x02, "QoS STA Counters for UP0 from dot11QosCountersTable" },
1468   { 0x03, "QoS STA Counters for UP1 from dot11QosCountersTable" },
1469   { 0x04, "QoS STA Counters for UP2 from dot11QosCountersTable" },
1470   { 0x05, "QoS STA Counters for UP3 from dot11QosCountersTable" },
1471   { 0x06, "QoS STA Counters for UP4 from dot11QosCountersTable" },
1472   { 0x07, "QoS STA Counters for UP5 from dot11QosCountersTable" },
1473   { 0x08, "QoS STA Counters for UP6 from dot11QosCountersTable" },
1474   { 0x09, "QoS STA Counters for UP7 from dot11QosCountersTable" },
1475   { 0x0a, "BSS Average Access Delays" },
1476   { 0x0b, "STA Counters from dot11A-MSDU Group" },
1477   { 0x0c, "STA Counters from dot11A-MPDU Group" },
1478   { 0x0d, "STA Counters from dot11 BAR, Channel Width, PSMP Group" },
1479   { 0x0e, "STA Counters from dot11Protection Group" },
1480   { 0x0f, "STBC Group" },
1481   { 0x00, NULL }
1482 };
1483 static value_string_ext ieee80211_tag_measure_request_group_id_flags_ext =
1484   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_group_id_flags);
1485
1486 static const value_string ieee80211_tclas_process_flag[] = {
1487   {0x00, "Incoming MSDU's higher layer parameters have to match to the parameters in all associated TCLAS elements."},
1488   {0x01, "Incoming MSDU's higher layer parameters have to match to at least one of the associated TCLAS elements."},
1489   {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."},
1490   {0, NULL}
1491 };
1492
1493
1494 #define MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO 1
1495
1496 static const value_string ieee80211_tag_measure_request_channel_load_sub_id_vals[] = {
1497   { MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO, "Channel Load Reporting Information" },
1498   { 221, "Vendor Specific" },
1499   { 0x00, NULL}
1500 };
1501
1502 static const value_string ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals[] = {
1503   { 0x00, "Report to be issued after each measurement (default, used when Channel Load Reporting Information subelement is not included in Channel Load Request)." },
1504   { 0x01, "Report to be issued when measured Channel Load is equal to or greater than the reference value." },
1505   { 0x02, "Report to be issued when measured Channel Load is equal to or less than the reference value." },
1506   { 0x00, NULL}
1507 };
1508
1509 #define MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO 1
1510
1511 static const value_string ieee80211_tag_measure_request_noise_histogram_sub_id_vals[] = {
1512   { MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO, "Noise Histogram Reporting Information" },
1513   { 221, "Vendor Specific" },
1514   { 0x00, NULL}
1515 };
1516
1517 static const value_string ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals[] = {
1518   { 0x00, "Report to be issued after each measurement (default, used when Noise Histogram Reporting Information subelement is not included in Noise Histogram Request)." },
1519   { 0x01, "Noise Histogram Report to be issued when measured ANPI is equal to or greater than the reference value." },
1520   { 0x02, "Noise Histogram Report to be issued when measured ANPI is equal to or less than the reference value." },
1521   { 0x00, NULL}
1522 };
1523
1524 #define MEASURE_REP_REPORTED_FRAME_BODY 1
1525
1526 static const value_string ieee80211_tag_measure_report_beacon_sub_id_vals[] = {
1527   { MEASURE_REP_REPORTED_FRAME_BODY, "Reported Frame Body" },
1528   { 221, "Vendor Specific" },
1529   { 0x00, NULL}
1530 };
1531
1532 static const value_string frame_type[] = {
1533   {MGT_FRAME,       "Management frame"},
1534   {CONTROL_FRAME,   "Control frame"},
1535   {DATA_FRAME,      "Data frame"},
1536   {EXTENSION_FRAME, "Extension frame"},
1537   {0,               NULL}
1538 };
1539
1540 static const value_string tofrom_ds[] = {
1541   {0,                     "Not leaving DS or network is operating "
1542     "in AD-HOC mode (To DS: 0 From DS: 0)"},
1543   {FLAG_TO_DS,            "Frame from STA to DS via an AP (To DS: 1 "
1544     "From DS: 0)"},
1545   {FLAG_FROM_DS,          "Frame from DS to a STA via AP(To DS: 0 "
1546     "From DS: 1)"},
1547   {FLAG_TO_DS|FLAG_FROM_DS, "WDS (AP to AP) or Mesh (MP to MP) Frame "
1548     "(To DS: 1 From DS: 1)"},
1549   {0, NULL}
1550 };
1551
1552 static const true_false_string tods_flag = {
1553   "Frame is entering DS",
1554   "Frame is not entering DS"
1555 };
1556
1557 static const true_false_string fromds_flag = {
1558   "Frame is exiting DS",
1559   "Frame is not exiting DS"
1560 };
1561
1562 static const true_false_string more_fragments = {
1563   "More fragments follow",
1564   "This is the last fragment"
1565 };
1566
1567 static const true_false_string retry_flags = {
1568   "Frame is being retransmitted",
1569   "Frame is not being retransmitted"
1570 };
1571
1572 static const true_false_string pm_flags = {
1573   "STA will go to sleep",
1574   "STA will stay up"
1575 };
1576
1577 static const true_false_string md_flags = {
1578   "Data is buffered for STA at AP",
1579   "No data buffered"
1580 };
1581
1582 static const true_false_string protected_flags = {
1583   "Data is protected",
1584   "Data is not protected"
1585 };
1586
1587 static const true_false_string order_flags = {
1588   "Strictly ordered",
1589   "Not strictly ordered"
1590 };
1591
1592 static const true_false_string cf_ess_flags = {
1593   "Transmitter is an AP",
1594   "Transmitter is a STA"
1595 };
1596
1597
1598 static const true_false_string cf_privacy_flags = {
1599   "AP/STA can support WEP",
1600   "AP/STA cannot support WEP"
1601 };
1602
1603 static const true_false_string cf_ibss_flags = {
1604   "Transmitter belongs to an IBSS",
1605   "Transmitter belongs to a BSS"
1606 };
1607
1608 static const true_false_string eosp_flag = {
1609   "End of service period",
1610   "Service period"
1611 };
1612
1613 static const true_false_string bit4_flag = {
1614   "Bits 8-15 of QoS Control field are Queue Size",
1615   "Bits 8-15 of QoS Control field are TXOP Duration Requested"
1616 };
1617
1618 static const true_false_string ieee80211_qos_amsdu_present_flag = {
1619   "A-MSDU",
1620   "MSDU"
1621 };
1622
1623 static const true_false_string csa_txrestrict_flags = {
1624   "Tx Restrict",
1625   "No Tx Restrict"
1626 };
1627
1628 static const true_false_string csa_initiator_flags = {
1629   "Initiator",
1630   "Non Initiator"
1631 };
1632
1633 static const true_false_string mesh_config_cap_power_save_level_flags = {
1634    "One of the peer-specific mesh power modes is deep sleep mode",
1635    "No one is in deep sleep mode"
1636 };
1637
1638 static const value_string sta_cf_pollable[] = {
1639   {0x00, "Station is not CF-Pollable"},
1640   {0x02, "Station is CF-Pollable, not requesting to be placed on the  CF-polling list"},
1641   {0x01, "Station is CF-Pollable, requesting to be placed on the CF-polling list"},
1642   {0x03, "Station is CF-Pollable, requesting never to be polled"},
1643   {0x80, "QSTA requesting association in QBSS"},
1644   {0x81, "Reserved"},
1645   {0x82, "Reserved"},
1646   {0x83, "Reserved"},
1647   {0, NULL}
1648 };
1649
1650 static const value_string ap_cf_pollable[] = {
1651   {0x00, "No point coordinator at AP"},
1652   {0x02, "Point coordinator at AP for delivery only (no polling)"},
1653   {0x01, "Point coordinator at AP for delivery and polling"},
1654   {0x03, "Reserved"},
1655   {0x80, "QAP (HC) does not use CFP for delivery of unicast data type frames"},
1656   {0x82, "QAP (HC) uses CFP for delivery, but does not send CF-Polls to non-QoS STAs"},
1657   {0x81, "QAP (HC) uses CFP for delivery, and sends CF-Polls to non-QoS STAs"},
1658   {0x83, "Reserved"},
1659   {0, NULL}
1660 };
1661
1662
1663 static const value_string auth_alg[] = {
1664   {0x00, "Open System"},
1665   {0x01, "Shared key"},
1666   {0x02, "Fast BSS Transition"},
1667   {0x03, "Simultaneous Authentication of Equals (SAE)"},
1668   {0x80, "Network EAP"},  /* Cisco proprietary? */
1669   {0, NULL}
1670 };
1671
1672 static const true_false_string ff_block_ack_params_amsdu_permitted_flag = {
1673   "Permitted in QoS Data MPDUs",
1674   "Not Permitted"
1675 };
1676
1677 static const true_false_string ff_block_ack_params_policy_flag = {
1678   "Immediate Block Ack",
1679   "Delayed Block Ack"
1680 };
1681
1682 static const value_string  ff_channel_width_vals[] = {
1683   {0x00, "20 MHz channel width only"},
1684   {0x01, "Any channel width in the STA's Supported Channel Width Set"},
1685   {0, NULL}
1686 };
1687
1688 static const true_false_string ff_qos_info_ap_q_ack_flag = {
1689   "APs MIB attribute dot11QAckOptionImplemented is true",
1690   "APs MIB attribute dot11QAckOptionImplemented is false"
1691 };
1692
1693 static const true_false_string ff_qos_info_ap_queue_req_flag = {
1694   "AP can process a nonzero Queue Size subfield in the QoS Control field in QoS data frames",
1695   "AP cannot process a nonzero Queue Size subfield in the QoS Control field in QoS data frames"
1696 };
1697
1698 static const true_false_string ff_qos_info_ap_txop_request_flag = {
1699   "AP can process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames",
1700   "AP cannot process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames"
1701 };
1702
1703 static const true_false_string ff_qos_info_sta_ac_flag = {
1704   "Trigger-enabled and Delivery-enabled",
1705   "Neither Trigger-enabled nor Delivery-enabled"
1706 };
1707
1708 static const true_false_string ff_qos_info_sta_q_ack_flag = {
1709   "STAs MIB attribute dot11QAckOptionImplemented is true",
1710   "STAs MIB attribute dot11QAckOptionImplemented is false"
1711 };
1712
1713 static const value_string ff_qos_info_sta_max_sp_len_flags[] = {
1714   {0x00, "AP may deliver all buffered MSDUs, A-MSDUs and MMPDUs"},
1715   {0x01, "AP may deliver a maximum of two MSDUs, A-MSDUs and MMPDUs per SP"},
1716   {0x02, "AP may deliver a maximum of four MSDUs, A-MSDUs and MMPDUs per SP"},
1717   {0x03, "AP may deliver a maximum of six MSDUs, A-MSDUs and MMPDUs per SP"},
1718   {0, NULL}
1719 };
1720
1721 static const true_false_string ff_qos_info_sta_more_data_ack_flag = {
1722   "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",
1723   "STA cannot process ACK frames with the More Data bit in the Frame Control field set to 1"
1724 };
1725
1726 static const true_false_string ff_sm_pwr_save_sm_mode_flag = {
1727   "Dynamic SM Power Save mode",
1728   "Static SM Power Save mode"
1729 };
1730
1731 static const true_false_string ff_pco_phase_cntrl_flag = {
1732   "40 MHz Phase",
1733   "20 MHz Phase"
1734 };
1735
1736 static const true_false_string ff_psmp_param_set_more_psmp_flag = {
1737   "More PSMP Sequences Follow",
1738   "No PSMP Sequences Follow"
1739 };
1740
1741 static const value_string ff_mimo_cntrl_nc_index_flags[] = {
1742   {0x00, "1 Column"},
1743   {0x01, "2 Columns"},
1744   {0x02, "3 Columns"},
1745   {0x03, "4 Columns"},
1746   {0, NULL}
1747 };
1748
1749 static const value_string ff_mimo_cntrl_nr_index_flags[] = {
1750   {0x00, "1 Row"},
1751   {0x01, "2 Rows"},
1752   {0x02, "3 Rows"},
1753   {0x03, "4 Rows"},
1754   {0, NULL}
1755 };
1756
1757 static const true_false_string ff_mimo_cntrl_channel_width_flag = {
1758   "40 MHz",
1759   "20 MHz"
1760 };
1761
1762 static const true_false_string ff_ht_info_information_request_flag = {
1763   "Requesting HT Information Exchange management action frame",
1764   "Should not send an HT Information Exchange management action frame"
1765 };
1766
1767 static const true_false_string ff_ht_info_40_mhz_intolerant_flag = {
1768   "Transmitting station is intolerant of 40 MHz operation",
1769   "Transmitting station permits 40 MHz operation"
1770 };
1771
1772 static const true_false_string ff_ht_info_sta_chan_width_flag = {
1773   "40 MHz",
1774   "20 MHz"
1775 };
1776
1777 static const value_string ff_ht_action_flags[] = {
1778   {HT_ACTION_NOTIFY_CHAN_WIDTH,           "Notify Channel Width"},
1779   {HT_ACTION_SM_PWR_SAVE,                 "Spatial Multiplexing (SM) Power Save"},
1780   {HT_ACTION_PSMP_ACTION,                 "Power Save Multi-Poll (PSMP) action frame"},
1781   {HT_ACTION_SET_PCO_PHASE,               "Set PCO Phase"},
1782   {HT_ACTION_MIMO_CSI,                    "MIMO CSI Matrices"},
1783   {HT_ACTION_MIMO_BEAMFORMING,            "MIMO Non-compressed Beamforming"},
1784   {HT_ACTION_MIMO_COMPRESSED_BEAMFORMING, "MIMO Compressed Beamforming"},
1785   {HT_ACTION_ANT_SEL_FEEDBACK,            "Antenna Selection Indices Feedback"},
1786   {HT_ACTION_HT_INFO_EXCHANGE,            "HT Information Exchange"},
1787   {0x00, NULL}
1788 };
1789
1790 static const value_string ff_fst_action_flags[] = {
1791   {FST_SETUP_REQUEST,             "FST Setup Request"},
1792   {FST_SETUP_RESPONSE,            "FST Setup Response"},
1793   {FST_TEAR_DOWN,                 "FST Tear Down"},
1794   {FST_ACK_REQUEST,               "FST Ack Request"},
1795   {FST_ACK_RESPONSE,              "FST Ack Response"},
1796   {FST_ON_CHANNEL_TUNNEL_REQUEST, "FST On-channel Tunnel Request"},
1797   {0x00, NULL}
1798 };
1799
1800 static const value_string ff_dmg_action_flags[] = {
1801   {DMG_ACTION_PWR_SAVE_CONFIG_REQ,           "Power Save Configuration Request"},
1802   {DMG_ACTION_PWR_SAVE_CONFIG_RES,           "Power Save Configuration Response"},
1803   {DMG_ACTION_INFO_REQ,                      "Information Request"},
1804   {DMG_ACTION_INFO_RES,                      "Information Response"},
1805   {DMG_ACTION_HANDOVER_REQ,                  "Handover Request"},
1806   {DMG_ACTION_HANDOVER_RES,                  "Handover Response"},
1807   {DMG_ACTION_DTP_REQ,                       "DTP Request"},
1808   {DMG_ACTION_DTP_RES,                       "DTP Response"},
1809   {DMG_ACTION_RELAY_SEARCH_REQ,              "Relay Search Request"},
1810   {DMG_ACTION_RELAY_SEARCH_RES,              "Relay Search Response"},
1811   {DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ, "Multi Relay Channel Measurement Request"},
1812   {DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES, "Multi Relay Channel Measurement Response"},
1813   {DMG_ACTION_RLS_REQ,                       "RLS Request"},
1814   {DMG_ACTION_RLS_RES,                       "RLS Response"},
1815   {DMG_ACTION_RLS_ANNOUNCE,                  "RLS Announcement"},
1816   {DMG_ACTION_RLS_TEARDOWN,                  "RLS Teardown"},
1817   {DMG_ACTION_RELAY_ACK_REQ,                 "Relay ACK Request"},
1818   {DMG_ACTION_RELAY_ACK_RES,                 "Relay ACK Response"},
1819   {DMG_ACTION_TPA_REQ,                       "TPA Request"},
1820   {DMG_ACTION_TPA_RES,                       "TPA Response"},
1821   {DMG_ACTION_TPA_REP,                       "TPA Report"},
1822   {DMG_ACTION_ROC_REQ,                       "ROC Request"},
1823   {DMG_ACTION_ROC_RES,                       "ROC Response"},
1824   {0x00, NULL}
1825 };
1826
1827 static const value_string ff_unprotected_dmg_action_flags[] = {
1828   {UNPROTECTED_DMG_ANNOUNCE,      "Announce"},
1829   {UNPROTECTED_DMG_BRP,           "BRP"},
1830   {0x00, NULL}
1831 };
1832 static const value_string ff_mimo_cntrl_grouping_flags[] = {
1833   {0x00, "No Grouping"},
1834   {0x01, "Carrier Groups of 2"},
1835   {0x02, "Carrier Groups of 4"},
1836   {0x03, "Reserved"},
1837   {0, NULL}
1838 };
1839
1840 static const value_string ff_mimo_cntrl_coefficient_size_flags[] = {
1841   {0x00, "4 Bits"},
1842   {0x01, "5 Bits"},
1843   {0x02, "6 Bits"},
1844   {0x03, "8 Bits"},
1845   {0, NULL}
1846 };
1847
1848 static const value_string ff_mimo_cntrl_codebook_info_flags[] = {
1849   {0x00, "1 bit for 'Capital Psi', 3 bits for 'Small Psi'"},
1850   {0x01, "2 bit for 'Capital Psi', 4 bits for 'Small Psi'"},
1851   {0x02, "3 bit for 'Capital Psi', 5 bits for 'Small Psi'"},
1852   {0x03, "4 bit for 'Capital Psi', 6 bits for 'Small Psi'"},
1853   {0, NULL}
1854 };
1855
1856 static const value_string ff_ppa_action_codes[] = {
1857   {PPA_DSE_ENABLEMENT,                  "Protected DSE enablement"},
1858   {PPA_DSE_DEENABLEMENT,                "Protected DSE deenablement"},
1859   {PPA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Protected Extended Channel Switch Announcement"},
1860   {PPA_DSE_MEASUREMENT_REQUEST,         "Protected DSE measurement request"},
1861   {PPA_DSE_MEASUREMENT_REPORT,          "Protected DSE measurement report"},
1862   {PPA_DSE_POWER_CONSTRAINT,            "Protected DSE power constraint"},
1863   {PPA_VENDOR_SPECIFIC,                 "Protected Vendor Specific"},
1864   {PPA_GAS_INITIAL_REQUEST,             "Protected GAS Initial Request"},
1865   {PPA_GAS_INITIAL_RESPONSE,            "Protected GAS Initial Response"},
1866   {PPA_GAS_COMEBACK_REQUEST,            "Protected GAS Comeback Request"},
1867   {PPA_GAS_COMEBACK_RESPONSE,           "Protected GAS Comeback Response"},
1868   {PPA_QAB_REQUEST,                     "Protected QAB Request"},
1869   {PPA_QAB_RESPONSE,                    "Protected QAB Response"},
1870   {0x00, NULL}
1871 };
1872 static value_string_ext ff_ppa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_ppa_action_codes);
1873
1874 static const value_string ff_pa_action_codes[] = {
1875   {PA_20_40_BSS_COEXISTENCE_MANAGEMENT, "20/40 BSS Coexistence Management"},
1876   {PA_DSE_ENABLEMENT,                  "DSE enablement"},
1877   {PA_DSE_DEENABLEMENT,                "DSE deenablement"},
1878   {PA_DSE_REG_LOC_ANNOUNCEMENT,        "DSE Registered Location Announcement"},
1879   {PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement"},
1880   {PA_DSE_MEASUREMENT_REQUEST,         "DSE measurement request"},
1881   {PA_DSE_MEASUREMENT_REPORT,          "DSE measurement report"},
1882   {PA_MEASUREMENT_PILOT,               "Measurement Pilot"},
1883   {PA_DSE_POWER_CONSTRAINT,            "DSE power constraint"},
1884   {PA_VENDOR_SPECIFIC,                 "Vendor Specific"},
1885   {PA_GAS_INITIAL_REQUEST,             "GAS Initial Request"},
1886   {PA_GAS_INITIAL_RESPONSE,            "GAS Initial Response"},
1887   {PA_GAS_COMEBACK_REQUEST,            "GAS Comeback Request"},
1888   {PA_GAS_COMEBACK_RESPONSE,           "GAS Comeback Response"},
1889   {PA_TDLS_DISCOVERY_RESPONSE,         "TDLS Discovery Response"},
1890   {PA_LOCATION_TRACK_NOTIFICATION,     "Location Track Notification"},
1891   {PA_QAB_REQUEST,                     "QAB Request"},
1892   {PA_QAB_RESPONSE,                    "QAB Response"},
1893   {0x00, NULL}
1894 };
1895 static value_string_ext ff_pa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_pa_action_codes);
1896
1897 static const value_string category_codes[] = {
1898   {CAT_SPECTRUM_MGMT,                    "Spectrum Management (SM)"},
1899   {CAT_QOS,                              "Quality of Service (QoS)"},
1900   {CAT_DLS,                              "Direct-Link Setup (DLS)"},
1901   {CAT_BLOCK_ACK,                        "Block Ack"},
1902   {CAT_PUBLIC,                           "Public Action"},
1903   {CAT_RADIO_MEASUREMENT,                "Radio Measurement"},
1904   {CAT_FAST_BSS_TRANSITION,              "Fast BSS Transition"},
1905   {CAT_HT,                               "High Throughput"},
1906   {CAT_SA_QUERY,                         "SA Query"},
1907   {CAT_PUBLIC_PROTECTED,                 "Protected Dual of Public Action"},
1908   {CAT_WNM,                              "WNM"},
1909   {CAT_UNPROTECTED_WNM,                  "Unprotected WNM"},
1910   {CAT_TDLS,                             "TDLS"},
1911   {CAT_MESH,                             "MESH"},
1912   {CAT_MULTIHOP,                         "Multihop"},
1913   {CAT_SELF_PROTECTED,                   "Self-protected"},
1914   {CAT_DMG,                              "DMG"},
1915   {CAT_MGMT_NOTIFICATION,                "Management Notification"},
1916   {CAT_FAST_SESSION_TRANSFER,            "Fast Session Transfer"},
1917   {CAT_ROBUST_AV_STREAMING,              "Robust AV Streaming"},
1918   {CAT_UNPROTECTED_DMG,                  "Unprotected DMG"},
1919   {CAT_VHT,                              "VHT"},
1920   {CAT_VENDOR_SPECIFIC_PROTECTED,        "Vendor-specific Protected"},
1921   {CAT_VENDOR_SPECIFIC,                  "Vendor Specific"},
1922
1923   {0x80 | CAT_SPECTRUM_MGMT,             "Spectrum Management (SM) (error)"},
1924   {0x80 | CAT_QOS,                       "Quality of Service (QoS (error))"},
1925   {0x80 | CAT_DLS,                       "Direct-Link Setup (DLS) (error)"},
1926   {0x80 | CAT_BLOCK_ACK,                 "Block Ack (error)"},
1927   {0x80 | CAT_PUBLIC,                    "Public Action (error)"},
1928   {0x80 | CAT_RADIO_MEASUREMENT,         "Radio Measurement (error)"},
1929   {0x80 | CAT_FAST_BSS_TRANSITION,       "Fast BSS Transition (error)"},
1930   {0x80 | CAT_HT,                        "High Throughput (error)"},
1931   {0x80 | CAT_SA_QUERY,                  "SA Query (error)"},
1932   {0x80 | CAT_PUBLIC_PROTECTED,          "Protected Dual of Public Action (error)"},
1933   {0x80 | CAT_WNM,                       "WNM (error)"},
1934   {0x80 | CAT_UNPROTECTED_WNM,           "Unprotected WNM (error)"},
1935   {0x80 | CAT_TDLS,                      "TDLS (error)"},
1936   {0x80 | CAT_MESH,                      "Mesh (error)"},
1937   {0x80 | CAT_MULTIHOP,                  "Multihop (error)"},
1938   {0x80 | CAT_SELF_PROTECTED,            "Self-protected (error)"},
1939   {0x80 | CAT_DMG,                       "DMG (error)"},
1940   {0x80 | CAT_MGMT_NOTIFICATION,         "Management Notification (error)"},
1941   {0x80 | CAT_FAST_SESSION_TRANSFER,     "Fast Session Transfer (error)"},
1942   {0x80 | CAT_ROBUST_AV_STREAMING,       "Robust AV Streaming (error)"},
1943   {0x80 | CAT_UNPROTECTED_DMG,           "Unprotected DMG (error)"},
1944   {0x80 | CAT_VHT,                       "VHT"},
1945   {0x80 | CAT_VENDOR_SPECIFIC_PROTECTED, "Vendor-specific Protected (error)"},
1946   {0x80 | CAT_VENDOR_SPECIFIC,           "Vendor Specific (error)"},
1947   {0, NULL}
1948 };
1949 static value_string_ext category_codes_ext = VALUE_STRING_EXT_INIT(category_codes);
1950
1951 #define NR_SUB_ID_TSF_INFO                 1
1952 #define NR_SUB_ID_CON_COU_STR              2
1953 #define NR_SUB_ID_BSS_TRN_CAN_PREF         3
1954 #define NR_SUB_ID_BSS_TER_DUR              4
1955 #define NR_SUB_ID_BEARING                  5
1956
1957 #define NR_SUB_ID_HT_CAPABILITIES          45
1958 #define NR_SUB_ID_HT_OPERATION             61
1959 #define NR_SUB_ID_SEC_CHANNEL_OFFSET       62
1960 #define NR_SUB_ID_MEASUREMENT_PILOT_INFO   66
1961 #define NR_SUB_ID_RM_ENABLE_CAP            70
1962 #define NR_SUB_ID_HT_MULTIPLE_BSSID        71
1963
1964 #define NR_SUB_ID_VENDOR_SPECIFIC          221
1965
1966 static const value_string ieee80211_neighbor_report_subelement_id_vals[] = {
1967   {NR_SUB_ID_TSF_INFO, "TSF Information"},
1968   {NR_SUB_ID_CON_COU_STR, "Condensed Country String"},
1969   {NR_SUB_ID_BSS_TRN_CAN_PREF, "BSS Transition Candidate Preference"},
1970   {NR_SUB_ID_BSS_TER_DUR, "BSS Termination Duration"},
1971   {NR_SUB_ID_BEARING, "Bearing"},
1972   {NR_SUB_ID_HT_CAPABILITIES, "HT Capabilities"},
1973   {NR_SUB_ID_HT_OPERATION, "HT Operation"},
1974   {NR_SUB_ID_SEC_CHANNEL_OFFSET, "Secondary Channel Offset"},
1975   {NR_SUB_ID_MEASUREMENT_PILOT_INFO, "Measurement Pilot Transmission"},
1976   {NR_SUB_ID_RM_ENABLE_CAP, "RM Enabled Capabilities"},
1977   {NR_SUB_ID_HT_MULTIPLE_BSSID, "Multiple BSSID"},
1978   {NR_SUB_ID_VENDOR_SPECIFIC, "Vendor Specific"},
1979   {0, NULL}
1980 };
1981
1982 static const value_string ieee80211_neighbor_report_bssid_info_reachability_vals[] = {
1983   {0, "Reserved"},
1984   {1, "Not Reachable"},
1985   {2, "Unknown"},
1986   {3, "Reachable"},
1987   {0, NULL}
1988 };
1989
1990 static const value_string action_codes[] = {
1991   {SM_ACTION_MEASUREMENT_REQUEST, "Measurement Request"},
1992   {SM_ACTION_MEASUREMENT_REPORT,  "Measurement Report"},
1993   {SM_ACTION_TPC_REQUEST,         "TPC Request"},
1994   {SM_ACTION_TPC_REPORT,          "TPC Report"},
1995   {SM_ACTION_CHAN_SWITCH_ANNC,    "Channel Switch Announcement"},
1996   {0, NULL}
1997 };
1998
1999 static const value_string vendor_action_types_mrvl[] = {
2000   {MRVL_ACTION_MESH_MANAGEMENT, "Mesh Management"},
2001   {0, NULL}
2002 };
2003
2004 static const value_string mesh_mgt_action_codes_mrvl[] = {
2005   {MRVL_MESH_MGMT_ACTION_RREQ, "Route Request"},
2006   {MRVL_MESH_MGMT_ACTION_RREP, "Route Response"},
2007   {MRVL_MESH_MGMT_ACTION_RERR, "Route Error"},
2008   {MRVL_MESH_MGMT_ACTION_PLDM, "Peer Link Down"},
2009   {0, NULL}
2010 };
2011
2012 static const value_string mesh_path_selection_codes[] = {
2013   {0x0, "Hybrid Wireless Mesh Protocol"},
2014   {0, NULL}
2015 };
2016
2017 static const value_string mesh_metric_codes[] = {
2018   {0x0, "Airtime Link Metric"},
2019   {0, NULL}
2020 };
2021
2022 static const value_string wme_action_codes[] = {
2023   {0x00, "Setup request"},
2024   {0x01, "Setup response"},
2025   {0x02, "Teardown"},
2026   {0x00, NULL}
2027 };
2028
2029 static const value_string wme_status_codes[] = {
2030   {0x00, "Admission accepted"},
2031   {0x01, "Invalid parameters"},
2032   {0x03, "Refused"},
2033   {0x00, NULL}
2034 };
2035
2036 static const value_string mesh_action[] = {
2037   {MESH_ACTION_LINK_METRIC_REPORT, "Mesh Link Metric Report"},
2038   {MESH_ACTION_HWMP,               "HWMP Mesh Path Selection"},
2039   {MESH_ACTION_GATE_ANNOUNCE,      "Gate Announcement"},
2040   {MESH_ACTION_CONGESTION_CTL,     "Congestion Control Notification"},
2041   {MESH_ACTION_MCCA_SETUP_REQUEST, "MCCA Setup Request"},
2042   {MESH_ACTION_MCCA_SETUP_REPLY,   "MCCA Setup Reply"},
2043   {MESH_ACTION_MCCA_ADV_REQUEST,   "MCCA Advertisement Request"},
2044   {MESH_ACTION_MCCA_ADV,           "MCCA Advertisement"},
2045   {MESH_ACTION_MCCA_TEARDOWN,      "MCCA Teardown"},
2046   {MESH_ACTION_TBTT_ADJ_REQUEST,   "TBTT Adjustment Request"},
2047   {MESH_ACTION_TBTT_ADJ_RESPONSE,  "TBTT Adjustment Response"},
2048   {0, NULL}
2049 };
2050 static value_string_ext mesh_action_ext = VALUE_STRING_EXT_INIT(mesh_action);
2051
2052 static const value_string multihop_action[] = {
2053   {MULTIHOP_ACTION_PROXY_UPDATE,      "Proxy Update"},
2054   {MULTIHOP_ACTION_PROXY_UPDATE_CONF, "Proxy Update Confirmation"},
2055   {0, NULL}
2056 };
2057
2058 static const value_string selfprot_action[] = {
2059   {SELFPROT_ACTION_MESH_PEERING_OPEN,     "Mesh Peering Open"},
2060   {SELFPROT_ACTION_MESH_PEERING_CONFIRM,  "Mesh Peering Confirm"},
2061   {SELFPROT_ACTION_MESH_PEERING_CLOSE,    "Mesh Peering Close"},
2062   {SELFPROT_ACTION_MESH_GROUP_KEY_INFORM, "Mesh Group Key Inform"},
2063   {SELFPROT_ACTION_MESH_GROUP_KEY_ACK,    "Mesh Group Key Ack"},
2064   {0, NULL}
2065 };
2066
2067 static const value_string mesh_peering_proto_ids[] = {
2068   {MESH_PEERING_PROTO_MGMT,   "Mesh peering management protocol"},
2069   {MESH_PEERING_PROTO_AMPE,   "Authenticated mesh peering exchange protocol"},
2070   {MESH_PEERING_PROTO_VENDOR, "Vendor specific"},
2071   {0, NULL}
2072 };
2073
2074 static const true_false_string hwmp_targ_usn_flags = {
2075   "[USN = 1] Target Sequence Number Unknown at Originator",
2076   "[USN = 0] Target Sequence Number Known at Originator"
2077 };
2078
2079 static const true_false_string hwmp_targ_to_flags = {
2080   "[TO = 1] Only Target Will Respond",
2081   "[TO = 0] Intermediate Nodes May Respond"
2082 };
2083
2084 static const value_string ack_policy[] = {
2085   {0x00, "Normal Ack"},
2086   {0x01, "No Ack"},
2087   {0x02, "No explicit acknowledgment"},
2088   {0x03, "Block Ack"},
2089   {0x00, NULL}
2090 };
2091
2092 static const value_string qos_action_codes[] = {
2093   {QOS_ACTION_ADDTS_REQUEST,  "ADDTS Request"},
2094   {QOS_ACTION_ADDTS_RESPONSE, "ADDTS Response"},
2095   {QOS_ACTION_DELTS,          "DELTS"},
2096   {QOS_ACTION_SCHEDULE,   "Schedule"},
2097   {QOS_ACTION_MAP_CONFIGURE, "QoS Map Configure"},
2098   {0, NULL}
2099 };
2100
2101 static const value_string ba_action_codes[] = {
2102   {BA_ADD_BLOCK_ACK_REQUEST,  "Add Block Ack Request"},
2103   {BA_ADD_BLOCK_ACK_RESPONSE, "Add Block Ack Response"},
2104   {BA_DELETE_BLOCK_ACK,       "Delete Block Ack"},
2105   {0x00, NULL}
2106 };
2107
2108 static const value_string dls_action_codes[] = {
2109   {DLS_ACTION_REQUEST,  "DLS Request"},
2110   {DLS_ACTION_RESPONSE, "DLS Response"},
2111   {DLS_ACTION_TEARDOWN, "DLS Teardown"},
2112   {0, NULL}
2113 };
2114
2115 static const value_string tsinfo_type[] = {
2116   {0x0, "Aperiodic or unspecified Traffic"},
2117   {0x1, "Periodic Traffic"},
2118   {0, NULL}
2119 };
2120
2121 static const value_string tsinfo_direction[] = {
2122   {0x00, "Uplink"},
2123   {0x01, "Downlink"},
2124   {0x02, "Direct link"},
2125   {0x03, "Bidirectional link"},
2126   {0, NULL}
2127 };
2128
2129 static const value_string tsinfo_access[] = {
2130   {0x00, "Reserved"},
2131   {0x01, "EDCA"},
2132   {0x02, "HCCA"},
2133   {0x03, "HEMM"},
2134   {0, NULL}
2135 };
2136
2137 static const value_string qos_up[] = {
2138   {0x00, "Best Effort"},
2139   {0x01, "Background"},
2140   {0x02, "Spare"},
2141   {0x03, "Excellent Effort"},
2142   {0x04, "Controlled Load"},
2143   {0x05, "Video"},
2144   {0x06, "Voice"},
2145   {0x07, "Network Control"},
2146   {0, NULL}
2147 };
2148
2149 static const value_string classifier_type[] = {
2150   {0x00, "Ethernet parameters"},
2151   {0x01, "TCP/UDP IP parameters"},
2152   {0x02, "IEEE 802.1D/Q parameters"},
2153   {0, NULL}
2154 };
2155
2156 static const true_false_string ieee80211_block_ack_control_ack_policy_flag = {
2157     "Sender Does Not Require Immediate Acknowledgement",
2158     "Immediate Acknowledgement Required"
2159 };
2160
2161 static const value_string ieee80211_block_ack_request_type_flags[] = {
2162   {0x00, "Basic Block Ack Request"},
2163   {0x01, "Reserved"},
2164   {0x02, "Compressed Block Ack Request"},
2165   {0x03, "Multi-TID Block Ack Request"},
2166   {0x00, NULL}
2167 };
2168
2169 static const value_string ieee80211_block_ack_type_flags[] = {
2170   {0x00, "Basic Block Ack"},
2171   {0x01, "Reserved"},
2172   {0x02, "Compressed Block"},
2173   {0x03, "Multi-TID Block"},
2174   {0x00, NULL}
2175 };
2176
2177 static const value_string ft_action_codes[] = {
2178   {FT_ACTION_REQUEST, "FT Request"},
2179   {FT_ACTION_RESPONSE, "FT Response"},
2180   {FT_ACTION_CONFIRM, "FT Confirm"},
2181   {FT_ACTION_ACK, "FT Ack"},
2182   {0, NULL}
2183 };
2184
2185 static const value_string sa_query_action_codes[] = {
2186   {SA_QUERY_REQUEST, "SA Query Request"},
2187   {SA_QUERY_RESPONSE, "SA Query Response"},
2188   {0, NULL}
2189 };
2190
2191 static const value_string ieee80211_data_encap_payload_types[] = {
2192   {1, "Remote Request/Response"},
2193   {2, "TDLS"},
2194   {0, NULL}
2195 };
2196
2197 static const true_false_string rsn_preauth_flags = {
2198   "Transmitter supports pre-authentication",
2199   "Transmitter does not support pre-authentication"
2200 };
2201
2202 static const true_false_string rsn_no_pairwise_flags = {
2203   "Transmitter cannot support WEP default key 0 simultaneously with "
2204   "Pairwise key",
2205   "Transmitter can support WEP default key 0 simultaneously with "
2206   "Pairwise key"
2207 };
2208
2209 static const value_string rsn_cap_replay_counter[] = {
2210   {0x00, "1 replay counter per PTKSA/GTKSA/STAKeySA"},
2211   {0x01, "2 replay counters per PTKSA/GTKSA/STAKeySA"},
2212   {0x02, "4 replay counters per PTKSA/GTKSA/STAKeySA"},
2213   {0x03, "16 replay counters per PTKSA/GTKSA/STAKeySA"},
2214   {0, NULL}
2215 };
2216
2217 static const true_false_string ht_ldpc_coding_flag = {
2218   "Transmitter supports receiving LDPC coded packets",
2219   "Transmitter does not support receiving LDPC coded packets"
2220 };
2221
2222 static const true_false_string ht_chan_width_flag = {
2223   "Transmitter supports 20MHz and 40MHz operation",
2224   "Transmitter only supports 20MHz operation"
2225 };
2226
2227 static const value_string ht_sm_pwsave_flag[] = {
2228   {0x00, "Static SM Power Save mode"},
2229   {0x01, "Dynamic SM Power Save mode"},
2230   {0x02, "Reserved"},
2231   {0x03, "SM Power Save disabled"},
2232   {0x00, NULL}
2233 };
2234
2235 static const true_false_string ht_green_flag = {
2236   "Transmitter is able to receive PPDUs with Green Field (GF) preamble",
2237   "Transmitter is not able to receive PPDUs with Green Field (GF) preamble"
2238 };
2239
2240 static const value_string ht_rx_stbc_flag[] = {
2241   {0x00, "No Rx STBC support"},
2242   {0x01, "Rx support of one spatial stream"},
2243   {0x02, "Rx support of one and two spatial streams"},
2244   {0x03, "Rx support of one, two, and three spatial streams"},
2245   {0x00, NULL}
2246 };
2247
2248   /* IEEE Stc 802.11ac-2013 8.4.2.29 Extended Capabilities element*/
2249 static const value_string vht_max_mpdu_in_amsdu[] = {
2250     {0x00, "No limit"},
2251     {0x01, "32"},
2252     {0x02, "16"},
2253     {0x03, "8"},
2254     {0, NULL}
2255 };
2256
2257   /* IEEE Stc 802.11ac/D3.1 */
2258
2259 static const value_string vht_max_mpdu_length_flag[] = {
2260   {0x00, "3 895"},
2261   {0x01, "7 991"},
2262   {0x02, "11 454"},
2263   {0x03, "Reserved"},
2264   {0x00, NULL}
2265 };
2266
2267 static const value_string vht_supported_chan_width_set_flag[] = {
2268   {0x00, "Neither 160MHz nor 80+80 supported"},
2269   {0x01, "160MHz supported"},
2270   {0x02, "160MHz and 80+80 Supported"},
2271   {0x03, "Reserved"},
2272   {0x00, NULL}
2273 };
2274
2275 static const value_string vht_rx_stbc_flag[] = {
2276   {0x00, "None"},
2277   {0x01, "1 Spatial Stream Supported"},
2278   {0x02, "1 to 2 Spatial Stream Supported"},
2279   {0x03, "1 to 3 Spatial Stream Supported"},
2280   {0x04, "1 to 4 Spatial Stream Supported"},
2281   {0x02, "160MHz and 80+80 Supported"},
2282   {0x05, "Reserved"},
2283   {0x06, "Reserved"},
2284   {0x07, "Reserved"},
2285   {0x00, NULL}
2286 };
2287
2288 static const value_string num_plus_one_3bit_flag[] = {
2289   {0x00, "1"},
2290   {0x01, "2"},
2291   {0x02, "3"},
2292   {0x03, "4"},
2293   {0x04, "5"},
2294   {0x05, "6"},
2295   {0x06, "7"},
2296   {0x07, "8"},
2297   {0x00, NULL}
2298 };
2299
2300 static const value_string vht_max_ampdu_flag[] = {
2301   {0x00, "8 191"},
2302   {0x01, "16 383"},
2303   {0x02, "32 767"},
2304   {0x03, "65,535"},
2305   {0x04, "131 071"},
2306   {0x05, "262 143"},
2307   {0x06, "524 287"},
2308   {0x07, "1 048 575"},
2309   {0x00, NULL}
2310 };
2311
2312 static const value_string vht_link_adapt_flag[] = {
2313   {0x00, "No Feedback"},
2314   {0x01, "Reserved (logically only solicited feedback)"},
2315   {0x02, "Unsolicited feedback only"},
2316   {0x03, "Both (can provide unsolicited feedback and respond to VHT MRQ)"},
2317   {0x00, NULL}
2318 };
2319
2320 static const value_string vht_supported_mcs_flag[] = {
2321   {0x00, "MCS 0-7"},
2322   {0x01, "MCS 0-8"},
2323   {0x02, "MCS 0-9"},
2324   {0x03, "Not Supported"},
2325   {0x00, NULL}
2326 };
2327
2328 static const value_string vht_op_channel_width_flag[] = {
2329   {0x00, "20 MHz or 40 MHz"},
2330   {0x01, "80 MHz"},
2331   {0x02, "160 MHz"},
2332   {0x03, "80+80 MHz"},
2333   {0x00, NULL}
2334 };
2335
2336 static const value_string vht_tpe_pwr_units[] = {
2337   {0x00, "EIRP"},
2338   {0x00, NULL}
2339 };
2340
2341 static const true_false_string vht_ndp_annc_sta_info_feedback_type = {
2342   "MU feedback requested",
2343   "SU feedback requested"
2344 };
2345
2346 static const true_false_string ht_delayed_block_ack_flag = {
2347   "Transmitter supports HT-Delayed BlockAck",
2348   "Transmitter does not support HT-Delayed BlockAck"
2349 };
2350
2351 static const true_false_string ht_max_amsdu_flag = {
2352   "7935 bytes",
2353   "3839 bytes"
2354 };
2355
2356 static const true_false_string ht_dss_cck_40_flag = {
2357   "Will/Can use DSSS/CCK in 40 MHz",
2358   "Won't/Can't use of DSSS/CCK in 40 MHz"
2359 };
2360
2361 static const true_false_string ht_psmp_flag = {
2362   "Will/Can support PSMP operation",
2363   "Won't/Can't support PSMP operation"
2364 };
2365
2366 static const true_false_string ht_40_mhz_intolerant_flag = {
2367   "Use of 40 MHz transmissions restricted/disallowed",
2368   "Use of 40 MHz transmissions unrestricted/allowed"
2369 };
2370
2371 static const value_string ampduparam_mpdu_start_spacing_flags[] = {
2372   {0x00, "no restriction"},
2373   {0x01, "1/4 [usec]"},
2374   {0x02, "1/2 [usec]"},
2375   {0x03, "1 [usec]"},
2376   {0x04, "2 [usec]"},
2377   {0x05, "4 [usec]"},
2378   {0x06, "8 [usec]"},
2379   {0x07, "16 [usec]"},
2380   {0x00, NULL}
2381 };
2382
2383 static const true_false_string mcsset_tx_rx_mcs_set_not_equal_flag = {
2384   "Not Equal",
2385   "Equal",
2386 };
2387
2388 static const value_string mcsset_tx_max_spatial_streams_flags[] = {
2389   {0x00, "1 spatial stream"},
2390   {0x01, "2 spatial streams"},
2391   {0x02, "3 spatial streams"},
2392   {0x03, "4 spatial streams"},
2393   {0x04, "TX MCS Set Not Defined"},
2394   {0x00, NULL}
2395 };
2396
2397 static const value_string htex_transtime_flags[] = {
2398   {0x00, "No Transition"},
2399   {0x01, "400 usec"},
2400   {0x02, "1.5 msec"},
2401   {0x03, "5 msec"},
2402   {0x00, NULL}
2403 };
2404
2405 static const value_string htex_mcs_flags[] = {
2406   {0x00, "STA does not provide MCS feedback"},
2407   {0x01, "Reserved"},
2408   {0x02, "STA provides only unsolicited MCS feedback"},
2409   {0x03, "STA can provide MCS feedback in response to MRQ as well as unsolicited MCS feedback"},
2410   {0x00, NULL}
2411 };
2412
2413 static const value_string txbf_calib_flag[] = {
2414   {0x00, "incapable"},
2415   {0x01, "Limited involvement, cannot initiate"},
2416   {0x02, "Limited involvement, can initiate"},
2417   {0x03, "Fully capable"},
2418   {0x00, NULL}
2419 };
2420
2421 static const value_string txbf_feedback_flags[] = {
2422   {0x00, "not supported"},
2423   {0x01, "delayed feedback capable"},
2424   {0x02, "immediate feedback capable"},
2425   {0x03, "delayed and immediate feedback capable"},
2426   {0x00, NULL}
2427 };
2428
2429 static const value_string txbf_antenna_flags[] = {
2430   {0x00, "1 TX antenna sounding"},
2431   {0x01, "2 TX antenna sounding"},
2432   {0x02, "3 TX antenna sounding"},
2433   {0x03, "4 TX antenna sounding"},
2434   {0x00, NULL}
2435 };
2436
2437 static const value_string txbf_csi_max_rows_bf_flags[] = {
2438   {0x00, "1 row of CSI"},
2439   {0x01, "2 rows of CSI"},
2440   {0x02, "3 rows of CSI"},
2441   {0x03, "4 rows of CSI"},
2442   {0x00, NULL}
2443 };
2444
2445 static const value_string txbf_chan_est_flags[] = {
2446   {0x00, "1 space time stream"},
2447   {0x01, "2 space time streams"},
2448   {0x02, "3 space time streams"},
2449   {0x03, "4 space time streams"},
2450   {0x00, NULL}
2451 };
2452
2453 static const value_string txbf_min_group_flags[] = {
2454   {0x00, "No grouping supported"},
2455   {0x01, "Groups of 1, 2 supported"},
2456   {0x02, "Groups of 1, 4 supported"},
2457   {0x03, "Groups of 1, 2, 4 supported"},
2458   {0x00, NULL}
2459 };
2460
2461 static const value_string hta_ext_chan_offset_flag[] = {
2462   {0x00, "No Extension Channel"},
2463   {0x01, "Extension Channel above control channel"},
2464   {0x02, "Undefined"},
2465   {0x03, "Extension Channel below control channel"},
2466   {0x00, NULL}
2467 };
2468
2469 static const true_false_string hta_rec_tx_width_flag = {
2470   "Any channel width enabled",
2471   "Use 20MHz channel (control)"
2472 };
2473
2474 static const true_false_string hta_rifs_mode_flag = {
2475   "Use of RIFS permitted",
2476   "Use of RIFS prohibited"
2477 };
2478
2479 static const true_false_string hta_controlled_access_flag = {
2480   "Not only PSMP",
2481   "PSMP only"
2482 };
2483
2484 static const value_string hta_service_interval_flag[] = {
2485   {0x00, "5ms"},
2486   {0x01, "10ms"},
2487   {0x02, "15ms"},
2488   {0x03, "20ms"},
2489   {0x04, "25ms"},
2490   {0x05, "30ms"},
2491   {0x06, "35ms"},
2492   {0x07, "40ms"},
2493   {0x00, NULL}
2494 };
2495
2496 static const value_string hta_operating_mode_flag[] = {
2497   {0x00, "Pure HT, no protection"},
2498   {0x01, "There may be non-HT devices (control & ext channel)"},
2499   {0x02, "No non-HT is associated, but at least 1 20MHz is. protect on"},
2500   {0x03, "Mixed: no non-HT is associated, protect on"},
2501   {0x00, NULL}
2502 };
2503
2504 static const true_false_string hta_non_gf_devices_flag = {
2505   "All HT devices associated are GF capable",
2506   "One or More HT devices are not GF capable"
2507 };
2508
2509 static const true_false_string hta_dual_stbc_protection_flag = {
2510   "Dual CTS protections is used",
2511   "Regular use of RTS/CTS"
2512 };
2513
2514 static const true_false_string hta_secondary_beacon_flag = {
2515   "Secondary Beacon",
2516   "Primary Beacon"
2517 };
2518
2519 static const true_false_string hta_lsig_txop_protection_flag = {
2520   "Full Support",
2521   "Not full support"
2522 };
2523
2524 static const true_false_string hta_pco_active_flag = {
2525   "PCO is activated in the BSS",
2526   "PCO is not activated in the BSS"
2527 };
2528
2529 static const true_false_string hta_pco_phase_flag = {
2530   "Switch to 20MHz phase/keep 20MHz",
2531   "Switch to 40MHz phase/keep 40MHz"
2532 };
2533
2534 static const value_string ht_info_secondary_channel_offset_flags[] = {
2535   {0x00, "No secondary channel"},
2536   {0x01, "Secondary channel is above the primary channel"},
2537   {0x02, "Reserved"},
2538   {0x03, "Secondary channel is below the primary channel"},
2539   {0x00, NULL}
2540 };
2541
2542 static const true_false_string ht_info_channel_width_flag = {
2543   "Channel of any width supported",
2544   "20 MHz channel width only"
2545 };
2546
2547 static const true_false_string ht_info_rifs_mode_flag = {
2548   "Permitted",
2549   "Prohibited"
2550 };
2551
2552 static const true_false_string ht_info_psmp_stas_only_flag = {
2553   "Association requests are accepted from only PSMP capable STA",
2554   "Association requests are accepted regardless of PSMP capability"
2555 };
2556
2557 static const value_string ht_info_service_interval_granularity_flags[] = {
2558   {0x00, "5 ms"},
2559   {0x01, "10 ms"},
2560   {0x02, "15 ms"},
2561   {0x03, "20 ms"},
2562   {0x04, "25 ms"},
2563   {0x05, "30 ms"},
2564   {0x06, "35 ms"},
2565   {0x07, "40 ms"},
2566   {0x00, NULL}
2567 };
2568
2569 static const value_string ht_info_operating_mode_flags[] = {
2570   {0x00, "All STAs are - 20/40 MHz HT or in a 20/40 MHz BSS or are 20 MHz HT in a 20 MHz BSS"},
2571   {0x01, "HT non-member protection mode"},
2572   {0x02, "Only HT STAs in the BSS, however, there exists at least one 20 MHz STA"},
2573   {0x03, "HT mixed mode"},
2574   {0x00, NULL}
2575 };
2576
2577 static const true_false_string ht_info_non_greenfield_sta_present_flag = {
2578   "One or more associated STAs are not greenfield capable",
2579   "All associated STAs are greenfield capable"
2580 };
2581
2582 static const true_false_string ht_info_transmit_burst_limit_flag = {
2583   "2.4 GHz - 6.16 ms | All other bands - 3.08 ms",
2584   "No limit"
2585 };
2586
2587 static const true_false_string ht_info_obss_non_ht_stas_present_flag = {
2588   "Use of protection for non-HT STAs by overlapping BSSs is needed",
2589   "Use of protection for non-HT STAs by overlapping BSSs is not needed"
2590 };
2591
2592 static const true_false_string ht_info_dual_beacon_flag = {
2593   "AP transmits a secondary beacon",
2594   "No second beacon is transmitted"
2595 };
2596
2597 static const true_false_string ht_info_dual_cts_protection_flag = {
2598   "Required",
2599   "Not required"
2600 };
2601
2602 static const true_false_string ht_info_secondary_beacon_flag = {
2603   "Secondary beacon",
2604   "Primary beacon"
2605 };
2606
2607 static const true_false_string ht_info_lsig_txop_protection_full_support_flag = {
2608   "All HT STAs in the BSS support L-SIG TXOP protection",
2609   "One or more HT STAs in the BSS do not support L-SIG TXOP protection"
2610 };
2611
2612 static const true_false_string ht_info_pco_phase_flag = {
2613   "Switch to or continue 40 MHz phase",
2614   "Switch to or continue 20 MHz phase"
2615 };
2616
2617 static const true_false_string htc_lac_trq_flag = {
2618   "Want sounding PPDU",
2619   "Don't want sounding PPDU"
2620 };
2621
2622 static const true_false_string htc_lac_mai_mrq_flag = {
2623   "MCS feedback requested",
2624   "No MCS feedback requested"
2625 };
2626
2627 static const value_string ieee80211_htc_lac_asel_command_flags[] = {
2628   {0x00, "Transmit Antenna Selection Sounding Indication (TXASSI)"},
2629   {0x01, "Transmit Antenna Selection Sounding Request (TXASSR)"},
2630   {0x02, "Receive Antenna Selection Sounding Indication (RXASSI)"},
2631   {0x03, "Receive Antenna Selection Sounding Request (RXASSR)"},
2632   {0x04, "Sounding Label"},
2633   {0x05, "No feedback, ASEL training failure"},
2634   {0x06, "Transmit Antenna Selection Sounding Indication (TXASSI) requesting feedback of explicit CSI"},
2635   {0x07, "Reserved"},
2636   {0x00, NULL}
2637 };
2638
2639 static const value_string ieee80211_htc_cal_pos_flags[] = {
2640   {0x00, "Not a calibration frame"},
2641   {0x01, "Calibration Start"},
2642   {0x02, "Sounding Response"},
2643   {0x03, "Sounding Complete"},
2644   {0x00, NULL}
2645 };
2646
2647 static const value_string ieee80211_htc_csi_steering_flags[] = {
2648   {0x00, "No feedback required"},
2649   {0x01, "CSI"},
2650   {0x02, "Non-compressed Beamforming Feedback Matrix"},
2651   {0x03, "Compressed Beamforming Feedback Matrix"},
2652   {0x00, NULL}
2653 };
2654
2655 static const true_false_string ieee80211_htc_ndp_announcement_flag = {
2656   "NDP will follow",
2657   "No NDP will follow"
2658 };
2659
2660 static const value_string ieee80211_htc_bw_recommended_vht_mcs_vals[] = {
2661   {0, "20 MHz"},
2662   {1, "40 MHz"},
2663   {2, "80 MHz"},
2664   {3, "160 MHz and 80+80 MHz"},
2665   {0, NULL}
2666 };
2667
2668 static const value_string ieee80211_htc_coding_type_vals[] = {
2669   {0, "BCC"},
2670   {1, "LDPC"},
2671   {0, NULL}
2672 };
2673
2674 static const value_string ieee80211_htc_fb_tx_type_vals[] = {
2675   {0, "Not beamformed"},
2676   {1, "Beamformed"},
2677   {0, NULL}
2678 };
2679
2680 static const value_string ieee80211_tag_secondary_channel_offset_flags[] = {
2681   {0x00, "No Secondary Channel"},
2682   {0x01, "Above Primary Channel"},
2683   {0x02, "Reserved"},
2684   {0x03, "Below Primary Channel"},
2685   {0x00, NULL}
2686 };
2687
2688 #define BSS_BITMASK_UP0   0x0001
2689 #define BSS_BITMASK_UP1   0x0002
2690 #define BSS_BITMASK_UP2   0x0004
2691 #define BSS_BITMASK_UP3   0x0008
2692 #define BSS_BITMASK_UP4   0x0010
2693 #define BSS_BITMASK_UP5   0x0020
2694 #define BSS_BITMASK_UP6   0x0040
2695 #define BSS_BITMASK_UP7   0x0080
2696 #define BSS_BITMASK_AC0   0x0100
2697 #define BSS_BITMASK_AC1   0x0200
2698 #define BSS_BITMASK_AC2   0x0400
2699 #define BSS_BITMASK_AC3   0x0800
2700 #define BSS_BITMASK_RSV   0xF000
2701
2702 static const value_string ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags[] = {
2703   {0x00, "Frames may be transmitted before the channel switch has been completed"},
2704   {0x01, "No more frames are to be transmitted until the channel switch has been completed"},
2705   {0x00, NULL}
2706 };
2707
2708 static const value_string service_interval_granularity_vals[] = {
2709   { 0, "5 ms" },
2710   { 1, "10 ms" },
2711   { 2, "15 ms" },
2712   { 3, "20 ms" },
2713   { 4, "25 ms" },
2714   { 5, "30 ms" },
2715   { 6, "35 ms" },
2716   { 7, "40 ms" },
2717   { 0x00, NULL }
2718 };
2719
2720 static const value_string wep_type_vals[] = {
2721   { AIRPDCAP_KEY_TYPE_WEP, STRING_KEY_TYPE_WEP },
2722   { AIRPDCAP_KEY_TYPE_WPA_PWD, STRING_KEY_TYPE_WPA_PWD },
2723   { AIRPDCAP_KEY_TYPE_WPA_PSK, STRING_KEY_TYPE_WPA_PSK },
2724   { 0x00, NULL }
2725 };
2726
2727 static const value_string ieee80211_ht_pren_type_vals[] = {
2728   { 51,  "HT Capabilities (802.11n D1.10)" },
2729   { 52,  "HT Additional Capabilities (802.11n D1.00)" },
2730   { 0, NULL }
2731 };
2732
2733 static const true_false_string ieee80211_cf_ssw_direction = {
2734   "Transmitted by the beamforming responder",
2735   "Transmitted by the beamforming initiator"
2736 };
2737
2738 static const value_string bss_type[] = {
2739   {0x0, "Reserved"},
2740   {0x1, "IBSS"},
2741   {0x2, "PBSS"},
2742   {0x3, "Infrastructure BSS"},
2743   {0,   NULL}
2744 };
2745
2746 static const value_string band_id[] = {
2747   {0x0, "TV white spaces"},
2748   {0x1, "Sub-1 GHZ (excluding TV white spaces)"},
2749   {0x2, "2.4 GHZ"},
2750   {0x3, "3.6 GHZ"},
2751   {0x4, "4.9 and 5 GHZ"},
2752   {0x5, "60 GHZ"},
2753   {0,   NULL}
2754 };
2755
2756 static const value_string allocation_type[] = {
2757   {0x0, "SP Allocation"},
2758   {0x4, "CBAP allocation"},
2759   {0,   NULL}
2760 };
2761
2762 static const value_string vht_operation_info_channel_width[] = {
2763   {0x00, "20MHz or 40MHz"},
2764   {0x01, "80MHZ"},
2765   {0x10, "160MHz"},
2766   {0x11, "80MHz+80MHz"},
2767   {0, NULL}
2768 };
2769 static const value_string operating_mode_field_channel_width[] = {
2770   {0x00, "20MHz"},
2771   {0x01, "40MHZ"},
2772   {0x02, "80MHz"},
2773   {0x03, "160MHz or 80MHz+80MHz"},
2774   {0, NULL}
2775 };
2776
2777 static const value_string operat_mode_field_rxnss[] = {
2778   {0x0, "1Nss"},
2779   {0x1, "2Nss"},
2780   {0x2, "3Nss"},
2781   {0x3, "4Nss"},
2782   {0x4, "5Nss"},
2783   {0x5, "6Nss"},
2784   {0x6, "7Nss"},
2785   {0x7, "8Nss"},
2786   {0, NULL}
2787 };
2788
2789 #define VHT_ACT_VHT_COMPRESSED_BEAMFORMING  0
2790 #define VHT_ACT_GROUP_ID_MANAGEMENT         1
2791 #define VHT_ACT_OPERATION_MODE_NOTIFICATION 2
2792
2793 static const value_string vht_action_vals[] = {
2794   {VHT_ACT_VHT_COMPRESSED_BEAMFORMING, "VHT Compressed Beamforming"},
2795   {VHT_ACT_GROUP_ID_MANAGEMENT, "Group ID Management"},
2796   {VHT_ACT_OPERATION_MODE_NOTIFICATION, "Operating Mode Notification"},
2797   {0,   NULL}
2798 };
2799
2800 static const value_string ff_vht_mimo_cntrl_nc_index_vals[] = {
2801   {0x00, "1 Column"},
2802   {0x01, "2 Columns"},
2803   {0x02, "3 Columns"},
2804   {0x03, "4 Columns"},
2805   {0x04, "5 Columns"},
2806   {0x05, "6 Columns"},
2807   {0x06, "7 Columns"},
2808   {0x07, "8 Columns"},
2809   {0, NULL}
2810 };
2811
2812 static const value_string ff_vht_mimo_cntrl_nr_index_vals[] = {
2813   {0x00, "1 Row"},
2814   {0x01, "2 Rows"},
2815   {0x02, "3 Rows"},
2816   {0x03, "4 Rows"},
2817   {0x04, "5 Rows"},
2818   {0x05, "6 Rows"},
2819   {0x06, "7 Rows"},
2820   {0x07, "8 Rows"},
2821   {0, NULL}
2822 };
2823
2824 static const value_string ff_vht_mimo_cntrl_channel_width_vals[] = {
2825   {0x00, "20 MHz"},
2826   {0x01, "40 MHz"},
2827   {0x02, "80 MHz"},
2828   {0x03, "160 MHz / 80+80 Mhz"},
2829   {0, NULL}
2830 };
2831
2832 static const value_string ff_vht_mimo_cntrl_grouping_vals[] = {
2833   {0x00, "1 (No Grouping)"},
2834   {0x01, "2"},
2835   {0x02, "4"},
2836   {0x03, "Reserved"},
2837   {0, NULL}
2838 };
2839
2840 static const value_string ff_vht_mimo_cntrl_feedback_vals[] = {
2841   {0x00, "SU"},
2842   {0x01, "MU"},
2843   {0, NULL}
2844 };
2845
2846
2847 static int proto_wlan = -1;
2848 static int proto_centrino = -1;
2849 static int proto_aggregate = -1;
2850 static gboolean ieee80211_tvb_invalid = FALSE;
2851
2852 /* ************************************************************************* */
2853 /*                Header field info values for FC-field                      */
2854 /* ************************************************************************* */
2855 static int hf_ieee80211_fc_field = -1;
2856 static int hf_ieee80211_fc_proto_version = -1;
2857 static int hf_ieee80211_fc_frame_type = -1;
2858 static int hf_ieee80211_fc_frame_subtype = -1;
2859 static int hf_ieee80211_fc_frame_extension = -1;
2860 static int hf_ieee80211_fc_frame_type_subtype = -1;
2861
2862 static int hf_ieee80211_fc_flags = -1;
2863 static int hf_ieee80211_fc_to_ds = -1;
2864 static int hf_ieee80211_fc_from_ds = -1;
2865 static int hf_ieee80211_fc_data_ds = -1;
2866
2867 static int hf_ieee80211_fc_more_frag = -1;
2868 static int hf_ieee80211_fc_retry = -1;
2869 static int hf_ieee80211_fc_pwr_mgt = -1;
2870 static int hf_ieee80211_fc_more_data = -1;
2871 static int hf_ieee80211_fc_protected = -1;
2872 static int hf_ieee80211_fc_order = -1;
2873
2874 typedef struct retransmit_key {
2875   guint8  bssid[6];
2876   guint8  src[6];
2877   guint16 seq_control;
2878   guint   fnum;
2879 } retransmit_key;
2880
2881 static GHashTable *fc_analyse_retransmit_table = NULL;
2882 static GHashTable *fc_first_frame_table = NULL;
2883
2884 static int hf_ieee80211_fc_analysis_retransmission = -1;
2885 static int hf_ieee80211_fc_analysis_retransmission_frame = -1;
2886
2887 /* ************************************************************************* */
2888 /*                   Header values for Duration/ID field                     */
2889 /* ************************************************************************* */
2890 static int hf_ieee80211_did_duration = -1;
2891 static int hf_ieee80211_assoc_id = -1;
2892
2893 /* ************************************************************************* */
2894 /*         Header values for different address-fields (all 4 of them)        */
2895 /* ************************************************************************* */
2896 static int hf_ieee80211_addr_da = -1;  /* Destination address subfield */
2897 static int hf_ieee80211_addr_da_resolved = -1;  /* Dst addr subfield resolved*/
2898 static int hf_ieee80211_addr_sa = -1;  /* Source address subfield */
2899 static int hf_ieee80211_addr_sa_resolved = -1;  /* Src addr subfield resolved*/
2900 static int hf_ieee80211_addr_ra = -1;  /* Receiver address subfield */
2901 static int hf_ieee80211_addr_ra_resolved = -1;  /* Rcv addr subfield resolved*/
2902 static int hf_ieee80211_addr_ta = -1;  /* Transmitter address subfield */
2903 static int hf_ieee80211_addr_ta_resolved = -1;  /* Txm addr subfield resolved*/
2904 static int hf_ieee80211_addr_bssid = -1;  /* address is bssid */
2905 static int hf_ieee80211_addr_bssid_resolved = -1;  /* bssid resolved*/
2906 static int hf_ieee80211_addr_staa = -1;  /* address is station address */
2907 static int hf_ieee80211_addr_staa_resolved = -1;  /* station address resolved*/
2908
2909 static int hf_ieee80211_addr = -1;  /* Source or destination address subfield */
2910 static int hf_ieee80211_addr_resolved = -1;/*Src/dst address subfield resolved*/
2911
2912 /* ************************************************************************* */
2913 /*                Header values for QoS control field                        */
2914 /* ************************************************************************* */
2915 static int hf_ieee80211_qos = -1;
2916 static int hf_ieee80211_qos_tid = -1;
2917 static int hf_ieee80211_qos_priority = -1;
2918 static int hf_ieee80211_qos_ack_policy = -1;
2919 static int hf_ieee80211_qos_amsdu_present = -1;
2920 static int hf_ieee80211_qos_eosp = -1;
2921 static int hf_ieee80211_qos_bit4 = -1;
2922 static int hf_ieee80211_qos_txop_limit = -1;
2923 static int hf_ieee80211_qos_ps_buf_state = -1;
2924 static int hf_ieee80211_qos_buf_state_indicated = -1;
2925 static int hf_ieee80211_qos_highest_pri_buf_ac = -1;
2926 static int hf_ieee80211_qos_qap_buf_load = -1;
2927 static int hf_ieee80211_qos_txop_dur_req = -1;
2928 static int hf_ieee80211_qos_queue_size = -1;
2929
2930 /* ************************************************************************* */
2931 /*                Header values for HT control field (+HTC)                  */
2932 /* ************************************************************************* */
2933 /* 802.11-2012 and 802.11ac-2013 8.2.4.6 */
2934 static int hf_ieee80211_htc = -1;
2935 static int hf_ieee80211_htc_vht = -1;
2936 static int hf_ieee80211_htc_lac = -1;
2937 static int hf_ieee80211_htc_lac_trq = -1;
2938 static int hf_ieee80211_htc_lac_mai_aseli = -1;
2939 static int hf_ieee80211_htc_lac_mai_mrq = -1;
2940 static int hf_ieee80211_htc_lac_mai_msi = -1;
2941 static int hf_ieee80211_htc_lac_mai_reserved = -1;
2942 static int hf_ieee80211_htc_lac_mfsi = -1;
2943 static int hf_ieee80211_htc_lac_mfb = -1;
2944 static int hf_ieee80211_htc_lac_asel_command = -1;
2945 static int hf_ieee80211_htc_lac_asel_data = -1;
2946 static int hf_ieee80211_htc_cal_pos = -1;
2947 static int hf_ieee80211_htc_cal_seq = -1;
2948 static int hf_ieee80211_htc_reserved1 = -1;
2949 static int hf_ieee80211_htc_csi_steering = -1;
2950 static int hf_ieee80211_htc_ndp_announcement = -1;
2951 static int hf_ieee80211_htc_reserved2 = -1;
2952 static int hf_ieee80211_htc_mrq = -1;
2953 static int hf_ieee80211_htc_msi = -1;
2954 static int hf_ieee80211_htc_msi_stbc_reserved = -1;
2955 static int hf_ieee80211_htc_compressed_msi = -1;
2956 static int hf_ieee80211_htc_ppdu_stbc_encoded = -1;
2957 static int hf_ieee80211_htc_mfsi = -1;
2958 static int hf_ieee80211_htc_gid_l = -1;
2959 static int hf_ieee80211_htc_mfb = -1;
2960 static int hf_ieee80211_htc_num_sts = -1;
2961 static int hf_ieee80211_htc_vht_mcs = -1;
2962 static int hf_ieee80211_htc_bw = -1;
2963 static int hf_ieee80211_htc_snr = -1;
2964 static int hf_ieee80211_htc_reserved3 = -1;
2965 static int hf_ieee80211_htc_gid_h = -1;
2966 static int hf_ieee80211_htc_coding_type = -1;
2967 static int hf_ieee80211_htc_fb_tx_type = -1;
2968 static int hf_ieee80211_htc_unsolicited_mfb = -1;
2969 static int hf_ieee80211_htc_ac_constraint = -1;
2970 static int hf_ieee80211_htc_rdg_more_ppdu = -1;
2971
2972 /* ************************************************************************* */
2973 /*                Header values for sequence number field                    */
2974 /* ************************************************************************* */
2975 static int hf_ieee80211_frag_number = -1;
2976 static int hf_ieee80211_seq_number = -1;
2977
2978 /* ************************************************************************* */
2979 /*                   Header values for Frame Check field                     */
2980 /* ************************************************************************* */
2981 static int hf_ieee80211_fcs = -1;
2982 static int hf_ieee80211_fcs_status = -1;
2983
2984 /* ************************************************************************* */
2985 /*                   Header values for reassembly                            */
2986 /* ************************************************************************* */
2987 static int hf_ieee80211_fragments = -1;
2988 static int hf_ieee80211_fragment = -1;
2989 static int hf_ieee80211_fragment_overlap = -1;
2990 static int hf_ieee80211_fragment_overlap_conflict = -1;
2991 static int hf_ieee80211_fragment_multiple_tails = -1;
2992 static int hf_ieee80211_fragment_too_long_fragment = -1;
2993 static int hf_ieee80211_fragment_error = -1;
2994 static int hf_ieee80211_fragment_count = -1;
2995 static int hf_ieee80211_reassembled_in = -1;
2996 static int hf_ieee80211_reassembled_length = -1;
2997
2998 static int proto_wlan_ext = -1;
2999
3000 /* ************************************************************************* */
3001 /*                      Fixed fields found in mgt frames                     */
3002 /* ************************************************************************* */
3003 static int hf_ieee80211_fixed_parameters = -1;  /* Protocol payload for management frames */
3004
3005 static int hf_ieee80211_ff_auth_alg = -1;            /* Authentication algorithm field            */
3006 static int hf_ieee80211_ff_auth_seq = -1;            /* Authentication transaction sequence       */
3007 static int hf_ieee80211_ff_current_ap = -1;          /* Current AP MAC address                    */
3008 static int hf_ieee80211_ff_listen_ival = -1;         /* Listen interval fixed field               */
3009 static int hf_ieee80211_ff_timestamp = -1;           /* 64 bit timestamp                          */
3010 static int hf_ieee80211_ff_beacon_interval = -1;     /* 16 bit Beacon interval                    */
3011 static int hf_ieee80211_ff_assoc_id = -1;            /* 16 bit AID field                          */
3012 static int hf_ieee80211_ff_reason = -1;              /* 16 bit reason code                        */
3013 static int hf_ieee80211_ff_status_code = -1;         /* Status code                               */
3014 static int hf_ieee80211_ff_category_code = -1;       /* 8 bit Category code */
3015 static int hf_ieee80211_ff_action_code = -1;         /* 8 bit Action code */
3016 static int hf_ieee80211_ff_dialog_token = -1;        /* 8 bit Dialog token */
3017 static int hf_ieee80211_ff_followup_dialog_token = -1;
3018 static int hf_ieee80211_ff_wme_action_code = -1;     /* Management notification action code */
3019 static int hf_ieee80211_ff_wme_status_code = -1;     /* Management notification setup response status code */
3020 static int hf_ieee80211_ff_qos_action_code = -1;
3021 static int hf_ieee80211_ff_dls_action_code = -1;
3022 static int hf_ieee80211_ff_dst_mac_addr = -1;        /* DLS destination MAC addressi */
3023 static int hf_ieee80211_ff_src_mac_addr = -1;        /* DLS source MAC addressi */
3024 static int hf_ieee80211_ff_req_ap_addr = -1;
3025 static int hf_ieee80211_ff_res_ap_addr = -1;
3026 static int hf_ieee80211_ff_check_beacon = -1;
3027 static int hf_ieee80211_ff_dls_timeout = -1;         /* DLS timeout value */
3028 static int hf_ieee80211_ff_ft_action_code = -1; /* 8 bit FT Action code */
3029 static int hf_ieee80211_ff_sta_address = -1;
3030 static int hf_ieee80211_ff_target_ap_address = -1;
3031 static int hf_ieee80211_ff_gas_comeback_delay = -1;
3032 static int hf_ieee80211_ff_gas_fragment_id = -1;
3033 static int hf_ieee80211_ff_more_gas_fragments = -1;
3034 static int hf_ieee80211_ff_query_request_length = -1;
3035 static int hf_ieee80211_ff_query_request = -1;
3036 static int hf_ieee80211_ff_query_response_length = -1;
3037 static int hf_ieee80211_ff_query_response = -1;
3038 static int hf_ieee80211_ff_anqp_info_id = -1;
3039 static int hf_ieee80211_ff_anqp_info_length = -1;
3040 static int hf_ieee80211_ff_anqp_info = -1;
3041 static int hf_ieee80211_ff_anqp_query_id = -1;
3042 static int hf_ieee80211_ff_anqp_capability = -1;
3043 static int hf_ieee80211_ff_anqp_capability_vlen = -1;
3044 static int hf_ieee80211_ff_anqp_capability_vendor = -1;
3045 static int hf_ieee80211_ff_venue_info_group = -1;
3046 static int hf_ieee80211_ff_venue_info_type = -1;
3047 static int hf_ieee80211_ff_anqp_venue_length = -1;
3048 static int hf_ieee80211_ff_anqp_venue_language = -1;
3049 static int hf_ieee80211_ff_anqp_venue_name = -1;
3050 static int hf_ieee80211_ff_anqp_nw_auth_type_indicator = -1;
3051 static int hf_ieee80211_ff_anqp_nw_auth_type_url_len = -1;
3052 static int hf_ieee80211_ff_anqp_nw_auth_type_url = -1;
3053 static int hf_ieee80211_ff_anqp_roaming_consortium_oi_len = -1;
3054 static int hf_ieee80211_ff_anqp_roaming_consortium_oi = -1;
3055 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv6 = -1;
3056 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv4 = -1;
3057 static int hf_ieee80211_ff_anqp_nai_realm_count = -1;
3058 static int hf_ieee80211_ff_anqp_nai_field_len = -1;
3059 static int hf_ieee80211_ff_anqp_nai_realm_encoding = -1;
3060 static int hf_ieee80211_ff_anqp_nai_realm_length = -1;
3061 static int hf_ieee80211_ff_anqp_nai_realm = -1;
3062 static int hf_ieee80211_ff_anqp_nai_realm_eap_count = -1;
3063 static int hf_ieee80211_ff_anqp_nai_realm_eap_len = -1;
3064 static int hf_ieee80211_ff_anqp_nai_realm_eap_method = -1;
3065 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_count = -1;
3066 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_id = -1;
3067 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_len = -1;
3068 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_value = -1;
3069 static int hf_ieee80211_3gpp_gc_gud = -1;
3070 static int hf_ieee80211_3gpp_gc_udhl = -1;
3071 static int hf_ieee80211_3gpp_gc_iei = -1;
3072 static int hf_ieee80211_3gpp_gc_num_plmns = -1;
3073 static int hf_ieee80211_3gpp_gc_plmn_len = -1;
3074 static int hf_ieee80211_ff_anqp_domain_name_len = -1;
3075 static int hf_ieee80211_ff_anqp_domain_name = -1;
3076 static int hf_ieee80211_ff_tdls_action_code = -1;
3077 static int hf_ieee80211_ff_target_channel = -1;
3078 static int hf_ieee80211_ff_operating_class = -1;
3079 static int hf_ieee80211_ff_wnm_action_code = -1;
3080 static int hf_ieee80211_ff_unprotected_wnm_action_code = -1;
3081 static int hf_ieee80211_ff_key_data_length = -1;
3082 static int hf_ieee80211_ff_key_data = -1;
3083 static int hf_ieee80211_ff_wnm_notification_type = -1;
3084 static int hf_ieee80211_ff_rm_action_code = -1;
3085 static int hf_ieee80211_ff_rm_dialog_token = -1;
3086 static int hf_ieee80211_ff_rm_repetitions = -1;
3087 static int hf_ieee80211_ff_rm_tx_power = -1;
3088 static int hf_ieee80211_ff_rm_max_tx_power = -1;
3089 static int hf_ieee80211_ff_tpc = -1;
3090 static int hf_ieee80211_ff_tpc_element_id = -1;
3091 static int hf_ieee80211_ff_tpc_length = -1;
3092 static int hf_ieee80211_ff_tpc_tx_power = -1;
3093 static int hf_ieee80211_ff_tpc_link_margin = -1;
3094 static int hf_ieee80211_ff_rm_rx_antenna_id = -1;
3095 static int hf_ieee80211_ff_rm_tx_antenna_id = -1;
3096 static int hf_ieee80211_ff_rm_rcpi = -1;
3097 static int hf_ieee80211_ff_rm_rsni = -1;
3098 static int hf_ieee80211_ff_request_mode_pref_cand = -1;
3099 static int hf_ieee80211_ff_request_mode_abridged = -1;
3100 static int hf_ieee80211_ff_request_mode_disassoc_imminent = -1;
3101 static int hf_ieee80211_ff_request_mode_bss_term_included = -1;
3102 static int hf_ieee80211_ff_request_mode_ess_disassoc_imminent = -1;
3103 static int hf_ieee80211_ff_disassoc_timer = -1;
3104 static int hf_ieee80211_ff_validity_interval = -1;
3105 static int hf_ieee80211_ff_bss_termination_duration = -1;
3106 static int hf_ieee80211_ff_url_len = -1;
3107 static int hf_ieee80211_ff_url = -1;
3108 static int hf_ieee80211_ff_target_bss = -1;
3109 static int hf_ieee80211_ff_bss_transition_status_code = -1;
3110 static int hf_ieee80211_ff_bss_termination_delay = -1;
3111 static int hf_ieee80211_ff_bss_transition_candidate_list_entries = -1;
3112
3113 static int hf_ieee80211_ff_sa_query_action_code = -1;
3114 static int hf_ieee80211_ff_transaction_id = -1;
3115
3116 /* Vendor specific */
3117 static int hf_ieee80211_ff_marvell_action_type = -1;
3118 static int hf_ieee80211_ff_marvell_mesh_mgt_action_code = -1;
3119 static int hf_ieee80211_ff_marvell_mesh_mgt_length = -1;     /* Mesh Management length */
3120 static int hf_ieee80211_ff_marvell_mesh_mgt_mode = -1;       /* Mesh Management mode */
3121 static int hf_ieee80211_ff_marvell_mesh_mgt_ttl = -1;        /* Mesh Management TTL */
3122 static int hf_ieee80211_ff_marvell_mesh_mgt_dstcount = -1;   /* Mesh Management dst count */
3123 static int hf_ieee80211_ff_marvell_mesh_mgt_hopcount = -1;   /* Mesh Management hop count */
3124 static int hf_ieee80211_ff_marvell_mesh_mgt_rreqid = -1;     /* Mesh Management RREQ ID */
3125 static int hf_ieee80211_ff_marvell_mesh_mgt_sa = -1;         /* Mesh Management src addr */
3126 static int hf_ieee80211_ff_marvell_mesh_mgt_ssn = -1;        /* Mesh Management src sequence number */
3127 static int hf_ieee80211_ff_marvell_mesh_mgt_metric = -1;     /* Mesh Management metric */
3128 static int hf_ieee80211_ff_marvell_mesh_mgt_flags = -1;      /* Mesh Management RREQ flags */
3129 static int hf_ieee80211_ff_marvell_mesh_mgt_da = -1;         /* Mesh Management dst addr */
3130 static int hf_ieee80211_ff_marvell_mesh_mgt_dsn = -1;        /* Mesh Management dst sequence number */
3131 static int hf_ieee80211_ff_marvell_mesh_mgt_lifetime = -1;   /* Mesh Management lifetime */
3132
3133
3134 static int hf_ieee80211_ff_ba_action = -1;
3135
3136 static int hf_ieee80211_ff_block_ack_params = -1;
3137 static int hf_ieee80211_ff_block_ack_params_amsdu_permitted = -1;
3138 static int hf_ieee80211_ff_block_ack_params_policy = -1;
3139 static int hf_ieee80211_ff_block_ack_params_tid = -1;
3140 static int hf_ieee80211_ff_block_ack_params_buffer_size = -1;
3141
3142 static const int *ieee80211_ff_block_ack_params_fields[] = {
3143   &hf_ieee80211_ff_block_ack_params_amsdu_permitted,
3144   &hf_ieee80211_ff_block_ack_params_policy,
3145   &hf_ieee80211_ff_block_ack_params_tid,
3146   &hf_ieee80211_ff_block_ack_params_buffer_size,
3147   NULL
3148 };
3149
3150 static int hf_ieee80211_ff_block_ack_timeout = -1;
3151
3152 static int hf_ieee80211_ff_block_ack_ssc = -1;
3153 static int hf_ieee80211_ff_block_ack_ssc_fragment = -1;
3154 static int hf_ieee80211_ff_block_ack_ssc_sequence = -1;
3155
3156 static const int *ieee80211_ff_block_ack_ssc_fields[] = {
3157   &hf_ieee80211_ff_block_ack_ssc_fragment,
3158   &hf_ieee80211_ff_block_ack_ssc_sequence,
3159   NULL
3160 };
3161
3162 static int hf_ieee80211_ff_delba_param = -1;
3163 static int hf_ieee80211_ff_delba_param_reserved = -1;
3164 static int hf_ieee80211_ff_delba_param_init = -1;
3165 static int hf_ieee80211_ff_delba_param_tid = -1;
3166
3167 static const int *ieee80211_ff_delba_param_fields[] = {
3168   &hf_ieee80211_ff_delba_param_reserved,
3169   &hf_ieee80211_ff_delba_param_init,
3170   &hf_ieee80211_ff_delba_param_tid,
3171   NULL
3172 };
3173
3174 static int hf_ieee80211_ff_max_reg_pwr = -1;
3175 static int hf_ieee80211_ff_measurement_pilot_int = -1;
3176 static int hf_ieee80211_ff_country_str = -1;
3177 static int hf_ieee80211_ff_max_tx_pwr = -1;
3178 static int hf_ieee80211_ff_tx_pwr_used = -1;
3179 static int hf_ieee80211_ff_transceiver_noise_floor = -1;
3180 static int hf_ieee80211_ff_channel_width = -1;
3181
3182 static int hf_ieee80211_ff_qos_info_ap = -1;
3183 static int hf_ieee80211_ff_qos_info_ap_edca_param_set_counter = -1;
3184 static int hf_ieee80211_ff_qos_info_ap_q_ack = -1;
3185 static int hf_ieee80211_ff_qos_info_ap_queue_req = -1;
3186 static int hf_ieee80211_ff_qos_info_ap_txop_request = -1;
3187 static int hf_ieee80211_ff_qos_info_ap_reserved = -1;
3188
3189 static const int *ieee80211_ff_qos_info_ap_fields[] = {
3190   &hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
3191   &hf_ieee80211_ff_qos_info_ap_q_ack,
3192   &hf_ieee80211_ff_qos_info_ap_queue_req,
3193   &hf_ieee80211_ff_qos_info_ap_txop_request,
3194   &hf_ieee80211_ff_qos_info_ap_reserved,
3195   NULL
3196 };
3197
3198 static int hf_ieee80211_ff_qos_info_sta = -1;
3199 static int hf_ieee80211_ff_qos_info_sta_ac_vo = -1;
3200 static int hf_ieee80211_ff_qos_info_sta_ac_vi = -1;
3201 static int hf_ieee80211_ff_qos_info_sta_ac_bk = -1;
3202 static int hf_ieee80211_ff_qos_info_sta_ac_be = -1;
3203 static int hf_ieee80211_ff_qos_info_sta_q_ack = -1;
3204 static int hf_ieee80211_ff_qos_info_sta_max_sp_length = -1;
3205 static int hf_ieee80211_ff_qos_info_sta_more_data_ack = -1;
3206
3207 static const int *ieee80211_ff_qos_info_sta_fields[] = {
3208   &hf_ieee80211_ff_qos_info_sta_ac_vo,
3209   &hf_ieee80211_ff_qos_info_sta_ac_vi,
3210   &hf_ieee80211_ff_qos_info_sta_ac_bk,
3211   &hf_ieee80211_ff_qos_info_sta_ac_be,
3212   &hf_ieee80211_ff_qos_info_sta_q_ack,
3213   &hf_ieee80211_ff_qos_info_sta_max_sp_length,
3214   &hf_ieee80211_ff_qos_info_sta_more_data_ack,
3215   NULL
3216 };
3217
3218 static int hf_ieee80211_ff_sm_pwr_save = -1;
3219 static int hf_ieee80211_ff_sm_pwr_save_enabled = -1;
3220 static int hf_ieee80211_ff_sm_pwr_save_sm_mode = -1;
3221 static int hf_ieee80211_ff_sm_pwr_save_reserved = -1;
3222
3223 static const int *ieee80211_ff_sw_pwr_save_fields[] = {
3224   &hf_ieee80211_ff_sm_pwr_save_enabled,
3225   &hf_ieee80211_ff_sm_pwr_save_sm_mode,
3226   &hf_ieee80211_ff_sm_pwr_save_reserved,
3227   NULL
3228 };
3229
3230 static int hf_ieee80211_ff_pco_phase_cntrl = -1;
3231
3232 static int hf_ieee80211_ff_psmp_param_set = -1;
3233 static int hf_ieee80211_ff_psmp_param_set_n_sta = -1;
3234 static int hf_ieee80211_ff_psmp_param_set_more_psmp = -1;
3235 static int hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration = -1;
3236
3237 static const int *ieee80211_ff_psmp_param_set_fields[] = {
3238   &hf_ieee80211_ff_psmp_param_set_n_sta,
3239   &hf_ieee80211_ff_psmp_param_set_more_psmp,
3240   &hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
3241   NULL
3242 };
3243
3244 static int hf_ieee80211_ff_mimo_cntrl = -1;
3245 static int hf_ieee80211_ff_mimo_cntrl_nc_index = -1;
3246 static int hf_ieee80211_ff_mimo_cntrl_nr_index = -1;
3247 static int hf_ieee80211_ff_mimo_cntrl_channel_width = -1;
3248 static int hf_ieee80211_ff_mimo_cntrl_grouping = -1;
3249 static int hf_ieee80211_ff_mimo_cntrl_coefficient_size = -1;
3250 static int hf_ieee80211_ff_mimo_cntrl_codebook_info = -1;
3251 static int hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment = -1;
3252 static int hf_ieee80211_ff_mimo_cntrl_reserved = -1;
3253 static int hf_ieee80211_ff_mimo_cntrl_sounding_timestamp = -1;
3254
3255 static int hf_ieee80211_ff_ant_selection = -1;
3256 static int hf_ieee80211_ff_ant_selection_0 = -1;
3257 static int hf_ieee80211_ff_ant_selection_1 = -1;
3258 static int hf_ieee80211_ff_ant_selection_2 = -1;
3259 static int hf_ieee80211_ff_ant_selection_3 = -1;
3260 static int hf_ieee80211_ff_ant_selection_4 = -1;
3261 static int hf_ieee80211_ff_ant_selection_5 = -1;
3262 static int hf_ieee80211_ff_ant_selection_6 = -1;
3263 static int hf_ieee80211_ff_ant_selection_7 = -1;
3264
3265 static const int *ieee80211_ff_ant_selection_fields[] = {
3266   &hf_ieee80211_ff_ant_selection_0,
3267   &hf_ieee80211_ff_ant_selection_1,
3268   &hf_ieee80211_ff_ant_selection_2,
3269   &hf_ieee80211_ff_ant_selection_3,
3270   &hf_ieee80211_ff_ant_selection_4,
3271   &hf_ieee80211_ff_ant_selection_5,
3272   &hf_ieee80211_ff_ant_selection_6,
3273   &hf_ieee80211_ff_ant_selection_7,
3274   NULL
3275 };
3276
3277 static int hf_ieee80211_ff_ext_channel_switch_announcement = -1;
3278 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode = -1;
3279 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class = -1;
3280 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number = -1;
3281 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_count = -1;
3282
3283 static const int *ieee80211_ff_ext_channel_switch_announcement_fields[] = {
3284   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
3285   &hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
3286   &hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
3287   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
3288   NULL
3289 };
3290
3291 static int hf_ieee80211_ff_ht_info = -1;
3292 static int hf_ieee80211_ff_ht_info_information_request = -1;
3293 static int hf_ieee80211_ff_ht_info_40_mhz_intolerant = -1;
3294 static int hf_ieee80211_ff_ht_info_sta_chan_width = -1;
3295 static int hf_ieee80211_ff_ht_info_reserved = -1;
3296
3297 static const int *ieee80211_ff_ht_info_fields[] = {
3298   &hf_ieee80211_ff_ht_info_information_request,
3299   &hf_ieee80211_ff_ht_info_40_mhz_intolerant,
3300   &hf_ieee80211_ff_ht_info_sta_chan_width,
3301   &hf_ieee80211_ff_ht_info_reserved,
3302   NULL
3303 };
3304
3305 static int hf_ieee80211_ff_ht_action = -1;
3306
3307 static int hf_ieee80211_ff_psmp_sta_info = -1;
3308 static int hf_ieee80211_ff_psmp_sta_info_type = -1;
3309 static int hf_ieee80211_ff_psmp_sta_info_dtt_start_offset = -1;
3310 static int hf_ieee80211_ff_psmp_sta_info_dtt_duration = -1;
3311 static int hf_ieee80211_ff_psmp_sta_info_sta_id = -1;
3312 static int hf_ieee80211_ff_psmp_sta_info_utt_start_offset = -1;
3313 static int hf_ieee80211_ff_psmp_sta_info_utt_duration = -1;
3314 static int hf_ieee80211_ff_psmp_sta_info_reserved_small= -1;
3315 static int hf_ieee80211_ff_psmp_sta_info_reserved_large = -1;
3316 static int hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id = -1;
3317
3318 static int hf_ieee80211_ff_mimo_csi_snr = -1;
3319 static int hf_ieee80211_ff_mimo_csi_matrices = -1;
3320 static int hf_ieee80211_ff_mimo_csi_bf_matrices = -1;
3321 static int hf_ieee80211_ff_mimo_csi_cbf_matrices = -1;
3322
3323 /*** Begin: 802.11s additions ***/
3324 static int hf_ieee80211_mesh_control_field = -1;
3325
3326 static int hf_ieee80211_ff_mesh_action = -1;
3327 static int hf_ieee80211_ff_multihop_action = -1;
3328 static int hf_ieee80211_ff_mesh_flags = -1;
3329 static int hf_ieee80211_ff_mesh_ttl = -1;
3330 static int hf_ieee80211_ff_mesh_sequence = -1;
3331 static int hf_ieee80211_ff_mesh_addr4 = -1;
3332 static int hf_ieee80211_ff_mesh_addr5 = -1;
3333 static int hf_ieee80211_ff_mesh_addr6 = -1;
3334 static int hf_ieee80211_ff_selfprot_action = -1;
3335
3336 static int hf_ieee80211_mesh_peering_proto = -1;
3337 static int hf_ieee80211_mesh_peering_local_link_id = -1;
3338 static int hf_ieee80211_mesh_peering_peer_link_id = -1;
3339
3340 static int hf_ieee80211_ff_hwmp_flags = -1;
3341 static int hf_ieee80211_ff_hwmp_hopcount = -1;
3342 static int hf_ieee80211_ff_hwmp_ttl = -1;
3343 static int hf_ieee80211_ff_hwmp_pdid = -1;
3344 static int hf_ieee80211_ff_hwmp_orig_sta = -1;
3345 static int hf_ieee80211_ff_hwmp_orig_sn = -1;
3346 static int hf_ieee80211_ff_hwmp_orig_ext = -1;
3347 static int hf_ieee80211_ff_hwmp_lifetime = -1;
3348 static int hf_ieee80211_ff_hwmp_metric = -1;
3349 static int hf_ieee80211_ff_hwmp_targ_count = -1;
3350 static int hf_ieee80211_ff_hwmp_targ_flags = -1;
3351 static int hf_ieee80211_ff_hwmp_targ_to_flags = -1;
3352 static int hf_ieee80211_ff_hwmp_targ_usn_flags = -1;
3353 static int hf_ieee80211_ff_hwmp_targ_sta = -1;
3354 static int hf_ieee80211_ff_hwmp_targ_sn = -1;
3355 static int hf_ieee80211_ff_hwmp_targ_ext = -1;
3356 static int hf_ieee80211_rann_flags = -1;
3357 static int hf_ieee80211_rann_root_sta = -1;
3358 static int hf_ieee80211_rann_sn = -1;
3359 static int hf_ieee80211_rann_interval = -1;
3360
3361 static int hf_ieee80211_mesh_channel_switch_ttl = -1;
3362 static int hf_ieee80211_mesh_channel_switch_flag = -1;
3363 static int hf_ieee80211_mesh_channel_switch_reason_code = -1;
3364 static int hf_ieee80211_mesh_channel_switch_precedence_value = -1;
3365 static int hf_ieee80211_mesh_chswitch_flag_txrestrict = -1;
3366 static int hf_ieee80211_mesh_chswitch_flag_initiator = -1;
3367
3368 static int hf_ieee80211_mesh_config_path_sel_protocol = -1;
3369 static int hf_ieee80211_mesh_config_path_sel_metric = -1;
3370 static int hf_ieee80211_mesh_config_congestion_control = -1;
3371 static int hf_ieee80211_mesh_config_sync_method = -1;
3372 static int hf_ieee80211_mesh_config_auth_protocol = -1;
3373 static int hf_ieee80211_mesh_config_formation_info = -1;
3374 static int hf_ieee80211_mesh_config_capability = -1;
3375 static int hf_ieee80211_mesh_id = -1;
3376 static int hf_ieee80211_mesh_config_cap_accepting = -1;
3377 static int hf_ieee80211_mesh_config_cap_mcca_support = -1;
3378 static int hf_ieee80211_mesh_config_cap_mcca_enabled = -1;
3379 static int hf_ieee80211_mesh_config_cap_forwarding = -1;
3380 static int hf_ieee80211_mesh_config_cap_mbca_enabled = -1;
3381 static int hf_ieee80211_mesh_config_cap_tbtt_adjusting = -1;
3382 static int hf_ieee80211_mesh_config_cap_power_save_level = -1;
3383 static int hf_ieee80211_mesh_form_info_num_of_peerings = -1;
3384
3385 static int hf_ieee80211_ff_public_action = -1;
3386 static int hf_ieee80211_ff_protected_public_action = -1;
3387 static int hf_ieee80211_ff_tod = -1;
3388 static int hf_ieee80211_ff_toa = -1;
3389 static int hf_ieee80211_ff_max_tod_err = -1;
3390 static int hf_ieee80211_ff_max_toa_err = -1;
3391
3392 /* ************************************************************************* */
3393 /*            Flags found in the capability field (fixed field)              */
3394 /* ************************************************************************* */
3395 static int hf_ieee80211_ff_capture = -1;
3396 static int hf_ieee80211_ff_cf_ess = -1;
3397 static int hf_ieee80211_ff_cf_ibss = -1;
3398 static int hf_ieee80211_ff_cf_sta_poll = -1; /* CF pollable status for a STA            */
3399 static int hf_ieee80211_ff_cf_ap_poll = -1;  /* CF pollable status for an AP            */
3400 static int hf_ieee80211_ff_cf_privacy = -1;
3401 static int hf_ieee80211_ff_cf_preamble = -1;
3402 static int hf_ieee80211_ff_cf_pbcc = -1;
3403 static int hf_ieee80211_ff_cf_agility = -1;
3404 static int hf_ieee80211_ff_short_slot_time = -1;
3405 static int hf_ieee80211_ff_dsss_ofdm = -1;
3406 static int hf_ieee80211_ff_cf_spec_man = -1;
3407 static int hf_ieee80211_ff_cf_apsd = -1;
3408 static int hf_ieee80211_ff_radio_measurement = -1;
3409 static int hf_ieee80211_ff_cf_del_blk_ack = -1;
3410 static int hf_ieee80211_ff_cf_imm_blk_ack = -1;
3411
3412 /* ************************************************************************* */
3413 /*                       A-MSDU fields                                       */
3414 /* ************************************************************************* */
3415 static int hf_ieee80211_amsdu_subframe = -1;
3416 static int hf_ieee80211_amsdu_length = -1;
3417
3418 /* ************************************************************************* */
3419 /*                       Tagged value format fields                          */
3420 /* ************************************************************************* */
3421 static int hf_ieee80211_tagged_parameters = -1;  /* Tagged payload item */
3422 static int hf_ieee80211_tag = -1;
3423 static int hf_ieee80211_tag_number = -1;
3424 static int hf_ieee80211_tag_length = -1;
3425 static int hf_ieee80211_tag_interpretation = -1;
3426 static int hf_ieee80211_tag_data = -1;
3427 static int hf_ieee80211_tag_oui = -1;
3428 static int hf_ieee80211_tag_oui_wfa_subtype = -1;
3429 static int hf_ieee80211_tag_ssid = -1;
3430 static int hf_ieee80211_tag_supp_rates = -1;
3431 static int hf_ieee80211_tag_fh_dwell_time = -1;
3432 static int hf_ieee80211_tag_fh_hop_set = -1;
3433 static int hf_ieee80211_tag_fh_hop_pattern = -1;
3434 static int hf_ieee80211_tag_fh_hop_index = -1;
3435 static int hf_ieee80211_tag_ds_param_channel = -1;
3436 static int hf_ieee80211_tag_cfp_count = -1;
3437 static int hf_ieee80211_tag_cfp_period = -1;
3438 static int hf_ieee80211_tag_cfp_max_duration = -1;
3439 static int hf_ieee80211_tag_cfp_dur_remaining = -1;
3440 static int hf_ieee80211_tim_dtim_count = -1;
3441 static int hf_ieee80211_tim_dtim_period = -1;
3442 static int hf_ieee80211_tim_bmapctl = -1;
3443 static int hf_ieee80211_tim_bmapctl_mcast = -1;
3444 static int hf_ieee80211_tim_bmapctl_offset = -1;
3445 static int hf_ieee80211_tim_partial_virtual_bitmap = -1;
3446 static int hf_ieee80211_tim_aid = -1;
3447 static int hf_ieee80211_tag_ibss_atim_window = -1;
3448 static int hf_ieee80211_tag_country_info_code = -1;
3449 static int hf_ieee80211_tag_country_info_env = -1;
3450 static int hf_ieee80211_tag_country_info_pad = -1;
3451 static int hf_ieee80211_tag_country_info_fnm = -1;
3452 static int hf_ieee80211_tag_country_info_fnm_fcn = -1;
3453 static int hf_ieee80211_tag_country_info_fnm_nc = -1;
3454 static int hf_ieee80211_tag_country_info_fnm_mtpl = -1;
3455 static int hf_ieee80211_tag_country_info_rrc = -1;
3456 static int hf_ieee80211_tag_country_info_rrc_oei = -1;
3457 static int hf_ieee80211_tag_country_info_rrc_oc = -1;
3458 static int hf_ieee80211_tag_country_info_rrc_cc = -1;
3459 static int hf_ieee80211_tag_fh_hopping_parameter_prime_radix = -1;
3460 static int hf_ieee80211_tag_fh_hopping_parameter_nb_channels = -1;
3461 static int hf_ieee80211_tag_fh_hopping_table_flag = -1;
3462 static int hf_ieee80211_tag_fh_hopping_table_number_of_sets = -1;
3463 static int hf_ieee80211_tag_fh_hopping_table_modulus = -1;
3464 static int hf_ieee80211_tag_fh_hopping_table_offset = -1;
3465 static int hf_ieee80211_tag_fh_hopping_random_table = -1;
3466 static int hf_ieee80211_tag_request = -1;
3467 static int hf_ieee80211_tag_challenge_text = -1;
3468
3469 static int hf_ieee80211_wep_iv = -1;
3470 static int hf_ieee80211_wep_iv_weak = -1;
3471 static int hf_ieee80211_tkip_extiv = -1;
3472 static int hf_ieee80211_ccmp_extiv = -1;
3473 static int hf_ieee80211_wep_key = -1;
3474 static int hf_ieee80211_wep_icv = -1;
3475 static int hf_ieee80211_fc_analysis_pmk = -1;
3476 static int hf_ieee80211_fc_analysis_tk = -1;
3477 static int hf_ieee80211_fc_analysis_gtk = -1;
3478
3479 static int hf_ieee80211_block_ack_request_control = -1;
3480 static int hf_ieee80211_block_ack_control = -1;
3481 static int hf_ieee80211_block_ack_control_ack_policy = -1;
3482 static int hf_ieee80211_block_ack_control_multi_tid = -1;
3483 static int hf_ieee80211_block_ack_control_compressed_bitmap = -1;
3484 static int hf_ieee80211_block_ack_control_reserved = -1;
3485
3486 static int hf_ieee80211_block_ack_control_basic_tid_info = -1;
3487 static int hf_ieee80211_block_ack_control_compressed_tid_info = -1;
3488 static int hf_ieee80211_block_ack_control_multi_tid_info = -1;
3489
3490 static int hf_ieee80211_block_ack_multi_tid_info = -1;
3491 static int hf_ieee80211_block_ack_request_type = -1;
3492 static int hf_ieee80211_block_ack_multi_tid_reserved = -1;
3493 static int hf_ieee80211_block_ack_multi_tid_value = -1;
3494 static int hf_ieee80211_block_ack_type = -1;
3495 static int hf_ieee80211_block_ack_bitmap = -1;
3496 static int hf_ieee80211_block_ack_bitmap_missing_frame = -1;
3497
3498 static int hf_ieee80211_tag_measure_request_measurement_mode = -1;
3499 static int hf_ieee80211_tag_measure_request_bssid = -1;
3500
3501 static int hf_ieee80211_tag_measure_request_subelement_length = -1;
3502 static int hf_ieee80211_tag_measure_request_beacon_sub_id = -1;
3503 static int hf_ieee80211_tag_measure_request_beacon_sub_ssid = -1;
3504 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition = -1;
3505 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset = -1;
3506 static int hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail = -1;
3507 static int hf_ieee80211_tag_measure_request_beacon_sub_request = -1;
3508 static int hf_ieee80211_tag_measure_request_beacon_unknown = -1;
3509
3510 static int hf_ieee80211_tag_measure_request_channel_load_sub_id = -1;
3511 static int hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition = -1;
3512 static int hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref = -1;
3513
3514 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_id = -1;
3515 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition = -1;
3516 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref = -1;
3517
3518 static int hf_ieee80211_tag_measure_request_frame_request_type = -1;
3519 static int hf_ieee80211_tag_measure_request_mac_address  = -1;
3520 static int hf_ieee80211_tag_measure_request_peer_mac_address = -1;
3521 static int hf_ieee80211_tag_measure_request_group_id = -1;
3522
3523 static int hf_ieee80211_tag_measure_request_unknown = -1;
3524
3525 static int hf_ieee80211_ht_pren_type = -1;
3526 static int hf_ieee80211_ht_pren_unknown = -1;
3527
3528 static int hf_ieee80211_ht_cap = -1;
3529 static int hf_ieee80211_ht_vs_cap = -1;
3530 static int hf_ieee80211_ht_ldpc_coding = -1;
3531 static int hf_ieee80211_ht_chan_width = -1;
3532 static int hf_ieee80211_ht_sm_pwsave = -1;
3533 static int hf_ieee80211_ht_green = -1;
3534 static int hf_ieee80211_ht_short20 = -1;
3535 static int hf_ieee80211_ht_short40 = -1;
3536 static int hf_ieee80211_ht_tx_stbc = -1;
3537 static int hf_ieee80211_ht_rx_stbc = -1;
3538 static int hf_ieee80211_ht_delayed_block_ack = -1;
3539 static int hf_ieee80211_ht_max_amsdu = -1;
3540 static int hf_ieee80211_ht_dss_cck_40 = -1;
3541 static int hf_ieee80211_ht_psmp = -1;
3542 static int hf_ieee80211_ht_40_mhz_intolerant = -1;
3543 static int hf_ieee80211_ht_l_sig = -1;
3544
3545 static int hf_ieee80211_ext_bss_mu_mimo_capable_sta_count = -1;
3546 static int hf_ieee80211_ext_bss_ss_underutilization = -1;
3547 static int hf_ieee80211_ext_bss_observable_sec_20mhz_utilization = -1;
3548 static int hf_ieee80211_ext_bss_observable_sec_40mhz_utilization = -1;
3549 static int hf_ieee80211_ext_bss_observable_sec_80mhz_utilization = -1;
3550 static int hf_ieee80211_wide_bw_new_channel_width = -1;
3551 static int hf_ieee80211_wide_bw_new_channel_center_freq_segment0 = -1;
3552 static int hf_ieee80211_wide_bw_new_channel_center_freq_segment1 = -1;
3553
3554 static int hf_ieee80211_operat_notification_mode = -1;
3555 static int hf_ieee80211_operat_mode_field_channel_width = -1;
3556 static int hf_ieee80211_operat_mode_field_reserved = -1;
3557 static int hf_ieee80211_operat_mode_field_rxnss = -1;
3558 static int hf_ieee80211_operat_mode_field_rxnsstype= -1;
3559 static int hf_ieee80211_ampduparam = -1;
3560 static int hf_ieee80211_ampduparam_vs = -1;
3561 static int hf_ieee80211_ampduparam_mpdu = -1;
3562 static int hf_ieee80211_ampduparam_mpdu_start_spacing = -1;
3563 static int hf_ieee80211_ampduparam_reserved = -1;
3564
3565 static int hf_ieee80211_mcsset = -1;
3566 static int hf_ieee80211_mcsset_vs = -1;
3567 static int hf_ieee80211_mcsset_rx_bitmask = -1;
3568 static int hf_ieee80211_mcsset_rx_bitmask_0to7 = -1;
3569 static int hf_ieee80211_mcsset_rx_bitmask_8to15 = -1;
3570 static int hf_ieee80211_mcsset_rx_bitmask_16to23 = -1;
3571 static int hf_ieee80211_mcsset_rx_bitmask_24to31 = -1;
3572 static int hf_ieee80211_mcsset_rx_bitmask_32 = -1;
3573 static int hf_ieee80211_mcsset_rx_bitmask_33to38 = -1;
3574 static int hf_ieee80211_mcsset_rx_bitmask_39to52 = -1;
3575 static int hf_ieee80211_mcsset_rx_bitmask_53to76 = -1;
3576 static int hf_ieee80211_mcsset_highest_data_rate = -1;
3577 static int hf_ieee80211_mcsset_tx_mcs_set_defined = -1;
3578 static int hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal = -1;
3579 static int hf_ieee80211_mcsset_tx_max_spatial_streams = -1;
3580 static int hf_ieee80211_mcsset_tx_unequal_modulation = -1;
3581
3582 static int hf_ieee80211_htex_cap = -1;
3583 static int hf_ieee80211_htex_vs_cap = -1;
3584 static int hf_ieee80211_htex_pco = -1;
3585 static int hf_ieee80211_htex_transtime = -1;
3586 static int hf_ieee80211_htex_mcs = -1;
3587 static int hf_ieee80211_htex_htc_support = -1;
3588 static int hf_ieee80211_htex_rd_responder = -1;
3589
3590 static int hf_ieee80211_txbf = -1;
3591 static int hf_ieee80211_txbf_vs = -1;
3592 static int hf_ieee80211_txbf_cap = -1;
3593 static int hf_ieee80211_txbf_rcv_ssc = -1;
3594 static int hf_ieee80211_txbf_tx_ssc = -1;
3595 static int hf_ieee80211_txbf_rcv_ndp = -1;
3596 static int hf_ieee80211_txbf_tx_ndp = -1;
3597 static int hf_ieee80211_txbf_impl_txbf = -1;
3598 static int hf_ieee80211_txbf_calib = -1;
3599 static int hf_ieee80211_txbf_expl_csi = -1;
3600 static int hf_ieee80211_txbf_expl_uncomp_fm = -1;
3601 static int hf_ieee80211_txbf_expl_comp_fm = -1;
3602 static int hf_ieee80211_txbf_expl_bf_csi = -1;
3603 static int hf_ieee80211_txbf_expl_uncomp_fm_feed = -1;
3604 static int hf_ieee80211_txbf_expl_comp_fm_feed = -1;
3605 static int hf_ieee80211_txbf_csi_num_bf_ant = -1;
3606 static int hf_ieee80211_txbf_min_group = -1;
3607 static int hf_ieee80211_txbf_uncomp_sm_bf_ant = -1;
3608 static int hf_ieee80211_txbf_comp_sm_bf_ant = -1;
3609 static int hf_ieee80211_txbf_csi_max_rows_bf = -1;
3610 static int hf_ieee80211_txbf_chan_est = -1;
3611 static int hf_ieee80211_txbf_resrv = -1;
3612
3613 /*** Begin: 802.11n D1.10 - HT Information IE  ***/
3614 static int hf_ieee80211_ht_info_primary_channel = -1;
3615
3616 static int hf_ieee80211_ht_info_delimiter1 = -1;
3617 static int hf_ieee80211_ht_info_secondary_channel_offset = -1;
3618 static int hf_ieee80211_ht_info_channel_width = -1;
3619 static int hf_ieee80211_ht_info_rifs_mode = -1;
3620 static int hf_ieee80211_ht_info_psmp_stas_only = -1;
3621 static int hf_ieee80211_ht_info_service_interval_granularity = -1;
3622
3623 static int hf_ieee80211_ht_info_delimiter2 = -1;
3624 static int hf_ieee80211_ht_info_operating_mode = -1;
3625 static int hf_ieee80211_ht_info_non_greenfield_sta_present = -1;
3626 static int hf_ieee80211_ht_info_transmit_burst_limit = -1;
3627 static int hf_ieee80211_ht_info_obss_non_ht_stas_present = -1;
3628 static int hf_ieee80211_ht_info_reserved_1 = -1;
3629
3630 static int hf_ieee80211_ht_info_delimiter3 = -1;
3631 static int hf_ieee80211_ht_info_reserved_2 = -1;
3632 static int hf_ieee80211_ht_info_dual_beacon = -1;
3633 static int hf_ieee80211_ht_info_dual_cts_protection = -1;
3634 static int hf_ieee80211_ht_info_secondary_beacon = -1;
3635 static int hf_ieee80211_ht_info_lsig_txop_protection_full_support = -1;
3636 static int hf_ieee80211_ht_info_pco_active = -1;
3637 static int hf_ieee80211_ht_info_pco_phase = -1;
3638 static int hf_ieee80211_ht_info_reserved_3 = -1;
3639 /*** End: 802.11n D1.10 - HT Information IE  ***/
3640
3641 static int hf_ieee80211_tag_ap_channel_report_operating_class = -1;
3642 static int hf_ieee80211_tag_ap_channel_report_channel_list = -1;
3643
3644 static int hf_ieee80211_tag_secondary_channel_offset = -1;
3645
3646 static int hf_ieee80211_tag_bss_ap_avg_access_delay = -1;
3647
3648 static int hf_ieee80211_tag_antenna_id = -1;
3649
3650 static int hf_ieee80211_tag_rsni = -1;
3651
3652 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask = -1;
3653 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0 = -1;
3654 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1 = -1;
3655 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2 = -1;
3656 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3 = -1;
3657 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4 = -1;
3658 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5 = -1;
3659 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6 = -1;
3660 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7 = -1;
3661 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0 = -1;
3662 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1 = -1;
3663 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2 = -1;
3664 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3 = -1;
3665 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv = -1;
3666 static int hf_ieee80211_tag_bss_avb_adm_cap_up0 = -1;
3667 static int hf_ieee80211_tag_bss_avb_adm_cap_up1 = -1;
3668 static int hf_ieee80211_tag_bss_avb_adm_cap_up2 = -1;
3669 static int hf_ieee80211_tag_bss_avb_adm_cap_up3 = -1;
3670 static int hf_ieee80211_tag_bss_avb_adm_cap_up4 = -1;
3671 static int hf_ieee80211_tag_bss_avb_adm_cap_up5 = -1;
3672 static int hf_ieee80211_tag_bss_avb_adm_cap_up6 = -1;
3673 static int hf_ieee80211_tag_bss_avb_adm_cap_up7 = -1;
3674 static int hf_ieee80211_tag_bss_avb_adm_cap_ac0 = -1;
3675 static int hf_ieee80211_tag_bss_avb_adm_cap_ac1 = -1;
3676 static int hf_ieee80211_tag_bss_avb_adm_cap_ac2 = -1;
3677 static int hf_ieee80211_tag_bss_avb_adm_cap_ac3 = -1;
3678
3679 static int hf_ieee80211_tag_bss_avg_ac_access_delay_be = -1;
3680 static int hf_ieee80211_tag_bss_avg_ac_access_delay_bk = -1;
3681 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vi = -1;
3682 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vo = -1;
3683
3684 static int hf_ieee80211_tag_rm_enabled_capabilities = -1;
3685 static int hf_ieee80211_tag_rm_enabled_capabilities_b0 = -1;
3686 static int hf_ieee80211_tag_rm_enabled_capabilities_b1 = -1;
3687 static int hf_ieee80211_tag_rm_enabled_capabilities_b2 = -1;
3688 static int hf_ieee80211_tag_rm_enabled_capabilities_b3 = -1;
3689 static int hf_ieee80211_tag_rm_enabled_capabilities_b4 = -1;
3690 static int hf_ieee80211_tag_rm_enabled_capabilities_b5 = -1;
3691 static int hf_ieee80211_tag_rm_enabled_capabilities_b6 = -1;
3692 static int hf_ieee80211_tag_rm_enabled_capabilities_b7 = -1;
3693 static int hf_ieee80211_tag_rm_enabled_capabilities_b8 = -1;
3694 static int hf_ieee80211_tag_rm_enabled_capabilities_b9 = -1;
3695 static int hf_ieee80211_tag_rm_enabled_capabilities_b10 = -1;
3696 static int hf_ieee80211_tag_rm_enabled_capabilities_b11 = -1;
3697 static int hf_ieee80211_tag_rm_enabled_capabilities_b12 = -1;
3698 static int hf_ieee80211_tag_rm_enabled_capabilities_b13 = -1;
3699 static int hf_ieee80211_tag_rm_enabled_capabilities_b14 = -1;
3700 static int hf_ieee80211_tag_rm_enabled_capabilities_b15 = -1;
3701 static int hf_ieee80211_tag_rm_enabled_capabilities_b16 = -1;
3702 static int hf_ieee80211_tag_rm_enabled_capabilities_b17 = -1;
3703 static int hf_ieee80211_tag_rm_enabled_capabilities_b18to20 = -1;
3704 static int hf_ieee80211_tag_rm_enabled_capabilities_b21to23 = -1;
3705 static int hf_ieee80211_tag_rm_enabled_capabilities_b24to26 = -1;
3706 static int hf_ieee80211_tag_rm_enabled_capabilities_b27 = -1;
3707 static int hf_ieee80211_tag_rm_enabled_capabilities_b28 = -1;
3708 static int hf_ieee80211_tag_rm_enabled_capabilities_b29 = -1;
3709 static int hf_ieee80211_tag_rm_enabled_capabilities_b30 = -1;
3710 static int hf_ieee80211_tag_rm_enabled_capabilities_b31 = -1;
3711 static int hf_ieee80211_tag_rm_enabled_capabilities_b32 = -1;
3712 static int hf_ieee80211_tag_rm_enabled_capabilities_b33 = -1;
3713 static int hf_ieee80211_tag_rm_enabled_capabilities_o5 = -1;
3714
3715 static int hf_ieee80211_tag_20_40_bc = -1;
3716 static int hf_ieee80211_tag_20_40_bc_information_request = -1;
3717 static int hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant = -1;
3718 static int hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request = -1;
3719 static int hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request = -1;
3720 static int hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant = -1;
3721 static int hf_ieee80211_tag_20_40_bc_reserved = -1;
3722
3723 static int hf_ieee80211_tag_power_constraint_local = -1;
3724
3725 static int hf_ieee80211_tag_power_capability_min = -1;
3726 static int hf_ieee80211_tag_power_capability_max = -1;
3727
3728 static int hf_ieee80211_tag_tpc_report_trsmt_pow = -1;
3729 static int hf_ieee80211_tag_tpc_report_link_mrg = -1;
3730
3731 static int hf_ieee80211_tag_supported_channels = -1;
3732 static int hf_ieee80211_tag_supported_channels_first = -1;
3733 static int hf_ieee80211_tag_supported_channels_range = -1;
3734
3735 static int hf_ieee80211_csa_channel_switch_mode = -1;
3736 static int hf_ieee80211_csa_new_channel_number = -1;
3737 static int hf_ieee80211_csa_channel_switch_count = -1;
3738
3739 static int hf_ieee80211_tag_measure_request_token = -1;
3740 static int hf_ieee80211_tag_measure_request_mode = -1;
3741 static int hf_ieee80211_tag_measure_request_mode_parallel = -1;
3742 static int hf_ieee80211_tag_measure_request_mode_enable = -1;
3743 static int hf_ieee80211_tag_measure_request_mode_request = -1;
3744 static int hf_ieee80211_tag_measure_request_mode_report = -1;
3745 static int hf_ieee80211_tag_measure_request_mode_duration_mandatory = -1;
3746 static int hf_ieee80211_tag_measure_request_mode_reserved = -1;
3747 static int hf_ieee80211_tag_measure_request_type = -1;
3748
3749 static int hf_ieee80211_tag_measure_request_channel_number = -1;
3750 static int hf_ieee80211_tag_measure_request_start_time = -1;
3751 static int hf_ieee80211_tag_measure_request_duration = -1;
3752
3753 static int hf_ieee80211_tag_measure_request_operating_class = -1;
3754 static int hf_ieee80211_tag_measure_request_randomization_interval = -1;
3755
3756 static int hf_ieee80211_tag_measure_report_measurement_token = -1;
3757 static int hf_ieee80211_tag_measure_report_mode = -1;
3758 static int hf_ieee80211_tag_measure_report_mode_late = -1;
3759 static int hf_ieee80211_tag_measure_report_mode_incapable = -1;
3760 static int hf_ieee80211_tag_measure_report_mode_refused = -1;
3761 static int hf_ieee80211_tag_measure_report_mode_reserved = -1;
3762 static int hf_ieee80211_tag_measure_report_type = -1;
3763 static int hf_ieee80211_tag_measure_report_channel_number = -1;
3764 static int hf_ieee80211_tag_measure_report_start_time = -1;
3765 static int hf_ieee80211_tag_measure_report_duration = -1;
3766
3767 static int hf_ieee80211_tag_measure_basic_map_field = -1;
3768 static int hf_ieee80211_tag_measure_map_field_bss = -1;
3769 static int hf_ieee80211_tag_measure_map_field_odfm = -1;
3770 static int hf_ieee80211_tag_measure_map_field_unident_signal = -1;
3771 static int hf_ieee80211_tag_measure_map_field_radar = -1;
3772 static int hf_ieee80211_tag_measure_map_field_unmeasured = -1;
3773 static int hf_ieee80211_tag_measure_map_field_reserved = -1;
3774
3775 static int hf_ieee80211_tag_measure_cca_busy_fraction = -1;
3776
3777 static int hf_ieee80211_tag_measure_rpi_histogram_report = -1;
3778 static int hf_ieee80211_tag_measure_rpi_histogram_report_0 = -1;
3779 static int hf_ieee80211_tag_measure_rpi_histogram_report_1 = -1;
3780 static int hf_ieee80211_tag_measure_rpi_histogram_report_2 = -1;
3781 static int hf_ieee80211_tag_measure_rpi_histogram_report_3 = -1;
3782 static int hf_ieee80211_tag_measure_rpi_histogram_report_4 = -1;
3783 static int hf_ieee80211_tag_measure_rpi_histogram_report_5 = -1;
3784 static int hf_ieee80211_tag_measure_rpi_histogram_report_6 = -1;
3785 static int hf_ieee80211_tag_measure_rpi_histogram_report_7 = -1;
3786
3787 static int hf_ieee80211_tag_measure_report_operating_class = -1;
3788 static int hf_ieee80211_tag_measure_report_channel_load = -1;
3789 static int hf_ieee80211_tag_measure_report_frame_info = -1;
3790 static int hf_ieee80211_tag_measure_report_frame_info_phy_type = -1;
3791 static int hf_ieee80211_tag_measure_report_frame_info_frame_type = -1;
3792 static int hf_ieee80211_tag_measure_report_rcpi = -1;
3793 static int hf_ieee80211_tag_measure_report_rsni = -1;
3794 static int hf_ieee80211_tag_measure_report_bssid = -1;
3795 static int hf_ieee80211_tag_measure_report_ant_id = -1;
3796 static int hf_ieee80211_tag_measure_report_anpi = -1;
3797 static int hf_ieee80211_tag_measure_report_ipi_density_0 = -1;
3798 static int hf_ieee80211_tag_measure_report_ipi_density_1 = -1;
3799 static int hf_ieee80211_tag_measure_report_ipi_density_2 = -1;
3800 static int hf_ieee80211_tag_measure_report_ipi_density_3 = -1;
3801 static int hf_ieee80211_tag_measure_report_ipi_density_4 = -1;
3802 static int hf_ieee80211_tag_measure_report_ipi_density_5 = -1;
3803 static int hf_ieee80211_tag_measure_report_ipi_density_6 = -1;
3804 static int hf_ieee80211_tag_measure_report_ipi_density_7 = -1;
3805 static int hf_ieee80211_tag_measure_report_ipi_density_8 = -1;
3806 static int hf_ieee80211_tag_measure_report_ipi_density_9 = -1;
3807 static int hf_ieee80211_tag_measure_report_ipi_density_10 = -1;
3808 static int hf_ieee80211_tag_measure_report_parent_tsf = -1;
3809
3810 static int hf_ieee80211_tag_measure_report_subelement_length = -1;
3811 static int hf_ieee80211_tag_measure_report_beacon_sub_id = -1;
3812
3813 static int hf_ieee80211_tag_measure_report_unknown = -1;
3814
3815 static int hf_ieee80211_tag_quiet_count = -1;
3816 static int hf_ieee80211_tag_quiet_period = -1;
3817 static int hf_ieee80211_tag_quiet_duration = -1;
3818 static int hf_ieee80211_tag_quiet_offset = -1;
3819
3820 static int hf_ieee80211_tag_dfs_owner = -1;
3821 static int hf_ieee80211_tag_dfs_recovery_interval = -1;
3822 static int hf_ieee80211_tag_dfs_channel_map = -1;
3823 static int hf_ieee80211_tag_dfs_channel_number = -1;
3824 static int hf_ieee80211_tag_dfs_map = -1;
3825
3826 static int hf_ieee80211_tag_erp_info = -1;
3827 static int hf_ieee80211_tag_erp_info_erp_present = -1;
3828 static int hf_ieee80211_tag_erp_info_use_protection = -1;
3829 static int hf_ieee80211_tag_erp_info_barker_preamble_mode = -1;
3830 static int hf_ieee80211_tag_erp_info_reserved = -1;
3831
3832 static int hf_ieee80211_tag_extended_capabilities = -1;
3833 static int hf_ieee80211_tag_extended_capabilities_b0 = -1;
3834 static int hf_ieee80211_tag_extended_capabilities_b1 = -1;
3835 static int hf_ieee80211_tag_extended_capabilities_b2 = -1;
3836 static int hf_ieee80211_tag_extended_capabilities_b3 = -1;
3837 static int hf_ieee80211_tag_extended_capabilities_b4 = -1;
3838 static int hf_ieee80211_tag_extended_capabilities_b5 = -1;
3839 static int hf_ieee80211_tag_extended_capabilities_b6 = -1;
3840 static int hf_ieee80211_tag_extended_capabilities_b7 = -1;
3841 static int hf_ieee80211_tag_extended_capabilities_b8 = -1;
3842 static int hf_ieee80211_tag_extended_capabilities_b9 = -1;
3843 static int hf_ieee80211_tag_extended_capabilities_b10 = -1;
3844 static int hf_ieee80211_tag_extended_capabilities_b11 = -1;
3845 static int hf_ieee80211_tag_extended_capabilities_b12 = -1;
3846 static int hf_ieee80211_tag_extended_capabilities_b13 = -1;
3847 static int hf_ieee80211_tag_extended_capabilities_b14 = -1;
3848 static int hf_ieee80211_tag_extended_capabilities_b15 = -1;
3849 static int hf_ieee80211_tag_extended_capabilities_b16 = -1;
3850 static int hf_ieee80211_tag_extended_capabilities_b17 = -1;
3851 static int hf_ieee80211_tag_extended_capabilities_b18 = -1;
3852 static int hf_ieee80211_tag_extended_capabilities_b19 = -1;
3853 static int hf_ieee80211_tag_extended_capabilities_b20 = -1;
3854 static int hf_ieee80211_tag_extended_capabilities_b21 = -1;
3855 static int hf_ieee80211_tag_extended_capabilities_b22 = -1;
3856 static int hf_ieee80211_tag_extended_capabilities_b23 = -1;
3857 static int hf_ieee80211_tag_extended_capabilities_b24 = -1;
3858 static int hf_ieee80211_tag_extended_capabilities_b25 = -1;
3859 static int hf_ieee80211_tag_extended_capabilities_b26 = -1;
3860 static int hf_ieee80211_tag_extended_capabilities_b27 = -1;
3861 static int hf_ieee80211_tag_extended_capabilities_b28 = -1;
3862 static int hf_ieee80211_tag_extended_capabilities_b29 = -1;
3863 static int hf_ieee80211_tag_extended_capabilities_b30 = -1;
3864 static int hf_ieee80211_tag_extended_capabilities_b31 = -1;
3865 static int hf_ieee80211_tag_extended_capabilities_b32 = -1;
3866 static int hf_ieee80211_tag_extended_capabilities_b33 = -1;
3867 static int hf_ieee80211_tag_extended_capabilities_b34 = -1;
3868 static int hf_ieee80211_tag_extended_capabilities_b35 = -1;
3869 static int hf_ieee80211_tag_extended_capabilities_b36 = -1;
3870 static int hf_ieee80211_tag_extended_capabilities_b37 = -1;
3871 static int hf_ieee80211_tag_extended_capabilities_b38 = -1;
3872 static int hf_ieee80211_tag_extended_capabilities_b39 = -1;
3873 static int hf_ieee80211_tag_extended_capabilities_b40 = -1;
3874 static int hf_ieee80211_tag_extended_capabilities_serv_int_granularity = -1;
3875 static int hf_ieee80211_tag_extended_capabilities_b44 = -1;
3876 static int hf_ieee80211_tag_extended_capabilities_b45 = -1;
3877 static int hf_ieee80211_tag_extended_capabilities_b46 = -1;
3878 static int hf_ieee80211_tag_extended_capabilities_b47 = -1;
3879 static int hf_ieee80211_tag_extended_capabilities_b48 = -1;
3880 static int hf_ieee80211_tag_extended_capabilities_b61 = -1;
3881 static int hf_ieee80211_tag_extended_capabilities_b62 = -1;
3882 static int hf_ieee80211_tag_extended_capabilities_b63 = -1;
3883 static int hf_ieee80211_tag_extended_capabilities_b64 = -1;
3884 static int hf_ieee80211_tag_extended_capabilities_o7 = -1;
3885 static int hf_ieee80211_tag_extended_capabilities_o8 = -1;
3886 static int hf_ieee80211_tag_extended_capabilities_o9 = -1;
3887
3888 static int hf_ieee80211_tag_cisco_ccx1_unknown = -1;
3889 static int hf_ieee80211_tag_cisco_ccx1_name = -1;
3890 static int hf_ieee80211_tag_cisco_ccx1_clients = -1;
3891 static int hf_ieee80211_tag_cisco_ccx1_unknown2 = -1;
3892
3893 static int hf_ieee80211_vht_cap = -1;
3894 static int hf_ieee80211_vht_max_mpdu_length = -1;
3895 static int hf_ieee80211_vht_supported_chan_width_set = -1;
3896 static int hf_ieee80211_vht_rx_ldpc = -1;
3897 static int hf_ieee80211_vht_short_gi_for_80 = -1;
3898 static int hf_ieee80211_vht_short_gi_for_160 = -1;
3899 static int hf_ieee80211_vht_tx_stbc = -1;
3900 static int hf_ieee80211_vht_rx_stbc = -1;
3901 static int hf_ieee80211_vht_su_beamformer_cap = -1;
3902 static int hf_ieee80211_vht_su_beamformee_cap = -1;
3903 static int hf_ieee80211_vht_beamformer_antennas = -1;
3904 static int hf_ieee80211_vht_sounding_dimensions = -1;
3905 static int hf_ieee80211_vht_mu_beamformer_cap = -1;
3906 static int hf_ieee80211_vht_mu_beamformee_cap = -1;
3907 static int hf_ieee80211_vht_txop_ps = -1;
3908 static int hf_ieee80211_vht_var_htc_field = -1;
3909 static int hf_ieee80211_vht_max_ampdu = -1;
3910 static int hf_ieee80211_vht_link_adaptation_cap = -1;
3911 static int hf_ieee80211_vht_rx_pattern = -1;
3912 static int hf_ieee80211_vht_tx_pattern = -1;
3913 static int hf_ieee80211_vht_reserv = -1;
3914
3915 static int hf_ieee80211_vht_mcsset = -1;
3916
3917 static int hf_ieee80211_vht_mcsset_rx_mcs_map = -1;
3918 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss = -1;
3919 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss = -1;
3920 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss = -1;
3921 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss = -1;
3922 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss = -1;
3923 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss = -1;
3924 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss = -1;
3925 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss = -1;
3926
3927 static int hf_ieee80211_vht_mcsset_rx_highest_long_gi = -1;
3928
3929 static int hf_ieee80211_vht_mcsset_tx_mcs_map = -1;
3930 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss = -1;
3931 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss = -1;
3932 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss = -1;
3933 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss = -1;
3934 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss = -1;
3935 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss = -1;
3936 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss = -1;
3937 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss = -1;
3938
3939 static int hf_ieee80211_vht_op = -1;
3940 static int hf_ieee80211_vht_op_channel_width = -1;
3941 static int hf_ieee80211_vht_op_channel_center0 = -1;
3942 static int hf_ieee80211_vht_op_channel_center1 = -1;
3943
3944 static int hf_ieee80211_vht_op_basic_mcs_map = -1;
3945 static int hf_ieee80211_vht_op_max_basic_mcs_for_1_ss = -1;
3946 static int hf_ieee80211_vht_op_max_basic_mcs_for_2_ss = -1;
3947 static int hf_ieee80211_vht_op_max_basic_mcs_for_3_ss = -1;
3948 static int hf_ieee80211_vht_op_max_basic_mcs_for_4_ss = -1;
3949 static int hf_ieee80211_vht_op_max_basic_mcs_for_5_ss = -1;
3950 static int hf_ieee80211_vht_op_max_basic_mcs_for_6_ss = -1;
3951 static int hf_ieee80211_vht_op_max_basic_mcs_for_7_ss = -1;
3952 static int hf_ieee80211_vht_op_max_basic_mcs_for_8_ss = -1;
3953 static int hf_ieee80211_vht_mcsset_tx_highest_long_gi = -1;
3954
3955 static int hf_ieee80211_vht_tpe_pwr_info = -1;
3956 static int hf_ieee80211_vht_tpe_pwr_info_count = -1;
3957 static int hf_ieee80211_vht_tpe_pwr_info_unit = -1;
3958 static int hf_ieee80211_vht_tpe_pwr_info_reserved = -1;
3959 static int hf_ieee80211_vht_tpe_pwr_constr_20 = -1;
3960 static int hf_ieee80211_vht_tpe_pwr_constr_40 = -1;
3961 static int hf_ieee80211_vht_tpe_pwr_constr_80 = -1;
3962 static int hf_ieee80211_vht_tpe_pwr_constr_160 = -1;
3963
3964 static int hf_ieee80211_beamform_feedback_seg_retrans_bitmap = -1;
3965
3966 static int hf_ieee80211_vht_ndp_annc_token = -1;
3967 static int hf_ieee80211_vht_ndp_annc_token_number = -1;
3968 static int hf_ieee80211_vht_ndp_annc_token_reserved = -1;
3969 static int hf_ieee80211_vht_ndp_annc_sta_info = -1;
3970 static int hf_ieee80211_vht_ndp_annc_sta_info_aid12 = -1;
3971 static int hf_ieee80211_vht_ndp_annc_sta_info_feedback_type = -1;
3972 static int hf_ieee80211_vht_ndp_annc_sta_info_nc_index = -1;
3973 static int hf_ieee80211_vht_ndp_annc_sta_info_reserved = -1;
3974
3975
3976 static int hf_ieee80211_ff_vht_action = -1;
3977 static int hf_ieee80211_ff_vht_mimo_cntrl = -1;
3978 static int hf_ieee80211_ff_vht_mimo_cntrl_nc_index = -1;
3979 static int hf_ieee80211_ff_vht_mimo_cntrl_nr_index = -1;
3980 static int hf_ieee80211_ff_vht_mimo_cntrl_channel_width = -1;
3981 static int hf_ieee80211_ff_vht_mimo_cntrl_grouping = -1;
3982 static int hf_ieee80211_ff_vht_mimo_cntrl_codebook_info = -1;
3983 static int hf_ieee80211_ff_vht_mimo_cntrl_feedback_type = -1;
3984 static int hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg = -1;
3985 static int hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg = -1;
3986 static int hf_ieee80211_ff_vht_mimo_cntrl_reserved = -1;
3987 static int hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number = -1;
3988
3989 static const int *hf_ieee80211_ff_vht_mimo_cntrl_fields[] = {
3990   &hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
3991   &hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
3992   &hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
3993   &hf_ieee80211_ff_vht_mimo_cntrl_grouping,
3994   &hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
3995   &hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
3996   &hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
3997   &hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
3998   &hf_ieee80211_ff_vht_mimo_cntrl_reserved,
3999   &hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
4000   NULL,
4001 };
4002
4003 static int hf_ieee80211_vht_compressed_beamforming_report = -1;
4004 static int hf_ieee80211_vht_compressed_beamforming_report_snr = -1;
4005 static int hf_ieee80211_vht_compressed_beamforming_feedback_matrix = -1;
4006 static int hf_ieee80211_vht_group_id_management = -1;
4007 static int hf_ieee80211_vht_membership_status_array = -1;
4008 static int hf_ieee80211_vht_user_position_array = -1;
4009 static int hf_ieee80211_vht_operation_mode_notification = -1;
4010 static int hf_ieee80211_vht_membership_status_field = -1;
4011 static int hf_ieee80211_vht_user_position_field = -1;
4012
4013 static int hf_ieee80211_tag_neighbor_report_bssid = -1;
4014 static int hf_ieee80211_tag_neighbor_report_bssid_info = -1;
4015 static int hf_ieee80211_tag_neighbor_report_bssid_info_reachability = -1;
4016 static int hf_ieee80211_tag_neighbor_report_bssid_info_security = -1;
4017 static int hf_ieee80211_tag_neighbor_report_bssid_info_key_scope = -1;
4018 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability = -1;
4019 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng = -1;
4020 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos = -1;
4021 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd = -1;
4022 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt = -1;
4023 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback = -1;
4024 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback = -1;
4025 static int hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain = -1;
4026 static int hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput = -1;
4027 static int hf_ieee80211_tag_neighbor_report_bssid_info_reserved = -1;
4028 static int hf_ieee80211_tag_neighbor_report_ope_class = -1;
4029 static int hf_ieee80211_tag_neighbor_report_channel_number = -1;
4030 static int hf_ieee80211_tag_neighbor_report_phy_type = -1;
4031 static int hf_ieee80211_tag_neighbor_report_subelement_id = -1;
4032 static int hf_ieee80211_tag_neighbor_report_subelement_length = -1;
4033
4034 static int hf_ieee80211_tag_supported_ope_classes_current = -1;
4035 static int hf_ieee80211_tag_supported_ope_classes_alternate = -1;
4036
4037 /* IEEE Std 802.11r-2008 7.3.2.47 */
4038 static int hf_ieee80211_tag_mobility_domain_mdid = -1;
4039 static int hf_ieee80211_tag_mobility_domain_ft_capab = -1;
4040 static int hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds = -1;
4041 static int hf_ieee80211_tag_mobility_domain_ft_capab_resource_req = -1;
4042
4043 /* IEEE Std 802.11r-2008 7.3.2.48 */
4044 static int hf_ieee80211_tag_ft_mic_control = -1;
4045 static int hf_ieee80211_tag_ft_element_count = -1;
4046 static int hf_ieee80211_tag_ft_mic = -1;
4047 static int hf_ieee80211_tag_ft_anonce = -1;
4048 static int hf_ieee80211_tag_ft_snonce = -1;
4049 static int hf_ieee80211_tag_ft_subelem_id = -1;
4050 static int hf_ieee80211_tag_ft_subelem_len = -1;
4051 static int hf_ieee80211_tag_ft_subelem_data = -1;
4052 static int hf_ieee80211_tag_ft_subelem_r1kh_id = -1;
4053 static int hf_ieee80211_tag_ft_subelem_gtk_key_info = -1;
4054 static int hf_ieee80211_tag_ft_subelem_gtk_key_id = -1;
4055 static int hf_ieee80211_tag_ft_subelem_gtk_key_length = -1;
4056 static int hf_ieee80211_tag_ft_subelem_gtk_rsc = -1;
4057 static int hf_ieee80211_tag_ft_subelem_gtk_key = -1;
4058 static int hf_ieee80211_tag_ft_subelem_r0kh_id = -1;
4059 static int hf_ieee80211_tag_ft_subelem_igtk_key_id = -1;
4060 static int hf_ieee80211_tag_ft_subelem_igtk_ipn = -1;
4061 static int hf_ieee80211_tag_ft_subelem_igtk_key_length = -1;
4062 static int hf_ieee80211_tag_ft_subelem_igtk_key = -1;
4063
4064 /* IEEE Std 802.11-2012: 11r 8.4.2.52 */
4065 static int hf_ieee80211_tag_ric_data_id = -1;
4066 static int hf_ieee80211_tag_ric_data_desc_cnt = -1;
4067 static int hf_ieee80211_tag_ric_data_status_code = -1;
4068
4069 /* IEEE Std 802.11-2012: 11r 8.4.2.53 */
4070 static int hf_ieee80211_tag_ric_desc_rsrc_type = -1;
4071 static int hf_ieee80211_tag_ric_desc_var_params = -1;
4072
4073 /* IEEE Std 802.11w-2009 7.3.2.55 */
4074 static int hf_ieee80211_tag_mmie_keyid = -1;
4075 static int hf_ieee80211_tag_mmie_ipn = -1;
4076 static int hf_ieee80211_tag_mmie_mic = -1;
4077
4078 /* IEEE Std 802.11-2012: 8.4.2.61 */
4079 static int hf_ieee80211_tag_obss_spd = -1;
4080 static int hf_ieee80211_tag_obss_sad = -1;
4081 static int hf_ieee80211_tag_obss_cwtsi = -1;
4082 static int hf_ieee80211_tag_obss_sptpc = -1;
4083 static int hf_ieee80211_tag_obss_satpc = -1;
4084 static int hf_ieee80211_tag_obss_wctdf = -1;
4085 static int hf_ieee80211_tag_obss_sat = -1;
4086
4087
4088 /*WAPI-Specification 7.3.2.25 : WAPI Parameter Set*/
4089 static int hf_ieee80211_tag_wapi_param_set_version = -1;
4090
4091 static int hf_ieee80211_tag_wapi_param_set_akm_suite_count = -1;
4092 static int hf_ieee80211_tag_wapi_param_set_akm_suite_oui = -1;
4093 static int hf_ieee80211_tag_wapi_param_set_akm_suite_type = -1;
4094
4095 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count = -1;
4096 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui = -1;
4097 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type = -1;
4098
4099 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui = -1;
4100 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type = -1;
4101
4102 static int hf_ieee80211_tag_wapi_param_set_capab = -1;
4103 static int hf_ieee80211_tag_wapi_param_set_capab_preauth = -1;
4104 static int hf_ieee80211_tag_wapi_param_set_capab_rsvd = -1;
4105 static int hf_ieee80211_tag_wapi_param_set_bkid_count = -1;
4106 static int hf_ieee80211_tag_wapi_param_set_bkid_list = -1;
4107
4108 /* IEEE Std 802.11v-2011 7.3.2.61 */
4109 static int hf_ieee80211_tag_time_adv_timing_capab = -1;
4110 static int hf_ieee80211_tag_time_adv_time_value = -1;
4111 static int hf_ieee80211_tag_time_adv_time_value_year = -1;
4112 static int hf_ieee80211_tag_time_adv_time_value_month = -1;
4113 static int hf_ieee80211_tag_time_adv_time_value_day = -1;
4114 static int hf_ieee80211_tag_time_adv_time_value_hours = -1;
4115 static int hf_ieee80211_tag_time_adv_time_value_minutes = -1;
4116 static int hf_ieee80211_tag_time_adv_time_value_seconds = -1;
4117 static int hf_ieee80211_tag_time_adv_time_value_milliseconds = -1;
4118 static int hf_ieee80211_tag_time_adv_time_value_reserved = -1;
4119 static int hf_ieee80211_tag_time_adv_time_error = -1;
4120 static int hf_ieee80211_tag_time_adv_time_update_counter = -1;
4121
4122 /* IEEE Std 802.11-2012 8.4.2.81 */
4123 static int hf_ieee80211_tag_bss_max_idle_period = -1;
4124 static int hf_ieee80211_tag_bss_max_idle_options_protected = -1;
4125
4126 /* IEEE Std 802.11-2012 8.4.2.82 */
4127 static int hf_ieee80211_tag_tfs_request_id = -1;
4128 static int hf_ieee80211_tag_tfs_request_ac_delete_after_match = -1;
4129 static int hf_ieee80211_tag_tfs_request_ac_notify = -1;
4130 static int hf_ieee80211_tag_tfs_request_subelem_id = -1;
4131 static int hf_ieee80211_tag_tfs_request_subelem_len = -1;
4132 static int hf_ieee80211_tag_tfs_request_subelem = -1;
4133
4134 /* IEEE Std 802.11-2012 8.4.2.83 */
4135 static int hf_ieee80211_tag_tfs_response_subelem_id = -1;
4136 static int hf_ieee80211_tag_tfs_response_subelem_len = -1;
4137 static int hf_ieee80211_tag_tfs_response_subelem = -1;
4138 static int hf_ieee80211_tag_tfs_response_status = -1;
4139 static int hf_ieee80211_tag_tfs_response_id = -1;
4140
4141 /* IEEE Std 802.11-2012 8.4.2.84 */
4142 static int hf_ieee80211_tag_wnm_sleep_mode_action_type = -1;
4143 static int hf_ieee80211_tag_wnm_sleep_mode_response_status = -1;
4144 static int hf_ieee80211_tag_wnm_sleep_mode_interval = -1;
4145
4146 /* IEEE Std 802.11v-2011 7.3.2.87 */
4147 static int hf_ieee80211_tag_time_zone = -1;
4148
4149 /* IEEE Std 802.11u-2011 7.3.2.92 */
4150 static int hf_ieee80211_tag_interworking_access_network_type = -1;
4151 static int hf_ieee80211_tag_interworking_internet = -1;
4152 static int hf_ieee80211_tag_interworking_asra = -1;
4153 static int hf_ieee80211_tag_interworking_esr = -1;
4154 static int hf_ieee80211_tag_interworking_uesa = -1;
4155 static int hf_ieee80211_tag_interworking_hessid = -1;
4156
4157 /* IEEE Std 802.11-2012, 8.4.2.97 */
4158 static int hf_ieee80211_tag_qos_map_set_dscp_exc = -1;
4159 static int hf_ieee80211_tag_qos_map_set_dscp_exc_val = -1;
4160 static int hf_ieee80211_tag_qos_map_set_dscp_exc_up = -1;
4161 static int hf_ieee80211_tag_qos_map_set_range = -1;
4162 static int hf_ieee80211_tag_qos_map_set_low = -1;
4163 static int hf_ieee80211_tag_qos_map_set_high = -1;
4164
4165 /* IEEE Std 802.11u-2011 7.3.2.93 */
4166 static int hf_ieee80211_tag_adv_proto_resp_len_limit = -1;
4167 static int hf_ieee80211_tag_adv_proto_pame_bi = -1;
4168 static int hf_ieee80211_tag_adv_proto_id = -1;
4169 static int hf_ieee80211_tag_adv_proto_vs_info = -1;
4170
4171 /* IEEE Std 802.11u-2011 7.3.2.96 */
4172 static int hf_ieee80211_tag_roaming_consortium_num_anqp_oi = -1;
4173 static int hf_ieee80211_tag_roaming_consortium_oi1_len = -1;
4174 static int hf_ieee80211_tag_roaming_consortium_oi2_len = -1;
4175 static int hf_ieee80211_tag_roaming_consortium_oi1 = -1;
4176 static int hf_ieee80211_tag_roaming_consortium_oi2 = -1;
4177 static int hf_ieee80211_tag_roaming_consortium_oi3 = -1;
4178
4179 /* 802.11n 7.3.2.48 */
4180 static int hf_ieee80211_hta_cc = -1;
4181 static int hf_ieee80211_hta_cap = -1;
4182 static int hf_ieee80211_hta_ext_chan_offset = -1;
4183 static int hf_ieee80211_hta_rec_tx_width = -1;
4184 static int hf_ieee80211_hta_rifs_mode = -1;
4185 static int hf_ieee80211_hta_controlled_access = -1;
4186 static int hf_ieee80211_hta_service_interval = -1;
4187 static int hf_ieee80211_hta_operating_mode = -1;
4188 static int hf_ieee80211_hta_non_gf_devices = -1;
4189 static int hf_ieee80211_hta_basic_stbc_mcs = -1;
4190 static int hf_ieee80211_hta_dual_stbc_protection = -1;
4191 static int hf_ieee80211_hta_secondary_beacon = -1;
4192 static int hf_ieee80211_hta_lsig_txop_protection = -1;
4193 static int hf_ieee80211_hta_pco_active = -1;
4194 static int hf_ieee80211_hta_pco_phase = -1;
4195
4196 static int hf_ieee80211_antsel = -1;
4197 static int hf_ieee80211_antsel_vs = -1;
4198 static int hf_ieee80211_antsel_b0 = -1;
4199 static int hf_ieee80211_antsel_b1 = -1;
4200 static int hf_ieee80211_antsel_b2 = -1;
4201 static int hf_ieee80211_antsel_b3 = -1;
4202 static int hf_ieee80211_antsel_b4 = -1;
4203 static int hf_ieee80211_antsel_b5 = -1;
4204 static int hf_ieee80211_antsel_b6 = -1;
4205 static int hf_ieee80211_antsel_b7 = -1;
4206
4207 static int hf_ieee80211_rsn_version = -1;
4208 static int hf_ieee80211_rsn_gcs = -1;
4209 static int hf_ieee80211_rsn_gcs_oui = -1;
4210 static int hf_ieee80211_rsn_gcs_type = -1;
4211 static int hf_ieee80211_rsn_gcs_80211_type = -1;
4212 static int hf_ieee80211_rsn_pcs_count = -1;
4213 static int hf_ieee80211_rsn_pcs_list = -1;
4214 static int hf_ieee80211_rsn_pcs = -1;
4215 static int hf_ieee80211_rsn_pcs_oui = -1;
4216 static int hf_ieee80211_rsn_pcs_80211_type = -1;
4217 static int hf_ieee80211_rsn_pcs_type = -1;
4218 static int hf_ieee80211_rsn_akms_count = -1;
4219 static int hf_ieee80211_rsn_akms_list = -1;
4220 static int hf_ieee80211_rsn_akms = -1;
4221 static int hf_ieee80211_rsn_akms_oui = -1;
4222 static int hf_ieee80211_rsn_akms_80211_type = -1;
4223 static int hf_ieee80211_rsn_akms_type = -1;
4224 static int hf_ieee80211_rsn_cap = -1;
4225 static int hf_ieee80211_rsn_cap_preauth = -1;
4226 static int hf_ieee80211_rsn_cap_no_pairwise = -1;
4227 static int hf_ieee80211_rsn_cap_ptksa_replay_counter = -1;
4228 static int hf_ieee80211_rsn_cap_gtksa_replay_counter = -1;
4229 static int hf_ieee80211_rsn_cap_mfpr = -1;
4230 static int hf_ieee80211_rsn_cap_mfpc = -1;
4231 static int hf_ieee80211_rsn_cap_jmr = -1;
4232 static int hf_ieee80211_rsn_cap_peerkey = -1;
4233 static int hf_ieee80211_rsn_pmkid_count = -1;
4234 static int hf_ieee80211_rsn_pmkid_list = -1;
4235 static int hf_ieee80211_rsn_pmkid = -1;
4236 static int hf_ieee80211_rsn_gmcs = -1;
4237 static int hf_ieee80211_rsn_gmcs_oui = -1;
4238 static int hf_ieee80211_rsn_gmcs_type = -1;
4239 static int hf_ieee80211_rsn_gmcs_80211_type = -1;
4240
4241 static int hf_ieee80211_wfa_ie_type = -1;
4242 static int hf_ieee80211_wfa_ie_wpa_version = -1;
4243 static int hf_ieee80211_wfa_ie_wpa_mcs = -1;
4244 static int hf_ieee80211_wfa_ie_wpa_mcs_oui = -1;
4245 static int hf_ieee80211_wfa_ie_wpa_mcs_type = -1;
4246 static int hf_ieee80211_wfa_ie_wpa_mcs_wfa_type = -1;
4247 static int hf_ieee80211_wfa_ie_wpa_ucs_count = -1;
4248 static int hf_ieee80211_wfa_ie_wpa_ucs_list = -1;
4249 static int hf_ieee80211_wfa_ie_wpa_ucs = -1;
4250 static int hf_ieee80211_wfa_ie_wpa_ucs_oui = -1;
4251 static int hf_ieee80211_wfa_ie_wpa_ucs_wfa_type = -1;
4252 static int hf_ieee80211_wfa_ie_wpa_ucs_type = -1;
4253 static int hf_ieee80211_wfa_ie_wpa_akms_count = -1;
4254 static int hf_ieee80211_wfa_ie_wpa_akms_list = -1;
4255 static int hf_ieee80211_wfa_ie_wpa_akms = -1;
4256 static int hf_ieee80211_wfa_ie_wpa_akms_oui = -1;
4257 static int hf_ieee80211_wfa_ie_wpa_akms_wfa_type = -1;
4258 static int hf_ieee80211_wfa_ie_wpa_akms_type = -1;
4259 static int hf_ieee80211_wfa_ie_wme_subtype = -1;
4260 static int hf_ieee80211_wfa_ie_wme_version = -1;
4261 static int hf_ieee80211_wfa_ie_wme_qos_info = -1;
4262 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length = -1;
4263 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be = -1;
4264 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk = -1;
4265 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi = -1;
4266 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo = -1;
4267 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved = -1;
4268 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd = -1;
4269 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count = -1;
4270 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved = -1;
4271 static int hf_ieee80211_wfa_ie_wme_reserved = -1;
4272 static int hf_ieee80211_wfa_ie_wme_ac_parameters = -1;
4273 static int hf_ieee80211_wfa_ie_wme_acp_aci_aifsn = -1;
4274 static int hf_ieee80211_wfa_ie_wme_acp_aci = -1;
4275 static int hf_ieee80211_wfa_ie_wme_acp_acm = -1;
4276 static int hf_ieee80211_wfa_ie_wme_acp_aifsn = -1;
4277 static int hf_ieee80211_wfa_ie_wme_acp_reserved = -1;
4278 static int hf_ieee80211_wfa_ie_wme_acp_ecw = -1;
4279 static int hf_ieee80211_wfa_ie_wme_acp_ecw_max = -1;
4280 static int hf_ieee80211_wfa_ie_wme_acp_ecw_min = -1;
4281 static int hf_ieee80211_wfa_ie_wme_acp_cw_max = -1;
4282 static int hf_ieee80211_wfa_ie_wme_acp_cw_min = -1;
4283 static int hf_ieee80211_wfa_ie_wme_acp_txop_limit = -1;
4284 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo = -1;
4285 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid = -1;
4286 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction = -1;
4287 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb = -1;
4288 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up = -1;
4289 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved = -1;
4290 static int hf_ieee80211_wfa_ie_wme_tspec_nor_msdu = -1;
4291 static int hf_ieee80211_wfa_ie_wme_tspec_max_msdu = -1;
4292 static int hf_ieee80211_wfa_ie_wme_tspec_min_srv = -1;
4293 static int hf_ieee80211_wfa_ie_wme_tspec_max_srv = -1;
4294 static int hf_ieee80211_wfa_ie_wme_tspec_inact_int = -1;
4295 static int hf_ieee80211_wfa_ie_wme_tspec_susp_int = -1;
4296 static int hf_ieee80211_wfa_ie_wme_tspec_srv_start = -1;
4297 static int hf_ieee80211_wfa_ie_wme_tspec_min_data = -1;
4298 static int hf_ieee80211_wfa_ie_wme_tspec_mean_data = -1;
4299 static int hf_ieee80211_wfa_ie_wme_tspec_peak_data = -1;
4300 static int hf_ieee80211_wfa_ie_wme_tspec_burst_size = -1;
4301 static int hf_ieee80211_wfa_ie_wme_tspec_delay_bound = -1;
4302 static int hf_ieee80211_wfa_ie_wme_tspec_min_phy = -1;
4303 static int hf_ieee80211_wfa_ie_wme_tspec_surplus = -1;
4304 static int hf_ieee80211_wfa_ie_wme_tspec_medium = -1;
4305
4306 static int hf_ieee80211_aironet_ie_type = -1;
4307 static int hf_ieee80211_aironet_ie_dtpc = -1;
4308 static int hf_ieee80211_aironet_ie_version = -1;
4309 static int hf_ieee80211_aironet_ie_data = -1;
4310 static int hf_ieee80211_aironet_ie_qos_reserved = -1;
4311 static int hf_ieee80211_aironet_ie_qos_paramset = -1;
4312 static int hf_ieee80211_aironet_ie_qos_val = -1;
4313 static int hf_ieee80211_aironet_ie_clientmfp = -1;
4314
4315 static int hf_ieee80211_vs_nintendo_type = -1;
4316 static int hf_ieee80211_vs_nintendo_length = -1;
4317 static int hf_ieee80211_vs_nintendo_servicelist = -1;
4318 static int hf_ieee80211_vs_nintendo_service = -1;
4319 static int hf_ieee80211_vs_nintendo_consoleid = -1;
4320 static int hf_ieee80211_vs_nintendo_unknown = -1;
4321
4322 static int hf_ieee80211_vs_aruba_subtype = -1;
4323 static int hf_ieee80211_vs_aruba_apname = -1;
4324 static int hf_ieee80211_vs_aruba_data = -1;
4325
4326 static int hf_ieee80211_vs_mikrotik_unknown = -1;
4327 static int hf_ieee80211_vs_mikrotik_subitem = -1;
4328 static int hf_ieee80211_vs_mikrotik_subtype = -1;
4329 static int hf_ieee80211_vs_mikrotik_sublength = -1;
4330 static int hf_ieee80211_vs_mikrotik_subdata = -1;
4331
4332 static int hf_ieee80211_vs_meru_subitem = -1;
4333 static int hf_ieee80211_vs_meru_subtype = -1;
4334 static int hf_ieee80211_vs_meru_sublength = -1;
4335 static int hf_ieee80211_vs_meru_subdata = -1;
4336
4337 static int hf_ieee80211_vs_extreme_subtype = -1;
4338 static int hf_ieee80211_vs_extreme_subdata = -1;
4339 static int hf_ieee80211_vs_extreme_unknown = -1;
4340 static int hf_ieee80211_vs_extreme_ap_length = -1;
4341 static int hf_ieee80211_vs_extreme_ap_name = -1;
4342
4343 static int hf_ieee80211_rsn_ie_pmkid = -1;
4344 static int hf_ieee80211_rsn_ie_unknown = -1;
4345
4346 static int hf_ieee80211_marvell_ie_type = -1;
4347 static int hf_ieee80211_marvell_ie_mesh_subtype = -1;
4348 static int hf_ieee80211_marvell_ie_mesh_version = -1;
4349 static int hf_ieee80211_marvell_ie_mesh_active_proto_id = -1;
4350 static int hf_ieee80211_marvell_ie_mesh_active_metric_id = -1;
4351 static int hf_ieee80211_marvell_ie_mesh_cap = -1;
4352 static int hf_ieee80211_marvell_ie_data = -1;
4353
4354 static int hf_ieee80211_atheros_ie_type = -1;
4355 static int hf_ieee80211_atheros_ie_subtype = -1;
4356 static int hf_ieee80211_atheros_ie_version = -1;
4357 static int hf_ieee80211_atheros_ie_cap_f_turbop = -1;
4358 static int hf_ieee80211_atheros_ie_cap_f_comp = -1;
4359 static int hf_ieee80211_atheros_ie_cap_f_ff = -1;
4360 static int hf_ieee80211_atheros_ie_cap_f_xr = -1;
4361 static int hf_ieee80211_atheros_ie_cap_f_ar = -1;
4362 static int hf_ieee80211_atheros_ie_cap_f_burst = -1;
4363 static int hf_ieee80211_atheros_ie_cap_f_wme = -1;
4364 static int hf_ieee80211_atheros_ie_cap_f_boost = -1;
4365 static int hf_ieee80211_atheros_ie_advcap_cap = -1;
4366 static int hf_ieee80211_atheros_ie_advcap_defkey = -1;
4367 static int hf_ieee80211_atheros_ie_xr_info = -1;
4368 static int hf_ieee80211_atheros_ie_xr_base_bssid = -1;
4369 static int hf_ieee80211_atheros_ie_xr_xr_bssid = -1;
4370 static int hf_ieee80211_atheros_ie_xr_xr_beacon = -1;
4371 static int hf_ieee80211_atheros_ie_xr_base_cap = -1;
4372 static int hf_ieee80211_atheros_ie_xr_xr_cap = -1;
4373 static int hf_ieee80211_atheros_ie_data = -1;
4374
4375 /*QBSS - Version 1,2,802.11e*/
4376
4377 static int hf_ieee80211_qbss2_cal = -1;
4378 static int hf_ieee80211_qbss2_gl = -1;
4379 static int hf_ieee80211_qbss_cu = -1;
4380 static int hf_ieee80211_qbss2_cu = -1;
4381 static int hf_ieee80211_qbss_scount = -1;
4382 static int hf_ieee80211_qbss2_scount = -1;
4383 static int hf_ieee80211_qbss_version = -1;
4384 static int hf_ieee80211_qbss_adc = -1;
4385
4386 static int hf_ieee80211_tsinfo = -1;
4387 static int hf_ieee80211_tsinfo_type = -1;
4388 static int hf_ieee80211_tsinfo_tsid = -1;
4389 static int hf_ieee80211_tsinfo_dir = -1;
4390 static int hf_ieee80211_tsinfo_access = -1;
4391 static int hf_ieee80211_tsinfo_agg = -1;
4392 static int hf_ieee80211_tsinfo_apsd = -1;
4393 static int hf_ieee80211_tsinfo_up = -1;
4394 static int hf_ieee80211_tsinfo_ack = -1;
4395 static int hf_ieee80211_tsinfo_sched = -1;
4396 static int hf_ieee80211_tsinfo_rsv = -1;
4397
4398 static const int *ieee80211_tsinfo_fields[] = {
4399   &hf_ieee80211_tsinfo_type,
4400   &hf_ieee80211_tsinfo_tsid,
4401   &hf_ieee80211_tsinfo_dir,
4402   &hf_ieee80211_tsinfo_access,
4403   &hf_ieee80211_tsinfo_agg,
4404   &hf_ieee80211_tsinfo_apsd,
4405   &hf_ieee80211_tsinfo_up,
4406   &hf_ieee80211_tsinfo_ack,
4407   &hf_ieee80211_tsinfo_sched,
4408   &hf_ieee80211_tsinfo_rsv,
4409   NULL
4410 };
4411
4412 static int hf_ieee80211_tspec_nor_msdu = -1;
4413 static int hf_ieee80211_tspec_max_msdu = -1;
4414 static int hf_ieee80211_tspec_min_srv = -1;
4415 static int hf_ieee80211_tspec_max_srv = -1;
4416 static int hf_ieee80211_tspec_inact_int = -1;
4417 static int hf_ieee80211_tspec_susp_int = -1;
4418 static int hf_ieee80211_tspec_srv_start = -1;
4419 static int hf_ieee80211_tspec_min_data = -1;
4420 static int hf_ieee80211_tspec_mean_data = -1;
4421 static int hf_ieee80211_tspec_peak_data = -1;
4422 static int hf_ieee80211_tspec_burst_size = -1;
4423 static int hf_ieee80211_tspec_delay_bound = -1;
4424 static int hf_ieee80211_tspec_min_phy = -1;
4425 static int hf_ieee80211_tspec_surplus = -1;
4426 static int hf_ieee80211_tspec_medium = -1;
4427 static int hf_ieee80211_tspec_dmg = -1;
4428 static int hf_ieee80211_ts_delay = -1;
4429 static int hf_ieee80211_tclas_process = -1;
4430 static int hf_ieee80211_tag_ext_supp_rates = -1;
4431 static int hf_ieee80211_sched_info = -1;
4432 static int hf_ieee80211_sched_info_agg = -1;
4433 static int hf_ieee80211_sched_info_tsid = -1;
4434 static int hf_ieee80211_sched_info_dir = -1;
4435 static int hf_ieee80211_sched_srv_start = -1;
4436 static int hf_ieee80211_sched_srv_int = -1;
4437 static int hf_ieee80211_sched_spec_int = -1;
4438 static int hf_ieee80211_tclas_up = -1;
4439 static int hf_ieee80211_tclas_class_type = -1;
4440 static int hf_ieee80211_tclas_class_mask = -1;
4441 static int hf_ieee80211_tclas_class_mask0_src_addr = -1;
4442 static int hf_ieee80211_tclas_class_mask0_dst_addr = -1;
4443 static int hf_ieee80211_tclas_class_mask0_type = -1;
4444 static int hf_ieee80211_tclas_class_mask1_ver = -1;
4445 static int hf_ieee80211_tclas_class_mask1_src_ip = -1;
4446 static int hf_ieee80211_tclas_class_mask1_dst_ip = -1;
4447 static int hf_ieee80211_tclas_class_mask1_src_port = -1;
4448 static int hf_ieee80211_tclas_class_mask1_dst_port = -1;
4449 static int hf_ieee80211_tclas_class_mask1_ipv4_dscp = -1;
4450 static int hf_ieee80211_tclas_class_mask1_ipv4_proto = -1;
4451 static int hf_ieee80211_tclas_class_mask1_ipv6_flow = -1;
4452 static int hf_ieee80211_tclas_class_mask2_tci = -1;
4453 static int hf_ieee80211_tclas_src_mac_addr = -1;
4454 static int hf_ieee80211_tclas_dst_mac_addr = -1;
4455 static int hf_ieee80211_tclas_ether_type = -1;
4456 static int hf_ieee80211_tclas_version = -1;
4457 static int hf_ieee80211_tclas_ipv4_src = -1;
4458 static int hf_ieee80211_tclas_ipv4_dst = -1;
4459 static int hf_ieee80211_tclas_src_port = -1;
4460 static int hf_ieee80211_tclas_dst_port = -1;
4461 static int hf_ieee80211_tclas_dscp = -1;
4462 static int hf_ieee80211_tclas_protocol = -1;
4463 static int hf_ieee80211_tclas_ipv6_src = -1;
4464 static int hf_ieee80211_tclas_ipv6_dst = -1;
4465 static int hf_ieee80211_tclas_flow = -1;
4466 static int hf_ieee80211_tclas_tag_type = -1;
4467
4468 static int hf_ieee80211_aruba = -1;
4469 static int hf_ieee80211_aruba_hb_seq = -1;
4470 static int hf_ieee80211_aruba_mtu = -1;
4471
4472 static int hf_ieee80211_tag_vendor_oui_type = -1;
4473 static int hf_ieee80211_tag_vendor_data = -1;
4474
4475 /* IEEE Std 802.11z-2010 7.3.2.62 */
4476 static int hf_ieee80211_tag_link_id_bssid = -1;
4477 static int hf_ieee80211_tag_link_id_init_sta = -1;
4478 static int hf_ieee80211_tag_link_id_resp_sta = -1;
4479
4480 /* IEEE Std 802.11z-2010 7.3.2.63 */
4481 static int hf_ieee80211_tag_wakeup_schedule_offset = -1;
4482 static int hf_ieee80211_tag_wakeup_schedule_interval = -1;
4483 static int hf_ieee80211_tag_wakeup_schedule_awake_window_slots = -1;
4484 static int hf_ieee80211_tag_wakeup_schedule_max_awake_dur = -1;
4485 static int hf_ieee80211_tag_wakeup_schedule_idle_count = -1;
4486
4487 /* IEEE Std 802.11z-2010 7.3.2.64 */
4488 static int hf_ieee80211_tag_channel_switch_timing_switch_time = -1;
4489 static int hf_ieee80211_tag_channel_switch_timing_switch_timeout = -1;
4490
4491 /* IEEE Std 802.11z-2010 7.3.2.65 */
4492 static int hf_ieee80211_tag_pti_control_tid = -1;
4493 static int hf_ieee80211_tag_pti_control_sequence_control = -1;
4494
4495 /* IEEE Std 802.11z-2010 7.3.2.66 */
4496 static int hf_ieee80211_tag_pu_buffer_status_ac_bk = -1;
4497 static int hf_ieee80211_tag_pu_buffer_status_ac_be = -1;
4498 static int hf_ieee80211_tag_pu_buffer_status_ac_vi = -1;
4499 static int hf_ieee80211_tag_pu_buffer_status_ac_vo = -1;
4500
4501 /* IEEE Std 802.11r-2008 7.3.2.49 */
4502 static int hf_ieee80211_tag_timeout_int_type = -1;
4503 static int hf_ieee80211_tag_timeout_int_value = -1;
4504
4505 /* Ethertype 89-0d */
4506 static int hf_ieee80211_data_encap_payload_type = -1;
4507
4508 static int hf_ieee80211_anqp_wfa_subtype = -1;
4509
4510 /* Hotspot 2.0 */
4511 static int hf_hs20_indication_dgaf_disabled = -1;
4512 static int hf_hs20_indication_pps_mo_id_present = -1;
4513 static int hf_hs20_indication_anqp_domain_id_present = -1;
4514 static int hf_hs20_indication_release_number = -1;
4515
4516 static int hf_hs20_anqp_subtype = -1;
4517 static int hf_hs20_anqp_reserved = -1;
4518 static int hf_hs20_anqp_payload = -1;
4519 static int hf_hs20_anqp_hs_query_list = -1;
4520 static int hf_hs20_anqp_hs_capability_list = -1;
4521 static int hf_hs20_anqp_ofn_length = -1;
4522 static int hf_hs20_anqp_ofn_language = -1;
4523 static int hf_hs20_anqp_ofn_name = -1;
4524 static int hf_hs20_anqp_wan_metrics_link_status = -1;
4525 static int hf_hs20_anqp_wan_metrics_symmetric_link = -1;
4526 static int hf_hs20_anqp_wan_metrics_at_capacity = -1;
4527 static int hf_hs20_anqp_wan_metrics_reserved = -1;
4528 static int hf_hs20_anqp_wan_metrics_downlink_speed = -1;
4529 static int hf_hs20_anqp_wan_metrics_uplink_speed = -1;
4530 static int hf_hs20_anqp_wan_metrics_downlink_load = -1;
4531 static int hf_hs20_anqp_wan_metrics_uplink_load = -1;
4532 static int hf_hs20_anqp_wan_metrics_lmd = -1;
4533 static int hf_hs20_anqp_cc_proto_ip_proto = -1;
4534 static int hf_hs20_anqp_cc_proto_port_num = -1;
4535 static int hf_hs20_anqp_cc_proto_status = -1;
4536 static int hf_hs20_anqp_nai_hrq_count = -1;
4537 static int hf_hs20_anqp_nai_hrq_encoding_type = -1;
4538 static int hf_hs20_anqp_nai_hrq_length = -1;
4539 static int hf_hs20_anqp_nai_hrq_realm_name = -1;
4540 static int hf_hs20_anqp_oper_class_indic = -1;
4541
4542 /* IEEE Std 802.11ad */
4543 static int hf_ieee80211_block_ack_RBUFCAP = -1;
4544 static int hf_ieee80211_cf_response_offset = -1;
4545 static int hf_ieee80211_grant_ack_reserved = -1;
4546 static int hf_ieee80211_ff_dynamic_allocation = -1;
4547 static int hf_ieee80211_ff_TID = -1;
4548 static int hf_ieee80211_ff_alloc_type = -1;
4549 static int hf_ieee80211_ff_src_aid = -1;
4550 static int hf_ieee80211_ff_dest_aid = -1;
4551 static int hf_ieee80211_ff_alloc_duration = -1;
4552 static int hf_ieee80211_ff_b39 = -1;
4553 static int hf_ieee80211_ff_ssw = -1;
4554 static int hf_ieee80211_ff_ssw_direction = -1;
4555 static int hf_ieee80211_ff_ssw_cdown = -1;
4556 static int hf_ieee80211_ff_ssw_sector_id = -1;
4557 static int hf_ieee80211_ff_ssw_dmg_ant_id = -1;
4558 static int hf_ieee80211_ff_ssw_rxss_len = -1;
4559 static int hf_ieee80211_ff_bf = -1;
4560 static int hf_ieee80211_ff_bf_train = -1;
4561 static int hf_ieee80211_ff_bf_is_init = -1;
4562 static int hf_ieee80211_ff_bf_is_resp = -1;
4563 static int hf_ieee80211_ff_bf_num_sectors = -1;
4564 static int hf_ieee80211_ff_bf_num_rx_dmg_ants = -1;
4565 static int hf_ieee80211_ff_bf_b12b15 = -1;
4566 static int hf_ieee80211_ff_bf_rxss_len = -1;
4567 static int hf_ieee80211_ff_bf_rxss_rate = -1;
4568 static int hf_ieee80211_ff_bf_b10b15 = -1;
4569 static int hf_ieee80211_addr_nav_da = -1;
4570 static int hf_ieee80211_addr_nav_sa = -1;
4571 static int hf_ieee80211_ff_sswf = -1;
4572 static int hf_ieee80211_ff_sswf_num_rx_dmg_ants = -1;
4573 static int hf_ieee80211_ff_sswf_poll_required = -1;
4574 static int hf_ieee80211_ff_sswf_total_sectors = -1;
4575 static int hf_ieee80211_ff_sswf_reserved1 = -1;
4576 static int hf_ieee80211_ff_sswf_reserved2 = -1;
4577 static int hf_ieee80211_ff_sswf_sector_select = -1;
4578 static int hf_ieee80211_ff_sswf_dmg_antenna_select = -1;
4579 static int hf_ieee80211_ff_sswf_snr_report = -1;
4580 static int hf_ieee80211_ff_brp = -1;
4581 static int hf_ieee80211_ff_brp_L_RX = -1;
4582 static int hf_ieee80211_ff_brp_TX_TRN_REQ = -1;
4583 static int hf_ieee80211_ff_brp_MID_REQ = -1;
4584 static int hf_ieee80211_ff_brp_BC_REQ = -1;
4585 static int hf_ieee80211_ff_brp_MID_GRANT = -1;
4586 static int hf_ieee80211_ff_brp_BC_GRANT = -1;
4587 static int hf_ieee80211_ff_brp_chan_FBCK_CAP = -1;
4588 static int hf_ieee80211_ff_brp_tx_sector = -1;
4589 static int hf_ieee80211_ff_brp_other_aid = -1;
4590 static int hf_ieee80211_ff_brp_tx_antenna = -1;
4591 static int hf_ieee80211_ff_brp_reserved = -1;
4592 static int hf_ieee80211_ff_blm = -1;
4593 static int hf_ieee80211_ff_blm_unit_index = -1;
4594 static int hf_ieee80211_ff_blm_maint_value = -1;
4595 static int hf_ieee80211_ff_blm_is_master = -1;
4596 static int hf_ieee80211_ff_bic = -1;
4597 static int hf_ieee80211_ff_bic_cc_present = -1;
4598 static int hf_ieee80211_ff_bic_discovery_mode = -1;
4599 static int hf_ieee80211_ff_bic_next_beacon = -1;
4600 static int hf_ieee80211_ff_bic_ati_present = -1;
4601 static int hf_ieee80211_ff_bic_abft_len = -1;
4602 static int hf_ieee80211_ff_bic_fss = -1;
4603 static int hf_ieee80211_ff_bic_is_resp = -1;
4604 static int hf_ieee80211_ff_bic_next_abft = -1;
4605 static int hf_ieee80211_ff_bic_frag_txss = -1;
4606 static int hf_ieee80211_ff_bic_txss_span = -1;
4607 static int hf_ieee80211_ff_bic_NBI_abft = -1;
4608 static int hf_ieee80211_ff_bic_abft_count = -1;
4609 static int hf_ieee80211_ff_bic_nabft = -1;
4610 static int hf_ieee80211_ff_bic_pcp = -1;
4611 static int hf_ieee80211_ff_bic_reserved = -1;
4612 static int hf_ieee80211_ff_dmg_params = -1;
4613 static int hf_ieee80211_ff_dmg_params_bss = -1;
4614 static int hf_ieee80211_ff_dmg_params_cbap_only = -1;
4615 static int hf_ieee80211_ff_dmg_params_cbap_src = -1;
4616 static int hf_ieee80211_ff_dmg_params_privacy = -1;
4617 static int hf_ieee80211_ff_dmg_params_policy = -1;
4618 static int hf_ieee80211_ff_cc = -1;
4619 static int hf_ieee80211_ff_cc_abft_resp_addr = -1;
4620 static int hf_ieee80211_ff_cc_sp_duration = -1;
4621 static int hf_ieee80211_ff_cc_cluster_id = -1;
4622 static int hf_ieee80211_ff_cc_role = -1;
4623 static int hf_ieee80211_ff_cc_max_mem = -1;
4624 static int hf_ieee80211_ff_dmg_action_code = -1;
4625 static int hf_ieee80211_ff_dmg_pwr_mgmt = -1;
4626 static int hf_ieee80211_ff_subject_address = -1;
4627 static int hf_ieee80211_ff_handover_reason = -1;
4628 static int hf_ieee80211_ff_handover_remaining_bi = -1;
4629 static int hf_ieee80211_ff_handover_result = -1;
4630 static int hf_ieee80211_ff_handover_reject_reason = -1;
4631 static int hf_ieee80211_ff_destination_reds_aid = -1;
4632 static int hf_ieee80211_ff_destination_aid = -1;
4633 static int hf_ieee80211_ff_realy_aid = -1;
4634 static int hf_ieee80211_ff_source_aid = -1;
4635 static int hf_ieee80211_ff_timing_offset = -1;
4636 static int hf_ieee80211_ff_sampling_frequency_offset = -1;
4637 static int hf_ieee80211_ff_relay_operation_type = -1;
4638 static int hf_ieee80211_ff_peer_sta_aid = -1;
4639 static int hf_ieee80211_ff_snr = -1;
4640 static int hf_ieee80211_ff_internal_angle = -1;
4641 static int hf_ieee80211_ff_recommend = -1;
4642 static int hf_ieee80211_ff_unprotected_dmg_action_code = -1;
4643 static int hf_ieee80211_ff_fst_action_code = -1;
4644 static int hf_ieee80211_ff_llt = -1;
4645 static int hf_ieee80211_ff_fsts_id = -1;
4646 static int hf_ieee80211_ff_mmpdu_len = -1;
4647 static int hf_ieee80211_ff_mmpdu_ctrl = -1;
4648 static int hf_ieee80211_ff_oct_mmpdu = -1;
4649 #if 0
4650 static int hf_ieee80211_ff_rcsi = -1;
4651 static int hf_ieee80211_ff_rcsi_aid = -1;
4652 #endif
4653 static int hf_ieee80211_ff_band_id = -1;
4654 static int hf_ieee80211_tag_relay_support = -1;
4655 static int hf_ieee80211_tag_relay_use = -1;
4656 static int hf_ieee80211_tag_relay_permission = -1;
4657 static int hf_ieee80211_tag_AC_power = -1;
4658 static int hf_ieee80211_tag_relay_prefer = -1;
4659 static int hf_ieee80211_tag_duplex = -1;
4660 static int hf_ieee80211_tag_cooperation = -1;
4661 static int hf_ieee80211_tag_move = -1;
4662 static int hf_ieee80211_tag_size = -1;
4663 static int hf_ieee80211_tag_tbtt_offset = -1;
4664 static int hf_ieee80211_tag_bi_duration = -1;
4665 static int hf_ieee80211_tag_dmg_capa_sta_addr = -1;
4666 static int hf_ieee80211_tag_dmg_capa_aid = -1;
4667 static int hf_ieee80211_tag_reverse_direction = -1;
4668 static int hf_ieee80211_tag_hlts = -1;
4669 static int hf_ieee80211_tag_tpc = -1;
4670 static int hf_ieee80211_tag_spsh = -1;
4671 static int hf_ieee80211_tag_rx_antenna = -1;
4672 static int hf_ieee80211_tag_fast_link = -1;
4673 static int hf_ieee80211_tag_num_sectors = -1;
4674 static int hf_ieee80211_tag_rxss_length = -1;
4675 static int hf_ieee80211_tag_reciprocity = -1;
4676 static int hf_ieee80211_tag_max_ampdu_exp = -1;
4677 static int hf_ieee80211_tag_min_mpdu_sapcing = -1;
4678 static int hf_ieee80211_tag_ba_flow_control = -1;
4679 static int hf_ieee80211_tag_max_sc_rx_mcs = -1;
4680 static int hf_ieee80211_tag_max_ofdm_rx_mcs = -1;
4681 static int hf_ieee80211_tag_max_sc_tx_mcs = -1;
4682 static int hf_ieee80211_tag_max_ofdm_tx_mcs = -1;
4683 static int hf_ieee80211_tag_low_power_supported = -1;
4684 static int hf_ieee80211_tag_code_rate = -1;
4685 static int hf_ieee80211_tag_dtp = -1;
4686 static int hf_ieee80211_tag_appdu_supp = -1;
4687 static int hf_ieee80211_tag_heartbeat = -1;
4688 static int hf_ieee80211_tag_other_aid = -1;
4689 static int hf_ieee80211_tag_pattern_recip = -1;
4690 static int hf_ieee80211_tag_heartbeat_elapsed = -1;
4691 static int hf_ieee80211_tag_grant_ack_supp = -1;
4692 static int hf_ieee80211_tag_RXSSTxRate_supp = -1;
4693 static int hf_ieee80211_tag_pcp_tddti = -1;
4694 static int hf_ieee80211_tag_pcp_PSA = -1;
4695 static int hf_ieee80211_tag_pcp_handover = -1;
4696 static int hf_ieee80211_tag_pcp_max_assoc = -1;
4697 static int hf_ieee80211_tag_pcp_power_src = -1;
4698 static int hf_ieee80211_tag_pcp_decenter = -1;
4699 static int hf_ieee80211_tag_pcp_forwarding = -1;
4700 static int hf_ieee80211_tag_pcp_center = -1;
4701 static int hf_ieee80211_tag_PSRSI = -1;
4702 static int hf_ieee80211_tag_min_BHI_duration = -1;
4703 static int hf_ieee80211_tag_brdct_sta_info_dur = -1;
4704 static int hf_ieee80211_tag_assoc_resp_confirm_time = -1;
4705 static int hf_ieee80211_tag_min_pp_duration = -1;
4706 static int hf_ieee80211_tag_SP_idle_timeout = -1;
4707 static int hf_ieee80211_tag_max_lost_beacons = -1;
4708 static int hf_ieee80211_tag_type = -1;
4709 static int hf_ieee80211_tag_tap1 = -1;
4710 static int hf_ieee80211_tag_state1 = -1;
4711 static int hf_ieee80211_tag_tap2 = -1;
4712 static int hf_ieee80211_tag_state2 = -1;
4713 static int hf_ieee80211_tag_allocation_id = -1;
4714 static int hf_ieee80211_tag_allocation_type = -1;
4715 static int hf_ieee80211_tag_pseudo_static = -1;
4716 static int hf_ieee80211_tag_truncatable = -1;
4717 static int hf_ieee80211_tag_extendable = -1;
4718 static int hf_ieee80211_tag_pcp_active = -1;
4719 static int hf_ieee80211_tag_lp_sc_used = -1;
4720 static int hf_ieee80211_tag_src_aid = -1;
4721 static int hf_ieee80211_tag_dest_aid = -1;
4722 static int hf_ieee80211_tag_alloc_start = -1;
4723 static int hf_ieee80211_tag_alloc_block_duration = -1;
4724 static int hf_ieee80211_tag_num_blocks = -1;
4725 static int hf_ieee80211_tag_alloc_block_period = -1;
4726 static int hf_ieee80211_tag_aid = -1;
4727 static int hf_ieee80211_tag_cbap = -1;
4728 static int hf_ieee80211_tag_pp_avail = -1;
4729 static int hf_ieee80211_tag_next_ati_start_time = -1;
4730 static int hf_ieee80211_tag_next_ati_duration = -1;
4731 static int hf_ieee80211_tag_old_bssid = -1;
4732 static int hf_ieee80211_tag_new_pcp_addr = -1;
4733 static int hf_ieee80211_tag_bssid = -1;
4734 static int hf_ieee80211_tag_duplex_relay = -1;
4735 static int hf_ieee80211_tag_cooperation_relay = -1;
4736 static int hf_ieee80211_tag_tx_mode = -1;
4737 static int hf_ieee80211_tag_link_change_interval = -1;
4738 static int hf_ieee80211_tag_data_sensing_time = -1;
4739 static int hf_ieee80211_tag_first_period = -1;
4740 static int hf_ieee80211_tag_second_period = -1;
4741 static int hf_ieee80211_tag_initiator = -1;
4742 static int hf_ieee80211_tag_tx_train_res = -1;
4743 static int hf_ieee80211_tag_rx_train_res = -1;
4744 static int hf_ieee80211_tag_tx_trn_ok = -1;
4745 static int hf_ieee80211_tag_txss_fbck_req = -1;
4746 static int hf_ieee80211_tag_bs_fbck = -1;
4747 static int hf_ieee80211_tag_bs_fbck_antenna_id = -1;
4748 static int hf_ieee80211_tag_snr_requested = -1;
4749 static int hf_ieee80211_tag_channel_measurement_requested = -1;
4750 static int hf_ieee80211_tag_number_of_taps_requested = -1;
4751 static int hf_ieee80211_tag_sector_id_order_req = -1;
4752 static int hf_ieee80211_tag_snr_present = -1;
4753 static int hf_ieee80211_tag_channel_measurement_present = -1;
4754 static int hf_ieee80211_tag_tap_delay_present = -1;
4755 static int hf_ieee80211_tag_number_of_taps_present = -1;
4756 static int hf_ieee80211_tag_number_of_measurement = -1;
4757 static int hf_ieee80211_tag_sector_id_order_present = -1;
4758 static int hf_ieee80211_tag_number_of_beams = -1;
4759 static int hf_ieee80211_tag_mid_extension = -1;
4760 static int hf_ieee80211_tag_capability_request = -1;
4761 static int hf_ieee80211_tag_beam_refine_reserved = -1;
4762 static int hf_ieee80211_tag_nextpcp_list = -1;
4763 static int hf_ieee80211_tag_nextpcp_token = -1;
4764 static int hf_ieee80211_tag_reamaining_BI = -1;
4765 static int hf_ieee80211_tag_request_token = -1;
4766 static int hf_ieee80211_tag_bi_start_time = -1;
4767 static int hf_ieee80211_tag_sleep_cycle = -1;
4768 static int hf_ieee80211_tag_num_awake_bis = -1;
4769 static int hf_ieee80211_tag_tspec_allocation_id = -1;
4770 static int hf_ieee80211_tag_tspec_allocation_type = -1;
4771 static int hf_ieee80211_tag_tspec_allocation_format = -1;
4772 static int hf_ieee80211_tag_tspec_pseudo_static = -1;
4773 static int hf_ieee80211_tag_tspec_truncatable = -1;
4774 static int hf_ieee80211_tag_tspec_extendable = -1;
4775 static int hf_ieee80211_tag_tspec_lp_sc_used = -1;
4776 static int hf_ieee80211_tag_tspec_up = -1;
4777 static int hf_ieee80211_tag_tspec_dest_aid = -1;
4778 static int hf_ieee80211_tag_tspec_allocation_period = -1;
4779 static int hf_ieee80211_tag_tspec_min_allocation = -1;
4780 static int hf_ieee80211_tag_tspec_max_allocation = -1;
4781 static int hf_ieee80211_tag_tspec_min_duration = -1;
4782 static int hf_ieee80211_tag_tspec_num_of_constraints = -1;
4783 static int hf_ieee80211_tag_tspec_tsconst_start_time = -1;
4784 static int hf_ieee80211_tag_tspec_tsconst_duration = -1;
4785 static int hf_ieee80211_tag_tspec_tsconst_period = -1;
4786 static int hf_ieee80211_tag_tspec_tsconst_interferer_mac = -1;
4787 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_I = -1;
4788 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_Q = -1;
4789 static int hf_ieee80211_tag_channel_measurement_feedback_tap_delay = -1;
4790 static int hf_ieee80211_tag_channel_measurement_feedback_sector_id = -1;
4791 static int hf_ieee80211_tag_channel_measurement_feedback_antenna_id = -1;
4792 static int hf_ieee80211_tag_awake_window = -1;
4793 static int hf_ieee80211_tag_addba_ext_no_frag = -1;
4794 static int hf_ieee80211_tag_multi_band_ctrl_sta_role = -1;
4795 static int hf_ieee80211_tag_multi_band_ctrl_addr_present = -1;
4796 static int hf_ieee80211_tag_multi_band_ctrl_cipher_present = -1;
4797 static int hf_ieee80211_tag_multi_band_oper_class = -1;
4798 static int hf_ieee80211_tag_multi_band_channel_number = -1;
4799 static int hf_ieee80211_tag_multi_band_tsf_offset = -1;
4800 static int hf_ieee80211_tag_multi_band_conn_ap = -1;
4801 static int hf_ieee80211_tag_multi_band_conn_pcp = -1;
4802 static int hf_ieee80211_tag_multi_band_conn_dls = -1;
4803 static int hf_ieee80211_tag_multi_band_conn_tdls = -1;
4804 static int hf_ieee80211_tag_multi_band_conn_ibss = -1;
4805 static int hf_ieee80211_tag_multi_band_fst_timeout = -1;
4806 static int hf_ieee80211_tag_multi_band_sta_mac = -1;
4807 static int hf_ieee80211_tag_activity = -1;
4808 static int hf_ieee80211_tag_dmg_link_adapt_mcs = -1;
4809 static int hf_ieee80211_tag_dmg_link_adapt_link_margin = -1;
4810 static int hf_ieee80211_tag_ref_timestamp = -1;
4811 static int hf_ieee80211_tag_switching_stream_non_qos = -1;
4812 static int hf_ieee80211_tag_switching_stream_param_num = -1;
4813 static int hf_ieee80211_tag_switching_stream_old_tid = -1;
4814 static int hf_ieee80211_tag_switching_stream_old_direction = -1;
4815 static int hf_ieee80211_tag_switching_stream_new_tid = -1;
4816 static int hf_ieee80211_tag_switching_stream_new_direction = -1;
4817 static int hf_ieee80211_tag_switching_stream_new_valid_id = -1;
4818 static int hf_ieee80211_tag_switching_stream_llt_type = -1;
4819
4820 static int hf_ieee80211_mysterious_olpc_stuff = -1;
4821
4822 /* ************************************************************************* */
4823 /*                               Protocol trees                              */
4824 /* ************************************************************************* */
4825 static gint ett_80211 = -1;
4826 static gint ett_proto_flags = -1;
4827 static gint ett_cap_tree = -1;
4828 static gint ett_fc_tree = -1;
4829 static gint ett_cntrl_wrapper_fc = -1;
4830 static gint ett_cntrl_wrapper_payload = -1;
4831 static gint ett_fragments = -1;
4832 static gint ett_fragment = -1;
4833 static gint ett_block_ack = -1;
4834 static gint ett_block_ack_bitmap = -1;
4835 static gint ett_ath_cap_tree = -1;
4836
4837 static gint ett_80211_mgt = -1;
4838 static gint ett_fixed_parameters = -1;
4839 static gint ett_tagged_parameters = -1;
4840 static gint ett_tag_bmapctl_tree = -1;
4841 static gint ett_tag_country_fnm_tree = -1;
4842 static gint ett_tag_country_rcc_tree = -1;
4843 static gint ett_qos_parameters = -1;
4844 static gint ett_qos_ps_buf_state = -1;
4845 static gint ett_wep_parameters = -1;
4846 static gint ett_msh_control = -1;
4847 static gint ett_hwmp_targ_flags_tree = -1;
4848 static gint ett_mesh_chswitch_flag_tree = -1;
4849 static gint ett_mesh_config_cap_tree = -1;
4850 static gint ett_mesh_formation_info_tree = -1;
4851
4852 static gint ett_rsn_gcs_tree = -1;
4853 static gint ett_rsn_pcs_tree = -1;
4854 static gint ett_rsn_sub_pcs_tree = -1;
4855 static gint ett_rsn_akms_tree = -1;
4856 static gint ett_rsn_sub_akms_tree = -1;
4857 static gint ett_rsn_cap_tree = -1;
4858 static gint ett_rsn_pmkid_tree = -1;
4859 static gint ett_rsn_gmcs_tree = -1;
4860
4861 static gint ett_wpa_mcs_tree = -1;
4862 static gint ett_wpa_ucs_tree = -1;
4863 static gint ett_wpa_sub_ucs_tree = -1;
4864 static gint ett_wpa_akms_tree = -1;
4865 static gint ett_wpa_sub_akms_tree = -1;
4866 static gint ett_wme_ac = -1;
4867 static gint ett_wme_aci_aifsn = -1;
4868 static gint ett_wme_ecw = -1;
4869 static gint ett_wme_qos_info = -1;
4870
4871 static gint ett_ht_cap_tree = -1;
4872 static gint ett_ampduparam_tree = -1;
4873 static gint ett_mcsset_tree = -1;
4874 static gint ett_mcsbit_tree = -1;
4875 static gint ett_htex_cap_tree = -1;
4876 static gint ett_txbf_tree = -1;
4877 static gint ett_antsel_tree = -1;
4878 static gint ett_hta_cap_tree = -1;
4879 static gint ett_hta_cap1_tree = -1;
4880 static gint ett_hta_cap2_tree = -1;
4881
4882 static gint ett_htc_tree = -1;
4883 static gint ett_mfb_subtree = -1;
4884 static gint ett_lac_subtree = -1;
4885
4886 static gint ett_vht_cap_tree = -1;
4887 static gint ett_vht_mcsset_tree = -1;
4888 static gint ett_vht_rx_mcsbit_tree = -1;
4889 static gint ett_vht_tx_mcsbit_tree = -1;
4890 static gint ett_vht_basic_mcsbit_tree = -1;
4891 static gint ett_vht_op_tree = -1;
4892 static gint ett_vht_tpe_info_tree = -1;
4893
4894 static gint ett_vht_ndp_annc_token_tree = -1;
4895 static gint ett_vht_ndp_annc_sta_info_tree = -1;
4896
4897 static gint ett_ff_vhtmimo_cntrl = -1;
4898 static gint ett_ff_vhtmimo_beamforming_report = -1;
4899 static gint ett_ff_vhtmimo_beamforming_report_snr = -1;
4900 static gint ett_ff_vhtmimo_beamforming_report_feedback_matrices = -1;
4901
4902 static gint ett_vht_grpidmgmt = -1;
4903 static gint ett_vht_msa = -1;
4904 static gint ett_vht_upa = -1;
4905
4906 static gint ett_ht_info_delimiter1_tree = -1;
4907 static gint ett_ht_info_delimiter2_tree = -1;
4908 static gint ett_ht_info_delimiter3_tree = -1;
4909
4910 static gint ett_tag_measure_request_mode_tree = -1;
4911 static gint ett_tag_measure_request_type_tree = -1;
4912 static gint ett_tag_measure_report_mode_tree = -1;
4913 static gint ett_tag_measure_report_type_tree = -1;
4914 static gint ett_tag_measure_report_basic_map_tree = -1;
4915 static gint ett_tag_measure_report_rpi_tree = -1;
4916 static gint ett_tag_measure_report_frame_tree = -1;
4917 static gint ett_tag_measure_reported_frame_tree = -1;
4918 static gint ett_tag_bss_bitmask_tree = -1;
4919 static gint ett_tag_dfs_map_tree = -1;
4920 static gint ett_tag_erp_info_tree = -1;
4921 static gint ett_tag_ex_cap1 = -1;
4922 static gint ett_tag_ex_cap2 = -1;
4923 static gint ett_tag_ex_cap3 = -1;
4924 static gint ett_tag_ex_cap4 = -1;
4925 static gint ett_tag_ex_cap5 = -1;
4926 static gint ett_tag_ex_cap6 = -1;
4927 static gint ett_tag_ex_cap7 = -1;
4928 static gint ett_tag_ex_cap8 = -1;
4929 static gint ett_tag_ex_cap9 = -1;
4930
4931 static gint ett_tag_rm_cap1 = -1;
4932 static gint ett_tag_rm_cap2 = -1;
4933 static gint ett_tag_rm_cap3 = -1;
4934 static gint ett_tag_rm_cap4 = -1;
4935 static gint ett_tag_rm_cap5 = -1;
4936
4937 static gint ett_tag_20_40_bc = -1;
4938
4939 static gint ett_tag_tclas_mask_tree = -1;
4940
4941 static gint ett_tag_supported_channels = -1;
4942
4943 static gint ett_tag_neighbor_report_bssid_info_tree = -1;
4944 static gint ett_tag_neighbor_report_bssid_info_capability_tree = -1;
4945 static gint ett_tag_neighbor_report_sub_tag_tree = -1;
4946
4947 static gint ett_tag_wapi_param_set_akm_tree = -1;
4948 static gint ett_tag_wapi_param_set_ucast_tree = -1;
4949 static gint ett_tag_wapi_param_set_mcast_tree = -1;
4950 static gint ett_tag_wapi_param_set_preauth_tree = -1;
4951
4952 static gint ett_tag_time_adv_tree = -1;
4953
4954 static gint ett_ff_ba_param_tree = -1;
4955 static gint ett_ff_ba_ssc_tree = -1;
4956 static gint ett_ff_delba_param_tree = -1;
4957 static gint ett_ff_qos_info = -1;
4958 static gint ett_ff_sm_pwr_save = -1;
4959 static gint ett_ff_psmp_param_set = -1;
4960 static gint ett_ff_mimo_cntrl = -1;
4961 static gint ett_ff_ant_sel = -1;
4962 static gint ett_mimo_report = -1;
4963 static gint ett_ff_chan_switch_announce = -1;
4964 static gint ett_ff_ht_info = -1;
4965 static gint ett_ff_psmp_sta_info = -1;
4966
4967 static gint ett_tpc = -1;
4968
4969 static gint ett_msdu_aggregation_parent_tree = -1;
4970 static gint ett_msdu_aggregation_subframe_tree = -1;
4971
4972 static gint ett_80211_mgt_ie = -1;
4973 static gint ett_tsinfo_tree = -1;
4974 static gint ett_sched_tree = -1;
4975
4976 static gint ett_fcs = -1;
4977
4978 static gint ett_adv_proto = -1;
4979 static gint ett_adv_proto_tuple = -1;
4980 static gint ett_gas_query = -1;
4981 static gint ett_gas_anqp = -1;
4982 static gint ett_nai_realm = -1;
4983 static gint ett_nai_realm_eap = -1;
4984 static gint ett_tag_ric_data_desc_ie = -1;
4985 static gint ett_anqp_vendor_capab = -1;
4986
4987 static gint ett_hs20_cc_proto_port_tuple = -1;
4988
4989 static gint ett_ssid_list = -1;
4990
4991 static gint ett_nintendo = -1;
4992
4993 static gint ett_mikrotik = -1;
4994
4995 static gint ett_meru = -1;
4996
4997 static gint ett_qos_map_set_exception = -1;
4998 static gint ett_qos_map_set_range = -1;
4999
5000 static expert_field ei_ieee80211_bad_length = EI_INIT;
5001 static expert_field ei_ieee80211_inv_val = EI_INIT;
5002 static expert_field ei_ieee80211_vht_tpe_pwr_info_count = EI_INIT;
5003 static expert_field ei_ieee80211_ff_query_response_length = EI_INIT;
5004 static expert_field ei_ieee80211_ff_anqp_nai_realm_eap_len = EI_INIT;
5005 static expert_field ei_hs20_anqp_nai_hrq_length = EI_INIT;
5006 static expert_field ei_ieee80211_extra_data = EI_INIT;
5007 static expert_field ei_ieee80211_tag_data = EI_INIT;
5008 static expert_field ei_ieee80211_tdls_setup_confirm_malformed = EI_INIT;
5009 static expert_field ei_ieee80211_ff_anqp_nai_field_len = EI_INIT;
5010 static expert_field ei_ieee80211_rsn_pcs_count = EI_INIT;
5011 static expert_field ei_ieee80211_tag_measure_request_unknown = EI_INIT;
5012 static expert_field ei_ieee80211_tag_measure_request_beacon_unknown = EI_INIT;
5013 static expert_field ei_ieee80211_tag_measure_report_unknown = EI_INIT;
5014 static expert_field ei_ieee80211_tag_number = EI_INIT;
5015 static expert_field ei_ieee80211_ff_anqp_info_length = EI_INIT;
5016 static expert_field ei_hs20_anqp_ofn_length = EI_INIT;
5017 static expert_field ei_ieee80211_tdls_setup_response_malformed = EI_INIT;
5018 static expert_field ei_ieee80211_ff_anqp_capability = EI_INIT;
5019 static expert_field ei_ieee80211_not_enough_room_for_anqp_header = EI_INIT;
5020 static expert_field ei_ieee80211_ff_query_request_length = EI_INIT;
5021 static expert_field ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype = EI_INIT;
5022 static expert_field ei_ieee80211_qos_info_bad_ftype = EI_INIT;
5023 static expert_field ei_ieee80211_qos_bad_aifsn = EI_INIT;
5024 static expert_field ei_ieee80211_pmkid_count_too_large = EI_INIT;
5025 static expert_field ei_ieee80211_ff_anqp_venue_length = EI_INIT;
5026 static expert_field ei_ieee80211_ff_anqp_roaming_consortium_oi_len = EI_INIT;
5027 static expert_field ei_ieee80211_tag_length = EI_INIT;
5028 static expert_field ei_ieee80211_missing_data = EI_INIT;
5029 static expert_field ei_ieee80211_rsn_pmkid_count = EI_INIT;
5030 static expert_field ei_ieee80211_fc_retry = EI_INIT;
5031 static expert_field ei_ieee80211_tag_wnm_sleep_mode_no_key_data = EI_INIT;
5032 static expert_field ei_ieee80211_dmg_subtype = EI_INIT;
5033 static expert_field ei_ieee80211_vht_action = EI_INIT;
5034 static expert_field ei_ieee80211_mesh_peering_unexpected = EI_INIT;
5035 static expert_field ei_ieee80211_fcs = EI_INIT;
5036 static expert_field ei_ieee80211_mismatched_akm_suite = EI_INIT;
5037
5038 /* 802.11ad trees */
5039 static gint ett_dynamic_alloc_tree = -1;
5040 static gint ett_ssw_tree = -1;
5041 static gint ett_bf_tree = -1;
5042 static gint ett_sswf_tree = -1;
5043 static gint ett_brp_tree = -1;
5044 static gint ett_blm_tree = -1;
5045 static gint ett_bic_tree = -1;
5046 static gint ett_dmg_params_tree = -1;
5047 static gint ett_cc_tree = -1;
5048 static gint ett_rcsi_tree = -1;
5049 static gint ett_80211_ext = -1;
5050 static gint ett_allocation_tree = -1;
5051 static gint ett_sta_info = -1;
5052
5053 static const fragment_items frag_items = {
5054   &ett_fragment,
5055   &ett_fragments,
5056   &hf_ieee80211_fragments,
5057   &hf_ieee80211_fragment,
5058   &hf_ieee80211_fragment_overlap,
5059   &hf_ieee80211_fragment_overlap_conflict,
5060   &hf_ieee80211_fragment_multiple_tails,
5061   &hf_ieee80211_fragment_too_long_fragment,
5062   &hf_ieee80211_fragment_error,
5063   &hf_ieee80211_fragment_count,
5064   &hf_ieee80211_reassembled_in,
5065   &hf_ieee80211_reassembled_length,
5066   /* Reassembled data field */
5067   NULL,
5068   "fragments"
5069 };
5070
5071 static const enum_val_t wlan_ignore_prot_options[] = {
5072   { "no",         "No",               WLAN_IGNORE_PROT_NO    },
5073   { "without_iv", "Yes - without IV", WLAN_IGNORE_PROT_WO_IV },
5074   { "with_iv",    "Yes - with IV",    WLAN_IGNORE_PROT_W_IV  },
5075   { NULL,         NULL,               0                     }
5076 };
5077
5078 static int wlan_address_type = -1;
5079 static int wlan_bssid_address_type = -1;
5080
5081 static address bssid_broadcast;
5082 gboolean
5083 is_broadcast_bssid(const address *bssid) {
5084   return addresses_equal(&bssid_broadcast, bssid);
5085 }
5086
5087 static dissector_handle_t ieee80211_handle;
5088 static dissector_handle_t wlan_withoutfcs_handle;
5089 static dissector_handle_t llc_handle;
5090 static dissector_handle_t ipx_handle;
5091 static dissector_handle_t eth_withoutfcs_handle;
5092
5093 static capture_dissector_handle_t llc_cap_handle;
5094 static capture_dissector_handle_t ipx_cap_handle;
5095
5096 static int wlan_tap = -1;
5097
5098 static const value_string access_network_type_vals[] = {
5099   {  0, "Private network" },
5100   {  1, "Private network with guest access" },
5101   {  2, "Chargeable public network" },
5102   {  3, "Free public network" },
5103   {  4, "Personal device network" },
5104   {  5, "Emergency services only network" },
5105   { 14, "Test or experimental" },
5106   { 15, "Wildcard" },
5107   { 0, NULL }
5108 };
5109
5110 static const value_string adv_proto_id_vals[] = {
5111   {  0, "Access Network Query Protocol"},
5112   {  1, "MIH Information Service"},
5113   {  2, "MIH Command and Event Services Capability Discovery"},
5114   {  3, "Emergency Alert System (EAS)"},
5115   {  4, "Location-to-Service Translation Protocol"},
5116   {221, "Vendor Specific"},
5117   {0, NULL}
5118 };
5119
5120 static const value_string timeout_int_types[] = {
5121   {1, "Reassociation deadline interval (TUs)"},
5122   {2, "Key lifetime interval (seconds)"},
5123   {3, "Association Comeback time (TUs)"},
5124   {4, "Time to start (TUs)"},
5125   {0, NULL}
5126 };
5127
5128 static const value_string tdls_action_codes[] = {
5129   {TDLS_SETUP_REQUEST,           "TDLS Setup Request"},
5130   {TDLS_SETUP_RESPONSE,          "TDLS Setup Response"},
5131   {TDLS_SETUP_CONFIRM,           "TDLS Setup Confirm"},
5132   {TDLS_TEARDOWN,                "TDLS Teardown"},
5133   {TDLS_PEER_TRAFFIC_INDICATION, "TDLS Peer Traffic Indication"},
5134   {TDLS_CHANNEL_SWITCH_REQUEST,  "TDLS Channel Switch Request"},
5135   {TDLS_CHANNEL_SWITCH_RESPONSE, "TDLS Channel Switch Response"},
5136   {TDLS_PEER_PSM_REQUEST,        "TDLS Peer PSM Request"},
5137   {TDLS_PEER_PSM_RESPONSE,       "TDLS Peer PSM Response"},
5138   {TDLS_PEER_TRAFFIC_RESPONSE,   "TDLS Peer Traffic Response"},
5139   {TDLS_DISCOVERY_REQUEST,       "TDLS Discovery Request"},
5140   {0, NULL}
5141 };
5142 static value_string_ext tdls_action_codes_ext = VALUE_STRING_EXT_INIT(tdls_action_codes);
5143
5144 static const value_string rm_action_codes[] = {
5145   {RM_ACTION_RADIO_MEASUREMENT_REQUEST,   "Radio Measurement Request"},
5146   {RM_ACTION_RADIO_MEASUREMENT_REPORT,    "Radio Measurement Report"},
5147   {RM_ACTION_LINK_MEASUREMENT_REQUEST,    "Link Measurement Request"},
5148   {RM_ACTION_LINK_MEASUREMENT_REPORT,     "Link Measurement Report"},
5149   {RM_ACTION_NEIGHBOR_REPORT_REQUEST,     "Neighbor Report Request"},
5150   {RM_ACTION_NEIGHBOR_REPORT_RESPONSE,    "Neighbor Report Response"},
5151   {0, NULL}
5152 };
5153 static value_string_ext rm_action_codes_ext = VALUE_STRING_EXT_INIT(rm_action_codes);
5154
5155 static const val64_string number_of_taps_values[] = {
5156   {0x0, "1 tap"},
5157   {0x1, "5 taps"},
5158   {0x2, "15 taps"},
5159   {0x3, "63 taps"},
5160   {0, NULL}
5161 };
5162
5163 AIRPDCAP_CONTEXT airpdcap_ctx;
5164
5165 #define PSMP_STA_INFO_BROADCAST 0
5166 #define PSMP_STA_INFO_MULTICAST 1
5167 #define PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED 2
5168
5169 #define PSMP_STA_INFO_FLAG_TYPE         0x00000003
5170 #define PSMP_STA_INFO_FLAG_DTT_START    0x00001FFC
5171 #define PSMP_STA_INFO_FLAG_DTT_DURATION 0x001FE000
5172
5173 #define PSMP_STA_INFO_FLAG_STA_ID       0x001FFFE0
5174
5175 #define PSMP_STA_INFO_FLAG_UTT_START    0x0000FFE0
5176 #define PSMP_STA_INFO_FLAG_UTT_DURATION 0x03FF0000
5177
5178 #define PSMP_STA_INFO_FLAG_IA_RESERVED  0xFC000000
5179
5180 static const value_string ff_psmp_sta_info_flags[] = {
5181   { PSMP_STA_INFO_BROADCAST,              "Broadcast"},
5182   { PSMP_STA_INFO_MULTICAST,              "Multicast"},
5183   { PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED, "Individually Addressed"},
5184   {0, NULL}
5185 };
5186
5187 static const char*
5188 wlan_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter)
5189 {
5190     if ((filter == CONV_FT_SRC_ADDRESS) && ((conv->src_address.type == AT_ETHER) || (conv->src_address.type == wlan_address_type)))
5191         return "wlan.sa";
5192
5193     if ((filter == CONV_FT_DST_ADDRESS) && ((conv->dst_address.type == AT_ETHER) || (conv->dst_address.type == wlan_address_type)))
5194         return "wlan.da";
5195
5196     if ((filter == CONV_FT_ANY_ADDRESS) && ((conv->src_address.type == AT_ETHER) || (conv->src_address.type == wlan_address_type)))
5197         return "wlan.addr";
5198
5199     return CONV_FILTER_INVALID;
5200 }
5201
5202 static ct_dissector_info_t wlan_ct_dissector_info = {&wlan_conv_get_filter_type};
5203
5204 static int
5205 wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5206 {
5207   conv_hash_t *hash = (conv_hash_t*) pct;
5208   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5209
5210   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, PT_NONE);
5211
5212   return 1;
5213 }
5214
5215 static const char*
5216 wlan_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
5217 {
5218   if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_ETHER))
5219     return "wlan.addr";
5220
5221   return CONV_FILTER_INVALID;
5222 }
5223
5224 static hostlist_dissector_info_t wlan_host_dissector_info = {&wlan_host_get_filter_type};
5225
5226 static int
5227 wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5228 {
5229   conv_hash_t *hash = (conv_hash_t*) pit;
5230   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5231
5232   /* Take two "add" passes per packet, adding for each direction, ensures that all
5233   packets are counted properly (even if address is sending to itself)
5234   XXX - this could probably be done more efficiently inside hostlist_table */
5235   add_hostlist_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, PT_NONE);
5236   add_hostlist_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, PT_NONE);
5237
5238   return 1;
5239 }
5240
5241 static const char*
5242 wlan_col_filter_str(const address* addr _U_, gboolean is_src)
5243 {
5244   if (is_src)
5245     return "wlan.sa";
5246
5247   return "wlan.da";
5248 }
5249
5250 static const char*
5251 wlan_bssid_col_filter_str(const address* addr _U_, gboolean is_src _U_)
5252 {
5253   return "wlan.bssid";
5254 }
5255
5256
5257 static void
5258 beacon_interval_base_custom(gchar *result, guint32 beacon_interval)
5259 {
5260   double temp_double;
5261
5262   temp_double = (double)beacon_interval;
5263   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double * 1024 / 1000000));
5264 }
5265
5266 static void
5267 allocation_duration_base_custom(gchar *result, guint32 allocation_duration)
5268 {
5269   double temp_double;
5270
5271   temp_double = (double)allocation_duration;
5272   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double / 1000000));
5273 }
5274
5275 static void
5276 extra_one_base_custom(gchar *result, guint32 value)
5277 {
5278   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1);
5279 }
5280
5281 static void
5282 extra_one_mul_two_base_custom(gchar *result, guint32 value)
5283 {
5284   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", (value+1)*2);
5285 }
5286
5287 /* ************************************************************************* */
5288 /* Mesh Control field helper functions
5289  *
5290  * Per IEEE 802.11s Draft 12.0 section 7.2.2.1:
5291  *
5292  * The frame body consists of either:
5293  * The MSDU (or a fragment thereof), the Mesh Control field (if and only if the
5294  * frame is transmitted by a mesh STA and the Mesh Control Present subfield of
5295  * the QoS Control field is 1)...
5296  *
5297  * 8.2.4.5.1 "QoS Control field structure", table 8-4, in 802.11-2012,
5298  * seems to indicate that the bit that means "Mesh Control Present" in
5299  * frames sent by mesh STAs in a mesh BSS is part of the TXOP Limit field,
5300  * the AP PS Buffer State field, the TXOP Duration Requested field, or the
5301  * Queue Size field in some data frames in non-mesh BSSes.
5302  *
5303  * We need a statefull sniffer for that.  For now, use heuristics.
5304  *
5305  * Notably, only mesh data frames contain the Mesh Control field in the header.
5306  * Other frames that contain mesh control (i.e., multihop action frames) have
5307  * it deeper in the frame body where it can be definitively identified.
5308  * Further, mesh data frames always have to-ds and from-ds either 11 or 01.  We
5309  * use these facts to make our heuristics more reliable.
5310  * ************************************************************************* */
5311 static int
5312 has_mesh_control(guint16 fcf, guint16 qos_ctl, guint8 mesh_flags)
5313 {
5314   /* assume mesh control present if the QOS field's Mesh Control Present bit is
5315    * set, all reserved bits in the mesh_flags field are zero, and the address
5316    * extension mode is not a reserved value.
5317    */
5318   return (((FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) || (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2)) &&
5319           (QOS_MESH_CONTROL_PRESENT(qos_ctl)) &&
5320           ((mesh_flags & ~MESH_FLAGS_ADDRESS_EXTENSION) == 0) &&
5321           ((mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION) != MESH_FLAGS_ADDRESS_EXTENSION));
5322 }
5323
5324 static int
5325 find_mesh_control_length(guint8 mesh_flags)
5326 {
5327   return 6 + 6*(mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION);
5328 }
5329
5330 static mimo_control_t
5331 get_mimo_control(tvbuff_t *tvb, int offset)
5332 {
5333   guint16        mimo;
5334   mimo_control_t output;
5335
5336   mimo = tvb_get_letohs(tvb, offset);
5337
5338   output.nc = (mimo & 0x0003) + 1;
5339   output.nr = ((mimo & 0x000C) >> 2) + 1;
5340   output.chan_width = (mimo & 0x0010) >> 4;
5341   output.coefficient_size = 4; /* XXX - Is this a good default? */
5342
5343   switch ((mimo & 0x0060) >> 5)
5344     {
5345       case 0:
5346         output.grouping = 1;
5347         break;
5348
5349       case 1:
5350         output.grouping = 2;
5351         break;
5352
5353       case 2:
5354         output.grouping = 4;
5355         break;
5356
5357       default:
5358         output.grouping = 1;
5359         break;
5360     }
5361
5362   switch ((mimo & 0x0180) >> 7)
5363     {
5364       case 0:
5365         output.coefficient_size = 4;
5366         break;
5367
5368       case 1:
5369         output.coefficient_size = 5;
5370         break;
5371
5372       case 2:
5373         output.coefficient_size = 6;
5374         break;
5375
5376       case 3:
5377         output.coefficient_size = 8;
5378         break;
5379     }
5380
5381   output.codebook_info = (mimo & 0x0600) >> 9;
5382   output.remaining_matrix_segment = (mimo & 0x3800) >> 11;
5383
5384   return output;
5385 }
5386
5387 static int
5388 get_mimo_na(guint8 nr, guint8 nc)
5389 {
5390   if ((nr == 2) && (nc == 1)) {
5391     return 2;
5392   } else if ((nr == 2) && (nc == 2)) {
5393     return 2;
5394   } else if ((nr == 3) && (nc == 1)) {
5395     return 4;
5396   } else if ((nr == 3) && (nc == 2)) {
5397     return 6;
5398   } else if ((nr == 3) && (nc == 3)) {
5399     return 6;
5400   } else if ((nr == 4) && (nc == 1)) {
5401     return 6;
5402   } else if ((nr == 4) && (nc == 2)) {
5403     return 10;
5404   } else if ((nr == 4) && (nc == 3)) {
5405     return 12;
5406   } else if ((nr == 4) && (nc == 4)) {
5407     return 12;
5408   } else{
5409     return 0;
5410   }
5411 }
5412
5413 static int
5414 get_mimo_ns(gboolean chan_width, guint8 output_grouping)
5415 {
5416   int ns = 0;
5417
5418   if (chan_width)
5419   {
5420     switch (output_grouping)
5421       {
5422         case 1:
5423           ns = 114;
5424           break;
5425
5426           case 2:
5427             ns = 58;
5428             break;
5429
5430           case 4:
5431             ns = 30;
5432             break;
5433
5434           default:
5435             ns = 0;
5436       }
5437   } else {
5438     switch (output_grouping)
5439       {
5440         case 1:
5441           ns = 56;
5442           break;
5443
5444         case 2:
5445           ns = 30;
5446           break;
5447
5448         case 4:
5449           ns = 16;
5450           break;
5451
5452         default:
5453           ns = 0;
5454       }
5455   }
5456
5457   return ns;
5458 }
5459
5460 static int
5461 add_mimo_csi_matrices_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
5462 {
5463   proto_tree *snr_tree;
5464   int         csi_matrix_size, start_offset;
5465   int         ns, i;
5466
5467   start_offset = offset;
5468   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
5469                         ett_mimo_report, NULL, "Signal to Noise Ratio");
5470
5471   for (i = 1; i <= mimo_cntrl.nr; i++)
5472   {
5473     guint8 snr;
5474
5475     snr = tvb_get_guint8(tvb, offset);
5476     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
5477                                snr, "Channel %d - Signal to Noise Ratio: 0x%02X", i, snr);
5478     offset += 1;
5479   }
5480
5481   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
5482   csi_matrix_size = ns*(3+(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size));
5483   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
5484   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_matrices, tvb, offset, csi_matrix_size, ENC_NA);
5485   offset += csi_matrix_size;
5486   return offset - start_offset;
5487 }
5488
5489 static int
5490 add_mimo_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
5491 {
5492   proto_tree *snr_tree;
5493   int         csi_matrix_size, start_offset;
5494   int         ns, i;
5495
5496   start_offset = offset;
5497   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc, ett_mimo_report, NULL, "Signal to Noise Ratio");
5498
5499   for (i = 1; i <= mimo_cntrl.nc; i++)
5500   {
5501     guint8 snr;
5502
5503     snr = tvb_get_guint8(tvb, offset);
5504     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
5505                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
5506     offset += 1;
5507   }
5508
5509   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
5510   csi_matrix_size = ns*(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size);
5511   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
5512   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_bf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
5513   offset += csi_matrix_size;
5514   return offset - start_offset;
5515 }
5516
5517 static int
5518 add_mimo_compressed_beamforming_feedback_report(proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
5519 {
5520   proto_tree *snr_tree;
5521   int         csi_matrix_size, start_offset;
5522   int         ns, na, i;
5523
5524   start_offset = offset;
5525   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
5526                         ett_mimo_report, NULL, "Signal to Noise Ratio");
5527
5528   for (i = 1; i <= mimo_cntrl.nc; i++)
5529   {
5530     guint8 snr;
5531
5532     snr = tvb_get_guint8(tvb, offset);
5533     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
5534                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
5535     offset += 1;
5536   }
5537
5538   na = get_mimo_na(mimo_cntrl.nr, mimo_cntrl.nc);
5539   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
5540   csi_matrix_size = ns*(na*((mimo_cntrl.codebook_info+1)*2 + 2)/2);
5541   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
5542   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_cbf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
5543   offset += csi_matrix_size;
5544   return offset - start_offset;
5545 }
5546
5547 /* ************************************************************************* */
5548 /*          This is the capture function used to update packet counts        */
5549 /* ************************************************************************* */
5550 static gboolean
5551 capture_ieee80211_common(const guchar * pd, int offset, int len,
5552                           capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_, gboolean datapad)
5553 {
5554   guint16 fcf, hdr_length;
5555
5556   if (!BYTES_ARE_IN_FRAME(offset, len, 2))
5557     return FALSE;
5558
5559   fcf = pletoh16(&pd[offset]);
5560
5561   if (IS_PROTECTED(FCF_FLAGS(fcf)) && (wlan_ignore_prot == WLAN_IGNORE_PROT_NO))
5562     return FALSE;
5563
5564   switch (COMPOSE_FRAME_TYPE (fcf)) {
5565
5566     case DATA:
5567     case DATA_CF_ACK:
5568     case DATA_CF_POLL:
5569     case DATA_CF_ACK_POLL:
5570     case DATA_QOS_DATA:
5571     case DATA_QOS_DATA_CF_ACK:
5572     case DATA_QOS_DATA_CF_POLL:
5573     case DATA_QOS_DATA_CF_ACK_POLL:
5574     {
5575       /* These are data frames that actually contain *data*. */
5576       hdr_length = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
5577
5578       if (DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
5579         /* QoS frame, so the header includes a QoS field */
5580         guint16 qosoff;  /* Offset of the 2-byte QoS field */
5581         guint8 mesh_flags;
5582
5583         qosoff = hdr_length;
5584         hdr_length += 2; /* Include the QoS field in the header length */
5585
5586         if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
5587           /* Frame has a 4-byte HT Control field */
5588           hdr_length += 4;
5589         }
5590
5591         /*
5592          * Does it look as if we have a mesh header?
5593          * Look at the Mesh Control subfield of the QoS field and at the
5594          * purported mesh flag fields.
5595          */
5596         if (!BYTES_ARE_IN_FRAME(offset, hdr_length, 1))
5597           return FALSE;
5598
5599         mesh_flags = pd[hdr_length];
5600         if (has_mesh_control(fcf, pletoh16(&pd[qosoff]), mesh_flags)) {
5601           /* Yes, add the length of that in as well. */
5602           hdr_length += find_mesh_control_length(mesh_flags);
5603         }
5604
5605         if (datapad) {
5606           /*
5607            * Include the padding between the 802.11 header and the body,
5608            * as "helpfully" provided by some Atheros adapters.
5609            *
5610            * XXX - would the mesh header be part of the header or the body
5611            * from the point of view of the Atheros adapters that insert
5612            * the padding, assuming they even recognize a mesh header?
5613            */
5614           hdr_length = roundup2(hdr_length, 4);
5615         }
5616       }
5617       /* I guess some bridges take Netware Ethernet_802_3 frames,
5618          which are 802.3 frames (with a length field rather than
5619          a type field, but with no 802.2 header in the payload),
5620          and just stick the payload into an 802.11 frame.  I've seen
5621          captures that show frames of that sort.
5622
5623          We also handle some odd form of encapsulation in which a
5624          complete Ethernet frame is encapsulated within an 802.11
5625          data frame, with no 802.2 header.  This has been seen
5626          from some hardware.
5627
5628          On top of that, at least at some point it appeared that
5629          the OLPC XO sent out frames with two bytes of 0 between
5630          the "end" of the 802.11 header and the beginning of
5631          the payload.
5632
5633          So, if the packet doesn't start with 0xaa 0xaa:
5634
5635            we first use the same scheme that linux-wlan-ng does to detect
5636            those encapsulated Ethernet frames, namely looking to see whether
5637            the frame either starts with 6 octets that match the destination
5638            address from the 802.11 header or has 6 octets that match the
5639            source address from the 802.11 header following the first 6 octets,
5640            and, if so, treat it as an encapsulated Ethernet frame;
5641
5642            otherwise, we use the same scheme that we use in the Ethernet
5643            dissector to recognize Netware 802.3 frames, namely checking
5644            whether the packet starts with 0xff 0xff and, if so, treat it
5645            as an encapsulated IPX frame, and then check whether the
5646            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
5647            frame. */
5648       if (!BYTES_ARE_IN_FRAME(offset+hdr_length, len, 2))
5649         return FALSE;
5650
5651       if ((pd[offset+hdr_length] != 0xaa) && (pd[offset+hdr_length+1] != 0xaa)) {
5652 #if 0
5653         /* XXX - this requires us to parse the header to find the source
5654            and destination addresses. */
5655         if (BYTES_ARE_IN_FRAME(offset+hdr_length, len, 12)) {
5656           /* We have two MAC addresses after the header. */
5657           if ((memcmp(&pd[offset+hdr_length+6], pinfo->dl_src.data, 6) == 0) ||
5658               (memcmp(&pd[offset+hdr_length+6], pinfo->dl_dst.data, 6) == 0)) {
5659             return capture_eth (pd, offset + hdr_length, len, cpinfo, pseudo_header);
5660           }
5661         }
5662 #endif
5663         if ((pd[offset+hdr_length] == 0xff) && (pd[offset+hdr_length+1] == 0xff))
5664           return call_capture_dissector (ipx_cap_handle, pd, offset+hdr_length, len, cpinfo, pseudo_header);
5665         else if ((pd[offset+hdr_length] == 0x00) && (pd[offset+hdr_length+1] == 0x00))
5666           return call_capture_dissector (llc_cap_handle, pd, offset + hdr_length + 2, len, cpinfo, pseudo_header);
5667       }
5668       else {
5669         return call_capture_dissector (llc_cap_handle, pd, offset + hdr_length, len, cpinfo, pseudo_header);
5670       }
5671       break;
5672     }
5673   }
5674
5675   return FALSE;
5676 }
5677
5678 /*
5679  * Handle 802.11 with a variable-length link-layer header.
5680  */
5681 static gboolean
5682 capture_ieee80211(const guchar * pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
5683 {
5684   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, FALSE);
5685 }
5686
5687 /*
5688  * Handle 802.11 with a variable-length link-layer header and data padding.
5689  */
5690 static gboolean
5691 capture_ieee80211_datapad(const guchar * pd, int offset, int len,
5692                            capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
5693 {
5694   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, TRUE);
5695 }
5696
5697
5698 /* ************************************************************************* */
5699 /*          Add the subtree used to store the fixed parameters               */
5700 /* ************************************************************************* */
5701 static proto_tree *
5702 get_fixed_parameter_tree(proto_tree * tree, tvbuff_t *tvb, int start, int size)
5703 {
5704   proto_item *fixed_fields;
5705
5706   fixed_fields = proto_tree_add_item(tree, hf_ieee80211_fixed_parameters, tvb, start, size, ENC_NA);
5707   proto_item_append_text(fixed_fields, " (%d bytes)", size);
5708
5709   return proto_item_add_subtree(fixed_fields, ett_fixed_parameters);
5710 }
5711
5712
5713 /* ************************************************************************* */
5714 /*            Add the subtree used to store tagged parameters                */
5715 /* ************************************************************************* */
5716 static proto_tree *
5717 get_tagged_parameter_tree(proto_tree * tree, tvbuff_t *tvb, int start, int size)
5718 {
5719   proto_item *tagged_fields;
5720
5721   tagged_fields = proto_tree_add_item(tree, hf_ieee80211_tagged_parameters, tvb, start, -1, ENC_NA);
5722   proto_item_append_text(tagged_fields, " (%d bytes)", size);
5723
5724   return proto_item_add_subtree(tagged_fields, ett_tagged_parameters);
5725 }
5726
5727
5728 static int
5729 dissect_vendor_action_marvell(proto_tree *tree, tvbuff_t *tvb, int offset)
5730 {
5731   guint8 octet;
5732
5733   octet = tvb_get_guint8(tvb, offset);
5734   proto_tree_add_item(tree, hf_ieee80211_ff_marvell_action_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5735   offset += 1;
5736   switch (octet)
5737     {
5738       case MRVL_ACTION_MESH_MANAGEMENT:
5739         octet = tvb_get_guint8(tvb, offset);
5740         proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5741         offset += 1;
5742         switch (octet)
5743           {
5744             case MRVL_MESH_MGMT_ACTION_RREQ:
5745               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5746               offset += 1;
5747               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5748               offset += 1;
5749               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5750               offset += 1;
5751               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5752               offset += 1;
5753               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_rreqid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5754               offset += 4;
5755               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
5756               offset += 6;
5757               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5758               offset += 4;
5759               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5760               offset += 4;
5761               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5762               offset += 4;
5763               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5764               offset += 1;
5765               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5766               offset += 1;
5767               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
5768               offset += 6;
5769               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5770               offset += 4;
5771               break;
5772             case MRVL_MESH_MGMT_ACTION_RREP:
5773               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5774               offset += 1;
5775               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5776               offset += 1;
5777               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5778               offset += 1;
5779               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5780               offset += 1;
5781               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
5782               offset += 6;
5783               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5784               offset += 4;
5785               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5786               offset += 4;
5787               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5788               offset += 4;
5789               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
5790               offset += 6;
5791               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5792               offset += 4;
5793               break;
5794             case MRVL_MESH_MGMT_ACTION_RERR:
5795               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5796               offset += 1;
5797               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5798               offset += 1;
5799               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5800               offset += 1;
5801               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
5802               offset += 6;
5803               proto_tree_add_item(tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5804               offset += 4;
5805               break;
5806             default:
5807               break;
5808           }
5809         break;
5810       default:
5811         break;
5812     }
5813
5814   return offset;
5815 }
5816
5817 static guint
5818 dissect_advertisement_protocol(packet_info *pinfo, proto_tree *tree,
5819                                tvbuff_t *tvb, int offset, gboolean *anqp)
5820 {
5821   guint8      tag_no, tag_len, left;
5822   proto_item *item = NULL, *adv_item;
5823   proto_tree *adv_tree, *adv_tuple_tree;
5824
5825   if (anqp)
5826     *anqp = FALSE;
5827   tag_no = tvb_get_guint8(tvb, offset);
5828   if (anqp)
5829     item = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5830
5831   tag_len = tvb_get_guint8(tvb, offset + 1);
5832   if (tag_no != TAG_ADVERTISEMENT_PROTOCOL) {
5833     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_number,
5834                            "Unexpected IE %d (expected Advertisement "
5835                            "Protocol)", tag_no);
5836     return 2 + tag_len;
5837   }
5838   if (anqp)
5839     item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
5840   if (tag_len < 2) {
5841     if (!anqp)
5842       item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
5843     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
5844                            "Advertisement Protocol: IE must be at least 2 "
5845                            "octets long");
5846     return 2 + tag_len;
5847   }
5848
5849   left = tag_len;
5850   offset += 2;
5851   adv_tree = proto_tree_add_subtree(tree, tvb, offset, left,
5852                                  ett_adv_proto, &adv_item, "Advertisement Protocol element");
5853
5854   while (left >= 2) {
5855     guint8 id;
5856
5857     id = tvb_get_guint8(tvb, offset + 1);
5858     if (id == 0)
5859       proto_item_append_text(adv_item, ": ANQP");
5860     adv_tuple_tree = proto_tree_add_subtree_format(adv_tree, tvb, offset, 2, ett_adv_proto_tuple, &item,
5861                                "Advertisement Protocol Tuple: %s",
5862                                val_to_str(id, adv_proto_id_vals,
5863                                           "Unknown (%d)"));
5864
5865     proto_tree_add_item(adv_tuple_tree,
5866                         hf_ieee80211_tag_adv_proto_resp_len_limit, tvb,
5867                         offset, 1, ENC_LITTLE_ENDIAN);
5868     proto_tree_add_item(adv_tuple_tree,
5869                         hf_ieee80211_tag_adv_proto_pame_bi, tvb,
5870                         offset, 1, ENC_LITTLE_ENDIAN);
5871     offset += 1;
5872     left--;
5873     proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_proto_id, tvb,
5874                         offset, 1, ENC_LITTLE_ENDIAN);
5875     offset += 1;
5876     left--;
5877
5878     if ((id == 0) && anqp)
5879       *anqp = TRUE;
5880
5881     if (id == 221) {
5882       /* Vendor specific */
5883       guint8 len = tvb_get_guint8(tvb, offset);
5884       offset += 1;
5885       left   -= 1;
5886       if (len > left) {
5887         expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
5888                                "Vendor specific info length error");
5889         return 2 + tag_len;
5890       }
5891       proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_proto_vs_info, tvb,
5892                         offset, len, ENC_NA);
5893       offset += len;
5894       left   -= len;
5895     }
5896   }
5897
5898   if (left) {
5899     expert_add_info_format(pinfo, item, &ei_ieee80211_extra_data,
5900                            "Unexpected extra data in the end");
5901   }
5902
5903   return 2 + tag_len;
5904 }
5905
5906 static void
5907 dissect_anqp_query_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
5908 {
5909   while (offset + 2 <= end) {
5910     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_query_id,
5911                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
5912     offset += 2;
5913   }
5914   if (offset != end) {
5915     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
5916                            "Unexpected ANQP Query list format");
5917   }
5918 }
5919
5920 static void
5921 dissect_hs20_anqp_hs_capability_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
5922 {
5923   while (offset < end) {
5924     proto_tree_add_item(tree, hf_hs20_anqp_hs_capability_list,
5925                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5926     offset++;
5927   }
5928 }
5929
5930 static void
5931 dissect_anqp_capab_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
5932 {
5933   guint16     id, len;
5934   proto_item *item;
5935   proto_tree *vtree;
5936   guint32     oui;
5937   guint8      subtype;
5938
5939   while (offset + 2 <= end) {
5940     id = tvb_get_letohs(tvb, offset);
5941     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_capability,
5942                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
5943     offset += 2;
5944     if (id == ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
5945       vtree = proto_item_add_subtree(item, ett_anqp_vendor_capab);
5946       len = tvb_get_letohs(tvb, offset);
5947       proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vlen,
5948                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
5949       offset += 2;
5950       if ((len < 3) || ((offset + len) > end)) {
5951         expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_capability);
5952         return;
5953       }
5954       oui = tvb_get_ntoh24(tvb, offset);
5955       proto_tree_add_item(vtree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
5956       offset += 3;
5957       len    -= 3;
5958
5959       switch (oui) {
5960       case OUI_WFA:
5961         if (len == 0)
5962           break;
5963         subtype = tvb_get_guint8(tvb, offset);
5964         proto_item_append_text(vtree, " - WFA - %s",
5965                                val_to_str(subtype, wfa_subtype_vals,
5966                                           "Unknown (%u)"));
5967         proto_tree_add_item(vtree, hf_ieee80211_anqp_wfa_subtype,
5968                             tvb, offset, 1, ENC_NA);
5969         offset++;
5970         len--;
5971         switch (subtype) {
5972         case WFA_SUBTYPE_HS20_ANQP:
5973           dissect_hs20_anqp_hs_capability_list(vtree, tvb, offset, end);
5974           break;
5975         default:
5976           proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
5977                               tvb, offset, len, ENC_NA);
5978           break;
5979         }
5980         break;
5981       default:
5982         proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
5983                             tvb, offset, len, ENC_NA);
5984         break;
5985       }
5986
5987       offset += len;
5988     }
5989   }
5990   if (offset != end) {
5991     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
5992                            "Unexpected ANQP Capability list format");
5993   }
5994 }
5995
5996 static const value_string venue_group_vals[] = {
5997   {  0, "Unspecified" },
5998   {  1, "Assembly" },
5999   {  2, "Business" },
6000   {  3, "Educational" },
6001   {  4, "Factory and Industrial" },
6002   {  5, "Institutional" },
6003   {  6, "Mercantile" },
6004   {  7, "Residential" },
6005   {  8, "Storage" },
6006   {  9, "Utility and Miscellaneous" },
6007   { 10, "Vehicular" },
6008   { 11, "Outdoor" },
6009   { 0, NULL }
6010 };
6011 static value_string_ext venue_group_vals_ext = VALUE_STRING_EXT_INIT(venue_group_vals);
6012
6013 static void
6014 dissect_venue_info(proto_tree *tree, tvbuff_t *tvb, int offset)
6015 {
6016   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_group,
6017                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6018   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_type,
6019                       tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
6020 }
6021
6022 static void
6023 dissect_venue_name_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6024 {
6025   proto_item *item;
6026
6027   dissect_venue_info(tree, tvb, offset);
6028   offset += 2;
6029   while (offset + 4 <= end) {
6030     guint8 vlen = tvb_get_guint8(tvb, offset);
6031     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_length,
6032                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6033     offset += 1;
6034     if ((vlen > (end - offset)) || (vlen < 3)) {
6035       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_venue_length);
6036       break;
6037     }
6038     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_language,
6039                         tvb, offset, 3, ENC_ASCII|ENC_NA);
6040     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_name,
6041                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
6042     offset += vlen;
6043   }
6044 }
6045
6046 static const value_string nw_auth_type_vals[] = {
6047   { 0, "Acceptance of terms and conditions" },
6048   { 1, "On-line enrollment supported" },
6049   { 2, "http/https redirection" },
6050   { 3, "DNS redirection" },
6051   { 0, NULL }
6052 };
6053
6054 static void
6055 dissect_network_auth_type(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6056 {
6057   while (offset + 3 <= end) {
6058     guint16 len;
6059     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_indicator,
6060                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6061     offset += 1;
6062     len = tvb_get_letohs(tvb, offset);
6063     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url_len,
6064                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6065     offset += 2;
6066     if (len)
6067       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url,
6068                           tvb, offset, len, ENC_ASCII|ENC_NA);
6069     offset += len;
6070   }
6071 }
6072
6073 static void
6074 add_manuf(proto_item *item, tvbuff_t *tvb, int offset)
6075 {
6076   const gchar *manuf_name;
6077
6078   manuf_name = tvb_get_manuf_name_if_known(tvb, offset);
6079   if (manuf_name == NULL)
6080     return;
6081   proto_item_append_text(item, " - %s", manuf_name);
6082 }
6083
6084 static void
6085 dissect_roaming_consortium_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6086                                 int end)
6087 {
6088   proto_item *item;
6089   guint8      len;
6090
6091   while (offset < end) {
6092     len = tvb_get_guint8(tvb, offset);
6093     item = proto_tree_add_item(tree,
6094                                hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
6095                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6096     offset += 1;
6097     if ((len > (end - offset)) || (len < 3)) {
6098       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_roaming_consortium_oi_len);
6099       break;
6100     }
6101     item = proto_tree_add_item(tree,
6102                                hf_ieee80211_ff_anqp_roaming_consortium_oi,
6103                                tvb, offset, len, ENC_NA);
6104     add_manuf(item, tvb, offset);
6105     offset += len;
6106   }
6107 }
6108
6109 static const value_string ip_addr_avail_ipv6_vals[] = {
6110   { 0, "Address type not available" },
6111   { 1, "Address type available" },
6112   { 2, "Availability of the address type not known" },
6113   { 0, NULL }
6114 };
6115
6116 static const value_string ip_addr_avail_ipv4_vals[] = {
6117   { 0, "Address type not available" },
6118   { 1, "Public IPv4 address available" },
6119   { 2, "Port-restricted IPv4 address available" },
6120   { 3, "Single NATed private IPv4 address available" },
6121   { 4, "Double NATed private IPv4 address available" },
6122   { 5, "Port-restricted IPv4 address and single NATed IPv4 address available" },
6123   { 6, "Port-restricted IPv4 address and double NATed IPv4 address available" },
6124   { 7, "Availability of the address type is not known" },
6125   { 0, NULL }
6126 };
6127
6128 static void
6129 dissect_ip_addr_type_availability_info(proto_tree *tree, tvbuff_t *tvb,
6130                                        int offset)
6131 {
6132   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
6133                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6134   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
6135                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6136 }
6137
6138 static const value_string nai_realm_encoding_vals[] = {
6139   { 0, "Formatted in accordance with RFC 4282" },
6140   { 1, "UTF-8 formatted that is not formatted in accordance with RFC 4282" },
6141   { 0, NULL }
6142 };
6143
6144 static const value_string nai_realm_auth_param_id_vals[] = {
6145   {   1, "Expanded EAP Method" },
6146   {   2, "Non-EAP Inner Authentication Type" },
6147   {   3, "Inner Authentication EAP Method Type" },
6148   {   4, "Expanded Inner EAP Method" },
6149   {   5, "Credential Type" },
6150   {   6, "Tunneled EAP Method Credential Type" },
6151   { 221, "Vendor Specific" },
6152   { 0, NULL }
6153 };
6154
6155 static void
6156 dissect_nai_realm_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6157 {
6158   guint16       count, len;
6159   proto_item   *item, *r_item;
6160   int           f_end, eap_end;
6161   guint8        nai_len, eap_count, eap_len, auth_param_count, auth_param_len;
6162   guint8        auth_param_id;
6163   proto_tree   *realm_tree, *eap_tree;
6164   const guint8 *realm;
6165
6166   count = tvb_get_letohs(tvb, offset);
6167   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nai_realm_count,
6168                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6169   offset += 2;
6170   while (count > 0) {
6171     len = tvb_get_letohs(tvb, offset);
6172     realm_tree = proto_tree_add_subtree(tree, tvb, offset, 2 + len, ett_nai_realm, &r_item, "NAI Realm Data");
6173
6174     item = proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_field_len,
6175                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6176     offset += 2;
6177     if (offset + len > end) {
6178       expert_add_info_format(pinfo, item, &ei_ieee80211_ff_anqp_nai_field_len,
6179                              "Invalid NAI Realm List");
6180       break;
6181     }
6182     f_end = offset + len;
6183     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_encoding,
6184                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6185     offset += 1;
6186     nai_len = tvb_get_guint8(tvb, offset);
6187     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_length,
6188                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6189     offset += 1;
6190     if (offset + nai_len > f_end) {
6191       expert_add_info_format(pinfo, r_item, &ei_ieee80211_ff_anqp_nai_field_len,
6192                              "Invalid NAI Realm Data");
6193       break;
6194     }
6195     proto_tree_add_item_ret_string(realm_tree, hf_ieee80211_ff_anqp_nai_realm,
6196                         tvb, offset, nai_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &realm);
6197     if (realm) {
6198       proto_item_append_text(r_item, " (%s)", realm);
6199     }
6200     offset += nai_len;
6201     eap_count = tvb_get_guint8(tvb, offset);
6202     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_eap_count,
6203                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6204     offset += 1;
6205
6206     while (eap_count > 0) {
6207       eap_len = tvb_get_guint8(tvb, offset);
6208       eap_end = offset + 1 + eap_len;
6209       eap_tree = proto_tree_add_subtree(realm_tree, tvb, offset, 1 + eap_len,
6210                                  ett_nai_realm_eap, NULL, "EAP Method");
6211
6212       item = proto_tree_add_item(eap_tree,
6213                                  hf_ieee80211_ff_anqp_nai_realm_eap_len,
6214                                  tvb, offset, 1, ENC_LITTLE_ENDIAN);
6215       offset += 1;
6216       if (offset + eap_len > f_end) {
6217         expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_nai_realm_eap_len);
6218         break;
6219       }
6220
6221       proto_item_append_text(eap_tree, ": %s",
6222                              val_to_str_ext(tvb_get_guint8(tvb, offset),
6223                                             &eap_type_vals_ext, "Unknown (%d)"));
6224       proto_tree_add_item(eap_tree, hf_ieee80211_ff_anqp_nai_realm_eap_method,
6225                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
6226       offset += 1;
6227       auth_param_count = tvb_get_guint8(tvb, offset);
6228       proto_tree_add_item(eap_tree,
6229                           hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
6230                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
6231       offset += 1;
6232
6233       while (auth_param_count > 0) {
6234         auth_param_id = tvb_get_guint8(tvb, offset);
6235         proto_tree_add_item(eap_tree,
6236                             hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
6237                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
6238         offset += 1;
6239         auth_param_len = tvb_get_guint8(tvb, offset);
6240         proto_tree_add_item(eap_tree,
6241                             hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
6242                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
6243         offset += 1;
6244         item = proto_tree_add_item(
6245           eap_tree, hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
6246           tvb, offset, auth_param_len, ENC_NA);
6247         if ((auth_param_id == 3) && (auth_param_len == 1)) {
6248           guint8 inner_method = tvb_get_guint8(tvb, offset);
6249           const char *str;
6250           str = val_to_str_ext(inner_method, &eap_type_vals_ext, "Unknown (%d)");
6251
6252           proto_item_append_text(eap_tree, " / %s", str);
6253           proto_item_append_text(item, " - %s", str);
6254         }
6255         offset += auth_param_len;
6256
6257         auth_param_count--;
6258       }
6259
6260       offset = eap_end;
6261       eap_count--;
6262     }
6263
6264     offset = f_end;
6265     count--;
6266   }
6267 }
6268
6269 static void
6270 dissect_3gpp_cellular_network_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6271 {
6272   guint8      iei, num;
6273   proto_item *item;
6274
6275   /* See Annex A of 3GPP TS 24.234 v8.1.0 for description */
6276   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_gud, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6277   offset += 1;
6278   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_udhl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6279   offset += 1;
6280   iei = tvb_get_guint8(tvb, offset);
6281   item = proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_iei, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6282   if (iei == 0)
6283     proto_item_append_text(item, " (PLMN List)");
6284   else
6285     return;
6286   offset += 1;
6287   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_plmn_len, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6288   offset += 1;
6289   num = tvb_get_guint8(tvb, offset);
6290   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_num_plmns, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6291   offset += 1;
6292   while (num > 0) {
6293     if (tvb_reported_length_remaining(tvb, offset) < 3)
6294       break;
6295     dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, offset, E212_NONE, TRUE);
6296     num--;
6297     offset += 3;
6298   }
6299 }
6300
6301 static void
6302 dissect_domain_name_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6303 {
6304   guint8 len;
6305
6306   while (offset < end) {
6307     len = tvb_get_guint8(tvb, offset);
6308     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name_len,
6309                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6310     offset += 1;
6311     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name,
6312                         tvb, offset, len, ENC_ASCII|ENC_NA);
6313     offset += len;
6314   }
6315 }
6316
6317 #define HS20_ANQP_HS_QUERY_LIST 1
6318 #define HS20_ANQP_HS_CAPABILITY_LIST 2
6319 #define HS20_ANQP_OPERATOR_FRIENDLY_NAME 3
6320 #define HS20_ANQP_WAN_METRICS 4
6321 #define HS20_ANQP_CONNECTION_CAPABILITY 5
6322 #define HS20_ANQP_NAI_HOME_REALM_QUERY 6
6323 #define HS20_ANQP_OPERATING_CLASS_INDICATION 7
6324
6325 static const value_string hs20_anqp_subtype_vals[] = {
6326   { HS20_ANQP_HS_QUERY_LIST, "HS Query list" },
6327   { HS20_ANQP_HS_CAPABILITY_LIST, "HS Capability List" },
6328   { HS20_ANQP_OPERATOR_FRIENDLY_NAME, "Operator Friendly Name" },
6329   { HS20_ANQP_WAN_METRICS, "WAN Metrics" },
6330   { HS20_ANQP_CONNECTION_CAPABILITY, "Connection Capability" },
6331   { HS20_ANQP_NAI_HOME_REALM_QUERY, "NAI Home Realm Query" },
6332   { HS20_ANQP_OPERATING_CLASS_INDICATION, "Operating Class Indication" },
6333   { 0, NULL }
6334 };
6335
6336 static void
6337 dissect_hs20_anqp_hs_query_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6338 {
6339   while (offset < end) {
6340     proto_tree_add_item(tree, hf_hs20_anqp_hs_query_list,
6341                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6342     offset++;
6343   }
6344 }
6345
6346 static void
6347 dissect_hs20_anqp_operator_friendly_name(proto_tree *tree, tvbuff_t *tvb,
6348                                          packet_info *pinfo, int offset, int end)
6349 {
6350   while (offset + 4 <= end) {
6351     guint8 vlen = tvb_get_guint8(tvb, offset);
6352     proto_item *item = proto_tree_add_item(tree, hf_hs20_anqp_ofn_length,
6353                                            tvb, offset, 1, ENC_LITTLE_ENDIAN);
6354     offset++;
6355     if (vlen > end - offset || vlen < 3) {
6356       expert_add_info(pinfo, item, &ei_hs20_anqp_ofn_length);
6357       break;
6358     }
6359     proto_tree_add_item(tree, hf_hs20_anqp_ofn_language,
6360                         tvb, offset, 3, ENC_ASCII|ENC_NA);
6361     proto_tree_add_item(tree, hf_hs20_anqp_ofn_name,
6362                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
6363     offset += vlen;
6364   }
6365 }
6366
6367 static const value_string hs20_wm_link_status_vals[] = {
6368   { 0, "Reserved" },
6369   { 1, "Link up" },
6370   { 2, "Link down" },
6371   { 3, "Link in test state" },
6372   { 0, NULL }
6373 };
6374
6375 static void
6376 dissect_hs20_anqp_wan_metrics(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean request)
6377 {
6378   if (request)
6379     return;
6380
6381   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_link_status,
6382                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6383   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_symmetric_link,
6384                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6385   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_at_capacity,
6386                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6387   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_reserved,
6388                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6389   offset++;
6390
6391   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_speed,
6392                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
6393   offset += 4;
6394
6395   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_speed,
6396                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
6397   offset += 4;
6398
6399   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_load,
6400                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6401   offset++;
6402
6403   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_load,
6404                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6405   offset++;
6406
6407   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_lmd,
6408                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6409 }
6410
6411 static const value_string hs20_cc_status_vals[] = {
6412   { 0, "Closed" },
6413   { 1, "Open" },
6414   { 2, "Unknown" },
6415   { 0, NULL }
6416 };
6417
6418 static void
6419 dissect_hs20_anqp_connection_capability(proto_tree *tree, tvbuff_t *tvb,
6420                                         int offset, int end)
6421 {
6422   proto_tree *tuple;
6423   while (offset + 4 <= end) {
6424     guint8 ip_proto, status;
6425     guint16 port_num;
6426
6427     ip_proto = tvb_get_guint8(tvb, offset);
6428     port_num = tvb_get_letohs(tvb, offset + 1);
6429     status = tvb_get_guint8(tvb, offset + 3);
6430
6431     tuple = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_hs20_cc_proto_port_tuple, NULL,
6432                                "ProtoPort Tuple - ip_proto=%u port_num=%u status=%s",
6433                                ip_proto, port_num,
6434                                val_to_str(status, hs20_cc_status_vals,
6435                                           "Unknown (%u)"));
6436     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_ip_proto,
6437                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6438     offset++;
6439     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_port_num,
6440                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6441     offset += 2;
6442     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_status,
6443                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6444     offset++;
6445   }
6446 }
6447
6448 static void
6449 dissect_hs20_anqp_nai_home_realm_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
6450                                        int offset, int end)
6451 {
6452   guint8 len;
6453   proto_item *item;
6454
6455   proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_count,
6456                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6457   offset++;
6458
6459   while (offset + 2 <= end) {
6460     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_encoding_type,
6461                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6462     offset++;
6463     len = tvb_get_guint8(tvb, offset);
6464     item = proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_length,
6465                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6466     offset++;
6467     if (offset + len > end) {
6468       expert_add_info(pinfo, item, &ei_hs20_anqp_nai_hrq_length);
6469       break;
6470     }
6471     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_realm_name,
6472                         tvb, offset, len, ENC_ASCII|ENC_NA);
6473     offset += len;
6474   }
6475 }
6476
6477 static void
6478 dissect_hs20_anqp_oper_class_indic(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6479 {
6480   while (offset < end) {
6481     proto_tree_add_item(tree, hf_hs20_anqp_oper_class_indic,
6482                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6483     offset++;
6484   }
6485 }
6486
6487 static void
6488 dissect_hs20_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6489                   int end, gboolean request, int idx)
6490 {
6491   guint8 subtype;
6492
6493   subtype = tvb_get_guint8(tvb, offset);
6494   proto_item_append_text(tree, " - HS 2.0 %s",
6495                          val_to_str(subtype, hs20_anqp_subtype_vals,
6496                                     "Unknown (%u)"));
6497   if (idx == 0) {
6498     col_append_fstr(pinfo->cinfo, COL_INFO, " HS 2.0 %s",
6499                     val_to_str(subtype, hs20_anqp_subtype_vals,
6500                                "Unknown (%u)"));
6501   } else if (idx == 1) {
6502     col_append_str(pinfo->cinfo, COL_INFO, ", ..");
6503   }
6504   proto_tree_add_item(tree, hf_hs20_anqp_subtype, tvb, offset, 1,
6505                       ENC_LITTLE_ENDIAN);
6506   offset++;
6507
6508   proto_tree_add_item(tree, hf_hs20_anqp_reserved, tvb, offset, 1,
6509                       ENC_LITTLE_ENDIAN);
6510   offset++;
6511
6512   switch (subtype) {
6513   case HS20_ANQP_HS_QUERY_LIST:
6514     dissect_hs20_anqp_hs_query_list(tree, tvb, offset, end);
6515     break;
6516   case HS20_ANQP_HS_CAPABILITY_LIST:
6517     dissect_hs20_anqp_hs_capability_list(tree, tvb, offset, end);
6518     break;
6519   case HS20_ANQP_OPERATOR_FRIENDLY_NAME:
6520     dissect_hs20_anqp_operator_friendly_name(tree, tvb, pinfo, offset, end);
6521     break;
6522   case HS20_ANQP_WAN_METRICS:
6523     dissect_hs20_anqp_wan_metrics(tree, tvb, offset, request);
6524     break;
6525   case HS20_ANQP_CONNECTION_CAPABILITY:
6526     dissect_hs20_anqp_connection_capability(tree, tvb, offset, end);
6527     break;
6528   case HS20_ANQP_NAI_HOME_REALM_QUERY:
6529     dissect_hs20_anqp_nai_home_realm_query(tree, tvb, pinfo, offset, end);
6530     break;
6531   case HS20_ANQP_OPERATING_CLASS_INDICATION:
6532     dissect_hs20_anqp_oper_class_indic(tree, tvb, offset, end);
6533     break;
6534   default:
6535     if (offset == end)
6536       break;
6537     proto_tree_add_item(tree, hf_hs20_anqp_payload, tvb, offset,
6538                         end - offset, ENC_NA);
6539     break;
6540   }
6541 }
6542
6543 static int
6544 dissect_anqp_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6545                   gboolean request, int idx)
6546 {
6547   guint16     id, len;
6548   guint32     oui;
6549   proto_item *item;
6550
6551   item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_id,
6552                              tvb, offset, 2, ENC_LITTLE_ENDIAN);
6553   id = tvb_get_letohs(tvb, offset);
6554   if (id != ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
6555     if (idx == 0) {
6556       proto_item_append_text(tree, " - %s",
6557                              val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
6558       col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
6559                       val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
6560     } else if (idx == 1) {
6561       proto_item_append_text(tree, ", ..");
6562       col_append_str(pinfo->cinfo, COL_INFO, ", ..");
6563     }
6564   }
6565   tree = proto_item_add_subtree(item, ett_gas_anqp);
6566   offset += 2;
6567   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_length,
6568                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6569   len = tvb_get_letohs(tvb, offset);
6570   offset += 2;
6571   if (tvb_reported_length_remaining(tvb, offset) < len) {
6572     expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_info_length);
6573     return 4 + len;
6574   }
6575   switch (id)
6576   {
6577   case ANQP_INFO_ANQP_QUERY_LIST:
6578     dissect_anqp_query_list(tree, tvb, pinfo, offset, offset + len);
6579     break;
6580   case ANQP_INFO_ANQP_CAPAB_LIST:
6581     dissect_anqp_capab_list(tree, tvb, pinfo, offset, offset + len);
6582     break;
6583   case ANQP_INFO_VENUE_NAME_INFO:
6584     dissect_venue_name_info(tree, tvb, pinfo, offset, offset + len);
6585     break;
6586   case ANQP_INFO_NETWORK_AUTH_TYPE_INFO:
6587     dissect_network_auth_type(tree, tvb, offset, offset + len);
6588     break;
6589   case ANQP_INFO_ROAMING_CONSORTIUM_LIST:
6590     dissect_roaming_consortium_list(tree, tvb, pinfo, offset, offset + len);
6591     break;
6592   case ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO:
6593     dissect_ip_addr_type_availability_info(tree, tvb, offset);
6594     break;
6595   case ANQP_INFO_NAI_REALM_LIST:
6596     dissect_nai_realm_list(tree, tvb, pinfo, offset, offset + len);
6597     break;
6598   case ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO:
6599     dissect_3gpp_cellular_network_info(tree, tvb, pinfo, offset);
6600     break;
6601   case ANQP_INFO_DOMAIN_NAME_LIST:
6602     dissect_domain_name_list(tree, tvb, offset, offset + len);
6603     break;
6604   case ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST:
6605     oui = tvb_get_ntoh24(tvb, offset);
6606     proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
6607     offset += 3;
6608
6609     switch (oui) {
6610     case OUI_WFA:
6611       proto_tree_add_item(tree, hf_ieee80211_anqp_wfa_subtype, tvb, offset, 1,
6612                           ENC_NA);
6613       switch (tvb_get_guint8(tvb, offset)) {
6614       case WFA_SUBTYPE_P2P:
6615         dissect_wifi_p2p_anqp(pinfo, tree, tvb, offset + 1, request);
6616         break;
6617       case WFA_SUBTYPE_HS20_ANQP:
6618         dissect_hs20_anqp(tree, tvb, pinfo, offset + 1, offset + len - 3, request,
6619                           idx);
6620         break;
6621       }
6622       break;
6623     default:
6624       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
6625                           tvb, offset, len, ENC_NA);
6626       break;
6627     }
6628     break;
6629   default:
6630     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
6631                         tvb, offset, len, ENC_NA);
6632     break;
6633   }
6634
6635   return 4 + len;
6636 }
6637
6638 static void
6639 dissect_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, gboolean request)
6640 {
6641   int idx = 0;
6642
6643   proto_item_append_text(tree, ": ANQP ");
6644   proto_item_append_text(tree, request ? "Request" : "Response");
6645   if (tvb_reported_length_remaining(tvb, offset) < 4) {
6646     expert_add_info_format(pinfo, tree, &ei_ieee80211_not_enough_room_for_anqp_header,
6647                            "Not enough room for ANQP header");
6648     return;
6649   }
6650   col_append_fstr(pinfo->cinfo, COL_INFO, ", ANQP %s",
6651                   request ? "Req" : "Resp");
6652   while (tvb_reported_length_remaining(tvb, offset) > 0) {
6653     offset += dissect_anqp_info(tree, tvb, pinfo, offset, request, idx);
6654     idx += 1;
6655   }
6656 }
6657
6658 static guint
6659 dissect_gas_initial_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6660                             gboolean anqp)
6661 {
6662   guint16     req_len;
6663   int         start = offset;
6664   proto_item *item;
6665   proto_tree *query;
6666
6667   /* Query Request Length (2 octets) */
6668   req_len = tvb_get_letohs(tvb, offset);
6669
6670   query = proto_tree_add_subtree(tree, tvb, offset, 2 + req_len, ett_gas_query, &item, "Query Request");
6671   if (tvb_reported_length_remaining(tvb, offset) < 2 + req_len) {
6672     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_request_length);
6673     return tvb_reported_length_remaining(tvb, offset);
6674   }
6675
6676   proto_tree_add_item(query, hf_ieee80211_ff_query_request_length,
6677                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6678   offset += 2;
6679   /*
6680    * Query Request (GAS query; formatted per protocol specified in the
6681    * Advertisement Protocol IE)
6682    */
6683   if (anqp)
6684     dissect_anqp(query, tvb, pinfo, offset, TRUE);
6685   else
6686     proto_tree_add_item(query, hf_ieee80211_ff_query_request,
6687                         tvb, offset, req_len, ENC_NA);
6688   offset += req_len;
6689
6690   return offset - start;
6691 }
6692
6693 static guint
6694 dissect_gas_initial_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6695                              gboolean anqp)
6696 {
6697   guint16     resp_len;
6698   int         start = offset;
6699   proto_item *item;
6700   proto_tree *query;
6701
6702   /* Query Response Length (2 octets) */
6703   resp_len = tvb_get_letohs(tvb, offset);
6704
6705   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
6706                              ett_gas_query, &item, "Query Response");
6707   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
6708     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
6709     return tvb_reported_length_remaining(tvb, offset);
6710   }
6711
6712   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
6713                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6714   offset += 2;
6715   /* Query Response (optional) */
6716   if (resp_len) {
6717     if (anqp)
6718       dissect_anqp(query, tvb, pinfo, offset, FALSE);
6719     else
6720       proto_tree_add_item(query, hf_ieee80211_ff_query_response,
6721                           tvb, offset, resp_len, ENC_NA);
6722     offset += resp_len;
6723   }
6724
6725   return offset - start;
6726 }
6727
6728 static reassembly_table gas_reassembly_table;
6729
6730 static gint ett_gas_resp_fragment = -1;
6731 static gint ett_gas_resp_fragments = -1;
6732
6733 static int hf_ieee80211_gas_resp_fragments = -1;
6734 static int hf_ieee80211_gas_resp_fragment = -1;
6735 static int hf_ieee80211_gas_resp_fragment_overlap = -1;
6736 static int hf_ieee80211_gas_resp_fragment_overlap_conflict = -1;
6737 static int hf_ieee80211_gas_resp_fragment_multiple_tails = -1;
6738 static int hf_ieee80211_gas_resp_fragment_too_long_fragment = -1;
6739 static int hf_ieee80211_gas_resp_fragment_error = -1;
6740 static int hf_ieee80211_gas_resp_fragment_count = -1;
6741 static int hf_ieee80211_gas_resp_reassembled_in = -1;
6742 static int hf_ieee80211_gas_resp_reassembled_length = -1;
6743
6744 static const fragment_items gas_resp_frag_items = {
6745   &ett_gas_resp_fragment,
6746   &ett_gas_resp_fragments,
6747   &hf_ieee80211_gas_resp_fragments,
6748   &hf_ieee80211_gas_resp_fragment,
6749   &hf_ieee80211_gas_resp_fragment_overlap,
6750   &hf_ieee80211_gas_resp_fragment_overlap_conflict,
6751   &hf_ieee80211_gas_resp_fragment_multiple_tails,
6752   &hf_ieee80211_gas_resp_fragment_too_long_fragment,
6753   &hf_ieee80211_gas_resp_fragment_error,
6754   &hf_ieee80211_gas_resp_fragment_count,
6755   &hf_ieee80211_gas_resp_reassembled_in,
6756   &hf_ieee80211_gas_resp_reassembled_length,
6757   /* Reassembled data field */
6758   NULL,
6759   "GAS Response fragments"
6760 };
6761
6762 static guint
6763 dissect_gas_comeback_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6764                               gboolean anqp, guint8 frag, gboolean more,
6765                               guint8 dialog_token)
6766 {
6767   guint16     resp_len;
6768   int         start = offset;
6769   proto_item *item;
6770   proto_tree *query;
6771
6772   /* Query Response Length (2 octets) */
6773   resp_len = tvb_get_letohs(tvb, offset);
6774
6775   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
6776                              ett_gas_query, &item, "Query Response");
6777   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
6778     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
6779     return tvb_reported_length_remaining(tvb, offset);
6780   }
6781
6782   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
6783                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6784   offset += 2;
6785   /* Query Response (optional) */
6786   if (resp_len) {
6787     if (anqp && (frag == 0) && !more)
6788       dissect_anqp(query, tvb, pinfo, offset, FALSE);
6789     else {
6790       fragment_head *frag_msg;
6791       gboolean save_fragmented;
6792       tvbuff_t *new_tvb;
6793
6794       save_fragmented = pinfo->fragmented;
6795       pinfo->fragmented = TRUE;
6796       frag_msg = fragment_add_seq_check(&gas_reassembly_table, tvb, offset,
6797                                         pinfo, dialog_token, NULL,
6798                                         frag, resp_len, more);
6799       new_tvb = process_reassembled_data(tvb, offset, pinfo,
6800                                          "Reassembled GAS Query Response",
6801                                          frag_msg, &gas_resp_frag_items,
6802                                          NULL, tree);
6803       if (new_tvb) {
6804         if (anqp)
6805           dissect_anqp(query, new_tvb, pinfo, 0, FALSE);
6806         else
6807           proto_tree_add_item(query, hf_ieee80211_ff_query_response,
6808                               new_tvb, 0,
6809                               tvb_reported_length_remaining(new_tvb, 0),
6810                               ENC_NA);
6811       }
6812
6813       /* The old tvb cannot be used anymore */
6814       ieee80211_tvb_invalid = TRUE;
6815
6816       pinfo->fragmented = save_fragmented;
6817     }
6818     offset += resp_len;
6819   }
6820
6821   return offset - start;
6822 }
6823
6824 /* ************************************************************************* */
6825 /*              Dissect and add fixed mgmt fields to protocol tree           */
6826 /* ************************************************************************* */
6827
6828 static guint64 last_timestamp;
6829
6830 static guint
6831 add_ff_timestamp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6832 {
6833   last_timestamp = tvb_get_letoh64(tvb, offset);
6834   proto_tree_add_item(tree, hf_ieee80211_ff_timestamp, tvb, offset, 8,
6835                       ENC_LITTLE_ENDIAN);
6836   return 8;
6837 }
6838
6839 static guint
6840 add_ff_beacon_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6841 {
6842   proto_tree_add_item(tree, hf_ieee80211_ff_beacon_interval, tvb, offset, 2,
6843                       ENC_LITTLE_ENDIAN);
6844   col_append_fstr(pinfo->cinfo, COL_INFO, ", BI=%d",
6845                   tvb_get_letohs(tvb, offset));
6846   return 2;
6847 }
6848
6849 static guint
6850 add_ff_cap_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6851 {
6852   proto_item *cap_item;
6853   proto_tree *cap_tree;
6854
6855   cap_item = proto_tree_add_item(tree, hf_ieee80211_ff_capture, tvb, offset, 2,
6856                                  ENC_LITTLE_ENDIAN);
6857   cap_tree = proto_item_add_subtree(cap_item, ett_cap_tree);
6858
6859   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ess, tvb, offset, 2,
6860                       ENC_LITTLE_ENDIAN);
6861   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ibss, tvb, offset, 2,
6862                       ENC_LITTLE_ENDIAN);
6863   if ((tvb_get_letohs(tvb, offset) & 0x0001) != 0) {
6864     /* This is an AP */
6865     proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ap_poll, tvb, offset, 2,
6866                         ENC_LITTLE_ENDIAN);
6867   } else {
6868     /* This is a STA */
6869     proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_sta_poll, tvb, offset, 2,
6870                         ENC_LITTLE_ENDIAN);
6871   }
6872
6873   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_privacy, tvb, offset, 2,
6874                       ENC_LITTLE_ENDIAN);
6875   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_preamble, tvb, offset, 2,
6876                       ENC_LITTLE_ENDIAN);
6877   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_pbcc, tvb, offset, 2,
6878                       ENC_LITTLE_ENDIAN);
6879   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_agility, tvb, offset, 2,
6880                       ENC_LITTLE_ENDIAN);
6881   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_spec_man, tvb, offset, 2,
6882                       ENC_LITTLE_ENDIAN);
6883   proto_tree_add_item(cap_tree, hf_ieee80211_ff_short_slot_time, tvb, offset,
6884                       2, ENC_LITTLE_ENDIAN);
6885   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_apsd, tvb, offset, 2,
6886                       ENC_LITTLE_ENDIAN);
6887   proto_tree_add_item(cap_tree, hf_ieee80211_ff_radio_measurement, tvb, offset, 2,
6888                       ENC_LITTLE_ENDIAN);
6889   proto_tree_add_item(cap_tree, hf_ieee80211_ff_dsss_ofdm, tvb, offset, 2,
6890                       ENC_LITTLE_ENDIAN);
6891   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_del_blk_ack, tvb, offset, 2,
6892                       ENC_LITTLE_ENDIAN);
6893   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_imm_blk_ack, tvb, offset, 2,
6894                       ENC_LITTLE_ENDIAN);
6895   return 2;
6896 }
6897
6898 static guint
6899 add_ff_auth_alg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6900 {
6901   proto_tree_add_item(tree, hf_ieee80211_ff_auth_alg, tvb, offset, 2,
6902                       ENC_LITTLE_ENDIAN);
6903   return 2;
6904 }
6905
6906 static guint
6907 add_ff_auth_trans_seq(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6908 {
6909   proto_tree_add_item(tree, hf_ieee80211_ff_auth_seq, tvb, offset, 2,
6910                       ENC_LITTLE_ENDIAN);
6911   return 2;
6912 }
6913
6914 static guint
6915 add_ff_current_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6916 {
6917   proto_tree_add_item(tree, hf_ieee80211_ff_current_ap, tvb, offset, 6,
6918                       ENC_NA);
6919   return 6;
6920 }
6921
6922 static guint
6923 add_ff_listen_ival(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6924 {
6925   proto_tree_add_item(tree, hf_ieee80211_ff_listen_ival, tvb, offset, 2,
6926                       ENC_LITTLE_ENDIAN);
6927   return 2;
6928 }
6929
6930 static guint
6931 add_ff_reason_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6932 {
6933   proto_tree_add_item(tree, hf_ieee80211_ff_reason, tvb, offset, 2,
6934                       ENC_LITTLE_ENDIAN);
6935   return 2;
6936 }
6937
6938 static guint
6939 add_ff_assoc_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6940 {
6941   proto_tree_add_item(tree, hf_ieee80211_ff_assoc_id, tvb, offset, 2,
6942                       ENC_LITTLE_ENDIAN);
6943   return 2;
6944 }
6945
6946 static guint
6947 add_ff_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6948 {
6949   proto_tree_add_item(tree, hf_ieee80211_ff_status_code, tvb, offset, 2,
6950                       ENC_LITTLE_ENDIAN);
6951   return 2;
6952 }
6953
6954 static guint
6955 add_ff_category_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6956 {
6957   proto_tree_add_item(tree, hf_ieee80211_ff_category_code, tvb, offset, 1,
6958                       ENC_LITTLE_ENDIAN);
6959   return 1;
6960 }
6961
6962 static guint
6963 add_ff_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6964 {
6965   proto_tree_add_item(tree, hf_ieee80211_ff_action_code, tvb, offset, 1,
6966                       ENC_LITTLE_ENDIAN);
6967   return 1;
6968 }
6969
6970 static guint
6971 add_ff_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6972 {
6973   proto_tree_add_item(tree, hf_ieee80211_ff_dialog_token, tvb, offset, 1,
6974                       ENC_LITTLE_ENDIAN);
6975   return 1;
6976 }
6977
6978 static guint
6979 add_ff_followup_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6980 {
6981   proto_tree_add_item(tree, hf_ieee80211_ff_followup_dialog_token, tvb, offset, 1,
6982                       ENC_LITTLE_ENDIAN);
6983   return 1;
6984 }
6985
6986 static guint
6987 add_ff_wme_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6988 {
6989   proto_tree_add_item(tree, hf_ieee80211_ff_wme_action_code, tvb, offset, 1,
6990                       ENC_LITTLE_ENDIAN);
6991   return 1;
6992 }
6993
6994 static guint
6995 add_ff_wme_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6996 {
6997   proto_tree_add_item(tree, hf_ieee80211_ff_wme_status_code, tvb, offset, 1,
6998                       ENC_LITTLE_ENDIAN);
6999   return 1;
7000 }
7001
7002 static guint
7003 add_ff_qos_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7004 {
7005   proto_tree_add_item(tree, hf_ieee80211_ff_qos_action_code, tvb, offset, 1,
7006                       ENC_LITTLE_ENDIAN);
7007   return 1;
7008 }
7009
7010 static guint
7011 add_ff_block_ack_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7012 {
7013   proto_tree_add_item(tree, hf_ieee80211_ff_ba_action, tvb, offset, 1,
7014                       ENC_LITTLE_ENDIAN);
7015   return 1;
7016 }
7017
7018 static guint
7019 add_ff_block_ack_param(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7020 {
7021   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_params,
7022                          ett_ff_ba_param_tree,
7023                          ieee80211_ff_block_ack_params_fields,
7024                          ENC_LITTLE_ENDIAN);
7025   return 2;
7026 }
7027
7028 static guint
7029 add_ff_block_ack_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7030 {
7031   proto_tree_add_item(tree, hf_ieee80211_ff_block_ack_timeout, tvb, offset, 2,
7032                       ENC_LITTLE_ENDIAN);
7033   return 2;
7034 }
7035
7036 static guint
7037 add_ff_block_ack_ssc(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7038 {
7039   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_ssc,
7040                          ett_ff_ba_ssc_tree, ieee80211_ff_block_ack_ssc_fields,
7041                          ENC_LITTLE_ENDIAN);
7042   return 2;
7043 }
7044
7045 static guint
7046 add_ff_qos_ts_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7047 {
7048   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_tsinfo,
7049                          ett_tsinfo_tree, ieee80211_tsinfo_fields,
7050                          ENC_LITTLE_ENDIAN);
7051   return 3;
7052 }
7053
7054 static guint
7055 add_ff_mesh_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7056 {
7057   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_action, tvb, offset, 1,
7058                       ENC_LITTLE_ENDIAN);
7059   return 1;
7060 }
7061
7062 static guint
7063 add_ff_multihop_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7064 {
7065   proto_tree_add_item(tree, hf_ieee80211_ff_multihop_action, tvb, offset, 1,
7066                       ENC_LITTLE_ENDIAN);
7067   return 1;
7068 }
7069
7070 static guint
7071 add_ff_mesh_control(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7072 {
7073   int    start = offset;
7074   guint8 flags;
7075
7076   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_flags, tvb, offset, 1,
7077                       ENC_LITTLE_ENDIAN);
7078   flags = tvb_get_guint8(tvb, offset);
7079   offset += 1;
7080   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_ttl, tvb, offset, 1,
7081                       ENC_LITTLE_ENDIAN);
7082   offset += 1;
7083   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_sequence, tvb, offset, 4,
7084                       ENC_LITTLE_ENDIAN);
7085   offset += 4;
7086
7087   switch (flags & 0x03) {
7088   case 1:
7089     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr4, tvb, offset, 6,
7090                         ENC_NA);
7091     offset += 6;
7092     break;
7093   case 2:
7094     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr5, tvb, offset, 6,
7095                         ENC_NA);
7096     offset += 6;
7097     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr6, tvb, offset, 6,
7098                         ENC_NA);
7099     offset += 6;
7100     break;
7101   case 3:
7102     proto_item_append_text(tree, " Unknown Address Extension Mode");
7103     break;
7104   default:
7105     /* no default action */
7106     break;
7107   }
7108
7109   return offset - start;
7110 }
7111
7112 static guint
7113 add_ff_selfprot_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7114 {
7115   proto_tree_add_item(tree, hf_ieee80211_ff_selfprot_action, tvb, offset, 1,
7116                       ENC_LITTLE_ENDIAN);
7117   return 1;
7118 }
7119
7120 static guint
7121 add_ff_dls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7122 {
7123   proto_tree_add_item(tree, hf_ieee80211_ff_dls_action_code, tvb, offset, 1,
7124                       ENC_LITTLE_ENDIAN);
7125   return 1;
7126 }
7127
7128 static guint
7129 add_ff_dst_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7130 {
7131   proto_tree_add_item(tree, hf_ieee80211_ff_dst_mac_addr, tvb, offset, 6,
7132                       ENC_NA);
7133   return 6;
7134 }
7135
7136 static guint
7137 add_ff_src_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7138 {
7139   proto_tree_add_item(tree, hf_ieee80211_ff_src_mac_addr, tvb, offset, 6,
7140                       ENC_NA);
7141   return 6;
7142 }
7143
7144 static guint
7145 add_ff_req_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7146 {
7147   proto_tree_add_item(tree, hf_ieee80211_ff_req_ap_addr, tvb, offset, 6,
7148                       ENC_NA);
7149   return 6;
7150 }
7151
7152 static guint
7153 add_ff_res_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7154 {
7155   proto_tree_add_item(tree, hf_ieee80211_ff_res_ap_addr, tvb, offset, 6,
7156                       ENC_NA);
7157   return 6;
7158 }
7159
7160 static guint
7161 add_ff_check_beacon(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7162 {
7163   proto_tree_add_item(tree, hf_ieee80211_ff_check_beacon, tvb, offset, 1,
7164                       ENC_NA);
7165   return 1;
7166 }
7167
7168 static guint
7169 add_ff_tod(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7170 {
7171   proto_tree_add_item(tree, hf_ieee80211_ff_tod, tvb, offset, 4,
7172                      ENC_NA);
7173   return 4;
7174 }
7175
7176 static guint
7177 add_ff_toa(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7178 {
7179   proto_tree_add_item(tree, hf_ieee80211_ff_toa, tvb, offset, 4,
7180                       ENC_NA);
7181   return 4;
7182 }
7183
7184 static guint
7185 add_ff_max_tod_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7186 {
7187   proto_tree_add_item(tree, hf_ieee80211_ff_max_tod_err, tvb, offset, 1,
7188                       ENC_NA);
7189   return 1;
7190 }
7191
7192 static guint
7193 add_ff_max_toa_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7194 {
7195   proto_tree_add_item(tree, hf_ieee80211_ff_max_toa_err, tvb, offset, 1,
7196                       ENC_NA);
7197   return 1;
7198 }
7199
7200 static guint
7201 add_ff_dls_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7202 {
7203   proto_tree_add_item(tree, hf_ieee80211_ff_dls_timeout, tvb, offset, 2,
7204                       ENC_LITTLE_ENDIAN);
7205   return 2;
7206 }
7207
7208 static guint
7209 add_ff_delba_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7210 {
7211   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_delba_param,
7212                          ett_ff_ba_param_tree, ieee80211_ff_delba_param_fields,
7213                          ENC_LITTLE_ENDIAN);
7214   return 2;
7215 }
7216
7217 static guint
7218 add_ff_max_reg_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7219 {
7220   proto_tree_add_item(tree, hf_ieee80211_ff_max_reg_pwr, tvb, offset, 2,
7221                       ENC_LITTLE_ENDIAN);
7222   return 2;
7223 }
7224
7225 static guint
7226 add_ff_measurement_pilot_int(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7227 {
7228   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
7229                       2, ENC_LITTLE_ENDIAN);
7230   return 2;
7231 }
7232
7233 static guint
7234 add_ff_country_str(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7235 {
7236   proto_tree_add_item(tree, hf_ieee80211_ff_country_str, tvb, offset, 3,
7237                       ENC_ASCII|ENC_NA);
7238   return 3;
7239 }
7240
7241 static guint
7242 add_ff_max_tx_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7243 {
7244   proto_tree_add_item(tree, hf_ieee80211_ff_max_tx_pwr, tvb, offset, 1,
7245                       ENC_LITTLE_ENDIAN);
7246   return 1;
7247 }
7248
7249 static guint
7250 add_ff_tx_pwr_used(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7251 {
7252   proto_tree_add_item(tree, hf_ieee80211_ff_tx_pwr_used, tvb, offset, 1,
7253                       ENC_LITTLE_ENDIAN);
7254   return 1;
7255 }
7256
7257 static guint
7258 add_ff_transceiver_noise_floor(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7259 {
7260   proto_tree_add_item(tree, hf_ieee80211_ff_transceiver_noise_floor, tvb,
7261                       offset, 1, ENC_LITTLE_ENDIAN);
7262   return 1;
7263 }
7264
7265 static guint
7266 add_ff_channel_width(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7267 {
7268   proto_tree_add_item(tree, hf_ieee80211_ff_channel_width, tvb, offset, 1,
7269                       ENC_LITTLE_ENDIAN);
7270   return 1;
7271 }
7272
7273 /* QoS Info:  802.11-2012 8.4.1.17 */
7274 static guint
7275 add_ff_qos_info_ap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7276 {
7277   /* From AP so decode as AP: Figure 8-51-QoS Info field when sent by a AP */
7278   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
7279                                     ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
7280                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
7281   return 1;
7282 }
7283
7284
7285 /* QoS Info:  802.11-2012 8.4.1.17 */
7286 static guint
7287 add_ff_qos_info_sta(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7288 {
7289   /* To AP so decode as STA: Figure 8-52-QoS Info field when set by a non-AP STA */
7290   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_sta,
7291                                     ett_ff_qos_info, ieee80211_ff_qos_info_sta_fields,
7292                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
7293   return 1;
7294 }
7295
7296 static guint
7297 add_ff_sm_pwr_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7298 {
7299   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_sm_pwr_save,
7300                          ett_ff_sm_pwr_save, ieee80211_ff_sw_pwr_save_fields,
7301                          ENC_LITTLE_ENDIAN);
7302   return 1;
7303 }
7304
7305 static guint
7306 add_ff_pco_phase_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7307 {
7308   proto_tree_add_item(tree, hf_ieee80211_ff_pco_phase_cntrl, tvb, offset, 1,
7309                       ENC_LITTLE_ENDIAN);
7310   return 1;
7311 }
7312
7313 static guint
7314 add_ff_psmp_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7315 {
7316   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_psmp_param_set,
7317                          ett_ff_psmp_param_set,
7318                          ieee80211_ff_psmp_param_set_fields,
7319                          ENC_LITTLE_ENDIAN);
7320   return 2;
7321 }
7322
7323 static guint
7324 add_ff_mimo_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7325 {
7326   proto_item *mimo_item;
7327   proto_tree *mimo_tree;
7328
7329   mimo_item = proto_tree_add_item(tree, hf_ieee80211_ff_mimo_cntrl, tvb,
7330                                   offset, 6, ENC_NA);
7331   mimo_tree = proto_item_add_subtree(mimo_item, ett_ff_mimo_cntrl);
7332
7333   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_nc_index, tvb,
7334                       offset, 1, ENC_LITTLE_ENDIAN);
7335   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_nr_index, tvb,
7336                       offset, 1, ENC_LITTLE_ENDIAN);
7337   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_channel_width, tvb,
7338                       offset, 1, ENC_LITTLE_ENDIAN);
7339   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_grouping, tvb,
7340                       offset, 1, ENC_LITTLE_ENDIAN);
7341   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_coefficient_size,
7342                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7343   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_codebook_info, tvb,
7344                       offset, 1, ENC_LITTLE_ENDIAN);
7345   proto_tree_add_item(mimo_tree,
7346                       hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment, tvb,
7347                       offset, 1, ENC_LITTLE_ENDIAN);
7348   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_reserved, tvb,
7349                       offset, 1, ENC_LITTLE_ENDIAN);
7350
7351   offset += 2;
7352   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
7353                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
7354
7355   return 6;
7356 }
7357
7358 static guint
7359 add_ff_ant_selection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7360 {
7361   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ant_selection,
7362                          ett_ff_ant_sel, ieee80211_ff_ant_selection_fields,
7363                          ENC_LITTLE_ENDIAN);
7364   return 1;
7365 }
7366
7367 static guint
7368 add_ff_extended_channel_switch_announcement(proto_tree *tree, tvbuff_t *tvb,
7369                                             packet_info *pinfo _U_, int offset)
7370 {
7371   proto_tree_add_bitmask(tree, tvb, offset,
7372                          hf_ieee80211_ff_ext_channel_switch_announcement,
7373                          ett_ff_chan_switch_announce,
7374                          ieee80211_ff_ext_channel_switch_announcement_fields,
7375                          ENC_LITTLE_ENDIAN);
7376   return 4;
7377 }
7378
7379 static guint
7380 add_ff_ht_information(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7381 {
7382   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ht_info,
7383                          ett_ff_ht_info, ieee80211_ff_ht_info_fields,
7384                          ENC_LITTLE_ENDIAN);
7385   return 1;
7386 }
7387
7388 static guint
7389 add_ff_ht_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7390 {
7391   proto_tree_add_item(tree, hf_ieee80211_ff_ht_action, tvb, offset, 1,
7392                       ENC_LITTLE_ENDIAN);
7393   return 1;
7394 }
7395
7396 static guint
7397 add_ff_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7398 {
7399   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_action_code, tvb, offset, 1,
7400                       ENC_LITTLE_ENDIAN);
7401   return 1;
7402 }
7403
7404 static guint
7405 add_ff_dmg_pwr_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7406 {
7407   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_pwr_mgmt, tvb, offset, 1,
7408                       ENC_LITTLE_ENDIAN);
7409   return 1;
7410 }
7411
7412 static guint
7413 add_ff_psmp_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7414 {
7415   proto_item *psmp_item;
7416   proto_tree *psmp_tree;
7417
7418   psmp_item = proto_tree_add_item(tree, hf_ieee80211_ff_psmp_sta_info, tvb,
7419                                   offset, 8, ENC_LITTLE_ENDIAN);
7420   psmp_tree = proto_item_add_subtree(psmp_item, ett_ff_psmp_sta_info);
7421
7422   proto_tree_add_item(psmp_item, hf_ieee80211_ff_psmp_sta_info_type, tvb,
7423                       offset, 4, ENC_LITTLE_ENDIAN);
7424
7425   switch (tvb_get_letohl(tvb, offset) & PSMP_STA_INFO_FLAG_TYPE) {
7426   case PSMP_STA_INFO_BROADCAST:
7427     proto_tree_add_item(psmp_tree,
7428                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
7429                         offset, 4, ENC_LITTLE_ENDIAN);
7430     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
7431                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7432     /* Missing 64 bit bitmask... */
7433     proto_tree_add_uint64(psmp_tree,
7434                           hf_ieee80211_ff_psmp_sta_info_reserved_large,
7435                           tvb, offset, 8,
7436                           (tvb_get_letoh64(tvb, offset) &
7437                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
7438     break;
7439   case PSMP_STA_INFO_MULTICAST:
7440     proto_tree_add_item(psmp_tree,
7441                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
7442                         offset, 4, ENC_LITTLE_ENDIAN);
7443     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
7444                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7445     /* Missing 64 bit bitmask... */
7446     proto_tree_add_uint64(psmp_tree,
7447                           hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
7448                           tvb, offset, 6,
7449                           (tvb_get_letoh64(tvb, offset) &
7450                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
7451     break;
7452   case PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED:
7453     proto_tree_add_item(psmp_tree,
7454                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
7455                         offset, 4, ENC_LITTLE_ENDIAN);
7456     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
7457                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7458     offset += 2;
7459     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_sta_id, tvb,
7460                         offset, 4, ENC_LITTLE_ENDIAN);
7461     offset += 2;
7462
7463     proto_tree_add_item(psmp_tree,
7464                         hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
7465                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7466     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_utt_duration,
7467                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7468     proto_tree_add_item(psmp_tree,
7469                         hf_ieee80211_ff_psmp_sta_info_reserved_small, tvb,
7470                         offset, 4, ENC_LITTLE_ENDIAN);
7471     break;
7472   }
7473
7474   return 8;
7475 }
7476
7477 static guint
7478 add_ff_schedule_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7479 {
7480   proto_item *sched_item;
7481   proto_tree *sched_tree;
7482
7483   sched_item = proto_tree_add_item(tree, hf_ieee80211_sched_info, tvb, offset,
7484                                    2, ENC_LITTLE_ENDIAN);
7485   sched_tree = proto_item_add_subtree(sched_item, ett_sched_tree);
7486
7487   proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_agg, tvb, offset, 2,
7488                       ENC_LITTLE_ENDIAN);
7489   if (tvb_get_letohs(tvb, offset) & 0x0001) {
7490     proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_tsid, tvb, offset,
7491                         2, ENC_LITTLE_ENDIAN);
7492     proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_dir, tvb, offset,
7493                         2, ENC_LITTLE_ENDIAN);
7494   }
7495
7496   return 2;
7497 }
7498
7499 static guint
7500 add_ff_pa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7501 {
7502   proto_tree_add_item(tree, hf_ieee80211_ff_public_action, tvb, offset, 1,
7503                       ENC_LITTLE_ENDIAN);
7504   return 1;
7505 }
7506
7507 static guint
7508 add_ff_ppa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7509 {
7510   proto_tree_add_item(tree, hf_ieee80211_ff_protected_public_action, tvb, offset, 1,
7511                       ENC_LITTLE_ENDIAN);
7512   return 1;
7513 }
7514
7515 static guint
7516 add_ff_ft_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7517 {
7518   proto_tree_add_item(tree, hf_ieee80211_ff_ft_action_code, tvb, offset, 1,
7519                       ENC_LITTLE_ENDIAN);
7520   return 1;
7521 }
7522
7523 static guint
7524 add_ff_sta_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7525 {
7526   proto_tree_add_item(tree, hf_ieee80211_ff_sta_address, tvb, offset, 6,
7527                       ENC_NA);
7528   return 6;
7529 }
7530
7531 static guint
7532 add_ff_target_ap_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7533 {
7534   proto_tree_add_item(tree, hf_ieee80211_ff_target_ap_address, tvb, offset, 6,
7535                       ENC_NA);
7536   return 6;
7537 }
7538
7539 static guint
7540 add_ff_gas_comeback_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7541 {
7542   proto_tree_add_item(tree, hf_ieee80211_ff_gas_comeback_delay, tvb, offset, 2,
7543                       ENC_LITTLE_ENDIAN);
7544   return 2;
7545 }
7546
7547 static guint
7548 add_ff_gas_fragment_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7549 {
7550   proto_tree_add_item(tree, hf_ieee80211_ff_gas_fragment_id, tvb, offset, 1,
7551                       ENC_LITTLE_ENDIAN);
7552   proto_tree_add_item(tree, hf_ieee80211_ff_more_gas_fragments, tvb, offset, 1,
7553                       ENC_LITTLE_ENDIAN);
7554   return 1;
7555 }
7556
7557 static guint
7558 add_ff_sa_query_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7559 {
7560   proto_tree_add_item(tree, hf_ieee80211_ff_sa_query_action_code, tvb, offset,
7561                       1, ENC_LITTLE_ENDIAN);
7562   return 1;
7563 }
7564
7565 static guint
7566 add_ff_transaction_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7567 {
7568   proto_tree_add_item(tree, hf_ieee80211_ff_transaction_id, tvb, offset, 2,
7569                       ENC_LITTLE_ENDIAN);
7570   return 2;
7571 }
7572
7573 static guint
7574 add_ff_tdls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7575 {
7576   guint8 code;
7577   code = tvb_get_guint8(tvb, offset);
7578   col_set_str(pinfo->cinfo, COL_INFO,
7579               val_to_str_ext_const(code, &tdls_action_codes_ext,
7580                                    "Unknown TDLS Action"));
7581   proto_tree_add_item(tree, hf_ieee80211_ff_tdls_action_code, tvb, offset, 1,
7582                       ENC_LITTLE_ENDIAN);
7583   return 1;
7584 }
7585
7586 static guint
7587 add_ff_target_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7588 {
7589   proto_tree_add_item(tree, hf_ieee80211_ff_target_channel, tvb, offset, 1,
7590                       ENC_LITTLE_ENDIAN);
7591   return 1;
7592 }
7593
7594 static guint
7595 add_ff_operating_class(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7596 {
7597   proto_tree_add_item(tree, hf_ieee80211_ff_operating_class, tvb, offset, 1,
7598                       ENC_LITTLE_ENDIAN);
7599   return 1;
7600 }
7601
7602 static guint
7603 add_ff_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7604 {
7605   guint8 code;
7606
7607   code = tvb_get_guint8(tvb, offset);
7608   col_set_str(pinfo->cinfo, COL_INFO,
7609               val_to_str_ext_const(code, &wnm_action_codes_ext, "Unknown WNM Action"));
7610   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7611   return 1;
7612 }
7613
7614 static guint
7615 add_ff_unprotected_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7616 {
7617   guint8 code;
7618
7619   code = tvb_get_guint8(tvb, offset);
7620   col_set_str(pinfo->cinfo, COL_INFO,
7621               val_to_str_ext_const(code, &unprotected_wnm_action_codes_ext, "Unknown Unprotected WNM Action"));
7622   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
7623   return 1;
7624 }
7625
7626 static guint
7627 add_ff_unprotected_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7628 {
7629   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_dmg_action_code, tvb, offset, 1, ENC_NA);
7630   return 1;
7631 }
7632
7633 static guint
7634 add_ff_key_data_length(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7635 {
7636   proto_tree_add_item(tree, hf_ieee80211_ff_key_data_length, tvb, offset, 2,
7637                       ENC_LITTLE_ENDIAN);
7638   return 2;
7639 }
7640
7641 static guint
7642 add_ff_wnm_notification_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7643 {
7644   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_notification_type,
7645                       tvb, offset, 1, ENC_NA);
7646   return 1;
7647 }
7648
7649 /* Action frame: Radio Measurement actions */
7650 static guint
7651 add_ff_rm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7652 {
7653   proto_tree_add_item(tree, hf_ieee80211_ff_rm_action_code, tvb, offset, 1, ENC_NA);
7654   return 1;
7655 }
7656
7657 static guint
7658 add_ff_rm_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7659 {
7660   proto_tree_add_item(tree, hf_ieee80211_ff_rm_dialog_token, tvb, offset, 1, ENC_NA);
7661   return 1;
7662 }
7663
7664 /* Radio Measurement Request frame, Action fields */
7665 static guint
7666 add_ff_rm_repetitions(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7667 {
7668   /* Note: 65535 means repeated until cancelled or superseded */
7669   proto_tree_add_item(tree, hf_ieee80211_ff_rm_repetitions, tvb, offset, 2,
7670                       ENC_BIG_ENDIAN);
7671   return 2;
7672 }
7673
7674 /* Link Measurement Request frame, Action fields*/
7675 static guint
7676 add_ff_rm_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7677 {
7678   /* In dBm, see 8.4.1.20 */
7679   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_power, tvb, offset, 1, ENC_NA);
7680   return 1;
7681 }
7682
7683 static guint
7684 add_ff_rm_max_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7685 {
7686   /* In dBm, see 8.4.1.19 */
7687   proto_tree_add_item(tree, hf_ieee80211_ff_rm_max_tx_power, tvb, offset, 1, ENC_NA);
7688   return 1;
7689 }
7690
7691 /* Link Measurement Report frame, Action fields */
7692 static guint
7693 add_ff_rm_tpc_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7694 {
7695   proto_tree *tpc_tree;
7696   proto_item *tpc_item;
7697
7698   /* 8.4.2.19 TPC Report element */
7699   tpc_item = proto_tree_add_item(tree, hf_ieee80211_ff_tpc, tvb, offset, 4, ENC_NA);
7700   tpc_tree = proto_item_add_subtree(tpc_item, ett_tpc);
7701   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_element_id, tvb, offset, 1, ENC_NA);
7702   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_length, tvb, offset + 1, 1, ENC_NA);
7703   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_tx_power, tvb, offset + 2, 1, ENC_NA);
7704   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_link_margin, tvb, offset + 3, 1, ENC_NA);
7705   return 4;
7706 }
7707
7708 static guint
7709 add_ff_rm_rx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7710 {
7711   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
7712   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rx_antenna_id, tvb, offset, 1, ENC_NA);
7713   return 1;
7714 }
7715
7716 static guint
7717 add_ff_rm_tx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7718 {
7719   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
7720   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_antenna_id, tvb, offset, 1, ENC_NA);
7721   return 1;
7722 }
7723
7724 static guint
7725 add_ff_rm_rcpi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7726 {
7727   /* 8.4.2.40: RCPI as specified for certain PHYs */
7728   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rcpi, tvb, offset, 1, ENC_NA);
7729   return 1;
7730 }
7731
7732 static guint
7733 add_ff_rm_rsni(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7734 {
7735   /* 8.4.2.43: RSNI in steps of 0.5 dB, calculated as:
7736    * RSNI = (10 * log10((RCPI_{power} - ANPI_{power}) / ANPI_{power}) + 20)*2 */
7737   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rsni, tvb, offset, 1, ENC_NA);
7738   return 1;
7739 }
7740
7741 static guint
7742 add_ff_bss_transition_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7743 {
7744   proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_status_code, tvb, offset, 1,
7745                       ENC_LITTLE_ENDIAN);
7746   return 1;
7747 }
7748
7749 static guint
7750 add_ff_bss_termination_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7751 {
7752   proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_delay, tvb, offset, 1,
7753                       ENC_LITTLE_ENDIAN);
7754   return 1;
7755 }
7756
7757 static guint
7758 add_ff_action_spectrum_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7759 {
7760     switch (tvb_get_guint8(tvb, offset + 1)) {
7761     case SM_ACTION_MEASUREMENT_REQUEST:
7762     case SM_ACTION_MEASUREMENT_REPORT:
7763     case SM_ACTION_TPC_REQUEST:
7764     case SM_ACTION_TPC_REPORT:
7765       add_ff_category_code(tree, tvb, pinfo, offset);
7766       add_ff_action_code(tree, tvb, pinfo, offset + 1);
7767       add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
7768       return 3;
7769     case SM_ACTION_CHAN_SWITCH_ANNC:
7770     case SM_ACTION_EXT_CHAN_SWITCH_ANNC:
7771       add_ff_category_code(tree, tvb, pinfo, offset);
7772       add_ff_action_code(tree, tvb, pinfo, offset + 1);
7773       return 2;
7774     default:
7775       add_ff_category_code(tree, tvb, pinfo, offset);
7776       add_ff_action_code(tree, tvb, pinfo, offset + 1);
7777       return 2;
7778     }
7779 }
7780
7781 static guint
7782 add_ff_action_qos(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7783 {
7784   switch (tvb_get_guint8(tvb, offset + 1)) {
7785   case QOS_ACTION_ADDTS_REQUEST:
7786     add_ff_category_code(tree, tvb, pinfo, offset);
7787     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
7788     add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
7789     return 3;
7790   case QOS_ACTION_ADDTS_RESPONSE:
7791     add_ff_category_code(tree, tvb, pinfo, offset);
7792     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
7793     add_ff_dialog_token(tree, tvb, pinfo, offset + 2);
7794     add_ff_status_code(tree, tvb, pinfo, offset + 3);
7795     return 5;
7796   case QOS_ACTION_DELTS:
7797     add_ff_category_code(tree, tvb, pinfo, offset);
7798     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
7799     add_ff_qos_ts_info(tree, tvb, pinfo, offset + 2);
7800     add_ff_reason_code(tree, tvb, pinfo, offset + 5);
7801     return 7;
7802   case QOS_ACTION_SCHEDULE:
7803     add_ff_category_code(tree, tvb, pinfo, offset);
7804     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
7805     return 2;
7806   case QOS_ACTION_MAP_CONFIGURE:
7807     add_ff_category_code(tree, tvb, pinfo, offset);
7808     add_ff_qos_action_code(tree, tvb, pinfo, offset + 1);
7809     return 2;
7810   default:
7811     add_ff_category_code(tree, tvb, pinfo, offset);
7812     return 2;
7813   }
7814 }
7815
7816 static guint
7817 add_ff_action_dls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7818 {
7819   switch (tvb_get_guint8(tvb, offset + 1)) {
7820   case DLS_ACTION_REQUEST:
7821     add_ff_category_code(tree, tvb, pinfo, offset);
7822     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
7823     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  2);
7824     add_ff_src_mac_addr(tree, tvb, pinfo, offset +  8);
7825     add_ff_cap_info(tree, tvb, pinfo, offset + 14);
7826     add_ff_dls_timeout(tree, tvb, pinfo, offset + 16);
7827     return 18;
7828   case DLS_ACTION_RESPONSE:
7829     add_ff_category_code(tree, tvb, pinfo, offset);
7830     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
7831     add_ff_status_code(tree, tvb, pinfo, offset +  2);
7832     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  4);
7833     add_ff_src_mac_addr(tree, tvb, pinfo, offset + 10);
7834     if (!hf_ieee80211_ff_status_code) {
7835       add_ff_cap_info(tree, tvb, pinfo, offset + 16);
7836     }
7837     return 16;
7838   case DLS_ACTION_TEARDOWN:
7839     add_ff_category_code(tree, tvb, pinfo, offset);
7840     add_ff_dls_action_code(tree, tvb, pinfo, offset +  1);
7841     add_ff_dst_mac_addr(tree, tvb, pinfo, offset +  2);
7842     add_ff_src_mac_addr(tree, tvb, pinfo, offset +  8);
7843     add_ff_reason_code(tree, tvb, pinfo, offset + 14);
7844     return 16;
7845   default:
7846     add_ff_category_code(tree, tvb, pinfo, offset);
7847     return 2;
7848   }
7849 }
7850
7851 static guint
7852 add_ff_action_block_ack(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7853 {
7854   guint start = offset;
7855
7856   switch (tvb_get_guint8(tvb, offset + 1)) {
7857   case BA_ADD_BLOCK_ACK_REQUEST:
7858     offset += add_ff_category_code(tree, tvb, pinfo, offset);
7859     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
7860     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
7861     offset += add_ff_block_ack_param(tree, tvb, pinfo, offset);
7862     offset += add_ff_block_ack_timeout(tree, tvb, pinfo, offset);
7863     offset += add_ff_block_ack_ssc(tree, tvb, pinfo, offset);
7864     break;
7865   case BA_ADD_BLOCK_ACK_RESPONSE:
7866     offset += add_ff_category_code(tree, tvb, pinfo, offset);
7867     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
7868     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
7869     offset += add_ff_status_code(tree, tvb, pinfo, offset);
7870     offset += add_ff_block_ack_param(tree, tvb, pinfo, offset);
7871     offset += add_ff_block_ack_timeout(tree, tvb, pinfo, offset);
7872     break;
7873   case BA_DELETE_BLOCK_ACK:
7874     offset += add_ff_category_code(tree, tvb, pinfo, offset);
7875     offset += add_ff_block_ack_action_code(tree, tvb, pinfo, offset);
7876     offset += add_ff_delba_param_set(tree, tvb, pinfo, offset);
7877     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
7878     break;
7879   }
7880
7881   return offset - start;  /* Size of fixed fields */
7882 }
7883
7884 static guint
7885 add_ff_action_public_fields(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint8 code)
7886 {
7887   guint32  oui;
7888   guint8   subtype;
7889   gboolean anqp;
7890   guint8   dialog_token;
7891   guint8   frag;
7892   gboolean more;
7893
7894   guint start = offset;
7895
7896   switch (code) {
7897   case PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT:
7898     offset += add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
7899     break;
7900   case PA_VENDOR_SPECIFIC:
7901     oui = tvb_get_ntoh24(tvb, offset);
7902     proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
7903     offset += 3;
7904     switch (oui) {
7905     case OUI_WFA:
7906       subtype = tvb_get_guint8(tvb, offset);
7907       proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
7908       offset += 1;
7909       if (subtype == WFA_SUBTYPE_P2P) {
7910         offset = dissect_wifi_p2p_public_action(pinfo, tree, tvb, offset);
7911       }
7912       break;
7913     default:
7914       /* Don't know how to handle this vendor */
7915       break;
7916     }
7917     break;
7918   case PA_GAS_INITIAL_REQUEST:
7919     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
7920     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
7921                                              &anqp);
7922     offset += dissect_gas_initial_request(tree, tvb, pinfo, offset, anqp);
7923     break;
7924   case PA_GAS_INITIAL_RESPONSE:
7925     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
7926     offset += add_ff_status_code(tree, tvb, pinfo, offset);
7927     offset += add_ff_gas_comeback_delay(tree, tvb, pinfo, offset);
7928     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
7929                                              &anqp);
7930     offset += dissect_gas_initial_response(tree, tvb, pinfo, offset, anqp);
7931     break;
7932   case PA_GAS_COMEBACK_REQUEST:
7933     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
7934     break;
7935   case PA_GAS_COMEBACK_RESPONSE:
7936     dialog_token = tvb_get_guint8(tvb, offset);
7937     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
7938     offset += add_ff_status_code(tree, tvb, pinfo, offset);
7939     frag = tvb_get_guint8(tvb, offset) & 0x7f;
7940     more = (tvb_get_guint8(tvb, offset) & 0x80) != 0;
7941     offset += add_ff_gas_fragment_id(tree, tvb, pinfo, offset);
7942     offset += add_ff_gas_comeback_delay(tree, tvb, pinfo, offset);
7943     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
7944                                              &anqp);
7945     offset += dissect_gas_comeback_response(tree, tvb, pinfo, offset, anqp, frag,
7946                                             more, dialog_token);
7947     break;
7948   case PA_TDLS_DISCOVERY_RESPONSE:
7949     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
7950     col_set_str(pinfo->cinfo, COL_INFO, "TDLS Discovery Response");
7951     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
7952     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
7953     break;
7954   case PA_QAB_REQUEST:
7955   case PA_QAB_RESPONSE:
7956     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
7957     offset += add_ff_req_ap_addr(tree, tvb, pinfo, offset);
7958     offset += add_ff_res_ap_addr(tree, tvb, pinfo, offset);
7959     break;
7960   }
7961
7962   return offset - start;  /* Size of fixed fields */
7963 }
7964
7965 static guint
7966 add_ff_action_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7967 {
7968   guint8 code;
7969   guint start = offset;
7970   offset += add_ff_category_code(tree, tvb, pinfo, offset);
7971   code    = tvb_get_guint8(tvb, offset);
7972   offset += add_ff_pa_action_code(tree, tvb, pinfo, offset);
7973   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
7974   return offset - start;
7975 }
7976
7977 static guint
7978 add_ff_action_protected_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7979 {
7980   guint8 code;
7981   guint start = offset;
7982   offset += add_ff_category_code(tree, tvb, pinfo, offset);
7983   code    = tvb_get_guint8(tvb, offset);
7984   offset += add_ff_ppa_action_code(tree, tvb, pinfo, offset);
7985   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
7986   return offset - start;
7987 }
7988
7989 static guint
7990 add_ff_action_radio_measurement(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7991 {
7992   guint  start = offset;
7993   guint8 code;
7994
7995   offset += add_ff_category_code(tree, tvb, pinfo, offset);
7996   code = tvb_get_guint8(tvb, offset);
7997   offset += add_ff_rm_action_code(tree, tvb, pinfo, offset);
7998
7999   switch (code) {
8000   case RM_ACTION_RADIO_MEASUREMENT_REQUEST:
8001     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8002     offset += add_ff_rm_repetitions(tree, tvb, pinfo, offset);
8003     /* Followed by Measurement Request Elements */
8004     break;
8005   case RM_ACTION_RADIO_MEASUREMENT_REPORT:
8006     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8007     /* Followed by Measurement Report Elements */
8008     break;
8009   case RM_ACTION_LINK_MEASUREMENT_REQUEST:
8010     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8011     offset += add_ff_rm_tx_power(tree, tvb, pinfo, offset);
8012     offset += add_ff_rm_max_tx_power(tree, tvb, pinfo, offset);
8013     /* Followed by Optional Subelements */
8014     break;
8015   case RM_ACTION_LINK_MEASUREMENT_REPORT:
8016     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8017     offset += add_ff_rm_tpc_report(tree, tvb, pinfo, offset);
8018     offset += add_ff_rm_rx_antenna_id(tree, tvb, pinfo, offset);
8019     offset += add_ff_rm_tx_antenna_id(tree, tvb, pinfo, offset);
8020     offset += add_ff_rm_rcpi(tree, tvb, pinfo, offset);
8021     offset += add_ff_rm_rsni(tree, tvb, pinfo, offset);
8022     /* Followed by Optional Subelements */
8023     break;
8024   case RM_ACTION_NEIGHBOR_REPORT_REQUEST:
8025     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8026     /* Followed by Optional Subelements */
8027     break;
8028   case RM_ACTION_NEIGHBOR_REPORT_RESPONSE:
8029     offset += add_ff_rm_dialog_token(tree, tvb, pinfo, offset);
8030     /* Followed by Neighbor Report Elements */
8031     break;
8032   }
8033
8034   return offset - start;  /* Size of fixed fields */
8035 }
8036
8037 static guint
8038 add_ff_action_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8039 {
8040   guint  start = offset;
8041   guint8 code;
8042
8043   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8044   code    = tvb_get_guint8(tvb, offset);
8045   offset += add_ff_ft_action_code(tree, tvb, pinfo, offset);
8046
8047   switch (code) {
8048   case FT_ACTION_REQUEST:
8049     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
8050     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
8051     /* Followed by FT Request frame body (IEs) */
8052     break;
8053   case FT_ACTION_RESPONSE:
8054     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
8055     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
8056     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8057     /* Followed by FT Response frame body (IEs) */
8058     break;
8059   case FT_ACTION_CONFIRM:
8060     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
8061     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
8062     /* Followed by FT Confirm frame body (IEs) */
8063     break;
8064   case FT_ACTION_ACK:
8065     offset += add_ff_sta_address(tree, tvb, pinfo, offset);
8066     offset += add_ff_target_ap_address(tree, tvb, pinfo, offset);
8067     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8068     /* Followed by FT Ack frame body (IEs) */
8069     break;
8070   }
8071
8072   return offset - start;  /* Size of fixed fields */
8073 }
8074
8075 static guint
8076 add_ff_action_sa_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8077 {
8078   guint  start = offset;
8079   guint8 code;
8080
8081   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8082   code    = tvb_get_guint8(tvb, offset);
8083   offset += add_ff_sa_query_action_code(tree, tvb, pinfo, offset);
8084
8085   switch (code) {
8086   case SA_QUERY_REQUEST:
8087     offset += add_ff_transaction_id(tree, tvb, pinfo, offset);
8088     break;
8089   case SA_QUERY_RESPONSE:
8090     offset += add_ff_transaction_id(tree, tvb, pinfo, offset);
8091     break;
8092   }
8093
8094   return offset - start;  /* Size of fixed fields */
8095 }
8096
8097 static guint
8098 add_ff_action_mesh(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8099 {
8100   guint length;
8101
8102   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8103   offset += add_ff_mesh_action(tree, tvb, pinfo, offset);
8104   /* The only fixed fields are the category and mesh action.  The rest are IEs.
8105    */
8106   length = 2;
8107   if (tvb_get_guint8(tvb, 1) == MESH_ACTION_TBTT_ADJ_RESPONSE) {
8108     /* ..except for the TBTT Adjustment Response, which has a status code field
8109      */
8110     length += add_ff_status_code(tree, tvb, pinfo, offset);
8111   }
8112   return length;
8113 }
8114
8115 static guint
8116 add_ff_action_multihop(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8117 {
8118   guint start = offset;
8119
8120   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8121   offset += add_ff_multihop_action(tree, tvb, pinfo, offset);
8122   offset += add_ff_mesh_control(tree, tvb, pinfo, offset);
8123   return offset - start;
8124 }
8125
8126 static guint
8127 add_ff_action_self_protected(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8128 {
8129   guint start = offset;
8130
8131   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8132   offset += add_ff_selfprot_action(tree, tvb, pinfo, offset);
8133
8134   switch (tvb_get_guint8(tvb, start + 1)) {
8135   case SELFPROT_ACTION_MESH_PEERING_OPEN:
8136     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
8137     break;
8138   case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
8139     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
8140     offset += add_ff_assoc_id(tree, tvb, pinfo, offset);
8141     break;
8142   }
8143
8144   return offset - start;
8145 }
8146
8147 static guint
8148 add_ff_vht_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8149 {
8150   proto_tree_add_item(tree, hf_ieee80211_ff_vht_action, tvb, offset, 1,
8151                       ENC_LITTLE_ENDIAN);
8152   return 1;
8153 }
8154
8155
8156 static guint
8157 wnm_bss_trans_mgmt_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8158 {
8159   int    start = offset;
8160   guint8 mode;
8161   gint   left;
8162
8163   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8164
8165   mode = tvb_get_guint8(tvb, offset);
8166   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_pref_cand,
8167                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8168   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_abridged,
8169                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8170   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_disassoc_imminent,
8171                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8172   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_bss_term_included,
8173                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8174   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
8175                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8176   offset += 1;
8177
8178   proto_tree_add_item(tree, hf_ieee80211_ff_disassoc_timer, tvb, offset, 2,
8179                       ENC_LITTLE_ENDIAN);
8180   offset += 2;
8181
8182   proto_tree_add_item(tree, hf_ieee80211_ff_validity_interval, tvb, offset, 1,
8183                       ENC_LITTLE_ENDIAN);
8184   offset += 1;
8185
8186   if (mode & 0x08) {
8187     proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_duration,
8188                         tvb, offset, 8, ENC_NA);
8189     offset += 8;
8190   }
8191
8192   if (mode & 0x10) {
8193     guint8 url_len;
8194     url_len = tvb_get_guint8(tvb, offset);
8195     proto_tree_add_item(tree, hf_ieee80211_ff_url_len, tvb, offset, 1,
8196                         ENC_LITTLE_ENDIAN);
8197     offset += 1;
8198     proto_tree_add_item(tree, hf_ieee80211_ff_url, tvb, offset, url_len,
8199                         ENC_ASCII|ENC_NA);
8200     offset += url_len;
8201   }
8202
8203   left = tvb_reported_length_remaining(tvb, offset);
8204   if (left > 0) {
8205     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
8206                         tvb, offset, left, ENC_NA);
8207     offset += left;
8208   }
8209
8210   return offset - start;
8211 }
8212
8213
8214 static guint
8215 wnm_bss_trans_mgmt_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8216 {
8217   int    start = offset;
8218   guint8 code;
8219   gint   left;
8220
8221   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8222   code = tvb_get_guint8(tvb, offset);
8223   offset += add_ff_bss_transition_status_code(tree, tvb, pinfo, offset);
8224   offset += add_ff_bss_termination_delay(tree, tvb, pinfo, offset);
8225   if (!code) {
8226     proto_tree_add_item(tree, hf_ieee80211_ff_target_bss,
8227                         tvb, offset, 6, ENC_NA);
8228     offset += 6;
8229   }
8230   left = tvb_reported_length_remaining(tvb, offset);
8231   if (left > 0) {
8232     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
8233                         tvb, offset, left, ENC_NA);
8234     offset += left;
8235   }
8236
8237   return offset - start;
8238 }
8239
8240 static guint
8241 wnm_sleep_mode_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8242 {
8243   int start = offset;
8244   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8245   return offset - start;
8246 }
8247
8248 static guint
8249 wnm_sleep_mode_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8250 {
8251   int start = offset;
8252   guint16 key_data_len;
8253   gint left;
8254
8255   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8256   key_data_len = tvb_get_letohs(tvb, offset);
8257   offset += add_ff_key_data_length(tree, tvb, pinfo, offset);
8258   left = tvb_reported_length_remaining(tvb, offset);
8259   if (left < key_data_len) {
8260     expert_add_info(pinfo, tree, &ei_ieee80211_tag_wnm_sleep_mode_no_key_data);
8261     return offset - start;
8262   }
8263   proto_tree_add_item(tree, hf_ieee80211_ff_key_data, tvb, offset,
8264                       key_data_len, ENC_NA);
8265   offset += key_data_len;
8266   return offset - start;
8267 }
8268
8269 static guint
8270 wnm_tfs_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8271 {
8272   int start = offset;
8273   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8274   return offset - start;
8275 }
8276
8277 static guint
8278 wnm_tfs_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8279 {
8280   int start = offset;
8281   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8282   return offset - start;
8283 }
8284
8285 static guint
8286 wnm_notification_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8287 {
8288   int start = offset;
8289   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8290   offset += add_ff_wnm_notification_type(tree, tvb, pinfo, offset);
8291   return offset - start;
8292 }
8293
8294 static guint
8295 add_ff_action_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8296 {
8297   guint8 code;
8298   guint  start = offset;
8299
8300   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8301   code    = tvb_get_guint8(tvb, offset);
8302   offset += add_ff_wnm_action_code(tree, tvb, pinfo, offset);
8303   switch (code) {
8304   case WNM_BSS_TRANS_MGMT_REQ:
8305     offset += wnm_bss_trans_mgmt_req(tree, tvb, pinfo, offset);
8306     break;
8307   case WNM_BSS_TRANS_MGMT_RESP:
8308     offset += wnm_bss_trans_mgmt_resp(tree, tvb, pinfo, offset);
8309     break;
8310   case WNM_TFS_REQ:
8311     offset += wnm_tfs_req(tree, tvb, pinfo, offset);
8312     break;
8313   case WNM_TFS_RESP:
8314     offset += wnm_tfs_resp(tree, tvb, pinfo, offset);
8315     break;
8316   case WNM_SLEEP_MODE_REQ:
8317     offset += wnm_sleep_mode_req(tree, tvb, pinfo, offset);
8318     break;
8319   case WNM_SLEEP_MODE_RESP:
8320     offset += wnm_sleep_mode_resp(tree, tvb, pinfo, offset);
8321     break;
8322   case WNM_NOTIFICATION_REQ:
8323     offset += wnm_notification_req(tree, tvb, pinfo, offset);
8324     break;
8325   }
8326
8327   return offset - start;  /* Size of fixed fields */
8328 }
8329
8330 static guint
8331 add_ff_action_unprotected_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8332 {
8333   guint8 code;
8334   guint  start = offset;
8335
8336   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8337   code    = tvb_get_guint8(tvb, offset);
8338   offset += add_ff_unprotected_wnm_action_code(tree, tvb, pinfo, offset);
8339
8340   switch (code) {
8341   case UNPROTECTED_WNM_TIM:
8342     offset += add_ff_check_beacon(tree, tvb, pinfo, offset);
8343     offset += add_ff_timestamp(tree, tvb, pinfo, offset);
8344     offset += add_ff_tod(tree, tvb, pinfo, offset);
8345     offset += add_ff_toa(tree, tvb, pinfo, offset);
8346     offset += add_ff_max_tod_err(tree, tvb, pinfo, offset);
8347     offset += add_ff_max_toa_err(tree, tvb, pinfo, offset);
8348     break;
8349   case UNPROTECTED_WNM_TIMING_MEASUREMENT:
8350     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8351     offset += add_ff_followup_dialog_token(tree, tvb, pinfo, offset);
8352     break;
8353   }
8354
8355   return offset - start;  /* Size of fixed fields */
8356 }
8357
8358 static guint
8359 add_ff_action_tdls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8360 {
8361   guint8  code;
8362   guint16 status;
8363   guint   start = offset;
8364
8365   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8366   code = tvb_get_guint8(tvb, offset);
8367   offset += add_ff_tdls_action_code(tree, tvb, pinfo, offset);
8368   switch (code) {
8369   case TDLS_SETUP_REQUEST:
8370     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8371     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
8372     break;
8373   case TDLS_SETUP_RESPONSE:
8374     status = tvb_get_letohs(tvb, offset);
8375     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8376     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8377     if (tvb_reported_length_remaining(tvb, offset) < 2) {
8378       if (status == 0) {
8379         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_response_malformed);
8380       }
8381       break;
8382     }
8383     offset += add_ff_cap_info(tree, tvb, pinfo, offset);
8384     break;
8385   case TDLS_SETUP_CONFIRM:
8386     status = tvb_get_letohs(tvb, offset);
8387     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8388     if (tvb_reported_length_remaining(tvb, offset) < 1) {
8389       if (status == 0) {
8390         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_confirm_malformed);
8391       }
8392       break;
8393     }
8394     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8395     break;
8396   case TDLS_TEARDOWN:
8397     offset += add_ff_reason_code(tree, tvb, pinfo, offset);
8398     break;
8399   case TDLS_PEER_TRAFFIC_INDICATION:
8400     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8401     break;
8402   case TDLS_CHANNEL_SWITCH_REQUEST:
8403     offset += add_ff_target_channel(tree, tvb, pinfo, offset);
8404     offset += add_ff_operating_class(tree, tvb, pinfo, offset);
8405     break;
8406   case TDLS_CHANNEL_SWITCH_RESPONSE:
8407     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8408     break;
8409   case TDLS_PEER_PSM_REQUEST:
8410     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8411     break;
8412   case TDLS_PEER_PSM_RESPONSE:
8413     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8414     offset += add_ff_status_code(tree, tvb, pinfo, offset);
8415     break;
8416   case TDLS_PEER_TRAFFIC_RESPONSE:
8417     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8418     break;
8419   case TDLS_DISCOVERY_REQUEST:
8420     offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8421     break;
8422   }
8423
8424   return offset - start;  /* Size of fixed fields */
8425 }
8426
8427 static guint
8428 add_ff_action_mgmt_notification(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8429 {
8430   guint start = offset;
8431
8432   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8433   offset += add_ff_wme_action_code(tree, tvb, pinfo, offset);
8434   offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8435   offset += add_ff_wme_status_code(tree, tvb, pinfo, offset);
8436
8437   return offset - start;  /* Size of fixed fields */
8438 }
8439
8440 static guint
8441 add_ff_action_vendor_specific(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8442 {
8443   guint   start = offset;
8444   guint32 oui;
8445   guint8  subtype;
8446
8447   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8448   oui = tvb_get_ntoh24(tvb, offset);
8449   proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
8450   offset += 3;
8451   switch (oui) {
8452   case OUI_MARVELL:
8453     offset = dissect_vendor_action_marvell(tree, tvb, offset);
8454     break;
8455   case OUI_WFA:
8456     subtype = tvb_get_guint8(tvb, offset);
8457       proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
8458     offset += 1;
8459     if (subtype == WFA_SUBTYPE_P2P) {
8460       offset = dissect_wifi_p2p_action(tree, tvb, offset);
8461     }
8462     break;
8463   default:
8464     /* Don't know how to handle this vendor */
8465     break;
8466   }
8467
8468   return offset - start;  /* Size of fixed fields */
8469 }
8470
8471 static guint
8472 add_ff_action_ht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8473 {
8474   guint  start = offset;
8475   guint8 n_sta, i;
8476   mimo_control_t mimo_cntrl;
8477
8478   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8479   offset += add_ff_ht_action_code(tree, tvb, pinfo, offset);
8480
8481   switch (tvb_get_guint8(tvb, offset - 1)) {
8482   case HT_ACTION_NOTIFY_CHAN_WIDTH:
8483     offset += add_ff_channel_width(tree, tvb, pinfo, offset);
8484     break;
8485   case HT_ACTION_SM_PWR_SAVE:
8486     offset += add_ff_sm_pwr_cntrl(tree, tvb, pinfo, offset);
8487     break;
8488   case HT_ACTION_PSMP_ACTION:
8489     n_sta = tvb_get_guint8(tvb, offset);
8490     offset += add_ff_psmp_param_set(tree, tvb, pinfo, offset);
8491     for (i = 0; i < (n_sta & 0x0F); i++) {
8492       offset += add_ff_psmp_sta_info(tree, tvb, pinfo, offset);
8493     }
8494     break;
8495   case HT_ACTION_SET_PCO_PHASE:
8496     offset += add_ff_pco_phase_cntrl(tree, tvb, pinfo, offset);
8497     break;
8498   case HT_ACTION_MIMO_CSI:
8499     mimo_cntrl = get_mimo_control(tvb, offset);
8500     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
8501     offset += add_mimo_csi_matrices_report(tree, tvb, offset, mimo_cntrl);
8502     break;
8503   case HT_ACTION_MIMO_BEAMFORMING:
8504     mimo_cntrl = get_mimo_control(tvb, offset);
8505     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
8506     offset += add_mimo_beamforming_feedback_report(tree, tvb, offset,
8507                                                    mimo_cntrl);
8508     break;
8509   case HT_ACTION_MIMO_COMPRESSED_BEAMFORMING:
8510     mimo_cntrl = get_mimo_control(tvb, offset);
8511     offset += add_ff_mimo_cntrl(tree, tvb, pinfo, offset);
8512     offset += add_mimo_compressed_beamforming_feedback_report(tree, tvb,
8513                                                               offset,
8514                                                               mimo_cntrl);
8515     break;
8516   case HT_ACTION_ANT_SEL_FEEDBACK:
8517     offset += add_ff_ant_selection(tree, tvb, pinfo, offset);
8518     break;
8519   case HT_ACTION_HT_INFO_EXCHANGE:
8520     offset += add_ff_ht_information(tree, tvb, pinfo, offset);
8521     break;
8522   }
8523
8524   return offset - start;
8525 }
8526
8527 static guint
8528 add_ff_beacon_interval_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8529 {
8530   proto_item *bic_item = proto_tree_add_item(tree, hf_ieee80211_ff_bic, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8531   proto_tree *bic_tree = proto_item_add_subtree(bic_item, ett_bic_tree);
8532
8533   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_cc_present, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8534   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_discovery_mode, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8535   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_next_beacon, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8536   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_ati_present, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8537   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_abft_len, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8538   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_fss, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8539   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_is_resp, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8540   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_next_abft, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8541   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_frag_txss, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8542   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_txss_span, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8543   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_NBI_abft, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8544   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_abft_count, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8545   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_nabft, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8546   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_pcp, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8547   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_reserved, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8548   return 6;
8549 }
8550
8551 static guint
8552 add_ff_beamforming_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset, gboolean isGrant)
8553 {
8554   proto_item *bf_item = proto_tree_add_item(tree, hf_ieee80211_ff_bf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8555   proto_tree *bf_tree = proto_item_add_subtree(bf_item, ett_bf_tree);
8556   guint16 bf_field = tvb_get_letohs(tvb, offset);
8557   gboolean isInit = (bf_field & 0x2) >> 1;
8558   gboolean isResp = (bf_field & 0x4) >> 2;
8559   proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_train, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8560   proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_is_init, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8561   proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_is_resp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8562   if((isInit==TRUE) && (isResp==TRUE) && isGrant) {
8563     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_num_sectors, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8564     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_num_rx_dmg_ants, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8565     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_b12b15, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8566   } else {
8567     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_rxss_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8568     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_rxss_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8569     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_b10b15, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8570   }
8571   return 2;
8572 }
8573
8574 static guint
8575 add_ff_dynamic_allocation(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8576 {
8577   proto_item *dynamic_alloc_item = proto_tree_add_item(tree, hf_ieee80211_ff_dynamic_allocation, tvb, offset, 5, ENC_LITTLE_ENDIAN);
8578   proto_tree *dynamic_alloc_tree = proto_item_add_subtree(dynamic_alloc_item, ett_dynamic_alloc_tree);
8579   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_TID, tvb, offset, 5, ENC_LITTLE_ENDIAN);
8580   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_alloc_type, tvb, offset, 5, ENC_LITTLE_ENDIAN);
8581   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_src_aid, tvb, offset, 5, ENC_LITTLE_ENDIAN);
8582   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_dest_aid, tvb, offset, 5, ENC_LITTLE_ENDIAN);
8583   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_alloc_duration, tvb, offset, 5, ENC_LITTLE_ENDIAN);
8584   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_b39, tvb, offset, 5, ENC_LITTLE_ENDIAN);
8585   return 5;
8586 }
8587
8588 static guint
8589 add_ff_beamformed_link(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8590 {
8591   proto_item *blm_item = proto_tree_add_item(tree, hf_ieee80211_ff_blm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8592   proto_tree *blm_tree = proto_item_add_subtree(blm_item, ett_blm_tree);
8593   proto_tree_add_item(blm_tree, hf_ieee80211_ff_blm_unit_index, tvb, offset, 1, ENC_NA);
8594   proto_tree_add_item(blm_tree, hf_ieee80211_ff_blm_maint_value, tvb, offset, 1, ENC_NA);
8595   proto_tree_add_item(blm_tree, hf_ieee80211_ff_blm_is_master, tvb, offset, 1, ENC_NA);
8596   return 1;
8597 }
8598
8599 static guint
8600 add_ff_BRP_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8601 {
8602   proto_item *brp_req_item = proto_tree_add_item(tree, hf_ieee80211_ff_brp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8603   proto_tree *brp_req_tree = proto_item_add_subtree(brp_req_item, ett_brp_tree);
8604
8605   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_L_RX, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8606   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_TX_TRN_REQ, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8607   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_MID_REQ, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8608   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_BC_REQ, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8609   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_MID_GRANT, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8610   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_BC_GRANT, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8611   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_chan_FBCK_CAP, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8612   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_tx_sector, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8613   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_other_aid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8614   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_tx_antenna, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8615   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8616   return 4;
8617 }
8618
8619 static guint
8620 add_ff_sector_sweep_feedback_from_iss(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8621 {
8622   proto_item *sswf_item = proto_tree_add_item(tree, hf_ieee80211_ff_sswf, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8623   proto_tree *sswf_tree = proto_item_add_subtree(sswf_item, ett_sswf_tree);
8624
8625   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_total_sectors, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8626   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_num_rx_dmg_ants, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8627   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_reserved1, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8628   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_poll_required, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8629   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_reserved2, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8630
8631   return 3;
8632 }
8633
8634 static guint
8635 add_ff_sector_sweep_feedback_to_iss(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8636 {
8637   proto_item *sswf_item = proto_tree_add_item(tree, hf_ieee80211_ff_sswf, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8638   proto_tree *sswf_tree = proto_item_add_subtree(sswf_item, ett_sswf_tree);
8639
8640   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_sector_select, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8641   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_dmg_antenna_select, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8642   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_snr_report, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8643   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_poll_required, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8644   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_reserved2, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8645   return 3;
8646 }
8647
8648 static guint
8649 add_ff_sector_sweep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8650 {
8651   proto_item *ssw_item = proto_tree_add_item(tree, hf_ieee80211_ff_ssw, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8652   proto_tree *ssw_tree = proto_item_add_subtree(ssw_item, ett_ssw_tree);
8653
8654   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_direction, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8655   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_cdown, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8656   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_sector_id, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8657   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_dmg_ant_id, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8658   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_rxss_len, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8659   return 3;
8660 }
8661
8662 static guint
8663 add_ff_dmg_params(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8664 {
8665   proto_item *dmg_params_item = proto_tree_add_item(tree, hf_ieee80211_ff_dmg_params, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8666   proto_tree *dmg_params_tree = proto_item_add_subtree(dmg_params_item, ett_dmg_params_tree);
8667
8668   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_bss, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8669   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_cbap_only, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8670   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_cbap_src, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8671   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_privacy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8672   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_policy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8673   return 1;
8674 }
8675
8676 static guint
8677 add_ff_cc_field(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean dis)
8678 {
8679   proto_item *cc_item = proto_tree_add_item(tree, hf_ieee80211_ff_cc, tvb, offset, 8, ENC_LITTLE_ENDIAN);
8680   proto_tree *cc_tree = proto_item_add_subtree(cc_item, ett_cc_tree);
8681   guint64 cc_field;
8682   if(dis) {
8683     proto_tree_add_item(cc_tree, hf_ieee80211_ff_cc_abft_resp_addr, tvb, offset, 6, ENC_NA);
8684   } else {
8685     cc_field = tvb_get_letoh64(tvb, offset);
8686     /*TODO : Add support of bitmask for FT_(U)INT64 */
8687     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_sp_duration, tvb, offset, 1, (guint32)(cc_field & 0xff));
8688     proto_tree_add_uint64(cc_tree, hf_ieee80211_ff_cc_cluster_id, tvb, offset+1, 6, (guint64)((cc_field & G_GUINT64_CONSTANT(0x00ffffffffffff00)) >> 8));
8689     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_role, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x0300000000000000)) >> 56));
8690     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_max_mem, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x7c00000000000000)) >> 58));
8691   }
8692   return 8;
8693 }
8694
8695
8696 static guint
8697 add_ff_band_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8698 {
8699   proto_tree_add_item(tree, hf_ieee80211_ff_band_id, tvb, offset, 1, ENC_NA);
8700   return 1;
8701 }
8702
8703 static guint
8704 add_ff_subject_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8705 {
8706   proto_tree_add_item(tree, hf_ieee80211_ff_subject_address, tvb, offset, 6, ENC_NA);
8707   return 6;
8708 }
8709
8710 static guint
8711 add_ff_handover_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8712 {
8713   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reason, tvb, offset, 1, ENC_NA);
8714   return 1;
8715 }
8716
8717 static guint
8718 add_ff_handover_remaining_bi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8719 {
8720   proto_tree_add_item(tree, hf_ieee80211_ff_handover_remaining_bi, tvb, offset, 1, ENC_NA);
8721   return 1;
8722 }
8723
8724 static guint
8725 add_ff_handover_result(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8726 {
8727   proto_tree_add_item(tree, hf_ieee80211_ff_handover_result, tvb, offset, 1, ENC_NA);
8728   return 1;
8729 }
8730
8731 static guint
8732 add_ff_handover_reject_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8733 {
8734   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reject_reason, tvb, offset, 1, ENC_NA);
8735   return 1;
8736 }
8737
8738 static guint
8739 add_ff_destination_reds_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8740 {
8741   proto_tree_add_item(tree, hf_ieee80211_ff_destination_reds_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8742   return 2;
8743 }
8744
8745 static guint
8746 add_ff_destination_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8747 {
8748   proto_tree_add_item(tree, hf_ieee80211_ff_destination_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8749   return 2;
8750 }
8751
8752 static guint
8753 add_ff_realy_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8754 {
8755   proto_tree_add_item(tree, hf_ieee80211_ff_realy_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8756   return 2;
8757 }
8758
8759 static guint
8760 add_ff_source_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8761 {
8762   proto_tree_add_item(tree, hf_ieee80211_ff_source_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8763   return 2;
8764 }
8765
8766 static guint
8767 add_ff_timing_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8768 {
8769   proto_tree_add_item(tree, hf_ieee80211_ff_timing_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8770   return 2;
8771 }
8772
8773 static guint
8774 add_ff_sampling_frequency_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8775 {
8776   proto_tree_add_item(tree, hf_ieee80211_ff_sampling_frequency_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8777   return 2;
8778 }
8779
8780 static guint
8781 add_ff_relay_operation_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8782 {
8783   proto_tree_add_item(tree, hf_ieee80211_ff_relay_operation_type, tvb, offset, 1, ENC_NA);
8784   return 1;
8785 }
8786
8787 static guint
8788 add_ff_fst_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8789 {
8790   proto_tree_add_item(tree, hf_ieee80211_ff_fst_action_code, tvb, offset, 1, ENC_NA);
8791   return 1;
8792 }
8793
8794 static guint
8795 add_ff_llt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8796 {
8797   proto_tree_add_item(tree, hf_ieee80211_ff_llt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8798   return 4;
8799 }
8800
8801 static guint
8802 add_ff_fsts_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8803 {
8804   proto_tree_add_item(tree, hf_ieee80211_ff_fsts_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8805   return 4;
8806 }
8807
8808 static guint
8809 add_ff_oct_mmpdu(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8810 {
8811   guint start = offset;
8812   guint len = tvb_get_letohs(tvb, offset);
8813   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8814   offset += 2;
8815   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_ctrl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8816   offset += 2;
8817   proto_tree_add_item(tree, hf_ieee80211_ff_oct_mmpdu, tvb, offset, len, ENC_NA);
8818   offset += len;
8819   return offset - start;
8820 }
8821
8822 static void
8823 add_tag_relay_capabilities(packet_info *pinfo, proto_item *item, gint32 tag_len, proto_tree *tree, tvbuff_t *tvb, gint32 *offset) {
8824
8825   if (tag_len < 2) {
8826     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length, "Tag length must be 2");
8827     return;
8828   }
8829
8830   *offset += 2;
8831
8832   proto_tree_add_item(tree, hf_ieee80211_tag_relay_support, tvb, *offset, 1, ENC_NA);
8833   proto_tree_add_item(tree, hf_ieee80211_tag_relay_use, tvb, *offset, 1, ENC_NA);
8834   proto_tree_add_item(tree, hf_ieee80211_tag_relay_permission, tvb, *offset, 1, ENC_NA);
8835   proto_tree_add_item(tree, hf_ieee80211_tag_AC_power, tvb, *offset, 1, ENC_NA);
8836   proto_tree_add_item(tree, hf_ieee80211_tag_relay_prefer, tvb, *offset, 1, ENC_NA);
8837   proto_tree_add_item(tree, hf_ieee80211_tag_duplex, tvb, *offset, 1, ENC_NA);
8838   proto_tree_add_item(tree, hf_ieee80211_tag_cooperation, tvb, *offset, 1, ENC_NA);
8839   *offset += 2;
8840   return;
8841 }
8842
8843 #if 0
8844 static guint
8845 add_ff_relay_capable_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8846 {
8847   proto_item *rcsi_item = proto_tree_add_item(tree, hf_ieee80211_ff_rcsi, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8848   proto_tree *rcsi_tree = proto_item_add_subtree(rcsi_item, ett_rcsi_tree);
8849   proto_tree_add_item(rcsi_tree, hf_ieee80211_ff_rcsi_aid, tvb, offset, 1, ENC_NA);
8850   offset += 1;
8851   add_tag_relay_capabilities(pinfo, rcsi_item, 2, rcsi_tree, tvb, &offset);
8852   return 3;
8853 }
8854 #endif
8855
8856 static void
8857 dissect_ieee80211_extension(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
8858 {
8859   proto_item *ti;
8860   proto_tree *ext_tree;
8861   proto_tree *fixed_tree;
8862   proto_tree *tagged_tree;
8863
8864   int offset = 0;
8865   int tagged_parameter_tree_len;
8866
8867   ti = proto_tree_add_item(tree, proto_wlan_ext, tvb, offset, -1, ENC_NA);
8868   ext_tree = proto_item_add_subtree(ti, ett_80211_ext);
8869
8870   switch (COMPOSE_FRAME_TYPE(fcf))
8871   {
8872     case EXTENSION_DMG_BEACON:
8873     {
8874       gboolean cc, dis;
8875       guint16 bic_field;
8876       fixed_tree = get_fixed_parameter_tree(ext_tree, tvb, offset, 20);
8877       offset += add_ff_timestamp(fixed_tree, tvb, pinfo, offset);
8878       offset += add_ff_sector_sweep(fixed_tree, tvb, pinfo, offset);
8879       offset += add_ff_beacon_interval(fixed_tree, tvb, pinfo, offset);
8880       bic_field = tvb_get_letohs(tvb, offset);
8881       cc = (bic_field & 0x1);
8882       dis  = (bic_field & 0x2) >> 1;
8883       offset += add_ff_beacon_interval_ctrl(fixed_tree, tvb, pinfo, offset);
8884       offset += add_ff_dmg_params(fixed_tree, tvb, pinfo, offset);
8885       if(cc) {
8886         offset += add_ff_cc_field(fixed_tree, tvb, offset, dis);
8887       }
8888       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
8889
8890       /*
8891        * The tagged params are optional here. See Table 8.33a of the 2012
8892        * version of the standard.
8893        */
8894       if (tagged_parameter_tree_len) {
8895         tagged_tree = get_tagged_parameter_tree(ext_tree, tvb, offset, tagged_parameter_tree_len);
8896         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, EXTENSION_DMG_BEACON, NULL);
8897       }
8898       break;
8899     }
8900   }
8901 }
8902
8903 static guint
8904 add_ff_action_unprotected_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8905 {
8906   guint8 code;
8907   guint  start = offset;
8908
8909   offset += add_ff_category_code(tree, tvb, pinfo, offset);
8910   code    = tvb_get_guint8(tvb, offset);
8911   offset += add_ff_unprotected_dmg_action_code(tree, tvb, pinfo, offset);
8912   switch (code) {
8913     case UNPROTECTED_DMG_ANNOUNCE:
8914       offset += add_ff_timestamp(tree, tvb, pinfo, offset);
8915       offset += add_ff_beacon_interval(tree, tvb, pinfo, offset);
8916       break;
8917     case UNPROTECTED_DMG_BRP:
8918       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
8919       offset += add_ff_BRP_request(tree, tvb, pinfo, offset);
8920       break;
8921   }
8922   return offset - start;
8923 }
8924
8925 /* There is no easy way to skip all these subcarrier indices that must not
8926  * be displayed when showing compressed beamforming feedback matrices
8927  * Table 8-53g IEEE Std 802.11ac-2013 amendment.
8928  *
8929  * The irregular use of case statements in this function is to improve
8930  * readability in what is otherwise a large funtion that does very little.
8931  */
8932 static inline int
8933 vht_compressed_skip_scidx(guint8 nchan_width, guint8 ng, int scidx)
8934 {
8935   switch(nchan_width) {
8936     /* 20 MHz */
8937     case 0:
8938       /* No Grouping */
8939       if (ng == 0)
8940         switch (scidx) {
8941           /* Pilot subcarriers */
8942           case -21: case -7: case 7: case 21:
8943           /* DC subcarrier */
8944           case 0:
8945             scidx++;
8946           default:
8947             break;
8948         }
8949       break;
8950     /* 40 MHz */
8951     case 1:
8952       /* No Grouping */
8953       if (ng == 0)
8954         switch (scidx) {
8955           /* Pilot subcarriers */
8956           case -53: case -25: case -11: case 11: case 25: case 53:
8957             scidx++;
8958             break;
8959           /* DC subcarriers */
8960           case -1: case 0: case 1:
8961             scidx = 2;
8962           default:
8963             break;
8964         }
8965       break;
8966     /* 80 MHz */
8967     case 2:
8968       /* No Grouping */
8969       if (ng == 0)
8970         switch (scidx) {
8971           /* Pilot subcarriers */
8972           case -103: case -75: case -39: case -11: case 11: case 39: case 75: case 103:
8973             scidx++;
8974             break;
8975           /* DC subcarriers, skip -1, 0, 1 */
8976           case -1:
8977             scidx = 2;
8978           default:
8979             break;
8980         }
8981       break;
8982     /* 160 MHz / 80+80 Mhz
8983      * Skip values here assume 160 MHz, as vht_mimo_control does not let us differentiate
8984      * between 160 MHz & 80-80MHz */
8985     case 3:
8986       switch (ng) {
8987         /* No Grouping */
8988         case 0:
8989           /* DC subcarriers, skip -5 to 5*/
8990           if (scidx == -5) {
8991             scidx = 6;
8992             break;
8993           }
8994           switch (scidx) {
8995             /* Pilot subcarriers */
8996             case -231: case -203: case -167: case -139: case -117: case -89: case -53: case -25:
8997             case 25: case 53: case 89: case 117: case 139: case 167: case 203: case 231:
8998               scidx++;
8999               break;
9000             /* Other subcarriers, skip -129 to -127, 127 to 129 */
9001             case -129:
9002               scidx = -126;
9003               break;
9004             case 127:
9005               scidx = 130;
9006               break;
9007             default:
9008               break;
9009           }
9010           break;
9011         /* Grouping of 2 */
9012         case 1:
9013           switch (scidx) {
9014             /* DC subcarriers */
9015             case -128: case -4: case -2: case 0: case 2: case 4: case 128:
9016               scidx++;
9017             default:
9018               break;
9019           }
9020           break;
9021         /* Grouping of 4 */
9022         case 2:
9023           if (scidx == -2 || scidx == 2)
9024             scidx++;
9025           break;
9026       }
9027       break;
9028     default:
9029       break;
9030   }
9031
9032   return scidx;
9033 }
9034
9035 static guint
9036 add_ff_vht_compressed_beamforming_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9037 {
9038   guint32 vht_mimo;
9039   guint8 nc;
9040   guint8 nr;
9041   guint8 chan_width;
9042   guint8 grouping;
9043   gboolean codebook_info;
9044   gboolean feedback_type;
9045   proto_item *vht_beam_item;
9046   proto_tree *vht_beam_tree, *subtree;
9047   int i, matrix_size, len, pos, ns, scidx = 0;
9048   guint8 phi, psi, carry;
9049   /* Table 8-53d Order of angles in the Compressed Beamforming Feedback
9050    * Matrix subfield, IEEE Std 802.11ac-2013 amendment */
9051   static const guint8 na_arr[8][8] = { {  0,  0,  0,  0,  0,  0,  0,  0 },
9052                                        {  2,  2,  0,  0,  0,  0,  0,  0 },
9053                                        {  4,  6,  6,  0,  0,  0,  0,  0 },
9054                                        {  6, 10, 12, 12,  0,  0,  0,  0 },
9055                                        {  8, 14, 18, 20, 20,  0,  0,  0 },
9056                                        { 10, 18, 24, 28, 30, 30,  0,  0 },
9057                                        { 12, 22, 30, 36, 40, 42, 42,  0 },
9058                                        { 14, 26, 36, 44, 50, 54, 56, 56 }
9059                                      };
9060   /* Table 8-53g Subcarriers for which a Compressed Beamforming Feedback Matrix
9061    * subfield is sent back. IEEE Std 802.11ac-2013 amendment */
9062   static const int ns_arr[4][3] = { {  52,  30,  16 },
9063                                     { 108,  58,  30 },
9064                                     { 234, 122,  62 },
9065                                     { 468, 244, 124 }
9066                                   };
9067
9068   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_vht_mimo_cntrl,
9069                         ett_ff_vhtmimo_cntrl, hf_ieee80211_ff_vht_mimo_cntrl_fields, ENC_LITTLE_ENDIAN);
9070
9071   /* Extract values for beamforming use */
9072   vht_mimo = tvb_get_letoh24(tvb, offset);
9073   offset += 3;
9074
9075   /* Extract values for beamforming use */
9076   nc = (vht_mimo & 0x7) + 1;
9077   nr = ((vht_mimo & 0x38) >> 3) + 1;
9078   chan_width = (vht_mimo & 0xC0) >> 6;
9079   grouping = ((vht_mimo & 0x300) >> 8);
9080   codebook_info = (vht_mimo & 0x400) >> 10;
9081   feedback_type = (vht_mimo & 0x800) >> 11;
9082
9083   vht_beam_item = proto_tree_add_item(tree, hf_ieee80211_vht_compressed_beamforming_report, tvb,
9084                                   offset, -1, ENC_NA);
9085   vht_beam_tree = proto_item_add_subtree(vht_beam_item, ett_ff_vhtmimo_beamforming_report);
9086
9087   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, nc,
9088                         ett_ff_vhtmimo_beamforming_report_snr, NULL, "Average Signal to Noise Ratio");
9089
9090   for (i = 1; i <= nc; i++)
9091   {
9092     guint8 snr;
9093
9094     snr = tvb_get_guint8(tvb, offset);
9095     proto_tree_add_uint_format(subtree, hf_ieee80211_vht_compressed_beamforming_report_snr, tvb, offset, 1,
9096                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
9097     offset += 1;
9098   }
9099
9100   /* Table 8-53c Subfields of the VHT MIMO Control field (802.11ac-2013)
9101    * reserves value 3 of the Grouping subfield. */
9102   if (grouping == 3) {
9103     expert_add_info_format(pinfo, vht_beam_item, &ei_ieee80211_inv_val,
9104                            "Grouping subfield value 3 is reserved");
9105     return offset;
9106   }
9107
9108   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, -1,
9109                         ett_ff_vhtmimo_beamforming_report_feedback_matrices, NULL, "Beamforming Feedback Matrics");
9110   if (feedback_type) {
9111     if (codebook_info) {
9112       psi = 7; phi = 9;
9113     } else {
9114       psi = 5; phi = 7;
9115     }
9116   } else {
9117     if (codebook_info) {
9118       psi = 4; phi = 6;
9119     } else {
9120       psi = 2; phi = 4;
9121     }
9122   }
9123
9124   ns = ns_arr[chan_width][grouping];
9125   switch(chan_width) {
9126     case 0:
9127       scidx = -28;
9128       break;
9129     case 1:
9130       scidx = -58;
9131       break;
9132     case 2:
9133       scidx = -122;
9134       break;
9135     case 3:
9136       /* This is -122 for 80+80MHz Channel Width but vht_mimo_control does not allow us
9137        * to differentiate between 160MHz and 80+80Mhz */
9138       scidx = -250;
9139       break;
9140   }
9141
9142   matrix_size = na_arr[nr - 1][nc -1] * (psi + phi)/2;
9143   pos = 0;
9144   for (i = 0; i < ns; i++) {
9145     if (pos % 8)
9146       carry = 1;
9147     else
9148       carry = 0;
9149     len = roundup2((pos + matrix_size), 8)/8 - roundup2(pos, 8)/8;
9150     scidx = vht_compressed_skip_scidx(chan_width, grouping, scidx);
9151
9152     /* TODO : For certain values from na_arr, there is always going be a carry over or overflow from the previous or
9153        into the next octet. The largest of possible unaligned values can be 41 bytes long, and masking and shifting
9154        whole buffers to show correct values with padding and overflow bits is hence skipped, we only mark the bytes
9155        of interest instead */
9156     proto_tree_add_none_format(subtree, hf_ieee80211_vht_compressed_beamforming_feedback_matrix, tvb,
9157                                     offset - carry, len + carry, "Compressed Beamforming Feedback Matrix for subcarrier %d", scidx++);
9158     offset += len;
9159     pos += matrix_size;
9160   }
9161
9162   return offset;
9163 }
9164
9165 static guint
9166 add_ff_action_vht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9167 {
9168   guint start = offset;
9169   guint8 vht_action, field_val;
9170   guint64 msa_value;
9171   guint64 upa_value, temp_val;
9172   int m;
9173   proto_item *ti;
9174   proto_tree *ti_tree;
9175   proto_item *msa, *upa;
9176   proto_tree *msa_tree, *upa_tree;
9177
9178   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9179
9180   vht_action = tvb_get_guint8(tvb, offset);
9181   offset += add_ff_vht_action(tree, tvb, pinfo, offset);
9182
9183   switch(vht_action){
9184     case VHT_ACT_VHT_COMPRESSED_BEAMFORMING:{
9185       offset = add_ff_vht_compressed_beamforming_report(tree, tvb, pinfo, offset);
9186       offset += tvb_reported_length_remaining(tvb, offset);
9187     }
9188     break;
9189     case VHT_ACT_GROUP_ID_MANAGEMENT:{
9190       ti = proto_tree_add_item(tree, hf_ieee80211_vht_group_id_management, tvb,
9191                           offset, -1, ENC_NA);
9192       ti_tree = proto_item_add_subtree(ti, ett_vht_grpidmgmt);
9193
9194       msa_value = tvb_get_letoh64(tvb, offset);
9195       msa = proto_tree_add_item(ti_tree, hf_ieee80211_vht_membership_status_array, tvb,
9196                                 offset, 8, ENC_NA);
9197       msa_tree = proto_item_add_subtree(msa, ett_vht_msa);
9198       for (m = 0; m < 64; m++) {
9199           if (msa_value & (G_GINT64_CONSTANT(1) << m))
9200               proto_tree_add_uint_format(msa_tree, hf_ieee80211_vht_membership_status_field,
9201                                                tvb, offset + (m/8), 1, 1, "Membership Status in Group ID %d: 1", m);
9202       }
9203       offset += 8;
9204
9205       upa = proto_tree_add_item(ti_tree, hf_ieee80211_vht_user_position_array, tvb,
9206                                       offset, 16, ENC_NA);
9207       upa_tree = proto_item_add_subtree(upa, ett_vht_upa);
9208
9209       upa_value = tvb_get_letoh64(tvb, offset);
9210       for (m = 0; m < 32; m++) {
9211           if (msa_value & (G_GINT64_CONSTANT(1) << m)) {
9212               temp_val = ((guint64) pow(4,m))*3;
9213               field_val = (guint8) ((upa_value & temp_val) >> m*2);
9214               proto_tree_add_uint_format(upa_tree, hf_ieee80211_vht_user_position_field,
9215                                                tvb, offset + (m/4), 1, field_val, "User Position in Group ID %d: %u", m, field_val);
9216               }
9217       }
9218       upa_value = tvb_get_letoh64(tvb, offset+8);
9219       for (m = 0; m < 32; m++) {
9220           if (msa_value & (G_GINT64_CONSTANT(1) << (32+m))) {
9221               temp_val = ((guint64) pow(4,m))*3;
9222               field_val = (guint8) ((upa_value & temp_val) >> m*2);
9223               proto_tree_add_uint_format(upa_tree, hf_ieee80211_vht_user_position_field,
9224                                                tvb, (offset + 8) + (m/4), 1, field_val, "User Position in Group ID %d: %u", m, field_val);
9225               }
9226       }
9227       offset += tvb_reported_length_remaining(tvb, offset);
9228     }
9229     break;
9230     case VHT_ACT_OPERATION_MODE_NOTIFICATION:{
9231       ti = proto_tree_add_item(tree, hf_ieee80211_vht_operation_mode_notification, tvb,
9232                           offset, -1, ENC_NA);
9233       expert_add_info(pinfo, ti, &ei_ieee80211_vht_action);
9234       offset += tvb_reported_length_remaining(tvb, offset);
9235     }
9236     break;
9237     default:
9238     break;
9239   }
9240
9241
9242   return offset - start;
9243 }
9244
9245 static guint
9246 add_ff_action_fst(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9247 {
9248   guint8 code;
9249   guint  start = offset;
9250
9251   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9252   code    = tvb_get_guint8(tvb, offset);
9253   offset += add_ff_fst_action_code(tree, tvb, pinfo, offset);
9254   switch (code) {
9255     case FST_SETUP_REQUEST:
9256       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9257       offset += add_ff_llt(tree, tvb, pinfo, offset);
9258       break;
9259     case FST_SETUP_RESPONSE:
9260       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9261       offset += add_ff_status_code(tree, tvb, pinfo, offset);
9262       break;
9263     case FST_TEAR_DOWN:
9264       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
9265       break;
9266     case FST_ACK_REQUEST:
9267       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9268       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
9269       break;
9270     case FST_ACK_RESPONSE:
9271       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9272       offset += add_ff_fsts_id(tree, tvb, pinfo, offset);
9273       break;
9274     case FST_ON_CHANNEL_TUNNEL_REQUEST:
9275       offset += add_ff_oct_mmpdu(tree, tvb, pinfo, offset);
9276       break;
9277   }
9278   return offset - start;
9279 }
9280
9281 static guint
9282 add_ff_action_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9283 {
9284   guint8 code;
9285   guint  start = offset;
9286   int left_offset;
9287
9288   offset += add_ff_category_code(tree, tvb, pinfo, offset);
9289   code    = tvb_get_guint8(tvb, offset);
9290   offset += add_ff_dmg_action_code(tree, tvb, pinfo, offset);
9291   switch (code) {
9292     case DMG_ACTION_PWR_SAVE_CONFIG_REQ:
9293       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9294       offset += add_ff_dmg_pwr_mgmt(tree, tvb, pinfo, offset);
9295       break;
9296     case DMG_ACTION_PWR_SAVE_CONFIG_RES:
9297       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9298       offset += add_ff_status_code(tree, tvb, pinfo, offset);
9299       break;
9300     case DMG_ACTION_INFO_REQ:
9301       offset += add_ff_subject_address(tree, tvb, pinfo, offset);
9302       break;
9303     case DMG_ACTION_INFO_RES:
9304       offset += add_ff_subject_address(tree, tvb, pinfo, offset);
9305       break;
9306     case DMG_ACTION_HANDOVER_REQ:
9307       offset += add_ff_handover_reason(tree, tvb, pinfo, offset);
9308       offset += add_ff_handover_remaining_bi(tree, tvb, pinfo, offset);
9309       break;
9310     case DMG_ACTION_HANDOVER_RES:
9311       offset += add_ff_handover_result(tree, tvb, pinfo, offset);
9312       offset += add_ff_handover_reject_reason(tree, tvb, pinfo, offset);
9313       break;
9314     case DMG_ACTION_DTP_REQ:
9315       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9316       break;
9317     case DMG_ACTION_DTP_RES:
9318       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9319       break;
9320     case DMG_ACTION_RELAY_SEARCH_REQ:
9321       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9322       offset += add_ff_destination_reds_aid(tree, tvb, pinfo, offset);
9323       break;
9324     case DMG_ACTION_RELAY_SEARCH_RES:
9325       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9326       offset += add_ff_status_code(tree, tvb, pinfo, offset);
9327       break;
9328     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ:
9329       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9330       break;
9331     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES:
9332       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9333       left_offset =
9334           tvb_reported_length_remaining(tvb, offset);
9335       while(left_offset > 0) {
9336         proto_tree_add_item(tree, hf_ieee80211_ff_peer_sta_aid, tvb, offset, 1, ENC_NA);
9337         proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset+1, 1, ENC_NA);
9338         proto_tree_add_item(tree, hf_ieee80211_ff_internal_angle, tvb, offset+2, 1, ENC_NA);
9339         proto_tree_add_item(tree, hf_ieee80211_ff_recommend, tvb, offset+2, 1, ENC_NA);
9340         /* another reserved byte */
9341         offset += 4;
9342         left_offset -= 4;
9343       }
9344       break;
9345     case DMG_ACTION_RLS_REQ:
9346       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9347       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
9348       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
9349       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
9350       break;
9351     case DMG_ACTION_RLS_RES:
9352       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9353       break;
9354     case DMG_ACTION_RLS_ANNOUNCE:
9355       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9356       offset += add_ff_status_code(tree, tvb, pinfo, offset);
9357       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
9358       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
9359       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
9360       break;
9361     case DMG_ACTION_RLS_TEARDOWN:
9362       offset += add_ff_destination_aid(tree, tvb, pinfo, offset);
9363       offset += add_ff_realy_aid(tree, tvb, pinfo, offset);
9364       offset += add_ff_source_aid(tree, tvb, pinfo, offset);
9365       break;
9366     case DMG_ACTION_RELAY_ACK_REQ:
9367     case DMG_ACTION_RELAY_ACK_RES:
9368       break;
9369     case DMG_ACTION_TPA_REQ:
9370       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9371       offset += add_ff_timing_offset(tree, tvb, pinfo, offset);
9372       offset += add_ff_sampling_frequency_offset(tree, tvb, pinfo, offset);
9373       break;
9374     case DMG_ACTION_TPA_RES:
9375       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9376       break;
9377     case DMG_ACTION_TPA_REP:
9378       offset += add_ff_status_code(tree, tvb, pinfo, offset);
9379       break;
9380     case DMG_ACTION_ROC_REQ:
9381       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9382       offset += add_ff_relay_operation_type(tree, tvb, pinfo, offset);
9383       break;
9384     case DMG_ACTION_ROC_RES:
9385       offset += add_ff_dialog_token(tree, tvb, pinfo, offset);
9386       offset += add_ff_status_code(tree, tvb, pinfo, offset);
9387       break;
9388   }
9389   return offset - start;
9390 }
9391
9392 static guint
9393 add_ff_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9394 {
9395   switch (tvb_get_guint8(tvb, offset) & 0x7f) {
9396   case CAT_SPECTRUM_MGMT: /* 0 */
9397     return add_ff_action_spectrum_mgmt(tree, tvb, pinfo, offset);
9398   case CAT_QOS: /* 1 */
9399     return add_ff_action_qos(tree, tvb, pinfo, offset);
9400   case CAT_DLS: /* 2 */
9401     return add_ff_action_dls(tree, tvb, pinfo, offset);
9402   case CAT_BLOCK_ACK: /* 3 */
9403     return add_ff_action_block_ack(tree, tvb, pinfo, offset);
9404   case CAT_PUBLIC: /* 4 */
9405     return add_ff_action_public(tree, tvb, pinfo, offset);
9406   case CAT_RADIO_MEASUREMENT: /* 5 */
9407     return add_ff_action_radio_measurement(tree, tvb, pinfo, offset);
9408   case CAT_FAST_BSS_TRANSITION: /* 6 */
9409     return add_ff_action_fast_bss_transition(tree, tvb, pinfo, offset);
9410   case CAT_HT: /* 7 */
9411     return add_ff_action_ht(tree, tvb, pinfo, offset);
9412   case CAT_SA_QUERY: /* 8 */
9413     return add_ff_action_sa_query(tree, tvb, pinfo, offset);
9414   case CAT_PUBLIC_PROTECTED: /* 9 */
9415     return add_ff_action_protected_public(tree, tvb, pinfo, offset);
9416   case CAT_WNM: /* 10 */
9417     return add_ff_action_wnm(tree, tvb, pinfo, offset);
9418   case CAT_UNPROTECTED_WNM: /* 11 */
9419     return add_ff_action_unprotected_wnm(tree, tvb, pinfo, offset);
9420   case CAT_TDLS: /* 12 */
9421     return add_ff_action_tdls(tree, tvb, pinfo, offset);
9422   case CAT_MESH: /* 13 */
9423     return add_ff_action_mesh(tree, tvb, pinfo, offset);
9424   case CAT_MULTIHOP: /* 14 */
9425     return add_ff_action_multihop(tree, tvb, pinfo, offset);
9426   case CAT_SELF_PROTECTED: /* 15 */
9427     return add_ff_action_self_protected(tree, tvb, pinfo, offset);
9428   case CAT_DMG: /* 16 */
9429     return add_ff_action_dmg(tree, tvb, pinfo, offset);
9430   case CAT_MGMT_NOTIFICATION:  /* Management notification frame - 17 */
9431     return add_ff_action_mgmt_notification(tree, tvb, pinfo, offset);
9432   case CAT_FAST_SESSION_TRANSFER: /* 18 */
9433     return add_ff_action_fst(tree, tvb, pinfo, offset);
9434 /* case CAT_ROBUST_AV_STREAMING:  19 */
9435 /*   return add_ff_action_robust_av_streaming(tree, tvb, pinfo, offset); */
9436   case CAT_UNPROTECTED_DMG: /* 20 */
9437     return add_ff_action_unprotected_dmg(tree, tvb, pinfo, offset);
9438   case CAT_VHT: /* 21 */
9439     return add_ff_action_vht(tree, tvb, pinfo, offset);
9440 /*  case CAT_VENDOR_SPECIFIC_PROTECTED:   Vendor Specific Protected Category - 126 */
9441 /*    return add_ff_action_vendor_specific_protected(tree, tvb, pinfo, offset);*/
9442   case CAT_VENDOR_SPECIFIC:  /* Vendor Specific Protected Category - 127 */
9443     return add_ff_action_vendor_specific(tree, tvb, pinfo, offset);
9444   default:
9445     add_ff_category_code(tree, tvb, pinfo, offset);
9446     return 1;
9447   }
9448 }
9449
9450 static const value_string ieee80211_rsn_cipher_vals[] = {
9451   {0, "NONE"},
9452   {1, "WEP (40-bit)"},
9453   {2, "TKIP"},
9454   {3, "AES (OCB)"},
9455   {4, "AES (CCM)"},
9456   {5, "WEP (104-bit)"},
9457   {6, "BIP"},
9458   {7, "Group addressed traffic not allowed"},
9459   {8, "GCMP"},
9460   {0, NULL}
9461 };
9462
9463 static const value_string ieee80211_rsn_keymgmt_vals[] = {
9464   {0, "NONE"},
9465   {1, "WPA"},
9466   {2, "PSK"},
9467   {3, "FT over IEEE 802.1X"},
9468   {4, "FT using PSK"},
9469   {5, "WPA (SHA256)"},
9470   {6, "PSK (SHA256)"},
9471   {7, "TDLS / TPK Handshake"},
9472   {0, NULL}
9473 };
9474
9475 static void
9476 oui_base_custom(gchar *result, guint32 oui)
9477 {
9478   guint8       p_oui[3];
9479   const gchar *manuf_name;
9480
9481   p_oui[0] = oui >> 16 & 0xFF;
9482   p_oui[1] = oui >> 8 & 0xFF;
9483   p_oui[2] = oui & 0xFF;
9484
9485   /* Attempt an OUI lookup. */
9486   manuf_name = get_manuf_name_if_known(p_oui);
9487   if (manuf_name == NULL) {
9488     /* Could not find an OUI. */
9489     g_snprintf(result, ITEM_LABEL_LENGTH, "%.2x-%.2x-%.2x", p_oui[0], p_oui[1], p_oui[2]);
9490   }
9491   else {
9492    /* Found an address string. */
9493     g_snprintf(result, ITEM_LABEL_LENGTH, "%.2x-%.2x-%.2x (%s)", p_oui[0], p_oui[1], p_oui[2], manuf_name);
9494   }
9495 }
9496
9497 static void
9498 rsn_gcs_base_custom(gchar *result, guint32 gcs)
9499 {
9500   gchar oui_result[SHORT_STR];
9501   gchar *tmp_str;
9502
9503   oui_result[0] = '\0';
9504   oui_base_custom(oui_result, gcs >> 8);
9505   tmp_str = val_to_str_wmem(NULL, gcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
9506   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9507   wmem_free(NULL, tmp_str);
9508 }
9509
9510 static void
9511 rsn_pcs_base_custom(gchar *result, guint32 pcs)
9512 {
9513   gchar oui_result[SHORT_STR];
9514   gchar *tmp_str;
9515
9516   oui_result[0] = '\0';
9517   oui_base_custom(oui_result, pcs >> 8);
9518   tmp_str = val_to_str_wmem(NULL, pcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
9519   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9520   wmem_free(NULL, tmp_str);
9521
9522 }
9523 static void
9524 rsn_akms_base_custom(gchar *result, guint32 akms)
9525 {
9526   gchar oui_result[SHORT_STR];
9527   gchar *tmp_str;
9528
9529   oui_result[0] = '\0';
9530   oui_base_custom(oui_result, akms >> 8);
9531   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_rsn_keymgmt_vals, "Unknown %d");
9532   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9533   wmem_free(NULL, tmp_str);
9534 }
9535
9536 static gchar *
9537 rsn_pcs_return(guint32 pcs)
9538 {
9539   gchar *result;
9540
9541   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
9542   result[0] = '\0';
9543   rsn_pcs_base_custom(result, pcs);
9544
9545   return result;
9546 }
9547
9548 static gchar *
9549 rsn_akms_return(guint32 akms)
9550 {
9551   gchar *result;
9552
9553   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
9554   result[0] = '\0';
9555   rsn_akms_base_custom(result, akms);
9556
9557   return result;
9558 }
9559
9560 static void
9561 rsn_gmcs_base_custom(gchar *result, guint32 gmcs)
9562 {
9563   gchar oui_result[SHORT_STR];
9564   gchar *tmp_str;
9565
9566   oui_result[0] = '\0';
9567   oui_base_custom(oui_result, gmcs >> 8);
9568   tmp_str = val_to_str_wmem(NULL, gmcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
9569   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9570   wmem_free(NULL, tmp_str);
9571 }
9572
9573 static void
9574 rsni_base_custom(gchar *result, guint32 rsni)
9575 {
9576   double temp_double;
9577
9578   temp_double = (double)rsni;
9579   g_snprintf(result, ITEM_LABEL_LENGTH, "%f dB", (temp_double / 2));
9580 }
9581
9582 static void
9583 vht_tpe_custom(gchar *result, guint8 txpwr)
9584 {
9585   gint8 txpwr_db;
9586
9587   txpwr_db = (gint8)(txpwr);
9588   g_snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm", (txpwr_db/2.0));
9589 }
9590
9591 static void
9592 channel_number_custom(gchar *result, guint8 channel_number)
9593 {
9594   switch(channel_number){
9595     case 0:
9596       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels in the specified Operating Class)", channel_number);
9597     break;
9598     case 255:
9599       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels listed in the AP Channel Report)", channel_number);
9600     break;
9601     default :
9602       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on that Channel Number)", channel_number);
9603     break;
9604   }
9605 }
9606
9607 /* WPA / WME */
9608 static const value_string ieee802111_wfa_ie_type_vals[] = {
9609   { 1, "WPA Information Element" },
9610   { 2, "WMM/WME" },
9611   { 4, "WPS" },
9612   { 0, NULL }
9613 };
9614
9615 static const value_string ieee80211_wfa_ie_wpa_cipher_vals[] = {
9616   { 0, "NONE" },
9617   { 1, "WEP (40-bit)" },
9618   { 2, "TKIP" },
9619   { 3, "AES (OCB)" },
9620   { 4, "AES (CCM)" },
9621   { 5, "WEP (104-bit)" },
9622   { 6, "BIP" },
9623   { 7, "Group addressed traffic not allowed" },
9624   { 0, NULL }
9625 };
9626
9627 static const value_string ieee80211_wfa_ie_wpa_keymgmt_vals[] = {
9628   { 0, "NONE" },
9629   { 1, "WPA" },
9630   { 2, "PSK" },
9631   { 3, "FT over IEEE 802.1X" },
9632   { 4, "FT using PSK" },
9633   { 5, "WPA (SHA256)" },
9634   { 6, "PSK (SHA256)" },
9635   { 7, "TDLS / TPK Handshake" },
9636   { 0, NULL }
9637 };
9638
9639 static const value_string ieee80211_wfa_ie_wme_acs_vals[] = {
9640   { 0, "Best Effort" },
9641   { 1, "Background" },
9642   { 2, "Video" },
9643   { 3, "Voice" },
9644   { 0, NULL }
9645 };
9646
9647 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals[] = {
9648   { 0, "Uplink" },
9649   { 1, "Downlink" },
9650   { 2, "Direct link" },
9651   { 3, "Bidirectional link" },
9652   { 0, NULL }
9653 };
9654
9655 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals[] = {
9656   { 0, "Legacy" },
9657   { 1, "U-APSD" },
9658   { 0, NULL }
9659 };
9660
9661 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals[] = {
9662   { 0, "Best Effort" },
9663   { 1, "Background" },
9664   { 2, "Spare" },
9665   { 3, "Excellent Effort" },
9666   { 4, "Controlled Load" },
9667   { 5, "Video" },
9668   { 6, "Voice" },
9669   { 7, "Network Control" },
9670   { 0, NULL }
9671 };
9672
9673 static const value_string ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals[] = {
9674   { 0, "WMM AP may deliver all buffered frames (MSDUs and MMPDUs)" },
9675   { 1, "WMM AP may deliver a maximum of 2 buffered frames (MSDUs and MMPDUs) per USP" },
9676   { 2, "WMM AP may deliver a maximum of 4 buffered frames (MSDUs and MMPDUs) per USP" },
9677   { 3, "WMM AP may deliver a maximum of 6 buffered frames (MSDUs and MMPDUs) per USP" },
9678   { 0, NULL}
9679 };
9680 static const true_false_string ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs = {
9681   "WMM delivery and trigger enabled",
9682   "non-WMM PS"
9683 };
9684
9685 static void
9686 wpa_mcs_base_custom(gchar *result, guint32 mcs)
9687 {
9688   gchar oui_result[SHORT_STR];
9689   gchar *tmp_str;
9690
9691   oui_result[0] = '\0';
9692   oui_base_custom(oui_result, mcs >> 8);
9693   tmp_str = val_to_str_wmem(NULL, mcs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
9694   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9695   wmem_free(NULL, tmp_str);
9696 }
9697
9698 static void
9699 wpa_ucs_base_custom(gchar *result, guint32 ucs)
9700 {
9701   gchar oui_result[SHORT_STR];
9702   gchar *tmp_str;
9703
9704   oui_result[0] = '\0';
9705   oui_base_custom(oui_result, ucs >> 8);
9706   tmp_str = val_to_str_wmem(NULL, ucs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
9707   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9708   wmem_free(NULL, tmp_str);
9709 }
9710 static void
9711 wpa_akms_base_custom(gchar *result, guint32 akms)
9712 {
9713   gchar oui_result[SHORT_STR];
9714   gchar *tmp_str;
9715
9716   oui_result[0] = '\0';
9717   oui_base_custom(oui_result, akms >> 8);
9718   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_wfa_ie_wpa_keymgmt_vals, "Unknown %d");
9719   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9720   wmem_free(NULL, tmp_str);
9721 }
9722
9723 static gchar *
9724 wpa_ucs_return(guint32 ucs)
9725 {
9726   gchar *result;
9727
9728   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
9729   result[0] = '\0';
9730   wpa_ucs_base_custom(result, ucs);
9731
9732   return result;
9733 }
9734
9735 static gchar *
9736 wpa_akms_return(guint32 akms)
9737 {
9738   gchar *result;
9739
9740   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
9741   result[0] = '\0';
9742   wpa_akms_base_custom(result, akms);
9743
9744   return result;
9745 }
9746
9747 /* For each Field */
9748 static const value_string ieee80211_wapi_suite_type[] = {
9749   {0, "Reserved"},
9750   {1, "WAI Certificate Authentication and Key Management"},
9751   {2, "WAI Preshared Key Authentication and Key Management"},
9752   {0, NULL},
9753 };
9754 /* For Summary Tag Information */
9755 static const value_string ieee80211_wapi_suite_type_short[] = {
9756   {0, "Reserved"},
9757   {1, "WAI-CERT"},
9758   {2, "WAI-PSK"},
9759   {0, NULL},
9760 };
9761
9762 static const value_string ieee80211_wapi_cipher_type[] = {
9763   {0, "Reserved"},
9764   {1, "WPI-SMS4"},
9765   {0, NULL},
9766 };
9767
9768 static const value_string ieee802111_wfa_ie_wme_type[] = {
9769   { 0, "Information Element" },
9770   { 1, "Parameter Element" },
9771   { 2, "TSPEC Element" },
9772   { 0, NULL}
9773 };
9774
9775 static const value_string ft_subelem_id_vals[] = {
9776   {0, "Reserved"},
9777   {1, "PMK-R1 key holder identifier (R1KH-ID)"},
9778   {2, "GTK subelement"},
9779   {3, "PMK-R0 key holder identifier (R0KH-ID)"},
9780   {4, "IGTK"},
9781   {0, NULL}
9782 };
9783
9784 static int
9785 dissect_wme_qos_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
9786 {
9787   proto_tree *wme_qos_info_tree;
9788   proto_item *wme_qos_info_item;
9789
9790   wme_qos_info_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_qos_info, tvb, offset, 1, ENC_NA);
9791   wme_qos_info_tree = proto_item_add_subtree(wme_qos_info_item, ett_wme_qos_info);
9792
9793   switch (ftype) {
9794     case MGT_ASSOC_REQ:
9795     case MGT_PROBE_REQ:
9796     case MGT_REASSOC_REQ:
9797     {
9798       /* To AP so decode as per WMM standard Figure 7 QoS Info field when sent from WMM STA*/
9799       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length, tvb, offset, 1, ENC_NA);
9800       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be, tvb, offset, 1, ENC_NA);
9801       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk, tvb, offset, 1, ENC_NA);
9802       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi, tvb, offset, 1, ENC_NA);
9803       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo, tvb, offset, 1, ENC_NA);
9804       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved, tvb, offset, 1, ENC_NA);
9805       break;
9806     }
9807     case MGT_BEACON:
9808     case MGT_PROBE_RESP:
9809     case MGT_ASSOC_RESP:
9810     case MGT_REASSOC_RESP:
9811     {
9812       /* From AP so decode as per WMM standard Figure 6 QoS Info field when sent from WMM AP */
9813       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd, tvb, offset, 1, ENC_NA);
9814       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count, tvb, offset, 1, ENC_NA);
9815       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved, tvb, offset, 1, ENC_NA);
9816       break;
9817     }
9818     default:
9819         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);
9820       break;
9821     }
9822
9823   offset += 1;
9824   return offset;
9825 }
9826
9827 static int
9828 dissect_vendor_ie_wpawme(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 tag_len, int ftype)
9829 {
9830   guint8 type;
9831
9832   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_type, tvb, offset, 1, ENC_NA);
9833   type = tvb_get_guint8(tvb, offset);
9834   proto_item_append_text(tree, ": %s", val_to_str(type, ieee802111_wfa_ie_type_vals, "Unknown %d"));
9835   offset += 1;
9836
9837   switch (type) {
9838     case 1:   /* Wi-Fi Protected Access (WPA) */
9839     {
9840       proto_item *wpa_mcs_item, *wpa_ucs_item, *wpa_akms_item;
9841       proto_item *wpa_sub_ucs_item, *wpa_sub_akms_item;
9842       proto_tree *wpa_mcs_tree, *wpa_ucs_tree, *wpa_akms_tree;
9843       proto_tree *wpa_sub_ucs_tree, *wpa_sub_akms_tree;
9844       guint16 ucs_count, akms_count;
9845       guint ii;
9846
9847       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9848       offset += 2;
9849
9850       /* Multicast Cipher Suite */
9851       wpa_mcs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_mcs, tvb, offset, 4, ENC_BIG_ENDIAN);
9852       wpa_mcs_tree = proto_item_add_subtree(wpa_mcs_item, ett_wpa_mcs_tree);
9853       proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
9854
9855       /* Check if OUI is 00:50:F2 (WFA) */
9856       if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
9857       {
9858         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_wfa_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
9859       } else {
9860         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
9861       }
9862       offset += 4;
9863
9864       /* Unicast Cipher Suites */
9865       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9866       ucs_count = tvb_get_letohs(tvb, offset);
9867       offset += 2;
9868
9869       wpa_ucs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_list, tvb, offset, ucs_count * 4, ENC_NA);
9870       wpa_ucs_tree = proto_item_add_subtree(wpa_ucs_item, ett_wpa_ucs_tree);
9871       for (ii = 0; ii < ucs_count; ii++)
9872       {
9873         wpa_sub_ucs_item = proto_tree_add_item(wpa_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs, tvb, offset, 4, ENC_BIG_ENDIAN);
9874         wpa_sub_ucs_tree = proto_item_add_subtree(wpa_sub_ucs_item, ett_wpa_sub_ucs_tree);
9875         proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
9876
9877         /* Check if OUI is 00:50:F2 (WFA) */
9878         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
9879         {
9880           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
9881           proto_item_append_text(wpa_ucs_item, " %s", wpa_ucs_return(tvb_get_ntohl(tvb, offset)));
9882         } else {
9883           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
9884         }
9885         offset += 4;
9886       }
9887
9888       /* Authenticated Key Management Suites */
9889       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9890       akms_count = tvb_get_letohs(tvb, offset);
9891       offset += 2;
9892
9893       wpa_akms_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_list, tvb, offset, akms_count * 4, ENC_NA);
9894       wpa_akms_tree = proto_item_add_subtree(wpa_akms_item, ett_wpa_akms_tree);
9895       for (ii = 0; ii < akms_count; ii++)
9896       {
9897         wpa_sub_akms_item = proto_tree_add_item(wpa_akms_tree, hf_ieee80211_wfa_ie_wpa_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
9898         wpa_sub_akms_tree = proto_item_add_subtree(wpa_sub_akms_item, ett_wpa_sub_akms_tree);
9899         proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
9900
9901         /* Check if OUI is 00:50:F2 (WFA) */
9902         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
9903         {
9904           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
9905           proto_item_append_text(wpa_akms_item, " %s", wpa_akms_return(tvb_get_ntohl(tvb, offset)));
9906         } else {
9907           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
9908         }
9909         offset += 4;
9910       }
9911       break;
9912     }
9913     case 2:   /* Wireless Multimedia Enhancements (WME) */
9914     {
9915       guint8 subtype;
9916
9917       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_subtype, tvb, offset, 1, ENC_NA);
9918       subtype = tvb_get_guint8(tvb, offset);
9919       proto_item_append_text(tree, ": %s", val_to_str(subtype, ieee802111_wfa_ie_wme_type, "Unknown %d"));
9920       offset += 1;
9921       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_version, tvb, offset, 1, ENC_NA);
9922       offset += 1;
9923       switch (subtype) {
9924         case 0: /* WME Information Element */
9925         {
9926           /* WME QoS Info Field */
9927           offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
9928           break;
9929         }
9930         case 1: /* WME Parameter Element */
9931         {
9932           int i;
9933           /* WME QoS Info Field */
9934           offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
9935           proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_reserved, tvb, offset, 1, ENC_NA);
9936           offset += 1;
9937           /* AC Parameters */
9938           for (i = 0; i < 4; i++)
9939           {
9940             proto_item *ac_item, *aci_aifsn_item, *ecw_item;
9941             proto_tree *ac_tree, *aci_aifsn_tree, *ecw_tree;
9942             guint8 aci_aifsn, ecw, ecwmin, ecwmax;
9943             guint16 cwmin, cwmax;
9944
9945             ac_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_ac_parameters, tvb, offset, 4, ENC_NA);
9946             ac_tree = proto_item_add_subtree(ac_item, ett_wme_ac);
9947
9948             /* ACI/AIFSN Field */
9949             aci_aifsn_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_aci_aifsn, tvb, offset, 1, ENC_NA);
9950             aci_aifsn_tree = proto_item_add_subtree(aci_aifsn_item, ett_wme_aci_aifsn);
9951             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_aci, tvb, offset, 1, ENC_NA);
9952             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_acm, tvb, offset, 1, ENC_NA);
9953             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_aifsn, tvb, offset, 1, ENC_NA);
9954             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_reserved, tvb, offset, 1, ENC_NA);
9955             aci_aifsn = tvb_get_guint8(tvb, offset);
9956             /* 802.11-2012, 8.4.2.31 EDCA Parameter Set element */
9957             if (aci_aifsn < 2) {
9958                expert_add_info_format(pinfo, aci_aifsn_tree, &ei_ieee80211_qos_bad_aifsn,
9959                  "The minimum value for the AIFSN subfield is 2 (found %u).", aci_aifsn);
9960             }
9961             proto_item_append_text(ac_item, " ACI %u (%s), ACM %s, AIFSN %u",
9962               (aci_aifsn & 0x60) >> 5, try_val_to_str((aci_aifsn & 0x60) >> 5, ieee80211_wfa_ie_wme_acs_vals),
9963               (aci_aifsn & 0x10) ? "yes" : "no", aci_aifsn & 0x0f);
9964             offset += 1;
9965
9966             /* ECWmin/ECWmax field */
9967             ecw_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_ecw, tvb, offset, 1, ENC_NA);
9968             ecw_tree = proto_item_add_subtree(ecw_item, ett_wme_ecw);
9969             ecw = tvb_get_guint8(tvb, offset);
9970             ecwmin = ecw & 0x0f;
9971             ecwmax = (ecw & 0xf0) >> 4;
9972             cwmin= (1 << ecwmin) - 1;
9973             cwmax= (1 << ecwmax) - 1;
9974             proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_max, tvb, offset, 1, ENC_NA);
9975             proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_min, tvb, offset, 1, ENC_NA);
9976             proto_tree_add_uint(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_cw_max, tvb, offset, 1, cwmax);
9977             proto_tree_add_uint(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_cw_min, tvb, offset, 1, cwmin);
9978             proto_item_append_text(ac_item, ", ECWmin/max %u/%u (CWmin/max %u/%u)", ecwmin, ecwmax, cwmin, cwmax);
9979             offset += 1;
9980
9981             /* TXOP Limit */
9982             proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_txop_limit, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9983             proto_item_append_text(ac_item, ", TXOP %u", tvb_get_letohs(tvb, offset));
9984             offset += 2;
9985           }
9986           break;
9987         }
9988         case 2:   /* WME TSPEC Element */
9989         {
9990
9991             proto_item *tsinfo_item;
9992             proto_tree *tsinfo_tree;
9993
9994             tsinfo_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo, tvb, offset, 3, ENC_LITTLE_ENDIAN);
9995             tsinfo_tree = proto_item_add_subtree(tsinfo_item, ett_tsinfo_tree);
9996
9997             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid, tvb, offset, 3, ENC_LITTLE_ENDIAN);
9998             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction, tvb, offset, 3, ENC_LITTLE_ENDIAN);
9999             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10000             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10001             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10002             offset += 3;
10003
10004             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10005             offset += 2;
10006
10007             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10008             offset += 2;
10009
10010             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10011             offset += 4;
10012
10013             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10014             offset += 4;
10015
10016             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10017             offset += 4;
10018
10019             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10020             offset += 4;
10021
10022             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10023             offset += 4;
10024
10025             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10026             offset += 4;
10027
10028             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10029             offset += 4;
10030
10031             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10032             offset += 4;
10033
10034             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10035             offset += 4;
10036
10037             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10038             offset += 4;
10039
10040             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10041             offset += 4;
10042
10043             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10044             offset += 2;
10045
10046             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10047             offset += 2;
10048
10049           break;
10050         }
10051         default:
10052           /* No default Action */
10053         break;
10054       } /* End switch (subtype) */
10055       break;
10056     }
10057     case 4: /* WPS: Wifi Protected Setup */
10058     {
10059       dissect_wps_tlvs(tree, tvb, offset, tag_len-1, NULL);
10060     }
10061     break;
10062     default:
10063       /* No default Action...*/
10064     break;
10065   } /* End switch (type) */
10066
10067   return offset;
10068 }
10069
10070 static const value_string hs20_indication_release_number_vals[] = {
10071   { 0, "Release 1" },
10072   { 1, "Release 2" },
10073   { 0, NULL }
10074 };
10075
10076 static void
10077 dissect_hs20_indication(proto_tree *tree, tvbuff_t *tvb, int offset)
10078 {
10079   proto_tree_add_item(tree, hf_hs20_indication_dgaf_disabled, tvb, offset, 1,
10080                       ENC_LITTLE_ENDIAN);
10081   proto_tree_add_item(tree, hf_hs20_indication_pps_mo_id_present, tvb, offset, 1,
10082                       ENC_LITTLE_ENDIAN);
10083   proto_tree_add_item(tree, hf_hs20_indication_anqp_domain_id_present, tvb, offset, 1,
10084                       ENC_LITTLE_ENDIAN);
10085   proto_tree_add_item(tree, hf_hs20_indication_release_number, tvb, offset, 1,
10086                       ENC_LITTLE_ENDIAN);
10087 }
10088
10089 static void
10090 dissect_vendor_ie_wfa(packet_info *pinfo, proto_item *item, tvbuff_t *tag_tvb)
10091 {
10092   gint tag_len = tvb_reported_length(tag_tvb);
10093
10094   if (tag_len < 4)
10095     return;
10096
10097   switch (tvb_get_guint8(tag_tvb, 3)) {
10098   case WFA_SUBTYPE_P2P:
10099     dissect_wifi_p2p_ie(pinfo, item, tag_tvb, 4, tag_len - 4);
10100     proto_item_append_text(item, ": P2P");
10101     break;
10102   case WFA_SUBTYPE_WIFI_DISPLAY:
10103     dissect_wifi_display_ie(pinfo, item, tag_tvb, 4, tag_len - 4);
10104     proto_item_append_text(item, ": Wi-Fi Display");
10105     break;
10106   case WFA_SUBTYPE_HS20_INDICATION:
10107     dissect_hs20_indication(item, tag_tvb, 4);
10108     proto_item_append_text(item, ": Hotspot 2.0 Indication");
10109     break;
10110   }
10111 }
10112
10113 static void
10114 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
10115 {
10116
10117   switch(tvb_get_guint8(tvb, offset)){
10118     case 4:
10119     {
10120       /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
10121        * This is only used within EAPOL-Key frame Key Data. */
10122       offset += 1;
10123       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_pmkid, tvb, offset, 16, ENC_NA);
10124     }
10125     break;
10126     default:
10127       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_unknown, tvb, offset, tag_len, ENC_NA);
10128     break;
10129   }
10130
10131   proto_item_append_text(item, ": RSN");
10132
10133 }
10134
10135 typedef enum {
10136   MARVELL_IE_MESH = 4
10137 } marvell_ie_type_t;
10138
10139 static void
10140 dissect_vendor_ie_marvell(proto_item *item _U_, proto_tree *ietree,
10141                           tvbuff_t *tvb, int offset, guint32 tag_len)
10142 {
10143   guint8 type;
10144
10145   type = tvb_get_guint8(tvb, offset);
10146   proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10147   offset += 1;
10148
10149   switch (type) {
10150   case MARVELL_IE_MESH:
10151     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_subtype, tvb,
10152                          offset++, 1, ENC_LITTLE_ENDIAN);
10153     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_version, tvb,
10154                          offset++, 1, ENC_LITTLE_ENDIAN);
10155     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_active_proto_id, tvb,
10156                          offset++, 1, ENC_LITTLE_ENDIAN);
10157     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_active_metric_id, tvb,
10158                          offset++, 1, ENC_LITTLE_ENDIAN);
10159     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_mesh_cap, tvb,
10160                          offset++, 1, ENC_LITTLE_ENDIAN);
10161     break;
10162
10163   default:
10164     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_data, tvb, offset,
10165       tag_len - 1, ENC_NA);
10166     break;
10167   }
10168 }
10169
10170 typedef enum {
10171   ATHEROS_IE_ADVCAP = 1,
10172   ATHEROS_IE_XR = 3
10173 } atheros_ie_type_t;
10174
10175 typedef enum {
10176   ATHEROS_IE_ADVCAP_S = 1
10177 } atheros_ie_advcap_subtype_t;
10178
10179 typedef enum {
10180   ATHEROS_IE_XR_S = 1
10181 } atheros_ie_xr_subtype_t;
10182
10183 typedef enum {
10184   ATHEROS_IE_CAP_TURBOP = 0x01,
10185   ATHEROS_IE_CAP_COMP   = 0x02,
10186   ATHEROS_IE_CAP_FF     = 0x04,
10187   ATHEROS_IE_CAP_XR     = 0x08,
10188   ATHEROS_IE_CAP_AR     = 0x10,
10189   ATHEROS_IE_CAP_BURST  = 0x20,
10190   ATHEROS_IE_CAP_WME    = 0x40,
10191   ATHEROS_IE_CAP_BOOST  = 0x80
10192 } atheros_ie_cap_t;
10193
10194 static const value_string atheros_ie_type_vals[] = {
10195   { ATHEROS_IE_ADVCAP, "Advanced Capability"},
10196   { ATHEROS_IE_XR,     "eXtended Range"},
10197   { 0,                 NULL }
10198 };
10199
10200 static void
10201 dissect_vendor_ie_atheros_cap(proto_item *item _U_, tvbuff_t *tvb, int offset)
10202 {
10203   proto_tree *cap_tree;
10204
10205   cap_tree = proto_item_add_subtree(item, ett_ath_cap_tree);
10206
10207   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_turbop, tvb, offset, 1, ENC_NA);
10208   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_comp,   tvb, offset, 1, ENC_NA);
10209   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_ff,     tvb, offset, 1, ENC_NA);
10210   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_xr,     tvb, offset, 1, ENC_NA);
10211   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_ar,     tvb, offset, 1, ENC_NA);
10212   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_burst,  tvb, offset, 1, ENC_NA);
10213   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_wme,    tvb, offset, 1, ENC_NA);
10214   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_boost,  tvb, offset, 1, ENC_NA);
10215
10216 }
10217
10218 static void
10219 dissect_vendor_ie_atheros(proto_item *item _U_, proto_tree *ietree,
10220                           tvbuff_t *tvb, int offset, guint tag_len,
10221                           packet_info *pinfo, proto_item *ti_len)
10222 {
10223   guint8      type;
10224   guint8      subtype;
10225   guint8      version;
10226   proto_item *cap_item;
10227
10228   if (tag_len <= 3) {
10229         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 */
10230         return;
10231   }
10232   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_type, tvb, offset, 1, ENC_NA);
10233   type = tvb_get_guint8(tvb, offset);
10234   proto_item_append_text(item, ": %s", val_to_str_const(type, atheros_ie_type_vals, "Unknown"));
10235   offset  += 1;
10236   tag_len -= 1;
10237
10238   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_subtype, tvb, offset, 1, ENC_NA);
10239   subtype  = tvb_get_guint8(tvb, offset);
10240   offset  += 1;
10241   tag_len -= 1;
10242
10243   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_version, tvb, offset, 1, ENC_NA);
10244   version  = tvb_get_guint8(tvb, offset);
10245   offset  += 1;
10246   tag_len -= 1;
10247
10248   if (version == 0)
10249   {
10250     switch (type) {
10251       case ATHEROS_IE_ADVCAP:
10252       {
10253         switch (subtype) {
10254           case ATHEROS_IE_ADVCAP_S:
10255           {
10256             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_cap, tvb, offset, 1, ENC_NA);
10257             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
10258             offset   += 1;
10259             tag_len  -= 1;
10260
10261             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_defkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10262             offset  += 2;
10263             tag_len -= 2;
10264             break;
10265           }
10266           default:
10267           /* No default Action */
10268           break;
10269         } /* End switch (subtype) */
10270         break;
10271       }
10272       case ATHEROS_IE_XR:
10273       {
10274         switch (subtype) {
10275           case ATHEROS_IE_XR_S:
10276           {
10277             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_info, tvb, offset, 1, ENC_NA);
10278             offset  += 1;
10279             tag_len -= 1;
10280
10281             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_bssid, tvb, offset, 6, ENC_NA);
10282             offset  += 6;
10283             tag_len -= 6;
10284
10285             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_bssid, tvb, offset, 6, ENC_NA);
10286             offset  += 6;
10287             tag_len -= 6;
10288
10289             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10290             offset  += 2;
10291             tag_len -= 2;
10292
10293             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_cap, tvb, offset, 1, ENC_NA);
10294             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
10295             offset   += 1;
10296             tag_len  -= 1;
10297
10298             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_cap, tvb, offset, 1, ENC_NA);
10299             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
10300             offset   += 1;
10301             tag_len  -= 1;
10302             break;
10303           }
10304           default:
10305           /* No default Action */
10306           break;
10307         } /* End switch (subtype) */
10308         break;
10309         default:
10310         /* No default Action */
10311         break;
10312       } /* End switch (type) */
10313
10314     }
10315   }
10316   if (tag_len > 0) {
10317     proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_data, tvb, offset, tag_len, ENC_NA);
10318   }
10319 }
10320
10321 typedef enum {
10322   AIRONET_IE_DTPC = 0,
10323   AIRONET_IE_UNKNOWN1 = 1,
10324   AIRONET_IE_VERSION = 3,
10325   AIRONET_IE_QOS,
10326   AIRONET_IE_UNKNOWN11 = 11,
10327   AIRONET_IE_QBSS_V2 = 14,
10328   AIRONET_IE_CLIENT_MFP = 20
10329 } aironet_ie_type_t;
10330
10331 static const value_string aironet_ie_type_vals[] = {
10332   { AIRONET_IE_DTPC,      "DTPC"},
10333   { AIRONET_IE_UNKNOWN1,  "Unknown (1)"},
10334   { AIRONET_IE_VERSION,   "CCX version"},
10335   { AIRONET_IE_QOS,       "Qos"},
10336   { AIRONET_IE_UNKNOWN11, "Unknown (11)"},
10337   { AIRONET_IE_QBSS_V2,   "QBSS V2 - CCA"},
10338   { AIRONET_IE_CLIENT_MFP, "Client MFP"},
10339   { 0,                    NULL }
10340 };
10341
10342 static const value_string aironet_mfp_vals[] = {
10343   { 0,      "Disabled"},
10344   { 1,      "Enabled"},
10345   { 0,      NULL }
10346 };
10347
10348 static void
10349 dissect_vendor_ie_aironet(proto_item *aironet_item, proto_tree *ietree,
10350                           tvbuff_t *tvb, int offset, guint32 tag_len)
10351 {
10352   guint8  type;
10353   int i;
10354   gboolean dont_change = FALSE; /* Don't change the IE item text to default */
10355
10356   type = tvb_get_guint8(tvb, offset);
10357   proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10358   offset += 1;
10359
10360   switch (type) {
10361   case AIRONET_IE_DTPC:
10362     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_dtpc, tvb, offset, 2, ENC_NA);
10363     proto_item_append_text(aironet_item, ": Aironet DTPC Powerlevel 0x%02X", tvb_get_guint8(tvb, offset));
10364     dont_change = TRUE;
10365     break;
10366   case AIRONET_IE_VERSION:
10367     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10368     proto_item_append_text(aironet_item, ": Aironet CCX version = %d", tvb_get_guint8(tvb, offset));
10369     dont_change = TRUE;
10370     break;
10371   case AIRONET_IE_QOS:
10372     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_qos_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10373     offset += 1;
10374     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_qos_paramset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10375     offset += 1;
10376
10377     /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
10378      *  need to be swapped. Also, the "TXOP" may be TXOP - or not.
10379      */
10380     for (i = 0; i < 4; i++) {
10381       guint8 byte1, byte2;
10382       guint16 txop;
10383       byte1 = tvb_get_guint8(tvb, offset);
10384       byte2 = tvb_get_guint8(tvb, offset + 1);
10385       txop = tvb_get_letohs(tvb, offset + 2);
10386       proto_tree_add_bytes_format(ietree, hf_ieee80211_aironet_ie_qos_val, tvb, offset, 4, NULL,
10387           "CCX QoS Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
10388         (byte1 & 0x60) >> 5, val_to_str((byte1 & 0x60) >> 5, wme_acs, "(Unknown: %d)"),
10389         (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
10390         byte2 & 0x0f, (byte2 & 0xf0) >> 4,
10391         txop);
10392       offset += 4;
10393     }
10394     break;
10395   case AIRONET_IE_QBSS_V2:
10396     /* Extract Values */
10397     proto_tree_add_item(ietree, hf_ieee80211_qbss2_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10398     proto_tree_add_item(ietree, hf_ieee80211_qbss2_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
10399     proto_tree_add_item(ietree, hf_ieee80211_qbss2_cal, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10400     proto_tree_add_item(ietree, hf_ieee80211_qbss2_gl, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
10401     break;
10402   case AIRONET_IE_CLIENT_MFP:
10403     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_clientmfp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10404     proto_item_append_text(aironet_item, ": Aironet Client MFP %s",
10405       val_to_str_const(1 & tvb_get_guint8(tvb, offset), aironet_mfp_vals, "Unknown"));
10406     dont_change = TRUE;
10407     break;
10408   default:
10409     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_data, tvb, offset,
10410       tag_len - 1, ENC_NA);
10411     break;
10412   }
10413   if (!dont_change) {
10414     proto_item_append_text(aironet_item, ": Aironet %s (%d)",
10415       val_to_str_const(type, aironet_ie_type_vals, "Unknown"), type);
10416   }
10417 }
10418
10419 #define ARUBA_APNAME  3
10420 static const value_string ieee80211_vs_aruba_subtype_vals[] = {
10421   { ARUBA_APNAME, "AP Name"},
10422   { 0,                 NULL }
10423 };
10424 static void
10425 dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree,
10426                           tvbuff_t *tvb, int offset, guint32 tag_len)
10427 {
10428   guint8 type;
10429   const guint8* name;
10430
10431   offset += 1; /* VS OUI Type */
10432   tag_len -= 1;
10433
10434   type = tvb_get_guint8(tvb, offset);
10435   proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_subtype, tvb, offset, 1, ENC_NA);
10436   proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aruba_subtype_vals, "Unknown"));
10437   offset += 1;
10438   tag_len -= 1;
10439
10440   switch (type) {
10441   case ARUBA_APNAME:
10442     offset += 1;
10443     tag_len -= 1;
10444
10445     proto_tree_add_item_ret_string(ietree, hf_ieee80211_vs_aruba_apname, tvb,
10446                          offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &name);
10447     proto_item_append_text(item, " (%s)", name);
10448     break;
10449
10450   default:
10451     proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_data, tvb, offset,
10452       tag_len, ENC_NA);
10453     proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len));
10454     break;
10455   }
10456 }
10457
10458 static void
10459 dissect_vendor_ie_mikrotik(proto_item *item _U_, proto_tree *ietree,
10460                           tvbuff_t *tvb, int offset, guint32 tag_len)
10461 {
10462   guint8 type, length;
10463   proto_item *subitem;
10464   proto_tree *subtree;
10465
10466   offset += 1; /* VS OUI Type */
10467   tag_len -= 1;
10468   /* FIXME: Make sure we have at least 2 bytes left */
10469   proto_tree_add_item(ietree, hf_ieee80211_vs_mikrotik_unknown, tvb, offset, 2, ENC_NA);
10470
10471   offset += 2;
10472   tag_len -= 2;
10473
10474   while (tag_len >= 2) {
10475     type = tvb_get_guint8(tvb, offset);
10476     length = tvb_get_guint8(tvb, offset+1);
10477     subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_mikrotik_subitem, tvb, offset, length+2, ENC_NA);
10478     subtree = proto_item_add_subtree(subitem, ett_mikrotik);
10479     proto_item_set_text(subitem, "Sub IE (T/L: %d/%d)", type, length);
10480
10481     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_subtype, tvb, offset, 1, ENC_NA);
10482     offset += 1;
10483     tag_len -= 1;
10484
10485     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_sublength, tvb, offset, 1, ENC_NA);
10486     offset += 1;
10487     tag_len -= 1;
10488
10489     if (tag_len < length)
10490       /* FIXME: warn about this */
10491       length = tag_len;
10492     if (length == 0) {
10493       break;
10494     }
10495
10496     proto_tree_add_item(subtree, hf_ieee80211_vs_mikrotik_subdata, tvb, offset, length, ENC_NA);
10497     offset += length;
10498     tag_len -= length;
10499   }
10500 }
10501
10502 enum vs_nintendo_type {
10503   NINTENDO_SERVICES = 0x11,
10504   NINTENDO_CONSOLEID = 0xF0
10505 };
10506
10507 static const value_string ieee80211_vs_nintendo_type_vals[] = {
10508   { NINTENDO_SERVICES,  "Services"},
10509   { NINTENDO_CONSOLEID, "ConsoleID"},
10510   { 0, NULL }
10511 };
10512
10513 static proto_tree*
10514 dissect_vendor_ie_nintendo_tlv(const int hfindex, proto_tree *ietree,
10515                           tvbuff_t *tvb, int offset, guint32 sublen)
10516 {
10517   proto_item *nintendo_item;
10518   proto_tree *nintendo_tree;
10519
10520   nintendo_item = proto_tree_add_item(ietree, hfindex, tvb, offset, sublen, ENC_NA);
10521   nintendo_tree = proto_item_add_subtree(nintendo_item, ett_nintendo);
10522
10523   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_type, tvb, offset, 1, ENC_NA);
10524   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_length, tvb, offset + 1,  1, ENC_NA);
10525
10526   return nintendo_tree;
10527 }
10528
10529 static void
10530 dissect_vendor_ie_nintendo(proto_item *item _U_, proto_tree *ietree,
10531                           tvbuff_t *tvb, int offset, guint32 tag_len)
10532 {
10533   proto_tree *nintendo_tree;
10534
10535   guint8      subtype;
10536   guint8      sublength;
10537   guint32     length = tag_len;
10538
10539   /* Skip OUI type for now - the code is for type 1 (StreetPass) only */
10540   /* http://3dbrew.org/wiki/StreetPass */
10541   offset += 1;
10542   length -= 1;
10543
10544   while(length > 0 && length < 256) { /* otherwise we are < 0 but on unsigned */
10545     subtype = tvb_get_guint8(tvb, offset);
10546     sublength = tvb_get_guint8(tvb, offset + 1);
10547
10548     switch(subtype) {
10549     case NINTENDO_SERVICES:
10550       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_servicelist, ietree, tvb, offset, sublength + 2);
10551       offset += 2;
10552       length -= 2;
10553
10554       while (sublength > 4) {
10555
10556         proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_service, tvb, offset, 5, ENC_NA);
10557         offset += 5;
10558         length -= 5;
10559         sublength -= 5;
10560       }
10561       break;
10562     case NINTENDO_CONSOLEID:
10563       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_consoleid, ietree, tvb, offset, sublength + 2);
10564       offset += + 2;
10565       length -= + 2;
10566
10567       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_consoleid, tvb, offset, sublength, ENC_NA);
10568       offset += sublength;
10569       length -= sublength;
10570       break;
10571     default:
10572       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_unknown, ietree, tvb, offset, sublength + 2);
10573       offset += + 2;
10574       length -= + 2;
10575
10576       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_unknown, tvb, offset, sublength, ENC_NA);
10577       offset += sublength;
10578       length -= sublength;
10579       break;
10580     }
10581   }
10582 }
10583
10584 static void
10585 dissect_vendor_ie_meru(proto_item *item _U_, proto_tree *ietree,
10586                        tvbuff_t *tvb, int offset, guint32 tag_len,
10587                        packet_info *pinfo)
10588 {
10589   guint32 type, length;
10590   proto_item *subitem, *ti_len;
10591   proto_tree *subtree;
10592
10593   while (tag_len >= 2) {
10594     subitem = proto_tree_add_item(ietree, hf_ieee80211_vs_meru_subitem, tvb, offset, 2, ENC_NA);
10595     subtree = proto_item_add_subtree(subitem, ett_meru);
10596
10597     proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_subtype, tvb, offset, 1, ENC_NA, &type);
10598     offset += 1;
10599     tag_len -= 1;
10600
10601     ti_len = proto_tree_add_item_ret_uint(subtree, hf_ieee80211_vs_meru_sublength, tvb, offset, 1, ENC_NA, &length);
10602     offset += 1;
10603     tag_len -= 1;
10604
10605     if (tag_len < length) {
10606       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < Sub Length");
10607       length = tag_len;
10608     }
10609
10610     proto_item_append_text(subitem, " (t=%d, l=%d)", type, length);
10611     proto_item_set_len(subitem, 2+length);
10612
10613     proto_tree_add_item(subtree, hf_ieee80211_vs_meru_subdata, tvb, offset, length, ENC_NA);
10614     offset += length;
10615     tag_len -= length;
10616
10617   }
10618 }
10619
10620 static const value_string ieee80211_vs_extreme_subtype_vals[] = {
10621   { 1, "AP Name"},
10622   { 0, NULL }
10623 };
10624
10625 static void
10626 dissect_vendor_ie_extreme(proto_item *item _U_, proto_tree *ietree,
10627                           tvbuff_t *tvb, int offset, guint32 tag_len,
10628                           packet_info *pinfo)
10629 {
10630   guint32 type, length;
10631   proto_item *ti_len;
10632
10633   proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_extreme_subtype, tvb, offset, 1, ENC_NA, &type);
10634   offset += 1;
10635   tag_len -= 1;
10636
10637   proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_subdata, tvb, offset, tag_len, ENC_NA);
10638
10639   switch(type){
10640     case 1: /* Unknown (7 bytes) + AP Name Length (1 byte) + AP Name */
10641
10642       proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_unknown, tvb, offset, 7, ENC_NA);
10643       offset += 7;
10644       tag_len -= 1;
10645
10646       ti_len = proto_tree_add_item_ret_uint(ietree, hf_ieee80211_vs_extreme_ap_length, tvb, offset, 1, ENC_NA, &length);
10647       offset += 1;
10648       tag_len -= 1;
10649
10650       if (tag_len < length) {
10651         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length < AP Length");
10652         length = tag_len;
10653       }
10654
10655     proto_tree_add_item(ietree, hf_ieee80211_vs_extreme_ap_name, tvb, offset, length, ENC_ASCII|ENC_NA);
10656
10657     break;
10658     default:
10659     /* Expert info ? */
10660     break;
10661   }
10662 }
10663
10664 /* 802.11-2012 8.4.2.37 QoS Capability element */
10665 static int
10666 dissect_qos_capability(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
10667 {
10668   switch (ftype) {
10669     case MGT_ASSOC_REQ:
10670     case MGT_PROBE_REQ:
10671     case MGT_REASSOC_REQ:
10672     {
10673       /* To AP so decode Qos Info as STA */
10674       offset += add_ff_qos_info_sta(tree, tvb, pinfo, offset);
10675       break;
10676     }
10677
10678     case MGT_BEACON:
10679     case MGT_PROBE_RESP:
10680     case MGT_ASSOC_RESP:
10681     case MGT_REASSOC_RESP:
10682     {
10683       /* From AP so decode QoS Info as AP */
10684       offset += add_ff_qos_info_ap(tree, tvb, pinfo, offset);
10685       break;
10686     }
10687
10688     default:
10689       expert_add_info_format(pinfo, proto_tree_get_parent(tree), &ei_ieee80211_qos_info_bad_ftype,
10690                              "Could not deduce direction to decode correctly, ftype %u", ftype);
10691       break;
10692   }
10693
10694   return offset;
10695 }
10696
10697 /* 7.3.2.25 RSN information element */
10698 static int
10699 dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
10700                int offset, guint32 tag_len, association_sanity_check_t *association_sanity_check)
10701 {
10702   proto_item *rsn_gcs_item, *rsn_pcs_item, *rsn_akms_item, *rsn_cap_item, *rsn_pmkid_item, *rsn_gmcs_item;
10703   proto_item *rsn_sub_pcs_item, *rsn_sub_akms_item;
10704   proto_item *rsn_pcs_count, *rsn_akms_count, *rsn_pmkid_count;
10705   proto_tree *rsn_gcs_tree, *rsn_pcs_tree, *rsn_akms_tree, *rsn_cap_tree, *rsn_pmkid_tree, *rsn_gmcs_tree;
10706   proto_tree *rsn_sub_pcs_tree, *rsn_sub_akms_tree;
10707   guint16     pcs_count, akms_count, pmkid_count;
10708   guint       ii;
10709   int         tag_end = offset + tag_len;
10710
10711   proto_tree_add_item(tree, hf_ieee80211_rsn_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10712   offset += 2;
10713
10714   /* 7.3.2.25.1 Group Cipher suites */
10715   rsn_gcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gcs, tvb, offset, 4, ENC_BIG_ENDIAN);
10716   rsn_gcs_tree = proto_item_add_subtree(rsn_gcs_item, ett_rsn_gcs_tree);
10717   proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10718
10719     /* Check if OUI is 00:0F:AC (ieee80211) */
10720   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
10721   {
10722     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10723   } else {
10724     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10725   }
10726   offset += 4;
10727
10728   /* 7.3.2.25.2 Pairwise Cipher suites */
10729   rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10730   pcs_count = tvb_get_letohs(tvb, offset);
10731   offset += 2;
10732
10733   if (offset + (pcs_count * 4) > tag_end)
10734   {
10735     expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
10736         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
10737     pcs_count = (tag_end - offset) / 4;
10738   }
10739
10740   rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
10741   rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
10742   for (ii = 0; ii < pcs_count; ii++)
10743   {
10744     rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
10745     rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
10746     proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10747
10748     /* Check if OUI is 00:0F:AC (ieee80211) */
10749     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
10750     {
10751       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10752       proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
10753     } else {
10754       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10755     }
10756     offset += 4;
10757   }
10758
10759   if (offset >= tag_end)
10760   {
10761     return offset;
10762   }
10763
10764   /* 7.3.2.25.2 AKM suites */
10765   rsn_akms_count = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10766   akms_count = tvb_get_letohs(tvb, offset);
10767   offset += 2;
10768
10769   if (offset + (akms_count * 4) > tag_end)
10770   {
10771     expert_add_info_format(pinfo, rsn_akms_count, &ei_ieee80211_rsn_pmkid_count,
10772         "Auth Key Management (AKM) Suite Count too large, 4*%u > %d", akms_count, tag_end - offset);
10773     akms_count = (tag_end - offset) / 4;
10774   }
10775
10776   rsn_akms_item = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_list, tvb, offset, akms_count * 4, ENC_NA);
10777   rsn_akms_tree = proto_item_add_subtree(rsn_akms_item, ett_rsn_akms_tree);
10778   for (ii = 0; ii < akms_count; ii++)
10779   {
10780     rsn_sub_akms_item = proto_tree_add_item(rsn_akms_tree, hf_ieee80211_rsn_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
10781     rsn_sub_akms_tree = proto_item_add_subtree(rsn_sub_akms_item, ett_rsn_sub_akms_tree);
10782     proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10783
10784     /* Check if OUI is 00:0F:AC (ieee80211) */
10785     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
10786     {
10787       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10788       proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(tvb_get_ntohl(tvb, offset)));
10789
10790       if (association_sanity_check) {
10791         guint32 akm_suite = tvb_get_ntohl(tvb, offset);
10792         if (akm_suite == 0x000FAC03 || akm_suite == 0x000FAC04 || akm_suite == 0x000FAC09) {
10793           /* This is an FT AKM suite */
10794           association_sanity_check->has_ft_akm_suite = TRUE;
10795           if (association_sanity_check->rsn_first_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
10796             association_sanity_check->rsn_first_ft_akm_suite = rsn_sub_akms_tree->last_child;
10797           }
10798         } else {
10799           /* This is a non-FT AKM suite */
10800           association_sanity_check->has_non_ft_akm_suite = TRUE;
10801           if (association_sanity_check->rsn_first_non_ft_akm_suite == NULL && rsn_sub_akms_tree != NULL) {
10802             association_sanity_check->rsn_first_non_ft_akm_suite = rsn_sub_akms_tree->last_child;
10803           }
10804         }
10805       }
10806 } else {
10807       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10808     }
10809     offset += 4;
10810   }
10811
10812   /* 7.3.2.25.3 RSN capabilities */
10813   rsn_cap_item = proto_tree_add_item(tree, hf_ieee80211_rsn_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10814   rsn_cap_tree = proto_item_add_subtree(rsn_cap_item, ett_rsn_cap_tree);
10815
10816   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_preauth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10817   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_no_pairwise, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10818   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_ptksa_replay_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10819   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_gtksa_replay_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10820   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_mfpr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10821   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_mfpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10822   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_jmr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10823   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_peerkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10824   offset += 2;
10825   if (offset >= tag_end)
10826   {
10827     return offset;
10828   }
10829   /* 7.3.2.25.4 PMKID */
10830   rsn_pmkid_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10831   pmkid_count = tvb_get_letohs(tvb, offset);
10832   offset += 2;
10833
10834   if (offset + (pmkid_count * 16) > tag_end)
10835   {
10836     expert_add_info_format(pinfo, rsn_pmkid_count, &ei_ieee80211_pmkid_count_too_large,
10837         "PMKID Count too large, 16*%u > %d", pmkid_count, tag_end - offset);
10838     pmkid_count = (tag_end - offset) / 16;
10839   }
10840
10841   rsn_pmkid_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_list, tvb, offset, pmkid_count * 16, ENC_NA);
10842   rsn_pmkid_tree = proto_item_add_subtree(rsn_pmkid_item, ett_rsn_pmkid_tree);
10843   for (ii = 0; ii < pmkid_count; ii++)
10844   {
10845     proto_tree_add_item(rsn_pmkid_tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
10846     offset += 16;
10847   }
10848
10849   if (offset >= tag_end)
10850   {
10851     return offset;
10852   }
10853   /* Group Management Cipher Suite (802.11w)*/
10854   rsn_gmcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gmcs, tvb, offset, 4, ENC_BIG_ENDIAN);
10855   rsn_gmcs_tree = proto_item_add_subtree(rsn_gmcs_item, ett_rsn_gmcs_tree);
10856   proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10857   /* Check if OUI is 00:0F:AC (ieee80211) */
10858   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
10859   {
10860     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10861   } else {
10862     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10863   }
10864   offset += 4;
10865
10866   return offset;
10867 }
10868 static int
10869 dissect_extended_capabilities_ie(packet_info *pinfo, proto_tree *tree,
10870                          proto_item *ti, proto_item *ti_len,
10871                          guint32 tag_len, tvbuff_t *tvb,
10872                          int offset, int tag_end)
10873 {
10874   proto_item *ti_ex_cap;
10875   proto_tree *ex_cap_tree;
10876
10877   if (tag_len < 1)
10878   {
10879     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be greater than 0", tag_len);
10880     return offset;
10881   }
10882   proto_item_append_text(ti, " (%u octet%s)", tag_len, plurality(tag_len, "", "s"));
10883
10884   /* Extended Capability octet 1 */
10885   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10886   proto_item_append_text(ti_ex_cap, " (octet 1)");
10887   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap1);
10888   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b0, tvb, offset, 1, ENC_NA);
10889   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b1, tvb, offset, 1, ENC_NA);
10890   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b2, tvb, offset, 1, ENC_NA);
10891   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b3, tvb, offset, 1, ENC_NA);
10892   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b4, tvb, offset, 1, ENC_NA);
10893   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b5, tvb, offset, 1, ENC_NA);
10894   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b6, tvb, offset, 1, ENC_NA);
10895   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b7, tvb, offset, 1, ENC_NA);
10896   offset += 1;
10897
10898   /* Extended Capability octet 2 */
10899   if (offset >= tag_end) {
10900     return offset;
10901   }
10902   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10903   proto_item_append_text(ti_ex_cap, " (octet 2)");
10904   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap2);
10905   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b8, tvb, offset, 1, ENC_NA);
10906   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b9, tvb, offset, 1, ENC_NA);
10907   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b10, tvb, offset, 1, ENC_NA);
10908   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b11, tvb, offset, 1, ENC_NA);
10909   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b12, tvb, offset, 1, ENC_NA);
10910   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b13, tvb, offset, 1, ENC_NA);
10911   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b14, tvb, offset, 1, ENC_NA);
10912   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b15, tvb, offset, 1, ENC_NA);
10913   offset += 1;
10914
10915   /* Extended Capability octet 3 */
10916   if (offset >= tag_end) {
10917     return offset;
10918   }
10919   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10920   proto_item_append_text(ti_ex_cap, " (octet 3)");
10921   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap3);
10922   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b16, tvb, offset, 1, ENC_NA);
10923   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b17, tvb, offset, 1, ENC_NA);
10924   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b18, tvb, offset, 1, ENC_NA);
10925   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b19, tvb, offset, 1, ENC_NA);
10926   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b20, tvb, offset, 1, ENC_NA);
10927   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b21, tvb, offset, 1, ENC_NA);
10928   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b22, tvb, offset, 1, ENC_NA);
10929   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b23, tvb, offset, 1, ENC_NA);
10930   offset += 1;
10931
10932   /* Extended Capability octet 4 */
10933   if (offset >= tag_end) {
10934     return offset;
10935   }
10936   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10937   proto_item_append_text(ti_ex_cap, " (octet 4)");
10938   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap4);
10939   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b24, tvb, offset, 1, ENC_NA);
10940   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b25, tvb, offset, 1, ENC_NA);
10941   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b26, tvb, offset, 1, ENC_NA);
10942   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b27, tvb, offset, 1, ENC_NA);
10943   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b28, tvb, offset, 1, ENC_NA);
10944   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b29, tvb, offset, 1, ENC_NA);
10945   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b30, tvb, offset, 1, ENC_NA);
10946   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b31, tvb, offset, 1, ENC_NA);
10947   offset += 1;
10948
10949   /* Extended Capability octet 5 */
10950   if (offset >= tag_end) {
10951     return offset;
10952   }
10953   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10954   proto_item_append_text(ti_ex_cap, " (octet 5)");
10955   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap5);
10956   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b32, tvb, offset, 1, ENC_NA);
10957   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b33, tvb, offset, 1, ENC_NA);
10958   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b34, tvb, offset, 1, ENC_NA);
10959   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b35, tvb, offset, 1, ENC_NA);
10960   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b36, tvb, offset, 1, ENC_NA);
10961   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b37, tvb, offset, 1, ENC_NA);
10962   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b38, tvb, offset, 1, ENC_NA);
10963   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b39, tvb, offset, 1, ENC_NA);
10964   offset += 1;
10965
10966   /* Extended Capability octet 6 */
10967   if (offset >= tag_end) {
10968     return offset;
10969   }
10970   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10971   proto_item_append_text(ti_ex_cap, " (octet 6)");
10972   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap6);
10973   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b40, tvb, offset, 1, ENC_NA);
10974   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_serv_int_granularity, tvb, offset, 1, ENC_NA);
10975   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b44, tvb, offset, 1, ENC_NA);
10976   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b45, tvb, offset, 1, ENC_NA);
10977   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b46, tvb, offset, 1, ENC_NA);
10978   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b47, tvb, offset, 1, ENC_NA);
10979   offset += 1;
10980
10981
10982   /* Extended Capability octet 7 */
10983   if (offset >= tag_end) {
10984     return offset;
10985   }
10986   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10987   proto_item_append_text(ti_ex_cap, " (octet 7)");
10988   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap7);
10989   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b48, tvb, offset, 1, ENC_NA);
10990   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o7, tvb, offset, 1, ENC_NA);
10991   offset += 1;
10992
10993   /* Extended Capability octet 8 */
10994   if (offset >= tag_end) {
10995     return offset;
10996   }
10997   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10998   proto_item_append_text(ti_ex_cap, " (octet 8)");
10999   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap8);
11000   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b61, tvb, offset, 1, ENC_NA);
11001   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b62, tvb, offset, 1, ENC_NA);
11002
11003   /* Std802.11ac-2013, b63-64 indicate the Max Number of MSDUs in AMSDU. */
11004   ti_ex_cap = proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b63, tvb, offset, 1, ENC_NA);
11005   if (offset+1 < tag_end) {
11006
11007     proto_item_append_text(ti_ex_cap, " (b63-64 Max Number of MSDUs in AMSDU: %s)",
11008       val_to_str((tvb_get_guint8(tvb, offset) & 0x80) + ((tvb_get_guint8(tvb, offset+1) & 0x1) << 1),
11009                   vht_max_mpdu_in_amsdu, "Unknown:%d"));
11010   }
11011
11012   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o8, tvb, offset, 1, ENC_NA);
11013   offset += 1;
11014
11015   /* Extended Capability octet 9 */
11016   if (offset >= tag_end) {
11017     return offset;
11018   }
11019   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
11020   proto_item_append_text(ti_ex_cap, " (octet 9)");
11021   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap9);
11022   ti_ex_cap = proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b64, tvb, offset, 1, ENC_NA);
11023   proto_item_append_text(ti_ex_cap, " (b63-64 Max Number of MSDUs in AMSDU)");
11024   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o9, tvb, offset, 1, ENC_NA);
11025   offset += 1;
11026
11027   return offset;
11028 }
11029 static int
11030 dissect_vht_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset)
11031 {
11032   proto_item *ti;
11033   proto_tree *mcs_tree, *rx_mcs_tree, *tx_mcs_tree;
11034
11035   /* 8 byte Supported MCS set */
11036   ti = proto_tree_add_item(tree, hf_ieee80211_vht_mcsset, tvb, offset, 8, ENC_NA);
11037
11038   mcs_tree = proto_item_add_subtree(ti, ett_vht_mcsset_tree);
11039
11040   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11041   rx_mcs_tree = proto_item_add_subtree(ti, ett_vht_rx_mcsbit_tree);
11042
11043   /* B0 - B15 */
11044   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11045   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11046   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11047   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11048   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11049   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11050   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11051   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11052
11053   offset += 2;
11054   /* B16 - B28 13 bits*/
11055   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11056
11057   /* B29 - B31 2 reserved bits*/
11058
11059   offset += 2;
11060   /* B32 - B47 */
11061
11062   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11063   tx_mcs_tree = proto_item_add_subtree(ti, ett_vht_tx_mcsbit_tree);
11064   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11065   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11066   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11067   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11068   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11069   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11070   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11071   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11072
11073   offset += 2;
11074   /* B48 - B60 13 bits */
11075   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11076   /* B61 - B63 2 reserved bits*/
11077
11078   offset += 2;
11079   return offset;
11080 }
11081
11082 static int
11083 dissect_vht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
11084          guint32 tag_len, proto_item *ti_len)
11085 {
11086   proto_item *cap_item;
11087   proto_tree *cap_tree;
11088
11089   if (tag_len != 12) {
11090     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11091                            "VHT Capabilities IE length %u wrong, must be = 12", tag_len);
11092     return offset;
11093   }
11094
11095   /* 4 byte VHT Capabilities  Info*/
11096   cap_item = proto_tree_add_item(tree, hf_ieee80211_vht_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11097
11098   cap_tree = proto_item_add_subtree(cap_item, ett_vht_cap_tree);
11099
11100   /* B0 - B1 2 bits */
11101   proto_tree_add_item(cap_tree, hf_ieee80211_vht_max_mpdu_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11102   /* B2 - B3 2 bits*/
11103   proto_tree_add_item(cap_tree, hf_ieee80211_vht_supported_chan_width_set, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11104
11105   /* B4 - B7 4x 1 bit fields */
11106   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_ldpc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11107   proto_tree_add_item(cap_tree, hf_ieee80211_vht_short_gi_for_80, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11108   proto_tree_add_item(cap_tree, hf_ieee80211_vht_short_gi_for_160, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11109   proto_tree_add_item(cap_tree, hf_ieee80211_vht_tx_stbc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11110
11111   /* End of first byte */
11112
11113   /* B8 - B10 3 bit field */
11114   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_stbc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11115
11116   /* B11 - B12 2x 1 bit fields */
11117   proto_tree_add_item(cap_tree, hf_ieee80211_vht_su_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11118   proto_tree_add_item(cap_tree, hf_ieee80211_vht_su_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11119
11120   /* B13 - B15 3 bit field */
11121   proto_tree_add_item(cap_tree, hf_ieee80211_vht_beamformer_antennas, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11122
11123   /* End of second byte */
11124
11125   /* B16 - B18 */
11126   proto_tree_add_item(cap_tree, hf_ieee80211_vht_sounding_dimensions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11127   /* B19 */
11128   proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11129
11130   /* B20 - B22 2x 1 bit fields */
11131   proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11132   proto_tree_add_item(cap_tree, hf_ieee80211_vht_txop_ps, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11133   proto_tree_add_item(cap_tree, hf_ieee80211_vht_var_htc_field, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11134
11135   /* B23 - B25 3 bit field which takes us 2 bits into next byte */
11136   proto_tree_add_item(cap_tree, hf_ieee80211_vht_max_ampdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11137
11138   /* B26 - B27 2 bit field */
11139   proto_tree_add_item(cap_tree, hf_ieee80211_vht_link_adaptation_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11140
11141   /* B28 - B29 2x 1 bit fields */
11142   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11143   proto_tree_add_item(cap_tree, hf_ieee80211_vht_tx_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11144
11145   /* B30 - B31 Reserved */
11146   proto_tree_add_item(cap_tree, hf_ieee80211_vht_reserv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11147
11148   offset += 4;
11149
11150   /* 8 byte MCS set */
11151   offset = dissect_vht_mcs_set(tree, tvb, offset);
11152
11153   return offset;
11154 }
11155
11156 static int
11157 dissect_vht_operation_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
11158          guint32 tag_len, proto_item *ti_len)
11159 {
11160   proto_item *op_item, *ti;
11161   proto_tree *op_tree, *basic_mcs_tree;
11162
11163   if (tag_len != 5) {
11164     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11165                            "VHT Operation IE length %u wrong, must be = 5", tag_len);
11166     return offset;
11167   }
11168
11169   /* 3 byte VHT Operation Info*/
11170   op_item = proto_tree_add_item(tree, hf_ieee80211_vht_op, tvb, offset, 3, ENC_NA);
11171   op_tree = proto_item_add_subtree(op_item, ett_vht_op_tree);
11172   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11173   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center0, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
11174   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center1, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
11175
11176   offset += 3;
11177   /* VHT Basic MCS Set */
11178   ti = proto_tree_add_item(tree, hf_ieee80211_vht_op_basic_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11179   basic_mcs_tree = proto_item_add_subtree(ti, ett_vht_basic_mcsbit_tree);
11180   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11181   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11182   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11183   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11184   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11185   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11186   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11187   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11188
11189   offset += 2;
11190
11191   return offset;
11192 }
11193
11194 static int
11195 dissect_vht_tx_pwr_envelope(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
11196     guint32 tag_len, proto_item *ti_len)
11197 {
11198   proto_item *tx_pwr_item, *ti;
11199   proto_tree *tx_pwr_info_tree;
11200   guint8 opt_ie_cnt=0;
11201   guint8 i;
11202
11203   if (tag_len < 2 || tag_len > 5) {
11204     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11205                            "VHT TX PWR Envelope IE length %u wrong, must be >= 2 and <= 5", tag_len);
11206     return offset;
11207   }
11208
11209   tx_pwr_item = proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_info, tvb, offset, 1, ENC_NA);
11210   tx_pwr_info_tree =  proto_item_add_subtree(tx_pwr_item, ett_vht_tpe_info_tree);
11211
11212   ti = proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11213   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_unit, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11214   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11215
11216   opt_ie_cnt = tvb_get_guint8(tvb, offset) & 0x07;
11217
11218   offset += 1;
11219
11220   /* Power Constraint info is mandatory only for 20MHz, others are optional*/
11221   /* Power is expressed in terms of 0.5dBm from -64 to 63 and is encoded
11222    * as 8-bit 2's compliment */
11223   for (i = 0; i <= opt_ie_cnt; i++) {
11224     switch(i) {
11225     case 0:
11226       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_20, tvb, offset, 1, ENC_NA);
11227       offset += 1;
11228       break;
11229     case 1:
11230       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_40, tvb, offset, 1, ENC_NA);
11231       offset += 1;
11232       break;
11233     case 2:
11234       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_80, tvb, offset, 1, ENC_NA);
11235       offset += 1;
11236       break;
11237     case 3:
11238       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_160, tvb, offset, 1, ENC_NA);
11239       offset += 1;
11240       break;
11241     default:
11242       expert_add_info(pinfo, ti, &ei_ieee80211_vht_tpe_pwr_info_count);
11243       offset += 1;
11244       break;
11245     }
11246   }
11247
11248   return offset;
11249 }
11250
11251 static void
11252 dissect_mobility_domain(proto_tree *tree, tvbuff_t *tvb, int offset,
11253                         guint32 tag_len, association_sanity_check_t *association_sanity_check)
11254 {
11255   if (association_sanity_check != NULL) {
11256     association_sanity_check->association_has_mobility_domain_element = TRUE;
11257   }
11258
11259   if (tag_len < 3) {
11260     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11261                           "MDIE content length must be at least 3 bytes");
11262     return;
11263   }
11264
11265   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_mdid,
11266                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11267   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab,
11268                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
11269   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
11270                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
11271   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
11272                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
11273 }
11274
11275 static void
11276 dissect_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, int offset,
11277                             guint32 tag_len)
11278 {
11279   int end = offset + tag_len;
11280   if (tag_len < 82) {
11281     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11282                           "FTIE content length must be at least 82 bytes");
11283     return;
11284   }
11285
11286   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic_control,
11287                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11288   proto_tree_add_item(tree, hf_ieee80211_tag_ft_element_count,
11289                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11290   offset += 2;
11291   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic,
11292                       tvb, offset, 16, ENC_NA);
11293   offset += 16;
11294   proto_tree_add_item(tree, hf_ieee80211_tag_ft_anonce,
11295                       tvb, offset, 32, ENC_NA);
11296   offset += 32;
11297   proto_tree_add_item(tree, hf_ieee80211_tag_ft_snonce,
11298                       tvb, offset, 32, ENC_NA);
11299   offset += 32;
11300
11301   while (offset + 2 <= end) {
11302     guint8 id, len;
11303     int s_end;
11304     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_id,
11305                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
11306     id = tvb_get_guint8(tvb, offset);
11307     offset += 1;
11308
11309     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_len,
11310                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
11311     len = tvb_get_guint8(tvb, offset);
11312     offset += 1;
11313
11314     if (offset + len > end) {
11315       proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset,
11316                             end - offset, "Invalid FTIE subelement");
11317       return;
11318     }
11319
11320     s_end = offset + len;
11321     switch (id) {
11322     case 1:
11323       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r1kh_id,
11324                           tvb, offset, len, ENC_NA);
11325       break;
11326     case 2:
11327       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_info,
11328                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
11329       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_id,
11330                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
11331       offset += 2;
11332       if (offset > s_end)
11333         break;
11334       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_length,
11335                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
11336       offset += 1;
11337       if (offset > s_end)
11338         break;
11339       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_rsc,
11340                           tvb, offset, 8, ENC_NA);
11341       offset += 8;
11342       if (offset > s_end)
11343         break;
11344       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key,
11345                           tvb, offset, s_end - offset, ENC_NA);
11346       break;
11347     case 3:
11348       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r0kh_id,
11349                           tvb, offset, len, ENC_ASCII|ENC_NA);
11350       break;
11351     case 4:
11352       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_id,
11353                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
11354       offset += 2;
11355       if (offset > s_end)
11356         break;
11357       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_ipn,
11358                           tvb, offset, 6, ENC_NA);
11359       offset += 6;
11360       if (offset > s_end)
11361         break;
11362       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_length,
11363                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
11364       offset += 1;
11365       if (offset > s_end)
11366         break;
11367       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key,
11368                           tvb, offset, 24, ENC_NA);
11369       break;
11370     default:
11371       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_data,
11372                           tvb, offset, len, ENC_NA);
11373       break;
11374     }
11375     offset = s_end;
11376   }
11377 }
11378
11379 static void
11380 dissect_mmie(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
11381 {
11382   if (tag_len < 16) {
11383     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11384                           "MMIE content length must be at least 16 bytes");
11385     return;
11386   }
11387
11388   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11389   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
11390                       ENC_NA);
11391   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
11392                       ENC_NA);
11393 }
11394
11395 static void
11396 dissect_ssid_list(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
11397 {
11398   int end = offset + tag_len;
11399   proto_tree *entry;
11400   gboolean first = TRUE;
11401
11402   while (offset + 1 <= end) {
11403     guint8 len = tvb_get_guint8(tvb, offset + 1);
11404     guint8 *str;
11405
11406     if (offset + 2 + len > end)
11407       break;
11408
11409     str = tvb_format_text(tvb, offset + 2, len);
11410     proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
11411     first = FALSE;
11412     entry = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len, ett_ssid_list, NULL, "SSID: %s", str);
11413     proto_tree_add_item(entry, hf_ieee80211_tag_number, tvb, offset, 1,
11414                         ENC_LITTLE_ENDIAN);
11415     offset++;
11416     proto_tree_add_uint(entry, hf_ieee80211_tag_length, tvb, offset, 1, len);
11417     offset++;
11418     proto_tree_add_item(entry, hf_ieee80211_tag_ssid, tvb, offset, len,
11419                         ENC_ASCII|ENC_NA);
11420     offset += len;
11421   }
11422 }
11423
11424 static void
11425 dissect_link_identifier(proto_tree *tree, tvbuff_t *tvb, int offset,
11426                         guint32 tag_len)
11427 {
11428   if (tag_len < 18) {
11429     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11430                           "Link Identifier content length must be at least "
11431                           "18 bytes");
11432     return;
11433   }
11434
11435   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_bssid, tvb,
11436                       offset, 6, ENC_NA);
11437   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_init_sta, tvb,
11438                       offset + 6, 6, ENC_NA);
11439   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_resp_sta, tvb,
11440                       offset + 12, 6, ENC_NA);
11441 }
11442
11443 static void
11444 dissect_wakeup_schedule(proto_tree *tree, tvbuff_t *tvb, int offset,
11445                         guint32 tag_len)
11446 {
11447   if (tag_len < 18) {
11448     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11449                           "Wakeup Schedule content length must be at least "
11450                           "18 bytes");
11451     return;
11452   }
11453
11454   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_offset, tvb,
11455                       offset, 4, ENC_LITTLE_ENDIAN);
11456   offset += 4;
11457
11458   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_interval, tvb,
11459                       offset, 4, ENC_LITTLE_ENDIAN);
11460   offset += 4;
11461
11462   proto_tree_add_item(tree,
11463                       hf_ieee80211_tag_wakeup_schedule_awake_window_slots, tvb,
11464                       offset, 4, ENC_LITTLE_ENDIAN);
11465   offset += 4;
11466
11467   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
11468                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
11469   offset += 4;
11470
11471   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_idle_count, tvb,
11472                       offset, 2, ENC_LITTLE_ENDIAN);
11473 }
11474
11475 static void
11476 dissect_channel_switch_timing(proto_tree *tree, tvbuff_t *tvb, int offset,
11477                               guint32 tag_len)
11478 {
11479   if (tag_len < 4) {
11480     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11481                           "Channel Switch Timing content length must be at "
11482                           "least 4 bytes");
11483     return;
11484   }
11485
11486   proto_tree_add_item(tree, hf_ieee80211_tag_channel_switch_timing_switch_time,
11487                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11488   offset += 2;
11489
11490   proto_tree_add_item(tree,
11491                       hf_ieee80211_tag_channel_switch_timing_switch_timeout,
11492                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11493 }
11494
11495 static void
11496 dissect_pti_control(proto_tree *tree, tvbuff_t *tvb, int offset,
11497                     guint32 tag_len)
11498 {
11499   if (tag_len < 3) {
11500     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11501                           "PTI Control content length must be at least "
11502                           "3 bytes");
11503     return;
11504   }
11505
11506   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_tid, tvb,
11507                       offset, 1, ENC_LITTLE_ENDIAN);
11508   offset += 1;
11509
11510   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_sequence_control, tvb,
11511                       offset, 2, ENC_LITTLE_ENDIAN);
11512 }
11513
11514 static void
11515 dissect_pu_buffer_status(proto_tree *tree, tvbuff_t *tvb, int offset,
11516                          guint32 tag_len)
11517 {
11518   if (tag_len < 1) {
11519     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11520                           "PU Buffer Status content length must be at least "
11521                           "1 byte");
11522     return;
11523   }
11524
11525   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_bk, tvb,
11526                       offset, 1, ENC_LITTLE_ENDIAN);
11527   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_be, tvb,
11528                       offset, 1, ENC_LITTLE_ENDIAN);
11529   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_vi, tvb,
11530                       offset, 1, ENC_LITTLE_ENDIAN);
11531   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_vo, tvb,
11532                       offset, 1, ENC_LITTLE_ENDIAN);
11533 }
11534
11535 static void
11536 dissect_timeout_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
11537                          guint32 tag_len)
11538 {
11539   proto_item *pi;
11540
11541   pi = proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_type, tvb,
11542                            offset, 1, ENC_LITTLE_ENDIAN);
11543   if (tag_len < 5) {
11544     expert_add_info_format(pinfo, pi, &ei_ieee80211_tag_length,
11545                            "Timeout Interval content length must be at least "
11546                           "5 bytes");
11547     return;
11548   }
11549
11550   proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_value, tvb,
11551                       offset + 1, 4, ENC_LITTLE_ENDIAN);
11552 }
11553
11554 static int
11555 dissect_ric_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
11556                          guint32 tag_len, proto_item *ti, proto_item *ti_len, int ftype)
11557 {
11558
11559   proto_tree  *sub_tree;
11560   guint8       desc_cnt = 0;
11561   guint32      next_ie;
11562   int          offset_r = 0;
11563   const guint8 ids[] = { TAG_RIC_DESCRIPTOR };
11564
11565   if (tag_len !=  4)  {
11566     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11567                            "RIC Data Length must be 4 bytes");
11568     return 0;
11569   }
11570
11571   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_id, tvb,
11572                            offset, 1, ENC_LITTLE_ENDIAN);
11573   offset += 1;
11574
11575   desc_cnt = tvb_get_guint8(tvb, offset);
11576   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_desc_cnt, tvb,
11577                            offset, 1, ENC_LITTLE_ENDIAN);
11578   offset += 1;
11579
11580   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_status_code, tvb,
11581                            offset, 2, ENC_LITTLE_ENDIAN);
11582   offset += 2;
11583
11584   /* Our Design is such that all the Resource request IE's part of the RIC
11585    * must be in the sub tree of RIC for better readability
11586    * Even omnipeek does the same way.
11587    */
11588   sub_tree = proto_item_add_subtree(tree, ett_tag_ric_data_desc_ie);
11589
11590   proto_item_append_text(ti, " :Resource Descriptor List");
11591   if (desc_cnt == 0) {
11592     proto_item_append_text(ti, " :0 (Weird?)");
11593   }
11594
11595   while ( desc_cnt !=0 ) {
11596
11597     next_ie = tvb_get_guint8(tvb, offset);
11598     proto_item_append_text(ti, " :(%d:%s)", desc_cnt, val_to_str_ext(next_ie, &tag_num_vals_ext, "Reserved (%d)"));
11599     /* Recursive call to avoid duplication of code*/
11600     offset_r = add_tagged_field(pinfo, sub_tree, tvb, offset, ftype, ids, G_N_ELEMENTS(ids), NULL);
11601     if (offset_r == 0 )/* should never happen, returns a min of 2*/
11602       break;
11603     /* This will ensure that the IE after RIC is processed
11604      * only once. This gives us a good looking RIC IE :-)
11605      */
11606     tag_len += offset_r;
11607     desc_cnt--;
11608   }
11609
11610   return tag_len;
11611 }
11612
11613 static int
11614 dissect_overlap_bss_scan_par(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
11615                          guint32 tag_len, proto_item *ti _U_, proto_item *ti_len)
11616 {
11617
11618   if (tag_len !=  14)  {
11619     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11620                            "OBSS Length must be 14 bytes");
11621     return 0;
11622   }
11623
11624   proto_tree_add_item(tree, hf_ieee80211_tag_obss_spd, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11625   offset += 2;
11626
11627   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sad, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11628   offset += 2;
11629
11630   proto_tree_add_item(tree, hf_ieee80211_tag_obss_cwtsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11631   offset += 2;
11632
11633   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sptpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11634   offset += 2;
11635
11636   proto_tree_add_item(tree, hf_ieee80211_tag_obss_satpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11637   offset += 2;
11638
11639   proto_tree_add_item(tree, hf_ieee80211_tag_obss_wctdf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11640   offset += 2;
11641
11642   proto_tree_add_item(tree, hf_ieee80211_tag_obss_sat, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11643   offset += 2;
11644
11645   return offset;
11646 }
11647
11648 static int
11649 dissect_ric_descriptor(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
11650                          guint32 tag_len, proto_item *ti, proto_item *ti_len)
11651 {
11652
11653   guint8       rsrc_type = 0;
11654
11655   if (tag_len < 1)  {
11656     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11657                            "RIC Data Length must be at least 1 byte");
11658     return 0;
11659   }
11660
11661   rsrc_type = tvb_get_guint8(tvb, offset);
11662   proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_rsrc_type, tvb,
11663                            offset, 1, ENC_LITTLE_ENDIAN);
11664   offset += 1;
11665
11666   if (rsrc_type == 1) {
11667     /* Block ACK params
11668      * 802.11-2012: 8.4.2.53 RIC Descriptor element
11669      * Block Ack parameter set as defined in 8.4.1.14,
11670      * Block Ack timeout value as defined in 8.4.1.15, and
11671      * Block Ack starting sequence control as defined in 8.3.1.8
11672      */
11673     /* TODO: Still figuring out how to parse these ones,
11674      * need a sample capture with at least HEX Dump
11675      */
11676     proto_item_append_text(ti, " : Block ACK Params");
11677     proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_var_params, tvb,
11678                         offset, tag_len-1, ENC_NA);
11679     offset += tag_len -1;
11680   }else {
11681     /* 0, 2-255 are reserved*/
11682     proto_item_append_text(ti, " :Reserved (type != 1)");
11683   }
11684
11685   return offset;
11686 }
11687
11688 static int
11689 dissect_ext_bss_load(proto_tree *tree, tvbuff_t *tvb, int offset)
11690 {
11691   proto_tree_add_item(tree, hf_ieee80211_ext_bss_mu_mimo_capable_sta_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11692   offset += 2;
11693   proto_tree_add_item(tree, hf_ieee80211_ext_bss_ss_underutilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11694   offset += 1;
11695   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_20mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11696   offset += 1;
11697   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_40mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11698   offset += 1;
11699   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_80mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11700   offset += 1;
11701
11702   return offset;
11703 }
11704
11705
11706 static int
11707 dissect_wide_bw_channel_switch(proto_tree *tree, tvbuff_t *tvb, int offset)
11708 {
11709
11710   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11711   offset += 1;
11712   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11713   offset += 1;
11714   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11715   offset += 1;
11716
11717   return offset;
11718 }
11719 static int
11720 dissect_channel_switch_wrapper(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
11721                          guint32 tag_len)
11722 {
11723   int tmp_sublen;
11724   const guint8 ids[] = { TAG_COUNTRY_INFO, TAG_WIDE_BW_CHANNEL_SWITCH,
11725     TAG_VHT_TX_PWR_ENVELOPE };
11726
11727   /*
11728   Decode three subelement in IE-196(Channel Switch Wrapper element):
11729         (1) New Country subelement
11730         (2) Wide Bandwidth Channel Switch subelement
11731         (3) New VHT Transmit Power Envelope subelement
11732   */
11733   while (tag_len > 0){
11734     tmp_sublen = tvb_get_guint8(tvb, offset + 1);
11735     if(add_tagged_field(pinfo, tree, tvb, offset, 0, ids, G_N_ELEMENTS(ids), NULL) == 0){
11736       break;
11737     }
11738     tag_len -= (tmp_sublen + 2);
11739     offset += (tmp_sublen + 2);
11740   }
11741   return offset;
11742 }
11743
11744 static int
11745 dissect_operating_mode_notification(proto_tree *tree, tvbuff_t *tvb, int offset)
11746 {
11747   proto_item *ti;
11748   proto_tree *bit_tree;
11749
11750   /* Operating Mode field */
11751   ti = proto_tree_add_item(tree, hf_ieee80211_operat_notification_mode, tvb, offset, 1, ENC_NA);
11752   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
11753   proto_tree_add_item(bit_tree, hf_ieee80211_operat_mode_field_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11754   proto_tree_add_item(bit_tree, hf_ieee80211_operat_mode_field_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11755   proto_tree_add_item(bit_tree, hf_ieee80211_operat_mode_field_rxnss, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11756   proto_tree_add_item(bit_tree, hf_ieee80211_operat_mode_field_rxnsstype, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11757
11758   offset += 1;
11759
11760   return offset;
11761 }
11762
11763 static int
11764 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vendorspecific)
11765 {
11766   proto_item *ti;
11767   proto_tree *mcs_tree, *bit_tree;
11768   guint8 rx_nss, tx_nss; /* 0-4 for HT and 0-8 for VHT*/
11769   guint32 value_mcs_0_31, value_mcs_32_52, value_mcs_53_76;
11770   guint16 tx_mcs_set;
11771   rx_nss = tx_nss = 8;
11772   /* 16 byte Supported MCS set */
11773   if (vendorspecific)
11774   {
11775     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset_vs, tvb, offset, 16,
11776       basic ? "Basic MCS Set" : "MCS Set");
11777   } else
11778   {
11779     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset, tvb, offset, 16,
11780       basic ? "Basic MCS Set" : "MCS Set");
11781   }
11782   mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
11783
11784   /* Rx MCS Bitmask */
11785   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_rx_bitmask, tvb, offset, 10, ENC_NA);
11786   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
11787
11788   /* Bits 0 - 31 */
11789   value_mcs_0_31 = tvb_get_letohl(tvb, offset);
11790
11791   /* Handle all zeroes/ff's case..*/
11792   if (value_mcs_0_31 != 0x0)
11793   {
11794     if (!(value_mcs_0_31 & (0xffffff00))) {
11795       /*
11796        * At least one MCS from 0-7 is supported, but no MCS from 8-31 are
11797        * supported, so only 1 spatial stream is supported.
11798        */
11799       rx_nss = 0;
11800     } else if (!(value_mcs_0_31 & (0xffff0000))) {
11801       /*
11802        * At least one MCS from 8-15 is supported, but no MCS from 16-31 are
11803        * supported, so only 2 spatial streams are supported.
11804        */
11805       rx_nss = 1;
11806     } else if (!(value_mcs_0_31 & (0xff000000))) {
11807       /*
11808        * At least one MCS from 16-23 is supported, but no MCS from 24-31 are
11809        * supported, so only 3 spatial streams are supported.
11810        */
11811       rx_nss = 2;
11812     } else {
11813       /*
11814        * At least one MCS from 24-31 is supported, so 4 spatial streams
11815        * are supported.
11816        */
11817       rx_nss = 3;
11818     }
11819   }
11820
11821   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_0to7, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11822   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_8to15, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11823   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_16to23, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11824   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_24to31, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11825   offset += 4;
11826
11827   /* Should be we check UEQM Supported?*/
11828   /* Bits 32 - 52 */
11829   value_mcs_32_52 = tvb_get_letohl(tvb, offset);
11830   if (!(value_mcs_32_52 & (0x1ffffe))) {
11831     /*
11832      * MCS 33-52 aren't supported, so the number of spatial streams we get
11833      * from whichever MCSes from 0-31 that we support is the total number
11834      * of spatial streams we support.
11835      */
11836     ;
11837   } else if (!(value_mcs_32_52 & (0x1fff80))) {
11838     /*
11839      * At least one MCS from 33-38 is supported, but no MCS from 39-52 is
11840      * supported, so we have at least 2 spatial streams, but none of the
11841      * MCSs in that range give us any more.
11842      */
11843     rx_nss = MAX(1, rx_nss);
11844   } else {
11845     /*
11846      * At least one MCS from 39-52 is supported, so we have at least 3
11847      * spatial streams.
11848      */
11849     rx_nss = MAX(2, rx_nss);
11850   }
11851
11852   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_32, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11853   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_33to38, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11854   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_39to52, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11855   offset += 2;
11856
11857   /* Bits 53 - 76 */
11858   value_mcs_53_76 = tvb_get_letohl(tvb, offset);
11859   if ((value_mcs_53_76 & (0x1fffffe0))) {
11860     /*
11861      * At least one MCS from 53-76 is supported, so we have at least 4
11862      * spatial streams.
11863      */
11864     rx_nss = MAX(3, rx_nss);
11865   }
11866
11867   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_53to76, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11868   offset += 4;
11869
11870   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_highest_data_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11871   offset += 2;
11872
11873   /* Follow table 8-126 from 802.11-2012 */
11874   tx_mcs_set = tvb_get_letohs(tvb, offset);
11875
11876   if (!(tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
11877   {
11878     /* TX MCS Set is not defined
11879      * so there is no interpretation for Max Tx Spatial Streams
11880      */
11881      tx_nss = 4; /* Not Defined*/
11882   }
11883
11884   if ((tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
11885   {
11886     /* TX MCS Set is defined to be equal to Rx MCS Set
11887      * So, get the Max Spatial Streams from Rx
11888      * MCS set
11889      */
11890      tx_nss = rx_nss;
11891   }
11892   proto_item_append_text(ti, ": %s", val_to_str(rx_nss, mcsset_tx_max_spatial_streams_flags, "Reserved:%d" ) );
11893
11894   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_mcs_set_defined, tvb, offset, 1,
11895       ENC_LITTLE_ENDIAN);
11896   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal, tvb, offset, 1,
11897       ENC_LITTLE_ENDIAN);
11898   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_max_spatial_streams, tvb, offset, 1,
11899       ENC_LITTLE_ENDIAN);
11900   proto_item_append_text(ti, ", %s", val_to_str(tx_nss, mcsset_tx_max_spatial_streams_flags, "Reserved:%d" ) );
11901   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_unequal_modulation, tvb, offset, 1,
11902       ENC_LITTLE_ENDIAN);
11903   offset += 1;
11904
11905   offset += 3;
11906   return offset;
11907 }
11908
11909 /*  802.11n D1.10 - HT Information IE  */
11910 static int
11911 dissect_ht_info_ie_1_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
11912                        guint32 tag_len, proto_item *ti_len)
11913 {
11914   proto_item *cap_item;
11915   proto_tree *cap_tree;
11916
11917   cap_tree = tree;
11918
11919   if (tag_len < 22) {
11920     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11921                            "HT Information IE content length %u wrong, must be at least 22 bytes", tag_len);
11922     return offset;
11923   }
11924
11925
11926   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_primary_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11927   offset += 1;
11928
11929   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter1, tvb,
11930                     offset, 1, ENC_LITTLE_ENDIAN);
11931   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter1_tree);
11932   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_secondary_channel_offset, tvb,
11933                     offset, 1, ENC_LITTLE_ENDIAN);
11934   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_channel_width, tvb,
11935                     offset, 1, ENC_LITTLE_ENDIAN);
11936   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_rifs_mode, tvb,
11937                     offset, 1, ENC_LITTLE_ENDIAN);
11938   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_psmp_stas_only, tvb,
11939                     offset, 1, ENC_LITTLE_ENDIAN);
11940   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_service_interval_granularity, tvb,
11941                     offset, 1, ENC_LITTLE_ENDIAN);
11942   offset += 1;
11943
11944   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter2, tvb,
11945                     offset, 2, ENC_LITTLE_ENDIAN);
11946   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter2_tree);
11947   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_operating_mode, tvb,
11948                     offset, 1, ENC_LITTLE_ENDIAN);
11949   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_non_greenfield_sta_present, tvb,
11950                     offset, 1, ENC_LITTLE_ENDIAN);
11951   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_transmit_burst_limit, tvb,
11952                     offset, 1, ENC_LITTLE_ENDIAN);
11953   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_obss_non_ht_stas_present, tvb,
11954                     offset, 1, ENC_LITTLE_ENDIAN);
11955   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_1, tvb,
11956                     offset, 2, ENC_LITTLE_ENDIAN);
11957   offset += 2;
11958
11959   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter3, tvb,
11960                     offset, 2, ENC_LITTLE_ENDIAN);
11961   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter3_tree);
11962   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_2, tvb,
11963                     offset, 1, ENC_LITTLE_ENDIAN);
11964   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_dual_beacon, tvb,
11965                     offset, 1, ENC_LITTLE_ENDIAN);
11966   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_dual_cts_protection, tvb,
11967                     offset, 1, ENC_LITTLE_ENDIAN);
11968   offset += 1;
11969   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_secondary_beacon, tvb,
11970                     offset, 1, ENC_LITTLE_ENDIAN);
11971   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_lsig_txop_protection_full_support, tvb,
11972                     offset, 1, ENC_LITTLE_ENDIAN);
11973   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_pco_active, tvb,
11974                     offset, 1, ENC_LITTLE_ENDIAN);
11975   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_pco_phase, tvb,
11976                     offset, 1, ENC_LITTLE_ENDIAN);
11977   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_3, tvb,
11978                     offset, 1, ENC_LITTLE_ENDIAN);
11979   offset += 1;
11980
11981   offset = dissect_mcs_set(tree, tvb, offset, TRUE, FALSE);
11982
11983   return offset;
11984 }
11985
11986
11987 static int
11988 dissect_wapi_param_set(tvbuff_t *tvb, packet_info *pinfo,
11989                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
11990                           proto_item *ti, int ftype)
11991 {
11992   /* Parse the WAPI Parameter Set IE Here*/
11993   proto_item *item;
11994   proto_tree *subtree;
11995   guint16 loop_cnt, version, akm_cnt  = 1, ucast_cnt = 1, bkid_cnt = 1;
11996   guint8  akm_suite_type = 0, ucast_cipher_type = 0, mcast_cipher_type = 0;
11997
11998   version = tvb_get_letohs(tvb, offset);
11999   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12000   offset += 2;
12001
12002   /*MIN: 2 + (2+4)+ (2+4) + 4 + 2 + 0 (BKID CNT and LIST)  =20*/
12003   if (tag_len < 20) {
12004       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12005                 "tag_len is  %d, it's neither WAPI not BSS-AC-Access-Delay", tag_len);
12006     return offset;
12007   }
12008
12009   if (version != 1) {
12010     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12011                            "Version of WAPI protocol is %d, must be = 1", version);
12012     return offset;
12013   }
12014
12015   /* AKM Suites: list can't be 0*/
12016   akm_cnt = tvb_get_letohs(tvb, offset);
12017   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_akm_suite_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12018   offset += 2;
12019   if (akm_cnt != 0) {
12020     proto_item_append_text(ti, " : AKM Suite List:");
12021     for (loop_cnt = 0; loop_cnt < akm_cnt; loop_cnt++) {
12022       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_akm_tree);
12023       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_oui, tvb, offset, 3, ENC_NA);
12024       offset += 3;
12025       akm_suite_type = tvb_get_guint8(tvb, offset);
12026       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12027       offset += 1;
12028       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(akm_suite_type,
12029       ieee80211_wapi_suite_type_short, "Reserved: %d"));
12030     }
12031     proto_item_append_text(ti, " /");
12032   } else {
12033     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of AKM suites is 0, must be min 1");
12034     return offset;
12035
12036   }
12037   /* Unicast Cipher Suites: list can't be 0*/
12038   ucast_cnt = tvb_get_letohs(tvb, offset);
12039   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
12040                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12041   offset += 2;
12042   if (ucast_cnt != 0) {
12043     proto_item_append_text(ti, " Unicast Cipher List:");
12044     for (loop_cnt = 0; loop_cnt < ucast_cnt; loop_cnt++) {
12045       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_ucast_tree);
12046       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
12047       offset += 3;
12048       ucast_cipher_type = tvb_get_guint8(tvb, offset);
12049       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12050       offset += 1;
12051       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(ucast_cipher_type, ieee80211_wapi_cipher_type, "Reserved: %d"));
12052     }
12053   proto_item_append_text(ti, " /");
12054   } else {
12055     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of Unicast Cipher suites is 0, must be min 1");
12056     return offset;
12057
12058   }
12059
12060   /* Multicast Cipher Suites*/
12061   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
12062   offset += 3;
12063   mcast_cipher_type = tvb_get_guint8(tvb, offset);
12064   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12065   offset += 1;
12066   proto_item_append_text(ti, " Multicast Cipher: %s", val_to_str(mcast_cipher_type, ieee80211_wapi_cipher_type, "Reserved: %d"));
12067
12068   /* WAPI capability*/
12069   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_capab, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12070   subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_preauth_tree);
12071   proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_capab_preauth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12072   proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_capab_rsvd, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12073
12074   offset += 2;
12075   /* BKID List: The list can be 0
12076    * Applicable only for assoc/re-assoc
12077    */
12078   if (ftype == MGT_ASSOC_REQ || ftype == MGT_REASSOC_REQ ) {
12079     bkid_cnt = tvb_get_letohs(tvb, offset);
12080     proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12081     offset += 2;
12082     if (bkid_cnt != 0) {
12083       for (loop_cnt = 0; loop_cnt < bkid_cnt; loop_cnt++) {
12084         proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_list, tvb, offset, 16, ENC_NA);
12085         offset += 16;
12086       }
12087     }
12088   }
12089   return offset;
12090 }
12091
12092 static int
12093 dissect_bss_max_idle_period(proto_tree *tree, tvbuff_t *tvb, int offset)
12094 {
12095   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_period,
12096                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12097   offset += 2;
12098   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_options_protected,
12099                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12100   offset++;
12101   return offset;
12102 }
12103
12104 enum tfs_request_subelem_id {
12105   TFS_REQ_SUBELEM_TFS = 1,
12106   TFS_REQ_SUBELEM_VENDOR_SPECIFIC = 221
12107 };
12108
12109 static const value_string tfs_request_subelem_ids[] = {
12110   { TFS_REQ_SUBELEM_TFS, "TFS subelement" },
12111   { TFS_REQ_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
12112   { 0, NULL }
12113 };
12114
12115 static int
12116 dissect_tfs_request(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
12117                     guint32 tag_len, int ftype)
12118 {
12119   int end = offset + tag_len;
12120   const guint8 ids[] = {
12121     1, /* TFS Subelement */
12122     TAG_VENDOR_SPECIFIC_IE
12123   };
12124
12125   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_id,
12126                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12127   offset++;
12128   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_delete_after_match,
12129                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12130   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_notify,
12131                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12132   offset++;
12133   if (offset + 1 >= end) {
12134     expert_add_info_format(pinfo, tree, &ei_ieee80211_missing_data,
12135                            "No TFS Request subelements in TFS Request");
12136     return end;
12137   }
12138
12139   while (offset + 1 < end) {
12140     guint8 id, len;
12141     int s_offset, s_end;
12142
12143     id = tvb_get_guint8(tvb, offset);
12144     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_id,
12145                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12146     offset++;
12147     len = tvb_get_guint8(tvb, offset);
12148     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_len,
12149                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12150     offset++;
12151     if (offset + len > end) {
12152       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
12153                              "Not enough data for TFS Request subelement");
12154       return end;
12155     }
12156     switch (id) {
12157     case TFS_REQ_SUBELEM_TFS:
12158       s_offset = offset;
12159       s_end = offset + len;
12160       while (s_offset < s_end) {
12161         /* TODO 1 is interpreted as TAG_SUPP_RATES, fix this! */
12162         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, ftype, ids, G_N_ELEMENTS(ids), NULL);
12163         if (tlen==0)
12164           break;
12165         s_offset += tlen;
12166       }
12167       break;
12168     default:
12169       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem,
12170                           tvb, offset, len, ENC_NA);
12171       break;
12172     }
12173     offset += len;
12174   }
12175
12176   if (offset < end) {
12177     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
12178                            tvb, offset, end - offset, "Extra data after TFS Subelements");
12179   }
12180
12181   return end;
12182 }
12183
12184 enum tfs_response_subelem_id {
12185   TFS_RESP_SUBELEM_TFS_STATUS = 1,
12186   TFS_RESP_SUBELEM_TFS = 2,
12187   TFS_RESP_SUBELEM_VENDOR_SPECIFIC = 221
12188 };
12189
12190 static const value_string tfs_response_subelem_ids[] = {
12191   { TFS_RESP_SUBELEM_TFS_STATUS, "TFS Status subelement" },
12192   { TFS_RESP_SUBELEM_TFS, "TFS subelement" },
12193   { TFS_RESP_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
12194   { 0, NULL }
12195 };
12196
12197 static int
12198 dissect_tfs_response(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
12199                      int offset, guint32 tag_len, int ftype)
12200 {
12201   int end = offset + tag_len;
12202   const guint8 ids[] = {
12203     1, /* TFS Status subelement*/
12204     2, /* TFS subelement */
12205     TAG_VENDOR_SPECIFIC_IE
12206   };
12207
12208   while (offset + 3 <= end) {
12209     guint8 id, len;
12210     int s_offset, s_end;
12211
12212     id = tvb_get_guint8(tvb, offset);
12213     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_id,
12214                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12215     offset++;
12216     len = tvb_get_guint8(tvb, offset);
12217     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_len,
12218                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12219     offset++;
12220     if (offset + len > end) {
12221       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
12222                              "Not enough data for TFS Request subelement");
12223       return end;
12224     }
12225     switch (id) {
12226     case TFS_RESP_SUBELEM_TFS_STATUS:
12227       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_status,
12228                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
12229       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_id,
12230                           tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
12231       break;
12232     case TFS_RESP_SUBELEM_TFS:
12233       s_offset = offset;
12234       s_end = offset + len;
12235       while (s_offset < s_end) {
12236         /* TODO Element IDs 1 and 2 are misinterpreted! */
12237         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, ftype, ids, G_N_ELEMENTS(ids), NULL);
12238         if (tlen==0)
12239           break;
12240         s_offset += tlen;
12241       }
12242       break;
12243     default:
12244       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem,
12245                           tvb, offset, len, ENC_NA);
12246       break;
12247     }
12248
12249     offset += len;
12250   }
12251
12252   if (offset < end) {
12253     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
12254                            tvb, offset, end - offset, "Extra data after TFS Subelements");
12255   }
12256
12257   return end;
12258 }
12259
12260 static const value_string wnm_sleep_mode_action_types[] = {
12261   { 0, "Enter WNM-Sleep Mode" },
12262   { 1, "Exit WNM-Sleep Mode" },
12263   { 0, NULL }
12264 };
12265
12266 static const value_string wnm_sleep_mode_response_status_vals[] = {
12267   { 0, "Enter/Exit WNM-Sleep Mode Accept" },
12268   { 1, "Exit WNM-Sleep Mode Accept, GTK/IGTK update required" },
12269   { 2, "Denied. The AP is unable to perform the requested action." },
12270   { 3, "Denied temporarily. The AP is unable to perform the requested action "
12271     "at the current time. The request can be submitted again at a later time."
12272   },
12273   { 4, "Denied. Due to the pending key expiration." },
12274   { 5, "Denied. The requested action was not granted due to other WNM services "
12275     "in use by the requesting STA." },
12276   { 0, NULL }
12277 };
12278
12279 static int
12280 dissect_wnm_sleep_mode(proto_tree *tree, tvbuff_t *tvb, int offset)
12281 {
12282   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_action_type,
12283                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12284   offset++;
12285   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_response_status,
12286                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12287   offset++;
12288   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_interval,
12289                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12290   offset += 2;
12291   return offset;
12292 }
12293
12294 static const value_string time_adv_timing_capab_vals[] = {
12295   { 0, "No standardized external time source" },
12296   { 1, "Timestamp offset based on UTC" },
12297   { 2, "UTC time at which the TSF timer is 0" },
12298   { 0, NULL }
12299 };
12300
12301 static int
12302 dissect_time_adv(proto_tree *tree, tvbuff_t *tvb, int offset)
12303 {
12304   guint8 capab;
12305   proto_item *item;
12306   proto_tree *subtree;
12307   struct tm tm, *now;
12308   time_t t;
12309
12310   capab = tvb_get_guint8(tvb, offset);
12311   proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_timing_capab,
12312                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12313   offset += 1;
12314
12315   switch (capab) {
12316   case 1:
12317     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
12318                         tvb, offset, 10, ENC_NA);
12319     offset += 10;
12320
12321     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
12322                         tvb, offset, 5, ENC_NA);
12323     offset += 5;
12324     break;
12325   case 2:
12326     item = proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
12327                                tvb, offset, 10, ENC_NA);
12328     subtree = proto_item_add_subtree(item, ett_tag_time_adv_tree);
12329     memset(&tm, 0, sizeof(tm));
12330     tm.tm_year = tvb_get_letohs(tvb, offset) - 1900;
12331     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_year,
12332                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
12333     offset += 2;
12334     tm.tm_mon = tvb_get_guint8(tvb, offset) - 1;
12335     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_month,
12336                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12337     offset += 1;
12338     tm.tm_mday = tvb_get_guint8(tvb, offset);
12339     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_day,
12340                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12341     offset += 1;
12342     tm.tm_hour = tvb_get_guint8(tvb, offset);
12343     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_hours,
12344                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12345     offset += 1;
12346     tm.tm_min = tvb_get_guint8(tvb, offset);
12347     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_minutes,
12348                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12349     offset += 1;
12350     tm.tm_sec = tvb_get_guint8(tvb, offset);
12351     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_seconds,
12352                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12353     offset += 1;
12354     proto_tree_add_item(subtree,
12355                         hf_ieee80211_tag_time_adv_time_value_milliseconds,
12356                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
12357     offset += 2;
12358     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_reserved,
12359                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12360     offset += 1;
12361
12362     tm.tm_isdst = -1;
12363     t = mktime(&tm);
12364     if (t != -1) {
12365       t += (time_t)(last_timestamp / 1000000);
12366       now = localtime(&t);
12367       if (now)
12368         proto_item_append_text(item,
12369                                ": current time=%u-%02u-%02u %02u:%02u:%02u",
12370                                now->tm_year + 1900, now->tm_mon + 1,
12371                                now->tm_mday, now->tm_hour, now->tm_min,
12372                                now->tm_sec);
12373     }
12374
12375     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
12376                         tvb, offset, 5, ENC_NA);
12377     offset += 5;
12378
12379     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_update_counter,
12380                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12381     offset += 1;
12382     break;
12383   }
12384
12385   return offset;
12386 }
12387
12388 static int
12389 dissect_time_zone(proto_tree *tree, tvbuff_t *tvb, int offset,
12390                   guint32 tag_len)
12391 {
12392   proto_tree_add_item(tree, hf_ieee80211_tag_time_zone, tvb, offset, tag_len,
12393                       ENC_ASCII|ENC_NA);
12394   return offset + tag_len;
12395 }
12396
12397 static int
12398 dissect_ap_channel_report(tvbuff_t *tvb, packet_info *pinfo,
12399                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
12400                           int tag_end, proto_item *ti)
12401 {
12402   if (tag_len < 1) {
12403     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12404                            "AP Channel Report length %u wrong, must be > 1", tag_len);
12405     return offset;
12406   }
12407
12408   proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_operating_class, tvb,
12409                       offset, 1, ENC_LITTLE_ENDIAN);
12410   proto_item_append_text(ti, ": Operating Class %u, Channel List :", tvb_get_guint8(tvb, offset));
12411   offset += 1;
12412
12413   while (offset < tag_end)
12414   {
12415     proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_channel_list, tvb, offset, 1, ENC_NA);
12416     proto_item_append_text(ti, " %u,", tvb_get_guint8(tvb, offset));
12417     offset += 1;
12418   }
12419   return offset;
12420 }
12421
12422
12423 static int
12424 dissect_secondary_channel_offset_ie(tvbuff_t *tvb, packet_info *pinfo,
12425                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12426 {
12427
12428   if (tag_len != 1) {
12429     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12430                            "Secondary Channel Offset length %u wrong, must be = 1", tag_len);
12431     return offset;
12432   }
12433
12434   proto_tree_add_item(tree, hf_ieee80211_tag_secondary_channel_offset, tvb,
12435                       offset, 1, ENC_LITTLE_ENDIAN);
12436
12437   offset += 1;
12438
12439   return offset;
12440 }
12441
12442 static int
12443 dissect_bss_avg_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
12444                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12445 {
12446
12447   if (tag_len != 1) {
12448     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12449                            "BSS Average Access Delay length %u wrong, must be = 1", tag_len);
12450     return offset;
12451   }
12452
12453   proto_tree_add_item(tree, hf_ieee80211_tag_bss_ap_avg_access_delay, tvb,
12454                       offset, 1, ENC_LITTLE_ENDIAN);
12455
12456   offset += 1;
12457
12458   return offset;
12459 }
12460
12461 static int
12462 dissect_antenna_ie(tvbuff_t *tvb, packet_info *pinfo,
12463                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12464 {
12465
12466   if (tag_len != 1) {
12467     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12468                            "Antenna length %u wrong, must be = 1", tag_len);
12469     return offset;
12470   }
12471
12472   proto_tree_add_item(tree, hf_ieee80211_tag_antenna_id, tvb,
12473                       offset, 1, ENC_LITTLE_ENDIAN);
12474
12475   offset += 1;
12476
12477   return offset;
12478 }
12479
12480 static int
12481 dissect_rsni_ie(tvbuff_t *tvb, packet_info *pinfo,
12482                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12483 {
12484
12485   if (tag_len != 1) {
12486     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12487                            "RSNI length %u wrong, must be = 1", tag_len);
12488     return offset;
12489   }
12490
12491   proto_tree_add_item(tree, hf_ieee80211_tag_rsni, tvb,
12492                       offset, 1, ENC_LITTLE_ENDIAN);
12493
12494   offset += 1;
12495
12496   return offset;
12497 }
12498
12499 static int
12500 dissect_bss_available_admission_capacity_ie(tvbuff_t *tvb, packet_info *pinfo,
12501                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12502 {
12503   proto_item *ti;
12504   proto_tree *btree;
12505   guint16 bitmask;
12506   if (tag_len < 2) {
12507     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12508                            "BSS Available Admission Capacity length %u wrong, must > = 2", tag_len);
12509     return offset;
12510   }
12511
12512   ti = proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask, tvb,
12513                       offset, 2, ENC_LITTLE_ENDIAN);
12514   btree = proto_item_add_subtree(ti, ett_tag_bss_bitmask_tree);
12515   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12516   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12517   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12518   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12519   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12520   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12521   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12522   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12523   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12524   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12525   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12526   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12527   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12528   bitmask = tvb_get_letohs(tvb, offset);
12529   offset += 2;
12530
12531   if(bitmask & BSS_BITMASK_UP0)
12532   {
12533     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12534     offset += 2;
12535   }
12536   if(bitmask & BSS_BITMASK_UP1)
12537   {
12538     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12539     offset += 2;
12540   }
12541   if(bitmask & BSS_BITMASK_UP2)
12542   {
12543     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12544     offset += 2;
12545   }
12546   if(bitmask & BSS_BITMASK_UP3)
12547   {
12548     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12549     offset += 2;
12550   }
12551   if(bitmask & BSS_BITMASK_UP4)
12552   {
12553     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12554     offset += 2;
12555   }
12556   if(bitmask & BSS_BITMASK_UP5)
12557   {
12558     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12559     offset += 2;
12560   }
12561   if(bitmask & BSS_BITMASK_UP6)
12562   {
12563     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12564     offset += 2;
12565   }
12566   if(bitmask & BSS_BITMASK_UP7)
12567   {
12568     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12569     offset += 2;
12570   }
12571   if(bitmask & BSS_BITMASK_AC0)
12572   {
12573     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12574     offset += 2;
12575   }
12576   if(bitmask & BSS_BITMASK_AC1)
12577   {
12578     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12579     offset += 2;
12580   }
12581   if(bitmask & BSS_BITMASK_AC2)
12582   {
12583     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12584     offset += 2;
12585   }
12586   if(bitmask & BSS_BITMASK_AC3)
12587   {
12588     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12589     offset += 2;
12590   }
12591   return offset;
12592 }
12593
12594 static int
12595 dissect_bss_ac_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
12596                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12597 {
12598
12599   if (tag_len != 4) {
12600     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12601                            "BSS AC Access Delay length %u wrong, must = 4", tag_len);
12602     return offset;
12603   }
12604
12605   /* TODO: Display the scaled representation of the average
12606     medium access delay (a big (precalculed) value_string ?)
12607     See 8.4.2.46 BSS AC Access Delay element ... */
12608
12609   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_be, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12610   offset += 1;
12611   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_bk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12612   offset += 1;
12613   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12614   offset += 1;
12615   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vo, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12616   offset += 1;
12617
12618   return offset;
12619 }
12620
12621 static int
12622 dissect_rm_enabled_capabilities_ie(packet_info *pinfo, proto_tree *tree,
12623                          proto_item *ti, proto_item *ti_len,
12624                          guint32 tag_len, tvbuff_t *tvb,
12625                          int offset, int tag_end _U_)
12626 {
12627   proto_item *ti_ex_cap;
12628   proto_tree *ex_cap_tree;
12629
12630   if (tag_len != 5)
12631   {
12632     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "RM Enabled Capabilities length %u wrong, must = 5", tag_len);
12633     return offset;
12634   }
12635   proto_item_append_text(ti, " (%d octets)", tag_len);
12636
12637   /* RM Enabled Capability octet 1 */
12638   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12639   proto_item_append_text(ti_ex_cap, " (octet 1)");
12640   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_rm_cap1);
12641   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b0, tvb, offset, 1, ENC_NA);
12642   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b1, tvb, offset, 1, ENC_NA);
12643   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b2, tvb, offset, 1, ENC_NA);
12644   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b3, tvb, offset, 1, ENC_NA);
12645   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b4, tvb, offset, 1, ENC_NA);
12646   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b5, tvb, offset, 1, ENC_NA);
12647   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b6, tvb, offset, 1, ENC_NA);
12648   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b7, tvb, offset, 1, ENC_NA);
12649   offset += 1;
12650
12651   /* RM Enabled Capability octet 2 */
12652   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12653   proto_item_append_text(ti_ex_cap, " (octet 2)");
12654   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_rm_cap2);
12655   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b8, tvb, offset, 1, ENC_NA);
12656   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b9, tvb, offset, 1, ENC_NA);
12657   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b10, tvb, offset, 1, ENC_NA);
12658   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b11, tvb, offset, 1, ENC_NA);
12659   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b12, tvb, offset, 1, ENC_NA);
12660   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b13, tvb, offset, 1, ENC_NA);
12661   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b14, tvb, offset, 1, ENC_NA);
12662   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b15, tvb, offset, 1, ENC_NA);
12663   offset += 1;
12664
12665   /* RM Enabled Capability octet 3 */
12666   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12667   proto_item_append_text(ti_ex_cap, " (octet 3)");
12668   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_rm_cap3);
12669   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b16, tvb, offset, 1, ENC_NA);
12670   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b17, tvb, offset, 1, ENC_NA);
12671   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b18to20, tvb, offset, 1, ENC_NA);
12672   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b21to23, tvb, offset, 1, ENC_NA);
12673   offset += 1;
12674
12675   /* RM Enabled Capability octet 4 */
12676   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12677   proto_item_append_text(ti_ex_cap, " (octet 4)");
12678   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_rm_cap4);
12679   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b24to26, tvb, offset, 1, ENC_NA);
12680   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b27, tvb, offset, 1, ENC_NA);
12681   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b28, tvb, offset, 1, ENC_NA);
12682   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b29, tvb, offset, 1, ENC_NA);
12683   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b30, tvb, offset, 1, ENC_NA);
12684   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b31, tvb, offset, 1, ENC_NA);
12685   offset += 1;
12686
12687   /* RM Enabled Capability octet 5 */
12688   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12689   proto_item_append_text(ti_ex_cap, " (octet 5)");
12690   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_rm_cap5);
12691   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b32, tvb, offset, 1, ENC_NA);
12692   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b33, tvb, offset, 1, ENC_NA);
12693   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_o5, tvb, offset, 1, ENC_NA);
12694   offset += 1;
12695
12696   return offset;
12697 }
12698
12699 static int
12700 dissect_20_40_bss_coexistence(packet_info *pinfo, proto_tree *tree,
12701                               proto_item *ti_len, guint32 tag_len,
12702                               tvbuff_t *tvb, int offset)
12703 {
12704
12705   static const int *ieee80211_20_40_bss_coexistence_fields[] = {
12706     &hf_ieee80211_tag_20_40_bc_information_request,
12707     &hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant,
12708     &hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request,
12709     &hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request,
12710     &hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant,
12711     &hf_ieee80211_tag_20_40_bc_reserved,
12712     NULL
12713   };
12714
12715
12716   if (tag_len != 1)
12717   {
12718     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "20/40 BSS Coexistence length %u wrong, must = 1", tag_len);
12719     return offset;
12720   }
12721
12722   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_tag_20_40_bc,
12723                                     ett_tag_20_40_bc, ieee80211_20_40_bss_coexistence_fields,
12724                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
12725
12726   offset += 1;
12727
12728   return offset;
12729 }
12730
12731 static int
12732 dissect_ht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
12733                          guint32 tag_len, proto_item *ti_len, gboolean vendorspecific)
12734 {
12735   proto_item *cap_item, *ti;
12736   proto_tree *cap_tree;
12737
12738   if (tag_len != 26) {
12739     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12740                            "HT Capabilities IE length %u wrong, must be = 26", tag_len);
12741     return offset;
12742   }
12743
12744   if (wlan_ignore_draft_ht && vendorspecific)
12745     return offset;
12746
12747   /* 2 byte HT Capabilities  Info*/
12748   if (vendorspecific)
12749   {
12750     cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_vs_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12751   }
12752   else
12753   {
12754     cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12755   }
12756   cap_tree = proto_item_add_subtree(cap_item, ett_ht_cap_tree);
12757   proto_tree_add_item(cap_tree, hf_ieee80211_ht_ldpc_coding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12758   proto_tree_add_item(cap_tree, hf_ieee80211_ht_chan_width, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12759   proto_tree_add_item(cap_tree, hf_ieee80211_ht_sm_pwsave, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12760   proto_tree_add_item(cap_tree, hf_ieee80211_ht_green, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12761   proto_tree_add_item(cap_tree, hf_ieee80211_ht_short20, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12762   proto_tree_add_item(cap_tree, hf_ieee80211_ht_short40, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12763   proto_tree_add_item(cap_tree, hf_ieee80211_ht_tx_stbc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12764
12765   proto_tree_add_item(cap_tree, hf_ieee80211_ht_rx_stbc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12766   proto_tree_add_item(cap_tree, hf_ieee80211_ht_delayed_block_ack, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12767   proto_tree_add_item(cap_tree, hf_ieee80211_ht_max_amsdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12768   proto_tree_add_item(cap_tree, hf_ieee80211_ht_dss_cck_40, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12769   proto_tree_add_item(cap_tree, hf_ieee80211_ht_psmp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12770   proto_tree_add_item(cap_tree, hf_ieee80211_ht_40_mhz_intolerant, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12771   proto_tree_add_item(cap_tree, hf_ieee80211_ht_l_sig, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12772   offset += 2;
12773
12774   /* 1 byte A-MPDU Parameters */
12775   if (vendorspecific)
12776   {
12777     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12778   } else
12779   {
12780     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12781   }
12782   cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
12783   ti = proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12784   proto_item_append_text(ti, " (%04.0f[Bytes])", pow(2, 13+(tvb_get_guint8(tvb, offset) & 0x3))-1);
12785   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu_start_spacing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12786   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12787   offset += 1;
12788
12789   /* 16 byte MCS set */
12790   offset = dissect_mcs_set(tree, tvb, offset, FALSE, vendorspecific);
12791
12792
12793   /* 2 byte HT Extended Capabilities */
12794   if (vendorspecific)
12795   {
12796     cap_item = proto_tree_add_item(tree, hf_ieee80211_htex_vs_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12797   } else {
12798     cap_item = proto_tree_add_item(tree, hf_ieee80211_htex_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12799   }
12800   cap_tree = proto_item_add_subtree(cap_item, ett_htex_cap_tree);
12801   proto_tree_add_item(cap_tree, hf_ieee80211_htex_pco, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12802   proto_tree_add_item(cap_tree, hf_ieee80211_htex_transtime, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12803
12804   proto_tree_add_item(cap_tree, hf_ieee80211_htex_mcs, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12805   proto_tree_add_item(cap_tree, hf_ieee80211_htex_htc_support, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12806   proto_tree_add_item(cap_tree, hf_ieee80211_htex_rd_responder, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12807   offset += 2;
12808
12809
12810   /* 4 byte TxBF capabilities */
12811   if (vendorspecific)
12812   {
12813     cap_item = proto_tree_add_item(tree, hf_ieee80211_txbf_vs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12814   } else {
12815     cap_item = proto_tree_add_item(tree, hf_ieee80211_txbf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12816   }
12817   cap_tree = proto_item_add_subtree(cap_item, ett_txbf_tree);
12818   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12819   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_rcv_ssc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12820   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_tx_ssc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12821   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_rcv_ndp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12822   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_tx_ndp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12823   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_impl_txbf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12824   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_calib, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12825
12826   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_csi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12827   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_uncomp_fm, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12828   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_comp_fm, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12829   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_bf_csi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12830   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_uncomp_fm_feed, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12831   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_comp_fm_feed, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12832
12833   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_min_group, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12834   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_csi_num_bf_ant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12835   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_uncomp_sm_bf_ant, tvb, offset, 4,  ENC_LITTLE_ENDIAN);
12836   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_comp_sm_bf_ant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12837
12838   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_csi_max_rows_bf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12839   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_chan_est, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12840   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_resrv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12841   offset += 4;
12842
12843   /* 1 byte Antenna Selection (ASEL) capabilities */
12844   if (vendorspecific)
12845   {
12846     cap_item = proto_tree_add_item(tree, hf_ieee80211_antsel_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12847   }
12848   else
12849   {
12850     cap_item = proto_tree_add_item(tree, hf_ieee80211_antsel, tvb,  offset, 1, ENC_LITTLE_ENDIAN);
12851   }
12852   cap_tree = proto_item_add_subtree(cap_item, ett_antsel_tree);
12853   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12854   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12855   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12856   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b3, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12857   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b4, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12858   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b5, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12859   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b6, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12860   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b7, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12861
12862   offset += 1;
12863
12864   return offset;
12865 }
12866
12867 static int
12868 dissect_ht_info_ie_1_0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
12869                        guint32 tag_len, proto_item *ti_len)
12870 {
12871   proto_item *cap_item;
12872   proto_tree *cap_tree;
12873
12874   if (tag_len != 22) {
12875     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12876                            "Tag length %u wrong, must be = 22", tag_len);
12877     return offset;
12878   }
12879
12880   if (wlan_ignore_draft_ht)
12881     return offset;
12882
12883   /* 1 HT Control Channel */
12884   proto_tree_add_item(tree, hf_ieee80211_hta_cc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12885   offset += 1;
12886
12887   /* 1 byte HT additional capabilities */
12888   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 1,
12889              ENC_LITTLE_ENDIAN);
12890   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap_tree);
12891
12892   proto_tree_add_item(cap_tree, hf_ieee80211_hta_ext_chan_offset, tvb, offset, 1,
12893              ENC_LITTLE_ENDIAN);
12894   proto_tree_add_item(cap_tree, hf_ieee80211_hta_rec_tx_width, tvb, offset, 1,
12895              ENC_LITTLE_ENDIAN);
12896   proto_tree_add_item(cap_tree, hf_ieee80211_hta_rifs_mode, tvb, offset, 1,
12897              ENC_LITTLE_ENDIAN);
12898   proto_tree_add_item(cap_tree, hf_ieee80211_hta_controlled_access, tvb, offset, 1,
12899              ENC_LITTLE_ENDIAN);
12900   proto_tree_add_item(cap_tree, hf_ieee80211_hta_service_interval, tvb, offset, 1,
12901              ENC_LITTLE_ENDIAN);
12902   offset += 1;
12903
12904   /* 2 byte HT additional capabilities */
12905   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 2,
12906              ENC_LITTLE_ENDIAN);
12907   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap1_tree);
12908
12909   proto_tree_add_item(cap_tree, hf_ieee80211_hta_operating_mode, tvb, offset, 2,
12910              ENC_LITTLE_ENDIAN);
12911   proto_tree_add_item(cap_tree, hf_ieee80211_hta_non_gf_devices, tvb, offset, 2,
12912              ENC_LITTLE_ENDIAN);
12913
12914   offset += 2;
12915
12916   /* 2 byte HT additional capabilities */
12917   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 2,
12918              ENC_LITTLE_ENDIAN);
12919   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap2_tree);
12920
12921   proto_tree_add_item(cap_tree, hf_ieee80211_hta_basic_stbc_mcs, tvb, offset, 2,
12922              ENC_LITTLE_ENDIAN);
12923   proto_tree_add_item(cap_tree, hf_ieee80211_hta_dual_stbc_protection, tvb, offset, 2,
12924              ENC_LITTLE_ENDIAN);
12925   proto_tree_add_item(cap_tree, hf_ieee80211_hta_secondary_beacon, tvb, offset, 2,
12926              ENC_LITTLE_ENDIAN);
12927   proto_tree_add_item(cap_tree, hf_ieee80211_hta_lsig_txop_protection, tvb, offset, 2,
12928              ENC_LITTLE_ENDIAN);
12929   proto_tree_add_item(cap_tree, hf_ieee80211_hta_pco_active, tvb, offset, 2,
12930              ENC_LITTLE_ENDIAN);
12931   proto_tree_add_item(cap_tree, hf_ieee80211_hta_pco_phase, tvb, offset, 2,
12932              ENC_LITTLE_ENDIAN);
12933   offset += 2;
12934
12935   /* 16 byte Supported MCS set */
12936   offset = dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
12937
12938   return offset;
12939 }
12940
12941 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
12942
12943 /*
12944  * 8.2.4.1.10 "Order field" says:
12945  *
12946  *  The Order field is 1 bit in length. It is used for two purposes:
12947  *
12948  *    -- It is set to 1 in a non-QoS data frame transmitted by a non-QoS
12949  *       STA to indicate that the frame contains an MSDU, or fragment
12950  *       thereof, that is being transferred using the StrictlyOrdered
12951  *       service class.
12952  *
12953  *    -- It is set to 1 in a QoS data or management frame transmitted
12954  *       with a value of HT_GF or HT_MF for the FORMAT parameter of the
12955  *       TXVECTOR to indicate that the frame contains an HT Control field.
12956  *
12957  * 802.11ac changes the second of those clauses to say "HT_GF, HT_MF,
12958  * or VHT", indicates that bit B0 of the field is 0 for HT and 1 for
12959  * VHT (stealing a reserved bit from the Link Adaptation Control field),
12960  * and that everything except for "AC Constraint" and "RDG/More Cowbell^W
12961  * PPDU" is different for the VHT version.
12962  *
12963  * I read the second clause of 8.2.4.1.10 "Order field", as modified by
12964  * 802.11ac, as meaning that, for QoS data and management frames, the
12965  * Order field will *only* be set to 1 for HT or VHT frames, and therefore
12966  * that we do *not* have to determine, from radio metadata, whether the
12967  * frame was transmitted as an HT or VHT frame.
12968  *
12969  * (See bug 11351, in which a frame with an HT Control field, with a
12970  * radiotap header, lacks the MCS or VHT fields in the radiotap header,
12971  * so Wireshark has no clue that it's an HT or VHT field, and misdissected
12972  * the packet.  Omnipeek, which also appeared to have no clue that it was
12973  * an HT or VHT field - it called it an 802.11b frame - *did* dissect the
12974  * HT Control field.)
12975  */
12976
12977 static void
12978 dissect_ht_control(proto_tree *tree, tvbuff_t *tvb, int offset)
12979 {
12980   proto_item *ti;
12981   proto_tree *htc_tree, *lac_subtree, *mfb_subtree;
12982   guint32 htc;
12983
12984   htc = tvb_get_letohl(tvb, offset);
12985
12986   ti = proto_tree_add_item(tree, hf_ieee80211_htc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12987   htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
12988
12989   /* Check the HT vs. VHT bit. */
12990   proto_tree_add_item(htc_tree, hf_ieee80211_htc_vht, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12991   if (htc & HTC_VHT) {
12992     /* VHT */
12993     proto_tree_add_item(htc_tree, hf_ieee80211_htc_mrq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12994     if (!(htc & HTC_UNSOLICITED_MFB)) {
12995       if (htc & HTC_MRQ) {
12996         proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12997       } else {
12998         proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12999       }
13000       proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfsi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13001     } else {
13002       if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
13003         proto_tree_add_item(htc_tree, hf_ieee80211_htc_compressed_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13004         proto_tree_add_item(htc_tree, hf_ieee80211_htc_ppdu_stbc_encoded, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13005       } else {
13006         proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13007       }
13008       proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_l, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13009     }
13010     ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13011     mfb_subtree = proto_item_add_subtree(ti, ett_mfb_subtree);
13012     proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_num_sts, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13013     proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_vht_mcs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13014     proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_bw, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13015     /* This should be converted to dB by adding 22  */
13016     proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_snr, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13017     if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
13018       proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13019       proto_tree_add_item(htc_tree, hf_ieee80211_htc_coding_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13020       proto_tree_add_item(htc_tree, hf_ieee80211_htc_fb_tx_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13021     } else {
13022       proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13023     }
13024     proto_tree_add_item(htc_tree, hf_ieee80211_htc_unsolicited_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13025   } else {
13026     /* Start: Link Adaptation Control */
13027     ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_lac, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13028     lac_subtree = proto_item_add_subtree(ti, ett_lac_subtree);
13029     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_trq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13030
13031     if (HTC_IS_ASELI(htc)) {
13032       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_aseli, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13033     } else {
13034       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_mrq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13035       if (HTC_LAC_MAI_MRQ(htc)) {
13036         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_msi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13037       } else {
13038         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13039       }
13040     }
13041
13042     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13043
13044     if (HTC_IS_ASELI(htc)) {
13045       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13046       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_data, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13047     } else {
13048       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13049     }
13050     /* End: Link Adaptation Control */
13051
13052     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_pos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13053     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_seq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13054     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13055     proto_tree_add_item(htc_tree, hf_ieee80211_htc_csi_steering, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13056
13057     proto_tree_add_item(htc_tree, hf_ieee80211_htc_ndp_announcement, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13058     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13059   }
13060   proto_tree_add_item(htc_tree, hf_ieee80211_htc_ac_constraint, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13061   proto_tree_add_item(htc_tree, hf_ieee80211_htc_rdg_more_ppdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13062
13063   /* offset += 2; */
13064 }
13065
13066 #define IEEE80211_COMMON_OPT_BROKEN_FC         0x00000001
13067 #define IEEE80211_COMMON_OPT_IS_CENTRINO       0x00000002
13068 #define IEEE80211_COMMON_OPT_NORMAL_QOS        0x00000004
13069
13070 static void
13071 dissect_frame_control(proto_tree *tree, tvbuff_t *tvb, guint32 option_flags,
13072                       guint32 offset, packet_info *pinfo)
13073 {
13074   guint16 fcf, flags, frame_type_subtype;
13075   proto_tree *fc_tree, *flag_tree;
13076   proto_item *fc_item, *flag_item, *hidden_item, *ti;
13077
13078   fcf = FETCH_FCF(offset);
13079
13080   flags = FCF_FLAGS(fcf);
13081   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
13082
13083   /* Swap offset... */
13084   if(option_flags & IEEE80211_COMMON_OPT_BROKEN_FC)
13085   {
13086     offset += 1;
13087   }
13088
13089   proto_tree_add_uint(tree, hf_ieee80211_fc_frame_type_subtype, tvb, offset, 1, frame_type_subtype);
13090
13091   fc_item = proto_tree_add_item(tree, hf_ieee80211_fc_field, tvb, offset, 2, ENC_BIG_ENDIAN);
13092
13093   fc_tree = proto_item_add_subtree(fc_item, ett_fc_tree);
13094
13095   proto_tree_add_item(fc_tree, hf_ieee80211_fc_proto_version, tvb, offset, 1, ENC_NA);
13096   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_type, tvb, offset, 1, ENC_NA);
13097   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_subtype, tvb, offset, 1, ENC_NA);
13098   /* Changing control frame extension for extension frames */
13099   if(IS_FRAME_EXTENSION(fcf) == 1) {
13100     proto_tree_add_uint(fc_tree, hf_ieee80211_fc_frame_extension, tvb, offset, 1, FCF_FRAME_EXTENSION(fcf));
13101   }
13102   offset += 1;
13103
13104   /* Reswap offset...*/
13105   if(option_flags & IEEE80211_COMMON_OPT_BROKEN_FC)
13106   {
13107     offset -= 1;
13108     proto_item_append_text(fc_item, "(Swapped)");
13109   }
13110
13111   /* Flags */
13112   flag_item = proto_tree_add_item(fc_tree, hf_ieee80211_fc_flags, tvb, offset, 1, ENC_NA);
13113   flag_tree = proto_item_add_subtree(flag_item, ett_proto_flags);
13114   /* Changing control frame flags for extension frames */
13115   if(IS_FRAME_EXTENSION(fcf) == 0) {
13116     proto_tree_add_item(flag_tree, hf_ieee80211_fc_data_ds, tvb, offset, 1, ENC_NA);
13117     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_to_ds, tvb, offset, 1, ENC_NA);
13118     PROTO_ITEM_SET_HIDDEN(hidden_item);
13119     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_from_ds, tvb, offset, 1, ENC_NA);
13120     PROTO_ITEM_SET_HIDDEN(hidden_item);
13121     proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_frag, tvb, offset, 1, ENC_NA);
13122     ti = proto_tree_add_item(flag_tree, hf_ieee80211_fc_retry, tvb, offset, 1, ENC_NA);
13123     if( IS_RETRY(flags) )
13124     {
13125       expert_add_info(pinfo, ti, &ei_ieee80211_fc_retry);
13126       wlan_stats.fc_retry = 1;
13127     }
13128   }
13129   proto_tree_add_item(flag_tree, hf_ieee80211_fc_pwr_mgt, tvb, offset, 1, ENC_NA);
13130   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_data, tvb, offset, 1, ENC_NA);
13131   /* Changing control frame flags for extension frames */
13132   if(IS_FRAME_EXTENSION(fcf) == 0) {
13133     proto_tree_add_item(flag_tree, hf_ieee80211_fc_protected, tvb, offset, 1, ENC_NA);
13134   }
13135   proto_tree_add_item(flag_tree, hf_ieee80211_fc_order, tvb, offset, 1, ENC_NA);
13136 }
13137
13138 static void
13139 dissect_durid(proto_tree *hdr_tree, tvbuff_t *tvb, guint16 fts, gint offset)
13140 {
13141   guint16 durid = tvb_get_letohs(tvb, offset);
13142
13143   if (durid < 0x8000) {
13144     proto_tree_add_uint_format_value(hdr_tree, hf_ieee80211_did_duration, tvb,
13145       offset, 2, durid, "%u microseconds", durid);
13146   } else if (((durid & 0xC000) == 0xC000) &&
13147              ((durid & 0x3FFF) > 0) && ((durid & 0x3FFF) <= 2007) &&
13148              (fts == CTRL_PS_POLL)) {
13149     proto_tree_add_item(hdr_tree, hf_ieee80211_assoc_id, tvb, offset, 2,
13150       ENC_LITTLE_ENDIAN);
13151   } else if (durid == 0x8000) {
13152     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
13153       offset, 2, durid, "Duration/ID: %u", durid);
13154   } else {
13155     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
13156       offset, 2, durid, "Duration/ID: %u (reserved)", durid & 0x3FFF);
13157   }
13158 }
13159
13160
13161 static void
13162 dissect_vendor_ie_ht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
13163                     guint offset, proto_item *item, proto_item *ti_len, gint tag_len)
13164 {
13165
13166   guint8 type;
13167
13168   proto_tree_add_item(tree, hf_ieee80211_ht_pren_type, tvb, offset, 1, ENC_NA);
13169   type = tvb_get_guint8(tvb, offset);
13170   offset += 1;
13171   tag_len -= 1;
13172
13173
13174   switch(type){
13175     case 51:
13176       dissect_ht_capability_ie(tvb, pinfo, tree, offset, tag_len, ti_len, TRUE);
13177       proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
13178     break;
13179
13180     case 52:
13181       dissect_ht_info_ie_1_0(tvb, pinfo, tree, offset, tag_len, ti_len);
13182       proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
13183     break;
13184
13185     default:
13186       proto_tree_add_item(tree, hf_ieee80211_ht_pren_unknown, tvb, offset, tag_len, ENC_NA);
13187     break;
13188   }
13189
13190 }
13191
13192 static guint
13193 dissect_interworking(packet_info *pinfo, proto_tree *tree, proto_item *item,
13194                      tvbuff_t *tvb, int offset)
13195 {
13196   guint8 len;
13197
13198   offset += 1;
13199   len = tvb_get_guint8(tvb, offset);
13200   offset += 1;
13201
13202   if ((tvb_reported_length_remaining(tvb, offset) < len) || (len == 0)) {
13203     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13204                            "Truncated Interworking element");
13205     return offset;
13206   }
13207
13208   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_access_network_type,
13209                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13210   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_internet,
13211                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13212   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_asra,
13213                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13214   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_esr,
13215                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13216   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_uesa,
13217                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13218   offset += 1;
13219
13220   if ((len == (1 + 2)) || (len == (1 + 2 + 6))) {
13221     dissect_venue_info(tree, tvb, offset);
13222     offset += 2;
13223   }
13224
13225   if ((len == (1 + 6)) || (len == (1 + 2 + 6))) {
13226     proto_tree_add_item(tree, hf_ieee80211_tag_interworking_hessid,
13227                         tvb, offset, 6, ENC_NA);
13228     offset += 6;
13229   }
13230
13231   if ((len != 1) && (len != (1 + 2)) && (len != (1 + 6)) && (len != (1 + 2 + 6))) {
13232     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13233                            "Invalid Interworking element length");
13234   }
13235
13236   return offset;
13237 }
13238
13239 static guint
13240 dissect_qos_map_set(packet_info *pinfo, proto_tree *tree, proto_item *item,
13241                     tvbuff_t *tvb, int offset)
13242 {
13243   guint8 len, left;
13244   guint8 val, val2;
13245   int i;
13246   proto_item *dscp_item;
13247   proto_tree *dscp_tree;
13248
13249   offset++;
13250   len = tvb_get_guint8(tvb, offset);
13251   offset++;
13252
13253   if (tvb_reported_length_remaining(tvb, offset) < len || len < 16 || len & 1) {
13254     expert_add_info_format(pinfo, item, &ei_ieee80211_bad_length,
13255                                 "Truncated QoS Map Set element");
13256     return 2 + len;
13257   }
13258
13259   left = len - 16;
13260   while (left >= 2) {
13261     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_dscp_exc,
13262                                     tvb, offset, 2, ENC_NA);
13263     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
13264
13265     item = proto_tree_add_item(dscp_tree,
13266                                hf_ieee80211_tag_qos_map_set_dscp_exc_val,
13267                                tvb, offset, 1, ENC_NA);
13268     val = tvb_get_guint8(tvb, offset);
13269     if (val > 63 && val != 255) {
13270       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
13271                                   "Invalid DSCP Value");
13272     }
13273     offset++;
13274
13275     item = proto_tree_add_item(dscp_tree,
13276                                hf_ieee80211_tag_qos_map_set_dscp_exc_up,
13277                                tvb, offset, 1, ENC_NA);
13278     val2 = tvb_get_guint8(tvb, offset);
13279     if (val2 > 7) {
13280       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
13281                                   "Invalid User Priority");
13282     }
13283     offset++;
13284
13285     proto_item_append_text(dscp_item, " (0x%02x: UP %u)", val, val2);
13286
13287     left -= 2;
13288   }
13289
13290   for (i = 0; i < 8; i++) {
13291     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_range,
13292                                     tvb, offset, 2, ENC_NA);
13293     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
13294
13295     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_low,
13296                                tvb, offset, 1, ENC_NA);
13297     val = tvb_get_guint8(tvb, offset);
13298     if (val > 63 && val != 255) {
13299       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
13300                                   "Invalid DSCP Value");
13301     }
13302     offset++;
13303
13304     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_high,
13305                                tvb, offset, 1, ENC_NA);
13306     val2 = tvb_get_guint8(tvb, offset);
13307     if ((val2 > 63 && val2 != 255) || val2 < val ||
13308         (val == 255 && val2 != 255) || (val != 255 && val2 == 255)) {
13309       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
13310                                   "Invalid DSCP Value");
13311     }
13312     offset++;
13313
13314     if (val == 255 && val2 == 255) {
13315       proto_item_append_text(dscp_item, " (UP %u not in use)", i);
13316     } else {
13317       proto_item_append_text(dscp_item, " (0x%02x-0x%02x: UP %u)",
13318                              val, val2, i);
13319     }
13320   }
13321
13322   return 2 + len;
13323 }
13324
13325 static guint
13326 dissect_roaming_consortium(packet_info *pinfo, proto_tree *tree,
13327                            proto_item *item, tvbuff_t *tvb, int offset)
13328 {
13329   guint8 len, oi_lens, oi1_len, oi2_len;
13330   int end;
13331
13332   offset += 1;
13333   len = tvb_get_guint8(tvb, offset);
13334   offset += 1;
13335   end = offset + len;
13336
13337   if ((tvb_reported_length_remaining(tvb, offset) < len) || (len < 2)) {
13338     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13339                            "Truncated Roaming Consortium element");
13340     return 2 + len;
13341   }
13342
13343   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
13344                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13345   offset += 1;
13346
13347   oi_lens = tvb_get_guint8(tvb, offset);
13348   oi1_len = oi_lens & 0x0f;
13349   oi2_len = (oi_lens & 0xf0) >> 4;
13350   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1_len,
13351                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13352   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2_len,
13353                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13354   offset += 1;
13355
13356   if (offset + oi1_len > end) {
13357     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13358                            "Truncated Roaming Consortium element");
13359     return 2 + len;
13360   }
13361
13362   item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1,
13363                              tvb, offset, oi1_len, ENC_NA);
13364   add_manuf(item, tvb, offset);
13365   offset += oi1_len;
13366
13367   if (offset + oi2_len > end) {
13368     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13369                            "Truncated Roaming Consortium element");
13370     return 2 + len;
13371   }
13372
13373   if (oi2_len > 0) {
13374     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2,
13375                         tvb, offset, oi2_len, ENC_NA);
13376     offset += oi2_len;
13377   }
13378
13379   if (end > offset) {
13380     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi3,
13381                         tvb, offset, end - offset, ENC_NA);
13382   }
13383
13384   return 2 + len;
13385 }
13386
13387
13388 /* ************************************************************************* */
13389 /*           Dissect and add tagged (optional) fields to proto tree          */
13390 /* ************************************************************************* */
13391
13392 static int beacon_padding = 0; /* beacon padding bug */
13393
13394 static int
13395 ieee80211_tag_ssid(packet_info *pinfo, proto_tree *tree,
13396                    proto_item *ti, proto_item *ti_len,
13397                    guint32 tag_len, tvbuff_t *tvb, int offset)
13398 {
13399   /* 7.3.2.1 SSID element (0) */
13400   gchar *ssid; /* The SSID may consist of arbitrary bytes */
13401   gint ssid_len = tag_len;
13402
13403   if (beacon_padding != 0) /* padding bug */
13404     return offset;
13405
13406   if (ssid_len > MAX_SSID_LEN) {
13407     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13408                            "SSID length (%u) greater than maximum (%u)",
13409                            ssid_len, MAX_SSID_LEN);
13410     ssid_len = MAX_SSID_LEN;
13411   }
13412
13413   /*
13414    * XXX - the 802.11 specs aren't particularly clear on how the SSID
13415    * is to be interpreted.
13416    *
13417    * IEEE Std 802.11-1999, section 7.3.2.2 "Service Set Identity (SSID)
13418    * element" says just
13419    *
13420    *    The length of the SSID information field is between 0 and 32
13421    *    octets. A 0 length information field indicates the broadcast SSID.
13422    *
13423    * with no indication that those octets encode a string.
13424    *
13425    * IEEE Std 802.11-2012, section 8.4.2.2 "SSID element", says that *but*
13426    * says after it
13427    *
13428    *    When the UTF-8 SSID subfield of the Extended Capabilities element
13429    *    is equal to 1 in the frame that includes the SSID element, the
13430    *    SSID is interpreted using UTF-8 encoding.
13431    *
13432    *    NOTE -- This is true for Beacon and Probe Response frames when the
13433    *    MLME-START.request primitive was issued with the SSIDEncoding
13434    *    parameter equal to UTF-8.
13435    *
13436    * and the SSIDEncoding parameter can either be UNSPECIFIED or UTF-8.
13437    *
13438    * So I *guess* that means that, if the UTF-8 SSID subfield isn't
13439    * equal to 1, the SSID is, in theory, just a bunch of octets, but
13440    * in practice, *probably* ASCII as that's the typical convention,
13441    * and, if it is equal to 1, it's a UTF-8 string.  (Of course, a
13442    * host can put anything there it wants to, so we shouldn't just
13443    * assume that it's *valid* ASCII or *valid* UTF-8.)
13444    *
13445    * So we really should extract it as an array of ssid_len bytes,
13446    * pass those bytes to AirPDcapSetLastSSID(), and:
13447    *
13448    *    If the UTF-8 SSID subfield isn't set to 1, put the SSID in
13449    *    as an ENC_ASCII string;
13450    *
13451    *    If the UTF-8 SSID subfield is set to 1, put it in as an
13452    *    ENC_UTF_8 string;
13453    *
13454    * and rely on the libwireshark core code to somehow deal with
13455    * non-ASCII characters or invalid UTF-8 sequences or valid-but-
13456    * not-all-printable ASCII or UTF-8 strings in the protocol tree
13457    * display.  I'm not sure we can currently rely on it to handle
13458    * invalid UTF-8 or non-printable characters in UTF-8 strings,
13459    * however, so we just treat it as ASCII for now.
13460    *
13461    * We also need a better way of getting the display format of a
13462    * string value, so we can do something other than run it through
13463    * format_text(), which won't handle UTF-8.
13464    */
13465   ssid = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, ssid_len, ENC_ASCII);
13466   if (ssid_len == (gint)tag_len) {
13467     AirPDcapSetLastSSID(&airpdcap_ctx, (CHAR *) ssid, ssid_len);
13468   }
13469   proto_tree_add_item(tree, hf_ieee80211_tag_ssid, tvb, offset + 2, tag_len,
13470                       ENC_ASCII|ENC_NA);
13471
13472   if (ssid_len > 0) {
13473     gchar* s = format_text_wmem(wmem_packet_scope(), ssid, ssid_len);
13474     proto_item_append_text(ti, ": %s", s);
13475
13476     col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", s);
13477
13478     /* Wlan Stats */
13479     memcpy(wlan_stats.ssid, ssid, MIN(ssid_len, MAX_SSID_LEN));
13480     wlan_stats.ssid_len = ssid_len;
13481   } else {
13482     proto_item_append_text(ti, ": Broadcast");
13483
13484     col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Broadcast");
13485   }
13486
13487   beacon_padding += 1; /* padding bug */
13488
13489   return offset + 2 + tag_len;
13490 }
13491
13492 static int
13493 dissect_neighbor_report(tvbuff_t *tvb, packet_info *pinfo,
13494                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
13495                           int tag_end, proto_item *ti _U_)
13496 {
13497
13498   guint8 sub_tag_id;
13499   guint32 sub_tag_length;
13500   proto_item *parent_item;
13501   proto_tree *bssid_info_subtree, *bssid_info_cap_subtree, *sub_tag_tree;
13502   tvbuff_t *sub_tag_tvb = NULL;
13503
13504   if (tag_len < 13) {
13505     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13506                            "Neighbor Report length %u wrong, must be > 13", tag_len);
13507     return offset;
13508   }
13509
13510   /* tag_offset = offset; */
13511
13512   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid, tvb, offset, 6, ENC_NA);
13513   offset += 6;
13514
13515   /*** Begin: BSSID Information ***/
13516
13517   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid_info, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13518   bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
13519
13520   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reachability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13521   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_security, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13522   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13523  parent_item = proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13524   bssid_info_cap_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_capability_tree);
13525   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13526   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13527   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13528   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13529   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13530   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13531   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13532   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13533   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13534   offset += 4;
13535
13536   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_ope_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13537   offset += 1;
13538
13539   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13540   offset += 1;
13541
13542   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13543   offset += 1;
13544
13545   /* The Optional Subelements field format contains zero or more subelements */
13546   if (tag_len == 13){ /* tag_len == 13 => no Subelements */
13547         return offset;
13548   }
13549
13550   while (offset < tag_end)
13551   {
13552
13553     sub_tag_id = tvb_get_guint8(tvb, offset);
13554     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13555     offset += 1;
13556
13557     sub_tag_length = tvb_get_guint8(tvb, offset);
13558     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13559     offset += 1;
13560     sub_tag_tvb = tvb_new_subset_length(tvb, offset, sub_tag_length);
13561
13562     switch (sub_tag_id) {
13563       case NR_SUB_ID_TSF_INFO:
13564         /* TODO */
13565         break;
13566       case NR_SUB_ID_MEASUREMENT_PILOT_INFO:
13567         /* TODO */
13568         break;
13569       case NR_SUB_ID_HT_CAPABILITIES:
13570         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
13571                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Capabilities");
13572         dissect_ht_capability_ie(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len, FALSE);
13573         break;
13574       case NR_SUB_ID_HT_OPERATION:
13575         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
13576                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Information");
13577         dissect_ht_info_ie_1_1(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len);
13578         break;
13579       case NR_SUB_ID_SEC_CHANNEL_OFFSET:
13580         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
13581                             ett_tag_neighbor_report_sub_tag_tree, NULL, "Secondary Channel Offset");
13582         dissect_secondary_channel_offset_ie(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len);
13583         break;
13584       case NR_SUB_ID_VENDOR_SPECIFIC:
13585         default:
13586         break;
13587     }
13588
13589   offset += sub_tag_length;
13590 }
13591
13592   return offset;
13593 }
13594
13595 static int
13596 ieee80211_tag_supp_rates(packet_info *pinfo, proto_tree *tree,
13597                          proto_item *ti, proto_item *ti_len,
13598                          guint32 tag_len, tvbuff_t *tvb,
13599                          int offset, int tag_end)
13600 {
13601   /* 7.3.2.2 Supported Rates element (1) */
13602   if (tag_len < 1) {
13603     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13604                            "Tag length %u too short, must be greater than 0",
13605                            tag_len);
13606     return offset;
13607   }
13608
13609   offset += 2;
13610
13611   while (offset < tag_end) {
13612     proto_tree_add_item(tree, hf_ieee80211_tag_supp_rates, tvb, offset, 1,
13613                         ENC_LITTLE_ENDIAN);
13614     proto_item_append_text(ti, " %s,",
13615                            val_to_str_ext_const(tvb_get_guint8(tvb, offset),
13616                                                 &ieee80211_supported_rates_vals_ext,
13617                                                 "Unknown Rate"));
13618     offset += 1;
13619   }
13620
13621   proto_item_append_text(ti, " [Mbit/sec]");
13622
13623   return offset;
13624 }
13625
13626 static int
13627 ieee80211_tag_fh_parameter(packet_info *pinfo, proto_tree *tree,
13628                            proto_item *ti_len, guint32 tag_len,
13629                            tvbuff_t *tvb, int offset)
13630 {
13631   /* 7.3.2.3 FH Parameter Set element (2) */
13632   if (tag_len < 5) {
13633     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13634                            "Tag length %u too short, must be >= 5", tag_len);
13635     return offset;
13636   }
13637
13638   offset += 2;
13639
13640   proto_tree_add_item(tree, hf_ieee80211_tag_fh_dwell_time,
13641                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13642   offset += 2;
13643
13644   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_set,
13645                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13646   offset += 1;
13647
13648   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_pattern,
13649                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13650   offset += 1;
13651
13652   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_index,
13653                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13654   offset += 1;
13655
13656   return offset;
13657 }
13658
13659 static int
13660 ieee80211_tag_ds_parameter(packet_info *pinfo, proto_tree *tree,
13661                            proto_item *ti, proto_item *ti_len,
13662                            guint32 tag_len, tvbuff_t *tvb,
13663                            int offset)
13664 {
13665   /* 7.3.2.4 DS Parameter Set element (3) */
13666   if (tag_len != 1) {
13667     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13668         "Tag length %u wrong, must be = 1", tag_len);
13669     return offset;
13670   }
13671
13672   offset += 2;
13673
13674   proto_tree_add_item(tree, hf_ieee80211_tag_ds_param_channel,
13675         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13676
13677   proto_item_append_text(ti, ": Current Channel: %u",
13678                          tvb_get_guint8(tvb, offset));
13679
13680   wlan_stats.channel = tvb_get_guint8(tvb, offset);
13681   offset += 1;
13682
13683   return offset;
13684 }
13685
13686 static int
13687 ieee80211_tag_cf_parameter(packet_info *pinfo, proto_tree *tree,
13688                            proto_item *ti, proto_item *ti_len,
13689                            guint32 tag_len, tvbuff_t *tvb,
13690                            int offset)
13691 {
13692   /* 7.3.2.5 CF Parameter Set element (4) */
13693   if (tag_len != 6) {
13694     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13695                            "Tag length %u wrong, must be = 6", tag_len);
13696     return offset;
13697   }
13698
13699   offset += 2;
13700
13701   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_count,
13702                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13703   proto_item_append_text(ti, ": CFP count %u", tvb_get_guint8(tvb, offset));
13704   offset += 1;
13705
13706   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_period,
13707                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13708   proto_item_append_text(ti, ": CFP Period %u", tvb_get_guint8(tvb, offset));
13709   offset += 1;
13710
13711   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_max_duration,
13712                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13713   proto_item_append_text(ti, ": CFP Max Duration %u",
13714                          tvb_get_letohs(tvb, offset));
13715   offset += 2;
13716
13717   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_dur_remaining,
13718                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13719   proto_item_append_text(ti, ": CFP Dur Remaining %u",
13720                          tvb_get_letohs(tvb, offset));
13721   offset += 1;
13722
13723   return offset;
13724 }
13725
13726 static int
13727 ieee80211_tag_tim(packet_info *pinfo, proto_tree *tree,
13728                   proto_item *ti, proto_item *ti_len,
13729                   guint32 tag_len, tvbuff_t *tvb, int offset)
13730 {
13731   proto_tree *bmapctl_tree;
13732   proto_item *bmapctl_item;
13733   guint aid, pvb_len, n1, i, j, byte;
13734
13735   /* 802.11-2012: 8.4.2.7 TIM element (5) */
13736   if (tag_len < 4) {
13737     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13738                            "Tag length %u too short, must be >= 4", tag_len);
13739     return offset;
13740   }
13741
13742   offset += 2;
13743
13744   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_count,
13745                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13746   proto_item_append_text(ti, ": DTIM %u of", tvb_get_guint8(tvb, offset));
13747   offset += 1;
13748
13749   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_period,
13750                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13751   proto_item_append_text(ti, " %u bitmap", tvb_get_guint8(tvb, offset + 1));
13752   offset += 1;
13753
13754   bmapctl_item = proto_tree_add_item(tree, hf_ieee80211_tim_bmapctl,
13755                                      tvb, offset, 1, ENC_LITTLE_ENDIAN);
13756   bmapctl_tree = proto_item_add_subtree(bmapctl_item, ett_tag_bmapctl_tree);
13757   proto_tree_add_item(bmapctl_tree, hf_ieee80211_tim_bmapctl_mcast,
13758                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13759   proto_tree_add_item(bmapctl_tree, hf_ieee80211_tim_bmapctl_offset,
13760                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13761   pvb_len = tag_len - 3;
13762   n1 = tvb_get_guint8(tvb, offset) & 0xFE;
13763   offset += 1;
13764
13765   proto_tree_add_item(tree, hf_ieee80211_tim_partial_virtual_bitmap,
13766                       tvb, offset, pvb_len, ENC_NA);
13767   /* FIXME: Handles dot11MgmtOptionMultiBSSIDActivated = false only */
13768   for (i = 0; i < pvb_len; i++) {
13769     byte = tvb_get_guint8(tvb, offset + i);
13770     for (j = 0; j < 8; j++) {
13771       if (byte & (1 << j)) {
13772         aid = 8*n1 + 8*i + j;
13773         proto_tree_add_uint(tree, hf_ieee80211_tim_aid, tvb, offset + i, 1, aid);
13774       }
13775     }
13776   }
13777   offset += pvb_len;
13778
13779   return offset;
13780 }
13781
13782 static int
13783 ieee80211_tag_ibss_parameter(packet_info *pinfo, proto_tree *tree,
13784                              proto_item *ti, proto_item *ti_len,
13785                              guint32 tag_len, tvbuff_t *tvb,
13786                              int offset)
13787 {
13788   /* 7.3.2.7 IBSS Parameter Set element (6) */
13789
13790   if (tag_len != 2) {
13791     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13792                            "Tag length %u wrong, must be = 2", tag_len);
13793     return offset;
13794   }
13795
13796   offset += 2;
13797
13798   proto_tree_add_item(tree, hf_ieee80211_tag_ibss_atim_window,
13799                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13800   proto_item_append_text(ti, ": ATIM window 0x%x",
13801                          tvb_get_letohs(tvb, offset));
13802   offset += 2;
13803
13804   return offset;
13805 }
13806
13807 static const value_string environment_vals[] = {
13808   { 0x20, "Any" },
13809   { 0x4f, "Outdoor" },
13810   { 0x49, "Indoor" },
13811   { 0,    NULL }
13812 };
13813
13814 static int
13815 ieee80211_tag_country_info(packet_info *pinfo, proto_tree *tree,
13816                            proto_item *ti, proto_item *ti_len,
13817                            guint32 tag_len, tvbuff_t *tvb,
13818                            int offset, int tag_end)
13819 {
13820   /* 7.3.2.9 Country information element (7) */
13821   proto_tree *sub_tree;
13822   proto_item *sub_item;
13823   const guint8* country_code;
13824
13825   if (tag_len < 6) {
13826     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13827                            "Tag length %u too short, must be >= 6", tag_len);
13828     return offset;
13829   }
13830
13831   offset += 2;
13832
13833   proto_tree_add_item_ret_string(tree, hf_ieee80211_tag_country_info_code,
13834                       tvb, offset, 2, ENC_ASCII|ENC_NA, wmem_packet_scope(), &country_code);
13835   proto_item_append_text(ti, ": Country Code %s", country_code);
13836   offset += 2;
13837
13838   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_env,
13839                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13840   proto_item_append_text(ti, ", Environment %s",
13841                          val_to_str(tvb_get_guint8(tvb, offset),
13842                                     environment_vals, "Unknown (0x%02x)"));
13843   offset += 1;
13844
13845   while (offset < tag_end) {
13846     /* Padding ? */
13847     if ((tag_end - offset) < 3) {
13848       proto_tree_add_item(tree, hf_ieee80211_tag_country_info_pad,
13849                           tvb, offset, 1, ENC_NA);
13850       offset += 1;
13851       continue;
13852     }
13853     if (tvb_get_guint8(tvb, offset) <= 200) { /* 802.11d */
13854       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_fnm,
13855                                      tvb, offset, 3, ENC_NA);
13856       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_fnm_tree);
13857
13858       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_fcn,
13859                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13860       proto_item_append_text(sub_item, ": First Channel Number: %d",
13861                              tvb_get_guint8(tvb, offset));
13862       offset += 1;
13863       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_nc,
13864                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13865       proto_item_append_text(sub_item, ", Number of Channels: %d",
13866                              tvb_get_guint8(tvb, offset));
13867       offset += 1;
13868       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_mtpl,
13869                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13870       proto_item_append_text(sub_item,
13871                              ", Maximum Transmit Power Level: %d dBm",
13872                              tvb_get_guint8(tvb, offset));
13873       offset += 1;
13874     } else { /* 802.11j */
13875       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_rrc,
13876                                      tvb, offset, 3, ENC_NA);
13877       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_rcc_tree);
13878
13879       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oei,
13880                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13881       proto_item_append_text(sub_item,
13882                              ": Operating Extension Identifier: %d",
13883                              tvb_get_guint8(tvb, offset));
13884       offset += 1;
13885       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oc,
13886                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13887       proto_item_append_text(sub_item, ", Operating Class: %d",
13888                              tvb_get_guint8(tvb, offset));
13889       offset += 1;
13890       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_cc,
13891                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13892       proto_item_append_text(sub_item, ", Coverage Class: %d",
13893                              tvb_get_guint8(tvb, offset));
13894       offset += 1;
13895     }
13896   }
13897
13898   return offset;
13899 }
13900
13901 static int
13902 ieee80211_tag_fh_hopping_parameter(packet_info *pinfo,
13903                                    proto_tree *tree,
13904                                    proto_item *ti,
13905                                    proto_item *ti_len,
13906                                    guint32 tag_len, tvbuff_t *tvb,
13907                                    int offset)
13908 {
13909   /* 7.3.2.10 Hopping Pattern Parameters information element (8) */
13910   if (tag_len < 2) {
13911     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13912                            "Tag length %u too short, must be >= 2", tag_len);
13913     return offset;
13914   }
13915
13916   offset += 2;
13917
13918   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
13919                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13920   proto_item_append_text(ti, ": Prime Radix: %u", tvb_get_guint8(tvb, offset));
13921   offset += 1;
13922
13923   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
13924                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13925   proto_item_append_text(ti, ", Number of Channels: %u",
13926                          tvb_get_guint8(tvb, offset));
13927   offset += 1;
13928
13929   return offset;
13930 }
13931
13932 static int
13933 ieee80211_tag_fh_hopping_table(packet_info *pinfo, proto_tree *tree,
13934                                proto_item *ti_len,
13935                                guint32 tag_len, tvbuff_t *tvb,
13936                                int offset, int tag_end)
13937 {
13938   /* 7.3.2.11 Hopping Pattern Table information element (9) */
13939   if (tag_len < 4) {
13940     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13941                            "Tag length %u too short, must be >= 4", tag_len);
13942     return offset;
13943   }
13944
13945   offset += 2;
13946
13947   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_flag,
13948                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13949   offset += 1;
13950
13951   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_number_of_sets,
13952                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13953   offset += 1;
13954
13955   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_modulus,
13956                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13957   offset += 1;
13958
13959   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_offset,
13960                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13961   offset += 1;
13962
13963   while (offset < tag_end) {
13964     proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_random_table,
13965                         tvb, offset, 2, ENC_BIG_ENDIAN);
13966     offset += 2;
13967   }
13968
13969   return offset;
13970 }
13971
13972 int
13973 add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype,
13974                  const guint8 *valid_element_ids, guint valid_element_ids_count,
13975                  association_sanity_check_t *association_sanity_check)
13976 {
13977   guint32       oui;
13978   tvbuff_t     *tag_tvb;
13979   const guint8 *tag_data_ptr;
13980   guint32       tag_no, tag_len;
13981   int           n, ret;
13982   char          print_buff[SHORT_STR];
13983   proto_tree   *orig_tree = tree;
13984   proto_item   *ti        = NULL;
13985   proto_item   *ti_len, *ti_tag;
13986   int           tag_end;
13987   gboolean      isDMG;
13988
13989   gboolean     *p_isDMG = ((gboolean*)(p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY)));
13990
13991   isDMG   = p_isDMG ? *p_isDMG : FALSE;
13992   tag_no  = tvb_get_guint8(tvb, offset);
13993   tag_len = tvb_get_guint8(tvb, offset + 1);
13994   tag_end = offset + 2 + tag_len;
13995
13996   if (tree) {
13997     ti = proto_tree_add_item(orig_tree, hf_ieee80211_tag, tvb, offset, 2 + tag_len , ENC_NA);
13998     proto_item_append_text(ti, ": %s", val_to_str_ext(tag_no, &tag_num_vals_ext, "Reserved (%d)"));
13999
14000     tree = proto_item_add_subtree(ti, ett_80211_mgt_ie);
14001
14002   }
14003
14004   ti_tag = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14005   ti_len = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
14006   if (tag_len > (guint)tvb_reported_length_remaining(tvb, offset)) {
14007     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
14008                            "Tag Length is longer than remaining payload");
14009   }
14010
14011   /* If the list of valid elements is restricted, require an Element ID to be
14012    * present in that list. Otherwise stop decoding the value to prevent possible
14013    * infinite recursions due to unexpected elements. */
14014   if (valid_element_ids_count) {
14015     gboolean valid_tag_no;
14016     guint i;
14017
14018     for (i = 0; i < valid_element_ids_count; i++) {
14019       valid_tag_no = valid_element_ids[i] == tag_no;
14020       if (valid_tag_no)
14021         break;
14022     }
14023     if (!valid_tag_no) {
14024       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_number,
14025           "Unexpected Element ID %d", tag_no);
14026       goto end_of_tag;
14027     }
14028   }
14029
14030   switch (tag_no) {
14031   case TAG_SSID:
14032     offset += ieee80211_tag_ssid(pinfo, tree, ti, ti_len, tag_len, tvb,
14033                                  offset);
14034     break;
14035   case TAG_SUPP_RATES:
14036     offset += ieee80211_tag_supp_rates(pinfo, tree, ti, ti_len, tag_len, tvb,
14037                                        offset, tag_end);
14038     break;
14039   case TAG_FH_PARAMETER:
14040     offset += ieee80211_tag_fh_parameter(pinfo, tree, ti_len, tag_len, tvb,
14041                                          offset);
14042     break;
14043   case TAG_DS_PARAMETER:
14044     offset += ieee80211_tag_ds_parameter(pinfo, tree, ti, ti_len, tag_len, tvb,
14045                                          offset);
14046     break;
14047   case TAG_CF_PARAMETER:
14048     offset += ieee80211_tag_cf_parameter(pinfo, tree, ti, ti_len, tag_len, tvb,
14049                                          offset);
14050     break;
14051   case TAG_TIM:
14052     offset += ieee80211_tag_tim(pinfo, tree, ti, ti_len, tag_len, tvb, offset);
14053     break;
14054   case TAG_IBSS_PARAMETER:
14055     offset += ieee80211_tag_ibss_parameter(pinfo, tree, ti, ti_len, tag_len,
14056                                            tvb, offset);
14057     break;
14058   case TAG_COUNTRY_INFO:
14059     offset += ieee80211_tag_country_info(pinfo, tree, ti, ti_len, tag_len, tvb,
14060                                          offset, tag_end);
14061     break;
14062   case TAG_FH_HOPPING_PARAMETER:
14063     offset += ieee80211_tag_fh_hopping_parameter(pinfo, tree, ti, ti_len,
14064                                                  tag_len, tvb, offset);
14065     break;
14066   case TAG_FH_HOPPING_TABLE:
14067     offset += ieee80211_tag_fh_hopping_table(pinfo, tree, ti_len, tag_len,
14068                                              tvb, offset, tag_end);
14069     break;
14070
14071     case TAG_REQUEST: /* 7.3.2.12 Request information element (10) */
14072       while (offset < tag_end)
14073       {
14074         proto_tree_add_item(tree, hf_ieee80211_tag_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14075         offset += 1;
14076       }
14077       break;
14078
14079     case TAG_QBSS_LOAD: /* 7.3.2.28 BSS Load element (11) */
14080                         /* 8.4.2.30 in 802.11-2012 */
14081       if ((tag_len < 4) || (tag_len > 5))
14082       {
14083         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4 or 5", tag_len);
14084         break;
14085       }
14086
14087       if (tag_len == 4)
14088       {
14089         /* QBSS Version 1 */
14090         proto_item_append_text(ti, " Cisco QBSS Version 1 - non CCA");
14091
14092         /* Extract Values */
14093         proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 1);
14094         proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN);
14095         proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
14096         proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
14097       }
14098       else if (tag_len == 5)
14099
14100       {
14101         proto_item *base_item;
14102
14103         /* QBSS Version 2 */
14104         proto_item_append_text(ti, " 802.11e CCA Version");
14105
14106         /* Extract Values */
14107         proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 2);
14108         proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN);
14109         base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
14110         proto_item_append_text(base_item, " (%d%%)", 100*tvb_get_guint8(tvb, offset + 4)/255);
14111         base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 2, ENC_LITTLE_ENDIAN);
14112         proto_item_append_text(base_item, " (%d us/s)", tvb_get_letohs(tvb, offset + 5)*32);
14113       }
14114       break;
14115
14116 #if 0 /* ToDo */
14117   case TAG_EDCA_PARAM_SET: /* 8.4.2.31 in 802-11-2012 */
14118     offset += add_ff_qos_info_ap(tree, tvb, pinfo, offset);
14119     offset += 1;  /* reserved */
14120     offset += 4;  /* AC_BE */
14121     offset += 4;  /* AC_BK */
14122     offset += 4;  /* AC_VI */
14123     offset += 4;  /* AC_VO */
14124     break;
14125 #endif
14126
14127     case TAG_TSPEC: /* TSPEC element (13) */
14128       if (isDMG == FALSE && tag_len != 55)
14129       {
14130         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 55", tag_len);
14131         break;
14132       }
14133       if (isDMG == TRUE && tag_len != 57)
14134       {
14135         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 57", tag_len);
14136         break;
14137       }
14138       offset += 2;
14139
14140       add_ff_qos_ts_info(tree, tvb, pinfo, offset);
14141       offset += 3;
14142
14143       proto_tree_add_item(tree, hf_ieee80211_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14144       offset += 2;
14145
14146       proto_tree_add_item(tree, hf_ieee80211_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14147       offset += 2;
14148
14149       proto_tree_add_item(tree, hf_ieee80211_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14150       offset += 4;
14151
14152       proto_tree_add_item(tree, hf_ieee80211_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14153       offset += 4;
14154
14155       proto_tree_add_item(tree, hf_ieee80211_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14156       offset += 4;
14157
14158       proto_tree_add_item(tree, hf_ieee80211_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14159       offset += 4;
14160
14161       proto_tree_add_item(tree, hf_ieee80211_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14162       offset += 4;
14163
14164       proto_tree_add_item(tree, hf_ieee80211_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14165       offset += 4;
14166
14167       proto_tree_add_item(tree, hf_ieee80211_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14168       offset += 4;
14169
14170       proto_tree_add_item(tree, hf_ieee80211_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14171       offset += 4;
14172
14173       proto_tree_add_item(tree, hf_ieee80211_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14174       offset += 4;
14175
14176       proto_tree_add_item(tree, hf_ieee80211_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14177       offset += 4;
14178
14179       proto_tree_add_item(tree, hf_ieee80211_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14180       offset += 4;
14181
14182       proto_tree_add_item(tree, hf_ieee80211_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14183       offset += 2;
14184
14185       proto_tree_add_item(tree, hf_ieee80211_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14186       offset += 2;
14187
14188       if(isDMG == TRUE) {
14189         proto_tree_add_item(tree, hf_ieee80211_tspec_dmg, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14190         offset +=2;
14191       }
14192
14193       break;
14194
14195     case TAG_TCLAS: /* 7.3.2.31 TCLAS element (14) */
14196       if (tag_len < 6)
14197       {
14198         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 6", tag_len);
14199         break;
14200       }
14201       {
14202       guint8 type;
14203       guint8 version;
14204       proto_item *class_mask;
14205       proto_tree *mask_tree;
14206
14207       offset += 2;
14208       proto_tree_add_item(tree, hf_ieee80211_tclas_up, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14209       offset += 1;
14210
14211       type = tvb_get_guint8(tvb, offset);
14212       proto_tree_add_item(tree, hf_ieee80211_tclas_class_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14213       offset += 1;
14214
14215       class_mask = proto_tree_add_item(tree, hf_ieee80211_tclas_class_mask,
14216                                        tvb, offset, 1, ENC_LITTLE_ENDIAN);
14217       offset += 1;
14218
14219       switch (type)
14220         {
14221           case 0:
14222             offset--;
14223             mask_tree = proto_item_add_subtree(class_mask,
14224                                                ett_tag_tclas_mask_tree);
14225             proto_tree_add_item(mask_tree,
14226                                 hf_ieee80211_tclas_class_mask0_src_addr,
14227                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14228             proto_tree_add_item(mask_tree,
14229                                 hf_ieee80211_tclas_class_mask0_dst_addr,
14230                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14231             proto_tree_add_item(mask_tree,
14232                                 hf_ieee80211_tclas_class_mask0_type,
14233                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14234             offset++;
14235
14236             proto_tree_add_item(tree, hf_ieee80211_tclas_src_mac_addr, tvb, offset, 6, ENC_NA);
14237             offset += 6;
14238
14239             proto_tree_add_item(tree, hf_ieee80211_tclas_dst_mac_addr, tvb, offset, 6, ENC_NA);
14240             offset += 6;
14241
14242             proto_tree_add_item(tree, hf_ieee80211_tclas_ether_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14243             offset += 2;
14244             break;
14245
14246           case 1:
14247             version = tvb_get_guint8(tvb, offset);
14248             offset--;
14249
14250             mask_tree = proto_item_add_subtree(class_mask,
14251                                                ett_tag_tclas_mask_tree);
14252             proto_tree_add_item(mask_tree,
14253                                 hf_ieee80211_tclas_class_mask1_ver,
14254                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14255             proto_tree_add_item(mask_tree,
14256                                 hf_ieee80211_tclas_class_mask1_src_ip,
14257                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14258             proto_tree_add_item(mask_tree,
14259                                 hf_ieee80211_tclas_class_mask1_dst_ip,
14260                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14261             proto_tree_add_item(mask_tree,
14262                                 hf_ieee80211_tclas_class_mask1_src_port,
14263                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14264             proto_tree_add_item(mask_tree,
14265                                 hf_ieee80211_tclas_class_mask1_dst_port,
14266                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14267             if (version == 4) {
14268               proto_tree_add_item(mask_tree,
14269                                   hf_ieee80211_tclas_class_mask1_ipv4_dscp,
14270                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
14271               proto_tree_add_item(mask_tree,
14272                                   hf_ieee80211_tclas_class_mask1_ipv4_proto,
14273                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
14274             } else {
14275               proto_tree_add_item(mask_tree,
14276                                   hf_ieee80211_tclas_class_mask1_ipv6_flow,
14277                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
14278             }
14279             offset += 1;
14280
14281             proto_tree_add_item(tree, hf_ieee80211_tclas_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14282             offset += 1;
14283             if (version == 4)
14284             {
14285               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
14286               offset += 4;
14287               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
14288               offset += 4;
14289               proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
14290               offset += 2;
14291               proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
14292               offset += 2;
14293               proto_tree_add_item(tree, hf_ieee80211_tclas_dscp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14294               offset += 1;
14295               proto_tree_add_item(tree, hf_ieee80211_tclas_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14296               offset += 1;
14297             }
14298             else if (version == 6)
14299             {
14300               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_src, tvb, offset, 16, ENC_NA);
14301               offset += 16;
14302               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_dst, tvb, offset, 16, ENC_NA);
14303               offset += 16;
14304               proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
14305               offset += 2;
14306               proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
14307               offset += 2;
14308               proto_tree_add_item(tree, hf_ieee80211_tclas_flow, tvb, offset, 3, ENC_BIG_ENDIAN);
14309               offset += 3;
14310             }
14311             break;
14312
14313           case 2:
14314             offset--;
14315             mask_tree = proto_item_add_subtree(class_mask,
14316                                                ett_tag_tclas_mask_tree);
14317             proto_tree_add_item(mask_tree,
14318                                 hf_ieee80211_tclas_class_mask2_tci,
14319                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14320             offset++;
14321
14322             proto_tree_add_item(tree, hf_ieee80211_tclas_tag_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14323             offset += 2;
14324             break;
14325
14326           default:
14327             break;
14328         }
14329       }
14330       break;
14331
14332     case TAG_SCHEDULE: /* 7.3.2.34 Schedule element (15) */
14333       if (tag_len != 14)
14334       {
14335         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 14", tag_len);
14336         break;
14337       }
14338       offset += 2;
14339
14340       add_ff_schedule_info(tree, tvb, pinfo, offset);
14341       offset += 2;
14342
14343       proto_tree_add_item(tree, hf_ieee80211_sched_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14344       offset += 4;
14345
14346       proto_tree_add_item(tree, hf_ieee80211_sched_srv_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14347       offset += 4;
14348
14349       proto_tree_add_item(tree, hf_ieee80211_sched_spec_int, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14350       offset += 2;
14351       break;
14352
14353     case TAG_CHALLENGE_TEXT: /* 7.3.2.8 Challenge Text element (16) */
14354       offset += 2;
14355       proto_tree_add_item(tree, hf_ieee80211_tag_challenge_text, tvb, offset, tag_len, ENC_NA);
14356       break;
14357
14358     case TAG_POWER_CONSTRAINT: /* 7.3.2.15 Power Constraint element (32) */
14359     {
14360       if (tag_len != 1)
14361       {
14362         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
14363         break;
14364       }
14365       offset += 2;
14366
14367       proto_tree_add_item(tree, hf_ieee80211_tag_power_constraint_local, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14368       proto_item_append_text(ti, ": %d", tvb_get_guint8(tvb, offset));
14369       offset += 1;
14370
14371       break;
14372     }
14373
14374     case TAG_POWER_CAPABILITY: /* 7.3.2.16 Power Capability element (33) */
14375     {
14376       if (tag_len != 2)
14377       {
14378         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
14379         break;
14380       }
14381       offset += 2;
14382
14383       proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_min, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14384       proto_item_append_text(ti, " Min: %d", tvb_get_guint8(tvb, offset));
14385       offset += 1;
14386
14387       proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_max, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14388       proto_item_append_text(ti, ", Max :%d", tvb_get_guint8(tvb, offset));
14389       offset += 1;
14390       break;
14391     }
14392
14393     case TAG_TPC_REQUEST: /* 7.3.2.18 TPC Request element (34) */
14394     {
14395       if (tag_len != 0)
14396       {
14397         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 0", tag_len);
14398         break;
14399       }
14400       offset += 2;
14401
14402       /* No Data */
14403       break;
14404     }
14405
14406     case TAG_TPC_REPORT: /* 7.3.2.18 TPC Report element (35) */
14407     {
14408       if (tag_len != 2)
14409       {
14410         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
14411         break;
14412       }
14413       offset += 2;
14414
14415       proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_trsmt_pow, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14416       proto_item_append_text(ti, " Transmit Power: %d", tvb_get_guint8(tvb, offset));
14417       offset += 1;
14418
14419       proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_link_mrg, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14420       proto_item_append_text(ti, ", Link Margin: %d", tvb_get_guint8(tvb, offset));
14421       offset += 1;
14422
14423       break;
14424     }
14425
14426     case TAG_SUPPORTED_CHANNELS: /* 7.3.2.19 Supported Channels element (36) */
14427       {
14428         proto_item *chan_item;
14429         proto_tree *chan_tree;
14430         guint       i = 1;
14431
14432         offset += 2;
14433         if (tag_len % 2 == 1) {
14434            expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u must be even", tag_len);
14435            break;
14436         }
14437         while (offset < tag_end)
14438         {
14439           chan_item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_channels, tvb, offset, 2, ENC_NA);
14440           proto_item_append_text(chan_item, " #%d", i);
14441           i += 1;
14442
14443           chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
14444
14445           proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_first, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14446           proto_item_append_text(chan_item, " First: %d", tvb_get_guint8(tvb, offset));
14447           offset += 1;
14448
14449           proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_range, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14450           proto_item_append_text(chan_item, ", Range: %d ", tvb_get_guint8(tvb, offset));
14451           offset += 1;
14452
14453         }
14454         break;
14455       }
14456     case TAG_CHANNEL_SWITCH_ANN: /* 7.3.2.20 Channel Switch Announcement element (37) */
14457     {
14458       if (tag_len != 3)
14459       {
14460         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 3", tag_len);
14461         break;
14462       }
14463       offset += 2;
14464
14465       proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14466       proto_item_append_text(ti, " Mode: %d", tvb_get_guint8(tvb, offset));
14467       offset += 1;
14468
14469       proto_tree_add_item(tree, hf_ieee80211_csa_new_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14470       proto_item_append_text(ti, ", Number: %d ", tvb_get_guint8(tvb, offset));
14471       offset += 1;
14472
14473       proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14474       proto_item_append_text(ti, ", Count: %d ", tvb_get_guint8(tvb, offset));
14475       offset += 1;
14476
14477       break;
14478     }
14479
14480     case TAG_MEASURE_REQ: /* 7.3.2.21 Measurement Request element (38) with update from 802.11k-2008 */
14481       if (tag_len < 3)
14482       {
14483         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
14484         break;
14485       }
14486       {
14487         guint8 request_type;
14488         proto_item *parent_item;
14489         proto_tree *sub_tree;
14490
14491         offset += 2;
14492
14493         proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_token, tvb, offset, 1, ENC_NA);
14494         offset += 1;
14495
14496         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_mode, tvb, offset, 1, ENC_NA);
14497         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_mode_tree);
14498         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_parallel, tvb, offset, 1, ENC_NA);
14499         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_enable, tvb, offset, 1, ENC_NA);
14500         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_request, tvb, offset, 1, ENC_NA);
14501         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_report, tvb, offset, 1, ENC_NA);
14502         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_duration_mandatory, tvb, offset, 1, ENC_NA);
14503         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_reserved, tvb, offset, 1, ENC_NA);
14504         offset += 1;
14505
14506
14507         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_type, tvb, offset, 1, ENC_NA);
14508         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_type_tree);
14509         request_type = tvb_get_guint8(tvb, offset);
14510         offset += 1;
14511
14512         switch (request_type) {
14513           case 0: /* Basic Request */
14514           case 1: /* Clear channel assessment (CCA) request */
14515           case 2: /* Receive power indication (RPI) histogram request */
14516           {
14517
14518             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14519             offset += 1;
14520
14521             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14522             offset += 8;
14523
14524             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14525             offset += 2;
14526             break;
14527           }
14528           case 3: /* Channel Load Request */
14529           {
14530             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
14531             offset += 1;
14532
14533             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14534             offset += 1;
14535
14536             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14537             offset += 2;
14538
14539             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14540             offset += 2;
14541
14542             while (offset < tag_end)
14543             {
14544               guint8 sub_id;
14545               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_id, tvb, offset, 1, ENC_NA);
14546               sub_id = tvb_get_guint8(tvb, offset);
14547               offset += 1;
14548
14549               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
14550               offset += 1;
14551
14552               switch (sub_id) {
14553                 case MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO: /* Channel Load Reporting Information (1) */
14554                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition, tvb, offset, 1, ENC_NA);
14555                   offset += 1;
14556                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref, tvb, offset, 1, ENC_NA);
14557                   offset += 1;
14558                   break;
14559                 default:
14560                   /* no default action */
14561                   break;
14562                 }
14563               }
14564             break;
14565           }
14566           case 4: /* Noise Histogram Request */
14567           {
14568             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
14569             offset += 1;
14570
14571             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14572             offset += 1;
14573
14574             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14575             offset += 2;
14576
14577             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14578             offset += 2;
14579
14580             while (offset < tag_end)
14581             {
14582               guint8 sub_id;
14583               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_id, tvb, offset, 1, ENC_NA);
14584               sub_id = tvb_get_guint8(tvb, offset);
14585               offset += 1;
14586
14587               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
14588               offset += 1;
14589
14590               switch (sub_id) {
14591                 case MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO: /* Noise Histogram Reporting Information (1) */
14592                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition, tvb, offset, 1, ENC_NA);
14593                   offset += 1;
14594                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref, tvb, offset, 1, ENC_NA);
14595                   offset += 1;
14596                   break;
14597                 default:
14598                   /* no default action */
14599                   break;
14600                 }
14601               }
14602             break;
14603           }
14604           case 5: /* Beacon Request */
14605           {
14606             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
14607             offset += 1;
14608
14609             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14610             offset += 1;
14611
14612             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14613             offset += 2;
14614
14615             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14616             offset += 2;
14617
14618             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_measurement_mode, tvb, offset, 1, ENC_NA);
14619             offset += 1;
14620
14621             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_bssid, tvb, offset, 6, ENC_NA);
14622             offset += 6;
14623
14624             while (offset < tag_end)
14625             {
14626               guint8 sub_id, sub_length, sub_tag_end;
14627               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_id, tvb, offset, 1, ENC_NA);
14628               sub_id = tvb_get_guint8(tvb, offset);
14629               offset += 1;
14630
14631               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
14632               sub_length = tvb_get_guint8(tvb, offset);
14633               offset += 1;
14634               sub_tag_end = offset + sub_length;
14635
14636               switch (sub_id) {
14637                 case MEASURE_REQ_BEACON_SUB_SSID: /* SSID (0) */
14638                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_ssid, tvb, offset, sub_length, ENC_ASCII|ENC_NA);
14639                   offset += sub_length;
14640                   break;
14641                 case MEASURE_REQ_BEACON_SUB_BRI: /* Beacon Reporting Information (1) */
14642                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14643                   offset += 1;
14644                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14645                   offset += 1;
14646                   break;
14647                 case MEASURE_REQ_BEACON_SUB_RD: /* Reporting Detail (2) */
14648                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14649                   offset += 1;
14650                   break;
14651                 case MEASURE_REQ_BEACON_SUB_REQUEST: /* Request (10) */
14652                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14653                   offset += 1;
14654                   break;
14655                 case MEASURE_REQ_BEACON_SUB_APCP: /* AP Channel Report (51) */
14656                   /* TODO */
14657                   break;
14658                 default:
14659                   /* no default action */
14660                   break;
14661              }
14662              if (offset < sub_tag_end)
14663              {
14664                proto_item *tix;
14665                tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_unknown, tvb, offset, sub_tag_end - offset, ENC_NA);
14666                expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_beacon_unknown);
14667                offset = sub_tag_end;
14668              }
14669             }
14670
14671             break;
14672           }
14673           case 6: /* Frame Request */
14674           {
14675             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
14676             offset += 1;
14677
14678             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14679             offset += 1;
14680
14681             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14682             offset += 2;
14683
14684             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14685             offset += 2;
14686
14687             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_frame_request_type, tvb, offset, 1, ENC_NA);
14688             offset += 1;
14689
14690             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mac_address, tvb, offset, 6, ENC_NA);
14691             offset += 6;
14692
14693             /* TODO Add Optional Subelements */
14694             break;
14695           }
14696           case 7: /* BSTA Statistics Request */
14697           {
14698             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_peer_mac_address, tvb, offset, 6, ENC_NA);
14699             offset += 6;
14700
14701             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14702             offset += 2;
14703
14704             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14705             offset += 2;
14706
14707             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_group_id, tvb, offset, 1, ENC_NA);
14708             offset += 1;
14709
14710             /* TODO Add Optional Subelements */
14711             break;
14712           }
14713           case 8: /* Location Configuration Indication (LCI) Request */
14714             /* TODO */
14715           case 9: /* Transmit Stream Measurement Request */
14716             /* TODO */
14717           case 10: /* Multicast diagnostics request */
14718             /* TODO */
14719           case 11: /* Location Civic request */
14720             /* TODO */
14721           case 12: /* Location Identifier request */
14722             /* TODO */
14723           case 13: /* Directional channel quality request */
14724             /* TODO */
14725           case 14: /* Directional measurement request */
14726             /* TODO */
14727           case 15: /* Directional statistics request */
14728             /* TODO */
14729           case 255: /* Measurement Pause Request*/
14730             /* TODO */
14731           default: /* unknown */
14732             break;
14733         }
14734         if (offset < tag_end)
14735         {
14736           proto_item *tix;
14737           tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_unknown, tvb, offset, tag_end - offset, ENC_NA);
14738           expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_unknown);
14739         }
14740       }
14741
14742       break;
14743     case TAG_MEASURE_REP: /* 7.3.2.22 Measurement Report element (39) with update from 802.11k-2008 */
14744       if (tag_len < 3)
14745       {
14746         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
14747         break;
14748       }
14749       {
14750         proto_item *parent_item;
14751         proto_tree *sub_tree;
14752         guint8 report_type;
14753
14754         offset += 2;
14755         proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_measurement_token, tvb, offset, 1, ENC_NA);
14756         offset += 1;
14757
14758         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_mode, tvb, offset, 1, ENC_NA);
14759         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_mode_tree);
14760         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_late, tvb, offset, 1, ENC_NA);
14761         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_incapable, tvb, offset, 1, ENC_NA);
14762         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_refused, tvb, offset, 1, ENC_NA);
14763         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_reserved, tvb, offset, 1, ENC_NA);
14764         offset += 1;
14765
14766         report_type = tvb_get_guint8(tvb, offset);
14767         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14768         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_type_tree);
14769         offset += 1;
14770
14771         if (tag_len == 3)
14772             break;
14773         switch (report_type) {
14774           case 0: /* Basic Report */
14775           {
14776             proto_tree *sub_tree_map_field;
14777
14778             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14779             offset += 1;
14780
14781             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14782             offset += 8;
14783
14784             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14785             offset += 2;
14786
14787
14788             parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_basic_map_field, tvb, offset, 1, ENC_NA);
14789             sub_tree_map_field = proto_item_add_subtree(parent_item, ett_tag_measure_report_basic_map_tree);
14790             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_bss, tvb, offset, 1, ENC_NA);
14791             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_odfm, tvb, offset, 1, ENC_NA);
14792             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_unident_signal, tvb, offset, 1, ENC_NA);
14793             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_radar, tvb, offset, 1, ENC_NA);
14794             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_unmeasured, tvb, offset, 1, ENC_NA);
14795             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_reserved, tvb, offset, 1, ENC_NA);
14796             break;
14797           }
14798           case 1: /* Clear channel assessment (CCA) report */
14799             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14800             offset += 1;
14801
14802             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14803             offset += 8;
14804
14805             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14806             offset += 2;
14807
14808             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_cca_busy_fraction, tvb, offset, 1, ENC_NA);
14809             offset += 1;
14810             break;
14811           case 2: /* Receive power indication (RPI) histogram report */
14812             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14813             offset += 1;
14814
14815             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14816             offset += 8;
14817
14818             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14819             offset += 2;
14820
14821             parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report, tvb, offset, 8, ENC_NA);
14822             sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_rpi_tree);
14823
14824             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_0, tvb, offset, 1, ENC_NA);
14825             offset += 1;
14826
14827             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_1, tvb, offset, 1, ENC_NA);
14828             offset += 1;
14829
14830             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_2, tvb, offset, 1, ENC_NA);
14831             offset += 1;
14832
14833             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_3, tvb, offset, 1, ENC_NA);
14834             offset += 1;
14835
14836             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_4, tvb, offset, 1, ENC_NA);
14837             offset += 1;
14838
14839             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_5, tvb, offset, 1, ENC_NA);
14840             offset += 1;
14841
14842             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_6, tvb, offset, 1, ENC_NA);
14843             offset += 1;
14844
14845             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_7, tvb, offset, 1, ENC_NA);
14846             offset += 1;
14847             break;
14848           case 3: /* Channel Load Report */
14849           {
14850             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
14851             offset += 1;
14852
14853             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14854             offset += 1;
14855
14856             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14857             offset += 8;
14858
14859             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14860             offset += 2;
14861
14862             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_load, tvb, offset, 1, ENC_NA);
14863             offset += 1;
14864
14865             /* TODO Add Optional Subelements */
14866             break;
14867           }
14868           case 4: /* Noise Histogram Report */
14869             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
14870             offset += 1;
14871
14872             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14873             offset += 1;
14874
14875             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14876             offset += 8;
14877
14878             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14879             offset += 2;
14880
14881             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
14882             offset += 1;
14883
14884             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_anpi, tvb, offset, 1, ENC_NA);
14885             offset += 1;
14886
14887             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_0, tvb, offset, 1, ENC_NA);
14888             offset += 1;
14889
14890             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_1, tvb, offset, 1, ENC_NA);
14891             offset += 1;
14892
14893             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_2, tvb, offset, 1, ENC_NA);
14894             offset += 1;
14895
14896             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_3, tvb, offset, 1, ENC_NA);
14897             offset += 1;
14898
14899             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_4, tvb, offset, 1, ENC_NA);
14900             offset += 1;
14901
14902             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_5, tvb, offset, 1, ENC_NA);
14903             offset += 1;
14904
14905             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_6, tvb, offset, 1, ENC_NA);
14906             offset += 1;
14907
14908             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_7, tvb, offset, 1, ENC_NA);
14909             offset += 1;
14910
14911             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_8, tvb, offset, 1, ENC_NA);
14912             offset += 1;
14913
14914             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_9, tvb, offset, 1, ENC_NA);
14915             offset += 1;
14916
14917             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_10, tvb, offset, 1, ENC_NA);
14918             offset += 1;
14919
14920             /* TODO Add Optional Subelements */
14921             break;
14922           case 5: /* Beacon Report */
14923           {
14924             proto_tree *sub_tree_frame_info;
14925
14926             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
14927             offset += 1;
14928
14929             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14930             offset += 1;
14931
14932             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14933             offset += 8;
14934
14935             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14936             offset += 2;
14937
14938             parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_frame_info, tvb, offset, 1, ENC_NA);
14939             sub_tree_frame_info = proto_item_add_subtree(parent_item, ett_tag_measure_report_frame_tree);
14940             proto_tree_add_item(sub_tree_frame_info, hf_ieee80211_tag_measure_report_frame_info_phy_type, tvb, offset, 1, ENC_NA);
14941             proto_tree_add_item(sub_tree_frame_info, hf_ieee80211_tag_measure_report_frame_info_frame_type, tvb, offset, 1, ENC_NA);
14942             offset += 1;
14943
14944             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rcpi, tvb, offset, 1, ENC_NA);
14945             offset += 1;
14946
14947             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rsni, tvb, offset, 1, ENC_NA);
14948             offset += 1;
14949
14950             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_bssid, tvb, offset, 6, ENC_NA);
14951             offset += 6;
14952
14953             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
14954             offset += 1;
14955
14956             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_parent_tsf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14957             offset += 4;
14958
14959             while (offset < tag_end)
14960             {
14961               guint8 sub_id, sub_length;
14962               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_beacon_sub_id, tvb, offset, 1, ENC_NA);
14963               sub_id = tvb_get_guint8(tvb, offset);
14964               offset += 1;
14965
14966               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_subelement_length, tvb, offset, 1, ENC_NA);
14967               sub_length = tvb_get_guint8(tvb, offset);
14968               offset += 1;
14969
14970               switch (sub_id) {
14971                 case MEASURE_REP_REPORTED_FRAME_BODY: /* Reported Frame Body (1) */
14972                   {
14973                     proto_tree *rep_tree;
14974
14975                     rep_tree = proto_tree_add_subtree(sub_tree, tvb, offset, sub_length, ett_tag_measure_reported_frame_tree, NULL, "Reported Frame Body");
14976
14977                     add_ff_timestamp(rep_tree, tvb, pinfo, 0);
14978                     add_ff_beacon_interval(rep_tree, tvb, pinfo, 8);
14979                     add_ff_cap_info(rep_tree, tvb, pinfo, 10);
14980                     offset += 12;
14981
14982                     ieee_80211_add_tagged_parameters(tvb, offset, pinfo, rep_tree, sub_length - 12, MGT_PROBE_RESP, NULL);
14983                     offset += (sub_length - 12);
14984                   }
14985                   break;
14986                 default:
14987                   /* no default action */
14988                   break;
14989               }
14990             }
14991             break;
14992           }
14993           case 6: /* Frame Report */
14994             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
14995             offset += 1;
14996
14997             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14998             offset += 1;
14999
15000             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
15001             offset += 8;
15002
15003             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15004             offset += 2;
15005
15006             /* TODO Add Optional Subelements */
15007             break;
15008           case 7: /* BSTA Statistics Report */
15009             /* TODO */
15010           case 8: /* Location Configuration Information Report element */
15011             /* TODO */
15012           case 9: /* Transmit Stream Measurement Report */
15013             /* TODO */
15014           case 10: /* Multicast diagnostics Report */
15015             /* TODO */
15016           case 11: /* Location Civic Report */
15017             /* TODO */
15018           case 12: /* Location Identifier Report */
15019             /* TODO */
15020           case 13: /* Directional channel quality Report */
15021             /* TODO */
15022           case 14: /* Directional measurement Report */
15023             /* TODO */
15024           case 15: /* Directional statistics Report */
15025             /* TODO */
15026           default: /* unknown */
15027             break;
15028         }
15029         if (offset < tag_end)
15030         {
15031           proto_item *tix;
15032           tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_unknown, tvb, offset, tag_end - offset, ENC_NA);
15033           expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_report_unknown);
15034         }
15035       }
15036       break;
15037
15038     case TAG_QUIET: /* 7.3.2.23 Quiet element (40) */
15039       if (tag_len != 6)
15040       {
15041         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
15042         break;
15043       }
15044       offset += 2;
15045
15046       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_count, tvb, offset, 1, ENC_NA);
15047       proto_item_append_text(ti, " Count: %d", tvb_get_guint8(tvb, offset));
15048       offset += 1;
15049
15050       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_period, tvb, offset, 1, ENC_NA);
15051       proto_item_append_text(ti, " Period: %d", tvb_get_guint8(tvb, offset));
15052       offset += 1;
15053
15054       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15055       proto_item_append_text(ti, " Duration: %d", tvb_get_letohs(tvb, offset));
15056       offset += 2;
15057
15058       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15059       proto_item_append_text(ti, " Offset: %d", tvb_get_letohs(tvb, offset));
15060       offset += 2;
15061       break;
15062
15063
15064     case TAG_IBSS_DFS: /* 7.3.2.24 IBSS DFS element (41) */
15065       if (tag_len < 7)
15066       {
15067         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 7", tag_len);
15068         break;
15069       }
15070       {
15071         proto_item *ti_sup_map;
15072         proto_tree *sub_map_tree;
15073         offset += 2;
15074
15075         proto_tree_add_item(tree, hf_ieee80211_tag_dfs_owner, tvb, offset, 6, ENC_NA);
15076         proto_item_append_text(ti, " Owner: %s", tvb_ether_to_str(tvb, offset));
15077         offset += 6;
15078
15079         proto_tree_add_item(tree, hf_ieee80211_tag_dfs_recovery_interval, tvb, offset, 1, ENC_NA);
15080         offset += 1;
15081
15082         while (offset < tag_end)
15083         {
15084           ti_sup_map = proto_tree_add_item(tree, hf_ieee80211_tag_dfs_channel_map, tvb, offset, 2, ENC_NA);
15085           sub_map_tree = proto_item_add_subtree(ti_sup_map, ett_tag_dfs_map_tree);
15086           proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_channel_number, tvb, offset, 1, ENC_NA);
15087           proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_map, tvb, offset, 1, ENC_NA);
15088           offset += 2;
15089         }
15090         break;
15091       }
15092     case TAG_ERP_INFO: /* 7.3.2.13 ERP Information element (42) */
15093     case TAG_ERP_INFO_OLD:
15094       if (tag_len != 1)
15095       {
15096         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
15097         break;
15098       }
15099       {
15100         proto_item *ti_erp;
15101         proto_tree *erp_tree;
15102
15103         offset += 2;
15104
15105         ti_erp = proto_tree_add_item(tree, hf_ieee80211_tag_erp_info, tvb, offset, 1, ENC_NA);
15106         erp_tree = proto_item_add_subtree(ti_erp, ett_tag_erp_info_tree);
15107         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_erp_present, tvb, offset, 1, ENC_NA);
15108         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_use_protection, tvb, offset, 1, ENC_NA);
15109         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_barker_preamble_mode, tvb, offset, 1, ENC_NA);
15110         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_reserved, tvb, offset, 1, ENC_NA);
15111         offset += 1;
15112         break;
15113       }
15114
15115     case TAG_TS_DELAY: /* 7.3.2.32 TS Delay element (43) */
15116       if (tag_len != 4)
15117       {
15118         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
15119         break;
15120       }
15121       offset += 2;
15122
15123       proto_tree_add_item(tree, hf_ieee80211_ts_delay, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15124       proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, offset));
15125       offset += 4;
15126       break;
15127
15128     case TAG_TCLAS_PROCESS: /* 7.3.2.33 TCLAS Processing element (44) */
15129       if (tag_len != 1)
15130       {
15131         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
15132         break;
15133       }
15134       offset += 2;
15135
15136       proto_tree_add_item(tree, hf_ieee80211_tclas_process, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15137       proto_item_append_text(ti, " : %s", val_to_str(tvb_get_guint8(tvb, offset), ieee80211_tclas_process_flag, "Unknown %d"));
15138       offset += 1;
15139       break;
15140
15141     case TAG_QOS_CAPABILITY: /* 802.11-2012 8.4.2.37 QoS Capability element (46) */
15142       if (tag_len != 1)
15143       {
15144         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
15145         break;
15146       }
15147       {
15148         offset += 2;
15149         offset = dissect_qos_capability(tree, tvb, pinfo, offset, ftype);
15150       }
15151       break;
15152
15153     case TAG_RSN_IE: /* 7.3.2.25 RSN information element (48) */
15154       if (tag_len < 18)
15155       {
15156         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 18", tag_len);
15157         break;
15158       }
15159       offset += 2;
15160
15161       offset = dissect_rsn_ie(pinfo, tree, tvb, offset, tag_len, association_sanity_check);
15162       break;
15163
15164     case TAG_EXT_SUPP_RATES: /* 7.3.2.14 Extended Supported Rates element (50) */
15165       if (tag_len < 1)
15166       {
15167         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be greater than 0", tag_len);
15168         break;
15169       }
15170       offset += 2;
15171
15172       while (offset < tag_end)
15173       {
15174         proto_tree_add_item(tree, hf_ieee80211_tag_ext_supp_rates, tvb, offset, 1, ENC_NA);
15175         proto_item_append_text(ti, " %s,", val_to_str_ext_const(tvb_get_guint8(tvb, offset), &ieee80211_supported_rates_vals_ext, "Unknown Rate"));
15176         offset += 1;
15177       }
15178       proto_item_append_text(ti, " [Mbit/sec]");
15179       break;
15180
15181     case TAG_EXTENDED_CAPABILITIES: /* 7.3.2.27 Extended Capabilities information element (127) */
15182       dissect_extended_capabilities_ie(pinfo, tree, ti, ti_len, tag_len, tvb, offset+2, tag_end);
15183       break;
15184
15185     case TAG_CISCO_CCX1_CKIP: /* Cisco CCX1 CKIP + Device Name (133) */
15186       /* From WCS manual:
15187        * If Aironet IE support is enabled, the access point sends an Aironet
15188        * IE 0x85 (which contains the access point name, load, number of
15189        * associated clients, and so on) in the beacon and probe responses of
15190        * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
15191        * (which contains the management IP address of the controller and
15192        * the IP address of the access point) in the reassociation response
15193        * if it receives Aironet IE 0x85 in the reassociation request.
15194        */
15195
15196       if (tag_len < 26)
15197       {
15198         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u too short, must be >= 26", tag_len);
15199         break;
15200       }
15201       offset += 2;
15202       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown, tvb, offset, 10, ENC_NA);
15203       offset += 10;
15204
15205       /* The Name of the sending device starts at offset 10 and is up to
15206          15 or 16 bytes in length, \0 padded */
15207       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_name, tvb, offset, 16, ENC_ASCII|ENC_NA);
15208       offset += 16;
15209
15210       /* Total number off associated clients and repeater access points */
15211       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_clients, tvb, offset, 1, ENC_NA);
15212       offset += 1;
15213       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown2, tvb, offset, 3, ENC_NA);
15214       offset += 3;
15215       break;
15216
15217     case TAG_VHT_CAPABILITY:
15218       dissect_vht_capability_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len);
15219       break;
15220
15221     case TAG_VHT_OPERATION:
15222       dissect_vht_operation_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len);
15223       break;
15224
15225     case TAG_EXT_BSS_LOAD:
15226       dissect_ext_bss_load(tree, tvb, offset+2);
15227       break;
15228
15229     case TAG_WIDE_BW_CHANNEL_SWITCH:
15230       dissect_wide_bw_channel_switch(tree, tvb, offset+2);
15231       break;
15232
15233     case TAG_VHT_TX_PWR_ENVELOPE:
15234       dissect_vht_tx_pwr_envelope(tvb, pinfo, tree, offset+2, tag_len, ti_len);
15235       break;
15236
15237     case TAG_CHANNEL_SWITCH_WRAPPER:
15238       dissect_channel_switch_wrapper(pinfo, tree, tvb, offset + 2, tag_len);
15239       break;
15240
15241     case TAG_OPERATING_MODE_NOTIFICATION:
15242       dissect_operating_mode_notification(tree, tvb, offset + 2);
15243       break;
15244
15245     case TAG_VENDOR_SPECIFIC_IE: /* 7.3.2.26 Vendor Specific information element (221) */
15246     case TAG_CISCO_VENDOR_SPECIFIC: /* This Cisco proprietary IE seems to mimic 221 */
15247     case TAG_SYMBOL_PROPRIETARY: /* This Symbol proprietary IE seems to mimic 221 */
15248       if (tag_len < 3)
15249       {
15250         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len);
15251         break;
15252       }
15253       {
15254         guint32 tag_vs_len = tag_len;
15255
15256         offset += 2;
15257         oui = tvb_get_ntoh24(tvb, offset);
15258         tag_tvb = tvb_new_subset_length(tvb, offset, tag_len);
15259         proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
15260         proto_item_append_text(ti, ": %s", uint_get_manuf_name(oui));
15261         offset += 3;
15262         tag_vs_len -= 3;
15263
15264         if (tag_len > 0) {
15265           proto_tree_add_item(ti, hf_ieee80211_tag_vendor_oui_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15266         }
15267
15268       switch (oui) {
15269         /* 802.11 specific vendor ids */
15270         case OUI_WPAWME:
15271           offset = dissect_vendor_ie_wpawme(tree, tvb, pinfo, offset, tag_vs_len, ftype);
15272           break;
15273         case OUI_RSN:
15274           dissect_vendor_ie_rsn(ti, tree, tvb, offset, tag_vs_len);
15275           break;
15276         case OUI_PRE11N:
15277           dissect_vendor_ie_ht(tvb, pinfo, tree, offset, ti, ti_len, tag_vs_len);
15278           break;
15279         case OUI_WFA:
15280           dissect_vendor_ie_wfa(pinfo, ti, tag_tvb);
15281           break;
15282
15283         /* Normal IEEE vendor ids (from oui.h) */
15284         case OUI_CISCOWL:  /* Cisco Wireless (Aironet) */
15285           dissect_vendor_ie_aironet(ti, tree, tvb, offset, tag_vs_len);
15286           break;
15287         case OUI_MARVELL:
15288           dissect_vendor_ie_marvell(ti, tree, tvb, offset, tag_vs_len);
15289           break;
15290         case OUI_ATHEROS:
15291           dissect_vendor_ie_atheros(ti, tree, tvb, offset, tag_vs_len, pinfo, ti_len);
15292           break;
15293         case OUI_ARUBA:
15294           dissect_vendor_ie_aruba(ti, tree, tvb, offset, tag_vs_len);
15295           break;
15296         case OUI_NINTENDO:
15297           dissect_vendor_ie_nintendo(ti, tree, tvb, offset, tag_vs_len);
15298           break;
15299         case OUI_MIKROTIK:
15300           dissect_vendor_ie_mikrotik(ti, tree, tvb, offset, tag_vs_len);
15301           break;
15302         case OUI_MERU:
15303           dissect_vendor_ie_meru(ti, tree, tvb, offset, tag_vs_len, pinfo);
15304           break;
15305         case OUI_ZEBRA_EXTREME:
15306           dissect_vendor_ie_extreme(ti, tree, tvb, offset, tag_vs_len, pinfo);
15307           break;
15308         default:
15309           proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA);
15310           break;
15311         }
15312
15313       }
15314       break;
15315
15316     case TAG_MOBILITY_DOMAIN:
15317       dissect_mobility_domain(tree, tvb, offset + 2, tag_len, association_sanity_check);
15318       break;
15319
15320     case TAG_FAST_BSS_TRANSITION:
15321       dissect_fast_bss_transition(tree, tvb, offset + 2, tag_len);
15322       break;
15323
15324     case TAG_MMIE:
15325       dissect_mmie(tree, tvb, offset + 2, tag_len);
15326       break;
15327
15328     case TAG_SSID_LIST:
15329       dissect_ssid_list(tree, tvb, offset + 2, tag_len);
15330       break;
15331
15332     case TAG_TIME_ZONE:
15333       dissect_time_zone(tree, tvb, offset + 2, tag_len);
15334       break;
15335
15336     case TAG_TIMEOUT_INTERVAL:
15337       dissect_timeout_interval(tree, tvb, pinfo, offset + 2, tag_len);
15338       break;
15339
15340     case TAG_RIC_DATA: /* RIC Data (RDE) (57) */
15341      /* Assigning the return value will ensure that the IE after RIC is processed
15342       * only once. This gives us a good looking RIC IE :-)
15343       */
15344       tag_len = dissect_ric_data(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len, ftype);
15345       break;
15346
15347     case TAG_LINK_IDENTIFIER:
15348       dissect_link_identifier(tree, tvb, offset + 2, tag_len);
15349       break;
15350
15351     case TAG_WAKEUP_SCHEDULE:
15352       dissect_wakeup_schedule(tree, tvb, offset + 2, tag_len);
15353       break;
15354
15355     case TAG_CHANNEL_SWITCH_TIMING:
15356       dissect_channel_switch_timing(tree, tvb, offset + 2, tag_len);
15357       break;
15358
15359     case TAG_PTI_CONTROL:
15360       dissect_pti_control(tree, tvb, offset + 2, tag_len);
15361       break;
15362
15363     case TAG_PU_BUFFER_STATUS:
15364       dissect_pu_buffer_status(tree, tvb, offset + 2, tag_len);
15365       break;
15366
15367     case TAG_HT_CAPABILITY:
15368       dissect_ht_capability_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len, FALSE);
15369       break;
15370
15371     case TAG_HT_INFO:
15372       dissect_ht_info_ie_1_1(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15373       break;
15374
15375     case TAG_SECONDARY_CHANNEL_OFFSET:
15376       dissect_secondary_channel_offset_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15377       break;
15378
15379     case TAG_BSS_AVG_ACCESS_DELAY: /* BSS Average Access Delay element (63) */
15380       dissect_bss_avg_access_delay_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15381       break;
15382
15383     case TAG_ANTENNA: /* Antenna element (64) */
15384       dissect_antenna_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15385       break;
15386
15387     case TAG_RSNI: /* RSNI element (65) */
15388       dissect_rsni_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15389       break;
15390
15391     case TAG_BSS_AVB_ADM_CAPACITY:
15392       dissect_bss_available_admission_capacity_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15393       break;
15394
15395     case TAG_IE_68_CONFLICT: /* Conflict: WAPI Vs. IEEE */
15396       if (tag_len >= 20) { /* It Might be WAPI*/
15397         dissect_wapi_param_set(tvb, pinfo, tree, offset + 2, tag_len, ti_len, ti, ftype);
15398       }
15399       else { /* BSS AC Access Delay (68) */
15400         dissect_bss_ac_access_delay_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15401       }
15402       break;
15403
15404     case TAG_BSS_MAX_IDLE_PERIOD:
15405       dissect_bss_max_idle_period(tree, tvb, offset + 2);
15406       break;
15407
15408     case TAG_TFS_REQUEST:
15409       dissect_tfs_request(pinfo, tree, tvb, offset + 2, tag_len, ftype);
15410       break;
15411
15412     case TAG_TFS_RESPONSE:
15413       dissect_tfs_response(pinfo, tree, tvb, offset + 2, tag_len, ftype);
15414       break;
15415
15416     case TAG_WNM_SLEEP_MODE:
15417       dissect_wnm_sleep_mode(tree, tvb, offset + 2);
15418       break;
15419
15420     case TAG_TIME_ADV:
15421       dissect_time_adv(tree, tvb, offset + 2);
15422       break;
15423
15424     case TAG_RM_ENABLED_CAPABILITY: /* RM Enabled Capabilities (70) */
15425       dissect_rm_enabled_capabilities_ie(pinfo, tree, ti, ti_len, tag_len, tvb, offset+2, tag_end);
15426       break;
15427
15428     case TAG_20_40_BSS_CO_EX: /* 20/40 BSS Coexistence (72) */
15429       dissect_20_40_bss_coexistence(pinfo, tree, ti_len, tag_len, tvb, offset+2);
15430       break;
15431
15432     case TAG_OVERLAP_BSS_SCAN_PAR: /* Overlapping BSS Scan Parameters (74) */
15433       dissect_overlap_bss_scan_par(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len);
15434       break;
15435
15436     case TAG_RIC_DESCRIPTOR: /* RIC Descriptor (75) */
15437       dissect_ric_descriptor(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len);
15438       break;
15439
15440     case TAG_MESH_PEERING_MGMT:
15441       {
15442         guint start = offset + 2;
15443         offset += 2;
15444         proto_tree_add_item(tree, hf_ieee80211_mesh_peering_proto, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15445         offset += 2;
15446         proto_tree_add_item(tree, hf_ieee80211_mesh_peering_local_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15447         offset += 2;
15448         switch (tvb_get_guint8(tvb, 1))
15449           {                                         /* Self-protected action field */
15450           case SELFPROT_ACTION_MESH_PEERING_OPEN:
15451             break;
15452
15453           case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
15454             proto_tree_add_item(tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15455             offset += 2;
15456             break;
15457
15458           case SELFPROT_ACTION_MESH_PEERING_CLOSE:
15459             if ((tag_len == 8) || (tag_len == 24))
15460               {
15461                 proto_tree_add_item(tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15462                 offset += 2;
15463               }
15464             offset += add_ff_reason_code(tree, tvb, pinfo, offset);
15465             break;
15466
15467           /* unexpected values */
15468           default:
15469             proto_tree_add_expert(tree, pinfo, &ei_ieee80211_mesh_peering_unexpected , tvb, offset, tag_len);
15470             offset += tag_len;
15471             break;
15472           }
15473         if (tag_len - (offset - start) == 16)
15474           {
15475             proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
15476             offset += 16;
15477           }
15478         break;
15479       }
15480
15481     case TAG_MESH_CONFIGURATION:
15482       {
15483         proto_item *item;
15484         proto_tree *subtree;
15485         offset += 2;
15486         proto_tree_add_item(tree, hf_ieee80211_mesh_config_path_sel_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15487         proto_tree_add_item(tree, hf_ieee80211_mesh_config_path_sel_metric, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
15488         proto_tree_add_item(tree, hf_ieee80211_mesh_config_congestion_control, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
15489         proto_tree_add_item(tree, hf_ieee80211_mesh_config_sync_method, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
15490         proto_tree_add_item(tree, hf_ieee80211_mesh_config_auth_protocol, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
15491         item = proto_tree_add_item(tree, hf_ieee80211_mesh_config_formation_info, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
15492         subtree = proto_item_add_subtree(item, ett_mesh_formation_info_tree);
15493         proto_tree_add_item(subtree, hf_ieee80211_mesh_form_info_num_of_peerings, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
15494         item = proto_tree_add_item(tree, hf_ieee80211_mesh_config_capability, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15495         subtree = proto_item_add_subtree(item, ett_mesh_config_cap_tree);
15496         proto_tree_add_item(subtree, hf_ieee80211_mesh_config_cap_accepting, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15497         proto_tree_add_item(subtree, hf_ieee80211_mesh_config_cap_mcca_support, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15498         proto_tree_add_item(subtree, hf_ieee80211_mesh_config_cap_mcca_enabled, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15499         proto_tree_add_item(subtree, hf_ieee80211_mesh_config_cap_forwarding, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15500         proto_tree_add_item(subtree, hf_ieee80211_mesh_config_cap_mbca_enabled, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15501         proto_tree_add_item(subtree, hf_ieee80211_mesh_config_cap_tbtt_adjusting, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15502         proto_tree_add_item(subtree, hf_ieee80211_mesh_config_cap_power_save_level, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15503         break;
15504       }
15505
15506     case TAG_MESH_ID:
15507       {
15508         const guint8* mesh_id;
15509         offset += 2;
15510
15511         proto_tree_add_item_ret_string(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &mesh_id);
15512         if (tag_len > 0) {
15513             gchar* s = format_text_wmem(wmem_packet_scope(), mesh_id, tag_len);
15514             col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", s);
15515             proto_item_append_text(ti, ": %s", s);
15516         }
15517
15518       break;
15519       }
15520
15521     case TAG_MESH_PREQ:
15522       {
15523         guint8 flags = tvb_get_guint8(tvb, offset + 2);
15524         guint8 targs, i;
15525
15526         offset += 2;
15527         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15528         offset += 1;
15529         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15530         offset += 1;
15531         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15532         offset += 1;
15533         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_pdid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15534         offset += 4;
15535         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
15536         offset += 6;
15537         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15538         offset += 4;
15539
15540         if (flags & (1<<6)) {
15541           proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_ext, tvb, offset, 6, ENC_NA);
15542           offset += 6;
15543         }
15544         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15545         offset += 4;
15546         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15547         offset += 4;
15548         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15549         targs = tvb_get_guint8(tvb, offset);
15550         offset += 1;
15551         for (i = 0; i < targs; i++) {
15552           const int * targ_flags[] = {
15553               &hf_ieee80211_ff_hwmp_targ_to_flags,
15554               &hf_ieee80211_ff_hwmp_targ_usn_flags,
15555               NULL
15556           };
15557
15558           proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_hwmp_targ_flags,
15559                                    ett_hwmp_targ_flags_tree, targ_flags, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15560
15561           offset += 1;
15562           proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
15563           offset += 6;
15564           proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15565           offset += 4;
15566         }
15567         break;
15568       }
15569
15570     case TAG_MESH_PREP:
15571       {
15572         guint8 flags = tvb_get_guint8(tvb, offset + 2);
15573         offset += 2;
15574         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15575         offset += 1;
15576         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15577         offset += 1;
15578         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset , 1, ENC_LITTLE_ENDIAN);
15579         offset += 1;
15580         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
15581         offset += 6;
15582         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15583         offset += 4;
15584         if (flags & (1<<6)) {
15585           proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
15586           offset += 6;
15587         }
15588         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15589         offset += 4;
15590         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15591         offset += 4;
15592         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
15593         offset += 6;
15594         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15595         offset += 4;
15596         break;
15597       }
15598
15599     case TAG_MESH_PERR:
15600       {
15601         guint8 targs, i;
15602
15603         offset += 2;
15604         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15605         offset += 1;
15606         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15607         targs = tvb_get_guint8(tvb, offset);
15608         offset += 1;
15609         for (i = 0; i < targs; i++) {
15610           guint8 flags = tvb_get_guint8(tvb, offset);
15611
15612           proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15613           offset += 1;
15614           proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
15615           offset += 6;
15616           proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15617           offset += 4;
15618           if (flags & (1<<6)) {
15619             proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
15620             offset += 6;
15621           }
15622           offset += add_ff_reason_code(tree, tvb, pinfo, offset);
15623         }
15624         break;
15625       }
15626
15627     case TAG_RANN:
15628       {
15629         offset += 2;
15630         proto_tree_add_item(tree, hf_ieee80211_rann_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15631         offset += 1;
15632         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15633         offset += 1;
15634         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15635         offset += 1;
15636         proto_tree_add_item(tree, hf_ieee80211_rann_root_sta, tvb, offset, 6, ENC_NA);
15637         offset += 6;
15638         proto_tree_add_item(tree, hf_ieee80211_rann_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15639         offset += 4;
15640         proto_tree_add_item(tree, hf_ieee80211_rann_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15641         offset += 4;
15642         proto_tree_add_item(tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15643         offset += 4;
15644         break;
15645       }
15646
15647     case TAG_MESH_CHANNEL_SWITCH: /* Mesh Channel Switch Parameters (118) */
15648       {
15649         proto_item *item;
15650         proto_tree *subtree;
15651         if (tag_len != 6)
15652         {
15653           expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
15654             break;
15655         }
15656         offset += 2;
15657
15658         proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15659         proto_item_append_text(ti, " TTL: %d", tvb_get_guint8(tvb, offset));
15660         offset += 1;
15661
15662         item = proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15663         subtree = proto_item_add_subtree(item, ett_mesh_chswitch_flag_tree);
15664         proto_tree_add_item(subtree, hf_ieee80211_mesh_chswitch_flag_initiator, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15665         proto_tree_add_item(subtree, hf_ieee80211_mesh_chswitch_flag_txrestrict, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15666         offset += 1;
15667
15668         proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_reason_code, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15669         offset += 2;
15670
15671         proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_precedence_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15672         offset += 2;
15673         break;
15674      }
15675
15676     case TAG_INTERWORKING:
15677       dissect_interworking(pinfo, tree, ti, tvb, offset);
15678       break;
15679     case TAG_ADVERTISEMENT_PROTOCOL:
15680     {
15681       dissect_advertisement_protocol(pinfo, tree, tvb, offset, NULL);
15682       break;
15683     }
15684     case TAG_QOS_MAP_SET:
15685       dissect_qos_map_set(pinfo, tree, ti, tvb, offset);
15686       break;
15687     case TAG_ROAMING_CONSORTIUM:
15688       dissect_roaming_consortium(pinfo, tree, ti, tvb, offset);
15689       break;
15690     case TAG_AP_CHANNEL_REPORT: /* 7.3.2.36 AP Channel Report element */
15691       dissect_ap_channel_report(tvb, pinfo, tree, offset + 2, tag_len, ti_len, tag_end, ti);
15692       break;
15693     case TAG_NEIGHBOR_REPORT:
15694       dissect_neighbor_report(tvb, pinfo, tree, offset + 2, tag_len, ti_len, tag_end, ti);
15695       break;
15696
15697     case TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT:
15698     {
15699       if (tag_len != 4)
15700       {
15701         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
15702         break;
15703       }
15704
15705       offset += 2;
15706
15707       offset += add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
15708
15709       break;
15710     }
15711     case TAG_SUPPORTED_OPERATING_CLASSES:
15712     {
15713       guint i;
15714
15715       if (tag_len < 2) {
15716         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len);
15717         break;
15718       } else if (tag_len > 32) {
15719         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be < 32", tag_len);
15720         break;
15721       }
15722
15723       offset += 2;
15724
15725       proto_tree_add_item(tree, hf_ieee80211_tag_supported_ope_classes_current, tvb, offset, 1, ENC_NA);
15726
15727       offset += 1;
15728       /* Partially taken from the ssid section */
15729       tag_data_ptr = tvb_get_ptr(tvb, offset, tag_len);
15730       for (i = 0, n = 0; (i < tag_len) && (n < SHORT_STR); i++) {
15731         ret = g_snprintf(print_buff + n, SHORT_STR - n, (i == tag_len-1)?"%d":"%d, ", tag_data_ptr[i]);
15732         if (ret >= SHORT_STR - n) {
15733           /* ret >= <buf_size> means buffer truncated  */
15734           break;
15735         }
15736         n += ret;
15737       }
15738       proto_tree_add_string(tree, hf_ieee80211_tag_supported_ope_classes_alternate, tvb, offset, tag_len, print_buff);
15739
15740       break;
15741     }
15742     case TAG_RELAY_CAPABILITIES:
15743     {
15744       add_tag_relay_capabilities(pinfo, ti_len, tag_len, tree, tvb, &offset);
15745       break;
15746     }
15747     case TAG_DMG_BSS_PRAMTER_CHANGE:
15748     {
15749       gboolean size;
15750       if (tag_len != 7)
15751       {
15752         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 7", tag_len);
15753         break;
15754       }
15755       offset += 2;
15756       size = (tvb_get_guint8(tvb, offset) & 0x02) >> 1;
15757       proto_tree_add_item(tree, hf_ieee80211_tag_move, tvb, offset, 1, ENC_NA);
15758       proto_tree_add_item(tree, hf_ieee80211_tag_size, tvb, offset, 1, ENC_NA);
15759       offset += 1;
15760       proto_tree_add_item(tree, hf_ieee80211_tag_tbtt_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15761       offset += 4;
15762       if(size == TRUE) { /* if size bit is 0, the field is reserved. */
15763         proto_tree_add_item(tree, hf_ieee80211_tag_bi_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15764       }
15765       offset += 2;
15766       break;
15767     }
15768     case TAG_DMG_CAPABILITIES:
15769     {
15770       if (tag_len != 17)
15771       {
15772         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 17", tag_len);
15773         break;
15774       }
15775       offset += 2;
15776       proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_sta_addr, tvb, offset, 6, ENC_NA);
15777       offset += 6;
15778       proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_aid, tvb, offset, 1, ENC_NA);
15779       offset += 1;
15780       proto_tree_add_item(tree, hf_ieee80211_tag_reverse_direction, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15781       proto_tree_add_item(tree, hf_ieee80211_tag_hlts, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15782       proto_tree_add_item(tree, hf_ieee80211_tag_tpc, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15783       proto_tree_add_item(tree, hf_ieee80211_tag_spsh, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15784       proto_tree_add_item(tree, hf_ieee80211_tag_rx_antenna, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15785       proto_tree_add_item(tree, hf_ieee80211_tag_fast_link, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15786       proto_tree_add_item(tree, hf_ieee80211_tag_num_sectors, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15787       proto_tree_add_item(tree, hf_ieee80211_tag_rxss_length, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15788       proto_tree_add_item(tree, hf_ieee80211_tag_reciprocity, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15789       proto_tree_add_item(tree, hf_ieee80211_tag_max_ampdu_exp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15790       offset += 3;
15791       proto_tree_add_item(tree, hf_ieee80211_tag_min_mpdu_sapcing, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15792       proto_tree_add_item(tree, hf_ieee80211_tag_ba_flow_control, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15793       proto_tree_add_item(tree, hf_ieee80211_tag_max_sc_rx_mcs, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15794       proto_tree_add_item(tree, hf_ieee80211_tag_max_ofdm_rx_mcs, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15795       proto_tree_add_item(tree, hf_ieee80211_tag_max_sc_tx_mcs, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15796       proto_tree_add_item(tree, hf_ieee80211_tag_max_ofdm_tx_mcs, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15797       offset += 3;
15798       proto_tree_add_item(tree, hf_ieee80211_tag_low_power_supported, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15799       proto_tree_add_item(tree, hf_ieee80211_tag_code_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15800       proto_tree_add_item(tree, hf_ieee80211_tag_dtp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15801       proto_tree_add_item(tree, hf_ieee80211_tag_appdu_supp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15802       proto_tree_add_item(tree, hf_ieee80211_tag_heartbeat, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15803       proto_tree_add_item(tree, hf_ieee80211_tag_other_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15804       proto_tree_add_item(tree, hf_ieee80211_tag_pattern_recip, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15805       proto_tree_add_item(tree, hf_ieee80211_tag_heartbeat_elapsed, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15806       proto_tree_add_item(tree, hf_ieee80211_tag_grant_ack_supp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15807       proto_tree_add_item(tree, hf_ieee80211_tag_RXSSTxRate_supp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15808       offset += 2;
15809       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_tddti, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15810       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_PSA, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15811       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_handover, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15812       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_max_assoc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15813       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_power_src, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15814       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_decenter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15815       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_forwarding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15816       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_center, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15817       offset += 2;
15818       break;
15819     }
15820     case TAG_DMG_OPERATION:
15821     {
15822       if (tag_len != 10)
15823       {
15824         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 10", tag_len);
15825         break;
15826       }
15827       offset += 2;
15828       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_tddti, tvb, offset, 1, ENC_NA);
15829       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_PSA, tvb, offset, 1, ENC_NA);
15830       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_handover, tvb, offset, 1, ENC_NA);
15831       offset += 2;
15832       proto_tree_add_item(tree, hf_ieee80211_tag_PSRSI, tvb, offset, 1, ENC_NA);
15833       offset += 1;
15834       proto_tree_add_item(tree, hf_ieee80211_tag_min_BHI_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15835       offset += 2;
15836       proto_tree_add_item(tree, hf_ieee80211_tag_brdct_sta_info_dur, tvb, offset, 1, ENC_NA);
15837       offset += 1;
15838       proto_tree_add_item(tree, hf_ieee80211_tag_assoc_resp_confirm_time, tvb, offset, 1, ENC_NA);
15839       offset += 1;
15840       proto_tree_add_item(tree, hf_ieee80211_tag_min_pp_duration, tvb, offset, 1, ENC_NA);
15841       offset += 1;
15842       proto_tree_add_item(tree, hf_ieee80211_tag_SP_idle_timeout, tvb, offset, 1, ENC_NA);
15843       offset += 1;
15844       proto_tree_add_item(tree, hf_ieee80211_tag_max_lost_beacons, tvb, offset, 1, ENC_NA);
15845       offset += 1;
15846       break;
15847     }
15848     case TAG_ANTENNA_SECTOR_ID:
15849     {
15850       if (tag_len != 4)
15851       {
15852         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
15853         break;
15854       }
15855       offset += 2;
15856       proto_tree_add_item(tree, hf_ieee80211_tag_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15857       proto_tree_add_item(tree, hf_ieee80211_tag_tap1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15858       proto_tree_add_item(tree, hf_ieee80211_tag_state1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15859       proto_tree_add_item(tree, hf_ieee80211_tag_tap2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15860       proto_tree_add_item(tree, hf_ieee80211_tag_state2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15861       offset += 4;
15862       break;
15863     }
15864     case TAG_EXTENDED_SCHEDULE:
15865     {
15866       guint32 i = 0;
15867       gboolean isGrant;
15868       proto_tree * alloc_tree;
15869       if ((tag_len%15) != 0)
15870       {
15871         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be N*15 where 0<=N<=17", tag_len);
15872         break;
15873       }
15874       offset += 2;
15875       isGrant = ((ftype==CTRL_GRANT)||(ftype==CTRL_GRANT_ACK));
15876       for(i=0; i < tag_len; i+=15) {
15877         alloc_tree = proto_tree_add_subtree_format(tree, tvb, offset, 15, ett_allocation_tree, NULL, "Allocation %d", i/15);
15878         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15879         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15880         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pseudo_static, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15881         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_truncatable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15882         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_extendable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15883         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pcp_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15884         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_lp_sc_used, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15885         offset += 2;
15886         offset += add_ff_beamforming_ctrl(alloc_tree, tvb, pinfo, offset, isGrant);
15887         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_src_aid, tvb, offset, 1, ENC_NA);
15888         offset += 1;
15889         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_dest_aid, tvb, offset, 1, ENC_NA);
15890         offset += 1;
15891         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15892         offset += 4;
15893         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15894         offset += 2;
15895         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_num_blocks, tvb, offset, 1, ENC_NA);
15896         offset += 1;
15897         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15898         offset += 2;
15899       }
15900       break;
15901     }
15902     case TAG_STA_AVAILABILITY:
15903     {
15904       guint32 i = 0;
15905       proto_tree * sta_info_tree;
15906       if ((tag_len%2) != 0)
15907       {
15908         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be N*2 where N>=0", tag_len);
15909         break;
15910       }
15911       offset += 2;
15912       for(i=0; i < tag_len; i+=2) {
15913         sta_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 2, ett_sta_info, NULL, "STA Info %d", i/2);
15914         proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15915         proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_cbap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15916         proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_pp_avail, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15917         offset += 2;
15918       }
15919       break;
15920     }
15921     case TAG_NEXT_DMG_ATI:
15922     {
15923       if (tag_len != 6)
15924       {
15925         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
15926         break;
15927       }
15928       offset += 2;
15929       proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15930       offset += 4;
15931       proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15932       offset += 2;
15933       break;
15934     }
15935     case TAG_NEXTPCP_LIST:
15936     {
15937       guint32 i = 0;
15938       if (tag_len < 1)
15939       {
15940         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 1", tag_len);
15941         break;
15942       }
15943       offset += 2;
15944       proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_token, tvb, offset, 1, ENC_NA);
15945       offset += 1;
15946       for(i=0; i < tag_len-1; i+=1) {
15947         proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_list, tvb, offset, 1, ENC_NA);
15948         offset += 1;
15949       }
15950       break;
15951     }
15952     case TAG_PCP_HANDOVER:
15953     {
15954       if (tag_len != 13)
15955       {
15956         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 13", tag_len);
15957         break;
15958       }
15959       offset += 2;
15960       proto_tree_add_item(tree, hf_ieee80211_tag_old_bssid, tvb, offset, 6, ENC_NA);
15961       offset += 6;
15962       proto_tree_add_item(tree, hf_ieee80211_tag_new_pcp_addr, tvb, offset, 6, ENC_NA);
15963       offset += 6;
15964       proto_tree_add_item(tree, hf_ieee80211_tag_reamaining_BI, tvb, offset, 1, ENC_NA);
15965       offset += 1;
15966       break;
15967     }
15968     case TAG_BEAMLINK_MAINTAINCE:
15969     {
15970       if (tag_len != 1)
15971       {
15972         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
15973         break;
15974       }
15975       offset += 2;
15976       offset += add_ff_beamformed_link(tree, tvb, pinfo, offset);
15977       break;
15978     }
15979     case TAG_QUIET_PERIOD_RES:
15980     {
15981       if (tag_len != 10)
15982       {
15983         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 10", tag_len);
15984         break;
15985       }
15986       offset += 2;
15987       proto_tree_add_item(tree, hf_ieee80211_tag_request_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15988       offset += 2;
15989       proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
15990       offset += 6;
15991       offset += add_ff_sta_address(tree, tvb, pinfo, offset);
15992       break;
15993     }
15994     case TAG_RELAY_TRANSFER_PARAM:
15995     {
15996       if (tag_len != 8)
15997       {
15998         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
15999         break;
16000       }
16001       offset += 2;
16002       proto_tree_add_item(tree, hf_ieee80211_tag_duplex_relay, tvb, offset, 1, ENC_NA);
16003       proto_tree_add_item(tree, hf_ieee80211_tag_cooperation_relay, tvb, offset, 1, ENC_NA);
16004       proto_tree_add_item(tree, hf_ieee80211_tag_tx_mode, tvb, offset, 1, ENC_NA);
16005       proto_tree_add_item(tree, hf_ieee80211_tag_link_change_interval, tvb, offset+1, 1, ENC_NA);
16006       proto_tree_add_item(tree, hf_ieee80211_tag_data_sensing_time, tvb, offset+2, 1, ENC_NA);
16007       proto_tree_add_item(tree, hf_ieee80211_tag_first_period, tvb, offset+3, 2, ENC_LITTLE_ENDIAN);
16008       proto_tree_add_item(tree, hf_ieee80211_tag_second_period, tvb, offset+5, 2, ENC_LITTLE_ENDIAN);
16009       offset += 8;
16010       break;
16011     }
16012     case TAG_DMG_BEAM_REFINEMENT:
16013     {
16014       if (tag_len != 5)
16015       {
16016         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
16017         break;
16018       }
16019       offset += 2;
16020       proto_tree_add_item(tree, hf_ieee80211_tag_initiator, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16021       proto_tree_add_item(tree, hf_ieee80211_tag_tx_train_res, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16022       proto_tree_add_item(tree, hf_ieee80211_tag_rx_train_res, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16023       proto_tree_add_item(tree, hf_ieee80211_tag_tx_trn_ok, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16024       proto_tree_add_item(tree, hf_ieee80211_tag_txss_fbck_req, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16025       proto_tree_add_item(tree, hf_ieee80211_tag_bs_fbck, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16026       proto_tree_add_item(tree, hf_ieee80211_tag_bs_fbck_antenna_id, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16027       proto_tree_add_item(tree, hf_ieee80211_tag_snr_requested, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16028       proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_requested, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16029       proto_tree_add_item(tree, hf_ieee80211_tag_number_of_taps_requested, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16030       proto_tree_add_item(tree, hf_ieee80211_tag_sector_id_order_req, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16031       proto_tree_add_item(tree, hf_ieee80211_tag_snr_present, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16032       proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_present, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16033       proto_tree_add_item(tree, hf_ieee80211_tag_tap_delay_present, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16034       proto_tree_add_item(tree, hf_ieee80211_tag_number_of_taps_present, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16035       proto_tree_add_item(tree, hf_ieee80211_tag_number_of_measurement, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16036       proto_tree_add_item(tree, hf_ieee80211_tag_sector_id_order_present, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16037       proto_tree_add_item(tree, hf_ieee80211_tag_number_of_beams, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16038       proto_tree_add_item(tree, hf_ieee80211_tag_mid_extension, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16039       proto_tree_add_item(tree, hf_ieee80211_tag_capability_request, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16040       proto_tree_add_item(tree, hf_ieee80211_tag_beam_refine_reserved, tvb, offset, 5, ENC_LITTLE_ENDIAN);
16041       offset += 5;
16042       break;
16043     }
16044     case TAG_WAKEUP_SCHEDULE_AD:
16045     {
16046       if (tag_len != 8)
16047       {
16048         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
16049         break;
16050       }
16051       offset += 2;
16052       proto_tree_add_item(tree, hf_ieee80211_tag_bi_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16053       offset += 4;
16054       proto_tree_add_item(tree, hf_ieee80211_tag_sleep_cycle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16055       offset += 2;
16056       proto_tree_add_item(tree, hf_ieee80211_tag_num_awake_bis, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16057       offset += 2;
16058       break;
16059     }
16060     case TAG_DMG_TSPEC:
16061     {
16062       gboolean isGrant;
16063       int num_constraints;
16064       if (tag_len < 14)
16065       {
16066         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 14", tag_len);
16067         break;
16068       }
16069       offset += 2;
16070       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_id, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16071       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_type, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16072       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_format, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16073       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_pseudo_static, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16074       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_truncatable, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16075       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_extendable, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16076       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_lp_sc_used, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16077       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_up, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16078       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_dest_aid, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16079       offset += 3;
16080       isGrant = ((ftype==CTRL_GRANT)||(ftype==CTRL_GRANT_ACK));
16081       offset += add_ff_beamforming_ctrl(tree, tvb, pinfo, 2, isGrant);
16082       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16083       offset += 2;
16084       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16085       offset += 2;
16086       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_max_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16087       offset += 2;
16088       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16089       offset += 2;
16090       num_constraints = tvb_get_guint8(tvb, offset);
16091       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_num_of_constraints, tvb, offset, 1, ENC_NA);
16092       offset += 1;
16093       while(num_constraints > 0) {
16094         proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
16095         offset += 4;
16096         proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16097         offset += 2;
16098         proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16099         offset += 2;
16100         proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_interferer_mac, tvb, offset, 2, ENC_NA);
16101         offset += 6;
16102         num_constraints--;
16103       }
16104       break;
16105     }
16106     case TAG_CHANNEL_MEASURMENT_FB:
16107     {
16108       int num_measurement;
16109       if (tag_len%5 != 0)
16110       {
16111         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be multiple of 5", tag_len);
16112         break;
16113       }
16114       num_measurement = tvb_get_guint8(tvb, offset+1);
16115       offset += 2;
16116       while(num_measurement > 0) {
16117         proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
16118         offset += 1;
16119         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_I, tvb, offset, 1, ENC_NA);
16120         offset += 1;
16121         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_Q, tvb, offset, 1, ENC_NA);
16122         offset += 1;
16123         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_tap_delay, tvb, offset, 1, ENC_NA);
16124         offset += 1;
16125         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_sector_id, tvb, offset, 1, ENC_NA);
16126         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_antenna_id, tvb, offset, 1, ENC_NA);
16127         offset += 1;
16128         num_measurement--;
16129       }
16130       break;
16131     }
16132     case TAG_AWAKE_WINDOW:
16133     {
16134       if (tag_len != 2)
16135       {
16136         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 2", tag_len);
16137         break;
16138       }
16139       offset += 2;
16140       proto_tree_add_item(tree, hf_ieee80211_tag_awake_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16141       offset += 2;
16142       break;
16143     }
16144     case TAG_ADDBA_EXT:
16145     {
16146       if (tag_len != 1)
16147       {
16148         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
16149         break;
16150       }
16151       offset += 2;
16152       proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_no_frag, tvb, offset, 1, ENC_NA);
16153       offset += 1;
16154       break;
16155     }
16156     case TAG_MULTI_BAND:
16157     {
16158       gboolean chiper_present, addr_present;
16159       if (tag_len < 22)
16160       {
16161         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 22", tag_len);
16162         break;
16163       }
16164       offset += 2;
16165       chiper_present = (tvb_get_letohs(tvb, offset) & 0x08) >> 3;
16166       addr_present = (tvb_get_letohs(tvb, offset) & 0x10) >> 4;
16167       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_ctrl_sta_role, tvb, offset, 1, ENC_NA);
16168       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_ctrl_addr_present, tvb, offset, 1, ENC_NA);
16169       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_ctrl_cipher_present, tvb, offset, 1, ENC_NA);
16170       offset += 1;
16171       offset += add_ff_band_id(tree, tvb, pinfo, 1);
16172       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_oper_class, tvb, offset, 1, ENC_NA);
16173       offset += 1;
16174       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_channel_number, tvb, offset, 1, ENC_NA);
16175       offset += 1;
16176       proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
16177       offset += 6;
16178       offset += add_ff_beacon_interval(tree, tvb, pinfo, 2);
16179       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_tsf_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16180       offset += 8;
16181       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_ap, tvb, offset, 1, ENC_NA);
16182       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_pcp, tvb, offset, 1, ENC_NA);
16183       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_dls, tvb, offset, 1, ENC_NA);
16184       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_tdls, tvb, offset, 1, ENC_NA);
16185       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_ibss, tvb, offset, 1, ENC_NA);
16186       offset += 1;
16187       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_fst_timeout, tvb, offset, 1, ENC_NA);
16188       offset += 1;
16189       if(addr_present)
16190       {
16191         proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_sta_mac, tvb, offset, 6, ENC_NA);
16192         offset += 6;
16193       }
16194       if(chiper_present)
16195       {
16196         proto_item *rsn_pcs_count, *rsn_pcs_item, *rsn_sub_pcs_item;
16197         proto_tree *rsn_pcs_tree, *rsn_sub_pcs_tree;
16198         gint ii;
16199         guint16     pcs_count;
16200         rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16201         pcs_count = tvb_get_letohs(tvb, offset);
16202         offset += 2;
16203
16204         if (offset + (pcs_count * 4) > tag_end)
16205         {
16206           expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
16207           "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
16208           pcs_count = (tag_end - offset) / 4;
16209         }
16210
16211         rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
16212         rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
16213         for (ii = 0; ii < pcs_count; ii++)
16214         {
16215           rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
16216           rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
16217           proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
16218
16219           /* Check if OUI is 00:0F:AC (ieee80211) */
16220           if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
16221           {
16222             proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
16223             proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
16224           } else {
16225             proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
16226           }
16227           offset += 4;
16228         }
16229       }
16230       break;
16231     }
16232     case TAG_DMG_LINK_MARGIN:
16233     {
16234       if (tag_len != 8)
16235       {
16236         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
16237         break;
16238       }
16239       offset += 2;
16240       proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
16241       offset += 1;
16242       proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_mcs, tvb, offset, 1, ENC_NA);
16243       offset += 1;
16244       proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_link_margin, tvb, offset, 1, ENC_NA);
16245       offset += 1;
16246       proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
16247       offset += 1;
16248       proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16249       offset += 4;
16250       break;
16251     }
16252     case TAG_DMG_LINK_ADAPTION_ACK:
16253     {
16254       if (tag_len != 5)
16255       {
16256         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
16257         break;
16258       }
16259       offset += 2;
16260       proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
16261       offset += 1;
16262       proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16263       offset += 4;
16264       break;
16265     }
16266     case TAG_SWITCHING_STREAM:
16267     {
16268       int param_num;
16269       if (tag_len < 4)
16270       {
16271         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 4", tag_len);
16272         break;
16273       }
16274       offset += 2;
16275       offset += add_ff_band_id(tree, tvb, pinfo, 1);
16276       offset += add_ff_band_id(tree, tvb, pinfo, 1);
16277       proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_non_qos, tvb, offset, 1, ENC_NA);
16278       offset += 1;
16279       param_num = tvb_get_letohs(tvb, offset);
16280       proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_param_num, tvb, offset, 1, ENC_NA);
16281       offset += 1;
16282       while(param_num > 0)
16283       {
16284         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_old_tid, tvb, offset, 1, ENC_NA);
16285         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_old_direction, tvb, offset, 1, ENC_NA);
16286         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_new_tid, tvb, offset, 1, ENC_NA);
16287         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_new_direction, tvb, offset, 1, ENC_NA);
16288         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_new_valid_id, tvb, offset, 1, ENC_NA);
16289         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_llt_type, tvb, offset, 1, ENC_NA);
16290         param_num--;
16291         offset += 2;
16292       }
16293       break;
16294     }
16295     default:
16296       proto_tree_add_item(tree, hf_ieee80211_tag_data, tvb, offset + 1 + 1, tag_len, ENC_NA);
16297       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_data,
16298                              "Dissector for 802.11 IE Tag"
16299                              " (%s) code not implemented, Contact"
16300                              " Wireshark developers if you want this supported", val_to_str_ext(tag_no,
16301                                             &tag_num_vals_ext, "(%d)"));
16302       proto_item_append_text(ti, ": Undecoded");
16303       break;
16304   }
16305   if (offset < tag_end) {
16306     /* TODO: add Expert info to indicate there is unknown data ! but all tagged option don't yet return offset.
16307       For the moment, this code only remove Clang Warnings about not used offset... */
16308   }
16309 end_of_tag:
16310   return tag_len + 1 + 1;
16311 }
16312
16313 static void
16314 ieee_80211_add_tagged_parameters(tvbuff_t *tvb, int offset, packet_info *pinfo,
16315                                   proto_tree *tree, int tagged_parameters_len, int ftype,
16316                                   association_sanity_check_t *association_sanity_check)
16317 {
16318   int next_len;
16319   beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
16320   while (tagged_parameters_len > 0) {
16321     /* TODO make callers optionally specify the list of valid IE IDs? */
16322     if ((next_len=add_tagged_field (pinfo, tree, tvb, offset, ftype, NULL, 0, association_sanity_check)) == 0)
16323       break;
16324     if (next_len > tagged_parameters_len) {
16325       /* XXX - flag this as an error? */
16326       next_len = tagged_parameters_len;
16327     }
16328     offset                += next_len;
16329     tagged_parameters_len -= next_len;
16330   }
16331 }
16332
16333 static void
16334 ieee_80211_do_association_sanity_check(packet_info *pinfo, association_sanity_check_t *sanity_check)
16335 {
16336   /* Given a [re-]association request frame, consider it in its totality and
16337      add expert information as appropriate */
16338
16339   if (sanity_check->association_has_mobility_domain_element) {
16340     /* This is an FT association, warn about any non-FT AKM suites */
16341     if (sanity_check->has_non_ft_akm_suite) {
16342       expert_add_info_format(pinfo, sanity_check->rsn_first_non_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
16343                              "Non-FT AKM suite is prohibited for FT association request");
16344     }
16345   } else {
16346     /* This is a non-FT association, warn about any FT AKM suites */
16347     if (sanity_check->has_ft_akm_suite) {
16348       expert_add_info_format(pinfo, sanity_check->rsn_first_ft_akm_suite, &ei_ieee80211_mismatched_akm_suite,
16349                              "FT AKM suite is prohibited for non-FT association request");
16350     }
16351   }
16352 }
16353
16354 /* ************************************************************************* */
16355 /*                     Dissect 802.11 management frame                       */
16356 /* ************************************************************************* */
16357 static void
16358 dissect_ieee80211_mgt(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
16359 {
16360   proto_item *ti;
16361   proto_tree *mgt_tree;
16362   proto_tree *fixed_tree;
16363   proto_tree *tagged_tree;
16364   int         offset = 0;
16365   int         tagged_parameter_tree_len;
16366
16367   association_sanity_check_t association_sanity_check;
16368   memset(&association_sanity_check, 0, sizeof(association_sanity_check));
16369
16370   ieee80211_tvb_invalid = FALSE;
16371
16372   ti = proto_tree_add_item(tree, proto_wlan, tvb, 0, -1, ENC_NA);
16373   mgt_tree = proto_item_add_subtree(ti, ett_80211_mgt);
16374
16375   switch (COMPOSE_FRAME_TYPE(fcf))
16376   {
16377
16378     case MGT_ASSOC_REQ:
16379       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 4);
16380       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
16381       add_ff_listen_ival(fixed_tree, tvb, pinfo, 2);
16382       offset = 4;  /* Size of fixed fields */
16383
16384       tagged_parameter_tree_len =
16385           tvb_reported_length_remaining(tvb, offset);
16386       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16387                  tagged_parameter_tree_len);
16388       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16389           tagged_parameter_tree_len, MGT_ASSOC_REQ, &association_sanity_check);
16390       ieee_80211_do_association_sanity_check(pinfo, &association_sanity_check);
16391       break;
16392
16393
16394     case MGT_ASSOC_RESP:
16395       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
16396       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
16397       add_ff_status_code(fixed_tree, tvb, pinfo, 2);
16398       add_ff_assoc_id(fixed_tree, tvb, pinfo, 4);
16399       offset = 6;  /* Size of fixed fields */
16400
16401       tagged_parameter_tree_len =
16402           tvb_reported_length_remaining(tvb, offset);
16403       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16404                  tagged_parameter_tree_len);
16405       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16406           tagged_parameter_tree_len, MGT_ASSOC_RESP, NULL);
16407       break;
16408
16409
16410     case MGT_REASSOC_REQ:
16411       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 10);
16412       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
16413       add_ff_listen_ival(fixed_tree, tvb, pinfo, 2);
16414       add_ff_current_ap_addr(fixed_tree, tvb, pinfo, 4);
16415       offset = 10;  /* Size of fixed fields */
16416
16417       tagged_parameter_tree_len =
16418           tvb_reported_length_remaining(tvb, offset);
16419       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16420                  tagged_parameter_tree_len);
16421       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16422           tagged_parameter_tree_len, MGT_REASSOC_REQ, &association_sanity_check);
16423       ieee_80211_do_association_sanity_check(pinfo, &association_sanity_check);
16424       break;
16425
16426     case MGT_REASSOC_RESP:
16427       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
16428       add_ff_cap_info(fixed_tree, tvb, pinfo, 0);
16429       add_ff_status_code(fixed_tree, tvb, pinfo, 2);
16430       add_ff_assoc_id(fixed_tree, tvb, pinfo, 4);
16431       offset = 6;  /* Size of fixed fields */
16432
16433       tagged_parameter_tree_len =
16434           tvb_reported_length_remaining(tvb, offset);
16435       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16436                  tagged_parameter_tree_len);
16437       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16438           tagged_parameter_tree_len, MGT_REASSOC_RESP, NULL);
16439       break;
16440
16441
16442     case MGT_PROBE_REQ:
16443       offset = 0;
16444       tagged_parameter_tree_len =
16445           tvb_reported_length_remaining(tvb, offset);
16446       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16447                  tagged_parameter_tree_len);
16448       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16449           tagged_parameter_tree_len, MGT_PROBE_REQ, NULL);
16450       break;
16451
16452     case MGT_PROBE_RESP:
16453     {
16454       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
16455       add_ff_timestamp(fixed_tree, tvb, pinfo, 0);
16456       add_ff_beacon_interval(fixed_tree, tvb, pinfo, 8);
16457       add_ff_cap_info(fixed_tree, tvb, pinfo, 10);
16458       offset = 12;  /* Size of fixed fields */
16459
16460       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16461       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset, tagged_parameter_tree_len);
16462       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_PROBE_RESP, NULL);
16463       break;
16464     }
16465     case MGT_MEASUREMENT_PILOT:
16466     {
16467       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
16468       offset += add_ff_timestamp(fixed_tree, tvb, pinfo, offset);
16469       offset += add_ff_measurement_pilot_int(fixed_tree, tvb, pinfo, offset);
16470       offset += add_ff_beacon_interval(fixed_tree, tvb, pinfo, offset);
16471       offset += add_ff_cap_info(fixed_tree, tvb, pinfo, offset);
16472       offset += add_ff_country_str(fixed_tree, tvb, pinfo, offset);
16473       offset += add_ff_max_reg_pwr(fixed_tree, tvb, pinfo, offset);
16474       offset += add_ff_max_tx_pwr(fixed_tree, tvb, pinfo, offset);
16475       offset += add_ff_tx_pwr_used(fixed_tree, tvb, pinfo, offset);
16476       offset += add_ff_transceiver_noise_floor(fixed_tree, tvb, pinfo, offset);
16477       /* TODO DS Parameter Set ??? */
16478
16479       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16480       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset, tagged_parameter_tree_len);
16481       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_MEASUREMENT_PILOT, NULL);
16482       break;
16483     }
16484     case MGT_BEACON:    /* Dissect protocol payload fields  */
16485       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 12);
16486       add_ff_timestamp(fixed_tree, tvb, pinfo, 0);
16487       add_ff_beacon_interval(fixed_tree, tvb, pinfo, 8);
16488       add_ff_cap_info(fixed_tree, tvb, pinfo, 10);
16489       offset = 12;  /* Size of fixed fields */
16490
16491       tagged_parameter_tree_len =
16492           tvb_reported_length_remaining(tvb, offset);
16493       tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16494       tagged_parameter_tree_len);
16495       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16496       tagged_parameter_tree_len, MGT_BEACON, NULL);
16497       break;
16498
16499     case MGT_ATIM:
16500       break;
16501
16502     case MGT_DISASS:
16503       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 2);
16504       add_ff_reason_code(fixed_tree, tvb, pinfo, 0);
16505       offset = 2; /* Size of fixed fields */
16506       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16507       if (tagged_parameter_tree_len > 0) {
16508         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16509                                                 tagged_parameter_tree_len);
16510         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16511                                          tagged_parameter_tree_len, MGT_DISASS, NULL);
16512       }
16513       break;
16514
16515     case MGT_AUTHENTICATION:
16516       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 6);
16517       add_ff_auth_alg(fixed_tree, tvb, pinfo, 0);
16518       add_ff_auth_trans_seq(fixed_tree, tvb, pinfo, 2);
16519       add_ff_status_code(fixed_tree, tvb, pinfo, 4);
16520       offset = 6;  /* Size of fixed fields */
16521
16522       tagged_parameter_tree_len =
16523         tvb_reported_length_remaining(tvb, offset);
16524       if (tagged_parameter_tree_len > 0)
16525       {
16526         tagged_tree = get_tagged_parameter_tree(mgt_tree,
16527             tvb,
16528             offset,
16529             tagged_parameter_tree_len);
16530         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16531         tagged_parameter_tree_len, MGT_AUTHENTICATION, NULL);
16532       }
16533       break;
16534
16535     case MGT_DEAUTHENTICATION:
16536       fixed_tree = get_fixed_parameter_tree(mgt_tree, tvb, 0, 2);
16537       add_ff_reason_code(fixed_tree, tvb, pinfo, 0);
16538       offset = 2; /* Size of fixed fields */
16539       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16540       if (tagged_parameter_tree_len > 0) {
16541         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16542                                                 tagged_parameter_tree_len);
16543         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16544                                          tagged_parameter_tree_len, MGT_DEAUTHENTICATION, NULL);
16545       }
16546       break;
16547
16548     case MGT_ACTION:
16549     {
16550       proto_item *lcl_fixed_hdr;
16551       proto_tree *lcl_fixed_tree;
16552       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
16553       offset += add_ff_action(lcl_fixed_tree, tvb, pinfo, 0);
16554
16555       proto_item_set_len(lcl_fixed_hdr, offset);
16556       if (ieee80211_tvb_invalid)
16557         break; /* Buffer not available for further processing */
16558       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16559       if (tagged_parameter_tree_len > 0)
16560       {
16561         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16562           tagged_parameter_tree_len);
16563         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16564           tagged_parameter_tree_len, MGT_ACTION, NULL);
16565       }
16566       break;
16567     }
16568     case MGT_ACTION_NO_ACK:
16569     {
16570       proto_item *lcl_fixed_hdr;
16571       proto_tree *lcl_fixed_tree;
16572       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
16573
16574       offset += add_ff_action(lcl_fixed_tree, tvb, pinfo, 0);
16575
16576       proto_item_set_len(lcl_fixed_hdr, offset);
16577       if (ieee80211_tvb_invalid)
16578         break; /* Buffer not available for further processing */
16579       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16580       if (tagged_parameter_tree_len > 0)
16581       {
16582         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16583           tagged_parameter_tree_len);
16584         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16585           tagged_parameter_tree_len, MGT_ACTION_NO_ACK, NULL);
16586       }
16587       break;
16588     }
16589     case MGT_ARUBA_WLAN:
16590     {
16591       proto_tree *aruba_tree;
16592       guint16 type;
16593       type = tvb_get_ntohs(tvb, offset);
16594
16595       aruba_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, NULL, "Aruba Management");
16596
16597       proto_tree_add_item(aruba_tree, hf_ieee80211_aruba, tvb, offset, 2, ENC_BIG_ENDIAN);
16598       offset += 2;
16599       switch(type){
16600         case 0x0003: /* MTU Size */
16601           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_mtu, tvb, offset, 2, ENC_BIG_ENDIAN);
16602         break;
16603         case 0x0005: /* HeartBeat Sequence */
16604           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_hb_seq, tvb, offset, 8, ENC_BIG_ENDIAN);
16605         break;
16606       }
16607       break;
16608     }
16609   }
16610 }
16611
16612 static void
16613 set_src_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
16614 {
16615   address      ether_addr;
16616
16617   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
16618
16619   col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
16620         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
16621 }
16622
16623 static void
16624 set_dst_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
16625 {
16626   address      ether_addr;
16627
16628   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
16629
16630   col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
16631         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
16632 }
16633
16634 static guint32
16635 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
16636 {
16637   guint32 c_crc;
16638
16639   c_crc = crc32_ccitt_tvb(tvb, hdr_len);
16640   c_crc = crc32_ccitt_tvb_offset_seed(tvb, hdr_size, len, ~c_crc);
16641
16642   return (c_crc);
16643 }
16644
16645 typedef enum {
16646     ENCAP_802_2,
16647     ENCAP_IPX,
16648     ENCAP_ETHERNET
16649 } encap_t;
16650
16651 /* ************************************************************************* */
16652 /*                          Dissect 802.11 frame                             */
16653 /* ************************************************************************* */
16654 /*
16655  * The 802.11n specification makes some fairly significant changes to the
16656  * layout of the MAC header.  The first two bits of the MAC header are the
16657  * protocol version.  You'd think that the 802.11 committee would have
16658  * bumped the version to indicate a different MAC layout, but NOOOO -- we
16659  * have to go digging for bits in various locations instead.
16660  */
16661 static int
16662 dissect_ieee80211_common(tvbuff_t *tvb, packet_info *pinfo,
16663                           proto_tree *tree, guint32 option_flags,
16664                           struct ieee_802_11_phdr *phdr)
16665 {
16666   guint16          fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
16667   guint16          cw_fcf;
16668   guint16          seq_control;
16669   guint32          seq_number, frag_number;
16670   gboolean         more_frags;
16671   proto_item      *ti          = NULL;
16672   proto_item      *cw_item     = NULL;
16673   proto_item      *hidden_item;
16674   proto_tree      *cw_tree     = NULL;
16675   guint16          hdr_len, ohdr_len;
16676   guint16          htc_len     = 0;
16677   gboolean         has_fcs;
16678   gint             len, reported_len, ivlen;
16679   gint             sta_addr_offset = 0;
16680   const gchar     *station_name;
16681   gboolean         is_amsdu    = 0;
16682   gboolean         save_fragmented;
16683   guint32          addr_type;
16684   guint8           octet1, octet2;
16685   char             out_buff[SHORT_STR];
16686   gint             is_iv_bad;
16687   guchar           iv_buff[4];
16688   const char      *addr1_str   = NULL;
16689   int              addr1_hf    = -1, addr1_hf_resolved = -1;
16690   guint            offset;
16691   const gchar     *fts_str;
16692   gchar            flag_str[]  = "opmPRMFTC";
16693   gint             ii;
16694   guint16          qosoff      = 0;
16695   guint16          qos_control = 0;
16696   gint             meshctl_len = 0;
16697   guint8           mesh_flags;
16698   guint16          meshoff     = 0;
16699   static wlan_hdr_t whdrs[4];
16700   gboolean         retransmitted;
16701   gboolean         isDMG = (phdr->has_frequency ?
16702                                 IS_80211AD(phdr->frequency) :
16703                                 FALSE);
16704
16705   encap_t     encap_type;
16706   proto_tree *hdr_tree = NULL;
16707   tvbuff_t   *next_tvb = NULL;
16708   wlan_hdr_t *whdr;
16709
16710   AIRPDCAP_KEY_ITEM  used_key;
16711
16712   p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY, &isDMG);
16713
16714   whdr= &whdrs[0];
16715
16716   col_set_str(pinfo->cinfo, COL_PROTOCOL, "802.11");
16717   col_clear(pinfo->cinfo, COL_INFO);
16718
16719   fcf = FETCH_FCF(0);
16720   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
16721   whdr->type = frame_type_subtype;
16722   if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
16723     ctrl_fcf = FETCH_FCF(10);
16724   else
16725     ctrl_fcf = 0;
16726
16727   fts_str = val_to_str_ext_const(frame_type_subtype, &frame_type_subtype_vals_ext,
16728                                  "Unrecognized (Reserved frame)");
16729   col_set_str(pinfo->cinfo, COL_INFO, fts_str);
16730
16731
16732 # define FROM_TO_DS 3
16733   flags = FCF_FLAGS(fcf);
16734   more_frags = HAVE_FRAGMENTS(flags);
16735
16736   for (ii = 0; ii < 8; ii++) {
16737     if (! (flags & 0x80 >> ii)) {
16738       flag_str[ii] = '.';
16739     }
16740   }
16741
16742   switch (FCF_FRAME_TYPE (fcf)) {
16743
16744   case MGT_FRAME:
16745     hdr_len = MGT_FRAME_HDR_LEN;
16746     if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
16747       /*
16748        * Management frames with the Order bit set have an HT Control field;
16749        * see 8.2.4.1.10 "Order field".  If they're not HT frames, they should
16750        * never have the Order bit set.
16751        */
16752       hdr_len += 4;
16753       htc_len = 4;
16754     }
16755     break;
16756
16757   case CONTROL_FRAME:
16758     if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
16759       hdr_len = 6;
16760       cw_fcf = ctrl_fcf;
16761     } else {
16762       hdr_len = 0;
16763       cw_fcf = fcf;
16764     }
16765     switch (COMPOSE_FRAME_TYPE (cw_fcf)) {
16766
16767     case CTRL_BEAMFORM_RPT_POLL:
16768       hdr_len += 17;
16769       break;
16770
16771     case CTRL_VHT_NDP_ANNC:
16772       hdr_len += 17;
16773       /* TODO: for now we only consider a single STA, add support for more */
16774       hdr_len += 2;
16775       break;
16776
16777     case CTRL_CTS:
16778     case CTRL_ACKNOWLEDGEMENT:
16779       hdr_len += 10;
16780       break;
16781
16782     case CTRL_POLL:
16783       hdr_len += 18;
16784       break;
16785
16786     case CTRL_SPR:
16787     case CTRL_GRANT:
16788     case CTRL_GRANT_ACK:
16789       hdr_len += 23;
16790       break;
16791
16792     case CTRL_DMG_CTS:
16793       hdr_len += 16;
16794       break;
16795
16796     case CTRL_DMG_DTS:
16797     case CTRL_SSW:
16798       hdr_len += 22;
16799       break;
16800
16801     case CTRL_SSW_FEEDBACK:
16802     case CTRL_SSW_ACK:
16803       hdr_len += 24;
16804       break;
16805
16806     case CTRL_RTS:
16807     case CTRL_PS_POLL:
16808     case CTRL_CFP_END:
16809     case CTRL_CFP_ENDACK:
16810     case CTRL_BLOCK_ACK_REQ:
16811     case CTRL_BLOCK_ACK:
16812       hdr_len += 16;
16813       break;
16814
16815     default:
16816       hdr_len += 4;  /* XXX */
16817       break;
16818     }
16819     break;
16820
16821   case DATA_FRAME:
16822     hdr_len = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
16823
16824     if ((option_flags & IEEE80211_COMMON_OPT_NORMAL_QOS) && DATA_FRAME_IS_QOS(frame_type_subtype)) {
16825       /* QoS frame */
16826       qosoff = hdr_len;
16827       hdr_len += 2; /* Include the QoS field in the header length */
16828
16829       if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
16830         /*
16831          * QoS data frames with the Order bit set have an HT Control field;
16832          * see 8.2.4.1.10 "Order field".  If they're not HT frames, they
16833          * should never have the Order bit set.
16834          */
16835         hdr_len += 4;
16836         htc_len = 4;
16837       }
16838
16839       /*
16840        * Does it look as if we have a mesh header?
16841        * Look at the Mesh Control subfield of the QoS field and at the
16842        * purported mesh flag fields.
16843        */
16844       qos_control = tvb_get_letohs(tvb, qosoff);
16845       if (tvb_bytes_exist(tvb, hdr_len, 1)) {
16846         meshoff = hdr_len;
16847         mesh_flags = tvb_get_guint8(tvb, meshoff);
16848         if (has_mesh_control(fcf, qos_control, mesh_flags)) {
16849           /* Yes, add the length of that in as well. */
16850           meshctl_len = find_mesh_control_length(mesh_flags);
16851           hdr_len += meshctl_len;
16852         }
16853       }
16854     }
16855     break;
16856
16857   case EXTENSION_FRAME:
16858     hdr_len = 10;
16859     break;
16860
16861   default:
16862     hdr_len = 4;  /* XXX */
16863     break;
16864   }
16865
16866   /*
16867    * Some portions of this code calculate offsets relative to the end of the
16868    * header.  But when the header has been padded to align the data this must
16869    * be done relative to true header size, not the padded/aligned value.  To
16870    * simplify this work we stash the original header size in ohdr_len instead
16871    * of recalculating it every time we need it.
16872    */
16873   ohdr_len = hdr_len;
16874   if (phdr->datapad) {
16875     /*
16876      * Add in Atheros padding between the 802.11 header and body.
16877      *
16878      * XXX - would the mesh header be part of the header or the body
16879      * from the point of view of the Atheros adapters that insert
16880      * the padding, assuming they even recognize a mesh header?
16881      */
16882     hdr_len = roundup2(hdr_len, 4);
16883   }
16884
16885   /* Add the FC and duration/id to the current tree */
16886   ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
16887                                            "IEEE 802.11 %s", fts_str);
16888   hdr_tree = proto_item_add_subtree(ti, ett_80211);
16889
16890   dissect_frame_control(hdr_tree, tvb, option_flags, 0, pinfo);
16891   dissect_durid(hdr_tree, tvb, frame_type_subtype, 2);
16892
16893   switch (phdr->fcs_len)
16894     {
16895       case 0: /* Definitely has no FCS */
16896         has_fcs = FALSE;
16897         break;
16898
16899       case 4: /* Definitely has an FCS */
16900         has_fcs = TRUE;
16901         break;
16902
16903       case -2: /* Data frames have no FCS, other frames may have an FCS */
16904                /* XXX: -2 currently used only in wiretap/netmon.c       */
16905         if (FCF_FRAME_TYPE (fcf) == DATA_FRAME)
16906           has_fcs = FALSE;
16907         else /* Management, Control, Extension */
16908           has_fcs = wlan_check_fcs;
16909         break;
16910
16911       default: /* Don't know - use "wlan_check_fcs" */
16912         has_fcs = wlan_check_fcs;
16913         break;
16914     }
16915
16916   /*
16917    * Decode the part of the frame header that isn't the same for all
16918    * frame types.
16919    */
16920   seq_control = 0;
16921   frag_number = 0;
16922   seq_number = 0;
16923
16924   switch (FCF_FRAME_TYPE (fcf))
16925   {
16926
16927     case MGT_FRAME:
16928       /*
16929        * All management frame types have the same header.
16930        */
16931       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, 10);
16932       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
16933       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, 4);
16934       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
16935
16936       /* for tap */
16937       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, 16);
16938       copy_address_shallow(&whdr->src, &pinfo->dl_src);
16939       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
16940
16941       seq_control = tvb_get_letohs(tvb, 22);
16942       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
16943       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
16944
16945       col_append_fstr(pinfo->cinfo, COL_INFO,
16946             ", SN=%d", seq_number);
16947
16948       col_append_fstr(pinfo->cinfo, COL_INFO,
16949             ", FN=%d", frag_number);
16950
16951       if (tree)
16952       {
16953         const gchar *ra_da_name, *ta_sa_name, *bssid_name;
16954
16955         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
16956         ra_da_name = tvb_get_ether_name(tvb, 4);
16957         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ra_resolved, tvb, 4, 6, ra_da_name);
16958         PROTO_ITEM_SET_HIDDEN(hidden_item);
16959         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
16960         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, 4, 6, ra_da_name);
16961         PROTO_ITEM_SET_HIDDEN(hidden_item);
16962         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
16963         ta_sa_name = tvb_get_ether_name(tvb, 10);
16964         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, 10, 6, ta_sa_name);
16965         PROTO_ITEM_SET_HIDDEN(hidden_item);
16966         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
16967         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, 10, 6, ta_sa_name);
16968         PROTO_ITEM_SET_HIDDEN(hidden_item);
16969         proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
16970         bssid_name = tvb_get_ether_name(tvb, 16);
16971         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, 16, 6, bssid_name);
16972         PROTO_ITEM_SET_HIDDEN(hidden_item);
16973
16974         /* FIXME: With mgmt frames FROM_TO_DS is always 0, perhaps compare address to bssid instead? */
16975         if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
16976           sta_addr_offset = 4;
16977         } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
16978           sta_addr_offset = 10;
16979         }
16980         if (sta_addr_offset > 0) {
16981           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
16982           station_name = tvb_get_ether_name(tvb, sta_addr_offset);
16983           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
16984           PROTO_ITEM_SET_HIDDEN(hidden_item);
16985         }
16986         /* add items for wlan.addr filter */
16987         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
16988         PROTO_ITEM_SET_HIDDEN(hidden_item);
16989         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 4, 6, ra_da_name);
16990         PROTO_ITEM_SET_HIDDEN(hidden_item);
16991         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
16992         PROTO_ITEM_SET_HIDDEN(hidden_item);
16993         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 10, 6, ta_sa_name);
16994         PROTO_ITEM_SET_HIDDEN(hidden_item);
16995         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
16996         PROTO_ITEM_SET_HIDDEN(hidden_item);
16997         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 16, 6, bssid_name);
16998         PROTO_ITEM_SET_HIDDEN(hidden_item);
16999         proto_tree_add_item(hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
17000         proto_tree_add_item(hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
17001       }
17002       break;
17003
17004     case CONTROL_FRAME:
17005     {
17006       /*
17007        * Control Wrapper frames insert themselves between address 1
17008        * and address 2 in a normal control frame.  Process address 1
17009        * first, then handle the rest of the frame in dissect_control.
17010        */
17011       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
17012         offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
17013         ctrl_fcf = FETCH_FCF(10);
17014         ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
17015       } else {
17016         offset = 10; /* FC + D/ID + Address 1 */
17017         ctrl_type_subtype = frame_type_subtype;
17018       }
17019       /* Added to disallow DMG STA to transfer packets of certain forbidden types. */
17020       switch (ctrl_type_subtype)
17021       {
17022         case CTRL_PS_POLL:
17023         case CTRL_CTS:
17024         case CTRL_CFP_ENDACK:
17025         if(isDMG == TRUE) {
17026           expert_add_info_format(pinfo, hdr_tree, &ei_ieee80211_dmg_subtype,
17027               "DMG STA shouldn't transmit control frame of type contention-free period end+ack");
17028         }
17029         break;
17030         default:
17031           break;
17032       }
17033
17034       switch (ctrl_type_subtype)
17035       {
17036         case CTRL_PS_POLL:
17037           addr1_str = "BSSID";
17038           addr1_hf = hf_ieee80211_addr_bssid;
17039           addr1_hf_resolved = hf_ieee80211_addr_bssid_resolved;
17040
17041           break;
17042         case CTRL_BEAMFORM_RPT_POLL:
17043         case CTRL_VHT_NDP_ANNC:
17044         case CTRL_RTS:
17045         case CTRL_POLL:
17046         case CTRL_SPR:
17047         case CTRL_GRANT:
17048         case CTRL_DMG_CTS:
17049         case CTRL_DMG_DTS:
17050         case CTRL_GRANT_ACK:
17051         case CTRL_SSW:
17052         case CTRL_SSW_FEEDBACK:
17053         case CTRL_SSW_ACK:
17054         case CTRL_CTS:
17055         case CTRL_ACKNOWLEDGEMENT:
17056         case CTRL_CFP_END:
17057         case CTRL_CFP_ENDACK:
17058         case CTRL_BLOCK_ACK_REQ:
17059         case CTRL_BLOCK_ACK:
17060           addr1_str = "RA";
17061           addr1_hf = hf_ieee80211_addr_ra;
17062           addr1_hf_resolved = hf_ieee80211_addr_ra_resolved;
17063           break;
17064         default:
17065           break;
17066       }
17067
17068       if (!addr1_str) /* XXX - Should we throw some sort of error? */
17069         break;
17070
17071       /* Add address 1 */
17072       set_dst_addr_cols(pinfo, tvb, 4, addr1_str);
17073       if (tree) {
17074         const gchar *ether_name = tvb_get_ether_name(tvb, 4);
17075         proto_tree_add_item(hdr_tree, addr1_hf, tvb, 4, 6, ENC_NA);
17076         hidden_item = proto_tree_add_string(hdr_tree, addr1_hf_resolved, tvb, 4, 6, ether_name);
17077         PROTO_ITEM_SET_HIDDEN(hidden_item);
17078         hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
17079         PROTO_ITEM_SET_HIDDEN(hidden_item);
17080         hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, 4, 6, ether_name);
17081         PROTO_ITEM_SET_HIDDEN(hidden_item);
17082       }
17083
17084       /*
17085        * Start shoving in other fields if needed.
17086        */
17087       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
17088         /* if (tree) */
17089         {
17090           cw_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
17091                       ett_cntrl_wrapper_fc, NULL, "Contained Frame Control");
17092           dissect_frame_control(cw_tree, tvb, 0, offset, pinfo);
17093           dissect_ht_control(hdr_tree, tvb, offset + 2);
17094           offset += 6;
17095           hdr_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
17096                       ett_cntrl_wrapper_fc, &cw_item, "Carried Frame");
17097           if (isDMG) {
17098             expert_add_info_format(pinfo, cw_item, &ei_ieee80211_dmg_subtype,
17099                                    "DMG STA shouldn't transmit Control Wrapper frame");
17100           }
17101         }
17102       }
17103
17104       switch (ctrl_type_subtype)
17105       {
17106         case CTRL_PS_POLL:
17107         case CTRL_CFP_ENDACK:
17108         {
17109           set_src_addr_cols(pinfo, tvb, offset, "BSSID");
17110           /* if (tree) */
17111           {
17112             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
17113             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17114             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17115             PROTO_ITEM_SET_HIDDEN(hidden_item);
17116             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17117             PROTO_ITEM_SET_HIDDEN(hidden_item);
17118             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17119             PROTO_ITEM_SET_HIDDEN(hidden_item);
17120             offset += 6;
17121           }
17122           break;
17123         }
17124
17125         case CTRL_CFP_END:
17126         {
17127           if (isDMG)
17128             set_src_addr_cols(pinfo, tvb, offset, "TA");
17129           else
17130             set_src_addr_cols(pinfo, tvb, offset, "BSSID");
17131           /* if (tree) */
17132           {
17133             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
17134             if (isDMG) {
17135               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17136               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17137               PROTO_ITEM_SET_HIDDEN(hidden_item);
17138             } else {
17139               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, offset, 6, ENC_NA);
17140               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, offset, 6, ether_name);
17141               PROTO_ITEM_SET_HIDDEN(hidden_item);
17142             }
17143             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17144             PROTO_ITEM_SET_HIDDEN(hidden_item);
17145             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17146             PROTO_ITEM_SET_HIDDEN(hidden_item);
17147             offset += 6;
17148           }
17149           break;
17150         }
17151
17152         case CTRL_BEAMFORM_RPT_POLL:
17153         {
17154           set_src_addr_cols(pinfo, tvb, offset, "TA");
17155           /* if (tree) */
17156           {
17157             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
17158
17159             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17160             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17161             PROTO_ITEM_SET_HIDDEN(hidden_item);
17162             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17163             PROTO_ITEM_SET_HIDDEN(hidden_item);
17164             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17165             PROTO_ITEM_SET_HIDDEN(hidden_item);
17166             offset += 6;
17167
17168             proto_tree_add_item(hdr_tree, hf_ieee80211_beamform_feedback_seg_retrans_bitmap, tvb, offset, 1, ENC_NA);
17169           }
17170         break;
17171         }
17172
17173         case CTRL_VHT_NDP_ANNC:
17174         {
17175           set_src_addr_cols(pinfo, tvb, offset, "TA");
17176           /* if (tree) */
17177           {
17178             guint16 sta_info;
17179             guint8 len_fcs = 0;
17180             proto_tree *dialog_token_tree;
17181             proto_item *dialog_token_item;
17182             proto_tree *sta_info_tree;
17183             proto_item *sta_info_item;
17184             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
17185
17186             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17187             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17188             PROTO_ITEM_SET_HIDDEN(hidden_item);
17189             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17190             PROTO_ITEM_SET_HIDDEN(hidden_item);
17191             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17192             PROTO_ITEM_SET_HIDDEN(hidden_item);
17193             offset += 6;
17194
17195             dialog_token_item = proto_tree_add_item(hdr_tree, hf_ieee80211_vht_ndp_annc_token,
17196                                                     tvb, offset, 1, ENC_NA);
17197             dialog_token_tree = proto_item_add_subtree(dialog_token_item, ett_vht_ndp_annc_token_tree);
17198             proto_tree_add_item(dialog_token_tree, hf_ieee80211_vht_ndp_annc_token_number,
17199                                 tvb, offset, 1, ENC_NA);
17200             proto_tree_add_item(dialog_token_tree, hf_ieee80211_vht_ndp_annc_token_reserved,
17201                                 tvb, offset, 1, ENC_NA);
17202             offset++;
17203
17204             /* Check if there is FCS in the packet */
17205             if(has_fcs){
17206               len_fcs = 4;
17207             }
17208             while (tvb_reported_length_remaining(tvb, offset) > len_fcs) {
17209               sta_info_item = proto_tree_add_item(hdr_tree, hf_ieee80211_vht_ndp_annc_sta_info,
17210                                                   tvb, offset, 2, ENC_LITTLE_ENDIAN);
17211               sta_info_tree = proto_item_add_subtree(sta_info_item, ett_vht_ndp_annc_sta_info_tree);
17212               proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_aid12,
17213                                   tvb, offset, 2, ENC_LITTLE_ENDIAN);
17214               proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
17215                                   tvb, offset, 2, ENC_LITTLE_ENDIAN);
17216
17217               sta_info = tvb_get_letohs(tvb, offset);
17218
17219               if (sta_info & 0x1000)
17220                 proto_tree_add_uint(sta_info_tree,
17221                                     hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
17222                                     tvb, offset, 2, sta_info);
17223               else
17224                 proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_reserved,
17225                                     tvb, offset, 2, ENC_LITTLE_ENDIAN);
17226               offset += 2;
17227             }
17228           }
17229         break;
17230         }
17231
17232         case CTRL_GRANT_ACK:
17233         case CTRL_SSW:
17234         case CTRL_SSW_FEEDBACK:
17235         case CTRL_SSW_ACK:
17236         case CTRL_DMG_CTS:
17237         case CTRL_GRANT:
17238         case CTRL_SPR:
17239         case CTRL_POLL:
17240         case CTRL_RTS:
17241         {
17242           set_src_addr_cols(pinfo, tvb, offset, "TA");
17243           /* if (tree) */
17244           {
17245             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
17246             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17247             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17248             PROTO_ITEM_SET_HIDDEN(hidden_item);
17249             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17250             PROTO_ITEM_SET_HIDDEN(hidden_item);
17251             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17252             PROTO_ITEM_SET_HIDDEN(hidden_item);
17253             offset += 6;
17254           }
17255           break;
17256         }
17257
17258         case CTRL_CONTROL_WRAPPER:
17259         {
17260           /* XXX - We shouldn't see this.  Should we throw an error? */
17261           break;
17262         }
17263
17264         case CTRL_BLOCK_ACK_REQ:
17265         {
17266           set_src_addr_cols(pinfo, tvb, offset, "TA");
17267
17268           /* if (tree) */
17269           {
17270             guint16 bar_control;
17271             guint8 block_ack_type;
17272             proto_item *bar_parent_item;
17273             proto_tree *bar_sub_tree;
17274             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
17275
17276             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17277             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17278             PROTO_ITEM_SET_HIDDEN(hidden_item);
17279             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17280             PROTO_ITEM_SET_HIDDEN(hidden_item);
17281             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17282             PROTO_ITEM_SET_HIDDEN(hidden_item);
17283             offset += 6;
17284
17285             bar_control = tvb_get_letohs(tvb, offset);
17286             /* According to the 802.11ad standard (28/12/12) there is need to find the
17287              * GCR subfield which isn't described, thus the black_ack_type calculations
17288              * should be changed.
17289              */
17290             block_ack_type = (bar_control & 0x0006) >> 1;
17291             proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_request_type, tvb,
17292               offset, 2, ENC_LITTLE_ENDIAN);
17293             bar_parent_item = proto_tree_add_item(hdr_tree,
17294               hf_ieee80211_block_ack_request_control, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17295             bar_sub_tree = proto_item_add_subtree(bar_parent_item,
17296               ett_block_ack);
17297             proto_tree_add_item(bar_sub_tree,
17298               hf_ieee80211_block_ack_control_ack_policy, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17299             proto_tree_add_item(bar_sub_tree, hf_ieee80211_block_ack_control_multi_tid,
17300               tvb, offset, 2, ENC_LITTLE_ENDIAN);
17301             proto_tree_add_item(bar_sub_tree,
17302               hf_ieee80211_block_ack_control_compressed_bitmap, tvb, offset, 2,
17303               ENC_LITTLE_ENDIAN);
17304             proto_tree_add_item(bar_sub_tree, hf_ieee80211_block_ack_control_reserved,
17305               tvb, offset, 2, ENC_LITTLE_ENDIAN);
17306
17307             switch (block_ack_type)
17308             {
17309               case 0: /*Basic BlockAckReq */
17310               {
17311                 if(isDMG == TRUE) {
17312                    expert_add_info_format(pinfo, bar_sub_tree, &ei_ieee80211_dmg_subtype,
17313                            "DMG STA shouldn't transmit BlockAckReq frame with Basic BlockAckReq");
17314                    break;
17315                 }
17316                 proto_tree_add_item(bar_sub_tree,
17317                 hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17318                 offset += 2;
17319
17320                 /*offset +=*/ add_ff_block_ack_ssc(hdr_tree, tvb, pinfo, offset);
17321                 break;
17322               }
17323               case 1: /* Extended Compressesd BlockAckReq */
17324                 if(isDMG == FALSE) {
17325                    expert_add_info_format(pinfo, bar_sub_tree, &ei_ieee80211_dmg_subtype,
17326                            "Non-DMG STA shouldn't transmit BlockAckReq frame with Extended Compressed BlockAckReq");
17327                    break;
17328                 }
17329               case 2: /* Compressed BlockAckReq */
17330               {
17331                 proto_tree_add_item(bar_sub_tree,
17332                 hf_ieee80211_block_ack_control_compressed_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17333                 offset += 2;
17334
17335                 /*offset +=*/ add_ff_block_ack_ssc(hdr_tree, tvb, pinfo, offset);
17336                 break;
17337               }
17338               case 3: /* Multi-TID BlockAckReq */
17339               {
17340                 guint8 tid_count;
17341                 guint iii;
17342                 proto_tree *bar_mtid_tree, *bar_mtid_sub_tree;
17343
17344                 if(isDMG == TRUE) {
17345                    expert_add_info_format(pinfo, bar_sub_tree, &ei_ieee80211_dmg_subtype,
17346                            "DMG STA shouldn't transmit BlockAckReq frame with Basic BlockAckReq");
17347                    break;
17348                 }
17349
17350                 tid_count = ((bar_control & 0xF000) >> 12) + 1;
17351                 proto_tree_add_uint(bar_sub_tree, hf_ieee80211_block_ack_control_multi_tid_info, tvb, offset, 2, tid_count);
17352                 offset += 2;
17353
17354                 bar_mtid_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, tid_count*4, ett_block_ack, NULL, "Per TID Info");
17355                 for (iii = 0; iii < tid_count; iii++) {
17356                   bar_parent_item = proto_tree_add_uint(bar_mtid_tree, hf_ieee80211_block_ack_multi_tid_info, tvb, offset, 4, iii);
17357                   bar_mtid_sub_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
17358
17359                   proto_tree_add_item(bar_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17360                   proto_tree_add_item(bar_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17361                   offset += 2;
17362
17363                   offset += add_ff_block_ack_ssc(bar_mtid_sub_tree, tvb, pinfo, offset);
17364                 }
17365                 break;
17366               }
17367             }
17368           }
17369           break;
17370         }
17371
17372         case CTRL_BLOCK_ACK:
17373         {
17374           set_src_addr_cols(pinfo, tvb, offset, "TA");
17375
17376           /* if (tree) */
17377           {
17378             guint16 ba_control;
17379             guint8 block_ack_type;
17380             proto_item *ba_parent_item;
17381             proto_tree *ba_sub_tree;
17382             const gchar *ether_name = tvb_get_ether_name(tvb, offset);
17383
17384             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17385             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17386             PROTO_ITEM_SET_HIDDEN(hidden_item);
17387             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17388             PROTO_ITEM_SET_HIDDEN(hidden_item);
17389             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17390             PROTO_ITEM_SET_HIDDEN(hidden_item);
17391             offset += 6;
17392
17393             ba_control = tvb_get_letohs(tvb, offset);
17394             block_ack_type = (ba_control & 0x0006) >> 1;
17395             proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17396             ba_parent_item = proto_tree_add_item(hdr_tree,
17397               hf_ieee80211_block_ack_control, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17398             ba_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
17399             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_ack_policy,
17400               tvb, offset, 2, ENC_LITTLE_ENDIAN);
17401             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_multi_tid,
17402               tvb, offset, 2, ENC_LITTLE_ENDIAN);
17403             proto_tree_add_item(ba_sub_tree,
17404               hf_ieee80211_block_ack_control_compressed_bitmap, tvb, offset, 2,
17405               ENC_LITTLE_ENDIAN);
17406             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_reserved, tvb,
17407               offset, 2, ENC_LITTLE_ENDIAN);
17408
17409             switch (block_ack_type)
17410             {
17411               case 0: /*Basic BlockAck */
17412               {
17413                 proto_tree_add_item(ba_sub_tree,
17414                 hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17415                 offset += 2;
17416
17417                 offset += add_ff_block_ack_ssc(hdr_tree, tvb, pinfo, offset);
17418                 proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 128, ENC_NA);
17419                 /*offset += 128;*/
17420                 break;
17421               }
17422               /* Added to support Extended Compressed BlockAck RBUFCAP subfield.*/
17423               case 1: /* Extended Compressed BlockAck */
17424               {
17425                 guint16 ssn;
17426                 guint64 bmap;
17427                 int f;
17428                 proto_item *ba_bitmap_item;
17429                 proto_tree *ba_bitmap_tree;
17430                 if(isDMG == FALSE) {
17431                    expert_add_info_format(pinfo, ba_sub_tree, &ei_ieee80211_dmg_subtype,
17432                            "Non-DMG STA shouldn't transmit BlockAck frame with Extended Compressed BlockAck");
17433                    break;
17434                 }
17435                 proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17436                 offset += 2;
17437
17438                 ssn = tvb_get_letohs(tvb, offset);
17439                 ssn >>= 4;
17440                 offset += add_ff_block_ack_ssc(hdr_tree, tvb, pinfo, offset);
17441                 bmap = tvb_get_letoh64(tvb, offset);
17442                 ba_bitmap_item = proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
17443                 ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item, ett_block_ack_bitmap);
17444                 for (f = 0; f < 64; f++) {
17445                   if (bmap & (G_GUINT64_CONSTANT(1) << f))
17446                     continue;
17447                   proto_tree_add_uint(ba_bitmap_tree, hf_ieee80211_block_ack_bitmap_missing_frame,
17448                                                    tvb, offset + (f/8), 1, ssn + f);
17449                 }
17450                 offset += 8;
17451                 proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_RBUFCAP, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17452                 offset += 1;
17453                 break;
17454               }
17455               case 2: /* Compressed BlockAck */
17456               {
17457                 guint16 ssn;
17458                 guint64 bmap;
17459                 int f;
17460                 proto_item *ba_bitmap_item;
17461                 proto_tree *ba_bitmap_tree;
17462
17463                 proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17464                 offset += 2;
17465
17466                 ssn = tvb_get_letohs(tvb, offset);
17467                 ssn >>= 4;
17468                 offset += add_ff_block_ack_ssc(hdr_tree, tvb, pinfo, offset);
17469                 bmap = tvb_get_letoh64(tvb, offset);
17470                 ba_bitmap_item = proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
17471                 ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item, ett_block_ack_bitmap);
17472                 for (f = 0; f < 64; f++) {
17473                   if (bmap & (G_GUINT64_CONSTANT(1) << f))
17474                     continue;
17475                   proto_tree_add_uint_format_value(ba_bitmap_tree, hf_ieee80211_block_ack_bitmap_missing_frame,
17476                                                    tvb, offset + (f/8), 1, ssn + f, "%u", (ssn + f) & 0x0fff);
17477                 }
17478                 /*offset += 8;*/
17479                 break;
17480               }
17481               case 3:  /* Multi-TID BlockAck */
17482               {
17483                 guint8 tid_count;
17484                 guint iii;
17485                 proto_tree *ba_mtid_tree, *ba_mtid_sub_tree;
17486
17487                 tid_count = ((ba_control & 0xF000) >> 12) + 1;
17488                 proto_tree_add_uint(ba_sub_tree,
17489                 hf_ieee80211_block_ack_control_compressed_tid_info, tvb, offset, 2, tid_count);
17490                 offset += 2;
17491
17492                 ba_mtid_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, tid_count*4, ett_block_ack, NULL, "Per TID Info");
17493                 for (iii = 0; iii < tid_count; iii++) {
17494                   ba_parent_item = proto_tree_add_uint(ba_mtid_tree, hf_ieee80211_block_ack_multi_tid_info, tvb, offset, 4, iii);
17495                   ba_mtid_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
17496
17497                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17498                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17499                   offset += 2;
17500
17501                   offset += add_ff_block_ack_ssc(ba_mtid_sub_tree, tvb, pinfo, offset);
17502                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
17503                   offset += 8;
17504                 }
17505                 break;
17506               }
17507             }
17508           }
17509           break;
17510         }
17511       }
17512 /*
17513  * 802.11ad : Used for extension types.
17514  */
17515       switch (ctrl_type_subtype) {
17516         case CTRL_POLL: {
17517                 proto_tree_add_item(hdr_tree, hf_ieee80211_cf_response_offset,
17518                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
17519
17520                 break;
17521         }
17522         case CTRL_GRANT:
17523         case CTRL_GRANT_ACK:
17524         case CTRL_SPR: {
17525           gboolean isGrant;
17526           if(ctrl_type_subtype != CTRL_GRANT_ACK) {
17527             offset += add_ff_dynamic_allocation(hdr_tree, tvb, pinfo, offset);
17528           } else { /* CTRL_GRANT_ACK have 5 octets that are reserved*/
17529             proto_tree_add_item(hdr_tree, hf_ieee80211_grant_ack_reserved, tvb, offset, 5, ENC_NA);
17530             offset += 5;
17531           }
17532           isGrant = ((ctrl_type_subtype==CTRL_GRANT)||(ctrl_type_subtype==CTRL_GRANT_ACK));
17533           add_ff_beamforming_ctrl(hdr_tree, tvb, pinfo, offset, isGrant);
17534           /* offset += 2; */
17535           break;
17536         }
17537         case CTRL_SSW: {
17538           guint32 sector_sweep;
17539
17540           sector_sweep = tvb_get_letoh24(tvb, offset);
17541           offset += add_ff_sector_sweep(hdr_tree, tvb, pinfo, offset);
17542           /* if Sector Sweep Direction = Responder, use SW Feedback field format when not transmitted as part of an ISS */
17543           if(sector_sweep & 0x00001) {
17544             add_ff_sector_sweep_feedback_to_iss(hdr_tree, tvb, pinfo, offset);
17545           } else {
17546             add_ff_sector_sweep_feedback_from_iss(hdr_tree, tvb, pinfo, offset);
17547           }
17548           /* offset += 3; */
17549           break;
17550         }
17551         case CTRL_SSW_ACK:
17552         case CTRL_SSW_FEEDBACK: {
17553           offset += add_ff_sector_sweep_feedback_to_iss(hdr_tree, tvb, pinfo, offset);
17554           offset += add_ff_BRP_request(hdr_tree, tvb, pinfo, offset);
17555           add_ff_beamformed_link(hdr_tree, tvb, pinfo, offset);
17556           /* offset += 1; */
17557           break;
17558         }
17559         case CTRL_DMG_DTS: {
17560           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_sa, tvb, offset, 6, ENC_NA);
17561           offset += 6;
17562           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_da, tvb, offset, 6, ENC_NA);
17563           /* offset += 6; */
17564           break;
17565         }
17566         default:
17567                 break;
17568       }
17569       break;
17570     }
17571
17572     case DATA_FRAME:
17573     {
17574       guint32 ra_offset, da_offset, sa_offset, ta_offset, bssid_offset;
17575       addr_type = FCF_ADDR_SELECTOR(fcf);
17576
17577       /* In order to show src/dst address we must always do the following */
17578       switch (addr_type)
17579       {
17580
17581         case DATA_ADDR_T1:
17582           ra_offset = 4;
17583           da_offset = 4;
17584           sa_offset = 10;
17585           ta_offset = 10;
17586           bssid_offset = 16;
17587           break;
17588
17589         case DATA_ADDR_T2:
17590           ra_offset = 4;
17591           da_offset = 4;
17592           sa_offset = 16;
17593           ta_offset = 10;
17594           bssid_offset = 10;
17595           break;
17596
17597         case DATA_ADDR_T3:
17598           ra_offset = 4;
17599           da_offset = 16;
17600           sa_offset = 10;
17601           ta_offset = 10;
17602           bssid_offset = 4;
17603           break;
17604
17605         case DATA_ADDR_T4:
17606           ra_offset = 4;
17607           da_offset = 16;
17608           sa_offset = 24;
17609           ta_offset = 10;
17610           bssid_offset = 10;
17611           break;
17612
17613         default:
17614           /* Should never happen? */
17615           ra_offset = 0;
17616           da_offset = 0;
17617           sa_offset = 0;
17618           ta_offset = 0;
17619           bssid_offset = 0;
17620           break;
17621       }
17622
17623
17624
17625       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, sa_offset);
17626       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
17627       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, da_offset);
17628       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
17629
17630       /* for tap */
17631       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, bssid_offset);
17632
17633       copy_address_shallow(&whdr->src, &pinfo->dl_src);
17634       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
17635
17636       seq_control = tvb_get_letohs(tvb, 22);
17637       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
17638       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
17639
17640       col_append_fstr(pinfo->cinfo, COL_INFO,
17641             ", SN=%d, FN=%d", seq_number, frag_number);
17642
17643       /* Now if we have a tree we start adding stuff */
17644       if (tree)
17645       {
17646         const gchar *ra_name, *ta_name, *sa_name, *da_name, *bssid_name = NULL;
17647
17648         switch (addr_type)
17649         {
17650           case DATA_ADDR_T1:
17651           case DATA_ADDR_T2:
17652           case DATA_ADDR_T3:
17653           case DATA_ADDR_T4:
17654             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ra, tvb, ra_offset, 6, ENC_NA);
17655             ra_name = tvb_get_ether_name(tvb, ra_offset);
17656             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ra_resolved, tvb, ra_offset, 6, ra_name);
17657             PROTO_ITEM_SET_HIDDEN(hidden_item);
17658
17659             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_da, tvb, da_offset, 6, ENC_NA);
17660             da_name = tvb_get_ether_name(tvb, da_offset);
17661             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, da_offset, 6, da_name);
17662             PROTO_ITEM_SET_HIDDEN(hidden_item);
17663
17664             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, ta_offset, 6, ENC_NA);
17665             ta_name = tvb_get_ether_name(tvb, ta_offset);
17666             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, ta_offset, 6, ta_name);
17667             PROTO_ITEM_SET_HIDDEN(hidden_item);
17668
17669             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_sa, tvb, sa_offset, 6, ENC_NA);
17670             sa_name = tvb_get_ether_name(tvb, sa_offset);
17671             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, sa_offset, 6, sa_name);
17672             PROTO_ITEM_SET_HIDDEN(hidden_item);
17673
17674             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, bssid_offset, 6, ENC_NA);
17675             bssid_name = tvb_get_ether_name(tvb, bssid_offset);
17676             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, bssid_offset, 6, bssid_name);
17677             PROTO_ITEM_SET_HIDDEN(hidden_item);
17678
17679             if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
17680               sta_addr_offset = ra_offset;
17681             } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
17682               sta_addr_offset = ta_offset;
17683             }
17684             if (sta_addr_offset > 0) {
17685               proto_tree_add_item(hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
17686               station_name = tvb_get_ether_name(tvb, sta_addr_offset);
17687               hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
17688               PROTO_ITEM_SET_HIDDEN(hidden_item);
17689             }
17690             proto_tree_add_item(hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
17691             proto_tree_add_item(hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
17692
17693             /* add items for wlan.addr filter */
17694             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, ra_offset, 6, ENC_NA);
17695             PROTO_ITEM_SET_HIDDEN(hidden_item);
17696             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, ra_offset, 6, ra_name);
17697             PROTO_ITEM_SET_HIDDEN(hidden_item);
17698             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, ta_offset, 6, ENC_NA);
17699             PROTO_ITEM_SET_HIDDEN(hidden_item);
17700             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, ta_offset, 6, ta_name);
17701             PROTO_ITEM_SET_HIDDEN(hidden_item);
17702             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, sa_offset, 6, ENC_NA);
17703             PROTO_ITEM_SET_HIDDEN(hidden_item);
17704             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, sa_offset, 6, sa_name);
17705             PROTO_ITEM_SET_HIDDEN(hidden_item);
17706             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, da_offset, 6, ENC_NA);
17707             PROTO_ITEM_SET_HIDDEN(hidden_item);
17708             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, da_offset, 6, da_name);
17709             PROTO_ITEM_SET_HIDDEN(hidden_item);
17710             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, bssid_offset, 6, ENC_NA);
17711             PROTO_ITEM_SET_HIDDEN(hidden_item);
17712             hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_resolved, tvb, bssid_offset, 6, bssid_name);
17713             PROTO_ITEM_SET_HIDDEN(hidden_item);
17714             break;
17715         }
17716
17717       }
17718       break;
17719       }
17720     case EXTENSION_FRAME: {
17721       switch (frame_type_subtype) {
17722         case EXTENSION_DMG_BEACON: {
17723           set_dst_addr_cols(pinfo, tvb, 4, "BSSID");
17724           if (tree) {
17725             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
17726             hidden_item = proto_tree_add_item(hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
17727             PROTO_ITEM_SET_HIDDEN(hidden_item);
17728           }
17729           break;
17730         }
17731       }
17732     }
17733   }
17734
17735   len = tvb_captured_length_remaining(tvb, hdr_len);
17736   reported_len = tvb_reported_length_remaining(tvb, hdr_len);
17737
17738   if (has_fcs)
17739     {
17740       /*
17741        * Well, this packet should, in theory, have an FCS.
17742        * Do we have the entire packet, and does it have enough data for
17743        * the FCS?
17744        */
17745       if (reported_len < 4)
17746       {
17747         /*
17748          * The packet is claimed not to even have enough data for a 4-byte
17749          * FCS.
17750          * Pretend it doesn't have an FCS.
17751          */
17752         ;
17753       }
17754       else if (len < reported_len)
17755       {
17756         /*
17757          * The packet is claimed to have enough data for a 4-byte FCS, but
17758          * we didn't capture all of the packet.
17759          * Slice off the 4-byte FCS from the reported length, and trim the
17760          * captured length so it's no more than the reported length; that
17761          * will slice off what of the FCS, if any, is in the captured
17762          * length.
17763          */
17764         reported_len -= 4;
17765         if (len > reported_len)
17766             len = reported_len;
17767       }
17768       else
17769       {
17770         /*
17771          * We have the entire packet, and it includes a 4-byte FCS.
17772          * Slice it off, and put it into the tree.
17773          */
17774         len          -= 4;
17775         reported_len -= 4;
17776         if (wlan_check_checksum)
17777         {
17778           guint32 sent_fcs = tvb_get_letohl(tvb, hdr_len + len);
17779           guint32 fcs;
17780
17781           if (phdr->datapad)
17782             fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
17783           else
17784             fcs = crc32_ccitt_tvb(tvb, hdr_len + len);
17785           if (fcs != sent_fcs) {
17786             flag_str[8] = '.';
17787           }
17788
17789           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);
17790         } else {
17791           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);
17792         }
17793       }
17794     }
17795   else
17796     {
17797       flag_str[8] = '\0';
17798     }
17799
17800   proto_item_append_text(ti, ", Flags: %s", flag_str);
17801   col_append_fstr(pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
17802
17803
17804   /*
17805    * Only management and data frames have a body, so we don't have
17806    * anything more to do for other types of frames.
17807    */
17808   switch (FCF_FRAME_TYPE (fcf))
17809     {
17810
17811     case MGT_FRAME:
17812       if (htc_len == 4) {
17813         dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
17814       }
17815       break;
17816
17817     case DATA_FRAME:
17818       if ((option_flags & IEEE80211_COMMON_OPT_NORMAL_QOS) && tree && DATA_FRAME_IS_QOS(frame_type_subtype))
17819       {
17820         proto_item *qos_fields, *qos_ti;
17821         proto_tree *qos_tree;
17822
17823         guint16 qos_eosp;
17824         guint16 qos_field_content;
17825
17826         qos_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_qos, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17827         qos_tree = proto_item_add_subtree(qos_fields, ett_qos_parameters);
17828
17829         qos_eosp = QOS_EOSP(qos_control);
17830         qos_field_content = QOS_FIELD_CONTENT(qos_control);
17831
17832         proto_tree_add_item(qos_tree, hf_ieee80211_qos_tid, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17833
17834         qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_priority, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17835         PROTO_ITEM_SET_GENERATED(qos_ti);
17836
17837         if (FLAGS_DS_STATUS(flags) == (FLAG_FROM_DS|FLAG_TO_DS)) {
17838           /* mesh frame */
17839           proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17840         } else {
17841           if (flags & FLAG_TO_DS) {
17842             proto_tree_add_item(qos_tree, hf_ieee80211_qos_bit4, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17843           } else {
17844             proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17845           }
17846         }
17847
17848         proto_tree_add_item(qos_tree, hf_ieee80211_qos_ack_policy, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17849
17850         if (flags & FLAG_FROM_DS) {
17851           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
17852             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17853             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
17854           }
17855           if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
17856             /* txop limit */
17857               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_limit, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17858             if (qos_field_content == 0) {
17859               proto_item_append_text(qos_ti, " (transmit one frame immediately)");
17860             }
17861           } else {
17862             /* qap ps buffer state */
17863             proto_item *qos_ps_buf_state_fields;
17864             proto_tree *qos_ps_buf_state_tree;
17865
17866             qos_ps_buf_state_fields = proto_tree_add_item(qos_tree, hf_ieee80211_qos_ps_buf_state, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17867             qos_ps_buf_state_tree = proto_item_add_subtree(qos_ps_buf_state_fields, ett_qos_ps_buf_state);
17868
17869             proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_buf_state_indicated, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17870
17871             if (QOS_PS_BUF_STATE_INDICATED(qos_field_content)) {
17872               proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_highest_pri_buf_ac, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17873               qos_ti = proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_qap_buf_load, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17874               switch (QOS_PS_QAP_BUF_LOAD(qos_field_content)) {
17875
17876               case 0:
17877                 proto_item_append_text(qos_ti, " (no buffered traffic)");
17878                 break;
17879
17880               default:
17881                 proto_item_append_text(qos_ti, " (%d octets)", QOS_PS_QAP_BUF_LOAD(qos_field_content)*4096);
17882                 break;
17883
17884               case 15:
17885                 proto_item_append_text(qos_ti, " (greater than 57344 octets)");
17886                 break;
17887               }
17888
17889             }
17890           }
17891         } else {
17892           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
17893             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17894             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
17895           }
17896           if (qos_eosp) {
17897             /* queue size */
17898             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_queue_size, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17899             switch (qos_field_content) {
17900             case 0:
17901               proto_item_append_text(qos_ti, " (no buffered traffic in the queue)");
17902               break;
17903
17904             default:
17905               proto_item_append_text(qos_ti, " (%u bytes)", qos_field_content*256);
17906               break;
17907
17908             case 254:
17909               proto_item_append_text(qos_ti, " (more than 64768 octets)");
17910               break;
17911
17912             case 255:
17913               proto_item_append_text(qos_ti, " (unspecified or unknown)");
17914               break;
17915             }
17916           } else {
17917             /* txop duration requested */
17918             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_dur_req,
17919                                    tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17920             if (qos_field_content == 0) {
17921               proto_item_append_text(qos_ti, " (no TXOP requested)");
17922             }
17923           }
17924         }
17925
17926         /* Do we have +HTC? */
17927         if (htc_len == 4) {
17928           dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
17929         }
17930
17931         if (meshctl_len != 0) {
17932           proto_item *msh_fields;
17933           proto_tree *msh_tree;
17934
17935           msh_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_mesh_control_field, tvb, meshoff, meshctl_len, ENC_NA);
17936           msh_tree = proto_item_add_subtree(msh_fields, ett_msh_control);
17937           add_ff_mesh_control(msh_tree, tvb, pinfo, meshoff);
17938         }
17939
17940       } /* end of qos control field */
17941       if (enable_decryption && !pinfo->fd->flags.visited) {
17942         const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
17943         /* The processing will take care of 4-way handshake sessions for WPA and WPA2 decryption */
17944         AirPDcapPacketProcess(&airpdcap_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE);
17945
17946       }
17947       /*
17948        * No-data frames don't have a body.
17949        */
17950       if (DATA_FRAME_IS_NULL(frame_type_subtype))
17951         goto end_of_wlan;
17952
17953       if (!wlan_subdissector) {
17954         guint fnum = 0;
17955
17956         /* key: bssid:src
17957          * data: last seq_control seen and frame number
17958          */
17959         retransmitted = FALSE;
17960         if (!pinfo->fd->flags.visited) {
17961           retransmit_key key;
17962           retransmit_key *result;
17963
17964           memcpy(key.bssid, whdr->bssid.data, 6);
17965           memcpy(key.src, whdr->src.data, 6);
17966           key.seq_control = 0;
17967           result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
17968           if (result && (result->seq_control == seq_control)) {
17969             /* keep a pointer to the first seen frame, could be done with proto data? */
17970             fnum = result->fnum;
17971             g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER(pinfo->num),
17972                                 GINT_TO_POINTER(fnum));
17973             retransmitted = TRUE;
17974           } else {
17975             /* first time or new seq*/
17976             if (!result) {
17977               result = wmem_new(wmem_file_scope(), retransmit_key);
17978               *result = key;
17979               g_hash_table_insert(fc_analyse_retransmit_table, result, result);
17980             }
17981             result->seq_control = seq_control;
17982             result->fnum =  pinfo->num;
17983           }
17984         }
17985         else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER(pinfo->num))))) {
17986           retransmitted = TRUE;
17987         }
17988
17989         if (retransmitted) {
17990           col_append_str(pinfo->cinfo, COL_INFO, " [retransmitted]");
17991           if (tree) {
17992             proto_item *item;
17993
17994             item=proto_tree_add_none_format(hdr_tree, hf_ieee80211_fc_analysis_retransmission, tvb, 0, 0,
17995                                             "Retransmitted frame");
17996             PROTO_ITEM_SET_GENERATED(item);
17997             item=proto_tree_add_uint(hdr_tree, hf_ieee80211_fc_analysis_retransmission_frame, tvb, 0, 0, fnum);
17998             PROTO_ITEM_SET_GENERATED(item);
17999           }
18000           next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
18001           call_data_dissector(next_tvb, pinfo, tree);
18002           goto end_of_wlan;
18003         }
18004       }
18005
18006       break;
18007
18008     case CONTROL_FRAME:
18009       goto end_of_wlan;
18010
18011     case EXTENSION_FRAME:
18012       break;
18013
18014     default:
18015       goto end_of_wlan;
18016     }
18017
18018   if (IS_PROTECTED(FCF_FLAGS(fcf))
18019       && !phdr->decrypted
18020       && (wlan_ignore_prot != WLAN_IGNORE_PROT_WO_IV)) {
18021     /*
18022      * It's a WEP or WPA encrypted frame, and it hasn't already been
18023      * decrypted; dissect the protections parameters and decrypt the data,
18024      * if we have a matching key. Otherwise display it as data.
18025      */
18026     gboolean    can_decrypt = FALSE;
18027     proto_tree *wep_tree    = NULL;
18028     guint32     iv;
18029     guint8      key, keybyte;
18030
18031 #define PROTECTION_ALG_WEP  AIRPDCAP_KEY_TYPE_WEP
18032 #define PROTECTION_ALG_TKIP  AIRPDCAP_KEY_TYPE_TKIP
18033 #define PROTECTION_ALG_CCMP  AIRPDCAP_KEY_TYPE_CCMP
18034 #define PROTECTION_ALG_RSNA  PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
18035     guint8 algorithm=G_MAXUINT8;
18036 #define IS_TKIP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 1) == \
18037   ((tvb_get_guint8(tvb, hdr_len) | 0x20) & 0x7f))
18038 #define IS_CCMP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 2) == 0)
18039     guint32 sec_header=0;
18040     guint32 sec_trailer=0;
18041
18042     next_tvb = try_decrypt(tvb, pinfo, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer, &used_key);
18043
18044     keybyte = tvb_get_guint8(tvb, hdr_len + 3);
18045     key = KEY_OCTET_WEP_KEY(keybyte);
18046     if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
18047       /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
18048       if (tree) {
18049         if (algorithm==PROTECTION_ALG_TKIP)
18050           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
18051               ett_wep_parameters, NULL, "TKIP parameters");
18052         else if (algorithm==PROTECTION_ALG_CCMP)
18053           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
18054             ett_wep_parameters, NULL, "CCMP parameters");
18055         else {
18056           if (IS_TKIP(tvb, hdr_len)) {
18057             algorithm=PROTECTION_ALG_TKIP;
18058             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
18059                 ett_wep_parameters, NULL, "TKIP parameters");
18060           } else if (IS_CCMP(tvb, hdr_len)) {
18061             algorithm=PROTECTION_ALG_CCMP;
18062             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
18063                 ett_wep_parameters, NULL, "CCMP parameters");
18064           } else
18065             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
18066                 ett_wep_parameters, NULL, "TKIP/CCMP parameters");
18067         }
18068         proto_item_set_len(ti, hdr_len + 8);
18069
18070         if (algorithm==PROTECTION_ALG_TKIP) {
18071           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
18072               tvb_get_letohl(tvb, hdr_len + 4),
18073               tvb_get_guint8(tvb, hdr_len),
18074               tvb_get_guint8(tvb, hdr_len + 2));
18075           proto_tree_add_string(wep_tree, hf_ieee80211_tkip_extiv, tvb, hdr_len,
18076               EXTIV_LEN, out_buff);
18077         } else if (algorithm==PROTECTION_ALG_CCMP) {
18078           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
18079               tvb_get_letohl(tvb, hdr_len + 4),
18080               tvb_get_guint8(tvb, hdr_len + 1),
18081               tvb_get_guint8(tvb, hdr_len));
18082           proto_tree_add_string(wep_tree, hf_ieee80211_ccmp_extiv, tvb, hdr_len,
18083               EXTIV_LEN, out_buff);
18084         }
18085
18086         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
18087       }
18088
18089       /* Subtract out the length of the IV. */
18090       len          -= EXTIV_LEN;
18091       reported_len -= EXTIV_LEN;
18092       ivlen         = EXTIV_LEN;
18093       /* It is unknown whether this is TKIP or CCMP, so let's not even try to
18094        * parse TKIP Michael MIC+ICV or CCMP MIC. */
18095
18096       /* checking for the trailer                            */
18097       if (next_tvb!=NULL) {
18098         if (reported_len < (gint) sec_trailer) {
18099           /* There is no space for a trailer, ignore it and don't decrypt  */
18100           ;
18101         } else if (len < reported_len) {
18102           /* There is space for a trailer, but we haven't capture all the  */
18103           /* packet. Slice off the trailer, but don't try to decrypt      */
18104           reported_len -= sec_trailer;
18105           if (len > reported_len)
18106             len = reported_len;
18107         } else {
18108           /* Ok, we have a trailer and the whole packet. Decrypt it!      */
18109           /* TODO: At the moment we won't add the trailer to the tree,    */
18110           /* so don't remove the trailer from the packet                  */
18111           len          -= sec_trailer;
18112           reported_len -= sec_trailer;
18113           can_decrypt   = TRUE;
18114
18115           /* Add Key information to packet */
18116           bytes_to_hexstr(out_buff, used_key.KeyData.Wpa.Ptk+32, AIRPDCAP_TK_LEN); /* TK is stored in PTK at offset 32 bytes and 16 bytes long */
18117           out_buff[2*AIRPDCAP_TK_LEN] = '\0';
18118
18119           if (key == 0) { /* encrypted with pairwise key */
18120             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_tk, tvb, 0, 0, out_buff);
18121             PROTO_ITEM_SET_GENERATED(ti);
18122
18123             /* Also add the PMK used to to decrypt the packet. (PMK==PSK) */
18124             bytes_to_hexstr(out_buff, used_key.KeyData.Wpa.Psk, AIRPDCAP_WPA_PSK_LEN); /* 32 bytes */
18125             out_buff[2*AIRPDCAP_WPA_PSK_LEN] = '\0';
18126             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_pmk, tvb, 0, 0, out_buff);
18127             PROTO_ITEM_SET_GENERATED(ti);
18128
18129           } else { /* Encrypted with Group Key */
18130             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 */
18131             PROTO_ITEM_SET_GENERATED(ti);
18132           }
18133         }
18134       }
18135     } else {
18136       /* No Ext. IV - WEP packet */
18137       /*
18138        * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
18139        * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
18140        * them itself.
18141        *
18142        * Also, just pass the data *following* the WEP parameters as the
18143        * buffer to decrypt.
18144        */
18145       iv = tvb_get_ntoh24(tvb, hdr_len);
18146       if (tree) {
18147         wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 4,
18148             ett_wep_parameters, NULL, "WEP parameters");
18149
18150         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_iv, tvb, hdr_len, 3, iv);
18151         tvb_memcpy(tvb, iv_buff, hdr_len, 3);
18152         is_iv_bad = weak_iv(iv_buff);
18153         if (is_iv_bad != -1) {
18154           proto_tree_add_boolean_format (wep_tree, hf_ieee80211_wep_iv_weak,
18155               tvb, 0, 0, TRUE,
18156               "Weak IV for key byte %d",
18157               is_iv_bad);
18158         }
18159       }
18160       if (tree)
18161         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
18162
18163       /* Subtract out the length of the IV. */
18164       len          -= 4;
18165       reported_len -= 4;
18166       ivlen         = 4;
18167
18168       /* Even if the decryption was not successful, set the algorithm */
18169       algorithm=PROTECTION_ALG_WEP;
18170
18171       /*
18172        * Well, this packet should, in theory, have an ICV.
18173        * Do we have the entire packet, and does it have enough data for
18174        * the ICV?
18175        */
18176       if (reported_len < 4) {
18177         /*
18178          * The packet is claimed not to even have enough data for a
18179          * 4-byte ICV.
18180          * Pretend it doesn't have an ICV.
18181          */
18182         ;
18183       } else if (len < reported_len) {
18184         /*
18185          * The packet is claimed to have enough data for a 4-byte ICV,
18186          * but we didn't capture all of the packet.
18187          * Slice off the 4-byte ICV from the reported length, and trim
18188          * the captured length so it's no more than the reported length;
18189          * that will slice off what of the ICV, if any, is in the
18190          * captured length.
18191          */
18192         reported_len -= 4;
18193         if (len > reported_len)
18194           len         = reported_len;
18195       } else {
18196         /*
18197          * We have the entire packet, and it includes a 4-byte ICV.
18198          * Slice it off, and put it into the tree.
18199          *
18200          * We only support decrypting if we have the the ICV.
18201          *
18202          * XXX - the ICV is encrypted; we're putting the encrypted
18203          * value, not the decrypted value, into the tree.
18204          */
18205         len          -= 4;
18206         reported_len -= 4;
18207         can_decrypt   = TRUE;
18208       }
18209     }
18210
18211     if (algorithm == PROTECTION_ALG_WEP) {
18212       g_strlcpy(wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
18213     } else if (algorithm == PROTECTION_ALG_TKIP) {
18214       g_strlcpy(wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
18215     } else if (algorithm == PROTECTION_ALG_CCMP) {
18216       g_strlcpy(wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
18217     } else {
18218       g_strlcpy(wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
18219     }
18220
18221     /* protection header                                  */
18222     if (!can_decrypt || (next_tvb == NULL)) {
18223       /*
18224        * WEP decode impossible or failed, treat payload as raw data
18225        * and don't attempt fragment reassembly or further dissection.
18226        */
18227       next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len + ivlen, len, reported_len);
18228
18229       if (tree) {
18230         if (algorithm == PROTECTION_ALG_WEP) {
18231           if (can_decrypt)
18232             proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
18233                 hdr_len + ivlen + len, 4,
18234                 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
18235                 "0x%08x (not verified)",
18236                 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
18237         } else if (algorithm == PROTECTION_ALG_CCMP) {
18238         } else if (algorithm == PROTECTION_ALG_TKIP) {
18239         }
18240       }
18241
18242       if ((!(option_flags & IEEE80211_COMMON_OPT_IS_CENTRINO)) && (wlan_ignore_prot == WLAN_IGNORE_PROT_NO)) {
18243         /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
18244         call_data_dissector(next_tvb, pinfo, tree);
18245         goto end_of_wlan;
18246       }
18247     } else {
18248       if (algorithm == PROTECTION_ALG_WEP) {
18249         if (tree)
18250           proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
18251               hdr_len + ivlen + len, 4,
18252               tvb_get_ntohl(tvb, hdr_len + ivlen + len),
18253               "0x%08x (correct)",
18254               tvb_get_ntohl(tvb, hdr_len + ivlen + len));
18255
18256         add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
18257       } else if (algorithm==PROTECTION_ALG_CCMP) {
18258         add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
18259       } else if (algorithm==PROTECTION_ALG_TKIP) {
18260         add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
18261       }
18262 #undef IS_TKIP
18263 #undef IS_CCMP
18264 #undef PROTECTION_ALG_CCMP
18265 #undef PROTECTION_ALG_TKIP
18266 #undef PROTECTION_ALG_WEP
18267     }
18268
18269     /*
18270      * WEP decryption successful!
18271      *
18272      * Use the tvbuff we got back from the decryption; the data starts at
18273      * the beginning.  The lengths are already correct for the decoded WEP
18274      * payload.
18275      */
18276     hdr_len = 0;
18277
18278   } else {
18279     /*
18280      * Not a WEP-encrypted frame; just use the data from the tvbuff
18281      * handed to us.
18282      *
18283      * The payload starts at "hdr_len" (i.e., just past the 802.11
18284      * MAC header), the length of data in the tvbuff following the
18285      * 802.11 header is "len", and the length of data in the packet
18286      * following the 802.11 header is "reported_len".
18287      */
18288     next_tvb = tvb;
18289   }
18290
18291   /*
18292    * Do defragmentation if "wlan_defragment" is true, and we have more
18293    * fragments or this isn't the first fragment.
18294    *
18295    * We have to do some special handling to catch frames that
18296    * have the "More Fragments" indicator not set but that
18297    * don't show up as reassembled and don't have any other
18298    * fragments present.  Some networking interfaces appear
18299    * to do reassembly even when you're capturing raw packets
18300    * *and* show the reassembled packet without the "More
18301    * Fragments" indicator set *but* with a non-zero fragment
18302    * number.
18303    *
18304    * "fragment_add_seq_802_11()" handles that; we want to call it
18305    * even if we have a short frame, so that it does those checks - if
18306    * the frame is short, it doesn't do reassembly on it.
18307    *
18308    * (This could get some false positives if we really *did* only
18309    * capture the last fragment of a fragmented packet, but that's
18310    * life.)
18311    */
18312   save_fragmented = pinfo->fragmented;
18313   if (wlan_defragment && (more_frags || (frag_number != 0))) {
18314     fragment_head *fd_head;
18315
18316     /*
18317      * If we've already seen this frame, look it up in the
18318      * table of reassembled packets, otherwise add it to
18319      * whatever reassembly is in progress, if any, and see
18320      * if it's done.
18321      */
18322     if (reported_len < 0)
18323       THROW(ReportedBoundsError);
18324     fd_head = fragment_add_seq_802_11(&wlan_reassembly_table,
18325         next_tvb, hdr_len, pinfo, seq_number, NULL,
18326         frag_number,
18327         reported_len,
18328         more_frags);
18329     next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
18330         "Reassembled 802.11", fd_head,
18331         &frag_items, NULL, hdr_tree);
18332   } else {
18333     /*
18334      * If this is the first fragment, dissect its contents, otherwise
18335      * just show it as a fragment.
18336      */
18337     if (frag_number != 0) {
18338       /* Not the first fragment - don't dissect it. */
18339       next_tvb = NULL;
18340     } else {
18341       /* First fragment, or not fragmented.  Dissect what we have here. */
18342
18343       /* Get a tvbuff for the payload. */
18344       next_tvb = tvb_new_subset_length_caplen(next_tvb, hdr_len, len, reported_len);
18345
18346       /*
18347        * If this is the first fragment, but not the only fragment,
18348        * tell the next protocol that.
18349        */
18350       if (more_frags)
18351         pinfo->fragmented = TRUE;
18352       else
18353         pinfo->fragmented = FALSE;
18354     }
18355   }
18356
18357   if (next_tvb == NULL) {
18358     /* Just show this as an incomplete fragment. */
18359     col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
18360     next_tvb = tvb_new_subset_length_caplen(tvb, hdr_len, len, reported_len);
18361     call_data_dissector(next_tvb, pinfo, tree);
18362     pinfo->fragmented = save_fragmented;
18363     goto end_of_wlan;
18364   }
18365
18366   switch (FCF_FRAME_TYPE (fcf))
18367     {
18368
18369     case MGT_FRAME:
18370       dissect_ieee80211_mgt(fcf, next_tvb, pinfo, tree);
18371       break;
18372
18373     case DATA_FRAME:
18374       if (is_amsdu && (tvb_reported_length_remaining(next_tvb, 0) > 4)) {
18375         proto_item   *parent_item;
18376         proto_tree   *mpdu_tree;
18377         guint32       msdu_offset = 0;
18378         guint         i           = 1;
18379
18380         parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
18381                                     tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
18382         mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
18383
18384         do {
18385           tvbuff_t *volatile  msdu_tvb;
18386           guint16             msdu_length;
18387           proto_tree         *subframe_tree;
18388
18389           /*
18390            * IEEE Std 802.11-2012 says, in section 8.3.2.2 "A-MSDU format":
18391            *
18392            *  The A-MSDU subframe header contains three fields: DA, SA, and
18393            *  Length. The order of these fields and the bits within these
18394            *  fields are the same as the IEEE 802.3 frame format.
18395            *
18396            * which means that the length field is big-endian, not
18397            * little-endian.
18398            */
18399           msdu_length = tvb_get_ntohs(next_tvb, msdu_offset+12);
18400
18401           parent_item = proto_tree_add_item(mpdu_tree, hf_ieee80211_amsdu_subframe, next_tvb,
18402                             msdu_offset, roundup2(msdu_offset+14+msdu_length, 4), ENC_NA);
18403           proto_item_append_text(parent_item, " #%u", i);
18404           subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
18405           i += 1;
18406
18407           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_da, next_tvb, msdu_offset, 6, ENC_NA);
18408           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_da_resolved, tvb, msdu_offset, 6,
18409             tvb_get_ether_name(tvb, msdu_offset));
18410           PROTO_ITEM_SET_HIDDEN(hidden_item);
18411           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_sa, next_tvb, msdu_offset+6, 6, ENC_NA);
18412           hidden_item = proto_tree_add_string(hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, msdu_offset+6, 6,
18413             tvb_get_ether_name(tvb, msdu_offset+6));
18414           PROTO_ITEM_SET_HIDDEN(hidden_item);
18415           proto_tree_add_item(subframe_tree, hf_ieee80211_amsdu_length, next_tvb, msdu_offset+12, 2, ENC_BIG_ENDIAN);
18416
18417           msdu_offset += 14;
18418           msdu_tvb = tvb_new_subset_length(next_tvb, msdu_offset, msdu_length);
18419           call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
18420           msdu_offset = roundup2(msdu_offset+msdu_length, 4);
18421         } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
18422
18423         break;
18424       }
18425       /* I guess some bridges take Netware Ethernet_802_3 frames,
18426          which are 802.3 frames (with a length field rather than
18427          a type field, but with no 802.2 header in the payload),
18428          and just stick the payload into an 802.11 frame.  I've seen
18429          captures that show frames of that sort.
18430
18431          We also handle some odd form of encapsulation in which a
18432          complete Ethernet frame is encapsulated within an 802.11
18433          data frame, with no 802.2 header.  This has been seen
18434          from some hardware.
18435
18436          On top of that, at least at some point it appeared that
18437          the OLPC XO sent out frames with two bytes of 0 between
18438          the "end" of the 802.11 header and the beginning of
18439          the payload.
18440
18441          So, if the packet doesn't start with 0xaa 0xaa:
18442
18443            we first use the same scheme that linux-wlan-ng does to detect
18444            those encapsulated Ethernet frames, namely looking to see whether
18445            the frame either starts with 6 octets that match the destination
18446            address from the 802.11 header or has 6 octets that match the
18447            source address from the 802.11 header following the first 6 octets,
18448            and, if so, treat it as an encapsulated Ethernet frame;
18449
18450            otherwise, we use the same scheme that we use in the Ethernet
18451            dissector to recognize Netware 802.3 frames, namely checking
18452            whether the packet starts with 0xff 0xff and, if so, treat it
18453            as an encapsulated IPX frame, and then check whether the
18454            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
18455            frame. */
18456       encap_type = ENCAP_802_2;
18457       if (tvb_bytes_exist(next_tvb, 0, 2)) {
18458         octet1 = tvb_get_guint8(next_tvb, 0);
18459         octet2 = tvb_get_guint8(next_tvb, 1);
18460         if ((octet1 != 0xaa) || (octet2 != 0xaa)) {
18461           if ((tvb_memeql(next_tvb, 6, (const guint8 *)pinfo->dl_src.data, 6) == 0) ||
18462               (tvb_memeql(next_tvb, 0, (const guint8 *)pinfo->dl_dst.data, 6) == 0))
18463             encap_type = ENCAP_ETHERNET;
18464           else if ((octet1 == 0xff) && (octet2 == 0xff))
18465             encap_type = ENCAP_IPX;
18466           else if ((octet1 == 0x00) && (octet2 == 0x00)) {
18467             proto_tree_add_item(tree, hf_ieee80211_mysterious_olpc_stuff, next_tvb, 0, 2, ENC_NA);
18468             next_tvb = tvb_new_subset_remaining(next_tvb, 2);
18469           }
18470         }
18471       }
18472
18473       switch (encap_type) {
18474
18475       case ENCAP_802_2:
18476         call_dissector(llc_handle, next_tvb, pinfo, tree);
18477         break;
18478
18479       case ENCAP_ETHERNET:
18480         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
18481         break;
18482
18483       case ENCAP_IPX:
18484         call_dissector(ipx_handle, next_tvb, pinfo, tree);
18485         break;
18486       }
18487       break;
18488
18489     case EXTENSION_FRAME:
18490     {
18491       dissect_ieee80211_extension(fcf, next_tvb, pinfo, tree);
18492       break;
18493     }
18494   }
18495   pinfo->fragmented = save_fragmented;
18496
18497 end_of_wlan:
18498   whdr->stats = wlan_stats;
18499   tap_queue_packet(wlan_tap, pinfo, whdr);
18500   memset(&wlan_stats, 0, sizeof wlan_stats);
18501
18502   return tvb_captured_length(tvb);
18503 }
18504
18505 /*
18506  * Dissect 802.11 with a variable-length link-layer header and with the FCS
18507  * presence or absence indicated by the pseudo-header, if there is one.
18508  */
18509 static int
18510 dissect_ieee80211(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
18511 {
18512   struct ieee_802_11_phdr *phdr = (struct ieee_802_11_phdr *)data;
18513   struct ieee_802_11_phdr ourphdr;
18514
18515   if (phdr == NULL) {
18516     /*
18517      * Fake a pseudo-header.
18518      * XXX - what are we supposed to do if the FCS length is unknown?
18519      */
18520     memset(&ourphdr, 0, sizeof(ourphdr));
18521     ourphdr.fcs_len = -1;
18522     ourphdr.decrypted = FALSE;
18523     ourphdr.datapad = FALSE;
18524     ourphdr.phy = PHDR_802_11_PHY_UNKNOWN;
18525     phdr = &ourphdr;
18526   }
18527   return dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, phdr);
18528 }
18529
18530 /*
18531  * Dissect 802.11 with a variable-length link-layer header and with an
18532  * FCS, but no pseudo-header.
18533  */
18534 static int
18535 dissect_ieee80211_withfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18536 {
18537   struct ieee_802_11_phdr phdr;
18538
18539   /* Construct a pseudo-header to hand to the common code. */
18540   memset(&phdr, 0, sizeof(phdr));
18541   phdr.fcs_len = 4;
18542   phdr.decrypted = FALSE;
18543   phdr.datapad = FALSE;
18544   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18545   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
18546   return tvb_captured_length(tvb);
18547 }
18548
18549 /*
18550  * Dissect 802.11 with a variable-length link-layer header and without an
18551  * FCS, but no pseudo-header.
18552  */
18553 static int
18554 dissect_ieee80211_withoutfcs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18555 {
18556   struct ieee_802_11_phdr phdr;
18557
18558   /* Construct a pseudo-header to hand to the common code. */
18559   memset(&phdr, 0, sizeof(phdr));
18560   phdr.decrypted = FALSE;
18561   phdr.datapad = FALSE;
18562   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18563   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
18564   return tvb_captured_length(tvb);
18565 }
18566
18567 /*
18568  * Dissect 802.11 from an Intel 2200BG adapter in a Centrino laptop
18569  * running Windows XP.
18570  *
18571  * From
18572  *
18573  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00184.html
18574  *
18575  * and
18576  *
18577  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00393.html:
18578  *
18579  *  I tried capturing from a Centrino laptop with the Intel 2200BG 802.11g
18580  *  chipset. I saw a lot of "Ethernet II" frames with 0x2452 as ethertype.
18581  *
18582  *    ...
18583  *
18584  *  This behaviour has been observed on Windows XP. In my opinion it is
18585  *  a "proprietary" behaviour of either the Centrino driver or the Centrino
18586  *  hardware. Currently I have no Linux distro installed on the machine to
18587  *  verify whether it is also the case.
18588  *
18589  *  These packets are seen only in a promiscuous capture:
18590  *    - Packets normally received by the Centrino computer have the normal
18591  *      structure (no 802.11/LLC header but directly IP header).
18592  *    - Packets that are supposed to be received by another computer have
18593  *      the 802.11/LLC headers. ... Also I noticed that when WEP is enabled,
18594  *      the 802.11 header has the flag "WEP" set to true, but the packet
18595  *      is already decrypted. I added a test in the code to accomodate this.
18596  *      For TKIP it seems to stay encrypted.
18597  */
18598 static int
18599 dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18600 {
18601   struct ieee_802_11_phdr phdr;
18602
18603   /* Construct a pseudo-header to hand to the common code. */
18604   memset(&phdr, 0, sizeof(phdr));
18605   phdr.decrypted = FALSE;
18606   phdr.datapad = FALSE;
18607   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18608   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_IS_CENTRINO|IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
18609   return tvb_captured_length(tvb);
18610 }
18611
18612 /*
18613  * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
18614  * control field and with no FCS (some hardware sends out LWAPP-encapsulated
18615  * 802.11 packets with the control field byte swapped).
18616  */
18617 static int
18618 dissect_ieee80211_bsfc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18619 {
18620   struct ieee_802_11_phdr phdr;
18621
18622   /* Construct a pseudo-header to hand to the common code. */
18623   memset(&phdr, 0, sizeof(phdr));
18624   phdr.decrypted = FALSE;
18625   phdr.datapad = FALSE;
18626   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18627   dissect_ieee80211_common(tvb, pinfo, tree, IEEE80211_COMMON_OPT_BROKEN_FC|IEEE80211_COMMON_OPT_NORMAL_QOS, &phdr);
18628   return tvb_captured_length(tvb);
18629 }
18630
18631 /*
18632  * Dissect 802.11 with a variable-length link-layer header without qos elements
18633  * in data+qos frames and with no FCS (sent as WIDS frames by Cisco standalone
18634  * APs).
18635  */
18636 static int
18637 dissect_ieee80211_noqos(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18638 {
18639   struct ieee_802_11_phdr phdr;
18640
18641   /* Construct a pseudo-header to hand to the common code. */
18642   memset(&phdr, 0, sizeof(phdr));
18643   phdr.decrypted = FALSE;
18644   phdr.datapad = FALSE;
18645   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18646   dissect_ieee80211_common(tvb, pinfo, tree, 0, &phdr);
18647   return tvb_captured_length(tvb);
18648 }
18649
18650
18651 /* ------------- */
18652 static guint
18653 retransmit_hash(gconstpointer k)
18654 {
18655   const retransmit_key *key = (const retransmit_key *)k;
18656   guint hash_val;
18657   int   i;
18658
18659   hash_val = 0;
18660   for (i = 0; i < 6; i++)
18661     hash_val += key->bssid[i];
18662
18663   for (i = 0; i < 6; i++)
18664     hash_val += key->src[i];
18665
18666   return hash_val;
18667 }
18668
18669 static gint
18670 retransmit_equal(gconstpointer k1, gconstpointer k2)
18671 {
18672   const retransmit_key *key1 = (const retransmit_key *)k1;
18673   const retransmit_key *key2 = (const retransmit_key *)k2;
18674
18675   return ((!memcmp(key1->bssid, key2->bssid, 6) && !memcmp(key1->src, key2->src, 6)) ? TRUE:FALSE);
18676 }
18677
18678 static guint
18679 frame_hash(gconstpointer k)
18680 {
18681   guint32 frame = GPOINTER_TO_UINT(k);
18682
18683   return frame;
18684 }
18685
18686 static gint
18687 frame_equal(gconstpointer k1, gconstpointer k2)
18688 {
18689   guint32 frame1 = GPOINTER_TO_UINT(k1);
18690   guint32 frame2 = GPOINTER_TO_UINT(k2);
18691
18692   return frame1==frame2;
18693 }
18694
18695 /*
18696  * EAPOL key description dissectors.
18697  */
18698 #define KEY_INFO_KEYDES_VERSION_MASK        0x0007
18699 #define KEY_INFO_KEY_TYPE_MASK              0x0008
18700 #define KEY_INFO_KEY_INDEX_MASK             0x0030
18701 #define KEY_INFO_INSTALL_MASK               0x0040
18702 #define KEY_INFO_KEY_ACK_MASK               0x0080
18703 #define KEY_INFO_KEY_MIC_MASK               0x0100
18704 #define KEY_INFO_SECURE_MASK                0x0200
18705 #define KEY_INFO_ERROR_MASK                 0x0400
18706 #define KEY_INFO_REQUEST_MASK               0x0800
18707 #define KEY_INFO_ENCRYPTED_KEY_DATA_MASK    0x1000
18708 #define KEY_INFO_SMK_MESSAGE_MASK           0x2000
18709
18710 #define KEYDES_VER_TYPE1        0x01
18711 #define KEYDES_VER_TYPE2        0x02
18712 #define KEYDES_VER_TYPE3        0x03
18713
18714 static const value_string keydes_version_vals[] = {
18715   { KEYDES_VER_TYPE1,     "RC4 Cipher, HMAC-MD5 MIC" },
18716   { KEYDES_VER_TYPE2,     "AES Cipher, HMAC-SHA1 MIC" },
18717   { KEYDES_VER_TYPE3,     "AES Cipher, AES-128-CMAC MIC" },
18718   { 0, NULL }
18719 };
18720
18721 static int proto_wlan_rsna_eapol = -1;
18722
18723 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo = -1;
18724 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version = -1;
18725 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type = -1;
18726 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index = -1;
18727 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install = -1;
18728 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack = -1;
18729 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic = -1;
18730 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure = -1;
18731 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error = -1;
18732 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request = -1;
18733 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data = -1;
18734 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message = -1;
18735 static int hf_wlan_rsna_eapol_keydes_key_len = -1;
18736 static int hf_wlan_rsna_eapol_keydes_replay_counter = -1;
18737 static int hf_wlan_rsna_eapol_keydes_key_iv = -1;
18738 static int hf_wlan_rsna_eapol_wpa_keydes_nonce = -1;
18739 static int hf_wlan_rsna_eapol_wpa_keydes_rsc = -1;
18740 static int hf_wlan_rsna_eapol_wpa_keydes_id = -1;
18741 static int hf_wlan_rsna_eapol_wpa_keydes_mic = -1;
18742 static int hf_wlan_rsna_eapol_wpa_keydes_data_len = -1;
18743 static int hf_wlan_rsna_eapol_wpa_keydes_data = -1;
18744
18745 static gint ett_keyinfo = -1;
18746 static gint ett_wlan_rsna_eapol_keydes_data = -1;
18747
18748 static const true_false_string keyinfo_key_type_tfs = { "Pairwise Key", "Group Key" };
18749
18750 static int
18751 dissect_wlan_rsna_eapol_wpa_or_rsn_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
18752 {
18753   int         offset = 0;
18754   guint16     keyinfo;
18755   guint16     eapol_data_len;
18756   proto_tree *keyinfo_item = NULL;
18757   proto_tree *keyinfo_tree = NULL;
18758   proto_tree *keydes_tree;
18759   proto_tree *ti = NULL;
18760
18761   /*
18762    * RSNA key descriptors.
18763    */
18764   eapol_data_len = tvb_get_ntohs(tvb, offset+92);
18765   keyinfo = tvb_get_ntohs(tvb, offset);
18766   if (keyinfo & KEY_INFO_REQUEST_MASK) {
18767     col_set_str(pinfo->cinfo, COL_INFO, "Key (Request)");
18768     if (keyinfo & KEY_INFO_ERROR_MASK)
18769       col_set_str(pinfo->cinfo, COL_INFO, "Key (Request, Error)");
18770   } else if (keyinfo & KEY_INFO_KEY_TYPE_MASK) {
18771     guint16 masked;
18772     /* Windows is setting the Secure Bit on message 2 when rekeying, so we'll ignore it */
18773     masked = keyinfo &
18774       (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK);
18775
18776     switch (masked) {
18777     case KEY_INFO_KEY_ACK_MASK:
18778       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 1 of 4)");
18779       break;
18780
18781     case KEY_INFO_KEY_MIC_MASK:
18782       /* We check the key length to differentiate between message 2 and 4 and just hope that
18783       there are no strange implementations with key data and non-zero key length in message 4.
18784       According to the IEEE specification, sections 11.6.6.3 and 11.6.6.5 we should
18785       use the Secure Bit and/or the Nonce, but there are implementations ignoring the spec.
18786       The Secure Bit is incorrectly set on rekeys for Windows clients for Message 2 and the Nonce is non-zero
18787       in Message 4 in Bug 11994 (Apple?) */
18788       if (eapol_data_len)
18789         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 2 of 4)");
18790       else
18791         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 4 of 4)");
18792       break;
18793
18794     case (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK):
18795       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 3 of 4)");
18796       break;
18797     }
18798   } else {
18799     if (keyinfo & KEY_INFO_KEY_ACK_MASK)
18800       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 1 of 2)");
18801     else
18802       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 2 of 2)");
18803   }
18804   keyinfo_item =
18805     proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo, tvb,
18806                         offset, 2, ENC_BIG_ENDIAN);
18807
18808   keyinfo_tree = proto_item_add_subtree(keyinfo_item, ett_keyinfo);
18809   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version, tvb, offset, 2, ENC_BIG_ENDIAN);
18810   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type, tvb, offset, 2, ENC_BIG_ENDIAN);
18811   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index, tvb, offset, 2, ENC_BIG_ENDIAN);
18812   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install, tvb, offset, 2, ENC_BIG_ENDIAN);
18813   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack, tvb, offset, 2, ENC_BIG_ENDIAN);
18814   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic, tvb, offset, 2, ENC_BIG_ENDIAN);
18815   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure, tvb, offset, 2, ENC_BIG_ENDIAN);
18816   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error, tvb, offset, 2, ENC_BIG_ENDIAN);
18817   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request, tvb, offset, 2, ENC_BIG_ENDIAN);
18818   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data, tvb, offset, 2, ENC_BIG_ENDIAN);
18819   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message, tvb, offset, 2, ENC_BIG_ENDIAN);
18820   offset += 2;
18821
18822   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_len, tvb, offset,
18823                       2, ENC_BIG_ENDIAN);
18824   offset += 2;
18825   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_replay_counter, tvb,
18826                       offset, 8, ENC_BIG_ENDIAN);
18827   offset += 8;
18828   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_nonce, tvb, offset,
18829                       32, ENC_NA);
18830   offset += 32;
18831   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_iv, tvb,
18832                       offset, 16, ENC_NA);
18833   offset += 16;
18834   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_rsc, tvb, offset,
18835                       8, ENC_NA);
18836   offset += 8;
18837   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_id, tvb, offset, 8,
18838                       ENC_NA);
18839   offset += 8;
18840   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_mic, tvb, offset,
18841                       16, ENC_NA);
18842   offset += 16;
18843   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data_len, tvb,
18844                       offset, 2, ENC_BIG_ENDIAN);
18845   offset += 2;
18846   if (eapol_data_len != 0) {
18847     ti = proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data,
18848                              tvb, offset, eapol_data_len, ENC_NA);
18849     if ((keyinfo & KEY_INFO_ENCRYPTED_KEY_DATA_MASK) ||
18850         !(keyinfo & KEY_INFO_KEY_TYPE_MASK)) {
18851       /* RSN: EAPOL-Key Key Data is encrypted.
18852        * WPA: Group Keys use encrypted Key Data.
18853        * Cannot parse this without knowing the key.
18854        * IEEE 802.11i-2004 8.5.2.
18855        */
18856     } else {
18857       keydes_tree = proto_item_add_subtree(ti, ett_wlan_rsna_eapol_keydes_data);
18858       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, keydes_tree,
18859                                        tvb_reported_length_remaining(tvb, offset),
18860                                        -1, NULL);
18861     }
18862   }
18863   return tvb_captured_length(tvb);
18864 }
18865
18866 /* It returns the algorithm used for decryption and the header and trailer lengths. */
18867 static tvbuff_t *
18868 try_decrypt(tvbuff_t *tvb, packet_info *pinfo, guint offset, guint len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer, PAIRPDCAP_KEY_ITEM used_key)
18869 {
18870   const guint8      *enc_data;
18871   tvbuff_t          *decr_tvb = NULL;
18872   guint32            dec_caplen;
18873   guchar             dec_data[AIRPDCAP_MAX_CAPLEN];
18874
18875   if (!enable_decryption)
18876     return NULL;
18877
18878   /* get the entire packet                                  */
18879   enc_data = tvb_get_ptr(tvb, 0, len+offset);
18880
18881   /*  process packet with AirPDcap                              */
18882   if (AirPDcapPacketProcess(&airpdcap_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen,
18883                             used_key, FALSE)==AIRPDCAP_RET_SUCCESS)
18884   {
18885     guint8 *tmp;
18886     *algorithm=used_key->KeyType;
18887     switch (*algorithm) {
18888       case AIRPDCAP_KEY_TYPE_WEP:
18889         *sec_header=AIRPDCAP_WEP_HEADER;
18890         *sec_trailer=AIRPDCAP_WEP_TRAILER;
18891         break;
18892       case AIRPDCAP_KEY_TYPE_CCMP:
18893         *sec_header=AIRPDCAP_RSNA_HEADER;
18894         *sec_trailer=AIRPDCAP_CCMP_TRAILER;
18895         break;
18896       case AIRPDCAP_KEY_TYPE_TKIP:
18897         *sec_header=AIRPDCAP_RSNA_HEADER;
18898         *sec_trailer=AIRPDCAP_TKIP_TRAILER;
18899         break;
18900       default:
18901         return NULL;
18902     }
18903
18904     /* allocate buffer for decrypted payload                      */
18905     tmp = (guint8 *)wmem_memdup(pinfo->pool, dec_data+offset, dec_caplen-offset);
18906
18907     len = dec_caplen-offset;
18908
18909     /* decrypt successful, let's set up a new data tvb.              */
18910     decr_tvb = tvb_new_child_real_data(tvb, tmp, len, len);
18911   }
18912
18913   return decr_tvb;
18914 }
18915
18916 /* Collect our WEP and WPA keys */
18917 static void
18918 set_airpdcap_keys(void)
18919 {
18920   AIRPDCAP_KEYS_COLLECTION  keys;
18921   GByteArray                *bytes = NULL;
18922   guint                      i;
18923
18924   keys.nKeys = 0;
18925
18926   for (i = 0; (uat_wep_key_records != NULL) && (i < num_wepkeys_uat) && (i < MAX_ENCRYPTION_KEYS); i++)
18927   {
18928     decryption_key_t *dk;
18929     dk = parse_key_string(uat_wep_key_records[i].string, uat_wep_key_records[i].key);
18930
18931     if (dk != NULL)
18932     {
18933       AIRPDCAP_KEY_ITEM          key;
18934       if (dk->type == AIRPDCAP_KEY_TYPE_WEP)
18935       {
18936         gboolean res;
18937         key.KeyType = AIRPDCAP_KEY_TYPE_WEP;
18938
18939         bytes = g_byte_array_new();
18940         res = hex_str_to_bytes(dk->key->str, bytes, FALSE);
18941
18942         if (dk->key->str && res && (bytes->len > 0) && (bytes->len <= AIRPDCAP_WEP_KEY_MAXLEN))
18943         {
18944           /*
18945            * WEP key is correct (well, the can be even or odd, so it is not
18946            * a real check, I think... is a check performed somewhere in the
18947            * AirPDcap function???)
18948            */
18949           memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
18950           key.KeyData.Wep.WepKeyLen = bytes->len;
18951           keys.Keys[keys.nKeys] = key;
18952           keys.nKeys += 1;
18953         }
18954       }
18955       else if (dk->type == AIRPDCAP_KEY_TYPE_WPA_PWD)
18956       {
18957         key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PWD;
18958
18959         /* XXX - This just lops the end if the key off if it's too long.
18960          *       Should we handle this more gracefully? */
18961         g_strlcpy(key.UserPwd.Passphrase, dk->key->str, AIRPDCAP_WPA_PASSPHRASE_MAX_LEN+1);
18962
18963         key.UserPwd.SsidLen = 0;
18964         if ((dk->ssid != NULL) && (dk->ssid->len <= AIRPDCAP_WPA_SSID_MAX_LEN))
18965         {
18966           memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
18967           key.UserPwd.SsidLen = dk->ssid->len;
18968         }
18969
18970         keys.Keys[keys.nKeys] = key;
18971         keys.nKeys += 1;
18972       }
18973       else if (dk->type == AIRPDCAP_KEY_TYPE_WPA_PSK)
18974       {
18975         key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PSK;
18976
18977         bytes = g_byte_array_new();
18978         hex_str_to_bytes(dk->key->str, bytes, FALSE);
18979
18980         /* XXX - Pass the correct array of bytes... */
18981         if (bytes->len <= AIRPDCAP_WPA_PSK_LEN) {
18982           memcpy(key.KeyData.Wpa.Psk, bytes->data, bytes->len);
18983
18984           keys.Keys[keys.nKeys] = key;
18985           keys.nKeys += 1;
18986         }
18987       }
18988       free_key_string(dk);
18989       if (bytes) {
18990         g_byte_array_free(bytes, TRUE);
18991         bytes = NULL;
18992       }
18993     }
18994   }
18995
18996   /* Now set the keys */
18997   AirPDcapSetKeys(&airpdcap_ctx, keys.Keys, keys.nKeys);
18998
18999 }
19000
19001 static void
19002 init_wepkeys(void)
19003 {
19004
19005   /*
19006    * XXX - AirPDcap - That God sends it to us beautiful (che dio ce la mandi bona)
19007    * The next lines will add a key to the AirPDcap context. The keystring will be added
19008    * to the old WEP array too, but we don't care, because the packets will come here
19009    * already decrypted... One of these days we will fix this too
19010    */
19011   set_airpdcap_keys();
19012 }
19013
19014 /*
19015  * This code had been taken from AirSnort crack.c function classify()
19016  * Permission granted by snax <at> shmoo dot com
19017  * weak_iv - determine which key byte an iv is useful in resolving
19018  * parm     - p, pointer to the first byte of an IV
19019  * return   -  n - this IV is weak for byte n of a WEP key
19020  *            -1 - this IV is not weak for any key bytes
19021  *
19022  * This function tests for IVs that are known to satisfy the criteria
19023  * for a weak IV as specified in FMS section 7.1
19024  *
19025  */
19026 static int
19027 weak_iv(guchar *iv)
19028 {
19029   guchar sum, k;
19030
19031   if ((iv[1] == 255) && (iv[0] > 2) && (iv[0] < 16)) {
19032     return iv[0] -3;
19033   }
19034
19035   sum = iv[0] + iv[1];
19036   if (sum == 1) {
19037     if (iv[2] <= 0x0a) {
19038       return iv[2] +2;
19039     }
19040     else if (iv[2] == 0xff) {
19041       return 0;
19042     }
19043   }
19044   k = 0xfe - iv[2];
19045   if ((sum == k)  && ((iv[2] >= 0xf2) && (iv[2] <= 0xfe) && (iv[2] != 0xfd))) {
19046     return k;
19047   }
19048   return -1;
19049 }
19050
19051 static void
19052 wlan_retransmit_init(void)
19053 {
19054   if (fc_analyse_retransmit_table) {
19055     g_hash_table_destroy(fc_analyse_retransmit_table);
19056     fc_analyse_retransmit_table = NULL;
19057   }
19058
19059   if (fc_first_frame_table) {
19060     g_hash_table_destroy(fc_first_frame_table);
19061     fc_first_frame_table = NULL;
19062   }
19063
19064   if (wlan_subdissector)
19065     return;
19066
19067   fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
19068   fc_first_frame_table = g_hash_table_new(frame_hash, frame_equal);
19069
19070 }
19071
19072 static int
19073 dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
19074 {
19075   int         offset = 0;
19076   guint8      type;
19077   int         tagged_parameter_tree_len;
19078   proto_tree *tagged_tree;
19079
19080   type = tvb_get_guint8(tvb, offset);
19081   proto_tree_add_item(tree, hf_ieee80211_data_encap_payload_type, tvb, offset,
19082                       1, ENC_LITTLE_ENDIAN);
19083   offset += 1;
19084   switch (type) {
19085   case 1:
19086     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRB");
19087     /* TODO: IEEE 802.11r */
19088     break;
19089   case 2:
19090     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
19091     col_clear(pinfo->cinfo, COL_INFO);
19092     offset += add_ff_action(tree, tvb, pinfo, offset);
19093     tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
19094     if (tagged_parameter_tree_len > 0) {
19095       tagged_tree = get_tagged_parameter_tree(tree, tvb, offset,
19096                                               tagged_parameter_tree_len);
19097       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
19098                                        tagged_parameter_tree_len, -1, NULL);
19099     }
19100     break;
19101   }
19102   return tvb_captured_length(tvb);
19103 }
19104
19105 void
19106 proto_register_ieee80211(void)
19107 {
19108
19109   static hf_register_info hf[] = {
19110     {&hf_ieee80211_fc_field,
19111      {"Frame Control Field", "wlan.fc",
19112       FT_UINT16, BASE_HEX, NULL, 0,
19113       "MAC Frame control", HFILL }},
19114
19115     {&hf_ieee80211_fc_proto_version,
19116      {"Version", "wlan.fc.version",
19117       FT_UINT8, BASE_DEC, NULL, 0x03,
19118       "MAC Protocol version", HFILL }},  /* 0 */
19119
19120     {&hf_ieee80211_fc_frame_type,
19121      {"Type", "wlan.fc.type",
19122       FT_UINT8, BASE_DEC, VALS(frame_type), 0x0C,
19123       "Frame type", HFILL }},
19124
19125     {&hf_ieee80211_fc_frame_subtype,
19126      {"Subtype", "wlan.fc.subtype",
19127       FT_UINT8, BASE_DEC, NULL, 0xF0,
19128       "Frame subtype", HFILL }},  /* 2 */
19129
19130     {&hf_ieee80211_fc_frame_type_subtype,
19131      {"Type/Subtype", "wlan.fc.type_subtype",
19132       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &frame_type_subtype_vals_ext, 0x0,
19133       "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
19134
19135     {&hf_ieee80211_fc_frame_extension,
19136      {"Control Frame Extension", "wlan.fc.extension",
19137       FT_UINT8, BASE_DEC, NULL, 0,
19138       NULL, HFILL }},
19139
19140     {&hf_ieee80211_fc_flags,
19141      {"Flags", "wlan.flags",
19142       FT_UINT8, BASE_HEX, NULL, 0,
19143       NULL, HFILL }},
19144
19145     {&hf_ieee80211_fc_data_ds,
19146      {"DS status", "wlan.fc.ds",
19147       FT_UINT8, BASE_HEX, VALS(tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
19148       "Data-frame DS-traversal status", HFILL }},  /* 3 */
19149
19150     {&hf_ieee80211_fc_to_ds,
19151      {"To DS", "wlan.fc.tods",
19152       FT_BOOLEAN, 8, TFS(&tods_flag), FLAG_TO_DS,
19153       "To DS flag", HFILL }},    /* 4 */
19154
19155     {&hf_ieee80211_fc_from_ds,
19156      {"From DS", "wlan.fc.fromds",
19157       FT_BOOLEAN, 8, TFS(&fromds_flag), FLAG_FROM_DS,
19158       "From DS flag", HFILL }},    /* 5 */
19159
19160     {&hf_ieee80211_fc_more_frag,
19161      {"More Fragments", "wlan.fc.frag",
19162       FT_BOOLEAN, 8, TFS(&more_fragments), FLAG_MORE_FRAGMENTS,
19163       "More Fragments flag", HFILL }},  /* 6 */
19164
19165     {&hf_ieee80211_fc_retry,
19166      {"Retry", "wlan.fc.retry",
19167       FT_BOOLEAN, 8, TFS(&retry_flags), FLAG_RETRY,
19168       "Retransmission flag", HFILL }},
19169
19170     { &hf_ieee80211_fc_analysis_retransmission,
19171      {"Retransmission", "wlan.analysis.retransmission",
19172       FT_NONE, BASE_NONE, NULL, 0x0,
19173       "This frame is a suspected wireless retransmission", HFILL }},
19174
19175     { &hf_ieee80211_fc_analysis_retransmission_frame,
19176      {"Retransmission of frame", "wlan.analysis.retransmission_frame",
19177       FT_FRAMENUM, BASE_NONE, NULL, 0x0,
19178       "This is a retransmission of frame #", HFILL }},
19179
19180     {&hf_ieee80211_fc_pwr_mgt,
19181      {"PWR MGT", "wlan.fc.pwrmgt",
19182       FT_BOOLEAN, 8, TFS(&pm_flags), FLAG_POWER_MGT,
19183       "Power management status", HFILL }},
19184
19185     {&hf_ieee80211_fc_more_data,
19186      {"More Data", "wlan.fc.moredata",
19187       FT_BOOLEAN, 8, TFS(&md_flags), FLAG_MORE_DATA,
19188       "More data flag", HFILL }},
19189
19190     {&hf_ieee80211_fc_protected,
19191      {"Protected flag", "wlan.fc.protected",
19192       FT_BOOLEAN, 8, TFS(&protected_flags), FLAG_PROTECTED,
19193       NULL, HFILL }},
19194
19195     {&hf_ieee80211_fc_order,
19196      {"Order flag", "wlan.fc.order",
19197       FT_BOOLEAN, 8, TFS(&order_flags), FLAG_ORDER,
19198       "Strictly ordered flag", HFILL }},
19199
19200     {&hf_ieee80211_assoc_id,
19201      {"Association ID", "wlan.aid",
19202       FT_UINT16, BASE_DEC, NULL, 0x3FFF,
19203       NULL, HFILL }},
19204
19205     {&hf_ieee80211_did_duration,
19206      {"Duration", "wlan.duration",
19207       FT_UINT16, BASE_DEC, NULL, 0x7FFF,
19208       NULL, HFILL }},
19209
19210     {&hf_ieee80211_addr_da,
19211      {"Destination address", "wlan.da",
19212       FT_ETHER, BASE_NONE, NULL, 0,
19213       "Destination Hardware Address", HFILL }},
19214
19215     { &hf_ieee80211_addr_da_resolved,
19216       {"Destination address (resolved)", "wlan.da_resolved", FT_STRING,
19217         BASE_NONE, NULL, 0x0,
19218         "Destination Hardware Address (resolved)", HFILL }},
19219
19220     {&hf_ieee80211_addr_sa,
19221      {"Source address", "wlan.sa",
19222       FT_ETHER, BASE_NONE, NULL, 0,
19223       "Source Hardware Address", HFILL }},
19224
19225     { &hf_ieee80211_addr_sa_resolved,
19226       {"Source address (resolved)", "wlan.sa_resolved", FT_STRING,
19227        BASE_NONE, NULL, 0x0,
19228        "Source Hardware Address (resolved)", HFILL }},
19229
19230     { &hf_ieee80211_addr,
19231       {"Hardware address", "wlan.addr",
19232        FT_ETHER, BASE_NONE, NULL, 0,
19233        "SA, DA, BSSID, RA or TA Hardware Address", HFILL }},
19234
19235     { &hf_ieee80211_addr_resolved,
19236       { "Hardware address (resolved)", "wlan.addr_resolved", FT_STRING,
19237         BASE_NONE, NULL, 0x0,
19238         "SA, DA, BSSID, RA or TA Hardware Address (resolved)", HFILL }},
19239
19240     {&hf_ieee80211_addr_ra,
19241      {"Receiver address", "wlan.ra",
19242       FT_ETHER, BASE_NONE, NULL, 0,
19243       "Receiving Station Hardware Address", HFILL }},
19244
19245     { &hf_ieee80211_addr_ra_resolved,
19246       {"Receiver address (resolved)", "wlan.ra_resolved", FT_STRING, BASE_NONE,
19247         NULL, 0x0, "Receiving Station Hardware Address (resolved)", HFILL }},
19248
19249     {&hf_ieee80211_addr_ta,
19250      {"Transmitter address", "wlan.ta",
19251       FT_ETHER, BASE_NONE, NULL, 0,
19252       "Transmitting Station Hardware Address", HFILL }},
19253
19254     { &hf_ieee80211_addr_ta_resolved,
19255       {"Transmitter address (resolved)", "wlan.ta_resolved", FT_STRING,
19256         BASE_NONE, NULL, 0x0,
19257         "Transmitting Station Hardware Address (resolved)", HFILL }},
19258
19259     {&hf_ieee80211_addr_bssid,
19260      {"BSS Id", "wlan.bssid",
19261       FT_ETHER, BASE_NONE, NULL, 0,
19262       "Basic Service Set ID", HFILL }},
19263
19264     { &hf_ieee80211_addr_bssid_resolved,
19265       {"BSS Id (resolved)", "wlan.bssid_resolved", FT_STRING, BASE_NONE, NULL,
19266         0x0, "Basic Service Set ID (resolved)", HFILL }},
19267
19268     {&hf_ieee80211_addr_staa,
19269      {"STA address", "wlan.staa",
19270       FT_ETHER, BASE_NONE, NULL, 0,
19271       "Station Hardware Address", HFILL }},
19272
19273     { &hf_ieee80211_addr_staa_resolved,
19274       {"STA address (resolved)", "wlan.staa_resolved", FT_STRING, BASE_NONE, NULL,
19275         0x0, "Station Hardware Address (resolved)", HFILL }},
19276
19277     {&hf_ieee80211_frag_number,
19278      {"Fragment number", "wlan.frag",
19279       FT_UINT16, BASE_DEC, NULL, 0x000F,
19280       NULL, HFILL }},
19281
19282     {&hf_ieee80211_seq_number,
19283      {"Sequence number", "wlan.seq",
19284       FT_UINT16, BASE_DEC, NULL, 0xFFF0,
19285       NULL, HFILL }},
19286
19287     {&hf_ieee80211_mesh_control_field,
19288      {"Mesh Control Field", "wlan.mesh.control_field",
19289       FT_NONE, BASE_NONE, NULL, 0,
19290       NULL, HFILL }},
19291
19292     {&hf_ieee80211_qos,
19293      {"Qos Control", "wlan.qos",
19294       FT_UINT16, BASE_HEX, NULL, 0,
19295       NULL, HFILL }},
19296
19297     {&hf_ieee80211_qos_tid,
19298      {"TID", "wlan.qos.tid",
19299       FT_UINT16, BASE_DEC, NULL, 0x000F,
19300       NULL, HFILL }},
19301
19302     {&hf_ieee80211_qos_priority,
19303      {"Priority", "wlan.qos.priority",
19304       FT_UINT16, BASE_DEC, VALS(ieee80211_qos_tags_acs), 0x0007,
19305       "802.1D Tag", HFILL }},
19306
19307     {&hf_ieee80211_qos_eosp,
19308      {"EOSP", "wlan.qos.eosp",
19309       FT_BOOLEAN, 16, TFS(&eosp_flag), QOS_FLAG_EOSP,
19310       "EOSP Field", HFILL }},
19311
19312     {&hf_ieee80211_qos_bit4,
19313      {"QoS bit 4", "wlan.qos.bit4",
19314       FT_BOOLEAN, 16, TFS(&bit4_flag), QOS_FLAG_EOSP,
19315       NULL, HFILL }},
19316
19317     {&hf_ieee80211_qos_ack_policy,
19318      {"Ack Policy", "wlan.qos.ack",
19319       FT_UINT16, BASE_HEX,  VALS(ack_policy), 0x0060,
19320       NULL, HFILL }},
19321
19322     {&hf_ieee80211_qos_amsdu_present,
19323      {"Payload Type", "wlan.qos.amsdupresent",
19324       FT_BOOLEAN, 16, TFS(&ieee80211_qos_amsdu_present_flag), 0x0080,
19325       NULL, HFILL }},
19326
19327     {&hf_ieee80211_qos_txop_limit,
19328      {"TXOP Limit", "wlan.qos.txop_limit",
19329       FT_UINT16, BASE_DEC, NULL, 0xFF00,
19330       NULL, HFILL }},
19331
19332     {&hf_ieee80211_qos_ps_buf_state,
19333      {"QAP PS Buffer State", "wlan.qos.ps_buf_state",
19334       FT_UINT16, BASE_HEX, NULL, 0xFF00,
19335       NULL, HFILL }},
19336
19337     {&hf_ieee80211_qos_buf_state_indicated,
19338      {"Buffer State Indicated", "wlan.qos.buf_state_indicated",
19339       FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
19340       NULL, HFILL }},
19341
19342     {&hf_ieee80211_qos_highest_pri_buf_ac,
19343      {"Highest-Priority Buffered AC", "wlan.qos.highest_pri_buf_ac",
19344        FT_UINT16, BASE_DEC, VALS(wme_acs), 0x0C00,
19345       NULL, HFILL }},
19346
19347     {&hf_ieee80211_qos_qap_buf_load,
19348      {"QAP Buffered Load", "wlan.qos.qap_buf_load",
19349       FT_UINT16, BASE_DEC, NULL, 0xF000,
19350       NULL, HFILL }},
19351
19352     {&hf_ieee80211_qos_txop_dur_req,
19353      {"TXOP Duration Requested", "wlan.qos.txop_dur_req",
19354       FT_UINT16, BASE_DEC, NULL, 0xFF00,
19355       NULL, HFILL }},
19356
19357     {&hf_ieee80211_qos_queue_size,
19358      {"Queue Size", "wlan.qos.queue_size",
19359       FT_UINT16, BASE_DEC, NULL, 0xFF00,
19360       NULL, HFILL }},
19361
19362     {&hf_ieee80211_fcs,
19363      {"Frame check sequence", "wlan.fcs",
19364       FT_UINT32, BASE_HEX, NULL, 0,
19365       "Frame Check Sequence (FCS)", HFILL }},
19366
19367     {&hf_ieee80211_fcs_status,
19368      {"FCS Status", "wlan.fcs.status",
19369       FT_UINT8, BASE_NONE, VALS(proto_checksum_vals), 0x0,
19370       NULL, HFILL }},
19371
19372     {&hf_ieee80211_fragment_overlap,
19373       {"Fragment overlap", "wlan.fragment.overlap",
19374        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19375        "Fragment overlaps with other fragments", HFILL }},
19376
19377     {&hf_ieee80211_fragment_overlap_conflict,
19378       {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
19379        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19380        "Overlapping fragments contained conflicting data", HFILL }},
19381
19382     {&hf_ieee80211_fragment_multiple_tails,
19383       {"Multiple tail fragments found", "wlan.fragment.multipletails",
19384        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19385        "Several tails were found when defragmenting the packet", HFILL }},
19386
19387     {&hf_ieee80211_fragment_too_long_fragment,
19388       {"Fragment too long", "wlan.fragment.toolongfragment",
19389        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19390        "Fragment contained data past end of packet", HFILL }},
19391
19392     {&hf_ieee80211_fragment_error,
19393       {"Defragmentation error", "wlan.fragment.error",
19394        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
19395        "Defragmentation error due to illegal fragments", HFILL }},
19396
19397     {&hf_ieee80211_fragment_count,
19398       {"Fragment count", "wlan.fragment.count",
19399        FT_UINT32, BASE_DEC, NULL, 0x0,
19400        NULL, HFILL }},
19401
19402     {&hf_ieee80211_fragment,
19403       {"802.11 Fragment", "wlan.fragment",
19404        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
19405        NULL, HFILL }},
19406
19407     {&hf_ieee80211_fragments,
19408       {"802.11 Fragments", "wlan.fragments",
19409        FT_NONE, BASE_NONE, NULL, 0x0,
19410        NULL, HFILL }},
19411
19412     {&hf_ieee80211_reassembled_in,
19413       {"Reassembled 802.11 in frame", "wlan.reassembled_in",
19414        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
19415        "This 802.11 packet is reassembled in this frame", HFILL }},
19416
19417     {&hf_ieee80211_reassembled_length,
19418       {"Reassembled 802.11 length", "wlan.reassembled.length",
19419        FT_UINT32, BASE_DEC, NULL, 0x0,
19420        "The total length of the reassembled payload", HFILL }},
19421
19422     {&hf_ieee80211_wep_iv,
19423      {"Initialization Vector", "wlan.wep.iv",
19424       FT_UINT24, BASE_HEX, NULL, 0,
19425       NULL, HFILL }},
19426
19427     {&hf_ieee80211_wep_iv_weak,
19428      {"Weak IV", "wlan.wep.weakiv",
19429       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19430        NULL, HFILL}},
19431
19432     {&hf_ieee80211_tkip_extiv,
19433      {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv",
19434       FT_STRING, BASE_NONE, NULL, 0,
19435       "TKIP Extended Initialization Vector", HFILL }},
19436
19437     {&hf_ieee80211_ccmp_extiv,
19438      {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv",
19439       FT_STRING, BASE_NONE, NULL, 0,
19440       "CCMP Extended Initialization Vector", HFILL }},
19441
19442     {&hf_ieee80211_wep_key,
19443      {"Key Index", "wlan.wep.key",
19444       FT_UINT8, BASE_DEC, NULL, 0,
19445       NULL, HFILL }},
19446
19447     {&hf_ieee80211_wep_icv,
19448      {"WEP ICV", "wlan.wep.icv",
19449       FT_UINT32, BASE_HEX, NULL, 0,
19450       NULL, HFILL }},
19451
19452     {&hf_ieee80211_fc_analysis_pmk,
19453      {"PMK", "wlan.analysis.pmk",
19454       FT_STRING, BASE_NONE, NULL, 0x0,
19455       NULL, HFILL }},
19456
19457     {&hf_ieee80211_fc_analysis_tk,
19458      {"TK", "wlan.analysis.tk",
19459       FT_STRING, BASE_NONE, NULL, 0x0,
19460       NULL, HFILL }},
19461
19462     {&hf_ieee80211_fc_analysis_gtk,
19463      {"GTK", "wlan.analysis.gtk",
19464       FT_STRING, BASE_NONE, NULL, 0x0,
19465       NULL, HFILL }},
19466
19467     {&hf_ieee80211_block_ack_request_control,
19468      {"Block Ack Request (BAR) Control", "wlan.bar.control",
19469       FT_UINT16, BASE_HEX, NULL, 0,
19470       NULL, HFILL }},
19471
19472     {&hf_ieee80211_block_ack_control,
19473      {"Block Ack Request Control", "wlan.ba.control",
19474       FT_UINT16, BASE_HEX, NULL, 0,
19475       NULL, HFILL }},
19476
19477     {&hf_ieee80211_block_ack_control_ack_policy,
19478      {"BAR Ack Policy", "wlan.ba.control.ackpolicy",
19479       FT_BOOLEAN, 16, TFS(&ieee80211_block_ack_control_ack_policy_flag), 0x01,
19480       "Block Ack Request (BAR) Ack Policy", HFILL }},
19481
19482     {&hf_ieee80211_block_ack_control_multi_tid,
19483      {"Multi-TID", "wlan.ba.control.multitid",
19484       FT_BOOLEAN, 16, 0, 0x02,
19485       "Multi-Traffic Identifier (TID)", HFILL }},
19486
19487     {&hf_ieee80211_block_ack_control_compressed_bitmap,
19488      {"Compressed Bitmap", "wlan.ba.control.cbitmap",
19489       FT_BOOLEAN, 16, 0, 0x04,
19490       NULL, HFILL }},
19491
19492     {&hf_ieee80211_block_ack_control_reserved,
19493      {"Reserved", "wlan.ba.control.reserved",
19494       FT_UINT16, BASE_HEX, NULL, 0x0ff8,
19495       NULL, HFILL }},
19496
19497     {&hf_ieee80211_block_ack_control_basic_tid_info,
19498      {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
19499       FT_UINT16, BASE_HEX, NULL, 0xf000,
19500       "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
19501
19502     {&hf_ieee80211_block_ack_control_compressed_tid_info,
19503      {"TID for which a BlockAck frame is requested", "wlan.bar.compressed.tidinfo",
19504       FT_UINT16, BASE_HEX, NULL, 0xf000,
19505       "Traffic Identifier (TID) for which a BlockAck frame is requested", HFILL }},
19506
19507     {&hf_ieee80211_block_ack_control_multi_tid_info,
19508      {"Number of TIDs Present", "wlan.ba.mtid.tidinfo",
19509       FT_UINT16, BASE_HEX, NULL, 0xf000,
19510       "Number of Traffic Identifiers (TIDs) Present", HFILL }},
19511
19512     {&hf_ieee80211_block_ack_multi_tid_info,
19513      {"Traffic Identifier (TID) Info", "wlan.ba.mtid.tid",
19514       FT_UINT8, BASE_DEC, 0, 0,
19515       NULL, HFILL }},
19516
19517     {&hf_ieee80211_block_ack_multi_tid_reserved,
19518      {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
19519       FT_UINT16, BASE_HEX, 0, 0x0fff,
19520       NULL, HFILL }},
19521
19522     {&hf_ieee80211_block_ack_multi_tid_value,
19523      {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
19524       FT_UINT16, BASE_HEX, 0, 0xf000,
19525       NULL, HFILL }},
19526
19527     {&hf_ieee80211_block_ack_request_type,
19528      {"Block Ack Request Type", "wlan.bar.type",
19529       FT_UINT8, BASE_HEX, VALS(ieee80211_block_ack_request_type_flags), 0x06,
19530       "Block Ack Request (BAR) Type", HFILL }},
19531
19532     {&hf_ieee80211_block_ack_type,
19533      {"Block Ack Type", "wlan.ba.type",
19534       FT_UINT8, BASE_HEX, VALS(ieee80211_block_ack_type_flags), 0x06,
19535       NULL, HFILL }},
19536
19537     {&hf_ieee80211_block_ack_bitmap,
19538      {"Block Ack Bitmap", "wlan.ba.bm",
19539       FT_BYTES, BASE_NONE, NULL, 0,
19540       NULL, HFILL }},
19541
19542     /* Used for Extended compressed BlockAck */
19543     {&hf_ieee80211_block_ack_RBUFCAP,
19544      {"Block Ack RBUFCAP", "wlan.ba.RBUFCAP",
19545       FT_BOOLEAN, BASE_DEC, NULL, 0,
19546       NULL, HFILL }},
19547
19548     {&hf_ieee80211_block_ack_bitmap_missing_frame,
19549      {"Missing frame", "wlan.ba.bm.missing_frame",
19550       FT_UINT32, BASE_DEC, NULL, 0,
19551       NULL, HFILL }},
19552
19553     {&hf_ieee80211_beamform_feedback_seg_retrans_bitmap,
19554      {"Feedback segment Retansmission Bitmap", "wlan.beamform.feedback_seg_retrans_bitmap",
19555       FT_UINT8, BASE_HEX, NULL, 0,
19556       NULL, HFILL }},
19557
19558     {&hf_ieee80211_vht_ndp_annc_token,
19559      {"Sounding Dialog Token", "wlan.vht_ndp.token",
19560       FT_UINT8, BASE_HEX, NULL, 0,
19561       NULL, HFILL }},
19562
19563     {&hf_ieee80211_vht_ndp_annc_token_number,
19564      {"Sounding Dialog Token Number", "wlan.vht_ndp.token.number",
19565       FT_UINT8, BASE_DEC, NULL, 0xFC,
19566       NULL, HFILL }},
19567
19568     {&hf_ieee80211_vht_ndp_annc_token_reserved,
19569      {"Reserved", "wlan.vht_ndp.token.reserved",
19570       FT_UINT8, BASE_HEX, NULL, 0x03,
19571       NULL, HFILL }},
19572
19573     {&hf_ieee80211_vht_ndp_annc_sta_info,
19574      {"STA Info", "wlan.vht_ndp.sta_info",
19575       FT_UINT16, BASE_HEX, NULL, 0,
19576       NULL, HFILL }},
19577
19578     {&hf_ieee80211_vht_ndp_annc_sta_info_aid12,
19579      {"AID12", "wlan.vht_ndp.sta_info.aid12",
19580       FT_UINT16, BASE_HEX, NULL, 0x0FFF,
19581       "12 least significant bits of the AID of the target STA", HFILL }},
19582
19583     {&hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
19584      {"Feedback Type", "wlan.vht_ndp.sta_info.feedback_type",
19585       FT_BOOLEAN, 16, TFS(&vht_ndp_annc_sta_info_feedback_type), 0x1000,
19586       NULL, HFILL }},
19587
19588     {&hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
19589      {"Nc Index", "wlan.vht_ndp.sta_info.nc_index",
19590       FT_UINT16, BASE_DEC, VALS(num_plus_one_3bit_flag), 0xE000,
19591       NULL, HFILL }},
19592
19593     {&hf_ieee80211_vht_ndp_annc_sta_info_reserved,
19594      {"Reserved", "wlan.vht_ndp.sta_info.reserved",
19595       FT_UINT16, BASE_HEX, NULL, 0xE000,
19596       NULL, HFILL }},
19597
19598     {&hf_ieee80211_data_encap_payload_type,
19599      {"Payload Type", "wlan.data_encap.payload_type",
19600       FT_UINT8, BASE_DEC, VALS(ieee80211_data_encap_payload_types), 0,
19601       NULL, HFILL }},
19602
19603     {&hf_ieee80211_ff_tdls_action_code,
19604      {"Action code", "wlan.fixed.action_code",
19605       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tdls_action_codes_ext, 0,
19606       "Management action code", HFILL }},
19607
19608     {&hf_ieee80211_ff_target_channel,
19609      {"Target Channel", "wlan.fixed.target_channel",
19610       FT_UINT8, BASE_DEC, NULL, 0,
19611       NULL, HFILL }},
19612
19613     {&hf_ieee80211_ff_operating_class,
19614      {"Operating Class", "wlan.fixed.operating_class",
19615       FT_UINT8, BASE_DEC, NULL, 0,
19616       NULL, HFILL }},
19617
19618     {&hf_ieee80211_ff_wnm_action_code,
19619      {"Action code", "wlan.fixed.action_code",
19620       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_action_codes_ext, 0,
19621       "Management action code", HFILL }},
19622
19623     {&hf_ieee80211_ff_unprotected_wnm_action_code,
19624      {"Action code", "wlan.fixed.action_code",
19625       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &unprotected_wnm_action_codes_ext, 0,
19626       "Management action code", HFILL }},
19627
19628     {&hf_ieee80211_ff_key_data,
19629      {"Key Data", "wlan.fixed.key_data",
19630       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
19631
19632     {&hf_ieee80211_ff_key_data_length,
19633      {"Key Data Length", "wlan.fixed.key_data_length",
19634       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
19635
19636     {&hf_ieee80211_ff_wnm_notification_type,
19637      {"WNM-Notification type", "wlan.fixed.wnm_notification_type",
19638       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_notification_types_ext, 0,
19639       NULL, HFILL }},
19640
19641     {&hf_ieee80211_ff_rm_action_code,
19642      {"Action code", "wlan.rm.action_code",
19643       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &rm_action_codes_ext, 0,
19644       "Radio Measurement Action", HFILL }},
19645
19646     {&hf_ieee80211_ff_rm_dialog_token,
19647      {"Dialog token", "wlan.rm.dialog_token",
19648       FT_UINT8, BASE_DEC, NULL, 0,
19649       "Non-zero Dialog Token identifies request/report transaction", HFILL }},
19650
19651     {&hf_ieee80211_ff_rm_repetitions,
19652      {"Repetitions", "wlan.rm.repetitions",
19653       FT_UINT16, BASE_DEC, NULL, 0,
19654       "Numer of Repetitions, 65535 indicates repeat until cancellation", HFILL }},
19655
19656     {&hf_ieee80211_ff_rm_tx_power,
19657      {"Transmit Power Used", "wlan.rm.tx_power",
19658       FT_INT8, BASE_DEC, NULL, 0,
19659       NULL, HFILL }},
19660
19661     {&hf_ieee80211_ff_rm_max_tx_power,
19662      {"Max Transmit Power", "wlan.rm.max_tx_power",
19663       FT_INT8, BASE_DEC, NULL, 0,
19664       NULL, HFILL }},
19665
19666     {&hf_ieee80211_ff_tpc,
19667      {"TPC Report", "wlan.rm.tpc",
19668       FT_NONE, BASE_NONE, NULL, 0,
19669       NULL, HFILL }},
19670
19671     {&hf_ieee80211_ff_tpc_element_id,
19672      {"TPC Element ID", "wlan.rm.tpc.element_id",
19673       FT_UINT8, BASE_DEC, NULL, 0,
19674       NULL, HFILL }},
19675
19676     {&hf_ieee80211_ff_tpc_length,
19677      {"TPC Length", "wlan.rm.tpc.length",
19678       FT_UINT8, BASE_DEC, NULL, 0,
19679       "Length of TPC Report element (always 2)", HFILL }},
19680
19681     {&hf_ieee80211_ff_tpc_tx_power,
19682      {"TPC Transmit Power", "wlan.rm.tpc.tx_power",
19683       FT_INT8, BASE_DEC, NULL, 0,
19684       NULL, HFILL }},
19685
19686     {&hf_ieee80211_ff_tpc_link_margin,
19687      {"TPC Link Margin", "wlan.rm.tpc.link_margin",
19688       FT_INT8, BASE_DEC, NULL, 0,
19689       NULL, HFILL }},
19690
19691     {&hf_ieee80211_ff_rm_rx_antenna_id,
19692      {"Receive Antenna ID", "wlan.rm.rx_antenna_id",
19693       FT_UINT8, BASE_DEC, NULL, 0,
19694       NULL, HFILL }},
19695
19696     {&hf_ieee80211_ff_rm_tx_antenna_id,
19697      {"Transmit Antenna ID", "wlan.rm.tx_antenna_id",
19698       FT_UINT8, BASE_DEC, NULL, 0,
19699       NULL, HFILL }},
19700
19701     {&hf_ieee80211_ff_rm_rcpi,
19702      {"Received Channel Power", "wlan.rm.rcpi",
19703       FT_UINT8, BASE_DEC, NULL, 0,
19704       NULL, HFILL }},
19705
19706     {&hf_ieee80211_ff_rm_rsni,
19707      {"Received Signal to noise indication", "wlan.rm.rsni",
19708       FT_UINT8, BASE_DEC, NULL, 0,
19709       NULL, HFILL }},
19710
19711     {&hf_ieee80211_ff_request_mode_pref_cand,
19712      {"Preferred Candidate List Included", "wlan.fixed.request_mode.pref_cand",
19713       FT_UINT8, BASE_DEC, NULL, 0x01,
19714       NULL, HFILL }},
19715
19716     {&hf_ieee80211_ff_request_mode_abridged,
19717      {"Abridged", "wlan.fixed.request_mode.abridged",
19718       FT_UINT8, BASE_DEC, NULL, 0x02,
19719       NULL, HFILL }},
19720
19721     {&hf_ieee80211_ff_request_mode_disassoc_imminent,
19722      {"Disassociation Imminent", "wlan.fixed.request_mode.disassoc_imminent",
19723       FT_UINT8, BASE_DEC, NULL, 0x04,
19724       NULL, HFILL }},
19725
19726     {&hf_ieee80211_ff_request_mode_bss_term_included,
19727      {"BSS Termination Included", "wlan.fixed.request_mode.bss_term_included",
19728       FT_UINT8, BASE_DEC, NULL, 0x08,
19729       NULL, HFILL }},
19730
19731     {&hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
19732      {"ESS Disassociation Imminent", "wlan.fixed.request_mode.ess_disassoc_imminent",
19733       FT_UINT8, BASE_DEC, NULL, 0x10,
19734       NULL, HFILL }},
19735
19736     {&hf_ieee80211_ff_disassoc_timer,
19737      {"Disassociation Timer", "wlan.fixed.disassoc_timer",
19738       FT_UINT16, BASE_DEC, NULL, 0,
19739       NULL, HFILL }},
19740
19741     {&hf_ieee80211_ff_bss_termination_delay,
19742      {"BSS Termination Delay", "wlan.fixed.bss_termination_delay",
19743       FT_UINT8, BASE_DEC, NULL, 0,
19744       NULL, HFILL }},
19745
19746     {&hf_ieee80211_ff_bss_transition_status_code,
19747      {"BSS Transition Status Code", "wlan.fixed.bss_transition_status_code",
19748       FT_UINT8, BASE_DEC, NULL, 0,
19749       NULL, HFILL }},
19750
19751     {&hf_ieee80211_ff_validity_interval,
19752      {"Validity Interval", "wlan.fixed.validity_interval",
19753       FT_UINT8, BASE_DEC, NULL, 0,
19754       NULL, HFILL }},
19755
19756     {&hf_ieee80211_ff_bss_termination_duration,
19757      {"BSS Termination Duration", "wlan.fixed.bss_termination_duration",
19758       FT_BYTES, BASE_NONE, NULL, 0,
19759       NULL, HFILL }},
19760
19761     {&hf_ieee80211_ff_url_len,
19762      {"Session Information URL Length",
19763       "wlan.fixed.session_information.url_length",
19764       FT_UINT8, BASE_DEC, NULL, 0,
19765       NULL, HFILL }},
19766
19767     {&hf_ieee80211_ff_url,
19768      {"Session Information URL", "wlan.fixed.session_information.url",
19769       FT_STRING, BASE_NONE, NULL, 0,
19770       NULL, HFILL }},
19771
19772     {&hf_ieee80211_ff_target_bss,
19773      {"BSS Transition Target BSS", "wlan.fixed.bss_transition_target_bss",
19774       FT_ETHER, BASE_NONE, NULL, 0,
19775       NULL, HFILL }},
19776
19777     {&hf_ieee80211_ff_bss_transition_candidate_list_entries,
19778      {"BSS Transition Candidate List Entries", "wlan.fixed.bss_transition_candidate_list_entries",
19779       FT_BYTES, BASE_NONE, NULL, 0,
19780       NULL, HFILL }},
19781
19782 /* 802.11ad */
19783     {&hf_ieee80211_cf_response_offset,
19784      {"Response Offset", "wlan.res_offset",
19785       FT_UINT16, BASE_DEC, NULL, 0,
19786       NULL, HFILL }},
19787
19788     {&hf_ieee80211_grant_ack_reserved,
19789      {"Reserved", "wlan.grant_ack.reserved",
19790       FT_BYTES, BASE_NONE, NULL, 0,
19791       NULL, HFILL }},
19792
19793     {&hf_ieee80211_ff_dynamic_allocation,
19794      {"Dynamic Allocation", "wlan.dynamic_allocation",
19795       FT_UINT40, BASE_HEX, NULL, 0,
19796       NULL, HFILL }},
19797
19798     {&hf_ieee80211_ff_TID,
19799      {"TID", "wlan.dynamic_allocation.tid",
19800       FT_UINT40, BASE_DEC, NULL, 0x000000000F,
19801       NULL, HFILL }},
19802
19803     {&hf_ieee80211_ff_alloc_type,
19804      {"Allocation Type", "wlan.dynamic_allocation.alloc_type",
19805       FT_UINT40, BASE_DEC, NULL, 0x000000070,
19806       NULL, HFILL }},
19807
19808     {&hf_ieee80211_ff_src_aid,
19809      {"Source AID", "wlan.dynamic_allocation.src_aid",
19810       FT_UINT40, BASE_DEC, NULL, 0x0000007F80,
19811       NULL, HFILL }},
19812
19813     {&hf_ieee80211_ff_dest_aid,
19814      {"Destination AID", "wlan.dynamic_allocation.dest_aid",
19815       FT_UINT40, BASE_DEC, NULL, 0x00007f8000,
19816       NULL, HFILL }},
19817
19818     {&hf_ieee80211_ff_alloc_duration,
19819      {"Allocation Duration", "wlan.dynamic_allocation.alloc_duration",
19820       FT_UINT40, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0x7FFF800000,
19821       NULL, HFILL }},
19822
19823     {&hf_ieee80211_ff_b39,
19824      {"Reserved (b39)", "wlan.dynamic_allocation.b39",
19825       FT_UINT40, BASE_HEX, NULL, 0x8000000000,
19826       NULL, HFILL }},
19827
19828     {&hf_ieee80211_ff_ssw,
19829      {"Sector Sweep", "wlan.ssw",
19830       FT_UINT24, BASE_HEX, NULL, 0,
19831       NULL, HFILL }},
19832
19833     {&hf_ieee80211_ff_ssw_direction,
19834      {"Sector Sweep Direction", "wlan.ssw.direction",
19835       FT_BOOLEAN, 24, TFS(&ieee80211_cf_ssw_direction), 0x000001,
19836       NULL, HFILL}},
19837
19838     {&hf_ieee80211_ff_ssw_cdown,
19839      {"Sector Sweep CDOWN", "wlan.ssw.cdown",
19840       FT_UINT24, BASE_DEC, NULL, 0x0003fe,
19841       NULL, HFILL }},
19842
19843     {&hf_ieee80211_ff_ssw_sector_id,
19844      {"Sector Sweep Sector ID", "wlan.ssw.sector_id",
19845       FT_UINT24, BASE_DEC, NULL, 0x00fc00,
19846       NULL, HFILL }},
19847
19848     {&hf_ieee80211_ff_ssw_dmg_ant_id,
19849      {"Sector Sweep DMG Antenna ID", "wlan.ssw.dmg_ant_id",
19850       FT_UINT24, BASE_DEC, NULL, 0x030000,
19851       NULL, HFILL }},
19852
19853     {&hf_ieee80211_ff_ssw_rxss_len,
19854      {"Sector Sweep RXSS Length", "wlan.ssw.rxss_len",
19855       FT_UINT24, BASE_DEC, NULL, 0xfc0000,
19856       NULL, HFILL }},
19857
19858     {&hf_ieee80211_ff_bf,
19859      {"Beam Forming", "wlan.bf",
19860       FT_UINT16, BASE_HEX, NULL, 0,
19861       NULL, HFILL }},
19862
19863     {&hf_ieee80211_ff_bf_train,
19864      {"Beam Forming Training", "wlan.bf.train",
19865       FT_BOOLEAN, 16, NULL, 0x0001,
19866       NULL, HFILL }},
19867
19868     {&hf_ieee80211_ff_bf_is_init,
19869      {"Beam Forming Is InitiatorTXSS", "wlan.bf.isInit",
19870       FT_BOOLEAN, 16, NULL, 0x0002,
19871       NULL, HFILL }},
19872
19873     {&hf_ieee80211_ff_bf_is_resp,
19874      {"Beam Forming Is ResponderTXSS", "wlan.bf.isResp",
19875       FT_BOOLEAN, 16, NULL, 0x0004,
19876       NULL, HFILL }},
19877
19878     {&hf_ieee80211_ff_bf_rxss_len,
19879      {"Beam Forming RXSS Length", "wlan.bf.rxss_len",
19880       FT_UINT16, BASE_DEC, NULL, 0x01f8,
19881       NULL, HFILL }},
19882
19883     {&hf_ieee80211_ff_bf_rxss_rate,
19884      {"Beam Forming RXSS Rate", "wlan.bf.rxss_rate",
19885       FT_BOOLEAN, 16, NULL, 0x0200,
19886       NULL, HFILL }},
19887
19888     {&hf_ieee80211_ff_bf_b10b15,
19889      {"Reserved (B10-B15)", "wlan.bf.reserved",
19890       FT_UINT16, BASE_DEC, NULL, 0xFC00,
19891       NULL, HFILL }},
19892
19893     {&hf_ieee80211_ff_bf_num_sectors,
19894      {"Beam Forming Total Number of Sectors", "wlan.bf.num_sectors",
19895       FT_UINT16, BASE_DEC, NULL, 0x03f8,
19896       NULL, HFILL }},
19897
19898     {&hf_ieee80211_ff_bf_num_rx_dmg_ants,
19899      {"Beam Forming Number of DMG Antennas", "wlan.bf.num_dmg_ants",
19900       FT_UINT16, BASE_DEC, NULL, 0x0c00,
19901       NULL, HFILL }},
19902
19903     {&hf_ieee80211_ff_bf_b12b15,
19904      {"Reserved (B12-B15)", "wlan.bf.reserved",
19905       FT_UINT16, BASE_DEC, NULL, 0xF000,
19906       NULL, HFILL }},
19907
19908     {&hf_ieee80211_addr_nav_da,
19909      {"Destination address of STA that caused NAV update", "wlan.nav_da",
19910       FT_ETHER, BASE_NONE, NULL, 0,
19911       "DMG Destination Hardware Address", HFILL }},
19912
19913     {&hf_ieee80211_addr_nav_sa,
19914      {"Source address of STA that caused NAV update", "wlan.nav_sa",
19915       FT_ETHER, BASE_NONE, NULL, 0,
19916       "DMG Source Hardware Address", HFILL }},
19917
19918     {&hf_ieee80211_ff_sswf,
19919      {"Sector Sweep Feedback", "wlan.sswf",
19920       FT_UINT24, BASE_HEX, NULL, 0,
19921       NULL, HFILL }},
19922
19923     {&hf_ieee80211_ff_sswf_total_sectors,
19924      {"Sector Sweep Feedback total number of sectors", "wlan.sswf.num_sectors",
19925       FT_UINT24, BASE_DEC, NULL, 0x0001ff,
19926       NULL, HFILL }},
19927
19928     {&hf_ieee80211_ff_sswf_num_rx_dmg_ants,
19929      {"Sector Sweep Feedback Number of receive DMG Antennas", "wlan.sswf.num_dmg_ants",
19930       FT_UINT24, BASE_DEC, NULL, 0x000600,
19931       NULL, HFILL }},
19932
19933     {&hf_ieee80211_ff_sswf_poll_required,
19934      {"Sector Sweep Feedback Poll required", "wlan.sswf.poll",
19935       FT_BOOLEAN, 24, NULL, 0x010000,
19936       NULL, HFILL }},
19937
19938     {&hf_ieee80211_ff_sswf_reserved1,
19939      {"Sector Sweep Feedback Reserved", "wlan.sswf.reserved",
19940       FT_UINT24, BASE_HEX, NULL, 0x00F800,
19941       NULL, HFILL }},
19942
19943     {&hf_ieee80211_ff_sswf_reserved2,
19944      {"Sector Sweep Feedback Reserved", "wlan.sswf.reserved",
19945       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
19946       NULL, HFILL }},
19947
19948     {&hf_ieee80211_ff_sswf_sector_select,
19949      {"Sector Sweep Feedback Sector Select", "wlan.sswf.sector_select",
19950       FT_UINT24, BASE_DEC, NULL, 0x00003F,
19951       NULL, HFILL }},
19952
19953     {&hf_ieee80211_ff_sswf_dmg_antenna_select,
19954      {"Sector Sweep Feedback DMG Antenna Select", "wlan.sswf.dmg_antenna_select",
19955       FT_UINT24, BASE_DEC, NULL, 0x0001C0,
19956       NULL, HFILL }},
19957
19958     {&hf_ieee80211_ff_sswf_snr_report,
19959      {"Sector Sweep Feedback SNR Report", "wlan.sswf.snr_report",
19960       FT_UINT24, BASE_DEC, NULL, 0x00FE00,
19961       NULL, HFILL }},
19962
19963
19964     {&hf_ieee80211_ff_brp,
19965      {"BRP Request", "wlan.brp",
19966       FT_UINT32, BASE_HEX, NULL, 0,
19967       NULL, HFILL }},
19968
19969     {&hf_ieee80211_ff_brp_L_RX,
19970      {"BRP Request L-RX", "wlan.brp.l_rx",
19971       FT_UINT32, BASE_DEC, NULL, 0x0000001f,
19972       NULL, HFILL }},
19973
19974     {&hf_ieee80211_ff_brp_TX_TRN_REQ,
19975      {"BRP Request TX-TRN-REQ", "wlan.brp.tx_trn_req",
19976       FT_BOOLEAN, 32, NULL, 0x00000020,
19977       NULL, HFILL }},
19978
19979     {&hf_ieee80211_ff_brp_MID_REQ,
19980      {"BRP Request MID-REQ", "wlan.brp.mid_req",
19981       FT_BOOLEAN, 32, NULL, 0x00000040,
19982       NULL, HFILL }},
19983
19984     {&hf_ieee80211_ff_brp_BC_REQ,
19985      {"BRP Request BC-REQ", "wlan.brp.bc_req",
19986       FT_BOOLEAN, 32, NULL, 0x00000080,
19987       NULL, HFILL }},
19988
19989     {&hf_ieee80211_ff_brp_MID_GRANT,
19990      {"BRP Request MID-GRANT", "wlan.brp.mid_grant",
19991       FT_BOOLEAN, 32, NULL, 0x00000100,
19992       NULL, HFILL }},
19993
19994     {&hf_ieee80211_ff_brp_BC_GRANT,
19995      {"BRP Request BC-GRANT", "wlan.brp.bc_grant",
19996       FT_BOOLEAN, 32, NULL, 0x00000200,
19997       NULL, HFILL }},
19998
19999     {&hf_ieee80211_ff_brp_chan_FBCK_CAP,
20000      {"BRP Request Chan FBCK-CAP", "wlan.brp.chan_fbck_cap",
20001       FT_BOOLEAN, 32, NULL, 0x00000400,
20002       NULL, HFILL }},
20003
20004     {&hf_ieee80211_ff_brp_tx_sector,
20005      {"BRP Request TX Sector ID", "wlan.brp.tx_sector_id",
20006       FT_UINT32, BASE_DEC, NULL, 0x0001f800,
20007       NULL, HFILL }},
20008
20009     {&hf_ieee80211_ff_brp_other_aid,
20010      {"BRP Request Other AID", "wlan.brp.other_aid",
20011       FT_UINT32, BASE_DEC, NULL, 0x01fe0000,
20012       NULL, HFILL }},
20013
20014     {&hf_ieee80211_ff_brp_tx_antenna,
20015      {"BRP Request TX Antenna ID", "wlan.brp.tx_antenna_id",
20016       FT_UINT32, BASE_DEC, NULL, 0x06000000,
20017       NULL, HFILL }},
20018
20019     {&hf_ieee80211_ff_brp_reserved,
20020      {"BRP Request Reserved", "wlan.brp.reserved",
20021       FT_UINT32, BASE_HEX, NULL, 0xF8000000,
20022       NULL, HFILL }},
20023
20024     {&hf_ieee80211_ff_blm,
20025      {"Beamformed Link Maintenance", "wlan.blm",
20026       FT_UINT8, BASE_HEX, NULL, 0,
20027       NULL, HFILL }},
20028
20029     {&hf_ieee80211_ff_blm_unit_index,
20030      {"BeamLink Maintenance Uint Index", "wlan.blm.uint_index",
20031       FT_BOOLEAN, 8, NULL, 0x01,
20032       NULL, HFILL }},
20033
20034     {&hf_ieee80211_ff_blm_maint_value,
20035      {"BeamLink Maintenance Value", "wlan.blm.value",
20036       FT_UINT8, BASE_DEC, NULL, 0x7e,
20037       NULL, HFILL }},
20038
20039     {&hf_ieee80211_ff_blm_is_master,
20040      {"BeamLink Is Master", "wlan.blm.is_master",
20041       FT_BOOLEAN, 8, NULL, 0x80,
20042       NULL, HFILL }},
20043
20044     {&hf_ieee80211_ff_bic,
20045      {"Beacon Interval Control", "wlan.bic",
20046       FT_UINT48, BASE_HEX, NULL, 0,
20047       NULL, HFILL }},
20048
20049     {&hf_ieee80211_ff_bic_cc_present,
20050      {"Clustering Control Present", "wlan.bic.cc",
20051       FT_BOOLEAN, 48, NULL, 0x000000000001,
20052       NULL, HFILL }},
20053
20054     {&hf_ieee80211_ff_bic_discovery_mode,
20055      {"Discovery Mode", "wlan.bic.discovery_mode",
20056       FT_BOOLEAN, 48, NULL, 0x000000000002,
20057       NULL, HFILL }},
20058
20059     {&hf_ieee80211_ff_bic_next_beacon,
20060      {"Next Beacon", "wlan.bic.next_beacon",
20061       FT_UINT48, BASE_DEC, NULL, 0x00000000003c,
20062
20063       NULL, HFILL }},
20064
20065     {&hf_ieee80211_ff_bic_ati_present,
20066      {"ATI Present", "wlan.bic.ati",
20067       FT_BOOLEAN, 48, NULL, 0x000000000040,
20068       NULL, HFILL }},
20069
20070     {&hf_ieee80211_ff_bic_abft_len,
20071      {"A-BFT length", "wlan.bic.abft_len",
20072       FT_UINT48, BASE_DEC, NULL, 0x000000000380,
20073       NULL, HFILL }},
20074
20075     {&hf_ieee80211_ff_bic_fss,
20076      {"FSS", "wlan.bic.fss",
20077       FT_UINT48, BASE_DEC, NULL, 0x000000003c00,
20078       NULL, HFILL }},
20079
20080     {&hf_ieee80211_ff_bic_is_resp,
20081      {"Is TXSS Responder", "wlan.bic.is_responder",
20082       FT_BOOLEAN, 48, NULL, 0x000000004000,
20083       NULL, HFILL }},
20084
20085     {&hf_ieee80211_ff_bic_next_abft,
20086      {"Next A-BFT", "wlan.bic.next_abft",
20087       FT_UINT48, BASE_DEC, NULL, 0x000000078000,
20088       NULL, HFILL }},
20089
20090     {&hf_ieee80211_ff_bic_frag_txss,
20091      {"Fragmented TXSS", "wlan.bic.frag_txss",
20092       FT_BOOLEAN, 48, NULL, 0x000000080000,
20093       NULL, HFILL }},
20094
20095     {&hf_ieee80211_ff_bic_txss_span,
20096      {"TXSS span", "wlan.bic.txss_span",
20097       FT_UINT48, BASE_DEC, NULL, 0x000007f00000,
20098       NULL, HFILL }},
20099
20100     {&hf_ieee80211_ff_bic_NBI_abft,
20101      {"Number of Beacon Intervals that are needed to allocate A-BFT", "wlan.bic.NBI_abft",
20102       FT_UINT48, BASE_DEC, NULL, 0x00078000000,
20103       NULL, HFILL }},
20104
20105     {&hf_ieee80211_ff_bic_abft_count,
20106      {"A-BFT Count", "wlan.bic.abft_count",
20107       FT_UINT48, BASE_DEC, NULL, 0x001f80000000,
20108       NULL, HFILL }},
20109
20110     {&hf_ieee80211_ff_bic_nabft,
20111      {"Number of A-BFT's received from each Antenna", "wlan.bic.nabft",
20112       FT_UINT48, BASE_DEC, NULL, 0x07e000000000,
20113       NULL, HFILL }},
20114
20115     {&hf_ieee80211_ff_bic_pcp,
20116      {"PCP Association Ready", "wlan.bic.pcp",
20117       FT_BOOLEAN, 48, NULL, 0x080000000000,
20118       NULL, HFILL }},
20119
20120     {&hf_ieee80211_ff_bic_reserved,
20121      {"Reserved", "wlan.bic.reserved",
20122       FT_UINT48, BASE_HEX, NULL, 0xF00000000000,
20123       NULL, HFILL }},
20124
20125     {&hf_ieee80211_ff_dmg_params,
20126      {"DMG Parameters", "wlan.dmg_params",
20127       FT_UINT8, BASE_HEX , NULL, 0,
20128       NULL, HFILL }},
20129
20130     {&hf_ieee80211_ff_dmg_params_bss,
20131      {"BSS Type", "wlan.dmg_params.bss",
20132       FT_UINT8, BASE_DEC, VALS(bss_type), 0x03,
20133       NULL, HFILL }},
20134
20135     {&hf_ieee80211_ff_dmg_params_cbap_only,
20136      {"CBAP Only", "wlan.dmp_params.cbap_only",
20137       FT_BOOLEAN, 8, NULL, 0x04,
20138       NULL, HFILL }},
20139
20140     {&hf_ieee80211_ff_dmg_params_cbap_src,
20141      {"CBAP Source", "wlan.dmp_params.cbap_src",
20142       FT_BOOLEAN, 8, NULL, 0x08,
20143       NULL, HFILL }},
20144
20145     {&hf_ieee80211_ff_dmg_params_privacy,
20146      {"DMG Privacy", "wlan.dmp_params.privacy",
20147       FT_BOOLEAN, 8, NULL, 0x10,
20148       NULL, HFILL }},
20149
20150     {&hf_ieee80211_ff_dmg_params_policy,
20151      {"ECPAC Policy Enforced", "wlan.dmp_params.policy",
20152       FT_BOOLEAN, 8, NULL, 0x20,
20153       NULL, HFILL }},
20154
20155     {&hf_ieee80211_ff_cc,
20156      {"Clustering Control", "wlan.cc",
20157       FT_UINT64, BASE_HEX , NULL, 0,
20158       NULL, HFILL }},
20159
20160     {&hf_ieee80211_ff_cc_abft_resp_addr,
20161      {"A-BFT Responder Address", "wlan.cc.abft_resp_addr",
20162       FT_ETHER, BASE_NONE , NULL, 0,
20163       NULL, HFILL }},
20164
20165     {&hf_ieee80211_ff_cc_sp_duration,
20166      {"Beacon SP Duration", "wlan.cc.sp_duration",
20167       FT_UINT8, BASE_DEC , NULL, 0,
20168       NULL, HFILL }},
20169
20170     {&hf_ieee80211_ff_cc_cluster_id,
20171      {"Cluster ID", "wlan.cc.cluster_id",
20172       FT_UINT64, BASE_DEC , NULL, 0,
20173       NULL, HFILL }},
20174
20175     {&hf_ieee80211_ff_cc_role,
20176      {"Cluster Member Role", "wlan.cc.rold",
20177       FT_UINT8, BASE_DEC , NULL, 0,
20178       NULL, HFILL }},
20179
20180     {&hf_ieee80211_ff_cc_max_mem,
20181      {"Cluster MaxMem", "wlan.cc.max_mem",
20182       FT_UINT8, BASE_DEC , NULL, 0,
20183       NULL, HFILL }},
20184
20185     {&hf_ieee80211_tag_relay_support,
20186      {"Relay Supportability", "wlan.relay_capabilities.relay_support",
20187       FT_BOOLEAN, 8, NULL, 0x01,
20188       NULL, HFILL }},
20189
20190     {&hf_ieee80211_tag_relay_use,
20191      {"Relay Usability", "wlan.relay_capabilities.relay_use",
20192       FT_BOOLEAN, 8, NULL, 0x02,
20193       NULL, HFILL }},
20194
20195     {&hf_ieee80211_tag_relay_permission,
20196      {"Relay Permission", "wlan.relay_capabilities.relay_permission",
20197       FT_BOOLEAN, 8, NULL, 0x04,
20198       NULL, HFILL }},
20199
20200     {&hf_ieee80211_tag_AC_power,
20201      {"A/C Power", "wlan.relay_capabilities.AC_power",
20202       FT_BOOLEAN, 8, NULL, 0x08,
20203       NULL, HFILL }},
20204
20205     {&hf_ieee80211_tag_relay_prefer,
20206      {"Relay Preference", "wlan.relay_capabilities.relay_prefer",
20207       FT_BOOLEAN, 8, NULL, 0x10,
20208       NULL, HFILL }},
20209
20210     {&hf_ieee80211_tag_duplex,
20211      {"Duplex", "wlan.relay_capabilities.duplex",
20212       FT_UINT8, BASE_DEC, NULL, 0x60,
20213       NULL, HFILL }},
20214
20215     {&hf_ieee80211_tag_cooperation,
20216      {"Cooperation", "wlan.relay_capabilities.cooperation",
20217       FT_BOOLEAN, 8, NULL, 0x80,
20218       NULL, HFILL }},
20219
20220 #if 0
20221     {&hf_ieee80211_ff_rcsi,
20222      {"Relay Capable STA Info", "wlan.rcsi",
20223       FT_UINT24, BASE_HEX, NULL, 0,
20224       NULL, HFILL }},
20225
20226     {&hf_ieee80211_ff_rcsi_aid,
20227      {"AID", "wlan.rcsi.aid",
20228       FT_UINT8, BASE_DEC, NULL, 0xff,
20229       NULL, HFILL }},
20230 #endif
20231
20232     {&hf_ieee80211_ff_band_id,
20233      {"Band ID", "wlan.band_id",
20234       FT_UINT8, BASE_DEC, VALS(band_id), 0xff,
20235       NULL, HFILL }},
20236
20237     {&hf_ieee80211_tag_move,
20238      {"Move", "wlan.dmg_bss_param_change.move",
20239       FT_BOOLEAN, 8, NULL, 0x01,
20240       NULL, HFILL }},
20241
20242     {&hf_ieee80211_tag_size,
20243      {"Size", "wlan.dmg_bss_param_change.size",
20244       FT_BOOLEAN, 8, NULL, 0x02,
20245       NULL, HFILL }},
20246
20247     {&hf_ieee80211_tag_tbtt_offset,
20248      {"TBTT Offset", "wlan.dmg_bss_param_change.tbtt_offset",
20249       FT_UINT32, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xffffffff,
20250       NULL, HFILL }},
20251
20252     {&hf_ieee80211_tag_bi_duration,
20253      {"BI Duration", "wlan.dmg_bss_param_change.bi_duration",
20254       FT_UINT16, BASE_DEC, NULL, 0xffff,
20255       NULL, HFILL }},
20256
20257     {&hf_ieee80211_tag_dmg_capa_sta_addr,
20258      {"STA Address", "wlan.dmg_capa.sta_addr",
20259       FT_ETHER, BASE_NONE, NULL, 0,
20260       "STA_Address", HFILL }},
20261
20262     {&hf_ieee80211_tag_dmg_capa_aid,
20263      {"AID", "wlan.dmg_capa.aid",
20264       FT_UINT16, BASE_DEC, NULL, 0,
20265       NULL, HFILL }},
20266 /* 8.4.2.127.2 DMG STA Capability Information field */
20267     {&hf_ieee80211_tag_reverse_direction, /* DMG STA capa, bits [0] */
20268      {"Reverse Direction", "wlan.dmg_capa.reverse_direction",
20269       FT_BOOLEAN, 24, NULL, GENMASK(0, 0),
20270       NULL, HFILL }},
20271
20272     {&hf_ieee80211_tag_hlts, /* DMG STA capa, bits [1] */
20273      {"Higher Layer Timer Synchronization", "wlan.dmg_capa.htls",
20274       FT_BOOLEAN, 24, NULL, GENMASK(1, 1),
20275       NULL, HFILL }},
20276
20277     {&hf_ieee80211_tag_tpc, /* DMG STA capa, bits [2] */
20278      {"TPC", "wlan.dmg_capa.tpc",
20279       FT_BOOLEAN, 24, NULL, GENMASK(2, 2),
20280       NULL, HFILL }},
20281
20282     {&hf_ieee80211_tag_spsh, /* DMG STA capa, bits [3] */
20283      {"SPSH and Interference Mitigation", "wlan.dmg_capa.spsh",
20284       FT_BOOLEAN, 24, NULL, GENMASK(3, 3),
20285       NULL, HFILL }},
20286
20287     {&hf_ieee80211_tag_rx_antenna, /* DMG STA capa, bits [4..5] */
20288      {"Number of RX DMG Antennas", "wlan.dmg_capa.num_rx",
20289       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(5, 4),
20290       NULL, HFILL }},
20291
20292     {&hf_ieee80211_tag_fast_link, /* DMG STA capa, bits [6] */
20293      {"Fast Link Adaptation", "wlan.dmg_capa.fast_link",
20294       FT_BOOLEAN, 24, NULL, GENMASK(6, 6),
20295       NULL, HFILL }},
20296
20297     {&hf_ieee80211_tag_num_sectors, /* DMG STA capa, bits [7..13] */
20298      {"Total Number of Sectors", "wlan.dmg_capa.num_sectors",
20299       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(13, 7),
20300       NULL, HFILL }},
20301
20302     {&hf_ieee80211_tag_rxss_length, /* DMG STA capa, bits [14..19] */
20303      {"RXSS Length", "wlan.dmg_capa.rxss_len",
20304       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_mul_two_base_custom), GENMASK(19, 14),
20305       NULL, HFILL }},
20306
20307     {&hf_ieee80211_tag_reciprocity, /* DMG STA capa, bits [20] */
20308      {"DMG Antenna Reciprocity", "wlan.dmg_capa.reciprocity",
20309       FT_BOOLEAN, 24, NULL, GENMASK(20, 20),
20310       NULL, HFILL }},
20311 /* DMG STA capa, A-MPDU params, bits [21..26] */
20312     {&hf_ieee80211_tag_max_ampdu_exp, /* DMG STA capa, bits [21..23] */
20313      {"Maximum A-MPDU Length Exponent", "wlan.dmg_capa.max_ampdu_exp",
20314       FT_UINT24, BASE_DEC, NULL, GENMASK(23, 21),
20315       NULL, HFILL }},
20316
20317     {&hf_ieee80211_tag_min_mpdu_sapcing, /* DMG STA capa, bits [24..26] */
20318      {"Minimum MPDU Start Spacing", "wlan.dmg_capa.min_mpdu_spacing",
20319       FT_UINT24, BASE_DEC, NULL, GENMASK(26-24, 24-24),
20320       NULL, HFILL }},
20321
20322     {&hf_ieee80211_tag_ba_flow_control , /* DMG STA capa, bits [27] */
20323      {"BA with Flow Control", "wlan.dmg_capa.bs_flow_ctrl",
20324       FT_BOOLEAN, 24, NULL, GENMASK(27-24, 27-24),
20325       NULL, HFILL }},
20326 /* DMG STA capa, supported MCS set, bits [28..51] */
20327     {&hf_ieee80211_tag_max_sc_rx_mcs, /* DMG STA capa, bits [28..32] */
20328      {"Maximum SC Rx MCS", "wlan.dmg_capa.max_sc_rx_mcs",
20329       FT_UINT24, BASE_DEC, NULL, GENMASK(32-24, 28-24),
20330       NULL, HFILL }},
20331
20332     {&hf_ieee80211_tag_max_ofdm_rx_mcs, /* DMG STA capa, bits [33..37] */
20333      {"Maximum OFDM Rx MCS", "wlan.dmg_capa.max_ofdm_rx_mcs",
20334       FT_UINT24, BASE_DEC, NULL, GENMASK(37-24, 33-24),
20335       NULL, HFILL }},
20336
20337     {&hf_ieee80211_tag_max_sc_tx_mcs, /* DMG STA capa, bits [38..42] */
20338      {"Maximum SC Tx MCS", "wlan.dmg_capa.max_sc_tx_mcs",
20339       FT_UINT24, BASE_DEC, NULL, GENMASK(42-24, 38-24),
20340       NULL, HFILL }},
20341
20342     {&hf_ieee80211_tag_max_ofdm_tx_mcs, /* DMG STA capa, bits [43..47] */
20343      {"Maximum OFDM Tx MCS", "wlan.dmg_capa.max_ofdm_tx_mcs",
20344       FT_UINT24, BASE_DEC, NULL, GENMASK(47-24, 43-24),
20345       NULL, HFILL }},
20346
20347     {&hf_ieee80211_tag_low_power_supported, /* DMG STA capa, bits [48] */
20348      {"Low Power SC PHY Supported", "wlan.dmg_capa.low_power_suuported",
20349       FT_BOOLEAN, 16, NULL, GENMASK(48-48, 48-48),
20350       NULL, HFILL }},
20351
20352     {&hf_ieee80211_tag_code_rate, /* DMG STA capa, bits [49] */
20353      {"Code Rate 13/16", "wlan.dmg_capa.code_rate",
20354       FT_BOOLEAN, 16, NULL, GENMASK(49-48, 49-48),
20355       NULL, HFILL }},
20356
20357     {&hf_ieee80211_tag_dtp, /* DMG STA capa, bits [52] */
20358      {"DTP Supported", "wlan.dmg_capa.dtp",
20359       FT_BOOLEAN, 16, NULL, GENMASK(52-48, 52-48),
20360       NULL, HFILL }},
20361
20362     {&hf_ieee80211_tag_appdu_supp, /* DMG STA capa, bits [53] */
20363      {"A-PPDU Supported", "wlan.dmg_capa.appdu_supp",
20364       FT_BOOLEAN, 16, NULL, GENMASK(53-48, 53-48),
20365       NULL, HFILL }},
20366
20367     {&hf_ieee80211_tag_heartbeat, /* DMG STA capa, bits [54] */
20368      {"HeartBeat", "wlan.dmg_capa.heartbeat",
20369       FT_BOOLEAN, 16, NULL, GENMASK(54-48, 54-48),
20370       NULL, HFILL }},
20371
20372     {&hf_ieee80211_tag_other_aid, /* DMG STA capa, bits [55] */
20373      {"Supports Other_AID", "wlan.dmg_capa.other_aid",
20374       FT_BOOLEAN, 16, NULL, GENMASK(55-48, 55-48),
20375       NULL, HFILL }},
20376
20377     {&hf_ieee80211_tag_pattern_recip, /* DMG STA capa, bits [56] */
20378      {"Antenna Pattern Reciprocity", "wlan.dmg_capa.pattern_recip",
20379       FT_BOOLEAN, 16, NULL, GENMASK(56-48, 56-48),
20380       NULL, HFILL }},
20381
20382     {&hf_ieee80211_tag_heartbeat_elapsed, /* DMG STA capa, bits [57..59] */
20383      {"Heartbeat Elapsed Indication", "wlan.dmg_capa.heartbeat_elapsed",
20384       FT_UINT16, BASE_DEC, NULL, GENMASK(59-48, 57-48),
20385       NULL, HFILL }},
20386
20387     {&hf_ieee80211_tag_grant_ack_supp, /* DMG STA capa, bits [60] */
20388      {"Grant ACK Supported", "wlan.dmg_capa.grant_ack_supp",
20389       FT_BOOLEAN, 16, NULL, GENMASK(60-48, 60-48),
20390       NULL, HFILL }},
20391
20392     {&hf_ieee80211_tag_RXSSTxRate_supp, /* DMG STA capa, bits [61] */
20393      {"RXSSTxRate Supported", "wlan.dmg_capa.RXSSTxRate",
20394       FT_BOOLEAN, 16, NULL, GENMASK(61-48, 61-48),
20395       NULL, HFILL }},
20396 /* 8.4.2.127.3 DMG PCP/AP Capability Information field */
20397     {&hf_ieee80211_tag_pcp_tddti, /* DMG PCP/AP capa, bits [0] */
20398      {"TDDTI", "wlan.dmg_capa.pcp_tdtti",
20399       FT_BOOLEAN, 16, NULL, GENMASK(0, 0),
20400       NULL, HFILL }},
20401
20402     {&hf_ieee80211_tag_pcp_PSA, /* DMG PCP/AP capa, bits [1] */
20403      {"Pseudo-static Allocations", "wlan.dmg_capa.pcp_psa",
20404       FT_BOOLEAN, 16, NULL, GENMASK(1, 1),
20405       NULL, HFILL }},
20406
20407     {&hf_ieee80211_tag_pcp_handover, /* DMG PCP/AP capa, bits [2] */
20408      {"PDP Handover", "wlan.dmg_capa.pcp_handover",
20409       FT_BOOLEAN, 16, NULL, GENMASK(2, 2),
20410       NULL, HFILL }},
20411
20412     {&hf_ieee80211_tag_pcp_max_assoc, /* DMG PCP/AP capa, bits [3..10] */
20413      {"Max Associated STA Number", "wlan.dmg_capa.pcp_max_assoc",
20414       FT_UINT16, BASE_DEC, NULL, GENMASK(10, 3),
20415       NULL, HFILL }},
20416
20417     {&hf_ieee80211_tag_pcp_power_src, /* DMG PCP/AP capa, bits [11] */
20418      {"Power Source", "wlan.dmg_capa.pcp_power_src",
20419       FT_BOOLEAN, 16, NULL, GENMASK(11, 11),
20420       NULL, HFILL }},
20421
20422     {&hf_ieee80211_tag_pcp_decenter, /* DMG PCP/AP capa, bits [12] */
20423      {"Decentralized PCP/AP Clustering", "wlan.dmg_capa.pcp_decenter",
20424       FT_BOOLEAN, 16, NULL, GENMASK(12, 12),
20425       NULL, HFILL }},
20426
20427     {&hf_ieee80211_tag_pcp_forwarding, /* DMG PCP/AP capa, bits [13] */
20428      {"PCP Forwarding", "wlan.dmg_capa.pcp_forwarding",
20429       FT_BOOLEAN, 16, NULL, GENMASK(13, 13),
20430       NULL, HFILL }},
20431
20432     {&hf_ieee80211_tag_pcp_center, /* DMG PCP/AP capa, bits [14] */
20433      {"Centralized PCP/AP Clustering", "wlan.dmg_capa.pcp_center",
20434       FT_BOOLEAN, 16, NULL, GENMASK(14, 14),
20435       NULL, HFILL }},
20436
20437     {&hf_ieee80211_tag_PSRSI,
20438      {"PS Request Suspension Interval", "wlan.dmg_oper.psrsi",
20439       FT_UINT8, BASE_DEC, NULL, 0,
20440       NULL, HFILL }},
20441
20442     {&hf_ieee80211_tag_min_BHI_duration,
20443      {"Min BHI Duration", "wlan.dmg_oper.min_BHI_duration",
20444       FT_UINT16, BASE_DEC, NULL, 0,
20445       NULL, HFILL }},
20446
20447     {&hf_ieee80211_tag_brdct_sta_info_dur,
20448      {"Broadcast STA Info Duration", "wlan.dmg_oper.brdcst_sta_info_dur",
20449       FT_UINT8, BASE_DEC, NULL, 0,
20450       NULL, HFILL }},
20451
20452     {&hf_ieee80211_tag_assoc_resp_confirm_time,
20453      {"Associated Response Confirm Time", "wlan.dmg_oper.assoc_resp_confirm_time",
20454       FT_UINT8, BASE_DEC, NULL, 0,
20455       NULL, HFILL }},
20456
20457     {&hf_ieee80211_tag_min_pp_duration,
20458      {"Min PP Duration", "wlan.dmg_oper.min_pp_duration",
20459       FT_UINT8, BASE_DEC, NULL, 0,
20460       NULL, HFILL }},
20461
20462     {&hf_ieee80211_tag_SP_idle_timeout,
20463      {"SP Idle Timeout", "wlan.dmg_oper.SP_idle_timeout",
20464       FT_UINT8, BASE_DEC, NULL, 0,
20465       NULL, HFILL }},
20466
20467     {&hf_ieee80211_tag_max_lost_beacons,
20468      {"Max Lost Beacons", "wlan.dmg_oper.max_lost_beacons",
20469       FT_UINT8, BASE_DEC, NULL, 0,
20470       NULL, HFILL }},
20471
20472     {&hf_ieee80211_tag_type,
20473      {"Type", "wlan.sctor_id.type",
20474       FT_UINT32, BASE_HEX, NULL, 0x0000000f,
20475       NULL, HFILL }},
20476
20477     {&hf_ieee80211_tag_tap1,
20478      {"Tap 1", "wlan.sctor_id.tap1",
20479       FT_UINT32, BASE_HEX, NULL, 0x000003f0,
20480       NULL, HFILL }},
20481
20482     {&hf_ieee80211_tag_state1,
20483      {"State 1", "wlan.sctor_id.state1",
20484       FT_UINT32, BASE_HEX, NULL, 0x0000fc00,
20485       NULL, HFILL }},
20486
20487     {&hf_ieee80211_tag_tap2,
20488      {"Tap 2", "wlan.sctor_id.tap2",
20489       FT_UINT32, BASE_HEX, NULL, 0x00ff0000,
20490       NULL, HFILL }},
20491
20492     {&hf_ieee80211_tag_state2,
20493      {"State 2", "wlan.sctor_id.state2",
20494       FT_UINT32, BASE_HEX, NULL, 0xff000000,
20495       NULL, HFILL }},
20496
20497     {&hf_ieee80211_tag_allocation_id,
20498      {"Allocation ID", "wlan.ext_sched.alloc_id",
20499       FT_UINT16, BASE_DEC, NULL, 0x000f,
20500       NULL, HFILL }},
20501
20502     {&hf_ieee80211_tag_allocation_type,
20503      {"Allocation Type", "wlan.ext_sched.alloc_type",
20504       FT_UINT16, BASE_DEC, VALS(allocation_type), 0x0070,
20505       NULL, HFILL }},
20506
20507     {&hf_ieee80211_tag_pseudo_static,
20508      {"Pseudo-static", "wlan.ext_sched.p_static",
20509       FT_BOOLEAN, 16, NULL, 0x0080,
20510       NULL, HFILL }},
20511
20512     {&hf_ieee80211_tag_truncatable,
20513      {"Truncatable", "wlan.ext_sched.truncatable",
20514       FT_BOOLEAN, 16, NULL, 0x0100,
20515       NULL, HFILL }},
20516
20517     {&hf_ieee80211_tag_extendable,
20518      {"Extenedable", "wlan.ext_sched.extendable",
20519       FT_BOOLEAN, 16, NULL, 0x0200,
20520       NULL, HFILL }},
20521
20522     {&hf_ieee80211_tag_pcp_active,
20523      {"PCP Active", "wlan.ext_sched.pcp_active",
20524       FT_BOOLEAN, 16, NULL, 0x0400,
20525       NULL, HFILL }},
20526
20527     {&hf_ieee80211_tag_lp_sc_used,
20528      {"LP SC Used", "wlan.ext_sched.lp_sc_used",
20529       FT_BOOLEAN, 16, NULL, 0x0800,
20530       NULL, HFILL }},
20531
20532     {&hf_ieee80211_tag_src_aid,
20533      {"Source AID", "wlan.ext_sched.src_id",
20534       FT_UINT8, BASE_DEC, NULL, 0xff,
20535       NULL, HFILL }},
20536
20537     {&hf_ieee80211_tag_dest_aid,
20538      {"Destination AID", "wlan.ext_sched.dest_id",
20539       FT_UINT8, BASE_DEC, NULL, 0xff,
20540       NULL, HFILL }},
20541
20542     {&hf_ieee80211_tag_alloc_start,
20543      {"Allocation Start", "wlan.ext_sched.alloc_start",
20544       FT_UINT32, BASE_DEC, NULL, 0,
20545       NULL, HFILL }},
20546
20547     {&hf_ieee80211_tag_alloc_block_duration,
20548      {"Allocation Block Duration", "wlan.ext_sched.block_duration",
20549       FT_UINT16, BASE_DEC, NULL, 0xffff,
20550       NULL, HFILL }},
20551
20552     {&hf_ieee80211_tag_num_blocks,
20553      {"Number of Blocks", "wlan.ext_sched.num_blocks",
20554       FT_UINT8, BASE_DEC, NULL, 0xff,
20555       NULL, HFILL }},
20556
20557     {&hf_ieee80211_tag_alloc_block_period,
20558      {"Allocation Block Period", "wlan.ext_sched.alloc_block_period",
20559       FT_UINT16, BASE_DEC, NULL, 0xffff,
20560       NULL, HFILL }},
20561
20562     {&hf_ieee80211_tag_aid,
20563      {"AID", "wlan.sta_avail.aid",
20564       FT_UINT16, BASE_DEC, NULL, 0x00ff,
20565       NULL, HFILL }},
20566
20567     {&hf_ieee80211_tag_cbap,
20568      {"CBAP", "wlan.sta_avail.cbap",
20569       FT_BOOLEAN, 16, NULL, 0x0100,
20570       NULL, HFILL }},
20571
20572     {&hf_ieee80211_tag_pp_avail,
20573      {"PP Available", "wlan.sta_avail.pp_avail",
20574       FT_BOOLEAN, 16, NULL, 0x0200,
20575       NULL, HFILL }},
20576
20577     {&hf_ieee80211_tag_next_ati_start_time,
20578      {"Start Time", "wlan.next_ati.start_time",
20579       FT_UINT32, BASE_DEC, NULL, 0,
20580       NULL, HFILL }},
20581
20582     {&hf_ieee80211_tag_next_ati_duration,
20583      {"ATI Duration", "wlan.next_ati.duration",
20584       FT_UINT16, BASE_DEC, NULL, 0xffff,
20585       NULL, HFILL }},
20586
20587     {&hf_ieee80211_tag_old_bssid,
20588      {"Old BSSID", "wlan.pcp_handover.old_bssid",
20589       FT_ETHER, BASE_NONE, NULL, 0,
20590       "OLD_BSSID", HFILL }},
20591
20592     {&hf_ieee80211_tag_new_pcp_addr,
20593      {"New PCP Address", "wlan.pcp_handover.new_pcp_addr",
20594       FT_ETHER, BASE_NONE, NULL, 0,
20595       "New_PCP_Address", HFILL }},
20596
20597     {&hf_ieee80211_tag_bssid,
20598      {"BSSID", "wlan.quiet_res.bssid",
20599       FT_ETHER, BASE_NONE, NULL, 0,
20600       "BSS-ID", HFILL }},
20601
20602     {&hf_ieee80211_tag_duplex_relay,
20603      {"Duplex", "wlan.relay_capabilities.duplex",
20604       FT_UINT8, BASE_DEC, NULL, 0x01,
20605       NULL, HFILL }},
20606
20607     {&hf_ieee80211_tag_cooperation_relay,
20608      {"Cooperation", "wlan.relay_capabilities.cooperation",
20609       FT_BOOLEAN, 8, NULL, 0x02,
20610       NULL, HFILL }},
20611
20612     {&hf_ieee80211_tag_tx_mode,
20613      {"TX-Mode", "wlan.realy_trans_param.tx_mode",
20614       FT_BOOLEAN, 8, NULL, 0x04,
20615       NULL, HFILL }},
20616
20617     {&hf_ieee80211_tag_link_change_interval,
20618      {"Link Change Interval", "wlan.realy_trans_param.link_change_interval",
20619       FT_UINT8, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xff,
20620       NULL, HFILL }},
20621
20622     {&hf_ieee80211_tag_data_sensing_time,
20623      {"Data Sensing Time", "wlan.realy_trans_param.data_sensing_time",
20624       FT_UINT8, BASE_DEC, NULL, 0xff,
20625       NULL, HFILL }},
20626
20627     {&hf_ieee80211_tag_first_period,
20628      {"First Period", "wlan.realy_trans_param.first_period",
20629       FT_UINT16, BASE_DEC, NULL, 0xffff,
20630       NULL, HFILL }},
20631
20632     {&hf_ieee80211_tag_second_period,
20633      {"Second Period", "wlan.realy_trans_param.second_period",
20634       FT_UINT16, BASE_DEC, NULL, 0xffff,
20635       NULL, HFILL }},
20636
20637     {&hf_ieee80211_tag_initiator,
20638      {"Initiator", "wlan.beam_refine.initiator",
20639       FT_BOOLEAN, 40, NULL, 0x0000000001,
20640       NULL, HFILL }},
20641
20642     {&hf_ieee80211_tag_tx_train_res,
20643      {"TX-train-response", "wlan.beam_refine.tx_train_res",
20644       FT_BOOLEAN, 40, NULL, 0x0000000002,
20645       NULL, HFILL }},
20646
20647     {&hf_ieee80211_tag_rx_train_res,
20648      {"RX-train-response", "wlan.beam_refine.rx_train_res",
20649       FT_BOOLEAN, 40, NULL, 0x0000000004,
20650       NULL, HFILL }},
20651
20652     {&hf_ieee80211_tag_tx_trn_ok,
20653      {"TX-TRN-OK", "wlan.beam_refine.tx_trn_ok",
20654       FT_BOOLEAN, 40, NULL, 0x0000000008,
20655       NULL, HFILL }},
20656
20657     {&hf_ieee80211_tag_txss_fbck_req,
20658      {"TXSS-FBCK-REQ", "wlan.beam_refine.txss_fbck_req",
20659       FT_BOOLEAN, 40, NULL, 0x0000000010,
20660       NULL, HFILL }},
20661
20662     {&hf_ieee80211_tag_bs_fbck,
20663      {"BS-FBCK", "wlan.beam_refine.bs_fbck",
20664       FT_UINT40, BASE_DEC, NULL, 0x00000007e0,
20665       NULL, HFILL }},
20666
20667     {&hf_ieee80211_tag_bs_fbck_antenna_id,
20668      {"BS-FBCK Anetenna ID", "wlan.beam_refine.bs_fbck_antenna_id",
20669       FT_UINT40, BASE_DEC, NULL, 0x0000001800,
20670       NULL, HFILL }},
20671
20672     {&hf_ieee80211_tag_snr_requested,
20673      {"SNR Requested", "wlan.beam_refine.snr_req",
20674       FT_BOOLEAN, 40, NULL, 0x0000002000,
20675       NULL, HFILL }},
20676
20677     {&hf_ieee80211_tag_channel_measurement_requested,
20678      {"Channel Measurement Requested", "wlan.beam_refine.ch_measure_req",
20679       FT_BOOLEAN, 40, NULL, 0x0000004000,
20680       NULL, HFILL }},
20681
20682     {&hf_ieee80211_tag_number_of_taps_requested,
20683      {"Number of Taps Requested", "wlan.beam_refine.taps_req",
20684       FT_UINT40, BASE_DEC | BASE_VAL64_STRING, VALS64(number_of_taps_values), 0x0000018000,
20685       NULL, HFILL }},
20686
20687     {&hf_ieee80211_tag_sector_id_order_req,
20688      {"Sector ID Order Requested", "wlan.beam_refine.sector_id_req",
20689       FT_BOOLEAN, 40, NULL, 0x0000020000,
20690       NULL, HFILL }},
20691
20692     {&hf_ieee80211_tag_snr_present,
20693      {"SNR Present", "wlan.beam_refine.snr_present",
20694       FT_BOOLEAN, 40, NULL, 0x0000040000,
20695       NULL, HFILL }},
20696
20697     {&hf_ieee80211_tag_channel_measurement_present,
20698      {"Channel Measurement Present", "wlan.beam_refine.ch_measure_present",
20699       FT_BOOLEAN, 40, NULL, 0x0000080000,
20700       NULL, HFILL }},
20701
20702     {&hf_ieee80211_tag_tap_delay_present,
20703      {"Tap Delay Present", "wlan.beam_refine.tap_delay_present",
20704       FT_BOOLEAN, 40, NULL, 0x0000100000,
20705       NULL, HFILL }},
20706
20707     {&hf_ieee80211_tag_number_of_taps_present,
20708      {"Number of Taps Present", "wlan.beam_refine.taps_present",
20709       FT_UINT40, BASE_DEC | BASE_VAL64_STRING, VALS64(number_of_taps_values), 0x0000600000,
20710       NULL, HFILL }},
20711
20712     {&hf_ieee80211_tag_number_of_measurement,
20713      {"Number of Measurements", "wlan.beam_refine.num_measurement",
20714       FT_UINT40, BASE_DEC, NULL, 0x003f800000,
20715       NULL, HFILL }},
20716
20717     {&hf_ieee80211_tag_sector_id_order_present,
20718      {"Sector ID Order Present", "wlan.beam_refine.sector_id_present",
20719       FT_BOOLEAN, 40, NULL, 0x0040000000,
20720       NULL, HFILL }},
20721
20722     {&hf_ieee80211_tag_number_of_beams,
20723      {"Number of Beams", "wlan.beam_refine.num_beams",
20724       FT_UINT40, BASE_DEC, NULL, 0x0f80000000,
20725       NULL, HFILL }},
20726
20727     {&hf_ieee80211_tag_mid_extension,
20728      {"MID Extension", "wlan.beam_refine.mid_ext",
20729       FT_BOOLEAN, 40, NULL, 0x1000000000,
20730       NULL, HFILL }},
20731
20732     {&hf_ieee80211_tag_capability_request,
20733      {"Capability Request", "wlan.beam_refine.cap_req",
20734       FT_BOOLEAN, 40, NULL, 0x2000000000,
20735       NULL, HFILL }},
20736
20737     {&hf_ieee80211_tag_beam_refine_reserved,
20738      {"Reserved", "wlan.beam_refine.reserved",
20739       FT_UINT40, BASE_DEC, NULL, 0xc000000000,
20740       NULL, HFILL }},
20741
20742     {&hf_ieee80211_tag_nextpcp_list,
20743       {"AID of NextPCP", "wlan.next_pcp.list",
20744        FT_UINT8, BASE_DEC, NULL, 0,
20745        NULL, HFILL }},
20746
20747     {&hf_ieee80211_tag_nextpcp_token,
20748       {"NextPCP List Token", "wlan.next_pcp.token",
20749        FT_UINT8, BASE_DEC, NULL, 0,
20750        NULL, HFILL }},
20751
20752     {&hf_ieee80211_tag_reamaining_BI,
20753       {"Remaining BI's", "wlan.pcp_handover.remaining_BIs",
20754        FT_UINT8, BASE_DEC, NULL, 0,
20755        NULL, HFILL }},
20756
20757     {&hf_ieee80211_tag_request_token,
20758       {"Request Token", "wlan.request_token",
20759        FT_UINT16, BASE_DEC, NULL, 0,
20760        NULL, HFILL }},
20761
20762     {&hf_ieee80211_tag_bi_start_time,
20763       {"BI Start Time", "wlan.bi_start_time",
20764        FT_UINT32, BASE_DEC, NULL, 0,
20765        NULL, HFILL }},
20766
20767     {&hf_ieee80211_tag_sleep_cycle,
20768       {"Sleep Cycle", "wlan.sleep_cycle",
20769        FT_UINT16, BASE_DEC, NULL, 0,
20770        NULL, HFILL }},
20771
20772     {&hf_ieee80211_tag_num_awake_bis,
20773       {"Number of Awake/Doze BIs", "wlan.num_awake_bis",
20774        FT_UINT16, BASE_DEC, NULL, 0,
20775        NULL, HFILL }},
20776
20777     {&hf_ieee80211_ff_dmg_action_code,
20778      {"DMG Action", "wlan.fixed.dmg_act",
20779       FT_UINT8, BASE_HEX, VALS(ff_dmg_action_flags), 0,
20780       "Action Code", HFILL }},
20781
20782     {&hf_ieee80211_ff_unprotected_dmg_action_code,
20783      {"Unprotected DMG Action", "wlan.fixed.unprotected_dmg_act",
20784       FT_UINT8, BASE_HEX, VALS(ff_unprotected_dmg_action_flags), 0,
20785       "Action Code", HFILL }},
20786
20787     {&hf_ieee80211_ff_dmg_pwr_mgmt,
20788       {"DMG Power Management", "wlan.dmg.pwr_mgmt",
20789        FT_BOOLEAN, 8, NULL, 0x01,
20790        NULL, HFILL }},
20791
20792     {&hf_ieee80211_ff_subject_address,
20793       {"Subject Address", "wlan.dmg.subject_addr",
20794        FT_ETHER, BASE_NONE, NULL, 0,
20795        "MAC address of requested STA", HFILL }},
20796
20797     {&hf_ieee80211_ff_handover_reason,
20798       {"Handover Reason", "wlan.dmg.handover_reason",
20799        FT_UINT8, BASE_DEC, NULL, 0x03,
20800        NULL, HFILL }},
20801
20802     {&hf_ieee80211_ff_handover_remaining_bi,
20803       {"Handover Remaining BI", "wlan.dmg.handover_remaining_bi",
20804        FT_UINT8, BASE_DEC, NULL, 0x01,
20805        NULL, HFILL }},
20806
20807     {&hf_ieee80211_ff_handover_result,
20808       {"Handover Result", "wlan.dmg.handover_result",
20809        FT_UINT8, BASE_DEC, NULL, 0x01,
20810        NULL, HFILL }},
20811
20812     {&hf_ieee80211_ff_handover_reject_reason,
20813       {"Handover Reject Reason", "wlan.dmg.handover_reject_reason",
20814        FT_UINT8, BASE_DEC, NULL, 0x03,
20815        NULL, HFILL }},
20816
20817     {&hf_ieee80211_ff_destination_reds_aid,
20818       {"Destination REDS AID", "wlan.dmg.destination_reds_aid",
20819        FT_UINT16, BASE_DEC, NULL, 0,
20820        NULL, HFILL }},
20821
20822     {&hf_ieee80211_ff_destination_aid,
20823       {"Destination AID", "wlan.dmg.destination_aid",
20824        FT_UINT16, BASE_DEC, NULL, 0,
20825        NULL, HFILL }},
20826
20827     {&hf_ieee80211_ff_realy_aid,
20828       {"Relay AID", "wlan.dmg.realy_aid",
20829        FT_UINT16, BASE_DEC, NULL, 0,
20830        NULL, HFILL }},
20831
20832     {&hf_ieee80211_ff_source_aid,
20833       {"Source AID", "wlan.dmg.source_aid",
20834        FT_UINT16, BASE_DEC, NULL, 0,
20835        NULL, HFILL }},
20836
20837     {&hf_ieee80211_ff_timing_offset,
20838       {"Timing Offset", "wlan.dmg.timing_offset",
20839        FT_UINT16, BASE_DEC, NULL, 0,
20840        NULL, HFILL }},
20841
20842     {&hf_ieee80211_ff_sampling_frequency_offset,
20843       {"Sampling Frequency Offset", "wlan.dmg.sampling_frequency_offset",
20844        FT_UINT16, BASE_DEC, NULL, 0,
20845        NULL, HFILL }},
20846
20847     {&hf_ieee80211_ff_relay_operation_type,
20848       {"Relay Operation Type", "wlan.dmg.relay_operation_type",
20849        FT_UINT8, BASE_DEC, NULL, 0x03,
20850        NULL, HFILL }},
20851
20852     {&hf_ieee80211_ff_peer_sta_aid,
20853       {"Peer STA AID", "wlan.dmg.peer_sta_aid",
20854        FT_UINT8, BASE_DEC, NULL, 0,
20855        NULL, HFILL }},
20856
20857     {&hf_ieee80211_ff_snr,
20858       {"SNR", "wlan.dmg.snr",
20859        FT_UINT8, BASE_DEC, NULL, 0,
20860        NULL, HFILL }},
20861
20862     {&hf_ieee80211_ff_internal_angle,
20863       {"Internal Angle", "wlan.dmg.internal_angle",
20864        FT_UINT8, BASE_DEC, NULL, 0xfe,
20865        NULL, HFILL }},
20866
20867     {&hf_ieee80211_ff_recommend,
20868       {"Recommend", "wlan.dmg.recommend",
20869        FT_UINT8, BASE_DEC, NULL, 0x01,
20870        NULL, HFILL }},
20871
20872     {&hf_ieee80211_ff_fst_action_code,
20873       {"FST Action Code", "wlan.fst.action_code",
20874        FT_UINT8, BASE_HEX, VALS(ff_fst_action_flags), 0,
20875        "Action Code", HFILL }},
20876
20877     {&hf_ieee80211_ff_llt,
20878       {"Link Loss Timeout", "wlan.fst.llt",
20879        FT_UINT32, BASE_DEC, NULL, 0,
20880        NULL, HFILL }},
20881
20882     {&hf_ieee80211_ff_fsts_id,
20883       {"FSTS ID", "wlan.session_trans.fsts_id",
20884        FT_UINT32, BASE_DEC, NULL, 0,
20885        NULL, HFILL }},
20886
20887     {&hf_ieee80211_ff_mmpdu_len,
20888       {"MMPDU Length", "wlan.fst.mmpdu_length",
20889        FT_UINT16, BASE_DEC, NULL, 0,
20890        NULL, HFILL }},
20891
20892     {&hf_ieee80211_ff_mmpdu_ctrl,
20893       {"MMPDU Control", "wlan.fst.mmpdu_ctrl",
20894        FT_UINT16, BASE_HEX, NULL, 0,
20895        NULL, HFILL }},
20896
20897     {&hf_ieee80211_ff_oct_mmpdu,
20898       {"OCT MMPDU", "wlan.fst.oct_mmpdu",
20899        FT_BYTES, BASE_NONE, NULL, 0,
20900        NULL, HFILL }},
20901
20902     {&hf_ieee80211_ff_vht_mimo_cntrl,
20903      {"VHT MIMO Control", "wlan.vht.mimo_control.control",
20904       FT_UINT24, BASE_HEX, NULL, 0x0,
20905       NULL, HFILL }},
20906
20907     {&hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
20908      {"Nc Index", "wlan.vht.mimo_control.ncindex",
20909       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nc_index_vals), 0x000007,
20910       "Number of Columns Less One", HFILL }},
20911
20912     {&hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
20913      {"Nr Index", "wlan.vht.mimo_control.nrindex",
20914       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nr_index_vals), 0x000038,
20915       "Number of Rows Less One", HFILL }},
20916
20917     {&hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
20918      {"Channel Width", "wlan.vht.mimo_control.chanwidth",
20919       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_channel_width_vals), 0x0000C0,
20920       NULL, HFILL }},
20921
20922     {&hf_ieee80211_ff_vht_mimo_cntrl_grouping,
20923      {"Grouping (Ng)", "wlan.vht.mimo_control.grouping",
20924       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_grouping_vals), 0x000300,
20925       NULL, HFILL }},
20926
20927     {&hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
20928      {"Codebook Information", "wlan.vht.mimo_control.codebookinfo",
20929       FT_UINT24, BASE_HEX, NULL, 0x000400,
20930       NULL, HFILL }},
20931
20932     {&hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
20933      {"Feedback Type", "wlan.vht.mimo_control.feedbacktype",
20934       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_feedback_vals), 0x000800,
20935       NULL, HFILL }},
20936
20937     {&hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
20938      {"Remaining Feedback Segments", "wlan.vht.mimo_control.remainingfeedbackseg",
20939       FT_UINT24, BASE_HEX, NULL, 0x007000,
20940       NULL, HFILL }},
20941
20942     {&hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
20943      {"First Feedback Segments", "wlan.vht.mimo_control.firstfeedbackseg",
20944       FT_UINT24, BASE_HEX, NULL, 0x008000,
20945       NULL, HFILL }},
20946
20947     {&hf_ieee80211_ff_vht_mimo_cntrl_reserved,
20948      {"Reserved", "wlan.vht.mimo_control.reserved",
20949       FT_UINT24, BASE_HEX, NULL, 0x030000,
20950       NULL, HFILL }},
20951
20952     {&hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
20953      {"Sounding Dialog Toker Number", "wlan.vht.mimo_control.soundingdialogtocketnbr",
20954       FT_UINT24, BASE_HEX, NULL, 0xFC0000,
20955       NULL, HFILL }},
20956
20957     {&hf_ieee80211_ff_vht_action,
20958       {"VHT Action", "wlan.vht.action",
20959        FT_UINT8, BASE_DEC, VALS(vht_action_vals), 0,
20960        NULL, HFILL }},
20961
20962     {&hf_ieee80211_vht_compressed_beamforming_report,
20963       {"VHT Compressed Beamforming Report", "wlan.vht.compressed_beamforming_report",
20964        FT_BYTES, BASE_NONE, NULL, 0,
20965        NULL, HFILL }},
20966
20967     {&hf_ieee80211_vht_compressed_beamforming_report_snr,
20968       {"Signal to Noise Ratio (SNR)", "wlan.vht.compressed_beamforming_report.snr",
20969        FT_UINT8, BASE_HEX, NULL, 0,
20970        NULL, HFILL }},
20971
20972     {&hf_ieee80211_vht_compressed_beamforming_feedback_matrix,
20973       {"Compressed Beamforming Feedback Matrix", "wlan.vht.compressed_beamforming_report.feedback_matrix",
20974        FT_NONE, BASE_NONE, NULL, 0,
20975        NULL, HFILL }},
20976
20977     {&hf_ieee80211_vht_group_id_management,
20978       {"Group ID Management", "wlan.vht.group_id_management",
20979        FT_BYTES, BASE_NONE, NULL, 0,
20980        NULL, HFILL }},
20981
20982     {&hf_ieee80211_vht_membership_status_array,
20983       {"Membership Status Array", "wlan.vht.membership_status_array",
20984        FT_BYTES, BASE_NONE, NULL, 0,
20985        NULL, HFILL }},
20986
20987       {&hf_ieee80211_vht_user_position_array,
20988         {"User Position Array", "wlan.vht.user_position_array",
20989          FT_BYTES, BASE_NONE, NULL, 0,
20990          NULL, HFILL }},
20991
20992       {&hf_ieee80211_vht_membership_status_field,
20993         {"Membership Status Field", "wlan.vht.membership_status_array.field",
20994          FT_UINT8, BASE_DEC, NULL, 0,
20995          NULL, HFILL }},
20996
20997       {&hf_ieee80211_vht_user_position_field,
20998         {"User Position Field", "wlan.vht.user_position_array.field",
20999          FT_UINT8, BASE_DEC, NULL, 0,
21000          NULL, HFILL }},
21001
21002     {&hf_ieee80211_vht_operation_mode_notification,
21003       {"Operation Mode Notification", "wlan.vht.operation_mode_notification",
21004        FT_BYTES, BASE_NONE, NULL, 0,
21005        NULL, HFILL }},
21006
21007     {&hf_ieee80211_tag_tspec_allocation_id,
21008       {"Allocation ID", "wlan.dmg_tspec.allocation_id",
21009        FT_UINT24, BASE_DEC, NULL, 0x00000f,
21010        NULL, HFILL }},
21011
21012     {&hf_ieee80211_tag_tspec_allocation_type,
21013       {"Allocation Type", "wlan.dmg_tspec.allocation_type",
21014        FT_UINT24, BASE_DEC, NULL, 0x000070,
21015        NULL, HFILL }},
21016
21017     {&hf_ieee80211_tag_tspec_allocation_format,
21018       {"Allocation Format", "wlan.dmg_tspec.allocation_format",
21019        FT_BOOLEAN, 24, NULL, 0x000080,
21020        NULL, HFILL }},
21021
21022     {&hf_ieee80211_tag_tspec_pseudo_static,
21023       {"Pseudo Static", "wlan.dmg_tspec.pseudo_static",
21024        FT_BOOLEAN, 24, NULL, 0x000100,
21025        NULL, HFILL }},
21026
21027     {&hf_ieee80211_tag_tspec_truncatable,
21028       {"Truncatable", "wlan.dmg_tspec.truncatable",
21029        FT_BOOLEAN, 24, NULL, 0x000200,
21030        NULL, HFILL }},
21031
21032     {&hf_ieee80211_tag_tspec_extendable,
21033       {"Extendable", "wlan.dmg_tspec.extendable",
21034        FT_BOOLEAN, 24, NULL, 0x000400,
21035        NULL, HFILL }},
21036
21037     {&hf_ieee80211_tag_tspec_lp_sc_used,
21038       {"LP SC Usec", "wlan.dmg_tspec.lp_sc_used",
21039        FT_BOOLEAN, 24, NULL, 0x000800,
21040        NULL, HFILL }},
21041
21042     {&hf_ieee80211_tag_tspec_up,
21043       {"UP", "wlan.dmg_tspec.up",
21044        FT_UINT24, BASE_HEX, NULL, 0x007000,
21045        NULL, HFILL }},
21046
21047     {&hf_ieee80211_tag_tspec_dest_aid,
21048       {"Destination AID", "wlan.dmg_tspec.dest_aid",
21049        FT_UINT24, BASE_HEX, NULL, 0x7f8000,
21050        NULL, HFILL }},
21051
21052     {&hf_ieee80211_tag_tspec_allocation_period,
21053       {"Allocation Period", "wlan.dmg_tspec.allocation_period",
21054        FT_UINT16, BASE_DEC, NULL, 0,
21055        NULL, HFILL }},
21056
21057     {&hf_ieee80211_tag_tspec_min_allocation,
21058       {"Minimal Allocation", "wlan.dmg_tspec.min_allocation",
21059        FT_UINT16, BASE_DEC, NULL, 0,
21060        NULL, HFILL }},
21061
21062     {&hf_ieee80211_tag_tspec_max_allocation,
21063       {"Maximal Allocation", "wlan.dmg_tspec.max_allocation",
21064        FT_UINT16, BASE_DEC, NULL, 0,
21065        NULL, HFILL }},
21066
21067     {&hf_ieee80211_tag_tspec_min_duration,
21068       {"Minimal Duration", "wlan.dmg_tspec.min_duration",
21069        FT_UINT16, BASE_DEC, NULL, 0,
21070        NULL, HFILL }},
21071
21072     {&hf_ieee80211_tag_tspec_num_of_constraints,
21073       {"Number Of Constraints", "wlan.dmg_tspec.num_of_constraints",
21074        FT_UINT8, BASE_DEC, NULL, 0,
21075        NULL, HFILL }},
21076
21077     {&hf_ieee80211_tag_tspec_tsconst_start_time,
21078       {"TS Constraint Start Time", "wlan.dmg_tspec.tsconst.start_time",
21079        FT_UINT32, BASE_DEC, NULL, 0,
21080        NULL, HFILL }},
21081
21082     {&hf_ieee80211_tag_tspec_tsconst_duration,
21083       {"TS Constraint Duration", "wlan.dmg_tspec.tsconst.duration",
21084        FT_UINT16, BASE_DEC, NULL, 0,
21085        NULL, HFILL }},
21086
21087     {&hf_ieee80211_tag_tspec_tsconst_period,
21088       {"TS Constraint Period", "wlan.dmg_tspec.tsconst.period",
21089        FT_UINT16, BASE_DEC, NULL, 0,
21090        NULL, HFILL }},
21091
21092     {&hf_ieee80211_tag_tspec_tsconst_interferer_mac,
21093       {"TS Constraint Interferer MAC Address", "wlan.dmg_tspec.tsconst.interferer_mac",
21094        FT_ETHER, BASE_NONE, NULL, 0,
21095        NULL, HFILL }},
21096
21097     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_I,
21098       {"Channel Measurement Feedback Relative I", "wlan.ch_meas_fb.realtive_I",
21099        FT_UINT8, BASE_DEC, NULL, 0,
21100        NULL, HFILL }},
21101
21102     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_Q,
21103       {"Channel Measurement Feedback Relative Q", "wlan.ch_meas_fb.realtive_Q",
21104        FT_UINT8, BASE_DEC, NULL, 0,
21105        NULL, HFILL }},
21106
21107     {&hf_ieee80211_tag_channel_measurement_feedback_tap_delay,
21108       {"Channel Measurement Feedback Tap Delay", "wlan.ch_meas_fb.tap_delay",
21109        FT_UINT8, BASE_DEC, NULL, 0,
21110        NULL, HFILL }},
21111
21112     {&hf_ieee80211_tag_channel_measurement_feedback_sector_id,
21113       {"Channel Measurement Feedback Secotr ID", "wlan.ch_meas_fb.sector_id",
21114        FT_UINT8, BASE_DEC, NULL, 0xfc,
21115        NULL, HFILL }},
21116
21117     {&hf_ieee80211_tag_channel_measurement_feedback_antenna_id,
21118       {"Channel Measurement Feedback Antenna ID", "wlan.ch_meas_fb.antenna_id",
21119        FT_UINT8, BASE_DEC, NULL, 0x03,
21120        NULL, HFILL }},
21121
21122     {&hf_ieee80211_tag_awake_window,
21123       {"Awake Window", "wlan.awake_window",
21124        FT_UINT16, BASE_DEC, NULL, 0,
21125        NULL, HFILL }},
21126
21127     {&hf_ieee80211_tag_addba_ext_no_frag,
21128       {"ADDBA No Fragmentation", "wlan.addba.no_frag",
21129        FT_BOOLEAN, 8, NULL, 0x80,
21130        NULL, HFILL }},
21131
21132     {&hf_ieee80211_tag_multi_band_ctrl_sta_role,
21133       {"STA Rold", "wlan.multi_band.ctrl_sta_role",
21134        FT_UINT8, BASE_DEC, NULL, 0xe0,
21135        NULL, HFILL }},
21136
21137     {&hf_ieee80211_tag_multi_band_ctrl_addr_present,
21138       {"STA MAC Address Present", "wlan.multi_band.ctrl_addr_present",
21139        FT_BOOLEAN, 8, NULL, 0x10,
21140        NULL, HFILL }},
21141
21142     {&hf_ieee80211_tag_multi_band_ctrl_cipher_present,
21143       {"PCS Present", "wlan.multi_band.ctrl_cipher_present",
21144        FT_BOOLEAN, 8, NULL, 0x08,
21145        NULL, HFILL }},
21146
21147     {&hf_ieee80211_tag_multi_band_oper_class,
21148       {"Operating Class", "wlan.multi_band.oper_class",
21149        FT_UINT8, BASE_DEC, NULL, 0,
21150        NULL, HFILL }},
21151
21152     {&hf_ieee80211_tag_multi_band_channel_number,
21153       {"Channel Number", "wlan.multi_band.channel_number",
21154        FT_UINT8, BASE_DEC, NULL, 0,
21155        NULL, HFILL }},
21156
21157     {&hf_ieee80211_tag_multi_band_tsf_offset,
21158       {"TSF Offset", "wlan.multi_band.tsf_offset",
21159        FT_UINT64, BASE_DEC, NULL, 0,
21160        NULL, HFILL }},
21161
21162     {&hf_ieee80211_tag_multi_band_conn_ap,
21163       {"Connection Capability AP", "wlan.multi_band.conn_ap",
21164        FT_BOOLEAN, 8, NULL, 0x80,
21165        NULL, HFILL }},
21166
21167     {&hf_ieee80211_tag_multi_band_conn_pcp,
21168       {"Connection Capability PCP", "wlan.multi_band.conn_pcp",
21169        FT_BOOLEAN, 8, NULL, 0x40,
21170        NULL, HFILL }},
21171
21172     {&hf_ieee80211_tag_multi_band_conn_dls,
21173       {"Connection Capability DLS", "wlan.multi_band.conn_dls",
21174        FT_BOOLEAN, 8, NULL, 0x20,
21175        NULL, HFILL }},
21176
21177     {&hf_ieee80211_tag_multi_band_conn_tdls,
21178       {"Connection Capability TDLS", "wlan.multi_band.conn_tdls",
21179        FT_BOOLEAN, 8, NULL, 0x10,
21180        NULL, HFILL }},
21181
21182     {&hf_ieee80211_tag_multi_band_conn_ibss,
21183       {"Connection Capability IBSS", "wlan.multi_band.conn_ibss",
21184        FT_BOOLEAN, 8, NULL, 0x08,
21185        NULL, HFILL }},
21186
21187     {&hf_ieee80211_tag_multi_band_fst_timeout,
21188       {"FST Session Timeout", "wlan.multi_band.fst_timeout",
21189        FT_UINT8, BASE_DEC, NULL, 0,
21190        NULL, HFILL }},
21191
21192     {&hf_ieee80211_tag_multi_band_sta_mac,
21193       {"Transmitting STA MAC Address", "wlan.multi_band.sta_mac",
21194        FT_ETHER, BASE_NONE, NULL, 0,
21195        NULL, HFILL }},
21196
21197     {&hf_ieee80211_tag_activity,
21198       {"Activity", "wlan.activity",
21199        FT_UINT8, BASE_DEC, NULL, 0,
21200        NULL, HFILL }},
21201
21202     {&hf_ieee80211_tag_dmg_link_adapt_mcs,
21203       {"MCS", "wlan.dmg_link_adapt.mcs",
21204        FT_UINT8, BASE_DEC, NULL, 0,
21205        NULL, HFILL }},
21206
21207     {&hf_ieee80211_tag_dmg_link_adapt_link_margin,
21208       {"Link Margin", "wlan.dmg_link_adapt.link_margin",
21209        FT_UINT8, BASE_DEC, NULL, 0,
21210        NULL, HFILL }},
21211
21212     {&hf_ieee80211_tag_ref_timestamp,
21213       {"Reference Timestamp", "wlan.ref_timestamp",
21214        FT_UINT32, BASE_DEC, NULL, 0,
21215        NULL, HFILL }},
21216
21217     {&hf_ieee80211_tag_switching_stream_non_qos,
21218       {"Non-Qos Data Frames", "wlan.switching_stream.non_qos",
21219        FT_BOOLEAN, 8, NULL, 0,
21220        NULL, HFILL }},
21221
21222     {&hf_ieee80211_tag_switching_stream_param_num,
21223       {"Number Of Switching Stream Elements", "wlan.switching_stream.param_num",
21224        FT_UINT8, BASE_DEC, NULL, 0,
21225        NULL, HFILL }},
21226
21227     {&hf_ieee80211_tag_switching_stream_old_tid,
21228       {"Old Band TID", "wlan.switching_stream.old_tid",
21229        FT_UINT16, BASE_DEC, NULL, 0xf000,
21230        NULL, HFILL }},
21231
21232     {&hf_ieee80211_tag_switching_stream_old_direction,
21233       {"Old Band Direction", "wlan.switching_stream.old_direction",
21234        FT_BOOLEAN, 16, NULL, 0x0800,
21235        NULL, HFILL }},
21236
21237     {&hf_ieee80211_tag_switching_stream_new_tid,
21238       {"New Band TID", "wlan.switching_stream.new_tid",
21239        FT_UINT16, BASE_DEC, NULL, 0x0780,
21240        NULL, HFILL }},
21241
21242     {&hf_ieee80211_tag_switching_stream_new_direction,
21243       {"New Band Direction", "wlan.switching_stream.new_direction",
21244        FT_BOOLEAN, 16, NULL, 0x0040,
21245        NULL, HFILL }},
21246
21247     {&hf_ieee80211_tag_switching_stream_new_valid_id,
21248       {"Stream ID in New Band Valid", "wlan.switching_stream.new_valid_id",
21249        FT_BOOLEAN, 16, NULL, 0x0020,
21250        NULL, HFILL }},
21251
21252     {&hf_ieee80211_tag_switching_stream_llt_type,
21253       {"LLT Type", "wlan.switching_stream.llt_type",
21254        FT_BOOLEAN, 16, NULL, 0x0010,
21255        NULL, HFILL }},
21256
21257     {&hf_ieee80211_ff_timestamp,
21258      {"Timestamp", "wlan.fixed.timestamp",
21259       FT_UINT64, BASE_HEX, NULL, 0,
21260       NULL, HFILL }},
21261
21262     {&hf_ieee80211_ff_auth_alg,
21263      {"Authentication Algorithm", "wlan.fixed.auth.alg",
21264       FT_UINT16, BASE_DEC, VALS(auth_alg), 0,
21265       NULL, HFILL }},
21266
21267     {&hf_ieee80211_ff_beacon_interval,
21268      {"Beacon Interval", "wlan.fixed.beacon",
21269       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
21270       NULL, HFILL }},
21271
21272     {&hf_ieee80211_fixed_parameters,
21273      {"Fixed parameters", "wlan.fixed.all",
21274       FT_NONE, BASE_NONE, NULL, 0,
21275       NULL, HFILL }},
21276
21277     {&hf_ieee80211_tagged_parameters,
21278      {"Tagged parameters", "wlan.tagged.all",
21279       FT_NONE, BASE_NONE, NULL, 0,
21280       NULL, HFILL }},
21281
21282     {&hf_ieee80211_tag_ssid,
21283      {"SSID", "wlan.ssid",
21284       FT_STRING, BASE_NONE, NULL, 0,
21285       "Indicates the identity of an ESS or IBSS", HFILL }},
21286
21287     {&hf_ieee80211_tag_supp_rates,
21288      {"Supported Rates", "wlan.supported_rates",
21289       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
21290       "In Mbit/sec, (B) for Basic Rates", HFILL }},
21291
21292     {&hf_ieee80211_tag_fh_dwell_time,
21293      {"Dwell Time", "wlan.fh.dwell_time",
21294       FT_UINT16, BASE_HEX, NULL, 0x0,
21295       "In Time Unit (TU)", HFILL }},
21296
21297     {&hf_ieee80211_tag_fh_hop_set,
21298      {"Hop Set", "wlan.fh.hop_set",
21299       FT_UINT8, BASE_DEC, NULL, 0x0,
21300       NULL, HFILL }},
21301
21302     {&hf_ieee80211_tag_fh_hop_pattern,
21303      {"Hop Pattern", "wlan.fh.hop_pattern",
21304       FT_UINT8, BASE_DEC, NULL, 0x0,
21305       NULL, HFILL }},
21306
21307     {&hf_ieee80211_tag_fh_hop_index,
21308      {"Hop Index", "wlan.fh.hop_index",
21309       FT_UINT8, BASE_DEC, NULL, 0x0,
21310       NULL, HFILL }},
21311
21312     {&hf_ieee80211_ff_block_ack_params,
21313      {"Block Ack Parameters", "wlan.fixed.baparams",
21314       FT_UINT16, BASE_HEX, NULL, 0,
21315       NULL, HFILL }},
21316
21317     {&hf_ieee80211_ff_block_ack_params_amsdu_permitted,
21318      {"A-MSDUs", "wlan.fixed.baparams.amsdu",
21319       FT_BOOLEAN, 16, TFS(&ff_block_ack_params_amsdu_permitted_flag), 0x0001,
21320       "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
21321
21322     {&hf_ieee80211_ff_block_ack_params_policy,
21323      {"Block Ack Policy", "wlan.fixed.baparams.policy",
21324       FT_BOOLEAN, 16, TFS(&ff_block_ack_params_policy_flag), 0x0002,
21325       NULL, HFILL }},
21326
21327     {&hf_ieee80211_ff_block_ack_params_tid,
21328      {"Traffic Identifier", "wlan.fixed.baparams.tid",
21329       FT_UINT16, BASE_HEX, NULL, 0x003C,
21330       NULL, HFILL }},
21331
21332     {&hf_ieee80211_ff_block_ack_params_buffer_size,
21333      {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan.fixed.baparams.buffersize",
21334       FT_UINT16, BASE_DEC, NULL, 0xFFC0,
21335       "Number of Buffers", HFILL }},
21336
21337     {&hf_ieee80211_ff_block_ack_timeout,
21338      {"Block Ack Timeout", "wlan.fixed.batimeout",
21339       FT_UINT16, BASE_HEX, NULL, 0,
21340       NULL, HFILL }},
21341
21342     {&hf_ieee80211_ff_block_ack_ssc,
21343      {"Block Ack Starting Sequence Control (SSC)", "wlan.fixed.ssc",
21344       FT_UINT16, BASE_HEX, 0, 0,
21345       NULL, HFILL }},
21346
21347     {&hf_ieee80211_ff_block_ack_ssc_fragment,
21348      {"Fragment", "wlan.fixed.ssc.fragment",
21349       FT_UINT16, BASE_DEC, 0, 0x000f,
21350       NULL, HFILL }},
21351
21352     {&hf_ieee80211_ff_block_ack_ssc_sequence,
21353      {"Starting Sequence Number", "wlan.fixed.ssc.sequence",
21354       FT_UINT16, BASE_DEC, 0, 0xfff0,
21355       NULL, HFILL }},
21356
21357     {&hf_ieee80211_ff_delba_param,
21358      {"Delete Block Ack (DELBA) Parameter Set", "wlan.fixed.delba.param",
21359       FT_UINT16, BASE_HEX, 0, 0,
21360       NULL, HFILL }},
21361
21362     {&hf_ieee80211_ff_delba_param_reserved,
21363      {"Reserved", "wlan.fixed.delba.param.reserved",
21364       FT_UINT16, BASE_HEX, 0, 0x07ff,
21365       NULL, HFILL }},
21366
21367     {&hf_ieee80211_ff_delba_param_init,
21368      {"Initiator", "wlan.fixed.delba.param.initiator",
21369       FT_BOOLEAN, 16, 0, 0x0800,
21370       NULL, HFILL }},
21371
21372     {&hf_ieee80211_ff_delba_param_tid,
21373      {"TID", "wlan.fixed.delba.param.tid",
21374       FT_UINT16, BASE_HEX, 0, 0xf000,
21375       "Traffic Identifier (TID)", HFILL }},
21376
21377     {&hf_ieee80211_ff_max_reg_pwr,
21378      {"Maximum Regulation Power", "wlan.fixed.maxregpwr",
21379       FT_UINT16, BASE_HEX, 0, 0,
21380       NULL, HFILL }},
21381
21382     {&hf_ieee80211_ff_measurement_pilot_int,
21383      {"Measurement Pilot Interval", "wlan.fixed.msmtpilotint",
21384       FT_UINT16, BASE_HEX, 0, 0,
21385       "Measurement Pilot Interval Fixed Field", HFILL }},
21386
21387     {&hf_ieee80211_ff_country_str,
21388      {"Country String", "wlan.fixed.country",
21389       FT_STRING, BASE_NONE, 0, 0,
21390       NULL, HFILL }},
21391
21392     {&hf_ieee80211_ff_max_tx_pwr,
21393      {"Maximum Transmit Power", "wlan.fixed.maxtxpwr",
21394       FT_UINT8, BASE_HEX, 0, 0,
21395       NULL, HFILL }},
21396
21397     {&hf_ieee80211_ff_tx_pwr_used,
21398      {"Transmit Power Used", "wlan.fixed.txpwr",
21399       FT_UINT8, BASE_HEX, 0, 0,
21400       NULL, HFILL }},
21401
21402     {&hf_ieee80211_ff_transceiver_noise_floor,
21403      {"Transceiver Noise Floor", "wlan.fixed.tnoisefloor",
21404       FT_UINT8, BASE_HEX, 0, 0,
21405       NULL, HFILL }},
21406
21407     {&hf_ieee80211_ff_channel_width,
21408      {"Supported Channel Width", "wlan.fixed.chanwidth",
21409       FT_UINT8, BASE_HEX, VALS(ff_channel_width_vals), 0,
21410       NULL, HFILL }},
21411
21412     {&hf_ieee80211_ff_qos_info_ap,
21413      {"QoS Information (AP)", "wlan.fixed.qosinfo.ap",
21414       FT_UINT8, BASE_HEX, NULL, 0,
21415       NULL, HFILL }},
21416
21417     {&hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
21418      {"EDCA Parameter Set Update Count", "wlan.fixed.qosinfo.ap.edcaupdate",
21419       FT_UINT8, BASE_HEX, NULL, 0x0F,
21420       "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
21421
21422     {&hf_ieee80211_ff_qos_info_ap_q_ack,
21423      {"Q-Ack", "wlan.fixed.qosinfo.ap.qack",
21424       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_q_ack_flag), 0x10,
21425       "QoS Ack", HFILL }},
21426
21427     {&hf_ieee80211_ff_qos_info_ap_queue_req,
21428      {"Queue Request", "wlan.fixed.qosinfo.ap.queue_req",
21429       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_queue_req_flag), 0x20,
21430       NULL, HFILL }},
21431
21432     {&hf_ieee80211_ff_qos_info_ap_txop_request,
21433      {"TXOP Request", "wlan.fixed.qosinfo.ap.txopreq",
21434       FT_BOOLEAN, 8, TFS(&ff_qos_info_ap_txop_request_flag), 0x40,
21435       "Transmit Opportunity (TXOP) Request", HFILL }},
21436
21437     {&hf_ieee80211_ff_qos_info_ap_reserved,
21438      {"Reserved", "wlan.fixed.qosinfo.ap.reserved",
21439       FT_BOOLEAN, 8, NULL, 0x80,
21440       NULL, HFILL }},
21441
21442     {&hf_ieee80211_ff_qos_info_sta,
21443      {"QoS Information (STA)", "wlan.fixed.qosinfo.sta",
21444       FT_UINT8, BASE_HEX, NULL, 0,
21445       "TCLAS Processing", HFILL }},
21446
21447     {&hf_ieee80211_ff_qos_info_sta_ac_vo,
21448      {"AC_VO U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_vo",
21449       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x01,
21450       NULL, HFILL }},
21451
21452     {&hf_ieee80211_ff_qos_info_sta_ac_vi,
21453      {"AC_VI U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_vi",
21454       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x02,
21455       NULL, HFILL }},
21456
21457     {&hf_ieee80211_ff_qos_info_sta_ac_bk,
21458      {"AC_BK U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_bk",
21459       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x04,
21460       NULL, HFILL }},
21461
21462     {&hf_ieee80211_ff_qos_info_sta_ac_be,
21463      {"AC_BE U-APSD Flag", "wlan.fixed.qosinfo.sta.ac_be",
21464       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_ac_flag), 0x08,
21465       NULL, HFILL }},
21466
21467     {&hf_ieee80211_ff_qos_info_sta_q_ack,
21468      {"Q-Ack", "wlan.fixed.qosinfo.sta.qack",
21469       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_q_ack_flag), 0x10,
21470       "QoS Ack", HFILL }},
21471
21472     {&hf_ieee80211_ff_qos_info_sta_max_sp_length,
21473      {"Max SP Length", "wlan.fixed.qosinfo.sta.max_sp_length",
21474       FT_UINT8, BASE_HEX, VALS(ff_qos_info_sta_max_sp_len_flags) , 0x60,
21475       NULL, HFILL }},
21476
21477     {&hf_ieee80211_ff_qos_info_sta_more_data_ack,
21478      {"More Data Ack", "wlan.fixed.qosinfo.sta.more_data_ack",
21479       FT_BOOLEAN, 8, TFS(&ff_qos_info_sta_more_data_ack_flag), 0x80,
21480       NULL, HFILL }},
21481
21482     {&hf_ieee80211_ff_sm_pwr_save,
21483      {"Spatial Multiplexing (SM) Power Control", "wlan.fixed.sm.powercontrol",
21484       FT_UINT8, BASE_HEX, NULL, 0,
21485       NULL, HFILL }},
21486
21487     {&hf_ieee80211_ff_sm_pwr_save_enabled,
21488      {"SM Power Save", "wlan.fixed.sm.powercontrol.enabled",
21489       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
21490       "Spatial Multiplexing (SM) Power Save", HFILL }},
21491
21492     {&hf_ieee80211_ff_sm_pwr_save_sm_mode,
21493      {"SM Mode", "wlan.fixed.sm.powercontrol.mode",
21494       FT_BOOLEAN, 8, TFS(&ff_sm_pwr_save_sm_mode_flag), 0x02,
21495       "Spatial Multiplexing (SM) Mode", HFILL }},
21496
21497     {&hf_ieee80211_ff_sm_pwr_save_reserved,
21498      {"Reserved", "wlan.fixed.sm.powercontrol.reserved",
21499       FT_UINT8, BASE_HEX, NULL, 0xFC,
21500       NULL, HFILL }},
21501
21502     {&hf_ieee80211_ff_pco_phase_cntrl,
21503      {"Phased Coexistence Operation (PCO) Phase Control", "wlan.fixed.pco.phasecntrl",
21504       FT_BOOLEAN, BASE_NONE, TFS(&ff_pco_phase_cntrl_flag), 0x0,
21505       NULL, HFILL }},
21506
21507     {&hf_ieee80211_ff_psmp_param_set,
21508      {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan.fixed.psmp.paramset",
21509       FT_UINT16, BASE_HEX, 0, 0,
21510       NULL, HFILL }},
21511
21512     {&hf_ieee80211_ff_psmp_param_set_n_sta,
21513      {"Number of STA Info Fields Present", "wlan.fixed.psmp.paramset.nsta",
21514       FT_UINT16, BASE_HEX, 0, 0x000F,
21515       NULL, HFILL }},
21516
21517     {&hf_ieee80211_ff_psmp_param_set_more_psmp,
21518      {"More PSMP", "wlan.fixed.psmp.paramset.more",
21519       FT_BOOLEAN, 16, TFS(&ff_psmp_param_set_more_psmp_flag), 0x0010,
21520       "More Power Save Multi-Poll (PSMP)", HFILL }},
21521
21522     {&hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
21523      {"PSMP Sequence Duration [us]", "wlan.fixed.psmp.paramset.seqduration",
21524       FT_UINT16, BASE_DEC, 0, 0xFFE0,
21525       "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
21526
21527     {&hf_ieee80211_ff_mimo_cntrl,
21528      {"MIMO Control", "wlan.fixed.mimo.control",
21529       FT_BYTES, BASE_NONE, 0, 0x0,
21530       NULL, HFILL }},
21531
21532     {&hf_ieee80211_ff_mimo_cntrl_nc_index,
21533      {"Nc Index", "wlan.fixed.mimo.control.ncindex",
21534       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nc_index_flags), 0x0003,
21535       "Number of Columns Less One", HFILL }},
21536
21537     {&hf_ieee80211_ff_mimo_cntrl_nr_index,
21538      {"Nr Index", "wlan.fixed.mimo.control.nrindex",
21539       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nr_index_flags), 0x000C,
21540       "Number of Rows Less One", HFILL }},
21541
21542     {&hf_ieee80211_ff_mimo_cntrl_channel_width,
21543      {"Channel Width", "wlan.fixed.mimo.control.chanwidth",
21544       FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010,
21545       NULL, HFILL }},
21546
21547     {&hf_ieee80211_ff_mimo_cntrl_grouping,
21548      {"Grouping (Ng)", "wlan.fixed.mimo.control.grouping",
21549       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_grouping_flags), 0x0060,
21550       NULL, HFILL }},
21551
21552     {&hf_ieee80211_ff_mimo_cntrl_coefficient_size,
21553      {"Coefficient Size (Nb)", "wlan.fixed.mimo.control.cosize",
21554       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_coefficient_size_flags), 0x0180,
21555       NULL, HFILL }},
21556
21557     {&hf_ieee80211_ff_mimo_cntrl_codebook_info,
21558      {"Codebook Information", "wlan.fixed.mimo.control.codebookinfo",
21559       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_codebook_info_flags), 0x0600,
21560       NULL, HFILL }},
21561
21562     {&hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
21563      {"Remaining Matrix Segment", "wlan.fixed.mimo.control.matrixseg",
21564       FT_UINT16, BASE_HEX, 0, 0x3800,
21565       NULL, HFILL }},
21566
21567     {&hf_ieee80211_ff_mimo_cntrl_reserved,
21568      {"Reserved", "wlan.fixed.mimo.control.reserved",
21569       FT_UINT16, BASE_HEX, 0, 0xC000,
21570       NULL, HFILL }},
21571
21572     {&hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
21573      {"Sounding Timestamp", "wlan.fixed.mimo.control.soundingtime",
21574       FT_UINT32, BASE_HEX, 0, 0,
21575       NULL, HFILL }},
21576
21577     {&hf_ieee80211_ff_psmp_sta_info,
21578      {"Power Save Multi-Poll (PSMP) Station Information", "wlan.fixed.psmp.stainfo",
21579       FT_UINT64, BASE_HEX, 0, 0,
21580       NULL, HFILL }},
21581
21582     {&hf_ieee80211_ff_psmp_sta_info_type,
21583      {"Sta Info Type", "wlan.fixed.psmp.stainfo.type",
21584       FT_UINT32, BASE_HEX, VALS(ff_psmp_sta_info_flags), PSMP_STA_INFO_FLAG_TYPE,
21585       NULL, HFILL }},
21586
21587     {&hf_ieee80211_ff_psmp_sta_info_dtt_start_offset,
21588      {"DTT Start Offset", "wlan.fixed.psmp.stainfo.dttstart",
21589       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_START,
21590       NULL, HFILL }},
21591
21592     {&hf_ieee80211_ff_psmp_sta_info_dtt_duration,
21593      {"DTT Duration", "wlan.fixed.psmp.stainfo.dttduration",
21594       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_DURATION,
21595       NULL, HFILL }},
21596
21597     {&hf_ieee80211_ff_psmp_sta_info_sta_id,
21598      {"Target Station ID", "wlan.fixed.psmp.stainfo.staid",
21599       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_STA_ID,
21600       NULL, HFILL }},
21601
21602     {&hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
21603      {"UTT Start Offset", "wlan.fixed.psmp.stainfo.uttstart",
21604       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_START,
21605       NULL, HFILL }},
21606
21607     {&hf_ieee80211_ff_psmp_sta_info_utt_duration,
21608      {"UTT Duration", "wlan.fixed.psmp.stainfo.uttduration",
21609       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_DURATION,
21610       NULL, HFILL }},
21611
21612     {&hf_ieee80211_ff_psmp_sta_info_reserved_small,
21613      {"Reserved", "wlan.fixed.psmp.stainfo.reserved",
21614       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_IA_RESERVED,
21615       NULL, HFILL }},
21616
21617     {&hf_ieee80211_ff_psmp_sta_info_reserved_large,
21618      {"Reserved", "wlan.fixed.psmp.stainfo.reserved64",
21619       FT_UINT64, BASE_HEX, 0, 0,
21620       NULL, HFILL }},
21621
21622     {&hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
21623      {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan.fixed.psmp.stainfo.multicastid",
21624       FT_UINT64, BASE_HEX, 0, 0,
21625       NULL, HFILL }},
21626
21627     {&hf_ieee80211_ff_ant_selection,
21628      {"Antenna Selection", "wlan.fixed.antsel",
21629       FT_UINT8, BASE_HEX, 0, 0,
21630       NULL, HFILL }},
21631
21632     {&hf_ieee80211_ff_ant_selection_0,
21633      {"Antenna 0", "wlan.fixed.antsel.ant0",
21634       FT_UINT8, BASE_HEX, 0, 0x01,
21635       NULL, HFILL }},
21636
21637     {&hf_ieee80211_ff_ant_selection_1,
21638      {"Antenna 1", "wlan.fixed.antsel.ant1",
21639       FT_UINT8, BASE_HEX, 0, 0x02,
21640       NULL, HFILL }},
21641
21642     {&hf_ieee80211_ff_ant_selection_2,
21643      {"Antenna 2", "wlan.fixed.antsel.ant2",
21644       FT_UINT8, BASE_HEX, 0, 0x04,
21645       NULL, HFILL }},
21646
21647     {&hf_ieee80211_ff_ant_selection_3,
21648      {"Antenna 3", "wlan.fixed.antsel.ant3",
21649       FT_UINT8, BASE_HEX, 0, 0x08,
21650       NULL, HFILL }},
21651
21652     {&hf_ieee80211_ff_ant_selection_4,
21653      {"Antenna 4", "wlan.fixed.antsel.ant4",
21654       FT_UINT8, BASE_HEX, 0, 0x10,
21655       NULL, HFILL }},
21656
21657     {&hf_ieee80211_ff_ant_selection_5,
21658      {"Antenna 5", "wlan.fixed.antsel.ant5",
21659       FT_UINT8, BASE_HEX, 0, 0x20,
21660       NULL, HFILL }},
21661
21662     {&hf_ieee80211_ff_ant_selection_6,
21663      {"Antenna 6", "wlan.fixed.antsel.ant6",
21664       FT_UINT8, BASE_HEX, 0, 0x40,
21665       NULL, HFILL }},
21666
21667     {&hf_ieee80211_ff_ant_selection_7,
21668      {"Antenna 7", "wlan.fixed.antsel.ant7",
21669       FT_UINT8, BASE_HEX, 0, 0x80,
21670       NULL, HFILL }},
21671
21672     {&hf_ieee80211_ff_ext_channel_switch_announcement,
21673      {"Extended Channel Switch Announcement", "wlan.fixed.extchansw",
21674       FT_UINT32, BASE_HEX, 0, 0,
21675       NULL, HFILL }},
21676
21677     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
21678      {"Channel Switch Mode", "wlan.fixed.extchansw.switchmode",
21679       FT_UINT32, BASE_HEX, VALS(ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags), 0x000000FF,
21680       NULL, HFILL }},
21681
21682     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
21683      {"New Operating Class", "wlan.fixed.extchansw.new.opeclass",
21684       FT_UINT32, BASE_HEX, NULL, 0x0000FF00,
21685       NULL, HFILL }},
21686
21687     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
21688      {"New Channel Number", "wlan.fixed.extchansw.new.channumber",
21689       FT_UINT32, BASE_HEX, NULL, 0x00FF0000,
21690       NULL, HFILL }},
21691
21692     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
21693      {"Channel Switch Count", "wlan.extchanswitch.switchcount",
21694       FT_UINT32, BASE_HEX, NULL, 0xFF000000,
21695       NULL, HFILL }},
21696
21697     {&hf_ieee80211_ff_ht_info,
21698      {"HT Information", "wlan.fixed.extchansw",
21699       FT_UINT8, BASE_HEX, 0, 0,
21700       "HT Information Fixed Field", HFILL }},
21701
21702     {&hf_ieee80211_ff_ht_info_information_request,
21703      {"Information Request", "wlan.fixed.mimo.control.chanwidth",
21704       FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01,
21705       NULL, HFILL }},
21706
21707     {&hf_ieee80211_ff_ht_info_40_mhz_intolerant,
21708      {"40 MHz Intolerant", "wlan.fixed.mimo.control.chanwidth",
21709       FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02,
21710       NULL, HFILL }},
21711
21712     {&hf_ieee80211_ff_ht_info_sta_chan_width,
21713      {"Station Channel Width", "wlan.fixed.mimo.control.chanwidth",
21714       FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04,
21715       NULL, HFILL }},
21716
21717     {&hf_ieee80211_ff_ht_info_reserved,
21718      {"Reserved", "wlan.fixed.extchansw",
21719       FT_UINT8, BASE_HEX, 0, 0xF8,
21720       "Reserved Field", HFILL }},
21721
21722     {&hf_ieee80211_ff_ht_action,
21723      {"HT Action", "wlan.fixed.htact",
21724       FT_UINT8, BASE_HEX, VALS(ff_ht_action_flags), 0,
21725       "HT Action Code", HFILL }},
21726
21727     {&hf_ieee80211_ff_mimo_csi_snr,
21728      {"Signal to Noise Ratio (SNR)", "wlan.mimo.csimatrices.snr",
21729       FT_UINT8, BASE_HEX, NULL, 0,
21730       NULL, HFILL }},
21731
21732     {&hf_ieee80211_ff_mimo_csi_matrices,
21733      {"CSI Matrices", "wlan.mimo.csimatrices",
21734       FT_NONE, BASE_NONE, NULL, 0,
21735       NULL, HFILL }},
21736
21737     {&hf_ieee80211_ff_mimo_csi_bf_matrices,
21738      {"Beamforming Feedback Matrices", "wlan.mimo.csimatrices.bf",
21739       FT_NONE, BASE_NONE, NULL, 0,
21740       NULL, HFILL }},
21741
21742     {&hf_ieee80211_ff_mimo_csi_cbf_matrices,
21743      {"Compressed Beamforming Feedback Matrices", "wlan.mimo.csimatrices.cbf",
21744       FT_NONE, BASE_NONE, NULL, 0,
21745       NULL, HFILL }},
21746     {&hf_ieee80211_ff_public_action,
21747      {"Public Action", "wlan.fixed.publicact",
21748       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_pa_action_codes_ext, 0,
21749       "Public Action Code", HFILL }},
21750
21751     {&hf_ieee80211_ff_protected_public_action,
21752      {"Protected Public Action", "wlan.fixed.publicact",
21753       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_ppa_action_codes_ext, 0,
21754       "Protected Public Action Code", HFILL }},
21755
21756     {&hf_ieee80211_ff_capture,
21757      {"Capabilities Information", "wlan.fixed.capabilities",
21758       FT_UINT16, BASE_HEX, NULL, 0,
21759       "Capability information", HFILL }},
21760
21761     {&hf_ieee80211_ff_cf_ess,
21762      {"ESS capabilities", "wlan.fixed.capabilities.ess",
21763       FT_BOOLEAN, 16, TFS(&cf_ess_flags), 0x0001,
21764       NULL, HFILL }},
21765
21766     {&hf_ieee80211_ff_cf_ibss,
21767      {"IBSS status", "wlan.fixed.capabilities.ibss",
21768       FT_BOOLEAN, 16, TFS(&cf_ibss_flags), 0x0002,
21769       "IBSS participation", HFILL }},
21770
21771     {&hf_ieee80211_ff_cf_sta_poll,
21772      {"CFP participation capabilities", "wlan.fixed.capabilities.cfpoll.sta",
21773       FT_UINT16, BASE_HEX, VALS(sta_cf_pollable), 0x020C,
21774       "CF-Poll capabilities for a STA", HFILL }},
21775
21776     {&hf_ieee80211_ff_cf_ap_poll,
21777      {"CFP participation capabilities", "wlan.fixed.capabilities.cfpoll.ap",
21778       FT_UINT16, BASE_HEX, VALS(ap_cf_pollable), 0x020C,
21779       "CF-Poll capabilities for an AP", HFILL }},
21780
21781     {&hf_ieee80211_ff_cf_privacy,
21782      {"Privacy", "wlan.fixed.capabilities.privacy",
21783       FT_BOOLEAN, 16, TFS(&cf_privacy_flags), 0x0010,
21784       "WEP support", HFILL }},
21785
21786     {&hf_ieee80211_ff_cf_preamble,
21787      {"Short Preamble", "wlan.fixed.capabilities.preamble",
21788       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0020,
21789       NULL, HFILL }},
21790
21791     {&hf_ieee80211_ff_cf_pbcc,
21792      {"PBCC", "wlan.fixed.capabilities.pbcc",
21793       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0040,
21794       "PBCC Modulation", HFILL }},
21795
21796     {&hf_ieee80211_ff_cf_agility,
21797      {"Channel Agility", "wlan.fixed.capabilities.agility",
21798       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0080,
21799       NULL, HFILL }},
21800
21801     {&hf_ieee80211_ff_cf_spec_man,
21802      {"Spectrum Management", "wlan.fixed.capabilities.spec_man",
21803       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0100,
21804       NULL, HFILL }},
21805
21806     {&hf_ieee80211_ff_short_slot_time,
21807      {"Short Slot Time", "wlan.fixed.capabilities.short_slot_time",
21808       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0400,
21809       NULL, HFILL }},
21810
21811     {&hf_ieee80211_ff_cf_apsd,
21812      {"Automatic Power Save Delivery", "wlan.fixed.capabilities.apsd",
21813       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0800,
21814       NULL, HFILL }},
21815
21816     {&hf_ieee80211_ff_radio_measurement,
21817      {"Radio Measurement", "wlan.fixed.capabilities.radio_measurement",
21818       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x1000,
21819       NULL, HFILL }},
21820
21821     {&hf_ieee80211_ff_dsss_ofdm,
21822      {"DSSS-OFDM", "wlan.fixed.capabilities.dsss_ofdm",
21823       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x2000,
21824       "DSSS-OFDM Modulation", HFILL }},
21825
21826     {&hf_ieee80211_ff_cf_del_blk_ack,
21827      {"Delayed Block Ack", "wlan.fixed.capabilities.del_blk_ack",
21828       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x4000,
21829       NULL, HFILL }},
21830
21831     {&hf_ieee80211_ff_cf_imm_blk_ack,
21832      {"Immediate Block Ack", "wlan.fixed.capabilities.imm_blk_ack",
21833       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x8000,
21834       NULL, HFILL }},
21835
21836     {&hf_ieee80211_ff_auth_seq,
21837      {"Authentication SEQ", "wlan.fixed.auth_seq",
21838       FT_UINT16, BASE_HEX, NULL, 0,
21839       "Authentication Sequence Number", HFILL }},
21840
21841     {&hf_ieee80211_ff_assoc_id,
21842      {"Association ID", "wlan.fixed.aid",
21843       FT_UINT16, BASE_HEX, NULL, 0x3FFF,
21844       NULL, HFILL }},
21845
21846     {&hf_ieee80211_ff_listen_ival,
21847      {"Listen Interval", "wlan.fixed.listen_ival",
21848       FT_UINT16, BASE_HEX, NULL, 0,
21849       NULL, HFILL }},
21850
21851     {&hf_ieee80211_ff_current_ap,
21852      {"Current AP", "wlan.fixed.current_ap",
21853       FT_ETHER, BASE_NONE, NULL, 0,
21854       "MAC address of current AP", HFILL }},
21855
21856     {&hf_ieee80211_ff_reason,
21857      {"Reason code", "wlan.fixed.reason_code",
21858       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
21859       "Reason for unsolicited notification", HFILL }},
21860
21861     {&hf_ieee80211_ff_status_code,
21862      {"Status code", "wlan.fixed.status_code",
21863       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
21864       "Status of requested event", HFILL }},
21865
21866     {&hf_ieee80211_ff_category_code,
21867      {"Category code", "wlan.fixed.category_code",
21868       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &category_codes_ext, 0,
21869       "Management action category", HFILL }},
21870
21871     {&hf_ieee80211_ff_action_code,
21872      {"Action code", "wlan.fixed.action_code",
21873       FT_UINT16, BASE_DEC, VALS(action_codes), 0,
21874       "Management action code", HFILL }},
21875
21876     {&hf_ieee80211_ff_dialog_token,
21877      {"Dialog token", "wlan.fixed.dialog_token",
21878       FT_UINT8, BASE_HEX, NULL, 0,
21879       "Management action dialog token", HFILL }},
21880
21881     {&hf_ieee80211_ff_followup_dialog_token,
21882      {"Followup Dialog token", "wlan.fixed.followup_dialog_token",
21883       FT_UINT8, BASE_HEX, NULL, 0,
21884       "Management action followup dialog token", HFILL }},
21885
21886     {&hf_ieee80211_ff_marvell_action_type,
21887      {"Marvell Action type", "wlan.fixed.mrvl_action_type",
21888       FT_UINT8, BASE_DEC, VALS(vendor_action_types_mrvl), 0,
21889       "Vendor Specific Action Type (Marvell)", HFILL }},
21890
21891     {&hf_ieee80211_ff_marvell_mesh_mgt_action_code,
21892      {"Mesh action(Marvell)", "wlan.fixed.mrvl_mesh_action",
21893       FT_UINT8, BASE_HEX, VALS(mesh_mgt_action_codes_mrvl), 0,
21894       "Mesh action code(Marvell)", HFILL }},
21895
21896     {&hf_ieee80211_ff_marvell_mesh_mgt_length,
21897      {"Message Length", "wlan.fixed.length",
21898       FT_UINT8, BASE_DEC, NULL, 0,
21899       NULL, HFILL }},
21900
21901     {&hf_ieee80211_ff_marvell_mesh_mgt_mode,
21902      {"Message Mode", "wlan.fixed.mode",
21903       FT_UINT8, BASE_HEX, NULL, 0,
21904       NULL, HFILL }},
21905
21906     {&hf_ieee80211_ff_marvell_mesh_mgt_ttl,
21907      {"Message TTL", "wlan.fixed.ttl",
21908       FT_UINT8, BASE_DEC, NULL, 0,
21909       NULL, HFILL }},
21910
21911     {&hf_ieee80211_ff_marvell_mesh_mgt_dstcount,
21912      {"Destination Count", "wlan.fixed.dstcount",
21913       FT_UINT8, BASE_DEC, NULL, 0,
21914       NULL, HFILL }},
21915
21916     {&hf_ieee80211_ff_marvell_mesh_mgt_hopcount,
21917      {"Hop Count", "wlan.fixed.hopcount",
21918       FT_UINT8, BASE_DEC, NULL, 0,
21919       NULL, HFILL }},
21920
21921     {&hf_ieee80211_ff_marvell_mesh_mgt_rreqid,
21922      {"RREQ ID", "wlan.fixed.rreqid",
21923       FT_UINT32, BASE_DEC, NULL, 0,
21924       NULL, HFILL }},
21925
21926     {&hf_ieee80211_ff_marvell_mesh_mgt_sa,
21927      {"Source Address", "wlan.fixed.sa",
21928       FT_ETHER, BASE_NONE, NULL, 0,
21929       "Source MAC address", HFILL }},
21930
21931     {&hf_ieee80211_ff_marvell_mesh_mgt_ssn,
21932      {"SSN", "wlan.fixed.ssn",
21933       FT_UINT32, BASE_DEC, NULL, 0,
21934       "Source Sequence Number", HFILL }},
21935
21936     {&hf_ieee80211_ff_marvell_mesh_mgt_metric,
21937      {"Metric", "wlan.fixed.metric",
21938       FT_UINT32, BASE_DEC, NULL, 0,
21939       "Route Metric", HFILL }},
21940
21941     {&hf_ieee80211_ff_marvell_mesh_mgt_flags,
21942      {"RREQ Flags", "wlan.fixed.hopcount",
21943       FT_UINT8, BASE_HEX, NULL, 0,
21944       NULL, HFILL }},
21945
21946     {&hf_ieee80211_ff_marvell_mesh_mgt_da,
21947      {"Destination Address", "wlan.fixed.da",
21948       FT_ETHER, BASE_NONE, NULL, 0,
21949       "Destination MAC address", HFILL }},
21950
21951     {&hf_ieee80211_ff_marvell_mesh_mgt_dsn,
21952      {"DSN", "wlan.fixed.dsn",
21953       FT_UINT32, BASE_DEC, NULL, 0,
21954       "Destination Sequence Number", HFILL }},
21955
21956     {&hf_ieee80211_ff_marvell_mesh_mgt_lifetime,
21957      {"Lifetime", "wlan.fixed.lifetime",
21958       FT_UINT32, BASE_DEC, NULL, 0,
21959       "Route Lifetime", HFILL }},
21960
21961     {&hf_ieee80211_ff_wme_action_code,
21962      {"Action code", "wlan.fixed.action_code",
21963       FT_UINT16, BASE_HEX, VALS(wme_action_codes), 0,
21964       "Management notification action code", HFILL }},
21965
21966     {&hf_ieee80211_ff_wme_status_code,
21967      {"Status code", "wlan.fixed.status_code",
21968       FT_UINT16, BASE_HEX, VALS(wme_status_codes), 0,
21969       "Management notification setup response status code", HFILL }},
21970
21971     {&hf_ieee80211_ff_mesh_action,
21972      {"Mesh Action code", "wlan.fixed.mesh_action",
21973       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &mesh_action_ext, 0,
21974       NULL, HFILL }},
21975
21976     {&hf_ieee80211_ff_multihop_action,
21977      {"Multihop Action code", "wlan.fixed.multihop_action",
21978       FT_UINT8, BASE_HEX, VALS(multihop_action), 0,
21979       NULL, HFILL }},
21980
21981     {&hf_ieee80211_ff_mesh_flags,
21982      {"Mesh Flags", "wlan.fixed.mesh_flags",
21983       FT_UINT8, BASE_HEX, NULL, 0,
21984       NULL, HFILL }},
21985
21986     {&hf_ieee80211_ff_mesh_ttl,
21987      {"Mesh TTL", "wlan.fixed.mesh_ttl",
21988       FT_UINT8, BASE_HEX, NULL, 0,
21989       NULL, HFILL }},
21990
21991     {&hf_ieee80211_ff_mesh_sequence,
21992      {"Sequence Number", "wlan.fixed.mesh_sequence",
21993       FT_UINT32, BASE_HEX, NULL, 0,
21994       NULL, HFILL }},
21995
21996     {&hf_ieee80211_ff_mesh_addr4,
21997      {"Mesh Extended Address 4", "wlan.fixed.mesh_addr4",
21998       FT_ETHER, BASE_NONE, NULL, 0,
21999       NULL, HFILL }},
22000
22001     {&hf_ieee80211_ff_mesh_addr5,
22002      {"Mesh Extended Address 5", "wlan.fixed.mesh_addr5",
22003       FT_ETHER, BASE_NONE, NULL, 0,
22004       NULL, HFILL }},
22005
22006     {&hf_ieee80211_ff_mesh_addr6,
22007      {"Mesh Extended Address 6", "wlan.fixed.mesh_addr6",
22008       FT_ETHER, BASE_NONE, NULL, 0,
22009       NULL, HFILL }},
22010
22011     {&hf_ieee80211_ff_selfprot_action,
22012      {"Self-protected Action code", "wlan.fixed.selfprot_action",
22013       FT_UINT8, BASE_HEX, VALS(selfprot_action), 0,
22014       NULL, HFILL }},
22015
22016     {&hf_ieee80211_mesh_peering_proto,
22017      {"Mesh Peering Protocol ID", "wlan.peering.proto",
22018       FT_UINT16, BASE_HEX, VALS(mesh_peering_proto_ids), 0,
22019       NULL, HFILL }},
22020
22021     {&hf_ieee80211_mesh_peering_local_link_id,
22022      {"Local Link ID", "wlan.peering.local_id",
22023       FT_UINT16, BASE_HEX, NULL, 0,
22024       "Mesh Peering Management Local Link ID", HFILL }},
22025
22026     {&hf_ieee80211_mesh_peering_peer_link_id,
22027      {"Peer Link ID", "wlan.peering.peer_id",
22028       FT_UINT16, BASE_HEX, NULL, 0,
22029       "Mesh Peering Management Peer Link ID", HFILL }},
22030
22031     {&hf_ieee80211_ff_hwmp_flags,
22032      {"HWMP Flags", "wlan.hwmp.flags",
22033       FT_UINT8, BASE_HEX, NULL, 0,
22034       NULL, HFILL }},
22035
22036     {&hf_ieee80211_ff_hwmp_hopcount,
22037      {"HWMP Hop Count", "wlan.hwmp.hopcount",
22038       FT_UINT8, BASE_DEC, NULL, 0,
22039       NULL, HFILL }},
22040
22041     {&hf_ieee80211_ff_hwmp_ttl,
22042      {"HWMP TTL", "wlan.hwmp.ttl",
22043       FT_UINT8, BASE_DEC, NULL, 0,
22044       NULL, HFILL }},
22045
22046     {&hf_ieee80211_ff_hwmp_pdid,
22047      {"HWMP Path Discovery ID", "wlan.hwmp.pdid",
22048       FT_UINT32, BASE_DEC, NULL, 0,
22049       NULL, HFILL }},
22050
22051     {&hf_ieee80211_ff_hwmp_orig_sta,
22052      {"Originator STA Address", "wlan.hwmp.orig_sta",
22053       FT_ETHER, BASE_NONE, NULL, 0,
22054       NULL, HFILL }},
22055
22056     {&hf_ieee80211_ff_hwmp_orig_sn,
22057      {"HWMP Originator Sequence Number", "wlan.hwmp.orig_sn",
22058       FT_UINT32, BASE_DEC, NULL, 0,
22059       NULL, HFILL}},
22060
22061     {&hf_ieee80211_ff_hwmp_orig_ext,
22062      {"Originator External Address", "wlan.hwmp.orig_ext",
22063       FT_ETHER, BASE_NONE, NULL, 0,
22064       NULL, HFILL }},
22065
22066     {&hf_ieee80211_ff_hwmp_lifetime,
22067      {"HWMP Lifetime", "wlan.hwmp.lifetime",
22068       FT_UINT32, BASE_DEC, NULL, 0,
22069       NULL, HFILL }},
22070
22071     {&hf_ieee80211_ff_hwmp_metric,
22072      {"HWMP Metric", "wlan.hwmp.metric",
22073       FT_UINT32, BASE_DEC, NULL, 0,
22074       NULL, HFILL }},
22075
22076     {&hf_ieee80211_ff_hwmp_targ_count,
22077      {"HWMP Target Count", "wlan.hwmp.targ_count",
22078       FT_UINT8, BASE_DEC, NULL, 0,
22079       NULL, HFILL }},
22080
22081     {&hf_ieee80211_ff_hwmp_targ_flags,
22082      {"HWMP Per-Target Flags", "wlan.hwmp.targ_flags",
22083       FT_UINT8, BASE_HEX, NULL, 0,
22084       NULL, HFILL }},
22085
22086     {&hf_ieee80211_ff_hwmp_targ_to_flags,
22087      {"TO Flag", "wlan.hwmp.to_flag",
22088       FT_BOOLEAN, 8, TFS(&hwmp_targ_to_flags), 0x01,
22089       "Target Only Flag", HFILL }},
22090
22091     {&hf_ieee80211_ff_hwmp_targ_usn_flags,
22092      {"USN Flag", "wlan.hwmp.usn_flag",
22093       FT_BOOLEAN, 8, TFS(&hwmp_targ_usn_flags), 0x04,
22094       "Unknown Target HWMP Sequence Number Flag", HFILL }},
22095
22096     {&hf_ieee80211_ff_hwmp_targ_sta,
22097      {"Target STA Address", "wlan.hwmp.targ_sta",
22098       FT_ETHER, BASE_NONE, NULL, 0,
22099       NULL, HFILL }},
22100
22101     {&hf_ieee80211_ff_hwmp_targ_ext,
22102      {"Target External Address", "wlan.hwmp.targ_ext",
22103       FT_ETHER, BASE_NONE, NULL, 0,
22104       NULL, HFILL }},
22105
22106     {&hf_ieee80211_ff_hwmp_targ_sn,
22107      {"Target HWMP Sequence Number", "wlan.hwmp.targ_sn",
22108       FT_UINT32, BASE_DEC, NULL, 0,
22109       NULL, HFILL }},
22110
22111     {&hf_ieee80211_mesh_config_path_sel_protocol,
22112      {"Path Selection Protocol", "wlan.mesh.config.ps_protocol",
22113       FT_UINT8, BASE_HEX, NULL, 0,
22114       "Mesh Configuration Path Selection Protocol", HFILL }},
22115
22116     {&hf_ieee80211_mesh_config_path_sel_metric,
22117      {"Path Selection Metric", "wlan.mesh.config.ps_metric",
22118       FT_UINT8, BASE_HEX, NULL, 0,
22119       "Mesh Configuration Path Selection Metric", HFILL }},
22120
22121     {&hf_ieee80211_mesh_config_congestion_control,
22122      {"Congestion Control", "wlan.mesh.config.cong_ctl",
22123       FT_UINT8, BASE_HEX, NULL, 0,
22124       "Mesh Configuration Congestion Control", HFILL }},
22125
22126     {&hf_ieee80211_mesh_config_sync_method,
22127      {"Synchronization Method", "wlan.mesh.config.sync_method",
22128       FT_UINT8, BASE_HEX, NULL, 0,
22129       "Mesh Configuration Synchronization Method", HFILL }},
22130
22131     {&hf_ieee80211_mesh_config_auth_protocol,
22132      {"Authentication Protocol", "wlan.mesh.config.auth_protocol",
22133       FT_UINT8, BASE_HEX, NULL, 0,
22134       "Mesh Configuration Authentication Protocol", HFILL }},
22135
22136     {&hf_ieee80211_mesh_config_formation_info,
22137      {"Formation Info", "wlan.mesh.config.formation_info",
22138       FT_UINT8, BASE_HEX, NULL, 0,
22139       "Mesh Configuration Formation Info", HFILL }},
22140
22141     {&hf_ieee80211_mesh_form_info_num_of_peerings,
22142      {"Number of Peerings", "wlan.mesh.config.formation_info.num_peers",
22143       FT_UINT8, BASE_DEC, NULL, 0x7E,
22144       NULL, HFILL }},
22145
22146     {&hf_ieee80211_mesh_config_capability,
22147      {"Capability", "wlan.mesh.config.cap",
22148       FT_UINT8, BASE_HEX, NULL, 0,
22149       "Mesh Configuration Capability", HFILL }},
22150
22151     {&hf_ieee80211_mesh_config_cap_accepting,
22152      {"Accepting Additional Mesh Peerings", "wlan.mesh.config.cap.accept",
22153       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
22154       NULL, HFILL }},
22155
22156     {&hf_ieee80211_mesh_config_cap_mcca_support,
22157      {"MCCA Support", "wlan.mesh.config.cap.mcca_support",
22158       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
22159       NULL, HFILL }},
22160
22161     {&hf_ieee80211_mesh_config_cap_mcca_enabled,
22162      {"MCCA Enabled", "wlan.mesh.config.cap.mcca_enabled",
22163       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
22164       NULL, HFILL }},
22165
22166     {&hf_ieee80211_mesh_config_cap_forwarding,
22167      {"Mesh Forwarding", "wlan.mesh.config.cap.forwarding",
22168       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08,
22169       NULL, HFILL }},
22170
22171     {&hf_ieee80211_mesh_config_cap_mbca_enabled,
22172      {"MBCA Enabled", "wlan.mesh.config.cap.mbca_enabled",
22173       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
22174       NULL, HFILL }},
22175
22176     {&hf_ieee80211_mesh_config_cap_tbtt_adjusting,
22177      {"TBTT Adjustment", "wlan.mesh.config.cap.tbtt_adjusting",
22178       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20,
22179       NULL, HFILL }},
22180
22181     {&hf_ieee80211_mesh_config_cap_power_save_level,
22182      {"Power Save", "wlan.mesh.config.cap.power_save_level",
22183       FT_BOOLEAN, 8, TFS(&mesh_config_cap_power_save_level_flags), 0x40,
22184       NULL, HFILL }},
22185
22186     {&hf_ieee80211_mesh_id,
22187      {"Mesh ID", "wlan.mesh.id",
22188       FT_STRING, BASE_NONE, NULL, 0,
22189       NULL, HFILL }},
22190
22191     {&hf_ieee80211_rann_flags,
22192      {"RANN Flags", "wlan.rann.flags",
22193       FT_UINT8, BASE_HEX, NULL, 0,
22194       "Root Announcement Flags", HFILL }},
22195
22196     {&hf_ieee80211_rann_root_sta,
22197      {"Root STA Address", "wlan.rann.root_sta", FT_ETHER, BASE_NONE, NULL, 0,
22198       "Root Mesh STA Address", HFILL }},
22199
22200     {&hf_ieee80211_rann_sn,
22201      {"Root STA Sequence Number", "wlan.rann.rann_sn",
22202       FT_UINT32, BASE_DEC, NULL, 0,
22203       "Root Mesh STA Sequence Number", HFILL }},
22204
22205     {&hf_ieee80211_rann_interval,
22206      {"RANN Interval", "wlan.rann.interval",
22207       FT_UINT32, BASE_DEC, NULL, 0,
22208       "Root Announcement Interval", HFILL }},
22209
22210     {&hf_ieee80211_ff_qos_action_code,
22211      {"Action code", "wlan.fixed.action_code",
22212       FT_UINT16, BASE_HEX, VALS(qos_action_codes), 0,
22213       "QoS management action code", HFILL }},
22214
22215     {&hf_ieee80211_ff_ba_action,
22216      {"Action code", "wlan.fixed.action_code",
22217       FT_UINT8, BASE_HEX, VALS(ba_action_codes), 0,
22218       "Block Ack action code", HFILL }},
22219
22220     {&hf_ieee80211_ff_check_beacon,
22221      {"Check Beacon", "wlan.fixed.check_beacon",
22222       FT_UINT8, BASE_DEC, NULL, 0,
22223       "Unprotected WNM Check Beacon", HFILL }},
22224
22225     {&hf_ieee80211_ff_tod,
22226      {"TOD", "wlan.fixed.tod",
22227       FT_UINT32, BASE_DEC, NULL, 0,
22228       "Previous TS of transmit antenna port", HFILL }},
22229
22230     {&hf_ieee80211_ff_toa,
22231      {"TOA", "wlan.fixed.toa",
22232       FT_UINT32, BASE_DEC, NULL, 0,
22233       "Previous TS of receive antenna port", HFILL }},
22234
22235     {&hf_ieee80211_ff_max_tod_err,
22236      {"MAX TOD ERROR", "wlan.fixed.max_tod_err",
22237       FT_UINT8, BASE_DEC, NULL, 0,
22238       "Maximal Error at Previous TS of transmit antenna port", HFILL }},
22239
22240     {&hf_ieee80211_ff_max_toa_err,
22241      {"MAX TOA ERROR", "wlan.fixed.max_toa_err",
22242       FT_UINT8, BASE_DEC, NULL, 0,
22243       "Maximal Error at Previous TS of receive antenna port", HFILL }},
22244
22245     {&hf_ieee80211_ff_dls_action_code,
22246      {"Action code", "wlan.fixed.action_code",
22247       FT_UINT16, BASE_HEX, VALS(dls_action_codes), 0,
22248       "DLS management action code", HFILL }},
22249
22250     {&hf_ieee80211_ff_dst_mac_addr,
22251      {"Destination address", "wlan.fixed.dst_mac_addr",
22252       FT_ETHER, BASE_NONE, NULL, 0,
22253       "Destination MAC address", HFILL }},
22254
22255     {&hf_ieee80211_ff_src_mac_addr,
22256      {"Source address", "wlan.fixed.src_mac_addr",
22257       FT_ETHER, BASE_NONE, NULL, 0,
22258       "Source MAC address", HFILL }},
22259
22260     {&hf_ieee80211_ff_req_ap_addr,
22261      {"RequesterAP address", "wlan.fixed.req_ap_addr",
22262       FT_ETHER, BASE_NONE, NULL, 0,
22263       NULL, HFILL }},
22264
22265     {&hf_ieee80211_ff_res_ap_addr,
22266      {"ResponderAP address", "wlan.fixed.res_ap_addr",
22267       FT_ETHER, BASE_NONE, NULL, 0,
22268       NULL, HFILL }},
22269
22270     {&hf_ieee80211_ff_ft_action_code,
22271      {"Action code", "wlan.fixed.action_code",
22272       FT_UINT8, BASE_DEC, VALS(ft_action_codes), 0,
22273       "Management action code", HFILL }},
22274
22275     {&hf_ieee80211_ff_sta_address,
22276      {"STA Address", "wlan.fixed.sta_address",
22277       FT_ETHER, BASE_NONE, NULL, 0,
22278       NULL, HFILL }},
22279
22280     {&hf_ieee80211_ff_target_ap_address,
22281      {"Target AP Address", "wlan.fixed.target_ap_address",
22282       FT_ETHER, BASE_NONE, NULL, 0,
22283       "Target AP MAC address", HFILL }},
22284
22285     {&hf_ieee80211_ff_gas_comeback_delay,
22286      {"GAS Comeback Delay", "wlan.fixed.gas_comeback_delay",
22287       FT_UINT16, BASE_DEC, NULL, 0,
22288       NULL, HFILL }},
22289
22290     {&hf_ieee80211_ff_gas_fragment_id,
22291      {"GAS Query Response Fragment ID", "wlan.fixed.gas_fragment_id",
22292       FT_UINT8, BASE_DEC, NULL, 0x7f,
22293       NULL, HFILL }},
22294
22295     {&hf_ieee80211_ff_more_gas_fragments,
22296      {"More GAS Fragments", "wlan.fixed.more_gas_fragments",
22297       FT_UINT8, BASE_DEC, NULL, 0x80,
22298       NULL, HFILL }},
22299
22300     {&hf_ieee80211_ff_query_request_length,
22301      {"Query Request Length", "wlan.fixed.query_request_length",
22302       FT_UINT16, BASE_DEC, NULL, 0,
22303       NULL, HFILL }},
22304
22305     {&hf_ieee80211_ff_query_request,
22306      {"Query Request", "wlan.fixed.query_request",
22307       FT_BYTES, BASE_NONE, NULL, 0,
22308       NULL, HFILL }},
22309
22310     {&hf_ieee80211_ff_query_response_length,
22311      {"Query Response Length", "wlan.fixed.query_response_length",
22312       FT_UINT16, BASE_DEC, NULL, 0,
22313       NULL, HFILL }},
22314
22315     {&hf_ieee80211_ff_query_response,
22316      {"Query Response", "wlan.fixed.query_response",
22317       FT_BYTES, BASE_NONE, NULL, 0,
22318       NULL, HFILL }},
22319
22320     {&hf_ieee80211_gas_resp_fragments,
22321      {"GAS Query Response fragments", "wlan.fixed.fragments",
22322       FT_NONE, BASE_NONE, NULL, 0x00,
22323       NULL, HFILL } },
22324
22325     {&hf_ieee80211_gas_resp_fragment,
22326      {"GAS Query Response fragment", "wlan.fixed.fragment",
22327       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
22328       NULL, HFILL } },
22329
22330     {&hf_ieee80211_gas_resp_fragment_overlap,
22331      {"GAS Query Response fragment overlap", "wlan.fixed.fragment.overlap",
22332       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
22333       NULL, HFILL } },
22334
22335     {&hf_ieee80211_gas_resp_fragment_overlap_conflict,
22336      {"GAS Query Response fragment overlapping with conflicting data", "wlan.fixed.fragment.overlap.conflicts",
22337       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
22338       NULL, HFILL } },
22339
22340     {&hf_ieee80211_gas_resp_fragment_multiple_tails,
22341      {"GAS Query Response has multiple tail fragments",  "wlan.fixed.fragment.multiple_tails",
22342       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
22343       NULL, HFILL } },
22344
22345     {&hf_ieee80211_gas_resp_fragment_too_long_fragment,
22346      {"GAS Query Response fragment too long", "wlan.fixed.fragment.too_long_fragment",
22347       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
22348       NULL, HFILL } },
22349
22350     {&hf_ieee80211_gas_resp_fragment_error,
22351      {"GAS Query Response reassembly error", "wlan.fixed.fragment.error",
22352       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
22353       NULL, HFILL } },
22354
22355     {&hf_ieee80211_gas_resp_fragment_count,
22356      {"GAS Query Response fragment count", "wlan.fixed.fragment.count",
22357       FT_UINT32, BASE_DEC, NULL, 0x00,
22358       NULL, HFILL } },
22359
22360     {&hf_ieee80211_gas_resp_reassembled_in,
22361      {"Reassembled in", "wlan.fixed.reassembled.in",
22362       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
22363       NULL, HFILL } },
22364
22365     {&hf_ieee80211_gas_resp_reassembled_length,
22366      {"Reassembled length", "wlan.fixed.reassembled.length",
22367       FT_UINT32, BASE_DEC, NULL, 0x00,
22368       NULL, HFILL } },
22369
22370     {&hf_ieee80211_ff_anqp_info_id,
22371      {"Info ID", "wlan.fixed.anqp.info_id",
22372       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
22373       "Access Network Query Protocol Info ID", HFILL }},
22374
22375     {&hf_ieee80211_ff_anqp_info_length,
22376      {"Length", "wlan.fixed.anqp.info_length",
22377       FT_UINT16, BASE_DEC, NULL, 0,
22378       "Access Network Query Protocol Length", HFILL }},
22379
22380     {&hf_ieee80211_ff_anqp_info,
22381      {"Information", "wlan.fixed.anqp.info",
22382       FT_BYTES, BASE_NONE, NULL, 0,
22383       "Access Network Query Protocol Information", HFILL }},
22384
22385     {&hf_ieee80211_ff_anqp_query_id,
22386      {"ANQP Query ID", "wlan.fixed.anqp.query_id",
22387       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
22388       "Access Network Query Protocol Query ID", HFILL }},
22389
22390     {&hf_ieee80211_ff_anqp_capability,
22391      {"ANQP Capability", "wlan.fixed.anqp.capability",
22392       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
22393       "Access Network Query Protocol Query ID", HFILL }},
22394
22395     {&hf_ieee80211_ff_anqp_capability_vlen,
22396      {"Vendor-specific Capability Length", "wlan.fixed.anqp.capability_vlen",
22397       FT_UINT16, BASE_DEC, NULL, 0,
22398       NULL, HFILL }},
22399
22400     {&hf_ieee80211_ff_anqp_capability_vendor,
22401      {"Vendor-specific Capability", "wlan.fixed.anqp.capability_vendor",
22402       FT_BYTES, BASE_NONE, NULL, 0,
22403       NULL, HFILL }},
22404
22405     {&hf_ieee80211_ff_venue_info_group,
22406      {"Venue Group", "wlan.fixed.venue_info.group",
22407       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &venue_group_vals_ext, 0,
22408       NULL, HFILL }},
22409
22410     {&hf_ieee80211_ff_venue_info_type,
22411      {"Venue Type", "wlan.fixed.venue_info.type",
22412       FT_UINT8, BASE_DEC, NULL, 0,
22413       NULL, HFILL }},
22414
22415     {&hf_ieee80211_ff_anqp_venue_length,
22416      {"Venue Name Duple Length", "wlan.fixed.anqp.venue.length",
22417       FT_UINT8, BASE_DEC, NULL, 0,
22418       NULL, HFILL }},
22419
22420     {&hf_ieee80211_ff_anqp_venue_language,
22421      {"Language Code", "wlan.fixed.anqp.venue.language",
22422       FT_STRING, BASE_NONE, NULL, 0,
22423       "Venue Name Language Code", HFILL }},
22424
22425     {&hf_ieee80211_ff_anqp_venue_name,
22426      {"Venue Name", "wlan.fixed.anqp.venue.name",
22427       FT_STRING, BASE_NONE, NULL, 0,
22428       NULL, HFILL }},
22429
22430     {&hf_ieee80211_ff_anqp_nw_auth_type_indicator,
22431      {"Network Authentication Type Indicator", "wlan.fixed.anqp.nw_auth_type.indicator",
22432       FT_UINT8, BASE_DEC, VALS(nw_auth_type_vals), 0,
22433       NULL, HFILL }},
22434
22435     {&hf_ieee80211_ff_anqp_nw_auth_type_url_len,
22436      {"Re-direct URL Length", "wlan.fixed.anqp.nw_auth_type.url_len",
22437       FT_UINT16, BASE_DEC, NULL, 0,
22438       NULL, HFILL }},
22439
22440     {&hf_ieee80211_ff_anqp_nw_auth_type_url,
22441      {"Re-direct URL", "wlan.fixed.anqp.nw_auth_type_url",
22442       FT_STRING, BASE_NONE, NULL, 0,
22443       NULL, HFILL }},
22444
22445     {&hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
22446      {"OI Length", "wlan.fixed.anqp.roaming_consortium.oi_len",
22447       FT_UINT8, BASE_DEC, NULL, 0,
22448       "Roaming Consortium OI Length", HFILL }},
22449
22450     {&hf_ieee80211_ff_anqp_roaming_consortium_oi,
22451      {"OI", "wlan.fixed.anqp.roaming_consortium.oi",
22452       FT_BYTES, BASE_NONE, NULL, 0,
22453       "Roaming Consortium OI", HFILL }},
22454
22455     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
22456      {"IPv6 Address", "wlan.fixed.anqp.ip_addr_availability.ipv6",
22457       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv6_vals), 0x03,
22458       "IP Address Type Availability information for IPv6", HFILL }},
22459
22460     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
22461      {"IPv4 Address", "wlan.fixed.anqp.ip_addr_availability.ipv4",
22462       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv4_vals), 0xfc,
22463       "IP Address Type Availability information for IPv4", HFILL }},
22464
22465     {&hf_ieee80211_ff_anqp_nai_realm_count,
22466      {"NAI Realm Count", "wlan.fixed.anqp.nai_realm_list.count",
22467       FT_UINT16, BASE_DEC, NULL, 0,
22468       NULL, HFILL }},
22469
22470     {&hf_ieee80211_ff_anqp_nai_field_len,
22471      {"NAI Realm Data Field Length", "wlan.fixed.anqp.nai_realm_list.field_len",
22472       FT_UINT16, BASE_DEC, NULL, 0,
22473       NULL, HFILL }},
22474
22475     {&hf_ieee80211_ff_anqp_nai_realm_encoding,
22476      {"NAI Realm Encoding", "wlan.fixed.naqp_nai_realm_list.encoding",
22477       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals), 0x01,
22478       NULL, HFILL }},
22479
22480     {&hf_ieee80211_ff_anqp_nai_realm_length,
22481      {"NAI Realm Length", "wlan.fixed.naqp_nai_realm_list.realm_length",
22482       FT_UINT8, BASE_DEC, NULL, 0,
22483       NULL, HFILL }},
22484
22485     {&hf_ieee80211_ff_anqp_nai_realm,
22486      {"NAI Realm", "wlan.fixed.naqp_nai_realm_list.realm",
22487       FT_STRING, BASE_NONE, NULL, 0,
22488       NULL, HFILL }},
22489
22490     {&hf_ieee80211_ff_anqp_nai_realm_eap_count,
22491      {"EAP Method Count", "wlan.fixed.naqp_nai_realm_list.eap_method_count",
22492       FT_UINT8, BASE_DEC, NULL, 0,
22493       NULL, HFILL }},
22494
22495     {&hf_ieee80211_ff_anqp_nai_realm_eap_len,
22496      {"EAP Method subfield Length", "wlan.fixed.naqp_nai_realm_list.eap_method_len",
22497       FT_UINT8, BASE_DEC, NULL, 0,
22498       NULL, HFILL }},
22499
22500     {&hf_ieee80211_ff_anqp_nai_realm_eap_method,
22501      {"EAP Method", "wlan.fixed.naqp_nai_realm_list.eap_method",
22502       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &eap_type_vals_ext, 0,
22503       NULL, HFILL }},
22504
22505     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
22506      {"Authentication Parameter Count", "wlan.fixed.naqp_nai_realm_list.auth_param_count",
22507       FT_UINT8, BASE_DEC, NULL, 0,
22508       NULL, HFILL }},
22509
22510     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
22511      {"Authentication Parameter ID", "wlan.fixed.naqp_nai_realm_list.auth_param_id",
22512       FT_UINT8, BASE_DEC, VALS(nai_realm_auth_param_id_vals), 0,
22513       NULL, HFILL }},
22514
22515     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
22516      {"Authentication Parameter Length", "wlan.fixed.naqp_nai_realm_list.auth_param_len",
22517       FT_UINT8, BASE_DEC, NULL, 0,
22518       NULL, HFILL }},
22519
22520     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
22521      {"Authentication Parameter Value", "wlan.fixed.naqp_nai_realm_list.auth_param_value",
22522       FT_BYTES, BASE_NONE, NULL, 0,
22523       NULL, HFILL }},
22524
22525     {&hf_ieee80211_3gpp_gc_gud,
22526      {"GUD", "wlan.fixed.anqp.3gpp_cellular_info.gud",
22527       FT_UINT8, BASE_DEC, NULL, 0,
22528       "Generic container User Data", HFILL }},
22529
22530     {&hf_ieee80211_3gpp_gc_udhl,
22531      {"UDHL", "wlan.fixed.anqp.3gpp_cellular_info.udhl",
22532       FT_UINT8, BASE_DEC, NULL, 0,
22533       "User Data Header Length", HFILL }},
22534
22535     {&hf_ieee80211_3gpp_gc_iei,
22536      {"IEI", "wlan.fixed.anqp.3gpp_cellular_info.iei",
22537       FT_UINT8, BASE_DEC, NULL, 0,
22538       "Information Element Identity", HFILL }},
22539
22540     {&hf_ieee80211_3gpp_gc_plmn_len,
22541      {"PLMN Length", "wlan.fixed.anqp.3gpp_cellular_info.plmn_len",
22542       FT_UINT8, BASE_DEC, NULL, 0,
22543       "Length of PLMN List value contents", HFILL }},
22544
22545     {&hf_ieee80211_3gpp_gc_num_plmns,
22546      {"Number of PLMNs", "wlan.fixed.anqp.3gpp_cellular_info.num_plmns",
22547       FT_UINT8, BASE_DEC, NULL, 0,
22548       NULL, HFILL }},
22549
22550     {&hf_ieee80211_ff_anqp_domain_name_len,
22551      {"Domain Name Length", "wlan.fixed.anqp.domain_name_list.len",
22552       FT_UINT8, BASE_DEC, NULL, 0,
22553       NULL, HFILL }},
22554
22555     {&hf_ieee80211_ff_anqp_domain_name,
22556      {"Domain Name", "wlan.fixed.anqp.domain_name_list.name",
22557       FT_STRING, BASE_NONE, NULL, 0,
22558       NULL, HFILL }},
22559
22560     {&hf_ieee80211_ff_dls_timeout,
22561      {"DLS timeout", "wlan.fixed.dls_timeout",
22562       FT_UINT16, BASE_HEX, NULL, 0,
22563       "DLS timeout value", HFILL }},
22564
22565     {&hf_ieee80211_ff_sa_query_action_code,
22566      {"Action code", "wlan.fixed.action_code",
22567       FT_UINT8, BASE_DEC, VALS(sa_query_action_codes), 0,
22568       "Management action code", HFILL }},
22569
22570     {&hf_ieee80211_ff_transaction_id,
22571      {"Transaction Id", "wlan.fixed.transaction_id",
22572       FT_UINT16, BASE_HEX, NULL, 0,
22573       NULL, HFILL }},
22574
22575     {&hf_ieee80211_anqp_wfa_subtype,
22576      {"ANQP WFA Subtype", "wlan.anqp.wfa.subtype",
22577       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }},
22578
22579     {&hf_hs20_indication_dgaf_disabled,
22580      {"DGAF Disabled", "wlan.hs20.indication.dgaf_disabled",
22581       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
22582
22583     {&hf_hs20_indication_pps_mo_id_present,
22584      {"PPS MO ID Present", "wlan.hs20.indication.pps_mo_id_present",
22585       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
22586
22587     {&hf_hs20_indication_anqp_domain_id_present,
22588      {"ANQP Domain ID Present", "wlan.hs20.indication.anqp_domain_id_present",
22589       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
22590
22591     {&hf_hs20_indication_release_number,
22592      {"Release Number", "wlan.hs20.indication.release_number",
22593       FT_UINT8, BASE_DEC, VALS(hs20_indication_release_number_vals), 0xF0, NULL, HFILL }},
22594
22595     {&hf_hs20_anqp_subtype,
22596      {"Subtype", "wlan.hs20.anqp.subtype",
22597       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
22598       "Hotspot 2.0 ANQP Subtype", HFILL }},
22599
22600     {&hf_hs20_anqp_reserved,
22601      {"Reserved", "wlan.hs20.anqp.reserved",
22602       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22603
22604     {&hf_hs20_anqp_payload,
22605      {"Payload", "wlan.hs20.anqp.payload",
22606       FT_BYTES, BASE_NONE, NULL, 0,
22607       "Hotspot 2.0 ANQP Payload", HFILL }},
22608
22609     {&hf_hs20_anqp_hs_query_list,
22610      {"Queried Subtype", "wlan.hs20.anqp.hs_query_list",
22611       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
22612       "Queried HS 2.0 Element Subtype", HFILL }},
22613
22614     {&hf_hs20_anqp_hs_capability_list,
22615      {"Capability", "wlan.hs20.anqp.hs_capability_list",
22616       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
22617       "Hotspot 2.0 ANQP Subtype Capability", HFILL }},
22618
22619     {&hf_hs20_anqp_ofn_length,
22620      {"Length", "wlan.hs20.anqp.ofn.length",
22621       FT_UINT8, BASE_DEC, NULL, 0,
22622       "Operator Friendly Name Length", HFILL }},
22623
22624     {&hf_hs20_anqp_ofn_language,
22625      {"Language Code", "wlan.hs20.anqp.ofn.language",
22626       FT_STRING, BASE_NONE, NULL, 0,
22627       "Operator Friendly Name Language Code", HFILL }},
22628
22629     {&hf_hs20_anqp_ofn_name,
22630      {"Operator Friendly Name", "wlan.hs20.anqp.ofn.name",
22631       FT_STRING, BASE_NONE, NULL, 0,
22632       NULL, HFILL }},
22633
22634     {&hf_hs20_anqp_wan_metrics_link_status,
22635      {"Link Status", "wlan.hs20.anqp.wan_metrics.link_status",
22636       FT_UINT8, BASE_DEC, VALS(hs20_wm_link_status_vals), 0x03, NULL, HFILL }},
22637
22638     {&hf_hs20_anqp_wan_metrics_symmetric_link,
22639      {"Symmetric Link", "wlan.hs20.anqp.wan_metrics.symmetric_link",
22640       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
22641
22642     {&hf_hs20_anqp_wan_metrics_at_capacity,
22643      {"At Capacity", "wlan.hs20.anqp.wan_metrics.at_capacity",
22644       FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
22645
22646     {&hf_hs20_anqp_wan_metrics_reserved,
22647      {"Reserved", "wlan.hs20.anqp.wan_metrics.reserved",
22648       FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }},
22649
22650     {&hf_hs20_anqp_wan_metrics_downlink_speed,
22651      {"Downlink Speed", "wlan.hs20.anqp.wan_metrics.downlink_speed",
22652       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
22653
22654     {&hf_hs20_anqp_wan_metrics_uplink_speed,
22655      {"Uplink Speed", "wlan.hs20.anqp.wan_metrics.uplink_speed",
22656       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
22657
22658     {&hf_hs20_anqp_wan_metrics_downlink_load,
22659      {"Downlink Load", "wlan.hs20.anqp.wan_metrics.downlink_load",
22660       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22661
22662     {&hf_hs20_anqp_wan_metrics_uplink_load,
22663      {"Uplink Load", "wlan.hs20.anqp.wan_metrics.uplink_load",
22664       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22665
22666     {&hf_hs20_anqp_wan_metrics_lmd,
22667      {"LMD", "wlan.hs20.anqp.wan_metrics.lmd",
22668       FT_UINT16, BASE_DEC, NULL, 0, "Load Measurement Duration", HFILL }},
22669
22670     {&hf_hs20_anqp_cc_proto_ip_proto,
22671      {"IP Protocol", "wlan.hs20.anqp.cc.ip_proto",
22672       FT_UINT8, BASE_DEC, NULL, 0,
22673       "ProtoPort Tuple - IP Protocol", HFILL }},
22674
22675     {&hf_hs20_anqp_cc_proto_port_num,
22676      {"Port Number", "wlan.hs20.anqp.cc.port_num",
22677       FT_UINT16, BASE_DEC, NULL, 0,
22678       "ProtoPort Tuple - Port Number", HFILL }},
22679
22680     {&hf_hs20_anqp_cc_proto_status,
22681      {"Status", "wlan.hs20.anqp.cc.status",
22682       FT_UINT8, BASE_DEC, VALS(hs20_cc_status_vals), 0,
22683       "ProtoPort Tuple - Status", HFILL }},
22684
22685     {&hf_hs20_anqp_nai_hrq_count,
22686      {"NAI Home Realm Count", "wlan.hs20.anqp.nai_hrq.count",
22687       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22688
22689     {&hf_hs20_anqp_nai_hrq_encoding_type,
22690      {"NAI Home Realm Encoding Type",
22691       "wlan.hs20.anqp.nai_hrq.encoding_type",
22692       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals),
22693       0x01, NULL, HFILL }},
22694
22695     {&hf_hs20_anqp_nai_hrq_length,
22696      {"NAI Home Realm Name Length", "wlan.hs20.anqp.nai_hrq.length",
22697       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22698
22699     {&hf_hs20_anqp_nai_hrq_realm_name,
22700      {"NAI Home Realm Name", "wlan.hs20.anqp.nai_hrq.name",
22701       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
22702
22703     {&hf_hs20_anqp_oper_class_indic,
22704      {"Operating Class", "wlan.hs20.anqp.oper_class_indic.oper_class",
22705       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22706
22707     {&hf_ieee80211_tag,
22708      {"Tag", "wlan.tag",
22709       FT_NONE, BASE_NONE, 0x0, 0,
22710       NULL, HFILL }},
22711
22712     {&hf_ieee80211_tag_number,
22713      {"Tag Number", "wlan.tag.number",
22714       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
22715       "Element ID", HFILL }},
22716
22717     {&hf_ieee80211_tag_length,
22718      {"Tag length", "wlan.tag.length",
22719       FT_UINT32, BASE_DEC, NULL, 0,
22720       "Length of tag", HFILL }},
22721
22722     {&hf_ieee80211_tag_interpretation,
22723      {"Tag interpretation", "wlan.tag.interpretation",
22724       FT_STRING, BASE_NONE, NULL, 0,
22725       "Interpretation of tag", HFILL }},
22726
22727     {&hf_ieee80211_tag_data,
22728      {"Tag Data", "wlan.tag.data",
22729       FT_BYTES, BASE_NONE, NULL, 0,
22730       "Data Interpretation of tag", HFILL }},
22731
22732     {&hf_ieee80211_tag_oui,
22733      {"OUI", "wlan.tag.oui",
22734       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
22735       "OUI of vendor specific IE", HFILL }},
22736
22737     {&hf_ieee80211_tag_oui_wfa_subtype,
22738      {"WFA Subtype", "wlan.tag.oui.wfa_subtype",
22739       FT_UINT8, BASE_DEC, NULL, 0,
22740       NULL, HFILL }},
22741
22742     {&hf_ieee80211_tag_ds_param_channel,
22743      {"Current Channel", "wlan.ds.current_channel",
22744       FT_UINT8, BASE_DEC, NULL, 0,
22745       "DS Parameter Set - Current Channel", HFILL }},
22746
22747     {&hf_ieee80211_tag_cfp_count,
22748      {"CFP Count", "wlan.cfp.count",
22749       FT_UINT8, BASE_DEC, NULL, 0,
22750       "Indicates how many delivery traffic indication messages (DTIMs)", HFILL }},
22751
22752     {&hf_ieee80211_tag_cfp_period,
22753      {"CFP Period", "wlan.cfp.period",
22754       FT_UINT8, BASE_DEC, NULL, 0,
22755       "Indicates the number of DTIM intervals between the start of CFPs", HFILL }},
22756
22757     {&hf_ieee80211_tag_cfp_max_duration,
22758      {"CFP Max Duration", "wlan.cfp.max_duration",
22759       FT_UINT16, BASE_DEC, NULL, 0,
22760       "Indicates the maximum duration (in TU) of the CFP that may be generated by this PCF", HFILL }},
22761
22762     {&hf_ieee80211_tag_cfp_dur_remaining,
22763      {"CFP Dur Remaining", "wlan.cfp.dur_remaining",
22764       FT_UINT16, BASE_DEC, NULL, 0,
22765       "Indicates the maximum time (in TU) remaining in the present CFP", HFILL }},
22766
22767     {&hf_ieee80211_tag_vendor_oui_type,
22768      {"Vendor Specific OUI Type", "wlan.tag.vendor.oui.type",
22769       FT_UINT8, BASE_DEC, NULL, 0,
22770       NULL, HFILL }},
22771
22772     {&hf_ieee80211_tag_vendor_data,
22773      {"Vendor Specific Data", "wlan.tag.vendor.data",
22774       FT_BYTES, BASE_NONE, NULL, 0,
22775       "Unknown/undecoded Vendor Specific Data", HFILL }},
22776
22777     {&hf_ieee80211_tim_dtim_count,
22778      {"DTIM count", "wlan.tim.dtim_count",
22779       FT_UINT8, BASE_DEC, NULL, 0,
22780       "Indicates how many Beacon frames (including the current frame) appear before the next DTIM", HFILL }},
22781
22782     {&hf_ieee80211_tim_dtim_period,
22783      {"DTIM period", "wlan.tim.dtim_period",
22784       FT_UINT8, BASE_DEC, NULL, 0,
22785       "Indicates the number of beacon intervals between successive DTIMs", HFILL }},
22786
22787     {&hf_ieee80211_tim_bmapctl,
22788      {"Bitmap control", "wlan.tim.bmapctl",
22789       FT_UINT8, BASE_HEX, NULL, 0,
22790       NULL, HFILL }},
22791
22792     {&hf_ieee80211_tim_bmapctl_mcast,
22793      {"Multicast", "wlan.tim.bmapctl.multicast",
22794       FT_BOOLEAN, 8, NULL, 0x1,
22795       "Contains the Traffic Indicator bit associated with Association ID 0", HFILL }},
22796
22797     {&hf_ieee80211_tim_bmapctl_offset,
22798      {"Bitmap Offset", "wlan.tim.bmapctl.offset",
22799       FT_UINT8, BASE_HEX, NULL, 0xFE,
22800       NULL, HFILL }},
22801
22802     {&hf_ieee80211_tim_partial_virtual_bitmap,
22803      {"Partial Virtual Bitmap", "wlan.tim.partial_virtual_bitmap",
22804       FT_BYTES, BASE_NONE, NULL, 0x0,
22805       NULL, HFILL }},
22806
22807     {&hf_ieee80211_tim_aid,
22808      {"Association ID", "wlan.tim.aid",
22809       FT_UINT8, BASE_HEX, NULL, 0x0,
22810       NULL, HFILL }},
22811
22812     {&hf_ieee80211_tag_ibss_atim_window,
22813      {"Atim Windows", "wlan.ibss.atim_windows",
22814       FT_UINT16, BASE_HEX, NULL, 0x0,
22815       "Contains the ATIM Window length in TU", HFILL }},
22816
22817     {&hf_ieee80211_tag_country_info_code,
22818      {"Code", "wlan.country_info.code",
22819       FT_STRING, BASE_NONE, NULL, 0x0,
22820       NULL, HFILL }},
22821
22822     {&hf_ieee80211_tag_country_info_env,
22823      {"Environment", "wlan.country_info.environment",
22824       FT_UINT8, BASE_HEX, VALS(environment_vals), 0x0,
22825       NULL, HFILL }},
22826
22827     {&hf_ieee80211_tag_country_info_pad,
22828      {"Padding", "wlan.country_info.padding",
22829       FT_BYTES, BASE_NONE, NULL, 0x0,
22830       NULL, HFILL }},
22831
22832     {&hf_ieee80211_tag_country_info_fnm,
22833      {"Country Info", "wlan.country_info.fnm",
22834       FT_NONE, BASE_NONE, NULL, 0x0,
22835       NULL, HFILL }},
22836
22837     {&hf_ieee80211_tag_country_info_fnm_fcn,
22838      {"First Channel Number", "wlan.country_info.fnm.fcn",
22839       FT_UINT8, BASE_DEC, NULL, 0x0,
22840       NULL, HFILL }},
22841
22842     {&hf_ieee80211_tag_country_info_fnm_nc,
22843      {"Number of Channels", "wlan.country_info.fnm.nc",
22844       FT_UINT8, BASE_DEC, NULL, 0x0,
22845       NULL, HFILL }},
22846
22847     {&hf_ieee80211_tag_country_info_fnm_mtpl,
22848      {"Maximum Transmit Power Level (in dBm)", "wlan.country_info.fnm.mtpl",
22849       FT_UINT8, BASE_DEC, NULL, 0x0,
22850       NULL, HFILL }},
22851
22852     {&hf_ieee80211_tag_country_info_rrc,
22853      {"Country Info", "wlan.country_info.rrc",
22854       FT_NONE, BASE_NONE, NULL, 0x0,
22855       NULL, HFILL }},
22856
22857     {&hf_ieee80211_tag_country_info_rrc_oei,
22858      {"Operating Extension Identifier", "wlan.country_info.rrc.oei",
22859       FT_UINT8, BASE_DEC, NULL, 0x0,
22860       NULL, HFILL }},
22861
22862     {&hf_ieee80211_tag_country_info_rrc_oc,
22863      {"Operating Class", "wlan.country_info.rrc.oc",
22864       FT_UINT8, BASE_DEC, NULL, 0x0,
22865       NULL, HFILL }},
22866
22867     {&hf_ieee80211_tag_country_info_rrc_cc,
22868      {"Coverage Class", "wlan.country_info.rrc.cc",
22869       FT_UINT8, BASE_DEC, NULL, 0x0,
22870       NULL, HFILL }},
22871
22872     {&hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
22873      {"Prime Radix", "wlan.fh_hopping.parameter.prime_radix",
22874       FT_UINT8, BASE_DEC, NULL, 0x0,
22875       NULL, HFILL }},
22876
22877     {&hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
22878      {"Number of Channels", "wlan.fh_hopping.parameter.nb_channels",
22879       FT_UINT8, BASE_DEC, NULL, 0x0,
22880       NULL, HFILL }},
22881
22882     {&hf_ieee80211_tag_fh_hopping_table_flag,
22883      {"Flag", "wlan.fh_hopping.table.flag",
22884       FT_UINT8, BASE_HEX, NULL, 0x0,
22885       "Indicates that a Random Table is present when the value is 1", HFILL }},
22886
22887     {&hf_ieee80211_tag_fh_hopping_table_number_of_sets,
22888      {"Number of Sets", "wlan.fh_hopping.table.number_of_sets",
22889       FT_UINT8, BASE_DEC, NULL, 0x0,
22890       "Indicates the total number of sets within the hopping patterns", HFILL }},
22891
22892     {&hf_ieee80211_tag_fh_hopping_table_modulus,
22893      {"Modulus", "wlan.fh_hopping.table.modulus",
22894       FT_UINT8, BASE_HEX, NULL, 0x0,
22895       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
22896
22897     {&hf_ieee80211_tag_fh_hopping_table_offset,
22898      {"Offset", "wlan.fh_hopping.table.offset",
22899       FT_UINT8, BASE_HEX, NULL, 0x0,
22900       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
22901
22902     {&hf_ieee80211_tag_fh_hopping_random_table,
22903      {"Random Table", "wlan.fh_hopping.table.random_table",
22904       FT_UINT16, BASE_HEX, NULL, 0x0,
22905       "It is a vector of single octet values that indicate the random sequence to be followed during a hopping sequence", HFILL }},
22906
22907     {&hf_ieee80211_tag_request,
22908      {"Requested Element ID", "wlan.tag.request",
22909       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
22910       "The list of elements that are to be included in the responding STA Probe Response frame", HFILL }},
22911
22912     {&hf_ieee80211_tclas_up,
22913      {"User Priority", "wlan.tclas.user_priority",
22914       FT_UINT8, BASE_DEC, NULL, 0,
22915       "Contains the value of the UP of the associated MSDUs", HFILL }},
22916
22917     {&hf_ieee80211_tclas_class_type,
22918      {"Classifier Type", "wlan.tclas.class_type",
22919       FT_UINT8, BASE_DEC, VALS(classifier_type), 0,
22920       "Specifies the type of classifier parameters", HFILL }},
22921
22922     {&hf_ieee80211_tclas_class_mask,
22923      {"Classifier Mask", "wlan.tclas.class_mask",
22924       FT_UINT8, BASE_HEX,  NULL, 0,
22925       "Specifies a bitmap where bits that are set to 1 identify a subset of the classifier parameters", HFILL }},
22926
22927     {&hf_ieee80211_tclas_class_mask0_src_addr,
22928      {"Source Address", "wlan.tclas.class_mask.src_addr",
22929       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
22930
22931     {&hf_ieee80211_tclas_class_mask0_dst_addr,
22932      {"Destination Address", "wlan.tclas.class_mask.dst_addr",
22933       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
22934
22935     {&hf_ieee80211_tclas_class_mask0_type,
22936      {"Type", "wlan.tclas.class_mask.type",
22937       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
22938
22939     {&hf_ieee80211_tclas_class_mask1_ver,
22940      {"Version", "wlan.tclas.class_mask.version",
22941       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
22942
22943     {&hf_ieee80211_tclas_class_mask1_src_ip,
22944      {"Source IP Address", "wlan.tclas.class_mask.src_ip",
22945       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
22946
22947     {&hf_ieee80211_tclas_class_mask1_dst_ip,
22948      {"Destination IP Address", "wlan.tclas.class_mask.dst_ip",
22949       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
22950
22951     {&hf_ieee80211_tclas_class_mask1_src_port,
22952      {"Source Port", "wlan.tclas.class_mask.src_port",
22953       FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL }},
22954
22955     {&hf_ieee80211_tclas_class_mask1_dst_port,
22956      {"Destination Port", "wlan.tclas.class_mask.dst_port",
22957       FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL }},
22958
22959     {&hf_ieee80211_tclas_class_mask1_ipv4_dscp,
22960      {"DSCP", "wlan.tclas.class_mask.dscp",
22961       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
22962
22963     {&hf_ieee80211_tclas_class_mask1_ipv4_proto,
22964      {"Protocol", "wlan.tclas.class_mask.proto",
22965       FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL }},
22966
22967     {&hf_ieee80211_tclas_class_mask1_ipv6_flow,
22968      {"Flow Label", "wlan.tclas.class_mask.flow_label",
22969       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
22970
22971     {&hf_ieee80211_tclas_class_mask2_tci,
22972      {"802.1Q CLAN TCI", "wlan.tclas.class_mask.tci",
22973       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
22974
22975     {&hf_ieee80211_tclas_src_mac_addr,
22976      {"Source address", "wlan.tclas.src_mac_addr",
22977       FT_ETHER, BASE_NONE, NULL, 0,
22978       "Classifier Parameters Ethernet Type", HFILL }},
22979
22980     {&hf_ieee80211_tclas_dst_mac_addr,
22981      {"Destination address", "wlan.tclas.dat_mac_addr",
22982       FT_ETHER, BASE_NONE, NULL, 0,
22983       NULL, HFILL }},
22984
22985     {&hf_ieee80211_tclas_ether_type,
22986      {"Ethernet Type", "wlan.tclas.ether_type",
22987       FT_UINT8, BASE_DEC, NULL, 0,
22988       NULL, HFILL }},
22989
22990     {&hf_ieee80211_tclas_version,
22991      {"IP Version", "wlan.tclas.version",
22992       FT_UINT8, BASE_DEC, NULL, 0,
22993       NULL, HFILL }},
22994
22995     {&hf_ieee80211_tclas_ipv4_src,
22996      {"IPv4 Src Addr", "wlan.tclas.ipv4_src",
22997       FT_IPv4, BASE_NONE, NULL, 0,
22998       NULL, HFILL }},
22999
23000     {&hf_ieee80211_tclas_ipv4_dst,
23001      {"IPv4 Dst Addr", "wlan.tclas.ipv4_dst",
23002       FT_IPv4, BASE_NONE, NULL, 0,
23003       NULL, HFILL }},
23004
23005     {&hf_ieee80211_tclas_src_port,
23006      {"Source Port", "wlan.tclas.src_port",
23007       FT_UINT16, BASE_DEC, NULL, 0,
23008       NULL, HFILL }},
23009
23010     {&hf_ieee80211_tclas_dst_port,
23011      {"Destination Port", "wlan.tclas.dst_port",
23012       FT_UINT16, BASE_DEC, NULL, 0,
23013       NULL, HFILL }},
23014
23015     {&hf_ieee80211_tclas_dscp,
23016      {"IPv4 DSCP", "wlan.tclas.dscp",
23017       FT_UINT8, BASE_HEX, NULL, 0,
23018       "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
23019
23020     {&hf_ieee80211_tclas_protocol,
23021      {"Protocol", "wlan.tclas.protocol",
23022       FT_UINT8, BASE_HEX, NULL, 0,
23023       "IPv4 Protocol", HFILL }},
23024
23025     {&hf_ieee80211_tclas_ipv6_src,
23026      {"IPv6 Src Addr", "wlan.tclas.ipv6_src",
23027       FT_IPv6, BASE_NONE, NULL, 0,
23028       NULL, HFILL }},
23029
23030     {&hf_ieee80211_tclas_ipv6_dst,
23031      {"IPv6 Dst Addr", "wlan.tclas.ipv6_dst",
23032       FT_IPv6, BASE_NONE, NULL, 0,
23033       NULL, HFILL }},
23034
23035     {&hf_ieee80211_tclas_flow,
23036      {"Flow Label", "wlan.tclas.flow",
23037       FT_UINT24, BASE_HEX, NULL, 0,
23038       "IPv6 Flow Label", HFILL }},
23039
23040     {&hf_ieee80211_tclas_tag_type,
23041      {"802.1Q Tag Type", "wlan.tclas.tag_type",
23042       FT_UINT16, BASE_HEX, NULL, 0,
23043       NULL, HFILL }},
23044
23045     {&hf_ieee80211_tag_challenge_text,
23046      {"Challenge Text", "wlan.tag.challenge_text",
23047       FT_BYTES, BASE_NONE, NULL, 0,
23048       NULL, HFILL }},
23049
23050     {&hf_ieee80211_rsn_version,
23051      {"RSN Version", "wlan.rsn.version",
23052       FT_UINT16, BASE_DEC, NULL, 0,
23053       "Indicates the version number of the RSNA protocol", HFILL }},
23054
23055     {&hf_ieee80211_rsn_gcs,
23056      {"Group Cipher Suite", "wlan.rsn.gcs",
23057       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gcs_base_custom), 0,
23058       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
23059
23060     {&hf_ieee80211_rsn_gcs_oui,
23061      {"Group Cipher Suite OUI", "wlan.rsn.gcs.oui",
23062       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
23063       NULL, HFILL }},
23064
23065     {&hf_ieee80211_rsn_gcs_type,
23066      {"Group Cipher Suite type", "wlan.rsn.gcs.type",
23067       FT_UINT8, BASE_DEC, NULL, 0,
23068       NULL, HFILL }},
23069
23070     {&hf_ieee80211_rsn_gcs_80211_type,
23071      {"Group Cipher Suite type", "wlan.rsn.gcs.type",
23072       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
23073       NULL, HFILL }},
23074
23075     {&hf_ieee80211_rsn_pcs_count,
23076      {"Pairwise Cipher Suite Count", "wlan.rsn.pcs.count",
23077       FT_UINT16, BASE_DEC,  NULL, 0,
23078       "Indicates the number of pairwise cipher suite selectors that are contained in the Pairwise Cipher Suite List", HFILL }},
23079
23080     {&hf_ieee80211_rsn_pcs_list,
23081      {"Pairwise Cipher Suite List", "wlan.rsn.pcs.list",
23082       FT_NONE, BASE_NONE, NULL, 0,
23083       "Contains a series of cipher suite selectors that indicate the pairwisecipher suites", HFILL }},
23084
23085     {&hf_ieee80211_rsn_pcs,
23086      {"Pairwise Cipher Suite", "wlan.rsn.pcs",
23087       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_pcs_base_custom), 0,
23088       NULL, HFILL }},
23089
23090     {&hf_ieee80211_rsn_pcs_oui,
23091      {"Pairwise Cipher Suite OUI", "wlan.rsn.pcs.oui",
23092       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
23093       NULL, HFILL }},
23094
23095     {&hf_ieee80211_rsn_pcs_type,
23096      {"Pairwise Cipher Suite type", "wlan.rsn.pcs.type",
23097       FT_UINT8, BASE_DEC, NULL, 0,
23098       NULL, HFILL }},
23099
23100     {&hf_ieee80211_rsn_pcs_80211_type,
23101      {"Pairwise Cipher Suite type", "wlan.rsn.pcs.type",
23102       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
23103       NULL, HFILL }},
23104
23105     {&hf_ieee80211_rsn_akms_count,
23106      {"Auth Key Management (AKM) Suite Count", "wlan.rsn.akms.count",
23107       FT_UINT16, BASE_DEC, NULL, 0,
23108       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
23109
23110     {&hf_ieee80211_rsn_akms_list,
23111      {"Auth Key Management (AKM) List", "wlan.rsn.akms.list",
23112       FT_NONE, BASE_NONE, NULL, 0,
23113       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
23114
23115     {&hf_ieee80211_rsn_akms,
23116      {"Auth Key Management (AKM) Suite", "wlan.rsn.akms",
23117       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_akms_base_custom), 0,
23118       NULL, HFILL }},
23119
23120     {&hf_ieee80211_rsn_akms_oui,
23121      {"Auth Key Management (AKM) OUI", "wlan.rsn.akms.oui",
23122       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
23123       NULL, HFILL }},
23124
23125     {&hf_ieee80211_rsn_akms_type,
23126      {"Auth Key Management (AKM) type", "wlan.rsn.akms.type",
23127       FT_UINT8, BASE_DEC, NULL, 0,
23128       NULL, HFILL }},
23129
23130     {&hf_ieee80211_rsn_akms_80211_type,
23131      {"Auth Key Management (AKM) type", "wlan.rsn.akms.type",
23132       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_keymgmt_vals), 0,
23133       NULL, HFILL }},
23134
23135     {&hf_ieee80211_rsn_cap,
23136      {"RSN Capabilities", "wlan.rsn.capabilities",
23137       FT_UINT16, BASE_HEX, NULL, 0,
23138       "RSN Capability information", HFILL }},
23139
23140     {&hf_ieee80211_rsn_cap_preauth,
23141      {"RSN Pre-Auth capabilities", "wlan.rsn.capabilities.preauth",
23142       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001,
23143       NULL, HFILL }},
23144
23145     {&hf_ieee80211_rsn_cap_no_pairwise,
23146      {"RSN No Pairwise capabilities", "wlan.rsn.capabilities.no_pairwise",
23147       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002,
23148       NULL, HFILL }},
23149
23150     {&hf_ieee80211_rsn_cap_ptksa_replay_counter,
23151      {"RSN PTKSA Replay Counter capabilities", "wlan.rsn.capabilities.ptksa_replay_counter",
23152       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C,
23153       NULL, HFILL }},
23154
23155     {&hf_ieee80211_rsn_cap_gtksa_replay_counter,
23156      {"RSN GTKSA Replay Counter capabilities", "wlan.rsn.capabilities.gtksa_replay_counter",
23157       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030,
23158       NULL, HFILL }},
23159
23160     {&hf_ieee80211_rsn_cap_mfpr,
23161      {"Management Frame Protection Required", "wlan.rsn.capabilities.mfpr",
23162       FT_BOOLEAN, 16, NULL, 0x0040,
23163       NULL, HFILL }},
23164
23165     {&hf_ieee80211_rsn_cap_mfpc,
23166      {"Management Frame Protection Capable", "wlan.rsn.capabilities.mfpc",
23167       FT_BOOLEAN, 16, NULL, 0x0080,
23168       NULL, HFILL }},
23169
23170     {&hf_ieee80211_rsn_cap_jmr,
23171      {"Joint Multi-band RSNA", "wlan.rsn.capabilities.jmr",
23172       FT_BOOLEAN, 16, NULL, 0x0100,
23173       NULL, HFILL }},
23174
23175     {&hf_ieee80211_rsn_cap_peerkey,
23176      {"PeerKey Enabled", "wlan.rsn.capabilities.peerkey",
23177       FT_BOOLEAN, 16, NULL, 0x0200,
23178       NULL, HFILL }},
23179
23180     {&hf_ieee80211_rsn_pmkid_count,
23181      {"PMKID Count", "wlan.rsn.pmkid.count",
23182       FT_UINT16, BASE_DEC, NULL, 0,
23183       "Indicates the number of PMKID  selectors that are contained in the PMKID Suite List", HFILL }},
23184
23185     {&hf_ieee80211_rsn_pmkid_list,
23186      {"PMKID List", "wlan.rsn.pmkid.list",
23187       FT_NONE, BASE_NONE, NULL, 0,
23188       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
23189
23190     {&hf_ieee80211_rsn_pmkid,
23191      {"PMKID", "wlan.pmkid.akms",
23192       FT_BYTES, BASE_NONE, NULL, 0,
23193       NULL, HFILL }},
23194
23195     {&hf_ieee80211_rsn_gmcs,
23196      {"Group Management Cipher Suite", "wlan.rsn.gmcs",
23197       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gmcs_base_custom), 0,
23198       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
23199
23200     {&hf_ieee80211_rsn_gmcs_oui,
23201      {"Group Management Cipher Suite OUI", "wlan.rsn.gmcs.oui",
23202       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
23203       NULL, HFILL }},
23204
23205     {&hf_ieee80211_rsn_gmcs_type,
23206      {"Group Management Cipher Suite type", "wlan.rsn.gmcs.type",
23207       FT_UINT8, BASE_DEC, NULL, 0,
23208       NULL, HFILL }},
23209
23210     {&hf_ieee80211_rsn_gmcs_80211_type,
23211      {"Group Management Cipher Suite type", "wlan.rsn.gmcs.type",
23212       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
23213       NULL, HFILL }},
23214
23215     {&hf_ieee80211_ht_pren_type,
23216      {"802.11n (Pre) Type", "wlan.vs.pren.type",
23217       FT_UINT8, BASE_DEC, VALS(ieee80211_ht_pren_type_vals), 0,
23218       "Vendor Specific HT Type", HFILL }},
23219     {&hf_ieee80211_ht_pren_unknown,
23220      {"802.11n (Pre) Unknown Data", "wlan.vs.pren.unknown_data",
23221       FT_BYTES, BASE_NONE, NULL, 0,
23222       NULL, HFILL }},
23223
23224     {&hf_ieee80211_ht_cap,
23225      {"HT Capabilities Info", "wlan.ht.capabilities",
23226       FT_UINT16, BASE_HEX, NULL, 0,
23227       "HT Capabilities information", HFILL }},
23228
23229     {&hf_ieee80211_ht_vs_cap,
23230      {"HT Capabilities Info (VS)", "wlan.vs.ht.capabilities",
23231       FT_UINT16, BASE_HEX, NULL, 0,
23232       "Vendor Specific HT Capabilities information", HFILL }},
23233
23234     {&hf_ieee80211_ht_ldpc_coding,
23235      {"HT LDPC coding capability", "wlan.ht.capabilities.ldpccoding",
23236       FT_BOOLEAN, 16, TFS(&ht_ldpc_coding_flag), 0x0001,
23237       NULL, HFILL }},
23238
23239     {&hf_ieee80211_ht_chan_width,
23240      {"HT Support channel width", "wlan.ht.capabilities.width",
23241       FT_BOOLEAN, 16, TFS(&ht_chan_width_flag), 0x0002,
23242       NULL, HFILL }},
23243
23244     {&hf_ieee80211_ht_sm_pwsave,
23245      {"HT SM Power Save", "wlan.ht.capabilities.sm",
23246       FT_UINT16, BASE_HEX, VALS(ht_sm_pwsave_flag), 0x000c,
23247       NULL, HFILL }},
23248
23249     {&hf_ieee80211_ht_green,
23250      {"HT Green Field", "wlan.ht.capabilities.green",
23251       FT_BOOLEAN, 16, TFS(&ht_green_flag), 0x0010,
23252       NULL, HFILL }},
23253
23254     {&hf_ieee80211_ht_short20,
23255      {"HT Short GI for 20MHz", "wlan.ht.capabilities.short20",
23256       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0020,
23257       NULL, HFILL }},
23258
23259     {&hf_ieee80211_ht_short40,
23260      {"HT Short GI for 40MHz", "wlan.ht.capabilities.short40",
23261       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0040,
23262       NULL, HFILL }},
23263
23264     {&hf_ieee80211_ht_tx_stbc,
23265      {"HT Tx STBC", "wlan.ht.capabilities.txstbc",
23266       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0080,
23267       NULL, HFILL }},
23268
23269     {&hf_ieee80211_ht_rx_stbc,
23270      {"HT Rx STBC", "wlan.ht.capabilities.rxstbc",
23271       FT_UINT16, BASE_HEX, VALS(ht_rx_stbc_flag), 0x0300,
23272       "HT Tx STBC", HFILL }},
23273
23274     {&hf_ieee80211_ht_delayed_block_ack,
23275      {"HT Delayed Block ACK", "wlan.ht.capabilities.delayedblockack",
23276       FT_BOOLEAN, 16, TFS(&ht_delayed_block_ack_flag), 0x0400,
23277       NULL, HFILL }},
23278
23279     {&hf_ieee80211_ht_max_amsdu,
23280      {"HT Max A-MSDU length", "wlan.ht.capabilities.amsdu",
23281       FT_BOOLEAN, 16, TFS(&ht_max_amsdu_flag), 0x0800,
23282       NULL, HFILL }},
23283
23284     {&hf_ieee80211_ht_dss_cck_40,
23285      {"HT DSSS/CCK mode in 40MHz", "wlan.ht.capabilities.dsscck",
23286       FT_BOOLEAN, 16, TFS(&ht_dss_cck_40_flag), 0x1000,
23287       "HT DSS/CCK mode in 40MHz", HFILL }},
23288
23289     {&hf_ieee80211_ht_psmp,
23290      {"HT PSMP Support", "wlan.ht.capabilities.psmp",
23291       FT_BOOLEAN, 16, TFS(&ht_psmp_flag), 0x2000,
23292       NULL, HFILL }},
23293
23294     {&hf_ieee80211_ht_40_mhz_intolerant,
23295      {"HT Forty MHz Intolerant", "wlan.ht.capabilities.40mhzintolerant",
23296       FT_BOOLEAN, 16, TFS(&ht_40_mhz_intolerant_flag), 0x4000,
23297       NULL, HFILL }},
23298
23299     {&hf_ieee80211_ht_l_sig,
23300      {"HT L-SIG TXOP Protection support", "wlan.ht.capabilities.lsig",
23301       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x8000,
23302       NULL, HFILL }},
23303
23304     {&hf_ieee80211_ext_bss_mu_mimo_capable_sta_count,
23305      {"MU-MIMO Capable STA Count", "wlan.ext_bss.mu_mimo_capable_sta_count",
23306       FT_UINT16, BASE_DEC, NULL, 0,
23307       NULL, HFILL }},
23308
23309     {&hf_ieee80211_ext_bss_ss_underutilization,
23310      {"Spatial Stream Underutilization", "wlan.ext_bss.ss_underutilization",
23311       FT_UINT8, BASE_HEX, NULL, 0,
23312       NULL, HFILL }},
23313
23314     {&hf_ieee80211_ext_bss_observable_sec_20mhz_utilization,
23315      {"Observable Secondary 20MHz Utilization", "wlan.ext_bss.observable_sec_20mhz_utilization",
23316       FT_UINT8, BASE_HEX, NULL, 0,
23317       NULL, HFILL }},
23318
23319     {&hf_ieee80211_ext_bss_observable_sec_40mhz_utilization,
23320      {"Observable Secondary 40MHz Utilization", "wlan.ext_bss.observable_sec_40mhz_utilization",
23321       FT_UINT8, BASE_HEX, NULL, 0,
23322       NULL, HFILL }},
23323
23324     {&hf_ieee80211_ext_bss_observable_sec_80mhz_utilization,
23325      {"Observable Secondary 80MHz Utilization", "wlan.ext_bss.observable_sec_80mhz_utilization",
23326       FT_UINT8, BASE_HEX, NULL, 0,
23327       NULL, HFILL }},
23328
23329     {&hf_ieee80211_wide_bw_new_channel_width,
23330      {"New Channel Width", "wlan.wide_bw.new_channel_width",
23331       FT_UINT8, BASE_HEX, VALS(vht_operation_info_channel_width), 0x0,
23332       NULL, HFILL }},
23333
23334     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment0,
23335      {"New Channel Center Frequency Segment 0", "wlan.wide_bw.new_channel_center_freq_segment0",
23336       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
23337       NULL, HFILL }},
23338
23339     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment1,
23340      {"New Channel Center Frequency Segment 1", "wlan.wide_bw.new_channel_center_freq_segment1",
23341       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
23342       NULL, HFILL }},
23343
23344     {&hf_ieee80211_operat_notification_mode,
23345      {"Operating Mode Notification", "wlan.operat_notification_mode",
23346       FT_UINT8, BASE_HEX, NULL, 0x0,
23347       NULL, HFILL }},
23348
23349     {&hf_ieee80211_operat_mode_field_channel_width,
23350      {"Channel Width", "wlan.operat_mode_field.channelwidth",
23351       FT_UINT8, BASE_HEX, VALS(operating_mode_field_channel_width), 0x03,
23352       NULL, HFILL }},
23353
23354     {&hf_ieee80211_operat_mode_field_reserved,
23355      {"Reserved", "wlan.operat_mode_field.reserved",
23356       FT_UINT8, BASE_HEX, NULL, 0x0C,
23357       NULL, HFILL }},
23358
23359     {&hf_ieee80211_operat_mode_field_rxnss,
23360      {"Rx NSS", "wlan.operat_mode_field.rxnss",
23361       FT_UINT8, BASE_HEX, VALS(operat_mode_field_rxnss), 0x70,
23362       NULL, HFILL }},
23363
23364     {&hf_ieee80211_operat_mode_field_rxnsstype,
23365      {"Rx NSS Type", "wlan.operat_mode_field.rxnsstype",
23366       FT_UINT8, BASE_HEX, NULL, 0x80,
23367       "Indicate that the Rx NSS subfield carries the maximum number of spatial streams that the STA can receive", HFILL }},
23368
23369     {&hf_ieee80211_ampduparam,
23370      {"A-MPDU Parameters", "wlan.ht.ampduparam",
23371       FT_UINT8, BASE_HEX, NULL, 0,
23372       NULL, HFILL }},
23373
23374     {&hf_ieee80211_ampduparam_vs,
23375      {"A-MPDU Parameters (VS)", "wlan.vs.ht.ampduparam",
23376       FT_UINT8, BASE_HEX, NULL, 0,
23377       "Vendor Specific A-MPDU Parameters", HFILL }},
23378
23379     {&hf_ieee80211_ampduparam_mpdu,
23380      {"Maximum Rx A-MPDU Length", "wlan.ht.ampduparam.maxlength",
23381       FT_UINT8, BASE_HEX, 0, 0x03,
23382       NULL, HFILL }},
23383
23384     {&hf_ieee80211_ampduparam_mpdu_start_spacing,
23385      {"MPDU Density", "wlan.ht.ampduparam.mpdudensity",
23386       FT_UINT8, BASE_HEX, VALS(ampduparam_mpdu_start_spacing_flags), 0x1c,
23387       NULL, HFILL }},
23388
23389     {&hf_ieee80211_ampduparam_reserved,
23390      {"Reserved", "wlan.ht.ampduparam.reserved",
23391       FT_UINT8, BASE_HEX, NULL, 0xE0,
23392       NULL, HFILL }},
23393
23394     {&hf_ieee80211_mcsset,
23395      {"Rx Supported Modulation and Coding Scheme Set", "wlan.ht.mcsset",
23396       FT_STRING, BASE_NONE, NULL, 0,
23397       NULL, HFILL }},
23398
23399     {&hf_ieee80211_mcsset_vs,
23400      {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan.vs.ht.mcsset",
23401       FT_STRING, BASE_NONE, NULL, 0,
23402       "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
23403
23404     {&hf_ieee80211_mcsset_rx_bitmask,
23405      {"Rx Modulation and Coding Scheme (One bit per modulation)", "wlan.ht.mcsset.rxbitmask",
23406       FT_NONE, BASE_NONE, NULL, 0,
23407       "One bit per modulation", HFILL }},
23408
23409     {&hf_ieee80211_mcsset_rx_bitmask_0to7,
23410      {"Rx Bitmask Bits 0-7", "wlan.ht.mcsset.rxbitmask.0to7",
23411       FT_UINT32, BASE_HEX, 0, 0x000000ff,
23412       NULL, HFILL }},
23413
23414     {&hf_ieee80211_mcsset_rx_bitmask_8to15,
23415      {"Rx Bitmask Bits 8-15", "wlan.ht.mcsset.rxbitmask.8to15",
23416       FT_UINT32, BASE_HEX, 0, 0x0000ff00,
23417       NULL, HFILL }},
23418
23419     {&hf_ieee80211_mcsset_rx_bitmask_16to23,
23420      {"Rx Bitmask Bits 16-23", "wlan.ht.mcsset.rxbitmask.16to23",
23421       FT_UINT32, BASE_HEX, 0, 0x00ff0000,
23422       NULL, HFILL }},
23423
23424     {&hf_ieee80211_mcsset_rx_bitmask_24to31,
23425      {"Rx Bitmask Bits 24-31", "wlan.ht.mcsset.rxbitmask.24to31",
23426       FT_UINT32, BASE_HEX, 0, 0xff000000,
23427       NULL, HFILL }},
23428
23429     {&hf_ieee80211_mcsset_rx_bitmask_32,
23430      {"Rx Bitmask Bit 32", "wlan.ht.mcsset.rxbitmask.32",
23431       FT_UINT32, BASE_HEX, 0, 0x000001,
23432       NULL, HFILL }},
23433
23434     {&hf_ieee80211_mcsset_rx_bitmask_33to38,
23435      {"Rx Bitmask Bits 33-38", "wlan.ht.mcsset.rxbitmask.33to38",
23436       FT_UINT32, BASE_HEX, 0, 0x00007e,
23437       NULL, HFILL }},
23438
23439     {&hf_ieee80211_mcsset_rx_bitmask_39to52,
23440      {"Rx Bitmask Bits 39-52", "wlan.ht.mcsset.rxbitmask.39to52",
23441       FT_UINT32, BASE_HEX, 0, 0x1fff80,
23442       NULL, HFILL }},
23443
23444     {&hf_ieee80211_mcsset_rx_bitmask_53to76,
23445      {"Rx Bitmask Bits 53-76", "wlan.ht.mcsset.rxbitmask.53to76",
23446       FT_UINT32, BASE_HEX, 0, 0x1fffffe0,
23447       NULL, HFILL }},
23448
23449     {&hf_ieee80211_mcsset_highest_data_rate,
23450      {"Highest Supported Data Rate", "wlan.ht.mcsset.highestdatarate",
23451       FT_UINT16, BASE_HEX, 0, 0x03ff,
23452       NULL, HFILL }},
23453
23454     {&hf_ieee80211_mcsset_tx_mcs_set_defined,
23455      {"Tx Supported MCS Set", "wlan.ht.mcsset.txsetdefined",
23456       FT_BOOLEAN, 16, TFS(&tfs_defined_not_defined), 0x0001,
23457       NULL, HFILL }},
23458
23459     {&hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal,
23460      {"Tx and Rx MCS Set", "wlan.ht.mcsset.txrxmcsnotequal",
23461       FT_BOOLEAN, 16, TFS(&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
23462       NULL, HFILL }},
23463
23464     {&hf_ieee80211_mcsset_tx_max_spatial_streams,
23465      {"Maximum Number of Tx Spatial Streams Supported", "wlan.ht.mcsset.txmaxss",
23466       FT_UINT16, BASE_HEX, 0 , 0x000c,
23467       NULL, HFILL }},
23468
23469     {&hf_ieee80211_mcsset_tx_unequal_modulation,
23470      {"Unequal Modulation", "wlan.ht.mcsset.txunequalmod",
23471       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0010,
23472       NULL, HFILL }},
23473
23474     {&hf_ieee80211_htex_cap,
23475      {"HT Extended Capabilities", "wlan.htex.capabilities",
23476       FT_UINT16, BASE_HEX, NULL, 0,
23477       "HT Extended Capability information", HFILL }},
23478
23479     {&hf_ieee80211_htex_vs_cap,
23480      {"HT Extended Capabilities (VS)", "wlan.vs.htex.capabilities",
23481       FT_UINT16, BASE_HEX, NULL, 0,
23482       "Vendor Specific HT Extended Capability information", HFILL }},
23483
23484     {&hf_ieee80211_htex_pco,
23485      {"Transmitter supports PCO", "wlan.htex.capabilities.pco",
23486       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0001,
23487       NULL, HFILL }},
23488
23489     {&hf_ieee80211_htex_transtime,
23490      {"Time needed to transition between 20MHz and 40MHz", "wlan.htex.capabilities.transtime",
23491       FT_UINT16, BASE_HEX, VALS(htex_transtime_flags), 0x0006,
23492       NULL, HFILL }},
23493
23494     {&hf_ieee80211_htex_mcs,
23495      {"MCS Feedback capability", "wlan.htex.capabilities.mcs",
23496       FT_UINT16, BASE_HEX, VALS(htex_mcs_flags), 0x0300,
23497       NULL, HFILL }},
23498
23499     {&hf_ieee80211_htex_htc_support,
23500      {"High Throughput", "wlan.htex.capabilities.htc",
23501       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0400,
23502       NULL, HFILL }},
23503
23504     {&hf_ieee80211_htex_rd_responder,
23505      {"Reverse Direction Responder", "wlan.htex.capabilities.rdresponder",
23506       FT_BOOLEAN, 16, TFS(&tfs_supported_not_supported), 0x0800,
23507       NULL, HFILL }},
23508
23509     {&hf_ieee80211_txbf,
23510      {"Transmit Beam Forming (TxBF) Capabilities", "wlan.txbf",
23511       FT_UINT32, BASE_HEX, NULL, 0,
23512       NULL, HFILL }},
23513
23514     {&hf_ieee80211_txbf_vs,
23515      {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan.vs.txbf",
23516       FT_UINT32, BASE_HEX, NULL, 0,
23517       "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
23518
23519     {&hf_ieee80211_txbf_cap,
23520      {"Transmit Beamforming", "wlan.txbf.txbf",
23521       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
23522       NULL, HFILL }},
23523
23524     {&hf_ieee80211_txbf_rcv_ssc,
23525      {"Receive Staggered Sounding", "wlan.txbf.rxss",
23526       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
23527       NULL, HFILL }},
23528
23529     {&hf_ieee80211_txbf_tx_ssc,
23530      {"Transmit Staggered Sounding", "wlan.txbf.txss",
23531       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
23532       NULL, HFILL }},
23533
23534     {&hf_ieee80211_txbf_rcv_ndp,
23535      {"Receive Null Data packet (NDP)", "wlan.txbf.rxndp",
23536       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
23537       NULL, HFILL }},
23538
23539     {&hf_ieee80211_txbf_tx_ndp,
23540      {"Transmit Null Data packet (NDP)", "wlan.txbf.txndp",
23541       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
23542       NULL, HFILL }},
23543
23544     {&hf_ieee80211_txbf_impl_txbf,
23545      {"Implicit TxBF capable", "wlan.txbf.impltxbf",
23546       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
23547       "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
23548
23549     {&hf_ieee80211_txbf_calib,
23550      {"Calibration", "wlan.txbf.calibration",
23551       FT_UINT32, BASE_HEX, VALS(txbf_calib_flag), 0x000000c0,
23552       NULL, HFILL }},
23553
23554     {&hf_ieee80211_txbf_expl_csi,
23555      {"STA can apply TxBF using CSI explicit feedback", "wlan.txbf.csi",
23556       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
23557       "Station can apply TxBF using CSI explicit feedback", HFILL }},
23558
23559     {&hf_ieee80211_txbf_expl_uncomp_fm,
23560      {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan.txbf.fm.uncompressed.tbf",
23561       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
23562       "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
23563
23564     {&hf_ieee80211_txbf_expl_comp_fm,
23565      {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan.txbf.fm.compressed.tbf",
23566       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
23567       "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
23568
23569     {&hf_ieee80211_txbf_expl_bf_csi,
23570      {"Receiver can return explicit CSI feedback", "wlan.txbf.rcsi",
23571       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00001800,
23572       NULL, HFILL }},
23573
23574     {&hf_ieee80211_txbf_expl_uncomp_fm_feed,
23575      {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan.txbf.fm.uncompressed.rbf",
23576       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00006000,
23577       NULL, HFILL }},
23578
23579     {&hf_ieee80211_txbf_expl_comp_fm_feed,
23580      {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan.txbf.fm.compressed.bf",
23581       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00018000,
23582       "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
23583
23584     {&hf_ieee80211_txbf_min_group,
23585      {"Minimal grouping used for explicit feedback reports", "wlan.txbf.mingroup",
23586       FT_UINT32, BASE_HEX, VALS(txbf_min_group_flags), 0x00060000,
23587       NULL, HFILL }},
23588
23589     {&hf_ieee80211_vht_cap,
23590      {"VHT Capabilities Info", "wlan.vht.capabilities",
23591       FT_UINT32, BASE_HEX, NULL, 0,
23592       "VHT Capabilities information", HFILL }},
23593
23594     {&hf_ieee80211_vht_max_mpdu_length,
23595      {"Maximum MPDU Length", "wlan.vht.capabilities.maxmpdulength",
23596       FT_UINT32, BASE_HEX, VALS(vht_max_mpdu_length_flag), 0x00000003,
23597       "In Octets unit", HFILL }},
23598
23599     {&hf_ieee80211_vht_supported_chan_width_set,
23600      {"Supported Channel Width Set", "wlan.vht.capabilities.supportedchanwidthset",
23601       FT_UINT32, BASE_HEX, VALS(vht_supported_chan_width_set_flag), 0x0000000c,
23602       NULL, HFILL }},
23603
23604     {&hf_ieee80211_vht_rx_ldpc,
23605      {"Rx LDPC", "wlan.vht.capabilities.rxldpc",
23606       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
23607       NULL, HFILL }},
23608
23609     {&hf_ieee80211_vht_short_gi_for_80,
23610      {"Short GI for 80MHz", "wlan.vht.capabilities.short80",
23611       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
23612       NULL, HFILL }},
23613
23614     {&hf_ieee80211_vht_short_gi_for_160,
23615      {"Short GI for 160MHz and 80+80MHz", "wlan.vht.capabilities.short160",
23616       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
23617       NULL, HFILL }},
23618
23619     {&hf_ieee80211_vht_tx_stbc,
23620      {"Tx STBC", "wlan.vht.capabilities.txstbc",
23621       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
23622       NULL, HFILL }},
23623
23624     {&hf_ieee80211_vht_rx_stbc,
23625      {"Rx STBC", "wlan.vht.capabilities.rxstbc",
23626       FT_UINT32, BASE_HEX, VALS(vht_rx_stbc_flag), 0x00000700,
23627       NULL, HFILL }},
23628
23629     {&hf_ieee80211_vht_su_beamformer_cap,
23630      {"SU Beam-former Capable", "wlan.vht.capabilities.subeamformer",
23631       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
23632       NULL, HFILL }},
23633
23634     {&hf_ieee80211_vht_su_beamformee_cap,
23635      {"SU Beam-formee Capable", "wlan.vht.capabilities.subeamformee",
23636       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
23637       NULL, HFILL }},
23638
23639     {&hf_ieee80211_vht_beamformer_antennas,
23640      {"Compressed Steering Number of Beamformer Antennas Supported", "wlan.vht.capabilities.beamformerants",
23641       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x0000e000,
23642       NULL, HFILL }},
23643
23644     {&hf_ieee80211_vht_sounding_dimensions,
23645      {"Number of Sounding Dimensions", "wlan.vht.capabilities.soundingdimensions",
23646       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x00070000,
23647       NULL, HFILL }},
23648
23649     {&hf_ieee80211_vht_mu_beamformer_cap,
23650      {"MU Beam-former Capable", "wlan.vht.capabilities.mubeamformer",
23651       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
23652       NULL, HFILL }},
23653
23654     {&hf_ieee80211_vht_mu_beamformee_cap,
23655      {"MU Beam-formee Capable", "wlan.vht.capabilities.mubeamformee",
23656       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
23657       NULL, HFILL }},
23658
23659     {&hf_ieee80211_vht_txop_ps,
23660      {"VHT TXOP PS", "wlan.vht.capabilities.vhttxopps",
23661       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
23662       NULL, HFILL }},
23663
23664     {&hf_ieee80211_vht_var_htc_field,
23665      {"+HTC-VHT Capable (VHT variant HT Control field)", "wlan.vht.capabilities.vhthtc",
23666       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
23667       NULL, HFILL }},
23668
23669     {&hf_ieee80211_vht_max_ampdu,
23670      {"Max A-MPDU Length", "wlan.vht.capabilities.maxampdu",
23671       FT_UINT32, BASE_HEX, VALS(vht_max_ampdu_flag), 0x03800000,
23672       "In Octets unit", HFILL }},
23673
23674     {&hf_ieee80211_vht_link_adaptation_cap,
23675      {"VHT Link Adaptation", "wlan.vht.capabilities.linkadapt",
23676       FT_UINT32, BASE_HEX, VALS(vht_link_adapt_flag), 0x0c000000,
23677       NULL, HFILL }},
23678
23679     {&hf_ieee80211_vht_rx_pattern,
23680      {"Rx Antenna Pattern Consistency", "wlan.vht.capabilities.rxpatconsist",
23681       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x10000000,
23682       NULL, HFILL }},
23683
23684     {&hf_ieee80211_vht_tx_pattern,
23685      {"Tx Antenna Pattern Consistency", "wlan.vht.capabilities.txpatconsist",
23686       FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x20000000,
23687       NULL, HFILL }},
23688
23689     {&hf_ieee80211_vht_reserv,
23690      {"Reserved", "wlan.vht.reserved",
23691       FT_BOOLEAN, 32, NULL, 0xc0000000,
23692       NULL, HFILL }},
23693
23694     {&hf_ieee80211_vht_mcsset,
23695      {"VHT Supported MCS Set", "wlan.vht.mcsset",
23696       FT_NONE, BASE_NONE, NULL, 0,
23697       NULL, HFILL }},
23698
23699     {&hf_ieee80211_vht_mcsset_rx_mcs_map,
23700      {"Rx MCS Map", "wlan.vht.mcsset.rxmcsmap",
23701       FT_UINT16, BASE_HEX, NULL, 0,
23702       NULL, HFILL }},
23703
23704     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
23705      {"Rx 1 SS", "wlan.vht.mcsset.rxmcsmap.ss1",
23706       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
23707       NULL, HFILL }},
23708
23709     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
23710      {"Rx 2 SS", "wlan.vht.mcsset.rxmcsmap.ss2",
23711       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
23712       NULL, HFILL }},
23713
23714     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
23715      {"Rx 3 SS", "wlan.vht.mcsset.rxmcsmap.ss3",
23716       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
23717       NULL, HFILL }},
23718
23719     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
23720      {"Rx 4 SS", "wlan.vht.mcsset.rxmcsmap.ss4",
23721       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
23722       NULL, HFILL }},
23723
23724     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
23725      {"Rx 5 SS", "wlan.vht.mcsset.rxmcsmap.ss5",
23726       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
23727       NULL, HFILL }},
23728
23729     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
23730      {"Rx 6 SS", "wlan.vht.mcsset.rxmcsmap.ss6",
23731       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
23732       NULL, HFILL }},
23733
23734     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
23735      {"Rx 7 SS", "wlan.vht.mcsset.rxmcsmap.ss7",
23736       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
23737       NULL, HFILL }},
23738
23739     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
23740      {"Rx 8 SS", "wlan.vht.mcsset.rxmcsmap.ss8",
23741       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
23742       NULL, HFILL }},
23743
23744     {&hf_ieee80211_vht_mcsset_rx_highest_long_gi,
23745      {"Rx Highest Long GI Data Rate (in Mb/s, 0 = subfield not in use)", "wlan.vht.mcsset.rxhighestlonggirate",
23746       FT_UINT16, BASE_HEX, NULL, 0x1fff,
23747       NULL, HFILL }},
23748
23749     {&hf_ieee80211_vht_mcsset_tx_mcs_map,
23750      {"Tx MCS Map", "wlan.vht.mcsset.txmcsmap",
23751       FT_UINT16, BASE_HEX, NULL, 0,
23752       NULL, HFILL }},
23753
23754     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
23755      {"Tx 1 SS", "wlan.vht.mcsset.txmcsmap.ss1",
23756       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
23757       NULL, HFILL }},
23758
23759     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
23760      {"Tx 2 SS", "wlan.vht.mcsset.txmcsmap.ss2",
23761       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
23762       NULL, HFILL }},
23763
23764     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
23765      {"Tx 3 SS", "wlan.vht.mcsset.txmcsmap.ss3",
23766       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
23767       NULL, HFILL }},
23768
23769     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
23770      {"Tx 4 SS", "wlan.vht.mcsset.txmcsmap.ss4",
23771       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
23772       NULL, HFILL }},
23773
23774     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
23775      {"Tx 5 SS", "wlan.vht.mcsset.txmcsmap.ss5",
23776       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
23777       NULL, HFILL }},
23778
23779     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
23780      {"Tx 6 SS", "wlan.vht.mcsset.txmcsmap.ss6",
23781       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
23782       NULL, HFILL }},
23783
23784     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
23785      {"Tx 7 SS", "wlan.vht.mcsset.txmcsmap.ss7",
23786       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
23787       NULL, HFILL }},
23788
23789     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
23790      {"Tx 8 SS", "wlan.vht.mcsset.txmcsmap.ss8",
23791       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
23792       NULL, HFILL }},
23793
23794     {&hf_ieee80211_vht_mcsset_tx_highest_long_gi,
23795      {"Tx Highest Long GI Data Rate  (in Mb/s, 0 = subfield not in use)", "wlan.vht.mcsset.txhighestlonggirate",
23796       FT_UINT16, BASE_HEX, NULL, 0x1fff,
23797       NULL, HFILL }},
23798
23799     {&hf_ieee80211_vht_op,
23800      {"VHT Operation Info", "wlan.vht.op",
23801       FT_NONE, BASE_NONE, NULL, 0,
23802       NULL, HFILL }},
23803
23804     {&hf_ieee80211_vht_op_channel_width,
23805      {"Channel Width", "wlan.vht.op.channelwidth",
23806       FT_UINT8, BASE_HEX, VALS(vht_op_channel_width_flag), 0,
23807       NULL, HFILL }},
23808
23809     {&hf_ieee80211_vht_op_channel_center0,
23810      {"Channel Center Segment 0", "wlan.vht.op.channelcenter0",
23811       FT_UINT8, BASE_DEC, NULL, 0,
23812       NULL, HFILL }},
23813
23814     {&hf_ieee80211_vht_op_channel_center1,
23815      {"Channel Center Segment 1", "wlan.vht.op.channelcenter1",
23816       FT_UINT8, BASE_DEC, NULL, 0,
23817       NULL, HFILL }},
23818
23819     {&hf_ieee80211_vht_op_basic_mcs_map,
23820      {"Basic MCS Map", "wlan.vht.op.basicmcsmap",
23821       FT_UINT16, BASE_HEX, NULL, 0,
23822       NULL, HFILL }},
23823
23824     {&hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
23825      {"Basic 1 SS", "wlan.vht.op.basicmcsmap.ss1",
23826       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
23827       NULL, HFILL }},
23828
23829     {&hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
23830      {"Basic 2 SS", "wlan.vht.op.basicmcsmap.ss2",
23831       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
23832       NULL, HFILL }},
23833
23834     {&hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
23835      {"Basic 3 SS", "wlan.vht.op.basicmcsmap.ss3",
23836       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
23837       NULL, HFILL }},
23838
23839     {&hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
23840      {"Basic 4 SS", "wlan.vht.op.basicmcsmap.ss4",
23841       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
23842       NULL, HFILL }},
23843
23844     {&hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
23845      {"Basic 5 SS", "wlan.vht.op.basicmcsmap.ss5",
23846       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
23847       NULL, HFILL }},
23848
23849     {&hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
23850      {"Basic 6 SS", "wlan.vht.op.basicmcsmap.ss6",
23851       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
23852       NULL, HFILL }},
23853
23854     {&hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
23855      {"Basic 7 SS", "wlan.vht.op.basicmcsmap.ss7",
23856       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
23857       NULL, HFILL }},
23858
23859     {&hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
23860      {"Basic 8 SS", "wlan.vht.op.basicmcsmap.ss8",
23861       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
23862       NULL, HFILL }},
23863
23864     {&hf_ieee80211_vht_tpe_pwr_info,
23865      {"Tx Pwr Info", "wlan.vht.tpe.pwr_info",
23866       FT_UINT8, BASE_HEX, NULL, 0,
23867       NULL, HFILL }},
23868
23869     {&hf_ieee80211_vht_tpe_pwr_info_count,
23870      {"Max Tx Pwr Count", "wlan.vht.tpe.pwr_info.count",
23871       FT_UINT8, BASE_DEC, NULL , 0x07,
23872       NULL, HFILL }},
23873
23874     {&hf_ieee80211_vht_tpe_pwr_info_unit,
23875      {"Max Tx Pwr Unit Interpretation", "wlan.vht.tpe.pwr_info.unit",
23876       FT_UINT8, BASE_DEC, VALS(vht_tpe_pwr_units) , 0x38,
23877       NULL, HFILL }},
23878
23879     {&hf_ieee80211_vht_tpe_pwr_info_reserved,
23880      {"Reserved", "wlan.vht.tpe.pwr_info.reserved",
23881       FT_UINT8, BASE_DEC, NULL , 0xC0,
23882       NULL, HFILL }},
23883
23884     {&hf_ieee80211_vht_tpe_pwr_constr_20,
23885      {"Local Max Tx Pwr Constraint 20MHz", "wlan.vht.tpe.pwr_constr_20",
23886       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
23887       NULL, HFILL }},
23888
23889     {&hf_ieee80211_vht_tpe_pwr_constr_40,
23890      {"Local Max Tx Pwr Constraint 40MHz", "wlan.vht.tpe.pwr_constr_40",
23891       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
23892       NULL, HFILL }},
23893
23894     {&hf_ieee80211_vht_tpe_pwr_constr_80,
23895      {"Local Max Tx Pwr Constraint 80MHz", "wlan.vht.tpe.pwr_constr_80",
23896       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
23897       NULL, HFILL }},
23898
23899     {&hf_ieee80211_vht_tpe_pwr_constr_160,
23900      {"Local Max Tx Pwr Constraint 160MHz/80+80 MHz", "wlan.vht.tpe.pwr_constr_160",
23901       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
23902       NULL, HFILL }},
23903
23904     {&hf_ieee80211_txbf_csi_num_bf_ant,
23905      {"Max antennae STA can support when CSI feedback required", "wlan.txbf.csinumant",
23906       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00180000,
23907       "Max antennae station can support when CSI feedback required", HFILL }},
23908
23909     {&hf_ieee80211_txbf_uncomp_sm_bf_ant,
23910      {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan.txbf.fm.uncompressed.maxant",
23911       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00600000,
23912       "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
23913
23914     {&hf_ieee80211_txbf_comp_sm_bf_ant,
23915      {"Max antennae STA can support when compressed Beamforming feedback required", "wlan.txbf.fm.compressed.maxant",
23916       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x01800000,
23917       "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
23918
23919     {&hf_ieee80211_txbf_csi_max_rows_bf,
23920      {"Maximum number of rows of CSI explicit feedback", "wlan.txbf.csi.maxrows",
23921       FT_UINT32, BASE_HEX, VALS(txbf_csi_max_rows_bf_flags), 0x06000000,
23922       NULL, HFILL }},
23923
23924     {&hf_ieee80211_txbf_chan_est,
23925      {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan.txbf.channelest",
23926       FT_UINT32, BASE_HEX, VALS(txbf_chan_est_flags), 0x18000000,
23927       NULL, HFILL }},
23928
23929     {&hf_ieee80211_txbf_resrv,
23930      {"Reserved", "wlan.txbf.reserved",
23931       FT_UINT32, BASE_HEX, NULL, 0xe0000000,
23932       NULL, HFILL }},
23933
23934     {&hf_ieee80211_hta_cc,
23935      {"HT Control Channel", "wlan.hta.control_channel",
23936       FT_UINT8, BASE_DEC, NULL, 0,
23937       NULL, HFILL }},
23938
23939     {&hf_ieee80211_hta_cap,
23940      {"HT Additional Capabilities", "wlan.hta.capabilities",
23941       FT_UINT16, BASE_HEX, NULL, 0,
23942       "HT Additional Capability information", HFILL }},
23943
23944     {&hf_ieee80211_hta_ext_chan_offset,
23945      {"Extension Channel Offset", "wlan.hta.capabilities.ext_chan_offset",
23946       FT_UINT16, BASE_HEX, VALS(hta_ext_chan_offset_flag), 0x0003,
23947       NULL, HFILL }},
23948
23949     {&hf_ieee80211_hta_rec_tx_width,
23950      {"Recommended Tx Channel Width", "wlan.hta.capabilities.rec_tx_width",
23951       FT_BOOLEAN, 16, TFS(&hta_rec_tx_width_flag), 0x0004,
23952       "Recommended Transmit Channel Width", HFILL }},
23953
23954     {&hf_ieee80211_hta_rifs_mode,
23955      {"Reduced Interframe Spacing (RIFS) Mode", "wlan.hta.capabilities.rifs_mode",
23956       FT_BOOLEAN, 16, TFS(&hta_rifs_mode_flag), 0x0008,
23957       NULL, HFILL }},
23958
23959     {&hf_ieee80211_hta_controlled_access,
23960      {"Controlled Access Only", "wlan.hta.capabilities.controlled_access",
23961       FT_BOOLEAN, 16, TFS(&hta_controlled_access_flag), 0x0010,
23962       NULL, HFILL }},
23963
23964     {&hf_ieee80211_hta_service_interval,
23965      {"Service Interval Granularity", "wlan.hta.capabilities.service_interval",
23966       FT_UINT16, BASE_HEX, VALS(hta_service_interval_flag), 0x00E0,
23967       NULL, HFILL }},
23968
23969     {&hf_ieee80211_hta_operating_mode,
23970      {"Operating Mode", "wlan.hta.capabilities.operating_mode",
23971       FT_UINT16, BASE_HEX, VALS(hta_operating_mode_flag), 0x0003,
23972       NULL, HFILL }},
23973
23974     {&hf_ieee80211_hta_non_gf_devices,
23975      {"Non Greenfield (GF) devices Present", "wlan.hta.capabilities.non_gf_devices",
23976       FT_BOOLEAN, 16, TFS(&hta_non_gf_devices_flag), 0x0004,
23977       "on Greenfield (GF) devices Present", HFILL }},
23978
23979     {&hf_ieee80211_hta_basic_stbc_mcs,
23980      {"Basic STB Modulation and Coding Scheme (MCS)", "wlan.hta.capabilities.basic_stbc_mcs",
23981       FT_UINT16, BASE_HEX, NULL , 0x007f,
23982       NULL, HFILL }},
23983
23984     {&hf_ieee80211_hta_dual_stbc_protection,
23985      {"Dual Clear To Send (CTS) Protection", "wlan.hta.capabilities.dual_stbc_protection",
23986       FT_BOOLEAN, 16, TFS(&hta_dual_stbc_protection_flag), 0x0080,
23987       NULL, HFILL }},
23988
23989     {&hf_ieee80211_hta_secondary_beacon,
23990      {"Secondary Beacon", "wlan.hta.capabilities.secondary_beacon",
23991       FT_BOOLEAN, 16, TFS(&hta_secondary_beacon_flag), 0x0100,
23992       NULL, HFILL }},
23993
23994     {&hf_ieee80211_hta_lsig_txop_protection,
23995      {"L-SIG TXOP Protection Support", "wlan.hta.capabilities.lsig_txop_protection",
23996       FT_BOOLEAN, 16, TFS(&hta_lsig_txop_protection_flag), 0x0200,
23997       NULL, HFILL }},
23998
23999     {&hf_ieee80211_hta_pco_active,
24000      {"Phased Coexistence Operation (PCO) Active", "wlan.hta.capabilities.pco_active",
24001       FT_BOOLEAN, 16, TFS(&hta_pco_active_flag), 0x0400,
24002       NULL, HFILL }},
24003
24004     {&hf_ieee80211_hta_pco_phase,
24005      {"Phased Coexistence Operation (PCO) Phase", "wlan.hta.capabilities.pco_phase",
24006       FT_BOOLEAN, 16, TFS(&hta_pco_phase_flag), 0x0800,
24007       NULL, HFILL }},
24008
24009     {&hf_ieee80211_antsel,
24010      {"Antenna Selection (ASEL) Capabilities", "wlan.asel",
24011       FT_UINT8, BASE_HEX, NULL, 0,
24012       NULL, HFILL }},
24013
24014     {&hf_ieee80211_antsel_vs,
24015      {"Antenna Selection (ASEL) Capabilities (VS)", "wlan.vs.asel",
24016       FT_UINT8, BASE_HEX, NULL, 0,
24017       "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
24018
24019     {&hf_ieee80211_antsel_b0,
24020      {"Antenna Selection Capable", "wlan.asel.capable",
24021       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
24022       NULL, HFILL }},
24023
24024     {&hf_ieee80211_antsel_b1,
24025      {"Explicit CSI Feedback Based Tx ASEL", "wlan.asel.txcsi",
24026       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
24027       NULL, HFILL }},
24028
24029     {&hf_ieee80211_antsel_b2,
24030      {"Antenna Indices Feedback Based Tx ASEL", "wlan.asel.txif",
24031       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
24032       NULL, HFILL }},
24033
24034     {&hf_ieee80211_antsel_b3,
24035      {"Explicit CSI Feedback", "wlan.asel.csi",
24036       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
24037       NULL, HFILL }},
24038
24039     {&hf_ieee80211_antsel_b4,
24040      {"Antenna Indices Feedback", "wlan.asel.if",
24041       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
24042       NULL, HFILL }},
24043
24044     {&hf_ieee80211_antsel_b5,
24045      {"Rx ASEL", "wlan.asel.rx",
24046       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
24047       NULL, HFILL }},
24048
24049     {&hf_ieee80211_antsel_b6,
24050      {"Tx Sounding PPDUs", "wlan.asel.sppdu",
24051       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24052       NULL, HFILL }},
24053
24054     {&hf_ieee80211_antsel_b7,
24055      {"Reserved", "wlan.asel.reserved",
24056       FT_UINT8, BASE_HEX, NULL, 0x80,
24057       NULL, HFILL }},
24058
24059     {&hf_ieee80211_ht_info_delimiter1,
24060      {"HT Information Subset (1 of 3)", "wlan.ht.info.delim1",
24061       FT_UINT8, BASE_HEX, NULL, 0,
24062       NULL, HFILL }},
24063
24064     {&hf_ieee80211_ht_info_primary_channel,
24065      {"Primary Channel", "wlan.ht.info.primarychannel",
24066       FT_UINT8, BASE_DEC, NULL, 0,
24067       NULL, HFILL }},
24068
24069     {&hf_ieee80211_ht_info_secondary_channel_offset,
24070      {"Secondary channel offset", "wlan.ht.info.secchanoffset",
24071       FT_UINT8, BASE_HEX, VALS(ht_info_secondary_channel_offset_flags), 0x03,
24072       NULL, HFILL }},
24073
24074     {&hf_ieee80211_ht_info_channel_width,
24075      {"Supported channel width", "wlan.ht.info.chanwidth",
24076       FT_BOOLEAN, 8, TFS(&ht_info_channel_width_flag), 0x04,
24077       NULL, HFILL }},
24078
24079     {&hf_ieee80211_ht_info_rifs_mode,
24080      {"Reduced Interframe Spacing (RIFS)", "wlan.ht.info.rifs",
24081       FT_BOOLEAN, 8, TFS(&ht_info_rifs_mode_flag), 0x08,
24082       NULL, HFILL }},
24083
24084     {&hf_ieee80211_ht_info_psmp_stas_only,
24085      {"Power Save Multi-Poll (PSMP) stations only", "wlan.ht.info.psmponly",
24086       FT_BOOLEAN, 8, TFS(&ht_info_psmp_stas_only_flag), 0x10,
24087       NULL, HFILL }},
24088
24089     {&hf_ieee80211_ht_info_service_interval_granularity,
24090      {"Shortest service interval", "wlan.ht.info",
24091       FT_UINT8, BASE_HEX, VALS(ht_info_service_interval_granularity_flags), 0xe0,
24092       NULL, HFILL }},
24093
24094     {&hf_ieee80211_ht_info_delimiter2,
24095      {"HT Information Subset (2 of 3)", "wlan.ht.info.delim2",
24096       FT_UINT16, BASE_HEX, NULL, 0,
24097       NULL, HFILL }},
24098
24099     {&hf_ieee80211_ht_info_operating_mode,
24100      {"Operating mode of BSS", "wlan.ht.info.operatingmode",
24101       FT_UINT16, BASE_HEX, VALS(ht_info_operating_mode_flags), 0x0003,
24102       NULL, HFILL }},
24103
24104     {&hf_ieee80211_ht_info_non_greenfield_sta_present,
24105      {"Non-greenfield STAs present", "wlan.ht.info.greenfield",
24106       FT_BOOLEAN, 16, TFS(&ht_info_non_greenfield_sta_present_flag), 0x0004,
24107       NULL, HFILL }},
24108
24109     {&hf_ieee80211_ht_info_transmit_burst_limit,
24110      {"Transmit burst limit", "wlan.ht.info.burstlim",
24111       FT_BOOLEAN, 16, TFS(&ht_info_transmit_burst_limit_flag), 0x0008,
24112       NULL, HFILL }},
24113
24114     {&hf_ieee80211_ht_info_obss_non_ht_stas_present,
24115      {"OBSS non-HT STAs present", "wlan.ht.info.obssnonht",
24116       FT_BOOLEAN, 16, TFS(&ht_info_obss_non_ht_stas_present_flag), 0x0010,
24117       NULL, HFILL }},
24118
24119     {&hf_ieee80211_ht_info_reserved_1,
24120      {"Reserved", "wlan.ht.info.reserved1",
24121       FT_UINT16, BASE_HEX, NULL, 0xffe0,
24122       NULL, HFILL }},
24123
24124     {&hf_ieee80211_ht_info_delimiter3,
24125      {"HT Information Subset (3 of 3)", "wlan.ht.info.delim3",
24126       FT_UINT16, BASE_HEX, NULL, 0,
24127       NULL, HFILL }},
24128
24129     {&hf_ieee80211_ht_info_reserved_2,
24130      {"Reserved", "wlan.ht.info.reserved2",
24131       FT_UINT16, BASE_HEX, NULL, 0x003f,
24132       NULL, HFILL }},
24133
24134     {&hf_ieee80211_ht_info_dual_beacon,
24135      {"Dual beacon", "wlan.ht.info.dualbeacon",
24136       FT_BOOLEAN, 16, TFS(&ht_info_dual_beacon_flag), 0x0040,
24137       NULL, HFILL }},
24138
24139     {&hf_ieee80211_ht_info_dual_cts_protection,
24140      {"Dual Clear To Send (CTS) protection", "wlan.ht.info.dualcts",
24141       FT_BOOLEAN, 16, TFS(&ht_info_dual_cts_protection_flag), 0x0080,
24142       NULL, HFILL }},
24143
24144     {&hf_ieee80211_ht_info_secondary_beacon,
24145      {"Beacon ID", "wlan.ht.info.secondarybeacon",
24146       FT_BOOLEAN, 16, TFS(&ht_info_secondary_beacon_flag), 0x0100,
24147       NULL, HFILL }},
24148
24149     {&hf_ieee80211_ht_info_lsig_txop_protection_full_support,
24150      {"L-SIG TXOP Protection Full Support", "wlan.ht.info.lsigprotsupport",
24151       FT_BOOLEAN, 16, TFS(&ht_info_lsig_txop_protection_full_support_flag), 0x0200,
24152       NULL, HFILL }},
24153
24154     {&hf_ieee80211_ht_info_pco_active,
24155      {"Phased Coexistence Operation (PCO)", "wlan.ht.info.pco.active",
24156       FT_BOOLEAN, 16, TFS(&tfs_active_inactive), 0x0400,
24157       NULL, HFILL }},
24158
24159     {&hf_ieee80211_ht_info_pco_phase,
24160      {"Phased Coexistence Operation (PCO) Phase", "wlan.ht.info.pco.phase",
24161       FT_BOOLEAN, 16, TFS(&ht_info_pco_phase_flag), 0x0800,
24162       NULL, HFILL }},
24163
24164     {&hf_ieee80211_ht_info_reserved_3,
24165      {"Reserved", "wlan.ht.info.reserved3",
24166       FT_UINT16, BASE_HEX, NULL, 0xf000,
24167       NULL, HFILL }},
24168
24169     {&hf_ieee80211_tag_ap_channel_report_operating_class,
24170      {"Operating Class", "wlan.ap_channel_report.operating_class",
24171       FT_UINT8, BASE_DEC, NULL, 0,
24172       NULL, HFILL }},
24173
24174     {&hf_ieee80211_tag_ap_channel_report_channel_list,
24175      {"Channel List", "wlan.ap_channel_report.channel_list",
24176       FT_UINT8, BASE_DEC, NULL, 0,
24177       NULL, HFILL }},
24178
24179     {&hf_ieee80211_tag_secondary_channel_offset,
24180      {"Secondary Channel Offset", "wlan.secchanoffset",
24181       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_secondary_channel_offset_flags), 0,
24182       NULL, HFILL }},
24183
24184     {&hf_ieee80211_tag_bss_ap_avg_access_delay,
24185      {"AP Average Access Delay", "wlan.bss_ap_avg_access_delay",
24186       FT_UINT8, BASE_DEC, NULL, 0x0,
24187       NULL, HFILL }},
24188
24189     {&hf_ieee80211_tag_antenna_id,
24190      {"Antenna ID", "wlan.antenna.id",
24191       FT_UINT8, BASE_DEC, NULL, 0x0,
24192       NULL, HFILL }},
24193
24194     {&hf_ieee80211_tag_rsni,
24195      {"RSNI", "wlan.rsni",
24196       FT_UINT8, BASE_CUSTOM, CF_FUNC(rsni_base_custom), 0x0,
24197       NULL, HFILL }},
24198
24199     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
24200      {"Available Admission Capacity Bitmask", "wlan.bss_avb_adm_cap.bitmask",
24201       FT_UINT16, BASE_HEX, NULL, 0,
24202       NULL, HFILL }},
24203     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
24204      {"UP0 (bit0)", "wlan.bss_avb_adm_cap.bitmask.up0",
24205       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP0,
24206       NULL, HFILL }},
24207     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
24208      {"UP1 (bit1)", "wlan.bss_avb_adm_cap.bitmask.up1",
24209       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP1,
24210       NULL, HFILL }},
24211     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
24212      {"UP2 (bit2)", "wlan.bss_avb_adm_cap.bitmask.up2",
24213       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP2,
24214       NULL, HFILL }},
24215     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
24216      {"UP3 (bit3)", "wlan.bss_avb_adm_cap.bitmask.up3",
24217       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP3,
24218       NULL, HFILL }},
24219     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
24220      {"UP4 (bit4)", "wlan.bss_avb_adm_cap.bitmask.up4",
24221       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP4,
24222       NULL, HFILL }},
24223     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
24224      {"UP5 (bit5)", "wlan.bss_avb_adm_cap.bitmask.up5",
24225       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP5,
24226       NULL, HFILL }},
24227     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
24228      {"UP0 (bit6)", "wlan.bss_avb_adm_cap.bitmask.up6",
24229       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP6,
24230       NULL, HFILL }},
24231     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
24232      {"UP7 (bit7)", "wlan.bss_avb_adm_cap.bitmask.up7",
24233       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP7,
24234       NULL, HFILL }},
24235     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
24236      {"AC0 (bit8)", "wlan.bss_avb_adm_cap.bitmask.ac0",
24237       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC0,
24238       NULL, HFILL }},
24239     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
24240      {"AC1 (bit9)", "wlan.bss_avb_adm_cap.bitmask.AC1",
24241       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC1,
24242       NULL, HFILL }},
24243     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
24244      {"AC2 (bit10)", "wlan.bss_avb_adm_cap.bitmask.ac2",
24245       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC2,
24246       NULL, HFILL }},
24247     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
24248      {"AC3 (bit11)", "wlan.bss_avb_adm_cap.bitmask.ac3",
24249       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC3,
24250       NULL, HFILL }},
24251     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
24252      {"Reserved", "wlan.bss_avb_adm_cap.bitmask.rsv",
24253       FT_UINT16, BASE_HEX, NULL, BSS_BITMASK_RSV,
24254       NULL, HFILL }},
24255     {&hf_ieee80211_tag_bss_avb_adm_cap_up0,
24256      {"UP0", "wlan.bss_avb_adm_cap.up0",
24257       FT_UINT16, BASE_DEC, NULL, 0x0,
24258       NULL, HFILL }},
24259     {&hf_ieee80211_tag_bss_avb_adm_cap_up1,
24260      {"UP1", "wlan.bss_avb_adm_cap.up1",
24261       FT_UINT16, BASE_DEC, NULL, 0x0,
24262       NULL, HFILL }},
24263     {&hf_ieee80211_tag_bss_avb_adm_cap_up2,
24264      {"UP2", "wlan.bss_avb_adm_cap.up2",
24265       FT_UINT16, BASE_DEC, NULL, 0x0,
24266       NULL, HFILL }},
24267     {&hf_ieee80211_tag_bss_avb_adm_cap_up3,
24268      {"UP3", "wlan.bss_avb_adm_cap.up3",
24269       FT_UINT16, BASE_DEC, NULL, 0x0,
24270       NULL, HFILL }},
24271     {&hf_ieee80211_tag_bss_avb_adm_cap_up4,
24272      {"UP4", "wlan.bss_avb_adm_cap.up4",
24273       FT_UINT16, BASE_DEC, NULL, 0x0,
24274       NULL, HFILL }},
24275     {&hf_ieee80211_tag_bss_avb_adm_cap_up5,
24276      {"UP5", "wlan.bss_avb_adm_cap.up5",
24277       FT_UINT16, BASE_DEC, NULL, 0x0,
24278       NULL, HFILL }},
24279     {&hf_ieee80211_tag_bss_avb_adm_cap_up6,
24280      {"UP6", "wlan.bss_avb_adm_cap.up6",
24281       FT_UINT16, BASE_DEC, NULL, 0x0,
24282       NULL, HFILL }},
24283     {&hf_ieee80211_tag_bss_avb_adm_cap_up7,
24284      {"UP7", "wlan.bss_avb_adm_cap.up7",
24285       FT_UINT16, BASE_DEC, NULL, 0x0,
24286       NULL, HFILL }},
24287     {&hf_ieee80211_tag_bss_avb_adm_cap_ac0,
24288      {"AC0", "wlan.bss_avb_adm_cap.ac0",
24289       FT_UINT16, BASE_DEC, NULL, 0x0,
24290       NULL, HFILL }},
24291     {&hf_ieee80211_tag_bss_avb_adm_cap_ac1,
24292      {"AC1", "wlan.bss_avb_adm_cap.ac1",
24293       FT_UINT16, BASE_DEC, NULL, 0x0,
24294       NULL, HFILL }},
24295     {&hf_ieee80211_tag_bss_avb_adm_cap_ac2,
24296      {"AC2", "wlan.bss_avb_adm_cap.ac2",
24297       FT_UINT16, BASE_DEC, NULL, 0x0,
24298       NULL, HFILL }},
24299     {&hf_ieee80211_tag_bss_avb_adm_cap_ac3,
24300      {"AC3", "wlan.bss_avb_adm_cap.ac3",
24301       FT_UINT16, BASE_DEC, NULL, 0x0,
24302       NULL, HFILL }},
24303
24304     {&hf_ieee80211_tag_bss_avg_ac_access_delay_be,
24305      {"AC Average Access Delay for Best Effort", "wlan.bss_avg_ac_access_delay.be",
24306       FT_UINT8, BASE_DEC, NULL, 0x0,
24307       NULL, HFILL }},
24308     {&hf_ieee80211_tag_bss_avg_ac_access_delay_bk,
24309      {"AC Average Access Delay for Best Background", "wlan.bss_avg_ac_access_delay.bk",
24310       FT_UINT8, BASE_DEC, NULL, 0x0,
24311       NULL, HFILL }},
24312     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vi,
24313      {"AC Average Access Delay for Video", "wlan.bss_avg_ac_access_delay_vi",
24314       FT_UINT8, BASE_DEC, NULL, 0x0,
24315       NULL, HFILL }},
24316     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vo,
24317      {"AC Average Access Delay for Voice", "wlan.bss_avg_ac_access_delay_vo",
24318       FT_UINT8, BASE_DEC, NULL, 0x0,
24319       NULL, HFILL }},
24320
24321
24322     /* 802.11-2012 Table 8-119-RM Enabled Capabilities definition */
24323     {&hf_ieee80211_tag_rm_enabled_capabilities,
24324      {"RM Capabilities", "wlan.rmcap",
24325       FT_UINT8, BASE_HEX, NULL, 0,
24326       "Signals support for radio measurements in a device", HFILL }},
24327
24328     /* RM Enabled Capability octet 1 */
24329     {&hf_ieee80211_tag_rm_enabled_capabilities_b0,
24330      {"Link Measurement", "wlan.rmcap.b0",
24331       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24332       NULL, HFILL }},
24333     {&hf_ieee80211_tag_rm_enabled_capabilities_b1,
24334      {"Neighbor Report", "wlan.rmcap.b1",
24335       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24336       NULL, HFILL }},
24337     {&hf_ieee80211_tag_rm_enabled_capabilities_b2,
24338      {"Parallel Measurements", "wlan.rmcap.b2",
24339       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
24340       NULL, HFILL }},
24341     {&hf_ieee80211_tag_rm_enabled_capabilities_b3,
24342      {"Repeated Measurements", "wlan.rmcap.b3",
24343       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
24344       NULL, HFILL }},
24345     {&hf_ieee80211_tag_rm_enabled_capabilities_b4,
24346      {"Beacon Passive Measurement", "wlan.rmcap.b4",
24347       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
24348       NULL, HFILL }},
24349     {&hf_ieee80211_tag_rm_enabled_capabilities_b5,
24350      {"Beacon Active Measurement", "wlan.rmcap.b5",
24351       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
24352       NULL, HFILL }},
24353     {&hf_ieee80211_tag_rm_enabled_capabilities_b6,
24354      {"Beacon Table Measurement", "wlan.rmcap.b6",
24355       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24356       NULL, HFILL }},
24357     {&hf_ieee80211_tag_rm_enabled_capabilities_b7,
24358      {"Beacon Measurement Reporting Conditions", "wlan.rmcap.b7",
24359       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
24360       NULL, HFILL }},
24361
24362     /* RM Enabled Capability octet 2 */
24363     {&hf_ieee80211_tag_rm_enabled_capabilities_b8,
24364      {"Frame Measurement", "wlan.rmcap.b8",
24365       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24366       NULL, HFILL }},
24367     {&hf_ieee80211_tag_rm_enabled_capabilities_b9,
24368      {"Channel Load Measurement", "wlan.rmcap.b9",
24369       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24370       NULL, HFILL }},
24371     {&hf_ieee80211_tag_rm_enabled_capabilities_b10,
24372      {"Noise Histogram Measurement", "wlan.rmcap.b10",
24373       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
24374       NULL, HFILL }},
24375     {&hf_ieee80211_tag_rm_enabled_capabilities_b11,
24376      {"Statistics Measurement", "wlan.rmcap.b11",
24377       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
24378       NULL, HFILL }},
24379     {&hf_ieee80211_tag_rm_enabled_capabilities_b12,
24380      {"LCI Measurement", "wlan.rmcap.b12",
24381       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
24382       NULL, HFILL }},
24383     {&hf_ieee80211_tag_rm_enabled_capabilities_b13,
24384      {"LCI Azimuth capability", "wlan.rmcap.b13",
24385       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
24386       NULL, HFILL }},
24387     {&hf_ieee80211_tag_rm_enabled_capabilities_b14,
24388      {"Transmit Stream/Category Measurement", "wlan.rmcap.b14",
24389       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24390       NULL, HFILL }},
24391     {&hf_ieee80211_tag_rm_enabled_capabilities_b15,
24392      {"Triggered Transmit Stream/Category Measurement", "wlan.rmcap.b15",
24393       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
24394       NULL, HFILL }},
24395
24396     /* RM Enabled Capability octet 3 */
24397     {&hf_ieee80211_tag_rm_enabled_capabilities_b16,
24398      {"AP Channel Report capability", "wlan.rmcap.b16",
24399       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24400       NULL, HFILL }},
24401     {&hf_ieee80211_tag_rm_enabled_capabilities_b17,
24402      {"RM MIB capability", "wlan.rmcap.b17",
24403       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24404       NULL, HFILL }},
24405     {&hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
24406      {"Operating Channel Max Measurement Duration", "wlan.rmcap.b18to20",
24407       FT_UINT8, BASE_DEC, NULL, 0x1C,
24408       NULL, HFILL }},
24409     {&hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
24410      {"Nonoperating Channel Max Measurement Duration", "wlan.rmcap.b21to23",
24411       FT_UINT8, BASE_DEC, NULL, 0xE0,
24412       NULL, HFILL }},
24413
24414     /* RM Enabled Capability octet 4 */
24415     {&hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
24416      {"Measurement Pilotcapability", "wlan.rmcap.b24to26",
24417       FT_UINT8, BASE_DEC, NULL, 0x07,
24418       NULL, HFILL }},
24419     {&hf_ieee80211_tag_rm_enabled_capabilities_b27,
24420      {"Measurement Pilot Transmission Information", "wlan.rmcap.b27",
24421       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
24422       NULL, HFILL }},
24423     {&hf_ieee80211_tag_rm_enabled_capabilities_b28,
24424      {"Neighbor Report TSF Offset", "wlan.rmcap.b28",
24425       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
24426       NULL, HFILL }},
24427     {&hf_ieee80211_tag_rm_enabled_capabilities_b29,
24428      {"RCPI Measurement capability", "wlan.rmcap.b29",
24429       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
24430       NULL, HFILL }},
24431     {&hf_ieee80211_tag_rm_enabled_capabilities_b30,
24432      {"RSNI Measurement capability", "wlan.rmcap.b30",
24433       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24434       NULL, HFILL }},
24435     {&hf_ieee80211_tag_rm_enabled_capabilities_b31,
24436      {"BSS Average Access Delay capability", "wlan.rmcap.b31",
24437       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
24438       NULL, HFILL }},
24439
24440     /* RM Enabled Capability octet 5 */
24441     {&hf_ieee80211_tag_rm_enabled_capabilities_b32,
24442      {"BSS Available Admission Capacity capability", "wlan.rmcap.b32",
24443       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24444       NULL, HFILL }},
24445     {&hf_ieee80211_tag_rm_enabled_capabilities_b33,
24446      {"Antenna capability", "wlan.rmcap.b33",
24447       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24448       NULL, HFILL }},
24449     {&hf_ieee80211_tag_rm_enabled_capabilities_o5,
24450      {"Reserved", "wlan.rmcap.o5",
24451       FT_UINT8, BASE_HEX, NULL, 0xFC,
24452       "Must be zero", HFILL }},
24453
24454     /* 20/40 BSS Coexistence */
24455     {&hf_ieee80211_tag_20_40_bc,
24456      {"20/40 BSS Coexistence Flags", "wlan.20_40_bc",
24457       FT_UINT8, BASE_HEX, NULL, 0x0,
24458       NULL, HFILL }},
24459     {&hf_ieee80211_tag_20_40_bc_information_request,
24460      {"Information Request", "wlan.20_40_bc.information_request",
24461       FT_BOOLEAN, 8, NULL, 0x01,
24462       NULL, HFILL }},
24463     {&hf_ieee80211_tag_20_40_bc_forty_mhz_intolerant,
24464      {"Forty MHz Intolerant", "wlan.20_40_bc.forty_mhz_intolerant",
24465       FT_BOOLEAN, 8, NULL, 0x02,
24466       NULL, HFILL }},
24467     {&hf_ieee80211_tag_20_40_bc_20_mhz_bss_witdh_request,
24468      {"20 MHz BSS Witdh Request", "wlan.20_40_bc.20_mhz_bss_witdh_request",
24469       FT_BOOLEAN, 8, NULL, 0x04,
24470       NULL, HFILL }},
24471     {&hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_request,
24472      {"OBSS Scanning Exemption Request", "wlan.20_40_bc.obss_scanning_exemption_request",
24473       FT_BOOLEAN, 8, NULL, 0x08,
24474       NULL, HFILL }},
24475     {&hf_ieee80211_tag_20_40_bc_obss_scanning_exemption_grant,
24476      {"OBSS Scanning Exemption Grant", "wlan.20_40_bc.obss_scanning_exemption_grant",
24477       FT_BOOLEAN, 8, NULL, 0x10,
24478       NULL, HFILL }},
24479     {&hf_ieee80211_tag_20_40_bc_reserved,
24480      {"Reserved", "wlan.20_40_bc.reserved",
24481       FT_UINT8, BASE_HEX, NULL, 0xE0,
24482       "Must be zero", HFILL }},
24483
24484
24485     {&hf_ieee80211_tag_power_constraint_local,
24486      {"Local Power Constraint", "wlan.powercon.local",
24487       FT_UINT8, BASE_DEC, NULL, 0,
24488       "Value that allows the mitigation requirements to be satisfied in the current channel", HFILL }},
24489
24490     {&hf_ieee80211_tag_power_capability_min,
24491      {"Minimum Transmit Power", "wlan.powercap.min",
24492       FT_UINT8, BASE_DEC_HEX, NULL, 0,
24493       "The nominal minimum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
24494
24495     {&hf_ieee80211_tag_power_capability_max,
24496      {"Maximum Transmit Power", "wlan.powercap.max",
24497       FT_UINT8, BASE_DEC_HEX, NULL, 0,
24498       "The nominal maximum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
24499
24500     {&hf_ieee80211_tag_tpc_report_trsmt_pow,
24501      {"Transmit Power", "wlan.tcprep.trsmt_pow",
24502       FT_INT8, BASE_DEC, NULL, 0,
24503       NULL, HFILL }},
24504
24505     {&hf_ieee80211_tag_tpc_report_link_mrg,
24506      {"Link Margin", "wlan.tcprep.link_mrg",
24507       FT_INT8, BASE_DEC, NULL, 0,
24508       NULL, HFILL }},
24509
24510     {&hf_ieee80211_tag_supported_channels,
24511      {"Supported Channels Set", "wlan.supchan",
24512       FT_NONE, BASE_NONE, NULL, 0,
24513       NULL, HFILL }},
24514
24515     {&hf_ieee80211_tag_supported_channels_first,
24516      {"First Supported Channel", "wlan.supchan.first",
24517       FT_UINT8, BASE_DEC, NULL, 0,
24518       NULL, HFILL }},
24519
24520     {&hf_ieee80211_tag_supported_channels_range,
24521      {"Supported Channel Range", "wlan.supchan.range",
24522       FT_UINT8, BASE_DEC, NULL, 0,
24523       NULL, HFILL }},
24524
24525     {&hf_ieee80211_csa_channel_switch_mode,
24526      {"Channel Switch Mode", "wlan.csa.channel_switch_mode",
24527       FT_UINT8, BASE_HEX, NULL, 0,
24528       "Indicates any restrictions on transmission until a channel switch", HFILL }},
24529
24530     {&hf_ieee80211_csa_new_channel_number,
24531      {"New Channel Number", "wlan.csa.new_channel_number",
24532       FT_UINT8, BASE_HEX, NULL, 0,
24533       "Set to the number of the channel to which the STA is moving", HFILL }},
24534
24535     {&hf_ieee80211_csa_channel_switch_count,
24536      {"Channel Switch Count", "wlan.csa.channel_switch.count",
24537       FT_UINT8, BASE_DEC, NULL, 0,
24538       "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 }},
24539
24540     {&hf_ieee80211_mesh_channel_switch_ttl,
24541      {"Mesh Channel Switch TTL", "wlan.csa.mesh_channel_switch.ttl",
24542       FT_UINT8, BASE_DEC, NULL, 0,
24543       NULL, HFILL }},
24544
24545     {&hf_ieee80211_mesh_channel_switch_flag,
24546      {"Mesh Channel Switch Flag", "wlan.csa.mesh_channel_switch.flag",
24547       FT_UINT8, BASE_HEX, NULL, 0,
24548       NULL, HFILL }},
24549
24550     {&hf_ieee80211_mesh_chswitch_flag_txrestrict,
24551      {"CSA Tx Restrict", "wlan.csa.mesh_channel_switch.flag.txrestrict",
24552       FT_BOOLEAN, 16, TFS(&csa_txrestrict_flags), 0x0001,
24553       NULL, HFILL }},
24554
24555     {&hf_ieee80211_mesh_chswitch_flag_initiator,
24556      {"CSA Initiator", "wlan.csa.mesh_channel_switch.flag.initiator",
24557       FT_BOOLEAN, 16, TFS(&csa_initiator_flags), 0x0002,
24558       NULL, HFILL }},
24559
24560     {&hf_ieee80211_mesh_channel_switch_reason_code,
24561      {"Mesh Channel Switch Reason Code", "wlan.csa.mesh_channel_switch.reason_code",
24562       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
24563       NULL, HFILL }},
24564
24565     {&hf_ieee80211_mesh_channel_switch_precedence_value,
24566      {"Mesh Channel Switch Precedence Value", "wlan.csa.mesh_channel_switch.pre_value",
24567       FT_UINT16, BASE_DEC, NULL, 0,
24568       NULL, HFILL }},
24569
24570     {&hf_ieee80211_tag_measure_request_token,
24571      {"Measurement Token", "wlan.measure.req.token",
24572       FT_UINT8, BASE_HEX, NULL, 0xff,
24573       NULL, HFILL }},
24574
24575     {&hf_ieee80211_tag_measure_request_mode,
24576      {"Measurement Request Mode", "wlan.measure.req.mode",
24577       FT_UINT8, BASE_HEX, NULL, 0xff,
24578       NULL, HFILL }},
24579
24580     {&hf_ieee80211_tag_measure_request_mode_parallel,
24581      {"Parallel", "wlan.measure.req.reqmode.parallel",
24582       FT_BOOLEAN, 8, NULL, 0x01,
24583       NULL, HFILL }},
24584
24585     {&hf_ieee80211_tag_measure_request_mode_enable,
24586      {"Measurement Request Mode Field", "wlan.measure.req.reqmode.enable",
24587       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24588       NULL, HFILL }},
24589
24590     {&hf_ieee80211_tag_measure_request_mode_request,
24591      {"Measurement Reports", "wlan.measure.req.reqmode.request",
24592       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x04,
24593       NULL, HFILL }},
24594
24595     {&hf_ieee80211_tag_measure_request_mode_report,
24596      {"Autonomous Measurement Reports", "wlan.measure.req.reqmode.report",
24597       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x08,
24598       NULL, HFILL }},
24599
24600     {&hf_ieee80211_tag_measure_request_mode_duration_mandatory,
24601      {"Duration Mandatory", "wlan.measure.req.reqmode.duration_mandatory",
24602       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x10,
24603       NULL, HFILL }},
24604
24605     {&hf_ieee80211_tag_measure_request_mode_reserved,
24606      {"Reserved", "wlan.measure.req.reqmode.reserved",
24607       FT_UINT8, BASE_HEX, NULL, 0xE0,
24608       NULL, HFILL }},
24609
24610     {&hf_ieee80211_tag_measure_request_type,
24611      {"Measurement Request Type", "wlan.measure.req.reqtype",
24612       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_type_flags_ext, 0x00,
24613       NULL, HFILL }},
24614
24615     {&hf_ieee80211_tag_measure_request_channel_number,
24616      {"Measurement Channel Number", "wlan.measure.req.channelnumber",
24617       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
24618       NULL, HFILL }},
24619
24620     {&hf_ieee80211_tag_measure_request_start_time,
24621      {"Measurement Start Time", "wlan.measure.req.starttime",
24622       FT_UINT64, BASE_HEX, NULL, 0,
24623       NULL, HFILL }},
24624
24625     {&hf_ieee80211_tag_measure_request_duration,
24626      {"Measurement Duration", "wlan.measure.req.channelnumber",
24627       FT_UINT16, BASE_HEX, NULL, 0,
24628       "in TU (1 TU = 1024 us)", HFILL }},
24629
24630     {&hf_ieee80211_tag_measure_request_operating_class,
24631      {"Operating Class", "wlan.measure.req.operatingclass",
24632       FT_UINT8, BASE_DEC, NULL, 0,
24633       NULL, HFILL }},
24634
24635     {&hf_ieee80211_tag_measure_request_randomization_interval,
24636      {"Randomization Interval", "wlan.measure.req.randint",
24637       FT_UINT16, BASE_HEX, NULL, 0,
24638       "in TU (1 TU = 1024 us)", HFILL }},
24639
24640     {&hf_ieee80211_tag_measure_request_measurement_mode,
24641      {"Measurement Mode", "wlan.measure.req.measurementmode",
24642       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_measurement_mode_flags), 0,
24643       NULL, HFILL }},
24644
24645     {&hf_ieee80211_tag_measure_request_bssid,
24646      {"BSSID", "wlan.measure.req.bssid",
24647       FT_ETHER, BASE_NONE, NULL, 0,
24648       NULL, HFILL }},
24649
24650     {&hf_ieee80211_tag_measure_request_subelement_length,
24651      {"Length", "wlan.measure.req.sub.length",
24652       FT_UINT8, BASE_DEC, NULL, 0,
24653       NULL, HFILL }},
24654
24655     {&hf_ieee80211_tag_measure_request_beacon_sub_id,
24656      {"SubElement ID", "wlan.measure.req.beacon.sub.id",
24657       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_beacon_sub_id_flags), 0,
24658       NULL, HFILL }},
24659
24660     {&hf_ieee80211_tag_measure_request_beacon_sub_ssid,
24661      {"SSID", "wlan.measure.req.beacon.sub.ssid",
24662       FT_STRING, BASE_NONE, 0, 0,
24663       NULL, HFILL }},
24664
24665     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition,
24666      {"Reporting Condition", "wlan.measure.req.beacon.sub.bri.repcond",
24667       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags), 0,
24668       NULL, HFILL }},
24669
24670     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset,
24671      {"Threshold/Offset", "wlan.measure.req.beacon.sub.bri.threshold_offset",
24672       FT_UINT8, BASE_HEX, NULL, 0,
24673       NULL, HFILL }},
24674
24675     {&hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail,
24676      {"Reporting Detail", "wlan.measure.req.beacon.sub.bri.reporting_detail",
24677       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags), 0,
24678       NULL, HFILL }},
24679
24680     {&hf_ieee80211_tag_measure_request_beacon_sub_request,
24681      {"Request", "wlan.measure.req.beacon.sub.request",
24682       FT_UINT8, BASE_DEC, 0, 0,
24683       NULL, HFILL }},
24684
24685     {&hf_ieee80211_tag_measure_request_beacon_unknown,
24686      {"Unknown Data", "wlan.measure.req.beacon.unknown",
24687       FT_BYTES, BASE_NONE, NULL, 0,
24688       "(not interpreted)", HFILL }},
24689
24690     {&hf_ieee80211_tag_measure_request_channel_load_sub_id,
24691      {"SubElement ID", "wlan.measure.req.channel_load.sub.id",
24692       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_channel_load_sub_id_vals), 0,
24693       NULL, HFILL }},
24694
24695     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition,
24696      {"Reporting Condition", "wlan.measure.req.channel_load.sub.repcond",
24697       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals), 0,
24698       NULL, HFILL }},
24699
24700     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref,
24701      {"Reference Value", "wlan.measure.req.channel_load.sub.ref",
24702       FT_UINT8, BASE_HEX, NULL, 0,
24703       NULL, HFILL }},
24704
24705
24706     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_id,
24707      {"SubElement ID", "wlan.measure.req.noise_histogram.sub.id",
24708       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_noise_histogram_sub_id_vals), 0,
24709       NULL, HFILL }},
24710
24711     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition,
24712      {"Reporting Condition", "wlan.measure.reqnoise_histogram.sub.repcond",
24713       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals), 0,
24714       NULL, HFILL }},
24715
24716     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref,
24717      {"ANPI Reference Value", "wlan.measure.req.noise_histogram.sub.anpiref",
24718       FT_UINT8, BASE_HEX, NULL, 0,
24719       NULL, HFILL }},
24720
24721
24722     {&hf_ieee80211_tag_measure_request_frame_request_type,
24723      {"Frame Request Type", "wlan.measure.req.frame_request_type",
24724       FT_UINT8, BASE_HEX, NULL, 0,
24725       NULL, HFILL }},
24726
24727     {&hf_ieee80211_tag_measure_request_mac_address,
24728      {"MAC Address", "wlan.measure.req.mac_address",
24729       FT_BYTES, BASE_NONE, NULL, 0,
24730       NULL, HFILL }},
24731
24732     {&hf_ieee80211_tag_measure_request_peer_mac_address,
24733      {"Peer MAC Address", "wlan.measure.req.peer_mac_address",
24734       FT_BYTES, BASE_NONE, NULL, 0,
24735       NULL, HFILL }},
24736
24737     {&hf_ieee80211_tag_measure_request_group_id,
24738      {"Group ID", "wlan.measure.req.groupid",
24739       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_group_id_flags_ext, 0,
24740       NULL, HFILL }},
24741
24742     {&hf_ieee80211_tag_measure_request_unknown,
24743      {"Unknown Data", "wlan.measure.req.unknown",
24744       FT_BYTES, BASE_NONE, NULL, 0,
24745       "(not interpreted)", HFILL }},
24746
24747     {&hf_ieee80211_tag_measure_report_measurement_token,
24748      {"Measurement Token", "wlan.measure.req.token",
24749       FT_UINT8, BASE_HEX, NULL, 0,
24750       NULL, HFILL }},
24751
24752     {&hf_ieee80211_tag_measure_report_mode,
24753      {"Measurement Report Mode", "wlan.measure.req.mode",
24754       FT_UINT8, BASE_HEX, NULL, 0,
24755       NULL, HFILL }},
24756
24757     {&hf_ieee80211_tag_measure_report_mode_late,
24758      {"Measurement Report Mode Field", "wlan.measure.rep.repmode.late",
24759       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24760       NULL, HFILL }},
24761
24762     {&hf_ieee80211_tag_measure_report_mode_incapable,
24763      {"Measurement Reports", "wlan.measure.rep.repmode.incapable",
24764       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x02,
24765       NULL, HFILL }},
24766
24767     {&hf_ieee80211_tag_measure_report_mode_refused,
24768      {"Autonomous Measurement Reports", "wlan.measure.rep.repmode.refused",
24769       FT_BOOLEAN, 8, TFS(&tfs_accepted_not_accepted), 0x04,
24770       NULL, HFILL }},
24771
24772     {&hf_ieee80211_tag_measure_report_mode_reserved,
24773      {"Reserved", "wlan.measure.rep.repmode.reserved",
24774       FT_UINT8, BASE_HEX, NULL, 0xf8,
24775       NULL, HFILL }},
24776
24777     {&hf_ieee80211_tag_measure_report_type,
24778      {"Measurement Report Type", "wlan.measure.rep.reptype",
24779       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_report_type_flags_ext, 0x00,
24780       NULL, HFILL }},
24781
24782     {&hf_ieee80211_tag_measure_report_channel_number,
24783      {"Measurement Channel Number", "wlan.measure.rep.channelnumber",
24784       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
24785       NULL, HFILL }},
24786
24787     {&hf_ieee80211_tag_measure_report_start_time,
24788      {"Measurement Start Time", "wlan.measure.rep.starttime",
24789       FT_UINT64, BASE_HEX, NULL, 0,
24790       NULL, HFILL }},
24791
24792     {&hf_ieee80211_tag_measure_report_duration,
24793      {"Measurement Duration", "wlan.measure.rep.channelnumber",
24794       FT_UINT16, BASE_HEX, NULL, 0,
24795       NULL, HFILL }},
24796
24797     {&hf_ieee80211_tag_measure_cca_busy_fraction,
24798      {"CCA Busy Fraction", "wlan.measure.rep.ccabusy",
24799       FT_UINT8, BASE_HEX, NULL, 0,
24800       NULL, HFILL }},
24801
24802     {&hf_ieee80211_tag_measure_basic_map_field,
24803      {"Map Field", "wlan.measure.rep.mapfield",
24804       FT_UINT8, BASE_HEX, NULL, 0,
24805       NULL, HFILL }},
24806
24807     {&hf_ieee80211_tag_measure_map_field_bss,
24808      {"BSS", "wlan.measure.rep.repmode.mapfield.bss",
24809       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_map_field_bss_flag), 0x01,
24810       NULL, HFILL }},
24811
24812     {&hf_ieee80211_tag_measure_map_field_odfm,
24813      {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan.measure.rep.repmode.mapfield.bss",
24814       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x02,
24815       NULL, HFILL }},
24816
24817     {&hf_ieee80211_tag_measure_map_field_unident_signal,
24818      {"Unidentified Signal", "wlan.measure.rep.repmode.mapfield.unidentsig",
24819       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x04,
24820       NULL, HFILL }},
24821
24822     {&hf_ieee80211_tag_measure_map_field_radar,
24823      {"Radar", "wlan.measure.rep.repmode.mapfield.radar",
24824       FT_BOOLEAN, 8, TFS(&tfs_detected_not_detected), 0x08,
24825       NULL, HFILL }},
24826
24827     {&hf_ieee80211_tag_measure_map_field_unmeasured,
24828      {"Unmeasured", "wlan.measure.rep.repmode.mapfield.unmeasured",
24829       FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x10,
24830       NULL, HFILL }},
24831
24832     {&hf_ieee80211_tag_measure_map_field_reserved,
24833      {"Reserved", "wlan.measure.rep.repmode.mapfield.reserved",
24834       FT_UINT8, BASE_HEX, NULL, 0xe0,
24835       NULL, HFILL }},
24836
24837     {&hf_ieee80211_tag_measure_rpi_histogram_report,
24838      {"Receive Power Indicator (RPI) Histogram Report", "wlan.measure.rep.rpi.histogram_report",
24839       FT_BYTES, BASE_NONE, NULL, 0,
24840       NULL, HFILL }},
24841
24842     {&hf_ieee80211_tag_measure_rpi_histogram_report_0,
24843      {"RPI 0 Density", "wlan.measure.rep.rpi.rpi0density",
24844       FT_UINT8, BASE_HEX, NULL, 0,
24845       "Receive Power Indicator (RPI) 0 Density", HFILL }},
24846
24847     {&hf_ieee80211_tag_measure_rpi_histogram_report_1,
24848      {"RPI 1 Density", "wlan.measure.rep.rpi.rpi1density",
24849       FT_UINT8, BASE_HEX, NULL, 0,
24850       "Receive Power Indicator (RPI) 1 Density", HFILL }},
24851
24852     {&hf_ieee80211_tag_measure_rpi_histogram_report_2,
24853      {"RPI 2 Density", "wlan.measure.rep.rpi.rpi2density",
24854       FT_UINT8, BASE_HEX, NULL, 0,
24855       "Receive Power Indicator (RPI) 2 Density", HFILL }},
24856
24857     {&hf_ieee80211_tag_measure_rpi_histogram_report_3,
24858      {"RPI 3 Density", "wlan.measure.rep.rpi.rpi3density",
24859       FT_UINT8, BASE_HEX, NULL, 0,
24860       "Receive Power Indicator (RPI) 3 Density", HFILL }},
24861
24862     {&hf_ieee80211_tag_measure_rpi_histogram_report_4,
24863      {"RPI 4 Density", "wlan.measure.rep.rpi.rpi4density",
24864       FT_UINT8, BASE_HEX, NULL, 0,
24865       "Receive Power Indicator (RPI) 4 Density", HFILL }},
24866
24867     {&hf_ieee80211_tag_measure_rpi_histogram_report_5,
24868      {"RPI 5 Density", "wlan.measure.rep.rpi.rpi5density",
24869       FT_UINT8, BASE_HEX, NULL, 0,
24870       "Receive Power Indicator (RPI) 5 Density", HFILL }},
24871
24872     {&hf_ieee80211_tag_measure_rpi_histogram_report_6,
24873      {"RPI 6 Density", "wlan.measure.rep.rpi.rpi6density",
24874       FT_UINT8, BASE_HEX, NULL, 0,
24875       "Receive Power Indicator (RPI) 6 Density", HFILL }},
24876
24877     {&hf_ieee80211_tag_measure_rpi_histogram_report_7,
24878      {"RPI 7 Density", "wlan.measure.rep.rpi.rpi7density",
24879       FT_UINT8, BASE_HEX, NULL, 0,
24880       "Receive Power Indicator (RPI) 7 Density", HFILL }},
24881
24882     {&hf_ieee80211_tag_measure_report_operating_class,
24883      {"Operating Class", "wlan.measure.rep.operatingclass",
24884       FT_UINT8, BASE_DEC, NULL, 0,
24885       NULL, HFILL }},
24886
24887     {&hf_ieee80211_tag_measure_report_channel_load,
24888      {"Channel Load", "wlan.measure.rep.chanload",
24889       FT_UINT8, BASE_HEX, NULL, 0,
24890       NULL, HFILL }},
24891
24892     {&hf_ieee80211_tag_measure_report_frame_info,
24893      {"Reported Frame Information", "wlan.measure.rep.frameinfo",
24894       FT_UINT8, BASE_HEX, NULL, 0,
24895       NULL, HFILL }},
24896
24897     {&hf_ieee80211_tag_measure_report_frame_info_phy_type,
24898      {"Condensed PHY", "wlan.measure.rep.frameinfo.phytype",
24899       FT_UINT8, BASE_HEX, NULL, 0x7F,
24900       NULL, HFILL }},
24901
24902     {&hf_ieee80211_tag_measure_report_frame_info_frame_type,
24903      {"Reported Frame Type", "wlan.measure.rep.frameinfo.frametype",
24904       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_report_frame_info_frame_type_flag), 0x80,
24905       NULL, HFILL }},
24906
24907     {&hf_ieee80211_tag_measure_report_rcpi,
24908      {"Received Channel Power Indicator (RCPI)", "wlan.measure.rep.rcpi",
24909       FT_UINT8, BASE_HEX, NULL, 0,
24910       "in dBm", HFILL }},
24911
24912     {&hf_ieee80211_tag_measure_report_rsni,
24913      {"Received Signal to Noise Indicator (RSNI)", "wlan.measure.rep.rsni",
24914       FT_UINT8, BASE_HEX, NULL, 0,
24915       "in dB", HFILL }},
24916
24917     {&hf_ieee80211_tag_measure_report_bssid,
24918      {"BSSID Being Reported", "wlan.measure.rep.bssid",
24919       FT_ETHER, BASE_NONE, NULL, 0,
24920       NULL, HFILL }},
24921
24922     {&hf_ieee80211_tag_measure_report_ant_id,
24923      {"Antenna ID", "wlan.measure.rep.antid",
24924       FT_UINT8, BASE_HEX, NULL, 0,
24925       NULL, HFILL }},
24926
24927     {&hf_ieee80211_tag_measure_report_anpi,
24928      {"ANPI", "wlan.measure.rep.anpi",
24929       FT_UINT8, BASE_HEX, NULL, 0,
24930       NULL, HFILL }},
24931
24932     {&hf_ieee80211_tag_measure_report_ipi_density_0,
24933      {"IPI Density 0", "wlan.measure.rep.ipi_density0",
24934       FT_UINT8, BASE_HEX, NULL, 0,
24935       NULL, HFILL }},
24936
24937     {&hf_ieee80211_tag_measure_report_ipi_density_1,
24938      {"IPI Density 1", "wlan.measure.rep.ipi_density1",
24939       FT_UINT8, BASE_HEX, NULL, 0,
24940       NULL, HFILL }},
24941
24942     {&hf_ieee80211_tag_measure_report_ipi_density_2,
24943      {"IPI Density 2", "wlan.measure.rep.ipi_density2",
24944       FT_UINT8, BASE_HEX, NULL, 0,
24945       NULL, HFILL }},
24946
24947     {&hf_ieee80211_tag_measure_report_ipi_density_3,
24948      {"IPI Density 3", "wlan.measure.rep.ipi_density3",
24949       FT_UINT8, BASE_HEX, NULL, 0,
24950       NULL, HFILL }},
24951
24952     {&hf_ieee80211_tag_measure_report_ipi_density_4,
24953      {"IPI Density 4", "wlan.measure.rep.ipi_density4",
24954       FT_UINT8, BASE_HEX, NULL, 0,
24955       NULL, HFILL }},
24956
24957     {&hf_ieee80211_tag_measure_report_ipi_density_5,
24958      {"IPI Density 5", "wlan.measure.rep.ipi_density5",
24959       FT_UINT8, BASE_HEX, NULL, 0,
24960       NULL, HFILL }},
24961
24962     {&hf_ieee80211_tag_measure_report_ipi_density_6,
24963      {"IPI Density 6", "wlan.measure.rep.ipi_density6",
24964       FT_UINT8, BASE_HEX, NULL, 0,
24965       NULL, HFILL }},
24966
24967     {&hf_ieee80211_tag_measure_report_ipi_density_7,
24968      {"IPI Density 7", "wlan.measure.rep.ipi_density7",
24969       FT_UINT8, BASE_HEX, NULL, 0,
24970       NULL, HFILL }},
24971
24972     {&hf_ieee80211_tag_measure_report_ipi_density_8,
24973      {"IPI Density 8", "wlan.measure.rep.ipi_density8",
24974       FT_UINT8, BASE_HEX, NULL, 0,
24975       NULL, HFILL }},
24976
24977     {&hf_ieee80211_tag_measure_report_ipi_density_9,
24978      {"IPI Density 9", "wlan.measure.rep.ipi_density9",
24979       FT_UINT8, BASE_HEX, NULL, 0,
24980       NULL, HFILL }},
24981
24982     {&hf_ieee80211_tag_measure_report_ipi_density_10,
24983      {"IPI Density 10", "wlan.measure.rep.ipi_density10",
24984       FT_UINT8, BASE_HEX, NULL, 0,
24985       NULL, HFILL }},
24986
24987     {&hf_ieee80211_tag_measure_report_parent_tsf,
24988      {"Parent Timing Synchronization Function (TSF)", "wlan.measure.rep.parenttsf",
24989       FT_UINT32, BASE_HEX, NULL, 0,
24990       NULL, HFILL }},
24991
24992     {&hf_ieee80211_tag_measure_report_subelement_length,
24993      {"Length", "wlan.measure.req.sub.length",
24994       FT_UINT8, BASE_DEC, NULL, 0,
24995       NULL, HFILL }},
24996
24997     {&hf_ieee80211_tag_measure_report_beacon_sub_id,
24998      {"SubElement ID", "wlan.measure.req.beacon.sub.id",
24999       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_report_beacon_sub_id_vals), 0,
25000       NULL, HFILL }},
25001
25002     {&hf_ieee80211_tag_measure_report_unknown,
25003      {"Unknown Data", "wlan.measure.rep.unknown",
25004       FT_BYTES, BASE_NONE, NULL, 0,
25005       "(not interpreted)", HFILL }},
25006
25007     {&hf_ieee80211_tag_quiet_count,
25008      {"Count", "wlan.quiet.count",
25009       FT_UINT8, BASE_DEC, NULL, 0,
25010       "Set to the number of TBTTs until the beacon interval during which the next quiet interval shall start", HFILL }},
25011
25012     {&hf_ieee80211_tag_quiet_period,
25013      {"Period", "wlan.quiet.period",
25014       FT_UINT8, BASE_DEC, NULL, 0,
25015       "Set to the number of beacon intervals between the start of regularly scheduled quiet intervals", HFILL }},
25016
25017     {&hf_ieee80211_tag_quiet_duration,
25018      {"Duration", "wlan.quiet.duration",
25019       FT_UINT16, BASE_DEC, NULL, 0,
25020       "Set to the duration of the quiet interval", HFILL }},
25021
25022     {&hf_ieee80211_tag_quiet_offset,
25023      {"Offset", "wlan.quiet.offset",
25024       FT_UINT16, BASE_DEC, NULL, 0,
25025       "Set to the offset of the start of the quiet interval from the TBTT", HFILL }},
25026
25027     {&hf_ieee80211_tag_dfs_owner,
25028      {"Owner", "wlan.dfs.owner",
25029       FT_ETHER, BASE_NONE, NULL, 0,
25030       "Set to the individual IEEE MAC address of the STA that is the currently known DFS Owner in the IBSS", HFILL  }},
25031
25032     {&hf_ieee80211_tag_dfs_recovery_interval,
25033      {"Recovery Interval", "wlan.dfs.recovery_interval",
25034       FT_UINT8, BASE_DEC, NULL, 0,
25035       "Indicates the time interval that shall be used for DFS owner recovery", HFILL  }},
25036
25037     {&hf_ieee80211_tag_dfs_channel_map,
25038      {"Channel Map", "wlan.dfs.channel_map",
25039       FT_NONE, BASE_NONE, NULL, 0,
25040       NULL, HFILL  }},
25041
25042     {&hf_ieee80211_tag_dfs_channel_number,
25043      {"Channel Number", "wlan.dfs.channel_number",
25044       FT_UINT8, BASE_DEC, NULL, 0,
25045       NULL, HFILL  }},
25046
25047     {&hf_ieee80211_tag_dfs_map,
25048      {"Map", "wlan.dfs.map",
25049       FT_UINT8, BASE_HEX, NULL, 0,
25050       NULL, HFILL  }},
25051
25052     {&hf_ieee80211_tag_erp_info,
25053      {"ERP Information", "wlan.erp_info",
25054       FT_UINT8, BASE_HEX, NULL, 0,
25055       NULL, HFILL  }},
25056
25057     {&hf_ieee80211_tag_erp_info_erp_present,
25058      {"Non ERP Present", "wlan.erp_info.erp_present",
25059       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
25060       NULL, HFILL  }},
25061
25062     {&hf_ieee80211_tag_erp_info_use_protection,
25063      {"Use Protection", "wlan.erp_info.use_protection",
25064       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
25065       NULL, HFILL  }},
25066
25067     {&hf_ieee80211_tag_erp_info_barker_preamble_mode,
25068      {"Barker Preamble Mode", "wlan.erp_info.barker_preamble_mode",
25069       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
25070       NULL, HFILL  }},
25071
25072     {&hf_ieee80211_tag_erp_info_reserved,
25073      {"Reserved", "wlan.erp_info.reserved",
25074       FT_UINT8, BASE_HEX, NULL, 0xF8,
25075       NULL, HFILL  }},
25076
25077     /* Table 8-103-Capabilities field */
25078     {&hf_ieee80211_tag_extended_capabilities,
25079      {"Extended Capabilities", "wlan.extcap",
25080       FT_UINT8, BASE_HEX, NULL, 0,
25081       NULL, HFILL }},
25082
25083     /* P802.11n/D6.0 */
25084     /* Extended Capability octet 1 */
25085     {&hf_ieee80211_tag_extended_capabilities_b0,
25086      {"20/40 BSS Coexistence Management Support", "wlan.extcap.b0",
25087       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25088       "HT Information Exchange Support", HFILL }},
25089
25090     /* P802.11p/D4.0 */
25091     {&hf_ieee80211_tag_extended_capabilities_b1,
25092      {"On-demand beacon", "wlan.extcap.b1",
25093       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
25094       NULL, HFILL }},
25095
25096     {&hf_ieee80211_tag_extended_capabilities_b2,
25097      {"Extended Channel Switching", "wlan.extcap.b2",
25098       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
25099       NULL, HFILL }},
25100
25101     {&hf_ieee80211_tag_extended_capabilities_b3,
25102      {"WAVE indication", "wlan.extcap.b3",
25103       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
25104       NULL, HFILL }},
25105     /*End: P802.11p/D4.0 */
25106
25107     {&hf_ieee80211_tag_extended_capabilities_b4,
25108      {"PSMP Capability", "wlan.extcap.b4",
25109       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
25110       NULL, HFILL }},
25111
25112     {&hf_ieee80211_tag_extended_capabilities_b5,
25113      {"Reserved", "wlan.extcap.b5",
25114       FT_UINT8, BASE_HEX, NULL, 0x20,
25115       "Must be zero", HFILL }},
25116
25117     {&hf_ieee80211_tag_extended_capabilities_b6,
25118      {"S-PSMP Support", "wlan.extcap.b6",
25119       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25120       NULL, HFILL }},
25121
25122     {&hf_ieee80211_tag_extended_capabilities_b7,
25123      {"Event", "wlan.extcap.b7",
25124       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
25125       NULL, HFILL }},
25126
25127
25128     /* Extended Capability octet 2 */
25129     {&hf_ieee80211_tag_extended_capabilities_b8,
25130      {"Diagnostics", "wlan.extcap.b8",
25131       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25132       NULL, HFILL }},
25133
25134     {&hf_ieee80211_tag_extended_capabilities_b9,
25135      {"Multicast Diagnostics", "wlan.extcap.b9",
25136       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
25137       NULL, HFILL }},
25138
25139     {&hf_ieee80211_tag_extended_capabilities_b10,
25140      {"Location Tracking", "wlan.extcap.b10",
25141       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
25142       NULL, HFILL }},
25143
25144     {&hf_ieee80211_tag_extended_capabilities_b11,
25145      {"FMS", "wlan.extcap.b11",
25146       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
25147       NULL, HFILL }},
25148
25149     {&hf_ieee80211_tag_extended_capabilities_b12,
25150      {"Proxy ARP Service", "wlan.extcap.b12",
25151       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
25152       NULL, HFILL }},
25153
25154     {&hf_ieee80211_tag_extended_capabilities_b13,
25155      {"Collocated Interference Reporting", "wlan.extcap.b13",
25156       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25157       NULL, HFILL }},
25158
25159     {&hf_ieee80211_tag_extended_capabilities_b14,
25160      {"Civic Location", "wlan.extcap.b14",
25161       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25162       NULL, HFILL }},
25163
25164     {&hf_ieee80211_tag_extended_capabilities_b15,
25165      {"Geospatial Location", "wlan.extcap.b15",
25166       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
25167       NULL, HFILL }},
25168
25169
25170     /* Extended Capability octet 3 */
25171     {&hf_ieee80211_tag_extended_capabilities_b16,
25172      {"TFS", "wlan.extcap.b16",
25173       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25174       NULL, HFILL }},
25175
25176     {&hf_ieee80211_tag_extended_capabilities_b17,
25177      {"WNM-Sleep Mode", "wlan.extcap.b17",
25178       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
25179       NULL, HFILL }},
25180
25181     {&hf_ieee80211_tag_extended_capabilities_b18,
25182      {"TIM Broadcast", "wlan.extcap.b18",
25183       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
25184       NULL, HFILL }},
25185
25186     {&hf_ieee80211_tag_extended_capabilities_b19,
25187      {"BSS Transition", "wlan.extcap.b19",
25188       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
25189       NULL, HFILL }},
25190
25191     {&hf_ieee80211_tag_extended_capabilities_b20,
25192      {"QoS Traffic Capability", "wlan.extcap.b20",
25193       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
25194       NULL, HFILL }},
25195
25196     {&hf_ieee80211_tag_extended_capabilities_b21,
25197      {"AC Station Count", "wlan.extcap.b21",
25198       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25199       NULL, HFILL }},
25200
25201     {&hf_ieee80211_tag_extended_capabilities_b22,
25202      {"Multiple BSSID", "wlan.extcap.b22",
25203       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25204       NULL, HFILL }},
25205
25206     {&hf_ieee80211_tag_extended_capabilities_b23,
25207      {"Timing Measurement", "wlan.extcap.b23",
25208       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
25209       NULL, HFILL }},
25210
25211
25212     /* Extended Capability octet 4 */
25213     {&hf_ieee80211_tag_extended_capabilities_b24,
25214      {"Channel Usage", "wlan.extcap.b24",
25215       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25216       NULL, HFILL }},
25217
25218     {&hf_ieee80211_tag_extended_capabilities_b25,
25219      {"SSID List", "wlan.extcap.b25",
25220       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
25221       NULL, HFILL }},
25222
25223     {&hf_ieee80211_tag_extended_capabilities_b26,
25224      {"DMS", "wlan.extcap.b26",
25225       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
25226       NULL, HFILL }},
25227
25228     {&hf_ieee80211_tag_extended_capabilities_b27,
25229      {"UTC TSF Offset", "wlan.extcap.b27",
25230       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
25231       NULL, HFILL }},
25232
25233     {&hf_ieee80211_tag_extended_capabilities_b28,
25234      {"Peer U-APSD Buffer STA Support", "wlan.extcap.b28",
25235       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
25236       NULL, HFILL }},
25237
25238     {&hf_ieee80211_tag_extended_capabilities_b29,
25239      {"TDLS Peer PSM Support", "wlan.extcap.b29",
25240       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25241       NULL, HFILL }},
25242
25243     {&hf_ieee80211_tag_extended_capabilities_b30,
25244      {"TDLS channel switching", "wlan.extcap.b30",
25245       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25246       NULL, HFILL }},
25247
25248     {&hf_ieee80211_tag_extended_capabilities_b31,
25249      {"Interworking", "wlan.extcap.b31",
25250       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
25251       NULL, HFILL }},
25252
25253
25254     /* Extended Capability octet 5 */
25255     {&hf_ieee80211_tag_extended_capabilities_b32,
25256      {"QoS Map", "wlan.extcap.b32",
25257       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25258       NULL, HFILL }},
25259
25260     {&hf_ieee80211_tag_extended_capabilities_b33,
25261      {"EBR", "wlan.extcap.b33",
25262       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
25263       NULL, HFILL }},
25264
25265     {&hf_ieee80211_tag_extended_capabilities_b34,
25266      {"SSPN Interface", "wlan.extcap.b34",
25267       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
25268       NULL, HFILL }},
25269
25270     {&hf_ieee80211_tag_extended_capabilities_b35,
25271      {"Reserved", "wlan.extcap.b35",
25272       FT_UINT8, BASE_HEX, NULL, 0x08,
25273       "Must be zero", HFILL }},
25274
25275     {&hf_ieee80211_tag_extended_capabilities_b36,
25276      {"MSGCF Capability", "wlan.extcap.b36",
25277       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
25278       NULL, HFILL }},
25279
25280     {&hf_ieee80211_tag_extended_capabilities_b37,
25281      {"TDLS support", "wlan.extcap.b37",
25282       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25283       NULL, HFILL }},
25284
25285     {&hf_ieee80211_tag_extended_capabilities_b38,
25286      {"TDLS Prohibited", "wlan.extcap.b38",
25287       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25288       NULL, HFILL }},
25289
25290     {&hf_ieee80211_tag_extended_capabilities_b39,
25291      {"TDLS Channel Switching Prohibited", "wlan.extcap.b39",
25292       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
25293       NULL, HFILL }},
25294
25295     /* Extended Capability octet 6 */
25296     {&hf_ieee80211_tag_extended_capabilities_b40,
25297      {"Reject Unadmitted Frame", "wlan.extcap.b40",
25298       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25299       NULL, HFILL }},
25300
25301     {&hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
25302      {"Service Interval Granularity",
25303       "wlan.extcap.serv_int_granularity",
25304       FT_UINT8, BASE_DEC, VALS(service_interval_granularity_vals), 0x0e,
25305       NULL, HFILL }},
25306
25307     {&hf_ieee80211_tag_extended_capabilities_b44,
25308      {"Identifier Location", "wlan.extcap.b44",
25309       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
25310       NULL, HFILL }},
25311
25312     {&hf_ieee80211_tag_extended_capabilities_b45,
25313      {"U-APSD Coexistence", "wlan.extcap.b45",
25314       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25315       NULL, HFILL }},
25316
25317     {&hf_ieee80211_tag_extended_capabilities_b46,
25318      {"WNM-Notification", "wlan.extcap.b46",
25319       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25320       NULL, HFILL }},
25321
25322     {&hf_ieee80211_tag_extended_capabilities_b47,
25323      {"QAB Capability", "wlan.extcap.b47",
25324       FT_UINT8, BASE_HEX, NULL, 0x80,
25325       "AP supports QAB", HFILL }},
25326
25327     /* Extended Capability octet 7 */
25328     {&hf_ieee80211_tag_extended_capabilities_b48,
25329      {"UTF-8 SSID", "wlan.extcap.b48",
25330       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25331       "The SSID in this BSS is interpreted using UTF-8 encoding", HFILL }},
25332
25333     {&hf_ieee80211_tag_extended_capabilities_o7,
25334      {"Reserved", "wlan.extcap.o7",
25335       FT_UINT8, BASE_HEX, NULL, 0xfe,
25336       "Must be zero", HFILL }},
25337
25338     /* Extended Capability octet 8 */
25339     {&hf_ieee80211_tag_extended_capabilities_b61,
25340      {"TDLS Wider Bandwidth", "wlan.extcap.b61",
25341       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25342       NULL, HFILL }},
25343
25344     {&hf_ieee80211_tag_extended_capabilities_b62,
25345      {"Operating Mode Notification", "wlan.extcap.b62",
25346       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25347       NULL, HFILL }},
25348
25349     {&hf_ieee80211_tag_extended_capabilities_b63,
25350      {"Max Number Of MSDUs In A-MSDU", "wlan.extcap.b63",
25351       FT_UINT8, BASE_DEC, NULL, 0x80,
25352       "Part 1 (bit63)", HFILL }},
25353
25354     {&hf_ieee80211_tag_extended_capabilities_o8,
25355      {"Reserved", "wlan.extcap.o8",
25356       FT_UINT8, BASE_HEX, NULL, 0x1f,
25357       "Must be zero", HFILL }},
25358
25359     /* Extended Capability octet 9 */
25360     {&hf_ieee80211_tag_extended_capabilities_b64,
25361      {"Max Number Of MSDUs In A-MSDU64", "wlan.extcap.b64",
25362       FT_UINT8, BASE_DEC, NULL, 0x01,
25363       "Part 2 (bit64)", HFILL }},
25364
25365     {&hf_ieee80211_tag_extended_capabilities_o9,
25366      {"Reserved", "wlan.extcap.o9",
25367       FT_UINT8, BASE_HEX, NULL, 0xfe,
25368       "Must be zero", HFILL }},
25369
25370     {&hf_ieee80211_tag_cisco_ccx1_unknown,
25371      {"Unknown", "wlan.cisco.ccx1.unknown",
25372       FT_BYTES, BASE_NONE, NULL, 0,
25373       NULL, HFILL }},
25374
25375     {&hf_ieee80211_tag_cisco_ccx1_name,
25376      {"Name", "wlan.cisco.ccx1.name",
25377       FT_STRING, BASE_NONE, NULL, 0,
25378       NULL, HFILL }},
25379
25380     {&hf_ieee80211_tag_cisco_ccx1_clients,
25381      {"Clients", "wlan.cisco.ccx1.clients",
25382       FT_UINT8, BASE_DEC, NULL, 0,
25383       NULL, HFILL }},
25384
25385     {&hf_ieee80211_tag_cisco_ccx1_unknown2,
25386      {"Unknown2", "wlan.cisco.ccx1.unknown2",
25387       FT_BYTES, BASE_NONE, NULL, 0,
25388       NULL, HFILL }},
25389
25390     {&hf_ieee80211_tag_neighbor_report_bssid,
25391      {"BSSID", "wlan.nreport.bssid",
25392       FT_ETHER, BASE_NONE, NULL, 0,
25393       NULL, HFILL }},
25394
25395     {&hf_ieee80211_tag_neighbor_report_bssid_info,
25396      {"BSSID Information", "wlan.nreport.bssid.info",
25397       FT_UINT32, BASE_HEX, NULL, 0,
25398       NULL, HFILL }},
25399
25400     {&hf_ieee80211_tag_neighbor_report_bssid_info_reachability,
25401      {"AP Reachability", "wlan.nreport.bssid.info.reachability",
25402       FT_UINT32, BASE_HEX, VALS(ieee80211_neighbor_report_bssid_info_reachability_vals), 0x00000003,
25403       "Indicates whether the AP identified by this BSSID is reachable by the STA that requested the neighbor report", HFILL }},
25404
25405     {&hf_ieee80211_tag_neighbor_report_bssid_info_security,
25406      {"Security", "wlan.nreport.bssid.info.security",
25407       FT_BOOLEAN, 32, NULL, 0x00000004,
25408       "Indicates that the AP identified by this BSSID supports the same security provisioning as used by the STA in its current association", HFILL }},
25409
25410     {&hf_ieee80211_tag_neighbor_report_bssid_info_key_scope,
25411      {"Key Scope", "wlan.nreport.bssid.info.keyscope",
25412       FT_BOOLEAN, 32, NULL, 0x00000008,
25413       "indicates the AP indicated by this BSSID has the same authenticator as the AP sending the report", HFILL }},
25414
25415     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability,
25416      {"Capability", "wlan.nreport.bssid.info.capability",
25417       FT_UINT32, BASE_HEX, NULL, 0x000003F0,
25418       "Contains selected capability information for the AP indicated by this BSSID", HFILL }},
25419
25420     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng,
25421      {"Spectrum Management", "wlan.nreport.bssid.info.capability.specmngt",
25422       FT_BOOLEAN, 32, NULL, 0x00000010,
25423       NULL, HFILL }},
25424
25425     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos,
25426      {"QoS", "wlan.nreport.bssid.info.capability.qos",
25427       FT_BOOLEAN, 32, NULL, 0x00000020,
25428       NULL, HFILL }},
25429
25430     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd,
25431      {"APSD", "wlan.nreport.bssid.info.capability.apsd",
25432       FT_BOOLEAN, 32, NULL, 0x00000040,
25433       NULL, HFILL }},
25434
25435     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt,
25436      {"Radio Measurement", "wlan.nreport.bssid.info.capability.radiomsnt",
25437       FT_BOOLEAN, 32, NULL, 0x00000080,
25438       NULL, HFILL }},
25439
25440     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback,
25441      {"Delayed Block Ack", "wlan.nreport.bssid.info.capability.dback",
25442       FT_BOOLEAN, 32, NULL, 0x000000100,
25443       NULL, HFILL }},
25444
25445     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback,
25446      {"Immediate Block Ack", "wlan.nreport.bssid.info.capability.iback",
25447       FT_BOOLEAN, 32, NULL, 0x00000200,
25448       NULL, HFILL }},
25449
25450     {&hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain,
25451      {"Mobility Domain", "wlan.nreport.bssid.info.mobilitydomain",
25452       FT_BOOLEAN, 32, NULL, 0x00000400,
25453       "", HFILL }},
25454
25455     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput,
25456      {"High Throughput Control (+HTC)", "wlan.nreport.bssid.info.hthoughput",
25457       FT_BOOLEAN, 32, NULL, 0x00000800,
25458       NULL, HFILL }},
25459
25460     {&hf_ieee80211_tag_neighbor_report_bssid_info_reserved,
25461      {"Reserved", "wlan.nreport.bssid.info.reserved",
25462       FT_UINT32, BASE_HEX, NULL, 0xFFFFF000,
25463       "Must be zero", HFILL }},
25464
25465     {&hf_ieee80211_tag_neighbor_report_ope_class,
25466      {"Operating Class", "wlan.nreport.opeclass",
25467       FT_UINT8, BASE_DEC, NULL, 0,
25468       NULL, HFILL }},
25469
25470     {&hf_ieee80211_tag_neighbor_report_channel_number,
25471      {"Channel Number", "wlan.nreport.channumber",
25472       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
25473       NULL, HFILL }},
25474
25475     {&hf_ieee80211_tag_neighbor_report_phy_type,
25476      {"PHY Type", "wlan.nreport.phytype",
25477       FT_UINT8, BASE_HEX, NULL, 0,
25478       NULL, HFILL }},
25479
25480     {&hf_ieee80211_tag_neighbor_report_subelement_id,
25481      {"Subelement ID", "wlan.nreport.subelement_id",
25482       FT_UINT8, BASE_HEX, VALS(ieee80211_neighbor_report_subelement_id_vals), 0,
25483       NULL, HFILL }},
25484
25485     {&hf_ieee80211_tag_neighbor_report_subelement_length,
25486      {"Length", "wlan.nreport.phytype.subelement_length",
25487       FT_UINT8, BASE_HEX, NULL, 0,
25488       NULL, HFILL }},
25489
25490     {&hf_ieee80211_tag_supported_ope_classes_current,
25491      {"Current Operating Class", "wlan.supopeclass.current",
25492       FT_UINT8, BASE_HEX, NULL, 0,
25493       NULL, HFILL }},
25494
25495     {&hf_ieee80211_tag_supported_ope_classes_alternate,
25496      {"Alternate Operating Classes", "wlan.supopeclass.alt",
25497       FT_STRING, BASE_NONE, NULL, 0,
25498       NULL, HFILL }},
25499
25500     {&hf_ieee80211_wfa_ie_type,
25501      {"Type", "wlan.wfa.ie.type",
25502       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_type_vals), 0,
25503       NULL, HFILL }},
25504
25505     {&hf_ieee80211_wfa_ie_wpa_version,
25506      {"WPA Version", "wlan.wfa.ie.wpa.version",
25507       FT_UINT16, BASE_DEC, NULL, 0,
25508       NULL, HFILL }},
25509
25510     {&hf_ieee80211_wfa_ie_wpa_mcs,
25511      {"Multicast Cipher Suite", "wlan.wfa.ie.wpa.mcs",
25512       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_mcs_base_custom), 0,
25513       "Contains the cipher suite selector used by the BSS to protect broadcast/multicasttraffic", HFILL }},
25514
25515     {&hf_ieee80211_wfa_ie_wpa_mcs_oui,
25516      {"Multicast Cipher Suite OUI", "wlan.wfa.ie.wpa.mcs.oui",
25517       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
25518       NULL, HFILL }},
25519
25520     {&hf_ieee80211_wfa_ie_wpa_mcs_type,
25521      {"Multicast Cipher Suite type", "wlan.wfa.ie.wpa.mcs.type",
25522       FT_UINT8, BASE_DEC, NULL, 0,
25523       NULL, HFILL }},
25524
25525     {&hf_ieee80211_wfa_ie_wpa_mcs_wfa_type,
25526      {"Multicast Cipher Suite type", "wlan.wfa.ie.wpa.mcs.type",
25527       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
25528       NULL, HFILL }},
25529
25530     {&hf_ieee80211_wfa_ie_wpa_ucs_count,
25531      {"Unicast Cipher Suite Count", "wlan.wfa.ie.wpa.ucs.count",
25532       FT_UINT16, BASE_DEC, NULL, 0,
25533       "Indicates the number of pairwise cipher suite selectors that are contained in the Unicast Cipher Suite List", HFILL }},
25534
25535     {&hf_ieee80211_wfa_ie_wpa_ucs_list,
25536      {"Unicast Cipher Suite List", "wlan.wfa.ie.wpa.ucs.list",
25537       FT_NONE, BASE_NONE, NULL, 0,
25538       "Contains a series of cipher suite selectors that indicate the Unicast cipher suites", HFILL }},
25539
25540     {&hf_ieee80211_wfa_ie_wpa_ucs,
25541      {"Unicast Cipher Suite", "wlan.wfa.ie.wpa.ucs",
25542       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_ucs_base_custom), 0,
25543       NULL, HFILL }},
25544
25545     {&hf_ieee80211_wfa_ie_wpa_ucs_oui,
25546      {"Unicast Cipher Suite OUI", "wlan.wfa.ie.wpau.cs.oui",
25547       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
25548       NULL, HFILL }},
25549
25550     {&hf_ieee80211_wfa_ie_wpa_ucs_type,
25551      {"Unicast Cipher Suite type", "wlan.wfa.ie.wpa.ucs.type",
25552       FT_UINT8, BASE_DEC, NULL, 0,
25553       NULL, HFILL }},
25554
25555     {&hf_ieee80211_wfa_ie_wpa_ucs_wfa_type,
25556      {"Unicast Cipher Suite type", "wlan.wfa.ie.wpa.ucs.type",
25557       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
25558       NULL, HFILL }},
25559
25560     {&hf_ieee80211_wfa_ie_wpa_akms_count,
25561      {"Auth Key Management (AKM) Suite Count", "wlan.wfa.ie.wpa.akms.count",
25562       FT_UINT16, BASE_DEC, NULL, 0,
25563       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
25564
25565     {&hf_ieee80211_wfa_ie_wpa_akms_list,
25566      {"Auth Key Management (AKM) List", "wlan.wfa.ie.wpa.akms.list",
25567       FT_NONE, BASE_NONE, NULL, 0,
25568       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
25569
25570     {&hf_ieee80211_wfa_ie_wpa_akms,
25571      {"Auth Key Management (AKM) Suite", "wlan.wfa.ie.wpa.akms",
25572       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_akms_base_custom), 0,
25573       NULL, HFILL }},
25574
25575     {&hf_ieee80211_wfa_ie_wpa_akms_oui,
25576      {"Auth Key Management (AKM) OUI", "wlan.wfa.ie.wpa.akms.oui",
25577       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
25578       NULL, HFILL }},
25579
25580     {&hf_ieee80211_wfa_ie_wpa_akms_type,
25581      {"Auth Key Management (AKM) type", "wlan.wfa.ie.wpa.akms.type",
25582       FT_UINT8, BASE_DEC, NULL, 0,
25583       NULL, HFILL }},
25584
25585     {&hf_ieee80211_wfa_ie_wpa_akms_wfa_type,
25586      {"Auth Key Management (AKM) type", "wlan.wfa.ie.wpa.type",
25587       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_keymgmt_vals), 0,
25588       NULL, HFILL }},
25589
25590     {&hf_ieee80211_wfa_ie_wme_subtype,
25591      {"WME Subtype", "wlan.wfa.ie.wme.subtype",
25592       FT_UINT8, BASE_DEC, VALS(ieee802111_wfa_ie_wme_type), 0,
25593       NULL, HFILL }},
25594
25595     {&hf_ieee80211_wfa_ie_wme_version,
25596      {"WME Version", "wlan.wfa.ie.wme.version",
25597       FT_UINT8, BASE_DEC, NULL, 0,
25598       NULL, HFILL }},
25599
25600     {&hf_ieee80211_wfa_ie_wme_qos_info,
25601      {"WME QoS Info", "wlan.wfa.ie.wme.qos_info",
25602       FT_UINT8, BASE_HEX, NULL, 0,
25603       NULL, HFILL }},
25604
25605     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
25606      {"Max SP Length", "wlan.wfa.ie.wme.qos_info.sta.max_sp_length",
25607       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals), 0x60,
25608       NULL, HFILL }},
25609
25610     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
25611      {"AC_BE", "wlan.wfa.ie.wme.qos_info.sta.ac_be",
25612       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x08,
25613       NULL, HFILL }},
25614
25615     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
25616      {"AC_BK", "wlan.wfa.ie.wme.qos_info.sta.ac_bk",
25617       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x04,
25618       NULL, HFILL }},
25619
25620     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
25621      {"AC_VI", "wlan.wfa.ie.wme.qos_info.sta.ac_vi",
25622       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x02,
25623       NULL, HFILL }},
25624
25625     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
25626      {"AC_VO", "wlan.wfa.ie.wme.qos_info.sta.ac_vo",
25627       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x01,
25628       NULL, HFILL }},
25629
25630     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
25631      {"Reserved", "wlan.wfa.ie.wme.qos_info.sta.reserved",
25632       FT_UINT8, BASE_HEX, NULL, 0x90,
25633       "Must Be Zero", HFILL }},
25634
25635     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
25636      {"U-APSD", "wlan.wfa.ie.wme.qos_info.ap.u_apsd",
25637       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
25638       "Indicates the WMM AP is currently supporting unscheduled automatic power save delivery", HFILL }},
25639
25640     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
25641      {"Parameter Set Count", "wlan.wfa.ie.wme.qos_info.ap.parameter_set_count",
25642       FT_UINT8, BASE_HEX, NULL, 0x0F,
25643       NULL, HFILL }},
25644
25645     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
25646      {"Reserved", "wlan.wfa.ie.wme.qos_info.ap.reserved",
25647       FT_UINT8, BASE_HEX, NULL, 0x70,
25648       "Must Be Zero", HFILL }},
25649
25650     {&hf_ieee80211_wfa_ie_wme_reserved,
25651      {"Reserved", "wlan.wfa.ie.wme.reserved",
25652       FT_BYTES, BASE_NONE, NULL, 0,
25653       "Must Be Zero", HFILL }},
25654
25655     {&hf_ieee80211_wfa_ie_wme_ac_parameters,
25656      {"Ac Parameters", "wlan.wfa.ie.wme.acp",
25657       FT_NONE, BASE_NONE, NULL, 0,
25658       NULL, HFILL }},
25659
25660     {&hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
25661      {"ACI / AIFSN Field", "wlan.wfa.ie.wme.acp.aci_aifsn",
25662       FT_UINT8, BASE_HEX, NULL, 0,
25663       NULL, HFILL }},
25664
25665     {&hf_ieee80211_wfa_ie_wme_acp_aci,
25666      {"ACI", "wlan.wfa.ie.wme.acp.aci",
25667       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wme_acs_vals), 0x60,
25668       NULL, HFILL }},
25669
25670     {&hf_ieee80211_wfa_ie_wme_acp_acm,
25671      {"Admission Control Mandatory", "wlan.wfa.ie.wme.acp.acm",
25672       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
25673       NULL, HFILL }},
25674
25675     {&hf_ieee80211_wfa_ie_wme_acp_aifsn,
25676      {"AIFSN", "wlan.wfa.ie.wme.acp.aifsn",
25677       FT_UINT8, BASE_DEC, NULL, 0x0F,
25678       NULL, HFILL }},
25679
25680     {&hf_ieee80211_wfa_ie_wme_acp_reserved,
25681      {"Reserved", "wlan.wfa.ie.wme.acp.reserved",
25682       FT_UINT8, BASE_DEC, NULL, 0x80,
25683       "Must be Zero", HFILL }},
25684
25685     {&hf_ieee80211_wfa_ie_wme_acp_ecw,
25686      {"ECW", "wlan.wfa.ie.wme.acp.ecw",
25687       FT_UINT8, BASE_HEX, NULL, 0x00,
25688       NULL, HFILL }},
25689
25690     {&hf_ieee80211_wfa_ie_wme_acp_ecw_max,
25691      {"ECW Max", "wlan.wfa.ie.wme.acp.ecw.max",
25692       FT_UINT8, BASE_DEC, NULL, 0xF0,
25693       NULL, HFILL }},
25694
25695     {&hf_ieee80211_wfa_ie_wme_acp_ecw_min,
25696      {"ECW Min", "wlan.wfa.ie.wme.acp.ecw.min",
25697       FT_UINT8, BASE_DEC, NULL, 0x0F,
25698       NULL, HFILL }},
25699
25700     {&hf_ieee80211_wfa_ie_wme_acp_cw_max,
25701      {"CW Max", "wlan.wfa.ie.wme.acp.cw.max",
25702       FT_UINT8, BASE_DEC, NULL, 0,
25703       NULL, HFILL }},
25704
25705     {&hf_ieee80211_wfa_ie_wme_acp_cw_min,
25706      {"CW Min", "wlan.wfa.ie.wme.acp.cw.min",
25707       FT_UINT8, BASE_DEC, NULL, 0,
25708       NULL, HFILL }},
25709
25710     {&hf_ieee80211_wfa_ie_wme_acp_txop_limit,
25711      {"TXOP Limit", "wlan.wfa.ie.wme.acp.txop_limit",
25712       FT_UINT16, BASE_DEC, NULL, 0x00,
25713       NULL, HFILL }},
25714
25715     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
25716      {"TS Info", "wlan.wfa.ie.wme.tspec.ts_info",
25717       FT_UINT24, BASE_HEX, NULL, 0,
25718       "Traffic Stream (TS) Info", HFILL }},
25719
25720     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
25721      {"TID", "wlan.wfa.ie.wme.tspec.ts_info.tid",
25722       FT_UINT24, BASE_DEC, NULL, 0x00001E,
25723       "Traffic Stream Info ID (TID)", HFILL }},
25724
25725     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
25726      {"Direction", "wlan.wfa.ie.wme.tspec.ts_info.dir",
25727       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals), 0x000060,
25728       "Traffic Stream (TS) Info Direction", HFILL }},
25729
25730     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
25731      {"PSB", "wlan.wfa.ie.wme.tspec.ts_info.psb",
25732       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals), 0x000400,
25733       "Traffic Stream (TS) Info Power Save Behavior (PSB)", HFILL }},
25734
25735     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
25736      {"UP", "wlan.wfa.ie.wme.tspec.ts_info.up",
25737       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals), 0x003800,
25738       "Traffic Stream (TS) Info User Priority (UP)", HFILL }},
25739
25740     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
25741      {"Reserved", "wlan.wfa.ie.wme.tspec.ts_info.reserved",
25742       FT_UINT24, BASE_HEX, NULL, 0xFFC381,
25743       "Must be Zero", HFILL }},
25744
25745     {&hf_ieee80211_wfa_ie_wme_tspec_nor_msdu,
25746      {"Normal MSDU Size", "wlan.wfa.ie.wme.tspec.nor_msdu",
25747       FT_UINT16, BASE_DEC, NULL, 0,
25748       NULL, HFILL }},
25749
25750     {&hf_ieee80211_wfa_ie_wme_tspec_max_msdu,
25751      {"Maximum MSDU Size", "wlan.wfa.ie.wme.tspec.max_msdu",
25752       FT_UINT16, BASE_DEC, NULL, 0,
25753       NULL, HFILL }},
25754
25755     {&hf_ieee80211_wfa_ie_wme_tspec_min_srv,
25756      {"Minimum Service Interval", "wlan.wfa.ie.wme.tspec.min_srv",
25757       FT_UINT32, BASE_DEC, NULL, 0,
25758       NULL, HFILL }},
25759
25760     {&hf_ieee80211_wfa_ie_wme_tspec_max_srv,
25761      {"Maximum Service Interval", "wlan.wfa.ie.wme.tspec.max_srv",
25762       FT_UINT32, BASE_DEC, NULL, 0,
25763       NULL, HFILL }},
25764
25765     {&hf_ieee80211_wfa_ie_wme_tspec_inact_int,
25766      {"Inactivity Interval", "wlan.wfa.ie.wme.tspec.inact_int",
25767       FT_UINT32, BASE_DEC, NULL, 0,
25768       NULL, HFILL }},
25769
25770     {&hf_ieee80211_wfa_ie_wme_tspec_susp_int,
25771      {"Suspension Interval", "wlan.wfa.ie.wme.tspec.susp_int",
25772       FT_UINT32, BASE_DEC, NULL, 0,
25773       NULL, HFILL }},
25774
25775     {&hf_ieee80211_wfa_ie_wme_tspec_srv_start,
25776      {"Service Start Time", "wlan.wfa.ie.wme.tspec.srv_start",
25777       FT_UINT32, BASE_DEC, NULL, 0,
25778       NULL, HFILL }},
25779
25780     {&hf_ieee80211_wfa_ie_wme_tspec_min_data,
25781      {"Minimum Data Rate", "wlan.wfa.ie.wme.tspec.min_data",
25782       FT_UINT32, BASE_DEC, NULL, 0,
25783       NULL, HFILL }},
25784
25785     {&hf_ieee80211_wfa_ie_wme_tspec_mean_data,
25786      {"Mean Data Rate", "wlan.wfa.ie.wme.tspec.mean_data",
25787       FT_UINT32, BASE_DEC, NULL, 0,
25788       NULL, HFILL }},
25789
25790     {&hf_ieee80211_wfa_ie_wme_tspec_peak_data,
25791      {"Peak Data Rate", "wlan.wfa.ie.wme.tspec.peak_data",
25792       FT_UINT32, BASE_DEC, NULL, 0,
25793       NULL, HFILL }},
25794
25795     {&hf_ieee80211_wfa_ie_wme_tspec_burst_size,
25796      {"Burst Size", "wlan.wfa.ie.wme.tspec.burst_size",
25797       FT_UINT32, BASE_DEC, NULL, 0,
25798       NULL, HFILL }},
25799
25800     {&hf_ieee80211_wfa_ie_wme_tspec_delay_bound,
25801      {"Delay Bound", "wlan.wfa.ie.wme.tspec.delay_bound",
25802       FT_UINT32, BASE_DEC, NULL, 0,
25803       NULL, HFILL }},
25804
25805     {&hf_ieee80211_wfa_ie_wme_tspec_min_phy,
25806      {"Minimum PHY Rate", "wlan.wfa.ie.wme.tspec.min_phy",
25807       FT_UINT32, BASE_DEC, NULL, 0,
25808       NULL, HFILL }},
25809
25810     {&hf_ieee80211_wfa_ie_wme_tspec_surplus,
25811      {"Surplus Bandwidth Allowance", "wlan.wfa.ie.wme.tspec.surplus",
25812       FT_UINT16, BASE_DEC, NULL, 0,
25813       NULL, HFILL }},
25814
25815     {&hf_ieee80211_wfa_ie_wme_tspec_medium,
25816      {"Medium Time", "wlan.wfa.ie.wme.tspec.medium",
25817       FT_UINT16, BASE_DEC, NULL, 0,
25818       NULL, HFILL }},
25819
25820     {&hf_ieee80211_rsn_ie_pmkid,
25821      {"RSN PMKID", "wlan.rsn.ie.pmkid",
25822       FT_BYTES, BASE_NONE, NULL, 0,
25823       NULL, HFILL }},
25824
25825     {&hf_ieee80211_rsn_ie_unknown,
25826      {"RSN Unknown", "wlan.rsn.ie.unknown",
25827       FT_BYTES, BASE_NONE, NULL, 0,
25828       NULL, HFILL }},
25829
25830     {&hf_ieee80211_marvell_ie_type,
25831      {"Type", "wlan.marvell.ie.type",
25832       FT_UINT8, BASE_HEX, NULL, 0,
25833       NULL, HFILL }},
25834
25835     {&hf_ieee80211_marvell_ie_mesh_subtype,
25836      {"Subtype", "wlan.marvell.ie.subtype",
25837       FT_UINT8, BASE_HEX, NULL, 0,
25838       NULL, HFILL }},
25839
25840     {&hf_ieee80211_marvell_ie_mesh_version,
25841      {"Version", "wlan.marvell.ie.version",
25842       FT_UINT8, BASE_HEX, NULL, 0,
25843       NULL, HFILL }},
25844
25845     {&hf_ieee80211_marvell_ie_mesh_active_proto_id,
25846      {"Path Selection Protocol", "wlan.marvell.ie.proto_id",
25847       FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0,
25848       NULL, HFILL }},
25849
25850     {&hf_ieee80211_marvell_ie_mesh_active_metric_id,
25851      {"Path Selection Metric", "wlan.marvell.ie.metric_id",
25852       FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0,
25853       NULL, HFILL }},
25854
25855     {&hf_ieee80211_marvell_ie_mesh_cap,
25856      {"Mesh Capabilities", "wlan.marvell.ie.cap",
25857       FT_UINT8, BASE_HEX, NULL, 0,
25858       NULL, HFILL }},
25859
25860     {&hf_ieee80211_marvell_ie_data,
25861      { "Marvell IE data", "wlan.marvell.data",
25862        FT_BYTES, BASE_NONE, NULL, 0x0,
25863        NULL, HFILL }},
25864
25865     {&hf_ieee80211_atheros_ie_type,
25866      {"Type", "wlan.atheros.ie.type",
25867       FT_UINT8, BASE_HEX, VALS(atheros_ie_type_vals), 0,
25868       NULL, HFILL }},
25869
25870     {&hf_ieee80211_atheros_ie_subtype,
25871      {"Subtype", "wlan.atheros.ie.subtype",
25872       FT_UINT8, BASE_HEX, NULL, 0,
25873       NULL, HFILL }},
25874
25875     {&hf_ieee80211_atheros_ie_version,
25876      {"Version", "wlan.atheros.ie.version",
25877       FT_UINT8, BASE_HEX, NULL, 0,
25878       NULL, HFILL }},
25879
25880     {&hf_ieee80211_atheros_ie_cap_f_turbop,
25881      {"Turbo Prime", "wlan.ie.atheros.capabilities.turbop",
25882       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_TURBOP,
25883       NULL, HFILL }},
25884
25885     {&hf_ieee80211_atheros_ie_cap_f_comp,
25886      {"Compression", "wlan.ie.atheros.capabilities.comp",
25887       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_COMP,
25888       NULL, HFILL }},
25889
25890     {&hf_ieee80211_atheros_ie_cap_f_ff,
25891      {"Fast Frames", "wlan.ie.atheros.capabilities.ff",
25892       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_FF,
25893       NULL, HFILL }},
25894
25895     {&hf_ieee80211_atheros_ie_cap_f_xr,
25896      {"eXtended Range", "wlan.ie.atheros.capabilities.xr",
25897       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_XR,
25898       NULL, HFILL }},
25899
25900     {&hf_ieee80211_atheros_ie_cap_f_ar,
25901      {"Advanced Radar", "wlan.ie.atheros.capabilities.ar",
25902       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_AR,
25903       NULL, HFILL }},
25904
25905     {&hf_ieee80211_atheros_ie_cap_f_burst,
25906      {"Burst", "wlan.ie.atheros.capabilities.burst",
25907       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BURST,
25908       NULL, HFILL }},
25909
25910     {&hf_ieee80211_atheros_ie_cap_f_wme,
25911      {"CWMin tuning", "wlan.ie.atheros.capabilities.wme",
25912       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_WME,
25913       NULL, HFILL }},
25914
25915     {&hf_ieee80211_atheros_ie_cap_f_boost,
25916      {"Boost", "wlan.ie.atheros.capabilities.boost",
25917       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BOOST,
25918       NULL, HFILL }},
25919
25920     {&hf_ieee80211_atheros_ie_advcap_cap,
25921      {"Capabilities", "wlan.atheros.ie.advcap.cap",
25922       FT_UINT8, BASE_HEX, NULL, 0,
25923       NULL, HFILL }},
25924
25925     {&hf_ieee80211_atheros_ie_advcap_defkey,
25926      {"Default key index", "wlan.atheros.ie.advcap.defkey",
25927       FT_UINT16, BASE_HEX, NULL, 0,
25928       NULL, HFILL }},
25929
25930     {&hf_ieee80211_atheros_ie_xr_info,
25931      {"Info", "wlan.atheros.ie.xr.info",
25932       FT_UINT8, BASE_HEX, NULL, 0,
25933       NULL, HFILL }},
25934
25935     {&hf_ieee80211_atheros_ie_xr_base_bssid,
25936      {"Base BSS Id", "wlan.atheros.ie.xr.base_bssid",
25937       FT_ETHER, BASE_NONE, NULL, 0,
25938       NULL, HFILL }},
25939
25940     {&hf_ieee80211_atheros_ie_xr_xr_bssid,
25941      {"XR BSS Id", "wlan.atheros.ie.xr.xr_bssid",
25942       FT_ETHER, BASE_NONE, NULL, 0,
25943       NULL, HFILL }},
25944
25945     {&hf_ieee80211_atheros_ie_xr_xr_beacon,
25946      {"XR Beacon Interval", "wlan.atheros.ie.xr.xr_beacon",
25947       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
25948       NULL, HFILL }},
25949
25950     {&hf_ieee80211_atheros_ie_xr_base_cap,
25951      {"Base capabilities", "wlan.atheros.ie.xr.base_cap",
25952       FT_UINT8, BASE_HEX, NULL, 0,
25953       NULL, HFILL }},
25954
25955     {&hf_ieee80211_atheros_ie_xr_xr_cap,
25956      {"XR capabilities", "wlan.atheros.ie.xr.xr_cap",
25957       FT_UINT8, BASE_HEX, NULL, 0,
25958       NULL, HFILL }},
25959
25960     {&hf_ieee80211_atheros_ie_data,
25961      {"Atheros IE data", "wlan.atheros.data",
25962       FT_BYTES, BASE_NONE, NULL, 0,
25963       NULL, HFILL }},
25964
25965     {&hf_ieee80211_aironet_ie_type,
25966      {"Aironet IE type", "wlan.aironet.type",
25967       FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0,
25968       NULL, HFILL }},
25969
25970     {&hf_ieee80211_aironet_ie_dtpc,
25971      {"Aironet IE CCX DTCP", "wlan.aironet.dtpc",
25972       FT_BYTES, BASE_NONE, NULL, 0,
25973       NULL, HFILL }},
25974
25975     {&hf_ieee80211_aironet_ie_version,
25976      {"Aironet IE CCX version", "wlan.aironet.version",
25977       FT_UINT8, BASE_DEC, NULL, 0,
25978       NULL, HFILL }},
25979
25980     {&hf_ieee80211_aironet_ie_data,
25981      { "Aironet IE data", "wlan.aironet.data",
25982        FT_BYTES, BASE_NONE, NULL, 0x0,
25983        NULL, HFILL }},
25984
25985     {&hf_ieee80211_qbss_version,
25986      {"QBSS Version", "wlan.qbss.version",
25987       FT_UINT8, BASE_DEC, NULL, 0,
25988       NULL, HFILL }},
25989
25990     {&hf_ieee80211_qbss_scount,
25991      {"Station Count", "wlan.qbss.scount",
25992       FT_UINT16, BASE_DEC, NULL, 0,
25993       NULL, HFILL }},
25994
25995     {&hf_ieee80211_qbss_cu,
25996      {"Channel Utilization", "wlan.qbss.cu",
25997       FT_UINT8, BASE_DEC, NULL, 0,
25998       NULL, HFILL }},
25999
26000     {&hf_ieee80211_qbss_adc,
26001      {"Available Admission Capacity", "wlan.qbss.adc",
26002       FT_UINT8, BASE_DEC, NULL, 0,
26003       NULL, HFILL }},
26004
26005     {&hf_ieee80211_qbss2_cu,
26006      {"Channel Utilization", "wlan.qbss2.cu",
26007       FT_UINT8, BASE_DEC, NULL, 0,
26008       NULL, HFILL }},
26009
26010     {&hf_ieee80211_qbss2_gl,
26011      {"G.711 CU Quantum", "wlan.qbss2.glimit",
26012       FT_UINT8, BASE_DEC, NULL, 0,
26013       NULL, HFILL }},
26014
26015     {&hf_ieee80211_qbss2_cal,
26016      {"Call Admission Limit", "wlan.qbss2.cal",
26017       FT_UINT8, BASE_DEC, NULL, 0,
26018       NULL, HFILL }},
26019
26020     {&hf_ieee80211_qbss2_scount,
26021      {"Station Count", "wlan.qbss2.scount",
26022       FT_UINT16, BASE_DEC, NULL, 0,
26023       NULL, HFILL }},
26024
26025     {&hf_ieee80211_aironet_ie_qos_reserved,
26026      {"Aironet IE QoS reserved", "wlan.aironet.qos.reserved",
26027       FT_UINT8, BASE_HEX, NULL, 0,
26028       NULL, HFILL }},
26029
26030     {&hf_ieee80211_aironet_ie_qos_paramset,
26031      {"Aironet IE QoS paramset", "wlan.aironet.qos.paramset",
26032       FT_UINT8, BASE_DEC, NULL, 0,
26033       NULL, HFILL }},
26034
26035     {&hf_ieee80211_aironet_ie_qos_val,
26036      {"Aironet IE QoS valueset", "wlan.aironet.qos.val",
26037       FT_BYTES, BASE_NONE, NULL, 0,
26038       NULL, HFILL }},
26039
26040     {&hf_ieee80211_aironet_ie_clientmfp,
26041      {"Aironet IE Client MFP", "wlan.aironet.clientmfp",
26042       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
26043       NULL, HFILL }},
26044
26045     /* Vendor Specific : Nintendo */
26046     {&hf_ieee80211_vs_nintendo_type,
26047      {"Type", "wlan.vs.nintendo.type",
26048       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_nintendo_type_vals), 0,
26049       NULL, HFILL }},
26050
26051     {&hf_ieee80211_vs_nintendo_length,
26052      {"Length", "wlan.vs.nintendo.length",
26053       FT_UINT8, BASE_DEC, NULL, 0,
26054       NULL, HFILL }},
26055
26056     {&hf_ieee80211_vs_nintendo_servicelist,
26057      {"Servicelist", "wlan.vs.nintendo.servicelist",
26058       FT_BYTES, BASE_NONE, NULL, 0,
26059       NULL, HFILL }},
26060
26061     {&hf_ieee80211_vs_nintendo_service,
26062      {"Service", "wlan.vs.nintendo.service",
26063       FT_BYTES, BASE_NONE, NULL, 0,
26064       NULL, HFILL }},
26065
26066     {&hf_ieee80211_vs_nintendo_consoleid,
26067      {"Console ID", "wlan.vs.nintendo.consoleid",
26068       FT_BYTES, BASE_NONE, NULL, 0,
26069       NULL, HFILL }},
26070
26071     {&hf_ieee80211_vs_nintendo_unknown,
26072      {"Unknown", "wlan.vs.nintendo.unknown",
26073       FT_BYTES, BASE_NONE, NULL, 0,
26074       NULL, HFILL }},
26075
26076     /* Vendor Specific : Aruba Networks */
26077     {&hf_ieee80211_vs_aruba_subtype,
26078      {"Subtype", "wlan.vs.aruba.subtype",
26079       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_aruba_subtype_vals), 0,
26080       NULL, HFILL }},
26081
26082     {&hf_ieee80211_vs_aruba_apname,
26083      {"AP Name", "wlan.vs.aruba.ap_name",
26084       FT_STRINGZ, BASE_NONE, NULL, 0,
26085       NULL, HFILL }},
26086
26087     {&hf_ieee80211_vs_aruba_data,
26088      {"Data", "wlan.vs.aruba.data",
26089       FT_BYTES, BASE_NONE, NULL, 0,
26090       NULL, HFILL }},
26091
26092     {&hf_ieee80211_vs_mikrotik_unknown,
26093      {"Unknown", "wlan.vs.mikrotik.unknown",
26094       FT_BYTES, BASE_NONE, NULL, 0,
26095       NULL, HFILL }},
26096
26097     {&hf_ieee80211_vs_mikrotik_subitem,
26098      {"Sub IE", "wlan.vs.mikrotik.unknown",
26099       FT_BYTES, BASE_NONE, NULL, 0,
26100       NULL, HFILL }},
26101
26102     {&hf_ieee80211_vs_mikrotik_subtype,
26103      {"Subtype", "wlan.vs.mikrotik.subtype",
26104       FT_UINT8, BASE_DEC, NULL, 0,
26105       NULL, HFILL }},
26106
26107     {&hf_ieee80211_vs_mikrotik_sublength,
26108      {"Sublength", "wlan.vs.mikrotik.sublength",
26109       FT_UINT8, BASE_DEC, NULL, 0,
26110       NULL, HFILL }},
26111
26112     {&hf_ieee80211_vs_mikrotik_subdata,
26113      {"Subdata", "wlan.vs.mikrotik.subdata",
26114       FT_BYTES, BASE_NONE, NULL, 0,
26115       NULL, HFILL }},
26116
26117     /* Vendor Specific : Meru (Fortinet) */
26118     {&hf_ieee80211_vs_meru_subitem,
26119      {"Sub IE", "wlan.vs.meru.unknown",
26120       FT_NONE, BASE_NONE, NULL, 0,
26121       NULL, HFILL }},
26122
26123     {&hf_ieee80211_vs_meru_subtype,
26124      {"Subtype", "wlan.vs.meru.subtype",
26125       FT_UINT8, BASE_DEC, NULL, 0,
26126       NULL, HFILL }},
26127
26128     {&hf_ieee80211_vs_meru_sublength,
26129      {"Sublength", "wlan.vs.meru.sublength",
26130       FT_UINT8, BASE_DEC, NULL, 0,
26131       NULL, HFILL }},
26132
26133     {&hf_ieee80211_vs_meru_subdata,
26134      {"Subdata", "wlan.vs.meru.subdata",
26135       FT_BYTES, BASE_NONE, NULL, 0,
26136       NULL, HFILL }},
26137
26138     /* Vendor Specific : Extreme (Zebra) */
26139     {&hf_ieee80211_vs_extreme_subtype,
26140      {"Subtype", "wlan.vs.extreme.subtype",
26141       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_extreme_subtype_vals), 0,
26142       NULL, HFILL }},
26143
26144     {&hf_ieee80211_vs_extreme_subdata,
26145      {"Subdata", "wlan.vs.extreme.subdata",
26146       FT_BYTES, BASE_NONE, NULL, 0,
26147       NULL, HFILL }},
26148
26149     {&hf_ieee80211_vs_extreme_unknown,
26150      {"Unknown", "wlan.vs.extreme.unknown",
26151       FT_BYTES, BASE_NONE, NULL, 0,
26152       NULL, HFILL }},
26153
26154     {&hf_ieee80211_vs_extreme_ap_length,
26155      {"AP Length", "wlan.vs.extreme.ap_length",
26156       FT_UINT8, BASE_DEC, NULL, 0,
26157       NULL, HFILL }},
26158
26159     {&hf_ieee80211_vs_extreme_ap_name,
26160      {"AP Name", "wlan.vs.extreme.ap_name",
26161       FT_STRING, BASE_NONE, NULL, 0,
26162       NULL, HFILL }},
26163
26164     {&hf_ieee80211_tsinfo,
26165      {"Traffic Stream (TS) Info", "wlan.ts_info",
26166       FT_UINT24, BASE_HEX, NULL, 0,
26167       "Traffic Stream (TS) Info field", HFILL }},
26168
26169     {&hf_ieee80211_tsinfo_type,
26170      {"Traffic Type", "wlan.ts_info.type",
26171       FT_UINT24, BASE_DEC, VALS(tsinfo_type), 0x000001,
26172       "Traffic Stream (TS) Info Traffic Type", HFILL }},
26173
26174     {&hf_ieee80211_tsinfo_tsid,
26175      {"Traffic Stream ID (TSID)", "wlan.ts_info.tsid",
26176       FT_UINT24, BASE_DEC, NULL, 0x00001E,
26177       "Traffic Stream ID (TSID) Info TSID", HFILL }},
26178
26179     {&hf_ieee80211_tsinfo_dir,
26180      {"Direction", "wlan.ts_info.dir",
26181       FT_UINT24, BASE_DEC, VALS(tsinfo_direction), 0x000060,
26182       "Traffic Stream (TS) Info Direction", HFILL }},
26183
26184     {&hf_ieee80211_tsinfo_access,
26185      {"Access Policy", "wlan.ts_info.dir",
26186       FT_UINT24, BASE_DEC, VALS(tsinfo_access), 0x000180,
26187       "Traffic Stream (TS) Info Access Policy", HFILL }},
26188
26189     {&hf_ieee80211_tsinfo_agg,
26190      {"Aggregation", "wlan.ts_info.agg",
26191       FT_UINT24, BASE_DEC, NULL, 0x000200,
26192       "Traffic Stream (TS) Info Access Policy", HFILL }},
26193
26194     {&hf_ieee80211_tsinfo_apsd,
26195      {"Automatic Power-Save Delivery (APSD)", "wlan.ts_info.apsd",
26196       FT_UINT24, BASE_DEC, NULL, 0x000400,
26197       "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
26198
26199     {&hf_ieee80211_tsinfo_up,
26200      {"User Priority", "wlan.ts_info.up",
26201       FT_UINT24, BASE_DEC, VALS(qos_up), 0x003800,
26202       "Traffic Stream (TS) Info User Priority", HFILL }},
26203
26204     {&hf_ieee80211_tsinfo_ack,
26205      {"Ack Policy", "wlan.ts_info.ack",
26206       FT_UINT24, BASE_DEC, VALS(ack_policy), 0x00C000,
26207       "Traffic Stream (TS) Info Ack Policy", HFILL }},
26208
26209     {&hf_ieee80211_tsinfo_sched,
26210      {"Schedule", "wlan.ts_info.sched",
26211       FT_UINT24, BASE_DEC, NULL, 0x010000,
26212       "Traffic Stream (TS) Info Schedule", HFILL }},
26213
26214     {&hf_ieee80211_tsinfo_rsv,
26215      {"Reserved", "wlan.ts_info.rsv",
26216       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
26217       "Must be Zero", HFILL }},
26218
26219     {&hf_ieee80211_tspec_nor_msdu,
26220      {"Normal MSDU Size", "wlan.tspec.nor_msdu",
26221       FT_UINT16, BASE_DEC, NULL, 0,
26222       NULL, HFILL }},
26223
26224     {&hf_ieee80211_tspec_max_msdu,
26225      {"Maximum MSDU Size", "wlan.tspec.max_msdu",
26226       FT_UINT16, BASE_DEC, NULL, 0,
26227       NULL, HFILL }},
26228
26229     {&hf_ieee80211_tspec_min_srv,
26230      {"Minimum Service Interval", "wlan.tspec.min_srv",
26231       FT_UINT32, BASE_DEC, NULL, 0,
26232       NULL, HFILL }},
26233
26234     {&hf_ieee80211_tspec_max_srv,
26235      {"Maximum Service Interval", "wlan.tspec.max_srv",
26236       FT_UINT32, BASE_DEC, NULL, 0,
26237       NULL, HFILL }},
26238
26239     {&hf_ieee80211_tspec_inact_int,
26240      {"Inactivity Interval", "wlan.tspec.inact_int",
26241       FT_UINT32, BASE_DEC, NULL, 0,
26242       NULL, HFILL }},
26243
26244     {&hf_ieee80211_tspec_susp_int,
26245      {"Suspension Interval", "wlan.tspec.susp_int",
26246       FT_UINT32, BASE_DEC, NULL, 0,
26247       NULL, HFILL }},
26248
26249     {&hf_ieee80211_tspec_srv_start,
26250      {"Service Start Time", "wlan.tspec.srv_start",
26251       FT_UINT32, BASE_DEC, NULL, 0,
26252       NULL, HFILL }},
26253
26254     {&hf_ieee80211_tspec_min_data,
26255      {"Minimum Data Rate", "wlan.tspec.min_data",
26256       FT_UINT32, BASE_DEC, NULL, 0,
26257       NULL, HFILL }},
26258
26259     {&hf_ieee80211_tspec_mean_data,
26260      {"Mean Data Rate", "wlan.tspec.mean_data",
26261       FT_UINT32, BASE_DEC, NULL, 0,
26262       NULL, HFILL }},
26263
26264     {&hf_ieee80211_tspec_peak_data,
26265      {"Peak Data Rate", "wlan.tspec.peak_data",
26266       FT_UINT32, BASE_DEC, NULL, 0,
26267       NULL, HFILL }},
26268
26269     {&hf_ieee80211_tspec_burst_size,
26270      {"Burst Size", "wlan.tspec.burst_size",
26271       FT_UINT32, BASE_DEC, NULL, 0,
26272       NULL, HFILL }},
26273
26274     {&hf_ieee80211_tspec_delay_bound,
26275      {"Delay Bound", "wlan.tspec.delay_bound",
26276       FT_UINT32, BASE_DEC, NULL, 0,
26277       NULL, HFILL }},
26278
26279     {&hf_ieee80211_tspec_min_phy,
26280      {"Minimum PHY Rate", "wlan.tspec.min_phy",
26281       FT_UINT32, BASE_DEC, NULL, 0,
26282       NULL, HFILL }},
26283
26284     {&hf_ieee80211_tspec_surplus,
26285      {"Surplus Bandwidth Allowance", "wlan.tspec.surplus",
26286       FT_UINT16, BASE_DEC, NULL, 0,
26287       NULL, HFILL }},
26288
26289     {&hf_ieee80211_tspec_medium,
26290      {"Medium Time", "wlan.tspec.medium",
26291       FT_UINT16, BASE_DEC, NULL, 0,
26292       NULL, HFILL }},
26293
26294     {&hf_ieee80211_tspec_dmg,
26295      {"DMG attributes", "wlan.tspec.dmg",
26296       FT_UINT16, BASE_DEC, NULL, 0,
26297       NULL, HFILL }},
26298
26299     {&hf_ieee80211_ts_delay,
26300      {"Traffic Stream (TS) Delay", "wlan.ts_delay",
26301       FT_UINT32, BASE_DEC, NULL, 0,
26302       NULL, HFILL }},
26303
26304     {&hf_ieee80211_tclas_process,
26305      {"Processing", "wlan.tclas_proc.processing",
26306       FT_UINT8, BASE_DEC, VALS(ieee80211_tclas_process_flag), 0,
26307       NULL, HFILL }},
26308
26309     {&hf_ieee80211_tag_ext_supp_rates,
26310      {"Extended Supported Rates", "wlan.extended_supported_rates",
26311       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
26312       "In Mbit/sec, (B) for Basic Rates", HFILL }},
26313
26314     {&hf_ieee80211_sched_info,
26315      {"Schedule Info", "wlan.sched.sched_info",
26316       FT_UINT16, BASE_HEX, NULL, 0,
26317       "Schedule Info field", HFILL }},
26318
26319     {&hf_ieee80211_sched_info_agg,
26320      {"Schedule Aggregation", "wlan.sched_info.agg",
26321       FT_UINT16, BASE_DEC, NULL, 0x0001,
26322       "Traffic Stream (TS) Info Access Policy", HFILL }},
26323
26324     {&hf_ieee80211_sched_info_tsid,
26325      {"Schedule Traffic Stream ID (TSID)", "wlan.sched_info.tsid",
26326       FT_UINT16, BASE_DEC, NULL, 0x001E,
26327       "Traffic Stream ID (TSID) Info TSID", HFILL }},
26328
26329     {&hf_ieee80211_sched_info_dir,
26330      {"Schedule Direction", "wlan.sched_info.dir",
26331       FT_UINT16, BASE_DEC, VALS(tsinfo_direction), 0x0060,
26332       "Traffic Stream (TS) Info Direction", HFILL }},
26333
26334     {&hf_ieee80211_sched_srv_start,
26335      {"Service Start Time", "wlan.sched.srv_start",
26336       FT_UINT32, BASE_HEX, NULL, 0,
26337       NULL, HFILL }},
26338
26339     {&hf_ieee80211_sched_srv_int,
26340      {"Service Interval", "wlan.sched.srv_int",
26341       FT_UINT32, BASE_HEX, NULL, 0,
26342       NULL, HFILL }},
26343
26344     {&hf_ieee80211_sched_spec_int,
26345      {"Specification Interval", "wlan.sched.spec_int",
26346       FT_UINT16, BASE_HEX, NULL, 0,
26347       NULL, HFILL }},
26348
26349     {&hf_ieee80211_aruba,
26350      {"Aruba Type", "wlan.aruba.type",
26351       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &aruba_mgt_typevals_ext, 0,
26352       "Aruba Management", HFILL }},
26353
26354     {&hf_ieee80211_aruba_hb_seq,
26355      {"Aruba Heartbeat Sequence", "wlan.aruba.heartbeat_sequence",
26356       FT_UINT64, BASE_DEC, NULL, 0,
26357       NULL, HFILL }},
26358
26359     {&hf_ieee80211_aruba_mtu,
26360      {"Aruba MTU Size", "wlan.aruba.mtu_size",
26361       FT_UINT16, BASE_DEC, NULL, 0,
26362       NULL, HFILL }},
26363
26364     /* Start: HT Control (+HTC) */
26365     {&hf_ieee80211_htc,
26366      {"HT Control (+HTC)", "wlan.htc",
26367       FT_UINT32, BASE_HEX, NULL, 0,
26368       "High Throughput Control (+HTC)", HFILL }},
26369
26370     {&hf_ieee80211_htc_vht,
26371      {"VHT", "wlan.htc.lac.vht",
26372       FT_BOOLEAN, 32, NULL, HTC_VHT,
26373       "High Throughput Control HT/VHT flag", HFILL }},
26374
26375     {&hf_ieee80211_htc_lac,
26376      {"Link Adaptation Control (LAC)", "wlan.htc.lac",
26377       FT_UINT32, BASE_HEX, NULL, 0x0000FFFE,
26378       "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
26379
26380     {&hf_ieee80211_htc_lac_trq,
26381      {"Training Request (TRQ)", "wlan.htc.lac.trq",
26382       FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002,
26383       "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
26384
26385     {&hf_ieee80211_htc_lac_mai_aseli,
26386      {"Antenna Selection Indication (ASELI)", "wlan.htc.lac.mai.aseli",
26387       FT_UINT16, BASE_HEX, NULL, 0x003C,
26388       "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
26389
26390     {&hf_ieee80211_htc_lac_mai_mrq,
26391      {"MCS Request (MRQ)", "wlan.htc.lac.mai.mrq",
26392       FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004,
26393       "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
26394
26395     {&hf_ieee80211_htc_lac_mai_msi,
26396      {"MCS Request Sequence Identifier (MSI)", "wlan.htc.lac.mai.msi",
26397       FT_UINT16, BASE_HEX, NULL, 0x0038,
26398       "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
26399
26400     {&hf_ieee80211_htc_lac_mai_reserved,
26401      {"Reserved", "wlan.htc.lac.mai.reserved",
26402       FT_UINT16, BASE_HEX, NULL, 0x0038,
26403       "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
26404
26405     {&hf_ieee80211_htc_lac_mfsi,
26406      {"MCS Feedback Sequence Identifier (MFSI)", "wlan.htc.lac.mfsi",
26407       FT_UINT16, BASE_DEC, NULL, 0x01C0,
26408       "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
26409
26410     {&hf_ieee80211_htc_lac_asel_command,
26411      {"Antenna Selection (ASEL) Command", "wlan.htc.lac.asel.command",
26412       FT_UINT16, BASE_HEX, VALS(ieee80211_htc_lac_asel_command_flags), 0x0E00,
26413       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
26414
26415     {&hf_ieee80211_htc_lac_asel_data,
26416      {"Antenna Selection (ASEL) Data", "wlan.htc.lac.asel.data",
26417       FT_UINT16, BASE_HEX, NULL, 0xF000,
26418       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
26419
26420     {&hf_ieee80211_htc_lac_mfb,
26421      {"MCS Feedback (MFB)", "wlan.htc.lac.mfb",
26422       FT_UINT16, BASE_HEX, NULL, 0xFE00,
26423       "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
26424
26425     {&hf_ieee80211_htc_cal_pos,
26426      {"Calibration Position", "wlan.htc.cal.pos",
26427       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_cal_pos_flags), 0x00030000,
26428       "High Throughput Control Calibration Position", HFILL }},
26429
26430     {&hf_ieee80211_htc_cal_seq,
26431      {"Calibration Sequence Identifier", "wlan.htc.cal.seq",
26432       FT_UINT32, BASE_DEC, NULL, 0x000C0000,
26433       "High Throughput Control Calibration Sequence Identifier", HFILL }},
26434
26435     {&hf_ieee80211_htc_reserved1,
26436      {"Reserved", "wlan.htc.reserved1",
26437       FT_UINT32, BASE_HEX, NULL, 0x00300000,
26438       "High Throughput Control Reserved", HFILL }},
26439
26440     {&hf_ieee80211_htc_csi_steering,
26441      {"CSI/Steering", "wlan.htc.csi_steering",
26442       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_csi_steering_flags), 0x00C00000,
26443       "High Throughput Control CSI/Steering", HFILL }},
26444
26445     {&hf_ieee80211_htc_ndp_announcement,
26446      {"NDP Announcement", "wlan.htc.ndp_announcement",
26447       FT_BOOLEAN, 32, TFS(&ieee80211_htc_ndp_announcement_flag), 0x01000000,
26448       "High Throughput Control NDP Announcement", HFILL }},
26449
26450     {&hf_ieee80211_htc_reserved2,
26451      {"Reserved", "wlan.htc.reserved2",
26452       FT_UINT32, BASE_HEX, NULL, 0x3E000000,
26453       "High Throughput Control Reserved", HFILL }},
26454
26455     {&hf_ieee80211_htc_mrq,
26456      {"MRQ", "wlan.htc.mrq",
26457       FT_BOOLEAN, 32, NULL, HTC_MRQ,
26458       "VHT-MCS feedback request", HFILL }},
26459
26460     {&hf_ieee80211_htc_msi,
26461      {"MSI", "wlan.htc.msi",
26462       FT_UINT32, BASE_DEC, NULL, 0x00000038,
26463       "MRQ sequence number", HFILL }},
26464
26465     {&hf_ieee80211_htc_msi_stbc_reserved,
26466      {"Reserved", "wlan.htc.msi_stbc_reserved",
26467       FT_UINT32, BASE_HEX, NULL, 0x00000038,
26468       NULL, HFILL }},
26469
26470     {&hf_ieee80211_htc_compressed_msi,
26471      {"Compressed MSI", "wlan.htc.compressed_msi",
26472       FT_UINT32, BASE_DEC, NULL, 0x00000018,
26473       NULL, HFILL }},
26474
26475     {&hf_ieee80211_htc_ppdu_stbc_encoded,
26476      {"PPDU was STBC encoded", "wlan.htc.ppdu_stbc_encoded",
26477       FT_BOOLEAN, 32, NULL, 0x00000020,
26478       NULL, HFILL }},
26479
26480     {&hf_ieee80211_htc_mfsi,
26481      {"MFSI", "wlan.htc.mfsi",
26482       FT_BOOLEAN, 32, NULL, 0x000001C0,
26483       "MFB sequence identifier", HFILL }},
26484
26485     {&hf_ieee80211_htc_gid_l,
26486      {"GID-L", "wlan.htc.gid_l",
26487       FT_BOOLEAN, 32, NULL, 0x000001C0,
26488       "LSBs of group ID", HFILL }},
26489
26490     {&hf_ieee80211_htc_mfb,
26491      {"MFB", "wlan.htc.mfb",
26492       FT_UINT32, BASE_HEX, NULL, 0x00FFFE00,
26493       "Recommended MFB", HFILL }},
26494
26495     {&hf_ieee80211_htc_num_sts,
26496      {"NUM_STS", "wlan.htc.num_sts",
26497       FT_UINT32, BASE_DEC, NULL, 0x00000E00,
26498       "Recommended NUM_STS", HFILL }},
26499
26500     {&hf_ieee80211_htc_vht_mcs,
26501      {"VHT-MCS", "wlan.htc.vht_mcs",
26502       FT_UINT32, BASE_DEC, NULL, 0x0000F000,
26503       "Recommended VHT-MCS", HFILL }},
26504
26505     {&hf_ieee80211_htc_bw,
26506      {"BW", "wlan.htc.bw",
26507       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_bw_recommended_vht_mcs_vals), 0x00030000,
26508       "Bandwidth for recommended VHT-MCS", HFILL }},
26509
26510     {&hf_ieee80211_htc_snr,
26511      {"SNR", "wlan.htc.snr",
26512       FT_INT32, BASE_DEC, NULL, 0x00FC0000,
26513       "Average SNR + 22", HFILL }},
26514
26515     {&hf_ieee80211_htc_reserved3,
26516      {"Reserved", "wlan.htc.reserved3",
26517       FT_UINT32, BASE_HEX, NULL, 0x1F000000,
26518       NULL, HFILL }},
26519
26520     {&hf_ieee80211_htc_gid_h,
26521      {"GID-H", "wlan.htc.gid_h",
26522       FT_UINT32, BASE_DEC, NULL, 0x07000000,
26523       NULL, HFILL }},
26524
26525     {&hf_ieee80211_htc_coding_type,
26526      {"Coding type", "wlan.htc.coding_type",
26527       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_coding_type_vals), 0x08000000,
26528       NULL, HFILL }},
26529
26530     {&hf_ieee80211_htc_fb_tx_type,
26531      {"FB Tx type", "wlan.htc.fb_tx_type",
26532       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_fb_tx_type_vals), 0x10000000,
26533       NULL, HFILL }},
26534
26535     {&hf_ieee80211_htc_unsolicited_mfb,
26536      {"Unsolicited MFB", "wlan.htc.unsolicited_mfb",
26537       FT_BOOLEAN, 32, NULL, HTC_UNSOLICITED_MFB,
26538       "High Throughput Control Unsolicited MFB", HFILL }},
26539
26540     {&hf_ieee80211_htc_ac_constraint,
26541      {"AC Constraint", "wlan.htc.ac_constraint",
26542       FT_BOOLEAN, 32, NULL, 0x40000000,
26543       "High Throughput Control AC Constraint", HFILL }},
26544
26545     {&hf_ieee80211_htc_rdg_more_ppdu,
26546      {"RDG/More PPDU", "wlan.htc.rdg_more_ppdu",
26547       FT_BOOLEAN, 32, NULL, 0x80000000,
26548       "High Throughput Control RDG/More PPDU", HFILL }},
26549     /* End: HT Control (+HTC) */
26550
26551     /* MDIE */
26552     {&hf_ieee80211_tag_mobility_domain_mdid,
26553      {"Mobility Domain Identifier", "wlan.mobility_domain.mdid",
26554       FT_UINT16, BASE_HEX, NULL, 0,
26555       NULL, HFILL }},
26556
26557     {&hf_ieee80211_tag_mobility_domain_ft_capab,
26558      {"FT Capability and Policy", "wlan.mobility_domain.ft_capab",
26559       FT_UINT8, BASE_HEX, NULL, 0,
26560       NULL, HFILL }},
26561
26562     {&hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
26563      {"Fast BSS Transition over DS",
26564       "wlan.mobility_domain.ft_capab.ft_over_ds",
26565       FT_UINT8, BASE_HEX, NULL, 0x01,
26566       NULL, HFILL }},
26567
26568     {&hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
26569      {"Resource Request Protocol Capability",
26570       "wlan.mobility_domain.ft_capab.resource_req",
26571       FT_UINT8, BASE_HEX, NULL, 0x02,
26572       NULL, HFILL }},
26573
26574     /* FTIE */
26575     {&hf_ieee80211_tag_ft_mic_control,
26576      {"MIC Control", "wlan.ft.mic_control",
26577       FT_UINT16, BASE_HEX, NULL, 0,
26578       NULL, HFILL }},
26579
26580     {&hf_ieee80211_tag_ft_element_count,
26581      {"Element Count", "wlan.ft.element_count",
26582       FT_UINT16, BASE_DEC, NULL, 0xff00,
26583       NULL, HFILL }},
26584
26585     {&hf_ieee80211_tag_ft_mic,
26586      {"MIC", "wlan.ft.mic",
26587       FT_BYTES, BASE_NONE, NULL, 0,
26588       NULL, HFILL }},
26589
26590     {&hf_ieee80211_tag_ft_anonce,
26591      {"ANonce", "wlan.ft.anonce",
26592       FT_BYTES, BASE_NONE, NULL, 0,
26593       NULL, HFILL }},
26594
26595     {&hf_ieee80211_tag_ft_snonce,
26596      {"SNonce", "wlan.ft.snonce",
26597       FT_BYTES, BASE_NONE, NULL, 0,
26598       NULL, HFILL }},
26599
26600     {&hf_ieee80211_tag_ft_subelem_id,
26601      {"Subelement ID", "wlan.ft.subelem.id",
26602       FT_UINT8, BASE_DEC, VALS(ft_subelem_id_vals), 0,
26603       NULL, HFILL }},
26604
26605     {&hf_ieee80211_tag_ft_subelem_len,
26606      {"Length", "wlan.ft.subelem.len",
26607       FT_UINT8, BASE_DEC, NULL, 0,
26608       NULL, HFILL }},
26609
26610     {&hf_ieee80211_tag_ft_subelem_data,
26611      {"Data", "wlan.ft.subelem.data",
26612       FT_BYTES, BASE_NONE, NULL, 0,
26613       NULL, HFILL }},
26614
26615     {&hf_ieee80211_tag_ft_subelem_r1kh_id,
26616      {"PMK-R1 key holder identifier (R1KH-ID)", "wlan.ft.subelem.r1kh_id",
26617       FT_BYTES, BASE_NONE, NULL, 0,
26618       NULL, HFILL }},
26619
26620     {&hf_ieee80211_tag_ft_subelem_gtk_key_info,
26621      {"Key Info", "wlan.ft.subelem.gtk.key_info",
26622       FT_UINT16, BASE_HEX, NULL, 0,
26623       NULL, HFILL }},
26624
26625     {&hf_ieee80211_tag_ft_subelem_gtk_key_id,
26626      {"Key ID", "wlan.ft.subelem.gtk.key_id",
26627       FT_UINT16, BASE_DEC, NULL, 0x0003,
26628       NULL, HFILL }},
26629
26630     {&hf_ieee80211_tag_ft_subelem_gtk_key_length,
26631      {"Key Length", "wlan.ft.subelem.gtk.key_length",
26632       FT_UINT8, BASE_HEX, NULL, 0,
26633       NULL, HFILL }},
26634
26635     {&hf_ieee80211_tag_ft_subelem_gtk_rsc,
26636      {"RSC", "wlan.ft.subelem.gtk.rsc",
26637       FT_BYTES, BASE_NONE, NULL, 0,
26638       NULL, HFILL }},
26639
26640     {&hf_ieee80211_tag_ft_subelem_gtk_key,
26641      {"GTK", "wlan.ft.subelem.gtk.key",
26642       FT_BYTES, BASE_NONE, NULL, 0,
26643       NULL, HFILL }},
26644
26645     {&hf_ieee80211_tag_ft_subelem_r0kh_id,
26646      {"PMK-R0 key holder identifier (R0KH-ID)", "wlan.ft.subelem.r0kh_id",
26647       FT_STRING, BASE_NONE, NULL, 0,
26648       NULL, HFILL }},
26649
26650     {&hf_ieee80211_tag_ft_subelem_igtk_key_id,
26651      {"Key ID", "wlan.ft.subelem.igtk.key_id",
26652       FT_UINT16, BASE_DEC, NULL, 0,
26653       NULL, HFILL }},
26654
26655     {&hf_ieee80211_tag_ft_subelem_igtk_ipn,
26656      {"IPN", "wlan.ft.subelem.igtk.ipn",
26657       FT_BYTES, BASE_NONE, NULL, 0,
26658       NULL, HFILL }},
26659
26660     {&hf_ieee80211_tag_ft_subelem_igtk_key_length,
26661      {"Key Length", "wlan.ft.subelem.igtk.key_length",
26662       FT_UINT8, BASE_HEX, NULL, 0,
26663       NULL, HFILL }},
26664
26665     {&hf_ieee80211_tag_ft_subelem_igtk_key,
26666      {"Wrapped Key (IGTK)", "wlan.ft.subelem.igtk.key",
26667       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
26668
26669     /* RIC Data IE: 802.11-2012: 8.4.2.52 */
26670     {&hf_ieee80211_tag_ric_data_id,
26671      {"Resource Handshake Identifier", "wlan.ric_data.id",
26672       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26673
26674     {&hf_ieee80211_tag_ric_data_desc_cnt,
26675      {"Resource Descriptor Count", "wlan.ric_data.desc_cnt",
26676       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26677
26678     {&hf_ieee80211_tag_ric_data_status_code,
26679      {"Status Code", "wlan.ric_data.status_code",
26680       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
26681       "Status of requested Resource", HFILL }},
26682
26683     /* OBSS IE: 802.11-2012: 8.4.2.61 */
26684     {&hf_ieee80211_tag_obss_spd,
26685      {"Scan Passive Dwell", "wlan.obss.spd",
26686       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26687
26688     {&hf_ieee80211_tag_obss_sad,
26689      {"Scan Active Dwell", "wlan.obss.sad",
26690       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26691
26692     {&hf_ieee80211_tag_obss_cwtsi,
26693      {"Channel Width Trigger Scan Interval", "wlan.obss.cwtsi",
26694       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26695
26696     {&hf_ieee80211_tag_obss_sptpc,
26697      {"Scan Passive Total Per Channel", "wlan.obss.sptpc",
26698       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26699
26700     {&hf_ieee80211_tag_obss_satpc,
26701      {"Scan Active Total Per Channel", "wlan.obss.satpc",
26702       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26703
26704     {&hf_ieee80211_tag_obss_wctdf,
26705      {"Width Channel Transition Delay Factor", "wlan.obss.wctdf",
26706       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26707
26708     {&hf_ieee80211_tag_obss_sat,
26709      {"Scan Activity Threshold", "wlan.obss.sat",
26710       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26711
26712     /* RIC Descriptor IE: 802.11-2012: 8.4.2.53 */
26713     {&hf_ieee80211_tag_ric_desc_rsrc_type,
26714      {"Resource Type", "wlan.ric_desc.rsrc_type",
26715       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26716
26717     {&hf_ieee80211_tag_ric_desc_var_params,
26718      {"Variable Params", "wlan.ric_desc.var_params",
26719       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
26720
26721     /* MMIE */
26722     {&hf_ieee80211_tag_mmie_keyid,
26723      {"KeyID", "wlan.mmie.keyid",
26724       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26725
26726     {&hf_ieee80211_tag_mmie_ipn,
26727      {"IPN", "wlan.mmie.ipn",
26728       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
26729
26730     {&hf_ieee80211_tag_mmie_mic,
26731      {"MIC", "wlan.mmie.mic",
26732       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
26733
26734     /* WAPI Parameter Set*/
26735     {&hf_ieee80211_tag_wapi_param_set_version,
26736      {"Version", "wlan.wapi.version",
26737       FT_UINT16, BASE_DEC, NULL, 0,
26738       NULL, HFILL }},
26739
26740     {&hf_ieee80211_tag_wapi_param_set_akm_suite_count,
26741      {"AKM Suite Count", "wlan.wapi.akm_suite.count",
26742       FT_UINT16, BASE_DEC, NULL, 0,
26743       NULL, HFILL }},
26744
26745     {&hf_ieee80211_tag_wapi_param_set_akm_suite_oui,
26746      {"AKM Suite OUI", "wlan.wapi.akm_suite.oui",
26747       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
26748       NULL, HFILL }},
26749
26750     {&hf_ieee80211_tag_wapi_param_set_akm_suite_type,
26751      {"AKM Suite Type", "wlan.wapi.akm_suite.type",
26752       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_suite_type) , 0,
26753       NULL, HFILL }},
26754
26755     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
26756      {"Unicast Cipher Suite Count", "wlan.wapi.unicast_cipher.suite.count",
26757       FT_UINT16, BASE_DEC, NULL, 0,
26758       NULL, HFILL }},
26759
26760     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui,
26761      {"Unicast Cipher Suite OUI", "wlan.wapi.unicast_cipher.suite.oui",
26762       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
26763       NULL, HFILL }},
26764
26765     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type,
26766      {"Unicast Cipher Suite Type", "wlan.wapi.unicast_cipher.suite.type",
26767       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
26768       NULL, HFILL }},
26769
26770     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui,
26771      {"Multicast Cipher Suite OUI", "wlan.wapi.multicast_cipher.suite.oui",
26772       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
26773       NULL, HFILL }},
26774
26775     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type,
26776      {"Multicast Cipher Suite Type", "wlan.wapi.multicast_cipher.suite.type",
26777       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
26778       NULL, HFILL }},
26779
26780     {&hf_ieee80211_tag_wapi_param_set_capab,
26781      {"WAPI Capability Info", "wlan.wapi.capab",
26782       FT_UINT16, BASE_HEX, NULL, 0,
26783       NULL, HFILL }},
26784
26785     {&hf_ieee80211_tag_wapi_param_set_capab_preauth,
26786      {"Supports Preauthentication?", "wlan.wapi.capab.preauth",
26787       FT_BOOLEAN, 16 , NULL, 0x0001,
26788       NULL, HFILL }},
26789
26790     {&hf_ieee80211_tag_wapi_param_set_capab_rsvd,
26791      {"Reserved", "wlan.wapi.capab.rsvd",
26792       FT_UINT16, BASE_DEC , NULL, 0xFFFE,
26793       NULL, HFILL }},
26794
26795     {&hf_ieee80211_tag_wapi_param_set_bkid_count,
26796      {"No of BKID's", "wlan.wapi.bkid.count",
26797       FT_UINT16, BASE_DEC, NULL, 0,
26798       NULL, HFILL }},
26799
26800     {&hf_ieee80211_tag_wapi_param_set_bkid_list,
26801      {"BKID", "wlan.wapi.bkid",
26802       FT_BYTES, BASE_NONE, NULL, 0,
26803       NULL, HFILL }},
26804
26805     /* BSS Max Idle Period */
26806     {&hf_ieee80211_tag_bss_max_idle_period,
26807      {"BSS Max Idle Period (1000 TUs)", "wlan.bss_max_idle.period",
26808       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26809
26810     {&hf_ieee80211_tag_bss_max_idle_options_protected,
26811      {"BSS Max Idle Period Options: Protected Keep-Alive Required",
26812       "wlan.bss_max_idle.options.protected",
26813       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
26814
26815     /* TFS Request */
26816     {&hf_ieee80211_tag_tfs_request_id,
26817      {"TFS ID", "wlan.tfs_request.id",
26818       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26819
26820     {&hf_ieee80211_tag_tfs_request_ac_delete_after_match,
26821      {"TFS Action Code - Delete after match",
26822       "wlan.tfs_request.action_code.delete_after_match",
26823       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
26824
26825     {&hf_ieee80211_tag_tfs_request_ac_notify,
26826      {"TFS Action Code - Notify",
26827       "wlan.tfs_request.action_code.notify",
26828       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
26829
26830     {&hf_ieee80211_tag_tfs_request_subelem_id,
26831      {"Subelement ID", "wlan.tfs_request.subelem.id",
26832       FT_UINT8, BASE_DEC, VALS(tfs_request_subelem_ids), 0,
26833       "TFS Request Subelement ID", HFILL }},
26834
26835     {&hf_ieee80211_tag_tfs_request_subelem_len,
26836      {"Length", "wlan.tfs_request.subelem.len",
26837       FT_UINT8, BASE_DEC, NULL, 0,
26838       "TFS Request Subelement Length", HFILL }},
26839
26840     {&hf_ieee80211_tag_tfs_request_subelem,
26841      {"Subelement Data", "wlan.tfs_request.subelem",
26842       FT_BYTES, BASE_NONE, NULL, 0,
26843       "TFS Request Subelement Data", HFILL }},
26844
26845     /* TFS Response */
26846     {&hf_ieee80211_tag_tfs_response_subelem_id,
26847      {"Subelement ID", "wlan.tfs_response.subelem.id",
26848       FT_UINT8, BASE_DEC, VALS(tfs_response_subelem_ids), 0,
26849       "TFS Response Subelement ID", HFILL }},
26850
26851     {&hf_ieee80211_tag_tfs_response_subelem_len,
26852      {"Length", "wlan.tfs_response.subelem.len",
26853       FT_UINT8, BASE_DEC, NULL, 0,
26854       "TFS Response Subelement Length", HFILL }},
26855
26856     {&hf_ieee80211_tag_tfs_response_subelem,
26857      {"Subelement Data", "wlan.tfs_response.subelem",
26858       FT_BYTES, BASE_NONE, NULL, 0,
26859       "TFS Response Subelement Data", HFILL }},
26860
26861     {&hf_ieee80211_tag_tfs_response_status,
26862      {"TFS Response Status", "wlan.tfs_response.status",
26863       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26864
26865     {&hf_ieee80211_tag_tfs_response_id,
26866      {"TFS ID", "wlan.tfs_response.tfs_id",
26867       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26868
26869     /* WNM-Sleep Mode */
26870     {&hf_ieee80211_tag_wnm_sleep_mode_action_type,
26871      {"Action Type", "wlan.wnm_sleep_mode.action_type",
26872       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_action_types), 0,
26873       "WNM-Sleep Mode Action Type", HFILL }},
26874
26875     {&hf_ieee80211_tag_wnm_sleep_mode_response_status,
26876      {"WNM-Sleep Mode Response Status",
26877       "wlan.wnm_sleep_mode.response_status",
26878       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_response_status_vals), 0, NULL,
26879       HFILL }},
26880
26881     {&hf_ieee80211_tag_wnm_sleep_mode_interval,
26882      {"WNM-Sleep Interval", "wlan.wnm_sleep_mode.interval",
26883       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26884
26885     /* Time Advertisement */
26886     {&hf_ieee80211_tag_time_adv_timing_capab,
26887      {"Timing capabilities", "wlan.time_adv.timing_capab",
26888       FT_UINT8, BASE_DEC, VALS(time_adv_timing_capab_vals), 0,
26889       NULL, HFILL }},
26890
26891     {&hf_ieee80211_tag_time_adv_time_value,
26892      {"Time Value", "wlan.time_adv.time_value",
26893       FT_BYTES, BASE_NONE, NULL, 0,
26894       NULL, HFILL }},
26895
26896     {&hf_ieee80211_tag_time_adv_time_value_year,
26897      {"Time Value: Year", "wlan.time_adv.time_value.year",
26898       FT_UINT16, BASE_DEC, NULL, 0,
26899       NULL, HFILL }},
26900
26901     {&hf_ieee80211_tag_time_adv_time_value_month,
26902      {"Time Value: Month", "wlan.time_adv.time_value.month",
26903       FT_UINT8, BASE_DEC, NULL, 0,
26904       NULL, HFILL }},
26905
26906     {&hf_ieee80211_tag_time_adv_time_value_day,
26907      {"Time Value: Day", "wlan.time_adv.time_value.month",
26908       FT_UINT8, BASE_DEC, NULL, 0,
26909       NULL, HFILL }},
26910
26911     {&hf_ieee80211_tag_time_adv_time_value_hours,
26912      {"Time Value: Hours", "wlan.time_adv.time_value.hours",
26913       FT_UINT8, BASE_DEC, NULL, 0,
26914       NULL, HFILL }},
26915
26916     {&hf_ieee80211_tag_time_adv_time_value_minutes,
26917      {"Time Value: Minutes", "wlan.time_adv.time_value.minutes",
26918       FT_UINT8, BASE_DEC, NULL, 0,
26919       NULL, HFILL }},
26920
26921     {&hf_ieee80211_tag_time_adv_time_value_seconds,
26922      {"Time Value: Seconds", "wlan.time_adv.time_value.seconds",
26923       FT_UINT8, BASE_DEC, NULL, 0,
26924       NULL, HFILL }},
26925
26926     {&hf_ieee80211_tag_time_adv_time_value_milliseconds,
26927      {"Time Value: Milliseconds", "wlan.time_adv.time_value.milliseconds",
26928       FT_UINT16, BASE_DEC, NULL, 0,
26929       NULL, HFILL }},
26930
26931     {&hf_ieee80211_tag_time_adv_time_value_reserved,
26932      {"Time Value: Reserved", "wlan.time_adv.time_value.reserved",
26933       FT_UINT8, BASE_DEC, NULL, 0,
26934       NULL, HFILL }},
26935
26936     {&hf_ieee80211_tag_time_adv_time_error,
26937      {"Time Error", "wlan.time_adv.time_error",
26938       FT_BYTES, BASE_NONE, NULL, 0,
26939       NULL, HFILL }},
26940
26941     {&hf_ieee80211_tag_time_adv_time_update_counter,
26942      {"Time Update Counter", "wlan.time_adv.time_update_counter",
26943       FT_UINT8, BASE_DEC, NULL, 0,
26944       NULL, HFILL }},
26945
26946     /* Time Zone */
26947     {&hf_ieee80211_tag_time_zone,
26948      {"Time Zone", "wlan.time_zone",
26949       FT_STRING, BASE_NONE, NULL, 0,
26950       NULL, HFILL }},
26951
26952     /* Interworking */
26953     {&hf_ieee80211_tag_interworking_access_network_type,
26954      {"Access Network Type", "wlan.interworking.access_network_type",
26955       FT_UINT8, BASE_DEC, VALS(access_network_type_vals), 0x0f,
26956       NULL, HFILL }},
26957
26958     {&hf_ieee80211_tag_interworking_internet,
26959      {"Internet", "wlan.interworking.internet",
26960       FT_UINT8, BASE_DEC, NULL, 0x10,
26961       NULL, HFILL }},
26962
26963     {&hf_ieee80211_tag_interworking_asra,
26964      {"ASRA", "wlan.interworking.asra",
26965       FT_UINT8, BASE_DEC, NULL, 0x20,
26966       "Additional Step Required for Access", HFILL }},
26967
26968     {&hf_ieee80211_tag_interworking_esr,
26969      {"ESR", "wlan.interworking.esr",
26970       FT_UINT8, BASE_DEC, NULL, 0x40,
26971       "Emergency services reachable", HFILL }},
26972
26973     {&hf_ieee80211_tag_interworking_uesa,
26974      {"UESA", "wlan.interworking.uesa",
26975       FT_UINT8, BASE_DEC, NULL, 0x80,
26976       "Unauthenticated emergency service accessible", HFILL }},
26977
26978     {&hf_ieee80211_tag_interworking_hessid,
26979      {"HESSID", "wlan.interworking.hessid",
26980       FT_ETHER, BASE_NONE, NULL, 0,
26981       "Homogeneous ESS identifier", HFILL }},
26982
26983     /* QoS Map Set element */
26984     {&hf_ieee80211_tag_qos_map_set_dscp_exc,
26985      {"DSCP Exception", "wlan.qos_map_set.dscp_exception",
26986       FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
26987
26988     {&hf_ieee80211_tag_qos_map_set_dscp_exc_val,
26989      {"DSCP Value", "wlan.qos_map_set.dscp_value",
26990       FT_UINT8, BASE_DEC, NULL, 0,
26991       "DSCP Exception - DSCP Value", HFILL }},
26992
26993     {&hf_ieee80211_tag_qos_map_set_dscp_exc_up,
26994      {"User Priority", "wlan.qos_map_set.up",
26995       FT_UINT8, BASE_DEC, NULL, 0,
26996       "DSCP Exception - User Priority", HFILL }},
26997
26998     {&hf_ieee80211_tag_qos_map_set_range,
26999      {"DSCP Range description", "wlan.qos_map_set.range",
27000       FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
27001
27002     {&hf_ieee80211_tag_qos_map_set_low,
27003      {"DSCP Low Value", "wlan.qos_map_set.dscp_low_value",
27004       FT_UINT8, BASE_DEC, NULL, 0,
27005       "DSCP Range description - DSCP Low Value", HFILL }},
27006
27007     {&hf_ieee80211_tag_qos_map_set_high,
27008      {"DSCP High Value", "wlan.qos_map_set.dscp_high_value",
27009       FT_UINT8, BASE_DEC, NULL, 0,
27010       "DSCP Range description - DSCP High Value", HFILL }},
27011
27012     /* Advertisement Protocol */
27013     {&hf_ieee80211_tag_adv_proto_resp_len_limit,
27014      {"Query Response Length Limit", "wlan.adv_proto.resp_len_limit",
27015       FT_UINT8, BASE_DEC, NULL, 0x7f,
27016       NULL, HFILL }},
27017
27018     {&hf_ieee80211_tag_adv_proto_pame_bi,
27019      {"PAME-BI", "wlan.adv_proto.pame_bi",
27020       FT_UINT8, BASE_DEC, NULL, 0x80,
27021       "Pre-Association Message Xchange BSSID Independent (PAME-BI)", HFILL }},
27022
27023     {&hf_ieee80211_tag_adv_proto_id,
27024      {"Advertisement Protocol ID", "wlan.adv_proto.id",
27025       FT_UINT8, BASE_DEC, VALS(adv_proto_id_vals), 0,
27026       NULL, HFILL }},
27027
27028     {&hf_ieee80211_tag_adv_proto_vs_info,
27029      {"Advertisement Protocol Vendor Specific info", "wlan.adv_proto.vs_info",
27030       FT_NONE, BASE_NONE, NULL, 0,
27031       NULL, HFILL }},
27032
27033     /* Roaming Consortium */
27034     {&hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
27035      {"Number of ANQP OIs", "wlan.roaming_consortium.num_anqp_oi",
27036       FT_UINT8, BASE_DEC, NULL, 0,
27037       NULL, HFILL }},
27038
27039     {&hf_ieee80211_tag_roaming_consortium_oi1_len,
27040      {"OI #1 Length", "wlan.roaming_consortium.oi1_len",
27041       FT_UINT8, BASE_DEC, NULL, 0x0f,
27042       NULL, HFILL }},
27043
27044     {&hf_ieee80211_tag_roaming_consortium_oi2_len,
27045      {"OI #2 Length", "wlan.roaming_consortium.oi2_len",
27046       FT_UINT8, BASE_DEC, NULL, 0xf0,
27047       NULL, HFILL }},
27048
27049     {&hf_ieee80211_tag_roaming_consortium_oi1,
27050      {"OI #1", "wlan.roaming_consortium.oi1",
27051       FT_BYTES, BASE_NONE, NULL, 0,
27052       NULL, HFILL }},
27053
27054     {&hf_ieee80211_tag_roaming_consortium_oi2,
27055      {"OI #2", "wlan.roaming_consortium.oi2",
27056       FT_BYTES, BASE_NONE, NULL, 0,
27057       NULL, HFILL }},
27058
27059     {&hf_ieee80211_tag_roaming_consortium_oi3,
27060      {"OI #3", "wlan.roaming_consortium.oi3",
27061       FT_BYTES, BASE_NONE, NULL, 0,
27062       NULL, HFILL }},
27063
27064     /* Timeout Interval */
27065     {&hf_ieee80211_tag_timeout_int_type,
27066      {"Timeout Interval Type", "wlan.timeout_int.type",
27067       FT_UINT8, BASE_DEC, VALS(timeout_int_types), 0,
27068       NULL, HFILL }},
27069
27070     {&hf_ieee80211_tag_timeout_int_value,
27071      {"Timeout Interval Value", "wlan.timeout_int.value",
27072       FT_UINT32, BASE_DEC, NULL, 0,
27073       NULL, HFILL }},
27074
27075     /* Link Identifier */
27076     {&hf_ieee80211_tag_link_id_bssid,
27077      {"BSSID", "wlan.link_id.bssid",
27078       FT_ETHER, BASE_NONE, NULL, 0,
27079       NULL, HFILL }},
27080
27081     {&hf_ieee80211_tag_link_id_init_sta,
27082      {"TDLS initiator STA Address", "wlan.link_id.init_sta",
27083       FT_ETHER, BASE_NONE, NULL, 0,
27084       NULL, HFILL }},
27085
27086     {&hf_ieee80211_tag_link_id_resp_sta,
27087      {"TDLS responder STA Address", "wlan.link_id.resp_sta",
27088       FT_ETHER, BASE_NONE, NULL, 0,
27089       NULL, HFILL }},
27090
27091     /* Wakeup Schedule */
27092     {&hf_ieee80211_tag_wakeup_schedule_offset,
27093      {"Offset", "wlan.wakeup_schedule.offset",
27094       FT_UINT32, BASE_DEC, NULL, 0,
27095       NULL, HFILL }},
27096
27097     {&hf_ieee80211_tag_wakeup_schedule_interval,
27098      {"Interval", "wlan.wakeup_schedule.interval",
27099       FT_UINT32, BASE_DEC, NULL, 0,
27100       NULL, HFILL }},
27101
27102     {&hf_ieee80211_tag_wakeup_schedule_awake_window_slots,
27103      {"Awake Window Slots", "wlan.wakeup_schedule.awake_window_slots",
27104       FT_UINT32, BASE_DEC, NULL, 0,
27105       NULL, HFILL }},
27106
27107     {&hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
27108      {"Maximum Awake Window Duration", "wlan.wakeup_schedule.max_awake_dur",
27109       FT_UINT32, BASE_DEC, NULL, 0,
27110       NULL, HFILL }},
27111
27112     {&hf_ieee80211_tag_wakeup_schedule_idle_count,
27113      {"Idle Count", "wlan.wakeup_schedule.idle_count",
27114       FT_UINT16, BASE_DEC, NULL, 0,
27115       NULL, HFILL }},
27116
27117     /* Channel Switch Timing */
27118     {&hf_ieee80211_tag_channel_switch_timing_switch_time,
27119      {"Switch Time", "wlan.channel_switch_timing.switch_time",
27120       FT_UINT16, BASE_DEC, NULL, 0,
27121       NULL, HFILL }},
27122
27123     {&hf_ieee80211_tag_channel_switch_timing_switch_timeout,
27124      {"Switch Timeout", "wlan.channel_switch_timing.switch_timeout",
27125       FT_UINT16, BASE_DEC, NULL, 0,
27126       NULL, HFILL }},
27127
27128     /* PTI Control */
27129     {&hf_ieee80211_tag_pti_control_tid,
27130      {"TID", "wlan.pti_control.tid",
27131       FT_UINT8, BASE_DEC, NULL, 0,
27132       NULL, HFILL }},
27133
27134     {&hf_ieee80211_tag_pti_control_sequence_control,
27135      {"Sequence Control", "wlan.pti_control.sequence_control",
27136       FT_UINT16, BASE_HEX, NULL, 0,
27137       NULL, HFILL }},
27138
27139     /* PU Buffer Status */
27140     {&hf_ieee80211_tag_pu_buffer_status_ac_bk,
27141      {"AC_BK traffic available", "wlan.pu_buffer_status.ac_bk",
27142       FT_UINT8, BASE_DEC, NULL, 0x01,
27143       NULL, HFILL }},
27144
27145     {&hf_ieee80211_tag_pu_buffer_status_ac_be,
27146      {"AC_BE traffic available", "wlan.pu_buffer_status.ac_be",
27147       FT_UINT8, BASE_DEC, NULL, 0x02,
27148       NULL, HFILL }},
27149
27150     {&hf_ieee80211_tag_pu_buffer_status_ac_vi,
27151      {"AC_VI traffic available", "wlan.pu_buffer_status.ac_vi",
27152       FT_UINT8, BASE_DEC, NULL, 0x04,
27153       NULL, HFILL }},
27154
27155     {&hf_ieee80211_tag_pu_buffer_status_ac_vo,
27156      {"AC_VO traffic available", "wlan.pu_buffer_status.ac_vo",
27157       FT_UINT8, BASE_DEC, NULL, 0x08,
27158       NULL, HFILL }},
27159
27160     {&hf_ieee80211_mysterious_olpc_stuff,
27161      {"Mysterious OLPC stuff", "wlan.mysterious_olpc_stuff",
27162       FT_NONE, BASE_NONE, NULL, 0x0,
27163       NULL, HFILL }}
27164
27165   };
27166
27167   static hf_register_info aggregate_fields[] = {
27168     {&hf_ieee80211_amsdu_subframe,
27169      {"A-MSDU Subframe", "wlan_aggregate.a_mdsu.subframe",
27170       FT_NONE, BASE_NONE, NULL, 0x0,
27171       "Aggregate MAC Service Data Unit (MSDU) Subframe", HFILL }},
27172
27173     {&hf_ieee80211_amsdu_length,
27174      {"A-MSDU Length", "wlan_aggregate.a_mdsu.length",
27175       FT_UINT16, BASE_DEC, NULL, 0x0,
27176       NULL, HFILL }}
27177   };
27178
27179   static uat_field_t wep_uat_flds[] = {
27180
27181       UAT_FLD_VS(uat_wep_key_records, key, "Key type", wep_type_vals,
27182                         "Decryption key type used"),
27183       UAT_FLD_CSTRING(uat_wep_key_records, string, "Key",
27184                         "wep:<wep hexadecimal key>\n"
27185                         "wpa-pwd:<passphrase>[:<ssid>]\n"
27186                         "wpa-psk:<wpa hexadecimal key>"),
27187       UAT_END_FIELDS
27188     };
27189
27190   static gint *tree_array[] = {
27191     &ett_80211,
27192     &ett_proto_flags,
27193     &ett_cap_tree,
27194     &ett_fc_tree,
27195     &ett_cntrl_wrapper_fc,
27196     &ett_cntrl_wrapper_payload,
27197     &ett_fragments,
27198     &ett_fragment,
27199     &ett_block_ack,
27200     &ett_block_ack_bitmap,
27201     &ett_ath_cap_tree,
27202
27203     &ett_80211_mgt,
27204     &ett_fixed_parameters,
27205     &ett_tagged_parameters,
27206     &ett_tag_bmapctl_tree,
27207     &ett_tag_country_fnm_tree,
27208     &ett_tag_country_rcc_tree,
27209     &ett_qos_parameters,
27210     &ett_qos_ps_buf_state,
27211     &ett_wep_parameters,
27212     &ett_msh_control,
27213     &ett_hwmp_targ_flags_tree,
27214     &ett_mesh_chswitch_flag_tree,
27215     &ett_mesh_config_cap_tree,
27216     &ett_mesh_formation_info_tree,
27217
27218     &ett_rsn_gcs_tree,
27219     &ett_rsn_pcs_tree,
27220     &ett_rsn_sub_pcs_tree,
27221     &ett_rsn_akms_tree,
27222     &ett_rsn_sub_akms_tree,
27223     &ett_rsn_cap_tree,
27224     &ett_rsn_pmkid_tree,
27225     &ett_rsn_gmcs_tree,
27226
27227     &ett_wpa_mcs_tree,
27228     &ett_wpa_ucs_tree,
27229     &ett_wpa_sub_ucs_tree,
27230     &ett_wpa_akms_tree,
27231     &ett_wpa_sub_akms_tree,
27232     &ett_wme_ac,
27233     &ett_wme_aci_aifsn,
27234     &ett_wme_ecw,
27235     &ett_wme_qos_info,
27236
27237     &ett_ht_cap_tree,
27238     &ett_ampduparam_tree,
27239     &ett_mcsset_tree,
27240     &ett_mcsbit_tree,
27241     &ett_htex_cap_tree,
27242     &ett_txbf_tree,
27243     &ett_antsel_tree,
27244     &ett_hta_cap_tree,
27245     &ett_hta_cap1_tree,
27246     &ett_hta_cap2_tree,
27247
27248     &ett_htc_tree,
27249     &ett_mfb_subtree,
27250     &ett_lac_subtree,
27251
27252     &ett_vht_cap_tree,
27253     &ett_vht_mcsset_tree,
27254     &ett_vht_rx_mcsbit_tree,
27255     &ett_vht_tx_mcsbit_tree,
27256     &ett_vht_basic_mcsbit_tree,
27257     &ett_vht_op_tree,
27258     &ett_vht_tpe_info_tree,
27259
27260     &ett_vht_ndp_annc_token_tree,
27261     &ett_vht_ndp_annc_sta_info_tree,
27262
27263     &ett_ff_vhtmimo_cntrl,
27264     &ett_ff_vhtmimo_beamforming_report,
27265     &ett_ff_vhtmimo_beamforming_report_snr,
27266     &ett_ff_vhtmimo_beamforming_report_feedback_matrices,
27267
27268     &ett_vht_grpidmgmt,
27269     &ett_vht_msa,
27270     &ett_vht_upa,
27271
27272     &ett_ht_info_delimiter1_tree,
27273     &ett_ht_info_delimiter2_tree,
27274     &ett_ht_info_delimiter3_tree,
27275
27276     &ett_tag_measure_request_mode_tree,
27277     &ett_tag_measure_request_type_tree,
27278     &ett_tag_measure_report_mode_tree,
27279     &ett_tag_measure_report_type_tree,
27280     &ett_tag_measure_report_basic_map_tree,
27281     &ett_tag_measure_report_rpi_tree,
27282     &ett_tag_measure_report_frame_tree,
27283     &ett_tag_measure_reported_frame_tree,
27284     &ett_tag_bss_bitmask_tree,
27285     &ett_tag_dfs_map_tree,
27286     &ett_tag_erp_info_tree,
27287     &ett_tag_ex_cap1,
27288     &ett_tag_ex_cap2,
27289     &ett_tag_ex_cap3,
27290     &ett_tag_ex_cap4,
27291     &ett_tag_ex_cap5,
27292     &ett_tag_ex_cap6,
27293     &ett_tag_ex_cap7,
27294     &ett_tag_ex_cap8,
27295     &ett_tag_ex_cap9,
27296
27297     &ett_tag_rm_cap1,
27298     &ett_tag_rm_cap2,
27299     &ett_tag_rm_cap3,
27300     &ett_tag_rm_cap4,
27301     &ett_tag_rm_cap5,
27302
27303     &ett_tag_20_40_bc,
27304
27305     &ett_tag_tclas_mask_tree,
27306
27307     &ett_tag_supported_channels,
27308
27309     &ett_tag_neighbor_report_bssid_info_tree,
27310     &ett_tag_neighbor_report_bssid_info_capability_tree,
27311     &ett_tag_neighbor_report_sub_tag_tree,
27312
27313     &ett_tag_wapi_param_set_akm_tree,
27314     &ett_tag_wapi_param_set_ucast_tree,
27315     &ett_tag_wapi_param_set_mcast_tree,
27316     &ett_tag_wapi_param_set_preauth_tree,
27317
27318     &ett_tag_time_adv_tree,
27319
27320     &ett_ff_ba_param_tree,
27321     &ett_ff_ba_ssc_tree,
27322     &ett_ff_delba_param_tree,
27323     &ett_ff_qos_info,
27324     &ett_ff_psmp_param_set,
27325     &ett_ff_mimo_cntrl,
27326     &ett_ff_ant_sel,
27327     &ett_mimo_report,
27328     &ett_ff_sm_pwr_save,
27329     &ett_ff_chan_switch_announce,
27330     &ett_ff_ht_info,
27331     &ett_ff_psmp_sta_info,
27332
27333     &ett_tpc,
27334
27335     &ett_msdu_aggregation_parent_tree,
27336     &ett_msdu_aggregation_subframe_tree,
27337
27338     &ett_80211_mgt_ie,
27339     &ett_tsinfo_tree,
27340     &ett_sched_tree,
27341
27342     &ett_fcs,
27343
27344     &ett_adv_proto,
27345     &ett_adv_proto_tuple,
27346     &ett_gas_query,
27347     &ett_gas_anqp,
27348     &ett_nai_realm,
27349     &ett_nai_realm_eap,
27350     &ett_tag_ric_data_desc_ie,
27351     &ett_anqp_vendor_capab,
27352
27353     &ett_hs20_cc_proto_port_tuple,
27354
27355     &ett_ssid_list,
27356
27357     &ett_nintendo,
27358
27359     &ett_mikrotik,
27360
27361     &ett_meru,
27362
27363     &ett_qos_map_set_exception,
27364     &ett_qos_map_set_range,
27365
27366     /* 802.11ad trees */
27367     &ett_dynamic_alloc_tree,
27368     &ett_ssw_tree,
27369     &ett_bf_tree,
27370     &ett_sswf_tree,
27371     &ett_brp_tree,
27372     &ett_blm_tree,
27373     &ett_bic_tree,
27374     &ett_dmg_params_tree,
27375     &ett_cc_tree,
27376     &ett_rcsi_tree,
27377     &ett_80211_ext,
27378     &ett_allocation_tree,
27379     &ett_sta_info,
27380
27381     &ett_gas_resp_fragment,
27382     &ett_gas_resp_fragments
27383   };
27384
27385   static ei_register_info ei[] = {
27386     { &ei_ieee80211_bad_length,
27387       { "ieee80211.bad_length", PI_MALFORMED, PI_ERROR,
27388         "Wrong length indicated", EXPFILL }},
27389
27390     { &ei_ieee80211_inv_val,
27391       { "ieee80211.invalid_value", PI_MALFORMED, PI_WARN,
27392         "Invalid value", EXPFILL }},
27393
27394     { &ei_ieee80211_tag_number,
27395       { "wlan.tag.number.unexpected_ie", PI_MALFORMED, PI_ERROR,
27396         "Unexpected Information Element ID", EXPFILL }},
27397
27398     { &ei_ieee80211_tag_length,
27399       { "wlan.tag.length.bad", PI_MALFORMED, PI_ERROR,
27400         "Bad tag length", EXPFILL }},
27401
27402     { &ei_ieee80211_extra_data,
27403       { "ieee80211.extra_data", PI_MALFORMED, PI_WARN,
27404         "Unexpected extra data in the end", EXPFILL }},
27405
27406     { &ei_ieee80211_ff_anqp_capability,
27407       { "wlan.fixed.anqp.capability.invalid", PI_MALFORMED, PI_ERROR,
27408         "Invalid vendor-specific ANQP capability", EXPFILL }},
27409
27410     { &ei_ieee80211_ff_anqp_venue_length,
27411       { "wlan.fixed.anqp.venue.length.invalid", PI_MALFORMED, PI_ERROR,
27412         "Invalid Venue Name Duple length", EXPFILL }},
27413
27414     { &ei_ieee80211_ff_anqp_roaming_consortium_oi_len,
27415       { "wlan.fixed.anqp.roaming_consortium.oi_len.invalid", PI_MALFORMED, PI_ERROR,
27416         "Invalid Roaming Consortium OI", EXPFILL }},
27417
27418     { &ei_ieee80211_ff_anqp_nai_field_len,
27419       { "wlan.fixed.anqp.nai_realm_list.field_len.invalid", PI_MALFORMED, PI_ERROR,
27420         "Invalid NAI Realm List", EXPFILL }},
27421
27422     { &ei_ieee80211_ff_anqp_nai_realm_eap_len,
27423       { "wlan.fixed.naqp_nai_realm_list.eap_method_len.invalid", PI_MALFORMED, PI_ERROR,
27424         "Invalid EAP Method subfield", EXPFILL }},
27425
27426     { &ei_hs20_anqp_ofn_length,
27427       { "wlan.hs20.anqp.ofn.length.invalid", PI_MALFORMED, PI_ERROR,
27428         "Invalid Operator Friendly Name Duple length", EXPFILL }},
27429
27430     { &ei_hs20_anqp_nai_hrq_length,
27431       { "wlan.hs20.anqp.nai_hrq.length.invalid", PI_MALFORMED, PI_ERROR,
27432         "Invalid NAI Home Realm Query length", EXPFILL }},
27433
27434     { &ei_ieee80211_ff_anqp_info_length,
27435       { "wlan.fixed.anqp.info_length.invalid", PI_MALFORMED, PI_ERROR,
27436         "Invalid ANQP Info length", EXPFILL }},
27437
27438     { &ei_ieee80211_not_enough_room_for_anqp_header,
27439       { "wlan.fixed.query_length_invalid", PI_MALFORMED, PI_ERROR,
27440         "Not enough room for ANQP header", EXPFILL }},
27441
27442     { &ei_ieee80211_ff_query_request_length,
27443       { "wlan.fixed.query_request_length.invalid", PI_MALFORMED, PI_ERROR,
27444         "Invalid Query Request Length", EXPFILL }},
27445
27446     { &ei_ieee80211_ff_query_response_length,
27447       { "wlan.fixed.query_response_length.invalid", PI_MALFORMED, PI_ERROR,
27448         "Invalid Query Response Length", EXPFILL }},
27449
27450     { &ei_ieee80211_tag_wnm_sleep_mode_no_key_data,
27451       { "wlan.wnm_sleep_mode.no_key_data", PI_MALFORMED, PI_ERROR,
27452         "WNM-Sleep Mode Response is not long enough to include Key Data", EXPFILL }},
27453
27454     { &ei_ieee80211_tdls_setup_response_malformed,
27455       { "wlan.tdls_setup_response_malformed", PI_MALFORMED, PI_ERROR,
27456         "TDLS Setup Response (success) does not include mandatory fields", EXPFILL }},
27457
27458     { &ei_ieee80211_tdls_setup_confirm_malformed,
27459       { "wlan.tdls_setup_confirm_malformed", PI_MALFORMED, PI_ERROR,
27460         "TDLS Setup Confirm (success) does not include mandatory fields", EXPFILL }},
27461
27462     { &ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype,
27463       { "wlan.wfa.ie.wme.qos_info.bad_ftype", PI_UNDECODED, PI_WARN,
27464         "Could not deduce direction to decode correctly", EXPFILL }},
27465
27466     { &ei_ieee80211_qos_info_bad_ftype,
27467       { "wlan.qos_info.bad_ftype", PI_UNDECODED, PI_WARN,
27468         "Could not deduce direction to decode correctly", EXPFILL }},
27469
27470     { &ei_ieee80211_qos_bad_aifsn,
27471       { "wlan.qos_info.bad_aifsn", PI_MALFORMED, PI_WARN,
27472         "Invalid AIFSN", EXPFILL }},
27473
27474     { &ei_ieee80211_rsn_pcs_count,
27475       { "wlan.rsn.pcs.count.invalid", PI_MALFORMED, PI_ERROR,
27476         "Pairwise Cipher Suite Count too large", EXPFILL }},
27477
27478     { &ei_ieee80211_rsn_pmkid_count,
27479       { "wlan.rsn.akms.count.invalid", PI_MALFORMED, PI_ERROR,
27480         "Auth Key Management (AKM) Suite Count too large", EXPFILL }},
27481
27482     { &ei_ieee80211_pmkid_count_too_large,
27483       { "wlan.rsn.pmkid.count.invalid", PI_MALFORMED, PI_ERROR,
27484         "PMKID Count too large", EXPFILL }},
27485
27486     { &ei_ieee80211_vht_tpe_pwr_info_count,
27487       { "wlan.vht.tpe.pwr_info.count.invalid", PI_MALFORMED, PI_ERROR,
27488         "Max Tx Pwr Count is Incorrect, should be 0-7", EXPFILL }},
27489
27490     { &ei_ieee80211_missing_data,
27491       { "ieee80211.missing_data", PI_MALFORMED, PI_WARN,
27492         "No Request subelements in TFS Request", EXPFILL }},
27493
27494     { &ei_ieee80211_fc_retry,
27495       { "wlan.fc.retry.expert", PI_SEQUENCE, PI_NOTE,
27496         "Retransmission (retry)", EXPFILL }},
27497
27498     { &ei_ieee80211_tag_measure_request_unknown,
27499       { "wlan.measure.req.unknown.expert", PI_UNDECODED, PI_WARN,
27500         "Undecoded Measurement Request type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
27501
27502     { &ei_ieee80211_tag_measure_request_beacon_unknown,
27503       { "wlan.measure.req.beacon.unknown.expert", PI_UNDECODED, PI_WARN,
27504         "Unknown Data (not interpreted)", EXPFILL }},
27505
27506     { &ei_ieee80211_tag_measure_report_unknown,
27507       { "wlan.measure.req.unknown.expert", PI_UNDECODED, PI_WARN,
27508         "Undecoded Measurement Report type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
27509
27510     { &ei_ieee80211_tag_data,
27511       { "wlan.tag.data.undecoded", PI_UNDECODED, PI_NOTE,
27512         "Dissector for 802.11 IE Tag code not implemented, Contact Wireshark developers if you want this supported", EXPFILL }},
27513
27514     { &ei_ieee80211_dmg_subtype,
27515       { "wlan.dmg_subtype.bad", PI_MALFORMED, PI_ERROR,
27516         "Bad DMG type/subtype", EXPFILL }},
27517
27518     { &ei_ieee80211_vht_action,
27519       { "wlan.vht.action.undecoded", PI_UNDECODED, PI_NOTE,
27520         "All subtype of VHT Action is not yet supported by Wireshark", EXPFILL }},
27521
27522     { &ei_ieee80211_mesh_peering_unexpected,
27523       { "wlan.peering.unexpected", PI_MALFORMED, PI_ERROR,
27524         "Unexpected Self-protected action", EXPFILL }},
27525
27526     { &ei_ieee80211_fcs,
27527       { "wlan.fcs.bad_checksum", PI_MALFORMED, PI_ERROR,
27528         NULL, EXPFILL }},
27529
27530     { &ei_ieee80211_mismatched_akm_suite,
27531       { "wlan.rsn.akms.mismatched", PI_PROTOCOL, PI_ERROR,
27532         NULL, EXPFILL }},
27533   };
27534
27535   expert_module_t *expert_ieee80211;
27536
27537   module_t *wlan_module;
27538
27539   const unsigned char bssid_broadcast_data[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
27540
27541   memset(&wlan_stats, 0, sizeof wlan_stats);
27542
27543   proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
27544       "IEEE 802.11 Aggregate Data", "wlan_aggregate");
27545   proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
27546
27547   proto_wlan = proto_register_protocol("IEEE 802.11 wireless LAN", "IEEE 802.11", "wlan");
27548   /* Created to remove Decode As confusion */
27549   proto_centrino = proto_register_protocol("IEEE 802.11 wireless LAN (Centrino)", "IEEE 802.11 (Centrino)", "wlan_centrino");
27550   proto_register_field_array(proto_wlan, hf, array_length(hf));
27551
27552   proto_wlan_ext = proto_register_protocol("IEEE 802.11 wireless LAN extension frame",
27553       "IEEE 802.11 EXT", "wlan_ext");
27554
27555   proto_register_subtree_array(tree_array, array_length(tree_array));
27556
27557   expert_ieee80211 = expert_register_protocol(proto_wlan);
27558   expert_register_field_array(expert_ieee80211, ei, array_length(ei));
27559
27560   ieee80211_handle = register_dissector("wlan", dissect_ieee80211,                    proto_wlan);
27561   register_dissector("wlan_withfcs",            dissect_ieee80211_withfcs,            proto_wlan);
27562   wlan_withoutfcs_handle = register_dissector("wlan_withoutfcs", dissect_ieee80211_withoutfcs, proto_wlan);
27563   register_dissector("wlan_bsfc",               dissect_ieee80211_bsfc,               proto_wlan);
27564   register_dissector("wlan_noqos",              dissect_ieee80211_noqos,              proto_wlan);
27565
27566   register_capture_dissector("ieee80211", capture_ieee80211, proto_wlan);
27567   register_capture_dissector("ieee80211_datapad", capture_ieee80211_datapad, proto_wlan);
27568
27569   reassembly_table_register(&wlan_reassembly_table,
27570                         &addresses_reassembly_table_functions);
27571   register_init_routine(wlan_retransmit_init);
27572   reassembly_table_register(&gas_reassembly_table,
27573                         &addresses_reassembly_table_functions);
27574
27575   wlan_tap = register_tap("wlan");
27576   register_conversation_table(proto_wlan, TRUE, wlan_conversation_packet, wlan_hostlist_packet);
27577
27578   wlan_address_type = address_type_dissector_register("AT_ETHER_WLAN", "WLAN Address", ether_to_str, ether_str_len, NULL, wlan_col_filter_str,
27579                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
27580   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,
27581                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
27582   set_address(&bssid_broadcast, wlan_bssid_address_type, 6, bssid_broadcast_data);
27583
27584   /* Register configuration options */
27585   wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
27586   prefs_register_bool_preference(wlan_module, "defragment",
27587     "Reassemble fragmented 802.11 datagrams",
27588     "Whether fragmented 802.11 datagrams should be reassembled",
27589      &wlan_defragment);
27590
27591   prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
27592     "Ignore vendor-specific HT elements",
27593     "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
27594     &wlan_ignore_draft_ht);
27595
27596   prefs_register_bool_preference(wlan_module, "retransmitted",
27597     "Call subdissector for retransmitted 802.11 frames",
27598     "Whether retransmitted 802.11 frames should be subdissected",
27599     &wlan_subdissector);
27600
27601   prefs_register_bool_preference(wlan_module, "check_fcs",
27602     "Assume packets have FCS",
27603     "Some 802.11 cards include the FCS at the end of a packet, others do not.",
27604     &wlan_check_fcs);
27605
27606   prefs_register_bool_preference(wlan_module, "check_checksum",
27607     "Validate the FCS checksum if possible",
27608     "Whether to validate the FCS checksum or not.",
27609     &wlan_check_checksum);
27610
27611   prefs_register_enum_preference(wlan_module, "ignore_wep",
27612     "Ignore the Protection bit",
27613     "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
27614     "and some also leave the IV (initialization vector).",
27615     &wlan_ignore_prot, wlan_ignore_prot_options, TRUE);
27616
27617   prefs_register_obsolete_preference(wlan_module, "wep_keys");
27618
27619   prefs_register_bool_preference(wlan_module, "enable_decryption",
27620     "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
27621     &enable_decryption);
27622
27623   wep_uat = uat_new("WEP and WPA Decryption Keys",
27624             sizeof(uat_wep_key_record_t), /* record size */
27625             "80211_keys",                 /* filename */
27626             TRUE,                         /* from_profile */
27627             &uat_wep_key_records,         /* data_ptr */
27628             &num_wepkeys_uat,             /* numitems_ptr */
27629             UAT_AFFECTS_DISSECTION,       /* affects dissection of packets, but not set of named fields */
27630             NULL,                         /* help. XXX Needs chapter in WSUG */
27631             uat_wep_key_record_copy_cb,   /* copy callback */
27632             uat_wep_key_record_update_cb, /* update callback */
27633             uat_wep_key_record_free_cb,   /* free callback */
27634             init_wepkeys,                 /* post update callback - update the WEP/WPA keys */
27635             NULL,                         /* reset callback */
27636             wep_uat_flds);                /* UAT field definitions */
27637
27638   prefs_register_uat_preference(wlan_module,
27639                                 "wep_key_table",
27640                                 "Decryption keys",
27641                                 "WEP and pre-shared WPA keys\n"
27642                                 "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
27643                                 "010203040506070809101111213 (104/128-bit WEP),\n"
27644                                 "MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
27645                                 "0102030405...6061626364 (WPA + 256-bit key)."
27646                                 "Invalid keys will be ignored.",
27647                                 wep_uat);
27648 }
27649
27650 void
27651 proto_register_wlan_rsna_eapol(void)
27652 {
27653
27654   static hf_register_info hf[] = {
27655     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo,
27656      {"Key Information", "wlan_rsna_eapol.keydes.key_info",
27657       FT_UINT16, BASE_HEX, NULL, 0x0,
27658       NULL, HFILL }},
27659
27660     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version,
27661      {"Key Descriptor Version", "wlan_rsna_eapol.keydes.key_info.keydes_version",
27662       FT_UINT16, BASE_DEC, VALS(keydes_version_vals), KEY_INFO_KEYDES_VERSION_MASK,
27663       NULL, HFILL }},
27664
27665     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type,
27666      {"Key Type", "wlan_rsna_eapol.keydes.key_info.key_type",
27667       FT_BOOLEAN, 16, TFS(&keyinfo_key_type_tfs), KEY_INFO_KEY_TYPE_MASK,
27668       NULL, HFILL }},
27669
27670     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index,
27671      {"Key Index", "wlan_rsna_eapol.keydes.key_info.key_index",
27672       FT_UINT16, BASE_DEC, NULL, KEY_INFO_KEY_INDEX_MASK,
27673       NULL, HFILL }},
27674
27675     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install,
27676      {"Install", "wlan_rsna_eapol.keydes.key_info.install",
27677       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_INSTALL_MASK,
27678       NULL, HFILL }},
27679
27680     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack,
27681      {"Key ACK", "wlan_rsna_eapol.keydes.key_info.key_ack",
27682       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_ACK_MASK,
27683       NULL, HFILL }},
27684
27685     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic,
27686      {"Key MIC", "wlan_rsna_eapol.keydes.key_info.key_mic",
27687       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_MIC_MASK,
27688       NULL, HFILL }},
27689
27690     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure,
27691      {"Secure", "wlan_rsna_eapol.keydes.key_info.secure",
27692       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_SECURE_MASK,
27693       NULL, HFILL }},
27694
27695     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error,
27696      {"Error", "wlan_rsna_eapol.keydes.key_info.error",
27697       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ERROR_MASK,
27698       NULL, HFILL }},
27699
27700     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request,
27701      {"Request", "wlan_rsna_eapol.keydes.key_info.request",
27702       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_REQUEST_MASK,
27703       NULL, HFILL }},
27704
27705     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data,
27706      {"Encrypted Key Data", "wlan_rsna_eapol.keydes.key_info.encrypted_key_data",
27707       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ENCRYPTED_KEY_DATA_MASK,
27708       NULL, HFILL }},
27709
27710     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
27711      {"SMK Message", "wlan_rsna_eapol.keydes.key_info.smk_message",
27712       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ENCRYPTED_KEY_DATA_MASK,
27713       NULL, HFILL }},
27714
27715     {&hf_wlan_rsna_eapol_keydes_key_len,
27716      {"Key Length", "eapol.keydes.key_len",
27717       FT_UINT16, BASE_DEC, NULL, 0x0,
27718       NULL, HFILL }},
27719
27720     {&hf_wlan_rsna_eapol_keydes_replay_counter,
27721      {"Replay Counter", "eapol.keydes.replay_counter",
27722       FT_UINT64, BASE_DEC, NULL, 0x0,
27723       NULL, HFILL }},
27724
27725     {&hf_wlan_rsna_eapol_keydes_key_iv,
27726      {"Key IV", "eapol.keydes.key_iv",
27727       FT_BYTES, BASE_NONE, NULL, 0x0,
27728       NULL, HFILL }},
27729
27730     {&hf_wlan_rsna_eapol_wpa_keydes_nonce,
27731      {"WPA Key Nonce", "wlan_rsna_eapol.keydes.nonce",
27732       FT_BYTES, BASE_NONE, NULL, 0x0,
27733       NULL, HFILL }},
27734
27735     {&hf_wlan_rsna_eapol_wpa_keydes_rsc,
27736      {"WPA Key RSC", "wlan_rsna_eapol.keydes.rsc",
27737       FT_BYTES, BASE_NONE, NULL, 0x0,
27738       NULL, HFILL }},
27739
27740     {&hf_wlan_rsna_eapol_wpa_keydes_id,
27741      {"WPA Key ID", "wlan_rsna_eapol.keydes.id",
27742       FT_BYTES, BASE_NONE, NULL, 0x0,
27743       NULL, HFILL }},
27744
27745     {&hf_wlan_rsna_eapol_wpa_keydes_mic,
27746      {"WPA Key MIC", "wlan_rsna_eapol.keydes.mic",
27747       FT_BYTES, BASE_NONE, NULL, 0x0,
27748       NULL, HFILL }},
27749
27750     {&hf_wlan_rsna_eapol_wpa_keydes_data_len,
27751      {"WPA Key Data Length", "wlan_rsna_eapol.keydes.data_len",
27752       FT_UINT16, BASE_DEC, NULL, 0x0,
27753       NULL, HFILL }},
27754
27755     {&hf_wlan_rsna_eapol_wpa_keydes_data,
27756      {"WPA Key Data", "wlan_rsna_eapol.keydes.data",
27757       FT_BYTES, BASE_NONE, NULL, 0x0,
27758       NULL, HFILL }},
27759   };
27760
27761   static gint *tree_array[] = {
27762     &ett_keyinfo,
27763     &ett_wlan_rsna_eapol_keydes_data,
27764   };
27765
27766   proto_wlan_rsna_eapol = proto_register_protocol("IEEE 802.11 RSNA EAPOL key",
27767       "802.11 RSNA EAPOL", "wlan_rsna_eapol");
27768   proto_register_field_array(proto_wlan_rsna_eapol, hf, array_length(hf));
27769
27770   proto_register_subtree_array(tree_array, array_length(tree_array));
27771 }
27772
27773 void
27774 proto_reg_handoff_ieee80211(void)
27775 {
27776   dissector_handle_t data_encap_handle, centrino_handle;
27777   dissector_handle_t wlan_rsna_eapol_wpa_key_handle, wlan_rsna_eapol_rsn_key_handle;
27778   capture_dissector_handle_t ieee80211_cap_handle;
27779
27780   /*
27781    * Get handles for the LLC, IPX and Ethernet  dissectors.
27782    */
27783   llc_handle            = find_dissector_add_dependency("llc", proto_wlan);
27784   ipx_handle            = find_dissector_add_dependency("ipx", proto_wlan);
27785   eth_withoutfcs_handle = find_dissector_add_dependency("eth_withoutfcs", proto_wlan);
27786
27787   llc_cap_handle = find_capture_dissector("llc");
27788   ipx_cap_handle = find_capture_dissector("ipx");
27789
27790   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
27791
27792   centrino_handle = create_dissector_handle( dissect_ieee80211_centrino, proto_centrino );
27793   dissector_add_uint("ethertype", ETHERTYPE_CENTRINO_PROMISC, centrino_handle);
27794
27795   ieee80211_cap_handle = find_capture_dissector("ieee80211");
27796   capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_cap_handle);
27797   capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_WITH_RADIO, ieee80211_cap_handle);
27798   capture_dissector_add_uint("ppi", 105 /* DLT_DLT_IEEE802_11 */, ieee80211_cap_handle);
27799
27800   /* Register handoff to Aruba GRE */
27801   dissector_add_uint("gre.proto", GRE_ARUBA_8200, ieee80211_handle);
27802   dissector_add_uint("gre.proto", GRE_ARUBA_8210, ieee80211_handle);
27803   dissector_add_uint("gre.proto", GRE_ARUBA_8220, ieee80211_handle);
27804   dissector_add_uint("gre.proto", GRE_ARUBA_8230, ieee80211_handle);
27805   dissector_add_uint("gre.proto", GRE_ARUBA_8240, ieee80211_handle);
27806   dissector_add_uint("gre.proto", GRE_ARUBA_8250, ieee80211_handle);
27807   dissector_add_uint("gre.proto", GRE_ARUBA_8260, ieee80211_handle);
27808   dissector_add_uint("gre.proto", GRE_ARUBA_8270, ieee80211_handle);
27809   dissector_add_uint("gre.proto", GRE_ARUBA_8280, ieee80211_handle);
27810   dissector_add_uint("gre.proto", GRE_ARUBA_8290, ieee80211_handle);
27811   dissector_add_uint("gre.proto", GRE_ARUBA_82A0, ieee80211_handle);
27812   dissector_add_uint("gre.proto", GRE_ARUBA_82B0, ieee80211_handle);
27813   dissector_add_uint("gre.proto", GRE_ARUBA_82C0, ieee80211_handle);
27814   dissector_add_uint("gre.proto", GRE_ARUBA_82D0, ieee80211_handle);
27815   dissector_add_uint("gre.proto", GRE_ARUBA_82E0, ieee80211_handle);
27816   dissector_add_uint("gre.proto", GRE_ARUBA_82F0, ieee80211_handle);
27817   dissector_add_uint("gre.proto", GRE_ARUBA_8300, ieee80211_handle);
27818   dissector_add_uint("gre.proto", GRE_ARUBA_8310, ieee80211_handle);
27819   dissector_add_uint("gre.proto", GRE_ARUBA_8320, ieee80211_handle);
27820   dissector_add_uint("gre.proto", GRE_ARUBA_8330, ieee80211_handle);
27821   dissector_add_uint("gre.proto", GRE_ARUBA_8340, ieee80211_handle);
27822   dissector_add_uint("gre.proto", GRE_ARUBA_8350, ieee80211_handle);
27823   dissector_add_uint("gre.proto", GRE_ARUBA_8360, ieee80211_handle);
27824   dissector_add_uint("gre.proto", GRE_ARUBA_8370, ieee80211_handle);
27825
27826   data_encap_handle = create_dissector_handle(dissect_data_encap, proto_wlan);
27827   dissector_add_uint("ethertype", ETHERTYPE_IEEE80211_DATA_ENCAP,
27828                 data_encap_handle);
27829
27830   /*
27831    * EAPOL key descriptor types.
27832    */
27833   wlan_rsna_eapol_wpa_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
27834                                                                proto_wlan_rsna_eapol);
27835   dissector_add_uint("eapol.keydes.type", EAPOL_WPA_KEY, wlan_rsna_eapol_wpa_key_handle);
27836   wlan_rsna_eapol_rsn_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
27837                                                                proto_wlan_rsna_eapol);
27838   dissector_add_uint("eapol.keydes.type", EAPOL_RSN_KEY, wlan_rsna_eapol_rsn_key_handle);
27839
27840   dissector_add_uint("sflow_245.header_protocol", SFLOW_5_HEADER_80211_MAC, wlan_withoutfcs_handle);
27841 }
27842
27843 /*
27844  * Editor modelines
27845  *
27846  * Local Variables:
27847  * c-basic-offset: 2
27848  * tab-width: 8
27849  * indent-tabs-mode: nil
27850  * End:
27851  *
27852  * ex: set shiftwidth=2 tabstop=8 expandtab:
27853  * :indentSize=2:tabSize=8:noTabs=true:
27854  */