Add more fields to packet_info structure and use them.
[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  * 09/12/2003 - Added dissection of country information tag
34  *
35  * Ritchie<at>tipsybottle.com
36  *
37  * 03/22/2004 - Added dissection of RSN IE
38  * Jouni Malinen <jkmaline@cc.hut.fi>
39  *
40  * 10/24/2005 - Add dissection for 802.11e
41  * Zhu Yi <yi.zhu@intel.com>
42  *
43  * Dutin Johnson - 802.11n and portions of 802.11k and 802.11ma
44  * dustin@dustinj.us & dustin.johnson@cacetech.com
45  *
46  * 01/31/2008 - Added dissection of 802.11s
47  * Javier Cardona <javier@cozybit.com>
48  *
49  * 04/21/2008 - Added dissection for 802.11p
50  * Arada Systems <http://www.aradasystems.com>
51  *
52  * 05/29/2011 - UATification of decryption keys
53  * Michael Mann <mmann78@netscape.net>
54  *
55  * 07/30/2011 - Update 802.11s packet dissecting to the ratified standard (v12.0)
56  * Brian Cavagnolo <brian@cozybit.com>
57  *
58  * Enhance 802.11 dissector by Alexis La Goutte
59  *
60  * 04/20/2013 - Added dissection of 802.11ad according to the 9th draft of the standard.
61  * Extended as a project in the Laboratory of Computer Communication & Networking (LCCN), Computer Science Department, Technion, Israel.
62  * Majd Omari    <majd.omari@outlook.com>
63  * Jalil Moraney <moraney.jalil@outlook.com>
64  */
65
66 /*
67  * Reference :
68  * The 802.11 standard is "free", 6 month after the publication.
69  *
70  * IEEE Std 802.11-2012: Revision of IEEE Std 802.11-2007
71  * include 10 amendments (802.11k,r,y,w,n,p,z,v,u,s) 802.11-2007
72  * include 8 amendments (802.11a,b,d,e,g,h,i,j) 802.11-1999
73  * http://standards.ieee.org/getieee802/download/802.11-2012.pdf
74  *
75  * WAPI (IE 68)
76  * http://isotc.iso.org/livelink/livelink/fetch/-8913189/8913214/8913250/8913253/JTC001-N-9880.pdf?nodeid=8500308&vernum=-2
77  */
78
79 #include "config.h"
80
81 #include <math.h>
82
83 #include <epan/packet.h>
84 #include <epan/capture_dissectors.h>
85 #include <epan/exceptions.h>
86 #include <wsutil/pint.h>
87 #include <wsutil/str_util.h>
88 #include <epan/addr_resolv.h>
89 #include <epan/address_types.h>
90 #include <epan/strutil.h>
91 #include <epan/prefs.h>
92 #include <epan/reassemble.h>
93 #include "packet-ipx.h"
94 #include "packet-llc.h"
95 #include "packet-ieee80211.h"
96 #include <epan/etypes.h>
97 #include <epan/oui.h>
98 #include <epan/crc32-tvb.h>
99 #include <epan/crypt/wep-wpadefs.h>
100 #include <epan/expert.h>
101 #include <epan/conversation_table.h>
102 #include <epan/uat.h>
103 #include <epan/eapol_keydes_types.h>
104 #include <epan/to_str.h>
105
106 #include "packet-wps.h"
107 #include "packet-e212.h"
108 #include "packet-sflow.h"
109 #include "packet-gre.h"
110
111 /*     Davide Schiera (2006-11-22): including AirPDcap project                */
112 #include <epan/crypt/airpdcap_ws.h>
113 /* Davide Schiera (2006-11-22) ---------------------------------------------- */
114
115 void proto_register_ieee80211(void);
116 void proto_reg_handoff_ieee80211(void);
117 void proto_register_wlan_rsna_eapol(void);
118
119 extern value_string_ext eap_type_vals_ext; /* from packet-eap.c */
120
121 #ifndef roundup2
122 #define roundup2(x, y)  (((x)+((y)-1))&(~((y)-1)))  /* if y is powers of two */
123 #endif
124
125 /* bitmask for bits [l..h]
126  * taken from kernel's include/linux/bitops.h
127  */
128 #define GENMASK(h, l)  (((1U << ((h) - (l) + 1)) - 1) << (l))
129
130 /* Defragment fragmented 802.11 datagrams */
131 static gboolean wlan_defragment = TRUE;
132
133 /* call subdissector for retransmitted frames */
134 static gboolean wlan_subdissector = TRUE;
135
136 /* Check for the presence of the 802.11 FCS */
137 static gboolean wlan_check_fcs = FALSE;
138
139 /* Check the FCS checksum */
140 static gboolean wlan_check_checksum = TRUE;
141
142 /* Ignore vendor-specific HT elements */
143 static gboolean wlan_ignore_draft_ht = FALSE;
144
145 /* Ignore the Protection bit; assume packet is decrypted */
146 /* (The term "WEP" is historical.) */
147 #define WLAN_IGNORE_WEP_NO     0
148 #define WLAN_IGNORE_WEP_WO_IV  1
149 #define WLAN_IGNORE_WEP_W_IV   2
150 static gint wlan_ignore_wep = WLAN_IGNORE_WEP_NO;
151
152 /* Table for reassembly of fragments. */
153 static reassembly_table wlan_reassembly_table;
154
155 /* Statistical data */
156 static struct _wlan_stats wlan_stats;
157
158 /*-------------------------------------
159  * UAT for WEP decoder
160  *-------------------------------------
161  */
162 static uat_wep_key_record_t *uat_wep_key_records = NULL;
163 static uat_t                *wep_uat             = NULL;
164 static guint                 num_wepkeys_uat     = 0;
165
166 static void *
167 uat_wep_key_record_copy_cb(void* n, const void* o, size_t siz _U_)
168 {
169   uat_wep_key_record_t* new_key = (uat_wep_key_record_t *)n;
170   const uat_wep_key_record_t* old_key = (const uat_wep_key_record_t *)o;
171
172   if (old_key->string) {
173     new_key->string = g_strdup(old_key->string);
174   } else {
175     new_key->string = NULL;
176   }
177
178   return new_key;
179 }
180
181 static gboolean
182 uat_wep_key_record_update_cb(void* r, char** err)
183 {
184   uat_wep_key_record_t* rec = (uat_wep_key_record_t *)r;
185   decryption_key_t* dk;
186   guint dk_type;
187
188   if (rec->string == NULL) {
189     *err = g_strdup("Key can't be blank");
190     return FALSE;
191   }
192
193   g_strstrip(rec->string);
194   dk = parse_key_string(rec->string, rec->key);
195
196   if (dk != NULL) {
197     dk_type = dk->type;
198     free_key_string(dk);
199     switch (dk_type) {
200       case AIRPDCAP_KEY_TYPE_WEP:
201       case AIRPDCAP_KEY_TYPE_WEP_40:
202       case AIRPDCAP_KEY_TYPE_WEP_104:
203         if (rec->key != AIRPDCAP_KEY_TYPE_WEP) {
204           *err = g_strdup("Invalid key format");
205           return FALSE;
206         }
207         break;
208       case AIRPDCAP_KEY_TYPE_WPA_PWD:
209         if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PWD) {
210           *err = g_strdup("Invalid key format");
211           return FALSE;
212         }
213         break;
214       case AIRPDCAP_KEY_TYPE_WPA_PSK:
215         if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PSK) {
216           *err = g_strdup("Invalid key format");
217           return FALSE;
218         }
219         break;
220       default:
221         *err = g_strdup("Invalid key format");
222         return FALSE;
223         break;
224     }
225   } else {
226     *err = g_strdup("Invalid key format");
227     return FALSE;
228   }
229   return TRUE;
230 }
231
232 static void
233 uat_wep_key_record_free_cb(void*r)
234 {
235   uat_wep_key_record_t* key = (uat_wep_key_record_t *)r;
236
237   if (key->string) g_free(key->string);
238 }
239
240 UAT_VS_DEF(uat_wep_key_records, key, uat_wep_key_record_t, guint8, 0, STRING_KEY_TYPE_WEP)
241 UAT_CSTRING_CB_DEF(uat_wep_key_records, string, uat_wep_key_record_t)
242
243 /* Stuff for the WEP/WPA/WPA2 decoder */
244 static gboolean enable_decryption = TRUE;
245
246 static void
247 ieee_80211_add_tagged_parameters (tvbuff_t *tvb, int offset, packet_info *pinfo,
248                                   proto_tree *tree, int tagged_parameters_len, int ftype);
249
250 /* Davide Schiera (2006-11-26): created function to decrypt WEP and WPA/WPA2  */
251 static tvbuff_t *try_decrypt(tvbuff_t *tvb, guint32 offset, guint32 len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer, PAIRPDCAP_KEY_ITEM used_key);
252
253 static int weak_iv(guchar *iv);
254
255 typedef struct mimo_control
256 {
257   guint8 nc;
258   guint8 nr;
259   gboolean chan_width;
260   guint8 grouping;
261   guint8 coefficient_size;
262   guint8 codebook_info;
263   guint8 remaining_matrix_segment;
264 } mimo_control_t;
265
266 /* ************************************************************************* */
267 /*                          Miscellaneous Constants                          */
268 /* ************************************************************************* */
269 #define SHORT_STR 256
270 #define IS_DMG_KEY 1
271 #define IS_CTRL_GRANT_OR_GRANT_ACK_KEY 2
272 /* ************************************************************************* */
273 /*  Define some very useful macros that are used to analyze frame types etc. */
274 /* ************************************************************************* */
275
276 /*
277  * Fetch the frame control field and swap it if needed.  "fcf" and "tvb"
278  * must be valid variables.
279  */
280 #define FETCH_FCF(off) (wlan_broken_fc ? \
281   GUINT16_SWAP_LE_BE(tvb_get_letohs(tvb, off)) : \
282   tvb_get_letohs(tvb, off))
283
284 /*
285  * Extract the fragment number and sequence number from the sequence
286  * control field.
287  */
288 #define SEQCTL_FRAGMENT_NUMBER(x) ((x) & 0x000F)
289 #define SEQCTL_SEQUENCE_NUMBER(x) (((x) & 0xFFF0) >> 4)
290
291 /*
292  * Extract subfields from the QoS control field.
293  */
294 #define QOS_TID(x)            ((x) & 0x000F)
295 #define QOS_PRIORITY(x)       ((x) & 0x0007)
296 #define QOS_EOSP(x)           (((x) & 0x0010) >> 4) /* end of service period */
297 #define QOS_ACK_POLICY(x)     (((x) & 0x0060) >> 5)
298 #define QOS_AMSDU_PRESENT(x)  (((x) & 0x0080) >> 6)
299 #define QOS_FIELD_CONTENT(x)  (((x) & 0xFF00) >> 8)
300 #define QOS_MESH_CONTROL_PRESENT(x) (((x) & 0x0100) >> 8)
301
302 #define QOS_FLAG_EOSP    0x0010
303
304 /*
305  * Extract subfields from the result of QOS_FIELD_CONTENT().
306  */
307 #define QOS_PS_BUF_STATE_INDICATED(x)  (((x) & 0x02) >> 1)
308 #define QOS_PS_HIGHEST_PRI_BUF_AC(x)   (((x) & 0x0C) >> 2)
309 #define QOS_PS_QAP_BUF_LOAD(x)         (((x) & 0xF0) >> 4)
310
311 /*
312  * Bits from the HT Control field.
313  * 802.11-2012 and 802.11ac-2013 8.2.4.6, 32 bits.
314  */
315 #define HTC_VHT              0x00000001
316 #define HTC_MRQ              0x00000004
317 #define HTC_UNSOLICITED_MFB  0x20000000
318
319 /*
320  * Extract subfields from the HT Control field.
321  */
322 #define HTC_LAC(htc)           ((htc) & 0xFE)
323 #define HTC_LAC_MAI(htc)       (((htc) >> 2) & 0xF)
324 #define HTC_IS_ASELI(htc)      (HTC_LAC_MAI(htc) == 0xE)
325 #define HTC_LAC_MAI_MRQ(htc)   ((HTC_LAC_MAI(htc))  & 0x1)
326 #define HTC_LAC_MAI_MSI(htc)   ((HTC_LAC_MAI(htc) >> 1) & 0x7)
327 #define HTC_LAC_MFSI(htc)      (((htc) >> 4) & 0x7)
328 #define HTC_LAC_ASEL_CMD(htc)  (((htc) >> 9) & 0x7)
329 #define HTC_LAC_ASEL_DATA(htc) (((htc) >> 12) & 0xF)
330 #define HTC_LAC_MFB(htc)       (((htc) >> 9) & 0x7F)
331 #define HTC_CAL_POS(htc)       (((htc) >> 16) & 0x3)
332 #define HTC_CAL_SEQ(htc)       (((htc) >> 18) & 0x3)
333 #define HTC_CSI_STEERING(htc)  (((htc) >> 22) & 0x3)
334 #define HTC_NDP_ANN(htc)       (((htc) >> 24) & 0x1)
335 #define HTC_AC_CONSTRAINT(htc) (((htc) >> 30) & 0x1)
336 #define HTC_RDG_MORE_PPDU(htc) (((htc) >> 31) & 0x1)
337
338 #define HTC_MFB(htc)           (((htc) >> 9) & 0x7FFF)
339
340 /* VHT-MCS = 15, NUM_STS = 7 */
341 #define HTC_NO_FEEDBACK_PRESENT(mfb) (((mfb) & 0x7F) == 0x7F)
342
343 /*
344  * Extract subfields from the key octet in WEP-encrypted frames.
345  */
346 #define KEY_OCTET_WEP_KEY(x)   (((x) & 0xC0) >> 6)
347
348 #define KEY_EXTIV    0x20
349 #define EXTIV_LEN    8
350
351 /*
352  * Bits from the Mesh Flags field
353  */
354 #define MESH_FLAGS_ADDRESS_EXTENSION  0x3
355
356 /* ************************************************************************* */
357 /*              Constants used to identify cooked frame types                */
358 /* ************************************************************************* */
359 #define MGT_FRAME            0x00  /* Frame type is management */
360 #define CONTROL_FRAME        0x01  /* Frame type is control */
361 #define DATA_FRAME           0x02  /* Frame type is Data */
362 #define EXTENSION_FRAME      0x03  /* Frame type is Extension */
363
364 #define DATA_SHORT_HDR_LEN     24
365 #define DATA_LONG_HDR_LEN      30
366 #define MGT_FRAME_HDR_LEN      24  /* Length of Management frame-headers */
367
368
369 /* ************************************************************************* */
370 /*        Logical field codes (dissector's encoding of fixed fields)         */
371 /* ************************************************************************* */
372 enum fixed_field {
373   FIELD_TIMESTAMP,                            /* 64-bit timestamp */
374   FIELD_BEACON_INTERVAL,                      /* 16-bit beacon interval */
375   FIELD_CAP_INFO,                             /* Add capability information tree */
376   FIELD_AUTH_ALG,                             /* Authentication algorithm used */
377   FIELD_AUTH_TRANS_SEQ,                       /* Authentication sequence number */
378   FIELD_CURRENT_AP_ADDR,
379   FIELD_LISTEN_IVAL,
380   FIELD_REASON_CODE,
381   FIELD_ASSOC_ID,
382   FIELD_STATUS_CODE,
383   FIELD_CATEGORY_CODE,                        /* Management action category */
384   FIELD_ACTION_CODE,                          /* Management action code */
385   FIELD_DIALOG_TOKEN,                         /* Management action dialog token */
386   FIELD_FOLLOWUP_DIALOG_TOKEN,
387   FIELD_WME_ACTION_CODE,                      /* Management notification action code */
388   FIELD_WME_DIALOG_TOKEN,                     /* Management notification dialog token */
389   FIELD_WME_STATUS_CODE,                      /* Management notification setup response status code */
390   FIELD_QOS_ACTION_CODE,
391   FIELD_QOS_TS_INFO,
392   FIELD_DLS_ACTION_CODE,
393   FIELD_DST_MAC_ADDR,                         /* DLS destination MAC address */
394   FIELD_SRC_MAC_ADDR,                         /* DLS source MAC address */
395   FIELD_DLS_TIMEOUT,                          /* DLS timeout value */
396   FIELD_SCHEDULE_INFO,                        /* Schedule Info field */
397   FIELD_ACTION,                               /* Action field */
398   FIELD_BLOCK_ACK_ACTION_CODE,
399   FIELD_QOS_INFO_AP,
400   FIELD_QOS_INFO_STA,
401   FIELD_BLOCK_ACK_PARAM,
402   FIELD_BLOCK_ACK_TIMEOUT,
403   FIELD_BLOCK_ACK_SSC,
404   FIELD_DELBA_PARAM_SET,
405   FIELD_MAX_REG_PWR,
406   FIELD_MEASUREMENT_PILOT_INT,
407   FIELD_COUNTRY_STR,
408   FIELD_MAX_TX_PWR,
409   FIELD_TX_PWR_USED,
410   FIELD_TRANSCEIVER_NOISE_FLOOR,
411   FIELD_DS_PARAM_SET,
412   FIELD_CHANNEL_WIDTH,
413   FIELD_SM_PWR_CNTRL,
414   FIELD_PCO_PHASE_CNTRL,
415   FIELD_PSMP_PARAM_SET,
416   FIELD_PSMP_STA_INFO,
417   FIELD_MIMO_CNTRL,
418   FIELD_ANT_SELECTION,
419   FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT,
420   FIELD_HT_INFORMATION,
421   FIELD_HT_ACTION_CODE,
422   FIELD_PA_ACTION_CODE,
423   FIELD_PPA_ACTION_CODE,
424   FIELD_FT_ACTION_CODE,
425   FIELD_STA_ADDRESS,
426   FIELD_TARGET_AP_ADDRESS,
427   FIELD_GAS_COMEBACK_DELAY,
428   FIELD_GAS_FRAGMENT_ID,
429   FIELD_SA_QUERY_ACTION_CODE,
430   FIELD_TRANSACTION_ID,
431   FIELD_TDLS_ACTION_CODE,
432   FIELD_TARGET_CHANNEL,
433   FIELD_OPERATING_CLASS,
434   FIELD_MESH_ACTION,
435   FIELD_MULTIHOP_ACTION,
436   FIELD_MESH_CONTROL,
437   FIELD_SELFPROT_ACTION,
438   FIELD_WNM_ACTION_CODE,
439   FIELD_UNPROTECTED_WNM_ACTION_CODE,
440   FIELD_RELAY_CAPABLE_STA_INFO,
441   FIELD_BAND_ID,
442   FIELD_DMG_PARAMETERS,
443   FIELD_SECTOR_SWEEP,
444   FIELD_DYNAMIC_ALLOCATION,
445   FIELD_SECTOR_SWEEP_FB,
446   FIELD_BRP_REQ,
447   FIELD_BEAMFORMING_CTRL,
448   FIELD_BEAMFORMED_LINK_MAINTAINCE,
449   FIELD_BEACON_INTERVAL_CTRL,
450   FIELD_KEY_DATA_LENGTH,
451   FIELD_WNM_NOTIFICATION_TYPE,
452   FIELD_RM_ACTION_CODE,
453   FIELD_RM_DIALOG_TOKEN,
454   FIELD_RM_REPETITIONS,
455   FIELD_RM_TX_POWER,
456   FIELD_RM_MAX_TX_POWER,
457   FIELD_RM_TPC_REPORT,
458   FIELD_RM_RX_ANTENNA_ID,
459   FIELD_RM_TX_ANTENNA_ID,
460   FIELD_RM_RCPI,
461   FIELD_RM_RSNI,
462   FIELD_DMG_ACTION_CODE,
463   FIELD_DMG_PWR_MGMT,
464   FIELD_REQ_AP_ADDR,
465   FIELD_RES_AP_ADDR,
466   FIELD_CHECK_BEACON,
467   FIELD_TOD,
468   FIELD_TOA,
469   FIELD_MAX_TOD_ERR,
470   FIELD_MAX_TOA_ERR,
471   FIELD_SUBJECT_ADDRESS,
472   FIELD_HANDOVER_REASON,
473   FIELD_HANDOVER_REMAINING_BI,
474   FIELD_HANDOVER_RESULT,
475   FIELD_HANDOVER_REJECT_REASON,
476   FIELD_DESTINATION_REDS_AID,
477   FIELD_DESTINATION_AID,
478   FIELD_REALY_AID,
479   FIELD_SOURCE_AID,
480   FIELD_TIMING_OFFSET,
481   FIELD_SAMPLING_FREQUENCY_OFFSET,
482   FIELD_RELAY_OPERATION_TYPE,
483   FIELD_UNPROTECTED_DMG_ACTION_CODE,
484   FIELD_FST_ACTION_CODE,
485   FIELD_LLT,
486   FIELD_FSTS_ID,
487   FIELD_OCT_MMPDU,
488   FIELD_VHT_ACTION,
489                                               /* add any new fixed field value above this line */
490   MAX_FIELD_NUM
491 };
492
493 /* ************************************************************************* */
494 /*        Logical field codes (IEEE 802.11 encoding of tags)                 */
495 /* ************************************************************************* */
496 #define TAG_SSID                       0
497 #define TAG_SUPP_RATES                 1
498 #define TAG_FH_PARAMETER               2
499 #define TAG_DS_PARAMETER               3
500 #define TAG_CF_PARAMETER               4
501 #define TAG_TIM                        5
502 #define TAG_IBSS_PARAMETER             6
503 #define TAG_COUNTRY_INFO               7
504 #define TAG_FH_HOPPING_PARAMETER       8
505 #define TAG_FH_HOPPING_TABLE           9
506 #define TAG_REQUEST                   10
507 #define TAG_QBSS_LOAD                 11
508 #define TAG_EDCA_PARAM_SET            12
509 #define TAG_TSPEC                     13
510 #define TAG_TCLAS                     14
511 #define TAG_SCHEDULE                  15
512 #define TAG_CHALLENGE_TEXT            16
513
514 #define TAG_POWER_CONSTRAINT          32
515 #define TAG_POWER_CAPABILITY          33
516 #define TAG_TPC_REQUEST               34
517 #define TAG_TPC_REPORT                35
518 #define TAG_SUPPORTED_CHANNELS        36
519 #define TAG_CHANNEL_SWITCH_ANN        37
520 #define TAG_MEASURE_REQ               38
521 #define TAG_MEASURE_REP               39
522 #define TAG_QUIET                     40
523 #define TAG_IBSS_DFS                  41
524 #define TAG_ERP_INFO                  42
525 #define TAG_TS_DELAY                  43
526 #define TAG_TCLAS_PROCESS             44
527 #define TAG_HT_CAPABILITY             45 /* IEEE Stc 802.11n/D2.0 */
528 #define TAG_QOS_CAPABILITY            46
529 #define TAG_ERP_INFO_OLD              47 /* IEEE Std 802.11g/D4.0 */
530 #define TAG_RSN_IE                    48
531 /* Reserved 49 */
532 #define TAG_EXT_SUPP_RATES            50
533 #define TAG_AP_CHANNEL_REPORT         51
534 #define TAG_NEIGHBOR_REPORT           52
535 #define TAG_RCPI                      53
536 #define TAG_MOBILITY_DOMAIN           54  /* IEEE Std 802.11r-2008 */
537 #define TAG_FAST_BSS_TRANSITION       55  /* IEEE Std 802.11r-2008 */
538 #define TAG_TIMEOUT_INTERVAL          56  /* IEEE Std 802.11r-2008 */
539 #define TAG_RIC_DATA                  57  /* IEEE Std 802.11r-2008 */
540 #define TAG_DSE_REG_LOCATION          58
541 #define TAG_SUPPORTED_OPERATING_CLASSES             59 /* IEEE Std 802.11w-2009 */
542 #define TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT    60 /* IEEE Std 802.11w-2009 */
543 #define TAG_HT_INFO                   61  /* IEEE Stc 802.11n/D2.0 */
544 #define TAG_SECONDARY_CHANNEL_OFFSET  62  /* IEEE Stc 802.11n/D1.10/D2.0 */
545 #define TAG_BSS_AVG_ACCESS_DELAY      63
546 #define TAG_ANTENNA                   64
547 #define TAG_RSNI                      65
548 #define TAG_MEASURE_PILOT_TRANS       66
549 #define TAG_BSS_AVB_ADM_CAPACITY      67
550 #define TAG_IE_68_CONFLICT            68  /* Conflict: WAPI Vs. IEEE */
551 #define TAG_WAPI_PARAM_SET            68
552 #define TAG_BSS_AC_ACCESS_DELAY       68
553 #define TAG_TIME_ADV                  69  /* IEEE Std 802.11p-2010 */
554 #define TAG_RM_ENABLED_CAPABILITY     70
555 #define TAG_MULTIPLE_BSSID            71
556 #define TAG_20_40_BSS_CO_EX           72  /* IEEE P802.11n/D6.0 */
557 #define TAG_20_40_BSS_INTOL_CH_REP    73  /* IEEE P802.11n/D6.0 */
558 #define TAG_OVERLAP_BSS_SCAN_PAR      74  /* IEEE P802.11n/D6.0 */
559 #define TAG_RIC_DESCRIPTOR            75  /* IEEE Std 802.11r-2008 */
560 #define TAG_MMIE                      76  /* IEEE Std 802.11w-2009 */
561 #define TAG_EVENT_REQUEST             78
562 #define TAG_EVENT_REPORT              79
563 #define TAG_DIAGNOSTIC_REQUEST        80
564 #define TAG_DIAGNOSTIC_REPORT         81
565 #define TAG_LOCATION_PARAMETERS       82
566 #define TAG_NO_BSSID_CAPABILITY       83
567 #define TAG_SSID_LIST                 84
568 #define TAG_MULTIPLE_BSSID_INDEX      85
569 #define TAG_FMS_DESCRIPTOR            86
570 #define TAG_FMS_REQUEST               87
571 #define TAG_FMS_RESPONSE              88
572 #define TAG_QOS_TRAFFIC_CAPABILITY    89
573 #define TAG_BSS_MAX_IDLE_PERIOD       90
574 #define TAG_TFS_REQUEST               91
575 #define TAG_TFS_RESPONSE              92
576 #define TAG_WNM_SLEEP_MODE            93
577 #define TAG_TIM_BROADCAST_REQUEST     94
578 #define TAG_TIM_BROADCAST_RESPONSE    95
579 #define TAG_COLLOCATED_INTER_REPORT   96
580 #define TAG_CHANNEL_USAGE             97
581 #define TAG_TIME_ZONE                 98  /* IEEE Std 802.11v-2011 */
582 #define TAG_DMS_REQUEST               99
583 #define TAG_DMS_RESPONSE             100
584 #define TAG_LINK_IDENTIFIER          101  /* IEEE Std 802.11z-2010 */
585 #define TAG_WAKEUP_SCHEDULE          102  /* IEEE Std 802.11z-2010 */
586 #define TAG_CHANNEL_SWITCH_TIMING    104  /* IEEE Std 802.11z-2010 */
587 #define TAG_PTI_CONTROL              105  /* IEEE Std 802.11z-2010 */
588 #define TAG_PU_BUFFER_STATUS         106  /* IEEE Std 802.11z-2010 */
589 #define TAG_INTERWORKING             107  /* IEEE Std 802.11u-2011 */
590 #define TAG_ADVERTISEMENT_PROTOCOL   108  /* IEEE Std 802.11u-2011 */
591 #define TAG_EXPIDITED_BANDWIDTH_REQ  109  /* IEEE Std 802.11u-2011 */
592 #define TAG_QOS_MAP_SET              110  /* IEEE Std 802.11u-2011 */
593 #define TAG_ROAMING_CONSORTIUM       111  /* IEEE Std 802.11u-2011 */
594 #define TAG_EMERGENCY_ALERT_ID       112  /* IEEE Std 802.11u-2011 */
595 #define TAG_MESH_CONFIGURATION       113  /* IEEE Std 802.11s-2011 */
596 #define TAG_MESH_ID                  114  /* IEEE Std 802.11s-2011 */
597 #define TAG_MESH_LINK_METRIC_REPORT  115
598 #define TAG_CONGESTION_NOTIFICATION  116
599 #define TAG_MESH_PEERING_MGMT        117  /* IEEE Std 802.11s-2011 */
600 #define TAG_MESH_CHANNEL_SWITCH      118
601 #define TAG_MESH_AWAKE_WINDOW        119
602 #define TAG_BEACON_TIMING            120
603 #define TAG_MCCAOP_SETUP_REQUEST     121
604 #define TAG_MCCAOP_SETUP_REPLY       122
605 #define TAG_MCCAOP_ADVERTISEMENT     123
606 #define TAG_MCCAOP_TEARDOWN          124
607 #define TAG_GANN                     125
608 #define TAG_RANN                     126  /* IEEE Std 802.11s-2011 */
609 #define TAG_EXTENDED_CAPABILITIES    127  /* IEEE Stc 802.11n/D1.10/D2.0 */
610 #define TAG_AGERE_PROPRIETARY        128
611 #define TAG_MESH_PREQ                130  /* IEEE Std 802.11s-2011 */
612 #define TAG_MESH_PREP                131  /* IEEE Std 802.11s-2011 */
613 #define TAG_MESH_PERR                132  /* IEEE Std 802.11s-2011 */
614 #define TAG_CISCO_CCX1_CKIP          133  /* Cisco Compatible eXtensions v1 */
615 #define TAG_CISCO_CCX2               136  /* Cisco Compatible eXtensions v2 */
616 #define TAG_PXU                      137
617 #define TAG_PXUC                     138
618 #define TAG_AUTH_MESH_PEERING_EXCH   139
619 #define TAG_MIC                      140
620 #define TAG_DESTINATION_URI          141
621 #define TAG_U_APSD_COEX              142
622 #define TAG_WAKEUP_SCHEDULE_AD       143  /* IEEE Std 802.11ad */
623 #define TAG_EXTENDED_SCHEDULE        144  /* IEEE Std 802.11ad */
624 #define TAG_STA_AVAILABILITY         145  /* IEEE Std 802.11ad */
625 #define TAG_DMG_TSPEC                146  /* IEEE Std 802.11ad */
626 #define TAG_NEXT_DMG_ATI             147  /* IEEE Std 802.11ad */
627 #define TAG_DMG_CAPABILITIES         148  /* IEEE Std 802.11ad */
628 #define TAG_CISCO_CCX3               149  /* Cisco Compatible eXtensions v3 */
629 #define TAG_CISCO_VENDOR_SPECIFIC    150  /* Cisco Compatible eXtensions */
630 #define TAG_DMG_OPERATION            151  /* IEEE Std 802.11ad */
631 #define TAG_DMG_BSS_PRAMTER_CHANGE   152  /* IEEE Std 802.11ad */
632 #define TAG_DMG_BEAM_REFINEMENT      153  /* IEEE Std 802.11ad */
633 #define TAG_CHANNEL_MEASURMENT_FB    154  /* IEEE Std 802.11ad */
634 #define TAG_AWAKE_WINDOW             157  /* IEEE Std 802.11ad */
635 #define TAG_MULTI_BAND               158  /* IEEE Std 802.11ad */
636 #define TAG_ADDBA_EXT                159  /* IEEE Std 802.11ad */
637 #define TAG_NEXTPCP_LIST             160  /* IEEE Std 802.11ad */
638 #define TAG_PCP_HANDOVER             161  /* IEEE Std 802.11ad */
639 #define TAG_DMG_LINK_MARGIN          162  /* IEEE Std 802.11ad */
640 #define TAG_SWITCHING_STREAM         163  /* IEEE Std 802.11ad */
641 #define TAG_SESSION_TRANSMISSION     164  /* IEEE Std 802.11ad */
642 #define TAG_DYN_TONE_PAIR_REP        165  /* IEEE Std 802.11ad */
643 #define TAG_CLUSTER_REP              166  /* IEEE Std 802.11ad */
644 #define TAG_RELAY_CAPABILITIES       167  /* IEEE Std 802.11ad */
645 #define TAG_RELAY_TRANSFER_PARAM     168  /* IEEE Std 802.11ad */
646 #define TAG_BEAMLINK_MAINTAINCE      169  /* IEEE Std 802.11ad */
647 #define TAG_MULTIPLE_MAC_SUBLAYERS   170  /* IEEE Std 802.11ad */
648 #define TAG_U_PID                    171  /* IEEE Std 802.11ad */
649 #define TAG_DMG_LINK_ADAPTION_ACK    172  /* IEEE Std 802.11ad */
650 #define TAG_SYMBOL_PROPRIETARY       173
651 #define TAG_MCCAOP_ADVERTISEMENT_OV  174
652 #define TAG_QUIET_PERIOD_REQ         175  /* IEEE Std 802.11ad */
653 #define TAG_QUIET_PERIOD_RES         177  /* IEEE Std 802.11ad */
654 #define TAG_ECPAC_POLICY             182  /* IEEE Std 802.11ad */
655 #define TAG_CLUSTER_TIME_OFFSET      183  /* IEEE Std 802.11ad */
656 #define TAG_ANTENNA_SECTOR_ID        190  /* IEEE Std 802.11ad */
657 #define TAG_VHT_CAPABILITY           191  /* IEEE Std 802.11ac/D3.1 */
658 #define TAG_VHT_OPERATION            192  /* IEEE Std 802.11ac/D3.1 */
659 #define TAG_EXT_BSS_LOAD             193  /* IEEE Std 802.11ac */
660 #define TAG_WIDE_BW_CHANNEL_SWITCH   194  /* IEEE Std 802.11ac */
661 #define TAG_VHT_TX_PWR_ENVELOPE      195  /* IEEE Std 802.11ac/D5.0 */
662 #define TAG_CHANNEL_SWITCH_WRAPPER   196  /* IEEE Std 802.11ac */
663 #define TAG_OPERATING_MODE_NOTIFICATION 199  /* IEEE Std 802.11ac */
664 #define TAG_VENDOR_SPECIFIC_IE       221
665
666 static const value_string tag_num_vals[] = {
667   { TAG_SSID,                                 "SSID parameter set" },
668   { TAG_SUPP_RATES,                           "Supported Rates" },
669   { TAG_FH_PARAMETER,                         "FH Parameter set" },
670   { TAG_DS_PARAMETER,                         "DS Parameter set" },
671   { TAG_CF_PARAMETER,                         "CF Parameter set" },
672   { TAG_TIM,                                  "Traffic Indication Map (TIM)" },
673   { TAG_IBSS_PARAMETER,                       "IBSS Parameter set" },
674   { TAG_COUNTRY_INFO,                         "Country Information" },
675   { TAG_FH_HOPPING_PARAMETER,                 "Hopping Pattern Parameters" },
676   { TAG_FH_HOPPING_TABLE,                     "Hopping Pattern Table" },
677   { TAG_REQUEST,                              "Request" },
678   { TAG_QBSS_LOAD,                            "QBSS Load Element" },
679   { TAG_EDCA_PARAM_SET,                       "EDCA Parameter Set" },
680   { TAG_TSPEC,                                "Traffic Specification" },
681   { TAG_TCLAS,                                "Traffic Classification" },
682   { TAG_SCHEDULE,                             "Schedule" },
683   { TAG_CHALLENGE_TEXT,                       "Challenge text" },
684   { TAG_POWER_CONSTRAINT,                     "Power Constraint" },
685   { TAG_POWER_CAPABILITY,                     "Power Capability" },
686   { TAG_TPC_REQUEST,                          "TPC Request" },
687   { TAG_TPC_REPORT,                           "TPC Report" },
688   { TAG_SUPPORTED_CHANNELS,                   "Supported Channels" },
689   { TAG_CHANNEL_SWITCH_ANN,                   "Channel Switch Announcement" },
690   { TAG_MEASURE_REQ,                          "Measurement Request" },
691   { TAG_MEASURE_REP,                          "Measurement Report" },
692   { TAG_QUIET,                                "Quiet" },
693   { TAG_IBSS_DFS,                             "IBSS DFS" },
694   { TAG_ERP_INFO,                             "ERP Information" },
695   { TAG_TS_DELAY,                             "TS Delay" },
696   { TAG_TCLAS_PROCESS,                        "TCLAS Processing" },
697   { TAG_HT_CAPABILITY,                        "HT Capabilities (802.11n D1.10)" },
698   { TAG_QOS_CAPABILITY,                       "QoS Capability" },
699   { TAG_ERP_INFO_OLD,                         "ERP Information" }, /* Reserved... */
700   { TAG_RSN_IE,                               "RSN Information" },
701   { TAG_EXT_SUPP_RATES,                       "Extended Supported Rates" },
702   { TAG_AP_CHANNEL_REPORT,                    "AP Channel Report" },
703   { TAG_NEIGHBOR_REPORT,                      "Neighbor Report" },
704   { TAG_RCPI,                                 "RCPI" },
705   { TAG_MOBILITY_DOMAIN,                      "Mobility Domain" },
706   { TAG_FAST_BSS_TRANSITION,                  "Fast BSS Transition" },
707   { TAG_TIMEOUT_INTERVAL,                     "Timeout Interval" },
708   { TAG_RIC_DATA,                             "RIC Data" },
709   { TAG_DSE_REG_LOCATION,                     "DSE Registered Location" },
710   { TAG_SUPPORTED_OPERATING_CLASSES,          "Supported Operating Classes" },
711   { TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement" },
712   { TAG_HT_INFO,                              "HT Information (802.11n D1.10)" },
713   { TAG_SECONDARY_CHANNEL_OFFSET,             "Secondary Channel Offset (802.11n D1.10)" },
714   { TAG_BSS_AVG_ACCESS_DELAY,                 "BSS Average Access Delay" },
715   { TAG_ANTENNA,                              "Antenna" },
716   { TAG_RSNI,                                 "RSNI" },
717   { TAG_MEASURE_PILOT_TRANS,                  "Measurement Pilot Transmission" },
718   { TAG_BSS_AVB_ADM_CAPACITY,                 "BSS Available Admission Capacity" },
719   { TAG_IE_68_CONFLICT,                       "BSS AC Access Delay/WAPI Parameter Set" },
720   { TAG_TIME_ADV,                             "Time Advertisement" },
721   { TAG_RM_ENABLED_CAPABILITY,                "RM Enabled Capabilities" },
722   { TAG_MULTIPLE_BSSID,                       "Multiple BSSID" },
723   { TAG_20_40_BSS_CO_EX,                      "20/40 BSS Coexistence" },
724   { TAG_20_40_BSS_INTOL_CH_REP,               "20/40 BSS Intolerant Channel Report" },   /* IEEE P802.11n/D6.0 */
725   { TAG_OVERLAP_BSS_SCAN_PAR,                 "Overlapping BSS Scan Parameters" },       /* IEEE P802.11n/D6.0 */
726   { TAG_RIC_DESCRIPTOR,                       "RIC Descriptor" },
727   { TAG_MMIE,                                 "Management MIC" },
728   { TAG_EVENT_REQUEST,                        "Event Request" },
729   { TAG_EVENT_REPORT,                         "Event Report" },
730   { TAG_DIAGNOSTIC_REQUEST,                   "Diagnostic Request" },
731   { TAG_DIAGNOSTIC_REPORT,                    "Diagnostic Report" },
732   { TAG_LOCATION_PARAMETERS,                  "Location Parameters" },
733   { TAG_NO_BSSID_CAPABILITY,                  "Non Transmitted BSSID Capability" },
734   { TAG_SSID_LIST,                            "SSID List" },
735   { TAG_MULTIPLE_BSSID_INDEX,                 "Multiple BSSID Index" },
736   { TAG_FMS_DESCRIPTOR,                       "FMS Descriptor" },
737   { TAG_FMS_REQUEST,                          "FMS Request" },
738   { TAG_FMS_RESPONSE,                         "FMS Response" },
739   { TAG_QOS_TRAFFIC_CAPABILITY,               "QoS Traffic Capability" },
740   { TAG_BSS_MAX_IDLE_PERIOD,                  "BSS Max Idle Period" },
741   { TAG_TFS_REQUEST,                          "TFS Request" },
742   { TAG_TFS_RESPONSE,                         "TFS Response" },
743   { TAG_WNM_SLEEP_MODE,                       "WNM-Sleep Mode" },
744   { TAG_TIM_BROADCAST_REQUEST,                "TIM Broadcast Request" },
745   { TAG_TIM_BROADCAST_RESPONSE,               "TIM Broadcast Response" },
746   { TAG_COLLOCATED_INTER_REPORT,              "Collocated Interference Report" },
747   { TAG_CHANNEL_USAGE,                        "Channel Usage" },
748   { TAG_TIME_ZONE,                            "Time Zone" },
749   { TAG_DMS_REQUEST,                          "DMS Request" },
750   { TAG_DMS_RESPONSE,                         "DMS Response" },
751   { TAG_LINK_IDENTIFIER,                      "Link Identifier" },
752   { TAG_WAKEUP_SCHEDULE,                      "Wakeup Schedule" },
753   { TAG_CHANNEL_SWITCH_TIMING,                "Channel Switch Timing" },
754   { TAG_PTI_CONTROL,                          "PTI Control" },
755   { TAG_PU_BUFFER_STATUS,                     "PU Buffer Status" },
756   { TAG_INTERWORKING,                         "Interworking" },
757   { TAG_ADVERTISEMENT_PROTOCOL,               "Advertisement Protocol"},
758   { TAG_EXPIDITED_BANDWIDTH_REQ,              "Expedited Bandwidth Request" },
759   { TAG_QOS_MAP_SET,                          "QoS Map Set" },
760   { TAG_ROAMING_CONSORTIUM,                   "Roaming Consortium" },
761   { TAG_EMERGENCY_ALERT_ID,                   "Emergency Alert Identifier" },
762   { TAG_MESH_CONFIGURATION,                   "Mesh Configuration" },
763   { TAG_MESH_ID,                              "Mesh ID" },
764   { TAG_MESH_LINK_METRIC_REPORT,              "Mesh Link Metric Report" },
765   { TAG_CONGESTION_NOTIFICATION,              "Congestion Notification" },
766   { TAG_MESH_PEERING_MGMT,                    "Mesh Peering Management" },
767   { TAG_MESH_CHANNEL_SWITCH,                  "Mesh Channel Switch Parameters" },
768   { TAG_MESH_AWAKE_WINDOW,                    "Mesh Awake Windows" },
769   { TAG_BEACON_TIMING,                        "Beacon Timing" },
770   { TAG_MCCAOP_SETUP_REQUEST,                 "MCCAOP Setup Request" },
771   { TAG_MCCAOP_SETUP_REPLY,                   "MCCAOP SETUP Reply" },
772   { TAG_MCCAOP_ADVERTISEMENT,                 "MCCAOP Advertisement" },
773   { TAG_MCCAOP_TEARDOWN,                      "MCCAOP Teardown" },
774   { TAG_GANN,                                 "Gate Announcement" },
775   { TAG_RANN,                                 "Root Announcement" },
776   { TAG_EXTENDED_CAPABILITIES,                "Extended Capabilities" },
777   { TAG_AGERE_PROPRIETARY,                    "Agere Proprietary" },
778   { TAG_MESH_PREQ,                            "Path Request" },
779   { TAG_MESH_PREP,                            "Path Reply" },
780   { TAG_MESH_PERR,                            "Path Error" },
781   { TAG_CISCO_CCX1_CKIP,                      "Cisco CCX1 CKIP + Device Name" },
782   { TAG_CISCO_CCX2,                           "Cisco CCX2" },
783   { TAG_PXU,                                  "Proxy Update" },
784   { TAG_PXUC,                                 "Proxy Update Confirmation"},
785   { TAG_AUTH_MESH_PEERING_EXCH,               "Auhenticated Mesh Perring Exchange" },
786   { TAG_MIC,                                  "MIC (Message Integrity Code)" },
787   { TAG_DESTINATION_URI,                      "Destination URI" },
788   { TAG_U_APSD_COEX,                          "U-APSD Coexistence" },
789   { TAG_WAKEUP_SCHEDULE_AD,                   "Wakeup Schedule 802.11ad" },
790   { TAG_EXTENDED_SCHEDULE,                    "Extended Schedule" },
791   { TAG_STA_AVAILABILITY,                     "STA Availability" },
792   { TAG_DMG_TSPEC,                            "DMG TSPEC" },
793   { TAG_NEXT_DMG_ATI,                         "Next DMG ATI" },
794   { TAG_DMG_CAPABILITIES,                     "DMG Capabilities" },
795   { TAG_CISCO_CCX3,                           "Cisco Unknown 95" },
796   { TAG_CISCO_VENDOR_SPECIFIC,                "Vendor Specific" },
797   { TAG_DMG_OPERATION,                        "DMG Operating" },
798   { TAG_DMG_BSS_PRAMTER_CHANGE,               "DMG BSS Parameter Change" },
799   { TAG_DMG_BEAM_REFINEMENT,                  "DMG Beam Refinement" },
800   { TAG_CHANNEL_MEASURMENT_FB,                "Channel Measurement Feedback" },
801   { TAG_AWAKE_WINDOW,                         "Awake Window" },
802   { TAG_MULTI_BAND,                           "Multi Band" },
803   { TAG_ADDBA_EXT,                            "ADDBA Extension" },
804   { TAG_NEXTPCP_LIST,                         "NEXTPCP List" },
805   { TAG_PCP_HANDOVER,                         "PCP Handover" },
806   { TAG_DMG_LINK_MARGIN,                      "DMG Link Margin" },
807   { TAG_SWITCHING_STREAM,                     "Switching Stream" },
808   { TAG_SESSION_TRANSMISSION,                 "Session Transmission" },
809   { TAG_DYN_TONE_PAIR_REP,                    "Dynamic Tone Pairing Report" },
810   { TAG_CLUSTER_REP,                          "Cluster Report" },
811   { TAG_RELAY_CAPABILITIES,                   "Relay Capabilities" },
812   { TAG_RELAY_TRANSFER_PARAM,                 "Relay Transfer Parameter" },
813   { TAG_BEAMLINK_MAINTAINCE,                  "Beamlink Maintenance" },
814   { TAG_MULTIPLE_MAC_SUBLAYERS,               "Multiple MAC Sublayers" },
815   { TAG_U_PID,                                "U-PID" },
816   { TAG_DMG_LINK_ADAPTION_ACK,                "DMG Link Adaption Acknowledgment" },
817   { TAG_SYMBOL_PROPRIETARY,                   "Symbol Proprietary" },
818   { TAG_MCCAOP_ADVERTISEMENT_OV,              "MCCAOP Advertisement Overview" },
819   { TAG_QUIET_PERIOD_REQ,                     "Quiet Period Request" },
820   { TAG_QUIET_PERIOD_RES,                     "Quiet Period Response" },
821   { TAG_ECPAC_POLICY,                         "ECPAC Policy" },
822   { TAG_CLUSTER_TIME_OFFSET,                  "Cluster Time Offset" },
823   { TAG_ANTENNA_SECTOR_ID,                    "Antenna Sector ID" },
824   { TAG_VHT_CAPABILITY,                       "VHT Capabilities (IEEE Std 802.11ac/D3.1)" },
825   { TAG_VHT_OPERATION,                        "VHT Operation (IEEE Std 802.11ac/D3.1)" },
826   { TAG_EXT_BSS_LOAD,                         "Extended BSS Load" },
827   { TAG_WIDE_BW_CHANNEL_SWITCH,               "Wide Bandwidth Channel Switch" },
828   { TAG_VHT_TX_PWR_ENVELOPE,                  "VHT Tx Power Envelope (IEEE Std 802.11ac/D5.0)" },
829   { TAG_CHANNEL_SWITCH_WRAPPER,               "Channel Switch Wrapper" },
830   { TAG_OPERATING_MODE_NOTIFICATION,          "Operating Mode Notification" },
831   { TAG_VENDOR_SPECIFIC_IE,                   "Vendor Specific" },
832   { 0, NULL }
833 };
834 static value_string_ext tag_num_vals_ext = VALUE_STRING_EXT_INIT(tag_num_vals);
835
836 /* WFA vendor specific subtypes */
837 #define WFA_SUBTYPE_P2P 9
838 #define WFA_SUBTYPE_WIFI_DISPLAY 10
839 #define WFA_SUBTYPE_HS20_INDICATION 16
840 #define WFA_SUBTYPE_HS20_ANQP 17
841
842 static const value_string wfa_subtype_vals[] = {
843   { WFA_SUBTYPE_P2P, "P2P" },
844   { WFA_SUBTYPE_HS20_INDICATION, "Hotspot 2.0 Indication" },
845   { WFA_SUBTYPE_HS20_ANQP, "Hotspot 2.0 ANQP" },
846   { 0, NULL }
847 };
848
849 /* ************************************************************************* */
850 /*              Supported Rates (7.3.2.2)                                    */
851 /* ************************************************************************* */
852
853 static const value_string ieee80211_supported_rates_vals[] = {
854   { 0x02, "1" },
855   { 0x03, "1.5" },
856   { 0x04, "2" },
857   { 0x05, "2.5" },
858   { 0x06, "3" },
859   { 0x09, "4.5" },
860   { 0x0B, "5.5" },
861   { 0x0C, "6" },
862   { 0x12, "9" },
863   { 0x16, "11" },
864   { 0x18, "12" },
865   { 0x1B, "13.5" },
866   { 0x24, "18" },
867   { 0x2C, "22" },
868   { 0x30, "24" },
869   { 0x36, "27" },
870   { 0x42, "33" },
871   { 0x48, "36" },
872   { 0x60, "48" },
873   { 0x6C, "54" },
874   { 0x82, "1(B)" },
875   { 0x83, "1.5(B)" },
876   { 0x84, "2(B)" },
877   { 0x85, "2.5(B)" },
878   { 0x86, "3(B)" },
879   { 0x89, "4.5(B)" },
880   { 0x8B, "5.5(B)" },
881   { 0x8C, "6(B)" },
882   { 0x92, "9(B)" },
883   { 0x96, "11(B)" },
884   { 0x98, "12(B)" },
885   { 0x9B, "13.5(B)" },
886   { 0xA4, "18(B)" },
887   { 0xAC, "22(B)" },
888   { 0xB0, "24(B)" },
889   { 0xB6, "27(B)" },
890   { 0xC2, "33(B)" },
891   { 0xC8, "36(B)" },
892   { 0xE0, "48(B)" },
893   { 0xEC, "54(B)" },
894   { 0xFF, "BSS requires support for mandatory features of HT PHY (IEEE 802.11 - Clause 20)" },
895   { 0,    NULL}
896 };
897 value_string_ext ieee80211_supported_rates_vals_ext = VALUE_STRING_EXT_INIT(ieee80211_supported_rates_vals);
898
899 /* ************************************************************************* */
900 /*                         8.4.1.7 Reason Code field                         */
901 /* ************************************************************************* */
902 static const value_string ieee80211_reason_code[] = {
903   {  1, "Unspecified reason" },
904   {  2, "Previous authentication no longer valid" },
905   {  3, "Deauthenticated because sending STA is leaving (or has left) IBSS or ESS" },
906   {  4, "Disassociated due to inactivity" },
907   {  5, "Disassociated because AP is unable to handle all currently associated STAs" },
908   {  6, "Class 2 frame received from nonauthenticated STA" },
909   {  7, "Class 3 frame received from nonassociated STA" },
910   {  8, "Disassociated because sending STA is leaving (or has left) BSS" },
911   {  9, "STA requesting (re)association is not authenticated with responding STA" },
912   { 10, "Disassociated because the information in the Power Capability element is unacceptable" },
913   { 11, "Disassociated because the information in the Supported Channels element is unacceptable" },
914   { 12, "Reserved" },
915   { 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" },
916   { 14, "Message integrity code (MIC) failure" },
917   { 15, "4-Way Handshake timeout" },
918   { 16, "Group Key Handshake timeout" },
919   { 17, "Information element in 4-Way Handshake different from (Re)Association Request/Probe Response/Beacon frame" },
920   { 18, "Invalid group cipher" },
921   { 19, "Invalid pairwise cipher" },
922   { 20, "Invalid AKMP" },
923   { 21, "Unsupported RSN information element version" },
924   { 22, "Invalid RSN information element capabilities" },
925   { 23, "IEEE 802.1X authentication failed" },
926   { 24, "Cipher suite rejected because of the security policy" },
927   { 25, "TDLS direct-link teardown due to TDLS peer STA unreachable via the TDLS direct link" },
928   { 26, "TDLS direct-link teardown for unspecified reason" },
929   { 27, "Disassociated because session terminated by SSP request" },
930   { 28, "Disassociated because of lack of SSP roaming agreement" },
931   { 29, "Requested service rejected because of SSP cipher suite or AKM requirement " },
932   { 30, "Requested service not authorized in this location" },
933   { 31, "TS deleted because QoS AP lacks sufficient bandwidth for this QoS STA due to a change in BSS service characteristics or operational mode" },
934   { 32, "Disassociated for unspecified, QoS-related reason" },
935   { 33, "Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA" },
936   { 34, "Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions" },
937   { 35, "Disassociated because STA is transmitting outside the limits of its TXOPs" },
938   { 36, "Requested from peer STA as the STA is leaving the BSS (or resetting)" },
939   { 37, "Requested from peer STA as it does not want to use the mechanism" },
940   { 38, "Requested from peer STA as the STA received frames using the mechanism for which a setup is required" },
941   { 39, "Requested from peer STA due to timeout" },
942   { 45, "Peer STA does not support the requested cipher suite" },
943   { 46, "Disassociated because authorized access limit reached" },
944   { 47, "Disassociated due to external service requirements" },
945   { 48, "Invalid FT Action frame count" },
946   { 49, "Invalid pairwise master key identifier (PMKI)" },
947   { 50, "Invalid MDE" },
948   { 51, "Invalid FTE" },
949   { 52, "SME cancels the mesh peering instance with the reason other than reaching the maximum number of peer mesh STAs" },
950   { 53, "The mesh STA has reached the supported maximum number of peer mesh STAs" },
951   { 54, "The received information violates the Mesh Configuration policy configured in the mesh STA profile" },
952   { 55, "The mesh STA has received a Mesh Peering Close message requesting to close the mesh peering" },
953   { 56, "The mesh STA has re-sent dot11MeshMaxRetries Mesh Peering Open messages, without receiving a Mesh Peering Confirm message" },
954   { 57, "The confirmTimer for the mesh peering instance times out" },
955   { 58, "The mesh STA fails to unwrap the GTK or the values in the wrapped contents do not match" },
956   { 59, "The mesh STA receives inconsistent information about the mesh parameters between Mesh Peering Management frames" },
957   { 60, "The mesh STA fails the authenticated mesh peering exchange because due to failure in selecting either the pairwise ciphersuite or group ciphersuite" },
958   { 61, "The mesh STA does not have proxy information for this external destination" },
959   { 62, "The mesh STA does not have forwarding information for this destination" },
960   { 63, "The mesh STA determines that the link to the next hop of an active path in its forwarding information is no longer usable" },
961   { 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)" },
962   { 65, "The mesh STA performs channel switch to meet regulatory requirements" },
963   { 66, "The mesh STA performs channel switch with unspecified reason" },
964   { 0,    NULL}
965 };
966 static value_string_ext ieee80211_reason_code_ext = VALUE_STRING_EXT_INIT(ieee80211_reason_code);
967
968 /* ************************************************************************* */
969 /*                         8.4.1.9 Status Code field                         */
970 /* ************************************************************************* */
971 static const value_string ieee80211_status_code[] = {
972   {  0, "Successful" },
973   {  1, "Unspecified failure" },
974   {  2, "TDLS wakeup schedule rejected but alternative schedule provided" },
975   {  3, "TDLS wakeup schedule rejected" },
976   {  4, "Reserved" },
977   {  5, "Security disabled" },
978   {  6, "Unacceptable lifetime" },
979   {  7, "Not in same BSS" },
980   {  8, "Reserved" },
981   {  9, "Reserved" },
982   { 10, "Cannot support all requested capabilities in the Capability Information field" },
983   { 11, "Reassociation denied due to inability to confirm that association exists" },
984   { 12, "Association denied due to reason outside the scope of this standard" },
985   { 13, "Responding STA does not support the specified authentication algorithm" },
986   { 14, "Received an Authentication frame with authentication transaction sequence number out of expected sequence" },
987   { 15, "Authentication rejected because of challenge failure" },
988   { 16, "Authentication rejected due to timeout waiting for next frame in sequence" },
989   { 17, "Association denied because AP is unable to handle additional associated STAs" },
990   { 18, "Association denied due to requesting STA not supporting all of the data rates in the BSSBasicRateSet parameter" },
991   { 19, "Association denied due to requesting STA not supporting the short preamble option" },
992   { 20, "Association denied due to requesting STA not supporting the PBCC modulation option" },
993   { 21, "Association denied due to requesting STA not supporting the Channel Agility option" },
994   { 22, "Association request rejected because Spectrum Management capability is required" },
995   { 23, "Association request rejected because the information in the Power Capability element is unacceptable" },
996   { 24, "Association request rejected because the information in the Supported Channels element is unacceptable" },
997   { 25, "Association denied due to requesting STA not supporting the Short Slot Time option" },
998   { 26, "Association denied due to requesting STA not supporting the DSSS-OFDM option" },
999   { 27, "Reserved Association denied because the requesting STA does not support HT features" },
1000   { 28, "R0KH unreachable" },
1001   { 29, "Association denied because the requesting STA does not support the phased coexistence operation (PCO) transition time required by the AP" },
1002   { 30, "Association request rejected temporarily; try again later" },
1003   { 31, "Robust Management frame policy violation" },
1004   { 32, "Unspecified, QoS-related failure" },
1005   { 33, "Association denied because QoS AP or PCP has insufficient bandwidth to handle another QoS STA" },
1006   { 34, "Association denied due to excessive frame loss rates and/or poor conditions on current operating channel" },
1007   { 35, "Association (with QoS BSS) denied because the requesting STA does not support the QoS facility" },
1008   { 36, "Reserved" },
1009   { 37, "The request has been declined" },
1010   { 38, "The request has not been successful as one or more parameters have invalid values" },
1011   { 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" },
1012   { 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" },
1013   { 41, "Invalid group cipher" },
1014   { 42, "Invalid pairwise cipher" },
1015   { 43, "Invalid AKMP" },
1016   { 44, "Unsupported RSN information element version" },
1017   { 45, "Invalid RSN information element capabilities" },
1018   { 46, "Cipher suite rejected because of security policy" },
1019   { 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" },
1020   { 48, "Direct link is not allowed in the BSS by policy" },
1021   { 49, "The Destination STA is not present within this BSS" },
1022   { 50, "The Destination STA is not a QoS STA" },
1023   { 51, "Association denied because the ListenInterval is too large" },
1024   { 52, "Invalid FT Action frame count" },
1025   { 53, "Invalid pairwise master key identifier (PMKID)" },
1026   { 54, "Invalid MDIE" },
1027   { 55, "Invalid FTIE" },
1028   { 56, "Requested TCLAS processing is not supported by the PCP/AP" },
1029   { 57, "The PCP/AP has insufficient TCLAS processing resources to satisfy the request" },
1030   { 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" },
1031   { 59, "GAS Advertisement Protocol not supported" },
1032   { 60, "No outstanding GAS request" },
1033   { 61, "GAS Response not received from the Advertisement Server" },
1034   { 62, "STA timed out waiting for GAS Query Response" },
1035   { 63, "GAS Response is larger than query response length limit" },
1036   { 64, "Request refused because home network does not support request" },
1037   { 65, "Advertisement Server in the network is not currently reachable" },
1038   { 66, "Reserved" },
1039   { 67, "Request refused due to permissions received via SSPN interface" },
1040   { 68, "Request refused because PCP/AP does not support unauthenticated access" },
1041   { 69, "Reserved" },
1042   { 70, "Reserved" },
1043   { 71, "Reserved" },
1044   { 72, "Invalid contents of RSNIE" },
1045   { 73, "U-APSD Coexistence is not supported" },
1046   { 74, "Requested U-APSD Coexistence mode is not supported" },
1047   { 75, "Requested Interval/Duration value cannot be supported with U-APSD Coexistence" },
1048   { 76, "Authentication is rejected because an Anti-Clogging Token is required" },
1049   { 77, "Authentication is rejected because the offered finite cyclic group is not supported" },
1050   { 78, "The TBTT adjustment request has not been successful because the STA could not find an alternative TBTT" },
1051   { 79, "Transmission failure" },
1052   { 80, "Requested TCLAS Not Supported" },
1053   { 81, "TCLAS Resources Exhausted" },
1054   { 82, "Rejected with Suggested BSS Transition" },
1055   { 83, "Reject with recommended schedule" },
1056   { 84, "Reject because no wakeup schedule specified" },
1057   { 85, "Success, the destination STA is in power save mode" },
1058   { 86, "FST pending, in process of admitting FST session" },
1059   { 87, "performing FST now" },
1060   { 88, "FST pending, gap(s) in Block Ack window" },
1061   { 89, "Reject because of U-PID setting" },
1062   { 92, "(Re)association refused for some external reason" },
1063   { 93, "(Re)association refused because of memory limits at the AP" },
1064   { 94, "(Re)association refused because emergency services are not supported at the AP" },
1065   { 95, "GAS query response not yet received" },
1066   { 96, "Reject since the request is for transition to a frequency band subject to DSE procedures and FST initiator is a dependent STA" },
1067   { 97, "Reserved" },
1068   { 98, "Reserved" },
1069   { 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" },
1070   { 100, "The request failed due to a reservation conflict" },
1071   { 101, "The request failed due to exceeded MAF limit" },
1072   { 102, "The request failed due to exceeded MCCA track limit" },
1073   { 103, "Association denied because the information in the Spectrum Management field is unacceptable" },
1074   { 0,    NULL}
1075 };
1076 static value_string_ext ieee80211_status_code_ext = VALUE_STRING_EXT_INIT(ieee80211_status_code);
1077
1078 /* ************************************************************************* */
1079 /*                         Frame types, and their names                      */
1080 /* ************************************************************************* */
1081 static const value_string frame_type_subtype_vals[] = {
1082   {MGT_ASSOC_REQ,             "Association Request"},
1083   {MGT_ASSOC_RESP,            "Association Response"},
1084   {MGT_REASSOC_REQ,           "Reassociation Request"},
1085   {MGT_REASSOC_RESP,          "Reassociation Response"},
1086   {MGT_PROBE_REQ,             "Probe Request"},
1087   {MGT_PROBE_RESP,            "Probe Response"},
1088   {MGT_MEASUREMENT_PILOT,     "Measurement Pilot"},
1089   {MGT_BEACON,                "Beacon frame"},
1090   {MGT_ATIM,                  "ATIM"},
1091   {MGT_DISASS,                "Disassociate"},
1092   {MGT_AUTHENTICATION,        "Authentication"},
1093   {MGT_DEAUTHENTICATION,      "Deauthentication"},
1094   {MGT_ACTION,                "Action"},
1095   {MGT_ACTION_NO_ACK,         "Action No Ack"},
1096   {MGT_ARUBA_WLAN,            "Aruba Management"},
1097
1098   {CTRL_BEAMFORM_RPT_POLL,    "Beamforming Report Poll"},
1099   {CTRL_VHT_NDP_ANNC,         "VHT NDP Announcement"},
1100   {CTRL_CONTROL_WRAPPER,      "Control Wrapper"},
1101   {CTRL_BLOCK_ACK_REQ,        "802.11 Block Ack Req"},
1102   {CTRL_BLOCK_ACK,            "802.11 Block Ack"},
1103   {CTRL_PS_POLL,              "Power-Save poll"},
1104   {CTRL_RTS,                  "Request-to-send"},
1105   {CTRL_CTS,                  "Clear-to-send"},
1106   {CTRL_ACKNOWLEDGEMENT,      "Acknowledgement"},
1107   {CTRL_CFP_END,              "CF-End (Control-frame)"},
1108   {CTRL_CFP_ENDACK,           "CF-End + CF-Ack (Control-frame)"},
1109
1110   {DATA,                      "Data"},
1111   {DATA_CF_ACK,               "Data + CF-Ack"},
1112   {DATA_CF_POLL,              "Data + CF-Poll"},
1113   {DATA_CF_ACK_POLL,          "Data + CF-Ack + CF-Poll"},
1114   {DATA_NULL_FUNCTION,        "Null function (No data)"},
1115   {DATA_CF_ACK_NOD,           "Acknowledgement (No data)"},
1116   {DATA_CF_POLL_NOD,          "CF-Poll (No data)"},
1117   {DATA_CF_ACK_POLL_NOD,      "CF-Ack/Poll (No data)"},
1118   {DATA_QOS_DATA,             "QoS Data"},
1119   {DATA_QOS_DATA_CF_ACK,      "QoS Data + CF-Acknowledgment"},
1120   {DATA_QOS_DATA_CF_POLL,     "QoS Data + CF-Poll"},
1121   {DATA_QOS_DATA_CF_ACK_POLL, "QoS Data + CF-Ack + CF-Poll"},
1122   {DATA_QOS_NULL,             "QoS Null function (No data)"},
1123   {DATA_QOS_CF_POLL_NOD,      "QoS CF-Poll (No Data)"},
1124   {DATA_QOS_CF_ACK_POLL_NOD,  "QoS CF-Ack + CF-Poll (No data)"},
1125
1126   {EXTENSION_DMG_BEACON,      "DMG Beacon"},
1127
1128   {CTRL_POLL,                 "Poll"},
1129   {CTRL_SPR,                  "Service Period Request"},
1130   {CTRL_GRANT,                "Grant"},
1131   {CTRL_DMG_CTS,              "DMG Clear-to-send"},
1132   {CTRL_DMG_DTS,              "DMG Denial-to-send"},
1133   {CTRL_GRANT_ACK,            "Grant Acknowledgment"},
1134   {CTRL_SSW,                  "Sector Sweep"},
1135   {CTRL_SSW_FEEDBACK,         "Sector Sweep Feedback"},
1136   {CTRL_SSW_ACK,              "Sector Sweep Acknoledgment"},
1137
1138   {0,                         NULL}
1139 };
1140 static value_string_ext frame_type_subtype_vals_ext = VALUE_STRING_EXT_INIT(frame_type_subtype_vals);
1141
1142 /* ************************************************************************* */
1143 /*                 802.1D Tag Name (by WME Access Category Names)            */
1144 /* ************************************************************************* */
1145 static const value_string ieee80211_qos_tags_acs[] = {
1146   { 0, "Best Effort (Best Effort)" },
1147   { 1, "Background (Background)" },
1148   { 2, "Spare (Background)" },
1149   { 3, "Excellent Effort (Best Effort)" },
1150   { 4, "Controlled Load (Video)" },
1151   { 5, "Video (Video)" },
1152   { 6, "Voice (Voice)" },
1153   { 7, "Network Control (Voice)" },
1154   { 0, NULL }
1155 };
1156
1157 /* ************************************************************************* */
1158 /*                   WME Access Category Names (by WME ACI)                  */
1159 /* ************************************************************************* */
1160 static const value_string wme_acs[] = {
1161   { 0, "Best Effort" },
1162   { 1, "Background" },
1163   { 2, "Video" },
1164   { 3, "Voice" },
1165   { 0, NULL }
1166 };
1167
1168 /* ************************************************************************* */
1169 /*                  Aruba Management Type                                    */
1170 /* ************************************************************************* */
1171 static const value_string aruba_mgt_typevals[] = {
1172   { 0x0001,       "Hello" },
1173   { 0x0002,       "Probe" },
1174   { 0x0003,       "MTU" },
1175   { 0x0004,       "Ageout" },
1176   { 0x0005,       "Heartbeat" },
1177   { 0x0006,       "Deauth" },
1178   { 0x0007,       "Disassoc" },
1179   { 0x0008,       "Probe response" },
1180   { 0x0009,       "Tunnel update" },
1181   { 0x000A,       "Laser beam active" },
1182   { 0x000B,       "Client IP" },
1183   { 0x000C,       "Laser beam active v2" },
1184   { 0x000D,       "AP statistics" },
1185   { 0,            NULL }
1186 };
1187 static value_string_ext aruba_mgt_typevals_ext = VALUE_STRING_EXT_INIT(aruba_mgt_typevals);
1188
1189 /*** Begin: Action Fixed Parameter ***/
1190 #define CAT_SPECTRUM_MGMT          0
1191 #define CAT_QOS                    1
1192 #define CAT_DLS                    2
1193 #define CAT_BLOCK_ACK              3
1194 #define CAT_PUBLIC                 4
1195 #define CAT_RADIO_MEASUREMENT      5
1196 #define CAT_FAST_BSS_TRANSITION    6
1197 #define CAT_HT                     7
1198 #define CAT_SA_QUERY               8
1199 #define CAT_PUBLIC_PROTECTED       9
1200 #define CAT_WNM                   10
1201 #define CAT_UNPROTECTED_WNM       11
1202 #define CAT_TDLS                  12
1203 #define CAT_MESH                  13
1204 #define CAT_MULTIHOP              14
1205 #define CAT_SELF_PROTECTED        15
1206 #define CAT_DMG                   16
1207 #define CAT_MGMT_NOTIFICATION     17
1208 #define CAT_FAST_SESSION_TRANSFER 18
1209 #define CAT_ROBUST_AV_STREAMING   19
1210 #define CAT_UNPROTECTED_DMG       20
1211 #define CAT_VHT                   21
1212 #define CAT_VENDOR_SPECIFIC_PROTECTED 126
1213 #define CAT_VENDOR_SPECIFIC     127
1214
1215 #define CAT_MESH_LINK_METRIC               31
1216 #define CAT_MESH_PATH_SELECTION            32
1217 #define CAT_MESH_INTERWORKING              33
1218 #define CAT_MESH_RESOURCE_COORDINATION     34
1219 #define CAT_MESH_SECURITY_ARCHITECTURE     35
1220
1221 #define SM_ACTION_MEASUREMENT_REQUEST   0
1222 #define SM_ACTION_MEASUREMENT_REPORT    1
1223 #define SM_ACTION_TPC_REQUEST           2
1224 #define SM_ACTION_TPC_REPORT            3
1225 #define SM_ACTION_CHAN_SWITCH_ANNC      4
1226 #define SM_ACTION_EXT_CHAN_SWITCH_ANNC  5
1227
1228 #define QOS_ACTION_ADDTS_REQUEST     0
1229 #define QOS_ACTION_ADDTS_RESPONSE    1
1230 #define QOS_ACTION_DELTS             2
1231 #define QOS_ACTION_SCHEDULE      3
1232 #define QOS_ACTION_MAP_CONFIGURE 4
1233
1234 #define DLS_ACTION_REQUEST       0
1235 #define DLS_ACTION_RESPONSE      1
1236 #define DLS_ACTION_TEARDOWN      2
1237
1238 #define BA_ADD_BLOCK_ACK_REQUEST    0
1239 #define BA_ADD_BLOCK_ACK_RESPONSE   1
1240 #define BA_DELETE_BLOCK_ACK         2
1241
1242 /* Keep in sync with PPA_* defines */
1243 #define PA_20_40_BSS_COEXISTENCE_MANAGEMENT 0
1244 #define PA_DSE_ENABLEMENT                   1
1245 #define PA_DSE_DEENABLEMENT                 2
1246 #define PA_DSE_REG_LOC_ANNOUNCEMENT         3
1247 #define PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT  4
1248 #define PA_DSE_MEASUREMENT_REQUEST          5
1249 #define PA_DSE_MEASUREMENT_REPORT           6
1250 #define PA_MEASUREMENT_PILOT                7
1251 #define PA_DSE_POWER_CONSTRAINT             8
1252 #define PA_VENDOR_SPECIFIC                  9
1253 #define PA_GAS_INITIAL_REQUEST             10
1254 #define PA_GAS_INITIAL_RESPONSE            11
1255 #define PA_GAS_COMEBACK_REQUEST            12
1256 #define PA_GAS_COMEBACK_RESPONSE           13
1257 #define PA_TDLS_DISCOVERY_RESPONSE         14
1258 #define PA_LOCATION_TRACK_NOTIFICATION     15
1259 #define PA_QAB_REQUEST                     16
1260 #define PA_QAB_RESPONSE                    17
1261
1262 /* Keep in sync with PA_* defines */
1263 #define PPA_DSE_ENABLEMENT                   1
1264 #define PPA_DSE_DEENABLEMENT                 2
1265 #define PPA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT  4
1266 #define PPA_DSE_MEASUREMENT_REQUEST          5
1267 #define PPA_DSE_MEASUREMENT_REPORT           6
1268 #define PPA_DSE_POWER_CONSTRAINT             8
1269 #define PPA_VENDOR_SPECIFIC                  9
1270 #define PPA_GAS_INITIAL_REQUEST             10
1271 #define PPA_GAS_INITIAL_RESPONSE            11
1272 #define PPA_GAS_COMEBACK_REQUEST            12
1273 #define PPA_GAS_COMEBACK_RESPONSE           13
1274 #define PPA_QAB_REQUEST                     16
1275 #define PPA_QAB_RESPONSE                    17
1276
1277 #define HT_ACTION_NOTIFY_CHAN_WIDTH           0
1278 #define HT_ACTION_SM_PWR_SAVE                 1
1279 #define HT_ACTION_PSMP_ACTION                 2
1280 #define HT_ACTION_SET_PCO_PHASE               3
1281 #define HT_ACTION_MIMO_CSI                    4
1282 #define HT_ACTION_MIMO_BEAMFORMING            5
1283 #define HT_ACTION_MIMO_COMPRESSED_BEAMFORMING 6
1284 #define HT_ACTION_ANT_SEL_FEEDBACK            7
1285 #define HT_ACTION_HT_INFO_EXCHANGE            8
1286
1287 #define DMG_ACTION_PWR_SAVE_CONFIG_REQ           0
1288 #define DMG_ACTION_PWR_SAVE_CONFIG_RES           1
1289 #define DMG_ACTION_INFO_REQ                      2
1290 #define DMG_ACTION_INFO_RES                      3
1291 #define DMG_ACTION_HANDOVER_REQ                  4
1292 #define DMG_ACTION_HANDOVER_RES                  5
1293 #define DMG_ACTION_DTP_REQ                       6
1294 #define DMG_ACTION_DTP_RES                       7
1295 #define DMG_ACTION_RELAY_SEARCH_REQ              8
1296 #define DMG_ACTION_RELAY_SEARCH_RES              9
1297 #define DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ 10
1298 #define DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES 11
1299 #define DMG_ACTION_RLS_REQ                       12
1300 #define DMG_ACTION_RLS_RES                       13
1301 #define DMG_ACTION_RLS_ANNOUNCE                  14
1302 #define DMG_ACTION_RLS_TEARDOWN                  15
1303 #define DMG_ACTION_RELAY_ACK_REQ                 16
1304 #define DMG_ACTION_RELAY_ACK_RES                 17
1305 #define DMG_ACTION_TPA_REQ                       18
1306 #define DMG_ACTION_TPA_RES                       19
1307 #define DMG_ACTION_TPA_REP                       20
1308 #define DMG_ACTION_ROC_REQ                       21
1309 #define DMG_ACTION_ROC_RES                       22
1310
1311 #define UNPROTECTED_DMG_ANNOUNCE                 0
1312 #define UNPROTECTED_DMG_BRP                      1
1313
1314 #define FST_SETUP_REQUEST                        0
1315 #define FST_SETUP_RESPONSE                       1
1316 #define FST_TEAR_DOWN                            2
1317 #define FST_ACK_REQUEST                          3
1318 #define FST_ACK_RESPONSE                         4
1319 #define FST_ON_CHANNEL_TUNNEL_REQUEST            5
1320
1321 /* IEEE Std 802.11r-2008, 7.4.8, Table 7-57g */
1322 #define FT_ACTION_REQUEST               1
1323 #define FT_ACTION_RESPONSE              2
1324 #define FT_ACTION_CONFIRM               3
1325 #define FT_ACTION_ACK                   4
1326
1327 /* SA Query Action frame codes (IEEE 802.11w-2009, 7.4.9) */
1328 #define SA_QUERY_REQUEST                0
1329 #define SA_QUERY_RESPONSE               1
1330
1331 /* IEEE Std 802.11z-2010, 7.4.11, Table 7-57v1 */
1332 #define TDLS_SETUP_REQUEST              0
1333 #define TDLS_SETUP_RESPONSE             1
1334 #define TDLS_SETUP_CONFIRM              2
1335 #define TDLS_TEARDOWN                   3
1336 #define TDLS_PEER_TRAFFIC_INDICATION    4
1337 #define TDLS_CHANNEL_SWITCH_REQUEST     5
1338 #define TDLS_CHANNEL_SWITCH_RESPONSE    6
1339 #define TDLS_PEER_PSM_REQUEST           7
1340 #define TDLS_PEER_PSM_RESPONSE          8
1341 #define TDLS_PEER_TRAFFIC_RESPONSE      9
1342 #define TDLS_DISCOVERY_REQUEST          10
1343
1344 /* IEEE Std 802.11-2012, 8.5.7.1, Table 8-206 */
1345 #define RM_ACTION_RADIO_MEASUREMENT_REQUEST         0
1346 #define RM_ACTION_RADIO_MEASUREMENT_REPORT          1
1347 #define RM_ACTION_LINK_MEASUREMENT_REQUEST          2
1348 #define RM_ACTION_LINK_MEASUREMENT_REPORT           3
1349 #define RM_ACTION_NEIGHBOR_REPORT_REQUEST           4
1350 #define RM_ACTION_NEIGHBOR_REPORT_RESPONSE          5
1351
1352 /* 11s draft 12.0, table 7-57v30 */
1353 #define MESH_ACTION_LINK_METRIC_REPORT              0
1354 #define MESH_ACTION_HWMP                            1
1355 #define MESH_ACTION_GATE_ANNOUNCE                   2
1356 #define MESH_ACTION_CONGESTION_CTL                  3
1357 #define MESH_ACTION_MCCA_SETUP_REQUEST              4
1358 #define MESH_ACTION_MCCA_SETUP_REPLY                5
1359 #define MESH_ACTION_MCCA_ADV_REQUEST                6
1360 #define MESH_ACTION_MCCA_ADV                        7
1361 #define MESH_ACTION_MCCA_TEARDOWN                   8
1362 #define MESH_ACTION_TBTT_ADJ_REQUEST                9
1363 #define MESH_ACTION_TBTT_ADJ_RESPONSE              10
1364
1365 /* 11s draft 12.0, table 7-57v42: Multihop Action field values */
1366 #define MULTIHOP_ACTION_PROXY_UPDATE                0
1367 #define MULTIHOP_ACTION_PROXY_UPDATE_CONF           1
1368
1369 /* 11s draft 12.0, table 7-57v24: Self-protected Action field values */
1370 #define SELFPROT_ACTION_MESH_PEERING_OPEN           1
1371 #define SELFPROT_ACTION_MESH_PEERING_CONFIRM        2
1372 #define SELFPROT_ACTION_MESH_PEERING_CLOSE          3
1373 #define SELFPROT_ACTION_MESH_GROUP_KEY_INFORM       4
1374 #define SELFPROT_ACTION_MESH_GROUP_KEY_ACK          5
1375
1376 /* 11s draft 12.0, table 7-43bj6: Mesh Peering Protocol Identifier field values */
1377 #define MESH_PEERING_PROTO_MGMT                     0
1378 #define MESH_PEERING_PROTO_AMPE                     1
1379 #define MESH_PEERING_PROTO_VENDOR                 255
1380
1381 /* Vendor actions */
1382 /* MARVELL */
1383 #define MRVL_ACTION_MESH_MANAGEMENT     1
1384
1385 #define MRVL_MESH_MGMT_ACTION_RREQ      0
1386 #define MRVL_MESH_MGMT_ACTION_RREP      1
1387 #define MRVL_MESH_MGMT_ACTION_RERR      2
1388 #define MRVL_MESH_MGMT_ACTION_PLDM      3
1389
1390 #define ANQP_INFO_ANQP_QUERY_LIST 256
1391 #define ANQP_INFO_ANQP_CAPAB_LIST 257
1392 #define ANQP_INFO_VENUE_NAME_INFO 258
1393 #define ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO 259
1394 #define ANQP_INFO_NETWORK_AUTH_TYPE_INFO 260
1395 #define ANQP_INFO_ROAMING_CONSORTIUM_LIST 261
1396 #define ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO 262
1397 #define ANQP_INFO_NAI_REALM_LIST 263
1398 #define ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO 264
1399 #define ANQP_INFO_AP_GEOSPATIAL_LOCATION 265
1400 #define ANQP_INFO_AP_CIVIC_LOCATION 266
1401 #define ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI 267
1402 #define ANQP_INFO_DOMAIN_NAME_LIST 268
1403 #define ANQP_INFO_EMERGENCY_ALERT_ID_URI 269
1404 #define ANQP_INFO_TDLS_CAPAB_INFO 270
1405 #define ANQP_INFO_EMERGENCY_NAI 271
1406 #define ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST 56797
1407
1408 /* ANQP information ID - IEEE Std 802.11u-2011 - Table 7-43bk */
1409 static const value_string anqp_info_id_vals[] = {
1410   {ANQP_INFO_ANQP_QUERY_LIST, "ANQP Query list"},
1411   {ANQP_INFO_ANQP_CAPAB_LIST, "ANQP Capability list"},
1412   {ANQP_INFO_VENUE_NAME_INFO, "Venue Name information"},
1413   {ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO, "Emergency Call Number information"},
1414   {ANQP_INFO_NETWORK_AUTH_TYPE_INFO,
1415    "Network Authentication Type information"},
1416   {ANQP_INFO_ROAMING_CONSORTIUM_LIST, "Roaming Consortium list"},
1417   {ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO,
1418    "IP Address Type Availability information"},
1419   {ANQP_INFO_NAI_REALM_LIST, "NAI Realm list"},
1420   {ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO, "3GPP Cellular Network information"},
1421   {ANQP_INFO_AP_GEOSPATIAL_LOCATION, "AP Geospatial Location"},
1422   {ANQP_INFO_AP_CIVIC_LOCATION, "AP Civic Location"},
1423   {ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI, "AP Location Public Identifier URI"},
1424   {ANQP_INFO_DOMAIN_NAME_LIST, "Domain Name list"},
1425   {ANQP_INFO_EMERGENCY_ALERT_ID_URI, "Emergency Alert Identifier URI"},
1426   {ANQP_INFO_TDLS_CAPAB_INFO, "TDLS Capability information"},
1427   {ANQP_INFO_EMERGENCY_NAI, "Emergency NAI"},
1428   {ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST, "ANQP vendor-specific list"},
1429   {0, NULL}
1430 };
1431 static value_string_ext anqp_info_id_vals_ext = VALUE_STRING_EXT_INIT(anqp_info_id_vals);
1432
1433 /* IEEE 802.11v - WNM Action field values */
1434 enum wnm_action {
1435   WNM_EVENT_REQ = 0,
1436   WNM_EVENT_REPORT = 1,
1437   WNM_DIAGNOSTIC_REQ = 2,
1438   WNM_DIAGNOSTIC_REPORT = 3,
1439   WNM_LOCATION_CFG_REQ = 4,
1440   WNM_LOCATION_CFG_RESP = 5,
1441   WNM_BSS_TRANS_MGMT_QUERY = 6,
1442   WNM_BSS_TRANS_MGMT_REQ = 7,
1443   WNM_BSS_TRANS_MGMT_RESP = 8,
1444   WNM_FMS_REQ = 9,
1445   WNM_FMS_RESP = 10,
1446   WNM_COLLOCATED_INTERFERENCE_REQ = 11,
1447   WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
1448   WNM_TFS_REQ = 13,
1449   WNM_TFS_RESP = 14,
1450   WNM_TFS_NOTIFY = 15,
1451   WNM_SLEEP_MODE_REQ = 16,
1452   WNM_SLEEP_MODE_RESP = 17,
1453   WNM_TIM_BROADCAST_REQ = 18,
1454   WNM_TIM_BROADCAST_RESP = 19,
1455   WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
1456   WNM_CHANNEL_USAGE_REQ = 21,
1457   WNM_CHANNEL_USAGE_RESP = 22,
1458   WNM_DMS_REQ = 23,
1459   WNM_DMS_RESP = 24,
1460   WNM_TIMING_MEASUREMENT_REQ = 25,
1461   WNM_NOTIFICATION_REQ = 26,
1462   WNM_NOTIFICATION_RESP = 27
1463 };
1464
1465 static const value_string wnm_action_codes[] = {
1466   { WNM_EVENT_REQ, "Event Request" },
1467   { WNM_EVENT_REPORT, "Event Report" },
1468   { WNM_DIAGNOSTIC_REQ, "Diagnostic Request" },
1469   { WNM_DIAGNOSTIC_REPORT, "Diagnostic Report" },
1470   { WNM_LOCATION_CFG_REQ, "Location Configuration Request" },
1471   { WNM_LOCATION_CFG_RESP, "Location Configuration Response" },
1472   { WNM_BSS_TRANS_MGMT_QUERY, "BSS Transition Management Query" },
1473   { WNM_BSS_TRANS_MGMT_REQ, "BSS Transition Management Request" },
1474   { WNM_BSS_TRANS_MGMT_RESP, "BSS Transition Management Response" },
1475   { WNM_FMS_REQ, "FMS Request" },
1476   { WNM_FMS_RESP, "FMS Response" },
1477   { WNM_COLLOCATED_INTERFERENCE_REQ, "Collocated Interference Request" },
1478   { WNM_COLLOCATED_INTERFERENCE_REPORT, "Collocated Interference Report" },
1479   { WNM_TFS_REQ, "TFS Request" },
1480   { WNM_TFS_RESP, "TFS Response" },
1481   { WNM_TFS_NOTIFY, "TFS Notify" },
1482   { WNM_SLEEP_MODE_REQ, "WNM-Sleep Mode Request" },
1483   { WNM_SLEEP_MODE_RESP, "WNM-Sleep Mode Response" },
1484   { WNM_TIM_BROADCAST_REQ, "TIM Broadcast Request" },
1485   { WNM_TIM_BROADCAST_RESP, "TIM Broadcast Response" },
1486   { WNM_QOS_TRAFFIC_CAPAB_UPDATE, "QoS Traffic Capability Update" },
1487   { WNM_CHANNEL_USAGE_REQ, "Channel Usage Request" },
1488   { WNM_CHANNEL_USAGE_RESP, "Channel Usage Response" },
1489   { WNM_DMS_REQ, "DMS Request" },
1490   { WNM_DMS_RESP, "DMS Response" },
1491   { WNM_TIMING_MEASUREMENT_REQ, "Timing Measurement Request" },
1492   { WNM_NOTIFICATION_REQ, "WNM-Notification Request" },
1493   { WNM_NOTIFICATION_RESP, "WNM-Notification Response" },
1494   { 0, NULL }
1495 };
1496 static value_string_ext wnm_action_codes_ext = VALUE_STRING_EXT_INIT(wnm_action_codes);
1497
1498 enum unprotected_wnm_action {
1499   UNPROTECTED_WNM_TIM = 0,
1500   UNPROTECTED_WNM_TIMING_MEASUREMENT = 1
1501 };
1502
1503 static const value_string unprotected_wnm_action_codes[] = {
1504   { UNPROTECTED_WNM_TIM, "TIM" },
1505   { UNPROTECTED_WNM_TIMING_MEASUREMENT, "Timing Measurement" },
1506   { 0, NULL }
1507 };
1508 static value_string_ext unprotected_wnm_action_codes_ext = VALUE_STRING_EXT_INIT(unprotected_wnm_action_codes);
1509
1510 static const value_string wnm_notification_types[] = {
1511   { 0, "Firmware Update Notification" },
1512   { 1, "Reserved for use by WFA" },
1513   { 221, "Vendor Specific" },
1514   { 0, NULL }
1515 };
1516
1517 static value_string_ext wnm_notification_types_ext =
1518   VALUE_STRING_EXT_INIT(wnm_notification_types);
1519
1520 /*** End: Action Fixed Parameter ***/
1521
1522 static const value_string ieee80211_tag_measure_request_type_flags[] = {
1523   {0x00, "Basic Request"},
1524   {0x01, "Clear Channel Assessment (CCA) Request"},
1525   {0x02, "Receive Power Indication (RPI) Histogram Request"},
1526   {0x03, "Channel Load Request"},
1527   {0x04, "Noise Histogram Request"},
1528   {0x05, "Beacon Request"},
1529   {0x06, "Frame Request"},
1530   {0x07, "STA Statistics Request"},
1531   {0x08, "Location Configuration Indication (LCI) Request"},
1532   {0x09, "Transmit Stream Measurement Request"},
1533   {0x0A, "Measurement Pause Request"},
1534   {0x00, NULL}
1535 };
1536 static value_string_ext ieee80211_tag_measure_request_type_flags_ext =
1537   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_type_flags);
1538
1539 static const value_string ieee80211_tag_measure_report_type_flags[] = {
1540   { 0x00, "Basic Report" },
1541   { 0x01, "Clear Channel Assessment (CCA) Report" },
1542   { 0x02, "Receive Power Indication (RPI) Histogram Report" },
1543   { 0x03, "Channel Load Report" },
1544   { 0x04, "Noise Histogram Report" },
1545   { 0x05, "Beacon Report" },
1546   { 0x06, "Frame Report" },
1547   { 0x07, "STA Statistics Report" },
1548   { 0x08, "Location Configuration Information (LCI) Report" },
1549   { 0x09, "Transmit Stream Measurement Report" },
1550   { 0x00, NULL }
1551 };
1552 static value_string_ext ieee80211_tag_measure_report_type_flags_ext =
1553   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_report_type_flags);
1554
1555 static const true_false_string ieee80211_tag_measure_report_frame_info_frame_type_flag = {
1556   "Measurement Pilot Frame",
1557   "Beacon/Probe Response Frame"
1558 };
1559
1560 static const true_false_string ieee80211_tag_measure_map_field_bss_flag = {
1561   "At least one MPDU was received by another BSS or IBSS in the measurement period.",
1562   "No MPDUs were received from another BSS or IBSS in the measurement period."
1563 };
1564
1565 static const value_string ieee80211_tag_measure_request_measurement_mode_flags[] = {
1566   { 0x00, "Passive" },
1567   { 0x01, "Active" },
1568   { 0x02, "Beacon Table" },
1569   { 0x00, NULL }
1570 };
1571
1572 #define MEASURE_REQ_BEACON_SUB_SSID 0
1573 #define MEASURE_REQ_BEACON_SUB_BRI 1
1574 #define MEASURE_REQ_BEACON_SUB_RD 2
1575 #define MEASURE_REQ_BEACON_SUB_REQUEST 10
1576 #define MEASURE_REQ_BEACON_SUB_APCP 51
1577 #define MEASURE_REQ_BEACON_SUB_VS 221
1578
1579 static const value_string ieee80211_tag_measure_request_beacon_sub_id_flags[] = {
1580   { MEASURE_REQ_BEACON_SUB_SSID, "SSID" },
1581   { MEASURE_REQ_BEACON_SUB_BRI, "Beacon Reporting Information" },
1582   { MEASURE_REQ_BEACON_SUB_RD, "Reporting Detail" },
1583   { MEASURE_REQ_BEACON_SUB_REQUEST, "Request" },
1584   { MEASURE_REQ_BEACON_SUB_APCP, "AP Channel Report" },
1585   { MEASURE_REQ_BEACON_SUB_VS, "Vendor Specific" },
1586   { 0x00, NULL}
1587 };
1588
1589 static const value_string ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags[] = {
1590   { 0x00, "Report to be issued after each measurement." },
1591   { 0x01, "The measured RCPI level is greater than an absolute threshold." },
1592   { 0x02, "The measured RCPI level is less than an absolute threshold." },
1593   { 0x03, "The measured RSNI level is greater than an absolute threshold." },
1594   { 0x04, "The measured RSNI level is less than an absolute threshold." },
1595   { 0x05, "The measured RCPI level is greater than a threshold defined by an offset from the serving AP's reference RCPI." },
1596   { 0x06, "The measured RCPI level is less than a threshold defined by an offset from the serving AP's reference RCPI." },
1597   { 0x07, "The measured RSNI level is greater than a threshold defined by an offset from the serving AP's reference RSNI." },
1598   { 0x08, "The measured RSNI level is less than a threshold defined by an offset from the serving AP's reference RSNI." },
1599   { 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." },
1600   { 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." },
1601   { 0xfe, "Report not required to be issued" },
1602   { 0x00, NULL }
1603 };
1604
1605 static const value_string ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags[] = {
1606   { 0, "No fixed length fields or elements" },
1607   { 1, "All fixed length fields and any requested elements in the Request information element if present" },
1608   { 2, "All fixed length fields and elements (default, used when Reporting Detail subelement is not included in Beacon Request" },
1609   { 0x00, NULL }
1610 };
1611
1612 static const value_string ieee80211_tag_measure_request_group_id_flags[] = {
1613   { 0x00, "STA Counters from dot11CountersTable" },
1614   { 0x01, "STA Counters from dot11MacStatistics group" },
1615   { 0x02, "QoS STA Counters for UP0 from dot11QosCountersTable" },
1616   { 0x03, "QoS STA Counters for UP1 from dot11QosCountersTable" },
1617   { 0x04, "QoS STA Counters for UP2 from dot11QosCountersTable" },
1618   { 0x05, "QoS STA Counters for UP3 from dot11QosCountersTable" },
1619   { 0x06, "QoS STA Counters for UP4 from dot11QosCountersTable" },
1620   { 0x07, "QoS STA Counters for UP5 from dot11QosCountersTable" },
1621   { 0x08, "QoS STA Counters for UP6 from dot11QosCountersTable" },
1622   { 0x09, "QoS STA Counters for UP7 from dot11QosCountersTable" },
1623   { 0x0a, "BSS Average Access Delays" },
1624   { 0x0b, "STA Counters from dot11A-MSDU Group" },
1625   { 0x0c, "STA Counters from dot11A-MPDU Group" },
1626   { 0x0d, "STA Counters from dot11 BAR, Channel Width, PSMP Group" },
1627   { 0x0e, "STA Counters from dot11Protection Group" },
1628   { 0x0f, "STBC Group" },
1629   { 0x00, NULL }
1630 };
1631 static value_string_ext ieee80211_tag_measure_request_group_id_flags_ext =
1632   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_group_id_flags);
1633
1634 static const value_string ieee80211_tclas_process_flag[] = {
1635   {0x00, "Incoming MSDU's higher layer parameters have to match to the parameters in all associated TCLAS elements."},
1636   {0x01, "Incoming MSDU's higher layer parameters have to match to at least one of the associated TCLAS elements."},
1637   {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."},
1638   {0, NULL}
1639 };
1640
1641
1642 #define MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO 1
1643
1644 static const value_string ieee80211_tag_measure_request_channel_load_sub_id_vals[] = {
1645   { MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO, "Channel Load Reporting Information" },
1646   { 221, "Vendor Specific" },
1647   { 0x00, NULL}
1648 };
1649
1650 static const value_string ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals[] = {
1651   { 0x00, "Report to be issued after each measurement (default, used when Channel Load Reporting Information subelement is not included in Channel Load Request)." },
1652   { 0x01, "Report to be issued when measured Channel Load is equal to or greater than the reference value." },
1653   { 0x02, "Report to be issued when measured Channel Load is equal to or less than the reference value." },
1654   { 0x00, NULL}
1655 };
1656
1657 #define MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO 1
1658
1659 static const value_string ieee80211_tag_measure_request_noise_histogram_sub_id_vals[] = {
1660   { MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO, "Noise Histogram Reporting Information" },
1661   { 221, "Vendor Specific" },
1662   { 0x00, NULL}
1663 };
1664
1665 static const value_string ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals[] = {
1666   { 0x00, "Report to be issued after each measurement (default, used when Noise Histogram Reporting Information subelement is not included in Noise Histogram Request)." },
1667   { 0x01, "Noise Histogram Report to be issued when measured ANPI is equal to or greater than the reference value." },
1668   { 0x02, "Noise Histogram Report to be issued when measured ANPI is equal to or less than the reference value." },
1669   { 0x00, NULL}
1670 };
1671
1672 #define MEASURE_REP_REPORTED_FRAME_BODY 1
1673
1674 static const value_string ieee80211_tag_measure_report_beacon_sub_id_vals[] = {
1675   { MEASURE_REP_REPORTED_FRAME_BODY, "Reported Frame Body" },
1676   { 221, "Vendor Specific" },
1677   { 0x00, NULL}
1678 };
1679
1680 static const value_string frame_type[] = {
1681   {MGT_FRAME,       "Management frame"},
1682   {CONTROL_FRAME,   "Control frame"},
1683   {DATA_FRAME,      "Data frame"},
1684   {EXTENSION_FRAME, "Extension frame"},
1685   {0,               NULL}
1686 };
1687
1688 static const value_string tofrom_ds[] = {
1689   {0,                     "Not leaving DS or network is operating "
1690     "in AD-HOC mode (To DS: 0 From DS: 0)"},
1691   {FLAG_TO_DS,            "Frame from STA to DS via an AP (To DS: 1 "
1692     "From DS: 0)"},
1693   {FLAG_FROM_DS,          "Frame from DS to a STA via AP(To DS: 0 "
1694     "From DS: 1)"},
1695   {FLAG_TO_DS|FLAG_FROM_DS, "WDS (AP to AP) or Mesh (MP to MP) Frame "
1696     "(To DS: 1 From DS: 1)"},
1697   {0, NULL}
1698 };
1699
1700 static const true_false_string tods_flag = {
1701   "Frame is entering DS",
1702   "Frame is not entering DS"
1703 };
1704
1705 static const true_false_string fromds_flag = {
1706   "Frame is exiting DS",
1707   "Frame is not exiting DS"
1708 };
1709
1710 static const true_false_string more_fragments = {
1711   "More fragments follow",
1712   "This is the last fragment"
1713 };
1714
1715 static const true_false_string retry_flags = {
1716   "Frame is being retransmitted",
1717   "Frame is not being retransmitted"
1718 };
1719
1720 static const true_false_string pm_flags = {
1721   "STA will go to sleep",
1722   "STA will stay up"
1723 };
1724
1725 static const true_false_string md_flags = {
1726   "Data is buffered for STA at AP",
1727   "No data buffered"
1728 };
1729
1730 static const true_false_string protected_flags = {
1731   "Data is protected",
1732   "Data is not protected"
1733 };
1734
1735 static const true_false_string order_flags = {
1736   "Strictly ordered",
1737   "Not strictly ordered"
1738 };
1739
1740 static const true_false_string cf_ess_flags = {
1741   "Transmitter is an AP",
1742   "Transmitter is a STA"
1743 };
1744
1745
1746 static const true_false_string cf_privacy_flags = {
1747   "AP/STA can support WEP",
1748   "AP/STA cannot support WEP"
1749 };
1750
1751 static const true_false_string cf_ibss_flags = {
1752   "Transmitter belongs to an IBSS",
1753   "Transmitter belongs to a BSS"
1754 };
1755
1756 static const true_false_string eosp_flag = {
1757   "End of service period",
1758   "Service period"
1759 };
1760
1761 static const true_false_string bit4_flag = {
1762   "Bits 8-15 of QoS Control field are Queue Size",
1763   "Bits 8-15 of QoS Control field are TXOP Duration Requested"
1764 };
1765
1766 static const true_false_string ieee80211_qos_amsdu_present_flag = {
1767   "A-MSDU",
1768   "MSDU"
1769 };
1770
1771 static const true_false_string csa_txrestrict_flags = {
1772   "Tx Restrict",
1773   "No Tx Restrict"
1774 };
1775
1776 static const true_false_string csa_initiator_flags = {
1777   "Initiator",
1778   "Non Initiator"
1779 };
1780
1781 static const true_false_string mesh_config_cap_power_save_level_flags = {
1782    "One of the peer-specific mesh power modes is deep sleep mode",
1783    "No one is in deep sleep mode"
1784 };
1785
1786 static const value_string sta_cf_pollable[] = {
1787   {0x00, "Station is not CF-Pollable"},
1788   {0x02, "Station is CF-Pollable, not requesting to be placed on the  CF-polling list"},
1789   {0x01, "Station is CF-Pollable, requesting to be placed on the CF-polling list"},
1790   {0x03, "Station is CF-Pollable, requesting never to be polled"},
1791   {0x80, "QSTA requesting association in QBSS"},
1792   {0x81, "Reserved"},
1793   {0x82, "Reserved"},
1794   {0x83, "Reserved"},
1795   {0, NULL}
1796 };
1797
1798 static const value_string ap_cf_pollable[] = {
1799   {0x00, "No point coordinator at AP"},
1800   {0x02, "Point coordinator at AP for delivery only (no polling)"},
1801   {0x01, "Point coordinator at AP for delivery and polling"},
1802   {0x03, "Reserved"},
1803   {0x80, "QAP (HC) does not use CFP for delivery of unicast data type frames"},
1804   {0x82, "QAP (HC) uses CFP for delivery, but does not send CF-Polls to non-QoS STAs"},
1805   {0x81, "QAP (HC) uses CFP for delivery, and sends CF-Polls to non-QoS STAs"},
1806   {0x83, "Reserved"},
1807   {0, NULL}
1808 };
1809
1810
1811 static const value_string auth_alg[] = {
1812   {0x00, "Open System"},
1813   {0x01, "Shared key"},
1814   {0x02, "Fast BSS Transition"},
1815   {0x03, "Simultaneous Authentication of Equals (SAE)"},
1816   {0x80, "Network EAP"},  /* Cisco proprietary? */
1817   {0, NULL}
1818 };
1819
1820 static const true_false_string ff_block_ack_params_amsdu_permitted_flag = {
1821   "Permitted in QoS Data MPDUs",
1822   "Not Permitted"
1823 };
1824
1825 static const true_false_string ff_block_ack_params_policy_flag = {
1826   "Immediate Block Ack",
1827   "Delayed Block Ack"
1828 };
1829
1830 static const value_string  ff_channel_width_vals[] = {
1831   {0x00, "20 MHz channel width only"},
1832   {0x01, "Any channel width in the STA's Supported Channel Width Set"},
1833   {0, NULL}
1834 };
1835
1836 static const true_false_string ff_qos_info_ap_q_ack_flag = {
1837   "APs MIB attribute dot11QAckOptionImplemented is true",
1838   "APs MIB attribute dot11QAckOptionImplemented is false"
1839 };
1840
1841 static const true_false_string ff_qos_info_ap_queue_req_flag = {
1842   "AP can process a nonzero Queue Size subfield in the QoS Control field in QoS data frames",
1843   "AP cannot process a nonzero Queue Size subfield in the QoS Control field in QoS data frames"
1844 };
1845
1846 static const true_false_string ff_qos_info_ap_txop_request_flag = {
1847   "AP can process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames",
1848   "AP cannot process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames"
1849 };
1850
1851 static const true_false_string ff_qos_info_sta_ac_flag = {
1852   "Trigger-enabled and Delivery-enabled",
1853   "Neither Trigger-enabled nor Delivery-enabled"
1854 };
1855
1856 static const true_false_string ff_qos_info_sta_q_ack_flag = {
1857   "STAs MIB attribute dot11QAckOptionImplemented is true",
1858   "STAs MIB attribute dot11QAckOptionImplemented is false"
1859 };
1860
1861 static const value_string ff_qos_info_sta_max_sp_len_flags[] = {
1862   {0x00, "AP may deliver all buffered MSDUs, A-MSDUs and MMPDUs"},
1863   {0x01, "AP may deliver a maximum of two MSDUs, A-MSDUs and MMPDUs per SP"},
1864   {0x02, "AP may deliver a maximum of four MSDUs, A-MSDUs and MMPDUs per SP"},
1865   {0x03, "AP may deliver a maximum of six MSDUs, A-MSDUs and MMPDUs per SP"},
1866   {0, NULL}
1867 };
1868
1869 static const true_false_string ff_qos_info_sta_more_data_ack_flag = {
1870   "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",
1871   "STA cannot process ACK frames with the More Data bit in the Frame Control field set to 1"
1872 };
1873
1874 static const true_false_string ff_sm_pwr_save_sm_mode_flag = {
1875   "Dynamic SM Power Save mode",
1876   "Static SM Power Save mode"
1877 };
1878
1879 static const true_false_string ff_pco_phase_cntrl_flag = {
1880   "40 MHz Phase",
1881   "20 MHz Phase"
1882 };
1883
1884 static const true_false_string ff_psmp_param_set_more_psmp_flag = {
1885   "More PSMP Sequences Follow",
1886   "No PSMP Sequences Follow"
1887 };
1888
1889 static const value_string ff_mimo_cntrl_nc_index_flags[] = {
1890   {0x00, "1 Column"},
1891   {0x01, "2 Columns"},
1892   {0x02, "3 Columns"},
1893   {0x03, "4 Columns"},
1894   {0, NULL}
1895 };
1896
1897 static const value_string ff_mimo_cntrl_nr_index_flags[] = {
1898   {0x00, "1 Row"},
1899   {0x01, "2 Rows"},
1900   {0x02, "3 Rows"},
1901   {0x03, "4 Rows"},
1902   {0, NULL}
1903 };
1904
1905 static const true_false_string ff_mimo_cntrl_channel_width_flag = {
1906   "40 MHz",
1907   "20 MHz"
1908 };
1909
1910 static const true_false_string ff_ht_info_information_request_flag = {
1911   "Requesting HT Information Exchange management action frame",
1912   "Should not send an HT Information Exchange management action frame"
1913 };
1914
1915 static const true_false_string ff_ht_info_40_mhz_intolerant_flag = {
1916   "Transmitting station is intolerant of 40 MHz operation",
1917   "Transmitting station permits 40 MHz operation"
1918 };
1919
1920 static const true_false_string ff_ht_info_sta_chan_width_flag = {
1921   "40 MHz",
1922   "20 MHz"
1923 };
1924
1925 static const value_string ff_ht_action_flags[] = {
1926   {HT_ACTION_NOTIFY_CHAN_WIDTH,           "Notify Channel Width"},
1927   {HT_ACTION_SM_PWR_SAVE,                 "Spatial Multiplexing (SM) Power Save"},
1928   {HT_ACTION_PSMP_ACTION,                 "Power Save Multi-Poll (PSMP) action frame"},
1929   {HT_ACTION_SET_PCO_PHASE,               "Set PCO Phase"},
1930   {HT_ACTION_MIMO_CSI,                    "MIMO CSI Matrices"},
1931   {HT_ACTION_MIMO_BEAMFORMING,            "MIMO Non-compressed Beamforming"},
1932   {HT_ACTION_MIMO_COMPRESSED_BEAMFORMING, "MIMO Compressed Beamforming"},
1933   {HT_ACTION_ANT_SEL_FEEDBACK,            "Antenna Selection Indices Feedback"},
1934   {HT_ACTION_HT_INFO_EXCHANGE,            "HT Information Exchange"},
1935   {0x00, NULL}
1936 };
1937
1938 static const value_string ff_fst_action_flags[] = {
1939   {FST_SETUP_REQUEST,             "FST Setup Request"},
1940   {FST_SETUP_RESPONSE,            "FST Setup Response"},
1941   {FST_TEAR_DOWN,                 "FST Tear Down"},
1942   {FST_ACK_REQUEST,               "FST Ack Request"},
1943   {FST_ACK_RESPONSE,              "FST Ack Response"},
1944   {FST_ON_CHANNEL_TUNNEL_REQUEST, "FST On-channel Tunnel Request"},
1945   {0x00, NULL}
1946 };
1947
1948 static const value_string ff_dmg_action_flags[] = {
1949   {DMG_ACTION_PWR_SAVE_CONFIG_REQ,           "Power Save Configuration Request"},
1950   {DMG_ACTION_PWR_SAVE_CONFIG_RES,           "Power Save Configuration Response"},
1951   {DMG_ACTION_INFO_REQ,                      "Information Request"},
1952   {DMG_ACTION_INFO_RES,                      "Information Response"},
1953   {DMG_ACTION_HANDOVER_REQ,                  "Handover Request"},
1954   {DMG_ACTION_HANDOVER_RES,                  "Handover Response"},
1955   {DMG_ACTION_DTP_REQ,                       "DTP Request"},
1956   {DMG_ACTION_DTP_RES,                       "DTP Response"},
1957   {DMG_ACTION_RELAY_SEARCH_REQ,              "Relay Search Request"},
1958   {DMG_ACTION_RELAY_SEARCH_RES,              "Relay Search Response"},
1959   {DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ, "Multi Relay Channel Measurement Request"},
1960   {DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES, "Multi Relay Channel Measurement Response"},
1961   {DMG_ACTION_RLS_REQ,                       "RLS Request"},
1962   {DMG_ACTION_RLS_RES,                       "RLS Response"},
1963   {DMG_ACTION_RLS_ANNOUNCE,                  "RLS Announcement"},
1964   {DMG_ACTION_RLS_TEARDOWN,                  "RLS Teardown"},
1965   {DMG_ACTION_RELAY_ACK_REQ,                 "Relay ACK Request"},
1966   {DMG_ACTION_RELAY_ACK_RES,                 "Relay ACK Response"},
1967   {DMG_ACTION_TPA_REQ,                       "TPA Request"},
1968   {DMG_ACTION_TPA_RES,                       "TPA Response"},
1969   {DMG_ACTION_TPA_REP,                       "TPA Report"},
1970   {DMG_ACTION_ROC_REQ,                       "ROC Request"},
1971   {DMG_ACTION_ROC_RES,                       "ROC Response"},
1972   {0x00, NULL}
1973 };
1974
1975 static const value_string ff_unprotected_dmg_action_flags[] = {
1976   {UNPROTECTED_DMG_ANNOUNCE,      "Announce"},
1977   {UNPROTECTED_DMG_BRP,           "BRP"},
1978   {0x00, NULL}
1979 };
1980 static const value_string ff_mimo_cntrl_grouping_flags[] = {
1981   {0x00, "No Grouping"},
1982   {0x01, "Carrier Groups of 2"},
1983   {0x02, "Carrier Groups of 4"},
1984   {0x03, "Reserved"},
1985   {0, NULL}
1986 };
1987
1988 static const value_string ff_mimo_cntrl_coefficient_size_flags[] = {
1989   {0x00, "4 Bits"},
1990   {0x01, "5 Bits"},
1991   {0x02, "6 Bits"},
1992   {0x03, "8 Bits"},
1993   {0, NULL}
1994 };
1995
1996 static const value_string ff_mimo_cntrl_codebook_info_flags[] = {
1997   {0x00, "1 bit for 'Capital Psi', 3 bits for 'Small Psi'"},
1998   {0x01, "2 bit for 'Capital Psi', 4 bits for 'Small Psi'"},
1999   {0x02, "3 bit for 'Capital Psi', 5 bits for 'Small Psi'"},
2000   {0x03, "4 bit for 'Capital Psi', 6 bits for 'Small Psi'"},
2001   {0, NULL}
2002 };
2003
2004 static const value_string ff_ppa_action_codes[] = {
2005   {PPA_DSE_ENABLEMENT,                  "Protected DSE enablement"},
2006   {PPA_DSE_DEENABLEMENT,                "Protected DSE deenablement"},
2007   {PPA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Protected Extended Channel Switch Announcement"},
2008   {PPA_DSE_MEASUREMENT_REQUEST,         "Protected DSE measurement request"},
2009   {PPA_DSE_MEASUREMENT_REPORT,          "Protected DSE measurement report"},
2010   {PPA_DSE_POWER_CONSTRAINT,            "Protected DSE power constraint"},
2011   {PPA_VENDOR_SPECIFIC,                 "Protected Vendor Specific"},
2012   {PPA_GAS_INITIAL_REQUEST,             "Protected GAS Initial Request"},
2013   {PPA_GAS_INITIAL_RESPONSE,            "Protected GAS Initial Response"},
2014   {PPA_GAS_COMEBACK_REQUEST,            "Protected GAS Comeback Request"},
2015   {PPA_GAS_COMEBACK_RESPONSE,           "Protected GAS Comeback Response"},
2016   {PPA_QAB_REQUEST,                     "Protected QAB Request"},
2017   {PPA_QAB_RESPONSE,                    "Protected QAB Response"},
2018   {0x00, NULL}
2019 };
2020 static value_string_ext ff_ppa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_ppa_action_codes);
2021
2022 static const value_string ff_pa_action_codes[] = {
2023   {PA_20_40_BSS_COEXISTENCE_MANAGEMENT,"20/40 BSS Coexistence Management"},
2024   {PA_DSE_ENABLEMENT,                  "DSE enablement"},
2025   {PA_DSE_DEENABLEMENT,                "DSE deenablement"},
2026   {PA_DSE_REG_LOC_ANNOUNCEMENT,        "DSE Registered Location Announcement"},
2027   {PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement"},
2028   {PA_DSE_MEASUREMENT_REQUEST,         "DSE measurement request"},
2029   {PA_DSE_MEASUREMENT_REPORT,          "DSE measurement report"},
2030   {PA_MEASUREMENT_PILOT,               "Measurement Pilot"},
2031   {PA_DSE_POWER_CONSTRAINT,            "DSE power constraint"},
2032   {PA_VENDOR_SPECIFIC,                 "Vendor Specific"},
2033   {PA_GAS_INITIAL_REQUEST,             "GAS Initial Request"},
2034   {PA_GAS_INITIAL_RESPONSE,            "GAS Initial Response"},
2035   {PA_GAS_COMEBACK_REQUEST,            "GAS Comeback Request"},
2036   {PA_GAS_COMEBACK_RESPONSE,           "GAS Comeback Response"},
2037   {PA_TDLS_DISCOVERY_RESPONSE,         "TDLS Discovery Response"},
2038   {PA_LOCATION_TRACK_NOTIFICATION,     "Location Track Notification"},
2039   {PA_QAB_REQUEST,                     "QAB Request"},
2040   {PA_QAB_RESPONSE,                    "QAB Response"},
2041   {0x00, NULL}
2042 };
2043 static value_string_ext ff_pa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_pa_action_codes);
2044
2045 static const value_string category_codes[] = {
2046   {CAT_SPECTRUM_MGMT,                    "Spectrum Management (SM)"},
2047   {CAT_QOS,                              "Quality of Service (QoS)"},
2048   {CAT_DLS,                              "Direct-Link Setup (DLS)"},
2049   {CAT_BLOCK_ACK,                        "Block Ack"},
2050   {CAT_PUBLIC,                           "Public Action"},
2051   {CAT_RADIO_MEASUREMENT,                "Radio Measurement"},
2052   {CAT_FAST_BSS_TRANSITION,              "Fast BSS Transition"},
2053   {CAT_HT,                               "High Throughput"},
2054   {CAT_SA_QUERY,                         "SA Query"},
2055   {CAT_PUBLIC_PROTECTED,                 "Protected Dual of Public Action"},
2056   {CAT_WNM,                              "WNM"},
2057   {CAT_UNPROTECTED_WNM,                  "Unprotected WNM"},
2058   {CAT_TDLS,                             "TDLS"},
2059   {CAT_MESH,                             "MESH"},
2060   {CAT_MULTIHOP,                         "Multihop"},
2061   {CAT_SELF_PROTECTED,                   "Self-protected"},
2062   {CAT_DMG,                              "DMG"},
2063   {CAT_MGMT_NOTIFICATION,                "Management Notification"},
2064   {CAT_FAST_SESSION_TRANSFER,            "Fast Session Transfer"},
2065   {CAT_ROBUST_AV_STREAMING,              "Robust AV Streaming"},
2066   {CAT_UNPROTECTED_DMG,                  "Unprotected DMG"},
2067   {CAT_VHT,                              "VHT"},
2068   {CAT_VENDOR_SPECIFIC_PROTECTED,        "Vendor-specific Protected"},
2069   {CAT_VENDOR_SPECIFIC,                  "Vendor Specific"},
2070
2071   {0x80 | CAT_SPECTRUM_MGMT,             "Spectrum Management (SM) (error)"},
2072   {0x80 | CAT_QOS,                       "Quality of Service (QoS (error))"},
2073   {0x80 | CAT_DLS,                       "Direct-Link Setup (DLS) (error)"},
2074   {0x80 | CAT_BLOCK_ACK,                 "Block Ack (error)"},
2075   {0x80 | CAT_PUBLIC,                    "Public Action (error)"},
2076   {0x80 | CAT_RADIO_MEASUREMENT,         "Radio Measurement (error)"},
2077   {0x80 | CAT_FAST_BSS_TRANSITION,       "Fast BSS Transition (error)"},
2078   {0x80 | CAT_HT,                        "High Throughput (error)"},
2079   {0x80 | CAT_SA_QUERY,                  "SA Query (error)"},
2080   {0x80 | CAT_PUBLIC_PROTECTED,          "Protected Dual of Public Action (error)"},
2081   {0x80 | CAT_WNM,                       "WNM (error)"},
2082   {0x80 | CAT_UNPROTECTED_WNM,           "Unprotected WNM (error)"},
2083   {0x80 | CAT_TDLS,                      "TDLS (error)"},
2084   {0x80 | CAT_MESH,                      "Mesh (error)"},
2085   {0x80 | CAT_MULTIHOP,                  "Multihop (error)"},
2086   {0x80 | CAT_SELF_PROTECTED,            "Self-protected (error)"},
2087   {0x80 | CAT_DMG,                       "DMG (error)"},
2088   {0x80 | CAT_MGMT_NOTIFICATION,         "Management Notification (error)"},
2089   {0x80 | CAT_FAST_SESSION_TRANSFER,     "Fast Session Transfer (error)"},
2090   {0x80 | CAT_ROBUST_AV_STREAMING,       "Robust AV Streaming (error)"},
2091   {0x80 | CAT_UNPROTECTED_DMG,           "Unprotected DMG (error)"},
2092   {0x80 | CAT_VHT,                       "VHT"},
2093   {0x80 | CAT_VENDOR_SPECIFIC_PROTECTED, "Vendor-specific Protected (error)"},
2094   {0x80 | CAT_VENDOR_SPECIFIC,           "Vendor Specific (error)"},
2095   {0, NULL}
2096 };
2097 static value_string_ext category_codes_ext = VALUE_STRING_EXT_INIT(category_codes);
2098
2099 #define NR_SUB_ID_TSF_INFO                 1
2100 #define NR_SUB_ID_CON_COU_STR              2
2101 #define NR_SUB_ID_BSS_TRN_CAN_PREF         3
2102 #define NR_SUB_ID_BSS_TER_DUR              4
2103 #define NR_SUB_ID_BEARING                  5
2104
2105 #define NR_SUB_ID_HT_CAPABILITIES          45
2106 #define NR_SUB_ID_HT_OPERATION             61
2107 #define NR_SUB_ID_SEC_CHANNEL_OFFSET       62
2108 #define NR_SUB_ID_MEASUREMENT_PILOT_INFO   66
2109 #define NR_SUB_ID_RM_ENABLE_CAP            70
2110 #define NR_SUB_ID_HT_MULTIPLE_BSSID        71
2111
2112 #define NR_SUB_ID_VENDOR_SPECIFIC          221
2113
2114 static const value_string ieee80211_neighbor_report_subelement_id_vals[] = {
2115   {NR_SUB_ID_TSF_INFO, "TSF Information"},
2116   {NR_SUB_ID_CON_COU_STR, "Condensed Country String"},
2117   {NR_SUB_ID_BSS_TRN_CAN_PREF, "BSS Transition Candidate Preference"},
2118   {NR_SUB_ID_BSS_TER_DUR, "BSS Termination Duration"},
2119   {NR_SUB_ID_BEARING, "Bearing"},
2120   {NR_SUB_ID_HT_CAPABILITIES, "HT Capabilities"},
2121   {NR_SUB_ID_HT_OPERATION, "HT Operation"},
2122   {NR_SUB_ID_SEC_CHANNEL_OFFSET, "Secondary Channel Offset"},
2123   {NR_SUB_ID_MEASUREMENT_PILOT_INFO, "Measurement Pilot Transmission"},
2124   {NR_SUB_ID_RM_ENABLE_CAP, "RM Enabled Capabilities"},
2125   {NR_SUB_ID_HT_MULTIPLE_BSSID, "Multiple BSSID"},
2126   {NR_SUB_ID_VENDOR_SPECIFIC, "Vendor Specific"},
2127   {0, NULL}
2128 };
2129
2130 static const value_string ieee80211_neighbor_report_bssid_info_reachability_vals[] = {
2131   {0, "Reserved"},
2132   {1, "Not Reachable"},
2133   {2, "Unknown"},
2134   {3, "Reachable"},
2135   {0, NULL}
2136 };
2137
2138 static const value_string action_codes[] = {
2139   {SM_ACTION_MEASUREMENT_REQUEST, "Measurement Request"},
2140   {SM_ACTION_MEASUREMENT_REPORT,  "Measurement Report"},
2141   {SM_ACTION_TPC_REQUEST,         "TPC Request"},
2142   {SM_ACTION_TPC_REPORT,          "TPC Report"},
2143   {SM_ACTION_CHAN_SWITCH_ANNC,    "Channel Switch Announcement"},
2144   {0, NULL}
2145 };
2146
2147 static const value_string vendor_action_types_mrvl[] = {
2148   {MRVL_ACTION_MESH_MANAGEMENT, "Mesh Management"},
2149   {0, NULL}
2150 };
2151
2152 static const value_string mesh_mgt_action_codes_mrvl[] = {
2153   {MRVL_MESH_MGMT_ACTION_RREQ, "Route Request"},
2154   {MRVL_MESH_MGMT_ACTION_RREP, "Route Response"},
2155   {MRVL_MESH_MGMT_ACTION_RERR, "Route Error"},
2156   {MRVL_MESH_MGMT_ACTION_PLDM, "Peer Link Down"},
2157   {0, NULL}
2158 };
2159
2160 static const value_string mesh_path_selection_codes[] = {
2161   {0x0, "Hybrid Wireless Mesh Protocol"},
2162   {0, NULL}
2163 };
2164
2165 static const value_string mesh_metric_codes[] = {
2166   {0x0, "Airtime Link Metric"},
2167   {0, NULL}
2168 };
2169
2170 static const value_string wme_action_codes[] = {
2171   {0x00, "Setup request"},
2172   {0x01, "Setup response"},
2173   {0x02, "Teardown"},
2174   {0x00, NULL}
2175 };
2176
2177 static const value_string wme_status_codes[] = {
2178   {0x00, "Admission accepted"},
2179   {0x01, "Invalid parameters"},
2180   {0x03, "Refused"},
2181   {0x00, NULL}
2182 };
2183
2184 static const value_string mesh_action[] = {
2185   {MESH_ACTION_LINK_METRIC_REPORT, "Mesh Link Metric Report"},
2186   {MESH_ACTION_HWMP,               "HWMP Mesh Path Selection"},
2187   {MESH_ACTION_GATE_ANNOUNCE,      "Gate Announcement"},
2188   {MESH_ACTION_CONGESTION_CTL,     "Congestion Control Notification"},
2189   {MESH_ACTION_MCCA_SETUP_REQUEST, "MCCA Setup Request"},
2190   {MESH_ACTION_MCCA_SETUP_REPLY,   "MCCA Setup Reply"},
2191   {MESH_ACTION_MCCA_ADV_REQUEST,   "MCCA Advertisement Request"},
2192   {MESH_ACTION_MCCA_ADV,           "MCCA Advertisement"},
2193   {MESH_ACTION_MCCA_TEARDOWN,      "MCCA Teardown"},
2194   {MESH_ACTION_TBTT_ADJ_REQUEST,   "TBTT Adjustment Request"},
2195   {MESH_ACTION_TBTT_ADJ_RESPONSE,  "TBTT Adjustment Response"},
2196   {0, NULL}
2197 };
2198 static value_string_ext mesh_action_ext = VALUE_STRING_EXT_INIT(mesh_action);
2199
2200 static const value_string multihop_action[] = {
2201   {MULTIHOP_ACTION_PROXY_UPDATE,      "Proxy Update"},
2202   {MULTIHOP_ACTION_PROXY_UPDATE_CONF, "Proxy Update Confirmation"},
2203   {0, NULL}
2204 };
2205
2206 static const value_string selfprot_action[] = {
2207   {SELFPROT_ACTION_MESH_PEERING_OPEN,     "Mesh Peering Open"},
2208   {SELFPROT_ACTION_MESH_PEERING_CONFIRM,  "Mesh Peering Confirm"},
2209   {SELFPROT_ACTION_MESH_PEERING_CLOSE,    "Mesh Peering Close"},
2210   {SELFPROT_ACTION_MESH_GROUP_KEY_INFORM, "Mesh Group Key Inform"},
2211   {SELFPROT_ACTION_MESH_GROUP_KEY_ACK,    "Mesh Group Key Ack"},
2212   {0, NULL}
2213 };
2214
2215 static const value_string mesh_peering_proto_ids[] = {
2216   {MESH_PEERING_PROTO_MGMT,   "Mesh peering management protocol"},
2217   {MESH_PEERING_PROTO_AMPE,   "Authenticated mesh peering exchange protocol"},
2218   {MESH_PEERING_PROTO_VENDOR, "Vendor specific"},
2219   {0, NULL}
2220 };
2221
2222 static const true_false_string hwmp_targ_usn_flags = {
2223   "[USN = 1] Target Sequence Number Unknown at Originator",
2224   "[USN = 0] Target Sequence Number Known at Originator"
2225 };
2226
2227 static const true_false_string hwmp_targ_to_flags = {
2228   "[TO = 1] Only Target Will Respond",
2229   "[TO = 0] Intermediate Nodes May Respond"
2230 };
2231
2232 static const value_string ack_policy[] = {
2233   {0x00, "Normal Ack"},
2234   {0x01, "No Ack"},
2235   {0x02, "No explicit acknowledgment"},
2236   {0x03, "Block Ack"},
2237   {0x00, NULL}
2238 };
2239
2240 static const value_string qos_action_codes[] = {
2241   {QOS_ACTION_ADDTS_REQUEST,  "ADDTS Request"},
2242   {QOS_ACTION_ADDTS_RESPONSE, "ADDTS Response"},
2243   {QOS_ACTION_DELTS,          "DELTS"},
2244   {QOS_ACTION_SCHEDULE,   "Schedule"},
2245   {QOS_ACTION_MAP_CONFIGURE, "QoS Map Configure"},
2246   {0, NULL}
2247 };
2248
2249 static const value_string ba_action_codes[] = {
2250   {BA_ADD_BLOCK_ACK_REQUEST,  "Add Block Ack Request"},
2251   {BA_ADD_BLOCK_ACK_RESPONSE, "Add Block Ack Response"},
2252   {BA_DELETE_BLOCK_ACK,       "Delete Block Ack"},
2253   {0x00, NULL}
2254 };
2255
2256 static const value_string dls_action_codes[] = {
2257   {DLS_ACTION_REQUEST,  "DLS Request"},
2258   {DLS_ACTION_RESPONSE, "DLS Response"},
2259   {DLS_ACTION_TEARDOWN, "DLS Teardown"},
2260   {0, NULL}
2261 };
2262
2263 static const value_string tsinfo_type[] = {
2264   {0x0, "Aperiodic or unspecified Traffic"},
2265   {0x1, "Periodic Traffic"},
2266   {0, NULL}
2267 };
2268
2269 static const value_string tsinfo_direction[] = {
2270   {0x00, "Uplink"},
2271   {0x01, "Downlink"},
2272   {0x02, "Direct link"},
2273   {0x03, "Bidirectional link"},
2274   {0, NULL}
2275 };
2276
2277 static const value_string tsinfo_access[] = {
2278   {0x00, "Reserved"},
2279   {0x01, "EDCA"},
2280   {0x02, "HCCA"},
2281   {0x03, "HEMM"},
2282   {0, NULL}
2283 };
2284
2285 static const value_string qos_up[] = {
2286   {0x00, "Best Effort"},
2287   {0x01, "Background"},
2288   {0x02, "Spare"},
2289   {0x03, "Excellent Effort"},
2290   {0x04, "Controlled Load"},
2291   {0x05, "Video"},
2292   {0x06, "Voice"},
2293   {0x07, "Network Control"},
2294   {0, NULL}
2295 };
2296
2297 static const value_string classifier_type[] = {
2298   {0x00, "Ethernet parameters"},
2299   {0x01, "TCP/UDP IP parameters"},
2300   {0x02, "IEEE 802.1D/Q parameters"},
2301   {0, NULL}
2302 };
2303
2304 static const true_false_string ieee80211_block_ack_control_ack_policy_flag = {
2305     "Immediate Acknowledgement Required",
2306     "Sender Does Not Require Immediate Acknowledgement"
2307 };
2308
2309 static const value_string ieee80211_block_ack_request_type_flags[] = {
2310   {0x00, "Basic Block Ack Request"},
2311   {0x01, "Reserved"},
2312   {0x02, "Compressed Block Ack Request"},
2313   {0x03, "Multi-TID Block Ack Request"},
2314   {0x00, NULL}
2315 };
2316
2317 static const value_string ieee80211_block_ack_type_flags[] = {
2318   {0x00, "Basic Block Ack"},
2319   {0x01, "Reserved"},
2320   {0x02, "Compressed Block"},
2321   {0x03, "Multi-TID Block"},
2322   {0x00, NULL}
2323 };
2324
2325 static const value_string ft_action_codes[] = {
2326   {FT_ACTION_REQUEST, "FT Request"},
2327   {FT_ACTION_RESPONSE, "FT Response"},
2328   {FT_ACTION_CONFIRM, "FT Confirm"},
2329   {FT_ACTION_ACK, "FT Ack"},
2330   {0, NULL}
2331 };
2332
2333 static const value_string sa_query_action_codes[] = {
2334   {SA_QUERY_REQUEST, "SA Query Request"},
2335   {SA_QUERY_RESPONSE, "SA Query Response"},
2336   {0, NULL}
2337 };
2338
2339 static const value_string ieee80211_data_encap_payload_types[] = {
2340   {1, "Remote Request/Response"},
2341   {2, "TDLS"},
2342   {0, NULL}
2343 };
2344
2345 static const true_false_string rsn_preauth_flags = {
2346   "Transmitter supports pre-authentication",
2347   "Transmitter does not support pre-authentication"
2348 };
2349
2350 static const true_false_string rsn_no_pairwise_flags = {
2351   "Transmitter cannot support WEP default key 0 simultaneously with "
2352   "Pairwise key",
2353   "Transmitter can support WEP default key 0 simultaneously with "
2354   "Pairwise key"
2355 };
2356
2357 static const value_string rsn_cap_replay_counter[] = {
2358   {0x00, "1 replay counter per PTKSA/GTKSA/STAKeySA"},
2359   {0x01, "2 replay counters per PTKSA/GTKSA/STAKeySA"},
2360   {0x02, "4 replay counters per PTKSA/GTKSA/STAKeySA"},
2361   {0x03, "16 replay counters per PTKSA/GTKSA/STAKeySA"},
2362   {0, NULL}
2363 };
2364
2365 static const true_false_string ht_ldpc_coding_flag = {
2366   "Transmitter supports receiving LDPC coded packets",
2367   "Transmitter does not support receiving LDPC coded packets"
2368 };
2369
2370 static const true_false_string ht_chan_width_flag = {
2371   "Transmitter supports 20MHz and 40MHz operation",
2372   "Transmitter only supports 20MHz operation"
2373 };
2374
2375 static const value_string ht_sm_pwsave_flag[] = {
2376   {0x00, "Static SM Power Save mode"},
2377   {0x01, "Dynamic SM Power Save mode"},
2378   {0x02, "Reserved"},
2379   {0x03, "SM Power Save disabled"},
2380   {0x00, NULL}
2381 };
2382
2383 static const true_false_string ht_green_flag = {
2384   "Transmitter is able to receive PPDUs with Green Field (GF) preamble",
2385   "Transmitter is not able to receive PPDUs with Green Field (GF) preamble"
2386 };
2387
2388 static const value_string ht_rx_stbc_flag[] = {
2389   {0x00, "No Rx STBC support"},
2390   {0x01, "Rx support of one spatial stream"},
2391   {0x02, "Rx support of one and two spatial streams"},
2392   {0x03, "Rx support of one, two, and three spatial streams"},
2393   {0x00, NULL}
2394 };
2395
2396   /* IEEE Stc 802.11ac-2013 8.4.2.29 Extended Capabilities element*/
2397 static const value_string vht_max_mpdu_in_amsdu[] = {
2398     {0x00, "No limit"},
2399     {0x01, "32"},
2400     {0x02, "16"},
2401     {0x03, "8"},
2402     {0, NULL}
2403 };
2404
2405   /* IEEE Stc 802.11ac/D3.1 */
2406
2407 static const value_string vht_max_mpdu_length_flag[] = {
2408   {0x00, "3 895"},
2409   {0x01, "7 991"},
2410   {0x02, "11 454"},
2411   {0x03, "Reserved"},
2412   {0x00, NULL}
2413 };
2414
2415 static const value_string vht_supported_chan_width_set_flag[] = {
2416   {0x00, "Neither 160MHz nor 80+80 supported"},
2417   {0x01, "160MHz supported"},
2418   {0x02, "160MHz and 80+80 Supported"},
2419   {0x03, "Reserved"},
2420   {0x00, NULL}
2421 };
2422
2423 static const value_string vht_rx_stbc_flag[] = {
2424   {0x00, "None"},
2425   {0x01, "1 Spatial Stream Supported"},
2426   {0x02, "1 to 2 Spatial Stream Supported"},
2427   {0x03, "1 to 3 Spatial Stream Supported"},
2428   {0x04, "1 to 4 Spatial Stream Supported"},
2429   {0x02, "160MHz and 80+80 Supported"},
2430   {0x05, "Reserved"},
2431   {0x06, "Reserved"},
2432   {0x07, "Reserved"},
2433   {0x00, NULL}
2434 };
2435
2436 static const value_string num_plus_one_3bit_flag[] = {
2437   {0x00, "1"},
2438   {0x01, "2"},
2439   {0x02, "3"},
2440   {0x03, "4"},
2441   {0x04, "5"},
2442   {0x05, "6"},
2443   {0x06, "7"},
2444   {0x07, "8"},
2445   {0x00, NULL}
2446 };
2447
2448 static const value_string vht_max_ampdu_flag[] = {
2449   {0x00, "8 191"},
2450   {0x01, "16 383"},
2451   {0x02, "32 767"},
2452   {0x03, "65,535"},
2453   {0x04, "131 071"},
2454   {0x05, "262 143"},
2455   {0x06, "524 287"},
2456   {0x07, "1 048 575"},
2457   {0x00, NULL}
2458 };
2459
2460 static const value_string vht_link_adapt_flag[] = {
2461   {0x00, "No Feedback"},
2462   {0x01, "Reserved (logically only solicited feedback)"},
2463   {0x02, "Unsolicited feedback only"},
2464   {0x03, "Both (can provide unsolicited feedback and respond to VHT MRQ)"},
2465   {0x00, NULL}
2466 };
2467
2468 static const value_string vht_supported_mcs_flag[] = {
2469   {0x00, "MCS 0-7"},
2470   {0x01, "MCS 0-8"},
2471   {0x02, "MCS 0-9"},
2472   {0x03, "Not Supported"},
2473   {0x00, NULL}
2474 };
2475
2476 static const value_string vht_op_channel_width_flag[] = {
2477   {0x00, "20 MHz or 40 MHz"},
2478   {0x01, "80 MHz"},
2479   {0x02, "160 MHz"},
2480   {0x03, "80+80 MHz"},
2481   {0x00, NULL}
2482 };
2483
2484 static const value_string vht_tpe_pwr_units[] = {
2485   {0x00, "EIRP"},
2486   {0x00, NULL}
2487 };
2488
2489 static const true_false_string vht_ndp_annc_sta_info_feedback_type = {
2490   "MU feedback requested",
2491   "SU feedback requested"
2492 };
2493
2494 static const true_false_string ht_delayed_block_ack_flag = {
2495   "Transmitter supports HT-Delayed BlockAck",
2496   "Transmitter does not support HT-Delayed BlockAck"
2497 };
2498
2499 static const true_false_string ht_max_amsdu_flag = {
2500   "7935 bytes",
2501   "3839 bytes"
2502 };
2503
2504 static const true_false_string ht_dss_cck_40_flag = {
2505   "Will/Can use DSSS/CCK in 40 MHz",
2506   "Won't/Can't use of DSSS/CCK in 40 MHz"
2507 };
2508
2509 static const true_false_string ht_psmp_flag = {
2510   "Will/Can support PSMP operation",
2511   "Won't/Can't support PSMP operation"
2512 };
2513
2514 static const true_false_string ht_40_mhz_intolerant_flag = {
2515   "Use of 40 MHz transmissions restricted/disallowed",
2516   "Use of 40 MHz transmissions unrestricted/allowed"
2517 };
2518
2519 static const value_string ampduparam_mpdu_start_spacing_flags[] = {
2520   {0x00, "no restriction"},
2521   {0x01, "1/4 [usec]"},
2522   {0x02, "1/2 [usec]"},
2523   {0x03, "1 [usec]"},
2524   {0x04, "2 [usec]"},
2525   {0x05, "4 [usec]"},
2526   {0x06, "8 [usec]"},
2527   {0x07, "16 [usec]"},
2528   {0x00, NULL}
2529 };
2530
2531 static const true_false_string mcsset_tx_rx_mcs_set_not_equal_flag = {
2532   "Not Equal",
2533   "Equal",
2534 };
2535
2536 static const value_string mcsset_tx_max_spatial_streams_flags[] = {
2537   {0x00, "1 spatial stream"},
2538   {0x01, "2 spatial streams"},
2539   {0x02, "3 spatial streams"},
2540   {0x03, "4 spatial streams"},
2541   {0x04, "TX MCS Set Not Defined"},
2542   {0x00, NULL}
2543 };
2544
2545 static const value_string htex_transtime_flags[] = {
2546   {0x00, "No Transition"},
2547   {0x01, "400 usec"},
2548   {0x02, "1.5 msec"},
2549   {0x03, "5 msec"},
2550   {0x00, NULL}
2551 };
2552
2553 static const value_string htex_mcs_flags[] = {
2554   {0x00, "STA does not provide MCS feedback"},
2555   {0x01, "Reserved"},
2556   {0x02, "STA provides only unsolicited MCS feedback"},
2557   {0x03, "STA can provide MCS feedback in response to MRQ as well as unsolicited MCS feedback"},
2558   {0x00, NULL}
2559 };
2560
2561 static const value_string txbf_calib_flag[] = {
2562   {0x00, "incapable"},
2563   {0x01, "Limited involvement, cannot initiate"},
2564   {0x02, "Limited involvement, can initiate"},
2565   {0x03, "Fully capable"},
2566   {0x00, NULL}
2567 };
2568
2569 static const value_string txbf_feedback_flags[] = {
2570   {0x00, "not supported"},
2571   {0x01, "delayed feedback capable"},
2572   {0x02, "immediate feedback capable"},
2573   {0x03, "delayed and immediate feedback capable"},
2574   {0x00, NULL}
2575 };
2576
2577 static const value_string txbf_antenna_flags[] = {
2578   {0x00, "1 TX antenna sounding"},
2579   {0x01, "2 TX antenna sounding"},
2580   {0x02, "3 TX antenna sounding"},
2581   {0x03, "4 TX antenna sounding"},
2582   {0x00, NULL}
2583 };
2584
2585 static const value_string txbf_csi_max_rows_bf_flags[] = {
2586   {0x00, "1 row of CSI"},
2587   {0x01, "2 rows of CSI"},
2588   {0x02, "3 rows of CSI"},
2589   {0x03, "4 rows of CSI"},
2590   {0x00, NULL}
2591 };
2592
2593 static const value_string txbf_chan_est_flags[] = {
2594   {0x00, "1 space time stream"},
2595   {0x01, "2 space time streams"},
2596   {0x02, "3 space time streams"},
2597   {0x03, "4 space time streams"},
2598   {0x00, NULL}
2599 };
2600
2601 static const value_string txbf_min_group_flags[] = {
2602   {0x00, "No grouping supported"},
2603   {0x01, "Groups of 1,2 supported"},
2604   {0x02, "Groups of 1,4 supported"},
2605   {0x03, "Groups of 1,2,4 supported"},
2606   {0x00, NULL}
2607 };
2608
2609 static const value_string hta_ext_chan_offset_flag[] = {
2610   {0x00, "No Extension Channel"},
2611   {0x01, "Extension Channel above control channel"},
2612   {0x02, "Undefined"},
2613   {0x03, "Extension Channel below control channel"},
2614   {0x00, NULL}
2615 };
2616
2617 static const true_false_string hta_rec_tx_width_flag = {
2618   "Any channel width enabled",
2619   "Use 20MHz channel (control)"
2620 };
2621
2622 static const true_false_string hta_rifs_mode_flag = {
2623   "Use of RIFS permitted",
2624   "Use of RIFS prohibited"
2625 };
2626
2627 static const true_false_string hta_controlled_access_flag = {
2628   "Not only PSMP",
2629   "PSMP only"
2630 };
2631
2632 static const value_string hta_service_interval_flag[] = {
2633   {0x00, "5ms"},
2634   {0x01, "10ms"},
2635   {0x02, "15ms"},
2636   {0x03, "20ms"},
2637   {0x04, "25ms"},
2638   {0x05, "30ms"},
2639   {0x06, "35ms"},
2640   {0x07, "40ms"},
2641   {0x00, NULL}
2642 };
2643
2644 static const value_string hta_operating_mode_flag[] = {
2645   {0x00, "Pure HT, no protection"},
2646   {0x01, "There may be non-HT devices (control & ext channel)"},
2647   {0x02, "No non-HT is associated, but at least 1 20MHz is. protect on"},
2648   {0x03, "Mixed: no non-HT is associated, protect on"},
2649   {0x00, NULL}
2650 };
2651
2652 static const true_false_string hta_non_gf_devices_flag = {
2653   "All HT devices associated are GF capable",
2654   "One or More HT devices are not GF capable"
2655 };
2656
2657 static const true_false_string hta_dual_stbc_protection_flag = {
2658   "Dual CTS protections is used",
2659   "Regular use of RTS/CTS"
2660 };
2661
2662 static const true_false_string hta_secondary_beacon_flag = {
2663   "Secondary Beacon",
2664   "Primary Beacon"
2665 };
2666
2667 static const true_false_string hta_lsig_txop_protection_flag = {
2668   "Full Support",
2669   "Not full support"
2670 };
2671
2672 static const true_false_string hta_pco_active_flag = {
2673   "PCO is activated in the BSS",
2674   "PCO is not activated in the BSS"
2675 };
2676
2677 static const true_false_string hta_pco_phase_flag = {
2678   "Switch to 20MHz phase/keep 20MHz",
2679   "Switch to 40MHz phase/keep 40MHz"
2680 };
2681
2682 static const value_string ht_info_secondary_channel_offset_flags[] = {
2683   {0x00, "No secondary channel"},
2684   {0x01, "Secondary channel is above the primary channel"},
2685   {0x02, "Reserved"},
2686   {0x03, "Secondary channel is below the primary channel"},
2687   {0x00, NULL}
2688 };
2689
2690 static const true_false_string ht_info_channel_width_flag = {
2691   "Channel of any width supported",
2692   "20 MHz channel width only"
2693 };
2694
2695 static const true_false_string ht_info_rifs_mode_flag = {
2696   "Permitted",
2697   "Prohibited"
2698 };
2699
2700 static const true_false_string ht_info_psmp_stas_only_flag = {
2701   "Association requests are accepted from only PSMP capable STA",
2702   "Association requests are accepted regardless of PSMP capability"
2703 };
2704
2705 static const value_string ht_info_service_interval_granularity_flags[] = {
2706   {0x00, "5 ms"},
2707   {0x01, "10 ms"},
2708   {0x02, "15 ms"},
2709   {0x03, "20 ms"},
2710   {0x04, "25 ms"},
2711   {0x05, "30 ms"},
2712   {0x06, "35 ms"},
2713   {0x07, "40 ms"},
2714   {0x00, NULL}
2715 };
2716
2717 static const value_string ht_info_operating_mode_flags[] = {
2718   {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"},
2719   {0x01, "HT non-member protection mode"},
2720   {0x02, "Only HT STAs in the BSS, however, there exists at least one 20 MHz STA"},
2721   {0x03, "HT mixed mode"},
2722   {0x00, NULL}
2723 };
2724
2725 static const true_false_string ht_info_non_greenfield_sta_present_flag = {
2726   "One or more associated STAs are not greenfield capable",
2727   "All associated STAs are greenfield capable"
2728 };
2729
2730 static const true_false_string ht_info_transmit_burst_limit_flag = {
2731   "2.4 GHz - 6.16 ms | All other bands - 3.08 ms",
2732   "No limit"
2733 };
2734
2735 static const true_false_string ht_info_obss_non_ht_stas_present_flag = {
2736   "Use of protection for non-HT STAs by overlapping BSSs is needed",
2737   "Use of protection for non-HT STAs by overlapping BSSs is not needed"
2738 };
2739
2740 static const true_false_string ht_info_dual_beacon_flag = {
2741   "AP transmits a secondary beacon",
2742   "No second beacon is transmitted"
2743 };
2744
2745 static const true_false_string ht_info_dual_cts_protection_flag = {
2746   "Required",
2747   "Not required"
2748 };
2749
2750 static const true_false_string ht_info_secondary_beacon_flag = {
2751   "Secondary beacon",
2752   "Primary beacon"
2753 };
2754
2755 static const true_false_string ht_info_lsig_txop_protection_full_support_flag = {
2756   "All HT STAs in the BSS support L-SIG TXOP protection",
2757   "One or more HT STAs in the BSS do not support L-SIG TXOP protection"
2758 };
2759
2760 static const true_false_string ht_info_pco_phase_flag = {
2761   "Switch to or continue 40 MHz phase",
2762   "Switch to or continue 20 MHz phase"
2763 };
2764
2765 static const true_false_string htc_lac_trq_flag = {
2766   "Want sounding PPDU",
2767   "Don't want sounding PPDU"
2768 };
2769
2770 static const true_false_string htc_lac_mai_mrq_flag = {
2771   "MCS feedback requested",
2772   "No MCS feedback requested"
2773 };
2774
2775 static const value_string ieee80211_htc_lac_asel_command_flags[] = {
2776   {0x00, "Transmit Antenna Selection Sounding Indication (TXASSI)"},
2777   {0x01, "Transmit Antenna Selection Sounding Request (TXASSR)"},
2778   {0x02, "Receive Antenna Selection Sounding Indication (RXASSI)"},
2779   {0x03, "Receive Antenna Selection Sounding Request (RXASSR)"},
2780   {0x04, "Sounding Label"},
2781   {0x05, "No feedback, ASEL training failure"},
2782   {0x06, "Transmit Antenna Selection Sounding Indication (TXASSI) requesting feedback of explicit CSI"},
2783   {0x07, "Reserved"},
2784   {0x00, NULL}
2785 };
2786
2787 static const value_string ieee80211_htc_cal_pos_flags[] = {
2788   {0x00, "Not a calibration frame"},
2789   {0x01, "Calibration Start"},
2790   {0x02, "Sounding Response"},
2791   {0x03, "Sounding Complete"},
2792   {0x00, NULL}
2793 };
2794
2795 static const value_string ieee80211_htc_csi_steering_flags[] = {
2796   {0x00, "No feedback required"},
2797   {0x01, "CSI"},
2798   {0x02, "Non-compressed Beamforming Feedback Matrix"},
2799   {0x03, "Compressed Beamforming Feedback Matrix"},
2800   {0x00, NULL}
2801 };
2802
2803 static const true_false_string ieee80211_htc_ndp_announcement_flag = {
2804   "NDP will follow",
2805   "No NDP will follow"
2806 };
2807
2808 static const value_string ieee80211_htc_bw_recommended_vht_mcs_vals[] = {
2809   {0, "20 MHz"},
2810   {1, "40 MHz"},
2811   {2, "80 MHz"},
2812   {3, "160 MHz and 80+80 MHz"},
2813   {0, NULL}
2814 };
2815
2816 static const value_string ieee80211_htc_coding_type_vals[] = {
2817   {0, "BCC"},
2818   {1, "LDPC"},
2819   {0, NULL}
2820 };
2821
2822 static const value_string ieee80211_htc_fb_tx_type_vals[] = {
2823   {0, "Not beamformed"},
2824   {1, "Beamformed"},
2825   {0, NULL}
2826 };
2827
2828 static const value_string ieee80211_tag_secondary_channel_offset_flags[] = {
2829   {0x00, "No Secondary Channel"},
2830   {0x01, "Above Primary Channel"},
2831   {0x02, "Reserved"},
2832   {0x03, "Below Primary Channel"},
2833   {0x00, NULL}
2834 };
2835
2836 #define BSS_BITMASK_UP0   0x0001
2837 #define BSS_BITMASK_UP1   0x0002
2838 #define BSS_BITMASK_UP2   0x0004
2839 #define BSS_BITMASK_UP3   0x0008
2840 #define BSS_BITMASK_UP4   0x0010
2841 #define BSS_BITMASK_UP5   0x0020
2842 #define BSS_BITMASK_UP6   0x0040
2843 #define BSS_BITMASK_UP7   0x0080
2844 #define BSS_BITMASK_AC0   0x0100
2845 #define BSS_BITMASK_AC1   0x0200
2846 #define BSS_BITMASK_AC2   0x0400
2847 #define BSS_BITMASK_AC3   0x0800
2848 #define BSS_BITMASK_RSV   0xF000
2849
2850 static const value_string ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags[] = {
2851   {0x00, "Frames may be transmitted before the channel switch has been completed"},
2852   {0x01, "No more frames are to be transmitted until the channel switch has been completed"},
2853   {0x00, NULL}
2854 };
2855
2856 static const value_string service_interval_granularity_vals[] = {
2857   { 0, "5 ms" },
2858   { 1, "10 ms" },
2859   { 2, "15 ms" },
2860   { 3, "20 ms" },
2861   { 4, "25 ms" },
2862   { 5, "30 ms" },
2863   { 6, "35 ms" },
2864   { 7, "40 ms" },
2865   { 0x00, NULL }
2866 };
2867
2868 static const value_string wep_type_vals[] = {
2869   { AIRPDCAP_KEY_TYPE_WEP, STRING_KEY_TYPE_WEP },
2870   { AIRPDCAP_KEY_TYPE_WPA_PWD, STRING_KEY_TYPE_WPA_PWD },
2871   { AIRPDCAP_KEY_TYPE_WPA_PSK, STRING_KEY_TYPE_WPA_PSK },
2872   { 0x00, NULL }
2873 };
2874
2875 static const value_string ieee80211_ht_pren_type_vals[] = {
2876   { 51,  "HT Capabilities (802.11n D1.10)" },
2877   { 52,  "HT Additional Capabilities (802.11n D1.00)" },
2878   { 0, NULL }
2879 };
2880
2881 static const true_false_string ieee80211_cf_ssw_direction = {
2882   "Transmitted by the beamforming responder",
2883   "Transmitted by the beamforming initiator"
2884 };
2885
2886 static const value_string bss_type[] = {
2887   {0x0, "Reserved"},
2888   {0x1, "IBSS"},
2889   {0x2, "PBSS"},
2890   {0x3, "Infrastructure BSS"},
2891   {0,   NULL}
2892 };
2893
2894 static const value_string band_id[] = {
2895   {0x0, "TV white spaces"},
2896   {0x1, "Sub-1 GHZ (excluding TV white spaces)"},
2897   {0x2, "2.4 GHZ"},
2898   {0x3, "3.6 GHZ"},
2899   {0x4, "4.9 and 5 GHZ"},
2900   {0x5, "60 GHZ"},
2901   {0,   NULL}
2902 };
2903
2904 static const value_string allocation_type[] = {
2905   {0x0, "SP Allocation"},
2906   {0x4, "CBAP allocation"},
2907   {0,   NULL}
2908 };
2909
2910 static const value_string vht_operation_info_channel_width[] = {
2911   {0x00, "20MHz or 40MHz"},
2912   {0x01, "80MHZ"},
2913   {0x10, "160MHz"},
2914   {0x11, "80MHz+80MHz"},
2915   {0, NULL}
2916 };
2917 static const value_string operating_mode_field_channel_width[] = {
2918   {0x00, "20MHz"},
2919   {0x01, "40MHZ"},
2920   {0x02, "80MHz"},
2921   {0x03, "160MHz or 80MHz+80MHz"},
2922   {0, NULL}
2923 };
2924
2925 static const value_string operat_mode_field_rxnss[] = {
2926   {0x0, "1Nss"},
2927   {0x1, "2Nss"},
2928   {0x2, "3Nss"},
2929   {0x3, "4Nss"},
2930   {0x4, "5Nss"},
2931   {0x5, "6Nss"},
2932   {0x6, "7Nss"},
2933   {0x7, "8Nss"},
2934   {0, NULL}
2935 };
2936
2937 #define VHT_ACT_VHT_COMPRESSED_BEAMFORMING  0
2938 #define VHT_ACT_GROUP_ID_MANAGEMENT         1
2939 #define VHT_ACT_OPERATION_MODE_NOTIFICATION 2
2940
2941 static const value_string vht_action_vals[] = {
2942   {VHT_ACT_VHT_COMPRESSED_BEAMFORMING, "VHT Compressed Beamforming"},
2943   {VHT_ACT_GROUP_ID_MANAGEMENT, "Group ID Management"},
2944   {VHT_ACT_OPERATION_MODE_NOTIFICATION, "Operating Mode Notification"},
2945   {0,   NULL}
2946 };
2947
2948 static const value_string ff_vht_mimo_cntrl_nc_index_vals[] = {
2949   {0x00, "1 Column"},
2950   {0x01, "2 Columns"},
2951   {0x02, "3 Columns"},
2952   {0x03, "4 Columns"},
2953   {0x04, "5 Columns"},
2954   {0x05, "6 Columns"},
2955   {0x06, "7 Columns"},
2956   {0x07, "8 Columns"},
2957   {0, NULL}
2958 };
2959
2960 static const value_string ff_vht_mimo_cntrl_nr_index_vals[] = {
2961   {0x00, "1 Row"},
2962   {0x01, "2 Rows"},
2963   {0x02, "3 Rows"},
2964   {0x03, "4 Rows"},
2965   {0x04, "5 Rows"},
2966   {0x05, "6 Rows"},
2967   {0x06, "7 Rows"},
2968   {0x07, "8 Rows"},
2969   {0, NULL}
2970 };
2971
2972 static const value_string ff_vht_mimo_cntrl_channel_width_vals[] = {
2973   {0x00, "20 MHz"},
2974   {0x01, "40 MHz"},
2975   {0x02, "80 MHz"},
2976   {0x03, "160 MHz / 80+80 Mhz"},
2977   {0, NULL}
2978 };
2979
2980 static const value_string ff_vht_mimo_cntrl_grouping_vals[] = {
2981   {0x00, "1 (No Grouping)"},
2982   {0x01, "2"},
2983   {0x02, "4"},
2984   {0x03, "Reserved"},
2985   {0, NULL}
2986 };
2987
2988 static const value_string ff_vht_mimo_cntrl_feedback_vals[] = {
2989   {0x00, "SU"},
2990   {0x01, "MU"},
2991   {0, NULL}
2992 };
2993
2994
2995 static int proto_wlan = -1;
2996 static int proto_centrino = -1;
2997 static int proto_aggregate = -1;
2998 static gboolean ieee80211_tvb_invalid = FALSE;
2999
3000 /* ************************************************************************* */
3001 /*                Header field info values for FC-field                      */
3002 /* ************************************************************************* */
3003 static int hf_ieee80211_fc_field = -1;
3004 static int hf_ieee80211_fc_proto_version = -1;
3005 static int hf_ieee80211_fc_frame_type = -1;
3006 static int hf_ieee80211_fc_frame_subtype = -1;
3007 static int hf_ieee80211_fc_frame_extension = -1;
3008 static int hf_ieee80211_fc_frame_type_subtype = -1;
3009
3010 static int hf_ieee80211_fc_flags = -1;
3011 static int hf_ieee80211_fc_to_ds = -1;
3012 static int hf_ieee80211_fc_from_ds = -1;
3013 static int hf_ieee80211_fc_data_ds = -1;
3014
3015 static int hf_ieee80211_fc_more_frag = -1;
3016 static int hf_ieee80211_fc_retry = -1;
3017 static int hf_ieee80211_fc_pwr_mgt = -1;
3018 static int hf_ieee80211_fc_more_data = -1;
3019 static int hf_ieee80211_fc_protected = -1;
3020 static int hf_ieee80211_fc_order = -1;
3021
3022 typedef struct retransmit_key {
3023   guint8  bssid[6];
3024   guint8  src[6];
3025   guint16 seq_control;
3026   guint   fnum;
3027 } retransmit_key;
3028
3029 static GHashTable *fc_analyse_retransmit_table = NULL;
3030 static GHashTable *fc_first_frame_table = NULL;
3031
3032 static int hf_ieee80211_fc_analysis_retransmission = -1;
3033 static int hf_ieee80211_fc_analysis_retransmission_frame = -1;
3034
3035 /* ************************************************************************* */
3036 /*                   Header values for Duration/ID field                     */
3037 /* ************************************************************************* */
3038 static int hf_ieee80211_did_duration = -1;
3039 static int hf_ieee80211_assoc_id = -1;
3040
3041 /* ************************************************************************* */
3042 /*         Header values for different address-fields (all 4 of them)        */
3043 /* ************************************************************************* */
3044 static int hf_ieee80211_addr_da = -1;  /* Destination address subfield */
3045 static int hf_ieee80211_addr_da_resolved = -1;  /* Dst addr subfield resolved*/
3046 static int hf_ieee80211_addr_sa = -1;  /* Source address subfield */
3047 static int hf_ieee80211_addr_sa_resolved = -1;  /* Src addr subfield resolved*/
3048 static int hf_ieee80211_addr_ra = -1;  /* Receiver address subfield */
3049 static int hf_ieee80211_addr_ra_resolved = -1;  /* Rcv addr subfield resolved*/
3050 static int hf_ieee80211_addr_ta = -1;  /* Transmitter address subfield */
3051 static int hf_ieee80211_addr_ta_resolved = -1;  /* Txm addr subfield resolved*/
3052 static int hf_ieee80211_addr_bssid = -1;  /* address is bssid */
3053 static int hf_ieee80211_addr_bssid_resolved = -1;  /* bssid resolved*/
3054 static int hf_ieee80211_addr_staa = -1;  /* address is station address */
3055 static int hf_ieee80211_addr_staa_resolved = -1;  /* station address resolved*/
3056
3057 static int hf_ieee80211_addr = -1;  /* Source or destination address subfield */
3058 static int hf_ieee80211_addr_resolved = -1;/*Src/dst address subfield resolved*/
3059
3060 /* ************************************************************************* */
3061 /*                Header values for QoS control field                        */
3062 /* ************************************************************************* */
3063 static int hf_ieee80211_qos = -1;
3064 static int hf_ieee80211_qos_tid = -1;
3065 static int hf_ieee80211_qos_priority = -1;
3066 static int hf_ieee80211_qos_ack_policy = -1;
3067 static int hf_ieee80211_qos_amsdu_present = -1;
3068 static int hf_ieee80211_qos_eosp = -1;
3069 static int hf_ieee80211_qos_bit4 = -1;
3070 static int hf_ieee80211_qos_txop_limit = -1;
3071 static int hf_ieee80211_qos_ps_buf_state = -1;
3072 static int hf_ieee80211_qos_buf_state_indicated = -1;
3073 static int hf_ieee80211_qos_highest_pri_buf_ac = -1;
3074 static int hf_ieee80211_qos_qap_buf_load = -1;
3075 static int hf_ieee80211_qos_txop_dur_req = -1;
3076 static int hf_ieee80211_qos_queue_size = -1;
3077
3078 /* ************************************************************************* */
3079 /*                Header values for HT control field (+HTC)                  */
3080 /* ************************************************************************* */
3081 /* 802.11-2012 and 802.11ac-2013 8.2.4.6 */
3082 static int hf_ieee80211_htc = -1;
3083 static int hf_ieee80211_htc_vht = -1;
3084 static int hf_ieee80211_htc_lac = -1;
3085 static int hf_ieee80211_htc_lac_trq = -1;
3086 static int hf_ieee80211_htc_lac_mai_aseli = -1;
3087 static int hf_ieee80211_htc_lac_mai_mrq = -1;
3088 static int hf_ieee80211_htc_lac_mai_msi = -1;
3089 static int hf_ieee80211_htc_lac_mai_reserved = -1;
3090 static int hf_ieee80211_htc_lac_mfsi = -1;
3091 static int hf_ieee80211_htc_lac_mfb = -1;
3092 static int hf_ieee80211_htc_lac_asel_command = -1;
3093 static int hf_ieee80211_htc_lac_asel_data = -1;
3094 static int hf_ieee80211_htc_cal_pos = -1;
3095 static int hf_ieee80211_htc_cal_seq = -1;
3096 static int hf_ieee80211_htc_reserved1 = -1;
3097 static int hf_ieee80211_htc_csi_steering = -1;
3098 static int hf_ieee80211_htc_ndp_announcement = -1;
3099 static int hf_ieee80211_htc_reserved2 = -1;
3100 static int hf_ieee80211_htc_mrq = -1;
3101 static int hf_ieee80211_htc_msi = -1;
3102 static int hf_ieee80211_htc_msi_stbc_reserved = -1;
3103 static int hf_ieee80211_htc_compressed_msi = -1;
3104 static int hf_ieee80211_htc_ppdu_stbc_encoded = -1;
3105 static int hf_ieee80211_htc_mfsi = -1;
3106 static int hf_ieee80211_htc_gid_l = -1;
3107 static int hf_ieee80211_htc_mfb = -1;
3108 static int hf_ieee80211_htc_num_sts = -1;
3109 static int hf_ieee80211_htc_vht_mcs = -1;
3110 static int hf_ieee80211_htc_bw = -1;
3111 static int hf_ieee80211_htc_snr = -1;
3112 static int hf_ieee80211_htc_reserved3 = -1;
3113 static int hf_ieee80211_htc_gid_h = -1;
3114 static int hf_ieee80211_htc_coding_type = -1;
3115 static int hf_ieee80211_htc_fb_tx_type = -1;
3116 static int hf_ieee80211_htc_unsolicited_mfb = -1;
3117 static int hf_ieee80211_htc_ac_constraint = -1;
3118 static int hf_ieee80211_htc_rdg_more_ppdu = -1;
3119
3120 /* ************************************************************************* */
3121 /*                Header values for sequence number field                    */
3122 /* ************************************************************************* */
3123 static int hf_ieee80211_frag_number = -1;
3124 static int hf_ieee80211_seq_number = -1;
3125
3126 /* ************************************************************************* */
3127 /*                   Header values for Frame Check field                     */
3128 /* ************************************************************************* */
3129 static int hf_ieee80211_fcs = -1;
3130 static int hf_ieee80211_fcs_good = -1;
3131 static int hf_ieee80211_fcs_bad = -1;
3132
3133 /* ************************************************************************* */
3134 /*                   Header values for reassembly                            */
3135 /* ************************************************************************* */
3136 static int hf_ieee80211_fragments = -1;
3137 static int hf_ieee80211_fragment = -1;
3138 static int hf_ieee80211_fragment_overlap = -1;
3139 static int hf_ieee80211_fragment_overlap_conflict = -1;
3140 static int hf_ieee80211_fragment_multiple_tails = -1;
3141 static int hf_ieee80211_fragment_too_long_fragment = -1;
3142 static int hf_ieee80211_fragment_error = -1;
3143 static int hf_ieee80211_fragment_count = -1;
3144 static int hf_ieee80211_reassembled_in = -1;
3145 static int hf_ieee80211_reassembled_length = -1;
3146
3147 static int proto_wlan_mgt = -1;
3148 static int proto_wlan_ext = -1;
3149
3150 /* ************************************************************************* */
3151 /*                      Fixed fields found in mgt frames                     */
3152 /* ************************************************************************* */
3153 static int hf_ieee80211_fixed_parameters = -1;  /* Protocol payload for management frames */
3154
3155 static int hf_ieee80211_ff_auth_alg = -1;            /* Authentication algorithm field            */
3156 static int hf_ieee80211_ff_auth_seq = -1;            /* Authentication transaction sequence       */
3157 static int hf_ieee80211_ff_current_ap = -1;          /* Current AP MAC address                    */
3158 static int hf_ieee80211_ff_listen_ival = -1;         /* Listen interval fixed field               */
3159 static int hf_ieee80211_ff_timestamp = -1;           /* 64 bit timestamp                          */
3160 static int hf_ieee80211_ff_beacon_interval = -1;     /* 16 bit Beacon interval                    */
3161 static int hf_ieee80211_ff_assoc_id = -1;            /* 16 bit AID field                          */
3162 static int hf_ieee80211_ff_reason = -1;              /* 16 bit reason code                        */
3163 static int hf_ieee80211_ff_status_code = -1;         /* Status code                               */
3164 static int hf_ieee80211_ff_category_code = -1;       /* 8 bit Category code */
3165 static int hf_ieee80211_ff_action_code = -1;         /* 8 bit Action code */
3166 static int hf_ieee80211_ff_dialog_token = -1;        /* 8 bit Dialog token */
3167 static int hf_ieee80211_ff_followup_dialog_token = -1;
3168 static int hf_ieee80211_ff_wme_action_code = -1;     /* Management notification action code */
3169 static int hf_ieee80211_ff_wme_status_code = -1;     /* Management notification setup response status code */
3170 static int hf_ieee80211_ff_qos_action_code = -1;
3171 static int hf_ieee80211_ff_dls_action_code = -1;
3172 static int hf_ieee80211_ff_dst_mac_addr = -1;        /* DLS destination MAC addressi */
3173 static int hf_ieee80211_ff_src_mac_addr = -1;        /* DLS source MAC addressi */
3174 static int hf_ieee80211_ff_req_ap_addr = -1;
3175 static int hf_ieee80211_ff_res_ap_addr = -1;
3176 static int hf_ieee80211_ff_check_beacon = -1;
3177 static int hf_ieee80211_ff_dls_timeout = -1;         /* DLS timeout value */
3178 static int hf_ieee80211_ff_ft_action_code = -1; /* 8 bit FT Action code */
3179 static int hf_ieee80211_ff_sta_address = -1;
3180 static int hf_ieee80211_ff_target_ap_address = -1;
3181 static int hf_ieee80211_ff_gas_comeback_delay = -1;
3182 static int hf_ieee80211_ff_gas_fragment_id = -1;
3183 static int hf_ieee80211_ff_more_gas_fragments = -1;
3184 static int hf_ieee80211_ff_query_request_length = -1;
3185 static int hf_ieee80211_ff_query_request = -1;
3186 static int hf_ieee80211_ff_query_response_length = -1;
3187 static int hf_ieee80211_ff_query_response = -1;
3188 static int hf_ieee80211_ff_anqp_info_id = -1;
3189 static int hf_ieee80211_ff_anqp_info_length = -1;
3190 static int hf_ieee80211_ff_anqp_info = -1;
3191 static int hf_ieee80211_ff_anqp_query_id = -1;
3192 static int hf_ieee80211_ff_anqp_capability = -1;
3193 static int hf_ieee80211_ff_anqp_capability_vlen = -1;
3194 static int hf_ieee80211_ff_anqp_capability_vendor = -1;
3195 static int hf_ieee80211_ff_venue_info_group = -1;
3196 static int hf_ieee80211_ff_venue_info_type = -1;
3197 static int hf_ieee80211_ff_anqp_venue_length = -1;
3198 static int hf_ieee80211_ff_anqp_venue_language = -1;
3199 static int hf_ieee80211_ff_anqp_venue_name = -1;
3200 static int hf_ieee80211_ff_anqp_nw_auth_type_indicator = -1;
3201 static int hf_ieee80211_ff_anqp_nw_auth_type_url_len = -1;
3202 static int hf_ieee80211_ff_anqp_nw_auth_type_url = -1;
3203 static int hf_ieee80211_ff_anqp_roaming_consortium_oi_len = -1;
3204 static int hf_ieee80211_ff_anqp_roaming_consortium_oi = -1;
3205 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv6 = -1;
3206 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv4 = -1;
3207 static int hf_ieee80211_ff_anqp_nai_realm_count = -1;
3208 static int hf_ieee80211_ff_anqp_nai_field_len = -1;
3209 static int hf_ieee80211_ff_anqp_nai_realm_encoding = -1;
3210 static int hf_ieee80211_ff_anqp_nai_realm_length = -1;
3211 static int hf_ieee80211_ff_anqp_nai_realm = -1;
3212 static int hf_ieee80211_ff_anqp_nai_realm_eap_count = -1;
3213 static int hf_ieee80211_ff_anqp_nai_realm_eap_len = -1;
3214 static int hf_ieee80211_ff_anqp_nai_realm_eap_method = -1;
3215 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_count = -1;
3216 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_id = -1;
3217 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_len = -1;
3218 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_value = -1;
3219 static int hf_ieee80211_3gpp_gc_gud = -1;
3220 static int hf_ieee80211_3gpp_gc_udhl = -1;
3221 static int hf_ieee80211_3gpp_gc_iei = -1;
3222 static int hf_ieee80211_3gpp_gc_num_plmns = -1;
3223 static int hf_ieee80211_3gpp_gc_plmn_len = -1;
3224 static int hf_ieee80211_ff_anqp_domain_name_len = -1;
3225 static int hf_ieee80211_ff_anqp_domain_name = -1;
3226 static int hf_ieee80211_ff_tdls_action_code = -1;
3227 static int hf_ieee80211_ff_target_channel = -1;
3228 static int hf_ieee80211_ff_operating_class = -1;
3229 static int hf_ieee80211_ff_wnm_action_code = -1;
3230 static int hf_ieee80211_ff_unprotected_wnm_action_code = -1;
3231 static int hf_ieee80211_ff_key_data_length = -1;
3232 static int hf_ieee80211_ff_key_data = -1;
3233 static int hf_ieee80211_ff_wnm_notification_type = -1;
3234 static int hf_ieee80211_ff_rm_action_code = -1;
3235 static int hf_ieee80211_ff_rm_dialog_token = -1;
3236 static int hf_ieee80211_ff_rm_repetitions = -1;
3237 static int hf_ieee80211_ff_rm_tx_power = -1;
3238 static int hf_ieee80211_ff_rm_max_tx_power = -1;
3239 static int hf_ieee80211_ff_tpc = -1;
3240 static int hf_ieee80211_ff_tpc_element_id = -1;
3241 static int hf_ieee80211_ff_tpc_length = -1;
3242 static int hf_ieee80211_ff_tpc_tx_power = -1;
3243 static int hf_ieee80211_ff_tpc_link_margin = -1;
3244 static int hf_ieee80211_ff_rm_rx_antenna_id = -1;
3245 static int hf_ieee80211_ff_rm_tx_antenna_id = -1;
3246 static int hf_ieee80211_ff_rm_rcpi = -1;
3247 static int hf_ieee80211_ff_rm_rsni = -1;
3248 static int hf_ieee80211_ff_request_mode_pref_cand = -1;
3249 static int hf_ieee80211_ff_request_mode_abridged = -1;
3250 static int hf_ieee80211_ff_request_mode_disassoc_imminent = -1;
3251 static int hf_ieee80211_ff_request_mode_bss_term_included = -1;
3252 static int hf_ieee80211_ff_request_mode_ess_disassoc_imminent = -1;
3253 static int hf_ieee80211_ff_disassoc_timer = -1;
3254 static int hf_ieee80211_ff_validity_interval = -1;
3255 static int hf_ieee80211_ff_bss_termination_duration = -1;
3256 static int hf_ieee80211_ff_url_len = -1;
3257 static int hf_ieee80211_ff_url = -1;
3258 static int hf_ieee80211_ff_bss_transition_candidate_list_entries = -1;
3259
3260 static int hf_ieee80211_ff_sa_query_action_code = -1;
3261 static int hf_ieee80211_ff_transaction_id = -1;
3262
3263 /* Vendor specific */
3264 static int hf_ieee80211_ff_marvell_action_type = -1;
3265 static int hf_ieee80211_ff_marvell_mesh_mgt_action_code = -1;
3266 static int hf_ieee80211_ff_marvell_mesh_mgt_length = -1;     /* Mesh Management length */
3267 static int hf_ieee80211_ff_marvell_mesh_mgt_mode = -1;       /* Mesh Management mode */
3268 static int hf_ieee80211_ff_marvell_mesh_mgt_ttl = -1;        /* Mesh Management TTL */
3269 static int hf_ieee80211_ff_marvell_mesh_mgt_dstcount = -1;   /* Mesh Management dst count */
3270 static int hf_ieee80211_ff_marvell_mesh_mgt_hopcount = -1;   /* Mesh Management hop count */
3271 static int hf_ieee80211_ff_marvell_mesh_mgt_rreqid = -1;     /* Mesh Management RREQ ID */
3272 static int hf_ieee80211_ff_marvell_mesh_mgt_sa = -1;         /* Mesh Management src addr */
3273 static int hf_ieee80211_ff_marvell_mesh_mgt_ssn = -1;        /* Mesh Management src sequence number */
3274 static int hf_ieee80211_ff_marvell_mesh_mgt_metric = -1;     /* Mesh Management metric */
3275 static int hf_ieee80211_ff_marvell_mesh_mgt_flags = -1;      /* Mesh Management RREQ flags */
3276 static int hf_ieee80211_ff_marvell_mesh_mgt_da = -1;         /* Mesh Management dst addr */
3277 static int hf_ieee80211_ff_marvell_mesh_mgt_dsn = -1;        /* Mesh Management dst sequence number */
3278 static int hf_ieee80211_ff_marvell_mesh_mgt_lifetime = -1;   /* Mesh Management lifetime */
3279
3280
3281 static int hf_ieee80211_ff_ba_action = -1;
3282
3283 static int hf_ieee80211_ff_block_ack_params = -1;
3284 static int hf_ieee80211_ff_block_ack_params_amsdu_permitted = -1;
3285 static int hf_ieee80211_ff_block_ack_params_policy = -1;
3286 static int hf_ieee80211_ff_block_ack_params_tid = -1;
3287 static int hf_ieee80211_ff_block_ack_params_buffer_size = -1;
3288
3289 static const int *ieee80211_ff_block_ack_params_fields[] = {
3290   &hf_ieee80211_ff_block_ack_params_amsdu_permitted,
3291   &hf_ieee80211_ff_block_ack_params_policy,
3292   &hf_ieee80211_ff_block_ack_params_tid,
3293   &hf_ieee80211_ff_block_ack_params_buffer_size,
3294   NULL
3295 };
3296
3297 static int hf_ieee80211_ff_block_ack_timeout = -1;
3298
3299 static int hf_ieee80211_ff_block_ack_ssc = -1;
3300 static int hf_ieee80211_ff_block_ack_ssc_fragment = -1;
3301 static int hf_ieee80211_ff_block_ack_ssc_sequence = -1;
3302
3303 static const int *ieee80211_ff_block_ack_ssc_fields[] = {
3304   &hf_ieee80211_ff_block_ack_ssc_fragment,
3305   &hf_ieee80211_ff_block_ack_ssc_sequence,
3306   NULL
3307 };
3308
3309 static int hf_ieee80211_ff_delba_param = -1;
3310 static int hf_ieee80211_ff_delba_param_reserved = -1;
3311 static int hf_ieee80211_ff_delba_param_init = -1;
3312 static int hf_ieee80211_ff_delba_param_tid = -1;
3313
3314 static const int *ieee80211_ff_delba_param_fields[] = {
3315   &hf_ieee80211_ff_delba_param_reserved,
3316   &hf_ieee80211_ff_delba_param_init,
3317   &hf_ieee80211_ff_delba_param_tid,
3318   NULL
3319 };
3320
3321 static int hf_ieee80211_ff_max_reg_pwr = -1;
3322 static int hf_ieee80211_ff_measurement_pilot_int = -1;
3323 static int hf_ieee80211_ff_country_str = -1;
3324 static int hf_ieee80211_ff_max_tx_pwr = -1;
3325 static int hf_ieee80211_ff_tx_pwr_used = -1;
3326 static int hf_ieee80211_ff_transceiver_noise_floor = -1;
3327 static int hf_ieee80211_ff_channel_width = -1;
3328
3329 static int hf_ieee80211_ff_qos_info_ap = -1;
3330 static int hf_ieee80211_ff_qos_info_ap_edca_param_set_counter = -1;
3331 static int hf_ieee80211_ff_qos_info_ap_q_ack = -1;
3332 static int hf_ieee80211_ff_qos_info_ap_queue_req = -1;
3333 static int hf_ieee80211_ff_qos_info_ap_txop_request = -1;
3334 static int hf_ieee80211_ff_qos_info_ap_reserved = -1;
3335
3336 static const int *ieee80211_ff_qos_info_ap_fields[] = {
3337   &hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
3338   &hf_ieee80211_ff_qos_info_ap_q_ack,
3339   &hf_ieee80211_ff_qos_info_ap_queue_req,
3340   &hf_ieee80211_ff_qos_info_ap_txop_request,
3341   &hf_ieee80211_ff_qos_info_ap_reserved,
3342   NULL
3343 };
3344
3345 static int hf_ieee80211_ff_qos_info_sta = -1;
3346 static int hf_ieee80211_ff_qos_info_sta_ac_vo = -1;
3347 static int hf_ieee80211_ff_qos_info_sta_ac_vi = -1;
3348 static int hf_ieee80211_ff_qos_info_sta_ac_bk = -1;
3349 static int hf_ieee80211_ff_qos_info_sta_ac_be = -1;
3350 static int hf_ieee80211_ff_qos_info_sta_q_ack = -1;
3351 static int hf_ieee80211_ff_qos_info_sta_max_sp_length = -1;
3352 static int hf_ieee80211_ff_qos_info_sta_more_data_ack = -1;
3353
3354 static const int *ieee80211_ff_qos_info_sta_fields[] = {
3355   &hf_ieee80211_ff_qos_info_sta_ac_vo,
3356   &hf_ieee80211_ff_qos_info_sta_ac_vi,
3357   &hf_ieee80211_ff_qos_info_sta_ac_bk,
3358   &hf_ieee80211_ff_qos_info_sta_ac_be,
3359   &hf_ieee80211_ff_qos_info_sta_q_ack,
3360   &hf_ieee80211_ff_qos_info_sta_max_sp_length,
3361   &hf_ieee80211_ff_qos_info_sta_more_data_ack,
3362   NULL
3363 };
3364
3365 static int hf_ieee80211_ff_sm_pwr_save = -1;
3366 static int hf_ieee80211_ff_sm_pwr_save_enabled = -1;
3367 static int hf_ieee80211_ff_sm_pwr_save_sm_mode = -1;
3368 static int hf_ieee80211_ff_sm_pwr_save_reserved = -1;
3369
3370 static const int *ieee80211_ff_sw_pwr_save_fields[] = {
3371   &hf_ieee80211_ff_sm_pwr_save_enabled,
3372   &hf_ieee80211_ff_sm_pwr_save_sm_mode,
3373   &hf_ieee80211_ff_sm_pwr_save_reserved,
3374   NULL
3375 };
3376
3377 static int hf_ieee80211_ff_pco_phase_cntrl = -1;
3378
3379 static int hf_ieee80211_ff_psmp_param_set = -1;
3380 static int hf_ieee80211_ff_psmp_param_set_n_sta = -1;
3381 static int hf_ieee80211_ff_psmp_param_set_more_psmp = -1;
3382 static int hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration = -1;
3383
3384 static const int *ieee80211_ff_psmp_param_set_fields[] = {
3385   &hf_ieee80211_ff_psmp_param_set_n_sta,
3386   &hf_ieee80211_ff_psmp_param_set_more_psmp,
3387   &hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
3388   NULL
3389 };
3390
3391 static int hf_ieee80211_ff_mimo_cntrl = -1;
3392 static int hf_ieee80211_ff_mimo_cntrl_nc_index = -1;
3393 static int hf_ieee80211_ff_mimo_cntrl_nr_index = -1;
3394 static int hf_ieee80211_ff_mimo_cntrl_channel_width = -1;
3395 static int hf_ieee80211_ff_mimo_cntrl_grouping = -1;
3396 static int hf_ieee80211_ff_mimo_cntrl_coefficient_size = -1;
3397 static int hf_ieee80211_ff_mimo_cntrl_codebook_info = -1;
3398 static int hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment = -1;
3399 static int hf_ieee80211_ff_mimo_cntrl_reserved = -1;
3400 static int hf_ieee80211_ff_mimo_cntrl_sounding_timestamp = -1;
3401
3402 static int hf_ieee80211_ff_ant_selection = -1;
3403 static int hf_ieee80211_ff_ant_selection_0 = -1;
3404 static int hf_ieee80211_ff_ant_selection_1 = -1;
3405 static int hf_ieee80211_ff_ant_selection_2 = -1;
3406 static int hf_ieee80211_ff_ant_selection_3 = -1;
3407 static int hf_ieee80211_ff_ant_selection_4 = -1;
3408 static int hf_ieee80211_ff_ant_selection_5 = -1;
3409 static int hf_ieee80211_ff_ant_selection_6 = -1;
3410 static int hf_ieee80211_ff_ant_selection_7 = -1;
3411
3412 static const int *ieee80211_ff_ant_selection_fields[] = {
3413   &hf_ieee80211_ff_ant_selection_0,
3414   &hf_ieee80211_ff_ant_selection_1,
3415   &hf_ieee80211_ff_ant_selection_2,
3416   &hf_ieee80211_ff_ant_selection_3,
3417   &hf_ieee80211_ff_ant_selection_4,
3418   &hf_ieee80211_ff_ant_selection_5,
3419   &hf_ieee80211_ff_ant_selection_6,
3420   &hf_ieee80211_ff_ant_selection_7,
3421   NULL
3422 };
3423
3424 static int hf_ieee80211_ff_ext_channel_switch_announcement = -1;
3425 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode = -1;
3426 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class = -1;
3427 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number = -1;
3428 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_count = -1;
3429
3430 static const int *ieee80211_ff_ext_channel_switch_announcement_fields[] = {
3431   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
3432   &hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
3433   &hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
3434   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
3435   NULL
3436 };
3437
3438 static int hf_ieee80211_ff_ht_info = -1;
3439 static int hf_ieee80211_ff_ht_info_information_request = -1;
3440 static int hf_ieee80211_ff_ht_info_40_mhz_intolerant = -1;
3441 static int hf_ieee80211_ff_ht_info_sta_chan_width = -1;
3442 static int hf_ieee80211_ff_ht_info_reserved = -1;
3443
3444 static const int *ieee80211_ff_ht_info_fields[] = {
3445   &hf_ieee80211_ff_ht_info_information_request,
3446   &hf_ieee80211_ff_ht_info_40_mhz_intolerant,
3447   &hf_ieee80211_ff_ht_info_sta_chan_width,
3448   &hf_ieee80211_ff_ht_info_reserved,
3449   NULL
3450 };
3451
3452 static int hf_ieee80211_ff_ht_action = -1;
3453
3454 static int hf_ieee80211_ff_psmp_sta_info = -1;
3455 static int hf_ieee80211_ff_psmp_sta_info_type = -1;
3456 static int hf_ieee80211_ff_psmp_sta_info_dtt_start_offset = -1;
3457 static int hf_ieee80211_ff_psmp_sta_info_dtt_duration = -1;
3458 static int hf_ieee80211_ff_psmp_sta_info_sta_id = -1;
3459 static int hf_ieee80211_ff_psmp_sta_info_utt_start_offset = -1;
3460 static int hf_ieee80211_ff_psmp_sta_info_utt_duration = -1;
3461 static int hf_ieee80211_ff_psmp_sta_info_reserved_small= -1;
3462 static int hf_ieee80211_ff_psmp_sta_info_reserved_large = -1;
3463 static int hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id = -1;
3464
3465 static int hf_ieee80211_ff_mimo_csi_snr = -1;
3466 static int hf_ieee80211_ff_mimo_csi_matrices = -1;
3467 static int hf_ieee80211_ff_mimo_csi_bf_matrices = -1;
3468 static int hf_ieee80211_ff_mimo_csi_cbf_matrices = -1;
3469
3470 /*** Begin: 802.11s additions ***/
3471 static int hf_ieee80211_mesh_control_field = -1;
3472
3473 static int hf_ieee80211_ff_mesh_action = -1;
3474 static int hf_ieee80211_ff_multihop_action = -1;
3475 static int hf_ieee80211_ff_mesh_flags = -1;
3476 static int hf_ieee80211_ff_mesh_ttl = -1;
3477 static int hf_ieee80211_ff_mesh_sequence = -1;
3478 static int hf_ieee80211_ff_mesh_addr4 = -1;
3479 static int hf_ieee80211_ff_mesh_addr5 = -1;
3480 static int hf_ieee80211_ff_mesh_addr6 = -1;
3481 static int hf_ieee80211_ff_selfprot_action = -1;
3482
3483 static int hf_ieee80211_mesh_peering_proto = -1;
3484 static int hf_ieee80211_mesh_peering_local_link_id = -1;
3485 static int hf_ieee80211_mesh_peering_peer_link_id = -1;
3486
3487 static int hf_ieee80211_ff_hwmp_flags = -1;
3488 static int hf_ieee80211_ff_hwmp_hopcount = -1;
3489 static int hf_ieee80211_ff_hwmp_ttl = -1;
3490 static int hf_ieee80211_ff_hwmp_pdid = -1;
3491 static int hf_ieee80211_ff_hwmp_orig_sta = -1;
3492 static int hf_ieee80211_ff_hwmp_orig_sn = -1;
3493 static int hf_ieee80211_ff_hwmp_orig_ext = -1;
3494 static int hf_ieee80211_ff_hwmp_lifetime = -1;
3495 static int hf_ieee80211_ff_hwmp_metric = -1;
3496 static int hf_ieee80211_ff_hwmp_targ_count = -1;
3497 static int hf_ieee80211_ff_hwmp_targ_flags = -1;
3498 static int hf_ieee80211_ff_hwmp_targ_to_flags = -1;
3499 static int hf_ieee80211_ff_hwmp_targ_usn_flags = -1;
3500 static int hf_ieee80211_ff_hwmp_targ_sta = -1;
3501 static int hf_ieee80211_ff_hwmp_targ_sn = -1;
3502 static int hf_ieee80211_ff_hwmp_targ_ext = -1;
3503 static int hf_ieee80211_rann_flags = -1;
3504 static int hf_ieee80211_rann_root_sta = -1;
3505 static int hf_ieee80211_rann_sn = -1;
3506 static int hf_ieee80211_rann_interval = -1;
3507
3508 static int hf_ieee80211_mesh_channel_switch_ttl = -1;
3509 static int hf_ieee80211_mesh_channel_switch_flag = -1;
3510 static int hf_ieee80211_mesh_channel_switch_reason_code = -1;
3511 static int hf_ieee80211_mesh_channel_switch_precedence_value = -1;
3512 static int hf_ieee80211_mesh_chswitch_flag_txrestrict = -1;
3513 static int hf_ieee80211_mesh_chswitch_flag_initiator = -1;
3514
3515 static int hf_ieee80211_mesh_config_path_sel_protocol = -1;
3516 static int hf_ieee80211_mesh_config_path_sel_metric = -1;
3517 static int hf_ieee80211_mesh_config_congestion_control = -1;
3518 static int hf_ieee80211_mesh_config_sync_method = -1;
3519 static int hf_ieee80211_mesh_config_auth_protocol = -1;
3520 static int hf_ieee80211_mesh_config_formation_info = -1;
3521 static int hf_ieee80211_mesh_config_capability = -1;
3522 static int hf_ieee80211_mesh_id = -1;
3523 static int hf_ieee80211_mesh_config_cap_accepting = -1;
3524 static int hf_ieee80211_mesh_config_cap_mcca_support = -1;
3525 static int hf_ieee80211_mesh_config_cap_mcca_enabled = -1;
3526 static int hf_ieee80211_mesh_config_cap_forwarding = -1;
3527 static int hf_ieee80211_mesh_config_cap_mbca_enabled = -1;
3528 static int hf_ieee80211_mesh_config_cap_tbtt_adjusting = -1;
3529 static int hf_ieee80211_mesh_config_cap_power_save_level = -1;
3530 static int hf_ieee80211_mesh_form_info_num_of_peerings = -1;
3531
3532 static int hf_ieee80211_ff_public_action = -1;
3533 static int hf_ieee80211_ff_protected_public_action = -1;
3534 static int hf_ieee80211_ff_tod = -1;
3535 static int hf_ieee80211_ff_toa = -1;
3536 static int hf_ieee80211_ff_max_tod_err = -1;
3537 static int hf_ieee80211_ff_max_toa_err = -1;
3538
3539 /* ************************************************************************* */
3540 /*            Flags found in the capability field (fixed field)              */
3541 /* ************************************************************************* */
3542 static int hf_ieee80211_ff_capture = -1;
3543 static int hf_ieee80211_ff_cf_ess = -1;
3544 static int hf_ieee80211_ff_cf_ibss = -1;
3545 static int hf_ieee80211_ff_cf_sta_poll = -1; /* CF pollable status for a STA            */
3546 static int hf_ieee80211_ff_cf_ap_poll = -1;  /* CF pollable status for an AP            */
3547 static int hf_ieee80211_ff_cf_privacy = -1;
3548 static int hf_ieee80211_ff_cf_preamble = -1;
3549 static int hf_ieee80211_ff_cf_pbcc = -1;
3550 static int hf_ieee80211_ff_cf_agility = -1;
3551 static int hf_ieee80211_ff_short_slot_time = -1;
3552 static int hf_ieee80211_ff_dsss_ofdm = -1;
3553 static int hf_ieee80211_ff_cf_spec_man = -1;
3554 static int hf_ieee80211_ff_cf_apsd = -1;
3555 static int hf_ieee80211_ff_radio_measurement = -1;
3556 static int hf_ieee80211_ff_cf_del_blk_ack = -1;
3557 static int hf_ieee80211_ff_cf_imm_blk_ack = -1;
3558
3559 /* ************************************************************************* */
3560 /*                       A-MSDU fields                                       */
3561 /* ************************************************************************* */
3562 static int hf_ieee80211_amsdu_subframe = -1;
3563 static int hf_ieee80211_amsdu_length = -1;
3564
3565 /* ************************************************************************* */
3566 /*                       Tagged value format fields                          */
3567 /* ************************************************************************* */
3568 static int hf_ieee80211_tagged_parameters = -1;  /* Tagged payload item */
3569 static int hf_ieee80211_tag = -1;
3570 static int hf_ieee80211_tag_number = -1;
3571 static int hf_ieee80211_tag_length = -1;
3572 static int hf_ieee80211_tag_interpretation = -1;
3573 static int hf_ieee80211_tag_data = -1;
3574 static int hf_ieee80211_tag_oui = -1;
3575 static int hf_ieee80211_tag_oui_wfa_subtype = -1;
3576 static int hf_ieee80211_tag_ssid = -1;
3577 static int hf_ieee80211_tag_supp_rates = -1;
3578 static int hf_ieee80211_tag_fh_dwell_time = -1;
3579 static int hf_ieee80211_tag_fh_hop_set = -1;
3580 static int hf_ieee80211_tag_fh_hop_pattern = -1;
3581 static int hf_ieee80211_tag_fh_hop_index = -1;
3582 static int hf_ieee80211_tag_ds_param_channel = -1;
3583 static int hf_ieee80211_tag_cfp_count = -1;
3584 static int hf_ieee80211_tag_cfp_period = -1;
3585 static int hf_ieee80211_tag_cfp_max_duration = -1;
3586 static int hf_ieee80211_tag_cfp_dur_remaining = -1;
3587 static int hf_ieee80211_tim_dtim_count = -1;
3588 static int hf_ieee80211_tim_dtim_period = -1;
3589 static int hf_ieee80211_tim_bmapctl = -1;
3590 static int hf_ieee80211_tim_bmapctl_mcast = -1;
3591 static int hf_ieee80211_tim_bmapctl_offset = -1;
3592 static int hf_ieee80211_tim_partial_virtual_bitmap = -1;
3593 static int hf_ieee80211_tag_ibss_atim_window = -1;
3594 static int hf_ieee80211_tag_country_info_code = -1;
3595 static int hf_ieee80211_tag_country_info_env = -1;
3596 static int hf_ieee80211_tag_country_info_pad = -1;
3597 static int hf_ieee80211_tag_country_info_fnm = -1;
3598 static int hf_ieee80211_tag_country_info_fnm_fcn = -1;
3599 static int hf_ieee80211_tag_country_info_fnm_nc = -1;
3600 static int hf_ieee80211_tag_country_info_fnm_mtpl = -1;
3601 static int hf_ieee80211_tag_country_info_rrc = -1;
3602 static int hf_ieee80211_tag_country_info_rrc_oei = -1;
3603 static int hf_ieee80211_tag_country_info_rrc_oc = -1;
3604 static int hf_ieee80211_tag_country_info_rrc_cc = -1;
3605 static int hf_ieee80211_tag_fh_hopping_parameter_prime_radix = -1;
3606 static int hf_ieee80211_tag_fh_hopping_parameter_nb_channels = -1;
3607 static int hf_ieee80211_tag_fh_hopping_table_flag = -1;
3608 static int hf_ieee80211_tag_fh_hopping_table_number_of_sets = -1;
3609 static int hf_ieee80211_tag_fh_hopping_table_modulus = -1;
3610 static int hf_ieee80211_tag_fh_hopping_table_offset = -1;
3611 static int hf_ieee80211_tag_fh_hopping_random_table = -1;
3612 static int hf_ieee80211_tag_request = -1;
3613 static int hf_ieee80211_tag_challenge_text = -1;
3614
3615 static int hf_ieee80211_wep_iv = -1;
3616 static int hf_ieee80211_wep_iv_weak = -1;
3617 static int hf_ieee80211_tkip_extiv = -1;
3618 static int hf_ieee80211_ccmp_extiv = -1;
3619 static int hf_ieee80211_wep_key = -1;
3620 static int hf_ieee80211_wep_icv = -1;
3621 static int hf_ieee80211_fc_analysis_pmk = -1;
3622 static int hf_ieee80211_fc_analysis_tk = -1;
3623 static int hf_ieee80211_fc_analysis_gtk = -1;
3624
3625 static int hf_ieee80211_block_ack_request_control = -1;
3626 static int hf_ieee80211_block_ack_control = -1;
3627 static int hf_ieee80211_block_ack_control_ack_policy = -1;
3628 static int hf_ieee80211_block_ack_control_multi_tid = -1;
3629 static int hf_ieee80211_block_ack_control_compressed_bitmap = -1;
3630 static int hf_ieee80211_block_ack_control_reserved = -1;
3631
3632 static int hf_ieee80211_block_ack_control_basic_tid_info = -1;
3633 static int hf_ieee80211_block_ack_control_compressed_tid_info = -1;
3634 static int hf_ieee80211_block_ack_control_multi_tid_info = -1;
3635
3636 static int hf_ieee80211_block_ack_multi_tid_info = -1;
3637 static int hf_ieee80211_block_ack_request_type = -1;
3638 static int hf_ieee80211_block_ack_multi_tid_reserved = -1;
3639 static int hf_ieee80211_block_ack_multi_tid_value = -1;
3640 static int hf_ieee80211_block_ack_type = -1;
3641 static int hf_ieee80211_block_ack_bitmap = -1;
3642 static int hf_ieee80211_block_ack_bitmap_missing_frame = -1;
3643
3644 static int hf_ieee80211_tag_measure_request_measurement_mode = -1;
3645 static int hf_ieee80211_tag_measure_request_bssid = -1;
3646
3647 static int hf_ieee80211_tag_measure_request_subelement_length = -1;
3648 static int hf_ieee80211_tag_measure_request_beacon_sub_id = -1;
3649 static int hf_ieee80211_tag_measure_request_beacon_sub_ssid = -1;
3650 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition = -1;
3651 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset = -1;
3652 static int hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail = -1;
3653 static int hf_ieee80211_tag_measure_request_beacon_sub_request = -1;
3654 static int hf_ieee80211_tag_measure_request_beacon_unknown = -1;
3655
3656 static int hf_ieee80211_tag_measure_request_channel_load_sub_id = -1;
3657 static int hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition = -1;
3658 static int hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref = -1;
3659
3660 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_id = -1;
3661 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition = -1;
3662 static int hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref = -1;
3663
3664 static int hf_ieee80211_tag_measure_request_frame_request_type = -1;
3665 static int hf_ieee80211_tag_measure_request_mac_address  = -1;
3666 static int hf_ieee80211_tag_measure_request_peer_mac_address = -1;
3667 static int hf_ieee80211_tag_measure_request_group_id = -1;
3668
3669 static int hf_ieee80211_tag_measure_request_unknown = -1;
3670
3671 static int hf_ieee80211_ht_pren_type = -1;
3672 static int hf_ieee80211_ht_pren_unknown = -1;
3673
3674 static int hf_ieee80211_ht_cap = -1;
3675 static int hf_ieee80211_ht_vs_cap = -1;
3676 static int hf_ieee80211_ht_ldpc_coding = -1;
3677 static int hf_ieee80211_ht_chan_width = -1;
3678 static int hf_ieee80211_ht_sm_pwsave = -1;
3679 static int hf_ieee80211_ht_green = -1;
3680 static int hf_ieee80211_ht_short20 = -1;
3681 static int hf_ieee80211_ht_short40 = -1;
3682 static int hf_ieee80211_ht_tx_stbc = -1;
3683 static int hf_ieee80211_ht_rx_stbc = -1;
3684 static int hf_ieee80211_ht_delayed_block_ack = -1;
3685 static int hf_ieee80211_ht_max_amsdu = -1;
3686 static int hf_ieee80211_ht_dss_cck_40 = -1;
3687 static int hf_ieee80211_ht_psmp = -1;
3688 static int hf_ieee80211_ht_40_mhz_intolerant = -1;
3689 static int hf_ieee80211_ht_l_sig = -1;
3690
3691 static int hf_ieee80211_ext_bss_mu_mimo_capable_sta_count = -1;
3692 static int hf_ieee80211_ext_bss_ss_underutilization = -1;
3693 static int hf_ieee80211_ext_bss_observable_sec_20mhz_utilization = -1;
3694 static int hf_ieee80211_ext_bss_observable_sec_40mhz_utilization = -1;
3695 static int hf_ieee80211_ext_bss_observable_sec_80mhz_utilization = -1;
3696 static int hf_ieee80211_wide_bw_new_channel_width = -1;
3697 static int hf_ieee80211_wide_bw_new_channel_center_freq_segment0 = -1;
3698 static int hf_ieee80211_wide_bw_new_channel_center_freq_segment1 = -1;
3699
3700 static int hf_ieee80211_operat_notification_mode = -1;
3701 static int hf_ieee80211_operat_mode_field_channel_width = -1;
3702 static int hf_ieee80211_operat_mode_field_reserved = -1;
3703 static int hf_ieee80211_operat_mode_field_rxnss = -1;
3704 static int hf_ieee80211_operat_mode_field_rxnsstype= -1;
3705 static int hf_ieee80211_ampduparam = -1;
3706 static int hf_ieee80211_ampduparam_vs = -1;
3707 static int hf_ieee80211_ampduparam_mpdu = -1;
3708 static int hf_ieee80211_ampduparam_mpdu_start_spacing = -1;
3709 static int hf_ieee80211_ampduparam_reserved = -1;
3710
3711 static int hf_ieee80211_mcsset = -1;
3712 static int hf_ieee80211_mcsset_vs = -1;
3713 static int hf_ieee80211_mcsset_rx_bitmask = -1;
3714 static int hf_ieee80211_mcsset_rx_bitmask_0to7 = -1;
3715 static int hf_ieee80211_mcsset_rx_bitmask_8to15 = -1;
3716 static int hf_ieee80211_mcsset_rx_bitmask_16to23 = -1;
3717 static int hf_ieee80211_mcsset_rx_bitmask_24to31 = -1;
3718 static int hf_ieee80211_mcsset_rx_bitmask_32 = -1;
3719 static int hf_ieee80211_mcsset_rx_bitmask_33to38 = -1;
3720 static int hf_ieee80211_mcsset_rx_bitmask_39to52 = -1;
3721 static int hf_ieee80211_mcsset_rx_bitmask_53to76 = -1;
3722 static int hf_ieee80211_mcsset_highest_data_rate = -1;
3723 static int hf_ieee80211_mcsset_tx_mcs_set_defined = -1;
3724 static int hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal = -1;
3725 static int hf_ieee80211_mcsset_tx_max_spatial_streams = -1;
3726 static int hf_ieee80211_mcsset_tx_unequal_modulation = -1;
3727
3728 static int hf_ieee80211_htex_cap = -1;
3729 static int hf_ieee80211_htex_vs_cap = -1;
3730 static int hf_ieee80211_htex_pco = -1;
3731 static int hf_ieee80211_htex_transtime = -1;
3732 static int hf_ieee80211_htex_mcs = -1;
3733 static int hf_ieee80211_htex_htc_support = -1;
3734 static int hf_ieee80211_htex_rd_responder = -1;
3735
3736 static int hf_ieee80211_txbf = -1;
3737 static int hf_ieee80211_txbf_vs = -1;
3738 static int hf_ieee80211_txbf_cap = -1;
3739 static int hf_ieee80211_txbf_rcv_ssc = -1;
3740 static int hf_ieee80211_txbf_tx_ssc = -1;
3741 static int hf_ieee80211_txbf_rcv_ndp = -1;
3742 static int hf_ieee80211_txbf_tx_ndp = -1;
3743 static int hf_ieee80211_txbf_impl_txbf = -1;
3744 static int hf_ieee80211_txbf_calib = -1;
3745 static int hf_ieee80211_txbf_expl_csi = -1;
3746 static int hf_ieee80211_txbf_expl_uncomp_fm = -1;
3747 static int hf_ieee80211_txbf_expl_comp_fm = -1;
3748 static int hf_ieee80211_txbf_expl_bf_csi = -1;
3749 static int hf_ieee80211_txbf_expl_uncomp_fm_feed = -1;
3750 static int hf_ieee80211_txbf_expl_comp_fm_feed = -1;
3751 static int hf_ieee80211_txbf_csi_num_bf_ant = -1;
3752 static int hf_ieee80211_txbf_min_group = -1;
3753 static int hf_ieee80211_txbf_uncomp_sm_bf_ant = -1;
3754 static int hf_ieee80211_txbf_comp_sm_bf_ant = -1;
3755 static int hf_ieee80211_txbf_csi_max_rows_bf = -1;
3756 static int hf_ieee80211_txbf_chan_est = -1;
3757 static int hf_ieee80211_txbf_resrv = -1;
3758
3759 /*** Begin: 802.11n D1.10 - HT Information IE  ***/
3760 static int hf_ieee80211_ht_info_primary_channel = -1;
3761
3762 static int hf_ieee80211_ht_info_delimiter1 = -1;
3763 static int hf_ieee80211_ht_info_secondary_channel_offset = -1;
3764 static int hf_ieee80211_ht_info_channel_width = -1;
3765 static int hf_ieee80211_ht_info_rifs_mode = -1;
3766 static int hf_ieee80211_ht_info_psmp_stas_only = -1;
3767 static int hf_ieee80211_ht_info_service_interval_granularity = -1;
3768
3769 static int hf_ieee80211_ht_info_delimiter2 = -1;
3770 static int hf_ieee80211_ht_info_operating_mode = -1;
3771 static int hf_ieee80211_ht_info_non_greenfield_sta_present = -1;
3772 static int hf_ieee80211_ht_info_transmit_burst_limit = -1;
3773 static int hf_ieee80211_ht_info_obss_non_ht_stas_present = -1;
3774 static int hf_ieee80211_ht_info_reserved_1 = -1;
3775
3776 static int hf_ieee80211_ht_info_delimiter3 = -1;
3777 static int hf_ieee80211_ht_info_reserved_2 = -1;
3778 static int hf_ieee80211_ht_info_dual_beacon = -1;
3779 static int hf_ieee80211_ht_info_dual_cts_protection = -1;
3780 static int hf_ieee80211_ht_info_secondary_beacon = -1;
3781 static int hf_ieee80211_ht_info_lsig_txop_protection_full_support = -1;
3782 static int hf_ieee80211_ht_info_pco_active = -1;
3783 static int hf_ieee80211_ht_info_pco_phase = -1;
3784 static int hf_ieee80211_ht_info_reserved_3 = -1;
3785 /*** End: 802.11n D1.10 - HT Information IE  ***/
3786
3787 static int hf_ieee80211_tag_ap_channel_report_operating_class = -1;
3788 static int hf_ieee80211_tag_ap_channel_report_channel_list = -1;
3789
3790 static int hf_ieee80211_tag_secondary_channel_offset = -1;
3791
3792 static int hf_ieee80211_tag_bss_ap_avg_access_delay = -1;
3793
3794 static int hf_ieee80211_tag_antenna_id = -1;
3795
3796 static int hf_ieee80211_tag_rsni = -1;
3797
3798 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask = -1;
3799 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0 = -1;
3800 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1 = -1;
3801 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2 = -1;
3802 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3 = -1;
3803 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4 = -1;
3804 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5 = -1;
3805 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6 = -1;
3806 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7 = -1;
3807 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0 = -1;
3808 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1 = -1;
3809 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2 = -1;
3810 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3 = -1;
3811 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv = -1;
3812 static int hf_ieee80211_tag_bss_avb_adm_cap_up0 = -1;
3813 static int hf_ieee80211_tag_bss_avb_adm_cap_up1 = -1;
3814 static int hf_ieee80211_tag_bss_avb_adm_cap_up2 = -1;
3815 static int hf_ieee80211_tag_bss_avb_adm_cap_up3 = -1;
3816 static int hf_ieee80211_tag_bss_avb_adm_cap_up4 = -1;
3817 static int hf_ieee80211_tag_bss_avb_adm_cap_up5 = -1;
3818 static int hf_ieee80211_tag_bss_avb_adm_cap_up6 = -1;
3819 static int hf_ieee80211_tag_bss_avb_adm_cap_up7 = -1;
3820 static int hf_ieee80211_tag_bss_avb_adm_cap_ac0 = -1;
3821 static int hf_ieee80211_tag_bss_avb_adm_cap_ac1 = -1;
3822 static int hf_ieee80211_tag_bss_avb_adm_cap_ac2 = -1;
3823 static int hf_ieee80211_tag_bss_avb_adm_cap_ac3 = -1;
3824
3825 static int hf_ieee80211_tag_bss_avg_ac_access_delay_be = -1;
3826 static int hf_ieee80211_tag_bss_avg_ac_access_delay_bk = -1;
3827 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vi = -1;
3828 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vo = -1;
3829
3830 static int hf_ieee80211_tag_rm_enabled_capabilities = -1;
3831 static int hf_ieee80211_tag_rm_enabled_capabilities_b0 = -1;
3832 static int hf_ieee80211_tag_rm_enabled_capabilities_b1 = -1;
3833 static int hf_ieee80211_tag_rm_enabled_capabilities_b2 = -1;
3834 static int hf_ieee80211_tag_rm_enabled_capabilities_b3 = -1;
3835 static int hf_ieee80211_tag_rm_enabled_capabilities_b4 = -1;
3836 static int hf_ieee80211_tag_rm_enabled_capabilities_b5 = -1;
3837 static int hf_ieee80211_tag_rm_enabled_capabilities_b6 = -1;
3838 static int hf_ieee80211_tag_rm_enabled_capabilities_b7 = -1;
3839 static int hf_ieee80211_tag_rm_enabled_capabilities_b8 = -1;
3840 static int hf_ieee80211_tag_rm_enabled_capabilities_b9 = -1;
3841 static int hf_ieee80211_tag_rm_enabled_capabilities_b10 = -1;
3842 static int hf_ieee80211_tag_rm_enabled_capabilities_b11 = -1;
3843 static int hf_ieee80211_tag_rm_enabled_capabilities_b12 = -1;
3844 static int hf_ieee80211_tag_rm_enabled_capabilities_b13 = -1;
3845 static int hf_ieee80211_tag_rm_enabled_capabilities_b14 = -1;
3846 static int hf_ieee80211_tag_rm_enabled_capabilities_b15 = -1;
3847 static int hf_ieee80211_tag_rm_enabled_capabilities_b16 = -1;
3848 static int hf_ieee80211_tag_rm_enabled_capabilities_b17 = -1;
3849 static int hf_ieee80211_tag_rm_enabled_capabilities_b18to20 = -1;
3850 static int hf_ieee80211_tag_rm_enabled_capabilities_b21to23 = -1;
3851 static int hf_ieee80211_tag_rm_enabled_capabilities_b24to26 = -1;
3852 static int hf_ieee80211_tag_rm_enabled_capabilities_b27 = -1;
3853 static int hf_ieee80211_tag_rm_enabled_capabilities_b28 = -1;
3854 static int hf_ieee80211_tag_rm_enabled_capabilities_b29 = -1;
3855 static int hf_ieee80211_tag_rm_enabled_capabilities_b30 = -1;
3856 static int hf_ieee80211_tag_rm_enabled_capabilities_b31 = -1;
3857 static int hf_ieee80211_tag_rm_enabled_capabilities_b32 = -1;
3858 static int hf_ieee80211_tag_rm_enabled_capabilities_b33 = -1;
3859 static int hf_ieee80211_tag_rm_enabled_capabilities_o5 = -1;
3860
3861 static int hf_ieee80211_tag_power_constraint_local = -1;
3862
3863 static int hf_ieee80211_tag_power_capability_min = -1;
3864 static int hf_ieee80211_tag_power_capability_max = -1;
3865
3866 static int hf_ieee80211_tag_tpc_report_trsmt_pow = -1;
3867 static int hf_ieee80211_tag_tpc_report_link_mrg = -1;
3868
3869 static int hf_ieee80211_tag_supported_channels = -1;
3870 static int hf_ieee80211_tag_supported_channels_first = -1;
3871 static int hf_ieee80211_tag_supported_channels_range = -1;
3872
3873 static int hf_ieee80211_csa_channel_switch_mode = -1;
3874 static int hf_ieee80211_csa_new_channel_number = -1;
3875 static int hf_ieee80211_csa_channel_switch_count = -1;
3876
3877 static int hf_ieee80211_tag_measure_request_token = -1;
3878 static int hf_ieee80211_tag_measure_request_mode = -1;
3879 static int hf_ieee80211_tag_measure_request_mode_parallel = -1;
3880 static int hf_ieee80211_tag_measure_request_mode_enable = -1;
3881 static int hf_ieee80211_tag_measure_request_mode_request = -1;
3882 static int hf_ieee80211_tag_measure_request_mode_report = -1;
3883 static int hf_ieee80211_tag_measure_request_mode_duration_mandatory = -1;
3884 static int hf_ieee80211_tag_measure_request_mode_reserved = -1;
3885 static int hf_ieee80211_tag_measure_request_type = -1;
3886
3887 static int hf_ieee80211_tag_measure_request_channel_number = -1;
3888 static int hf_ieee80211_tag_measure_request_start_time = -1;
3889 static int hf_ieee80211_tag_measure_request_duration = -1;
3890
3891 static int hf_ieee80211_tag_measure_request_operating_class = -1;
3892 static int hf_ieee80211_tag_measure_request_randomization_interval = -1;
3893
3894 static int hf_ieee80211_tag_measure_report_measurement_token = -1;
3895 static int hf_ieee80211_tag_measure_report_mode = -1;
3896 static int hf_ieee80211_tag_measure_report_mode_late = -1;
3897 static int hf_ieee80211_tag_measure_report_mode_incapable = -1;
3898 static int hf_ieee80211_tag_measure_report_mode_refused = -1;
3899 static int hf_ieee80211_tag_measure_report_mode_reserved = -1;
3900 static int hf_ieee80211_tag_measure_report_type = -1;
3901 static int hf_ieee80211_tag_measure_report_channel_number = -1;
3902 static int hf_ieee80211_tag_measure_report_start_time = -1;
3903 static int hf_ieee80211_tag_measure_report_duration = -1;
3904
3905 static int hf_ieee80211_tag_measure_basic_map_field = -1;
3906 static int hf_ieee80211_tag_measure_map_field_bss = -1;
3907 static int hf_ieee80211_tag_measure_map_field_odfm = -1;
3908 static int hf_ieee80211_tag_measure_map_field_unident_signal = -1;
3909 static int hf_ieee80211_tag_measure_map_field_radar = -1;
3910 static int hf_ieee80211_tag_measure_map_field_unmeasured = -1;
3911 static int hf_ieee80211_tag_measure_map_field_reserved = -1;
3912
3913 static int hf_ieee80211_tag_measure_cca_busy_fraction = -1;
3914
3915 static int hf_ieee80211_tag_measure_rpi_histogram_report = -1;
3916 static int hf_ieee80211_tag_measure_rpi_histogram_report_0 = -1;
3917 static int hf_ieee80211_tag_measure_rpi_histogram_report_1 = -1;
3918 static int hf_ieee80211_tag_measure_rpi_histogram_report_2 = -1;
3919 static int hf_ieee80211_tag_measure_rpi_histogram_report_3 = -1;
3920 static int hf_ieee80211_tag_measure_rpi_histogram_report_4 = -1;
3921 static int hf_ieee80211_tag_measure_rpi_histogram_report_5 = -1;
3922 static int hf_ieee80211_tag_measure_rpi_histogram_report_6 = -1;
3923 static int hf_ieee80211_tag_measure_rpi_histogram_report_7 = -1;
3924
3925 static int hf_ieee80211_tag_measure_report_operating_class = -1;
3926 static int hf_ieee80211_tag_measure_report_channel_load = -1;
3927 static int hf_ieee80211_tag_measure_report_frame_info = -1;
3928 static int hf_ieee80211_tag_measure_report_frame_info_phy_type = -1;
3929 static int hf_ieee80211_tag_measure_report_frame_info_frame_type = -1;
3930 static int hf_ieee80211_tag_measure_report_rcpi = -1;
3931 static int hf_ieee80211_tag_measure_report_rsni = -1;
3932 static int hf_ieee80211_tag_measure_report_bssid = -1;
3933 static int hf_ieee80211_tag_measure_report_ant_id = -1;
3934 static int hf_ieee80211_tag_measure_report_anpi = -1;
3935 static int hf_ieee80211_tag_measure_report_ipi_density_0 = -1;
3936 static int hf_ieee80211_tag_measure_report_ipi_density_1 = -1;
3937 static int hf_ieee80211_tag_measure_report_ipi_density_2 = -1;
3938 static int hf_ieee80211_tag_measure_report_ipi_density_3 = -1;
3939 static int hf_ieee80211_tag_measure_report_ipi_density_4 = -1;
3940 static int hf_ieee80211_tag_measure_report_ipi_density_5 = -1;
3941 static int hf_ieee80211_tag_measure_report_ipi_density_6 = -1;
3942 static int hf_ieee80211_tag_measure_report_ipi_density_7 = -1;
3943 static int hf_ieee80211_tag_measure_report_ipi_density_8 = -1;
3944 static int hf_ieee80211_tag_measure_report_ipi_density_9 = -1;
3945 static int hf_ieee80211_tag_measure_report_ipi_density_10 = -1;
3946 static int hf_ieee80211_tag_measure_report_parent_tsf = -1;
3947
3948 static int hf_ieee80211_tag_measure_report_subelement_length = -1;
3949 static int hf_ieee80211_tag_measure_report_beacon_sub_id = -1;
3950
3951 static int hf_ieee80211_tag_measure_report_unknown = -1;
3952
3953 static int hf_ieee80211_tag_quiet_count = -1;
3954 static int hf_ieee80211_tag_quiet_period = -1;
3955 static int hf_ieee80211_tag_quiet_duration = -1;
3956 static int hf_ieee80211_tag_quiet_offset = -1;
3957
3958 static int hf_ieee80211_tag_dfs_owner = -1;
3959 static int hf_ieee80211_tag_dfs_recovery_interval = -1;
3960 static int hf_ieee80211_tag_dfs_channel_map = -1;
3961 static int hf_ieee80211_tag_dfs_channel_number = -1;
3962 static int hf_ieee80211_tag_dfs_map = -1;
3963
3964 static int hf_ieee80211_tag_erp_info = -1;
3965 static int hf_ieee80211_tag_erp_info_erp_present = -1;
3966 static int hf_ieee80211_tag_erp_info_use_protection = -1;
3967 static int hf_ieee80211_tag_erp_info_barker_preamble_mode = -1;
3968 static int hf_ieee80211_tag_erp_info_reserved = -1;
3969
3970 static int hf_ieee80211_tag_extended_capabilities = -1;
3971 static int hf_ieee80211_tag_extended_capabilities_b0 = -1;
3972 static int hf_ieee80211_tag_extended_capabilities_b1 = -1;
3973 static int hf_ieee80211_tag_extended_capabilities_b2 = -1;
3974 static int hf_ieee80211_tag_extended_capabilities_b3 = -1;
3975 static int hf_ieee80211_tag_extended_capabilities_b4 = -1;
3976 static int hf_ieee80211_tag_extended_capabilities_b5 = -1;
3977 static int hf_ieee80211_tag_extended_capabilities_b6 = -1;
3978 static int hf_ieee80211_tag_extended_capabilities_b7 = -1;
3979 static int hf_ieee80211_tag_extended_capabilities_b8 = -1;
3980 static int hf_ieee80211_tag_extended_capabilities_b9 = -1;
3981 static int hf_ieee80211_tag_extended_capabilities_b10 = -1;
3982 static int hf_ieee80211_tag_extended_capabilities_b11 = -1;
3983 static int hf_ieee80211_tag_extended_capabilities_b12 = -1;
3984 static int hf_ieee80211_tag_extended_capabilities_b13 = -1;
3985 static int hf_ieee80211_tag_extended_capabilities_b14 = -1;
3986 static int hf_ieee80211_tag_extended_capabilities_b15 = -1;
3987 static int hf_ieee80211_tag_extended_capabilities_b16 = -1;
3988 static int hf_ieee80211_tag_extended_capabilities_b17 = -1;
3989 static int hf_ieee80211_tag_extended_capabilities_b18 = -1;
3990 static int hf_ieee80211_tag_extended_capabilities_b19 = -1;
3991 static int hf_ieee80211_tag_extended_capabilities_b20 = -1;
3992 static int hf_ieee80211_tag_extended_capabilities_b21 = -1;
3993 static int hf_ieee80211_tag_extended_capabilities_b22 = -1;
3994 static int hf_ieee80211_tag_extended_capabilities_b23 = -1;
3995 static int hf_ieee80211_tag_extended_capabilities_b24 = -1;
3996 static int hf_ieee80211_tag_extended_capabilities_b25 = -1;
3997 static int hf_ieee80211_tag_extended_capabilities_b26 = -1;
3998 static int hf_ieee80211_tag_extended_capabilities_b27 = -1;
3999 static int hf_ieee80211_tag_extended_capabilities_b28 = -1;
4000 static int hf_ieee80211_tag_extended_capabilities_b29 = -1;
4001 static int hf_ieee80211_tag_extended_capabilities_b30 = -1;
4002 static int hf_ieee80211_tag_extended_capabilities_b31 = -1;
4003 static int hf_ieee80211_tag_extended_capabilities_b32 = -1;
4004 static int hf_ieee80211_tag_extended_capabilities_b33 = -1;
4005 static int hf_ieee80211_tag_extended_capabilities_b34 = -1;
4006 static int hf_ieee80211_tag_extended_capabilities_b35 = -1;
4007 static int hf_ieee80211_tag_extended_capabilities_b36 = -1;
4008 static int hf_ieee80211_tag_extended_capabilities_b37 = -1;
4009 static int hf_ieee80211_tag_extended_capabilities_b38 = -1;
4010 static int hf_ieee80211_tag_extended_capabilities_b39 = -1;
4011 static int hf_ieee80211_tag_extended_capabilities_b40 = -1;
4012 static int hf_ieee80211_tag_extended_capabilities_serv_int_granularity = -1;
4013 static int hf_ieee80211_tag_extended_capabilities_b44 = -1;
4014 static int hf_ieee80211_tag_extended_capabilities_b45 = -1;
4015 static int hf_ieee80211_tag_extended_capabilities_b46 = -1;
4016 static int hf_ieee80211_tag_extended_capabilities_b47 = -1;
4017 static int hf_ieee80211_tag_extended_capabilities_b48 = -1;
4018 static int hf_ieee80211_tag_extended_capabilities_b61 = -1;
4019 static int hf_ieee80211_tag_extended_capabilities_b62 = -1;
4020 static int hf_ieee80211_tag_extended_capabilities_b63 = -1;
4021 static int hf_ieee80211_tag_extended_capabilities_b64 = -1;
4022 static int hf_ieee80211_tag_extended_capabilities_o7 = -1;
4023 static int hf_ieee80211_tag_extended_capabilities_o8 = -1;
4024 static int hf_ieee80211_tag_extended_capabilities_o9 = -1;
4025
4026 static int hf_ieee80211_tag_cisco_ccx1_unknown = -1;
4027 static int hf_ieee80211_tag_cisco_ccx1_name = -1;
4028 static int hf_ieee80211_tag_cisco_ccx1_clients = -1;
4029 static int hf_ieee80211_tag_cisco_ccx1_unknown2 = -1;
4030
4031 static int hf_ieee80211_vht_cap = -1;
4032 static int hf_ieee80211_vht_max_mpdu_length = -1;
4033 static int hf_ieee80211_vht_supported_chan_width_set = -1;
4034 static int hf_ieee80211_vht_rx_ldpc = -1;
4035 static int hf_ieee80211_vht_short_gi_for_80 = -1;
4036 static int hf_ieee80211_vht_short_gi_for_160 = -1;
4037 static int hf_ieee80211_vht_tx_stbc = -1;
4038 static int hf_ieee80211_vht_rx_stbc = -1;
4039 static int hf_ieee80211_vht_su_beamformer_cap = -1;
4040 static int hf_ieee80211_vht_su_beamformee_cap = -1;
4041 static int hf_ieee80211_vht_beamformer_antennas = -1;
4042 static int hf_ieee80211_vht_sounding_dimensions = -1;
4043 static int hf_ieee80211_vht_mu_beamformer_cap = -1;
4044 static int hf_ieee80211_vht_mu_beamformee_cap = -1;
4045 static int hf_ieee80211_vht_txop_ps = -1;
4046 static int hf_ieee80211_vht_var_htc_field = -1;
4047 static int hf_ieee80211_vht_max_ampdu = -1;
4048 static int hf_ieee80211_vht_link_adaptation_cap = -1;
4049 static int hf_ieee80211_vht_rx_pattern = -1;
4050 static int hf_ieee80211_vht_tx_pattern = -1;
4051 static int hf_ieee80211_vht_reserv = -1;
4052
4053 static int hf_ieee80211_vht_mcsset = -1;
4054
4055 static int hf_ieee80211_vht_mcsset_rx_mcs_map = -1;
4056 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss = -1;
4057 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss = -1;
4058 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss = -1;
4059 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss = -1;
4060 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss = -1;
4061 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss = -1;
4062 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss = -1;
4063 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss = -1;
4064
4065 static int hf_ieee80211_vht_mcsset_rx_highest_long_gi = -1;
4066
4067 static int hf_ieee80211_vht_mcsset_tx_mcs_map = -1;
4068 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss = -1;
4069 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss = -1;
4070 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss = -1;
4071 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss = -1;
4072 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss = -1;
4073 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss = -1;
4074 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss = -1;
4075 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss = -1;
4076
4077 static int hf_ieee80211_vht_op = -1;
4078 static int hf_ieee80211_vht_op_channel_width = -1;
4079 static int hf_ieee80211_vht_op_channel_center0 = -1;
4080 static int hf_ieee80211_vht_op_channel_center1 = -1;
4081
4082 static int hf_ieee80211_vht_op_basic_mcs_map = -1;
4083 static int hf_ieee80211_vht_op_max_basic_mcs_for_1_ss = -1;
4084 static int hf_ieee80211_vht_op_max_basic_mcs_for_2_ss = -1;
4085 static int hf_ieee80211_vht_op_max_basic_mcs_for_3_ss = -1;
4086 static int hf_ieee80211_vht_op_max_basic_mcs_for_4_ss = -1;
4087 static int hf_ieee80211_vht_op_max_basic_mcs_for_5_ss = -1;
4088 static int hf_ieee80211_vht_op_max_basic_mcs_for_6_ss = -1;
4089 static int hf_ieee80211_vht_op_max_basic_mcs_for_7_ss = -1;
4090 static int hf_ieee80211_vht_op_max_basic_mcs_for_8_ss = -1;
4091 static int hf_ieee80211_vht_mcsset_tx_highest_long_gi = -1;
4092
4093 static int hf_ieee80211_vht_tpe_pwr_info = -1;
4094 static int hf_ieee80211_vht_tpe_pwr_info_count = -1;
4095 static int hf_ieee80211_vht_tpe_pwr_info_unit = -1;
4096 static int hf_ieee80211_vht_tpe_pwr_info_reserved = -1;
4097 static int hf_ieee80211_vht_tpe_pwr_constr_20 = -1;
4098 static int hf_ieee80211_vht_tpe_pwr_constr_40 = -1;
4099 static int hf_ieee80211_vht_tpe_pwr_constr_80 = -1;
4100 static int hf_ieee80211_vht_tpe_pwr_constr_160 = -1;
4101
4102 static int hf_ieee80211_beamform_feedback_seg_retrans_bitmap = -1;
4103
4104 static int hf_ieee80211_vht_ndp_annc_token = -1;
4105 static int hf_ieee80211_vht_ndp_annc_token_number = -1;
4106 static int hf_ieee80211_vht_ndp_annc_token_reserved = -1;
4107 static int hf_ieee80211_vht_ndp_annc_sta_info = -1;
4108 static int hf_ieee80211_vht_ndp_annc_sta_info_aid12 = -1;
4109 static int hf_ieee80211_vht_ndp_annc_sta_info_feedback_type = -1;
4110 static int hf_ieee80211_vht_ndp_annc_sta_info_nc_index = -1;
4111 static int hf_ieee80211_vht_ndp_annc_sta_info_reserved = -1;
4112
4113
4114 static int hf_ieee80211_ff_vht_action = -1;
4115 static int hf_ieee80211_ff_vht_mimo_cntrl = -1;
4116 static int hf_ieee80211_ff_vht_mimo_cntrl_nc_index = -1;
4117 static int hf_ieee80211_ff_vht_mimo_cntrl_nr_index = -1;
4118 static int hf_ieee80211_ff_vht_mimo_cntrl_channel_width = -1;
4119 static int hf_ieee80211_ff_vht_mimo_cntrl_grouping = -1;
4120 static int hf_ieee80211_ff_vht_mimo_cntrl_codebook_info = -1;
4121 static int hf_ieee80211_ff_vht_mimo_cntrl_feedback_type = -1;
4122 static int hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg = -1;
4123 static int hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg = -1;
4124 static int hf_ieee80211_ff_vht_mimo_cntrl_reserved = -1;
4125 static int hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number = -1;
4126
4127 static const int *hf_ieee80211_ff_vht_mimo_cntrl_fields[] = {
4128   &hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
4129   &hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
4130   &hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
4131   &hf_ieee80211_ff_vht_mimo_cntrl_grouping,
4132   &hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
4133   &hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
4134   &hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
4135   &hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
4136   &hf_ieee80211_ff_vht_mimo_cntrl_reserved,
4137   &hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
4138   NULL,
4139 };
4140
4141 static int hf_ieee80211_vht_compressed_beamforming_report = -1;
4142 static int hf_ieee80211_vht_compressed_beamforming_report_snr = -1;
4143 static int hf_ieee80211_vht_compressed_beamforming_feedback_matrix = -1;
4144 static int hf_ieee80211_vht_group_id_management = -1;
4145 static int hf_ieee80211_vht_membership_status_array = -1;
4146 static int hf_ieee80211_vht_user_position_array = -1;
4147 static int hf_ieee80211_vht_operation_mode_notification = -1;
4148
4149 static int hf_ieee80211_tag_neighbor_report_bssid = -1;
4150 static int hf_ieee80211_tag_neighbor_report_bssid_info = -1;
4151 static int hf_ieee80211_tag_neighbor_report_bssid_info_reachability = -1;
4152 static int hf_ieee80211_tag_neighbor_report_bssid_info_security = -1;
4153 static int hf_ieee80211_tag_neighbor_report_bssid_info_key_scope = -1;
4154 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability = -1;
4155 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng = -1;
4156 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos = -1;
4157 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd = -1;
4158 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt = -1;
4159 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback = -1;
4160 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback = -1;
4161 static int hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain = -1;
4162 static int hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput = -1;
4163 static int hf_ieee80211_tag_neighbor_report_bssid_info_reserved = -1;
4164 static int hf_ieee80211_tag_neighbor_report_ope_class = -1;
4165 static int hf_ieee80211_tag_neighbor_report_channel_number = -1;
4166 static int hf_ieee80211_tag_neighbor_report_phy_type = -1;
4167 static int hf_ieee80211_tag_neighbor_report_subelement_id = -1;
4168 static int hf_ieee80211_tag_neighbor_report_subelement_length = -1;
4169
4170 static int hf_ieee80211_tag_supported_ope_classes_current = -1;
4171 static int hf_ieee80211_tag_supported_ope_classes_alternate = -1;
4172
4173 /* IEEE Std 802.11r-2008 7.3.2.47 */
4174 static int hf_ieee80211_tag_mobility_domain_mdid = -1;
4175 static int hf_ieee80211_tag_mobility_domain_ft_capab = -1;
4176 static int hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds = -1;
4177 static int hf_ieee80211_tag_mobility_domain_ft_capab_resource_req = -1;
4178
4179 /* IEEE Std 802.11r-2008 7.3.2.48 */
4180 static int hf_ieee80211_tag_ft_mic_control = -1;
4181 static int hf_ieee80211_tag_ft_element_count = -1;
4182 static int hf_ieee80211_tag_ft_mic = -1;
4183 static int hf_ieee80211_tag_ft_anonce = -1;
4184 static int hf_ieee80211_tag_ft_snonce = -1;
4185 static int hf_ieee80211_tag_ft_subelem_id = -1;
4186 static int hf_ieee80211_tag_ft_subelem_len = -1;
4187 static int hf_ieee80211_tag_ft_subelem_data = -1;
4188 static int hf_ieee80211_tag_ft_subelem_r1kh_id = -1;
4189 static int hf_ieee80211_tag_ft_subelem_gtk_key_info = -1;
4190 static int hf_ieee80211_tag_ft_subelem_gtk_key_id = -1;
4191 static int hf_ieee80211_tag_ft_subelem_gtk_key_length = -1;
4192 static int hf_ieee80211_tag_ft_subelem_gtk_rsc = -1;
4193 static int hf_ieee80211_tag_ft_subelem_gtk_key = -1;
4194 static int hf_ieee80211_tag_ft_subelem_r0kh_id = -1;
4195 static int hf_ieee80211_tag_ft_subelem_igtk_key_id = -1;
4196 static int hf_ieee80211_tag_ft_subelem_igtk_ipn = -1;
4197 static int hf_ieee80211_tag_ft_subelem_igtk_key_length = -1;
4198 static int hf_ieee80211_tag_ft_subelem_igtk_key = -1;
4199
4200 /* IEEE Std 802.11-2012: 11r 8.4.2.52 */
4201 static int hf_ieee80211_tag_ric_data_id = -1;
4202 static int hf_ieee80211_tag_ric_data_desc_cnt = -1;
4203 static int hf_ieee80211_tag_ric_data_status_code = -1;
4204
4205 /* IEEE Std 802.11-2012: 11r 8.4.2.53 */
4206 static int hf_ieee80211_tag_ric_desc_rsrc_type = -1;
4207 static int hf_ieee80211_tag_ric_desc_var_params = -1;
4208
4209 /* IEEE Std 802.11w-2009 7.3.2.55 */
4210 static int hf_ieee80211_tag_mmie_keyid = -1;
4211 static int hf_ieee80211_tag_mmie_ipn = -1;
4212 static int hf_ieee80211_tag_mmie_mic = -1;
4213
4214 /*WAPI-Specification 7.3.2.25 : WAPI Parameter Set*/
4215 static int hf_ieee80211_tag_wapi_param_set_version = -1;
4216
4217 static int hf_ieee80211_tag_wapi_param_set_akm_suite_count = -1;
4218 static int hf_ieee80211_tag_wapi_param_set_akm_suite_oui = -1;
4219 static int hf_ieee80211_tag_wapi_param_set_akm_suite_type = -1;
4220
4221 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count = -1;
4222 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui = -1;
4223 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type = -1;
4224
4225 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui = -1;
4226 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type = -1;
4227
4228 static int hf_ieee80211_tag_wapi_param_set_capab = -1;
4229 static int hf_ieee80211_tag_wapi_param_set_capab_preauth = -1;
4230 static int hf_ieee80211_tag_wapi_param_set_capab_rsvd = -1;
4231 static int hf_ieee80211_tag_wapi_param_set_bkid_count = -1;
4232 static int hf_ieee80211_tag_wapi_param_set_bkid_list = -1;
4233
4234 /* IEEE Std 802.11v-2011 7.3.2.61 */
4235 static int hf_ieee80211_tag_time_adv_timing_capab = -1;
4236 static int hf_ieee80211_tag_time_adv_time_value = -1;
4237 static int hf_ieee80211_tag_time_adv_time_value_year = -1;
4238 static int hf_ieee80211_tag_time_adv_time_value_month = -1;
4239 static int hf_ieee80211_tag_time_adv_time_value_day = -1;
4240 static int hf_ieee80211_tag_time_adv_time_value_hours = -1;
4241 static int hf_ieee80211_tag_time_adv_time_value_minutes = -1;
4242 static int hf_ieee80211_tag_time_adv_time_value_seconds = -1;
4243 static int hf_ieee80211_tag_time_adv_time_value_milliseconds = -1;
4244 static int hf_ieee80211_tag_time_adv_time_value_reserved = -1;
4245 static int hf_ieee80211_tag_time_adv_time_error = -1;
4246 static int hf_ieee80211_tag_time_adv_time_update_counter = -1;
4247
4248 /* IEEE Std 802.11-2012 8.4.2.81 */
4249 static int hf_ieee80211_tag_bss_max_idle_period = -1;
4250 static int hf_ieee80211_tag_bss_max_idle_options_protected = -1;
4251
4252 /* IEEE Std 802.11-2012 8.4.2.82 */
4253 static int hf_ieee80211_tag_tfs_request_id = -1;
4254 static int hf_ieee80211_tag_tfs_request_ac_delete_after_match = -1;
4255 static int hf_ieee80211_tag_tfs_request_ac_notify = -1;
4256 static int hf_ieee80211_tag_tfs_request_subelem_id = -1;
4257 static int hf_ieee80211_tag_tfs_request_subelem_len = -1;
4258 static int hf_ieee80211_tag_tfs_request_subelem = -1;
4259
4260 /* IEEE Std 802.11-2012 8.4.2.83 */
4261 static int hf_ieee80211_tag_tfs_response_subelem_id = -1;
4262 static int hf_ieee80211_tag_tfs_response_subelem_len = -1;
4263 static int hf_ieee80211_tag_tfs_response_subelem = -1;
4264 static int hf_ieee80211_tag_tfs_response_status = -1;
4265 static int hf_ieee80211_tag_tfs_response_id = -1;
4266
4267 /* IEEE Std 802.11-2012 8.4.2.84 */
4268 static int hf_ieee80211_tag_wnm_sleep_mode_action_type = -1;
4269 static int hf_ieee80211_tag_wnm_sleep_mode_response_status = -1;
4270 static int hf_ieee80211_tag_wnm_sleep_mode_interval = -1;
4271
4272 /* IEEE Std 802.11v-2011 7.3.2.87 */
4273 static int hf_ieee80211_tag_time_zone = -1;
4274
4275 /* IEEE Std 802.11u-2011 7.3.2.92 */
4276 static int hf_ieee80211_tag_interworking_access_network_type = -1;
4277 static int hf_ieee80211_tag_interworking_internet = -1;
4278 static int hf_ieee80211_tag_interworking_asra = -1;
4279 static int hf_ieee80211_tag_interworking_esr = -1;
4280 static int hf_ieee80211_tag_interworking_uesa = -1;
4281 static int hf_ieee80211_tag_interworking_hessid = -1;
4282
4283 /* IEEE Std 802.11-2012, 8.4.2.97 */
4284 static int hf_ieee80211_tag_qos_map_set_dscp_exc = -1;
4285 static int hf_ieee80211_tag_qos_map_set_dscp_exc_val = -1;
4286 static int hf_ieee80211_tag_qos_map_set_dscp_exc_up = -1;
4287 static int hf_ieee80211_tag_qos_map_set_range = -1;
4288 static int hf_ieee80211_tag_qos_map_set_low = -1;
4289 static int hf_ieee80211_tag_qos_map_set_high = -1;
4290
4291 /* IEEE Std 802.11u-2011 7.3.2.93 */
4292 static int hf_ieee80211_tag_adv_proto_resp_len_limit = -1;
4293 static int hf_ieee80211_tag_adv_proto_pame_bi = -1;
4294 static int hf_ieee80211_tag_adv_proto_id = -1;
4295 static int hf_ieee80211_tag_adv_proto_vs_info = -1;
4296
4297 /* IEEE Std 802.11u-2011 7.3.2.96 */
4298 static int hf_ieee80211_tag_roaming_consortium_num_anqp_oi = -1;
4299 static int hf_ieee80211_tag_roaming_consortium_oi1_len = -1;
4300 static int hf_ieee80211_tag_roaming_consortium_oi2_len = -1;
4301 static int hf_ieee80211_tag_roaming_consortium_oi1 = -1;
4302 static int hf_ieee80211_tag_roaming_consortium_oi2 = -1;
4303 static int hf_ieee80211_tag_roaming_consortium_oi3 = -1;
4304
4305 /* 802.11n 7.3.2.48 */
4306 static int hf_ieee80211_hta_cc = -1;
4307 static int hf_ieee80211_hta_cap = -1;
4308 static int hf_ieee80211_hta_ext_chan_offset = -1;
4309 static int hf_ieee80211_hta_rec_tx_width = -1;
4310 static int hf_ieee80211_hta_rifs_mode = -1;
4311 static int hf_ieee80211_hta_controlled_access = -1;
4312 static int hf_ieee80211_hta_service_interval = -1;
4313 static int hf_ieee80211_hta_operating_mode = -1;
4314 static int hf_ieee80211_hta_non_gf_devices = -1;
4315 static int hf_ieee80211_hta_basic_stbc_mcs = -1;
4316 static int hf_ieee80211_hta_dual_stbc_protection = -1;
4317 static int hf_ieee80211_hta_secondary_beacon = -1;
4318 static int hf_ieee80211_hta_lsig_txop_protection = -1;
4319 static int hf_ieee80211_hta_pco_active = -1;
4320 static int hf_ieee80211_hta_pco_phase = -1;
4321
4322 static int hf_ieee80211_antsel = -1;
4323 static int hf_ieee80211_antsel_vs = -1;
4324 static int hf_ieee80211_antsel_b0 = -1;
4325 static int hf_ieee80211_antsel_b1 = -1;
4326 static int hf_ieee80211_antsel_b2 = -1;
4327 static int hf_ieee80211_antsel_b3 = -1;
4328 static int hf_ieee80211_antsel_b4 = -1;
4329 static int hf_ieee80211_antsel_b5 = -1;
4330 static int hf_ieee80211_antsel_b6 = -1;
4331 static int hf_ieee80211_antsel_b7 = -1;
4332
4333 static int hf_ieee80211_rsn_version = -1;
4334 static int hf_ieee80211_rsn_gcs = -1;
4335 static int hf_ieee80211_rsn_gcs_oui = -1;
4336 static int hf_ieee80211_rsn_gcs_type = -1;
4337 static int hf_ieee80211_rsn_gcs_80211_type = -1;
4338 static int hf_ieee80211_rsn_pcs_count = -1;
4339 static int hf_ieee80211_rsn_pcs_list = -1;
4340 static int hf_ieee80211_rsn_pcs = -1;
4341 static int hf_ieee80211_rsn_pcs_oui = -1;
4342 static int hf_ieee80211_rsn_pcs_80211_type = -1;
4343 static int hf_ieee80211_rsn_pcs_type = -1;
4344 static int hf_ieee80211_rsn_akms_count = -1;
4345 static int hf_ieee80211_rsn_akms_list = -1;
4346 static int hf_ieee80211_rsn_akms = -1;
4347 static int hf_ieee80211_rsn_akms_oui = -1;
4348 static int hf_ieee80211_rsn_akms_80211_type = -1;
4349 static int hf_ieee80211_rsn_akms_type = -1;
4350 static int hf_ieee80211_rsn_cap = -1;
4351 static int hf_ieee80211_rsn_cap_preauth = -1;
4352 static int hf_ieee80211_rsn_cap_no_pairwise = -1;
4353 static int hf_ieee80211_rsn_cap_ptksa_replay_counter = -1;
4354 static int hf_ieee80211_rsn_cap_gtksa_replay_counter = -1;
4355 static int hf_ieee80211_rsn_cap_mfpr = -1;
4356 static int hf_ieee80211_rsn_cap_mfpc = -1;
4357 static int hf_ieee80211_rsn_cap_jmr = -1;
4358 static int hf_ieee80211_rsn_cap_peerkey = -1;
4359 static int hf_ieee80211_rsn_pmkid_count = -1;
4360 static int hf_ieee80211_rsn_pmkid_list = -1;
4361 static int hf_ieee80211_rsn_pmkid = -1;
4362 static int hf_ieee80211_rsn_gmcs = -1;
4363 static int hf_ieee80211_rsn_gmcs_oui = -1;
4364 static int hf_ieee80211_rsn_gmcs_type = -1;
4365 static int hf_ieee80211_rsn_gmcs_80211_type = -1;
4366
4367 static int hf_ieee80211_wfa_ie_type = -1;
4368 static int hf_ieee80211_wfa_ie_wpa_version = -1;
4369 static int hf_ieee80211_wfa_ie_wpa_mcs = -1;
4370 static int hf_ieee80211_wfa_ie_wpa_mcs_oui = -1;
4371 static int hf_ieee80211_wfa_ie_wpa_mcs_type = -1;
4372 static int hf_ieee80211_wfa_ie_wpa_mcs_wfa_type = -1;
4373 static int hf_ieee80211_wfa_ie_wpa_ucs_count = -1;
4374 static int hf_ieee80211_wfa_ie_wpa_ucs_list = -1;
4375 static int hf_ieee80211_wfa_ie_wpa_ucs = -1;
4376 static int hf_ieee80211_wfa_ie_wpa_ucs_oui = -1;
4377 static int hf_ieee80211_wfa_ie_wpa_ucs_wfa_type = -1;
4378 static int hf_ieee80211_wfa_ie_wpa_ucs_type = -1;
4379 static int hf_ieee80211_wfa_ie_wpa_akms_count = -1;
4380 static int hf_ieee80211_wfa_ie_wpa_akms_list = -1;
4381 static int hf_ieee80211_wfa_ie_wpa_akms = -1;
4382 static int hf_ieee80211_wfa_ie_wpa_akms_oui = -1;
4383 static int hf_ieee80211_wfa_ie_wpa_akms_wfa_type = -1;
4384 static int hf_ieee80211_wfa_ie_wpa_akms_type = -1;
4385 static int hf_ieee80211_wfa_ie_wme_subtype = -1;
4386 static int hf_ieee80211_wfa_ie_wme_version = -1;
4387 static int hf_ieee80211_wfa_ie_wme_qos_info = -1;
4388 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length = -1;
4389 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be = -1;
4390 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk = -1;
4391 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi = -1;
4392 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo = -1;
4393 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved = -1;
4394 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd = -1;
4395 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count = -1;
4396 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved = -1;
4397 static int hf_ieee80211_wfa_ie_wme_reserved = -1;
4398 static int hf_ieee80211_wfa_ie_wme_ac_parameters = -1;
4399 static int hf_ieee80211_wfa_ie_wme_acp_aci_aifsn = -1;
4400 static int hf_ieee80211_wfa_ie_wme_acp_aci = -1;
4401 static int hf_ieee80211_wfa_ie_wme_acp_acm = -1;
4402 static int hf_ieee80211_wfa_ie_wme_acp_aifsn = -1;
4403 static int hf_ieee80211_wfa_ie_wme_acp_reserved = -1;
4404 static int hf_ieee80211_wfa_ie_wme_acp_ecw = -1;
4405 static int hf_ieee80211_wfa_ie_wme_acp_ecw_max = -1;
4406 static int hf_ieee80211_wfa_ie_wme_acp_ecw_min = -1;
4407 static int hf_ieee80211_wfa_ie_wme_acp_txop_limit = -1;
4408 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo = -1;
4409 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid = -1;
4410 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction = -1;
4411 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb = -1;
4412 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up = -1;
4413 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved = -1;
4414 static int hf_ieee80211_wfa_ie_wme_tspec_nor_msdu = -1;
4415 static int hf_ieee80211_wfa_ie_wme_tspec_max_msdu = -1;
4416 static int hf_ieee80211_wfa_ie_wme_tspec_min_srv = -1;
4417 static int hf_ieee80211_wfa_ie_wme_tspec_max_srv = -1;
4418 static int hf_ieee80211_wfa_ie_wme_tspec_inact_int = -1;
4419 static int hf_ieee80211_wfa_ie_wme_tspec_susp_int = -1;
4420 static int hf_ieee80211_wfa_ie_wme_tspec_srv_start = -1;
4421 static int hf_ieee80211_wfa_ie_wme_tspec_min_data = -1;
4422 static int hf_ieee80211_wfa_ie_wme_tspec_mean_data = -1;
4423 static int hf_ieee80211_wfa_ie_wme_tspec_peak_data = -1;
4424 static int hf_ieee80211_wfa_ie_wme_tspec_burst_size = -1;
4425 static int hf_ieee80211_wfa_ie_wme_tspec_delay_bound = -1;
4426 static int hf_ieee80211_wfa_ie_wme_tspec_min_phy = -1;
4427 static int hf_ieee80211_wfa_ie_wme_tspec_surplus = -1;
4428 static int hf_ieee80211_wfa_ie_wme_tspec_medium = -1;
4429
4430 static int hf_ieee80211_aironet_ie_type = -1;
4431 static int hf_ieee80211_aironet_ie_dtpc = -1;
4432 static int hf_ieee80211_aironet_ie_version = -1;
4433 static int hf_ieee80211_aironet_ie_data = -1;
4434 static int hf_ieee80211_aironet_ie_qos_reserved = -1;
4435 static int hf_ieee80211_aironet_ie_qos_paramset = -1;
4436 static int hf_ieee80211_aironet_ie_qos_val = -1;
4437 static int hf_ieee80211_aironet_ie_clientmfp = -1;
4438
4439 static int hf_ieee80211_vs_nintendo_type = -1;
4440 static int hf_ieee80211_vs_nintendo_length = -1;
4441 static int hf_ieee80211_vs_nintendo_servicelist = -1;
4442 static int hf_ieee80211_vs_nintendo_service = -1;
4443 static int hf_ieee80211_vs_nintendo_consoleid = -1;
4444 static int hf_ieee80211_vs_nintendo_unknown = -1;
4445
4446 static int hf_ieee80211_vs_aruba_subtype = -1;
4447 static int hf_ieee80211_vs_aruba_apname = -1;
4448 static int hf_ieee80211_vs_aruba_data = -1;
4449
4450 static int hf_ieee80211_rsn_ie_pmkid = -1;
4451 static int hf_ieee80211_rsn_ie_unknown = -1;
4452
4453 static int hf_ieee80211_marvell_ie_type = -1;
4454 static int hf_ieee80211_marvell_ie_mesh_subtype = -1;
4455 static int hf_ieee80211_marvell_ie_mesh_version = -1;
4456 static int hf_ieee80211_marvell_ie_mesh_active_proto_id = -1;
4457 static int hf_ieee80211_marvell_ie_mesh_active_metric_id = -1;
4458 static int hf_ieee80211_marvell_ie_mesh_cap = -1;
4459 static int hf_ieee80211_marvell_ie_data = -1;
4460
4461 static int hf_ieee80211_atheros_ie_type = -1;
4462 static int hf_ieee80211_atheros_ie_subtype = -1;
4463 static int hf_ieee80211_atheros_ie_version = -1;
4464 static int hf_ieee80211_atheros_ie_cap_f_turbop = -1;
4465 static int hf_ieee80211_atheros_ie_cap_f_comp = -1;
4466 static int hf_ieee80211_atheros_ie_cap_f_ff = -1;
4467 static int hf_ieee80211_atheros_ie_cap_f_xr = -1;
4468 static int hf_ieee80211_atheros_ie_cap_f_ar = -1;
4469 static int hf_ieee80211_atheros_ie_cap_f_burst = -1;
4470 static int hf_ieee80211_atheros_ie_cap_f_wme = -1;
4471 static int hf_ieee80211_atheros_ie_cap_f_boost = -1;
4472 static int hf_ieee80211_atheros_ie_advcap_cap = -1;
4473 static int hf_ieee80211_atheros_ie_advcap_defkey = -1;
4474 static int hf_ieee80211_atheros_ie_xr_info = -1;
4475 static int hf_ieee80211_atheros_ie_xr_base_bssid = -1;
4476 static int hf_ieee80211_atheros_ie_xr_xr_bssid = -1;
4477 static int hf_ieee80211_atheros_ie_xr_xr_beacon = -1;
4478 static int hf_ieee80211_atheros_ie_xr_base_cap = -1;
4479 static int hf_ieee80211_atheros_ie_xr_xr_cap = -1;
4480 static int hf_ieee80211_atheros_ie_data = -1;
4481
4482 /*QBSS - Version 1,2,802.11e*/
4483
4484 static int hf_ieee80211_qbss2_cal = -1;
4485 static int hf_ieee80211_qbss2_gl = -1;
4486 static int hf_ieee80211_qbss_cu = -1;
4487 static int hf_ieee80211_qbss2_cu = -1;
4488 static int hf_ieee80211_qbss_scount = -1;
4489 static int hf_ieee80211_qbss2_scount = -1;
4490 static int hf_ieee80211_qbss_version = -1;
4491 static int hf_ieee80211_qbss_adc = -1;
4492
4493 static int hf_ieee80211_tsinfo = -1;
4494 static int hf_ieee80211_tsinfo_type = -1;
4495 static int hf_ieee80211_tsinfo_tsid = -1;
4496 static int hf_ieee80211_tsinfo_dir = -1;
4497 static int hf_ieee80211_tsinfo_access = -1;
4498 static int hf_ieee80211_tsinfo_agg = -1;
4499 static int hf_ieee80211_tsinfo_apsd = -1;
4500 static int hf_ieee80211_tsinfo_up = -1;
4501 static int hf_ieee80211_tsinfo_ack = -1;
4502 static int hf_ieee80211_tsinfo_sched = -1;
4503 static int hf_ieee80211_tsinfo_rsv = -1;
4504
4505 static const int *ieee80211_tsinfo_fields[] = {
4506   &hf_ieee80211_tsinfo_type,
4507   &hf_ieee80211_tsinfo_tsid,
4508   &hf_ieee80211_tsinfo_dir,
4509   &hf_ieee80211_tsinfo_access,
4510   &hf_ieee80211_tsinfo_agg,
4511   &hf_ieee80211_tsinfo_apsd,
4512   &hf_ieee80211_tsinfo_up,
4513   &hf_ieee80211_tsinfo_ack,
4514   &hf_ieee80211_tsinfo_sched,
4515   &hf_ieee80211_tsinfo_rsv,
4516   NULL
4517 };
4518
4519 static int hf_ieee80211_tspec_nor_msdu = -1;
4520 static int hf_ieee80211_tspec_max_msdu = -1;
4521 static int hf_ieee80211_tspec_min_srv = -1;
4522 static int hf_ieee80211_tspec_max_srv = -1;
4523 static int hf_ieee80211_tspec_inact_int = -1;
4524 static int hf_ieee80211_tspec_susp_int = -1;
4525 static int hf_ieee80211_tspec_srv_start = -1;
4526 static int hf_ieee80211_tspec_min_data = -1;
4527 static int hf_ieee80211_tspec_mean_data = -1;
4528 static int hf_ieee80211_tspec_peak_data = -1;
4529 static int hf_ieee80211_tspec_burst_size = -1;
4530 static int hf_ieee80211_tspec_delay_bound = -1;
4531 static int hf_ieee80211_tspec_min_phy = -1;
4532 static int hf_ieee80211_tspec_surplus = -1;
4533 static int hf_ieee80211_tspec_medium = -1;
4534 static int hf_ieee80211_tspec_dmg = -1;
4535 static int hf_ieee80211_ts_delay = -1;
4536 static int hf_ieee80211_tclas_process = -1;
4537 static int hf_ieee80211_tag_ext_supp_rates = -1;
4538 static int hf_ieee80211_sched_info = -1;
4539 static int hf_ieee80211_sched_info_agg = -1;
4540 static int hf_ieee80211_sched_info_tsid = -1;
4541 static int hf_ieee80211_sched_info_dir = -1;
4542 static int hf_ieee80211_sched_srv_start = -1;
4543 static int hf_ieee80211_sched_srv_int = -1;
4544 static int hf_ieee80211_sched_spec_int = -1;
4545 static int hf_ieee80211_tclas_up = -1;
4546 static int hf_ieee80211_tclas_class_type = -1;
4547 static int hf_ieee80211_tclas_class_mask = -1;
4548 static int hf_ieee80211_tclas_class_mask0_src_addr = -1;
4549 static int hf_ieee80211_tclas_class_mask0_dst_addr = -1;
4550 static int hf_ieee80211_tclas_class_mask0_type = -1;
4551 static int hf_ieee80211_tclas_class_mask1_ver = -1;
4552 static int hf_ieee80211_tclas_class_mask1_src_ip = -1;
4553 static int hf_ieee80211_tclas_class_mask1_dst_ip = -1;
4554 static int hf_ieee80211_tclas_class_mask1_src_port = -1;
4555 static int hf_ieee80211_tclas_class_mask1_dst_port = -1;
4556 static int hf_ieee80211_tclas_class_mask1_ipv4_dscp = -1;
4557 static int hf_ieee80211_tclas_class_mask1_ipv4_proto = -1;
4558 static int hf_ieee80211_tclas_class_mask1_ipv6_flow = -1;
4559 static int hf_ieee80211_tclas_class_mask2_tci = -1;
4560 static int hf_ieee80211_tclas_src_mac_addr = -1;
4561 static int hf_ieee80211_tclas_dst_mac_addr = -1;
4562 static int hf_ieee80211_tclas_ether_type = -1;
4563 static int hf_ieee80211_tclas_version = -1;
4564 static int hf_ieee80211_tclas_ipv4_src = -1;
4565 static int hf_ieee80211_tclas_ipv4_dst = -1;
4566 static int hf_ieee80211_tclas_src_port = -1;
4567 static int hf_ieee80211_tclas_dst_port = -1;
4568 static int hf_ieee80211_tclas_dscp = -1;
4569 static int hf_ieee80211_tclas_protocol = -1;
4570 static int hf_ieee80211_tclas_ipv6_src = -1;
4571 static int hf_ieee80211_tclas_ipv6_dst = -1;
4572 static int hf_ieee80211_tclas_flow = -1;
4573 static int hf_ieee80211_tclas_tag_type = -1;
4574
4575 static int hf_ieee80211_aruba = -1;
4576 static int hf_ieee80211_aruba_hb_seq = -1;
4577 static int hf_ieee80211_aruba_mtu = -1;
4578
4579 static int hf_ieee80211_tag_vendor_oui_type = -1;
4580 static int hf_ieee80211_tag_vendor_data = -1;
4581
4582 /* IEEE Std 802.11z-2010 7.3.2.62 */
4583 static int hf_ieee80211_tag_link_id_bssid = -1;
4584 static int hf_ieee80211_tag_link_id_init_sta = -1;
4585 static int hf_ieee80211_tag_link_id_resp_sta = -1;
4586
4587 /* IEEE Std 802.11z-2010 7.3.2.63 */
4588 static int hf_ieee80211_tag_wakeup_schedule_offset = -1;
4589 static int hf_ieee80211_tag_wakeup_schedule_interval = -1;
4590 static int hf_ieee80211_tag_wakeup_schedule_awake_window_slots = -1;
4591 static int hf_ieee80211_tag_wakeup_schedule_max_awake_dur = -1;
4592 static int hf_ieee80211_tag_wakeup_schedule_idle_count = -1;
4593
4594 /* IEEE Std 802.11z-2010 7.3.2.64 */
4595 static int hf_ieee80211_tag_channel_switch_timing_switch_time = -1;
4596 static int hf_ieee80211_tag_channel_switch_timing_switch_timeout = -1;
4597
4598 /* IEEE Std 802.11z-2010 7.3.2.65 */
4599 static int hf_ieee80211_tag_pti_control_tid = -1;
4600 static int hf_ieee80211_tag_pti_control_sequence_control = -1;
4601
4602 /* IEEE Std 802.11z-2010 7.3.2.66 */
4603 static int hf_ieee80211_tag_pu_buffer_status_ac_bk = -1;
4604 static int hf_ieee80211_tag_pu_buffer_status_ac_be = -1;
4605 static int hf_ieee80211_tag_pu_buffer_status_ac_vi = -1;
4606 static int hf_ieee80211_tag_pu_buffer_status_ac_vo = -1;
4607
4608 /* IEEE Std 802.11r-2008 7.3.2.49 */
4609 static int hf_ieee80211_tag_timeout_int_type = -1;
4610 static int hf_ieee80211_tag_timeout_int_value = -1;
4611
4612 /* Ethertype 89-0d */
4613 static int hf_ieee80211_data_encap_payload_type = -1;
4614
4615 static int hf_ieee80211_anqp_wfa_subtype = -1;
4616
4617 /* Hotspot 2.0 */
4618 static int hf_hs20_indication_dgaf_disabled = -1;
4619 static int hf_hs20_indication_pps_mo_id_present = -1;
4620 static int hf_hs20_indication_anqp_domain_id_present = -1;
4621 static int hf_hs20_indication_release_number = -1;
4622
4623 static int hf_hs20_anqp_subtype = -1;
4624 static int hf_hs20_anqp_reserved = -1;
4625 static int hf_hs20_anqp_payload = -1;
4626 static int hf_hs20_anqp_hs_query_list = -1;
4627 static int hf_hs20_anqp_hs_capability_list = -1;
4628 static int hf_hs20_anqp_ofn_length = -1;
4629 static int hf_hs20_anqp_ofn_language = -1;
4630 static int hf_hs20_anqp_ofn_name = -1;
4631 static int hf_hs20_anqp_wan_metrics_link_status = -1;
4632 static int hf_hs20_anqp_wan_metrics_symmetric_link = -1;
4633 static int hf_hs20_anqp_wan_metrics_at_capacity = -1;
4634 static int hf_hs20_anqp_wan_metrics_reserved = -1;
4635 static int hf_hs20_anqp_wan_metrics_downlink_speed = -1;
4636 static int hf_hs20_anqp_wan_metrics_uplink_speed = -1;
4637 static int hf_hs20_anqp_wan_metrics_downlink_load = -1;
4638 static int hf_hs20_anqp_wan_metrics_uplink_load = -1;
4639 static int hf_hs20_anqp_wan_metrics_lmd = -1;
4640 static int hf_hs20_anqp_cc_proto_ip_proto = -1;
4641 static int hf_hs20_anqp_cc_proto_port_num = -1;
4642 static int hf_hs20_anqp_cc_proto_status = -1;
4643 static int hf_hs20_anqp_nai_hrq_count = -1;
4644 static int hf_hs20_anqp_nai_hrq_encoding_type = -1;
4645 static int hf_hs20_anqp_nai_hrq_length = -1;
4646 static int hf_hs20_anqp_nai_hrq_realm_name = -1;
4647 static int hf_hs20_anqp_oper_class_indic = -1;
4648
4649 /* IEEE Std 802.11ad */
4650 static int hf_ieee80211_block_ack_RBUFCAP = -1;
4651 static int hf_ieee80211_cf_response_offset = -1;
4652 static int hf_ieee80211_ff_dynamic_allocation = -1;
4653 static int hf_ieee80211_ff_TID = -1;
4654 static int hf_ieee80211_ff_alloc_type = -1;
4655 static int hf_ieee80211_ff_src_aid = -1;
4656 static int hf_ieee80211_ff_dest_aid = -1;
4657 static int hf_ieee80211_ff_alloc_duration = -1;
4658 static int hf_ieee80211_ff_ssw = -1;
4659 static int hf_ieee80211_ff_ssw_direction = -1;
4660 static int hf_ieee80211_ff_ssw_cdown = -1;
4661 static int hf_ieee80211_ff_ssw_sector_id = -1;
4662 static int hf_ieee80211_ff_ssw_dmg_ant_id = -1;
4663 static int hf_ieee80211_ff_ssw_rxss_len = -1;
4664 static int hf_ieee80211_ff_bf = -1;
4665 static int hf_ieee80211_ff_bf_train = -1;
4666 static int hf_ieee80211_ff_bf_is_init = -1;
4667 static int hf_ieee80211_ff_bf_is_resp = -1;
4668 static int hf_ieee80211_ff_bf_num_sectors = -1;
4669 static int hf_ieee80211_ff_bf_num_rx_dmg_ants = -1;
4670 static int hf_ieee80211_ff_bf_rxss_len = -1;
4671 static int hf_ieee80211_ff_bf_rxss_rate = -1;
4672 static int hf_ieee80211_addr_nav_da = -1;
4673 static int hf_ieee80211_addr_nav_sa = -1;
4674 static int hf_ieee80211_ff_sswf = -1;
4675 static int hf_ieee80211_ff_sswf_num_rx_dmg_ants = -1;
4676 static int hf_ieee80211_ff_sswf_poll_required = -1;
4677 static int hf_ieee80211_ff_sswf_total_sectors = -1;
4678 static int hf_ieee80211_ff_brp = -1;
4679 static int hf_ieee80211_ff_brp_L_RX = -1;
4680 static int hf_ieee80211_ff_brp_TX_TRN_REQ = -1;
4681 static int hf_ieee80211_ff_brp_MID_REQ = -1;
4682 static int hf_ieee80211_ff_brp_BC_REQ = -1;
4683 static int hf_ieee80211_ff_brp_MID_GRANT = -1;
4684 static int hf_ieee80211_ff_brp_BC_GRANT = -1;
4685 static int hf_ieee80211_ff_brp_chan_FBCK_CAP = -1;
4686 static int hf_ieee80211_ff_brp_tx_sector = -1;
4687 static int hf_ieee80211_ff_brp_other_aid = -1;
4688 static int hf_ieee80211_ff_brp_tx_antenna = -1;
4689 static int hf_ieee80211_ff_blm = -1;
4690 static int hf_ieee80211_ff_blm_unit_index = -1;
4691 static int hf_ieee80211_ff_blm_maint_value = -1;
4692 static int hf_ieee80211_ff_blm_is_master = -1;
4693 static int hf_ieee80211_ff_bic = -1;
4694 static int hf_ieee80211_ff_bic_cc_present = -1;
4695 static int hf_ieee80211_ff_bic_discovery_mode = -1;
4696 static int hf_ieee80211_ff_bic_next_beacon = -1;
4697 static int hf_ieee80211_ff_bic_ati_present = -1;
4698 static int hf_ieee80211_ff_bic_abft_len = -1;
4699 static int hf_ieee80211_ff_bic_fss = -1;
4700 static int hf_ieee80211_ff_bic_is_resp = -1;
4701 static int hf_ieee80211_ff_bic_next_abft = -1;
4702 static int hf_ieee80211_ff_bic_frag_txss = -1;
4703 static int hf_ieee80211_ff_bic_txss_span = -1;
4704 static int hf_ieee80211_ff_bic_NBI_abft = -1;
4705 static int hf_ieee80211_ff_bic_abft_count = -1;
4706 static int hf_ieee80211_ff_bic_nabft = -1;
4707 static int hf_ieee80211_ff_bic_pcp = -1;
4708 static int hf_ieee80211_ff_dmg_params = -1;
4709 static int hf_ieee80211_ff_dmg_params_bss = -1;
4710 static int hf_ieee80211_ff_dmg_params_cbap_only = -1;
4711 static int hf_ieee80211_ff_dmg_params_cbap_src = -1;
4712 static int hf_ieee80211_ff_dmg_params_privacy = -1;
4713 static int hf_ieee80211_ff_dmg_params_policy = -1;
4714 static int hf_ieee80211_ff_cc = -1;
4715 static int hf_ieee80211_ff_cc_abft_resp_addr = -1;
4716 static int hf_ieee80211_ff_cc_sp_duration = -1;
4717 static int hf_ieee80211_ff_cc_cluster_id = -1;
4718 static int hf_ieee80211_ff_cc_role = -1;
4719 static int hf_ieee80211_ff_cc_max_mem = -1;
4720 static int hf_ieee80211_ff_dmg_action_code = -1;
4721 static int hf_ieee80211_ff_dmg_pwr_mgmt = -1;
4722 static int hf_ieee80211_ff_subject_address = -1;
4723 static int hf_ieee80211_ff_handover_reason = -1;
4724 static int hf_ieee80211_ff_handover_remaining_bi = -1;
4725 static int hf_ieee80211_ff_handover_result = -1;
4726 static int hf_ieee80211_ff_handover_reject_reason = -1;
4727 static int hf_ieee80211_ff_destination_reds_aid = -1;
4728 static int hf_ieee80211_ff_destination_aid = -1;
4729 static int hf_ieee80211_ff_realy_aid = -1;
4730 static int hf_ieee80211_ff_source_aid = -1;
4731 static int hf_ieee80211_ff_timing_offset = -1;
4732 static int hf_ieee80211_ff_sampling_frequency_offset = -1;
4733 static int hf_ieee80211_ff_relay_operation_type = -1;
4734 static int hf_ieee80211_ff_peer_sta_aid = -1;
4735 static int hf_ieee80211_ff_snr = -1;
4736 static int hf_ieee80211_ff_internal_angle = -1;
4737 static int hf_ieee80211_ff_recommend = -1;
4738 static int hf_ieee80211_ff_unprotected_dmg_action_code = -1;
4739 static int hf_ieee80211_ff_fst_action_code = -1;
4740 static int hf_ieee80211_ff_llt = -1;
4741 static int hf_ieee80211_ff_fsts_id = -1;
4742 static int hf_ieee80211_ff_mmpdu_len = -1;
4743 static int hf_ieee80211_ff_mmpdu_ctrl = -1;
4744 static int hf_ieee80211_ff_oct_mmpdu = -1;
4745 static int hf_ieee80211_ff_rcsi = -1;
4746 static int hf_ieee80211_ff_rcsi_aid = -1;
4747 static int hf_ieee80211_ff_band_id = -1;
4748 static int hf_ieee80211_tag_relay_support = -1;
4749 static int hf_ieee80211_tag_relay_use = -1;
4750 static int hf_ieee80211_tag_relay_permission = -1;
4751 static int hf_ieee80211_tag_AC_power = -1;
4752 static int hf_ieee80211_tag_relay_prefer = -1;
4753 static int hf_ieee80211_tag_duplex = -1;
4754 static int hf_ieee80211_tag_cooperation = -1;
4755 static int hf_ieee80211_tag_move = -1;
4756 static int hf_ieee80211_tag_size = -1;
4757 static int hf_ieee80211_tag_tbtt_offset = -1;
4758 static int hf_ieee80211_tag_bi_duration = -1;
4759 static int hf_ieee80211_tag_dmg_capa_sta_addr = -1;
4760 static int hf_ieee80211_tag_dmg_capa_aid = -1;
4761 static int hf_ieee80211_tag_reverse_direction = -1;
4762 static int hf_ieee80211_tag_hlts = -1;
4763 static int hf_ieee80211_tag_tpc = -1;
4764 static int hf_ieee80211_tag_spsh = -1;
4765 static int hf_ieee80211_tag_rx_antenna = -1;
4766 static int hf_ieee80211_tag_fast_link = -1;
4767 static int hf_ieee80211_tag_num_sectors = -1;
4768 static int hf_ieee80211_tag_rxss_length = -1;
4769 static int hf_ieee80211_tag_reciprocity = -1;
4770 static int hf_ieee80211_tag_max_ampdu_exp = -1;
4771 static int hf_ieee80211_tag_min_mpdu_sapcing = -1;
4772 static int hf_ieee80211_tag_ba_flow_control = -1;
4773 static int hf_ieee80211_tag_max_sc_rx_mcs = -1;
4774 static int hf_ieee80211_tag_max_ofdm_rx_mcs = -1;
4775 static int hf_ieee80211_tag_max_sc_tx_mcs = -1;
4776 static int hf_ieee80211_tag_max_ofdm_tx_mcs = -1;
4777 static int hf_ieee80211_tag_low_power_supported = -1;
4778 static int hf_ieee80211_tag_code_rate = -1;
4779 static int hf_ieee80211_tag_dtp = -1;
4780 static int hf_ieee80211_tag_appdu_supp = -1;
4781 static int hf_ieee80211_tag_heartbeat = -1;
4782 static int hf_ieee80211_tag_other_aid = -1;
4783 static int hf_ieee80211_tag_pattern_recip = -1;
4784 static int hf_ieee80211_tag_heartbeat_elapsed = -1;
4785 static int hf_ieee80211_tag_grant_ack_supp = -1;
4786 static int hf_ieee80211_tag_RXSSTxRate_supp = -1;
4787 static int hf_ieee80211_tag_pcp_tddti = -1;
4788 static int hf_ieee80211_tag_pcp_PSA = -1;
4789 static int hf_ieee80211_tag_pcp_handover = -1;
4790 static int hf_ieee80211_tag_pcp_max_assoc = -1;
4791 static int hf_ieee80211_tag_pcp_power_src = -1;
4792 static int hf_ieee80211_tag_pcp_decenter = -1;
4793 static int hf_ieee80211_tag_pcp_forwarding = -1;
4794 static int hf_ieee80211_tag_pcp_center = -1;
4795 static int hf_ieee80211_tag_PSRSI = -1;
4796 static int hf_ieee80211_tag_min_BHI_duration = -1;
4797 static int hf_ieee80211_tag_brdct_sta_info_dur = -1;
4798 static int hf_ieee80211_tag_assoc_resp_confirm_time = -1;
4799 static int hf_ieee80211_tag_min_pp_duration = -1;
4800 static int hf_ieee80211_tag_SP_idle_timeout = -1;
4801 static int hf_ieee80211_tag_max_lost_beacons = -1;
4802 static int hf_ieee80211_tag_type = -1;
4803 static int hf_ieee80211_tag_tap1 = -1;
4804 static int hf_ieee80211_tag_state1 = -1;
4805 static int hf_ieee80211_tag_tap2 = -1;
4806 static int hf_ieee80211_tag_state2 = -1;
4807 static int hf_ieee80211_tag_allocation_id = -1;
4808 static int hf_ieee80211_tag_allocation_type = -1;
4809 static int hf_ieee80211_tag_pseudo_static = -1;
4810 static int hf_ieee80211_tag_truncatable = -1;
4811 static int hf_ieee80211_tag_extendable = -1;
4812 static int hf_ieee80211_tag_pcp_active = -1;
4813 static int hf_ieee80211_tag_lp_sc_used = -1;
4814 static int hf_ieee80211_tag_src_aid = -1;
4815 static int hf_ieee80211_tag_dest_aid = -1;
4816 static int hf_ieee80211_tag_alloc_start = -1;
4817 static int hf_ieee80211_tag_alloc_block_duration = -1;
4818 static int hf_ieee80211_tag_num_blocks = -1;
4819 static int hf_ieee80211_tag_alloc_block_period = -1;
4820 static int hf_ieee80211_tag_aid = -1;
4821 static int hf_ieee80211_tag_cbap = -1;
4822 static int hf_ieee80211_tag_pp_avail = -1;
4823 static int hf_ieee80211_tag_next_ati_start_time = -1;
4824 static int hf_ieee80211_tag_next_ati_duration = -1;
4825 static int hf_ieee80211_tag_old_bssid = -1;
4826 static int hf_ieee80211_tag_new_pcp_addr = -1;
4827 static int hf_ieee80211_tag_bssid = -1;
4828 static int hf_ieee80211_tag_duplex_relay = -1;
4829 static int hf_ieee80211_tag_cooperation_relay = -1;
4830 static int hf_ieee80211_tag_tx_mode = -1;
4831 static int hf_ieee80211_tag_link_change_interval = -1;
4832 static int hf_ieee80211_tag_data_sensing_time = -1;
4833 static int hf_ieee80211_tag_first_period = -1;
4834 static int hf_ieee80211_tag_second_period = -1;
4835 static int hf_ieee80211_tag_initiator = -1;
4836 static int hf_ieee80211_tag_tx_train_res = -1;
4837 static int hf_ieee80211_tag_rx_train_res = -1;
4838 static int hf_ieee80211_tag_tx_trn_ok = -1;
4839 static int hf_ieee80211_tag_txss_fbck_req = -1;
4840 static int hf_ieee80211_tag_bs_fbck = -1;
4841 static int hf_ieee80211_tag_bs_fbck_antenna_id = -1;
4842 static int hf_ieee80211_tag_snr_requested = -1;
4843 static int hf_ieee80211_tag_channel_measurement_requested = -1;
4844 static int hf_ieee80211_tag_number_of_taps_requested = -1;
4845 static int hf_ieee80211_tag_sector_id_order_req = -1;
4846 static int hf_ieee80211_tag_snr_present = -1;
4847 static int hf_ieee80211_tag_channel_measurement_present = -1;
4848 static int hf_ieee80211_tag_tap_delay_present = -1;
4849 static int hf_ieee80211_tag_number_of_taps_present = -1;
4850 static int hf_ieee80211_tag_number_of_measurement = -1;
4851 static int hf_ieee80211_tag_sector_id_order_present = -1;
4852 static int hf_ieee80211_tag_number_of_beams = -1;
4853 static int hf_ieee80211_tag_mid_extension = -1;
4854 static int hf_ieee80211_tag_capability_request = -1;
4855 static int hf_ieee80211_tag_nextpcp_list = -1;
4856 static int hf_ieee80211_tag_nextpcp_token = -1;
4857 static int hf_ieee80211_tag_reamaining_BI = -1;
4858 static int hf_ieee80211_tag_request_token = -1;
4859 static int hf_ieee80211_tag_bi_start_time = -1;
4860 static int hf_ieee80211_tag_sleep_cycle = -1;
4861 static int hf_ieee80211_tag_num_awake_bis = -1;
4862 static int hf_ieee80211_tag_tspec_allocation_id = -1;
4863 static int hf_ieee80211_tag_tspec_allocation_type = -1;
4864 static int hf_ieee80211_tag_tspec_allocation_format = -1;
4865 static int hf_ieee80211_tag_tspec_pseudo_static = -1;
4866 static int hf_ieee80211_tag_tspec_truncatable = -1;
4867 static int hf_ieee80211_tag_tspec_extendable = -1;
4868 static int hf_ieee80211_tag_tspec_lp_sc_used = -1;
4869 static int hf_ieee80211_tag_tspec_up = -1;
4870 static int hf_ieee80211_tag_tspec_dest_aid = -1;
4871 static int hf_ieee80211_tag_tspec_allocation_period = -1;
4872 static int hf_ieee80211_tag_tspec_min_allocation = -1;
4873 static int hf_ieee80211_tag_tspec_max_allocation = -1;
4874 static int hf_ieee80211_tag_tspec_min_duration = -1;
4875 static int hf_ieee80211_tag_tspec_num_of_constraints = -1;
4876 static int hf_ieee80211_tag_tspec_tsconst_start_time = -1;
4877 static int hf_ieee80211_tag_tspec_tsconst_duration = -1;
4878 static int hf_ieee80211_tag_tspec_tsconst_period = -1;
4879 static int hf_ieee80211_tag_tspec_tsconst_interferer_mac = -1;
4880 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_I = -1;
4881 static int hf_ieee80211_tag_channel_measurement_feedback_realtive_Q = -1;
4882 static int hf_ieee80211_tag_channel_measurement_feedback_tap_delay = -1;
4883 static int hf_ieee80211_tag_channel_measurement_feedback_sector_id = -1;
4884 static int hf_ieee80211_tag_channel_measurement_feedback_antenna_id = -1;
4885 static int hf_ieee80211_tag_awake_window = -1;
4886 static int hf_ieee80211_tag_addba_ext_no_frag = -1;
4887 static int hf_ieee80211_tag_multi_band_ctrl_sta_role = -1;
4888 static int hf_ieee80211_tag_multi_band_ctrl_addr_present = -1;
4889 static int hf_ieee80211_tag_multi_band_ctrl_cipher_present = -1;
4890 static int hf_ieee80211_tag_multi_band_oper_class = -1;
4891 static int hf_ieee80211_tag_multi_band_channel_number = -1;
4892 static int hf_ieee80211_tag_multi_band_tsf_offset = -1;
4893 static int hf_ieee80211_tag_multi_band_conn_ap = -1;
4894 static int hf_ieee80211_tag_multi_band_conn_pcp = -1;
4895 static int hf_ieee80211_tag_multi_band_conn_dls = -1;
4896 static int hf_ieee80211_tag_multi_band_conn_tdls = -1;
4897 static int hf_ieee80211_tag_multi_band_conn_ibss = -1;
4898 static int hf_ieee80211_tag_multi_band_fst_timeout = -1;
4899 static int hf_ieee80211_tag_multi_band_sta_mac = -1;
4900 static int hf_ieee80211_tag_activity = -1;
4901 static int hf_ieee80211_tag_dmg_link_adapt_mcs = -1;
4902 static int hf_ieee80211_tag_dmg_link_adapt_link_margin = -1;
4903 static int hf_ieee80211_tag_ref_timestamp = -1;
4904 static int hf_ieee80211_tag_switching_stream_non_qos = -1;
4905 static int hf_ieee80211_tag_switching_stream_param_num = -1;
4906 static int hf_ieee80211_tag_switching_stream_old_tid = -1;
4907 static int hf_ieee80211_tag_switching_stream_old_direction = -1;
4908 static int hf_ieee80211_tag_switching_stream_new_tid = -1;
4909 static int hf_ieee80211_tag_switching_stream_new_direction = -1;
4910 static int hf_ieee80211_tag_switching_stream_new_valid_id = -1;
4911 static int hf_ieee80211_tag_switching_stream_llt_type = -1;
4912
4913 static int hf_ieee80211_mysterious_olpc_stuff = -1;
4914
4915 /* ************************************************************************* */
4916 /*                               Protocol trees                              */
4917 /* ************************************************************************* */
4918 static gint ett_80211 = -1;
4919 static gint ett_proto_flags = -1;
4920 static gint ett_cap_tree = -1;
4921 static gint ett_fc_tree = -1;
4922 static gint ett_cntrl_wrapper_fc = -1;
4923 static gint ett_cntrl_wrapper_payload = -1;
4924 static gint ett_fragments = -1;
4925 static gint ett_fragment = -1;
4926 static gint ett_block_ack = -1;
4927 static gint ett_block_ack_bitmap = -1;
4928 static gint ett_ath_cap_tree = -1;
4929
4930 static gint ett_80211_mgt = -1;
4931 static gint ett_fixed_parameters = -1;
4932 static gint ett_tagged_parameters = -1;
4933 static gint ett_tag_bmapctl_tree = -1;
4934 static gint ett_tag_country_fnm_tree = -1;
4935 static gint ett_tag_country_rcc_tree = -1;
4936 static gint ett_qos_parameters = -1;
4937 static gint ett_qos_ps_buf_state = -1;
4938 static gint ett_wep_parameters = -1;
4939 static gint ett_msh_control = -1;
4940 static gint ett_hwmp_targ_flags_tree = -1;
4941 static gint ett_mesh_chswitch_flag_tree = -1;
4942 static gint ett_mesh_config_cap_tree = -1;
4943 static gint ett_mesh_formation_info_tree = -1;
4944
4945 static gint ett_rsn_gcs_tree = -1;
4946 static gint ett_rsn_pcs_tree = -1;
4947 static gint ett_rsn_sub_pcs_tree = -1;
4948 static gint ett_rsn_akms_tree = -1;
4949 static gint ett_rsn_sub_akms_tree = -1;
4950 static gint ett_rsn_cap_tree = -1;
4951 static gint ett_rsn_pmkid_tree = -1;
4952 static gint ett_rsn_gmcs_tree = -1;
4953
4954 static gint ett_wpa_mcs_tree = -1;
4955 static gint ett_wpa_ucs_tree = -1;
4956 static gint ett_wpa_sub_ucs_tree = -1;
4957 static gint ett_wpa_akms_tree = -1;
4958 static gint ett_wpa_sub_akms_tree = -1;
4959 static gint ett_wme_ac = -1;
4960 static gint ett_wme_aci_aifsn = -1;
4961 static gint ett_wme_ecw = -1;
4962 static gint ett_wme_qos_info = -1;
4963
4964 static gint ett_ht_cap_tree = -1;
4965 static gint ett_ampduparam_tree = -1;
4966 static gint ett_mcsset_tree = -1;
4967 static gint ett_mcsbit_tree = -1;
4968 static gint ett_htex_cap_tree = -1;
4969 static gint ett_txbf_tree = -1;
4970 static gint ett_antsel_tree = -1;
4971 static gint ett_hta_cap_tree = -1;
4972 static gint ett_hta_cap1_tree = -1;
4973 static gint ett_hta_cap2_tree = -1;
4974
4975 static gint ett_htc_tree = -1;
4976 static gint ett_mfb_subtree = -1;
4977 static gint ett_lac_subtree = -1;
4978
4979 static gint ett_vht_cap_tree = -1;
4980 static gint ett_vht_mcsset_tree = -1;
4981 static gint ett_vht_rx_mcsbit_tree = -1;
4982 static gint ett_vht_tx_mcsbit_tree = -1;
4983 static gint ett_vht_basic_mcsbit_tree = -1;
4984 static gint ett_vht_op_tree = -1;
4985 static gint ett_vht_tpe_info_tree = -1;
4986
4987 static gint ett_vht_ndp_annc_token_tree = -1;
4988 static gint ett_vht_ndp_annc_sta_info_tree = -1;
4989
4990 static gint ett_ff_vhtmimo_cntrl = -1;
4991 static gint ett_ff_vhtmimo_beamforming_report = -1;
4992 static gint ett_ff_vhtmimo_beamforming_report_snr = -1;
4993 static gint ett_ff_vhtmimo_beamforming_report_feedback_matrices = -1;
4994
4995 static gint ett_vht_grpidmgmt = -1;
4996
4997 static gint ett_ht_info_delimiter1_tree = -1;
4998 static gint ett_ht_info_delimiter2_tree = -1;
4999 static gint ett_ht_info_delimiter3_tree = -1;
5000
5001 static gint ett_tag_measure_request_mode_tree = -1;
5002 static gint ett_tag_measure_request_type_tree = -1;
5003 static gint ett_tag_measure_report_mode_tree = -1;
5004 static gint ett_tag_measure_report_type_tree = -1;
5005 static gint ett_tag_measure_report_basic_map_tree = -1;
5006 static gint ett_tag_measure_report_rpi_tree = -1;
5007 static gint ett_tag_measure_report_frame_tree = -1;
5008 static gint ett_tag_measure_reported_frame_tree = -1;
5009 static gint ett_tag_bss_bitmask_tree = -1;
5010 static gint ett_tag_dfs_map_tree = -1;
5011 static gint ett_tag_erp_info_tree = -1;
5012 static gint ett_tag_ex_cap1 = -1;
5013 static gint ett_tag_ex_cap2 = -1;
5014 static gint ett_tag_ex_cap3 = -1;
5015 static gint ett_tag_ex_cap4 = -1;
5016 static gint ett_tag_ex_cap5 = -1;
5017 static gint ett_tag_ex_cap6 = -1;
5018 static gint ett_tag_ex_cap7 = -1;
5019 static gint ett_tag_ex_cap8 = -1;
5020 static gint ett_tag_ex_cap9 = -1;
5021
5022 static gint ett_tag_rm_cap1 = -1;
5023 static gint ett_tag_rm_cap2 = -1;
5024 static gint ett_tag_rm_cap3 = -1;
5025 static gint ett_tag_rm_cap4 = -1;
5026 static gint ett_tag_rm_cap5 = -1;
5027 static gint ett_tag_tclas_mask_tree = -1;
5028
5029 static gint ett_tag_supported_channels = -1;
5030
5031 static gint ett_tag_neighbor_report_bssid_info_tree = -1;
5032 static gint ett_tag_neighbor_report_bssid_info_capability_tree = -1;
5033 static gint ett_tag_neighbor_report_sub_tag_tree = -1;
5034
5035 static gint ett_tag_wapi_param_set_akm_tree = -1;
5036 static gint ett_tag_wapi_param_set_ucast_tree = -1;
5037 static gint ett_tag_wapi_param_set_mcast_tree = -1;
5038 static gint ett_tag_wapi_param_set_preauth_tree = -1;
5039
5040 static gint ett_tag_time_adv_tree = -1;
5041
5042 static gint ett_ff_ba_param_tree = -1;
5043 static gint ett_ff_ba_ssc_tree = -1;
5044 static gint ett_ff_delba_param_tree = -1;
5045 static gint ett_ff_qos_info = -1;
5046 static gint ett_ff_sm_pwr_save = -1;
5047 static gint ett_ff_psmp_param_set = -1;
5048 static gint ett_ff_mimo_cntrl = -1;
5049 static gint ett_ff_ant_sel = -1;
5050 static gint ett_mimo_report = -1;
5051 static gint ett_ff_chan_switch_announce = -1;
5052 static gint ett_ff_ht_info = -1;
5053 static gint ett_ff_psmp_sta_info = -1;
5054
5055 static gint ett_tpc = -1;
5056
5057 static gint ett_msdu_aggregation_parent_tree = -1;
5058 static gint ett_msdu_aggregation_subframe_tree = -1;
5059
5060 static gint ett_80211_mgt_ie = -1;
5061 static gint ett_tsinfo_tree = -1;
5062 static gint ett_sched_tree = -1;
5063
5064 static gint ett_fcs = -1;
5065
5066 static gint ett_adv_proto = -1;
5067 static gint ett_adv_proto_tuple = -1;
5068 static gint ett_gas_query = -1;
5069 static gint ett_gas_anqp = -1;
5070 static gint ett_nai_realm = -1;
5071 static gint ett_nai_realm_eap = -1;
5072 static gint ett_tag_ric_data_desc_ie = -1;
5073 static gint ett_anqp_vendor_capab = -1;
5074
5075 static gint ett_hs20_cc_proto_port_tuple = -1;
5076
5077 static gint ett_ssid_list = -1;
5078
5079 static gint ett_nintendo = -1;
5080
5081 static gint ett_qos_map_set_exception = -1;
5082 static gint ett_qos_map_set_range = -1;
5083
5084 static expert_field ei_ieee80211_bad_length = EI_INIT;
5085 static expert_field ei_ieee80211_inv_val = EI_INIT;
5086 static expert_field ei_ieee80211_vht_tpe_pwr_info_count = EI_INIT;
5087 static expert_field ei_ieee80211_ff_query_response_length = EI_INIT;
5088 static expert_field ei_ieee80211_ff_anqp_nai_realm_eap_len = EI_INIT;
5089 static expert_field ei_hs20_anqp_nai_hrq_length = EI_INIT;
5090 static expert_field ei_ieee80211_extra_data = EI_INIT;
5091 static expert_field ei_ieee80211_tag_data = EI_INIT;
5092 static expert_field ei_ieee80211_tdls_setup_confirm_malformed = EI_INIT;
5093 static expert_field ei_ieee80211_ff_anqp_nai_field_len = EI_INIT;
5094 static expert_field ei_ieee80211_rsn_pcs_count = EI_INIT;
5095 static expert_field ei_ieee80211_tag_measure_request_unknown = EI_INIT;
5096 static expert_field ei_ieee80211_tag_measure_request_beacon_unknown = EI_INIT;
5097 static expert_field ei_ieee80211_tag_measure_report_unknown = EI_INIT;
5098 static expert_field ei_ieee80211_tag_number = EI_INIT;
5099 static expert_field ei_ieee80211_ff_anqp_info_length = EI_INIT;
5100 static expert_field ei_hs20_anqp_ofn_length = EI_INIT;
5101 static expert_field ei_ieee80211_tdls_setup_response_malformed = EI_INIT;
5102 static expert_field ei_ieee80211_ff_anqp_capability = EI_INIT;
5103 static expert_field ei_ieee80211_not_enough_room_for_anqp_header = EI_INIT;
5104 static expert_field ei_ieee80211_ff_query_request_length = EI_INIT;
5105 static expert_field ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype = EI_INIT;
5106 static expert_field ei_ieee80211_qos_info_bad_ftype = EI_INIT;
5107 static expert_field ei_ieee80211_pmkid_count_too_large = EI_INIT;
5108 static expert_field ei_ieee80211_ff_anqp_venue_length = EI_INIT;
5109 static expert_field ei_ieee80211_ff_anqp_roaming_consortium_oi_len = EI_INIT;
5110 static expert_field ei_ieee80211_tag_length = EI_INIT;
5111 static expert_field ei_ieee80211_missing_data = EI_INIT;
5112 static expert_field ei_ieee80211_rsn_pmkid_count = EI_INIT;
5113 static expert_field ei_ieee80211_fc_retry = EI_INIT;
5114 static expert_field ei_ieee80211_tag_wnm_sleep_mode_no_key_data = EI_INIT;
5115 static expert_field ei_ieee80211_dmg_subtype = EI_INIT;
5116 static expert_field ei_ieee80211_vht_action = EI_INIT;
5117 static expert_field ei_ieee80211_mesh_peering_unexpected = EI_INIT;
5118
5119 /* 802.11ad trees */
5120 static gint ett_dynamic_alloc_tree = -1;
5121 static gint ett_ssw_tree = -1;
5122 static gint ett_bf_tree = -1;
5123 static gint ett_sswf_tree = -1;
5124 static gint ett_brp_tree = -1;
5125 static gint ett_blm_tree = -1;
5126 static gint ett_bic_tree = -1;
5127 static gint ett_dmg_params_tree = -1;
5128 static gint ett_cc_tree = -1;
5129 static gint ett_rcsi_tree = -1;
5130 static gint ett_80211_ext = -1;
5131 static gint ett_allocation_tree = -1;
5132 static gint ett_sta_info = -1;
5133
5134 static const fragment_items frag_items = {
5135   &ett_fragment,
5136   &ett_fragments,
5137   &hf_ieee80211_fragments,
5138   &hf_ieee80211_fragment,
5139   &hf_ieee80211_fragment_overlap,
5140   &hf_ieee80211_fragment_overlap_conflict,
5141   &hf_ieee80211_fragment_multiple_tails,
5142   &hf_ieee80211_fragment_too_long_fragment,
5143   &hf_ieee80211_fragment_error,
5144   &hf_ieee80211_fragment_count,
5145   &hf_ieee80211_reassembled_in,
5146   &hf_ieee80211_reassembled_length,
5147   /* Reassembled data field */
5148   NULL,
5149   "fragments"
5150 };
5151
5152 static const enum_val_t wlan_ignore_wep_options[] = {
5153   { "no",         "No",               WLAN_IGNORE_WEP_NO    },
5154   { "without_iv", "Yes - without IV", WLAN_IGNORE_WEP_WO_IV },
5155   { "with_iv",    "Yes - with IV",    WLAN_IGNORE_WEP_W_IV  },
5156   { NULL,         NULL,               0                     }
5157 };
5158
5159 static int wlan_address_type = -1;
5160 static int wlan_bssid_address_type = -1;
5161
5162 static address bssid_broadcast;
5163 gboolean is_broadcast_bssid(const address *bssid) {
5164   return addresses_equal(&bssid_broadcast, bssid);
5165 }
5166
5167 static dissector_handle_t ieee80211_handle;
5168 static dissector_handle_t llc_handle;
5169 static dissector_handle_t ipx_handle;
5170 static dissector_handle_t eth_withoutfcs_handle;
5171 static dissector_handle_t data_handle;
5172
5173 static int wlan_tap = -1;
5174
5175 static const value_string access_network_type_vals[] = {
5176   {  0, "Private network" },
5177   {  1, "Private network with guest access" },
5178   {  2, "Chargeable public network" },
5179   {  3, "Free public network" },
5180   {  4, "Personal device network" },
5181   {  5, "Emergency services only network" },
5182   { 14, "Test or experimental" },
5183   { 15, "Wildcard" },
5184   { 0, NULL }
5185 };
5186
5187 static const value_string adv_proto_id_vals[] = {
5188   {  0, "Access Network Query Protocol"},
5189   {  1, "MIH Information Service"},
5190   {  2, "MIH Command and Event Services Capability Discovery"},
5191   {  3, "Emergency Alert System (EAS)"},
5192   {  4, "Location-to-Service Translation Protocol"},
5193   {221, "Vendor Specific"},
5194   {0, NULL}
5195 };
5196
5197 static const value_string timeout_int_types[] = {
5198   {1, "Reassociation deadline interval (TUs)"},
5199   {2, "Key lifetime interval (seconds)"},
5200   {3, "Association Comeback time (TUs)"},
5201   {4, "Time to start (TUs)"},
5202   {0, NULL}
5203 };
5204
5205 static const value_string tdls_action_codes[] = {
5206   {TDLS_SETUP_REQUEST,           "TDLS Setup Request"},
5207   {TDLS_SETUP_RESPONSE,          "TDLS Setup Response"},
5208   {TDLS_SETUP_CONFIRM,           "TDLS Setup Confirm"},
5209   {TDLS_TEARDOWN,                "TDLS Teardown"},
5210   {TDLS_PEER_TRAFFIC_INDICATION, "TDLS Peer Traffic Indication"},
5211   {TDLS_CHANNEL_SWITCH_REQUEST,  "TDLS Channel Switch Request"},
5212   {TDLS_CHANNEL_SWITCH_RESPONSE, "TDLS Channel Switch Response"},
5213   {TDLS_PEER_PSM_REQUEST,        "TDLS Peer PSM Request"},
5214   {TDLS_PEER_PSM_RESPONSE,       "TDLS Peer PSM Response"},
5215   {TDLS_PEER_TRAFFIC_RESPONSE,   "TDLS Peer Traffic Response"},
5216   {TDLS_DISCOVERY_REQUEST,       "TDLS Discovery Request"},
5217   {0, NULL}
5218 };
5219 static value_string_ext tdls_action_codes_ext = VALUE_STRING_EXT_INIT(tdls_action_codes);
5220
5221 static const value_string rm_action_codes[] = {
5222   {RM_ACTION_RADIO_MEASUREMENT_REQUEST,   "Radio Measurement Request"},
5223   {RM_ACTION_RADIO_MEASUREMENT_REPORT,    "Radio Measurement Report"},
5224   {RM_ACTION_LINK_MEASUREMENT_REQUEST,    "Link Measurement Request"},
5225   {RM_ACTION_LINK_MEASUREMENT_REPORT,     "Link Measurement Report"},
5226   {RM_ACTION_NEIGHBOR_REPORT_REQUEST,     "Neighbor Report Request"},
5227   {RM_ACTION_NEIGHBOR_REPORT_RESPONSE,    "Neighbor Report Response"},
5228   {0, NULL}
5229 };
5230 static value_string_ext rm_action_codes_ext = VALUE_STRING_EXT_INIT(rm_action_codes);
5231
5232 static const value_string number_of_taps_values[] = {
5233   {0x0, "1 tap"},
5234   {0x1, "5 taps"},
5235   {0x2, "15 taps"},
5236   {0x3, "63 taps"},
5237   {0, NULL}
5238 };
5239
5240 AIRPDCAP_CONTEXT airpdcap_ctx;
5241
5242 #define PSMP_STA_INFO_BROADCAST 0
5243 #define PSMP_STA_INFO_MULTICAST 1
5244 #define PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED 2
5245
5246 #define PSMP_STA_INFO_FLAG_TYPE         0x00000003
5247 #define PSMP_STA_INFO_FLAG_DTT_START    0x00001FFC
5248 #define PSMP_STA_INFO_FLAG_DTT_DURATION 0x001FE000
5249
5250 #define PSMP_STA_INFO_FLAG_STA_ID       0x001FFFE0
5251
5252 #define PSMP_STA_INFO_FLAG_UTT_START    0x0000FFE0
5253 #define PSMP_STA_INFO_FLAG_UTT_DURATION 0x03FF0000
5254
5255 #define PSMP_STA_INFO_FLAG_IA_RESERVED  0xFC000000
5256
5257 static const value_string ff_psmp_sta_info_flags[] = {
5258   { PSMP_STA_INFO_BROADCAST,              "Broadcast"},
5259   { PSMP_STA_INFO_MULTICAST,              "Multicast"},
5260   { PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED, "Individually Addressed"},
5261   {0, NULL}
5262 };
5263
5264 static const char* wlan_conv_get_filter_type(conv_item_t* conv, conv_filter_type_e filter)
5265 {
5266     if ((filter == CONV_FT_SRC_ADDRESS) && ((conv->src_address.type == AT_ETHER) || (conv->src_address.type == wlan_address_type)))
5267         return "wlan.sa";
5268
5269     if ((filter == CONV_FT_DST_ADDRESS) && ((conv->dst_address.type == AT_ETHER) || (conv->dst_address.type == wlan_address_type)))
5270         return "wlan.da";
5271
5272     if ((filter == CONV_FT_ANY_ADDRESS) && ((conv->src_address.type == AT_ETHER) || (conv->src_address.type == wlan_address_type)))
5273         return "wlan.addr";
5274
5275     return CONV_FILTER_INVALID;
5276 }
5277
5278 static ct_dissector_info_t wlan_ct_dissector_info = {&wlan_conv_get_filter_type};
5279
5280 static int
5281 wlan_conversation_packet(void *pct, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5282 {
5283   conv_hash_t *hash = (conv_hash_t*) pct;
5284   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5285
5286   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);
5287
5288   return 1;
5289 }
5290
5291 static const char* wlan_host_get_filter_type(hostlist_talker_t* host, conv_filter_type_e filter)
5292 {
5293   if ((filter == CONV_FT_ANY_ADDRESS) && (host->myaddress.type == AT_ETHER))
5294     return "wlan.addr";
5295
5296   return CONV_FILTER_INVALID;
5297 }
5298
5299 static hostlist_dissector_info_t wlan_host_dissector_info = {&wlan_host_get_filter_type};
5300
5301 static int
5302 wlan_hostlist_packet(void *pit, packet_info *pinfo, epan_dissect_t *edt _U_, const void *vip)
5303 {
5304   conv_hash_t *hash = (conv_hash_t*) pit;
5305   const wlan_hdr_t *whdr=(const wlan_hdr_t *)vip;
5306
5307   /* Take two "add" passes per packet, adding for each direction, ensures that all
5308   packets are counted properly (even if address is sending to itself)
5309   XXX - this could probably be done more efficiently inside hostlist_table */
5310   add_hostlist_table_data(hash, &whdr->src, 0, TRUE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, PT_NONE);
5311   add_hostlist_table_data(hash, &whdr->dst, 0, FALSE, 1, pinfo->fd->pkt_len, &wlan_host_dissector_info, PT_NONE);
5312
5313   return 1;
5314 }
5315
5316 static const char* wlan_col_filter_str(const address* addr _U_, gboolean is_src)
5317 {
5318   if (is_src)
5319     return "wlan.sa";
5320
5321   return "wlan.da";
5322 }
5323
5324 static const char* wlan_bssid_col_filter_str(const address* addr _U_, gboolean is_src _U_)
5325 {
5326   return "wlan.bssid";
5327 }
5328
5329
5330 static void
5331 beacon_interval_base_custom(gchar *result, guint32 beacon_interval)
5332 {
5333   double temp_double;
5334
5335   temp_double = (double)beacon_interval;
5336   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double * 1024 / 1000000));
5337 }
5338
5339 static void
5340 allocation_duration_base_custom(gchar *result, guint32 allocation_duration)
5341 {
5342   double temp_double;
5343
5344   temp_double = (double)allocation_duration;
5345   g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double / 1000000));
5346 }
5347
5348 static void
5349 extra_one_base_custom(gchar *result, guint32 value)
5350 {
5351   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", value+1);
5352 }
5353
5354 static void
5355 extra_one_mul_two_base_custom(gchar *result, guint32 value)
5356 {
5357   g_snprintf(result, ITEM_LABEL_LENGTH, "%d", (value+1)*2);
5358 }
5359
5360 /* ************************************************************************* */
5361 /* Mesh Control field helper functions
5362  *
5363  * Per IEEE 802.11s Draft 12.0 section 7.2.2.1:
5364  *
5365  * The frame body consists of either:
5366  * The MSDU (or a fragment thereof), the Mesh Control field (if and only if the
5367  * frame is transmitted by a mesh STA and the Mesh Control Present subfield of
5368  * the QoS Control field is 1)...
5369  *
5370  * 8.2.4.5.1 "QoS Control field structure", table 8-4, in 802.11-2012,
5371  * seems to indicate that the bit that means "Mesh Control Present" in
5372  * frames sent by mesh STAs in a mesh BSS is part of the TXOP Limit field,
5373  * the AP PS Buffer State field, the TXOP Duration Requested field, or the
5374  * Queue Size field in some data frames in non-mesh BSSes.
5375  *
5376  * We need a statefull sniffer for that.  For now, use heuristics.
5377  *
5378  * Notably, only mesh data frames contain the Mesh Control field in the header.
5379  * Other frames that contain mesh control (i.e., multihop action frames) have
5380  * it deeper in the frame body where it can be definitively identified.
5381  * Further, mesh data frames always have to-ds and from-ds either 11 or 01.  We
5382  * use these facts to make our heuristics more reliable.
5383  * ************************************************************************* */
5384 static int
5385 has_mesh_control(guint16 fcf, guint16 qos_ctl, guint8 mesh_flags)
5386 {
5387   /* assume mesh control present if the QOS field's Mesh Control Present bit is
5388    * set, all reserved bits in the mesh_flags field are zero, and the address
5389    * extension mode is not a reserved value.
5390    */
5391   return (((FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) || (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2)) &&
5392           (QOS_MESH_CONTROL_PRESENT(qos_ctl)) &&
5393           ((mesh_flags & ~MESH_FLAGS_ADDRESS_EXTENSION) == 0) &&
5394           ((mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION) != MESH_FLAGS_ADDRESS_EXTENSION));
5395 }
5396
5397 static int
5398 find_mesh_control_length(guint8 mesh_flags)
5399 {
5400   return 6 + 6*(mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION);
5401 }
5402
5403 static mimo_control_t
5404 get_mimo_control (tvbuff_t *tvb, int offset)
5405 {
5406   guint16        mimo;
5407   mimo_control_t output;
5408
5409   mimo = tvb_get_letohs (tvb, offset);
5410
5411   output.nc = (mimo & 0x0003) + 1;
5412   output.nr = ((mimo & 0x000C) >> 2) + 1;
5413   output.chan_width = (mimo & 0x0010) >> 4;
5414   output.coefficient_size = 4; /* XXX - Is this a good default? */
5415
5416   switch ((mimo & 0x0060) >> 5)
5417     {
5418       case 0:
5419         output.grouping = 1;
5420         break;
5421
5422       case 1:
5423         output.grouping = 2;
5424         break;
5425
5426       case 2:
5427         output.grouping = 4;
5428         break;
5429
5430       default:
5431         output.grouping = 1;
5432         break;
5433     }
5434
5435   switch ((mimo & 0x0180) >> 7)
5436     {
5437       case 0:
5438         output.coefficient_size = 4;
5439         break;
5440
5441       case 1:
5442         output.coefficient_size = 5;
5443         break;
5444
5445       case 2:
5446         output.coefficient_size = 6;
5447         break;
5448
5449       case 3:
5450         output.coefficient_size = 8;
5451         break;
5452     }
5453
5454   output.codebook_info = (mimo & 0x0600) >> 9;
5455   output.remaining_matrix_segment = (mimo & 0x3800) >> 11;
5456
5457   return output;
5458 }
5459
5460 static int
5461 get_mimo_na (guint8 nr, guint8 nc)
5462 {
5463   if ((nr == 2) && (nc == 1)) {
5464     return 2;
5465   } else if ((nr == 2) && (nc == 2)) {
5466     return 2;
5467   } else if ((nr == 3) && (nc == 1)) {
5468     return 4;
5469   } else if ((nr == 3) && (nc == 2)) {
5470     return 6;
5471   } else if ((nr == 3) && (nc == 3)) {
5472     return 6;
5473   } else if ((nr == 4) && (nc == 1)) {
5474     return 6;
5475   } else if ((nr == 4) && (nc == 2)) {
5476     return 10;
5477   } else if ((nr == 4) && (nc == 3)) {
5478     return 12;
5479   } else if ((nr == 4) && (nc == 4)) {
5480     return 12;
5481   } else{
5482     return 0;
5483   }
5484 }
5485
5486 static int
5487 get_mimo_ns (gboolean chan_width, guint8 output_grouping)
5488 {
5489   int ns = 0;
5490
5491   if (chan_width)
5492   {
5493     switch (output_grouping)
5494       {
5495         case 1:
5496           ns = 114;
5497           break;
5498
5499           case 2:
5500             ns = 58;
5501             break;
5502
5503           case 4:
5504             ns = 30;
5505             break;
5506
5507           default:
5508             ns = 0;
5509       }
5510   } else {
5511     switch (output_grouping)
5512       {
5513         case 1:
5514           ns = 56;
5515           break;
5516
5517         case 2:
5518           ns = 30;
5519           break;
5520
5521         case 4:
5522           ns = 16;
5523           break;
5524
5525         default:
5526           ns = 0;
5527       }
5528   }
5529
5530   return ns;
5531 }
5532
5533 static int
5534 add_mimo_csi_matrices_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
5535 {
5536   proto_tree *snr_tree;
5537   int         csi_matrix_size, start_offset;
5538   int         ns, i;
5539
5540   start_offset = offset;
5541   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
5542                         ett_mimo_report, NULL, "Signal to Noise Ratio");
5543
5544   for (i = 1; i <= mimo_cntrl.nr; i++)
5545   {
5546     guint8 snr;
5547
5548     snr = tvb_get_guint8(tvb, offset);
5549     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
5550                                snr, "Channel %d - Signal to Noise Ratio: 0x%02X", i, snr);
5551     offset += 1;
5552   }
5553
5554   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
5555   csi_matrix_size = ns*(3+(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size));
5556   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
5557   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_matrices, tvb, offset, csi_matrix_size, ENC_NA);
5558   offset += csi_matrix_size;
5559   return offset - start_offset;
5560 }
5561
5562 static int
5563 add_mimo_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
5564 {
5565   proto_tree *snr_tree;
5566   int         csi_matrix_size, start_offset;
5567   int         ns, i;
5568
5569   start_offset = offset;
5570   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc, ett_mimo_report, NULL, "Signal to Noise Ratio");
5571
5572   for (i = 1; i <= mimo_cntrl.nc; i++)
5573   {
5574     guint8 snr;
5575
5576     snr = tvb_get_guint8(tvb, offset);
5577     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
5578                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
5579     offset += 1;
5580   }
5581
5582   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
5583   csi_matrix_size = ns*(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size);
5584   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
5585   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_bf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
5586   offset += csi_matrix_size;
5587   return offset - start_offset;
5588 }
5589
5590 static int
5591 add_mimo_compressed_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
5592 {
5593   proto_tree *snr_tree;
5594   int         csi_matrix_size, start_offset;
5595   int         ns, na, i;
5596
5597   start_offset = offset;
5598   snr_tree = proto_tree_add_subtree(tree, tvb, offset, mimo_cntrl.nc,
5599                         ett_mimo_report, NULL, "Signal to Noise Ratio");
5600
5601   for (i = 1; i <= mimo_cntrl.nc; i++)
5602   {
5603     guint8 snr;
5604
5605     snr = tvb_get_guint8(tvb, offset);
5606     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
5607                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
5608     offset += 1;
5609   }
5610
5611   na = get_mimo_na(mimo_cntrl.nr, mimo_cntrl.nc);
5612   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
5613   csi_matrix_size = ns*(na*((mimo_cntrl.codebook_info+1)*2 + 2)/2);
5614   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
5615   proto_tree_add_item(snr_tree, hf_ieee80211_ff_mimo_csi_cbf_matrices, tvb, offset, csi_matrix_size, ENC_NA);
5616   offset += csi_matrix_size;
5617   return offset - start_offset;
5618 }
5619
5620 /* ************************************************************************* */
5621 /*          This is the capture function used to update packet counts        */
5622 /* ************************************************************************* */
5623 static gboolean
5624 capture_ieee80211_common (const guchar * pd, int offset, int len,
5625                           capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_, gboolean datapad)
5626 {
5627   guint16 fcf, hdr_length;
5628
5629   if (!BYTES_ARE_IN_FRAME(offset, len, 2))
5630     return FALSE;
5631
5632   fcf = pletoh16 (&pd[offset]);
5633
5634   if (IS_PROTECTED(FCF_FLAGS(fcf)) && (wlan_ignore_wep == WLAN_IGNORE_WEP_NO))
5635     return FALSE;
5636
5637   switch (COMPOSE_FRAME_TYPE (fcf)) {
5638
5639     case DATA:
5640     case DATA_CF_ACK:
5641     case DATA_CF_POLL:
5642     case DATA_CF_ACK_POLL:
5643     case DATA_QOS_DATA:
5644     case DATA_QOS_DATA_CF_ACK:
5645     case DATA_QOS_DATA_CF_POLL:
5646     case DATA_QOS_DATA_CF_ACK_POLL:
5647     {
5648       /* These are data frames that actually contain *data*. */
5649       hdr_length = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
5650
5651       if (DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
5652         /* QoS frame, so the header includes a QoS field */
5653         guint16 qosoff;  /* Offset of the 2-byte QoS field */
5654         guint8 mesh_flags;
5655
5656         qosoff = hdr_length;
5657         hdr_length += 2; /* Include the QoS field in the header length */
5658
5659         if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
5660           /* Frame has a 4-byte HT Control field */
5661           hdr_length += 4;
5662         }
5663
5664         /*
5665          * Does it look as if we have a mesh header?
5666          * Look at the Mesh Control subfield of the QoS field and at the
5667          * purported mesh flag fields.
5668          */
5669         if (!BYTES_ARE_IN_FRAME(offset, hdr_length, 1))
5670           return FALSE;
5671
5672         mesh_flags = pd[hdr_length];
5673         if (has_mesh_control(fcf, pletoh16(&pd[qosoff]), mesh_flags)) {
5674           /* Yes, add the length of that in as well. */
5675           hdr_length += find_mesh_control_length(mesh_flags);
5676         }
5677
5678         if (datapad) {
5679           /*
5680            * Include the padding between the 802.11 header and the body,
5681            * as "helpfully" provided by some Atheros adapters.
5682            *
5683            * XXX - would the mesh header be part of the header or the body
5684            * from the point of view of the Atheros adapters that insert
5685            * the padding, assuming they even recognize a mesh header?
5686            */
5687           hdr_length = roundup2(hdr_length, 4);
5688         }
5689       }
5690       /* I guess some bridges take Netware Ethernet_802_3 frames,
5691          which are 802.3 frames (with a length field rather than
5692          a type field, but with no 802.2 header in the payload),
5693          and just stick the payload into an 802.11 frame.  I've seen
5694          captures that show frames of that sort.
5695
5696          We also handle some odd form of encapsulation in which a
5697          complete Ethernet frame is encapsulated within an 802.11
5698          data frame, with no 802.2 header.  This has been seen
5699          from some hardware.
5700
5701          On top of that, at least at some point it appeared that
5702          the OLPC XO sent out frames with two bytes of 0 between
5703          the "end" of the 802.11 header and the beginning of
5704          the payload.
5705
5706          So, if the packet doesn't start with 0xaa 0xaa:
5707
5708            we first use the same scheme that linux-wlan-ng does to detect
5709            those encapsulated Ethernet frames, namely looking to see whether
5710            the frame either starts with 6 octets that match the destination
5711            address from the 802.11 header or has 6 octets that match the
5712            source address from the 802.11 header following the first 6 octets,
5713            and, if so, treat it as an encapsulated Ethernet frame;
5714
5715            otherwise, we use the same scheme that we use in the Ethernet
5716            dissector to recognize Netware 802.3 frames, namely checking
5717            whether the packet starts with 0xff 0xff and, if so, treat it
5718            as an encapsulated IPX frame, and then check whether the
5719            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
5720            frame. */
5721       if (!BYTES_ARE_IN_FRAME(offset+hdr_length, len, 2))
5722         return FALSE;
5723
5724       if ((pd[offset+hdr_length] != 0xaa) && (pd[offset+hdr_length+1] != 0xaa)) {
5725 #if 0
5726         /* XXX - this requires us to parse the header to find the source
5727            and destination addresses. */
5728         if (BYTES_ARE_IN_FRAME(offset+hdr_length, len, 12)) {
5729           /* We have two MAC addresses after the header. */
5730           if ((memcmp(&pd[offset+hdr_length+6], pinfo->dl_src.data, 6) == 0) ||
5731               (memcmp(&pd[offset+hdr_length+6], pinfo->dl_dst.data, 6) == 0)) {
5732             return capture_eth (pd, offset + hdr_length, len, cpinfo, pseudo_header);
5733           }
5734         }
5735 #endif
5736         if ((pd[offset+hdr_length] == 0xff) && (pd[offset+hdr_length+1] == 0xff))
5737           return capture_ipx (pd, offset+hdr_length, len, cpinfo, pseudo_header);
5738         else if ((pd[offset+hdr_length] == 0x00) && (pd[offset+hdr_length+1] == 0x00))
5739           return capture_llc (pd, offset + hdr_length + 2, len, cpinfo, pseudo_header);
5740       }
5741       else {
5742         return capture_llc (pd, offset + hdr_length, len, cpinfo, pseudo_header);
5743       }
5744       break;
5745     }
5746   }
5747
5748   return FALSE;
5749 }
5750
5751 /*
5752  * Handle 802.11 with a variable-length link-layer header.
5753  */
5754 gboolean
5755 capture_ieee80211 (const guchar * pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
5756 {
5757   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, FALSE);
5758 }
5759
5760 /*
5761  * Handle 802.11 with a variable-length link-layer header and data padding.
5762  */
5763 gboolean
5764 capture_ieee80211_datapad (const guchar * pd, int offset, int len,
5765                            capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_)
5766 {
5767   return capture_ieee80211_common (pd, offset, len, cpinfo, pseudo_header, TRUE);
5768 }
5769
5770
5771 /* ************************************************************************* */
5772 /*          Add the subtree used to store the fixed parameters               */
5773 /* ************************************************************************* */
5774 static proto_tree *
5775 get_fixed_parameter_tree (proto_tree * tree, tvbuff_t *tvb, int start, int size)
5776 {
5777   proto_item *fixed_fields;
5778
5779   fixed_fields = proto_tree_add_item (tree, hf_ieee80211_fixed_parameters, tvb, start, size, ENC_NA);
5780   proto_item_append_text(fixed_fields, " (%d bytes)",size);
5781
5782   return proto_item_add_subtree (fixed_fields, ett_fixed_parameters);
5783 }
5784
5785
5786 /* ************************************************************************* */
5787 /*            Add the subtree used to store tagged parameters                */
5788 /* ************************************************************************* */
5789 static proto_tree *
5790 get_tagged_parameter_tree (proto_tree * tree, tvbuff_t *tvb, int start, int size)
5791 {
5792   proto_item *tagged_fields;
5793
5794   tagged_fields = proto_tree_add_item(tree, hf_ieee80211_tagged_parameters, tvb, start, -1, ENC_NA);
5795   proto_item_append_text(tagged_fields, " (%d bytes)",size);
5796
5797   return proto_item_add_subtree (tagged_fields, ett_tagged_parameters);
5798 }
5799
5800
5801 static int
5802 dissect_vendor_action_marvell(proto_tree *tree, tvbuff_t *tvb, int offset)
5803 {
5804   guint8 octet;
5805
5806   octet = tvb_get_guint8(tvb, offset);
5807   proto_tree_add_item (tree, hf_ieee80211_ff_marvell_action_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5808   offset += 1;
5809   switch (octet)
5810     {
5811       case MRVL_ACTION_MESH_MANAGEMENT:
5812         octet = tvb_get_guint8(tvb, offset);
5813         proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5814         offset += 1;
5815         switch (octet)
5816           {
5817             case MRVL_MESH_MGMT_ACTION_RREQ:
5818               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5819               offset += 1;
5820               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5821               offset += 1;
5822               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5823               offset += 1;
5824               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5825               offset += 1;
5826               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_rreqid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5827               offset += 4;
5828               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
5829               offset += 6;
5830               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5831               offset += 4;
5832               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5833               offset += 4;
5834               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5835               offset += 4;
5836               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5837               offset += 1;
5838               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5839               offset += 1;
5840               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
5841               offset += 6;
5842               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5843               offset += 4;
5844               break;
5845             case MRVL_MESH_MGMT_ACTION_RREP:
5846               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5847               offset += 1;
5848               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5849               offset += 1;
5850               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5851               offset += 1;
5852               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5853               offset += 1;
5854               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
5855               offset += 6;
5856               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5857               offset += 4;
5858               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5859               offset += 4;
5860               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5861               offset += 4;
5862               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
5863               offset += 6;
5864               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5865               offset += 4;
5866               break;
5867             case MRVL_MESH_MGMT_ACTION_RERR:
5868               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5869               offset += 1;
5870               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5871               offset += 1;
5872               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5873               offset += 1;
5874               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
5875               offset += 6;
5876               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
5877               offset += 4;
5878               break;
5879             default:
5880               break;
5881           }
5882         break;
5883       default:
5884         break;
5885     }
5886
5887   return offset;
5888 }
5889
5890 static guint
5891 dissect_advertisement_protocol(packet_info *pinfo, proto_tree *tree,
5892                                tvbuff_t *tvb, int offset, gboolean *anqp)
5893 {
5894   guint8      tag_no, tag_len, left;
5895   proto_item *item = NULL, *adv_item;
5896   proto_tree *adv_tree, *adv_tuple_tree;
5897
5898   if (anqp)
5899     *anqp = FALSE;
5900   tag_no = tvb_get_guint8(tvb, offset);
5901   if (anqp)
5902     item = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
5903
5904   tag_len = tvb_get_guint8(tvb, offset + 1);
5905   if (tag_no != TAG_ADVERTISEMENT_PROTOCOL) {
5906     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_number,
5907                            "Unexpected IE %d (expected Advertisement "
5908                            "Protocol)", tag_no);
5909     return 2 + tag_len;
5910   }
5911   if (anqp)
5912     item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
5913   if (tag_len < 2) {
5914     if (!anqp)
5915       item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
5916     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
5917                            "Advertisement Protocol: IE must be at least 2 "
5918                            "octets long");
5919     return 2 + tag_len;
5920   }
5921
5922   left = tag_len;
5923   offset += 2;
5924   adv_tree = proto_tree_add_subtree(tree, tvb, offset, left,
5925                                  ett_adv_proto, &adv_item, "Advertisement Protocol element");
5926
5927   while (left >= 2) {
5928     guint8 id;
5929
5930     id = tvb_get_guint8(tvb, offset + 1);
5931     if (id == 0)
5932       proto_item_append_text(adv_item, ": ANQP");
5933     adv_tuple_tree = proto_tree_add_subtree_format(adv_tree, tvb, offset, 2, ett_adv_proto_tuple, &item,
5934                                "Advertisement Protocol Tuple: %s",
5935                                val_to_str(id, adv_proto_id_vals,
5936                                           "Unknown (%d)"));
5937
5938     proto_tree_add_item(adv_tuple_tree,
5939                         hf_ieee80211_tag_adv_proto_resp_len_limit, tvb,
5940                         offset, 1, ENC_LITTLE_ENDIAN);
5941     proto_tree_add_item(adv_tuple_tree,
5942                         hf_ieee80211_tag_adv_proto_pame_bi, tvb,
5943                         offset, 1, ENC_LITTLE_ENDIAN);
5944     offset += 1;
5945     left--;
5946     proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_proto_id, tvb,
5947                         offset, 1, ENC_LITTLE_ENDIAN);
5948     offset += 1;
5949     left--;
5950
5951     if ((id == 0) && anqp)
5952       *anqp = TRUE;
5953
5954     if (id == 221) {
5955       /* Vendor specific */
5956       guint8 len = tvb_get_guint8(tvb, offset);
5957       offset += 1;
5958       left   -= 1;
5959       if (len > left) {
5960         expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
5961                                "Vendor specific info length error");
5962         return 2 + tag_len;
5963       }
5964       proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_proto_vs_info, tvb,
5965                         offset, len, ENC_NA);
5966       offset += len;
5967       left   -= len;
5968     }
5969   }
5970
5971   if (left) {
5972     expert_add_info_format(pinfo, item, &ei_ieee80211_extra_data,
5973                            "Unexpected extra data in the end");
5974   }
5975
5976   return 2 + tag_len;
5977 }
5978
5979 static void
5980 dissect_anqp_query_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
5981 {
5982   while (offset + 2 <= end) {
5983     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_query_id,
5984                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
5985     offset += 2;
5986   }
5987   if (offset != end) {
5988     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
5989                            "Unexpected ANQP Query list format");
5990   }
5991 }
5992
5993 static void dissect_hs20_anqp_hs_capability_list(proto_tree *tree,
5994                                                  tvbuff_t *tvb,
5995                                                  int offset, int end)
5996 {
5997   while (offset < end) {
5998     proto_tree_add_item(tree, hf_hs20_anqp_hs_capability_list,
5999                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6000     offset++;
6001   }
6002 }
6003
6004 static void
6005 dissect_anqp_capab_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6006 {
6007   guint16     id, len;
6008   proto_item *item;
6009   proto_tree *vtree;
6010   guint32     oui;
6011   guint8      subtype;
6012
6013   while (offset + 2 <= end) {
6014     id = tvb_get_letohs(tvb, offset);
6015     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_capability,
6016                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6017     offset += 2;
6018     if (id == ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
6019       vtree = proto_item_add_subtree(item, ett_anqp_vendor_capab);
6020       len = tvb_get_letohs(tvb, offset);
6021       proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vlen,
6022                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
6023       offset += 2;
6024       if ((len < 3) || ((offset + len) > end)) {
6025         expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_capability);
6026         return;
6027       }
6028       oui = tvb_get_ntoh24(tvb, offset);
6029       proto_tree_add_item(vtree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
6030       offset += 3;
6031       len    -= 3;
6032
6033       switch (oui) {
6034       case OUI_WFA:
6035         if (len == 0)
6036           break;
6037         subtype = tvb_get_guint8(tvb, offset);
6038         proto_item_append_text(vtree, " - WFA - %s",
6039                                val_to_str(subtype, wfa_subtype_vals,
6040                                           "Unknown (%u)"));
6041         proto_tree_add_item(vtree, hf_ieee80211_anqp_wfa_subtype,
6042                             tvb, offset, 1, ENC_NA);
6043         offset++;
6044         len--;
6045         switch (subtype) {
6046         case WFA_SUBTYPE_HS20_ANQP:
6047           dissect_hs20_anqp_hs_capability_list(vtree, tvb, offset, end);
6048           break;
6049         default:
6050           proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
6051                               tvb, offset, len, ENC_NA);
6052           break;
6053         }
6054         break;
6055       default:
6056         proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
6057                             tvb, offset, len, ENC_NA);
6058         break;
6059       }
6060
6061       offset += len;
6062     }
6063   }
6064   if (offset != end) {
6065     expert_add_info_format(pinfo, tree, &ei_ieee80211_ff_anqp_info_length,
6066                            "Unexpected ANQP Capability list format");
6067   }
6068 }
6069
6070 static const value_string venue_group_vals[] = {
6071   {  0, "Unspecified" },
6072   {  1, "Assembly" },
6073   {  2, "Business" },
6074   {  3, "Educational" },
6075   {  4, "Factory and Industrial" },
6076   {  5, "Institutional" },
6077   {  6, "Mercantile" },
6078   {  7, "Residential" },
6079   {  8, "Storage" },
6080   {  9, "Utility and Miscellaneous" },
6081   { 10, "Vehicular" },
6082   { 11, "Outdoor" },
6083   { 0, NULL }
6084 };
6085 static value_string_ext venue_group_vals_ext = VALUE_STRING_EXT_INIT(venue_group_vals);
6086
6087 static void
6088 dissect_venue_info(proto_tree *tree, tvbuff_t *tvb, int offset)
6089 {
6090   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_group,
6091                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6092   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_type,
6093                       tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
6094 }
6095
6096 static void
6097 dissect_venue_name_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6098 {
6099   proto_item *item;
6100
6101   dissect_venue_info(tree, tvb, offset);
6102   offset += 2;
6103   while (offset + 4 <= end) {
6104     guint8 vlen = tvb_get_guint8(tvb, offset);
6105     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_length,
6106                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6107     offset += 1;
6108     if ((vlen > (end - offset)) || (vlen < 3)) {
6109       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_venue_length);
6110       break;
6111     }
6112     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_language,
6113                         tvb, offset, 3, ENC_ASCII|ENC_NA);
6114     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_name,
6115                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
6116     offset += vlen;
6117   }
6118 }
6119
6120 static const value_string nw_auth_type_vals[] = {
6121   { 0, "Acceptance of terms and conditions" },
6122   { 1, "On-line enrollment supported" },
6123   { 2, "http/https redirection" },
6124   { 3, "DNS redirection" },
6125   { 0, NULL }
6126 };
6127
6128 static void
6129 dissect_network_auth_type(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6130 {
6131   while (offset + 3 <= end) {
6132     guint16 len;
6133     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_indicator,
6134                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6135     offset += 1;
6136     len = tvb_get_letohs(tvb, offset);
6137     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url_len,
6138                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6139     offset += 2;
6140     if (len)
6141       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url,
6142                           tvb, offset, len, ENC_ASCII|ENC_NA);
6143     offset += len;
6144   }
6145 }
6146
6147 static void
6148 add_manuf(proto_item *item, tvbuff_t *tvb, int offset)
6149 {
6150   const gchar *manuf_name;
6151
6152   manuf_name = tvb_get_manuf_name_if_known(tvb, offset);
6153   if (manuf_name == NULL)
6154     return;
6155   proto_item_append_text(item, " - %s", manuf_name);
6156 }
6157
6158 static void
6159 dissect_roaming_consortium_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6160                                 int end)
6161 {
6162   proto_item *item;
6163   guint8      len;
6164
6165   while (offset < end) {
6166     len = tvb_get_guint8(tvb, offset);
6167     item = proto_tree_add_item(tree,
6168                                hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
6169                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6170     offset += 1;
6171     if ((len > (end - offset)) || (len < 3)) {
6172       expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_roaming_consortium_oi_len);
6173       break;
6174     }
6175     item = proto_tree_add_item(tree,
6176                                hf_ieee80211_ff_anqp_roaming_consortium_oi,
6177                                tvb, offset, len, ENC_NA);
6178     add_manuf(item, tvb, offset);
6179     offset += len;
6180   }
6181 }
6182
6183 static const value_string ip_addr_avail_ipv6_vals[] = {
6184   { 0, "Address type not available" },
6185   { 1, "Address type available" },
6186   { 2, "Availability of the address type not known" },
6187   { 0, NULL }
6188 };
6189
6190 static const value_string ip_addr_avail_ipv4_vals[] = {
6191   { 0, "Address type not available" },
6192   { 1, "Public IPv4 address available" },
6193   { 2, "Port-restricted IPv4 address available" },
6194   { 3, "Single NATed private IPv4 address available" },
6195   { 4, "Double NATed private IPv4 address available" },
6196   { 5, "Port-restricted IPv4 address and single NATed IPv4 address available" },
6197   { 6, "Port-restricted IPv4 address and double NATed IPv4 address available" },
6198   { 7, "Availability of the address type is not known" },
6199   { 0, NULL }
6200 };
6201
6202 static void
6203 dissect_ip_addr_type_availability_info(proto_tree *tree, tvbuff_t *tvb,
6204                                        int offset)
6205 {
6206   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
6207                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6208   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
6209                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6210 }
6211
6212 static const value_string nai_realm_encoding_vals[] = {
6213   { 0, "Formatted in accordance with RFC 4282" },
6214   { 1, "UTF-8 formatted that is not formatted in accordance with RFC 4282" },
6215   { 0, NULL }
6216 };
6217
6218 static const value_string nai_realm_auth_param_id_vals[] = {
6219   {   1, "Expanded EAP Method" },
6220   {   2, "Non-EAP Inner Authentication Type" },
6221   {   3, "Inner Authentication EAP Method Type" },
6222   {   4, "Expanded Inner EAP Method" },
6223   {   5, "Credential Type" },
6224   {   6, "Tunneled EAP Method Credential Type" },
6225   { 221, "Vendor Specific" },
6226   { 0, NULL }
6227 };
6228
6229 static void
6230 dissect_nai_realm_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
6231 {
6232   guint16     count, len;
6233   proto_item *item, *r_item;
6234   int         f_end, eap_end;
6235   guint8      nai_len, eap_count, eap_len, auth_param_count, auth_param_len;
6236   guint8      auth_param_id;
6237   proto_tree *realm_tree, *eap_tree;
6238   guint8     *realm;
6239
6240   count = tvb_get_letohs(tvb, offset);
6241   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nai_realm_count,
6242                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6243   offset += 2;
6244   while (count > 0) {
6245     len = tvb_get_letohs(tvb, offset);
6246     realm_tree = proto_tree_add_subtree(tree, tvb, offset, 2 + len, ett_nai_realm, &r_item, "NAI Realm Data");
6247
6248     item = proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_field_len,
6249                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
6250     offset += 2;
6251     if (offset + len > end) {
6252       expert_add_info_format(pinfo, item, &ei_ieee80211_ff_anqp_nai_field_len,
6253                              "Invalid NAI Realm List");
6254       break;
6255     }
6256     f_end = offset + len;
6257     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_encoding,
6258                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6259     offset += 1;
6260     nai_len = tvb_get_guint8(tvb, offset);
6261     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_length,
6262                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6263     offset += 1;
6264     if (offset + nai_len > f_end) {
6265       expert_add_info_format(pinfo, r_item, &ei_ieee80211_ff_anqp_nai_field_len,
6266                              "Invalid NAI Realm Data");
6267       break;
6268     }
6269     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm,
6270                         tvb, offset, nai_len, ENC_ASCII|ENC_NA);
6271     realm = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, nai_len, ENC_ASCII);
6272     if (realm) {
6273       proto_item_append_text(r_item, " (%s)", realm);
6274     }
6275     offset += nai_len;
6276     eap_count = tvb_get_guint8(tvb, offset);
6277     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_eap_count,
6278                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6279     offset += 1;
6280
6281     while (eap_count > 0) {
6282       eap_len = tvb_get_guint8(tvb, offset);
6283       eap_end = offset + 1 + eap_len;
6284       eap_tree = proto_tree_add_subtree(realm_tree, tvb, offset, 1 + eap_len,
6285                                  ett_nai_realm_eap, NULL, "EAP Method");
6286
6287       item = proto_tree_add_item(eap_tree,
6288                                  hf_ieee80211_ff_anqp_nai_realm_eap_len,
6289                                  tvb, offset, 1, ENC_LITTLE_ENDIAN);
6290       offset += 1;
6291       if (offset + eap_len > f_end) {
6292         expert_add_info(pinfo, item, &ei_ieee80211_ff_anqp_nai_realm_eap_len);
6293         break;
6294       }
6295
6296       proto_item_append_text(eap_tree, ": %s",
6297                              val_to_str_ext(tvb_get_guint8(tvb, offset),
6298                                             &eap_type_vals_ext, "Unknown (%d)"));
6299       proto_tree_add_item(eap_tree, hf_ieee80211_ff_anqp_nai_realm_eap_method,
6300                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
6301       offset += 1;
6302       auth_param_count = tvb_get_guint8(tvb, offset);
6303       proto_tree_add_item(eap_tree,
6304                           hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
6305                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
6306       offset += 1;
6307
6308       while (auth_param_count > 0) {
6309         auth_param_id = tvb_get_guint8(tvb, offset);
6310         proto_tree_add_item(eap_tree,
6311                             hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
6312                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
6313         offset += 1;
6314         auth_param_len = tvb_get_guint8(tvb, offset);
6315         proto_tree_add_item(eap_tree,
6316                             hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
6317                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
6318         offset += 1;
6319         item = proto_tree_add_item(
6320           eap_tree, hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
6321           tvb, offset, auth_param_len, ENC_NA);
6322         if ((auth_param_id == 3) && (auth_param_len == 1)) {
6323           guint8 inner_method = tvb_get_guint8(tvb, offset);
6324           const char *str;
6325           str = val_to_str_ext(inner_method, &eap_type_vals_ext, "Unknown (%d)");
6326
6327           proto_item_append_text(eap_tree, " / %s", str);
6328           proto_item_append_text(item, " - %s", str);
6329         }
6330         offset += auth_param_len;
6331
6332         auth_param_count--;
6333       }
6334
6335       offset = eap_end;
6336       eap_count--;
6337     }
6338
6339     offset = f_end;
6340     count--;
6341   }
6342 }
6343
6344 static void
6345 dissect_3gpp_cellular_network_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6346 {
6347   guint8      iei, num;
6348   proto_item *item;
6349
6350   /* See Annex A of 3GPP TS 24.234 v8.1.0 for description */
6351   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_gud, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6352   offset += 1;
6353   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_udhl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6354   offset += 1;
6355   iei = tvb_get_guint8(tvb, offset);
6356   item = proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_iei, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6357   if (iei == 0)
6358     proto_item_append_text(item, " (PLMN List)");
6359   else
6360     return;
6361   offset += 1;
6362   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_plmn_len, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6363   offset += 1;
6364   num = tvb_get_guint8(tvb, offset);
6365   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_num_plmns, tvb, offset, 1, ENC_LITTLE_ENDIAN);
6366   offset += 1;
6367   while (num > 0) {
6368     if (tvb_reported_length_remaining(tvb, offset) < 3)
6369       break;
6370     dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, offset, E212_NONE, FALSE);
6371     num--;
6372     offset += 3;
6373   }
6374 }
6375
6376 static void
6377 dissect_domain_name_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
6378 {
6379   guint8 len;
6380
6381   while (offset < end) {
6382     len = tvb_get_guint8(tvb, offset);
6383     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name_len,
6384                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6385     offset += 1;
6386     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name,
6387                         tvb, offset, len, ENC_ASCII|ENC_NA);
6388     offset += len;
6389   }
6390 }
6391
6392 #define HS20_ANQP_HS_QUERY_LIST 1
6393 #define HS20_ANQP_HS_CAPABILITY_LIST 2
6394 #define HS20_ANQP_OPERATOR_FRIENDLY_NAME 3
6395 #define HS20_ANQP_WAN_METRICS 4
6396 #define HS20_ANQP_CONNECTION_CAPABILITY 5
6397 #define HS20_ANQP_NAI_HOME_REALM_QUERY 6
6398 #define HS20_ANQP_OPERATING_CLASS_INDICATION 7
6399
6400 static const value_string hs20_anqp_subtype_vals[] = {
6401   { HS20_ANQP_HS_QUERY_LIST, "HS Query list" },
6402   { HS20_ANQP_HS_CAPABILITY_LIST, "HS Capability List" },
6403   { HS20_ANQP_OPERATOR_FRIENDLY_NAME, "Operator Friendly Name" },
6404   { HS20_ANQP_WAN_METRICS, "WAN Metrics" },
6405   { HS20_ANQP_CONNECTION_CAPABILITY, "Connection Capability" },
6406   { HS20_ANQP_NAI_HOME_REALM_QUERY, "NAI Home Realm Query" },
6407   { HS20_ANQP_OPERATING_CLASS_INDICATION, "Operating Class Indication" },
6408   { 0, NULL }
6409 };
6410
6411 static void dissect_hs20_anqp_hs_query_list(proto_tree *tree, tvbuff_t *tvb,
6412                                             int offset, int end)
6413 {
6414   while (offset < end) {
6415     proto_tree_add_item(tree, hf_hs20_anqp_hs_query_list,
6416                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6417     offset++;
6418   }
6419 }
6420
6421 static void dissect_hs20_anqp_operator_friendly_name(proto_tree *tree,
6422                                                      tvbuff_t *tvb, packet_info *pinfo,
6423                                                      int offset, int end)
6424 {
6425   while (offset + 4 <= end) {
6426     guint8 vlen = tvb_get_guint8(tvb, offset);
6427     proto_item *item = proto_tree_add_item(tree, hf_hs20_anqp_ofn_length,
6428                                            tvb, offset, 1, ENC_LITTLE_ENDIAN);
6429     offset++;
6430     if (vlen > end - offset || vlen < 3) {
6431       expert_add_info(pinfo, item, &ei_hs20_anqp_ofn_length);
6432       break;
6433     }
6434     proto_tree_add_item(tree, hf_hs20_anqp_ofn_language,
6435                         tvb, offset, 3, ENC_ASCII|ENC_NA);
6436     proto_tree_add_item(tree, hf_hs20_anqp_ofn_name,
6437                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
6438     offset += vlen;
6439   }
6440 }
6441
6442 static const value_string hs20_wm_link_status_vals[] = {
6443   { 0, "Reserved" },
6444   { 1, "Link up" },
6445   { 2, "Link down" },
6446   { 3, "Link in test state" },
6447   { 0, NULL }
6448 };
6449
6450 static void dissect_hs20_anqp_wan_metrics(proto_tree *tree, tvbuff_t *tvb,
6451                                           int offset, gboolean request)
6452 {
6453   if (request)
6454     return;
6455
6456   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_link_status,
6457                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6458   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_symmetric_link,
6459                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6460   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_at_capacity,
6461                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6462   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_reserved,
6463                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6464   offset++;
6465
6466   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_speed,
6467                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
6468   offset += 4;
6469
6470   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_speed,
6471                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
6472   offset += 4;
6473
6474   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_load,
6475                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6476   offset++;
6477
6478   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_load,
6479                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6480   offset++;
6481
6482   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_lmd,
6483                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6484 }
6485
6486 static const value_string hs20_cc_status_vals[] = {
6487   { 0, "Closed" },
6488   { 1, "Open" },
6489   { 2, "Unknown" },
6490   { 0, NULL }
6491 };
6492
6493 static void
6494 dissect_hs20_anqp_connection_capability(proto_tree *tree, tvbuff_t *tvb,
6495                                         int offset, int end)
6496 {
6497   proto_tree *tuple;
6498   while (offset + 4 <= end) {
6499     guint8 ip_proto, status;
6500     guint16 port_num;
6501
6502     ip_proto = tvb_get_guint8(tvb, offset);
6503     port_num = tvb_get_letohs(tvb, offset + 1);
6504     status = tvb_get_guint8(tvb, offset + 3);
6505
6506     tuple = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_hs20_cc_proto_port_tuple, NULL,
6507                                "ProtoPort Tuple - ip_proto=%u port_num=%u status=%s",
6508                                ip_proto, port_num,
6509                                val_to_str(status, hs20_cc_status_vals,
6510                                           "Unknown (%u)"));
6511     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_ip_proto,
6512                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6513     offset++;
6514     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_port_num,
6515                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
6516     offset += 2;
6517     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_status,
6518                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6519     offset++;
6520   }
6521 }
6522
6523 static void
6524 dissect_hs20_anqp_nai_home_realm_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
6525                                        int offset, int end)
6526 {
6527   guint8 len;
6528   proto_item *item;
6529
6530   proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_count,
6531                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6532   offset++;
6533
6534   while (offset + 2 <= end) {
6535     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_encoding_type,
6536                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6537     offset++;
6538     len = tvb_get_guint8(tvb, offset);
6539     item = proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_length,
6540                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
6541     offset++;
6542     if (offset + len > end) {
6543       expert_add_info(pinfo, item, &ei_hs20_anqp_nai_hrq_length);
6544       break;
6545     }
6546     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_realm_name,
6547                         tvb, offset, len, ENC_ASCII|ENC_NA);
6548     offset += len;
6549   }
6550 }
6551
6552 static void dissect_hs20_anqp_oper_class_indic(proto_tree *tree, tvbuff_t *tvb,
6553                                                int offset, int end)
6554 {
6555   while (offset < end) {
6556     proto_tree_add_item(tree, hf_hs20_anqp_oper_class_indic,
6557                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
6558     offset++;
6559   }
6560 }
6561
6562 static void dissect_hs20_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6563                               int end, gboolean request, int idx)
6564 {
6565   guint8 subtype;
6566
6567   subtype = tvb_get_guint8(tvb, offset);
6568   proto_item_append_text(tree, " - HS 2.0 %s",
6569                          val_to_str(subtype, hs20_anqp_subtype_vals,
6570                                     "Unknown (%u)"));
6571   if (idx == 0) {
6572     col_append_fstr(pinfo->cinfo, COL_INFO, " HS 2.0 %s",
6573                     val_to_str(subtype, hs20_anqp_subtype_vals,
6574                                "Unknown (%u)"));
6575   } else if (idx == 1) {
6576     col_append_str(pinfo->cinfo, COL_INFO, ", ..");
6577   }
6578   proto_tree_add_item(tree, hf_hs20_anqp_subtype, tvb, offset, 1,
6579                       ENC_LITTLE_ENDIAN);
6580   offset++;
6581
6582   proto_tree_add_item(tree, hf_hs20_anqp_reserved, tvb, offset, 1,
6583                       ENC_LITTLE_ENDIAN);
6584   offset++;
6585
6586   switch (subtype) {
6587   case HS20_ANQP_HS_QUERY_LIST:
6588     dissect_hs20_anqp_hs_query_list(tree, tvb, offset, end);
6589     break;
6590   case HS20_ANQP_HS_CAPABILITY_LIST:
6591     dissect_hs20_anqp_hs_capability_list(tree, tvb, offset, end);
6592     break;
6593   case HS20_ANQP_OPERATOR_FRIENDLY_NAME:
6594     dissect_hs20_anqp_operator_friendly_name(tree, tvb, pinfo, offset, end);
6595     break;
6596   case HS20_ANQP_WAN_METRICS:
6597     dissect_hs20_anqp_wan_metrics(tree, tvb, offset, request);
6598     break;
6599   case HS20_ANQP_CONNECTION_CAPABILITY:
6600     dissect_hs20_anqp_connection_capability(tree, tvb, offset, end);
6601     break;
6602   case HS20_ANQP_NAI_HOME_REALM_QUERY:
6603     dissect_hs20_anqp_nai_home_realm_query(tree, tvb, pinfo, offset, end);
6604     break;
6605   case HS20_ANQP_OPERATING_CLASS_INDICATION:
6606     dissect_hs20_anqp_oper_class_indic(tree, tvb, offset, end);
6607     break;
6608   default:
6609     if (offset == end)
6610       break;
6611     proto_tree_add_item(tree, hf_hs20_anqp_payload, tvb, offset,
6612                         end - offset, ENC_NA);
6613     break;
6614   }
6615 }
6616
6617 static int
6618 dissect_anqp_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6619                   gboolean request, int idx)
6620 {
6621   guint16     id, len;
6622   guint32     oui;
6623   proto_item *item;
6624
6625   item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_id,
6626                              tvb, offset, 2, ENC_LITTLE_ENDIAN);
6627   id = tvb_get_letohs(tvb, offset);
6628   if (id != ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
6629     if (idx == 0) {
6630       proto_item_append_text(tree, " - %s",
6631                              val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
6632       col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
6633                       val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
6634     } else if (idx == 1) {
6635       proto_item_append_text(tree, ", ..");
6636       col_append_str(pinfo->cinfo, COL_INFO, ", ..");
6637     }
6638   }
6639   tree = proto_item_add_subtree(item, ett_gas_anqp);
6640   offset += 2;
6641   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_length,
6642                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6643   len = tvb_get_letohs(tvb, offset);
6644   offset += 2;
6645   if (tvb_reported_length_remaining(tvb, offset) < len) {
6646     expert_add_info(pinfo, tree, &ei_ieee80211_ff_anqp_info_length);
6647     return 4 + len;
6648   }
6649   switch (id)
6650   {
6651   case ANQP_INFO_ANQP_QUERY_LIST:
6652     dissect_anqp_query_list(tree, tvb, pinfo, offset, offset + len);
6653     break;
6654   case ANQP_INFO_ANQP_CAPAB_LIST:
6655     dissect_anqp_capab_list(tree, tvb, pinfo, offset, offset + len);
6656     break;
6657   case ANQP_INFO_VENUE_NAME_INFO:
6658     dissect_venue_name_info(tree, tvb, pinfo, offset, offset + len);
6659     break;
6660   case ANQP_INFO_NETWORK_AUTH_TYPE_INFO:
6661     dissect_network_auth_type(tree, tvb, offset, offset + len);
6662     break;
6663   case ANQP_INFO_ROAMING_CONSORTIUM_LIST:
6664     dissect_roaming_consortium_list(tree, tvb, pinfo, offset, offset + len);
6665     break;
6666   case ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO:
6667     dissect_ip_addr_type_availability_info(tree, tvb, offset);
6668     break;
6669   case ANQP_INFO_NAI_REALM_LIST:
6670     dissect_nai_realm_list(tree, tvb, pinfo, offset, offset + len);
6671     break;
6672   case ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO:
6673     dissect_3gpp_cellular_network_info(tree, tvb, pinfo, offset);
6674     break;
6675   case ANQP_INFO_DOMAIN_NAME_LIST:
6676     dissect_domain_name_list(tree, tvb, offset, offset + len);
6677     break;
6678   case ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST:
6679     oui = tvb_get_ntoh24(tvb, offset);
6680     proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
6681     offset += 3;
6682
6683     switch (oui) {
6684     case OUI_WFA:
6685       proto_tree_add_item(tree, hf_ieee80211_anqp_wfa_subtype, tvb, offset, 1,
6686                           ENC_NA);
6687       switch (tvb_get_guint8(tvb, offset)) {
6688       case WFA_SUBTYPE_P2P:
6689         dissect_wifi_p2p_anqp(pinfo, tree, tvb, offset + 1, request);
6690         break;
6691       case WFA_SUBTYPE_HS20_ANQP:
6692         dissect_hs20_anqp(tree, tvb, pinfo, offset + 1, offset + len - 3, request,
6693                           idx);
6694         break;
6695       }
6696       break;
6697     default:
6698       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
6699                           tvb, offset, len, ENC_NA);
6700       break;
6701     }
6702     break;
6703   default:
6704     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
6705                         tvb, offset, len, ENC_NA);
6706     break;
6707   }
6708
6709   return 4 + len;
6710 }
6711
6712 static void
6713 dissect_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, gboolean request)
6714 {
6715   int idx = 0;
6716
6717   proto_item_append_text(tree, ": ANQP ");
6718   proto_item_append_text(tree, request ? "Request" : "Response");
6719   if (tvb_reported_length_remaining(tvb, offset) < 4) {
6720     expert_add_info_format(pinfo, tree, &ei_ieee80211_not_enough_room_for_anqp_header,
6721                            "Not enough room for ANQP header");
6722     return;
6723   }
6724   col_append_fstr(pinfo->cinfo, COL_INFO, ", ANQP %s",
6725                   request ? "Req" : "Resp");
6726   while (tvb_reported_length_remaining(tvb, offset) > 0) {
6727     offset += dissect_anqp_info(tree, tvb, pinfo, offset, request, idx);
6728     idx += 1;
6729   }
6730 }
6731
6732 static guint
6733 dissect_gas_initial_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6734                             gboolean anqp)
6735 {
6736   guint16     req_len;
6737   int         start = offset;
6738   proto_item *item;
6739   proto_tree *query;
6740
6741   /* Query Request Length (2 octets) */
6742   req_len = tvb_get_letohs(tvb, offset);
6743
6744   query = proto_tree_add_subtree(tree, tvb, offset, 2 + req_len, ett_gas_query, &item, "Query Request");
6745   if (tvb_reported_length_remaining(tvb, offset) < 2 + req_len) {
6746     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_request_length);
6747     return tvb_reported_length_remaining(tvb, offset);
6748   }
6749
6750   proto_tree_add_item(query, hf_ieee80211_ff_query_request_length,
6751                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6752   offset += 2;
6753   /*
6754    * Query Request (GAS query; formatted per protocol specified in the
6755    * Advertisement Protocol IE)
6756    */
6757   if (anqp)
6758     dissect_anqp(query, tvb, pinfo, offset, TRUE);
6759   else
6760     proto_tree_add_item(query, hf_ieee80211_ff_query_request,
6761                         tvb, offset, req_len, ENC_NA);
6762   offset += req_len;
6763
6764   return offset - start;
6765 }
6766
6767 static guint
6768 dissect_gas_initial_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6769                              gboolean anqp)
6770 {
6771   guint16     resp_len;
6772   int         start = offset;
6773   proto_item *item;
6774   proto_tree *query;
6775
6776   /* Query Response Length (2 octets) */
6777   resp_len = tvb_get_letohs(tvb, offset);
6778
6779   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
6780                              ett_gas_query, &item, "Query Response");
6781   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
6782     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
6783     return tvb_reported_length_remaining(tvb, offset);
6784   }
6785
6786   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
6787                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6788   offset += 2;
6789   /* Query Response (optional) */
6790   if (resp_len) {
6791     if (anqp)
6792       dissect_anqp(query, tvb, pinfo, offset, FALSE);
6793     else
6794       proto_tree_add_item(query, hf_ieee80211_ff_query_response,
6795                           tvb, offset, resp_len, ENC_NA);
6796     offset += resp_len;
6797   }
6798
6799   return offset - start;
6800 }
6801
6802 static reassembly_table gas_reassembly_table;
6803
6804 static void
6805 ieee80211_gas_reassembly_init(void)
6806 {
6807   reassembly_table_init(&gas_reassembly_table,
6808                         &addresses_reassembly_table_functions);
6809 }
6810
6811 static gint ett_gas_resp_fragment = -1;
6812 static gint ett_gas_resp_fragments = -1;
6813
6814 static int hf_ieee80211_gas_resp_fragments = -1;
6815 static int hf_ieee80211_gas_resp_fragment = -1;
6816 static int hf_ieee80211_gas_resp_fragment_overlap = -1;
6817 static int hf_ieee80211_gas_resp_fragment_overlap_conflict = -1;
6818 static int hf_ieee80211_gas_resp_fragment_multiple_tails = -1;
6819 static int hf_ieee80211_gas_resp_fragment_too_long_fragment = -1;
6820 static int hf_ieee80211_gas_resp_fragment_error = -1;
6821 static int hf_ieee80211_gas_resp_fragment_count = -1;
6822 static int hf_ieee80211_gas_resp_reassembled_in = -1;
6823 static int hf_ieee80211_gas_resp_reassembled_length = -1;
6824
6825 static const fragment_items gas_resp_frag_items = {
6826   &ett_gas_resp_fragment,
6827   &ett_gas_resp_fragments,
6828   &hf_ieee80211_gas_resp_fragments,
6829   &hf_ieee80211_gas_resp_fragment,
6830   &hf_ieee80211_gas_resp_fragment_overlap,
6831   &hf_ieee80211_gas_resp_fragment_overlap_conflict,
6832   &hf_ieee80211_gas_resp_fragment_multiple_tails,
6833   &hf_ieee80211_gas_resp_fragment_too_long_fragment,
6834   &hf_ieee80211_gas_resp_fragment_error,
6835   &hf_ieee80211_gas_resp_fragment_count,
6836   &hf_ieee80211_gas_resp_reassembled_in,
6837   &hf_ieee80211_gas_resp_reassembled_length,
6838   /* Reassembled data field */
6839   NULL,
6840   "GAS Response fragments"
6841 };
6842
6843 static guint
6844 dissect_gas_comeback_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6845                               gboolean anqp, guint8 frag, gboolean more,
6846                               guint8 dialog_token)
6847 {
6848   guint16     resp_len;
6849   int         start = offset;
6850   proto_item *item;
6851   proto_tree *query;
6852
6853   /* Query Response Length (2 octets) */
6854   resp_len = tvb_get_letohs(tvb, offset);
6855
6856   query = proto_tree_add_subtree(tree, tvb, offset, 2 + resp_len,
6857                              ett_gas_query, &item, "Query Response");
6858   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
6859     expert_add_info(pinfo, item, &ei_ieee80211_ff_query_response_length);
6860     return tvb_reported_length_remaining(tvb, offset);
6861   }
6862
6863   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
6864                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6865   offset += 2;
6866   /* Query Response (optional) */
6867   if (resp_len) {
6868     if (anqp && (frag == 0) && !more)
6869       dissect_anqp(query, tvb, pinfo, offset, FALSE);
6870     else {
6871       fragment_head *frag_msg;
6872       gboolean save_fragmented;
6873       tvbuff_t *new_tvb;
6874
6875       save_fragmented = pinfo->fragmented;
6876       pinfo->fragmented = TRUE;
6877       frag_msg = fragment_add_seq_check(&gas_reassembly_table, tvb, offset,
6878                                         pinfo, dialog_token, NULL,
6879                                         frag, resp_len, more);
6880       new_tvb = process_reassembled_data(tvb, offset, pinfo,
6881                                          "Reassembled GAS Query Response",
6882                                          frag_msg, &gas_resp_frag_items,
6883                                          NULL, tree);
6884       if (new_tvb) {
6885         if (anqp)
6886           dissect_anqp(query, new_tvb, pinfo, 0, FALSE);
6887         else
6888           proto_tree_add_item(query, hf_ieee80211_ff_query_response,
6889                               new_tvb, 0,
6890                               tvb_reported_length_remaining(new_tvb, 0),
6891                               ENC_NA);
6892       }
6893
6894       /* The old tvb cannot be used anymore */
6895       ieee80211_tvb_invalid = TRUE;
6896
6897       pinfo->fragmented = save_fragmented;
6898     }
6899     offset += resp_len;
6900   }
6901
6902   return offset - start;
6903 }
6904
6905 /* ************************************************************************* */
6906 /*              Dissect and add fixed mgmt fields to protocol tree           */
6907 /* ************************************************************************* */
6908
6909 static guint
6910 add_fixed_field(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
6911                 enum fixed_field lfcode);
6912
6913 static guint64 last_timestamp;
6914
6915 static guint
6916 add_ff_timestamp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6917 {
6918   last_timestamp = tvb_get_letoh64(tvb, offset);
6919   proto_tree_add_item(tree, hf_ieee80211_ff_timestamp, tvb, offset, 8,
6920                       ENC_LITTLE_ENDIAN);
6921   return 8;
6922 }
6923
6924 static guint
6925 add_ff_beacon_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6926 {
6927   proto_tree_add_item(tree, hf_ieee80211_ff_beacon_interval, tvb, offset, 2,
6928                       ENC_LITTLE_ENDIAN);
6929   col_append_fstr(pinfo->cinfo, COL_INFO, ", BI=%d",
6930                   tvb_get_letohs(tvb, offset));
6931   return 2;
6932 }
6933
6934 static guint
6935 add_ff_cap_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6936 {
6937   proto_item *cap_item;
6938   proto_tree *cap_tree;
6939
6940   cap_item = proto_tree_add_item(tree, hf_ieee80211_ff_capture, tvb, offset, 2,
6941                                  ENC_LITTLE_ENDIAN);
6942   cap_tree = proto_item_add_subtree(cap_item, ett_cap_tree);
6943
6944   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ess, tvb, offset, 2,
6945                       ENC_LITTLE_ENDIAN);
6946   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ibss, tvb, offset, 2,
6947                       ENC_LITTLE_ENDIAN);
6948   if ((tvb_get_letohs(tvb, offset) & 0x0001) != 0) {
6949     /* This is an AP */
6950     proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ap_poll, tvb, offset, 2,
6951                         ENC_LITTLE_ENDIAN);
6952   } else {
6953     /* This is a STA */
6954     proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_sta_poll, tvb, offset, 2,
6955                         ENC_LITTLE_ENDIAN);
6956   }
6957
6958   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_privacy, tvb, offset, 2,
6959                       ENC_LITTLE_ENDIAN);
6960   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_preamble, tvb, offset, 2,
6961                       ENC_LITTLE_ENDIAN);
6962   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_pbcc, tvb, offset, 2,
6963                       ENC_LITTLE_ENDIAN);
6964   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_agility, tvb, offset, 2,
6965                       ENC_LITTLE_ENDIAN);
6966   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_spec_man, tvb, offset, 2,
6967                       ENC_LITTLE_ENDIAN);
6968   proto_tree_add_item(cap_tree, hf_ieee80211_ff_short_slot_time, tvb, offset,
6969                       2, ENC_LITTLE_ENDIAN);
6970   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_apsd, tvb, offset, 2,
6971                       ENC_LITTLE_ENDIAN);
6972   proto_tree_add_item(cap_tree, hf_ieee80211_ff_radio_measurement, tvb, offset, 2,
6973                       ENC_LITTLE_ENDIAN);
6974   proto_tree_add_item(cap_tree, hf_ieee80211_ff_dsss_ofdm, tvb, offset, 2,
6975                       ENC_LITTLE_ENDIAN);
6976   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_del_blk_ack, tvb, offset, 2,
6977                       ENC_LITTLE_ENDIAN);
6978   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_imm_blk_ack, tvb, offset, 2,
6979                       ENC_LITTLE_ENDIAN);
6980   return 2;
6981 }
6982
6983 static guint
6984 add_ff_auth_alg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6985 {
6986   proto_tree_add_item(tree, hf_ieee80211_ff_auth_alg, tvb, offset, 2,
6987                       ENC_LITTLE_ENDIAN);
6988   return 2;
6989 }
6990
6991 static guint
6992 add_ff_auth_trans_seq(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6993 {
6994   proto_tree_add_item(tree, hf_ieee80211_ff_auth_seq, tvb, offset, 2,
6995                       ENC_LITTLE_ENDIAN);
6996   return 2;
6997 }
6998
6999 static guint
7000 add_ff_current_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7001 {
7002   proto_tree_add_item(tree, hf_ieee80211_ff_current_ap, tvb, offset, 6,
7003                       ENC_NA);
7004   return 6;
7005 }
7006
7007 static guint
7008 add_ff_listen_ival(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7009 {
7010   proto_tree_add_item(tree, hf_ieee80211_ff_listen_ival, tvb, offset, 2,
7011                       ENC_LITTLE_ENDIAN);
7012   return 2;
7013 }
7014
7015 static guint
7016 add_ff_reason_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7017 {
7018   proto_tree_add_item(tree, hf_ieee80211_ff_reason, tvb, offset, 2,
7019                       ENC_LITTLE_ENDIAN);
7020   return 2;
7021 }
7022
7023 static guint
7024 add_ff_assoc_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7025 {
7026   proto_tree_add_item(tree, hf_ieee80211_ff_assoc_id, tvb, offset, 2,
7027                       ENC_LITTLE_ENDIAN);
7028   return 2;
7029 }
7030
7031 static guint
7032 add_ff_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7033 {
7034   proto_tree_add_item(tree, hf_ieee80211_ff_status_code, tvb, offset, 2,
7035                       ENC_LITTLE_ENDIAN);
7036   return 2;
7037 }
7038
7039 static guint
7040 add_ff_category_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7041 {
7042   proto_tree_add_item(tree, hf_ieee80211_ff_category_code, tvb, offset, 1,
7043                       ENC_LITTLE_ENDIAN);
7044   return 1;
7045 }
7046
7047 static guint
7048 add_ff_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7049 {
7050   proto_tree_add_item(tree, hf_ieee80211_ff_action_code, tvb, offset, 1,
7051                       ENC_LITTLE_ENDIAN);
7052   return 1;
7053 }
7054
7055 static guint
7056 add_ff_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7057 {
7058   proto_tree_add_item(tree, hf_ieee80211_ff_dialog_token, tvb, offset, 1,
7059                       ENC_LITTLE_ENDIAN);
7060   return 1;
7061 }
7062
7063 static guint
7064 add_ff_followup_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7065 {
7066   proto_tree_add_item(tree, hf_ieee80211_ff_followup_dialog_token, tvb, offset, 1,
7067                       ENC_LITTLE_ENDIAN);
7068   return 1;
7069 }
7070
7071 static guint
7072 add_ff_wme_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7073 {
7074   proto_tree_add_item(tree, hf_ieee80211_ff_wme_action_code, tvb, offset, 1,
7075                       ENC_LITTLE_ENDIAN);
7076   return 1;
7077 }
7078
7079 static guint
7080 add_ff_wme_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7081 {
7082   proto_tree_add_item(tree, hf_ieee80211_ff_wme_status_code, tvb, offset, 1,
7083                       ENC_LITTLE_ENDIAN);
7084   return 1;
7085 }
7086
7087 static guint
7088 add_ff_qos_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7089 {
7090   proto_tree_add_item(tree, hf_ieee80211_ff_qos_action_code, tvb, offset, 1,
7091                       ENC_LITTLE_ENDIAN);
7092   return 1;
7093 }
7094
7095 static guint
7096 add_ff_block_ack_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7097 {
7098   proto_tree_add_item(tree, hf_ieee80211_ff_ba_action, tvb, offset, 1,
7099                       ENC_LITTLE_ENDIAN);
7100   return 1;
7101 }
7102
7103 static guint
7104 add_ff_block_ack_param(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7105 {
7106   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_params,
7107                          ett_ff_ba_param_tree,
7108                          ieee80211_ff_block_ack_params_fields,
7109                          ENC_LITTLE_ENDIAN);
7110   return 2;
7111 }
7112
7113 static guint
7114 add_ff_block_ack_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7115 {
7116   proto_tree_add_item(tree, hf_ieee80211_ff_block_ack_timeout, tvb, offset, 2,
7117                       ENC_LITTLE_ENDIAN);
7118   return 2;
7119 }
7120
7121 static guint
7122 add_ff_block_ack_ssc(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7123 {
7124   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_ssc,
7125                          ett_ff_ba_ssc_tree, ieee80211_ff_block_ack_ssc_fields,
7126                          ENC_LITTLE_ENDIAN);
7127   return 2;
7128 }
7129
7130 static guint
7131 add_ff_qos_ts_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7132 {
7133   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_tsinfo,
7134                          ett_tsinfo_tree, ieee80211_tsinfo_fields,
7135                          ENC_LITTLE_ENDIAN);
7136   return 3;
7137 }
7138
7139 static guint
7140 add_ff_mesh_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7141 {
7142   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_action, tvb, offset, 1,
7143                       ENC_LITTLE_ENDIAN);
7144   return 1;
7145 }
7146
7147 static guint
7148 add_ff_multihop_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7149 {
7150   proto_tree_add_item(tree, hf_ieee80211_ff_multihop_action, tvb, offset, 1,
7151                       ENC_LITTLE_ENDIAN);
7152   return 1;
7153 }
7154
7155 static guint
7156 add_ff_mesh_control(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7157 {
7158   int    start = offset;
7159   guint8 flags;
7160
7161   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_flags, tvb, offset, 1,
7162                       ENC_LITTLE_ENDIAN);
7163   flags = tvb_get_guint8(tvb, offset);
7164   offset += 1;
7165   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_ttl, tvb, offset, 1,
7166                       ENC_LITTLE_ENDIAN);
7167   offset += 1;
7168   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_sequence, tvb, offset, 4,
7169                       ENC_LITTLE_ENDIAN);
7170   offset += 4;
7171
7172   switch (flags & 0x03) {
7173   case 1:
7174     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr4, tvb, offset, 6,
7175                         ENC_NA);
7176     offset += 6;
7177     break;
7178   case 2:
7179     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr5, tvb, offset, 6,
7180                         ENC_NA);
7181     offset += 6;
7182     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr6, tvb, offset, 6,
7183                         ENC_NA);
7184     offset += 6;
7185     break;
7186   case 3:
7187     proto_item_append_text(tree, " Unknown Address Extension Mode");
7188     break;
7189   default:
7190     /* no default action */
7191     break;
7192   }
7193
7194   return offset - start;
7195 }
7196
7197 static guint
7198 add_ff_selfprot_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7199 {
7200   proto_tree_add_item(tree, hf_ieee80211_ff_selfprot_action, tvb, offset, 1,
7201                       ENC_LITTLE_ENDIAN);
7202   return 1;
7203 }
7204
7205 static guint
7206 add_ff_dls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7207 {
7208   proto_tree_add_item(tree, hf_ieee80211_ff_dls_action_code, tvb, offset, 1,
7209                       ENC_LITTLE_ENDIAN);
7210   return 1;
7211 }
7212
7213 static guint
7214 add_ff_dst_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7215 {
7216   proto_tree_add_item(tree, hf_ieee80211_ff_dst_mac_addr, tvb, offset, 6,
7217                       ENC_NA);
7218   return 6;
7219 }
7220
7221 static guint
7222 add_ff_src_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7223 {
7224   proto_tree_add_item(tree, hf_ieee80211_ff_src_mac_addr, tvb, offset, 6,
7225                       ENC_NA);
7226   return 6;
7227 }
7228
7229 static guint
7230 add_ff_req_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7231 {
7232   proto_tree_add_item(tree, hf_ieee80211_ff_req_ap_addr, tvb, offset, 6,
7233                       ENC_NA);
7234   return 6;
7235 }
7236
7237 static guint
7238 add_ff_res_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7239 {
7240   proto_tree_add_item(tree, hf_ieee80211_ff_res_ap_addr, tvb, offset, 6,
7241                       ENC_NA);
7242   return 6;
7243 }
7244
7245 static guint
7246 add_ff_check_beacon(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7247 {
7248   proto_tree_add_item(tree, hf_ieee80211_ff_check_beacon, tvb, offset, 1,
7249                       ENC_NA);
7250   return 1;
7251 }
7252
7253 static guint
7254 add_ff_tod(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7255 {
7256   proto_tree_add_item(tree, hf_ieee80211_ff_tod, tvb, offset, 4,
7257                      ENC_NA);
7258   return 4;
7259 }
7260
7261 static guint
7262 add_ff_toa(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7263 {
7264   proto_tree_add_item(tree, hf_ieee80211_ff_toa, tvb, offset, 4,
7265                       ENC_NA);
7266   return 4;
7267 }
7268
7269 static guint
7270 add_ff_max_tod_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7271 {
7272   proto_tree_add_item(tree, hf_ieee80211_ff_max_tod_err, tvb, offset, 1,
7273                       ENC_NA);
7274   return 1;
7275 }
7276
7277 static guint
7278 add_ff_max_toa_err(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7279 {
7280   proto_tree_add_item(tree, hf_ieee80211_ff_max_toa_err, tvb, offset, 1,
7281                       ENC_NA);
7282   return 1;
7283 }
7284
7285 static guint
7286 add_ff_dls_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7287 {
7288   proto_tree_add_item(tree, hf_ieee80211_ff_dls_timeout, tvb, offset, 2,
7289                       ENC_LITTLE_ENDIAN);
7290   return 2;
7291 }
7292
7293 static guint
7294 add_ff_delba_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7295 {
7296   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_delba_param,
7297                          ett_ff_ba_param_tree, ieee80211_ff_delba_param_fields,
7298                          ENC_LITTLE_ENDIAN);
7299   return 2;
7300 }
7301
7302 static guint
7303 add_ff_max_reg_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7304 {
7305   proto_tree_add_item(tree, hf_ieee80211_ff_max_reg_pwr, tvb, offset, 2,
7306                       ENC_LITTLE_ENDIAN);
7307   return 2;
7308 }
7309
7310 static guint
7311 add_ff_measurement_pilot_int(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7312 {
7313   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
7314                       2, ENC_LITTLE_ENDIAN);
7315   return 2;
7316 }
7317
7318 static guint
7319 add_ff_country_str(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7320 {
7321   proto_tree_add_item(tree, hf_ieee80211_ff_country_str, tvb, offset, 3,
7322                       ENC_ASCII|ENC_NA);
7323   return 3;
7324 }
7325
7326 static guint
7327 add_ff_max_tx_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7328 {
7329   proto_tree_add_item(tree, hf_ieee80211_ff_max_tx_pwr, tvb, offset, 1,
7330                       ENC_LITTLE_ENDIAN);
7331   return 1;
7332 }
7333
7334 static guint
7335 add_ff_tx_pwr_used(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7336 {
7337   proto_tree_add_item(tree, hf_ieee80211_ff_tx_pwr_used, tvb, offset, 1,
7338                       ENC_LITTLE_ENDIAN);
7339   return 1;
7340 }
7341
7342 static guint
7343 add_ff_transceiver_noise_floor(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7344 {
7345   proto_tree_add_item(tree, hf_ieee80211_ff_transceiver_noise_floor, tvb,
7346                       offset, 1, ENC_LITTLE_ENDIAN);
7347   return 1;
7348 }
7349
7350 static guint
7351 add_ff_channel_width(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7352 {
7353   proto_tree_add_item(tree, hf_ieee80211_ff_channel_width, tvb, offset, 1,
7354                       ENC_LITTLE_ENDIAN);
7355   return 1;
7356 }
7357
7358 /* QoS Info:  802.11-2012 8.4.1.17 */
7359 static guint
7360 add_ff_qos_info_ap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7361 {
7362   /* From AP so decode as AP: Figure 8-51-QoS Info field when sent by a AP */
7363   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
7364                                     ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
7365                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
7366   return 1;
7367 }
7368
7369
7370 /* QoS Info:  802.11-2012 8.4.1.17 */
7371 static guint
7372 add_ff_qos_info_sta(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7373 {
7374   /* To AP so decode as STA: Figure 8-52-QoS Info field when set by a non-AP STA */
7375   proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_qos_info_sta,
7376                                     ett_ff_qos_info, ieee80211_ff_qos_info_sta_fields,
7377                                     ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
7378   return 1;
7379 }
7380
7381 static guint
7382 add_ff_sm_pwr_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7383 {
7384   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_sm_pwr_save,
7385                          ett_ff_sm_pwr_save, ieee80211_ff_sw_pwr_save_fields,
7386                          ENC_LITTLE_ENDIAN);
7387   return 1;
7388 }
7389
7390 static guint
7391 add_ff_pco_phase_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7392 {
7393   proto_tree_add_item(tree, hf_ieee80211_ff_pco_phase_cntrl, tvb, offset, 1,
7394                       ENC_LITTLE_ENDIAN);
7395   return 1;
7396 }
7397
7398 static guint
7399 add_ff_psmp_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7400 {
7401   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_psmp_param_set,
7402                          ett_ff_psmp_param_set,
7403                          ieee80211_ff_psmp_param_set_fields,
7404                          ENC_LITTLE_ENDIAN);
7405   return 2;
7406 }
7407
7408 static guint
7409 add_ff_mimo_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7410 {
7411   proto_item *mimo_item;
7412   proto_tree *mimo_tree;
7413
7414   mimo_item = proto_tree_add_item(tree, hf_ieee80211_ff_mimo_cntrl, tvb,
7415                                   offset, 6, ENC_NA);
7416   mimo_tree = proto_item_add_subtree(mimo_item, ett_ff_mimo_cntrl);
7417
7418   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_nc_index, tvb,
7419                       offset, 1, ENC_LITTLE_ENDIAN);
7420   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_nr_index, tvb,
7421                       offset, 1, ENC_LITTLE_ENDIAN);
7422   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_channel_width, tvb,
7423                       offset, 1, ENC_LITTLE_ENDIAN);
7424   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_grouping, tvb,
7425                       offset, 1, ENC_LITTLE_ENDIAN);
7426   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_coefficient_size,
7427                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
7428   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_codebook_info, tvb,
7429                       offset, 1, ENC_LITTLE_ENDIAN);
7430   proto_tree_add_item(mimo_tree,
7431                       hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment, tvb,
7432                       offset, 1, ENC_LITTLE_ENDIAN);
7433   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_reserved, tvb,
7434                       offset, 1, ENC_LITTLE_ENDIAN);
7435
7436   offset += 2;
7437   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
7438                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
7439
7440   return 6;
7441 }
7442
7443 static guint
7444 add_ff_ant_selection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7445 {
7446   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ant_selection,
7447                          ett_ff_ant_sel, ieee80211_ff_ant_selection_fields,
7448                          ENC_LITTLE_ENDIAN);
7449   return 1;
7450 }
7451
7452 static guint
7453 add_ff_extended_channel_switch_announcement(proto_tree *tree, tvbuff_t *tvb,
7454                                             packet_info *pinfo _U_, int offset)
7455 {
7456   proto_tree_add_bitmask(tree, tvb, offset,
7457                          hf_ieee80211_ff_ext_channel_switch_announcement,
7458                          ett_ff_chan_switch_announce,
7459                          ieee80211_ff_ext_channel_switch_announcement_fields,
7460                          ENC_LITTLE_ENDIAN);
7461   return 4;
7462 }
7463
7464 static guint
7465 add_ff_ht_information(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7466 {
7467   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ht_info,
7468                          ett_ff_ht_info, ieee80211_ff_ht_info_fields,
7469                          ENC_LITTLE_ENDIAN);
7470   return 1;
7471 }
7472
7473 static guint
7474 add_ff_ht_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7475 {
7476   proto_tree_add_item(tree, hf_ieee80211_ff_ht_action, tvb, offset, 1,
7477                       ENC_LITTLE_ENDIAN);
7478   return 1;
7479 }
7480
7481 static guint
7482 add_ff_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7483 {
7484   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_action_code, tvb, offset, 1,
7485                       ENC_LITTLE_ENDIAN);
7486   return 1;
7487 }
7488
7489 static guint
7490 add_ff_dmg_pwr_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7491 {
7492   proto_tree_add_item(tree, hf_ieee80211_ff_dmg_pwr_mgmt, tvb, offset, 1,
7493                       ENC_LITTLE_ENDIAN);
7494   return 1;
7495 }
7496
7497 static guint
7498 add_ff_psmp_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7499 {
7500   proto_item *psmp_item;
7501   proto_tree *psmp_tree;
7502
7503   psmp_item = proto_tree_add_item(tree, hf_ieee80211_ff_psmp_sta_info, tvb,
7504                                   offset, 8, ENC_LITTLE_ENDIAN);
7505   psmp_tree = proto_item_add_subtree(psmp_item, ett_ff_psmp_sta_info);
7506
7507   proto_tree_add_item(psmp_item, hf_ieee80211_ff_psmp_sta_info_type, tvb,
7508                       offset, 4, ENC_LITTLE_ENDIAN);
7509
7510   switch (tvb_get_letohl(tvb, offset) & PSMP_STA_INFO_FLAG_TYPE) {
7511   case PSMP_STA_INFO_BROADCAST:
7512     proto_tree_add_item(psmp_tree,
7513                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
7514                         offset, 4, ENC_LITTLE_ENDIAN);
7515     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
7516                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7517     /* Missing 64 bit bitmask... */
7518     proto_tree_add_uint64(psmp_tree,
7519                           hf_ieee80211_ff_psmp_sta_info_reserved_large,
7520                           tvb, offset, 8,
7521                           (tvb_get_letoh64(tvb, offset) &
7522                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
7523     break;
7524   case PSMP_STA_INFO_MULTICAST:
7525     proto_tree_add_item(psmp_tree,
7526                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
7527                         offset, 4, ENC_LITTLE_ENDIAN);
7528     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
7529                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7530     /* Missing 64 bit bitmask... */
7531     proto_tree_add_uint64(psmp_tree,
7532                           hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
7533                           tvb, offset, 6,
7534                           (tvb_get_letoh64(tvb, offset) &
7535                            G_GUINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
7536     break;
7537   case PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED:
7538     proto_tree_add_item(psmp_tree,
7539                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
7540                         offset, 4, ENC_LITTLE_ENDIAN);
7541     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
7542                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7543     offset += 2;
7544     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_sta_id, tvb,
7545                         offset, 4, ENC_LITTLE_ENDIAN);
7546     offset += 2;
7547
7548     proto_tree_add_item(psmp_tree,
7549                         hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
7550                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7551     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_utt_duration,
7552                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
7553     proto_tree_add_item(psmp_tree,
7554                         hf_ieee80211_ff_psmp_sta_info_reserved_small, tvb,
7555                         offset, 4, ENC_LITTLE_ENDIAN);
7556     break;
7557   }
7558
7559   return 8;
7560 }
7561
7562 static guint
7563 add_ff_schedule_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7564 {
7565   proto_item *sched_item;
7566   proto_tree *sched_tree;
7567
7568   sched_item = proto_tree_add_item(tree, hf_ieee80211_sched_info, tvb, offset,
7569                                    2, ENC_LITTLE_ENDIAN);
7570   sched_tree = proto_item_add_subtree(sched_item, ett_sched_tree);
7571
7572   proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_agg, tvb, offset, 2,
7573                       ENC_LITTLE_ENDIAN);
7574   if (tvb_get_letohs(tvb, offset) & 0x0001) {
7575     proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_tsid, tvb, offset,
7576                         2, ENC_LITTLE_ENDIAN);
7577     proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_dir, tvb, offset,
7578                         2, ENC_LITTLE_ENDIAN);
7579   }
7580
7581   return 2;
7582 }
7583
7584 static guint
7585 add_ff_pa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7586 {
7587   proto_tree_add_item(tree, hf_ieee80211_ff_public_action, tvb, offset, 1,
7588                       ENC_LITTLE_ENDIAN);
7589   return 1;
7590 }
7591
7592 static guint
7593 add_ff_ppa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7594 {
7595   proto_tree_add_item(tree, hf_ieee80211_ff_protected_public_action, tvb, offset, 1,
7596                       ENC_LITTLE_ENDIAN);
7597   return 1;
7598 }
7599
7600 static guint
7601 add_ff_action_spectrum_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7602 {
7603     switch (tvb_get_guint8(tvb, offset + 1)) {
7604     case SM_ACTION_MEASUREMENT_REQUEST:
7605     case SM_ACTION_MEASUREMENT_REPORT:
7606     case SM_ACTION_TPC_REQUEST:
7607     case SM_ACTION_TPC_REPORT:
7608       add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
7609       add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_ACTION_CODE);
7610       add_fixed_field(tree, tvb, pinfo, offset + 2, FIELD_DIALOG_TOKEN);
7611       return 3;
7612     case SM_ACTION_CHAN_SWITCH_ANNC:
7613     case SM_ACTION_EXT_CHAN_SWITCH_ANNC:
7614       add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
7615       add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_ACTION_CODE);
7616       return 2;
7617     default:
7618       add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
7619       add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_ACTION_CODE);
7620       return 2;
7621     }
7622 }
7623
7624 static guint
7625 add_ff_action_qos(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7626 {
7627   switch (tvb_get_guint8(tvb, offset + 1)) {
7628   case QOS_ACTION_ADDTS_REQUEST:
7629     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7630     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
7631     add_fixed_field(tree, tvb, pinfo, offset + 2, FIELD_DIALOG_TOKEN);
7632     return 3;
7633   case QOS_ACTION_ADDTS_RESPONSE:
7634     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7635     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
7636     add_fixed_field(tree, tvb, pinfo, offset + 2, FIELD_DIALOG_TOKEN);
7637     add_fixed_field(tree, tvb, pinfo, offset + 3, FIELD_STATUS_CODE);
7638     return 5;
7639   case QOS_ACTION_DELTS:
7640     add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
7641     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
7642     add_fixed_field(tree, tvb, pinfo, offset + 2, FIELD_QOS_TS_INFO);
7643     add_fixed_field(tree, tvb, pinfo, offset + 5, FIELD_REASON_CODE);
7644     return 7;
7645   case QOS_ACTION_SCHEDULE:
7646     add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
7647     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
7648     return 2;
7649   case QOS_ACTION_MAP_CONFIGURE:
7650     add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
7651     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
7652     return 2;
7653   default:
7654     add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
7655     return 2;
7656   }
7657 }
7658
7659 static guint
7660 add_ff_action_dls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7661 {
7662   switch (tvb_get_guint8(tvb, offset + 1)) {
7663   case DLS_ACTION_REQUEST:
7664     add_fixed_field(tree, tvb, pinfo, offset,      FIELD_CATEGORY_CODE);
7665     add_fixed_field(tree, tvb, pinfo, offset +  1, FIELD_DLS_ACTION_CODE);
7666     add_fixed_field(tree, tvb, pinfo, offset +  2, FIELD_DST_MAC_ADDR);
7667     add_fixed_field(tree, tvb, pinfo, offset +  8, FIELD_SRC_MAC_ADDR);
7668     add_fixed_field(tree, tvb, pinfo, offset + 14, FIELD_CAP_INFO);
7669     add_fixed_field(tree, tvb, pinfo, offset + 16, FIELD_DLS_TIMEOUT);
7670     return 18;
7671   case DLS_ACTION_RESPONSE:
7672     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7673     add_fixed_field(tree, tvb, pinfo, offset +  1, FIELD_DLS_ACTION_CODE);
7674     add_fixed_field(tree, tvb, pinfo, offset +  2, FIELD_STATUS_CODE);
7675     add_fixed_field(tree, tvb, pinfo, offset +  4, FIELD_DST_MAC_ADDR);
7676     add_fixed_field(tree, tvb, pinfo, offset + 10, FIELD_SRC_MAC_ADDR);
7677     if (!hf_ieee80211_ff_status_code) {
7678       add_fixed_field(tree, tvb, pinfo, offset + 16, FIELD_CAP_INFO);
7679     }
7680     return 16;
7681   case DLS_ACTION_TEARDOWN:
7682     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7683     add_fixed_field(tree, tvb, pinfo, offset +  1, FIELD_DLS_ACTION_CODE);
7684     add_fixed_field(tree, tvb, pinfo, offset +  2, FIELD_DST_MAC_ADDR);
7685     add_fixed_field(tree, tvb, pinfo, offset +  8, FIELD_SRC_MAC_ADDR);
7686     add_fixed_field(tree, tvb, pinfo, offset + 14, FIELD_REASON_CODE);
7687     return 16;
7688   default:
7689     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7690     return 2;
7691   }
7692 }
7693
7694 static guint
7695 add_ff_action_block_ack(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7696 {
7697   guint start = offset;
7698
7699   switch (tvb_get_guint8(tvb, offset + 1)) {
7700   case BA_ADD_BLOCK_ACK_REQUEST:
7701     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7702     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_ACTION_CODE);
7703     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7704     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_PARAM);
7705     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_TIMEOUT);
7706     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
7707     break;
7708   case BA_ADD_BLOCK_ACK_RESPONSE:
7709     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7710     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_ACTION_CODE);
7711     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7712     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7713     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_PARAM);
7714     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_TIMEOUT);
7715     break;
7716   case BA_DELETE_BLOCK_ACK:
7717     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7718     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_ACTION_CODE);
7719     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DELBA_PARAM_SET);
7720     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
7721     break;
7722   }
7723
7724   return offset - start;  /* Size of fixed fields */
7725 }
7726
7727 static guint
7728 add_ff_action_public_fields(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint8 code)
7729 {
7730   guint32  oui;
7731   guint8   subtype;
7732   gboolean anqp;
7733   guint8   dialog_token;
7734   guint8   frag;
7735   gboolean more;
7736
7737   guint start = offset;
7738
7739   switch (code) {
7740   case PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT:
7741     offset += add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
7742     break;
7743   case PA_VENDOR_SPECIFIC:
7744     oui = tvb_get_ntoh24(tvb, offset);
7745     proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
7746     offset += 3;
7747     switch (oui) {
7748     case OUI_WFA:
7749       subtype = tvb_get_guint8(tvb, offset);
7750       proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
7751       offset += 1;
7752       if (subtype == WFA_SUBTYPE_P2P) {
7753         offset = dissect_wifi_p2p_public_action(pinfo, tree, tvb, offset);
7754       }
7755       break;
7756     default:
7757       /* Don't know how to handle this vendor */
7758       break;
7759     }
7760     break;
7761   case PA_GAS_INITIAL_REQUEST:
7762     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7763     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
7764                                              &anqp);
7765     offset += dissect_gas_initial_request(tree, tvb, pinfo, offset, anqp);
7766     break;
7767   case PA_GAS_INITIAL_RESPONSE:
7768     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7769     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7770     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_GAS_COMEBACK_DELAY);
7771     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
7772                                              &anqp);
7773     offset += dissect_gas_initial_response(tree, tvb, pinfo, offset, anqp);
7774     break;
7775   case PA_GAS_COMEBACK_REQUEST:
7776     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7777     break;
7778   case PA_GAS_COMEBACK_RESPONSE:
7779     dialog_token = tvb_get_guint8(tvb, offset);
7780     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7781     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7782     frag = tvb_get_guint8(tvb, offset) & 0x7f;
7783     more = (tvb_get_guint8(tvb, offset) & 0x80) != 0;
7784     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_GAS_FRAGMENT_ID);
7785     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_GAS_COMEBACK_DELAY);
7786     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
7787                                              &anqp);
7788     offset += dissect_gas_comeback_response(tree, tvb, pinfo, offset, anqp, frag,
7789                                             more, dialog_token);
7790     break;
7791   case PA_TDLS_DISCOVERY_RESPONSE:
7792     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
7793     col_set_str(pinfo->cinfo, COL_INFO, "TDLS Discovery Response");
7794     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7795     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
7796     break;
7797   case PA_QAB_REQUEST:
7798   case PA_QAB_RESPONSE:
7799     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7800     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REQ_AP_ADDR);
7801     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RES_AP_ADDR);
7802     break;
7803   }
7804
7805   return offset - start;  /* Size of fixed fields */
7806 }
7807
7808 static guint
7809 add_ff_action_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7810 {
7811   guint8 code;
7812   guint start = offset;
7813   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7814   code    = tvb_get_guint8(tvb, offset);
7815   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PA_ACTION_CODE);
7816   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
7817   return offset - start;
7818 }
7819
7820 static guint
7821 add_ff_action_protected_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7822 {
7823   guint8 code;
7824   guint start = offset;
7825   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7826   code    = tvb_get_guint8(tvb, offset);
7827   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PPA_ACTION_CODE);
7828   offset += add_ff_action_public_fields(tree, tvb, pinfo, offset, code);
7829   return offset - start;
7830 }
7831
7832 static guint
7833 add_ff_action_radio_measurement(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7834 {
7835   guint  start = offset;
7836   guint8 code;
7837
7838   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7839   code = tvb_get_guint8(tvb, offset);
7840   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_ACTION_CODE);
7841
7842   switch (code) {
7843   case RM_ACTION_RADIO_MEASUREMENT_REQUEST:
7844     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_DIALOG_TOKEN);
7845     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_REPETITIONS);
7846     /* Followed by Measurement Request Elements */
7847     break;
7848   case RM_ACTION_RADIO_MEASUREMENT_REPORT:
7849     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_DIALOG_TOKEN);
7850     /* Followed by Measurement Report Elements */
7851     break;
7852   case RM_ACTION_LINK_MEASUREMENT_REQUEST:
7853     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_DIALOG_TOKEN);
7854     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_TX_POWER);
7855     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_MAX_TX_POWER);
7856     /* Followed by Optional Subelements */
7857     break;
7858   case RM_ACTION_LINK_MEASUREMENT_REPORT:
7859     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_DIALOG_TOKEN);
7860     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_TPC_REPORT);
7861     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_RX_ANTENNA_ID);
7862     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_TX_ANTENNA_ID);
7863     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_RCPI);
7864     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_RSNI);
7865     /* Followed by Optional Subelements */
7866     break;
7867   case RM_ACTION_NEIGHBOR_REPORT_REQUEST:
7868     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_DIALOG_TOKEN);
7869     /* Followed by Optional Subelements */
7870     break;
7871   case RM_ACTION_NEIGHBOR_REPORT_RESPONSE:
7872     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RM_DIALOG_TOKEN);
7873     /* Followed by Neighbor Report Elements */
7874     break;
7875   }
7876
7877   return offset - start;  /* Size of fixed fields */
7878 }
7879
7880 static guint
7881 add_ff_action_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7882 {
7883   guint  start = offset;
7884   guint8 code;
7885
7886   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7887   code    = tvb_get_guint8(tvb, offset);
7888   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_FT_ACTION_CODE);
7889
7890   switch (code) {
7891   case FT_ACTION_REQUEST:
7892     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STA_ADDRESS);
7893     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_AP_ADDRESS);
7894     /* Followed by FT Request frame body (IEs) */
7895     break;
7896   case FT_ACTION_RESPONSE:
7897     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STA_ADDRESS);
7898     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_AP_ADDRESS);
7899     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7900     /* Followed by FT Response frame body (IEs) */
7901     break;
7902   case FT_ACTION_CONFIRM:
7903     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STA_ADDRESS);
7904     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_AP_ADDRESS);
7905     /* Followed by FT Confirm frame body (IEs) */
7906     break;
7907   case FT_ACTION_ACK:
7908     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STA_ADDRESS);
7909     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_AP_ADDRESS);
7910     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7911     /* Followed by FT Ack frame body (IEs) */
7912     break;
7913   }
7914
7915   return offset - start;  /* Size of fixed fields */
7916 }
7917
7918 static guint
7919 add_ff_action_sa_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7920 {
7921   guint  start = offset;
7922   guint8 code;
7923
7924   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7925   code    = tvb_get_guint8(tvb, offset);
7926   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SA_QUERY_ACTION_CODE);
7927
7928   switch (code) {
7929   case SA_QUERY_REQUEST:
7930     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TRANSACTION_ID);
7931     break;
7932   case SA_QUERY_RESPONSE:
7933     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TRANSACTION_ID);
7934     break;
7935   }
7936
7937   return offset - start;  /* Size of fixed fields */
7938 }
7939
7940 static guint
7941 add_ff_action_mesh(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7942 {
7943   guint length;
7944
7945   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7946   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MESH_ACTION);
7947   /* The only fixed fields are the category and mesh action.  The rest are IEs.
7948    */
7949   length = 2;
7950   if (tvb_get_guint8(tvb, 1) == MESH_ACTION_TBTT_ADJ_RESPONSE) {
7951     /* ..except for the TBTT Adjustment Response, which has a status code field
7952      */
7953     length += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7954   }
7955   return length;
7956 }
7957
7958 static guint
7959 add_ff_action_multihop(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7960 {
7961   guint start = offset;
7962
7963   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7964   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MULTIHOP_ACTION);
7965   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MESH_CONTROL);
7966   return offset - start;
7967 }
7968
7969 static guint
7970 add_ff_action_self_protected(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7971 {
7972   guint start = offset;
7973
7974   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7975   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SELFPROT_ACTION);
7976
7977   switch (tvb_get_guint8(tvb, start + 1)) {
7978   case SELFPROT_ACTION_MESH_PEERING_OPEN:
7979     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
7980     break;
7981   case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
7982     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
7983     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_ASSOC_ID);
7984     break;
7985   }
7986
7987   return offset - start;
7988 }
7989
7990 static guint
7991 add_ff_vht_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7992 {
7993   proto_tree_add_item(tree, hf_ieee80211_ff_vht_action, tvb, offset, 1,
7994                       ENC_LITTLE_ENDIAN);
7995   return 1;
7996 }
7997
7998
7999 static guint
8000 wnm_bss_trans_mgmt_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8001 {
8002   int    start = offset;
8003   guint8 mode;
8004   gint   left;
8005
8006   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8007
8008   mode = tvb_get_guint8(tvb, offset);
8009   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_pref_cand,
8010                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8011   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_abridged,
8012                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8013   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_disassoc_imminent,
8014                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8015   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_bss_term_included,
8016                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8017   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
8018                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
8019   offset += 1;
8020
8021   proto_tree_add_item(tree, hf_ieee80211_ff_disassoc_timer, tvb, offset, 2,
8022                       ENC_LITTLE_ENDIAN);
8023   offset += 2;
8024
8025   proto_tree_add_item(tree, hf_ieee80211_ff_validity_interval, tvb, offset, 1,
8026                       ENC_LITTLE_ENDIAN);
8027   offset += 1;
8028
8029   if (mode & 0x08) {
8030     proto_tree_add_item(tree, hf_ieee80211_ff_bss_termination_duration,
8031                         tvb, offset, 8, ENC_NA);
8032     offset += 8;
8033   }
8034
8035   if (mode & 0x10) {
8036     guint8 url_len;
8037     url_len = tvb_get_guint8(tvb, offset);
8038     proto_tree_add_item(tree, hf_ieee80211_ff_url_len, tvb, offset, 1,
8039                         ENC_LITTLE_ENDIAN);
8040     offset += 1;
8041     proto_tree_add_item(tree, hf_ieee80211_ff_url, tvb, offset, url_len,
8042                         ENC_ASCII|ENC_NA);
8043     offset += url_len;
8044   }
8045
8046   left = tvb_reported_length_remaining(tvb, offset);
8047   if (left > 0) {
8048     proto_tree_add_item(tree, hf_ieee80211_ff_bss_transition_candidate_list_entries,
8049                         tvb, offset, left, ENC_NA);
8050     offset += left;
8051   }
8052
8053   return offset - start;
8054 }
8055
8056 static guint
8057 wnm_sleep_mode_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8058 {
8059   int start = offset;
8060   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8061   return offset - start;
8062 }
8063
8064 static guint
8065 wnm_sleep_mode_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8066 {
8067   int start = offset;
8068   guint16 key_data_len;
8069   gint left;
8070
8071   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8072   key_data_len = tvb_get_letohs(tvb, offset);
8073   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_KEY_DATA_LENGTH);
8074   left = tvb_reported_length_remaining(tvb, offset);
8075   if (left < key_data_len) {
8076     expert_add_info(pinfo, tree, &ei_ieee80211_tag_wnm_sleep_mode_no_key_data);
8077     return offset - start;
8078   }
8079   proto_tree_add_item(tree, hf_ieee80211_ff_key_data, tvb, offset,
8080                       key_data_len, ENC_NA);
8081   offset += key_data_len;
8082   return offset - start;
8083 }
8084
8085 static guint
8086 wnm_tfs_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8087 {
8088   int start = offset;
8089   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8090   return offset - start;
8091 }
8092
8093 static guint
8094 wnm_tfs_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8095 {
8096   int start = offset;
8097   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8098   return offset - start;
8099 }
8100
8101 static guint
8102 wnm_notification_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8103 {
8104   int start = offset;
8105   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8106   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_WNM_NOTIFICATION_TYPE);
8107   return offset - start;
8108 }
8109
8110 static guint
8111 add_ff_action_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8112 {
8113   guint8 code;
8114   guint  start = offset;
8115
8116   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
8117   code    = tvb_get_guint8(tvb, offset);
8118   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_WNM_ACTION_CODE);
8119   switch (code) {
8120   case WNM_BSS_TRANS_MGMT_REQ:
8121     offset += wnm_bss_trans_mgmt_req(tree, tvb, pinfo, offset);
8122     break;
8123   case WNM_TFS_REQ:
8124     offset += wnm_tfs_req(tree, tvb, pinfo, offset);
8125     break;
8126   case WNM_TFS_RESP:
8127     offset += wnm_tfs_resp(tree, tvb, pinfo, offset);
8128     break;
8129   case WNM_SLEEP_MODE_REQ:
8130     offset += wnm_sleep_mode_req(tree, tvb, pinfo, offset);
8131     break;
8132   case WNM_SLEEP_MODE_RESP:
8133     offset += wnm_sleep_mode_resp(tree, tvb, pinfo, offset);
8134     break;
8135   case WNM_NOTIFICATION_REQ:
8136     offset += wnm_notification_req(tree, tvb, pinfo, offset);
8137     break;
8138   }
8139
8140   return offset - start;  /* Size of fixed fields */
8141 }
8142
8143 static guint
8144 add_ff_action_unprotected_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8145 {
8146   guint8 code;
8147   guint  start = offset;
8148
8149   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
8150   code    = tvb_get_guint8(tvb, offset);
8151   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_UNPROTECTED_WNM_ACTION_CODE);
8152
8153   switch (code) {
8154   case UNPROTECTED_WNM_TIM:
8155     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CHECK_BEACON);
8156     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TIMESTAMP);
8157     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TOD);
8158     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TOA);
8159     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MAX_TOD_ERR);
8160     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MAX_TOA_ERR);
8161     break;
8162   case UNPROTECTED_WNM_TIMING_MEASUREMENT:
8163     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8164     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_FOLLOWUP_DIALOG_TOKEN);
8165     break;
8166   }
8167
8168   return offset - start;  /* Size of fixed fields */
8169 }
8170
8171 static guint
8172 add_ff_action_tdls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8173 {
8174   guint8  code;
8175   guint16 status;
8176   guint   start = offset;
8177
8178   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
8179   code = tvb_get_guint8(tvb, offset);
8180   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TDLS_ACTION_CODE);
8181   switch (code) {
8182   case TDLS_SETUP_REQUEST:
8183     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8184     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
8185     break;
8186   case TDLS_SETUP_RESPONSE:
8187     status = tvb_get_letohs(tvb, offset);
8188     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
8189     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8190     if (tvb_reported_length_remaining(tvb, offset) < 2) {
8191       if (status == 0) {
8192         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_response_malformed);
8193       }
8194       break;
8195     }
8196     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
8197     break;
8198   case TDLS_SETUP_CONFIRM:
8199     status = tvb_get_letohs(tvb, offset);
8200     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
8201     if (tvb_reported_length_remaining(tvb, offset) < 1) {
8202       if (status == 0) {
8203         expert_add_info(pinfo, tree, &ei_ieee80211_tdls_setup_confirm_malformed);
8204       }
8205       break;
8206     }
8207     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8208     break;
8209   case TDLS_TEARDOWN:
8210     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
8211     break;
8212   case TDLS_PEER_TRAFFIC_INDICATION:
8213     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8214     break;
8215   case TDLS_CHANNEL_SWITCH_REQUEST:
8216     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_CHANNEL);
8217     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_OPERATING_CLASS);
8218     break;
8219   case TDLS_CHANNEL_SWITCH_RESPONSE:
8220     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
8221     break;
8222   case TDLS_PEER_PSM_REQUEST:
8223     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8224     break;
8225   case TDLS_PEER_PSM_RESPONSE:
8226     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8227     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
8228     break;
8229   case TDLS_PEER_TRAFFIC_RESPONSE:
8230     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8231     break;
8232   case TDLS_DISCOVERY_REQUEST:
8233     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8234     break;
8235   }
8236
8237   return offset - start;  /* Size of fixed fields */
8238 }
8239
8240 static guint
8241 add_ff_action_mgmt_notification(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8242 {
8243   guint start = offset;
8244
8245   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
8246   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_WME_ACTION_CODE);
8247   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8248   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_WME_STATUS_CODE);
8249
8250   return offset - start;  /* Size of fixed fields */
8251 }
8252
8253 static guint
8254 add_ff_action_vendor_specific(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8255 {
8256   guint   start = offset;
8257   guint32 oui;
8258   guint8  subtype;
8259
8260   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
8261   oui = tvb_get_ntoh24(tvb, offset);
8262   proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
8263   offset += 3;
8264   switch (oui) {
8265   case OUI_MARVELL:
8266     offset = dissect_vendor_action_marvell(tree, tvb, offset);
8267     break;
8268   case OUI_WFA:
8269     subtype = tvb_get_guint8(tvb, offset);
8270       proto_tree_add_item(tree, hf_ieee80211_tag_oui_wfa_subtype, tvb, offset, 1, ENC_NA);
8271     offset += 1;
8272     if (subtype == WFA_SUBTYPE_P2P) {
8273       offset = dissect_wifi_p2p_action(tree, tvb, offset);
8274     }
8275     break;
8276   default:
8277     /* Don't know how to handle this vendor */
8278     break;
8279   }
8280
8281   return offset - start;  /* Size of fixed fields */
8282 }
8283
8284 static guint
8285 add_ff_action_ht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8286 {
8287   guint  start = offset;
8288   guint8 n_sta, i;
8289   mimo_control_t mimo_cntrl;
8290
8291   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
8292   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_HT_ACTION_CODE);
8293
8294   switch (tvb_get_guint8(tvb, offset - 1)) {
8295   case HT_ACTION_NOTIFY_CHAN_WIDTH:
8296     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CHANNEL_WIDTH);
8297     break;
8298   case HT_ACTION_SM_PWR_SAVE:
8299     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SM_PWR_CNTRL);
8300     break;
8301   case HT_ACTION_PSMP_ACTION:
8302     n_sta = tvb_get_guint8(tvb, offset);
8303     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PSMP_PARAM_SET);
8304     for (i = 0; i < (n_sta & 0x0F); i++) {
8305       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PSMP_STA_INFO);
8306     }
8307     break;
8308   case HT_ACTION_SET_PCO_PHASE:
8309     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PCO_PHASE_CNTRL);
8310     break;
8311   case HT_ACTION_MIMO_CSI:
8312     mimo_cntrl = get_mimo_control(tvb, offset);
8313     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MIMO_CNTRL);
8314     offset += add_mimo_csi_matrices_report(tree, tvb, offset, mimo_cntrl);
8315     break;
8316   case HT_ACTION_MIMO_BEAMFORMING:
8317     mimo_cntrl = get_mimo_control(tvb, offset);
8318     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MIMO_CNTRL);
8319     offset += add_mimo_beamforming_feedback_report(tree, tvb, offset,
8320                                                    mimo_cntrl);
8321     break;
8322   case HT_ACTION_MIMO_COMPRESSED_BEAMFORMING:
8323     mimo_cntrl = get_mimo_control(tvb, offset);
8324     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MIMO_CNTRL);
8325     offset += add_mimo_compressed_beamforming_feedback_report(tree, tvb,
8326                                                               offset,
8327                                                               mimo_cntrl);
8328     break;
8329   case HT_ACTION_ANT_SEL_FEEDBACK:
8330     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_ANT_SELECTION);
8331     break;
8332   case HT_ACTION_HT_INFO_EXCHANGE:
8333     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_HT_INFORMATION);
8334     break;
8335   }
8336
8337   return offset - start;
8338 }
8339
8340 static guint
8341 add_ff_ft_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8342 {
8343   proto_tree_add_item(tree, hf_ieee80211_ff_ft_action_code, tvb, offset, 1,
8344                       ENC_LITTLE_ENDIAN);
8345   return 1;
8346 }
8347
8348 static guint
8349 add_ff_sta_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8350 {
8351   proto_tree_add_item(tree, hf_ieee80211_ff_sta_address, tvb, offset, 6,
8352                       ENC_NA);
8353   return 6;
8354 }
8355
8356 static guint
8357 add_ff_target_ap_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8358 {
8359   proto_tree_add_item(tree, hf_ieee80211_ff_target_ap_address, tvb, offset, 6,
8360                       ENC_NA);
8361   return 6;
8362 }
8363
8364 static guint
8365 add_ff_gas_comeback_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8366 {
8367   proto_tree_add_item(tree, hf_ieee80211_ff_gas_comeback_delay, tvb, offset, 2,
8368                       ENC_LITTLE_ENDIAN);
8369   return 2;
8370 }
8371
8372 static guint
8373 add_ff_gas_fragment_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8374 {
8375   proto_tree_add_item(tree, hf_ieee80211_ff_gas_fragment_id, tvb, offset, 1,
8376                       ENC_LITTLE_ENDIAN);
8377   proto_tree_add_item(tree, hf_ieee80211_ff_more_gas_fragments, tvb, offset, 1,
8378                       ENC_LITTLE_ENDIAN);
8379   return 1;
8380 }
8381
8382 static guint
8383 add_ff_sa_query_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8384 {
8385   proto_tree_add_item(tree, hf_ieee80211_ff_sa_query_action_code, tvb, offset,
8386                       1, ENC_LITTLE_ENDIAN);
8387   return 1;
8388 }
8389
8390 static guint
8391 add_ff_transaction_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8392 {
8393   proto_tree_add_item(tree, hf_ieee80211_ff_transaction_id, tvb, offset, 2,
8394                       ENC_LITTLE_ENDIAN);
8395   return 2;
8396 }
8397
8398 static guint
8399 add_ff_tdls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8400 {
8401   guint8 code;
8402   code = tvb_get_guint8(tvb, offset);
8403   col_set_str(pinfo->cinfo, COL_INFO,
8404               val_to_str_ext_const(code, &tdls_action_codes_ext,
8405                                    "Unknown TDLS Action"));
8406   proto_tree_add_item(tree, hf_ieee80211_ff_tdls_action_code, tvb, offset, 1,
8407                       ENC_LITTLE_ENDIAN);
8408   return 1;
8409 }
8410
8411 static guint
8412 add_ff_target_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8413 {
8414   proto_tree_add_item(tree, hf_ieee80211_ff_target_channel, tvb, offset, 1,
8415                       ENC_LITTLE_ENDIAN);
8416   return 1;
8417 }
8418
8419 static guint
8420 add_ff_operating_class(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8421 {
8422   proto_tree_add_item(tree, hf_ieee80211_ff_operating_class, tvb, offset, 1,
8423                       ENC_LITTLE_ENDIAN);
8424   return 1;
8425 }
8426
8427 static guint
8428 add_ff_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8429 {
8430   guint8 code;
8431
8432   code = tvb_get_guint8(tvb, offset);
8433   col_set_str(pinfo->cinfo, COL_INFO,
8434               val_to_str_ext_const(code, &wnm_action_codes_ext, "Unknown WNM Action"));
8435   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8436   return 1;
8437 }
8438
8439 static guint
8440 add_ff_unprotected_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8441 {
8442   guint8 code;
8443
8444   code = tvb_get_guint8(tvb, offset);
8445   col_set_str(pinfo->cinfo, COL_INFO,
8446               val_to_str_ext_const(code, &unprotected_wnm_action_codes_ext, "Unknown Unprotected WNM Action"));
8447   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_wnm_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8448   return 1;
8449 }
8450
8451 static guint
8452 add_ff_unprotected_dmg_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8453 {
8454   proto_tree_add_item(tree, hf_ieee80211_ff_unprotected_dmg_action_code, tvb, offset, 1, ENC_NA);
8455   return 1;
8456 }
8457
8458 static guint
8459 add_ff_key_data_length(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8460 {
8461   proto_tree_add_item(tree, hf_ieee80211_ff_key_data_length, tvb, offset, 2,
8462                       ENC_LITTLE_ENDIAN);
8463   return 2;
8464 }
8465
8466 struct ieee80211_fixed_field_dissector {
8467   enum fixed_field lfcode;
8468   guint (*dissector)(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset);
8469 };
8470
8471 static guint
8472 add_ff_wnm_notification_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8473 {
8474   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_notification_type,
8475                       tvb, offset, 1, ENC_NA);
8476   return 1;
8477 }
8478
8479 /* Action frame: Radio Measurement actions */
8480 static guint
8481 add_ff_rm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8482 {
8483   proto_tree_add_item(tree, hf_ieee80211_ff_rm_action_code, tvb, offset, 1, ENC_NA);
8484   return 1;
8485 }
8486
8487 static guint
8488 add_ff_rm_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8489 {
8490   proto_tree_add_item(tree, hf_ieee80211_ff_rm_dialog_token, tvb, offset, 1, ENC_NA);
8491   return 1;
8492 }
8493
8494 /* Radio Measurement Request frame, Action fields */
8495 static guint
8496 add_ff_rm_repetitions(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8497 {
8498   /* Note: 65535 means repeated until cancelled or superseded */
8499   proto_tree_add_item(tree, hf_ieee80211_ff_rm_repetitions, tvb, offset, 2,
8500                       ENC_BIG_ENDIAN);
8501   return 2;
8502 }
8503
8504 /* Link Measurement Request frame, Action fields*/
8505 static guint
8506 add_ff_rm_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8507 {
8508   /* In dBm, see 8.4.1.20 */
8509   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_power, tvb, offset, 1, ENC_NA);
8510   return 1;
8511 }
8512
8513 static guint
8514 add_ff_rm_max_tx_power(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8515 {
8516   /* In dBm, see 8.4.1.19 */
8517   proto_tree_add_item(tree, hf_ieee80211_ff_rm_max_tx_power, tvb, offset, 1, ENC_NA);
8518   return 1;
8519 }
8520
8521 /* Link Measurement Report frame, Action fields */
8522 static guint
8523 add_ff_rm_tpc_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8524 {
8525   proto_tree *tpc_tree;
8526   proto_item *tpc_item;
8527
8528   /* 8.4.2.19 TPC Report element */
8529   tpc_item = proto_tree_add_item(tree, hf_ieee80211_ff_tpc, tvb, offset, 4, ENC_NA);
8530   tpc_tree = proto_item_add_subtree(tpc_item, ett_tpc);
8531   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_element_id, tvb, offset, 1, ENC_NA);
8532   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_length, tvb, offset + 1, 1, ENC_NA);
8533   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_tx_power, tvb, offset + 2, 1, ENC_NA);
8534   proto_tree_add_item(tpc_tree, hf_ieee80211_ff_tpc_link_margin, tvb, offset + 3, 1, ENC_NA);
8535   return 4;
8536 }
8537
8538 static guint
8539 add_ff_rm_rx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8540 {
8541   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
8542   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rx_antenna_id, tvb, offset, 1, ENC_NA);
8543   return 1;
8544 }
8545
8546 static guint
8547 add_ff_rm_tx_antenna_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8548 {
8549   /* 8.4.2.42: 0 means unknown, 1-254 is valid, 255 means multiple antennas */
8550   proto_tree_add_item(tree, hf_ieee80211_ff_rm_tx_antenna_id, tvb, offset, 1, ENC_NA);
8551   return 1;
8552 }
8553
8554 static guint
8555 add_ff_rm_rcpi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8556 {
8557   /* 8.4.2.40: RCPI as specified for certain PHYs */
8558   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rcpi, tvb, offset, 1, ENC_NA);
8559   return 1;
8560 }
8561
8562 static guint
8563 add_ff_rm_rsni(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8564 {
8565   /* 8.4.2.43: RSNI in steps of 0.5 dB, calculated as:
8566    * RSNI = (10 * log10((RCPI_{power} - ANPI_{power}) / ANPI_{power}) + 20)*2 */
8567   proto_tree_add_item(tree, hf_ieee80211_ff_rm_rsni, tvb, offset, 1, ENC_NA);
8568   return 1;
8569 }
8570
8571 static guint
8572 add_ff_beacon_interval_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8573 {
8574   proto_item *bic_item = proto_tree_add_item(tree, hf_ieee80211_ff_bic, tvb, offset, 6, ENC_LITTLE_ENDIAN);
8575   proto_tree *bic_tree = proto_item_add_subtree(bic_item, ett_bic_tree);
8576
8577   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_cc_present, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8578   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_discovery_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8579   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_next_beacon, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8580   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_ati_present, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8581   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_abft_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8582   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_fss, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
8583   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_is_resp, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
8584   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_next_abft, tvb, offset+1, 2, ENC_LITTLE_ENDIAN);
8585   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_frag_txss, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
8586   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_txss_span, tvb, offset+2, 2, ENC_LITTLE_ENDIAN);
8587   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_NBI_abft, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
8588   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_abft_count, tvb, offset+3, 2, ENC_LITTLE_ENDIAN);
8589   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_nabft, tvb, offset+4, 2, ENC_LITTLE_ENDIAN);
8590   proto_tree_add_item(bic_tree, hf_ieee80211_ff_bic_pcp, tvb, offset+5, 1, ENC_LITTLE_ENDIAN);
8591   return 6;
8592 }
8593
8594 static guint
8595 add_ff_beamforming_ctrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8596 {
8597   gboolean isGrant = *((gboolean*)(p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_CTRL_GRANT_OR_GRANT_ACK_KEY)));
8598   proto_item *bf_item = proto_tree_add_item(tree, hf_ieee80211_ff_bf, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8599   proto_tree *bf_tree = proto_item_add_subtree(bf_item, ett_bf_tree);
8600   guint16 bf_field = tvb_get_letohs(tvb, offset);
8601   gboolean isInit = (bf_field & 0x2) >> 1;
8602   gboolean isResp = (bf_field & 0x4) >> 2;
8603   proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_train, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8604   proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_is_init, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8605   proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_is_resp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8606   if((isInit==TRUE) && (isResp==TRUE) && isGrant) {
8607     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_num_sectors, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8608     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_num_rx_dmg_ants, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8609   } else {
8610     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_rxss_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8611     proto_tree_add_item(bf_tree, hf_ieee80211_ff_bf_rxss_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8612   }
8613   return 2;
8614 }
8615
8616 static guint
8617 add_ff_dynamic_allocation(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8618 {
8619   proto_item *dynamic_alloc_item = proto_tree_add_item(tree, hf_ieee80211_ff_dynamic_allocation, tvb, offset, 5, ENC_LITTLE_ENDIAN);
8620   proto_tree *dynamic_alloc_tree = proto_item_add_subtree(dynamic_alloc_item, ett_dynamic_alloc_tree);
8621   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_TID, tvb, offset, 1, ENC_NA);
8622   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_alloc_type, tvb, offset, 1, ENC_NA);
8623   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_src_aid, tvb, offset, 1, ENC_NA);
8624   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_dest_aid, tvb, offset, 1, ENC_NA);
8625   proto_tree_add_item(dynamic_alloc_tree, hf_ieee80211_ff_alloc_duration, tvb, offset, 1, ENC_NA);
8626   return 5;
8627 }
8628
8629 static guint
8630 add_ff_beamformed_link(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8631 {
8632   proto_item *blm_item = proto_tree_add_item(tree, hf_ieee80211_ff_blm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8633   proto_tree *blm_tree = proto_item_add_subtree(blm_item, ett_blm_tree);
8634   proto_tree_add_item(blm_tree, hf_ieee80211_ff_blm_unit_index, tvb, offset, 1, ENC_NA);
8635   proto_tree_add_item(blm_tree, hf_ieee80211_ff_blm_maint_value, tvb, offset, 1, ENC_NA);
8636   proto_tree_add_item(blm_tree, hf_ieee80211_ff_blm_is_master, tvb, offset, 1, ENC_NA);
8637   return 1;
8638 }
8639
8640 static guint
8641 add_ff_BRP_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8642 {
8643   proto_item *brp_req_item = proto_tree_add_item(tree, hf_ieee80211_ff_brp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8644   proto_tree *brp_req_tree = proto_item_add_subtree(brp_req_item, ett_brp_tree);
8645
8646   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_L_RX, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8647   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_TX_TRN_REQ, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8648   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_MID_REQ, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8649   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_BC_REQ, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8650   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_MID_GRANT, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8651   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_BC_GRANT, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8652   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_chan_FBCK_CAP, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8653   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_tx_sector, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8654   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_other_aid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8655   proto_tree_add_item(brp_req_tree, hf_ieee80211_ff_brp_tx_antenna, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8656   return 4;
8657 }
8658
8659 static guint
8660 add_ff_sector_sweep_feedback(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8661 {
8662   proto_item *sswf_item = proto_tree_add_item(tree, hf_ieee80211_ff_sswf, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8663   proto_tree *sswf_tree = proto_item_add_subtree(sswf_item, ett_sswf_tree);
8664
8665   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_total_sectors, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8666   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_num_rx_dmg_ants, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8667   proto_tree_add_item(sswf_tree, hf_ieee80211_ff_sswf_poll_required, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8668   return 3;
8669 }
8670
8671 static guint
8672 add_ff_sector_sweep(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8673 {
8674   proto_item *ssw_item = proto_tree_add_item(tree, hf_ieee80211_ff_ssw, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8675   proto_tree *ssw_tree = proto_item_add_subtree(ssw_item, ett_ssw_tree);
8676
8677   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_direction, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8678   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_cdown, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8679   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_sector_id, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8680   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_dmg_ant_id, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8681   proto_tree_add_item(ssw_tree, hf_ieee80211_ff_ssw_rxss_len, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8682   return 3;
8683 }
8684
8685 static guint
8686 add_ff_dmg_params(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8687 {
8688   proto_item *dmg_params_item = proto_tree_add_item(tree, hf_ieee80211_ff_dmg_params, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8689   proto_tree *dmg_params_tree = proto_item_add_subtree(dmg_params_item, ett_dmg_params_tree);
8690
8691   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_bss, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8692   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_cbap_only, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8693   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_cbap_src, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8694   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_privacy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8695   proto_tree_add_item(dmg_params_tree, hf_ieee80211_ff_dmg_params_policy, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8696   return 1;
8697 }
8698
8699 static guint
8700 add_ff_cc_field(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean dis)
8701 {
8702   proto_item *cc_item = proto_tree_add_item(tree, hf_ieee80211_ff_cc, tvb, offset, 8, ENC_LITTLE_ENDIAN);
8703   proto_tree *cc_tree = proto_item_add_subtree(cc_item, ett_cc_tree);
8704   guint64 cc_field;
8705   if(dis) {
8706     proto_tree_add_item(cc_tree, hf_ieee80211_ff_cc_abft_resp_addr, tvb, offset, 6, ENC_NA);
8707   } else {
8708     cc_field = tvb_get_letoh64(tvb, offset);
8709     /*TODO : Add support of bitmask for FT_(U)INT64 */
8710     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_sp_duration, tvb, offset, 1, (guint32)(cc_field & 0xff));
8711     proto_tree_add_uint64(cc_tree, hf_ieee80211_ff_cc_cluster_id, tvb, offset+1, 6, (guint64)((cc_field & G_GUINT64_CONSTANT(0x00ffffffffffff00)) >> 8));
8712     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_role, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x0300000000000000)) >> 56));
8713     proto_tree_add_uint(cc_tree, hf_ieee80211_ff_cc_max_mem, tvb, offset+7, 1, (guint32)((cc_field & G_GUINT64_CONSTANT(0x7c00000000000000)) >> 58));
8714   }
8715   return 8;
8716 }
8717
8718
8719 static guint
8720 add_ff_band_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8721 {
8722   proto_tree_add_item(tree, hf_ieee80211_ff_band_id, tvb, offset, 1, ENC_NA);
8723   return 1;
8724 }
8725
8726 static guint
8727 add_ff_subject_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8728 {
8729   proto_tree_add_item(tree, hf_ieee80211_ff_subject_address, tvb, offset, 6, ENC_NA);
8730   return 6;
8731 }
8732
8733 static guint
8734 add_ff_handover_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8735 {
8736   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reason, tvb, offset, 1, ENC_NA);
8737   return 1;
8738 }
8739
8740 static guint
8741 add_ff_handover_remaining_bi(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8742 {
8743   proto_tree_add_item(tree, hf_ieee80211_ff_handover_remaining_bi, tvb, offset, 1, ENC_NA);
8744   return 1;
8745 }
8746
8747 static guint
8748 add_ff_handover_result(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8749 {
8750   proto_tree_add_item(tree, hf_ieee80211_ff_handover_result, tvb, offset, 1, ENC_NA);
8751   return 1;
8752 }
8753
8754 static guint
8755 add_ff_handover_reject_reason(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8756 {
8757   proto_tree_add_item(tree, hf_ieee80211_ff_handover_reject_reason, tvb, offset, 1, ENC_NA);
8758   return 1;
8759 }
8760
8761 static guint
8762 add_ff_destination_reds_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8763 {
8764   proto_tree_add_item(tree, hf_ieee80211_ff_destination_reds_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8765   return 2;
8766 }
8767
8768 static guint
8769 add_ff_destination_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8770 {
8771   proto_tree_add_item(tree, hf_ieee80211_ff_destination_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8772   return 2;
8773 }
8774
8775 static guint
8776 add_ff_realy_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8777 {
8778   proto_tree_add_item(tree, hf_ieee80211_ff_realy_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8779   return 2;
8780 }
8781
8782 static guint
8783 add_ff_source_aid(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8784 {
8785   proto_tree_add_item(tree, hf_ieee80211_ff_source_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8786   return 2;
8787 }
8788
8789 static guint
8790 add_ff_timing_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8791 {
8792   proto_tree_add_item(tree, hf_ieee80211_ff_timing_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8793   return 2;
8794 }
8795
8796 static guint
8797 add_ff_sampling_frequency_offset(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8798 {
8799   proto_tree_add_item(tree, hf_ieee80211_ff_sampling_frequency_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8800   return 2;
8801 }
8802
8803 static guint
8804 add_ff_relay_operation_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8805 {
8806   proto_tree_add_item(tree, hf_ieee80211_ff_relay_operation_type, tvb, offset, 1, ENC_NA);
8807   return 1;
8808 }
8809
8810 static guint
8811 add_ff_fst_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8812 {
8813   proto_tree_add_item(tree, hf_ieee80211_ff_fst_action_code, tvb, offset, 1, ENC_NA);
8814   return 1;
8815 }
8816
8817 static guint
8818 add_ff_llt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8819 {
8820   proto_tree_add_item(tree, hf_ieee80211_ff_llt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8821   return 4;
8822 }
8823
8824 static guint
8825 add_ff_fsts_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8826 {
8827   proto_tree_add_item(tree, hf_ieee80211_ff_fsts_id, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8828   return 4;
8829 }
8830
8831 static guint
8832 add_ff_oct_mmpdu(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8833 {
8834   guint start = offset;
8835   guint len = tvb_get_letohs(tvb, offset);
8836   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8837   offset += 2;
8838   proto_tree_add_item(tree, hf_ieee80211_ff_mmpdu_ctrl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8839   offset += 2;
8840   proto_tree_add_item(tree, hf_ieee80211_ff_oct_mmpdu, tvb, offset, len, ENC_NA);
8841   offset += len;
8842   return offset - start;
8843 }
8844
8845 static void
8846 add_tag_relay_capabilities(packet_info *pinfo, proto_item *item, gint32 tag_len, proto_tree *tree, tvbuff_t *tvb, gint32 *offset) {
8847
8848   if (tag_len < 2) {
8849     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length, "Tag length must be 2");
8850     return;
8851   }
8852
8853   *offset += 2;
8854
8855   proto_tree_add_item(tree, hf_ieee80211_tag_relay_support, tvb, *offset, 1, ENC_NA);
8856   proto_tree_add_item(tree, hf_ieee80211_tag_relay_use, tvb, *offset, 1, ENC_NA);
8857   proto_tree_add_item(tree, hf_ieee80211_tag_relay_permission, tvb, *offset, 1, ENC_NA);
8858   proto_tree_add_item(tree, hf_ieee80211_tag_AC_power, tvb, *offset, 1, ENC_NA);
8859   proto_tree_add_item(tree, hf_ieee80211_tag_relay_prefer, tvb, *offset, 1, ENC_NA);
8860   proto_tree_add_item(tree, hf_ieee80211_tag_duplex, tvb, *offset, 1, ENC_NA);
8861   proto_tree_add_item(tree, hf_ieee80211_tag_cooperation, tvb, *offset, 1, ENC_NA);
8862   *offset += 2;
8863   return;
8864 }
8865
8866 static guint
8867 add_ff_relay_capable_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
8868 {
8869   proto_item *rcsi_item = proto_tree_add_item(tree, hf_ieee80211_ff_rcsi, tvb, offset, 3, ENC_LITTLE_ENDIAN);
8870   proto_tree *rcsi_tree = proto_item_add_subtree(rcsi_item, ett_rcsi_tree);
8871   proto_tree_add_item(rcsi_tree, hf_ieee80211_ff_rcsi_aid, tvb, offset, 1, ENC_NA);
8872   offset += 1;
8873   add_tag_relay_capabilities(pinfo, rcsi_item, 2, rcsi_tree, tvb, &offset);
8874   return 3;
8875 }
8876
8877
8878 static void
8879 dissect_ieee80211_extension(guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
8880 {
8881   proto_item *ti;
8882   proto_tree *ext_tree;
8883   proto_tree *fixed_tree;
8884   proto_tree *tagged_tree;
8885
8886   int offset = 0;
8887   int tagged_parameter_tree_len;
8888
8889   ti = proto_tree_add_item (tree, proto_wlan_ext, tvb, offset, -1, ENC_NA);
8890   ext_tree = proto_item_add_subtree (ti, ett_80211_ext);
8891
8892   switch (COMPOSE_FRAME_TYPE(fcf))
8893   {
8894     case EXTENSION_DMG_BEACON:
8895     {
8896       gboolean cc, dis;
8897       guint16 bic_field;
8898       fixed_tree = get_fixed_parameter_tree (ext_tree, tvb, offset, 20);
8899       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TIMESTAMP);
8900       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_SECTOR_SWEEP);
8901       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_BEACON_INTERVAL);
8902       bic_field = tvb_get_letohs(tvb, offset);
8903       cc = (bic_field & 0x1);
8904       dis  = (bic_field & 0x2) >> 1;
8905       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_BEACON_INTERVAL_CTRL);
8906       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_DMG_PARAMETERS);
8907       if(cc) {
8908         offset += add_ff_cc_field(fixed_tree,tvb, offset, dis);
8909       }
8910       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
8911
8912       /*
8913        * The tagged params are optional here. See Table 8.33a of the 2012
8914        * version of the standard.
8915        */
8916       if (tagged_parameter_tree_len) {
8917         tagged_tree = get_tagged_parameter_tree (ext_tree, tvb, offset, tagged_parameter_tree_len);
8918         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, EXTENSION_DMG_BEACON);
8919       }
8920       break;
8921     }
8922   }
8923 }
8924
8925 static guint
8926 add_ff_action_unprotected_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
8927 {
8928   guint8 code;
8929   guint  start = offset;
8930
8931   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
8932   code    = tvb_get_guint8(tvb, offset);
8933   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_UNPROTECTED_DMG_ACTION_CODE);
8934   switch (code) {
8935     case UNPROTECTED_DMG_ANNOUNCE:
8936       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TIMESTAMP);
8937       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BEACON_INTERVAL);
8938       break;
8939     case UNPROTECTED_DMG_BRP:
8940       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
8941       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BRP_REQ);
8942       break;
8943   }
8944   return offset - start;
8945 }
8946
8947 /* There is no easy way to skip all these subcarrier indices that must not
8948  * be displayed when showing compressed beamforming feedback matrices
8949  * Table 8-53g IEEE Std 802.11ac-2013 amendment.
8950  *
8951  * The irregular use of case statements in this function is to improve
8952  * readability in what is otherwise a large funtion that does very little.
8953  */
8954 static inline int vht_compressed_skip_scidx(guint8 nchan_width, guint8 ng, int scidx)
8955 {
8956   switch(nchan_width) {
8957     /* 20 MHz */
8958     case 0:
8959       /* No Grouping */
8960       if (ng == 0)
8961         switch (scidx) {
8962           /* Pilot subcarriers */
8963           case -21: case -7: case 7: case 21:
8964           /* DC subcarrier */
8965           case 0:
8966             scidx++;
8967           default:
8968             break;
8969         }
8970       break;
8971     /* 40 MHz */
8972     case 1:
8973       /* No Grouping */
8974       if (ng == 0)
8975         switch (scidx) {
8976           /* Pilot subcarriers */
8977           case -53: case -25: case -11: case 11: case 25: case 53:
8978             scidx++;
8979             break;
8980           /* DC subcarriers */
8981           case -1: case 0: case 1:
8982             scidx = 2;
8983           default:
8984             break;
8985         }
8986       break;
8987     /* 80 MHz */
8988     case 2:
8989       /* No Grouping */
8990       if (ng == 0)
8991         switch (scidx) {
8992           /* Pilot subcarriers */
8993           case -103: case -75: case -39: case -11: case 11: case 39: case 75: case 103:
8994             scidx++;
8995             break;
8996           /* DC subcarriers, skip -1,0, 1 */
8997           case -1:
8998             scidx = 2;
8999           default:
9000             break;
9001         }
9002       break;
9003     /* 160 MHz / 80+80 Mhz
9004      * Skip values here assume 160 MHz, as vht_mimo_control does not let us differentiate
9005      * between 160 MHz & 80-80MHz */
9006     case 3:
9007       switch (ng) {
9008         /* No Grouping */
9009         case 0:
9010           /* DC subcarriers, skip -5 to 5*/
9011           if (scidx == -5) {
9012             scidx = 6;
9013             break;
9014           }
9015           switch (scidx) {
9016             /* Pilot subcarriers */
9017             case -231: case -203: case -167: case -139: case -117: case -89: case -53: case -25:
9018             case 25: case 53: case 89: case 117: case 139: case 167: case 203: case 231:
9019               scidx++;
9020               break;
9021             /* Other subcarriers, skip -129 to -127, 127 to 129 */
9022             case -129:
9023               scidx = -126;
9024               break;
9025             case 127:
9026               scidx = 130;
9027               break;
9028             default:
9029               break;
9030           }
9031           break;
9032         /* Grouping of 2 */
9033         case 1:
9034           switch (scidx) {
9035             /* DC subcarriers */
9036             case -128: case -4: case -2: case 0: case 2: case 4: case 128:
9037               scidx++;
9038             default:
9039               break;
9040           }
9041           break;
9042         /* Grouping of 4 */
9043         case 2:
9044           if (scidx == -2 || scidx == 2)
9045             scidx++;
9046           break;
9047       }
9048       break;
9049     default:
9050       break;
9051   }
9052
9053   return scidx;
9054 }
9055
9056 static guint
9057 add_ff_vht_compressed_beamforming_report(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
9058 {
9059   guint32 vht_mimo;
9060   guint8 nc;
9061   guint8 nr;
9062   guint8 chan_width;
9063   guint8 grouping;
9064   gboolean codebook_info;
9065   gboolean feedback_type;
9066   proto_item *vht_beam_item;
9067   proto_tree *vht_beam_tree, *subtree;
9068   int i, matrix_size, len, pos, ns, scidx = 0;
9069   guint8 phi, psi, carry;
9070   /* Table 8-53d Order of angles in the Compressed Beamforming Feedback
9071    * Matrix subfield, IEEE Std 802.11ac-2013 amendment */
9072   static const guint8 na_arr[8][8] = { {  0,  0,  0,  0,  0,  0,  0,  0 },
9073                                        {  2,  2,  0,  0,  0,  0,  0,  0 },
9074                                        {  4,  6,  6,  0,  0,  0,  0,  0 },
9075                                        {  6, 10, 12, 12,  0,  0,  0,  0 },
9076                                        {  8, 14, 18, 20, 20,  0,  0,  0 },
9077                                        { 10, 18, 24, 28, 30, 30,  0,  0 },
9078                                        { 12, 22, 30, 36, 40, 42, 42,  0 },
9079                                        { 14, 26, 36, 44, 50, 54, 56, 56 }
9080                                      };
9081   /* Table 8-53g Subcarriers for which a Compressed Beamforming Feedback Matrix
9082    * subfield is sent back. IEEE Std 802.11ac-2013 amendment */
9083   static const int ns_arr[4][3] = { {  52,  30,  16 },
9084                                     { 108,  58,  30 },
9085                                     { 234, 122,  62 },
9086                                     { 468, 244, 124 }
9087                                   };
9088
9089   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_vht_mimo_cntrl,
9090                         ett_ff_vhtmimo_cntrl, hf_ieee80211_ff_vht_mimo_cntrl_fields, ENC_LITTLE_ENDIAN);
9091   offset += 3;
9092
9093   /* Extract values for beamforming use */
9094   vht_mimo = tvb_get_letoh24(tvb, offset);
9095   nc = (vht_mimo & 0x7) + 1;
9096   nr = ((vht_mimo & 0x38) >> 3) + 1;
9097   chan_width = (vht_mimo & 0xC0) >> 6;
9098   grouping = ((vht_mimo & 0x300) >> 8);
9099   codebook_info = (vht_mimo & 0x400) >> 10;
9100   feedback_type = (vht_mimo & 0x800) >> 11;
9101
9102   vht_beam_item = proto_tree_add_item(tree, hf_ieee80211_vht_compressed_beamforming_report, tvb,
9103                                   offset, -1, ENC_NA);
9104   vht_beam_tree = proto_item_add_subtree(vht_beam_item, ett_ff_vhtmimo_beamforming_report);
9105
9106   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, nc,
9107                         ett_ff_vhtmimo_beamforming_report_snr, NULL, "Average Signal to Noise Ratio");
9108
9109   for (i = 1; i <= nc; i++)
9110   {
9111     guint8 snr;
9112
9113     snr = tvb_get_guint8(tvb, offset);
9114     proto_tree_add_uint_format(subtree, hf_ieee80211_vht_compressed_beamforming_report_snr, tvb, offset, 1,
9115                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
9116     offset += 1;
9117   }
9118
9119   subtree = proto_tree_add_subtree(vht_beam_tree, tvb, offset, -1,
9120                         ett_ff_vhtmimo_beamforming_report_feedback_matrices, NULL, "Beamforming Feedback Matrics");
9121   if (feedback_type) {
9122     if (codebook_info) {
9123       psi = 7; phi = 9;
9124     } else {
9125       psi = 5; phi = 7;
9126     }
9127   } else {
9128     if (codebook_info) {
9129       psi = 4; phi = 6;
9130     } else {
9131       psi = 2; phi = 4;
9132     }
9133   }
9134
9135   ns = ns_arr[chan_width][grouping];
9136   switch(chan_width) {
9137     case 0:
9138       scidx = -28;
9139       break;
9140     case 1:
9141       scidx = -58;
9142       break;
9143     case 2:
9144       scidx = -122;
9145       break;
9146     case 3:
9147       /* This is -122 for 80+80MHz Channel Width but vht_mimo_control does not allow us
9148        * to differentiate between 160MHz and 80+80Mhz */
9149       scidx = -250;
9150       break;
9151   }
9152
9153   matrix_size = na_arr[nr - 1][nc -1] * (psi + phi)/2;
9154   pos = 0;
9155   for (i = 0; i < ns; i++) {
9156     if (pos % 8)
9157       carry = 1;
9158     else
9159       carry = 0;
9160     len = roundup2((pos + matrix_size), 8)/8 - roundup2(pos, 8)/8;
9161     scidx = vht_compressed_skip_scidx(chan_width, grouping, scidx);
9162
9163     /* TODO : For certain values from na_arr, there is always going be a carry over or overflow from the previous or
9164        into the next octet. The largest of possible unaligned values can be 41 bytes long, and masking and shifting
9165        whole buffers to show correct values with padding and overflow bits is hence skipped, we only mark the bytes
9166        of interest instead */
9167     proto_tree_add_none_format(subtree, hf_ieee80211_vht_compressed_beamforming_feedback_matrix, tvb,
9168                                     offset - carry, len + carry, "Compressed Beamforming Feedback Matrix for subcarrier %d", scidx++);
9169     offset += len;
9170     pos += matrix_size;
9171   }
9172
9173   return offset;
9174 }
9175
9176 static guint
9177 add_ff_action_vht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9178 {
9179   guint start = offset;
9180   guint8 vht_action;
9181   proto_item *ti;
9182   proto_tree *ti_tree;
9183
9184   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
9185
9186   vht_action = tvb_get_guint8(tvb, offset);
9187   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_VHT_ACTION);
9188
9189   switch(vht_action){
9190     case VHT_ACT_VHT_COMPRESSED_BEAMFORMING:{
9191       offset = add_ff_vht_compressed_beamforming_report(tree, tvb, pinfo, offset);
9192       offset += tvb_reported_length_remaining(tvb, offset);
9193     }
9194     break;
9195     case VHT_ACT_GROUP_ID_MANAGEMENT:{
9196       ti = proto_tree_add_item(tree, hf_ieee80211_vht_group_id_management, tvb,
9197                           offset, -1, ENC_NA);
9198       ti_tree = proto_item_add_subtree(ti, ett_vht_grpidmgmt);
9199
9200       proto_tree_add_item(ti_tree, hf_ieee80211_vht_membership_status_array, tvb,
9201                                 offset, 8, ENC_NA);
9202       offset += 8;
9203       proto_tree_add_item(ti_tree, hf_ieee80211_vht_user_position_array, tvb,
9204                                 offset, 16, ENC_NA);
9205       /*expert_add_info(pinfo, ti, &ei_ieee80211_vht_action); */
9206       offset += tvb_reported_length_remaining(tvb, offset);
9207     }
9208     break;
9209     case VHT_ACT_OPERATION_MODE_NOTIFICATION:{
9210       ti = proto_tree_add_item(tree, hf_ieee80211_vht_operation_mode_notification, tvb,
9211                           offset, -1, ENC_NA);
9212       expert_add_info(pinfo, ti, &ei_ieee80211_vht_action);
9213       offset += tvb_reported_length_remaining(tvb, offset);
9214     }
9215     break;
9216     default:
9217     break;
9218   }
9219
9220
9221   return offset - start;
9222 }
9223
9224 static guint
9225 add_ff_action_fst(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9226 {
9227   guint8 code;
9228   guint  start = offset;
9229
9230   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
9231   code    = tvb_get_guint8(tvb, offset);
9232   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_FST_ACTION_CODE);
9233   switch (code) {
9234     case FST_SETUP_REQUEST:
9235       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9236       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_LLT);
9237       break;
9238     case FST_SETUP_RESPONSE:
9239       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9240       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
9241       break;
9242     case FST_TEAR_DOWN:
9243       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_FSTS_ID);
9244       break;
9245     case FST_ACK_REQUEST:
9246       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9247       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_FSTS_ID);
9248       break;
9249     case FST_ACK_RESPONSE:
9250       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9251       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_FSTS_ID);
9252       break;
9253     case FST_ON_CHANNEL_TUNNEL_REQUEST:
9254       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_OCT_MMPDU);
9255       break;
9256   }
9257   return offset - start;
9258 }
9259
9260 static guint
9261 add_ff_action_dmg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9262 {
9263   guint8 code;
9264   guint  start = offset;
9265   int left_offset;
9266
9267   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
9268   code    = tvb_get_guint8(tvb, offset);
9269   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DMG_ACTION_CODE);
9270   switch (code) {
9271     case DMG_ACTION_PWR_SAVE_CONFIG_REQ:
9272       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9273       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DMG_PWR_MGMT);
9274       break;
9275     case DMG_ACTION_PWR_SAVE_CONFIG_RES:
9276       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9277       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
9278       break;
9279     case DMG_ACTION_INFO_REQ:
9280       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SUBJECT_ADDRESS);
9281       break;
9282     case DMG_ACTION_INFO_RES:
9283       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SUBJECT_ADDRESS);
9284       break;
9285     case DMG_ACTION_HANDOVER_REQ:
9286       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_HANDOVER_REASON);
9287       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_HANDOVER_REMAINING_BI);
9288       break;
9289     case DMG_ACTION_HANDOVER_RES:
9290       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_HANDOVER_RESULT);
9291       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_HANDOVER_REJECT_REASON);
9292       break;
9293     case DMG_ACTION_DTP_REQ:
9294       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9295       break;
9296     case DMG_ACTION_DTP_RES:
9297       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9298       break;
9299     case DMG_ACTION_RELAY_SEARCH_REQ:
9300       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9301       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DESTINATION_REDS_AID);
9302       break;
9303     case DMG_ACTION_RELAY_SEARCH_RES:
9304       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9305       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
9306       break;
9307     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_REQ:
9308       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9309       break;
9310     case DMG_ACTION_MUL_RELAY_CHANNEL_MEASURE_RES:
9311       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9312       left_offset =
9313           tvb_reported_length_remaining(tvb, offset);
9314       while(left_offset > 0) {
9315         proto_tree_add_item(tree, hf_ieee80211_ff_peer_sta_aid, tvb, offset, 1, ENC_NA);
9316         proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset+1, 1, ENC_NA);
9317         proto_tree_add_item(tree, hf_ieee80211_ff_internal_angle, tvb, offset+2, 1, ENC_NA);
9318         proto_tree_add_item(tree, hf_ieee80211_ff_recommend, tvb, offset+2, 1, ENC_NA);
9319         /* another reserved byte */
9320         offset += 4;
9321         left_offset -= 4;
9322       }
9323       break;
9324     case DMG_ACTION_RLS_REQ:
9325       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9326       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DESTINATION_AID);
9327       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REALY_AID);
9328       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SOURCE_AID);
9329       break;
9330     case DMG_ACTION_RLS_RES:
9331       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9332       break;
9333     case DMG_ACTION_RLS_ANNOUNCE:
9334       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9335       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
9336       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DESTINATION_AID);
9337       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REALY_AID);
9338       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SOURCE_AID);
9339       break;
9340     case DMG_ACTION_RLS_TEARDOWN:
9341       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DESTINATION_AID);
9342       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REALY_AID);
9343       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SOURCE_AID);
9344       break;
9345     case DMG_ACTION_RELAY_ACK_REQ:
9346     case DMG_ACTION_RELAY_ACK_RES:
9347       break;
9348     case DMG_ACTION_TPA_REQ:
9349       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9350       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TIMING_OFFSET);
9351       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SAMPLING_FREQUENCY_OFFSET);
9352       break;
9353     case DMG_ACTION_TPA_RES:
9354       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9355       break;
9356     case DMG_ACTION_TPA_REP:
9357       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
9358       break;
9359     case DMG_ACTION_ROC_REQ:
9360       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9361       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_RELAY_OPERATION_TYPE);
9362       break;
9363     case DMG_ACTION_ROC_RES:
9364       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
9365       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
9366       break;
9367   }
9368   return offset - start;
9369 }
9370
9371 static guint
9372 add_ff_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
9373 {
9374   switch (tvb_get_guint8(tvb, offset) & 0x7f) {
9375   case CAT_SPECTRUM_MGMT: /* 0 */
9376     return add_ff_action_spectrum_mgmt(tree, tvb, pinfo, offset);
9377   case CAT_QOS: /* 1 */
9378     return add_ff_action_qos(tree, tvb, pinfo, offset);
9379   case CAT_DLS: /* 2 */
9380     return add_ff_action_dls(tree, tvb, pinfo, offset);
9381   case CAT_BLOCK_ACK: /* 3 */
9382     return add_ff_action_block_ack(tree, tvb, pinfo, offset);
9383   case CAT_PUBLIC: /* 4 */
9384     return add_ff_action_public(tree, tvb, pinfo, offset);
9385   case CAT_RADIO_MEASUREMENT: /* 5 */
9386     return add_ff_action_radio_measurement(tree, tvb, pinfo, offset);
9387   case CAT_FAST_BSS_TRANSITION: /* 6 */
9388     return add_ff_action_fast_bss_transition(tree, tvb, pinfo, offset);
9389   case CAT_HT: /* 7 */
9390     return add_ff_action_ht(tree, tvb, pinfo, offset);
9391   case CAT_SA_QUERY: /* 8 */
9392     return add_ff_action_sa_query(tree, tvb, pinfo, offset);
9393   case CAT_PUBLIC_PROTECTED: /* 9 */
9394     return add_ff_action_protected_public(tree, tvb, pinfo, offset);
9395   case CAT_WNM: /* 10 */
9396     return add_ff_action_wnm(tree, tvb, pinfo, offset);
9397   case CAT_UNPROTECTED_WNM: /* 11 */
9398     return add_ff_action_unprotected_wnm(tree, tvb, pinfo, offset);
9399   case CAT_TDLS: /* 12 */
9400     return add_ff_action_tdls(tree, tvb, pinfo, offset);
9401   case CAT_MESH: /* 13 */
9402     return add_ff_action_mesh(tree, tvb, pinfo, offset);
9403   case CAT_MULTIHOP: /* 14 */
9404     return add_ff_action_multihop(tree, tvb, pinfo, offset);
9405   case CAT_SELF_PROTECTED: /* 15 */
9406     return add_ff_action_self_protected(tree, tvb, pinfo, offset);
9407   case CAT_DMG: /* 16 */
9408     return add_ff_action_dmg(tree, tvb, pinfo, offset);
9409   case CAT_MGMT_NOTIFICATION:  /* Management notification frame - 17 */
9410     return add_ff_action_mgmt_notification(tree, tvb, pinfo, offset);
9411   case CAT_FAST_SESSION_TRANSFER: /* 18 */
9412     return add_ff_action_fst(tree, tvb, pinfo, offset);
9413 /* case CAT_ROBUST_AV_STREAMING:  19 */
9414 /*   return add_ff_action_robust_av_streaming(tree, tvb, pinfo, offset); */
9415   case CAT_UNPROTECTED_DMG: /* 20 */
9416     return add_ff_action_unprotected_dmg(tree, tvb, pinfo, offset);
9417   case CAT_VHT: /* 21 */
9418     return add_ff_action_vht(tree, tvb, pinfo, offset);
9419 /*  case CAT_VENDOR_SPECIFIC_PROTECTED:   Vendor Specific Protected Category - 126 */
9420 /*    return add_ff_action_vendor_specific_protected(tree, tvb, pinfo, offset);*/
9421   case CAT_VENDOR_SPECIFIC:  /* Vendor Specific Protected Category - 127 */
9422     return add_ff_action_vendor_specific(tree, tvb, pinfo, offset);
9423   default:
9424     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
9425     return 1;
9426   }
9427 }
9428
9429 #define FF_FIELD(f, func) { FIELD_ ## f, add_ff_ ## func }
9430
9431 static const struct ieee80211_fixed_field_dissector ff_dissectors[] = {
9432   FF_FIELD(TIMESTAMP                             , timestamp),
9433   FF_FIELD(BEACON_INTERVAL                       , beacon_interval),
9434   FF_FIELD(CAP_INFO                              , cap_info),
9435   FF_FIELD(AUTH_ALG                              , auth_alg),
9436   FF_FIELD(AUTH_TRANS_SEQ                        , auth_trans_seq),
9437   FF_FIELD(CURRENT_AP_ADDR                       , current_ap_addr),
9438   FF_FIELD(LISTEN_IVAL                           , listen_ival),
9439   FF_FIELD(REASON_CODE                           , reason_code),
9440   FF_FIELD(ASSOC_ID                              , assoc_id),
9441   FF_FIELD(STATUS_CODE                           , status_code),
9442   FF_FIELD(CATEGORY_CODE                         , category_code),
9443   FF_FIELD(ACTION_CODE                           , action_code),
9444   FF_FIELD(DIALOG_TOKEN                          , dialog_token),
9445   FF_FIELD(FOLLOWUP_DIALOG_TOKEN                 , followup_dialog_token),
9446   FF_FIELD(WME_ACTION_CODE                       , wme_action_code),
9447   FF_FIELD(WME_STATUS_CODE                       , wme_status_code),
9448   FF_FIELD(QOS_ACTION_CODE                       , qos_action_code),
9449   FF_FIELD(BLOCK_ACK_ACTION_CODE                 , block_ack_action_code),
9450   FF_FIELD(BLOCK_ACK_PARAM                       , block_ack_param),
9451   FF_FIELD(BLOCK_ACK_TIMEOUT                     , block_ack_timeout),
9452   FF_FIELD(BLOCK_ACK_SSC                         , block_ack_ssc),
9453   FF_FIELD(QOS_TS_INFO                           , qos_ts_info),
9454   FF_FIELD(MESH_ACTION                           , mesh_action),
9455   FF_FIELD(MULTIHOP_ACTION                       , multihop_action),
9456   FF_FIELD(MESH_CONTROL                          , mesh_control),
9457   FF_FIELD(SELFPROT_ACTION                       , selfprot_action),
9458   FF_FIELD(DLS_ACTION_CODE                       , dls_action_code),
9459   FF_FIELD(DST_MAC_ADDR                          , dst_mac_addr),
9460   FF_FIELD(SRC_MAC_ADDR                          , src_mac_addr),
9461   FF_FIELD(DLS_TIMEOUT                           , dls_timeout),
9462   FF_FIELD(DELBA_PARAM_SET                       , delba_param_set),
9463   FF_FIELD(MAX_REG_PWR                           , max_reg_pwr),
9464   FF_FIELD(MEASUREMENT_PILOT_INT                 , measurement_pilot_int),
9465   FF_FIELD(COUNTRY_STR                           , country_str),
9466   FF_FIELD(MAX_TX_PWR                            , max_tx_pwr),
9467   FF_FIELD(TX_PWR_USED                           , tx_pwr_used),
9468   FF_FIELD(TRANSCEIVER_NOISE_FLOOR               , transceiver_noise_floor),
9469   FF_FIELD(CHANNEL_WIDTH                         , channel_width),
9470   FF_FIELD(QOS_INFO_AP                           , qos_info_ap),
9471   FF_FIELD(QOS_INFO_STA                          , qos_info_sta),
9472   FF_FIELD(SM_PWR_CNTRL                          , sm_pwr_cntrl),
9473   FF_FIELD(PCO_PHASE_CNTRL                       , pco_phase_cntrl),
9474   FF_FIELD(PSMP_PARAM_SET                        , psmp_param_set),
9475   FF_FIELD(MIMO_CNTRL                            , mimo_cntrl),
9476   FF_FIELD(ANT_SELECTION                         , ant_selection),
9477   FF_FIELD(EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT  , extended_channel_switch_announcement) ,
9478   FF_FIELD(HT_INFORMATION                        , ht_information),
9479   FF_FIELD(HT_ACTION_CODE                        , ht_action_code),
9480   FF_FIELD(PSMP_STA_INFO                         , psmp_sta_info),
9481   FF_FIELD(SCHEDULE_INFO                         , schedule_info),
9482   FF_FIELD(PA_ACTION_CODE                        , pa_action_code),
9483   FF_FIELD(PPA_ACTION_CODE                       , ppa_action_code),
9484   FF_FIELD(ACTION                                , action),
9485   FF_FIELD(FT_ACTION_CODE                        , ft_action_code),
9486   FF_FIELD(STA_ADDRESS                           , sta_address),
9487   FF_FIELD(TARGET_AP_ADDRESS                     , target_ap_address),
9488   FF_FIELD(GAS_COMEBACK_DELAY                    , gas_comeback_delay),
9489   FF_FIELD(GAS_FRAGMENT_ID                       , gas_fragment_id),
9490   FF_FIELD(SA_QUERY_ACTION_CODE                  , sa_query_action_code),
9491   FF_FIELD(TRANSACTION_ID                        , transaction_id),
9492   FF_FIELD(TDLS_ACTION_CODE                      , tdls_action_code),
9493   FF_FIELD(TARGET_CHANNEL                        , target_channel),
9494   FF_FIELD(OPERATING_CLASS                       , operating_class),
9495   FF_FIELD(WNM_ACTION_CODE                       , wnm_action_code),
9496   FF_FIELD(UNPROTECTED_WNM_ACTION_CODE           , unprotected_wnm_action_code),
9497   FF_FIELD(KEY_DATA_LENGTH                       , key_data_length),
9498   FF_FIELD(WNM_NOTIFICATION_TYPE                 , wnm_notification_type),
9499   FF_FIELD(RM_ACTION_CODE                        , rm_action_code),
9500   FF_FIELD(RM_DIALOG_TOKEN                       , rm_dialog_token),
9501   FF_FIELD(RM_REPETITIONS                        , rm_repetitions),
9502   FF_FIELD(RM_TX_POWER                           , rm_tx_power),
9503   FF_FIELD(RM_MAX_TX_POWER                       , rm_max_tx_power),
9504   FF_FIELD(RM_TPC_REPORT                         , rm_tpc_report),
9505   FF_FIELD(RM_RX_ANTENNA_ID                      , rm_rx_antenna_id),
9506   FF_FIELD(RM_TX_ANTENNA_ID                      , rm_tx_antenna_id),
9507   FF_FIELD(RM_RCPI                               , rm_rcpi),
9508   FF_FIELD(RM_RSNI                               , rm_rsni),
9509   FF_FIELD(RELAY_CAPABLE_STA_INFO                , relay_capable_sta_info),
9510   FF_FIELD(BAND_ID                               , band_id),
9511   FF_FIELD(DMG_PARAMETERS                        , dmg_params),
9512   FF_FIELD(SECTOR_SWEEP                          , sector_sweep),
9513   FF_FIELD(DYNAMIC_ALLOCATION                    , dynamic_allocation),
9514   FF_FIELD(SECTOR_SWEEP_FB                       , sector_sweep_feedback),
9515   FF_FIELD(BRP_REQ                               , BRP_request),
9516   FF_FIELD(BEAMFORMED_LINK_MAINTAINCE            , beamformed_link),
9517   FF_FIELD(BEAMFORMING_CTRL                      , beamforming_ctrl),
9518   FF_FIELD(BEACON_INTERVAL_CTRL                  , beacon_interval_ctrl),
9519   FF_FIELD(DMG_ACTION_CODE                       , dmg_action_code),
9520   FF_FIELD(DMG_PWR_MGMT                          , dmg_pwr_mgmt),
9521   FF_FIELD(REQ_AP_ADDR                           , req_ap_addr),
9522   FF_FIELD(RES_AP_ADDR                           , res_ap_addr),
9523   FF_FIELD(CHECK_BEACON                          , check_beacon),
9524   FF_FIELD(TOD                                   , tod),
9525   FF_FIELD(TOA                                   , toa),
9526   FF_FIELD(MAX_TOD_ERR                           , max_tod_err),
9527   FF_FIELD(MAX_TOA_ERR                           , max_toa_err),
9528   FF_FIELD(SUBJECT_ADDRESS                       , subject_address),
9529   FF_FIELD(HANDOVER_REASON                       , handover_reason),
9530   FF_FIELD(HANDOVER_REMAINING_BI                 , handover_remaining_bi),
9531   FF_FIELD(HANDOVER_RESULT                       , handover_result),
9532   FF_FIELD(HANDOVER_REJECT_REASON                , handover_reject_reason),
9533   FF_FIELD(DESTINATION_REDS_AID                  , destination_reds_aid),
9534   FF_FIELD(DESTINATION_AID                       , destination_aid),
9535   FF_FIELD(REALY_AID                             , realy_aid),
9536   FF_FIELD(SOURCE_AID                            , source_aid),
9537   FF_FIELD(TIMING_OFFSET                         , timing_offset),
9538   FF_FIELD(SAMPLING_FREQUENCY_OFFSET             , sampling_frequency_offset),
9539   FF_FIELD(RELAY_OPERATION_TYPE                  , relay_operation_type),
9540   FF_FIELD(UNPROTECTED_DMG_ACTION_CODE           , unprotected_dmg_action_code),
9541   FF_FIELD(FST_ACTION_CODE                       , fst_action_code),
9542   FF_FIELD(LLT                                   , llt),
9543   FF_FIELD(FSTS_ID                               , fsts_id),
9544   FF_FIELD(OCT_MMPDU                             , oct_mmpdu),
9545   FF_FIELD(VHT_ACTION                            , vht_action),
9546   { (enum fixed_field)-1                         , NULL }
9547 };
9548
9549 #undef FF_FIELD
9550
9551 static guint
9552 add_fixed_field(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
9553                 enum fixed_field lfcode)
9554 {
9555   int i;
9556   for (i = 0; ff_dissectors[i].dissector; i++) {
9557     if (ff_dissectors[i].lfcode == lfcode) {
9558       return ff_dissectors[i].dissector(tree, tvb, pinfo, offset);
9559     }
9560   }
9561   return 0;
9562 }
9563
9564 static const value_string ieee80211_rsn_cipher_vals[] = {
9565   {0, "NONE"},
9566   {1, "WEP (40-bit)"},
9567   {2, "TKIP"},
9568   {3, "AES (OCB)"},
9569   {4, "AES (CCM)"},
9570   {5, "WEP (104-bit)"},
9571   {6, "BIP"},
9572   {7, "Group addressed traffic not allowed"},
9573   {8, "GCMP"},
9574   {0, NULL}
9575 };
9576
9577 static const value_string ieee80211_rsn_keymgmt_vals[] = {
9578   {0, "NONE"},
9579   {1, "WPA"},
9580   {2, "PSK"},
9581   {3, "FT over IEEE 802.1X"},
9582   {4, "FT using PSK"},
9583   {5, "WPA (SHA256)"},
9584   {6, "PSK (SHA256)"},
9585   {7, "TDLS / TPK Handshake"},
9586   {0, NULL}
9587 };
9588
9589 static void
9590 oui_base_custom(gchar *result, guint32 oui)
9591 {
9592   guint8       p_oui[3];
9593   const gchar *manuf_name;
9594
9595   p_oui[0] = oui >> 16 & 0xFF;
9596   p_oui[1] = oui >> 8 & 0xFF;
9597   p_oui[2] = oui & 0xFF;
9598
9599   /* Attempt an OUI lookup. */
9600   manuf_name = get_manuf_name_if_known(p_oui);
9601   if (manuf_name == NULL) {
9602     /* Could not find an OUI. */
9603     g_snprintf(result, ITEM_LABEL_LENGTH, "%.2x-%.2x-%.2x", p_oui[0], p_oui[1], p_oui[2]);
9604   }
9605   else {
9606    /* Found an address string. */
9607     g_snprintf(result, ITEM_LABEL_LENGTH, "%.2x-%.2x-%.2x (%s)", p_oui[0], p_oui[1], p_oui[2], manuf_name);
9608   }
9609 }
9610
9611 static void
9612 rsn_gcs_base_custom(gchar *result, guint32 gcs)
9613 {
9614   gchar oui_result[SHORT_STR];
9615   gchar *tmp_str;
9616
9617   oui_result[0] = '\0';
9618   oui_base_custom(oui_result, gcs >> 8);
9619   tmp_str = val_to_str_wmem(NULL, gcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
9620   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9621   wmem_free(NULL, tmp_str);
9622 }
9623
9624 static void
9625 rsn_pcs_base_custom(gchar *result, guint32 pcs)
9626 {
9627   gchar oui_result[SHORT_STR];
9628   gchar *tmp_str;
9629
9630   oui_result[0] = '\0';
9631   oui_base_custom(oui_result, pcs >> 8);
9632   tmp_str = val_to_str_wmem(NULL, pcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
9633   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9634   wmem_free(NULL, tmp_str);
9635
9636 }
9637 static void
9638 rsn_akms_base_custom(gchar *result, guint32 akms)
9639 {
9640   gchar oui_result[SHORT_STR];
9641   gchar *tmp_str;
9642
9643   oui_result[0] = '\0';
9644   oui_base_custom(oui_result, akms >> 8);
9645   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_rsn_keymgmt_vals, "Unknown %d");
9646   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9647   wmem_free(NULL, tmp_str);
9648 }
9649
9650 static gchar *
9651 rsn_pcs_return(guint32 pcs)
9652 {
9653   gchar *result;
9654
9655   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
9656   result[0] = '\0';
9657   rsn_pcs_base_custom(result, pcs);
9658
9659   return result;
9660 }
9661
9662 static gchar *
9663 rsn_akms_return(guint32 akms)
9664 {
9665   gchar *result;
9666
9667   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
9668   result[0] = '\0';
9669   rsn_akms_base_custom(result, akms);
9670
9671   return result;
9672 }
9673
9674 static void
9675 rsn_gmcs_base_custom(gchar *result, guint32 gmcs)
9676 {
9677   gchar oui_result[SHORT_STR];
9678   gchar *tmp_str;
9679
9680   oui_result[0] = '\0';
9681   oui_base_custom(oui_result, gmcs >> 8);
9682   tmp_str = val_to_str_wmem(NULL, gmcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d");
9683   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9684   wmem_free(NULL, tmp_str);
9685 }
9686
9687 static void
9688 rsni_base_custom(gchar *result, guint32 rsni)
9689 {
9690   double temp_double;
9691
9692   temp_double = (double)rsni;
9693   g_snprintf(result, ITEM_LABEL_LENGTH, "%f dB", (temp_double / 2));
9694 }
9695
9696 static void
9697 vht_tpe_custom(gchar *result, guint8 txpwr)
9698 {
9699   gint8 txpwr_db;
9700
9701   txpwr_db = (gint8)(txpwr);
9702   g_snprintf(result, ITEM_LABEL_LENGTH, "%3.1f dBm", (txpwr_db/2.0));
9703 }
9704
9705 static void
9706 channel_number_custom(gchar *result, guint8 channel_number)
9707 {
9708   switch(channel_number){
9709     case 0:
9710       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels in the specified Operating Class)", channel_number);
9711     break;
9712     case 255:
9713       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on all supported channels listed in the AP Channel Report)", channel_number);
9714     break;
9715     default :
9716       g_snprintf(result, ITEM_LABEL_LENGTH, "%u (iterative measurements on that Channel Number)", channel_number);
9717     break;
9718   }
9719 }
9720
9721 /* WPA / WME */
9722 static const value_string ieee802111_wfa_ie_type_vals[] = {
9723   { 1, "WPA Information Element" },
9724   { 2, "WMM/WME" },
9725   { 4, "WPS" },
9726   { 0, NULL }
9727 };
9728
9729 static const value_string ieee80211_wfa_ie_wpa_cipher_vals[] = {
9730   { 0, "NONE" },
9731   { 1, "WEP (40-bit)" },
9732   { 2, "TKIP" },
9733   { 3, "AES (OCB)" },
9734   { 4, "AES (CCM)" },
9735   { 5, "WEP (104-bit)" },
9736   { 6, "BIP" },
9737   { 7, "Group addressed traffic not allowed" },
9738   { 0, NULL }
9739 };
9740
9741 static const value_string ieee80211_wfa_ie_wpa_keymgmt_vals[] = {
9742   { 0, "NONE" },
9743   { 1, "WPA" },
9744   { 2, "PSK" },
9745   { 3, "FT over IEEE 802.1X" },
9746   { 4, "FT using PSK" },
9747   { 5, "WPA (SHA256)" },
9748   { 6, "PSK (SHA256)" },
9749   { 7, "TDLS / TPK Handshake" },
9750   { 0, NULL }
9751 };
9752
9753 static const value_string ieee80211_wfa_ie_wme_acs_vals[] = {
9754   { 0, "Best Effort" },
9755   { 1, "Background" },
9756   { 2, "Video" },
9757   { 3, "Voice" },
9758   { 0, NULL }
9759 };
9760
9761 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals[] = {
9762   { 0, "Uplink" },
9763   { 1, "Downlink" },
9764   { 2, "Direct link" },
9765   { 3, "Bidirectional link" },
9766   { 0, NULL }
9767 };
9768
9769 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals[] = {
9770   { 0, "Legacy" },
9771   { 1, "U-APSD" },
9772   { 0, NULL }
9773 };
9774
9775 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals[] = {
9776   { 0, "Best Effort" },
9777   { 1, "Background" },
9778   { 2, "Spare" },
9779   { 3, "Excellent Effort" },
9780   { 4, "Controlled Load" },
9781   { 5, "Video" },
9782   { 6, "Voice" },
9783   { 7, "Network Control" },
9784   { 0, NULL }
9785 };
9786
9787 static const value_string ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals[] = {
9788   { 0, "WMM AP may deliver all buffered frames (MSDUs and MMPDUs)" },
9789   { 1, "WMM AP may deliver a maximum of 2 buffered frames (MSDUs and MMPDUs) per USP" },
9790   { 2, "WMM AP may deliver a maximum of 4 buffered frames (MSDUs and MMPDUs) per USP" },
9791   { 3, "WMM AP may deliver a maximum of 6 buffered frames (MSDUs and MMPDUs) per USP" },
9792   { 0, NULL}
9793 };
9794 static const true_false_string ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs = {
9795   "WMM delivery and trigger enabled",
9796   "non-WMM PS"
9797 };
9798
9799 static void
9800 wpa_mcs_base_custom(gchar *result, guint32 mcs)
9801 {
9802   gchar oui_result[SHORT_STR];
9803   gchar *tmp_str;
9804
9805   oui_result[0] = '\0';
9806   oui_base_custom(oui_result, mcs >> 8);
9807   tmp_str = val_to_str_wmem(NULL, mcs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
9808   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9809   wmem_free(NULL, tmp_str);
9810 }
9811
9812 static void
9813 wpa_ucs_base_custom(gchar *result, guint32 ucs)
9814 {
9815   gchar oui_result[SHORT_STR];
9816   gchar *tmp_str;
9817
9818   oui_result[0] = '\0';
9819   oui_base_custom(oui_result, ucs >> 8);
9820   tmp_str = val_to_str_wmem(NULL, ucs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d");
9821   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9822   wmem_free(NULL, tmp_str);
9823 }
9824 static void
9825 wpa_akms_base_custom(gchar *result, guint32 akms)
9826 {
9827   gchar oui_result[SHORT_STR];
9828   gchar *tmp_str;
9829
9830   oui_result[0] = '\0';
9831   oui_base_custom(oui_result, akms >> 8);
9832   tmp_str = val_to_str_wmem(NULL, akms & 0xFF, ieee80211_wfa_ie_wpa_keymgmt_vals, "Unknown %d");
9833   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result, tmp_str);
9834   wmem_free(NULL, tmp_str);
9835 }
9836
9837 static gchar *
9838 wpa_ucs_return(guint32 ucs)
9839 {
9840   gchar *result;
9841
9842   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
9843   result[0] = '\0';
9844   wpa_ucs_base_custom(result, ucs);
9845
9846   return result;
9847 }
9848
9849 static gchar *
9850 wpa_akms_return(guint32 akms)
9851 {
9852   gchar *result;
9853
9854   result = (gchar *)wmem_alloc(wmem_packet_scope(), SHORT_STR);
9855   result[0] = '\0';
9856   wpa_akms_base_custom(result, akms);
9857
9858   return result;
9859 }
9860
9861 /* For each Field */
9862 static const value_string ieee80211_wapi_suite_type[] = {
9863   {0, "Reserved"},
9864   {1, "WAI Certificate Authentication and Key Management"},
9865   {2, "WAI Preshared Key Authentication and Key Management"},
9866   {0, NULL},
9867 };
9868 /* For Summary Tag Information */
9869 static const value_string ieee80211_wapi_suite_type_short[] = {
9870   {0, "Reserved"},
9871   {1, "WAI-CERT"},
9872   {2, "WAI-PSK"},
9873   {0, NULL},
9874 };
9875
9876 static const value_string ieee80211_wapi_cipher_type[] = {
9877   {0, "Reserved"},
9878   {1, "WPI-SMS4"},
9879   {0, NULL},
9880 };
9881
9882 static const value_string ieee802111_wfa_ie_wme_type[] = {
9883   { 0, "Information Element" },
9884   { 1, "Parameter Element" },
9885   { 2, "TSPEC Element" },
9886   { 0, NULL}
9887 };
9888
9889 static const value_string ft_subelem_id_vals[] = {
9890   {0, "Reserved"},
9891   {1, "PMK-R1 key holder identifier (R1KH-ID)"},
9892   {2, "GTK subelement"},
9893   {3, "PMK-R0 key holder identifier (R0KH-ID)"},
9894   {4, "IGTK"},
9895   {0, NULL}
9896 };
9897
9898 static int
9899 dissect_wme_qos_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
9900 {
9901   proto_tree *wme_qos_info_tree;
9902   proto_item *wme_qos_info_item;
9903
9904   wme_qos_info_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_qos_info, tvb, offset, 1, ENC_NA);
9905   wme_qos_info_tree = proto_item_add_subtree(wme_qos_info_item, ett_wme_qos_info);
9906
9907   switch (ftype) {
9908     case MGT_ASSOC_REQ:
9909     case MGT_PROBE_REQ:
9910     case MGT_REASSOC_REQ:
9911     {
9912       /* To AP so decode as per WMM standard Figure 7 QoS Info field when sent from WMM STA*/
9913       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length, tvb, offset, 1, ENC_NA);
9914       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be, tvb, offset, 1, ENC_NA);
9915       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk, tvb, offset, 1, ENC_NA);
9916       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi, tvb, offset, 1, ENC_NA);
9917       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo, tvb, offset, 1, ENC_NA);
9918       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved, tvb, offset, 1, ENC_NA);
9919       break;
9920     }
9921     case MGT_BEACON:
9922     case MGT_PROBE_RESP:
9923     case MGT_ASSOC_RESP:
9924     case MGT_REASSOC_RESP:
9925     {
9926       /* From AP so decode as per WMM standard Figure 6 QoS Info field when sent from WMM AP */
9927       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd, tvb, offset, 1, ENC_NA);
9928       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count, tvb, offset, 1, ENC_NA);
9929       proto_tree_add_item(wme_qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved, tvb, offset, 1, ENC_NA);
9930       break;
9931     }
9932     default:
9933         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);
9934       break;
9935     }
9936
9937   offset += 1;
9938   return offset;
9939 }
9940
9941 static int
9942 dissect_vendor_ie_wpawme(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 tag_len, int ftype)
9943 {
9944   guint8 type;
9945
9946   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_type, tvb, offset, 1, ENC_NA);
9947   type = tvb_get_guint8(tvb, offset);
9948   proto_item_append_text(tree, ": %s", val_to_str(type, ieee802111_wfa_ie_type_vals, "Unknown %d"));
9949   offset += 1;
9950
9951   switch (type) {
9952     case 1:   /* Wi-Fi Protected Access (WPA) */
9953     {
9954       proto_item *wpa_mcs_item, *wpa_ucs_item, *wpa_akms_item;
9955       proto_item *wpa_sub_ucs_item, *wpa_sub_akms_item;
9956       proto_tree *wpa_mcs_tree, *wpa_ucs_tree, *wpa_akms_tree;
9957       proto_tree *wpa_sub_ucs_tree, *wpa_sub_akms_tree;
9958       guint16 ucs_count, akms_count;
9959       guint ii;
9960
9961       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9962       offset += 2;
9963
9964       /* Multicast Cipher Suite */
9965       wpa_mcs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_mcs, tvb, offset, 4, ENC_BIG_ENDIAN);
9966       wpa_mcs_tree = proto_item_add_subtree(wpa_mcs_item, ett_wpa_mcs_tree);
9967       proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
9968
9969       /* Check if OUI is 00:50:F2 (WFA) */
9970       if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
9971       {
9972         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_wfa_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
9973       } else {
9974         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
9975       }
9976       offset += 4;
9977
9978       /* Unicast Cipher Suites */
9979       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9980       ucs_count = tvb_get_letohs(tvb, offset);
9981       offset += 2;
9982
9983       wpa_ucs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_list, tvb, offset, ucs_count * 4, ENC_NA);
9984       wpa_ucs_tree = proto_item_add_subtree(wpa_ucs_item, ett_wpa_ucs_tree);
9985       for (ii = 0; ii < ucs_count; ii++)
9986       {
9987         wpa_sub_ucs_item = proto_tree_add_item(wpa_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs, tvb, offset, 4, ENC_BIG_ENDIAN);
9988         wpa_sub_ucs_tree = proto_item_add_subtree(wpa_sub_ucs_item, ett_wpa_sub_ucs_tree);
9989         proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
9990
9991         /* Check if OUI is 00:50:F2 (WFA) */
9992         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
9993         {
9994           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
9995           proto_item_append_text(wpa_ucs_item, " %s", wpa_ucs_return(tvb_get_ntohl(tvb, offset)));
9996         } else {
9997           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
9998         }
9999         offset += 4;
10000       }
10001
10002       /* Authenticated Key Management Suites */
10003       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10004       akms_count = tvb_get_letohs(tvb, offset);
10005       offset += 2;
10006
10007       wpa_akms_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_list, tvb, offset, akms_count * 4, ENC_NA);
10008       wpa_akms_tree = proto_item_add_subtree(wpa_akms_item, ett_wpa_akms_tree);
10009       for (ii = 0; ii < akms_count; ii++)
10010       {
10011         wpa_sub_akms_item = proto_tree_add_item(wpa_akms_tree, hf_ieee80211_wfa_ie_wpa_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
10012         wpa_sub_akms_tree = proto_item_add_subtree(wpa_sub_akms_item, ett_wpa_sub_akms_tree);
10013         proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10014
10015         /* Check if OUI is 00:50:F2 (WFA) */
10016         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
10017         {
10018           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_wfa_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10019           proto_item_append_text(wpa_akms_item, " %s", wpa_akms_return(tvb_get_ntohl(tvb, offset)));
10020         } else {
10021           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10022         }
10023         offset += 4;
10024       }
10025       break;
10026     }
10027     case 2:   /* Wireless Multimedia Enhancements (WME) */
10028     {
10029       guint8 subtype;
10030
10031       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_subtype, tvb, offset, 1, ENC_NA);
10032       subtype = tvb_get_guint8(tvb, offset);
10033       proto_item_append_text(tree, ": %s", val_to_str(subtype, ieee802111_wfa_ie_wme_type, "Unknown %d"));
10034       offset += 1;
10035       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_version, tvb, offset, 1, ENC_NA);
10036       offset += 1;
10037       switch (subtype) {
10038         case 0: /* WME Information Element */
10039         {
10040           /* WME QoS Info Field */
10041           offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
10042           break;
10043         }
10044         case 1: /* WME Parameter Element */
10045         {
10046           int i;
10047           /* WME QoS Info Field */
10048           offset = dissect_wme_qos_info(tree, tvb, pinfo, offset, ftype);
10049           proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_reserved, tvb, offset, 1, ENC_NA);
10050           offset += 1;
10051           /* AC Parameters */
10052           for (i = 0; i < 4; i++)
10053           {
10054             proto_item *ac_item, *aci_aifsn_item, *ecw_item;
10055             proto_tree *ac_tree, *aci_aifsn_tree, *ecw_tree;
10056             guint8 aci_aifsn, ecw;
10057
10058             ac_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_ac_parameters, tvb, offset, 4, ENC_NA);
10059             ac_tree = proto_item_add_subtree(ac_item, ett_wme_ac);
10060
10061             /* ACI/AIFSN Field */
10062             aci_aifsn_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_aci_aifsn, tvb, offset, 1, ENC_NA);
10063             aci_aifsn_tree = proto_item_add_subtree(aci_aifsn_item, ett_wme_aci_aifsn);
10064             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_aci, tvb, offset, 1, ENC_NA);
10065             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_acm, tvb, offset, 1, ENC_NA);
10066             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_aifsn, tvb, offset, 1, ENC_NA);
10067             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_reserved, tvb, offset, 1, ENC_NA);
10068             aci_aifsn = tvb_get_guint8(tvb, offset);
10069             proto_item_append_text(ac_item, " ACI %u (%s), ACM %s, AIFSN %u",
10070               (aci_aifsn & 0x60) >> 5, try_val_to_str((aci_aifsn & 0x60) >> 5, ieee80211_wfa_ie_wme_acs_vals),
10071               (aci_aifsn & 0x10) ? "yes" : "no", aci_aifsn & 0x0f);
10072             offset += 1;
10073
10074             /* ECWmin/ECWmax field */
10075             ecw_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_ecw, tvb, offset, 1, ENC_NA);
10076             ecw_tree = proto_item_add_subtree(ecw_item, ett_wme_ecw);
10077             proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_max, tvb, offset, 1, ENC_NA);
10078             proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_min, tvb, offset, 1, ENC_NA);
10079             ecw = tvb_get_guint8(tvb, offset);
10080             proto_item_append_text(ac_item, ", ECWmin %u, ECWmax %u", ecw & 0x0f, (ecw & 0xf0) >> 4);
10081             offset += 1;
10082
10083             /* TXOP Limit */
10084             proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_txop_limit, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10085             proto_item_append_text(ac_item, ", TXOP %u", tvb_get_letohs(tvb, offset));
10086             offset += 2;
10087           }
10088           break;
10089         }
10090         case 2:   /* WME TSPEC Element */
10091         {
10092
10093             proto_item *tsinfo_item;
10094             proto_tree *tsinfo_tree;
10095
10096             tsinfo_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10097             tsinfo_tree = proto_item_add_subtree(tsinfo_item, ett_tsinfo_tree);
10098
10099             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10100             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10101             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10102             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10103             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved, tvb, offset, 3, ENC_LITTLE_ENDIAN);
10104             offset += 3;
10105
10106             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10107             offset += 2;
10108
10109             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10110             offset += 2;
10111
10112             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10113             offset += 4;
10114
10115             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10116             offset += 4;
10117
10118             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10119             offset += 4;
10120
10121             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10122             offset += 4;
10123
10124             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10125             offset += 4;
10126
10127             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10128             offset += 4;
10129
10130             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10131             offset += 4;
10132
10133             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10134             offset += 4;
10135
10136             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10137             offset += 4;
10138
10139             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10140             offset += 4;
10141
10142             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10143             offset += 4;
10144
10145             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10146             offset += 2;
10147
10148             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10149             offset += 2;
10150
10151           break;
10152         }
10153         default:
10154           /* No default Action */
10155         break;
10156       } /* End switch (subtype) */
10157       break;
10158     }
10159     case 4: /* WPS: Wifi Protected Setup */
10160     {
10161       dissect_wps_tlvs(tree, tvb, offset, tag_len-1, NULL);
10162     }
10163     break;
10164     default:
10165       /* No default Action...*/
10166     break;
10167   } /* End switch (type) */
10168
10169   return offset;
10170 }
10171
10172 static const value_string hs20_indication_release_number_vals[] = {
10173   { 0, "Release 1" },
10174   { 1, "Release 2" },
10175   { 0, NULL }
10176 };
10177
10178 static void dissect_hs20_indication(proto_tree *tree, tvbuff_t *tvb,
10179                                     int offset)
10180 {
10181   proto_tree_add_item(tree, hf_hs20_indication_dgaf_disabled, tvb, offset, 1,
10182                       ENC_LITTLE_ENDIAN);
10183   proto_tree_add_item(tree, hf_hs20_indication_pps_mo_id_present, tvb, offset, 1,
10184                       ENC_LITTLE_ENDIAN);
10185   proto_tree_add_item(tree, hf_hs20_indication_anqp_domain_id_present, tvb, offset, 1,
10186                       ENC_LITTLE_ENDIAN);
10187   proto_tree_add_item(tree, hf_hs20_indication_release_number, tvb, offset, 1,
10188                       ENC_LITTLE_ENDIAN);
10189 }
10190
10191 static void
10192 dissect_vendor_ie_wfa(packet_info *pinfo, proto_item *item, tvbuff_t *tag_tvb)
10193 {
10194   gint tag_len = tvb_reported_length(tag_tvb);
10195
10196   if (tag_len < 4)
10197     return;
10198
10199   switch (tvb_get_guint8(tag_tvb, 3)) {
10200   case WFA_SUBTYPE_P2P:
10201     dissect_wifi_p2p_ie(pinfo, item, tag_tvb, 4, tag_len - 4);
10202     proto_item_append_text(item, ": P2P");
10203     break;
10204   case WFA_SUBTYPE_WIFI_DISPLAY:
10205     dissect_wifi_display_ie(pinfo, item, tag_tvb, 4, tag_len - 4);
10206     proto_item_append_text(item, ": Wi-Fi Display");
10207     break;
10208   case WFA_SUBTYPE_HS20_INDICATION:
10209     dissect_hs20_indication(item, tag_tvb, 4);
10210     proto_item_append_text(item, ": Hotspot 2.0 Indication");
10211     break;
10212   }
10213 }
10214
10215 static void
10216 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
10217 {
10218
10219   switch(tvb_get_guint8(tvb, offset)){
10220     case 4:
10221     {
10222       /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
10223        * This is only used within EAPOL-Key frame Key Data. */
10224       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_pmkid, tvb, offset, 16, ENC_NA);
10225     }
10226     break;
10227     default:
10228       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_unknown, tvb, offset, tag_len, ENC_NA);
10229     break;
10230   }
10231
10232   proto_item_append_text(item, ": RSN");
10233
10234 }
10235
10236 typedef enum {
10237   MARVELL_IE_MESH = 4
10238 } marvell_ie_type_t;
10239
10240 static void
10241 dissect_vendor_ie_marvell(proto_item *item _U_, proto_tree *ietree,
10242                           tvbuff_t *tvb, int offset, guint32 tag_len)
10243 {
10244   guint8 type;
10245
10246   type = tvb_get_guint8(tvb, offset);
10247   proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10248   offset += 1;
10249
10250   switch (type) {
10251   case MARVELL_IE_MESH:
10252     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_subtype, tvb,
10253                          offset++, 1, ENC_LITTLE_ENDIAN);
10254     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_version, tvb,
10255                          offset++, 1, ENC_LITTLE_ENDIAN);
10256     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_active_proto_id, tvb,
10257                          offset++, 1, ENC_LITTLE_ENDIAN);
10258     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_active_metric_id, tvb,
10259                          offset++, 1, ENC_LITTLE_ENDIAN);
10260     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_cap, tvb,
10261                          offset++, 1, ENC_LITTLE_ENDIAN);
10262     break;
10263
10264   default:
10265     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_data, tvb, offset,
10266       tag_len - 1, ENC_NA);
10267     break;
10268   }
10269 }
10270
10271 typedef enum {
10272   ATHEROS_IE_ADVCAP = 1,
10273   ATHEROS_IE_XR = 3
10274 } atheros_ie_type_t;
10275
10276 typedef enum {
10277   ATHEROS_IE_ADVCAP_S = 1
10278 } atheros_ie_advcap_subtype_t;
10279
10280 typedef enum {
10281   ATHEROS_IE_XR_S = 1
10282 } atheros_ie_xr_subtype_t;
10283
10284 typedef enum {
10285   ATHEROS_IE_CAP_TURBOP = 0x01,
10286   ATHEROS_IE_CAP_COMP   = 0x02,
10287   ATHEROS_IE_CAP_FF     = 0x04,
10288   ATHEROS_IE_CAP_XR     = 0x08,
10289   ATHEROS_IE_CAP_AR     = 0x10,
10290   ATHEROS_IE_CAP_BURST  = 0x20,
10291   ATHEROS_IE_CAP_WME    = 0x40,
10292   ATHEROS_IE_CAP_BOOST  = 0x80
10293 } atheros_ie_cap_t;
10294
10295 static const value_string atheros_ie_type_vals[] = {
10296   { ATHEROS_IE_ADVCAP, "Advanced Capability"},
10297   { ATHEROS_IE_XR,     "eXtended Range"},
10298   { 0,                 NULL }
10299 };
10300
10301 static void
10302 dissect_vendor_ie_atheros_cap(proto_item *item _U_, tvbuff_t *tvb, int offset)
10303 {
10304   proto_tree *cap_tree;
10305
10306   cap_tree = proto_item_add_subtree(item, ett_ath_cap_tree);
10307
10308   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_turbop, tvb, offset, 1, ENC_NA);
10309   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_comp,   tvb, offset, 1, ENC_NA);
10310   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_ff,     tvb, offset, 1, ENC_NA);
10311   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_xr,     tvb, offset, 1, ENC_NA);
10312   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_ar,     tvb, offset, 1, ENC_NA);
10313   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_burst,  tvb, offset, 1, ENC_NA);
10314   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_wme,    tvb, offset, 1, ENC_NA);
10315   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_boost,  tvb, offset, 1, ENC_NA);
10316
10317 }
10318
10319 static void
10320 dissect_vendor_ie_atheros(proto_item *item _U_, proto_tree *ietree,
10321                           tvbuff_t *tvb, int offset, guint tag_len,
10322                           packet_info *pinfo, proto_item *ti_len)
10323 {
10324   guint8      type;
10325   guint8      subtype;
10326   guint8      version;
10327   proto_item *cap_item;
10328
10329   if (tag_len <= 3) {
10330         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 */
10331         return;
10332   }
10333   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_type, tvb, offset, 1, ENC_NA);
10334   type = tvb_get_guint8(tvb, offset);
10335   proto_item_append_text(item, ": %s", val_to_str_const(type, atheros_ie_type_vals, "Unknown"));
10336   offset  += 1;
10337   tag_len -= 1;
10338
10339   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_subtype, tvb, offset, 1, ENC_NA);
10340   subtype  = tvb_get_guint8(tvb, offset);
10341   offset  += 1;
10342   tag_len -= 1;
10343
10344   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_version, tvb, offset, 1, ENC_NA);
10345   version  = tvb_get_guint8(tvb, offset);
10346   offset  += 1;
10347   tag_len -= 1;
10348
10349   if (version == 0)
10350   {
10351     switch (type) {
10352       case ATHEROS_IE_ADVCAP:
10353       {
10354         switch (subtype) {
10355           case ATHEROS_IE_ADVCAP_S:
10356           {
10357             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_cap, tvb, offset, 1, ENC_NA);
10358             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
10359             offset   += 1;
10360             tag_len  -= 1;
10361
10362             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_defkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10363             offset  += 2;
10364             tag_len -= 2;
10365             break;
10366           }
10367           default:
10368           /* No default Action */
10369           break;
10370         } /* End switch (subtype) */
10371         break;
10372       }
10373       case ATHEROS_IE_XR:
10374       {
10375         switch (subtype) {
10376           case ATHEROS_IE_XR_S:
10377           {
10378             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_info, tvb, offset, 1, ENC_NA);
10379             offset  += 1;
10380             tag_len -= 1;
10381
10382             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_bssid, tvb, offset, 6, ENC_NA);
10383             offset  += 6;
10384             tag_len -= 6;
10385
10386             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_bssid, tvb, offset, 6, ENC_NA);
10387             offset  += 6;
10388             tag_len -= 6;
10389
10390             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10391             offset  += 2;
10392             tag_len -= 2;
10393
10394             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_cap, tvb, offset, 1, ENC_NA);
10395             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
10396             offset   += 1;
10397             tag_len  -= 1;
10398
10399             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_cap, tvb, offset, 1, ENC_NA);
10400             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
10401             offset   += 1;
10402             tag_len  -= 1;
10403             break;
10404           }
10405           default:
10406           /* No default Action */
10407           break;
10408         } /* End switch (subtype) */
10409         break;
10410         default:
10411         /* No default Action */
10412         break;
10413       } /* End switch (type) */
10414
10415     }
10416   }
10417   if (tag_len > 0) {
10418     proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_data, tvb, offset, tag_len, ENC_NA);
10419   }
10420 }
10421
10422 typedef enum {
10423   AIRONET_IE_DTPC = 0,
10424   AIRONET_IE_UNKNOWN1 = 1,
10425   AIRONET_IE_VERSION = 3,
10426   AIRONET_IE_QOS,
10427   AIRONET_IE_UNKNOWN11 = 11,
10428   AIRONET_IE_QBSS_V2 = 14,
10429   AIRONET_IE_CLIENT_MFP = 20
10430 } aironet_ie_type_t;
10431
10432 static const value_string aironet_ie_type_vals[] = {
10433   { AIRONET_IE_DTPC,      "DTPC"},
10434   { AIRONET_IE_UNKNOWN1,  "Unknown (1)"},
10435   { AIRONET_IE_VERSION,   "CCX version"},
10436   { AIRONET_IE_QOS,       "Qos"},
10437   { AIRONET_IE_UNKNOWN11, "Unknown (11)"},
10438   { AIRONET_IE_QBSS_V2,   "QBSS V2 - CCA"},
10439   { AIRONET_IE_CLIENT_MFP, "Client MFP"},
10440   { 0,                    NULL }
10441 };
10442
10443 static const value_string aironet_mfp_vals[] = {
10444   { 0,      "Disabled"},
10445   { 1,      "Enabled"},
10446   { 0,      NULL }
10447 };
10448
10449 static void
10450 dissect_vendor_ie_aironet(proto_item *aironet_item, proto_tree *ietree,
10451                           tvbuff_t *tvb, int offset, guint32 tag_len)
10452 {
10453   guint8  type;
10454   int i;
10455   gboolean dont_change = FALSE; /* Don't change the IE item text to default */
10456
10457   type = tvb_get_guint8(tvb, offset);
10458   proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10459   offset += 1;
10460
10461   switch (type) {
10462   case AIRONET_IE_DTPC:
10463     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_dtpc, tvb, offset, 2, ENC_NA);
10464     proto_item_append_text(aironet_item, ": Aironet DTPC Powerlevel 0x%02X", tvb_get_guint8(tvb, offset));
10465     dont_change = TRUE;
10466     break;
10467   case AIRONET_IE_VERSION:
10468     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10469     proto_item_append_text(aironet_item, ": Aironet CCX version = %d", tvb_get_guint8(tvb, offset));
10470     dont_change = TRUE;
10471     break;
10472   case AIRONET_IE_QOS:
10473     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_qos_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10474     offset += 1;
10475     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_qos_paramset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10476     offset += 1;
10477
10478     /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
10479      *  need to be swapped. Also, the "TXOP" may be TXOP - or not.
10480      */
10481     for (i = 0; i < 4; i++) {
10482       guint8 byte1, byte2;
10483       guint16 txop;
10484       byte1 = tvb_get_guint8(tvb, offset);
10485       byte2 = tvb_get_guint8(tvb, offset + 1);
10486       txop = tvb_get_letohs(tvb, offset + 2);
10487       proto_tree_add_bytes_format(ietree, hf_ieee80211_aironet_ie_qos_val, tvb, offset, 4, NULL,
10488           "CCX QoS Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
10489         (byte1 & 0x60) >> 5, val_to_str((byte1 & 0x60) >> 5, wme_acs, "(Unknown: %d)"),
10490         (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
10491         byte2 & 0x0f, (byte2 & 0xf0) >> 4,
10492         txop);
10493       offset += 4;
10494     }
10495     break;
10496   case AIRONET_IE_QBSS_V2:
10497     /* Extract Values */
10498     proto_tree_add_item (ietree, hf_ieee80211_qbss2_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10499     proto_tree_add_item (ietree, hf_ieee80211_qbss2_cu, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
10500     proto_tree_add_item (ietree, hf_ieee80211_qbss2_cal, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10501     proto_tree_add_item (ietree, hf_ieee80211_qbss2_gl, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
10502     break;
10503   case AIRONET_IE_CLIENT_MFP:
10504     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_clientmfp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10505     proto_item_append_text(aironet_item, ": Aironet Client MFP %s",
10506       val_to_str_const(1 & tvb_get_guint8(tvb, offset), aironet_mfp_vals, "Unknown"));
10507     dont_change = TRUE;
10508     break;
10509   default:
10510     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_data, tvb, offset,
10511       tag_len - 1, ENC_NA);
10512     break;
10513   }
10514   if (!dont_change) {
10515     proto_item_append_text(aironet_item, ": Aironet %s (%d)",
10516       val_to_str_const(type, aironet_ie_type_vals, "Unknown"), type);
10517   }
10518 }
10519
10520 #define ARUBA_APNAME  3
10521 static const value_string ieee80211_vs_aruba_subtype_vals[] = {
10522   { ARUBA_APNAME, "AP Name"},
10523   { 0,                 NULL }
10524 };
10525 static void
10526 dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree,
10527                           tvbuff_t *tvb, int offset, guint32 tag_len)
10528 {
10529   guint8 type;
10530
10531   offset += 1; /* VS OUI Type */
10532   tag_len -= 1;
10533
10534   type = tvb_get_guint8(tvb, offset);
10535   proto_tree_add_item (ietree, hf_ieee80211_vs_aruba_subtype, tvb, offset, 1, ENC_NA);
10536   proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aruba_subtype_vals, "Unknown"));
10537   offset += 1;
10538   tag_len -= 1;
10539
10540   switch (type) {
10541   case ARUBA_APNAME:
10542     offset += 1;
10543     tag_len -= 1;
10544
10545     proto_tree_add_item (ietree, hf_ieee80211_vs_aruba_apname, tvb,
10546                          offset, tag_len, ENC_ASCII|ENC_NA);
10547     proto_item_append_text(item, " (%s)", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tag_len, ENC_ASCII));
10548     break;
10549
10550   default:
10551     proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_data, tvb, offset,
10552       tag_len, ENC_NA);
10553     proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, tag_len));
10554     break;
10555   }
10556 }
10557
10558 enum vs_nintendo_type {
10559   NINTENDO_SERVICES = 0x11,
10560   NINTENDO_CONSOLEID = 0xF0
10561 };
10562
10563 static const value_string ieee80211_vs_nintendo_type_vals[] = {
10564   { NINTENDO_SERVICES,  "Services"},
10565   { NINTENDO_CONSOLEID, "ConsoleID"},
10566   { 0, NULL }
10567 };
10568
10569 static proto_tree*
10570 dissect_vendor_ie_nintendo_tlv(const int hfindex, proto_tree *ietree,
10571                           tvbuff_t *tvb, int offset, guint32 sublen)
10572 {
10573   proto_item *nintendo_item;
10574   proto_tree *nintendo_tree;
10575
10576   nintendo_item = proto_tree_add_item(ietree, hfindex, tvb, offset, sublen, ENC_NA);
10577   nintendo_tree = proto_item_add_subtree(nintendo_item, ett_nintendo);
10578
10579   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_type, tvb, offset, 1, ENC_NA);
10580   proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_length, tvb, offset + 1,  1, ENC_NA);
10581
10582   return nintendo_tree;
10583 }
10584
10585 static void
10586 dissect_vendor_ie_nintendo(proto_item *item _U_, proto_tree *ietree,
10587                           tvbuff_t *tvb, int offset, guint32 tag_len)
10588 {
10589   proto_tree *nintendo_tree;
10590
10591   guint8      subtype;
10592   guint8      sublength;
10593   guint32     length = tag_len;
10594
10595   /* Skip OUI type for now - the code is for type 1 (StreetPass) only */
10596   /* http://3dbrew.org/wiki/StreetPass */
10597   offset += 1;
10598   length -= 1;
10599
10600   while(length > 0 && length < 256) { /* otherwise we are < 0 but on unsigned */
10601     subtype = tvb_get_guint8(tvb, offset);
10602     sublength = tvb_get_guint8(tvb, offset + 1);
10603
10604     switch(subtype) {
10605     case NINTENDO_SERVICES:
10606       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_servicelist, ietree, tvb, offset, sublength + 2);
10607       offset += 2;
10608       length -= 2;
10609
10610       while (sublength > 4) {
10611
10612         proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_service, tvb, offset, 5, ENC_NA);
10613         offset += 5;
10614         length -= 5;
10615         sublength -= 5;
10616       }
10617       break;
10618     case NINTENDO_CONSOLEID:
10619       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_consoleid, ietree, tvb, offset, sublength + 2);
10620       offset += + 2;
10621       length -= + 2;
10622
10623       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_consoleid, tvb, offset, sublength, ENC_NA);
10624       offset += sublength;
10625       length -= sublength;
10626       break;
10627     default:
10628       nintendo_tree = dissect_vendor_ie_nintendo_tlv(hf_ieee80211_vs_nintendo_unknown, ietree, tvb, offset, sublength + 2);
10629       offset += + 2;
10630       length -= + 2;
10631
10632       proto_tree_add_item(nintendo_tree, hf_ieee80211_vs_nintendo_unknown, tvb, offset, sublength, ENC_NA);
10633       offset += sublength;
10634       length -= sublength;
10635       break;
10636     }
10637   }
10638 }
10639
10640 /* 802.11-2012 8.4.2.37 QoS Capability element */
10641 static int
10642 dissect_qos_capability(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
10643 {
10644   switch (ftype) {
10645     case MGT_ASSOC_REQ:
10646     case MGT_PROBE_REQ:
10647     case MGT_REASSOC_REQ:
10648     {
10649       /* To AP so decode Qos Info as STA */
10650       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_QOS_INFO_STA);
10651       break;
10652     }
10653
10654     case MGT_BEACON:
10655     case MGT_PROBE_RESP:
10656     case MGT_ASSOC_RESP:
10657     case MGT_REASSOC_RESP:
10658     {
10659       /* From AP so decode QoS Info as AP */
10660       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_QOS_INFO_AP);
10661       break;
10662     }
10663
10664     default:
10665       expert_add_info_format(pinfo, proto_tree_get_parent(tree), &ei_ieee80211_qos_info_bad_ftype,
10666                              "Could not deduce direction to decode correctly, ftype %u", ftype);
10667       break;
10668   }
10669
10670   return offset;
10671 }
10672
10673 /* 7.3.2.25 RSN information element */
10674 static int
10675 dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
10676                int offset, guint32 tag_len)
10677 {
10678   proto_item *rsn_gcs_item, *rsn_pcs_item, *rsn_akms_item, *rsn_cap_item, *rsn_pmkid_item, *rsn_gmcs_item;
10679   proto_item *rsn_sub_pcs_item, *rsn_sub_akms_item;
10680   proto_item *rsn_pcs_count, *rsn_akms_count, *rsn_pmkid_count;
10681   proto_tree *rsn_gcs_tree, *rsn_pcs_tree, *rsn_akms_tree, *rsn_cap_tree, *rsn_pmkid_tree, *rsn_gmcs_tree;
10682   proto_tree *rsn_sub_pcs_tree, *rsn_sub_akms_tree;
10683   guint16     pcs_count, akms_count, pmkid_count;
10684   guint       ii;
10685   int         tag_end = offset + tag_len;
10686
10687   proto_tree_add_item(tree, hf_ieee80211_rsn_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10688   offset += 2;
10689
10690   /* 7.3.2.25.1 Group Cipher suites */
10691   rsn_gcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gcs, tvb, offset, 4, ENC_BIG_ENDIAN);
10692   rsn_gcs_tree = proto_item_add_subtree(rsn_gcs_item, ett_rsn_gcs_tree);
10693   proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10694
10695     /* Check if OUI is 00:0F:AC (ieee80211) */
10696   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
10697   {
10698     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10699   } else {
10700     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10701   }
10702   offset += 4;
10703
10704   /* 7.3.2.25.2 Pairwise Cipher suites */
10705   rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10706   pcs_count = tvb_get_letohs(tvb, offset);
10707   offset += 2;
10708
10709   if (offset + (pcs_count * 4) > tag_end)
10710   {
10711     expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
10712         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
10713     pcs_count = (tag_end - offset) / 4;
10714   }
10715
10716   rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
10717   rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
10718   for (ii = 0; ii < pcs_count; ii++)
10719   {
10720     rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
10721     rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
10722     proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10723
10724     /* Check if OUI is 00:0F:AC (ieee80211) */
10725     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
10726     {
10727       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10728       proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
10729     } else {
10730       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10731     }
10732     offset += 4;
10733   }
10734
10735   if (offset >= tag_end)
10736   {
10737     return offset;
10738   }
10739
10740   /* 7.3.2.25.2 AKM suites */
10741   rsn_akms_count = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10742   akms_count = tvb_get_letohs(tvb, offset);
10743   offset += 2;
10744
10745   if (offset + (akms_count * 4) > tag_end)
10746   {
10747     expert_add_info_format(pinfo, rsn_akms_count, &ei_ieee80211_rsn_pmkid_count,
10748         "Auth Key Management (AKM) Suite Count too large, 4*%u > %d", akms_count, tag_end - offset);
10749     akms_count = (tag_end - offset) / 4;
10750   }
10751
10752   rsn_akms_item = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_list, tvb, offset, akms_count * 4, ENC_NA);
10753   rsn_akms_tree = proto_item_add_subtree(rsn_akms_item, ett_rsn_akms_tree);
10754   for (ii = 0; ii < akms_count; ii++)
10755   {
10756     rsn_sub_akms_item = proto_tree_add_item(rsn_akms_tree, hf_ieee80211_rsn_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
10757     rsn_sub_akms_tree = proto_item_add_subtree(rsn_sub_akms_item, ett_rsn_sub_akms_tree);
10758     proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10759
10760     /* Check if OUI is 00:0F:AC (ieee80211) */
10761     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
10762     {
10763       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10764       proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(tvb_get_ntohl(tvb, offset)));
10765     } else {
10766       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
10767     }
10768     offset += 4;
10769   }
10770
10771   /* 7.3.2.25.3 RSN capabilities */
10772   rsn_cap_item = proto_tree_add_item(tree, hf_ieee80211_rsn_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10773   rsn_cap_tree = proto_item_add_subtree(rsn_cap_item, ett_rsn_cap_tree);
10774
10775   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_preauth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10776   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_no_pairwise, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10777   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_ptksa_replay_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10778   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_gtksa_replay_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10779   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_mfpr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10780   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_mfpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10781   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_jmr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10782   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_peerkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10783   offset += 2;
10784   if (offset >= tag_end)
10785   {
10786     return offset;
10787   }
10788   /* 7.3.2.25.4 PMKID */
10789   rsn_pmkid_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10790   pmkid_count = tvb_get_letohs(tvb, offset);
10791   offset += 2;
10792
10793   if (offset + (pmkid_count * 16) > tag_end)
10794   {
10795     expert_add_info_format(pinfo, rsn_pmkid_count, &ei_ieee80211_pmkid_count_too_large,
10796         "PMKID Count too large, 16*%u > %d", pmkid_count, tag_end - offset);
10797     pmkid_count = (tag_end - offset) / 16;
10798   }
10799
10800   rsn_pmkid_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_list, tvb, offset, pmkid_count * 16, ENC_NA);
10801   rsn_pmkid_tree = proto_item_add_subtree(rsn_pmkid_item, ett_rsn_pmkid_tree);
10802   for (ii = 0; ii < pmkid_count; ii++)
10803   {
10804     proto_tree_add_item(rsn_pmkid_tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
10805     offset += 16;
10806   }
10807
10808   if (offset >= tag_end)
10809   {
10810     return offset;
10811   }
10812   /* Group Management Cipher Suite (802.11w)*/
10813   rsn_gmcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gmcs, tvb, offset, 4, ENC_BIG_ENDIAN);
10814   rsn_gmcs_tree = proto_item_add_subtree(rsn_gmcs_item, ett_rsn_gmcs_tree);
10815   proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
10816   /* Check if OUI is 00:0F:AC (ieee80211) */
10817   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
10818   {
10819     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_80211_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10820   } else {
10821     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_type, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
10822   }
10823   offset += 4;
10824
10825   return offset;
10826 }
10827 static int
10828 dissect_extended_capabilities_ie(packet_info *pinfo, proto_tree *tree,
10829                          proto_item *ti, proto_item *ti_len,
10830                          guint32 tag_len, tvbuff_t *tvb,
10831                          int offset, int tag_end)
10832 {
10833   proto_item *ti_ex_cap;
10834   proto_tree *ex_cap_tree;
10835
10836   if (tag_len < 1)
10837   {
10838     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be greater than 0", tag_len);
10839     return offset;
10840   }
10841   proto_item_append_text(ti, " (%u octet%s)", tag_len, plurality(tag_len, "", "s"));
10842
10843   /* Extended Capability octet 1 */
10844   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10845   proto_item_append_text(ti_ex_cap, " (octet 1)");
10846   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap1);
10847   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b0, tvb, offset, 1, ENC_NA);
10848   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b1, tvb, offset, 1, ENC_NA);
10849   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b2, tvb, offset, 1, ENC_NA);
10850   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b3, tvb, offset, 1, ENC_NA);
10851   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b4, tvb, offset, 1, ENC_NA);
10852   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b5, tvb, offset, 1, ENC_NA);
10853   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b6, tvb, offset, 1, ENC_NA);
10854   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b7, tvb, offset, 1, ENC_NA);
10855   offset += 1;
10856
10857   /* Extended Capability octet 2 */
10858   if (offset >= tag_end) {
10859     return offset;
10860   }
10861   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10862   proto_item_append_text(ti_ex_cap, " (octet 2)");
10863   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap2);
10864   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b8, tvb, offset, 1, ENC_NA);
10865   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b9, tvb, offset, 1, ENC_NA);
10866   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b10, tvb, offset, 1, ENC_NA);
10867   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b11, tvb, offset, 1, ENC_NA);
10868   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b12, tvb, offset, 1, ENC_NA);
10869   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b13, tvb, offset, 1, ENC_NA);
10870   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b14, tvb, offset, 1, ENC_NA);
10871   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b15, tvb, offset, 1, ENC_NA);
10872   offset += 1;
10873
10874   /* Extended Capability octet 3 */
10875   if (offset >= tag_end) {
10876     return offset;
10877   }
10878   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10879   proto_item_append_text(ti_ex_cap, " (octet 3)");
10880   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap3);
10881   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b16, tvb, offset, 1, ENC_NA);
10882   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b17, tvb, offset, 1, ENC_NA);
10883   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b18, tvb, offset, 1, ENC_NA);
10884   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b19, tvb, offset, 1, ENC_NA);
10885   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b20, tvb, offset, 1, ENC_NA);
10886   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b21, tvb, offset, 1, ENC_NA);
10887   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b22, tvb, offset, 1, ENC_NA);
10888   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b23, tvb, offset, 1, ENC_NA);
10889   offset += 1;
10890
10891   /* Extended Capability octet 4 */
10892   if (offset >= tag_end) {
10893     return offset;
10894   }
10895   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10896   proto_item_append_text(ti_ex_cap, " (octet 4)");
10897   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap4);
10898   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b24, tvb, offset, 1, ENC_NA);
10899   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b25, tvb, offset, 1, ENC_NA);
10900   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b26, tvb, offset, 1, ENC_NA);
10901   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b27, tvb, offset, 1, ENC_NA);
10902   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b28, tvb, offset, 1, ENC_NA);
10903   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b29, tvb, offset, 1, ENC_NA);
10904   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b30, tvb, offset, 1, ENC_NA);
10905   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b31, tvb, offset, 1, ENC_NA);
10906   offset += 1;
10907
10908   /* Extended Capability octet 5 */
10909   if (offset >= tag_end) {
10910     return offset;
10911   }
10912   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10913   proto_item_append_text(ti_ex_cap, " (octet 5)");
10914   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap5);
10915   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b32, tvb, offset, 1, ENC_NA);
10916   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b33, tvb, offset, 1, ENC_NA);
10917   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b34, tvb, offset, 1, ENC_NA);
10918   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b35, tvb, offset, 1, ENC_NA);
10919   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b36, tvb, offset, 1, ENC_NA);
10920   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b37, tvb, offset, 1, ENC_NA);
10921   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b38, tvb, offset, 1, ENC_NA);
10922   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b39, tvb, offset, 1, ENC_NA);
10923   offset += 1;
10924
10925   /* Extended Capability octet 6 */
10926   if (offset >= tag_end) {
10927     return offset;
10928   }
10929   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10930   proto_item_append_text(ti_ex_cap, " (octet 6)");
10931   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap6);
10932   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b40, tvb, offset, 1, ENC_NA);
10933   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_serv_int_granularity, tvb, offset, 1, ENC_NA);
10934   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b44, tvb, offset, 1, ENC_NA);
10935   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b45, tvb, offset, 1, ENC_NA);
10936   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b46, tvb, offset, 1, ENC_NA);
10937   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b47, tvb, offset, 1, ENC_NA);
10938   offset += 1;
10939
10940
10941   /* Extended Capability octet 7 */
10942   if (offset >= tag_end) {
10943     return offset;
10944   }
10945   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10946   proto_item_append_text(ti_ex_cap, " (octet 7)");
10947   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap7);
10948   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b48, tvb, offset, 1, ENC_NA);
10949   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o7, tvb, offset, 1, ENC_NA);
10950   offset += 1;
10951
10952   /* Extended Capability octet 8 */
10953   if (offset >= tag_end) {
10954     return offset;
10955   }
10956   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10957   proto_item_append_text(ti_ex_cap, " (octet 8)");
10958   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap8);
10959   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b61, tvb, offset, 1, ENC_NA);
10960   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b62, tvb, offset, 1, ENC_NA);
10961
10962   /* Std802.11ac-2013, b63-64 indicate the Max Number of MSDUs in AMSDU. */
10963   ti_ex_cap = proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b63, tvb, offset, 1, ENC_NA);
10964   if (offset+1 < tag_end) {
10965
10966     proto_item_append_text(ti_ex_cap, " (b63-64 Max Number of MSDUs in AMSDU: %s)",
10967       val_to_str((tvb_get_guint8(tvb,offset) & 0x80) + ((tvb_get_guint8(tvb,offset+1) & 0x1) << 1),
10968                   vht_max_mpdu_in_amsdu,"Unknown:%d"));
10969   }
10970
10971   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o8, tvb, offset, 1, ENC_NA);
10972   offset += 1;
10973
10974   /* Extended Capability octet 9 */
10975   if (offset >= tag_end) {
10976     return offset;
10977   }
10978   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
10979   proto_item_append_text(ti_ex_cap, " (octet 9)");
10980   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap9);
10981   ti_ex_cap = proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b64, tvb, offset, 1, ENC_NA);
10982   proto_item_append_text(ti_ex_cap, " (b63-64 Max Number of MSDUs in AMSDU)");
10983   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o9, tvb, offset, 1, ENC_NA);
10984   offset += 1;
10985
10986   return offset;
10987 }
10988 static int
10989 dissect_vht_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset)
10990 {
10991   proto_item *ti;
10992   proto_tree *mcs_tree, *rx_mcs_tree, *tx_mcs_tree;
10993
10994   /* 8 byte Supported MCS set */
10995   ti = proto_tree_add_item(tree, hf_ieee80211_vht_mcsset, tvb, offset, 8, ENC_NA);
10996
10997   mcs_tree = proto_item_add_subtree(ti, ett_vht_mcsset_tree);
10998
10999   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11000   rx_mcs_tree = proto_item_add_subtree(ti, ett_vht_rx_mcsbit_tree);
11001
11002   /* B0 - B15 */
11003   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11004   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11005   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11006   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11007   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11008   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11009   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11010   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11011
11012   offset += 2;
11013   /* B16 - B28 13 bits*/
11014   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11015
11016   /* B29 - B31 2 reserved bits*/
11017
11018   offset += 2;
11019   /* B32 - B47 */
11020
11021   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11022   tx_mcs_tree = proto_item_add_subtree(ti, ett_vht_tx_mcsbit_tree);
11023   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11024   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11025   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11026   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11027   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11028   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11029   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11030   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11031
11032   offset += 2;
11033   /* B48 - B60 13 bits */
11034   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11035   /* B61 - B63 2 reserved bits*/
11036
11037   offset += 2;
11038   return offset;
11039 }
11040
11041 static int
11042 dissect_vht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
11043          guint32 tag_len, proto_item *ti_len)
11044 {
11045   proto_item *cap_item;
11046   proto_tree *cap_tree;
11047
11048   if (tag_len != 12) {
11049     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11050                            "VHT Capabilities IE length %u wrong, must be = 12", tag_len);
11051     return offset;
11052   }
11053
11054   /* 4 byte VHT Capabilities  Info*/
11055   cap_item = proto_tree_add_item(tree, hf_ieee80211_vht_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11056
11057   cap_tree = proto_item_add_subtree(cap_item, ett_vht_cap_tree);
11058
11059   /* B0 - B1 2 bits */
11060   proto_tree_add_item(cap_tree, hf_ieee80211_vht_max_mpdu_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11061   /* B2 - B3 2 bits*/
11062   proto_tree_add_item(cap_tree, hf_ieee80211_vht_supported_chan_width_set, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11063
11064   /* B4 - B7 4x 1 bit fields */
11065   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_ldpc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11066   proto_tree_add_item(cap_tree, hf_ieee80211_vht_short_gi_for_80, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11067   proto_tree_add_item(cap_tree, hf_ieee80211_vht_short_gi_for_160, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11068   proto_tree_add_item(cap_tree, hf_ieee80211_vht_tx_stbc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11069
11070   /* End of first byte */
11071
11072   /* B8 - B10 3 bit field */
11073   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_stbc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11074
11075   /* B11 - B12 2x 1 bit fields */
11076   proto_tree_add_item(cap_tree, hf_ieee80211_vht_su_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11077   proto_tree_add_item(cap_tree, hf_ieee80211_vht_su_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11078
11079   /* B13 - B15 3 bit field */
11080   proto_tree_add_item(cap_tree, hf_ieee80211_vht_beamformer_antennas, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11081
11082   /* End of second byte */
11083
11084   /* B16 - B18 */
11085   proto_tree_add_item(cap_tree, hf_ieee80211_vht_sounding_dimensions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11086   /* B19 */
11087   proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11088
11089   /* B20 - B22 2x 1 bit fields */
11090   proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11091   proto_tree_add_item(cap_tree, hf_ieee80211_vht_txop_ps, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11092   proto_tree_add_item(cap_tree, hf_ieee80211_vht_var_htc_field, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11093
11094   /* B23 - B25 3 bit field which takes us 2 bits into next byte */
11095   proto_tree_add_item(cap_tree, hf_ieee80211_vht_max_ampdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11096
11097   /* B26 - B27 2 bit field */
11098   proto_tree_add_item(cap_tree, hf_ieee80211_vht_link_adaptation_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11099
11100   /* B28 - B29 2x 1 bit fields */
11101   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11102   proto_tree_add_item(cap_tree, hf_ieee80211_vht_tx_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11103
11104   /* B30 - B31 Reserved */
11105   proto_tree_add_item(cap_tree, hf_ieee80211_vht_reserv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11106
11107   offset += 4;
11108
11109   /* 8 byte MCS set */
11110   offset = dissect_vht_mcs_set(tree, tvb, offset);
11111
11112   return offset;
11113 }
11114
11115 static int
11116 dissect_vht_operation_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
11117          guint32 tag_len, proto_item *ti_len)
11118 {
11119   proto_item *op_item, *ti;
11120   proto_tree *op_tree, *basic_mcs_tree;
11121
11122   if (tag_len != 5) {
11123     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11124                            "VHT Operation IE length %u wrong, must be = 5", tag_len);
11125     return offset;
11126   }
11127
11128   /* 3 byte VHT Operation Info*/
11129   op_item = proto_tree_add_item(tree, hf_ieee80211_vht_op, tvb, offset, 3, ENC_NA);
11130   op_tree = proto_item_add_subtree(op_item, ett_vht_op_tree);
11131   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11132   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center0, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
11133   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center1, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
11134
11135   offset += 3;
11136   /* VHT Basic MCS Set */
11137   ti = proto_tree_add_item(tree, hf_ieee80211_vht_op_basic_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11138   basic_mcs_tree = proto_item_add_subtree(ti, ett_vht_basic_mcsbit_tree);
11139   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11140   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11141   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11142   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11143   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11144   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11145   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11146   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11147
11148   offset += 2;
11149
11150   return offset;
11151 }
11152
11153 static int
11154 dissect_vht_tx_pwr_envelope(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
11155     guint32 tag_len, proto_item *ti_len)
11156 {
11157   proto_item *tx_pwr_item, *ti;
11158   proto_tree *tx_pwr_info_tree;
11159   guint8 opt_ie_cnt=0;
11160   guint8 i;
11161
11162   if (tag_len < 2 || tag_len > 5) {
11163     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11164                            "VHT TX PWR Envelope IE length %u wrong, must be >= 2 and <= 5", tag_len);
11165     return offset;
11166   }
11167
11168   tx_pwr_item = proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_info, tvb, offset, 1, ENC_NA);
11169   tx_pwr_info_tree =  proto_item_add_subtree(tx_pwr_item, ett_vht_tpe_info_tree);
11170
11171   ti = proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11172   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_unit, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11173   proto_tree_add_item(tx_pwr_info_tree, hf_ieee80211_vht_tpe_pwr_info_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11174
11175   opt_ie_cnt = tvb_get_guint8(tvb, offset) & 0x07;
11176
11177   offset += 1;
11178
11179   /* Power Constraint info is mandatory only for 20MHz, others are optional*/
11180   /* Power is expressed in terms of 0.5dBm from -64 to 63 and is encoded
11181    * as 8-bit 2's compliment */
11182   for (i = 0; i <= opt_ie_cnt; i++) {
11183     switch(i) {
11184     case 0:
11185       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_20, tvb, offset, 1, ENC_NA);
11186       offset += 1;
11187       break;
11188     case 1:
11189       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_40, tvb, offset, 1, ENC_NA);
11190       offset += 1;
11191       break;
11192     case 2:
11193       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_80, tvb, offset, 1, ENC_NA);
11194       offset += 1;
11195       break;
11196     case 3:
11197       proto_tree_add_item(tree, hf_ieee80211_vht_tpe_pwr_constr_160, tvb, offset, 1, ENC_NA);
11198       offset += 1;
11199       break;
11200     default:
11201       expert_add_info(pinfo, ti, &ei_ieee80211_vht_tpe_pwr_info_count);
11202       offset += 1;
11203       break;
11204     }
11205   }
11206
11207   return offset;
11208 }
11209
11210 static void
11211 dissect_mobility_domain(proto_tree *tree, tvbuff_t *tvb, int offset,
11212                         guint32 tag_len)
11213 {
11214   if (tag_len < 3) {
11215     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11216                           "MDIE content length must be at least 3 bytes");
11217     return;
11218   }
11219
11220   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_mdid,
11221                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11222   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab,
11223                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
11224   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
11225                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
11226   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
11227                       tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
11228 }
11229
11230 static void
11231 dissect_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, int offset,
11232                             guint32 tag_len)
11233 {
11234   int end = offset + tag_len;
11235   if (tag_len < 82) {
11236     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11237                           "FTIE content length must be at least 82 bytes");
11238     return;
11239   }
11240
11241   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic_control,
11242                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11243   proto_tree_add_item(tree, hf_ieee80211_tag_ft_element_count,
11244                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11245   offset += 2;
11246   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic,
11247                       tvb, offset, 16, ENC_NA);
11248   offset += 16;
11249   proto_tree_add_item(tree, hf_ieee80211_tag_ft_anonce,
11250                       tvb, offset, 32, ENC_NA);
11251   offset += 32;
11252   proto_tree_add_item(tree, hf_ieee80211_tag_ft_snonce,
11253                       tvb, offset, 32, ENC_NA);
11254   offset += 32;
11255
11256   while (offset + 2 <= end) {
11257     guint8 id, len;
11258     int s_end;
11259     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_id,
11260                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
11261     id = tvb_get_guint8(tvb, offset);
11262     offset += 1;
11263
11264     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_len,
11265                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
11266     len = tvb_get_guint8(tvb, offset);
11267     offset += 1;
11268
11269     if (offset + len > end) {
11270       proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset,
11271                             end - offset, "Invalid FTIE subelement");
11272       return;
11273     }
11274
11275     s_end = offset + len;
11276     switch (id) {
11277     case 1:
11278       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r1kh_id,
11279                           tvb, offset, len, ENC_NA);
11280       break;
11281     case 2:
11282       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_info,
11283                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
11284       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_id,
11285                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
11286       offset += 2;
11287       if (offset > s_end)
11288         break;
11289       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_length,
11290                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
11291       offset += 1;
11292       if (offset > s_end)
11293         break;
11294       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_rsc,
11295                           tvb, offset, 8, ENC_NA);
11296       offset += 8;
11297       if (offset > s_end)
11298         break;
11299       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key,
11300                           tvb, offset, s_end - offset, ENC_NA);
11301       break;
11302     case 3:
11303       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r0kh_id,
11304                           tvb, offset, len, ENC_ASCII|ENC_NA);
11305       break;
11306     case 4:
11307       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_id,
11308                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
11309       offset += 2;
11310       if (offset > s_end)
11311         break;
11312       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_ipn,
11313                           tvb, offset, 6, ENC_NA);
11314       offset += 6;
11315       if (offset > s_end)
11316         break;
11317       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_length,
11318                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
11319       offset += 1;
11320       if (offset > s_end)
11321         break;
11322       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key,
11323                           tvb, offset, 24, ENC_NA);
11324       break;
11325     default:
11326       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_data,
11327                           tvb, offset, len, ENC_NA);
11328       break;
11329     }
11330     offset = s_end;
11331   }
11332 }
11333
11334 static void
11335 dissect_mmie(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
11336 {
11337   if (tag_len < 16) {
11338     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11339                           "MMIE content length must be at least 16 bytes");
11340     return;
11341   }
11342
11343   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11344   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
11345                       ENC_NA);
11346   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
11347                       ENC_NA);
11348 }
11349
11350 static void
11351 dissect_ssid_list(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
11352 {
11353   int end = offset + tag_len;
11354   proto_tree *entry;
11355   gboolean first = TRUE;
11356
11357   while (offset + 1 <= end) {
11358     guint8 len = tvb_get_guint8(tvb, offset + 1);
11359     guint8 *str;
11360
11361     if (offset + 2 + len > end)
11362       break;
11363
11364     str = format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, len, ENC_ASCII), len);
11365     proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
11366     first = FALSE;
11367     entry = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len, ett_ssid_list, NULL, "SSID: %s", str);
11368     proto_tree_add_item(entry, hf_ieee80211_tag_number, tvb, offset, 1,
11369                         ENC_LITTLE_ENDIAN);
11370     offset++;
11371     proto_tree_add_uint(entry, hf_ieee80211_tag_length, tvb, offset, 1, len);
11372     offset++;
11373     proto_tree_add_item(entry, hf_ieee80211_tag_ssid, tvb, offset, len,
11374                         ENC_ASCII|ENC_NA);
11375     offset += len;
11376   }
11377 }
11378
11379 static void
11380 dissect_link_identifier(proto_tree *tree, tvbuff_t *tvb, int offset,
11381                         guint32 tag_len)
11382 {
11383   if (tag_len < 18) {
11384     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11385                           "Link Identifier content length must be at least "
11386                           "18 bytes");
11387     return;
11388   }
11389
11390   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_bssid, tvb,
11391                       offset, 6, ENC_NA);
11392   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_init_sta, tvb,
11393                       offset + 6, 6, ENC_NA);
11394   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_resp_sta, tvb,
11395                       offset + 12, 6, ENC_NA);
11396 }
11397
11398 static void
11399 dissect_wakeup_schedule(proto_tree *tree, tvbuff_t *tvb, int offset,
11400                         guint32 tag_len)
11401 {
11402   if (tag_len < 18) {
11403     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11404                           "Wakeup Schedule content length must be at least "
11405                           "18 bytes");
11406     return;
11407   }
11408
11409   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_offset, tvb,
11410                       offset, 4, ENC_LITTLE_ENDIAN);
11411   offset += 4;
11412
11413   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_interval, tvb,
11414                       offset, 4, ENC_LITTLE_ENDIAN);
11415   offset += 4;
11416
11417   proto_tree_add_item(tree,
11418                       hf_ieee80211_tag_wakeup_schedule_awake_window_slots, tvb,
11419                       offset, 4, ENC_LITTLE_ENDIAN);
11420   offset += 4;
11421
11422   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
11423                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
11424   offset += 4;
11425
11426   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_idle_count, tvb,
11427                       offset, 2, ENC_LITTLE_ENDIAN);
11428 }
11429
11430 static void
11431 dissect_channel_switch_timing(proto_tree *tree, tvbuff_t *tvb, int offset,
11432                               guint32 tag_len)
11433 {
11434   if (tag_len < 4) {
11435     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11436                           "Channel Switch Timing content length must be at "
11437                           "least 4 bytes");
11438     return;
11439   }
11440
11441   proto_tree_add_item(tree, hf_ieee80211_tag_channel_switch_timing_switch_time,
11442                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11443   offset += 2;
11444
11445   proto_tree_add_item(tree,
11446                       hf_ieee80211_tag_channel_switch_timing_switch_timeout,
11447                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11448 }
11449
11450 static void
11451 dissect_pti_control(proto_tree *tree, tvbuff_t *tvb, int offset,
11452                     guint32 tag_len)
11453 {
11454   if (tag_len < 3) {
11455     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11456                           "PTI Control content length must be at least "
11457                           "3 bytes");
11458     return;
11459   }
11460
11461   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_tid, tvb,
11462                       offset, 1, ENC_LITTLE_ENDIAN);
11463   offset += 1;
11464
11465   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_sequence_control, tvb,
11466                       offset, 2, ENC_LITTLE_ENDIAN);
11467 }
11468
11469 static void
11470 dissect_pu_buffer_status(proto_tree *tree, tvbuff_t *tvb, int offset,
11471                          guint32 tag_len)
11472 {
11473   if (tag_len < 1) {
11474     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
11475                           "PU Buffer Status content length must be at least "
11476                           "1 byte");
11477     return;
11478   }
11479
11480   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_bk, tvb,
11481                       offset, 1, ENC_LITTLE_ENDIAN);
11482   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_be, tvb,
11483                       offset, 1, ENC_LITTLE_ENDIAN);
11484   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_vi, tvb,
11485                       offset, 1, ENC_LITTLE_ENDIAN);
11486   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_vo, tvb,
11487                       offset, 1, ENC_LITTLE_ENDIAN);
11488 }
11489
11490 static void
11491 dissect_timeout_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
11492                          guint32 tag_len)
11493 {
11494   proto_item *pi;
11495
11496   pi = proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_type, tvb,
11497                            offset, 1, ENC_LITTLE_ENDIAN);
11498   if (tag_len < 5) {
11499     expert_add_info_format(pinfo, pi, &ei_ieee80211_tag_length,
11500                            "Timeout Interval content length must be at least "
11501                           "5 bytes");
11502     return;
11503   }
11504
11505   proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_value, tvb,
11506                       offset + 1, 4, ENC_LITTLE_ENDIAN);
11507 }
11508
11509 static int
11510 dissect_ric_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
11511                          guint32 tag_len, proto_item *ti, proto_item *ti_len, int ftype)
11512 {
11513
11514   proto_tree  *sub_tree;
11515   guint8       desc_cnt = 0;
11516   guint32      next_ie;
11517   int          offset_r = 0;
11518
11519   if (tag_len !=  4)  {
11520     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11521                            "RIC Data Length must be 4 bytes");
11522     return 0;
11523   }
11524
11525   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_id, tvb,
11526                            offset, 1, ENC_LITTLE_ENDIAN);
11527   offset += 1;
11528
11529   desc_cnt = tvb_get_guint8(tvb,offset);
11530   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_desc_cnt, tvb,
11531                            offset, 1, ENC_LITTLE_ENDIAN);
11532   offset += 1;
11533
11534   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_status_code, tvb,
11535                            offset, 2, ENC_LITTLE_ENDIAN);
11536   offset += 2;
11537
11538   /* Our Design is such that all the Resource request IE's part of the RIC
11539    * must be in the sub tree of RIC for better readability
11540    * Even omnipeek does the same way.
11541    */
11542   sub_tree = proto_item_add_subtree(tree, ett_tag_ric_data_desc_ie);
11543
11544   proto_item_append_text(ti, " :Resource Descriptor List");
11545   if (desc_cnt == 0) {
11546     proto_item_append_text(ti, " :0 (Weird?)");
11547   }
11548
11549   while ( desc_cnt !=0 ) {
11550
11551     next_ie = tvb_get_guint8(tvb,offset);
11552     proto_item_append_text(ti, " :(%d:%s)", desc_cnt,val_to_str_ext(next_ie, &tag_num_vals_ext, "Reserved (%d)"));
11553     /* Recursive call to avoid duplication of code*/
11554     offset_r = add_tagged_field(pinfo, sub_tree, tvb, offset, ftype);
11555     if (offset_r == 0 )/* should never happen, returns a min of 2*/
11556       break;
11557     /* This will ensure that the IE after RIC is processed
11558      * only once. This gives us a good looking RIC IE :-)
11559      */
11560     tag_len += offset_r;
11561     desc_cnt--;
11562   }
11563
11564   return tag_len;
11565 }
11566
11567 static int
11568 dissect_ric_descriptor(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
11569                          guint32 tag_len, proto_item *ti, proto_item *ti_len)
11570 {
11571
11572   guint8       rsrc_type = 0;
11573
11574   if (tag_len < 1)  {
11575     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11576                            "RIC Data Length must be at least 1 byte");
11577     return 0;
11578   }
11579
11580   rsrc_type = tvb_get_guint8(tvb,offset);
11581   proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_rsrc_type, tvb,
11582                            offset, 1, ENC_LITTLE_ENDIAN);
11583   offset += 1;
11584
11585   if (rsrc_type == 1) {
11586     /* Block ACK params
11587      * 802.11-2012: 8.4.2.53 RIC Descriptor element
11588      * Block Ack parameter set as defined in 8.4.1.14,
11589      * Block Ack timeout value as defined in 8.4.1.15, and
11590      * Block Ack starting sequence control as defined in 8.3.1.8
11591      */
11592     /* TODO: Still figuring out how to parse these ones,
11593      * need a sample capture with at least HEX Dump
11594      */
11595     proto_item_append_text(ti, " : Block ACK Params");
11596     proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_var_params, tvb,
11597                         offset, tag_len-1, ENC_NA);
11598     offset += tag_len -1;
11599   }else {
11600     /* 0,2-255 are reserved*/
11601     proto_item_append_text(ti, " :Reserved (type != 1)");
11602   }
11603   return offset;
11604 }
11605
11606 static int
11607 dissect_ext_bss_load(proto_tree *tree, tvbuff_t *tvb, int offset)
11608 {
11609   proto_tree_add_item(tree, hf_ieee80211_ext_bss_mu_mimo_capable_sta_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11610   offset += 2;
11611   proto_tree_add_item(tree, hf_ieee80211_ext_bss_ss_underutilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11612   offset += 1;
11613   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_20mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11614   offset += 1;
11615   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_40mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11616   offset += 1;
11617   proto_tree_add_item(tree, hf_ieee80211_ext_bss_observable_sec_80mhz_utilization, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11618   offset += 1;
11619
11620   return offset;
11621 }
11622
11623
11624 static int
11625 dissect_wide_bw_channel_switch(proto_tree *tree, tvbuff_t *tvb, int offset)
11626 {
11627
11628   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11629   offset += 1;
11630   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11631   offset += 1;
11632   proto_tree_add_item(tree, hf_ieee80211_wide_bw_new_channel_center_freq_segment1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11633   offset += 1;
11634
11635   return offset;
11636 }
11637 static int
11638 dissect_channel_switch_wrapper(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
11639                          guint32 tag_len)
11640 {
11641   int tmp_sublen;
11642
11643   /*
11644   Decode three subelement in IE-196(Channel Switch Wrapper element):
11645         (1) New Country subelement
11646         (2) Wide Bandwidth Channel Switch subelement
11647         (3) New VHT Transmit Power Envelope subelement
11648   */
11649   while (tag_len > 0){
11650         tmp_sublen = tvb_get_guint8(tvb, offset + 1);
11651         if(add_tagged_field(pinfo, tree, tvb, offset, 0) == 0){
11652           break;
11653         }
11654         tag_len -= (tmp_sublen + 2);
11655         offset += (tmp_sublen + 2);
11656   }
11657   return offset;
11658 }
11659
11660 static int
11661 dissect_operating_mode_notification(proto_tree *tree, tvbuff_t *tvb, int offset)
11662 {
11663   proto_item *ti;
11664   proto_tree *bit_tree;
11665
11666   /* Operating Mode field */
11667   ti = proto_tree_add_item(tree, hf_ieee80211_operat_notification_mode, tvb, offset, 1, ENC_NA);
11668   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
11669   proto_tree_add_item(bit_tree, hf_ieee80211_operat_mode_field_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11670   proto_tree_add_item(bit_tree, hf_ieee80211_operat_mode_field_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11671   proto_tree_add_item(bit_tree, hf_ieee80211_operat_mode_field_rxnss, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11672   proto_tree_add_item(bit_tree, hf_ieee80211_operat_mode_field_rxnsstype, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11673
11674   offset += 1;
11675
11676   return offset;
11677 }
11678
11679 static int
11680 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vendorspecific)
11681 {
11682   proto_item *ti;
11683   proto_tree *mcs_tree, *bit_tree;
11684   guint8 rx_nss, tx_nss; /* 0-4 for HT and 0-8 for VHT*/
11685   guint32 value_mcs_0_31, value_mcs_32_52, value_mcs_53_76;
11686   guint16 tx_mcs_set;
11687   rx_nss = tx_nss = 8;
11688   /* 16 byte Supported MCS set */
11689   if (vendorspecific)
11690   {
11691     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset_vs, tvb, offset, 16,
11692       basic ? "Basic MCS Set" : "MCS Set");
11693   } else
11694   {
11695     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset, tvb, offset, 16,
11696       basic ? "Basic MCS Set" : "MCS Set");
11697   }
11698   mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
11699
11700   /* Rx MCS Bitmask */
11701   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_rx_bitmask, tvb, offset, 10, ENC_NA);
11702   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
11703
11704   /* Bits 0 - 31 */
11705   value_mcs_0_31 = tvb_get_letohl(tvb, offset);
11706
11707   /* Handle all zeroes/ff's case..*/
11708   if (value_mcs_0_31 != 0x0)
11709   {
11710     if (!(value_mcs_0_31 & (0xffffff00))) {
11711       /*
11712        * At least one MCS from 0-7 is supported, but no MCS from 8-31 are
11713        * supported, so only 1 spatial stream is supported.
11714        */
11715       rx_nss = 0;
11716     } else if (!(value_mcs_0_31 & (0xffff0000))) {
11717       /*
11718        * At least one MCS from 8-15 is supported, but no MCS from 16-31 are
11719        * supported, so only 2 spatial streams are supported.
11720        */
11721       rx_nss = 1;
11722     } else if (!(value_mcs_0_31 & (0xff000000))) {
11723       /*
11724        * At least one MCS from 16-23 is supported, but no MCS from 24-31 are
11725        * supported, so only 3 spatial streams are supported.
11726        */
11727       rx_nss = 2;
11728     } else {
11729       /*
11730        * At least one MCS from 24-31 is supported, so 4 spatial streams
11731        * are supported.
11732        */
11733       rx_nss = 3;
11734     }
11735   }
11736
11737   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_0to7, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11738   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_8to15, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11739   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_16to23, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11740   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_24to31, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11741   offset += 4;
11742
11743   /* Should be we check UEQM Supported?*/
11744   /* Bits 32 - 52 */
11745   value_mcs_32_52 = tvb_get_letohl(tvb, offset);
11746   if (!(value_mcs_32_52 & (0x1ffffe))) {
11747     /*
11748      * MCS 33-52 aren't supported, so the number of spatial streams we get
11749      * from whichever MCSes from 0-31 that we support is the total number
11750      * of spatial streams we support.
11751      */
11752     ;
11753   } else if (!(value_mcs_32_52 & (0x1fff80))) {
11754     /*
11755      * At least one MCS from 33-38 is supported, but no MCS from 39-52 is
11756      * supported, so we have at least 2 spatial streams, but none of the
11757      * MCSs in that range give us any more.
11758      */
11759     rx_nss = MAX(1,rx_nss);
11760   } else {
11761     /*
11762      * At least one MCS from 39-52 is supported, so we have at least 3
11763      * spatial streams.
11764      */
11765     rx_nss = MAX(2,rx_nss);
11766   }
11767
11768   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_32, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11769   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_33to38, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11770   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_39to52, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11771   offset += 2;
11772
11773   /* Bits 53 - 76 */
11774   value_mcs_53_76 = tvb_get_letohl(tvb, offset);
11775   if ((value_mcs_53_76 & (0x1fffffe0))) {
11776     /*
11777      * At least one MCS from 53-76 is supported, so we have at least 4
11778      * spatial streams.
11779      */
11780     rx_nss = MAX(3,rx_nss);
11781   }
11782
11783   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_53to76, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11784   offset += 4;
11785
11786   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_highest_data_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11787   offset += 2;
11788
11789   /* Follow table 8-126 from 802.11-2012 */
11790   tx_mcs_set = tvb_get_letohs(tvb,offset);
11791
11792   if (!(tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
11793   {
11794     /* TX MCS Set is not defined
11795      * so there is no interpretation for Max Tx Spatial Streams
11796      */
11797      tx_nss = 4; /* Not Defined*/
11798   }
11799
11800   if ((tx_mcs_set & 0x0001) && !(tx_mcs_set & 0x0002))
11801   {
11802     /* TX MCS Set is defined to be equal to Rx MCS Set
11803      * So, get the Max Spatial Streams from Rx
11804      * MCS set
11805      */
11806      tx_nss = rx_nss;
11807   }
11808   proto_item_append_text(ti, ": %s",val_to_str(rx_nss,mcsset_tx_max_spatial_streams_flags,"Reserved:%d" ) );
11809
11810   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_mcs_set_defined, tvb, offset, 1,
11811       ENC_LITTLE_ENDIAN);
11812   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal, tvb, offset, 1,
11813       ENC_LITTLE_ENDIAN);
11814   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_max_spatial_streams, tvb, offset, 1,
11815       ENC_LITTLE_ENDIAN);
11816   proto_item_append_text(ti, ", %s",val_to_str(tx_nss,mcsset_tx_max_spatial_streams_flags,"Reserved:%d" ) );
11817   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_unequal_modulation, tvb, offset, 1,
11818       ENC_LITTLE_ENDIAN);
11819   offset += 1;
11820
11821   offset += 3;
11822   return offset;
11823 }
11824
11825 /*  802.11n D1.10 - HT Information IE  */
11826 static int
11827 dissect_ht_info_ie_1_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
11828                        guint32 tag_len, proto_item *ti_len)
11829 {
11830   proto_item *cap_item;
11831   proto_tree *cap_tree;
11832
11833   cap_tree = tree;
11834
11835   if (tag_len < 22) {
11836     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11837                            "HT Information IE content length %u wrong, must be at least 22 bytes", tag_len);
11838     return offset;
11839   }
11840
11841
11842   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_primary_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11843   offset += 1;
11844
11845   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter1, tvb,
11846                     offset, 1, ENC_LITTLE_ENDIAN);
11847   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter1_tree);
11848   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_secondary_channel_offset, tvb,
11849                     offset, 1, ENC_LITTLE_ENDIAN);
11850   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_channel_width, tvb,
11851                     offset, 1, ENC_LITTLE_ENDIAN);
11852   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_rifs_mode, tvb,
11853                     offset, 1, ENC_LITTLE_ENDIAN);
11854   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_psmp_stas_only, tvb,
11855                     offset, 1, ENC_LITTLE_ENDIAN);
11856   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_service_interval_granularity, tvb,
11857                     offset, 1, ENC_LITTLE_ENDIAN);
11858   offset += 1;
11859
11860   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter2, tvb,
11861                     offset, 2, ENC_LITTLE_ENDIAN);
11862   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter2_tree);
11863   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_operating_mode, tvb,
11864                     offset, 1, ENC_LITTLE_ENDIAN);
11865   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_non_greenfield_sta_present, tvb,
11866                     offset, 1, ENC_LITTLE_ENDIAN);
11867   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_transmit_burst_limit, tvb,
11868                     offset, 1, ENC_LITTLE_ENDIAN);
11869   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_obss_non_ht_stas_present, tvb,
11870                     offset, 1, ENC_LITTLE_ENDIAN);
11871   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_1, tvb,
11872                     offset, 2, ENC_LITTLE_ENDIAN);
11873   offset += 2;
11874
11875   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter3, tvb,
11876                     offset, 2, ENC_LITTLE_ENDIAN);
11877   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter3_tree);
11878   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_2, tvb,
11879                     offset, 1, ENC_LITTLE_ENDIAN);
11880   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_dual_beacon, tvb,
11881                     offset, 1, ENC_LITTLE_ENDIAN);
11882   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_dual_cts_protection, tvb,
11883                     offset, 1, ENC_LITTLE_ENDIAN);
11884   offset += 1;
11885   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_secondary_beacon, tvb,
11886                     offset, 1, ENC_LITTLE_ENDIAN);
11887   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_lsig_txop_protection_full_support, tvb,
11888                     offset, 1, ENC_LITTLE_ENDIAN);
11889   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_pco_active, tvb,
11890                     offset, 1, ENC_LITTLE_ENDIAN);
11891   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_pco_phase, tvb,
11892                     offset, 1, ENC_LITTLE_ENDIAN);
11893   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_3, tvb,
11894                     offset, 1, ENC_LITTLE_ENDIAN);
11895   offset += 1;
11896
11897   offset = dissect_mcs_set(tree, tvb, offset, TRUE, FALSE);
11898
11899   return offset;
11900 }
11901
11902
11903 static int
11904 dissect_wapi_param_set(tvbuff_t *tvb, packet_info *pinfo,
11905                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
11906                           proto_item *ti, int ftype)
11907 {
11908   /* Parse the WAPI Parameter Set IE Here*/
11909   proto_item *item;
11910   proto_tree *subtree;
11911   guint16 loop_cnt, version, akm_cnt  = 1, ucast_cnt = 1, bkid_cnt = 1;
11912   guint8  akm_suite_type = 0, ucast_cipher_type = 0, mcast_cipher_type = 0;
11913
11914   version = tvb_get_letohs(tvb, offset);
11915   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11916   offset += 2;
11917
11918   /*MIN: 2 + (2+4)+ (2+4) + 4 + 2 + 0 (BKID CNT and LIST)  =20*/
11919   if (tag_len < 20) {
11920       expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11921                 "tag_len is  %d, it's neither WAPI not BSS-AC-Access-Delay", tag_len);
11922     return offset;
11923   }
11924
11925   if (version != 1) {
11926     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
11927                            "Version of WAPI protocol is %d, must be = 1", version);
11928     return offset;
11929   }
11930
11931   /* AKM Suites: list can't be 0*/
11932   akm_cnt = tvb_get_letohs(tvb, offset);
11933   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_akm_suite_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11934   offset += 2;
11935   if (akm_cnt != 0) {
11936     proto_item_append_text(ti, " : AKM Suite List:");
11937     for (loop_cnt = 0; loop_cnt < akm_cnt; loop_cnt++) {
11938       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_akm_tree);
11939       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_oui, tvb, offset, 3, ENC_NA);
11940       offset += 3;
11941       akm_suite_type = tvb_get_guint8(tvb,offset);
11942       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11943       offset += 1;
11944       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1,val_to_str(akm_suite_type,
11945       ieee80211_wapi_suite_type_short,"Reserved: %d"));
11946     }
11947     proto_item_append_text(ti, " /");
11948   } else {
11949     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of AKM suites is 0, must be min 1");
11950     return offset;
11951
11952   }
11953   /* Unicast Cipher Suites: list can't be 0*/
11954   ucast_cnt = tvb_get_letohs(tvb, offset);
11955   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
11956                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
11957   offset += 2;
11958   if (ucast_cnt != 0) {
11959     proto_item_append_text(ti, " Unicast Cipher List:");
11960     for (loop_cnt = 0; loop_cnt < ucast_cnt; loop_cnt++) {
11961       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_ucast_tree);
11962       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
11963       offset += 3;
11964       ucast_cipher_type = tvb_get_guint8(tvb,offset);
11965       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11966       offset += 1;
11967       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(ucast_cipher_type,ieee80211_wapi_cipher_type,"Reserved: %d"));
11968     }
11969   proto_item_append_text(ti, " /");
11970   } else {
11971     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Number of Unicast Cipher suites is 0, must be min 1");
11972     return offset;
11973
11974   }
11975
11976   /* Multicast Cipher Suites*/
11977   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
11978   offset += 3;
11979   mcast_cipher_type = tvb_get_guint8(tvb,offset);
11980   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11981   offset += 1;
11982   proto_item_append_text(ti, " Multicast Cipher: %s", val_to_str(mcast_cipher_type,ieee80211_wapi_cipher_type,"Reserved: %d"));
11983
11984   /* WAPI capability*/
11985   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_capab, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11986   subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_preauth_tree);
11987   proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_capab_preauth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11988   proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_capab_rsvd, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11989
11990   offset += 2;
11991   /* BKID List: The list can be 0
11992    * Applicable only for assoc/re-assoc
11993    */
11994   if (ftype == MGT_ASSOC_REQ || ftype == MGT_REASSOC_REQ ) {
11995     bkid_cnt = tvb_get_letohs(tvb, offset);
11996     proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11997     offset += 2;
11998     if (bkid_cnt != 0) {
11999       for (loop_cnt = 0; loop_cnt < bkid_cnt; loop_cnt++) {
12000         proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_list, tvb, offset, 16, ENC_NA);
12001         offset += 16;
12002       }
12003     }
12004   }
12005   return offset;
12006 }
12007
12008 static int dissect_bss_max_idle_period(proto_tree *tree, tvbuff_t *tvb,
12009                                        int offset)
12010 {
12011   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_period,
12012                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12013   offset += 2;
12014   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_options_protected,
12015                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12016   offset++;
12017   return offset;
12018 }
12019
12020 enum tfs_request_subelem_id {
12021   TFS_REQ_SUBELEM_TFS = 1,
12022   TFS_REQ_SUBELEM_VENDOR_SPECIFIC = 221
12023 };
12024
12025 static const value_string tfs_request_subelem_ids[] = {
12026   { TFS_REQ_SUBELEM_TFS, "TFS subelement" },
12027   { TFS_REQ_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
12028   { 0, NULL }
12029 };
12030
12031 static int dissect_tfs_request(packet_info *pinfo, proto_tree *tree,
12032                                tvbuff_t *tvb, int offset, guint32 tag_len,
12033                                int ftype)
12034 {
12035   int end = offset + tag_len;
12036
12037   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_id,
12038                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12039   offset++;
12040   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_delete_after_match,
12041                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12042   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_notify,
12043                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12044   offset++;
12045   if (offset + 1 >= end) {
12046     expert_add_info_format(pinfo, tree, &ei_ieee80211_missing_data,
12047                            "No TFS Request subelements in TFS Request");
12048     return end;
12049   }
12050
12051   while (offset + 1 < end) {
12052     guint8 id, len;
12053     int s_offset, s_end;
12054
12055     id = tvb_get_guint8(tvb, offset);
12056     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_id,
12057                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12058     offset++;
12059     len = tvb_get_guint8(tvb, offset);
12060     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_len,
12061                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12062     offset++;
12063     if (offset + len > end) {
12064       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
12065                              "Not enough data for TFS Request subelement");
12066       return end;
12067     }
12068     switch (id) {
12069     case TFS_REQ_SUBELEM_TFS:
12070       s_offset = offset;
12071       s_end = offset + len;
12072       while (s_offset < s_end) {
12073         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, ftype);
12074         if (tlen==0)
12075           break;
12076         s_offset += tlen;
12077       }
12078       break;
12079     default:
12080       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem,
12081                           tvb, offset, len, ENC_NA);
12082       break;
12083     }
12084     offset += len;
12085   }
12086
12087   if (offset < end) {
12088     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
12089                            tvb, offset, end - offset, "Extra data after TFS Subelements");
12090   }
12091
12092   return end;
12093 }
12094
12095 enum tfs_response_subelem_id {
12096   TFS_RESP_SUBELEM_TFS_STATUS = 1,
12097   TFS_RESP_SUBELEM_TFS = 2,
12098   TFS_RESP_SUBELEM_VENDOR_SPECIFIC = 221
12099 };
12100
12101 static const value_string tfs_response_subelem_ids[] = {
12102   { TFS_RESP_SUBELEM_TFS_STATUS, "TFS Status subelement" },
12103   { TFS_RESP_SUBELEM_TFS, "TFS subelement" },
12104   { TFS_RESP_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
12105   { 0, NULL }
12106 };
12107
12108 static int dissect_tfs_response(packet_info *pinfo, proto_tree *tree,
12109                                 tvbuff_t *tvb, int offset, guint32 tag_len,
12110                                 int ftype)
12111 {
12112   int end = offset + tag_len;
12113
12114   while (offset + 3 <= end) {
12115     guint8 id, len;
12116     int s_offset, s_end;
12117
12118     id = tvb_get_guint8(tvb, offset);
12119     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_id,
12120                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12121     offset++;
12122     len = tvb_get_guint8(tvb, offset);
12123     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_len,
12124                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12125     offset++;
12126     if (offset + len > end) {
12127       expert_add_info_format(pinfo, tree, &ei_ieee80211_tag_length,
12128                              "Not enough data for TFS Request subelement");
12129       return end;
12130     }
12131     switch (id) {
12132     case TFS_RESP_SUBELEM_TFS_STATUS:
12133       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_status,
12134                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
12135       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_id,
12136                           tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
12137       break;
12138     case TFS_RESP_SUBELEM_TFS:
12139       s_offset = offset;
12140       s_end = offset + len;
12141       while (s_offset < s_end) {
12142         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, ftype);
12143         if (tlen==0)
12144           break;
12145         s_offset += tlen;
12146       }
12147       break;
12148     default:
12149       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem,
12150                           tvb, offset, len, ENC_NA);
12151       break;
12152     }
12153
12154     offset += len;
12155   }
12156
12157   if (offset < end) {
12158     proto_tree_add_expert_format(tree, pinfo, &ei_ieee80211_extra_data,
12159                            tvb, offset, end - offset, "Extra data after TFS Subelements");
12160   }
12161
12162   return end;
12163 }
12164
12165 static const value_string wnm_sleep_mode_action_types[] = {
12166   { 0, "Enter WNM-Sleep Mode" },
12167   { 1, "Exit WNM-Sleep Mode" },
12168   { 0, NULL }
12169 };
12170
12171 static const value_string wnm_sleep_mode_response_status_vals[] = {
12172   { 0, "Enter/Exit WNM-Sleep Mode Accept" },
12173   { 1, "Exit WNM-Sleep Mode Accept, GTK/IGTK update required" },
12174   { 2, "Denied. The AP is unable to perform the requested action." },
12175   { 3, "Denied temporarily. The AP is unable to perform the requested action "
12176     "at the current time. The request can be submitted again at a later time."
12177   },
12178   { 4, "Denied. Due to the pending key expiration." },
12179   { 5, "Denied. The requested action was not granted due to other WNM services "
12180     "in use by the requesting STA." },
12181   { 0, NULL }
12182 };
12183
12184 static int dissect_wnm_sleep_mode(proto_tree *tree, tvbuff_t *tvb, int offset)
12185 {
12186   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_action_type,
12187                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12188   offset++;
12189   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_response_status,
12190                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12191   offset++;
12192   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_interval,
12193                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
12194   offset += 2;
12195   return offset;
12196 }
12197
12198 static const value_string time_adv_timing_capab_vals[] = {
12199   { 0, "No standardized external time source" },
12200   { 1, "Timestamp offset based on UTC" },
12201   { 2, "UTC time at which the TSF timer is 0" },
12202   { 0, NULL }
12203 };
12204
12205 static int
12206 dissect_time_adv(proto_tree *tree, tvbuff_t *tvb, int offset)
12207 {
12208   guint8 capab;
12209   proto_item *item;
12210   proto_tree *subtree;
12211   struct tm tm, *now;
12212   time_t t;
12213
12214   capab = tvb_get_guint8(tvb, offset);
12215   proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_timing_capab,
12216                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
12217   offset += 1;
12218
12219   switch (capab) {
12220   case 1:
12221     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
12222                         tvb, offset, 10, ENC_NA);
12223     offset += 10;
12224
12225     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
12226                         tvb, offset, 5, ENC_NA);
12227     offset += 5;
12228     break;
12229   case 2:
12230     item = proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
12231                                tvb, offset, 10, ENC_NA);
12232     subtree = proto_item_add_subtree(item, ett_tag_time_adv_tree);
12233     memset(&tm, 0, sizeof(tm));
12234     tm.tm_year = tvb_get_letohs(tvb, offset) - 1900;
12235     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_year,
12236                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
12237     offset += 2;
12238     tm.tm_mon = tvb_get_guint8(tvb, offset) - 1;
12239     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_month,
12240                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12241     offset += 1;
12242     tm.tm_mday = tvb_get_guint8(tvb, offset);
12243     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_day,
12244                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12245     offset += 1;
12246     tm.tm_hour = tvb_get_guint8(tvb, offset);
12247     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_hours,
12248                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12249     offset += 1;
12250     tm.tm_min = tvb_get_guint8(tvb, offset);
12251     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_minutes,
12252                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12253     offset += 1;
12254     tm.tm_sec = tvb_get_guint8(tvb, offset);
12255     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_seconds,
12256                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12257     offset += 1;
12258     proto_tree_add_item(subtree,
12259                         hf_ieee80211_tag_time_adv_time_value_milliseconds,
12260                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
12261     offset += 2;
12262     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_reserved,
12263                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12264     offset += 1;
12265
12266     tm.tm_isdst = -1;
12267     t = mktime(&tm);
12268     if (t != -1) {
12269       t += (time_t)(last_timestamp / 1000000);
12270       now = localtime(&t);
12271       if (now)
12272         proto_item_append_text(item,
12273                                ": current time=%u-%02u-%02u %02u:%02u:%02u",
12274                                now->tm_year + 1900, now->tm_mon + 1,
12275                                now->tm_mday, now->tm_hour, now->tm_min,
12276                                now->tm_sec);
12277     }
12278
12279     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
12280                         tvb, offset, 5, ENC_NA);
12281     offset += 5;
12282
12283     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_update_counter,
12284                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
12285     offset += 1;
12286     break;
12287   }
12288
12289   return offset;
12290 }
12291
12292 static int
12293 dissect_time_zone(proto_tree *tree, tvbuff_t *tvb, int offset,
12294                   guint32 tag_len)
12295 {
12296   proto_tree_add_item(tree, hf_ieee80211_tag_time_zone, tvb, offset, tag_len,
12297                       ENC_ASCII|ENC_NA);
12298   return offset + tag_len;
12299 }
12300
12301 static int
12302 dissect_ap_channel_report(tvbuff_t *tvb, packet_info *pinfo,
12303                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
12304                           int tag_end, proto_item *ti)
12305 {
12306   if (tag_len < 1) {
12307     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12308                            "AP Channel Report length %u wrong, must be > 1", tag_len);
12309     return offset;
12310   }
12311
12312   proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_operating_class, tvb,
12313                       offset, 1, ENC_LITTLE_ENDIAN);
12314   proto_item_append_text(ti, ": Operating Class %u, Channel List :", tvb_get_guint8(tvb, offset));
12315   offset += 1;
12316
12317   while (offset < tag_end)
12318   {
12319     proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_channel_list, tvb, offset, 1, ENC_NA);
12320     proto_item_append_text(ti, " %u,", tvb_get_guint8(tvb, offset));
12321     offset += 1;
12322   }
12323   return offset;
12324 }
12325
12326
12327 static int
12328 dissect_secondary_channel_offset_ie(tvbuff_t *tvb, packet_info *pinfo,
12329                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12330 {
12331
12332   if (tag_len != 1) {
12333     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12334                            "Secondary Channel Offset length %u wrong, must be = 1", tag_len);
12335     return offset;
12336   }
12337
12338   proto_tree_add_item(tree, hf_ieee80211_tag_secondary_channel_offset, tvb,
12339                       offset, 1, ENC_LITTLE_ENDIAN);
12340
12341   offset += 1;
12342
12343   return offset;
12344 }
12345
12346 static int
12347 dissect_bss_avg_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
12348                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12349 {
12350
12351   if (tag_len != 1) {
12352     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12353                            "BSS Average Access Delay length %u wrong, must be = 1", tag_len);
12354     return offset;
12355   }
12356
12357   proto_tree_add_item(tree, hf_ieee80211_tag_bss_ap_avg_access_delay, tvb,
12358                       offset, 1, ENC_LITTLE_ENDIAN);
12359
12360   offset += 1;
12361
12362   return offset;
12363 }
12364
12365 static int
12366 dissect_antenna_ie(tvbuff_t *tvb, packet_info *pinfo,
12367                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12368 {
12369
12370   if (tag_len != 1) {
12371     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12372                            "Antenna length %u wrong, must be = 1", tag_len);
12373     return offset;
12374   }
12375
12376   proto_tree_add_item(tree, hf_ieee80211_tag_antenna_id, tvb,
12377                       offset, 1, ENC_LITTLE_ENDIAN);
12378
12379   offset += 1;
12380
12381   return offset;
12382 }
12383
12384 static int
12385 dissect_rsni_ie(tvbuff_t *tvb, packet_info *pinfo,
12386                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12387 {
12388
12389   if (tag_len != 1) {
12390     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12391                            "RSNI length %u wrong, must be = 1", tag_len);
12392     return offset;
12393   }
12394
12395   proto_tree_add_item(tree, hf_ieee80211_tag_rsni, tvb,
12396                       offset, 1, ENC_LITTLE_ENDIAN);
12397
12398   offset += 1;
12399
12400   return offset;
12401 }
12402
12403 static int
12404 dissect_bss_available_admission_capacity_ie(tvbuff_t *tvb, packet_info *pinfo,
12405                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12406 {
12407   proto_item *ti;
12408   proto_tree *btree;
12409   guint16 bitmask;
12410   if (tag_len < 2) {
12411     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12412                            "BSS Available Admission Capacity length %u wrong, must > = 2", tag_len);
12413     return offset;
12414   }
12415
12416   ti = proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask, tvb,
12417                       offset, 2, ENC_LITTLE_ENDIAN);
12418   btree = proto_item_add_subtree(ti, ett_tag_bss_bitmask_tree);
12419   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12420   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12421   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12422   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12423   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12424   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12425   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12426   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12427   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12428   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12429   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12430   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12431   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12432   bitmask = tvb_get_letohs(tvb, offset);
12433   offset += 2;
12434
12435   if(bitmask & BSS_BITMASK_UP0)
12436   {
12437     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12438     offset += 2;
12439   }
12440   if(bitmask & BSS_BITMASK_UP1)
12441   {
12442     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12443     offset += 2;
12444   }
12445   if(bitmask & BSS_BITMASK_UP2)
12446   {
12447     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12448     offset += 2;
12449   }
12450   if(bitmask & BSS_BITMASK_UP3)
12451   {
12452     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12453     offset += 2;
12454   }
12455   if(bitmask & BSS_BITMASK_UP4)
12456   {
12457     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12458     offset += 2;
12459   }
12460   if(bitmask & BSS_BITMASK_UP5)
12461   {
12462     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12463     offset += 2;
12464   }
12465   if(bitmask & BSS_BITMASK_UP6)
12466   {
12467     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12468     offset += 2;
12469   }
12470   if(bitmask & BSS_BITMASK_UP7)
12471   {
12472     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12473     offset += 2;
12474   }
12475   if(bitmask & BSS_BITMASK_AC0)
12476   {
12477     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12478     offset += 2;
12479   }
12480   if(bitmask & BSS_BITMASK_AC1)
12481   {
12482     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12483     offset += 2;
12484   }
12485   if(bitmask & BSS_BITMASK_AC2)
12486   {
12487     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12488     offset += 2;
12489   }
12490   if(bitmask & BSS_BITMASK_AC3)
12491   {
12492     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12493     offset += 2;
12494   }
12495   return offset;
12496 }
12497
12498 static int
12499 dissect_bss_ac_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
12500                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
12501 {
12502
12503   if (tag_len == 4) {
12504     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12505                            "BSS AC Access Delay length %u wrong, must = 4", tag_len);
12506     return offset;
12507   }
12508
12509   /* TODO: Display the scaled representation of the average
12510     medium access delay (a big (precalculed) value_string ?)
12511     See 8.4.2.46 BSS AC Access Delay element ... */
12512
12513   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_be, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12514   offset += 1;
12515   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_bk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12516   offset += 1;
12517   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12518   offset += 1;
12519   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vo, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12520   offset += 1;
12521
12522   return offset;
12523 }
12524
12525 static int
12526 dissect_rm_enabled_capabilities_ie(packet_info *pinfo, proto_tree *tree,
12527                          proto_item *ti, proto_item *ti_len,
12528                          guint32 tag_len, tvbuff_t *tvb,
12529                          int offset, int tag_end _U_)
12530 {
12531   proto_item *ti_ex_cap;
12532   proto_tree *ex_cap_tree;
12533
12534   if (tag_len != 5)
12535   {
12536     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "RM Enabled Capabilities length %u wrong, must = 4", tag_len);
12537     return offset;
12538   }
12539   proto_item_append_text(ti, " (%d octets)", tag_len);
12540
12541   /* RM Enabled Capability octet 1 */
12542   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12543   proto_item_append_text(ti_ex_cap, " (octet 1)");
12544   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap1);
12545   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b0, tvb, offset, 1, ENC_NA);
12546   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b1, tvb, offset, 1, ENC_NA);
12547   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b2, tvb, offset, 1, ENC_NA);
12548   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b3, tvb, offset, 1, ENC_NA);
12549   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b4, tvb, offset, 1, ENC_NA);
12550   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b5, tvb, offset, 1, ENC_NA);
12551   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b6, tvb, offset, 1, ENC_NA);
12552   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b7, tvb, offset, 1, ENC_NA);
12553   offset += 1;
12554
12555   /* RM Enabled Capability octet 2 */
12556   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12557   proto_item_append_text(ti_ex_cap, " (octet 2)");
12558   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap2);
12559   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b8, tvb, offset, 1, ENC_NA);
12560   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b9, tvb, offset, 1, ENC_NA);
12561   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b10, tvb, offset, 1, ENC_NA);
12562   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b11, tvb, offset, 1, ENC_NA);
12563   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b12, tvb, offset, 1, ENC_NA);
12564   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b13, tvb, offset, 1, ENC_NA);
12565   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b14, tvb, offset, 1, ENC_NA);
12566   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b15, tvb, offset, 1, ENC_NA);
12567   offset += 1;
12568
12569   /* RM Enabled Capability octet 3 */
12570   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12571   proto_item_append_text(ti_ex_cap, " (octet 3)");
12572   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap3);
12573   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b16, tvb, offset, 1, ENC_NA);
12574   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b17, tvb, offset, 1, ENC_NA);
12575   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b18to20, tvb, offset, 1, ENC_NA);
12576   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b21to23, tvb, offset, 1, ENC_NA);
12577   offset += 1;
12578
12579   /* RM Enabled Capability octet 4 */
12580   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12581   proto_item_append_text(ti_ex_cap, " (octet 4)");
12582   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap4);
12583   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b24to26, tvb, offset, 1, ENC_NA);
12584   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b27, tvb, offset, 1, ENC_NA);
12585   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b28, tvb, offset, 1, ENC_NA);
12586   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b29, tvb, offset, 1, ENC_NA);
12587   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b30, tvb, offset, 1, ENC_NA);
12588   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b31, tvb, offset, 1, ENC_NA);
12589   offset += 1;
12590
12591   /* RM Enabled Capability octet 5 */
12592   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
12593   proto_item_append_text(ti_ex_cap, " (octet 5)");
12594   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap5);
12595   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b32, tvb, offset, 1, ENC_NA);
12596   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b33, tvb, offset, 1, ENC_NA);
12597   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_o5, tvb, offset, 1, ENC_NA);
12598   offset += 1;
12599
12600   return offset;
12601 }
12602
12603 static int
12604 dissect_ht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
12605                          guint32 tag_len, proto_item *ti_len, gboolean vendorspecific)
12606 {
12607   proto_item *cap_item, *ti;
12608   proto_tree *cap_tree;
12609
12610   if (tag_len != 26) {
12611     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12612                            "HT Capabilities IE length %u wrong, must be = 26", tag_len);
12613     return offset;
12614   }
12615
12616   if (wlan_ignore_draft_ht && vendorspecific)
12617     return offset;
12618
12619   /* 2 byte HT Capabilities  Info*/
12620   if (vendorspecific)
12621   {
12622     cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_vs_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12623   }
12624   else
12625   {
12626     cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12627   }
12628   cap_tree = proto_item_add_subtree(cap_item, ett_ht_cap_tree);
12629   proto_tree_add_item(cap_tree, hf_ieee80211_ht_ldpc_coding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12630   proto_tree_add_item(cap_tree, hf_ieee80211_ht_chan_width, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12631   proto_tree_add_item(cap_tree, hf_ieee80211_ht_sm_pwsave, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12632   proto_tree_add_item(cap_tree, hf_ieee80211_ht_green, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12633   proto_tree_add_item(cap_tree, hf_ieee80211_ht_short20, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12634   proto_tree_add_item(cap_tree, hf_ieee80211_ht_short40, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12635   proto_tree_add_item(cap_tree, hf_ieee80211_ht_tx_stbc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12636
12637   proto_tree_add_item(cap_tree, hf_ieee80211_ht_rx_stbc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12638   proto_tree_add_item(cap_tree, hf_ieee80211_ht_delayed_block_ack, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12639   proto_tree_add_item(cap_tree, hf_ieee80211_ht_max_amsdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12640   proto_tree_add_item(cap_tree, hf_ieee80211_ht_dss_cck_40, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12641   proto_tree_add_item(cap_tree, hf_ieee80211_ht_psmp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12642   proto_tree_add_item(cap_tree, hf_ieee80211_ht_40_mhz_intolerant, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12643   proto_tree_add_item(cap_tree, hf_ieee80211_ht_l_sig, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12644   offset += 2;
12645
12646   /* 1 byte A-MPDU Parameters */
12647   if (vendorspecific)
12648   {
12649     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12650   } else
12651   {
12652     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12653   }
12654   cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
12655   ti = proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12656   proto_item_append_text(ti, " (%04.0f[Bytes])",pow(2,13+(tvb_get_guint8(tvb, offset) & 0x3))-1);
12657   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu_start_spacing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12658   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12659   offset += 1;
12660
12661   /* 16 byte MCS set */
12662   offset = dissect_mcs_set(tree, tvb, offset, FALSE, vendorspecific);
12663
12664
12665   /* 2 byte HT Extended Capabilities */
12666   if (vendorspecific)
12667   {
12668     cap_item = proto_tree_add_item(tree, hf_ieee80211_htex_vs_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12669   } else {
12670     cap_item = proto_tree_add_item(tree, hf_ieee80211_htex_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12671   }
12672   cap_tree = proto_item_add_subtree(cap_item, ett_htex_cap_tree);
12673   proto_tree_add_item(cap_tree, hf_ieee80211_htex_pco, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12674   proto_tree_add_item(cap_tree, hf_ieee80211_htex_transtime, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12675
12676   proto_tree_add_item(cap_tree, hf_ieee80211_htex_mcs, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12677   proto_tree_add_item(cap_tree, hf_ieee80211_htex_htc_support, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12678   proto_tree_add_item(cap_tree, hf_ieee80211_htex_rd_responder, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12679   offset += 2;
12680
12681
12682   /* 4 byte TxBF capabilities */
12683   if (vendorspecific)
12684   {
12685     cap_item = proto_tree_add_item(tree, hf_ieee80211_txbf_vs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12686   } else {
12687     cap_item = proto_tree_add_item(tree, hf_ieee80211_txbf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12688   }
12689   cap_tree = proto_item_add_subtree(cap_item, ett_txbf_tree);
12690   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12691   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_rcv_ssc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12692   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_tx_ssc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12693   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_rcv_ndp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12694   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_tx_ndp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12695   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_impl_txbf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12696   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_calib, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12697
12698   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_csi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12699   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_uncomp_fm, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12700   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_comp_fm, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12701   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_bf_csi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12702   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_uncomp_fm_feed, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12703   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_comp_fm_feed, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12704
12705   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_min_group, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12706   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_csi_num_bf_ant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12707   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_uncomp_sm_bf_ant, tvb, offset, 4,  ENC_LITTLE_ENDIAN);
12708   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_comp_sm_bf_ant, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12709
12710   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_csi_max_rows_bf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12711   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_chan_est, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12712   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_resrv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12713   offset += 4;
12714
12715   /* 1 byte Antenna Selection (ASEL) capabilities */
12716   if (vendorspecific)
12717   {
12718     cap_item = proto_tree_add_item(tree, hf_ieee80211_antsel_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12719   }
12720   else
12721   {
12722     cap_item = proto_tree_add_item(tree, hf_ieee80211_antsel, tvb,  offset, 1, ENC_LITTLE_ENDIAN);
12723   }
12724   cap_tree = proto_item_add_subtree(cap_item, ett_antsel_tree);
12725   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12726   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12727   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12728   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b3, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12729   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b4, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12730   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b5, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12731   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b6, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12732   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b7, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12733
12734   offset += 1;
12735
12736   return offset;
12737 }
12738
12739 static int
12740 dissect_ht_info_ie_1_0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
12741                        guint32 tag_len, proto_item *ti_len)
12742 {
12743   proto_item *cap_item;
12744   proto_tree *cap_tree;
12745
12746   if (tag_len != 22) {
12747     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
12748                            "Tag length %u wrong, must be = 22", tag_len);
12749     return offset;
12750   }
12751
12752   if (wlan_ignore_draft_ht)
12753     return offset;
12754
12755   /* 1 HT Control Channel */
12756   proto_tree_add_item(tree, hf_ieee80211_hta_cc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12757   offset += 1;
12758
12759   /* 1 byte HT additional capabilities */
12760   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 1,
12761              ENC_LITTLE_ENDIAN);
12762   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap_tree);
12763
12764   proto_tree_add_item(cap_tree, hf_ieee80211_hta_ext_chan_offset, tvb, offset, 1,
12765              ENC_LITTLE_ENDIAN);
12766   proto_tree_add_item(cap_tree, hf_ieee80211_hta_rec_tx_width, tvb, offset, 1,
12767              ENC_LITTLE_ENDIAN);
12768   proto_tree_add_item(cap_tree, hf_ieee80211_hta_rifs_mode, tvb, offset, 1,
12769              ENC_LITTLE_ENDIAN);
12770   proto_tree_add_item(cap_tree, hf_ieee80211_hta_controlled_access, tvb, offset, 1,
12771              ENC_LITTLE_ENDIAN);
12772   proto_tree_add_item(cap_tree, hf_ieee80211_hta_service_interval, tvb, offset, 1,
12773              ENC_LITTLE_ENDIAN);
12774   offset += 1;
12775
12776   /* 2 byte HT additional capabilities */
12777   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 2,
12778              ENC_LITTLE_ENDIAN);
12779   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap1_tree);
12780
12781   proto_tree_add_item(cap_tree, hf_ieee80211_hta_operating_mode, tvb, offset, 2,
12782              ENC_LITTLE_ENDIAN);
12783   proto_tree_add_item(cap_tree, hf_ieee80211_hta_non_gf_devices, tvb, offset, 2,
12784              ENC_LITTLE_ENDIAN);
12785
12786   offset += 2;
12787
12788   /* 2 byte HT additional capabilities */
12789   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 2,
12790              ENC_LITTLE_ENDIAN);
12791   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap2_tree);
12792
12793   proto_tree_add_item(cap_tree, hf_ieee80211_hta_basic_stbc_mcs, tvb, offset, 2,
12794              ENC_LITTLE_ENDIAN);
12795   proto_tree_add_item(cap_tree, hf_ieee80211_hta_dual_stbc_protection, tvb, offset, 2,
12796              ENC_LITTLE_ENDIAN);
12797   proto_tree_add_item(cap_tree, hf_ieee80211_hta_secondary_beacon, tvb, offset, 2,
12798              ENC_LITTLE_ENDIAN);
12799   proto_tree_add_item(cap_tree, hf_ieee80211_hta_lsig_txop_protection, tvb, offset, 2,
12800              ENC_LITTLE_ENDIAN);
12801   proto_tree_add_item(cap_tree, hf_ieee80211_hta_pco_active, tvb, offset, 2,
12802              ENC_LITTLE_ENDIAN);
12803   proto_tree_add_item(cap_tree, hf_ieee80211_hta_pco_phase, tvb, offset, 2,
12804              ENC_LITTLE_ENDIAN);
12805   offset += 2;
12806
12807   /* 16 byte Supported MCS set */
12808   offset = dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
12809
12810   return offset;
12811 }
12812
12813 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
12814
12815 /*
12816  * 8.2.4.1.10 "Order field" says:
12817  *
12818  *  The Order field is 1 bit in length. It is used for two purposes:
12819  *
12820  *    -- It is set to 1 in a non-QoS data frame transmitted by a non-QoS
12821  *       STA to indicate that the frame contains an MSDU, or fragment
12822  *       thereof, that is being transferred using the StrictlyOrdered
12823  *       service class.
12824  *
12825  *    -- It is set to 1 in a QoS data or management frame transmitted
12826  *       with a value of HT_GF or HT_MF for the FORMAT parameter of the
12827  *       TXVECTOR to indicate that the frame contains an HT Control field.
12828  *
12829  * 802.11ac changes the second of those clauses to say "HT_GF, HT_MF,
12830  * or VHT", indicates that bit B0 of the field is 0 for HT and 1 for
12831  * VHT (stealing a reserved bit from the Link Adaptation Control field),
12832  * and that everything except for "AC Constraint" and "RDG/More Cowbell^W
12833  * PPDU" is different for the VHT version.
12834  *
12835  * I read the second clause of 8.2.4.1.10 "Order field", as modified by
12836  * 802.11ac, as meaning that, for QoS data and management frames, the
12837  * Order field will *only* be set to 1 for HT or VHT frames, and therefore
12838  * that we do *not* have to determine, from radio metadata, whether the
12839  * frame was transmitted as an HT or VHT frame.
12840  *
12841  * (See bug 11351, in which a frame with an HT Control field, with a
12842  * radiotap header, lacks the MCS or VHT fields in the radiotap header,
12843  * so Wireshark has no clue that it's an HT or VHT field, and misdissected
12844  * the packet.  Omnipeek, which also appeared to have no clue that it was
12845  * an HT or VHT field - it called it an 802.11b frame - *did* dissect the
12846  * HT Control field.)
12847  */
12848
12849 static void
12850 dissect_ht_control(proto_tree *tree, tvbuff_t *tvb, int offset)
12851 {
12852   proto_item *ti;
12853   proto_tree *htc_tree, *lac_subtree, *mfb_subtree;
12854   guint32 htc;
12855
12856   htc = tvb_get_letohl(tvb, offset);
12857
12858   ti = proto_tree_add_item(tree, hf_ieee80211_htc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12859   htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
12860
12861   /* Check the HT vs. VHT bit. */
12862   proto_tree_add_item(htc_tree, hf_ieee80211_htc_vht, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12863   if (htc & HTC_VHT) {
12864     /* VHT */
12865     proto_tree_add_item(htc_tree, hf_ieee80211_htc_mrq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12866     if (!(htc & HTC_UNSOLICITED_MFB)) {
12867       if (htc & HTC_MRQ) {
12868         proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12869       } else {
12870         proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12871       }
12872       proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfsi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12873     } else {
12874       if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
12875         proto_tree_add_item(htc_tree, hf_ieee80211_htc_compressed_msi, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12876         proto_tree_add_item(htc_tree, hf_ieee80211_htc_ppdu_stbc_encoded, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12877       } else {
12878         proto_tree_add_item(htc_tree, hf_ieee80211_htc_msi_stbc_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12879       }
12880       proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_l, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12881     }
12882     ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12883     mfb_subtree = proto_item_add_subtree(ti, ett_mfb_subtree);
12884     proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_num_sts, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12885     proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_vht_mcs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12886     proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_bw, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12887     /* This should be converted to dB by adding 22  */
12888     proto_tree_add_item(mfb_subtree, hf_ieee80211_htc_snr, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12889     if (!HTC_NO_FEEDBACK_PRESENT(HTC_MFB(htc))) {
12890       proto_tree_add_item(htc_tree, hf_ieee80211_htc_gid_h, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12891       proto_tree_add_item(htc_tree, hf_ieee80211_htc_coding_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12892       proto_tree_add_item(htc_tree, hf_ieee80211_htc_fb_tx_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12893     } else {
12894       proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved3, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12895     }
12896     proto_tree_add_item(htc_tree, hf_ieee80211_htc_unsolicited_mfb, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12897   } else {
12898     /* Start: Link Adaptation Control */
12899     ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_lac, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12900     lac_subtree = proto_item_add_subtree(ti, ett_lac_subtree);
12901     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_trq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12902
12903     if (HTC_IS_ASELI(htc)) {
12904       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_aseli, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12905     } else {
12906       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_mrq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12907       if (HTC_LAC_MAI_MRQ(htc)) {
12908         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_msi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12909       } else {
12910         proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12911       }
12912     }
12913
12914     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12915
12916     if (HTC_IS_ASELI(htc)) {
12917       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12918       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_data, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12919     } else {
12920       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12921     }
12922     /* End: Link Adaptation Control */
12923
12924     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_pos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12925     proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_seq, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12926     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12927     proto_tree_add_item(htc_tree, hf_ieee80211_htc_csi_steering, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12928
12929     proto_tree_add_item(htc_tree, hf_ieee80211_htc_ndp_announcement, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12930     proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12931   }
12932   proto_tree_add_item(htc_tree, hf_ieee80211_htc_ac_constraint, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12933   proto_tree_add_item(htc_tree, hf_ieee80211_htc_rdg_more_ppdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12934
12935   /* offset += 2; */
12936 }
12937
12938 static void
12939 dissect_frame_control(proto_tree *tree, tvbuff_t *tvb, gboolean wlan_broken_fc,
12940                       guint32 offset, packet_info *pinfo)
12941 {
12942   guint16 fcf, flags, frame_type_subtype;
12943   proto_tree *fc_tree, *flag_tree;
12944   proto_item *fc_item, *flag_item, *hidden_item, *ti;
12945
12946   fcf = FETCH_FCF(offset);
12947
12948   flags = FCF_FLAGS(fcf);
12949   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
12950
12951   /* Swap offset... */
12952   if(wlan_broken_fc)
12953   {
12954     offset += 1;
12955   }
12956
12957   proto_tree_add_uint(tree, hf_ieee80211_fc_frame_type_subtype, tvb, offset, 1, frame_type_subtype);
12958
12959   fc_item = proto_tree_add_item(tree, hf_ieee80211_fc_field, tvb, offset, 2, ENC_BIG_ENDIAN);
12960
12961   fc_tree = proto_item_add_subtree(fc_item, ett_fc_tree);
12962
12963   proto_tree_add_item(fc_tree, hf_ieee80211_fc_proto_version, tvb, offset, 1, ENC_NA);
12964   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_type, tvb, offset, 1, ENC_NA);
12965   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_subtype, tvb, offset, 1, ENC_NA);
12966   /* Changing control frame extension for extension frames */
12967   if(IS_FRAME_EXTENSION(fcf) == 1) {
12968     proto_tree_add_uint (fc_tree, hf_ieee80211_fc_frame_extension, tvb, offset, 1, FCF_FRAME_EXTENSION (fcf));
12969   }
12970   offset += 1;
12971
12972   /* Reswap offset...*/
12973   if(wlan_broken_fc)
12974   {
12975     offset -= 1;
12976     proto_item_append_text(fc_item, "(Swapped)");
12977   }
12978
12979   /* Flags */
12980   flag_item = proto_tree_add_item(fc_tree, hf_ieee80211_fc_flags, tvb, offset, 1, ENC_NA);
12981   flag_tree = proto_item_add_subtree (flag_item, ett_proto_flags);
12982   /* Changing control frame flags for extension frames */
12983   if(IS_FRAME_EXTENSION(fcf) == 0) {
12984     proto_tree_add_item (flag_tree, hf_ieee80211_fc_data_ds, tvb, offset, 1, ENC_NA);
12985     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_to_ds, tvb, offset, 1, ENC_NA);
12986     PROTO_ITEM_SET_HIDDEN(hidden_item);
12987     hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_from_ds, tvb, offset, 1, ENC_NA);
12988     PROTO_ITEM_SET_HIDDEN(hidden_item);
12989     proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_frag, tvb, offset, 1,ENC_NA);
12990     ti = proto_tree_add_item(flag_tree, hf_ieee80211_fc_retry, tvb, offset, 1, ENC_NA);
12991     if( IS_RETRY(flags) )
12992     {
12993       expert_add_info(pinfo, ti, &ei_ieee80211_fc_retry);
12994     }
12995   }
12996   proto_tree_add_item(flag_tree, hf_ieee80211_fc_pwr_mgt, tvb, offset, 1, ENC_NA);
12997   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_data, tvb, offset, 1, ENC_NA);
12998   /* Changing control frame flags for extension frames */
12999   if(IS_FRAME_EXTENSION(fcf) == 0) {
13000     proto_tree_add_item(flag_tree, hf_ieee80211_fc_protected, tvb, offset, 1,ENC_NA);
13001   }
13002   proto_tree_add_item(flag_tree, hf_ieee80211_fc_order, tvb, offset, 1, ENC_NA);
13003 }
13004
13005 static void
13006 dissect_durid(proto_tree *hdr_tree, tvbuff_t *tvb, guint16 fts, gint offset)
13007 {
13008   guint16 durid = tvb_get_letohs(tvb, offset);
13009
13010   if (durid < 0x8000) {
13011     proto_tree_add_uint_format_value(hdr_tree, hf_ieee80211_did_duration, tvb,
13012       offset, 2, durid, "%u microseconds", durid);
13013   } else if (((durid & 0xC000) == 0xC000) &&
13014              ((durid & 0x3FFF) > 0) && ((durid & 0x3FFF) <= 2007) &&
13015              (fts == CTRL_PS_POLL)) {
13016     proto_tree_add_item(hdr_tree, hf_ieee80211_assoc_id, tvb, offset, 2,
13017       ENC_LITTLE_ENDIAN);
13018   } else if (durid == 0x8000) {
13019     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
13020       offset, 2, durid, "Duration/ID: %u", durid);
13021   } else {
13022     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
13023       offset, 2, durid, "Duration/ID: %u (reserved)", durid & 0x3FFF);
13024   }
13025 }
13026
13027
13028 static void
13029 dissect_vendor_ie_ht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
13030                     guint offset, proto_item *item, proto_item *ti_len, gint tag_len)
13031 {
13032
13033   guint8 type;
13034
13035   proto_tree_add_item(tree, hf_ieee80211_ht_pren_type, tvb, offset, 1, ENC_NA);
13036   type = tvb_get_guint8(tvb, offset);
13037   offset += 1;
13038   tag_len -= 1;
13039
13040
13041   switch(type){
13042     case 51:
13043       dissect_ht_capability_ie(tvb, pinfo, tree, offset, tag_len, ti_len, TRUE);
13044       proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
13045     break;
13046
13047     case 52:
13048       dissect_ht_info_ie_1_0(tvb, pinfo, tree, offset, tag_len, ti_len);
13049       proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
13050     break;
13051
13052     default:
13053       proto_tree_add_item(tree, hf_ieee80211_ht_pren_unknown, tvb, offset, tag_len, ENC_NA);
13054     break;
13055   }
13056
13057 }
13058
13059 static guint
13060 dissect_interworking(packet_info *pinfo, proto_tree *tree, proto_item *item,
13061                      tvbuff_t *tvb, int offset)
13062 {
13063   guint8 len;
13064
13065   offset += 1;
13066   len = tvb_get_guint8(tvb, offset);
13067   offset += 1;
13068
13069   if ((tvb_reported_length_remaining(tvb, offset) < len) || (len == 0)) {
13070     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13071                            "Truncated Interworking element");
13072     return offset;
13073   }
13074
13075   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_access_network_type,
13076                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13077   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_internet,
13078                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13079   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_asra,
13080                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13081   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_esr,
13082                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13083   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_uesa,
13084                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13085   offset += 1;
13086
13087   if ((len == (1 + 2)) || (len == (1 + 2 + 6))) {
13088     dissect_venue_info(tree, tvb, offset);
13089     offset += 2;
13090   }
13091
13092   if ((len == (1 + 6)) || (len == (1 + 2 + 6))) {
13093     proto_tree_add_item(tree, hf_ieee80211_tag_interworking_hessid,
13094                         tvb, offset, 6, ENC_NA);
13095     offset += 6;
13096   }
13097
13098   if ((len != 1) && (len != (1 + 2)) && (len != (1 + 6)) && (len != (1 + 2 + 6))) {
13099     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13100                            "Invalid Interworking element length");
13101   }
13102
13103   return offset;
13104 }
13105
13106 static guint
13107 dissect_qos_map_set(packet_info *pinfo, proto_tree *tree, proto_item *item,
13108                     tvbuff_t *tvb, int offset)
13109 {
13110   guint8 len, left;
13111   guint8 val, val2;
13112   int i;
13113   proto_item *dscp_item;
13114   proto_tree *dscp_tree;
13115
13116   offset++;
13117   len = tvb_get_guint8(tvb, offset);
13118   offset++;
13119
13120   if (tvb_reported_length_remaining(tvb, offset) < len || len < 16 || len & 1) {
13121     expert_add_info_format(pinfo, item, &ei_ieee80211_bad_length,
13122                                 "Truncated QoS Map Set element");
13123     return 2 + len;
13124   }
13125
13126   left = len - 16;
13127   while (left >= 2) {
13128     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_dscp_exc,
13129                                     tvb, offset, 2, ENC_NA);
13130     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
13131
13132     item = proto_tree_add_item(dscp_tree,
13133                                hf_ieee80211_tag_qos_map_set_dscp_exc_val,
13134                                tvb, offset, 1, ENC_NA);
13135     val = tvb_get_guint8(tvb, offset);
13136     if (val > 63 && val != 255) {
13137       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
13138                                   "Invalid DSCP Value");
13139     }
13140     offset++;
13141
13142     item = proto_tree_add_item(dscp_tree,
13143                                hf_ieee80211_tag_qos_map_set_dscp_exc_up,
13144                                tvb, offset, 1, ENC_NA);
13145     val2 = tvb_get_guint8(tvb, offset);
13146     if (val2 > 7) {
13147       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
13148                                   "Invalid User Priority");
13149     }
13150     offset++;
13151
13152     proto_item_append_text(dscp_item, " (0x%02x: UP %u)", val, val2);
13153
13154     left -= 2;
13155   }
13156
13157   for (i = 0; i < 8; i++) {
13158     dscp_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_map_set_range,
13159                                     tvb, offset, 2, ENC_NA);
13160     dscp_tree = proto_item_add_subtree(dscp_item, ett_qos_map_set_exception);
13161
13162     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_low,
13163                                tvb, offset, 1, ENC_NA);
13164     val = tvb_get_guint8(tvb, offset);
13165     if (val > 63 && val != 255) {
13166       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
13167                                   "Invalid DSCP Value");
13168     }
13169     offset++;
13170
13171     item = proto_tree_add_item(dscp_tree, hf_ieee80211_tag_qos_map_set_high,
13172                                tvb, offset, 1, ENC_NA);
13173     val2 = tvb_get_guint8(tvb, offset);
13174     if ((val2 > 63 && val2 != 255) || val2 < val ||
13175         (val == 255 && val2 != 255) || (val != 255 && val2 == 255)) {
13176       expert_add_info_format(pinfo, item, &ei_ieee80211_inv_val,
13177                                   "Invalid DSCP Value");
13178     }
13179     offset++;
13180
13181     if (val == 255 && val2 == 255) {
13182       proto_item_append_text(dscp_item, " (UP %u not in use)", i);
13183     } else {
13184       proto_item_append_text(dscp_item, " (0x%02x-0x%02x: UP %u)",
13185                              val, val2, i);
13186     }
13187   }
13188
13189   return 2 + len;
13190 }
13191
13192 static guint
13193 dissect_roaming_consortium(packet_info *pinfo, proto_tree *tree,
13194                            proto_item *item, tvbuff_t *tvb, int offset)
13195 {
13196   guint8 len, oi_lens, oi1_len, oi2_len;
13197   int end;
13198
13199   offset += 1;
13200   len = tvb_get_guint8(tvb, offset);
13201   offset += 1;
13202   end = offset + len;
13203
13204   if ((tvb_reported_length_remaining(tvb, offset) < len) || (len < 2)) {
13205     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13206                            "Truncated Roaming Consortium element");
13207     return 2 + len;
13208   }
13209
13210   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
13211                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13212   offset += 1;
13213
13214   oi_lens = tvb_get_guint8(tvb, offset);
13215   oi1_len = oi_lens & 0x0f;
13216   oi2_len = (oi_lens & 0xf0) >> 4;
13217   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1_len,
13218                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13219   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2_len,
13220                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13221   offset += 1;
13222
13223   if (offset + oi1_len > end) {
13224     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13225                            "Truncated Roaming Consortium element");
13226     return 2 + len;
13227   }
13228
13229   item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1,
13230                              tvb, offset, oi1_len, ENC_NA);
13231   add_manuf(item, tvb, offset);
13232   offset += oi1_len;
13233
13234   if (offset + oi2_len > end) {
13235     expert_add_info_format(pinfo, item, &ei_ieee80211_tag_length,
13236                            "Truncated Roaming Consortium element");
13237     return 2 + len;
13238   }
13239
13240   if (oi2_len > 0) {
13241     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2,
13242                         tvb, offset, oi2_len, ENC_NA);
13243     offset += oi2_len;
13244   }
13245
13246   if (end > offset) {
13247     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi3,
13248                         tvb, offset, end - offset, ENC_NA);
13249   }
13250
13251   return 2 + len;
13252 }
13253
13254
13255 /* ************************************************************************* */
13256 /*           Dissect and add tagged (optional) fields to proto tree          */
13257 /* ************************************************************************* */
13258
13259 static int beacon_padding = 0; /* beacon padding bug */
13260
13261 static int
13262 ieee80211_tag_ssid(packet_info *pinfo, proto_tree *tree,
13263                    proto_item *ti, proto_item *ti_len,
13264                    guint32 tag_len, tvbuff_t *tvb, int offset)
13265 {
13266   /* 7.3.2.1 SSID element (0) */
13267   gchar *ssid; /* The SSID may consist of arbitrary bytes */
13268   gint ssid_len = tag_len;
13269
13270   if (beacon_padding != 0) /* padding bug */
13271     return offset;
13272
13273   if (ssid_len > MAX_SSID_LEN) {
13274     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13275                            "SSID length (%u) greater than maximum (%u)",
13276                            ssid_len, MAX_SSID_LEN);
13277     ssid_len = MAX_SSID_LEN;
13278   }
13279
13280   /*
13281    * XXX - the 802.11 specs aren't particularly clear on how the SSID
13282    * is to be interpreted.
13283    *
13284    * IEEE Std 802.11-1999, section 7.3.2.2 "Service Set Identity (SSID)
13285    * element" says just
13286    *
13287    *    The length of the SSID information field is between 0 and 32
13288    *    octets. A 0 length information field indicates the broadcast SSID.
13289    *
13290    * with no indication that those octets encode a string.
13291    *
13292    * IEEE Std 802.11-2012, section 8.4.2.2 "SSID element", says that *but*
13293    * says after it
13294    *
13295    *    When the UTF-8 SSID subfield of the Extended Capabilities element
13296    *    is equal to 1 in the frame that includes the SSID element, the
13297    *    SSID is interpreted using UTF-8 encoding.
13298    *
13299    *    NOTE -- This is true for Beacon and Probe Response frames when the
13300    *    MLME-START.request primitive was issued with the SSIDEncoding
13301    *    parameter equal to UTF8.
13302    *
13303    * and the SSIDEncoding parameter can either be UNSPECIFIED or UTF8.
13304    *
13305    * So I *guess* that means that, if the UTF-8 SSID subfield isn't
13306    * equal to 1, the SSID is, in theory, just a bunch of octets, but
13307    * in practice, *probably* ASCII as that's the typical convention,
13308    * and, if it is equal to 1, it's a UTF-8 string.  (Of course, a
13309    * host can put anything there it wants to, so we shouldn't just
13310    * assume that it's *valid* ASCII or *valid* UTF-8.)
13311    *
13312    * So we really should extract it as an array of ssid_len bytes,
13313    * pass those bytes to AirPDcapSetLastSSID(), and:
13314    *
13315    *    If the UTF-8 SSID subfield isn't set to 1, put the SSID in
13316    *    as an ENC_ASCII string;
13317    *
13318    *    If the UTF-8 SSID subfield is set to 1, put it in as an
13319    *    ENC_UTF_8 string;
13320    *
13321    * and rely on the libwireshark core code to somehow deal with
13322    * non-ASCII characters or invalid UTF-8 sequences or valid-but-
13323    * not-all-printable ASCII or UTF-8 strings in the protocol tree
13324    * display.  I'm not sure we can currently rely on it to handle
13325    * invalid UTF-8 or non-printable characters in UTF-8 strings,
13326    * however, so we just treat it as ASCII for now.
13327    *
13328    * We also need a better way of getting the display format of a
13329    * string value, so we can do something other than run it through
13330    * format_text(), which won't handle UTF-8.
13331    */
13332   ssid = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, ssid_len, ENC_ASCII);
13333   if (ssid_len == (gint)tag_len) {
13334     AirPDcapSetLastSSID(&airpdcap_ctx, (CHAR *) ssid, ssid_len);
13335   }
13336   proto_tree_add_item(tree, hf_ieee80211_tag_ssid, tvb, offset + 2, tag_len,
13337                       ENC_ASCII|ENC_NA);
13338
13339   if (ssid_len > 0) {
13340     proto_item_append_text(ti, ": %s", format_text(ssid, ssid_len));
13341
13342     col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", format_text(ssid, ssid_len));
13343
13344     /* Wlan Stats */
13345     memcpy(wlan_stats.ssid, ssid, MIN(ssid_len, MAX_SSID_LEN));
13346     wlan_stats.ssid_len = ssid_len;
13347   } else {
13348     proto_item_append_text(ti, ": Broadcast");
13349
13350     col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Broadcast");
13351   }
13352
13353   beacon_padding += 1; /* padding bug */
13354
13355   return offset + 2 + tag_len;
13356 }
13357
13358 static int
13359 dissect_neighbor_report(tvbuff_t *tvb, packet_info *pinfo,
13360                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
13361                           int tag_end, proto_item *ti _U_)
13362 {
13363
13364   guint8 sub_tag_id;
13365   guint32 sub_tag_length;
13366   proto_item *parent_item;
13367   proto_tree *bssid_info_subtree, *bssid_info_cap_subtree, *sub_tag_tree;
13368   tvbuff_t *sub_tag_tvb = NULL;
13369
13370   if (tag_len < 13) {
13371     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13372                            "Neighbor Report length %u wrong, must be > 13", tag_len);
13373     return offset;
13374   }
13375
13376   /* tag_offset = offset; */
13377
13378   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid, tvb, offset, 6, ENC_NA);
13379   offset += 6;
13380
13381   /*** Begin: BSSID Information ***/
13382
13383   parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid_info, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13384   bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
13385
13386   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reachability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13387   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_security, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13388   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13389  parent_item = proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13390   bssid_info_cap_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_capability_tree);
13391   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13392   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13393   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13394   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13395   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13396   proto_tree_add_item(bssid_info_cap_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13397   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13398   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13399   proto_tree_add_item(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reserved, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13400   offset += 4;
13401
13402   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_ope_class, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13403   offset += 1;
13404
13405   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13406   offset += 1;
13407
13408   proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13409   offset += 1;
13410
13411   /* The Optional Subelements field format contains zero or more subelements */
13412   if (tag_len == 13){ /* tag_len == 13 => no Subelements */
13413         return offset;
13414   }
13415
13416   while (offset < tag_end)
13417   {
13418
13419     sub_tag_id = tvb_get_guint8 (tvb, offset);
13420     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_id, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13421     offset += 1;
13422
13423     sub_tag_length = tvb_get_guint8 (tvb, offset);
13424     proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_subelement_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13425     offset += 1;
13426     sub_tag_tvb = tvb_new_subset_length(tvb, offset, sub_tag_length);
13427
13428     switch (sub_tag_id) {
13429       case NR_SUB_ID_TSF_INFO:
13430         /* TODO */
13431         break;
13432       case NR_SUB_ID_MEASUREMENT_PILOT_INFO:
13433         /* TODO */
13434         break;
13435       case NR_SUB_ID_HT_CAPABILITIES:
13436         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
13437                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Capabilities");
13438         dissect_ht_capability_ie(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len, FALSE);
13439         break;
13440       case NR_SUB_ID_HT_OPERATION:
13441         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
13442                             ett_tag_neighbor_report_sub_tag_tree, NULL, "HT Information");
13443         dissect_ht_info_ie_1_1(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len);
13444         break;
13445       case NR_SUB_ID_SEC_CHANNEL_OFFSET:
13446         sub_tag_tree = proto_tree_add_subtree(tree, tvb, offset, sub_tag_length,
13447                             ett_tag_neighbor_report_sub_tag_tree, NULL, "Secondary Channel Offset");
13448         dissect_secondary_channel_offset_ie(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len);
13449         break;
13450       case NR_SUB_ID_VENDOR_SPECIFIC:
13451         default:
13452         break;
13453     }
13454
13455   offset += sub_tag_length;
13456 }
13457
13458   return offset;
13459 }
13460
13461 static int
13462 ieee80211_tag_supp_rates(packet_info *pinfo, proto_tree *tree,
13463                          proto_item *ti, proto_item *ti_len,
13464                          guint32 tag_len, tvbuff_t *tvb,
13465                          int offset, int tag_end)
13466 {
13467   /* 7.3.2.2 Supported Rates element (1) */
13468   if (tag_len < 1) {
13469     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13470                            "Tag length %u too short, must be greater than 0",
13471                            tag_len);
13472     return offset;
13473   }
13474
13475   offset += 2;
13476
13477   while (offset < tag_end) {
13478     proto_tree_add_item(tree, hf_ieee80211_tag_supp_rates, tvb, offset, 1,
13479                         ENC_LITTLE_ENDIAN);
13480     proto_item_append_text(ti, " %s,",
13481                            val_to_str_ext_const(tvb_get_guint8(tvb, offset),
13482                                                 &ieee80211_supported_rates_vals_ext,
13483                                                 "Unknown Rate"));
13484     offset += 1;
13485   }
13486
13487   proto_item_append_text(ti, " [Mbit/sec]");
13488
13489   return offset;
13490 }
13491
13492 static int
13493 ieee80211_tag_fh_parameter(packet_info *pinfo, proto_tree *tree,
13494                            proto_item *ti_len, guint32 tag_len,
13495                            tvbuff_t *tvb, int offset)
13496 {
13497   /* 7.3.2.3 FH Parameter Set element (2) */
13498   if (tag_len < 5) {
13499     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13500                            "Tag length %u too short, must be >= 5", tag_len);
13501     return offset;
13502   }
13503
13504   offset += 2;
13505
13506   proto_tree_add_item(tree, hf_ieee80211_tag_fh_dwell_time,
13507                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13508   offset += 2;
13509
13510   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_set,
13511                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13512   offset += 1;
13513
13514   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_pattern,
13515                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13516   offset += 1;
13517
13518   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_index,
13519                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13520   offset += 1;
13521
13522   return offset;
13523 }
13524
13525 static int
13526 ieee80211_tag_ds_parameter(packet_info *pinfo, proto_tree *tree,
13527                            proto_item *ti, proto_item *ti_len,
13528                            guint32 tag_len, tvbuff_t *tvb,
13529                            int offset)
13530 {
13531   /* 7.3.2.4 DS Parameter Set element (3) */
13532   if (tag_len != 1) {
13533     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13534         "Tag length %u wrong, must be = 1", tag_len);
13535     return offset;
13536   }
13537
13538   offset += 2;
13539
13540   proto_tree_add_item(tree, hf_ieee80211_tag_ds_param_channel,
13541         tvb, offset, 1, ENC_LITTLE_ENDIAN);
13542
13543   proto_item_append_text(ti, ": Current Channel: %u",
13544                          tvb_get_guint8(tvb, offset));
13545
13546   wlan_stats.channel = tvb_get_guint8(tvb, offset);
13547   offset += 1;
13548
13549   return offset;
13550 }
13551
13552 static int
13553 ieee80211_tag_cf_parameter(packet_info *pinfo, proto_tree *tree,
13554                            proto_item *ti, proto_item *ti_len,
13555                            guint32 tag_len, tvbuff_t *tvb,
13556                            int offset)
13557 {
13558   /* 7.3.2.5 CF Parameter Set element (4) */
13559   if (tag_len != 6) {
13560     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13561                            "Tag length %u wrong, must be = 6", tag_len);
13562     return offset;
13563   }
13564
13565   offset += 2;
13566
13567   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_count,
13568                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13569   proto_item_append_text(ti, ": CFP count %u", tvb_get_guint8(tvb, offset));
13570   offset += 1;
13571
13572   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_period,
13573                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13574   proto_item_append_text(ti, ": CFP Period %u", tvb_get_guint8(tvb, offset));
13575   offset += 1;
13576
13577   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_max_duration,
13578                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13579   proto_item_append_text(ti, ": CFP Max Duration %u",
13580                          tvb_get_letohs(tvb, offset));
13581   offset += 2;
13582
13583   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_dur_remaining,
13584                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13585   proto_item_append_text(ti, ": CFP Dur Remaining %u",
13586                          tvb_get_letohs(tvb, offset));
13587   offset += 1;
13588
13589   return offset;
13590 }
13591
13592 static int
13593 ieee80211_tag_tim(packet_info *pinfo, proto_tree *tree,
13594                   proto_item *ti, proto_item *ti_len,
13595                   guint32 tag_len, tvbuff_t *tvb, int offset)
13596 {
13597   proto_tree *bmapctl_tree;
13598   proto_item *bmapctl_item;
13599
13600   /* 7.3.2.6 TIM (5) */
13601   if (tag_len < 4) {
13602     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13603                            "Tag length %u too short, must be >= 4", tag_len);
13604     return offset;
13605   }
13606
13607   offset += 2;
13608
13609   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_count,
13610                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13611   proto_item_append_text(ti, ": DTIM %u of", tvb_get_guint8(tvb, offset));
13612   offset += 1;
13613
13614   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_period,
13615                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13616   proto_item_append_text(ti, " %u bitmap", tvb_get_guint8(tvb, offset + 1));
13617   offset += 1;
13618
13619   bmapctl_item = proto_tree_add_item(tree, hf_ieee80211_tim_bmapctl,
13620                                      tvb, offset, 1, ENC_LITTLE_ENDIAN);
13621   bmapctl_tree = proto_item_add_subtree(bmapctl_item, ett_tag_bmapctl_tree);
13622   proto_tree_add_item(bmapctl_tree, hf_ieee80211_tim_bmapctl_mcast,
13623                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13624   proto_tree_add_item(bmapctl_tree, hf_ieee80211_tim_bmapctl_offset,
13625                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13626   offset += 1;
13627
13628   proto_tree_add_item(tree, hf_ieee80211_tim_partial_virtual_bitmap,
13629                       tvb, offset, tag_len - 3, ENC_NA);
13630   offset += tag_len - 3;
13631
13632   return offset;
13633 }
13634
13635 static int
13636 ieee80211_tag_ibss_parameter(packet_info *pinfo, proto_tree *tree,
13637                              proto_item *ti, proto_item *ti_len,
13638                              guint32 tag_len, tvbuff_t *tvb,
13639                              int offset)
13640 {
13641   /* 7.3.2.7 IBSS Parameter Set element (6) */
13642
13643   if (tag_len != 2) {
13644     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13645                            "Tag length %u wrong, must be = 2", tag_len);
13646     return offset;
13647   }
13648
13649   offset += 2;
13650
13651   proto_tree_add_item(tree, hf_ieee80211_tag_ibss_atim_window,
13652                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
13653   proto_item_append_text(ti, ": ATIM window 0x%x",
13654                          tvb_get_letohs(tvb, offset));
13655   offset += 2;
13656
13657   return offset;
13658 }
13659
13660 static const value_string environment_vals[] = {
13661   { 0x20, "Any" },
13662   { 0x4f, "Outdoor" },
13663   { 0x49, "Indoor" },
13664   { 0,    NULL }
13665 };
13666
13667 static int
13668 ieee80211_tag_country_info(packet_info *pinfo, proto_tree *tree,
13669                            proto_item *ti, proto_item *ti_len,
13670                            guint32 tag_len, tvbuff_t *tvb,
13671                            int offset, int tag_end)
13672 {
13673   /* 7.3.2.9 Country information element (7) */
13674   proto_tree *sub_tree;
13675   proto_item *sub_item;
13676
13677   if (tag_len < 6) {
13678     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13679                            "Tag length %u too short, must be >= 6", tag_len);
13680     return offset;
13681   }
13682
13683   offset += 2;
13684
13685   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_code,
13686                       tvb, offset, 2, ENC_ASCII|ENC_NA);
13687   proto_item_append_text(ti, ": Country Code %s",
13688                          tvb_get_string_enc(wmem_packet_scope(), tvb, offset, 2, ENC_ASCII));
13689   offset += 2;
13690
13691   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_env,
13692                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13693   proto_item_append_text(ti, ", Environment %s",
13694                          val_to_str(tvb_get_guint8(tvb, offset),
13695                                     environment_vals,"Unknown (0x%02x)"));
13696   offset += 1;
13697
13698   while (offset < tag_end) {
13699     /* Padding ? */
13700     if ((tag_end - offset) < 3) {
13701       proto_tree_add_item(tree, hf_ieee80211_tag_country_info_pad,
13702                           tvb, offset, 1, ENC_NA);
13703       offset += 1;
13704       continue;
13705     }
13706     if (tvb_get_guint8(tvb, offset) <= 200) { /* 802.11d */
13707       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_fnm,
13708                                      tvb, offset, 3, ENC_NA);
13709       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_fnm_tree);
13710
13711       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_fcn,
13712                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13713       proto_item_append_text(sub_item, ": First Channel Number: %d",
13714                              tvb_get_guint8(tvb, offset));
13715       offset += 1;
13716       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_nc,
13717                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13718       proto_item_append_text(sub_item, ", Number of Channels: %d",
13719                              tvb_get_guint8(tvb, offset));
13720       offset += 1;
13721       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_mtpl,
13722                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13723       proto_item_append_text(sub_item,
13724                              ", Maximum Transmit Power Level: %d dBm",
13725                              tvb_get_guint8(tvb, offset));
13726       offset += 1;
13727     } else { /* 802.11j */
13728       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_rrc,
13729                                      tvb, offset, 3, ENC_NA);
13730       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_rcc_tree);
13731
13732       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oei,
13733                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13734       proto_item_append_text(sub_item,
13735                              ": Operating Extension Identifier: %d",
13736                              tvb_get_guint8(tvb, offset));
13737       offset += 1;
13738       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_oc,
13739                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13740       proto_item_append_text(sub_item, ", Operating Class: %d",
13741                              tvb_get_guint8(tvb, offset));
13742       offset += 1;
13743       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_cc,
13744                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
13745       proto_item_append_text(sub_item, ", Coverage Class: %d",
13746                              tvb_get_guint8(tvb, offset));
13747       offset += 1;
13748     }
13749   }
13750
13751   return offset;
13752 }
13753
13754 static int
13755 ieee80211_tag_fh_hopping_parameter(packet_info *pinfo,
13756                                    proto_tree *tree,
13757                                    proto_item *ti,
13758                                    proto_item *ti_len,
13759                                    guint32 tag_len, tvbuff_t *tvb,
13760                                    int offset)
13761 {
13762   /* 7.3.2.10 Hopping Pattern Parameters information element (8) */
13763   if (tag_len < 2) {
13764     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13765                            "Tag length %u too short, must be >= 2", tag_len);
13766     return offset;
13767   }
13768
13769   offset += 2;
13770
13771   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
13772                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13773   proto_item_append_text(ti, ": Prime Radix: %u", tvb_get_guint8(tvb, offset));
13774   offset += 1;
13775
13776   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
13777                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13778   proto_item_append_text(ti, ", Number of Channels: %u",
13779                          tvb_get_guint8(tvb, offset));
13780   offset += 1;
13781
13782   return offset;
13783 }
13784
13785 static int
13786 ieee80211_tag_fh_hopping_table(packet_info *pinfo, proto_tree *tree,
13787                                proto_item *ti_len,
13788                                guint32 tag_len, tvbuff_t *tvb,
13789                                int offset, int tag_end)
13790 {
13791   /* 7.3.2.11 Hopping Pattern Table information element (9) */
13792   if (tag_len < 4) {
13793     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13794                            "Tag length %u too short, must be >= 4", tag_len);
13795     return offset;
13796   }
13797
13798   offset += 2;
13799
13800   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_flag,
13801                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13802   offset += 1;
13803
13804   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_number_of_sets,
13805                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13806   offset += 1;
13807
13808   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_modulus,
13809                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13810   offset += 1;
13811
13812   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_offset,
13813                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
13814   offset += 1;
13815
13816   while (offset < tag_end) {
13817     proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_random_table,
13818                         tvb, offset, 2, ENC_BIG_ENDIAN);
13819     offset += 2;
13820   }
13821
13822   return offset;
13823 }
13824
13825 int
13826 add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype)
13827 {
13828   guint32       oui;
13829   tvbuff_t     *tag_tvb;
13830   const guint8 *tag_data_ptr;
13831   guint32       tag_no, tag_len;
13832   int           n, ret;
13833   char          print_buff[SHORT_STR];
13834   proto_tree   *orig_tree = tree;
13835   proto_item   *ti        = NULL;
13836   proto_item   *ti_len, *ti_tag;
13837   int           tag_end;
13838   gboolean      isDMG;
13839
13840   gboolean     *p_isDMG = ((gboolean*)(p_get_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY)));
13841
13842   isDMG   = p_isDMG ? *p_isDMG : FALSE;
13843   tag_no  = tvb_get_guint8(tvb, offset);
13844   tag_len = tvb_get_guint8(tvb, offset + 1);
13845   tag_end = offset + 2 + tag_len;
13846
13847   if (tree) {
13848     ti = proto_tree_add_item(orig_tree, hf_ieee80211_tag, tvb, offset, 2 + tag_len , ENC_NA);
13849     proto_item_append_text(ti, ": %s", val_to_str_ext(tag_no, &tag_num_vals_ext, "Reserved (%d)"));
13850
13851     tree = proto_item_add_subtree(ti, ett_80211_mgt_ie);
13852
13853   }
13854
13855   ti_tag = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13856   ti_len = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
13857   if (tag_len > (guint)tvb_reported_length_remaining(tvb, offset)) {
13858     expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length,
13859                            "Tag Length is longer than remaining payload");
13860   }
13861
13862   switch (tag_no) {
13863   case TAG_SSID:
13864     offset += ieee80211_tag_ssid(pinfo, tree, ti, ti_len, tag_len, tvb,
13865                                  offset);
13866     break;
13867   case TAG_SUPP_RATES:
13868     offset += ieee80211_tag_supp_rates(pinfo, tree, ti, ti_len, tag_len, tvb,
13869                                        offset, tag_end);
13870     break;
13871   case TAG_FH_PARAMETER:
13872     offset += ieee80211_tag_fh_parameter(pinfo, tree, ti_len, tag_len, tvb,
13873                                          offset);
13874     break;
13875   case TAG_DS_PARAMETER:
13876     offset += ieee80211_tag_ds_parameter(pinfo, tree, ti, ti_len, tag_len, tvb,
13877                                          offset);
13878     break;
13879   case TAG_CF_PARAMETER:
13880     offset += ieee80211_tag_cf_parameter(pinfo, tree, ti, ti_len, tag_len, tvb,
13881                                          offset);
13882     break;
13883   case TAG_TIM:
13884     offset += ieee80211_tag_tim(pinfo, tree, ti, ti_len, tag_len, tvb, offset);
13885     break;
13886   case TAG_IBSS_PARAMETER:
13887     offset += ieee80211_tag_ibss_parameter(pinfo, tree, ti, ti_len, tag_len,
13888                                            tvb, offset);
13889     break;
13890   case TAG_COUNTRY_INFO:
13891     offset += ieee80211_tag_country_info(pinfo, tree, ti, ti_len, tag_len, tvb,
13892                                          offset, tag_end);
13893     break;
13894   case TAG_FH_HOPPING_PARAMETER:
13895     offset += ieee80211_tag_fh_hopping_parameter(pinfo, tree, ti, ti_len,
13896                                                  tag_len, tvb, offset);
13897     break;
13898   case TAG_FH_HOPPING_TABLE:
13899     offset += ieee80211_tag_fh_hopping_table(pinfo, tree, ti_len, tag_len,
13900                                              tvb, offset, tag_end);
13901     break;
13902
13903     case TAG_REQUEST: /* 7.3.2.12 Request information element (10) */
13904       while (offset < tag_end)
13905       {
13906         proto_tree_add_item(tree, hf_ieee80211_tag_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
13907         offset += 1;
13908       }
13909       break;
13910
13911     case TAG_QBSS_LOAD: /* 7.3.2.28 BSS Load element (11) */
13912                         /* 8.4.2.30 in 802.11-2012 */
13913       if ((tag_len < 4) || (tag_len > 5))
13914       {
13915         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4 or 5", tag_len);
13916         break;
13917       }
13918
13919       if (tag_len == 4)
13920       {
13921         /* QBSS Version 1 */
13922         proto_item_append_text(ti, " Cisco QBSS Version 1 - non CCA");
13923
13924         /* Extract Values */
13925         proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 1);
13926         proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN);
13927         proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
13928         proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
13929       }
13930       else if (tag_len == 5)
13931
13932       {
13933         proto_item *base_item;
13934
13935         /* QBSS Version 2 */
13936         proto_item_append_text(ti, " 802.11e CCA Version");
13937
13938         /* Extract Values */
13939         proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 2);
13940         proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN);
13941         base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
13942         proto_item_append_text(base_item, " (%d%%)", 100*tvb_get_guint8(tvb, offset + 4)/255);
13943         base_item = proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 2, ENC_LITTLE_ENDIAN);
13944         proto_item_append_text(base_item, " (%d us/s)", tvb_get_letohs(tvb, offset + 5)*32);
13945       }
13946       break;
13947
13948 #if 0 /* ToDo */
13949   case TAG_EDCA_PARAM_SET: /* 8.4.2.31 in 802-11-2012 */
13950     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_QOS_INFO_AP);
13951     offset += 1;  /* reserved */
13952     offset += 4;  /* AC_BE */
13953     offset += 4;  /* AC_BK */
13954     offset += 4;  /* AC_VI */
13955     offset += 4;  /* AC_VO */
13956     break;
13957 #endif
13958
13959     case TAG_TSPEC: /* TSPEC element (13) */
13960       if (isDMG == FALSE && tag_len != 55)
13961       {
13962         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 55", tag_len);
13963         break;
13964       }
13965       if (isDMG == TRUE && tag_len != 57)
13966       {
13967         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 57", tag_len);
13968         break;
13969       }
13970       offset += 2;
13971
13972       add_fixed_field(tree, tvb, pinfo, offset, FIELD_QOS_TS_INFO);
13973       offset += 3;
13974
13975       proto_tree_add_item(tree, hf_ieee80211_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13976       offset += 2;
13977
13978       proto_tree_add_item(tree, hf_ieee80211_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13979       offset += 2;
13980
13981       proto_tree_add_item(tree, hf_ieee80211_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13982       offset += 4;
13983
13984       proto_tree_add_item(tree, hf_ieee80211_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13985       offset += 4;
13986
13987       proto_tree_add_item(tree, hf_ieee80211_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13988       offset += 4;
13989
13990       proto_tree_add_item(tree, hf_ieee80211_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13991       offset += 4;
13992
13993       proto_tree_add_item(tree, hf_ieee80211_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13994       offset += 4;
13995
13996       proto_tree_add_item(tree, hf_ieee80211_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
13997       offset += 4;
13998
13999       proto_tree_add_item(tree, hf_ieee80211_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14000       offset += 4;
14001
14002       proto_tree_add_item(tree, hf_ieee80211_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14003       offset += 4;
14004
14005       proto_tree_add_item(tree, hf_ieee80211_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14006       offset += 4;
14007
14008       proto_tree_add_item(tree, hf_ieee80211_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14009       offset += 4;
14010
14011       proto_tree_add_item(tree, hf_ieee80211_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14012       offset += 4;
14013
14014       proto_tree_add_item(tree, hf_ieee80211_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14015       offset += 2;
14016
14017       proto_tree_add_item(tree, hf_ieee80211_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14018       offset += 2;
14019
14020       if(isDMG == TRUE) {
14021         proto_tree_add_item(tree, hf_ieee80211_tspec_dmg, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14022         offset +=2;
14023       }
14024
14025       break;
14026
14027     case TAG_TCLAS: /* 7.3.2.31 TCLAS element (14) */
14028       if (tag_len < 6)
14029       {
14030         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 6", tag_len);
14031         break;
14032       }
14033       {
14034       guint8 type;
14035       guint8 version;
14036       proto_item *class_mask;
14037       proto_tree *mask_tree;
14038
14039       offset += 2;
14040       proto_tree_add_item(tree, hf_ieee80211_tclas_up, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14041       offset += 1;
14042
14043       type = tvb_get_guint8(tvb, offset);
14044       proto_tree_add_item(tree, hf_ieee80211_tclas_class_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14045       offset += 1;
14046
14047       class_mask = proto_tree_add_item(tree, hf_ieee80211_tclas_class_mask,
14048                                        tvb, offset, 1, ENC_LITTLE_ENDIAN);
14049       offset += 1;
14050
14051       switch (type)
14052         {
14053           case 0:
14054             offset--;
14055             mask_tree = proto_item_add_subtree(class_mask,
14056                                                ett_tag_tclas_mask_tree);
14057             proto_tree_add_item(mask_tree,
14058                                 hf_ieee80211_tclas_class_mask0_src_addr,
14059                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14060             proto_tree_add_item(mask_tree,
14061                                 hf_ieee80211_tclas_class_mask0_dst_addr,
14062                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14063             proto_tree_add_item(mask_tree,
14064                                 hf_ieee80211_tclas_class_mask0_type,
14065                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14066             offset++;
14067
14068             proto_tree_add_item(tree, hf_ieee80211_tclas_src_mac_addr, tvb, offset, 6, ENC_NA);
14069             offset += 6;
14070
14071             proto_tree_add_item(tree, hf_ieee80211_tclas_dst_mac_addr, tvb, offset, 6, ENC_NA);
14072             offset += 6;
14073
14074             proto_tree_add_item(tree, hf_ieee80211_tclas_ether_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14075             offset += 2;
14076             break;
14077
14078           case 1:
14079             version = tvb_get_guint8(tvb, offset);
14080             offset--;
14081
14082             mask_tree = proto_item_add_subtree(class_mask,
14083                                                ett_tag_tclas_mask_tree);
14084             proto_tree_add_item(mask_tree,
14085                                 hf_ieee80211_tclas_class_mask1_ver,
14086                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14087             proto_tree_add_item(mask_tree,
14088                                 hf_ieee80211_tclas_class_mask1_src_ip,
14089                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14090             proto_tree_add_item(mask_tree,
14091                                 hf_ieee80211_tclas_class_mask1_dst_ip,
14092                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14093             proto_tree_add_item(mask_tree,
14094                                 hf_ieee80211_tclas_class_mask1_src_port,
14095                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14096             proto_tree_add_item(mask_tree,
14097                                 hf_ieee80211_tclas_class_mask1_dst_port,
14098                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14099             if (version == 4) {
14100               proto_tree_add_item(mask_tree,
14101                                   hf_ieee80211_tclas_class_mask1_ipv4_dscp,
14102                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
14103               proto_tree_add_item(mask_tree,
14104                                   hf_ieee80211_tclas_class_mask1_ipv4_proto,
14105                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
14106             } else {
14107               proto_tree_add_item(mask_tree,
14108                                   hf_ieee80211_tclas_class_mask1_ipv6_flow,
14109                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
14110             }
14111             offset += 1;
14112
14113             proto_tree_add_item(tree, hf_ieee80211_tclas_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14114             offset += 1;
14115             if (version == 4)
14116             {
14117               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
14118               offset += 4;
14119               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
14120               offset += 4;
14121               proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
14122               offset += 2;
14123               proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
14124               offset += 2;
14125               proto_tree_add_item(tree, hf_ieee80211_tclas_dscp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14126               offset += 1;
14127               proto_tree_add_item(tree, hf_ieee80211_tclas_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14128               offset += 1;
14129             }
14130             else if (version == 6)
14131             {
14132               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_src, tvb, offset, 16, ENC_NA);
14133               offset += 16;
14134               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_dst, tvb, offset, 16, ENC_NA);
14135               offset += 16;
14136               proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
14137               offset += 2;
14138               proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
14139               offset += 2;
14140               proto_tree_add_item(tree, hf_ieee80211_tclas_flow, tvb, offset, 3, ENC_BIG_ENDIAN);
14141               offset += 3;
14142             }
14143             break;
14144
14145           case 2:
14146             offset--;
14147             mask_tree = proto_item_add_subtree(class_mask,
14148                                                ett_tag_tclas_mask_tree);
14149             proto_tree_add_item(mask_tree,
14150                                 hf_ieee80211_tclas_class_mask2_tci,
14151                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
14152             offset++;
14153
14154             proto_tree_add_item(tree, hf_ieee80211_tclas_tag_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14155             offset += 2;
14156             break;
14157
14158           default:
14159             break;
14160         }
14161       }
14162       break;
14163
14164     case TAG_SCHEDULE: /* 7.3.2.34 Schedule element (15) */
14165       if (tag_len != 14)
14166       {
14167         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 14", tag_len);
14168         break;
14169       }
14170       offset += 2;
14171
14172       add_fixed_field(tree, tvb, pinfo, offset, FIELD_SCHEDULE_INFO);
14173       offset += 2;
14174
14175       proto_tree_add_item(tree, hf_ieee80211_sched_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14176       offset += 4;
14177
14178       proto_tree_add_item(tree, hf_ieee80211_sched_srv_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14179       offset += 4;
14180
14181       proto_tree_add_item(tree, hf_ieee80211_sched_spec_int, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14182       offset += 2;
14183       break;
14184
14185     case TAG_CHALLENGE_TEXT: /* 7.3.2.8 Challenge Text element (16) */
14186       offset += 2;
14187       proto_tree_add_item(tree, hf_ieee80211_tag_challenge_text, tvb, offset, tag_len, ENC_NA);
14188       break;
14189
14190     case TAG_POWER_CONSTRAINT: /* 7.3.2.15 Power Constraint element (32) */
14191     {
14192       if (tag_len != 1)
14193       {
14194         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
14195         break;
14196       }
14197       offset += 2;
14198
14199       proto_tree_add_item(tree, hf_ieee80211_tag_power_constraint_local, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14200       proto_item_append_text(ti, ": %d", tvb_get_guint8(tvb, offset));
14201       offset += 1;
14202
14203       break;
14204     }
14205
14206     case TAG_POWER_CAPABILITY: /* 7.3.2.16 Power Capability element (33) */
14207     {
14208       if (tag_len != 2)
14209       {
14210         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
14211         break;
14212       }
14213       offset += 2;
14214
14215       proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_min, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14216       proto_item_append_text(ti, " Min: %d", tvb_get_guint8(tvb, offset));
14217       offset += 1;
14218
14219       proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_max, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14220       proto_item_append_text(ti, ", Max :%d", tvb_get_guint8(tvb, offset));
14221       offset += 1;
14222       break;
14223     }
14224
14225     case TAG_TPC_REQUEST: /* 7.3.2.18 TPC Request element (34) */
14226     {
14227       if (tag_len != 0)
14228       {
14229         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 0", tag_len);
14230         break;
14231       }
14232       offset += 2;
14233
14234       /* No Data */
14235       break;
14236     }
14237
14238     case TAG_TPC_REPORT: /* 7.3.2.18 TPC Report element (35) */
14239     {
14240       if (tag_len != 2)
14241       {
14242         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 2", tag_len);
14243         break;
14244       }
14245       offset += 2;
14246
14247       proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_trsmt_pow, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14248       proto_item_append_text(ti, " Transmit Power: %d", tvb_get_guint8(tvb, offset));
14249       offset += 1;
14250
14251       proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_link_mrg, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14252       proto_item_append_text(ti, ", Link Margin: %d", tvb_get_guint8(tvb, offset));
14253       offset += 1;
14254
14255       break;
14256     }
14257
14258     case TAG_SUPPORTED_CHANNELS: /* 7.3.2.19 Supported Channels element (36) */
14259       {
14260         proto_item *chan_item;
14261         proto_tree *chan_tree;
14262         guint       i = 1;
14263
14264         offset += 2;
14265         if (tag_len % 2 == 1) {
14266            expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u must be even", tag_len);
14267            break;
14268         }
14269         while (offset < tag_end)
14270         {
14271           chan_item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_channels, tvb, offset, 2, ENC_NA);
14272           proto_item_append_text(chan_item, " #%d", i);
14273           i += 1;
14274
14275           chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
14276
14277           proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_first, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14278           proto_item_append_text(chan_item, " First: %d", tvb_get_guint8(tvb, offset));
14279           offset += 1;
14280
14281           proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_range, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14282           proto_item_append_text(chan_item, ", Range: %d ", tvb_get_guint8(tvb, offset));
14283           offset += 1;
14284
14285         }
14286         break;
14287       }
14288     case TAG_CHANNEL_SWITCH_ANN: /* 7.3.2.20 Channel Switch Announcement element (37) */
14289     {
14290       if (tag_len != 3)
14291       {
14292         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 3", tag_len);
14293         break;
14294       }
14295       offset += 2;
14296
14297       proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14298       proto_item_append_text(ti, " Mode: %d", tvb_get_guint8(tvb, offset));
14299       offset += 1;
14300
14301       proto_tree_add_item(tree, hf_ieee80211_csa_new_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14302       proto_item_append_text(ti, ", Number: %d ", tvb_get_guint8(tvb, offset));
14303       offset += 1;
14304
14305       proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14306       proto_item_append_text(ti, ", Count: %d ", tvb_get_guint8(tvb, offset));
14307       offset += 1;
14308
14309       break;
14310     }
14311
14312     case TAG_MEASURE_REQ: /* 7.3.2.21 Measurement Request element (38) with update from 802.11k-2008 */
14313       if (tag_len < 3)
14314       {
14315         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
14316         break;
14317       }
14318       {
14319         guint8 request_type;
14320         proto_item *parent_item;
14321         proto_tree *sub_tree;
14322
14323         offset += 2;
14324
14325         proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_token, tvb, offset, 1, ENC_NA);
14326         offset += 1;
14327
14328         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_mode, tvb, offset, 1, ENC_NA);
14329         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_mode_tree);
14330         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_parallel, tvb, offset, 1, ENC_NA);
14331         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_enable, tvb, offset, 1, ENC_NA);
14332         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_request, tvb, offset, 1, ENC_NA);
14333         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_report, tvb, offset, 1, ENC_NA);
14334         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_duration_mandatory, tvb, offset, 1, ENC_NA);
14335         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_reserved, tvb, offset, 1, ENC_NA);
14336         offset += 1;
14337
14338
14339         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_type, tvb, offset, 1, ENC_NA);
14340         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_type_tree);
14341         request_type = tvb_get_guint8 (tvb, offset);
14342         offset += 1;
14343
14344         switch (request_type) {
14345           case 0: /* Basic Request */
14346           case 1: /* Clear channel assessment (CCA) request */
14347           case 2: /* Receive power indication (RPI) histogram request */
14348           {
14349
14350             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14351             offset += 1;
14352
14353             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14354             offset += 8;
14355
14356             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14357             offset += 2;
14358             break;
14359           }
14360           case 3: /* Channel Load Request */
14361           {
14362             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
14363             offset += 1;
14364
14365             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14366             offset += 1;
14367
14368             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14369             offset += 2;
14370
14371             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14372             offset += 2;
14373
14374             while (offset < tag_end)
14375             {
14376               guint8 sub_id;
14377               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_id, tvb, offset, 1, ENC_NA);
14378               sub_id = tvb_get_guint8(tvb, offset);
14379               offset += 1;
14380
14381               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
14382               offset += 1;
14383
14384               switch (sub_id) {
14385                 case MEASURE_REQ_CHANNEL_LOAD_SUB_REPORTING_INFO: /* Channel Load Reporting Information (1) */
14386                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition, tvb, offset, 1, ENC_NA);
14387                   offset += 1;
14388                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref, tvb, offset, 1, ENC_NA);
14389                   offset += 1;
14390                   break;
14391                 default:
14392                   /* no default action */
14393                   break;
14394                 }
14395               }
14396             break;
14397           }
14398           case 4: /* Noise Histogram Request */
14399           {
14400             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
14401             offset += 1;
14402
14403             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14404             offset += 1;
14405
14406             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14407             offset += 2;
14408
14409             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14410             offset += 2;
14411
14412             while (offset < tag_end)
14413             {
14414               guint8 sub_id;
14415               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_id, tvb, offset, 1, ENC_NA);
14416               sub_id = tvb_get_guint8(tvb, offset);
14417               offset += 1;
14418
14419               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
14420               offset += 1;
14421
14422               switch (sub_id) {
14423                 case MEASURE_REQ_NOISE_HISTOGRAM_SUB_REPORTING_INFO: /* Noise Histogram Reporting Information (1) */
14424                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition, tvb, offset, 1, ENC_NA);
14425                   offset += 1;
14426                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref, tvb, offset, 1, ENC_NA);
14427                   offset += 1;
14428                   break;
14429                 default:
14430                   /* no default action */
14431                   break;
14432                 }
14433               }
14434             break;
14435           }
14436           case 5: /* Beacon Request */
14437           {
14438             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
14439             offset += 1;
14440
14441             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14442             offset += 1;
14443
14444             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14445             offset += 2;
14446
14447             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14448             offset += 2;
14449
14450             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_measurement_mode, tvb, offset, 1, ENC_NA);
14451             offset += 1;
14452
14453             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_bssid, tvb, offset, 6, ENC_NA);
14454             offset += 6;
14455
14456             while (offset < tag_end)
14457             {
14458               guint8 sub_id, sub_length, sub_tag_end;
14459               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_id, tvb, offset, 1, ENC_NA);
14460               sub_id = tvb_get_guint8(tvb, offset);
14461               offset += 1;
14462
14463               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
14464               sub_length = tvb_get_guint8(tvb, offset);
14465               offset += 1;
14466               sub_tag_end = offset + sub_length;
14467
14468               switch (sub_id) {
14469                 case MEASURE_REQ_BEACON_SUB_SSID: /* SSID (0) */
14470                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_ssid, tvb, offset, sub_length, ENC_ASCII|ENC_NA);
14471                   offset += sub_length;
14472                   break;
14473                 case MEASURE_REQ_BEACON_SUB_BRI: /* Beacon Reporting Information (1) */
14474                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14475                   offset += 1;
14476                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14477                   offset += 1;
14478                   break;
14479                 case MEASURE_REQ_BEACON_SUB_RD: /* Reporting Detail (2) */
14480                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14481                   offset += 1;
14482                   break;
14483                 case MEASURE_REQ_BEACON_SUB_REQUEST: /* Request (10) */
14484                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_request, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14485                   offset += 1;
14486                   break;
14487                 case MEASURE_REQ_BEACON_SUB_APCP: /* AP Channel Report (51) */
14488                   /* TODO */
14489                   break;
14490                 default:
14491                   /* no default action */
14492                   break;
14493              }
14494              if (offset < sub_tag_end)
14495              {
14496                proto_item *tix;
14497                tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_unknown, tvb, offset, sub_tag_end - offset, ENC_NA);
14498                expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_beacon_unknown);
14499                offset = sub_tag_end;
14500              }
14501             }
14502
14503             break;
14504           }
14505           case 6: /* Frame Request */
14506           {
14507             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_operating_class, tvb, offset, 1, ENC_NA);
14508             offset += 1;
14509
14510             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
14511             offset += 1;
14512
14513             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14514             offset += 2;
14515
14516             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14517             offset += 2;
14518
14519             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_frame_request_type, tvb, offset, 1, ENC_NA);
14520             offset += 1;
14521
14522             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mac_address, tvb, offset, 6, ENC_NA);
14523             offset += 6;
14524
14525             /* TODO Add Optional Subelements */
14526             break;
14527           }
14528           case 7: /* BSTA Statistics Request */
14529           {
14530             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_peer_mac_address, tvb, offset, 6, ENC_NA);
14531             offset += 6;
14532
14533             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14534             offset += 2;
14535
14536             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14537             offset += 2;
14538
14539             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_group_id, tvb, offset, 1, ENC_NA);
14540             offset += 1;
14541
14542             /* TODO Add Optional Subelements */
14543             break;
14544           }
14545           case 8: /* Location Configuration Indication (LCI) Request */
14546             /* TODO */
14547           case 9: /* Transmit Stream Measurement Request */
14548             /* TODO */
14549           case 10: /* Multicast diagnostics request */
14550             /* TODO */
14551           case 11: /* Location Civic request */
14552             /* TODO */
14553           case 12: /* Location Identifier request */
14554             /* TODO */
14555           case 13: /* Directional channel quality request */
14556             /* TODO */
14557           case 14: /* Directional measurement request */
14558             /* TODO */
14559           case 15: /* Directional statistics request */
14560             /* TODO */
14561           case 255: /* Measurement Pause Request*/
14562             /* TODO */
14563           default: /* unknown */
14564             break;
14565         }
14566         if (offset < tag_end)
14567         {
14568           proto_item *tix;
14569           tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_unknown, tvb, offset, tag_end - offset, ENC_NA);
14570           expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_request_unknown);
14571         }
14572       }
14573
14574       break;
14575     case TAG_MEASURE_REP: /* 7.3.2.22 Measurement Report element (39) with update from 802.11k-2008 */
14576       if (tag_len < 3)
14577       {
14578         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be >= 3", tag_len);
14579         break;
14580       }
14581       {
14582         proto_item *parent_item;
14583         proto_tree *sub_tree;
14584         guint8 report_type;
14585
14586         offset += 2;
14587         proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_measurement_token, tvb, offset, 1, ENC_NA);
14588         offset += 1;
14589
14590         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_mode, tvb, offset, 1, ENC_NA);
14591         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_mode_tree);
14592         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_late, tvb, offset, 1, ENC_NA);
14593         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_incapable, tvb, offset, 1, ENC_NA);
14594         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_refused, tvb, offset, 1, ENC_NA);
14595         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_reserved, tvb, offset, 1, ENC_NA);
14596         offset += 1;
14597
14598         report_type = tvb_get_guint8(tvb, offset);
14599         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14600         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_type_tree);
14601         offset += 1;
14602
14603         if (tag_len == 3)
14604             break;
14605         switch (report_type) {
14606           case 0: /* Basic Report */
14607           {
14608             proto_tree *sub_tree_map_field;
14609
14610             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14611             offset += 1;
14612
14613             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14614             offset += 8;
14615
14616             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14617             offset += 2;
14618
14619
14620             parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_basic_map_field, tvb, offset, 1, ENC_NA);
14621             sub_tree_map_field = proto_item_add_subtree(parent_item, ett_tag_measure_report_basic_map_tree);
14622             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_bss, tvb, offset, 1, ENC_NA);
14623             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_odfm, tvb, offset, 1, ENC_NA);
14624             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_unident_signal, tvb, offset, 1, ENC_NA);
14625             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_radar, tvb, offset, 1, ENC_NA);
14626             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_unmeasured, tvb, offset, 1, ENC_NA);
14627             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_reserved, tvb, offset, 1, ENC_NA);
14628             break;
14629           }
14630           case 1: /* Clear channel assessment (CCA) report */
14631             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14632             offset += 1;
14633
14634             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14635             offset += 8;
14636
14637             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14638             offset += 2;
14639
14640             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_cca_busy_fraction, tvb, offset, 1, ENC_NA);
14641             offset += 1;
14642             break;
14643           case 2: /* Receive power indication (RPI) histogram report */
14644             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14645             offset += 1;
14646
14647             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14648             offset += 8;
14649
14650             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14651             offset += 2;
14652
14653             parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report, tvb, offset, 8, ENC_NA);
14654             sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_rpi_tree);
14655
14656             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_0, tvb, offset, 1, ENC_NA);
14657             offset += 1;
14658
14659             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_1, tvb, offset, 1, ENC_NA);
14660             offset += 1;
14661
14662             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_2, tvb, offset, 1, ENC_NA);
14663             offset += 1;
14664
14665             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_3, tvb, offset, 1, ENC_NA);
14666             offset += 1;
14667
14668             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_4, tvb, offset, 1, ENC_NA);
14669             offset += 1;
14670
14671             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_5, tvb, offset, 1, ENC_NA);
14672             offset += 1;
14673
14674             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_6, tvb, offset, 1, ENC_NA);
14675             offset += 1;
14676
14677             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_7, tvb, offset, 1, ENC_NA);
14678             offset += 1;
14679             break;
14680           case 3: /* Channel Load Report */
14681           {
14682             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
14683             offset += 1;
14684
14685             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14686             offset += 1;
14687
14688             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14689             offset += 8;
14690
14691             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14692             offset += 2;
14693
14694             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_load, tvb, offset, 1, ENC_NA);
14695             offset += 1;
14696
14697             /* TODO Add Optional Subelements */
14698             break;
14699           }
14700           case 4: /* Noise Histogram Report */
14701             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
14702             offset += 1;
14703
14704             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14705             offset += 1;
14706
14707             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14708             offset += 8;
14709
14710             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14711             offset += 2;
14712
14713             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
14714             offset += 1;
14715
14716             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_anpi, tvb, offset, 1, ENC_NA);
14717             offset += 1;
14718
14719             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_0, tvb, offset, 1, ENC_NA);
14720             offset += 1;
14721
14722             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_1, tvb, offset, 1, ENC_NA);
14723             offset += 1;
14724
14725             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_2, tvb, offset, 1, ENC_NA);
14726             offset += 1;
14727
14728             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_3, tvb, offset, 1, ENC_NA);
14729             offset += 1;
14730
14731             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_4, tvb, offset, 1, ENC_NA);
14732             offset += 1;
14733
14734             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_5, tvb, offset, 1, ENC_NA);
14735             offset += 1;
14736
14737             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_6, tvb, offset, 1, ENC_NA);
14738             offset += 1;
14739
14740             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_7, tvb, offset, 1, ENC_NA);
14741             offset += 1;
14742
14743             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_8, tvb, offset, 1, ENC_NA);
14744             offset += 1;
14745
14746             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_9, tvb, offset, 1, ENC_NA);
14747             offset += 1;
14748
14749             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_10, tvb, offset, 1, ENC_NA);
14750             offset += 1;
14751
14752             /* TODO Add Optional Subelements */
14753             break;
14754           case 5: /* Beacon Report */
14755           {
14756             proto_tree *sub_tree_frame_info;
14757
14758             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
14759             offset += 1;
14760
14761             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14762             offset += 1;
14763
14764             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14765             offset += 8;
14766
14767             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14768             offset += 2;
14769
14770             parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_frame_info, tvb, offset, 1, ENC_NA);
14771             sub_tree_frame_info = proto_item_add_subtree(parent_item, ett_tag_measure_report_frame_tree);
14772             proto_tree_add_item(sub_tree_frame_info, hf_ieee80211_tag_measure_report_frame_info_phy_type, tvb, offset, 1, ENC_NA);
14773             proto_tree_add_item(sub_tree_frame_info, hf_ieee80211_tag_measure_report_frame_info_frame_type, tvb, offset, 1, ENC_NA);
14774             offset += 1;
14775
14776             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rcpi, tvb, offset, 1, ENC_NA);
14777             offset += 1;
14778
14779             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rsni, tvb, offset, 1, ENC_NA);
14780             offset += 1;
14781
14782             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_bssid, tvb, offset, 6, ENC_NA);
14783             offset += 6;
14784
14785             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
14786             offset += 1;
14787
14788             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_parent_tsf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14789             offset += 4;
14790
14791             while (offset < tag_end)
14792             {
14793               guint8 sub_id, sub_length;
14794               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_beacon_sub_id, tvb, offset, 1, ENC_NA);
14795               sub_id = tvb_get_guint8(tvb, offset);
14796               offset += 1;
14797
14798               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_subelement_length, tvb, offset, 1, ENC_NA);
14799               sub_length = tvb_get_guint8(tvb, offset);
14800               offset += 1;
14801
14802               switch (sub_id) {
14803                 case MEASURE_REP_REPORTED_FRAME_BODY: /* Reported Frame Body (1) */
14804                   {
14805                     proto_tree *rep_tree;
14806
14807                     rep_tree = proto_tree_add_subtree(sub_tree, tvb, offset, sub_length, ett_tag_measure_reported_frame_tree, NULL, "Reported Frame Body");
14808
14809                     add_fixed_field(rep_tree, tvb, pinfo, 0, FIELD_TIMESTAMP);
14810                     add_fixed_field(rep_tree, tvb, pinfo, 8, FIELD_BEACON_INTERVAL);
14811                     add_fixed_field(rep_tree, tvb, pinfo, 10, FIELD_CAP_INFO);
14812                     offset += 12;
14813
14814                     ieee_80211_add_tagged_parameters (tvb, offset, pinfo, rep_tree, sub_length - 12, MGT_PROBE_RESP);
14815                     offset += (sub_length - 12);
14816                   }
14817                   break;
14818                 default:
14819                   /* no default action */
14820                   break;
14821               }
14822             }
14823             break;
14824           }
14825           case 6: /* Frame Report */
14826             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_operating_class, tvb, offset, 1, ENC_NA);
14827             offset += 1;
14828
14829             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
14830             offset += 1;
14831
14832             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
14833             offset += 8;
14834
14835             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14836             offset += 2;
14837
14838             /* TODO Add Optional Subelements */
14839             break;
14840           case 7: /* BSTA Statistics Report */
14841             /* TODO */
14842           case 8: /* Location Configuration Information Report element */
14843             /* TODO */
14844           case 9: /* Transmit Stream Measurement Report */
14845             /* TODO */
14846           case 10: /* Multicast diagnostics Report */
14847             /* TODO */
14848           case 11: /* Location Civic Report */
14849             /* TODO */
14850           case 12: /* Location Identifier Report */
14851             /* TODO */
14852           case 13: /* Directional channel quality Report */
14853             /* TODO */
14854           case 14: /* Directional measurement Report */
14855             /* TODO */
14856           case 15: /* Directional statistics Report */
14857             /* TODO */
14858           default: /* unknown */
14859             break;
14860         }
14861         if (offset < tag_end)
14862         {
14863           proto_item *tix;
14864           tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_unknown, tvb, offset, tag_end - offset, ENC_NA);
14865           expert_add_info(pinfo, tix, &ei_ieee80211_tag_measure_report_unknown);
14866         }
14867       }
14868       break;
14869
14870     case TAG_QUIET: /* 7.3.2.23 Quiet element (40) */
14871       if (tag_len != 6)
14872       {
14873         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
14874         break;
14875       }
14876       offset += 2;
14877
14878       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_count, tvb, offset, 1, ENC_NA);
14879       proto_item_append_text(ti, " Count: %d", tvb_get_guint8(tvb, offset));
14880       offset += 1;
14881
14882       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_period, tvb, offset, 1, ENC_NA);
14883       proto_item_append_text(ti, " Period: %d", tvb_get_guint8(tvb, offset));
14884       offset += 1;
14885
14886       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14887       proto_item_append_text(ti, " Duration: %d", tvb_get_letohs(tvb, offset));
14888       offset += 2;
14889
14890       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
14891       proto_item_append_text(ti, " Offset: %d", tvb_get_letohs(tvb, offset));
14892       offset += 2;
14893       break;
14894
14895
14896     case TAG_IBSS_DFS: /* 7.3.2.24 IBSS DFS element (41) */
14897       if (tag_len < 7)
14898       {
14899         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 7", tag_len);
14900         break;
14901       }
14902       {
14903         proto_item *ti_sup_map;
14904         proto_tree *sub_map_tree;
14905         offset += 2;
14906
14907         proto_tree_add_item(tree, hf_ieee80211_tag_dfs_owner, tvb, offset, 6, ENC_NA);
14908         proto_item_append_text(ti, " Owner: %s", tvb_ether_to_str(tvb, offset));
14909         offset += 6;
14910
14911         proto_tree_add_item(tree, hf_ieee80211_tag_dfs_recovery_interval, tvb, offset, 1, ENC_NA);
14912         offset += 1;
14913
14914         while (offset < tag_end)
14915         {
14916           ti_sup_map = proto_tree_add_item(tree, hf_ieee80211_tag_dfs_channel_map, tvb, offset, 2, ENC_NA);
14917           sub_map_tree = proto_item_add_subtree(ti_sup_map, ett_tag_dfs_map_tree);
14918           proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_channel_number, tvb, offset, 1, ENC_NA);
14919           proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_map, tvb, offset, 1, ENC_NA);
14920           offset += 2;
14921         }
14922         break;
14923       }
14924     case TAG_ERP_INFO: /* 7.3.2.13 ERP Information element (42) */
14925     case TAG_ERP_INFO_OLD:
14926       if (tag_len != 1)
14927       {
14928         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
14929         break;
14930       }
14931       {
14932         proto_item *ti_erp;
14933         proto_tree *erp_tree;
14934
14935         offset += 2;
14936
14937         ti_erp = proto_tree_add_item(tree, hf_ieee80211_tag_erp_info, tvb, offset, 1, ENC_NA);
14938         erp_tree = proto_item_add_subtree(ti_erp, ett_tag_erp_info_tree);
14939         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_erp_present, tvb, offset, 1, ENC_NA);
14940         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_use_protection, tvb, offset, 1, ENC_NA);
14941         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_barker_preamble_mode, tvb, offset, 1, ENC_NA);
14942         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_reserved, tvb, offset, 1, ENC_NA);
14943         offset += 1;
14944         break;
14945       }
14946
14947     case TAG_TS_DELAY: /* 7.3.2.32 TS Delay element (43) */
14948       if (tag_len != 4)
14949       {
14950         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
14951         break;
14952       }
14953       offset += 2;
14954
14955       proto_tree_add_item(tree, hf_ieee80211_ts_delay, tvb, offset, 4, ENC_LITTLE_ENDIAN);
14956       proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, offset));
14957       offset += 4;
14958       break;
14959
14960     case TAG_TCLAS_PROCESS: /* 7.3.2.33 TCLAS Processing element (44) */
14961       if (tag_len != 1)
14962       {
14963         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
14964         break;
14965       }
14966       offset += 2;
14967
14968       proto_tree_add_item(tree, hf_ieee80211_tclas_process, tvb, offset, 1, ENC_LITTLE_ENDIAN);
14969       proto_item_append_text(ti, " : %s", val_to_str(tvb_get_guint8(tvb, offset), ieee80211_tclas_process_flag, "Unknown %d"));
14970       offset += 1;
14971       break;
14972
14973     case TAG_QOS_CAPABILITY: /* 802.11-2012 8.4.2.37 QoS Capability element (46) */
14974       if (tag_len != 1)
14975       {
14976         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 1", tag_len);
14977         break;
14978       }
14979       {
14980         offset += 2;
14981         offset = dissect_qos_capability(tree, tvb, pinfo, offset, ftype);
14982       }
14983       break;
14984
14985     case TAG_RSN_IE: /* 7.3.2.25 RSN information element (48) */
14986       if (tag_len < 18)
14987       {
14988         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 18", tag_len);
14989         break;
14990       }
14991       offset += 2;
14992
14993       offset = dissect_rsn_ie(pinfo, tree, tvb, offset, tag_len);
14994       break;
14995
14996     case TAG_EXT_SUPP_RATES: /* 7.3.2.14 Extended Supported Rates element (50) */
14997       if (tag_len < 1)
14998       {
14999         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag length %u too short, must be greater than 0", tag_len);
15000         break;
15001       }
15002       offset += 2;
15003
15004       while (offset < tag_end)
15005       {
15006         proto_tree_add_item(tree, hf_ieee80211_tag_ext_supp_rates, tvb, offset, 1, ENC_NA);
15007         proto_item_append_text(ti, " %s,", val_to_str_ext_const(tvb_get_guint8(tvb, offset), &ieee80211_supported_rates_vals_ext, "Unknown Rate"));
15008         offset += 1;
15009       }
15010       proto_item_append_text(ti, " [Mbit/sec]");
15011       break;
15012
15013     case TAG_EXTENDED_CAPABILITIES: /* 7.3.2.27 Extended Capabilities information element (127) */
15014       dissect_extended_capabilities_ie(pinfo, tree, ti, ti_len, tag_len, tvb, offset+2, tag_end);
15015       break;
15016
15017     case TAG_CISCO_CCX1_CKIP: /* Cisco CCX1 CKIP + Device Name (133) */
15018       /* From WCS manual:
15019        * If Aironet IE support is enabled, the access point sends an Aironet
15020        * IE 0x85 (which contains the access point name, load, number of
15021        * associated clients, and so on) in the beacon and probe responses of
15022        * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
15023        * (which contains the management IP address of the controller and
15024        * the IP address of the access point) in the reassociation response
15025        * if it receives Aironet IE 0x85 in the reassociation request.
15026        */
15027
15028       if (tag_len < 26)
15029       {
15030         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u too short, must be >= 26", tag_len);
15031         break;
15032       }
15033       offset += 2;
15034       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown, tvb, offset, 10, ENC_NA);
15035       offset += 10;
15036
15037       /* The Name of the sending device starts at offset 10 and is up to
15038          15 or 16 bytes in length, \0 padded */
15039       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_name, tvb, offset, 16, ENC_ASCII|ENC_NA);
15040       offset += 16;
15041
15042       /* Total number off associated clients and repeater access points */
15043       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_clients, tvb, offset, 1, ENC_NA);
15044       offset += 1;
15045       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown2, tvb, offset, 3, ENC_NA);
15046       offset += 3;
15047       break;
15048
15049     case TAG_VHT_CAPABILITY:
15050       dissect_vht_capability_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len);
15051       break;
15052
15053     case TAG_VHT_OPERATION:
15054       dissect_vht_operation_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len);
15055       break;
15056
15057     case TAG_EXT_BSS_LOAD:
15058       dissect_ext_bss_load(tree, tvb, offset+2);
15059       break;
15060
15061     case TAG_WIDE_BW_CHANNEL_SWITCH:
15062       dissect_wide_bw_channel_switch(tree, tvb, offset+2);
15063       break;
15064
15065     case TAG_VHT_TX_PWR_ENVELOPE:
15066       dissect_vht_tx_pwr_envelope(tvb, pinfo, tree, offset+2, tag_len, ti_len);
15067       break;
15068
15069     case TAG_CHANNEL_SWITCH_WRAPPER:
15070       dissect_channel_switch_wrapper(pinfo, tree, tvb, offset + 2, tag_len);
15071       break;
15072
15073     case TAG_OPERATING_MODE_NOTIFICATION:
15074       dissect_operating_mode_notification(tree, tvb, offset + 2);
15075       break;
15076
15077     case TAG_VENDOR_SPECIFIC_IE: /* 7.3.2.26 Vendor Specific information element (221) */
15078     case TAG_CISCO_VENDOR_SPECIFIC: /* This Cisco proprietary IE seems to mimic 221 */
15079     case TAG_SYMBOL_PROPRIETARY: /* This Symbol proprietary IE seems to mimic 221 */
15080       if (tag_len < 3)
15081       {
15082         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len);
15083         break;
15084       }
15085       {
15086         guint32 tag_vs_len = tag_len;
15087
15088         offset += 2;
15089         oui = tvb_get_ntoh24(tvb, offset);
15090         tag_tvb = tvb_new_subset_length(tvb, offset, tag_len);
15091         proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
15092         proto_item_append_text(ti, ": %s", uint_get_manuf_name(oui));
15093         offset += 3;
15094         tag_vs_len -= 3;
15095
15096         if (tag_len > 0) {
15097           proto_tree_add_item(ti, hf_ieee80211_tag_vendor_oui_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15098         }
15099
15100       switch (oui) {
15101         /* 802.11 specific vendor ids */
15102         case OUI_WPAWME:
15103           offset = dissect_vendor_ie_wpawme(tree, tvb, pinfo, offset, tag_vs_len, ftype);
15104           break;
15105         case OUI_RSN:
15106           dissect_vendor_ie_rsn(ti, tree, tvb, offset, tag_vs_len);
15107           break;
15108         case OUI_PRE11N:
15109           dissect_vendor_ie_ht(tvb, pinfo, tree, offset, ti, ti_len, tag_vs_len);
15110           break;
15111         case OUI_WFA:
15112           dissect_vendor_ie_wfa(pinfo, ti, tag_tvb);
15113           break;
15114
15115         /* Normal IEEE vendor ids (from oui.h) */
15116         case OUI_CISCOWL:  /* Cisco Wireless (Aironet) */
15117           dissect_vendor_ie_aironet(ti, tree, tvb, offset, tag_vs_len);
15118           break;
15119         case OUI_MARVELL:
15120           dissect_vendor_ie_marvell(ti, tree, tvb, offset, tag_vs_len);
15121           break;
15122         case OUI_ATHEROS:
15123           dissect_vendor_ie_atheros(ti, tree, tvb, offset, tag_vs_len, pinfo, ti_len);
15124           break;
15125         case OUI_ARUBA:
15126           dissect_vendor_ie_aruba(ti, tree, tvb, offset, tag_vs_len);
15127           break;
15128         case OUI_NINTENDO:
15129           dissect_vendor_ie_nintendo(ti, tree, tvb, offset, tag_vs_len);
15130           break;
15131         default:
15132           proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA);
15133           break;
15134         }
15135
15136       }
15137       break;
15138
15139     case TAG_MOBILITY_DOMAIN:
15140       dissect_mobility_domain(tree, tvb, offset + 2, tag_len);
15141       break;
15142
15143     case TAG_FAST_BSS_TRANSITION:
15144       dissect_fast_bss_transition(tree, tvb, offset + 2, tag_len);
15145       break;
15146
15147     case TAG_MMIE:
15148       dissect_mmie(tree, tvb, offset + 2, tag_len);
15149       break;
15150
15151     case TAG_SSID_LIST:
15152       dissect_ssid_list(tree, tvb, offset + 2, tag_len);
15153       break;
15154
15155     case TAG_TIME_ZONE:
15156       dissect_time_zone(tree, tvb, offset + 2, tag_len);
15157       break;
15158
15159     case TAG_TIMEOUT_INTERVAL:
15160       dissect_timeout_interval(tree, tvb, pinfo, offset + 2, tag_len);
15161       break;
15162
15163     case TAG_RIC_DATA: /* RIC Data (RDE) (57) */
15164      /* Assigning the return value will ensure that the IE after RIC is processed
15165       * only once. This gives us a good looking RIC IE :-)
15166       */
15167       tag_len = dissect_ric_data(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len, ftype);
15168       break;
15169
15170     case TAG_LINK_IDENTIFIER:
15171       dissect_link_identifier(tree, tvb, offset + 2, tag_len);
15172       break;
15173
15174     case TAG_WAKEUP_SCHEDULE:
15175       dissect_wakeup_schedule(tree, tvb, offset + 2, tag_len);
15176       break;
15177
15178     case TAG_CHANNEL_SWITCH_TIMING:
15179       dissect_channel_switch_timing(tree, tvb, offset + 2, tag_len);
15180       break;
15181
15182     case TAG_PTI_CONTROL:
15183       dissect_pti_control(tree, tvb, offset + 2, tag_len);
15184       break;
15185
15186     case TAG_PU_BUFFER_STATUS:
15187       dissect_pu_buffer_status(tree, tvb, offset + 2, tag_len);
15188       break;
15189
15190     case TAG_HT_CAPABILITY:
15191       dissect_ht_capability_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len, FALSE);
15192       break;
15193
15194     case TAG_HT_INFO:
15195       dissect_ht_info_ie_1_1(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15196       break;
15197
15198     case TAG_SECONDARY_CHANNEL_OFFSET:
15199       dissect_secondary_channel_offset_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15200       break;
15201
15202     case TAG_BSS_AVG_ACCESS_DELAY: /* BSS Average Access Delay element (63) */
15203       dissect_bss_avg_access_delay_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15204       break;
15205
15206     case TAG_ANTENNA: /* Antenna element (64) */
15207       dissect_antenna_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15208       break;
15209
15210     case TAG_RSNI: /* RSNI element (65) */
15211       dissect_rsni_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15212       break;
15213
15214     case TAG_BSS_AVB_ADM_CAPACITY:
15215       dissect_bss_available_admission_capacity_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15216       break;
15217
15218     case TAG_IE_68_CONFLICT: /* Conflict: WAPI Vs. IEEE */
15219       if (tag_len >= 20) { /* It Might be WAPI*/
15220         dissect_wapi_param_set(tvb, pinfo, tree, offset + 2,tag_len, ti_len, ti, ftype);
15221       }
15222       else { /* BSS AC Access Delay (68) */
15223         dissect_bss_ac_access_delay_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
15224       }
15225       break;
15226
15227     case TAG_BSS_MAX_IDLE_PERIOD:
15228       dissect_bss_max_idle_period(tree, tvb, offset + 2);
15229       break;
15230
15231     case TAG_TFS_REQUEST:
15232       dissect_tfs_request(pinfo, tree, tvb, offset + 2, tag_len, ftype);
15233       break;
15234
15235     case TAG_TFS_RESPONSE:
15236       dissect_tfs_response(pinfo, tree, tvb, offset + 2, tag_len, ftype);
15237       break;
15238
15239     case TAG_WNM_SLEEP_MODE:
15240       dissect_wnm_sleep_mode(tree, tvb, offset + 2);
15241       break;
15242
15243     case TAG_TIME_ADV:
15244       dissect_time_adv(tree, tvb, offset + 2);
15245       break;
15246
15247     case TAG_RM_ENABLED_CAPABILITY: /* RM Enabled Capabilities (70) */
15248       dissect_rm_enabled_capabilities_ie(pinfo, tree, ti, ti_len, tag_len, tvb, offset+2, tag_end);
15249       break;
15250
15251     case TAG_RIC_DESCRIPTOR: /* RIC Descriptor (75) */
15252       dissect_ric_descriptor(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len);
15253       break;
15254
15255     case TAG_MESH_PEERING_MGMT:
15256       {
15257         guint start = offset + 2;
15258         offset += 2;
15259         proto_tree_add_item (tree, hf_ieee80211_mesh_peering_proto, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15260         offset += 2;
15261         proto_tree_add_item (tree, hf_ieee80211_mesh_peering_local_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15262         offset += 2;
15263         switch (tvb_get_guint8(tvb, 1))
15264           {                                         /* Self-protected action field */
15265           case SELFPROT_ACTION_MESH_PEERING_OPEN:
15266             break;
15267
15268           case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
15269             proto_tree_add_item (tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15270             offset += 2;
15271             break;
15272
15273           case SELFPROT_ACTION_MESH_PEERING_CLOSE:
15274             if ((tag_len == 8) || (tag_len == 24))
15275               {
15276                 proto_tree_add_item (tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15277                 offset += 2;
15278               }
15279             offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
15280             break;
15281
15282           /* unexpected values */
15283           default:
15284             proto_tree_add_expert(tree, pinfo, &ei_ieee80211_mesh_peering_unexpected , tvb, offset, tag_len);
15285             offset += tag_len;
15286             break;
15287           }
15288         if (tag_len - (offset - start) == 16)
15289           {
15290             proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
15291             offset += 16;
15292           }
15293         break;
15294       }
15295
15296     case TAG_MESH_CONFIGURATION:
15297       {
15298         proto_item *item;
15299         proto_tree *subtree;
15300         offset += 2;
15301         proto_tree_add_item (tree, hf_ieee80211_mesh_config_path_sel_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15302         proto_tree_add_item (tree, hf_ieee80211_mesh_config_path_sel_metric, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
15303         proto_tree_add_item (tree, hf_ieee80211_mesh_config_congestion_control, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
15304         proto_tree_add_item (tree, hf_ieee80211_mesh_config_sync_method, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
15305         proto_tree_add_item (tree, hf_ieee80211_mesh_config_auth_protocol, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
15306         item = proto_tree_add_item (tree, hf_ieee80211_mesh_config_formation_info, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
15307         subtree = proto_item_add_subtree(item, ett_mesh_formation_info_tree);
15308         proto_tree_add_item (subtree, hf_ieee80211_mesh_form_info_num_of_peerings, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
15309         item = proto_tree_add_item (tree, hf_ieee80211_mesh_config_capability, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15310         subtree = proto_item_add_subtree(item, ett_mesh_config_cap_tree);
15311         proto_tree_add_item (subtree, hf_ieee80211_mesh_config_cap_accepting, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15312         proto_tree_add_item (subtree, hf_ieee80211_mesh_config_cap_mcca_support, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15313         proto_tree_add_item (subtree, hf_ieee80211_mesh_config_cap_mcca_enabled, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15314         proto_tree_add_item (subtree, hf_ieee80211_mesh_config_cap_forwarding, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15315         proto_tree_add_item (subtree, hf_ieee80211_mesh_config_cap_mbca_enabled, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15316         proto_tree_add_item (subtree, hf_ieee80211_mesh_config_cap_tbtt_adjusting, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15317         proto_tree_add_item (subtree, hf_ieee80211_mesh_config_cap_power_save_level, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
15318         break;
15319       }
15320
15321     case TAG_MESH_ID:
15322       {
15323         offset += 2;
15324
15325         proto_tree_add_item(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA);
15326         if (tag_len > 0) {
15327             col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tag_len, ENC_ASCII), tag_len));
15328             proto_item_append_text(ti, ": %s", format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, offset, tag_len, ENC_ASCII), tag_len));
15329         }
15330
15331       break;
15332       }
15333
15334     case TAG_MESH_PREQ:
15335       {
15336         guint8 flags = tvb_get_guint8(tvb, offset + 2);
15337         guint8 targs, i;
15338
15339         offset += 2;
15340         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15341         offset += 1;
15342         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15343         offset += 1;
15344         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15345         offset += 1;
15346         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_pdid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15347         offset += 4;
15348         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
15349         offset += 6;
15350         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15351         offset += 4;
15352
15353         if (flags & (1<<6)) {
15354           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_ext, tvb, offset, 6, ENC_NA);
15355           offset += 6;
15356         }
15357         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15358         offset += 4;
15359         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15360         offset += 4;
15361         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15362         targs = tvb_get_guint8 (tvb, offset);
15363         offset += 1;
15364         for (i = 0; i < targs; i++) {
15365           const int * targ_flags[] = {
15366               &hf_ieee80211_ff_hwmp_targ_to_flags,
15367               &hf_ieee80211_ff_hwmp_targ_usn_flags,
15368               NULL
15369           };
15370
15371           proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_ieee80211_ff_hwmp_targ_flags,
15372                                    ett_hwmp_targ_flags_tree, targ_flags, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
15373
15374           offset += 1;
15375           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
15376           offset += 6;
15377           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15378           offset += 4;
15379         }
15380         break;
15381       }
15382
15383     case TAG_MESH_PREP:
15384       {
15385         guint8 flags = tvb_get_guint8(tvb, offset + 2);
15386         offset += 2;
15387         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15388         offset += 1;
15389         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15390         offset += 1;
15391         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset , 1, ENC_LITTLE_ENDIAN);
15392         offset += 1;
15393         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
15394         offset += 6;
15395         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15396         offset += 4;
15397         if (flags & (1<<6)) {
15398           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
15399           offset += 6;
15400         }
15401         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15402         offset += 4;
15403         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15404         offset += 4;
15405         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
15406         offset += 6;
15407         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15408         offset += 4;
15409         break;
15410       }
15411
15412     case TAG_MESH_PERR:
15413       {
15414         guint8 targs, i;
15415
15416         offset += 2;
15417         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15418         offset += 1;
15419         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15420         targs = tvb_get_guint8 (tvb, offset);
15421         offset += 1;
15422         for (i = 0; i < targs; i++) {
15423           guint8 flags = tvb_get_guint8(tvb, offset);
15424
15425           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15426           offset += 1;
15427           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
15428           offset += 6;
15429           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15430           offset += 4;
15431           if (flags & (1<<6)) {
15432             proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
15433             offset += 6;
15434           }
15435           offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
15436         }
15437         break;
15438       }
15439
15440     case TAG_RANN:
15441       {
15442         offset += 2;
15443         proto_tree_add_item (tree, hf_ieee80211_rann_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15444         offset += 1;
15445         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15446         offset += 1;
15447         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15448         offset += 1;
15449         proto_tree_add_item (tree, hf_ieee80211_rann_root_sta, tvb, offset, 6, ENC_NA);
15450         offset += 6;
15451         proto_tree_add_item (tree, hf_ieee80211_rann_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15452         offset += 4;
15453         proto_tree_add_item (tree, hf_ieee80211_rann_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15454         offset += 4;
15455         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15456         offset += 4;
15457         break;
15458       }
15459
15460     case TAG_MESH_CHANNEL_SWITCH: /* Mesh Channel Switch Parameters (118) */
15461       {
15462         proto_item *item;
15463         proto_tree *subtree;
15464         if (tag_len != 6)
15465         {
15466           expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
15467             break;
15468         }
15469         offset += 2;
15470
15471         proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15472         proto_item_append_text(ti, " TTL: %d", tvb_get_guint8(tvb, offset));
15473         offset += 1;
15474
15475         item = proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15476         subtree = proto_item_add_subtree(item, ett_mesh_chswitch_flag_tree);
15477         proto_tree_add_item(subtree, hf_ieee80211_mesh_chswitch_flag_initiator, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15478         proto_tree_add_item(subtree, hf_ieee80211_mesh_chswitch_flag_txrestrict, tvb, offset, 1, ENC_LITTLE_ENDIAN);
15479         offset += 1;
15480
15481         proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_reason_code, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15482         offset += 2;
15483
15484         proto_tree_add_item(tree, hf_ieee80211_mesh_channel_switch_precedence_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15485         offset += 2;
15486         break;
15487      }
15488
15489     case TAG_INTERWORKING:
15490       dissect_interworking(pinfo, tree, ti, tvb, offset);
15491       break;
15492     case TAG_ADVERTISEMENT_PROTOCOL:
15493     {
15494       dissect_advertisement_protocol(pinfo, tree, tvb, offset, NULL);
15495       break;
15496     }
15497     case TAG_QOS_MAP_SET:
15498       dissect_qos_map_set(pinfo, tree, ti, tvb, offset);
15499       break;
15500     case TAG_ROAMING_CONSORTIUM:
15501       dissect_roaming_consortium(pinfo, tree, ti, tvb, offset);
15502       break;
15503     case TAG_AP_CHANNEL_REPORT: /* 7.3.2.36 AP Channel Report element */
15504       dissect_ap_channel_report(tvb, pinfo, tree, offset + 2, tag_len, ti_len, tag_end, ti);
15505       break;
15506     case TAG_NEIGHBOR_REPORT:
15507       dissect_neighbor_report(tvb, pinfo, tree, offset + 2, tag_len, ti_len, tag_end, ti);
15508       break;
15509
15510     case TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT:
15511     {
15512       if (tag_len != 4)
15513       {
15514         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
15515         break;
15516       }
15517
15518       offset += 2;
15519
15520       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT);
15521
15522       break;
15523     }
15524     case TAG_SUPPORTED_OPERATING_CLASSES:
15525     {
15526       guint i;
15527
15528       if (tag_len < 2) {
15529         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be >= 3", tag_len);
15530         break;
15531       } else if (tag_len > 32) {
15532         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be < 32", tag_len);
15533         break;
15534       }
15535
15536       offset += 2;
15537
15538       proto_tree_add_item(tree, hf_ieee80211_tag_supported_ope_classes_current, tvb, offset, 1, ENC_NA);
15539
15540       offset += 1;
15541       /* Partially taken from the ssid section */
15542       tag_data_ptr = tvb_get_ptr (tvb, offset, tag_len);
15543       for (i = 0, n = 0; (i < tag_len) && (n < SHORT_STR); i++) {
15544         ret = g_snprintf (print_buff + n, SHORT_STR - n, (i == tag_len-1)?"%d":"%d, ", tag_data_ptr[i]);
15545         if (ret >= SHORT_STR - n) {
15546           /* ret >= <buf_size> means buffer truncated  */
15547           break;
15548         }
15549         n += ret;
15550       }
15551       proto_tree_add_string (tree, hf_ieee80211_tag_supported_ope_classes_alternate, tvb, offset, tag_len, print_buff);
15552
15553       break;
15554     }
15555     case TAG_RELAY_CAPABILITIES:
15556     {
15557       add_tag_relay_capabilities(pinfo, ti_len, tag_len, tree, tvb, &offset);
15558       break;
15559     }
15560     case TAG_DMG_BSS_PRAMTER_CHANGE:
15561     {
15562       gboolean size;
15563       if (tag_len != 7)
15564       {
15565         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 7", tag_len);
15566         break;
15567       }
15568       offset += 2;
15569       size = (tvb_get_guint8(tvb, offset) & 0x02) >> 1;
15570       proto_tree_add_item(tree, hf_ieee80211_tag_move, tvb, offset, 1, ENC_NA);
15571       proto_tree_add_item(tree, hf_ieee80211_tag_size, tvb, offset, 1, ENC_NA);
15572       offset += 1;
15573       proto_tree_add_item(tree, hf_ieee80211_tag_tbtt_offset, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15574       offset += 4;
15575       if(size == TRUE) { /* if size bit is 0, the field is reserved. */
15576         proto_tree_add_item(tree, hf_ieee80211_tag_bi_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15577       }
15578       offset += 2;
15579       break;
15580     }
15581     case TAG_DMG_CAPABILITIES:
15582     {
15583       if (tag_len != 17)
15584       {
15585         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 17", tag_len);
15586         break;
15587       }
15588       offset += 2;
15589       proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_sta_addr, tvb, offset, 6, ENC_NA);
15590       offset += 6;
15591       proto_tree_add_item(tree, hf_ieee80211_tag_dmg_capa_aid, tvb, offset, 1, ENC_NA);
15592       offset += 1;
15593       proto_tree_add_item(tree, hf_ieee80211_tag_reverse_direction, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15594       proto_tree_add_item(tree, hf_ieee80211_tag_hlts, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15595       proto_tree_add_item(tree, hf_ieee80211_tag_tpc, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15596       proto_tree_add_item(tree, hf_ieee80211_tag_spsh, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15597       proto_tree_add_item(tree, hf_ieee80211_tag_rx_antenna, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15598       proto_tree_add_item(tree, hf_ieee80211_tag_fast_link, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15599       proto_tree_add_item(tree, hf_ieee80211_tag_num_sectors, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15600       proto_tree_add_item(tree, hf_ieee80211_tag_rxss_length, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15601       proto_tree_add_item(tree, hf_ieee80211_tag_reciprocity, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15602       proto_tree_add_item(tree, hf_ieee80211_tag_max_ampdu_exp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15603       offset += 3;
15604       proto_tree_add_item(tree, hf_ieee80211_tag_min_mpdu_sapcing, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15605       proto_tree_add_item(tree, hf_ieee80211_tag_ba_flow_control, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15606       proto_tree_add_item(tree, hf_ieee80211_tag_max_sc_rx_mcs, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15607       proto_tree_add_item(tree, hf_ieee80211_tag_max_ofdm_rx_mcs, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15608       proto_tree_add_item(tree, hf_ieee80211_tag_max_sc_tx_mcs, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15609       proto_tree_add_item(tree, hf_ieee80211_tag_max_ofdm_tx_mcs, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15610       offset += 3;
15611       proto_tree_add_item(tree, hf_ieee80211_tag_low_power_supported, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15612       proto_tree_add_item(tree, hf_ieee80211_tag_code_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15613       proto_tree_add_item(tree, hf_ieee80211_tag_dtp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15614       proto_tree_add_item(tree, hf_ieee80211_tag_appdu_supp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15615       proto_tree_add_item(tree, hf_ieee80211_tag_heartbeat, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15616       proto_tree_add_item(tree, hf_ieee80211_tag_other_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15617       proto_tree_add_item(tree, hf_ieee80211_tag_pattern_recip, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15618       proto_tree_add_item(tree, hf_ieee80211_tag_heartbeat_elapsed, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15619       proto_tree_add_item(tree, hf_ieee80211_tag_grant_ack_supp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15620       proto_tree_add_item(tree, hf_ieee80211_tag_RXSSTxRate_supp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15621       offset += 2;
15622       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_tddti, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15623       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_PSA, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15624       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_handover, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15625       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_max_assoc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15626       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_power_src, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15627       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_decenter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15628       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_forwarding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15629       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_center, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15630       offset += 2;
15631       break;
15632     }
15633     case TAG_DMG_OPERATION:
15634     {
15635       if (tag_len != 10)
15636       {
15637         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 10", tag_len);
15638         break;
15639       }
15640       offset += 2;
15641       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_tddti, tvb, offset, 1, ENC_NA);
15642       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_PSA, tvb, offset, 1, ENC_NA);
15643       proto_tree_add_item(tree, hf_ieee80211_tag_pcp_handover, tvb, offset, 1, ENC_NA);
15644       offset += 2;
15645       proto_tree_add_item(tree, hf_ieee80211_tag_PSRSI, tvb, offset, 1, ENC_NA);
15646       offset += 1;
15647       proto_tree_add_item(tree, hf_ieee80211_tag_min_BHI_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15648       offset += 2;
15649       proto_tree_add_item(tree, hf_ieee80211_tag_brdct_sta_info_dur, tvb, offset, 1, ENC_NA);
15650       offset += 1;
15651       proto_tree_add_item(tree, hf_ieee80211_tag_assoc_resp_confirm_time, tvb, offset, 1, ENC_NA);
15652       offset += 1;
15653       proto_tree_add_item(tree, hf_ieee80211_tag_min_pp_duration, tvb, offset, 1, ENC_NA);
15654       offset += 1;
15655       proto_tree_add_item(tree, hf_ieee80211_tag_SP_idle_timeout, tvb, offset, 1, ENC_NA);
15656       offset += 1;
15657       proto_tree_add_item(tree, hf_ieee80211_tag_max_lost_beacons, tvb, offset, 1, ENC_NA);
15658       offset += 1;
15659       break;
15660     }
15661     case TAG_ANTENNA_SECTOR_ID:
15662     {
15663       if (tag_len != 4)
15664       {
15665         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 4", tag_len);
15666         break;
15667       }
15668       offset += 2;
15669       proto_tree_add_item(tree, hf_ieee80211_tag_type, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15670       proto_tree_add_item(tree, hf_ieee80211_tag_tap1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15671       proto_tree_add_item(tree, hf_ieee80211_tag_state1, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15672       proto_tree_add_item(tree, hf_ieee80211_tag_tap2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15673       proto_tree_add_item(tree, hf_ieee80211_tag_state2, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15674       offset += 4;
15675       break;
15676     }
15677     case TAG_EXTENDED_SCHEDULE:
15678     {
15679       guint32 i = 0;
15680       gboolean isGrant;
15681       proto_tree * alloc_tree;
15682       if ((tag_len%15) != 0)
15683       {
15684         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);
15685         break;
15686       }
15687       offset += 2;
15688       isGrant = ((ftype==CTRL_GRANT)||(ftype==CTRL_GRANT_ACK));
15689       p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_CTRL_GRANT_OR_GRANT_ACK_KEY, &isGrant);
15690       for(i=0; i < tag_len; i+=15) {
15691         alloc_tree = proto_tree_add_subtree_format(tree, tvb, offset, 15, ett_allocation_tree, NULL, "Allocation %d", i/15);
15692         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15693         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_allocation_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15694         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pseudo_static, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15695         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_truncatable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15696         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_extendable, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15697         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_pcp_active, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15698         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_lp_sc_used, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15699         offset += 2;
15700         offset += add_fixed_field(alloc_tree, tvb, pinfo, offset, FIELD_BEAMFORMING_CTRL);
15701         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_src_aid, tvb, offset, 1, ENC_NA);
15702         offset += 1;
15703         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_dest_aid, tvb, offset, 1, ENC_NA);
15704         offset += 1;
15705         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15706         offset += 4;
15707         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15708         offset += 2;
15709         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_num_blocks, tvb, offset, 1, ENC_NA);
15710         offset += 1;
15711         proto_tree_add_item(alloc_tree, hf_ieee80211_tag_alloc_block_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15712         offset += 2;
15713       }
15714       break;
15715     }
15716     case TAG_STA_AVAILABILITY:
15717     {
15718       guint32 i = 0;
15719       proto_tree * sta_info_tree;
15720       if ((tag_len%2) != 0)
15721       {
15722         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be N*2 where N>=0", tag_len);
15723         break;
15724       }
15725       offset += 2;
15726       for(i=0; i < tag_len; i+=2) {
15727         sta_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 2, ett_sta_info, NULL, "STA Info %d", i/2);
15728         proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15729         proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_cbap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15730         proto_tree_add_item(sta_info_tree, hf_ieee80211_tag_pp_avail, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15731         offset += 2;
15732       }
15733       break;
15734     }
15735     case TAG_NEXT_DMG_ATI:
15736     {
15737       if (tag_len != 6)
15738       {
15739         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be = 6", tag_len);
15740         break;
15741       }
15742       offset += 2;
15743       proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15744       offset += 4;
15745       proto_tree_add_item(tree, hf_ieee80211_tag_next_ati_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15746       offset += 2;
15747       break;
15748     }
15749     case TAG_NEXTPCP_LIST:
15750     {
15751       guint32 i = 0;
15752       if (tag_len < 1)
15753       {
15754         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 1", tag_len);
15755         break;
15756       }
15757       offset += 2;
15758       proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_token, tvb, offset, 1, ENC_NA);
15759       offset += 1;
15760       for(i=0; i < tag_len-1; i+=1) {
15761         proto_tree_add_item(tree, hf_ieee80211_tag_nextpcp_list, tvb, offset, 1, ENC_NA);
15762         offset += 1;
15763       }
15764       break;
15765     }
15766     case TAG_PCP_HANDOVER:
15767     {
15768       if (tag_len != 13)
15769       {
15770         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 13", tag_len);
15771         break;
15772       }
15773       offset += 2;
15774       proto_tree_add_item(tree, hf_ieee80211_tag_old_bssid, tvb, offset, 6, ENC_NA);
15775       offset += 6;
15776       proto_tree_add_item(tree, hf_ieee80211_tag_new_pcp_addr, tvb, offset, 6, ENC_NA);
15777       offset += 6;
15778       proto_tree_add_item(tree, hf_ieee80211_tag_reamaining_BI, tvb, offset, 1, ENC_NA);
15779       offset += 1;
15780       break;
15781     }
15782     case TAG_BEAMLINK_MAINTAINCE:
15783     {
15784       if (tag_len != 1)
15785       {
15786         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
15787         break;
15788       }
15789       offset += 2;
15790       offset += add_ff_beamformed_link(tree, tvb, pinfo, offset);
15791       break;
15792     }
15793     case TAG_QUIET_PERIOD_RES:
15794     {
15795       if (tag_len != 10)
15796       {
15797         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 10", tag_len);
15798         break;
15799       }
15800       offset += 2;
15801       proto_tree_add_item(tree, hf_ieee80211_tag_request_token, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15802       offset += 2;
15803       proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
15804       offset += 6;
15805       offset += add_ff_sta_address(tree, tvb, pinfo, offset);
15806       break;
15807     }
15808     case TAG_RELAY_TRANSFER_PARAM:
15809     {
15810       if (tag_len != 8)
15811       {
15812         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
15813         break;
15814       }
15815       offset += 2;
15816       proto_tree_add_item(tree, hf_ieee80211_tag_duplex_relay, tvb, offset, 1, ENC_NA);
15817       proto_tree_add_item(tree, hf_ieee80211_tag_cooperation_relay, tvb, offset, 1, ENC_NA);
15818       proto_tree_add_item(tree, hf_ieee80211_tag_tx_mode, tvb, offset, 1, ENC_NA);
15819       proto_tree_add_item(tree, hf_ieee80211_tag_link_change_interval, tvb, offset+1, 1, ENC_NA);
15820       proto_tree_add_item(tree, hf_ieee80211_tag_data_sensing_time, tvb, offset+2, 1, ENC_NA);
15821       proto_tree_add_item(tree, hf_ieee80211_tag_first_period, tvb, offset+3, 2, ENC_LITTLE_ENDIAN);
15822       proto_tree_add_item(tree, hf_ieee80211_tag_second_period, tvb, offset+5, 2, ENC_LITTLE_ENDIAN);
15823       offset += 8;
15824       break;
15825     }
15826     case TAG_DMG_BEAM_REFINEMENT:
15827     {
15828       if (tag_len != 5)
15829       {
15830         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
15831         break;
15832       }
15833       offset += 2;
15834       proto_tree_add_item(tree, hf_ieee80211_tag_initiator, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15835       proto_tree_add_item(tree, hf_ieee80211_tag_tx_train_res, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15836       proto_tree_add_item(tree, hf_ieee80211_tag_rx_train_res, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15837       proto_tree_add_item(tree, hf_ieee80211_tag_tx_trn_ok, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15838       proto_tree_add_item(tree, hf_ieee80211_tag_txss_fbck_req, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15839       proto_tree_add_item(tree, hf_ieee80211_tag_bs_fbck, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15840       proto_tree_add_item(tree, hf_ieee80211_tag_bs_fbck_antenna_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15841       proto_tree_add_item(tree, hf_ieee80211_tag_snr_requested, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15842       proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_requested, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15843
15844       /*
15845        * This is confusing.
15846        * We don't support bitfields in fields bigger than 32 bits, and none
15847        * of the bitfields boundaries line up with byte boundaries, so we have
15848        * to slice this 40-bit field into overlapping pieces.
15849        *
15850        * The preceding piece had 16 bits, but the uppermost bit is the low-
15851        * order bit of the 2-bit "Number of Taps Requested" bitfield, so
15852        * we've only dissected the low-order 15 bits above.
15853        *
15854        * So we skip the first byte of those 16 bits, and fetch a 4-byte field
15855        * that starts with the second byte of those 16 bits.
15856        */
15857       offset += 1;
15858       proto_tree_add_item(tree, hf_ieee80211_tag_number_of_taps_requested, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15859       proto_tree_add_item(tree, hf_ieee80211_tag_sector_id_order_req, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15860       proto_tree_add_item(tree, hf_ieee80211_tag_snr_present, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15861       proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_present, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15862       proto_tree_add_item(tree, hf_ieee80211_tag_tap_delay_present, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15863       proto_tree_add_item(tree, hf_ieee80211_tag_number_of_taps_present, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15864       proto_tree_add_item(tree, hf_ieee80211_tag_number_of_measurement, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15865       proto_tree_add_item(tree, hf_ieee80211_tag_sector_id_order_present, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15866       proto_tree_add_item(tree, hf_ieee80211_tag_number_of_beams, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15867       proto_tree_add_item(tree, hf_ieee80211_tag_mid_extension, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15868       proto_tree_add_item(tree, hf_ieee80211_tag_capability_request, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15869       offset += 4;
15870       break;
15871     }
15872     case TAG_WAKEUP_SCHEDULE_AD:
15873     {
15874       if (tag_len != 8)
15875       {
15876         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
15877         break;
15878       }
15879       offset += 2;
15880       proto_tree_add_item(tree, hf_ieee80211_tag_bi_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15881       offset += 4;
15882       proto_tree_add_item(tree, hf_ieee80211_tag_sleep_cycle, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15883       offset += 2;
15884       proto_tree_add_item(tree, hf_ieee80211_tag_num_awake_bis, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15885       offset += 2;
15886       break;
15887     }
15888     case TAG_DMG_TSPEC:
15889     {
15890       gboolean isGrant;
15891       int num_constraints;
15892       if (tag_len < 14)
15893       {
15894         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 14", tag_len);
15895         break;
15896       }
15897       offset += 2;
15898       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_id, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15899       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_type, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15900       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_format, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15901       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_pseudo_static, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15902       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_truncatable, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15903       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_extendable, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15904       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_lp_sc_used, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15905       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_up, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15906       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_dest_aid, tvb, offset, 3, ENC_LITTLE_ENDIAN);
15907       offset += 3;
15908       isGrant = ((ftype==CTRL_GRANT)||(ftype==CTRL_GRANT_ACK));
15909       p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_CTRL_GRANT_OR_GRANT_ACK_KEY, &isGrant);
15910       offset += add_fixed_field(tree, tvb, pinfo, 2, FIELD_BEAMFORMING_CTRL);
15911       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_allocation_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15912       offset += 2;
15913       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15914       offset += 2;
15915       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_max_allocation, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15916       offset += 2;
15917       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_min_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15918       offset += 2;
15919       num_constraints = tvb_get_guint8(tvb, offset);
15920       proto_tree_add_item(tree, hf_ieee80211_tag_tspec_num_of_constraints, tvb, offset, 1, ENC_NA);
15921       offset += 1;
15922       while(num_constraints > 0) {
15923         proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_start_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
15924         offset += 4;
15925         proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15926         offset += 2;
15927         proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_period, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15928         offset += 2;
15929         proto_tree_add_item(tree, hf_ieee80211_tag_tspec_tsconst_interferer_mac, tvb, offset, 2, ENC_NA);
15930         offset += 6;
15931         num_constraints--;
15932       }
15933       break;
15934     }
15935     case TAG_CHANNEL_MEASURMENT_FB:
15936     {
15937       int num_measurement;
15938       if (tag_len%5 != 0)
15939       {
15940         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be multiple of 5", tag_len);
15941         break;
15942       }
15943       num_measurement = tvb_get_guint8(tvb, offset+1);
15944       offset += 2;
15945       while(num_measurement > 0) {
15946         proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
15947         offset += 1;
15948         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_I, tvb, offset, 1, ENC_NA);
15949         offset += 1;
15950         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_realtive_Q, tvb, offset, 1, ENC_NA);
15951         offset += 1;
15952         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_tap_delay, tvb, offset, 1, ENC_NA);
15953         offset += 1;
15954         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_sector_id, tvb, offset, 1, ENC_NA);
15955         proto_tree_add_item(tree, hf_ieee80211_tag_channel_measurement_feedback_antenna_id, tvb, offset, 1, ENC_NA);
15956         offset += 1;
15957         num_measurement--;
15958       }
15959       break;
15960     }
15961     case TAG_AWAKE_WINDOW:
15962     {
15963       if (tag_len != 2)
15964       {
15965         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 2", tag_len);
15966         break;
15967       }
15968       offset += 2;
15969       proto_tree_add_item(tree, hf_ieee80211_tag_awake_window, tvb, offset, 2, ENC_LITTLE_ENDIAN);
15970       offset += 2;
15971       break;
15972     }
15973     case TAG_ADDBA_EXT:
15974     {
15975       if (tag_len != 1)
15976       {
15977         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 1", tag_len);
15978         break;
15979       }
15980       offset += 2;
15981       proto_tree_add_item(tree, hf_ieee80211_tag_addba_ext_no_frag, tvb, offset, 1, ENC_NA);
15982       offset += 1;
15983       break;
15984     }
15985     case TAG_MULTI_BAND:
15986     {
15987       gboolean chiper_present, addr_present;
15988       if (tag_len < 22)
15989       {
15990         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 22", tag_len);
15991         break;
15992       }
15993       offset += 2;
15994       chiper_present = (tvb_get_letohs(tvb, offset) & 0x08) >> 3;
15995       addr_present = (tvb_get_letohs(tvb, offset) & 0x10) >> 4;
15996       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_ctrl_sta_role, tvb, offset, 1, ENC_NA);
15997       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_ctrl_addr_present, tvb, offset, 1, ENC_NA);
15998       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_ctrl_cipher_present, tvb, offset, 1, ENC_NA);
15999       offset += 1;
16000       offset += add_fixed_field(tree, tvb, pinfo, 1, FIELD_BAND_ID);
16001       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_oper_class, tvb, offset, 1, ENC_NA);
16002       offset += 1;
16003       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_channel_number, tvb, offset, 1, ENC_NA);
16004       offset += 1;
16005       proto_tree_add_item(tree, hf_ieee80211_tag_bssid, tvb, offset, 6, ENC_NA);
16006       offset += 6;
16007       offset += add_fixed_field(tree, tvb, pinfo, 2, FIELD_BEACON_INTERVAL);
16008       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_tsf_offset, tvb, offset, 8, ENC_LITTLE_ENDIAN);
16009       offset += 8;
16010       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_ap, tvb, offset, 1, ENC_NA);
16011       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_pcp, tvb, offset, 1, ENC_NA);
16012       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_dls, tvb, offset, 1, ENC_NA);
16013       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_tdls, tvb, offset, 1, ENC_NA);
16014       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_conn_ibss, tvb, offset, 1, ENC_NA);
16015       offset += 1;
16016       proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_fst_timeout, tvb, offset, 1, ENC_NA);
16017       offset += 1;
16018       if(addr_present)
16019       {
16020         proto_tree_add_item(tree, hf_ieee80211_tag_multi_band_sta_mac, tvb, offset, 6, ENC_NA);
16021         offset += 6;
16022       }
16023       if(chiper_present)
16024       {
16025         proto_item *rsn_pcs_count, *rsn_pcs_item, *rsn_sub_pcs_item;
16026         proto_tree *rsn_pcs_tree, *rsn_sub_pcs_tree;
16027         gint ii;
16028         guint16     pcs_count;
16029         rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
16030         pcs_count = tvb_get_letohs(tvb, offset);
16031         offset += 2;
16032
16033         if (offset + (pcs_count * 4) > tag_end)
16034         {
16035           expert_add_info_format(pinfo, rsn_pcs_count, &ei_ieee80211_rsn_pcs_count,
16036           "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
16037           pcs_count = (tag_end - offset) / 4;
16038         }
16039
16040         rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
16041         rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
16042         for (ii = 0; ii < pcs_count; ii++)
16043         {
16044           rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
16045           rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
16046           proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
16047
16048           /* Check if OUI is 00:0F:AC (ieee80211) */
16049           if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
16050           {
16051             proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
16052             proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
16053           } else {
16054             proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_LITTLE_ENDIAN);
16055           }
16056           offset += 4;
16057         }
16058       }
16059       break;
16060     }
16061     case TAG_DMG_LINK_MARGIN:
16062     {
16063       if (tag_len != 8)
16064       {
16065         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 8", tag_len);
16066         break;
16067       }
16068       offset += 2;
16069       proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
16070       offset += 1;
16071       proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_mcs, tvb, offset, 1, ENC_NA);
16072       offset += 1;
16073       proto_tree_add_item(tree, hf_ieee80211_tag_dmg_link_adapt_link_margin, tvb, offset, 1, ENC_NA);
16074       offset += 1;
16075       proto_tree_add_item(tree, hf_ieee80211_ff_snr, tvb, offset, 1, ENC_NA);
16076       offset += 1;
16077       proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16078       offset += 4;
16079       break;
16080     }
16081     case TAG_DMG_LINK_ADAPTION_ACK:
16082     {
16083       if (tag_len != 5)
16084       {
16085         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be 5", tag_len);
16086         break;
16087       }
16088       offset += 2;
16089       proto_tree_add_item(tree, hf_ieee80211_tag_activity, tvb, offset, 1, ENC_NA);
16090       offset += 1;
16091       proto_tree_add_item(tree, hf_ieee80211_tag_ref_timestamp, tvb, offset, 3, ENC_LITTLE_ENDIAN);
16092       offset += 4;
16093       break;
16094     }
16095     case TAG_SWITCHING_STREAM:
16096     {
16097       int param_num;
16098       if (tag_len < 4)
16099       {
16100         expert_add_info_format(pinfo, ti_len, &ei_ieee80211_tag_length, "Tag Length %u wrong, must be at least 4", tag_len);
16101         break;
16102       }
16103       offset += 2;
16104       offset += add_fixed_field(tree, tvb, pinfo, 1, FIELD_BAND_ID);
16105       offset += add_fixed_field(tree, tvb, pinfo, 1, FIELD_BAND_ID);
16106       proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_non_qos, tvb, offset, 1, ENC_NA);
16107       offset += 1;
16108       param_num = tvb_get_letohs(tvb, offset);
16109       proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_param_num, tvb, offset, 1, ENC_NA);
16110       offset += 1;
16111       while(param_num > 0)
16112       {
16113         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_old_tid, tvb, offset, 1, ENC_NA);
16114         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_old_direction, tvb, offset, 1, ENC_NA);
16115         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_new_tid, tvb, offset, 1, ENC_NA);
16116         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_new_direction, tvb, offset, 1, ENC_NA);
16117         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_new_valid_id, tvb, offset, 1, ENC_NA);
16118         proto_tree_add_item(tree, hf_ieee80211_tag_switching_stream_llt_type, tvb, offset, 1, ENC_NA);
16119         param_num--;
16120         offset += 2;
16121       }
16122       break;
16123     }
16124     default:
16125       proto_tree_add_item(tree, hf_ieee80211_tag_data, tvb, offset + 1 + 1, tag_len, ENC_NA);
16126       expert_add_info_format(pinfo, ti_tag, &ei_ieee80211_tag_data,
16127                              "Dissector for 802.11 IE Tag"
16128                              " (%s) code not implemented, Contact"
16129                              " Wireshark developers if you want this supported", val_to_str_ext(tag_no,
16130                                             &tag_num_vals_ext, "(%d)"));
16131       proto_item_append_text(ti, ": Undecoded");
16132       break;
16133   }
16134   if (offset < tag_end) {
16135     /* TODO: add Expert info to indicate there is unknown data ! but all tagged option don't yet return offset.
16136       For the moment, this code only remove Clang Warnings about not used offset... */
16137   }
16138   return tag_len + 1 + 1;
16139 }
16140
16141 static void
16142 ieee_80211_add_tagged_parameters (tvbuff_t *tvb, int offset, packet_info *pinfo,
16143                                   proto_tree *tree, int tagged_parameters_len, int ftype)
16144 {
16145   int next_len;
16146   beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
16147   while (tagged_parameters_len > 0) {
16148     if ((next_len=add_tagged_field (pinfo, tree, tvb, offset, ftype)) == 0)
16149       break;
16150     if (next_len > tagged_parameters_len) {
16151       /* XXX - flag this as an error? */
16152       next_len = tagged_parameters_len;
16153     }
16154     offset                += next_len;
16155     tagged_parameters_len -= next_len;
16156   }
16157 }
16158
16159 /* ************************************************************************* */
16160 /*                     Dissect 802.11 management frame                       */
16161 /* ************************************************************************* */
16162 static void
16163 dissect_ieee80211_mgt (guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
16164 {
16165   proto_item *ti;
16166   proto_tree *mgt_tree;
16167   proto_tree *fixed_tree;
16168   proto_tree *tagged_tree;
16169   int         offset = 0;
16170   int         tagged_parameter_tree_len;
16171
16172   ieee80211_tvb_invalid = FALSE;
16173
16174   /* check protocol activation */
16175   if (!proto_is_protocol_enabled(find_protocol_by_id(proto_wlan_mgt))) {
16176     call_dissector(data_handle,tvb, pinfo, tree);
16177     return;
16178   }
16179
16180   ti = proto_tree_add_item (tree, proto_wlan_mgt, tvb, 0, -1, ENC_NA);
16181   mgt_tree = proto_item_add_subtree (ti, ett_80211_mgt);
16182
16183   switch (COMPOSE_FRAME_TYPE(fcf))
16184   {
16185
16186     case MGT_ASSOC_REQ:
16187       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 4);
16188       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
16189       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_LISTEN_IVAL);
16190       offset = 4;  /* Size of fixed fields */
16191
16192       tagged_parameter_tree_len =
16193           tvb_reported_length_remaining(tvb, offset);
16194       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
16195                  tagged_parameter_tree_len);
16196       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16197           tagged_parameter_tree_len, MGT_ASSOC_REQ);
16198       break;
16199
16200
16201     case MGT_ASSOC_RESP:
16202       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
16203       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
16204       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_STATUS_CODE);
16205       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_ASSOC_ID);
16206       offset = 6;  /* Size of fixed fields */
16207
16208       tagged_parameter_tree_len =
16209           tvb_reported_length_remaining(tvb, offset);
16210       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
16211                  tagged_parameter_tree_len);
16212       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16213           tagged_parameter_tree_len, MGT_ASSOC_RESP);
16214       break;
16215
16216
16217     case MGT_REASSOC_REQ:
16218       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 10);
16219       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
16220       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_LISTEN_IVAL);
16221       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_CURRENT_AP_ADDR);
16222       offset = 10;  /* Size of fixed fields */
16223
16224       tagged_parameter_tree_len =
16225           tvb_reported_length_remaining(tvb, offset);
16226       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
16227                  tagged_parameter_tree_len);
16228       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16229           tagged_parameter_tree_len, MGT_REASSOC_REQ);
16230       break;
16231
16232     case MGT_REASSOC_RESP:
16233       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
16234       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
16235       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_STATUS_CODE);
16236       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_ASSOC_ID);
16237       offset = 6;  /* Size of fixed fields */
16238
16239       tagged_parameter_tree_len =
16240           tvb_reported_length_remaining(tvb, offset);
16241       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
16242                  tagged_parameter_tree_len);
16243       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16244           tagged_parameter_tree_len, MGT_REASSOC_RESP);
16245       break;
16246
16247
16248     case MGT_PROBE_REQ:
16249       offset = 0;
16250       tagged_parameter_tree_len =
16251           tvb_reported_length_remaining(tvb, offset);
16252       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
16253                  tagged_parameter_tree_len);
16254       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16255           tagged_parameter_tree_len, MGT_PROBE_REQ);
16256       break;
16257
16258     case MGT_PROBE_RESP:
16259     {
16260       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
16261       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_TIMESTAMP);
16262       add_fixed_field(fixed_tree, tvb, pinfo, 8, FIELD_BEACON_INTERVAL);
16263       add_fixed_field(fixed_tree, tvb, pinfo, 10, FIELD_CAP_INFO);
16264       offset = 12;  /* Size of fixed fields */
16265
16266       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16267       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
16268       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_PROBE_RESP);
16269       break;
16270     }
16271     case MGT_MEASUREMENT_PILOT:
16272     {
16273       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
16274       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TIMESTAMP);
16275       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MEASUREMENT_PILOT_INT);
16276       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_BEACON_INTERVAL);
16277       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_CAP_INFO);
16278       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_COUNTRY_STR);
16279       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MAX_REG_PWR);
16280       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MAX_TX_PWR);
16281       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TX_PWR_USED);
16282       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TRANSCEIVER_NOISE_FLOOR);
16283       /* TODO DS Parameter Set ??? */
16284
16285       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16286       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
16287       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_MEASUREMENT_PILOT);
16288       break;
16289     }
16290     case MGT_BEACON:    /* Dissect protocol payload fields  */
16291       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
16292       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_TIMESTAMP);
16293       add_fixed_field(fixed_tree, tvb, pinfo, 8, FIELD_BEACON_INTERVAL);
16294       add_fixed_field(fixed_tree, tvb, pinfo, 10, FIELD_CAP_INFO);
16295       offset = 12;  /* Size of fixed fields */
16296
16297       tagged_parameter_tree_len =
16298           tvb_reported_length_remaining(tvb, offset);
16299       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
16300       tagged_parameter_tree_len);
16301       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16302       tagged_parameter_tree_len, MGT_BEACON);
16303       break;
16304
16305     case MGT_ATIM:
16306       break;
16307
16308     case MGT_DISASS:
16309       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
16310       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_REASON_CODE);
16311       offset = 2; /* Size of fixed fields */
16312       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16313       if (tagged_parameter_tree_len > 0) {
16314         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16315                                                 tagged_parameter_tree_len);
16316         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16317                                          tagged_parameter_tree_len, MGT_DISASS);
16318       }
16319       break;
16320
16321     case MGT_AUTHENTICATION:
16322       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
16323       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_AUTH_ALG);
16324       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_AUTH_TRANS_SEQ);
16325       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_STATUS_CODE);
16326       offset = 6;  /* Size of fixed fields */
16327
16328       tagged_parameter_tree_len =
16329         tvb_reported_length_remaining(tvb, offset);
16330       if (tagged_parameter_tree_len > 0)
16331       {
16332         tagged_tree = get_tagged_parameter_tree (mgt_tree,
16333             tvb,
16334             offset,
16335             tagged_parameter_tree_len);
16336         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16337         tagged_parameter_tree_len, MGT_AUTHENTICATION);
16338       }
16339       break;
16340
16341     case MGT_DEAUTHENTICATION:
16342       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
16343       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_REASON_CODE);
16344       offset = 2; /* Size of fixed fields */
16345       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16346       if (tagged_parameter_tree_len > 0) {
16347         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
16348                                                 tagged_parameter_tree_len);
16349         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
16350                                          tagged_parameter_tree_len, MGT_DEAUTHENTICATION);
16351       }
16352       break;
16353
16354     case MGT_ACTION:
16355     {
16356       proto_item *lcl_fixed_hdr;
16357       proto_tree *lcl_fixed_tree;
16358       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
16359       offset += add_fixed_field(lcl_fixed_tree, tvb, pinfo, 0, FIELD_ACTION);
16360
16361       proto_item_set_len(lcl_fixed_hdr, offset);
16362       if (ieee80211_tvb_invalid)
16363         break; /* Buffer not available for further processing */
16364       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16365       if (tagged_parameter_tree_len > 0)
16366       {
16367         tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
16368           tagged_parameter_tree_len);
16369         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16370           tagged_parameter_tree_len, MGT_ACTION);
16371       }
16372       break;
16373     }
16374     case MGT_ACTION_NO_ACK:
16375     {
16376       proto_item *lcl_fixed_hdr;
16377       proto_tree *lcl_fixed_tree;
16378       lcl_fixed_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, &lcl_fixed_hdr, "Fixed parameters");
16379
16380       offset += add_fixed_field(lcl_fixed_tree, tvb, pinfo, 0, FIELD_ACTION);
16381
16382       proto_item_set_len(lcl_fixed_hdr, offset);
16383       if (ieee80211_tvb_invalid)
16384         break; /* Buffer not available for further processing */
16385       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
16386       if (tagged_parameter_tree_len > 0)
16387       {
16388         tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
16389           tagged_parameter_tree_len);
16390         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
16391           tagged_parameter_tree_len, MGT_ACTION_NO_ACK);
16392       }
16393       break;
16394     }
16395     case MGT_ARUBA_WLAN:
16396     {
16397       proto_tree *aruba_tree;
16398       guint16 type;
16399       type = tvb_get_ntohs(tvb, offset);
16400
16401       aruba_tree = proto_tree_add_subtree(mgt_tree, tvb, 0, 0, ett_fixed_parameters, NULL, "Aruba Management");
16402
16403       proto_tree_add_item(aruba_tree, hf_ieee80211_aruba, tvb, offset, 2, ENC_BIG_ENDIAN);
16404       offset += 2;
16405       switch(type){
16406         case 0x0003: /* MTU Size */
16407           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_mtu, tvb, offset, 2, ENC_BIG_ENDIAN);
16408         break;
16409         case 0x0005: /* HeartBeat Sequence */
16410           proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_hb_seq, tvb, offset, 8, ENC_BIG_ENDIAN);
16411         break;
16412       }
16413       break;
16414     }
16415   }
16416 }
16417
16418 static void
16419 set_src_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
16420 {
16421   address      ether_addr;
16422
16423   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
16424
16425   col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
16426         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
16427 }
16428
16429 static void
16430 set_dst_addr_cols(packet_info *pinfo, tvbuff_t *tvb, int offset, const char *type)
16431 {
16432   address      ether_addr;
16433
16434   set_address_tvb(&ether_addr, AT_ETHER, 6, tvb, offset);
16435
16436   col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
16437         address_with_resolution_to_str(wmem_packet_scope(), &ether_addr), type);
16438 }
16439
16440 static guint32
16441 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
16442 {
16443   guint32 c_crc;
16444
16445   c_crc = crc32_ccitt_tvb(tvb, hdr_len);
16446   c_crc = crc32_ccitt_tvb_offset_seed(tvb, hdr_size, len, ~c_crc);
16447
16448   /* Byte reverse. */
16449   c_crc = ((unsigned char)(c_crc>>0)<<24) |
16450     ((unsigned char)(c_crc>>8)<<16) |
16451     ((unsigned char)(c_crc>>16)<<8) |
16452     ((unsigned char)(c_crc>>24)<<0);
16453
16454   return (c_crc);
16455 }
16456
16457 typedef enum {
16458     ENCAP_802_2,
16459     ENCAP_IPX,
16460     ENCAP_ETHERNET
16461 } encap_t;
16462
16463 /* ************************************************************************* */
16464 /*                          Dissect 802.11 frame                             */
16465 /* ************************************************************************* */
16466
16467 /*
16468  * The 802.11n specification makes some fairly significant changes to the
16469  * layout of the MAC header.  The first two bits of the MAC header are the
16470  * protocol version.  You'd think that the 802.11 committee would have
16471  * bumped the version to indicate a different MAC layout, but NOOOO -- we
16472  * have to go digging for bits in various locations instead.
16473  */
16474
16475 static int
16476 dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
16477                           proto_tree *tree, gboolean wlan_broken_fc,
16478                           gboolean is_centrino,
16479                           struct ieee_802_11_phdr *phdr)
16480 {
16481   guint16          fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
16482   guint16          cw_fcf;
16483   guint16          seq_control;
16484   guint32          seq_number, frag_number;
16485   gboolean         more_frags;
16486   proto_item      *ti          = NULL;
16487   proto_item      *fcs_item    = NULL;
16488   proto_item      *cw_item     = NULL;
16489   proto_item      *hidden_item;
16490   proto_tree      *fcs_tree    = NULL;
16491   proto_tree      *cw_tree     = NULL;
16492   guint16          hdr_len, ohdr_len;
16493   guint16          htc_len     = 0;
16494   gboolean         has_fcs, fcs_good, fcs_bad;
16495   gint             len, reported_len, ivlen;
16496   gint             sta_addr_offset = 0;
16497   gchar           *station_name;
16498   gboolean         is_amsdu    = 0;
16499   gboolean         save_fragmented;
16500   guint32          addr_type;
16501   guint8           octet1, octet2;
16502   char             out_buff[SHORT_STR];
16503   gint             is_iv_bad;
16504   guchar           iv_buff[4];
16505   const char      *addr1_str   = NULL;
16506   int              addr1_hf    = -1, addr1_hf_resolved = -1;
16507   guint            offset;
16508   const gchar     *fts_str;
16509   gchar            flag_str[]  = "opmPRMFTC";
16510   gint             ii;
16511   guint16          qosoff      = 0;
16512   guint16          qos_control = 0;
16513   gint             meshctl_len = 0;
16514   guint8           mesh_flags;
16515   guint16          meshoff     = 0;
16516   static wlan_hdr_t whdrs[4];
16517   gboolean         retransmitted;
16518   gboolean         isDMG = (phdr->has_frequency ?
16519                                 IS_80211AD(phdr->frequency) :
16520                                 FALSE);
16521
16522   encap_t     encap_type;
16523   proto_tree *hdr_tree = NULL;
16524   tvbuff_t   *next_tvb = NULL;
16525   wlan_hdr_t *whdr;
16526
16527   AIRPDCAP_KEY_ITEM  used_key;
16528
16529   p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_DMG_KEY, &isDMG);
16530
16531   whdr= &whdrs[0];
16532
16533   col_set_str (pinfo->cinfo, COL_PROTOCOL, "802.11");
16534   col_clear(pinfo->cinfo, COL_INFO);
16535
16536   fcf = FETCH_FCF(0);
16537   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
16538   whdr->type = frame_type_subtype;
16539   if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
16540     ctrl_fcf = FETCH_FCF(10);
16541   else
16542     ctrl_fcf = 0;
16543
16544   fts_str = val_to_str_ext_const(frame_type_subtype, &frame_type_subtype_vals_ext,
16545                                  "Unrecognized (Reserved frame)");
16546   col_set_str (pinfo->cinfo, COL_INFO, fts_str);
16547
16548
16549 # define FROM_TO_DS 3
16550   flags = FCF_FLAGS (fcf);
16551   more_frags = HAVE_FRAGMENTS (flags);
16552
16553   for (ii = 0; ii < 8; ii++) {
16554     if (! (flags & 0x80 >> ii)) {
16555       flag_str[ii] = '.';
16556     }
16557   }
16558
16559   switch (FCF_FRAME_TYPE (fcf)) {
16560
16561   case MGT_FRAME:
16562     hdr_len = MGT_FRAME_HDR_LEN;
16563     if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
16564       /*
16565        * Management frames with the Order bit set have an HT Control field;
16566        * see 8.2.4.1.10 "Order field".  If they're not HT frames, they should
16567        * never have the Order bit set.
16568        */
16569       hdr_len += 4;
16570       htc_len = 4;
16571     }
16572     break;
16573
16574   case CONTROL_FRAME:
16575     if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
16576       hdr_len = 6;
16577       cw_fcf = ctrl_fcf;
16578     } else {
16579       hdr_len = 0;
16580       cw_fcf = fcf;
16581     }
16582     switch (COMPOSE_FRAME_TYPE (cw_fcf)) {
16583
16584     case CTRL_BEAMFORM_RPT_POLL:
16585       hdr_len += 17;
16586       break;
16587
16588     case CTRL_VHT_NDP_ANNC:
16589       hdr_len += 17;
16590       /* TODO: for now we only consider a single STA, add support for more */
16591       hdr_len += 2;
16592       break;
16593
16594     case CTRL_CTS:
16595     case CTRL_ACKNOWLEDGEMENT:
16596       hdr_len += 10;
16597       break;
16598
16599     case CTRL_POLL:
16600       hdr_len += 18;
16601       break;
16602
16603     case CTRL_SPR:
16604     case CTRL_GRANT:
16605     case CTRL_GRANT_ACK:
16606       hdr_len += 23;
16607       break;
16608
16609     case CTRL_DMG_CTS:
16610       hdr_len += 16;
16611       break;
16612
16613     case CTRL_DMG_DTS:
16614     case CTRL_SSW:
16615       hdr_len += 22;
16616       break;
16617
16618     case CTRL_SSW_FEEDBACK:
16619     case CTRL_SSW_ACK:
16620       hdr_len += 24;
16621       break;
16622
16623     case CTRL_RTS:
16624     case CTRL_PS_POLL:
16625     case CTRL_CFP_END:
16626     case CTRL_CFP_ENDACK:
16627     case CTRL_BLOCK_ACK_REQ:
16628     case CTRL_BLOCK_ACK:
16629       hdr_len += 16;
16630       break;
16631
16632     default:
16633       hdr_len += 4;  /* XXX */
16634       break;
16635     }
16636     break;
16637
16638   case DATA_FRAME:
16639     hdr_len = (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
16640
16641     if (DATA_FRAME_IS_QOS(frame_type_subtype)) {
16642       /* QoS frame */
16643       qosoff = hdr_len;
16644       hdr_len += 2; /* Include the QoS field in the header length */
16645
16646       if (HAS_HT_CONTROL(FCF_FLAGS(fcf))) {
16647         /*
16648          * QoS data frames with the Order bit set have an HT Control field;
16649          * see 8.2.4.1.10 "Order field".  If they're not HT frames, they
16650          * should never have the Order bit set.
16651          */
16652         hdr_len += 4;
16653         htc_len = 4;
16654       }
16655
16656       /*
16657        * Does it look as if we have a mesh header?
16658        * Look at the Mesh Control subfield of the QoS field and at the
16659        * purported mesh flag fields.
16660        */
16661       qos_control = tvb_get_letohs(tvb, qosoff);
16662       if (tvb_bytes_exist(tvb, hdr_len, 1)) {
16663         meshoff = hdr_len;
16664         mesh_flags = tvb_get_guint8 (tvb, meshoff);
16665         if (has_mesh_control(fcf, qos_control, mesh_flags)) {
16666           /* Yes, add the length of that in as well. */
16667           meshctl_len = find_mesh_control_length(mesh_flags);
16668           hdr_len += meshctl_len;
16669         }
16670       }
16671     }
16672     break;
16673
16674   case EXTENSION_FRAME:
16675     hdr_len = 10;
16676     break;
16677
16678   default:
16679     hdr_len = 4;  /* XXX */
16680     break;
16681   }
16682
16683   /*
16684    * Some portions of this code calculate offsets relative to the end of the
16685    * header.  But when the header has been padded to align the data this must
16686    * be done relative to true header size, not the padded/aligned value.  To
16687    * simplify this work we stash the original header size in ohdr_len instead
16688    * of recalculating it every time we need it.
16689    */
16690   ohdr_len = hdr_len;
16691   if (phdr->datapad) {
16692     /*
16693      * Add in Atheros padding between the 802.11 header and body.
16694      *
16695      * XXX - would the mesh header be part of the header or the body
16696      * from the point of view of the Atheros adapters that insert
16697      * the padding, assuming they even recognize a mesh header?
16698      */
16699     hdr_len = roundup2(hdr_len, 4);
16700   }
16701
16702   /* Add the FC and duration/id to the current tree */
16703   ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
16704                                            "IEEE 802.11 %s", fts_str);
16705   hdr_tree = proto_item_add_subtree (ti, ett_80211);
16706
16707   dissect_frame_control(hdr_tree, tvb, wlan_broken_fc, 0, pinfo);
16708   dissect_durid(hdr_tree, tvb, frame_type_subtype, 2);
16709
16710   switch (phdr->fcs_len)
16711     {
16712       case 0: /* Definitely has no FCS */
16713         has_fcs = FALSE;
16714         break;
16715
16716       case 4: /* Definitely has an FCS */
16717         has_fcs = TRUE;
16718         break;
16719
16720       case -2: /* Data frames have no FCS, other frames may have an FCS */
16721                /* XXX: -2 currently used only in wiretap/netmon.c       */
16722         if (FCF_FRAME_TYPE (fcf) == DATA_FRAME)
16723           has_fcs = FALSE;
16724         else /* Management, Control, Extension */
16725           has_fcs = wlan_check_fcs;
16726         break;
16727
16728       default: /* Don't know - use "wlan_check_fcs" */
16729         has_fcs = wlan_check_fcs;
16730         break;
16731     }
16732
16733   /*
16734    * Decode the part of the frame header that isn't the same for all
16735    * frame types.
16736    */
16737   seq_control = 0;
16738   frag_number = 0;
16739   seq_number = 0;
16740
16741   switch (FCF_FRAME_TYPE (fcf))
16742   {
16743
16744     case MGT_FRAME:
16745       /*
16746        * All management frame types have the same header.
16747        */
16748       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, 10);
16749       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
16750       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, 4);
16751       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
16752
16753       /* for tap */
16754       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, 16);
16755       copy_address_shallow(&whdr->src, &pinfo->dl_src);
16756       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
16757
16758       seq_control = tvb_get_letohs(tvb, 22);
16759       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
16760       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
16761
16762       col_append_fstr(pinfo->cinfo, COL_INFO,
16763             ", SN=%d", seq_number);
16764
16765       col_append_fstr(pinfo->cinfo, COL_INFO,
16766             ", FN=%d",frag_number);
16767
16768       if (tree)
16769       {
16770         gchar *ra_da_name, *ta_sa_name, *bssid_name;
16771
16772         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
16773         ra_da_name = tvb_get_ether_name(tvb, 4);
16774         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ra_resolved, tvb, 4, 6, ra_da_name);
16775         PROTO_ITEM_SET_HIDDEN(hidden_item);
16776         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
16777         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_da_resolved, tvb, 4, 6, ra_da_name);
16778         PROTO_ITEM_SET_HIDDEN(hidden_item);
16779         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
16780         ta_sa_name = tvb_get_ether_name(tvb, 10);
16781         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, 10, 6, ta_sa_name);
16782         PROTO_ITEM_SET_HIDDEN(hidden_item);
16783         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
16784         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, 10, 6, ta_sa_name);
16785         PROTO_ITEM_SET_HIDDEN(hidden_item);
16786         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
16787         bssid_name = tvb_get_ether_name(tvb, 16);
16788         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, 16, 6, bssid_name);
16789         PROTO_ITEM_SET_HIDDEN(hidden_item);
16790
16791         /* FIXME: With mgmt frames FROM_TO_DS is always 0, perhaps compare address to bssid instead? */
16792         if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
16793           sta_addr_offset = 4;
16794         } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
16795           sta_addr_offset = 10;
16796         }
16797         if (sta_addr_offset > 0) {
16798           proto_tree_add_item (hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
16799           station_name = tvb_get_ether_name(tvb, sta_addr_offset);
16800           hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
16801           PROTO_ITEM_SET_HIDDEN(hidden_item);
16802         }
16803         /* add items for wlan.addr filter */
16804         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
16805         PROTO_ITEM_SET_HIDDEN(hidden_item);
16806         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, 4, 6, ra_da_name);
16807         PROTO_ITEM_SET_HIDDEN(hidden_item);
16808         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
16809         PROTO_ITEM_SET_HIDDEN(hidden_item);
16810         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, 10, 6, ta_sa_name);
16811         PROTO_ITEM_SET_HIDDEN(hidden_item);
16812         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
16813         PROTO_ITEM_SET_HIDDEN(hidden_item);
16814         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, 16, 6, bssid_name);
16815         PROTO_ITEM_SET_HIDDEN(hidden_item);
16816         proto_tree_add_item (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
16817         proto_tree_add_item (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
16818       }
16819       break;
16820
16821     case CONTROL_FRAME:
16822     {
16823       /*
16824        * Control Wrapper frames insert themselves between address 1
16825        * and address 2 in a normal control frame.  Process address 1
16826        * first, then handle the rest of the frame in dissect_control.
16827        */
16828       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
16829         offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
16830         ctrl_fcf = FETCH_FCF(10);
16831         ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
16832       } else {
16833         offset = 10; /* FC + D/ID + Address 1 */
16834         ctrl_type_subtype = frame_type_subtype;
16835       }
16836       /* Added to disallow DMG STA to transfer packets of certain forbidden types. */
16837       switch (ctrl_type_subtype)
16838       {
16839         case CTRL_PS_POLL:
16840         case CTRL_CTS:
16841         case CTRL_CFP_ENDACK:
16842         if(isDMG == TRUE) {
16843           expert_add_info_format(pinfo, hdr_tree, &ei_ieee80211_dmg_subtype,
16844               "DMG STA shouldn't transmit control frame of type contention-free period end+ack");
16845         }
16846         break;
16847         default:
16848           break;
16849       }
16850
16851       switch (ctrl_type_subtype)
16852       {
16853         case CTRL_PS_POLL:
16854           addr1_str = "BSSID";
16855           addr1_hf = hf_ieee80211_addr_bssid;
16856           addr1_hf_resolved = hf_ieee80211_addr_bssid_resolved;
16857
16858           break;
16859         case CTRL_BEAMFORM_RPT_POLL:
16860         case CTRL_VHT_NDP_ANNC:
16861         case CTRL_RTS:
16862         case CTRL_POLL:
16863         case CTRL_SPR:
16864         case CTRL_GRANT:
16865         case CTRL_DMG_CTS:
16866         case CTRL_DMG_DTS:
16867         case CTRL_GRANT_ACK:
16868         case CTRL_SSW:
16869         case CTRL_SSW_FEEDBACK:
16870         case CTRL_SSW_ACK:
16871         case CTRL_CTS:
16872         case CTRL_ACKNOWLEDGEMENT:
16873         case CTRL_CFP_END:
16874         case CTRL_CFP_ENDACK:
16875         case CTRL_BLOCK_ACK_REQ:
16876         case CTRL_BLOCK_ACK:
16877           addr1_str = "RA";
16878           addr1_hf = hf_ieee80211_addr_ra;
16879           addr1_hf_resolved = hf_ieee80211_addr_ra_resolved;
16880           break;
16881         default:
16882           break;
16883       }
16884
16885       if (!addr1_str) /* XXX - Should we throw some sort of error? */
16886         break;
16887
16888       /* Add address 1 */
16889       set_dst_addr_cols(pinfo, tvb, 4, addr1_str);
16890       if (tree) {
16891         gchar* ether_name = tvb_get_ether_name(tvb, 4);
16892         proto_tree_add_item(hdr_tree, addr1_hf, tvb, 4, 6, ENC_NA);
16893         hidden_item = proto_tree_add_string (hdr_tree, addr1_hf_resolved, tvb, 4, 6, ether_name);
16894         PROTO_ITEM_SET_HIDDEN(hidden_item);
16895         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
16896         PROTO_ITEM_SET_HIDDEN(hidden_item);
16897         hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, 4, 6, ether_name);
16898         PROTO_ITEM_SET_HIDDEN(hidden_item);
16899       }
16900
16901       /*
16902        * Start shoving in other fields if needed.
16903        */
16904       if ((frame_type_subtype == CTRL_CONTROL_WRAPPER) && tree) {
16905         cw_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
16906                     ett_cntrl_wrapper_fc, NULL, "Contained Frame Control");
16907         dissect_frame_control(cw_tree, tvb, FALSE, offset, pinfo);
16908         dissect_ht_control(hdr_tree, tvb, offset + 2);
16909         offset += 6;
16910         hdr_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, 2,
16911                     ett_cntrl_wrapper_fc, &cw_item, "Carried Frame");
16912          if(isDMG == TRUE) {
16913                  expert_add_info_format(pinfo, cw_item, &ei_ieee80211_dmg_subtype,
16914                  "DMG STA shouldn't transmit Control Wrapper frame");
16915          }
16916       }
16917
16918       if ((frame_type_subtype == CTRL_CFP_END) && tree) {
16919           if(isDMG == TRUE)
16920                   set_src_addr_cols(pinfo, tvb, offset, "TA");
16921           else
16922                   set_src_addr_cols(pinfo, tvb, offset, "BSSID");
16923           if (tree) {
16924             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
16925             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
16926             PROTO_ITEM_SET_HIDDEN(hidden_item);
16927           }
16928         offset += 6;
16929       }
16930
16931       switch (ctrl_type_subtype)
16932       {
16933         case CTRL_PS_POLL:
16934         case CTRL_CFP_END:
16935         case CTRL_CFP_ENDACK:
16936         {
16937           set_src_addr_cols(pinfo, tvb, offset, "BSSID");
16938           if (tree) {
16939             gchar* ether_name = tvb_get_ether_name(tvb, offset);
16940             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
16941             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
16942             PROTO_ITEM_SET_HIDDEN(hidden_item);
16943             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
16944             PROTO_ITEM_SET_HIDDEN(hidden_item);
16945             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
16946             PROTO_ITEM_SET_HIDDEN(hidden_item);
16947             offset += 6;
16948           }
16949           break;
16950         }
16951
16952         case CTRL_BEAMFORM_RPT_POLL:
16953         {
16954           set_src_addr_cols(pinfo, tvb, offset, "TA");
16955           if (tree) {
16956             gchar *ether_name = tvb_get_ether_name(tvb, offset);
16957
16958             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
16959             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
16960             PROTO_ITEM_SET_HIDDEN(hidden_item);
16961             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
16962             PROTO_ITEM_SET_HIDDEN(hidden_item);
16963             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
16964             PROTO_ITEM_SET_HIDDEN(hidden_item);
16965             offset += 6;
16966
16967             proto_tree_add_item(hdr_tree, hf_ieee80211_beamform_feedback_seg_retrans_bitmap, tvb, offset, 1, ENC_NA);
16968           }
16969         break;
16970         }
16971
16972         case CTRL_VHT_NDP_ANNC:
16973         {
16974           set_src_addr_cols(pinfo, tvb, offset, "TA");
16975           if (tree) {
16976             guint16 sta_info;
16977             guint8 len_fcs = 0;
16978             proto_tree *dialog_token_tree;
16979             proto_item *dialog_token_item;
16980             proto_tree *sta_info_tree;
16981             proto_item *sta_info_item;
16982             gchar* ether_name = tvb_get_ether_name(tvb, offset);
16983
16984             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
16985             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
16986             PROTO_ITEM_SET_HIDDEN(hidden_item);
16987             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
16988             PROTO_ITEM_SET_HIDDEN(hidden_item);
16989             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
16990             PROTO_ITEM_SET_HIDDEN(hidden_item);
16991             offset += 6;
16992
16993             dialog_token_item = proto_tree_add_item(hdr_tree, hf_ieee80211_vht_ndp_annc_token,
16994                                                     tvb, offset, 1, ENC_NA);
16995             dialog_token_tree = proto_item_add_subtree(dialog_token_item, ett_vht_ndp_annc_token_tree);
16996             proto_tree_add_item(dialog_token_tree, hf_ieee80211_vht_ndp_annc_token_number,
16997                                 tvb, offset, 1, ENC_NA);
16998             proto_tree_add_item(dialog_token_tree, hf_ieee80211_vht_ndp_annc_token_reserved,
16999                                 tvb, offset, 1, ENC_NA);
17000             offset++;
17001
17002             /* Check if there is FCS in the packet */
17003             if(has_fcs){
17004               len_fcs = 4;
17005             }
17006             while (tvb_reported_length_remaining(tvb, offset) > len_fcs) {
17007               sta_info_item = proto_tree_add_item(hdr_tree, hf_ieee80211_vht_ndp_annc_sta_info,
17008                                                   tvb, offset, 2, ENC_LITTLE_ENDIAN);
17009               sta_info_tree = proto_item_add_subtree(sta_info_item, ett_vht_ndp_annc_sta_info_tree);
17010               proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_aid12,
17011                                   tvb, offset, 2, ENC_LITTLE_ENDIAN);
17012               proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
17013                                   tvb, offset, 2, ENC_LITTLE_ENDIAN);
17014
17015               sta_info = tvb_get_letohs(tvb, offset);
17016
17017               if (sta_info & 0x0010)
17018                 proto_tree_add_uint(sta_info_tree,
17019                                     hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
17020                                     tvb, offset, 2, sta_info);
17021               else
17022                 proto_tree_add_item(sta_info_tree, hf_ieee80211_vht_ndp_annc_sta_info_reserved,
17023                                     tvb, offset, 2, ENC_LITTLE_ENDIAN);
17024               offset += 2;
17025             }
17026           }
17027         break;
17028         }
17029
17030         case CTRL_GRANT_ACK:
17031         case CTRL_SSW:
17032         case CTRL_SSW_FEEDBACK:
17033         case CTRL_SSW_ACK:
17034         case CTRL_DMG_CTS:
17035         case CTRL_GRANT:
17036         case CTRL_SPR:
17037         case CTRL_POLL:
17038         case CTRL_RTS:
17039         {
17040           set_src_addr_cols(pinfo, tvb, offset, "TA");
17041           if (tree) {
17042             gchar* ether_name = tvb_get_ether_name(tvb, offset);
17043             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17044             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17045             PROTO_ITEM_SET_HIDDEN(hidden_item);
17046             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17047             PROTO_ITEM_SET_HIDDEN(hidden_item);
17048             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17049             PROTO_ITEM_SET_HIDDEN(hidden_item);
17050                 offset += 6;
17051           }
17052           break;
17053         }
17054
17055         case CTRL_CONTROL_WRAPPER:
17056         {
17057           /* XXX - We shouldn't see this.  Should we throw an error? */
17058           break;
17059         }
17060
17061         case CTRL_BLOCK_ACK_REQ:
17062         {
17063           set_src_addr_cols(pinfo, tvb, offset, "TA");
17064
17065           /* if (tree) */
17066           {
17067             guint16 bar_control;
17068             guint8 block_ack_type;
17069             proto_item *bar_parent_item;
17070             proto_tree *bar_sub_tree;
17071             gchar* ether_name = tvb_get_ether_name(tvb, offset);
17072
17073             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17074             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17075             PROTO_ITEM_SET_HIDDEN(hidden_item);
17076             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17077             PROTO_ITEM_SET_HIDDEN(hidden_item);
17078             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17079             PROTO_ITEM_SET_HIDDEN(hidden_item);
17080             offset += 6;
17081
17082             bar_control = tvb_get_letohs(tvb, offset);
17083             /* According to the 802.11ad standard (28/12/12) there is need to find the
17084              * GCR subfield which isn't described, thus the black_ack_type calculations
17085              * should be changed.
17086              */
17087             block_ack_type = (bar_control & 0x0006) >> 1;
17088             proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_request_type, tvb,
17089               offset, 2, ENC_LITTLE_ENDIAN);
17090             bar_parent_item = proto_tree_add_item(hdr_tree,
17091               hf_ieee80211_block_ack_request_control, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17092             bar_sub_tree = proto_item_add_subtree(bar_parent_item,
17093               ett_block_ack);
17094             proto_tree_add_item(bar_sub_tree,
17095               hf_ieee80211_block_ack_control_ack_policy, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17096             proto_tree_add_item(bar_sub_tree, hf_ieee80211_block_ack_control_multi_tid,
17097               tvb, offset, 2, ENC_LITTLE_ENDIAN);
17098             proto_tree_add_item(bar_sub_tree,
17099               hf_ieee80211_block_ack_control_compressed_bitmap, tvb, offset, 2,
17100               ENC_LITTLE_ENDIAN);
17101             proto_tree_add_item(bar_sub_tree, hf_ieee80211_block_ack_control_reserved,
17102               tvb, offset, 2, ENC_LITTLE_ENDIAN);
17103
17104             switch (block_ack_type)
17105             {
17106               case 0: /*Basic BlockAckReq */
17107               {
17108                 if(isDMG == TRUE) {
17109                    expert_add_info_format(pinfo, bar_sub_tree, &ei_ieee80211_dmg_subtype,
17110                            "DMG STA shouldn't transmit BlockAckReq frame with Basic BlockAckReq");
17111                    break;
17112                 }
17113                 proto_tree_add_item(bar_sub_tree,
17114                 hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17115                 offset += 2;
17116
17117                 /*offset +=*/ add_fixed_field(hdr_tree, tvb, pinfo, offset,
17118                   FIELD_BLOCK_ACK_SSC);
17119                 break;
17120               }
17121               case 1: /* Extended Compressesd BlockAckReq */
17122                 if(isDMG == FALSE) {
17123                    expert_add_info_format(pinfo, bar_sub_tree, &ei_ieee80211_dmg_subtype,
17124                            "Non-DMG STA shouldn't transmit BlockAckReq frame with Extended Compressed BlockAckReq");
17125                    break;
17126                 }
17127               case 2: /* Compressed BlockAckReq */
17128               {
17129                 proto_tree_add_item(bar_sub_tree,
17130                 hf_ieee80211_block_ack_control_compressed_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17131                 offset += 2;
17132
17133                 /*offset +=*/ add_fixed_field(hdr_tree, tvb, pinfo, offset,
17134                   FIELD_BLOCK_ACK_SSC);
17135                 break;
17136               }
17137               case 3: /* Multi-TID BlockAckReq */
17138               {
17139                 guint8 tid_count;
17140                 guint iii;
17141                 proto_tree *bar_mtid_tree, *bar_mtid_sub_tree;
17142
17143                 if(isDMG == TRUE) {
17144                    expert_add_info_format(pinfo, bar_sub_tree, &ei_ieee80211_dmg_subtype,
17145                            "DMG STA shouldn't transmit BlockAckReq frame with Basic BlockAckReq");
17146                    break;
17147                 }
17148
17149                 tid_count = ((bar_control & 0xF000) >> 12) + 1;
17150                 proto_tree_add_uint(bar_sub_tree, hf_ieee80211_block_ack_control_multi_tid_info, tvb, offset, 2, tid_count);
17151                 offset += 2;
17152
17153                 bar_mtid_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, tid_count*4, ett_block_ack, NULL, "Per TID Info");
17154                 for (iii = 0; iii < tid_count; iii++) {
17155                   bar_parent_item = proto_tree_add_uint(bar_mtid_tree, hf_ieee80211_block_ack_multi_tid_info, tvb, offset, 4, iii);
17156                   bar_mtid_sub_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
17157
17158                   proto_tree_add_item(bar_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17159                   proto_tree_add_item(bar_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17160                   offset += 2;
17161
17162                   offset += add_fixed_field(bar_mtid_sub_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
17163                 }
17164                 break;
17165               }
17166             }
17167           }
17168           break;
17169         }
17170
17171         case CTRL_BLOCK_ACK:
17172         {
17173           set_src_addr_cols(pinfo, tvb, offset, "TA");
17174
17175           /* if (tree) */
17176           {
17177             guint16 ba_control;
17178             guint8 block_ack_type;
17179             proto_item *ba_parent_item;
17180             proto_tree *ba_sub_tree;
17181             gchar* ether_name = tvb_get_ether_name(tvb, offset);
17182
17183             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
17184             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, offset, 6, ether_name);
17185             PROTO_ITEM_SET_HIDDEN(hidden_item);
17186             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
17187             PROTO_ITEM_SET_HIDDEN(hidden_item);
17188             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, offset, 6, ether_name);
17189             PROTO_ITEM_SET_HIDDEN(hidden_item);
17190             offset += 6;
17191
17192             ba_control = tvb_get_letohs(tvb, offset);
17193             block_ack_type = (ba_control & 0x0006) >> 1;
17194             proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17195             ba_parent_item = proto_tree_add_item(hdr_tree,
17196               hf_ieee80211_block_ack_control, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17197             ba_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
17198             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_ack_policy,
17199               tvb, offset, 2, ENC_LITTLE_ENDIAN);
17200             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_multi_tid,
17201               tvb, offset, 2, ENC_LITTLE_ENDIAN);
17202             proto_tree_add_item(ba_sub_tree,
17203               hf_ieee80211_block_ack_control_compressed_bitmap, tvb, offset, 2,
17204               ENC_LITTLE_ENDIAN);
17205             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_reserved, tvb,
17206               offset, 2, ENC_LITTLE_ENDIAN);
17207
17208             switch (block_ack_type)
17209             {
17210               case 0: /*Basic BlockAck */
17211               {
17212                 proto_tree_add_item(ba_sub_tree,
17213                 hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17214                 offset += 2;
17215
17216                 offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
17217                 proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 128, ENC_NA);
17218                 /*offset += 128;*/
17219                 break;
17220               }
17221               /* Added to support Extended Compressed BlockAck RBUFCAP subfield.*/
17222               case 1: /* Extended Compressed BlockAck */
17223               {
17224                 guint16 ssn;
17225                 guint64 bmap;
17226                 int f;
17227                 proto_item *ba_bitmap_item;
17228                 proto_tree *ba_bitmap_tree;
17229                 if(isDMG == FALSE) {
17230                    expert_add_info_format(pinfo, ba_sub_tree, &ei_ieee80211_dmg_subtype,
17231                            "Non-DMG STA shouldn't transmit BlockAck frame with Extended Compressed BlockAck");
17232                    break;
17233                 }
17234                 proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17235                 offset += 2;
17236
17237                 ssn = tvb_get_letohs(tvb, offset);
17238                 ssn >>= 4;
17239                 offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
17240                 bmap = tvb_get_letoh64(tvb, offset);
17241                 ba_bitmap_item = proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
17242                 ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item, ett_block_ack_bitmap);
17243                 for (f = 0; f < 64; f++) {
17244                   if (bmap & (G_GUINT64_CONSTANT(1) << f))
17245                     continue;
17246                   proto_tree_add_uint_format_value(ba_bitmap_tree, hf_ieee80211_block_ack_bitmap_missing_frame,
17247                                                    tvb, offset + (f/8), 1, ssn + f, "%u", ssn + f);
17248                 }
17249                 offset += 8;
17250                 proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_RBUFCAP, tvb, offset, 1, ENC_LITTLE_ENDIAN);
17251                 offset += 1;
17252                 break;
17253               }
17254               case 2: /* Compressed BlockAck */
17255               {
17256                 guint16 ssn;
17257                 guint64 bmap;
17258                 int f;
17259                 proto_item *ba_bitmap_item;
17260                 proto_tree *ba_bitmap_tree;
17261
17262                 proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17263                 offset += 2;
17264
17265                 ssn = tvb_get_letohs(tvb, offset);
17266                 ssn >>= 4;
17267                 offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
17268                 bmap = tvb_get_letoh64(tvb, offset);
17269                 ba_bitmap_item = proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
17270                 ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item, ett_block_ack_bitmap);
17271                 for (f = 0; f < 64; f++) {
17272                   if (bmap & (G_GUINT64_CONSTANT(1) << f))
17273                     continue;
17274                   proto_tree_add_uint_format_value(ba_bitmap_tree, hf_ieee80211_block_ack_bitmap_missing_frame,
17275                                                    tvb, offset + (f/8), 1, ssn + f, "%u", (ssn + f) & 0x0fff);
17276                 }
17277                 /*offset += 8;*/
17278                 break;
17279               }
17280               case 3:  /* Multi-TID BlockAck */
17281               {
17282                 guint8 tid_count;
17283                 guint iii;
17284                 proto_tree *ba_mtid_tree, *ba_mtid_sub_tree;
17285
17286                 tid_count = ((ba_control & 0xF000) >> 12) + 1;
17287                 proto_tree_add_uint(ba_sub_tree,
17288                 hf_ieee80211_block_ack_control_compressed_tid_info, tvb, offset, 2, tid_count);
17289                 offset += 2;
17290
17291                 ba_mtid_tree = proto_tree_add_subtree(hdr_tree, tvb, offset, tid_count*4, ett_block_ack, NULL, "Per TID Info");
17292                 for (iii = 0; iii < tid_count; iii++) {
17293                   ba_parent_item = proto_tree_add_uint(ba_mtid_tree, hf_ieee80211_block_ack_multi_tid_info, tvb, offset, 4, iii);
17294                   ba_mtid_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
17295
17296                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17297                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
17298                   offset += 2;
17299
17300                   offset += add_fixed_field(ba_mtid_sub_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
17301                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
17302                   offset += 8;
17303                 }
17304                 break;
17305               }
17306             }
17307           }
17308           break;
17309         }
17310       }
17311 /*
17312  * 802.11ad : Used for extension types.
17313  */
17314       switch (ctrl_type_subtype) {
17315         case CTRL_POLL: {
17316                 proto_tree_add_item(hdr_tree, hf_ieee80211_cf_response_offset,
17317                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
17318                 /* offset += 2; commented to avoid Clang warnings*/
17319                 break;
17320         }
17321         case CTRL_GRANT:
17322         case CTRL_GRANT_ACK:
17323         case CTRL_SPR: {
17324           gboolean isGrant;
17325           if(ctrl_type_subtype != CTRL_GRANT_ACK) {
17326             offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_DYNAMIC_ALLOCATION);
17327           } else { /* CTRL_GRANT_ACK have 5 octets that are reserved thus not shown.*/
17328             offset += 5;
17329           }
17330           /* offset += commented to avoid Clang warnings*/
17331           isGrant = ((ctrl_type_subtype==CTRL_GRANT)||(ctrl_type_subtype==CTRL_GRANT_ACK));
17332           p_add_proto_data(wmem_file_scope(), pinfo, proto_wlan, IS_CTRL_GRANT_OR_GRANT_ACK_KEY, &isGrant);
17333           add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BEAMFORMING_CTRL);
17334           break;
17335         }
17336         case CTRL_SSW: {
17337           offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_SECTOR_SWEEP);
17338           /* offset += commented to avoid Clang warnings*/
17339           add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_SECTOR_SWEEP_FB);
17340           break;
17341         }
17342         case CTRL_SSW_ACK:
17343         case CTRL_SSW_FEEDBACK: {
17344           offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_SECTOR_SWEEP_FB);
17345           offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BRP_REQ);
17346           /* offset += commented to avoid Clang warnings*/
17347           add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BEAMFORMED_LINK_MAINTAINCE);
17348           break;
17349         }
17350         case CTRL_DMG_DTS: {
17351           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_sa, tvb, offset, 6, ENC_NA);
17352           offset += 6;
17353           proto_tree_add_item(hdr_tree, hf_ieee80211_addr_nav_da, tvb, offset, 6, ENC_NA);
17354           /* offset += 6; commented to avoid Clang warnings*/
17355           break;
17356         }
17357         default:
17358                 break;
17359       }
17360       break;
17361     }
17362
17363     case DATA_FRAME:
17364     {
17365       guint32 ra_offset, da_offset, sa_offset, ta_offset, bssid_offset;
17366       addr_type = FCF_ADDR_SELECTOR (fcf);
17367
17368       /* In order to show src/dst address we must always do the following */
17369       switch (addr_type)
17370       {
17371
17372         case DATA_ADDR_T1:
17373           ra_offset = 4;
17374           da_offset = 4;
17375           sa_offset = 10;
17376           ta_offset = 10;
17377           bssid_offset = 16;
17378           break;
17379
17380         case DATA_ADDR_T2:
17381           ra_offset = 4;
17382           da_offset = 4;
17383           sa_offset = 16;
17384           ta_offset = 10;
17385           bssid_offset = 10;
17386           break;
17387
17388         case DATA_ADDR_T3:
17389           ra_offset = 4;
17390           da_offset = 16;
17391           sa_offset = 10;
17392           ta_offset = 10;
17393           bssid_offset = 4;
17394           break;
17395
17396         case DATA_ADDR_T4:
17397           ra_offset = 4;
17398           da_offset = 16;
17399           sa_offset = 24;
17400           ta_offset = 10;
17401           bssid_offset = 10;
17402           break;
17403
17404         default:
17405           /* Should never happen? */
17406           ra_offset = 0;
17407           da_offset = 0;
17408           sa_offset = 0;
17409           ta_offset = 0;
17410           bssid_offset = 0;
17411           break;
17412       }
17413
17414
17415
17416       set_address_tvb(&pinfo->dl_src, wlan_address_type, 6, tvb, sa_offset);
17417       copy_address_shallow(&pinfo->src, &pinfo->dl_src);
17418       set_address_tvb(&pinfo->dl_dst, wlan_address_type, 6, tvb, da_offset);
17419       copy_address_shallow(&pinfo->dst, &pinfo->dl_dst);
17420
17421       /* for tap */
17422       set_address_tvb(&whdr->bssid, wlan_bssid_address_type, 6, tvb, bssid_offset);
17423
17424       copy_address_shallow(&whdr->src, &pinfo->dl_src);
17425       copy_address_shallow(&whdr->dst, &pinfo->dl_dst);
17426
17427       seq_control = tvb_get_letohs(tvb, 22);
17428       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
17429       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
17430
17431       col_append_fstr(pinfo->cinfo, COL_INFO,
17432             ", SN=%d, FN=%d", seq_number,frag_number);
17433
17434       /* Now if we have a tree we start adding stuff */
17435       if (tree)
17436       {
17437         gchar *ra_name, *ta_name, *sa_name, *da_name, *bssid_name = NULL;
17438
17439         switch (addr_type)
17440         {
17441           case DATA_ADDR_T1:
17442           case DATA_ADDR_T2:
17443           case DATA_ADDR_T3:
17444           case DATA_ADDR_T4:
17445             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, ra_offset, 6, ENC_NA);
17446             ra_name = tvb_get_ether_name(tvb, ra_offset);
17447             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ra_resolved, tvb, ra_offset, 6, ra_name);
17448             PROTO_ITEM_SET_HIDDEN(hidden_item);
17449
17450             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, da_offset, 6, ENC_NA);
17451             da_name = tvb_get_ether_name(tvb, da_offset);
17452             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_da_resolved, tvb, da_offset, 6, da_name);
17453             PROTO_ITEM_SET_HIDDEN(hidden_item);
17454
17455             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, ta_offset, 6, ENC_NA);
17456             ta_name = tvb_get_ether_name(tvb, ta_offset);
17457             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_ta_resolved, tvb, ta_offset, 6, ta_name);
17458             PROTO_ITEM_SET_HIDDEN(hidden_item);
17459
17460             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, sa_offset, 6, ENC_NA);
17461             sa_name = tvb_get_ether_name(tvb, sa_offset);
17462             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, sa_offset, 6, sa_name);
17463             PROTO_ITEM_SET_HIDDEN(hidden_item);
17464
17465             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, bssid_offset, 6, ENC_NA);
17466             bssid_name = tvb_get_ether_name(tvb, bssid_offset);
17467             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_bssid_resolved, tvb, bssid_offset, 6, bssid_name);
17468             PROTO_ITEM_SET_HIDDEN(hidden_item);
17469
17470             if ((flags & FROM_TO_DS) == FLAG_FROM_DS) { /* Receiver address */
17471               sta_addr_offset = ra_offset;
17472             } else if ((flags & FROM_TO_DS) == FLAG_TO_DS) { /* Transmitter address */
17473               sta_addr_offset = ta_offset;
17474             }
17475             if (sta_addr_offset > 0) {
17476               proto_tree_add_item (hdr_tree, hf_ieee80211_addr_staa, tvb, sta_addr_offset, 6, ENC_NA);
17477               station_name = tvb_get_ether_name(tvb, sta_addr_offset);
17478               hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_staa_resolved, tvb, sta_addr_offset, 6, station_name);
17479               PROTO_ITEM_SET_HIDDEN(hidden_item);
17480             }
17481             proto_tree_add_item (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
17482             proto_tree_add_item (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, ENC_LITTLE_ENDIAN);
17483
17484             /* add items for wlan.addr filter */
17485             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, ra_offset, 6, ENC_NA);
17486             PROTO_ITEM_SET_HIDDEN(hidden_item);
17487             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, ra_offset, 6, ra_name);
17488             PROTO_ITEM_SET_HIDDEN(hidden_item);
17489             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, ta_offset, 6, ENC_NA);
17490             PROTO_ITEM_SET_HIDDEN(hidden_item);
17491             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, ta_offset, 6, ta_name);
17492             PROTO_ITEM_SET_HIDDEN(hidden_item);
17493             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, sa_offset, 6, ENC_NA);
17494             PROTO_ITEM_SET_HIDDEN(hidden_item);
17495             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, sa_offset, 6, sa_name);
17496             PROTO_ITEM_SET_HIDDEN(hidden_item);
17497             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, da_offset, 6, ENC_NA);
17498             PROTO_ITEM_SET_HIDDEN(hidden_item);
17499             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, da_offset, 6, da_name);
17500             PROTO_ITEM_SET_HIDDEN(hidden_item);
17501             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, bssid_offset, 6, ENC_NA);
17502             PROTO_ITEM_SET_HIDDEN(hidden_item);
17503             hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_resolved, tvb, bssid_offset, 6, bssid_name);
17504             PROTO_ITEM_SET_HIDDEN(hidden_item);
17505             break;
17506         }
17507
17508       }
17509       break;
17510       }
17511     case EXTENSION_FRAME: {
17512       switch (frame_type_subtype) {
17513         case EXTENSION_DMG_BEACON: {
17514           set_dst_addr_cols(pinfo, tvb, 4, "BSSID");
17515           if (tree) {
17516             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
17517             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
17518             PROTO_ITEM_SET_HIDDEN(hidden_item);
17519           }
17520           break;
17521         }
17522       }
17523     }
17524   }
17525
17526   len = tvb_captured_length_remaining(tvb, hdr_len);
17527   reported_len = tvb_reported_length_remaining(tvb, hdr_len);
17528
17529   if (has_fcs)
17530     {
17531       /*
17532        * Well, this packet should, in theory, have an FCS.
17533        * Do we have the entire packet, and does it have enough data for
17534        * the FCS?
17535        */
17536       if (reported_len < 4)
17537       {
17538         /*
17539          * The packet is claimed not to even have enough data for a 4-byte
17540          * FCS.
17541          * Pretend it doesn't have an FCS.
17542          */
17543         ;
17544       }
17545       else if (len < reported_len)
17546       {
17547         /*
17548          * The packet is claimed to have enough data for a 4-byte FCS, but
17549          * we didn't capture all of the packet.
17550          * Slice off the 4-byte FCS from the reported length, and trim the
17551          * captured length so it's no more than the reported length; that
17552          * will slice off what of the FCS, if any, is in the captured
17553          * length.
17554          */
17555         reported_len -= 4;
17556         if (len > reported_len)
17557             len = reported_len;
17558       }
17559       else
17560       {
17561         /*
17562          * We have the entire packet, and it includes a 4-byte FCS.
17563          * Slice it off, and put it into the tree.
17564          */
17565         len          -= 4;
17566         reported_len -= 4;
17567         if (tree)
17568         {
17569           guint32 sent_fcs = tvb_get_ntohl(tvb, hdr_len + len);
17570           guint32 fcs;
17571
17572           if (phdr->datapad)
17573             fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
17574           else
17575             fcs = crc32_802_tvb(tvb, hdr_len + len);
17576           if (fcs == sent_fcs) {
17577             fcs_good = TRUE;
17578             fcs_bad = FALSE;
17579           } else {
17580             fcs_good = FALSE;
17581             fcs_bad = TRUE;
17582           }
17583
17584           fcs_item = proto_tree_add_item(hdr_tree, hf_ieee80211_fcs, tvb,
17585                 hdr_len + len, 4, ENC_LITTLE_ENDIAN);
17586           if (fcs_good) {
17587             proto_item_append_text(fcs_item, " [correct]");
17588           } else {
17589             proto_item_append_text(fcs_item, " [incorrect, should be 0x%08x]", fcs);
17590             flag_str[8] = '.';
17591           }
17592
17593           proto_tree_set_appendix(hdr_tree, tvb, hdr_len + len, 4);
17594
17595           if(wlan_check_checksum) {
17596             fcs_tree = proto_item_add_subtree(fcs_item, ett_fcs);
17597
17598             fcs_item = proto_tree_add_boolean(fcs_tree,
17599                 hf_ieee80211_fcs_good, tvb,
17600                 hdr_len + len, 4,
17601                 fcs_good);
17602             PROTO_ITEM_SET_GENERATED(fcs_item);
17603
17604             fcs_item = proto_tree_add_boolean(fcs_tree,
17605                 hf_ieee80211_fcs_bad, tvb,
17606                 hdr_len + len, 4,
17607                 fcs_bad);
17608             PROTO_ITEM_SET_GENERATED(fcs_item);
17609           }
17610         }
17611       }
17612     }
17613   else
17614     {
17615       flag_str[8] = '\0';
17616     }
17617
17618   proto_item_append_text(ti, ", Flags: %s", flag_str);
17619   col_append_fstr (pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
17620
17621
17622   /*
17623    * Only management and data frames have a body, so we don't have
17624    * anything more to do for other types of frames.
17625    */
17626   switch (FCF_FRAME_TYPE (fcf))
17627     {
17628
17629     case MGT_FRAME:
17630       if (htc_len == 4) {
17631         dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
17632       }
17633       break;
17634
17635     case DATA_FRAME:
17636       if (tree && DATA_FRAME_IS_QOS(frame_type_subtype))
17637       {
17638         proto_item *qos_fields, *qos_ti;
17639         proto_tree *qos_tree;
17640
17641         guint16 qos_eosp;
17642         guint16 qos_field_content;
17643
17644         qos_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_qos, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17645         qos_tree = proto_item_add_subtree (qos_fields, ett_qos_parameters);
17646
17647         qos_eosp = QOS_EOSP(qos_control);
17648         qos_field_content = QOS_FIELD_CONTENT(qos_control);
17649
17650         proto_tree_add_item(qos_tree, hf_ieee80211_qos_tid, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17651
17652         qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_priority, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17653         PROTO_ITEM_SET_GENERATED(qos_ti);
17654
17655         if (flags & FLAG_TO_DS) {
17656           proto_tree_add_item(qos_tree, hf_ieee80211_qos_bit4, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17657         } else {
17658           proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17659         }
17660
17661         proto_tree_add_item(qos_tree, hf_ieee80211_qos_ack_policy, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17662
17663         if (flags & FLAG_FROM_DS) {
17664           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
17665             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17666             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
17667           }
17668           if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
17669             /* txop limit */
17670               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_limit, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17671             if (qos_field_content == 0) {
17672               proto_item_append_text(qos_ti, " (transmit one frame immediately)");
17673             }
17674           } else {
17675             /* qap ps buffer state */
17676             proto_item *qos_ps_buf_state_fields;
17677             proto_tree *qos_ps_buf_state_tree;
17678
17679             qos_ps_buf_state_fields = proto_tree_add_item(qos_tree, hf_ieee80211_qos_ps_buf_state, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17680             qos_ps_buf_state_tree = proto_item_add_subtree (qos_ps_buf_state_fields, ett_qos_ps_buf_state);
17681
17682             proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_buf_state_indicated, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17683
17684             if (QOS_PS_BUF_STATE_INDICATED(qos_field_content)) {
17685               proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_highest_pri_buf_ac, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17686               qos_ti = proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_qap_buf_load, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17687               switch (QOS_PS_QAP_BUF_LOAD(qos_field_content)) {
17688
17689               case 0:
17690                 proto_item_append_text(qos_ti, " (no buffered traffic)");
17691                 break;
17692
17693               default:
17694                 proto_item_append_text(qos_ti, " (%d octets)", QOS_PS_QAP_BUF_LOAD(qos_field_content)*4096);
17695                 break;
17696
17697               case 15:
17698                 proto_item_append_text(qos_ti, " (greater than 57344 octets)");
17699                 break;
17700               }
17701
17702             }
17703           }
17704         } else {
17705           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
17706             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17707             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
17708           }
17709           if (qos_eosp) {
17710             /* queue size */
17711             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_queue_size, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17712             switch (qos_field_content) {
17713             case 0:
17714               proto_item_append_text(qos_ti, " (no buffered traffic in the queue)");
17715               break;
17716
17717             default:
17718               proto_item_append_text(qos_ti, " (%u bytes)", qos_field_content*256);
17719               break;
17720
17721             case 254:
17722               proto_item_append_text(qos_ti, " (more than 64768 octets)");
17723               break;
17724
17725             case 255:
17726               proto_item_append_text(qos_ti, " (unspecified or unknown)");
17727               break;
17728             }
17729           } else {
17730             /* txop duration requested */
17731             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_dur_req,
17732                                    tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
17733             if (qos_field_content == 0) {
17734               proto_item_append_text(qos_ti, " (no TXOP requested)");
17735             }
17736           }
17737         }
17738
17739         /* Do we have +HTC? */
17740         if (htc_len == 4) {
17741           dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
17742         }
17743
17744         if (meshctl_len != 0) {
17745           proto_item *msh_fields;
17746           proto_tree *msh_tree;
17747
17748           msh_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_mesh_control_field, tvb, meshoff, meshctl_len, ENC_NA);
17749           msh_tree = proto_item_add_subtree (msh_fields, ett_msh_control);
17750           add_fixed_field(msh_tree, tvb, pinfo, meshoff, FIELD_MESH_CONTROL);
17751         }
17752
17753       } /* end of qos control field */
17754       /* Davide Schiera (2006-11-21): process handshake packet with AirPDcap    */
17755       /* the processing will take care of 4-way handshake sessions for WPA    */
17756       /* and WPA2 decryption                                  */
17757       if (enable_decryption && !pinfo->fd->flags.visited) {
17758         const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
17759         AirPDcapPacketProcess(&airpdcap_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE);
17760
17761       }
17762       /* Davide Schiera --------------------------------------------------------  */
17763
17764       /*
17765        * No-data frames don't have a body.
17766        */
17767       if (DATA_FRAME_IS_NULL(frame_type_subtype))
17768         goto end_of_wlan;
17769
17770       if (!wlan_subdissector) {
17771         guint fnum = 0;
17772
17773         /* key: bssid:src
17774          * data: last seq_control seen and frame number
17775          */
17776         retransmitted = FALSE;
17777         if (!pinfo->fd->flags.visited) {
17778           retransmit_key key;
17779           retransmit_key *result;
17780
17781           memcpy(key.bssid, whdr->bssid.data, 6);
17782           memcpy(key.src, whdr->src.data, 6);
17783           key.seq_control = 0;
17784           result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
17785           if (result && (result->seq_control == seq_control)) {
17786             /* keep a pointer to the first seen frame, could be done with proto data? */
17787             fnum = result->fnum;
17788             g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER(pinfo->fd->num),
17789                                 GINT_TO_POINTER(fnum));
17790             retransmitted = TRUE;
17791           } else {
17792             /* first time or new seq*/
17793             if (!result) {
17794               result = wmem_new(wmem_file_scope(), retransmit_key);
17795               *result = key;
17796               g_hash_table_insert(fc_analyse_retransmit_table, result, result);
17797             }
17798             result->seq_control = seq_control;
17799             result->fnum =  pinfo->fd->num;
17800           }
17801         }
17802         else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER(pinfo->fd->num))))) {
17803           retransmitted = TRUE;
17804         }
17805
17806         if (retransmitted) {
17807           col_append_str(pinfo->cinfo, COL_INFO, " [retransmitted]");
17808           if (tree) {
17809             proto_item *item;
17810
17811             item=proto_tree_add_none_format(hdr_tree, hf_ieee80211_fc_analysis_retransmission, tvb, 0, 0,
17812                                             "Retransmitted frame");
17813             PROTO_ITEM_SET_GENERATED(item);
17814             item=proto_tree_add_uint(hdr_tree, hf_ieee80211_fc_analysis_retransmission_frame,tvb, 0, 0, fnum);
17815             PROTO_ITEM_SET_GENERATED(item);
17816           }
17817           next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
17818           call_dissector(data_handle, next_tvb, pinfo, tree);
17819           goto end_of_wlan;
17820         }
17821       }
17822
17823       break;
17824
17825     case CONTROL_FRAME:
17826       goto end_of_wlan;
17827
17828     case EXTENSION_FRAME:
17829       break;
17830
17831     default:
17832       goto end_of_wlan;
17833     }
17834
17835   if (IS_PROTECTED(FCF_FLAGS(fcf))
17836       && !phdr->decrypted
17837       && (wlan_ignore_wep != WLAN_IGNORE_WEP_WO_IV)) {
17838     /*
17839      * It's a WEP or WPA encrypted frame, and it hasn't already been
17840      * decrypted; dissect the protections parameters and decrypt the data,
17841      * if we have a matching key. Otherwise display it as data.
17842      */
17843     gboolean    can_decrypt = FALSE;
17844     proto_tree *wep_tree    = NULL;
17845     guint32     iv;
17846     guint8      key, keybyte;
17847
17848     /* Davide Schiera (2006-11-27): define algorithms constants and macros  */
17849 #define PROTECTION_ALG_WEP  AIRPDCAP_KEY_TYPE_WEP
17850 #define PROTECTION_ALG_TKIP  AIRPDCAP_KEY_TYPE_TKIP
17851 #define PROTECTION_ALG_CCMP  AIRPDCAP_KEY_TYPE_CCMP
17852 #define PROTECTION_ALG_RSNA  PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
17853     guint8 algorithm=G_MAXUINT8;
17854     /* Davide Schiera (2006-11-27): added macros to check the algorithm    */
17855     /* used could be TKIP or CCMP                            */
17856 #define IS_TKIP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 1) == \
17857   ((tvb_get_guint8(tvb, hdr_len) | 0x20) & 0x7f))
17858 #define IS_CCMP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 2) == 0)
17859     /* Davide Schiera -----------------------------------------------------  */
17860
17861     /* Davide Schiera (2006-11-21): recorded original lengths to pass them  */
17862     /* to the packets process function                        */
17863     guint32 sec_header=0;
17864     guint32 sec_trailer=0;
17865
17866     next_tvb = try_decrypt(tvb, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer, &used_key);
17867     /* Davide Schiera -----------------------------------------------------  */
17868
17869     keybyte = tvb_get_guint8(tvb, hdr_len + 3);
17870     key = KEY_OCTET_WEP_KEY(keybyte);
17871     if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
17872       /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
17873       if (tree) {
17874         /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if  */
17875         /* it's possible                                */
17876         if (algorithm==PROTECTION_ALG_TKIP)
17877           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
17878               ett_wep_parameters, NULL, "TKIP parameters");
17879         else if (algorithm==PROTECTION_ALG_CCMP)
17880           wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
17881             ett_wep_parameters, NULL, "CCMP parameters");
17882         else {
17883           /* Davide Schiera --------------------------------------------  */
17884           /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if*/
17885           /* it's possible                              */
17886           if (IS_TKIP(tvb, hdr_len)) {
17887             algorithm=PROTECTION_ALG_TKIP;
17888             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
17889                 ett_wep_parameters, NULL, "TKIP parameters");
17890           } else if (IS_CCMP(tvb, hdr_len)) {
17891             algorithm=PROTECTION_ALG_CCMP;
17892             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
17893                 ett_wep_parameters, NULL, "CCMP parameters");
17894           } else
17895             wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 8,
17896                 ett_wep_parameters, NULL, "TKIP/CCMP parameters");
17897         }
17898         proto_item_set_len (ti, hdr_len + 8);
17899
17900         if (algorithm==PROTECTION_ALG_TKIP) {
17901           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
17902               tvb_get_letohl(tvb, hdr_len + 4),
17903               tvb_get_guint8(tvb, hdr_len),
17904               tvb_get_guint8(tvb, hdr_len + 2));
17905           proto_tree_add_string(wep_tree, hf_ieee80211_tkip_extiv, tvb, hdr_len,
17906               EXTIV_LEN, out_buff);
17907         } else if (algorithm==PROTECTION_ALG_CCMP) {
17908           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
17909               tvb_get_letohl(tvb, hdr_len + 4),
17910               tvb_get_guint8(tvb, hdr_len + 1),
17911               tvb_get_guint8(tvb, hdr_len));
17912           proto_tree_add_string(wep_tree, hf_ieee80211_ccmp_extiv, tvb, hdr_len,
17913               EXTIV_LEN, out_buff);
17914         }
17915
17916         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
17917       }
17918
17919       /* Subtract out the length of the IV. */
17920       len          -= EXTIV_LEN;
17921       reported_len -= EXTIV_LEN;
17922       ivlen         = EXTIV_LEN;
17923       /* It is unknown whether this is TKIP or CCMP, so let's not even try to
17924        * parse TKIP Michael MIC+ICV or CCMP MIC. */
17925
17926       /* Davide Schiera (2006-11-21): enable TKIP and CCMP decryption      */
17927       /* checking for the trailer                            */
17928       if (next_tvb!=NULL) {
17929         if (reported_len < (gint) sec_trailer) {
17930           /* There is no space for a trailer, ignore it and don't decrypt  */
17931           ;
17932         } else if (len < reported_len) {
17933           /* There is space for a trailer, but we haven't capture all the  */
17934           /* packet. Slice off the trailer, but don't try to decrypt      */
17935           reported_len -= sec_trailer;
17936           if (len > reported_len)
17937             len = reported_len;
17938         } else {
17939           /* Ok, we have a trailer and the whole packet. Decrypt it!      */
17940           /* TODO: At the moment we won't add the trailer to the tree,    */
17941           /* so don't remove the trailer from the packet                  */
17942           len          -= sec_trailer;
17943           reported_len -= sec_trailer;
17944           can_decrypt   = TRUE;
17945
17946           /* Add Key information to packet */
17947           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 */
17948           out_buff[2*AIRPDCAP_TK_LEN] = '\0';
17949
17950           if (key == 0) { /* encrypted with pairwise key */
17951             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_tk, tvb, 0, 0, out_buff);
17952             PROTO_ITEM_SET_GENERATED(ti);
17953
17954             /* Also add the PMK used to to decrypt the packet. (PMK==PSK) */
17955             bytes_to_hexstr(out_buff, used_key.KeyData.Wpa.Psk, AIRPDCAP_WPA_PSK_LEN); /* 32 bytes */
17956             out_buff[2*AIRPDCAP_WPA_PSK_LEN] = '\0';
17957             ti = proto_tree_add_string(wep_tree, hf_ieee80211_fc_analysis_pmk, tvb, 0, 0, out_buff);
17958             PROTO_ITEM_SET_GENERATED(ti);
17959
17960           } else { /* Encrypted with Group Key */
17961             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 */
17962             PROTO_ITEM_SET_GENERATED(ti);
17963           }
17964         }
17965       }
17966       /* Davide Schiera --------------------------------------------------  */
17967     } else {
17968       /* No Ext. IV - WEP packet */
17969       /*
17970        * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
17971        * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
17972        * them itself.
17973        *
17974        * Also, just pass the data *following* the WEP parameters as the
17975        * buffer to decrypt.
17976        */
17977       iv = tvb_get_ntoh24(tvb, hdr_len);
17978       if (tree) {
17979         wep_tree = proto_tree_add_subtree(hdr_tree, tvb, hdr_len, 4,
17980             ett_wep_parameters, NULL, "WEP parameters");
17981
17982         proto_tree_add_uint (wep_tree, hf_ieee80211_wep_iv, tvb, hdr_len, 3, iv);
17983         tvb_memcpy(tvb, iv_buff, hdr_len, 3);
17984         is_iv_bad = weak_iv(iv_buff);
17985         if (is_iv_bad != -1) {
17986           proto_tree_add_boolean_format (wep_tree, hf_ieee80211_wep_iv_weak,
17987               tvb, 0, 0, TRUE,
17988               "Weak IV for key byte %d",
17989               is_iv_bad);
17990         }
17991       }
17992       if (tree)
17993         proto_tree_add_uint (wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
17994
17995       /* Subtract out the length of the IV. */
17996       len          -= 4;
17997       reported_len -= 4;
17998       ivlen         = 4;
17999
18000       /* Davide Schiera (2006-11-27): Even if the decryption was not */
18001       /* successful, set the algorithm                               */
18002       algorithm=PROTECTION_ALG_WEP;
18003
18004       /*
18005        * Well, this packet should, in theory, have an ICV.
18006        * Do we have the entire packet, and does it have enough data for
18007        * the ICV?
18008        */
18009       if (reported_len < 4) {
18010         /*
18011          * The packet is claimed not to even have enough data for a
18012          * 4-byte ICV.
18013          * Pretend it doesn't have an ICV.
18014          */
18015         ;
18016       } else if (len < reported_len) {
18017         /*
18018          * The packet is claimed to have enough data for a 4-byte ICV,
18019          * but we didn't capture all of the packet.
18020          * Slice off the 4-byte ICV from the reported length, and trim
18021          * the captured length so it's no more than the reported length;
18022          * that will slice off what of the ICV, if any, is in the
18023          * captured length.
18024          */
18025         reported_len -= 4;
18026         if (len > reported_len)
18027           len         = reported_len;
18028       } else {
18029         /*
18030          * We have the entire packet, and it includes a 4-byte ICV.
18031          * Slice it off, and put it into the tree.
18032          *
18033          * We only support decrypting if we have the the ICV.
18034          *
18035          * XXX - the ICV is encrypted; we're putting the encrypted
18036          * value, not the decrypted value, into the tree.
18037          */
18038         len          -= 4;
18039         reported_len -= 4;
18040         can_decrypt   = TRUE;
18041       }
18042     }
18043
18044     if (algorithm == PROTECTION_ALG_WEP) {
18045       g_strlcpy (wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
18046     } else if (algorithm == PROTECTION_ALG_TKIP) {
18047       g_strlcpy (wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
18048     } else if (algorithm == PROTECTION_ALG_CCMP) {
18049       g_strlcpy (wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
18050     } else {
18051       g_strlcpy (wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
18052     }
18053
18054     /* Davide Schiera (2006-11-26): decrypted before parsing header and    */
18055     /* protection header                                  */
18056     if (!can_decrypt || (next_tvb == NULL)) {
18057       /*
18058        * WEP decode impossible or failed, treat payload as raw data
18059        * and don't attempt fragment reassembly or further dissection.
18060        */
18061       next_tvb = tvb_new_subset(tvb, hdr_len + ivlen, len, reported_len);
18062
18063       if (tree) {
18064         /* Davide Schiera (2006-11-21): added WEP or WPA separation      */
18065         if (algorithm == PROTECTION_ALG_WEP) {
18066           if (can_decrypt)
18067             proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
18068                 hdr_len + ivlen + len, 4,
18069                 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
18070                 "0x%08x (not verified)",
18071                 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
18072         } else if (algorithm == PROTECTION_ALG_CCMP) {
18073         } else if (algorithm == PROTECTION_ALG_TKIP) {
18074         }
18075       }
18076       /* Davide Schiera (2006-11-21) ----------------------------------  */
18077
18078       if ((!is_centrino) && (wlan_ignore_wep == WLAN_IGNORE_WEP_NO)) {
18079         /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
18080         call_dissector(data_handle, next_tvb, pinfo, tree);
18081         goto end_of_wlan;
18082       }
18083     } else {
18084       /* Davide Schiera (2006-11-21): added WEP or WPA separation        */
18085       if (algorithm == PROTECTION_ALG_WEP) {
18086         if (tree)
18087           proto_tree_add_uint_format_value(wep_tree, hf_ieee80211_wep_icv, tvb,
18088               hdr_len + ivlen + len, 4,
18089               tvb_get_ntohl(tvb, hdr_len + ivlen + len),
18090               "0x%08x (correct)",
18091               tvb_get_ntohl(tvb, hdr_len + ivlen + len));
18092
18093         add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
18094       } else if (algorithm==PROTECTION_ALG_CCMP) {
18095         add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
18096       } else if (algorithm==PROTECTION_ALG_TKIP) {
18097         add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
18098       }
18099       /* Davide Schiera (2006-11-21) -------------------------------------  */
18100       /* Davide Schiera (2006-11-27): undefine macros and definitions  */
18101 #undef IS_TKIP
18102 #undef IS_CCMP
18103 #undef PROTECTION_ALG_CCMP
18104 #undef PROTECTION_ALG_TKIP
18105 #undef PROTECTION_ALG_WEP
18106       /* Davide Schiera --------------------------------------------------  */
18107     }
18108
18109     /*
18110      * WEP decryption successful!
18111      *
18112      * Use the tvbuff we got back from the decryption; the data starts at
18113      * the beginning.  The lengths are already correct for the decoded WEP
18114      * payload.
18115      */
18116     hdr_len = 0;
18117
18118   } else {
18119     /*
18120      * Not a WEP-encrypted frame; just use the data from the tvbuff
18121      * handed to us.
18122      *
18123      * The payload starts at "hdr_len" (i.e., just past the 802.11
18124      * MAC header), the length of data in the tvbuff following the
18125      * 802.11 header is "len", and the length of data in the packet
18126      * following the 802.11 header is "reported_len".
18127      */
18128     next_tvb = tvb;
18129   }
18130
18131   /*
18132    * Do defragmentation if "wlan_defragment" is true, and we have more
18133    * fragments or this isn't the first fragment.
18134    *
18135    * We have to do some special handling to catch frames that
18136    * have the "More Fragments" indicator not set but that
18137    * don't show up as reassembled and don't have any other
18138    * fragments present.  Some networking interfaces appear
18139    * to do reassembly even when you're capturing raw packets
18140    * *and* show the reassembled packet without the "More
18141    * Fragments" indicator set *but* with a non-zero fragment
18142    * number.
18143    *
18144    * "fragment_add_seq_802_11()" handles that; we want to call it
18145    * even if we have a short frame, so that it does those checks - if
18146    * the frame is short, it doesn't do reassembly on it.
18147    *
18148    * (This could get some false positives if we really *did* only
18149    * capture the last fragment of a fragmented packet, but that's
18150    * life.)
18151    */
18152   save_fragmented = pinfo->fragmented;
18153   if (wlan_defragment && (more_frags || (frag_number != 0))) {
18154     fragment_head *fd_head;
18155
18156     /*
18157      * If we've already seen this frame, look it up in the
18158      * table of reassembled packets, otherwise add it to
18159      * whatever reassembly is in progress, if any, and see
18160      * if it's done.
18161      */
18162     if (reported_len < 0)
18163       THROW(ReportedBoundsError);
18164     fd_head = fragment_add_seq_802_11(&wlan_reassembly_table,
18165         next_tvb, hdr_len, pinfo, seq_number, NULL,
18166         frag_number,
18167         reported_len,
18168         more_frags);
18169     next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
18170         "Reassembled 802.11", fd_head,
18171         &frag_items, NULL, hdr_tree);
18172   } else {
18173     /*
18174      * If this is the first fragment, dissect its contents, otherwise
18175      * just show it as a fragment.
18176      */
18177     if (frag_number != 0) {
18178       /* Not the first fragment - don't dissect it. */
18179       next_tvb = NULL;
18180     } else {
18181       /* First fragment, or not fragmented.  Dissect what we have here. */
18182
18183       /* Get a tvbuff for the payload. */
18184       next_tvb = tvb_new_subset (next_tvb, hdr_len, len, reported_len);
18185
18186       /*
18187        * If this is the first fragment, but not the only fragment,
18188        * tell the next protocol that.
18189        */
18190       if (more_frags)
18191         pinfo->fragmented = TRUE;
18192       else
18193         pinfo->fragmented = FALSE;
18194     }
18195   }
18196
18197   if (next_tvb == NULL) {
18198     /* Just show this as an incomplete fragment. */
18199     col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
18200     next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
18201     call_dissector(data_handle, next_tvb, pinfo, tree);
18202     pinfo->fragmented = save_fragmented;
18203     goto end_of_wlan;
18204   }
18205
18206   switch (FCF_FRAME_TYPE (fcf))
18207     {
18208
18209     case MGT_FRAME:
18210       dissect_ieee80211_mgt (fcf, next_tvb, pinfo, tree);
18211       break;
18212
18213     case DATA_FRAME:
18214       if (is_amsdu && (tvb_reported_length_remaining(next_tvb, 0) > 4)) {
18215         proto_item   *parent_item;
18216         proto_tree   *mpdu_tree;
18217         guint32       msdu_offset = 0;
18218         guint         i           = 1;
18219
18220         parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
18221                                     tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
18222         mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
18223
18224         do {
18225           tvbuff_t *volatile  msdu_tvb;
18226           guint16             msdu_length;
18227           proto_tree         *subframe_tree;
18228
18229           /*
18230            * IEEE Std 802.11-2012 says, in section 8.3.2.2 "A-MSDU format":
18231            *
18232            *  The A-MSDU subframe header contains three fields: DA, SA, and
18233            *  Length. The order of these fields and the bits within these
18234            *  fields are the same as the IEEE 802.3 frame format.
18235            *
18236            * which means that the length field is big-endian, not
18237            * little-endian.
18238            */
18239           msdu_length = tvb_get_ntohs (next_tvb, msdu_offset+12);
18240
18241           parent_item = proto_tree_add_item(mpdu_tree, hf_ieee80211_amsdu_subframe, next_tvb,
18242                             msdu_offset, roundup2(msdu_offset+14+msdu_length, 4), ENC_NA);
18243           proto_item_append_text(parent_item, " #%u", i);
18244           subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
18245           i += 1;
18246
18247           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_da, next_tvb, msdu_offset, 6, ENC_NA);
18248           hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_da_resolved, tvb, msdu_offset, 6,
18249             tvb_get_ether_name(tvb, msdu_offset));
18250           PROTO_ITEM_SET_HIDDEN(hidden_item);
18251           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_sa, next_tvb, msdu_offset+6, 6, ENC_NA);
18252           hidden_item = proto_tree_add_string (hdr_tree, hf_ieee80211_addr_sa_resolved, tvb, msdu_offset+6, 6,
18253             tvb_get_ether_name(tvb, msdu_offset+6));
18254           PROTO_ITEM_SET_HIDDEN(hidden_item);
18255           proto_tree_add_item(subframe_tree, hf_ieee80211_amsdu_length, next_tvb, msdu_offset+12, 2, ENC_BIG_ENDIAN);
18256
18257           msdu_offset += 14;
18258           msdu_tvb = tvb_new_subset_length(next_tvb, msdu_offset, msdu_length);
18259           call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
18260           msdu_offset = roundup2(msdu_offset+msdu_length, 4);
18261         } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
18262
18263         break;
18264       }
18265       /* I guess some bridges take Netware Ethernet_802_3 frames,
18266          which are 802.3 frames (with a length field rather than
18267          a type field, but with no 802.2 header in the payload),
18268          and just stick the payload into an 802.11 frame.  I've seen
18269          captures that show frames of that sort.
18270
18271          We also handle some odd form of encapsulation in which a
18272          complete Ethernet frame is encapsulated within an 802.11
18273          data frame, with no 802.2 header.  This has been seen
18274          from some hardware.
18275
18276          On top of that, at least at some point it appeared that
18277          the OLPC XO sent out frames with two bytes of 0 between
18278          the "end" of the 802.11 header and the beginning of
18279          the payload.
18280
18281          So, if the packet doesn't start with 0xaa 0xaa:
18282
18283            we first use the same scheme that linux-wlan-ng does to detect
18284            those encapsulated Ethernet frames, namely looking to see whether
18285            the frame either starts with 6 octets that match the destination
18286            address from the 802.11 header or has 6 octets that match the
18287            source address from the 802.11 header following the first 6 octets,
18288            and, if so, treat it as an encapsulated Ethernet frame;
18289
18290            otherwise, we use the same scheme that we use in the Ethernet
18291            dissector to recognize Netware 802.3 frames, namely checking
18292            whether the packet starts with 0xff 0xff and, if so, treat it
18293            as an encapsulated IPX frame, and then check whether the
18294            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
18295            frame. */
18296       encap_type = ENCAP_802_2;
18297       if (tvb_bytes_exist(next_tvb, 0, 2)) {
18298         octet1 = tvb_get_guint8(next_tvb, 0);
18299         octet2 = tvb_get_guint8(next_tvb, 1);
18300         if ((octet1 != 0xaa) || (octet2 != 0xaa)) {
18301           if ((tvb_memeql(next_tvb, 6, (const guint8 *)pinfo->dl_src.data, 6) == 0) ||
18302               (tvb_memeql(next_tvb, 0, (const guint8 *)pinfo->dl_dst.data, 6) == 0))
18303             encap_type = ENCAP_ETHERNET;
18304           else if ((octet1 == 0xff) && (octet2 == 0xff))
18305             encap_type = ENCAP_IPX;
18306           else if ((octet1 == 0x00) && (octet2 == 0x00)) {
18307             proto_tree_add_item(tree, hf_ieee80211_mysterious_olpc_stuff, next_tvb, 0, 2, ENC_NA);
18308             next_tvb = tvb_new_subset_remaining (next_tvb, 2);
18309           }
18310         }
18311       }
18312
18313       switch (encap_type) {
18314
18315       case ENCAP_802_2:
18316         call_dissector(llc_handle, next_tvb, pinfo, tree);
18317         break;
18318
18319       case ENCAP_ETHERNET:
18320         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
18321         break;
18322
18323       case ENCAP_IPX:
18324         call_dissector(ipx_handle, next_tvb, pinfo, tree);
18325         break;
18326       }
18327       break;
18328
18329     case EXTENSION_FRAME:
18330     {
18331       dissect_ieee80211_extension(fcf, next_tvb, pinfo, tree);
18332       break;
18333     }
18334   }
18335   pinfo->fragmented = save_fragmented;
18336
18337   end_of_wlan:
18338   whdr->stats = wlan_stats;
18339   tap_queue_packet(wlan_tap, pinfo, whdr);
18340   memset (&wlan_stats, 0, sizeof wlan_stats);
18341
18342   return tvb_captured_length(tvb);
18343 }
18344
18345 /*
18346  * Dissect 802.11 with a variable-length link-layer header and with the FCS
18347  * presence or absence indicated by the pseudo-header, if there is one.
18348  */
18349 static int
18350 dissect_ieee80211 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
18351 {
18352   struct ieee_802_11_phdr *phdr = (struct ieee_802_11_phdr *)data;
18353   struct ieee_802_11_phdr ourphdr;
18354
18355   if (phdr == NULL) {
18356     /*
18357      * Fake a pseudo-header.
18358      * XXX - what are we supposed to do if the FCS length is unknown?
18359      */
18360     memset(&ourphdr, 0, sizeof(ourphdr));
18361     ourphdr.fcs_len = -1;
18362     ourphdr.decrypted = FALSE;
18363     ourphdr.datapad = FALSE;
18364     ourphdr.phy = PHDR_802_11_PHY_UNKNOWN;
18365     phdr = &ourphdr;
18366   }
18367   return dissect_ieee80211_common (tvb, pinfo, tree, FALSE, FALSE, phdr);
18368 }
18369
18370 /*
18371  * Dissect 802.11 with a variable-length link-layer header and with an
18372  * FCS, but no pseudo-header.
18373  */
18374 static int
18375 dissect_ieee80211_withfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18376 {
18377   struct ieee_802_11_phdr phdr;
18378
18379   /* Construct a pseudo-header to hand to the common code. */
18380   memset(&phdr, 0, sizeof(phdr));
18381   phdr.fcs_len = 4;
18382   phdr.decrypted = FALSE;
18383   phdr.datapad = FALSE;
18384   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18385   dissect_ieee80211_common (tvb, pinfo, tree, FALSE, FALSE, &phdr);
18386   return tvb_captured_length(tvb);
18387 }
18388
18389 /*
18390  * Dissect 802.11 with a variable-length link-layer header and without an
18391  * FCS, but no pseudo-header.
18392  */
18393 static int
18394 dissect_ieee80211_withoutfcs (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18395 {
18396   struct ieee_802_11_phdr phdr;
18397
18398   /* Construct a pseudo-header to hand to the common code. */
18399   memset(&phdr, 0, sizeof(phdr));
18400   phdr.decrypted = FALSE;
18401   phdr.datapad = FALSE;
18402   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18403   dissect_ieee80211_common (tvb, pinfo, tree, FALSE, FALSE, &phdr);
18404   return tvb_captured_length(tvb);
18405 }
18406
18407 /*
18408  * Dissect 802.11 from an Intel 2200BG adapter in a Centrino laptop
18409  * running Windows XP.
18410  *
18411  * From
18412  *
18413  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00184.html
18414  *
18415  * and
18416  *
18417  *   https://www.wireshark.org/lists/ethereal-dev/200407/msg00393.html:
18418  *
18419  *  I tried capturing from a Centrino laptop with the Intel 2200BG 802.11g
18420  *  chipset. I saw a lot of "Ethernet II" frames with 0x2452 as ethertype.
18421  *
18422  *    ...
18423  *
18424  *  This behaviour has been observed on Windows XP. In my opinion it is
18425  *  a "proprietary" behaviour of either the Centrino driver or the Centrino
18426  *  hardware. Currently I have no Linux distro installed on the machine to
18427  *  verify whether it is also the case.
18428  *
18429  *  These packets are seen only in a promiscuous capture:
18430  *    - Packets normally received by the Centrino computer have the normal
18431  *      structure (no 802.11/LLC header but directly IP header).
18432  *    - Packets that are supposed to be received by another computer have
18433  *      the 802.11/LLC headers. ... Also I noticed that when WEP is enabled,
18434  *      the 802.11 header has the flag "WEP" set to true, but the packet
18435  *      is already decrypted. I added a test in the code to accomodate this.
18436  *      For TKIP it seems to stay encrypted.
18437  */
18438 static int
18439 dissect_ieee80211_centrino(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18440 {
18441   struct ieee_802_11_phdr phdr;
18442
18443   /* Construct a pseudo-header to hand to the common code. */
18444   memset(&phdr, 0, sizeof(phdr));
18445   phdr.decrypted = FALSE;
18446   phdr.datapad = FALSE;
18447   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18448   dissect_ieee80211_common (tvb, pinfo, tree, FALSE, TRUE, &phdr);
18449   return tvb_captured_length(tvb);
18450 }
18451
18452 /*
18453  * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
18454  * control field and with no FCS (some hardware sends out LWAPP-encapsulated
18455  * 802.11 packets with the control field byte swapped).
18456  */
18457 static int
18458 dissect_ieee80211_bsfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18459 {
18460   struct ieee_802_11_phdr phdr;
18461
18462   /* Construct a pseudo-header to hand to the common code. */
18463   memset(&phdr, 0, sizeof(phdr));
18464   phdr.decrypted = FALSE;
18465   phdr.datapad = FALSE;
18466   phdr.phy = PHDR_802_11_PHY_UNKNOWN;
18467   dissect_ieee80211_common (tvb, pinfo, tree, TRUE, FALSE, &phdr);
18468   return tvb_captured_length(tvb);
18469 }
18470
18471 static void
18472 wlan_defragment_init(void)
18473 {
18474   reassembly_table_init(&wlan_reassembly_table,
18475                         &addresses_reassembly_table_functions);
18476 }
18477
18478 static void
18479 wlan_defragment_cleanup(void)
18480 {
18481   reassembly_table_destroy(&wlan_reassembly_table);
18482 }
18483
18484 /* ------------- */
18485 static guint
18486 retransmit_hash(gconstpointer k)
18487 {
18488   const retransmit_key *key = (const retransmit_key *)k;
18489   guint hash_val;
18490   int   i;
18491
18492   hash_val = 0;
18493   for (i = 0; i < 6; i++)
18494     hash_val += key->bssid[i];
18495
18496   for (i = 0; i < 6; i++)
18497     hash_val += key->src[i];
18498
18499   return hash_val;
18500 }
18501
18502 static gint
18503 retransmit_equal(gconstpointer k1, gconstpointer k2)
18504 {
18505   const retransmit_key *key1 = (const retransmit_key *)k1;
18506   const retransmit_key *key2 = (const retransmit_key *)k2;
18507
18508   return ((!memcmp(key1->bssid, key2->bssid, 6) && !memcmp(key1->src, key2->src, 6)) ? TRUE:FALSE);
18509 }
18510
18511 static guint
18512 frame_hash(gconstpointer k)
18513 {
18514   guint32 frame = GPOINTER_TO_UINT(k);
18515
18516   return frame;
18517 }
18518
18519 static gint
18520 frame_equal(gconstpointer k1, gconstpointer k2)
18521 {
18522   guint32 frame1 = GPOINTER_TO_UINT(k1);
18523   guint32 frame2 = GPOINTER_TO_UINT(k2);
18524
18525   return frame1==frame2;
18526 }
18527
18528 /*
18529  * EAPOL key description dissectors.
18530  */
18531 #define KEY_INFO_KEYDES_VERSION_MASK        0x0007
18532 #define KEY_INFO_KEY_TYPE_MASK              0x0008
18533 #define KEY_INFO_KEY_INDEX_MASK             0x0030
18534 #define KEY_INFO_INSTALL_MASK               0x0040
18535 #define KEY_INFO_KEY_ACK_MASK               0x0080
18536 #define KEY_INFO_KEY_MIC_MASK               0x0100
18537 #define KEY_INFO_SECURE_MASK                0x0200
18538 #define KEY_INFO_ERROR_MASK                 0x0400
18539 #define KEY_INFO_REQUEST_MASK               0x0800
18540 #define KEY_INFO_ENCRYPTED_KEY_DATA_MASK    0x1000
18541 #define KEY_INFO_SMK_MESSAGE_MASK           0x2000
18542
18543 #define KEYDES_VER_TYPE1        0x01
18544 #define KEYDES_VER_TYPE2        0x02
18545 #define KEYDES_VER_TYPE3        0x03
18546
18547 static const value_string keydes_version_vals[] = {
18548   { KEYDES_VER_TYPE1,     "RC4 Cipher, HMAC-MD5 MIC" },
18549   { KEYDES_VER_TYPE2,     "AES Cipher, HMAC-SHA1 MIC" },
18550   { KEYDES_VER_TYPE3,     "AES Cipher, AES-128-CMAC MIC" },
18551   { 0, NULL }
18552 };
18553
18554 static int proto_wlan_rsna_eapol = -1;
18555
18556 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo = -1;
18557 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version = -1;
18558 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type = -1;
18559 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index = -1;
18560 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install = -1;
18561 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack = -1;
18562 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic = -1;
18563 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure = -1;
18564 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error = -1;
18565 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request = -1;
18566 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data = -1;
18567 static int hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message = -1;
18568 static int hf_wlan_rsna_eapol_keydes_key_len = -1;
18569 static int hf_wlan_rsna_eapol_keydes_replay_counter = -1;
18570 static int hf_wlan_rsna_eapol_keydes_key_iv = -1;
18571 static int hf_wlan_rsna_eapol_wpa_keydes_nonce = -1;
18572 static int hf_wlan_rsna_eapol_wpa_keydes_rsc = -1;
18573 static int hf_wlan_rsna_eapol_wpa_keydes_id = -1;
18574 static int hf_wlan_rsna_eapol_wpa_keydes_mic = -1;
18575 static int hf_wlan_rsna_eapol_wpa_keydes_data_len = -1;
18576 static int hf_wlan_rsna_eapol_wpa_keydes_data = -1;
18577
18578 static gint ett_keyinfo = -1;
18579 static gint ett_wlan_rsna_eapol_keydes_data = -1;
18580
18581 static const true_false_string keyinfo_key_type_tfs = { "Pairwise Key", "Group Key" };
18582
18583 static int
18584 dissect_wlan_rsna_eapol_wpa_or_rsn_key(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
18585 {
18586   int         offset = 0;
18587   guint16     keyinfo;
18588   guint16     eapol_data_len;
18589   proto_tree *keyinfo_item = NULL;
18590   proto_tree *keyinfo_tree = NULL;
18591   proto_tree *keydes_tree;
18592   proto_tree *ti = NULL;
18593
18594   /*
18595    * RSNA key descriptors.
18596    */
18597   eapol_data_len = tvb_get_ntohs(tvb, offset+92);
18598   keyinfo = tvb_get_ntohs(tvb, offset);
18599   if (keyinfo & KEY_INFO_REQUEST_MASK) {
18600     col_set_str(pinfo->cinfo, COL_INFO, "Key (Request)");
18601     if (keyinfo & KEY_INFO_ERROR_MASK)
18602       col_set_str(pinfo->cinfo, COL_INFO, "Key (Request, Error)");
18603   } else if (keyinfo & KEY_INFO_KEY_TYPE_MASK) {
18604     guint16 masked;
18605     /* Windows is setting the Secure Bit on message 2 when rekeying, so we'll ignore it */
18606     masked = keyinfo &
18607       (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK);
18608
18609     switch (masked) {
18610     case KEY_INFO_KEY_ACK_MASK:
18611       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 1 of 4)");
18612       break;
18613
18614     case KEY_INFO_KEY_MIC_MASK:
18615       /* We check the key length to differentiate between message 2 and 4 and just hope that
18616       there are no strange implementations with key data and non-zero key length in message 4.
18617       According to the IEEE specification, sections 11.6.6.3 and 11.6.6.5 we should
18618       use the Secure Bit and/or the Nonce, but there are implementations ignoring the spec.
18619       The Secure Bit is incorrectly set on rekeys for Windows clients for Message 2 and the Nonce is non-zero
18620       in Message 4 in Bug 11994 (Apple?) */
18621       if (eapol_data_len)
18622         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 2 of 4)");
18623       else
18624         col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 4 of 4)");
18625       break;
18626
18627     case (KEY_INFO_INSTALL_MASK | KEY_INFO_KEY_ACK_MASK | KEY_INFO_KEY_MIC_MASK):
18628       col_set_str(pinfo->cinfo, COL_INFO, "Key (Message 3 of 4)");
18629       break;
18630     }
18631   } else {
18632     if (keyinfo & KEY_INFO_KEY_ACK_MASK)
18633       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 1 of 2)");
18634     else
18635       col_set_str(pinfo->cinfo, COL_INFO, "Key (Group Message 2 of 2)");
18636   }
18637   keyinfo_item =
18638     proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo, tvb,
18639                         offset, 2, ENC_BIG_ENDIAN);
18640
18641   keyinfo_tree = proto_item_add_subtree(keyinfo_item, ett_keyinfo);
18642   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version, tvb, offset, 2, ENC_BIG_ENDIAN);
18643   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type, tvb, offset, 2, ENC_BIG_ENDIAN);
18644   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index, tvb, offset, 2, ENC_BIG_ENDIAN);
18645   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install, tvb, offset, 2, ENC_BIG_ENDIAN);
18646   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack, tvb, offset, 2, ENC_BIG_ENDIAN);
18647   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic, tvb, offset, 2, ENC_BIG_ENDIAN);
18648   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure, tvb, offset, 2, ENC_BIG_ENDIAN);
18649   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error, tvb, offset, 2, ENC_BIG_ENDIAN);
18650   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request, tvb, offset, 2, ENC_BIG_ENDIAN);
18651   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data, tvb, offset, 2, ENC_BIG_ENDIAN);
18652   proto_tree_add_item(keyinfo_tree, hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message, tvb, offset, 2, ENC_BIG_ENDIAN);
18653   offset += 2;
18654
18655   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_len, tvb, offset,
18656                       2, ENC_BIG_ENDIAN);
18657   offset += 2;
18658   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_replay_counter, tvb,
18659                       offset, 8, ENC_BIG_ENDIAN);
18660   offset += 8;
18661   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_nonce, tvb, offset,
18662                       32, ENC_NA);
18663   offset += 32;
18664   proto_tree_add_item(tree, hf_wlan_rsna_eapol_keydes_key_iv, tvb,
18665                       offset, 16, ENC_NA);
18666   offset += 16;
18667   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_rsc, tvb, offset,
18668                       8, ENC_NA);
18669   offset += 8;
18670   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_id, tvb, offset, 8,
18671                       ENC_NA);
18672   offset += 8;
18673   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_mic, tvb, offset,
18674                       16, ENC_NA);
18675   offset += 16;
18676   proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data_len, tvb,
18677                       offset, 2, ENC_BIG_ENDIAN);
18678   offset += 2;
18679   if (eapol_data_len != 0) {
18680     ti = proto_tree_add_item(tree, hf_wlan_rsna_eapol_wpa_keydes_data,
18681                              tvb, offset, eapol_data_len, ENC_NA);
18682     if ((keyinfo & KEY_INFO_ENCRYPTED_KEY_DATA_MASK) ||
18683         !(keyinfo & KEY_INFO_KEY_TYPE_MASK)) {
18684       /* RSN: EAPOL-Key Key Data is encrypted.
18685        * WPA: Group Keys use encrypted Key Data.
18686        * Cannot parse this without knowing the key.
18687        * IEEE 802.11i-2004 8.5.2.
18688        */
18689     } else {
18690       keydes_tree = proto_item_add_subtree(ti, ett_wlan_rsna_eapol_keydes_data);
18691       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, keydes_tree,
18692                                        tvb_reported_length_remaining(tvb, offset),
18693                                        -1);
18694     }
18695   }
18696   return tvb_captured_length(tvb);
18697 }
18698
18699 /* Davide Schiera (2006-11-26): this function will try to decrypt with WEP or  */
18700 /* WPA and return a tvb to the caller to add a new tab. It returns the    */
18701 /* algorithm used for decryption (WEP, TKIP, CCMP) and the header and    */
18702 /* trailer lengths.                                      */
18703 static tvbuff_t *
18704 try_decrypt(tvbuff_t *tvb, guint offset, guint len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer, PAIRPDCAP_KEY_ITEM used_key)
18705 {
18706   const guint8      *enc_data;
18707   tvbuff_t          *decr_tvb = NULL;
18708   guint32            dec_caplen;
18709   guchar             dec_data[AIRPDCAP_MAX_CAPLEN];
18710
18711   if (!enable_decryption)
18712     return NULL;
18713
18714   /* get the entire packet                                  */
18715   enc_data = tvb_get_ptr(tvb, 0, len+offset);
18716
18717   /*  process packet with AirPDcap                              */
18718   if (AirPDcapPacketProcess(&airpdcap_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen,
18719                             used_key, FALSE)==AIRPDCAP_RET_SUCCESS)
18720   {
18721     guint8 *tmp;
18722     *algorithm=used_key->KeyType;
18723     switch (*algorithm) {
18724       case AIRPDCAP_KEY_TYPE_WEP:
18725         *sec_header=AIRPDCAP_WEP_HEADER;
18726         *sec_trailer=AIRPDCAP_WEP_TRAILER;
18727         break;
18728       case AIRPDCAP_KEY_TYPE_CCMP:
18729         *sec_header=AIRPDCAP_RSNA_HEADER;
18730         *sec_trailer=AIRPDCAP_CCMP_TRAILER;
18731         break;
18732       case AIRPDCAP_KEY_TYPE_TKIP:
18733         *sec_header=AIRPDCAP_RSNA_HEADER;
18734         *sec_trailer=AIRPDCAP_TKIP_TRAILER;
18735         break;
18736       default:
18737         return NULL;
18738     }
18739
18740     /* allocate buffer for decrypted payload                      */
18741     tmp = (guint8 *)g_memdup(dec_data+offset, dec_caplen-offset);
18742
18743     len = dec_caplen-offset;
18744
18745     /* decrypt successful, let's set up a new data tvb.              */
18746     decr_tvb = tvb_new_child_real_data(tvb, tmp, len, len);
18747     tvb_set_free_cb(decr_tvb, g_free);
18748   }
18749
18750   return decr_tvb;
18751 }
18752 /*  Davide Schiera -----------------------------------------------------------  */
18753
18754
18755 /* Collect our WEP and WPA keys */
18756 static void
18757 set_airpdcap_keys(void)
18758 {
18759   AIRPDCAP_KEYS_COLLECTION  keys;
18760   GByteArray                *bytes = NULL;
18761   guint                      i;
18762
18763   keys.nKeys = 0;
18764
18765   for (i = 0; (uat_wep_key_records != NULL) && (i < num_wepkeys_uat) && (i < MAX_ENCRYPTION_KEYS); i++)
18766   {
18767     decryption_key_t *dk;
18768     dk = parse_key_string(uat_wep_key_records[i].string, uat_wep_key_records[i].key);
18769
18770     if (dk != NULL)
18771     {
18772       AIRPDCAP_KEY_ITEM          key;
18773       if (dk->type == AIRPDCAP_KEY_TYPE_WEP)
18774       {
18775         gboolean res;
18776         key.KeyType = AIRPDCAP_KEY_TYPE_WEP;
18777
18778         bytes = g_byte_array_new();
18779         res = hex_str_to_bytes(dk->key->str, bytes, FALSE);
18780
18781         if (dk->key->str && res && (bytes->len > 0) && (bytes->len <= AIRPDCAP_WEP_KEY_MAXLEN))
18782         {
18783           /*
18784            * WEP key is correct (well, the can be even or odd, so it is not
18785            * a real check, I think... is a check performed somewhere in the
18786            * AirPDcap function???)
18787            */
18788           memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
18789           key.KeyData.Wep.WepKeyLen = bytes->len;
18790           keys.Keys[keys.nKeys] = key;
18791           keys.nKeys += 1;
18792         }
18793       }
18794       else if (dk->type == AIRPDCAP_KEY_TYPE_WPA_PWD)
18795       {
18796         key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PWD;
18797
18798         /* XXX - This just lops the end if the key off if it's too long.
18799          *       Should we handle this more gracefully? */
18800         g_strlcpy(key.UserPwd.Passphrase, dk->key->str, AIRPDCAP_WPA_PASSPHRASE_MAX_LEN+1);
18801
18802         key.UserPwd.SsidLen = 0;
18803         if ((dk->ssid != NULL) && (dk->ssid->len <= AIRPDCAP_WPA_SSID_MAX_LEN))
18804         {
18805           memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
18806           key.UserPwd.SsidLen = dk->ssid->len;
18807         }
18808
18809         keys.Keys[keys.nKeys] = key;
18810         keys.nKeys += 1;
18811       }
18812       else if (dk->type == AIRPDCAP_KEY_TYPE_WPA_PSK)
18813       {
18814         key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PSK;
18815
18816         bytes = g_byte_array_new();
18817         hex_str_to_bytes(dk->key->str, bytes, FALSE);
18818
18819         /* XXX - Pass the correct array of bytes... */
18820         if (bytes->len <= AIRPDCAP_WPA_PSK_LEN) {
18821           memcpy(key.KeyData.Wpa.Psk, bytes->data, bytes->len);
18822
18823           keys.Keys[keys.nKeys] = key;
18824           keys.nKeys += 1;
18825         }
18826       }
18827       free_key_string(dk);
18828       if (bytes) {
18829         g_byte_array_free(bytes, TRUE);
18830         bytes = NULL;
18831       }
18832     }
18833   }
18834
18835   /* Now set the keys */
18836   AirPDcapSetKeys(&airpdcap_ctx, keys.Keys, keys.nKeys);
18837
18838 }
18839
18840 static void
18841 init_wepkeys(void)
18842 {
18843
18844   /*
18845    * XXX - AirPDcap - That God sends it to us beautiful (che dio ce la mandi bona)
18846    * The next lines will add a key to the AirPDcap context. The keystring will be added
18847    * to the old WEP array too, but we don't care, because the packets will come here
18848    * already decrypted... One of these days we will fix this too
18849    */
18850   set_airpdcap_keys();
18851 }
18852
18853 /*
18854  * This code had been taken from AirSnort crack.c function classify()
18855  * Permission granted by snax <at> shmoo dot com
18856  * weak_iv - determine which key byte an iv is useful in resolving
18857  * parm     - p, pointer to the first byte of an IV
18858  * return   -  n - this IV is weak for byte n of a WEP key
18859  *            -1 - this IV is not weak for any key bytes
18860  *
18861  * This function tests for IVs that are known to satisfy the criteria
18862  * for a weak IV as specified in FMS section 7.1
18863  *
18864  */
18865 static int
18866 weak_iv(guchar *iv)
18867 {
18868   guchar sum, k;
18869
18870   if ((iv[1] == 255) && (iv[0] > 2) && (iv[0] < 16)) {
18871     return iv[0] -3;
18872   }
18873
18874   sum = iv[0] + iv[1];
18875   if (sum == 1) {
18876     if (iv[2] <= 0x0a) {
18877       return iv[2] +2;
18878     }
18879     else if (iv[2] == 0xff) {
18880       return 0;
18881     }
18882   }
18883   k = 0xfe - iv[2];
18884   if ((sum == k)  && ((iv[2] >= 0xf2) && (iv[2] <= 0xfe) && (iv[2] != 0xfd))) {
18885     return k;
18886   }
18887   return -1;
18888 }
18889
18890 static void
18891 wlan_retransmit_init(void)
18892 {
18893   if (fc_analyse_retransmit_table) {
18894     g_hash_table_destroy(fc_analyse_retransmit_table);
18895     fc_analyse_retransmit_table = NULL;
18896   }
18897
18898   if (fc_first_frame_table) {
18899     g_hash_table_destroy(fc_first_frame_table);
18900     fc_first_frame_table = NULL;
18901   }
18902
18903   if (wlan_subdissector)
18904     return;
18905
18906   fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
18907   fc_first_frame_table = g_hash_table_new(frame_hash, frame_equal);
18908
18909 }
18910
18911 static int
18912 dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
18913 {
18914   int         offset = 0;
18915   guint8      type;
18916   int         tagged_parameter_tree_len;
18917   proto_tree *tagged_tree;
18918
18919   type = tvb_get_guint8(tvb, offset);
18920   proto_tree_add_item(tree, hf_ieee80211_data_encap_payload_type, tvb, offset,
18921                       1, ENC_LITTLE_ENDIAN);
18922   offset += 1;
18923   switch (type) {
18924   case 1:
18925     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRB");
18926     /* TODO: IEEE 802.11r */
18927     break;
18928   case 2:
18929     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
18930     col_clear(pinfo->cinfo, COL_INFO);
18931     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_ACTION);
18932     tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
18933     if (tagged_parameter_tree_len > 0) {
18934       tagged_tree = get_tagged_parameter_tree(tree, tvb, offset,
18935                                               tagged_parameter_tree_len);
18936       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
18937                                        tagged_parameter_tree_len, -1);
18938     }
18939     break;
18940   }
18941   return tvb_captured_length(tvb);
18942 }
18943
18944 void
18945 proto_register_ieee80211 (void)
18946 {
18947
18948   static hf_register_info hf[] = {
18949     {&hf_ieee80211_fc_field,
18950      {"Frame Control Field", "wlan.fc",
18951       FT_UINT16, BASE_HEX, NULL, 0,
18952       "MAC Frame control", HFILL }},
18953
18954     {&hf_ieee80211_fc_proto_version,
18955      {"Version", "wlan.fc.version",
18956       FT_UINT8, BASE_DEC, NULL, 0x03,
18957       "MAC Protocol version", HFILL }},  /* 0 */
18958
18959     {&hf_ieee80211_fc_frame_type,
18960      {"Type", "wlan.fc.type",
18961       FT_UINT8, BASE_DEC, VALS(frame_type), 0x0C,
18962       "Frame type", HFILL }},
18963
18964     {&hf_ieee80211_fc_frame_subtype,
18965      {"Subtype", "wlan.fc.subtype",
18966       FT_UINT8, BASE_DEC, NULL, 0xF0,
18967       "Frame subtype", HFILL }},  /* 2 */
18968
18969     {&hf_ieee80211_fc_frame_type_subtype,
18970      {"Type/Subtype", "wlan.fc.type_subtype",
18971       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &frame_type_subtype_vals_ext, 0x0,
18972       "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
18973
18974     {&hf_ieee80211_fc_frame_extension,
18975      {"Control Frame Extension", "wlan.fc.extension",
18976       FT_UINT8, BASE_DEC, NULL, 0,
18977       NULL, HFILL }},
18978
18979     {&hf_ieee80211_fc_flags,
18980      {"Flags", "wlan.flags",
18981       FT_UINT8, BASE_HEX, NULL, 0,
18982       NULL, HFILL }},
18983
18984     {&hf_ieee80211_fc_data_ds,
18985      {"DS status", "wlan.fc.ds",
18986       FT_UINT8, BASE_HEX, VALS(tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
18987       "Data-frame DS-traversal status", HFILL }},  /* 3 */
18988
18989     {&hf_ieee80211_fc_to_ds,
18990      {"To DS", "wlan.fc.tods",
18991       FT_BOOLEAN, 8, TFS (&tods_flag), FLAG_TO_DS,
18992       "To DS flag", HFILL }},    /* 4 */
18993
18994     {&hf_ieee80211_fc_from_ds,
18995      {"From DS", "wlan.fc.fromds",
18996       FT_BOOLEAN, 8, TFS (&fromds_flag), FLAG_FROM_DS,
18997       "From DS flag", HFILL }},    /* 5 */
18998
18999     {&hf_ieee80211_fc_more_frag,
19000      {"More Fragments", "wlan.fc.frag",
19001       FT_BOOLEAN, 8, TFS (&more_fragments), FLAG_MORE_FRAGMENTS,
19002       "More Fragments flag", HFILL }},  /* 6 */
19003
19004     {&hf_ieee80211_fc_retry,
19005      {"Retry", "wlan.fc.retry",
19006       FT_BOOLEAN, 8, TFS (&retry_flags), FLAG_RETRY,
19007       "Retransmission flag", HFILL }},
19008
19009     { &hf_ieee80211_fc_analysis_retransmission,
19010      {"Retransmission", "wlan.analysis.retransmission",
19011       FT_NONE, BASE_NONE, NULL, 0x0,
19012       "This frame is a suspected wireless retransmission", HFILL }},
19013
19014     { &hf_ieee80211_fc_analysis_retransmission_frame,
19015      {"Retransmission of frame", "wlan.analysis.retransmission_frame",
19016       FT_FRAMENUM, BASE_NONE, NULL, 0x0,
19017       "This is a retransmission of frame #", HFILL }},
19018
19019     {&hf_ieee80211_fc_pwr_mgt,
19020      {"PWR MGT", "wlan.fc.pwrmgt",
19021       FT_BOOLEAN, 8, TFS (&pm_flags), FLAG_POWER_MGT,
19022       "Power management status", HFILL }},
19023
19024     {&hf_ieee80211_fc_more_data,
19025      {"More Data", "wlan.fc.moredata",
19026       FT_BOOLEAN, 8, TFS (&md_flags), FLAG_MORE_DATA,
19027       "More data flag", HFILL }},
19028
19029     {&hf_ieee80211_fc_protected,
19030      {"Protected flag", "wlan.fc.protected",
19031       FT_BOOLEAN, 8, TFS (&protected_flags), FLAG_PROTECTED,
19032       NULL, HFILL }},
19033
19034     {&hf_ieee80211_fc_order,
19035      {"Order flag", "wlan.fc.order",
19036       FT_BOOLEAN, 8, TFS (&order_flags), FLAG_ORDER,
19037       "Strictly ordered flag", HFILL }},
19038
19039     {&hf_ieee80211_assoc_id,
19040      {"Association ID","wlan.aid"
19041       ,FT_UINT16, BASE_DEC, NULL, 0x3FFF,
19042       "Association-ID field", HFILL }},
19043
19044     {&hf_ieee80211_did_duration,
19045      {"Duration", "wlan.duration",
19046       FT_UINT16, BASE_DEC, NULL, 0x7FFF,
19047       "Duration field", HFILL }},
19048
19049     {&hf_ieee80211_addr_da,
19050      {"Destination address", "wlan.da",
19051       FT_ETHER, BASE_NONE, NULL, 0,
19052       "Destination Hardware Address", HFILL }},
19053
19054     { &hf_ieee80211_addr_da_resolved,
19055       {"Destination address (resolved)", "wlan.da_resolved", FT_STRING,
19056         BASE_NONE, NULL, 0x0, "Destination Hardware Address (resolved)",
19057         HFILL }},
19058
19059     {&hf_ieee80211_addr_sa,
19060      {"Source address", "wlan.sa",
19061       FT_ETHER, BASE_NONE, NULL, 0,
19062       "Source Hardware Address", HFILL }},
19063
19064     { &hf_ieee80211_addr_sa_resolved,
19065       {"Source address (resolved)", "wlan.sa_resolved", FT_STRING, BASE_NONE,
19066         NULL, 0x0, "Source Hardware Address (resolved)", HFILL }},
19067
19068     { &hf_ieee80211_addr,
19069       {"Hardware address", "wlan.addr",
19070        FT_ETHER, BASE_NONE, NULL, 0,
19071        "SA, DA, BSSID, RA or TA Hardware Address", HFILL }},
19072
19073     { &hf_ieee80211_addr_resolved,
19074       { "Hardware address (resolved)", "wlan.addr_resolved", FT_STRING,
19075         BASE_NONE, NULL, 0x0,
19076         "SA, DA, BSSID, RA or TA Hardware Address (resolved)", HFILL }},
19077
19078     {&hf_ieee80211_addr_ra,
19079      {"Receiver address", "wlan.ra",
19080       FT_ETHER, BASE_NONE, NULL, 0,
19081       "Receiving Station Hardware Address", HFILL }},
19082
19083     { &hf_ieee80211_addr_ra_resolved,
19084       {"Receiver address (resolved)", "wlan.ra_resolved", FT_STRING, BASE_NONE,
19085         NULL, 0x0, "Receiving Station Hardware Address (resolved)", HFILL }},
19086
19087     {&hf_ieee80211_addr_ta,
19088      {"Transmitter address", "wlan.ta",
19089       FT_ETHER, BASE_NONE, NULL, 0,
19090       "Transmitting Station Hardware Address", HFILL }},
19091
19092     { &hf_ieee80211_addr_ta_resolved,
19093       {"Transmitter address (resolved)", "wlan.ta_resolved", FT_STRING,
19094         BASE_NONE, NULL, 0x0,
19095         "Transmitting Station Hardware Address (resolved)", HFILL }},
19096
19097     {&hf_ieee80211_addr_bssid,
19098      {"BSS Id", "wlan.bssid",
19099       FT_ETHER, BASE_NONE, NULL, 0,
19100       "Basic Service Set ID", HFILL }},
19101
19102     { &hf_ieee80211_addr_bssid_resolved,
19103       {"BSS Id (resolved)", "wlan.bssid_resolved", FT_STRING, BASE_NONE, NULL,
19104         0x0, "Basic Service Set ID (resolved)", HFILL }},
19105
19106     {&hf_ieee80211_addr_staa,
19107      {"STA address", "wlan.staa",
19108       FT_ETHER, BASE_NONE, NULL, 0,
19109       "Station Hardware Address", HFILL }},
19110
19111     { &hf_ieee80211_addr_staa_resolved,
19112       {"STA address (resolved)", "wlan.staa_resolved", FT_STRING, BASE_NONE, NULL,
19113         0x0, "Station Hardware Address (resolved)", HFILL }},
19114
19115     {&hf_ieee80211_frag_number,
19116      {"Fragment number", "wlan.frag",
19117       FT_UINT16, BASE_DEC, NULL, 0x000F,
19118       NULL, HFILL }},
19119
19120     {&hf_ieee80211_seq_number,
19121      {"Sequence number", "wlan.seq",
19122       FT_UINT16, BASE_DEC, NULL, 0xFFF0,
19123       NULL, HFILL }},
19124
19125     {&hf_ieee80211_mesh_control_field,
19126      {"Mesh Control Field", "wlan.mesh.control_field",
19127       FT_NONE, BASE_NONE, NULL, 0,
19128       NULL, HFILL }},
19129
19130     {&hf_ieee80211_qos,
19131      {"Qos Control", "wlan.qos",
19132       FT_UINT16, BASE_HEX, NULL, 0,
19133       NULL, HFILL }},
19134
19135     {&hf_ieee80211_qos_tid,
19136      {"TID", "wlan.qos.tid",
19137       FT_UINT16, BASE_DEC, NULL, 0x000F,
19138       NULL, HFILL }},
19139
19140     {&hf_ieee80211_qos_priority,
19141      {"Priority", "wlan.qos.priority",
19142       FT_UINT16, BASE_DEC, VALS(ieee80211_qos_tags_acs), 0x0007,
19143       "802.1D Tag", HFILL }},
19144
19145     {&hf_ieee80211_qos_eosp,
19146      {"EOSP", "wlan.qos.eosp",
19147       FT_BOOLEAN, 16, TFS (&eosp_flag), QOS_FLAG_EOSP,
19148       "EOSP Field", HFILL }},
19149
19150     {&hf_ieee80211_qos_bit4,
19151      {"QoS bit 4", "wlan.qos.bit4",
19152       FT_BOOLEAN, 16, TFS (&bit4_flag), QOS_FLAG_EOSP,
19153       NULL, HFILL }},
19154
19155     {&hf_ieee80211_qos_ack_policy,
19156      {"Ack Policy", "wlan.qos.ack",
19157       FT_UINT16, BASE_HEX,  VALS(ack_policy), 0x0060,
19158       NULL, HFILL }},
19159
19160     {&hf_ieee80211_qos_amsdu_present,
19161      {"Payload Type", "wlan.qos.amsdupresent",
19162       FT_BOOLEAN, 16,
19163       TFS(&ieee80211_qos_amsdu_present_flag), 0x0080, NULL, HFILL }},
19164
19165     {&hf_ieee80211_qos_txop_limit,
19166      {"TXOP Limit", "wlan.qos.txop_limit",
19167       FT_UINT16, BASE_DEC, NULL, 0xFF00,
19168       NULL, HFILL }},
19169
19170     {&hf_ieee80211_qos_ps_buf_state,
19171      {"QAP PS Buffer State", "wlan.qos.ps_buf_state",
19172       FT_UINT16, BASE_HEX, NULL, 0xFF00,
19173       NULL, HFILL }},
19174
19175     {&hf_ieee80211_qos_buf_state_indicated,
19176      {"Buffer State Indicated", "wlan.qos.buf_state_indicated",
19177       FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
19178       NULL, HFILL }},
19179
19180     {&hf_ieee80211_qos_highest_pri_buf_ac,
19181      {"Highest-Priority Buffered AC", "wlan.qos.highest_pri_buf_ac",
19182        FT_UINT16, BASE_DEC, VALS(wme_acs), 0x0C00,
19183       NULL, HFILL }},
19184
19185     {&hf_ieee80211_qos_qap_buf_load,
19186      {"QAP Buffered Load", "wlan.qos.qap_buf_load",
19187       FT_UINT16, BASE_DEC, NULL, 0xF000,
19188       NULL, HFILL }},
19189
19190     {&hf_ieee80211_qos_txop_dur_req,
19191      {"TXOP Duration Requested", "wlan.qos.txop_dur_req",
19192       FT_UINT16, BASE_DEC, NULL, 0xFF00,
19193       NULL, HFILL }},
19194
19195     {&hf_ieee80211_qos_queue_size,
19196      {"Queue Size", "wlan.qos.queue_size",
19197       FT_UINT16, BASE_DEC, NULL, 0xFF00,
19198       NULL, HFILL }},
19199
19200     {&hf_ieee80211_fcs,
19201      {"Frame check sequence", "wlan.fcs",
19202       FT_UINT32, BASE_HEX, NULL, 0,
19203       "Frame Check Sequence (FCS)", HFILL }},
19204
19205     {&hf_ieee80211_fcs_good,
19206      {"Good", "wlan.fcs_good",
19207       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19208       "True if the FCS is correct", HFILL }},
19209
19210     {&hf_ieee80211_fcs_bad,
19211      {"Bad", "wlan.fcs_bad",
19212       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19213       "True if the FCS is incorrect", HFILL }},
19214
19215     {&hf_ieee80211_fragment_overlap,
19216       {"Fragment overlap", "wlan.fragment.overlap",
19217        FT_BOOLEAN, BASE_NONE,
19218        NULL, 0x0,
19219        "Fragment overlaps with other fragments", HFILL }},
19220
19221     {&hf_ieee80211_fragment_overlap_conflict,
19222       {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
19223        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19224        "Overlapping fragments contained conflicting data", HFILL }},
19225
19226     {&hf_ieee80211_fragment_multiple_tails,
19227       {"Multiple tail fragments found", "wlan.fragment.multipletails",
19228        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19229        "Several tails were found when defragmenting the packet", HFILL }},
19230
19231     {&hf_ieee80211_fragment_too_long_fragment,
19232       {"Fragment too long", "wlan.fragment.toolongfragment",
19233        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
19234        "Fragment contained data past end of packet", HFILL }},
19235
19236     {&hf_ieee80211_fragment_error,
19237       {"Defragmentation error", "wlan.fragment.error",
19238        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
19239        "Defragmentation error due to illegal fragments", HFILL }},
19240
19241     {&hf_ieee80211_fragment_count,
19242       {"Fragment count", "wlan.fragment.count",
19243        FT_UINT32, BASE_DEC, NULL, 0x0,
19244        NULL, HFILL }},
19245
19246     {&hf_ieee80211_fragment,
19247       {"802.11 Fragment", "wlan.fragment",
19248        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
19249        NULL, HFILL }},
19250
19251     {&hf_ieee80211_fragments,
19252       {"802.11 Fragments", "wlan.fragments",
19253        FT_NONE, BASE_NONE, NULL, 0x0,
19254        NULL, HFILL }},
19255
19256     {&hf_ieee80211_reassembled_in,
19257       {"Reassembled 802.11 in frame", "wlan.reassembled_in",
19258        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
19259        "This 802.11 packet is reassembled in this frame", HFILL }},
19260
19261     {&hf_ieee80211_reassembled_length,
19262       {"Reassembled 802.11 length", "wlan.reassembled.length",
19263        FT_UINT32, BASE_DEC, NULL, 0x0,
19264        "The total length of the reassembled payload", HFILL }},
19265
19266     {&hf_ieee80211_wep_iv,
19267      {"Initialization Vector", "wlan.wep.iv",
19268       FT_UINT24, BASE_HEX, NULL, 0,
19269       NULL, HFILL }},
19270
19271     {&hf_ieee80211_wep_iv_weak,
19272      {"Weak IV", "wlan.wep.weakiv",
19273       FT_BOOLEAN, BASE_NONE, NULL,0x0,
19274        NULL,HFILL}},
19275
19276     {&hf_ieee80211_tkip_extiv,
19277      {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv",
19278       FT_STRING, BASE_NONE, NULL, 0,
19279       "TKIP Extended Initialization Vector", HFILL }},
19280
19281     {&hf_ieee80211_ccmp_extiv,
19282      {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv",
19283       FT_STRING, BASE_NONE, NULL, 0,
19284       "CCMP Extended Initialization Vector", HFILL }},
19285
19286     {&hf_ieee80211_wep_key,
19287      {"Key Index", "wlan.wep.key",
19288       FT_UINT8, BASE_DEC, NULL, 0,
19289       NULL, HFILL }},
19290
19291     {&hf_ieee80211_wep_icv,
19292      {"WEP ICV", "wlan.wep.icv",
19293       FT_UINT32, BASE_HEX, NULL, 0,
19294       NULL, HFILL }},
19295
19296     {&hf_ieee80211_fc_analysis_pmk,
19297      {"PMK", "wlan.analysis.pmk",
19298       FT_STRING, BASE_NONE, NULL, 0x0,
19299       NULL, HFILL }},
19300
19301     {&hf_ieee80211_fc_analysis_tk,
19302      {"TK", "wlan.analysis.tk",
19303       FT_STRING, BASE_NONE, NULL, 0x0,
19304       NULL, HFILL }},
19305
19306     {&hf_ieee80211_fc_analysis_gtk,
19307      {"GTK", "wlan.analysis.gtk",
19308       FT_STRING, BASE_NONE, NULL, 0x0,
19309       NULL, HFILL }},
19310
19311     {&hf_ieee80211_block_ack_request_control,
19312      {"Block Ack Request (BAR) Control", "wlan.bar.control",
19313       FT_UINT16, BASE_HEX, NULL, 0,
19314       NULL, HFILL }},
19315
19316     {&hf_ieee80211_block_ack_control,
19317      {"Block Ack Request Control", "wlan.ba.control",
19318       FT_UINT16, BASE_HEX, NULL, 0,
19319       NULL, HFILL }},
19320
19321     {&hf_ieee80211_block_ack_control_ack_policy,
19322      {"BAR Ack Policy", "wlan.ba.control.ackpolicy",
19323       FT_BOOLEAN, 16, TFS (&ieee80211_block_ack_control_ack_policy_flag), 0x01,
19324       "Block Ack Request (BAR) Ack Policy", HFILL }},
19325
19326     {&hf_ieee80211_block_ack_control_multi_tid,
19327      {"Multi-TID", "wlan.ba.control.multitid",
19328       FT_BOOLEAN, 16, 0, 0x02,
19329       "Multi-Traffic Identifier (TID)", HFILL }},
19330
19331     {&hf_ieee80211_block_ack_control_compressed_bitmap,
19332      {"Compressed Bitmap", "wlan.ba.control.cbitmap",
19333       FT_BOOLEAN, 16, 0, 0x04,
19334       NULL, HFILL }},
19335
19336     {&hf_ieee80211_block_ack_control_reserved,
19337      {"Reserved", "wlan.ba.control.reserved",
19338       FT_UINT16, BASE_HEX, NULL, 0x0ff8,
19339       NULL, HFILL }},
19340
19341     {&hf_ieee80211_block_ack_control_basic_tid_info,
19342      {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
19343       FT_UINT16, BASE_HEX, NULL, 0xf000,
19344       "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
19345
19346     {&hf_ieee80211_block_ack_control_compressed_tid_info,
19347      {"TID for which a BlockAck frame is requested", "wlan.bar.compressed.tidinfo",
19348       FT_UINT16, BASE_HEX, NULL, 0xf000,
19349       "Traffic Identifier (TID) for which a BlockAck frame is requested", HFILL }},
19350
19351     {&hf_ieee80211_block_ack_control_multi_tid_info,
19352      {"Number of TIDs Present", "wlan.ba.mtid.tidinfo",
19353       FT_UINT16, BASE_HEX, NULL, 0xf000,
19354       "Number of Traffic Identifiers (TIDs) Present", HFILL }},
19355
19356     {&hf_ieee80211_block_ack_multi_tid_info,
19357      {"Traffic Identifier (TID) Info", "wlan.ba.mtid.tid",
19358       FT_UINT8, BASE_DEC, 0, 0,
19359       NULL, HFILL }},
19360
19361     {&hf_ieee80211_block_ack_multi_tid_reserved,
19362      {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
19363       FT_UINT16, BASE_HEX, 0, 0x0fff,
19364       NULL, HFILL }},
19365
19366     {&hf_ieee80211_block_ack_multi_tid_value,
19367      {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
19368       FT_UINT16, BASE_HEX, 0, 0xf000,
19369       NULL, HFILL }},
19370
19371     {&hf_ieee80211_block_ack_request_type,
19372      {"Block Ack Request Type", "wlan.bar.type",
19373       FT_UINT8, BASE_HEX, VALS(ieee80211_block_ack_request_type_flags), 0x06,
19374       "Block Ack Request (BAR) Type", HFILL }},
19375
19376     {&hf_ieee80211_block_ack_type,
19377      {"Block Ack Type", "wlan.ba.type",
19378       FT_UINT8, BASE_HEX, VALS(ieee80211_block_ack_type_flags), 0x06,
19379       NULL, HFILL }},
19380
19381     {&hf_ieee80211_block_ack_bitmap,
19382      {"Block Ack Bitmap", "wlan.ba.bm",
19383       FT_BYTES, BASE_NONE, NULL, 0,
19384       NULL, HFILL }},
19385
19386     /* Used for Extended compressed BlockAck */
19387     {&hf_ieee80211_block_ack_RBUFCAP,
19388      {"Block Ack RBUFCAP", "wlan.ba.RBUFCAP",
19389       FT_BOOLEAN, BASE_DEC, NULL, 0,
19390       NULL, HFILL }},
19391
19392     {&hf_ieee80211_block_ack_bitmap_missing_frame,
19393      {"Missing frame", "wlan.ba.bm.missing_frame",
19394       FT_UINT32, BASE_DEC, NULL, 0,
19395       NULL, HFILL }},
19396
19397     {&hf_ieee80211_beamform_feedback_seg_retrans_bitmap,
19398      {"Feedback segment Retansmission Bitmap", "wlan.beamform.feedback_seg_retrans_bitmap",
19399       FT_UINT8, BASE_HEX, NULL, 0,
19400       NULL, HFILL }},
19401
19402     {&hf_ieee80211_vht_ndp_annc_token,
19403      {"Sounding Dialog Token", "wlan.vht_ndp.token",
19404       FT_UINT8, BASE_HEX, NULL, 0,
19405       NULL, HFILL }},
19406
19407     {&hf_ieee80211_vht_ndp_annc_token_number,
19408      {"Sounding Dialog Token Number", "wlan.vht_ndp.token.number",
19409       FT_UINT8, BASE_DEC, NULL, 0xFC,
19410       NULL, HFILL }},
19411
19412     {&hf_ieee80211_vht_ndp_annc_token_reserved,
19413      {"Reserved", "wlan.vht_ndp.token.reserved",
19414       FT_UINT8, BASE_HEX, NULL, 0x03,
19415       NULL, HFILL }},
19416
19417     {&hf_ieee80211_vht_ndp_annc_sta_info,
19418      {"STA Info", "wlan.vht_ndp.sta_info",
19419       FT_UINT16, BASE_HEX, NULL, 0,
19420       NULL, HFILL }},
19421
19422     {&hf_ieee80211_vht_ndp_annc_sta_info_aid12,
19423      {"AID12", "wlan.vht_ndp.sta_info.aid12",
19424       FT_UINT16, BASE_HEX, NULL, 0x0FFF,
19425       "12 least significant bits of the AID of the target STA", HFILL }},
19426
19427     {&hf_ieee80211_vht_ndp_annc_sta_info_feedback_type,
19428      {"Feedback Type", "wlan.vht_ndp.sta_info.feedback_type",
19429       FT_BOOLEAN, 16, TFS(&vht_ndp_annc_sta_info_feedback_type), 0x1000,
19430       NULL, HFILL }},
19431
19432     {&hf_ieee80211_vht_ndp_annc_sta_info_nc_index,
19433      {"Nc Index", "wlan.vht_ndp.sta_info.nc_index",
19434       FT_UINT16, BASE_DEC, VALS(num_plus_one_3bit_flag), 0xE000,
19435       NULL, HFILL }},
19436
19437     {&hf_ieee80211_vht_ndp_annc_sta_info_reserved,
19438      {"Reserved", "wlan.vht_ndp.sta_info.reserved",
19439       FT_UINT16, BASE_HEX, NULL, 0xE000,
19440       NULL, HFILL }},
19441
19442     {&hf_ieee80211_data_encap_payload_type,
19443      {"Payload Type", "wlan.data_encap.payload_type",
19444       FT_UINT8, BASE_DEC, VALS(ieee80211_data_encap_payload_types), 0,
19445       NULL, HFILL }},
19446
19447     {&hf_ieee80211_ff_tdls_action_code,
19448      {"Action code", "wlan_mgt.fixed.action_code",
19449       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tdls_action_codes_ext, 0,
19450       "Management action code", HFILL }},
19451
19452     {&hf_ieee80211_ff_target_channel,
19453      {"Target Channel", "wlan_mgt.fixed.target_channel",
19454       FT_UINT8, BASE_DEC, NULL, 0,
19455       NULL, HFILL }},
19456
19457     {&hf_ieee80211_ff_operating_class,
19458      {"Operating Class", "wlan_mgt.fixed.operating_class",
19459       FT_UINT8, BASE_DEC, NULL, 0,
19460       NULL, HFILL }},
19461
19462     {&hf_ieee80211_ff_wnm_action_code,
19463      {"Action code", "wlan_mgt.fixed.action_code",
19464       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_action_codes_ext, 0,
19465       "Management action code", HFILL }},
19466
19467     {&hf_ieee80211_ff_unprotected_wnm_action_code,
19468      {"Action code", "wlan_mgt.fixed.action_code",
19469       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &unprotected_wnm_action_codes_ext, 0,
19470       "Management action code", HFILL }},
19471
19472     {&hf_ieee80211_ff_key_data,
19473      {"Key Data", "wlan_mgt.fixed.key_data",
19474       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
19475
19476     {&hf_ieee80211_ff_key_data_length,
19477      {"Key Data Length", "wlan_mgt.fixed.key_data_length",
19478       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
19479
19480     {&hf_ieee80211_ff_wnm_notification_type,
19481      {"WNM-Notification type", "wlan_mgt.fixed.wnm_notification_type",
19482       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_notification_types_ext, 0,
19483       NULL, HFILL }},
19484
19485     {&hf_ieee80211_ff_rm_action_code,
19486      {"Action code", "wlan_mgt.rm.action_code",
19487       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &rm_action_codes_ext, 0,
19488       "Radio Measurement Action", HFILL }},
19489
19490     {&hf_ieee80211_ff_rm_dialog_token,
19491      {"Dialog token", "wlan_mgt.rm.dialog_token",
19492       FT_UINT8, BASE_DEC, NULL, 0,
19493       "Non-zero Dialog Token identifies request/report transaction", HFILL }},
19494
19495     {&hf_ieee80211_ff_rm_repetitions,
19496      {"Repetitions", "wlan_mgt.rm.repetitions",
19497       FT_UINT16, BASE_DEC, NULL, 0,
19498       "Numer of Repetitions, 65535 indicates repeat until cancellation", HFILL }},
19499
19500     {&hf_ieee80211_ff_rm_tx_power,
19501      {"Transmit Power Used", "wlan_mgt.rm.tx_power",
19502       FT_INT8, BASE_DEC, NULL, 0,
19503       NULL, HFILL }},
19504
19505     {&hf_ieee80211_ff_rm_max_tx_power,
19506      {"Max Transmit Power", "wlan_mgt.rm.max_tx_power",
19507       FT_INT8, BASE_DEC, NULL, 0,
19508       NULL, HFILL }},
19509
19510     {&hf_ieee80211_ff_tpc,
19511      {"TPC Report", "wlan_mgt.rm.tpc",
19512       FT_NONE, BASE_NONE, NULL, 0,
19513       NULL, HFILL }},
19514
19515     {&hf_ieee80211_ff_tpc_element_id,
19516      {"TPC Element ID", "wlan_mgt.rm.tpc.element_id",
19517       FT_UINT8, BASE_DEC, NULL, 0,
19518       NULL, HFILL }},
19519
19520     {&hf_ieee80211_ff_tpc_length,
19521      {"TPC Length", "wlan_mgt.rm.tpc.length",
19522       FT_UINT8, BASE_DEC, NULL, 0,
19523       "Length of TPC Report element (always 2)", HFILL }},
19524
19525     {&hf_ieee80211_ff_tpc_tx_power,
19526      {"TPC Transmit Power", "wlan_mgt.rm.tpc.tx_power",
19527       FT_INT8, BASE_DEC, NULL, 0,
19528       NULL, HFILL }},
19529
19530     {&hf_ieee80211_ff_tpc_link_margin,
19531      {"TPC Link Margin", "wlan_mgt.rm.tpc.link_margin",
19532       FT_INT8, BASE_DEC, NULL, 0,
19533       NULL, HFILL }},
19534
19535     {&hf_ieee80211_ff_rm_rx_antenna_id,
19536      {"Receive Antenna ID", "wlan_mgt.rm.rx_antenna_id",
19537       FT_UINT8, BASE_DEC, NULL, 0,
19538       NULL, HFILL }},
19539
19540     {&hf_ieee80211_ff_rm_tx_antenna_id,
19541      {"Transmit Antenna ID", "wlan_mgt.rm.tx_antenna_id",
19542       FT_UINT8, BASE_DEC, NULL, 0,
19543       NULL, HFILL }},
19544
19545     {&hf_ieee80211_ff_rm_rcpi,
19546      {"Received Channel Power", "wlan_mgt.rm.rcpi",
19547       FT_UINT8, BASE_DEC, NULL, 0,
19548       NULL, HFILL }},
19549
19550     {&hf_ieee80211_ff_rm_rsni,
19551      {"Received Signal to noise indication", "wlan_mgt.rm.rsni",
19552       FT_UINT8, BASE_DEC, NULL, 0,
19553       NULL, HFILL }},
19554
19555     {&hf_ieee80211_ff_request_mode_pref_cand,
19556      {"Preferred Candidate List Included","wlan_mgt.fixed.request_mode.pref_cand",
19557       FT_UINT8, BASE_DEC, NULL, 0x01,
19558       NULL, HFILL }},
19559
19560     {&hf_ieee80211_ff_request_mode_abridged,
19561      {"Abridged", "wlan_mgt.fixed.request_mode.abridged",
19562       FT_UINT8, BASE_DEC, NULL, 0x02,
19563       NULL, HFILL }},
19564
19565     {&hf_ieee80211_ff_request_mode_disassoc_imminent,
19566      {"Disassociation Imminent", "wlan_mgt.fixed.request_mode.disassoc_imminent",
19567       FT_UINT8, BASE_DEC, NULL, 0x04,
19568       NULL, HFILL }},
19569
19570     {&hf_ieee80211_ff_request_mode_bss_term_included,
19571      {"BSS Termination Included", "wlan_mgt.fixed.request_mode.bss_term_included",
19572       FT_UINT8, BASE_DEC, NULL, 0x08,
19573       NULL, HFILL }},
19574
19575     {&hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
19576      {"ESS Disassociation Imminent", "wlan_mgt.fixed.request_mode.ess_disassoc_imminent",
19577       FT_UINT8, BASE_DEC, NULL, 0x10,
19578       NULL, HFILL }},
19579
19580     {&hf_ieee80211_ff_disassoc_timer,
19581      {"Disassociation Timer", "wlan_mgt.fixed.disassoc_timer",
19582       FT_UINT16, BASE_DEC, NULL, 0,
19583       NULL, HFILL }},
19584
19585     {&hf_ieee80211_ff_validity_interval,
19586      {"Validity Interval", "wlan_mgt.fixed.validity_interval",
19587       FT_UINT8, BASE_DEC, NULL, 0,
19588       NULL, HFILL }},
19589
19590     {&hf_ieee80211_ff_bss_termination_duration,
19591      {"BSS Termination Duration", "wlan_mgt.fixed.bss_termination_duration",
19592       FT_BYTES, BASE_NONE, NULL, 0,
19593       NULL, HFILL }},
19594
19595     {&hf_ieee80211_ff_url_len,
19596      {"Session Information URL Length",
19597       "wlan_mgt.fixed.session_information.url_length",
19598       FT_UINT8, BASE_DEC, NULL, 0,
19599       NULL, HFILL }},
19600
19601     {&hf_ieee80211_ff_url,
19602      {"Session Information URL", "wlan_mgt.fixed.session_information.url",
19603       FT_STRING, BASE_NONE, NULL, 0,
19604       NULL, HFILL }},
19605
19606     {&hf_ieee80211_ff_bss_transition_candidate_list_entries,
19607      {"BSS Transition Candidate List Entries", "wlan_mgt.fixed.bss_transition_candidate_list_entries",
19608       FT_BYTES, BASE_NONE, NULL, 0,
19609       NULL, HFILL }},
19610
19611 /* 802.11ad */
19612     {&hf_ieee80211_cf_response_offset,
19613      {"Response Offset", "wlan.res_offset",
19614       FT_UINT16, BASE_DEC, NULL, 0,
19615       NULL, HFILL }},
19616
19617     {&hf_ieee80211_ff_dynamic_allocation,
19618      {"Response Offset", "wlan.dynamic_allocation",
19619       FT_UINT64, BASE_HEX, NULL, 0,
19620       NULL, HFILL }},
19621
19622     {&hf_ieee80211_ff_TID,
19623      {"Response Offset", "wlan.dynamic_allocation.TID",
19624       FT_UINT8, BASE_DEC, NULL, 0x0f,
19625       NULL, HFILL }},
19626
19627     {&hf_ieee80211_ff_alloc_type,
19628      {"Response Offset", "wlan.dynamic_allocation.alloc_type",
19629       FT_UINT8, BASE_DEC, NULL, 0x70,
19630       NULL, HFILL }},
19631
19632     {&hf_ieee80211_ff_src_aid,
19633      {"Response Offset", "wlan.dynamic_allocation.src_aid",
19634       FT_UINT16, BASE_DEC, NULL, 0x7f80,
19635       NULL, HFILL }},
19636
19637     {&hf_ieee80211_ff_dest_aid,
19638      {"Response Offset", "wlan.dynamic_allocation.dest_aid",
19639       FT_UINT16, BASE_DEC, NULL, 0x7f80,
19640       NULL, HFILL }},
19641
19642     {&hf_ieee80211_ff_alloc_duration,
19643      {"Response Offset", "wlan.dynamic_allocation.alloc_duration",
19644       FT_UINT32, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0x7fff80,
19645       NULL, HFILL }},
19646
19647     {&hf_ieee80211_ff_ssw,
19648      {"Sector Sweep", "wlan.ssw",
19649       FT_UINT24, BASE_HEX, NULL, 0,
19650       NULL, HFILL }},
19651
19652     {&hf_ieee80211_ff_ssw_direction,
19653      {"Sector Sweep Direction", "wlan.ssw.direction",
19654       FT_BOOLEAN, 24, TFS(&ieee80211_cf_ssw_direction), 0x000001,
19655       NULL, HFILL}},
19656
19657     {&hf_ieee80211_ff_ssw_cdown,
19658      {"Sector Sweep CDOWN", "wlan.ssw.cdown",
19659       FT_UINT24, BASE_DEC, NULL, 0x0003fe,
19660       NULL, HFILL }},
19661
19662     {&hf_ieee80211_ff_ssw_sector_id,
19663      {"Sector Sweep Sector ID", "wlan.ssw.sector_id",
19664       FT_UINT24, BASE_DEC, NULL, 0x00fc00,
19665       NULL, HFILL }},
19666
19667     {&hf_ieee80211_ff_ssw_dmg_ant_id,
19668      {"Sector Sweep DMG Antenna ID", "wlan.ssw.dmg_ant_id",
19669       FT_UINT24, BASE_DEC, NULL, 0x030000,
19670       NULL, HFILL }},
19671
19672     {&hf_ieee80211_ff_ssw_rxss_len,
19673      {"Sector Sweep RXSS Length", "wlan.ssw.rxss_len",
19674       FT_UINT24, BASE_DEC, NULL, 0xfc0000,
19675       NULL, HFILL }},
19676
19677     {&hf_ieee80211_ff_bf,
19678      {"Beam Forming", "wlan.bf",
19679       FT_UINT16, BASE_HEX, NULL, 0,
19680       NULL, HFILL }},
19681
19682     {&hf_ieee80211_ff_bf_train,
19683      {"Beam Forming Training", "wlan.bf.train",
19684       FT_BOOLEAN, 8, NULL, 0x01,
19685       NULL, HFILL }},
19686
19687     {&hf_ieee80211_ff_bf_is_init,
19688      {"Beam Forming Is InitiatorTXSS", "wlan.bf.isInit",
19689       FT_BOOLEAN, 8, NULL, 0x02,
19690       NULL, HFILL }},
19691
19692     {&hf_ieee80211_ff_bf_is_resp,
19693      {"Beam Forming Is ResponderTXSS", "wlan.bf.isResp",
19694       FT_BOOLEAN, 8, NULL, 0x4,
19695       NULL, HFILL }},
19696
19697     {&hf_ieee80211_ff_bf_rxss_len,
19698      {"Beam Forming RXSS Length", "wlan.bf.rxss_len",
19699       FT_UINT16, BASE_DEC, NULL, 0x1f8,
19700       NULL, HFILL }},
19701
19702     {&hf_ieee80211_ff_bf_rxss_rate,
19703      {"Beam Forming RXSS Rate", "wlan.bf.rxss_rate",
19704       FT_BOOLEAN, 16, NULL, 0x200,
19705       NULL, HFILL }},
19706
19707     {&hf_ieee80211_ff_bf_num_sectors,
19708      {"Beam Forming Total Number of Sectors", "wlan.bf.num_sectors",
19709       FT_UINT16, BASE_DEC, NULL, 0x3f8,
19710       NULL, HFILL }},
19711
19712     {&hf_ieee80211_ff_bf_num_rx_dmg_ants,
19713      {"Beam Forming Number of DMG Antennas", "wlan.bf.num_dmg_ants",
19714       FT_UINT16, BASE_DEC, NULL, 0xc00,
19715       NULL, HFILL }},
19716
19717     {&hf_ieee80211_addr_nav_da,
19718      {"Destination address of STA that caused NAV update", "wlan.nav_da",
19719       FT_ETHER, BASE_NONE, NULL, 0,
19720       "DMG Destination Hardware Address", HFILL }},
19721
19722     {&hf_ieee80211_addr_nav_sa,
19723      {"Source address of STA that caused NAV update", "wlan.nav_sa",
19724       FT_ETHER, BASE_NONE, NULL, 0,
19725       "DMG Source Hardware Address", HFILL }},
19726
19727     {&hf_ieee80211_ff_sswf,
19728      {"Sector Sweep Feedback", "wlan.sswf",
19729       FT_UINT24, BASE_HEX, NULL, 0,
19730       NULL, HFILL }},
19731
19732     {&hf_ieee80211_ff_sswf_total_sectors,
19733      {"Sector Sweep Feedback total number of sectors", "wlan.sswf.num_sectors",
19734       FT_UINT24, BASE_DEC, NULL, 0x0001ff,
19735       NULL, HFILL }},
19736
19737     {&hf_ieee80211_ff_sswf_num_rx_dmg_ants,
19738      {"Sector Sweep Feedback Number of receive DMG Antennas", "wlan.sswf.num_dmg_ants",
19739       FT_UINT24, BASE_DEC, NULL, 0x000600,
19740       NULL, HFILL }},
19741
19742     {&hf_ieee80211_ff_sswf_poll_required,
19743      {"Sector Sweep Feedback Poll required", "wlan.sswf.poll",
19744       FT_BOOLEAN, 24, NULL, 0x010000,
19745       NULL, HFILL }},
19746
19747     {&hf_ieee80211_ff_brp,
19748      {"BRP Request", "wlan.brp",
19749       FT_UINT32, BASE_HEX, NULL, 0,
19750       NULL, HFILL }},
19751
19752     {&hf_ieee80211_ff_brp_L_RX,
19753      {"BRP Request L-RX", "wlan.brp.l_rx",
19754       FT_UINT32, BASE_DEC, NULL, 0x0000001f,
19755       NULL, HFILL }},
19756
19757     {&hf_ieee80211_ff_brp_TX_TRN_REQ,
19758      {"BRP Request TX-TRN-REQ", "wlan.brp.tx_trn_req",
19759       FT_BOOLEAN, 32, NULL, 0x00000020,
19760       NULL, HFILL }},
19761
19762     {&hf_ieee80211_ff_brp_MID_REQ,
19763      {"BRP Request MID-REQ", "wlan.brp.mid_req",
19764       FT_BOOLEAN, 32, NULL, 0x00000040,
19765       NULL, HFILL }},
19766
19767     {&hf_ieee80211_ff_brp_BC_REQ,
19768      {"BRP Request BC-REQ", "wlan.brp.bc_req",
19769       FT_BOOLEAN, 32, NULL, 0x00000080,
19770       NULL, HFILL }},
19771
19772     {&hf_ieee80211_ff_brp_MID_GRANT,
19773      {"BRP Request MID-GRANT", "wlan.brp.mid_grant",
19774       FT_BOOLEAN, 32, NULL, 0x00000100,
19775       NULL, HFILL }},
19776
19777     {&hf_ieee80211_ff_brp_BC_GRANT,
19778      {"BRP Request BC-GRANT", "wlan.brp.bc_grant",
19779       FT_BOOLEAN, 32, NULL, 0x00000200,
19780       NULL, HFILL }},
19781
19782     {&hf_ieee80211_ff_brp_chan_FBCK_CAP,
19783      {"BRP Request Chan FBCK-CAP", "wlan.brp.chan_fbck_cap",
19784       FT_BOOLEAN, 32, NULL, 0x00000400,
19785       NULL, HFILL }},
19786
19787     {&hf_ieee80211_ff_brp_tx_sector,
19788      {"BRP Request TX Sector ID", "wlan.brp.tx_sector_id",
19789       FT_UINT32, BASE_DEC, NULL, 0x0001f800,
19790       NULL, HFILL }},
19791
19792     {&hf_ieee80211_ff_brp_other_aid,
19793      {"BRP Request Other AID", "wlan.brp.other_aid",
19794       FT_UINT32, BASE_DEC, NULL, 0x01fe0000,
19795       NULL, HFILL }},
19796
19797     {&hf_ieee80211_ff_brp_tx_antenna,
19798      {"BRP Request TX Antenna ID", "wlan.brp.tx_antenna_id",
19799       FT_UINT32, BASE_DEC, NULL, 0x0600000,
19800       NULL, HFILL }},
19801
19802     {&hf_ieee80211_ff_blm,
19803      {"Beamformed Link Maintenance", "wlan.blm",
19804       FT_UINT8, BASE_HEX, NULL, 0,
19805       NULL, HFILL }},
19806
19807     {&hf_ieee80211_ff_blm_unit_index,
19808      {"BeamLink Maintenance Uint Index", "wlan.blm.uint_index",
19809       FT_BOOLEAN, 8, NULL, 0x01,
19810       NULL, HFILL }},
19811
19812     {&hf_ieee80211_ff_blm_maint_value,
19813      {"BeamLink Maintenance Value", "wlan.blm.value",
19814       FT_UINT8, BASE_DEC, NULL, 0x7e,
19815       NULL, HFILL }},
19816
19817     {&hf_ieee80211_ff_blm_is_master,
19818      {"BeamLink Is Master", "wlan.blm.is_master",
19819       FT_BOOLEAN, 8, NULL, 0x80,
19820       NULL, HFILL }},
19821
19822     {&hf_ieee80211_ff_bic,
19823      {"Beacon Interval Control", "wlan.bic",
19824       FT_UINT48, BASE_HEX, NULL, 0,
19825       NULL, HFILL }},
19826
19827     {&hf_ieee80211_ff_bic_cc_present,
19828      {"Clustering Control Present", "wlan.bic.cc",
19829       FT_BOOLEAN, 8, NULL, 0x01,
19830       NULL, HFILL }},
19831
19832     {&hf_ieee80211_ff_bic_discovery_mode,
19833      {"Discovery Mode", "wlan.bic.discovery_mode",
19834       FT_BOOLEAN, 8, NULL, 0x02,
19835       NULL, HFILL }},
19836
19837     {&hf_ieee80211_ff_bic_next_beacon,
19838      {"Next Beacon", "wlan.bic.next_beacon",
19839       FT_UINT8, BASE_DEC, NULL, 0x3c,
19840       NULL, HFILL }},
19841
19842     {&hf_ieee80211_ff_bic_ati_present,
19843      {"ATI Present", "wlan.bic.ati",
19844       FT_BOOLEAN, 8, NULL, 0x40,
19845       NULL, HFILL }},
19846
19847     {&hf_ieee80211_ff_bic_abft_len,
19848      {"A-BFT length", "wlan.bic.abft_len",
19849       FT_UINT16, BASE_DEC, NULL, 0x0380,
19850       NULL, HFILL }},
19851
19852     {&hf_ieee80211_ff_bic_fss,
19853      {"FSS", "wlan.bic.fss",
19854       FT_UINT8, BASE_DEC, NULL, 0x3c,
19855       NULL, HFILL }},
19856
19857     {&hf_ieee80211_ff_bic_is_resp,
19858      {"Is TXSS Responder", "wlan.bic.is_responder",
19859       FT_BOOLEAN, 8, NULL, 0x40,
19860       NULL, HFILL }},
19861
19862     {&hf_ieee80211_ff_bic_next_abft,
19863      {"Next A-BFT", "wlan.bic.next_abft",
19864       FT_UINT16, BASE_DEC, NULL, 0x0780,
19865       NULL, HFILL }},
19866
19867     {&hf_ieee80211_ff_bic_frag_txss,
19868      {"Fragmented TXSS", "wlan.bic.frag_txss",
19869       FT_BOOLEAN, 8, NULL, 0x08,
19870       NULL, HFILL }},
19871
19872     {&hf_ieee80211_ff_bic_txss_span,
19873      {"TXSS span", "wlan.bic.txss_span",
19874       FT_UINT16, BASE_DEC, NULL, 0x07f0,
19875       NULL, HFILL }},
19876
19877     {&hf_ieee80211_ff_bic_NBI_abft,
19878      {"Number of Beacon Intervals that are needed to allocate A-BFT", "wlan.bic.NBI_abft",
19879       FT_UINT8, BASE_DEC, NULL, 0x78,
19880       NULL, HFILL }},
19881
19882     {&hf_ieee80211_ff_bic_abft_count,
19883      {"A-BFT Count", "wlan.bic.abft_count",
19884       FT_UINT16, BASE_DEC, NULL, 0x1f80,
19885       NULL, HFILL }},
19886
19887     {&hf_ieee80211_ff_bic_nabft,
19888      {"Number of A-BFT's received from each Antenna", "wlan.bic.nabft",
19889       FT_UINT16, BASE_DEC, NULL, 0x07e0,
19890       NULL, HFILL }},
19891
19892     {&hf_ieee80211_ff_bic_pcp,
19893      {"PCP Association Ready", "wlan.bic.pcp",
19894       FT_BOOLEAN, 8, NULL, 0x08,
19895       NULL, HFILL }},
19896
19897     {&hf_ieee80211_ff_dmg_params,
19898      {"DMG Parameters", "wlan.dmg_params",
19899       FT_UINT8, BASE_HEX , NULL, 0,
19900       NULL, HFILL }},
19901
19902     {&hf_ieee80211_ff_dmg_params_bss,
19903      {"BSS Type", "wlan.dmg_params.bss",
19904       FT_UINT8, BASE_DEC, VALS(bss_type), 0x03,
19905       NULL, HFILL }},
19906
19907     {&hf_ieee80211_ff_dmg_params_cbap_only,
19908      {"CBAP Only", "wlan.dmp_params.cbap_only",
19909       FT_BOOLEAN, 8, NULL, 0x04,
19910       NULL, HFILL }},
19911
19912     {&hf_ieee80211_ff_dmg_params_cbap_src,
19913      {"CBAP Source", "wlan.dmp_params.cbap_src",
19914       FT_BOOLEAN, 8, NULL, 0x08,
19915       NULL, HFILL }},
19916
19917     {&hf_ieee80211_ff_dmg_params_privacy,
19918      {"DMG Privacy", "wlan.dmp_params.privacy",
19919       FT_BOOLEAN, 8, NULL, 0x10,
19920       NULL, HFILL }},
19921
19922     {&hf_ieee80211_ff_dmg_params_policy,
19923      {"ECPAC Policy Enforced", "wlan.dmp_params.policy",
19924       FT_BOOLEAN, 8, NULL, 0x20,
19925       NULL, HFILL }},
19926
19927     {&hf_ieee80211_ff_cc,
19928      {"Clustering Control", "wlan.cc",
19929       FT_UINT64, BASE_HEX , NULL, 0,
19930       NULL, HFILL }},
19931
19932     {&hf_ieee80211_ff_cc_abft_resp_addr,
19933      {"A-BFT Responder Address", "wlan.cc.abft_resp_addr",
19934       FT_ETHER, BASE_NONE , NULL, 0,
19935       NULL, HFILL }},
19936
19937     {&hf_ieee80211_ff_cc_sp_duration,
19938      {"Beacon SP Duration", "wlan.cc.sp_duration",
19939       FT_UINT8, BASE_DEC , NULL, 0,
19940       NULL, HFILL }},
19941
19942     {&hf_ieee80211_ff_cc_cluster_id,
19943      {"Cluster ID", "wlan.cc.cluster_id",
19944       FT_UINT64, BASE_DEC , NULL, 0,
19945       NULL, HFILL }},
19946
19947     {&hf_ieee80211_ff_cc_role,
19948      {"Cluster Member Role", "wlan.cc.rold",
19949       FT_UINT8, BASE_DEC , NULL, 0,
19950       NULL, HFILL }},
19951
19952     {&hf_ieee80211_ff_cc_max_mem,
19953      {"Cluster MaxMem", "wlan.cc.max_mem",
19954       FT_UINT8, BASE_DEC , NULL, 0,
19955       NULL, HFILL }},
19956
19957     {&hf_ieee80211_tag_relay_support,
19958      {"Relay Supportability", "wlan.relay_capabilities.relay_support",
19959       FT_BOOLEAN, 8, NULL, 0x01,
19960       NULL, HFILL }},
19961
19962     {&hf_ieee80211_tag_relay_use,
19963      {"Relay Usability", "wlan.relay_capabilities.relay_use",
19964       FT_BOOLEAN, 8, NULL, 0x02,
19965       NULL, HFILL }},
19966
19967     {&hf_ieee80211_tag_relay_permission,
19968      {"Relay Permission", "wlan.relay_capabilities.relay_permission",
19969       FT_BOOLEAN, 8, NULL, 0x04,
19970       NULL, HFILL }},
19971
19972     {&hf_ieee80211_tag_AC_power,
19973      {"A/C Power", "wlan.relay_capabilities.AC_power",
19974       FT_BOOLEAN, 8, NULL, 0x08,
19975       NULL, HFILL }},
19976
19977     {&hf_ieee80211_tag_relay_prefer,
19978      {"Relay Preference", "wlan.relay_capabilities.relay_prefer",
19979       FT_BOOLEAN, 8, NULL, 0x10,
19980       NULL, HFILL }},
19981
19982     {&hf_ieee80211_tag_duplex,
19983      {"Duplex", "wlan.relay_capabilities.duplex",
19984       FT_UINT8, BASE_DEC, NULL, 0x60,
19985       NULL, HFILL }},
19986
19987     {&hf_ieee80211_tag_cooperation,
19988      {"Cooperation", "wlan.relay_capabilities.cooperation",
19989       FT_BOOLEAN, 8, NULL, 0x80,
19990       NULL, HFILL }},
19991
19992     {&hf_ieee80211_ff_rcsi,
19993      {"Relay Capable STA Info", "wlan.rcsi",
19994       FT_UINT24, BASE_HEX, NULL, 0,
19995       NULL, HFILL }},
19996
19997     {&hf_ieee80211_ff_rcsi_aid,
19998      {"AID", "wlan.rcsi.aid",
19999       FT_UINT8, BASE_DEC, NULL, 0xff,
20000       NULL, HFILL }},
20001
20002     {&hf_ieee80211_ff_band_id,
20003      {"Band ID", "wlan.band_id",
20004       FT_UINT8, BASE_DEC, VALS(band_id), 0xff,
20005       NULL, HFILL }},
20006
20007     {&hf_ieee80211_tag_move,
20008      {"Move", "wlan.dmg_bss_param_change.move",
20009       FT_BOOLEAN, 8, NULL, 0x01,
20010       NULL, HFILL }},
20011
20012     {&hf_ieee80211_tag_size,
20013      {"Size", "wlan.dmg_bss_param_change.size",
20014       FT_BOOLEAN, 8, NULL, 0x02,
20015       NULL, HFILL }},
20016
20017     {&hf_ieee80211_tag_tbtt_offset,
20018      {"TBTT Offset", "wlan.dmg_bss_param_change.tbtt_offset",
20019       FT_UINT32, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xffffffff,
20020       NULL, HFILL }},
20021
20022     {&hf_ieee80211_tag_bi_duration,
20023      {"BI Duration", "wlan.dmg_bss_param_change.bi_duration",
20024       FT_UINT16, BASE_DEC, NULL, 0xffff,
20025       NULL, HFILL }},
20026
20027     {&hf_ieee80211_tag_dmg_capa_sta_addr,
20028      {"STA Address", "wlan.dmg_capa.sta_addr",
20029       FT_ETHER, BASE_NONE, NULL, 0,
20030       "STA_Address", HFILL }},
20031
20032     {&hf_ieee80211_tag_dmg_capa_aid,
20033      {"AID", "wlan.dmg_capa.aid",
20034       FT_UINT16, BASE_DEC, NULL, 0,
20035       NULL, HFILL }},
20036 /* 8.4.2.127.2 DMG STA Capability Information field */
20037     {&hf_ieee80211_tag_reverse_direction, /* DMG STA capa, bits [0] */
20038      {"Reverse Direction", "wlan.dmg_capa.reverse_direction",
20039       FT_BOOLEAN, 24, NULL, GENMASK(0, 0),
20040       NULL, HFILL }},
20041
20042     {&hf_ieee80211_tag_hlts, /* DMG STA capa, bits [1] */
20043      {"Higher Layer Timer Synchronization", "wlan.dmg_capa.htls",
20044       FT_BOOLEAN, 24, NULL, GENMASK(1, 1),
20045       NULL, HFILL }},
20046
20047     {&hf_ieee80211_tag_tpc, /* DMG STA capa, bits [2] */
20048      {"TPC", "wlan.dmg_capa.tpc",
20049       FT_BOOLEAN, 24, NULL, GENMASK(2, 2),
20050       NULL, HFILL }},
20051
20052     {&hf_ieee80211_tag_spsh, /* DMG STA capa, bits [3] */
20053      {"SPSH and Interference Mitigation", "wlan.dmg_capa.spsh",
20054       FT_BOOLEAN, 24, NULL, GENMASK(3, 3),
20055       NULL, HFILL }},
20056
20057     {&hf_ieee80211_tag_rx_antenna, /* DMG STA capa, bits [4..5] */
20058      {"Number of RX DMG Antennas", "wlan.dmg_capa.num_rx",
20059       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(5, 4),
20060       NULL, HFILL }},
20061
20062     {&hf_ieee80211_tag_fast_link, /* DMG STA capa, bits [6] */
20063      {"Fast Link Adaptation", "wlan.dmg_capa.fast_link",
20064       FT_BOOLEAN, 24, NULL, GENMASK(6, 6),
20065       NULL, HFILL }},
20066
20067     {&hf_ieee80211_tag_num_sectors, /* DMG STA capa, bits [7..13] */
20068      {"Total Number of Sectors", "wlan.dmg_capa.num_sectors",
20069       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_base_custom), GENMASK(13, 7),
20070       NULL, HFILL }},
20071
20072     {&hf_ieee80211_tag_rxss_length, /* DMG STA capa, bits [14..19] */
20073      {"RXSS Length", "wlan.dmg_capa.rxss_len",
20074       FT_UINT24, BASE_CUSTOM, CF_FUNC(extra_one_mul_two_base_custom), GENMASK(19, 14),
20075       NULL, HFILL }},
20076
20077     {&hf_ieee80211_tag_reciprocity, /* DMG STA capa, bits [20] */
20078      {"DMG Antenna Reciprocity", "wlan.dmg_capa.reciprocity",
20079       FT_BOOLEAN, 24, NULL, GENMASK(20, 20),
20080       NULL, HFILL }},
20081 /* DMG STA capa, A-MPDU params, bits [21..26] */
20082     {&hf_ieee80211_tag_max_ampdu_exp, /* DMG STA capa, bits [21..23] */
20083      {"Maximum A-MPDU Length Exponent", "wlan.dmg_capa.max_ampdu_exp",
20084       FT_UINT24, BASE_DEC, NULL, GENMASK(23, 21),
20085       NULL, HFILL }},
20086
20087     {&hf_ieee80211_tag_min_mpdu_sapcing, /* DMG STA capa, bits [24..26] */
20088      {"Minimum MPDU Start Spacing", "wlan.dmg_capa.min_mpdu_spacing",
20089       FT_UINT24, BASE_DEC, NULL, GENMASK(26-24, 24-24),
20090       NULL, HFILL }},
20091
20092     {&hf_ieee80211_tag_ba_flow_control , /* DMG STA capa, bits [27] */
20093      {"BA with Flow Control", "wlan.dmg_capa.bs_flow_ctrl",
20094       FT_BOOLEAN, 24, NULL, GENMASK(27-24, 27-24),
20095       NULL, HFILL }},
20096 /* DMG STA capa, supported MCS set, bits [28..51] */
20097     {&hf_ieee80211_tag_max_sc_rx_mcs, /* DMG STA capa, bits [28..32] */
20098      {"Maximum SC Rx MCS", "wlan.dmg_capa.max_sc_rx_mcs",
20099       FT_UINT24, BASE_DEC, NULL, GENMASK(32-24, 28-24),
20100       NULL, HFILL }},
20101
20102     {&hf_ieee80211_tag_max_ofdm_rx_mcs, /* DMG STA capa, bits [33..37] */
20103      {"Maximum OFDM Rx MCS", "wlan.dmg_capa.max_ofdm_rx_mcs",
20104       FT_UINT24, BASE_DEC, NULL, GENMASK(37-24, 33-24),
20105       NULL, HFILL }},
20106
20107     {&hf_ieee80211_tag_max_sc_tx_mcs, /* DMG STA capa, bits [38..42] */
20108      {"Maximum SC Tx MCS", "wlan.dmg_capa.max_sc_tx_mcs",
20109       FT_UINT24, BASE_DEC, NULL, GENMASK(42-24, 38-24),
20110       NULL, HFILL }},
20111
20112     {&hf_ieee80211_tag_max_ofdm_tx_mcs, /* DMG STA capa, bits [43..47] */
20113      {"Maximum OFDM Tx MCS", "wlan.dmg_capa.max_ofdm_tx_mcs",
20114       FT_UINT24, BASE_DEC, NULL, GENMASK(47-24, 43-24),
20115       NULL, HFILL }},
20116
20117     {&hf_ieee80211_tag_low_power_supported, /* DMG STA capa, bits [48] */
20118      {"Low Power SC PHY Supported", "wlan.dmg_capa.low_power_suuported",
20119       FT_BOOLEAN, 16, NULL, GENMASK(48-48, 48-48),
20120       NULL, HFILL }},
20121
20122     {&hf_ieee80211_tag_code_rate, /* DMG STA capa, bits [49] */
20123      {"Code Rate 13/16", "wlan.dmg_capa.code_rate",
20124       FT_BOOLEAN, 16, NULL, GENMASK(49-48, 49-48),
20125       NULL, HFILL }},
20126
20127     {&hf_ieee80211_tag_dtp, /* DMG STA capa, bits [52] */
20128      {"DTP Supported", "wlan.dmg_capa.dtp",
20129       FT_BOOLEAN, 16, NULL, GENMASK(52-48, 52-48),
20130       NULL, HFILL }},
20131
20132     {&hf_ieee80211_tag_appdu_supp, /* DMG STA capa, bits [53] */
20133      {"A-PPDU Supported", "wlan.dmg_capa.appdu_supp",
20134       FT_BOOLEAN, 16, NULL, GENMASK(53-48, 53-48),
20135       NULL, HFILL }},
20136
20137     {&hf_ieee80211_tag_heartbeat, /* DMG STA capa, bits [54] */
20138      {"HeartBeat", "wlan.dmg_capa.heartbeat",
20139       FT_BOOLEAN, 16, NULL, GENMASK(54-48, 54-48),
20140       NULL, HFILL }},
20141
20142     {&hf_ieee80211_tag_other_aid, /* DMG STA capa, bits [55] */
20143      {"Supports Other_AID", "wlan.dmg_capa.other_aid",
20144       FT_BOOLEAN, 16, NULL, GENMASK(55-48, 55-48),
20145       NULL, HFILL }},
20146
20147     {&hf_ieee80211_tag_pattern_recip, /* DMG STA capa, bits [56] */
20148      {"Antenna Pattern Reciprocity", "wlan.dmg_capa.pattern_recip",
20149       FT_BOOLEAN, 16, NULL, GENMASK(56-48, 56-48),
20150       NULL, HFILL }},
20151
20152     {&hf_ieee80211_tag_heartbeat_elapsed, /* DMG STA capa, bits [57..59] */
20153      {"Heartbeat Elapsed Indication", "wlan.dmg_capa.heartbeat_elapsed",
20154       FT_UINT16, BASE_DEC, NULL, GENMASK(59-48, 57-48),
20155       NULL, HFILL }},
20156
20157     {&hf_ieee80211_tag_grant_ack_supp, /* DMG STA capa, bits [60] */
20158      {"Grant ACK Supported", "wlan.dmg_capa.grant_ack_supp",
20159       FT_BOOLEAN, 16, NULL, GENMASK(60-48, 60-48),
20160       NULL, HFILL }},
20161
20162     {&hf_ieee80211_tag_RXSSTxRate_supp, /* DMG STA capa, bits [61] */
20163      {"RXSSTxRate Supported", "wlan.dmg_capa.RXSSTxRate",
20164       FT_BOOLEAN, 16, NULL, GENMASK(61-48, 61-48),
20165       NULL, HFILL }},
20166 /* 8.4.2.127.3 DMG PCP/AP Capability Information field */
20167     {&hf_ieee80211_tag_pcp_tddti, /* DMG PCP/AP capa, bits [0] */
20168      {"TDDTI", "wlan.dmg_capa.pcp_tdtti",
20169       FT_BOOLEAN, 16, NULL, GENMASK(0, 0),
20170       NULL, HFILL }},
20171
20172     {&hf_ieee80211_tag_pcp_PSA, /* DMG PCP/AP capa, bits [1] */
20173      {"Pseudo-static Allocations", "wlan.dmg_capa.pcp_psa",
20174       FT_BOOLEAN, 16, NULL, GENMASK(1, 1),
20175       NULL, HFILL }},
20176
20177     {&hf_ieee80211_tag_pcp_handover, /* DMG PCP/AP capa, bits [2] */
20178      {"PDP Handover", "wlan.dmg_capa.pcp_handover",
20179       FT_BOOLEAN, 16, NULL, GENMASK(2, 2),
20180       NULL, HFILL }},
20181
20182     {&hf_ieee80211_tag_pcp_max_assoc, /* DMG PCP/AP capa, bits [3..10] */
20183      {"Max Associated STA Number", "wlan.dmg_capa.pcp_max_assoc",
20184       FT_UINT16, BASE_DEC, NULL, GENMASK(10, 3),
20185       NULL, HFILL }},
20186
20187     {&hf_ieee80211_tag_pcp_power_src, /* DMG PCP/AP capa, bits [11] */
20188      {"Power Source", "wlan.dmg_capa.pcp_power_src",
20189       FT_BOOLEAN, 16, NULL, GENMASK(11, 11),
20190       NULL, HFILL }},
20191
20192     {&hf_ieee80211_tag_pcp_decenter, /* DMG PCP/AP capa, bits [12] */
20193      {"Decentralized PCP/AP Clustering", "wlan.dmg_capa.pcp_decenter",
20194       FT_BOOLEAN, 16, NULL, GENMASK(12, 12),
20195       NULL, HFILL }},
20196
20197     {&hf_ieee80211_tag_pcp_forwarding, /* DMG PCP/AP capa, bits [13] */
20198      {"PCP Forwarding", "wlan.dmg_capa.pcp_forwarding",
20199       FT_BOOLEAN, 16, NULL, GENMASK(13, 13),
20200       NULL, HFILL }},
20201
20202     {&hf_ieee80211_tag_pcp_center, /* DMG PCP/AP capa, bits [14] */
20203      {"Centralized PCP/AP Clustering", "wlan.dmg_capa.pcp_center",
20204       FT_BOOLEAN, 16, NULL, GENMASK(14, 14),
20205       NULL, HFILL }},
20206
20207     {&hf_ieee80211_tag_PSRSI,
20208      {"PS Request Suspension Interval", "wlan.dmg_oper.psrsi",
20209       FT_UINT8, BASE_DEC, NULL, 0,
20210       NULL, HFILL }},
20211
20212     {&hf_ieee80211_tag_min_BHI_duration,
20213      {"Min BHI Duration", "wlan.dmg_oper.min_BHI_duration",
20214       FT_UINT16, BASE_DEC, NULL, 0,
20215       NULL, HFILL }},
20216
20217     {&hf_ieee80211_tag_brdct_sta_info_dur,
20218      {"Broadcast STA Info Duration", "wlan.dmg_oper.brdcst_sta_info_dur",
20219       FT_UINT8, BASE_DEC, NULL, 0,
20220       NULL, HFILL }},
20221
20222     {&hf_ieee80211_tag_assoc_resp_confirm_time,
20223      {"Associated Response Confirm Time", "wlan.dmg_oper.assoc_resp_confirm_time",
20224       FT_UINT8, BASE_DEC, NULL, 0,
20225       NULL, HFILL }},
20226
20227     {&hf_ieee80211_tag_min_pp_duration,
20228      {"Min PP Duration", "wlan.dmg_oper.min_pp_duration",
20229       FT_UINT8, BASE_DEC, NULL, 0,
20230       NULL, HFILL }},
20231
20232     {&hf_ieee80211_tag_SP_idle_timeout,
20233      {"SP Idle Timeout", "wlan.dmg_oper.SP_idle_timeout",
20234       FT_UINT8, BASE_DEC, NULL, 0,
20235       NULL, HFILL }},
20236
20237     {&hf_ieee80211_tag_max_lost_beacons,
20238      {"Max Lost Beacons", "wlan.dmg_oper.max_lost_beacons",
20239       FT_UINT8, BASE_DEC, NULL, 0,
20240       NULL, HFILL }},
20241
20242     {&hf_ieee80211_tag_type,
20243      {"Type", "wlan.sctor_id.type",
20244       FT_UINT32, BASE_HEX, NULL, 0x0000000f,
20245       NULL, HFILL }},
20246
20247     {&hf_ieee80211_tag_tap1,
20248      {"Tap 1", "wlan.sctor_id.tap1",
20249       FT_UINT32, BASE_HEX, NULL, 0x000003f0,
20250       NULL, HFILL }},
20251
20252     {&hf_ieee80211_tag_state1,
20253      {"State 1", "wlan.sctor_id.state1",
20254       FT_UINT32, BASE_HEX, NULL, 0x0000fc00,
20255       NULL, HFILL }},
20256
20257     {&hf_ieee80211_tag_tap2,
20258      {"Tap 2", "wlan.sctor_id.tap2",
20259       FT_UINT32, BASE_HEX, NULL, 0x00ff0000,
20260       NULL, HFILL }},
20261
20262     {&hf_ieee80211_tag_state2,
20263      {"State 2", "wlan.sctor_id.state2",
20264       FT_UINT32, BASE_HEX, NULL, 0xff000000,
20265       NULL, HFILL }},
20266
20267     {&hf_ieee80211_tag_allocation_id,
20268      {"Allocation ID", "wlan.ext_sched.alloc_id",
20269       FT_UINT16, BASE_DEC, NULL, 0x000f,
20270       NULL, HFILL }},
20271
20272     {&hf_ieee80211_tag_allocation_type,
20273      {"Allocation Type", "wlan.ext_sched.alloc_type",
20274       FT_UINT16, BASE_DEC, VALS(allocation_type), 0x0070,
20275       NULL, HFILL }},
20276
20277     {&hf_ieee80211_tag_pseudo_static,
20278      {"Pseudo-static", "wlan.ext_sched.p_static",
20279       FT_BOOLEAN, 16, NULL, 0x0080,
20280       NULL, HFILL }},
20281
20282     {&hf_ieee80211_tag_truncatable,
20283      {"Truncatable", "wlan.ext_sched.truncatable",
20284       FT_BOOLEAN, 16, NULL, 0x0100,
20285       NULL, HFILL }},
20286
20287     {&hf_ieee80211_tag_extendable,
20288      {"Extenedable", "wlan.ext_sched.extendable",
20289       FT_BOOLEAN, 16, NULL, 0x0200,
20290       NULL, HFILL }},
20291
20292     {&hf_ieee80211_tag_pcp_active,
20293      {"PCP Active", "wlan.ext_sched.pcp_active",
20294       FT_BOOLEAN, 16, NULL, 0x0400,
20295       NULL, HFILL }},
20296
20297     {&hf_ieee80211_tag_lp_sc_used,
20298      {"LP SC Used", "wlan.ext_sched.lp_sc_used",
20299       FT_BOOLEAN, 16, NULL, 0x0800,
20300       NULL, HFILL }},
20301
20302     {&hf_ieee80211_tag_src_aid,
20303      {"Source AID", "wlan.ext_sched.src_id",
20304       FT_UINT8, BASE_DEC, NULL, 0xff,
20305       NULL, HFILL }},
20306
20307     {&hf_ieee80211_tag_dest_aid,
20308      {"Destination AID", "wlan.ext_sched.dest_id",
20309       FT_UINT8, BASE_DEC, NULL, 0xff,
20310       NULL, HFILL }},
20311
20312     {&hf_ieee80211_tag_alloc_start,
20313      {"Allocation Start", "wlan.ext_sched.alloc_start",
20314       FT_UINT32, BASE_DEC, NULL, 0,
20315       NULL, HFILL }},
20316
20317     {&hf_ieee80211_tag_alloc_block_duration,
20318      {"Allocation Block Duration", "wlan.ext_sched.block_duration",
20319       FT_UINT16, BASE_DEC, NULL, 0xffff,
20320       NULL, HFILL }},
20321
20322     {&hf_ieee80211_tag_num_blocks,
20323      {"Number of Blocks", "wlan.ext_sched.num_blocks",
20324       FT_UINT8, BASE_DEC, NULL, 0xff,
20325       NULL, HFILL }},
20326
20327     {&hf_ieee80211_tag_alloc_block_period,
20328      {"Allocation Block Period", "wlan.ext_sched.alloc_block_period",
20329       FT_UINT16, BASE_DEC, NULL, 0xffff,
20330       NULL, HFILL }},
20331
20332     {&hf_ieee80211_tag_aid,
20333      {"AID", "wlan.sta_avail.aid",
20334       FT_UINT16, BASE_DEC, NULL, 0x00ff,
20335       NULL, HFILL }},
20336
20337     {&hf_ieee80211_tag_cbap,
20338      {"CBAP", "wlan.sta_avail.cbap",
20339       FT_BOOLEAN, 16, NULL, 0x0100,
20340       NULL, HFILL }},
20341
20342     {&hf_ieee80211_tag_pp_avail,
20343      {"PP Available", "wlan.sta_avail.pp_avail",
20344       FT_BOOLEAN, 16, NULL, 0x0200,
20345       NULL, HFILL }},
20346
20347     {&hf_ieee80211_tag_next_ati_start_time,
20348      {"Start Time", "wlan.next_ati.start_time",
20349       FT_UINT32, BASE_DEC, NULL, 0,
20350       NULL, HFILL }},
20351
20352     {&hf_ieee80211_tag_next_ati_duration,
20353      {"ATI Duration", "wlan.next_ati.duration",
20354       FT_UINT16, BASE_DEC, NULL, 0xffff,
20355       NULL, HFILL }},
20356
20357     {&hf_ieee80211_tag_old_bssid,
20358      {"Old BSSID", "wlan.pcp_handover.old_bssid",
20359       FT_ETHER, BASE_NONE, NULL, 0,
20360       "OLD_BSSID", HFILL }},
20361
20362     {&hf_ieee80211_tag_new_pcp_addr,
20363      {"New PCP Address", "wlan.pcp_handover.new_pcp_addr",
20364       FT_ETHER, BASE_NONE, NULL, 0,
20365       "New_PCP_Address", HFILL }},
20366
20367     {&hf_ieee80211_tag_bssid,
20368      {"BSSID", "wlan.quiet_res.bssid",
20369       FT_ETHER, BASE_NONE, NULL, 0,
20370       "BSS-ID", HFILL }},
20371
20372     {&hf_ieee80211_tag_duplex_relay,
20373      {"Duplex", "wlan.relay_capabilities.duplex",
20374       FT_UINT8, BASE_DEC, NULL, 0x01,
20375       NULL, HFILL }},
20376
20377     {&hf_ieee80211_tag_cooperation_relay,
20378      {"Cooperation", "wlan.relay_capabilities.cooperation",
20379       FT_BOOLEAN, 8, NULL, 0x02,
20380       NULL, HFILL }},
20381
20382     {&hf_ieee80211_tag_tx_mode,
20383      {"TX-Mode", "wlan.realy_trans_param.tx_mode",
20384       FT_BOOLEAN, 8, NULL, 0x04,
20385       NULL, HFILL }},
20386
20387     {&hf_ieee80211_tag_link_change_interval,
20388      {"Link Change Interval", "wlan.realy_trans_param.link_change_interval",
20389       FT_UINT8, BASE_CUSTOM, CF_FUNC(allocation_duration_base_custom), 0xff,
20390       NULL, HFILL }},
20391
20392     {&hf_ieee80211_tag_data_sensing_time,
20393      {"Data Sensing Time", "wlan.realy_trans_param.data_sensing_time",
20394       FT_UINT8, BASE_DEC, NULL, 0xff,
20395       NULL, HFILL }},
20396
20397     {&hf_ieee80211_tag_first_period,
20398      {"First Period", "wlan.realy_trans_param.first_period",
20399       FT_UINT16, BASE_DEC, NULL, 0xffff,
20400       NULL, HFILL }},
20401
20402     {&hf_ieee80211_tag_second_period,
20403      {"Second Period", "wlan.realy_trans_param.second_period",
20404       FT_UINT16, BASE_DEC, NULL, 0xffff,
20405       NULL, HFILL }},
20406
20407     {&hf_ieee80211_tag_initiator,
20408      {"Initiator", "wlan.beam_refine.initiator",
20409       FT_BOOLEAN, 16, NULL, 0x0001,
20410       NULL, HFILL }},
20411
20412     {&hf_ieee80211_tag_tx_train_res,
20413      {"TX-train-response", "wlan.beam_refine.tx_train_res",
20414       FT_BOOLEAN, 16, NULL, 0x0002,
20415       NULL, HFILL }},
20416
20417     {&hf_ieee80211_tag_rx_train_res,
20418      {"RX-train-response", "wlan.beam_refine.rx_train_res",
20419       FT_BOOLEAN, 16, NULL, 0x0004,
20420       NULL, HFILL }},
20421
20422     {&hf_ieee80211_tag_tx_trn_ok,
20423      {"TX-TRN-OK", "wlan.beam_refine.tx_trn_ok",
20424       FT_BOOLEAN, 16, NULL, 0x0008,
20425       NULL, HFILL }},
20426
20427     {&hf_ieee80211_tag_txss_fbck_req,
20428      {"TXSS-FBCK-REQ", "wlan.beam_refine.txss_fbck_req",
20429       FT_BOOLEAN, 16, NULL, 0x0010,
20430       NULL, HFILL }},
20431
20432     {&hf_ieee80211_tag_bs_fbck,
20433      {"BS-FBCK", "wlan.beam_refine.bs_fbck",
20434       FT_UINT16, BASE_DEC, NULL, 0x07e0,
20435       NULL, HFILL }},
20436
20437     {&hf_ieee80211_tag_bs_fbck_antenna_id,
20438      {"BS-FBCK Anetenna ID", "wlan.beam_refine.bs_fbck_antenna_id",
20439       FT_UINT16, BASE_DEC, NULL, 0x1800,
20440       NULL, HFILL }},
20441
20442     {&hf_ieee80211_tag_snr_requested,
20443      {"SNR Requested", "wlan.beam_refine.snr_req",
20444       FT_BOOLEAN, 16, NULL, 0x2000,
20445       NULL, HFILL }},
20446
20447     {&hf_ieee80211_tag_channel_measurement_requested,
20448      {"Channel Measurement Requested", "wlan.beam_refine.ch_measure_req",
20449       FT_BOOLEAN, 16, NULL, 0x4000,
20450       NULL, HFILL }},
20451
20452     {&hf_ieee80211_tag_number_of_taps_requested,
20453      {"Number of Taps Requested", "wlan.beam_refine.taps_req",
20454       FT_UINT32, BASE_DEC, VALS(number_of_taps_values), 0x00000180,
20455       NULL, HFILL }},
20456
20457     {&hf_ieee80211_tag_sector_id_order_req,
20458      {"Sector ID Order Requested", "wlan.beam_refine.sector_id_req",
20459       FT_BOOLEAN, 32, NULL, 0x00000200,
20460       NULL, HFILL }},
20461
20462     {&hf_ieee80211_tag_snr_present,
20463      {"SNR Present", "wlan.beam_refine.snr_present",
20464       FT_BOOLEAN, 32, NULL, 0x00000400,
20465       NULL, HFILL }},
20466
20467     {&hf_ieee80211_tag_channel_measurement_present,
20468      {"Channel Measurement Present", "wlan.beam_refine.ch_measure_present",
20469       FT_BOOLEAN, 32, NULL, 0x00000800,
20470       NULL, HFILL }},
20471
20472     {&hf_ieee80211_tag_tap_delay_present,
20473      {"Tap Delay Present", "wlan.beam_refine.tap_delay_present",
20474       FT_BOOLEAN, 32, NULL, 0x00001000,
20475       NULL, HFILL }},
20476
20477     {&hf_ieee80211_tag_number_of_taps_present,
20478      {"Number of Taps Present", "wlan.beam_refine.taps_present",
20479       FT_UINT32, BASE_DEC, VALS(number_of_taps_values), 0x00006000,
20480       NULL, HFILL }},
20481
20482     {&hf_ieee80211_tag_number_of_measurement,
20483      {"Number of Measurements", "wlan.beam_refine.num_measurement",
20484       FT_UINT32, BASE_DEC, NULL, 0x003f8000,
20485       NULL, HFILL }},
20486
20487     {&hf_ieee80211_tag_sector_id_order_present,
20488      {"Sector ID Order Present", "wlan.beam_refine.sector_id_present",
20489       FT_BOOLEAN, 32, NULL, 0x00400000,
20490       NULL, HFILL }},
20491
20492     {&hf_ieee80211_tag_number_of_beams,
20493      {"Number of Beams", "wlan.beam_refine.num_beams",
20494       FT_UINT32, BASE_DEC, NULL, 0x0f800000,
20495       NULL, HFILL }},
20496
20497     {&hf_ieee80211_tag_mid_extension,
20498      {"MID Extension", "wlan.beam_refine.mid_ext",
20499       FT_BOOLEAN, 32, NULL, 0x10000000,
20500       NULL, HFILL }},
20501
20502     {&hf_ieee80211_tag_capability_request,
20503      {"Capability Request", "wlan.beam_refine.cap_req",
20504       FT_BOOLEAN, 32, NULL, 0x20000000,
20505       NULL, HFILL }},
20506
20507     {&hf_ieee80211_tag_nextpcp_list,
20508       {"AID of NextPCP", "wlan.next_pcp.list",
20509        FT_UINT8, BASE_DEC, NULL, 0,
20510        NULL, HFILL }},
20511
20512     {&hf_ieee80211_tag_nextpcp_token,
20513       {"NextPCP List Token", "wlan.next_pcp.token",
20514        FT_UINT8, BASE_DEC, NULL, 0,
20515        NULL, HFILL }},
20516
20517     {&hf_ieee80211_tag_reamaining_BI,
20518       {"Remaining BI's", "wlan.pcp_handover.remaining_BIs",
20519        FT_UINT8, BASE_DEC, NULL, 0,
20520        NULL, HFILL }},
20521
20522     {&hf_ieee80211_tag_request_token,
20523       {"Request Token", "wlan.request_token",
20524        FT_UINT16, BASE_DEC, NULL, 0,
20525        NULL, HFILL }},
20526
20527     {&hf_ieee80211_tag_bi_start_time,
20528       {"BI Start Time", "wlan.bi_start_time",
20529        FT_UINT32, BASE_DEC, NULL, 0,
20530        NULL, HFILL }},
20531
20532     {&hf_ieee80211_tag_sleep_cycle,
20533       {"Sleep Cycle", "wlan.sleep_cycle",
20534        FT_UINT16, BASE_DEC, NULL, 0,
20535        NULL, HFILL }},
20536
20537     {&hf_ieee80211_tag_num_awake_bis,
20538       {"Number of Awake/Doze BIs", "wlan.num_awake_bis",
20539        FT_UINT16, BASE_DEC, NULL, 0,
20540        NULL, HFILL }},
20541
20542     {&hf_ieee80211_ff_dmg_action_code,
20543      {"DMG Action", "wlan_mgt.fixed.dmg_act",
20544       FT_UINT8, BASE_HEX, VALS(ff_dmg_action_flags), 0,
20545       "Action Code", HFILL }},
20546
20547     {&hf_ieee80211_ff_unprotected_dmg_action_code,
20548      {"Unprotected DMG Action", "wlan_mgt.fixed.unprotected_dmg_act",
20549       FT_UINT8, BASE_HEX, VALS(ff_unprotected_dmg_action_flags), 0,
20550       "Action Code", HFILL }},
20551
20552     {&hf_ieee80211_ff_dmg_pwr_mgmt,
20553       {"DMG Power Management", "wlan.dmg.pwr_mgmt",
20554        FT_BOOLEAN, 8, NULL, 0x01,
20555        NULL, HFILL }},
20556
20557     {&hf_ieee80211_ff_subject_address,
20558       {"Subject Address","wlan.dmg.subject_addr",
20559        FT_ETHER, BASE_NONE, NULL, 0,
20560        "MAC address of requested STA", HFILL }},
20561
20562     {&hf_ieee80211_ff_handover_reason,
20563       {"Handover Reason","wlan.dmg.handover_reason",
20564        FT_UINT8, BASE_DEC, NULL, 0x03,
20565        NULL, HFILL }},
20566
20567     {&hf_ieee80211_ff_handover_remaining_bi,
20568       {"Handover Remaining BI","wlan.dmg.handover_remaining_bi",
20569        FT_UINT8, BASE_DEC, NULL, 0x01,
20570        NULL, HFILL }},
20571
20572     {&hf_ieee80211_ff_handover_result,
20573       {"Handover Result","wlan.dmg.handover_result",
20574        FT_UINT8, BASE_DEC, NULL, 0x01,
20575        NULL, HFILL }},
20576
20577     {&hf_ieee80211_ff_handover_reject_reason,
20578       {"Handover Reject Reason","wlan.dmg.handover_reject_reason",
20579        FT_UINT8, BASE_DEC, NULL, 0x03,
20580        NULL, HFILL }},
20581
20582     {&hf_ieee80211_ff_destination_reds_aid,
20583       {"Destination REDS AID","wlan.dmg.destination_reds_aid",
20584        FT_UINT16, BASE_DEC, NULL, 0,
20585        NULL, HFILL }},
20586
20587     {&hf_ieee80211_ff_destination_aid,
20588       {"Destination AID","wlan.dmg.destination_aid",
20589        FT_UINT16, BASE_DEC, NULL, 0,
20590        NULL, HFILL }},
20591
20592     {&hf_ieee80211_ff_realy_aid,
20593       {"Relay AID","wlan.dmg.realy_aid",
20594        FT_UINT16, BASE_DEC, NULL, 0,
20595        NULL, HFILL }},
20596
20597     {&hf_ieee80211_ff_source_aid,
20598       {"Source AID","wlan.dmg.source_aid",
20599        FT_UINT16, BASE_DEC, NULL, 0,
20600        NULL, HFILL }},
20601
20602     {&hf_ieee80211_ff_timing_offset,
20603       {"Timing Offset","wlan.dmg.timing_offset",
20604        FT_UINT16, BASE_DEC, NULL, 0,
20605        NULL, HFILL }},
20606
20607     {&hf_ieee80211_ff_sampling_frequency_offset,
20608       {"Sampling Frequency Offset","wlan.dmg.sampling_frequency_offset",
20609        FT_UINT16, BASE_DEC, NULL, 0,
20610        NULL, HFILL }},
20611
20612     {&hf_ieee80211_ff_relay_operation_type,
20613       {"Relay Operation Type","wlan.dmg.relay_operation_type",
20614        FT_UINT8, BASE_DEC, NULL, 0x03,
20615        NULL, HFILL }},
20616
20617     {&hf_ieee80211_ff_peer_sta_aid,
20618       {"Peer STA AID","wlan.dmg.peer_sta_aid",
20619        FT_UINT8, BASE_DEC, NULL, 0,
20620        NULL, HFILL }},
20621
20622     {&hf_ieee80211_ff_snr,
20623       {"SNR","wlan.dmg.snr",
20624        FT_UINT8, BASE_DEC, NULL, 0,
20625        NULL, HFILL }},
20626
20627     {&hf_ieee80211_ff_internal_angle,
20628       {"Internal Angle","wlan.dmg.internal_angle",
20629        FT_UINT8, BASE_DEC, NULL, 0xfe,
20630        NULL, HFILL }},
20631
20632     {&hf_ieee80211_ff_recommend,
20633       {"Recommend","wlan.dmg.recommend",
20634        FT_UINT8, BASE_DEC, NULL, 0x01,
20635        NULL, HFILL }},
20636
20637     {&hf_ieee80211_ff_fst_action_code,
20638       {"FST Action Code","wlan.fst.action_code",
20639        FT_UINT8, BASE_HEX, VALS(ff_fst_action_flags), 0,
20640        "Action Code", HFILL }},
20641
20642     {&hf_ieee80211_ff_llt,
20643       {"Link Loss Timeout","wlan.fst.llt",
20644        FT_UINT32, BASE_DEC, NULL, 0,
20645        NULL, HFILL }},
20646
20647     {&hf_ieee80211_ff_fsts_id,
20648       {"FSTS ID","wlan.session_trans.fsts_id",
20649        FT_UINT32, BASE_DEC, NULL, 0,
20650        NULL, HFILL }},
20651
20652     {&hf_ieee80211_ff_mmpdu_len,
20653       {"MMPDU Length","wlan.fst.mmpdu_length",
20654        FT_UINT16, BASE_DEC, NULL, 0,
20655        NULL, HFILL }},
20656
20657     {&hf_ieee80211_ff_mmpdu_ctrl,
20658       {"MMPDU Control","wlan.fst.mmpdu_ctrl",
20659        FT_UINT16, BASE_HEX, NULL, 0,
20660        NULL, HFILL }},
20661
20662     {&hf_ieee80211_ff_oct_mmpdu,
20663       {"OCT MMPDU","wlan.fst.oct_mmpdu",
20664        FT_BYTES, BASE_NONE, NULL, 0,
20665        NULL, HFILL }},
20666
20667     {&hf_ieee80211_ff_vht_mimo_cntrl,
20668      {"VHT MIMO Control", "wlan.vht.mimo_control.control",
20669       FT_UINT24, BASE_HEX, NULL, 0x0,
20670       NULL, HFILL }},
20671
20672     {&hf_ieee80211_ff_vht_mimo_cntrl_nc_index,
20673      {"Nc Index", "wlan.vht.mimo_control.ncindex",
20674       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nc_index_vals), 0x000007,
20675       "Number of Columns Less One", HFILL }},
20676
20677     {&hf_ieee80211_ff_vht_mimo_cntrl_nr_index,
20678      {"Nr Index", "wlan.vht.mimo_control.nrindex",
20679       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_nr_index_vals), 0x000038,
20680       "Number of Rows Less One", HFILL }},
20681
20682     {&hf_ieee80211_ff_vht_mimo_cntrl_channel_width,
20683      {"Channel Width", "wlan.vht.mimo_control.chanwidth",
20684       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_channel_width_vals), 0x0000C0,
20685       NULL, HFILL }},
20686
20687     {&hf_ieee80211_ff_vht_mimo_cntrl_grouping,
20688      {"Grouping (Ng)", "wlan.vht.mimo_control.grouping",
20689       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_grouping_vals), 0x000300,
20690       NULL, HFILL }},
20691
20692     {&hf_ieee80211_ff_vht_mimo_cntrl_codebook_info,
20693      {"Codebook Information", "wlan.vht.mimo_control.codebookinfo",
20694       FT_UINT24, BASE_HEX, NULL, 0x000400,
20695       NULL, HFILL }},
20696
20697     {&hf_ieee80211_ff_vht_mimo_cntrl_feedback_type,
20698      {"Feedback Type", "wlan.vht.mimo_control.feedbacktype",
20699       FT_UINT24, BASE_HEX, VALS(ff_vht_mimo_cntrl_feedback_vals), 0x000800,
20700       NULL, HFILL }},
20701
20702     {&hf_ieee80211_ff_vht_mimo_cntrl_remaining_feedback_seg,
20703      {"Remaining Feedback Segments", "wlan.vht.mimo_control.remainingfeedbackseg",
20704       FT_UINT24, BASE_HEX, NULL, 0x007000,
20705       NULL, HFILL }},
20706
20707     {&hf_ieee80211_ff_vht_mimo_cntrl_first_feedback_seg,
20708      {"First Feedback Segments", "wlan.vht.mimo_control.firstfeedbackseg",
20709       FT_UINT24, BASE_HEX, NULL, 0x008000,
20710       NULL, HFILL }},
20711
20712     {&hf_ieee80211_ff_vht_mimo_cntrl_reserved,
20713      {"Reserved", "wlan.vht.mimo_control.reserved",
20714       FT_UINT24, BASE_HEX, NULL, 0x030000,
20715       NULL, HFILL }},
20716
20717     {&hf_ieee80211_ff_vht_mimo_cntrl_sounding_dialog_token_number,
20718      {"Sounding Dialog Toker Number", "wlan.vht.mimo_control.soundingdialogtocketnbr",
20719       FT_UINT24, BASE_HEX, NULL, 0xFC0000,
20720       NULL, HFILL }},
20721
20722     {&hf_ieee80211_ff_vht_action,
20723       {"VHT Action","wlan.vht.action",
20724        FT_UINT8, BASE_DEC, VALS(vht_action_vals), 0,
20725        NULL, HFILL }},
20726
20727     {&hf_ieee80211_vht_compressed_beamforming_report,
20728       {"VHT Compressed Beamforming Report","wlan.vht.compressed_beamforming_report",
20729        FT_BYTES, BASE_NONE, NULL, 0,
20730        NULL, HFILL }},
20731
20732     {&hf_ieee80211_vht_compressed_beamforming_report_snr,
20733       {"Signal to Noise Ratio (SNR)", "wlan.vht.compressed_beamforming_report.snr",
20734        FT_UINT8, BASE_HEX, NULL, 0,
20735        NULL, HFILL }},
20736
20737     {&hf_ieee80211_vht_compressed_beamforming_feedback_matrix,
20738       {"Compressed Beamforming Feedback Matrix", "wlan.vht.compressed_beamforming_report.feedback_matrix",
20739        FT_NONE, BASE_NONE, NULL, 0,
20740        NULL, HFILL }},
20741
20742     {&hf_ieee80211_vht_group_id_management,
20743       {"Group ID Management","wlan.vht.group_id_management",
20744        FT_BYTES, BASE_NONE, NULL, 0,
20745        NULL, HFILL }},
20746
20747     {&hf_ieee80211_vht_membership_status_array,
20748       {"Membership Status Array","wlan.vht.membership_status_array",
20749        FT_BYTES, BASE_NONE, NULL, 0,
20750        NULL, HFILL }},
20751
20752     {&hf_ieee80211_vht_user_position_array,
20753       {"User Position Array","wlan.vht.user_position_array",
20754        FT_BYTES, BASE_NONE, NULL, 0,
20755        NULL, HFILL }},
20756
20757     {&hf_ieee80211_vht_operation_mode_notification,
20758       {"Operation Mode Notification","wlan.vht.operation_mode_notification",
20759        FT_BYTES, BASE_NONE, NULL, 0,
20760        NULL, HFILL }},
20761
20762     {&hf_ieee80211_tag_tspec_allocation_id,
20763       {"Allocation ID","wlan.dmg_tspec.allocation_id",
20764        FT_UINT24, BASE_DEC, NULL, 0x00000f,
20765        NULL, HFILL }},
20766
20767     {&hf_ieee80211_tag_tspec_allocation_type,
20768       {"Allocation Type","wlan.dmg_tspec.allocation_type",
20769        FT_UINT24, BASE_DEC, NULL, 0x000070,
20770        NULL, HFILL }},
20771
20772     {&hf_ieee80211_tag_tspec_allocation_format,
20773       {"Allocation Format","wlan.dmg_tspec.allocation_format",
20774        FT_BOOLEAN, 24, NULL, 0x000080,
20775        NULL, HFILL }},
20776
20777     {&hf_ieee80211_tag_tspec_pseudo_static,
20778       {"Pseudo Static","wlan.dmg_tspec.pseudo_static",
20779        FT_BOOLEAN, 24, NULL, 0x000100,
20780        NULL, HFILL }},
20781
20782     {&hf_ieee80211_tag_tspec_truncatable,
20783       {"Truncatable","wlan.dmg_tspec.truncatable",
20784        FT_BOOLEAN, 24, NULL, 0x000200,
20785        NULL, HFILL }},
20786
20787     {&hf_ieee80211_tag_tspec_extendable,
20788       {"Extendable","wlan.dmg_tspec.extendable",
20789        FT_BOOLEAN, 24, NULL, 0x000400,
20790        NULL, HFILL }},
20791
20792     {&hf_ieee80211_tag_tspec_lp_sc_used,
20793       {"LP SC Usec","wlan.dmg_tspec.lp_sc_used",
20794        FT_BOOLEAN, 24, NULL, 0x000800,
20795        NULL, HFILL }},
20796
20797     {&hf_ieee80211_tag_tspec_up,
20798       {"UP","wlan.dmg_tspec.up",
20799        FT_UINT24, BASE_HEX, NULL, 0x007000,
20800        NULL, HFILL }},
20801
20802     {&hf_ieee80211_tag_tspec_dest_aid,
20803       {"Destination AID","wlan.dmg_tspec.dest_aid",
20804        FT_UINT24, BASE_HEX, NULL, 0x7f8000,
20805        NULL, HFILL }},
20806
20807     {&hf_ieee80211_tag_tspec_allocation_period,
20808       {"Allocation Period","wlan.dmg_tspec.allocation_period",
20809        FT_UINT16, BASE_DEC, NULL, 0,
20810        NULL, HFILL }},
20811
20812     {&hf_ieee80211_tag_tspec_min_allocation,
20813       {"Minimal Allocation","wlan.dmg_tspec.min_allocation",
20814        FT_UINT16, BASE_DEC, NULL, 0,
20815        NULL, HFILL }},
20816
20817     {&hf_ieee80211_tag_tspec_max_allocation,
20818       {"Maximal Allocation","wlan.dmg_tspec.max_allocation",
20819        FT_UINT16, BASE_DEC, NULL, 0,
20820        NULL, HFILL }},
20821
20822     {&hf_ieee80211_tag_tspec_min_duration,
20823       {"Minimal Duration","wlan.dmg_tspec.min_duration",
20824        FT_UINT16, BASE_DEC, NULL, 0,
20825        NULL, HFILL }},
20826
20827     {&hf_ieee80211_tag_tspec_num_of_constraints,
20828       {"Number Of Constraints","wlan.dmg_tspec.num_of_constraints",
20829        FT_UINT8, BASE_DEC, NULL, 0,
20830        NULL, HFILL }},
20831
20832     {&hf_ieee80211_tag_tspec_tsconst_start_time,
20833       {"TS Constraint Start Time","wlan.dmg_tspec.tsconst.start_time",
20834        FT_UINT32, BASE_DEC, NULL, 0,
20835        NULL, HFILL }},
20836
20837     {&hf_ieee80211_tag_tspec_tsconst_duration,
20838       {"TS Constraint Duration","wlan.dmg_tspec.tsconst.duration",
20839        FT_UINT16, BASE_DEC, NULL, 0,
20840        NULL, HFILL }},
20841
20842     {&hf_ieee80211_tag_tspec_tsconst_period,
20843       {"TS Constraint Period","wlan.dmg_tspec.tsconst.period",
20844        FT_UINT16, BASE_DEC, NULL, 0,
20845        NULL, HFILL }},
20846
20847     {&hf_ieee80211_tag_tspec_tsconst_interferer_mac,
20848       {"TS Constraint Interferer MAC Address","wlan.dmg_tspec.tsconst.interferer_mac",
20849        FT_ETHER, BASE_NONE, NULL, 0,
20850        NULL, HFILL }},
20851
20852     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_I,
20853       {"Channel Measurement Feedback Relative I","wlan.ch_meas_fb.realtive_I",
20854        FT_UINT8, BASE_DEC, NULL, 0,
20855        NULL, HFILL }},
20856
20857     {&hf_ieee80211_tag_channel_measurement_feedback_realtive_Q,
20858       {"Channel Measurement Feedback Relative Q","wlan.ch_meas_fb.realtive_Q",
20859        FT_UINT8, BASE_DEC, NULL, 0,
20860        NULL, HFILL }},
20861
20862     {&hf_ieee80211_tag_channel_measurement_feedback_tap_delay,
20863       {"Channel Measurement Feedback Tap Delay","wlan.ch_meas_fb.tap_delay",
20864        FT_UINT8, BASE_DEC, NULL, 0,
20865        NULL, HFILL }},
20866
20867     {&hf_ieee80211_tag_channel_measurement_feedback_sector_id,
20868       {"Channel Measurement Feedback Secotr ID","wlan.ch_meas_fb.sector_id",
20869        FT_UINT8, BASE_DEC, NULL, 0xfc,
20870        NULL, HFILL }},
20871
20872     {&hf_ieee80211_tag_channel_measurement_feedback_antenna_id,
20873       {"Channel Measurement Feedback Antenna ID","wlan.ch_meas_fb.antenna_id",
20874        FT_UINT8, BASE_DEC, NULL, 0x03,
20875        NULL, HFILL }},
20876
20877     {&hf_ieee80211_tag_awake_window,
20878       {"Awake Window","wlan.awake_window",
20879        FT_UINT16, BASE_DEC, NULL, 0,
20880        NULL, HFILL }},
20881
20882     {&hf_ieee80211_tag_addba_ext_no_frag,
20883       {"ADDBA No Fragmentation","wlan.addba.no_frag",
20884        FT_BOOLEAN, 8, NULL, 0x80,
20885        NULL, HFILL }},
20886
20887     {&hf_ieee80211_tag_multi_band_ctrl_sta_role,
20888       {"STA Rold","wlan.multi_band.ctrl_sta_role",
20889        FT_UINT8, BASE_DEC, NULL, 0xe0,
20890        NULL, HFILL }},
20891
20892     {&hf_ieee80211_tag_multi_band_ctrl_addr_present,
20893       {"STA MAC Address Present","wlan.multi_band.ctrl_addr_present",
20894        FT_BOOLEAN, 8, NULL, 0x10,
20895        NULL, HFILL }},
20896
20897     {&hf_ieee80211_tag_multi_band_ctrl_cipher_present,
20898       {"PCS Present","wlan.multi_band.ctrl_cipher_present",
20899        FT_BOOLEAN, 8, NULL, 0x08,
20900        NULL, HFILL }},
20901
20902     {&hf_ieee80211_tag_multi_band_oper_class,
20903       {"Operating Class","wlan.multi_band.oper_class",
20904        FT_UINT8, BASE_DEC, NULL, 0,
20905        NULL, HFILL }},
20906
20907     {&hf_ieee80211_tag_multi_band_channel_number,
20908       {"Channel Number","wlan.multi_band.channel_number",
20909        FT_UINT8, BASE_DEC, NULL, 0,
20910        NULL, HFILL }},
20911
20912     {&hf_ieee80211_tag_multi_band_tsf_offset,
20913       {"TSF Offset","wlan.multi_band.tsf_offset",
20914        FT_UINT64, BASE_DEC, NULL, 0,
20915        NULL, HFILL }},
20916
20917     {&hf_ieee80211_tag_multi_band_conn_ap,
20918       {"Connection Capability AP","wlan.multi_band.conn_ap",
20919        FT_BOOLEAN, 8, NULL, 0x80,
20920        NULL, HFILL }},
20921
20922     {&hf_ieee80211_tag_multi_band_conn_pcp,
20923       {"Connection Capability PCP","wlan.multi_band.conn_pcp",
20924        FT_BOOLEAN, 8, NULL, 0x40,
20925        NULL, HFILL }},
20926
20927     {&hf_ieee80211_tag_multi_band_conn_dls,
20928       {"Connection Capability DLS","wlan.multi_band.conn_dls",
20929        FT_BOOLEAN, 8, NULL, 0x20,
20930        NULL, HFILL }},
20931
20932     {&hf_ieee80211_tag_multi_band_conn_tdls,
20933       {"Connection Capability TDLS","wlan.multi_band.conn_tdls",
20934        FT_BOOLEAN, 8, NULL, 0x10,
20935        NULL, HFILL }},
20936
20937     {&hf_ieee80211_tag_multi_band_conn_ibss,
20938       {"Connection Capability IBSS","wlan.multi_band.conn_ibss",
20939        FT_BOOLEAN, 8, NULL, 0x08,
20940        NULL, HFILL }},
20941
20942     {&hf_ieee80211_tag_multi_band_fst_timeout,
20943       {"FST Session Timeout","wlan.multi_band.fst_timeout",
20944        FT_UINT8, BASE_DEC, NULL, 0,
20945        NULL, HFILL }},
20946
20947     {&hf_ieee80211_tag_multi_band_sta_mac,
20948       {"Transmitting STA MAC Address","wlan.multi_band.sta_mac",
20949        FT_ETHER, BASE_NONE, NULL, 0,
20950        NULL, HFILL }},
20951
20952     {&hf_ieee80211_tag_activity,
20953       {"Activity","wlan.activity",
20954        FT_UINT8, BASE_DEC, NULL, 0,
20955        NULL, HFILL }},
20956
20957     {&hf_ieee80211_tag_dmg_link_adapt_mcs,
20958       {"MCS","wlan.dmg_link_adapt.mcs",
20959        FT_UINT8, BASE_DEC, NULL, 0,
20960        NULL, HFILL }},
20961
20962     {&hf_ieee80211_tag_dmg_link_adapt_link_margin,
20963       {"Link Margin","wlan.dmg_link_adapt.link_margin",
20964        FT_UINT8, BASE_DEC, NULL, 0,
20965        NULL, HFILL }},
20966
20967     {&hf_ieee80211_tag_ref_timestamp,
20968       {"Reference Timestamp","wlan.ref_timestamp",
20969        FT_UINT32, BASE_DEC, NULL, 0,
20970        NULL, HFILL }},
20971
20972     {&hf_ieee80211_tag_switching_stream_non_qos,
20973       {"Non-Qos Data Frames","wlan.switching_stream.non_qos",
20974        FT_BOOLEAN, 8, NULL, 0,
20975        NULL, HFILL }},
20976
20977     {&hf_ieee80211_tag_switching_stream_param_num,
20978       {"Number Of Switching Stream Elements","wlan.switching_stream.param_num",
20979        FT_UINT8, BASE_DEC, NULL, 0,
20980        NULL, HFILL }},
20981
20982     {&hf_ieee80211_tag_switching_stream_old_tid,
20983       {"Old Band TID","wlan.switching_stream.old_tid",
20984        FT_UINT16, BASE_DEC, NULL, 0xf000,
20985        NULL, HFILL }},
20986
20987     {&hf_ieee80211_tag_switching_stream_old_direction,
20988       {"Old Band Direction","wlan.switching_stream.old_direction",
20989        FT_BOOLEAN, 16, NULL, 0x0800,
20990        NULL, HFILL }},
20991
20992     {&hf_ieee80211_tag_switching_stream_new_tid,
20993       {"New Band TID","wlan.switching_stream.new_tid",
20994        FT_UINT16, BASE_DEC, NULL, 0x0780,
20995        NULL, HFILL }},
20996
20997     {&hf_ieee80211_tag_switching_stream_new_direction,
20998       {"New Band Direction","wlan.switching_stream.new_direction",
20999        FT_BOOLEAN, 16, NULL, 0x0040,
21000        NULL, HFILL }},
21001
21002     {&hf_ieee80211_tag_switching_stream_new_valid_id,
21003       {"Stream ID in New Band Valid","wlan.switching_stream.new_valid_id",
21004        FT_BOOLEAN, 16, NULL, 0x0020,
21005        NULL, HFILL }},
21006
21007     {&hf_ieee80211_tag_switching_stream_llt_type,
21008       {"LLT Type","wlan.switching_stream.llt_type",
21009        FT_BOOLEAN, 16, NULL, 0x0010,
21010        NULL, HFILL }},
21011   };
21012
21013   static hf_register_info ff[] = {
21014
21015     {&hf_ieee80211_ff_timestamp,
21016      {"Timestamp", "wlan_mgt.fixed.timestamp",
21017       FT_UINT64, BASE_HEX, NULL, 0,
21018       NULL, HFILL }},
21019
21020     {&hf_ieee80211_ff_auth_alg,
21021      {"Authentication Algorithm", "wlan_mgt.fixed.auth.alg",
21022       FT_UINT16, BASE_DEC, VALS(auth_alg), 0,
21023       NULL, HFILL }},
21024
21025     {&hf_ieee80211_ff_beacon_interval,
21026      {"Beacon Interval", "wlan_mgt.fixed.beacon",
21027       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
21028       NULL, HFILL }},
21029
21030     {&hf_ieee80211_fixed_parameters,
21031      {"Fixed parameters", "wlan_mgt.fixed.all",
21032       FT_NONE, BASE_NONE, NULL, 0,
21033       NULL, HFILL }},
21034
21035     {&hf_ieee80211_tagged_parameters,
21036      {"Tagged parameters", "wlan_mgt.tagged.all",
21037       FT_NONE, BASE_NONE, NULL, 0,
21038       NULL, HFILL }},
21039
21040     {&hf_ieee80211_tag_ssid,
21041      {"SSID", "wlan_mgt.ssid",
21042       FT_STRING, BASE_NONE, NULL, 0,
21043       "Indicates the identity of an ESS or IBSS", HFILL }},
21044
21045     {&hf_ieee80211_tag_supp_rates,
21046      {"Supported Rates", "wlan_mgt.supported_rates",
21047       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
21048       "In Mbit/sec, (B) for Basic Rates", HFILL }},
21049
21050     {&hf_ieee80211_tag_fh_dwell_time,
21051      {"Dwell Time", "wlan_mgt.fh.dwell_time",
21052       FT_UINT16, BASE_HEX, NULL, 0x0,
21053       "In Time Unit (TU)", HFILL }},
21054
21055     {&hf_ieee80211_tag_fh_hop_set,
21056      {"Hop Set", "wlan_mgt.fh.hop_set",
21057       FT_UINT8, BASE_DEC, NULL, 0x0,
21058       NULL, HFILL }},
21059
21060     {&hf_ieee80211_tag_fh_hop_pattern,
21061      {"Hop Pattern", "wlan_mgt.fh.hop_pattern",
21062       FT_UINT8, BASE_DEC, NULL, 0x0,
21063       NULL, HFILL }},
21064
21065     {&hf_ieee80211_tag_fh_hop_index,
21066      {"Hop Index", "wlan_mgt.fh.hop_index",
21067       FT_UINT8, BASE_DEC, NULL, 0x0,
21068       NULL, HFILL }},
21069
21070     {&hf_ieee80211_ff_block_ack_params,
21071      {"Block Ack Parameters", "wlan_mgt.fixed.baparams",
21072       FT_UINT16, BASE_HEX, NULL, 0,
21073       NULL, HFILL }},
21074
21075     {&hf_ieee80211_ff_block_ack_params_amsdu_permitted,
21076      {"A-MSDUs", "wlan_mgt.fixed.baparams.amsdu",
21077       FT_BOOLEAN, 16, TFS (&ff_block_ack_params_amsdu_permitted_flag), 0x0001,
21078       "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
21079
21080     {&hf_ieee80211_ff_block_ack_params_policy,
21081      {"Block Ack Policy", "wlan_mgt.fixed.baparams.policy",
21082       FT_BOOLEAN, 16, TFS (&ff_block_ack_params_policy_flag), 0x0002,
21083       NULL, HFILL }},
21084
21085     {&hf_ieee80211_ff_block_ack_params_tid,
21086      {"Traffic Identifier", "wlan_mgt.fixed.baparams.tid",
21087       FT_UINT16, BASE_HEX, NULL, 0x003C,
21088       NULL, HFILL }},
21089
21090     {&hf_ieee80211_ff_block_ack_params_buffer_size,
21091      {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan_mgt.fixed.baparams.buffersize",
21092       FT_UINT16, BASE_DEC, NULL, 0xFFC0,
21093       "Number of Buffers", HFILL }},
21094
21095     {&hf_ieee80211_ff_block_ack_timeout,
21096      {"Block Ack Timeout", "wlan_mgt.fixed.batimeout",
21097       FT_UINT16, BASE_HEX, NULL, 0,
21098       NULL, HFILL }},
21099
21100     {&hf_ieee80211_ff_block_ack_ssc,
21101      {"Block Ack Starting Sequence Control (SSC)", "wlan_mgt.fixed.ssc",
21102       FT_UINT16, BASE_HEX, 0, 0,
21103       NULL, HFILL }},
21104
21105     {&hf_ieee80211_ff_block_ack_ssc_fragment,
21106      {"Fragment", "wlan_mgt.fixed.ssc.fragment",
21107       FT_UINT16, BASE_DEC, 0, 0x000f,
21108       NULL, HFILL }},
21109
21110     {&hf_ieee80211_ff_block_ack_ssc_sequence,
21111      {"Starting Sequence Number", "wlan_mgt.fixed.ssc.sequence",
21112       FT_UINT16, BASE_DEC, 0, 0xfff0,
21113       NULL, HFILL }},
21114
21115     {&hf_ieee80211_ff_delba_param,
21116      {"Delete Block Ack (DELBA) Parameter Set", "wlan_mgt.fixed.delba.param",
21117       FT_UINT16, BASE_HEX, 0, 0,
21118       NULL, HFILL }},
21119
21120     {&hf_ieee80211_ff_delba_param_reserved,
21121      {"Reserved", "wlan_mgt.fixed.delba.param.reserved",
21122       FT_UINT16, BASE_HEX, 0, 0x07ff,
21123       NULL, HFILL }},
21124
21125     {&hf_ieee80211_ff_delba_param_init,
21126      {"Initiator", "wlan_mgt.fixed.delba.param.initiator",
21127       FT_BOOLEAN, 16, 0, 0x0800,
21128       NULL, HFILL }},
21129
21130     {&hf_ieee80211_ff_delba_param_tid,
21131      {"TID", "wlan_mgt.fixed.delba.param.tid",
21132       FT_UINT16, BASE_HEX, 0, 0xf000,
21133       "Traffic Identifier (TID)", HFILL }},
21134
21135     {&hf_ieee80211_ff_max_reg_pwr,
21136      {"Maximum Regulation Power", "wlan_mgt.fixed.maxregpwr",
21137       FT_UINT16, BASE_HEX, 0, 0,
21138       NULL, HFILL }},
21139
21140     {&hf_ieee80211_ff_measurement_pilot_int,
21141      {"Measurement Pilot Interval", "wlan_mgt.fixed.msmtpilotint",
21142       FT_UINT16, BASE_HEX, 0, 0,
21143       "Measurement Pilot Interval Fixed Field", HFILL }},
21144
21145     {&hf_ieee80211_ff_country_str,
21146      {"Country String", "wlan_mgt.fixed.country",
21147       FT_STRING, BASE_NONE, 0, 0,
21148       NULL, HFILL }},
21149
21150     {&hf_ieee80211_ff_max_tx_pwr,
21151      {"Maximum Transmit Power", "wlan_mgt.fixed.maxtxpwr",
21152       FT_UINT8, BASE_HEX, 0, 0,
21153       NULL, HFILL }},
21154
21155     {&hf_ieee80211_ff_tx_pwr_used,
21156      {"Transmit Power Used", "wlan_mgt.fixed.txpwr",
21157       FT_UINT8, BASE_HEX, 0, 0,
21158       NULL, HFILL }},
21159
21160     {&hf_ieee80211_ff_transceiver_noise_floor,
21161      {"Transceiver Noise Floor", "wlan_mgt.fixed.tnoisefloor",
21162       FT_UINT8, BASE_HEX, 0, 0,
21163       NULL, HFILL }},
21164
21165     {&hf_ieee80211_ff_channel_width,
21166      {"Supported Channel Width", "wlan_mgt.fixed.chanwidth",
21167       FT_UINT8, BASE_HEX, VALS(ff_channel_width_vals), 0,
21168       NULL, HFILL }},
21169
21170     {&hf_ieee80211_ff_qos_info_ap,
21171      {"QoS Information (AP)", "wlan_mgt.fixed.qosinfo.ap",
21172       FT_UINT8, BASE_HEX, NULL, 0,
21173       NULL, HFILL }},
21174
21175     {&hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
21176      {"EDCA Parameter Set Update Count", "wlan_mgt.fixed.qosinfo.ap.edcaupdate",
21177       FT_UINT8, BASE_HEX, NULL, 0x0F,
21178       "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
21179
21180     {&hf_ieee80211_ff_qos_info_ap_q_ack,
21181      {"Q-Ack", "wlan_mgt.fixed.qosinfo.ap.qack",
21182       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_q_ack_flag), 0x10,
21183       "QoS Ack", HFILL }},
21184
21185     {&hf_ieee80211_ff_qos_info_ap_queue_req,
21186      {"Queue Request", "wlan_mgt.fixed.qosinfo.ap.queue_req",
21187       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_queue_req_flag), 0x20,
21188       NULL, HFILL }},
21189
21190     {&hf_ieee80211_ff_qos_info_ap_txop_request,
21191      {"TXOP Request", "wlan_mgt.fixed.qosinfo.ap.txopreq",
21192       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_txop_request_flag), 0x40,
21193       "Transmit Opportunity (TXOP) Request", HFILL }},
21194
21195     {&hf_ieee80211_ff_qos_info_ap_reserved,
21196      {"Reserved", "wlan_mgt.fixed.qosinfo.ap.reserved",
21197       FT_BOOLEAN, 8, NULL, 0x80,
21198       NULL, HFILL }},
21199
21200     {&hf_ieee80211_ff_qos_info_sta,
21201      {"QoS Information (STA)", "wlan_mgt.fixed.qosinfo.sta",
21202       FT_UINT8, BASE_HEX, NULL, 0,
21203       "TCLAS Processing", HFILL }},
21204
21205     {&hf_ieee80211_ff_qos_info_sta_ac_vo,
21206      {"AC_VO U-APSD Flag", "wlan_mgt.fixed.qosinfo.sta.ac_vo",
21207       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x01,
21208       NULL, HFILL }},
21209
21210     {&hf_ieee80211_ff_qos_info_sta_ac_vi,
21211      {"AC_VI U-APSD Flag", "wlan_mgt.fixed.qosinfo.sta.ac_vi",
21212       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x02,
21213       NULL, HFILL }},
21214
21215     {&hf_ieee80211_ff_qos_info_sta_ac_bk,
21216      {"AC_BK U-APSD Flag", "wlan_mgt.fixed.qosinfo.sta.ac_bk",
21217       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x04,
21218       NULL, HFILL }},
21219
21220     {&hf_ieee80211_ff_qos_info_sta_ac_be,
21221      {"AC_BE U-APSD Flag", "wlan_mgt.fixed.qosinfo.sta.ac_be",
21222       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x08,
21223       NULL, HFILL }},
21224
21225     {&hf_ieee80211_ff_qos_info_sta_q_ack,
21226      {"Q-Ack", "wlan_mgt.fixed.qosinfo.sta.qack",
21227       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_q_ack_flag), 0x10,
21228       "QoS Ack", HFILL }},
21229
21230     {&hf_ieee80211_ff_qos_info_sta_max_sp_length,
21231      {"Max SP Length", "wlan_mgt.fixed.qosinfo.sta.max_sp_length",
21232       FT_UINT8, BASE_HEX, VALS(ff_qos_info_sta_max_sp_len_flags) , 0x60,
21233       NULL, HFILL }},
21234
21235     {&hf_ieee80211_ff_qos_info_sta_more_data_ack,
21236      {"More Data Ack", "wlan_mgt.fixed.qosinfo.sta.more_data_ack",
21237       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_more_data_ack_flag), 0x80,
21238       NULL, HFILL }},
21239
21240     {&hf_ieee80211_ff_sm_pwr_save,
21241      {"Spatial Multiplexing (SM) Power Control", "wlan_mgt.fixed.sm.powercontrol",
21242       FT_UINT8, BASE_HEX, NULL, 0,
21243       NULL, HFILL }},
21244
21245     {&hf_ieee80211_ff_sm_pwr_save_enabled,
21246      {"SM Power Save", "wlan_mgt.fixed.sm.powercontrol.enabled",
21247       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x01,
21248       "Spatial Multiplexing (SM) Power Save", HFILL }},
21249
21250     {&hf_ieee80211_ff_sm_pwr_save_sm_mode,
21251      {"SM Mode", "wlan_mgt.fixed.sm.powercontrol.mode",
21252       FT_BOOLEAN, 8, TFS (&ff_sm_pwr_save_sm_mode_flag), 0x02,
21253       "Spatial Multiplexing (SM) Mode", HFILL }},
21254
21255     {&hf_ieee80211_ff_sm_pwr_save_reserved,
21256      {"Reserved", "wlan_mgt.fixed.sm.powercontrol.reserved",
21257       FT_UINT8, BASE_HEX, NULL, 0xFC,
21258       NULL, HFILL }},
21259
21260     {&hf_ieee80211_ff_pco_phase_cntrl,
21261      {"Phased Coexistence Operation (PCO) Phase Control", "wlan_mgt.fixed.pco.phasecntrl",
21262       FT_BOOLEAN, BASE_NONE, TFS (&ff_pco_phase_cntrl_flag), 0x0,
21263       NULL, HFILL }},
21264
21265     {&hf_ieee80211_ff_psmp_param_set,
21266      {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan_mgt.fixed.psmp.paramset",
21267       FT_UINT16, BASE_HEX, 0, 0,
21268       NULL, HFILL }},
21269
21270     {&hf_ieee80211_ff_psmp_param_set_n_sta,
21271      {"Number of STA Info Fields Present", "wlan_mgt.fixed.psmp.paramset.nsta",
21272       FT_UINT16, BASE_HEX, 0, 0x000F,
21273       NULL, HFILL }},
21274
21275     {&hf_ieee80211_ff_psmp_param_set_more_psmp,
21276      {"More PSMP", "wlan_mgt.fixed.psmp.paramset.more",
21277       FT_BOOLEAN, 16, TFS(&ff_psmp_param_set_more_psmp_flag), 0x0010,
21278       "More Power Save Multi-Poll (PSMP)", HFILL }},
21279
21280     {&hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
21281      {"PSMP Sequence Duration [us]", "wlan_mgt.fixed.psmp.paramset.seqduration",
21282       FT_UINT16, BASE_DEC, 0, 0xFFE0,
21283       "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
21284
21285     {&hf_ieee80211_ff_mimo_cntrl,
21286      {"MIMO Control", "wlan_mgt.fixed.mimo.control",
21287       FT_BYTES, BASE_NONE, 0, 0x0,
21288       NULL, HFILL }},
21289
21290     {&hf_ieee80211_ff_mimo_cntrl_nc_index,
21291      {"Nc Index", "wlan_mgt.fixed.mimo.control.ncindex",
21292       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nc_index_flags), 0x0003,
21293       "Number of Columns Less One", HFILL }},
21294
21295     {&hf_ieee80211_ff_mimo_cntrl_nr_index,
21296      {"Nr Index", "wlan_mgt.fixed.mimo.control.nrindex",
21297       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nr_index_flags), 0x000C,
21298       "Number of Rows Less One", HFILL }},
21299
21300     {&hf_ieee80211_ff_mimo_cntrl_channel_width,
21301      {"Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
21302       FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010,
21303       NULL, HFILL }},
21304
21305     {&hf_ieee80211_ff_mimo_cntrl_grouping,
21306      {"Grouping (Ng)", "wlan_mgt.fixed.mimo.control.grouping",
21307       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_grouping_flags), 0x0060,
21308       NULL, HFILL }},
21309
21310     {&hf_ieee80211_ff_mimo_cntrl_coefficient_size,
21311      {"Coefficient Size (Nb)", "wlan_mgt.fixed.mimo.control.cosize",
21312       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_coefficient_size_flags), 0x0180,
21313       NULL, HFILL }},
21314
21315     {&hf_ieee80211_ff_mimo_cntrl_codebook_info,
21316      {"Codebook Information", "wlan_mgt.fixed.mimo.control.codebookinfo",
21317       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_codebook_info_flags), 0x0600,
21318       NULL, HFILL }},
21319
21320     {&hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
21321      {"Remaining Matrix Segment", "wlan_mgt.fixed.mimo.control.matrixseg",
21322       FT_UINT16, BASE_HEX, 0, 0x3800,
21323       NULL, HFILL }},
21324
21325     {&hf_ieee80211_ff_mimo_cntrl_reserved,
21326      {"Reserved", "wlan_mgt.fixed.mimo.control.reserved",
21327       FT_UINT16, BASE_HEX, 0, 0xC000,
21328       NULL, HFILL }},
21329
21330     {&hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
21331      {"Sounding Timestamp", "wlan_mgt.fixed.mimo.control.soundingtime",
21332       FT_UINT32, BASE_HEX, 0, 0,
21333       NULL, HFILL }},
21334
21335     {&hf_ieee80211_ff_psmp_sta_info,
21336      {"Power Save Multi-Poll (PSMP) Station Information", "wlan_mgt.fixed.psmp.stainfo",
21337       FT_UINT64, BASE_HEX, 0, 0,
21338       NULL, HFILL }},
21339
21340     {&hf_ieee80211_ff_psmp_sta_info_type,
21341      {"Sta Info Type", "wlan_mgt.fixed.psmp.stainfo.type",
21342       FT_UINT32, BASE_HEX, VALS(ff_psmp_sta_info_flags), PSMP_STA_INFO_FLAG_TYPE,
21343       NULL, HFILL }},
21344
21345     {&hf_ieee80211_ff_psmp_sta_info_dtt_start_offset,
21346      {"DTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.dttstart",
21347       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_START,
21348       NULL, HFILL }},
21349
21350     {&hf_ieee80211_ff_psmp_sta_info_dtt_duration,
21351      {"DTT Duration", "wlan_mgt.fixed.psmp.stainfo.dttduration",
21352       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_DURATION,
21353       NULL, HFILL }},
21354
21355     {&hf_ieee80211_ff_psmp_sta_info_sta_id,
21356      {"Target Station ID", "wlan_mgt.fixed.psmp.stainfo.staid",
21357       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_STA_ID,
21358       NULL, HFILL }},
21359
21360     {&hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
21361      {"UTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.uttstart",
21362       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_START,
21363       NULL, HFILL }},
21364
21365     {&hf_ieee80211_ff_psmp_sta_info_utt_duration,
21366      {"UTT Duration", "wlan_mgt.fixed.psmp.stainfo.uttduration",
21367       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_DURATION,
21368       NULL, HFILL }},
21369
21370     {&hf_ieee80211_ff_psmp_sta_info_reserved_small,
21371      {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
21372       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_IA_RESERVED,
21373       NULL, HFILL }},
21374
21375     {&hf_ieee80211_ff_psmp_sta_info_reserved_large,
21376      {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
21377       FT_UINT64, BASE_HEX, 0, 0,
21378       NULL, HFILL }},
21379
21380     {&hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
21381      {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan_mgt.fixed.psmp.stainfo.multicastid",
21382       FT_UINT64, BASE_HEX, 0, 0,
21383       NULL, HFILL }},
21384
21385     {&hf_ieee80211_ff_ant_selection,
21386      {"Antenna Selection", "wlan_mgt.fixed.antsel",
21387       FT_UINT8, BASE_HEX, 0, 0,
21388       NULL, HFILL }},
21389
21390     {&hf_ieee80211_ff_ant_selection_0,
21391      {"Antenna 0", "wlan_mgt.fixed.antsel.ant0",
21392       FT_UINT8, BASE_HEX, 0, 0x01,
21393       NULL, HFILL }},
21394
21395     {&hf_ieee80211_ff_ant_selection_1,
21396      {"Antenna 1", "wlan_mgt.fixed.antsel.ant1",
21397       FT_UINT8, BASE_HEX, 0, 0x02,
21398       NULL, HFILL }},
21399
21400     {&hf_ieee80211_ff_ant_selection_2,
21401      {"Antenna 2", "wlan_mgt.fixed.antsel.ant2",
21402       FT_UINT8, BASE_HEX, 0, 0x04,
21403       NULL, HFILL }},
21404
21405     {&hf_ieee80211_ff_ant_selection_3,
21406      {"Antenna 3", "wlan_mgt.fixed.antsel.ant3",
21407       FT_UINT8, BASE_HEX, 0, 0x08,
21408       NULL, HFILL }},
21409
21410     {&hf_ieee80211_ff_ant_selection_4,
21411      {"Antenna 4", "wlan_mgt.fixed.antsel.ant4",
21412       FT_UINT8, BASE_HEX, 0, 0x10,
21413       NULL, HFILL }},
21414
21415     {&hf_ieee80211_ff_ant_selection_5,
21416      {"Antenna 5", "wlan_mgt.fixed.antsel.ant5",
21417       FT_UINT8, BASE_HEX, 0, 0x20,
21418       NULL, HFILL }},
21419
21420     {&hf_ieee80211_ff_ant_selection_6,
21421      {"Antenna 6", "wlan_mgt.fixed.antsel.ant6",
21422       FT_UINT8, BASE_HEX, 0, 0x40,
21423       NULL, HFILL }},
21424
21425     {&hf_ieee80211_ff_ant_selection_7,
21426      {"Antenna 7", "wlan_mgt.fixed.antsel.ant7",
21427       FT_UINT8, BASE_HEX, 0, 0x80,
21428       NULL, HFILL }},
21429
21430     {&hf_ieee80211_ff_ext_channel_switch_announcement,
21431      {"Extended Channel Switch Announcement", "wlan_mgt.fixed.extchansw",
21432       FT_UINT32, BASE_HEX, 0, 0,
21433       NULL, HFILL }},
21434
21435     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
21436      {"Channel Switch Mode", "wlan_mgt.fixed.extchansw.switchmode",
21437       FT_UINT32, BASE_HEX, VALS(ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags), 0x000000FF,
21438       NULL, HFILL }},
21439
21440     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_ope_class,
21441      {"New Operating Class", "wlan_mgt.fixed.extchansw.new.opeclass",
21442       FT_UINT32, BASE_HEX, NULL, 0x0000FF00,
21443       NULL, HFILL }},
21444
21445     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
21446      {"New Channel Number", "wlan_mgt.fixed.extchansw.new.channumber",
21447       FT_UINT32, BASE_HEX, NULL, 0x00FF0000,
21448       NULL, HFILL }},
21449
21450     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
21451      {"Channel Switch Count", "wlan_mgt.extchanswitch.switchcount",
21452       FT_UINT32, BASE_HEX, NULL, 0xFF000000,
21453       NULL, HFILL }},
21454
21455     {&hf_ieee80211_ff_ht_info,
21456      {"HT Information", "wlan_mgt.fixed.extchansw",
21457       FT_UINT8, BASE_HEX, 0, 0,
21458       "HT Information Fixed Field", HFILL }},
21459
21460     {&hf_ieee80211_ff_ht_info_information_request,
21461      {"Information Request", "wlan_mgt.fixed.mimo.control.chanwidth",
21462       FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01,
21463       NULL, HFILL }},
21464
21465     {&hf_ieee80211_ff_ht_info_40_mhz_intolerant,
21466      {"40 MHz Intolerant", "wlan_mgt.fixed.mimo.control.chanwidth",
21467       FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02,
21468       NULL, HFILL }},
21469
21470     {&hf_ieee80211_ff_ht_info_sta_chan_width,
21471      {"Station Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
21472       FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04,
21473       NULL, HFILL }},
21474
21475     {&hf_ieee80211_ff_ht_info_reserved,
21476      {"Reserved", "wlan_mgt.fixed.extchansw",
21477       FT_UINT8, BASE_HEX, 0, 0xF8,
21478       "Reserved Field", HFILL }},
21479
21480     {&hf_ieee80211_ff_ht_action,
21481      {"HT Action", "wlan_mgt.fixed.htact",
21482       FT_UINT8, BASE_HEX, VALS(ff_ht_action_flags), 0,
21483       "HT Action Code", HFILL }},
21484
21485     {&hf_ieee80211_ff_mimo_csi_snr,
21486      {"Signal to Noise Ratio (SNR)", "wlan_mgt.mimo.csimatrices.snr",
21487       FT_UINT8, BASE_HEX, NULL, 0,
21488       NULL, HFILL }},
21489
21490     {&hf_ieee80211_ff_mimo_csi_matrices,
21491      {"CSI Matrices", "wlan_mgt.mimo.csimatrices",
21492       FT_NONE, BASE_NONE, NULL, 0,
21493       NULL, HFILL }},
21494
21495     {&hf_ieee80211_ff_mimo_csi_bf_matrices,
21496      {"Beamforming Feedback Matrices", "wlan_mgt.mimo.csimatrices.bf",
21497       FT_NONE, BASE_NONE, NULL, 0,
21498       NULL, HFILL }},
21499
21500     {&hf_ieee80211_ff_mimo_csi_cbf_matrices,
21501      {"Compressed Beamforming Feedback Matrices", "wlan_mgt.mimo.csimatrices.cbf",
21502       FT_NONE, BASE_NONE, NULL, 0,
21503       NULL, HFILL }},
21504     {&hf_ieee80211_ff_public_action,
21505      {"Public Action", "wlan_mgt.fixed.publicact",
21506       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_pa_action_codes_ext, 0,
21507       "Public Action Code", HFILL }},
21508
21509     {&hf_ieee80211_ff_protected_public_action,
21510      {"Protected Public Action", "wlan_mgt.fixed.publicact",
21511       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_ppa_action_codes_ext, 0,
21512       "Protected Public Action Code", HFILL }},
21513
21514     {&hf_ieee80211_ff_capture,
21515      {"Capabilities Information", "wlan_mgt.fixed.capabilities",
21516       FT_UINT16, BASE_HEX, NULL, 0,
21517       "Capability information", HFILL }},
21518
21519     {&hf_ieee80211_ff_cf_ess,
21520      {"ESS capabilities", "wlan_mgt.fixed.capabilities.ess",
21521       FT_BOOLEAN, 16, TFS (&cf_ess_flags), 0x0001,
21522       NULL, HFILL }},
21523
21524     {&hf_ieee80211_ff_cf_ibss,
21525      {"IBSS status", "wlan_mgt.fixed.capabilities.ibss",
21526       FT_BOOLEAN, 16, TFS(&cf_ibss_flags), 0x0002,
21527       "IBSS participation", HFILL }},
21528
21529     {&hf_ieee80211_ff_cf_sta_poll,
21530      {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.sta",
21531       FT_UINT16, BASE_HEX, VALS(sta_cf_pollable), 0x020C,
21532       "CF-Poll capabilities for a STA", HFILL }},
21533
21534     {&hf_ieee80211_ff_cf_ap_poll,
21535      {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.ap",
21536       FT_UINT16, BASE_HEX, VALS(ap_cf_pollable), 0x020C,
21537       "CF-Poll capabilities for an AP", HFILL }},
21538
21539     {&hf_ieee80211_ff_cf_privacy,
21540      {"Privacy", "wlan_mgt.fixed.capabilities.privacy",
21541       FT_BOOLEAN, 16, TFS(&cf_privacy_flags), 0x0010,
21542       "WEP support", HFILL }},
21543
21544     {&hf_ieee80211_ff_cf_preamble,
21545      {"Short Preamble", "wlan_mgt.fixed.capabilities.preamble",
21546       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0020,
21547       NULL, HFILL }},
21548
21549     {&hf_ieee80211_ff_cf_pbcc,
21550      {"PBCC", "wlan_mgt.fixed.capabilities.pbcc",
21551       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0040,
21552       "PBCC Modulation", HFILL }},
21553
21554     {&hf_ieee80211_ff_cf_agility,
21555      {"Channel Agility", "wlan_mgt.fixed.capabilities.agility",
21556       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0080,
21557       NULL, HFILL }},
21558
21559     {&hf_ieee80211_ff_cf_spec_man,
21560      {"Spectrum Management", "wlan_mgt.fixed.capabilities.spec_man",
21561       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0100,
21562       NULL, HFILL }},
21563
21564     {&hf_ieee80211_ff_short_slot_time,
21565      {"Short Slot Time", "wlan_mgt.fixed.capabilities.short_slot_time",
21566       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0400,
21567       NULL, HFILL }},
21568
21569     {&hf_ieee80211_ff_cf_apsd,
21570      {"Automatic Power Save Delivery", "wlan_mgt.fixed.capabilities.apsd",
21571       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0800,
21572       NULL, HFILL }},
21573
21574     {&hf_ieee80211_ff_radio_measurement,
21575      {"Radio Measurement", "wlan_mgt.fixed.capabilities.radio_measurement",
21576       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x1000,
21577       NULL, HFILL }},
21578
21579     {&hf_ieee80211_ff_dsss_ofdm,
21580      {"DSSS-OFDM", "wlan_mgt.fixed.capabilities.dsss_ofdm",
21581       FT_BOOLEAN, 16,  TFS(&tfs_allowed_not_allowed), 0x2000,
21582       "DSSS-OFDM Modulation", HFILL }},
21583
21584     {&hf_ieee80211_ff_cf_del_blk_ack,
21585      {"Delayed Block Ack", "wlan_mgt.fixed.capabilities.del_blk_ack",
21586       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x4000,
21587       NULL, HFILL }},
21588
21589     {&hf_ieee80211_ff_cf_imm_blk_ack,
21590      {"Immediate Block Ack", "wlan_mgt.fixed.capabilities.imm_blk_ack",
21591       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x8000,
21592       NULL, HFILL }},
21593
21594     {&hf_ieee80211_ff_auth_seq,
21595      {"Authentication SEQ", "wlan_mgt.fixed.auth_seq",
21596       FT_UINT16, BASE_HEX, NULL, 0,
21597       "Authentication Sequence Number", HFILL }},
21598
21599     {&hf_ieee80211_ff_assoc_id,
21600      {"Association ID", "wlan_mgt.fixed.aid",
21601       FT_UINT16, BASE_HEX, NULL, 0x3FFF,
21602       NULL, HFILL }},
21603
21604     {&hf_ieee80211_ff_listen_ival,
21605      {"Listen Interval", "wlan_mgt.fixed.listen_ival",
21606       FT_UINT16, BASE_HEX, NULL, 0,
21607       NULL, HFILL }},
21608
21609     {&hf_ieee80211_ff_current_ap,
21610      {"Current AP", "wlan_mgt.fixed.current_ap",
21611       FT_ETHER, BASE_NONE, NULL, 0,
21612       "MAC address of current AP", HFILL }},
21613
21614     {&hf_ieee80211_ff_reason,
21615      {"Reason code", "wlan_mgt.fixed.reason_code",
21616       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
21617       "Reason for unsolicited notification", HFILL }},
21618
21619     {&hf_ieee80211_ff_status_code,
21620      {"Status code", "wlan_mgt.fixed.status_code",
21621       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
21622       "Status of requested event", HFILL }},
21623
21624     {&hf_ieee80211_ff_category_code,
21625      {"Category code", "wlan_mgt.fixed.category_code",
21626       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &category_codes_ext, 0,
21627       "Management action category", HFILL }},
21628
21629     {&hf_ieee80211_ff_action_code,
21630      {"Action code", "wlan_mgt.fixed.action_code",
21631       FT_UINT16, BASE_DEC, VALS(action_codes), 0,
21632       "Management action code", HFILL }},
21633
21634     {&hf_ieee80211_ff_dialog_token,
21635      {"Dialog token", "wlan_mgt.fixed.dialog_token",
21636       FT_UINT8, BASE_HEX, NULL, 0,
21637       "Management action dialog token", HFILL }},
21638
21639     {&hf_ieee80211_ff_followup_dialog_token,
21640      {"Followup Dialog token", "wlan_mgt.fixed.followup_dialog_token",
21641       FT_UINT8, BASE_HEX, NULL, 0,
21642       "Management action followup dialog token", HFILL }},
21643
21644     {&hf_ieee80211_ff_marvell_action_type,
21645      {"Marvell Action type", "wlan_mgt.fixed.mrvl_action_type",
21646       FT_UINT8, BASE_DEC, VALS(vendor_action_types_mrvl), 0,
21647       "Vendor Specific Action Type (Marvell)", HFILL }},
21648
21649     {&hf_ieee80211_ff_marvell_mesh_mgt_action_code,
21650      {"Mesh action(Marvell)", "wlan_mgt.fixed.mrvl_mesh_action",
21651       FT_UINT8, BASE_HEX, VALS(mesh_mgt_action_codes_mrvl), 0,
21652       "Mesh action code(Marvell)", HFILL }},
21653
21654     {&hf_ieee80211_ff_marvell_mesh_mgt_length,
21655      {"Message Length", "wlan_mgt.fixed.length",
21656       FT_UINT8, BASE_DEC, NULL, 0,
21657       NULL, HFILL }},
21658
21659     {&hf_ieee80211_ff_marvell_mesh_mgt_mode,
21660      {"Message Mode", "wlan_mgt.fixed.mode",
21661       FT_UINT8, BASE_HEX, NULL, 0,
21662       NULL, HFILL }},
21663
21664     {&hf_ieee80211_ff_marvell_mesh_mgt_ttl,
21665      {"Message TTL", "wlan_mgt.fixed.ttl",
21666       FT_UINT8, BASE_DEC, NULL, 0,
21667       NULL, HFILL }},
21668
21669     {&hf_ieee80211_ff_marvell_mesh_mgt_dstcount,
21670      {"Destination Count", "wlan_mgt.fixed.dstcount",
21671       FT_UINT8, BASE_DEC, NULL, 0,
21672       NULL, HFILL }},
21673
21674     {&hf_ieee80211_ff_marvell_mesh_mgt_hopcount,
21675      {"Hop Count", "wlan_mgt.fixed.hopcount",
21676       FT_UINT8, BASE_DEC, NULL, 0,
21677       NULL, HFILL }},
21678
21679     {&hf_ieee80211_ff_marvell_mesh_mgt_rreqid,
21680      {"RREQ ID", "wlan_mgt.fixed.rreqid",
21681       FT_UINT32, BASE_DEC, NULL, 0,
21682       NULL, HFILL }},
21683
21684     {&hf_ieee80211_ff_marvell_mesh_mgt_sa,
21685      {"Source Address", "wlan_mgt.fixed.sa",
21686       FT_ETHER, BASE_NONE, NULL, 0,
21687       "Source MAC address", HFILL }},
21688
21689     {&hf_ieee80211_ff_marvell_mesh_mgt_ssn,
21690      {"SSN", "wlan_mgt.fixed.ssn",
21691       FT_UINT32, BASE_DEC, NULL, 0,
21692       "Source Sequence Number", HFILL }},
21693
21694     {&hf_ieee80211_ff_marvell_mesh_mgt_metric,
21695      {"Metric", "wlan_mgt.fixed.metric",
21696       FT_UINT32, BASE_DEC, NULL, 0,
21697       "Route Metric", HFILL }},
21698
21699     {&hf_ieee80211_ff_marvell_mesh_mgt_flags,
21700      {"RREQ Flags", "wlan_mgt.fixed.hopcount",
21701       FT_UINT8, BASE_HEX, NULL, 0,
21702       NULL, HFILL }},
21703
21704     {&hf_ieee80211_ff_marvell_mesh_mgt_da,
21705      {"Destination Address", "wlan_mgt.fixed.da",
21706       FT_ETHER, BASE_NONE, NULL, 0,
21707       "Destination MAC address", HFILL }},
21708
21709     {&hf_ieee80211_ff_marvell_mesh_mgt_dsn,
21710      {"DSN", "wlan_mgt.fixed.dsn",
21711       FT_UINT32, BASE_DEC, NULL, 0,
21712       "Destination Sequence Number", HFILL }},
21713
21714     {&hf_ieee80211_ff_marvell_mesh_mgt_lifetime,
21715      {"Lifetime", "wlan_mgt.fixed.lifetime",
21716       FT_UINT32, BASE_DEC, NULL, 0,
21717       "Route Lifetime", HFILL }},
21718
21719     {&hf_ieee80211_ff_wme_action_code,
21720      {"Action code", "wlan_mgt.fixed.action_code",
21721       FT_UINT16, BASE_HEX, VALS(wme_action_codes), 0,
21722       "Management notification action code", HFILL }},
21723
21724     {&hf_ieee80211_ff_wme_status_code,
21725      {"Status code", "wlan_mgt.fixed.status_code",
21726       FT_UINT16, BASE_HEX, VALS(wme_status_codes), 0,
21727       "Management notification setup response status code", HFILL }},
21728
21729     {&hf_ieee80211_ff_mesh_action,
21730      {"Mesh Action code", "wlan_mgt.fixed.mesh_action",
21731       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &mesh_action_ext, 0,
21732       NULL, HFILL }},
21733
21734     {&hf_ieee80211_ff_multihop_action,
21735      {"Multihop Action code", "wlan_mgt.fixed.multihop_action",
21736       FT_UINT8, BASE_HEX, VALS(multihop_action), 0,
21737       NULL, HFILL }},
21738
21739     {&hf_ieee80211_ff_mesh_flags,
21740      {"Mesh Flags", "wlan_mgt.fixed.mesh_flags",
21741       FT_UINT8, BASE_HEX, NULL, 0,
21742       NULL, HFILL }},
21743
21744     {&hf_ieee80211_ff_mesh_ttl,
21745      {"Mesh TTL", "wlan_mgt.fixed.mesh_ttl",
21746       FT_UINT8, BASE_HEX, NULL, 0,
21747       NULL, HFILL }},
21748
21749     {&hf_ieee80211_ff_mesh_sequence,
21750      {"Sequence Number", "wlan_mgt.fixed.mesh_sequence",
21751       FT_UINT32, BASE_HEX, NULL, 0,
21752       NULL, HFILL }},
21753
21754     {&hf_ieee80211_ff_mesh_addr4,
21755      {"Mesh Extended Address 4", "wlan_mgt.fixed.mesh_addr4",
21756       FT_ETHER, BASE_NONE, NULL, 0,
21757       NULL, HFILL }},
21758
21759     {&hf_ieee80211_ff_mesh_addr5,
21760      {"Mesh Extended Address 5", "wlan_mgt.fixed.mesh_addr5",
21761       FT_ETHER, BASE_NONE, NULL, 0,
21762       NULL, HFILL }},
21763
21764     {&hf_ieee80211_ff_mesh_addr6,
21765      {"Mesh Extended Address 6", "wlan_mgt.fixed.mesh_addr6",
21766       FT_ETHER, BASE_NONE, NULL, 0,
21767       NULL, HFILL }},
21768
21769     {&hf_ieee80211_ff_selfprot_action,
21770      {"Self-protected Action code", "wlan_mgt.fixed.selfprot_action",
21771       FT_UINT8, BASE_HEX, VALS(selfprot_action), 0,
21772       NULL, HFILL }},
21773
21774     {&hf_ieee80211_mesh_peering_proto,
21775      {"Mesh Peering Protocol ID", "wlan.peering.proto",
21776       FT_UINT16, BASE_HEX, VALS(mesh_peering_proto_ids), 0,
21777       NULL, HFILL }},
21778
21779     {&hf_ieee80211_mesh_peering_local_link_id,
21780      {"Local Link ID", "wlan.peering.local_id",
21781       FT_UINT16, BASE_HEX, NULL, 0,
21782       "Mesh Peering Management Local Link ID", HFILL }},
21783
21784     {&hf_ieee80211_mesh_peering_peer_link_id,
21785      {"Peer Link ID", "wlan.peering.peer_id",
21786       FT_UINT16, BASE_HEX, NULL, 0,
21787       "Mesh Peering Management Peer Link ID", HFILL }},
21788
21789     {&hf_ieee80211_ff_hwmp_flags,
21790      {"HWMP Flags", "wlan.hwmp.flags",
21791       FT_UINT8, BASE_HEX, NULL, 0,
21792       NULL, HFILL }},
21793
21794     {&hf_ieee80211_ff_hwmp_hopcount,
21795      {"HWMP Hop Count", "wlan.hwmp.hopcount",
21796       FT_UINT8, BASE_DEC, NULL, 0,
21797       NULL, HFILL }},
21798
21799     {&hf_ieee80211_ff_hwmp_ttl,
21800      {"HWMP TTL", "wlan.hwmp.ttl",
21801       FT_UINT8, BASE_DEC, NULL, 0,
21802       NULL, HFILL }},
21803
21804     {&hf_ieee80211_ff_hwmp_pdid,
21805      {"HWMP Path Discovery ID", "wlan.hwmp.pdid",
21806       FT_UINT32, BASE_DEC, NULL, 0,
21807       NULL, HFILL }},
21808
21809     {&hf_ieee80211_ff_hwmp_orig_sta,
21810      {"Originator STA Address", "wlan.hwmp.orig_sta",
21811       FT_ETHER, BASE_NONE, NULL, 0,
21812       NULL, HFILL }},
21813
21814     {&hf_ieee80211_ff_hwmp_orig_sn,
21815      {"HWMP Originator Sequence Number", "wlan.hwmp.orig_sn",
21816       FT_UINT32, BASE_DEC, NULL, 0,
21817       NULL, HFILL}},
21818
21819     {&hf_ieee80211_ff_hwmp_orig_ext,
21820      {"Originator External Address", "wlan.hwmp.orig_ext",
21821       FT_ETHER, BASE_NONE, NULL, 0,
21822       NULL, HFILL }},
21823
21824     {&hf_ieee80211_ff_hwmp_lifetime,
21825      {"HWMP Lifetime", "wlan.hwmp.lifetime",
21826       FT_UINT32, BASE_DEC, NULL, 0,
21827       NULL, HFILL }},
21828
21829     {&hf_ieee80211_ff_hwmp_metric,
21830      {"HWMP Metric", "wlan.hwmp.metric",
21831       FT_UINT32, BASE_DEC, NULL, 0,
21832       NULL, HFILL }},
21833
21834     {&hf_ieee80211_ff_hwmp_targ_count,
21835      {"HWMP Target Count", "wlan.hwmp.targ_count",
21836       FT_UINT8, BASE_DEC, NULL, 0,
21837       NULL, HFILL }},
21838
21839     {&hf_ieee80211_ff_hwmp_targ_flags,
21840      {"HWMP Per-Target Flags", "wlan.hwmp.targ_flags",
21841       FT_UINT8, BASE_HEX, NULL, 0,
21842       NULL, HFILL }},
21843
21844     {&hf_ieee80211_ff_hwmp_targ_to_flags,
21845      {"TO Flag", "wlan.hwmp.to_flag",
21846       FT_BOOLEAN, 8, TFS (&hwmp_targ_to_flags), 0x01,
21847       "Target Only Flag", HFILL }},
21848
21849     {&hf_ieee80211_ff_hwmp_targ_usn_flags,
21850      {"USN Flag", "wlan.hwmp.usn_flag",
21851       FT_BOOLEAN, 8, TFS (&hwmp_targ_usn_flags), 0x04,
21852       "Unknown Target HWMP Sequence Number Flag", HFILL }},
21853
21854     {&hf_ieee80211_ff_hwmp_targ_sta,
21855      {"Target STA Address", "wlan.hwmp.targ_sta",
21856       FT_ETHER, BASE_NONE, NULL, 0,
21857       NULL, HFILL }},
21858
21859     {&hf_ieee80211_ff_hwmp_targ_ext,
21860      {"Target External Address", "wlan.hwmp.targ_ext",
21861       FT_ETHER, BASE_NONE, NULL, 0,
21862       NULL, HFILL }},
21863
21864     {&hf_ieee80211_ff_hwmp_targ_sn,
21865      {"Target HWMP Sequence Number", "wlan.hwmp.targ_sn",
21866       FT_UINT32, BASE_DEC, NULL, 0,
21867       NULL, HFILL }},
21868
21869     {&hf_ieee80211_mesh_config_path_sel_protocol,
21870      {"Path Selection Protocol", "wlan.mesh.config.ps_protocol",
21871       FT_UINT8, BASE_HEX, NULL, 0,
21872       "Mesh Configuration Path Selection Protocol", HFILL }},
21873
21874     {&hf_ieee80211_mesh_config_path_sel_metric,
21875      {"Path Selection Metric", "wlan.mesh.config.ps_metric",
21876       FT_UINT8, BASE_HEX, NULL, 0,
21877       "Mesh Configuration Path Selection Metric", HFILL }},
21878
21879     {&hf_ieee80211_mesh_config_congestion_control,
21880      {"Congestion Control", "wlan.mesh.config.cong_ctl",
21881       FT_UINT8, BASE_HEX, NULL, 0,
21882       "Mesh Configuration Congestion Control", HFILL }},
21883
21884     {&hf_ieee80211_mesh_config_sync_method,
21885      {"Synchronization Method", "wlan.mesh.config.sync_method",
21886       FT_UINT8, BASE_HEX, NULL, 0,
21887       "Mesh Configuration Synchronization Method", HFILL }},
21888
21889     {&hf_ieee80211_mesh_config_auth_protocol,
21890      {"Authentication Protocol", "wlan.mesh.config.auth_protocol",
21891       FT_UINT8, BASE_HEX, NULL, 0,
21892       "Mesh Configuration Authentication Protocol", HFILL }},
21893
21894     {&hf_ieee80211_mesh_config_formation_info,
21895      {"Formation Info", "wlan.mesh.config.formation_info",
21896       FT_UINT8, BASE_HEX, NULL, 0,
21897       "Mesh Configuration Formation Info", HFILL }},
21898
21899     {&hf_ieee80211_mesh_form_info_num_of_peerings,
21900      {"Number of Peerings", "wlan.mesh.config.formation_info.num_peers",
21901       FT_UINT8, BASE_DEC, NULL, 0x7E,
21902       NULL, HFILL }},
21903
21904     {&hf_ieee80211_mesh_config_capability,
21905      {"Capability", "wlan.mesh.config.cap",
21906       FT_UINT8, BASE_HEX, NULL, 0,
21907       "Mesh Configuration Capability", HFILL }},
21908
21909     {&hf_ieee80211_mesh_config_cap_accepting,
21910      {"Accepting Additional Mesh Peerings", "wlan.mesh.config.cap.accept",
21911       FT_BOOLEAN, 8, TFS (&tfs_yes_no), 0x01,
21912       NULL, HFILL }},
21913
21914     {&hf_ieee80211_mesh_config_cap_mcca_support,
21915      {"MCCA Support", "wlan.mesh.config.cap.mcca_support",
21916       FT_BOOLEAN, 8, TFS (&tfs_yes_no), 0x02,
21917       NULL, HFILL }},
21918
21919     {&hf_ieee80211_mesh_config_cap_mcca_enabled,
21920      {"MCCA Enabled", "wlan.mesh.config.cap.mcca_enabled",
21921       FT_BOOLEAN, 8, TFS (&tfs_yes_no), 0x04,
21922       NULL, HFILL }},
21923
21924     {&hf_ieee80211_mesh_config_cap_forwarding,
21925      {"Mesh Forwarding", "wlan.mesh.config.cap.forwarding",
21926       FT_BOOLEAN, 8, TFS (&tfs_yes_no), 0x08,
21927       NULL, HFILL }},
21928
21929     {&hf_ieee80211_mesh_config_cap_mbca_enabled,
21930      {"MBCA Enabled", "wlan.mesh.config.cap.mbca_enabled",
21931       FT_BOOLEAN, 8, TFS (&tfs_yes_no), 0x10,
21932       NULL, HFILL }},
21933
21934     {&hf_ieee80211_mesh_config_cap_tbtt_adjusting,
21935      {"TBTT Adjustment", "wlan.mesh.config.cap.tbtt_adjusting",
21936       FT_BOOLEAN, 8, TFS (&tfs_yes_no), 0x20,
21937       NULL, HFILL }},
21938
21939     {&hf_ieee80211_mesh_config_cap_power_save_level,
21940      {"Power Save", "wlan.mesh.config.cap.power_save_level",
21941       FT_BOOLEAN, 8, TFS (&mesh_config_cap_power_save_level_flags), 0x40,
21942       NULL, HFILL }},
21943
21944     {&hf_ieee80211_mesh_id,
21945      {"Mesh ID", "wlan.mesh.id",
21946       FT_STRING, BASE_NONE, NULL, 0,
21947       NULL, HFILL }},
21948
21949     {&hf_ieee80211_rann_flags,
21950      {"RANN Flags", "wlan.rann.flags",
21951       FT_UINT8, BASE_HEX, NULL, 0,
21952       "Root Announcement Flags", HFILL }},
21953
21954     {&hf_ieee80211_rann_root_sta,
21955      {"Root STA Address", "wlan.rann.root_sta", FT_ETHER, BASE_NONE, NULL, 0,
21956       "Root Mesh STA Address", HFILL }},
21957
21958     {&hf_ieee80211_rann_sn,
21959      {"Root STA Sequence Number", "wlan.rann.rann_sn",
21960       FT_UINT32, BASE_DEC, NULL, 0,
21961       "Root Mesh STA Sequence Number", HFILL }},
21962
21963     {&hf_ieee80211_rann_interval,
21964      {"RANN Interval", "wlan.rann.interval",
21965       FT_UINT32, BASE_DEC, NULL, 0,
21966       "Root Announcement Interval", HFILL }},
21967
21968     {&hf_ieee80211_ff_qos_action_code,
21969      {"Action code", "wlan_mgt.fixed.action_code",
21970       FT_UINT16, BASE_HEX, VALS(qos_action_codes), 0,
21971       "QoS management action code", HFILL }},
21972
21973     {&hf_ieee80211_ff_ba_action,
21974      {"Action code", "wlan_mgt.fixed.action_code",
21975       FT_UINT8, BASE_HEX, VALS(ba_action_codes), 0,
21976       "Block Ack action code", HFILL }},
21977
21978     {&hf_ieee80211_ff_check_beacon,
21979      {"Check Beacon", "wlan_mgt.fixed.check_beacon",
21980       FT_UINT8, BASE_DEC, NULL, 0,
21981       "Unprotected WNM Check Beacon", HFILL }},
21982
21983     {&hf_ieee80211_ff_tod,
21984      {"TOD", "wlan_mgt.fixed.tod",
21985       FT_UINT32, BASE_DEC, NULL, 0,
21986       "Previous TS of transmit antenna port", HFILL }},
21987
21988     {&hf_ieee80211_ff_toa,
21989      {"TOA", "wlan_mgt.fixed.toa",
21990       FT_UINT32, BASE_DEC, NULL, 0,
21991       "Previous TS of receive antenna port", HFILL }},
21992
21993     {&hf_ieee80211_ff_max_tod_err,
21994      {"MAX TOD ERROR", "wlan_mgt.fixed.max_tod_err",
21995       FT_UINT8, BASE_DEC, NULL, 0,
21996       "Maximal Error at Previous TS of transmit antenna port", HFILL }},
21997
21998     {&hf_ieee80211_ff_max_toa_err,
21999      {"MAX TOA ERROR", "wlan_mgt.fixed.max_toa_err",
22000       FT_UINT8, BASE_DEC, NULL, 0,
22001       "Maximal Error at Previous TS of receive antenna port", HFILL }},
22002
22003     {&hf_ieee80211_ff_dls_action_code,
22004      {"Action code", "wlan_mgt.fixed.action_code",
22005       FT_UINT16, BASE_HEX, VALS(dls_action_codes), 0,
22006       "DLS management action code", HFILL }},
22007
22008     {&hf_ieee80211_ff_dst_mac_addr,
22009      {"Destination address", "wlan_mgt.fixed.dst_mac_addr",
22010       FT_ETHER, BASE_NONE, NULL, 0,
22011       "Destination MAC address", HFILL }},
22012
22013     {&hf_ieee80211_ff_src_mac_addr,
22014      {"Source address", "wlan_mgt.fixed.src_mac_addr",
22015       FT_ETHER, BASE_NONE, NULL, 0,
22016       "Source MAC address", HFILL }},
22017
22018     {&hf_ieee80211_ff_req_ap_addr,
22019      {"RequesterAP address", "wlan_mgt.fixed.req_ap_addr",
22020       FT_ETHER, BASE_NONE, NULL, 0,
22021       NULL, HFILL }},
22022
22023     {&hf_ieee80211_ff_res_ap_addr,
22024      {"ResponderAP address", "wlan_mgt.fixed.res_ap_addr",
22025       FT_ETHER, BASE_NONE, NULL, 0,
22026       NULL, HFILL }},
22027
22028     {&hf_ieee80211_ff_ft_action_code,
22029      {"Action code", "wlan_mgt.fixed.action_code",
22030       FT_UINT8, BASE_DEC, VALS(ft_action_codes), 0,
22031       "Management action code", HFILL }},
22032
22033     {&hf_ieee80211_ff_sta_address,
22034      {"STA Address", "wlan_mgt.fixed.sta_address",
22035       FT_ETHER, BASE_NONE, NULL, 0,
22036       NULL, HFILL }},
22037
22038     {&hf_ieee80211_ff_target_ap_address,
22039      {"Target AP Address", "wlan_mgt.fixed.target_ap_address",
22040       FT_ETHER, BASE_NONE, NULL, 0,
22041       "Target AP MAC address", HFILL }},
22042
22043     {&hf_ieee80211_ff_gas_comeback_delay,
22044      {"GAS Comeback Delay", "wlan_mgt.fixed.gas_comeback_delay",
22045       FT_UINT16, BASE_DEC, NULL, 0,
22046       NULL, HFILL }},
22047
22048     {&hf_ieee80211_ff_gas_fragment_id,
22049      {"GAS Query Response Fragment ID", "wlan_mgt.fixed.gas_fragment_id",
22050       FT_UINT8, BASE_DEC, NULL, 0x7f,
22051       NULL, HFILL }},
22052
22053     {&hf_ieee80211_ff_more_gas_fragments,
22054      {"More GAS Fragments", "wlan_mgt.fixed.more_gas_fragments",
22055       FT_UINT8, BASE_DEC, NULL, 0x80,
22056       NULL, HFILL }},
22057
22058     {&hf_ieee80211_ff_query_request_length,
22059      {"Query Request Length", "wlan_mgt.fixed.query_request_length",
22060       FT_UINT16, BASE_DEC, NULL, 0,
22061       NULL, HFILL }},
22062
22063     {&hf_ieee80211_ff_query_request,
22064      {"Query Request", "wlan_mgt.fixed.query_request",
22065       FT_BYTES, BASE_NONE, NULL, 0,
22066       NULL, HFILL }},
22067
22068     {&hf_ieee80211_ff_query_response_length,
22069      {"Query Response Length", "wlan_mgt.fixed.query_response_length",
22070       FT_UINT16, BASE_DEC, NULL, 0,
22071       NULL, HFILL }},
22072
22073     {&hf_ieee80211_ff_query_response,
22074      {"Query Response", "wlan_mgt.fixed.query_response",
22075       FT_BYTES, BASE_NONE, NULL, 0,
22076       NULL, HFILL }},
22077
22078     {&hf_ieee80211_gas_resp_fragments,
22079      {"GAS Query Response fragments", "wlan_mgt.fixed.fragments",
22080       FT_NONE, BASE_NONE, NULL, 0x00,
22081       NULL, HFILL } },
22082
22083     {&hf_ieee80211_gas_resp_fragment,
22084      {"GAS Query Response fragment", "wlan_mgt.fixed.fragment",
22085       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
22086       NULL, HFILL } },
22087
22088     {&hf_ieee80211_gas_resp_fragment_overlap,
22089      {"GAS Query Response fragment overlap", "wlan_mgt.fixed.fragment.overlap",
22090       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
22091       NULL, HFILL } },
22092
22093     {&hf_ieee80211_gas_resp_fragment_overlap_conflict,
22094      {"GAS Query Response fragment overlapping with conflicting data", "wlan_mgt.fixed.fragment.overlap.conflicts",
22095       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
22096       NULL, HFILL } },
22097
22098     {&hf_ieee80211_gas_resp_fragment_multiple_tails,
22099      {"GAS Query Response has multiple tail fragments",  "wlan_mgt.fixed.fragment.multiple_tails",
22100       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
22101       NULL, HFILL } },
22102
22103     {&hf_ieee80211_gas_resp_fragment_too_long_fragment,
22104      {"GAS Query Response fragment too long", "wlan_mgt.fixed.fragment.too_long_fragment",
22105       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
22106       NULL, HFILL } },
22107
22108     {&hf_ieee80211_gas_resp_fragment_error,
22109      {"GAS Query Response reassembly error", "wlan_mgt.fixed.fragment.error",
22110       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
22111       NULL, HFILL } },
22112
22113     {&hf_ieee80211_gas_resp_fragment_count,
22114      {"GAS Query Response fragment count", "wlan_mgt.fixed.fragment.count",
22115       FT_UINT32, BASE_DEC, NULL, 0x00,
22116       NULL, HFILL } },
22117
22118     {&hf_ieee80211_gas_resp_reassembled_in,
22119      {"Reassembled in", "wlan_mgt.fixed.reassembled.in",
22120       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
22121       NULL, HFILL } },
22122
22123     {&hf_ieee80211_gas_resp_reassembled_length,
22124      {"Reassembled length", "wlan_mgt.fixed.reassembled.length",
22125       FT_UINT32, BASE_DEC, NULL, 0x00,
22126       NULL, HFILL } },
22127
22128     {&hf_ieee80211_ff_anqp_info_id,
22129      {"Info ID", "wlan_mgt.fixed.anqp.info_id",
22130       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
22131       "Access Network Query Protocol Info ID", HFILL }},
22132
22133     {&hf_ieee80211_ff_anqp_info_length,
22134      {"Length", "wlan_mgt.fixed.anqp.info_length",
22135       FT_UINT16, BASE_DEC, NULL, 0,
22136       "Access Network Query Protocol Length", HFILL }},
22137
22138     {&hf_ieee80211_ff_anqp_info,
22139      {"Information", "wlan_mgt.fixed.anqp.info",
22140       FT_BYTES, BASE_NONE, NULL, 0,
22141       "Access Network Query Protocol Information", HFILL }},
22142
22143     {&hf_ieee80211_ff_anqp_query_id,
22144      {"ANQP Query ID", "wlan_mgt.fixed.anqp.query_id",
22145       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
22146       "Access Network Query Protocol Query ID", HFILL }},
22147
22148     {&hf_ieee80211_ff_anqp_capability,
22149      {"ANQP Capability", "wlan_mgt.fixed.anqp.capability",
22150       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
22151       "Access Network Query Protocol Query ID", HFILL }},
22152
22153     {&hf_ieee80211_ff_anqp_capability_vlen,
22154      {"Vendor-specific Capability Length", "wlan_mgt.fixed.anqp.capability_vlen",
22155       FT_UINT16, BASE_DEC, NULL, 0,
22156       NULL, HFILL }},
22157
22158     {&hf_ieee80211_ff_anqp_capability_vendor,
22159      {"Vendor-specific Capability", "wlan_mgt.fixed.anqp.capability_vendor",
22160       FT_BYTES, BASE_NONE, NULL, 0,
22161       NULL, HFILL }},
22162
22163     {&hf_ieee80211_ff_venue_info_group,
22164      {"Venue Group", "wlan_mgt.fixed.venue_info.group",
22165       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &venue_group_vals_ext, 0,
22166       NULL, HFILL }},
22167
22168     {&hf_ieee80211_ff_venue_info_type,
22169      {"Venue Type", "wlan_mgt.fixed.venue_info.type",
22170       FT_UINT8, BASE_DEC, NULL, 0,
22171       NULL, HFILL }},
22172
22173     {&hf_ieee80211_ff_anqp_venue_length,
22174      {"Venue Name Duple Length", "wlan_mgt.fixed.anqp.venue.length",
22175       FT_UINT8, BASE_DEC, NULL, 0,
22176       NULL, HFILL }},
22177
22178     {&hf_ieee80211_ff_anqp_venue_language,
22179      {"Language Code", "wlan_mgt.fixed.anqp.venue.language",
22180       FT_STRING, BASE_NONE, NULL, 0,
22181       "Venue Name Language Code", HFILL }},
22182
22183     {&hf_ieee80211_ff_anqp_venue_name,
22184      {"Venue Name", "wlan_mgt.fixed.anqp.venue.name",
22185       FT_STRING, BASE_NONE, NULL, 0,
22186       NULL, HFILL }},
22187
22188     {&hf_ieee80211_ff_anqp_nw_auth_type_indicator,
22189      {"Network Authentication Type Indicator", "wlan_mgt.fixed.anqp.nw_auth_type.indicator",
22190       FT_UINT8, BASE_DEC, VALS(nw_auth_type_vals), 0,
22191       NULL, HFILL }},
22192
22193     {&hf_ieee80211_ff_anqp_nw_auth_type_url_len,
22194      {"Re-direct URL Length", "wlan_mgt.fixed.anqp.nw_auth_type.url_len",
22195       FT_UINT16, BASE_DEC, NULL, 0,
22196       NULL, HFILL }},
22197
22198     {&hf_ieee80211_ff_anqp_nw_auth_type_url,
22199      {"Re-direct URL", "wlan_mgt.fixed.anqp.nw_auth_type_url",
22200       FT_STRING, BASE_NONE, NULL, 0,
22201       NULL, HFILL }},
22202
22203     {&hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
22204      {"OI Length", "wlan_mgt.fixed.anqp.roaming_consortium.oi_len",
22205       FT_UINT8, BASE_DEC, NULL, 0,
22206       "Roaming Consortium OI Length", HFILL }},
22207
22208     {&hf_ieee80211_ff_anqp_roaming_consortium_oi,
22209      {"OI", "wlan_mgt.fixed.anqp.roaming_consortium.oi",
22210       FT_BYTES, BASE_NONE, NULL, 0,
22211       "Roaming Consortium OI", HFILL }},
22212
22213     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
22214      {"IPv6 Address", "wlan_mgt.fixed.anqp.ip_addr_availability.ipv6",
22215       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv6_vals), 0x03,
22216       "IP Address Type Availability information for IPv6", HFILL }},
22217
22218     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
22219      {"IPv4 Address", "wlan_mgt.fixed.anqp.ip_addr_availability.ipv4",
22220       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv4_vals), 0xfc,
22221       "IP Address Type Availability information for IPv4", HFILL }},
22222
22223     {&hf_ieee80211_ff_anqp_nai_realm_count,
22224      {"NAI Realm Count", "wlan_mgt.fixed.anqp.nai_realm_list.count",
22225       FT_UINT16, BASE_DEC, NULL, 0,
22226       NULL, HFILL }},
22227
22228     {&hf_ieee80211_ff_anqp_nai_field_len,
22229      {"NAI Realm Data Field Length", "wlan_mgt.fixed.anqp.nai_realm_list.field_len",
22230       FT_UINT16, BASE_DEC, NULL, 0,
22231       NULL, HFILL }},
22232
22233     {&hf_ieee80211_ff_anqp_nai_realm_encoding,
22234      {"NAI Realm Encoding", "wlan_mgt.fixed.naqp_nai_realm_list.encoding",
22235       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals), 0x01,
22236       NULL, HFILL }},
22237
22238     {&hf_ieee80211_ff_anqp_nai_realm_length,
22239      {"NAI Realm Length", "wlan_mgt.fixed.naqp_nai_realm_list.realm_length",
22240       FT_UINT8, BASE_DEC, NULL, 0,
22241       NULL, HFILL }},
22242
22243     {&hf_ieee80211_ff_anqp_nai_realm,
22244      {"NAI Realm", "wlan_mgt.fixed.naqp_nai_realm_list.realm",
22245       FT_STRING, BASE_NONE, NULL, 0,
22246       NULL, HFILL }},
22247
22248     {&hf_ieee80211_ff_anqp_nai_realm_eap_count,
22249      {"EAP Method Count", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method_count",
22250       FT_UINT8, BASE_DEC, NULL, 0,
22251       NULL, HFILL }},
22252
22253     {&hf_ieee80211_ff_anqp_nai_realm_eap_len,
22254      {"EAP Method subfield Length", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method_len",
22255       FT_UINT8, BASE_DEC, NULL, 0,
22256       NULL, HFILL }},
22257
22258     {&hf_ieee80211_ff_anqp_nai_realm_eap_method,
22259      {"EAP Method", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method",
22260       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &eap_type_vals_ext, 0,
22261       NULL, HFILL }},
22262
22263     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
22264      {"Authentication Parameter Count", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_count",
22265       FT_UINT8, BASE_DEC, NULL, 0,
22266       NULL, HFILL }},
22267
22268     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
22269      {"Authentication Parameter ID", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_id",
22270       FT_UINT8, BASE_DEC, VALS(nai_realm_auth_param_id_vals), 0,
22271       NULL, HFILL }},
22272
22273     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
22274      {"Authentication Parameter Length", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_len",
22275       FT_UINT8, BASE_DEC, NULL, 0,
22276       NULL, HFILL }},
22277
22278     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
22279      {"Authentication Parameter Value", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_value",
22280       FT_BYTES, BASE_NONE, NULL, 0,
22281       NULL, HFILL }},
22282
22283     {&hf_ieee80211_3gpp_gc_gud,
22284      {"GUD", "wlan_mgt.fixed.anqp.3gpp_cellular_info.gud",
22285       FT_UINT8, BASE_DEC, NULL, 0,
22286       "Generic container User Data", HFILL }},
22287
22288     {&hf_ieee80211_3gpp_gc_udhl,
22289      {"UDHL", "wlan_mgt.fixed.anqp.3gpp_cellular_info.udhl",
22290       FT_UINT8, BASE_DEC, NULL, 0,
22291       "User Data Header Length", HFILL }},
22292
22293     {&hf_ieee80211_3gpp_gc_iei,
22294      {"IEI", "wlan_mgt.fixed.anqp.3gpp_cellular_info.iei",
22295       FT_UINT8, BASE_DEC, NULL, 0,
22296       "Information Element Identity", HFILL }},
22297
22298     {&hf_ieee80211_3gpp_gc_plmn_len,
22299      {"PLMN Length", "wlan_mgt.fixed.anqp.3gpp_cellular_info.plmn_len",
22300       FT_UINT8, BASE_DEC, NULL, 0,
22301       "Length of PLMN List value contents", HFILL }},
22302
22303     {&hf_ieee80211_3gpp_gc_num_plmns,
22304      {"Number of PLMNs", "wlan_mgt.fixed.anqp.3gpp_cellular_info.num_plmns",
22305       FT_UINT8, BASE_DEC, NULL, 0,
22306       NULL, HFILL }},
22307
22308     {&hf_ieee80211_ff_anqp_domain_name_len,
22309      {"Domain Name Length", "wlan_mgt.fixed.anqp.domain_name_list.len",
22310       FT_UINT8, BASE_DEC, NULL, 0,
22311       NULL, HFILL }},
22312
22313     {&hf_ieee80211_ff_anqp_domain_name,
22314      {"Domain Name", "wlan_mgt.fixed.anqp.domain_name_list.name",
22315       FT_STRING, BASE_NONE, NULL, 0,
22316       NULL, HFILL }},
22317
22318     {&hf_ieee80211_ff_dls_timeout,
22319      {"DLS timeout", "wlan_mgt.fixed.dls_timeout",
22320       FT_UINT16, BASE_HEX, NULL, 0,
22321       "DLS timeout value", HFILL }},
22322
22323     {&hf_ieee80211_ff_sa_query_action_code,
22324      {"Action code", "wlan_mgt.fixed.action_code",
22325       FT_UINT8, BASE_DEC, VALS(sa_query_action_codes), 0,
22326       "Management action code", HFILL }},
22327
22328     {&hf_ieee80211_ff_transaction_id,
22329      {"Transaction Id", "wlan_mgt.fixed.transaction_id",
22330       FT_UINT16, BASE_HEX, NULL, 0,
22331       NULL, HFILL }},
22332
22333     {&hf_ieee80211_anqp_wfa_subtype,
22334      {"ANQP WFA Subtype", "wlan_mgt.anqp.wfa.subtype",
22335       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }},
22336
22337     {&hf_hs20_indication_dgaf_disabled,
22338      {"DGAF Disabled", "wlan_mgt.hs20.indication.dgaf_disabled",
22339       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
22340
22341     {&hf_hs20_indication_pps_mo_id_present,
22342      {"PPS MO ID Present", "wlan_mgt.hs20.indication.pps_mo_id_present",
22343       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
22344
22345     {&hf_hs20_indication_anqp_domain_id_present,
22346      {"ANQP Domain ID Present", "wlan_mgt.hs20.indication.anqp_domain_id_present",
22347       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
22348
22349     {&hf_hs20_indication_release_number,
22350      {"Release Number", "wlan_mgt.hs20.indication.release_number",
22351       FT_UINT8, BASE_DEC, VALS(hs20_indication_release_number_vals), 0xF0, NULL, HFILL }},
22352
22353     {&hf_hs20_anqp_subtype,
22354      {"Subtype", "wlan_mgt.hs20.anqp.subtype",
22355       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
22356       "Hotspot 2.0 ANQP Subtype", HFILL }},
22357
22358     {&hf_hs20_anqp_reserved,
22359      {"Reserved", "wlan_mgt.hs20.anqp.reserved",
22360       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22361
22362     {&hf_hs20_anqp_payload,
22363      {"Payload", "wlan_mgt.hs20.anqp.payload",
22364       FT_BYTES, BASE_NONE, NULL, 0,
22365       "Hotspot 2.0 ANQP Payload", HFILL }},
22366
22367     {&hf_hs20_anqp_hs_query_list,
22368      {"Queried Subtype", "wlan_mgt.hs20.anqp.hs_query_list",
22369       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
22370       "Queried HS 2.0 Element Subtype", HFILL }},
22371
22372     {&hf_hs20_anqp_hs_capability_list,
22373      {"Capability", "wlan_mgt.hs20.anqp.hs_capability_list",
22374       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
22375       "Hotspot 2.0 ANQP Subtype Capability", HFILL }},
22376
22377     {&hf_hs20_anqp_ofn_length,
22378      {"Length", "wlan_mgt.hs20.anqp.ofn.length",
22379       FT_UINT8, BASE_DEC, NULL, 0,
22380       "Operator Friendly Name Length", HFILL }},
22381
22382     {&hf_hs20_anqp_ofn_language,
22383      {"Language Code", "wlan_mgt.hs20.anqp.ofn.language",
22384       FT_STRING, BASE_NONE, NULL, 0,
22385       "Operator Friendly Name Language Code", HFILL }},
22386
22387     {&hf_hs20_anqp_ofn_name,
22388      {"Operator Friendly Name", "wlan_mgt.hs20.anqp.ofn.name",
22389       FT_STRING, BASE_NONE, NULL, 0,
22390       NULL, HFILL }},
22391
22392     {&hf_hs20_anqp_wan_metrics_link_status,
22393      {"Link Status", "wlan_mgt.hs20.anqp.wan_metrics.link_status",
22394       FT_UINT8, BASE_DEC, VALS(hs20_wm_link_status_vals), 0x03, NULL, HFILL }},
22395
22396     {&hf_hs20_anqp_wan_metrics_symmetric_link,
22397      {"Symmetric Link", "wlan_mgt.hs20.anqp.wan_metrics.symmetric_link",
22398       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
22399
22400     {&hf_hs20_anqp_wan_metrics_at_capacity,
22401      {"At Capacity", "wlan_mgt.hs20.anqp.wan_metrics.at_capacity",
22402       FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
22403
22404     {&hf_hs20_anqp_wan_metrics_reserved,
22405      {"Reserved", "wlan_mgt.hs20.anqp.wan_metrics.reserved",
22406       FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }},
22407
22408     {&hf_hs20_anqp_wan_metrics_downlink_speed,
22409      {"Downlink Speed", "wlan_mgt.hs20.anqp.wan_metrics.downlink_speed",
22410       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
22411
22412     {&hf_hs20_anqp_wan_metrics_uplink_speed,
22413      {"Uplink Speed", "wlan_mgt.hs20.anqp.wan_metrics.uplink_speed",
22414       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
22415
22416     {&hf_hs20_anqp_wan_metrics_downlink_load,
22417      {"Downlink Load", "wlan_mgt.hs20.anqp.wan_metrics.downlink_load",
22418       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22419
22420     {&hf_hs20_anqp_wan_metrics_uplink_load,
22421      {"Uplink Load", "wlan_mgt.hs20.anqp.wan_metrics.uplink_load",
22422       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22423
22424     {&hf_hs20_anqp_wan_metrics_lmd,
22425      {"LMD", "wlan_mgt.hs20.anqp.wan_metrics.lmd",
22426       FT_UINT16, BASE_DEC, NULL, 0, "Load Measurement Duration", HFILL }},
22427
22428     {&hf_hs20_anqp_cc_proto_ip_proto,
22429      {"IP Protocol", "wlan_mgt.hs20.anqp.cc.ip_proto",
22430       FT_UINT8, BASE_DEC, NULL, 0,
22431       "ProtoPort Tuple - IP Protocol", HFILL }},
22432
22433     {&hf_hs20_anqp_cc_proto_port_num,
22434      {"Port Number", "wlan_mgt.hs20.anqp.cc.port_num",
22435       FT_UINT16, BASE_DEC, NULL, 0,
22436       "ProtoPort Tuple - Port Number", HFILL }},
22437
22438     {&hf_hs20_anqp_cc_proto_status,
22439      {"Status", "wlan_mgt.hs20.anqp.cc.status",
22440       FT_UINT8, BASE_DEC, VALS(hs20_cc_status_vals), 0,
22441       "ProtoPort Tuple - Status", HFILL }},
22442
22443     {&hf_hs20_anqp_nai_hrq_count,
22444      {"NAI Home Realm Count", "wlan_mgt.hs20.anqp.nai_hrq.count",
22445       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22446
22447     {&hf_hs20_anqp_nai_hrq_encoding_type,
22448      {"NAI Home Realm Encoding Type",
22449       "wlan_mgt.hs20.anqp.nai_hrq.encoding_type",
22450       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals),
22451       0x01, NULL, HFILL }},
22452
22453     {&hf_hs20_anqp_nai_hrq_length,
22454      {"NAI Home Realm Name Length", "wlan_mgt.hs20.anqp.nai_hrq.length",
22455       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22456
22457     {&hf_hs20_anqp_nai_hrq_realm_name,
22458      {"NAI Home Realm Name", "wlan_mgt.hs20.anqp.nai_hrq.name",
22459       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
22460
22461     {&hf_hs20_anqp_oper_class_indic,
22462      {"Operating Class", "wlan_mgt.hs20.anqp.oper_class_indic.oper_class",
22463       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
22464
22465     {&hf_ieee80211_tag,
22466      {"Tag", "wlan_mgt.tag",
22467       FT_NONE, BASE_NONE, 0x0, 0,
22468       NULL, HFILL }},
22469
22470     {&hf_ieee80211_tag_number,
22471      {"Tag Number", "wlan_mgt.tag.number",
22472       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
22473       "Element ID", HFILL }},
22474
22475     {&hf_ieee80211_tag_length,
22476      {"Tag length", "wlan_mgt.tag.length",
22477       FT_UINT32, BASE_DEC, NULL, 0,
22478       "Length of tag", HFILL }},
22479
22480     {&hf_ieee80211_tag_interpretation,
22481      {"Tag interpretation", "wlan_mgt.tag.interpretation",
22482       FT_STRING, BASE_NONE, NULL, 0,
22483       "Interpretation of tag", HFILL }},
22484
22485     {&hf_ieee80211_tag_data,
22486      {"Tag Data", "wlan_mgt.tag.data",
22487       FT_BYTES, BASE_NONE, NULL, 0,
22488       "Data Interpretation of tag", HFILL }},
22489
22490     {&hf_ieee80211_tag_oui,
22491      {"OUI", "wlan_mgt.tag.oui",
22492       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
22493       "OUI of vendor specific IE", HFILL }},
22494
22495     {&hf_ieee80211_tag_oui_wfa_subtype,
22496      {"WFA Subtype", "wlan_mgt.tag.oui.wfa_subtype",
22497       FT_UINT8, BASE_DEC, NULL, 0,
22498       NULL, HFILL }},
22499
22500     {&hf_ieee80211_tag_ds_param_channel,
22501      {"Current Channel", "wlan_mgt.ds.current_channel",
22502       FT_UINT8, BASE_DEC, NULL, 0,
22503       "DS Parameter Set - Current Channel", HFILL }},
22504
22505     {&hf_ieee80211_tag_cfp_count,
22506      {"CFP Count", "wlan_mgt.cfp.count",
22507       FT_UINT8, BASE_DEC, NULL, 0,
22508       "Indicates how many delivery traffic indication messages (DTIMs)", HFILL }},
22509
22510     {&hf_ieee80211_tag_cfp_period,
22511      {"CFP Period", "wlan_mgt.cfp.period",
22512       FT_UINT8, BASE_DEC, NULL, 0,
22513       "Indicates the number of DTIM intervals between the start of CFPs", HFILL }},
22514
22515     {&hf_ieee80211_tag_cfp_max_duration,
22516      {"CFP Max Duration", "wlan_mgt.cfp.max_duration",
22517       FT_UINT16, BASE_DEC, NULL, 0,
22518       "Indicates the maximum duration (in TU) of the CFP that may be generated by this PCF", HFILL }},
22519
22520     {&hf_ieee80211_tag_cfp_dur_remaining,
22521      {"CFP Dur Remaining", "wlan_mgt.cfp.dur_remaining",
22522       FT_UINT16, BASE_DEC, NULL, 0,
22523       "Indicates the maximum time (in TU) remaining in the present CFP", HFILL }},
22524
22525     {&hf_ieee80211_tag_vendor_oui_type,
22526      {"Vendor Specific OUI Type", "wlan_mgt.tag.vendor.oui.type",
22527       FT_UINT8, BASE_DEC, NULL, 0,
22528       NULL, HFILL }},
22529
22530     {&hf_ieee80211_tag_vendor_data,
22531      {"Vendor Specific Data", "wlan_mgt.tag.vendor.data",
22532       FT_BYTES, BASE_NONE, NULL, 0,
22533       "Unknown/undecoded Vendor Specific Data", HFILL }},
22534
22535     {&hf_ieee80211_tim_dtim_count,
22536      {"DTIM count", "wlan_mgt.tim.dtim_count",
22537       FT_UINT8, BASE_DEC, NULL, 0,
22538       "Indicates how many Beacon frames (including the current frame) appear before the next DTIM", HFILL }},
22539
22540     {&hf_ieee80211_tim_dtim_period,
22541      {"DTIM period", "wlan_mgt.tim.dtim_period",
22542       FT_UINT8, BASE_DEC, NULL, 0,
22543       "Indicates the number of beacon intervals between successive DTIMs", HFILL }},
22544
22545     {&hf_ieee80211_tim_bmapctl,
22546      {"Bitmap control", "wlan_mgt.tim.bmapctl",
22547       FT_UINT8, BASE_HEX, NULL, 0,
22548       NULL, HFILL }},
22549
22550     {&hf_ieee80211_tim_bmapctl_mcast,
22551      {"Multicast", "wlan_mgt.tim.bmapctl.multicast",
22552       FT_BOOLEAN, 8, NULL, 0x1,
22553       "Contains the Traffic Indicator bit associated with Association ID 0", HFILL }},
22554
22555     {&hf_ieee80211_tim_bmapctl_offset,
22556      {"Bitmap Offset", "wlan_mgt.tim.bmapctl.offset",
22557       FT_UINT8, BASE_HEX, NULL, 0xFE,
22558       NULL, HFILL }},
22559
22560     {&hf_ieee80211_tim_partial_virtual_bitmap,
22561      {"Partial Virtual Bitmap", "wlan_mgt.tim.partial_virtual_bitmap",
22562       FT_BYTES, BASE_NONE, NULL, 0x0,
22563       NULL, HFILL }},
22564
22565     {&hf_ieee80211_tag_ibss_atim_window,
22566      {"Atim Windows", "wlan_mgt.ibss.atim_windows",
22567       FT_UINT16, BASE_HEX, NULL, 0x0,
22568       "Contains the ATIM Window length in TU", HFILL }},
22569
22570     {&hf_ieee80211_tag_country_info_code,
22571      {"Code", "wlan_mgt.country_info.code",
22572       FT_STRING, BASE_NONE, NULL, 0x0,
22573       NULL, HFILL }},
22574
22575     {&hf_ieee80211_tag_country_info_env,
22576      {"Environment", "wlan_mgt.country_info.environment",
22577       FT_UINT8, BASE_HEX, VALS(environment_vals), 0x0,
22578       NULL, HFILL }},
22579
22580     {&hf_ieee80211_tag_country_info_pad,
22581      {"Padding", "wlan_mgt.country_info.padding",
22582       FT_BYTES, BASE_NONE, NULL, 0x0,
22583       NULL, HFILL }},
22584
22585     {&hf_ieee80211_tag_country_info_fnm,
22586      {"Country Info", "wlan_mgt.country_info.fnm",
22587       FT_NONE, BASE_NONE, NULL, 0x0,
22588       NULL, HFILL }},
22589
22590     {&hf_ieee80211_tag_country_info_fnm_fcn,
22591      {"First Channel Number", "wlan_mgt.country_info.fnm.fcn",
22592       FT_UINT8, BASE_DEC, NULL, 0x0,
22593       NULL, HFILL }},
22594
22595     {&hf_ieee80211_tag_country_info_fnm_nc,
22596      {"Number of Channels", "wlan_mgt.country_info.fnm.nc",
22597       FT_UINT8, BASE_DEC, NULL, 0x0,
22598       NULL, HFILL }},
22599
22600     {&hf_ieee80211_tag_country_info_fnm_mtpl,
22601      {"Maximum Transmit Power Level (in dBm)", "wlan_mgt.country_info.fnm.mtpl",
22602       FT_UINT8, BASE_DEC, NULL, 0x0,
22603       NULL, HFILL }},
22604
22605     {&hf_ieee80211_tag_country_info_rrc,
22606      {"Country Info", "wlan_mgt.country_info.rrc",
22607       FT_NONE, BASE_NONE, NULL, 0x0,
22608       NULL, HFILL }},
22609
22610     {&hf_ieee80211_tag_country_info_rrc_oei,
22611      {"Operating Extension Identifier", "wlan_mgt.country_info.rrc.oei",
22612       FT_UINT8, BASE_DEC, NULL, 0x0,
22613       NULL, HFILL }},
22614
22615     {&hf_ieee80211_tag_country_info_rrc_oc,
22616      {"Operating Class", "wlan_mgt.country_info.rrc.oc",
22617       FT_UINT8, BASE_DEC, NULL, 0x0,
22618       NULL, HFILL }},
22619
22620     {&hf_ieee80211_tag_country_info_rrc_cc,
22621      {"Coverage Class", "wlan_mgt.country_info.rrc.cc",
22622       FT_UINT8, BASE_DEC, NULL, 0x0,
22623       NULL, HFILL }},
22624
22625     {&hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
22626      {"Prime Radix", "wlan_mgt.fh_hopping.parameter.prime_radix",
22627       FT_UINT8, BASE_DEC, NULL, 0x0,
22628       NULL, HFILL }},
22629
22630     {&hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
22631      {"Number of Channels", "wlan_mgt.fh_hopping.parameter.nb_channels",
22632       FT_UINT8, BASE_DEC, NULL, 0x0,
22633       NULL, HFILL }},
22634
22635     {&hf_ieee80211_tag_fh_hopping_table_flag,
22636      {"Flag", "wlan_mgt.fh_hopping.table.flag",
22637       FT_UINT8, BASE_HEX, NULL, 0x0,
22638       "Indicates that a Random Table is present when the value is 1", HFILL }},
22639
22640     {&hf_ieee80211_tag_fh_hopping_table_number_of_sets,
22641      {"Number of Sets", "wlan_mgt.fh_hopping.table.number_of_sets",
22642       FT_UINT8, BASE_DEC, NULL, 0x0,
22643       "Indicates the total number of sets within the hopping patterns", HFILL }},
22644
22645     {&hf_ieee80211_tag_fh_hopping_table_modulus,
22646      {"Modulus", "wlan_mgt.fh_hopping.table.modulus",
22647       FT_UINT8, BASE_HEX, NULL, 0x0,
22648       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
22649
22650     {&hf_ieee80211_tag_fh_hopping_table_offset,
22651      {"Offset", "wlan_mgt.fh_hopping.table.offset",
22652       FT_UINT8, BASE_HEX, NULL, 0x0,
22653       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
22654
22655     {&hf_ieee80211_tag_fh_hopping_random_table,
22656      {"Random Table", "wlan_mgt.fh_hopping.table.random_table",
22657       FT_UINT16, BASE_HEX, NULL, 0x0,
22658       "It is a vector of single octet values that indicate the random sequence to be followed during a hopping sequence", HFILL }},
22659
22660     {&hf_ieee80211_tag_request,
22661      {"Requested Element ID", "wlan_mgt.tag.request",
22662       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
22663       "The list of elements that are to be included in the responding STA Probe Response frame", HFILL }},
22664
22665     {&hf_ieee80211_tclas_up,
22666      {"User Priority", "wlan_mgt.tclas.user_priority",
22667       FT_UINT8, BASE_DEC, NULL, 0,
22668       "Contains the value of the UP of the associated MSDUs", HFILL }},
22669
22670     {&hf_ieee80211_tclas_class_type,
22671      {"Classifier Type", "wlan_mgt.tclas.class_type",
22672       FT_UINT8, BASE_DEC, VALS (classifier_type), 0,
22673       "Specifies the type of classifier parameters", HFILL }},
22674
22675     {&hf_ieee80211_tclas_class_mask,
22676      {"Classifier Mask", "wlan_mgt.tclas.class_mask",
22677       FT_UINT8, BASE_HEX,  NULL, 0,
22678       "Specifies a bitmap where bits that are set to 1 identify a subset of the classifier parameters", HFILL }},
22679
22680     {&hf_ieee80211_tclas_class_mask0_src_addr,
22681      {"Source Address", "wlan_mgt.tclas.class_mask.src_addr",
22682       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
22683
22684     {&hf_ieee80211_tclas_class_mask0_dst_addr,
22685      {"Destination Address", "wlan_mgt.tclas.class_mask.dst_addr",
22686       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
22687
22688     {&hf_ieee80211_tclas_class_mask0_type,
22689      {"Type", "wlan_mgt.tclas.class_mask.type",
22690       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
22691
22692     {&hf_ieee80211_tclas_class_mask1_ver,
22693      {"Version", "wlan_mgt.tclas.class_mask.version",
22694       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
22695
22696     {&hf_ieee80211_tclas_class_mask1_src_ip,
22697      {"Source IP Address", "wlan_mgt.tclas.class_mask.src_ip",
22698       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
22699
22700     {&hf_ieee80211_tclas_class_mask1_dst_ip,
22701      {"Destination IP Address", "wlan_mgt.tclas.class_mask.dst_ip",
22702       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
22703
22704     {&hf_ieee80211_tclas_class_mask1_src_port,
22705      {"Source Port", "wlan_mgt.tclas.class_mask.src_port",
22706       FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL }},
22707
22708     {&hf_ieee80211_tclas_class_mask1_dst_port,
22709      {"Destination Port", "wlan_mgt.tclas.class_mask.dst_port",
22710       FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL }},
22711
22712     {&hf_ieee80211_tclas_class_mask1_ipv4_dscp,
22713      {"DSCP", "wlan_mgt.tclas.class_mask.dscp",
22714       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
22715
22716     {&hf_ieee80211_tclas_class_mask1_ipv4_proto,
22717      {"Protocol", "wlan_mgt.tclas.class_mask.proto",
22718       FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL }},
22719
22720     {&hf_ieee80211_tclas_class_mask1_ipv6_flow,
22721      {"Flow Label", "wlan_mgt.tclas.class_mask.flow_label",
22722       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
22723
22724     {&hf_ieee80211_tclas_class_mask2_tci,
22725      {"802.1Q CLAN TCI", "wlan_mgt.tclas.class_mask.tci",
22726       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
22727
22728     {&hf_ieee80211_tclas_src_mac_addr,
22729      {"Source address", "wlan_mgt.tclas.src_mac_addr",
22730       FT_ETHER, BASE_NONE, NULL, 0,
22731       "Classifier Parameters Ethernet Type", HFILL }},
22732
22733     {&hf_ieee80211_tclas_dst_mac_addr,
22734      {"Destination address", "wlan_mgt.tclas.dat_mac_addr",
22735       FT_ETHER, BASE_NONE, NULL, 0,
22736       NULL, HFILL }},
22737
22738     {&hf_ieee80211_tclas_ether_type,
22739      {"Ethernet Type", "wlan_mgt.tclas.ether_type",
22740       FT_UINT8, BASE_DEC, NULL, 0,
22741       NULL, HFILL }},
22742
22743     {&hf_ieee80211_tclas_version,
22744      {"IP Version", "wlan_mgt.tclas.version",
22745       FT_UINT8, BASE_DEC, NULL, 0,
22746       NULL, HFILL }},
22747
22748     {&hf_ieee80211_tclas_ipv4_src,
22749      {"IPv4 Src Addr", "wlan_mgt.tclas.ipv4_src",
22750       FT_IPv4, BASE_NONE, NULL, 0,
22751       NULL, HFILL }},
22752
22753     {&hf_ieee80211_tclas_ipv4_dst,
22754      {"IPv4 Dst Addr", "wlan_mgt.tclas.ipv4_dst",
22755       FT_IPv4, BASE_NONE, NULL, 0,
22756       NULL, HFILL }},
22757
22758     {&hf_ieee80211_tclas_src_port,
22759      {"Source Port", "wlan_mgt.tclas.src_port",
22760       FT_UINT16, BASE_DEC, NULL, 0,
22761       NULL, HFILL }},
22762
22763     {&hf_ieee80211_tclas_dst_port,
22764      {"Destination Port", "wlan_mgt.tclas.dst_port",
22765       FT_UINT16, BASE_DEC, NULL, 0,
22766       NULL, HFILL }},
22767
22768     {&hf_ieee80211_tclas_dscp,
22769      {"IPv4 DSCP", "wlan_mgt.tclas.dscp",
22770       FT_UINT8, BASE_HEX, NULL, 0,
22771       "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
22772
22773     {&hf_ieee80211_tclas_protocol,
22774      {"Protocol", "wlan_mgt.tclas.protocol",
22775       FT_UINT8, BASE_HEX, NULL, 0,
22776       "IPv4 Protocol", HFILL }},
22777
22778     {&hf_ieee80211_tclas_ipv6_src,
22779      {"IPv6 Src Addr", "wlan_mgt.tclas.ipv6_src",
22780       FT_IPv6, BASE_NONE, NULL, 0,
22781       NULL, HFILL }},
22782
22783     {&hf_ieee80211_tclas_ipv6_dst,
22784      {"IPv6 Dst Addr", "wlan_mgt.tclas.ipv6_dst",
22785       FT_IPv6, BASE_NONE, NULL, 0,
22786       NULL, HFILL }},
22787
22788     {&hf_ieee80211_tclas_flow,
22789      {"Flow Label", "wlan_mgt.tclas.flow",
22790       FT_UINT24, BASE_HEX, NULL, 0,
22791       "IPv6 Flow Label", HFILL }},
22792
22793     {&hf_ieee80211_tclas_tag_type,
22794      {"802.1Q Tag Type", "wlan_mgt.tclas.tag_type",
22795       FT_UINT16, BASE_HEX, NULL, 0,
22796       NULL, HFILL }},
22797
22798     {&hf_ieee80211_tag_challenge_text,
22799      {"Challenge Text", "wlan_mgt.tag.challenge_text",
22800       FT_BYTES, BASE_NONE, NULL, 0,
22801       NULL, HFILL }},
22802
22803     {&hf_ieee80211_rsn_version,
22804      {"RSN Version", "wlan_mgt.rsn.version",
22805       FT_UINT16, BASE_DEC, NULL, 0,
22806       "Indicates the version number of the RSNA protocol", HFILL }},
22807
22808     {&hf_ieee80211_rsn_gcs,
22809      {"Group Cipher Suite", "wlan_mgt.rsn.gcs",
22810       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gcs_base_custom), 0,
22811       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
22812
22813     {&hf_ieee80211_rsn_gcs_oui,
22814      {"Group Cipher Suite OUI", "wlan_mgt.rsn.gcs.oui",
22815       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
22816       NULL, HFILL }},
22817
22818     {&hf_ieee80211_rsn_gcs_type,
22819      {"Group Cipher Suite type", "wlan_mgt.rsn.gcs.type",
22820       FT_UINT8, BASE_DEC, NULL, 0,
22821       NULL, HFILL }},
22822
22823     {&hf_ieee80211_rsn_gcs_80211_type,
22824      {"Group Cipher Suite type", "wlan_mgt.rsn.gcs.type",
22825       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
22826       NULL, HFILL }},
22827
22828     {&hf_ieee80211_rsn_pcs_count,
22829      {"Pairwise Cipher Suite Count", "wlan_mgt.rsn.pcs.count",
22830       FT_UINT16, BASE_DEC,  NULL, 0,
22831       "Indicates the number of pairwise cipher suite selectors that are contained in the Pairwise Cipher Suite List", HFILL }},
22832
22833     {&hf_ieee80211_rsn_pcs_list,
22834      {"Pairwise Cipher Suite List", "wlan_mgt.rsn.pcs.list",
22835       FT_NONE, BASE_NONE, NULL, 0,
22836       "Contains a series of cipher suite selectors that indicate the pairwisecipher suites", HFILL }},
22837
22838     {&hf_ieee80211_rsn_pcs,
22839      {"Pairwise Cipher Suite", "wlan_mgt.rsn.pcs",
22840       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_pcs_base_custom), 0,
22841       NULL, HFILL }},
22842
22843     {&hf_ieee80211_rsn_pcs_oui,
22844      {"Pairwise Cipher Suite OUI", "wlan_mgt.rsn.pcs.oui",
22845       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
22846       NULL, HFILL }},
22847
22848     {&hf_ieee80211_rsn_pcs_type,
22849      {"Pairwise Cipher Suite type", "wlan_mgt.rsn.pcs.type",
22850       FT_UINT8, BASE_DEC, NULL, 0,
22851       NULL, HFILL }},
22852
22853     {&hf_ieee80211_rsn_pcs_80211_type,
22854      {"Pairwise Cipher Suite type", "wlan_mgt.rsn.pcs.type",
22855       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
22856       NULL, HFILL }},
22857
22858     {&hf_ieee80211_rsn_akms_count,
22859      {"Auth Key Management (AKM) Suite Count", "wlan_mgt.rsn.akms.count",
22860       FT_UINT16, BASE_DEC, NULL, 0,
22861       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
22862
22863     {&hf_ieee80211_rsn_akms_list,
22864      {"Auth Key Management (AKM) List", "wlan_mgt.rsn.akms.list",
22865       FT_NONE, BASE_NONE, NULL, 0,
22866       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
22867
22868     {&hf_ieee80211_rsn_akms,
22869      {"Auth Key Management (AKM) Suite", "wlan_mgt.rsn.akms",
22870       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_akms_base_custom), 0,
22871       NULL, HFILL }},
22872
22873     {&hf_ieee80211_rsn_akms_oui,
22874      {"Auth Key Management (AKM) OUI", "wlan_mgt.rsn.akms.oui",
22875       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
22876       NULL, HFILL }},
22877
22878     {&hf_ieee80211_rsn_akms_type,
22879      {"Auth Key Management (AKM) type", "wlan_mgt.rsn.akms.type",
22880       FT_UINT8, BASE_DEC, NULL, 0,
22881       NULL, HFILL }},
22882
22883     {&hf_ieee80211_rsn_akms_80211_type,
22884      {"Auth Key Management (AKM) type", "wlan_mgt.rsn.akms.type",
22885       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_keymgmt_vals), 0,
22886       NULL, HFILL }},
22887
22888     {&hf_ieee80211_rsn_cap,
22889      {"RSN Capabilities", "wlan_mgt.rsn.capabilities",
22890       FT_UINT16, BASE_HEX, NULL, 0,
22891       "RSN Capability information", HFILL }},
22892
22893     {&hf_ieee80211_rsn_cap_preauth,
22894      {"RSN Pre-Auth capabilities", "wlan_mgt.rsn.capabilities.preauth",
22895       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001,
22896       NULL, HFILL }},
22897
22898     {&hf_ieee80211_rsn_cap_no_pairwise,
22899      {"RSN No Pairwise capabilities", "wlan_mgt.rsn.capabilities.no_pairwise",
22900       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002,
22901       NULL, HFILL }},
22902
22903     {&hf_ieee80211_rsn_cap_ptksa_replay_counter,
22904      {"RSN PTKSA Replay Counter capabilities", "wlan_mgt.rsn.capabilities.ptksa_replay_counter",
22905       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C,
22906       NULL, HFILL }},
22907
22908     {&hf_ieee80211_rsn_cap_gtksa_replay_counter,
22909      {"RSN GTKSA Replay Counter capabilities", "wlan_mgt.rsn.capabilities.gtksa_replay_counter",
22910       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030,
22911       NULL, HFILL }},
22912
22913     {&hf_ieee80211_rsn_cap_mfpr,
22914      {"Management Frame Protection Required", "wlan_mgt.rsn.capabilities.mfpr",
22915       FT_BOOLEAN, 16, NULL, 0x0040,
22916       NULL, HFILL }},
22917
22918     {&hf_ieee80211_rsn_cap_mfpc,
22919      {"Management Frame Protection Capable", "wlan_mgt.rsn.capabilities.mfpc",
22920       FT_BOOLEAN, 16, NULL, 0x0080,
22921       NULL, HFILL }},
22922
22923     {&hf_ieee80211_rsn_cap_jmr,
22924      {"Joint Multi-band RSNA", "wlan_mgt.rsn.capabilities.jmr",
22925       FT_BOOLEAN, 16, NULL, 0x0100,
22926       NULL, HFILL }},
22927
22928     {&hf_ieee80211_rsn_cap_peerkey,
22929      {"PeerKey Enabled", "wlan_mgt.rsn.capabilities.peerkey",
22930       FT_BOOLEAN, 16, NULL, 0x0200,
22931       NULL, HFILL }},
22932
22933     {&hf_ieee80211_rsn_pmkid_count,
22934      {"PMKID Count", "wlan_mgt.rsn.pmkid.count",
22935       FT_UINT16, BASE_DEC, NULL, 0,
22936       "Indicates the number of PMKID  selectors that are contained in the PMKID Suite List", HFILL }},
22937
22938     {&hf_ieee80211_rsn_pmkid_list,
22939      {"PMKID List", "wlan_mgt.rsn.pmkid.list",
22940       FT_NONE, BASE_NONE, NULL, 0,
22941       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
22942
22943     {&hf_ieee80211_rsn_pmkid,
22944      {"PMKID", "wlan_mgt.pmkid.akms",
22945       FT_BYTES, BASE_NONE, NULL, 0,
22946       NULL, HFILL }},
22947
22948     {&hf_ieee80211_rsn_gmcs,
22949      {"Group Management Cipher Suite", "wlan_mgt.rsn.gmcs",
22950       FT_UINT32, BASE_CUSTOM, CF_FUNC(rsn_gmcs_base_custom), 0,
22951       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
22952
22953     {&hf_ieee80211_rsn_gmcs_oui,
22954      {"Group Management Cipher Suite OUI", "wlan_mgt.rsn.gmcs.oui",
22955       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
22956       NULL, HFILL }},
22957
22958     {&hf_ieee80211_rsn_gmcs_type,
22959      {"Group Management Cipher Suite type", "wlan_mgt.rsn.gmcs.type",
22960       FT_UINT8, BASE_DEC, NULL, 0,
22961       NULL, HFILL }},
22962
22963     {&hf_ieee80211_rsn_gmcs_80211_type,
22964      {"Group Management Cipher Suite type", "wlan_mgt.rsn.gmcs.type",
22965       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
22966       NULL, HFILL }},
22967
22968     {&hf_ieee80211_ht_pren_type,
22969      {"802.11n (Pre) Type", "wlan_mgt.vs.pren.type",
22970       FT_UINT8, BASE_DEC, VALS(ieee80211_ht_pren_type_vals), 0,
22971       "Vendor Specific HT Type", HFILL }},
22972     {&hf_ieee80211_ht_pren_unknown,
22973      {"802.11n (Pre) Unknown Data", "wlan_mgt.vs.pren.unknown_data",
22974       FT_BYTES, BASE_NONE, NULL, 0,
22975       NULL, HFILL }},
22976
22977     {&hf_ieee80211_ht_cap,
22978      {"HT Capabilities Info", "wlan_mgt.ht.capabilities",
22979       FT_UINT16, BASE_HEX, NULL, 0,
22980       "HT Capabilities information", HFILL }},
22981
22982     {&hf_ieee80211_ht_vs_cap,
22983      {"HT Capabilities Info (VS)", "wlan_mgt.vs.ht.capabilities",
22984       FT_UINT16, BASE_HEX, NULL, 0,
22985       "Vendor Specific HT Capabilities information", HFILL }},
22986
22987     {&hf_ieee80211_ht_ldpc_coding,
22988      {"HT LDPC coding capability", "wlan_mgt.ht.capabilities.ldpccoding",
22989       FT_BOOLEAN, 16, TFS (&ht_ldpc_coding_flag), 0x0001,
22990       NULL, HFILL }},
22991
22992     {&hf_ieee80211_ht_chan_width,
22993      {"HT Support channel width", "wlan_mgt.ht.capabilities.width",
22994       FT_BOOLEAN, 16, TFS (&ht_chan_width_flag), 0x0002,
22995       NULL, HFILL }},
22996
22997     {&hf_ieee80211_ht_sm_pwsave,
22998      {"HT SM Power Save", "wlan_mgt.ht.capabilities.sm",
22999       FT_UINT16, BASE_HEX, VALS(ht_sm_pwsave_flag), 0x000c,
23000       NULL, HFILL }},
23001
23002     {&hf_ieee80211_ht_green,
23003      {"HT Green Field", "wlan_mgt.ht.capabilities.green",
23004       FT_BOOLEAN, 16, TFS (&ht_green_flag), 0x0010,
23005       NULL, HFILL }},
23006
23007     {&hf_ieee80211_ht_short20,
23008      {"HT Short GI for 20MHz", "wlan_mgt.ht.capabilities.short20",
23009       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0020,
23010       NULL, HFILL }},
23011
23012     {&hf_ieee80211_ht_short40,
23013      {"HT Short GI for 40MHz", "wlan_mgt.ht.capabilities.short40",
23014       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0040,
23015       NULL, HFILL }},
23016
23017     {&hf_ieee80211_ht_tx_stbc,
23018      {"HT Tx STBC", "wlan_mgt.ht.capabilities.txstbc",
23019       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0080,
23020       NULL, HFILL }},
23021
23022     {&hf_ieee80211_ht_rx_stbc,
23023      {"HT Rx STBC", "wlan_mgt.ht.capabilities.rxstbc",
23024       FT_UINT16, BASE_HEX, VALS(ht_rx_stbc_flag), 0x0300,
23025       "HT Tx STBC", HFILL }},
23026
23027     {&hf_ieee80211_ht_delayed_block_ack,
23028      {"HT Delayed Block ACK", "wlan_mgt.ht.capabilities.delayedblockack",
23029       FT_BOOLEAN, 16, TFS (&ht_delayed_block_ack_flag), 0x0400,
23030       NULL, HFILL }},
23031
23032     {&hf_ieee80211_ht_max_amsdu,
23033      {"HT Max A-MSDU length", "wlan_mgt.ht.capabilities.amsdu",
23034       FT_BOOLEAN, 16, TFS (&ht_max_amsdu_flag), 0x0800,
23035       NULL, HFILL }},
23036
23037     {&hf_ieee80211_ht_dss_cck_40,
23038      {"HT DSSS/CCK mode in 40MHz", "wlan_mgt.ht.capabilities.dsscck",
23039       FT_BOOLEAN, 16, TFS (&ht_dss_cck_40_flag), 0x1000,
23040       "HT DSS/CCK mode in 40MHz", HFILL }},
23041
23042     {&hf_ieee80211_ht_psmp,
23043      {"HT PSMP Support", "wlan_mgt.ht.capabilities.psmp",
23044       FT_BOOLEAN, 16, TFS (&ht_psmp_flag), 0x2000,
23045       NULL, HFILL }},
23046
23047     {&hf_ieee80211_ht_40_mhz_intolerant,
23048      {"HT Forty MHz Intolerant", "wlan_mgt.ht.capabilities.40mhzintolerant",
23049       FT_BOOLEAN, 16, TFS (&ht_40_mhz_intolerant_flag), 0x4000,
23050       NULL, HFILL }},
23051
23052     {&hf_ieee80211_ht_l_sig,
23053      {"HT L-SIG TXOP Protection support", "wlan_mgt.ht.capabilities.lsig",
23054       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x8000,
23055       NULL, HFILL }},
23056
23057     {&hf_ieee80211_ext_bss_mu_mimo_capable_sta_count,
23058      {"MU-MIMO Capable STA Count", "wlan_mgt.ext_bss.mu_mimo_capable_sta_count",
23059       FT_UINT16, BASE_DEC, NULL, 0,
23060       NULL, HFILL }},
23061
23062     {&hf_ieee80211_ext_bss_ss_underutilization,
23063      {"Spatial Stream Underutilization", "wlan_mgt.ext_bss.ss_underutilization",
23064       FT_UINT8, BASE_HEX, NULL, 0,
23065       NULL, HFILL }},
23066
23067     {&hf_ieee80211_ext_bss_observable_sec_20mhz_utilization,
23068      {"Observable Secondary 20MHz Utilization", "wlan_mgt.ext_bss.observable_sec_20mhz_utilization",
23069       FT_UINT8, BASE_HEX, NULL, 0,
23070       NULL, HFILL }},
23071
23072     {&hf_ieee80211_ext_bss_observable_sec_40mhz_utilization,
23073      {"Observable Secondary 40MHz Utilization", "wlan_mgt.ext_bss.observable_sec_40mhz_utilization",
23074       FT_UINT8, BASE_HEX, NULL, 0,
23075       NULL, HFILL }},
23076
23077     {&hf_ieee80211_ext_bss_observable_sec_80mhz_utilization,
23078      {"Observable Secondary 80MHz Utilization", "wlan_mgt.ext_bss.observable_sec_80mhz_utilization",
23079       FT_UINT8, BASE_HEX, NULL, 0,
23080       NULL, HFILL }},
23081
23082     {&hf_ieee80211_wide_bw_new_channel_width,
23083      {"New Channel Width", "wlan_mgt.wide_bw.new_channel_width",
23084       FT_UINT8, BASE_HEX, VALS(vht_operation_info_channel_width), 0x0,
23085       NULL, HFILL }},
23086
23087     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment0,
23088      {"New Channel Center Frequency Segment 0", "wlan_mgt.wide_bw.new_channel_center_freq_segment0",
23089       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
23090       NULL, HFILL }},
23091
23092     {&hf_ieee80211_wide_bw_new_channel_center_freq_segment1,
23093      {"New Channel Center Frequency Segment 1", "wlan_mgt.wide_bw.new_channel_center_freq_segment1",
23094       FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
23095       NULL, HFILL }},
23096
23097     {&hf_ieee80211_operat_notification_mode,
23098      {"Operating Mode Notification", "wlan_mgt.operat_notification_mode",
23099       FT_UINT8, BASE_HEX, NULL, 0x0,
23100       NULL, HFILL }},
23101
23102     {&hf_ieee80211_operat_mode_field_channel_width,
23103      {"Channel Width", "wlan_mgt.operat_mode_field.channelwidth",
23104       FT_UINT8, BASE_HEX, VALS (&operating_mode_field_channel_width), 0x03,
23105       NULL, HFILL }},
23106
23107     {&hf_ieee80211_operat_mode_field_reserved,
23108      {"Reserved", "wlan_mgt.operat_mode_field.reserved",
23109       FT_UINT8, BASE_HEX, NULL, 0x0C,
23110       NULL, HFILL }},
23111
23112     {&hf_ieee80211_operat_mode_field_rxnss,
23113      {"Rx NSS", "wlan_mgt.operat_mode_field.rxnss",
23114       FT_UINT8, BASE_HEX, VALS (&operat_mode_field_rxnss), 0x70,
23115       NULL, HFILL }},
23116
23117     {&hf_ieee80211_operat_mode_field_rxnsstype,
23118      {"Rx NSS Type", "wlan_mgt.operat_mode_field.rxnsstype",
23119       FT_UINT8, BASE_HEX, NULL, 0x80,
23120       "Indicate that the Rx NSS subfield carries the maximum number of spatial streams that the STA can receive", HFILL }},
23121
23122     {&hf_ieee80211_ampduparam,
23123      {"A-MPDU Parameters", "wlan_mgt.ht.ampduparam",
23124       FT_UINT8, BASE_HEX, NULL, 0,
23125       NULL, HFILL }},
23126
23127     {&hf_ieee80211_ampduparam_vs,
23128      {"A-MPDU Parameters (VS)", "wlan_mgt.vs.ht.ampduparam",
23129       FT_UINT8, BASE_HEX, NULL, 0,
23130       "Vendor Specific A-MPDU Parameters", HFILL }},
23131
23132     {&hf_ieee80211_ampduparam_mpdu,
23133      {"Maximum Rx A-MPDU Length", "wlan_mgt.ht.ampduparam.maxlength",
23134       FT_UINT8, BASE_HEX, 0, 0x03,
23135       NULL, HFILL }},
23136
23137     {&hf_ieee80211_ampduparam_mpdu_start_spacing,
23138      {"MPDU Density", "wlan_mgt.ht.ampduparam.mpdudensity",
23139       FT_UINT8, BASE_HEX, VALS(ampduparam_mpdu_start_spacing_flags), 0x1c,
23140       NULL, HFILL }},
23141
23142     {&hf_ieee80211_ampduparam_reserved,
23143      {"Reserved", "wlan_mgt.ht.ampduparam.reserved",
23144       FT_UINT8, BASE_HEX, NULL, 0xE0,
23145       NULL, HFILL }},
23146
23147     {&hf_ieee80211_mcsset,
23148      {"Rx Supported Modulation and Coding Scheme Set", "wlan_mgt.ht.mcsset",
23149       FT_STRING, BASE_NONE, NULL, 0,
23150       NULL, HFILL }},
23151
23152     {&hf_ieee80211_mcsset_vs,
23153      {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan_mgt.vs.ht.mcsset",
23154       FT_STRING, BASE_NONE, NULL, 0,
23155       "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
23156
23157     {&hf_ieee80211_mcsset_rx_bitmask,
23158      {"Rx Modulation and Coding Scheme (One bit per modulation)", "wlan_mgt.ht.mcsset.rxbitmask",
23159       FT_NONE, BASE_NONE, NULL, 0,
23160       "One bit per modulation", HFILL }},
23161
23162     {&hf_ieee80211_mcsset_rx_bitmask_0to7,
23163      {"Rx Bitmask Bits 0-7", "wlan_mgt.ht.mcsset.rxbitmask.0to7",
23164       FT_UINT32, BASE_HEX, 0, 0x000000ff,
23165       NULL, HFILL }},
23166
23167     {&hf_ieee80211_mcsset_rx_bitmask_8to15,
23168      {"Rx Bitmask Bits 8-15", "wlan_mgt.ht.mcsset.rxbitmask.8to15",
23169       FT_UINT32, BASE_HEX, 0, 0x0000ff00,
23170       NULL, HFILL }},
23171
23172     {&hf_ieee80211_mcsset_rx_bitmask_16to23,
23173      {"Rx Bitmask Bits 16-23", "wlan_mgt.ht.mcsset.rxbitmask.16to23",
23174       FT_UINT32, BASE_HEX, 0, 0x00ff0000,
23175       NULL, HFILL }},
23176
23177     {&hf_ieee80211_mcsset_rx_bitmask_24to31,
23178      {"Rx Bitmask Bits 24-31", "wlan_mgt.ht.mcsset.rxbitmask.24to31",
23179       FT_UINT32, BASE_HEX, 0, 0xff000000,
23180       NULL, HFILL }},
23181
23182     {&hf_ieee80211_mcsset_rx_bitmask_32,
23183      {"Rx Bitmask Bit 32", "wlan_mgt.ht.mcsset.rxbitmask.32",
23184       FT_UINT32, BASE_HEX, 0, 0x000001,
23185       NULL, HFILL }},
23186
23187     {&hf_ieee80211_mcsset_rx_bitmask_33to38,
23188      {"Rx Bitmask Bits 33-38", "wlan_mgt.ht.mcsset.rxbitmask.33to38",
23189       FT_UINT32, BASE_HEX, 0, 0x00007e,
23190       NULL, HFILL }},
23191
23192     {&hf_ieee80211_mcsset_rx_bitmask_39to52,
23193      {"Rx Bitmask Bits 39-52", "wlan_mgt.ht.mcsset.rxbitmask.39to52",
23194       FT_UINT32, BASE_HEX, 0, 0x1fff80,
23195       NULL, HFILL }},
23196
23197     {&hf_ieee80211_mcsset_rx_bitmask_53to76,
23198      {"Rx Bitmask Bits 53-76", "wlan_mgt.ht.mcsset.rxbitmask.53to76",
23199       FT_UINT32, BASE_HEX, 0, 0x1fffffe0,
23200       NULL, HFILL }},
23201
23202     {&hf_ieee80211_mcsset_highest_data_rate,
23203      {"Highest Supported Data Rate", "wlan_mgt.ht.mcsset.highestdatarate",
23204       FT_UINT16, BASE_HEX, 0, 0x03ff,
23205       NULL, HFILL }},
23206
23207     {&hf_ieee80211_mcsset_tx_mcs_set_defined,
23208      {"Tx Supported MCS Set", "wlan_mgt.ht.mcsset.txsetdefined",
23209       FT_BOOLEAN, 16, TFS (&tfs_defined_not_defined), 0x0001,
23210       NULL, HFILL }},
23211
23212     {&hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal,
23213      {"Tx and Rx MCS Set", "wlan_mgt.ht.mcsset.txrxmcsnotequal",
23214       FT_BOOLEAN, 16, TFS (&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
23215       NULL, HFILL }},
23216
23217     {&hf_ieee80211_mcsset_tx_max_spatial_streams,
23218      {"Maximum Number of Tx Spatial Streams Supported", "wlan_mgt.ht.mcsset.txmaxss",
23219       FT_UINT16, BASE_HEX, 0 , 0x000c,
23220       NULL, HFILL }},
23221
23222     {&hf_ieee80211_mcsset_tx_unequal_modulation,
23223      {"Unequal Modulation", "wlan_mgt.ht.mcsset.txunequalmod",
23224       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0010,
23225       NULL, HFILL }},
23226
23227     {&hf_ieee80211_htex_cap,
23228      {"HT Extended Capabilities", "wlan_mgt.htex.capabilities",
23229       FT_UINT16, BASE_HEX, NULL, 0,
23230       "HT Extended Capability information", HFILL }},
23231
23232     {&hf_ieee80211_htex_vs_cap,
23233      {"HT Extended Capabilities (VS)", "wlan_mgt.vs.htex.capabilities",
23234       FT_UINT16, BASE_HEX, NULL, 0,
23235       "Vendor Specific HT Extended Capability information", HFILL }},
23236
23237     {&hf_ieee80211_htex_pco,
23238      {"Transmitter supports PCO", "wlan_mgt.htex.capabilities.pco",
23239       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0001,
23240       NULL, HFILL }},
23241
23242     {&hf_ieee80211_htex_transtime,
23243      {"Time needed to transition between 20MHz and 40MHz", "wlan_mgt.htex.capabilities.transtime",
23244       FT_UINT16, BASE_HEX, VALS(htex_transtime_flags), 0x0006,
23245       NULL, HFILL }},
23246
23247     {&hf_ieee80211_htex_mcs,
23248      {"MCS Feedback capability", "wlan_mgt.htex.capabilities.mcs",
23249       FT_UINT16, BASE_HEX, VALS(htex_mcs_flags), 0x0300,
23250       NULL, HFILL }},
23251
23252     {&hf_ieee80211_htex_htc_support,
23253      {"High Throughput", "wlan_mgt.htex.capabilities.htc",
23254       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0400,
23255       NULL, HFILL }},
23256
23257     {&hf_ieee80211_htex_rd_responder,
23258      {"Reverse Direction Responder", "wlan_mgt.htex.capabilities.rdresponder",
23259       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0800,
23260       NULL, HFILL }},
23261
23262     {&hf_ieee80211_txbf,
23263      {"Transmit Beam Forming (TxBF) Capabilities", "wlan_mgt.txbf",
23264       FT_UINT32, BASE_HEX, NULL, 0,
23265       NULL, HFILL }},
23266
23267     {&hf_ieee80211_txbf_vs,
23268      {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan_mgt.vs.txbf",
23269       FT_UINT32, BASE_HEX, NULL, 0,
23270       "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
23271
23272     {&hf_ieee80211_txbf_cap,
23273      {"Transmit Beamforming", "wlan_mgt.txbf.txbf",
23274       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000001,
23275       NULL, HFILL }},
23276
23277     {&hf_ieee80211_txbf_rcv_ssc,
23278      {"Receive Staggered Sounding", "wlan_mgt.txbf.rxss",
23279       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000002,
23280       NULL, HFILL }},
23281
23282     {&hf_ieee80211_txbf_tx_ssc,
23283      {"Transmit Staggered Sounding", "wlan_mgt.txbf.txss",
23284       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000004,
23285       NULL, HFILL }},
23286
23287     {&hf_ieee80211_txbf_rcv_ndp,
23288      {"Receive Null Data packet (NDP)", "wlan_mgt.txbf.rxndp",
23289       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000008,
23290       NULL, HFILL }},
23291
23292     {&hf_ieee80211_txbf_tx_ndp,
23293      {"Transmit Null Data packet (NDP)", "wlan_mgt.txbf.txndp",
23294       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000010,
23295       NULL, HFILL }},
23296
23297     {&hf_ieee80211_txbf_impl_txbf,
23298      {"Implicit TxBF capable", "wlan_mgt.txbf.impltxbf",
23299       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000020,
23300       "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
23301
23302     {&hf_ieee80211_txbf_calib,
23303      {"Calibration", "wlan_mgt.txbf.calibration",
23304       FT_UINT32, BASE_HEX, VALS(txbf_calib_flag), 0x000000c0,
23305       NULL, HFILL }},
23306
23307     {&hf_ieee80211_txbf_expl_csi,
23308      {"STA can apply TxBF using CSI explicit feedback", "wlan_mgt.txbf.csi",
23309       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000100,
23310       "Station can apply TxBF using CSI explicit feedback", HFILL }},
23311
23312     {&hf_ieee80211_txbf_expl_uncomp_fm,
23313      {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan_mgt.txbf.fm.uncompressed.tbf",
23314       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000200,
23315       "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
23316
23317     {&hf_ieee80211_txbf_expl_comp_fm,
23318      {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan_mgt.txbf.fm.compressed.tbf",
23319       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000400,
23320       "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
23321
23322     {&hf_ieee80211_txbf_expl_bf_csi,
23323      {"Receiver can return explicit CSI feedback", "wlan_mgt.txbf.rcsi",
23324       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00001800,
23325       NULL, HFILL }},
23326
23327     {&hf_ieee80211_txbf_expl_uncomp_fm_feed,
23328      {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.uncompressed.rbf",
23329       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00006000,
23330       NULL, HFILL }},
23331
23332     {&hf_ieee80211_txbf_expl_comp_fm_feed,
23333      {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.compressed.bf",
23334       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00018000,
23335       "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
23336
23337     {&hf_ieee80211_txbf_min_group,
23338      {"Minimal grouping used for explicit feedback reports", "wlan_mgt.txbf.mingroup",
23339       FT_UINT32, BASE_HEX, VALS(txbf_min_group_flags), 0x00060000,
23340       NULL, HFILL }},
23341
23342     {&hf_ieee80211_vht_cap,
23343      {"VHT Capabilities Info", "wlan_mgt.vht.capabilities",
23344       FT_UINT32, BASE_HEX, NULL, 0,
23345       "VHT Capabilities information", HFILL }},
23346
23347     {&hf_ieee80211_vht_max_mpdu_length,
23348      {"Maximum MPDU Length", "wlan_mgt.vht.capabilities.maxmpdulength",
23349       FT_UINT32, BASE_HEX, VALS(vht_max_mpdu_length_flag), 0x00000003,
23350       "In Octets unit", HFILL }},
23351
23352     {&hf_ieee80211_vht_supported_chan_width_set,
23353      {"Supported Channel Width Set", "wlan_mgt.vht.capabilities.supportedchanwidthset",
23354       FT_UINT32, BASE_HEX, VALS(vht_supported_chan_width_set_flag), 0x0000000c,
23355       NULL, HFILL }},
23356
23357     {&hf_ieee80211_vht_rx_ldpc,
23358      {"Rx LDPC", "wlan_mgt.vht.capabilities.rxldpc",
23359       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000010,
23360       NULL, HFILL }},
23361
23362     {&hf_ieee80211_vht_short_gi_for_80,
23363      {"Short GI for 80MHz", "wlan_mgt.vht.capabilities.short80",
23364       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000020,
23365       NULL, HFILL }},
23366
23367     {&hf_ieee80211_vht_short_gi_for_160,
23368      {"Short GI for 160MHz and 80+80MHz", "wlan_mgt.vht.capabilities.short160",
23369       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000040,
23370       NULL, HFILL }},
23371
23372     {&hf_ieee80211_vht_tx_stbc,
23373      {"Tx STBC", "wlan_mgt.vht.capabilities.txstbc",
23374       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000080,
23375       NULL, HFILL }},
23376
23377     {&hf_ieee80211_vht_rx_stbc,
23378      {"Rx STBC", "wlan_mgt.vht.capabilities.rxstbc",
23379       FT_UINT32, BASE_HEX, VALS(vht_rx_stbc_flag), 0x00000700,
23380       NULL, HFILL }},
23381
23382     {&hf_ieee80211_vht_su_beamformer_cap,
23383      {"SU Beam-former Capable", "wlan_mgt.vht.capabilities.subeamformer",
23384       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000800,
23385       NULL, HFILL }},
23386
23387     {&hf_ieee80211_vht_su_beamformee_cap,
23388      {"SU Beam-formee Capable", "wlan_mgt.vht.capabilities.subeamformee",
23389       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00001000,
23390       NULL, HFILL }},
23391
23392     {&hf_ieee80211_vht_beamformer_antennas,
23393      {"Compressed Steering Number of Beamformer Antennas Supported", "wlan_mgt.vht.capabilities.beamformerants",
23394       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x0000e000,
23395       NULL, HFILL }},
23396
23397     {&hf_ieee80211_vht_sounding_dimensions,
23398      {"Number of Sounding Dimensions", "wlan_mgt.vht.capabilities.soundingdimensions",
23399       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x00070000,
23400       NULL, HFILL }},
23401
23402     {&hf_ieee80211_vht_mu_beamformer_cap,
23403      {"MU Beam-former Capable", "wlan_mgt.vht.capabilities.mubeamformer",
23404       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00080000,
23405       NULL, HFILL }},
23406
23407     {&hf_ieee80211_vht_mu_beamformee_cap,
23408      {"MU Beam-formee Capable", "wlan_mgt.vht.capabilities.mubeamformee",
23409       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00100000,
23410       NULL, HFILL }},
23411
23412     {&hf_ieee80211_vht_txop_ps,
23413      {"VHT TXOP PS", "wlan_mgt.vht.capabilities.vhttxopps",
23414       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00200000,
23415       NULL, HFILL }},
23416
23417     {&hf_ieee80211_vht_var_htc_field,
23418      {"+HTC-VHT Capable (VHT variant HT Control field)", "wlan_mgt.vht.capabilities.vhthtc",
23419       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00400000,
23420       NULL, HFILL }},
23421
23422     {&hf_ieee80211_vht_max_ampdu,
23423      {"Max A-MPDU Length", "wlan_mgt.vht.capabilities.maxampdu",
23424       FT_UINT32, BASE_HEX, VALS(vht_max_ampdu_flag), 0x03800000,
23425       "In Octets unit", HFILL }},
23426
23427     {&hf_ieee80211_vht_link_adaptation_cap,
23428      {"VHT Link Adaptation", "wlan_mgt.vht.capabilities.linkadapt",
23429       FT_UINT32, BASE_HEX, VALS(vht_link_adapt_flag), 0x0c000000,
23430       NULL, HFILL }},
23431
23432     {&hf_ieee80211_vht_rx_pattern,
23433      {"Rx Antenna Pattern Consistency", "wlan_mgt.vht.capabilities.rxpatconsist",
23434       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x10000000,
23435       NULL, HFILL }},
23436
23437     {&hf_ieee80211_vht_tx_pattern,
23438      {"Tx Antenna Pattern Consistency", "wlan_mgt.vht.capabilities.txpatconsist",
23439       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x20000000,
23440       NULL, HFILL }},
23441
23442     {&hf_ieee80211_vht_reserv,
23443      {"Reserved", "wlan_mgt.vht.reserved",
23444       FT_BOOLEAN, 32, NULL, 0xc0000000,
23445       NULL, HFILL }},
23446
23447     {&hf_ieee80211_vht_mcsset,
23448      {"VHT Supported MCS Set", "wlan_mgt.vht.mcsset",
23449       FT_NONE, BASE_NONE, NULL, 0,
23450       NULL, HFILL }},
23451
23452     {&hf_ieee80211_vht_mcsset_rx_mcs_map,
23453      {"Rx MCS Map", "wlan_mgt.vht.mcsset.rxmcsmap",
23454       FT_UINT16, BASE_HEX, NULL, 0,
23455       NULL, HFILL }},
23456
23457     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
23458      {"Rx 1 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss1",
23459       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
23460       NULL, HFILL }},
23461
23462     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
23463      {"Rx 2 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss2",
23464       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
23465       NULL, HFILL }},
23466
23467     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
23468      {"Rx 3 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss3",
23469       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
23470       NULL, HFILL }},
23471
23472     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
23473      {"Rx 4 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss4",
23474       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
23475       NULL, HFILL }},
23476
23477     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
23478      {"Rx 5 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss5",
23479       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
23480       NULL, HFILL }},
23481
23482     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
23483      {"Rx 6 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss6",
23484       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
23485       NULL, HFILL }},
23486
23487     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
23488      {"Rx 7 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss7",
23489       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
23490       NULL, HFILL }},
23491
23492     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
23493      {"Rx 8 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss8",
23494       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
23495       NULL, HFILL }},
23496
23497     {&hf_ieee80211_vht_mcsset_rx_highest_long_gi,
23498      {"Rx Highest Long GI Data Rate (in Mb/s, 0 = subfield not in use)", "wlan_mgt.vht.mcsset.rxhighestlonggirate",
23499       FT_UINT16, BASE_HEX, NULL, 0x1fff,
23500       NULL, HFILL }},
23501
23502     {&hf_ieee80211_vht_mcsset_tx_mcs_map,
23503      {"Tx MCS Map", "wlan_mgt.vht.mcsset.txmcsmap",
23504       FT_UINT16, BASE_HEX, NULL, 0,
23505       NULL, HFILL }},
23506
23507     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
23508      {"Tx 1 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss1",
23509       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
23510       NULL, HFILL }},
23511
23512     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
23513      {"Tx 2 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss2",
23514       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
23515       NULL, HFILL }},
23516
23517     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
23518      {"Tx 3 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss3",
23519       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
23520       NULL, HFILL }},
23521
23522     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
23523      {"Tx 4 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss4",
23524       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
23525       NULL, HFILL }},
23526
23527     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
23528      {"Tx 5 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss5",
23529       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
23530       NULL, HFILL }},
23531
23532     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
23533      {"Tx 6 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss6",
23534       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
23535       NULL, HFILL }},
23536
23537     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
23538      {"Tx 7 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss7",
23539       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
23540       NULL, HFILL }},
23541
23542     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
23543      {"Tx 8 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss8",
23544       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
23545       NULL, HFILL }},
23546
23547     {&hf_ieee80211_vht_mcsset_tx_highest_long_gi,
23548      {"Tx Highest Long GI Data Rate  (in Mb/s, 0 = subfield not in use)", "wlan_mgt.vht.mcsset.txhighestlonggirate",
23549       FT_UINT16, BASE_HEX, NULL, 0x1fff,
23550       NULL, HFILL }},
23551
23552     {&hf_ieee80211_vht_op,
23553      {"VHT Operation Info", "wlan_mgt.vht.op",
23554       FT_NONE, BASE_NONE, NULL, 0,
23555       NULL, HFILL }},
23556
23557     {&hf_ieee80211_vht_op_channel_width,
23558      {"Channel Width", "wlan_mgt.vht.op.channelwidth",
23559       FT_UINT8, BASE_HEX, VALS(vht_op_channel_width_flag), 0,
23560       NULL, HFILL }},
23561
23562     {&hf_ieee80211_vht_op_channel_center0,
23563      {"Channel Center Segment 0", "wlan_mgt.vht.op.channelcenter0",
23564       FT_UINT8, BASE_DEC, NULL, 0,
23565       NULL, HFILL }},
23566
23567     {&hf_ieee80211_vht_op_channel_center1,
23568      {"Channel Center Segment 1", "wlan_mgt.vht.op.channelcenter1",
23569       FT_UINT8, BASE_DEC, NULL, 0,
23570       NULL, HFILL }},
23571
23572     {&hf_ieee80211_vht_op_basic_mcs_map,
23573      {"Basic MCS Map", "wlan_mgt.vht.op.basicmcsmap",
23574       FT_UINT16, BASE_HEX, NULL, 0,
23575       NULL, HFILL }},
23576
23577     {&hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
23578      {"Basic 1 SS", "wlan_mgt.vht.op.basicmcsmap.ss1",
23579       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
23580       NULL, HFILL }},
23581
23582     {&hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
23583      {"Basic 2 SS", "wlan_mgt.vht.op.basicmcsmap.ss2",
23584       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
23585       NULL, HFILL }},
23586
23587     {&hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
23588      {"Basic 3 SS", "wlan_mgt.vht.op.basicmcsmap.ss3",
23589       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
23590       NULL, HFILL }},
23591
23592     {&hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
23593      {"Basic 4 SS", "wlan_mgt.vht.op.basicmcsmap.ss4",
23594       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
23595       NULL, HFILL }},
23596
23597     {&hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
23598      {"Basic 5 SS", "wlan_mgt.vht.op.basicmcsmap.ss5",
23599       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
23600       NULL, HFILL }},
23601
23602     {&hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
23603      {"Basic 6 SS", "wlan_mgt.vht.op.basicmcsmap.ss6",
23604       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
23605       NULL, HFILL }},
23606
23607     {&hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
23608      {"Basic 7 SS", "wlan_mgt.vht.op.basicmcsmap.ss7",
23609       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
23610       NULL, HFILL }},
23611
23612     {&hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
23613      {"Basic 8 SS", "wlan_mgt.vht.op.basicmcsmap.ss8",
23614       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
23615       NULL, HFILL }},
23616
23617     {&hf_ieee80211_vht_tpe_pwr_info,
23618      {"Tx Pwr Info", "wlan_mgt.vht.tpe.pwr_info",
23619       FT_UINT8, BASE_HEX, NULL, 0,
23620       NULL, HFILL }},
23621
23622     {&hf_ieee80211_vht_tpe_pwr_info_count,
23623      {"Max Tx Pwr Count", "wlan_mgt.vht.tpe.pwr_info.count",
23624       FT_UINT8, BASE_DEC, NULL , 0x07,
23625       NULL, HFILL }},
23626
23627     {&hf_ieee80211_vht_tpe_pwr_info_unit,
23628      {"Max Tx Pwr Unit Interpretation", "wlan_mgt.vht.tpe.pwr_info.unit",
23629       FT_UINT8, BASE_DEC, VALS(vht_tpe_pwr_units) , 0x38,
23630       NULL, HFILL }},
23631
23632     {&hf_ieee80211_vht_tpe_pwr_info_reserved,
23633      {"Reserved", "wlan_mgt.vht.tpe.pwr_info.reserved",
23634       FT_UINT8, BASE_DEC, NULL , 0xC0,
23635       NULL, HFILL }},
23636
23637     {&hf_ieee80211_vht_tpe_pwr_constr_20,
23638      {"Local Max Tx Pwr Constraint 20MHz", "wlan_mgt.vht.tpe.pwr_constr_20",
23639       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
23640       NULL, HFILL }},
23641
23642     {&hf_ieee80211_vht_tpe_pwr_constr_40,
23643      {"Local Max Tx Pwr Constraint 40MHz", "wlan_mgt.vht.tpe.pwr_constr_40",
23644       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
23645       NULL, HFILL }},
23646
23647     {&hf_ieee80211_vht_tpe_pwr_constr_80,
23648      {"Local Max Tx Pwr Constraint 80MHz", "wlan_mgt.vht.tpe.pwr_constr_80",
23649       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
23650       NULL, HFILL }},
23651
23652     {&hf_ieee80211_vht_tpe_pwr_constr_160,
23653      {"Local Max Tx Pwr Constraint 160MHz/80+80 MHz", "wlan_mgt.vht.tpe.pwr_constr_160",
23654       FT_INT8, BASE_CUSTOM, CF_FUNC(vht_tpe_custom), 0,
23655       NULL, HFILL }},
23656
23657     {&hf_ieee80211_txbf_csi_num_bf_ant,
23658      {"Max antennae STA can support when CSI feedback required", "wlan_mgt.txbf.csinumant",
23659       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00180000,
23660       "Max antennae station can support when CSI feedback required", HFILL }},
23661
23662     {&hf_ieee80211_txbf_uncomp_sm_bf_ant,
23663      {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan_mgt.txbf.fm.uncompressed.maxant",
23664       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00600000,
23665       "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
23666
23667     {&hf_ieee80211_txbf_comp_sm_bf_ant,
23668      {"Max antennae STA can support when compressed Beamforming feedback required", "wlan_mgt.txbf.fm.compressed.maxant",
23669       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x01800000,
23670       "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
23671
23672     {&hf_ieee80211_txbf_csi_max_rows_bf,
23673      {"Maximum number of rows of CSI explicit feedback", "wlan_mgt.txbf.csi.maxrows",
23674       FT_UINT32, BASE_HEX, VALS(txbf_csi_max_rows_bf_flags), 0x06000000,
23675       NULL, HFILL }},
23676
23677     {&hf_ieee80211_txbf_chan_est,
23678      {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan_mgt.txbf.channelest",
23679       FT_UINT32, BASE_HEX, VALS(txbf_chan_est_flags), 0x18000000,
23680       NULL, HFILL }},
23681
23682     {&hf_ieee80211_txbf_resrv,
23683      {"Reserved", "wlan_mgt.txbf.reserved",
23684       FT_UINT32, BASE_HEX, NULL, 0xe0000000,
23685       NULL, HFILL }},
23686
23687     {&hf_ieee80211_hta_cc,
23688      {"HT Control Channel", "wlan_mgt.hta.control_channel",
23689       FT_UINT8, BASE_DEC, NULL, 0,
23690       NULL, HFILL }},
23691
23692     {&hf_ieee80211_hta_cap,
23693      {"HT Additional Capabilities", "wlan_mgt.hta.capabilities",
23694       FT_UINT16, BASE_HEX, NULL, 0,
23695       "HT Additional Capability information", HFILL }},
23696
23697     {&hf_ieee80211_hta_ext_chan_offset,
23698      {"Extension Channel Offset", "wlan_mgt.hta.capabilities.ext_chan_offset",
23699       FT_UINT16, BASE_HEX, VALS(hta_ext_chan_offset_flag), 0x0003,
23700       NULL, HFILL }},
23701
23702     {&hf_ieee80211_hta_rec_tx_width,
23703      {"Recommended Tx Channel Width", "wlan_mgt.hta.capabilities.rec_tx_width",
23704       FT_BOOLEAN, 16, TFS (&hta_rec_tx_width_flag), 0x0004,
23705       "Recommended Transmit Channel Width", HFILL }},
23706
23707     {&hf_ieee80211_hta_rifs_mode,
23708      {"Reduced Interframe Spacing (RIFS) Mode", "wlan_mgt.hta.capabilities.rifs_mode",
23709       FT_BOOLEAN, 16, TFS (&hta_rifs_mode_flag), 0x0008,
23710       NULL, HFILL }},
23711
23712     {&hf_ieee80211_hta_controlled_access,
23713      {"Controlled Access Only", "wlan_mgt.hta.capabilities.controlled_access",
23714       FT_BOOLEAN, 16, TFS (&hta_controlled_access_flag), 0x0010,
23715       NULL, HFILL }},
23716
23717     {&hf_ieee80211_hta_service_interval,
23718      {"Service Interval Granularity", "wlan_mgt.hta.capabilities.service_interval",
23719       FT_UINT16, BASE_HEX, VALS(hta_service_interval_flag), 0x00E0,
23720       NULL, HFILL }},
23721
23722     {&hf_ieee80211_hta_operating_mode,
23723      {"Operating Mode", "wlan_mgt.hta.capabilities.operating_mode",
23724       FT_UINT16, BASE_HEX, VALS(hta_operating_mode_flag), 0x0003,
23725       NULL, HFILL }},
23726
23727     {&hf_ieee80211_hta_non_gf_devices,
23728      {"Non Greenfield (GF) devices Present", "wlan_mgt.hta.capabilities.non_gf_devices",
23729       FT_BOOLEAN, 16, TFS (&hta_non_gf_devices_flag), 0x0004,
23730       "on Greenfield (GF) devices Present", HFILL }},
23731
23732     {&hf_ieee80211_hta_basic_stbc_mcs,
23733      {"Basic STB Modulation and Coding Scheme (MCS)", "wlan_mgt.hta.capabilities.basic_stbc_mcs",
23734       FT_UINT16, BASE_HEX, NULL , 0x007f,
23735       NULL, HFILL }},
23736
23737     {&hf_ieee80211_hta_dual_stbc_protection,
23738      {"Dual Clear To Send (CTS) Protection", "wlan_mgt.hta.capabilities.dual_stbc_protection",
23739       FT_BOOLEAN, 16, TFS (&hta_dual_stbc_protection_flag), 0x0080,
23740       NULL, HFILL }},
23741
23742     {&hf_ieee80211_hta_secondary_beacon,
23743      {"Secondary Beacon", "wlan_mgt.hta.capabilities.secondary_beacon",
23744       FT_BOOLEAN, 16, TFS (&hta_secondary_beacon_flag), 0x0100,
23745       NULL, HFILL }},
23746
23747     {&hf_ieee80211_hta_lsig_txop_protection,
23748      {"L-SIG TXOP Protection Support", "wlan_mgt.hta.capabilities.lsig_txop_protection",
23749       FT_BOOLEAN, 16, TFS (&hta_lsig_txop_protection_flag), 0x0200,
23750       NULL, HFILL }},
23751
23752     {&hf_ieee80211_hta_pco_active,
23753      {"Phased Coexistence Operation (PCO) Active", "wlan_mgt.hta.capabilities.pco_active",
23754       FT_BOOLEAN, 16, TFS (&hta_pco_active_flag), 0x0400,
23755       NULL, HFILL }},
23756
23757     {&hf_ieee80211_hta_pco_phase,
23758      {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.hta.capabilities.pco_phase",
23759       FT_BOOLEAN, 16, TFS (&hta_pco_phase_flag), 0x0800,
23760       NULL, HFILL }},
23761
23762     {&hf_ieee80211_antsel,
23763      {"Antenna Selection (ASEL) Capabilities", "wlan_mgt.asel",
23764       FT_UINT8, BASE_HEX, NULL, 0,
23765       NULL, HFILL }},
23766
23767     {&hf_ieee80211_antsel_vs,
23768      {"Antenna Selection (ASEL) Capabilities (VS)", "wlan_mgt.vs.asel",
23769       FT_UINT8, BASE_HEX, NULL, 0,
23770       "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
23771
23772     {&hf_ieee80211_antsel_b0,
23773      {"Antenna Selection Capable", "wlan_mgt.asel.capable",
23774       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x01,
23775       NULL, HFILL }},
23776
23777     {&hf_ieee80211_antsel_b1,
23778      {"Explicit CSI Feedback Based Tx ASEL", "wlan_mgt.asel.txcsi",
23779       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x02,
23780       NULL, HFILL }},
23781
23782     {&hf_ieee80211_antsel_b2,
23783      {"Antenna Indices Feedback Based Tx ASEL", "wlan_mgt.asel.txif",
23784       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x04,
23785       NULL, HFILL }},
23786
23787     {&hf_ieee80211_antsel_b3,
23788      {"Explicit CSI Feedback", "wlan_mgt.asel.csi",
23789       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x08,
23790       NULL, HFILL }},
23791
23792     {&hf_ieee80211_antsel_b4,
23793      {"Antenna Indices Feedback", "wlan_mgt.asel.if",
23794       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x10,
23795       NULL, HFILL }},
23796
23797     {&hf_ieee80211_antsel_b5,
23798      {"Rx ASEL", "wlan_mgt.asel.rx",
23799       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x20,
23800       NULL, HFILL }},
23801
23802     {&hf_ieee80211_antsel_b6,
23803      {"Tx Sounding PPDUs", "wlan_mgt.asel.sppdu",
23804       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x40,
23805       NULL, HFILL }},
23806
23807     {&hf_ieee80211_antsel_b7,
23808      {"Reserved", "wlan_mgt.asel.reserved",
23809       FT_UINT8, BASE_HEX, NULL, 0x80,
23810       NULL, HFILL }},
23811
23812     {&hf_ieee80211_ht_info_delimiter1,
23813      {"HT Information Subset (1 of 3)", "wlan_mgt.ht.info.delim1",
23814       FT_UINT8, BASE_HEX, NULL, 0,
23815       NULL, HFILL }},
23816
23817     {&hf_ieee80211_ht_info_primary_channel,
23818      {"Primary Channel", "wlan_mgt.ht.info.primarychannel",
23819       FT_UINT8, BASE_DEC, NULL, 0,
23820       NULL, HFILL }},
23821
23822     {&hf_ieee80211_ht_info_secondary_channel_offset,
23823      {"Secondary channel offset", "wlan_mgt.ht.info.secchanoffset",
23824       FT_UINT8, BASE_HEX, VALS(ht_info_secondary_channel_offset_flags), 0x03,
23825       NULL, HFILL }},
23826
23827     {&hf_ieee80211_ht_info_channel_width,
23828      {"Supported channel width", "wlan_mgt.ht.info.chanwidth",
23829       FT_BOOLEAN, 8, TFS (&ht_info_channel_width_flag), 0x04,
23830       NULL, HFILL }},
23831
23832     {&hf_ieee80211_ht_info_rifs_mode,
23833      {"Reduced Interframe Spacing (RIFS)", "wlan_mgt.ht.info.rifs",
23834       FT_BOOLEAN, 8, TFS (&ht_info_rifs_mode_flag), 0x08,
23835       NULL, HFILL }},
23836
23837     {&hf_ieee80211_ht_info_psmp_stas_only,
23838      {"Power Save Multi-Poll (PSMP) stations only", "wlan_mgt.ht.info.psmponly",
23839       FT_BOOLEAN, 8, TFS (&ht_info_psmp_stas_only_flag), 0x10,
23840       NULL, HFILL }},
23841
23842     {&hf_ieee80211_ht_info_service_interval_granularity,
23843      {"Shortest service interval", "wlan_mgt.ht.info",
23844       FT_UINT8, BASE_HEX, VALS(ht_info_service_interval_granularity_flags), 0xe0,
23845       NULL, HFILL }},
23846
23847     {&hf_ieee80211_ht_info_delimiter2,
23848      {"HT Information Subset (2 of 3)", "wlan_mgt.ht.info.delim2",
23849       FT_UINT16, BASE_HEX, NULL, 0,
23850       NULL, HFILL }},
23851
23852     {&hf_ieee80211_ht_info_operating_mode,
23853      {"Operating mode of BSS", "wlan_mgt.ht.info.operatingmode",
23854       FT_UINT16, BASE_HEX, VALS(ht_info_operating_mode_flags), 0x0003,
23855       NULL, HFILL }},
23856
23857     {&hf_ieee80211_ht_info_non_greenfield_sta_present,
23858      {"Non-greenfield STAs present", "wlan_mgt.ht.info.greenfield",
23859       FT_BOOLEAN, 16, TFS (&ht_info_non_greenfield_sta_present_flag), 0x0004,
23860       NULL, HFILL }},
23861
23862     {&hf_ieee80211_ht_info_transmit_burst_limit,
23863      {"Transmit burst limit", "wlan_mgt.ht.info.burstlim",
23864       FT_BOOLEAN, 16, TFS (&ht_info_transmit_burst_limit_flag), 0x0008,
23865       NULL, HFILL }},
23866
23867     {&hf_ieee80211_ht_info_obss_non_ht_stas_present,
23868      {"OBSS non-HT STAs present", "wlan_mgt.ht.info.obssnonht",
23869       FT_BOOLEAN, 16, TFS (&ht_info_obss_non_ht_stas_present_flag), 0x0010,
23870       NULL, HFILL }},
23871
23872     {&hf_ieee80211_ht_info_reserved_1,
23873      {"Reserved", "wlan_mgt.ht.info.reserved1",
23874       FT_UINT16, BASE_HEX, NULL, 0xffe0,
23875       NULL, HFILL }},
23876
23877     {&hf_ieee80211_ht_info_delimiter3,
23878      {"HT Information Subset (3 of 3)", "wlan_mgt.ht.info.delim3",
23879       FT_UINT16, BASE_HEX, NULL, 0,
23880       NULL, HFILL }},
23881
23882     {&hf_ieee80211_ht_info_reserved_2,
23883      {"Reserved", "wlan_mgt.ht.info.reserved2",
23884       FT_UINT16, BASE_HEX, NULL, 0x003f,
23885       NULL, HFILL }},
23886
23887     {&hf_ieee80211_ht_info_dual_beacon,
23888      {"Dual beacon", "wlan_mgt.ht.info.dualbeacon",
23889       FT_BOOLEAN, 16, TFS (&ht_info_dual_beacon_flag), 0x0040,
23890       NULL, HFILL }},
23891
23892     {&hf_ieee80211_ht_info_dual_cts_protection,
23893      {"Dual Clear To Send (CTS) protection", "wlan_mgt.ht.info.dualcts",
23894       FT_BOOLEAN, 16, TFS (&ht_info_dual_cts_protection_flag), 0x0080,
23895       NULL, HFILL }},
23896
23897     {&hf_ieee80211_ht_info_secondary_beacon,
23898      {"Beacon ID", "wlan_mgt.ht.info.secondarybeacon",
23899       FT_BOOLEAN, 16, TFS (&ht_info_secondary_beacon_flag), 0x0100,
23900       NULL, HFILL }},
23901
23902     {&hf_ieee80211_ht_info_lsig_txop_protection_full_support,
23903      {"L-SIG TXOP Protection Full Support", "wlan_mgt.ht.info.lsigprotsupport",
23904       FT_BOOLEAN, 16, TFS (&ht_info_lsig_txop_protection_full_support_flag), 0x0200,
23905       NULL, HFILL }},
23906
23907     {&hf_ieee80211_ht_info_pco_active,
23908      {"Phased Coexistence Operation (PCO)", "wlan_mgt.ht.info.pco.active",
23909       FT_BOOLEAN, 16, TFS (&tfs_active_inactive), 0x0400,
23910       NULL, HFILL }},
23911
23912     {&hf_ieee80211_ht_info_pco_phase,
23913      {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.ht.info.pco.phase",
23914       FT_BOOLEAN, 16, TFS (&ht_info_pco_phase_flag), 0x0800,
23915       NULL, HFILL }},
23916
23917     {&hf_ieee80211_ht_info_reserved_3,
23918      {"Reserved", "wlan_mgt.ht.info.reserved3",
23919       FT_UINT16, BASE_HEX, NULL, 0xf000,
23920       NULL, HFILL }},
23921
23922     {&hf_ieee80211_tag_ap_channel_report_operating_class,
23923      {"Operating Class", "wlan_mgt.ap_channel_report.operating_class",
23924       FT_UINT8, BASE_DEC, NULL, 0,
23925       NULL, HFILL }},
23926
23927     {&hf_ieee80211_tag_ap_channel_report_channel_list,
23928      {"Channel List", "wlan_mgt.ap_channel_report.channel_list",
23929       FT_UINT8, BASE_DEC, NULL, 0,
23930       NULL, HFILL }},
23931
23932     {&hf_ieee80211_tag_secondary_channel_offset,
23933      {"Secondary Channel Offset", "wlan_mgt.secchanoffset",
23934       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_secondary_channel_offset_flags), 0,
23935       NULL, HFILL }},
23936
23937     {&hf_ieee80211_tag_bss_ap_avg_access_delay,
23938      {"AP Average Access Delay", "wlan_mgt.bss_ap_avg_access_delay",
23939       FT_UINT8, BASE_DEC, NULL, 0x0,
23940       NULL, HFILL }},
23941
23942     {&hf_ieee80211_tag_antenna_id,
23943      {"Antenna ID", "wlan_mgt.antenna.id",
23944       FT_UINT8, BASE_DEC, NULL, 0x0,
23945       NULL, HFILL }},
23946
23947     {&hf_ieee80211_tag_rsni,
23948      {"RSNI", "wlan_mgt.rsni",
23949       FT_UINT8, BASE_CUSTOM, CF_FUNC(rsni_base_custom), 0x0,
23950       NULL, HFILL }},
23951
23952     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
23953      {"Available Admission Capacity Bitmask", "wlan_mgt.bss_avb_adm_cap.bitmask",
23954       FT_UINT16, BASE_HEX, NULL, 0,
23955       NULL, HFILL }},
23956     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
23957      {"UP0 (bit0)", "wlan_mgt.bss_avb_adm_cap.bitmask.up0",
23958       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP0,
23959       NULL, HFILL }},
23960     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
23961      {"UP1 (bit1)", "wlan_mgt.bss_avb_adm_cap.bitmask.up1",
23962       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP1,
23963       NULL, HFILL }},
23964     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
23965      {"UP2 (bit2)", "wlan_mgt.bss_avb_adm_cap.bitmask.up2",
23966       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP2,
23967       NULL, HFILL }},
23968     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
23969      {"UP3 (bit3)", "wlan_mgt.bss_avb_adm_cap.bitmask.up3",
23970       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP3,
23971       NULL, HFILL }},
23972     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
23973      {"UP4 (bit4)", "wlan_mgt.bss_avb_adm_cap.bitmask.up4",
23974       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP4,
23975       NULL, HFILL }},
23976     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
23977      {"UP5 (bit5)", "wlan_mgt.bss_avb_adm_cap.bitmask.up5",
23978       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP5,
23979       NULL, HFILL }},
23980     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
23981      {"UP0 (bit6)", "wlan_mgt.bss_avb_adm_cap.bitmask.up6",
23982       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP6,
23983       NULL, HFILL }},
23984     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
23985      {"UP7 (bit7)", "wlan_mgt.bss_avb_adm_cap.bitmask.up7",
23986       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP7,
23987       NULL, HFILL }},
23988     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
23989      {"AC0 (bit8)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac0",
23990       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC0,
23991       NULL, HFILL }},
23992     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
23993      {"AC1 (bit9)", "wlan_mgt.bss_avb_adm_cap.bitmask.AC1",
23994       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC1,
23995       NULL, HFILL }},
23996     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
23997      {"AC2 (bit10)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac2",
23998       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC2,
23999       NULL, HFILL }},
24000     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
24001      {"AC3 (bit11)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac3",
24002       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC3,
24003       NULL, HFILL }},
24004     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
24005      {"Reserved", "wlan_mgt.bss_avb_adm_cap.bitmask.rsv",
24006       FT_UINT16, BASE_HEX, NULL, BSS_BITMASK_RSV,
24007       NULL, HFILL }},
24008     {&hf_ieee80211_tag_bss_avb_adm_cap_up0,
24009      {"UP0", "wlan_mgt.bss_avb_adm_cap.up0",
24010       FT_UINT16, BASE_DEC, NULL, 0x0,
24011       NULL, HFILL }},
24012     {&hf_ieee80211_tag_bss_avb_adm_cap_up1,
24013      {"UP1", "wlan_mgt.bss_avb_adm_cap.up1",
24014       FT_UINT16, BASE_DEC, NULL, 0x0,
24015       NULL, HFILL }},
24016     {&hf_ieee80211_tag_bss_avb_adm_cap_up2,
24017      {"UP2", "wlan_mgt.bss_avb_adm_cap.up2",
24018       FT_UINT16, BASE_DEC, NULL, 0x0,
24019       NULL, HFILL }},
24020     {&hf_ieee80211_tag_bss_avb_adm_cap_up3,
24021      {"UP3", "wlan_mgt.bss_avb_adm_cap.up3",
24022       FT_UINT16, BASE_DEC, NULL, 0x0,
24023       NULL, HFILL }},
24024     {&hf_ieee80211_tag_bss_avb_adm_cap_up4,
24025      {"UP4", "wlan_mgt.bss_avb_adm_cap.up4",
24026       FT_UINT16, BASE_DEC, NULL, 0x0,
24027       NULL, HFILL }},
24028     {&hf_ieee80211_tag_bss_avb_adm_cap_up5,
24029      {"UP5", "wlan_mgt.bss_avb_adm_cap.up5",
24030       FT_UINT16, BASE_DEC, NULL, 0x0,
24031       NULL, HFILL }},
24032     {&hf_ieee80211_tag_bss_avb_adm_cap_up6,
24033      {"UP6", "wlan_mgt.bss_avb_adm_cap.up6",
24034       FT_UINT16, BASE_DEC, NULL, 0x0,
24035       NULL, HFILL }},
24036     {&hf_ieee80211_tag_bss_avb_adm_cap_up7,
24037      {"UP7", "wlan_mgt.bss_avb_adm_cap.up7",
24038       FT_UINT16, BASE_DEC, NULL, 0x0,
24039       NULL, HFILL }},
24040     {&hf_ieee80211_tag_bss_avb_adm_cap_ac0,
24041      {"AC0", "wlan_mgt.bss_avb_adm_cap.ac0",
24042       FT_UINT16, BASE_DEC, NULL, 0x0,
24043       NULL, HFILL }},
24044     {&hf_ieee80211_tag_bss_avb_adm_cap_ac1,
24045      {"AC1", "wlan_mgt.bss_avb_adm_cap.ac1",
24046       FT_UINT16, BASE_DEC, NULL, 0x0,
24047       NULL, HFILL }},
24048     {&hf_ieee80211_tag_bss_avb_adm_cap_ac2,
24049      {"AC2", "wlan_mgt.bss_avb_adm_cap.ac2",
24050       FT_UINT16, BASE_DEC, NULL, 0x0,
24051       NULL, HFILL }},
24052     {&hf_ieee80211_tag_bss_avb_adm_cap_ac3,
24053      {"AC3", "wlan_mgt.bss_avb_adm_cap.ac3",
24054       FT_UINT16, BASE_DEC, NULL, 0x0,
24055       NULL, HFILL }},
24056
24057     {&hf_ieee80211_tag_bss_avg_ac_access_delay_be,
24058      {"AC Average Access Delay for Best Effort", "wlan_mgt.bss_avg_ac_access_delay.be",
24059       FT_UINT8, BASE_DEC, NULL, 0x0,
24060       NULL, HFILL }},
24061     {&hf_ieee80211_tag_bss_avg_ac_access_delay_bk,
24062      {"AC Average Access Delay for Best Background", "wlan_mgt.bss_avg_ac_access_delay.bk",
24063       FT_UINT8, BASE_DEC, NULL, 0x0,
24064       NULL, HFILL }},
24065     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vi,
24066      {"AC Average Access Delay for Video", "wlan_mgt.bss_avg_ac_access_delay_vi",
24067       FT_UINT8, BASE_DEC, NULL, 0x0,
24068       NULL, HFILL }},
24069     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vo,
24070      {"AC Average Access Delay for Voice", "wlan_mgt.bss_avg_ac_access_delay_vo",
24071       FT_UINT8, BASE_DEC, NULL, 0x0,
24072       NULL, HFILL }},
24073
24074
24075     /* 802.11-2012 Table 8-119-RM Enabled Capabilities definition */
24076     {&hf_ieee80211_tag_rm_enabled_capabilities,
24077      {"RM Capabilities", "wlan_mgt.rmcap",
24078       FT_UINT8, BASE_HEX, NULL, 0,
24079       "Signals support for radio measurements in a device", HFILL }},
24080
24081     /* RM Enabled Capability octet 1 */
24082     {&hf_ieee80211_tag_rm_enabled_capabilities_b0,
24083      {"Link Measurement", "wlan_mgt.rmcap.b0",
24084       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24085       NULL, HFILL }},
24086     {&hf_ieee80211_tag_rm_enabled_capabilities_b1,
24087      {"Neighbor Report", "wlan_mgt.rmcap.b1",
24088       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24089       NULL, HFILL }},
24090     {&hf_ieee80211_tag_rm_enabled_capabilities_b2,
24091      {"Parallel Measurements", "wlan_mgt.rmcap.b2",
24092       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
24093       NULL, HFILL }},
24094     {&hf_ieee80211_tag_rm_enabled_capabilities_b3,
24095      {"Repeated Measurements", "wlan_mgt.rmcap.b3",
24096       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
24097       NULL, HFILL }},
24098     {&hf_ieee80211_tag_rm_enabled_capabilities_b4,
24099      {"Beacon Passive Measurement", "wlan_mgt.rmcap.b4",
24100       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
24101       NULL, HFILL }},
24102     {&hf_ieee80211_tag_rm_enabled_capabilities_b5,
24103      {"Beacon Active Measurement", "wlan_mgt.rmcap.b5",
24104       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
24105       NULL, HFILL }},
24106     {&hf_ieee80211_tag_rm_enabled_capabilities_b6,
24107      {"Beacon Table Measurement", "wlan_mgt.rmcap.b6",
24108       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24109       NULL, HFILL }},
24110     {&hf_ieee80211_tag_rm_enabled_capabilities_b7,
24111      {"Beacon Measurement Reporting Conditions", "wlan_mgt.rmcap.b7",
24112       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
24113       NULL, HFILL }},
24114
24115     /* RM Enabled Capability octet 2 */
24116     {&hf_ieee80211_tag_rm_enabled_capabilities_b8,
24117      {"Frame Measurement", "wlan_mgt.rmcap.b8",
24118       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24119       NULL, HFILL }},
24120     {&hf_ieee80211_tag_rm_enabled_capabilities_b9,
24121      {"Channel Load Measurement", "wlan_mgt.rmcap.b9",
24122       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24123       NULL, HFILL }},
24124     {&hf_ieee80211_tag_rm_enabled_capabilities_b10,
24125      {"Noise Histogram Measurement", "wlan_mgt.rmcap.b10",
24126       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
24127       NULL, HFILL }},
24128     {&hf_ieee80211_tag_rm_enabled_capabilities_b11,
24129      {"Statistics Measurement", "wlan_mgt.rmcap.b11",
24130       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
24131       NULL, HFILL }},
24132     {&hf_ieee80211_tag_rm_enabled_capabilities_b12,
24133      {"LCI Measurement", "wlan_mgt.rmcap.b12",
24134       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
24135       NULL, HFILL }},
24136     {&hf_ieee80211_tag_rm_enabled_capabilities_b13,
24137      {"LCI Azimuth capability", "wlan_mgt.rmcap.b13",
24138       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
24139       NULL, HFILL }},
24140     {&hf_ieee80211_tag_rm_enabled_capabilities_b14,
24141      {"Transmit Stream/Category Measurement", "wlan_mgt.rmcap.b14",
24142       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24143       NULL, HFILL }},
24144     {&hf_ieee80211_tag_rm_enabled_capabilities_b15,
24145      {"Triggered Transmit Stream/Category Measurement", "wlan_mgt.rmcap.b15",
24146       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
24147       NULL, HFILL }},
24148
24149     /* RM Enabled Capability octet 3 */
24150     {&hf_ieee80211_tag_rm_enabled_capabilities_b16,
24151      {"AP Channel Report capability", "wlan_mgt.rmcap.b16",
24152       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24153       NULL, HFILL }},
24154     {&hf_ieee80211_tag_rm_enabled_capabilities_b17,
24155      {"RM MIB capability", "wlan_mgt.rmcap.b17",
24156       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24157       NULL, HFILL }},
24158     {&hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
24159      {"Operating Channel Max Measurement Duration", "wlan_mgt.rmcap.b18to20",
24160       FT_UINT8, BASE_DEC, NULL, 0x1C,
24161       NULL, HFILL }},
24162     {&hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
24163      {"Nonoperating Channel Max Measurement Duration", "wlan_mgt.rmcap.b21to23",
24164       FT_UINT8, BASE_DEC, NULL, 0xE0,
24165       NULL, HFILL }},
24166
24167     /* RM Enabled Capability octet 4 */
24168     {&hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
24169      {"Measurement Pilotcapability", "wlan_mgt.rmcap.b24to26",
24170       FT_UINT8, BASE_DEC, NULL, 0x07,
24171       NULL, HFILL }},
24172     {&hf_ieee80211_tag_rm_enabled_capabilities_b27,
24173      {"Measurement Pilot Transmission Information", "wlan_mgt.rmcap.b27",
24174       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
24175       NULL, HFILL }},
24176     {&hf_ieee80211_tag_rm_enabled_capabilities_b28,
24177      {"Neighbor Report TSF Offset", "wlan_mgt.rmcap.b28",
24178       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
24179       NULL, HFILL }},
24180     {&hf_ieee80211_tag_rm_enabled_capabilities_b29,
24181      {"RCPI Measurement capability", "wlan_mgt.rmcap.b29",
24182       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
24183       NULL, HFILL }},
24184     {&hf_ieee80211_tag_rm_enabled_capabilities_b30,
24185      {"RSNI Measurement capability", "wlan_mgt.rmcap.b30",
24186       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24187       NULL, HFILL }},
24188     {&hf_ieee80211_tag_rm_enabled_capabilities_b31,
24189      {"BSS Average Access Delay capability", "wlan_mgt.rmcap.b31",
24190       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
24191       NULL, HFILL }},
24192
24193     /* RM Enabled Capability octet 5 */
24194     {&hf_ieee80211_tag_rm_enabled_capabilities_b32,
24195      {"BSS Available Admission Capacity capability", "wlan_mgt.rmcap.b32",
24196       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
24197       NULL, HFILL }},
24198     {&hf_ieee80211_tag_rm_enabled_capabilities_b33,
24199      {"Antenna capability", "wlan_mgt.rmcap.b33",
24200       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
24201       NULL, HFILL }},
24202     {&hf_ieee80211_tag_rm_enabled_capabilities_o5,
24203      {"Reserved", "wlan_mgt.rmcap.o5",
24204       FT_UINT8, BASE_HEX, NULL, 0xFC,
24205       "Must be zero", HFILL }},
24206
24207     {&hf_ieee80211_tag_power_constraint_local,
24208      {"Local Power Constraint", "wlan_mgt.powercon.local",
24209       FT_UINT8, BASE_DEC, NULL, 0,
24210       "Value that allows the mitigation requirements to be satisfied in the current channel", HFILL }},
24211
24212     {&hf_ieee80211_tag_power_capability_min,
24213      {"Minimum Transmit Power", "wlan_mgt.powercap.min",
24214       FT_UINT8, BASE_HEX, NULL, 0,
24215       "The nominal minimum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
24216
24217     {&hf_ieee80211_tag_power_capability_max,
24218      {"Maximum Transmit Power", "wlan_mgt.powercap.max",
24219       FT_UINT8, BASE_HEX, NULL, 0,
24220       "The nominal maximum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
24221
24222     {&hf_ieee80211_tag_tpc_report_trsmt_pow,
24223      {"Transmit Power", "wlan_mgt.tcprep.trsmt_pow",
24224       FT_INT8, BASE_DEC, NULL, 0,
24225       NULL, HFILL }},
24226
24227     {&hf_ieee80211_tag_tpc_report_link_mrg,
24228      {"Link Margin", "wlan_mgt.tcprep.link_mrg",
24229       FT_INT8, BASE_DEC, NULL, 0,
24230       NULL, HFILL }},
24231
24232     {&hf_ieee80211_tag_supported_channels,
24233      {"Supported Channels Set", "wlan_mgt.supchan",
24234       FT_NONE, BASE_NONE, NULL, 0,
24235       NULL, HFILL }},
24236
24237     {&hf_ieee80211_tag_supported_channels_first,
24238      {"First Supported Channel", "wlan_mgt.supchan.first",
24239       FT_UINT8, BASE_DEC, NULL, 0,
24240       NULL, HFILL }},
24241
24242     {&hf_ieee80211_tag_supported_channels_range,
24243      {"Supported Channel Range", "wlan_mgt.supchan.range",
24244       FT_UINT8, BASE_DEC, NULL, 0,
24245       NULL, HFILL }},
24246
24247     {&hf_ieee80211_csa_channel_switch_mode,
24248      {"Channel Switch Mode", "wlan_mgt.csa.channel_switch_mode",
24249       FT_UINT8, BASE_HEX, NULL, 0,
24250       "Indicates any restrictions on transmission until a channel switch", HFILL }},
24251
24252     {&hf_ieee80211_csa_new_channel_number,
24253      {"New Channel Number", "wlan_mgt.csa.new_channel_number",
24254       FT_UINT8, BASE_HEX, NULL, 0,
24255       "Set to the number of the channel to which the STA is moving", HFILL }},
24256
24257     {&hf_ieee80211_csa_channel_switch_count,
24258      {"Channel Switch Count", "wlan_mgt.csa.channel_switch.count",
24259       FT_UINT8, BASE_DEC, NULL, 0,
24260       "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 }},
24261
24262     {&hf_ieee80211_mesh_channel_switch_ttl,
24263      {"Mesh Channel Switch TTL", "wlan_mgt.csa.mesh_channel_switch.ttl",
24264       FT_UINT8, BASE_DEC, NULL, 0,
24265       NULL, HFILL }},
24266
24267     {&hf_ieee80211_mesh_channel_switch_flag,
24268      {"Mesh Channel Switch Flag", "wlan_mgt.csa.mesh_channel_switch.flag",
24269       FT_UINT8, BASE_HEX, NULL, 0,
24270       NULL, HFILL }},
24271
24272     {&hf_ieee80211_mesh_chswitch_flag_txrestrict,
24273      {"CSA Tx Restrict", "wlan_mgt.csa.mesh_channel_switch.flag.txrestrict",
24274       FT_BOOLEAN, 16, TFS (&csa_txrestrict_flags), 0x0001,
24275       NULL, HFILL }},
24276
24277     {&hf_ieee80211_mesh_chswitch_flag_initiator,
24278      {"CSA Initiator", "wlan_mgt.csa.mesh_channel_switch.flag.initiator",
24279       FT_BOOLEAN, 16, TFS (&csa_initiator_flags), 0x0002,
24280       NULL, HFILL }},
24281
24282     {&hf_ieee80211_mesh_channel_switch_reason_code,
24283      {"Mesh Channel Switch Reason Code", "wlan_mgt.csa.mesh_channel_switch.reason_code",
24284       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
24285       NULL, HFILL }},
24286
24287     {&hf_ieee80211_mesh_channel_switch_precedence_value,
24288      {"Mesh Channel Switch Precedence Value", "wlan_mgt.csa.mesh_channel_switch.pre_value",
24289       FT_UINT16, BASE_DEC, NULL, 0,
24290       NULL, HFILL }},
24291
24292     {&hf_ieee80211_tag_measure_request_token,
24293      {"Measurement Token", "wlan_mgt.measure.req.token",
24294       FT_UINT8, BASE_HEX, NULL, 0xff,
24295       NULL, HFILL }},
24296
24297     {&hf_ieee80211_tag_measure_request_mode,
24298      {"Measurement Request Mode", "wlan_mgt.measure.req.mode",
24299       FT_UINT8, BASE_HEX, NULL, 0xff,
24300       NULL, HFILL }},
24301
24302     {&hf_ieee80211_tag_measure_request_mode_parallel,
24303      {"Parallel", "wlan_mgt.measure.req.reqmode.parallel",
24304       FT_BOOLEAN, 8, NULL, 0x01,
24305       NULL, HFILL }},
24306
24307     {&hf_ieee80211_tag_measure_request_mode_enable,
24308      {"Measurement Request Mode Field", "wlan_mgt.measure.req.reqmode.enable",
24309       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x02,
24310       NULL, HFILL }},
24311
24312     {&hf_ieee80211_tag_measure_request_mode_request,
24313      {"Measurement Reports", "wlan_mgt.measure.req.reqmode.request",
24314       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x04,
24315       NULL, HFILL }},
24316
24317     {&hf_ieee80211_tag_measure_request_mode_report,
24318      {"Autonomous Measurement Reports", "wlan_mgt.measure.req.reqmode.report",
24319       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x08,
24320       NULL, HFILL }},
24321
24322     {&hf_ieee80211_tag_measure_request_mode_duration_mandatory,
24323      {"Duration Mandatory", "wlan_mgt.measure.req.reqmode.duration_mandatory",
24324       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x10,
24325       NULL, HFILL }},
24326
24327     {&hf_ieee80211_tag_measure_request_mode_reserved,
24328      {"Reserved", "wlan_mgt.measure.req.reqmode.reserved",
24329       FT_UINT8, BASE_HEX, NULL, 0xE0,
24330       NULL, HFILL }},
24331
24332     {&hf_ieee80211_tag_measure_request_type,
24333      {"Measurement Request Type", "wlan_mgt.measure.req.reqtype",
24334       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_type_flags_ext, 0x00,
24335       NULL, HFILL }},
24336
24337     {&hf_ieee80211_tag_measure_request_channel_number,
24338      {"Measurement Channel Number", "wlan_mgt.measure.req.channelnumber",
24339       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
24340       NULL, HFILL }},
24341
24342     {&hf_ieee80211_tag_measure_request_start_time,
24343      {"Measurement Start Time", "wlan_mgt.measure.req.starttime",
24344       FT_UINT64, BASE_HEX, NULL, 0,
24345       NULL, HFILL }},
24346
24347     {&hf_ieee80211_tag_measure_request_duration,
24348      {"Measurement Duration", "wlan_mgt.measure.req.channelnumber",
24349       FT_UINT16, BASE_HEX, NULL, 0,
24350       "in TU (1 TU = 1024 us)", HFILL }},
24351
24352     {&hf_ieee80211_tag_measure_request_operating_class,
24353      {"Operating Class", "wlan_mgt.measure.req.operatingclass",
24354       FT_UINT8, BASE_DEC, NULL, 0,
24355       NULL, HFILL }},
24356
24357     {&hf_ieee80211_tag_measure_request_randomization_interval,
24358      {"Randomization Interval", "wlan_mgt.measure.req.randint",
24359       FT_UINT16, BASE_HEX, NULL, 0,
24360       "in TU (1 TU = 1024 us)", HFILL }},
24361
24362     {&hf_ieee80211_tag_measure_request_measurement_mode,
24363      {"Measurement Mode", "wlan_mgt.measure.req.measurementmode",
24364       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_measurement_mode_flags), 0,
24365       NULL, HFILL }},
24366
24367     {&hf_ieee80211_tag_measure_request_bssid,
24368      {"BSSID", "wlan_mgt.measure.req.bssid",
24369       FT_ETHER, BASE_NONE, NULL, 0,
24370       NULL, HFILL }},
24371
24372     {&hf_ieee80211_tag_measure_request_subelement_length,
24373      {"Length", "wlan_mgt.measure.req.sub.length",
24374       FT_UINT8, BASE_DEC, NULL, 0,
24375       NULL, HFILL }},
24376
24377     {&hf_ieee80211_tag_measure_request_beacon_sub_id,
24378      {"SubElement ID", "wlan_mgt.measure.req.beacon.sub.id",
24379       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_beacon_sub_id_flags), 0,
24380       NULL, HFILL }},
24381
24382     {&hf_ieee80211_tag_measure_request_beacon_sub_ssid,
24383      {"SSID", "wlan_mgt.measure.req.beacon.sub.ssid",
24384       FT_STRING, BASE_NONE, 0, 0,
24385       NULL, HFILL }},
24386
24387     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition,
24388      {"Reporting Condition", "wlan_mgt.measure.req.beacon.sub.bri.repcond",
24389       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags), 0,
24390       NULL, HFILL }},
24391
24392     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset,
24393      {"Threshold/Offset", "wlan_mgt.measure.req.beacon.sub.bri.threshold_offset",
24394       FT_UINT8, BASE_HEX, NULL, 0,
24395       NULL, HFILL }},
24396
24397     {&hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail,
24398      {"Reporting Detail", "wlan_mgt.measure.req.beacon.sub.bri.reporting_detail",
24399       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags), 0,
24400       NULL, HFILL }},
24401
24402     {&hf_ieee80211_tag_measure_request_beacon_sub_request,
24403      {"Request", "wlan_mgt.measure.req.beacon.sub.request",
24404       FT_UINT8, BASE_DEC, 0, 0,
24405       NULL, HFILL }},
24406
24407     {&hf_ieee80211_tag_measure_request_beacon_unknown,
24408      {"Unknown Data", "wlan_mgt.measure.req.beacon.unknown",
24409       FT_BYTES, BASE_NONE, NULL, 0,
24410       "(not interpreted)", HFILL }},
24411
24412     {&hf_ieee80211_tag_measure_request_channel_load_sub_id,
24413      {"SubElement ID", "wlan_mgt.measure.req.channel_load.sub.id",
24414       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_channel_load_sub_id_vals), 0,
24415       NULL, HFILL }},
24416
24417     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_condition,
24418      {"Reporting Condition", "wlan_mgt.measure.req.channel_load.sub.repcond",
24419       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_channel_load_sub_reporting_condition_vals), 0,
24420       NULL, HFILL }},
24421
24422     {&hf_ieee80211_tag_measure_request_channel_load_sub_reporting_ref,
24423      {"Reference Value", "wlan_mgt.measure.req.channel_load.sub.ref",
24424       FT_UINT8, BASE_HEX, NULL, 0,
24425       NULL, HFILL }},
24426
24427
24428     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_id,
24429      {"SubElement ID", "wlan_mgt.measure.req.noise_histogram.sub.id",
24430       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_noise_histogram_sub_id_vals), 0,
24431       NULL, HFILL }},
24432
24433     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition,
24434      {"Reporting Condition", "wlan_mgt.measure.reqnoise_histogram.sub.repcond",
24435       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_noise_histogram_sub_reporting_condition_vals), 0,
24436       NULL, HFILL }},
24437
24438     {&hf_ieee80211_tag_measure_request_noise_histogram_sub_reporting_anpi_ref,
24439      {"ANPI Reference Value", "wlan_mgt.measure.req.noise_histogram.sub.anpiref",
24440       FT_UINT8, BASE_HEX, NULL, 0,
24441       NULL, HFILL }},
24442
24443
24444     {&hf_ieee80211_tag_measure_request_frame_request_type,
24445      {"Frame Request Type", "wlan_mgt.measure.req.frame_request_type",
24446       FT_UINT8, BASE_HEX, NULL, 0,
24447       NULL, HFILL }},
24448
24449     {&hf_ieee80211_tag_measure_request_mac_address,
24450      {"MAC Address", "wlan_mgt.measure.req.mac_address",
24451       FT_BYTES, BASE_NONE, NULL, 0,
24452       NULL, HFILL }},
24453
24454     {&hf_ieee80211_tag_measure_request_peer_mac_address,
24455      {"Peer MAC Address", "wlan_mgt.measure.req.peer_mac_address",
24456       FT_BYTES, BASE_NONE, NULL, 0,
24457       NULL, HFILL }},
24458
24459     {&hf_ieee80211_tag_measure_request_group_id,
24460      {"Group ID", "wlan_mgt.measure.req.groupid",
24461       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_group_id_flags_ext, 0,
24462       NULL, HFILL }},
24463
24464     {&hf_ieee80211_tag_measure_request_unknown,
24465      {"Unknown Data", "wlan_mgt.measure.req.unknown",
24466       FT_BYTES, BASE_NONE, NULL, 0,
24467       "(not interpreted)", HFILL }},
24468
24469     {&hf_ieee80211_tag_measure_report_measurement_token,
24470      {"Measurement Token", "wlan_mgt.measure.req.token",
24471       FT_UINT8, BASE_HEX, NULL, 0,
24472       NULL, HFILL }},
24473
24474     {&hf_ieee80211_tag_measure_report_mode,
24475      {"Measurement Report Mode", "wlan_mgt.measure.req.mode",
24476       FT_UINT8, BASE_HEX, NULL, 0,
24477       NULL, HFILL }},
24478
24479     {&hf_ieee80211_tag_measure_report_mode_late,
24480      {"Measurement Report Mode Field", "wlan_mgt.measure.rep.repmode.late",
24481       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x01,
24482       NULL, HFILL }},
24483
24484     {&hf_ieee80211_tag_measure_report_mode_incapable,
24485      {"Measurement Reports", "wlan_mgt.measure.rep.repmode.incapable",
24486       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x02,
24487       NULL, HFILL }},
24488
24489     {&hf_ieee80211_tag_measure_report_mode_refused,
24490      {"Autonomous Measurement Reports", "wlan_mgt.measure.rep.repmode.refused",
24491       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x04,
24492       NULL, HFILL }},
24493
24494     {&hf_ieee80211_tag_measure_report_mode_reserved,
24495      {"Reserved", "wlan_mgt.measure.rep.repmode.reserved",
24496       FT_UINT8, BASE_HEX, NULL, 0xf8,
24497       NULL, HFILL }},
24498
24499     {&hf_ieee80211_tag_measure_report_type,
24500      {"Measurement Report Type", "wlan_mgt.measure.rep.reptype",
24501       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_report_type_flags_ext, 0x00,
24502       NULL, HFILL }},
24503
24504     {&hf_ieee80211_tag_measure_report_channel_number,
24505      {"Measurement Channel Number", "wlan_mgt.measure.rep.channelnumber",
24506       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
24507       NULL, HFILL }},
24508
24509     {&hf_ieee80211_tag_measure_report_start_time,
24510      {"Measurement Start Time", "wlan_mgt.measure.rep.starttime",
24511       FT_UINT64, BASE_HEX, NULL, 0,
24512       NULL, HFILL }},
24513
24514     {&hf_ieee80211_tag_measure_report_duration,
24515      {"Measurement Duration", "wlan_mgt.measure.rep.channelnumber",
24516       FT_UINT16, BASE_HEX, NULL, 0,
24517       NULL, HFILL }},
24518
24519     {&hf_ieee80211_tag_measure_cca_busy_fraction,
24520      {"CCA Busy Fraction", "wlan_mgt.measure.rep.ccabusy",
24521       FT_UINT8, BASE_HEX, NULL, 0,
24522       NULL, HFILL }},
24523
24524     {&hf_ieee80211_tag_measure_basic_map_field,
24525      {"Map Field", "wlan_mgt.measure.rep.mapfield",
24526       FT_UINT8, BASE_HEX, NULL, 0,
24527       NULL, HFILL }},
24528
24529     {&hf_ieee80211_tag_measure_map_field_bss,
24530      {"BSS", "wlan_mgt.measure.rep.repmode.mapfield.bss",
24531       FT_BOOLEAN, 8, TFS (&ieee80211_tag_measure_map_field_bss_flag), 0x01,
24532       NULL, HFILL }},
24533
24534     {&hf_ieee80211_tag_measure_map_field_odfm,
24535      {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan_mgt.measure.rep.repmode.mapfield.bss",
24536       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x02,
24537       NULL, HFILL }},
24538
24539     {&hf_ieee80211_tag_measure_map_field_unident_signal,
24540      {"Unidentified Signal", "wlan_mgt.measure.rep.repmode.mapfield.unidentsig",
24541       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x04,
24542       NULL, HFILL }},
24543
24544     {&hf_ieee80211_tag_measure_map_field_radar,
24545      {"Radar", "wlan_mgt.measure.rep.repmode.mapfield.radar",
24546       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x08,
24547       NULL, HFILL }},
24548
24549     {&hf_ieee80211_tag_measure_map_field_unmeasured,
24550      {"Unmeasured", "wlan_mgt.measure.rep.repmode.mapfield.unmeasured",
24551       FT_BOOLEAN, 8, TFS (&tfs_true_false), 0x10,
24552       NULL, HFILL }},
24553
24554     {&hf_ieee80211_tag_measure_map_field_reserved,
24555      {"Reserved", "wlan_mgt.measure.rep.repmode.mapfield.reserved",
24556       FT_UINT8, BASE_HEX, NULL, 0xe0,
24557       NULL, HFILL }},
24558
24559     {&hf_ieee80211_tag_measure_rpi_histogram_report,
24560      {"Receive Power Indicator (RPI) Histogram Report", "wlan_mgt.measure.rep.rpi.histogram_report",
24561       FT_BYTES, BASE_NONE, NULL, 0,
24562       NULL, HFILL }},
24563
24564     {&hf_ieee80211_tag_measure_rpi_histogram_report_0,
24565      {"RPI 0 Density", "wlan_mgt.measure.rep.rpi.rpi0density",
24566       FT_UINT8, BASE_HEX, NULL, 0,
24567       "Receive Power Indicator (RPI) 0 Density", HFILL }},
24568
24569     {&hf_ieee80211_tag_measure_rpi_histogram_report_1,
24570      {"RPI 1 Density", "wlan_mgt.measure.rep.rpi.rpi1density",
24571       FT_UINT8, BASE_HEX, NULL, 0,
24572       "Receive Power Indicator (RPI) 1 Density", HFILL }},
24573
24574     {&hf_ieee80211_tag_measure_rpi_histogram_report_2,
24575      {"RPI 2 Density", "wlan_mgt.measure.rep.rpi.rpi2density",
24576       FT_UINT8, BASE_HEX, NULL, 0,
24577       "Receive Power Indicator (RPI) 2 Density", HFILL }},
24578
24579     {&hf_ieee80211_tag_measure_rpi_histogram_report_3,
24580      {"RPI 3 Density", "wlan_mgt.measure.rep.rpi.rpi3density",
24581       FT_UINT8, BASE_HEX, NULL, 0,
24582       "Receive Power Indicator (RPI) 3 Density", HFILL }},
24583
24584     {&hf_ieee80211_tag_measure_rpi_histogram_report_4,
24585      {"RPI 4 Density", "wlan_mgt.measure.rep.rpi.rpi4density",
24586       FT_UINT8, BASE_HEX, NULL, 0,
24587       "Receive Power Indicator (RPI) 4 Density", HFILL }},
24588
24589     {&hf_ieee80211_tag_measure_rpi_histogram_report_5,
24590      {"RPI 5 Density", "wlan_mgt.measure.rep.rpi.rpi5density",
24591       FT_UINT8, BASE_HEX, NULL, 0,
24592       "Receive Power Indicator (RPI) 5 Density", HFILL }},
24593
24594     {&hf_ieee80211_tag_measure_rpi_histogram_report_6,
24595      {"RPI 6 Density", "wlan_mgt.measure.rep.rpi.rpi6density",
24596       FT_UINT8, BASE_HEX, NULL, 0,
24597       "Receive Power Indicator (RPI) 6 Density", HFILL }},
24598
24599     {&hf_ieee80211_tag_measure_rpi_histogram_report_7,
24600      {"RPI 7 Density", "wlan_mgt.measure.rep.rpi.rpi7density",
24601       FT_UINT8, BASE_HEX, NULL, 0,
24602       "Receive Power Indicator (RPI) 7 Density", HFILL }},
24603
24604     {&hf_ieee80211_tag_measure_report_operating_class,
24605      {"Operating Class", "wlan_mgt.measure.rep.operatingclass",
24606       FT_UINT8, BASE_DEC, NULL, 0,
24607       NULL, HFILL }},
24608
24609     {&hf_ieee80211_tag_measure_report_channel_load,
24610      {"Channel Load", "wlan_mgt.measure.rep.chanload",
24611       FT_UINT8, BASE_HEX, NULL, 0,
24612       NULL, HFILL }},
24613
24614     {&hf_ieee80211_tag_measure_report_frame_info,
24615      {"Reported Frame Information", "wlan_mgt.measure.rep.frameinfo",
24616       FT_UINT8, BASE_HEX, NULL, 0,
24617       NULL, HFILL }},
24618
24619     {&hf_ieee80211_tag_measure_report_frame_info_phy_type,
24620      {"Condensed PHY", "wlan_mgt.measure.rep.frameinfo.phytype",
24621       FT_UINT8, BASE_HEX, NULL, 0x7F,
24622       NULL, HFILL }},
24623
24624     {&hf_ieee80211_tag_measure_report_frame_info_frame_type,
24625      {"Reported Frame Type", "wlan_mgt.measure.rep.frameinfo.frametype",
24626       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_report_frame_info_frame_type_flag), 0x80,
24627       NULL, HFILL }},
24628
24629     {&hf_ieee80211_tag_measure_report_rcpi,
24630      {"Received Channel Power Indicator (RCPI)", "wlan_mgt.measure.rep.rcpi",
24631       FT_UINT8, BASE_HEX, NULL, 0,
24632       "in dBm", HFILL }},
24633
24634     {&hf_ieee80211_tag_measure_report_rsni,
24635      {"Received Signal to Noise Indicator (RSNI)", "wlan_mgt.measure.rep.rsni",
24636       FT_UINT8, BASE_HEX, NULL, 0,
24637       "in dB", HFILL }},
24638
24639     {&hf_ieee80211_tag_measure_report_bssid,
24640      {"BSSID Being Reported", "wlan_mgt.measure.rep.bssid",
24641       FT_ETHER, BASE_NONE, NULL, 0,
24642       NULL, HFILL }},
24643
24644     {&hf_ieee80211_tag_measure_report_ant_id,
24645      {"Antenna ID", "wlan_mgt.measure.rep.antid",
24646       FT_UINT8, BASE_HEX, NULL, 0,
24647       NULL, HFILL }},
24648
24649     {&hf_ieee80211_tag_measure_report_anpi,
24650      {"ANPI", "wlan_mgt.measure.rep.anpi",
24651       FT_UINT8, BASE_HEX, NULL, 0,
24652       NULL, HFILL }},
24653
24654     {&hf_ieee80211_tag_measure_report_ipi_density_0,
24655      {"IPI Density 0", "wlan_mgt.measure.rep.ipi_density0",
24656       FT_UINT8, BASE_HEX, NULL, 0,
24657       NULL, HFILL }},
24658
24659     {&hf_ieee80211_tag_measure_report_ipi_density_1,
24660      {"IPI Density 1", "wlan_mgt.measure.rep.ipi_density1",
24661       FT_UINT8, BASE_HEX, NULL, 0,
24662       NULL, HFILL }},
24663
24664     {&hf_ieee80211_tag_measure_report_ipi_density_2,
24665      {"IPI Density 2", "wlan_mgt.measure.rep.ipi_density2",
24666       FT_UINT8, BASE_HEX, NULL, 0,
24667       NULL, HFILL }},
24668
24669     {&hf_ieee80211_tag_measure_report_ipi_density_3,
24670      {"IPI Density 3", "wlan_mgt.measure.rep.ipi_density3",
24671       FT_UINT8, BASE_HEX, NULL, 0,
24672       NULL, HFILL }},
24673
24674     {&hf_ieee80211_tag_measure_report_ipi_density_4,
24675      {"IPI Density 4", "wlan_mgt.measure.rep.ipi_density4",
24676       FT_UINT8, BASE_HEX, NULL, 0,
24677       NULL, HFILL }},
24678
24679     {&hf_ieee80211_tag_measure_report_ipi_density_5,
24680      {"IPI Density 5", "wlan_mgt.measure.rep.ipi_density5",
24681       FT_UINT8, BASE_HEX, NULL, 0,
24682       NULL, HFILL }},
24683
24684     {&hf_ieee80211_tag_measure_report_ipi_density_6,
24685      {"IPI Density 6", "wlan_mgt.measure.rep.ipi_density6",
24686       FT_UINT8, BASE_HEX, NULL, 0,
24687       NULL, HFILL }},
24688
24689     {&hf_ieee80211_tag_measure_report_ipi_density_7,
24690      {"IPI Density 7", "wlan_mgt.measure.rep.ipi_density7",
24691       FT_UINT8, BASE_HEX, NULL, 0,
24692       NULL, HFILL }},
24693
24694     {&hf_ieee80211_tag_measure_report_ipi_density_8,
24695      {"IPI Density 8", "wlan_mgt.measure.rep.ipi_density8",
24696       FT_UINT8, BASE_HEX, NULL, 0,
24697       NULL, HFILL }},
24698
24699     {&hf_ieee80211_tag_measure_report_ipi_density_9,
24700      {"IPI Density 9", "wlan_mgt.measure.rep.ipi_density9",
24701       FT_UINT8, BASE_HEX, NULL, 0,
24702       NULL, HFILL }},
24703
24704     {&hf_ieee80211_tag_measure_report_ipi_density_10,
24705      {"IPI Density 10", "wlan_mgt.measure.rep.ipi_density10",
24706       FT_UINT8, BASE_HEX, NULL, 0,
24707       NULL, HFILL }},
24708
24709     {&hf_ieee80211_tag_measure_report_parent_tsf,
24710      {"Parent Timing Synchronization Function (TSF)", "wlan_mgt.measure.rep.parenttsf",
24711       FT_UINT32, BASE_HEX, NULL, 0,
24712       NULL, HFILL }},
24713
24714     {&hf_ieee80211_tag_measure_report_subelement_length,
24715      {"Length", "wlan_mgt.measure.req.sub.length",
24716       FT_UINT8, BASE_DEC, NULL, 0,
24717       NULL, HFILL }},
24718
24719     {&hf_ieee80211_tag_measure_report_beacon_sub_id,
24720      {"SubElement ID", "wlan_mgt.measure.req.beacon.sub.id",
24721       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_report_beacon_sub_id_vals), 0,
24722       NULL, HFILL }},
24723
24724     {&hf_ieee80211_tag_measure_report_unknown,
24725      {"Unknown Data", "wlan_mgt.measure.rep.unknown",
24726       FT_BYTES, BASE_NONE, NULL, 0,
24727       "(not interpreted)", HFILL }},
24728
24729     {&hf_ieee80211_tag_quiet_count,
24730      {"Count", "wlan_mgt.quiet.count",
24731       FT_UINT8, BASE_DEC, NULL, 0,
24732       "Set to the number of TBTTs until the beacon interval during which the next quiet interval shall start", HFILL }},
24733
24734     {&hf_ieee80211_tag_quiet_period,
24735      {"Period", "wlan_mgt.quiet.period",
24736       FT_UINT8, BASE_DEC, NULL, 0,
24737       "Set to the number of beacon intervals between the start of regularly scheduled quiet intervals", HFILL }},
24738
24739     {&hf_ieee80211_tag_quiet_duration,
24740      {"Duration", "wlan_mgt.quiet.duration",
24741       FT_UINT16, BASE_DEC, NULL, 0,
24742       "Set to the duration of the quiet interval", HFILL }},
24743
24744     {&hf_ieee80211_tag_quiet_offset,
24745      {"Offset", "wlan_mgt.quiet.offset",
24746       FT_UINT16, BASE_DEC, NULL, 0,
24747       "Set to the offset of the start of the quiet interval from the TBTT", HFILL }},
24748
24749     {&hf_ieee80211_tag_dfs_owner,
24750      {"Owner", "wlan_mgt.dfs.owner",
24751       FT_ETHER, BASE_NONE, NULL, 0,
24752       "Set to the individual IEEE MAC address of the STA that is the currently known DFS Owner in the IBSS", HFILL  }},
24753
24754     {&hf_ieee80211_tag_dfs_recovery_interval,
24755      {"Recovery Interval", "wlan_mgt.dfs.recovery_interval",
24756       FT_UINT8, BASE_DEC, NULL, 0,
24757       "Indicates the time interval that shall be used for DFS owner recovery", HFILL  }},
24758
24759     {&hf_ieee80211_tag_dfs_channel_map,
24760      {"Channel Map", "wlan_mgt.dfs.channel_map",
24761       FT_NONE, BASE_NONE, NULL, 0,
24762       NULL, HFILL  }},
24763
24764     {&hf_ieee80211_tag_dfs_channel_number,
24765      {"Channel Number", "wlan_mgt.dfs.channel_number",
24766       FT_UINT8, BASE_DEC, NULL, 0,
24767       NULL, HFILL  }},
24768
24769     {&hf_ieee80211_tag_dfs_map,
24770      {"Map", "wlan_mgt.dfs.map",
24771       FT_UINT8, BASE_HEX, NULL, 0,
24772       NULL, HFILL  }},
24773
24774     {&hf_ieee80211_tag_erp_info,
24775      {"ERP Information", "wlan_mgt.erp_info",
24776       FT_UINT8, BASE_HEX, NULL, 0,
24777       NULL, HFILL  }},
24778
24779     {&hf_ieee80211_tag_erp_info_erp_present,
24780      {"Non ERP Present", "wlan_mgt.erp_info.erp_present",
24781       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
24782       NULL, HFILL  }},
24783
24784     {&hf_ieee80211_tag_erp_info_use_protection,
24785      {"Use Protection", "wlan_mgt.erp_info.use_protection",
24786       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
24787       NULL, HFILL  }},
24788
24789     {&hf_ieee80211_tag_erp_info_barker_preamble_mode,
24790      {"Barker Preamble Mode", "wlan_mgt.erp_info.barker_preamble_mode",
24791       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
24792       NULL, HFILL  }},
24793
24794     {&hf_ieee80211_tag_erp_info_reserved,
24795      {"Reserved", "wlan_mgt.erp_info.reserved",
24796       FT_UINT8, BASE_HEX, NULL, 0xF8,
24797       NULL, HFILL  }},
24798
24799     /* Table 8-103-Capabilities field */
24800     {&hf_ieee80211_tag_extended_capabilities,
24801      {"Extended Capabilities", "wlan_mgt.extcap",
24802       FT_UINT8, BASE_HEX, NULL, 0,
24803       NULL, HFILL }},
24804
24805     /* P802.11n/D6.0 */
24806     /* Extended Capability octet 1 */
24807     {&hf_ieee80211_tag_extended_capabilities_b0,
24808      {"20/40 BSS Coexistence Management Support", "wlan_mgt.extcap.b0",
24809       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
24810       "HT Information Exchange Support", HFILL }},
24811
24812     /* P802.11p/D4.0 */
24813     {&hf_ieee80211_tag_extended_capabilities_b1,
24814      {"On-demand beacon", "wlan_mgt.extcap.b1",
24815       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
24816       NULL, HFILL }},
24817
24818     {&hf_ieee80211_tag_extended_capabilities_b2,
24819      {"Extended Channel Switching", "wlan_mgt.extcap.b2",
24820       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
24821       NULL, HFILL }},
24822
24823     {&hf_ieee80211_tag_extended_capabilities_b3,
24824      {"WAVE indication", "wlan_mgt.extcap.b3",
24825       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
24826       NULL, HFILL }},
24827     /*End: P802.11p/D4.0 */
24828
24829     {&hf_ieee80211_tag_extended_capabilities_b4,
24830      {"PSMP Capability", "wlan_mgt.extcap.b4",
24831       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
24832       NULL, HFILL }},
24833
24834     {&hf_ieee80211_tag_extended_capabilities_b5,
24835      {"Reserved", "wlan_mgt.extcap.b5",
24836       FT_UINT8, BASE_HEX, NULL, 0x20,
24837       "Must be zero", HFILL }},
24838
24839     {&hf_ieee80211_tag_extended_capabilities_b6,
24840      {"S-PSMP Support", "wlan_mgt.extcap.b6",
24841       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24842       NULL, HFILL }},
24843
24844     {&hf_ieee80211_tag_extended_capabilities_b7,
24845      {"Event", "wlan_mgt.extcap.b7",
24846       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
24847       NULL, HFILL }},
24848
24849
24850     /* Extended Capability octet 2 */
24851     {&hf_ieee80211_tag_extended_capabilities_b8,
24852      {"Diagnostics", "wlan_mgt.extcap.b8",
24853       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
24854       NULL, HFILL }},
24855
24856     {&hf_ieee80211_tag_extended_capabilities_b9,
24857      {"Multicast Diagnostics", "wlan_mgt.extcap.b9",
24858       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
24859       NULL, HFILL }},
24860
24861     {&hf_ieee80211_tag_extended_capabilities_b10,
24862      {"Location Tracking", "wlan_mgt.extcap.b10",
24863       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
24864       NULL, HFILL }},
24865
24866     {&hf_ieee80211_tag_extended_capabilities_b11,
24867      {"FMS", "wlan_mgt.extcap.b11",
24868       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
24869       NULL, HFILL }},
24870
24871     {&hf_ieee80211_tag_extended_capabilities_b12,
24872      {"Proxy ARP Service", "wlan_mgt.extcap.b12",
24873       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
24874       NULL, HFILL }},
24875
24876     {&hf_ieee80211_tag_extended_capabilities_b13,
24877      {"Collocated Interference Reporting", "wlan_mgt.extcap.b13",
24878       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
24879       NULL, HFILL }},
24880
24881     {&hf_ieee80211_tag_extended_capabilities_b14,
24882      {"Civic Location", "wlan_mgt.extcap.b14",
24883       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24884       NULL, HFILL }},
24885
24886     {&hf_ieee80211_tag_extended_capabilities_b15,
24887      {"Geospatial Location", "wlan_mgt.extcap.b15",
24888       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
24889       NULL, HFILL }},
24890
24891
24892     /* Extended Capability octet 3 */
24893     {&hf_ieee80211_tag_extended_capabilities_b16,
24894      {"TFS", "wlan_mgt.extcap.b16",
24895       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
24896       NULL, HFILL }},
24897
24898     {&hf_ieee80211_tag_extended_capabilities_b17,
24899      {"WNM-Sleep Mode", "wlan_mgt.extcap.b17",
24900       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
24901       NULL, HFILL }},
24902
24903     {&hf_ieee80211_tag_extended_capabilities_b18,
24904      {"TIM Broadcast", "wlan_mgt.extcap.b18",
24905       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
24906       NULL, HFILL }},
24907
24908     {&hf_ieee80211_tag_extended_capabilities_b19,
24909      {"BSS Transition", "wlan_mgt.extcap.b19",
24910       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
24911       NULL, HFILL }},
24912
24913     {&hf_ieee80211_tag_extended_capabilities_b20,
24914      {"QoS Traffic Capability", "wlan_mgt.extcap.b20",
24915       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
24916       NULL, HFILL }},
24917
24918     {&hf_ieee80211_tag_extended_capabilities_b21,
24919      {"AC Station Count", "wlan_mgt.extcap.b21",
24920       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
24921       NULL, HFILL }},
24922
24923     {&hf_ieee80211_tag_extended_capabilities_b22,
24924      {"Multiple BSSID", "wlan_mgt.extcap.b22",
24925       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24926       NULL, HFILL }},
24927
24928     {&hf_ieee80211_tag_extended_capabilities_b23,
24929      {"Timing Measurement", "wlan_mgt.extcap.b23",
24930       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
24931       NULL, HFILL }},
24932
24933
24934     /* Extended Capability octet 4 */
24935     {&hf_ieee80211_tag_extended_capabilities_b24,
24936      {"Channel Usage", "wlan_mgt.extcap.b24",
24937       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
24938       NULL, HFILL }},
24939
24940     {&hf_ieee80211_tag_extended_capabilities_b25,
24941      {"SSID List", "wlan_mgt.extcap.b25",
24942       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
24943       NULL, HFILL }},
24944
24945     {&hf_ieee80211_tag_extended_capabilities_b26,
24946      {"DMS", "wlan_mgt.extcap.b26",
24947       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
24948       NULL, HFILL }},
24949
24950     {&hf_ieee80211_tag_extended_capabilities_b27,
24951      {"UTC TSF Offset", "wlan_mgt.extcap.b27",
24952       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
24953       NULL, HFILL }},
24954
24955     {&hf_ieee80211_tag_extended_capabilities_b28,
24956      {"Peer U-APSD Buffer STA Support", "wlan_mgt.extcap.b28",
24957       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
24958       NULL, HFILL }},
24959
24960     {&hf_ieee80211_tag_extended_capabilities_b29,
24961      {"TDLS Peer PSM Support", "wlan_mgt.extcap.b29",
24962       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
24963       NULL, HFILL }},
24964
24965     {&hf_ieee80211_tag_extended_capabilities_b30,
24966      {"TDLS channel switching", "wlan_mgt.extcap.b30",
24967       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
24968       NULL, HFILL }},
24969
24970     {&hf_ieee80211_tag_extended_capabilities_b31,
24971      {"Interworking", "wlan_mgt.extcap.b31",
24972       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
24973       NULL, HFILL }},
24974
24975
24976     /* Extended Capability octet 5 */
24977     {&hf_ieee80211_tag_extended_capabilities_b32,
24978      {"QoS Map", "wlan_mgt.extcap.b32",
24979       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
24980       NULL, HFILL }},
24981
24982     {&hf_ieee80211_tag_extended_capabilities_b33,
24983      {"EBR", "wlan_mgt.extcap.b33",
24984       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
24985       NULL, HFILL }},
24986
24987     {&hf_ieee80211_tag_extended_capabilities_b34,
24988      {"SSPN Interface", "wlan_mgt.extcap.b34",
24989       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
24990       NULL, HFILL }},
24991
24992     {&hf_ieee80211_tag_extended_capabilities_b35,
24993      {"Reserved", "wlan_mgt.extcap.b35",
24994       FT_UINT8, BASE_HEX, NULL, 0x08,
24995       "Must be zero", HFILL }},
24996
24997     {&hf_ieee80211_tag_extended_capabilities_b36,
24998      {"MSGCF Capability", "wlan_mgt.extcap.b36",
24999       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
25000       NULL, HFILL }},
25001
25002     {&hf_ieee80211_tag_extended_capabilities_b37,
25003      {"TDLS support", "wlan_mgt.extcap.b37",
25004       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25005       NULL, HFILL }},
25006
25007     {&hf_ieee80211_tag_extended_capabilities_b38,
25008      {"TDLS Prohibited", "wlan_mgt.extcap.b38",
25009       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25010       NULL, HFILL }},
25011
25012     {&hf_ieee80211_tag_extended_capabilities_b39,
25013      {"TDLS Channel Switching Prohibited", "wlan_mgt.extcap.b39",
25014       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
25015       NULL, HFILL }},
25016
25017     /* Extended Capability octet 6 */
25018     {&hf_ieee80211_tag_extended_capabilities_b40,
25019      {"Reject Unadmitted Frame", "wlan_mgt.extcap.b40",
25020       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25021       NULL, HFILL }},
25022
25023     {&hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
25024      {"Service Interval Granularity",
25025       "wlan_mgt.extcap.serv_int_granularity",
25026       FT_UINT8, BASE_DEC, VALS(service_interval_granularity_vals), 0x0e,
25027       NULL, HFILL }},
25028
25029     {&hf_ieee80211_tag_extended_capabilities_b44,
25030      {"Identifier Location", "wlan_mgt.extcap.b44",
25031       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
25032       NULL, HFILL }},
25033
25034     {&hf_ieee80211_tag_extended_capabilities_b45,
25035      {"U-APSD Coexistence", "wlan_mgt.extcap.b45",
25036       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25037       NULL, HFILL }},
25038
25039     {&hf_ieee80211_tag_extended_capabilities_b46,
25040      {"WNM-Notification", "wlan_mgt.extcap.b46",
25041       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25042       NULL, HFILL }},
25043
25044     {&hf_ieee80211_tag_extended_capabilities_b47,
25045      {"QAB Capability", "wlan_mgt.extcap.b47",
25046       FT_UINT8, BASE_HEX, NULL, 0x80,
25047       "AP supports QAB", HFILL }},
25048
25049     /* Extended Capability octet 7 */
25050     {&hf_ieee80211_tag_extended_capabilities_b48,
25051      {"UTF-8 SSID", "wlan_mgt.extcap.b48",
25052       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
25053       "The SSID in this BSS is interpreted using UTF-8 encoding", HFILL }},
25054
25055     {&hf_ieee80211_tag_extended_capabilities_o7,
25056      {"Reserved", "wlan_mgt.extcap.o7",
25057       FT_UINT8, BASE_HEX, NULL, 0xfe,
25058       "Must be zero", HFILL }},
25059
25060     /* Extended Capability octet 8 */
25061     {&hf_ieee80211_tag_extended_capabilities_b61,
25062      {"TDLS Wider Bandwidth", "wlan_mgt.extcap.b61",
25063       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
25064       NULL, HFILL }},
25065
25066     {&hf_ieee80211_tag_extended_capabilities_b62,
25067      {"Operating Mode Notification", "wlan_mgt.extcap.b62",
25068       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
25069       NULL, HFILL }},
25070
25071     {&hf_ieee80211_tag_extended_capabilities_b63,
25072      {"Max Number Of MSDUs In A-MSDU", "wlan_mgt.extcap.b63",
25073       FT_UINT8, BASE_DEC, NULL, 0x80,
25074       "Part 1 (bit63)", HFILL }},
25075
25076     {&hf_ieee80211_tag_extended_capabilities_o8,
25077      {"Reserved", "wlan_mgt.extcap.o8",
25078       FT_UINT8, BASE_HEX, NULL, 0x1f,
25079       "Must be zero", HFILL }},
25080
25081     /* Extended Capability octet 9 */
25082     {&hf_ieee80211_tag_extended_capabilities_b64,
25083      {"Max Number Of MSDUs In A-MSDU64", "wlan_mgt.extcap.b64",
25084       FT_UINT8, BASE_DEC, NULL, 0x01,
25085       "Part 2 (bit64)", HFILL }},
25086
25087     {&hf_ieee80211_tag_extended_capabilities_o9,
25088      {"Reserved", "wlan_mgt.extcap.o9",
25089       FT_UINT8, BASE_HEX, NULL, 0xfe,
25090       "Must be zero", HFILL }},
25091
25092     {&hf_ieee80211_tag_cisco_ccx1_unknown,
25093      {"Unknown", "wlan_mgt.cisco.ccx1.unknown",
25094       FT_BYTES, BASE_NONE, NULL, 0,
25095       NULL, HFILL }},
25096
25097     {&hf_ieee80211_tag_cisco_ccx1_name,
25098      {"Name", "wlan_mgt.cisco.ccx1.name",
25099       FT_STRING, BASE_NONE, NULL, 0,
25100       NULL, HFILL }},
25101
25102     {&hf_ieee80211_tag_cisco_ccx1_clients,
25103      {"Clients", "wlan_mgt.cisco.ccx1.clients",
25104       FT_UINT8, BASE_DEC, NULL, 0,
25105       NULL, HFILL }},
25106
25107     {&hf_ieee80211_tag_cisco_ccx1_unknown2,
25108      {"Unknown2", "wlan_mgt.cisco.ccx1.unknown2",
25109       FT_BYTES, BASE_NONE, NULL, 0,
25110       NULL, HFILL }},
25111
25112     {&hf_ieee80211_tag_neighbor_report_bssid,
25113      {"BSSID", "wlan_mgt.nreport.bssid",
25114       FT_ETHER, BASE_NONE, NULL, 0,
25115       NULL, HFILL }},
25116
25117     {&hf_ieee80211_tag_neighbor_report_bssid_info,
25118      {"BSSID Information", "wlan_mgt.nreport.bssid.info",
25119       FT_UINT32, BASE_HEX, NULL, 0,
25120       NULL, HFILL }},
25121
25122     {&hf_ieee80211_tag_neighbor_report_bssid_info_reachability,
25123      {"AP Reachability", "wlan_mgt.nreport.bssid.info.reachability",
25124       FT_UINT32, BASE_HEX, VALS(ieee80211_neighbor_report_bssid_info_reachability_vals), 0x00000003,
25125       "Indicates whether the AP identified by this BSSID is reachable by the STA that requested the neighbor report", HFILL }},
25126
25127     {&hf_ieee80211_tag_neighbor_report_bssid_info_security,
25128      {"Security", "wlan_mgt.nreport.bssid.info.security",
25129       FT_BOOLEAN, 32, NULL, 0x00000004,
25130       "Indicates that the AP identified by this BSSID supports the same security provisioning as used by the STA in its current association", HFILL }},
25131
25132     {&hf_ieee80211_tag_neighbor_report_bssid_info_key_scope,
25133      {"Key Scope", "wlan_mgt.nreport.bssid.info.keyscope",
25134       FT_BOOLEAN, 32, NULL, 0x00000008,
25135       "indicates the AP indicated by this BSSID has the same authenticator as the AP sending the report", HFILL }},
25136
25137     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability,
25138      {"Capability", "wlan_mgt.nreport.bssid.info.capability",
25139       FT_UINT32, BASE_HEX, NULL, 0x000003F0,
25140       "Contains selected capability information for the AP indicated by this BSSID", HFILL }},
25141
25142     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng,
25143      {"Spectrum Management", "wlan_mgt.nreport.bssid.info.capability.specmngt",
25144       FT_BOOLEAN, 32, NULL, 0x00000010,
25145       NULL, HFILL }},
25146
25147     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos,
25148      {"QoS", "wlan_mgt.nreport.bssid.info.capability.qos",
25149       FT_BOOLEAN, 32, NULL, 0x00000020,
25150       NULL, HFILL }},
25151
25152     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd,
25153      {"APSD", "wlan_mgt.nreport.bssid.info.capability.apsd",
25154       FT_BOOLEAN, 32, NULL, 0x00000040,
25155       NULL, HFILL }},
25156
25157     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt,
25158      {"Radio Measurement", "wlan_mgt.nreport.bssid.info.capability.radiomsnt",
25159       FT_BOOLEAN, 32, NULL, 0x00000080,
25160       NULL, HFILL }},
25161
25162     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback,
25163      {"Delayed Block Ack", "wlan_mgt.nreport.bssid.info.capability.dback",
25164       FT_BOOLEAN, 32, NULL, 0x000000100,
25165       NULL, HFILL }},
25166
25167     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback,
25168      {"Immediate Block Ack", "wlan_mgt.nreport.bssid.info.capability.iback",
25169       FT_BOOLEAN, 32, NULL, 0x00000200,
25170       NULL, HFILL }},
25171
25172     {&hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain,
25173      {"Mobility Domain", "wlan_mgt.nreport.bssid.info.mobilitydomain",
25174       FT_BOOLEAN, 32, NULL, 0x00000400,
25175       "", HFILL }},
25176
25177     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput,
25178      {"High Throughput Control (+HTC)", "wlan_mgt.nreport.bssid.info.hthoughput",
25179       FT_BOOLEAN, 32, NULL, 0x00000800,
25180       NULL, HFILL }},
25181
25182     {&hf_ieee80211_tag_neighbor_report_bssid_info_reserved,
25183      {"Reserved", "wlan_mgt.nreport.bssid.info.reserved",
25184       FT_UINT32, BASE_HEX, NULL, 0xFFFFF000,
25185       "Must be zero", HFILL }},
25186
25187     {&hf_ieee80211_tag_neighbor_report_ope_class,
25188      {"Operating Class", "wlan_mgt.nreport.opeclass",
25189       FT_UINT8, BASE_DEC, NULL, 0,
25190       NULL, HFILL }},
25191
25192     {&hf_ieee80211_tag_neighbor_report_channel_number,
25193      {"Channel Number", "wlan_mgt.nreport.channumber",
25194       FT_UINT8, BASE_CUSTOM, CF_FUNC(channel_number_custom), 0,
25195       NULL, HFILL }},
25196
25197     {&hf_ieee80211_tag_neighbor_report_phy_type,
25198      {"PHY Type", "wlan_mgt.nreport.phytype",
25199       FT_UINT8, BASE_HEX, NULL, 0,
25200       NULL, HFILL }},
25201
25202     {&hf_ieee80211_tag_neighbor_report_subelement_id,
25203      {"Subelement ID", "wlan_mgt.nreport.subelement_id",
25204       FT_UINT8, BASE_HEX, VALS(ieee80211_neighbor_report_subelement_id_vals), 0,
25205       NULL, HFILL }},
25206
25207     {&hf_ieee80211_tag_neighbor_report_subelement_length,
25208      {"Length", "wlan_mgt.nreport.phytype.subelement_length",
25209       FT_UINT8, BASE_HEX, NULL, 0,
25210       NULL, HFILL }},
25211
25212     {&hf_ieee80211_tag_supported_ope_classes_current,
25213      {"Current Operating Class", "wlan_mgt.supopeclass.current",
25214       FT_UINT8, BASE_HEX, NULL, 0,
25215       NULL, HFILL }},
25216
25217     {&hf_ieee80211_tag_supported_ope_classes_alternate,
25218      {"Alternate Operating Classes", "wlan_mgt.supopeclass.alt",
25219       FT_STRING, BASE_NONE, NULL, 0,
25220       NULL, HFILL }},
25221
25222     {&hf_ieee80211_wfa_ie_type,
25223      {"Type", "wlan_mgt.wfa.ie.type",
25224       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_type_vals), 0,
25225       NULL, HFILL }},
25226
25227     {&hf_ieee80211_wfa_ie_wpa_version,
25228      {"WPA Version", "wlan_mgt.wfa.ie.wpa.version",
25229       FT_UINT16, BASE_DEC, NULL, 0,
25230       NULL, HFILL }},
25231
25232     {&hf_ieee80211_wfa_ie_wpa_mcs,
25233      {"Multicast Cipher Suite", "wlan_mgt.wfa.ie.wpa.mcs",
25234       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_mcs_base_custom), 0,
25235       "Contains the cipher suite selector used by the BSS to protect broadcast/multicasttraffic", HFILL }},
25236
25237     {&hf_ieee80211_wfa_ie_wpa_mcs_oui,
25238      {"Multicast Cipher Suite OUI", "wlan_mgt.wfa.ie.wpa.mcs.oui",
25239       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
25240       NULL, HFILL }},
25241
25242     {&hf_ieee80211_wfa_ie_wpa_mcs_type,
25243      {"Multicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.mcs.type",
25244       FT_UINT8, BASE_DEC, NULL, 0,
25245       NULL, HFILL }},
25246
25247     {&hf_ieee80211_wfa_ie_wpa_mcs_wfa_type,
25248      {"Multicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.mcs.type",
25249       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
25250       NULL, HFILL }},
25251
25252     {&hf_ieee80211_wfa_ie_wpa_ucs_count,
25253      {"Unicast Cipher Suite Count", "wlan_mgt.wfa.ie.wpa.ucs.count",
25254       FT_UINT16, BASE_DEC, NULL, 0,
25255       "Indicates the number of pairwise cipher suite selectors that are contained in the Unicast Cipher Suite List", HFILL }},
25256
25257     {&hf_ieee80211_wfa_ie_wpa_ucs_list,
25258      {"Unicast Cipher Suite List", "wlan_mgt.wfa.ie.wpa.ucs.list",
25259       FT_NONE, BASE_NONE, NULL, 0,
25260       "Contains a series of cipher suite selectors that indicate the Unicast cipher suites", HFILL }},
25261
25262     {&hf_ieee80211_wfa_ie_wpa_ucs,
25263      {"Unicast Cipher Suite", "wlan_mgt.wfa.ie.wpa.ucs",
25264       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_ucs_base_custom), 0,
25265       NULL, HFILL }},
25266
25267     {&hf_ieee80211_wfa_ie_wpa_ucs_oui,
25268      {"Unicast Cipher Suite OUI", "wlan_mgt.wfa.ie.wpau.cs.oui",
25269       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
25270       NULL, HFILL }},
25271
25272     {&hf_ieee80211_wfa_ie_wpa_ucs_type,
25273      {"Unicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.ucs.type",
25274       FT_UINT8, BASE_DEC, NULL, 0,
25275       NULL, HFILL }},
25276
25277     {&hf_ieee80211_wfa_ie_wpa_ucs_wfa_type,
25278      {"Unicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.ucs.type",
25279       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
25280       NULL, HFILL }},
25281
25282     {&hf_ieee80211_wfa_ie_wpa_akms_count,
25283      {"Auth Key Management (AKM) Suite Count", "wlan_mgt.wfa.ie.wpa.akms.count",
25284       FT_UINT16, BASE_DEC, NULL, 0,
25285       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
25286
25287     {&hf_ieee80211_wfa_ie_wpa_akms_list,
25288      {"Auth Key Management (AKM) List", "wlan_mgt.wfa.ie.wpa.akms.list",
25289       FT_NONE, BASE_NONE, NULL, 0,
25290       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
25291
25292     {&hf_ieee80211_wfa_ie_wpa_akms,
25293      {"Auth Key Management (AKM) Suite", "wlan_mgt.wfa.ie.wpa.akms",
25294       FT_UINT32, BASE_CUSTOM, CF_FUNC(wpa_akms_base_custom), 0,
25295       NULL, HFILL }},
25296
25297     {&hf_ieee80211_wfa_ie_wpa_akms_oui,
25298      {"Auth Key Management (AKM) OUI", "wlan_mgt.wfa.ie.wpa.akms.oui",
25299       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
25300       NULL, HFILL }},
25301
25302     {&hf_ieee80211_wfa_ie_wpa_akms_type,
25303      {"Auth Key Management (AKM) type", "wlan_mgt.wfa.ie.wpa.akms.type",
25304       FT_UINT8, BASE_DEC, NULL, 0,
25305       NULL, HFILL }},
25306
25307     {&hf_ieee80211_wfa_ie_wpa_akms_wfa_type,
25308      {"Auth Key Management (AKM) type", "wlan_mgt.wfa.ie.wpa.type",
25309       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_keymgmt_vals), 0,
25310       NULL, HFILL }},
25311
25312     {&hf_ieee80211_wfa_ie_wme_subtype,
25313      {"WME Subtype", "wlan_mgt.wfa.ie.wme.subtype",
25314       FT_UINT8, BASE_DEC, VALS(ieee802111_wfa_ie_wme_type), 0,
25315       NULL, HFILL }},
25316
25317     {&hf_ieee80211_wfa_ie_wme_version,
25318      {"WME Version", "wlan_mgt.wfa.ie.wme.version",
25319       FT_UINT8, BASE_DEC, NULL, 0,
25320       NULL, HFILL }},
25321
25322     {&hf_ieee80211_wfa_ie_wme_qos_info,
25323      {"WME QoS Info", "wlan_mgt.wfa.ie.wme.qos_info",
25324       FT_UINT8, BASE_HEX, NULL, 0,
25325       NULL, HFILL }},
25326
25327     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
25328      {"Max SP Length", "wlan_mgt.wfa.ie.wme.qos_info.sta.max_sp_length",
25329       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals), 0x60,
25330       NULL, HFILL }},
25331
25332     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
25333      {"AC_BE", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_be",
25334       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x08,
25335       NULL, HFILL }},
25336
25337     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
25338      {"AC_BK", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_bk",
25339       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x04,
25340       NULL, HFILL }},
25341
25342     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
25343      {"AC_VI", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_vi",
25344       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x02,
25345       NULL, HFILL }},
25346
25347     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
25348      {"AC_VO", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_vo",
25349       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x01,
25350       NULL, HFILL }},
25351
25352     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
25353      {"Reserved", "wlan_mgt.wfa.ie.wme.qos_info.sta.reserved",
25354       FT_UINT8, BASE_HEX, NULL, 0x90,
25355       "Must Be Zero", HFILL }},
25356
25357     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
25358      {"U-APSD", "wlan_mgt.wfa.ie.wme.qos_info.ap.u_apsd",
25359       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
25360       "Indicates the WMM AP is currently supporting unscheduled automatic power save delivery", HFILL }},
25361
25362     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
25363      {"Parameter Set Count", "wlan_mgt.wfa.ie.wme.qos_info.ap.parameter_set_count",
25364       FT_UINT8, BASE_HEX, NULL, 0x0F,
25365       NULL, HFILL }},
25366
25367     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
25368      {"Reserved", "wlan_mgt.wfa.ie.wme.qos_info.ap.reserved",
25369       FT_UINT8, BASE_HEX, NULL, 0x70,
25370       "Must Be Zero", HFILL }},
25371
25372     {&hf_ieee80211_wfa_ie_wme_reserved,
25373      {"Reserved", "wlan_mgt.wfa.ie.wme.reserved",
25374       FT_BYTES, BASE_NONE, NULL, 0,
25375       "Must Be Zero", HFILL }},
25376
25377     {&hf_ieee80211_wfa_ie_wme_ac_parameters,
25378      {"Ac Parameters", "wlan_mgt.wfa.ie.wme.acp",
25379       FT_NONE, BASE_NONE, NULL, 0,
25380       NULL, HFILL }},
25381
25382     {&hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
25383      {"ACI / AIFSN Field", "wlan_mgt.wfa.ie.wme.acp.aci_aifsn",
25384       FT_UINT8, BASE_HEX, NULL, 0,
25385       NULL, HFILL }},
25386
25387     {&hf_ieee80211_wfa_ie_wme_acp_aci,
25388      {"ACI", "wlan_mgt.wfa.ie.wme.acp.aci",
25389       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wme_acs_vals), 0x60,
25390       NULL, HFILL }},
25391
25392     {&hf_ieee80211_wfa_ie_wme_acp_acm,
25393      {"Admission Control Mandatory", "wlan_mgt.wfa.ie.wme.acp.acm",
25394       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
25395       NULL, HFILL }},
25396
25397     {&hf_ieee80211_wfa_ie_wme_acp_aifsn,
25398      {"AIFSN", "wlan_mgt.wfa.ie.wme.acp.aifsn",
25399       FT_UINT8, BASE_DEC, NULL, 0x0F,
25400       NULL, HFILL }},
25401
25402     {&hf_ieee80211_wfa_ie_wme_acp_reserved,
25403      {"Reserved", "wlan_mgt.wfa.ie.wme.acp.reserved",
25404       FT_UINT8, BASE_DEC, NULL, 0x80,
25405       "Must be Zero", HFILL }},
25406
25407     {&hf_ieee80211_wfa_ie_wme_acp_ecw,
25408      {"ECW", "wlan_mgt.wfa.ie.wme.acp.ecw",
25409       FT_UINT8, BASE_HEX, NULL, 0x00,
25410       NULL, HFILL }},
25411
25412     {&hf_ieee80211_wfa_ie_wme_acp_ecw_max,
25413      {"ECW Max", "wlan_mgt.wfa.ie.wme.acp.ecw.max",
25414       FT_UINT8, BASE_DEC, NULL, 0xF0,
25415       NULL, HFILL }},
25416
25417     {&hf_ieee80211_wfa_ie_wme_acp_ecw_min,
25418      {"ECW Min", "wlan_mgt.wfa.ie.wme.acp.ecw.min",
25419       FT_UINT8, BASE_DEC, NULL, 0x0F,
25420       NULL, HFILL }},
25421
25422     {&hf_ieee80211_wfa_ie_wme_acp_txop_limit,
25423      {"TXOP Limit", "wlan_mgt.wfa.ie.wme.acp.txop_limit",
25424       FT_UINT16, BASE_DEC, NULL, 0x00,
25425       NULL, HFILL }},
25426
25427     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
25428      {"TS Info", "wlan_mgt.wfa.ie.wme.tspec.ts_info",
25429       FT_UINT24, BASE_HEX, NULL, 0,
25430       "Traffic Stream (TS) Info", HFILL }},
25431
25432     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
25433      {"TID", "wlan_mgt.wfa.ie.wme.tspec.ts_info.tid",
25434       FT_UINT24, BASE_DEC, NULL, 0x00001E,
25435       "Traffic Stream Info ID (TID)", HFILL }},
25436
25437     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
25438      {"Direction", "wlan_mgt.wfa.ie.wme.tspec.ts_info.dir",
25439       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals), 0x000060,
25440       "Traffic Stream (TS) Info Direction", HFILL }},
25441
25442     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
25443      {"PSB", "wlan_mgt.wfa.ie.wme.tspec.ts_info.psb",
25444       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals), 0x000400,
25445       "Traffic Stream (TS) Info Power Save Behavior (PSB)", HFILL }},
25446
25447     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
25448      {"UP", "wlan_mgt.wfa.ie.wme.tspec.ts_info.up",
25449       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals), 0x003800,
25450       "Traffic Stream (TS) Info User Priority (UP)", HFILL }},
25451
25452     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
25453      {"Reserved", "wlan_mgt.wfa.ie.wme.tspec.ts_info.reserved",
25454       FT_UINT24, BASE_HEX, NULL, 0xFFC381,
25455       "Must be Zero", HFILL }},
25456
25457     {&hf_ieee80211_wfa_ie_wme_tspec_nor_msdu,
25458      {"Normal MSDU Size", "wlan_mgt.wfa.ie.wme.tspec.nor_msdu",
25459       FT_UINT16, BASE_DEC, NULL, 0,
25460       NULL, HFILL }},
25461
25462     {&hf_ieee80211_wfa_ie_wme_tspec_max_msdu,
25463      {"Maximum MSDU Size", "wlan_mgt.wfa.ie.wme.tspec.max_msdu",
25464       FT_UINT16, BASE_DEC, NULL, 0,
25465       NULL, HFILL }},
25466
25467     {&hf_ieee80211_wfa_ie_wme_tspec_min_srv,
25468      {"Minimum Service Interval", "wlan_mgt.wfa.ie.wme.tspec.min_srv",
25469       FT_UINT32, BASE_DEC, NULL, 0,
25470       NULL, HFILL }},
25471
25472     {&hf_ieee80211_wfa_ie_wme_tspec_max_srv,
25473      {"Maximum Service Interval", "wlan_mgt.wfa.ie.wme.tspec.max_srv",
25474       FT_UINT32, BASE_DEC, NULL, 0,
25475       NULL, HFILL }},
25476
25477     {&hf_ieee80211_wfa_ie_wme_tspec_inact_int,
25478      {"Inactivity Interval", "wlan_mgt.wfa.ie.wme.tspec.inact_int",
25479       FT_UINT32, BASE_DEC, NULL, 0,
25480       NULL, HFILL }},
25481
25482     {&hf_ieee80211_wfa_ie_wme_tspec_susp_int,
25483      {"Suspension Interval", "wlan_mgt.wfa.ie.wme.tspec.susp_int",
25484       FT_UINT32, BASE_DEC, NULL, 0,
25485       NULL, HFILL }},
25486
25487     {&hf_ieee80211_wfa_ie_wme_tspec_srv_start,
25488      {"Service Start Time", "wlan_mgt.wfa.ie.wme.tspec.srv_start",
25489       FT_UINT32, BASE_DEC, NULL, 0,
25490       NULL, HFILL }},
25491
25492     {&hf_ieee80211_wfa_ie_wme_tspec_min_data,
25493      {"Minimum Data Rate", "wlan_mgt.wfa.ie.wme.tspec.min_data",
25494       FT_UINT32, BASE_DEC, NULL, 0,
25495       NULL, HFILL }},
25496
25497     {&hf_ieee80211_wfa_ie_wme_tspec_mean_data,
25498      {"Mean Data Rate", "wlan_mgt.wfa.ie.wme.tspec.mean_data",
25499       FT_UINT32, BASE_DEC, NULL, 0,
25500       NULL, HFILL }},
25501
25502     {&hf_ieee80211_wfa_ie_wme_tspec_peak_data,
25503      {"Peak Data Rate", "wlan_mgt.wfa.ie.wme.tspec.peak_data",
25504       FT_UINT32, BASE_DEC, NULL, 0,
25505       NULL, HFILL }},
25506
25507     {&hf_ieee80211_wfa_ie_wme_tspec_burst_size,
25508      {"Burst Size", "wlan_mgt.wfa.ie.wme.tspec.burst_size",
25509       FT_UINT32, BASE_DEC, NULL, 0,
25510       NULL, HFILL }},
25511
25512     {&hf_ieee80211_wfa_ie_wme_tspec_delay_bound,
25513      {"Delay Bound", "wlan_mgt.wfa.ie.wme.tspec.delay_bound",
25514       FT_UINT32, BASE_DEC, NULL, 0,
25515       NULL, HFILL }},
25516
25517     {&hf_ieee80211_wfa_ie_wme_tspec_min_phy,
25518      {"Minimum PHY Rate", "wlan_mgt.wfa.ie.wme.tspec.min_phy",
25519       FT_UINT32, BASE_DEC, NULL, 0,
25520       NULL, HFILL }},
25521
25522     {&hf_ieee80211_wfa_ie_wme_tspec_surplus,
25523      {"Surplus Bandwidth Allowance", "wlan_mgt.wfa.ie.wme.tspec.surplus",
25524       FT_UINT16, BASE_DEC, NULL, 0,
25525       NULL, HFILL }},
25526
25527     {&hf_ieee80211_wfa_ie_wme_tspec_medium,
25528      {"Medium Time", "wlan_mgt.wfa.ie.wme.tspec.medium",
25529       FT_UINT16, BASE_DEC, NULL, 0,
25530       NULL, HFILL }},
25531
25532     {&hf_ieee80211_rsn_ie_pmkid,
25533      {"RSN PMKID", "wlan_mgt.rsn.ie.pmkid",
25534       FT_BYTES, BASE_NONE, NULL, 0,
25535       NULL, HFILL }},
25536
25537     {&hf_ieee80211_rsn_ie_unknown,
25538      {"RSN Unknown", "wlan_mgt.rsn.ie.unknown",
25539       FT_BYTES, BASE_NONE, NULL, 0,
25540       NULL, HFILL }},
25541
25542     {&hf_ieee80211_marvell_ie_type,
25543      {"Type", "wlan_mgt.marvell.ie.type",
25544       FT_UINT8, BASE_HEX, NULL, 0,
25545       NULL, HFILL }},
25546
25547     {&hf_ieee80211_marvell_ie_mesh_subtype,
25548      {"Subtype", "wlan_mgt.marvell.ie.subtype",
25549       FT_UINT8, BASE_HEX, NULL, 0,
25550       NULL, HFILL }},
25551
25552     {&hf_ieee80211_marvell_ie_mesh_version,
25553      {"Version", "wlan_mgt.marvell.ie.version",
25554       FT_UINT8, BASE_HEX, NULL, 0,
25555       NULL, HFILL }},
25556
25557     {&hf_ieee80211_marvell_ie_mesh_active_proto_id,
25558      {"Path Selection Protocol", "wlan_mgt.marvell.ie.proto_id",
25559       FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0,
25560       NULL, HFILL }},
25561
25562     {&hf_ieee80211_marvell_ie_mesh_active_metric_id,
25563      {"Path Selection Metric", "wlan_mgt.marvell.ie.metric_id",
25564       FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0,
25565       NULL, HFILL }},
25566
25567     {&hf_ieee80211_marvell_ie_mesh_cap,
25568      {"Mesh Capabilities", "wlan_mgt.marvell.ie.cap",
25569       FT_UINT8, BASE_HEX, NULL, 0,
25570       NULL, HFILL }},
25571
25572     {&hf_ieee80211_marvell_ie_data,
25573      { "Marvell IE data", "wlan_mgt.marvell.data",
25574        FT_BYTES, BASE_NONE, NULL, 0x0,
25575        NULL, HFILL }},
25576
25577     {&hf_ieee80211_atheros_ie_type,
25578      {"Type", "wlan_mgt.atheros.ie.type",
25579       FT_UINT8, BASE_HEX, VALS(atheros_ie_type_vals), 0,
25580       NULL, HFILL }},
25581
25582     {&hf_ieee80211_atheros_ie_subtype,
25583      {"Subtype", "wlan_mgt.atheros.ie.subtype",
25584       FT_UINT8, BASE_HEX, NULL, 0,
25585       NULL, HFILL }},
25586
25587     {&hf_ieee80211_atheros_ie_version,
25588      {"Version", "wlan_mgt.atheros.ie.version",
25589       FT_UINT8, BASE_HEX, NULL, 0,
25590       NULL, HFILL }},
25591
25592     {&hf_ieee80211_atheros_ie_cap_f_turbop,
25593      {"Turbo Prime", "wlan_mgt.ie.atheros.capabilities.turbop",
25594       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_TURBOP,
25595       NULL, HFILL }},
25596
25597     {&hf_ieee80211_atheros_ie_cap_f_comp,
25598      {"Compression", "wlan_mgt.ie.atheros.capabilities.comp",
25599       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_COMP,
25600       NULL, HFILL }},
25601
25602     {&hf_ieee80211_atheros_ie_cap_f_ff,
25603      {"Fast Frames", "wlan_mgt.ie.atheros.capabilities.ff",
25604       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_FF,
25605       NULL, HFILL }},
25606
25607     {&hf_ieee80211_atheros_ie_cap_f_xr,
25608      {"eXtended Range", "wlan_mgt.ie.atheros.capabilities.xr",
25609       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_XR,
25610       NULL, HFILL }},
25611
25612     {&hf_ieee80211_atheros_ie_cap_f_ar,
25613      {"Advanced Radar", "wlan_mgt.ie.atheros.capabilities.ar",
25614       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_AR,
25615       NULL, HFILL }},
25616
25617     {&hf_ieee80211_atheros_ie_cap_f_burst,
25618      {"Burst", "wlan_mgt.ie.atheros.capabilities.burst",
25619       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BURST,
25620       NULL, HFILL }},
25621
25622     {&hf_ieee80211_atheros_ie_cap_f_wme,
25623      {"CWMin tuning", "wlan_mgt.ie.atheros.capabilities.wme",
25624       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_WME,
25625       NULL, HFILL }},
25626
25627     {&hf_ieee80211_atheros_ie_cap_f_boost,
25628      {"Boost", "wlan_mgt.ie.atheros.capabilities.boost",
25629       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BOOST,
25630       NULL, HFILL }},
25631
25632     {&hf_ieee80211_atheros_ie_advcap_cap,
25633      {"Capabilities", "wlan_mgt.atheros.ie.advcap.cap",
25634       FT_UINT8, BASE_HEX, NULL, 0,
25635       NULL, HFILL }},
25636
25637     {&hf_ieee80211_atheros_ie_advcap_defkey,
25638      {"Default key index", "wlan_mgt.atheros.ie.advcap.defkey",
25639       FT_UINT16, BASE_HEX, NULL, 0,
25640       NULL, HFILL }},
25641
25642     {&hf_ieee80211_atheros_ie_xr_info,
25643      {"Info", "wlan_mgt.atheros.ie.xr.info",
25644       FT_UINT8, BASE_HEX, NULL, 0,
25645       NULL, HFILL }},
25646
25647     {&hf_ieee80211_atheros_ie_xr_base_bssid,
25648      {"Base BSS Id", "wlan_mgt.atheros.ie.xr.base_bssid",
25649       FT_ETHER, BASE_NONE, NULL, 0,
25650       NULL, HFILL }},
25651
25652     {&hf_ieee80211_atheros_ie_xr_xr_bssid,
25653      {"XR BSS Id", "wlan_mgt.atheros.ie.xr.xr_bssid",
25654       FT_ETHER, BASE_NONE, NULL, 0,
25655       NULL, HFILL }},
25656
25657     {&hf_ieee80211_atheros_ie_xr_xr_beacon,
25658      {"XR Beacon Interval", "wlan_mgt.atheros.ie.xr.xr_beacon",
25659       FT_UINT32, BASE_CUSTOM, CF_FUNC(beacon_interval_base_custom), 0,
25660       NULL, HFILL }},
25661
25662     {&hf_ieee80211_atheros_ie_xr_base_cap,
25663      {"Base capabilities", "wlan_mgt.atheros.ie.xr.base_cap",
25664       FT_UINT8, BASE_HEX, NULL, 0,
25665       NULL, HFILL }},
25666
25667     {&hf_ieee80211_atheros_ie_xr_xr_cap,
25668      {"XR capabilities", "wlan_mgt.atheros.ie.xr.xr_cap",
25669       FT_UINT8, BASE_HEX, NULL, 0,
25670       NULL, HFILL }},
25671
25672     {&hf_ieee80211_atheros_ie_data,
25673      {"Atheros IE data", "wlan_mgt.atheros.data",
25674       FT_BYTES, BASE_NONE, NULL, 0,
25675       NULL, HFILL }},
25676
25677     {&hf_ieee80211_aironet_ie_type,
25678      {"Aironet IE type", "wlan_mgt.aironet.type",
25679       FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0,
25680       NULL, HFILL }},
25681
25682     {&hf_ieee80211_aironet_ie_dtpc,
25683      {"Aironet IE CCX DTCP", "wlan_mgt.aironet.dtpc",
25684       FT_BYTES, BASE_NONE, NULL, 0,
25685       NULL, HFILL }},
25686
25687     {&hf_ieee80211_aironet_ie_version,
25688      {"Aironet IE CCX version", "wlan_mgt.aironet.version",
25689       FT_UINT8, BASE_DEC, NULL, 0,
25690       NULL, HFILL }},
25691
25692     {&hf_ieee80211_aironet_ie_data,
25693      { "Aironet IE data", "wlan_mgt.aironet.data",
25694        FT_BYTES, BASE_NONE, NULL, 0x0,
25695        NULL, HFILL }},
25696
25697     {&hf_ieee80211_qbss_version,
25698      {"QBSS Version", "wlan_mgt.qbss.version",
25699       FT_UINT8, BASE_DEC, NULL, 0,
25700       NULL, HFILL }},
25701
25702     {&hf_ieee80211_qbss_scount,
25703      {"Station Count", "wlan_mgt.qbss.scount",
25704       FT_UINT16, BASE_DEC, NULL, 0,
25705       NULL, HFILL }},
25706
25707     {&hf_ieee80211_qbss_cu,
25708      {"Channel Utilization", "wlan_mgt.qbss.cu",
25709       FT_UINT8, BASE_DEC, NULL, 0,
25710       NULL, HFILL }},
25711
25712     {&hf_ieee80211_qbss_adc,
25713      {"Available Admission Capabilities", "wlan_mgt.qbss.adc",
25714       FT_UINT8, BASE_DEC, NULL, 0,
25715       NULL, HFILL }},
25716
25717     {&hf_ieee80211_qbss2_cu,
25718      {"Channel Utilization", "wlan_mgt.qbss2.cu",
25719       FT_UINT8, BASE_DEC, NULL, 0,
25720       NULL, HFILL }},
25721
25722     {&hf_ieee80211_qbss2_gl,
25723      {"G.711 CU Quantum", "wlan_mgt.qbss2.glimit",
25724       FT_UINT8, BASE_DEC, NULL, 0,
25725       NULL, HFILL }},
25726
25727     {&hf_ieee80211_qbss2_cal,
25728      {"Call Admission Limit", "wlan_mgt.qbss2.cal",
25729       FT_UINT8, BASE_DEC, NULL, 0,
25730       NULL, HFILL }},
25731
25732     {&hf_ieee80211_qbss2_scount,
25733      {"Station Count", "wlan_mgt.qbss2.scount",
25734       FT_UINT16, BASE_DEC, NULL, 0,
25735       NULL, HFILL }},
25736
25737     {&hf_ieee80211_aironet_ie_qos_reserved,
25738      {"Aironet IE QoS reserved", "wlan_mgt.aironet.qos.reserved",
25739       FT_UINT8, BASE_HEX, NULL, 0,
25740       NULL, HFILL }},
25741
25742     {&hf_ieee80211_aironet_ie_qos_paramset,
25743      {"Aironet IE QoS paramset", "wlan_mgt.aironet.qos.paramset",
25744       FT_UINT8, BASE_DEC, NULL, 0,
25745       NULL, HFILL }},
25746
25747     {&hf_ieee80211_aironet_ie_qos_val,
25748      {"Aironet IE QoS valueset", "wlan_mgt.aironet.qos.val",
25749       FT_BYTES, BASE_NONE, NULL, 0,
25750       NULL, HFILL }},
25751
25752     {&hf_ieee80211_aironet_ie_clientmfp,
25753      {"Aironet IE Client MFP", "wlan_mgt.aironet.clientmfp",
25754       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
25755       NULL, HFILL }},
25756
25757     /* Vendor Specific : Nintendo */
25758     {&hf_ieee80211_vs_nintendo_type,
25759      {"Type", "wlan_mgt.vs.nintendo.type",
25760       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_nintendo_type_vals), 0,
25761       NULL, HFILL }},
25762
25763     {&hf_ieee80211_vs_nintendo_length,
25764      {"Length", "wlan_mgt.vs.nintendo.length",
25765       FT_UINT8, BASE_DEC, NULL, 0,
25766       NULL, HFILL }},
25767
25768     {&hf_ieee80211_vs_nintendo_servicelist,
25769      {"Servicelist", "wlan_mgt.vs.nintendo.servicelist",
25770       FT_BYTES, BASE_NONE, NULL, 0,
25771       NULL, HFILL }},
25772
25773     {&hf_ieee80211_vs_nintendo_service,
25774      {"Service", "wlan_mgt.vs.nintendo.service",
25775       FT_BYTES, BASE_NONE, NULL, 0,
25776       NULL, HFILL }},
25777
25778     {&hf_ieee80211_vs_nintendo_consoleid,
25779      {"Console ID", "wlan_mgt.vs.nintendo.consoleid",
25780       FT_BYTES, BASE_NONE, NULL, 0,
25781       NULL, HFILL }},
25782
25783     {&hf_ieee80211_vs_nintendo_unknown,
25784      {"Unknown", "wlan_mgt.vs.nintendo.unknown",
25785       FT_BYTES, BASE_NONE, NULL, 0,
25786       NULL, HFILL }},
25787
25788     /* Vendor Specific : Aruba Networks */
25789     {&hf_ieee80211_vs_aruba_subtype,
25790      {"Subtype", "wlan_mgt.vs.aruba.subtype",
25791       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_aruba_subtype_vals), 0,
25792       NULL, HFILL }},
25793
25794     {&hf_ieee80211_vs_aruba_apname,
25795      {"AP Name", "wlan_mgt.vs.aruba.ap_name",
25796       FT_STRINGZ, BASE_NONE, NULL, 0,
25797       NULL, HFILL }},
25798
25799     {&hf_ieee80211_vs_aruba_data,
25800      {"Data", "wlan_mgt.vs.aruba.data",
25801       FT_BYTES, BASE_NONE, NULL, 0,
25802       NULL, HFILL }},
25803
25804     {&hf_ieee80211_tsinfo,
25805      {"Traffic Stream (TS) Info", "wlan_mgt.ts_info",
25806       FT_UINT24, BASE_HEX, NULL, 0,
25807       "Traffic Stream (TS) Info field", HFILL }},
25808
25809     {&hf_ieee80211_tsinfo_type,
25810      {"Traffic Type", "wlan_mgt.ts_info.type",
25811       FT_UINT24, BASE_DEC, VALS(tsinfo_type), 0x000001,
25812       "Traffic Stream (TS) Info Traffic Type", HFILL }},
25813
25814     {&hf_ieee80211_tsinfo_tsid,
25815      {"Traffic Stream ID (TSID)", "wlan_mgt.ts_info.tsid",
25816       FT_UINT24, BASE_DEC, NULL, 0x00001E,
25817       "Traffic Stream ID (TSID) Info TSID", HFILL }},
25818
25819     {&hf_ieee80211_tsinfo_dir,
25820      {"Direction", "wlan_mgt.ts_info.dir",
25821       FT_UINT24, BASE_DEC, VALS(tsinfo_direction), 0x000060,
25822       "Traffic Stream (TS) Info Direction", HFILL }},
25823
25824     {&hf_ieee80211_tsinfo_access,
25825      {"Access Policy", "wlan_mgt.ts_info.dir",
25826       FT_UINT24, BASE_DEC, VALS(tsinfo_access), 0x000180,
25827       "Traffic Stream (TS) Info Access Policy", HFILL }},
25828
25829     {&hf_ieee80211_tsinfo_agg,
25830      {"Aggregation", "wlan_mgt.ts_info.agg",
25831       FT_UINT24, BASE_DEC, NULL, 0x000200,
25832       "Traffic Stream (TS) Info Access Policy", HFILL }},
25833
25834     {&hf_ieee80211_tsinfo_apsd,
25835      {"Automatic Power-Save Delivery (APSD)", "wlan_mgt.ts_info.apsd",
25836       FT_UINT24, BASE_DEC, NULL, 0x000400,
25837       "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
25838
25839     {&hf_ieee80211_tsinfo_up,
25840      {"User Priority", "wlan_mgt.ts_info.up",
25841       FT_UINT24, BASE_DEC, VALS(qos_up), 0x003800,
25842       "Traffic Stream (TS) Info User Priority", HFILL }},
25843
25844     {&hf_ieee80211_tsinfo_ack,
25845      {"Ack Policy", "wlan_mgt.ts_info.ack",
25846       FT_UINT24, BASE_DEC, VALS(ack_policy), 0x00C000,
25847       "Traffic Stream (TS) Info Ack Policy", HFILL }},
25848
25849     {&hf_ieee80211_tsinfo_sched,
25850      {"Schedule", "wlan_mgt.ts_info.sched",
25851       FT_UINT24, BASE_DEC, NULL, 0x010000,
25852       "Traffic Stream (TS) Info Schedule", HFILL }},
25853
25854     {&hf_ieee80211_tsinfo_rsv,
25855      {"Reserved", "wlan_mgt.ts_info.rsv",
25856       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
25857       "Must be Zero", HFILL }},
25858
25859     {&hf_ieee80211_tspec_nor_msdu,
25860      {"Normal MSDU Size", "wlan_mgt.tspec.nor_msdu",
25861       FT_UINT16, BASE_DEC, NULL, 0,
25862       NULL, HFILL }},
25863
25864     {&hf_ieee80211_tspec_max_msdu,
25865      {"Maximum MSDU Size", "wlan_mgt.tspec.max_msdu",
25866       FT_UINT16, BASE_DEC, NULL, 0,
25867       NULL, HFILL }},
25868
25869     {&hf_ieee80211_tspec_min_srv,
25870      {"Minimum Service Interval", "wlan_mgt.tspec.min_srv",
25871       FT_UINT32, BASE_DEC, NULL, 0,
25872       NULL, HFILL }},
25873
25874     {&hf_ieee80211_tspec_max_srv,
25875      {"Maximum Service Interval", "wlan_mgt.tspec.max_srv",
25876       FT_UINT32, BASE_DEC, NULL, 0,
25877       NULL, HFILL }},
25878
25879     {&hf_ieee80211_tspec_inact_int,
25880      {"Inactivity Interval", "wlan_mgt.tspec.inact_int",
25881       FT_UINT32, BASE_DEC, NULL, 0,
25882       NULL, HFILL }},
25883
25884     {&hf_ieee80211_tspec_susp_int,
25885      {"Suspension Interval", "wlan_mgt.tspec.susp_int",
25886       FT_UINT32, BASE_DEC, NULL, 0,
25887       NULL, HFILL }},
25888
25889     {&hf_ieee80211_tspec_srv_start,
25890      {"Service Start Time", "wlan_mgt.tspec.srv_start",
25891       FT_UINT32, BASE_DEC, NULL, 0,
25892       NULL, HFILL }},
25893
25894     {&hf_ieee80211_tspec_min_data,
25895      {"Minimum Data Rate", "wlan_mgt.tspec.min_data",
25896       FT_UINT32, BASE_DEC, NULL, 0,
25897       NULL, HFILL }},
25898
25899     {&hf_ieee80211_tspec_mean_data,
25900      {"Mean Data Rate", "wlan_mgt.tspec.mean_data",
25901       FT_UINT32, BASE_DEC, NULL, 0,
25902       NULL, HFILL }},
25903
25904     {&hf_ieee80211_tspec_peak_data,
25905      {"Peak Data Rate", "wlan_mgt.tspec.peak_data",
25906       FT_UINT32, BASE_DEC, NULL, 0,
25907       NULL, HFILL }},
25908
25909     {&hf_ieee80211_tspec_burst_size,
25910      {"Burst Size", "wlan_mgt.tspec.burst_size",
25911       FT_UINT32, BASE_DEC, NULL, 0,
25912       NULL, HFILL }},
25913
25914     {&hf_ieee80211_tspec_delay_bound,
25915      {"Delay Bound", "wlan_mgt.tspec.delay_bound",
25916       FT_UINT32, BASE_DEC, NULL, 0,
25917       NULL, HFILL }},
25918
25919     {&hf_ieee80211_tspec_min_phy,
25920      {"Minimum PHY Rate", "wlan_mgt.tspec.min_phy",
25921       FT_UINT32, BASE_DEC, NULL, 0,
25922       NULL, HFILL }},
25923
25924     {&hf_ieee80211_tspec_surplus,
25925      {"Surplus Bandwidth Allowance", "wlan_mgt.tspec.surplus",
25926       FT_UINT16, BASE_DEC, NULL, 0,
25927       NULL, HFILL }},
25928
25929     {&hf_ieee80211_tspec_medium,
25930      {"Medium Time", "wlan_mgt.tspec.medium",
25931       FT_UINT16, BASE_DEC, NULL, 0,
25932       NULL, HFILL }},
25933
25934     {&hf_ieee80211_tspec_dmg,
25935      {"DMG attributes", "wlan_mgt.tspec.dmg",
25936       FT_UINT16, BASE_DEC, NULL, 0,
25937       NULL, HFILL }},
25938
25939     {&hf_ieee80211_ts_delay,
25940      {"Traffic Stream (TS) Delay", "wlan_mgt.ts_delay",
25941       FT_UINT32, BASE_DEC, NULL, 0,
25942       NULL, HFILL }},
25943
25944     {&hf_ieee80211_tclas_process,
25945      {"Processing", "wlan_mgt.tclas_proc.processing",
25946       FT_UINT8, BASE_DEC, VALS(ieee80211_tclas_process_flag), 0,
25947       NULL, HFILL }},
25948
25949     {&hf_ieee80211_tag_ext_supp_rates,
25950      {"Extended Supported Rates", "wlan_mgt.extended_supported_rates",
25951       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
25952       "In Mbit/sec, (B) for Basic Rates", HFILL }},
25953
25954     {&hf_ieee80211_sched_info,
25955      {"Schedule Info", "wlan_mgt.sched.sched_info",
25956       FT_UINT16, BASE_HEX, NULL, 0,
25957       "Schedule Info field", HFILL }},
25958
25959     {&hf_ieee80211_sched_info_agg,
25960      {"Schedule Aggregation", "wlan_mgt.sched_info.agg",
25961       FT_UINT16, BASE_DEC, NULL, 0x0001,
25962       "Traffic Stream (TS) Info Access Policy", HFILL }},
25963
25964     {&hf_ieee80211_sched_info_tsid,
25965      {"Schedule Traffic Stream ID (TSID)", "wlan_mgt.sched_info.tsid",
25966       FT_UINT16, BASE_DEC, NULL, 0x001E,
25967       "Traffic Stream ID (TSID) Info TSID", HFILL }},
25968
25969     {&hf_ieee80211_sched_info_dir,
25970      {"Schedule Direction", "wlan_mgt.sched_info.dir",
25971       FT_UINT16, BASE_DEC, VALS(tsinfo_direction), 0x0060,
25972       "Traffic Stream (TS) Info Direction", HFILL }},
25973
25974     {&hf_ieee80211_sched_srv_start,
25975      {"Service Start Time", "wlan_mgt.sched.srv_start",
25976       FT_UINT32, BASE_HEX, NULL, 0,
25977       NULL, HFILL }},
25978
25979     {&hf_ieee80211_sched_srv_int,
25980      {"Service Interval", "wlan_mgt.sched.srv_int",
25981       FT_UINT32, BASE_HEX, NULL, 0,
25982       NULL, HFILL }},
25983
25984     {&hf_ieee80211_sched_spec_int,
25985      {"Specification Interval", "wlan_mgt.sched.spec_int",
25986       FT_UINT16, BASE_HEX, NULL, 0,
25987       NULL, HFILL }},
25988
25989     {&hf_ieee80211_aruba,
25990      {"Aruba Type", "wlan_mgt.aruba.type",
25991       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &aruba_mgt_typevals_ext, 0,
25992       "Aruba Management", HFILL }},
25993
25994     {&hf_ieee80211_aruba_hb_seq,
25995      {"Aruba Heartbeat Sequence", "wlan_mgt.aruba.heartbeat_sequence",
25996       FT_UINT64, BASE_DEC, NULL, 0,
25997       NULL, HFILL }},
25998
25999     {&hf_ieee80211_aruba_mtu,
26000      {"Aruba MTU Size", "wlan_mgt.aruba.mtu_size",
26001       FT_UINT16, BASE_DEC, NULL, 0,
26002       NULL, HFILL }},
26003
26004     /* Start: HT Control (+HTC) */
26005     {&hf_ieee80211_htc,
26006      {"HT Control (+HTC)", "wlan_mgt.htc",
26007       FT_UINT32, BASE_HEX, NULL, 0,
26008       "High Throughput Control (+HTC)", HFILL }},
26009
26010     {&hf_ieee80211_htc_vht,
26011      {"VHT", "wlan_mgt.htc.lac.vht",
26012       FT_BOOLEAN, 32, NULL, HTC_VHT,
26013       "High Throughput Control HT/VHT flag", HFILL }},
26014
26015     {&hf_ieee80211_htc_lac,
26016      {"Link Adaptation Control (LAC)", "wlan_mgt.htc.lac",
26017       FT_UINT32, BASE_HEX, NULL, 0x0000FFFE,
26018       "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
26019
26020     {&hf_ieee80211_htc_lac_trq,
26021      {"Training Request (TRQ)", "wlan_mgt.htc.lac.trq",
26022       FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002,
26023       "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
26024
26025     {&hf_ieee80211_htc_lac_mai_aseli,
26026      {"Antenna Selection Indication (ASELI)", "wlan_mgt.htc.lac.mai.aseli",
26027       FT_UINT16, BASE_HEX, NULL, 0x003C,
26028       "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
26029
26030     {&hf_ieee80211_htc_lac_mai_mrq,
26031      {"MCS Request (MRQ)", "wlan_mgt.htc.lac.mai.mrq",
26032       FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004,
26033       "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
26034
26035     {&hf_ieee80211_htc_lac_mai_msi,
26036      {"MCS Request Sequence Identifier (MSI)", "wlan_mgt.htc.lac.mai.msi",
26037       FT_UINT16, BASE_HEX, NULL, 0x0038,
26038       "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
26039
26040     {&hf_ieee80211_htc_lac_mai_reserved,
26041      {"Reserved", "wlan_mgt.htc.lac.mai.reserved",
26042       FT_UINT16, BASE_HEX, NULL, 0x0038,
26043       "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
26044
26045     {&hf_ieee80211_htc_lac_mfsi,
26046      {"MCS Feedback Sequence Identifier (MFSI)", "wlan_mgt.htc.lac.mfsi",
26047       FT_UINT16, BASE_DEC, NULL, 0x01C0,
26048       "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
26049
26050     {&hf_ieee80211_htc_lac_asel_command,
26051      {"Antenna Selection (ASEL) Command", "wlan_mgt.htc.lac.asel.command",
26052       FT_UINT16, BASE_HEX, VALS(ieee80211_htc_lac_asel_command_flags), 0x0E00,
26053       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
26054
26055     {&hf_ieee80211_htc_lac_asel_data,
26056      {"Antenna Selection (ASEL) Data", "wlan_mgt.htc.lac.asel.data",
26057       FT_UINT16, BASE_HEX, NULL, 0xF000,
26058       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
26059
26060     {&hf_ieee80211_htc_lac_mfb,
26061      {"MCS Feedback (MFB)", "wlan_mgt.htc.lac.mfb",
26062       FT_UINT16, BASE_HEX, NULL, 0xFE00,
26063       "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
26064
26065     {&hf_ieee80211_htc_cal_pos,
26066      {"Calibration Position", "wlan_mgt.htc.cal.pos",
26067       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_cal_pos_flags), 0x00030000,
26068       "High Throughput Control Calibration Position", HFILL }},
26069
26070     {&hf_ieee80211_htc_cal_seq,
26071      {"Calibration Sequence Identifier", "wlan_mgt.htc.cal.seq",
26072       FT_UINT32, BASE_DEC, NULL, 0x000C0000,
26073       "High Throughput Control Calibration Sequence Identifier", HFILL }},
26074
26075     {&hf_ieee80211_htc_reserved1,
26076      {"Reserved", "wlan_mgt.htc.reserved1",
26077       FT_UINT32, BASE_HEX, NULL, 0x00300000,
26078       "High Throughput Control Reserved", HFILL }},
26079
26080     {&hf_ieee80211_htc_csi_steering,
26081      {"CSI/Steering", "wlan_mgt.htc.csi_steering",
26082       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_csi_steering_flags), 0x00C00000,
26083       "High Throughput Control CSI/Steering", HFILL }},
26084
26085     {&hf_ieee80211_htc_ndp_announcement,
26086      {"NDP Announcement", "wlan_mgt.htc.ndp_announcement",
26087       FT_BOOLEAN, 32, TFS(&ieee80211_htc_ndp_announcement_flag), 0x01000000,
26088       "High Throughput Control NDP Announcement", HFILL }},
26089
26090     {&hf_ieee80211_htc_reserved2,
26091      {"Reserved", "wlan_mgt.htc.reserved2",
26092       FT_UINT32, BASE_HEX, NULL, 0x3E000000,
26093       "High Throughput Control Reserved", HFILL }},
26094
26095     {&hf_ieee80211_htc_mrq,
26096      {"MRQ", "wlan_mgt.htc.mrq",
26097       FT_BOOLEAN, 32, NULL, HTC_MRQ,
26098       "VHT-MCS feedback request", HFILL }},
26099
26100     {&hf_ieee80211_htc_msi,
26101      {"MSI", "wlan_mgt.htc.msi",
26102       FT_UINT32, BASE_DEC, NULL, 0x00000038,
26103       "MRQ sequence number", HFILL }},
26104
26105     {&hf_ieee80211_htc_msi_stbc_reserved,
26106      {"Reserved", "wlan_mgt.htc.msi_stbc_reserved",
26107       FT_UINT32, BASE_HEX, NULL, 0x00000038,
26108       NULL, HFILL }},
26109
26110     {&hf_ieee80211_htc_compressed_msi,
26111      {"Compressed MSI", "wlan_mgt.htc.compressed_msi",
26112       FT_UINT32, BASE_DEC, NULL, 0x00000018,
26113       NULL, HFILL }},
26114
26115     {&hf_ieee80211_htc_ppdu_stbc_encoded,
26116      {"PPDU was STBC encoded", "wlan_mgt.htc.ppdu_stbc_encoded",
26117       FT_BOOLEAN, 32, NULL, 0x00000020,
26118       NULL, HFILL }},
26119
26120     {&hf_ieee80211_htc_mfsi,
26121      {"MFSI", "wlan_mgt.htc.mfsi",
26122       FT_BOOLEAN, 32, NULL, 0x000001C0,
26123       "MFB sequence identifier", HFILL }},
26124
26125     {&hf_ieee80211_htc_gid_l,
26126      {"GID-L", "wlan_mgt.htc.gid_l",
26127       FT_BOOLEAN, 32, NULL, 0x000001C0,
26128       "LSBs of group ID", HFILL }},
26129
26130     {&hf_ieee80211_htc_mfb,
26131      {"MFB", "wlan_mgt.htc.mfb",
26132       FT_UINT32, BASE_HEX, NULL, 0x00FFFE00,
26133       "Recommended MFB", HFILL }},
26134
26135     {&hf_ieee80211_htc_num_sts,
26136      {"NUM_STS", "wlan_mgt.htc.num_sts",
26137       FT_UINT32, BASE_DEC, NULL, 0x00000E00,
26138       "Recommended NUM_STS", HFILL }},
26139
26140     {&hf_ieee80211_htc_vht_mcs,
26141      {"VHT-MCS", "wlan_mgt.htc.vht_mcs",
26142       FT_UINT32, BASE_DEC, NULL, 0x0000F000,
26143       "Recommended VHT-MCS", HFILL }},
26144
26145     {&hf_ieee80211_htc_bw,
26146      {"BW", "wlan_mgt.htc.bw",
26147       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_bw_recommended_vht_mcs_vals), 0x00030000,
26148       "Bandwidth for recommended VHT-MCS", HFILL }},
26149
26150     {&hf_ieee80211_htc_snr,
26151      {"SNR", "wlan_mgt.htc.snr",
26152       FT_INT32, BASE_DEC, NULL, 0x00FC0000,
26153       "Average SNR + 22", HFILL }},
26154
26155     {&hf_ieee80211_htc_reserved3,
26156      {"Reserved", "wlan_mgt.htc.reserved3",
26157       FT_UINT32, BASE_HEX, NULL, 0x1F000000,
26158       NULL, HFILL }},
26159
26160     {&hf_ieee80211_htc_gid_h,
26161      {"GID-H", "wlan_mgt.htc.gid_h",
26162       FT_UINT32, BASE_DEC, NULL, 0x07000000,
26163       NULL, HFILL }},
26164
26165     {&hf_ieee80211_htc_coding_type,
26166      {"Coding type", "wlan_mgt.htc.coding_type",
26167       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_coding_type_vals), 0x08000000,
26168       NULL, HFILL }},
26169
26170     {&hf_ieee80211_htc_fb_tx_type,
26171      {"FB Tx type", "wlan_mgt.htc.fb_tx_type",
26172       FT_UINT32, BASE_DEC, VALS(ieee80211_htc_fb_tx_type_vals), 0x10000000,
26173       NULL, HFILL }},
26174
26175     {&hf_ieee80211_htc_unsolicited_mfb,
26176      {"Unsolicited MFB", "wlan_mgt.htc.unsolicited_mfb",
26177       FT_BOOLEAN, 32, NULL, HTC_UNSOLICITED_MFB,
26178       "High Throughput Control Unsolicited MFB", HFILL }},
26179
26180     {&hf_ieee80211_htc_ac_constraint,
26181      {"AC Constraint", "wlan_mgt.htc.ac_constraint",
26182       FT_BOOLEAN, 32, NULL, 0x40000000,
26183       "High Throughput Control AC Constraint", HFILL }},
26184
26185     {&hf_ieee80211_htc_rdg_more_ppdu,
26186      {"RDG/More PPDU", "wlan_mgt.htc.rdg_more_ppdu",
26187       FT_BOOLEAN, 32, NULL, 0x80000000,
26188       "High Throughput Control RDG/More PPDU", HFILL }},
26189     /* End: HT Control (+HTC) */
26190
26191     /* MDIE */
26192     {&hf_ieee80211_tag_mobility_domain_mdid,
26193      {"Mobility Domain Identifier", "wlan_mgt.mobility_domain.mdid",
26194       FT_UINT16, BASE_HEX, NULL, 0,
26195       NULL, HFILL }},
26196
26197     {&hf_ieee80211_tag_mobility_domain_ft_capab,
26198      {"FT Capability and Policy", "wlan_mgt.mobility_domain.ft_capab",
26199       FT_UINT8, BASE_HEX, NULL, 0,
26200       NULL, HFILL }},
26201
26202     {&hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
26203      {"Fast BSS Transition over DS",
26204       "wlan_mgt.mobility_domain.ft_capab.ft_over_ds",
26205       FT_UINT8, BASE_HEX, NULL, 0x01,
26206       NULL, HFILL }},
26207
26208     {&hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
26209      {"Resource Request Protocol Capability",
26210       "wlan_mgt.mobility_domain.ft_capab.resource_req",
26211       FT_UINT8, BASE_HEX, NULL, 0x02,
26212       NULL, HFILL }},
26213
26214     /* FTIE */
26215     {&hf_ieee80211_tag_ft_mic_control,
26216      {"MIC Control", "wlan_mgt.ft.mic_control",
26217       FT_UINT16, BASE_HEX, NULL, 0,
26218       NULL, HFILL }},
26219
26220     {&hf_ieee80211_tag_ft_element_count,
26221      {"Element Count", "wlan_mgt.ft.element_count",
26222       FT_UINT16, BASE_DEC, NULL, 0xff00,
26223       NULL, HFILL }},
26224
26225     {&hf_ieee80211_tag_ft_mic,
26226      {"MIC", "wlan_mgt.ft.mic",
26227       FT_BYTES, BASE_NONE, NULL, 0,
26228       NULL, HFILL }},
26229
26230     {&hf_ieee80211_tag_ft_anonce,
26231      {"ANonce", "wlan_mgt.ft.anonce",
26232       FT_BYTES, BASE_NONE, NULL, 0,
26233       NULL, HFILL }},
26234
26235     {&hf_ieee80211_tag_ft_snonce,
26236      {"SNonce", "wlan_mgt.ft.snonce",
26237       FT_BYTES, BASE_NONE, NULL, 0,
26238       NULL, HFILL }},
26239
26240     {&hf_ieee80211_tag_ft_subelem_id,
26241      {"Subelement ID", "wlan_mgt.ft.subelem.id",
26242       FT_UINT8, BASE_DEC, VALS(ft_subelem_id_vals), 0,
26243       NULL, HFILL }},
26244
26245     {&hf_ieee80211_tag_ft_subelem_len,
26246      {"Length", "wlan_mgt.ft.subelem.len",
26247       FT_UINT8, BASE_DEC, NULL, 0,
26248       NULL, HFILL }},
26249
26250     {&hf_ieee80211_tag_ft_subelem_data,
26251      {"Data", "wlan_mgt.ft.subelem.data",
26252       FT_BYTES, BASE_NONE, NULL, 0,
26253       NULL, HFILL }},
26254
26255     {&hf_ieee80211_tag_ft_subelem_r1kh_id,
26256      {"PMK-R1 key holder identifier (R1KH-ID)", "wlan_mgt.ft.subelem.r1kh_id",
26257       FT_BYTES, BASE_NONE, NULL, 0,
26258       NULL, HFILL }},
26259
26260     {&hf_ieee80211_tag_ft_subelem_gtk_key_info,
26261      {"Key Info", "wlan_mgt.ft.subelem.gtk.key_info",
26262       FT_UINT16, BASE_HEX, NULL, 0,
26263       NULL, HFILL }},
26264
26265     {&hf_ieee80211_tag_ft_subelem_gtk_key_id,
26266      {"Key ID", "wlan_mgt.ft.subelem.gtk.key_id",
26267       FT_UINT16, BASE_DEC, NULL, 0x0003,
26268       NULL, HFILL }},
26269
26270     {&hf_ieee80211_tag_ft_subelem_gtk_key_length,
26271      {"Key Length", "wlan_mgt.ft.subelem.gtk.key_length",
26272       FT_UINT8, BASE_HEX, NULL, 0,
26273       NULL, HFILL }},
26274
26275     {&hf_ieee80211_tag_ft_subelem_gtk_rsc,
26276      {"RSC", "wlan_mgt.ft.subelem.gtk.rsc",
26277       FT_BYTES, BASE_NONE, NULL, 0,
26278       NULL, HFILL }},
26279
26280     {&hf_ieee80211_tag_ft_subelem_gtk_key,
26281      {"GTK", "wlan_mgt.ft.subelem.gtk.key",
26282       FT_BYTES, BASE_NONE, NULL, 0,
26283       NULL, HFILL }},
26284
26285     {&hf_ieee80211_tag_ft_subelem_r0kh_id,
26286      {"PMK-R0 key holder identifier (R0KH-ID)", "wlan_mgt.ft.subelem.r0kh_id",
26287       FT_STRING, BASE_NONE, NULL, 0,
26288       NULL, HFILL }},
26289
26290     {&hf_ieee80211_tag_ft_subelem_igtk_key_id,
26291      {"Key ID", "wlan_mgt.ft.subelem.igtk.key_id",
26292       FT_UINT16, BASE_DEC, NULL, 0,
26293       NULL, HFILL }},
26294
26295     {&hf_ieee80211_tag_ft_subelem_igtk_ipn,
26296      {"IPN", "wlan_mgt.ft.subelem.igtk.ipn",
26297       FT_BYTES, BASE_NONE, NULL, 0,
26298       NULL, HFILL }},
26299
26300     {&hf_ieee80211_tag_ft_subelem_igtk_key_length,
26301      {"Key Length", "wlan_mgt.ft.subelem.igtk.key_length",
26302       FT_UINT8, BASE_HEX, NULL, 0,
26303       NULL, HFILL }},
26304
26305     {&hf_ieee80211_tag_ft_subelem_igtk_key,
26306      {"Wrapped Key (IGTK)", "wlan_mgt.ft.subelem.igtk.key",
26307       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
26308
26309     /* RIC Data IE: 802.11-2012: 8.4.2.52 */
26310     {&hf_ieee80211_tag_ric_data_id,
26311      {"Resource Handshake Identifier", "wlan_mgt.ric_data.id",
26312       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26313
26314     {&hf_ieee80211_tag_ric_data_desc_cnt,
26315      {"Resource Descriptor Count", "wlan_mgt.ric_data.desc_cnt",
26316       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26317
26318     {&hf_ieee80211_tag_ric_data_status_code,
26319      {"Status Code", "wlan_mgt.ric_data.status_code",
26320       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
26321       "Status of requested Resource", HFILL }},
26322
26323     /* RIC Descriptor IE: 802.11-2012: 8.4.2.53 */
26324     {&hf_ieee80211_tag_ric_desc_rsrc_type,
26325      {"Resource Type", "wlan_mgt.ric_desc.rsrc_type",
26326       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26327
26328     {&hf_ieee80211_tag_ric_desc_var_params,
26329      {"Variable Params", "wlan_mgt.ric_desc.var_params",
26330       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
26331
26332     /* MMIE */
26333     {&hf_ieee80211_tag_mmie_keyid,
26334      {"KeyID", "wlan_mgt.mmie.keyid",
26335       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26336
26337     {&hf_ieee80211_tag_mmie_ipn,
26338      {"IPN", "wlan_mgt.mmie.ipn",
26339       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
26340
26341     {&hf_ieee80211_tag_mmie_mic,
26342      {"MIC", "wlan_mgt.mmie.mic",
26343       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
26344
26345     /* WAPI Parameter Set*/
26346     {&hf_ieee80211_tag_wapi_param_set_version,
26347      {"Version", "wlan_mgt.wapi.version",
26348       FT_UINT16, BASE_DEC, NULL, 0,
26349       NULL, HFILL }},
26350
26351     {&hf_ieee80211_tag_wapi_param_set_akm_suite_count,
26352      {"AKM Suite Count", "wlan_mgt.wapi.akm_suite.count",
26353       FT_UINT16, BASE_DEC, NULL, 0,
26354       NULL, HFILL }},
26355
26356     {&hf_ieee80211_tag_wapi_param_set_akm_suite_oui,
26357      {"AKM Suite OUI", "wlan_mgt.wapi.akm_suite.oui",
26358       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
26359       NULL, HFILL }},
26360
26361     {&hf_ieee80211_tag_wapi_param_set_akm_suite_type,
26362      {"AKM Suite Type", "wlan_mgt.wapi.akm_suite.type",
26363       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_suite_type) , 0,
26364       NULL, HFILL }},
26365
26366     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
26367      {"Unicast Cipher Suite Count", "wlan_mgt.wapi.unicast_cipher.suite.count",
26368       FT_UINT16, BASE_DEC, NULL, 0,
26369       NULL, HFILL }},
26370
26371     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui,
26372      {"Unicast Cipher Suite OUI", "wlan_mgt.wapi.unicast_cipher.suite.oui",
26373       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
26374       NULL, HFILL }},
26375
26376     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type,
26377      {"Unicast Cipher Suite Type", "wlan_mgt.wapi.unicast_cipher.suite.type",
26378       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
26379       NULL, HFILL }},
26380
26381     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui,
26382      {"Multicast Cipher Suite OUI", "wlan_mgt.wapi.multicast_cipher.suite.oui",
26383       FT_UINT24, BASE_CUSTOM, CF_FUNC(oui_base_custom), 0,
26384       NULL, HFILL }},
26385
26386     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type,
26387      {"Multicast Cipher Suite Type", "wlan_mgt.wapi.multicast_cipher.suite.type",
26388       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
26389       NULL, HFILL }},
26390
26391     {&hf_ieee80211_tag_wapi_param_set_capab,
26392      {"WAPI Capability Info", "wlan_mgt.wapi.capab",
26393       FT_UINT16, BASE_HEX, NULL, 0,
26394       NULL, HFILL }},
26395
26396     {&hf_ieee80211_tag_wapi_param_set_capab_preauth,
26397      {"Supports Preauthentication?", "wlan_mgt.wapi.capab.preauth",
26398       FT_BOOLEAN, 16 , NULL, 0x0001,
26399       NULL, HFILL }},
26400
26401     {&hf_ieee80211_tag_wapi_param_set_capab_rsvd,
26402      {"Reserved", "wlan_mgt.wapi.capab.rsvd",
26403       FT_UINT16, BASE_DEC , NULL, 0xFFFE,
26404       NULL, HFILL }},
26405
26406     {&hf_ieee80211_tag_wapi_param_set_bkid_count,
26407      {"No of BKID's", "wlan_mgt.wapi.bkid.count",
26408       FT_UINT16, BASE_DEC, NULL, 0,
26409       NULL, HFILL }},
26410
26411     {&hf_ieee80211_tag_wapi_param_set_bkid_list,
26412      {"BKID", "wlan_mgt.wapi.bkid",
26413       FT_BYTES, BASE_NONE, NULL, 0,
26414       NULL, HFILL }},
26415
26416     /* BSS Max Idle Period */
26417     {&hf_ieee80211_tag_bss_max_idle_period,
26418      {"BSS Max Idle Period (1000 TUs)", "wlan_mgt.bss_max_idle.period",
26419       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26420
26421     {&hf_ieee80211_tag_bss_max_idle_options_protected,
26422      {"BSS Max Idle Period Options: Protected Keep-Alive Required",
26423       "wlan_mgt.bss_max_idle.options.protected",
26424       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
26425
26426     /* TFS Request */
26427     {&hf_ieee80211_tag_tfs_request_id,
26428      {"TFS ID", "wlan_mgt.tfs_request.id",
26429       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26430
26431     {&hf_ieee80211_tag_tfs_request_ac_delete_after_match,
26432      {"TFS Action Code - Delete after match",
26433       "wlan_mgt.tfs_request.action_code.delete_after_match",
26434       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
26435
26436     {&hf_ieee80211_tag_tfs_request_ac_notify,
26437      {"TFS Action Code - Notify",
26438       "wlan_mgt.tfs_request.action_code.notify",
26439       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
26440
26441     {&hf_ieee80211_tag_tfs_request_subelem_id,
26442      {"Subelement ID", "wlan_mgt.tfs_request.subelem.id",
26443       FT_UINT8, BASE_DEC, VALS(tfs_request_subelem_ids), 0,
26444       "TFS Request Subelement ID", HFILL }},
26445
26446     {&hf_ieee80211_tag_tfs_request_subelem_len,
26447      {"Length", "wlan_mgt.tfs_request.subelem.len",
26448       FT_UINT8, BASE_DEC, NULL, 0,
26449       "TFS Request Subelement Length", HFILL }},
26450
26451     {&hf_ieee80211_tag_tfs_request_subelem,
26452      {"Subelement Data", "wlan_mgt.tfs_request.subelem",
26453       FT_BYTES, BASE_NONE, NULL, 0,
26454       "TFS Request Subelement Data", HFILL }},
26455
26456     /* TFS Response */
26457     {&hf_ieee80211_tag_tfs_response_subelem_id,
26458      {"Subelement ID", "wlan_mgt.tfs_response.subelem.id",
26459       FT_UINT8, BASE_DEC, VALS(tfs_response_subelem_ids), 0,
26460       "TFS Response Subelement ID", HFILL }},
26461
26462     {&hf_ieee80211_tag_tfs_response_subelem_len,
26463      {"Length", "wlan_mgt.tfs_response.subelem.len",
26464       FT_UINT8, BASE_DEC, NULL, 0,
26465       "TFS Response Subelement Length", HFILL }},
26466
26467     {&hf_ieee80211_tag_tfs_response_subelem,
26468      {"Subelement Data", "wlan_mgt.tfs_response.subelem",
26469       FT_BYTES, BASE_NONE, NULL, 0,
26470       "TFS Response Subelement Data", HFILL }},
26471
26472     {&hf_ieee80211_tag_tfs_response_status,
26473      {"TFS Response Status", "wlan_mgt.tfs_response.status",
26474       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26475
26476     {&hf_ieee80211_tag_tfs_response_id,
26477      {"TFS ID", "wlan_mgt.tfs_response.tfs_id",
26478       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
26479
26480     /* WNM-Sleep Mode */
26481     {&hf_ieee80211_tag_wnm_sleep_mode_action_type,
26482      {"Action Type", "wlan_mgt.wnm_sleep_mode.action_type",
26483       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_action_types), 0,
26484       "WNM-Sleep Mode Action Type", HFILL }},
26485
26486     {&hf_ieee80211_tag_wnm_sleep_mode_response_status,
26487      {"WNM-Sleep Mode Response Status",
26488       "wlan_mgt.wnm_sleep_mode.response_status",
26489       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_response_status_vals), 0, NULL,
26490       HFILL }},
26491
26492     {&hf_ieee80211_tag_wnm_sleep_mode_interval,
26493      {"WNM-Sleep Interval", "wlan_mgt.wnm_sleep_mode.interval",
26494       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
26495
26496     /* Time Advertisement */
26497     {&hf_ieee80211_tag_time_adv_timing_capab,
26498      {"Timing capabilities", "wlan_mgt.time_adv.timing_capab",
26499       FT_UINT8, BASE_DEC, VALS(time_adv_timing_capab_vals), 0,
26500       NULL, HFILL }},
26501
26502     {&hf_ieee80211_tag_time_adv_time_value,
26503      {"Time Value", "wlan_mgt.time_adv.time_value",
26504       FT_BYTES, BASE_NONE, NULL, 0,
26505       NULL, HFILL }},
26506
26507     {&hf_ieee80211_tag_time_adv_time_value_year,
26508      {"Time Value: Year", "wlan_mgt.time_adv.time_value.year",
26509       FT_UINT16, BASE_DEC, NULL, 0,
26510       NULL, HFILL }},
26511
26512     {&hf_ieee80211_tag_time_adv_time_value_month,
26513      {"Time Value: Month", "wlan_mgt.time_adv.time_value.month",
26514       FT_UINT8, BASE_DEC, NULL, 0,
26515       NULL, HFILL }},
26516
26517     {&hf_ieee80211_tag_time_adv_time_value_day,
26518      {"Time Value: Day", "wlan_mgt.time_adv.time_value.month",
26519       FT_UINT8, BASE_DEC, NULL, 0,
26520       NULL, HFILL }},
26521
26522     {&hf_ieee80211_tag_time_adv_time_value_hours,
26523      {"Time Value: Hours", "wlan_mgt.time_adv.time_value.hours",
26524       FT_UINT8, BASE_DEC, NULL, 0,
26525       NULL, HFILL }},
26526
26527     {&hf_ieee80211_tag_time_adv_time_value_minutes,
26528      {"Time Value: Minutes", "wlan_mgt.time_adv.time_value.minutes",
26529       FT_UINT8, BASE_DEC, NULL, 0,
26530       NULL, HFILL }},
26531
26532     {&hf_ieee80211_tag_time_adv_time_value_seconds,
26533      {"Time Value: Seconds", "wlan_mgt.time_adv.time_value.seconds",
26534       FT_UINT8, BASE_DEC, NULL, 0,
26535       NULL, HFILL }},
26536
26537     {&hf_ieee80211_tag_time_adv_time_value_milliseconds,
26538      {"Time Value: Milliseconds", "wlan_mgt.time_adv.time_value.milliseconds",
26539       FT_UINT16, BASE_DEC, NULL, 0,
26540       NULL, HFILL }},
26541
26542     {&hf_ieee80211_tag_time_adv_time_value_reserved,
26543      {"Time Value: Reserved", "wlan_mgt.time_adv.time_value.reserved",
26544       FT_UINT8, BASE_DEC, NULL, 0,
26545       NULL, HFILL }},
26546
26547     {&hf_ieee80211_tag_time_adv_time_error,
26548      {"Time Error", "wlan_mgt.time_adv.time_error",
26549       FT_BYTES, BASE_NONE, NULL, 0,
26550       NULL, HFILL }},
26551
26552     {&hf_ieee80211_tag_time_adv_time_update_counter,
26553      {"Time Update Counter", "wlan_mgt.time_adv.time_update_counter",
26554       FT_UINT8, BASE_DEC, NULL, 0,
26555       NULL, HFILL }},
26556
26557     /* Time Zone */
26558     {&hf_ieee80211_tag_time_zone,
26559      {"Time Zone", "wlan_mgt.time_zone",
26560       FT_STRING, BASE_NONE, NULL, 0,
26561       NULL, HFILL }},
26562
26563     /* Interworking */
26564     {&hf_ieee80211_tag_interworking_access_network_type,
26565      {"Access Network Type", "wlan_mgt.interworking.access_network_type",
26566       FT_UINT8, BASE_DEC, VALS(access_network_type_vals), 0x0f,
26567       NULL, HFILL }},
26568
26569     {&hf_ieee80211_tag_interworking_internet,
26570      {"Internet", "wlan_mgt.interworking.internet",
26571       FT_UINT8, BASE_DEC, NULL, 0x10,
26572       NULL, HFILL }},
26573
26574     {&hf_ieee80211_tag_interworking_asra,
26575      {"ASRA", "wlan_mgt.interworking.asra",
26576       FT_UINT8, BASE_DEC, NULL, 0x20,
26577       "Additional Step Required for Access", HFILL }},
26578
26579     {&hf_ieee80211_tag_interworking_esr,
26580      {"ESR", "wlan_mgt.interworking.esr",
26581       FT_UINT8, BASE_DEC, NULL, 0x40,
26582       "Emergency services reachable", HFILL }},
26583
26584     {&hf_ieee80211_tag_interworking_uesa,
26585      {"UESA", "wlan_mgt.interworking.uesa",
26586       FT_UINT8, BASE_DEC, NULL, 0x80,
26587       "Unauthenticated emergency service accessible", HFILL }},
26588
26589     {&hf_ieee80211_tag_interworking_hessid,
26590      {"HESSID", "wlan_mgt.interworking.hessid",
26591       FT_ETHER, BASE_NONE, NULL, 0,
26592       "Homogeneous ESS identifier", HFILL }},
26593
26594     /* QoS Map Set element */
26595     {&hf_ieee80211_tag_qos_map_set_dscp_exc,
26596      {"DSCP Exception", "wlan_mgt.qos_map_set.dscp_exception",
26597       FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
26598
26599     {&hf_ieee80211_tag_qos_map_set_dscp_exc_val,
26600      {"DSCP Value", "wlan_mgt.qos_map_set.dscp_value",
26601       FT_UINT8, BASE_DEC, NULL, 0,
26602       "DSCP Exception - DSCP Value", HFILL }},
26603
26604     {&hf_ieee80211_tag_qos_map_set_dscp_exc_up,
26605      {"User Priority", "wlan_mgt.qos_map_set.up",
26606       FT_UINT8, BASE_DEC, NULL, 0,
26607       "DSCP Exception - User Priority", HFILL }},
26608
26609     {&hf_ieee80211_tag_qos_map_set_range,
26610      {"DSCP Range description", "wlan_mgt.qos_map_set.range",
26611       FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL }},
26612
26613     {&hf_ieee80211_tag_qos_map_set_low,
26614      {"DSCP Low Value", "wlan_mgt.qos_map_set.dscp_low_value",
26615       FT_UINT8, BASE_DEC, NULL, 0,
26616       "DSCP Range description - DSCP Low Value", HFILL }},
26617
26618     {&hf_ieee80211_tag_qos_map_set_high,
26619      {"DSCP High Value", "wlan_mgt.qos_map_set.dscp_high_value",
26620       FT_UINT8, BASE_DEC, NULL, 0,
26621       "DSCP Range description - DSCP High Value", HFILL }},
26622
26623     /* Advertisement Protocol */
26624     {&hf_ieee80211_tag_adv_proto_resp_len_limit,
26625      {"Query Response Length Limit", "wlan_mgt.adv_proto.resp_len_limit",
26626       FT_UINT8, BASE_DEC, NULL, 0x7f,
26627       NULL, HFILL }},
26628
26629     {&hf_ieee80211_tag_adv_proto_pame_bi,
26630      {"PAME-BI", "wlan_mgt.adv_proto.pame_bi",
26631       FT_UINT8, BASE_DEC, NULL, 0x80,
26632       "Pre-Association Message Xchange BSSID Independent (PAME-BI)", HFILL }},
26633
26634     {&hf_ieee80211_tag_adv_proto_id,
26635      {"Advertisement Protocol ID", "wlan_mgt.adv_proto.id",
26636       FT_UINT8, BASE_DEC, VALS(adv_proto_id_vals), 0,
26637       NULL, HFILL }},
26638
26639     {&hf_ieee80211_tag_adv_proto_vs_info,
26640      {"Advertisement Protocol Vendor Specific info", "wlan_mgt.adv_proto.vs_info",
26641       FT_NONE, BASE_NONE, NULL, 0,
26642       NULL, HFILL }},
26643
26644     /* Roaming Consortium */
26645     {&hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
26646      {"Number of ANQP OIs", "wlan_mgt.roaming_consortium.num_anqp_oi",
26647       FT_UINT8, BASE_DEC, NULL, 0,
26648       NULL, HFILL }},
26649
26650     {&hf_ieee80211_tag_roaming_consortium_oi1_len,
26651      {"OI #1 Length", "wlan_mgt.roaming_consortium.oi1_len",
26652       FT_UINT8, BASE_DEC, NULL, 0x0f,
26653       NULL, HFILL }},
26654
26655     {&hf_ieee80211_tag_roaming_consortium_oi2_len,
26656      {"OI #2 Length", "wlan_mgt.roaming_consortium.oi2_len",
26657       FT_UINT8, BASE_DEC, NULL, 0xf0,
26658       NULL, HFILL }},
26659
26660     {&hf_ieee80211_tag_roaming_consortium_oi1,
26661      {"OI #1", "wlan_mgt.roaming_consortium.oi1",
26662       FT_BYTES, BASE_NONE, NULL, 0,
26663       NULL, HFILL }},
26664
26665     {&hf_ieee80211_tag_roaming_consortium_oi2,
26666      {"OI #2", "wlan_mgt.roaming_consortium.oi2",
26667       FT_BYTES, BASE_NONE, NULL, 0,
26668       NULL, HFILL }},
26669
26670     {&hf_ieee80211_tag_roaming_consortium_oi3,
26671      {"OI #3", "wlan_mgt.roaming_consortium.oi3",
26672       FT_BYTES, BASE_NONE, NULL, 0,
26673       NULL, HFILL }},
26674
26675     /* Timeout Interval */
26676     {&hf_ieee80211_tag_timeout_int_type,
26677      {"Timeout Interval Type", "wlan_mgt.timeout_int.type",
26678       FT_UINT8, BASE_DEC, VALS(timeout_int_types), 0,
26679       NULL, HFILL }},
26680
26681     {&hf_ieee80211_tag_timeout_int_value,
26682      {"Timeout Interval Value", "wlan_mgt.timeout_int.value",
26683       FT_UINT32, BASE_DEC, NULL, 0,
26684       NULL, HFILL }},
26685
26686     /* Link Identifier */
26687     {&hf_ieee80211_tag_link_id_bssid,
26688      {"BSSID", "wlan_mgt.link_id.bssid",
26689       FT_ETHER, BASE_NONE, NULL, 0,
26690       NULL, HFILL }},
26691
26692     {&hf_ieee80211_tag_link_id_init_sta,
26693      {"TDLS initiator STA Address", "wlan_mgt.link_id.init_sta",
26694       FT_ETHER, BASE_NONE, NULL, 0,
26695       NULL, HFILL }},
26696
26697     {&hf_ieee80211_tag_link_id_resp_sta,
26698      {"TDLS responder STA Address", "wlan_mgt.link_id.resp_sta",
26699       FT_ETHER, BASE_NONE, NULL, 0,
26700       NULL, HFILL }},
26701
26702     /* Wakeup Schedule */
26703     {&hf_ieee80211_tag_wakeup_schedule_offset,
26704      {"Offset", "wlan_mgt.wakeup_schedule.offset",
26705       FT_UINT32, BASE_DEC, NULL, 0,
26706       NULL, HFILL }},
26707
26708     {&hf_ieee80211_tag_wakeup_schedule_interval,
26709      {"Interval", "wlan_mgt.wakeup_schedule.interval",
26710       FT_UINT32, BASE_DEC, NULL, 0,
26711       NULL, HFILL }},
26712
26713     {&hf_ieee80211_tag_wakeup_schedule_awake_window_slots,
26714      {"Awake Window Slots", "wlan_mgt.wakeup_schedule.awake_window_slots",
26715       FT_UINT32, BASE_DEC, NULL, 0,
26716       NULL, HFILL }},
26717
26718     {&hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
26719      {"Maximum Awake Window Duration", "wlan_mgt.wakeup_schedule.max_awake_dur",
26720       FT_UINT32, BASE_DEC, NULL, 0,
26721       NULL, HFILL }},
26722
26723     {&hf_ieee80211_tag_wakeup_schedule_idle_count,
26724      {"Idle Count", "wlan_mgt.wakeup_schedule.idle_count",
26725       FT_UINT16, BASE_DEC, NULL, 0,
26726       NULL, HFILL }},
26727
26728     /* Channel Switch Timing */
26729     {&hf_ieee80211_tag_channel_switch_timing_switch_time,
26730      {"Switch Time", "wlan_mgt.channel_switch_timing.switch_time",
26731       FT_UINT16, BASE_DEC, NULL, 0,
26732       NULL, HFILL }},
26733
26734     {&hf_ieee80211_tag_channel_switch_timing_switch_timeout,
26735      {"Switch Timeout", "wlan_mgt.channel_switch_timing.switch_timeout",
26736       FT_UINT16, BASE_DEC, NULL, 0,
26737       NULL, HFILL }},
26738
26739     /* PTI Control */
26740     {&hf_ieee80211_tag_pti_control_tid,
26741      {"TID", "wlan_mgt.pti_control.tid",
26742       FT_UINT8, BASE_DEC, NULL, 0,
26743       NULL, HFILL }},
26744
26745     {&hf_ieee80211_tag_pti_control_sequence_control,
26746      {"Sequence Control", "wlan_mgt.pti_control.sequence_control",
26747       FT_UINT16, BASE_HEX, NULL, 0,
26748       NULL, HFILL }},
26749
26750     /* PU Buffer Status */
26751     {&hf_ieee80211_tag_pu_buffer_status_ac_bk,
26752      {"AC_BK traffic available", "wlan_mgt.pu_buffer_status.ac_bk",
26753       FT_UINT8, BASE_DEC, NULL, 0x01,
26754       NULL, HFILL }},
26755
26756     {&hf_ieee80211_tag_pu_buffer_status_ac_be,
26757      {"AC_BE traffic available", "wlan_mgt.pu_buffer_status.ac_be",
26758       FT_UINT8, BASE_DEC, NULL, 0x02,
26759       NULL, HFILL }},
26760
26761     {&hf_ieee80211_tag_pu_buffer_status_ac_vi,
26762      {"AC_VI traffic available", "wlan_mgt.pu_buffer_status.ac_vi",
26763       FT_UINT8, BASE_DEC, NULL, 0x04,
26764       NULL, HFILL }},
26765
26766     {&hf_ieee80211_tag_pu_buffer_status_ac_vo,
26767      {"AC_VO traffic available", "wlan_mgt.pu_buffer_status.ac_vo",
26768       FT_UINT8, BASE_DEC, NULL, 0x08,
26769       NULL, HFILL }},
26770
26771     {&hf_ieee80211_mysterious_olpc_stuff,
26772      {"Mysterious OLPC stuff", "wlan_mgt.mysterious_olpc_stuff",
26773       FT_NONE, BASE_NONE, NULL, 0x0,
26774       NULL, HFILL }}
26775
26776   };
26777
26778   static hf_register_info aggregate_fields[] = {
26779     {&hf_ieee80211_amsdu_subframe,
26780      {"A-MSDU Subframe", "wlan_aggregate.a_mdsu.subframe",
26781       FT_NONE, BASE_NONE, NULL, 0x0,
26782       "Aggregate MAC Service Data Unit (MSDU) Subframe", HFILL }},
26783
26784     {&hf_ieee80211_amsdu_length,
26785      {"A-MSDU Length", "wlan_aggregate.a_mdsu.length",
26786       FT_UINT16, BASE_DEC, NULL, 0x0,
26787       NULL, HFILL }}
26788   };
26789
26790   static uat_field_t wep_uat_flds[] = {
26791
26792       UAT_FLD_VS(uat_wep_key_records, key, "Key type", wep_type_vals,
26793                         "Decryption key type used"),
26794       UAT_FLD_CSTRING(uat_wep_key_records, string, "Key",
26795                         "wep:<wep hexadecimal key>\n"
26796                         "wpa-pwd:<passphrase>[:<ssid>]\n"
26797                         "wpa-psk:<wpa hexadecimal key>"),
26798       UAT_END_FIELDS
26799     };
26800
26801   static gint *tree_array[] = {
26802     &ett_80211,
26803     &ett_proto_flags,
26804     &ett_cap_tree,
26805     &ett_fc_tree,
26806     &ett_cntrl_wrapper_fc,
26807     &ett_cntrl_wrapper_payload,
26808     &ett_fragments,
26809     &ett_fragment,
26810     &ett_block_ack,
26811     &ett_block_ack_bitmap,
26812     &ett_ath_cap_tree,
26813
26814     &ett_80211_mgt,
26815     &ett_fixed_parameters,
26816     &ett_tagged_parameters,
26817     &ett_tag_bmapctl_tree,
26818     &ett_tag_country_fnm_tree,
26819     &ett_tag_country_rcc_tree,
26820     &ett_qos_parameters,
26821     &ett_qos_ps_buf_state,
26822     &ett_wep_parameters,
26823     &ett_msh_control,
26824     &ett_hwmp_targ_flags_tree,
26825     &ett_mesh_chswitch_flag_tree,
26826     &ett_mesh_config_cap_tree,
26827     &ett_mesh_formation_info_tree,
26828
26829     &ett_rsn_gcs_tree,
26830     &ett_rsn_pcs_tree,
26831     &ett_rsn_sub_pcs_tree,
26832     &ett_rsn_akms_tree,
26833     &ett_rsn_sub_akms_tree,
26834     &ett_rsn_cap_tree,
26835     &ett_rsn_pmkid_tree,
26836     &ett_rsn_gmcs_tree,
26837
26838     &ett_wpa_mcs_tree,
26839     &ett_wpa_ucs_tree,
26840     &ett_wpa_sub_ucs_tree,
26841     &ett_wpa_akms_tree,
26842     &ett_wpa_sub_akms_tree,
26843     &ett_wme_ac,
26844     &ett_wme_aci_aifsn,
26845     &ett_wme_ecw,
26846     &ett_wme_qos_info,
26847
26848     &ett_ht_cap_tree,
26849     &ett_ampduparam_tree,
26850     &ett_mcsset_tree,
26851     &ett_mcsbit_tree,
26852     &ett_htex_cap_tree,
26853     &ett_txbf_tree,
26854     &ett_antsel_tree,
26855     &ett_hta_cap_tree,
26856     &ett_hta_cap1_tree,
26857     &ett_hta_cap2_tree,
26858
26859     &ett_htc_tree,
26860     &ett_mfb_subtree,
26861     &ett_lac_subtree,
26862
26863     &ett_vht_cap_tree,
26864     &ett_vht_mcsset_tree,
26865     &ett_vht_rx_mcsbit_tree,
26866     &ett_vht_tx_mcsbit_tree,
26867     &ett_vht_basic_mcsbit_tree,
26868     &ett_vht_op_tree,
26869     &ett_vht_tpe_info_tree,
26870
26871     &ett_vht_ndp_annc_token_tree,
26872     &ett_vht_ndp_annc_sta_info_tree,
26873
26874     &ett_ff_vhtmimo_cntrl,
26875     &ett_ff_vhtmimo_beamforming_report,
26876     &ett_ff_vhtmimo_beamforming_report_snr,
26877     &ett_ff_vhtmimo_beamforming_report_feedback_matrices,
26878
26879     &ett_vht_grpidmgmt,
26880
26881     &ett_ht_info_delimiter1_tree,
26882     &ett_ht_info_delimiter2_tree,
26883     &ett_ht_info_delimiter3_tree,
26884
26885     &ett_tag_measure_request_mode_tree,
26886     &ett_tag_measure_request_type_tree,
26887     &ett_tag_measure_report_mode_tree,
26888     &ett_tag_measure_report_type_tree,
26889     &ett_tag_measure_report_basic_map_tree,
26890     &ett_tag_measure_report_rpi_tree,
26891     &ett_tag_measure_report_frame_tree,
26892     &ett_tag_measure_reported_frame_tree,
26893     &ett_tag_bss_bitmask_tree,
26894     &ett_tag_dfs_map_tree,
26895     &ett_tag_erp_info_tree,
26896     &ett_tag_ex_cap1,
26897     &ett_tag_ex_cap2,
26898     &ett_tag_ex_cap3,
26899     &ett_tag_ex_cap4,
26900     &ett_tag_ex_cap5,
26901     &ett_tag_ex_cap6,
26902     &ett_tag_ex_cap7,
26903     &ett_tag_ex_cap8,
26904     &ett_tag_ex_cap9,
26905
26906     &ett_tag_rm_cap1,
26907     &ett_tag_rm_cap2,
26908     &ett_tag_rm_cap3,
26909     &ett_tag_rm_cap4,
26910     &ett_tag_rm_cap5,
26911     &ett_tag_tclas_mask_tree,
26912
26913     &ett_tag_supported_channels,
26914
26915     &ett_tag_neighbor_report_bssid_info_tree,
26916     &ett_tag_neighbor_report_bssid_info_capability_tree,
26917     &ett_tag_neighbor_report_sub_tag_tree,
26918
26919     &ett_tag_wapi_param_set_akm_tree,
26920     &ett_tag_wapi_param_set_ucast_tree,
26921     &ett_tag_wapi_param_set_mcast_tree,
26922     &ett_tag_wapi_param_set_preauth_tree,
26923
26924     &ett_tag_time_adv_tree,
26925
26926     &ett_ff_ba_param_tree,
26927     &ett_ff_ba_ssc_tree,
26928     &ett_ff_delba_param_tree,
26929     &ett_ff_qos_info,
26930     &ett_ff_psmp_param_set,
26931     &ett_ff_mimo_cntrl,
26932     &ett_ff_ant_sel,
26933     &ett_mimo_report,
26934     &ett_ff_sm_pwr_save,
26935     &ett_ff_chan_switch_announce,
26936     &ett_ff_ht_info,
26937     &ett_ff_psmp_sta_info,
26938
26939     &ett_tpc,
26940
26941     &ett_msdu_aggregation_parent_tree,
26942     &ett_msdu_aggregation_subframe_tree,
26943
26944     &ett_80211_mgt_ie,
26945     &ett_tsinfo_tree,
26946     &ett_sched_tree,
26947
26948     &ett_fcs,
26949
26950     &ett_adv_proto,
26951     &ett_adv_proto_tuple,
26952     &ett_gas_query,
26953     &ett_gas_anqp,
26954     &ett_nai_realm,
26955     &ett_nai_realm_eap,
26956     &ett_tag_ric_data_desc_ie,
26957     &ett_anqp_vendor_capab,
26958
26959     &ett_hs20_cc_proto_port_tuple,
26960
26961     &ett_ssid_list,
26962
26963     &ett_nintendo,
26964
26965     &ett_qos_map_set_exception,
26966     &ett_qos_map_set_range,
26967
26968     /* 802.11ad trees */
26969     &ett_dynamic_alloc_tree,
26970     &ett_ssw_tree,
26971     &ett_bf_tree,
26972     &ett_sswf_tree,
26973     &ett_brp_tree,
26974     &ett_blm_tree,
26975     &ett_bic_tree,
26976     &ett_dmg_params_tree,
26977     &ett_cc_tree,
26978     &ett_rcsi_tree,
26979     &ett_80211_ext,
26980     &ett_allocation_tree,
26981     &ett_sta_info,
26982
26983     &ett_gas_resp_fragment,
26984     &ett_gas_resp_fragments
26985   };
26986
26987   static ei_register_info ei[] = {
26988     { &ei_ieee80211_bad_length,
26989       { "ieee80211.bad_length", PI_MALFORMED, PI_ERROR,
26990         "Wrong length indicated", EXPFILL }},
26991     { &ei_ieee80211_inv_val,
26992       { "ieee80211.invalid_value", PI_MALFORMED, PI_WARN,
26993         "Invalid value", EXPFILL }},
26994     { &ei_ieee80211_tag_number, { "wlan_mgt.tag.number.unexpected_ie", PI_MALFORMED, PI_ERROR, "Unexpected IE (expected Advertisement Protocol)", EXPFILL }},
26995     { &ei_ieee80211_tag_length, { "wlan_mgt.tag.length.bad", PI_MALFORMED, PI_ERROR, "Bad tag length", EXPFILL }},
26996     { &ei_ieee80211_extra_data, { "ieee80211.extra_data", PI_MALFORMED, PI_WARN, "Unexpected extra data in the end", EXPFILL }},
26997     { &ei_ieee80211_ff_anqp_capability, { "wlan_mgt.fixed.anqp.capability.invalid", PI_MALFORMED, PI_ERROR, "Invalid vendor-specific ANQP capability", EXPFILL }},
26998     { &ei_ieee80211_ff_anqp_venue_length, { "wlan_mgt.fixed.anqp.venue.length.invalid", PI_MALFORMED, PI_ERROR, "Invalid Venue Name Duple length", EXPFILL }},
26999     { &ei_ieee80211_ff_anqp_roaming_consortium_oi_len, { "wlan_mgt.fixed.anqp.roaming_consortium.oi_len.invalid", PI_MALFORMED, PI_ERROR, "Invalid Roaming Consortium OI", EXPFILL }},
27000     { &ei_ieee80211_ff_anqp_nai_field_len, { "wlan_mgt.fixed.anqp.nai_realm_list.field_len.invalid", PI_MALFORMED, PI_ERROR, "Invalid NAI Realm List", EXPFILL }},
27001     { &ei_ieee80211_ff_anqp_nai_realm_eap_len, { "wlan_mgt.fixed.naqp_nai_realm_list.eap_method_len.invalid", PI_MALFORMED, PI_ERROR, "Invalid EAP Method subfield", EXPFILL }},
27002     { &ei_hs20_anqp_ofn_length, { "wlan_mgt.hs20.anqp.ofn.length.invalid", PI_MALFORMED, PI_ERROR, "Invalid Operator Friendly Name Duple length", EXPFILL }},
27003     { &ei_hs20_anqp_nai_hrq_length, { "wlan_mgt.hs20.anqp.nai_hrq.length.invalid", PI_MALFORMED, PI_ERROR, "Invalid NAI Home Realm Query length", EXPFILL }},
27004     { &ei_ieee80211_ff_anqp_info_length, { "wlan_mgt.fixed.anqp.info_length.invalid", PI_MALFORMED, PI_ERROR, "Invalid ANQP Info length", EXPFILL }},
27005     { &ei_ieee80211_not_enough_room_for_anqp_header, { "wlan_mgt.fixed.query_length_invalid", PI_MALFORMED, PI_ERROR, "Not enough room for ANQP header", EXPFILL }},
27006     { &ei_ieee80211_ff_query_request_length, { "wlan_mgt.fixed.query_request_length.invalid", PI_MALFORMED, PI_ERROR, "Invalid Query Request Length", EXPFILL }},
27007     { &ei_ieee80211_ff_query_response_length, { "wlan_mgt.fixed.query_response_length.invalid", PI_MALFORMED, PI_ERROR, "Invalid Query Response Length", EXPFILL }},
27008     { &ei_ieee80211_tag_wnm_sleep_mode_no_key_data, { "wlan_mgt.wnm_sleep_mode.no_key_data", PI_MALFORMED, PI_ERROR, "WNM-Sleep Mode Response is not long enough to include Key Data", EXPFILL }},
27009     { &ei_ieee80211_tdls_setup_response_malformed, { "wlan_mgt.tdls_setup_response_malformed", PI_MALFORMED, PI_ERROR, "TDLS Setup Response (success) does not include mandatory fields", EXPFILL }},
27010     { &ei_ieee80211_tdls_setup_confirm_malformed, { "wlan_mgt.tdls_setup_confirm_malformed", PI_MALFORMED, PI_ERROR, "TDLS Setup Confirm (success) does not include mandatory fields", EXPFILL }},
27011     { &ei_ieee80211_wfa_ie_wme_qos_info_bad_ftype, { "wlan_mgt.wfa.ie.wme.qos_info.bad_ftype", PI_UNDECODED, PI_WARN, "Could not deduce direction to decode correctly", EXPFILL }},
27012     { &ei_ieee80211_qos_info_bad_ftype, { "wlan_mgt.qos_info.bad_ftype", PI_UNDECODED, PI_WARN, "Could not deduce direction to decode correctly", EXPFILL }},
27013     { &ei_ieee80211_rsn_pcs_count, { "wlan_mgt.rsn.pcs.count.invalid", PI_MALFORMED, PI_ERROR, "Pairwise Cipher Suite Count too large", EXPFILL }},
27014     { &ei_ieee80211_rsn_pmkid_count, { "wlan_mgt.rsn.akms.count.invalid", PI_MALFORMED, PI_ERROR, "Auth Key Management (AKM) Suite Count too large", EXPFILL }},
27015     { &ei_ieee80211_pmkid_count_too_large, { "wlan_mgt.rsn.pmkid.count.invalid", PI_MALFORMED, PI_ERROR, "PMKID Count too large", EXPFILL }},
27016     { &ei_ieee80211_vht_tpe_pwr_info_count, { "wlan_mgt.vht.tpe.pwr_info.count.invalid", PI_MALFORMED, PI_ERROR, "Max Tx Pwr Count is Incorrect, should be 0-7", EXPFILL }},
27017     { &ei_ieee80211_missing_data, { "ieee80211.missing_data", PI_MALFORMED, PI_WARN, "No TFS Request subelements in TFS Request", EXPFILL }},
27018     { &ei_ieee80211_fc_retry, { "wlan.fc.retry.expert", PI_SEQUENCE, PI_NOTE, "Retransmission (retry)", EXPFILL }},
27019     { &ei_ieee80211_tag_measure_request_unknown, { "wlan_mgt.measure.req.unknown.expert", PI_UNDECODED, PI_WARN, "Undecoded Measurement Request type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
27020     { &ei_ieee80211_tag_measure_request_beacon_unknown, { "wlan_mgt.measure.req.beacon.unknown.expert", PI_UNDECODED, PI_WARN, "Unknown Data (not interpreted)", EXPFILL }},
27021     { &ei_ieee80211_tag_measure_report_unknown, { "wlan_mgt.measure.req.unknown.expert", PI_UNDECODED, PI_WARN, "Undecoded Measurement Report type (or subtype), Contact Wireshark developers if you want this supported", EXPFILL }},
27022     { &ei_ieee80211_tag_data, { "wlan_mgt.tag.data.undecoded", PI_UNDECODED, PI_NOTE, "Dissector for 802.11 IE Tag code not implemented, Contact Wireshark developers if you want this supported", EXPFILL }},
27023     { &ei_ieee80211_dmg_subtype, { "wlan.dmg_subtype.bad", PI_MALFORMED, PI_ERROR, "Bad DMG type/subtype", EXPFILL }},
27024     { &ei_ieee80211_vht_action, { "wlan_mgt.vht.action.undecoded", PI_UNDECODED, PI_NOTE, "All subtype of VHT Action is not yet supported by Wireshark", EXPFILL }},
27025     { &ei_ieee80211_mesh_peering_unexpected, { "wlan.peering.unexpected", PI_MALFORMED, PI_ERROR, "Unexpected Self-protected action", EXPFILL }},
27026
27027   };
27028
27029   expert_module_t *expert_ieee80211;
27030
27031   module_t *wlan_module;
27032
27033   const unsigned char bssid_broadcast_data[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
27034
27035   memset(&wlan_stats, 0, sizeof wlan_stats);
27036
27037   proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
27038       "IEEE 802.11 Aggregate Data", "wlan_aggregate");
27039   proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
27040
27041   proto_wlan = proto_register_protocol("IEEE 802.11 wireless LAN", "IEEE 802.11", "wlan");
27042   /* Created to remove Decode As confusion */
27043   proto_centrino = proto_register_protocol("IEEE 802.11 wireless LAN (Centrino)", "IEEE 802.11 (Centrino)", "wlan_centrino");
27044   proto_register_field_array(proto_wlan, hf, array_length (hf));
27045
27046   proto_wlan_mgt = proto_register_protocol("IEEE 802.11 wireless LAN management frame",
27047       "IEEE 802.11 MGT", "wlan_mgt");
27048   proto_register_field_array (proto_wlan_mgt, ff, array_length (ff));
27049
27050   proto_wlan_ext = proto_register_protocol ("IEEE 802.11 wireless LAN extension frame",
27051       "IEEE 802.11 EXT", "wlan_ext");
27052
27053   proto_register_subtree_array (tree_array, array_length (tree_array));
27054
27055   expert_ieee80211 = expert_register_protocol(proto_wlan);
27056   expert_register_field_array(expert_ieee80211, ei, array_length(ei));
27057
27058   register_dissector("wlan",                dissect_ieee80211,                    proto_wlan);
27059   register_dissector("wlan_withfcs",            dissect_ieee80211_withfcs,            proto_wlan);
27060   register_dissector("wlan_withoutfcs",         dissect_ieee80211_withoutfcs,         proto_wlan);
27061   register_dissector("wlan_bsfc",               dissect_ieee80211_bsfc,               proto_wlan);
27062
27063   register_init_routine(wlan_defragment_init);
27064   register_cleanup_routine(wlan_defragment_cleanup);
27065   register_init_routine(wlan_retransmit_init);
27066   register_init_routine(ieee80211_gas_reassembly_init);
27067
27068   wlan_tap = register_tap("wlan");
27069   register_conversation_table(proto_wlan, TRUE, wlan_conversation_packet, wlan_hostlist_packet);
27070
27071   wlan_address_type = address_type_dissector_register("AT_ETHER_WLAN", "WLAN Address", ether_to_str, ether_str_len, wlan_col_filter_str,
27072                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
27073   wlan_bssid_address_type = address_type_dissector_register("AT_ETHER_BSSID", "WLAN BSSID Address", ether_to_str, ether_str_len, wlan_bssid_col_filter_str,
27074                                                             ether_len, ether_name_resolution_str, ether_name_resolution_len);
27075   set_address(&bssid_broadcast, wlan_bssid_address_type, 6, bssid_broadcast_data);
27076
27077   /* Register configuration options */
27078   wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
27079   prefs_register_bool_preference(wlan_module, "defragment",
27080     "Reassemble fragmented 802.11 datagrams",
27081     "Whether fragmented 802.11 datagrams should be reassembled",
27082      &wlan_defragment);
27083
27084   prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
27085     "Ignore vendor-specific HT elements",
27086     "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
27087     &wlan_ignore_draft_ht);
27088
27089   prefs_register_bool_preference(wlan_module, "retransmitted",
27090     "Call subdissector for retransmitted 802.11 frames",
27091     "Whether retransmitted 802.11 frames should be subdissected",
27092     &wlan_subdissector);
27093
27094   prefs_register_bool_preference(wlan_module, "check_fcs",
27095     "Assume packets have FCS",
27096     "Some 802.11 cards include the FCS at the end of a packet, others do not.",
27097     &wlan_check_fcs);
27098
27099   prefs_register_bool_preference(wlan_module, "check_checksum",
27100     "Validate the FCS checksum if possible",
27101     "Whether to validate the FCS checksum or not.",
27102     &wlan_check_checksum);
27103
27104   /* Davide Schiera (2006-11-26): changed "WEP bit" in "Protection bit"    */
27105   prefs_register_enum_preference(wlan_module, "ignore_wep",
27106     "Ignore the Protection bit",
27107     "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
27108     "and some also leave the IV (initialization vector).",
27109     &wlan_ignore_wep, wlan_ignore_wep_options, TRUE);
27110
27111   prefs_register_obsolete_preference(wlan_module, "wep_keys");
27112
27113   /* Davide Schiera (2006-11-26): added reference to WPA/WPA2 decryption    */
27114   prefs_register_bool_preference(wlan_module, "enable_decryption",
27115     "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
27116     &enable_decryption);
27117
27118   prefs_register_static_text_preference(wlan_module, "info_decryption_key",
27119     "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
27120     "010203040506070809101111213 (104/128-bit WEP),\n"
27121     "MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
27122     "0102030405...6061626364 (WPA + 256-bit key).  "
27123     "Invalid keys will be ignored.",
27124     "Valid key formats");
27125
27126   wep_uat = uat_new("WEP and WPA Decryption Keys",
27127             sizeof(uat_wep_key_record_t), /* record size */
27128             "80211_keys",                 /* filename */
27129             TRUE,                         /* from_profile */
27130             &uat_wep_key_records,         /* data_ptr */
27131             &num_wepkeys_uat,             /* numitems_ptr */
27132             UAT_AFFECTS_DISSECTION,       /* affects dissection of packets, but not set of named fields */
27133             NULL,                         /* help */
27134             uat_wep_key_record_copy_cb,   /* copy callback */
27135             uat_wep_key_record_update_cb, /* update callback */
27136             uat_wep_key_record_free_cb,   /* free callback */
27137             init_wepkeys,                 /* post update callback - update the WEP/WPA keys */
27138             wep_uat_flds);                /* UAT field definitions */
27139
27140   prefs_register_uat_preference(wlan_module,
27141                                 "wep_key_table",
27142                                 "Decryption Keys",
27143                                 "WEP and pre-shared WPA keys",
27144                                 wep_uat);
27145 }
27146
27147 void
27148 proto_register_wlan_rsna_eapol (void)
27149 {
27150
27151   static hf_register_info hf[] = {
27152     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo,
27153      {"Key Information", "wlan_rsna_eapol.keydes.key_info",
27154       FT_UINT16, BASE_HEX, NULL, 0x0,
27155       NULL, HFILL }},
27156
27157     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_keydes_version,
27158      {"Key Descriptor Version", "wlan_rsna_eapol.keydes.key_info.keydes_version",
27159       FT_UINT16, BASE_DEC, VALS(keydes_version_vals), KEY_INFO_KEYDES_VERSION_MASK,
27160       NULL, HFILL }},
27161
27162     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_type,
27163      {"Key Type", "wlan_rsna_eapol.keydes.key_info.key_type",
27164       FT_BOOLEAN, 16, TFS(&keyinfo_key_type_tfs), KEY_INFO_KEY_TYPE_MASK,
27165       NULL, HFILL }},
27166
27167     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_index,
27168      {"Key Index", "wlan_rsna_eapol.keydes.key_info.key_index",
27169       FT_UINT16, BASE_DEC, NULL, KEY_INFO_KEY_INDEX_MASK,
27170       NULL, HFILL }},
27171
27172     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_install,
27173      {"Install", "wlan_rsna_eapol.keydes.key_info.install",
27174       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_INSTALL_MASK,
27175       NULL, HFILL }},
27176
27177     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_ack,
27178      {"Key ACK", "wlan_rsna_eapol.keydes.key_info.key_ack",
27179       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_ACK_MASK,
27180       NULL, HFILL }},
27181
27182     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_key_mic,
27183      {"Key MIC", "wlan_rsna_eapol.keydes.key_info.key_mic",
27184       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_KEY_MIC_MASK,
27185       NULL, HFILL }},
27186
27187     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_secure,
27188      {"Secure", "wlan_rsna_eapol.keydes.key_info.secure",
27189       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_SECURE_MASK,
27190       NULL, HFILL }},
27191
27192     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_error,
27193      {"Error", "wlan_rsna_eapol.keydes.key_info.error",
27194       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ERROR_MASK,
27195       NULL, HFILL }},
27196
27197     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_request,
27198      {"Request", "wlan_rsna_eapol.keydes.key_info.request",
27199       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_REQUEST_MASK,
27200       NULL, HFILL }},
27201
27202     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_encrypted_key_data,
27203      {"Encrypted Key Data", "wlan_rsna_eapol.keydes.key_info.encrypted_key_data",
27204       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ENCRYPTED_KEY_DATA_MASK,
27205       NULL, HFILL }},
27206
27207     {&hf_wlan_rsna_eapol_wpa_keydes_keyinfo_smk_message,
27208      {"SMK Message", "wlan_rsna_eapol.keydes.key_info.smk_message",
27209       FT_BOOLEAN, 16, TFS(&tfs_set_notset), KEY_INFO_ENCRYPTED_KEY_DATA_MASK,
27210       NULL, HFILL }},
27211
27212     {&hf_wlan_rsna_eapol_keydes_key_len,
27213      {"Key Length", "eapol.keydes.key_len",
27214       FT_UINT16, BASE_DEC, NULL, 0x0,
27215       NULL, HFILL }},
27216
27217     {&hf_wlan_rsna_eapol_keydes_replay_counter,
27218      {"Replay Counter", "eapol.keydes.replay_counter",
27219       FT_UINT64, BASE_DEC, NULL, 0x0,
27220       NULL, HFILL }},
27221
27222     {&hf_wlan_rsna_eapol_keydes_key_iv,
27223      {"Key IV", "eapol.keydes.key_iv",
27224       FT_BYTES, BASE_NONE, NULL, 0x0,
27225       NULL, HFILL }},
27226
27227     {&hf_wlan_rsna_eapol_wpa_keydes_nonce,
27228      {"WPA Key Nonce", "wlan_rsna_eapol.keydes.nonce",
27229       FT_BYTES, BASE_NONE, NULL, 0x0,
27230       NULL, HFILL }},
27231
27232     {&hf_wlan_rsna_eapol_wpa_keydes_rsc,
27233      {"WPA Key RSC", "wlan_rsna_eapol.keydes.rsc",
27234       FT_BYTES, BASE_NONE, NULL, 0x0,
27235       NULL, HFILL }},
27236
27237     {&hf_wlan_rsna_eapol_wpa_keydes_id,
27238      {"WPA Key ID", "wlan_rsna_eapol.keydes.id",
27239       FT_BYTES, BASE_NONE, NULL, 0x0,
27240       NULL, HFILL }},
27241
27242     {&hf_wlan_rsna_eapol_wpa_keydes_mic,
27243      {"WPA Key MIC", "wlan_rsna_eapol.keydes.mic",
27244       FT_BYTES, BASE_NONE, NULL, 0x0,
27245       NULL, HFILL }},
27246
27247     {&hf_wlan_rsna_eapol_wpa_keydes_data_len,
27248      {"WPA Key Data Length", "wlan_rsna_eapol.keydes.data_len",
27249       FT_UINT16, BASE_DEC, NULL, 0x0,
27250       NULL, HFILL }},
27251
27252     {&hf_wlan_rsna_eapol_wpa_keydes_data,
27253      {"WPA Key Data", "wlan_rsna_eapol.keydes.data",
27254       FT_BYTES, BASE_NONE, NULL, 0x0,
27255       NULL, HFILL }},
27256   };
27257
27258   static gint *tree_array[] = {
27259     &ett_keyinfo,
27260     &ett_wlan_rsna_eapol_keydes_data,
27261   };
27262
27263   proto_wlan_rsna_eapol = proto_register_protocol("IEEE 802.11 RSNA EAPOL key",
27264       "802.11 RSNA EAPOL", "wlan_rsna_eapol");
27265   proto_register_field_array(proto_wlan_rsna_eapol, hf, array_length (hf));
27266
27267   proto_register_subtree_array (tree_array, array_length (tree_array));
27268 }
27269
27270 void
27271 proto_reg_handoff_ieee80211(void)
27272 {
27273   dissector_handle_t data_encap_handle, centrino_handle;
27274   dissector_handle_t wlan_rsna_eapol_wpa_key_handle, wlan_rsna_eapol_rsn_key_handle, wlan_withoutfcs_handle;
27275
27276   /*
27277    * Get handles for the LLC, IPX and Ethernet  dissectors.
27278    */
27279   llc_handle            = find_dissector("llc");
27280   ipx_handle            = find_dissector("ipx");
27281   eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
27282   data_handle           = find_dissector("data");
27283
27284   ieee80211_handle = find_dissector("wlan");
27285   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
27286
27287   centrino_handle = create_dissector_handle( dissect_ieee80211_centrino, proto_centrino );
27288   dissector_add_uint("ethertype", ETHERTYPE_CENTRINO_PROMISC, centrino_handle);
27289
27290   register_capture_dissector("wtap_encap", WTAP_ENCAP_IEEE_802_11, capture_ieee80211, proto_wlan);
27291   register_capture_dissector("wtap_encap", WTAP_ENCAP_IEEE_802_11_WITH_RADIO, capture_ieee80211, proto_wlan);
27292   register_capture_dissector("ppi", 105 /* DLT_DLT_IEEE802_11 */, capture_ieee80211, proto_wlan);
27293
27294   /* Register handoff to Aruba GRE */
27295   dissector_add_uint("gre.proto", GRE_ARUBA_8200, ieee80211_handle);
27296   dissector_add_uint("gre.proto", GRE_ARUBA_8210, ieee80211_handle);
27297   dissector_add_uint("gre.proto", GRE_ARUBA_8220, ieee80211_handle);
27298   dissector_add_uint("gre.proto", GRE_ARUBA_8230, ieee80211_handle);
27299   dissector_add_uint("gre.proto", GRE_ARUBA_8240, ieee80211_handle);
27300   dissector_add_uint("gre.proto", GRE_ARUBA_8250, ieee80211_handle);
27301   dissector_add_uint("gre.proto", GRE_ARUBA_8260, ieee80211_handle);
27302   dissector_add_uint("gre.proto", GRE_ARUBA_8270, ieee80211_handle);
27303   dissector_add_uint("gre.proto", GRE_ARUBA_8280, ieee80211_handle);
27304   dissector_add_uint("gre.proto", GRE_ARUBA_8290, ieee80211_handle);
27305   dissector_add_uint("gre.proto", GRE_ARUBA_82A0, ieee80211_handle);
27306   dissector_add_uint("gre.proto", GRE_ARUBA_82B0, ieee80211_handle);
27307   dissector_add_uint("gre.proto", GRE_ARUBA_82C0, ieee80211_handle);
27308   dissector_add_uint("gre.proto", GRE_ARUBA_82D0, ieee80211_handle);
27309   dissector_add_uint("gre.proto", GRE_ARUBA_82E0, ieee80211_handle);
27310   dissector_add_uint("gre.proto", GRE_ARUBA_82F0, ieee80211_handle);
27311   dissector_add_uint("gre.proto", GRE_ARUBA_8300, ieee80211_handle);
27312   dissector_add_uint("gre.proto", GRE_ARUBA_8310, ieee80211_handle);
27313   dissector_add_uint("gre.proto", GRE_ARUBA_8320, ieee80211_handle);
27314   dissector_add_uint("gre.proto", GRE_ARUBA_8330, ieee80211_handle);
27315   dissector_add_uint("gre.proto", GRE_ARUBA_8340, ieee80211_handle);
27316   dissector_add_uint("gre.proto", GRE_ARUBA_8350, ieee80211_handle);
27317   dissector_add_uint("gre.proto", GRE_ARUBA_8360, ieee80211_handle);
27318   dissector_add_uint("gre.proto", GRE_ARUBA_8370, ieee80211_handle);
27319
27320   data_encap_handle = create_dissector_handle(dissect_data_encap, proto_wlan);
27321   dissector_add_uint("ethertype", ETHERTYPE_IEEE80211_DATA_ENCAP,
27322                 data_encap_handle);
27323
27324   /*
27325    * EAPOL key descriptor types.
27326    */
27327   wlan_rsna_eapol_wpa_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
27328                                                                proto_wlan_rsna_eapol);
27329   dissector_add_uint("eapol.keydes.type", EAPOL_WPA_KEY, wlan_rsna_eapol_wpa_key_handle);
27330   wlan_rsna_eapol_rsn_key_handle = create_dissector_handle(dissect_wlan_rsna_eapol_wpa_or_rsn_key,
27331                                                                proto_wlan_rsna_eapol);
27332   dissector_add_uint("eapol.keydes.type", EAPOL_RSN_KEY, wlan_rsna_eapol_rsn_key_handle);
27333
27334   wlan_withoutfcs_handle = find_dissector("wlan_withoutfcs");
27335   dissector_add_uint("sflow_245.header_protocol", SFLOW_5_HEADER_80211_MAC, wlan_withoutfcs_handle);
27336 }
27337
27338 /*
27339  * Editor modelines
27340  *
27341  * Local Variables:
27342  * c-basic-offset: 2
27343  * tab-width: 8
27344  * indent-tabs-mode: nil
27345  * End:
27346  *
27347  * ex: set shiftwidth=2 tabstop=8 expandtab:
27348  * :indentSize=2:tabSize=8:noTabs=true:
27349  */