SCSI Add decoding of Block Device Characteristics VPD page
[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  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * Credits:
26  *
27  * The following people helped me by pointing out bugs etc. Thank you!
28  *
29  * Marco Molteni
30  * Lena-Marie Nilsson
31  * Magnus Hultman-Persson
32  */
33
34 /*
35  * 09/12/2003 - Added dissection of country information tag
36  *
37  * Ritchie<at>tipsybottle.com
38  *
39  * 03/22/2004 - Added dissection of RSN IE
40  * Jouni Malinen <jkmaline@cc.hut.fi>
41  *
42  * 10/24/2005 - Add dissection for 802.11e
43  * Zhu Yi <yi.zhu@intel.com>
44  *
45  * Dutin Johnson - 802.11n and portions of 802.11k and 802.11ma
46  * dustin@dustinj.us & dustin.johnson@cacetech.com
47  *
48  * 01/31/2008 - Added dissection of 802.11s
49  * Javier Cardona <javier@cozybit.com>
50  *
51  * 04/21/2008 - Added dissection for 802.11p
52  * Arada Systems <http://www.aradasystems.com>
53  *
54  * 05/29/2011 - UATification of decryption keys
55  * Michael Mann <mmann78@netscape.net>
56  *
57  * 07/30/2011 - Update 802.11s packet dissecting to the ratified standard (v12.0)
58  * Brian Cavagnolo <brian@cozybit.com>
59  *
60  * Enhance 802.11 dissector by Alexis La Goutte
61  */
62
63 /*
64  * Reference :
65  * The 802.11 standard is "free", 6 month after the publication.
66  *
67  * IEEE Std 802.11-2012: Revision of IEEE Std 802.11-2007
68  * include 10 amendments (802.11k,r,y,w,n,p,z,v,u,s) 802.11-2007
69  * include 8 amendments (802.11a,b,d,e,g,h,i,j) 802.11-1999
70  * http://standards.ieee.org/getieee802/download/802.11-2012.pdf
71  *
72  * WAPI (IE 68)
73  * http://isotc.iso.org/livelink/livelink/fetch/-8913189/8913214/8913250/8913253/JTC001-N-9880.pdf?nodeid=8500308&vernum=-2
74  */
75
76
77 #include "config.h"
78
79 #include <string.h>
80 #include <math.h>
81
82 #include <glib.h>
83
84 #include <epan/packet.h>
85 #include <epan/bitswap.h>
86 #include <epan/addr_resolv.h>
87 #include <epan/strutil.h>
88 #include <epan/prefs.h>
89 #include <epan/reassemble.h>
90 #include "packet-ipx.h"
91 #include "packet-llc.h"
92 #include "packet-ieee80211.h"
93 #include <epan/etypes.h>
94 #include <epan/greproto.h>
95 #include <epan/oui.h>
96 #include <wsutil/crc32.h>
97 #include <epan/crc32-tvb.h>
98 #include <epan/tap.h>
99 #include <epan/emem.h>
100 #include <epan/crypt/wep-wpadefs.h>
101 #include <epan/expert.h>
102 #include <epan/uat.h>
103
104 #include "packet-wps.h"
105 #include "packet-wifi-p2p.h"
106
107 /*     Davide Schiera (2006-11-22): including AirPDcap project                */
108 #include <epan/crypt/airpdcap_ws.h>
109 /* Davide Schiera (2006-11-22) ---------------------------------------------- */
110
111 extern value_string_ext eap_type_vals_ext; /* from packet-eap.c */
112
113 /* To Avoid Compilation warnings/errors because
114  * dissectors such as RIC will use this function recursively
115  */
116 static int add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype);
117
118 #ifndef roundup2
119 #define roundup2(x, y)  (((x)+((y)-1))&(~((y)-1)))  /* if y is powers of two */
120 #endif
121
122 /* Defragment fragmented 802.11 datagrams */
123 static gboolean wlan_defragment = TRUE;
124
125 /* call subdissector for retransmitted frames */
126 static gboolean wlan_subdissector = TRUE;
127
128 /* Check for the presence of the 802.11 FCS */
129 static gboolean wlan_check_fcs = FALSE;
130
131 /* Ignore vendor-specific HT elements */
132 static gboolean wlan_ignore_draft_ht = FALSE;
133
134 /* Ignore the WEP bit; assume packet is decrypted */
135 #define WLAN_IGNORE_WEP_NO     0
136 #define WLAN_IGNORE_WEP_WO_IV  1
137 #define WLAN_IGNORE_WEP_W_IV   2
138 static gint wlan_ignore_wep = WLAN_IGNORE_WEP_NO;
139
140 /* Table for reassembly of fragments. */
141 static reassembly_table wlan_reassembly_table;
142
143 /* Statistical data */
144 static struct _wlan_stats wlan_stats;
145
146 /*-------------------------------------
147  * UAT for WEP decoder
148  *-------------------------------------
149  */
150 static uat_wep_key_record_t *uat_wep_key_records = NULL;
151 static uat_t                *wep_uat             = NULL;
152 static guint                 num_wepkeys_uat     = 0;
153
154 static void *
155 uat_wep_key_record_copy_cb(void* n, const void* o, size_t siz _U_)
156 {
157     uat_wep_key_record_t* new_key = (uat_wep_key_record_t *)n;
158     const uat_wep_key_record_t* old_key = (const uat_wep_key_record_t *)o;
159
160     if (old_key->string) {
161         new_key->string = g_strdup(old_key->string);
162     } else {
163         new_key->string = NULL;
164     }
165
166     return new_key;
167 }
168
169 static void
170 uat_wep_key_record_update_cb(void* r, const char** err)
171 {
172     uat_wep_key_record_t* rec = (uat_wep_key_record_t *)r;
173     decryption_key_t* dk;
174
175     if (rec->string == NULL) {
176          *err = ep_strdup_printf("Key can't be blank");
177     } else {
178         g_strstrip(rec->string);
179         dk = parse_key_string(rec->string, rec->key);
180
181         if (dk != NULL) {
182            switch (dk->type) {
183               case AIRPDCAP_KEY_TYPE_WEP:
184               case AIRPDCAP_KEY_TYPE_WEP_40:
185               case AIRPDCAP_KEY_TYPE_WEP_104:
186                  if (rec->key != AIRPDCAP_KEY_TYPE_WEP) {
187                     *err = ep_strdup_printf("Invalid key format");
188                  }
189                  break;
190               case AIRPDCAP_KEY_TYPE_WPA_PWD:
191                  if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PWD) {
192                     *err = ep_strdup_printf("Invalid key format");
193                  }
194                  break;
195               case AIRPDCAP_KEY_TYPE_WPA_PSK:
196                  if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PSK) {
197                     *err = ep_strdup_printf("Invalid key format");
198                  }
199                  break;
200               default:
201                  *err = ep_strdup_printf("Invalid key format");
202                  break;
203            }
204         } else {
205            *err = ep_strdup_printf("Invalid key format");
206         }
207     }
208 }
209
210 static void
211 uat_wep_key_record_free_cb(void*r)
212 {
213     uat_wep_key_record_t* key = (uat_wep_key_record_t *)r;
214
215     if (key->string) g_free(key->string);
216 }
217
218 UAT_VS_DEF(uat_wep_key_records, key, uat_wep_key_record_t, guint8, 0, STRING_KEY_TYPE_WEP)
219 UAT_CSTRING_CB_DEF(uat_wep_key_records, string, uat_wep_key_record_t)
220
221 /* Stuff for the WEP decoder */
222 static gboolean enable_decryption = FALSE;
223
224 /* Davide Schiera (2006-11-26): created function to decrypt WEP and WPA/WPA2  */
225 static tvbuff_t *try_decrypt(tvbuff_t *tvb, guint32 offset, guint32 len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer);
226
227 static int weak_iv(guchar *iv);
228
229 typedef struct mimo_control
230 {
231   guint8 nc;
232   guint8 nr;
233   gboolean chan_width;
234   guint8 grouping;
235   guint8 coefficient_size;
236   guint8 codebook_info;
237   guint8 remaining_matrix_segment;
238 } mimo_control_t;
239
240 /* ************************************************************************* */
241 /*                          Miscellaneous Constants                          */
242 /* ************************************************************************* */
243 #define SHORT_STR 256
244
245 /* ************************************************************************* */
246 /*  Define some very useful macros that are used to analyze frame types etc. */
247 /* ************************************************************************* */
248
249 /*
250  * Fetch the frame control field and swap it if needed.  "fcf" and "tvb"
251  * must be valid variables.
252  */
253 #define FETCH_FCF(off) (wlan_broken_fc ? \
254   BSWAP16(tvb_get_letohs(tvb, off)) : \
255   tvb_get_letohs(tvb, off))
256
257 /*
258  * Extract the protocol version from the frame control field
259  */
260 #define FCF_PROT_VERSION(x)  ((x) & 0x3)
261
262 /*
263  * Extract the frame type from the frame control field.
264  */
265 #define FCF_FRAME_TYPE(x)    (((x) & 0xC) >> 2)
266
267 /*
268  * Extract the frame subtype from the frame control field.
269  */
270 #define FCF_FRAME_SUBTYPE(x) (((x) & 0xF0) >> 4)
271
272 /*
273  * Convert the frame type and subtype from the frame control field into
274  * one of the MGT_, CTRL_, or DATA_ values.
275  */
276 #define COMPOSE_FRAME_TYPE(x) (((x & 0x0C)<< 2)+FCF_FRAME_SUBTYPE(x))  /* Create key to (sub)type */
277
278 /*
279  * The subtype field of a data frame is, in effect, composed of 4 flag
280  * bits - CF-Ack, CF-Poll, Null (means the frame doesn't actually have
281  * any data), and QoS.
282  */
283 #define DATA_FRAME_IS_CF_ACK(x)  ((x) & 0x01)
284 #define DATA_FRAME_IS_CF_POLL(x) ((x) & 0x02)
285 #define DATA_FRAME_IS_NULL(x)    ((x) & 0x04)
286 #define DATA_FRAME_IS_QOS(x)     ((x) & 0x08)
287
288 /*
289  * Extract the flags from the frame control field.
290  */
291 #define FCF_FLAGS(x)           (((x) & 0xFF00) >> 8)
292
293 /*
294  * Bits from the flags field.
295  */
296 #define FLAG_TO_DS            0x01
297 #define FLAG_FROM_DS          0x02
298 #define FLAG_MORE_FRAGMENTS   0x04
299 #define FLAG_RETRY            0x08
300 #define FLAG_POWER_MGT        0x10
301 #define FLAG_MORE_DATA        0x20
302 #define FLAG_PROTECTED        0x40
303 #define FLAG_ORDER            0x80
304
305 /*
306  * Test bits in the flags field.
307  */
308 /*
309  * XXX - Only HAVE_FRAGMENTS, IS_PROTECTED, and IS_STRICTLY_ORDERED
310  * are in use.  Should the rest be removed?
311  */
312 #define IS_TO_DS(x)            ((x) & FLAG_TO_DS)
313 #define IS_FROM_DS(x)          ((x) & FLAG_FROM_DS)
314 #define HAVE_FRAGMENTS(x)      ((x) & FLAG_MORE_FRAGMENTS)
315 #define IS_RETRY(x)            ((x) & FLAG_RETRY)
316 #define POWER_MGT_STATUS(x)    ((x) & FLAG_POWER_MGT)
317 #define HAS_MORE_DATA(x)       ((x) & FLAG_MORE_DATA)
318 #define IS_PROTECTED(x)        ((x) & FLAG_PROTECTED)
319 #define IS_STRICTLY_ORDERED(x) ((x) & FLAG_ORDER)
320
321 /*
322  * Extract subfields from the flags field.
323  */
324 #define FLAGS_DS_STATUS(x)          ((x) & (FLAG_FROM_DS|FLAG_TO_DS))
325
326 /*
327  * Extract an indication of the types of addresses in a data frame from
328  * the frame control field.
329  */
330 #define FCF_ADDR_SELECTOR(x) ((x) & ((FLAG_TO_DS|FLAG_FROM_DS) << 8))
331
332 #define DATA_ADDR_T1         0
333 #define DATA_ADDR_T2         (FLAG_FROM_DS << 8)
334 #define DATA_ADDR_T3         (FLAG_TO_DS << 8)
335 #define DATA_ADDR_T4         ((FLAG_TO_DS|FLAG_FROM_DS) << 8)
336
337 /*
338  * Extract the fragment number and sequence number from the sequence
339  * control field.
340  */
341 #define SEQCTL_FRAGMENT_NUMBER(x) ((x) & 0x000F)
342 #define SEQCTL_SEQUENCE_NUMBER(x) (((x) & 0xFFF0) >> 4)
343
344 /*
345  * Extract subfields from the QoS control field.
346  */
347 #define QOS_TID(x)            ((x) & 0x000F)
348 #define QOS_PRIORITY(x)       ((x) & 0x0007)
349 #define QOS_EOSP(x)           (((x) & 0x0010) >> 4) /* end of service period */
350 #define QOS_ACK_POLICY(x)     (((x) & 0x0060) >> 5)
351 #define QOS_AMSDU_PRESENT(x)  (((x) & 0x0080) >> 6)
352 #define QOS_FIELD_CONTENT(x)  (((x) & 0xFF00) >> 8)
353 #define QOS_MESH_CONTROL_PRESENT(x) (((x) & 0x0100) >> 8)
354
355 #define QOS_FLAG_EOSP    0x0010
356
357 /*
358  * Extract subfields from the result of QOS_FIELD_CONTENT().
359  */
360 #define QOS_PS_BUF_STATE_INDICATED(x)  (((x) & 0x02) >> 1)
361 #define QOS_PS_HIGHEST_PRI_BUF_AC(x)   (((x) & 0x0C) >> 2)
362 #define QOS_PS_QAP_BUF_LOAD(x)         (((x) & 0xF0) >> 4)
363
364 /*
365  * Extract subfields from the HT Control field.
366  * .11n D-1.10 & D-2.0, 7.1.3.5a, 32 bits.
367  */
368 #define HTC_LAC(htc)           ((htc) & 0xFF)
369 #define HTC_LAC_MAI(htc)       (((htc) >> 2) & 0xF)
370 #define HTC_IS_ASELI(htc)      (HTC_LAC_MAI(htc) == 0xE)
371 #define HTC_LAC_MAI_MRQ(htc)   ((HTC_LAC_MAI(htc))  & 0x1)
372 #define HTC_LAC_MAI_MSI(htc)   ((HTC_LAC_MAI(htc) >> 1) & 0x7)
373 #define HTC_LAC_MFSI(htc)      (((htc) >> 4) & 0x7)
374 #define HTC_LAC_ASEL_CMD(htc)  (((htc) >> 9) & 0x7)
375 #define HTC_LAC_ASEL_DATA(htc) (((htc) >> 12) & 0xF)
376 #define HTC_LAC_MFB(htc)       (((htc) >> 9) & 0x7F)
377 #define HTC_CAL_POS(htc)       (((htc) >> 16) & 0x3)
378 #define HTC_CAL_SEQ(htc)       (((htc) >> 18) & 0x3)
379 #define HTC_CSI_STEERING(htc)  (((htc) >> 22) & 0x3)
380 #define HTC_NDP_ANN(htc)       (((htc) >> 24) & 0x1)
381 #define HTC_AC_CONSTRAINT(htc) (((htc) >> 30) & 0x1)
382 #define HTC_RDG_MORE_PPDU(htc) (((htc) >> 31) & 0x1)
383
384 /*
385  * Extract subfields from the key octet in WEP-encrypted frames.
386  */
387 #define KEY_OCTET_WEP_KEY(x)   (((x) & 0xC0) >> 6)
388
389 #define KEY_EXTIV    0x20
390 #define EXTIV_LEN    8
391
392 /*
393  * Bits from the Mesh Flags field
394  */
395 #define MESH_FLAGS_ADDRESS_EXTENSION  0x3
396
397 /* ************************************************************************* */
398 /*              Constants used to identify cooked frame types                */
399 /* ************************************************************************* */
400 #define MGT_FRAME            0x00  /* Frame type is management */
401 #define CONTROL_FRAME        0x01  /* Frame type is control */
402 #define DATA_FRAME           0x02  /* Frame type is Data */
403
404 #define DATA_SHORT_HDR_LEN     24
405 #define DATA_LONG_HDR_LEN      30
406 #define MGT_FRAME_HDR_LEN      24  /* Length of Management frame-headers */
407
408 /*
409  * COMPOSE_FRAME_TYPE() values for management frames.
410  */
411 #define MGT_ASSOC_REQ          0x00  /* association request        */
412 #define MGT_ASSOC_RESP         0x01  /* association response       */
413 #define MGT_REASSOC_REQ        0x02  /* reassociation request      */
414 #define MGT_REASSOC_RESP       0x03  /* reassociation response     */
415 #define MGT_PROBE_REQ          0x04  /* Probe request              */
416 #define MGT_PROBE_RESP         0x05  /* Probe response             */
417 #define MGT_MEASUREMENT_PILOT  0x06  /* Measurement Pilot          */
418 #define MGT_BEACON             0x08  /* Beacon frame               */
419 #define MGT_ATIM               0x09  /* ATIM                       */
420 #define MGT_DISASS             0x0A  /* Disassociation             */
421 #define MGT_AUTHENTICATION     0x0B  /* Authentication             */
422 #define MGT_DEAUTHENTICATION   0x0C  /* Deauthentication           */
423 #define MGT_ACTION             0x0D  /* Action                     */
424 #define MGT_ACTION_NO_ACK      0x0E  /* Action No Ack              */
425 #define MGT_ARUBA_WLAN         0x0F  /* Aruba WLAN Specific        */
426
427 /*
428  * COMPOSE_FRAME_TYPE() values for control frames.
429  */
430 #define CTRL_CONTROL_WRAPPER 0x17  /* Control Wrapper        */
431 #define CTRL_BLOCK_ACK_REQ   0x18  /* Block ack Request        */
432 #define CTRL_BLOCK_ACK       0x19  /* Block ack          */
433 #define CTRL_PS_POLL         0x1A  /* power-save poll               */
434 #define CTRL_RTS             0x1B  /* request to send               */
435 #define CTRL_CTS             0x1C  /* clear to send                 */
436 #define CTRL_ACKNOWLEDGEMENT 0x1D  /* acknowledgement               */
437 #define CTRL_CFP_END         0x1E  /* contention-free period end    */
438 #define CTRL_CFP_ENDACK      0x1F  /* contention-free period end/ack */
439
440 /*
441  * COMPOSE_FRAME_TYPE() values for data frames.
442  */
443 #define DATA                        0x20  /* Data                       */
444 #define DATA_CF_ACK                 0x21  /* Data + CF-Ack              */
445 #define DATA_CF_POLL                0x22  /* Data + CF-Poll             */
446 #define DATA_CF_ACK_POLL            0x23  /* Data + CF-Ack + CF-Poll    */
447 #define DATA_NULL_FUNCTION          0x24  /* Null function (no data)    */
448 #define DATA_CF_ACK_NOD             0x25  /* CF-Ack (no data)           */
449 #define DATA_CF_POLL_NOD            0x26  /* CF-Poll (No data)          */
450 #define DATA_CF_ACK_POLL_NOD        0x27  /* CF-Ack + CF-Poll (no data) */
451
452 #define DATA_QOS_DATA               0x28  /* QoS Data                   */
453 #define DATA_QOS_DATA_CF_ACK        0x29  /* QoS Data + CF-Ack        */
454 #define DATA_QOS_DATA_CF_POLL       0x2A  /* QoS Data + CF-Poll      */
455 #define DATA_QOS_DATA_CF_ACK_POLL   0x2B  /* QoS Data + CF-Ack + CF-Poll    */
456 #define DATA_QOS_NULL               0x2C  /* QoS Null        */
457 #define DATA_QOS_CF_POLL_NOD        0x2E  /* QoS CF-Poll (No Data)      */
458 #define DATA_QOS_CF_ACK_POLL_NOD    0x2F  /* QoS CF-Ack + CF-Poll (No Data) */
459
460
461 /* ************************************************************************* */
462 /*        Logical field codes (dissector's encoding of fixed fields)         */
463 /* ************************************************************************* */
464 enum fixed_field {
465   FIELD_TIMESTAMP,                            /* 64-bit timestamp */
466   FIELD_BEACON_INTERVAL,                      /* 16-bit beacon interval */
467   FIELD_CAP_INFO,                             /* Add capability information tree */
468   FIELD_AUTH_ALG,                             /* Authentication algorithm used */
469   FIELD_AUTH_TRANS_SEQ,                       /* Authentication sequence number */
470   FIELD_CURRENT_AP_ADDR,
471   FIELD_LISTEN_IVAL,
472   FIELD_REASON_CODE,
473   FIELD_ASSOC_ID,
474   FIELD_STATUS_CODE,
475   FIELD_CATEGORY_CODE,                        /* Management action category */
476   FIELD_ACTION_CODE,                          /* Management action code */
477   FIELD_DIALOG_TOKEN,                         /* Management action dialog token */
478   FIELD_WME_ACTION_CODE,                      /* Management notification action code */
479   FIELD_WME_DIALOG_TOKEN,                     /* Management notification dialog token */
480   FIELD_WME_STATUS_CODE,                      /* Management notification setup response status code */
481   FIELD_QOS_ACTION_CODE,
482   FIELD_QOS_TS_INFO,
483   FIELD_DLS_ACTION_CODE,
484   FIELD_DST_MAC_ADDR,                         /* DLS destination MAC address */
485   FIELD_SRC_MAC_ADDR,                         /* DLS source MAC address */
486   FIELD_DLS_TIMEOUT,                          /* DLS timeout value */
487   FIELD_SCHEDULE_INFO,                        /* Schedule Info field */
488   FIELD_ACTION,                               /* Action field */
489   FIELD_BLOCK_ACK_ACTION_CODE,
490   FIELD_QOS_INFO_AP,
491   FIELD_QOS_INFO_STA,
492   FIELD_BLOCK_ACK_PARAM,
493   FIELD_BLOCK_ACK_TIMEOUT,
494   FIELD_BLOCK_ACK_SSC,
495   FIELD_DELBA_PARAM_SET,
496   FIELD_MAX_REG_PWR,
497   FIELD_MEASUREMENT_PILOT_INT,
498   FIELD_COUNTRY_STR,
499   FIELD_MAX_TX_PWR,
500   FIELD_TX_PWR_USED,
501   FIELD_TRANSCEIVER_NOISE_FLOOR,
502   FIELD_DS_PARAM_SET,
503   FIELD_CHANNEL_WIDTH,
504   FIELD_SM_PWR_CNTRL,
505   FIELD_PCO_PHASE_CNTRL,
506   FIELD_PSMP_PARAM_SET,
507   FIELD_PSMP_STA_INFO,
508   FIELD_MIMO_CNTRL,
509   FIELD_ANT_SELECTION,
510   FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT,
511   FIELD_HT_INFORMATION,
512   FIELD_HT_ACTION_CODE,
513   FIELD_PA_ACTION_CODE,
514   FIELD_FT_ACTION_CODE,
515   FIELD_STA_ADDRESS,
516   FIELD_TARGET_AP_ADDRESS,
517   FIELD_GAS_COMEBACK_DELAY,
518   FIELD_GAS_FRAGMENT_ID,
519   FIELD_SA_QUERY_ACTION_CODE,
520   FIELD_TRANSACTION_ID,
521   FIELD_TDLS_ACTION_CODE,
522   FIELD_TARGET_CHANNEL,
523   FIELD_REGULATORY_CLASS,
524   FIELD_MESH_ACTION,
525   FIELD_MULTIHOP_ACTION,
526   FIELD_MESH_CONTROL,
527   FIELD_SELFPROT_ACTION,
528   FIELD_WNM_ACTION_CODE,
529   FIELD_KEY_DATA_LENGTH,
530   FIELD_WNM_NOTIFICATION_TYPE,
531                                               /* add any new fixed field value above this line */
532   MAX_FIELD_NUM
533 };
534
535 /* ************************************************************************* */
536 /*        Logical field codes (IEEE 802.11 encoding of tags)                 */
537 /* ************************************************************************* */
538 #define TAG_SSID                       0
539 #define TAG_SUPP_RATES                 1
540 #define TAG_FH_PARAMETER               2
541 #define TAG_DS_PARAMETER               3
542 #define TAG_CF_PARAMETER               4
543 #define TAG_TIM                        5
544 #define TAG_IBSS_PARAMETER             6
545 #define TAG_COUNTRY_INFO               7
546 #define TAG_FH_HOPPING_PARAMETER       8
547 #define TAG_FH_HOPPING_TABLE           9
548 #define TAG_REQUEST                   10
549 #define TAG_QBSS_LOAD                 11
550 #define TAG_EDCA_PARAM_SET            12
551 #define TAG_TSPEC                     13
552 #define TAG_TCLAS                     14
553 #define TAG_SCHEDULE                  15
554 #define TAG_CHALLENGE_TEXT            16
555
556 #define TAG_POWER_CONSTRAINT          32
557 #define TAG_POWER_CAPABILITY          33
558 #define TAG_TPC_REQUEST               34
559 #define TAG_TPC_REPORT                35
560 #define TAG_SUPPORTED_CHANNELS        36
561 #define TAG_CHANNEL_SWITCH_ANN        37
562 #define TAG_MEASURE_REQ               38
563 #define TAG_MEASURE_REP               39
564 #define TAG_QUIET                     40
565 #define TAG_IBSS_DFS                  41
566 #define TAG_ERP_INFO                  42
567 #define TAG_TS_DELAY                  43
568 #define TAG_TCLAS_PROCESS             44
569 #define TAG_HT_CAPABILITY             45 /* IEEE Stc 802.11n/D2.0 */
570 #define TAG_QOS_CAPABILITY            46
571 #define TAG_ERP_INFO_OLD              47 /* IEEE Std 802.11g/D4.0 */
572 #define TAG_RSN_IE                    48
573 /* Reserved 49 */
574 #define TAG_EXT_SUPP_RATES            50
575 #define TAG_AP_CHANNEL_REPORT         51
576 #define TAG_NEIGHBOR_REPORT           52
577 #define TAG_RCPI                      53
578 #define TAG_MOBILITY_DOMAIN           54  /* IEEE Std 802.11r-2008 */
579 #define TAG_FAST_BSS_TRANSITION       55  /* IEEE Std 802.11r-2008 */
580 #define TAG_TIMEOUT_INTERVAL          56  /* IEEE Std 802.11r-2008 */
581 #define TAG_RIC_DATA                  57  /* IEEE Std 802.11r-2008 */
582 #define TAG_DSE_REG_LOCATION          58
583 #define TAG_SUPPORTED_REGULATORY_CLASSES            59 /* IEEE Std 802.11w-2009 */
584 #define TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT    60 /* IEEE Std 802.11w-2009 */
585 #define TAG_HT_INFO                   61  /* IEEE Stc 802.11n/D2.0 */
586 #define TAG_SECONDARY_CHANNEL_OFFSET  62  /* IEEE Stc 802.11n/D1.10/D2.0 */
587 #define TAG_BSS_AVG_ACCESS_DELAY      63
588 #define TAG_ANTENNA                   64
589 #define TAG_RSNI                      65
590 #define TAG_MEASURE_PILOT_TRANS       66
591 #define TAG_BSS_AVB_ADM_CAPACITY      67
592 #define TAG_IE_68_CONFLICT            68  /* Conflict: WAPI Vs. IEEE */
593 #define TAG_WAPI_PARAM_SET            68
594 #define TAG_BSS_AC_ACCESS_DELAY       68
595 #define TAG_TIME_ADV                  69  /* IEEE Std 802.11p-2010 */
596 #define TAG_RM_ENABLED_CAPABILITY     70
597 #define TAG_MULTIPLE_BSSID            71
598 #define TAG_20_40_BSS_CO_EX           72  /* IEEE P802.11n/D6.0 */
599 #define TAG_20_40_BSS_INTOL_CH_REP    73  /* IEEE P802.11n/D6.0 */
600 #define TAG_OVERLAP_BSS_SCAN_PAR      74  /* IEEE P802.11n/D6.0 */
601 #define TAG_RIC_DESCRIPTOR            75  /* IEEE Std 802.11r-2008 */
602 #define TAG_MMIE                      76  /* IEEE Std 802.11w-2009 */
603 #define TAG_EVENT_REQUEST             78
604 #define TAG_EVENT_REPORT              79
605 #define TAG_DIAGNOSTIC_REQUEST        80
606 #define TAG_DIAGNOSTIC_REPORT         81
607 #define TAG_LOCATION_PARAMETERS       82
608 #define TAG_NO_BSSID_CAPABILITY       83
609 #define TAG_SSID_LIST                 84
610 #define TAG_MULTIPLE_BSSID_INDEX      85
611 #define TAG_FMS_DESCRIPTOR            86
612 #define TAG_FMS_REQUEST               87
613 #define TAG_FMS_RESPONSE              88
614 #define TAG_QOS_TRAFFIC_CAPABILITY    89
615 #define TAG_BSS_MAX_IDLE_PERIOD       90
616 #define TAG_TFS_REQUEST               91
617 #define TAG_TFS_RESPONSE              92
618 #define TAG_WNM_SLEEP_MODE            93
619 #define TAG_TIM_BROADCAST_REQUEST     94
620 #define TAG_TIM_BROADCAST_RESPONSE    95
621 #define TAG_COLLOCATED_INTER_REPORT   96
622 #define TAG_CHANNEL_USAGE             97
623 #define TAG_TIME_ZONE                 98  /* IEEE Std 802.11v-2011 */
624 #define TAG_DMS_REQUEST               99
625 #define TAG_DMS_RESPONSE             100
626 #define TAG_LINK_IDENTIFIER          101  /* IEEE Std 802.11z-2010 */
627 #define TAG_WAKEUP_SCHEDULE          102  /* IEEE Std 802.11z-2010 */
628 #define TAG_CHANNEL_SWITCH_TIMING    104  /* IEEE Std 802.11z-2010 */
629 #define TAG_PTI_CONTROL              105  /* IEEE Std 802.11z-2010 */
630 #define TAG_PU_BUFFER_STATUS         106  /* IEEE Std 802.11z-2010 */
631 #define TAG_INTERWORKING             107  /* IEEE Std 802.11u-2011 */
632 #define TAG_ADVERTISEMENT_PROTOCOL   108  /* IEEE Std 802.11u-2011 */
633 #define TAG_EXPIDITED_BANDWIDTH_REQ  109  /* IEEE Std 802.11u-2011 */
634 #define TAG_QOS_MAP_SET              110  /* IEEE Std 802.11u-2011 */
635 #define TAG_ROAMING_CONSORTIUM       111  /* IEEE Std 802.11u-2011 */
636 #define TAG_EMERGENCY_ALERT_ID       112  /* IEEE Std 802.11u-2011 */
637 #define TAG_MESH_CONFIGURATION       113  /* IEEE Std 802.11s-2011 */
638 #define TAG_MESH_ID                  114  /* IEEE Std 802.11s-2011 */
639 #define TAG_MESH_LINK_METRIC_REPORT  115
640 #define TAG_CONGESTION_NOTIFICATION  116
641 #define TAG_MESH_PEERING_MGMT        117  /* IEEE Std 802.11s-2011 */
642 #define TAG_MESH_CHANNEL_SWITCH      118
643 #define TAG_MESH_AWAKE_WINDOW        119
644 #define TAG_BEACON_TIMING            120
645 #define TAG_MCCAOP_SETUP_REQUEST     121
646 #define TAG_MCCAOP_SETUP_REPLY       122
647 #define TAG_MCCAOP_ADVERTISSEMENT    123
648 #define TAG_MCCAOP_TEARDOWN          124
649 #define TAG_GANN                     125
650 #define TAG_RANN                     126  /* IEEE Std 802.11s-2011 */
651 #define TAG_EXTENDED_CAPABILITIES    127  /* IEEE Stc 802.11n/D1.10/D2.0 */
652 #define TAG_AGERE_PROPRIETARY        128
653 #define TAG_MESH_PREQ                130  /* IEEE Std 802.11s-2011 */
654 #define TAG_MESH_PREP                131  /* IEEE Std 802.11s-2011 */
655 #define TAG_MESH_PERR                132  /* IEEE Std 802.11s-2011 */
656 #define TAG_CISCO_CCX1_CKIP          133  /* Cisco Compatible eXtensions v1 */
657 #define TAG_CISCO_CCX2               136  /* Cisco Compatible eXtensions v2 */
658 #define TAG_PXU                      137
659 #define TAG_PXUC                     138
660 #define TAG_AUTH_MESH_PEERING_EXCH   139
661 #define TAG_MIC                      140
662 #define TAG_DESTINATION_URI          141
663 #define TAG_U_APSD_COEX              142
664 #define TAG_CISCO_CCX3               149  /* Cisco Compatible eXtensions v3 */
665 #define TAG_CISCO_UNKNOWN_96         150  /* Cisco Compatible eXtensions */
666 #define TAG_SYMBOL_PROPRIETARY       173
667 #define TAG_MCCAOP_ADVERTISSEMENT_OV 174
668 #define TAG_VHT_CAPABILITY           191  /* IEEE Stc 802.11ac/D3.1 */
669 #define TAG_VHT_OPERATION            192  /* IEEE Stc 802.11ac/D3.1 */
670 #define TAG_VENDOR_SPECIFIC_IE       221
671
672 static const value_string tag_num_vals[] = {
673   { TAG_SSID,                                 "SSID parameter set" },
674   { TAG_SUPP_RATES,                           "Supported Rates" },
675   { TAG_FH_PARAMETER,                         "FH Parameter set" },
676   { TAG_DS_PARAMETER,                         "DS Parameter set" },
677   { TAG_CF_PARAMETER,                         "CF Parameter set" },
678   { TAG_TIM,                                  "Traffic Indication Map (TIM)" },
679   { TAG_IBSS_PARAMETER,                       "IBSS Parameter set" },
680   { TAG_COUNTRY_INFO,                         "Country Information" },
681   { TAG_FH_HOPPING_PARAMETER,                 "Hopping Pattern Parameters" },
682   { TAG_FH_HOPPING_TABLE,                     "Hopping Pattern Table" },
683   { TAG_REQUEST,                              "Request" },
684   { TAG_QBSS_LOAD,                            "QBSS Load Element" },
685   { TAG_EDCA_PARAM_SET,                       "EDCA Parameter Set" },
686   { TAG_TSPEC,                                "Traffic Specification" },
687   { TAG_TCLAS,                                "Traffic Classification" },
688   { TAG_SCHEDULE,                             "Schedule" },
689   { TAG_CHALLENGE_TEXT,                       "Challenge text" },
690   { TAG_POWER_CONSTRAINT,                     "Power Constraint" },
691   { TAG_POWER_CAPABILITY,                     "Power Capability" },
692   { TAG_TPC_REQUEST,                          "TPC Request" },
693   { TAG_TPC_REPORT,                           "TPC Report" },
694   { TAG_SUPPORTED_CHANNELS,                   "Supported Channels" },
695   { TAG_CHANNEL_SWITCH_ANN,                   "Channel Switch Announcement" },
696   { TAG_MEASURE_REQ,                          "Measurement Request" },
697   { TAG_MEASURE_REP,                          "Measurement Report" },
698   { TAG_QUIET,                                "Quiet" },
699   { TAG_IBSS_DFS,                             "IBSS DFS" },
700   { TAG_ERP_INFO,                             "ERP Information" },
701   { TAG_TS_DELAY,                             "TS Delay" },
702   { TAG_TCLAS_PROCESS,                        "TCLAS Processing" },
703   { TAG_HT_CAPABILITY,                        "HT Capabilities (802.11n D1.10)" },
704   { TAG_QOS_CAPABILITY,                       "QoS Capability" },
705   { TAG_ERP_INFO_OLD,                         "ERP Information" }, /* Reserved... */
706   { TAG_RSN_IE,                               "RSN Information" },
707   { TAG_EXT_SUPP_RATES,                       "Extended Supported Rates" },
708   { TAG_AP_CHANNEL_REPORT,                    "AP Channel Report" },
709   { TAG_NEIGHBOR_REPORT,                      "Neighbor Report" },
710   { TAG_RCPI,                                 "RCPI" },
711   { TAG_MOBILITY_DOMAIN,                      "Mobility Domain" },
712   { TAG_FAST_BSS_TRANSITION,                  "Fast BSS Transition" },
713   { TAG_TIMEOUT_INTERVAL,                     "Timeout Interval" },
714   { TAG_RIC_DATA,                             "RIC Data" },
715   { TAG_DSE_REG_LOCATION,                     "DSE Registered Location" },
716   { TAG_SUPPORTED_REGULATORY_CLASSES,         "Supported Regulatory Classes" },
717   { TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement" },
718   { TAG_HT_INFO,                              "HT Information (802.11n D1.10)" },
719   { TAG_SECONDARY_CHANNEL_OFFSET,             "Secondary Channel Offset (802.11n D1.10)" },
720   { TAG_BSS_AVG_ACCESS_DELAY,                 "BSS Average Access Delay" },
721   { TAG_ANTENNA,                              "Antenna" },
722   { TAG_RSNI,                                 "RSNI" },
723   { TAG_MEASURE_PILOT_TRANS,                  "Measurement Pilot Transmission" },
724   { TAG_BSS_AVB_ADM_CAPACITY,                 "BSS Available Admission Capacity" },
725   { TAG_IE_68_CONFLICT,                       "BSS AC Access Delay/WAPI Parameter Set" },
726   { TAG_TIME_ADV,                             "Time Advertisement" },
727   { TAG_RM_ENABLED_CAPABILITY,                "RM Enabled Capabilities" },
728   { TAG_MULTIPLE_BSSID,                       "Multiple BSSID" },
729   { TAG_20_40_BSS_CO_EX,                      "20/40 BSS Coexistence" },
730   { TAG_20_40_BSS_INTOL_CH_REP,               "20/40 BSS Intolerant Channel Report" },   /* IEEE P802.11n/D6.0 */
731   { TAG_OVERLAP_BSS_SCAN_PAR,                 "Overlapping BSS Scan Parameters" },       /* IEEE P802.11n/D6.0 */
732   { TAG_RIC_DESCRIPTOR,                       "RIC Descriptor" },
733   { TAG_MMIE,                                 "Management MIC" },
734   { TAG_EVENT_REQUEST,                        "Event Request" },
735   { TAG_EVENT_REPORT,                         "Event Report" },
736   { TAG_DIAGNOSTIC_REQUEST,                   "Diagnostic Request" },
737   { TAG_DIAGNOSTIC_REPORT,                    "Diagnostic Report" },
738   { TAG_LOCATION_PARAMETERS,                  "Location Parameters" },
739   { TAG_NO_BSSID_CAPABILITY,                  "Non Transmitted BSSID Capability" },
740   { TAG_SSID_LIST,                            "SSID List" },
741   { TAG_MULTIPLE_BSSID_INDEX,                 "Multiple BSSID Index" },
742   { TAG_FMS_DESCRIPTOR,                       "FMS Descriptor" },
743   { TAG_FMS_REQUEST,                          "FMS Request" },
744   { TAG_FMS_RESPONSE,                         "FMS Response" },
745   { TAG_QOS_TRAFFIC_CAPABILITY,               "QoS Traffic Capability" },
746   { TAG_BSS_MAX_IDLE_PERIOD,                  "BSS Max Idle Period" },
747   { TAG_TFS_REQUEST,                          "TFS Request" },
748   { TAG_TFS_RESPONSE,                         "TFS Response" },
749   { TAG_WNM_SLEEP_MODE,                       "WNM-Sleep Mode" },
750   { TAG_TIM_BROADCAST_REQUEST,                "TIM Broadcast Request" },
751   { TAG_TIM_BROADCAST_RESPONSE,               "TIM Broadcast Response" },
752   { TAG_COLLOCATED_INTER_REPORT,              "Collocated Interference Report" },
753   { TAG_CHANNEL_USAGE,                        "Channel Usage" },
754   { TAG_TIME_ZONE,                            "Time Zone" },
755   { TAG_DMS_REQUEST,                          "DMS Request" },
756   { TAG_DMS_RESPONSE,                         "DMS Response" },
757   { TAG_LINK_IDENTIFIER,                      "Link Identifier" },
758   { TAG_WAKEUP_SCHEDULE,                      "Wakeup Schedule" },
759   { TAG_CHANNEL_SWITCH_TIMING,                "Channel Switch Timing" },
760   { TAG_PTI_CONTROL,                          "PTI Control" },
761   { TAG_PU_BUFFER_STATUS,                     "PU Buffer Status" },
762   { TAG_INTERWORKING,                         "Interworking" },
763   { TAG_ADVERTISEMENT_PROTOCOL,               "Advertisement Protocol"},
764   { TAG_EXPIDITED_BANDWIDTH_REQ,              "Expedited Bandwidth Request" },
765   { TAG_QOS_MAP_SET,                          "QoS Map Set" },
766   { TAG_ROAMING_CONSORTIUM,                   "Roaming Consortium" },
767   { TAG_EMERGENCY_ALERT_ID,                   "Emergency Alert Identifier" },
768   { TAG_MESH_CONFIGURATION,                   "Mesh Configuration" },
769   { TAG_MESH_ID,                              "Mesh ID" },
770   { TAG_MESH_LINK_METRIC_REPORT,              "Mesh Link Metric Report" },
771   { TAG_CONGESTION_NOTIFICATION,              "Congestion Notification" },
772   { TAG_MESH_PEERING_MGMT,                    "Mesh Peering Management" },
773   { TAG_MESH_CHANNEL_SWITCH,                  "Mesh Channel Switch Parameters" },
774   { TAG_MESH_AWAKE_WINDOW,                    "Mesh Awake Windows" },
775   { TAG_BEACON_TIMING,                        "Beacon Timing" },
776   { TAG_MCCAOP_SETUP_REQUEST,                 "MCCAOP Setup Request" },
777   { TAG_MCCAOP_SETUP_REPLY,                   "MCCAOP SETUP Reply" },
778   { TAG_MCCAOP_ADVERTISSEMENT,                "MCCAOP Advertissement" },
779   { TAG_MCCAOP_TEARDOWN,                      "MCCAOP Teardown" },
780   { TAG_GANN,                                 "Gate Announcemen" },
781   { TAG_RANN,                                 "Root Announcement" },
782   { TAG_EXTENDED_CAPABILITIES,                "Extended Capabilities" },
783   { TAG_AGERE_PROPRIETARY,                    "Agere Proprietary" },
784   { TAG_MESH_PREQ,                            "Path Request" },
785   { TAG_MESH_PREP,                            "Path Reply" },
786   { TAG_MESH_PERR,                            "Path Error" },
787   { TAG_CISCO_CCX1_CKIP,                      "Cisco CCX1 CKIP + Device Name" },
788   { TAG_CISCO_CCX2,                           "Cisco CCX2" },
789   { TAG_PXU,                                  "Proxy Update" },
790   { TAG_PXUC,                                 "Proxy Update Confirmation"},
791   { TAG_AUTH_MESH_PEERING_EXCH,               "Auhenticated Mesh Perring Exchange" },
792   { TAG_MIC,                                  "MIC (Message Integrity Code)" },
793   { TAG_DESTINATION_URI,                      "Destination URI" },
794   { TAG_U_APSD_COEX,                          "U-APSD Coexistence" },
795   { TAG_CISCO_CCX3,                           "Cisco Unknown 95" },
796   { TAG_CISCO_UNKNOWN_96,                     "Cisco Unknown 96" },
797   { TAG_SYMBOL_PROPRIETARY,                   "Symbol Proprietary" },
798   { TAG_MCCAOP_ADVERTISSEMENT_OV,             "MCCAOP Advertissement Overviw" },
799   { TAG_VHT_CAPABILITY,                       "VHT Capabilities (IEEE Stc 802.11ac/D3.1)" },
800   { TAG_VHT_OPERATION,                        "VHT Operation (IEEE Stc 802.11ac/D3.1)" },
801   { TAG_VENDOR_SPECIFIC_IE,                   "Vendor Specific" },
802   { 0, NULL }
803 };
804 static value_string_ext tag_num_vals_ext = VALUE_STRING_EXT_INIT(tag_num_vals);
805
806 /* WFA vendor specific subtypes */
807 #define WFA_SUBTYPE_P2P 9
808 #define WFA_SUBTYPE_HS20_INDICATION 16
809 #define WFA_SUBTYPE_HS20_ANQP 17
810
811 static const value_string wfa_subtype_vals[] = {
812   { WFA_SUBTYPE_P2P, "P2P" },
813   { WFA_SUBTYPE_HS20_INDICATION, "Hotspot 2.0 Indication" },
814   { WFA_SUBTYPE_HS20_ANQP, "Hotspot 2.0 ANQP" },
815   { 0, NULL }
816 };
817
818 /* ************************************************************************* */
819 /*              Supported Rates (7.3.2.2)                                    */
820 /* ************************************************************************* */
821
822 static const value_string ieee80211_supported_rates_vals[] = {
823   { 0x02, "1" },
824   { 0x03, "1.5" },
825   { 0x04, "2" },
826   { 0x05, "2.5" },
827   { 0x06, "3" },
828   { 0x09, "4.5" },
829   { 0x0B, "5.5" },
830   { 0x0C, "6" },
831   { 0x12, "9" },
832   { 0x16, "11" },
833   { 0x18, "12" },
834   { 0x1B, "13.5" },
835   { 0x24, "18" },
836   { 0x2C, "22" },
837   { 0x30, "24" },
838   { 0x36, "27" },
839   { 0x42, "33" },
840   { 0x48, "36" },
841   { 0x60, "48" },
842   { 0x6C, "54" },
843   { 0x82, "1(B)" },
844   { 0x83, "1.5(B)" },
845   { 0x84, "2(B)" },
846   { 0x85, "2.5(B)" },
847   { 0x86, "3(B)" },
848   { 0x89, "4.5(B)" },
849   { 0x8B, "5.5(B)" },
850   { 0x8C, "6(B)" },
851   { 0x92, "9(B)" },
852   { 0x96, "11(B)" },
853   { 0x98, "12(B)" },
854   { 0x9B, "13.5(B)" },
855   { 0xA4, "18(B)" },
856   { 0xAC, "22(B)" },
857   { 0xB0, "24(B)" },
858   { 0xB6, "27(B)" },
859   { 0xC2, "33(B)" },
860   { 0xC8, "36(B)" },
861   { 0xE0, "48(B)" },
862   { 0xEC, "54(B)" },
863   { 0xFF, "BSS requires support for mandatory features of HT PHY (IEEE 802.11 - Clause 20)" },
864   { 0,    NULL}
865 };
866 static value_string_ext ieee80211_supported_rates_vals_ext = VALUE_STRING_EXT_INIT(ieee80211_supported_rates_vals);
867
868 /* ************************************************************************* */
869 /*                         8.4.1.7 Reason Code field                         */
870 /* ************************************************************************* */
871 static const value_string ieee80211_reason_code[] = {
872   {  1, "Unspecified reason" },
873   {  2, "Previous authentication no longer valid" },
874   {  3, "Deauthenticated because sending STA is leaving (or has left) IBSS or ESS" },
875   {  4, "Disassociated due to inactivity" },
876   {  5, "Disassociated because AP is unable to handle all currently associated STAs" },
877   {  6, "Class 2 frame received from nonauthenticated STA" },
878   {  7, "Class 3 frame received from nonassociated STA" },
879   {  8, "Disassociated because sending STA is leaving (or has left) BSS" },
880   {  9, "STA requesting (re)association is not authenticated with responding STA" },
881   { 10, "Disassociated because the information in the Power Capability element is unacceptable" },
882   { 11, "Disassociated because the information in the Supported Channels element is unacceptable" },
883   { 12, "Reserved" },
884   { 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" },
885   { 14, "Message integrity code (MIC) failure" },
886   { 15, "4-Way Handshake timeout" },
887   { 16, "Group Key Handshake timeout" },
888   { 17, "Information element in 4-Way Handshake different from (Re)Association Request/Probe Response/Beacon frame" },
889   { 18, "Invalid group cipher" },
890   { 19, "Invalid pairwise cipher" },
891   { 20, "Invalid AKMP" },
892   { 21, "Unsupported RSN information element version" },
893   { 22, "Invalid RSN information element capabilities" },
894   { 23, "IEEE 802.1X authentication failed" },
895   { 24, "Cipher suite rejected because of the security policy" },
896   { 25, "TDLS direct-link teardown due to TDLS peer STA unreachable via the TDLS direct link" },
897   { 26, "TDLS direct-link teardown for unspecified reason" },
898   { 27, "Disassociated because session terminated by SSP request" },
899   { 28, "Disassociated because of lack of SSP roaming agreement" },
900   { 29, "Requested service rejected because of SSP cipher suite or AKM requirement " },
901   { 30, "Requested service not authorized in this location" },
902   { 31, "TS deleted because QoS AP lacks sufficient bandwidth for this QoS STA due to a change in BSS service characteristics or operational mode" },
903   { 32, "Disassociated for unspecified, QoS-related reason" },
904   { 33, "Disassociated because QoS AP lacks sufficient bandwidth for this QoS STA" },
905   { 34, "Disassociated because excessive number of frames need to be acknowledged, but are not acknowledged due to AP transmissions and/or poor channel conditions" },
906   { 35, "Disassociated because STA is transmitting outside the limits of its TXOPs" },
907   { 36, "Requested from peer STA as the STA is leaving the BSS (or resetting)" },
908   { 37, "Requested from peer STA as it does not want to use the mechanism" },
909   { 38, "Requested from peer STA as the STA received frames using the mechanism for which a setup is required" },
910   { 39, "Requested from peer STA due to timeout" },
911   { 45, "Peer STA does not support the requested cipher suite" },
912   { 46, "Disassociated because authorized access limit reached" },
913   { 47, "Disassociated due to external service requirements" },
914   { 48, "Invalid FT Action frame count" },
915   { 49, "Invalid pairwise master key identifier (PMKI)" },
916   { 50, "Invalid MDE" },
917   { 51, "Invalid FTE" },
918   { 52, "SME cancels the mesh peering instance with the reason other than reaching the maximum number of peer mesh STAs" },
919   { 53, "The mesh STA has reached the supported maximum number of peer mesh STAs" },
920   { 54, "The received information violates the Mesh Configuration policy configured in the mesh STA profile" },
921   { 55, "The mesh STA has received a Mesh Peering Close message requesting to close the mesh peering" },
922   { 56, "The mesh STA has re-sent dot11MeshMaxRetries Mesh Peering Open messages, without receiving a Mesh Peering Confirm message" },
923   { 57, "The confirmTimer for the mesh peering instance times out" },
924   { 58, "The mesh STA fails to unwrap the GTK or the values in the wrapped contents do not match" },
925   { 59, "The mesh STA receives inconsistent information about the mesh parameters between Mesh Peering Management frames" },
926   { 60, "The mesh STA fails the authenticated mesh peering exchange because due to failure in selecting either the pairwise ciphersuite or group ciphersuite" },
927   { 61, "The mesh STA does not have proxy information for this external destination" },
928   { 62, "The mesh STA does not have forwarding information for this destination" },
929   { 63, "The mesh STA determines that the link to the next hop of an active path in its forwarding information is no longer usable" },
930   { 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)" },
931   { 65, "The mesh STA performs channel switch to meet regulatory requirements" },
932   { 66, "The mesh STA performs channel switch with unspecified reason" },
933   { 0,    NULL}
934 };
935 static value_string_ext ieee80211_reason_code_ext = VALUE_STRING_EXT_INIT(ieee80211_reason_code);
936
937 /* ************************************************************************* */
938 /*                         8.4.1.9 Status Code field                         */
939 /* ************************************************************************* */
940 static const value_string ieee80211_status_code[] = {
941   {  0, "Successful" },
942   {  1, "Unspecified failure" },
943   {  2, "TDLS wakeup schedule rejected but alternative schedule provided" },
944   {  3, "TDLS wakeup schedule rejected" },
945   {  4, "Reserved" },
946   {  5, "Security disabled" },
947   {  6, "Unacceptable lifetime" },
948   {  7, "Not in same BSS" },
949   {  8, "Reserved" },
950   {  9, "Reserved" },
951   { 10, "Cannot support all requested capabilities in the Capability Information field" },
952   { 11, "Reassociation denied due to inability to confirm that association exists" },
953   { 12, "Association denied due to reason outside the scope of this standard" },
954   { 13, "Responding STA does not support the specified authentication algorithm" },
955   { 14, "Received an Authentication frame with authentication transaction sequence number out of expected sequence" },
956   { 15, "Authentication rejected because of challenge failure" },
957   { 16, "Authentication rejected due to timeout waiting for next frame in sequence" },
958   { 17, "Association denied because AP is unable to handle additional associated STAs" },
959   { 18, "Association denied due to requesting STA not supporting all of the data rates in the BSSBasicRateSet parameter" },
960   { 19, "Association denied due to requesting STA not supporting the short preamble option" },
961   { 20, "Association denied due to requesting STA not supporting the PBCC modulation option" },
962   { 21, "Association denied due to requesting STA not supporting the Channel Agility option" },
963   { 22, "Association request rejected because Spectrum Management capability is required" },
964   { 23, "Association request rejected because the information in the Power Capability element is unacceptable" },
965   { 24, "Association request rejected because the information in the Supported Channels element is unacceptable" },
966   { 25, "Association denied due to requesting STA not supporting the Short Slot Time option" },
967   { 26, "Association denied due to requesting STA not supporting the DSSS-OFDM option" },
968   { 27, "Reserved Association denied because the requesting STA does not support HT features" },
969   { 28, "R0KH unreachable" },
970   { 29, "Association denied because the requesting STA does not support the phased coexistence operation (PCO) transition time required by the AP" },
971   { 30, "Association request rejected temporarily; try again later" },
972   { 31, "Robust Management frame policy violation" },
973   { 32, "Unspecified, QoS-related failure" },
974   { 33, "Association denied because QoS AP has insufficient bandwidth to handle another QoS STA" },
975   { 34, "Association denied due to excessive frame loss rates and/or poor conditions on current operating channel" },
976   { 35, "Association (with QoS BSS) denied because the requesting STA does not support the QoS facility" },
977   { 36, "Reserved" },
978   { 37, "The request has been declined" },
979   { 38, "The request has not been successful as one or more parameters have invalid values" },
980   { 39, "The TS has not been created because the request cannot be honored; however, a suggested TSPEC is provided so that the initiating STA may attempt to set another TS with the suggested changes to the TSPEC" },
981   { 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" },
982   { 41, "Invalid group cipher" },
983   { 42, "Invalid pairwise cipher" },
984   { 43, "Invalid AKMP" },
985   { 44, "Unsupported RSN information element version" },
986   { 45, "Invalid RSN information element capabilities" },
987   { 46, "Cipher suite rejected because of security policy" },
988   { 47, "The TS has not been created; however, the HC may be capable of creating a TS, in response to a request, after the time indicated in the TS Delay element" },
989   { 48, "Direct link is not allowed in the BSS by policy" },
990   { 49, "The Destination STA is not present within this BSS" },
991   { 50, "The Destination STA is not a QoS STA" },
992   { 51, "Association denied because the ListenInterval is too large" },
993   { 52, "Invalid FT Action frame count" },
994   { 53, "Invalid pairwise master key identifier (PMKID)" },
995   { 54, "Invalid MDIE" },
996   { 55, "Invalid FTIE" },
997   { 56, "Requested TCLAS processing is not supported by the AP" },
998   { 57, "The AP has insufficient TCLAS processing resources to satisfy the request" },
999   { 58, "The TS has not been created because the request cannot be honored; however, the HC suggests the STA transitions to other BSSs to setup the TS" },
1000   { 59, "GAS Advertisement Protocol not supported" },
1001   { 60, "No outstanding GAS request" },
1002   { 61, "GAS Response not received from the Advertisement Server" },
1003   { 62, "STA timed out waiting for GAS Query Response" },
1004   { 63, "GAS Response is larger than query response length limit" },
1005   { 64, "Request refused because home network does not support request" },
1006   { 65, "Advertisement Server in the network is not currently reachable" },
1007   { 66, "Reserved" },
1008   { 67, "Request refused due to permissions received via SSPN interface" },
1009   { 68, "Request refused because AP does not support unauthenticated access" },
1010   { 69, "Reserved" },
1011   { 70, "Reserved" },
1012   { 71, "Reserved" },
1013   { 72, "Invalid contents of RSNIE" },
1014   { 73, "U-APSD Coexistence is not supported" },
1015   { 74, "Requested U-APSD Coexistence mode is not supported" },
1016   { 75, "Requested Interval/Duration value cannot be supported with U-APSD Coexistence" },
1017   { 76, "Authentication is rejected because an Anti-Clogging Token is required" },
1018   { 77, "Authentication is rejected because the offered finite cyclic group is not supported" },
1019   { 78, "The TBTT adjustment request has not been successful because the STA could not find an alternative TBTT" },
1020   { 79, "Transmission failure" },
1021   { 80, "Requested TCLAS Not Supported" },
1022   { 81, "TCLAS Resources Exhausted" },
1023   { 82, "Rejected with Suggested BSS Transition" },
1024   { 83, "Reserved" },
1025   { 92, "(Re)association refused for some external reason" },
1026   { 93, "(Re)association refused because of memory limits at the AP" },
1027   { 94, "(Re)association refused because emergency services are not supported at the AP" },
1028   { 95, "GAS query response not yet received" },
1029   { 96, "Reserved" },
1030   { 97, "Reserved" },
1031   { 98, "Reserved" },
1032   { 99, "Reserved" },
1033   { 100, "The request failed due to a reservation conflict" },
1034   { 101, "The request failed due to exceeded MAF limit" },
1035   { 102, "The request failed due to exceeded MCCA track limit" },
1036   { 0,    NULL}
1037 };
1038 static value_string_ext ieee80211_status_code_ext = VALUE_STRING_EXT_INIT(ieee80211_status_code);
1039
1040 /* ************************************************************************* */
1041 /*                         Frame types, and their names                      */
1042 /* ************************************************************************* */
1043 static const value_string frame_type_subtype_vals[] = {
1044   {MGT_ASSOC_REQ,             "Association Request"},
1045   {MGT_ASSOC_RESP,            "Association Response"},
1046   {MGT_REASSOC_REQ,           "Reassociation Request"},
1047   {MGT_REASSOC_RESP,          "Reassociation Response"},
1048   {MGT_PROBE_REQ,             "Probe Request"},
1049   {MGT_PROBE_RESP,            "Probe Response"},
1050   {MGT_MEASUREMENT_PILOT,     "Measurement Pilot"},
1051   {MGT_BEACON,                "Beacon frame"},
1052   {MGT_ATIM,                  "ATIM"},
1053   {MGT_DISASS,                "Disassociate"},
1054   {MGT_AUTHENTICATION,        "Authentication"},
1055   {MGT_DEAUTHENTICATION,      "Deauthentication"},
1056   {MGT_ACTION,                "Action"},
1057   {MGT_ACTION_NO_ACK,         "Action No Ack"},
1058   {MGT_ARUBA_WLAN,            "Aruba Management"},
1059
1060   {CTRL_CONTROL_WRAPPER,      "Control Wrapper"},
1061   {CTRL_BLOCK_ACK_REQ,        "802.11 Block Ack Req"},
1062   {CTRL_BLOCK_ACK,            "802.11 Block Ack"},
1063   {CTRL_PS_POLL,              "Power-Save poll"},
1064   {CTRL_RTS,                  "Request-to-send"},
1065   {CTRL_CTS,                  "Clear-to-send"},
1066   {CTRL_ACKNOWLEDGEMENT,      "Acknowledgement"},
1067   {CTRL_CFP_END,              "CF-End (Control-frame)"},
1068   {CTRL_CFP_ENDACK,           "CF-End + CF-Ack (Control-frame)"},
1069
1070   {DATA,                      "Data"},
1071   {DATA_CF_ACK,               "Data + CF-Ack"},
1072   {DATA_CF_POLL,              "Data + CF-Poll"},
1073   {DATA_CF_ACK_POLL,          "Data + CF-Ack + CF-Poll"},
1074   {DATA_NULL_FUNCTION,        "Null function (No data)"},
1075   {DATA_CF_ACK_NOD,           "Acknowledgement (No data)"},
1076   {DATA_CF_POLL_NOD,          "CF-Poll (No data)"},
1077   {DATA_CF_ACK_POLL_NOD,      "CF-Ack/Poll (No data)"},
1078   {DATA_QOS_DATA,             "QoS Data"},
1079   {DATA_QOS_DATA_CF_ACK,      "QoS Data + CF-Acknowledgment"},
1080   {DATA_QOS_DATA_CF_POLL,     "QoS Data + CF-Poll"},
1081   {DATA_QOS_DATA_CF_ACK_POLL, "QoS Data + CF-Ack + CF-Poll"},
1082   {DATA_QOS_NULL,             "QoS Null function (No data)"},
1083   {DATA_QOS_CF_POLL_NOD,      "QoS CF-Poll (No Data)"},
1084   {DATA_QOS_CF_ACK_POLL_NOD,  "QoS CF-Ack + CF-Poll (No data)"},
1085   {0,                         NULL}
1086 };
1087 static value_string_ext frame_type_subtype_vals_ext = VALUE_STRING_EXT_INIT(frame_type_subtype_vals);
1088
1089 /* ************************************************************************* */
1090 /*                 802.1D Tag Name (by WME Access Category Names)            */
1091 /* ************************************************************************* */
1092 static const value_string ieee80211_qos_tags_acs[] = {
1093   { 0, "Best Effort (Best Effort)" },
1094   { 1, "Background (Background)" },
1095   { 2, "Spare (Background)" },
1096   { 3, "Excellent Effort (Best Effort)" },
1097   { 4, "Controlled Load (Video)" },
1098   { 5, "Video (Video)" },
1099   { 6, "Voice (Voice)" },
1100   { 7, "Netowrk Control (Voice)" },
1101   { 0, NULL }
1102 };
1103
1104 /* ************************************************************************* */
1105 /*                   WME Access Category Names (by WME ACI)                  */
1106 /* ************************************************************************* */
1107 static const value_string wme_acs[] = {
1108   { 0, "Best Effort" },
1109   { 1, "Background" },
1110   { 2, "Video" },
1111   { 3, "Voice" },
1112   { 0, NULL }
1113 };
1114
1115 /* ************************************************************************* */
1116 /*                  Aruba Management Type                                    */
1117 /* ************************************************************************* */
1118 static const value_string aruba_mgt_typevals[] = {
1119   { 0x0001,       "Hello" },
1120   { 0x0002,       "Probe" },
1121   { 0x0003,       "MTU" },
1122   { 0x0004,       "Ageout" },
1123   { 0x0005,       "Heartbeat" },
1124   { 0x0006,       "Deauth" },
1125   { 0x0007,       "Disassoc" },
1126   { 0x0008,       "Probe response" },
1127   { 0x0009,       "Tunnel update" },
1128   { 0x000A,       "Laser beam active" },
1129   { 0x000B,       "Client IP" },
1130   { 0x000C,       "Laser beam active v2" },
1131   { 0x000D,       "AP statistics" },
1132   { 0,            NULL }
1133 };
1134 static value_string_ext aruba_mgt_typevals_ext = VALUE_STRING_EXT_INIT(aruba_mgt_typevals);
1135
1136 /*** Begin: Action Fixed Parameter ***/
1137 #define CAT_SPECTRUM_MGMT        0
1138 #define CAT_QOS                  1
1139 #define CAT_DLS                  2
1140 #define CAT_BLOCK_ACK            3
1141 #define CAT_PUBLIC               4
1142
1143 #define CAT_RADIO_MEASUREMENT    5
1144 #define CAT_FAST_BSS_TRANSITION  6
1145 #define CAT_HT                   7
1146 #define CAT_SA_QUERY             8
1147 #define CAT_PUBLIC_PROTECTED     9
1148 #define CAT_WNM                 10
1149 #define CAT_UNPROTECTED_WNM     11
1150 #define CAT_TDLS                12
1151
1152 /* per 11s draft 12.0 */
1153 #define CAT_MESH                13
1154 #define CAT_MULTIHOP            14
1155 #define CAT_SELF_PROTECTED      15
1156
1157 #define CAT_MGMT_NOTIFICATION   17
1158 #define CAT_VENDOR_SPECIFIC_PROTECTED 126
1159 #define CAT_VENDOR_SPECIFIC     127
1160
1161 #define CAT_MESH_LINK_METRIC               31
1162 #define CAT_MESH_PATH_SELECTION            32
1163 #define CAT_MESH_INTERWORKING              33
1164 #define CAT_MESH_RESOURCE_COORDINATION     34
1165 #define CAT_MESH_SECURITY_ARCHITECTURE     35
1166
1167 #define SM_ACTION_MEASUREMENT_REQUEST   0
1168 #define SM_ACTION_MEASUREMENT_REPORT    1
1169 #define SM_ACTION_TPC_REQUEST           2
1170 #define SM_ACTION_TPC_REPORT            3
1171 #define SM_ACTION_CHAN_SWITCH_ANNC      4
1172 #define SM_ACTION_EXT_CHAN_SWITCH_ANNC  5
1173
1174 #define SM_ACTION_ADDTS_REQUEST     0
1175 #define SM_ACTION_ADDTS_RESPONSE    1
1176 #define SM_ACTION_DELTS             2
1177 #define SM_ACTION_QOS_SCHEDULE      3
1178
1179 #define SM_ACTION_DLS_REQUEST       0
1180 #define SM_ACTION_DLS_RESPONSE      1
1181 #define SM_ACTION_DLS_TEARDOWN      2
1182
1183 #define BA_ADD_BLOCK_ACK_REQUEST    0
1184 #define BA_ADD_BLOCK_ACK_RESPONSE   1
1185 #define BA_DELETE_BLOCK_ACK         2
1186
1187 #define PA_DSE_ENABLEMENT                  1
1188 #define PA_DSE_DEENABLEMENT                2
1189 #define PA_DSE_REG_LOC_ANNOUNCEMENT        3
1190 #define PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT 4
1191 #define PA_DSE_MEASUREMENT_REQUEST         5
1192 #define PA_DSE_MEASUREMENT_REPORT          6
1193 #define PA_MEASUREMENT_PILOT               7
1194 #define PA_DSE_POWER_CONSTRAINT            8
1195 #define PA_VENDOR_SPECIFIC                 9
1196 #define PA_GAS_INITIAL_REQUEST             10
1197 #define PA_GAS_INITIAL_RESPONSE            11
1198 #define PA_GAS_COMEBACK_REQUEST            12
1199 #define PA_GAS_COMEBACK_RESPONSE           13
1200 #define PA_TDLS_DISCOVERY_RESPONSE         14
1201
1202 #define HT_ACTION_NOTIFY_CHAN_WIDTH           0
1203 #define HT_ACTION_SM_PWR_SAVE                 1
1204 #define HT_ACTION_PSMP_ACTION                 2
1205 #define HT_ACTION_SET_PCO_PHASE               3
1206 #define HT_ACTION_MIMO_CSI                    4
1207 #define HT_ACTION_MIMO_BEAMFORMING            5
1208 #define HT_ACTION_MIMO_COMPRESSED_BEAMFORMING 6
1209 #define HT_ACTION_ANT_SEL_FEEDBACK            7
1210 #define HT_ACTION_HT_INFO_EXCHANGE            8
1211
1212 /* IEEE Std 802.11r-2008, 7.4.8, Table 7-57g */
1213 #define FT_ACTION_REQUEST               1
1214 #define FT_ACTION_RESPONSE              2
1215 #define FT_ACTION_CONFIRM               3
1216 #define FT_ACTION_ACK                   4
1217
1218 /* SA Query Action frame codes (IEEE 802.11w-2009, 7.4.9) */
1219 #define SA_QUERY_REQUEST                0
1220 #define SA_QUERY_RESPONSE               1
1221
1222 /* IEEE Std 802.11z-2010, 7.4.11, Table 7-57v1 */
1223 #define TDLS_SETUP_REQUEST              0
1224 #define TDLS_SETUP_RESPONSE             1
1225 #define TDLS_SETUP_CONFIRM              2
1226 #define TDLS_TEARDOWN                   3
1227 #define TDLS_PEER_TRAFFIC_INDICATION    4
1228 #define TDLS_CHANNEL_SWITCH_REQUEST     5
1229 #define TDLS_CHANNEL_SWITCH_RESPONSE    6
1230 #define TDLS_PEER_PSM_REQUEST           7
1231 #define TDLS_PEER_PSM_RESPONSE          8
1232 #define TDLS_PEER_TRAFFIC_RESPONSE      9
1233 #define TDLS_DISCOVERY_REQUEST          10
1234
1235 /* 11s draft 12.0, table 7-57v30 */
1236 #define MESH_ACTION_LINK_METRIC_REPORT              0
1237 #define MESH_ACTION_HWMP                            1
1238 #define MESH_ACTION_GATE_ANNOUNCE                   2
1239 #define MESH_ACTION_CONGESTION_CTL                  3
1240 #define MESH_ACTION_MCCA_SETUP_REQUEST              4
1241 #define MESH_ACTION_MCCA_SETUP_REPLY                5
1242 #define MESH_ACTION_MCCA_ADV_REQUEST                6
1243 #define MESH_ACTION_MCCA_ADV                        7
1244 #define MESH_ACTION_MCCA_TEARDOWN                   8
1245 #define MESH_ACTION_TBTT_ADJ_REQUEST                9
1246 #define MESH_ACTION_TBTT_ADJ_RESPONSE              10
1247
1248 /* 11s draft 12.0, table 7-57v42: Multihop Action field values */
1249 #define MULTIHOP_ACTION_PROXY_UPDATE                0
1250 #define MULTIHOP_ACTION_PROXY_UPDATE_CONF           1
1251
1252 /* 11s draft 12.0, table 7-57v24: Self-protected Action field values */
1253 #define SELFPROT_ACTION_MESH_PEERING_OPEN           1
1254 #define SELFPROT_ACTION_MESH_PEERING_CONFIRM        2
1255 #define SELFPROT_ACTION_MESH_PEERING_CLOSE          3
1256 #define SELFPROT_ACTION_MESH_GROUP_KEY_INFORM       4
1257 #define SELFPROT_ACTION_MESH_GROUP_KEY_ACK          5
1258
1259 /* 11s draft 12.0, table 7-43bj6: Mesh Peering Protocol Identifier field values */
1260 #define MESH_PEERING_PROTO_MGMT                     0
1261 #define MESH_PEERING_PROTO_AMPE                     1
1262 #define MESH_PEERING_PROTO_VENDOR                 255
1263
1264 /* Vendor actions */
1265 /* MARVELL */
1266 #define MRVL_ACTION_MESH_MANAGEMENT     1
1267
1268 #define MRVL_MESH_MGMT_ACTION_RREQ      0
1269 #define MRVL_MESH_MGMT_ACTION_RREP      1
1270 #define MRVL_MESH_MGMT_ACTION_RERR      2
1271 #define MRVL_MESH_MGMT_ACTION_PLDM      3
1272
1273 #define ANQP_INFO_ANQP_QUERY_LIST 256
1274 #define ANQP_INFO_ANQP_CAPAB_LIST 257
1275 #define ANQP_INFO_VENUE_NAME_INFO 258
1276 #define ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO 259
1277 #define ANQP_INFO_NETWORK_AUTH_TYPE_INFO 260
1278 #define ANQP_INFO_ROAMING_CONSORTIUM_LIST 261
1279 #define ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO 262
1280 #define ANQP_INFO_NAI_REALM_LIST 263
1281 #define ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO 264
1282 #define ANQP_INFO_AP_GEOSPATIAL_LOCATION 265
1283 #define ANQP_INFO_AP_CIVIC_LOCATION 266
1284 #define ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI 267
1285 #define ANQP_INFO_DOMAIN_NAME_LIST 268
1286 #define ANQP_INFO_EMERGENCY_ALERT_ID_URI 269
1287 #define ANQP_INFO_TDLS_CAPAB_INFO 270
1288 #define ANQP_INFO_EMERGENCY_NAI 271
1289 #define ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST 56797
1290
1291 /* ANQP information ID - IEEE Std 802.11u-2011 - Table 7-43bk */
1292 static const value_string anqp_info_id_vals[] = {
1293   {ANQP_INFO_ANQP_QUERY_LIST, "ANQP Query list"},
1294   {ANQP_INFO_ANQP_CAPAB_LIST, "ANQP Capability list"},
1295   {ANQP_INFO_VENUE_NAME_INFO, "Venue Name information"},
1296   {ANQP_INFO_EMERGENCY_CALL_NUMBER_INFO, "Emergency Call Number information"},
1297   {ANQP_INFO_NETWORK_AUTH_TYPE_INFO,
1298    "Network Authentication Type information"},
1299   {ANQP_INFO_ROAMING_CONSORTIUM_LIST, "Roaming Consortium list"},
1300   {ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO,
1301    "IP Address Type Availability information"},
1302   {ANQP_INFO_NAI_REALM_LIST, "NAI Realm list"},
1303   {ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO, "3GPP Cellular Network information"},
1304   {ANQP_INFO_AP_GEOSPATIAL_LOCATION, "AP Geospatial Location"},
1305   {ANQP_INFO_AP_CIVIC_LOCATION, "AP Civic Location"},
1306   {ANQP_INFO_AP_LOCATION_PUBLIC_ID_URI, "AP Location Public Identifier URI"},
1307   {ANQP_INFO_DOMAIN_NAME_LIST, "Domain Name list"},
1308   {ANQP_INFO_EMERGENCY_ALERT_ID_URI, "Emergency Alert Identifier URI"},
1309   {ANQP_INFO_TDLS_CAPAB_INFO, "TDLS Capability information"},
1310   {ANQP_INFO_EMERGENCY_NAI, "Emergency NAI"},
1311   {ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST, "ANQP vendor-specific list"},
1312   {0, NULL}
1313 };
1314 static value_string_ext anqp_info_id_vals_ext = VALUE_STRING_EXT_INIT(anqp_info_id_vals);
1315
1316 /* IEEE 802.11v - WNM Action field values */
1317 enum wnm_action {
1318   WNM_EVENT_REQ = 0,
1319   WNM_EVENT_REPORT = 1,
1320   WNM_DIAGNOSTIC_REQ = 2,
1321   WNM_DIAGNOSTIC_REPORT = 3,
1322   WNM_LOCATION_CFG_REQ = 4,
1323   WNM_LOCATION_CFG_RESP = 5,
1324   WNM_BSS_TRANS_MGMT_QUERY = 6,
1325   WNM_BSS_TRANS_MGMT_REQ = 7,
1326   WNM_BSS_TRANS_MGMT_RESP = 8,
1327   WNM_FMS_REQ = 9,
1328   WNM_FMS_RESP = 10,
1329   WNM_COLLOCATED_INTERFERENCE_REQ = 11,
1330   WNM_COLLOCATED_INTERFERENCE_REPORT = 12,
1331   WNM_TFS_REQ = 13,
1332   WNM_TFS_RESP = 14,
1333   WNM_TFS_NOTIFY = 15,
1334   WNM_SLEEP_MODE_REQ = 16,
1335   WNM_SLEEP_MODE_RESP = 17,
1336   WNM_TIM_BROADCAST_REQ = 18,
1337   WNM_TIM_BROADCAST_RESP = 19,
1338   WNM_QOS_TRAFFIC_CAPAB_UPDATE = 20,
1339   WNM_CHANNEL_USAGE_REQ = 21,
1340   WNM_CHANNEL_USAGE_RESP = 22,
1341   WNM_DMS_REQ = 23,
1342   WNM_DMS_RESP = 24,
1343   WNM_TIMING_MEASUREMENT_REQ = 25,
1344   WNM_NOTIFICATION_REQ = 26,
1345   WNM_NOTIFICATION_RESP = 27
1346 };
1347
1348 static const value_string wnm_action_codes[] = {
1349   { WNM_EVENT_REQ, "Event Request" },
1350   { WNM_EVENT_REPORT, "Event Report" },
1351   { WNM_DIAGNOSTIC_REQ, "Diagnostic Request" },
1352   { WNM_DIAGNOSTIC_REPORT, "Diagnostic Report" },
1353   { WNM_LOCATION_CFG_REQ, "Location Configuration Request" },
1354   { WNM_LOCATION_CFG_RESP, "Location Configuration Response" },
1355   { WNM_BSS_TRANS_MGMT_QUERY, "BSS Transition Management Query" },
1356   { WNM_BSS_TRANS_MGMT_REQ, "BSS Transition Management Request" },
1357   { WNM_BSS_TRANS_MGMT_RESP, "BSS Transition Management Response" },
1358   { WNM_FMS_REQ, "FMS Request" },
1359   { WNM_FMS_RESP, "FMS Response" },
1360   { WNM_COLLOCATED_INTERFERENCE_REQ, "Collocated Interference Request" },
1361   { WNM_COLLOCATED_INTERFERENCE_REPORT, "Collocated Interference Report" },
1362   { WNM_TFS_REQ, "TFS Request" },
1363   { WNM_TFS_RESP, "TFS Response" },
1364   { WNM_TFS_NOTIFY, "TFS Notify" },
1365   { WNM_SLEEP_MODE_REQ, "WNM-Sleep Mode Request" },
1366   { WNM_SLEEP_MODE_RESP, "WNM-Sleep Mode Response" },
1367   { WNM_TIM_BROADCAST_REQ, "TIM Broadcast Request" },
1368   { WNM_TIM_BROADCAST_RESP, "TIM Broadcast Response" },
1369   { WNM_QOS_TRAFFIC_CAPAB_UPDATE, "QoS Traffic Capability Update" },
1370   { WNM_CHANNEL_USAGE_REQ, "Channel Usage Request" },
1371   { WNM_CHANNEL_USAGE_RESP, "Channel Usage Response" },
1372   { WNM_DMS_REQ, "DMS Request" },
1373   { WNM_DMS_RESP, "DMS Response" },
1374   { WNM_TIMING_MEASUREMENT_REQ, "Timing Measurement Request" },
1375   { WNM_NOTIFICATION_REQ, "WNM-Notification Request" },
1376   { WNM_NOTIFICATION_RESP, "WNM-Notification Response" },
1377   { 0, NULL }
1378 };
1379 static value_string_ext wnm_action_codes_ext = VALUE_STRING_EXT_INIT(wnm_action_codes);
1380
1381
1382 static const value_string wnm_notification_types[] = {
1383   { 0, "Firmware Update Notification" },
1384   { 1, "Reserved for use by WFA" },
1385   { 221, "Vendor Specific" },
1386   { 0, NULL }
1387 };
1388
1389 static value_string_ext wnm_notification_types_ext =
1390   VALUE_STRING_EXT_INIT(wnm_notification_types);
1391
1392 /*** End: Action Fixed Parameter ***/
1393
1394 static const value_string ieee80211_tag_measure_request_type_flags[] = {
1395   {0x00, "Basic Request"},
1396   {0x01, "Clear Channel Assessment (CCA) Request"},
1397   {0x02, "Receive Power Indication (RPI) Histogram Request"},
1398   {0x03, "Channel Load Request"},
1399   {0x04, "Noise Histogram Request"},
1400   {0x05, "Beacon Request"},
1401   {0x06, "Frame Request"},
1402   {0x07, "STA Statistics Request"},
1403   {0x08, "Location Configuration Indication (LCI) Request"},
1404   {0x09, "Transmit Stream Measurement Request"},
1405   {0x0A, "Measurement Pause Request"},
1406   {0x00, NULL}
1407 };
1408 static value_string_ext ieee80211_tag_measure_request_type_flags_ext =
1409   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_type_flags);
1410
1411 static const value_string ieee80211_tag_measure_report_type_flags[] = {
1412   { 0x00, "Basic Report" },
1413   { 0x01, "Clear Channel Assessment (CCA) Report" },
1414   { 0x02, "Receive Power Indication (RPI) Histogram Report" },
1415   { 0x03, "Channel Load Report" },
1416   { 0x04, "Noise Histogram Report" },
1417   { 0x05, "Beacon Report" },
1418   { 0x06, "Frame Report" },
1419   { 0x07, "STA Statistics Report" },
1420   { 0x08, "Location Configuration Information (LCI) Report" },
1421   { 0x09, "Transmit Stream Measurement Report" },
1422   { 0x00, NULL }
1423 };
1424 static value_string_ext ieee80211_tag_measure_report_type_flags_ext =
1425   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_report_type_flags);
1426
1427 static const true_false_string ieee80211_tag_measure_report_frame_info_frame_type_flag = {
1428   "Measurement Pilot Frame",
1429   "Beacon/Probe Response Frame"
1430 };
1431
1432 static const true_false_string ieee80211_tag_measure_map_field_bss_flag = {
1433   "At least one MPDU was received by another BSS or IBSS in the measurement period.",
1434   "No MPDUs were received from another BSS or IBSS in the measurement period."
1435 };
1436
1437 static const value_string ieee80211_tag_measure_request_measurement_mode_flags[] = {
1438   { 0x00, "Passive" },
1439   { 0x01, "Active" },
1440   { 0x02, "Beacon Table" },
1441   { 0x00, NULL }
1442 };
1443
1444 #define MEASURE_REQ_BEACON_SUB_SSID 0
1445 #define MEASURE_REQ_BEACON_SUB_BRI 1
1446 #define MEASURE_REQ_BEACON_SUB_RD 2
1447 #define MEASURE_REQ_BEACON_SUB_REQUEST 10
1448 #define MEASURE_REQ_BEACON_SUB_APCP 51
1449 #define MEASURE_REQ_BEACON_SUB_VS 221
1450
1451 static const value_string ieee80211_tag_measure_request_beacon_sub_id_flags[] = {
1452   { MEASURE_REQ_BEACON_SUB_SSID, "SSID" },
1453   { MEASURE_REQ_BEACON_SUB_BRI, "Beacon Reporting Information" },
1454   { MEASURE_REQ_BEACON_SUB_RD, "Reporting Detail" },
1455   { MEASURE_REQ_BEACON_SUB_REQUEST, "Request" },
1456   { MEASURE_REQ_BEACON_SUB_APCP, "AP Channel Report" },
1457   { MEASURE_REQ_BEACON_SUB_VS, "Vendor Specific" },
1458   { 0x00, NULL}
1459 };
1460
1461 static const value_string ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags[] = {
1462   { 0x00, "Report to be issued after each measurement." },
1463   { 0x01, "The measured RCPI level is greater than an absolute threshold." },
1464   { 0x02, "The measured RCPI level is less than an absolute threshold." },
1465   { 0x03, "The measured RSNI level is greater than an absolute threshold." },
1466   { 0x04, "The measured RSNI level is less than an absolute threshold." },
1467   { 0x05, "The measured RCPI level is greater than a threshold defined by an offset from the serving AP's reference RCPI." },
1468   { 0x06, "The measured RCPI level is less than a threshold defined by an offset from the serving AP's reference RCPI." },
1469   { 0x07, "The measured RSNI level is greater than a threshold defined by an offset from the serving AP's reference RSNI." },
1470   { 0x08, "The measured RSNI level is less than a threshold defined by an offset from the serving AP's reference RSNI." },
1471   { 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." },
1472   { 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." },
1473   { 0xfe, "Report not required to be issued" },
1474   { 0x00, NULL }
1475 };
1476
1477 static const value_string ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags[] = {
1478   { 0, "No fixed length fields or elements" },
1479   { 1, "All fixed length fields and any requested elements in the Request information element if present" },
1480   { 2, "All fixed length fields and elements (default, used when Reporting Detail subelement is not included in Beacon Request" },
1481   { 0x00, NULL }
1482 };
1483
1484 static const value_string ieee80211_tag_measure_request_group_id_flags[] = {
1485   { 0x00, "STA Counters from dot11CountersTable" },
1486   { 0x01, "STA Counters from dot11MacStatistics group" },
1487   { 0x02, "QoS STA Counters for UP0 from dot11QosCountersTable" },
1488   { 0x03, "QoS STA Counters for UP1 from dot11QosCountersTable" },
1489   { 0x04, "QoS STA Counters for UP2 from dot11QosCountersTable" },
1490   { 0x05, "QoS STA Counters for UP3 from dot11QosCountersTable" },
1491   { 0x06, "QoS STA Counters for UP4 from dot11QosCountersTable" },
1492   { 0x07, "QoS STA Counters for UP5 from dot11QosCountersTable" },
1493   { 0x08, "QoS STA Counters for UP6 from dot11QosCountersTable" },
1494   { 0x09, "QoS STA Counters for UP7 from dot11QosCountersTable" },
1495   { 0x0a, "BSS Average Access Delays" },
1496   { 0x0b, "STA Counters from dot11A-MSDU Group" },
1497   { 0x0c, "STA Counters from dot11A-MPDU Group" },
1498   { 0x0d, "STA Counters from dot11 BAR, Channel Width, PSMP Group" },
1499   { 0x0e, "STA Counters from dot11Protection Group" },
1500   { 0x0f, "STBC Group" },
1501   { 0x00, NULL }
1502 };
1503 static value_string_ext ieee80211_tag_measure_request_group_id_flags_ext =
1504   VALUE_STRING_EXT_INIT(ieee80211_tag_measure_request_group_id_flags);
1505
1506 static const value_string ieee80211_tclas_process_flag[] = {
1507   {0x00, "Incoming MSDU's higher layer parameters have to match to the parameters in all associated TCLAS elements."},
1508   {0x01, "Incoming MSDU's higher layer parameters have to match to at least one of the associated TCLAS elements."},
1509   {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."},
1510   {0, NULL}
1511 };
1512
1513 static const value_string frame_type[] = {
1514   {MGT_FRAME,     "Management frame"},
1515   {CONTROL_FRAME, "Control frame"},
1516   {DATA_FRAME,    "Data frame"},
1517   {0,             NULL}
1518 };
1519
1520 static const value_string tofrom_ds[] = {
1521   {0,                     "Not leaving DS or network is operating "
1522     "in AD-HOC mode (To DS: 0 From DS: 0)"},
1523   {FLAG_TO_DS,            "Frame from STA to DS via an AP (To DS: 1 "
1524     "From DS: 0)"},
1525   {FLAG_FROM_DS,          "Frame from DS to a STA via AP(To DS: 0 "
1526     "From DS: 1)"},
1527   {FLAG_TO_DS|FLAG_FROM_DS, "WDS (AP to AP) or Mesh (MP to MP) Frame "
1528     "(To DS: 1 From DS: 1)"},
1529   {0, NULL}
1530 };
1531
1532 static const true_false_string tods_flag = {
1533   "Frame is entering DS",
1534   "Frame is not entering DS"
1535 };
1536
1537 static const true_false_string fromds_flag = {
1538   "Frame is exiting DS",
1539   "Frame is not exiting DS"
1540 };
1541
1542 static const true_false_string more_fragments = {
1543   "More fragments follow",
1544   "This is the last fragment"
1545 };
1546
1547 static const true_false_string retry_flags = {
1548   "Frame is being retransmitted",
1549   "Frame is not being retransmitted"
1550 };
1551
1552 static const true_false_string pm_flags = {
1553   "STA will go to sleep",
1554   "STA will stay up"
1555 };
1556
1557 static const true_false_string md_flags = {
1558   "Data is buffered for STA at AP",
1559   "No data buffered"
1560 };
1561
1562 static const true_false_string protected_flags = {
1563   "Data is protected",
1564   "Data is not protected"
1565 };
1566
1567 static const true_false_string order_flags = {
1568   "Strictly ordered",
1569   "Not strictly ordered"
1570 };
1571
1572 static const true_false_string cf_ess_flags = {
1573   "Transmitter is an AP",
1574   "Transmitter is a STA"
1575 };
1576
1577
1578 static const true_false_string cf_privacy_flags = {
1579   "AP/STA can support WEP",
1580   "AP/STA cannot support WEP"
1581 };
1582
1583 static const true_false_string cf_ibss_flags = {
1584   "Transmitter belongs to an IBSS",
1585   "Transmitter belongs to a BSS"
1586 };
1587
1588 static const true_false_string eosp_flag = {
1589   "End of service period",
1590   "Service period"
1591 };
1592
1593 static const true_false_string bit4_flag = {
1594   "Bits 8-15 of QoS Control field are Queue Size",
1595   "Bits 8-15 of QoS Control field are TXOP Duration Requested"
1596 };
1597
1598 static const true_false_string ieee80211_qos_amsdu_present_flag = {
1599   "A-MSDU",
1600   "MSDU"
1601 };
1602
1603 static const value_string sta_cf_pollable[] = {
1604   {0x00, "Station is not CF-Pollable"},
1605   {0x02, "Station is CF-Pollable, not requesting to be placed on the  CF-polling list"},
1606   {0x01, "Station is CF-Pollable, requesting to be placed on the CF-polling list"},
1607   {0x03, "Station is CF-Pollable, requesting never to be polled"},
1608   {0x80, "QSTA requesting association in QBSS"},
1609   {0x81, "Reserved"},
1610   {0x82, "Reserved"},
1611   {0x83, "Reserved"},
1612   {0, NULL}
1613 };
1614
1615 static const value_string ap_cf_pollable[] = {
1616   {0x00, "No point coordinator at AP"},
1617   {0x02, "Point coordinator at AP for delivery only (no polling)"},
1618   {0x01, "Point coordinator at AP for delivery and polling"},
1619   {0x03, "Reserved"},
1620   {0x80, "QAP (HC) does not use CFP for delivery of unicast data type frames"},
1621   {0x82, "QAP (HC) uses CFP for delivery, but does not send CF-Polls to non-QoS STAs"},
1622   {0x81, "QAP (HC) uses CFP for delivery, and sends CF-Polls to non-QoS STAs"},
1623   {0x83, "Reserved"},
1624   {0, NULL}
1625 };
1626
1627
1628 static const value_string auth_alg[] = {
1629   {0x00, "Open System"},
1630   {0x01, "Shared key"},
1631   {0x02, "Fast BSS Transition"},
1632   {0x80, "Network EAP"},  /* Cisco proprietary? */
1633   {0, NULL}
1634 };
1635
1636 static const true_false_string ff_block_ack_params_amsdu_permitted_flag = {
1637   "Permitted in QoS Data MPDUs",
1638   "Not Permitted"
1639 };
1640
1641 static const true_false_string ff_block_ack_params_policy_flag = {
1642   "Immediate Block Ack",
1643   "Delayed Block Ack"
1644 };
1645
1646 static const value_string  ff_channel_width_vals[] = {
1647   {0x00, "20 MHz channel width only"},
1648   {0x01, "Any channel width in the STA's Supported Channel Width Set"},
1649   {0, NULL}
1650 };
1651
1652 static const true_false_string ff_qos_info_ap_q_ack_flag = {
1653   "Implemented",
1654   "Not Implemented"
1655 };
1656
1657 static const true_false_string ff_qos_info_ap_queue_req_flag = {
1658   "Can process a nonzero Queue Size subfield in the QoS Control field in QoS data frames",
1659   "Can NOT process a nonzero Queue Size subfield in the QoS Control field in QoS data frames"
1660 };
1661
1662 static const true_false_string ff_qos_info_ap_txop_request_flag = {
1663   "Can process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames",
1664   "Can NOT process a nonzero TXOP Duration Requested subfield in the QoS Control field in QoS data frames"
1665 };
1666
1667 static const true_false_string ff_qos_info_sta_ac_flag = {
1668   "Trigger-enabled and Delivery-enabled",
1669   "Neither Trigger-enabled nor Delivery-enabled"
1670 };
1671
1672 static const true_false_string ff_qos_info_sta_q_ack_flag = {
1673   "Implemented",
1674   "Not Implemented"
1675 };
1676
1677 static const value_string ff_qos_info_sta_max_sp_len_flags[] = {
1678   {0x00, "AP may deliver all buffered MSDUs, A-MSDUs and MMPDUs"},
1679   {0x01, "AP may deliver a maximum of two MSDUs and MMPDUs per SP"},
1680   {0x02, "AP may deliver a maximum of four MSDUs and MMPDUs per SP"},
1681   {0x03, "AP may deliver a maximum of six MSDUs and MMPDUs per SP"},
1682   {0, NULL}
1683 };
1684
1685 static const true_false_string ff_qos_info_sta_more_data_ack_flag = {
1686   "Can process ACK frames with the More Data bit in the Frame Control field set to 1",
1687   "Can NOT process ACK frames with the More Data bit in the Frame Control field set to 1"
1688 };
1689
1690 static const true_false_string ff_sm_pwr_save_sm_mode_flag = {
1691   "Dynamic SM Power Save mode",
1692   "Static SM Power Save mode"
1693 };
1694
1695 static const true_false_string ff_pco_phase_cntrl_flag = {
1696   "40 MHz Phase",
1697   "20 MHz Phase"
1698 };
1699
1700 static const true_false_string ff_psmp_param_set_more_psmp_flag = {
1701   "More PSMP Sequences Follow",
1702   "No PSMP Sequences Follow"
1703 };
1704
1705 static const value_string ff_mimo_cntrl_nc_index_flags[] = {
1706   {0x00, "1 Column"},
1707   {0x01, "2 Columns"},
1708   {0x02, "3 Columns"},
1709   {0x03, "4 Columns"},
1710   {0, NULL}
1711 };
1712
1713 static const value_string ff_mimo_cntrl_nr_index_flags[] = {
1714   {0x00, "1 Row"},
1715   {0x01, "2 Rows"},
1716   {0x02, "3 Rows"},
1717   {0x03, "4 Rows"},
1718   {0, NULL}
1719 };
1720
1721 static const true_false_string ff_mimo_cntrl_channel_width_flag = {
1722   "40 MHz",
1723   "20 MHz"
1724 };
1725
1726 static const true_false_string ff_ht_info_information_request_flag = {
1727   "Requesting HT Information Exchange management action frame",
1728   "Should not send an HT Information Exchange management action frame"
1729 };
1730
1731 static const true_false_string ff_ht_info_40_mhz_intolerant_flag = {
1732   "Transmitting station is intolerant of 40 MHz operation",
1733   "Transmitting station permits 40 MHz operation"
1734 };
1735
1736 static const true_false_string ff_ht_info_sta_chan_width_flag = {
1737   "40 MHz",
1738   "20 MHz"
1739 };
1740
1741 static const value_string ff_ht_action_flags[] = {
1742   {HT_ACTION_NOTIFY_CHAN_WIDTH,           "Notify Channel Width"},
1743   {HT_ACTION_SM_PWR_SAVE,                 "Spatial Multiplexing (SM) Power Save"},
1744   {HT_ACTION_PSMP_ACTION,                 "Power Save Multi-Poll (PSMP) action frame"},
1745   {HT_ACTION_SET_PCO_PHASE,               "Set PCO Phase"},
1746   {HT_ACTION_MIMO_CSI,                    "MIMO CSI Matrices"},
1747   {HT_ACTION_MIMO_BEAMFORMING,            "MIMO Non-compressed Beamforming"},
1748   {HT_ACTION_MIMO_COMPRESSED_BEAMFORMING, "MIMO Compressed Beamforming"},
1749   {HT_ACTION_ANT_SEL_FEEDBACK,            "Antenna Selection Indices Feedback"},
1750   {HT_ACTION_HT_INFO_EXCHANGE,            "HT Information Exchange"},
1751   {0x00, NULL}
1752 };
1753
1754 static const value_string ff_mimo_cntrl_grouping_flags[] = {
1755   {0x00, "No Grouping"},
1756   {0x01, "Carrier Groups of 2"},
1757   {0x02, "Carrier Groups of 4"},
1758   {0x03, "Reserved"},
1759   {0, NULL}
1760 };
1761
1762 static const value_string ff_mimo_cntrl_coefficient_size_flags[] = {
1763   {0x00, "4 Bits"},
1764   {0x01, "5 Bits"},
1765   {0x02, "6 Bits"},
1766   {0x03, "8 Bits"},
1767   {0, NULL}
1768 };
1769
1770 static const value_string ff_mimo_cntrl_codebook_info_flags[] = {
1771   {0x00, "1 bit for 'Capital Psi', 3 bits for 'Small Psi'"},
1772   {0x01, "2 bit for 'Capital Psi', 4 bits for 'Small Psi'"},
1773   {0x02, "3 bit for 'Capital Psi', 5 bits for 'Small Psi'"},
1774   {0x03, "4 bit for 'Capital Psi', 6 bits for 'Small Psi'"},
1775   {0, NULL}
1776 };
1777
1778
1779
1780 static const value_string ff_pa_action_codes[] = {
1781   {PA_DSE_ENABLEMENT,                  "DSE enablement"},
1782   {PA_DSE_DEENABLEMENT,                "DSE deenablement"},
1783   {PA_DSE_REG_LOC_ANNOUNCEMENT,        "DSE Registered Location Announcement"},
1784   {PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement"},
1785   {PA_DSE_MEASUREMENT_REQUEST,         "DSE measurement request"},
1786   {PA_DSE_MEASUREMENT_REPORT,          "DSE measurement report"},
1787   {PA_MEASUREMENT_PILOT,               "Measurement Pilot"},
1788   {PA_DSE_POWER_CONSTRAINT,            "DSE power constraint"},
1789   {PA_VENDOR_SPECIFIC,                 "Vendor Specific"},
1790   {PA_GAS_INITIAL_REQUEST,             "GAS Initial Request"},
1791   {PA_GAS_INITIAL_RESPONSE,            "GAS Initial Response"},
1792   {PA_GAS_COMEBACK_REQUEST,            "GAS Comeback Request"},
1793   {PA_GAS_COMEBACK_RESPONSE,           "GAS Comeback Response"},
1794   {PA_TDLS_DISCOVERY_RESPONSE,         "TDLS Discovery Response"},
1795   {0x00, NULL}
1796 };
1797 static value_string_ext ff_pa_action_codes_ext = VALUE_STRING_EXT_INIT(ff_pa_action_codes);
1798
1799 static const value_string category_codes[] = {
1800   {CAT_SPECTRUM_MGMT,                    "Spectrum Management (SM)"},
1801   {CAT_QOS,                              "Quality of Service (QoS)"},
1802   {CAT_DLS,                              "Direct-Link Setup (DLS)"},
1803   {CAT_BLOCK_ACK,                        "Block Ack"},
1804   {CAT_PUBLIC,                           "Public Action"},
1805   {CAT_RADIO_MEASUREMENT,                "Radio Measurement"},
1806   {CAT_FAST_BSS_TRANSITION,              "Fast BSS Transition"},
1807   {CAT_HT,                               "High Throughput"},
1808   {CAT_SA_QUERY,                         "SA Query"},
1809   {CAT_PUBLIC_PROTECTED,                 "Protected Dual of Public Action"},
1810   {CAT_WNM,                              "WNM"},
1811   {CAT_UNPROTECTED_WNM,                  "Unprotected WNM"},
1812   {CAT_TDLS,                             "TDLS"},
1813   {CAT_MESH,                             "MESH"},
1814   {CAT_MULTIHOP,                         "Multihop"},
1815   {CAT_SELF_PROTECTED,                   "Self-protected"},
1816   {CAT_MGMT_NOTIFICATION,                "Management Notification"},
1817   {CAT_VENDOR_SPECIFIC_PROTECTED,        "Vendor-specific Protected"},
1818   {CAT_VENDOR_SPECIFIC,                  "Vendor Specific"},
1819
1820   {0x80 | CAT_SPECTRUM_MGMT,             "Spectrum Management (SM) (error)"},
1821   {0x80 | CAT_QOS,                       "Quality of Service (QoS (error))"},
1822   {0x80 | CAT_DLS,                       "Direct-Link Setup (DLS) (error)"},
1823   {0x80 | CAT_BLOCK_ACK,                 "Block Ack (error)"},
1824   {0x80 | CAT_PUBLIC,                    "Public Action (error)"},
1825   {0x80 | CAT_RADIO_MEASUREMENT,         "Radio Measurement (error)"},
1826   {0x80 | CAT_FAST_BSS_TRANSITION,       "Fast BSS Transition (error)"},
1827   {0x80 | CAT_HT,                        "High Throughput (error)"},
1828   {0x80 | CAT_SA_QUERY,                  "SA Query (error)"},
1829   {0x80 | CAT_PUBLIC_PROTECTED,          "Protected Dual of Public Action (error)"},
1830   {0x80 | CAT_WNM,                       "WNM (error)"},
1831   {0x80 | CAT_UNPROTECTED_WNM,           "Unprotected WNM (error)"},
1832   {0x80 | CAT_TDLS,                      "TDLS (error)"},
1833   {0x80 | CAT_MESH,                      "Mesh (error)"},
1834   {0x80 | CAT_MULTIHOP,                  "Multihop (error)"},
1835   {0x80 | CAT_SELF_PROTECTED,            "Self-protected (error)"},
1836   {0x80 | CAT_MGMT_NOTIFICATION,         "Management Notification (error)"},
1837   {0x80 | CAT_VENDOR_SPECIFIC_PROTECTED, "Vendor-specific Protected (error)"},
1838   {0x80 | CAT_VENDOR_SPECIFIC,           "Vendor Specific (error)"},
1839   {0, NULL}
1840 };
1841 static value_string_ext category_codes_ext = VALUE_STRING_EXT_INIT(category_codes);
1842
1843 static const value_string action_codes[] = {
1844   {SM_ACTION_MEASUREMENT_REQUEST, "Measurement Request"},
1845   {SM_ACTION_MEASUREMENT_REPORT,  "Measurement Report"},
1846   {SM_ACTION_TPC_REQUEST,         "TPC Request"},
1847   {SM_ACTION_TPC_REPORT,          "TPC Report"},
1848   {SM_ACTION_CHAN_SWITCH_ANNC,    "Channel Switch Announcement"},
1849   {0, NULL}
1850 };
1851
1852 static const value_string vendor_action_types_mrvl[] = {
1853   {MRVL_ACTION_MESH_MANAGEMENT, "Mesh Management"},
1854   {0, NULL}
1855 };
1856
1857 static const value_string mesh_mgt_action_codes_mrvl[] = {
1858   {MRVL_MESH_MGMT_ACTION_RREQ, "Route Request"},
1859   {MRVL_MESH_MGMT_ACTION_RREP, "Route Response"},
1860   {MRVL_MESH_MGMT_ACTION_RERR, "Route Error"},
1861   {MRVL_MESH_MGMT_ACTION_PLDM, "Peer Link Down"},
1862   {0, NULL}
1863 };
1864
1865 static const value_string mesh_path_selection_codes[] = {
1866   {0x0, "Hybrid Wireless Mesh Protocol"},
1867   {0, NULL}
1868 };
1869
1870 static const value_string mesh_metric_codes[] = {
1871   {0x0, "Airtime Link Metric"},
1872   {0, NULL}
1873 };
1874
1875 static const value_string wme_action_codes[] = {
1876   {0x00, "Setup request"},
1877   {0x01, "Setup response"},
1878   {0x02, "Teardown"},
1879   {0x00, NULL}
1880 };
1881
1882 static const value_string wme_status_codes[] = {
1883   {0x00, "Admission accepted"},
1884   {0x01, "Invalid parameters"},
1885   {0x03, "Refused"},
1886   {0x00, NULL}
1887 };
1888
1889 static const value_string mesh_action[] = {
1890   {MESH_ACTION_LINK_METRIC_REPORT, "Mesh Link Metric Report"},
1891   {MESH_ACTION_HWMP,               "HWMP Mesh Path Selection"},
1892   {MESH_ACTION_GATE_ANNOUNCE,      "Gate Announcement"},
1893   {MESH_ACTION_CONGESTION_CTL,     "Congestion Control Notification"},
1894   {MESH_ACTION_MCCA_SETUP_REQUEST, "MCCA Setup Request"},
1895   {MESH_ACTION_MCCA_SETUP_REPLY,   "MCCA Setup Reply"},
1896   {MESH_ACTION_MCCA_ADV_REQUEST,   "MCCA Advertisement Request"},
1897   {MESH_ACTION_MCCA_ADV,           "MCCA Advertisement"},
1898   {MESH_ACTION_MCCA_TEARDOWN,      "MCCA Teardown"},
1899   {MESH_ACTION_TBTT_ADJ_REQUEST,   "TBTT Adjustment Request"},
1900   {MESH_ACTION_TBTT_ADJ_RESPONSE,  "TBTT Adjustment Response"},
1901   {0, NULL}
1902 };
1903 static value_string_ext mesh_action_ext = VALUE_STRING_EXT_INIT(mesh_action);
1904
1905 static const value_string multihop_action[] = {
1906   {MULTIHOP_ACTION_PROXY_UPDATE,      "Proxy Update"},
1907   {MULTIHOP_ACTION_PROXY_UPDATE_CONF, "Proxy Update Confirmation"},
1908   {0, NULL}
1909 };
1910
1911 static const value_string selfprot_action[] = {
1912   {SELFPROT_ACTION_MESH_PEERING_OPEN,     "Mesh Peering Open"},
1913   {SELFPROT_ACTION_MESH_PEERING_CONFIRM,  "Mesh Peering Confirm"},
1914   {SELFPROT_ACTION_MESH_PEERING_CLOSE,    "Mesh Peering Close"},
1915   {SELFPROT_ACTION_MESH_GROUP_KEY_INFORM, "Mesh Group Key Inform"},
1916   {SELFPROT_ACTION_MESH_GROUP_KEY_ACK,    "Mesh Group Key Ack"},
1917   {0, NULL}
1918 };
1919
1920 static const value_string mesh_peering_proto_ids[] = {
1921   {MESH_PEERING_PROTO_MGMT,   "Mesh peering management protocol"},
1922   {MESH_PEERING_PROTO_AMPE,   "Authenticated mesh peering exchange protocol"},
1923   {MESH_PEERING_PROTO_VENDOR, "Vendor specific"},
1924   {0, NULL}
1925 };
1926
1927 static const true_false_string hwmp_targ_usn_flags = {
1928   "[USN = 1] Target Sequence Number Unknown at Originator",
1929   "[USN = 0] Target Sequence Number Known at Originator"
1930 };
1931
1932 static const true_false_string hwmp_targ_to_flags = {
1933   "[TO = 1] Only Target Will Respond",
1934   "[TO = 0] Intermediate Nodes May Respond"
1935 };
1936
1937 static const value_string ack_policy[] = {
1938   {0x00, "Normal Ack"},
1939   {0x01, "No Ack"},
1940   {0x02, "No explicit acknowledgment"},
1941   {0x03, "Block Ack"},
1942   {0x00, NULL}
1943 };
1944
1945 static const value_string qos_action_codes[] = {
1946   {SM_ACTION_ADDTS_REQUEST,  "ADDTS Request"},
1947   {SM_ACTION_ADDTS_RESPONSE, "ADDTS Response"},
1948   {SM_ACTION_DELTS,          "DELTS"},
1949   {SM_ACTION_QOS_SCHEDULE,   "Schedule"},
1950   {0, NULL}
1951 };
1952
1953 static const value_string ba_action_codes[] = {
1954   {BA_ADD_BLOCK_ACK_REQUEST,  "Add Block Ack Request"},
1955   {BA_ADD_BLOCK_ACK_RESPONSE, "Add Block Ack Response"},
1956   {BA_DELETE_BLOCK_ACK,       "Delete Block Ack"},
1957   {0x00, NULL}
1958 };
1959
1960 static const value_string dls_action_codes[] = {
1961   {SM_ACTION_DLS_REQUEST,  "DLS Request"},
1962   {SM_ACTION_DLS_RESPONSE, "DLS Response"},
1963   {SM_ACTION_DLS_TEARDOWN, "DLS Teardown"},
1964   {0, NULL}
1965 };
1966
1967 static const value_string tsinfo_type[] = {
1968   {0x0, "Aperiodic or unspecified Traffic"},
1969   {0x1, "Periodic Traffic"},
1970   {0, NULL}
1971 };
1972
1973 static const value_string tsinfo_direction[] = {
1974   {0x00, "Uplink"},
1975   {0x01, "Downlink"},
1976   {0x02, "Direct link"},
1977   {0x03, "Bidirectional link"},
1978   {0, NULL}
1979 };
1980
1981 static const value_string tsinfo_access[] = {
1982   {0x00, "Reserved"},
1983   {0x01, "EDCA"},
1984   {0x02, "HCCA"},
1985   {0x03, "HEMM"},
1986   {0, NULL}
1987 };
1988
1989 static const value_string qos_up[] = {
1990   {0x00, "Best Effort"},
1991   {0x01, "Background"},
1992   {0x02, "Spare"},
1993   {0x03, "Excellent Effort"},
1994   {0x04, "Controlled Load"},
1995   {0x05, "Video"},
1996   {0x06, "Voice"},
1997   {0x07, "Network Control"},
1998   {0, NULL}
1999 };
2000
2001 static const value_string classifier_type[] = {
2002   {0x00, "Ethernet parameters"},
2003   {0x01, "TCP/UDP IP parameters"},
2004   {0x02, "IEEE 802.1D/Q parameters"},
2005   {0, NULL}
2006 };
2007
2008 static const true_false_string ieee80211_block_ack_control_ack_policy_flag = {
2009     "Immediate Acknowledgement Required",
2010     "Sender Does Not Require Immediate Acknowledgement"
2011 };
2012
2013 static const value_string ieee80211_block_ack_request_type_flags[] = {
2014   {0x00, "Basic Block Ack Request"},
2015   {0x01, "Reserved"},
2016   {0x02, "Compressed Block Ack Request"},
2017   {0x03, "Multi-TID Block Ack Request"},
2018   {0x00, NULL}
2019 };
2020
2021 static const value_string ieee80211_block_ack_type_flags[] = {
2022   {0x00, "Basic Block Ack"},
2023   {0x01, "Reserved"},
2024   {0x02, "Compressed Block"},
2025   {0x03, "Multi-TID Block"},
2026   {0x00, NULL}
2027 };
2028
2029 static const value_string ft_action_codes[] = {
2030   {FT_ACTION_REQUEST, "FT Request"},
2031   {FT_ACTION_RESPONSE, "FT Response"},
2032   {FT_ACTION_CONFIRM, "FT Confirm"},
2033   {FT_ACTION_ACK, "FT Ack"},
2034   {0, NULL}
2035 };
2036
2037 static const value_string sa_query_action_codes[] = {
2038   {SA_QUERY_REQUEST, "SA Query Request"},
2039   {SA_QUERY_RESPONSE, "SA Query Response"},
2040   {0, NULL}
2041 };
2042
2043 static const value_string ieee80211_data_encap_payload_types[] = {
2044   {1, "Remote Request/Response"},
2045   {2, "TDLS"},
2046   {0, NULL}
2047 };
2048
2049 static const true_false_string qos_info_field_qack_flags = {
2050   "STAs/APs MIB attribute dot11QAckOptionImplemented is true",
2051   "STAs/APs MIB attribute dot11QAckOptionImplemented is false"
2052 };
2053
2054 static const true_false_string qos_info_field_more_data_ack_flags = {
2055   "STA can process Ack frames with More Data bit and will remain in the awake state.",
2056   "STA cannot process Ack frames with More Data bit in Frame Control field."
2057 };
2058
2059 static const true_false_string qos_info_field_queue_req_flags = {
2060   "AP can process a nonzero Queue Size subfield in the QoS Control field in QoS data frames",
2061   "AP cannot process Queue Size subfield in QoS data frames."
2062 };
2063
2064   /* 7.3.1.17 Table 19b-Settings of the Max SP Length subfield */
2065 static const value_string qos_info_field_max_sp_length_flags[] = {
2066   { 0x0, "QAP may deliver all buffered MSDUs and MMPDUs." },
2067   { 0x2, "QAP may deliver a maximum of two MSDUs and MMPDUs per SP." },
2068   { 0x1, "QAP may deliver a maximum of four MSDUs and MMPDUs per SP." },
2069   { 0x3, "QAP may deliver a maximum of six MSDUs and MMPDUs per SP." },
2070   { 0, NULL}
2071 };
2072
2073 static const true_false_string rsn_preauth_flags = {
2074   "Transmitter supports pre-authentication",
2075   "Transmitter does not support pre-authentication"
2076 };
2077
2078 static const true_false_string rsn_no_pairwise_flags = {
2079   "Transmitter cannot support WEP default key 0 simultaneously with "
2080   "Pairwise key",
2081   "Transmitter can support WEP default key 0 simultaneously with "
2082   "Pairwise key"
2083 };
2084
2085 static const value_string rsn_cap_replay_counter[] = {
2086   {0x00, "1 replay counter per PTKSA/GTKSA/STAKeySA"},
2087   {0x01, "2 replay counters per PTKSA/GTKSA/STAKeySA"},
2088   {0x02, "4 replay counters per PTKSA/GTKSA/STAKeySA"},
2089   {0x03, "16 replay counters per PTKSA/GTKSA/STAKeySA"},
2090   {0, NULL}
2091 };
2092
2093 static const true_false_string ht_ldpc_coding_flag = {
2094   "Transmitter supports receiving LDPC coded packets",
2095   "Transmitter does not support receiving LDPC coded packets"
2096 };
2097
2098 static const true_false_string ht_chan_width_flag = {
2099   "Transmitter supports 20MHz and 40MHz operation",
2100   "Transmitter only supports 20MHz operation"
2101 };
2102
2103 static const value_string ht_sm_pwsave_flag[] = {
2104   {0x00, "Static SM Power Save mode"},
2105   {0x01, "Dynamic SM Power Save mode"},
2106   {0x02, "Reserved"},
2107   {0x03, "SM Power Save disabled"},
2108   {0x00, NULL}
2109 };
2110
2111 static const true_false_string ht_green_flag = {
2112   "Transmitter is able to receive PPDUs with Green Field (GF) preamble",
2113   "Transmitter is not able to receive PPDUs with Green Field (GF) preamble"
2114 };
2115
2116 static const value_string ht_rx_stbc_flag[] = {
2117   {0x00, "No Rx STBC support"},
2118   {0x01, "Rx support of one spatial stream"},
2119   {0x02, "Rx support of one and two spatial streams"},
2120   {0x03, "Rx support of one, two, and three spatial streams"},
2121   {0x00, NULL}
2122 };
2123
2124   /* IEEE Stc 802.11ac/D3.1 */
2125
2126 static const value_string vht_max_mpdu_length_flag[] = {
2127   {0x00, "3 895"},
2128   {0x01, "7 991"},
2129   {0x02, "11 454"},
2130   {0x03, "Reserved"},
2131   {0x00, NULL}
2132 };
2133
2134 static const value_string vht_supported_chan_width_set_flag[] = {
2135   {0x00, "Neither 160MHz nor 80+80 supported"},
2136   {0x01, "160MHz supported"},
2137   {0x02, "160MHz and 80+80 Supported"},
2138   {0x03, "Reserved"},
2139   {0x00, NULL}
2140 };
2141
2142 static const value_string vht_rx_stbc_flag[] = {
2143   {0x00, "None"},
2144   {0x01, "1 Spatial Stream Supported"},
2145   {0x02, "1 to 2 Spatial Stream Supported"},
2146   {0x03, "1 to 3 Spatial Stream Supported"},
2147   {0x04, "1 to 4 Spatial Stream Supported"},
2148   {0x02, "160MHz and 80+80 Supported"},
2149   {0x05, "Reserved"},
2150   {0x06, "Reserved"},
2151   {0x07, "Reserved"},
2152   {0x00, NULL}
2153 };
2154
2155 static const value_string num_plus_one_3bit_flag[] = {
2156   {0x00, "1"},
2157   {0x01, "2"},
2158   {0x02, "3"},
2159   {0x03, "4"},
2160   {0x04, "5"},
2161   {0x05, "6"},
2162   {0x06, "7"},
2163   {0x07, "8"},
2164   {0x00, NULL}
2165 };
2166
2167 static const value_string vht_max_ampdu_flag[] = {
2168   {0x00, "8 191"},
2169   {0x01, "16 383"},
2170   {0x02, "32 767"},
2171   {0x03, "65,535"},
2172   {0x04, "131 071"},
2173   {0x05, "262 143"},
2174   {0x06, "524 287"},
2175   {0x07, "1 048 575"},
2176   {0x00, NULL}
2177 };
2178
2179 static const value_string vht_link_adapt_flag[] = {
2180   {0x00, "No Feedback"},
2181   {0x01, "Reserved (logically only solicited feedback)"},
2182   {0x02, "Unsolicited feedback only"},
2183   {0x03, "Both (can provide unsolicited feedback and respond to VHT MRQ)"},
2184   {0x00, NULL}
2185 };
2186
2187 static const value_string vht_supported_mcs_flag[] = {
2188   {0x00, "MCS 0-7"},
2189   {0x01, "MCS 0-8"},
2190   {0x02, "MCS 0-9"},
2191   {0x03, "Not Supported"},
2192   {0x00, NULL}
2193 };
2194
2195 static const value_string vht_op_channel_width_flag[] = {
2196   {0x00, "20 MHz or 40 MHz"},
2197   {0x01, "80 MHz"},
2198   {0x02, "160 MHz"},
2199   {0x03, "80+80 MHz"},
2200   {0x00, NULL}
2201 };
2202
2203
2204
2205 static const true_false_string ht_delayed_block_ack_flag = {
2206   "Transmitter supports HT-Delayed BlockAck",
2207   "Transmitter does not support HT-Delayed BlockAck"
2208 };
2209
2210 static const true_false_string ht_max_amsdu_flag = {
2211   "7935 bytes",
2212   "3839 bytes"
2213 };
2214
2215 static const true_false_string ht_dss_cck_40_flag = {
2216   "Will/Can use DSSS/CCK in 40 MHz",
2217   "Won't/Can't use of DSSS/CCK in 40 MHz"
2218 };
2219
2220 static const true_false_string ht_psmp_flag = {
2221   "Will/Can support PSMP operation",
2222   "Won't/Can't support PSMP operation"
2223 };
2224
2225 static const true_false_string ht_40_mhz_intolerant_flag = {
2226   "Use of 40 MHz transmissions restricted/disallowed",
2227   "Use of 40 MHz transmissions unrestricted/allowed"
2228 };
2229
2230 static const value_string ampduparam_mpdu_start_spacing_flags[] = {
2231   {0x00, "no restriction"},
2232   {0x01, "1/4 [usec]"},
2233   {0x02, "1/2 [usec]"},
2234   {0x03, "1 [usec]"},
2235   {0x04, "2 [usec]"},
2236   {0x05, "4 [usec]"},
2237   {0x06, "8 [usec]"},
2238   {0x07, "16 [usec]"},
2239   {0x00, NULL}
2240 };
2241
2242 static const true_false_string mcsset_tx_mcs_set_defined_flag = {
2243   "Defined",
2244   "Not Defined",
2245 };
2246
2247 static const true_false_string mcsset_tx_rx_mcs_set_not_equal_flag = {
2248   "Not Equal",
2249   "Equal",
2250 };
2251
2252 static const value_string mcsset_tx_max_spatial_streams_flags[] = {
2253   {0x00, "1 spatial stream"},
2254   {0x01, "2 spatial streams"},
2255   {0x02, "3 spatial streams"},
2256   {0x03, "4 spatial streams"},
2257   {0x00, NULL}
2258 };
2259
2260 static const value_string htex_transtime_flags[] = {
2261   {0x00, "No Transition"},
2262   {0x01, "400 usec"},
2263   {0x02, "1.5 msec"},
2264   {0x03, "5 msec"},
2265   {0x00, NULL}
2266 };
2267
2268 static const value_string htex_mcs_flags[] = {
2269   {0x00, "STA does not provide MCS feedback"},
2270   {0x01, "Reserved"},
2271   {0x02, "STA provides only unsolicited MCS feedback"},
2272   {0x03, "STA can provide MCS feedback in response to MRQ as well as unsolicited MCS feedback"},
2273   {0x00, NULL}
2274 };
2275
2276 static const value_string txbf_calib_flag[] = {
2277   {0x00, "incapable"},
2278   {0x01, "Limited involvement, cannot initiate"},
2279   {0x02, "Limited involvement, can initiate"},
2280   {0x03, "Fully capable"},
2281   {0x00, NULL}
2282 };
2283
2284 static const value_string txbf_feedback_flags[] = {
2285   {0x00, "not supported"},
2286   {0x01, "delayed feedback capable"},
2287   {0x02, "immediate feedback capable"},
2288   {0x03, "delayed and immediate feedback capable"},
2289   {0x00, NULL}
2290 };
2291
2292 static const value_string txbf_antenna_flags[] = {
2293   {0x00, "1 TX antenna sounding"},
2294   {0x01, "2 TX antenna sounding"},
2295   {0x02, "3 TX antenna sounding"},
2296   {0x03, "4 TX antenna sounding"},
2297   {0x00, NULL}
2298 };
2299
2300 static const value_string txbf_csi_max_rows_bf_flags[] = {
2301   {0x00, "1 row of CSI"},
2302   {0x01, "2 rows of CSI"},
2303   {0x02, "3 rows of CSI"},
2304   {0x03, "4 rows of CSI"},
2305   {0x00, NULL}
2306 };
2307
2308 static const value_string txbf_chan_est_flags[] = {
2309   {0x00, "1 space time stream"},
2310   {0x01, "2 space time streams"},
2311   {0x02, "3 space time streams"},
2312   {0x03, "4 space time streams"},
2313   {0x00, NULL}
2314 };
2315
2316 static const value_string txbf_min_group_flags[] = {
2317   {0x00, "No grouping supported"},
2318   {0x01, "Groups of 1,2 supported"},
2319   {0x02, "Groups of 1,4 supported"},
2320   {0x03, "Groups of 1,2,4 supported"},
2321   {0x00, NULL}
2322 };
2323
2324 static const value_string hta_ext_chan_offset_flag[] = {
2325   {0x00, "No Extension Channel"},
2326   {0x01, "Extension Channel above control channel"},
2327   {0x02, "Undefined"},
2328   {0x03, "Extension Channel below control channel"},
2329   {0x00, NULL}
2330 };
2331
2332 static const true_false_string hta_rec_tx_width_flag = {
2333   "Any channel width enabled",
2334   "Use 20MHz channel (control)"
2335 };
2336
2337 static const true_false_string hta_rifs_mode_flag = {
2338   "Use of RIFS permitted",
2339   "Use of RIFS prohibited"
2340 };
2341
2342 static const true_false_string hta_controlled_access_flag = {
2343   "Not only PSMP",
2344   "PSMP only"
2345 };
2346
2347 static const value_string hta_service_interval_flag[] = {
2348   {0x00, "5ms"},
2349   {0x01, "10ms"},
2350   {0x02, "15ms"},
2351   {0x03, "20ms"},
2352   {0x04, "25ms"},
2353   {0x05, "30ms"},
2354   {0x06, "35ms"},
2355   {0x07, "40ms"},
2356   {0x00, NULL}
2357 };
2358
2359 static const value_string hta_operating_mode_flag[] = {
2360   {0x00, "Pure HT, no protection"},
2361   {0x01, "There may be non-HT devices (control & ext channel)"},
2362   {0x02, "No non-HT is associated, but at least 1 20MHz is. protect on"},
2363   {0x03, "Mixed: no non-HT is associated, protect on"},
2364   {0x00, NULL}
2365 };
2366
2367 static const true_false_string hta_non_gf_devices_flag = {
2368   "All HT devices associated are GF capable",
2369   "One or More HT devices are not GF capable"
2370 };
2371
2372 static const true_false_string hta_dual_stbc_protection_flag = {
2373   "Dual CTS protections is used",
2374   "Regular use of RTS/CTS"
2375 };
2376
2377 static const true_false_string hta_secondary_beacon_flag = {
2378   "Secondary Beacon",
2379   "Primary Beacon"
2380 };
2381
2382 static const true_false_string hta_lsig_txop_protection_flag = {
2383   "Full Support",
2384   "Not full support"
2385 };
2386
2387 static const true_false_string hta_pco_active_flag = {
2388   "PCO is activated in the BSS",
2389   "PCO is not activated in the BSS"
2390 };
2391
2392 static const true_false_string hta_pco_phase_flag = {
2393   "Switch to 20MHz phase/keep 20MHz",
2394   "Switch to 40MHz phase/keep 40MHz"
2395 };
2396
2397 static const value_string ht_info_secondary_channel_offset_flags[] = {
2398   {0x00, "No secondary channel"},
2399   {0x01, "Secondary channel is above the primary channel"},
2400   {0x02, "Reserved"},
2401   {0x03, "Secondary channel is below the primary channel"},
2402   {0x00, NULL}
2403 };
2404
2405 static const true_false_string ht_info_channel_width_flag = {
2406   "Channel of any width supported",
2407   "20 MHz channel width only"
2408 };
2409
2410 static const true_false_string ht_info_rifs_mode_flag = {
2411   "Permitted",
2412   "Prohibited"
2413 };
2414
2415 static const true_false_string ht_info_psmp_stas_only_flag = {
2416   "Association requests are accepted from only PSMP capable STA",
2417   "Association requests are accepted regardless of PSMP capability"
2418 };
2419
2420 static const value_string ht_info_service_interval_granularity_flags[] = {
2421   {0x00, "5 ms"},
2422   {0x01, "10 ms"},
2423   {0x02, "15 ms"},
2424   {0x03, "20 ms"},
2425   {0x04, "25 ms"},
2426   {0x05, "30 ms"},
2427   {0x06, "35 ms"},
2428   {0x07, "40 ms"},
2429   {0x00, NULL}
2430 };
2431
2432 static const value_string ht_info_operating_mode_flags[] = {
2433   {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"},
2434   {0x01, "HT non-member protection mode"},
2435   {0x02, "Only HT STAs in the BSS, however, there exists at least one 20 MHz STA"},
2436   {0x03, "HT mixed mode"},
2437   {0x00, NULL}
2438 };
2439
2440 static const true_false_string ht_info_non_greenfield_sta_present_flag = {
2441   "One or more associated STAs are not greenfield capable",
2442   "All associated STAs are greenfield capable"
2443 };
2444
2445 static const true_false_string ht_info_transmit_burst_limit_flag = {
2446   "2.4 GHz - 6.16 ms | All other bands - 3.08 ms",
2447   "No limit"
2448 };
2449
2450 static const true_false_string ht_info_obss_non_ht_stas_present_flag = {
2451   "Use of protection for non-HT STAs by overlapping BSSs is needed",
2452   "Use of protection for non-HT STAs by overlapping BSSs is not needed"
2453 };
2454
2455 static const true_false_string ht_info_dual_beacon_flag = {
2456   "AP transmits a secondary beacon",
2457   "No second beacon is transmitted"
2458 };
2459
2460 static const true_false_string ht_info_dual_cts_protection_flag = {
2461   "Required",
2462   "Not required"
2463 };
2464
2465 static const true_false_string ht_info_secondary_beacon_flag = {
2466   "Secondary beacon",
2467   "Primary beacon"
2468 };
2469
2470 static const true_false_string ht_info_lsig_txop_protection_full_support_flag = {
2471   "All HT STAs in the BSS support L-SIG TXOP protection",
2472   "One or more HT STAs in the BSS do not support L-SIG TXOP protection"
2473 };
2474
2475 static const true_false_string ht_info_pco_phase_flag = {
2476   "Switch to or continue 40 MHz phase",
2477   "Switch to or continue 20 MHz phase"
2478 };
2479
2480 static const true_false_string htc_lac_trq_flag = {
2481   "Want sounding PPDU",
2482   "Don't want sounding PPDU"
2483 };
2484
2485 static const true_false_string htc_lac_mai_mrq_flag = {
2486   "MCS feedback requested",
2487   "No MCS feedback requested"
2488 };
2489
2490 static const value_string ieee80211_htc_lac_asel_command_flags[] = {
2491   {0x00, "Transmit Antenna Selection Sounding Indication (TXASSI)"},
2492   {0x01, "Transmit Antenna Selection Sounding Request (TXASSR)"},
2493   {0x02, "Receive Antenna Selection Sounding Indication (RXASSI)"},
2494   {0x03, "Receive Antenna Selection Sounding Request (RXASSR)"},
2495   {0x04, "Sounding Label"},
2496   {0x05, "No feedback, ASEL training failure"},
2497   {0x06, "Transmit Antenna Selection Sounding Indication (TXASSI) requesting feedback of explicit CSI"},
2498   {0x07, "Reserved"},
2499   {0x00, NULL}
2500 };
2501
2502 static const value_string ieee80211_htc_cal_pos_flags[] = {
2503   {0x00, "Not a calibration frame"},
2504   {0x01, "Calibration Start"},
2505   {0x02, "Sounding Response"},
2506   {0x03, "Sounding Complete"},
2507   {0x00, NULL}
2508 };
2509
2510 static const true_false_string ieee80211_htc_ndp_announcement_flag = {
2511   "NDP will follow",
2512   "No NDP will follow"
2513 };
2514
2515 static const value_string ieee80211_htc_csi_steering_flags[] = {
2516   {0x00, "No feedback required"},
2517   {0x01, "CSI"},
2518   {0x02, "Non-compressed Beamforming Feedback Matrix"},
2519   {0x03, "Compressed Beamforming Feedback Matrix"},
2520   {0x00, NULL}
2521 };
2522
2523 static const value_string ieee80211_tag_secondary_channel_offset_flags[] = {
2524   {0x00, "No Secondary Channel"},
2525   {0x01, "Above Primary Channel"},
2526   {0x02, "Reserved"},
2527   {0x03, "Below Primary Channel"},
2528   {0x00, NULL}
2529 };
2530
2531 #define BSS_BITMASK_UP0   0x0001
2532 #define BSS_BITMASK_UP1   0x0002
2533 #define BSS_BITMASK_UP2   0x0004
2534 #define BSS_BITMASK_UP3   0x0008
2535 #define BSS_BITMASK_UP4   0x0010
2536 #define BSS_BITMASK_UP5   0x0020
2537 #define BSS_BITMASK_UP6   0x0040
2538 #define BSS_BITMASK_UP7   0x0080
2539 #define BSS_BITMASK_AC0   0x0100
2540 #define BSS_BITMASK_AC1   0x0200
2541 #define BSS_BITMASK_AC2   0x0400
2542 #define BSS_BITMASK_AC3   0x0800
2543 #define BSS_BITMASK_RSV   0xF000
2544
2545 static const value_string ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags[] = {
2546   {0x00, "Frames may be transmitted before the channel switch has been completed"},
2547   {0x01, "No more frames are to be transmitted until the channel switch has been completed"},
2548   {0x00, NULL}
2549 };
2550
2551 static const value_string service_interval_granularity_vals[] = {
2552   { 0, "5 ms" },
2553   { 1, "10 ms" },
2554   { 2, "15 ms" },
2555   { 3, "20 ms" },
2556   { 4, "25 ms" },
2557   { 5, "30 ms" },
2558   { 6, "35 ms" },
2559   { 7, "40 ms" },
2560   { 0x00, NULL }
2561 };
2562
2563 static const value_string wep_type_vals[] = {
2564   { AIRPDCAP_KEY_TYPE_WEP, STRING_KEY_TYPE_WEP },
2565   { AIRPDCAP_KEY_TYPE_WPA_PWD, STRING_KEY_TYPE_WPA_PWD },
2566   { AIRPDCAP_KEY_TYPE_WPA_PSK, STRING_KEY_TYPE_WPA_PSK },
2567   { 0x00, NULL }
2568 };
2569
2570 static const value_string ieee80211_ht_pren_type_vals[] = {
2571   { 51,  "HT Capabilities (802.11n D1.10)" },
2572   { 52,  "HT Additional Capabilities (802.11n D1.00)" },
2573   { 0, NULL }
2574 };
2575
2576 static int proto_wlan = -1;
2577 static int proto_aggregate = -1;
2578 static gboolean ieee80211_tvb_invalid = FALSE;
2579
2580 /* ************************************************************************* */
2581 /*                Header field info values for FC-field                      */
2582 /* ************************************************************************* */
2583 static int hf_ieee80211_fc_field = -1;
2584 static int hf_ieee80211_fc_proto_version = -1;
2585 static int hf_ieee80211_fc_frame_type = -1;
2586 static int hf_ieee80211_fc_frame_subtype = -1;
2587 static int hf_ieee80211_fc_frame_type_subtype = -1;
2588
2589 static int hf_ieee80211_fc_flags = -1;
2590 static int hf_ieee80211_fc_to_ds = -1;
2591 static int hf_ieee80211_fc_from_ds = -1;
2592 static int hf_ieee80211_fc_data_ds = -1;
2593
2594 static int hf_ieee80211_fc_more_frag = -1;
2595 static int hf_ieee80211_fc_retry = -1;
2596 static int hf_ieee80211_fc_pwr_mgt = -1;
2597 static int hf_ieee80211_fc_more_data = -1;
2598 static int hf_ieee80211_fc_protected = -1;
2599 static int hf_ieee80211_fc_order = -1;
2600
2601 typedef struct retransmit_key {
2602   guint8  bssid[6];
2603   guint8  src[6];
2604   guint16 seq_control;
2605   guint   fnum;
2606 } retransmit_key;
2607
2608 static GHashTable *fc_analyse_retransmit_table = NULL;
2609 static GHashTable *fc_first_frame_table = NULL;
2610
2611 static int hf_ieee80211_fc_analysis_retransmission = -1;
2612 static int hf_ieee80211_fc_analysis_retransmission_frame = -1;
2613
2614 /* ************************************************************************* */
2615 /*                   Header values for Duration/ID field                     */
2616 /* ************************************************************************* */
2617 static int hf_ieee80211_did_duration = -1;
2618 static int hf_ieee80211_assoc_id = -1;
2619
2620 /* ************************************************************************* */
2621 /*         Header values for different address-fields (all 4 of them)        */
2622 /* ************************************************************************* */
2623 static int hf_ieee80211_addr_da = -1;  /* Destination address subfield */
2624 static int hf_ieee80211_addr_sa = -1;  /* Source address subfield */
2625 static int hf_ieee80211_addr_ra = -1;  /* Receiver address subfield */
2626 static int hf_ieee80211_addr_ta = -1;  /* Transmitter address subfield */
2627 static int hf_ieee80211_addr_bssid = -1;  /* address is bssid */
2628
2629 static int hf_ieee80211_addr = -1;  /* Source or destination address subfield */
2630
2631
2632 /* ************************************************************************* */
2633 /*                Header values for QoS control field                        */
2634 /* ************************************************************************* */
2635 static int hf_ieee80211_qos = -1;
2636 static int hf_ieee80211_qos_tid = -1;
2637 static int hf_ieee80211_qos_priority = -1;
2638 static int hf_ieee80211_qos_ack_policy = -1;
2639 static int hf_ieee80211_qos_amsdu_present = -1;
2640 static int hf_ieee80211_qos_eosp = -1;
2641 static int hf_ieee80211_qos_bit4 = -1;
2642 static int hf_ieee80211_qos_txop_limit = -1;
2643 static int hf_ieee80211_qos_ps_buf_state = -1;
2644 static int hf_ieee80211_qos_buf_state_indicated = -1;
2645 static int hf_ieee80211_qos_highest_pri_buf_ac = -1;
2646 static int hf_ieee80211_qos_qap_buf_load = -1;
2647 static int hf_ieee80211_qos_txop_dur_req = -1;
2648 static int hf_ieee80211_qos_queue_size = -1;
2649
2650 /* ************************************************************************* */
2651 /*                Header values for HT control field (+HTC)                  */
2652 /* ************************************************************************* */
2653 /* 802.11nD-1.10 & 802.11nD-2.0 7.1.3.5a */
2654 static int hf_ieee80211_htc = -1;
2655 static int hf_ieee80211_htc_lac = -1;
2656 static int hf_ieee80211_htc_lac_reserved = -1;
2657 static int hf_ieee80211_htc_lac_trq = -1;
2658 static int hf_ieee80211_htc_lac_mai_aseli = -1;
2659 static int hf_ieee80211_htc_lac_mai_mrq = -1;
2660 static int hf_ieee80211_htc_lac_mai_msi = -1;
2661 static int hf_ieee80211_htc_lac_mai_reserved = -1;
2662 static int hf_ieee80211_htc_lac_mfsi = -1;
2663 static int hf_ieee80211_htc_lac_mfb = -1;
2664 static int hf_ieee80211_htc_lac_asel_command = -1;
2665 static int hf_ieee80211_htc_lac_asel_data = -1;
2666 static int hf_ieee80211_htc_cal_pos = -1;
2667 static int hf_ieee80211_htc_cal_seq = -1;
2668 static int hf_ieee80211_htc_reserved1 = -1;
2669 static int hf_ieee80211_htc_csi_steering = -1;
2670 static int hf_ieee80211_htc_ndp_announcement = -1;
2671 static int hf_ieee80211_htc_reserved2 = -1;
2672 static int hf_ieee80211_htc_ac_constraint = -1;
2673 static int hf_ieee80211_htc_rdg_more_ppdu = -1;
2674
2675 /* ************************************************************************* */
2676 /*                Header values for sequence number field                    */
2677 /* ************************************************************************* */
2678 static int hf_ieee80211_frag_number = -1;
2679 static int hf_ieee80211_seq_number = -1;
2680
2681 /* ************************************************************************* */
2682 /*                   Header values for Frame Check field                     */
2683 /* ************************************************************************* */
2684 static int hf_ieee80211_fcs = -1;
2685 static int hf_ieee80211_fcs_good = -1;
2686 static int hf_ieee80211_fcs_bad = -1;
2687
2688 /* ************************************************************************* */
2689 /*                   Header values for reassembly                            */
2690 /* ************************************************************************* */
2691 static int hf_ieee80211_fragments = -1;
2692 static int hf_ieee80211_fragment = -1;
2693 static int hf_ieee80211_fragment_overlap = -1;
2694 static int hf_ieee80211_fragment_overlap_conflict = -1;
2695 static int hf_ieee80211_fragment_multiple_tails = -1;
2696 static int hf_ieee80211_fragment_too_long_fragment = -1;
2697 static int hf_ieee80211_fragment_error = -1;
2698 static int hf_ieee80211_fragment_count = -1;
2699 static int hf_ieee80211_reassembled_in = -1;
2700 static int hf_ieee80211_reassembled_length = -1;
2701
2702 static int proto_wlan_mgt = -1;
2703
2704 /* ************************************************************************* */
2705 /*                      Fixed fields found in mgt frames                     */
2706 /* ************************************************************************* */
2707 static int hf_ieee80211_fixed_parameters = -1;  /* Protocol payload for management frames */
2708
2709 static int hf_ieee80211_ff_auth_alg = -1;            /* Authentication algorithm field            */
2710 static int hf_ieee80211_ff_auth_seq = -1;            /* Authentication transaction sequence       */
2711 static int hf_ieee80211_ff_current_ap = -1;          /* Current AP MAC address                    */
2712 static int hf_ieee80211_ff_listen_ival = -1;         /* Listen interval fixed field               */
2713 static int hf_ieee80211_ff_timestamp = -1;           /* 64 bit timestamp                          */
2714 static int hf_ieee80211_ff_beacon_interval = -1;     /* 16 bit Beacon interval                    */
2715 static int hf_ieee80211_ff_assoc_id = -1;            /* 16 bit AID field                          */
2716 static int hf_ieee80211_ff_reason = -1;              /* 16 bit reason code                        */
2717 static int hf_ieee80211_ff_status_code = -1;         /* Status code                               */
2718 static int hf_ieee80211_ff_category_code = -1;       /* 8 bit Category code */
2719 static int hf_ieee80211_ff_action_code = -1;         /* 8 bit Action code */
2720 static int hf_ieee80211_ff_dialog_token = -1;        /* 8 bit Dialog token */
2721 static int hf_ieee80211_ff_wme_action_code = -1;     /* Management notification action code */
2722 static int hf_ieee80211_ff_wme_status_code = -1;     /* Management notification setup response status code */
2723 static int hf_ieee80211_ff_qos_action_code = -1;
2724 static int hf_ieee80211_ff_dls_action_code = -1;
2725 static int hf_ieee80211_ff_dst_mac_addr = -1;        /* DLS destination MAC addressi */
2726 static int hf_ieee80211_ff_src_mac_addr = -1;        /* DLS source MAC addressi */
2727 static int hf_ieee80211_ff_dls_timeout = -1;         /* DLS timeout value */
2728 static int hf_ieee80211_ff_ft_action_code = -1; /* 8 bit FT Action code */
2729 static int hf_ieee80211_ff_sta_address = -1;
2730 static int hf_ieee80211_ff_target_ap_address = -1;
2731 static int hf_ieee80211_ff_gas_comeback_delay = -1;
2732 static int hf_ieee80211_ff_gas_fragment_id = -1;
2733 static int hf_ieee80211_ff_more_gas_fragments = -1;
2734 static int hf_ieee80211_ff_query_request_length = -1;
2735 static int hf_ieee80211_ff_query_request = -1;
2736 static int hf_ieee80211_ff_query_response_length = -1;
2737 static int hf_ieee80211_ff_query_response = -1;
2738 static int hf_ieee80211_ff_anqp_info_id = -1;
2739 static int hf_ieee80211_ff_anqp_info_length = -1;
2740 static int hf_ieee80211_ff_anqp_info = -1;
2741 static int hf_ieee80211_ff_anqp_query_id = -1;
2742 static int hf_ieee80211_ff_anqp_capability = -1;
2743 static int hf_ieee80211_ff_anqp_capability_vlen = -1;
2744 static int hf_ieee80211_ff_anqp_capability_vendor = -1;
2745 static int hf_ieee80211_ff_venue_info_group = -1;
2746 static int hf_ieee80211_ff_venue_info_type = -1;
2747 static int hf_ieee80211_ff_anqp_venue_length = -1;
2748 static int hf_ieee80211_ff_anqp_venue_language = -1;
2749 static int hf_ieee80211_ff_anqp_venue_name = -1;
2750 static int hf_ieee80211_ff_anqp_nw_auth_type_indicator = -1;
2751 static int hf_ieee80211_ff_anqp_nw_auth_type_url_len = -1;
2752 static int hf_ieee80211_ff_anqp_nw_auth_type_url = -1;
2753 static int hf_ieee80211_ff_anqp_roaming_consortium_oi_len = -1;
2754 static int hf_ieee80211_ff_anqp_roaming_consortium_oi = -1;
2755 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv6 = -1;
2756 static int hf_ieee80211_ff_anqp_ip_addr_avail_ipv4 = -1;
2757 static int hf_ieee80211_ff_anqp_nai_realm_count = -1;
2758 static int hf_ieee80211_ff_anqp_nai_field_len = -1;
2759 static int hf_ieee80211_ff_anqp_nai_realm_encoding = -1;
2760 static int hf_ieee80211_ff_anqp_nai_realm_length = -1;
2761 static int hf_ieee80211_ff_anqp_nai_realm = -1;
2762 static int hf_ieee80211_ff_anqp_nai_realm_eap_count = -1;
2763 static int hf_ieee80211_ff_anqp_nai_realm_eap_len = -1;
2764 static int hf_ieee80211_ff_anqp_nai_realm_eap_method = -1;
2765 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_count = -1;
2766 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_id = -1;
2767 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_len = -1;
2768 static int hf_ieee80211_ff_anqp_nai_realm_auth_param_value = -1;
2769 static int hf_ieee80211_3gpp_gc_gud = -1;
2770 static int hf_ieee80211_3gpp_gc_udhl = -1;
2771 static int hf_ieee80211_3gpp_gc_iei = -1;
2772 static int hf_ieee80211_3gpp_gc_plmn_len = -1;
2773 static int hf_ieee80211_3gpp_gc_num_plmns = -1;
2774 static int hf_ieee80211_3gpp_gc_plmn = -1;
2775 static int hf_ieee80211_ff_anqp_domain_name_len = -1;
2776 static int hf_ieee80211_ff_anqp_domain_name = -1;
2777 static int hf_ieee80211_ff_tdls_action_code = -1;
2778 static int hf_ieee80211_ff_target_channel = -1;
2779 static int hf_ieee80211_ff_regulatory_class = -1;
2780 static int hf_ieee80211_ff_wnm_action_code = -1;
2781 static int hf_ieee80211_ff_key_data_length = -1;
2782 static int hf_ieee80211_ff_key_data = -1;
2783 static int hf_ieee80211_ff_wnm_notification_type = -1;
2784 static int hf_ieee80211_ff_request_mode_pref_cand = -1;
2785 static int hf_ieee80211_ff_request_mode_abridged = -1;
2786 static int hf_ieee80211_ff_request_mode_disassoc_imminent = -1;
2787 static int hf_ieee80211_ff_request_mode_bss_term_included = -1;
2788 static int hf_ieee80211_ff_request_mode_ess_disassoc_imminent = -1;
2789 static int hf_ieee80211_ff_disassoc_timer = -1;
2790 static int hf_ieee80211_ff_validity_interval = -1;
2791 static int hf_ieee80211_ff_url_len = -1;
2792 static int hf_ieee80211_ff_url = -1;
2793
2794 static int hf_ieee80211_ff_sa_query_action_code = -1;
2795 static int hf_ieee80211_ff_transaction_id = -1;
2796
2797 /* Vendor specific */
2798 static int hf_ieee80211_ff_marvell_action_type = -1;
2799 static int hf_ieee80211_ff_marvell_mesh_mgt_action_code = -1;
2800 static int hf_ieee80211_ff_marvell_mesh_mgt_length = -1;     /* Mesh Management length */
2801 static int hf_ieee80211_ff_marvell_mesh_mgt_mode = -1;       /* Mesh Management mode */
2802 static int hf_ieee80211_ff_marvell_mesh_mgt_ttl = -1;        /* Mesh Management TTL */
2803 static int hf_ieee80211_ff_marvell_mesh_mgt_dstcount = -1;   /* Mesh Management dst count */
2804 static int hf_ieee80211_ff_marvell_mesh_mgt_hopcount = -1;   /* Mesh Management hop count */
2805 static int hf_ieee80211_ff_marvell_mesh_mgt_rreqid = -1;     /* Mesh Management RREQ ID */
2806 static int hf_ieee80211_ff_marvell_mesh_mgt_sa = -1;         /* Mesh Management src addr */
2807 static int hf_ieee80211_ff_marvell_mesh_mgt_ssn = -1;        /* Mesh Management src sequence number */
2808 static int hf_ieee80211_ff_marvell_mesh_mgt_metric = -1;     /* Mesh Management metric */
2809 static int hf_ieee80211_ff_marvell_mesh_mgt_flags = -1;      /* Mesh Management RREQ flags */
2810 static int hf_ieee80211_ff_marvell_mesh_mgt_da = -1;         /* Mesh Management dst addr */
2811 static int hf_ieee80211_ff_marvell_mesh_mgt_dsn = -1;        /* Mesh Management dst sequence number */
2812 static int hf_ieee80211_ff_marvell_mesh_mgt_lifetime = -1;   /* Mesh Management lifetime */
2813
2814
2815 static int hf_ieee80211_ff_ba_action = -1;
2816
2817 static int hf_ieee80211_ff_block_ack_params = -1;
2818 static int hf_ieee80211_ff_block_ack_params_amsdu_permitted = -1;
2819 static int hf_ieee80211_ff_block_ack_params_policy = -1;
2820 static int hf_ieee80211_ff_block_ack_params_tid = -1;
2821 static int hf_ieee80211_ff_block_ack_params_buffer_size = -1;
2822
2823 static const int *ieee80211_ff_block_ack_params_fields[] = {
2824   &hf_ieee80211_ff_block_ack_params_amsdu_permitted,
2825   &hf_ieee80211_ff_block_ack_params_policy,
2826   &hf_ieee80211_ff_block_ack_params_tid,
2827   &hf_ieee80211_ff_block_ack_params_buffer_size,
2828   NULL
2829 };
2830
2831 static int hf_ieee80211_ff_block_ack_timeout = -1;
2832
2833 static int hf_ieee80211_ff_block_ack_ssc = -1;
2834 static int hf_ieee80211_ff_block_ack_ssc_fragment = -1;
2835 static int hf_ieee80211_ff_block_ack_ssc_sequence = -1;
2836
2837 static const int *ieee80211_ff_block_ack_ssc_fields[] = {
2838   &hf_ieee80211_ff_block_ack_ssc_fragment,
2839   &hf_ieee80211_ff_block_ack_ssc_sequence,
2840   NULL
2841 };
2842
2843 static int hf_ieee80211_ff_delba_param = -1;
2844 static int hf_ieee80211_ff_delba_param_reserved = -1;
2845 static int hf_ieee80211_ff_delba_param_init = -1;
2846 static int hf_ieee80211_ff_delba_param_tid = -1;
2847
2848 static const int *ieee80211_ff_delba_param_fields[] = {
2849   &hf_ieee80211_ff_delba_param_reserved,
2850   &hf_ieee80211_ff_delba_param_init,
2851   &hf_ieee80211_ff_delba_param_tid,
2852   NULL
2853 };
2854
2855 static int hf_ieee80211_ff_max_reg_pwr = -1;
2856 static int hf_ieee80211_ff_measurement_pilot_int = -1;
2857 static int hf_ieee80211_ff_country_str = -1;
2858 static int hf_ieee80211_ff_max_tx_pwr = -1;
2859 static int hf_ieee80211_ff_tx_pwr_used = -1;
2860 static int hf_ieee80211_ff_transceiver_noise_floor = -1;
2861 static int hf_ieee80211_ff_channel_width = -1;
2862
2863 static int hf_ieee80211_ff_qos_info_ap = -1;
2864 static int hf_ieee80211_ff_qos_info_ap_edca_param_set_counter = -1;
2865 static int hf_ieee80211_ff_qos_info_ap_q_ack = -1;
2866 static int hf_ieee80211_ff_qos_info_ap_queue_req = -1;
2867 static int hf_ieee80211_ff_qos_info_ap_txop_request = -1;
2868 static int hf_ieee80211_ff_qos_info_ap_reserved = -1;
2869
2870 static const int *ieee80211_ff_qos_info_ap_fields[] = {
2871   &hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
2872   &hf_ieee80211_ff_qos_info_ap_q_ack,
2873   &hf_ieee80211_ff_qos_info_ap_queue_req,
2874   &hf_ieee80211_ff_qos_info_ap_txop_request,
2875   &hf_ieee80211_ff_qos_info_ap_reserved,
2876   NULL
2877 };
2878
2879 static int hf_ieee80211_ff_qos_info_sta = -1;
2880 static int hf_ieee80211_ff_qos_info_sta_ac_vo = -1;
2881 static int hf_ieee80211_ff_qos_info_sta_ac_vi = -1;
2882 static int hf_ieee80211_ff_qos_info_sta_ac_bk = -1;
2883 static int hf_ieee80211_ff_qos_info_sta_ac_be = -1;
2884 static int hf_ieee80211_ff_qos_info_sta_q_ack = -1;
2885 static int hf_ieee80211_ff_qos_info_sta_max_sp_len = -1;
2886 static int hf_ieee80211_ff_qos_info_sta_more_data_ack = -1;
2887
2888 static const int *ieee80211_ff_qos_info_sta_fields[] = {
2889   &hf_ieee80211_ff_qos_info_sta_ac_vo,
2890   &hf_ieee80211_ff_qos_info_sta_ac_vi,
2891   &hf_ieee80211_ff_qos_info_sta_ac_bk,
2892   &hf_ieee80211_ff_qos_info_sta_ac_be,
2893   &hf_ieee80211_ff_qos_info_sta_q_ack,
2894   &hf_ieee80211_ff_qos_info_sta_max_sp_len,
2895   &hf_ieee80211_ff_qos_info_sta_more_data_ack,
2896   NULL
2897 };
2898
2899 static int hf_ieee80211_ff_sm_pwr_save = -1;
2900 static int hf_ieee80211_ff_sm_pwr_save_enabled = -1;
2901 static int hf_ieee80211_ff_sm_pwr_save_sm_mode = -1;
2902 static int hf_ieee80211_ff_sm_pwr_save_reserved = -1;
2903
2904 static const int *ieee80211_ff_sw_pwr_save_fields[] = {
2905   &hf_ieee80211_ff_sm_pwr_save_enabled,
2906   &hf_ieee80211_ff_sm_pwr_save_sm_mode,
2907   &hf_ieee80211_ff_sm_pwr_save_reserved,
2908   NULL
2909 };
2910
2911 static int hf_ieee80211_ff_pco_phase_cntrl = -1;
2912
2913 static int hf_ieee80211_ff_psmp_param_set = -1;
2914 static int hf_ieee80211_ff_psmp_param_set_n_sta = -1;
2915 static int hf_ieee80211_ff_psmp_param_set_more_psmp = -1;
2916 static int hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration = -1;
2917
2918 static const int *ieee80211_ff_psmp_param_set_fields[] = {
2919   &hf_ieee80211_ff_psmp_param_set_n_sta,
2920   &hf_ieee80211_ff_psmp_param_set_more_psmp,
2921   &hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
2922   NULL
2923 };
2924
2925 static int hf_ieee80211_ff_mimo_cntrl = -1;
2926 static int hf_ieee80211_ff_mimo_cntrl_nc_index = -1;
2927 static int hf_ieee80211_ff_mimo_cntrl_nr_index = -1;
2928 static int hf_ieee80211_ff_mimo_cntrl_channel_width = -1;
2929 static int hf_ieee80211_ff_mimo_cntrl_grouping = -1;
2930 static int hf_ieee80211_ff_mimo_cntrl_coefficient_size = -1;
2931 static int hf_ieee80211_ff_mimo_cntrl_codebook_info = -1;
2932 static int hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment = -1;
2933 static int hf_ieee80211_ff_mimo_cntrl_reserved = -1;
2934 static int hf_ieee80211_ff_mimo_cntrl_sounding_timestamp = -1;
2935
2936 static int hf_ieee80211_ff_ant_selection = -1;
2937 static int hf_ieee80211_ff_ant_selection_0 = -1;
2938 static int hf_ieee80211_ff_ant_selection_1 = -1;
2939 static int hf_ieee80211_ff_ant_selection_2 = -1;
2940 static int hf_ieee80211_ff_ant_selection_3 = -1;
2941 static int hf_ieee80211_ff_ant_selection_4 = -1;
2942 static int hf_ieee80211_ff_ant_selection_5 = -1;
2943 static int hf_ieee80211_ff_ant_selection_6 = -1;
2944 static int hf_ieee80211_ff_ant_selection_7 = -1;
2945
2946 static const int *ieee80211_ff_ant_selection_fields[] = {
2947   &hf_ieee80211_ff_ant_selection_0,
2948   &hf_ieee80211_ff_ant_selection_1,
2949   &hf_ieee80211_ff_ant_selection_2,
2950   &hf_ieee80211_ff_ant_selection_3,
2951   &hf_ieee80211_ff_ant_selection_4,
2952   &hf_ieee80211_ff_ant_selection_5,
2953   &hf_ieee80211_ff_ant_selection_6,
2954   &hf_ieee80211_ff_ant_selection_7,
2955   NULL
2956 };
2957
2958 static int hf_ieee80211_ff_ext_channel_switch_announcement = -1;
2959 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode = -1;
2960 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_reg_class = -1;
2961 static int hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number = -1;
2962 static int hf_ieee80211_ff_ext_channel_switch_announcement_switch_count = -1;
2963
2964 static const int *ieee80211_ff_ext_channel_switch_announcement_fields[] = {
2965   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
2966   &hf_ieee80211_ff_ext_channel_switch_announcement_new_reg_class,
2967   &hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
2968   &hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
2969   NULL
2970 };
2971
2972 static int hf_ieee80211_ff_ht_info = -1;
2973 static int hf_ieee80211_ff_ht_info_information_request = -1;
2974 static int hf_ieee80211_ff_ht_info_40_mhz_intolerant = -1;
2975 static int hf_ieee80211_ff_ht_info_sta_chan_width = -1;
2976 static int hf_ieee80211_ff_ht_info_reserved = -1;
2977
2978 static const int *ieee80211_ff_ht_info_fields[] = {
2979   &hf_ieee80211_ff_ht_info_information_request,
2980   &hf_ieee80211_ff_ht_info_40_mhz_intolerant,
2981   &hf_ieee80211_ff_ht_info_sta_chan_width,
2982   &hf_ieee80211_ff_ht_info_reserved,
2983   NULL
2984 };
2985
2986 static int hf_ieee80211_ff_ht_action = -1;
2987
2988 static int hf_ieee80211_ff_psmp_sta_info = -1;
2989 static int hf_ieee80211_ff_psmp_sta_info_type = -1;
2990 static int hf_ieee80211_ff_psmp_sta_info_dtt_start_offset = -1;
2991 static int hf_ieee80211_ff_psmp_sta_info_dtt_duration = -1;
2992 static int hf_ieee80211_ff_psmp_sta_info_sta_id = -1;
2993 static int hf_ieee80211_ff_psmp_sta_info_utt_start_offset = -1;
2994 static int hf_ieee80211_ff_psmp_sta_info_utt_duration = -1;
2995 static int hf_ieee80211_ff_psmp_sta_info_reserved_small= -1;
2996 static int hf_ieee80211_ff_psmp_sta_info_reserved_large = -1;
2997 static int hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id = -1;
2998
2999 static int hf_ieee80211_ff_mimo_csi_snr = -1;
3000
3001 /*** Begin: 802.11s additions ***/
3002 static int hf_ieee80211_mesh_control_field = -1;
3003
3004 static int hf_ieee80211_ff_mesh_action = -1;
3005 static int hf_ieee80211_ff_multihop_action = -1;
3006 static int hf_ieee80211_ff_mesh_flags = -1;
3007 static int hf_ieee80211_ff_mesh_ttl = -1;
3008 static int hf_ieee80211_ff_mesh_sequence = -1;
3009 static int hf_ieee80211_ff_mesh_addr4 = -1;
3010 static int hf_ieee80211_ff_mesh_addr5 = -1;
3011 static int hf_ieee80211_ff_mesh_addr6 = -1;
3012 static int hf_ieee80211_ff_selfprot_action = -1;
3013
3014 static int hf_ieee80211_mesh_peering_proto = -1;
3015 static int hf_ieee80211_mesh_peering_local_link_id = -1;
3016 static int hf_ieee80211_mesh_peering_peer_link_id = -1;
3017
3018 static int hf_ieee80211_ff_hwmp_flags = -1;
3019 static int hf_ieee80211_ff_hwmp_hopcount = -1;
3020 static int hf_ieee80211_ff_hwmp_ttl = -1;
3021 static int hf_ieee80211_ff_hwmp_pdid = -1;
3022 static int hf_ieee80211_ff_hwmp_orig_sta = -1;
3023 static int hf_ieee80211_ff_hwmp_orig_sn = -1;
3024 static int hf_ieee80211_ff_hwmp_orig_ext = -1;
3025 static int hf_ieee80211_ff_hwmp_lifetime = -1;
3026 static int hf_ieee80211_ff_hwmp_metric = -1;
3027 static int hf_ieee80211_ff_hwmp_targ_count = -1;
3028 static int hf_ieee80211_ff_hwmp_targ_flags = -1;
3029 static int hf_ieee80211_ff_hwmp_targ_to_flags = -1;
3030 static int hf_ieee80211_ff_hwmp_targ_usn_flags = -1;
3031 static int hf_ieee80211_ff_hwmp_targ_sta = -1;
3032 static int hf_ieee80211_ff_hwmp_targ_sn = -1;
3033 static int hf_ieee80211_ff_hwmp_targ_ext = -1;
3034 static int hf_ieee80211_rann_flags = -1;
3035 static int hf_ieee80211_rann_root_sta = -1;
3036 static int hf_ieee80211_rann_sn = -1;
3037 static int hf_ieee80211_rann_interval = -1;
3038
3039 static int hf_ieee80211_mesh_config_path_sel_protocol = -1;
3040 static int hf_ieee80211_mesh_config_path_sel_metric = -1;
3041 static int hf_ieee80211_mesh_config_congestion_control = -1;
3042 static int hf_ieee80211_mesh_config_sync_method = -1;
3043 static int hf_ieee80211_mesh_config_auth_protocol = -1;
3044 static int hf_ieee80211_mesh_config_formation_info = -1;
3045 static int hf_ieee80211_mesh_config_capability = -1;
3046 static int hf_ieee80211_mesh_id = -1;
3047
3048 static int hf_ieee80211_ff_public_action = -1;
3049
3050 /* ************************************************************************* */
3051 /*            Flags found in the capability field (fixed field)              */
3052 /* ************************************************************************* */
3053 static int hf_ieee80211_ff_capture = -1;
3054 static int hf_ieee80211_ff_cf_ess = -1;
3055 static int hf_ieee80211_ff_cf_ibss = -1;
3056 static int hf_ieee80211_ff_cf_sta_poll = -1; /* CF pollable status for a STA            */
3057 static int hf_ieee80211_ff_cf_ap_poll = -1;  /* CF pollable status for an AP            */
3058 static int hf_ieee80211_ff_cf_privacy = -1;
3059 static int hf_ieee80211_ff_cf_preamble = -1;
3060 static int hf_ieee80211_ff_cf_pbcc = -1;
3061 static int hf_ieee80211_ff_cf_agility = -1;
3062 static int hf_ieee80211_ff_short_slot_time = -1;
3063 static int hf_ieee80211_ff_dsss_ofdm = -1;
3064 static int hf_ieee80211_ff_cf_spec_man = -1;
3065 static int hf_ieee80211_ff_cf_apsd = -1;
3066 static int hf_ieee80211_ff_radio_measurement = -1;
3067 static int hf_ieee80211_ff_cf_del_blk_ack = -1;
3068 static int hf_ieee80211_ff_cf_imm_blk_ack = -1;
3069
3070 /* ************************************************************************* */
3071 /*                       A-MSDU fields                                       */
3072 /* ************************************************************************* */
3073 static int hf_ieee80211_amsdu_subframe = -1;
3074 static int hf_ieee80211_amsdu_length = -1;
3075
3076 /* ************************************************************************* */
3077 /*                       Tagged value format fields                          */
3078 /* ************************************************************************* */
3079 static int hf_ieee80211_tagged_parameters = -1;  /* Tagged payload item */
3080 static int hf_ieee80211_tag = -1;
3081 static int hf_ieee80211_tag_number = -1;
3082 static int hf_ieee80211_tag_length = -1;
3083 static int hf_ieee80211_tag_interpretation = -1;
3084 static int hf_ieee80211_tag_data = -1;
3085 static int hf_ieee80211_tag_oui = -1;
3086 static int hf_ieee80211_tag_ssid = -1;
3087 static int hf_ieee80211_tag_supp_rates = -1;
3088 static int hf_ieee80211_tag_fh_dwell_time = -1;
3089 static int hf_ieee80211_tag_fh_hop_set = -1;
3090 static int hf_ieee80211_tag_fh_hop_pattern = -1;
3091 static int hf_ieee80211_tag_fh_hop_index = -1;
3092 static int hf_ieee80211_tag_ds_param_channel = -1;
3093 static int hf_ieee80211_tag_cfp_count = -1;
3094 static int hf_ieee80211_tag_cfp_period = -1;
3095 static int hf_ieee80211_tag_cfp_max_duration = -1;
3096 static int hf_ieee80211_tag_cfp_dur_remaining = -1;
3097 static int hf_ieee80211_tim_dtim_count = -1;
3098 static int hf_ieee80211_tim_dtim_period = -1;
3099 static int hf_ieee80211_tim_bmapctl = -1;
3100 static int hf_ieee80211_tim_bmapctl_mcast = -1;
3101 static int hf_ieee80211_tim_bmapctl_offset = -1;
3102 static int hf_ieee80211_tim_partial_virtual_bitmap = -1;
3103 static int hf_ieee80211_tag_ibss_atim_window = -1;
3104 static int hf_ieee80211_tag_country_info_code = -1;
3105 static int hf_ieee80211_tag_country_info_env = -1;
3106 static int hf_ieee80211_tag_country_info_pad = -1;
3107 static int hf_ieee80211_tag_country_info_fnm = -1;
3108 static int hf_ieee80211_tag_country_info_fnm_fcn = -1;
3109 static int hf_ieee80211_tag_country_info_fnm_nc = -1;
3110 static int hf_ieee80211_tag_country_info_fnm_mtpl = -1;
3111 static int hf_ieee80211_tag_country_info_rrc = -1;
3112 static int hf_ieee80211_tag_country_info_rrc_rei = -1;
3113 static int hf_ieee80211_tag_country_info_rrc_rc = -1;
3114 static int hf_ieee80211_tag_country_info_rrc_cc = -1;
3115 static int hf_ieee80211_tag_fh_hopping_parameter_prime_radix = -1;
3116 static int hf_ieee80211_tag_fh_hopping_parameter_nb_channels = -1;
3117 static int hf_ieee80211_tag_fh_hopping_table_flag = -1;
3118 static int hf_ieee80211_tag_fh_hopping_table_number_of_sets = -1;
3119 static int hf_ieee80211_tag_fh_hopping_table_modulus = -1;
3120 static int hf_ieee80211_tag_fh_hopping_table_offset = -1;
3121 static int hf_ieee80211_tag_fh_hopping_random_table = -1;
3122 static int hf_ieee80211_tag_request = -1;
3123 static int hf_ieee80211_tag_challenge_text = -1;
3124
3125 static int hf_ieee80211_wep_iv = -1;
3126 static int hf_ieee80211_wep_iv_weak = -1;
3127 static int hf_ieee80211_tkip_extiv = -1;
3128 static int hf_ieee80211_ccmp_extiv = -1;
3129 static int hf_ieee80211_wep_key = -1;
3130 static int hf_ieee80211_wep_icv = -1;
3131
3132 static int hf_ieee80211_block_ack_request_control = -1;
3133 static int hf_ieee80211_block_ack_control = -1;
3134 static int hf_ieee80211_block_ack_control_ack_policy = -1;
3135 static int hf_ieee80211_block_ack_control_multi_tid = -1;
3136 static int hf_ieee80211_block_ack_control_compressed_bitmap = -1;
3137 static int hf_ieee80211_block_ack_control_reserved = -1;
3138
3139 static int hf_ieee80211_block_ack_control_basic_tid_info = -1;
3140 static int hf_ieee80211_block_ack_control_compressed_tid_info = -1;
3141 static int hf_ieee80211_block_ack_control_multi_tid_info = -1;
3142
3143 static int hf_ieee80211_block_ack_multi_tid_info = -1;
3144 static int hf_ieee80211_block_ack_request_type = -1;
3145 static int hf_ieee80211_block_ack_multi_tid_reserved = -1;
3146 static int hf_ieee80211_block_ack_multi_tid_value = -1;
3147 static int hf_ieee80211_block_ack_type = -1;
3148 static int hf_ieee80211_block_ack_bitmap = -1;
3149 static int hf_ieee80211_block_ack_bitmap_missing_frame = -1;
3150
3151 static int hf_ieee80211_tag_measure_request_measurement_mode = -1;
3152 static int hf_ieee80211_tag_measure_request_bssid = -1;
3153
3154 static int hf_ieee80211_tag_measure_request_subelement_length = -1;
3155 static int hf_ieee80211_tag_measure_request_beacon_sub_id = -1;
3156 static int hf_ieee80211_tag_measure_request_beacon_sub_ssid = -1;
3157 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition = -1;
3158 static int hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset = -1;
3159 static int hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail = -1;
3160 static int hf_ieee80211_tag_measure_request_beacon_sub_request = -1;
3161 static int hf_ieee80211_tag_measure_request_beacon_unknown = -1;
3162
3163 static int hf_ieee80211_tag_measure_request_frame_request_type = -1;
3164 static int hf_ieee80211_tag_measure_request_mac_address  = -1;
3165 static int hf_ieee80211_tag_measure_request_peer_mac_address = -1;
3166 static int hf_ieee80211_tag_measure_request_group_id = -1;
3167
3168 static int hf_ieee80211_ht_pren_type = -1;
3169 static int hf_ieee80211_ht_pren_unknown = -1;
3170
3171 static int hf_ieee80211_ht_cap = -1;
3172 static int hf_ieee80211_ht_vs_cap = -1;
3173 static int hf_ieee80211_ht_ldpc_coding = -1;
3174 static int hf_ieee80211_ht_chan_width = -1;
3175 static int hf_ieee80211_ht_sm_pwsave = -1;
3176 static int hf_ieee80211_ht_green = -1;
3177 static int hf_ieee80211_ht_short20 = -1;
3178 static int hf_ieee80211_ht_short40 = -1;
3179 static int hf_ieee80211_ht_tx_stbc = -1;
3180 static int hf_ieee80211_ht_rx_stbc = -1;
3181 static int hf_ieee80211_ht_delayed_block_ack = -1;
3182 static int hf_ieee80211_ht_max_amsdu = -1;
3183 static int hf_ieee80211_ht_dss_cck_40 = -1;
3184 static int hf_ieee80211_ht_psmp = -1;
3185 static int hf_ieee80211_ht_40_mhz_intolerant = -1;
3186 static int hf_ieee80211_ht_l_sig = -1;
3187
3188 static int hf_ieee80211_ampduparam = -1;
3189 static int hf_ieee80211_ampduparam_vs = -1;
3190 static int hf_ieee80211_ampduparam_mpdu = -1;
3191 static int hf_ieee80211_ampduparam_mpdu_start_spacing = -1;
3192 static int hf_ieee80211_ampduparam_reserved = -1;
3193
3194 static int hf_ieee80211_mcsset = -1;
3195 static int hf_ieee80211_mcsset_vs = -1;
3196 static int hf_ieee80211_mcsset_rx_bitmask = -1;
3197 static int hf_ieee80211_mcsset_rx_bitmask_0to7 = -1;
3198 static int hf_ieee80211_mcsset_rx_bitmask_8to15 = -1;
3199 static int hf_ieee80211_mcsset_rx_bitmask_16to23 = -1;
3200 static int hf_ieee80211_mcsset_rx_bitmask_24to31 = -1;
3201 static int hf_ieee80211_mcsset_rx_bitmask_32 = -1;
3202 static int hf_ieee80211_mcsset_rx_bitmask_33to38 = -1;
3203 static int hf_ieee80211_mcsset_rx_bitmask_39to52 = -1;
3204 static int hf_ieee80211_mcsset_rx_bitmask_53to76 = -1;
3205 static int hf_ieee80211_mcsset_highest_data_rate = -1;
3206 static int hf_ieee80211_mcsset_tx_mcs_set_defined = -1;
3207 static int hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal = -1;
3208 static int hf_ieee80211_mcsset_tx_max_spatial_streams = -1;
3209 static int hf_ieee80211_mcsset_tx_unequal_modulation = -1;
3210
3211 static int hf_ieee80211_htex_cap = -1;
3212 static int hf_ieee80211_htex_vs_cap = -1;
3213 static int hf_ieee80211_htex_pco = -1;
3214 static int hf_ieee80211_htex_transtime = -1;
3215 static int hf_ieee80211_htex_mcs = -1;
3216 static int hf_ieee80211_htex_htc_support = -1;
3217 static int hf_ieee80211_htex_rd_responder = -1;
3218
3219 static int hf_ieee80211_txbf = -1;
3220 static int hf_ieee80211_txbf_vs = -1;
3221 static int hf_ieee80211_txbf_cap = -1;
3222 static int hf_ieee80211_txbf_rcv_ssc = -1;
3223 static int hf_ieee80211_txbf_tx_ssc = -1;
3224 static int hf_ieee80211_txbf_rcv_ndp = -1;
3225 static int hf_ieee80211_txbf_tx_ndp = -1;
3226 static int hf_ieee80211_txbf_impl_txbf = -1;
3227 static int hf_ieee80211_txbf_calib = -1;
3228 static int hf_ieee80211_txbf_expl_csi = -1;
3229 static int hf_ieee80211_txbf_expl_uncomp_fm = -1;
3230 static int hf_ieee80211_txbf_expl_comp_fm = -1;
3231 static int hf_ieee80211_txbf_expl_bf_csi = -1;
3232 static int hf_ieee80211_txbf_expl_uncomp_fm_feed = -1;
3233 static int hf_ieee80211_txbf_expl_comp_fm_feed = -1;
3234 static int hf_ieee80211_txbf_csi_num_bf_ant = -1;
3235 static int hf_ieee80211_txbf_min_group = -1;
3236 static int hf_ieee80211_txbf_uncomp_sm_bf_ant = -1;
3237 static int hf_ieee80211_txbf_comp_sm_bf_ant = -1;
3238 static int hf_ieee80211_txbf_csi_max_rows_bf = -1;
3239 static int hf_ieee80211_txbf_chan_est = -1;
3240 static int hf_ieee80211_txbf_resrv = -1;
3241
3242 /*** Begin: 802.11n D1.10 - HT Information IE  ***/
3243 static int hf_ieee80211_ht_info_primary_channel = -1;
3244
3245 static int hf_ieee80211_ht_info_delimiter1 = -1;
3246 static int hf_ieee80211_ht_info_secondary_channel_offset = -1;
3247 static int hf_ieee80211_ht_info_channel_width = -1;
3248 static int hf_ieee80211_ht_info_rifs_mode = -1;
3249 static int hf_ieee80211_ht_info_psmp_stas_only = -1;
3250 static int hf_ieee80211_ht_info_service_interval_granularity = -1;
3251
3252 static int hf_ieee80211_ht_info_delimiter2 = -1;
3253 static int hf_ieee80211_ht_info_operating_mode = -1;
3254 static int hf_ieee80211_ht_info_non_greenfield_sta_present = -1;
3255 static int hf_ieee80211_ht_info_transmit_burst_limit = -1;
3256 static int hf_ieee80211_ht_info_obss_non_ht_stas_present = -1;
3257 static int hf_ieee80211_ht_info_reserved_1 = -1;
3258
3259 static int hf_ieee80211_ht_info_delimiter3 = -1;
3260 static int hf_ieee80211_ht_info_reserved_2 = -1;
3261 static int hf_ieee80211_ht_info_dual_beacon = -1;
3262 static int hf_ieee80211_ht_info_dual_cts_protection = -1;
3263 static int hf_ieee80211_ht_info_secondary_beacon = -1;
3264 static int hf_ieee80211_ht_info_lsig_txop_protection_full_support = -1;
3265 static int hf_ieee80211_ht_info_pco_active = -1;
3266 static int hf_ieee80211_ht_info_pco_phase = -1;
3267 static int hf_ieee80211_ht_info_reserved_3 = -1;
3268 /*** End: 802.11n D1.10 - HT Information IE  ***/
3269
3270 static int hf_ieee80211_tag_ap_channel_report_regulatory_class = -1;
3271 static int hf_ieee80211_tag_ap_channel_report_channel_list = -1;
3272
3273 static int hf_ieee80211_tag_secondary_channel_offset = -1;
3274
3275 static int hf_ieee80211_tag_bss_ap_avg_access_delay = -1;
3276
3277 static int hf_ieee80211_tag_antenna_id = -1;
3278
3279 static int hf_ieee80211_tag_rsni = -1;
3280
3281 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask = -1;
3282 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0 = -1;
3283 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1 = -1;
3284 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2 = -1;
3285 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3 = -1;
3286 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4 = -1;
3287 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5 = -1;
3288 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6 = -1;
3289 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7 = -1;
3290 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0 = -1;
3291 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1 = -1;
3292 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2 = -1;
3293 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3 = -1;
3294 static int hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv = -1;
3295 static int hf_ieee80211_tag_bss_avb_adm_cap_up0 = -1;
3296 static int hf_ieee80211_tag_bss_avb_adm_cap_up1 = -1;
3297 static int hf_ieee80211_tag_bss_avb_adm_cap_up2 = -1;
3298 static int hf_ieee80211_tag_bss_avb_adm_cap_up3 = -1;
3299 static int hf_ieee80211_tag_bss_avb_adm_cap_up4 = -1;
3300 static int hf_ieee80211_tag_bss_avb_adm_cap_up5 = -1;
3301 static int hf_ieee80211_tag_bss_avb_adm_cap_up6 = -1;
3302 static int hf_ieee80211_tag_bss_avb_adm_cap_up7 = -1;
3303 static int hf_ieee80211_tag_bss_avb_adm_cap_ac0 = -1;
3304 static int hf_ieee80211_tag_bss_avb_adm_cap_ac1 = -1;
3305 static int hf_ieee80211_tag_bss_avb_adm_cap_ac2 = -1;
3306 static int hf_ieee80211_tag_bss_avb_adm_cap_ac3 = -1;
3307
3308 static int hf_ieee80211_tag_bss_avg_ac_access_delay_be = -1;
3309 static int hf_ieee80211_tag_bss_avg_ac_access_delay_bk = -1;
3310 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vi = -1;
3311 static int hf_ieee80211_tag_bss_avg_ac_access_delay_vo = -1;
3312
3313 static int hf_ieee80211_tag_rm_enabled_capabilities = -1;
3314 static int hf_ieee80211_tag_rm_enabled_capabilities_b0 = -1;
3315 static int hf_ieee80211_tag_rm_enabled_capabilities_b1 = -1;
3316 static int hf_ieee80211_tag_rm_enabled_capabilities_b2 = -1;
3317 static int hf_ieee80211_tag_rm_enabled_capabilities_b3 = -1;
3318 static int hf_ieee80211_tag_rm_enabled_capabilities_b4 = -1;
3319 static int hf_ieee80211_tag_rm_enabled_capabilities_b5 = -1;
3320 static int hf_ieee80211_tag_rm_enabled_capabilities_b6 = -1;
3321 static int hf_ieee80211_tag_rm_enabled_capabilities_b7 = -1;
3322 static int hf_ieee80211_tag_rm_enabled_capabilities_b8 = -1;
3323 static int hf_ieee80211_tag_rm_enabled_capabilities_b9 = -1;
3324 static int hf_ieee80211_tag_rm_enabled_capabilities_b10 = -1;
3325 static int hf_ieee80211_tag_rm_enabled_capabilities_b11 = -1;
3326 static int hf_ieee80211_tag_rm_enabled_capabilities_b12 = -1;
3327 static int hf_ieee80211_tag_rm_enabled_capabilities_b13 = -1;
3328 static int hf_ieee80211_tag_rm_enabled_capabilities_b14 = -1;
3329 static int hf_ieee80211_tag_rm_enabled_capabilities_b15 = -1;
3330 static int hf_ieee80211_tag_rm_enabled_capabilities_b16 = -1;
3331 static int hf_ieee80211_tag_rm_enabled_capabilities_b17 = -1;
3332 static int hf_ieee80211_tag_rm_enabled_capabilities_b18to20 = -1;
3333 static int hf_ieee80211_tag_rm_enabled_capabilities_b21to23 = -1;
3334 static int hf_ieee80211_tag_rm_enabled_capabilities_b24to26 = -1;
3335 static int hf_ieee80211_tag_rm_enabled_capabilities_b27 = -1;
3336 static int hf_ieee80211_tag_rm_enabled_capabilities_b28 = -1;
3337 static int hf_ieee80211_tag_rm_enabled_capabilities_b29 = -1;
3338 static int hf_ieee80211_tag_rm_enabled_capabilities_b30 = -1;
3339 static int hf_ieee80211_tag_rm_enabled_capabilities_b31 = -1;
3340 static int hf_ieee80211_tag_rm_enabled_capabilities_b32 = -1;
3341 static int hf_ieee80211_tag_rm_enabled_capabilities_b33 = -1;
3342 static int hf_ieee80211_tag_rm_enabled_capabilities_o5 = -1;
3343
3344 static int hf_ieee80211_tag_power_constraint_local = -1;
3345
3346 static int hf_ieee80211_tag_power_capability_min = -1;
3347 static int hf_ieee80211_tag_power_capability_max = -1;
3348
3349 static int hf_ieee80211_tag_tpc_report_trsmt_pow = -1;
3350 static int hf_ieee80211_tag_tpc_report_link_mrg = -1;
3351
3352 static int hf_ieee80211_tag_supported_channels = -1;
3353 static int hf_ieee80211_tag_supported_channels_first = -1;
3354 static int hf_ieee80211_tag_supported_channels_range = -1;
3355
3356 static int hf_ieee80211_csa_channel_switch_mode = -1;
3357 static int hf_ieee80211_csa_new_channel_number = -1;
3358 static int hf_ieee80211_csa_channel_switch_count = -1;
3359
3360 static int hf_ieee80211_tag_measure_request_token = -1;
3361 static int hf_ieee80211_tag_measure_request_mode = -1;
3362 static int hf_ieee80211_tag_measure_request_mode_parallel = -1;
3363 static int hf_ieee80211_tag_measure_request_mode_enable = -1;
3364 static int hf_ieee80211_tag_measure_request_mode_request = -1;
3365 static int hf_ieee80211_tag_measure_request_mode_report = -1;
3366 static int hf_ieee80211_tag_measure_request_mode_duration_mandatory = -1;
3367 static int hf_ieee80211_tag_measure_request_mode_reserved = -1;
3368 static int hf_ieee80211_tag_measure_request_type = -1;
3369
3370 static int hf_ieee80211_tag_measure_request_channel_number = -1;
3371 static int hf_ieee80211_tag_measure_request_start_time = -1;
3372 static int hf_ieee80211_tag_measure_request_duration = -1;
3373
3374 static int hf_ieee80211_tag_measure_request_regulatory_class = -1;
3375 static int hf_ieee80211_tag_measure_request_randomization_interval = -1;
3376
3377 static int hf_ieee80211_tag_measure_report_measurement_token = -1;
3378 static int hf_ieee80211_tag_measure_report_mode = -1;
3379 static int hf_ieee80211_tag_measure_report_mode_late = -1;
3380 static int hf_ieee80211_tag_measure_report_mode_incapable = -1;
3381 static int hf_ieee80211_tag_measure_report_mode_refused = -1;
3382 static int hf_ieee80211_tag_measure_report_mode_reserved = -1;
3383 static int hf_ieee80211_tag_measure_report_type = -1;
3384 static int hf_ieee80211_tag_measure_report_channel_number = -1;
3385 static int hf_ieee80211_tag_measure_report_start_time = -1;
3386 static int hf_ieee80211_tag_measure_report_duration = -1;
3387
3388 static int hf_ieee80211_tag_measure_basic_map_field = -1;
3389 static int hf_ieee80211_tag_measure_map_field_bss = -1;
3390 static int hf_ieee80211_tag_measure_map_field_odfm = -1;
3391 static int hf_ieee80211_tag_measure_map_field_unident_signal = -1;
3392 static int hf_ieee80211_tag_measure_map_field_radar = -1;
3393 static int hf_ieee80211_tag_measure_map_field_unmeasured = -1;
3394 static int hf_ieee80211_tag_measure_map_field_reserved = -1;
3395
3396 static int hf_ieee80211_tag_measure_cca_busy_fraction = -1;
3397
3398 static int hf_ieee80211_tag_measure_rpi_histogram_report = -1;
3399 static int hf_ieee80211_tag_measure_rpi_histogram_report_0 = -1;
3400 static int hf_ieee80211_tag_measure_rpi_histogram_report_1 = -1;
3401 static int hf_ieee80211_tag_measure_rpi_histogram_report_2 = -1;
3402 static int hf_ieee80211_tag_measure_rpi_histogram_report_3 = -1;
3403 static int hf_ieee80211_tag_measure_rpi_histogram_report_4 = -1;
3404 static int hf_ieee80211_tag_measure_rpi_histogram_report_5 = -1;
3405 static int hf_ieee80211_tag_measure_rpi_histogram_report_6 = -1;
3406 static int hf_ieee80211_tag_measure_rpi_histogram_report_7 = -1;
3407
3408 static int hf_ieee80211_tag_measure_report_regulatory_class = -1;
3409 static int hf_ieee80211_tag_measure_report_channel_load = -1;
3410 static int hf_ieee80211_tag_measure_report_frame_info = -1;
3411 static int hf_ieee80211_tag_measure_report_frame_info_phy_type = -1;
3412 static int hf_ieee80211_tag_measure_report_frame_info_frame_type = -1;
3413 static int hf_ieee80211_tag_measure_report_rcpi = -1;
3414 static int hf_ieee80211_tag_measure_report_rsni = -1;
3415 static int hf_ieee80211_tag_measure_report_bssid = -1;
3416 static int hf_ieee80211_tag_measure_report_ant_id = -1;
3417 static int hf_ieee80211_tag_measure_report_anpi = -1;
3418 static int hf_ieee80211_tag_measure_report_ipi_density_0 = -1;
3419 static int hf_ieee80211_tag_measure_report_ipi_density_1 = -1;
3420 static int hf_ieee80211_tag_measure_report_ipi_density_2 = -1;
3421 static int hf_ieee80211_tag_measure_report_ipi_density_3 = -1;
3422 static int hf_ieee80211_tag_measure_report_ipi_density_4 = -1;
3423 static int hf_ieee80211_tag_measure_report_ipi_density_5 = -1;
3424 static int hf_ieee80211_tag_measure_report_ipi_density_6 = -1;
3425 static int hf_ieee80211_tag_measure_report_ipi_density_7 = -1;
3426 static int hf_ieee80211_tag_measure_report_ipi_density_8 = -1;
3427 static int hf_ieee80211_tag_measure_report_ipi_density_9 = -1;
3428 static int hf_ieee80211_tag_measure_report_ipi_density_10 = -1;
3429 static int hf_ieee80211_tag_measure_report_parent_tsf = -1;
3430
3431 static int hf_ieee80211_tag_quiet_count = -1;
3432 static int hf_ieee80211_tag_quiet_period = -1;
3433 static int hf_ieee80211_tag_quiet_duration = -1;
3434 static int hf_ieee80211_tag_quiet_offset = -1;
3435
3436 static int hf_ieee80211_tag_dfs_owner = -1;
3437 static int hf_ieee80211_tag_dfs_recovery_interval = -1;
3438 static int hf_ieee80211_tag_dfs_channel_map = -1;
3439 static int hf_ieee80211_tag_dfs_channel_number = -1;
3440 static int hf_ieee80211_tag_dfs_map = -1;
3441
3442 static int hf_ieee80211_tag_erp_info = -1;
3443 static int hf_ieee80211_tag_erp_info_erp_present = -1;
3444 static int hf_ieee80211_tag_erp_info_use_protection = -1;
3445 static int hf_ieee80211_tag_erp_info_barker_preamble_mode = -1;
3446 static int hf_ieee80211_tag_erp_info_reserved = -1;
3447
3448 static int hf_ieee80211_tag_extended_capabilities = -1;
3449 static int hf_ieee80211_tag_extended_capabilities_b0 = -1;
3450 static int hf_ieee80211_tag_extended_capabilities_b1 = -1;
3451 static int hf_ieee80211_tag_extended_capabilities_b2 = -1;
3452 static int hf_ieee80211_tag_extended_capabilities_b3 = -1;
3453 static int hf_ieee80211_tag_extended_capabilities_b4 = -1;
3454 static int hf_ieee80211_tag_extended_capabilities_b5 = -1;
3455 static int hf_ieee80211_tag_extended_capabilities_b6 = -1;
3456 static int hf_ieee80211_tag_extended_capabilities_b7 = -1;
3457 static int hf_ieee80211_tag_extended_capabilities_b8 = -1;
3458 static int hf_ieee80211_tag_extended_capabilities_b9 = -1;
3459 static int hf_ieee80211_tag_extended_capabilities_b10 = -1;
3460 static int hf_ieee80211_tag_extended_capabilities_b11 = -1;
3461 static int hf_ieee80211_tag_extended_capabilities_b12 = -1;
3462 static int hf_ieee80211_tag_extended_capabilities_b13 = -1;
3463 static int hf_ieee80211_tag_extended_capabilities_b14 = -1;
3464 static int hf_ieee80211_tag_extended_capabilities_b15 = -1;
3465 static int hf_ieee80211_tag_extended_capabilities_b16 = -1;
3466 static int hf_ieee80211_tag_extended_capabilities_b17 = -1;
3467 static int hf_ieee80211_tag_extended_capabilities_b18 = -1;
3468 static int hf_ieee80211_tag_extended_capabilities_b19 = -1;
3469 static int hf_ieee80211_tag_extended_capabilities_b20 = -1;
3470 static int hf_ieee80211_tag_extended_capabilities_b21 = -1;
3471 static int hf_ieee80211_tag_extended_capabilities_b22 = -1;
3472 static int hf_ieee80211_tag_extended_capabilities_b23 = -1;
3473 static int hf_ieee80211_tag_extended_capabilities_b24 = -1;
3474 static int hf_ieee80211_tag_extended_capabilities_b25 = -1;
3475 static int hf_ieee80211_tag_extended_capabilities_b26 = -1;
3476 static int hf_ieee80211_tag_extended_capabilities_b27 = -1;
3477 static int hf_ieee80211_tag_extended_capabilities_b28 = -1;
3478 static int hf_ieee80211_tag_extended_capabilities_b29 = -1;
3479 static int hf_ieee80211_tag_extended_capabilities_b30 = -1;
3480 static int hf_ieee80211_tag_extended_capabilities_b31 = -1;
3481 static int hf_ieee80211_tag_extended_capabilities_b32 = -1;
3482 static int hf_ieee80211_tag_extended_capabilities_b33 = -1;
3483 static int hf_ieee80211_tag_extended_capabilities_b34 = -1;
3484 static int hf_ieee80211_tag_extended_capabilities_b35 = -1;
3485 static int hf_ieee80211_tag_extended_capabilities_b36 = -1;
3486 static int hf_ieee80211_tag_extended_capabilities_b37 = -1;
3487 static int hf_ieee80211_tag_extended_capabilities_b38 = -1;
3488 static int hf_ieee80211_tag_extended_capabilities_b39 = -1;
3489 static int hf_ieee80211_tag_extended_capabilities_b40 = -1;
3490 static int hf_ieee80211_tag_extended_capabilities_serv_int_granularity = -1;
3491 static int hf_ieee80211_tag_extended_capabilities_b44 = -1;
3492 static int hf_ieee80211_tag_extended_capabilities_b45 = -1;
3493 static int hf_ieee80211_tag_extended_capabilities_b46 = -1;
3494 static int hf_ieee80211_tag_extended_capabilities_b47 = -1;
3495 static int hf_ieee80211_tag_extended_capabilities_b48 = -1;
3496 static int hf_ieee80211_tag_extended_capabilities_o7 = -1;
3497 static int hf_ieee80211_tag_extended_capabilities_o8 = -1;
3498
3499 static int hf_ieee80211_tag_cisco_ccx1_unknown = -1;
3500 static int hf_ieee80211_tag_cisco_ccx1_name = -1;
3501 static int hf_ieee80211_tag_cisco_ccx1_clients = -1;
3502 static int hf_ieee80211_tag_cisco_ccx1_unknown2 = -1;
3503
3504 static int hf_ieee80211_vht_cap = -1;
3505 static int hf_ieee80211_vht_max_mpdu_length = -1;
3506 static int hf_ieee80211_vht_supported_chan_width_set = -1;
3507 static int hf_ieee80211_vht_rx_ldpc = -1;
3508 static int hf_ieee80211_vht_short_gi_for_80 = -1;
3509 static int hf_ieee80211_vht_short_gi_for_160 = -1;
3510 static int hf_ieee80211_vht_tx_stbc = -1;
3511 static int hf_ieee80211_vht_rx_stbc = -1;
3512 static int hf_ieee80211_vht_su_beamformer_cap = -1;
3513 static int hf_ieee80211_vht_su_beamformee_cap = -1;
3514 static int hf_ieee80211_vht_beamformer_antennas = -1;
3515 static int hf_ieee80211_vht_sounding_dimensions = -1;
3516 static int hf_ieee80211_vht_mu_beamformer_cap = -1;
3517 static int hf_ieee80211_vht_mu_beamformee_cap = -1;
3518 static int hf_ieee80211_vht_txop_ps = -1;
3519 static int hf_ieee80211_vht_var_htc_field = -1;
3520 static int hf_ieee80211_vht_max_ampdu = -1;
3521 static int hf_ieee80211_vht_link_adaptation_cap = -1;
3522 static int hf_ieee80211_vht_rx_pattern = -1;
3523 static int hf_ieee80211_vht_tx_pattern = -1;
3524 static int hf_ieee80211_vht_reserv = -1;
3525
3526 static int hf_ieee80211_vht_mcsset = -1;
3527
3528 static int hf_ieee80211_vht_mcsset_rx_mcs_map = -1;
3529 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss = -1;
3530 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss = -1;
3531 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss = -1;
3532 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss = -1;
3533 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss = -1;
3534 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss = -1;
3535 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss = -1;
3536 static int hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss = -1;
3537
3538 static int hf_ieee80211_vht_mcsset_rx_highest_long_gi = -1;
3539
3540 static int hf_ieee80211_vht_mcsset_tx_mcs_map = -1;
3541 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss = -1;
3542 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss = -1;
3543 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss = -1;
3544 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss = -1;
3545 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss = -1;
3546 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss = -1;
3547 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss = -1;
3548 static int hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss = -1;
3549
3550 static int hf_ieee80211_vht_op = -1;
3551 static int hf_ieee80211_vht_op_channel_width = -1;
3552 static int hf_ieee80211_vht_op_channel_center0 = -1;
3553 static int hf_ieee80211_vht_op_channel_center1 = -1;
3554
3555 static int hf_ieee80211_vht_op_basic_mcs_map = -1;
3556 static int hf_ieee80211_vht_op_max_basic_mcs_for_1_ss = -1;
3557 static int hf_ieee80211_vht_op_max_basic_mcs_for_2_ss = -1;
3558 static int hf_ieee80211_vht_op_max_basic_mcs_for_3_ss = -1;
3559 static int hf_ieee80211_vht_op_max_basic_mcs_for_4_ss = -1;
3560 static int hf_ieee80211_vht_op_max_basic_mcs_for_5_ss = -1;
3561 static int hf_ieee80211_vht_op_max_basic_mcs_for_6_ss = -1;
3562 static int hf_ieee80211_vht_op_max_basic_mcs_for_7_ss = -1;
3563 static int hf_ieee80211_vht_op_max_basic_mcs_for_8_ss = -1;
3564
3565 static int hf_ieee80211_vht_mcsset_tx_highest_long_gi = -1;
3566
3567 static int hf_ieee80211_tag_neighbor_report_bssid = -1;
3568 static int hf_ieee80211_tag_neighbor_report_bssid_info = -1;
3569 static int hf_ieee80211_tag_neighbor_report_bssid_info_reachability = -1;
3570 static int hf_ieee80211_tag_neighbor_report_bssid_info_security = -1;
3571 static int hf_ieee80211_tag_neighbor_report_bssid_info_key_scope = -1;
3572 /*static int hf_ieee80211_tag_neighbor_report_bssid_info_capability = -1; */ /* TODO Make this the parent tree item */
3573 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng = -1;
3574 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos = -1;
3575 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd = -1;
3576 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt = -1;
3577 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback = -1;
3578 static int hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback = -1;
3579 static int hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain = -1;
3580 static int hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput = -1;
3581 static int hf_ieee80211_tag_neighbor_report_bssid_info_reserved = -1;
3582 static int hf_ieee80211_tag_neighbor_report_reg_class = -1;
3583 static int hf_ieee80211_tag_neighbor_report_channel_number = -1;
3584 static int hf_ieee80211_tag_neighbor_report_phy_type = -1;
3585
3586 static int hf_ieee80211_tag_supported_reg_classes_current = -1;
3587 static int hf_ieee80211_tag_supported_reg_classes_alternate = -1;
3588
3589 /* IEEE Std 802.11r-2008 7.3.2.47 */
3590 static int hf_ieee80211_tag_mobility_domain_mdid = -1;
3591 static int hf_ieee80211_tag_mobility_domain_ft_capab = -1;
3592 static int hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds = -1;
3593 static int hf_ieee80211_tag_mobility_domain_ft_capab_resource_req = -1;
3594
3595 /* IEEE Std 802.11r-2008 7.3.2.48 */
3596 static int hf_ieee80211_tag_ft_mic_control = -1;
3597 static int hf_ieee80211_tag_ft_element_count = -1;
3598 static int hf_ieee80211_tag_ft_mic = -1;
3599 static int hf_ieee80211_tag_ft_anonce = -1;
3600 static int hf_ieee80211_tag_ft_snonce = -1;
3601 static int hf_ieee80211_tag_ft_subelem_id = -1;
3602 static int hf_ieee80211_tag_ft_subelem_len = -1;
3603 static int hf_ieee80211_tag_ft_subelem_data = -1;
3604 static int hf_ieee80211_tag_ft_subelem_r1kh_id = -1;
3605 static int hf_ieee80211_tag_ft_subelem_gtk_key_info = -1;
3606 static int hf_ieee80211_tag_ft_subelem_gtk_key_id = -1;
3607 static int hf_ieee80211_tag_ft_subelem_gtk_key_length = -1;
3608 static int hf_ieee80211_tag_ft_subelem_gtk_rsc = -1;
3609 static int hf_ieee80211_tag_ft_subelem_gtk_key = -1;
3610 static int hf_ieee80211_tag_ft_subelem_r0kh_id = -1;
3611 static int hf_ieee80211_tag_ft_subelem_igtk_key_id = -1;
3612 static int hf_ieee80211_tag_ft_subelem_igtk_ipn = -1;
3613 static int hf_ieee80211_tag_ft_subelem_igtk_key_length = -1;
3614 static int hf_ieee80211_tag_ft_subelem_igtk_key = -1;
3615
3616 /* IEEE Std 802.11-2012: 11r 8.4.2.52 */
3617 static int hf_ieee80211_tag_ric_data_id = -1;
3618 static int hf_ieee80211_tag_ric_data_desc_cnt = -1;
3619 static int hf_ieee80211_tag_ric_data_status_code = -1;
3620
3621 /* IEEE Std 802.11-2012: 11r 8.4.2.53 */
3622 static int hf_ieee80211_tag_ric_desc_rsrc_type = -1;
3623 static int hf_ieee80211_tag_ric_desc_var_params = -1;
3624
3625 /* IEEE Std 802.11w-2009 7.3.2.55 */
3626 static int hf_ieee80211_tag_mmie_keyid = -1;
3627 static int hf_ieee80211_tag_mmie_ipn = -1;
3628 static int hf_ieee80211_tag_mmie_mic = -1;
3629
3630 /*WAPI-Specification 7.3.2.25 : WAPI Parameter Set*/
3631 static int hf_ieee80211_tag_wapi_param_set_version = -1;
3632
3633 static int hf_ieee80211_tag_wapi_param_set_akm_suite_count = -1;
3634 static int hf_ieee80211_tag_wapi_param_set_akm_suite_oui = -1;
3635 static int hf_ieee80211_tag_wapi_param_set_akm_suite_type = -1;
3636
3637 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count = -1;
3638 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui = -1;
3639 static int hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type = -1;
3640
3641 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui = -1;
3642 static int hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type = -1;
3643
3644 static int hf_ieee80211_tag_wapi_param_set_capab = -1;
3645 static int hf_ieee80211_tag_wapi_param_set_capab_preauth = -1;
3646 static int hf_ieee80211_tag_wapi_param_set_capab_rsvd = -1;
3647 static int hf_ieee80211_tag_wapi_param_set_bkid_count = -1;
3648 static int hf_ieee80211_tag_wapi_param_set_bkid_list = -1;
3649
3650 /* IEEE Std 802.11v-2011 7.3.2.61 */
3651 static int hf_ieee80211_tag_time_adv_timing_capab = -1;
3652 static int hf_ieee80211_tag_time_adv_time_value = -1;
3653 static int hf_ieee80211_tag_time_adv_time_value_year = -1;
3654 static int hf_ieee80211_tag_time_adv_time_value_month = -1;
3655 static int hf_ieee80211_tag_time_adv_time_value_day = -1;
3656 static int hf_ieee80211_tag_time_adv_time_value_hours = -1;
3657 static int hf_ieee80211_tag_time_adv_time_value_minutes = -1;
3658 static int hf_ieee80211_tag_time_adv_time_value_seconds = -1;
3659 static int hf_ieee80211_tag_time_adv_time_value_milliseconds = -1;
3660 static int hf_ieee80211_tag_time_adv_time_value_reserved = -1;
3661 static int hf_ieee80211_tag_time_adv_time_error = -1;
3662 static int hf_ieee80211_tag_time_adv_time_update_counter = -1;
3663
3664 /* IEEE Std 802.11-2012 8.4.2.81 */
3665 static int hf_ieee80211_tag_bss_max_idle_period = -1;
3666 static int hf_ieee80211_tag_bss_max_idle_options_protected = -1;
3667
3668 /* IEEE Std 802.11-2012 8.4.2.82 */
3669 static int hf_ieee80211_tag_tfs_request_id = -1;
3670 static int hf_ieee80211_tag_tfs_request_ac_delete_after_match = -1;
3671 static int hf_ieee80211_tag_tfs_request_ac_notify = -1;
3672 static int hf_ieee80211_tag_tfs_request_subelem_id = -1;
3673 static int hf_ieee80211_tag_tfs_request_subelem_len = -1;
3674 static int hf_ieee80211_tag_tfs_request_subelem = -1;
3675
3676 /* IEEE Std 802.11-2012 8.4.2.83 */
3677 static int hf_ieee80211_tag_tfs_response_subelem_id = -1;
3678 static int hf_ieee80211_tag_tfs_response_subelem_len = -1;
3679 static int hf_ieee80211_tag_tfs_response_subelem = -1;
3680 static int hf_ieee80211_tag_tfs_response_status = -1;
3681 static int hf_ieee80211_tag_tfs_response_id = -1;
3682
3683 /* IEEE Std 802.11-2012 8.4.2.84 */
3684 static int hf_ieee80211_tag_wnm_sleep_mode_action_type = -1;
3685 static int hf_ieee80211_tag_wnm_sleep_mode_response_status = -1;
3686 static int hf_ieee80211_tag_wnm_sleep_mode_interval = -1;
3687
3688 /* IEEE Std 802.11v-2011 7.3.2.87 */
3689 static int hf_ieee80211_tag_time_zone = -1;
3690
3691 /* IEEE Std 802.11u-2011 7.3.2.92 */
3692 static int hf_ieee80211_tag_interworking_access_network_type = -1;
3693 static int hf_ieee80211_tag_interworking_internet = -1;
3694 static int hf_ieee80211_tag_interworking_asra = -1;
3695 static int hf_ieee80211_tag_interworking_esr = -1;
3696 static int hf_ieee80211_tag_interworking_uesa = -1;
3697 static int hf_ieee80211_tag_interworking_hessid = -1;
3698
3699 /* IEEE Std 802.11u-2011 7.3.2.93 */
3700 static int hf_ieee80211_tag_adv_proto_resp_len_limit = -1;
3701 static int hf_ieee80211_tag_adv_proto_pame_bi = -1;
3702 static int hf_ieee80211_tag_adv_proto_id = -1;
3703
3704 /* IEEE Std 802.11u-2011 7.3.2.96 */
3705 static int hf_ieee80211_tag_roaming_consortium_num_anqp_oi = -1;
3706 static int hf_ieee80211_tag_roaming_consortium_oi1_len = -1;
3707 static int hf_ieee80211_tag_roaming_consortium_oi2_len = -1;
3708 static int hf_ieee80211_tag_roaming_consortium_oi1 = -1;
3709 static int hf_ieee80211_tag_roaming_consortium_oi2 = -1;
3710 static int hf_ieee80211_tag_roaming_consortium_oi3 = -1;
3711
3712 /* 802.11n 7.3.2.48 */
3713 static int hf_ieee80211_hta_cc = -1;
3714 static int hf_ieee80211_hta_cap = -1;
3715 static int hf_ieee80211_hta_ext_chan_offset = -1;
3716 static int hf_ieee80211_hta_rec_tx_width = -1;
3717 static int hf_ieee80211_hta_rifs_mode = -1;
3718 static int hf_ieee80211_hta_controlled_access = -1;
3719 static int hf_ieee80211_hta_service_interval = -1;
3720 static int hf_ieee80211_hta_operating_mode = -1;
3721 static int hf_ieee80211_hta_non_gf_devices = -1;
3722 static int hf_ieee80211_hta_basic_stbc_mcs = -1;
3723 static int hf_ieee80211_hta_dual_stbc_protection = -1;
3724 static int hf_ieee80211_hta_secondary_beacon = -1;
3725 static int hf_ieee80211_hta_lsig_txop_protection = -1;
3726 static int hf_ieee80211_hta_pco_active = -1;
3727 static int hf_ieee80211_hta_pco_phase = -1;
3728
3729 static int hf_ieee80211_antsel = -1;
3730 static int hf_ieee80211_antsel_vs = -1;
3731 static int hf_ieee80211_antsel_b0 = -1;
3732 static int hf_ieee80211_antsel_b1 = -1;
3733 static int hf_ieee80211_antsel_b2 = -1;
3734 static int hf_ieee80211_antsel_b3 = -1;
3735 static int hf_ieee80211_antsel_b4 = -1;
3736 static int hf_ieee80211_antsel_b5 = -1;
3737 static int hf_ieee80211_antsel_b6 = -1;
3738 static int hf_ieee80211_antsel_b7 = -1;
3739
3740 static int hf_ieee80211_rsn_version = -1;
3741 static int hf_ieee80211_rsn_gcs = -1;
3742 static int hf_ieee80211_rsn_gcs_oui = -1;
3743 static int hf_ieee80211_rsn_gcs_type = -1;
3744 static int hf_ieee80211_rsn_gcs_80211_type = -1;
3745 static int hf_ieee80211_rsn_pcs_count = -1;
3746 static int hf_ieee80211_rsn_pcs_list = -1;
3747 static int hf_ieee80211_rsn_pcs = -1;
3748 static int hf_ieee80211_rsn_pcs_oui = -1;
3749 static int hf_ieee80211_rsn_pcs_80211_type = -1;
3750 static int hf_ieee80211_rsn_pcs_type = -1;
3751 static int hf_ieee80211_rsn_akms_count = -1;
3752 static int hf_ieee80211_rsn_akms_list = -1;
3753 static int hf_ieee80211_rsn_akms = -1;
3754 static int hf_ieee80211_rsn_akms_oui = -1;
3755 static int hf_ieee80211_rsn_akms_80211_type = -1;
3756 static int hf_ieee80211_rsn_akms_type = -1;
3757 static int hf_ieee80211_rsn_cap = -1;
3758 static int hf_ieee80211_rsn_cap_preauth = -1;
3759 static int hf_ieee80211_rsn_cap_no_pairwise = -1;
3760 static int hf_ieee80211_rsn_cap_ptksa_replay_counter = -1;
3761 static int hf_ieee80211_rsn_cap_gtksa_replay_counter = -1;
3762 static int hf_ieee80211_rsn_cap_mfpr = -1;
3763 static int hf_ieee80211_rsn_cap_mfpc = -1;
3764 static int hf_ieee80211_rsn_cap_peerkey = -1;
3765 static int hf_ieee80211_rsn_pmkid_count = -1;
3766 static int hf_ieee80211_rsn_pmkid_list = -1;
3767 static int hf_ieee80211_rsn_pmkid = -1;
3768 static int hf_ieee80211_rsn_gmcs = -1;
3769 static int hf_ieee80211_rsn_gmcs_oui = -1;
3770 static int hf_ieee80211_rsn_gmcs_type = -1;
3771 static int hf_ieee80211_rsn_gmcs_80211_type = -1;
3772
3773 static int hf_ieee80211_wfa_ie_type = -1;
3774 static int hf_ieee80211_wfa_ie_wpa_version = -1;
3775 static int hf_ieee80211_wfa_ie_wpa_mcs = -1;
3776 static int hf_ieee80211_wfa_ie_wpa_mcs_oui = -1;
3777 static int hf_ieee80211_wfa_ie_wpa_mcs_type = -1;
3778 static int hf_ieee80211_wfa_ie_wpa_mcs_wfa_type = -1;
3779 static int hf_ieee80211_wfa_ie_wpa_ucs_count = -1;
3780 static int hf_ieee80211_wfa_ie_wpa_ucs_list = -1;
3781 static int hf_ieee80211_wfa_ie_wpa_ucs = -1;
3782 static int hf_ieee80211_wfa_ie_wpa_ucs_oui = -1;
3783 static int hf_ieee80211_wfa_ie_wpa_ucs_wfa_type = -1;
3784 static int hf_ieee80211_wfa_ie_wpa_ucs_type = -1;
3785 static int hf_ieee80211_wfa_ie_wpa_akms_count = -1;
3786 static int hf_ieee80211_wfa_ie_wpa_akms_list = -1;
3787 static int hf_ieee80211_wfa_ie_wpa_akms = -1;
3788 static int hf_ieee80211_wfa_ie_wpa_akms_oui = -1;
3789 static int hf_ieee80211_wfa_ie_wpa_akms_wfa_type = -1;
3790 static int hf_ieee80211_wfa_ie_wpa_akms_type = -1;
3791 static int hf_ieee80211_wfa_ie_wme_subtype = -1;
3792 static int hf_ieee80211_wfa_ie_wme_version = -1;
3793 static int hf_ieee80211_wfa_ie_wme_qos_info = -1;
3794 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length = -1;
3795 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be = -1;
3796 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk = -1;
3797 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi = -1;
3798 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo = -1;
3799 static int hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved = -1;
3800 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd = -1;
3801 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count = -1;
3802 static int hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved = -1;
3803 static int hf_ieee80211_wfa_ie_wme_reserved = -1;
3804 static int hf_ieee80211_wfa_ie_wme_ac_parameters = -1;
3805 static int hf_ieee80211_wfa_ie_wme_acp_aci_aifsn = -1;
3806 static int hf_ieee80211_wfa_ie_wme_acp_aci = -1;
3807 static int hf_ieee80211_wfa_ie_wme_acp_acm = -1;
3808 static int hf_ieee80211_wfa_ie_wme_acp_aifsn = -1;
3809 static int hf_ieee80211_wfa_ie_wme_acp_reserved = -1;
3810 static int hf_ieee80211_wfa_ie_wme_acp_ecw = -1;
3811 static int hf_ieee80211_wfa_ie_wme_acp_ecw_max = -1;
3812 static int hf_ieee80211_wfa_ie_wme_acp_ecw_min = -1;
3813 static int hf_ieee80211_wfa_ie_wme_acp_txop_limit = -1;
3814 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo = -1;
3815 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid = -1;
3816 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction = -1;
3817 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb = -1;
3818 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up = -1;
3819 static int hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved = -1;
3820 static int hf_ieee80211_wfa_ie_wme_tspec_nor_msdu = -1;
3821 static int hf_ieee80211_wfa_ie_wme_tspec_max_msdu = -1;
3822 static int hf_ieee80211_wfa_ie_wme_tspec_min_srv = -1;
3823 static int hf_ieee80211_wfa_ie_wme_tspec_max_srv = -1;
3824 static int hf_ieee80211_wfa_ie_wme_tspec_inact_int = -1;
3825 static int hf_ieee80211_wfa_ie_wme_tspec_susp_int = -1;
3826 static int hf_ieee80211_wfa_ie_wme_tspec_srv_start = -1;
3827 static int hf_ieee80211_wfa_ie_wme_tspec_min_data = -1;
3828 static int hf_ieee80211_wfa_ie_wme_tspec_mean_data = -1;
3829 static int hf_ieee80211_wfa_ie_wme_tspec_peak_data = -1;
3830 static int hf_ieee80211_wfa_ie_wme_tspec_burst_size = -1;
3831 static int hf_ieee80211_wfa_ie_wme_tspec_delay_bound = -1;
3832 static int hf_ieee80211_wfa_ie_wme_tspec_min_phy = -1;
3833 static int hf_ieee80211_wfa_ie_wme_tspec_surplus = -1;
3834 static int hf_ieee80211_wfa_ie_wme_tspec_medium = -1;
3835
3836 static int hf_ieee80211_aironet_ie_type = -1;
3837 static int hf_ieee80211_aironet_ie_version = -1;
3838 static int hf_ieee80211_aironet_ie_data = -1;
3839 static int hf_ieee80211_aironet_ie_qos_reserved = -1;
3840 static int hf_ieee80211_aironet_ie_qos_paramset = -1;
3841 static int hf_ieee80211_aironet_ie_qos_val = -1;
3842
3843 static int hf_ieee80211_vs_aruba_subtype = -1;
3844 static int hf_ieee80211_vs_aruba_apname = -1;
3845 static int hf_ieee80211_vs_aruba_data = -1;
3846
3847 static int hf_ieee80211_rsn_ie_pmkid = -1;
3848 static int hf_ieee80211_rsn_ie_unknown = -1;
3849
3850 static int hf_ieee80211_marvell_ie_type = -1;
3851 static int hf_ieee80211_marvell_ie_mesh_subtype = -1;
3852 static int hf_ieee80211_marvell_ie_mesh_version = -1;
3853 static int hf_ieee80211_marvell_ie_mesh_active_proto_id = -1;
3854 static int hf_ieee80211_marvell_ie_mesh_active_metric_id = -1;
3855 static int hf_ieee80211_marvell_ie_mesh_cap = -1;
3856 static int hf_ieee80211_marvell_ie_data = -1;
3857
3858 static int hf_ieee80211_atheros_ie_type = -1;
3859 static int hf_ieee80211_atheros_ie_subtype = -1;
3860 static int hf_ieee80211_atheros_ie_version = -1;
3861 static int hf_ieee80211_atheros_ie_cap_f_turbop = -1;
3862 static int hf_ieee80211_atheros_ie_cap_f_comp = -1;
3863 static int hf_ieee80211_atheros_ie_cap_f_ff = -1;
3864 static int hf_ieee80211_atheros_ie_cap_f_xr = -1;
3865 static int hf_ieee80211_atheros_ie_cap_f_ar = -1;
3866 static int hf_ieee80211_atheros_ie_cap_f_burst = -1;
3867 static int hf_ieee80211_atheros_ie_cap_f_wme = -1;
3868 static int hf_ieee80211_atheros_ie_cap_f_boost = -1;
3869 static int hf_ieee80211_atheros_ie_advcap_cap = -1;
3870 static int hf_ieee80211_atheros_ie_advcap_defkey = -1;
3871 static int hf_ieee80211_atheros_ie_xr_info = -1;
3872 static int hf_ieee80211_atheros_ie_xr_base_bssid = -1;
3873 static int hf_ieee80211_atheros_ie_xr_xr_bssid = -1;
3874 static int hf_ieee80211_atheros_ie_xr_xr_beacon = -1;
3875 static int hf_ieee80211_atheros_ie_xr_base_cap = -1;
3876 static int hf_ieee80211_atheros_ie_xr_xr_cap = -1;
3877 static int hf_ieee80211_atheros_ie_data = -1;
3878
3879 /*QBSS - Version 1,2,802.11e*/
3880
3881 static int hf_ieee80211_qbss2_cal = -1;
3882 static int hf_ieee80211_qbss2_gl = -1;
3883 static int hf_ieee80211_qbss_cu = -1;
3884 static int hf_ieee80211_qbss2_cu = -1;
3885 static int hf_ieee80211_qbss_scount = -1;
3886 static int hf_ieee80211_qbss2_scount = -1;
3887 static int hf_ieee80211_qbss_version = -1;
3888 static int hf_ieee80211_qbss_adc = -1;
3889
3890 static int hf_ieee80211_tsinfo = -1;
3891 static int hf_ieee80211_tsinfo_type = -1;
3892 static int hf_ieee80211_tsinfo_tsid = -1;
3893 static int hf_ieee80211_tsinfo_dir = -1;
3894 static int hf_ieee80211_tsinfo_access = -1;
3895 static int hf_ieee80211_tsinfo_agg = -1;
3896 static int hf_ieee80211_tsinfo_apsd = -1;
3897 static int hf_ieee80211_tsinfo_up = -1;
3898 static int hf_ieee80211_tsinfo_ack = -1;
3899 static int hf_ieee80211_tsinfo_sched = -1;
3900 static int hf_ieee80211_tsinfo_rsv = -1;
3901
3902 static const int *ieee80211_tsinfo_fields[] = {
3903   &hf_ieee80211_tsinfo_type,
3904   &hf_ieee80211_tsinfo_tsid,
3905   &hf_ieee80211_tsinfo_dir,
3906   &hf_ieee80211_tsinfo_access,
3907   &hf_ieee80211_tsinfo_agg,
3908   &hf_ieee80211_tsinfo_apsd,
3909   &hf_ieee80211_tsinfo_up,
3910   &hf_ieee80211_tsinfo_ack,
3911   &hf_ieee80211_tsinfo_sched,
3912   &hf_ieee80211_tsinfo_rsv,
3913   NULL
3914 };
3915
3916 static int hf_ieee80211_tspec_nor_msdu = -1;
3917 static int hf_ieee80211_tspec_max_msdu = -1;
3918 static int hf_ieee80211_tspec_min_srv = -1;
3919 static int hf_ieee80211_tspec_max_srv = -1;
3920 static int hf_ieee80211_tspec_inact_int = -1;
3921 static int hf_ieee80211_tspec_susp_int = -1;
3922 static int hf_ieee80211_tspec_srv_start = -1;
3923 static int hf_ieee80211_tspec_min_data = -1;
3924 static int hf_ieee80211_tspec_mean_data = -1;
3925 static int hf_ieee80211_tspec_peak_data = -1;
3926 static int hf_ieee80211_tspec_burst_size = -1;
3927 static int hf_ieee80211_tspec_delay_bound = -1;
3928 static int hf_ieee80211_tspec_min_phy = -1;
3929 static int hf_ieee80211_tspec_surplus = -1;
3930 static int hf_ieee80211_tspec_medium = -1;
3931 static int hf_ieee80211_ts_delay = -1;
3932 static int hf_ieee80211_tclas_process = -1;
3933 static int hf_ieee80211_tag_qos_cap_qos_info = -1;
3934 static int hf_ieee80211_qos_info_field_vo_uapsd = -1;
3935 static int hf_ieee80211_qos_info_field_vi_uapsd = -1;
3936 static int hf_ieee80211_qos_info_field_bk_uapsd = -1;
3937 static int hf_ieee80211_qos_info_field_be_uapsd = -1;
3938 static int hf_ieee80211_qos_info_field_qack = -1;
3939 static int hf_ieee80211_qos_info_field_max_sp_length = -1;
3940 static int hf_ieee80211_qos_info_field_more_data_ack = -1;
3941 static int hf_ieee80211_qos_info_field_edca_upd_cnt = -1;
3942 static int hf_ieee80211_qos_info_field_queue_req = -1;
3943 static int hf_ieee80211_qos_info_field_txop_req = -1;
3944 static int hf_ieee80211_qos_info_field_reserved = -1;
3945 static int hf_ieee80211_tag_ext_supp_rates = -1;
3946 static int hf_ieee80211_sched_info = -1;
3947 static int hf_ieee80211_sched_info_agg = -1;
3948 static int hf_ieee80211_sched_info_tsid = -1;
3949 static int hf_ieee80211_sched_info_dir = -1;
3950 static int hf_ieee80211_sched_srv_start = -1;
3951 static int hf_ieee80211_sched_srv_int = -1;
3952 static int hf_ieee80211_sched_spec_int = -1;
3953 static int hf_ieee80211_tclas_up = -1;
3954 static int hf_ieee80211_tclas_class_type = -1;
3955 static int hf_ieee80211_tclas_class_mask = -1;
3956 static int hf_ieee80211_tclas_class_mask0_src_addr = -1;
3957 static int hf_ieee80211_tclas_class_mask0_dst_addr = -1;
3958 static int hf_ieee80211_tclas_class_mask0_type = -1;
3959 static int hf_ieee80211_tclas_class_mask1_ver = -1;
3960 static int hf_ieee80211_tclas_class_mask1_src_ip = -1;
3961 static int hf_ieee80211_tclas_class_mask1_dst_ip = -1;
3962 static int hf_ieee80211_tclas_class_mask1_src_port = -1;
3963 static int hf_ieee80211_tclas_class_mask1_dst_port = -1;
3964 static int hf_ieee80211_tclas_class_mask1_ipv4_dscp = -1;
3965 static int hf_ieee80211_tclas_class_mask1_ipv4_proto = -1;
3966 static int hf_ieee80211_tclas_class_mask1_ipv6_flow = -1;
3967 static int hf_ieee80211_tclas_class_mask2_tci = -1;
3968 static int hf_ieee80211_tclas_src_mac_addr = -1;
3969 static int hf_ieee80211_tclas_dst_mac_addr = -1;
3970 static int hf_ieee80211_tclas_ether_type = -1;
3971 static int hf_ieee80211_tclas_version = -1;
3972 static int hf_ieee80211_tclas_ipv4_src = -1;
3973 static int hf_ieee80211_tclas_ipv4_dst = -1;
3974 static int hf_ieee80211_tclas_src_port = -1;
3975 static int hf_ieee80211_tclas_dst_port = -1;
3976 static int hf_ieee80211_tclas_dscp = -1;
3977 static int hf_ieee80211_tclas_protocol = -1;
3978 static int hf_ieee80211_tclas_ipv6_src = -1;
3979 static int hf_ieee80211_tclas_ipv6_dst = -1;
3980 static int hf_ieee80211_tclas_flow = -1;
3981 static int hf_ieee80211_tclas_tag_type = -1;
3982
3983 static int hf_ieee80211_aruba = -1;
3984 static int hf_ieee80211_aruba_hb_seq = -1;
3985 static int hf_ieee80211_aruba_mtu = -1;
3986
3987 static int hf_ieee80211_tag_vendor_oui_type = -1;
3988 static int hf_ieee80211_tag_vendor_data = -1;
3989
3990 /* IEEE Std 802.11z-2010 7.3.2.62 */
3991 static int hf_ieee80211_tag_link_id_bssid = -1;
3992 static int hf_ieee80211_tag_link_id_init_sta = -1;
3993 static int hf_ieee80211_tag_link_id_resp_sta = -1;
3994
3995 /* IEEE Std 802.11z-2010 7.3.2.63 */
3996 static int hf_ieee80211_tag_wakeup_schedule_offset = -1;
3997 static int hf_ieee80211_tag_wakeup_schedule_interval = -1;
3998 static int hf_ieee80211_tag_wakeup_schedule_awake_window_slots = -1;
3999 static int hf_ieee80211_tag_wakeup_schedule_max_awake_dur = -1;
4000 static int hf_ieee80211_tag_wakeup_schedule_idle_count = -1;
4001
4002 /* IEEE Std 802.11z-2010 7.3.2.64 */
4003 static int hf_ieee80211_tag_channel_switch_timing_switch_time = -1;
4004 static int hf_ieee80211_tag_channel_switch_timing_switch_timeout = -1;
4005
4006 /* IEEE Std 802.11z-2010 7.3.2.65 */
4007 static int hf_ieee80211_tag_pti_control_tid = -1;
4008 static int hf_ieee80211_tag_pti_control_sequence_control = -1;
4009
4010 /* IEEE Std 802.11z-2010 7.3.2.66 */
4011 static int hf_ieee80211_tag_pu_buffer_status_ac_bk = -1;
4012 static int hf_ieee80211_tag_pu_buffer_status_ac_be = -1;
4013 static int hf_ieee80211_tag_pu_buffer_status_ac_vi = -1;
4014 static int hf_ieee80211_tag_pu_buffer_status_ac_vo = -1;
4015
4016 /* IEEE Std 802.11r-2008 7.3.2.49 */
4017 static int hf_ieee80211_tag_timeout_int_type = -1;
4018 static int hf_ieee80211_tag_timeout_int_value = -1;
4019
4020 /* Ethertype 89-0d */
4021 static int hf_ieee80211_data_encap_payload_type = -1;
4022
4023 static int hf_ieee80211_anqp_wfa_subtype = -1;
4024
4025 /* Hotspot 2.0 */
4026 static int hf_hs20_indication_dgaf_disabled = -1;
4027
4028 static int hf_hs20_anqp_subtype = -1;
4029 static int hf_hs20_anqp_reserved = -1;
4030 static int hf_hs20_anqp_payload = -1;
4031 static int hf_hs20_anqp_hs_query_list = -1;
4032 static int hf_hs20_anqp_hs_capability_list = -1;
4033 static int hf_hs20_anqp_ofn_length = -1;
4034 static int hf_hs20_anqp_ofn_language = -1;
4035 static int hf_hs20_anqp_ofn_name = -1;
4036 static int hf_hs20_anqp_wan_metrics_link_status = -1;
4037 static int hf_hs20_anqp_wan_metrics_symmetric_link = -1;
4038 static int hf_hs20_anqp_wan_metrics_at_capacity = -1;
4039 static int hf_hs20_anqp_wan_metrics_reserved = -1;
4040 static int hf_hs20_anqp_wan_metrics_downlink_speed = -1;
4041 static int hf_hs20_anqp_wan_metrics_uplink_speed = -1;
4042 static int hf_hs20_anqp_wan_metrics_downlink_load = -1;
4043 static int hf_hs20_anqp_wan_metrics_uplink_load = -1;
4044 static int hf_hs20_anqp_wan_metrics_lmd = -1;
4045 static int hf_hs20_anqp_cc_proto_ip_proto = -1;
4046 static int hf_hs20_anqp_cc_proto_port_num = -1;
4047 static int hf_hs20_anqp_cc_proto_status = -1;
4048 static int hf_hs20_anqp_nai_hrq_count = -1;
4049 static int hf_hs20_anqp_nai_hrq_encoding_type = -1;
4050 static int hf_hs20_anqp_nai_hrq_length = -1;
4051 static int hf_hs20_anqp_nai_hrq_realm_name = -1;
4052 static int hf_hs20_anqp_oper_class_indic = -1;
4053
4054 /* ************************************************************************* */
4055 /*                               Protocol trees                              */
4056 /* ************************************************************************* */
4057 static gint ett_80211 = -1;
4058 static gint ett_proto_flags = -1;
4059 static gint ett_cap_tree = -1;
4060 static gint ett_fc_tree = -1;
4061 static gint ett_cntrl_wrapper_fc = -1;
4062 static gint ett_cntrl_wrapper_payload = -1;
4063 static gint ett_fragments = -1;
4064 static gint ett_fragment = -1;
4065 static gint ett_block_ack = -1;
4066 static gint ett_block_ack_bitmap = -1;
4067 static gint ett_ath_cap_tree = -1;
4068
4069
4070 static gint ett_80211_mgt = -1;
4071 static gint ett_fixed_parameters = -1;
4072 static gint ett_tagged_parameters = -1;
4073 static gint ett_tag_bmapctl_tree = -1;
4074 static gint ett_tag_country_fnm_tree = -1;
4075 static gint ett_tag_country_rcc_tree = -1;
4076 static gint ett_qos_parameters = -1;
4077 static gint ett_qos_ps_buf_state = -1;
4078 static gint ett_qos_info_field_tree = -1;
4079 static gint ett_wep_parameters = -1;
4080 static gint ett_msh_control = -1;
4081 static gint ett_hwmp_targ_flags_tree = -1;
4082
4083 static gint ett_rsn_gcs_tree = -1;
4084 static gint ett_rsn_pcs_tree = -1;
4085 static gint ett_rsn_sub_pcs_tree = -1;
4086 static gint ett_rsn_akms_tree = -1;
4087 static gint ett_rsn_sub_akms_tree = -1;
4088 static gint ett_rsn_cap_tree = -1;
4089 static gint ett_rsn_pmkid_tree = -1;
4090 static gint ett_rsn_gmcs_tree = -1;
4091
4092 static gint ett_wpa_mcs_tree = -1;
4093 static gint ett_wpa_ucs_tree = -1;
4094 static gint ett_wpa_sub_ucs_tree = -1;
4095 static gint ett_wpa_akms_tree = -1;
4096 static gint ett_wpa_sub_akms_tree = -1;
4097 static gint ett_wme_ac = -1;
4098 static gint ett_wme_aci_aifsn = -1;
4099 static gint ett_wme_ecw = -1;
4100 static gint ett_wme_qos_info = -1;
4101
4102 static gint ett_ht_cap_tree = -1;
4103 static gint ett_ampduparam_tree = -1;
4104 static gint ett_mcsset_tree = -1;
4105 static gint ett_mcsbit_tree = -1;
4106 static gint ett_htex_cap_tree = -1;
4107 static gint ett_txbf_tree = -1;
4108 static gint ett_antsel_tree = -1;
4109 static gint ett_hta_cap_tree = -1;
4110 static gint ett_hta_cap1_tree = -1;
4111 static gint ett_hta_cap2_tree = -1;
4112 static gint ett_htc_tree = -1;
4113
4114 static gint ett_vht_cap_tree = -1;
4115 static gint ett_vht_mcsset_tree = -1;
4116 static gint ett_vht_rx_mcsbit_tree = -1;
4117 static gint ett_vht_tx_mcsbit_tree = -1;
4118 static gint ett_vht_basic_mcsbit_tree = -1;
4119
4120 static gint ett_vht_op_tree = -1;
4121
4122 static gint ett_ht_info_delimiter1_tree = -1;
4123 static gint ett_ht_info_delimiter2_tree = -1;
4124 static gint ett_ht_info_delimiter3_tree = -1;
4125
4126 static gint ett_tag_measure_request_mode_tree = -1;
4127 static gint ett_tag_measure_request_type_tree = -1;
4128 static gint ett_tag_measure_report_mode_tree = -1;
4129 static gint ett_tag_measure_report_type_tree = -1;
4130 static gint ett_tag_measure_report_basic_map_tree = -1;
4131 static gint ett_tag_measure_report_rpi_tree = -1;
4132 static gint ett_tag_measure_report_frame_tree = -1;
4133 static gint ett_tag_bss_bitmask_tree = -1;
4134 static gint ett_tag_dfs_map_tree = -1;
4135 static gint ett_tag_erp_info_tree = -1;
4136 static gint ett_tag_ex_cap1 = -1;
4137 static gint ett_tag_ex_cap2 = -1;
4138 static gint ett_tag_ex_cap3 = -1;
4139 static gint ett_tag_ex_cap4 = -1;
4140 static gint ett_tag_ex_cap5 = -1;
4141 static gint ett_tag_ex_cap6 = -1;
4142 static gint ett_tag_ex_cap7 = -1;
4143 static gint ett_tag_ex_cap8 = -1;
4144
4145 static gint ett_tag_rm_cap1 = -1;
4146 static gint ett_tag_rm_cap2 = -1;
4147 static gint ett_tag_rm_cap3 = -1;
4148 static gint ett_tag_rm_cap4 = -1;
4149 static gint ett_tag_rm_cap5 = -1;
4150 static gint ett_tag_tclas_mask_tree = -1;
4151
4152 static gint ett_tag_supported_channels = -1;
4153
4154 static gint ett_tag_neighbor_report_bssid_info_tree = -1;
4155 static gint ett_tag_neighbor_report_bssid_info_capability_tree = -1;
4156 static gint ett_tag_neighbor_report_sub_tag_tree = -1;
4157
4158 static gint ett_tag_wapi_param_set_akm_tree = -1;
4159 static gint ett_tag_wapi_param_set_ucast_tree = -1;
4160 static gint ett_tag_wapi_param_set_mcast_tree = -1;
4161 static gint ett_tag_wapi_param_set_preauth_tree = -1;
4162
4163 static gint ett_tag_time_adv_tree = -1;
4164
4165 static gint ett_ff_ba_param_tree = -1;
4166 static gint ett_ff_ba_ssc_tree = -1;
4167 static gint ett_ff_delba_param_tree = -1;
4168 static gint ett_ff_qos_info = -1;
4169 static gint ett_ff_sm_pwr_save = -1;
4170 static gint ett_ff_psmp_param_set = -1;
4171 static gint ett_ff_mimo_cntrl = -1;
4172 static gint ett_ff_ant_sel = -1;
4173 static gint ett_mimo_report = -1;
4174 static gint ett_ff_chan_switch_announce = -1;
4175 static gint ett_ff_ht_info = -1;
4176 static gint ett_ff_psmp_sta_info = -1;
4177
4178 static gint ett_msdu_aggregation_parent_tree = -1;
4179 static gint ett_msdu_aggregation_subframe_tree = -1;
4180
4181 static gint ett_80211_mgt_ie = -1;
4182 static gint ett_tsinfo_tree = -1;
4183 static gint ett_sched_tree = -1;
4184
4185 static gint ett_fcs = -1;
4186
4187 static gint ett_adv_proto = -1;
4188 static gint ett_adv_proto_tuple = -1;
4189 static gint ett_gas_query = -1;
4190 static gint ett_gas_anqp = -1;
4191 static gint ett_nai_realm = -1;
4192 static gint ett_nai_realm_eap = -1;
4193 static gint ett_tag_ric_data_desc_ie = -1;
4194 static gint ett_anqp_vendor_capab = -1;
4195
4196 static gint ett_hs20_cc_proto_port_tuple = -1;
4197
4198 static gint ett_ssid_list = -1;
4199
4200 static const fragment_items frag_items = {
4201   &ett_fragment,
4202   &ett_fragments,
4203   &hf_ieee80211_fragments,
4204   &hf_ieee80211_fragment,
4205   &hf_ieee80211_fragment_overlap,
4206   &hf_ieee80211_fragment_overlap_conflict,
4207   &hf_ieee80211_fragment_multiple_tails,
4208   &hf_ieee80211_fragment_too_long_fragment,
4209   &hf_ieee80211_fragment_error,
4210   &hf_ieee80211_fragment_count,
4211   &hf_ieee80211_reassembled_in,
4212   &hf_ieee80211_reassembled_length,
4213   /* Reassembled data field */
4214   NULL,
4215   "fragments"
4216 };
4217
4218 static const enum_val_t wlan_ignore_wep_options[] = {
4219   { "no",         "No",               WLAN_IGNORE_WEP_NO    },
4220   { "without_iv", "Yes - without IV", WLAN_IGNORE_WEP_WO_IV },
4221   { "with_iv",    "Yes - with IV",    WLAN_IGNORE_WEP_W_IV  },
4222   { NULL,         NULL,               0                     }
4223 };
4224
4225 static dissector_handle_t ieee80211_handle;
4226 static dissector_handle_t llc_handle;
4227 static dissector_handle_t ipx_handle;
4228 static dissector_handle_t eth_withoutfcs_handle;
4229 static dissector_handle_t data_handle;
4230
4231 static int wlan_tap = -1;
4232
4233 static const value_string access_network_type_vals[] = {
4234   {  0, "Private network" },
4235   {  1, "Private network with guest access" },
4236   {  2, "Chargeable public network" },
4237   {  3, "Free public network" },
4238   {  4, "Personal device network" },
4239   {  5, "Emergency services only network" },
4240   { 14, "Test or experimental" },
4241   { 15, "Wildcard" },
4242   { 0, NULL }
4243 };
4244
4245 static const value_string adv_proto_id_vals[] = {
4246   {  0, "Access Network Query Protocol"},
4247   {  1, "MIH Information Service"},
4248   {  2, "MIH Command and Event Services Capability Discovery"},
4249   {  3, "Emergency Alert System (EAS)"},
4250   {  4, "Location-to-Service Translation Protocol"},
4251   {221, "Vendor Specific"},
4252   {0, NULL}
4253 };
4254
4255 static const value_string timeout_int_types[] = {
4256   {1, "Reassociation deadline interval (TUs)"},
4257   {2, "Key lifetime interval (seconds)"},
4258   {3, "Association Comeback time (TUs)"},
4259   {0, NULL}
4260 };
4261
4262 static const value_string tdls_action_codes[] = {
4263   {TDLS_SETUP_REQUEST,           "TDLS Setup Request"},
4264   {TDLS_SETUP_RESPONSE,          "TDLS Setup Response"},
4265   {TDLS_SETUP_CONFIRM,           "TDLS Setup Confirm"},
4266   {TDLS_TEARDOWN,                "TDLS Teardown"},
4267   {TDLS_PEER_TRAFFIC_INDICATION, "TDLS Peer Traffic Indication"},
4268   {TDLS_CHANNEL_SWITCH_REQUEST,  "TDLS Channel Switch Request"},
4269   {TDLS_CHANNEL_SWITCH_RESPONSE, "TDLS Channel Switch Response"},
4270   {TDLS_PEER_PSM_REQUEST,        "TDLS Peer PSM Request"},
4271   {TDLS_PEER_PSM_RESPONSE,       "TDLS Peer PSM Response"},
4272   {TDLS_PEER_TRAFFIC_RESPONSE,   "TDLS Peer Traffic Response"},
4273   {TDLS_DISCOVERY_REQUEST,       "TDLS Discovery Request"},
4274   {0, NULL}
4275 };
4276 static value_string_ext tdls_action_codes_ext = VALUE_STRING_EXT_INIT(tdls_action_codes);
4277
4278 AIRPDCAP_CONTEXT airpdcap_ctx;
4279
4280 #define PSMP_STA_INFO_BROADCAST 0
4281 #define PSMP_STA_INFO_MULTICAST 1
4282 #define PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED 2
4283
4284 #define PSMP_STA_INFO_FLAG_TYPE         0x00000003
4285 #define PSMP_STA_INFO_FLAG_DTT_START    0x00001FFC
4286 #define PSMP_STA_INFO_FLAG_DTT_DURATION 0x001FE000
4287
4288 #define PSMP_STA_INFO_FLAG_STA_ID       0x001FFFE0
4289
4290 #define PSMP_STA_INFO_FLAG_UTT_START    0x0000FFE0
4291 #define PSMP_STA_INFO_FLAG_UTT_DURATION 0x03FF0000
4292
4293 #define PSMP_STA_INFO_FLAG_IA_RESERVED  0xFC000000
4294
4295 static const value_string ff_psmp_sta_info_flags[] = {
4296   { PSMP_STA_INFO_BROADCAST,              "Broadcast"},
4297   { PSMP_STA_INFO_MULTICAST,              "Multicast"},
4298   { PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED, "Individually Addressed"},
4299   {0, NULL}
4300 };
4301
4302 static void
4303 beacon_interval_base_custom(gchar *result, guint32 beacon_interval)
4304 {
4305    double temp_double;
4306
4307    temp_double = (double)beacon_interval;
4308    g_snprintf(result, ITEM_LABEL_LENGTH, "%f [Seconds]", (temp_double * 1024 / 1000000));
4309 }
4310
4311 /* ************************************************************************* */
4312 /*            Return the length of the current header (in bytes)             */
4313 /* ************************************************************************* */
4314 static int
4315 find_header_length (guint16 fcf, guint16 ctrl_fcf, gboolean is_ht)
4316 {
4317   int     len;
4318   guint16 cw_fcf;
4319
4320   switch (FCF_FRAME_TYPE (fcf)) {
4321
4322   case MGT_FRAME:
4323     if (is_ht && IS_STRICTLY_ORDERED(FCF_FLAGS(fcf)))
4324       return MGT_FRAME_HDR_LEN + 4;
4325
4326     return MGT_FRAME_HDR_LEN;
4327
4328   case CONTROL_FRAME:
4329     if (COMPOSE_FRAME_TYPE(fcf) == CTRL_CONTROL_WRAPPER) {
4330       len = 6;
4331       cw_fcf = ctrl_fcf;
4332     } else {
4333       len = 0;
4334       cw_fcf = fcf;
4335     }
4336     switch (COMPOSE_FRAME_TYPE (cw_fcf)) {
4337
4338     case CTRL_CTS:
4339     case CTRL_ACKNOWLEDGEMENT:
4340       return len + 10;
4341
4342     case CTRL_RTS:
4343     case CTRL_PS_POLL:
4344     case CTRL_CFP_END:
4345     case CTRL_CFP_ENDACK:
4346     case CTRL_BLOCK_ACK_REQ:
4347     case CTRL_BLOCK_ACK:
4348       return len + 16;
4349     }
4350     return len + 4;  /* XXX */
4351
4352   case DATA_FRAME:
4353     len = (FCF_ADDR_SELECTOR(fcf) ==
4354       DATA_ADDR_T4) ? DATA_LONG_HDR_LEN : DATA_SHORT_HDR_LEN;
4355
4356     if (DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
4357       len += 2;
4358       if (is_ht && IS_STRICTLY_ORDERED(FCF_FLAGS(fcf))) {
4359         len += 4;
4360       }
4361     }
4362
4363     return len;
4364
4365   default:
4366     return 4;  /* XXX */
4367   }
4368 }
4369
4370 /* ************************************************************************* */
4371 /* Mesh Control field helper functions
4372  *
4373  * Per IEEE 802.11s Draft 12.0 section 7.2.2.1:
4374  *
4375  * The frame body consists of either:
4376  * The MSDU (or a fragment thereof), the Mesh Control field (if and only if the
4377  * frame is transmitted by a mesh STA and the Mesh Control Present subfield of
4378  * the QoS Control field is 1)...
4379  *
4380  * We need a stateful sniffer for that.  For now, use heuristics.
4381  *
4382  * Notably, only mesh data frames contain the Mesh Control field in the header.
4383  * Other frames that contain mesh control (i.e., multihop action frames) have
4384  * it deeper in the frame body where it can be definitively identified.
4385  * Further, mesh data frames always have to-ds and from-ds either 11 or 01.  We
4386  * use these facts to make our heuristics more reliable.
4387  * ************************************************************************* */
4388 static int
4389 has_mesh_control(guint16 fcf, guint16 qos_ctl, guint8 mesh_flags)
4390 {
4391   /* assume mesh control present if the QOS field's Mesh Control Present bit is
4392    * set, all reserved bits in the mesh_flags field are zero, and the address
4393    * extension mode is not a reserved value.
4394    */
4395   return (((FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T4) || (FCF_ADDR_SELECTOR(fcf) == DATA_ADDR_T2)) &&
4396           (QOS_MESH_CONTROL_PRESENT(qos_ctl)) &&
4397           ((mesh_flags & ~MESH_FLAGS_ADDRESS_EXTENSION) == 0) &&
4398           ((mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION) != MESH_FLAGS_ADDRESS_EXTENSION));
4399 }
4400
4401 static int
4402 find_mesh_control_length(guint8 mesh_flags)
4403 {
4404   return 6 + 6*(mesh_flags & MESH_FLAGS_ADDRESS_EXTENSION);
4405 }
4406
4407 static mimo_control_t
4408 get_mimo_control (tvbuff_t *tvb, int offset)
4409 {
4410   guint16        mimo;
4411   mimo_control_t output;
4412
4413   mimo = tvb_get_letohs (tvb, offset);
4414
4415   output.nc = (mimo & 0x0003) + 1;
4416   output.nr = ((mimo & 0x000C) >> 2) + 1;
4417   output.chan_width = (mimo & 0x0010) >> 4;
4418   output.coefficient_size = 4; /* XXX - Is this a good default? */
4419
4420   switch ((mimo & 0x0060) >> 5)
4421     {
4422       case 0:
4423         output.grouping = 1;
4424         break;
4425
4426       case 1:
4427         output.grouping = 2;
4428         break;
4429
4430       case 2:
4431         output.grouping = 4;
4432         break;
4433
4434       default:
4435         output.grouping = 1;
4436         break;
4437     }
4438
4439   switch ((mimo & 0x0180) >> 7)
4440     {
4441       case 0:
4442         output.coefficient_size = 4;
4443         break;
4444
4445       case 1:
4446         output.coefficient_size = 5;
4447         break;
4448
4449       case 2:
4450         output.coefficient_size = 6;
4451         break;
4452
4453       case 3:
4454         output.coefficient_size = 8;
4455         break;
4456     }
4457
4458   output.codebook_info = (mimo & 0x0600) >> 9;
4459   output.remaining_matrix_segment = (mimo & 0x3800) >> 11;
4460
4461   return output;
4462 }
4463
4464 static int
4465 get_mimo_na (guint8 nr, guint8 nc)
4466 {
4467   if ((nr == 2) && (nc == 1)) {
4468     return 2;
4469   } else if ((nr == 2) && (nc == 2)) {
4470     return 2;
4471   } else if ((nr == 3) && (nc == 1)) {
4472     return 4;
4473   } else if ((nr == 3) && (nc == 2)) {
4474     return 6;
4475   } else if ((nr == 3) && (nc == 3)) {
4476     return 6;
4477   } else if ((nr == 4) && (nc == 1)) {
4478     return 6;
4479   } else if ((nr == 4) && (nc == 2)) {
4480     return 10;
4481   } else if ((nr == 4) && (nc == 3)) {
4482     return 12;
4483   } else if ((nr == 4) && (nc == 4)) {
4484     return 12;
4485   } else{
4486     return 0;
4487   }
4488 }
4489
4490 static int
4491 get_mimo_ns (gboolean chan_width, guint8 output_grouping)
4492 {
4493   int ns = 0;
4494
4495   if (chan_width)
4496   {
4497     switch (output_grouping)
4498       {
4499         case 1:
4500           ns = 114;
4501           break;
4502
4503           case 2:
4504             ns = 58;
4505             break;
4506
4507           case 4:
4508             ns = 30;
4509             break;
4510
4511           default:
4512             ns = 0;
4513       }
4514   } else {
4515     switch (output_grouping)
4516       {
4517         case 1:
4518           ns = 56;
4519           break;
4520
4521         case 2:
4522           ns = 30;
4523           break;
4524
4525         case 4:
4526           ns = 16;
4527           break;
4528
4529         default:
4530           ns = 0;
4531       }
4532   }
4533
4534   return ns;
4535 }
4536
4537 static int
4538 add_mimo_csi_matrices_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
4539 {
4540   proto_item *snr_item;
4541   proto_tree *snr_tree;
4542   int         csi_matrix_size, start_offset;
4543   int         ns, i;
4544
4545   start_offset = offset;
4546   snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
4547   snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
4548
4549   for (i = 1; i <= mimo_cntrl.nr; i++)
4550   {
4551     guint8 snr;
4552
4553     snr = tvb_get_guint8(tvb, offset);
4554     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
4555                                snr, "Channel %d - Signal to Noise Ratio: 0x%02X", i, snr);
4556     offset += 1;
4557   }
4558
4559   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
4560   csi_matrix_size = ns*(3+(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size));
4561   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
4562   proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "CSI Matrices");
4563   offset += csi_matrix_size;
4564   return offset - start_offset;
4565 }
4566
4567 static int
4568 add_mimo_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
4569 {
4570   proto_item *snr_item;
4571   proto_tree *snr_tree;
4572   int         csi_matrix_size, start_offset;
4573   int         ns, i;
4574
4575   start_offset = offset;
4576   snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
4577   snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
4578
4579   for (i = 1; i <= mimo_cntrl.nc; i++)
4580   {
4581     guint8 snr;
4582
4583     snr = tvb_get_guint8(tvb, offset);
4584     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
4585                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
4586     offset += 1;
4587   }
4588
4589   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
4590   csi_matrix_size = ns*(2*mimo_cntrl.nc*mimo_cntrl.nr*mimo_cntrl.coefficient_size);
4591   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
4592   proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "Beamforming Feedback Matrices");
4593   offset += csi_matrix_size;
4594   return offset - start_offset;
4595 }
4596
4597 static int
4598 add_mimo_compressed_beamforming_feedback_report (proto_tree *tree, tvbuff_t *tvb, int offset, mimo_control_t mimo_cntrl)
4599 {
4600   proto_item *snr_item;
4601   proto_tree *snr_tree;
4602   int         csi_matrix_size, start_offset;
4603   int         ns, na, i;
4604
4605   start_offset = offset;
4606   snr_item = proto_tree_add_text(tree, tvb, offset, mimo_cntrl.nc, "Signal to Noise Ratio");
4607   snr_tree = proto_item_add_subtree (snr_item, ett_mimo_report);
4608
4609   for (i = 1; i <= mimo_cntrl.nc; i++)
4610   {
4611     guint8 snr;
4612
4613     snr = tvb_get_guint8(tvb, offset);
4614     proto_tree_add_uint_format(snr_tree, hf_ieee80211_ff_mimo_csi_snr, tvb, offset, 1,
4615                                snr, "Stream %d - Signal to Noise Ratio: 0x%02X", i, snr);
4616     offset += 1;
4617   }
4618
4619   na = get_mimo_na(mimo_cntrl.nr, mimo_cntrl.nc);
4620   ns = get_mimo_ns(mimo_cntrl.chan_width, mimo_cntrl.grouping);
4621   csi_matrix_size = ns*(na*((mimo_cntrl.codebook_info+1)*2 + 2)/2);
4622   csi_matrix_size = roundup2(csi_matrix_size, 8) / 8;
4623   proto_tree_add_text(tree, tvb, offset, csi_matrix_size, "Compressed Beamforming Feedback Matrices");
4624   offset += csi_matrix_size;
4625   return offset - start_offset;
4626 }
4627
4628 /* ************************************************************************* */
4629 /*          This is the capture function used to update packet counts        */
4630 /* ************************************************************************* */
4631 static void
4632 capture_ieee80211_common (const guchar * pd, int offset, int len,
4633                           packet_counts * ld, gboolean fixed_length_header,
4634                           gboolean datapad, gboolean is_ht)
4635 {
4636   guint16 fcf, hdr_length;
4637
4638   if (!BYTES_ARE_IN_FRAME(offset, len, 2)) {
4639     ld->other += 1;
4640     return;
4641   }
4642
4643   fcf = pletohs (&pd[offset]);
4644
4645   if (IS_PROTECTED(FCF_FLAGS(fcf)) && (wlan_ignore_wep == WLAN_IGNORE_WEP_NO)) {
4646     ld->other += 1;
4647     return;
4648   }
4649
4650   switch (COMPOSE_FRAME_TYPE (fcf)) {
4651
4652     case DATA:          /* We got a data frame */
4653     case DATA_CF_ACK:   /* Data with ACK */
4654     case DATA_CF_POLL:
4655     case DATA_CF_ACK_POLL:
4656     case DATA_QOS_DATA:
4657     {
4658       if (fixed_length_header) {
4659         hdr_length = DATA_LONG_HDR_LEN;
4660       } else {
4661         hdr_length = find_header_length (fcf, 0, is_ht);
4662         /* adjust the header length depending on the Mesh Control field */
4663         if ((FCF_FRAME_TYPE(fcf) == DATA_FRAME) &&
4664             DATA_FRAME_IS_QOS(COMPOSE_FRAME_TYPE(fcf))) {
4665
4666           guint8  mesh_flags = pd[hdr_length];
4667           guint16 qosoff     = hdr_length - 2;
4668           qosoff -= (is_ht ? 4 : 0);
4669           if (has_mesh_control(fcf, pletohs(&pd[qosoff]), mesh_flags)) {
4670             hdr_length += find_mesh_control_length(mesh_flags);
4671           }
4672         }
4673         if (datapad)
4674           hdr_length = roundup2(hdr_length, 4);
4675       }
4676       /* I guess some bridges take Netware Ethernet_802_3 frames,
4677          which are 802.3 frames (with a length field rather than
4678          a type field, but with no 802.2 header in the payload),
4679          and just stick the payload into an 802.11 frame.  I've seen
4680          captures that show frames of that sort.
4681
4682          We also handle some odd form of encapsulation in which a
4683          complete Ethernet frame is encapsulated within an 802.11
4684          data frame, with no 802.2 header.  This has been seen
4685          from some hardware.
4686
4687          On top of that, at least at some point it appeared that
4688          the OLPC XO sent out frames with two bytes of 0 between
4689          the "end" of the 802.11 header and the beginning of
4690          the payload.
4691
4692          So, if the packet doesn't start with 0xaa 0xaa:
4693
4694            we first use the same scheme that linux-wlan-ng does to detect
4695            those encapsulated Ethernet frames, namely looking to see whether
4696            the frame either starts with 6 octets that match the destination
4697            address from the 802.11 header or has 6 octets that match the
4698            source address from the 802.11 header following the first 6 octets,
4699            and, if so, treat it as an encapsulated Ethernet frame;
4700
4701            otherwise, we use the same scheme that we use in the Ethernet
4702            dissector to recognize Netware 802.3 frames, namely checking
4703            whether the packet starts with 0xff 0xff and, if so, treat it
4704            as an encapsulated IPX frame, and then check whether the
4705            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
4706            frame. */
4707       if (!BYTES_ARE_IN_FRAME(offset+hdr_length, len, 2)) {
4708         ld->other += 1;
4709         return;
4710       }
4711       if ((pd[offset+hdr_length] != 0xaa) && (pd[offset+hdr_length+1] != 0xaa)) {
4712 #if 0
4713         /* XXX - this requires us to parse the header to find the source
4714            and destination addresses. */
4715         if (BYTES_ARE_IN_FRAME(offset+hdr_length, len, 12)) {
4716             /* We have two MAC addresses after the header. */
4717             if ((memcmp(&pd[offset+hdr_length+6], pinfo->dl_src.data, 6) == 0) ||
4718                 (memcmp(&pd[offset+hdr_length+6], pinfo->dl_dst.data, 6) == 0)) {
4719               capture_eth (pd, offset + hdr_length, len, ld);
4720               return;
4721             }
4722         }
4723 #endif
4724         if ((pd[offset+hdr_length] == 0xff) && (pd[offset+hdr_length+1] == 0xff))
4725           capture_ipx (ld);
4726         else if ((pd[offset+hdr_length] == 0x00) && (pd[offset+hdr_length+1] == 0x00))
4727           capture_llc (pd, offset + hdr_length + 2, len, ld);
4728       }
4729       else {
4730         capture_llc (pd, offset + hdr_length, len, ld);
4731       }
4732       break;
4733     }
4734
4735     default:
4736       ld->other += 1;
4737       break;
4738   }
4739 }
4740
4741 /*
4742  * Handle 802.11 with a variable-length link-layer header.
4743  */
4744 void
4745 capture_ieee80211 (const guchar * pd, int offset, int len, packet_counts * ld)
4746 {
4747   capture_ieee80211_common (pd, offset, len, ld, FALSE, FALSE, FALSE);
4748 }
4749
4750 /*
4751  * Handle 802.11 with a variable-length link-layer header and data padding.
4752  */
4753 void
4754 capture_ieee80211_datapad (const guchar * pd, int offset, int len,
4755                            packet_counts * ld)
4756 {
4757   capture_ieee80211_common (pd, offset, len, ld, FALSE, TRUE, FALSE);
4758 }
4759
4760 /*
4761  * Handle 802.11 with a fixed-length link-layer header (padded to the
4762  * maximum length).
4763  */
4764 void
4765 capture_ieee80211_fixed (const guchar * pd, int offset, int len, packet_counts * ld)
4766 {
4767   capture_ieee80211_common (pd, offset, len, ld, TRUE, FALSE, FALSE);
4768 }
4769
4770 /*
4771  * Handle an HT 802.11 with a variable-length link-layer header.
4772  */
4773 void
4774 capture_ieee80211_ht (const guchar * pd, int offset, int len, packet_counts * ld)
4775 {
4776   capture_ieee80211_common (pd, offset, len, ld, FALSE, FALSE, TRUE);
4777 }
4778
4779
4780 /* ************************************************************************* */
4781 /*          Add the subtree used to store the fixed parameters               */
4782 /* ************************************************************************* */
4783 static proto_tree *
4784 get_fixed_parameter_tree (proto_tree * tree, tvbuff_t *tvb, int start, int size)
4785 {
4786   proto_item *fixed_fields;
4787
4788   fixed_fields = proto_tree_add_item (tree, hf_ieee80211_fixed_parameters, tvb, start, size, ENC_NA);
4789   proto_item_append_text(fixed_fields, " (%d bytes)",size);
4790
4791   return proto_item_add_subtree (fixed_fields, ett_fixed_parameters);
4792 }
4793
4794
4795 /* ************************************************************************* */
4796 /*            Add the subtree used to store tagged parameters                */
4797 /* ************************************************************************* */
4798 static proto_tree *
4799 get_tagged_parameter_tree (proto_tree * tree, tvbuff_t *tvb, int start, int size)
4800 {
4801   proto_item *tagged_fields;
4802
4803   tagged_fields = proto_tree_add_item(tree, hf_ieee80211_tagged_parameters, tvb, start, -1, ENC_NA);
4804   proto_item_append_text(tagged_fields, " (%d bytes)",size);
4805
4806   return proto_item_add_subtree (tagged_fields, ett_tagged_parameters);
4807 }
4808
4809
4810 static int
4811 dissect_vendor_action_marvell(proto_tree *tree, tvbuff_t *tvb, int offset)
4812 {
4813   guint8 octet;
4814
4815   octet = tvb_get_guint8(tvb, offset);
4816   proto_tree_add_item (tree, hf_ieee80211_ff_marvell_action_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4817   offset += 1;
4818   switch (octet)
4819     {
4820       case MRVL_ACTION_MESH_MANAGEMENT:
4821         octet = tvb_get_guint8(tvb, offset);
4822         proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_action_code, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4823         offset += 1;
4824         switch (octet)
4825           {
4826             case MRVL_MESH_MGMT_ACTION_RREQ:
4827               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4828               offset += 1;
4829               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4830               offset += 1;
4831               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4832               offset += 1;
4833               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4834               offset += 1;
4835               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_rreqid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4836               offset += 4;
4837               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
4838               offset += 6;
4839               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4840               offset += 4;
4841               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4842               offset += 4;
4843               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4844               offset += 4;
4845               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4846               offset += 1;
4847               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4848               offset += 1;
4849               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
4850               offset += 6;
4851               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4852               offset += 4;
4853               break;
4854             case MRVL_MESH_MGMT_ACTION_RREP:
4855               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4856               offset += 1;
4857               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4858               offset += 1;
4859               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4860               offset += 1;
4861               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4862               offset += 1;
4863               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
4864               offset += 6;
4865               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4866               offset += 4;
4867               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4868               offset += 4;
4869               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4870               offset += 4;
4871               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_sa, tvb, offset, 6, ENC_NA);
4872               offset += 6;
4873               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_ssn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4874               offset += 4;
4875               break;
4876             case MRVL_MESH_MGMT_ACTION_RERR:
4877               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4878               offset += 1;
4879               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4880               offset += 1;
4881               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dstcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4882               offset += 1;
4883               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_da, tvb, offset, 6, ENC_NA);
4884               offset += 6;
4885               proto_tree_add_item (tree, hf_ieee80211_ff_marvell_mesh_mgt_dsn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
4886               offset += 4;
4887               break;
4888             default:
4889               break;
4890           }
4891         break;
4892       default:
4893         break;
4894     }
4895
4896   return offset;
4897 }
4898
4899 static guint
4900 dissect_advertisement_protocol(packet_info *pinfo, proto_tree *tree,
4901                                tvbuff_t *tvb, int offset, gboolean *anqp)
4902 {
4903   guint8      tag_no, tag_len, left;
4904   proto_item *item = NULL, *adv_item;
4905   proto_tree *adv_tree, *adv_tuple_tree;
4906
4907   if (anqp)
4908     *anqp = FALSE;
4909   tag_no = tvb_get_guint8(tvb, offset);
4910   if (anqp)
4911     item = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
4912
4913   tag_len = tvb_get_guint8(tvb, offset + 1);
4914   if (tag_no != TAG_ADVERTISEMENT_PROTOCOL) {
4915     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
4916                            "Unexpected IE %d (expected Advertisement "
4917                            "Protocol)", tag_no);
4918     return 2 + tag_len;
4919   }
4920   if (anqp)
4921     item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
4922   if (tag_len < 2) {
4923     if (!anqp)
4924       item = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
4925     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
4926                            "Advertisement Protocol: IE must be at least 2 "
4927                            "octets long");
4928     return 2 + tag_len;
4929   }
4930
4931   left = tag_len;
4932   offset += 2;
4933   adv_item = proto_tree_add_text(tree, tvb, offset, left,
4934                                  "Advertisement Protocol element");
4935   adv_tree = proto_item_add_subtree(adv_item, ett_adv_proto);
4936
4937   while (left >= 2) {
4938     guint8 id;
4939
4940     id = tvb_get_guint8(tvb, offset + 1);
4941     if (id == 0)
4942       proto_item_append_text(adv_item, ": ANQP");
4943     item = proto_tree_add_text(adv_tree, tvb, offset, 2,
4944                                "Advertisement Protocol Tuple: %s",
4945                                val_to_str(id, adv_proto_id_vals,
4946                                           "Unknown (%d)"));
4947     adv_tuple_tree = proto_item_add_subtree(item, ett_adv_proto_tuple);
4948
4949     proto_tree_add_item(adv_tuple_tree,
4950                         hf_ieee80211_tag_adv_proto_resp_len_limit, tvb,
4951                         offset, 1, ENC_BIG_ENDIAN);
4952     proto_tree_add_item(adv_tuple_tree,
4953                         hf_ieee80211_tag_adv_proto_pame_bi, tvb,
4954                         offset, 1, ENC_BIG_ENDIAN);
4955     offset += 1;
4956     left--;
4957     proto_tree_add_item(adv_tuple_tree, hf_ieee80211_tag_adv_proto_id, tvb,
4958                         offset, 1, ENC_BIG_ENDIAN);
4959     offset += 1;
4960     left--;
4961
4962     if ((id == 0) && anqp)
4963       *anqp = TRUE;
4964
4965     if (id == 221) {
4966       /* Vendor specific */
4967       guint8 len = tvb_get_guint8(tvb, offset);
4968       offset += 1;
4969       left   -= 1;
4970       if (len > left) {
4971         expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
4972                                "Vendor specific info length error");
4973         return 2 + tag_len;
4974       }
4975       proto_tree_add_text(adv_tuple_tree, tvb, offset, len,
4976                           "Vendor Specific Advertisement Protocol info");
4977       offset += len;
4978       left   -= len;
4979     }
4980   }
4981
4982   if (left) {
4983     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
4984                            "Unexpected extra data in the end");
4985   }
4986
4987   return 2 + tag_len;
4988 }
4989
4990 static void
4991 dissect_anqp_query_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
4992 {
4993   while (offset + 2 <= end) {
4994     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_query_id,
4995                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
4996     offset += 2;
4997   }
4998   if (offset != end) {
4999     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
5000                            "Unexpected ANQP Query list format");
5001   }
5002 }
5003
5004 static void dissect_hs20_anqp_hs_capability_list(proto_tree *tree,
5005                                                  tvbuff_t *tvb,
5006                                                  int offset, int end)
5007 {
5008   while (offset < end) {
5009     proto_tree_add_item(tree, hf_hs20_anqp_hs_capability_list,
5010                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5011     offset++;
5012   }
5013 }
5014
5015 static void
5016 dissect_anqp_capab_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
5017 {
5018   guint16     id, len;
5019   proto_item *item;
5020   proto_tree *vtree;
5021   guint32     oui;
5022   guint8      subtype;
5023
5024   while (offset + 2 <= end) {
5025     id = tvb_get_letohs(tvb, offset);
5026     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_capability,
5027                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
5028     offset += 2;
5029     if (id == ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
5030       vtree = proto_item_add_subtree(item, ett_anqp_vendor_capab);
5031       len = tvb_get_letohs(tvb, offset);
5032       proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vlen,
5033                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
5034       offset += 2;
5035       if ((len < 3) || ((offset + len) > end)) {
5036         expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
5037                                "Invalid vendor-specific ANQP capability");
5038         return;
5039       }
5040       oui = tvb_get_ntoh24(tvb, offset);
5041       proto_tree_add_item(vtree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
5042       offset += 3;
5043       len    -= 3;
5044
5045       switch (oui) {
5046       case OUI_WFA:
5047         if (len == 0)
5048           break;
5049         subtype = tvb_get_guint8(tvb, offset);
5050         proto_item_append_text(vtree, " - WFA - %s",
5051                                val_to_str(subtype, wfa_subtype_vals,
5052                                           "Unknown (%u)"));
5053         proto_tree_add_item(vtree, hf_ieee80211_anqp_wfa_subtype,
5054                             tvb, offset, 1, ENC_NA);
5055         offset++;
5056         len--;
5057         switch (subtype) {
5058         case WFA_SUBTYPE_HS20_ANQP:
5059           dissect_hs20_anqp_hs_capability_list(vtree, tvb, offset, end);
5060           break;
5061         default:
5062           proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
5063                               tvb, offset, len, ENC_NA);
5064           break;
5065         }
5066         break;
5067       default:
5068         proto_tree_add_item(vtree, hf_ieee80211_ff_anqp_capability_vendor,
5069                             tvb, offset, len, ENC_NA);
5070         break;
5071       }
5072
5073       offset += len;
5074     }
5075   }
5076   if (offset != end) {
5077     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
5078                            "Unexpected ANQP Capability list format");
5079   }
5080 }
5081
5082 static const value_string venue_group_vals[] = {
5083   {  0, "Unspecified" },
5084   {  1, "Assembly" },
5085   {  2, "Business" },
5086   {  3, "Educational" },
5087   {  4, "Factory and Industrial" },
5088   {  5, "Institutional" },
5089   {  6, "Mercantile" },
5090   {  7, "Residential" },
5091   {  8, "Storage" },
5092   {  9, "Utility and Miscellaneous" },
5093   { 10, "Vehicular" },
5094   { 11, "Outdoor" },
5095   { 0, NULL }
5096 };
5097 static value_string_ext venue_group_vals_ext = VALUE_STRING_EXT_INIT(venue_group_vals);
5098
5099 static void
5100 dissect_venue_info(proto_tree *tree, tvbuff_t *tvb, int offset)
5101 {
5102   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_group,
5103                       tvb, offset, 1, ENC_BIG_ENDIAN);
5104   proto_tree_add_item(tree, hf_ieee80211_ff_venue_info_type,
5105                       tvb, offset + 1, 1, ENC_BIG_ENDIAN);
5106 }
5107
5108 static void
5109 dissect_venue_name_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
5110 {
5111   proto_item *item;
5112
5113   dissect_venue_info(tree, tvb, offset);
5114   offset += 2;
5115   while (offset + 4 <= end) {
5116     guint8 vlen = tvb_get_guint8(tvb, offset);
5117     item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_length,
5118                                tvb, offset, 1, ENC_BIG_ENDIAN);
5119     offset += 1;
5120     if ((vlen > (end - offset)) || (vlen < 3)) {
5121       expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
5122                              "Invalid Venue Name Duple length");
5123       break;
5124     }
5125     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_language,
5126                         tvb, offset, 3, ENC_ASCII|ENC_NA);
5127     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_venue_name,
5128                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
5129     offset += vlen;
5130   }
5131 }
5132
5133 static const value_string nw_auth_type_vals[] = {
5134   { 0, "Acceptance of terms and conditions" },
5135   { 1, "On-line enrollment supported" },
5136   { 2, "http/https redirection" },
5137   { 3, "DNS redirection" },
5138   { 0, NULL }
5139 };
5140
5141 static void
5142 dissect_network_auth_type(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
5143 {
5144   while (offset + 3 <= end) {
5145     guint16 len;
5146     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_indicator,
5147                         tvb, offset, 1, ENC_BIG_ENDIAN);
5148     offset += 1;
5149     len = tvb_get_letohs(tvb, offset);
5150     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url_len,
5151                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
5152     offset += 2;
5153     if (len)
5154       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nw_auth_type_url,
5155                           tvb, offset, len, ENC_ASCII|ENC_NA);
5156     offset += len;
5157   }
5158 }
5159
5160 static void
5161 add_manuf(proto_item *item, tvbuff_t *tvb, int offset)
5162 {
5163   const gchar *manuf_name;
5164
5165   manuf_name = tvb_get_manuf_name_if_known(tvb, offset);
5166   if (manuf_name == NULL)
5167     return;
5168   proto_item_append_text(item, " - %s", manuf_name);
5169 }
5170
5171 static void
5172 dissect_roaming_consortium_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
5173                                 int end)
5174 {
5175   proto_item *item;
5176   guint8      len;
5177
5178   while (offset < end) {
5179     len = tvb_get_guint8(tvb, offset);
5180     item = proto_tree_add_item(tree,
5181                                hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
5182                                tvb, offset, 1, ENC_BIG_ENDIAN);
5183     offset += 1;
5184     if ((len > (end - offset)) || (len < 3)) {
5185       expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
5186                              "Invalid Roaming Consortium OI");
5187       break;
5188     }
5189     item = proto_tree_add_item(tree,
5190                                hf_ieee80211_ff_anqp_roaming_consortium_oi,
5191                                tvb, offset, len, ENC_NA);
5192     add_manuf(item, tvb, offset);
5193     offset += len;
5194   }
5195 }
5196
5197 static const value_string ip_addr_avail_ipv6_vals[] = {
5198   { 0, "Address type not available" },
5199   { 1, "Address type available" },
5200   { 2, "Availability of the address type not known" },
5201   { 0, NULL }
5202 };
5203
5204 static const value_string ip_addr_avail_ipv4_vals[] = {
5205   { 0, "Address type not available" },
5206   { 1, "Public IPv4 address available" },
5207   { 2, "Port-restricted IPv4 address available" },
5208   { 3, "Single NATed private IPv4 address available" },
5209   { 4, "Double NATed private IPv4 address available" },
5210   { 5, "Port-restricted IPv4 address and single NATed IPv4 address available" },
5211   { 6, "Port-restricted IPv4 address and double NATed IPv4 address available" },
5212   { 7, "Availability of the address type is not known" },
5213   { 0, NULL }
5214 };
5215
5216 static void
5217 dissect_ip_addr_type_availability_info(proto_tree *tree, tvbuff_t *tvb,
5218                                        int offset)
5219 {
5220   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
5221                       tvb, offset, 1, ENC_BIG_ENDIAN);
5222   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
5223                       tvb, offset, 1, ENC_BIG_ENDIAN);
5224 }
5225
5226 static const value_string nai_realm_encoding_vals[] = {
5227   { 0, "Formatted in accordance with RFC 4282" },
5228   { 1, "UTF-8 formatted that is not formatted in accordance with RFC 4282" },
5229   { 0, NULL }
5230 };
5231
5232 static const value_string nai_realm_auth_param_id_vals[] = {
5233   {   1, "Expanded EAP Method" },
5234   {   2, "Non-EAP Inner Authentication Type" },
5235   {   3, "Inner Authentication EAP Method Type" },
5236   {   4, "Expanded Inner EAP Method" },
5237   {   5, "Credential Type" },
5238   {   6, "Tunneled EAP Method Credential Type" },
5239   { 221, "Vendor Specific" },
5240   { 0, NULL }
5241 };
5242
5243 static void
5244 dissect_nai_realm_list(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int end)
5245 {
5246   guint16     count, len;
5247   proto_item *item, *r_item;
5248   int         f_end, eap_end;
5249   guint8      nai_len, eap_count, eap_len, auth_param_count, auth_param_len;
5250   guint8      auth_param_id;
5251   proto_tree *realm_tree, *eap_tree;
5252   guint8     *realm;
5253
5254   count = tvb_get_letohs(tvb, offset);
5255   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_nai_realm_count,
5256                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
5257   offset += 2;
5258   while (count > 0) {
5259     len = tvb_get_letohs(tvb, offset);
5260     r_item = proto_tree_add_text(tree, tvb, offset, 2 + len, "NAI Realm Data");
5261     realm_tree = proto_item_add_subtree(r_item, ett_nai_realm);
5262
5263     item = proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_field_len,
5264                                tvb, offset, 2, ENC_LITTLE_ENDIAN);
5265     offset += 2;
5266     if (offset + len > end) {
5267       expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
5268                              "Invalid NAI Realm List");
5269       break;
5270     }
5271     f_end = offset + len;
5272     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_encoding,
5273                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5274     offset += 1;
5275     nai_len = tvb_get_guint8(tvb, offset);
5276     item = proto_tree_add_item(realm_tree,
5277                                hf_ieee80211_ff_anqp_nai_realm_length,
5278                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
5279     offset += 1;
5280     if (offset + nai_len > f_end) {
5281       expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
5282                              "Invalid NAI Realm Data");
5283       break;
5284     }
5285     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm,
5286                         tvb, offset, nai_len, ENC_ASCII|ENC_NA);
5287     realm = tvb_get_ephemeral_string(tvb, offset, nai_len);
5288     if (realm) {
5289       proto_item_append_text(r_item, " (%s)", realm);
5290     }
5291     offset += nai_len;
5292     eap_count = tvb_get_guint8(tvb, offset);
5293     proto_tree_add_item(realm_tree, hf_ieee80211_ff_anqp_nai_realm_eap_count,
5294                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5295     offset += 1;
5296
5297     while (eap_count > 0) {
5298       eap_len = tvb_get_guint8(tvb, offset);
5299       eap_end = offset + 1 + eap_len;
5300       item = proto_tree_add_text(realm_tree, tvb, offset, 1 + eap_len,
5301                                  "EAP Method");
5302       eap_tree = proto_item_add_subtree(item, ett_nai_realm_eap);
5303
5304       item = proto_tree_add_item(eap_tree,
5305                                  hf_ieee80211_ff_anqp_nai_realm_eap_len,
5306                                  tvb, offset, 1, ENC_LITTLE_ENDIAN);
5307       offset += 1;
5308       if (offset + eap_len > f_end) {
5309         expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
5310                                "Invalid EAP Method subfield");
5311         break;
5312       }
5313
5314       proto_item_append_text(eap_tree, ": %s",
5315                              val_to_str_ext(tvb_get_guint8(tvb, offset),
5316                                             &eap_type_vals_ext, "Unknown (%d)"));
5317       proto_tree_add_item(eap_tree, hf_ieee80211_ff_anqp_nai_realm_eap_method,
5318                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
5319       offset += 1;
5320       auth_param_count = tvb_get_guint8(tvb, offset);
5321       proto_tree_add_item(eap_tree,
5322                           hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
5323                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
5324       offset += 1;
5325
5326       while (auth_param_count > 0) {
5327         auth_param_id = tvb_get_guint8(tvb, offset);
5328         proto_tree_add_item(eap_tree,
5329                             hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
5330                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
5331         offset += 1;
5332         auth_param_len = tvb_get_guint8(tvb, offset);
5333         proto_tree_add_item(eap_tree,
5334                             hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
5335                             tvb, offset, 1, ENC_LITTLE_ENDIAN);
5336         offset += 1;
5337         item = proto_tree_add_item(
5338           eap_tree, hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
5339           tvb, offset, auth_param_len, ENC_NA);
5340         if ((auth_param_id == 3) && (auth_param_len == 1)) {
5341           guint8 inner_method = tvb_get_guint8(tvb, offset);
5342           const char *str;
5343           str = val_to_str_ext(inner_method, &eap_type_vals_ext, "Unknown (%d)");
5344
5345           proto_item_append_text(eap_tree, " / %s", str);
5346           proto_item_append_text(item, " - %s", str);
5347         }
5348         offset += auth_param_len;
5349
5350         auth_param_count--;
5351       }
5352
5353       offset = eap_end;
5354       eap_count--;
5355     }
5356
5357     offset = f_end;
5358     count--;
5359   }
5360 }
5361
5362 static void
5363 dissect_3gpp_cellular_network_info(proto_tree *tree, tvbuff_t *tvb, int offset)
5364 {
5365   guint8      iei, num;
5366   proto_item *item;
5367
5368   /* See Annex A of 3GPP TS 24.234 v8.1.0 for description */
5369   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_gud, tvb, offset, 1, ENC_BIG_ENDIAN);
5370   offset += 1;
5371   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_udhl, tvb, offset, 1, ENC_BIG_ENDIAN);
5372   offset += 1;
5373   iei = tvb_get_guint8(tvb, offset);
5374   item = proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_iei, tvb, offset, 1, ENC_BIG_ENDIAN);
5375   if (iei == 0)
5376     proto_item_append_text(item, " (PLMN List)");
5377   else
5378     return;
5379   offset += 1;
5380   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_plmn_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5381   offset += 1;
5382   num = tvb_get_guint8(tvb, offset);
5383   proto_tree_add_item(tree, hf_ieee80211_3gpp_gc_num_plmns, tvb, offset, 1, ENC_BIG_ENDIAN);
5384   offset += 1;
5385   while (num > 0) {
5386     guint8 o1, o2, o3;
5387     if (tvb_reported_length_remaining(tvb, offset) < 3)
5388       break;
5389     num--;
5390     o1 = tvb_get_guint8(tvb, offset);
5391     o2 = tvb_get_guint8(tvb, offset + 1);
5392     o3 = tvb_get_guint8(tvb, offset + 2);
5393     proto_tree_add_string_format_value(tree, hf_ieee80211_3gpp_gc_plmn, tvb, offset, 3,
5394                                        "", "MCC %d%d%d MNC %d%d%c",
5395                                        o1 & 0x0f, (o1 & 0xf0) >> 4, o2 & 0x0f,
5396                                        o3 & 0x0f, (o3 & 0xf0) >> 4,
5397                                        ((o2 & 0xf0) == 0xf0) ? ' ' :
5398                                        ('0' + ((o2 & 0xf0) >> 4)));
5399     offset += 3;
5400   }
5401 }
5402
5403 static void
5404 dissect_domain_name_list(proto_tree *tree, tvbuff_t *tvb, int offset, int end)
5405 {
5406   guint8 len;
5407
5408   while (offset < end) {
5409     len = tvb_get_guint8(tvb, offset);
5410     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name_len,
5411                         tvb, offset, 1, ENC_BIG_ENDIAN);
5412     offset += 1;
5413     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_domain_name,
5414                         tvb, offset, len, ENC_ASCII|ENC_NA);
5415     offset += len;
5416   }
5417 }
5418
5419 #define HS20_ANQP_HS_QUERY_LIST 1
5420 #define HS20_ANQP_HS_CAPABILITY_LIST 2
5421 #define HS20_ANQP_OPERATOR_FRIENDLY_NAME 3
5422 #define HS20_ANQP_WAN_METRICS 4
5423 #define HS20_ANQP_CONNECTION_CAPABILITY 5
5424 #define HS20_ANQP_NAI_HOME_REALM_QUERY 6
5425 #define HS20_ANQP_OPERATING_CLASS_INDICATION 7
5426
5427 static const value_string hs20_anqp_subtype_vals[] = {
5428   { HS20_ANQP_HS_QUERY_LIST, "HS Query list" },
5429   { HS20_ANQP_HS_CAPABILITY_LIST, "HS Capability List" },
5430   { HS20_ANQP_OPERATOR_FRIENDLY_NAME, "Operator Friendly Name" },
5431   { HS20_ANQP_WAN_METRICS, "WAN Metrics" },
5432   { HS20_ANQP_CONNECTION_CAPABILITY, "Connection Capability" },
5433   { HS20_ANQP_NAI_HOME_REALM_QUERY, "NAI Home Realm Query" },
5434   { HS20_ANQP_OPERATING_CLASS_INDICATION, "Operating Class Indication" },
5435   { 0, NULL }
5436 };
5437
5438 static void dissect_hs20_anqp_hs_query_list(proto_tree *tree, tvbuff_t *tvb,
5439                                             int offset, int end)
5440 {
5441   while (offset < end) {
5442     proto_tree_add_item(tree, hf_hs20_anqp_hs_query_list,
5443                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5444     offset++;
5445   }
5446 }
5447
5448 static void dissect_hs20_anqp_operator_friendly_name(proto_tree *tree,
5449                                                      tvbuff_t *tvb, packet_info *pinfo,
5450                                                      int offset, int end)
5451 {
5452   while (offset + 4 <= end) {
5453     guint8 vlen = tvb_get_guint8(tvb, offset);
5454     proto_item *item = proto_tree_add_item(tree, hf_hs20_anqp_ofn_length,
5455                                            tvb, offset, 1, ENC_LITTLE_ENDIAN);
5456     offset++;
5457     if (vlen > end - offset || vlen < 3) {
5458       expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
5459                              "Invalid Operator Friendly Name Duple length");
5460       break;
5461     }
5462     proto_tree_add_item(tree, hf_hs20_anqp_ofn_language,
5463                         tvb, offset, 3, ENC_ASCII|ENC_NA);
5464     proto_tree_add_item(tree, hf_hs20_anqp_ofn_name,
5465                         tvb, offset + 3, vlen - 3, ENC_UTF_8|ENC_NA);
5466     offset += vlen;
5467   }
5468 }
5469
5470 static const value_string hs20_wm_link_status_vals[] = {
5471   { 0, "Reserved" },
5472   { 1, "Link up" },
5473   { 2, "Link down" },
5474   { 3, "Link in test state" },
5475   { 0, NULL }
5476 };
5477
5478 static void dissect_hs20_anqp_wan_metrics(proto_tree *tree, tvbuff_t *tvb,
5479                                           int offset, gboolean request)
5480 {
5481   if (request)
5482     return;
5483
5484   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_link_status,
5485                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
5486   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_symmetric_link,
5487                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
5488   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_at_capacity,
5489                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
5490   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_reserved,
5491                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
5492   offset++;
5493
5494   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_speed,
5495                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
5496   offset += 4;
5497
5498   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_speed,
5499                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
5500   offset += 4;
5501
5502   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_downlink_load,
5503                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
5504   offset++;
5505
5506   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_uplink_load,
5507                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
5508   offset++;
5509
5510   proto_tree_add_item(tree, hf_hs20_anqp_wan_metrics_lmd,
5511                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
5512 }
5513
5514 static const value_string hs20_cc_status_vals[] = {
5515   { 0, "Closed" },
5516   { 1, "Open" },
5517   { 2, "Unknown" },
5518   { 0, NULL }
5519 };
5520
5521 static void
5522 dissect_hs20_anqp_connection_capability(proto_tree *tree, tvbuff_t *tvb,
5523                                         int offset, int end)
5524 {
5525   proto_item *item;
5526   proto_tree *tuple;
5527   while (offset + 4 <= end) {
5528     guint8 ip_proto, status;
5529     guint16 port_num;
5530
5531     ip_proto = tvb_get_guint8(tvb, offset);
5532     port_num = tvb_get_letohs(tvb, offset + 1);
5533     status = tvb_get_guint8(tvb, offset + 3);
5534
5535     item = proto_tree_add_text(tree, tvb, offset, 4, "ProtoPort Tuple - "
5536                                "ip_proto=%u port_num=%u status=%s",
5537                                ip_proto, port_num,
5538                                val_to_str(status, hs20_cc_status_vals,
5539                                           "Unknown (%u)"));
5540     tuple = proto_item_add_subtree(item, ett_hs20_cc_proto_port_tuple);
5541     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_ip_proto,
5542                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5543     offset++;
5544     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_port_num,
5545                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
5546     offset += 2;
5547     proto_tree_add_item(tuple, hf_hs20_anqp_cc_proto_status,
5548                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5549     offset++;
5550   }
5551 }
5552
5553 static void
5554 dissect_hs20_anqp_nai_home_realm_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo,
5555                                        int offset, int end)
5556 {
5557   guint8 len;
5558   proto_item *item;
5559
5560   proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_count,
5561                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
5562   offset++;
5563
5564   while (offset + 2 <= end) {
5565     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_encoding_type,
5566                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5567     offset++;
5568     len = tvb_get_guint8(tvb, offset);
5569     item = proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_length,
5570                                tvb, offset, 1, ENC_LITTLE_ENDIAN);
5571     offset++;
5572     if (offset + len > end) {
5573       expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
5574                              "Invalid NAI Home Realm Query length");
5575       break;
5576     }
5577     proto_tree_add_item(tree, hf_hs20_anqp_nai_hrq_realm_name,
5578                         tvb, offset, len, ENC_ASCII|ENC_NA);
5579     offset += len;
5580   }
5581 }
5582
5583 static void dissect_hs20_anqp_oper_class_indic(proto_tree *tree, tvbuff_t *tvb,
5584                                                int offset, int end)
5585 {
5586   while (offset < end) {
5587     proto_tree_add_item(tree, hf_hs20_anqp_oper_class_indic,
5588                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
5589     offset++;
5590   }
5591 }
5592
5593 static void dissect_hs20_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
5594                               int end, gboolean request, int idx)
5595 {
5596   guint8 subtype;
5597
5598   subtype = tvb_get_guint8(tvb, offset);
5599   proto_item_append_text(tree, " - HS 2.0 %s",
5600                          val_to_str(subtype, hs20_anqp_subtype_vals,
5601                                     "Unknown (%u)"));
5602   if (idx == 0) {
5603     col_append_fstr(pinfo->cinfo, COL_INFO, " HS 2.0 %s",
5604                     val_to_str(subtype, hs20_anqp_subtype_vals,
5605                                "Unknown (%u)"));
5606   } else if (idx == 1) {
5607     col_append_fstr(pinfo->cinfo, COL_INFO, ", ..");
5608   }
5609   proto_tree_add_item(tree, hf_hs20_anqp_subtype, tvb, offset, 1,
5610                       ENC_LITTLE_ENDIAN);
5611   offset++;
5612
5613   proto_tree_add_item(tree, hf_hs20_anqp_reserved, tvb, offset, 1,
5614                       ENC_LITTLE_ENDIAN);
5615   offset++;
5616
5617   switch (subtype) {
5618   case HS20_ANQP_HS_QUERY_LIST:
5619     dissect_hs20_anqp_hs_query_list(tree, tvb, offset, end);
5620     break;
5621   case HS20_ANQP_HS_CAPABILITY_LIST:
5622     dissect_hs20_anqp_hs_capability_list(tree, tvb, offset, end);
5623     break;
5624   case HS20_ANQP_OPERATOR_FRIENDLY_NAME:
5625     dissect_hs20_anqp_operator_friendly_name(tree, tvb, pinfo, offset, end);
5626     break;
5627   case HS20_ANQP_WAN_METRICS:
5628     dissect_hs20_anqp_wan_metrics(tree, tvb, offset, request);
5629     break;
5630   case HS20_ANQP_CONNECTION_CAPABILITY:
5631     dissect_hs20_anqp_connection_capability(tree, tvb, offset, end);
5632     break;
5633   case HS20_ANQP_NAI_HOME_REALM_QUERY:
5634     dissect_hs20_anqp_nai_home_realm_query(tree, tvb, pinfo, offset, end);
5635     break;
5636   case HS20_ANQP_OPERATING_CLASS_INDICATION:
5637     dissect_hs20_anqp_oper_class_indic(tree, tvb, offset, end);
5638     break;
5639   default:
5640     if (offset == end)
5641       break;
5642     proto_tree_add_item(tree, hf_hs20_anqp_payload, tvb, offset,
5643                         end - offset, ENC_NA);
5644     break;
5645   }
5646 }
5647
5648 static int
5649 dissect_anqp_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
5650                   gboolean request, int idx)
5651 {
5652   guint16     id, len;
5653   guint32     oui;
5654   proto_item *item;
5655
5656   item = proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_id,
5657                              tvb, offset, 2, ENC_LITTLE_ENDIAN);
5658   id = tvb_get_letohs(tvb, offset);
5659   if (id != ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST) {
5660     if (idx == 0) {
5661       proto_item_append_text(tree, " - %s",
5662                              val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
5663       col_append_fstr(pinfo->cinfo, COL_INFO, " %s",
5664                       val_to_str_ext(id, &anqp_info_id_vals_ext, "Unknown (%u)"));
5665     } else if (idx == 1) {
5666       proto_item_append_text(tree, ", ..");
5667       col_append_fstr(pinfo->cinfo, COL_INFO, ", ..");
5668     }
5669   }
5670   tree = proto_item_add_subtree(item, ett_gas_anqp);
5671   offset += 2;
5672   proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info_length,
5673                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
5674   len = tvb_get_letohs(tvb, offset);
5675   offset += 2;
5676   if (tvb_reported_length_remaining(tvb, offset) < len) {
5677     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
5678                            "Invalid ANQP Info length");
5679     return 4 + len;
5680   }
5681   switch (id)
5682   {
5683   case ANQP_INFO_ANQP_QUERY_LIST:
5684     dissect_anqp_query_list(tree, tvb, pinfo, offset, offset + len);
5685     break;
5686   case ANQP_INFO_ANQP_CAPAB_LIST:
5687     dissect_anqp_capab_list(tree, tvb, pinfo, offset, offset + len);
5688     break;
5689   case ANQP_INFO_VENUE_NAME_INFO:
5690     dissect_venue_name_info(tree, tvb, pinfo, offset, offset + len);
5691     break;
5692   case ANQP_INFO_NETWORK_AUTH_TYPE_INFO:
5693     dissect_network_auth_type(tree, tvb, offset, offset + len);
5694     break;
5695   case ANQP_INFO_ROAMING_CONSORTIUM_LIST:
5696     dissect_roaming_consortium_list(tree, tvb, pinfo, offset, offset + len);
5697     break;
5698   case ANQP_INFO_IP_ADDR_TYPE_AVAILABILITY_INFO:
5699     dissect_ip_addr_type_availability_info(tree, tvb, offset);
5700     break;
5701   case ANQP_INFO_NAI_REALM_LIST:
5702     dissect_nai_realm_list(tree, tvb, pinfo, offset, offset + len);
5703     break;
5704   case ANQP_INFO_3GPP_CELLULAR_NETWORK_INFO:
5705     dissect_3gpp_cellular_network_info(tree, tvb, offset);
5706     break;
5707   case ANQP_INFO_DOMAIN_NAME_LIST:
5708     dissect_domain_name_list(tree, tvb, offset, offset + len);
5709     break;
5710   case ANQP_INFO_ANQP_VENDOR_SPECIFIC_LIST:
5711     oui = tvb_get_ntoh24(tvb, offset);
5712     proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
5713     offset += 3;
5714
5715     switch (oui) {
5716     case OUI_WFA:
5717       proto_tree_add_item(tree, hf_ieee80211_anqp_wfa_subtype, tvb, offset, 1,
5718                           ENC_NA);
5719       switch (tvb_get_guint8(tvb, offset)) {
5720       case WFA_SUBTYPE_P2P:
5721         dissect_wifi_p2p_anqp(pinfo, tree, tvb, offset + 1, request);
5722         break;
5723       case WFA_SUBTYPE_HS20_ANQP:
5724         dissect_hs20_anqp(tree, tvb, pinfo, offset + 1, offset + len - 3, request,
5725                           idx);
5726         break;
5727       }
5728       break;
5729     default:
5730       proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
5731                           tvb, offset, len, ENC_NA);
5732       break;
5733     }
5734     break;
5735   default:
5736     proto_tree_add_item(tree, hf_ieee80211_ff_anqp_info,
5737                         tvb, offset, len, ENC_NA);
5738     break;
5739   }
5740
5741   return 4 + len;
5742 }
5743
5744 static void
5745 dissect_anqp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, gboolean request)
5746 {
5747   int idx = 0;
5748
5749   proto_item_append_text(tree, ": ANQP ");
5750   proto_item_append_text(tree, request ? "Request" : "Response");
5751   if (tvb_reported_length_remaining(tvb, offset) < 4) {
5752     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
5753                            "Not enough room for ANQP header");
5754     return;
5755   }
5756   col_append_fstr(pinfo->cinfo, COL_INFO, ", ANQP %s",
5757                   request ? "Req" : "Resp");
5758   while (tvb_reported_length_remaining(tvb, offset) > 0) {
5759     offset += dissect_anqp_info(tree, tvb, pinfo, offset, request, idx);
5760     idx += 1;
5761   }
5762 }
5763
5764 static guint
5765 dissect_gas_initial_request(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
5766                             gboolean anqp)
5767 {
5768   guint16     req_len;
5769   int         start = offset;
5770   proto_item *item;
5771   proto_tree *query;
5772
5773   /* Query Request Length (2 octets) */
5774   req_len = tvb_get_letohs(tvb, offset);
5775
5776   item = proto_tree_add_text(tree, tvb, offset, 2 + req_len, "Query Request");
5777   if (tvb_reported_length_remaining(tvb, offset) < 2 + req_len) {
5778     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
5779                            "Invalid Query Request Length");
5780     return tvb_reported_length_remaining(tvb, offset);
5781   }
5782   query = proto_item_add_subtree(item, ett_gas_query);
5783
5784   proto_tree_add_item(query, hf_ieee80211_ff_query_request_length,
5785                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
5786   offset += 2;
5787   /*
5788    * Query Request (GAS query; formatted per protocol specified in the
5789    * Advertisement Protocol IE)
5790    */
5791   if (anqp)
5792     dissect_anqp(query, tvb, pinfo, offset, TRUE);
5793   else
5794     proto_tree_add_item(query, hf_ieee80211_ff_query_request,
5795                         tvb, offset, req_len, ENC_NA);
5796   offset += req_len;
5797
5798   return offset - start;
5799 }
5800
5801 static guint
5802 dissect_gas_initial_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
5803                              gboolean anqp)
5804 {
5805   guint16     resp_len;
5806   int         start = offset;
5807   proto_item *item;
5808   proto_tree *query;
5809
5810   /* Query Response Length (2 octets) */
5811   resp_len = tvb_get_letohs(tvb, offset);
5812
5813   item = proto_tree_add_text(tree, tvb, offset, 2 + resp_len,
5814                              "Query Response");
5815   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
5816     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
5817                            "Invalid Query Response Length");
5818     return tvb_reported_length_remaining(tvb, offset);
5819   }
5820   query = proto_item_add_subtree(item, ett_gas_query);
5821
5822   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
5823                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
5824   offset += 2;
5825   /* Query Response (optional) */
5826   if (resp_len) {
5827     if (anqp)
5828       dissect_anqp(query, tvb, pinfo, offset, FALSE);
5829     else
5830       proto_tree_add_item(query, hf_ieee80211_ff_query_response,
5831                           tvb, offset, resp_len, ENC_NA);
5832     offset += resp_len;
5833   }
5834
5835   return offset - start;
5836 }
5837
5838 static reassembly_table gas_reassembly_table;
5839
5840 static void
5841 ieee80211_gas_reassembly_init(void)
5842 {
5843   reassembly_table_init(&gas_reassembly_table,
5844                         &addresses_reassembly_table_functions);
5845 }
5846
5847 static gint ett_gas_resp_fragment = -1;
5848 static gint ett_gas_resp_fragments = -1;
5849
5850 static int hf_ieee80211_gas_resp_fragments = -1;
5851 static int hf_ieee80211_gas_resp_fragment = -1;
5852 static int hf_ieee80211_gas_resp_fragment_overlap = -1;
5853 static int hf_ieee80211_gas_resp_fragment_overlap_conflict = -1;
5854 static int hf_ieee80211_gas_resp_fragment_multiple_tails = -1;
5855 static int hf_ieee80211_gas_resp_fragment_too_long_fragment = -1;
5856 static int hf_ieee80211_gas_resp_fragment_error = -1;
5857 static int hf_ieee80211_gas_resp_fragment_count = -1;
5858 static int hf_ieee80211_gas_resp_reassembled_in = -1;
5859 static int hf_ieee80211_gas_resp_reassembled_length = -1;
5860
5861 static const fragment_items gas_resp_frag_items = {
5862   &ett_gas_resp_fragment,
5863   &ett_gas_resp_fragments,
5864   &hf_ieee80211_gas_resp_fragments,
5865   &hf_ieee80211_gas_resp_fragment,
5866   &hf_ieee80211_gas_resp_fragment_overlap,
5867   &hf_ieee80211_gas_resp_fragment_overlap_conflict,
5868   &hf_ieee80211_gas_resp_fragment_multiple_tails,
5869   &hf_ieee80211_gas_resp_fragment_too_long_fragment,
5870   &hf_ieee80211_gas_resp_fragment_error,
5871   &hf_ieee80211_gas_resp_fragment_count,
5872   &hf_ieee80211_gas_resp_reassembled_in,
5873   &hf_ieee80211_gas_resp_reassembled_length,
5874   /* Reassembled data field */
5875   NULL,
5876   "GAS Response fragments"
5877 };
5878
5879 static guint
5880 dissect_gas_comeback_response(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
5881                               gboolean anqp, guint8 frag, gboolean more,
5882                               guint8 dialog_token)
5883 {
5884   guint16     resp_len;
5885   int         start = offset;
5886   proto_item *item;
5887   proto_tree *query;
5888
5889   /* Query Response Length (2 octets) */
5890   resp_len = tvb_get_letohs(tvb, offset);
5891
5892   item = proto_tree_add_text(tree, tvb, offset, 2 + resp_len,
5893                              "Query Response");
5894   if (tvb_reported_length_remaining(tvb, offset) < 2 + resp_len) {
5895     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
5896                            "Invalid Query Response Length");
5897     return tvb_reported_length_remaining(tvb, offset);
5898   }
5899   query = proto_item_add_subtree(item, ett_gas_query);
5900
5901   proto_tree_add_item(query, hf_ieee80211_ff_query_response_length,
5902                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
5903   offset += 2;
5904   /* Query Response (optional) */
5905   if (resp_len) {
5906     if (anqp && (frag == 0) && !more)
5907       dissect_anqp(query, tvb, pinfo, offset, FALSE);
5908     else {
5909       fragment_data *frag_msg;
5910       gboolean save_fragmented;
5911       tvbuff_t *new_tvb;
5912
5913       save_fragmented = pinfo->fragmented;
5914       pinfo->fragmented = TRUE;
5915       frag_msg = fragment_add_seq_check(&gas_reassembly_table, tvb, offset,
5916                                         pinfo, dialog_token, NULL,
5917                                         frag, resp_len, more);
5918       new_tvb = process_reassembled_data(tvb, offset, pinfo,
5919                                          "Reassembled GAS Query Response",
5920                                          frag_msg, &gas_resp_frag_items,
5921                                          NULL, tree);
5922       if (new_tvb) {
5923         if (anqp)
5924           dissect_anqp(query, new_tvb, pinfo, 0, FALSE);
5925         else
5926           proto_tree_add_item(query, hf_ieee80211_ff_query_response,
5927                               new_tvb, 0,
5928                               tvb_reported_length_remaining(new_tvb, 0),
5929                               ENC_NA);
5930       }
5931
5932       /* The old tvb cannot be used anymore */
5933       ieee80211_tvb_invalid = TRUE;
5934
5935       pinfo->fragmented = save_fragmented;
5936     }
5937     offset += resp_len;
5938   }
5939
5940   return offset - start;
5941 }
5942
5943 /* ************************************************************************* */
5944 /*              Dissect and add fixed mgmt fields to protocol tree           */
5945 /* ************************************************************************* */
5946
5947 static guint
5948 add_fixed_field(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
5949                 enum fixed_field lfcode);
5950
5951 static guint64 last_timestamp;
5952
5953 static guint
5954 add_ff_timestamp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
5955 {
5956   last_timestamp = tvb_get_letoh64(tvb, offset);
5957   proto_tree_add_item(tree, hf_ieee80211_ff_timestamp, tvb, offset, 8,
5958                       ENC_LITTLE_ENDIAN);
5959   return 8;
5960 }
5961
5962 static guint
5963 add_ff_beacon_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
5964 {
5965   proto_tree_add_item(tree, hf_ieee80211_ff_beacon_interval, tvb, offset, 2,
5966                       ENC_LITTLE_ENDIAN);
5967   col_append_fstr(pinfo->cinfo, COL_INFO, ", BI=%d",
5968                   tvb_get_letohs(tvb, offset));
5969   return 2;
5970 }
5971
5972 static guint
5973 add_ff_cap_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
5974 {
5975   proto_item *cap_item;
5976   proto_tree *cap_tree;
5977
5978   cap_item = proto_tree_add_item(tree, hf_ieee80211_ff_capture, tvb, offset, 2,
5979                                  ENC_LITTLE_ENDIAN);
5980   cap_tree = proto_item_add_subtree(cap_item, ett_cap_tree);
5981
5982   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ess, tvb, offset, 2,
5983                       ENC_LITTLE_ENDIAN);
5984   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ibss, tvb, offset, 2,
5985                       ENC_LITTLE_ENDIAN);
5986   if ((tvb_get_letohs(tvb, offset) & 0x0001) != 0) {
5987     /* This is an AP */
5988     proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_ap_poll, tvb, offset, 2,
5989                         ENC_LITTLE_ENDIAN);
5990   } else {
5991     /* This is a STA */
5992     proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_sta_poll, tvb, offset, 2,
5993                         ENC_LITTLE_ENDIAN);
5994   }
5995
5996   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_privacy, tvb, offset, 2,
5997                       ENC_LITTLE_ENDIAN);
5998   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_preamble, tvb, offset, 2,
5999                       ENC_LITTLE_ENDIAN);
6000   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_pbcc, tvb, offset, 2,
6001                       ENC_LITTLE_ENDIAN);
6002   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_agility, tvb, offset, 2,
6003                       ENC_LITTLE_ENDIAN);
6004   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_spec_man, tvb, offset, 2,
6005                       ENC_LITTLE_ENDIAN);
6006   proto_tree_add_item(cap_tree, hf_ieee80211_ff_short_slot_time, tvb, offset,
6007                       2, ENC_LITTLE_ENDIAN);
6008   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_apsd, tvb, offset, 2,
6009                       ENC_LITTLE_ENDIAN);
6010   proto_tree_add_item(cap_tree, hf_ieee80211_ff_radio_measurement, tvb, offset, 2,
6011                       ENC_LITTLE_ENDIAN);
6012   proto_tree_add_item(cap_tree, hf_ieee80211_ff_dsss_ofdm, tvb, offset, 2,
6013                       ENC_LITTLE_ENDIAN);
6014   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_del_blk_ack, tvb, offset, 2,
6015                       ENC_LITTLE_ENDIAN);
6016   proto_tree_add_item(cap_tree, hf_ieee80211_ff_cf_imm_blk_ack, tvb, offset, 2,
6017                       ENC_LITTLE_ENDIAN);
6018   return 2;
6019 }
6020
6021 static guint
6022 add_ff_auth_alg(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6023 {
6024   proto_tree_add_item(tree, hf_ieee80211_ff_auth_alg, tvb, offset, 2,
6025                       ENC_LITTLE_ENDIAN);
6026   return 2;
6027 }
6028
6029 static guint
6030 add_ff_auth_trans_seq(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6031 {
6032   proto_tree_add_item(tree, hf_ieee80211_ff_auth_seq, tvb, offset, 2,
6033                       ENC_LITTLE_ENDIAN);
6034   return 2;
6035 }
6036
6037 static guint
6038 add_ff_current_ap_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6039 {
6040   proto_tree_add_item(tree, hf_ieee80211_ff_current_ap, tvb, offset, 6,
6041                       ENC_NA);
6042   return 6;
6043 }
6044
6045 static guint
6046 add_ff_listen_ival(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6047 {
6048   proto_tree_add_item(tree, hf_ieee80211_ff_listen_ival, tvb, offset, 2,
6049                       ENC_LITTLE_ENDIAN);
6050   return 2;
6051 }
6052
6053 static guint
6054 add_ff_reason_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6055 {
6056   proto_tree_add_item(tree, hf_ieee80211_ff_reason, tvb, offset, 2,
6057                       ENC_LITTLE_ENDIAN);
6058   return 2;
6059 }
6060
6061 static guint
6062 add_ff_assoc_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6063 {
6064   proto_tree_add_item(tree, hf_ieee80211_ff_assoc_id, tvb, offset, 2,
6065                       ENC_LITTLE_ENDIAN);
6066   return 2;
6067 }
6068
6069 static guint
6070 add_ff_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6071 {
6072   proto_tree_add_item(tree, hf_ieee80211_ff_status_code, tvb, offset, 2,
6073                       ENC_LITTLE_ENDIAN);
6074   return 2;
6075 }
6076
6077 static guint
6078 add_ff_category_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6079 {
6080   proto_tree_add_item(tree, hf_ieee80211_ff_category_code, tvb, offset, 1,
6081                       ENC_LITTLE_ENDIAN);
6082   return 1;
6083 }
6084
6085 static guint
6086 add_ff_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6087 {
6088   proto_tree_add_item(tree, hf_ieee80211_ff_action_code, tvb, offset, 1,
6089                       ENC_LITTLE_ENDIAN);
6090   return 1;
6091 }
6092
6093 static guint
6094 add_ff_dialog_token(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6095 {
6096   proto_tree_add_item(tree, hf_ieee80211_ff_dialog_token, tvb, offset, 1,
6097                       ENC_LITTLE_ENDIAN);
6098   return 1;
6099 }
6100
6101 static guint
6102 add_ff_wme_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6103 {
6104   proto_tree_add_item(tree, hf_ieee80211_ff_wme_action_code, tvb, offset, 1,
6105                       ENC_LITTLE_ENDIAN);
6106   return 1;
6107 }
6108
6109 static guint
6110 add_ff_wme_status_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6111 {
6112   proto_tree_add_item(tree, hf_ieee80211_ff_wme_status_code, tvb, offset, 1,
6113                       ENC_LITTLE_ENDIAN);
6114   return 1;
6115 }
6116
6117 static guint
6118 add_ff_qos_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6119 {
6120   proto_tree_add_item(tree, hf_ieee80211_ff_qos_action_code, tvb, offset, 1,
6121                       ENC_LITTLE_ENDIAN);
6122   return 1;
6123 }
6124
6125 static guint
6126 add_ff_block_ack_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6127 {
6128   proto_tree_add_item(tree, hf_ieee80211_ff_ba_action, tvb, offset, 1,
6129                       ENC_LITTLE_ENDIAN);
6130   return 1;
6131 }
6132
6133 static guint
6134 add_ff_block_ack_param(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6135 {
6136   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_params,
6137                          ett_ff_ba_param_tree,
6138                          ieee80211_ff_block_ack_params_fields,
6139                          ENC_LITTLE_ENDIAN);
6140   return 2;
6141 }
6142
6143 static guint
6144 add_ff_block_ack_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6145 {
6146   proto_tree_add_item(tree, hf_ieee80211_ff_block_ack_timeout, tvb, offset, 2,
6147                       ENC_LITTLE_ENDIAN);
6148   return 2;
6149 }
6150
6151 static guint
6152 add_ff_block_ack_ssc(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6153 {
6154   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_block_ack_ssc,
6155                          ett_ff_ba_ssc_tree, ieee80211_ff_block_ack_ssc_fields,
6156                          ENC_LITTLE_ENDIAN);
6157   return 2;
6158 }
6159
6160 static guint
6161 add_ff_qos_ts_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6162 {
6163   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_tsinfo,
6164                          ett_tsinfo_tree, ieee80211_tsinfo_fields,
6165                          ENC_LITTLE_ENDIAN);
6166   return 3;
6167 }
6168
6169 static guint
6170 add_ff_mesh_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6171 {
6172   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_action, tvb, offset, 1,
6173                       ENC_LITTLE_ENDIAN);
6174   return 1;
6175 }
6176
6177 static guint
6178 add_ff_multihop_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6179 {
6180   proto_tree_add_item(tree, hf_ieee80211_ff_multihop_action, tvb, offset, 1,
6181                       ENC_LITTLE_ENDIAN);
6182   return 1;
6183 }
6184
6185 static guint
6186 add_ff_mesh_control(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6187 {
6188   int    start = offset;
6189   guint8 flags;
6190
6191   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_flags, tvb, offset, 1,
6192                       ENC_LITTLE_ENDIAN);
6193   flags = tvb_get_guint8(tvb, offset);
6194   offset += 1;
6195   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_ttl, tvb, offset, 1,
6196                       ENC_LITTLE_ENDIAN);
6197   offset += 1;
6198   proto_tree_add_item(tree, hf_ieee80211_ff_mesh_sequence, tvb, offset, 4,
6199                       ENC_LITTLE_ENDIAN);
6200   offset += 4;
6201
6202   switch (flags & 0x03) {
6203   case 1:
6204     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr4, tvb, offset, 6,
6205                         ENC_NA);
6206     offset += 6;
6207     break;
6208   case 2:
6209     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr5, tvb, offset, 6,
6210                         ENC_NA);
6211     offset += 6;
6212     proto_tree_add_item(tree, hf_ieee80211_ff_mesh_addr6, tvb, offset, 6,
6213                         ENC_NA);
6214     offset += 6;
6215     break;
6216   case 3:
6217     proto_item_append_text(tree, "Unknown Address Extension Mode");
6218     break;
6219   default:
6220     /* no default action */
6221     break;
6222   }
6223
6224   return offset - start;
6225 }
6226
6227 static guint
6228 add_ff_selfprot_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6229 {
6230   proto_tree_add_item(tree, hf_ieee80211_ff_selfprot_action, tvb, offset, 1,
6231                       ENC_LITTLE_ENDIAN);
6232   return 1;
6233 }
6234
6235 static guint
6236 add_ff_dls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6237 {
6238   proto_tree_add_item(tree, hf_ieee80211_ff_dls_action_code, tvb, offset, 1,
6239                       ENC_LITTLE_ENDIAN);
6240   return 1;
6241 }
6242
6243 static guint
6244 add_ff_dst_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6245 {
6246   proto_tree_add_item(tree, hf_ieee80211_ff_dst_mac_addr, tvb, offset, 6,
6247                       ENC_NA);
6248   return 6;
6249 }
6250
6251 static guint
6252 add_ff_src_mac_addr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6253 {
6254   proto_tree_add_item(tree, hf_ieee80211_ff_src_mac_addr, tvb, offset, 6,
6255                       ENC_NA);
6256   return 6;
6257 }
6258
6259 static guint
6260 add_ff_dls_timeout(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6261 {
6262   proto_tree_add_item(tree, hf_ieee80211_ff_dls_timeout, tvb, offset, 2,
6263                       ENC_LITTLE_ENDIAN);
6264   return 2;
6265 }
6266
6267 static guint
6268 add_ff_delba_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6269 {
6270   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_delba_param,
6271                          ett_ff_ba_param_tree, ieee80211_ff_delba_param_fields,
6272                          ENC_LITTLE_ENDIAN);
6273   return 2;
6274 }
6275
6276 static guint
6277 add_ff_max_reg_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6278 {
6279   proto_tree_add_item(tree, hf_ieee80211_ff_max_reg_pwr, tvb, offset, 2,
6280                       ENC_LITTLE_ENDIAN);
6281   return 2;
6282 }
6283
6284 static guint
6285 add_ff_measurement_pilot_int(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6286 {
6287   proto_tree_add_item(tree, hf_ieee80211_ff_measurement_pilot_int, tvb, offset,
6288                       2, ENC_LITTLE_ENDIAN);
6289   return 2;
6290 }
6291
6292 static guint
6293 add_ff_country_str(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6294 {
6295   proto_tree_add_item(tree, hf_ieee80211_ff_country_str, tvb, offset, 3,
6296                       ENC_ASCII|ENC_NA);
6297   return 3;
6298 }
6299
6300 static guint
6301 add_ff_max_tx_pwr(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6302 {
6303   proto_tree_add_item(tree, hf_ieee80211_ff_max_tx_pwr, tvb, offset, 1,
6304                       ENC_LITTLE_ENDIAN);
6305   return 1;
6306 }
6307
6308 static guint
6309 add_ff_tx_pwr_used(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6310 {
6311   proto_tree_add_item(tree, hf_ieee80211_ff_tx_pwr_used, tvb, offset, 1,
6312                       ENC_LITTLE_ENDIAN);
6313   return 1;
6314 }
6315
6316 static guint
6317 add_ff_transceiver_noise_floor(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6318 {
6319   proto_tree_add_item(tree, hf_ieee80211_ff_transceiver_noise_floor, tvb,
6320                       offset, 1, ENC_LITTLE_ENDIAN);
6321   return 1;
6322 }
6323
6324 static guint
6325 add_ff_channel_width(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6326 {
6327   proto_tree_add_item(tree, hf_ieee80211_ff_channel_width, tvb, offset, 1,
6328                       ENC_LITTLE_ENDIAN);
6329   return 1;
6330 }
6331
6332 static guint
6333 add_ff_qos_info_ap(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6334 {
6335   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_qos_info_ap,
6336                          ett_ff_qos_info, ieee80211_ff_qos_info_ap_fields,
6337                          ENC_LITTLE_ENDIAN);
6338   return 1;
6339 }
6340
6341 static guint
6342 add_ff_qos_info_sta(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6343 {
6344   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_qos_info_sta,
6345                          ett_ff_qos_info, ieee80211_ff_qos_info_sta_fields,
6346                          ENC_LITTLE_ENDIAN);
6347   return 1;
6348 }
6349
6350 static guint
6351 add_ff_sm_pwr_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6352 {
6353   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_sm_pwr_save,
6354                          ett_ff_sm_pwr_save, ieee80211_ff_sw_pwr_save_fields,
6355                          ENC_LITTLE_ENDIAN);
6356   return 1;
6357 }
6358
6359 static guint
6360 add_ff_pco_phase_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6361 {
6362   proto_tree_add_item(tree, hf_ieee80211_ff_pco_phase_cntrl, tvb, offset, 1,
6363                       ENC_LITTLE_ENDIAN);
6364   return 1;
6365 }
6366
6367 static guint
6368 add_ff_psmp_param_set(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6369 {
6370   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_psmp_param_set,
6371                          ett_ff_psmp_param_set,
6372                          ieee80211_ff_psmp_param_set_fields,
6373                          ENC_LITTLE_ENDIAN);
6374   return 2;
6375 }
6376
6377 static guint
6378 add_ff_mimo_cntrl(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6379 {
6380   proto_item *mimo_item;
6381   proto_tree *mimo_tree;
6382
6383   mimo_item = proto_tree_add_item(tree, hf_ieee80211_ff_mimo_cntrl, tvb,
6384                                   offset, 6, ENC_NA);
6385   mimo_tree = proto_item_add_subtree(mimo_item, ett_ff_mimo_cntrl);
6386
6387   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_nc_index, tvb,
6388                       offset, 1, ENC_LITTLE_ENDIAN);
6389   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_nr_index, tvb,
6390                       offset, 1, ENC_LITTLE_ENDIAN);
6391   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_channel_width, tvb,
6392                       offset, 1, ENC_LITTLE_ENDIAN);
6393   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_grouping, tvb,
6394                       offset, 1, ENC_LITTLE_ENDIAN);
6395   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_coefficient_size,
6396                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
6397   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_codebook_info, tvb,
6398                       offset, 1, ENC_LITTLE_ENDIAN);
6399   proto_tree_add_item(mimo_tree,
6400                       hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment, tvb,
6401                       offset, 1, ENC_LITTLE_ENDIAN);
6402   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_reserved, tvb,
6403                       offset, 1, ENC_LITTLE_ENDIAN);
6404
6405   offset += 2;
6406   proto_tree_add_item(mimo_tree, hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
6407                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
6408
6409   return 6;
6410 }
6411
6412 static guint
6413 add_ff_ant_selection(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6414 {
6415   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ant_selection,
6416                          ett_ff_ant_sel, ieee80211_ff_ant_selection_fields,
6417                          ENC_LITTLE_ENDIAN);
6418   return 1;
6419 }
6420
6421 static guint
6422 add_ff_extended_channel_switch_announcement(proto_tree *tree, tvbuff_t *tvb,
6423                                             packet_info *pinfo _U_, int offset)
6424 {
6425   proto_tree_add_bitmask(tree, tvb, offset,
6426                          hf_ieee80211_ff_ext_channel_switch_announcement,
6427                          ett_ff_chan_switch_announce,
6428                          ieee80211_ff_ext_channel_switch_announcement_fields,
6429                          ENC_LITTLE_ENDIAN);
6430   return 4;
6431 }
6432
6433 static guint
6434 add_ff_ht_information(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6435 {
6436   proto_tree_add_bitmask(tree, tvb, offset, hf_ieee80211_ff_ht_info,
6437                          ett_ff_ht_info, ieee80211_ff_ht_info_fields,
6438                          ENC_LITTLE_ENDIAN);
6439   return 1;
6440 }
6441
6442 static guint
6443 add_ff_ht_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6444 {
6445   proto_tree_add_item(tree, hf_ieee80211_ff_ht_action, tvb, offset, 1,
6446                       ENC_LITTLE_ENDIAN);
6447   return 1;
6448 }
6449
6450 static guint
6451 add_ff_psmp_sta_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6452 {
6453   proto_item *psmp_item;
6454   proto_tree *psmp_tree;
6455
6456   psmp_item = proto_tree_add_item(tree, hf_ieee80211_ff_psmp_sta_info, tvb,
6457                                   offset, 8, ENC_LITTLE_ENDIAN);
6458   psmp_tree = proto_item_add_subtree(psmp_item, ett_ff_psmp_sta_info);
6459
6460   proto_tree_add_item(psmp_item, hf_ieee80211_ff_psmp_sta_info_type, tvb,
6461                       offset, 4, ENC_LITTLE_ENDIAN);
6462
6463   switch (tvb_get_letohl(tvb, offset) & PSMP_STA_INFO_FLAG_TYPE) {
6464   case PSMP_STA_INFO_BROADCAST:
6465     proto_tree_add_item(psmp_tree,
6466                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
6467                         offset, 4, ENC_LITTLE_ENDIAN);
6468     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
6469                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
6470     /* Missing 64 bit bitmask... */
6471     proto_tree_add_uint64(psmp_tree,
6472                           hf_ieee80211_ff_psmp_sta_info_reserved_large,
6473                           tvb, offset, 8,
6474                           (tvb_get_letoh64(tvb, offset) &
6475                            G_GINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
6476     break;
6477   case PSMP_STA_INFO_MULTICAST:
6478     proto_tree_add_item(psmp_tree,
6479                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
6480                         offset, 4, ENC_LITTLE_ENDIAN);
6481     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
6482                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
6483     /* Missing 64 bit bitmask... */
6484     proto_tree_add_uint64(psmp_tree,
6485                           hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
6486                           tvb, offset, 6,
6487                           (tvb_get_letoh64(tvb, offset) &
6488                            G_GINT64_CONSTANT(0xFFFFFFFFFFE00000)) >> 21);
6489     break;
6490   case PSMP_STA_INFO_INDIVIDUALLY_ADDRESSED:
6491     proto_tree_add_item(psmp_tree,
6492                         hf_ieee80211_ff_psmp_sta_info_dtt_start_offset, tvb,
6493                         offset, 4, ENC_LITTLE_ENDIAN);
6494     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_dtt_duration,
6495                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
6496     offset += 2;
6497     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_sta_id, tvb,
6498                         offset, 4, ENC_LITTLE_ENDIAN);
6499     offset += 2;
6500
6501     proto_tree_add_item(psmp_tree,
6502                         hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
6503                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
6504     proto_tree_add_item(psmp_tree, hf_ieee80211_ff_psmp_sta_info_utt_duration,
6505                         tvb, offset, 4, ENC_LITTLE_ENDIAN);
6506     proto_tree_add_item(psmp_tree,
6507                         hf_ieee80211_ff_psmp_sta_info_reserved_small, tvb,
6508                         offset, 4, ENC_LITTLE_ENDIAN);
6509     break;
6510   }
6511
6512   return 8;
6513 }
6514
6515 static guint
6516 add_ff_schedule_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6517 {
6518   proto_item *sched_item;
6519   proto_tree *sched_tree;
6520
6521   sched_item = proto_tree_add_item(tree, hf_ieee80211_sched_info, tvb, offset,
6522                                    2, ENC_LITTLE_ENDIAN);
6523   sched_tree = proto_item_add_subtree(sched_item, ett_sched_tree);
6524
6525   proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_agg, tvb, offset, 2,
6526                       ENC_LITTLE_ENDIAN);
6527   if (tvb_get_letohs(tvb, offset) & 0x0001) {
6528     proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_tsid, tvb, offset,
6529                         2, ENC_LITTLE_ENDIAN);
6530     proto_tree_add_item(sched_tree, hf_ieee80211_sched_info_dir, tvb, offset,
6531                         2, ENC_LITTLE_ENDIAN);
6532   }
6533
6534   return 2;
6535 }
6536
6537 static guint
6538 add_ff_pa_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
6539 {
6540   proto_tree_add_item(tree, hf_ieee80211_ff_public_action, tvb, offset, 1,
6541                       ENC_BIG_ENDIAN);
6542   return 1;
6543 }
6544
6545 static guint
6546 add_ff_action_spectrum_mgmt(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6547 {
6548     switch (tvb_get_guint8(tvb, offset + 1)) {
6549     case SM_ACTION_MEASUREMENT_REQUEST:
6550     case SM_ACTION_MEASUREMENT_REPORT:
6551     case SM_ACTION_TPC_REQUEST:
6552     case SM_ACTION_TPC_REPORT:
6553       add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
6554       add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_ACTION_CODE);
6555       add_fixed_field(tree, tvb, pinfo, offset + 2, FIELD_DIALOG_TOKEN);
6556       return 3;
6557     case SM_ACTION_CHAN_SWITCH_ANNC:
6558     case SM_ACTION_EXT_CHAN_SWITCH_ANNC:
6559       add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
6560       add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_ACTION_CODE);
6561       return 2;
6562     default:
6563       add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
6564       add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_ACTION_CODE);
6565       return 2;
6566     }
6567 }
6568
6569 static guint
6570 add_ff_action_qos(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6571 {
6572   switch (tvb_get_guint8(tvb, offset + 1)) {
6573   case SM_ACTION_ADDTS_REQUEST:
6574     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6575     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
6576     add_fixed_field(tree, tvb, pinfo, offset + 2, FIELD_DIALOG_TOKEN);
6577     return 3;
6578   case SM_ACTION_ADDTS_RESPONSE:
6579     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6580     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
6581     add_fixed_field(tree, tvb, pinfo, offset + 2, FIELD_DIALOG_TOKEN);
6582     add_fixed_field(tree, tvb, pinfo, offset + 3, FIELD_STATUS_CODE);
6583     return 5;
6584   case SM_ACTION_DELTS:
6585     add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
6586     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
6587     add_fixed_field(tree, tvb, pinfo, offset + 2, FIELD_QOS_TS_INFO);
6588     add_fixed_field(tree, tvb, pinfo, offset + 5, FIELD_REASON_CODE);
6589     return 7;
6590   case SM_ACTION_QOS_SCHEDULE:
6591     add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
6592     add_fixed_field(tree, tvb, pinfo, offset + 1, FIELD_QOS_ACTION_CODE);
6593     return 2;
6594   default:
6595     add_fixed_field(tree, tvb, pinfo, offset,     FIELD_CATEGORY_CODE);
6596     return 2;
6597   }
6598 }
6599
6600 static guint
6601 add_ff_action_dls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6602 {
6603   switch (tvb_get_guint8(tvb, offset + 1)) {
6604   case SM_ACTION_DLS_REQUEST:
6605     add_fixed_field(tree, tvb, pinfo, offset,      FIELD_CATEGORY_CODE);
6606     add_fixed_field(tree, tvb, pinfo, offset +  1, FIELD_DLS_ACTION_CODE);
6607     add_fixed_field(tree, tvb, pinfo, offset +  2, FIELD_DST_MAC_ADDR);
6608     add_fixed_field(tree, tvb, pinfo, offset +  8, FIELD_SRC_MAC_ADDR);
6609     add_fixed_field(tree, tvb, pinfo, offset + 14, FIELD_CAP_INFO);
6610     add_fixed_field(tree, tvb, pinfo, offset + 16, FIELD_DLS_TIMEOUT);
6611     return 18;
6612   case SM_ACTION_DLS_RESPONSE:
6613     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6614     add_fixed_field(tree, tvb, pinfo, offset +  1, FIELD_DLS_ACTION_CODE);
6615     add_fixed_field(tree, tvb, pinfo, offset +  2, FIELD_STATUS_CODE);
6616     add_fixed_field(tree, tvb, pinfo, offset +  4, FIELD_DST_MAC_ADDR);
6617     add_fixed_field(tree, tvb, pinfo, offset + 10, FIELD_SRC_MAC_ADDR);
6618     if (!hf_ieee80211_ff_status_code) {
6619       add_fixed_field(tree, tvb, pinfo, offset + 16, FIELD_CAP_INFO);
6620     }
6621     return 16;
6622   case SM_ACTION_DLS_TEARDOWN:
6623     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6624     add_fixed_field(tree, tvb, pinfo, offset +  1, FIELD_DLS_ACTION_CODE);
6625     add_fixed_field(tree, tvb, pinfo, offset +  2, FIELD_DST_MAC_ADDR);
6626     add_fixed_field(tree, tvb, pinfo, offset +  8, FIELD_SRC_MAC_ADDR);
6627     add_fixed_field(tree, tvb, pinfo, offset + 14, FIELD_REASON_CODE);
6628     return 16;
6629   default:
6630     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6631     return 2;
6632   }
6633 }
6634
6635 static guint
6636 add_ff_action_block_ack(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6637 {
6638   guint start = offset;
6639
6640   switch (tvb_get_guint8(tvb, offset + 1)) {
6641   case BA_ADD_BLOCK_ACK_REQUEST:
6642     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6643     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_ACTION_CODE);
6644     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6645     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_PARAM);
6646     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_TIMEOUT);
6647     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
6648     break;
6649   case BA_ADD_BLOCK_ACK_RESPONSE:
6650     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6651     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_ACTION_CODE);
6652     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6653     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
6654     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_PARAM);
6655     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_TIMEOUT);
6656     break;
6657   case BA_DELETE_BLOCK_ACK:
6658     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6659     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_ACTION_CODE);
6660     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DELBA_PARAM_SET);
6661     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
6662     break;
6663   }
6664
6665   return offset - start;  /* Size of fixed fields */
6666 }
6667
6668 static guint
6669 add_ff_action_public(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6670 {
6671   guint    start = offset;
6672   guint32  oui;
6673   guint8   code;
6674   guint8   subtype;
6675   gboolean anqp;
6676   guint8   dialog_token;
6677   guint8   frag;
6678   gboolean more;
6679
6680   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6681   code    = tvb_get_guint8(tvb, offset);
6682   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PA_ACTION_CODE);
6683
6684   switch (code) {
6685   case PA_EXT_CHANNEL_SWITCH_ANNOUNCEMENT:
6686     offset += add_ff_extended_channel_switch_announcement(tree, tvb, pinfo, offset);
6687     break;
6688   case PA_VENDOR_SPECIFIC:
6689     oui = tvb_get_ntoh24(tvb, offset);
6690     proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
6691     offset += 3;
6692     switch (oui) {
6693     case OUI_WFA:
6694       subtype = tvb_get_guint8(tvb, offset);
6695       proto_tree_add_text(tree, tvb, offset, 1, "Subtype %u", subtype);
6696       offset += 1;
6697       if (subtype == WFA_SUBTYPE_P2P) {
6698         offset = dissect_wifi_p2p_public_action(pinfo, tree, tvb, offset);
6699       }
6700       break;
6701     default:
6702       /* Don't know how to handle this vendor */
6703       break;
6704     }
6705     break;
6706   case PA_GAS_INITIAL_REQUEST:
6707     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6708     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
6709                                              &anqp);
6710     offset += dissect_gas_initial_request(tree, tvb, pinfo, offset, anqp);
6711     break;
6712   case PA_GAS_INITIAL_RESPONSE:
6713     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6714     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
6715     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_GAS_COMEBACK_DELAY);
6716     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
6717                                              &anqp);
6718     offset += dissect_gas_initial_response(tree, tvb, pinfo, offset, anqp);
6719     break;
6720   case PA_GAS_COMEBACK_REQUEST:
6721     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6722     break;
6723   case PA_GAS_COMEBACK_RESPONSE:
6724     dialog_token = tvb_get_guint8(tvb, offset);
6725     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6726     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
6727     frag = tvb_get_guint8(tvb, offset) & 0x7f;
6728     more = (tvb_get_guint8(tvb, offset) & 0x80) != 0;
6729     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_GAS_FRAGMENT_ID);
6730     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_GAS_COMEBACK_DELAY);
6731     offset += dissect_advertisement_protocol(pinfo, tree, tvb, offset,
6732                                              &anqp);
6733     offset += dissect_gas_comeback_response(tree, tvb, pinfo, offset, anqp, frag,
6734                                             more, dialog_token);
6735     break;
6736   case PA_TDLS_DISCOVERY_RESPONSE:
6737     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
6738     col_set_str(pinfo->cinfo, COL_INFO, "TDLS Discovery Response");
6739     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6740     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
6741     break;
6742   }
6743
6744   return offset - start;  /* Size of fixed fields */
6745 }
6746
6747 static guint
6748 add_ff_action_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6749 {
6750   guint  start = offset;
6751   guint8 code;
6752
6753   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6754   code    = tvb_get_guint8(tvb, offset);
6755   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_FT_ACTION_CODE);
6756
6757   switch (code) {
6758   case FT_ACTION_REQUEST:
6759     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STA_ADDRESS);
6760     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_AP_ADDRESS);
6761     /* Followed by FT Request frame body (IEs) */
6762     break;
6763   case FT_ACTION_RESPONSE:
6764     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STA_ADDRESS);
6765     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_AP_ADDRESS);
6766     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
6767     /* Followed by FT Response frame body (IEs) */
6768     break;
6769   case FT_ACTION_CONFIRM:
6770     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STA_ADDRESS);
6771     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_AP_ADDRESS);
6772     /* Followed by FT Confirm frame body (IEs) */
6773     break;
6774   case FT_ACTION_ACK:
6775     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STA_ADDRESS);
6776     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_AP_ADDRESS);
6777     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
6778     /* Followed by FT Ack frame body (IEs) */
6779     break;
6780   }
6781
6782   return offset - start;  /* Size of fixed fields */
6783 }
6784
6785 static guint
6786 add_ff_action_sa_query(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6787 {
6788   guint  start = offset;
6789   guint8 code;
6790
6791   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6792   code    = tvb_get_guint8(tvb, offset);
6793   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SA_QUERY_ACTION_CODE);
6794
6795   switch (code) {
6796   case SA_QUERY_REQUEST:
6797     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TRANSACTION_ID);
6798     break;
6799   case SA_QUERY_RESPONSE:
6800     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TRANSACTION_ID);
6801     break;
6802   }
6803
6804   return offset - start;  /* Size of fixed fields */
6805 }
6806
6807 static guint
6808 add_ff_action_mesh(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6809 {
6810   guint length;
6811
6812   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6813   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MESH_ACTION);
6814   /* The only fixed fields are the category and mesh action.  The rest are IEs.
6815    */
6816   length = 2;
6817   if (tvb_get_guint8(tvb, 1) == MESH_ACTION_TBTT_ADJ_RESPONSE) {
6818     /* ..except for the TBTT Adjustment Response, which has a status code field
6819      */
6820     length += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
6821   }
6822   return length;
6823 }
6824
6825 static guint
6826 add_ff_action_multihop(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6827 {
6828   guint start = offset;
6829
6830   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6831   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MULTIHOP_ACTION);
6832   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MESH_CONTROL);
6833   return offset - start;
6834 }
6835
6836 static guint
6837 add_ff_action_self_protected(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6838 {
6839   guint start = offset;
6840
6841   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6842   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SELFPROT_ACTION);
6843
6844   switch (tvb_get_guint8(tvb, start + 1)) {
6845   case SELFPROT_ACTION_MESH_PEERING_OPEN:
6846     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
6847     break;
6848   case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
6849     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
6850     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_ASSOC_ID);
6851     break;
6852   }
6853
6854   return offset - start;
6855 }
6856
6857 static guint
6858 wnm_bss_trans_mgmt_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6859 {
6860   int    start = offset;
6861   guint8 mode;
6862   gint   left;
6863
6864   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6865
6866   mode = tvb_get_guint8(tvb, offset);
6867   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_pref_cand,
6868                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6869   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_abridged,
6870                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6871   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_disassoc_imminent,
6872                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6873   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_bss_term_included,
6874                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6875   proto_tree_add_item(tree, hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
6876                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
6877   offset += 1;
6878
6879   proto_tree_add_item(tree, hf_ieee80211_ff_disassoc_timer, tvb, offset, 2,
6880                       ENC_LITTLE_ENDIAN);
6881   offset += 2;
6882
6883   proto_tree_add_item(tree, hf_ieee80211_ff_validity_interval, tvb, offset, 1,
6884                       ENC_LITTLE_ENDIAN);
6885   offset += 1;
6886
6887   if (mode & 0x08) {
6888     proto_tree_add_text(tree, tvb, offset, 8, "BSS Termination Duration");
6889     offset += 8;
6890   }
6891
6892   if (mode & 0x10) {
6893     guint8 url_len;
6894     url_len = tvb_get_guint8(tvb, offset);
6895     proto_tree_add_item(tree, hf_ieee80211_ff_url_len, tvb, offset, 1,
6896                         ENC_LITTLE_ENDIAN);
6897     offset += 1;
6898     proto_tree_add_item(tree, hf_ieee80211_ff_url, tvb, offset, url_len,
6899                         ENC_ASCII|ENC_NA);
6900     offset += url_len;
6901   }
6902
6903   left = tvb_reported_length_remaining(tvb, offset);
6904   if (left > 0) {
6905     proto_tree_add_text(tree, tvb, offset, left,
6906                         "BSS Transition Candidate List Entries");
6907     offset += left;
6908   }
6909
6910   return offset - start;
6911 }
6912
6913 static guint
6914 wnm_sleep_mode_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6915 {
6916   int start = offset;
6917   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6918   return offset - start;
6919 }
6920
6921 static guint
6922 wnm_sleep_mode_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6923 {
6924   int start = offset;
6925   guint16 key_data_len;
6926   gint left;
6927
6928   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6929   key_data_len = tvb_get_letohs(tvb, offset);
6930   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_KEY_DATA_LENGTH);
6931   left = tvb_reported_length_remaining(tvb, offset);
6932   if (left < key_data_len) {
6933     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
6934                            "WNM-Sleep Mode Response is not long enough to "
6935                            "include Key Data");
6936     return offset - start;
6937   }
6938   proto_tree_add_item(tree, hf_ieee80211_ff_key_data, tvb, offset,
6939                       key_data_len, ENC_NA);
6940   offset += key_data_len;
6941   return offset - start;
6942 }
6943
6944 static guint
6945 wnm_tfs_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6946 {
6947   int start = offset;
6948   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6949   return offset - start;
6950 }
6951
6952 static guint
6953 wnm_tfs_resp(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6954 {
6955   int start = offset;
6956   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6957   return offset - start;
6958 }
6959
6960 static guint
6961 wnm_notification_req(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6962 {
6963   int start = offset;
6964   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
6965   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_WNM_NOTIFICATION_TYPE);
6966   return offset - start;
6967 }
6968
6969 static guint
6970 add_ff_action_wnm(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
6971 {
6972   guint8 code;
6973   guint  start = offset;
6974
6975   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
6976   code    = tvb_get_guint8(tvb, offset);
6977   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_WNM_ACTION_CODE);
6978   switch (code) {
6979   case WNM_BSS_TRANS_MGMT_REQ:
6980     offset += wnm_bss_trans_mgmt_req(tree, tvb, pinfo, offset);
6981     break;
6982   case WNM_TFS_REQ:
6983     offset += wnm_tfs_req(tree, tvb, pinfo, offset);
6984     break;
6985   case WNM_TFS_RESP:
6986     offset += wnm_tfs_resp(tree, tvb, pinfo, offset);
6987     break;
6988   case WNM_SLEEP_MODE_REQ:
6989     offset += wnm_sleep_mode_req(tree, tvb, pinfo, offset);
6990     break;
6991   case WNM_SLEEP_MODE_RESP:
6992     offset += wnm_sleep_mode_resp(tree, tvb, pinfo, offset);
6993     break;
6994   case WNM_NOTIFICATION_REQ:
6995     offset += wnm_notification_req(tree, tvb, pinfo, offset);
6996     break;
6997   }
6998
6999   return offset - start;  /* Size of fixed fields */
7000 }
7001
7002 static guint
7003 add_ff_action_tdls(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7004 {
7005   guint8  code;
7006   guint16 status;
7007   guint   start = offset;
7008
7009   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7010   code = tvb_get_guint8(tvb, offset);
7011   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TDLS_ACTION_CODE);
7012   switch (code) {
7013   case TDLS_SETUP_REQUEST:
7014     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7015     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
7016     break;
7017   case TDLS_SETUP_RESPONSE:
7018     status = tvb_get_letohs(tvb, offset);
7019     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7020     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7021     if (tvb_reported_length_remaining(tvb, offset) < 2) {
7022       if (status == 0) {
7023         expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
7024                                "TDLS Setup Response (success) does not "
7025                                "include mandatory fields");
7026       }
7027       break;
7028     }
7029     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CAP_INFO);
7030     break;
7031   case TDLS_SETUP_CONFIRM:
7032     status = tvb_get_letohs(tvb, offset);
7033     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7034     if (tvb_reported_length_remaining(tvb, offset) < 1) {
7035       if (status == 0) {
7036         expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
7037                                "TDLS Setup Confirm (success) does not include "
7038                                "mandatory fields");
7039       }
7040       break;
7041     }
7042     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7043     break;
7044   case TDLS_TEARDOWN:
7045     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
7046     break;
7047   case TDLS_PEER_TRAFFIC_INDICATION:
7048     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7049     break;
7050   case TDLS_CHANNEL_SWITCH_REQUEST:
7051     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_TARGET_CHANNEL);
7052     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REGULATORY_CLASS);
7053     break;
7054   case TDLS_CHANNEL_SWITCH_RESPONSE:
7055     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7056     break;
7057   case TDLS_PEER_PSM_REQUEST:
7058     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7059     break;
7060   case TDLS_PEER_PSM_RESPONSE:
7061     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7062     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_STATUS_CODE);
7063     break;
7064   case TDLS_PEER_TRAFFIC_RESPONSE:
7065     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7066     break;
7067   case TDLS_DISCOVERY_REQUEST:
7068     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7069     break;
7070   }
7071
7072   return offset - start;  /* Size of fixed fields */
7073 }
7074
7075 static guint
7076 add_ff_action_mgmt_notification(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7077 {
7078   guint start = offset;
7079
7080   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7081   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_WME_ACTION_CODE);
7082   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_DIALOG_TOKEN);
7083   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_WME_STATUS_CODE);
7084
7085   return offset - start;  /* Size of fixed fields */
7086 }
7087
7088 static guint
7089 add_ff_action_vendor_specific(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7090 {
7091   guint   start = offset;
7092   guint32 oui;
7093   guint8  subtype;
7094
7095   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7096   oui = tvb_get_ntoh24(tvb, offset);
7097   proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
7098   offset += 3;
7099   switch (oui) {
7100   case OUI_MARVELL:
7101     offset = dissect_vendor_action_marvell(tree, tvb, offset);
7102     break;
7103   case OUI_WFA:
7104     subtype = tvb_get_guint8(tvb, offset);
7105     proto_tree_add_text(tree, tvb, offset, 1, "Subtype %u", subtype);
7106     offset += 1;
7107     if (subtype == WFA_SUBTYPE_P2P) {
7108       offset = dissect_wifi_p2p_action(tree, tvb, offset);
7109     }
7110     break;
7111   default:
7112     /* Don't know how to handle this vendor */
7113     break;
7114   }
7115
7116   return offset - start;  /* Size of fixed fields */
7117 }
7118
7119 static guint
7120 add_ff_action_ht(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7121 {
7122   guint  start = offset;
7123   guint8 n_sta, i;
7124   mimo_control_t mimo_cntrl;
7125
7126   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7127   offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_HT_ACTION_CODE);
7128
7129   switch (tvb_get_guint8(tvb, offset - 1)) {
7130   case HT_ACTION_NOTIFY_CHAN_WIDTH:
7131     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_CHANNEL_WIDTH);
7132     break;
7133   case HT_ACTION_SM_PWR_SAVE:
7134     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_SM_PWR_CNTRL);
7135     break;
7136   case HT_ACTION_PSMP_ACTION:
7137     n_sta = tvb_get_guint8(tvb, offset);
7138     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PSMP_PARAM_SET);
7139     for (i = 0; i < (n_sta & 0x0F); i++) {
7140       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PSMP_STA_INFO);
7141     }
7142     break;
7143   case HT_ACTION_SET_PCO_PHASE:
7144     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_PCO_PHASE_CNTRL);
7145     break;
7146   case HT_ACTION_MIMO_CSI:
7147     mimo_cntrl = get_mimo_control(tvb, offset);
7148     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MIMO_CNTRL);
7149     offset += add_mimo_csi_matrices_report(tree, tvb, offset, mimo_cntrl);
7150     break;
7151   case HT_ACTION_MIMO_BEAMFORMING:
7152     mimo_cntrl = get_mimo_control(tvb, offset);
7153     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MIMO_CNTRL);
7154     offset += add_mimo_beamforming_feedback_report(tree, tvb, offset,
7155                                                    mimo_cntrl);
7156     break;
7157   case HT_ACTION_MIMO_COMPRESSED_BEAMFORMING:
7158     mimo_cntrl = get_mimo_control(tvb, offset);
7159     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_MIMO_CNTRL);
7160     offset += add_mimo_compressed_beamforming_feedback_report(tree, tvb,
7161                                                               offset,
7162                                                               mimo_cntrl);
7163     break;
7164   case HT_ACTION_ANT_SEL_FEEDBACK:
7165     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_ANT_SELECTION);
7166     break;
7167   case HT_ACTION_HT_INFO_EXCHANGE:
7168     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_HT_INFORMATION);
7169     break;
7170   }
7171
7172   return offset - start;
7173 }
7174
7175 static guint
7176 add_ff_action(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7177 {
7178   switch (tvb_get_guint8(tvb, offset) & 0x7f) {
7179   case CAT_SPECTRUM_MGMT:
7180     return add_ff_action_spectrum_mgmt(tree, tvb, pinfo, offset);
7181   case CAT_QOS:
7182     return add_ff_action_qos(tree, tvb, pinfo, offset);
7183   case CAT_DLS:
7184     return add_ff_action_dls(tree, tvb, pinfo, offset);
7185   case CAT_BLOCK_ACK:
7186     return add_ff_action_block_ack(tree, tvb, pinfo, offset);
7187   case CAT_PUBLIC:
7188     return add_ff_action_public(tree, tvb, pinfo, offset);
7189   case CAT_FAST_BSS_TRANSITION:
7190     return add_ff_action_fast_bss_transition(tree, tvb, pinfo, offset);
7191   case CAT_SA_QUERY:
7192     return add_ff_action_sa_query(tree, tvb, pinfo, offset);
7193   case CAT_MESH:
7194     return add_ff_action_mesh(tree, tvb, pinfo, offset);
7195   case CAT_MULTIHOP:
7196     return add_ff_action_multihop(tree, tvb, pinfo, offset);
7197   case CAT_SELF_PROTECTED:
7198     return add_ff_action_self_protected(tree, tvb, pinfo, offset);
7199   case CAT_WNM:
7200     return add_ff_action_wnm(tree, tvb, pinfo, offset);
7201   case CAT_TDLS:
7202     return add_ff_action_tdls(tree, tvb, pinfo, offset);
7203   case CAT_MGMT_NOTIFICATION:  /* Management notification frame */
7204     return add_ff_action_mgmt_notification(tree, tvb, pinfo, offset);
7205   case CAT_VENDOR_SPECIFIC:  /* Vendor Specific Category */
7206     return add_ff_action_vendor_specific(tree, tvb, pinfo, offset);
7207   case CAT_HT:
7208     return add_ff_action_ht(tree, tvb, pinfo, offset);
7209   default:
7210     add_fixed_field(tree, tvb, pinfo, offset, FIELD_CATEGORY_CODE);
7211     return 1;
7212   }
7213 }
7214
7215 static guint
7216 add_ff_ft_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7217 {
7218   proto_tree_add_item(tree, hf_ieee80211_ff_ft_action_code, tvb, offset, 1,
7219                       ENC_BIG_ENDIAN);
7220   return 1;
7221 }
7222
7223 static guint
7224 add_ff_sta_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7225 {
7226   proto_tree_add_item(tree, hf_ieee80211_ff_sta_address, tvb, offset, 6,
7227                       ENC_NA);
7228   return 6;
7229 }
7230
7231 static guint
7232 add_ff_target_ap_address(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7233 {
7234   proto_tree_add_item(tree, hf_ieee80211_ff_target_ap_address, tvb, offset, 6,
7235                       ENC_NA);
7236   return 6;
7237 }
7238
7239 static guint
7240 add_ff_gas_comeback_delay(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7241 {
7242   proto_tree_add_item(tree, hf_ieee80211_ff_gas_comeback_delay, tvb, offset, 2,
7243                       ENC_LITTLE_ENDIAN);
7244   return 2;
7245 }
7246
7247 static guint
7248 add_ff_gas_fragment_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7249 {
7250   proto_tree_add_item(tree, hf_ieee80211_ff_gas_fragment_id, tvb, offset, 1,
7251                       ENC_BIG_ENDIAN);
7252   proto_tree_add_item(tree, hf_ieee80211_ff_more_gas_fragments, tvb, offset, 1,
7253                       ENC_BIG_ENDIAN);
7254   return 1;
7255 }
7256
7257 static guint
7258 add_ff_sa_query_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7259 {
7260   proto_tree_add_item(tree, hf_ieee80211_ff_sa_query_action_code, tvb, offset,
7261                       1, ENC_BIG_ENDIAN);
7262   return 1;
7263 }
7264
7265 static guint
7266 add_ff_transaction_id(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7267 {
7268   proto_tree_add_item(tree, hf_ieee80211_ff_transaction_id, tvb, offset, 2,
7269                       ENC_LITTLE_ENDIAN);
7270   return 2;
7271 }
7272
7273 static guint
7274 add_ff_tdls_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7275 {
7276   guint8 code;
7277   code = tvb_get_guint8(tvb, offset);
7278   col_set_str(pinfo->cinfo, COL_INFO,
7279               val_to_str_ext_const(code, &tdls_action_codes_ext,
7280                                    "Unknown TDLS Action"));
7281   proto_tree_add_item(tree, hf_ieee80211_ff_tdls_action_code, tvb, offset, 1,
7282                       ENC_BIG_ENDIAN);
7283   return 1;
7284 }
7285
7286 static guint
7287 add_ff_target_channel(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7288 {
7289   proto_tree_add_item(tree, hf_ieee80211_ff_target_channel, tvb, offset, 1,
7290                       ENC_BIG_ENDIAN);
7291   return 1;
7292 }
7293
7294 static guint
7295 add_ff_regulatory_class(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7296 {
7297   proto_tree_add_item(tree, hf_ieee80211_ff_regulatory_class, tvb, offset, 1,
7298                       ENC_BIG_ENDIAN);
7299   return 1;
7300 }
7301
7302 static guint
7303 add_ff_wnm_action_code(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset)
7304 {
7305   guint8 code;
7306
7307   code = tvb_get_guint8(tvb, offset);
7308   col_set_str(pinfo->cinfo, COL_INFO,
7309               val_to_str_ext_const(code, &wnm_action_codes_ext, "Unknown WNM Action"));
7310   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_action_code, tvb, offset, 1, ENC_BIG_ENDIAN);
7311   return 1;
7312 }
7313
7314 static guint
7315 add_ff_key_data_length(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7316 {
7317   proto_tree_add_item(tree, hf_ieee80211_ff_key_data_length, tvb, offset, 2,
7318                       ENC_LITTLE_ENDIAN);
7319   return 2;
7320 }
7321
7322 struct ieee80211_fixed_field_dissector {
7323   enum fixed_field lfcode;
7324   guint (*dissector)(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset);
7325 };
7326
7327 static guint
7328 add_ff_wnm_notification_type(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo _U_, int offset)
7329 {
7330   proto_tree_add_item(tree, hf_ieee80211_ff_wnm_notification_type,
7331                       tvb, offset, 1, ENC_NA);
7332   return 1;
7333 }
7334
7335 #define FF_FIELD(f, func) { FIELD_ ## f, add_ff_ ## func }
7336
7337 static const struct ieee80211_fixed_field_dissector ff_dissectors[] = {
7338   FF_FIELD(TIMESTAMP                             , timestamp),
7339   FF_FIELD(BEACON_INTERVAL                       , beacon_interval),
7340   FF_FIELD(CAP_INFO                              , cap_info),
7341   FF_FIELD(AUTH_ALG                              , auth_alg),
7342   FF_FIELD(AUTH_TRANS_SEQ                        , auth_trans_seq),
7343   FF_FIELD(CURRENT_AP_ADDR                       , current_ap_addr),
7344   FF_FIELD(LISTEN_IVAL                           , listen_ival),
7345   FF_FIELD(REASON_CODE                           , reason_code),
7346   FF_FIELD(ASSOC_ID                              , assoc_id),
7347   FF_FIELD(STATUS_CODE                           , status_code),
7348   FF_FIELD(CATEGORY_CODE                         , category_code),
7349   FF_FIELD(ACTION_CODE                           , action_code),
7350   FF_FIELD(DIALOG_TOKEN                          , dialog_token),
7351   FF_FIELD(WME_ACTION_CODE                       , wme_action_code),
7352   FF_FIELD(WME_STATUS_CODE                       , wme_status_code),
7353   FF_FIELD(QOS_ACTION_CODE                       , qos_action_code),
7354   FF_FIELD(BLOCK_ACK_ACTION_CODE                 , block_ack_action_code),
7355   FF_FIELD(BLOCK_ACK_PARAM                       , block_ack_param),
7356   FF_FIELD(BLOCK_ACK_TIMEOUT                     , block_ack_timeout),
7357   FF_FIELD(BLOCK_ACK_SSC                         , block_ack_ssc),
7358   FF_FIELD(QOS_TS_INFO                           , qos_ts_info),
7359   FF_FIELD(MESH_ACTION                           , mesh_action),
7360   FF_FIELD(MULTIHOP_ACTION                       , multihop_action),
7361   FF_FIELD(MESH_CONTROL                          , mesh_control),
7362   FF_FIELD(SELFPROT_ACTION                       , selfprot_action),
7363   FF_FIELD(DLS_ACTION_CODE                       , dls_action_code),
7364   FF_FIELD(DST_MAC_ADDR                          , dst_mac_addr),
7365   FF_FIELD(SRC_MAC_ADDR                          , src_mac_addr),
7366   FF_FIELD(DLS_TIMEOUT                           , dls_timeout),
7367   FF_FIELD(DELBA_PARAM_SET                       , delba_param_set),
7368   FF_FIELD(MAX_REG_PWR                           , max_reg_pwr),
7369   FF_FIELD(MEASUREMENT_PILOT_INT                 , measurement_pilot_int),
7370   FF_FIELD(COUNTRY_STR                           , country_str),
7371   FF_FIELD(MAX_TX_PWR                            , max_tx_pwr),
7372   FF_FIELD(TX_PWR_USED                           , tx_pwr_used),
7373   FF_FIELD(TRANSCEIVER_NOISE_FLOOR               , transceiver_noise_floor),
7374   FF_FIELD(CHANNEL_WIDTH                         , channel_width),
7375   FF_FIELD(QOS_INFO_AP                           , qos_info_ap),
7376   FF_FIELD(QOS_INFO_STA                          , qos_info_sta),
7377   FF_FIELD(SM_PWR_CNTRL                          , sm_pwr_cntrl),
7378   FF_FIELD(PCO_PHASE_CNTRL                       , pco_phase_cntrl),
7379   FF_FIELD(PSMP_PARAM_SET                        , psmp_param_set),
7380   FF_FIELD(MIMO_CNTRL                            , mimo_cntrl),
7381   FF_FIELD(ANT_SELECTION                         , ant_selection),
7382   FF_FIELD(EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT  , extended_channel_switch_announcement) ,
7383   FF_FIELD(HT_INFORMATION                        , ht_information),
7384   FF_FIELD(HT_ACTION_CODE                        , ht_action_code),
7385   FF_FIELD(PSMP_STA_INFO                         , psmp_sta_info),
7386   FF_FIELD(SCHEDULE_INFO                         , schedule_info),
7387   FF_FIELD(PA_ACTION_CODE                        , pa_action_code),
7388   FF_FIELD(ACTION                                , action),
7389   FF_FIELD(FT_ACTION_CODE                        , ft_action_code),
7390   FF_FIELD(STA_ADDRESS                           , sta_address),
7391   FF_FIELD(TARGET_AP_ADDRESS                     , target_ap_address),
7392   FF_FIELD(GAS_COMEBACK_DELAY                    , gas_comeback_delay),
7393   FF_FIELD(GAS_FRAGMENT_ID                       , gas_fragment_id),
7394   FF_FIELD(SA_QUERY_ACTION_CODE                  , sa_query_action_code),
7395   FF_FIELD(TRANSACTION_ID                        , transaction_id),
7396   FF_FIELD(TDLS_ACTION_CODE                      , tdls_action_code),
7397   FF_FIELD(TARGET_CHANNEL                        , target_channel),
7398   FF_FIELD(REGULATORY_CLASS                      , regulatory_class),
7399   FF_FIELD(WNM_ACTION_CODE                       , wnm_action_code),
7400   FF_FIELD(KEY_DATA_LENGTH                       , key_data_length),
7401   FF_FIELD(WNM_NOTIFICATION_TYPE                 , wnm_notification_type),
7402   { (enum fixed_field)-1                         , NULL }
7403 };
7404
7405 #undef FF_FIELD
7406
7407 static guint
7408 add_fixed_field(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
7409                 enum fixed_field lfcode)
7410 {
7411   int i;
7412   for (i = 0; ff_dissectors[i].dissector; i++) {
7413     if (ff_dissectors[i].lfcode == lfcode) {
7414       return ff_dissectors[i].dissector(tree, tvb, pinfo, offset);
7415     }
7416   }
7417   return 0;
7418 }
7419
7420 static const value_string ieee80211_rsn_cipher_vals[] = {
7421   {0, "NONE"},
7422   {1, "WEP (40-bit)"},
7423   {2, "TKIP"},
7424   {3, "AES (OCB)"},
7425   {4, "AES (CCM)"},
7426   {5, "WEP (104-bit)"},
7427   {6, "BIP"},
7428   {7, "Group addressed traffic not allowed"},
7429   {0, NULL}
7430 };
7431
7432 static const value_string ieee80211_rsn_keymgmt_vals[] = {
7433   {0, "NONE"},
7434   {1, "WPA"},
7435   {2, "PSK"},
7436   {3, "FT over IEEE 802.1X"},
7437   {4, "FT using PSK"},
7438   {5, "WPA (SHA256)"},
7439   {6, "PSK (SHA256)"},
7440   {7, "TDLS / TPK Handshake"},
7441   {0, NULL}
7442 };
7443
7444 static void
7445 oui_base_custom(gchar *result, guint32 oui)
7446 {
7447   guint8       p_oui[3];
7448   const gchar *manuf_name;
7449
7450   p_oui[0] = oui >> 16 & 0xFF;
7451   p_oui[1] = oui >> 8 & 0xFF;
7452   p_oui[2] = oui & 0xFF;
7453
7454   /* Attempt an OUI lookup. */
7455   manuf_name = get_manuf_name_if_known(p_oui);
7456   if (manuf_name == NULL) {
7457       /* Could not find an OUI. */
7458       g_snprintf(result, ITEM_LABEL_LENGTH, "%.2x-%.2x-%.2x", p_oui[0], p_oui[1], p_oui[2]);
7459   }
7460   else {
7461       /* Found an address string. */
7462       g_snprintf(result, ITEM_LABEL_LENGTH, "%.2x-%.2x-%.2x (%s)", p_oui[0], p_oui[1], p_oui[2], manuf_name);
7463   }
7464 }
7465
7466 static void
7467 rsn_gcs_base_custom(gchar *result, guint32 gcs)
7468 {
7469   gchar *oui_result;
7470
7471   oui_result = (gchar *)ep_alloc(SHORT_STR);
7472   oui_result[0] = '\0';
7473   oui_base_custom(oui_result, gcs >> 8);
7474   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
7475              val_to_str(gcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d"));
7476 }
7477
7478 static void
7479 rsn_pcs_base_custom(gchar *result, guint32 pcs)
7480 {
7481   gchar *oui_result;
7482
7483   oui_result = (gchar *)ep_alloc(SHORT_STR);
7484   oui_result[0] = '\0';
7485   oui_base_custom(oui_result, pcs >> 8);
7486   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
7487              val_to_str(pcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d"));
7488
7489 }
7490 static void
7491 rsn_akms_base_custom(gchar *result, guint32 akms)
7492 {
7493   gchar *oui_result;
7494
7495   oui_result = (gchar *)ep_alloc(SHORT_STR);
7496   oui_result[0] = '\0';
7497   oui_base_custom(oui_result, akms >> 8);
7498   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
7499              val_to_str(akms & 0xFF, ieee80211_rsn_keymgmt_vals, "Unknown %d"));
7500 }
7501
7502 static gchar *
7503 rsn_pcs_return(guint32 pcs)
7504 {
7505   gchar *result;
7506
7507   result = (gchar *)ep_alloc(SHORT_STR);
7508   result[0] = '\0';
7509   rsn_pcs_base_custom(result, pcs);
7510
7511   return result;
7512 }
7513
7514 static gchar *
7515 rsn_akms_return(guint32 akms)
7516 {
7517   gchar *result;
7518
7519   result = (gchar *)ep_alloc(SHORT_STR);
7520   result[0] = '\0';
7521   rsn_akms_base_custom(result, akms);
7522
7523   return result;
7524 }
7525
7526 static void
7527 rsn_gmcs_base_custom(gchar *result, guint32 gmcs)
7528 {
7529   gchar *oui_result;
7530
7531   oui_result = (gchar *)ep_alloc(SHORT_STR);
7532   oui_result[0] = '\0';
7533   oui_base_custom(oui_result, gmcs >> 8);
7534   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
7535              val_to_str(gmcs & 0xFF, ieee80211_rsn_cipher_vals, "Unknown %d"));
7536 }
7537
7538 static void
7539 rsni_base_custom(gchar *result, guint32 rsni)
7540 {
7541    double temp_double;
7542
7543    temp_double = (double)rsni;
7544    g_snprintf(result, ITEM_LABEL_LENGTH, "%f dB", (temp_double / 2));
7545 }
7546
7547 /* WPA / WME */
7548 static const value_string ieee802111_wfa_ie_type_vals[] = {
7549   { 1, "WPA Information Element" },
7550   { 2, "WMM/WME" },
7551   { 4, "WPS" },
7552   { 0, NULL }
7553 };
7554
7555 static const value_string ieee80211_wfa_ie_wpa_cipher_vals[] = {
7556   { 0, "NONE" },
7557   { 1, "WEP (40-bit)" },
7558   { 2, "TKIP" },
7559   { 3, "AES (OCB)" },
7560   { 4, "AES (CCM)" },
7561   { 5, "WEP (104-bit)" },
7562   { 6, "BIP" },
7563   { 7, "Group addressed traffic not allowed" },
7564   { 0, NULL }
7565 };
7566
7567 static const value_string ieee80211_wfa_ie_wpa_keymgmt_vals[] = {
7568   { 0, "NONE" },
7569   { 1, "WPA" },
7570   { 2, "PSK" },
7571   { 3, "FT over IEEE 802.1X" },
7572   { 4, "FT using PSK" },
7573   { 5, "WPA (SHA256)" },
7574   { 6, "PSK (SHA256)" },
7575   { 7, "TDLS / TPK Handshake" },
7576   { 0, NULL }
7577 };
7578
7579 static const value_string ieee80211_wfa_ie_wme_acs_vals[] = {
7580   { 0, "Best Effort" },
7581   { 1, "Background" },
7582   { 2, "Video" },
7583   { 3, "Voice" },
7584   { 0, NULL }
7585 };
7586
7587 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals[] = {
7588   { 0, "Uplink" },
7589   { 1, "Downlink" },
7590   { 2, "Direct link" },
7591   { 3, "Bidirectional link" },
7592   { 0, NULL }
7593 };
7594
7595 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals[] = {
7596   { 0, "Legacy" },
7597   { 1, "U-APSD" },
7598   { 0, NULL }
7599 };
7600
7601 static const value_string ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals[] = {
7602   { 0, "Best Effort" },
7603   { 1, "Background" },
7604   { 2, "Spare" },
7605   { 3, "Excellent Effort" },
7606   { 4, "Controlled Load" },
7607   { 5, "Video" },
7608   { 6, "Voice" },
7609   { 7, "Network Control" },
7610   { 0, NULL }
7611 };
7612
7613 static const value_string ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals[] = {
7614   { 0, "WMM AP may deliver all buffered frames (MSDUs and MMPDUs)" },
7615   { 1, "WMM AP may deliver a maximum of 2 buffered frames (MSDUs and MMPDUs) per USP" },
7616   { 2, "WMM AP may deliver a maximum of 4 buffered frames (MSDUs and MMPDUs) per USP" },
7617   { 3, "WMM AP may deliver a maximum of 6 buffered frames (MSDUs and MMPDUs) per USP" },
7618   { 0, NULL}
7619 };
7620 static const true_false_string ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs = {
7621   "WMM delivery and trigger enabled",
7622   "non-WMM PS"
7623 };
7624
7625 static void
7626 wpa_mcs_base_custom(gchar *result, guint32 mcs)
7627 {
7628   gchar *oui_result;
7629
7630   oui_result = (gchar *)ep_alloc(SHORT_STR);
7631   oui_result[0] = '\0';
7632   oui_base_custom(oui_result, mcs >> 8);
7633   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
7634              val_to_str(mcs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d"));
7635 }
7636
7637 static void
7638 wpa_ucs_base_custom(gchar *result, guint32 ucs)
7639 {
7640   gchar *oui_result;
7641
7642   oui_result = (gchar *)ep_alloc(SHORT_STR);
7643   oui_result[0] = '\0';
7644   oui_base_custom(oui_result, ucs >> 8);
7645   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
7646              val_to_str(ucs & 0xFF, ieee80211_wfa_ie_wpa_cipher_vals, "Unknown %d"));
7647
7648 }
7649 static void
7650 wpa_akms_base_custom(gchar *result, guint32 akms)
7651 {
7652   gchar *oui_result;
7653
7654   oui_result = (gchar *)ep_alloc(SHORT_STR);
7655   oui_result[0] = '\0';
7656   oui_base_custom(oui_result, akms >> 8);
7657   g_snprintf(result, ITEM_LABEL_LENGTH, "%s %s", oui_result,
7658              val_to_str(akms & 0xFF, ieee80211_wfa_ie_wpa_keymgmt_vals, "Unknown %d"));
7659 }
7660
7661 static gchar *
7662 wpa_ucs_return(guint32 ucs)
7663 {
7664   gchar *result;
7665
7666   result = (gchar *)ep_alloc(SHORT_STR);
7667   result[0] = '\0';
7668   wpa_ucs_base_custom(result, ucs);
7669
7670   return result;
7671 }
7672
7673 static gchar *
7674 wpa_akms_return(guint32 akms)
7675 {
7676   gchar *result;
7677
7678   result = (gchar *)ep_alloc(SHORT_STR);
7679   result[0] = '\0';
7680   wpa_akms_base_custom(result, akms);
7681
7682   return result;
7683 }
7684
7685 /* For each Field */
7686 static const value_string ieee80211_wapi_suite_type[] = {
7687   {0, "Reserved"},
7688   {1, "WAI Certificate Authentication and Key Management"},
7689   {2, "WAI Preshared Key Authentication and Key Management"},
7690   {0, NULL},
7691 };
7692 /* For Summary Tag Information */
7693 static const value_string ieee80211_wapi_suite_type_short[] = {
7694   {0, "Reserved"},
7695   {1, "WAI-CERT"},
7696   {2, "WAI-PSK"},
7697   {0, NULL},
7698 };
7699
7700 static const value_string ieee80211_wapi_cipher_type[] = {
7701   {0, "Reserved"},
7702   {1, "WPI-SMS4"},
7703   {0, NULL},
7704 };
7705
7706 static const value_string ieee802111_wfa_ie_wme_type[] = {
7707   { 0, "Information Element" },
7708   { 1, "Parameter Element" },
7709   { 2, "TSPEC Element" },
7710   { 0, NULL}
7711 };
7712
7713 static const value_string ft_subelem_id_vals[] = {
7714   {0, "Reserved"},
7715   {1, "PMK-R1 key holder identifier (R1KH-ID)"},
7716   {2, "GTK subelement"},
7717   {3, "PMK-R0 key holder identifier (R0KH-ID)"},
7718   {4, "IGTK"},
7719   {0, NULL}
7720 };
7721
7722 static int
7723 dissect_qos_info(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
7724 {
7725   proto_tree *qos_info_tree;
7726   proto_item *qos_info_item;
7727
7728   qos_info_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_qos_info, tvb, offset, 1, ENC_NA);
7729   qos_info_tree = proto_item_add_subtree(qos_info_item, ett_wme_qos_info);
7730
7731   switch (ftype) {
7732     case MGT_ASSOC_REQ:
7733     case MGT_PROBE_REQ:
7734     case MGT_REASSOC_REQ:
7735     {
7736       /* To AP so decode as per WMM standard Figure 7 QoS Info field when sent from WMM STA*/
7737       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length, tvb, offset, 1, ENC_NA);
7738       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be, tvb, offset, 1, ENC_NA);
7739       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk, tvb, offset, 1, ENC_NA);
7740       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi, tvb, offset, 1, ENC_NA);
7741       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo, tvb, offset, 1, ENC_NA);
7742       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved, tvb, offset, 1, ENC_NA);
7743       break;
7744     }
7745     case MGT_BEACON:
7746     case MGT_PROBE_RESP:
7747     case MGT_ASSOC_RESP:
7748     case MGT_REASSOC_RESP:
7749     {
7750       /* From AP so decode as per WMM standard Figure 6 QoS Info field when sent from WMM AP */
7751       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd, tvb, offset, 1, ENC_NA);
7752       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count, tvb, offset, 1, ENC_NA);
7753       proto_tree_add_item(qos_info_tree, hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved, tvb, offset, 1, ENC_NA);
7754       break;
7755     }
7756     default:
7757         expert_add_info_format(pinfo, qos_info_item, PI_UNDECODED, PI_WARN, "Could not deduce direction to decode correctly, ftype %u", ftype);
7758       break;
7759     }
7760
7761   offset += 1;
7762   return offset;
7763 }
7764
7765 static int
7766 dissect_vendor_ie_wpawme(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, guint32 tag_len, int ftype)
7767 {
7768   guint8 type;
7769
7770   proto_tree_add_item(tree, hf_ieee80211_wfa_ie_type, tvb, offset, 1, ENC_NA);
7771   type = tvb_get_guint8(tvb, offset);
7772   proto_item_append_text(tree, ": %s", val_to_str(type, ieee802111_wfa_ie_type_vals, "Unknown %d"));
7773   offset += 1;
7774
7775   switch (type) {
7776     case 1:   /* Wi-Fi Protected Access (WPA) */
7777     {
7778       proto_item *wpa_mcs_item, *wpa_ucs_item, *wpa_akms_item;
7779       proto_item *wpa_sub_ucs_item, *wpa_sub_akms_item;
7780       proto_tree *wpa_mcs_tree, *wpa_ucs_tree, *wpa_akms_tree;
7781       proto_tree *wpa_sub_ucs_tree, *wpa_sub_akms_tree;
7782       guint16 ucs_count, akms_count;
7783       guint ii;
7784
7785       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7786       offset += 2;
7787
7788       /* Multicast Cipher Suite */
7789       wpa_mcs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_mcs, tvb, offset, 4, ENC_BIG_ENDIAN);
7790       wpa_mcs_tree = proto_item_add_subtree(wpa_mcs_item, ett_wpa_mcs_tree);
7791       proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
7792
7793       /* Check if OUI is 00:50:F2 (WFA) */
7794       if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
7795       {
7796         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_wfa_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
7797       } else {
7798         proto_tree_add_item(wpa_mcs_tree, hf_ieee80211_wfa_ie_wpa_mcs_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
7799       }
7800       offset += 4;
7801
7802       /* Unicast Cipher Suites */
7803       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7804       ucs_count = tvb_get_letohs(tvb, offset);
7805       offset += 2;
7806
7807       wpa_ucs_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_ucs_list, tvb, offset, ucs_count * 4, ENC_NA);
7808       wpa_ucs_tree = proto_item_add_subtree(wpa_ucs_item, ett_wpa_ucs_tree);
7809       for (ii = 0; ii < ucs_count; ii++)
7810       {
7811         wpa_sub_ucs_item = proto_tree_add_item(wpa_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs, tvb, offset, 4, ENC_BIG_ENDIAN);
7812         wpa_sub_ucs_tree = proto_item_add_subtree(wpa_sub_ucs_item, ett_wpa_sub_ucs_tree);
7813         proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
7814
7815         /* Check if OUI is 00:50:F2 (WFA) */
7816         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
7817         {
7818           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_wfa_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
7819           proto_item_append_text(wpa_ucs_item, " %s", wpa_ucs_return(tvb_get_ntohl(tvb, offset)));
7820         } else {
7821           proto_tree_add_item(wpa_sub_ucs_tree, hf_ieee80211_wfa_ie_wpa_ucs_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
7822         }
7823         offset += 4;
7824       }
7825
7826       /* Authenticated Key Management Suites */
7827       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7828       akms_count = tvb_get_letohs(tvb, offset);
7829       offset += 2;
7830
7831       wpa_akms_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wpa_akms_list, tvb, offset, akms_count * 4, ENC_NA);
7832       wpa_akms_tree = proto_item_add_subtree(wpa_akms_item, ett_wpa_akms_tree);
7833       for (ii = 0; ii < akms_count; ii++)
7834       {
7835         wpa_sub_akms_item = proto_tree_add_item(wpa_akms_tree, hf_ieee80211_wfa_ie_wpa_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
7836         wpa_sub_akms_tree = proto_item_add_subtree(wpa_sub_akms_item, ett_wpa_sub_akms_tree);
7837         proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
7838
7839         /* Check if OUI is 00:50:F2 (WFA) */
7840         if (tvb_get_ntoh24(tvb, offset) == OUI_WPAWME)
7841         {
7842           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_wfa_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
7843           proto_item_append_text(wpa_akms_item, " %s", wpa_akms_return(tvb_get_ntohl(tvb, offset)));
7844         } else {
7845           proto_tree_add_item(wpa_sub_akms_tree, hf_ieee80211_wfa_ie_wpa_akms_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
7846         }
7847         offset += 4;
7848       }
7849       break;
7850     }
7851     case 2:   /* Wireless Multimedia Enhancements (WME) */
7852     {
7853       guint8 subtype;
7854
7855       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_subtype, tvb, offset, 1, ENC_NA);
7856       subtype = tvb_get_guint8(tvb, offset);
7857       proto_item_append_text(tree, ": %s", val_to_str(subtype, ieee802111_wfa_ie_wme_type, "Unknown %d"));
7858       offset += 1;
7859       proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_version, tvb, offset, 1, ENC_NA);
7860       offset += 1;
7861       switch (subtype) {
7862         case 0: /* WME Information Element */
7863         {
7864           /* WME QoS Info Field */
7865           offset = dissect_qos_info(tree, tvb, pinfo, offset, ftype);
7866           break;
7867         }
7868         case 1: /* WME Parameter Element */
7869         {
7870           int i;
7871           /* WME QoS Info Field */
7872           offset = dissect_qos_info(tree, tvb, pinfo, offset, ftype);
7873           proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_reserved, tvb, offset, 1, ENC_NA);
7874           offset += 1;
7875           /* AC Parameters */
7876           for (i = 0; i < 4; i++)
7877           {
7878             proto_item *ac_item, *aci_aifsn_item, *ecw_item;
7879             proto_tree *ac_tree, *aci_aifsn_tree, *ecw_tree;
7880             guint8 aci_aifsn, ecw;
7881
7882             ac_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_ac_parameters, tvb, offset, 4, ENC_NA);
7883             ac_tree = proto_item_add_subtree(ac_item, ett_wme_ac);
7884
7885             /* ACI/AIFSN Field */
7886             aci_aifsn_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_aci_aifsn, tvb, offset, 1, ENC_NA);
7887             aci_aifsn_tree = proto_item_add_subtree(aci_aifsn_item, ett_wme_aci_aifsn);
7888             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_aci, tvb, offset, 1, ENC_NA);
7889             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_acm, tvb, offset, 1, ENC_NA);
7890             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_aifsn, tvb, offset, 1, ENC_NA);
7891             proto_tree_add_item(aci_aifsn_tree, hf_ieee80211_wfa_ie_wme_acp_reserved, tvb, offset, 1, ENC_NA);
7892             aci_aifsn = tvb_get_guint8(tvb, offset);
7893             proto_item_append_text(ac_item, " ACI %u (%s), ACM %s, AIFSN %u",
7894             (aci_aifsn & 0x60) >> 5, try_val_to_str((aci_aifsn & 0x60) >> 5, ieee80211_wfa_ie_wme_acs_vals),
7895             (aci_aifsn & 0x10) ? "yes" : "no ", aci_aifsn & 0x0f);
7896             offset += 1;
7897
7898             /* ECWmin/ECWmax field */
7899             ecw_item = proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_ecw, tvb, offset, 1, ENC_NA);
7900             ecw_tree = proto_item_add_subtree(ecw_item, ett_wme_ecw);
7901             proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_max, tvb, offset, 1, ENC_NA);
7902             proto_tree_add_item(ecw_tree, hf_ieee80211_wfa_ie_wme_acp_ecw_min, tvb, offset, 1, ENC_NA);
7903             ecw = tvb_get_guint8(tvb, offset);
7904             proto_item_append_text(ac_item, ", ECWmin %u ,ECWmax %u", ecw & 0x0f, (ecw & 0xf0) >> 4);
7905             offset += 1;
7906
7907             /* TXOP Limit */
7908             proto_tree_add_item(ac_tree, hf_ieee80211_wfa_ie_wme_acp_txop_limit, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7909             proto_item_append_text(ac_item, ", TXOP %u", tvb_get_letohs(tvb, offset));
7910             offset += 2;
7911           }
7912           break;
7913         }
7914         case 2:   /* WME TSPEC Element */
7915         {
7916
7917             proto_item *tsinfo_item;
7918             proto_tree *tsinfo_tree;
7919
7920             tsinfo_item = proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo, tvb, offset, 3, ENC_LITTLE_ENDIAN);
7921             tsinfo_tree = proto_item_add_subtree(tsinfo_item, ett_tsinfo_tree);
7922
7923             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid, tvb, offset, 3, ENC_LITTLE_ENDIAN);
7924             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction, tvb, offset, 3, ENC_LITTLE_ENDIAN);
7925             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb, tvb, offset, 3, ENC_LITTLE_ENDIAN);
7926             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up, tvb, offset, 3, ENC_LITTLE_ENDIAN);
7927             proto_tree_add_item(tsinfo_tree, hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved, tvb, offset, 3, ENC_LITTLE_ENDIAN);
7928             offset += 3;
7929
7930             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7931             offset += 2;
7932
7933             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7934             offset += 2;
7935
7936             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7937             offset += 4;
7938
7939             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7940             offset += 4;
7941
7942             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7943             offset += 4;
7944
7945             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7946             offset += 4;
7947
7948             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7949             offset += 4;
7950
7951             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7952             offset += 4;
7953
7954             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7955             offset += 4;
7956
7957             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7958             offset += 4;
7959
7960             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7961             offset += 4;
7962
7963             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7964             offset += 4;
7965
7966             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
7967             offset += 4;
7968
7969             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7970             offset += 2;
7971
7972             proto_tree_add_item(tree, hf_ieee80211_wfa_ie_wme_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
7973             offset += 2;
7974
7975           break;
7976         }
7977         default:
7978           /* No default Action */
7979         break;
7980       } /* End switch (subtype) */
7981       break;
7982     }
7983     case 4: /* WPS: Wifi Protected Setup */
7984     {
7985       dissect_wps_tlvs(tree, tvb, offset, tag_len-1, NULL);
7986     }
7987     break;
7988     default:
7989       /* No default Action...*/
7990     break;
7991   } /* End switch (type) */
7992
7993   return offset;
7994 }
7995
7996 static void dissect_hs20_indication(proto_tree *tree, tvbuff_t *tvb,
7997                                     int offset)
7998 {
7999   proto_tree_add_item(tree, hf_hs20_indication_dgaf_disabled, tvb, offset, 1,
8000                       ENC_LITTLE_ENDIAN);
8001 }
8002
8003 static void
8004 dissect_vendor_ie_wfa(packet_info *pinfo, proto_item *item, tvbuff_t *tag_tvb)
8005 {
8006   gint tag_len = tvb_length(tag_tvb);
8007
8008   if (tag_len < 4)
8009     return;
8010
8011   switch (tvb_get_guint8(tag_tvb, 3)) {
8012   case WFA_SUBTYPE_P2P:
8013     dissect_wifi_p2p_ie(pinfo, item, tag_tvb, 4, tag_len - 4);
8014     proto_item_append_text(item, ": P2P");
8015     break;
8016   case WFA_SUBTYPE_HS20_INDICATION:
8017     dissect_hs20_indication(item, tag_tvb, 4);
8018     proto_item_append_text(item, ": Hotspot 2.0 Indication");
8019     break;
8020   }
8021 }
8022
8023 static void
8024 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
8025 {
8026
8027   switch(tvb_get_guint8(tvb, offset)){
8028     case 4:
8029     {
8030       /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
8031        * This is only used within EAPOL-Key frame Key Data. */
8032       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_pmkid, tvb, offset, 16, ENC_NA);
8033     }
8034     break;
8035     default:
8036       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_unknown, tvb, offset, tag_len, ENC_NA);
8037     break;
8038   }
8039
8040   proto_item_append_text(item, ": RSN");
8041
8042 }
8043
8044 typedef enum {
8045   MARVELL_IE_MESH = 4
8046 } marvell_ie_type_t;
8047
8048 static void
8049 dissect_vendor_ie_marvell(proto_item *item _U_, proto_tree *ietree,
8050                           tvbuff_t *tvb, int offset, guint32 tag_len)
8051 {
8052   guint8 type;
8053
8054   type = tvb_get_guint8(tvb, offset);
8055   proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8056   offset += 1;
8057
8058   switch (type) {
8059   case MARVELL_IE_MESH:
8060     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_subtype, tvb,
8061                          offset++, 1, ENC_LITTLE_ENDIAN);
8062     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_version, tvb,
8063                          offset++, 1, ENC_LITTLE_ENDIAN);
8064     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_active_proto_id, tvb,
8065                          offset++, 1, ENC_LITTLE_ENDIAN);
8066     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_active_metric_id, tvb,
8067                          offset++, 1, ENC_LITTLE_ENDIAN);
8068     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_cap, tvb,
8069                          offset++, 1, ENC_LITTLE_ENDIAN);
8070     break;
8071
8072   default:
8073     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_data, tvb, offset,
8074       tag_len - 1, ENC_NA);
8075     break;
8076   }
8077 }
8078
8079 typedef enum {
8080   ATHEROS_IE_ADVCAP = 1,
8081   ATHEROS_IE_XR = 3
8082 } atheros_ie_type_t;
8083
8084 typedef enum {
8085   ATHEROS_IE_ADVCAP_S = 1
8086 } atheros_ie_advcap_subtype_t;
8087
8088 typedef enum {
8089   ATHEROS_IE_XR_S = 1
8090 } atheros_ie_xr_subtype_t;
8091
8092 typedef enum {
8093   ATHEROS_IE_CAP_TURBOP = 0x01,
8094   ATHEROS_IE_CAP_COMP   = 0x02,
8095   ATHEROS_IE_CAP_FF     = 0x04,
8096   ATHEROS_IE_CAP_XR     = 0x08,
8097   ATHEROS_IE_CAP_AR     = 0x10,
8098   ATHEROS_IE_CAP_BURST  = 0x20,
8099   ATHEROS_IE_CAP_WME    = 0x40,
8100   ATHEROS_IE_CAP_BOOST  = 0x80
8101 } atheros_ie_cap_t;
8102
8103 static const value_string atheros_ie_type_vals[] = {
8104   { ATHEROS_IE_ADVCAP, "Advanced Capability"},
8105   { ATHEROS_IE_XR,     "eXtended Range"},
8106   { 0,                 NULL }
8107 };
8108
8109 static void
8110 dissect_vendor_ie_atheros_cap(proto_item *item _U_, tvbuff_t *tvb, int offset)
8111 {
8112   proto_tree *cap_tree;
8113
8114   cap_tree = proto_item_add_subtree(item, ett_ath_cap_tree);
8115
8116   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_turbop, tvb, offset, 1, ENC_NA);
8117   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_comp,   tvb, offset, 1, ENC_NA);
8118   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_ff,     tvb, offset, 1, ENC_NA);
8119   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_xr,     tvb, offset, 1, ENC_NA);
8120   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_ar,     tvb, offset, 1, ENC_NA);
8121   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_burst,  tvb, offset, 1, ENC_NA);
8122   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_wme,    tvb, offset, 1, ENC_NA);
8123   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_boost,  tvb, offset, 1, ENC_NA);
8124
8125 }
8126
8127 static void
8128 dissect_vendor_ie_atheros(proto_item *item _U_, proto_tree *ietree,
8129                           tvbuff_t *tvb, int offset, guint tag_len,
8130                           packet_info *pinfo, proto_item *ti_len)
8131 {
8132   guint8      type;
8133   guint8      subtype;
8134   guint8      version;
8135   proto_item *cap_item;
8136
8137   if (tag_len <= 3) {
8138         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be >= 6", tag_len+3); /* Add length of OUI to tag_length */
8139         return;
8140   }
8141   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_type, tvb, offset, 1, ENC_NA);
8142   type = tvb_get_guint8(tvb, offset);
8143   proto_item_append_text(item, ": %s", val_to_str_const(type, atheros_ie_type_vals, "Unknown"));
8144   offset  += 1;
8145   tag_len -= 1;
8146
8147   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_subtype, tvb, offset, 1, ENC_NA);
8148   subtype  = tvb_get_guint8(tvb, offset);
8149   offset  += 1;
8150   tag_len -= 1;
8151
8152   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_version, tvb, offset, 1, ENC_NA);
8153   version  = tvb_get_guint8(tvb, offset);
8154   offset  += 1;
8155   tag_len -= 1;
8156
8157   if (version == 0)
8158   {
8159     switch (type) {
8160       case ATHEROS_IE_ADVCAP:
8161       {
8162         switch (subtype) {
8163           case ATHEROS_IE_ADVCAP_S:
8164           {
8165             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_cap, tvb, offset, 1, ENC_NA);
8166             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
8167             offset   += 1;
8168             tag_len  -= 1;
8169
8170             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_defkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8171             offset  += 2;
8172             tag_len -= 2;
8173             break;
8174           }
8175           default:
8176           /* No default Action */
8177           break;
8178         } /* End switch (subtype) */
8179         break;
8180       }
8181       case ATHEROS_IE_XR:
8182       {
8183         switch (subtype) {
8184           case ATHEROS_IE_XR_S:
8185           {
8186             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_info, tvb, offset, 1, ENC_NA);
8187             offset  += 1;
8188             tag_len -= 1;
8189
8190             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_bssid, tvb, offset, 6, ENC_NA);
8191             offset  += 6;
8192             tag_len -= 6;
8193
8194             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_bssid, tvb, offset, 6, ENC_NA);
8195             offset  += 6;
8196             tag_len -= 6;
8197
8198             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8199             offset  += 2;
8200             tag_len -= 2;
8201
8202             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_cap, tvb, offset, 1, ENC_NA);
8203             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
8204             offset   += 1;
8205             tag_len  -= 1;
8206
8207             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_cap, tvb, offset, 1, ENC_NA);
8208             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
8209             offset   += 1;
8210             tag_len  -= 1;
8211             break;
8212           }
8213           default:
8214           /* No default Action */
8215           break;
8216         } /* End switch (subtype) */
8217         break;
8218         default:
8219         /* No default Action */
8220         break;
8221       } /* End switch (type) */
8222
8223     }
8224   }
8225   if (tag_len > 0) {
8226     proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_data, tvb, offset, tag_len, ENC_NA);
8227   }
8228 }
8229
8230 typedef enum {
8231   AIRONET_IE_VERSION = 3,
8232   AIRONET_IE_QOS,
8233   AIRONET_IE_QBSS_V2 = 14
8234 } aironet_ie_type_t;
8235
8236 static const value_string aironet_ie_type_vals[] = {
8237   { AIRONET_IE_VERSION,   "CCX version"},
8238   { AIRONET_IE_QOS,       "Qos"},
8239   { AIRONET_IE_QBSS_V2,   "QBSS V2 - CCA"},
8240   { 0,                    NULL }
8241 };
8242
8243 static void
8244 dissect_vendor_ie_aironet(proto_item *aironet_item, proto_tree *ietree,
8245                           tvbuff_t *tvb, int offset, guint32 tag_len)
8246 {
8247   guint8  type;
8248   int i;
8249   gboolean dont_change = FALSE; /* Don't change the IE item text to default */
8250
8251   type = tvb_get_guint8(tvb, offset);
8252   proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8253   offset += 1;
8254
8255   switch (type) {
8256   case AIRONET_IE_VERSION:
8257     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8258     proto_item_append_text(aironet_item, ": Aironet CCX version = %d",
8259     tvb_get_guint8(tvb, offset));
8260     dont_change = TRUE;
8261     break;
8262   case AIRONET_IE_QOS:
8263     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_qos_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8264     offset += 1;
8265     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_qos_paramset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8266     offset += 1;
8267
8268     /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
8269      *  need to be swapped. Also, the "TXOP" may be TXOP - or not.
8270      */
8271     for (i = 0; i < 4; i++) {
8272       guint8 byte1, byte2;
8273       guint16 txop;
8274       byte1 = tvb_get_guint8(tvb, offset);
8275       byte2 = tvb_get_guint8(tvb, offset + 1);
8276       txop = tvb_get_letohs(tvb, offset + 2);
8277       proto_tree_add_bytes_format(ietree, hf_ieee80211_aironet_ie_qos_val, tvb, offset, 4, NULL,
8278           "CCX QoS Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
8279         (byte1 & 0x60) >> 5, val_to_str((byte1 & 0x60) >> 5, wme_acs, "(Unknown: %d)"),
8280         (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
8281         byte2 & 0x0f, (byte2 & 0xf0) >> 4,
8282         txop);
8283       offset += 4;
8284     }
8285     break;
8286   case AIRONET_IE_QBSS_V2:
8287     /* Extract Values */
8288     proto_tree_add_item (ietree, hf_ieee80211_qbss2_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8289     proto_tree_add_item (ietree, hf_ieee80211_qbss2_cu, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
8290     proto_tree_add_item (ietree, hf_ieee80211_qbss2_cal, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8291     proto_tree_add_item (ietree, hf_ieee80211_qbss2_gl, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
8292     break;
8293   default:
8294     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_data, tvb, offset,
8295       tag_len - 1, ENC_NA);
8296     break;
8297   }
8298   if (!dont_change) {
8299     proto_item_append_text(aironet_item, ": Aironet %s",
8300       val_to_str_const(type, aironet_ie_type_vals, "Unknown"));
8301   }
8302 }
8303
8304 #define ARUBA_APNAME  3
8305 static const value_string ieee80211_vs_aruba_subtype_vals[] = {
8306   { ARUBA_APNAME, "AP Name"},
8307   { 0,                 NULL }
8308 };
8309 static void
8310 dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree,
8311                           tvbuff_t *tvb, int offset, guint32 tag_len)
8312 {
8313   guint8 type;
8314
8315   offset += 1; /* VS OUI Type */
8316   tag_len -= 1;
8317
8318   type = tvb_get_guint8(tvb, offset);
8319   proto_tree_add_item (ietree, hf_ieee80211_vs_aruba_subtype, tvb, offset, 1, ENC_NA);
8320   proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aruba_subtype_vals, "Unknown"));
8321   offset += 1;
8322   tag_len -= 1;
8323
8324   switch (type) {
8325   case ARUBA_APNAME:
8326     offset += 1;
8327     tag_len -= 1;
8328
8329     proto_tree_add_item (ietree, hf_ieee80211_vs_aruba_apname, tvb,
8330                          offset, tag_len, ENC_ASCII|ENC_NA);
8331     proto_item_append_text(item, " (%s)", tvb_get_ephemeral_string(tvb, offset, tag_len));
8332     break;
8333
8334   default:
8335     proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_data, tvb, offset,
8336       tag_len, ENC_NA);
8337     proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(tvb, offset, tag_len));
8338     break;
8339   }
8340 }
8341
8342 /* 802.11e 7.3.2.33 QoS Capability element */
8343 static int
8344 dissect_qos_capability(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
8345 {
8346   proto_item *cap_info_item;
8347   proto_tree *cap_info_tree;
8348
8349   cap_info_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_cap_qos_info, tvb, offset, 1, ENC_NA);
8350   cap_info_tree = proto_item_add_subtree(cap_info_item, ett_qos_info_field_tree);
8351   switch (ftype) {
8352     case MGT_ASSOC_REQ:
8353     case MGT_PROBE_REQ:
8354     case MGT_REASSOC_REQ:
8355     {
8356       /* To AP so decode as STA: Figure 33h-QoS Info field when set by a non-AP QSTA */
8357       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_vo_uapsd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8358       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_vi_uapsd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8359       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_bk_uapsd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8360       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_be_uapsd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8361       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_qack, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8362       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_max_sp_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8363       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_more_data_ack, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8364       break;
8365     }
8366     case MGT_BEACON:
8367     case MGT_PROBE_RESP:
8368     case MGT_ASSOC_RESP:
8369     case MGT_REASSOC_RESP:
8370     {
8371       /* From AP so decode as AP: Figure 33g-QoS Info field when sent by a QAP */
8372       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_edca_upd_cnt, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8373       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_qack, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8374       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_queue_req, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8375       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_txop_req, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8376       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8377       break;
8378     }
8379     default:
8380         expert_add_info_format(pinfo, cap_info_item, PI_UNDECODED, PI_WARN, "Could not deduce direction to decode correctly, ftype %u", ftype);
8381       break;
8382   }
8383
8384   return offset + 1;
8385 }
8386
8387 /* 7.3.2.25 RSN information element */
8388 static int
8389 dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
8390                int offset, guint32 tag_len)
8391 {
8392   proto_item *rsn_gcs_item, *rsn_pcs_item, *rsn_akms_item, *rsn_cap_item, *rsn_pmkid_item, *rsn_gmcs_item;
8393   proto_item *rsn_sub_pcs_item, *rsn_sub_akms_item;
8394   proto_item *rsn_pcs_count, *rsn_akms_count, *rsn_pmkid_count;
8395   proto_tree *rsn_gcs_tree, *rsn_pcs_tree, *rsn_akms_tree, *rsn_cap_tree, *rsn_pmkid_tree, *rsn_gmcs_tree;
8396   proto_tree *rsn_sub_pcs_tree, *rsn_sub_akms_tree;
8397   guint16     pcs_count, akms_count, pmkid_count;
8398   guint       ii;
8399   int         tag_end = offset + tag_len;
8400
8401   proto_tree_add_item(tree, hf_ieee80211_rsn_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8402   offset += 2;
8403
8404   /* 7.3.2.25.1 Group Cipher suites */
8405   rsn_gcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gcs, tvb, offset, 4, ENC_BIG_ENDIAN);
8406   rsn_gcs_tree = proto_item_add_subtree(rsn_gcs_item, ett_rsn_gcs_tree);
8407   proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
8408
8409     /* Check if OUI is 00:0F:AC (ieee80211) */
8410   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
8411   {
8412     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_80211_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8413   } else {
8414     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8415   }
8416   offset += 4;
8417
8418   /* 7.3.2.25.2 Pairwise Cipher suites */
8419   rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8420   pcs_count = tvb_get_letohs(tvb, offset);
8421   offset += 2;
8422
8423   if (offset + (pcs_count * 4) > tag_end)
8424   {
8425     expert_add_info_format(pinfo, rsn_pcs_count, PI_MALFORMED, PI_ERROR,
8426         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
8427     pcs_count = (tag_end - offset) / 4;
8428   }
8429
8430   rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
8431   rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
8432   for (ii = 0; ii < pcs_count; ii++)
8433   {
8434     rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
8435     rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
8436     proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
8437
8438     /* Check if OUI is 00:0F:AC (ieee80211) */
8439     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
8440     {
8441       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
8442       proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
8443     } else {
8444       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
8445     }
8446     offset += 4;
8447   }
8448
8449   if (offset >= tag_end)
8450   {
8451     return offset;
8452   }
8453
8454   /* 7.3.2.25.2 AKM suites */
8455   rsn_akms_count = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8456   akms_count = tvb_get_letohs(tvb, offset);
8457   offset += 2;
8458
8459   if (offset + (akms_count * 4) > tag_end)
8460   {
8461     expert_add_info_format(pinfo, rsn_akms_count, PI_MALFORMED, PI_ERROR,
8462         "Auth Key Management (AKM) Suite Count too large, 4*%u > %d", akms_count, tag_end - offset);
8463     akms_count = (tag_end - offset) / 4;
8464   }
8465
8466   rsn_akms_item = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_list, tvb, offset, akms_count * 4, ENC_NA);
8467   rsn_akms_tree = proto_item_add_subtree(rsn_akms_item, ett_rsn_akms_tree);
8468   for (ii = 0; ii < akms_count; ii++)
8469   {
8470     rsn_sub_akms_item = proto_tree_add_item(rsn_akms_tree, hf_ieee80211_rsn_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
8471     rsn_sub_akms_tree = proto_item_add_subtree(rsn_sub_akms_item, ett_rsn_sub_akms_tree);
8472     proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
8473
8474     /* Check if OUI is 00:0F:AC (ieee80211) */
8475     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
8476     {
8477       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_80211_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
8478       proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(tvb_get_ntohl(tvb, offset)));
8479     } else {
8480       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
8481     }
8482     offset += 4;
8483   }
8484
8485   /* 7.3.2.25.3 RSN capabilities */
8486   rsn_cap_item = proto_tree_add_item(tree, hf_ieee80211_rsn_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8487   rsn_cap_tree = proto_item_add_subtree(rsn_cap_item, ett_rsn_cap_tree);
8488
8489   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_preauth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8490   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_no_pairwise, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8491   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_ptksa_replay_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8492   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_gtksa_replay_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8493   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_mfpr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8494   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_mfpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8495   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_peerkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8496   offset += 2;
8497   if (offset >= tag_end)
8498   {
8499     return offset;
8500   }
8501   /* 7.3.2.25.4 PMKID */
8502   rsn_pmkid_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8503   pmkid_count = tvb_get_letohs(tvb, offset);
8504   offset += 2;
8505
8506   if (offset + (pmkid_count * 16) > tag_end)
8507   {
8508     expert_add_info_format(pinfo, rsn_pmkid_count, PI_MALFORMED, PI_ERROR,
8509         "PMKID Count too large, 16*%u > %d", pmkid_count, tag_end - offset);
8510     pmkid_count = (tag_end - offset) / 16;
8511   }
8512
8513   rsn_pmkid_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_list, tvb, offset, pmkid_count * 16, ENC_NA);
8514   rsn_pmkid_tree = proto_item_add_subtree(rsn_pmkid_item, ett_rsn_pmkid_tree);
8515   for (ii = 0; ii < pmkid_count; ii++)
8516   {
8517     proto_tree_add_item(rsn_pmkid_tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
8518     offset += 16;
8519   }
8520
8521   if (offset >= tag_end)
8522   {
8523     return offset;
8524   }
8525   /* Group Management Cipher Suite (802.11w)*/
8526   rsn_gmcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gmcs, tvb, offset, 4, ENC_BIG_ENDIAN);
8527   rsn_gmcs_tree = proto_item_add_subtree(rsn_gmcs_item, ett_rsn_gmcs_tree);
8528   proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
8529   /* Check if OUI is 00:0F:AC (ieee80211) */
8530   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
8531   {
8532     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_80211_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8533   } else {
8534     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8535   }
8536   offset += 4;
8537
8538   return offset;
8539 }
8540 static int
8541 dissect_extended_capabilities_ie(packet_info *pinfo, proto_tree *tree,
8542                          proto_item *ti, proto_item *ti_len,
8543                          guint32 tag_len, tvbuff_t *tvb,
8544                          int offset, int tag_end)
8545 {
8546   proto_item *ti_ex_cap;
8547   proto_tree *ex_cap_tree;
8548
8549   if (tag_len < 1)
8550   {
8551     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be greater than 0", tag_len);
8552     return offset;
8553   }
8554   proto_item_append_text(ti, " (%u octet%s)", tag_len, plurality(tag_len, "", "s"));
8555
8556   /* Extended Capability octet 1 */
8557   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8558   proto_item_append_text(ti_ex_cap, " (octet 1)");
8559   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap1);
8560   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b0, tvb, offset, 1, ENC_NA);
8561   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b1, tvb, offset, 1, ENC_NA);
8562   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b2, tvb, offset, 1, ENC_NA);
8563   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b3, tvb, offset, 1, ENC_NA);
8564   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b4, tvb, offset, 1, ENC_NA);
8565   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b5, tvb, offset, 1, ENC_NA);
8566   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b6, tvb, offset, 1, ENC_NA);
8567   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b7, tvb, offset, 1, ENC_NA);
8568   offset += 1;
8569
8570   /* Extended Capability octet 2 */
8571   if (offset >= tag_end) {
8572     return offset;
8573   }
8574   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8575   proto_item_append_text(ti_ex_cap, " (octet 2)");
8576   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap2);
8577   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b8, tvb, offset, 1, ENC_NA);
8578   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b9, tvb, offset, 1, ENC_NA);
8579   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b10, tvb, offset, 1, ENC_NA);
8580   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b11, tvb, offset, 1, ENC_NA);
8581   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b12, tvb, offset, 1, ENC_NA);
8582   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b13, tvb, offset, 1, ENC_NA);
8583   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b14, tvb, offset, 1, ENC_NA);
8584   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b15, tvb, offset, 1, ENC_NA);
8585   offset += 1;
8586
8587   /* Extended Capability octet 3 */
8588   if (offset >= tag_end) {
8589     return offset;
8590   }
8591   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8592   proto_item_append_text(ti_ex_cap, " (octet 3)");
8593   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap3);
8594   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b16, tvb, offset, 1, ENC_NA);
8595   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b17, tvb, offset, 1, ENC_NA);
8596   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b18, tvb, offset, 1, ENC_NA);
8597   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b19, tvb, offset, 1, ENC_NA);
8598   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b20, tvb, offset, 1, ENC_NA);
8599   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b21, tvb, offset, 1, ENC_NA);
8600   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b22, tvb, offset, 1, ENC_NA);
8601   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b23, tvb, offset, 1, ENC_NA);
8602   offset += 1;
8603
8604   /* Extended Capability octet 4 */
8605   if (offset >= tag_end) {
8606     return offset;
8607   }
8608   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8609   proto_item_append_text(ti_ex_cap, " (octet 4)");
8610   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap4);
8611   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b24, tvb, offset, 1, ENC_NA);
8612   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b25, tvb, offset, 1, ENC_NA);
8613   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b26, tvb, offset, 1, ENC_NA);
8614   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b27, tvb, offset, 1, ENC_NA);
8615   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b28, tvb, offset, 1, ENC_NA);
8616   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b29, tvb, offset, 1, ENC_NA);
8617   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b30, tvb, offset, 1, ENC_NA);
8618   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b31, tvb, offset, 1, ENC_NA);
8619   offset += 1;
8620
8621   /* Extended Capability octet 5 */
8622   if (offset >= tag_end) {
8623     return offset;
8624   }
8625   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8626   proto_item_append_text(ti_ex_cap, " (octet 5)");
8627   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap5);
8628   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b32, tvb, offset, 1, ENC_NA);
8629   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b33, tvb, offset, 1, ENC_NA);
8630   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b34, tvb, offset, 1, ENC_NA);
8631   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b35, tvb, offset, 1, ENC_NA);
8632   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b36, tvb, offset, 1, ENC_NA);
8633   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b37, tvb, offset, 1, ENC_NA);
8634   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b38, tvb, offset, 1, ENC_NA);
8635   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b39, tvb, offset, 1, ENC_NA);
8636   offset += 1;
8637
8638   /* Extended Capability octet 6 */
8639   if (offset >= tag_end) {
8640     return offset;
8641   }
8642   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8643   proto_item_append_text(ti_ex_cap, " (octet 6)");
8644   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap6);
8645   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b40, tvb, offset, 1, ENC_NA);
8646   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_serv_int_granularity, tvb, offset, 1, ENC_NA);
8647   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b44, tvb, offset, 1, ENC_NA);
8648   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b45, tvb, offset, 1, ENC_NA);
8649   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b46, tvb, offset, 1, ENC_NA);
8650   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b47, tvb, offset, 1, ENC_NA);
8651   offset += 1;
8652
8653
8654   /* Extended Capability octet 7 */
8655   if (offset >= tag_end) {
8656     return offset;
8657   }
8658   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8659   proto_item_append_text(ti_ex_cap, " (octet 7)");
8660   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap7);
8661   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b48, tvb, offset, 1, ENC_NA);
8662   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o7, tvb, offset, 1, ENC_NA);
8663   offset += 1;
8664
8665   /* Extended Capability octet 8 */
8666   if (offset >= tag_end) {
8667     return offset;
8668   }
8669   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8670   proto_item_append_text(ti_ex_cap, " (octet 8)");
8671   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap8);
8672   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o8, tvb, offset, 1, ENC_NA);
8673   offset += 1;
8674
8675   return offset;
8676 }
8677 static int
8678 dissect_vht_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset)
8679 {
8680   proto_item *ti;
8681   proto_tree *mcs_tree, *rx_mcs_tree, *tx_mcs_tree;
8682
8683   /* 8 byte Supported MCS set */
8684   ti = proto_tree_add_item(tree, hf_ieee80211_vht_mcsset, tvb, offset, 8, ENC_NA);
8685
8686   mcs_tree = proto_item_add_subtree(ti, ett_vht_mcsset_tree);
8687
8688   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8689   rx_mcs_tree = proto_item_add_subtree(ti, ett_vht_rx_mcsbit_tree);
8690
8691   /* B0 - B15 */
8692   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8693   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8694   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8695   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8696   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8697   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8698   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8699   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8700
8701   offset += 2;
8702   /* B16 - B28 13 bits*/
8703   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8704
8705   /* B29 - B31 2 reserved bits*/
8706
8707   offset += 2;
8708   /* B32 - B47 */
8709
8710   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8711   tx_mcs_tree = proto_item_add_subtree(ti, ett_vht_tx_mcsbit_tree);
8712   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8713   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8714   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8715   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8716   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8717   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8718   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8719   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8720
8721   offset += 2;
8722   /* B48 - B60 13 bits */
8723   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8724   /* B61 - B63 2 reserved bits*/
8725
8726   offset += 2;
8727   return offset;
8728 }
8729
8730 static int
8731 dissect_vht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
8732          guint32 tag_len, proto_item *ti_len)
8733 {
8734   proto_item *cap_item;
8735   proto_tree *cap_tree;
8736
8737   if (tag_len != 12) {
8738     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
8739                            "VHT Capabilities IE length %u wrong, must be = 12", tag_len);
8740     return offset;
8741   }
8742
8743   /* 4 byte VHT Capabilities  Info*/
8744   cap_item = proto_tree_add_item(tree, hf_ieee80211_vht_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8745
8746   cap_tree = proto_item_add_subtree(cap_item, ett_vht_cap_tree);
8747
8748   /* B0 - B1 2 bits */
8749   proto_tree_add_item(cap_tree, hf_ieee80211_vht_max_mpdu_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8750   /* B2 - B3 2 bits*/
8751   proto_tree_add_item(cap_tree, hf_ieee80211_vht_supported_chan_width_set, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8752
8753   /* B4 - B7 4x 1 bit fields */
8754   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_ldpc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8755   proto_tree_add_item(cap_tree, hf_ieee80211_vht_short_gi_for_80, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8756   proto_tree_add_item(cap_tree, hf_ieee80211_vht_short_gi_for_160, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8757   proto_tree_add_item(cap_tree, hf_ieee80211_vht_tx_stbc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8758
8759   /* End of first byte */
8760
8761   /* B8 - B10 3 bit field */
8762   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_stbc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8763
8764   /* B11 - B12 2x 1 bit fields */
8765   proto_tree_add_item(cap_tree, hf_ieee80211_vht_su_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8766   proto_tree_add_item(cap_tree, hf_ieee80211_vht_su_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8767
8768   /* B13 - B15 3 bit field */
8769   proto_tree_add_item(cap_tree, hf_ieee80211_vht_beamformer_antennas, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8770
8771   /* End of second byte */
8772
8773   /* B16 - B18 */
8774   proto_tree_add_item(cap_tree, hf_ieee80211_vht_sounding_dimensions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8775   /* B19 */
8776   proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8777
8778   /* B20 - B22 2x 1 bit fields */
8779   proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8780   proto_tree_add_item(cap_tree, hf_ieee80211_vht_txop_ps, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8781   proto_tree_add_item(cap_tree, hf_ieee80211_vht_var_htc_field, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8782
8783   /* B23 - B25 3 bit field which takes us 2 bits into next byte */
8784   proto_tree_add_item(cap_tree, hf_ieee80211_vht_max_ampdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8785
8786   /* B26 - B27 2 bit field */
8787   proto_tree_add_item(cap_tree, hf_ieee80211_vht_link_adaptation_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8788
8789   /* B28 - B29 2x 1 bit fields */
8790   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8791   proto_tree_add_item(cap_tree, hf_ieee80211_vht_tx_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8792
8793   /* B30 - B31 Reserved */
8794   proto_tree_add_item(cap_tree, hf_ieee80211_vht_reserv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8795
8796   offset += 4;
8797
8798   /* 8 byte MCS set */
8799   offset = dissect_vht_mcs_set(tree, tvb, offset);
8800
8801   return offset;
8802 }
8803
8804 static int
8805 dissect_vht_operation_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
8806          guint32 tag_len, proto_item *ti_len)
8807 {
8808   proto_item *op_item, *ti;
8809   proto_tree *op_tree, *basic_mcs_tree;
8810
8811   if (tag_len != 5) {
8812     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
8813                            "VHT Operation IE length %u wrong, must be = 5", tag_len);
8814     return offset;
8815   }
8816
8817   /* 3 byte VHT Operation Info*/
8818   op_item = proto_tree_add_item(tree, hf_ieee80211_vht_op, tvb, offset, 3, ENC_NA);
8819   op_tree = proto_item_add_subtree(op_item, ett_vht_op_tree);
8820   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8821   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center0, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
8822   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center1, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
8823
8824   offset += 3;
8825   /* VHT Basic MCS Set */
8826   ti = proto_tree_add_item(tree, hf_ieee80211_vht_op_basic_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8827   basic_mcs_tree = proto_item_add_subtree(ti, ett_vht_basic_mcsbit_tree);
8828   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8829   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8830   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8831   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8832   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8833   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8834   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8835   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8836
8837   offset += 2;
8838
8839   return offset;
8840 }
8841
8842
8843 static void
8844 dissect_mobility_domain(proto_tree *tree, tvbuff_t *tvb, int offset,
8845                         guint32 tag_len)
8846 {
8847   if (tag_len < 3) {
8848     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
8849                           "MDIE content length must be at least 3 bytes");
8850     return;
8851   }
8852
8853   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_mdid,
8854                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8855   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab,
8856                       tvb, offset + 2, 1, ENC_BIG_ENDIAN);
8857   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
8858                       tvb, offset + 2, 1, ENC_BIG_ENDIAN);
8859   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
8860                       tvb, offset + 2, 1, ENC_BIG_ENDIAN);
8861 }
8862
8863 static void
8864 dissect_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, int offset,
8865                             guint32 tag_len)
8866 {
8867   int end = offset + tag_len;
8868   if (tag_len < 82) {
8869     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
8870                           "FTIE content length must be at least 82 bytes");
8871     return;
8872   }
8873
8874   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic_control,
8875                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8876   proto_tree_add_item(tree, hf_ieee80211_tag_ft_element_count,
8877                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8878   offset += 2;
8879   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic,
8880                       tvb, offset, 16, ENC_NA);
8881   offset += 16;
8882   proto_tree_add_item(tree, hf_ieee80211_tag_ft_anonce,
8883                       tvb, offset, 32, ENC_NA);
8884   offset += 32;
8885   proto_tree_add_item(tree, hf_ieee80211_tag_ft_snonce,
8886                       tvb, offset, 32, ENC_NA);
8887   offset += 32;
8888
8889   while (offset + 2 <= end) {
8890     guint8 id, len;
8891     int s_end;
8892     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_id,
8893                         tvb, offset, 1, ENC_BIG_ENDIAN);
8894     id = tvb_get_guint8(tvb, offset);
8895     offset += 1;
8896
8897     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_len,
8898                         tvb, offset, 1, ENC_BIG_ENDIAN);
8899     len = tvb_get_guint8(tvb, offset);
8900     offset += 1;
8901
8902     if (offset + len > end) {
8903       proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset,
8904                             end - offset, "Invalid FTIE subelement");
8905       return;
8906     }
8907
8908     s_end = offset + len;
8909     switch (id) {
8910     case 1:
8911       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r1kh_id,
8912                           tvb, offset, len, ENC_NA);
8913       break;
8914     case 2:
8915       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_info,
8916                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
8917       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_id,
8918                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
8919       offset += 2;
8920       if (offset > s_end)
8921         break;
8922       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_length,
8923                           tvb, offset, 1, ENC_BIG_ENDIAN);
8924       offset += 1;
8925       if (offset > s_end)
8926         break;
8927       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_rsc,
8928                           tvb, offset, 8, ENC_NA);
8929       offset += 8;
8930       if (offset > s_end)
8931         break;
8932       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key,
8933                           tvb, offset, s_end - offset, ENC_NA);
8934       break;
8935     case 3:
8936       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r0kh_id,
8937                           tvb, offset, len, ENC_ASCII|ENC_NA);
8938       break;
8939     case 4:
8940       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_id,
8941                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
8942       offset += 2;
8943       if (offset > s_end)
8944         break;
8945       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_ipn,
8946                           tvb, offset, 6, ENC_NA);
8947       offset += 6;
8948       if (offset > s_end)
8949         break;
8950       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_length,
8951                           tvb, offset, 1, ENC_BIG_ENDIAN);
8952       offset += 1;
8953       if (offset > s_end)
8954         break;
8955       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key,
8956                           tvb, offset, 24, ENC_NA);
8957       break;
8958     default:
8959       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_data,
8960                           tvb, offset, len, ENC_NA);
8961       break;
8962     }
8963     offset = s_end;
8964   }
8965 }
8966
8967 static void
8968 dissect_mmie(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
8969 {
8970   if (tag_len < 16) {
8971     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
8972                           "MMIE content length must be at least 16 bytes");
8973     return;
8974   }
8975
8976   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8977   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
8978                       ENC_NA);
8979   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
8980                       ENC_NA);
8981 }
8982
8983 static void
8984 dissect_ssid_list(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
8985 {
8986   int end = offset + tag_len;
8987   proto_item *ssid;
8988   proto_tree *entry;
8989   gboolean first = TRUE;
8990
8991   while (offset + 1 <= end) {
8992     guint8 len = tvb_get_guint8(tvb, offset + 1);
8993     guint8 *str;
8994
8995     if (offset + 2 + len > end)
8996       break;
8997
8998     str = tvb_get_ephemeral_string(tvb, offset + 2, len);
8999     proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
9000     first = FALSE;
9001     ssid = proto_tree_add_text(tree, tvb, offset, 2 + len, "SSID: %s", str);
9002     entry = proto_item_add_subtree(ssid, ett_ssid_list);
9003     proto_tree_add_item(entry, hf_ieee80211_tag_number, tvb, offset, 1,
9004                         ENC_BIG_ENDIAN);
9005     offset++;
9006     proto_tree_add_uint(entry, hf_ieee80211_tag_length, tvb, offset, 1, len);
9007     offset++;
9008     proto_tree_add_item(entry, hf_ieee80211_tag_ssid, tvb, offset, len,
9009                         ENC_ASCII|ENC_NA);
9010     offset += len;
9011   }
9012 }
9013
9014 static void
9015 dissect_link_identifier(proto_tree *tree, tvbuff_t *tvb, int offset,
9016                         guint32 tag_len)
9017 {
9018   if (tag_len < 18) {
9019     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9020                           "Link Identifier content length must be at least "
9021                           "18 bytes");
9022     return;
9023   }
9024
9025   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_bssid, tvb,
9026                       offset, 6, ENC_NA);
9027   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_init_sta, tvb,
9028                       offset + 6, 6, ENC_NA);
9029   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_resp_sta, tvb,
9030                       offset + 12, 6, ENC_NA);
9031 }
9032
9033 static void
9034 dissect_wakeup_schedule(proto_tree *tree, tvbuff_t *tvb, int offset,
9035                         guint32 tag_len)
9036 {
9037   if (tag_len < 18) {
9038     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9039                           "Wakeup Schedule content length must be at least "
9040                           "18 bytes");
9041     return;
9042   }
9043
9044   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_offset, tvb,
9045                       offset, 4, ENC_LITTLE_ENDIAN);
9046   offset += 4;
9047
9048   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_interval, tvb,
9049                       offset, 4, ENC_LITTLE_ENDIAN);
9050   offset += 4;
9051
9052   proto_tree_add_item(tree,
9053                       hf_ieee80211_tag_wakeup_schedule_awake_window_slots, tvb,
9054                       offset, 4, ENC_LITTLE_ENDIAN);
9055   offset += 4;
9056
9057   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
9058                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
9059   offset += 4;
9060
9061   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_idle_count, tvb,
9062                       offset, 2, ENC_LITTLE_ENDIAN);
9063 }
9064
9065 static void
9066 dissect_channel_switch_timing(proto_tree *tree, tvbuff_t *tvb, int offset,
9067                               guint32 tag_len)
9068 {
9069   if (tag_len < 4) {
9070     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9071                           "Channel Switch Timing content length must be at "
9072                           "least 4 bytes");
9073     return;
9074   }
9075
9076   proto_tree_add_item(tree, hf_ieee80211_tag_channel_switch_timing_switch_time,
9077                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9078   offset += 2;
9079
9080   proto_tree_add_item(tree,
9081                       hf_ieee80211_tag_channel_switch_timing_switch_timeout,
9082                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9083 }
9084
9085 static void
9086 dissect_pti_control(proto_tree *tree, tvbuff_t *tvb, int offset,
9087                     guint32 tag_len)
9088 {
9089   if (tag_len < 3) {
9090     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9091                           "PTI Control content length must be at least "
9092                           "3 bytes");
9093     return;
9094   }
9095
9096   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_tid, tvb,
9097                       offset, 1, ENC_BIG_ENDIAN);
9098   offset += 1;
9099
9100   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_sequence_control, tvb,
9101                       offset, 2, ENC_LITTLE_ENDIAN);
9102 }
9103
9104 static void
9105 dissect_pu_buffer_status(proto_tree *tree, tvbuff_t *tvb, int offset,
9106                          guint32 tag_len)
9107 {
9108   if (tag_len < 1) {
9109     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9110                           "PU Buffer Status content length must be at least "
9111                           "1 byte");
9112     return;
9113   }
9114
9115   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_bk, tvb,
9116                       offset, 1, ENC_BIG_ENDIAN);
9117   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_be, tvb,
9118                       offset, 1, ENC_BIG_ENDIAN);
9119   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_vi, tvb,
9120                       offset, 1, ENC_BIG_ENDIAN);
9121   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_vo, tvb,
9122                       offset, 1, ENC_BIG_ENDIAN);
9123 }
9124
9125 static void
9126 dissect_timeout_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
9127                          guint32 tag_len)
9128 {
9129   proto_item *pi;
9130
9131   pi = proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_type, tvb,
9132                            offset, 1, ENC_BIG_ENDIAN);
9133   if (tag_len < 5) {
9134     expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
9135                            "Timeout Interval content length must be at least "
9136                           "5 bytes");
9137     return;
9138   }
9139
9140   proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_value, tvb,
9141                       offset + 1, 4, ENC_LITTLE_ENDIAN);
9142 }
9143
9144 static int
9145 dissect_ric_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
9146                          guint32 tag_len, proto_item *ti, proto_item *ti_len, int ftype)
9147 {
9148
9149   proto_tree  *sub_tree;
9150   guint8       desc_cnt = 0;
9151   guint32      next_ie;
9152   int          offset_r = 0;
9153
9154   if (tag_len !=  4)  {
9155     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9156                            "RIC Data Length must be 4 bytes");
9157     return 0;
9158   }
9159
9160   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_id, tvb,
9161                            offset, 1, ENC_LITTLE_ENDIAN);
9162   offset += 1;
9163
9164   desc_cnt = tvb_get_guint8(tvb,offset);
9165   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_desc_cnt, tvb,
9166                            offset, 1, ENC_LITTLE_ENDIAN);
9167   offset += 1;
9168
9169   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_status_code, tvb,
9170                            offset, 2, ENC_LITTLE_ENDIAN);
9171   offset += 2;
9172
9173   /* Our Design is such that all the Resource request IE's part of the RIC
9174    * must be in the sub tree of RIC for better readability
9175    * Even omnipeek does the same way.
9176    */
9177   sub_tree = proto_item_add_subtree(tree, ett_tag_ric_data_desc_ie);
9178
9179   proto_item_append_text(ti, " :Resource Descriptor List");
9180   if (desc_cnt == 0) {
9181     proto_item_append_text(ti, " :0 (Weird?)");
9182   }
9183
9184   while ( desc_cnt !=0 ) {
9185
9186     next_ie = tvb_get_guint8(tvb,offset);
9187     proto_item_append_text(ti, " :(%d:%s)", desc_cnt,val_to_str_ext(next_ie, &tag_num_vals_ext, "Reserved (%d)"));
9188     /* Recursive call to avoid duplication of code*/
9189     offset_r = add_tagged_field(pinfo, sub_tree, tvb, offset, ftype);
9190     if (offset_r == 0 )/* should never happen, returns a min of 2*/
9191       break;
9192     /* This will ensure that the IE after RIC is processed
9193      * only once. This gives us a good looking RIC IE :-)
9194      */
9195     tag_len += offset_r;
9196     desc_cnt--;
9197   }
9198
9199   return tag_len;
9200 }
9201
9202 static int
9203 dissect_ric_descriptor(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
9204                          guint32 tag_len, proto_item *ti, proto_item *ti_len)
9205 {
9206
9207   guint8       rsrc_type = 0;
9208
9209   if (tag_len < 1)  {
9210     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9211                            "RIC Data Length must be at least 1 byte");
9212     return 0;
9213   }
9214
9215   rsrc_type = tvb_get_guint8(tvb,offset);
9216   proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_rsrc_type, tvb,
9217                            offset, 1, ENC_LITTLE_ENDIAN);
9218   offset += 1;
9219
9220   if (rsrc_type == 1) {
9221     /* Block ACK params
9222      * 802.11-2012: 8.4.2.53 RIC Descriptor element
9223      * Block Ack parameter set as defined in 8.4.1.14,
9224      * Block Ack timeout value as defined in 8.4.1.15, and
9225      * Block Ack starting sequence control as defined in 8.3.1.8
9226      */
9227     /* TODO: Still figuring out how to parse these ones,
9228      * need a sample capture with at least HEX Dump
9229      */
9230     proto_item_append_text(ti, " :RIC Descriptors: Block ACK Params");
9231     proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_var_params, tvb,
9232                         offset, tag_len-1, ENC_NA);
9233     offset += tag_len -1;
9234   }else {
9235     /* 0,2-255 are reserved*/
9236     proto_item_append_text(ti, " :RIC Descriptors: 0(Reserved)");
9237   }
9238   return offset;
9239 }
9240 static int
9241 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vs)
9242 {
9243   proto_item *ti;
9244   proto_tree *mcs_tree, *bit_tree;
9245
9246   /* 16 byte Supported MCS set */
9247   if (vs)
9248   {
9249     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset_vs, tvb, offset, 16,
9250       basic ? "Basic MCS Set" : "MCS Set");
9251   } else
9252   {
9253     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset, tvb, offset, 16,
9254       basic ? "Basic MCS Set" : "MCS Set");
9255   }
9256   mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
9257
9258   /* Rx MCS Bitmask */
9259   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_rx_bitmask, tvb, offset, 10, ENC_NA);
9260   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
9261
9262   /* Bits 0 - 31 */
9263   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_0to7, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9264   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_8to15, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9265   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_16to23, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9266   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_24to31, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9267   offset += 4;
9268
9269   /* Bits 32 - 52 */
9270   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_32, tvb, offset , 4, ENC_LITTLE_ENDIAN);
9271   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_33to38, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9272   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_39to52, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9273   offset += 2;
9274
9275   /* Bits 53 - 76 */
9276   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_53to76, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9277   offset += 4;
9278
9279   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_highest_data_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9280   offset += 2;
9281
9282   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_mcs_set_defined, tvb, offset, 1,
9283       ENC_LITTLE_ENDIAN);
9284   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal, tvb, offset, 1,
9285       ENC_LITTLE_ENDIAN);
9286   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_max_spatial_streams, tvb, offset, 1,
9287       ENC_LITTLE_ENDIAN);
9288   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_unequal_modulation, tvb, offset, 1,
9289       ENC_LITTLE_ENDIAN);
9290   offset += 1;
9291
9292   offset += 3;
9293   return offset;
9294 }
9295
9296 /*  802.11n D1.10 - HT Information IE  */
9297 static int
9298 dissect_ht_info_ie_1_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
9299                        guint32 tag_len, proto_item *ti_len)
9300 {
9301   proto_item *cap_item;
9302   proto_tree *cap_tree;
9303
9304   cap_tree = tree;
9305
9306   if (tag_len < 22) {
9307     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9308                            "HT Information IE content length %u wrong, must be at least 22 bytes", tag_len);
9309     return offset;
9310   }
9311
9312
9313   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_primary_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9314   offset += 1;
9315
9316   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter1, tvb,
9317                     offset, 1, ENC_LITTLE_ENDIAN);
9318   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter1_tree);
9319   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_secondary_channel_offset, tvb,
9320                     offset, 1, ENC_LITTLE_ENDIAN);
9321   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_channel_width, tvb,
9322                     offset, 1, ENC_LITTLE_ENDIAN);
9323   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_rifs_mode, tvb,
9324                     offset, 1, ENC_LITTLE_ENDIAN);
9325   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_psmp_stas_only, tvb,
9326                     offset, 1, ENC_LITTLE_ENDIAN);
9327   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_service_interval_granularity, tvb,
9328                     offset, 1, ENC_LITTLE_ENDIAN);
9329   offset += 1;
9330
9331   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter2, tvb,
9332                     offset, 2, ENC_LITTLE_ENDIAN);
9333   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter2_tree);
9334   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_operating_mode, tvb,
9335                     offset, 1, ENC_LITTLE_ENDIAN);
9336   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_non_greenfield_sta_present, tvb,
9337                     offset, 1, ENC_LITTLE_ENDIAN);
9338   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_transmit_burst_limit, tvb,
9339                     offset, 1, ENC_LITTLE_ENDIAN);
9340   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_obss_non_ht_stas_present, tvb,
9341                     offset, 1, ENC_LITTLE_ENDIAN);
9342   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_1, tvb,
9343                     offset, 2, ENC_LITTLE_ENDIAN);
9344   offset += 2;
9345
9346   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter3, tvb,
9347                     offset, 2, ENC_LITTLE_ENDIAN);
9348   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter3_tree);
9349   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_2, tvb,
9350                     offset, 1, ENC_LITTLE_ENDIAN);
9351   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_dual_beacon, tvb,
9352                     offset, 1, ENC_LITTLE_ENDIAN);
9353   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_dual_cts_protection, tvb,
9354                     offset, 1, ENC_LITTLE_ENDIAN);
9355   offset += 1;
9356   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_secondary_beacon, tvb,
9357                     offset, 1, ENC_LITTLE_ENDIAN);
9358   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_lsig_txop_protection_full_support, tvb,
9359                     offset, 1, ENC_LITTLE_ENDIAN);
9360   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_pco_active, tvb,
9361                     offset, 1, ENC_LITTLE_ENDIAN);
9362   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_pco_phase, tvb,
9363                     offset, 1, ENC_LITTLE_ENDIAN);
9364   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_3, tvb,
9365                     offset, 1, ENC_LITTLE_ENDIAN);
9366   offset += 1;
9367
9368   offset = dissect_mcs_set(tree, tvb, offset, TRUE, FALSE);
9369
9370   return offset;
9371 }
9372
9373
9374 static int
9375 dissect_wapi_param_set(tvbuff_t *tvb, packet_info *pinfo,
9376                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
9377                           proto_item *ti, int ftype)
9378 {
9379   /* Parse the WAPI Parameter Set IE Here*/
9380   proto_item *item;
9381   proto_tree *subtree;
9382   guint16 loop_cnt, version  = 1, akm_cnt  = 1, ucast_cnt = 1, bkid_cnt = 1;
9383   guint8  akm_suite_type = 0, ucast_cipher_type = 0, mcast_cipher_type = 0;
9384
9385   version = tvb_get_letohs(tvb, offset);
9386   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9387   offset += 2;
9388
9389   /*MIN: 2 + (2+4)+ (2+4) + 4 + 2 + 0 (BKID CNT and LIST)  =20*/
9390   if (tag_len < 20) {
9391       expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9392                 "tag_len is  %d, its neither WAPI not BSS-AC-Access-Delay", tag_len);
9393     return offset;
9394   }
9395
9396   if (version != 1) {
9397     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9398                            "Version of WAPI protocol is %d, must be = 1", version);
9399     return offset;
9400   }
9401
9402   /* AKM Suites: list can't be 0*/
9403   akm_cnt = tvb_get_letohs(tvb, offset);
9404   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_akm_suite_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9405   offset += 2;
9406   if (akm_cnt != 0) {
9407     proto_item_append_text(ti, " : AKM Suite List:");
9408     for (loop_cnt = 0; loop_cnt < akm_cnt; loop_cnt++) {
9409       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_akm_tree);
9410       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_oui, tvb, offset, 3, ENC_NA);
9411       offset += 3;
9412       akm_suite_type = tvb_get_guint8(tvb,offset);
9413       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9414       offset += 1;
9415       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1,val_to_str(akm_suite_type,
9416       ieee80211_wapi_suite_type_short,"Reserved: %d"));
9417     }
9418     proto_item_append_text(ti, " /");
9419   } else {
9420     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Number of AKM suites is 0, must be min 1");
9421     return offset;
9422
9423   }
9424   /* Unicast Cipher Suites: list can't be 0*/
9425   ucast_cnt = tvb_get_letohs(tvb, offset);
9426   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
9427                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9428   offset += 2;
9429   if (ucast_cnt != 0) {
9430     proto_item_append_text(ti, " Unicast Cipher List:");
9431     for (loop_cnt = 0; loop_cnt < ucast_cnt; loop_cnt++) {
9432       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_ucast_tree);
9433       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
9434       offset += 3;
9435       ucast_cipher_type = tvb_get_guint8(tvb,offset);
9436       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9437       offset += 1;
9438       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(ucast_cipher_type,ieee80211_wapi_cipher_type,"Reserved: %d"));
9439     }
9440   proto_item_append_text(ti, " /");
9441   } else {
9442     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Number of Unicast Cipher suites is 0, must be min  1");
9443     return offset;
9444
9445   }
9446
9447   /* Multicast Cipher Suites*/
9448   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
9449   offset += 3;
9450   mcast_cipher_type = tvb_get_guint8(tvb,offset);
9451   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9452   offset += 1;
9453   proto_item_append_text(ti, " Multicast Cipher: %s", val_to_str(mcast_cipher_type,ieee80211_wapi_cipher_type,"Reserved: %d"));
9454
9455   /* WAPI capability*/
9456   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_capab, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9457   subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_preauth_tree);
9458   proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_capab_preauth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9459   proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_capab_rsvd, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9460
9461   offset += 2;
9462   /* BKID List: The list can be 0
9463    * Applicable only for assoc/re-assoc
9464    */
9465   if (ftype == MGT_ASSOC_REQ || ftype == MGT_REASSOC_REQ ) {
9466     bkid_cnt = tvb_get_letohs(tvb, offset);
9467     proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9468     offset += 2;
9469     if (bkid_cnt != 0) {
9470       for (loop_cnt = 0; loop_cnt < bkid_cnt; loop_cnt++) {
9471         proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_list, tvb, offset, 16, ENC_NA);
9472         offset += 16;
9473       }
9474     }
9475   }
9476   return offset;
9477 }
9478
9479 static int dissect_bss_max_idle_period(proto_tree *tree, tvbuff_t *tvb,
9480                                        int offset)
9481 {
9482   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_period,
9483                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9484   offset += 2;
9485   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_options_protected,
9486                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9487   offset++;
9488   return offset;
9489 }
9490
9491 static int add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
9492                             int offset, int ftype);
9493
9494 enum tfs_request_subelem_id {
9495   TFS_REQ_SUBELEM_TFS = 1,
9496   TFS_REQ_SUBELEM_VENDOR_SPECIFIC = 221
9497 };
9498
9499 static const value_string tfs_request_subelem_ids[] = {
9500   { TFS_REQ_SUBELEM_TFS, "TFS subelement" },
9501   { TFS_REQ_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
9502   { 0, NULL }
9503 };
9504
9505 static int dissect_tfs_request(packet_info *pinfo, proto_tree *tree,
9506                                tvbuff_t *tvb, int offset, guint32 tag_len,
9507                                int ftype)
9508 {
9509   int end = offset + tag_len;
9510
9511   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_id,
9512                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9513   offset++;
9514   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_delete_after_match,
9515                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9516   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_notify,
9517                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9518   offset++;
9519   if (offset + 1 >= end) {
9520     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_WARN,
9521                            "No TFS Request subelements in TFS Request");
9522     return end;
9523   }
9524
9525   while (offset + 1 < end) {
9526     guint8 id, len;
9527     int s_offset, s_end;
9528
9529     id = tvb_get_guint8(tvb, offset);
9530     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_id,
9531                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9532     offset++;
9533     len = tvb_get_guint8(tvb, offset);
9534     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_len,
9535                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9536     offset++;
9537     if (offset + len > end) {
9538       expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
9539                              "Not enough data for TFS Request subelement");
9540       return end;
9541     }
9542     switch (id) {
9543     case TFS_REQ_SUBELEM_TFS:
9544       s_offset = offset;
9545       s_end = offset + len;
9546       while (s_offset < s_end) {
9547         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, ftype);
9548         s_offset += tlen;
9549       }
9550       break;
9551     default:
9552       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem,
9553                           tvb, offset, len, ENC_NA);
9554       break;
9555     }
9556     offset += len;
9557   }
9558
9559   if (offset < end) {
9560     proto_tree_add_text(tree, tvb, offset, end - offset,
9561                         "Unexpected extra data");
9562     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_WARN,
9563                            "Extra data after TFS Subelements");
9564   }
9565
9566   return end;
9567 }
9568
9569 enum tfs_response_subelem_id {
9570   TFS_RESP_SUBELEM_TFS_STATUS = 1,
9571   TFS_RESP_SUBELEM_TFS = 2,
9572   TFS_RESP_SUBELEM_VENDOR_SPECIFIC = 221
9573 };
9574
9575 static const value_string tfs_response_subelem_ids[] = {
9576   { TFS_RESP_SUBELEM_TFS_STATUS, "TFS Status subelement" },
9577   { TFS_RESP_SUBELEM_TFS, "TFS subelement" },
9578   { TFS_RESP_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
9579   { 0, NULL }
9580 };
9581
9582 static int dissect_tfs_response(packet_info *pinfo, proto_tree *tree,
9583                                 tvbuff_t *tvb, int offset, guint32 tag_len,
9584                                 int ftype)
9585 {
9586   int end = offset + tag_len;
9587
9588   while (offset + 3 <= end) {
9589     guint8 id, len;
9590     int s_offset, s_end;
9591
9592     id = tvb_get_guint8(tvb, offset);
9593     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_id,
9594                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9595     offset++;
9596     len = tvb_get_guint8(tvb, offset);
9597     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_len,
9598                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9599     offset++;
9600     if (offset + len > end) {
9601       expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
9602                              "Not enough data for TFS Request subelement");
9603       return end;
9604     }
9605     switch (id) {
9606     case TFS_RESP_SUBELEM_TFS_STATUS:
9607       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_status,
9608                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
9609       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_id,
9610                           tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
9611       break;
9612     case TFS_RESP_SUBELEM_TFS:
9613       s_offset = offset;
9614       s_end = offset + len;
9615       while (s_offset < s_end) {
9616         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, ftype);
9617         s_offset += tlen;
9618       }
9619       break;
9620     default:
9621       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem,
9622                           tvb, offset, len, ENC_NA);
9623       break;
9624     }
9625
9626     offset += len;
9627   }
9628
9629   if (offset < end) {
9630     proto_tree_add_text(tree, tvb, offset, end - offset,
9631                         "Unexpected extra data");
9632     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_WARN,
9633                            "Extra data after TFS Status subelements");
9634   }
9635
9636   return end;
9637 }
9638
9639 static const value_string wnm_sleep_mode_action_types[] = {
9640   { 0, "Enter WNM-Sleep Mode" },
9641   { 1, "Exit WNM-Sleep Mode" },
9642   { 0, NULL }
9643 };
9644
9645 static const value_string wnm_sleep_mode_response_status_vals[] = {
9646   { 0, "Enter/Exit WNM-Sleep Mode Accept" },
9647   { 1, "Exit WNM-Sleep Mode Accept, GTK/IGTK update required" },
9648   { 2, "Denied. The AP is unable to perform the requested action." },
9649   { 3, "Denied temporarily. The AP is unable to perform the requested action "
9650     "at the current time. The request can be submitted again at a later time."
9651   },
9652   { 4, "Denied. Due to the pending key expiration." },
9653   { 5, "Denied. The requested action was not granted due to other WNM services "
9654     "in use by the requesting STA." },
9655   { 0, NULL }
9656 };
9657
9658 static int dissect_wnm_sleep_mode(proto_tree *tree, tvbuff_t *tvb, int offset)
9659 {
9660   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_action_type,
9661                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9662   offset++;
9663   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_response_status,
9664                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9665   offset++;
9666   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_interval,
9667                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9668   offset += 2;
9669   return offset;
9670 }
9671
9672 static const value_string time_adv_timing_capab_vals[] = {
9673   { 0, "No standardized external time source" },
9674   { 1, "Timestamp offset based on UTC" },
9675   { 2, "UTC time at which the TSF timer is 0" },
9676   { 0, NULL }
9677 };
9678
9679 static int
9680 dissect_time_adv(proto_tree *tree, tvbuff_t *tvb, int offset)
9681 {
9682   guint8 capab;
9683   proto_item *item;
9684   proto_tree *subtree;
9685   struct tm tm, *now;
9686   time_t t;
9687
9688   capab = tvb_get_guint8(tvb, offset);
9689   proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_timing_capab,
9690                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9691   offset += 1;
9692
9693   switch (capab) {
9694   case 1:
9695     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
9696                         tvb, offset, 10, ENC_NA);
9697     offset += 10;
9698
9699     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
9700                         tvb, offset, 5, ENC_NA);
9701     offset += 5;
9702     break;
9703   case 2:
9704     item = proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
9705                                tvb, offset, 10, ENC_NA);
9706     subtree = proto_item_add_subtree(item, ett_tag_time_adv_tree);
9707     memset(&tm, 0, sizeof(tm));
9708     tm.tm_year = tvb_get_letohs(tvb, offset) - 1900;
9709     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_year,
9710                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
9711     offset += 2;
9712     tm.tm_mon = tvb_get_guint8(tvb, offset) - 1;
9713     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_month,
9714                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9715     offset += 1;
9716     tm.tm_mday = tvb_get_guint8(tvb, offset);
9717     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_day,
9718                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9719     offset += 1;
9720     tm.tm_hour = tvb_get_guint8(tvb, offset);
9721     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_hours,
9722                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9723     offset += 1;
9724     tm.tm_min = tvb_get_guint8(tvb, offset);
9725     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_minutes,
9726                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9727     offset += 1;
9728     tm.tm_sec = tvb_get_guint8(tvb, offset);
9729     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_seconds,
9730                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9731     offset += 1;
9732     proto_tree_add_item(subtree,
9733                         hf_ieee80211_tag_time_adv_time_value_milliseconds,
9734                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
9735     offset += 2;
9736     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_reserved,
9737                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9738     offset += 1;
9739
9740     tm.tm_isdst = -1;
9741     t = mktime(&tm);
9742     if (t != -1) {
9743       t += (time_t)(last_timestamp / 1000000);
9744       now = localtime(&t);
9745       if (now)
9746         proto_item_append_text(item,
9747                                ": current time=%u-%02u-%02u %02u:%02u:%02u",
9748                                now->tm_year + 1900, now->tm_mon + 1,
9749                                now->tm_mday, now->tm_hour, now->tm_min,
9750                                now->tm_sec);
9751     }
9752
9753     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
9754                         tvb, offset, 5, ENC_NA);
9755     offset += 5;
9756
9757     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_update_counter,
9758                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9759     offset += 1;
9760     break;
9761   }
9762
9763   return offset;
9764 }
9765
9766 static int
9767 dissect_time_zone(proto_tree *tree, tvbuff_t *tvb, int offset,
9768                   guint32 tag_len)
9769 {
9770   proto_tree_add_item(tree, hf_ieee80211_tag_time_zone, tvb, offset, tag_len,
9771                       ENC_ASCII|ENC_NA);
9772   return offset + tag_len;
9773 }
9774
9775 static int
9776 dissect_ap_channel_report(tvbuff_t *tvb, packet_info *pinfo,
9777                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
9778                           int tag_end, proto_item *ti)
9779 {
9780   if (tag_len < 1) {
9781     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9782                            "AP Channel Report length %u wrong, must be > 1", tag_len);
9783     return offset;
9784   }
9785
9786   proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_regulatory_class, tvb,
9787                       offset, 1, ENC_LITTLE_ENDIAN);
9788   proto_item_append_text(ti, ": Regulatory Class %u, Channel List :", tvb_get_guint8(tvb, offset));
9789   offset += 1;
9790
9791   while (offset < tag_end)
9792   {
9793     proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_channel_list, tvb, offset, 1, ENC_NA);
9794     proto_item_append_text(ti, " %u,", tvb_get_guint8(tvb, offset));
9795     offset += 1;
9796   }
9797   return offset;
9798 }
9799 static int
9800 dissect_secondary_channel_offset_ie(tvbuff_t *tvb, packet_info *pinfo,
9801                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9802 {
9803
9804   if (tag_len != 1) {
9805     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9806                            "Secondary Channel Offset length %u wrong, must be = 1", tag_len);
9807     return offset;
9808   }
9809
9810   proto_tree_add_item(tree, hf_ieee80211_tag_secondary_channel_offset, tvb,
9811                       offset, 1, ENC_LITTLE_ENDIAN);
9812
9813   offset += 1;
9814
9815   return offset;
9816 }
9817
9818 static int
9819 dissect_bss_avg_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
9820                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9821 {
9822
9823   if (tag_len != 1) {
9824     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9825                            "BSS Average Access Delay length %u wrong, must be = 1", tag_len);
9826     return offset;
9827   }
9828
9829   proto_tree_add_item(tree, hf_ieee80211_tag_bss_ap_avg_access_delay, tvb,
9830                       offset, 1, ENC_LITTLE_ENDIAN);
9831
9832   offset += 1;
9833
9834   return offset;
9835 }
9836
9837 static int
9838 dissect_antenna_ie(tvbuff_t *tvb, packet_info *pinfo,
9839                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9840 {
9841
9842   if (tag_len != 1) {
9843     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9844                            "Antenna length %u wrong, must be = 1", tag_len);
9845     return offset;
9846   }
9847
9848   proto_tree_add_item(tree, hf_ieee80211_tag_antenna_id, tvb,
9849                       offset, 1, ENC_LITTLE_ENDIAN);
9850
9851   offset += 1;
9852
9853   return offset;
9854 }
9855
9856 static int
9857 dissect_rsni_ie(tvbuff_t *tvb, packet_info *pinfo,
9858                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9859 {
9860
9861   if (tag_len != 1) {
9862     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9863                            "RSNI length %u wrong, must be = 1", tag_len);
9864     return offset;
9865   }
9866
9867   proto_tree_add_item(tree, hf_ieee80211_tag_rsni, tvb,
9868                       offset, 1, ENC_LITTLE_ENDIAN);
9869
9870   offset += 1;
9871
9872   return offset;
9873 }
9874
9875 static int
9876 dissect_bss_available_admission_capacity_ie(tvbuff_t *tvb, packet_info *pinfo,
9877                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9878 {
9879   proto_item *ti;
9880   proto_tree *btree;
9881   guint16 bitmask;
9882   if (tag_len < 2) {
9883     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9884                            "BSS Available Admission Capacity length %u wrong, must > = 2", tag_len);
9885     return offset;
9886   }
9887
9888   ti = proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask, tvb,
9889                       offset, 2, ENC_LITTLE_ENDIAN);
9890   btree = proto_item_add_subtree(ti, ett_tag_bss_bitmask_tree);
9891   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9892   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9893   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9894   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9895   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9896   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9897   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9898   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9899   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9900   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9901   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9902   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9903   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9904   bitmask = tvb_get_letohs(tvb, offset);
9905   offset += 2;
9906
9907   if(bitmask & BSS_BITMASK_UP0)
9908   {
9909     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9910     offset += 2;
9911   }
9912   if(bitmask & BSS_BITMASK_UP1)
9913   {
9914     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9915     offset += 2;
9916   }
9917   if(bitmask & BSS_BITMASK_UP2)
9918   {
9919     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9920     offset += 2;
9921   }
9922   if(bitmask & BSS_BITMASK_UP3)
9923   {
9924     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9925     offset += 2;
9926   }
9927   if(bitmask & BSS_BITMASK_UP4)
9928   {
9929     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9930     offset += 2;
9931   }
9932   if(bitmask & BSS_BITMASK_UP5)
9933   {
9934     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9935     offset += 2;
9936   }
9937   if(bitmask & BSS_BITMASK_UP6)
9938   {
9939     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9940     offset += 2;
9941   }
9942   if(bitmask & BSS_BITMASK_UP7)
9943   {
9944     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9945     offset += 2;
9946   }
9947   if(bitmask & BSS_BITMASK_AC0)
9948   {
9949     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9950     offset += 2;
9951   }
9952   if(bitmask & BSS_BITMASK_AC1)
9953   {
9954     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9955     offset += 2;
9956   }
9957   if(bitmask & BSS_BITMASK_AC2)
9958   {
9959     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9960     offset += 2;
9961   }
9962   if(bitmask & BSS_BITMASK_AC3)
9963   {
9964     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9965     offset += 2;
9966   }
9967   return offset;
9968 }
9969
9970 static int
9971 dissect_bss_ac_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
9972                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9973 {
9974
9975   if (tag_len == 4) {
9976     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9977                            "BSS AC Access Delay length %u wrong, must = 4", tag_len);
9978     return offset;
9979   }
9980
9981   /* TODO: Display the scaled representation of the average
9982     medium access delay (a big (precalculed) value_string ?)
9983     See 8.4.2.46 BSS AC Access Delay element ... */
9984
9985   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_be, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9986   offset += 1;
9987   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_bk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9988   offset += 1;
9989   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9990   offset += 1;
9991   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vo, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9992   offset += 1;
9993
9994   return offset;
9995 }
9996
9997 static int
9998 dissect_rm_enabled_capabilities_ie(packet_info *pinfo, proto_tree *tree,
9999                          proto_item *ti, proto_item *ti_len,
10000                          guint32 tag_len, tvbuff_t *tvb,
10001                          int offset, int tag_end _U_)
10002 {
10003   proto_item *ti_ex_cap;
10004   proto_tree *ex_cap_tree;
10005
10006   if (tag_len != 5)
10007   {
10008     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "RM Enabled Capabilities length %u wrong, must = 4", tag_len);
10009     return offset;
10010   }
10011   proto_item_append_text(ti, " (%d octets)", tag_len);
10012
10013   /* RM Enabled Capability octet 1 */
10014   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10015   proto_item_append_text(ti_ex_cap, " (octet 1)");
10016   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap1);
10017   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b0, tvb, offset, 1, ENC_NA);
10018   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b1, tvb, offset, 1, ENC_NA);
10019   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b2, tvb, offset, 1, ENC_NA);
10020   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b3, tvb, offset, 1, ENC_NA);
10021   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b4, tvb, offset, 1, ENC_NA);
10022   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b5, tvb, offset, 1, ENC_NA);
10023   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b6, tvb, offset, 1, ENC_NA);
10024   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b7, tvb, offset, 1, ENC_NA);
10025   offset += 1;
10026
10027   /* RM Enabled Capability octet 2 */
10028   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10029   proto_item_append_text(ti_ex_cap, " (octet 2)");
10030   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap2);
10031   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b8, tvb, offset, 1, ENC_NA);
10032   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b9, tvb, offset, 1, ENC_NA);
10033   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b10, tvb, offset, 1, ENC_NA);
10034   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b11, tvb, offset, 1, ENC_NA);
10035   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b12, tvb, offset, 1, ENC_NA);
10036   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b13, tvb, offset, 1, ENC_NA);
10037   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b14, tvb, offset, 1, ENC_NA);
10038   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b15, tvb, offset, 1, ENC_NA);
10039   offset += 1;
10040
10041   /* RM Enabled Capability octet 3 */
10042   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10043   proto_item_append_text(ti_ex_cap, " (octet 3)");
10044   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap3);
10045   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b16, tvb, offset, 1, ENC_NA);
10046   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b17, tvb, offset, 1, ENC_NA);
10047   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b18to20, tvb, offset, 1, ENC_NA);
10048   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b21to23, tvb, offset, 1, ENC_NA);
10049   offset += 1;
10050
10051   /* RM Enabled Capability octet 4 */
10052   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10053   proto_item_append_text(ti_ex_cap, " (octet 4)");
10054   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap4);
10055   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b24to26, tvb, offset, 1, ENC_NA);
10056   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b27, tvb, offset, 1, ENC_NA);
10057   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b28, tvb, offset, 1, ENC_NA);
10058   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b29, tvb, offset, 1, ENC_NA);
10059   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b30, tvb, offset, 1, ENC_NA);
10060   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b31, tvb, offset, 1, ENC_NA);
10061   offset += 1;
10062
10063   /* RM Enabled Capability octet 5 */
10064   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10065   proto_item_append_text(ti_ex_cap, " (octet 5)");
10066   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap5);
10067   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b32, tvb, offset, 1, ENC_NA);
10068   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b33, tvb, offset, 1, ENC_NA);
10069   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_o5, tvb, offset, 1, ENC_NA);
10070   offset += 1;
10071
10072   return offset;
10073 }
10074
10075 static int
10076 dissect_ht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
10077                          guint32 tag_len, proto_item *ti_len, gboolean vs)
10078 {
10079   proto_item *cap_item, *ti;
10080   proto_tree *cap_tree;
10081
10082   if (tag_len != 26) {
10083     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10084                            "HT Capabilities IE length %u wrong, must be = 26", tag_len);
10085     return offset;
10086   }
10087
10088   if (wlan_ignore_draft_ht && vs)
10089     return offset;
10090
10091   /* 2 byte HT Capabilities  Info*/
10092   if (vs)
10093   {
10094     cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_vs_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10095   }
10096   else
10097   {
10098     cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10099   }
10100   cap_tree = proto_item_add_subtree(cap_item, ett_ht_cap_tree);
10101   proto_tree_add_item(cap_tree, hf_ieee80211_ht_ldpc_coding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10102   proto_tree_add_item(cap_tree, hf_ieee80211_ht_chan_width, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10103   proto_tree_add_item(cap_tree, hf_ieee80211_ht_sm_pwsave, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10104   proto_tree_add_item(cap_tree, hf_ieee80211_ht_green, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10105   proto_tree_add_item(cap_tree, hf_ieee80211_ht_short20, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10106   proto_tree_add_item(cap_tree, hf_ieee80211_ht_short40, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10107   proto_tree_add_item(cap_tree, hf_ieee80211_ht_tx_stbc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10108
10109   proto_tree_add_item(cap_tree, hf_ieee80211_ht_rx_stbc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10110   proto_tree_add_item(cap_tree, hf_ieee80211_ht_delayed_block_ack, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10111   proto_tree_add_item(cap_tree, hf_ieee80211_ht_max_amsdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10112   proto_tree_add_item(cap_tree, hf_ieee80211_ht_dss_cck_40, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10113   proto_tree_add_item(cap_tree, hf_ieee80211_ht_psmp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10114   proto_tree_add_item(cap_tree, hf_ieee80211_ht_40_mhz_intolerant, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10115   proto_tree_add_item(cap_tree, hf_ieee80211_ht_l_sig, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10116   offset += 2;
10117
10118   /* 1 byte A-MPDU Parameters */
10119   if (vs)
10120   {
10121     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10122   } else
10123   {
10124     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10125   }
10126   cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
10127   ti = proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10128   proto_item_append_text(ti, " (%04.0f[Bytes])",pow(2,13+(tvb_get_guint8(tvb, offset) & 0x3))-1);
10129   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu_start_spacing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10130   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10131   offset += 1;
10132
10133   /* 16 byte MCS set */
10134   offset = dissect_mcs_set(tree, tvb, offset, FALSE, vs);
10135
10136
10137   /* 2 byte HT Extended Capabilities */
10138   if (vs)
10139   {
10140     cap_item = proto_tree_add_item(tree, hf_ieee80211_htex_vs_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10141   } else {
10142     cap_item = proto_tree_add_item(tree, hf_ieee80211_htex_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10143   }
10144   cap_tree = proto_item_add_subtree(cap_item, ett_htex_cap_tree);
10145   proto_tree_add_item(cap_tree, hf_ieee80211_htex_pco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10146   proto_tree_add_item(cap_tree, hf_ieee80211_htex_transtime, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10147   offset += 1;
10148   proto_tree_add_item(cap_tree, hf_ieee80211_htex_mcs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10149   proto_tree_add_item(cap_tree, hf_ieee80211_htex_htc_support, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10150   proto_tree_add_item(cap_tree, hf_ieee80211_htex_rd_responder, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10151   offset += 1;
10152
10153
10154   /* 4 byte TxBF capabilities */
10155   if (vs)
10156   {
10157     cap_item = proto_tree_add_item(tree, hf_ieee80211_txbf_vs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10158   } else {
10159     cap_item = proto_tree_add_item(tree, hf_ieee80211_txbf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10160   }
10161   cap_tree = proto_item_add_subtree(cap_item, ett_txbf_tree);
10162   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_cap, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10163   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_rcv_ssc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10164   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_tx_ssc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10165   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_rcv_ndp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10166   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_tx_ndp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10167   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_impl_txbf, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10168   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_calib, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10169   offset += 1;
10170
10171   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_csi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10172   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_uncomp_fm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10173   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_comp_fm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10174   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_bf_csi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10175   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_uncomp_fm_feed, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10176   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_comp_fm_feed, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10177   offset += 1;
10178
10179   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_min_group, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10180   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_csi_num_bf_ant, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10181   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_uncomp_sm_bf_ant, tvb, offset, 1,  ENC_LITTLE_ENDIAN);
10182   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_comp_sm_bf_ant, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10183   offset += 1;
10184
10185   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_csi_max_rows_bf, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10186   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_chan_est, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10187   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_resrv, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10188   offset += 1;
10189
10190   /* 1 byte Antenna Selection (ASEL) capabilities */
10191   if (vs)
10192   {
10193     cap_item = proto_tree_add_item(tree, hf_ieee80211_antsel_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10194   }
10195   else
10196   {
10197     cap_item = proto_tree_add_item(tree, hf_ieee80211_antsel, tvb,  offset, 1, ENC_LITTLE_ENDIAN);
10198   }
10199   cap_tree = proto_item_add_subtree(cap_item, ett_antsel_tree);
10200   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10201   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10202   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10203   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b3, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10204   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b4, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10205   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b5, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10206   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b6, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10207   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b7, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10208
10209   offset += 1;
10210
10211   return offset;
10212 }
10213
10214 static int
10215 dissect_ht_info_ie_1_0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
10216                        guint32 tag_len, proto_item *ti_len)
10217 {
10218   proto_item *cap_item;
10219   proto_tree *cap_tree;
10220
10221   if (tag_len != 22) {
10222     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10223                            "Tag length %u wrong, must be = 22", tag_len);
10224     return offset;
10225   }
10226
10227   if (wlan_ignore_draft_ht)
10228     return offset;
10229
10230   /* 1 HT Control Channel */
10231   proto_tree_add_item(tree, hf_ieee80211_hta_cc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10232   offset += 1;
10233
10234   /* 1 byte HT additional capabilities */
10235   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 1,
10236              ENC_LITTLE_ENDIAN);
10237   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap_tree);
10238
10239   proto_tree_add_item(cap_tree, hf_ieee80211_hta_ext_chan_offset, tvb, offset, 1,
10240              ENC_LITTLE_ENDIAN);
10241   proto_tree_add_item(cap_tree, hf_ieee80211_hta_rec_tx_width, tvb, offset, 1,
10242              ENC_LITTLE_ENDIAN);
10243   proto_tree_add_item(cap_tree, hf_ieee80211_hta_rifs_mode, tvb, offset, 1,
10244              ENC_LITTLE_ENDIAN);
10245   proto_tree_add_item(cap_tree, hf_ieee80211_hta_controlled_access, tvb, offset, 1,
10246              ENC_LITTLE_ENDIAN);
10247   proto_tree_add_item(cap_tree, hf_ieee80211_hta_service_interval, tvb, offset, 1,
10248              ENC_LITTLE_ENDIAN);
10249   offset += 1;
10250
10251   /* 2 byte HT additional capabilities */
10252   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 2,
10253              ENC_LITTLE_ENDIAN);
10254   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap1_tree);
10255
10256   proto_tree_add_item(cap_tree, hf_ieee80211_hta_operating_mode, tvb, offset, 2,
10257              ENC_LITTLE_ENDIAN);
10258   proto_tree_add_item(cap_tree, hf_ieee80211_hta_non_gf_devices, tvb, offset, 2,
10259              ENC_LITTLE_ENDIAN);
10260
10261   offset += 2;
10262
10263   /* 2 byte HT additional capabilities */
10264   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 2,
10265              ENC_LITTLE_ENDIAN);
10266   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap2_tree);
10267
10268   proto_tree_add_item(cap_tree, hf_ieee80211_hta_basic_stbc_mcs, tvb, offset, 2,
10269              ENC_LITTLE_ENDIAN);
10270   proto_tree_add_item(cap_tree, hf_ieee80211_hta_dual_stbc_protection, tvb, offset, 2,
10271              ENC_LITTLE_ENDIAN);
10272   proto_tree_add_item(cap_tree, hf_ieee80211_hta_secondary_beacon, tvb, offset, 2,
10273              ENC_LITTLE_ENDIAN);
10274   proto_tree_add_item(cap_tree, hf_ieee80211_hta_lsig_txop_protection, tvb, offset, 2,
10275              ENC_LITTLE_ENDIAN);
10276   proto_tree_add_item(cap_tree, hf_ieee80211_hta_pco_active, tvb, offset, 2,
10277              ENC_LITTLE_ENDIAN);
10278   proto_tree_add_item(cap_tree, hf_ieee80211_hta_pco_phase, tvb, offset, 2,
10279              ENC_LITTLE_ENDIAN);
10280   offset += 2;
10281
10282   /* 16 byte Supported MCS set */
10283   offset = dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
10284
10285   return offset;
10286 }
10287
10288 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
10289
10290 /*
10291  * 7.1.3.1.10 says:
10292  * "The Order field is 1 bit in length and is set to 1 in any non-QoS Data
10293  * frame that contains an MSDU, or fragment thereof, which is being
10294  * transferred using the StrictlyOrdered service class. The presence of the
10295  * HT Control field in frames is indicated by setting the Order field to 1
10296  * in any Data type or Management type frame that  is transmitted with a
10297  * value of HT_GF or HT_MM for the FORMAT parameter of the TXVECTOR except
10298  * a non-QoS Data frame or a Control Wrapper frame. The Order field is set
10299  * to 0 in all other frames. All non-HT QoS STAs set the Order field to 0."
10300  *
10301  * ...so does this mean that we can check for the presence of +HTC by
10302  * looking for QoS frames with the Order bit set, or do we need extra
10303  * information from the PHY (which would be monumentally silly)?
10304  *
10305  * At any rate, it doesn't look like any equipment we have produces
10306  * +HTC frames, so the code is completely untested.
10307  */
10308
10309 static void
10310 dissect_ht_control(proto_tree *tree, tvbuff_t *tvb, int offset)
10311 {
10312   proto_item *ti;
10313   proto_tree *htc_tree, *lac_subtree;
10314   guint16 htc;
10315
10316   htc = tvb_get_letohs(tvb, offset);
10317
10318   ti = proto_tree_add_item(tree, hf_ieee80211_htc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10319   htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
10320
10321   /* Start: Link Adaptation Control */
10322   ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_lac, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10323   lac_subtree = proto_item_add_subtree(ti, ett_htc_tree);
10324   proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10325   proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_trq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10326
10327   if (HTC_IS_ASELI(htc)) {
10328     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_aseli, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10329   } else {
10330     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_mrq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10331     if (HTC_LAC_MAI_MRQ(htc)) {
10332       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_msi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10333     } else {
10334       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10335     }
10336   }
10337
10338   proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10339
10340   if (HTC_IS_ASELI(htc)) {
10341     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10342     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_data, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10343   } else {
10344     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10345   }
10346   offset += 2;
10347   /* End: Link Adaptation Control */
10348
10349   proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_pos, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10350   proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_seq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10351   proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10352   proto_tree_add_item(htc_tree, hf_ieee80211_htc_csi_steering, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10353
10354   proto_tree_add_item(htc_tree, hf_ieee80211_htc_ndp_announcement, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10355   proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10356   proto_tree_add_item(htc_tree, hf_ieee80211_htc_ac_constraint, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10357   proto_tree_add_item(htc_tree, hf_ieee80211_htc_rdg_more_ppdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10358
10359   /* offset += 2; */
10360 }
10361
10362 static void
10363 dissect_frame_control(proto_tree *tree, tvbuff_t *tvb, gboolean wlan_broken_fc,
10364                       guint32 offset, packet_info *pinfo)
10365 {
10366   guint16 fcf, flags, frame_type_subtype;
10367   proto_tree *fc_tree, *flag_tree;
10368   proto_item *fc_item, *flag_item, *hidden_item, *ti;
10369
10370   fcf = FETCH_FCF(offset);
10371
10372   flags = FCF_FLAGS(fcf);
10373   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
10374
10375   /* Swap offset... */
10376   if(wlan_broken_fc)
10377   {
10378     offset += 1;
10379   }
10380
10381   proto_tree_add_uint(tree, hf_ieee80211_fc_frame_type_subtype, tvb, offset, 1, frame_type_subtype);
10382
10383   fc_item = proto_tree_add_item(tree, hf_ieee80211_fc_field, tvb, offset, 2, ENC_BIG_ENDIAN);
10384
10385   fc_tree = proto_item_add_subtree(fc_item, ett_fc_tree);
10386
10387   proto_tree_add_item(fc_tree, hf_ieee80211_fc_proto_version, tvb, offset, 1, ENC_NA);
10388   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_type, tvb, offset, 1, ENC_NA);
10389   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_subtype, tvb, offset, 1, ENC_NA);
10390   offset += 1;
10391
10392   /* Reswap offset...*/
10393   if(wlan_broken_fc)
10394   {
10395     offset -= 1;
10396     proto_item_append_text(fc_item, "(Swapped)");
10397   }
10398
10399   /* Flags */
10400   flag_item = proto_tree_add_item(fc_tree, hf_ieee80211_fc_flags, tvb, offset, 1, ENC_NA);
10401   flag_tree = proto_item_add_subtree (flag_item, ett_proto_flags);
10402   proto_tree_add_item (flag_tree, hf_ieee80211_fc_data_ds, tvb, offset, 1, ENC_NA);
10403   hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_to_ds, tvb, offset, 1, ENC_NA);
10404   PROTO_ITEM_SET_HIDDEN(hidden_item);
10405   hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_from_ds, tvb, offset, 1, ENC_NA);
10406   PROTO_ITEM_SET_HIDDEN(hidden_item);
10407   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_frag, tvb, offset, 1,ENC_NA);
10408   ti = proto_tree_add_item(flag_tree, hf_ieee80211_fc_retry, tvb, offset, 1, ENC_NA);
10409   if( IS_RETRY(flags) )
10410   {
10411     expert_add_info_format(pinfo, ti, PI_SEQUENCE, PI_NOTE, "Retransmission (retry)");
10412   }
10413   proto_tree_add_item(flag_tree, hf_ieee80211_fc_pwr_mgt, tvb, offset, 1, ENC_NA);
10414   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_data, tvb, offset, 1, ENC_NA);
10415   proto_tree_add_item(flag_tree, hf_ieee80211_fc_protected, tvb, offset, 1,ENC_NA);
10416   proto_tree_add_item(flag_tree, hf_ieee80211_fc_order, tvb, offset, 1, ENC_NA);
10417 }
10418
10419 static void
10420 dissect_durid(proto_tree *hdr_tree, tvbuff_t *tvb, guint16 fts, gint offset)
10421 {
10422   guint16 durid = tvb_get_letohs(tvb, offset);
10423
10424   if (durid < 0x8000) {
10425     proto_tree_add_uint_format_value(hdr_tree, hf_ieee80211_did_duration, tvb,
10426       offset, 2, durid, "%u microseconds", durid);
10427   } else if (((durid & 0xC000) == 0xC000) &&
10428              ((durid & 0x3FFF) > 0) && ((durid & 0x3FFF) <= 2007) &&
10429              (fts == CTRL_PS_POLL)) {
10430     proto_tree_add_item(hdr_tree, hf_ieee80211_assoc_id, tvb, 2, offset,
10431       ENC_LITTLE_ENDIAN);
10432   } else if (durid == 0x8000) {
10433     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
10434       offset, 2, durid, "Duration/ID: %u", durid);
10435   } else {
10436     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
10437       offset, 2, durid, "Duration/ID: %u (reserved)", durid & 0x3FFF);
10438   }
10439 }
10440
10441
10442 static void
10443 dissect_vendor_ie_ht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
10444                     guint offset, proto_item *item, proto_item *ti_len, gint tag_len)
10445 {
10446
10447   guint8 type;
10448
10449   proto_tree_add_item(tree, hf_ieee80211_ht_pren_type, tvb, offset, 1, ENC_NA);
10450   type = tvb_get_guint8(tvb, offset);
10451   offset += 1;
10452   tag_len -= 1;
10453
10454
10455   switch(type){
10456     case 51:
10457       dissect_ht_capability_ie(tvb, pinfo, tree, offset, tag_len, ti_len, TRUE);
10458       proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
10459     break;
10460
10461     case 52:
10462       dissect_ht_info_ie_1_0(tvb, pinfo, tree, offset, tag_len, ti_len);
10463       proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
10464     break;
10465
10466     default:
10467       proto_tree_add_item(tree, hf_ieee80211_ht_pren_unknown, tvb, offset, tag_len, ENC_NA);
10468     break;
10469   }
10470
10471 }
10472
10473 static guint
10474 dissect_interworking(packet_info *pinfo, proto_tree *tree, proto_item *item,
10475                      tvbuff_t *tvb, int offset)
10476 {
10477   guint8 len;
10478
10479   offset += 1;
10480   len = tvb_get_guint8(tvb, offset);
10481   offset += 1;
10482
10483   if ((tvb_reported_length_remaining(tvb, offset) < len) || (len == 0)) {
10484     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10485                            "Truncated Interworking element");
10486     return offset;
10487   }
10488
10489   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_access_network_type,
10490                       tvb, offset, 1, ENC_BIG_ENDIAN);
10491   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_internet,
10492                       tvb, offset, 1, ENC_BIG_ENDIAN);
10493   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_asra,
10494                       tvb, offset, 1, ENC_BIG_ENDIAN);
10495   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_esr,
10496                       tvb, offset, 1, ENC_BIG_ENDIAN);
10497   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_uesa,
10498                       tvb, offset, 1, ENC_BIG_ENDIAN);
10499   offset += 1;
10500
10501   if ((len == (1 + 2)) || (len == (1 + 2 + 6))) {
10502     dissect_venue_info(tree, tvb, offset);
10503     offset += 2;
10504   }
10505
10506   if ((len == (1 + 6)) || (len == (1 + 2 + 6))) {
10507     proto_tree_add_item(tree, hf_ieee80211_tag_interworking_hessid,
10508                         tvb, offset, 6, ENC_NA);
10509     offset += 6;
10510   }
10511
10512   if ((len != 1) && (len != (1 + 2)) && (len != (1 + 6)) && (len != (1 + 2 + 6))) {
10513     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10514                            "Invalid Interworking element length");
10515   }
10516
10517   return offset;
10518 }
10519
10520 static guint
10521 dissect_roaming_consortium(packet_info *pinfo, proto_tree *tree,
10522                            proto_item *item, tvbuff_t *tvb, int offset)
10523 {
10524   guint8 len, oi_lens, oi1_len, oi2_len;
10525   int end;
10526
10527   offset += 1;
10528   len = tvb_get_guint8(tvb, offset);
10529   offset += 1;
10530   end = offset + len;
10531
10532   if ((tvb_reported_length_remaining(tvb, offset) < len) || (len < 2)) {
10533     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10534                            "Truncated Roaming Consortium element");
10535     return 2 + len;
10536   }
10537
10538   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
10539                       tvb, offset, 1, ENC_BIG_ENDIAN);
10540   offset += 1;
10541
10542   oi_lens = tvb_get_guint8(tvb, offset);
10543   oi1_len = oi_lens & 0x0f;
10544   oi2_len = (oi_lens & 0xf0) >> 4;
10545   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1_len,
10546                       tvb, offset, 1, ENC_BIG_ENDIAN);
10547   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2_len,
10548                       tvb, offset, 1, ENC_BIG_ENDIAN);
10549   offset += 1;
10550
10551   if (offset + oi1_len > end) {
10552     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10553                            "Truncated Roaming Consortium element");
10554     return 2 + len;
10555   }
10556
10557   item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1,
10558                              tvb, offset, oi1_len, ENC_NA);
10559   add_manuf(item, tvb, offset);
10560   offset += oi1_len;
10561
10562   if (offset + oi2_len > end) {
10563     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10564                            "Truncated Roaming Consortium element");
10565     return 2 + len;
10566   }
10567
10568   if (oi2_len > 0) {
10569     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2,
10570                         tvb, offset, oi2_len, ENC_NA);
10571     offset += oi2_len;
10572   }
10573
10574   if (end > offset) {
10575     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi3,
10576                         tvb, offset, end - offset, ENC_NA);
10577   }
10578
10579   return 2 + len;
10580 }
10581
10582
10583 /* ************************************************************************* */
10584 /*           Dissect and add tagged (optional) fields to proto tree          */
10585 /* ************************************************************************* */
10586
10587 static int beacon_padding = 0; /* beacon padding bug */
10588
10589 static int
10590 ieee80211_tag_ssid(packet_info *pinfo, proto_tree *tree,
10591                    proto_item *ti, proto_item *ti_len,
10592                    guint32 tag_len, tvbuff_t *tvb, int offset)
10593 {
10594   /* 7.3.2.1 SSID element (0) */
10595   gchar *ssid; /* The SSID may consist of arbitrary bytes */
10596   const gchar *ssid_end;
10597   gint ssid_len = tag_len;
10598
10599   if (beacon_padding != 0) /* padding bug */
10600     return offset;
10601
10602   if (ssid_len > MAX_SSID_LEN) {
10603     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10604                            "SSID length (%u) greater than maximum (%u)",
10605                            ssid_len, MAX_SSID_LEN);
10606     ssid_len = MAX_SSID_LEN;
10607   }
10608
10609   ssid = tvb_get_ephemeral_string(tvb, offset + 2, ssid_len);
10610   if (ssid_len == (gint)tag_len) {
10611     AirPDcapSetLastSSID(&airpdcap_ctx, (CHAR *) ssid, ssid_len);
10612   }
10613   g_utf8_validate(ssid, ssid_len, &ssid_end);
10614   ssid[ssid_end - ssid] = '\0';
10615   if ((gint)(ssid_end - ssid) == ssid_len) {
10616     proto_tree_add_item(tree, hf_ieee80211_tag_ssid, tvb, offset + 2, tag_len,
10617                         ENC_ASCII|ENC_NA);
10618   } else {
10619     emem_strbuf_t *ssid_sb = ep_strbuf_new(ssid);
10620     ep_strbuf_append(ssid_sb, " [truncated]");
10621     proto_tree_add_string_format_value(tree, hf_ieee80211_tag_ssid, tvb, offset + 2, tag_len,
10622                         ssid, "%s", ssid_sb->str);
10623     ssid = ssid_sb->str;
10624   }
10625
10626   if (tag_len > 0) {
10627     proto_item_append_text(ti, ": %s", ssid);
10628
10629     col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", ssid);
10630
10631     /* Wlan Stats */
10632     memcpy(wlan_stats.ssid, ssid, MIN(tag_len, MAX_SSID_LEN));
10633     wlan_stats.ssid_len = tag_len;
10634   } else {
10635     proto_item_append_text(ti, ": Broadcast");
10636
10637     col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Broadcast");
10638   }
10639
10640   beacon_padding += 1; /* padding bug */
10641
10642   return offset + 2 + tag_len;
10643 }
10644
10645 static int
10646 ieee80211_tag_supp_rates(packet_info *pinfo, proto_tree *tree,
10647                          proto_item *ti, proto_item *ti_len,
10648                          guint32 tag_len, tvbuff_t *tvb,
10649                          int offset, int tag_end)
10650 {
10651   /* 7.3.2.2 Supported Rates element (1) */
10652   if (tag_len < 1) {
10653     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10654                            "Tag length %u too short, must be greater than 0",
10655                            tag_len);
10656     return offset;
10657   }
10658
10659   offset += 2;
10660
10661   while (offset < tag_end) {
10662     proto_tree_add_item(tree, hf_ieee80211_tag_supp_rates, tvb, offset, 1,
10663                         ENC_BIG_ENDIAN);
10664     proto_item_append_text(ti, " %s,",
10665                            val_to_str_ext_const(tvb_get_guint8(tvb, offset),
10666                                                 &ieee80211_supported_rates_vals_ext,
10667                                                 "Unknown Rate"));
10668     offset += 1;
10669   }
10670
10671   proto_item_append_text(ti, " [Mbit/sec]");
10672
10673   return offset;
10674 }
10675
10676 static int
10677 ieee80211_tag_fh_parameter(packet_info *pinfo, proto_tree *tree,
10678                            proto_item *ti_len, guint32 tag_len,
10679                            tvbuff_t *tvb, int offset)
10680 {
10681   /* 7.3.2.3 FH Parameter Set element (2) */
10682   if (tag_len < 5) {
10683     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10684                            "Tag length %u too short, must be >= 5", tag_len);
10685     return offset;
10686   }
10687
10688   offset += 2;
10689
10690   proto_tree_add_item(tree, hf_ieee80211_tag_fh_dwell_time,
10691                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
10692   offset += 2;
10693
10694   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_set,
10695                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10696   offset += 1;
10697
10698   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_pattern,
10699                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10700   offset += 1;
10701
10702   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_index,
10703                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10704   offset += 1;
10705
10706   return offset;
10707 }
10708
10709 static int
10710 ieee80211_tag_ds_parameter(packet_info *pinfo, proto_tree *tree,
10711                            proto_item *ti, proto_item *ti_len,
10712                            guint32 tag_len, tvbuff_t *tvb,
10713                            int offset)
10714 {
10715   /* 7.3.2.4 DS Parameter Set element (3) */
10716   if (tag_len != 1) {
10717     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10718         "Tag length %u wrong, must be = 1", tag_len);
10719     return offset;
10720   }
10721
10722   offset += 2;
10723
10724   proto_tree_add_item(tree, hf_ieee80211_tag_ds_param_channel,
10725         tvb, offset, 1, ENC_BIG_ENDIAN);
10726
10727   proto_item_append_text(ti, ": Current Channel: %u",
10728                          tvb_get_guint8(tvb, offset));
10729
10730   wlan_stats.channel = tvb_get_guint8(tvb, offset);
10731   offset += 1;
10732
10733   return offset;
10734 }
10735
10736 static int
10737 ieee80211_tag_cf_parameter(packet_info *pinfo, proto_tree *tree,
10738                            proto_item *ti, proto_item *ti_len,
10739                            guint32 tag_len, tvbuff_t *tvb,
10740                            int offset)
10741 {
10742   /* 7.3.2.5 CF Parameter Set element (4) */
10743   if (tag_len != 6) {
10744     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10745                            "Tag length %u wrong, must be = 6", tag_len);
10746     return offset;
10747   }
10748
10749   offset += 2;
10750
10751   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_count,
10752                       tvb, offset, 1, ENC_BIG_ENDIAN);
10753   proto_item_append_text(ti, ": CFP count %u", tvb_get_guint8(tvb, offset));
10754   offset += 1;
10755
10756   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_period,
10757                       tvb, offset, 1, ENC_BIG_ENDIAN);
10758   proto_item_append_text(ti, ": CFP Period %u", tvb_get_guint8(tvb, offset));
10759   offset += 1;
10760
10761   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_max_duration,
10762                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
10763   proto_item_append_text(ti, ": CFP Max Duration %u",
10764                          tvb_get_letohs(tvb, offset));
10765   offset += 2;
10766
10767   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_dur_remaining,
10768                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
10769   proto_item_append_text(ti, ": CFP Dur Remaining %u",
10770                          tvb_get_letohs(tvb, offset));
10771   offset += 1;
10772
10773   return offset;
10774 }
10775
10776 static int
10777 ieee80211_tag_tim(packet_info *pinfo, proto_tree *tree,
10778                   proto_item *ti, proto_item *ti_len,
10779                   guint32 tag_len, tvbuff_t *tvb, int offset)
10780 {
10781   proto_tree *bmapctl_tree;
10782   proto_item *bmapctl_item;
10783
10784   /* 7.3.2.6 TIM (5) */
10785   if (tag_len < 4) {
10786     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10787                            "Tag length %u too short, must be >= 4", tag_len);
10788     return offset;
10789   }
10790
10791   offset += 2;
10792
10793   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_count,
10794                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10795   proto_item_append_text(ti, ": DTIM %u of", tvb_get_guint8(tvb, offset));
10796   offset += 1;
10797
10798   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_period,
10799                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10800   proto_item_append_text(ti, " %u bitmap", tvb_get_guint8(tvb, offset + 1));
10801   offset += 1;
10802
10803   bmapctl_item = proto_tree_add_item(tree, hf_ieee80211_tim_bmapctl,
10804                                      tvb, offset, 1, ENC_LITTLE_ENDIAN);
10805   bmapctl_tree = proto_item_add_subtree(bmapctl_item, ett_tag_bmapctl_tree);
10806   proto_tree_add_item(bmapctl_tree, hf_ieee80211_tim_bmapctl_mcast,
10807                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10808   proto_tree_add_item(bmapctl_tree, hf_ieee80211_tim_bmapctl_offset,
10809                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10810   offset += 1;
10811
10812   proto_tree_add_item(tree, hf_ieee80211_tim_partial_virtual_bitmap,
10813                       tvb, offset, tag_len - 3, ENC_NA);
10814   offset += tag_len - 3;
10815
10816   return offset;
10817 }
10818
10819 static int
10820 ieee80211_tag_ibss_parameter(packet_info *pinfo, proto_tree *tree,
10821                              proto_item *ti, proto_item *ti_len,
10822                              guint32 tag_len, tvbuff_t *tvb,
10823                              int offset)
10824 {
10825   /* 7.3.2.7 IBSS Parameter Set element (6) */
10826
10827   if (tag_len != 2) {
10828     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10829                            "Tag length %u wrong, must be = 2", tag_len);
10830     return offset;
10831   }
10832
10833   offset += 2;
10834
10835   proto_tree_add_item(tree, hf_ieee80211_tag_ibss_atim_window,
10836                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
10837   proto_item_append_text(ti, ": ATIM window 0x%x",
10838                          tvb_get_letohs(tvb, offset));
10839   offset += 2;
10840
10841   return offset;
10842 }
10843
10844 static const value_string environment_vals[] = {
10845   { 0x20, "Any" },
10846   { 0x4f, "Outdoor" },
10847   { 0x49, "Indoor" },
10848   { 0,    NULL }
10849 };
10850
10851 static int
10852 ieee80211_tag_country_info(packet_info *pinfo, proto_tree *tree,
10853                            proto_item *ti, proto_item *ti_len,
10854                            guint32 tag_len, tvbuff_t *tvb,
10855                            int offset, int tag_end)
10856 {
10857   /* 7.3.2.9 Country information element (7) */
10858   proto_tree *sub_tree;
10859   proto_item *sub_item;
10860
10861   if (tag_len < 6) {
10862     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10863                            "Tag length %u too short, must be >= 6", tag_len);
10864     return offset;
10865   }
10866
10867   offset += 2;
10868
10869   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_code,
10870                       tvb, offset, 2, ENC_ASCII|ENC_NA);
10871   proto_item_append_text(ti, ": Country Code %s",
10872                          tvb_get_ephemeral_string(tvb, offset, 2));
10873   offset += 2;
10874
10875   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_env,
10876                       tvb, offset, 1, ENC_BIG_ENDIAN);
10877   proto_item_append_text(ti, ", Environment %s",
10878                          val_to_str(tvb_get_guint8(tvb, offset),
10879                                     environment_vals,"Unknown (0x%02x)"));
10880   offset += 1;
10881
10882   while (offset < tag_end) {
10883     /* Padding ? */
10884     if ((tag_end - offset) < 3) {
10885       proto_tree_add_item(tree, hf_ieee80211_tag_country_info_pad,
10886                           tvb, offset, 1, ENC_NA);
10887       offset += 1;
10888       continue;
10889     }
10890     if (tvb_get_guint8(tvb, offset) <= 200) { /* 802.11d */
10891       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_fnm,
10892                                      tvb, offset, 3, ENC_NA);
10893       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_fnm_tree);
10894
10895       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_fcn,
10896                           tvb, offset, 1, ENC_BIG_ENDIAN);
10897       proto_item_append_text(sub_item, ": First Channel Number: %d",
10898                              tvb_get_guint8(tvb, offset));
10899       offset += 1;
10900       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_nc,
10901                           tvb, offset, 1, ENC_BIG_ENDIAN);
10902       proto_item_append_text(sub_item, ", Number of Channels: %d",
10903                              tvb_get_guint8(tvb, offset));
10904       offset += 1;
10905       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_mtpl,
10906                           tvb, offset, 1, ENC_BIG_ENDIAN);
10907       proto_item_append_text(sub_item,
10908                              ", Maximum Transmit Power Level: %d dBm",
10909                              tvb_get_guint8(tvb, offset));
10910       offset += 1;
10911     } else { /* 802.11j */
10912       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_rrc,
10913                                      tvb, offset, 3, ENC_NA);
10914       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_rcc_tree);
10915
10916       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_rei,
10917                           tvb, offset, 1, ENC_BIG_ENDIAN);
10918       proto_item_append_text(sub_item,
10919                              ": Regulatory Extension Identifier: %d",
10920                              tvb_get_guint8(tvb, offset));
10921       offset += 1;
10922       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_rc,
10923                           tvb, offset, 1, ENC_BIG_ENDIAN);
10924       proto_item_append_text(sub_item, ", Regulatory Class: %d",
10925                              tvb_get_guint8(tvb, offset));
10926       offset += 1;
10927       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_cc,
10928                           tvb, offset, 1, ENC_BIG_ENDIAN);
10929       proto_item_append_text(sub_item, ", Coverage Class: %d",
10930                              tvb_get_guint8(tvb, offset));
10931       offset += 1;
10932     }
10933   }
10934
10935   return offset;
10936 }
10937
10938 static int
10939 ieee80211_tag_fh_hopping_parameter(packet_info *pinfo,
10940                                    proto_tree *tree,
10941                                    proto_item *ti,
10942                                    proto_item *ti_len,
10943                                    guint32 tag_len, tvbuff_t *tvb,
10944                                    int offset)
10945 {
10946   /* 7.3.2.10 Hopping Pattern Parameters information element (8) */
10947   if (tag_len < 2) {
10948     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10949                            "Tag length %u too short, must be >= 2", tag_len);
10950     return offset;
10951   }
10952
10953   offset += 2;
10954
10955   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
10956                       tvb, offset, 1, ENC_BIG_ENDIAN);
10957   proto_item_append_text(ti, ": Prime Radix: %u", tvb_get_guint8(tvb, offset));
10958   offset += 1;
10959
10960   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
10961                       tvb, offset, 1, ENC_BIG_ENDIAN);
10962   proto_item_append_text(ti, ", Number of Channels: %u",
10963                          tvb_get_guint8(tvb, offset));
10964   offset += 1;
10965
10966   return offset;
10967 }
10968
10969 static int
10970 ieee80211_tag_fh_hopping_table(packet_info *pinfo, proto_tree *tree,
10971                                proto_item *ti_len,
10972                                guint32 tag_len, tvbuff_t *tvb,
10973                                int offset, int tag_end)
10974 {
10975   /* 7.3.2.11 Hopping Pattern Table information element (9) */
10976   if (tag_len < 4) {
10977     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10978                            "Tag length %u too short, must be >= 4", tag_len);
10979     return offset;
10980   }
10981
10982   offset += 2;
10983
10984   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_flag,
10985                       tvb, offset, 1, ENC_BIG_ENDIAN);
10986   offset += 1;
10987
10988   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_number_of_sets,
10989                       tvb, offset, 1, ENC_BIG_ENDIAN);
10990   offset += 1;
10991
10992   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_modulus,
10993                       tvb, offset, 1, ENC_BIG_ENDIAN);
10994   offset += 1;
10995
10996   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_offset,
10997                       tvb, offset, 1, ENC_BIG_ENDIAN);
10998   offset += 1;
10999
11000   while (offset < tag_end) {
11001     proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_random_table,
11002                         tvb, offset, 2, ENC_BIG_ENDIAN);
11003     offset += 2;
11004   }
11005
11006   return offset;
11007 }
11008
11009 static int
11010 add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype)
11011 {
11012   guint32       oui;
11013   tvbuff_t     *tag_tvb;
11014   const guint8 *tag_data_ptr;
11015   guint32       tag_no, tag_len;
11016   int           n, ret;
11017   char          print_buff[SHORT_STR];
11018   proto_tree   *orig_tree = tree;
11019   proto_item   *ti        = NULL;
11020   proto_item   *ti_len, *ti_tag;
11021   int           tag_end;
11022
11023   tag_no  = tvb_get_guint8(tvb, offset);
11024   tag_len = tvb_get_guint8(tvb, offset + 1);
11025   tag_end = offset + 2 + tag_len;
11026
11027   if (tree) {
11028     ti = proto_tree_add_item(orig_tree, hf_ieee80211_tag, tvb, offset, 2 + tag_len , ENC_NA);
11029     proto_item_append_text(ti, ": %s", val_to_str_ext(tag_no, &tag_num_vals_ext, "Reserved (%d)"));
11030
11031     tree = proto_item_add_subtree(ti, ett_80211_mgt_ie);
11032
11033   }
11034
11035   ti_tag = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_BIG_ENDIAN);
11036
11037   ti_len = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
11038
11039   switch (tag_no) {
11040   case TAG_SSID:
11041     offset += ieee80211_tag_ssid(pinfo, tree, ti, ti_len, tag_len, tvb,
11042                                  offset);
11043     break;
11044   case TAG_SUPP_RATES:
11045     offset += ieee80211_tag_supp_rates(pinfo, tree, ti, ti_len, tag_len, tvb,
11046                                        offset, tag_end);
11047     break;
11048   case TAG_FH_PARAMETER:
11049     offset += ieee80211_tag_fh_parameter(pinfo, tree, ti_len, tag_len, tvb,
11050                                          offset);
11051     break;
11052   case TAG_DS_PARAMETER:
11053     offset += ieee80211_tag_ds_parameter(pinfo, tree, ti, ti_len, tag_len, tvb,
11054                                          offset);
11055     break;
11056   case TAG_CF_PARAMETER:
11057     offset += ieee80211_tag_cf_parameter(pinfo, tree, ti, ti_len, tag_len, tvb,
11058                                          offset);
11059     break;
11060   case TAG_TIM:
11061     offset += ieee80211_tag_tim(pinfo, tree, ti, ti_len, tag_len, tvb, offset);
11062     break;
11063   case TAG_IBSS_PARAMETER:
11064     offset += ieee80211_tag_ibss_parameter(pinfo, tree, ti, ti_len, tag_len,
11065                                            tvb, offset);
11066     break;
11067   case TAG_COUNTRY_INFO:
11068     offset += ieee80211_tag_country_info(pinfo, tree, ti, ti_len, tag_len, tvb,
11069                                          offset, tag_end);
11070     break;
11071   case TAG_FH_HOPPING_PARAMETER:
11072     offset += ieee80211_tag_fh_hopping_parameter(pinfo, tree, ti, ti_len,
11073                                                  tag_len, tvb, offset);
11074     break;
11075   case TAG_FH_HOPPING_TABLE:
11076     offset += ieee80211_tag_fh_hopping_table(pinfo, tree, ti_len, tag_len,
11077                                              tvb, offset, tag_end);
11078     break;
11079
11080     case TAG_REQUEST: /* 7.3.2.12 Request information element (10) */
11081       while (offset < tag_end)
11082       {
11083         proto_tree_add_item(tree, hf_ieee80211_tag_request, tvb, offset, 1, ENC_BIG_ENDIAN);
11084         offset += 1;
11085       }
11086       break;
11087
11088     case TAG_QBSS_LOAD: /* 7.3.2.28 BSS Load element (11) */
11089       if ((tag_len < 4) || (tag_len > 5))
11090       {
11091         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 4 or 5", tag_len);
11092         break;
11093       }
11094
11095       if (tag_len == 4)
11096       {
11097         /* QBSS Version 1 */
11098         proto_item_append_text(ti, " Cisco QBSS Version 1 - non CCA");
11099
11100         /* Extract Values */
11101         proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 1);
11102         proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN);
11103         proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
11104         proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 1, ENC_BIG_ENDIAN);
11105       }
11106       else if (tag_len == 5)
11107       {
11108          /* QBSS Version 2 */
11109          proto_item_append_text(ti, " 802.11e CCA Version");
11110
11111          /* Extract Values */
11112          proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 2);
11113          proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN);
11114          proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
11115          proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 2, ENC_LITTLE_ENDIAN);
11116       }
11117       break;
11118
11119     case TAG_TSPEC: /* 7.3.2.30 TSPEC element (13) */
11120       if (tag_len != 55)
11121       {
11122         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 55", tag_len);
11123         break;
11124       }
11125       offset += 2;
11126
11127       add_fixed_field(tree, tvb, pinfo, offset, FIELD_QOS_TS_INFO);
11128       offset += 3;
11129
11130       proto_tree_add_item(tree, hf_ieee80211_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11131       offset += 2;
11132
11133       proto_tree_add_item(tree, hf_ieee80211_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11134       offset += 2;
11135
11136       proto_tree_add_item(tree, hf_ieee80211_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11137       offset += 4;
11138
11139       proto_tree_add_item(tree, hf_ieee80211_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11140       offset += 4;
11141
11142       proto_tree_add_item(tree, hf_ieee80211_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11143       offset += 4;
11144
11145       proto_tree_add_item(tree, hf_ieee80211_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11146       offset += 4;
11147
11148       proto_tree_add_item(tree, hf_ieee80211_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11149       offset += 4;
11150
11151       proto_tree_add_item(tree, hf_ieee80211_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11152       offset += 4;
11153
11154       proto_tree_add_item(tree, hf_ieee80211_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11155       offset += 4;
11156
11157       proto_tree_add_item(tree, hf_ieee80211_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11158       offset += 4;
11159
11160       proto_tree_add_item(tree, hf_ieee80211_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11161       offset += 4;
11162
11163       proto_tree_add_item(tree, hf_ieee80211_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11164       offset += 4;
11165
11166       proto_tree_add_item(tree, hf_ieee80211_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11167       offset += 4;
11168
11169       proto_tree_add_item(tree, hf_ieee80211_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11170       offset += 2;
11171
11172       proto_tree_add_item(tree, hf_ieee80211_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11173       offset += 2;
11174
11175       break;
11176
11177     case TAG_TCLAS: /* 7.3.2.31 TCLAS element (14) */
11178       if (tag_len < 6)
11179       {
11180         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be >= 6", tag_len);
11181         break;
11182       }
11183       {
11184       guint8 type;
11185       guint8 version;
11186       proto_item *class_mask;
11187       proto_tree *mask_tree;
11188
11189       offset += 2;
11190       proto_tree_add_item(tree, hf_ieee80211_tclas_up, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11191       offset += 1;
11192
11193       type = tvb_get_guint8(tvb, offset);
11194       proto_tree_add_item(tree, hf_ieee80211_tclas_class_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11195       offset += 1;
11196
11197       class_mask = proto_tree_add_item(tree, hf_ieee80211_tclas_class_mask,
11198                                        tvb, offset, 1, ENC_LITTLE_ENDIAN);
11199       offset += 1;
11200
11201       switch (type)
11202         {
11203           case 0:
11204             offset--;
11205             mask_tree = proto_item_add_subtree(class_mask,
11206                                                ett_tag_tclas_mask_tree);
11207             proto_tree_add_item(mask_tree,
11208                                 hf_ieee80211_tclas_class_mask0_src_addr,
11209                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11210             proto_tree_add_item(mask_tree,
11211                                 hf_ieee80211_tclas_class_mask0_dst_addr,
11212                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11213             proto_tree_add_item(mask_tree,
11214                                 hf_ieee80211_tclas_class_mask0_type,
11215                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11216             offset++;
11217
11218             proto_tree_add_item(tree, hf_ieee80211_tclas_src_mac_addr, tvb, offset, 6, ENC_NA);
11219             offset += 6;
11220
11221             proto_tree_add_item(tree, hf_ieee80211_tclas_dst_mac_addr, tvb, offset, 6, ENC_NA);
11222             offset += 6;
11223
11224             proto_tree_add_item(tree, hf_ieee80211_tclas_ether_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11225             offset += 2;
11226             break;
11227
11228           case 1:
11229             version = tvb_get_guint8(tvb, offset);
11230             offset--;
11231
11232             mask_tree = proto_item_add_subtree(class_mask,
11233                                                ett_tag_tclas_mask_tree);
11234             proto_tree_add_item(mask_tree,
11235                                 hf_ieee80211_tclas_class_mask1_ver,
11236                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11237             proto_tree_add_item(mask_tree,
11238                                 hf_ieee80211_tclas_class_mask1_src_ip,
11239                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11240             proto_tree_add_item(mask_tree,
11241                                 hf_ieee80211_tclas_class_mask1_dst_ip,
11242                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11243             proto_tree_add_item(mask_tree,
11244                                 hf_ieee80211_tclas_class_mask1_src_port,
11245                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11246             proto_tree_add_item(mask_tree,
11247                                 hf_ieee80211_tclas_class_mask1_dst_port,
11248                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11249             if (version == 4) {
11250               proto_tree_add_item(mask_tree,
11251                                   hf_ieee80211_tclas_class_mask1_ipv4_dscp,
11252                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
11253               proto_tree_add_item(mask_tree,
11254                                   hf_ieee80211_tclas_class_mask1_ipv4_proto,
11255                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
11256             } else {
11257               proto_tree_add_item(mask_tree,
11258                                   hf_ieee80211_tclas_class_mask1_ipv6_flow,
11259                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
11260             }
11261             offset += 1;
11262
11263             proto_tree_add_item(tree, hf_ieee80211_tclas_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11264             offset += 1;
11265             if (version == 4)
11266             {
11267               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
11268               offset += 4;
11269               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
11270               offset += 4;
11271               proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
11272               offset += 2;
11273               proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
11274               offset += 2;
11275               proto_tree_add_item(tree, hf_ieee80211_tclas_dscp, tvb, offset, 1, ENC_BIG_ENDIAN);
11276               offset += 1;
11277               proto_tree_add_item(tree, hf_ieee80211_tclas_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
11278               offset += 1;
11279             }
11280             else if (version == 6)
11281             {
11282               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_src, tvb, offset, 16, ENC_NA);
11283               offset += 16;
11284               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_dst, tvb, offset, 16, ENC_NA);
11285               offset += 16;
11286               proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
11287               offset += 2;
11288               proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
11289               offset += 2;
11290               proto_tree_add_item(tree, hf_ieee80211_tclas_flow, tvb, offset, 3, ENC_BIG_ENDIAN);
11291               offset += 3;
11292             }
11293             break;
11294
11295           case 2:
11296             offset--;
11297             mask_tree = proto_item_add_subtree(class_mask,
11298                                                ett_tag_tclas_mask_tree);
11299             proto_tree_add_item(mask_tree,
11300                                 hf_ieee80211_tclas_class_mask2_tci,
11301                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11302             offset++;
11303
11304             proto_tree_add_item(tree, hf_ieee80211_tclas_tag_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11305             offset += 2;
11306             break;
11307
11308           default:
11309             break;
11310         }
11311       }
11312       break;
11313
11314     case TAG_SCHEDULE: /* 7.3.2.34 Schedule element (15) */
11315       if (tag_len != 14)
11316       {
11317         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 14", tag_len);
11318         break;
11319       }
11320       offset += 2;
11321
11322       add_fixed_field(tree, tvb, pinfo, offset, FIELD_SCHEDULE_INFO);
11323       offset += 2;
11324
11325       proto_tree_add_item(tree, hf_ieee80211_sched_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11326       offset += 4;
11327
11328       proto_tree_add_item(tree, hf_ieee80211_sched_srv_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11329       offset += 4;
11330
11331       proto_tree_add_item(tree, hf_ieee80211_sched_spec_int, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11332       offset += 2;
11333       break;
11334
11335     case TAG_CHALLENGE_TEXT: /* 7.3.2.8 Challenge Text element (16) */
11336       offset += 2;
11337       proto_tree_add_item(tree, hf_ieee80211_tag_challenge_text, tvb, offset, tag_len, ENC_NA);
11338       break;
11339
11340     case TAG_POWER_CONSTRAINT: /* 7.3.2.15 Power Constraint element (32) */
11341     {
11342       if (tag_len != 1)
11343       {
11344         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 1", tag_len);
11345         break;
11346       }
11347       offset += 2;
11348
11349       proto_tree_add_item(tree, hf_ieee80211_tag_power_constraint_local, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11350       proto_item_append_text(ti, ": %d", tvb_get_guint8(tvb, offset));
11351       offset += 1;
11352
11353       break;
11354     }
11355
11356     case TAG_POWER_CAPABILITY: /* 7.3.2.16 Power Capability element (33) */
11357     {
11358       if (tag_len != 2)
11359       {
11360         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 2", tag_len);
11361         break;
11362       }
11363       offset += 2;
11364
11365       proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_min, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11366       proto_item_append_text(ti, " Min: %d", tvb_get_guint8(tvb, offset));
11367       offset += 1;
11368
11369       proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_max, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11370       proto_item_append_text(ti, ", Max :%d", tvb_get_guint8(tvb, offset));
11371       offset += 1;
11372       break;
11373     }
11374
11375     case TAG_TPC_REQUEST: /* 7.3.2.18 TPC Request element (34) */
11376     {
11377       if (tag_len != 0)
11378       {
11379         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 0", tag_len);
11380         break;
11381       }
11382       offset += 2;
11383
11384       /* No Data */
11385       break;
11386     }
11387
11388     case TAG_TPC_REPORT: /* 7.3.2.18 TPC Report element (35) */
11389     {
11390       if (tag_len != 2)
11391       {
11392         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 2", tag_len);
11393         break;
11394       }
11395       offset += 2;
11396
11397       proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_trsmt_pow, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11398       proto_item_append_text(ti, " Transmit Power: %d", tvb_get_guint8(tvb, offset));
11399       offset += 1;
11400
11401       proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_link_mrg, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11402       proto_item_append_text(ti, ", Link Margin: %d", tvb_get_guint8(tvb, offset));
11403       offset += 1;
11404
11405       break;
11406     }
11407
11408     case TAG_SUPPORTED_CHANNELS: /* 7.3.2.19 Supported Channels element (36) */
11409       {
11410         proto_item *chan_item;
11411         proto_tree *chan_tree;
11412         guint       i = 1;
11413
11414         offset += 2;
11415         if (tag_len % 2 == 1) {
11416            expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u must be even",tag_len);
11417            break;
11418         }
11419         while (offset < tag_end)
11420         {
11421           chan_item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_channels, tvb, offset, 2, ENC_NA);
11422           proto_item_append_text(chan_item, " #%d", i);
11423           i += 1;
11424
11425           chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
11426
11427           proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_first, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11428           proto_item_append_text(chan_item, " First: %d", tvb_get_guint8(tvb, offset));
11429           offset += 1;
11430
11431           proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_range, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11432           proto_item_append_text(chan_item, ", Range: %d ", tvb_get_guint8(tvb, offset));
11433           offset += 1;
11434
11435         }
11436         break;
11437       }
11438     case TAG_CHANNEL_SWITCH_ANN: /* 7.3.2.20 Channel Switch Announcement element (37) */
11439     {
11440       if (tag_len != 3)
11441       {
11442         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 3", tag_len);
11443         break;
11444       }
11445       offset += 2;
11446
11447       proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11448       proto_item_append_text(ti, " Mode: %d", tvb_get_guint8(tvb, offset));
11449       offset += 1;
11450
11451       proto_tree_add_item(tree, hf_ieee80211_csa_new_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11452       proto_item_append_text(ti, ", Number: %d ", tvb_get_guint8(tvb, offset));
11453       offset += 1;
11454
11455       proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11456       proto_item_append_text(ti, ", Count: %d ", tvb_get_guint8(tvb, offset));
11457       offset += 1;
11458
11459       break;
11460     }
11461
11462     case TAG_MEASURE_REQ: /* 7.3.2.21 Measurement Request element (38) with update from 802.11k-2008 */
11463       if (tag_len < 3)
11464       {
11465         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be >= 3", tag_len);
11466         break;
11467       }
11468       {
11469         guint8 request_type;
11470         proto_item *parent_item;
11471         proto_tree *sub_tree;
11472
11473         offset += 2;
11474
11475         proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_token, tvb, offset, 1, ENC_NA);
11476         offset += 1;
11477
11478         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_mode, tvb, offset, 1, ENC_NA);
11479         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_mode_tree);
11480         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_parallel, tvb, offset, 1, ENC_NA);
11481         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_enable, tvb, offset, 1, ENC_NA);
11482         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_request, tvb, offset, 1, ENC_NA);
11483         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_report, tvb, offset, 1, ENC_NA);
11484         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_duration_mandatory, tvb, offset, 1, ENC_NA);
11485         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_reserved, tvb, offset, 1, ENC_NA);
11486         offset += 1;
11487
11488
11489         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_type, tvb, offset, 1, ENC_NA);
11490         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_type_tree);
11491         request_type = tvb_get_guint8 (tvb, offset);
11492         offset += 1;
11493
11494         switch (request_type) {
11495           case 0: /* Basic Request */
11496           case 1: /* Clear channel assessment (CCA) request */
11497           case 2: /* Receive power indication (RPI) histogram request */
11498           {
11499
11500             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
11501             offset += 1;
11502
11503             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11504             offset += 8;
11505
11506             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11507             offset += 2;
11508             break;
11509           }
11510           case 3: /* Channel Load Request */
11511           case 4: /* Noise Histogram Request */
11512           {
11513             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_regulatory_class, tvb, offset, 1, ENC_NA);
11514             offset += 1;
11515
11516             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
11517             offset += 1;
11518
11519             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11520             offset += 2;
11521
11522             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11523             offset += 2;
11524             /* TODO Add Optional Subelements */
11525             break;
11526           }
11527           case 5: /* Beacon Request */
11528           {
11529             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_regulatory_class, tvb, offset, 1, ENC_NA);
11530             offset += 1;
11531
11532             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
11533             offset += 1;
11534
11535             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11536             offset += 2;
11537
11538             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11539             offset += 2;
11540
11541             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_measurement_mode, tvb, offset, 1, ENC_NA);
11542             offset += 1;
11543
11544             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_bssid, tvb, offset, 6, ENC_NA);
11545             offset += 6;
11546
11547             while (offset < tag_end)
11548             {
11549               guint8 sub_id, sub_length, sub_tag_end;
11550               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_id, tvb, offset, 1, ENC_NA);
11551               sub_id = tvb_get_guint8(tvb, offset);
11552               offset += 1;
11553
11554               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
11555               sub_length = tvb_get_guint8(tvb, offset);
11556               offset += 1;
11557               sub_tag_end = offset + sub_length;
11558
11559               switch (sub_id) {
11560                 case MEASURE_REQ_BEACON_SUB_SSID: /* SSID (0) */
11561                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_ssid, tvb, offset, sub_length, ENC_ASCII|ENC_NA);
11562                   offset += sub_length;
11563                   break;
11564                 case MEASURE_REQ_BEACON_SUB_BRI: /* Beacon Reporting Information (1) */
11565                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition, tvb, offset, 1, ENC_BIG_ENDIAN);
11566                   offset += 1;
11567                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
11568                   offset += 1;
11569                   break;
11570                 case MEASURE_REQ_BEACON_SUB_RD: /* Reporting Detail (2) */
11571                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail, tvb, offset, 1, ENC_BIG_ENDIAN);
11572                   offset += 1;
11573                   break;
11574                 case MEASURE_REQ_BEACON_SUB_REQUEST: /* Request (10) */
11575                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_request, tvb, offset, 1, ENC_BIG_ENDIAN);
11576                   offset += 1;
11577                   break;
11578                 case MEASURE_REQ_BEACON_SUB_APCP: /* Request (51) */
11579                   /* TODO */
11580                   break;
11581                 default:
11582                   /* no default action */
11583                   break;
11584              }
11585              if (offset < sub_tag_end)
11586              {
11587                proto_item *tix;
11588                tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_unknown, tvb, offset, sub_tag_end - offset, ENC_NA);
11589                expert_add_info_format(pinfo, tix, PI_UNDECODED, PI_WARN, " Unknown Data (not interpreted)");
11590                offset = sub_tag_end;
11591              }
11592             }
11593
11594             break;
11595           }
11596           case 6: /* Frame Request */
11597           {
11598             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_regulatory_class, tvb, offset, 1, ENC_NA);
11599             offset += 1;
11600
11601             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
11602             offset += 1;
11603
11604             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11605             offset += 2;
11606
11607             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11608             offset += 2;
11609
11610             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_frame_request_type, tvb, offset, 1, ENC_NA);
11611             offset += 1;
11612
11613             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mac_address, tvb, offset, 6, ENC_NA);
11614             offset += 6;
11615
11616             /* TODO Add Optional Subelements */
11617             break;
11618           }
11619           case 7: /* BSTA Statistics Request */
11620           {
11621             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_peer_mac_address, tvb, offset, 6, ENC_NA);
11622             offset += 6;
11623
11624             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11625             offset += 2;
11626
11627             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11628             offset += 2;
11629
11630             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_group_id, tvb, offset, 1, ENC_NA);
11631             offset += 1;
11632
11633             /* TODO Add Optional Subelements */
11634             break;
11635           }
11636           case 8: /* Location Configuration Indication (LCI) Request */
11637             /* TODO */
11638           case 9: /* Transmit Stream Measurement Request */
11639             /* TODO */
11640           case 255: /* Measurement Pause Request*/
11641             /* TODO */
11642           default: /* unknown */
11643             break;
11644         }
11645       }
11646
11647       break;
11648     case TAG_MEASURE_REP: /* 7.3.2.22 Measurement Report element (39) with update from 802.11k-2008 */
11649       if (tag_len < 3)
11650       {
11651         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be >= 3", tag_len);
11652         break;
11653       }
11654       {
11655         proto_item *parent_item;
11656         proto_tree *sub_tree;
11657         guint8 report_type;
11658
11659         offset += 2;
11660         proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_measurement_token, tvb, offset, 1, ENC_NA);
11661         offset += 1;
11662
11663         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_mode, tvb, offset, 1, ENC_NA);
11664         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_mode_tree);
11665         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_late, tvb, offset, 1, ENC_NA);
11666         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_incapable, tvb, offset, 1, ENC_NA);
11667         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_refused, tvb, offset, 1, ENC_NA);
11668         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_reserved, tvb, offset, 1, ENC_NA);
11669         offset += 1;
11670
11671         report_type = tvb_get_guint8(tvb, offset);
11672         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11673         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_type_tree);
11674         offset += 1;
11675
11676         if (tag_len == 3)
11677             break;
11678         switch (report_type) {
11679           case 0: /* Basic Report */
11680           {
11681             proto_tree *sub_tree_map_field;
11682
11683             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11684             offset += 1;
11685
11686             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11687             offset += 8;
11688
11689             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11690             offset += 2;
11691
11692
11693             parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_basic_map_field, tvb, offset, 1, ENC_NA);
11694             sub_tree_map_field = proto_item_add_subtree(parent_item, ett_tag_measure_report_basic_map_tree);
11695             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_bss, tvb, offset, 1, ENC_NA);
11696             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_odfm, tvb, offset, 1, ENC_NA);
11697             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_unident_signal, tvb, offset, 1, ENC_NA);
11698             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_radar, tvb, offset, 1, ENC_NA);
11699             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_unmeasured, tvb, offset, 1, ENC_NA);
11700             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_reserved, tvb, offset, 1, ENC_NA);
11701             break;
11702           }
11703           case 1: /* Clear channel assessment (CCA) report */
11704             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11705             offset += 1;
11706
11707             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11708             offset += 8;
11709
11710             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11711             offset += 2;
11712
11713             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_cca_busy_fraction, tvb, offset, 1, ENC_NA);
11714             offset += 1;
11715             break;
11716           case 2: /* Receive power indication (RPI) histogram report */
11717             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11718             offset += 1;
11719
11720             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11721             offset += 8;
11722
11723             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11724             offset += 2;
11725
11726             parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report, tvb, offset, 8, ENC_NA);
11727             sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_rpi_tree);
11728
11729             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_0, tvb, offset, 1, ENC_NA);
11730             offset += 1;
11731
11732             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_1, tvb, offset, 1, ENC_NA);
11733             offset += 1;
11734
11735             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_2, tvb, offset, 1, ENC_NA);
11736             offset += 1;
11737
11738             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_3, tvb, offset, 1, ENC_NA);
11739             offset += 1;
11740
11741             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_4, tvb, offset, 1, ENC_NA);
11742             offset += 1;
11743
11744             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_5, tvb, offset, 1, ENC_NA);
11745             offset += 1;
11746
11747             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_6, tvb, offset, 1, ENC_NA);
11748             offset += 1;
11749
11750             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_7, tvb, offset, 1, ENC_NA);
11751             offset += 1;
11752             break;
11753           case 3: /* Channel Load Report */
11754           {
11755             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_regulatory_class, tvb, offset, 1, ENC_NA);
11756             offset += 1;
11757
11758             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11759             offset += 1;
11760
11761             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11762             offset += 8;
11763
11764             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11765             offset += 2;
11766
11767             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_load, tvb, offset, 1, ENC_NA);
11768             offset += 1;
11769
11770             /* TODO Add Optional Subelements */
11771             break;
11772           }
11773           case 4: /* Noise Histogram Report */
11774             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_regulatory_class, tvb, offset, 1, ENC_NA);
11775             offset += 1;
11776
11777             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11778             offset += 1;
11779
11780             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11781             offset += 8;
11782
11783             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11784             offset += 2;
11785
11786             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
11787             offset += 1;
11788
11789             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_anpi, tvb, offset, 1, ENC_NA);
11790             offset += 1;
11791
11792             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_0, tvb, offset, 1, ENC_NA);
11793             offset += 1;
11794
11795             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_1, tvb, offset, 1, ENC_NA);
11796             offset += 1;
11797
11798             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_2, tvb, offset, 1, ENC_NA);
11799             offset += 1;
11800
11801             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_3, tvb, offset, 1, ENC_NA);
11802             offset += 1;
11803
11804             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_4, tvb, offset, 1, ENC_NA);
11805             offset += 1;
11806
11807             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_5, tvb, offset, 1, ENC_NA);
11808             offset += 1;
11809
11810             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_6, tvb, offset, 1, ENC_NA);
11811             offset += 1;
11812
11813             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_7, tvb, offset, 1, ENC_NA);
11814             offset += 1;
11815
11816             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_8, tvb, offset, 1, ENC_NA);
11817             offset += 1;
11818
11819             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_9, tvb, offset, 1, ENC_NA);
11820             offset += 1;
11821
11822             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_10, tvb, offset, 1, ENC_NA);
11823             offset += 1;
11824
11825             /* TODO Add Optional Subelements */
11826             break;
11827           case 5: /* Beacon Report */
11828           {
11829             proto_tree *sub_tree_frame_info;
11830
11831             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_regulatory_class, tvb, offset, 1, ENC_NA);
11832             offset += 1;
11833
11834             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11835             offset += 1;
11836
11837             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11838             offset += 8;
11839
11840             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11841             offset += 2;
11842
11843             parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_frame_info, tvb, offset, 1, ENC_NA);
11844             sub_tree_frame_info = proto_item_add_subtree(parent_item, ett_tag_measure_report_frame_tree);
11845             proto_tree_add_item(sub_tree_frame_info, hf_ieee80211_tag_measure_report_frame_info_phy_type, tvb, offset, 1, ENC_NA);
11846             proto_tree_add_item(sub_tree_frame_info, hf_ieee80211_tag_measure_report_frame_info_frame_type, tvb, offset, 1, ENC_NA);
11847             offset += 1;
11848
11849             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rcpi, tvb, offset, 1, ENC_NA);
11850             offset += 1;
11851
11852             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rsni, tvb, offset, 1, ENC_NA);
11853             offset += 1;
11854
11855             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_bssid, tvb, offset, 6, ENC_NA);
11856             offset += 6;
11857
11858             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
11859             offset += 1;
11860
11861             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_parent_tsf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11862             offset += 4;
11863             /* TODO Add Optional Subelements */
11864             break;
11865           }
11866           case 6: /* Frame Report */
11867             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_regulatory_class, tvb, offset, 1, ENC_NA);
11868             offset += 1;
11869
11870             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11871             offset += 1;
11872
11873             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11874             offset += 8;
11875
11876             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11877             offset += 2;
11878
11879             /* TODO Add Optional Subelements */
11880             break;
11881           case 7: /* BSTA Statistics Report */
11882             /* TODO */
11883           case 8: /* Location Configuration Information Report element */
11884             /* TODO */
11885           case 9: /* Transmit Stream Measurement Report */
11886             /* TODO */
11887           default: /* unknown */
11888             break;
11889         }
11890       }
11891
11892     case TAG_QUIET: /* 7.3.2.23 Quiet element (40) */
11893       if (tag_len != 6)
11894       {
11895         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 6", tag_len);
11896         break;
11897       }
11898       offset += 2;
11899
11900       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_count, tvb, offset, 1, ENC_NA);
11901       proto_item_append_text(ti, " Count: %d", tvb_get_guint8(tvb, offset));
11902       offset += 1;
11903
11904       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_period, tvb, offset, 1, ENC_NA);
11905       proto_item_append_text(ti, " Period: %d", tvb_get_guint8(tvb, offset));
11906       offset += 1;
11907
11908       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11909       proto_item_append_text(ti, " Duration: %d", tvb_get_letohs(tvb, offset));
11910       offset += 2;
11911
11912       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11913       proto_item_append_text(ti, " Offset: %d", tvb_get_letohs(tvb, offset));
11914       offset += 2;
11915       break;
11916
11917
11918     case TAG_IBSS_DFS: /* 7.3.2.24 IBSS DFS element (41) */
11919       if (tag_len < 7)
11920       {
11921         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be >= 7", tag_len);
11922         break;
11923       }
11924       {
11925         proto_item *ti_sup_map;
11926         proto_tree *sub_map_tree;
11927         offset += 2;
11928
11929         proto_tree_add_item(tree, hf_ieee80211_tag_dfs_owner, tvb, offset, 6, ENC_NA);
11930         proto_item_append_text(ti, " Owner: %s", tvb_ether_to_str(tvb, offset));
11931         offset += 6;
11932
11933         proto_tree_add_item(tree, hf_ieee80211_tag_dfs_recovery_interval, tvb, offset, 1, ENC_NA);
11934         offset += 1;
11935
11936         while (offset < tag_end)
11937         {
11938           ti_sup_map = proto_tree_add_item(tree, hf_ieee80211_tag_dfs_channel_map, tvb, offset, 2, ENC_NA);
11939           sub_map_tree = proto_item_add_subtree(ti_sup_map, ett_tag_dfs_map_tree);
11940           proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_channel_number, tvb, offset, 1, ENC_NA);
11941           proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_map, tvb, offset, 1, ENC_NA);
11942           offset += 2;
11943         }
11944         break;
11945       }
11946     case TAG_ERP_INFO: /* 7.3.2.13 ERP Information element (42) */
11947     case TAG_ERP_INFO_OLD:
11948       if (tag_len != 1)
11949       {
11950         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 1", tag_len);
11951         break;
11952       }
11953       {
11954         proto_item *ti_erp;
11955         proto_tree *erp_tree;
11956
11957         offset += 2;
11958
11959         ti_erp = proto_tree_add_item(tree, hf_ieee80211_tag_erp_info, tvb, offset, 1, ENC_NA);
11960         erp_tree = proto_item_add_subtree(ti_erp, ett_tag_erp_info_tree);
11961         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_erp_present, tvb, offset, 1, ENC_NA);
11962         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_use_protection, tvb, offset, 1, ENC_NA);
11963         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_barker_preamble_mode, tvb, offset, 1, ENC_NA);
11964         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_reserved, tvb, offset, 1, ENC_NA);
11965         offset += 1;
11966         break;
11967       }
11968
11969     case TAG_TS_DELAY: /* 7.3.2.32 TS Delay element (43) */
11970       if (tag_len != 4)
11971       {
11972         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 4", tag_len);
11973         break;
11974       }
11975       offset += 2;
11976
11977       proto_tree_add_item(tree, hf_ieee80211_ts_delay, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11978       proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, offset));
11979       offset += 4;
11980       break;
11981
11982     case TAG_TCLAS_PROCESS: /* 7.3.2.33 TCLAS Processing element (44) */
11983       if (tag_len != 1)
11984       {
11985         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 1", tag_len);
11986         break;
11987       }
11988       offset += 2;
11989
11990       proto_tree_add_item(tree, hf_ieee80211_tclas_process, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11991       proto_item_append_text(ti, " : %s", val_to_str(tvb_get_guint8(tvb, offset), ieee80211_tclas_process_flag, "Unknown %d"));
11992       offset += 1;
11993       break;
11994
11995     case TAG_QOS_CAPABILITY: /* 7.3.2.35 QoS Capability element (46) */
11996       if (tag_len != 1)
11997       {
11998         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 1", tag_len);
11999         break;
12000       }
12001       {
12002         /* proto_item *ti_cap;
12003         proto_tree *cap_tree; */
12004         offset += 2;
12005         offset = dissect_qos_capability(tree, tvb, pinfo, offset, ftype);
12006       }
12007       break;
12008
12009     case TAG_RSN_IE: /* 7.3.2.25 RSN information element (48) */
12010       if (tag_len < 18)
12011       {
12012         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be >= 18", tag_len);
12013         break;
12014       }
12015       offset += 2;
12016
12017       offset = dissect_rsn_ie(pinfo, tree, tvb, offset, tag_len);
12018       break;
12019
12020     case TAG_EXT_SUPP_RATES: /* 7.3.2.14 Extended Supported Rates element (50) */
12021       if (tag_len < 1)
12022       {
12023         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be greater than 0", tag_len);
12024         break;
12025       }
12026       offset += 2;
12027
12028       while (offset < tag_end)
12029       {
12030         proto_tree_add_item(tree, hf_ieee80211_tag_ext_supp_rates, tvb, offset, 1, ENC_NA);
12031         proto_item_append_text(ti, " %s,", val_to_str_ext_const(tvb_get_guint8(tvb, offset), &ieee80211_supported_rates_vals_ext, "Unknown Rate"));
12032         offset += 1;
12033       }
12034       proto_item_append_text(ti, " [Mbit/sec]");
12035       break;
12036
12037     case TAG_EXTENDED_CAPABILITIES: /* 7.3.2.27 Extended Capabilities information element (127) */
12038       dissect_extended_capabilities_ie(pinfo, tree, ti, ti_len, tag_len, tvb, offset+2, tag_end);
12039       break;
12040
12041     case TAG_CISCO_CCX1_CKIP: /* Cisco CCX1 CKIP + Device Name (133) */
12042       /* From WCS manual:
12043        * If Aironet IE support is enabled, the access point sends an Aironet
12044        * IE 0x85 (which contains the access point name, load, number of
12045        * associated clients, and so on) in the beacon and probe responses of
12046        * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
12047        * (which contains the management IP address of the controller and
12048        * the IP address of the access point) in the reassociation response
12049        * if it receives Aironet IE 0x85 in the reassociation request.
12050        */
12051
12052       if (tag_len < 26)
12053       {
12054         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u too short, must be >= 26", tag_len);
12055         break;
12056       }
12057       offset += 2;
12058       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown, tvb, offset, 10, ENC_NA);
12059       offset += 10;
12060
12061       /* The Name of the sending device starts at offset 10 and is up to
12062          15 or 16 bytes in length, \0 padded */
12063       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_name, tvb, offset, 16, ENC_ASCII|ENC_NA);
12064       offset += 16;
12065
12066       /* Total number off associated clients and repeater access points */
12067       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_clients, tvb, offset, 1, ENC_NA);
12068       offset += 1;
12069       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown2, tvb, offset, 3, ENC_NA);
12070       offset += 3;
12071       break;
12072
12073     case TAG_VHT_CAPABILITY:
12074       dissect_vht_capability_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len);
12075       break;
12076
12077     case TAG_VHT_OPERATION:
12078       dissect_vht_operation_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len);
12079       break;
12080
12081     case TAG_VENDOR_SPECIFIC_IE: /* 7.3.2.26 Vendor Specific information element (221) */
12082       if (tag_len < 3)
12083       {
12084         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be >= 3", tag_len);
12085         break;
12086       }
12087       {
12088         guint32 tag_vs_len = tag_len;
12089
12090         offset += 2;
12091         oui = tvb_get_ntoh24(tvb, offset);
12092         tag_tvb = tvb_new_subset(tvb, offset, tag_len, tag_len);
12093         proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
12094         proto_item_append_text(ti, ": %s", uint_get_manuf_name(oui));
12095         offset += 3;
12096         tag_vs_len -= 3;
12097
12098         if (tag_len > 0) {
12099           proto_tree_add_item(ti, hf_ieee80211_tag_vendor_oui_type, tvb, offset, 1, ENC_BIG_ENDIAN);
12100         }
12101
12102       switch (oui) {
12103         /* 802.11 specific vendor ids */
12104         case OUI_WPAWME:
12105           offset = dissect_vendor_ie_wpawme(tree, tvb, pinfo, offset, tag_vs_len, ftype);
12106           break;
12107         case OUI_RSN:
12108           dissect_vendor_ie_rsn(ti, tree, tvb, offset, tag_vs_len);
12109           break;
12110         case OUI_PRE11N:
12111           dissect_vendor_ie_ht(tvb, pinfo, tree, offset, ti, ti_len, tag_vs_len);
12112           break;
12113         case OUI_WFA:
12114           dissect_vendor_ie_wfa(pinfo, ti, tag_tvb);
12115           break;
12116
12117         /* Normal IEEE vendor ids (from oui.h) */
12118         case OUI_CISCOWL:  /* Cisco Wireless (Aironet) */
12119           dissect_vendor_ie_aironet(ti, tree, tvb, offset, tag_vs_len);
12120           break;
12121         case OUI_MARVELL:
12122           dissect_vendor_ie_marvell(ti, tree, tvb, offset, tag_vs_len);
12123           break;
12124         case OUI_ATHEROS:
12125           dissect_vendor_ie_atheros(ti, tree, tvb, offset, tag_vs_len, pinfo, ti_len);
12126           break;
12127         case OUI_ARUBA:
12128           dissect_vendor_ie_aruba(ti, tree, tvb, offset, tag_vs_len);
12129           break;
12130         default:
12131           proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA);
12132           break;
12133         }
12134
12135       }
12136       break;
12137
12138     case TAG_MOBILITY_DOMAIN:
12139       dissect_mobility_domain(tree, tvb, offset + 2, tag_len);
12140       break;
12141
12142     case TAG_FAST_BSS_TRANSITION:
12143       dissect_fast_bss_transition(tree, tvb, offset + 2, tag_len);
12144       break;
12145
12146     case TAG_MMIE:
12147       dissect_mmie(tree, tvb, offset + 2, tag_len);
12148       break;
12149
12150     case TAG_SSID_LIST:
12151       dissect_ssid_list(tree, tvb, offset + 2, tag_len);
12152       break;
12153
12154     case TAG_TIME_ZONE:
12155       dissect_time_zone(tree, tvb, offset + 2, tag_len);
12156       break;
12157
12158     case TAG_TIMEOUT_INTERVAL:
12159       dissect_timeout_interval(tree, tvb, pinfo, offset + 2, tag_len);
12160       break;
12161
12162     case TAG_RIC_DATA: /* RIC Data (RDE) (57) */
12163      /* Assigning the return value will ensure that the IE after RIC is processed
12164       * only once. This gives us a good looking RIC IE :-)
12165       */
12166       tag_len = dissect_ric_data(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len, ftype);
12167       break;
12168
12169     case TAG_LINK_IDENTIFIER:
12170       dissect_link_identifier(tree, tvb, offset + 2, tag_len);
12171       break;
12172
12173     case TAG_WAKEUP_SCHEDULE:
12174       dissect_wakeup_schedule(tree, tvb, offset + 2, tag_len);
12175       break;
12176
12177     case TAG_CHANNEL_SWITCH_TIMING:
12178       dissect_channel_switch_timing(tree, tvb, offset + 2, tag_len);
12179       break;
12180
12181     case TAG_PTI_CONTROL:
12182       dissect_pti_control(tree, tvb, offset + 2, tag_len);
12183       break;
12184
12185     case TAG_PU_BUFFER_STATUS:
12186       dissect_pu_buffer_status(tree, tvb, offset + 2, tag_len);
12187       break;
12188
12189     case TAG_HT_CAPABILITY:
12190       dissect_ht_capability_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len, FALSE);
12191       break;
12192
12193     case TAG_HT_INFO:
12194       dissect_ht_info_ie_1_1(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12195       break;
12196
12197     case TAG_SECONDARY_CHANNEL_OFFSET:
12198       dissect_secondary_channel_offset_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12199       break;
12200
12201     case TAG_BSS_AVG_ACCESS_DELAY: /* BSS Average Access Delay element (63) */
12202       dissect_bss_avg_access_delay_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12203       break;
12204
12205     case TAG_ANTENNA: /* Antenna element (64) */
12206       dissect_antenna_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12207       break;
12208
12209     case TAG_RSNI: /* RSNI element (65) */
12210       dissect_rsni_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12211       break;
12212
12213     case TAG_BSS_AVB_ADM_CAPACITY:
12214       dissect_bss_available_admission_capacity_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12215       break;
12216
12217     case TAG_IE_68_CONFLICT: /* Conflict: WAPI Vs. IEEE */
12218       if (tag_len >= 20) { /* It Might be WAPI*/
12219         dissect_wapi_param_set(tvb, pinfo, tree, offset + 2,tag_len, ti_len, ti, ftype);
12220       }
12221       else { /* BSS AC Access Delay (68) */
12222         dissect_bss_ac_access_delay_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12223       }
12224       break;
12225
12226     case TAG_BSS_MAX_IDLE_PERIOD:
12227       dissect_bss_max_idle_period(tree, tvb, offset + 2);
12228       break;
12229
12230     case TAG_TFS_REQUEST:
12231       dissect_tfs_request(pinfo, tree, tvb, offset + 2, tag_len, ftype);
12232       break;
12233
12234     case TAG_TFS_RESPONSE:
12235       dissect_tfs_response(pinfo, tree, tvb, offset + 2, tag_len, ftype);
12236       break;
12237
12238     case TAG_WNM_SLEEP_MODE:
12239       dissect_wnm_sleep_mode(tree, tvb, offset + 2);
12240       break;
12241
12242     case TAG_TIME_ADV:
12243       dissect_time_adv(tree, tvb, offset + 2);
12244       break;
12245
12246     case TAG_RM_ENABLED_CAPABILITY: /* RM Enabled Capabilities (70) */
12247       dissect_rm_enabled_capabilities_ie(pinfo, tree, ti, ti_len, tag_len, tvb, offset+2, tag_end);
12248       break;
12249
12250     case TAG_RIC_DESCRIPTOR: /* RIC Descriptor (75) */
12251       dissect_ric_descriptor(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len);
12252       break;
12253
12254     case TAG_MESH_PEERING_MGMT:
12255       {
12256         guint start = offset + 2;
12257         offset += 2;
12258         proto_tree_add_item (tree, hf_ieee80211_mesh_peering_proto, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12259         offset += 2;
12260         proto_tree_add_item (tree, hf_ieee80211_mesh_peering_local_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12261         offset += 2;
12262         switch (tvb_get_guint8(tvb, 1))
12263           {                                         /* Self-protected action field */
12264           case SELFPROT_ACTION_MESH_PEERING_OPEN:
12265             break;
12266
12267           case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
12268             proto_tree_add_item (tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12269             offset += 2;
12270             break;
12271
12272           case SELFPROT_ACTION_MESH_PEERING_CLOSE:
12273             if ((tag_len == 8) || (tag_len == 24))
12274               {
12275                 proto_tree_add_item (tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12276                 offset += 2;
12277               }
12278             offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
12279             break;
12280
12281           /* unexpected values */
12282           default:
12283             proto_tree_add_text (tree, tvb, offset, tag_len, "Unexpected Self-protected action");
12284             offset += tag_len;
12285             break;
12286           }
12287         if (tag_len - (offset - start) == 16)
12288           {
12289             proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
12290             offset += 16;
12291           }
12292         break;
12293       }
12294
12295     case TAG_MESH_CONFIGURATION:
12296       {
12297         offset += 2;
12298         proto_tree_add_item (tree, hf_ieee80211_mesh_config_path_sel_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12299         proto_tree_add_item (tree, hf_ieee80211_mesh_config_path_sel_metric, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
12300         proto_tree_add_item (tree, hf_ieee80211_mesh_config_congestion_control, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
12301         proto_tree_add_item (tree, hf_ieee80211_mesh_config_sync_method, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
12302         proto_tree_add_item (tree, hf_ieee80211_mesh_config_auth_protocol, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
12303         proto_tree_add_item (tree, hf_ieee80211_mesh_config_formation_info, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
12304         proto_tree_add_item (tree, hf_ieee80211_mesh_config_capability, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
12305         break;
12306       }
12307
12308     case TAG_MESH_ID:
12309       {
12310         offset += 2;
12311
12312         proto_tree_add_item(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA);
12313         if (tag_len > 0) {
12314             col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", tvb_get_ephemeral_string(tvb, offset, tag_len));
12315             proto_item_append_text(ti, ": %s", tvb_get_ephemeral_string(tvb, offset, tag_len));
12316         }
12317
12318       break;
12319       }
12320
12321     case TAG_MESH_PREQ:
12322       {
12323         guint8 flags = tvb_get_guint8(tvb, offset + 2);
12324         guint8 targs, i;
12325         proto_item *item;
12326         proto_tree *subtree;
12327
12328         offset += 2;
12329         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12330         offset += 1;
12331         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12332         offset += 1;
12333         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12334         offset += 1;
12335         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_pdid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12336         offset += 4;
12337         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
12338         offset += 6;
12339         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12340         offset += 4;
12341
12342         if (flags & (1<<6)) {
12343           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_ext, tvb, offset, 6, ENC_NA);
12344           offset += 6;
12345         }
12346         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12347         offset += 4;
12348         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12349         offset += 4;
12350         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12351         targs = tvb_get_guint8 (tvb, offset);
12352         offset += 1;
12353         for (i = 0; i < targs; i++) {
12354           item = proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12355           subtree = proto_item_add_subtree(item, ett_hwmp_targ_flags_tree);
12356           proto_tree_add_boolean(subtree, hf_ieee80211_ff_hwmp_targ_to_flags, tvb, offset, 1, flags);
12357           proto_tree_add_boolean(subtree, hf_ieee80211_ff_hwmp_targ_usn_flags, tvb, offset, 1, flags);
12358           offset += 1;
12359           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
12360           offset += 6;
12361           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12362           offset += 4;
12363         }
12364         break;
12365       }
12366
12367     case TAG_MESH_PREP:
12368       {
12369         guint8 flags = tvb_get_guint8(tvb, offset + 2);
12370         offset += 2;
12371         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12372         offset += 1;
12373         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12374         offset += 1;
12375         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset , 1, ENC_LITTLE_ENDIAN);
12376         offset += 1;
12377         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
12378         offset += 6;
12379         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12380         offset += 4;
12381         if (flags & (1<<6)) {
12382           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
12383           offset += 6;
12384         }
12385         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12386         offset += 4;
12387         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12388         offset += 4;
12389         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
12390         offset += 6;
12391         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12392         offset += 4;
12393         break;
12394       }
12395
12396     case TAG_MESH_PERR:
12397       {
12398         guint8 targs, i;
12399
12400         offset += 2;
12401         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12402         offset += 1;
12403         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_BIG_ENDIAN);
12404         targs = tvb_get_guint8 (tvb, offset);
12405         offset += 1;
12406         for (i = 0; i < targs; i++) {
12407           guint8 flags = tvb_get_guint8(tvb, offset);
12408
12409           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12410           offset += 1;
12411           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
12412           offset += 6;
12413           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12414           offset += 4;
12415           if (flags & (1<<6)) {
12416             proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
12417             offset += 6;
12418           }
12419           offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
12420         }
12421         break;
12422       }
12423
12424     case TAG_RANN:
12425       {
12426         offset += 2;
12427         proto_tree_add_item (tree, hf_ieee80211_rann_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
12428         offset += 1;
12429         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_BIG_ENDIAN);
12430         offset += 1;
12431         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_BIG_ENDIAN);
12432         offset += 1;
12433         proto_tree_add_item (tree, hf_ieee80211_rann_root_sta, tvb, offset, 6, ENC_NA);
12434         offset += 6;
12435         proto_tree_add_item (tree, hf_ieee80211_rann_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12436         offset += 4;
12437         proto_tree_add_item (tree, hf_ieee80211_rann_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12438         offset += 4;
12439         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12440         offset += 4;
12441         break;
12442       }
12443       break;
12444
12445     case TAG_INTERWORKING:
12446       dissect_interworking(pinfo, tree, ti, tvb, offset);
12447       break;
12448     case TAG_ADVERTISEMENT_PROTOCOL:
12449     {
12450       dissect_advertisement_protocol(pinfo, tree, tvb, offset, NULL);
12451       break;
12452     }
12453     case TAG_ROAMING_CONSORTIUM:
12454       dissect_roaming_consortium(pinfo, tree, ti, tvb, offset);
12455       break;
12456     case TAG_AP_CHANNEL_REPORT: /* 7.3.2.36 AP Channel Report element */
12457       dissect_ap_channel_report(tvb, pinfo, tree, offset + 2, tag_len, ti_len, tag_end, ti);
12458       break;
12459     case TAG_NEIGHBOR_REPORT:
12460     {
12461       #define SUB_TAG_TSF_INFO                 0x01
12462       #define SUB_TAG_MEASUREMENT_PILOT_INFO   0x02
12463       #define SUB_TAG_HT_CAPABILITIES          0x03
12464       #define SUB_TAG_HT_INFO                  0x04
12465       #define SUB_TAG_SEC_CHANNEL_OFFSET       0x05
12466       #define SUB_TAG_VENDOR_SPECIFIC          0xDD
12467
12468
12469       guint tag_offset;
12470       guint8 sub_tag_id;
12471       guint32 bssid_info, info, sub_tag_length;
12472       proto_item *parent_item;
12473       proto_tree *bssid_info_subtree, *sub_tag_tree;
12474       tvbuff_t *volatile sub_tag_tvb = NULL;
12475
12476       if (tag_len < 13)
12477       {
12478         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
12479             "Neighbor Report: Error: Tag length must be at least 13 bytes long");
12480         break;
12481       }
12482       offset += 2;
12483       tag_offset = offset;
12484
12485       proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid, tvb, offset, 6, ENC_NA);
12486
12487       /*** Begin: BSSID Information ***/
12488       offset += 6;
12489       bssid_info = tvb_get_letohl (tvb, offset);
12490       parent_item = proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_bssid_info, tvb, offset, 4, bssid_info, "BSSID Information: 0x%08X", bssid_info);
12491       bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
12492
12493       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reachability, tvb, offset, 1, bssid_info);
12494       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_security, tvb, offset, 1, bssid_info);
12495       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 1, bssid_info);
12496       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 1, bssid_info);
12497       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 1, bssid_info);
12498       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 1, bssid_info);
12499       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 1, bssid_info);
12500       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback, tvb, offset+1, 1, bssid_info);
12501       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback, tvb, offset+1, 1, bssid_info);
12502       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset+1, 1, bssid_info);
12503       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput, tvb, offset+1, 1, bssid_info);
12504       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reserved, tvb, offset+1, 3, (bssid_info & 0xfffff000) >> 12);
12505       /*** End: BSSID Information ***/
12506
12507       offset += 4;
12508       info = tvb_get_guint8 (tvb, offset);
12509       proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_reg_class, tvb, offset, 1, info, "Regulatory Class: 0x%02X", info);
12510
12511       offset += 1;
12512       info = tvb_get_guint8 (tvb, offset);
12513       proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_channel_number, tvb, offset, 1, info, "Channel Number: 0x%02X", info);
12514
12515       offset += 1;
12516       info = tvb_get_guint8 (tvb, offset);
12517       proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, info, "PHY Type: 0x%02X", info);
12518
12519       offset += 1;
12520       sub_tag_id = tvb_get_guint8 (tvb, offset);
12521       offset += 1;
12522       sub_tag_length = tvb_get_guint8 (tvb, offset);
12523
12524       offset += 1;
12525       sub_tag_tvb = tvb_new_subset(tvb, offset, sub_tag_length, -1);
12526
12527       switch (sub_tag_id) {
12528         case SUB_TAG_TSF_INFO:
12529           /* TODO */
12530           break;
12531         case SUB_TAG_MEASUREMENT_PILOT_INFO:
12532           /* TODO */
12533           break;
12534         case SUB_TAG_HT_CAPABILITIES:
12535           parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "HT Capabilities");
12536           sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
12537           dissect_ht_capability_ie(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len, FALSE);
12538           break;
12539         case SUB_TAG_HT_INFO:
12540           parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "HT Information");
12541           sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
12542           dissect_ht_info_ie_1_1(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len);
12543           break;
12544         case SUB_TAG_SEC_CHANNEL_OFFSET:
12545           parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "Secondary Channel Offset");
12546           sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
12547           dissect_secondary_channel_offset_ie(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len);
12548           break;
12549         case SUB_TAG_VENDOR_SPECIFIC:
12550         default:
12551           break;
12552       }
12553
12554       offset += sub_tag_length;
12555
12556       if (tag_len > (offset - tag_offset))
12557       {
12558         proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
12559         break;
12560       }
12561       break;
12562     }
12563
12564     case TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT:
12565     {
12566       guint tag_offset;
12567
12568       if (tag_len != 4)
12569       {
12570         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
12571             "Extended Channel Switch Announcement: Error: Tag length must be exactly 4 bytes long");
12572         break;
12573       }
12574
12575       offset += 2;
12576       tag_offset = offset;
12577
12578       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT);
12579
12580       if (tag_len > (offset - tag_offset))
12581       {
12582         proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
12583         break;
12584       }
12585       break;
12586     }
12587     case TAG_SUPPORTED_REGULATORY_CLASSES:
12588     {
12589       guint8 current_field;
12590       guint i;
12591
12592       if (tag_len < 2) {
12593         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
12594             "Supported Regulatory Classes: Error: Tag length must be at least 2 bytes long");
12595         break;
12596       } else if (tag_len > 32) {
12597         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
12598             "Supported Regulatory Classes: Error: Tag length must be no more than 32 bytes long");
12599         break;
12600       }
12601
12602       offset += 2;
12603
12604       current_field = tvb_get_guint8 (tvb, offset);
12605       proto_tree_add_uint(tree, hf_ieee80211_tag_supported_reg_classes_current, tvb, offset, 1, current_field);
12606
12607       offset += 1;
12608       /* Partially taken from the ssid section */
12609       tag_data_ptr = tvb_get_ptr (tvb, offset, tag_len);
12610       for (i = 0, n = 0; (i < tag_len) && (n < SHORT_STR); i++) {
12611         ret = g_snprintf (print_buff + n, SHORT_STR - n, (i == tag_len-1)?"%d":"%d, ", tag_data_ptr[i]);
12612         if (ret >= SHORT_STR - n) {
12613           /* ret >= <buf_size> means buffer truncated  */
12614           break;
12615         }
12616         n += ret;
12617       }
12618       proto_tree_add_string (tree, hf_ieee80211_tag_supported_reg_classes_alternate, tvb, offset, tag_len, print_buff);
12619
12620       break;
12621     }
12622     default:
12623       proto_tree_add_item(tree, hf_ieee80211_tag_data, tvb, offset + 1 + 1, tag_len, ENC_NA);
12624       expert_add_info_format(pinfo, ti_tag, PI_UNDECODED, PI_NOTE,
12625                              "Dissector for 802.11 IE Tag"
12626                              " (%s) code not implemented, Contact"
12627                              " Wireshark developers if you want this supported", val_to_str_ext(tag_no,
12628                                             &tag_num_vals_ext, "(%d)"));
12629       proto_item_append_text(ti, ": Undecoded");
12630       break;
12631   }
12632   if (offset < tag_end) {
12633     /* TODO: add Expert info to indicate there is unknown data ! but all tagged option don't yet return offset.
12634       For the moment, this code only remove Clang Warnings about not used offset... */
12635   }
12636   return tag_len + 1 + 1;
12637 }
12638
12639 void
12640 ieee_80211_add_tagged_parameters (tvbuff_t *tvb, int offset, packet_info *pinfo,
12641                                   proto_tree *tree, int tagged_parameters_len, int ftype)
12642 {
12643   int next_len;
12644
12645   beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
12646   while (tagged_parameters_len > 0) {
12647     if ((next_len=add_tagged_field (pinfo, tree, tvb, offset, ftype))==0)
12648       break;
12649     if (next_len > tagged_parameters_len) {
12650       /* XXX - flag this as an error? */
12651       next_len = tagged_parameters_len;
12652     }
12653     offset                += next_len;
12654     tagged_parameters_len -= next_len;
12655   }
12656 }
12657
12658 /* ************************************************************************* */
12659 /*                     Dissect 802.11 management frame                       */
12660 /* ************************************************************************* */
12661 static void
12662 dissect_ieee80211_mgt (guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
12663 {
12664   proto_item *ti;
12665   proto_tree *mgt_tree;
12666   proto_tree *fixed_tree;
12667   proto_tree *tagged_tree;
12668   int         offset = 0;
12669   int         tagged_parameter_tree_len;
12670
12671   ieee80211_tvb_invalid = FALSE;
12672
12673   CHECK_DISPLAY_AS_X(data_handle,proto_wlan_mgt, tvb, pinfo, tree);
12674
12675   ti = proto_tree_add_item (tree, proto_wlan_mgt, tvb, 0, -1, ENC_NA);
12676   mgt_tree = proto_item_add_subtree (ti, ett_80211_mgt);
12677
12678   switch (COMPOSE_FRAME_TYPE(fcf))
12679   {
12680
12681     case MGT_ASSOC_REQ:
12682       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 4);
12683       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
12684       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_LISTEN_IVAL);
12685       offset = 4;  /* Size of fixed fields */
12686
12687       tagged_parameter_tree_len =
12688           tvb_reported_length_remaining(tvb, offset);
12689       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12690                  tagged_parameter_tree_len);
12691       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12692           tagged_parameter_tree_len, MGT_ASSOC_REQ);
12693       break;
12694
12695
12696     case MGT_ASSOC_RESP:
12697       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
12698       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
12699       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_STATUS_CODE);
12700       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_ASSOC_ID);
12701       offset = 6;  /* Size of fixed fields */
12702
12703       tagged_parameter_tree_len =
12704           tvb_reported_length_remaining(tvb, offset);
12705       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12706                  tagged_parameter_tree_len);
12707       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12708           tagged_parameter_tree_len, MGT_ASSOC_RESP);
12709       break;
12710
12711
12712     case MGT_REASSOC_REQ:
12713       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 10);
12714       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
12715       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_LISTEN_IVAL);
12716       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_CURRENT_AP_ADDR);
12717       offset = 10;  /* Size of fixed fields */
12718
12719       tagged_parameter_tree_len =
12720           tvb_reported_length_remaining(tvb, offset);
12721       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12722                  tagged_parameter_tree_len);
12723       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12724           tagged_parameter_tree_len, MGT_REASSOC_REQ);
12725       break;
12726
12727     case MGT_REASSOC_RESP:
12728       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
12729       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
12730       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_STATUS_CODE);
12731       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_ASSOC_ID);
12732       offset = 6;  /* Size of fixed fields */
12733
12734       tagged_parameter_tree_len =
12735           tvb_reported_length_remaining(tvb, offset);
12736       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12737                  tagged_parameter_tree_len);
12738       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12739           tagged_parameter_tree_len, MGT_REASSOC_RESP);
12740       break;
12741
12742
12743     case MGT_PROBE_REQ:
12744       offset = 0;
12745       tagged_parameter_tree_len =
12746           tvb_reported_length_remaining(tvb, offset);
12747       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12748                  tagged_parameter_tree_len);
12749       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12750           tagged_parameter_tree_len, MGT_PROBE_REQ);
12751       break;
12752
12753     case MGT_PROBE_RESP:
12754     {
12755       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
12756       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_TIMESTAMP);
12757       add_fixed_field(fixed_tree, tvb, pinfo, 8, FIELD_BEACON_INTERVAL);
12758       add_fixed_field(fixed_tree, tvb, pinfo, 10, FIELD_CAP_INFO);
12759       offset = 12;  /* Size of fixed fields */
12760
12761       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12762       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
12763       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_PROBE_RESP);
12764       break;
12765     }
12766     case MGT_MEASUREMENT_PILOT:
12767     {
12768       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
12769       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TIMESTAMP);
12770       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MEASUREMENT_PILOT_INT);
12771       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_BEACON_INTERVAL);
12772       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_CAP_INFO);
12773       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_COUNTRY_STR);
12774       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MAX_REG_PWR);
12775       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MAX_TX_PWR);
12776       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TX_PWR_USED);
12777       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TRANSCEIVER_NOISE_FLOOR);
12778       /* TODO DS Parameter Set ??? */
12779
12780       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12781       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
12782       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_MEASUREMENT_PILOT);
12783       break;
12784     }
12785     case MGT_BEACON:    /* Dissect protocol payload fields  */
12786       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
12787       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_TIMESTAMP);
12788       add_fixed_field(fixed_tree, tvb, pinfo, 8, FIELD_BEACON_INTERVAL);
12789       add_fixed_field(fixed_tree, tvb, pinfo, 10, FIELD_CAP_INFO);
12790       offset = 12;  /* Size of fixed fields */
12791
12792       tagged_parameter_tree_len =
12793           tvb_reported_length_remaining(tvb, offset);
12794       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12795       tagged_parameter_tree_len);
12796       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12797       tagged_parameter_tree_len, MGT_BEACON);
12798       break;
12799
12800     case MGT_ATIM:
12801       break;
12802
12803     case MGT_DISASS:
12804       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
12805       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_REASON_CODE);
12806       offset = 2; /* Size of fixed fields */
12807       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12808       if (tagged_parameter_tree_len > 0) {
12809         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
12810                                                 tagged_parameter_tree_len);
12811         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
12812                                          tagged_parameter_tree_len, MGT_DISASS);
12813       }
12814       break;
12815
12816     case MGT_AUTHENTICATION:
12817       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
12818       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_AUTH_ALG);
12819       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_AUTH_TRANS_SEQ);
12820       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_STATUS_CODE);
12821       offset = 6;  /* Size of fixed fields */
12822
12823       tagged_parameter_tree_len =
12824         tvb_reported_length_remaining(tvb, offset);
12825       if (tagged_parameter_tree_len > 0)
12826       {
12827         tagged_tree = get_tagged_parameter_tree (mgt_tree,
12828             tvb,
12829             offset,
12830             tagged_parameter_tree_len);
12831         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12832         tagged_parameter_tree_len, MGT_AUTHENTICATION);
12833       }
12834       break;
12835
12836     case MGT_DEAUTHENTICATION:
12837       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
12838       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_REASON_CODE);
12839       offset = 2; /* Size of fixed fields */
12840       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12841       if (tagged_parameter_tree_len > 0) {
12842         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
12843                                                 tagged_parameter_tree_len);
12844         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
12845                                          tagged_parameter_tree_len, MGT_DEAUTHENTICATION);
12846       }
12847       break;
12848
12849     case MGT_ACTION:
12850     {
12851       proto_item *lcl_fixed_hdr;
12852       proto_tree *lcl_fixed_tree;
12853       lcl_fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters");
12854       lcl_fixed_tree = proto_item_add_subtree (lcl_fixed_hdr, ett_fixed_parameters);
12855
12856       offset += add_fixed_field(lcl_fixed_tree, tvb, pinfo, 0, FIELD_ACTION);
12857
12858       proto_item_set_len(lcl_fixed_hdr, offset);
12859       if (ieee80211_tvb_invalid)
12860         break; /* Buffer not available for further processing */
12861       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12862       if (tagged_parameter_tree_len > 0)
12863       {
12864         tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12865           tagged_parameter_tree_len);
12866         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12867           tagged_parameter_tree_len, MGT_ACTION);
12868       }
12869       break;
12870     }
12871     case MGT_ACTION_NO_ACK:
12872     {
12873       proto_item *lcl_fixed_hdr;
12874       proto_tree *lcl_fixed_tree;
12875       lcl_fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters");
12876       lcl_fixed_tree = proto_item_add_subtree (lcl_fixed_hdr, ett_fixed_parameters);
12877
12878       offset += add_fixed_field(lcl_fixed_tree, tvb, pinfo, 0, FIELD_ACTION);
12879
12880       proto_item_set_len(lcl_fixed_hdr, offset);
12881       if (ieee80211_tvb_invalid)
12882         break; /* Buffer not available for further processing */
12883       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12884       if (tagged_parameter_tree_len > 0)
12885       {
12886         tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12887           tagged_parameter_tree_len);
12888         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12889           tagged_parameter_tree_len, MGT_ACTION_NO_ACK);
12890       }
12891       break;
12892     }
12893     case MGT_ARUBA_WLAN:
12894     {
12895       proto_item *aruba_hdr;
12896       proto_tree *aruba_tree;
12897       guint16 type;
12898       type = tvb_get_ntohs(tvb, offset);
12899
12900       aruba_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Aruba Management");
12901       aruba_tree = proto_item_add_subtree(aruba_hdr, ett_fixed_parameters);
12902
12903       proto_tree_add_item(aruba_tree, hf_ieee80211_aruba, tvb, offset, 2, ENC_BIG_ENDIAN);
12904       offset += 2;
12905       /* HeartBeat Sequence */
12906       if (type == 0x0005)
12907       {
12908         proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_hb_seq, tvb, offset, 8, ENC_BIG_ENDIAN);
12909       }
12910       /* MTU Size */
12911       if (type == 0x0003)
12912       {
12913         proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_mtu, tvb, offset, 2, ENC_BIG_ENDIAN);
12914       }
12915       break;
12916     }
12917   }
12918 }
12919
12920 static void
12921 set_src_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type)
12922 {
12923   col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
12924         get_ether_name(addr), type);
12925   col_add_str(pinfo->cinfo, COL_UNRES_DL_SRC, ether_to_str(addr));
12926 }
12927
12928 static void
12929 set_dst_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type)
12930 {
12931   col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
12932         get_ether_name(addr), type);
12933   col_add_str(pinfo->cinfo, COL_UNRES_DL_DST, ether_to_str(addr));
12934 }
12935
12936 static guint32
12937 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
12938 {
12939   guint32 c_crc;
12940
12941   c_crc = crc32_ccitt_tvb(tvb, hdr_len);
12942   c_crc = crc32_ccitt_seed(tvb_get_ptr(tvb, hdr_size, len), len, ~c_crc);
12943
12944   /* Byte reverse. */
12945   c_crc = ((unsigned char)(c_crc>>0)<<24) |
12946     ((unsigned char)(c_crc>>8)<<16) |
12947     ((unsigned char)(c_crc>>16)<<8) |
12948     ((unsigned char)(c_crc>>24)<<0);
12949
12950   return (c_crc);
12951 }
12952
12953 typedef enum {
12954     ENCAP_802_2,
12955     ENCAP_IPX,
12956     ENCAP_ETHERNET
12957 } encap_t;
12958
12959
12960 /* ************************************************************************* */
12961 /*                          Dissect 802.11 frame                             */
12962 /* ************************************************************************* */
12963
12964 /*
12965  * The 802.11n specification makes some fairly significant changes to the
12966  * layout of the MAC header.  The first two bits of the MAC header are the
12967  * protocol version.  You'd think that the 802.11 committee would have
12968  * bumped the version to indicate a different MAC layout, but NOOOO -- we
12969  * have to go digging for bits in various locations instead.
12970  */
12971
12972 static void
12973 dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
12974                           proto_tree *tree, gboolean fixed_length_header, gint fcs_len,
12975                           gboolean wlan_broken_fc, gboolean datapad,
12976                           gboolean is_ht)
12977 {
12978   guint16          fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
12979   guint16          seq_control;
12980   guint32          seq_number, frag_number;
12981   gboolean         more_frags;
12982   const guint8    *src         = NULL;
12983   const guint8    *dst         = NULL;
12984   const guint8    *bssid       = NULL;
12985   proto_item      *ti          = NULL;
12986   proto_item      *fcs_item    = NULL;
12987   proto_item      *cw_item     = NULL;
12988   proto_item      *hidden_item;
12989   proto_tree      *fcs_tree    = NULL;
12990   proto_tree      *cw_tree     = NULL;
12991   guint16          hdr_len, ohdr_len;
12992   guint16          htc_len     = 0;
12993   gboolean         has_fcs, fcs_good, fcs_bad;
12994   gint             len, reported_len, ivlen;
12995   gboolean         is_amsdu    = 0;
12996   gboolean         save_fragmented;
12997   guint32          addr_type;
12998   guint8           octet1, octet2;
12999   char             out_buff[SHORT_STR];
13000   gint             is_iv_bad;
13001   guchar           iv_buff[4];
13002   const char      *addr1_str   = NULL;
13003   int              addr1_hf    = -1;
13004   guint            offset;
13005   const gchar     *fts_str;
13006   gchar            flag_str[]  = "opmPRMFTC";
13007   gint             ii;
13008   guint16          qosoff      = 0;
13009   guint16          qos_control = 0;
13010   gint             meshctl_len = 0;
13011   guint8           mesh_flags;
13012   guint16          meshoff     = 0;
13013   static wlan_hdr  whdrs[4];
13014   gboolean         retransmitted;
13015
13016   volatile encap_t encap_type;
13017   proto_tree *volatile hdr_tree = NULL;
13018   tvbuff_t   *volatile next_tvb = NULL;
13019   wlan_hdr   *volatile whdr;
13020
13021   whdr= &whdrs[0];
13022
13023   col_set_str (pinfo->cinfo, COL_PROTOCOL, "802.11");
13024   col_clear(pinfo->cinfo, COL_INFO);
13025
13026   fcf = FETCH_FCF(0);
13027   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
13028   if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
13029     ctrl_fcf = FETCH_FCF(10);
13030   else
13031     ctrl_fcf = 0;
13032
13033   if (fixed_length_header)
13034     hdr_len = DATA_LONG_HDR_LEN;
13035   else
13036     hdr_len = find_header_length (fcf, ctrl_fcf, is_ht);
13037
13038   fts_str = val_to_str_ext_const(frame_type_subtype, &frame_type_subtype_vals_ext,
13039                                  "Unrecognized (Reserved frame)");
13040   col_set_str (pinfo->cinfo, COL_INFO, fts_str);
13041
13042
13043   flags = FCF_FLAGS (fcf);
13044   more_frags = HAVE_FRAGMENTS (flags);
13045
13046   for (ii = 0; ii < 8; ii++) {
13047     if (! (flags & 0x80 >> ii)) {
13048       flag_str[ii] = '.';
13049     }
13050   }
13051
13052   if (is_ht && IS_STRICTLY_ORDERED(flags) &&
13053       ((FCF_FRAME_TYPE(fcf) == MGT_FRAME) ||
13054        ((FCF_FRAME_TYPE(fcf) == DATA_FRAME) && DATA_FRAME_IS_QOS(frame_type_subtype)))) {
13055     htc_len = 4;
13056   }
13057
13058   /* adjust the header length depending on the Mesh Control field */
13059   if ((FCF_FRAME_TYPE(fcf) == DATA_FRAME) &&
13060       DATA_FRAME_IS_QOS(frame_type_subtype)) {
13061         qosoff = hdr_len - htc_len - 2;
13062         qos_control = tvb_get_letohs(tvb, qosoff);
13063         if (tvb_length(tvb) > hdr_len) {
13064             meshoff = hdr_len;
13065             mesh_flags = tvb_get_guint8 (tvb, hdr_len);
13066             if (has_mesh_control(fcf, qos_control, mesh_flags)) {
13067               meshctl_len = find_mesh_control_length(mesh_flags);
13068               hdr_len += meshctl_len;
13069             }
13070         }
13071   }
13072
13073   /*
13074    * Some portions of this code calculate offsets relative to the end of the
13075    * header.  But when the header has been padded to align the data this must
13076    * be done relative to true header size, not the padded/aligned value.  To
13077    * simplify this work we stash the original header size in ohdr_len instead
13078    * of recalculating it every time we need it.
13079    */
13080   ohdr_len = hdr_len;
13081   if (datapad)
13082     hdr_len = roundup2(hdr_len, 4);
13083
13084   /* Add the FC and duration/id to the current tree */
13085   if (tree)
13086     {
13087       ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
13088                                            "IEEE 802.11 %s", fts_str);
13089       hdr_tree = proto_item_add_subtree (ti, ett_80211);
13090
13091       dissect_frame_control(hdr_tree, tvb, wlan_broken_fc, 0, pinfo);
13092       dissect_durid(hdr_tree, tvb, frame_type_subtype, 2);
13093     }
13094
13095   /*
13096    * Decode the part of the frame header that isn't the same for all
13097    * frame types.
13098    */
13099   seq_control = 0;
13100   frag_number = 0;
13101   seq_number = 0;
13102
13103   switch (FCF_FRAME_TYPE (fcf))
13104   {
13105
13106     case MGT_FRAME:
13107       /*
13108        * All management frame types have the same header.
13109        */
13110       TVB_SET_ADDRESS_HF(&pinfo->dl_src, AT_ETHER, tvb, 10, 6, hf_ieee80211_addr_sa);
13111       COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->dl_src);
13112       TVB_SET_ADDRESS_HF(&pinfo->dl_dst, AT_ETHER, tvb, 4, 6, hf_ieee80211_addr_da);
13113       COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->dl_dst);
13114
13115       /* for tap */
13116       TVB_SET_ADDRESS_HF(&whdr->bssid, AT_ETHER, tvb, 16, 6, hf_ieee80211_addr_bssid);
13117       COPY_ADDRESS_SHALLOW(&whdr->src, &pinfo->dl_src);
13118       COPY_ADDRESS_SHALLOW(&whdr->dst, &pinfo->dl_dst);
13119       whdr->type = frame_type_subtype;
13120
13121       seq_control = tvb_get_letohs(tvb, 22);
13122       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
13123       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
13124
13125       col_append_fstr(pinfo->cinfo, COL_INFO,
13126             ", SN=%d", seq_number);
13127
13128       col_append_fstr(pinfo->cinfo, COL_INFO,
13129             ", FN=%d",frag_number);
13130
13131       if (tree)
13132       {
13133         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13134         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
13135
13136         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13137         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
13138
13139         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
13140
13141         /* add items for wlan.addr filter */
13142         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13143         PROTO_ITEM_SET_HIDDEN(hidden_item);
13144         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13145         PROTO_ITEM_SET_HIDDEN(hidden_item);
13146
13147         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13148         PROTO_ITEM_SET_HIDDEN(hidden_item);
13149
13150         proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13151         proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13152       }
13153       break;
13154
13155     case CONTROL_FRAME:
13156     {
13157       /*
13158        * Control Wrapper frames insert themselves between address 1
13159        * and address 2 in a normal control frame.  Process address 1
13160        * first, then handle the rest of the frame in dissect_control.
13161        */
13162       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
13163         offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
13164         ctrl_fcf = FETCH_FCF(10);
13165         ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
13166       } else {
13167         offset = 10; /* FC + D/ID + Address 1 */
13168         ctrl_type_subtype = frame_type_subtype;
13169       }
13170
13171       switch (ctrl_type_subtype)
13172       {
13173         case CTRL_PS_POLL:
13174           addr1_str = "BSSID";
13175           addr1_hf = hf_ieee80211_addr_bssid;
13176           break;
13177         case CTRL_RTS:
13178         case CTRL_CTS:
13179         case CTRL_ACKNOWLEDGEMENT:
13180         case CTRL_CFP_END:
13181         case CTRL_CFP_ENDACK:
13182         case CTRL_BLOCK_ACK_REQ:
13183         case CTRL_BLOCK_ACK:
13184           addr1_str = "RA";
13185           addr1_hf = hf_ieee80211_addr_ra;
13186           break;
13187         default:
13188           break;
13189       }
13190
13191       if (!addr1_str) /* XXX - Should we throw some sort of error? */
13192         break;
13193
13194       /* Add address 1 */
13195       dst = tvb_get_ptr(tvb, 4, 6);
13196       set_dst_addr_cols(pinfo, dst, addr1_str);
13197       if (tree) {
13198         proto_tree_add_item(hdr_tree, addr1_hf, tvb, 4, 6, ENC_BIG_ENDIAN);
13199         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13200         PROTO_ITEM_SET_HIDDEN(hidden_item);
13201       }
13202
13203       /*
13204        * Start shoving in other fields if needed.
13205        * XXX - Should we look for is_ht as well?
13206        */
13207       if ((frame_type_subtype == CTRL_CONTROL_WRAPPER) && tree) {
13208         cw_item = proto_tree_add_text(hdr_tree, tvb, offset, 2,
13209           "Contained Frame Control");
13210         cw_tree = proto_item_add_subtree (cw_item, ett_cntrl_wrapper_fc);
13211         dissect_frame_control(cw_tree, tvb, FALSE, offset, pinfo);
13212         dissect_ht_control(hdr_tree, tvb, offset + 2);
13213         offset += 6;
13214         cw_item = proto_tree_add_text(hdr_tree, tvb, offset, 2,
13215           "Carried Frame");
13216         hdr_tree = proto_item_add_subtree (cw_item, ett_cntrl_wrapper_fc);
13217       }
13218
13219       switch (ctrl_type_subtype)
13220       {
13221         case CTRL_PS_POLL:
13222         case CTRL_CFP_END:
13223         case CTRL_CFP_ENDACK:
13224         {
13225           src = tvb_get_ptr (tvb, offset, 6);
13226           set_src_addr_cols(pinfo, src, "BSSID");
13227           if (tree) {
13228             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
13229             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
13230             PROTO_ITEM_SET_HIDDEN(hidden_item);
13231           }
13232           break;
13233         }
13234
13235         case CTRL_RTS:
13236         {
13237           src = tvb_get_ptr (tvb, offset, 6);
13238           set_src_addr_cols(pinfo, src, "TA");
13239           if (tree) {
13240             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
13241             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
13242             PROTO_ITEM_SET_HIDDEN(hidden_item);
13243           }
13244           break;
13245         }
13246
13247         case CTRL_CONTROL_WRAPPER:
13248         {
13249           /* XXX - We shouldn't see this.  Should we throw an error? */
13250           break;
13251         }
13252
13253         case CTRL_BLOCK_ACK_REQ:
13254         {
13255           src = tvb_get_ptr (tvb, offset, 6);
13256           set_src_addr_cols(pinfo, src, "TA");
13257
13258           if (tree)
13259           {
13260             guint16 bar_control;
13261             guint8 block_ack_type;
13262             proto_item *bar_parent_item;
13263             proto_tree *bar_sub_tree;
13264
13265             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
13266             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
13267             PROTO_ITEM_SET_HIDDEN(hidden_item);
13268             offset += 6;
13269
13270             bar_control = tvb_get_letohs(tvb, offset);
13271             block_ack_type = (bar_control & 0x0006) >> 1;
13272             proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_request_type, tvb,
13273               offset, 2, ENC_LITTLE_ENDIAN);
13274             bar_parent_item = proto_tree_add_item(hdr_tree,
13275               hf_ieee80211_block_ack_request_control, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13276             bar_sub_tree = proto_item_add_subtree(bar_parent_item,
13277               ett_block_ack);
13278             proto_tree_add_item(bar_sub_tree,
13279               hf_ieee80211_block_ack_control_ack_policy, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13280             proto_tree_add_item(bar_sub_tree, hf_ieee80211_block_ack_control_multi_tid,
13281               tvb, offset, 2, ENC_LITTLE_ENDIAN);
13282             proto_tree_add_item(bar_sub_tree,
13283               hf_ieee80211_block_ack_control_compressed_bitmap, tvb, offset, 2,
13284               ENC_LITTLE_ENDIAN);
13285             proto_tree_add_item(bar_sub_tree, hf_ieee80211_block_ack_control_reserved,
13286               tvb, offset, 2, ENC_LITTLE_ENDIAN);
13287
13288             switch (block_ack_type)
13289             {
13290               case 0: /*Basic BlockAckReq */
13291               {
13292                 proto_tree_add_item(bar_sub_tree,
13293                 hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13294                 offset += 2;
13295
13296                 /*offset +=*/ add_fixed_field(hdr_tree, tvb, pinfo, offset,
13297                   FIELD_BLOCK_ACK_SSC);
13298                 break;
13299               }
13300               case 2: /* Compressed BlockAckReq */
13301               {
13302                 proto_tree_add_item(bar_sub_tree,
13303                 hf_ieee80211_block_ack_control_compressed_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13304                 offset += 2;
13305
13306                 /*offset +=*/ add_fixed_field(hdr_tree, tvb, pinfo, offset,
13307                   FIELD_BLOCK_ACK_SSC);
13308                 break;
13309               }
13310               case 3: /* Multi-TID BlockAckReq */
13311               {
13312                 guint8 tid_count;
13313                 guint iii;
13314                 proto_tree *bar_mtid_tree, *bar_mtid_sub_tree;
13315
13316                 tid_count = ((bar_control & 0xF000) >> 12) + 1;
13317                 proto_tree_add_uint(bar_sub_tree, hf_ieee80211_block_ack_control_multi_tid_info, tvb, offset, 2, tid_count);
13318                 offset += 2;
13319
13320                 bar_parent_item = proto_tree_add_text (hdr_tree, tvb, offset, tid_count*4, "Per TID Info");
13321                 bar_mtid_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
13322                 for (iii = 0; iii < tid_count; iii++) {
13323                   bar_parent_item = proto_tree_add_uint(bar_mtid_tree, hf_ieee80211_block_ack_multi_tid_info, tvb, offset, 4, iii);
13324                   bar_mtid_sub_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
13325
13326                   proto_tree_add_item(bar_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13327                   proto_tree_add_item(bar_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13328                   offset += 2;
13329
13330                   offset += add_fixed_field(bar_mtid_sub_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
13331                 }
13332                 break;
13333               }
13334             }
13335           }
13336           break;
13337         }
13338
13339         case CTRL_BLOCK_ACK:
13340         {
13341           src = tvb_get_ptr (tvb, offset, 6);
13342           set_src_addr_cols(pinfo, src, "TA");
13343
13344           if (tree)
13345           {
13346             guint16 ba_control;
13347             guint8 block_ack_type;
13348             proto_item *ba_parent_item;
13349             proto_tree *ba_sub_tree;
13350
13351             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
13352             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
13353             PROTO_ITEM_SET_HIDDEN(hidden_item);
13354             offset += 6;
13355
13356             ba_control = tvb_get_letohs(tvb, offset);
13357             block_ack_type = (ba_control & 0x0006) >> 1;
13358             proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13359             ba_parent_item = proto_tree_add_item(hdr_tree,
13360               hf_ieee80211_block_ack_control, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13361             ba_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
13362             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_ack_policy,
13363               tvb, offset, 2, ENC_LITTLE_ENDIAN);
13364             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_multi_tid,
13365               tvb, offset, 2, ENC_LITTLE_ENDIAN);
13366             proto_tree_add_item(ba_sub_tree,
13367               hf_ieee80211_block_ack_control_compressed_bitmap, tvb, offset, 2,
13368               ENC_LITTLE_ENDIAN);
13369             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_reserved, tvb,
13370               offset, 2, ENC_LITTLE_ENDIAN);
13371
13372             switch (block_ack_type)
13373             {
13374               case 0: /*Basic BlockAck */
13375               {
13376                 proto_tree_add_item(ba_sub_tree,
13377                 hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13378                 offset += 2;
13379
13380                 offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
13381                 proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 128, ENC_NA);
13382                 /*offset += 128;*/
13383                 break;
13384               }
13385               case 2: /* Compressed BlockAck */
13386               {
13387                 guint16 ssn;
13388                 guint64 bmap;
13389                 int f;
13390                 proto_item *ba_bitmap_item;
13391                 proto_tree *ba_bitmap_tree;
13392
13393                 proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13394                 offset += 2;
13395
13396                 ssn = tvb_get_letohs(tvb, offset);
13397                 ssn >>= 4;
13398                 offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
13399                 bmap = tvb_get_letoh64(tvb, offset);
13400                 ba_bitmap_item = proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
13401                 ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item, ett_block_ack_bitmap);
13402                 for (f = 0; f < 64; f++) {
13403                   if (bmap & (G_GINT64_CONSTANT(1) << f))
13404                     continue;
13405                   proto_tree_add_uint_format_value(ba_bitmap_tree, hf_ieee80211_block_ack_bitmap_missing_frame,
13406                                                    tvb, offset + (f/8), 1, ssn + f, "%u", ssn + f);
13407                 }
13408                 /*offset += 8;*/
13409                 break;
13410               }
13411               case 3:  /* Multi-TID BlockAck */
13412               {
13413                 guint8 tid_count;
13414                 guint iii;
13415                 proto_tree *ba_mtid_tree, *ba_mtid_sub_tree;
13416
13417                 tid_count = ((ba_control & 0xF000) >> 12) + 1;
13418                 proto_tree_add_uint(ba_sub_tree,
13419                 hf_ieee80211_block_ack_control_compressed_tid_info, tvb, offset, 2, tid_count);
13420                 offset += 2;
13421
13422                 ba_parent_item = proto_tree_add_text (hdr_tree, tvb, offset, tid_count*4, "Per TID Info");
13423                 ba_mtid_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
13424                 for (iii = 0; iii < tid_count; iii++) {
13425                   ba_parent_item = proto_tree_add_uint(ba_mtid_tree, hf_ieee80211_block_ack_multi_tid_info, tvb, offset, 4, iii);
13426                   ba_mtid_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
13427
13428                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13429                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13430                   offset += 2;
13431
13432                   offset += add_fixed_field(ba_mtid_sub_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
13433                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
13434                   offset += 8;
13435                 }
13436                 break;
13437               }
13438             }
13439           }
13440           break;
13441         }
13442       }
13443       break;
13444     }
13445
13446     case DATA_FRAME:
13447     {
13448       guint32 src_offset, dst_offset, bssid_offset;
13449       addr_type = FCF_ADDR_SELECTOR (fcf);
13450
13451       /* In order to show src/dst address we must always do the following */
13452       switch (addr_type)
13453       {
13454
13455         case DATA_ADDR_T1:
13456           src_offset = 10;
13457           dst_offset = 4;
13458           bssid_offset = 16;
13459           break;
13460
13461         case DATA_ADDR_T2:
13462           src_offset = 16;
13463           dst_offset = 4;
13464           bssid_offset = 10;
13465           break;
13466
13467         case DATA_ADDR_T3:
13468           src_offset = 10;
13469           dst_offset = 16;
13470           bssid_offset = 4;
13471           break;
13472
13473         case DATA_ADDR_T4:
13474           src_offset = 24;
13475           dst_offset = 16;
13476           bssid_offset = 16;
13477           break;
13478         default:
13479           /* Should never happen? */
13480           src_offset = 0;
13481           dst_offset = 0;
13482           bssid_offset = 0;
13483           break;
13484       }
13485
13486       TVB_SET_ADDRESS_HF(&pinfo->dl_src, AT_ETHER, tvb, src_offset, 6, hf_ieee80211_addr_sa);
13487       COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->dl_src);
13488       TVB_SET_ADDRESS_HF(&pinfo->dl_dst, AT_ETHER, tvb, dst_offset, 6, hf_ieee80211_addr_da);
13489       COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->dl_dst);
13490
13491       /* for tap */
13492
13493       TVB_SET_ADDRESS_HF(&whdr->bssid, AT_ETHER, tvb, bssid_offset, 6, hf_ieee80211_addr_bssid);
13494       COPY_ADDRESS_SHALLOW(&whdr->src, &pinfo->dl_src);
13495       COPY_ADDRESS_SHALLOW(&whdr->dst, &pinfo->dl_dst);
13496       whdr->type = frame_type_subtype;
13497
13498       seq_control = tvb_get_letohs(tvb, 22);
13499       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
13500       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
13501
13502       col_append_fstr(pinfo->cinfo, COL_INFO,
13503             ", SN=%d, FN=%d", seq_number,frag_number);
13504
13505       /* Now if we have a tree we start adding stuff */
13506       if (tree)
13507       {
13508
13509         switch (addr_type)
13510         {
13511           /* XXX - using the offsets set above, could all of these cases be collapsed into one? */
13512           case DATA_ADDR_T1:
13513             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13514             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
13515             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13516             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
13517             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
13518             proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13519             proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13520
13521             /* add items for wlan.addr filter */
13522             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13523             PROTO_ITEM_SET_HIDDEN(hidden_item);
13524             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13525             PROTO_ITEM_SET_HIDDEN(hidden_item);
13526             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13527             PROTO_ITEM_SET_HIDDEN(hidden_item);
13528             break;
13529
13530           case DATA_ADDR_T2:
13531             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13532             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
13533             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13534             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 10, 6, ENC_NA);
13535             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 16, 6, ENC_NA);
13536             proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13537             proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13538
13539             /* add items for wlan.addr filter */
13540             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13541             PROTO_ITEM_SET_HIDDEN(hidden_item);
13542             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13543             PROTO_ITEM_SET_HIDDEN(hidden_item);
13544             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13545             PROTO_ITEM_SET_HIDDEN(hidden_item);
13546             break;
13547
13548           case DATA_ADDR_T3:
13549             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13550             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
13551             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13552             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
13553             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 16, 6, ENC_NA);
13554             proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13555             proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13556
13557             /* add items for wlan.addr filter */
13558             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13559             PROTO_ITEM_SET_HIDDEN(hidden_item);
13560             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13561             PROTO_ITEM_SET_HIDDEN(hidden_item);
13562             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13563             PROTO_ITEM_SET_HIDDEN(hidden_item);
13564             break;
13565
13566           case DATA_ADDR_T4:
13567             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13568             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13569             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 16, 6, ENC_NA);
13570             proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13571             proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13572             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 24, 6, ENC_NA);
13573
13574             /* add items for wlan.addr filter */
13575             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13576             PROTO_ITEM_SET_HIDDEN(hidden_item);
13577             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13578             PROTO_ITEM_SET_HIDDEN(hidden_item);
13579             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13580             PROTO_ITEM_SET_HIDDEN(hidden_item);
13581             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 24, 6, ENC_NA);
13582             PROTO_ITEM_SET_HIDDEN(hidden_item);
13583             break;
13584         }
13585
13586       }
13587       break;
13588     }
13589   }
13590
13591   len = tvb_length_remaining(tvb, hdr_len);
13592   reported_len = tvb_reported_length_remaining(tvb, hdr_len);
13593
13594   switch (fcs_len)
13595     {
13596       case 0: /* Definitely has no FCS */
13597         has_fcs = FALSE;
13598         break;
13599
13600       case 4: /* Definitely has an FCS */
13601         has_fcs = TRUE;
13602         break;
13603
13604       case -2: /* Data frames have no FCS, other frames have an FCS */
13605         if (FCF_FRAME_TYPE (fcf) == DATA_FRAME)
13606           has_fcs = FALSE;
13607         else
13608           has_fcs = TRUE;
13609         break;
13610
13611       default: /* Don't know - use "wlan_check_fcs" */
13612         has_fcs = wlan_check_fcs;
13613         break;
13614     }
13615   if (has_fcs)
13616     {
13617       /*
13618        * Well, this packet should, in theory, have an FCS.
13619        * Do we have the entire packet, and does it have enough data for
13620        * the FCS?
13621        */
13622       if (reported_len < 4)
13623       {
13624         /*
13625          * The packet is claimed not to even have enough data for a 4-byte
13626          * FCS.
13627          * Pretend it doesn't have an FCS.
13628          */
13629         ;
13630       }
13631       else if (len < reported_len)
13632       {
13633         /*
13634          * The packet is claimed to have enough data for a 4-byte FCS, but
13635          * we didn't capture all of the packet.
13636          * Slice off the 4-byte FCS from the reported length, and trim the
13637          * captured length so it's no more than the reported length; that
13638          * will slice off what of the FCS, if any, is in the captured
13639          * length.
13640          */
13641         reported_len -= 4;
13642         if (len > reported_len)
13643             len = reported_len;
13644       }
13645       else
13646       {
13647         /*
13648          * We have the entire packet, and it includes a 4-byte FCS.
13649          * Slice it off, and put it into the tree.
13650          */
13651         len          -= 4;
13652         reported_len -= 4;
13653         if (tree)
13654         {
13655           guint32 sent_fcs = tvb_get_ntohl(tvb, hdr_len + len);
13656           guint32 fcs;
13657
13658           if (datapad)
13659             fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
13660           else
13661             fcs = crc32_802_tvb(tvb, hdr_len + len);
13662           if (fcs == sent_fcs) {
13663             fcs_good = TRUE;
13664             fcs_bad = FALSE;
13665           } else {
13666             fcs_good = FALSE;
13667             fcs_bad = TRUE;
13668           }
13669
13670           fcs_item = proto_tree_add_item(hdr_tree, hf_ieee80211_fcs, tvb,
13671                 hdr_len + len, 4, ENC_LITTLE_ENDIAN);
13672           if (fcs_good) {
13673             proto_item_append_text(fcs_item, " [correct]");
13674           } else {
13675             proto_item_append_text(fcs_item, " [incorrect, should be 0x%08x]", fcs);
13676             flag_str[8] = '.';
13677           }
13678
13679           proto_tree_set_appendix(hdr_tree, tvb, hdr_len + len, 4);
13680
13681           fcs_tree = proto_item_add_subtree(fcs_item, ett_fcs);
13682
13683           fcs_item = proto_tree_add_boolean(fcs_tree,
13684               hf_ieee80211_fcs_good, tvb,
13685               hdr_len + len, 4,
13686               fcs_good);
13687           PROTO_ITEM_SET_GENERATED(fcs_item);
13688
13689           fcs_item = proto_tree_add_boolean(fcs_tree,
13690               hf_ieee80211_fcs_bad, tvb,
13691               hdr_len + len, 4,
13692               fcs_bad);
13693           PROTO_ITEM_SET_GENERATED(fcs_item);
13694         }
13695       }
13696     } else {
13697       flag_str[8] = '\0';
13698     }
13699
13700     proto_item_append_text(ti, ", Flags: %s", flag_str);
13701     col_append_fstr (pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
13702
13703
13704   /*
13705    * Only management and data frames have a body, so we don't have
13706    * anything more to do for other types of frames.
13707    */
13708   switch (FCF_FRAME_TYPE (fcf))
13709     {
13710
13711     case MGT_FRAME:
13712       if (htc_len == 4) {
13713         dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
13714       }
13715       break;
13716
13717     case DATA_FRAME:
13718       if (tree && DATA_FRAME_IS_QOS(frame_type_subtype))
13719       {
13720         proto_item *qos_fields, *qos_ti;
13721         proto_tree *qos_tree;
13722
13723         guint16 qos_eosp;
13724         guint16 qos_field_content;
13725
13726         qos_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_qos, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13727         qos_tree = proto_item_add_subtree (qos_fields, ett_qos_parameters);
13728
13729         qos_eosp = QOS_EOSP(qos_control);
13730         qos_field_content = QOS_FIELD_CONTENT(qos_control);
13731
13732         proto_tree_add_item(qos_tree, hf_ieee80211_qos_tid, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13733
13734         qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_priority, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13735         PROTO_ITEM_SET_GENERATED(qos_ti);
13736
13737         if (flags & FLAG_FROM_DS) {
13738           proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13739         } else {
13740           proto_tree_add_item(qos_tree, hf_ieee80211_qos_bit4, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13741         }
13742
13743         proto_tree_add_item(qos_tree, hf_ieee80211_qos_ack_policy, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13744
13745         if (flags & FLAG_FROM_DS) {
13746           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
13747             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13748             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
13749           }
13750           if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
13751             /* txop limit */
13752               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_limit, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13753             if (qos_field_content == 0) {
13754               proto_item_append_text(qos_ti, " (transmit one frame immediately)");
13755             }
13756           } else {
13757             /* qap ps buffer state */
13758             proto_item *qos_ps_buf_state_fields;
13759             proto_tree *qos_ps_buf_state_tree;
13760
13761             qos_ps_buf_state_fields = proto_tree_add_item(qos_tree, hf_ieee80211_qos_ps_buf_state, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13762             qos_ps_buf_state_tree = proto_item_add_subtree (qos_ps_buf_state_fields, ett_qos_ps_buf_state);
13763
13764             proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_buf_state_indicated, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13765
13766             if (QOS_PS_BUF_STATE_INDICATED(qos_field_content)) {
13767               proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_highest_pri_buf_ac, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13768               qos_ti = proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_qap_buf_load, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13769               switch (QOS_PS_QAP_BUF_LOAD(qos_field_content)) {
13770
13771               case 0:
13772                 proto_item_append_text(qos_ti, " (no buffered traffic)");
13773                 break;
13774
13775               default:
13776                 proto_item_append_text(qos_ti, " (%d octets)", QOS_PS_QAP_BUF_LOAD(qos_field_content)*4096);
13777                 break;
13778
13779               case 15:
13780                 proto_item_append_text(qos_ti, " (greater than 57344 octets)");
13781                 break;
13782               }
13783
13784             }
13785           }
13786         } else {
13787           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
13788             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13789             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
13790           }
13791           if (qos_eosp) {
13792             /* queue size */
13793             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_queue_size, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13794             switch (qos_field_content) {
13795             case 0:
13796               proto_item_append_text(qos_ti, " (no buffered traffic in the queue)");
13797               break;
13798
13799             default:
13800               proto_item_append_text(qos_ti, " (%u bytes)", qos_field_content*256);
13801               break;
13802
13803             case 254:
13804               proto_item_append_text(qos_ti, " (more than 64768 octets)");
13805               break;
13806
13807             case 255:
13808               proto_item_append_text(qos_ti, " (unspecified or unknown)");
13809               break;
13810             }
13811           } else {
13812             /* txop duration requested */
13813             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_dur_req,
13814                                    tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13815             if (qos_field_content == 0) {
13816               proto_item_append_text(qos_ti, " (no TXOP requested)");
13817             }
13818           }
13819         }
13820
13821         /* Do we have +HTC? */
13822         if (htc_len == 4) {
13823           dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
13824         }
13825
13826         if (meshctl_len != 0) {
13827           proto_item *msh_fields;
13828           proto_tree *msh_tree;
13829
13830           msh_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_mesh_control_field, tvb, meshoff, meshctl_len, ENC_NA);
13831           msh_tree = proto_item_add_subtree (msh_fields, ett_msh_control);
13832           add_fixed_field(msh_tree, tvb, pinfo, meshoff, FIELD_MESH_CONTROL);
13833         }
13834
13835       } /* end of qos control field */
13836       /* Davide Schiera (2006-11-21): process handshake packet with AirPDcap    */
13837       /* the processing will take care of 4-way handshake sessions for WPA    */
13838       /* and WPA2 decryption                                  */
13839       if (enable_decryption && !pinfo->fd->flags.visited) {
13840         const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
13841         AirPDcapPacketProcess(&airpdcap_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE, FALSE);
13842       }
13843       /* Davide Schiera --------------------------------------------------------  */
13844
13845       /*
13846        * No-data frames don't have a body.
13847        */
13848       if (DATA_FRAME_IS_NULL(frame_type_subtype))
13849         return;
13850
13851       if (!wlan_subdissector) {
13852         guint fnum = 0;
13853
13854         /* key: bssid:src
13855          * data: last seq_control seen and frame number
13856          */
13857         retransmitted = FALSE;
13858         if (!pinfo->fd->flags.visited) {
13859           retransmit_key key;
13860           retransmit_key *result;
13861
13862           memcpy(key.bssid, bssid, 6);
13863           memcpy(key.src, src, 6);
13864           key.seq_control = 0;
13865           result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
13866           if (result && (result->seq_control == seq_control)) {
13867             /* keep a pointer to the first seen frame, could be done with proto data? */
13868             fnum = result->fnum;
13869             g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER(pinfo->fd->num),
13870                                 GINT_TO_POINTER(fnum));
13871             retransmitted = TRUE;
13872           } else {
13873             /* first time or new seq*/
13874             if (!result) {
13875               result = se_new(retransmit_key);
13876               *result = key;
13877               g_hash_table_insert(fc_analyse_retransmit_table, result, result);
13878             }
13879             result->seq_control = seq_control;
13880             result->fnum =  pinfo->fd->num;
13881           }
13882         }
13883         else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER(pinfo->fd->num))))) {
13884           retransmitted = TRUE;
13885         }
13886
13887         if (retransmitted) {
13888           col_append_str(pinfo->cinfo, COL_INFO, " [retransmitted]");
13889           if (tree) {
13890             proto_item *item;
13891
13892             item=proto_tree_add_none_format(hdr_tree, hf_ieee80211_fc_analysis_retransmission, tvb, 0, 0,
13893                                             "Retransmitted frame");
13894             PROTO_ITEM_SET_GENERATED(item);
13895             item=proto_tree_add_uint(hdr_tree, hf_ieee80211_fc_analysis_retransmission_frame,tvb, 0, 0, fnum);
13896             PROTO_ITEM_SET_GENERATED(item);
13897           }
13898           next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
13899           call_dissector(data_handle, next_tvb, pinfo, tree);
13900           goto end_of_wlan;
13901         }
13902       }
13903
13904       break;
13905
13906     case CONTROL_FRAME:
13907       return;
13908
13909     default:
13910       return;
13911     }
13912
13913   if (IS_PROTECTED(FCF_FLAGS(fcf))
13914       && !pinfo->pseudo_header->ieee_802_11.decrypted
13915       && (wlan_ignore_wep != WLAN_IGNORE_WEP_WO_IV)) {
13916     /*
13917      * It's a WEP or WPA encrypted frame, and it hasn't already been
13918      * decrypted; dissect the protections parameters and decrypt the data,
13919      * if we have a matching key. Otherwise display it as data.
13920      */
13921
13922     gboolean    can_decrypt = FALSE;
13923     proto_tree *wep_tree    = NULL;
13924     guint32     iv;
13925     guint8      key, keybyte;
13926
13927     /* Davide Schiera (2006-11-27): define algorithms constants and macros  */
13928 #define PROTECTION_ALG_WEP  AIRPDCAP_KEY_TYPE_WEP
13929 #define PROTECTION_ALG_TKIP  AIRPDCAP_KEY_TYPE_TKIP
13930 #define PROTECTION_ALG_CCMP  AIRPDCAP_KEY_TYPE_CCMP
13931 #define PROTECTION_ALG_RSNA  PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
13932     guint8 algorithm=G_MAXUINT8;
13933     /* Davide Schiera (2006-11-27): added macros to check the algorithm    */
13934     /* used could be TKIP or CCMP                            */
13935 #define IS_TKIP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 1) == \
13936   ((tvb_get_guint8(tvb, hdr_len) | 0x20) & 0x7f))
13937 #define IS_CCMP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 2) == 0)
13938     /* Davide Schiera -----------------------------------------------------  */
13939
13940     /* Davide Schiera (2006-11-21): recorded original lengths to pass them  */
13941     /* to the packets process function                        */
13942     guint32 sec_header=0;
13943     guint32 sec_trailer=0;
13944
13945     next_tvb = try_decrypt(tvb, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer);
13946     /* Davide Schiera -----------------------------------------------------  */
13947
13948     keybyte = tvb_get_guint8(tvb, hdr_len + 3);
13949     key = KEY_OCTET_WEP_KEY(keybyte);
13950     if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
13951       /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
13952       if (tree) {
13953         proto_item *extiv_fields;
13954
13955         /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if  */
13956         /* it's possible                                */
13957         if (algorithm==PROTECTION_ALG_TKIP)
13958           extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13959               "TKIP parameters");
13960         else if (algorithm==PROTECTION_ALG_CCMP)
13961           extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13962             "CCMP parameters");
13963         else {
13964           /* Davide Schiera --------------------------------------------  */
13965           /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if*/
13966           /* it's possible                              */
13967           if (IS_TKIP(tvb, hdr_len)) {
13968             algorithm=PROTECTION_ALG_TKIP;
13969             extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13970                 "TKIP parameters");
13971           } else if (IS_CCMP(tvb, hdr_len)) {
13972             algorithm=PROTECTION_ALG_CCMP;
13973             extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13974                 "CCMP parameters");
13975           } else
13976             extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13977                 "TKIP/CCMP parameters");
13978         }
13979         proto_item_set_len (ti, hdr_len + 8);
13980
13981         wep_tree = proto_item_add_subtree (extiv_fields, ett_wep_parameters);
13982
13983         if (algorithm==PROTECTION_ALG_TKIP) {
13984           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
13985               tvb_get_letohl(tvb, hdr_len + 4),
13986               tvb_get_guint8(tvb, hdr_len),
13987               tvb_get_guint8(tvb, hdr_len + 2));
13988           proto_tree_add_string(wep_tree, hf_ieee80211_tkip_extiv, tvb, hdr_len,
13989               EXTIV_LEN, out_buff);
13990         } else if (algorithm==PROTECTION_ALG_CCMP) {
13991           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
13992               tvb_get_letohl(tvb, hdr_len + 4),
13993               tvb_get_guint8(tvb, hdr_len + 1),
13994               tvb_get_guint8(tvb, hdr_len));
13995           proto_tree_add_string(wep_tree, hf_ieee80211_ccmp_extiv, tvb, hdr_len,
13996               EXTIV_LEN, out_buff);
13997         }
13998
13999         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
14000       }
14001
14002       /* Subtract out the length of the IV. */
14003       len          -= EXTIV_LEN;
14004       reported_len -= EXTIV_LEN;
14005       ivlen         = EXTIV_LEN;
14006       /* It is unknown whether this is TKIP or CCMP, so let's not even try to
14007        * parse TKIP Michael MIC+ICV or CCMP MIC. */
14008
14009       /* Davide Schiera (2006-11-21): enable TKIP and CCMP decryption      */
14010       /* checking for the trailer                            */
14011       if (next_tvb!=NULL) {
14012         if (reported_len < (gint) sec_trailer) {
14013           /* There is no space for a trailer, ignore it and don't decrypt  */
14014           ;
14015         } else if (len < reported_len) {
14016           /* There is space for a trailer, but we haven't capture all the  */
14017           /* packet. Slice off the trailer, but don't try to decrypt      */
14018           reported_len -= sec_trailer;
14019           if (len > reported_len)
14020             len = reported_len;
14021         } else {
14022           /* Ok, we have a trailer and the whole packet. Decrypt it!      */
14023           /* TODO: At the moment we won't add the trailer to the tree,    */
14024           /* so don't remove the trailer from the packet                  */
14025           len          -= sec_trailer;
14026           reported_len -= sec_trailer;
14027           can_decrypt   = TRUE;
14028         }
14029       }
14030       /* Davide Schiera --------------------------------------------------  */
14031     } else {
14032       /* No Ext. IV - WEP packet */
14033       /*
14034        * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
14035        * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
14036        * them itself.
14037        *
14038        * Also, just pass the data *following* the WEP parameters as the
14039        * buffer to decrypt.
14040        */
14041       iv = tvb_get_ntoh24(tvb, hdr_len);
14042       if (tree) {
14043         proto_item *wep_fields;
14044
14045         wep_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 4,
14046             "WEP parameters");
14047
14048         wep_tree = proto_item_add_subtree (wep_fields, ett_wep_parameters);
14049         proto_tree_add_uint (wep_tree, hf_ieee80211_wep_iv, tvb, hdr_len, 3, iv);
14050         tvb_memcpy(tvb, iv_buff, hdr_len, 3);
14051         is_iv_bad = weak_iv(iv_buff);
14052         if (is_iv_bad != -1) {
14053           proto_tree_add_boolean_format (wep_tree, hf_ieee80211_wep_iv_weak,
14054               tvb, 0, 0, TRUE,
14055               "Weak IV for key byte %d",
14056               is_iv_bad);
14057         }
14058       }
14059       if (tree)
14060         proto_tree_add_uint (wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
14061
14062       /* Subtract out the length of the IV. */
14063       len          -= 4;
14064       reported_len -= 4;
14065       ivlen         = 4;
14066
14067       /* Davide Schiera (2006-11-27): Even if the decryption was not */
14068       /* successful, set the algorithm                               */
14069       algorithm=PROTECTION_ALG_WEP;
14070
14071       /*
14072        * Well, this packet should, in theory, have an ICV.
14073        * Do we have the entire packet, and does it have enough data for
14074        * the ICV?
14075        */
14076       if (reported_len < 4) {
14077         /*
14078          * The packet is claimed not to even have enough data for a
14079          * 4-byte ICV.
14080          * Pretend it doesn't have an ICV.
14081          */
14082         ;
14083       } else if (len < reported_len) {
14084         /*
14085          * The packet is claimed to have enough data for a 4-byte ICV,
14086          * but we didn't capture all of the packet.
14087          * Slice off the 4-byte ICV from the reported length, and trim
14088          * the captured length so it's no more than the reported length;
14089          * that will slice off what of the ICV, if any, is in the
14090          * captured length.
14091          */
14092         reported_len -= 4;
14093         if (len > reported_len)
14094           len         = reported_len;
14095       } else {
14096         /*
14097          * We have the entire packet, and it includes a 4-byte ICV.
14098          * Slice it off, and put it into the tree.
14099          *
14100          * We only support decrypting if we have the the ICV.
14101          *
14102          * XXX - the ICV is encrypted; we're putting the encrypted
14103          * value, not the decrypted value, into the tree.
14104          */
14105         len          -= 4;
14106         reported_len -= 4;
14107         can_decrypt   = TRUE;
14108       }
14109     }
14110
14111     if (algorithm == PROTECTION_ALG_WEP) {
14112       g_strlcpy (wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
14113     } else if (algorithm == PROTECTION_ALG_TKIP) {
14114       g_strlcpy (wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
14115     } else if (algorithm == PROTECTION_ALG_CCMP) {
14116       g_strlcpy (wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
14117     } else {
14118       g_strlcpy (wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
14119     }
14120
14121     /* Davide Schiera (2006-11-26): decrypted before parsing header and    */
14122     /* protection header                                  */
14123     if (!can_decrypt || (next_tvb == NULL)) {
14124       /*
14125        * WEP decode impossible or failed, treat payload as raw data
14126        * and don't attempt fragment reassembly or further dissection.
14127        */
14128       next_tvb = tvb_new_subset(tvb, hdr_len + ivlen, len, reported_len);
14129
14130       if (tree) {
14131         /* Davide Schiera (2006-11-21): added WEP or WPA separation      */
14132         if (algorithm == PROTECTION_ALG_WEP) {
14133           if (can_decrypt)
14134             proto_tree_add_uint_format (wep_tree, hf_ieee80211_wep_icv, tvb,
14135                 hdr_len + ivlen + len, 4,
14136                 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
14137                 "WEP ICV: 0x%08x (not verified)",
14138                 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
14139         } else if (algorithm == PROTECTION_ALG_CCMP) {
14140         } else if (algorithm == PROTECTION_ALG_TKIP) {
14141         }
14142       }
14143       /* Davide Schiera (2006-11-21) ----------------------------------  */
14144
14145       if ((pinfo->ethertype != ETHERTYPE_CENTRINO_PROMISC) && (wlan_ignore_wep == WLAN_IGNORE_WEP_NO)) {
14146         /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
14147         call_dissector(data_handle, next_tvb, pinfo, tree);
14148         goto end_of_wlan;
14149       }
14150     } else {
14151       /* Davide Schiera (2006-11-21): added WEP or WPA separation        */
14152       if (algorithm == PROTECTION_ALG_WEP) {
14153         if (tree)
14154           proto_tree_add_uint_format (wep_tree, hf_ieee80211_wep_icv, tvb,
14155               hdr_len + ivlen + len, 4,
14156               tvb_get_ntohl(tvb, hdr_len + ivlen + len),
14157               "WEP ICV: 0x%08x (correct)",
14158               tvb_get_ntohl(tvb, hdr_len + ivlen + len));
14159
14160         add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
14161       } else if (algorithm==PROTECTION_ALG_CCMP) {
14162         add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
14163       } else if (algorithm==PROTECTION_ALG_TKIP) {
14164         add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
14165       }
14166       /* Davide Schiera (2006-11-21) -------------------------------------  */
14167       /* Davide Schiera (2006-11-27): undefine macros and definitions  */
14168 #undef IS_TKIP
14169 #undef IS_CCMP
14170 #undef PROTECTION_ALG_CCMP
14171 #undef PROTECTION_ALG_TKIP
14172 #undef PROTECTION_ALG_WEP
14173       /* Davide Schiera --------------------------------------------------  */
14174     }
14175
14176     /*
14177      * WEP decryption successful!
14178      *
14179      * Use the tvbuff we got back from the decryption; the data starts at
14180      * the beginning.  The lengths are already correct for the decoded WEP
14181      * payload.
14182      */
14183     hdr_len = 0;
14184
14185   } else {
14186     /*
14187      * Not a WEP-encrypted frame; just use the data from the tvbuff
14188      * handed to us.
14189      *
14190      * The payload starts at "hdr_len" (i.e., just past the 802.11
14191      * MAC header), the length of data in the tvbuff following the
14192      * 802.11 header is "len", and the length of data in the packet
14193      * following the 802.11 header is "reported_len".
14194      */
14195     next_tvb = tvb;
14196   }
14197
14198   /*
14199    * Do defragmentation if "wlan_defragment" is true, and we have more
14200    * fragments or this isn't the first fragment.
14201    *
14202    * We have to do some special handling to catch frames that
14203    * have the "More Fragments" indicator not set but that
14204    * don't show up as reassembled and don't have any other
14205    * fragments present.  Some networking interfaces appear
14206    * to do reassembly even when you're capturing raw packets
14207    * *and* show the reassembled packet without the "More
14208    * Fragments" indicator set *but* with a non-zero fragment
14209    * number.
14210    *
14211    * "fragment_add_seq_802_11()" handles that; we want to call it
14212    * even if we have a short frame, so that it does those checks - if
14213    * the frame is short, it doesn't do reassembly on it.
14214    *
14215    * (This could get some false positives if we really *did* only
14216    * capture the last fragment of a fragmented packet, but that's
14217    * life.)
14218    */
14219   save_fragmented = pinfo->fragmented;
14220   if (wlan_defragment && (more_frags || (frag_number != 0))) {
14221     fragment_data *fd_head;
14222
14223     /*
14224      * If we've already seen this frame, look it up in the
14225      * table of reassembled packets, otherwise add it to
14226      * whatever reassembly is in progress, if any, and see
14227      * if it's done.
14228      */
14229     if (reported_len < 0)
14230       THROW(ReportedBoundsError);
14231     fd_head = fragment_add_seq_802_11(&wlan_reassembly_table,
14232         next_tvb, hdr_len, pinfo, seq_number, NULL,
14233         frag_number,
14234         reported_len,
14235         more_frags);
14236     next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
14237         "Reassembled 802.11", fd_head,
14238         &frag_items, NULL, hdr_tree);
14239   } else {
14240     /*
14241      * If this is the first fragment, dissect its contents, otherwise
14242      * just show it as a fragment.
14243      */
14244     if (frag_number != 0) {
14245       /* Not the first fragment - don't dissect it. */
14246       next_tvb = NULL;
14247     } else {
14248       /* First fragment, or not fragmented.  Dissect what we have here. */
14249
14250       /* Get a tvbuff for the payload. */
14251       next_tvb = tvb_new_subset (next_tvb, hdr_len, len, reported_len);
14252
14253       /*
14254        * If this is the first fragment, but not the only fragment,
14255        * tell the next protocol that.
14256        */
14257       if (more_frags)
14258         pinfo->fragmented = TRUE;
14259       else
14260         pinfo->fragmented = FALSE;
14261     }
14262   }
14263
14264   if (next_tvb == NULL) {
14265     /* Just show this as an incomplete fragment. */
14266     col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
14267     next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
14268     call_dissector(data_handle, next_tvb, pinfo, tree);
14269     pinfo->fragmented = save_fragmented;
14270     goto end_of_wlan;
14271   }
14272
14273   switch (FCF_FRAME_TYPE (fcf))
14274     {
14275
14276     case MGT_FRAME:
14277       dissect_ieee80211_mgt (fcf, next_tvb, pinfo, tree);
14278       break;
14279
14280     case DATA_FRAME:
14281       if (is_amsdu && (tvb_reported_length_remaining(next_tvb, 0) > 4)) {
14282         proto_item   *parent_item;
14283         proto_tree   *mpdu_tree;
14284         guint32       msdu_offset = 0;
14285         guint         i           = 1;
14286
14287         parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
14288                                     tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
14289         mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
14290
14291         do {
14292           tvbuff_t *volatile  msdu_tvb;
14293           guint16             msdu_length;
14294           proto_tree         *subframe_tree;
14295
14296           msdu_length = tvb_get_ntohs (next_tvb, msdu_offset+12);
14297
14298           parent_item = proto_tree_add_item(mpdu_tree, hf_ieee80211_amsdu_subframe, next_tvb,
14299                             msdu_offset, roundup2(msdu_offset+14+msdu_length, 4), ENC_NA);
14300           proto_item_append_text(parent_item, " #%u", i);
14301           subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
14302           i += 1;
14303
14304           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_da, next_tvb, msdu_offset, 6, ENC_NA);
14305           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_sa, next_tvb, msdu_offset+6, 6, ENC_NA);
14306           proto_tree_add_item(subframe_tree, hf_ieee80211_amsdu_length, next_tvb, msdu_offset+12, 2, ENC_BIG_ENDIAN);
14307
14308           msdu_offset += 14;
14309           msdu_tvb = tvb_new_subset(next_tvb, msdu_offset, msdu_length, -1);
14310           call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
14311           msdu_offset = roundup2(msdu_offset+msdu_length, 4);
14312         } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
14313
14314         break;
14315       }
14316       /* I guess some bridges take Netware Ethernet_802_3 frames,
14317          which are 802.3 frames (with a length field rather than
14318          a type field, but with no 802.2 header in the payload),
14319          and just stick the payload into an 802.11 frame.  I've seen
14320          captures that show frames of that sort.
14321
14322          We also handle some odd form of encapsulation in which a
14323          complete Ethernet frame is encapsulated within an 802.11
14324          data frame, with no 802.2 header.  This has been seen
14325          from some hardware.
14326
14327          On top of that, at least at some point it appeared that
14328          the OLPC XO sent out frames with two bytes of 0 between
14329          the "end" of the 802.11 header and the beginning of
14330          the payload.
14331
14332          So, if the packet doesn't start with 0xaa 0xaa:
14333
14334            we first use the same scheme that linux-wlan-ng does to detect
14335            those encapsulated Ethernet frames, namely looking to see whether
14336            the frame either starts with 6 octets that match the destination
14337            address from the 802.11 header or has 6 octets that match the
14338            source address from the 802.11 header following the first 6 octets,
14339            and, if so, treat it as an encapsulated Ethernet frame;
14340
14341            otherwise, we use the same scheme that we use in the Ethernet
14342            dissector to recognize Netware 802.3 frames, namely checking
14343            whether the packet starts with 0xff 0xff and, if so, treat it
14344            as an encapsulated IPX frame, and then check whether the
14345            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
14346            frame. */
14347       encap_type = ENCAP_802_2;
14348       if (tvb_bytes_exist(next_tvb, 0, 2)) {
14349         octet1 = tvb_get_guint8(next_tvb, 0);
14350         octet2 = tvb_get_guint8(next_tvb, 1);
14351         if ((octet1 != 0xaa) || (octet2 != 0xaa)) {
14352           if ((tvb_memeql(next_tvb, 6, (const guint8 *)pinfo->dl_src.data, 6) == 0) ||
14353               (tvb_memeql(next_tvb, 0, (const guint8 *)pinfo->dl_dst.data, 6) == 0))
14354             encap_type = ENCAP_ETHERNET;
14355           else if ((octet1 == 0xff) && (octet2 == 0xff))
14356             encap_type = ENCAP_IPX;
14357           else if ((octet1 == 0x00) && (octet2 == 0x00)) {
14358             proto_tree_add_text(tree, next_tvb, 0, 2, "Mysterious OLPC stuff");
14359             next_tvb = tvb_new_subset_remaining (next_tvb, 2);
14360           }
14361         }
14362       }
14363
14364       switch (encap_type) {
14365
14366       case ENCAP_802_2:
14367         call_dissector(llc_handle, next_tvb, pinfo, tree);
14368         break;
14369
14370       case ENCAP_ETHERNET:
14371         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
14372         break;
14373
14374       case ENCAP_IPX:
14375         call_dissector(ipx_handle, next_tvb, pinfo, tree);
14376         break;
14377       }
14378       break;
14379     }
14380   pinfo->fragmented = save_fragmented;
14381
14382   end_of_wlan:
14383   whdr->stats = wlan_stats;
14384   tap_queue_packet(wlan_tap, pinfo, whdr);
14385   memset (&wlan_stats, 0, sizeof wlan_stats);
14386 }
14387
14388 /*
14389  * Dissect 802.11 with a variable-length link-layer header.
14390  */
14391 static void
14392 dissect_ieee80211 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14393 {
14394   dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
14395                             pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, FALSE);
14396 }
14397
14398 /*
14399  * Dissect 802.11 with a variable-length link-layer header and data padding.
14400  */
14401 static void
14402 dissect_ieee80211_datapad (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14403 {
14404   dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
14405                             pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, TRUE, FALSE);
14406 }
14407
14408 /*
14409  * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
14410  * control field (some hardware sends out LWAPP-encapsulated 802.11
14411  * packets with the control field byte swapped).
14412  */
14413 static void
14414 dissect_ieee80211_bsfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14415 {
14416   dissect_ieee80211_common (tvb, pinfo, tree, FALSE, 0, TRUE, FALSE, FALSE);
14417 }
14418
14419 /*
14420  * Dissect 802.11 with a fixed-length link-layer header (padded to the
14421  * maximum length).
14422  */
14423 static void
14424 dissect_ieee80211_fixed (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14425 {
14426   dissect_ieee80211_common (tvb, pinfo, tree, TRUE, 0, FALSE, FALSE, FALSE);
14427 }
14428
14429 /*
14430  * Dissect an HT 802.11 frame with a variable-length link-layer header.
14431  * XXX - Can we tell if a frame is +HTC just by looking at the MAC header?
14432  * If so, we can dispense with this.
14433  */
14434 static void
14435 dissect_ieee80211_ht (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14436 {
14437   dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
14438                             pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, TRUE);
14439 }
14440
14441 static void
14442 wlan_defragment_init(void)
14443 {
14444   reassembly_table_init(&wlan_reassembly_table,
14445                         &addresses_reassembly_table_functions);
14446 }
14447
14448 /* ------------- */
14449 static guint
14450 retransmit_hash(gconstpointer k)
14451 {
14452   const retransmit_key *key = (const retransmit_key *)k;
14453   guint hash_val;
14454   int   i;
14455
14456   hash_val = 0;
14457   for (i = 0; i < 6; i++)
14458     hash_val += key->bssid[i];
14459
14460   for (i = 0; i < 6; i++)
14461     hash_val += key->src[i];
14462
14463   return hash_val;
14464 }
14465
14466 static gint
14467 retransmit_equal(gconstpointer k1, gconstpointer k2)
14468 {
14469   const retransmit_key *key1 = (const retransmit_key *)k1;
14470   const retransmit_key *key2 = (const retransmit_key *)k2;
14471
14472   return ((!memcmp(key1->bssid, key2->bssid, 6) && !memcmp(key1->src, key2->src, 6)) ? TRUE:FALSE);
14473 }
14474
14475 static guint
14476 frame_hash(gconstpointer k)
14477 {
14478   guint32 frame = GPOINTER_TO_UINT(k);
14479
14480   return frame;
14481 }
14482
14483 static gint
14484 frame_equal(gconstpointer k1, gconstpointer k2)
14485 {
14486   guint32 frame1 = GPOINTER_TO_UINT(k1);
14487   guint32 frame2 = GPOINTER_TO_UINT(k2);
14488
14489   return frame1==frame2;
14490 }
14491
14492 /* Davide Schiera (2006-11-26): this function will try to decrypt with WEP or  */
14493 /* WPA and return a tvb to the caller to add a new tab. It returns the    */
14494 /* algorithm used for decryption (WEP, TKIP, CCMP) and the header and    */
14495 /* trailer lengths.                                      */
14496 static tvbuff_t *
14497 try_decrypt(tvbuff_t *tvb, guint offset, guint len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer)
14498 {
14499   const guint8      *enc_data;
14500   tvbuff_t          *decr_tvb = NULL;
14501   guint32            dec_caplen;
14502   guchar             dec_data[AIRPDCAP_MAX_CAPLEN];
14503   AIRPDCAP_KEY_ITEM  used_key;
14504
14505   if (!enable_decryption)
14506     return NULL;
14507
14508   /* get the entire packet                                  */
14509   enc_data = tvb_get_ptr(tvb, 0, len+offset);
14510
14511   /*  process packet with AirPDcap                              */
14512   if (AirPDcapPacketProcess(&airpdcap_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen,
14513                             &used_key, FALSE, TRUE)==AIRPDCAP_RET_SUCCESS)
14514   {
14515     guint8 *tmp;
14516     *algorithm=used_key.KeyType;
14517     switch (*algorithm) {
14518       case AIRPDCAP_KEY_TYPE_WEP:
14519         *sec_header=AIRPDCAP_WEP_HEADER;
14520         *sec_trailer=AIRPDCAP_WEP_TRAILER;
14521         break;
14522       case AIRPDCAP_KEY_TYPE_CCMP:
14523         *sec_header=AIRPDCAP_RSNA_HEADER;
14524         *sec_trailer=AIRPDCAP_CCMP_TRAILER;
14525         break;
14526       case AIRPDCAP_KEY_TYPE_TKIP:
14527         *sec_header=AIRPDCAP_RSNA_HEADER;
14528         *sec_trailer=AIRPDCAP_TKIP_TRAILER;
14529         break;
14530       default:
14531         return NULL;
14532     }
14533
14534     /* allocate buffer for decrypted payload                      */
14535     tmp = (guint8 *)g_memdup(dec_data+offset, dec_caplen-offset);
14536
14537     len = dec_caplen-offset;
14538
14539     /* decrypt successful, let's set up a new data tvb.              */
14540     decr_tvb = tvb_new_child_real_data(tvb, tmp, len, len);
14541     tvb_set_free_cb(decr_tvb, g_free);
14542   }
14543
14544   return decr_tvb;
14545 }
14546 /*  Davide Schiera -----------------------------------------------------------  */
14547
14548
14549 /* Collect our WEP and WPA keys */
14550 static void
14551 set_airpdcap_keys(void)
14552 {
14553   PAIRPDCAP_KEYS_COLLECTION  keys;
14554   GByteArray                *bytes = NULL;
14555   guint                      i;
14556
14557   keys = (PAIRPDCAP_KEYS_COLLECTION)se_alloc(sizeof(AIRPDCAP_KEYS_COLLECTION));
14558   keys->nKeys = 0;
14559
14560   for (i = 0; (uat_wep_key_records != NULL) && (i < num_wepkeys_uat) && (i < MAX_ENCRYPTION_KEYS); i++)
14561   {
14562     decryption_key_t *dk;
14563     dk = parse_key_string(uat_wep_key_records[i].string, uat_wep_key_records[i].key);
14564
14565     if (dk != NULL)
14566     {
14567       AIRPDCAP_KEY_ITEM          key;
14568       if (dk->type == AIRPDCAP_KEY_TYPE_WEP)
14569       {
14570         gboolean res;
14571         key.KeyType = AIRPDCAP_KEY_TYPE_WEP;
14572
14573         bytes = g_byte_array_new();
14574         res = hex_str_to_bytes(dk->key->str, bytes, FALSE);
14575
14576         if (dk->key->str && res && (bytes->len > 0) && (bytes->len <= AIRPDCAP_WEP_KEY_MAXLEN))
14577         {
14578           /*
14579            * WEP key is correct (well, the can be even or odd, so it is not
14580            * a real check, I think... is a check performed somewhere in the
14581            * AirPDcap function???)
14582            */
14583           memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
14584           key.KeyData.Wep.WepKeyLen = bytes->len;
14585           keys->Keys[keys->nKeys] = key;
14586           keys->nKeys += 1;
14587         }
14588       }
14589       else if (dk->type == AIRPDCAP_KEY_TYPE_WPA_PWD)
14590       {
14591         key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PWD;
14592
14593         /* XXX - This just lops the end if the key off if it's too long.
14594          *       Should we handle this more gracefully? */
14595         g_strlcpy(key.UserPwd.Passphrase, dk->key->str, AIRPDCAP_WPA_PASSPHRASE_MAX_LEN+1);
14596
14597         key.UserPwd.SsidLen = 0;
14598         if ((dk->ssid != NULL) && (dk->ssid->len <= AIRPDCAP_WPA_SSID_MAX_LEN))
14599         {
14600           memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
14601           key.UserPwd.SsidLen = dk->ssid->len;
14602         }
14603
14604         keys->Keys[keys->nKeys] = key;
14605         keys->nKeys += 1;
14606       }
14607       else if (dk->type == AIRPDCAP_KEY_TYPE_WPA_PSK)
14608       {
14609         key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PSK;
14610
14611         bytes = g_byte_array_new();
14612         hex_str_to_bytes(dk->key->str, bytes, FALSE);
14613
14614         /* XXX - Pass the correct array of bytes... */
14615         if (bytes->len <= AIRPDCAP_WPA_PSK_LEN) {
14616           memcpy(key.KeyData.Wpa.Psk, bytes->data, bytes->len);
14617
14618           keys->Keys[keys->nKeys] = key;
14619           keys->nKeys += 1;
14620         }
14621       }
14622     }
14623   }
14624
14625   /* Now set the keys */
14626   AirPDcapSetKeys(&airpdcap_ctx, keys->Keys, keys->nKeys);
14627   if (bytes)
14628     g_byte_array_free(bytes, TRUE);
14629
14630 }
14631
14632 static void
14633 init_wepkeys(void)
14634 {
14635
14636   /*
14637    * XXX - AirPDcap - That God sends it to us beautiful (che dio ce la mandi bona)
14638    * The next lines will add a key to the AirPDcap context. The keystring will be added
14639    * to the old WEP array too, but we don't care, because the packets will come here
14640    * already decrypted... One of these days we will fix this too
14641    */
14642   set_airpdcap_keys();
14643 }
14644
14645 /*
14646  * This code had been taken from AirSnort crack.c function classify()
14647  * Permission granted by snax <at> shmoo dot com
14648  * weak_iv - determine which key byte an iv is useful in resolving
14649  * parm     - p, pointer to the first byte of an IV
14650  * return   -  n - this IV is weak for byte n of a WEP key
14651  *            -1 - this IV is not weak for any key bytes
14652  *
14653  * This function tests for IVs that are known to satisfy the criteria
14654  * for a weak IV as specified in FMS section 7.1
14655  *
14656  */
14657 static int
14658 weak_iv(guchar *iv)
14659 {
14660   guchar sum, k;
14661
14662   if ((iv[1] == 255) && (iv[0] > 2) && (iv[0] < 16)) {
14663     return iv[0] -3;
14664   }
14665
14666   sum = iv[0] + iv[1];
14667   if (sum == 1) {
14668     if (iv[2] <= 0x0a) {
14669       return iv[2] +2;
14670     }
14671     else if (iv[2] == 0xff) {
14672       return 0;
14673     }
14674   }
14675   k = 0xfe - iv[2];
14676   if ((sum == k)  && ((iv[2] >= 0xf2) && (iv[2] <= 0xfe) && (iv[2] != 0xfd))) {
14677     return k;
14678   }
14679   return -1;
14680 }
14681
14682 static void
14683 wlan_retransmit_init(void)
14684 {
14685   if (fc_analyse_retransmit_table) {
14686     g_hash_table_destroy(fc_analyse_retransmit_table);
14687     fc_analyse_retransmit_table = NULL;
14688   }
14689
14690   if (fc_first_frame_table) {
14691     g_hash_table_destroy(fc_first_frame_table);
14692     fc_first_frame_table = NULL;
14693   }
14694
14695   if (wlan_subdissector)
14696     return;
14697
14698   fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
14699   fc_first_frame_table = g_hash_table_new(frame_hash, frame_equal);
14700
14701 }
14702
14703 static void
14704 dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14705 {
14706   int         offset = 0;
14707   guint8      type;
14708   int         tagged_parameter_tree_len;
14709   proto_tree *tagged_tree;
14710
14711   type = tvb_get_guint8(tvb, offset);
14712   proto_tree_add_item(tree, hf_ieee80211_data_encap_payload_type, tvb, offset,
14713                       1, ENC_BIG_ENDIAN);
14714   offset += 1;
14715   switch (type) {
14716   case 1:
14717     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRB");
14718     /* TODO: IEEE 802.11r */
14719     break;
14720   case 2:
14721     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
14722     col_clear(pinfo->cinfo, COL_INFO);
14723     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_ACTION);
14724     tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
14725     if (tagged_parameter_tree_len > 0) {
14726       tagged_tree = get_tagged_parameter_tree(tree, tvb, offset,
14727                                               tagged_parameter_tree_len);
14728       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
14729                                        tagged_parameter_tree_len, -1);
14730     }
14731     break;
14732   }
14733 }
14734
14735 void
14736 proto_register_ieee80211 (void)
14737 {
14738
14739   static hf_register_info hf[] = {
14740     {&hf_ieee80211_fc_field,
14741      {"Frame Control Field", "wlan.fc",
14742       FT_UINT16, BASE_HEX, NULL, 0,
14743       "MAC Frame control", HFILL }},
14744
14745     {&hf_ieee80211_fc_proto_version,
14746      {"Version", "wlan.fc.version",
14747       FT_UINT8, BASE_DEC, NULL, 0x03,
14748       "MAC Protocol version", HFILL }},  /* 0 */
14749
14750     {&hf_ieee80211_fc_frame_type,
14751      {"Type", "wlan.fc.type",
14752       FT_UINT8, BASE_DEC, VALS(frame_type), 0x0C,
14753       "Frame type", HFILL }},
14754
14755     {&hf_ieee80211_fc_frame_subtype,
14756      {"Subtype", "wlan.fc.subtype",
14757       FT_UINT8, BASE_DEC, NULL, 0xF0,
14758       "Frame subtype", HFILL }},  /* 2 */
14759
14760     {&hf_ieee80211_fc_frame_type_subtype,
14761      {"Type/Subtype", "wlan.fc.type_subtype",
14762       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &frame_type_subtype_vals_ext, 0x0,
14763       "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
14764
14765     {&hf_ieee80211_fc_flags,
14766      {"Flags", "wlan.flags",
14767       FT_UINT8, BASE_HEX, NULL, 0,
14768       NULL, HFILL }},
14769
14770     {&hf_ieee80211_fc_data_ds,
14771      {"DS status", "wlan.fc.ds",
14772       FT_UINT8, BASE_HEX, VALS(tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
14773       "Data-frame DS-traversal status", HFILL }},  /* 3 */
14774
14775     {&hf_ieee80211_fc_to_ds,
14776      {"To DS", "wlan.fc.tods",
14777       FT_BOOLEAN, 8, TFS (&tods_flag), FLAG_TO_DS,
14778       "To DS flag", HFILL }},    /* 4 */
14779
14780     {&hf_ieee80211_fc_from_ds,
14781      {"From DS", "wlan.fc.fromds",
14782       FT_BOOLEAN, 8, TFS (&fromds_flag), FLAG_FROM_DS,
14783       "From DS flag", HFILL }},    /* 5 */
14784
14785     {&hf_ieee80211_fc_more_frag,
14786      {"More Fragments", "wlan.fc.frag",
14787       FT_BOOLEAN, 8, TFS (&more_fragments), FLAG_MORE_FRAGMENTS,
14788       "More Fragments flag", HFILL }},  /* 6 */
14789
14790     {&hf_ieee80211_fc_retry,
14791      {"Retry", "wlan.fc.retry",
14792       FT_BOOLEAN, 8, TFS (&retry_flags), FLAG_RETRY,
14793       "Retransmission flag", HFILL }},
14794
14795     { &hf_ieee80211_fc_analysis_retransmission,
14796      {"Retransmission", "wlan.analysis.retransmission",
14797       FT_NONE, BASE_NONE, NULL, 0x0,
14798       "This frame is a suspected wireless retransmission", HFILL }},
14799
14800     { &hf_ieee80211_fc_analysis_retransmission_frame,
14801      {"Retransmission of frame", "wlan.analysis.retransmission_frame",
14802       FT_FRAMENUM, BASE_NONE, NULL, 0x0,
14803       "This is a retransmission of frame #", HFILL }},
14804
14805     {&hf_ieee80211_fc_pwr_mgt,
14806      {"PWR MGT", "wlan.fc.pwrmgt",
14807       FT_BOOLEAN, 8, TFS (&pm_flags), FLAG_POWER_MGT,
14808       "Power management status", HFILL }},
14809
14810     {&hf_ieee80211_fc_more_data,
14811      {"More Data", "wlan.fc.moredata",
14812       FT_BOOLEAN, 8, TFS (&md_flags), FLAG_MORE_DATA,
14813       "More data flag", HFILL }},
14814
14815     {&hf_ieee80211_fc_protected,
14816      {"Protected flag", "wlan.fc.protected",
14817       FT_BOOLEAN, 8, TFS (&protected_flags), FLAG_PROTECTED,
14818       NULL, HFILL }},
14819
14820     {&hf_ieee80211_fc_order,
14821      {"Order flag", "wlan.fc.order",
14822       FT_BOOLEAN, 8, TFS (&order_flags), FLAG_ORDER,
14823       "Strictly ordered flag", HFILL }},
14824
14825     {&hf_ieee80211_assoc_id,
14826      {"Association ID","wlan.aid"
14827       ,FT_UINT16, BASE_DEC, NULL, 0x3FFF,
14828       "Association-ID field", HFILL }},
14829
14830     {&hf_ieee80211_did_duration,
14831      {"Duration", "wlan.duration",
14832       FT_UINT16, BASE_DEC, NULL, 0x7FFF,
14833       "Duration field", HFILL }},
14834
14835     {&hf_ieee80211_addr_da,
14836      {"Destination address", "wlan.da",
14837       FT_ETHER, BASE_NONE, NULL, 0,
14838       "Destination Hardware Address", HFILL }},
14839
14840     {&hf_ieee80211_addr_sa,
14841      {"Source address", "wlan.sa",
14842       FT_ETHER, BASE_NONE, NULL, 0,
14843       "Source Hardware Address", HFILL }},
14844
14845     { &hf_ieee80211_addr,
14846       {"Hardware address", "wlan.addr",
14847        FT_ETHER, BASE_NONE, NULL, 0,
14848        "SA, DA, BSSID, RA or TA Hardware Address", HFILL }},
14849
14850     {&hf_ieee80211_addr_ra,
14851      {"Receiver address", "wlan.ra",
14852       FT_ETHER, BASE_NONE, NULL, 0,
14853       "Receiving Station Hardware Address", HFILL }},
14854
14855     {&hf_ieee80211_addr_ta,
14856      {"Transmitter address", "wlan.ta",
14857       FT_ETHER, BASE_NONE, NULL, 0,
14858       "Transmitting Station Hardware Address", HFILL }},
14859
14860     {&hf_ieee80211_addr_bssid,
14861      {"BSS Id", "wlan.bssid",
14862       FT_ETHER, BASE_NONE, NULL, 0,
14863       "Basic Service Set ID", HFILL }},
14864
14865     {&hf_ieee80211_frag_number,
14866      {"Fragment number", "wlan.frag",
14867       FT_UINT16, BASE_DEC, NULL, 0,
14868       NULL, HFILL }},
14869
14870     {&hf_ieee80211_seq_number,
14871      {"Sequence number", "wlan.seq",
14872       FT_UINT16, BASE_DEC, NULL, 0,
14873       NULL, HFILL }},
14874
14875     {&hf_ieee80211_mesh_control_field,
14876      {"Mesh Control Field", "wlan.mesh.control_field",
14877       FT_NONE, BASE_NONE, NULL, 0,
14878       NULL, HFILL }},
14879
14880     {&hf_ieee80211_qos,
14881      {"Qos Control", "wlan.qos",
14882       FT_UINT16, BASE_HEX, NULL, 0,
14883       NULL, HFILL }},
14884
14885     {&hf_ieee80211_qos_tid,
14886      {"TID", "wlan.qos.tid",
14887       FT_UINT16, BASE_DEC, NULL, 0x000F,
14888       NULL, HFILL }},
14889
14890     {&hf_ieee80211_qos_priority,
14891      {"Priority", "wlan.qos.priority",
14892       FT_UINT16, BASE_DEC, VALS(ieee80211_qos_tags_acs), 0x0007,
14893       "802.1D Tag", HFILL }},
14894
14895     {&hf_ieee80211_qos_eosp,
14896      {"EOSP", "wlan.qos.eosp",
14897       FT_BOOLEAN, 16, TFS (&eosp_flag), QOS_FLAG_EOSP,
14898       "EOSP Field", HFILL }},
14899
14900     {&hf_ieee80211_qos_bit4,
14901      {"QoS bit 4", "wlan.qos.bit4",
14902       FT_BOOLEAN, 16, TFS (&bit4_flag), QOS_FLAG_EOSP,
14903       NULL, HFILL }},
14904
14905     {&hf_ieee80211_qos_ack_policy,
14906      {"Ack Policy", "wlan.qos.ack",
14907       FT_UINT16, BASE_HEX,  VALS(ack_policy), 0x0060,
14908       NULL, HFILL }},
14909
14910     {&hf_ieee80211_qos_amsdu_present,
14911      {"Payload Type", "wlan.qos.amsdupresent",
14912       FT_BOOLEAN, 16,
14913       TFS(&ieee80211_qos_amsdu_present_flag), 0x0080, NULL, HFILL }},
14914
14915     {&hf_ieee80211_qos_txop_limit,
14916      {"TXOP Limit", "wlan.qos.txop_limit",
14917       FT_UINT16, BASE_DEC, NULL, 0xFF00,
14918       NULL, HFILL }},
14919
14920     {&hf_ieee80211_qos_ps_buf_state,
14921      {"QAP PS Buffer State", "wlan.qos.ps_buf_state",
14922       FT_UINT16, BASE_HEX, NULL, 0xFF00,
14923       NULL, HFILL }},
14924
14925     {&hf_ieee80211_qos_buf_state_indicated,
14926      {"Buffer State Indicated", "wlan.qos.buf_state_indicated",
14927       FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
14928       NULL, HFILL }},
14929
14930     {&hf_ieee80211_qos_highest_pri_buf_ac,
14931      {"Highest-Priority Buffered AC", "wlan.qos.highest_pri_buf_ac",
14932        FT_UINT16, BASE_DEC, VALS(wme_acs), 0x0C00,
14933       NULL, HFILL }},
14934
14935     {&hf_ieee80211_qos_qap_buf_load,
14936      {"QAP Buffered Load", "wlan.qos.qap_buf_load",
14937       FT_UINT16, BASE_DEC, NULL, 0xF000,
14938       NULL, HFILL }},
14939
14940     {&hf_ieee80211_qos_txop_dur_req,
14941      {"TXOP Duration Requested", "wlan.qos.txop_dur_req",
14942       FT_UINT16, BASE_DEC, NULL, 0xFF00,
14943       NULL, HFILL }},
14944
14945     {&hf_ieee80211_qos_queue_size,
14946      {"Queue Size", "wlan.qos.queue_size",
14947       FT_UINT16, BASE_DEC, NULL, 0xFF00,
14948       NULL, HFILL }},
14949
14950     {&hf_ieee80211_fcs,
14951      {"Frame check sequence", "wlan.fcs",
14952       FT_UINT32, BASE_HEX, NULL, 0,
14953       "Frame Check Sequence (FCS)", HFILL }},
14954
14955     {&hf_ieee80211_fcs_good,
14956      {"Good", "wlan.fcs_good",
14957       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14958       "True if the FCS is correct", HFILL }},
14959
14960     {&hf_ieee80211_fcs_bad,
14961      {"Bad", "wlan.fcs_bad",
14962       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14963       "True if the FCS is incorrect", HFILL }},
14964
14965     {&hf_ieee80211_fragment_overlap,
14966       {"Fragment overlap", "wlan.fragment.overlap",
14967        FT_BOOLEAN, BASE_NONE,
14968        NULL, 0x0,
14969        "Fragment overlaps with other fragments", HFILL }},
14970
14971     {&hf_ieee80211_fragment_overlap_conflict,
14972       {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
14973        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14974        "Overlapping fragments contained conflicting data", HFILL }},
14975
14976     {&hf_ieee80211_fragment_multiple_tails,
14977       {"Multiple tail fragments found", "wlan.fragment.multipletails",
14978        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14979        "Several tails were found when defragmenting the packet", HFILL }},
14980
14981     {&hf_ieee80211_fragment_too_long_fragment,
14982       {"Fragment too long", "wlan.fragment.toolongfragment",
14983        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14984        "Fragment contained data past end of packet", HFILL }},
14985
14986     {&hf_ieee80211_fragment_error,
14987       {"Defragmentation error", "wlan.fragment.error",
14988        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
14989        "Defragmentation error due to illegal fragments", HFILL }},
14990
14991     {&hf_ieee80211_fragment_count,
14992       {"Fragment count", "wlan.fragment.count",
14993        FT_UINT32, BASE_DEC, NULL, 0x0,
14994        NULL, HFILL }},
14995
14996     {&hf_ieee80211_fragment,
14997       {"802.11 Fragment", "wlan.fragment",
14998        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
14999        NULL, HFILL }},
15000
15001     {&hf_ieee80211_fragments,
15002       {"802.11 Fragments", "wlan.fragments",
15003        FT_NONE, BASE_NONE, NULL, 0x0,
15004        NULL, HFILL }},
15005
15006     {&hf_ieee80211_reassembled_in,
15007       {"Reassembled 802.11 in frame", "wlan.reassembled_in",
15008        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
15009        "This 802.11 packet is reassembled in this frame", HFILL }},
15010
15011     {&hf_ieee80211_reassembled_length,
15012       {"Reassembled 802.11 length", "wlan.reassembled.length",
15013        FT_UINT32, BASE_DEC, NULL, 0x0,
15014        "The total length of the reassembled payload", HFILL }},
15015
15016     {&hf_ieee80211_wep_iv,
15017      {"Initialization Vector", "wlan.wep.iv",
15018       FT_UINT24, BASE_HEX, NULL, 0,
15019       NULL, HFILL }},
15020
15021     {&hf_ieee80211_wep_iv_weak,
15022      {"Weak IV", "wlan.wep.weakiv",
15023       FT_BOOLEAN, BASE_NONE, NULL,0x0,
15024        NULL,HFILL}},
15025
15026     {&hf_ieee80211_tkip_extiv,
15027      {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv",
15028       FT_STRING, BASE_NONE, NULL, 0,
15029       "TKIP Extended Initialization Vector", HFILL }},
15030
15031     {&hf_ieee80211_ccmp_extiv,
15032      {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv",
15033       FT_STRING, BASE_NONE, NULL, 0,
15034       "CCMP Extended Initialization Vector", HFILL }},
15035
15036     {&hf_ieee80211_wep_key,
15037      {"Key Index", "wlan.wep.key",
15038       FT_UINT8, BASE_DEC, NULL, 0,
15039       NULL, HFILL }},
15040
15041     {&hf_ieee80211_wep_icv,
15042      {"WEP ICV", "wlan.wep.icv",
15043       FT_UINT32, BASE_HEX, NULL, 0,
15044       NULL, HFILL }},
15045
15046     {&hf_ieee80211_block_ack_request_control,
15047      {"Block Ack Request (BAR) Control", "wlan.bar.control",
15048       FT_UINT16, BASE_HEX, NULL, 0,
15049       NULL, HFILL }},
15050
15051     {&hf_ieee80211_block_ack_control,
15052      {"Block Ack Request Control", "wlan.ba.control",
15053       FT_UINT16, BASE_HEX, NULL, 0,
15054       NULL, HFILL }},
15055
15056     {&hf_ieee80211_block_ack_control_ack_policy,
15057      {"BAR Ack Policy", "wlan.ba.control.ackpolicy",
15058       FT_BOOLEAN, 16, TFS (&ieee80211_block_ack_control_ack_policy_flag), 0x01,
15059       "Block Ack Request (BAR) Ack Policy", HFILL }},
15060
15061     {&hf_ieee80211_block_ack_control_multi_tid,
15062      {"Multi-TID", "wlan.ba.control.multitid",
15063       FT_BOOLEAN, 16, 0, 0x02,
15064       "Multi-Traffic Identifier (TID)", HFILL }},
15065
15066     {&hf_ieee80211_block_ack_control_compressed_bitmap,
15067      {"Compressed Bitmap", "wlan.ba.control.cbitmap",
15068       FT_BOOLEAN, 16, 0, 0x04,
15069       NULL, HFILL }},
15070
15071     {&hf_ieee80211_block_ack_control_reserved,
15072      {"Reserved", "wlan.ba.control.cbitmap",
15073       FT_UINT16, BASE_HEX, NULL, 0x0ff8,
15074       NULL, HFILL }},
15075
15076     {&hf_ieee80211_block_ack_control_basic_tid_info,
15077      {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
15078       FT_UINT16, BASE_HEX, NULL, 0xf000,
15079       "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
15080
15081     {&hf_ieee80211_block_ack_control_compressed_tid_info,
15082      {"TID for which a BlockAck frame is requested", "wlan.bar.compressed.tidinfo",
15083       FT_UINT16, BASE_HEX, NULL, 0xf000,
15084       "Traffic Identifier (TID) for which a BlockAck frame is requested", HFILL }},
15085
15086     {&hf_ieee80211_block_ack_control_multi_tid_info,
15087      {"Number of TIDs Present", "wlan.ba.mtid.tidinfo",
15088       FT_UINT16, BASE_HEX, NULL, 0xf000,
15089       "Number of Traffic Identifiers (TIDs) Present", HFILL }},
15090
15091     {&hf_ieee80211_block_ack_multi_tid_info,
15092      {"Traffic Identifier (TID) Info", "wlan.ba.mtid.tid",
15093       FT_UINT8, BASE_DEC, 0, 0,
15094       NULL, HFILL }},
15095
15096     {&hf_ieee80211_block_ack_multi_tid_reserved,
15097      {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
15098       FT_UINT16, BASE_HEX, 0, 0x0fff,
15099       NULL, HFILL }},
15100
15101     {&hf_ieee80211_block_ack_multi_tid_value,
15102      {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
15103       FT_UINT16, BASE_HEX, 0, 0xf000,
15104       NULL, HFILL }},
15105
15106     {&hf_ieee80211_block_ack_request_type,
15107      {"Block Ack Request Type", "wlan.bar.type",
15108       FT_UINT8, BASE_HEX, VALS(ieee80211_block_ack_request_type_flags), 0x06,
15109       "Block Ack Request (BAR) Type", HFILL }},
15110
15111     {&hf_ieee80211_block_ack_type,
15112      {"Block Ack Type", "wlan.ba.type",
15113       FT_UINT8, BASE_HEX, VALS(ieee80211_block_ack_type_flags), 0x06,
15114       NULL, HFILL }},
15115
15116     {&hf_ieee80211_block_ack_bitmap,
15117      {"Block Ack Bitmap", "wlan.ba.bm",
15118       FT_BYTES, BASE_NONE, NULL, 0,
15119       NULL, HFILL }},
15120
15121     {&hf_ieee80211_block_ack_bitmap_missing_frame,
15122      {"Missing frame", "wlan.ba.bm.missing_frame",
15123       FT_UINT32, BASE_DEC, NULL, 0,
15124       NULL, HFILL }},
15125
15126     {&hf_ieee80211_data_encap_payload_type,
15127      {"Payload Type", "wlan.data_encap.payload_type",
15128       FT_UINT8, BASE_DEC, VALS(ieee80211_data_encap_payload_types), 0,
15129       NULL, HFILL }},
15130
15131     {&hf_ieee80211_ff_tdls_action_code,
15132      {"Action code", "wlan_mgt.fixed.action_code",
15133       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tdls_action_codes_ext, 0,
15134       "Management action code", HFILL }},
15135
15136     {&hf_ieee80211_ff_target_channel,
15137      {"Target Channel", "wlan_mgt.fixed.target_channel",
15138       FT_UINT8, BASE_DEC, NULL, 0,
15139       NULL, HFILL }},
15140
15141     {&hf_ieee80211_ff_regulatory_class,
15142      {"Regulatory Class", "wlan_mgt.fixed.regulatory_class",
15143       FT_UINT8, BASE_DEC, NULL, 0,
15144       NULL, HFILL }},
15145
15146     {&hf_ieee80211_ff_wnm_action_code,
15147      {"Action code", "wlan_mgt.fixed.action_code",
15148       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_action_codes_ext, 0,
15149       "Management action code", HFILL }},
15150
15151     {&hf_ieee80211_ff_key_data,
15152      {"Key Data", "wlan_mgt.fixed.key_data",
15153       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
15154
15155     {&hf_ieee80211_ff_key_data_length,
15156      {"Key Data Length", "wlan_mgt.fixed.key_data_length",
15157       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
15158
15159     {&hf_ieee80211_ff_wnm_notification_type,
15160      {"WNM-Notification type", "wlan_mgt.fixed.wnm_notification_type",
15161       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_notification_types_ext, 0,
15162       NULL, HFILL }},
15163
15164     {&hf_ieee80211_ff_request_mode_pref_cand,
15165      {"Preferred Candidate List Included","wlan_mgt.fixed.request_mode.pref_cand",
15166       FT_UINT8, BASE_DEC, NULL, 0x01,
15167       NULL, HFILL }},
15168
15169     {&hf_ieee80211_ff_request_mode_abridged,
15170      {"Abridged", "wlan_mgt.fixed.request_mode.abridged",
15171       FT_UINT8, BASE_DEC, NULL, 0x02,
15172       NULL, HFILL }},
15173
15174     {&hf_ieee80211_ff_request_mode_disassoc_imminent,
15175      {"Disassociation Imminent", "wlan_mgt.fixed.request_mode.disassoc_imminent",
15176       FT_UINT8, BASE_DEC, NULL, 0x04,
15177       NULL, HFILL }},
15178
15179     {&hf_ieee80211_ff_request_mode_bss_term_included,
15180      {"BSS Termination Included", "wlan_mgt.fixed.request_mode.bss_term_included",
15181       FT_UINT8, BASE_DEC, NULL, 0x08,
15182       NULL, HFILL }},
15183
15184     {&hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
15185      {"ESS Disassociation Imminent", "wlan_mgt.fixed.request_mode.ess_disassoc_imminent",
15186       FT_UINT8, BASE_DEC, NULL, 0x10,
15187       NULL, HFILL }},
15188
15189     {&hf_ieee80211_ff_disassoc_timer,
15190      {"Disassociation Timer", "wlan_mgt.fixed.disassoc_timer",
15191       FT_UINT16, BASE_DEC, NULL, 0,
15192       NULL, HFILL }},
15193
15194     {&hf_ieee80211_ff_validity_interval,
15195      {"Validity Interval", "wlan_mgt.fixed.validity_interval",
15196       FT_UINT8, BASE_DEC, NULL, 0,
15197       NULL, HFILL }},
15198
15199     {&hf_ieee80211_ff_url_len,
15200      {"Session Information URL Length",
15201       "wlan_mgt.fixed.session_information.url_length",
15202       FT_UINT8, BASE_DEC, NULL, 0,
15203       NULL, HFILL }},
15204
15205     {&hf_ieee80211_ff_url,
15206      {"Session Information URL", "wlan_mgt.fixed.session_information.url",
15207       FT_STRING, BASE_NONE, NULL, 0,
15208       NULL, HFILL }},
15209   };
15210
15211   static hf_register_info ff[] = {
15212
15213     {&hf_ieee80211_ff_timestamp,
15214      {"Timestamp", "wlan_mgt.fixed.timestamp",
15215       FT_UINT64, BASE_HEX, NULL, 0,
15216       NULL, HFILL }},
15217
15218     {&hf_ieee80211_ff_auth_alg,
15219      {"Authentication Algorithm", "wlan_mgt.fixed.auth.alg",
15220       FT_UINT16, BASE_DEC, VALS(auth_alg), 0,
15221       NULL, HFILL }},
15222
15223     {&hf_ieee80211_ff_beacon_interval,
15224      {"Beacon Interval", "wlan_mgt.fixed.beacon",
15225       FT_UINT32, BASE_CUSTOM, beacon_interval_base_custom, 0,
15226       NULL, HFILL }},
15227
15228     {&hf_ieee80211_fixed_parameters,
15229      {"Fixed parameters", "wlan_mgt.fixed.all",
15230       FT_NONE, BASE_NONE, NULL, 0,
15231       NULL, HFILL }},
15232
15233     {&hf_ieee80211_tagged_parameters,
15234      {"Tagged parameters", "wlan_mgt.tagged.all",
15235       FT_NONE, BASE_NONE, NULL, 0,
15236       NULL, HFILL }},
15237
15238     {&hf_ieee80211_tag_ssid,
15239      {"SSID", "wlan_mgt.ssid",
15240       FT_STRING, BASE_NONE, NULL, 0,
15241       "Indicates the identity of an ESS or IBSS", HFILL }},
15242
15243     {&hf_ieee80211_tag_supp_rates,
15244      {"Supported Rates", "wlan_mgt.supported_rates",
15245       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
15246       "In Mbit/sec, (B) for Basic Rates", HFILL }},
15247
15248     {&hf_ieee80211_tag_fh_dwell_time,
15249      {"Dwell Time", "wlan_mgt.fh.dwell_time",
15250       FT_UINT16, BASE_HEX, NULL, 0x0,
15251       "In Time Unit (TU)", HFILL }},
15252
15253     {&hf_ieee80211_tag_fh_hop_set,
15254      {"Hop Set", "wlan_mgt.fh.hop_set",
15255       FT_UINT8, BASE_DEC, NULL, 0x0,
15256       NULL, HFILL }},
15257
15258     {&hf_ieee80211_tag_fh_hop_pattern,
15259      {"Hop Pattern", "wlan_mgt.fh.hop_pattern",
15260       FT_UINT8, BASE_DEC, NULL, 0x0,
15261       NULL, HFILL }},
15262
15263     {&hf_ieee80211_tag_fh_hop_index,
15264      {"Hop Index", "wlan_mgt.fh.hop_index",
15265       FT_UINT8, BASE_DEC, NULL, 0x0,
15266       NULL, HFILL }},
15267
15268     {&hf_ieee80211_ff_block_ack_params,
15269      {"Block Ack Parameters", "wlan_mgt.fixed.baparams",
15270       FT_UINT16, BASE_HEX, NULL, 0,
15271       NULL, HFILL }},
15272
15273     {&hf_ieee80211_ff_block_ack_params_amsdu_permitted,
15274      {"A-MSDUs", "wlan_mgt.fixed.baparams.amsdu",
15275       FT_BOOLEAN, 16, TFS (&ff_block_ack_params_amsdu_permitted_flag), 0x0001,
15276       "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
15277
15278     {&hf_ieee80211_ff_block_ack_params_policy,
15279      {"Block Ack Policy", "wlan_mgt.fixed.baparams.policy",
15280       FT_BOOLEAN, 16, TFS (&ff_block_ack_params_policy_flag), 0x0002,
15281       NULL, HFILL }},
15282
15283     {&hf_ieee80211_ff_block_ack_params_tid,
15284      {"Traffic Identifier", "wlan_mgt.fixed.baparams.tid",
15285       FT_UINT16, BASE_HEX, NULL, 0x003C,
15286       NULL, HFILL }},
15287
15288     {&hf_ieee80211_ff_block_ack_params_buffer_size,
15289      {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan_mgt.fixed.baparams.buffersize",
15290       FT_UINT16, BASE_DEC, NULL, 0xFFC0,
15291       "Number of Buffers", HFILL }},
15292
15293     {&hf_ieee80211_ff_block_ack_timeout,
15294      {"Block Ack Timeout", "wlan_mgt.fixed.batimeout",
15295       FT_UINT16, BASE_HEX, NULL, 0,
15296       NULL, HFILL }},
15297
15298     {&hf_ieee80211_ff_block_ack_ssc,
15299      {"Block Ack Starting Sequence Control (SSC)", "wlan_mgt.fixed.ssc",
15300       FT_UINT16, BASE_HEX, 0, 0,
15301       NULL, HFILL }},
15302
15303     {&hf_ieee80211_ff_block_ack_ssc_fragment,
15304      {"Fragment", "wlan_mgt.fixed.fragment",
15305       FT_UINT16, BASE_DEC, 0, 0x000f,
15306       NULL, HFILL }},
15307
15308     {&hf_ieee80211_ff_block_ack_ssc_sequence,
15309      {"Starting Sequence Number", "wlan_mgt.fixed.sequence",
15310       FT_UINT16, BASE_DEC, 0, 0xfff0,
15311       NULL, HFILL }},
15312
15313     {&hf_ieee80211_ff_delba_param,
15314      {"Delete Block Ack (DELBA) Parameter Set", "wlan_mgt.fixed.delba.param",
15315       FT_UINT16, BASE_HEX, 0, 0,
15316       NULL, HFILL }},
15317
15318     {&hf_ieee80211_ff_delba_param_reserved,
15319      {"Reserved", "wlan_mgt.fixed.delba.param.reserved",
15320       FT_UINT16, BASE_HEX, 0, 0x07ff,
15321       NULL, HFILL }},
15322
15323     {&hf_ieee80211_ff_delba_param_init,
15324      {"Initiator", "wlan_mgt.fixed.delba.param.initiator",
15325       FT_BOOLEAN, 16, 0, 0x0800,
15326       NULL, HFILL }},
15327
15328     {&hf_ieee80211_ff_delba_param_tid,
15329      {"TID", "wlan_mgt.fixed.delba.param.tid",
15330       FT_UINT16, BASE_HEX, 0, 0xf000,
15331       "Traffic Identifier (TID)", HFILL }},
15332
15333     {&hf_ieee80211_ff_max_reg_pwr,
15334      {"Maximum Regulation Power", "wlan_mgt.fixed.maxregpwr",
15335       FT_UINT16, BASE_HEX, 0, 0,
15336       NULL, HFILL }},
15337
15338     {&hf_ieee80211_ff_measurement_pilot_int,
15339      {"Measurement Pilot Interval", "wlan_mgt.fixed.msmtpilotint",
15340       FT_UINT16, BASE_HEX, 0, 0,
15341       "Measurement Pilot Interval Fixed Field", HFILL }},
15342
15343     {&hf_ieee80211_ff_country_str,
15344      {"Country String", "wlan_mgt.fixed.country",
15345       FT_STRING, BASE_NONE, 0, 0,
15346       NULL, HFILL }},
15347
15348     {&hf_ieee80211_ff_max_tx_pwr,
15349      {"Maximum Transmit Power", "wlan_mgt.fixed.maxtxpwr",
15350       FT_UINT8, BASE_HEX, 0, 0,
15351       NULL, HFILL }},
15352
15353     {&hf_ieee80211_ff_tx_pwr_used,
15354      {"Transmit Power Used", "wlan_mgt.fixed.txpwr",
15355       FT_UINT8, BASE_HEX, 0, 0,
15356       NULL, HFILL }},
15357
15358     {&hf_ieee80211_ff_transceiver_noise_floor,
15359      {"Transceiver Noise Floor", "wlan_mgt.fixed.tnoisefloor",
15360       FT_UINT8, BASE_HEX, 0, 0,
15361       NULL, HFILL }},
15362
15363     {&hf_ieee80211_ff_channel_width,
15364      {"Supported Channel Width", "wlan_mgt.fixed.chanwidth",
15365       FT_UINT8, BASE_HEX, VALS(ff_channel_width_vals), 0,
15366       NULL, HFILL }},
15367
15368     {&hf_ieee80211_ff_qos_info_ap,
15369      {"QoS Information (AP)", "wlan_mgt.fixed.qosinfo.ap",
15370       FT_UINT8, BASE_HEX, NULL, 0,
15371       NULL, HFILL }},
15372
15373     {&hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
15374      {"EDCA Parameter Set Update Count", "wlan_mgt.fixed.qosinfo.ap.edcaupdate",
15375       FT_UINT8, BASE_HEX, NULL, 0x0F,
15376       "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
15377
15378     {&hf_ieee80211_ff_qos_info_ap_q_ack,
15379      {"Q-Ack", "wlan_mgt.fixed.qosinfo.ap.qack",
15380       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_q_ack_flag), 0x10,
15381       "QoS Ack", HFILL }},
15382
15383     {&hf_ieee80211_ff_qos_info_ap_queue_req,
15384      {"Queue Request", "wlan_mgt.fixed.qosinfo.ap",
15385       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_queue_req_flag), 0x20,
15386       NULL, HFILL }},
15387
15388     {&hf_ieee80211_ff_qos_info_ap_txop_request,
15389      {"TXOP Request", "wlan_mgt.fixed.qosinfo.ap.txopreq",
15390       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_txop_request_flag), 0x40,
15391       "Transmit Opportunity (TXOP) Request", HFILL }},
15392
15393     {&hf_ieee80211_ff_qos_info_ap_reserved,
15394      {"Reserved", "wlan_mgt.fixed.qosinfo.ap.reserved",
15395       FT_BOOLEAN, 8, NULL, 0x80,
15396       NULL, HFILL }},
15397
15398     {&hf_ieee80211_ff_qos_info_sta,
15399      {"QoS Information (STA)", "wlan_mgt.fixed.qosinfo.sta",
15400       FT_UINT8, BASE_HEX, NULL, 0,
15401       NULL, HFILL }},
15402
15403     {&hf_ieee80211_ff_qos_info_sta_ac_vo,
15404      {"AC_VO", "wlan_mgt.fixed.qosinfo.sta.ac.vo",
15405       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x01,
15406       NULL, HFILL }},
15407
15408     {&hf_ieee80211_ff_qos_info_sta_ac_vi,
15409      {"AC_VI", "wlan_mgt.fixed.qosinfo.sta.ac.vi",
15410       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x02,
15411       NULL, HFILL }},
15412
15413     {&hf_ieee80211_ff_qos_info_sta_ac_bk,
15414      {"AC_BK", "wlan_mgt.fixed.qosinfo.sta.ac.bk",
15415       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x04,
15416       NULL, HFILL }},
15417
15418     {&hf_ieee80211_ff_qos_info_sta_ac_be,
15419      {"AC_BE", "wlan_mgt.fixed.qosinfo.sta.ac.be",
15420       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x08,
15421       NULL, HFILL }},
15422
15423     {&hf_ieee80211_ff_qos_info_sta_q_ack,
15424      {"Q-Ack", "wlan_mgt.fixed.qosinfo.sta.qack",
15425       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_q_ack_flag), 0x10,
15426       "QoS Ack", HFILL }},
15427
15428     {&hf_ieee80211_ff_qos_info_sta_max_sp_len,
15429      {"Service Period (SP) Length", "wlan_mgt.fixed.qosinfo.sta.splen",
15430       FT_UINT8, BASE_HEX, VALS(ff_qos_info_sta_max_sp_len_flags) , 0x60,
15431       NULL, HFILL }},
15432
15433     {&hf_ieee80211_ff_qos_info_sta_more_data_ack,
15434      {"More Data Ack", "wlan_mgt.fixed.qosinfo.sta.moredataack",
15435       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_more_data_ack_flag), 0x80,
15436       NULL, HFILL }},
15437
15438     {&hf_ieee80211_ff_sm_pwr_save,
15439      {"Spatial Multiplexing (SM) Power Control", "wlan_mgt.fixed.sm.powercontrol",
15440       FT_UINT8, BASE_HEX, NULL, 0,
15441       NULL, HFILL }},
15442
15443     {&hf_ieee80211_ff_sm_pwr_save_enabled,
15444      {"SM Power Save", "wlan_mgt.fixed.sm.powercontrol.enabled",
15445       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x01,
15446       "Spatial Multiplexing (SM) Power Save", HFILL }},
15447
15448     {&hf_ieee80211_ff_sm_pwr_save_sm_mode,
15449      {"SM Mode", "wlan_mgt.fixed.sm.powercontrol.mode",
15450       FT_BOOLEAN, 8, TFS (&ff_sm_pwr_save_sm_mode_flag), 0x02,
15451       "Spatial Multiplexing (SM) Mode", HFILL }},
15452
15453     {&hf_ieee80211_ff_sm_pwr_save_reserved,
15454      {"Reserved", "wlan_mgt.fixed.sm.powercontrol.reserved",
15455       FT_UINT8, BASE_HEX, NULL, 0xFC,
15456       NULL, HFILL }},
15457
15458     {&hf_ieee80211_ff_pco_phase_cntrl,
15459      {"Phased Coexistence Operation (PCO) Phase Control", "wlan_mgt.fixed.pco.phasecntrl",
15460       FT_BOOLEAN, BASE_NONE, TFS (&ff_pco_phase_cntrl_flag), 0x0,
15461       NULL, HFILL }},
15462
15463     {&hf_ieee80211_ff_psmp_param_set,
15464      {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan_mgt.fixed.psmp.paramset",
15465       FT_UINT16, BASE_HEX, 0, 0,
15466       NULL, HFILL }},
15467
15468     {&hf_ieee80211_ff_psmp_param_set_n_sta,
15469      {"Number of STA Info Fields Present", "wlan_mgt.fixed.psmp.paramset.nsta",
15470       FT_UINT16, BASE_HEX, 0, 0x000F,
15471       NULL, HFILL }},
15472
15473     {&hf_ieee80211_ff_psmp_param_set_more_psmp,
15474      {"More PSMP", "wlan_mgt.fixed.psmp.paramset.more",
15475       FT_BOOLEAN, 16, TFS(&ff_psmp_param_set_more_psmp_flag), 0x0010,
15476       "More Power Save Multi-Poll (PSMP)", HFILL }},
15477
15478     {&hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
15479      {"PSMP Sequence Duration [us]", "wlan_mgt.fixed.psmp.paramset.seqduration",
15480       FT_UINT16, BASE_DEC, 0, 0xFFE0,
15481       "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
15482
15483     {&hf_ieee80211_ff_mimo_cntrl,
15484      {"MIMO Control", "wlan_mgt.fixed.mimo.control.",
15485       FT_BYTES, BASE_NONE, 0, 0x0,
15486       NULL, HFILL }},
15487
15488     {&hf_ieee80211_ff_mimo_cntrl_nc_index,
15489      {"Nc Index", "wlan_mgt.fixed.mimo.control.ncindex",
15490       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nc_index_flags), 0x0003,
15491       "Number of Columns Less One", HFILL }},
15492
15493     {&hf_ieee80211_ff_mimo_cntrl_nr_index,
15494      {"Nr Index", "wlan_mgt.fixed.mimo.control.nrindex",
15495       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nr_index_flags), 0x000C,
15496       "Number of Rows Less One", HFILL }},
15497
15498     {&hf_ieee80211_ff_mimo_cntrl_channel_width,
15499      {"Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
15500       FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010,
15501       NULL, HFILL }},
15502
15503     {&hf_ieee80211_ff_mimo_cntrl_grouping,
15504      {"Grouping (Ng)", "wlan_mgt.fixed.mimo.control.grouping",
15505       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_grouping_flags), 0x0060,
15506       NULL, HFILL }},
15507
15508     {&hf_ieee80211_ff_mimo_cntrl_coefficient_size,
15509      {"Coefficient Size (Nb)", "wlan_mgt.fixed.mimo.control.cosize",
15510       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_coefficient_size_flags), 0x0180,
15511       NULL, HFILL }},
15512
15513     {&hf_ieee80211_ff_mimo_cntrl_codebook_info,
15514      {"Codebook Information", "wlan_mgt.fixed.mimo.control.codebookinfo",
15515       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_codebook_info_flags), 0x0600,
15516       NULL, HFILL }},
15517
15518     {&hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
15519      {"Remaining Matrix Segment", "wlan_mgt.fixed.mimo.control.matrixseg",
15520       FT_UINT16, BASE_HEX, 0, 0x3800,
15521       NULL, HFILL }},
15522
15523     {&hf_ieee80211_ff_mimo_cntrl_reserved,
15524      {"Reserved", "wlan_mgt.fixed.mimo.control.reserved",
15525       FT_UINT16, BASE_HEX, 0, 0xC000,
15526       NULL, HFILL }},
15527
15528     {&hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
15529      {"Sounding Timestamp", "wlan_mgt.fixed.mimo.control.soundingtime",
15530       FT_UINT32, BASE_HEX, 0, 0,
15531       NULL, HFILL }},
15532
15533     {&hf_ieee80211_ff_psmp_sta_info,
15534      {"Power Save Multi-Poll (PSMP) Station Information", "wlan_mgt.fixed.psmp.stainfo",
15535       FT_UINT64, BASE_HEX, 0, 0,
15536       NULL, HFILL }},
15537
15538     {&hf_ieee80211_ff_psmp_sta_info_type,
15539      {"Sta Info Type", "wlan_mgt.fixed.psmp.stainfo.type",
15540       FT_UINT32, BASE_HEX, VALS(ff_psmp_sta_info_flags), PSMP_STA_INFO_FLAG_TYPE,
15541       NULL, HFILL }},
15542
15543     {&hf_ieee80211_ff_psmp_sta_info_dtt_start_offset,
15544      {"DTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.dttstart",
15545       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_START,
15546       NULL, HFILL }},
15547
15548     {&hf_ieee80211_ff_psmp_sta_info_dtt_duration,
15549      {"DTT Duration", "wlan_mgt.fixed.psmp.stainfo.dttduration",
15550       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_DURATION,
15551       NULL, HFILL }},
15552
15553     {&hf_ieee80211_ff_psmp_sta_info_sta_id,
15554      {"Target Station ID", "wlan_mgt.fixed.psmp.stainfo.staid",
15555       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_STA_ID,
15556       NULL, HFILL }},
15557
15558     {&hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
15559      {"UTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.uttstart",
15560       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_START,
15561       NULL, HFILL }},
15562
15563     {&hf_ieee80211_ff_psmp_sta_info_utt_duration,
15564      {"UTT Duration", "wlan_mgt.fixed.psmp.stainfo.uttduration",
15565       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_DURATION,
15566       NULL, HFILL }},
15567
15568     {&hf_ieee80211_ff_psmp_sta_info_reserved_small,
15569      {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
15570       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_IA_RESERVED,
15571       NULL, HFILL }},
15572
15573     {&hf_ieee80211_ff_psmp_sta_info_reserved_large,
15574      {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
15575       FT_UINT64, BASE_HEX, 0, 0,
15576       NULL, HFILL }},
15577
15578     {&hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
15579      {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan_mgt.fixed.psmp.stainfo.multicastid",
15580       FT_UINT64, BASE_HEX, 0, 0,
15581       NULL, HFILL }},
15582
15583     {&hf_ieee80211_ff_ant_selection,
15584      {"Antenna Selection", "wlan_mgt.fixed.antsel",
15585       FT_UINT8, BASE_HEX, 0, 0,
15586       NULL, HFILL }},
15587
15588     {&hf_ieee80211_ff_ant_selection_0,
15589      {"Antenna 0", "wlan_mgt.fixed.antsel.ant0",
15590       FT_UINT8, BASE_HEX, 0, 0x01,
15591       NULL, HFILL }},
15592
15593     {&hf_ieee80211_ff_ant_selection_1,
15594      {"Antenna 1", "wlan_mgt.fixed.antsel.ant1",
15595       FT_UINT8, BASE_HEX, 0, 0x02,
15596       NULL, HFILL }},
15597
15598     {&hf_ieee80211_ff_ant_selection_2,
15599      {"Antenna 2", "wlan_mgt.fixed.antsel.ant2",
15600       FT_UINT8, BASE_HEX, 0, 0x04,
15601       NULL, HFILL }},
15602
15603     {&hf_ieee80211_ff_ant_selection_3,
15604      {"Antenna 3", "wlan_mgt.fixed.antsel.ant3",
15605       FT_UINT8, BASE_HEX, 0, 0x08,
15606       NULL, HFILL }},
15607
15608     {&hf_ieee80211_ff_ant_selection_4,
15609      {"Antenna 4", "wlan_mgt.fixed.antsel.ant4",
15610       FT_UINT8, BASE_HEX, 0, 0x10,
15611       NULL, HFILL }},
15612
15613     {&hf_ieee80211_ff_ant_selection_5,
15614      {"Antenna 5", "wlan_mgt.fixed.antsel.ant5",
15615       FT_UINT8, BASE_HEX, 0, 0x20,
15616       NULL, HFILL }},
15617
15618     {&hf_ieee80211_ff_ant_selection_6,
15619      {"Antenna 6", "wlan_mgt.fixed.antsel.ant6",
15620       FT_UINT8, BASE_HEX, 0, 0x40,
15621       NULL, HFILL }},
15622
15623     {&hf_ieee80211_ff_ant_selection_7,
15624      {"Antenna 7", "wlan_mgt.fixed.antsel.ant7",
15625       FT_UINT8, BASE_HEX, 0, 0x80,
15626       NULL, HFILL }},
15627
15628     {&hf_ieee80211_ff_ext_channel_switch_announcement,
15629      {"Extended Channel Switch Announcement", "wlan_mgt.fixed.extchansw",
15630       FT_UINT32, BASE_HEX, 0, 0,
15631       NULL, HFILL }},
15632
15633     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
15634      {"Channel Switch Mode", "wlan_mgt.fixed.extchansw.switchmode",
15635       FT_UINT32, BASE_HEX, VALS(ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags), 0x000000FF,
15636       NULL, HFILL }},
15637
15638     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_reg_class,
15639      {"New Regulatory Class", "wlan_mgt.fixed.extchansw.new.regclass",
15640       FT_UINT32, BASE_HEX, NULL, 0x0000FF00,
15641       NULL, HFILL }},
15642
15643     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
15644      {"New Channel Number", "wlan_mgt.fixed.extchansw.new.channumber",
15645       FT_UINT32, BASE_HEX, NULL, 0x00FF0000,
15646       NULL, HFILL }},
15647
15648     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
15649      {"Channel Switch Count", "wlan_mgt.extchanswitch.switchcount",
15650       FT_UINT32, BASE_HEX, NULL, 0xFF000000,
15651       NULL, HFILL }},
15652
15653     {&hf_ieee80211_ff_ht_info,
15654      {"HT Information", "wlan_mgt.fixed.extchansw",
15655       FT_UINT8, BASE_HEX, 0, 0,
15656       "HT Information Fixed Field", HFILL }},
15657
15658     {&hf_ieee80211_ff_ht_info_information_request,
15659      {"Information Request", "wlan_mgt.fixed.mimo.control.chanwidth",
15660       FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01,
15661       NULL, HFILL }},
15662
15663     {&hf_ieee80211_ff_ht_info_40_mhz_intolerant,
15664      {"40 MHz Intolerant", "wlan_mgt.fixed.mimo.control.chanwidth",
15665       FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02,
15666       NULL, HFILL }},
15667
15668     {&hf_ieee80211_ff_ht_info_sta_chan_width,
15669      {"Station Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
15670       FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04,
15671       NULL, HFILL }},
15672
15673     {&hf_ieee80211_ff_ht_info_reserved,
15674      {"Reserved", "wlan_mgt.fixed.extchansw",
15675       FT_UINT8, BASE_HEX, 0, 0xF8,
15676       "Reserved Field", HFILL }},
15677
15678     {&hf_ieee80211_ff_ht_action,
15679      {"HT Action", "wlan_mgt.fixed.htact",
15680       FT_UINT8, BASE_HEX, VALS(ff_ht_action_flags), 0,
15681       "HT Action Code", HFILL }},
15682
15683     {&hf_ieee80211_ff_mimo_csi_snr,
15684      {"Signal to Noise Ratio (SNR)", "wlan_mgt.mimo.csimatrices.snr",
15685       FT_UINT8, BASE_HEX, NULL, 0,
15686       NULL, HFILL }},
15687
15688     {&hf_ieee80211_ff_public_action,
15689      {"Public Action", "wlan_mgt.fixed.publicact",
15690       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_pa_action_codes_ext, 0,
15691       "Public Action Code", HFILL }},
15692
15693     {&hf_ieee80211_ff_capture,
15694      {"Capabilities Information", "wlan_mgt.fixed.capabilities",
15695       FT_UINT16, BASE_HEX, NULL, 0,
15696       "Capability information", HFILL }},
15697
15698     {&hf_ieee80211_ff_cf_ess,
15699      {"ESS capabilities", "wlan_mgt.fixed.capabilities.ess",
15700       FT_BOOLEAN, 16, TFS (&cf_ess_flags), 0x0001,
15701       NULL, HFILL }},
15702
15703     {&hf_ieee80211_ff_cf_ibss,
15704      {"IBSS status", "wlan_mgt.fixed.capabilities.ibss",
15705       FT_BOOLEAN, 16, TFS(&cf_ibss_flags), 0x0002,
15706       "IBSS participation", HFILL }},
15707
15708     {&hf_ieee80211_ff_cf_sta_poll,
15709      {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.sta",
15710       FT_UINT16, BASE_HEX, VALS(sta_cf_pollable), 0x020C,
15711       "CF-Poll capabilities for a STA", HFILL }},
15712
15713     {&hf_ieee80211_ff_cf_ap_poll,
15714      {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.ap",
15715       FT_UINT16, BASE_HEX, VALS(ap_cf_pollable), 0x020C,
15716       "CF-Poll capabilities for an AP", HFILL }},
15717
15718     {&hf_ieee80211_ff_cf_privacy,
15719      {"Privacy", "wlan_mgt.fixed.capabilities.privacy",
15720       FT_BOOLEAN, 16, TFS(&cf_privacy_flags), 0x0010,
15721       "WEP support", HFILL }},
15722
15723     {&hf_ieee80211_ff_cf_preamble,
15724      {"Short Preamble", "wlan_mgt.fixed.capabilities.preamble",
15725       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0020,
15726       NULL, HFILL }},
15727
15728     {&hf_ieee80211_ff_cf_pbcc,
15729      {"PBCC", "wlan_mgt.fixed.capabilities.pbcc",
15730       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0040,
15731       "PBCC Modulation", HFILL }},
15732
15733     {&hf_ieee80211_ff_cf_agility,
15734      {"Channel Agility", "wlan_mgt.fixed.capabilities.agility",
15735       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0080,
15736       NULL, HFILL }},
15737
15738     {&hf_ieee80211_ff_cf_spec_man,
15739      {"Spectrum Management", "wlan_mgt.fixed.capabilities.spec_man",
15740       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0100,
15741       NULL, HFILL }},
15742
15743     {&hf_ieee80211_ff_short_slot_time,
15744      {"Short Slot Time", "wlan_mgt.fixed.capabilities.short_slot_time",
15745       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0400,
15746       NULL, HFILL }},
15747
15748     {&hf_ieee80211_ff_cf_apsd,
15749      {"Automatic Power Save Delivery", "wlan_mgt.fixed.capabilities.apsd",
15750       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0800,
15751       NULL, HFILL }},
15752
15753     {&hf_ieee80211_ff_radio_measurement,
15754      {"Radio Measurement", "wlan_mgt.fixed.capabilities.radio_measurement",
15755       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x1000,
15756       NULL, HFILL }},
15757
15758     {&hf_ieee80211_ff_dsss_ofdm,
15759      {"DSSS-OFDM", "wlan_mgt.fixed.capabilities.dsss_ofdm",
15760       FT_BOOLEAN, 16,  TFS(&tfs_allowed_not_allowed), 0x2000,
15761       "DSSS-OFDM Modulation", HFILL }},
15762
15763     {&hf_ieee80211_ff_cf_del_blk_ack,
15764      {"Delayed Block Ack", "wlan_mgt.fixed.capabilities.del_blk_ack",
15765       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x4000,
15766       NULL, HFILL }},
15767
15768     {&hf_ieee80211_ff_cf_imm_blk_ack,
15769      {"Immediate Block Ack", "wlan_mgt.fixed.capabilities.imm_blk_ack",
15770       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x8000,
15771       NULL, HFILL }},
15772
15773     {&hf_ieee80211_ff_auth_seq,
15774      {"Authentication SEQ", "wlan_mgt.fixed.auth_seq",
15775       FT_UINT16, BASE_HEX, NULL, 0,
15776       "Authentication Sequence Number", HFILL }},
15777
15778     {&hf_ieee80211_ff_assoc_id,
15779      {"Association ID", "wlan_mgt.fixed.aid",
15780       FT_UINT16, BASE_HEX, NULL, 0x3FFF,
15781       NULL, HFILL }},
15782
15783     {&hf_ieee80211_ff_listen_ival,
15784      {"Listen Interval", "wlan_mgt.fixed.listen_ival",
15785       FT_UINT16, BASE_HEX, NULL, 0,
15786       NULL, HFILL }},
15787
15788     {&hf_ieee80211_ff_current_ap,
15789      {"Current AP", "wlan_mgt.fixed.current_ap",
15790       FT_ETHER, BASE_NONE, NULL, 0,
15791       "MAC address of current AP", HFILL }},
15792
15793     {&hf_ieee80211_ff_reason,
15794      {"Reason code", "wlan_mgt.fixed.reason_code",
15795       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
15796       "Reason for unsolicited notification", HFILL }},
15797
15798     {&hf_ieee80211_ff_status_code,
15799      {"Status code", "wlan_mgt.fixed.status_code",
15800       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
15801       "Status of requested event", HFILL }},
15802
15803     {&hf_ieee80211_ff_category_code,
15804      {"Category code", "wlan_mgt.fixed.category_code",
15805       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &category_codes_ext, 0,
15806       "Management action category", HFILL }},
15807
15808     {&hf_ieee80211_ff_action_code,
15809      {"Action code", "wlan_mgt.fixed.action_code",
15810       FT_UINT16, BASE_DEC, VALS(action_codes), 0,
15811       "Management action code", HFILL }},
15812
15813     {&hf_ieee80211_ff_dialog_token,
15814      {"Dialog token", "wlan_mgt.fixed.dialog_token",
15815       FT_UINT8, BASE_HEX, NULL, 0,
15816       "Management action dialog token", HFILL }},
15817
15818     {&hf_ieee80211_ff_marvell_action_type,
15819      {"Marvell Action type", "wlan_mgt.fixed.mrvl_action_type",
15820       FT_UINT8, BASE_DEC, VALS(vendor_action_types_mrvl), 0,
15821       "Vendor Specific Action Type (Marvell)", HFILL }},
15822
15823     {&hf_ieee80211_ff_marvell_mesh_mgt_action_code,
15824      {"Mesh action(Marvell)", "wlan_mgt.fixed.mrvl_mesh_action",
15825       FT_UINT8, BASE_HEX, VALS(mesh_mgt_action_codes_mrvl), 0,
15826       "Mesh action code(Marvell)", HFILL }},
15827
15828     {&hf_ieee80211_ff_marvell_mesh_mgt_length,
15829      {"Message Length", "wlan_mgt.fixed.length",
15830       FT_UINT8, BASE_DEC, NULL, 0,
15831       NULL, HFILL }},
15832
15833     {&hf_ieee80211_ff_marvell_mesh_mgt_mode,
15834      {"Message Mode", "wlan_mgt.fixed.mode",
15835       FT_UINT8, BASE_HEX, NULL, 0,
15836       NULL, HFILL }},
15837
15838     {&hf_ieee80211_ff_marvell_mesh_mgt_ttl,
15839      {"Message TTL", "wlan_mgt.fixed.ttl",
15840       FT_UINT8, BASE_DEC, NULL, 0,
15841       NULL, HFILL }},
15842
15843     {&hf_ieee80211_ff_marvell_mesh_mgt_dstcount,
15844      {"Destination Count", "wlan_mgt.fixed.dstcount",
15845       FT_UINT8, BASE_DEC, NULL, 0,
15846       NULL, HFILL }},
15847
15848     {&hf_ieee80211_ff_marvell_mesh_mgt_hopcount,
15849      {"Hop Count", "wlan_mgt.fixed.hopcount",
15850       FT_UINT8, BASE_DEC, NULL, 0,
15851       NULL, HFILL }},
15852
15853     {&hf_ieee80211_ff_marvell_mesh_mgt_rreqid,
15854      {"RREQ ID", "wlan_mgt.fixed.rreqid",
15855       FT_UINT32, BASE_DEC, NULL, 0,
15856       NULL, HFILL }},
15857
15858     {&hf_ieee80211_ff_marvell_mesh_mgt_sa,
15859      {"Source Address", "wlan_mgt.fixed.sa",
15860       FT_ETHER, BASE_NONE, NULL, 0,
15861       "Source MAC address", HFILL }},
15862
15863     {&hf_ieee80211_ff_marvell_mesh_mgt_ssn,
15864      {"SSN", "wlan_mgt.fixed.ssn",
15865       FT_UINT32, BASE_DEC, NULL, 0,
15866       "Source Sequence Number", HFILL }},
15867
15868     {&hf_ieee80211_ff_marvell_mesh_mgt_metric,
15869      {"Metric", "wlan_mgt.fixed.metric",
15870       FT_UINT32, BASE_DEC, NULL, 0,
15871       "Route Metric", HFILL }},
15872
15873     {&hf_ieee80211_ff_marvell_mesh_mgt_flags,
15874      {"RREQ Flags", "wlan_mgt.fixed.hopcount",
15875       FT_UINT8, BASE_HEX, NULL, 0,
15876       NULL, HFILL }},
15877
15878     {&hf_ieee80211_ff_marvell_mesh_mgt_da,
15879      {"Destination Address", "wlan_mgt.fixed.da",
15880       FT_ETHER, BASE_NONE, NULL, 0,
15881       "Destination MAC address", HFILL }},
15882
15883     {&hf_ieee80211_ff_marvell_mesh_mgt_dsn,
15884      {"DSN", "wlan_mgt.fixed.dsn",
15885       FT_UINT32, BASE_DEC, NULL, 0,
15886       "Destination Sequence Number", HFILL }},
15887
15888     {&hf_ieee80211_ff_marvell_mesh_mgt_lifetime,
15889      {"Lifetime", "wlan_mgt.fixed.lifetime",
15890       FT_UINT32, BASE_DEC, NULL, 0,
15891       "Route Lifetime", HFILL }},
15892
15893     {&hf_ieee80211_ff_wme_action_code,
15894      {"Action code", "wlan_mgt.fixed.action_code",
15895       FT_UINT16, BASE_HEX, VALS(wme_action_codes), 0,
15896       "Management notification action code", HFILL }},
15897
15898     {&hf_ieee80211_ff_wme_status_code,
15899      {"Status code", "wlan_mgt.fixed.status_code",
15900       FT_UINT16, BASE_HEX, VALS(wme_status_codes), 0,
15901       "Management notification setup response status code", HFILL }},
15902
15903     {&hf_ieee80211_ff_mesh_action,
15904      {"Mesh Action code", "wlan_mgt.fixed.mesh_action",
15905       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &mesh_action_ext, 0,
15906       NULL, HFILL }},
15907
15908     {&hf_ieee80211_ff_multihop_action,
15909      {"Multihop Action code", "wlan_mgt.fixed.multihop_action",
15910       FT_UINT8, BASE_HEX, VALS(multihop_action), 0,
15911       NULL, HFILL }},
15912
15913     {&hf_ieee80211_ff_mesh_flags,
15914      {"Mesh Flags", "wlan_mgt.fixed.mesh_flags",
15915       FT_UINT8, BASE_HEX, NULL, 0,
15916       NULL, HFILL }},
15917
15918     {&hf_ieee80211_ff_mesh_ttl,
15919      {"Mesh TTL", "wlan_mgt.fixed.mesh_ttl",
15920       FT_UINT8, BASE_HEX, NULL, 0,
15921       NULL, HFILL }},
15922
15923     {&hf_ieee80211_ff_mesh_sequence,
15924      {"Sequence Number", "wlan_mgt.fixed.mesh_sequence",
15925       FT_UINT32, BASE_HEX, NULL, 0,
15926       NULL, HFILL }},
15927
15928     {&hf_ieee80211_ff_mesh_addr4,
15929      {"Mesh Extended Address 4", "wlan_mgt.fixed.mesh_addr4",
15930       FT_ETHER, BASE_NONE, NULL, 0,
15931       NULL, HFILL }},
15932
15933     {&hf_ieee80211_ff_mesh_addr5,
15934      {"Mesh Extended Address 5", "wlan_mgt.fixed.mesh_addr5",
15935       FT_ETHER, BASE_NONE, NULL, 0,
15936       NULL, HFILL }},
15937
15938     {&hf_ieee80211_ff_mesh_addr6,
15939      {"Mesh Extended Address 6", "wlan_mgt.fixed.mesh_addr6",
15940       FT_ETHER, BASE_NONE, NULL, 0,
15941       NULL, HFILL }},
15942
15943     {&hf_ieee80211_ff_selfprot_action,
15944      {"Self-protected Action code", "wlan_mgt.fixed.selfprot_action",
15945       FT_UINT8, BASE_HEX, VALS(selfprot_action), 0,
15946       NULL, HFILL }},
15947
15948     {&hf_ieee80211_mesh_peering_proto,
15949      {"Mesh Peering Protocol ID", "wlan.peering.proto",
15950       FT_UINT16, BASE_HEX, VALS(mesh_peering_proto_ids), 0,
15951       NULL, HFILL }},
15952
15953     {&hf_ieee80211_mesh_peering_local_link_id,
15954      {"Local Link ID", "wlan.peering.local_id",
15955       FT_UINT16, BASE_HEX, NULL, 0,
15956       "Mesh Peering Management Local Link ID", HFILL }},
15957
15958     {&hf_ieee80211_mesh_peering_peer_link_id,
15959      {"Peer Link ID", "wlan.peering.peer_id",
15960       FT_UINT16, BASE_HEX, NULL, 0,
15961       "Mesh Peering Management Peer Link ID", HFILL }},
15962
15963     {&hf_ieee80211_ff_hwmp_flags,
15964      {"HWMP Flags", "wlan.hwmp.flags",
15965       FT_UINT8, BASE_HEX, NULL, 0,
15966       NULL, HFILL }},
15967
15968     {&hf_ieee80211_ff_hwmp_hopcount,
15969      {"HWMP Hop Count", "wlan.hwmp.hopcount",
15970       FT_UINT8, BASE_DEC, NULL, 0,
15971       NULL, HFILL }},
15972
15973     {&hf_ieee80211_ff_hwmp_ttl,
15974      {"HWMP TTL", "wlan.hwmp.ttl",
15975       FT_UINT8, BASE_DEC, NULL, 0,
15976       NULL, HFILL }},
15977
15978     {&hf_ieee80211_ff_hwmp_pdid,
15979      {"HWMP Path Discovery ID", "wlan.hwmp.pdid",
15980       FT_UINT32, BASE_DEC, NULL, 0,
15981       NULL, HFILL }},
15982
15983     {&hf_ieee80211_ff_hwmp_orig_sta,
15984      {"Originator STA Address", "wlan.hwmp.orig_sta",
15985       FT_ETHER, BASE_NONE, NULL, 0,
15986       NULL, HFILL }},
15987
15988     {&hf_ieee80211_ff_hwmp_orig_sn,
15989      {"HWMP Originator Sequence Number", "wlan.hwmp.orig_sn",
15990       FT_UINT32, BASE_DEC, NULL, 0,
15991       NULL, HFILL}},
15992
15993     {&hf_ieee80211_ff_hwmp_orig_ext,
15994      {"Originator External Address", "wlan.hwmp.orig_ext",
15995       FT_ETHER, BASE_NONE, NULL, 0,
15996       NULL, HFILL }},
15997
15998     {&hf_ieee80211_ff_hwmp_lifetime,
15999      {"HWMP Lifetime", "wlan.hwmp.lifetime",
16000       FT_UINT32, BASE_DEC, NULL, 0,
16001       NULL, HFILL }},
16002
16003     {&hf_ieee80211_ff_hwmp_metric,
16004      {"HWMP Metric", "wlan.hwmp.metric",
16005       FT_UINT32, BASE_DEC, NULL, 0,
16006       NULL, HFILL }},
16007
16008     {&hf_ieee80211_ff_hwmp_targ_count,
16009      {"HWMP Target Count", "wlan.hwmp.targ_count",
16010       FT_UINT8, BASE_DEC, NULL, 0,
16011       NULL, HFILL }},
16012
16013     {&hf_ieee80211_ff_hwmp_targ_flags,
16014      {"HWMP Per-Target Flags", "wlan.hwmp.targ_flags",
16015       FT_UINT8, BASE_HEX, NULL, 0,
16016       NULL, HFILL }},
16017
16018     {&hf_ieee80211_ff_hwmp_targ_to_flags,
16019      {"TO Flag", "wlan.hwmp.to_flag",
16020       FT_BOOLEAN, 8, TFS (&hwmp_targ_to_flags), 0x01,
16021       "Target Only Flag", HFILL }},
16022
16023     {&hf_ieee80211_ff_hwmp_targ_usn_flags,
16024      {"USN Flag", "wlan.hwmp.usn_flag",
16025       FT_BOOLEAN, 8, TFS (&hwmp_targ_usn_flags), 0x04,
16026       "Unknown Target HWMP Sequence Number Flag", HFILL }},
16027
16028     {&hf_ieee80211_ff_hwmp_targ_sta,
16029      {"Target STA Address", "wlan.hwmp.targ_sta",
16030       FT_ETHER, BASE_NONE, NULL, 0,
16031       NULL, HFILL }},
16032
16033     {&hf_ieee80211_ff_hwmp_targ_ext,
16034      {"Target External Address", "wlan.hwmp.targ_ext",
16035       FT_ETHER, BASE_NONE, NULL, 0,
16036       NULL, HFILL }},
16037
16038     {&hf_ieee80211_ff_hwmp_targ_sn,
16039      {"Target HWMP Sequence Number", "wlan.hwmp.targ_sn",
16040       FT_UINT32, BASE_DEC, NULL, 0,
16041       NULL, HFILL }},
16042
16043     {&hf_ieee80211_mesh_config_path_sel_protocol,
16044      {"Path Selection Protocol", "wlan.mesh.config.ps_protocol",
16045       FT_UINT8, BASE_HEX, NULL, 0,
16046       "Mesh Configuration Path Selection Protocol", HFILL }},
16047
16048     {&hf_ieee80211_mesh_config_path_sel_metric,
16049      {"Path Selection Metric", "wlan.mesh.config.ps_metric",
16050       FT_UINT8, BASE_HEX, NULL, 0,
16051       "Mesh Configuration Path Selection Metric", HFILL }},
16052
16053     {&hf_ieee80211_mesh_config_congestion_control,
16054      {"Congestion Control", "wlan.mesh.config.cong_ctl",
16055       FT_UINT8, BASE_HEX, NULL, 0,
16056       "Mesh Configuration Congestion Control", HFILL }},
16057
16058     {&hf_ieee80211_mesh_config_sync_method,
16059      {"Synchronization Method", "wlan.mesh.config.sync_method",
16060       FT_UINT8, BASE_HEX, NULL, 0,
16061       "Mesh Configuration Synchronization Method", HFILL }},
16062
16063     {&hf_ieee80211_mesh_config_auth_protocol,
16064      {"Authentication Protocol", "wlan.mesh.config.auth_protocol",
16065       FT_UINT8, BASE_HEX, NULL, 0,
16066       "Mesh Configuration Authentication Protocol", HFILL }},
16067
16068     {&hf_ieee80211_mesh_config_formation_info,
16069      {"Formation Info", "wlan.mesh.config.formation_info",
16070       FT_UINT8, BASE_HEX, NULL, 0,
16071       "Mesh Configuration Formation Info", HFILL }},
16072
16073     {&hf_ieee80211_mesh_config_capability,
16074      {"Capability", "wlan.mesh.config.cap",
16075       FT_UINT8, BASE_HEX, NULL, 0,
16076       "Mesh Configuration Capability", HFILL }},
16077
16078     {&hf_ieee80211_mesh_id,
16079      {"Mesh ID", "wlan.mesh.id",
16080       FT_STRING, BASE_NONE, NULL, 0,
16081       NULL, HFILL }},
16082
16083     {&hf_ieee80211_rann_flags,
16084      {"RANN Flags", "wlan.rann.flags",
16085       FT_UINT8, BASE_HEX, NULL, 0,
16086       "Root Announcement Flags", HFILL }},
16087
16088     {&hf_ieee80211_rann_root_sta,
16089      {"Root STA Address", "wlan.rann.root_sta", FT_ETHER, BASE_NONE, NULL, 0,
16090       "Root Mesh STA Address", HFILL }},
16091
16092     {&hf_ieee80211_rann_sn,
16093      {"Root STA Sequence Number", "wlan.rann.rann_sn",
16094       FT_UINT32, BASE_DEC, NULL, 0,
16095       "Root Mesh STA Sequence Number", HFILL }},
16096
16097     {&hf_ieee80211_rann_interval,
16098      {"RANN Interval", "wlan.rann.interval",
16099       FT_UINT32, BASE_DEC, NULL, 0,
16100       "Root Announcement Interval", HFILL }},
16101
16102     {&hf_ieee80211_ff_qos_action_code,
16103      {"Action code", "wlan_mgt.fixed.action_code",
16104       FT_UINT16, BASE_HEX, VALS(qos_action_codes), 0,
16105       "QoS management action code", HFILL }},
16106
16107     {&hf_ieee80211_ff_ba_action,
16108      {"Action code", "wlan_mgt.fixed.action_code",
16109       FT_UINT8, BASE_HEX, VALS(ba_action_codes), 0,
16110       "Block Ack action code", HFILL }},
16111
16112     {&hf_ieee80211_ff_dls_action_code,
16113      {"Action code", "wlan_mgt.fixed.action_code",
16114       FT_UINT16, BASE_HEX, VALS(dls_action_codes), 0,
16115       "DLS management action code", HFILL }},
16116
16117     {&hf_ieee80211_ff_dst_mac_addr,
16118      {"Destination address", "wlan_mgt.fixed.dst_mac_addr",
16119       FT_ETHER, BASE_NONE, NULL, 0,
16120       "Destination MAC address", HFILL }},
16121
16122     {&hf_ieee80211_ff_src_mac_addr,
16123      {"Source address", "wlan_mgt.fixed.src_mac_addr",
16124       FT_ETHER, BASE_NONE, NULL, 0,
16125       "Source MAC address", HFILL }},
16126
16127     {&hf_ieee80211_ff_ft_action_code,
16128      {"Action code", "wlan_mgt.fixed.action_code",
16129       FT_UINT8, BASE_DEC, VALS(ft_action_codes), 0,
16130       "Management action code", HFILL }},
16131
16132     {&hf_ieee80211_ff_sta_address,
16133      {"STA Address", "wlan_mgt.fixed.sta_address",
16134       FT_ETHER, BASE_NONE, NULL, 0,
16135       NULL, HFILL }},
16136
16137     {&hf_ieee80211_ff_target_ap_address,
16138      {"Target AP Address", "wlan_mgt.fixed.target_ap_address",
16139       FT_ETHER, BASE_NONE, NULL, 0,
16140       "Target AP MAC address", HFILL }},
16141
16142     {&hf_ieee80211_ff_gas_comeback_delay,
16143      {"GAS Comeback Delay", "wlan_mgt.fixed.gas_comeback_delay",
16144       FT_UINT16, BASE_DEC, NULL, 0,
16145       NULL, HFILL }},
16146
16147     {&hf_ieee80211_ff_gas_fragment_id,
16148      {"GAS Query Response Fragment ID", "wlan_mgt.fixed.gas_fragment_id",
16149       FT_UINT8, BASE_DEC, NULL, 0x7f,
16150       NULL, HFILL }},
16151
16152     {&hf_ieee80211_ff_more_gas_fragments,
16153      {"More GAS Fragments", "wlan_mgt.fixed.more_gas_fragments",
16154       FT_UINT8, BASE_DEC, NULL, 0x80,
16155       NULL, HFILL }},
16156
16157     {&hf_ieee80211_ff_query_request_length,
16158      {"Query Request Length", "wlan_mgt.fixed.query_request_length",
16159       FT_UINT16, BASE_DEC, NULL, 0,
16160       NULL, HFILL }},
16161
16162     {&hf_ieee80211_ff_query_request,
16163      {"Query Request", "wlan_mgt.fixed.query_request",
16164       FT_BYTES, BASE_NONE, NULL, 0,
16165       NULL, HFILL }},
16166
16167     {&hf_ieee80211_ff_query_response_length,
16168      {"Query Response Length", "wlan_mgt.fixed.query_response_length",
16169       FT_UINT16, BASE_DEC, NULL, 0,
16170       NULL, HFILL }},
16171
16172     {&hf_ieee80211_ff_query_response,
16173      {"Query Response", "wlan_mgt.fixed.query_response",
16174       FT_BYTES, BASE_NONE, NULL, 0,
16175       NULL, HFILL }},
16176
16177     {&hf_ieee80211_gas_resp_fragments,
16178      {"GAS Query Response fragments", "wlan_mgt.fixed.fragments",
16179       FT_NONE, BASE_NONE, NULL, 0x00,
16180       NULL, HFILL } },
16181
16182     {&hf_ieee80211_gas_resp_fragment,
16183      {"GAS Query Response fragment", "wlan_mgt.fixed.fragment",
16184       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
16185       NULL, HFILL } },
16186
16187     {&hf_ieee80211_gas_resp_fragment_overlap,
16188      {"GAS Query Response fragment overlap", "wlan_mgt.fixed.fragment.overlap",
16189       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
16190       NULL, HFILL } },
16191
16192     {&hf_ieee80211_gas_resp_fragment_overlap_conflict,
16193      {"GAS Query Response fragment overlapping with conflicting data", "wlan_mgt.fixed.fragment.overlap.conflicts",
16194       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
16195       NULL, HFILL } },
16196
16197     {&hf_ieee80211_gas_resp_fragment_multiple_tails,
16198      {"GAS Query Response has multiple tail fragments",  "wlan_mgt.fixed.fragment.multiple_tails",
16199       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
16200       NULL, HFILL } },
16201
16202     {&hf_ieee80211_gas_resp_fragment_too_long_fragment,
16203      {"GAS Query Response fragment too long", "wlan_mgt.fixed.fragment.too_long_fragment",
16204       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
16205       NULL, HFILL } },
16206
16207     {&hf_ieee80211_gas_resp_fragment_error,
16208      {"GAS Query Response reassembly error", "wlan_mgt.fixed.fragment.error",
16209       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
16210       NULL, HFILL } },
16211
16212     {&hf_ieee80211_gas_resp_fragment_count,
16213      {"GAS Query Response fragment count", "wlan_mgt.fixed.fragment.count",
16214       FT_UINT32, BASE_DEC, NULL, 0x00,
16215       NULL, HFILL } },
16216
16217     {&hf_ieee80211_gas_resp_reassembled_in,
16218      {"Reassembled in", "wlan_mgt.fixed.reassembled.in",
16219       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
16220       NULL, HFILL } },
16221
16222     {&hf_ieee80211_gas_resp_reassembled_length,
16223      {"Reassembled length", "wlan_mgt.fixed.reassembled.length",
16224       FT_UINT32, BASE_DEC, NULL, 0x00,
16225       NULL, HFILL } },
16226
16227     {&hf_ieee80211_ff_anqp_info_id,
16228      {"Info ID", "wlan_mgt.fixed.anqp.info_id",
16229       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
16230       "Access Network Query Protocol Info ID", HFILL }},
16231
16232     {&hf_ieee80211_ff_anqp_info_length,
16233      {"Length", "wlan_mgt.fixed.anqp.info_length",
16234       FT_UINT16, BASE_DEC, NULL, 0,
16235       "Access Network Query Protocol Length", HFILL }},
16236
16237     {&hf_ieee80211_ff_anqp_info,
16238      {"Information", "wlan_mgt.fixed.anqp.info",
16239       FT_BYTES, BASE_NONE, NULL, 0,
16240       "Access Network Query Protocol Information", HFILL }},
16241
16242     {&hf_ieee80211_ff_anqp_query_id,
16243      {"ANQP Query ID", "wlan_mgt.fixed.anqp.query_id",
16244       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
16245       "Access Network Query Protocol Query ID", HFILL }},
16246
16247     {&hf_ieee80211_ff_anqp_capability,
16248      {"ANQP Capability", "wlan_mgt.fixed.anqp.capability",
16249       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
16250       "Access Network Query Protocol Query ID", HFILL }},
16251
16252     {&hf_ieee80211_ff_anqp_capability_vlen,
16253      {"Vendor-specific Capability Length", "wlan_mgt.fixed.anqp.capability_vlen",
16254       FT_UINT16, BASE_DEC, NULL, 0,
16255       NULL, HFILL }},
16256
16257     {&hf_ieee80211_ff_anqp_capability_vendor,
16258      {"Vendor-specific Capability", "wlan_mgt.fixed.anqp.capability_vendor",
16259       FT_BYTES, BASE_NONE, NULL, 0,
16260       NULL, HFILL }},
16261
16262     {&hf_ieee80211_ff_venue_info_group,
16263      {"Venue Group", "wlan_mgt.fixed.venue_info.group",
16264       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &venue_group_vals_ext, 0,
16265       NULL, HFILL }},
16266
16267     {&hf_ieee80211_ff_venue_info_type,
16268      {"Venue Type", "wlan_mgt.fixed.venue_info.type",
16269       FT_UINT8, BASE_DEC, NULL, 0,
16270       NULL, HFILL }},
16271
16272     {&hf_ieee80211_ff_anqp_venue_length,
16273      {"Venue Name Duple Length", "wlan_mgt.fixed.anqp.venue.length",
16274       FT_UINT8, BASE_DEC, NULL, 0,
16275       NULL, HFILL }},
16276
16277     {&hf_ieee80211_ff_anqp_venue_language,
16278      {"Language Code", "wlan_mgt.fixed.anqp.venue.language",
16279       FT_STRING, BASE_NONE, NULL, 0,
16280       "Venue Name Language Code", HFILL }},
16281
16282     {&hf_ieee80211_ff_anqp_venue_name,
16283      {"Venue Name", "wlan_mgt.fixed.anqp.venue.name",
16284       FT_STRING, BASE_NONE, NULL, 0,
16285       NULL, HFILL }},
16286
16287     {&hf_ieee80211_ff_anqp_nw_auth_type_indicator,
16288      {"Network Authentication Type Indicator", "wlan_mgt.fixed.anqp.nw_auth_type.indicator",
16289       FT_UINT8, BASE_DEC, VALS(nw_auth_type_vals), 0,
16290       NULL, HFILL }},
16291
16292     {&hf_ieee80211_ff_anqp_nw_auth_type_url_len,
16293      {"Re-direct URL Length", "wlan_mgt.fixed.anqp.nw_auth_type.url_len",
16294       FT_UINT16, BASE_DEC, NULL, 0,
16295       NULL, HFILL }},
16296
16297     {&hf_ieee80211_ff_anqp_nw_auth_type_url,
16298      {"Re-direct URL", "wlan_mgt.fixed.anqp.nw_auth_type_url",
16299       FT_STRING, BASE_NONE, NULL, 0,
16300       NULL, HFILL }},
16301
16302     {&hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
16303      {"OI Length", "wlan_mgt.fixed.anqp.roaming_consortium.oi_len",
16304       FT_UINT8, BASE_DEC, NULL, 0,
16305       "Roaming Consortium OI Length", HFILL }},
16306
16307     {&hf_ieee80211_ff_anqp_roaming_consortium_oi,
16308      {"OI", "wlan_mgt.fixed.anqp.roaming_consortium.oi",
16309       FT_BYTES, BASE_NONE, NULL, 0,
16310       "Roaming Consortium OI", HFILL }},
16311
16312     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
16313      {"IPv6 Address", "wlan_mgt.fixed.anqp.ip_addr_availability.ipv6",
16314       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv6_vals), 0x03,
16315       "IP Address Type Availability information for IPv6", HFILL }},
16316
16317     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
16318      {"IPv4 Address", "wlan_mgt.fixed.anqp.ip_addr_availability.ipv4",
16319       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv4_vals), 0xfc,
16320       "IP Address Type Availability information for IPv4", HFILL }},
16321
16322     {&hf_ieee80211_ff_anqp_nai_realm_count,
16323      {"NAI Realm Count", "wlan_mgt.fixed.anqp.nai_realm_list.count",
16324       FT_UINT16, BASE_DEC, NULL, 0,
16325       NULL, HFILL }},
16326
16327     {&hf_ieee80211_ff_anqp_nai_field_len,
16328      {"NAI Realm Data Field Length", "wlan_mgt.fixed.anqp.nai_realm_list.field_len",
16329       FT_UINT16, BASE_DEC, NULL, 0,
16330       NULL, HFILL }},
16331
16332     {&hf_ieee80211_ff_anqp_nai_realm_encoding,
16333      {"NAI Realm Encoding", "wlan_mgt.fixed.naqp_nai_realm_list.encoding",
16334       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals), 0x01,
16335       NULL, HFILL }},
16336
16337     {&hf_ieee80211_ff_anqp_nai_realm_length,
16338      {"NAI Realm Length", "wlan_mgt.fixed.naqp_nai_realm_list.realm_length",
16339       FT_UINT8, BASE_DEC, NULL, 0,
16340       NULL, HFILL }},
16341
16342     {&hf_ieee80211_ff_anqp_nai_realm,
16343      {"NAI Realm", "wlan_mgt.fixed.naqp_nai_realm_list.realm",
16344       FT_STRING, BASE_NONE, NULL, 0,
16345       NULL, HFILL }},
16346
16347     {&hf_ieee80211_ff_anqp_nai_realm_eap_count,
16348      {"EAP Method Count", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method_count",
16349       FT_UINT8, BASE_DEC, NULL, 0,
16350       NULL, HFILL }},
16351
16352     {&hf_ieee80211_ff_anqp_nai_realm_eap_len,
16353      {"EAP Method subfield Length", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method_len",
16354       FT_UINT8, BASE_DEC, NULL, 0,
16355       NULL, HFILL }},
16356
16357     {&hf_ieee80211_ff_anqp_nai_realm_eap_method,
16358      {"EAP Method", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method",
16359       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &eap_type_vals_ext, 0,
16360       NULL, HFILL }},
16361
16362     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
16363      {"Authentication Parameter Count", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_count",
16364       FT_UINT8, BASE_DEC, NULL, 0,
16365       NULL, HFILL }},
16366
16367     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
16368      {"Authentication Parameter ID", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_id",
16369       FT_UINT8, BASE_DEC, VALS(nai_realm_auth_param_id_vals), 0,
16370       NULL, HFILL }},
16371
16372     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
16373      {"Authentication Parameter Length", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_len",
16374       FT_UINT8, BASE_DEC, NULL, 0,
16375       NULL, HFILL }},
16376
16377     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
16378      {"Authentication Parameter Value", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_value",
16379       FT_BYTES, BASE_NONE, NULL, 0,
16380       NULL, HFILL }},
16381
16382     {&hf_ieee80211_3gpp_gc_gud,
16383      {"GUD", "wlan_mgt.fixed.anqp.3gpp_cellular_info.gud",
16384       FT_UINT8, BASE_DEC, NULL, 0,
16385       "Generic container User Data", HFILL }},
16386
16387     {&hf_ieee80211_3gpp_gc_udhl,
16388      {"UDHL", "wlan_mgt.fixed.anqp.3gpp_cellular_info.udhl",
16389       FT_UINT8, BASE_DEC, NULL, 0,
16390       "User Data Header Length", HFILL }},
16391
16392     {&hf_ieee80211_3gpp_gc_iei,
16393      {"IEI", "wlan_mgt.fixed.anqp.3gpp_cellular_info.iei",
16394       FT_UINT8, BASE_DEC, NULL, 0,
16395       "Information Element Identity", HFILL }},
16396
16397     {&hf_ieee80211_3gpp_gc_plmn_len,
16398      {"PLMN Length", "wlan_mgt.fixed.anqp.3gpp_cellular_info.plmn_len",
16399       FT_UINT8, BASE_DEC, NULL, 0,
16400       "Length of PLMN List value contents", HFILL }},
16401
16402     {&hf_ieee80211_3gpp_gc_num_plmns,
16403      {"Number of PLMNs", "wlan_mgt.fixed.anqp.3gpp_cellular_info.num_plmns",
16404       FT_UINT8, BASE_DEC, NULL, 0,
16405       NULL, HFILL }},
16406
16407     {&hf_ieee80211_3gpp_gc_plmn,
16408      {"PLMN", "wlan_mgt.fixed.anqp.3gpp_cellular_info.plmn",
16409       FT_STRING, BASE_NONE, NULL, 0,
16410       "PLMN information", HFILL }},
16411
16412     {&hf_ieee80211_ff_anqp_domain_name_len,
16413      {"Domain Name Length", "wlan_mgt.fixed.anqp.domain_name_list.len",
16414       FT_UINT8, BASE_DEC, NULL, 0,
16415       NULL, HFILL }},
16416
16417     {&hf_ieee80211_ff_anqp_domain_name,
16418      {"Domain Name", "wlan_mgt.fixed.anqp.domain_name_list.name",
16419       FT_STRING, BASE_NONE, NULL, 0,
16420       NULL, HFILL }},
16421
16422     {&hf_ieee80211_ff_dls_timeout,
16423      {"DLS timeout", "wlan_mgt.fixed.dls_timeout",
16424       FT_UINT16, BASE_HEX, NULL, 0,
16425       "DLS timeout value", HFILL }},
16426
16427     {&hf_ieee80211_ff_sa_query_action_code,
16428      {"Action code", "wlan_mgt.fixed.action_code",
16429       FT_UINT8, BASE_DEC, VALS(sa_query_action_codes), 0,
16430       "Management action code", HFILL }},
16431
16432     {&hf_ieee80211_ff_transaction_id,
16433      {"Transaction Id", "wlan_mgt.fixed.transaction_id",
16434       FT_UINT16, BASE_HEX, NULL, 0,
16435       NULL, HFILL }},
16436
16437     {&hf_ieee80211_anqp_wfa_subtype,
16438      {"ANQP WFA Subtype", "wlan_mgt.anqp.wfa.subtype",
16439       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }},
16440
16441     {&hf_hs20_indication_dgaf_disabled,
16442      {"DGAF Disabled", "wlan_mgt.hs20.indication.dgaf_disabled",
16443       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
16444
16445     {&hf_hs20_anqp_subtype,
16446      {"Subtype", "wlan_mgt.hs20.anqp.subtype",
16447       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
16448       "Hotspot 2.0 ANQP Subtype", HFILL }},
16449
16450     {&hf_hs20_anqp_reserved,
16451      {"Reserved", "wlan_mgt.hs20.anqp.reserved",
16452       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16453
16454     {&hf_hs20_anqp_payload,
16455      {"Payload", "wlan_mgt.hs20.anqp.payload",
16456       FT_BYTES, BASE_NONE, NULL, 0,
16457       "Hotspot 2.0 ANQP Payload", HFILL }},
16458
16459     {&hf_hs20_anqp_hs_query_list,
16460      {"Queried Subtype", "wlan_mgt.hs20.anqp.hs_query_list",
16461       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
16462       "Queried HS 2.0 Element Subtype", HFILL }},
16463
16464     {&hf_hs20_anqp_hs_capability_list,
16465      {"Capability", "wlan_mgt.hs20.anqp.hs_capability_list",
16466       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
16467       "Hotspot 2.0 ANQP Subtype Capability", HFILL }},
16468
16469     {&hf_hs20_anqp_ofn_length,
16470      {"Length", "wlan_mgt.hs20.anqp.ofn.length",
16471       FT_UINT8, BASE_DEC, NULL, 0,
16472       "Operator Friendly Name Length", HFILL }},
16473
16474     {&hf_hs20_anqp_ofn_language,
16475      {"Language Code", "wlan_mgt.hs20.anqp.ofn.language",
16476       FT_STRING, BASE_NONE, NULL, 0,
16477       "Operator Friendly Name Language Code", HFILL }},
16478
16479     {&hf_hs20_anqp_ofn_name,
16480      {"Operator Friendly Name", "wlan_mgt.hs20.anqp.ofn.name",
16481       FT_STRING, BASE_NONE, NULL, 0,
16482       NULL, HFILL }},
16483
16484     {&hf_hs20_anqp_wan_metrics_link_status,
16485      {"Link Status", "wlan_mgt.hs20.anqp.wan_metrics.link_status",
16486       FT_UINT8, BASE_DEC, VALS(hs20_wm_link_status_vals), 0x03, NULL, HFILL }},
16487
16488     {&hf_hs20_anqp_wan_metrics_symmetric_link,
16489      {"Symmetric Link", "wlan_mgt.hs20.anqp.wan_metrics.symmetric_link",
16490       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
16491
16492     {&hf_hs20_anqp_wan_metrics_at_capacity,
16493      {"At Capacity", "wlan_mgt.hs20.anqp.wan_metrics.at_capacity",
16494       FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
16495
16496     {&hf_hs20_anqp_wan_metrics_reserved,
16497      {"Reserved", "wlan_mgt.hs20.anqp.wan_metrics.reserved",
16498       FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }},
16499
16500     {&hf_hs20_anqp_wan_metrics_downlink_speed,
16501      {"Downlink Speed", "wlan_mgt.hs20.anqp.wan_metrics.downlink_speed",
16502       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
16503
16504     {&hf_hs20_anqp_wan_metrics_uplink_speed,
16505      {"Uplink Speed", "wlan_mgt.hs20.anqp.wan_metrics.uplink_speed",
16506       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
16507
16508     {&hf_hs20_anqp_wan_metrics_downlink_load,
16509      {"Downlink Load", "wlan_mgt.hs20.anqp.wan_metrics.downlink_load",
16510       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16511
16512     {&hf_hs20_anqp_wan_metrics_uplink_load,
16513      {"Uplink Load", "wlan_mgt.hs20.anqp.wan_metrics.uplink_load",
16514       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16515
16516     {&hf_hs20_anqp_wan_metrics_lmd,
16517      {"LMD", "wlan_mgt.hs20.anqp.wan_metrics.lmd",
16518       FT_UINT16, BASE_DEC, NULL, 0, "Load Measurement Duration", HFILL }},
16519
16520     {&hf_hs20_anqp_cc_proto_ip_proto,
16521      {"IP Protocol", "wlan_mgt.hs20.anqp.cc.ip_proto",
16522       FT_UINT8, BASE_DEC, NULL, 0,
16523       "ProtoPort Tuple - IP Protocol", HFILL }},
16524
16525     {&hf_hs20_anqp_cc_proto_port_num,
16526      {"Port Number", "wlan_mgt.hs20.anqp.cc.port_num",
16527       FT_UINT16, BASE_DEC, NULL, 0,
16528       "ProtoPort Tuple - Port Number", HFILL }},
16529
16530     {&hf_hs20_anqp_cc_proto_status,
16531      {"Status", "wlan_mgt.hs20.anqp.cc.status",
16532       FT_UINT8, BASE_DEC, VALS(hs20_cc_status_vals), 0,
16533       "ProtoPort Tuple - Status", HFILL }},
16534
16535     {&hf_hs20_anqp_nai_hrq_count,
16536      {"NAI Home Realm Count", "wlan_mgt.hs20.anqp.nai_hrq.count",
16537       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16538
16539     {&hf_hs20_anqp_nai_hrq_encoding_type,
16540      {"NAI Home Realm Encoding Type",
16541       "wlan_mgt.hs20.anqp.nai_hrq.encoding_type",
16542       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals),
16543       0x01, NULL, HFILL }},
16544
16545     {&hf_hs20_anqp_nai_hrq_length,
16546      {"NAI Home Realm Name Length", "wlan_mgt.hs20.anqp.nai_hrq.length",
16547       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16548
16549     {&hf_hs20_anqp_nai_hrq_realm_name,
16550      {"NAI Home Realm Name", "wlan_mgt.hs20.anqp.nai_hrq.name",
16551       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
16552
16553     {&hf_hs20_anqp_oper_class_indic,
16554      {"Operating Class", "wlan_mgt.hs20.anqp.oper_class_indic.oper_class",
16555       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16556
16557     {&hf_ieee80211_tag,
16558      {"Tag", "wlan_mgt.tag",
16559       FT_NONE, BASE_NONE, 0x0, 0,
16560       NULL, HFILL }},
16561
16562     {&hf_ieee80211_tag_number,
16563      {"Tag Number", "wlan_mgt.tag.number",
16564       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
16565       "Element ID", HFILL }},
16566
16567     {&hf_ieee80211_tag_length,
16568      {"Tag length", "wlan_mgt.tag.length",
16569       FT_UINT32, BASE_DEC, NULL, 0,
16570       "Length of tag", HFILL }},
16571
16572     {&hf_ieee80211_tag_interpretation,
16573      {"Tag interpretation", "wlan_mgt.tag.interpretation",
16574       FT_STRING, BASE_NONE, NULL, 0,
16575       "Interpretation of tag", HFILL }},
16576
16577     {&hf_ieee80211_tag_data,
16578      {"Tag Data", "wlan_mgt.tag.data",
16579       FT_BYTES, BASE_NONE, NULL, 0,
16580       "Data Interpretation of tag", HFILL }},
16581
16582     {&hf_ieee80211_tag_oui,
16583      {"OUI", "wlan_mgt.tag.oui",
16584       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0, "OUI of vendor specific IE", HFILL }},
16585
16586     {&hf_ieee80211_tag_ds_param_channel,
16587      {"Current Channel", "wlan_mgt.ds.current_channel",
16588       FT_UINT8, BASE_DEC, NULL, 0,
16589       "DS Parameter Set - Current Channel", HFILL }},
16590
16591     {&hf_ieee80211_tag_cfp_count,
16592      {"CFP Count", "wlan_mgt.cfp.count",
16593       FT_UINT8, BASE_DEC, NULL, 0,
16594       "Indicates how many delivery traffic indication messages (DTIMs)", HFILL }},
16595
16596     {&hf_ieee80211_tag_cfp_period,
16597      {"CFP Period", "wlan_mgt.cfp.period",
16598       FT_UINT8, BASE_DEC, NULL, 0,
16599       "Indicates the number of DTIM intervals between the start of CFPs", HFILL }},
16600
16601     {&hf_ieee80211_tag_cfp_max_duration,
16602      {"CFP Max Duration", "wlan_mgt.cfp.max_duration",
16603       FT_UINT16, BASE_DEC, NULL, 0,
16604       "Indicates the maximum duration (in TU) of the CFP that may be generated by this PCF", HFILL }},
16605
16606     {&hf_ieee80211_tag_cfp_dur_remaining,
16607      {"CFP Dur Remaining", "wlan_mgt.cfp.dur_remaining",
16608       FT_UINT16, BASE_DEC, NULL, 0,
16609       "Indicates the maximum time (in TU) remaining in the present CFP", HFILL }},
16610
16611     {&hf_ieee80211_tag_vendor_oui_type,
16612      {"Vendor Specific OUI Type", "wlan_mgt.tag.vendor.oui.type",
16613       FT_UINT8, BASE_DEC, NULL, 0,
16614       NULL, HFILL }},
16615
16616     {&hf_ieee80211_tag_vendor_data,
16617      {"Vendor Specific Data", "wlan_mgt.tag.vendor.data",
16618       FT_BYTES, BASE_NONE, NULL, 0,
16619       "Unknown/undecoded Vendor Specific Data", HFILL }},
16620
16621     {&hf_ieee80211_tim_dtim_count,
16622      {"DTIM count", "wlan_mgt.tim.dtim_count",
16623       FT_UINT8, BASE_DEC, NULL, 0,
16624       "Indicates how many Beacon frames (including the current frame) appear before the next DTIM", HFILL }},
16625
16626     {&hf_ieee80211_tim_dtim_period,
16627      {"DTIM period", "wlan_mgt.tim.dtim_period",
16628       FT_UINT8, BASE_DEC, NULL, 0,
16629       "Indicates the number of beacon intervals between successive DTIMs", HFILL }},
16630
16631     {&hf_ieee80211_tim_bmapctl,
16632      {"Bitmap control", "wlan_mgt.tim.bmapctl",
16633       FT_UINT8, BASE_HEX, NULL, 0,
16634       NULL, HFILL }},
16635
16636     {&hf_ieee80211_tim_bmapctl_mcast,
16637      {"Multicast", "wlan_mgt.tim.bmapctl.multicast",
16638       FT_BOOLEAN, 8, NULL, 0x1,
16639       "Contains the Traffic Indicator bit associated with Association ID 0", HFILL }},
16640
16641     {&hf_ieee80211_tim_bmapctl_offset,
16642      {"Bitmap Offset", "wlan_mgt.tim.bmapctl.offset",
16643       FT_UINT8, BASE_HEX, NULL, 0xFE,
16644       NULL, HFILL }},
16645
16646     {&hf_ieee80211_tim_partial_virtual_bitmap,
16647      {"Partial Virtual Bitmap", "wlan_mgt.tim.partial_virtual_bitmap",
16648       FT_BYTES, BASE_NONE, NULL, 0x0,
16649       NULL, HFILL }},
16650
16651     {&hf_ieee80211_tag_ibss_atim_window,
16652      {"Atim Windows", "wlan_mgt.ibss.atim_windows",
16653       FT_UINT16, BASE_HEX, NULL, 0x0,
16654       "Contains the ATIM Window length in TU", HFILL }},
16655
16656     {&hf_ieee80211_tag_country_info_code,
16657      {"Code", "wlan_mgt.country_info.code",
16658       FT_STRING, BASE_NONE, NULL, 0x0,
16659       NULL, HFILL }},
16660
16661     {&hf_ieee80211_tag_country_info_env,
16662      {"Environment", "wlan_mgt.country_info.environment",
16663       FT_UINT8, BASE_HEX, VALS(environment_vals), 0x0,
16664       NULL, HFILL }},
16665
16666     {&hf_ieee80211_tag_country_info_pad,
16667      {"Padding", "wlan_mgt.country_info.padding",
16668       FT_BYTES, BASE_NONE, NULL, 0x0,
16669       NULL, HFILL }},
16670
16671     {&hf_ieee80211_tag_country_info_fnm,
16672      {"Country Info", "wlan_mgt.country_info.fnm",
16673       FT_NONE, BASE_NONE, NULL, 0x0,
16674       NULL, HFILL }},
16675
16676     {&hf_ieee80211_tag_country_info_fnm_fcn,
16677      {"First Channel Number", "wlan_mgt.country_info.fnm.fcn",
16678       FT_UINT8, BASE_DEC, NULL, 0x0,
16679       NULL, HFILL }},
16680
16681     {&hf_ieee80211_tag_country_info_fnm_nc,
16682      {"Number of Channels", "wlan_mgt.country_info.fnm.nc",
16683       FT_UINT8, BASE_DEC, NULL, 0x0,
16684       NULL, HFILL }},
16685
16686     {&hf_ieee80211_tag_country_info_fnm_mtpl,
16687      {"Maximum Transmit Power Level (in dBm)", "wlan_mgt.country_info.fnm.mtpl",
16688       FT_UINT8, BASE_DEC, NULL, 0x0,
16689       NULL, HFILL }},
16690
16691     {&hf_ieee80211_tag_country_info_rrc,
16692      {"Country Info", "wlan_mgt.country_info.rrc",
16693       FT_NONE, BASE_NONE, NULL, 0x0,
16694       NULL, HFILL }},
16695
16696     {&hf_ieee80211_tag_country_info_rrc_rei,
16697      {"Regulatory Extension Identifier", "wlan_mgt.country_info.rrc.rei",
16698       FT_UINT8, BASE_DEC, NULL, 0x0,
16699       NULL, HFILL }},
16700
16701     {&hf_ieee80211_tag_country_info_rrc_rc,
16702      {"Regulatory Class", "wlan_mgt.country_info.rrc.rc",
16703       FT_UINT8, BASE_DEC, NULL, 0x0,
16704       NULL, HFILL }},
16705
16706     {&hf_ieee80211_tag_country_info_rrc_cc,
16707      {"Coverage Class", "wlan_mgt.country_info.rrc.cc",
16708       FT_UINT8, BASE_DEC, NULL, 0x0,
16709       NULL, HFILL }},
16710
16711     {&hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
16712      {"Prime Radix", "wlan_mgt.fh_hopping.parameter.prime_radix",
16713       FT_UINT8, BASE_DEC, NULL, 0x0,
16714       NULL, HFILL }},
16715
16716     {&hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
16717      {"Number of Channels", "wlan_mgt.fh_hopping.parameter.nb_channels",
16718       FT_UINT8, BASE_DEC, NULL, 0x0,
16719       NULL, HFILL }},
16720
16721     {&hf_ieee80211_tag_fh_hopping_table_flag,
16722      {"Flag", "wlan_mgt.fh_hopping.table.flag",
16723       FT_UINT8, BASE_HEX, NULL, 0x0,
16724       "Indicates that a Random Table is present when the value is 1", HFILL }},
16725
16726     {&hf_ieee80211_tag_fh_hopping_table_number_of_sets,
16727      {"Number of Sets", "wlan_mgt.fh_hopping.table.number_of_sets",
16728       FT_UINT8, BASE_DEC, NULL, 0x0,
16729       "Indicates the total number of sets within the hopping patterns", HFILL }},
16730
16731     {&hf_ieee80211_tag_fh_hopping_table_modulus,
16732      {"Modulus", "wlan_mgt.fh_hopping.table.modulus",
16733       FT_UINT8, BASE_HEX, NULL, 0x0,
16734       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
16735
16736     {&hf_ieee80211_tag_fh_hopping_table_offset,
16737      {"Offset", "wlan_mgt.fh_hopping.table.offset",
16738       FT_UINT8, BASE_HEX, NULL, 0x0,
16739       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
16740
16741     {&hf_ieee80211_tag_fh_hopping_random_table,
16742      {"Random Table", "wlan_mgt.fh_hopping.table.random_table",
16743       FT_UINT16, BASE_HEX, NULL, 0x0,
16744       "It is a vector of single octet values that indicate the random sequence to be followed during a hopping sequence", HFILL }},
16745
16746     {&hf_ieee80211_tag_request,
16747      {"Requested Element ID", "wlan_mgt.tag.request",
16748       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
16749       "The list of elements that are to be included in the responding STA Probe Response frame", HFILL }},
16750
16751     {&hf_ieee80211_tclas_up,
16752      {"User Priority", "wlan_mgt.tclas.user_priority",
16753       FT_UINT8, BASE_DEC, NULL, 0,
16754       "Contains the value of the UP of the associated MSDUs", HFILL }},
16755
16756     {&hf_ieee80211_tclas_class_type,
16757      {"Classifier Type", "wlan_mgt.tclas.class_type",
16758       FT_UINT8, BASE_DEC, VALS (classifier_type), 0,
16759       "Specifies the type of classifier parameters", HFILL }},
16760
16761     {&hf_ieee80211_tclas_class_mask,
16762      {"Classifier Mask", "wlan_mgt.tclas.class_mask",
16763       FT_UINT8, BASE_HEX,  NULL, 0,
16764       "Specifies a bitmap where bits that are set to 1 identify a subset of the classifier parameters", HFILL }},
16765     {&hf_ieee80211_tclas_class_mask0_src_addr,
16766      {"Source Address", "wlan_mgt.tclas.class_mask.src_addr",
16767       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
16768     {&hf_ieee80211_tclas_class_mask0_dst_addr,
16769      {"Destination Address", "wlan_mgt.tclas.class_mask.dst_addr",
16770       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
16771     {&hf_ieee80211_tclas_class_mask0_type,
16772      {"Type", "wlan_mgt.tclas.class_mask.type",
16773       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
16774     {&hf_ieee80211_tclas_class_mask1_ver,
16775      {"Version", "wlan_mgt.tclas.class_mask.version",
16776       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
16777     {&hf_ieee80211_tclas_class_mask1_src_ip,
16778      {"Source IP Address", "wlan_mgt.tclas.class_mask.src_ip",
16779       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
16780     {&hf_ieee80211_tclas_class_mask1_dst_ip,
16781      {"Destination IP Address", "wlan_mgt.tclas.class_mask.dst_ip",
16782       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
16783     {&hf_ieee80211_tclas_class_mask1_src_port,
16784      {"Source Port", "wlan_mgt.tclas.class_mask.src_port",
16785       FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL }},
16786     {&hf_ieee80211_tclas_class_mask1_dst_port,
16787      {"Destination Port", "wlan_mgt.tclas.class_mask.dst_port",
16788       FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL }},
16789     {&hf_ieee80211_tclas_class_mask1_ipv4_dscp,
16790      {"DSCP", "wlan_mgt.tclas.class_mask.dscp",
16791       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
16792     {&hf_ieee80211_tclas_class_mask1_ipv4_proto,
16793      {"Protocol", "wlan_mgt.tclas.class_mask.proto",
16794       FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL }},
16795     {&hf_ieee80211_tclas_class_mask1_ipv6_flow,
16796      {"Flow Label", "wlan_mgt.tclas.class_mask.flow_label",
16797       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
16798     {&hf_ieee80211_tclas_class_mask2_tci,
16799      {"802.1Q CLAN TCI", "wlan_mgt.tclas.class_mask.tci",
16800       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
16801
16802     {&hf_ieee80211_tclas_src_mac_addr,
16803      {"Source address", "wlan_mgt.tclas.type",
16804       FT_ETHER, BASE_NONE, NULL, 0,
16805       "Classifier Parameters Ethernet Type", HFILL }},
16806
16807     {&hf_ieee80211_tclas_dst_mac_addr,
16808      {"Destination address", "wlan_mgt.tclas.type",
16809       FT_ETHER, BASE_NONE, NULL, 0,
16810       NULL, HFILL }},
16811
16812     {&hf_ieee80211_tclas_ether_type,
16813      {"Ethernet Type", "wlan_mgt.tclas.type",
16814       FT_UINT8, BASE_DEC, NULL, 0,
16815       NULL, HFILL }},
16816
16817     {&hf_ieee80211_tclas_version,
16818      {"IP Version", "wlan_mgt.tclas.version",
16819       FT_UINT8, BASE_DEC, NULL, 0,
16820       NULL, HFILL }},
16821
16822     {&hf_ieee80211_tclas_ipv4_src,
16823      {"IPv4 Src Addr", "wlan_mgt.tclas.ipv4_src",
16824       FT_IPv4, BASE_NONE, NULL, 0,
16825       NULL, HFILL }},
16826
16827     {&hf_ieee80211_tclas_ipv4_dst,
16828      {"IPv4 Dst Addr", "wlan_mgt.tclas.ipv4_dst",
16829       FT_IPv4, BASE_NONE, NULL, 0,
16830       NULL, HFILL }},
16831
16832     {&hf_ieee80211_tclas_src_port,
16833      {"Source Port", "wlan_mgt.tclas.src_port",
16834       FT_UINT16, BASE_DEC, NULL, 0,
16835       NULL, HFILL }},
16836
16837     {&hf_ieee80211_tclas_dst_port,
16838      {"Destination Port", "wlan_mgt.tclas.dst_port",
16839       FT_UINT16, BASE_DEC, NULL, 0,
16840       NULL, HFILL }},
16841
16842     {&hf_ieee80211_tclas_dscp,
16843      {"IPv4 DSCP", "wlan_mgt.tclas.dscp",
16844       FT_UINT8, BASE_HEX, NULL, 0,
16845       "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
16846
16847     {&hf_ieee80211_tclas_protocol,
16848      {"Protocol", "wlan_mgt.tclas.protocol",
16849       FT_UINT8, BASE_HEX, NULL, 0,
16850       "IPv4 Protocol", HFILL }},
16851
16852     {&hf_ieee80211_tclas_ipv6_src,
16853      {"IPv6 Src Addr", "wlan_mgt.tclas.ipv6_src",
16854       FT_IPv6, BASE_NONE, NULL, 0,
16855       NULL, HFILL }},
16856
16857     {&hf_ieee80211_tclas_ipv6_dst,
16858      {"IPv6 Dst Addr", "wlan_mgt.tclas.ipv6_dst",
16859       FT_IPv6, BASE_NONE, NULL, 0,
16860       NULL, HFILL }},
16861
16862     {&hf_ieee80211_tclas_flow,
16863      {"Flow Label", "wlan_mgt.tclas.flow",
16864       FT_UINT24, BASE_HEX, NULL, 0,
16865       "IPv6 Flow Label", HFILL }},
16866
16867     {&hf_ieee80211_tclas_tag_type,
16868      {"802.1Q Tag Type", "wlan_mgt.tclas.tag_type",
16869       FT_UINT16, BASE_HEX, NULL, 0,
16870       NULL, HFILL }},
16871
16872     {&hf_ieee80211_tag_challenge_text,
16873      {"Challenge Text", "wlan_mgt.tag.challenge_text",
16874       FT_BYTES, BASE_NONE, NULL, 0,
16875       NULL, HFILL }},
16876
16877     {&hf_ieee80211_rsn_version,
16878      {"RSN Version", "wlan_mgt.rsn.version",
16879       FT_UINT16, BASE_DEC, NULL, 0,
16880       "Indicates the version number of the RSNA protocol", HFILL }},
16881
16882     {&hf_ieee80211_rsn_gcs,
16883      {"Group Cipher Suite", "wlan_mgt.rsn.gcs",
16884       FT_UINT32, BASE_CUSTOM, rsn_gcs_base_custom, 0,
16885       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
16886
16887     {&hf_ieee80211_rsn_gcs_oui,
16888      {"Group Cipher Suite OUI", "wlan_mgt.rsn.gcs.oui",
16889       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
16890       NULL, HFILL }},
16891
16892     {&hf_ieee80211_rsn_gcs_type,
16893      {"Group Cipher Suite type", "wlan_mgt.rsn.gcs.type",
16894       FT_UINT8, BASE_DEC, NULL, 0,
16895       NULL, HFILL }},
16896
16897     {&hf_ieee80211_rsn_gcs_80211_type,
16898      {"Group Cipher Suite type", "wlan_mgt.rsn.gcs.type",
16899       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
16900       NULL, HFILL }},
16901
16902     {&hf_ieee80211_rsn_pcs_count,
16903      {"Pairwise Cipher Suite Count", "wlan_mgt.rsn.pcs.count",
16904       FT_UINT16, BASE_DEC,  NULL, 0,
16905       "Indicates the number of pairwise cipher suite selectors that are contained in the Pairwise Cipher Suite List", HFILL }},
16906
16907     {&hf_ieee80211_rsn_pcs_list,
16908      {"Pairwise Cipher Suite List", "wlan_mgt.rsn.pcs.list",
16909       FT_NONE, BASE_NONE, NULL, 0,
16910       "Contains a series of cipher suite selectors that indicate the pairwisecipher suites", HFILL }},
16911
16912     {&hf_ieee80211_rsn_pcs,
16913      {"Pairwise Cipher Suite", "wlan_mgt.rsn.pcs",
16914       FT_UINT32, BASE_CUSTOM, rsn_pcs_base_custom, 0,
16915       NULL, HFILL }},
16916
16917     {&hf_ieee80211_rsn_pcs_oui,
16918      {"Pairwise Cipher Suite OUI", "wlan_mgt.rsn.pcs.oui",
16919       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
16920       NULL, HFILL }},
16921
16922     {&hf_ieee80211_rsn_pcs_type,
16923      {"Pairwise Cipher Suite type", "wlan_mgt.rsn.pcs.type",
16924       FT_UINT8, BASE_DEC, NULL, 0,
16925       NULL, HFILL }},
16926
16927     {&hf_ieee80211_rsn_pcs_80211_type,
16928      {"Pairwise Cipher Suite type", "wlan_mgt.rsn.pcs.type",
16929       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
16930       NULL, HFILL }},
16931
16932     {&hf_ieee80211_rsn_akms_count,
16933      {"Auth Key Management (AKM) Suite Count", "wlan_mgt.rsn.akms.count",
16934       FT_UINT16, BASE_DEC, NULL, 0,
16935       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
16936
16937     {&hf_ieee80211_rsn_akms_list,
16938      {"Auth Key Management (AKM) List", "wlan_mgt.rsn.akms.list",
16939       FT_NONE, BASE_NONE, NULL, 0,
16940       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
16941
16942     {&hf_ieee80211_rsn_akms,
16943      {"Auth Key Management (AKM) Suite", "wlan_mgt.rsn.akms",
16944       FT_UINT32, BASE_CUSTOM, rsn_akms_base_custom, 0,
16945       NULL, HFILL }},
16946
16947     {&hf_ieee80211_rsn_akms_oui,
16948      {"Auth Key Management (AKM) OUI", "wlan_mgt.rsn.akms.oui",
16949       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
16950       NULL, HFILL }},
16951
16952     {&hf_ieee80211_rsn_akms_type,
16953      {"Auth Key Management (AKM) type", "wlan_mgt.rsn.akms.type",
16954       FT_UINT8, BASE_DEC, NULL, 0,
16955       NULL, HFILL }},
16956
16957     {&hf_ieee80211_rsn_akms_80211_type,
16958      {"Auth Key Management (AKM) type", "wlan_mgt.rsn.akms.type",
16959       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_keymgmt_vals), 0,
16960       NULL, HFILL }},
16961
16962     {&hf_ieee80211_rsn_cap,
16963      {"RSN Capabilities", "wlan_mgt.rsn.capabilities",
16964       FT_UINT16, BASE_HEX, NULL, 0,
16965       "RSN Capability information", HFILL }},
16966
16967     {&hf_ieee80211_rsn_cap_preauth,
16968      {"RSN Pre-Auth capabilities", "wlan_mgt.rsn.capabilities.preauth",
16969       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001,
16970       NULL, HFILL }},
16971
16972     {&hf_ieee80211_rsn_cap_no_pairwise,
16973      {"RSN No Pairwise capabilities", "wlan_mgt.rsn.capabilities.no_pairwise",
16974       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002,
16975       NULL, HFILL }},
16976
16977     {&hf_ieee80211_rsn_cap_ptksa_replay_counter,
16978      {"RSN PTKSA Replay Counter capabilities", "wlan_mgt.rsn.capabilities.ptksa_replay_counter",
16979       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C,
16980       NULL, HFILL }},
16981
16982     {&hf_ieee80211_rsn_cap_gtksa_replay_counter,
16983      {"RSN GTKSA Replay Counter capabilities", "wlan_mgt.rsn.capabilities.gtksa_replay_counter",
16984       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030,
16985       NULL, HFILL }},
16986
16987     {&hf_ieee80211_rsn_cap_mfpr,
16988      {"Management Frame Protection Required", "wlan_mgt.rsn.capabilities.mfpr",
16989       FT_BOOLEAN, 16, NULL, 0x0040,
16990       NULL, HFILL }},
16991
16992     {&hf_ieee80211_rsn_cap_mfpc,
16993      {"Management Frame Protection Capable", "wlan_mgt.rsn.capabilities.mfpc",
16994       FT_BOOLEAN, 16, NULL, 0x0080,
16995       NULL, HFILL }},
16996
16997     {&hf_ieee80211_rsn_cap_peerkey,
16998      {"PeerKey Enabled", "wlan_mgt.rsn.capabilities.peerkey",
16999       FT_BOOLEAN, 16, NULL, 0x0200,
17000       NULL, HFILL }},
17001
17002     {&hf_ieee80211_rsn_pmkid_count,
17003      {"PMKID Count", "wlan_mgt.rsn.pmkid.count",
17004       FT_UINT16, BASE_DEC, NULL, 0,
17005       "Indicates the number of PMKID  selectors that are contained in the PMKID Suite List", HFILL }},
17006
17007     {&hf_ieee80211_rsn_pmkid_list,
17008      {"PMKID List", "wlan_mgt.rsn.pmkid.list",
17009       FT_NONE, BASE_NONE, NULL, 0,
17010       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
17011
17012     {&hf_ieee80211_rsn_pmkid,
17013      {"PMKID", "wlan_mgt.pmkid.akms",
17014       FT_BYTES, BASE_NONE, NULL, 0,
17015       NULL, HFILL }},
17016
17017     {&hf_ieee80211_rsn_gmcs,
17018      {"Group Management Cipher Suite", "wlan_mgt.rsn.gmcs",
17019       FT_UINT32, BASE_CUSTOM, rsn_gmcs_base_custom, 0,
17020       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
17021
17022     {&hf_ieee80211_rsn_gmcs_oui,
17023      {"Group Management Cipher Suite OUI", "wlan_mgt.rsn.gmcs.oui",
17024       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
17025       NULL, HFILL }},
17026
17027     {&hf_ieee80211_rsn_gmcs_type,
17028      {"Group Management Cipher Suite type", "wlan_mgt.rsn.gmcs.type",
17029       FT_UINT8, BASE_DEC, NULL, 0,
17030       NULL, HFILL }},
17031
17032     {&hf_ieee80211_rsn_gmcs_80211_type,
17033      {"Group Management Cipher Suite type", "wlan_mgt.rsn.gmcs.type",
17034       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
17035       NULL, HFILL }},
17036
17037     {&hf_ieee80211_ht_pren_type,
17038      {"802.11n (Pre) Type", "wlan_mgt.vs.pren.type",
17039       FT_UINT8, BASE_DEC, VALS(ieee80211_ht_pren_type_vals), 0,
17040       "Vendor Specific HT Type", HFILL }},
17041     {&hf_ieee80211_ht_pren_unknown,
17042      {"802.11n (Pre) Unknown Data", "wlan_mgt.vs.pren.unknown_data",
17043       FT_BYTES, BASE_NONE, NULL, 0,
17044       NULL, HFILL }},
17045
17046     {&hf_ieee80211_ht_cap,
17047      {"HT Capabilities Info", "wlan_mgt.ht.capabilities",
17048       FT_UINT16, BASE_HEX, NULL, 0,
17049       "HT Capabilities information", HFILL }},
17050
17051     {&hf_ieee80211_ht_vs_cap,
17052      {"HT Capabilities Info (VS)", "wlan_mgt.vs.ht.capabilities",
17053       FT_UINT16, BASE_HEX, NULL, 0,
17054       "Vendor Specific HT Capabilities information", HFILL }},
17055
17056     {&hf_ieee80211_ht_ldpc_coding,
17057      {"HT LDPC coding capability", "wlan_mgt.ht.capabilities.ldpccoding",
17058       FT_BOOLEAN, 16, TFS (&ht_ldpc_coding_flag), 0x0001,
17059       NULL, HFILL }},
17060
17061     {&hf_ieee80211_ht_chan_width,
17062      {"HT Support channel width", "wlan_mgt.ht.capabilities.width",
17063       FT_BOOLEAN, 16, TFS (&ht_chan_width_flag), 0x0002,
17064       NULL, HFILL }},
17065
17066     {&hf_ieee80211_ht_sm_pwsave,
17067      {"HT SM Power Save", "wlan_mgt.ht.capabilities.sm",
17068       FT_UINT16, BASE_HEX, VALS(ht_sm_pwsave_flag), 0x000c,
17069       NULL, HFILL }},
17070
17071     {&hf_ieee80211_ht_green,
17072      {"HT Green Field", "wlan_mgt.ht.capabilities.green",
17073       FT_BOOLEAN, 16, TFS (&ht_green_flag), 0x0010,
17074       NULL, HFILL }},
17075
17076     {&hf_ieee80211_ht_short20,
17077      {"HT Short GI for 20MHz", "wlan_mgt.ht.capabilities.short20",
17078       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0020,
17079       NULL, HFILL }},
17080
17081     {&hf_ieee80211_ht_short40,
17082      {"HT Short GI for 40MHz", "wlan_mgt.ht.capabilities.short40",
17083       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0040,
17084       NULL, HFILL }},
17085
17086     {&hf_ieee80211_ht_tx_stbc,
17087      {"HT Tx STBC", "wlan_mgt.ht.capabilities.txstbc",
17088       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0080,
17089       NULL, HFILL }},
17090
17091     {&hf_ieee80211_ht_rx_stbc,
17092      {"HT Rx STBC", "wlan_mgt.ht.capabilities.rxstbc",
17093       FT_UINT16, BASE_HEX, VALS(ht_rx_stbc_flag), 0x0300,
17094       "HT Tx STBC", HFILL }},
17095
17096     {&hf_ieee80211_ht_delayed_block_ack,
17097      {"HT Delayed Block ACK", "wlan_mgt.ht.capabilities.delayedblockack",
17098       FT_BOOLEAN, 16, TFS (&ht_delayed_block_ack_flag), 0x0400,
17099       NULL, HFILL }},
17100
17101     {&hf_ieee80211_ht_max_amsdu,
17102      {"HT Max A-MSDU length", "wlan_mgt.ht.capabilities.amsdu",
17103       FT_BOOLEAN, 16, TFS (&ht_max_amsdu_flag), 0x0800,
17104       NULL, HFILL }},
17105
17106     {&hf_ieee80211_ht_dss_cck_40,
17107      {"HT DSSS/CCK mode in 40MHz", "wlan_mgt.ht.capabilities.dsscck",
17108       FT_BOOLEAN, 16, TFS (&ht_dss_cck_40_flag), 0x1000,
17109       "HT DSS/CCK mode in 40MHz", HFILL }},
17110
17111     {&hf_ieee80211_ht_psmp,
17112      {"HT PSMP Support", "wlan_mgt.ht.capabilities.psmp",
17113       FT_BOOLEAN, 16, TFS (&ht_psmp_flag), 0x2000,
17114       NULL, HFILL }},
17115
17116     {&hf_ieee80211_ht_40_mhz_intolerant,
17117      {"HT Forty MHz Intolerant", "wlan_mgt.ht.capabilities.40mhzintolerant",
17118       FT_BOOLEAN, 16, TFS (&ht_40_mhz_intolerant_flag), 0x4000,
17119       NULL, HFILL }},
17120
17121     {&hf_ieee80211_ht_l_sig,
17122      {"HT L-SIG TXOP Protection support", "wlan_mgt.ht.capabilities.lsig",
17123       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x8000,
17124       NULL, HFILL }},
17125
17126     {&hf_ieee80211_ampduparam,
17127      {"A-MPDU Parameters", "wlan_mgt.ht.ampduparam",
17128       FT_UINT8, BASE_HEX, NULL, 0,
17129       NULL, HFILL }},
17130
17131     {&hf_ieee80211_ampduparam_vs,
17132      {"A-MPDU Parameters (VS)", "wlan_mgt.vs.ht.ampduparam",
17133       FT_UINT8, BASE_HEX, NULL, 0,
17134       "Vendor Specific A-MPDU Parameters", HFILL }},
17135
17136     {&hf_ieee80211_ampduparam_mpdu,
17137      {"Maximum Rx A-MPDU Length", "wlan_mgt.ht.ampduparam.maxlength",
17138       FT_UINT8, BASE_HEX, 0, 0x03,
17139       NULL, HFILL }},
17140
17141     {&hf_ieee80211_ampduparam_mpdu_start_spacing,
17142      {"MPDU Density", "wlan_mgt.ht.ampduparam.mpdudensity",
17143       FT_UINT8, BASE_HEX, VALS(&ampduparam_mpdu_start_spacing_flags), 0x1c,
17144       NULL, HFILL }},
17145
17146     {&hf_ieee80211_ampduparam_reserved,
17147      {"Reserved", "wlan_mgt.ht.ampduparam.reserved",
17148       FT_UINT8, BASE_HEX, NULL, 0xE0,
17149       NULL, HFILL }},
17150
17151     {&hf_ieee80211_mcsset,
17152      {"Rx Supported Modulation and Coding Scheme Set", "wlan_mgt.ht.mcsset",
17153       FT_STRING, BASE_NONE, NULL, 0,
17154       NULL, HFILL }},
17155
17156     {&hf_ieee80211_mcsset_vs,
17157      {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan_mgt.vs.ht.mcsset",
17158       FT_STRING, BASE_NONE, NULL, 0,
17159       "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
17160
17161     {&hf_ieee80211_mcsset_rx_bitmask,
17162      {"Rx Modulation and Coding Scheme (One bit per modulation)", "wlan_mgt.ht.mcsset.rxbitmask",
17163       FT_NONE, BASE_NONE, NULL, 0,
17164       "One bit per modulation", HFILL }},
17165
17166     {&hf_ieee80211_mcsset_rx_bitmask_0to7,
17167      {"Rx Bitmask Bits 0-7", "wlan_mgt.ht.mcsset.rxbitmask.0to7",
17168       FT_UINT32, BASE_HEX, 0, 0x000000ff,
17169       NULL, HFILL }},
17170
17171     {&hf_ieee80211_mcsset_rx_bitmask_8to15,
17172      {"Rx Bitmask Bits 8-15", "wlan_mgt.ht.mcsset.rxbitmask.8to15",
17173       FT_UINT32, BASE_HEX, 0, 0x0000ff00,
17174       NULL, HFILL }},
17175
17176     {&hf_ieee80211_mcsset_rx_bitmask_16to23,
17177      {"Rx Bitmask Bits 16-23", "wlan_mgt.ht.mcsset.rxbitmask.16to23",
17178       FT_UINT32, BASE_HEX, 0, 0x00ff0000,
17179       NULL, HFILL }},
17180
17181     {&hf_ieee80211_mcsset_rx_bitmask_24to31,
17182      {"Rx Bitmask Bits 24-31", "wlan_mgt.ht.mcsset.rxbitmask.24to31",
17183       FT_UINT32, BASE_HEX, 0, 0xff000000,
17184       NULL, HFILL }},
17185
17186     {&hf_ieee80211_mcsset_rx_bitmask_32,
17187      {"Rx Bitmask Bit 32", "wlan_mgt.ht.mcsset.rxbitmask.32",
17188       FT_UINT32, BASE_HEX, 0, 0x000001,
17189       NULL, HFILL }},
17190
17191     {&hf_ieee80211_mcsset_rx_bitmask_33to38,
17192      {"Rx Bitmask Bits 33-38", "wlan_mgt.ht.mcsset.rxbitmask.33to38",
17193       FT_UINT32, BASE_HEX, 0, 0x00007e,
17194       NULL, HFILL }},
17195
17196     {&hf_ieee80211_mcsset_rx_bitmask_39to52,
17197      {"Rx Bitmask Bits 39-52", "wlan_mgt.ht.mcsset.rxbitmask.39to52",
17198       FT_UINT32, BASE_HEX, 0, 0x1fff80,
17199       NULL, HFILL }},
17200
17201     {&hf_ieee80211_mcsset_rx_bitmask_53to76,
17202      {"Rx Bitmask Bits 53-76", "wlan_mgt.ht.mcsset.rxbitmask.53to76",
17203       FT_UINT32, BASE_HEX, 0, 0x1fffffe0,
17204       NULL, HFILL }},
17205
17206     {&hf_ieee80211_mcsset_highest_data_rate,
17207      {"Highest Supported Data Rate", "wlan_mgt.ht.mcsset.highestdatarate",
17208       FT_UINT16, BASE_HEX, 0, 0x03ff,
17209       NULL, HFILL }},
17210
17211     {&hf_ieee80211_mcsset_tx_mcs_set_defined,
17212      {"Tx Supported MCS Set", "wlan_mgt.ht.mcsset.txsetdefined",
17213       FT_BOOLEAN, 16, TFS (&mcsset_tx_mcs_set_defined_flag), 0x0001,
17214       NULL, HFILL }},
17215
17216     {&hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal,
17217      {"Tx and Rx MCS Set", "wlan_mgt.ht.mcsset.txrxmcsnotequal",
17218       FT_BOOLEAN, 16, TFS (&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
17219       NULL, HFILL }},
17220
17221     {&hf_ieee80211_mcsset_tx_max_spatial_streams,
17222      {"Tx Maximum Number of Spatial Streams Supported", "wlan_mgt.ht.mcsset.txmaxss",
17223       FT_UINT16, BASE_HEX, VALS(mcsset_tx_max_spatial_streams_flags) , 0x000c,
17224       NULL, HFILL }},
17225
17226     {&hf_ieee80211_mcsset_tx_unequal_modulation,
17227      {"Unequal Modulation", "wlan_mgt.ht.mcsset.txunequalmod",
17228       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0010,
17229       NULL, HFILL }},
17230
17231     {&hf_ieee80211_htex_cap,
17232      {"HT Extended Capabilities", "wlan_mgt.htex.capabilities",
17233       FT_UINT16, BASE_HEX, NULL, 0,
17234       "HT Extended Capability information", HFILL }},
17235
17236     {&hf_ieee80211_htex_vs_cap,
17237      {"HT Extended Capabilities (VS)", "wlan_mgt.vs.htex.capabilities",
17238       FT_UINT16, BASE_HEX, NULL, 0,
17239       "Vendor Specific HT Extended Capability information", HFILL }},
17240
17241     {&hf_ieee80211_htex_pco,
17242      {"Transmitter supports PCO", "wlan_mgt.htex.capabilities.pco",
17243       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0001,
17244       NULL, HFILL }},
17245
17246     {&hf_ieee80211_htex_transtime,
17247      {"Time needed to transition between 20MHz and 40MHz", "wlan_mgt.htex.capabilities.transtime",
17248       FT_UINT16, BASE_HEX, VALS(htex_transtime_flags), 0x0006,
17249       NULL, HFILL }},
17250
17251     {&hf_ieee80211_htex_mcs,
17252      {"MCS Feedback capability", "wlan_mgt.htex.capabilities.mcs",
17253       FT_UINT16, BASE_HEX, VALS(htex_mcs_flags), 0x0300,
17254       NULL, HFILL }},
17255
17256     {&hf_ieee80211_htex_htc_support,
17257      {"High Throughput", "wlan_mgt.htex.capabilities.htc",
17258       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0400,
17259       NULL, HFILL }},
17260
17261     {&hf_ieee80211_htex_rd_responder,
17262      {"Reverse Direction Responder", "wlan_mgt.htex.capabilities.rdresponder",
17263       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0800,
17264       NULL, HFILL }},
17265
17266     {&hf_ieee80211_txbf,
17267      {"Transmit Beam Forming (TxBF) Capabilities", "wlan_mgt.txbf",
17268       FT_UINT16, BASE_HEX, NULL, 0,
17269       NULL, HFILL }},
17270
17271     {&hf_ieee80211_txbf_vs,
17272      {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan_mgt.vs.txbf",
17273       FT_UINT16, BASE_HEX, NULL, 0,
17274       "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
17275
17276     {&hf_ieee80211_txbf_cap,
17277      {"Transmit Beamforming", "wlan_mgt.txbf.txbf",
17278       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000001,
17279       NULL, HFILL }},
17280
17281     {&hf_ieee80211_txbf_rcv_ssc,
17282      {"Receive Staggered Sounding", "wlan_mgt.txbf.rxss",
17283       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000002,
17284       NULL, HFILL }},
17285
17286     {&hf_ieee80211_txbf_tx_ssc,
17287      {"Transmit Staggered Sounding", "wlan_mgt.txbf.txss",
17288       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000004,
17289       NULL, HFILL }},
17290
17291     {&hf_ieee80211_txbf_rcv_ndp,
17292      {"Receive Null Data packet (NDP)", "wlan_mgt.txbf.rxndp",
17293       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000008,
17294       NULL, HFILL }},
17295
17296     {&hf_ieee80211_txbf_tx_ndp,
17297      {"Transmit Null Data packet (NDP)", "wlan_mgt.txbf.txndp",
17298       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000010,
17299       NULL, HFILL }},
17300
17301     {&hf_ieee80211_txbf_impl_txbf,
17302      {"Implicit TxBF capable", "wlan_mgt.txbf.impltxbf",
17303       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000020,
17304       "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
17305
17306     {&hf_ieee80211_txbf_calib,
17307      {"Calibration", "wlan_mgt.txbf.calibration",
17308       FT_UINT32, BASE_HEX, VALS(txbf_calib_flag), 0x000000c0,
17309       NULL, HFILL }},
17310
17311     {&hf_ieee80211_txbf_expl_csi,
17312      {"STA can apply TxBF using CSI explicit feedback", "wlan_mgt.txbf.csi",
17313       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000100,
17314       "Station can apply TxBF using CSI explicit feedback", HFILL }},
17315
17316     {&hf_ieee80211_txbf_expl_uncomp_fm,
17317      {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan_mgt.txbf.fm.uncompressed.tbf",
17318       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000200,
17319       "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
17320
17321     {&hf_ieee80211_txbf_expl_comp_fm,
17322      {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan_mgt.txbf.fm.compressed.tbf",
17323       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000400,
17324       "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
17325
17326     {&hf_ieee80211_txbf_expl_bf_csi,
17327      {"Receiver can return explicit CSI feedback", "wlan_mgt.txbf.rcsi",
17328       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00001800,
17329       NULL, HFILL }},
17330
17331     {&hf_ieee80211_txbf_expl_uncomp_fm_feed,
17332      {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.uncompressed.rbf",
17333       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00006000,
17334       NULL, HFILL }},
17335
17336     {&hf_ieee80211_txbf_expl_comp_fm_feed,
17337      {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.compressed.bf",
17338       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00018000,
17339       "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
17340
17341     {&hf_ieee80211_txbf_min_group,
17342      {"Minimal grouping used for explicit feedback reports", "wlan_mgt.txbf.mingroup",
17343       FT_UINT32, BASE_HEX, VALS(txbf_min_group_flags), 0x00060000,
17344       NULL, HFILL }},
17345
17346     {&hf_ieee80211_vht_cap,
17347      {"VHT Capabilities Info", "wlan_mgt.vht.capabilities",
17348       FT_UINT32, BASE_HEX, NULL, 0,
17349       "VHT Capabilities information", HFILL }},
17350
17351     {&hf_ieee80211_vht_max_mpdu_length,
17352      {"Maximum MPDU Length", "wlan_mgt.vht.capabilities.maxmpdulength",
17353       FT_UINT32, BASE_HEX, VALS(vht_max_mpdu_length_flag), 0x00000003,
17354       "In Octets unit", HFILL }},
17355
17356     {&hf_ieee80211_vht_supported_chan_width_set,
17357      {"Supported Channel Width Set", "wlan_mgt.vht.capabilities.supportedchanwidthset",
17358       FT_UINT32, BASE_HEX, VALS(vht_supported_chan_width_set_flag), 0x0000000c,
17359       NULL, HFILL }},
17360
17361     {&hf_ieee80211_vht_rx_ldpc,
17362      {"Rx LDPC", "wlan_mgt.vht.capabilities.rxldpc",
17363       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000010,
17364       NULL, HFILL }},
17365
17366     {&hf_ieee80211_vht_short_gi_for_80,
17367      {"Short GI for 80MHz", "wlan_mgt.vht.capabilities.short80",
17368       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000020,
17369       NULL, HFILL }},
17370
17371     {&hf_ieee80211_vht_short_gi_for_160,
17372      {"Short GI for 160MHz and 80+80MHz", "wlan_mgt.vht.capabilities.short160",
17373       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000040,
17374       NULL, HFILL }},
17375
17376     {&hf_ieee80211_vht_tx_stbc,
17377      {"Tx STBC", "wlan_mgt.vht.capabilities.txstbc",
17378       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000080,
17379       NULL, HFILL }},
17380
17381     {&hf_ieee80211_vht_rx_stbc,
17382      {"Rx STBC", "wlan_mgt.vht.capabilities.rxstbc",
17383       FT_UINT32, BASE_HEX, VALS(vht_rx_stbc_flag), 0x00000700,
17384       NULL, HFILL }},
17385
17386     {&hf_ieee80211_vht_su_beamformer_cap,
17387      {"SU Beam-former Capable", "wlan_mgt.vht.capabilities.subeamformer",
17388       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000800,
17389       NULL, HFILL }},
17390
17391     {&hf_ieee80211_vht_su_beamformee_cap,
17392      {"SU Beam-formee Capable", "wlan_mgt.vht.capabilities.subeamformee",
17393       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00001000,
17394       NULL, HFILL }},
17395
17396     {&hf_ieee80211_vht_beamformer_antennas,
17397      {"Compressed Steering Number of Beamformer Antennas Supported", "wlan_mgt.vht.capabilities.beamformerants",
17398       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x0000e000,
17399       NULL, HFILL }},
17400
17401     {&hf_ieee80211_vht_sounding_dimensions,
17402      {"Number of Sounding Dimensions", "wlan_mgt.vht.capabilities.soundingdimensions",
17403       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x00070000,
17404       NULL, HFILL }},
17405
17406     {&hf_ieee80211_vht_mu_beamformer_cap,
17407      {"MU Beam-former Capable", "wlan_mgt.vht.capabilities.mubeamformer",
17408       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00080000,
17409       NULL, HFILL }},
17410
17411     {&hf_ieee80211_vht_mu_beamformee_cap,
17412      {"MU Beam-formee Capable", "wlan_mgt.vht.capabilities.mubeamformee",
17413       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00100000,
17414       NULL, HFILL }},
17415
17416     {&hf_ieee80211_vht_txop_ps,
17417      {"VHT TXOP PS", "wlan_mgt.vht.capabilities.vhttxopps",
17418       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00200000,
17419       NULL, HFILL }},
17420
17421     {&hf_ieee80211_vht_var_htc_field,
17422      {"+HTC-VHT Capable (VHT variant HT Control field)", "wlan_mgt.vht.capabilities.vhthtc",
17423       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00400000,
17424       NULL, HFILL }},
17425
17426     {&hf_ieee80211_vht_max_ampdu,
17427      {"Max A-MPDU Length", "wlan_mgt.vht.capabilities.maxampdu",
17428       FT_UINT32, BASE_HEX, VALS(vht_max_ampdu_flag), 0x03800000,
17429       "In Octets unit", HFILL }},
17430
17431     {&hf_ieee80211_vht_link_adaptation_cap,
17432      {"VHT Link Adaptation", "wlan_mgt.vht.capabilities.linkadapt",
17433       FT_UINT32, BASE_HEX, VALS(vht_link_adapt_flag), 0x0c000000,
17434       NULL, HFILL }},
17435
17436     {&hf_ieee80211_vht_rx_pattern,
17437      {"Rx Antenna Pattern Consistency", "wlan_mgt.vht.capabilities.rxpatconsist",
17438       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x10000000,
17439       NULL, HFILL }},
17440
17441     {&hf_ieee80211_vht_tx_pattern,
17442      {"Tx Antenna Pattern Consistency", "wlan_mgt.vht.capabilities.txpatconsist",
17443       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x20000000,
17444       NULL, HFILL }},
17445
17446     {&hf_ieee80211_vht_reserv,
17447      {"Reserved", "wlan_mgt.vht.reserved",
17448       FT_BOOLEAN, 32, NULL, 0xc0000000,
17449       NULL, HFILL }},
17450
17451     {&hf_ieee80211_vht_mcsset,
17452      {"VHT Supported MCS Set", "wlan_mgt.vht.mcsset",
17453       FT_NONE, BASE_NONE, NULL, 0,
17454       NULL, HFILL }},
17455
17456     {&hf_ieee80211_vht_mcsset_rx_mcs_map,
17457      {"Rx MCS Map", "wlan_mgt.vht.mcsset.rxmcsmap",
17458       FT_UINT16, BASE_HEX, NULL, 0,
17459       NULL, HFILL }},
17460
17461     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
17462      {"Rx 1 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss1",
17463       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
17464       NULL, HFILL }},
17465
17466     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
17467      {"Rx 2 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss2",
17468       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
17469       NULL, HFILL }},
17470
17471     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
17472      {"Rx 3 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss3",
17473       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
17474       NULL, HFILL }},
17475
17476     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
17477      {"Rx 4 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss4",
17478       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
17479       NULL, HFILL }},
17480
17481     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
17482      {"Rx 5 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss5",
17483       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
17484       NULL, HFILL }},
17485
17486     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
17487      {"Rx 6 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss6",
17488       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
17489       NULL, HFILL }},
17490
17491     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
17492      {"Rx 7 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss7",
17493       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
17494       NULL, HFILL }},
17495
17496     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
17497      {"Rx 8 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss8",
17498       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
17499       NULL, HFILL }},
17500
17501     {&hf_ieee80211_vht_mcsset_rx_highest_long_gi,
17502      {"Rx Highest Long GI Data Rate (in Mb/s, 0 = subfield not in use)", "wlan_mgt.vht.mcsset.rxhighestlonggirate",
17503       FT_UINT16, BASE_HEX, NULL, 0x1fff,
17504       NULL, HFILL }},
17505
17506     {&hf_ieee80211_vht_mcsset_tx_mcs_map,
17507      {"Tx MCS Map", "wlan_mgt.vht.mcsset.txmcsmap",
17508       FT_UINT16, BASE_HEX, NULL, 0,
17509       NULL, HFILL }},
17510
17511     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
17512      {"Tx 1 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss1",
17513       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
17514       NULL, HFILL }},
17515
17516     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
17517      {"Tx 2 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss2",
17518       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
17519       NULL, HFILL }},
17520
17521     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
17522      {"Tx 3 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss3",
17523       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
17524       NULL, HFILL }},
17525
17526     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
17527      {"Tx 4 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss4",
17528       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
17529       NULL, HFILL }},
17530
17531     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
17532      {"Tx 5 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss5",
17533       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
17534       NULL, HFILL }},
17535
17536     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
17537      {"Tx 6 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss6",
17538       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
17539       NULL, HFILL }},
17540
17541     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
17542      {"Tx 7 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss7",
17543       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
17544       NULL, HFILL }},
17545
17546     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
17547      {"Tx 8 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss8",
17548       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
17549       NULL, HFILL }},
17550
17551     {&hf_ieee80211_vht_mcsset_tx_highest_long_gi,
17552      {"Tx Highest Long GI Data Rate  (in Mb/s, 0 = subfield not in use)", "wlan_mgt.vht.mcsset.txhighestlonggirate",
17553       FT_UINT16, BASE_HEX, NULL, 0x1fff,
17554       NULL, HFILL }},
17555
17556     {&hf_ieee80211_vht_op,
17557      {"VHT Operation Info", "wlan_mgt.vht.op",
17558       FT_NONE, BASE_NONE, NULL, 0,
17559       NULL, HFILL }},
17560
17561     {&hf_ieee80211_vht_op_channel_width,
17562      {"Channel Width", "wlan_mgt.vht.op.channelwidth",
17563       FT_UINT8, BASE_HEX, VALS(vht_op_channel_width_flag), 0,
17564       NULL, HFILL }},
17565
17566     {&hf_ieee80211_vht_op_channel_center0,
17567      {"Channel Center Segment 0", "wlan_mgt.vht.op.channelcenter0",
17568       FT_UINT8, BASE_DEC, NULL, 0,
17569       NULL, HFILL }},
17570
17571     {&hf_ieee80211_vht_op_channel_center1,
17572      {"Channel Center Segment 1", "wlan_mgt.vht.op.channelcenter1",
17573       FT_UINT8, BASE_DEC, NULL, 0,
17574       NULL, HFILL }},
17575
17576     {&hf_ieee80211_vht_op_basic_mcs_map,
17577      {"Basic MCS Map", "wlan_mgt.vht.op.basicmcsmap",
17578       FT_UINT16, BASE_HEX, NULL, 0,
17579       NULL, HFILL }},
17580
17581     {&hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
17582      {"Basic 1 SS", "wlan_mgt.vht.op.basicmcsmap.ss1",
17583       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
17584       NULL, HFILL }},
17585
17586     {&hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
17587      {"Basic 2 SS", "wlan_mgt.vht.op.basicmcsmap.ss2",
17588       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
17589       NULL, HFILL }},
17590
17591     {&hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
17592      {"Basic 3 SS", "wlan_mgt.vht.op.basicmcsmap.ss3",
17593       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
17594       NULL, HFILL }},
17595
17596     {&hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
17597      {"Basic 4 SS", "wlan_mgt.vht.op.basicmcsmap.ss4",
17598       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
17599       NULL, HFILL }},
17600
17601     {&hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
17602      {"Basic 5 SS", "wlan_mgt.vht.op.basicmcsmap.ss5",
17603       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
17604       NULL, HFILL }},
17605
17606     {&hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
17607      {"Basic 6 SS", "wlan_mgt.vht.op.basicmcsmap.ss6",
17608       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
17609       NULL, HFILL }},
17610
17611     {&hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
17612      {"Basic 7 SS", "wlan_mgt.vht.op.basicmcsmap.ss7",
17613       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
17614       NULL, HFILL }},
17615
17616     {&hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
17617      {"Basic 8 SS", "wlan_mgt.vht.op.basicmcsmap.ss8",
17618       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
17619       NULL, HFILL }},
17620
17621     {&hf_ieee80211_txbf_csi_num_bf_ant,
17622      {"Max antennae STA can support when CSI feedback required", "wlan_mgt.txbf.csinumant",
17623       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00180000,
17624       "Max antennae station can support when CSI feedback required", HFILL }},
17625
17626     {&hf_ieee80211_txbf_uncomp_sm_bf_ant,
17627      {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan_mgt.txbf.fm.uncompressed.maxant",
17628       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00600000,
17629       "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
17630
17631     {&hf_ieee80211_txbf_comp_sm_bf_ant,
17632      {"Max antennae STA can support when compressed Beamforming feedback required", "wlan_mgt.txbf.fm.compressed.maxant",
17633       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x01800000,
17634       "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
17635
17636     {&hf_ieee80211_txbf_csi_max_rows_bf,
17637      {"Maximum number of rows of CSI explicit feedback", "wlan_mgt.txbf.csi.maxrows",
17638       FT_UINT32, BASE_HEX, VALS(txbf_csi_max_rows_bf_flags), 0x06000000,
17639       NULL, HFILL }},
17640
17641     {&hf_ieee80211_txbf_chan_est,
17642      {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan_mgt.txbf.channelest",
17643       FT_UINT32, BASE_HEX, VALS(txbf_chan_est_flags), 0x18000000,
17644       NULL, HFILL }},
17645
17646     {&hf_ieee80211_txbf_resrv,
17647      {"Reserved", "wlan_mgt.txbf.reserved",
17648       FT_UINT32, BASE_HEX, NULL, 0xe0000000,
17649       NULL, HFILL }},
17650
17651     {&hf_ieee80211_hta_cc,
17652      {"HT Control Channel", "wlan_mgt.hta.control_channel",
17653       FT_UINT8, BASE_DEC, NULL, 0,
17654       NULL, HFILL }},
17655
17656     {&hf_ieee80211_hta_cap,
17657      {"HT Additional Capabilities", "wlan_mgt.hta.capabilities",
17658       FT_UINT16, BASE_HEX, NULL, 0,
17659       "HT Additional Capability information", HFILL }},
17660
17661     {&hf_ieee80211_hta_ext_chan_offset,
17662      {"Extension Channel Offset", "wlan_mgt.hta.capabilities.extchan",
17663       FT_UINT16, BASE_HEX, VALS(hta_ext_chan_offset_flag), 0x0003,
17664       NULL, HFILL }},
17665
17666     {&hf_ieee80211_hta_rec_tx_width,
17667      {"Recommended Tx Channel Width", "wlan_mgt.hta.capabilities.rectxwidth",
17668       FT_BOOLEAN, 16, TFS (&hta_rec_tx_width_flag), 0x0004,
17669       "Recommended Transmit Channel Width", HFILL }},
17670
17671     {&hf_ieee80211_hta_rifs_mode,
17672      {"Reduced Interframe Spacing (RIFS) Mode", "wlan_mgt.hta.capabilities.rifsmode",
17673       FT_BOOLEAN, 16, TFS (&hta_rifs_mode_flag), 0x0008,
17674       NULL, HFILL }},
17675
17676     {&hf_ieee80211_hta_controlled_access,
17677      {"Controlled Access Only", "wlan_mgt.hta.capabilities.controlledaccess",
17678       FT_BOOLEAN, 16, TFS (&hta_controlled_access_flag), 0x0010,
17679       NULL, HFILL }},
17680
17681     {&hf_ieee80211_hta_service_interval,
17682      {"Service Interval Granularity", "wlan_mgt.hta.capabilities.serviceinterval",
17683       FT_UINT16, BASE_HEX, VALS(hta_service_interval_flag), 0x00E0,
17684       NULL, HFILL }},
17685
17686     {&hf_ieee80211_hta_operating_mode,
17687      {"Operating Mode", "wlan_mgt.hta.capabilities.operatingmode",
17688       FT_UINT16, BASE_HEX, VALS(hta_operating_mode_flag), 0x0003,
17689       NULL, HFILL }},
17690
17691     {&hf_ieee80211_hta_non_gf_devices,
17692      {"Non Greenfield (GF) devices Present", "wlan_mgt.hta.capabilities.nongfdevices",
17693       FT_BOOLEAN, 16, TFS (&hta_non_gf_devices_flag), 0x0004,
17694       "on Greenfield (GF) devices Present", HFILL }},
17695
17696     {&hf_ieee80211_hta_basic_stbc_mcs,
17697      {"Basic STB Modulation and Coding Scheme (MCS)", "wlan_mgt.hta.capabilities.",
17698       FT_UINT16, BASE_HEX, NULL , 0x007f,
17699       NULL, HFILL }},
17700
17701     {&hf_ieee80211_hta_dual_stbc_protection,
17702      {"Dual Clear To Send (CTS) Protection", "wlan_mgt.hta.capabilities.",
17703       FT_BOOLEAN, 16, TFS (&hta_dual_stbc_protection_flag), 0x0080,
17704       NULL, HFILL }},
17705
17706     {&hf_ieee80211_hta_secondary_beacon,
17707      {"Secondary Beacon", "wlan_mgt.hta.capabilities.",
17708       FT_BOOLEAN, 16, TFS (&hta_secondary_beacon_flag), 0x0100,
17709       NULL, HFILL }},
17710
17711     {&hf_ieee80211_hta_lsig_txop_protection,
17712      {"L-SIG TXOP Protection Support", "wlan_mgt.hta.capabilities.",
17713       FT_BOOLEAN, 16, TFS (&hta_lsig_txop_protection_flag), 0x0200,
17714       NULL, HFILL }},
17715
17716     {&hf_ieee80211_hta_pco_active,
17717      {"Phased Coexistence Operation (PCO) Active", "wlan_mgt.hta.capabilities.",
17718       FT_BOOLEAN, 16, TFS (&hta_pco_active_flag), 0x0400,
17719       NULL, HFILL }},
17720
17721     {&hf_ieee80211_hta_pco_phase,
17722      {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.hta.capabilities.",
17723       FT_BOOLEAN, 16, TFS (&hta_pco_phase_flag), 0x0800,
17724       NULL, HFILL }},
17725
17726     {&hf_ieee80211_antsel,
17727      {"Antenna Selection (ASEL) Capabilities", "wlan_mgt.asel",
17728       FT_UINT8, BASE_HEX, NULL, 0,
17729       NULL, HFILL }},
17730
17731     {&hf_ieee80211_antsel_vs,
17732      {"Antenna Selection (ASEL) Capabilities (VS)", "wlan_mgt.vs.asel",
17733       FT_UINT8, BASE_HEX, NULL, 0,
17734       "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
17735
17736     {&hf_ieee80211_antsel_b0,
17737      {"Antenna Selection Capable", "wlan_mgt.asel.capable",
17738       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x01,
17739       NULL, HFILL }},
17740
17741     {&hf_ieee80211_antsel_b1,
17742      {"Explicit CSI Feedback Based Tx ASEL", "wlan_mgt.asel.txcsi",
17743       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x02,
17744       NULL, HFILL }},
17745
17746     {&hf_ieee80211_antsel_b2,
17747      {"Antenna Indices Feedback Based Tx ASEL", "wlan_mgt.asel.txif",
17748       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x04,
17749       NULL, HFILL }},
17750
17751     {&hf_ieee80211_antsel_b3,
17752      {"Explicit CSI Feedback", "wlan_mgt.asel.csi",
17753       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x08,
17754       NULL, HFILL }},
17755
17756     {&hf_ieee80211_antsel_b4,
17757      {"Antenna Indices Feedback", "wlan_mgt.asel.if",
17758       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x10,
17759       NULL, HFILL }},
17760
17761     {&hf_ieee80211_antsel_b5,
17762      {"Rx ASEL", "wlan_mgt.asel.rx",
17763       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x20,
17764       NULL, HFILL }},
17765
17766     {&hf_ieee80211_antsel_b6,
17767      {"Tx Sounding PPDUs", "wlan_mgt.asel.sppdu",
17768       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x40,
17769       NULL, HFILL }},
17770
17771     {&hf_ieee80211_antsel_b7,
17772      {"Reserved", "wlan_mgt.asel.reserved",
17773       FT_UINT8, BASE_HEX, NULL, 0x80,
17774       NULL, HFILL }},
17775
17776     {&hf_ieee80211_ht_info_delimiter1,
17777      {"HT Information Subset (1 of 3)", "wlan_mgt.ht.info.delim1",
17778       FT_UINT8, BASE_HEX, NULL, 0,
17779       NULL, HFILL }},
17780
17781     {&hf_ieee80211_ht_info_primary_channel,
17782      {"Primary Channel", "wlan_mgt.ht.info.primarychannel",
17783       FT_UINT8, BASE_DEC, NULL, 0,
17784       NULL, HFILL }},
17785
17786     {&hf_ieee80211_ht_info_secondary_channel_offset,
17787      {"Secondary channel offset", "wlan_mgt.ht.info.secchanoffset",
17788       FT_UINT8, BASE_HEX, VALS(ht_info_secondary_channel_offset_flags), 0x03,
17789       NULL, HFILL }},
17790
17791     {&hf_ieee80211_ht_info_channel_width,
17792      {"Supported channel width", "wlan_mgt.ht.info.chanwidth",
17793       FT_BOOLEAN, 8, TFS (&ht_info_channel_width_flag), 0x04,
17794       NULL, HFILL }},
17795
17796     {&hf_ieee80211_ht_info_rifs_mode,
17797      {"Reduced Interframe Spacing (RIFS)", "wlan_mgt.ht.info.rifs",
17798       FT_BOOLEAN, 8, TFS (&ht_info_rifs_mode_flag), 0x08,
17799       NULL, HFILL }},
17800
17801     {&hf_ieee80211_ht_info_psmp_stas_only,
17802      {"Power Save Multi-Poll (PSMP) stations only", "wlan_mgt.ht.info.psmponly",
17803       FT_BOOLEAN, 8, TFS (&ht_info_psmp_stas_only_flag), 0x10,
17804       NULL, HFILL }},
17805
17806     {&hf_ieee80211_ht_info_service_interval_granularity,
17807      {"Shortest service interval", "wlan_mgt.ht.info.",
17808       FT_UINT8, BASE_HEX, VALS(ht_info_service_interval_granularity_flags), 0xe0,
17809       NULL, HFILL }},
17810
17811     {&hf_ieee80211_ht_info_delimiter2,
17812      {"HT Information Subset (2 of 3)", "wlan_mgt.ht.info.delim2",
17813       FT_UINT16, BASE_HEX, NULL, 0,
17814       NULL, HFILL }},
17815
17816     {&hf_ieee80211_ht_info_operating_mode,
17817      {"Operating mode of BSS", "wlan_mgt.ht.info.operatingmode",
17818       FT_UINT16, BASE_HEX, VALS(ht_info_operating_mode_flags), 0x0003,
17819       NULL, HFILL }},
17820
17821     {&hf_ieee80211_ht_info_non_greenfield_sta_present,
17822      {"Non-greenfield STAs present", "wlan_mgt.ht.info.greenfield",
17823       FT_BOOLEAN, 16, TFS (&ht_info_non_greenfield_sta_present_flag), 0x0004,
17824       NULL, HFILL }},
17825
17826     {&hf_ieee80211_ht_info_transmit_burst_limit,
17827      {"Transmit burst limit", "wlan_mgt.ht.info.burstlim",
17828       FT_BOOLEAN, 16, TFS (&ht_info_transmit_burst_limit_flag), 0x0008,
17829       NULL, HFILL }},
17830
17831     {&hf_ieee80211_ht_info_obss_non_ht_stas_present,
17832      {"OBSS non-HT STAs present", "wlan_mgt.ht.info.obssnonht",
17833       FT_BOOLEAN, 16, TFS (&ht_info_obss_non_ht_stas_present_flag), 0x0010,
17834       NULL, HFILL }},
17835
17836     {&hf_ieee80211_ht_info_reserved_1,
17837      {"Reserved", "wlan_mgt.ht.info.reserved1",
17838       FT_UINT16, BASE_HEX, NULL, 0xffe0,
17839       NULL, HFILL }},
17840
17841     {&hf_ieee80211_ht_info_delimiter3,
17842      {"HT Information Subset (3 of 3)", "wlan_mgt.ht.info.delim3",
17843       FT_UINT16, BASE_HEX, NULL, 0,
17844       NULL, HFILL }},
17845
17846     {&hf_ieee80211_ht_info_reserved_2,
17847      {"Reserved", "wlan_mgt.ht.info.reserved2",
17848       FT_UINT16, BASE_HEX, NULL, 0x003f,
17849       NULL, HFILL }},
17850
17851     {&hf_ieee80211_ht_info_dual_beacon,
17852      {"Dual beacon", "wlan_mgt.ht.info.dualbeacon",
17853       FT_BOOLEAN, 16, TFS (&ht_info_dual_beacon_flag), 0x0040,
17854       NULL, HFILL }},
17855
17856     {&hf_ieee80211_ht_info_dual_cts_protection,
17857      {"Dual Clear To Send (CTS) protection", "wlan_mgt.ht.info.dualcts",
17858       FT_BOOLEAN, 16, TFS (&ht_info_dual_cts_protection_flag), 0x0080,
17859       NULL, HFILL }},
17860
17861     {&hf_ieee80211_ht_info_secondary_beacon,
17862      {"Beacon ID", "wlan_mgt.ht.info.secondarybeacon",
17863       FT_BOOLEAN, 16, TFS (&ht_info_secondary_beacon_flag), 0x0100,
17864       NULL, HFILL }},
17865
17866     {&hf_ieee80211_ht_info_lsig_txop_protection_full_support,
17867      {"L-SIG TXOP Protection Full Support", "wlan_mgt.ht.info.lsigprotsupport",
17868       FT_BOOLEAN, 16, TFS (&ht_info_lsig_txop_protection_full_support_flag), 0x0200,
17869       NULL, HFILL }},
17870
17871     {&hf_ieee80211_ht_info_pco_active,
17872      {"Phased Coexistence Operation (PCO)", "wlan_mgt.ht.info.pco.active",
17873       FT_BOOLEAN, 16, TFS (&tfs_active_inactive), 0x0400,
17874       NULL, HFILL }},
17875
17876     {&hf_ieee80211_ht_info_pco_phase,
17877      {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.ht.info.pco.phase",
17878       FT_BOOLEAN, 16, TFS (&ht_info_pco_phase_flag), 0x0800,
17879       NULL, HFILL }},
17880
17881     {&hf_ieee80211_ht_info_reserved_3,
17882      {"Reserved", "wlan_mgt.ht.info.reserved3",
17883       FT_UINT16, BASE_HEX, NULL, 0xf000,
17884       NULL, HFILL }},
17885
17886     {&hf_ieee80211_tag_ap_channel_report_regulatory_class,
17887      {"Regulatory Class", "wlan_mgt.ap_channel_report.regulatory_class",
17888       FT_UINT8, BASE_DEC, NULL, 0,
17889       NULL, HFILL }},
17890
17891     {&hf_ieee80211_tag_ap_channel_report_channel_list,
17892      {"Channel List", "wlan_mgt.ap_channel_report.channel_list",
17893       FT_UINT8, BASE_DEC, NULL, 0,
17894       NULL, HFILL }},
17895
17896     {&hf_ieee80211_tag_secondary_channel_offset,
17897      {"Secondary Channel Offset", "wlan_mgt.secchanoffset",
17898       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_secondary_channel_offset_flags), 0,
17899       NULL, HFILL }},
17900
17901     {&hf_ieee80211_tag_bss_ap_avg_access_delay,
17902      {"AP Average Access Delay", "wlan_mgt.bss_ap_avg_access_delay",
17903       FT_UINT8, BASE_DEC, NULL, 0x0,
17904       NULL, HFILL }},
17905
17906     {&hf_ieee80211_tag_antenna_id,
17907      {"Antenna ID", "wlan_mgt.antenna.id",
17908       FT_UINT8, BASE_DEC, NULL, 0x0,
17909       NULL, HFILL }},
17910
17911     {&hf_ieee80211_tag_rsni,
17912      {"RSNI", "wlan_mgt.rsni",
17913       FT_UINT8, BASE_CUSTOM, rsni_base_custom, 0x0,
17914       NULL, HFILL }},
17915
17916     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
17917      {"Available Admission Capacity Bitmask", "wlan_mgt.bss_avb_adm_cap.bitmask",
17918       FT_UINT16, BASE_HEX, NULL, 0,
17919       NULL, HFILL }},
17920     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
17921      {"UP0 (bit0)", "wlan_mgt.bss_avb_adm_cap.bitmask.up0",
17922       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP0,
17923       NULL, HFILL }},
17924     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
17925      {"UP1 (bit1)", "wlan_mgt.bss_avb_adm_cap.bitmask.up1",
17926       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP1,
17927       NULL, HFILL }},
17928     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
17929      {"UP2 (bit2)", "wlan_mgt.bss_avb_adm_cap.bitmask.up2",
17930       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP2,
17931       NULL, HFILL }},
17932     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
17933      {"UP3 (bit3)", "wlan_mgt.bss_avb_adm_cap.bitmask.up3",
17934       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP3,
17935       NULL, HFILL }},
17936     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
17937      {"UP4 (bit4)", "wlan_mgt.bss_avb_adm_cap.bitmask.up4",
17938       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP4,
17939       NULL, HFILL }},
17940     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
17941      {"UP5 (bit5)", "wlan_mgt.bss_avb_adm_cap.bitmask.up5",
17942       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP5,
17943       NULL, HFILL }},
17944     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
17945      {"UP0 (bit6)", "wlan_mgt.bss_avb_adm_cap.bitmask.up6",
17946       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP6,
17947       NULL, HFILL }},
17948     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
17949      {"UP7 (bit7)", "wlan_mgt.bss_avb_adm_cap.bitmask.up7",
17950       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP7,
17951       NULL, HFILL }},
17952     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
17953      {"AC0 (bit8)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac0",
17954       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC0,
17955       NULL, HFILL }},
17956     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
17957      {"AC1 (bit9)", "wlan_mgt.bss_avb_adm_cap.bitmask.AC1",
17958       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC1,
17959       NULL, HFILL }},
17960     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
17961      {"AC2 (bit10)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac2",
17962       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC2,
17963       NULL, HFILL }},
17964     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
17965      {"AC3 (bit11)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac3",
17966       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC3,
17967       NULL, HFILL }},
17968     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
17969      {"Reserved", "wlan_mgt.bss_avb_adm_cap.bitmask.rsv",
17970       FT_UINT16, BASE_HEX, NULL, BSS_BITMASK_RSV,
17971       NULL, HFILL }},
17972     {&hf_ieee80211_tag_bss_avb_adm_cap_up0,
17973      {"UP0", "wlan_mgt.bss_avb_adm_cap.up0",
17974       FT_UINT16, BASE_DEC, NULL, 0x0,
17975       NULL, HFILL }},
17976     {&hf_ieee80211_tag_bss_avb_adm_cap_up1,
17977      {"UP1", "wlan_mgt.bss_avb_adm_cap.up1",
17978       FT_UINT16, BASE_DEC, NULL, 0x0,
17979       NULL, HFILL }},
17980     {&hf_ieee80211_tag_bss_avb_adm_cap_up2,
17981      {"UP2", "wlan_mgt.bss_avb_adm_cap.up2",
17982       FT_UINT16, BASE_DEC, NULL, 0x0,
17983       NULL, HFILL }},
17984     {&hf_ieee80211_tag_bss_avb_adm_cap_up3,
17985      {"UP3", "wlan_mgt.bss_avb_adm_cap.up3",
17986       FT_UINT16, BASE_DEC, NULL, 0x0,
17987       NULL, HFILL }},
17988     {&hf_ieee80211_tag_bss_avb_adm_cap_up4,
17989      {"UP4", "wlan_mgt.bss_avb_adm_cap.up4",
17990       FT_UINT16, BASE_DEC, NULL, 0x0,
17991       NULL, HFILL }},
17992     {&hf_ieee80211_tag_bss_avb_adm_cap_up5,
17993      {"UP5", "wlan_mgt.bss_avb_adm_cap.up5",
17994       FT_UINT16, BASE_DEC, NULL, 0x0,
17995       NULL, HFILL }},
17996     {&hf_ieee80211_tag_bss_avb_adm_cap_up6,
17997      {"UP6", "wlan_mgt.bss_avb_adm_cap.up6",
17998       FT_UINT16, BASE_DEC, NULL, 0x0,
17999       NULL, HFILL }},
18000     {&hf_ieee80211_tag_bss_avb_adm_cap_up7,
18001      {"UP7", "wlan_mgt.bss_avb_adm_cap.up7",
18002       FT_UINT16, BASE_DEC, NULL, 0x0,
18003       NULL, HFILL }},
18004     {&hf_ieee80211_tag_bss_avb_adm_cap_ac0,
18005      {"AC0", "wlan_mgt.bss_avb_adm_cap.ac0",
18006       FT_UINT16, BASE_DEC, NULL, 0x0,
18007       NULL, HFILL }},
18008     {&hf_ieee80211_tag_bss_avb_adm_cap_ac1,
18009      {"AC1", "wlan_mgt.bss_avb_adm_cap.ac1",
18010       FT_UINT16, BASE_DEC, NULL, 0x0,
18011       NULL, HFILL }},
18012     {&hf_ieee80211_tag_bss_avb_adm_cap_ac2,
18013      {"AC2", "wlan_mgt.bss_avb_adm_cap.ac2",
18014       FT_UINT16, BASE_DEC, NULL, 0x0,
18015       NULL, HFILL }},
18016     {&hf_ieee80211_tag_bss_avb_adm_cap_ac3,
18017      {"AC3", "wlan_mgt.bss_avb_adm_cap.ac3",
18018       FT_UINT16, BASE_DEC, NULL, 0x0,
18019       NULL, HFILL }},
18020
18021     {&hf_ieee80211_tag_bss_avg_ac_access_delay_be,
18022      {"AC Average Access Delay for Best Effort", "wlan_mgt.bss_avg_ac_access_delay.be",
18023       FT_UINT8, BASE_DEC, NULL, 0x0,
18024       NULL, HFILL }},
18025     {&hf_ieee80211_tag_bss_avg_ac_access_delay_bk,
18026      {"AC Average Access Delay for Best Background", "wlan_mgt.bss_avg_ac_access_delay.bk",
18027       FT_UINT8, BASE_DEC, NULL, 0x0,
18028       NULL, HFILL }},
18029     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vi,
18030      {"AC Average Access Delay for Video", "wlan_mgt.bss_avg_ac_access_delay_vi",
18031       FT_UINT8, BASE_DEC, NULL, 0x0,
18032       NULL, HFILL }},
18033     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vo,
18034      {"AC Average Access Delay for Voice", "wlan_mgt.bss_avg_ac_access_delay_vo",
18035       FT_UINT8, BASE_DEC, NULL, 0x0,
18036       NULL, HFILL }},
18037
18038
18039     /* 802.11-2012 Table 8-119-RM Enabled Capabilities definition */
18040     {&hf_ieee80211_tag_rm_enabled_capabilities,
18041      {"RM Capabilities", "wlan_mgt.rmcap",
18042       FT_UINT8, BASE_HEX, NULL, 0,
18043       "Signals support for radio measurements in a device", HFILL }},
18044
18045     /* RM Enabled Capability octet 1 */
18046     {&hf_ieee80211_tag_rm_enabled_capabilities_b0,
18047      {"Link Measurement", "wlan_mgt.rmcap.b0",
18048       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
18049       NULL, HFILL }},
18050     {&hf_ieee80211_tag_rm_enabled_capabilities_b1,
18051      {"Neighbor Report", "wlan_mgt.rmcap.b1",
18052       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
18053       NULL, HFILL }},
18054     {&hf_ieee80211_tag_rm_enabled_capabilities_b2,
18055      {"Parallel Measurements", "wlan_mgt.rmcap.b2",
18056       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
18057       NULL, HFILL }},
18058     {&hf_ieee80211_tag_rm_enabled_capabilities_b3,
18059      {"Repeated Measurements", "wlan_mgt.rmcap.b3",
18060       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
18061       NULL, HFILL }},
18062     {&hf_ieee80211_tag_rm_enabled_capabilities_b4,
18063      {"Beacon Passive Measurement", "wlan_mgt.rmcap.b4",
18064       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
18065       NULL, HFILL }},
18066     {&hf_ieee80211_tag_rm_enabled_capabilities_b5,
18067      {"Beacon Active Measurement", "wlan_mgt.rmcap.b5",
18068       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
18069       NULL, HFILL }},
18070     {&hf_ieee80211_tag_rm_enabled_capabilities_b6,
18071      {"Beacon Table Measurement", "wlan_mgt.rmcap.b6",
18072       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18073       NULL, HFILL }},
18074     {&hf_ieee80211_tag_rm_enabled_capabilities_b7,
18075      {"Beacon Measurement Reporting Conditions", "wlan_mgt.rmcap.b7",
18076       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
18077       NULL, HFILL }},
18078
18079     /* RM Enabled Capability octet 2 */
18080     {&hf_ieee80211_tag_rm_enabled_capabilities_b8,
18081      {"Frame Measurement", "wlan_mgt.rmcap.b8",
18082       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
18083       NULL, HFILL }},
18084     {&hf_ieee80211_tag_rm_enabled_capabilities_b9,
18085      {"Channel Load Measurement", "wlan_mgt.rmcap.b9",
18086       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
18087       NULL, HFILL }},
18088     {&hf_ieee80211_tag_rm_enabled_capabilities_b10,
18089      {"Noise Histogram Measurement", "wlan_mgt.rmcap.b10",
18090       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
18091       NULL, HFILL }},
18092     {&hf_ieee80211_tag_rm_enabled_capabilities_b11,
18093      {"Statistics Measurement", "wlan_mgt.rmcap.b11",
18094       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
18095       NULL, HFILL }},
18096     {&hf_ieee80211_tag_rm_enabled_capabilities_b12,
18097      {"LCI Measurement", "wlan_mgt.rmcap.b12",
18098       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
18099       NULL, HFILL }},
18100     {&hf_ieee80211_tag_rm_enabled_capabilities_b13,
18101      {"LCI Azimuth capability", "wlan_mgt.rmcap.b13",
18102       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
18103       NULL, HFILL }},
18104     {&hf_ieee80211_tag_rm_enabled_capabilities_b14,
18105      {"Transmit Stream/Category Measurement", "wlan_mgt.rmcap.b14",
18106       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18107       NULL, HFILL }},
18108     {&hf_ieee80211_tag_rm_enabled_capabilities_b15,
18109      {"Triggered Transmit Stream/Category Measurement", "wlan_mgt.rmcap.b15",
18110       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
18111       NULL, HFILL }},
18112
18113     /* RM Enabled Capability octet 3 */
18114     {&hf_ieee80211_tag_rm_enabled_capabilities_b16,
18115      {"AP Channel Report capability", "wlan_mgt.rmcap.b16",
18116       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
18117       NULL, HFILL }},
18118     {&hf_ieee80211_tag_rm_enabled_capabilities_b17,
18119      {"RM MIB capability", "wlan_mgt.rmcap.b17",
18120       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
18121       NULL, HFILL }},
18122     {&hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
18123      {"Operating Channel Max Measurement Duration", "wlan_mgt.rmcap.b18to20",
18124       FT_UINT8, BASE_DEC, NULL, 0x1C,
18125       NULL, HFILL }},
18126     {&hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
18127      {"Nonoperating Channel Max Measurement Duration", "wlan_mgt.rmcap.b21to23",
18128       FT_UINT8, BASE_DEC, NULL, 0xE0,
18129       NULL, HFILL }},
18130
18131     /* RM Enabled Capability octet 4 */
18132     {&hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
18133      {"Measurement Pilotcapability", "wlan_mgt.rmcap.b24to26",
18134       FT_UINT8, BASE_DEC, NULL, 0x07,
18135       NULL, HFILL }},
18136     {&hf_ieee80211_tag_rm_enabled_capabilities_b27,
18137      {"Measurement Pilot Transmission Information", "wlan_mgt.rmcap.b27",
18138       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
18139       NULL, HFILL }},
18140     {&hf_ieee80211_tag_rm_enabled_capabilities_b28,
18141      {"Neighbor Report TSF Offset", "wlan_mgt.rmcap.b28",
18142       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
18143       NULL, HFILL }},
18144     {&hf_ieee80211_tag_rm_enabled_capabilities_b29,
18145      {"RCPI Measurement capability", "wlan_mgt.rmcap.b29",
18146       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
18147       NULL, HFILL }},
18148     {&hf_ieee80211_tag_rm_enabled_capabilities_b30,
18149      {"RSNI Measurement capability", "wlan_mgt.rmcap.b30",
18150       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18151       NULL, HFILL }},
18152     {&hf_ieee80211_tag_rm_enabled_capabilities_b31,
18153      {"BSS Average Access Delay capability", "wlan_mgt.rmcap.b31",
18154       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
18155       NULL, HFILL }},
18156
18157     /* RM Enabled Capability octet 5 */
18158     {&hf_ieee80211_tag_rm_enabled_capabilities_b32,
18159      {"BSS Available Admission Capacity capability", "wlan_mgt.rmcap.b32",
18160       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
18161       NULL, HFILL }},
18162     {&hf_ieee80211_tag_rm_enabled_capabilities_b33,
18163      {"Antenna capability", "wlan_mgt.rmcap.b33",
18164       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
18165       NULL, HFILL }},
18166     {&hf_ieee80211_tag_rm_enabled_capabilities_o5,
18167      {"Reserved", "wlan_mgt.rmcap.o5",
18168       FT_UINT8, BASE_HEX, NULL, 0xFC,
18169       "Must be zero", HFILL }},
18170
18171     {&hf_ieee80211_tag_power_constraint_local,
18172      {"Local Power Constraint", "wlan_mgt.powercon.local",
18173       FT_UINT8, BASE_DEC, NULL, 0,
18174       "Value that allows the mitigation requirements to be satisfied in the current channel", HFILL }},
18175
18176     {&hf_ieee80211_tag_power_capability_min,
18177      {"Minimum Transmit Power", "wlan_mgt.powercap.min",
18178       FT_UINT8, BASE_HEX, NULL, 0,
18179       "The nominal minimum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
18180
18181     {&hf_ieee80211_tag_power_capability_max,
18182      {"Maximum Transmit Power", "wlan_mgt.powercap.max",
18183       FT_UINT8, BASE_HEX, NULL, 0,
18184       "The nominal maximum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
18185
18186     {&hf_ieee80211_tag_tpc_report_trsmt_pow,
18187      {"Transmit Power", "wlan_mgt.tcprep.trsmt_pow",
18188       FT_INT8, BASE_DEC, NULL, 0,
18189       NULL, HFILL }},
18190
18191     {&hf_ieee80211_tag_tpc_report_link_mrg,
18192      {"Link Margin", "wlan_mgt.tcprep.link_mrg",
18193       FT_INT8, BASE_DEC, NULL, 0,
18194       NULL, HFILL }},
18195
18196     {&hf_ieee80211_tag_supported_channels,
18197      {"Supported Channels Set", "wlan_mgt.supchan",
18198       FT_NONE, BASE_NONE, NULL, 0,
18199       NULL, HFILL }},
18200
18201     {&hf_ieee80211_tag_supported_channels_first,
18202      {"First Supported Channel", "wlan_mgt.supchan.first",
18203       FT_UINT8, BASE_DEC, NULL, 0,
18204       NULL, HFILL }},
18205
18206     {&hf_ieee80211_tag_supported_channels_range,
18207      {"Supported Channel Range", "wlan_mgt.supchan.range",
18208       FT_UINT8, BASE_DEC, NULL, 0,
18209       NULL, HFILL }},
18210
18211     {&hf_ieee80211_csa_channel_switch_mode,
18212      {"Channel Switch Mode", "wlan_mgt.csa.channel_switch_mode",
18213       FT_UINT8, BASE_HEX, NULL, 0,
18214       "Indicates any restrictions on transmission until a channel switch", HFILL }},
18215
18216     {&hf_ieee80211_csa_new_channel_number,
18217      {"New Channel Number", "wlan_mgt.csa.new_channel_number",
18218       FT_UINT8, BASE_HEX, NULL, 0,
18219       "Set to the number of the channel to which the STA is moving", HFILL }},
18220
18221     {&hf_ieee80211_csa_channel_switch_count,
18222      {"Channel Switch Count", "wlan_mgt.csa.channel_switch_count",
18223       FT_UINT8, BASE_DEC, NULL, 0,
18224       "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 }},
18225
18226     {&hf_ieee80211_tag_measure_request_token,
18227      {"Measurement Token", "wlan_mgt.measure.req.token",
18228       FT_UINT8, BASE_HEX, NULL, 0xff,
18229       NULL, HFILL }},
18230
18231     {&hf_ieee80211_tag_measure_request_mode,
18232      {"Measurement Request Mode", "wlan_mgt.measure.req.mode",
18233       FT_UINT8, BASE_HEX, NULL, 0xff,
18234       NULL, HFILL }},
18235
18236     {&hf_ieee80211_tag_measure_request_mode_parallel,
18237      {"Parallel", "wlan_mgt.measure.req.reqmode.parallel",
18238       FT_BOOLEAN, 8, NULL, 0x01,
18239       NULL, HFILL }},
18240
18241     {&hf_ieee80211_tag_measure_request_mode_enable,
18242      {"Measurement Request Mode Field", "wlan_mgt.measure.req.reqmode.enable",
18243       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x02,
18244       NULL, HFILL }},
18245
18246     {&hf_ieee80211_tag_measure_request_mode_request,
18247      {"Measurement Reports", "wlan_mgt.measure.req.reqmode.request",
18248       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x04,
18249       NULL, HFILL }},
18250
18251     {&hf_ieee80211_tag_measure_request_mode_report,
18252      {"Autonomous Measurement Reports", "wlan_mgt.measure.req.reqmode.report",
18253       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x08,
18254       NULL, HFILL }},
18255
18256     {&hf_ieee80211_tag_measure_request_mode_duration_mandatory,
18257      {"Duration Mandatory", "wlan_mgt.measure.req.reqmode.duration_mandatory",
18258       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x10,
18259       NULL, HFILL }},
18260
18261     {&hf_ieee80211_tag_measure_request_mode_reserved,
18262      {"Reserved", "wlan_mgt.measure.req.reqmode.reserved",
18263       FT_UINT8, BASE_HEX, NULL, 0xE0,
18264       NULL, HFILL }},
18265
18266     {&hf_ieee80211_tag_measure_request_type,
18267      {"Measurement Request Type", "wlan_mgt.measure.req.reqtype",
18268       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_type_flags_ext, 0x00,
18269       NULL, HFILL }},
18270
18271     {&hf_ieee80211_tag_measure_request_channel_number,
18272      {"Measurement Channel Number", "wlan_mgt.measure.req.channelnumber",
18273       FT_UINT8, BASE_HEX, NULL, 0,
18274       NULL, HFILL }},
18275
18276     {&hf_ieee80211_tag_measure_request_start_time,
18277      {"Measurement Start Time", "wlan_mgt.measure.req.starttime",
18278       FT_UINT64, BASE_HEX, NULL, 0,
18279       NULL, HFILL }},
18280
18281     {&hf_ieee80211_tag_measure_request_duration,
18282      {"Measurement Duration", "wlan_mgt.measure.req.channelnumber",
18283       FT_UINT16, BASE_HEX, NULL, 0,
18284       "in TU (1 TU = 1024 us)", HFILL }},
18285
18286     {&hf_ieee80211_tag_measure_request_regulatory_class,
18287      {"Measurement Channel Number", "wlan_mgt.measure.req.regclass",
18288       FT_UINT8, BASE_HEX, NULL, 0,
18289       NULL, HFILL }},
18290
18291     {&hf_ieee80211_tag_measure_request_randomization_interval,
18292      {"Randomization Interval", "wlan_mgt.measure.req.randint",
18293       FT_UINT16, BASE_HEX, NULL, 0,
18294       "in TU (1 TU = 1024 us)", HFILL }},
18295
18296     {&hf_ieee80211_tag_measure_request_measurement_mode,
18297      {"Measurement Mode", "wlan_mgt.measure.req.measurementmode",
18298       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_measurement_mode_flags), 0,
18299       NULL, HFILL }},
18300
18301     {&hf_ieee80211_tag_measure_request_bssid,
18302      {"BSSID", "wlan_mgt.measure.req.bssid",
18303       FT_ETHER, BASE_NONE, NULL, 0,
18304       NULL, HFILL }},
18305
18306     {&hf_ieee80211_tag_measure_request_subelement_length,
18307      {"Length", "wlan_mgt.measure.req.sub.length",
18308       FT_UINT8, BASE_DEC, NULL, 0,
18309       NULL, HFILL }},
18310
18311     {&hf_ieee80211_tag_measure_request_beacon_sub_id,
18312      {"SubElement ID", "wlan_mgt.measure.req.beacon.sub.id",
18313       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_beacon_sub_id_flags), 0,
18314       NULL, HFILL }},
18315
18316     {&hf_ieee80211_tag_measure_request_beacon_sub_ssid,
18317      {"SSID", "wlan_mgt.measure.req.beacon.sub.ssid",
18318       FT_STRING, BASE_NONE, 0, 0,
18319       NULL, HFILL }},
18320
18321     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition,
18322      {"Reporting Condition", "wlan_mgt.measure.req.beacon.sub.bri.repcond",
18323       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags), 0,
18324       NULL, HFILL }},
18325
18326     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset,
18327      {"Threshold/Offset", "wlan_mgt.measure.req.beacon.sub.bri.threshold_offset",
18328       FT_UINT8, BASE_HEX, NULL, 0,
18329       NULL, HFILL }},
18330
18331     {&hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail,
18332      {"Reporting Detail", "wlan_mgt.measure.req.beacon.sub.bri.reporting_detail",
18333       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags), 0,
18334       NULL, HFILL }},
18335
18336     {&hf_ieee80211_tag_measure_request_beacon_sub_request,
18337      {"Request", "wlan_mgt.measure.req.beacon.sub.request",
18338       FT_UINT8, BASE_DEC, 0, 0,
18339       NULL, HFILL }},
18340
18341     {&hf_ieee80211_tag_measure_request_beacon_unknown,
18342      {"Unknown Data", "wlan_mgt.measure.req.beacon.unknown",
18343       FT_BYTES, BASE_NONE, NULL, 0,
18344       "(not interpreted)", HFILL }},
18345
18346     {&hf_ieee80211_tag_measure_request_frame_request_type,
18347      {"Frame Request Type", "wlan_mgt.measure.req.frame_request_type",
18348       FT_UINT8, BASE_HEX, NULL, 0,
18349       NULL, HFILL }},
18350
18351     {&hf_ieee80211_tag_measure_request_mac_address,
18352      {"MAC Address", "wlan_mgt.measure.req.mac_address",
18353       FT_BYTES, BASE_NONE, NULL, 0,
18354       NULL, HFILL }},
18355
18356     {&hf_ieee80211_tag_measure_request_peer_mac_address,
18357      {"Peer MAC Address", "wlan_mgt.measure.req.peer_mac_address",
18358       FT_BYTES, BASE_NONE, NULL, 0,
18359       NULL, HFILL }},
18360
18361     {&hf_ieee80211_tag_measure_request_group_id,
18362      {"Group ID", "wlan_mgt.measure.req.groupid",
18363       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_group_id_flags_ext, 0,
18364       NULL, HFILL }},
18365
18366     {&hf_ieee80211_tag_measure_report_measurement_token,
18367      {"Measurement Token", "wlan_mgt.measure.req.token",
18368       FT_UINT8, BASE_HEX, NULL, 0,
18369       NULL, HFILL }},
18370
18371     {&hf_ieee80211_tag_measure_report_mode,
18372      {"Measurement Report Mode", "wlan_mgt.measure.req.mode",
18373       FT_UINT8, BASE_HEX, NULL, 0,
18374       NULL, HFILL }},
18375
18376     {&hf_ieee80211_tag_measure_report_mode_late,
18377      {"Measurement Report Mode Field", "wlan_mgt.measure.rep.repmode.late",
18378       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x01,
18379       NULL, HFILL }},
18380
18381     {&hf_ieee80211_tag_measure_report_mode_incapable,
18382      {"Measurement Reports", "wlan_mgt.measure.rep.repmode.incapable",
18383       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x02,
18384       NULL, HFILL }},
18385
18386     {&hf_ieee80211_tag_measure_report_mode_refused,
18387      {"Autonomous Measurement Reports", "wlan_mgt.measure.rep.repmode.refused",
18388       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x04,
18389       NULL, HFILL }},
18390
18391     {&hf_ieee80211_tag_measure_report_mode_reserved,
18392      {"Reserved", "wlan_mgt.measure.rep.repmode.reserved",
18393       FT_UINT8, BASE_HEX, NULL, 0xf8,
18394       NULL, HFILL }},
18395
18396     {&hf_ieee80211_tag_measure_report_type,
18397      {"Measurement Report Type", "wlan_mgt.measure.rep.reptype",
18398       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_report_type_flags_ext, 0x00,
18399       NULL, HFILL }},
18400
18401     {&hf_ieee80211_tag_measure_report_channel_number,
18402      {"Measurement Channel Number", "wlan_mgt.measure.rep.channelnumber",
18403       FT_UINT8, BASE_HEX, NULL, 0,
18404       NULL, HFILL }},
18405
18406     {&hf_ieee80211_tag_measure_report_start_time,
18407      {"Measurement Start Time", "wlan_mgt.measure.rep.starttime",
18408       FT_UINT64, BASE_HEX, NULL, 0,
18409       NULL, HFILL }},
18410
18411     {&hf_ieee80211_tag_measure_report_duration,
18412      {"Measurement Duration", "wlan_mgt.measure.rep.channelnumber",
18413       FT_UINT16, BASE_HEX, NULL, 0,
18414       NULL, HFILL }},
18415
18416     {&hf_ieee80211_tag_measure_cca_busy_fraction,
18417      {"CCA Busy Fraction", "wlan_mgt.measure.rep.ccabusy",
18418       FT_UINT8, BASE_HEX, NULL, 0,
18419       NULL, HFILL }},
18420
18421     {&hf_ieee80211_tag_measure_basic_map_field,
18422      {"Map Field", "wlan_mgt.measure.rep.mapfield",
18423       FT_UINT8, BASE_HEX, NULL, 0,
18424       NULL, HFILL }},
18425
18426     {&hf_ieee80211_tag_measure_map_field_bss,
18427      {"BSS", "wlan_mgt.measure.rep.repmode.mapfield.bss",
18428       FT_BOOLEAN, 8, TFS (&ieee80211_tag_measure_map_field_bss_flag), 0x01,
18429       NULL, HFILL }},
18430
18431     {&hf_ieee80211_tag_measure_map_field_odfm,
18432      {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan_mgt.measure.rep.repmode.mapfield.bss",
18433       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x02,
18434       NULL, HFILL }},
18435
18436     {&hf_ieee80211_tag_measure_map_field_unident_signal,
18437      {"Unidentified Signal", "wlan_mgt.measure.rep.repmode.mapfield.unidentsig",
18438       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x04,
18439       NULL, HFILL }},
18440
18441     {&hf_ieee80211_tag_measure_map_field_radar,
18442      {"Radar", "wlan_mgt.measure.rep.repmode.mapfield.radar",
18443       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x08,
18444       NULL, HFILL }},
18445
18446     {&hf_ieee80211_tag_measure_map_field_unmeasured,
18447      {"Unmeasured", "wlan_mgt.measure.rep.repmode.mapfield.unmeasured",
18448       FT_BOOLEAN, 8, TFS (&tfs_true_false), 0x10,
18449       NULL, HFILL }},
18450
18451     {&hf_ieee80211_tag_measure_map_field_reserved,
18452      {"Reserved", "wlan_mgt.measure.rep.repmode.mapfield.reserved",
18453       FT_UINT8, BASE_HEX, NULL, 0xe0,
18454       NULL, HFILL }},
18455
18456     {&hf_ieee80211_tag_measure_rpi_histogram_report,
18457      {"Receive Power Indicator (RPI) Histogram Report", "wlan_mgt.measure.rep.rpi.histogram_report",
18458       FT_BYTES, BASE_NONE, NULL, 0,
18459       NULL, HFILL }},
18460
18461     {&hf_ieee80211_tag_measure_rpi_histogram_report_0,
18462      {"RPI 0 Density", "wlan_mgt.measure.rep.rpi.rpi0density",
18463       FT_UINT8, BASE_HEX, NULL, 0,
18464       "Receive Power Indicator (RPI) 0 Density", HFILL }},
18465
18466     {&hf_ieee80211_tag_measure_rpi_histogram_report_1,
18467      {"RPI 1 Density", "wlan_mgt.measure.rep.rpi.rpi1density",
18468       FT_UINT8, BASE_HEX, NULL, 0,
18469       "Receive Power Indicator (RPI) 1 Density", HFILL }},
18470
18471     {&hf_ieee80211_tag_measure_rpi_histogram_report_2,
18472      {"RPI 2 Density", "wlan_mgt.measure.rep.rpi.rpi2density",
18473       FT_UINT8, BASE_HEX, NULL, 0,
18474       "Receive Power Indicator (RPI) 2 Density", HFILL }},
18475
18476     {&hf_ieee80211_tag_measure_rpi_histogram_report_3,
18477      {"RPI 3 Density", "wlan_mgt.measure.rep.rpi.rpi3density",
18478       FT_UINT8, BASE_HEX, NULL, 0,
18479       "Receive Power Indicator (RPI) 3 Density", HFILL }},
18480
18481     {&hf_ieee80211_tag_measure_rpi_histogram_report_4,
18482      {"RPI 4 Density", "wlan_mgt.measure.rep.rpi.rpi4density",
18483       FT_UINT8, BASE_HEX, NULL, 0,
18484       "Receive Power Indicator (RPI) 4 Density", HFILL }},
18485
18486     {&hf_ieee80211_tag_measure_rpi_histogram_report_5,
18487      {"RPI 5 Density", "wlan_mgt.measure.rep.rpi.rpi5density",
18488       FT_UINT8, BASE_HEX, NULL, 0,
18489       "Receive Power Indicator (RPI) 5 Density", HFILL }},
18490
18491     {&hf_ieee80211_tag_measure_rpi_histogram_report_6,
18492      {"RPI 6 Density", "wlan_mgt.measure.rep.rpi.rpi6density",
18493       FT_UINT8, BASE_HEX, NULL, 0,
18494       "Receive Power Indicator (RPI) 6 Density", HFILL }},
18495
18496     {&hf_ieee80211_tag_measure_rpi_histogram_report_7,
18497      {"RPI 7 Density", "wlan_mgt.measure.rep.rpi.rpi7density",
18498       FT_UINT8, BASE_HEX, NULL, 0,
18499       "Receive Power Indicator (RPI) 7 Density", HFILL }},
18500
18501     {&hf_ieee80211_tag_measure_report_regulatory_class,
18502      {"Regulatory Class", "wlan_mgt.measure.rep.regclass",
18503       FT_UINT8, BASE_HEX, NULL, 0,
18504       NULL, HFILL }},
18505
18506     {&hf_ieee80211_tag_measure_report_channel_load,
18507      {"Channel Load", "wlan_mgt.measure.rep.chanload",
18508       FT_UINT8, BASE_HEX, NULL, 0,
18509       NULL, HFILL }},
18510
18511     {&hf_ieee80211_tag_measure_report_frame_info,
18512      {"Reported Frame Information", "wlan_mgt.measure.rep.frameinfo",
18513       FT_UINT8, BASE_HEX, NULL, 0,
18514       NULL, HFILL }},
18515
18516     {&hf_ieee80211_tag_measure_report_frame_info_phy_type,
18517      {"Condensed PHY", "wlan_mgt.measure.rep.frameinfo.phytype",
18518       FT_UINT8, BASE_HEX, NULL, 0x7F,
18519       NULL, HFILL }},
18520
18521     {&hf_ieee80211_tag_measure_report_frame_info_frame_type,
18522      {"Reported Frame Type", "wlan_mgt.measure.rep.frameinfo.frametype",
18523       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_report_frame_info_frame_type_flag), 0x80,
18524       NULL, HFILL }},
18525
18526     {&hf_ieee80211_tag_measure_report_rcpi,
18527      {"Received Channel Power Indicator (RCPI)", "wlan_mgt.measure.rep.rcpi",
18528       FT_UINT8, BASE_HEX, NULL, 0,
18529       "in dBm", HFILL }},
18530
18531     {&hf_ieee80211_tag_measure_report_rsni,
18532      {"Received Signal to Noise Indicator (RSNI)", "wlan_mgt.measure.rep.rsni",
18533       FT_UINT8, BASE_HEX, NULL, 0,
18534       "in dB", HFILL }},
18535
18536     {&hf_ieee80211_tag_measure_report_bssid,
18537      {"BSSID Being Reported", "wlan_mgt.measure.rep.bssid",
18538       FT_ETHER, BASE_NONE, NULL, 0,
18539       NULL, HFILL }},
18540
18541     {&hf_ieee80211_tag_measure_report_ant_id,
18542      {"Antenna ID", "wlan_mgt.measure.rep.antid",
18543       FT_UINT8, BASE_HEX, NULL, 0,
18544       NULL, HFILL }},
18545
18546     {&hf_ieee80211_tag_measure_report_anpi,
18547      {"ANPI", "wlan_mgt.measure.rep.anpi",
18548       FT_UINT8, BASE_HEX, NULL, 0,
18549       NULL, HFILL }},
18550
18551     {&hf_ieee80211_tag_measure_report_ipi_density_0,
18552      {"IPI Density 0", "wlan_mgt.measure.rep.ipi_density0",
18553       FT_UINT8, BASE_HEX, NULL, 0,
18554       NULL, HFILL }},
18555
18556     {&hf_ieee80211_tag_measure_report_ipi_density_1,
18557      {"IPI Density 1", "wlan_mgt.measure.rep.ipi_density1",
18558       FT_UINT8, BASE_HEX, NULL, 0,
18559       NULL, HFILL }},
18560
18561     {&hf_ieee80211_tag_measure_report_ipi_density_2,
18562      {"IPI Density 2", "wlan_mgt.measure.rep.ipi_density2",
18563       FT_UINT8, BASE_HEX, NULL, 0,
18564       NULL, HFILL }},
18565
18566     {&hf_ieee80211_tag_measure_report_ipi_density_3,
18567      {"IPI Density 3", "wlan_mgt.measure.rep.ipi_density3",
18568       FT_UINT8, BASE_HEX, NULL, 0,
18569       NULL, HFILL }},
18570
18571     {&hf_ieee80211_tag_measure_report_ipi_density_4,
18572      {"IPI Density 4", "wlan_mgt.measure.rep.ipi_density4",
18573       FT_UINT8, BASE_HEX, NULL, 0,
18574       NULL, HFILL }},
18575
18576     {&hf_ieee80211_tag_measure_report_ipi_density_5,
18577      {"IPI Density 5", "wlan_mgt.measure.rep.ipi_density5",
18578       FT_UINT8, BASE_HEX, NULL, 0,
18579       NULL, HFILL }},
18580
18581     {&hf_ieee80211_tag_measure_report_ipi_density_6,
18582      {"IPI Density 6", "wlan_mgt.measure.rep.ipi_density6",
18583       FT_UINT8, BASE_HEX, NULL, 0,
18584       NULL, HFILL }},
18585
18586     {&hf_ieee80211_tag_measure_report_ipi_density_7,
18587      {"IPI Density 7", "wlan_mgt.measure.rep.ipi_density7",
18588       FT_UINT8, BASE_HEX, NULL, 0,
18589       NULL, HFILL }},
18590
18591     {&hf_ieee80211_tag_measure_report_ipi_density_8,
18592      {"IPI Density 8", "wlan_mgt.measure.rep.ipi_density8",
18593       FT_UINT8, BASE_HEX, NULL, 0,
18594       NULL, HFILL }},
18595
18596     {&hf_ieee80211_tag_measure_report_ipi_density_9,
18597      {"IPI Density 9", "wlan_mgt.measure.rep.ipi_density9",
18598       FT_UINT8, BASE_HEX, NULL, 0,
18599       NULL, HFILL }},
18600
18601     {&hf_ieee80211_tag_measure_report_ipi_density_10,
18602      {"IPI Density 10", "wlan_mgt.measure.rep.ipi_density10",
18603       FT_UINT8, BASE_HEX, NULL, 0,
18604       NULL, HFILL }},
18605
18606     {&hf_ieee80211_tag_measure_report_parent_tsf,
18607      {"Parent Timing Synchronization Function (TSF)", "wlan_mgt.measure.rep.parenttsf",
18608       FT_UINT32, BASE_HEX, NULL, 0,
18609       NULL, HFILL }},
18610
18611     {&hf_ieee80211_tag_quiet_count,
18612      {"Count", "wlan_mgt.quiet.count",
18613       FT_UINT8, BASE_DEC, NULL, 0,
18614       "Set to the number of TBTTs until the beacon interval during which the next quiet interval shall start", HFILL }},
18615
18616     {&hf_ieee80211_tag_quiet_period,
18617      {"Period", "wlan_mgt.quiet.period",
18618       FT_UINT8, BASE_DEC, NULL, 0,
18619       "Set to the number of beacon intervals between the start of regularly scheduled quiet intervals", HFILL }},
18620
18621     {&hf_ieee80211_tag_quiet_duration,
18622      {"Duration", "wlan_mgt.quiet.duration",
18623       FT_UINT16, BASE_DEC, NULL, 0,
18624       "Set to the duration of the quiet interval", HFILL }},
18625
18626     {&hf_ieee80211_tag_quiet_offset,
18627      {"Offset", "wlan_mgt.quiet.offset",
18628       FT_UINT16, BASE_DEC, NULL, 0,
18629       "Set to the offset of the start of the quiet interval from the TBTT", HFILL }},
18630
18631     {&hf_ieee80211_tag_dfs_owner,
18632      {"Owner", "wlan_mgt.dfs.owner",
18633       FT_ETHER, BASE_NONE, NULL, 0,
18634       "Set to the individual IEEE MAC address of the STA that is the currently known DFS Owner in the IBSS", HFILL  }},
18635
18636     {&hf_ieee80211_tag_dfs_recovery_interval,
18637      {"Recovery Interval", "wlan_mgt.dfs.recovery_interval",
18638       FT_UINT8, BASE_DEC, NULL, 0,
18639       "Indicates the time interval that shall be used for DFS owner recovery", HFILL  }},
18640
18641     {&hf_ieee80211_tag_dfs_channel_map,
18642      {"Channel Map", "wlan_mgt.dfs.channel_map",
18643       FT_NONE, BASE_NONE, NULL, 0,
18644       NULL, HFILL  }},
18645
18646     {&hf_ieee80211_tag_dfs_channel_number,
18647      {"Channel Number", "wlan_mgt.dfs.channel_number",
18648       FT_UINT8, BASE_DEC, NULL, 0,
18649       NULL, HFILL  }},
18650
18651     {&hf_ieee80211_tag_dfs_map,
18652      {"Map", "wlan_mgt.dfs.map",
18653       FT_UINT8, BASE_HEX, NULL, 0,
18654       NULL, HFILL  }},
18655
18656     {&hf_ieee80211_tag_erp_info,
18657      {"ERP Information", "wlan_mgt.erp_info",
18658       FT_UINT8, BASE_HEX, NULL, 0,
18659       NULL, HFILL  }},
18660
18661     {&hf_ieee80211_tag_erp_info_erp_present,
18662      {"Non ERP Present", "wlan_mgt.erp_info.erp_present",
18663       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
18664       NULL, HFILL  }},
18665
18666     {&hf_ieee80211_tag_erp_info_use_protection,
18667      {"Use Protection", "wlan_mgt.erp_info.use_protection",
18668       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
18669       NULL, HFILL  }},
18670
18671     {&hf_ieee80211_tag_erp_info_barker_preamble_mode,
18672      {"Barker Preamble Mode", "wlan_mgt.erp_info.barker_preamble_mode",
18673       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
18674       NULL, HFILL  }},
18675
18676     {&hf_ieee80211_tag_erp_info_reserved,
18677      {"Reserved", "wlan_mgt.erp_info.reserved",
18678       FT_UINT8, BASE_HEX, NULL, 0xF8,
18679       NULL, HFILL  }},
18680
18681     /* Table 8-103-Capabilities field */
18682     {&hf_ieee80211_tag_extended_capabilities,
18683      {"Extended Capabilities", "wlan_mgt.extcap",
18684       FT_UINT8, BASE_HEX, NULL, 0,
18685       NULL, HFILL }},
18686
18687     /* P802.11n/D6.0 */
18688     /* Extended Capability octet 1 */
18689     {&hf_ieee80211_tag_extended_capabilities_b0,
18690      {"20/40 BSS Coexistence Management Support", "wlan_mgt.extcap.b0",
18691       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18692       "HT Information Exchange Support", HFILL }},
18693
18694     /* P802.11p/D4.0 */
18695     {&hf_ieee80211_tag_extended_capabilities_b1,
18696      {"On-demand beacon", "wlan_mgt.extcap.b1",
18697       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18698       NULL, HFILL }},
18699
18700     {&hf_ieee80211_tag_extended_capabilities_b2,
18701      {"Extended Channel Switching", "wlan_mgt.extcap.b2",
18702       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18703       NULL, HFILL }},
18704
18705     {&hf_ieee80211_tag_extended_capabilities_b3,
18706      {"WAVE indication", "wlan_mgt.extcap.b3",
18707       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
18708       NULL, HFILL }},
18709     /*End: P802.11p/D4.0 */
18710
18711     {&hf_ieee80211_tag_extended_capabilities_b4,
18712      {"PSMP Capability", "wlan_mgt.extcap.b4",
18713       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18714       NULL, HFILL }},
18715
18716     {&hf_ieee80211_tag_extended_capabilities_b5,
18717      {"Reserved", "wlan_mgt.extcap.b5",
18718       FT_UINT8, BASE_HEX, NULL, 0x20,
18719       "Must be zero", HFILL }},
18720
18721     {&hf_ieee80211_tag_extended_capabilities_b6,
18722      {"S-PSMP Support", "wlan_mgt.extcap.b6",
18723       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18724       NULL, HFILL }},
18725
18726     {&hf_ieee80211_tag_extended_capabilities_b7,
18727      {"Event", "wlan_mgt.extcap.b7",
18728       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18729       NULL, HFILL }},
18730
18731
18732     /* Extended Capability octet 2 */
18733     {&hf_ieee80211_tag_extended_capabilities_b8,
18734      {"Diagnostics", "wlan_mgt.extcap.b8",
18735       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18736       NULL, HFILL }},
18737
18738     {&hf_ieee80211_tag_extended_capabilities_b9,
18739      {"Multicast Diagnostics", "wlan_mgt.extcap.b9",
18740       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18741       NULL, HFILL }},
18742
18743     {&hf_ieee80211_tag_extended_capabilities_b10,
18744      {"Location Tracking", "wlan_mgt.extcap.b10",
18745       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18746       NULL, HFILL }},
18747
18748     {&hf_ieee80211_tag_extended_capabilities_b11,
18749      {"FMS", "wlan_mgt.extcap.b11",
18750       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
18751       NULL, HFILL }},
18752
18753     {&hf_ieee80211_tag_extended_capabilities_b12,
18754      {"Proxy ARP Service", "wlan_mgt.extcap.b12",
18755       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18756       NULL, HFILL }},
18757
18758     {&hf_ieee80211_tag_extended_capabilities_b13,
18759      {"Collocated Interference Reporting", "wlan_mgt.extcap.b13",
18760       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18761       NULL, HFILL }},
18762
18763     {&hf_ieee80211_tag_extended_capabilities_b14,
18764      {"Civic Location", "wlan_mgt.extcap.b14",
18765       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18766       NULL, HFILL }},
18767
18768     {&hf_ieee80211_tag_extended_capabilities_b15,
18769      {"Geospatial Location", "wlan_mgt.extcap.b15",
18770       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18771       NULL, HFILL }},
18772
18773
18774     /* Extended Capability octet 3 */
18775     {&hf_ieee80211_tag_extended_capabilities_b16,
18776      {"TFS", "wlan_mgt.extcap.b16",
18777       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18778       NULL, HFILL }},
18779
18780     {&hf_ieee80211_tag_extended_capabilities_b17,
18781      {"WNM-Sleep Mode", "wlan_mgt.extcap.b17",
18782       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18783       NULL, HFILL }},
18784
18785     {&hf_ieee80211_tag_extended_capabilities_b18,
18786      {"TIM Broadcast", "wlan_mgt.extcap.b18",
18787       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18788       NULL, HFILL }},
18789
18790     {&hf_ieee80211_tag_extended_capabilities_b19,
18791      {"BSS Transition", "wlan_mgt.extcap.b19",
18792       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
18793       NULL, HFILL }},
18794
18795     {&hf_ieee80211_tag_extended_capabilities_b20,
18796      {"QoS Traffic Capability", "wlan_mgt.extcap.b20",
18797       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18798       NULL, HFILL }},
18799
18800     {&hf_ieee80211_tag_extended_capabilities_b21,
18801      {"AC Station Count", "wlan_mgt.extcap.b21",
18802       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18803       NULL, HFILL }},
18804
18805     {&hf_ieee80211_tag_extended_capabilities_b22,
18806      {"Multiple BSSID", "wlan_mgt.extcap.b22",
18807       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18808       NULL, HFILL }},
18809
18810     {&hf_ieee80211_tag_extended_capabilities_b23,
18811      {"Timing Measurement", "wlan_mgt.extcap.b23",
18812       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18813       NULL, HFILL }},
18814
18815
18816     /* Extended Capability octet 4 */
18817     {&hf_ieee80211_tag_extended_capabilities_b24,
18818      {"Channel Usage", "wlan_mgt.extcap.b24",
18819       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18820       NULL, HFILL }},
18821
18822     {&hf_ieee80211_tag_extended_capabilities_b25,
18823      {"SSID List", "wlan_mgt.extcap.b25",
18824       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18825       NULL, HFILL }},
18826
18827     {&hf_ieee80211_tag_extended_capabilities_b26,
18828      {"DMS", "wlan_mgt.extcap.b26",
18829       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18830       NULL, HFILL }},
18831
18832     {&hf_ieee80211_tag_extended_capabilities_b27,
18833      {"UTC TSF Offset", "wlan_mgt.extcap.b27",
18834       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
18835       NULL, HFILL }},
18836
18837     {&hf_ieee80211_tag_extended_capabilities_b28,
18838      {"Peer U-APSD Buffer STA Support", "wlan_mgt.extcap.b28",
18839       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18840       NULL, HFILL }},
18841
18842     {&hf_ieee80211_tag_extended_capabilities_b29,
18843      {"TDLS Peer PSM Support", "wlan_mgt.extcap.b29",
18844       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18845       NULL, HFILL }},
18846
18847     {&hf_ieee80211_tag_extended_capabilities_b30,
18848      {"TDLS channel switching", "wlan_mgt.extcap.b30",
18849       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18850       NULL, HFILL }},
18851
18852     {&hf_ieee80211_tag_extended_capabilities_b31,
18853      {"Interworking", "wlan_mgt.extcap.b31",
18854       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18855       NULL, HFILL }},
18856
18857
18858     /* Extended Capability octet 5 */
18859     {&hf_ieee80211_tag_extended_capabilities_b32,
18860      {"QoS Map", "wlan_mgt.extcap.b32",
18861       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18862       NULL, HFILL }},
18863
18864     {&hf_ieee80211_tag_extended_capabilities_b33,
18865      {"EBR", "wlan_mgt.extcap.b33",
18866       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18867       NULL, HFILL }},
18868
18869     {&hf_ieee80211_tag_extended_capabilities_b34,
18870      {"SSPN Interface", "wlan_mgt.extcap.b34",
18871       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18872       NULL, HFILL }},
18873
18874     {&hf_ieee80211_tag_extended_capabilities_b35,
18875      {"Reserved", "wlan_mgt.extcap.b35",
18876       FT_UINT8, BASE_HEX, NULL, 0x08,
18877       "Must be zero", HFILL }},
18878
18879     {&hf_ieee80211_tag_extended_capabilities_b36,
18880      {"MSGCF Capability", "wlan_mgt.extcap.b36",
18881       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18882       NULL, HFILL }},
18883
18884     {&hf_ieee80211_tag_extended_capabilities_b37,
18885      {"TDLS support", "wlan_mgt.extcap.b37",
18886       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18887       NULL, HFILL }},
18888
18889     {&hf_ieee80211_tag_extended_capabilities_b38,
18890      {"TDLS Prohibited", "wlan_mgt.extcap.b38",
18891       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18892       NULL, HFILL }},
18893
18894     {&hf_ieee80211_tag_extended_capabilities_b39,
18895      {"TDLS Channel Switching Prohibited", "wlan_mgt.extcap.b39",
18896       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18897       NULL, HFILL }},
18898
18899
18900     /* Extended Capability octet 6 */
18901     {&hf_ieee80211_tag_extended_capabilities_b40,
18902      {"Reject Unadmitted Frame", "wlan_mgt.extcap.b40",
18903       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18904       NULL, HFILL }},
18905
18906     {&hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
18907      {"Service Interval Granularity",
18908       "wlan_mgt.extcap.serv_int_granularity",
18909       FT_UINT8, BASE_DEC, VALS(service_interval_granularity_vals), 0x0e,
18910       NULL, HFILL }},
18911
18912     {&hf_ieee80211_tag_extended_capabilities_b44,
18913      {"Identifier Location", "wlan_mgt.extcap.b44",
18914       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18915       NULL, HFILL }},
18916
18917     {&hf_ieee80211_tag_extended_capabilities_b45,
18918      {"U-APSD Coexistence", "wlan_mgt.extcap.b45",
18919       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18920       NULL, HFILL }},
18921
18922     {&hf_ieee80211_tag_extended_capabilities_b46,
18923      {"WNM-Notification", "wlan_mgt.extcap.b46",
18924       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18925       NULL, HFILL }},
18926
18927     {&hf_ieee80211_tag_extended_capabilities_b47,
18928      {"Reserved", "wlan_mgt.extcap.b47",
18929       FT_UINT8, BASE_HEX, NULL, 0x80,
18930       "Must be zero", HFILL }},
18931
18932     /* Extended Capability octet 7 */
18933     {&hf_ieee80211_tag_extended_capabilities_b48,
18934      {"UTF-8 SSID", "wlan_mgt.extcap.b48",
18935       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18936       "The SSID in this BSS is interpreted using UTF-8 encoding", HFILL }},
18937
18938     {&hf_ieee80211_tag_extended_capabilities_o7,
18939      {"Reserved", "wlan_mgt.extcap.o7",
18940       FT_UINT8, BASE_HEX, NULL, 0xfe,
18941       "Must be zero", HFILL }},
18942
18943     /* Extended Capability octet 8 */
18944
18945     {&hf_ieee80211_tag_extended_capabilities_o8,
18946      {"Reserved", "wlan_mgt.extcap.o8",
18947       FT_UINT8, BASE_HEX, NULL, 0xff,
18948       "Must be zero", HFILL }},
18949
18950     {&hf_ieee80211_tag_cisco_ccx1_unknown,
18951      {"Unknown", "wlan_mgt.cisco.ccx1.unknown",
18952       FT_BYTES, BASE_NONE, NULL, 0,
18953       NULL, HFILL }},
18954
18955     {&hf_ieee80211_tag_cisco_ccx1_name,
18956      {"Name", "wlan_mgt.cisco.ccx1.name",
18957       FT_STRING, BASE_NONE, NULL, 0,
18958       NULL, HFILL }},
18959
18960     {&hf_ieee80211_tag_cisco_ccx1_clients,
18961      {"Clients", "wlan_mgt.cisco.ccx1.clients",
18962       FT_UINT8, BASE_DEC, NULL, 0,
18963       NULL, HFILL }},
18964
18965     {&hf_ieee80211_tag_cisco_ccx1_unknown2,
18966      {"Unknown2", "wlan_mgt.cisco.ccx1.unknown2",
18967       FT_BYTES, BASE_NONE, NULL, 0,
18968       NULL, HFILL }},
18969
18970     {&hf_ieee80211_tag_neighbor_report_bssid,
18971      {"BSSID", "wlan_mgt.nreport.bssid",
18972       FT_ETHER, BASE_NONE, NULL, 0,
18973       NULL, HFILL }},
18974
18975     {&hf_ieee80211_tag_neighbor_report_bssid_info,
18976      {"BSSID Information", "wlan_mgt.nreport.bssid.info",
18977       FT_UINT32, BASE_HEX, NULL, 0,
18978       NULL, HFILL }},
18979
18980     {&hf_ieee80211_tag_neighbor_report_bssid_info_reachability,
18981      {"AP Reachability", "wlan_mgt.nreport.bssid.info.reachability",
18982       FT_UINT16, BASE_HEX, NULL, 0x0003,
18983       NULL, HFILL }},
18984
18985     {&hf_ieee80211_tag_neighbor_report_bssid_info_security,
18986      {"Security", "wlan_mgt.nreport.bssid.info.security",
18987       FT_UINT16, BASE_HEX, NULL, 0x0004,
18988       NULL, HFILL }},
18989
18990     {&hf_ieee80211_tag_neighbor_report_bssid_info_key_scope,
18991      {"Key Scope", "wlan_mgt.nreport.bssid.info.keyscope",
18992       FT_UINT16, BASE_HEX, NULL, 0x0008,
18993       NULL, HFILL }},
18994
18995     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng,
18996      {"Capability: Spectrum Management", "wlan_mgt.nreport.bssid.info.capability.specmngt",
18997       FT_UINT16, BASE_HEX, NULL, 0x0010,
18998       NULL, HFILL }},
18999
19000     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos,
19001      {"Capability: QoS", "wlan_mgt.nreport.bssid.info.capability.qos",
19002       FT_UINT16, BASE_HEX, NULL, 0x0020,
19003       NULL, HFILL }},
19004
19005     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd,
19006      {"Capability: APSD", "wlan_mgt.nreport.bssid.info.capability.apsd",
19007       FT_UINT16, BASE_HEX, NULL, 0x0040,
19008       NULL, HFILL }},
19009
19010     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt,
19011      {"Capability: Radio Measurement", "wlan_mgt.nreport.bssid.info.capability.radiomsnt",
19012       FT_UINT16, BASE_HEX, NULL, 0x0080,
19013       NULL, HFILL }},
19014
19015     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback,
19016      {"Capability: Delayed Block Ack", "wlan_mgt.nreport.bssid.info.capability.dback",
19017       FT_UINT16, BASE_HEX, NULL, 0x0100,
19018       NULL, HFILL }},
19019
19020     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback,
19021      {"Capability: Immediate Block Ack", "wlan_mgt.nreport.bssid.info.capability.iback",
19022       FT_UINT16, BASE_HEX, NULL, 0x0200,
19023       NULL, HFILL }},
19024
19025     {&hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain,
19026      {"Mobility Domain", "wlan_mgt.nreport.bssid.info.mobilitydomain",
19027       FT_UINT16, BASE_HEX, NULL, 0x0400,
19028       NULL, HFILL }},
19029
19030     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput,
19031      {"High Throughput", "wlan_mgt.nreport.bssid.info.hthoughput",
19032       FT_UINT16, BASE_HEX, NULL, 0x0800,
19033       NULL, HFILL }},
19034
19035     {&hf_ieee80211_tag_neighbor_report_bssid_info_reserved,
19036      {"Reserved", "wlan_mgt.nreport.bssid.info.reserved",
19037       FT_UINT32, BASE_HEX, NULL, 0,
19038       NULL, HFILL }},
19039
19040     {&hf_ieee80211_tag_neighbor_report_reg_class,
19041      {"Regulatory Class", "wlan_mgt.nreport.regclass",
19042       FT_UINT8, BASE_HEX, NULL, 0,
19043       NULL, HFILL }},
19044
19045     {&hf_ieee80211_tag_neighbor_report_channel_number,
19046      {"Channel Number", "wlan_mgt.nreport.channumber",
19047       FT_UINT8, BASE_HEX, NULL, 0,
19048       NULL, HFILL }},
19049
19050     {&hf_ieee80211_tag_neighbor_report_phy_type,
19051      {"PHY Type", "wlan_mgt.nreport.phytype",
19052       FT_UINT8, BASE_HEX, NULL, 0,
19053       NULL, HFILL }},
19054
19055     {&hf_ieee80211_tag_supported_reg_classes_current,
19056      {"Current Regulatory Class", "wlan_mgt.supregclass.current",
19057       FT_UINT8, BASE_HEX, NULL, 0,
19058       NULL, HFILL }},
19059
19060     {&hf_ieee80211_tag_supported_reg_classes_alternate,
19061      {"Alternate Regulatory Classes", "wlan_mgt.supregclass.alt",
19062       FT_STRING, BASE_NONE, NULL, 0,
19063       NULL, HFILL }},
19064
19065     {&hf_ieee80211_wfa_ie_type,
19066      {"Type", "wlan_mgt.wfa.ie.type",
19067       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_type_vals), 0,
19068       NULL, HFILL }},
19069
19070     {&hf_ieee80211_wfa_ie_wpa_version,
19071      {"WPA Version", "wlan_mgt.wfa.ie.wpa.version",
19072       FT_UINT16, BASE_DEC, NULL, 0,
19073       NULL, HFILL }},
19074
19075     {&hf_ieee80211_wfa_ie_wpa_mcs,
19076      {"Multicast Cipher Suite", "wlan_mgt.wfa.ie.wpa.mcs",
19077       FT_UINT32, BASE_CUSTOM, wpa_mcs_base_custom, 0,
19078       "Contains the cipher suite selector used by the BSS to protect broadcast/multicasttraffic", HFILL }},
19079
19080     {&hf_ieee80211_wfa_ie_wpa_mcs_oui,
19081      {"Multicast Cipher Suite OUI", "wlan_mgt.wfa.ie.wpa.mcs.oui",
19082       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
19083       NULL, HFILL }},
19084
19085     {&hf_ieee80211_wfa_ie_wpa_mcs_type,
19086      {"Multicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.mcs.type",
19087       FT_UINT8, BASE_DEC, NULL, 0,
19088       NULL, HFILL }},
19089
19090     {&hf_ieee80211_wfa_ie_wpa_mcs_wfa_type,
19091      {"Multicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.mcs.type",
19092       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
19093       NULL, HFILL }},
19094
19095     {&hf_ieee80211_wfa_ie_wpa_ucs_count,
19096      {"Unicast Cipher Suite Count", "wlan_mgt.wfa.ie.wpa.ucs.count",
19097       FT_UINT16, BASE_DEC, NULL, 0,
19098       "Indicates the number of pairwise cipher suite selectors that are contained in the Unicast Cipher Suite List", HFILL }},
19099
19100     {&hf_ieee80211_wfa_ie_wpa_ucs_list,
19101      {"Unicast Cipher Suite List", "wlan_mgt.wfa.ie.wpa.ucs.list",
19102       FT_NONE, BASE_NONE, NULL, 0,
19103       "Contains a series of cipher suite selectors that indicate the Unicast cipher suites", HFILL }},
19104
19105     {&hf_ieee80211_wfa_ie_wpa_ucs,
19106      {"Unicast Cipher Suite", "wlan_mgt.wfa.ie.wpa.ucs",
19107       FT_UINT32, BASE_CUSTOM, wpa_ucs_base_custom, 0,
19108       NULL, HFILL }},
19109
19110     {&hf_ieee80211_wfa_ie_wpa_ucs_oui,
19111      {"Unicast Cipher Suite OUI", "wlan_mgt.wfa.ie.wpau.cs.oui",
19112       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
19113       NULL, HFILL }},
19114
19115     {&hf_ieee80211_wfa_ie_wpa_ucs_type,
19116      {"Unicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.ucs.type",
19117       FT_UINT8, BASE_DEC, NULL, 0,
19118       NULL, HFILL }},
19119
19120     {&hf_ieee80211_wfa_ie_wpa_ucs_wfa_type,
19121      {"Unicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.ucs.type",
19122       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
19123       NULL, HFILL }},
19124
19125     {&hf_ieee80211_wfa_ie_wpa_akms_count,
19126      {"Auth Key Management (AKM) Suite Count", "wlan_mgt.wfa.ie.wpa.akms.count",
19127       FT_UINT16, BASE_DEC, NULL, 0,
19128       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
19129
19130     {&hf_ieee80211_wfa_ie_wpa_akms_list,
19131      {"Auth Key Management (AKM) List", "wlan_mgt.wfa.ie.wpa.akms.list",
19132       FT_NONE, BASE_NONE, NULL, 0,
19133       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
19134
19135     {&hf_ieee80211_wfa_ie_wpa_akms,
19136      {"Auth Key Management (AKM) Suite", "wlan_mgt.wfa.ie.wpa.akms",
19137       FT_UINT32, BASE_CUSTOM, wpa_akms_base_custom, 0,
19138       NULL, HFILL }},
19139
19140     {&hf_ieee80211_wfa_ie_wpa_akms_oui,
19141      {"Auth Key Management (AKM) OUI", "wlan_mgt.wfa.ie.wpa.akms.oui",
19142       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
19143       NULL, HFILL }},
19144
19145     {&hf_ieee80211_wfa_ie_wpa_akms_type,
19146      {"Auth Key Management (AKM) type", "wlan_mgt.wfa.ie.wpa.akms.type",
19147       FT_UINT8, BASE_DEC, NULL, 0,
19148       NULL, HFILL }},
19149
19150     {&hf_ieee80211_wfa_ie_wpa_akms_wfa_type,
19151      {"Auth Key Management (AKM) type", "wlan_mgt.wfa.ie.wpa.type",
19152       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_keymgmt_vals), 0,
19153       NULL, HFILL }},
19154
19155     {&hf_ieee80211_wfa_ie_wme_subtype,
19156      {"WME Subtype", "wlan_mgt.wfa.ie.wme.subtype",
19157       FT_UINT8, BASE_DEC, VALS(ieee802111_wfa_ie_wme_type), 0,
19158       NULL, HFILL }},
19159
19160     {&hf_ieee80211_wfa_ie_wme_version,
19161      {"WME Version", "wlan_mgt.wfa.ie.wme.version",
19162       FT_UINT8, BASE_DEC, NULL, 0,
19163       NULL, HFILL }},
19164
19165     {&hf_ieee80211_wfa_ie_wme_qos_info,
19166      {"WME QoS Info", "wlan_mgt.wfa.ie.wme.qos_info",
19167       FT_UINT8, BASE_HEX, NULL, 0,
19168       NULL, HFILL }},
19169
19170     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
19171      {"Max SP Length", "wlan_mgt.wfa.ie.wme.qos_info.sta.max_sp_length",
19172       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals), 0x60,
19173       NULL, HFILL }},
19174
19175     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
19176      {"AC_BE", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_be",
19177       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x08,
19178       NULL, HFILL }},
19179
19180     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
19181      {"AC_BK", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_bk",
19182       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x04,
19183       NULL, HFILL }},
19184
19185     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
19186      {"AC_VI", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_vi",
19187       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x02,
19188       NULL, HFILL }},
19189
19190     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
19191      {"AC_VO", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_vo",
19192       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x01,
19193       NULL, HFILL }},
19194
19195     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
19196      {"Reserved", "wlan_mgt.wfa.ie.wme.qos_info.sta.reserved",
19197       FT_UINT8, BASE_HEX, NULL, 0x90,
19198       "Must Be Zero", HFILL }},
19199
19200     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
19201      {"U-APSD", "wlan_mgt.wfa.ie.wme.qos_info.ap.u_apsd",
19202       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
19203       "Indicates the WMM AP is currently supporting unscheduled automatic power save delivery", HFILL }},
19204
19205     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
19206      {"Parameter Set Count", "wlan_mgt.wfa.ie.wme.qos_info.ap.parameter_set_count",
19207       FT_UINT8, BASE_HEX, NULL, 0x0F,
19208       NULL, HFILL }},
19209
19210     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
19211      {"Reserved", "wlan_mgt.wfa.ie.wme.qos_info.ap.reserved",
19212       FT_UINT8, BASE_HEX, NULL, 0x70,
19213       "Must Be Zero", HFILL }},
19214
19215     {&hf_ieee80211_wfa_ie_wme_reserved,
19216      {"Reserved", "wlan_mgt.wfa.ie.wme.reserved",
19217       FT_BYTES, BASE_NONE, NULL, 0,
19218       "Must Be Zero", HFILL }},
19219
19220     {&hf_ieee80211_wfa_ie_wme_ac_parameters,
19221      {"Ac Parameters", "wlan_mgt.wfa.ie.wme.acp",
19222       FT_NONE, BASE_NONE, NULL, 0,
19223       NULL, HFILL }},
19224
19225     {&hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
19226      {"ACI / AIFSN Field", "wlan_mgt.wfa.ie.wme.acp.aci_aifsn",
19227       FT_UINT8, BASE_HEX, NULL, 0,
19228       NULL, HFILL }},
19229
19230     {&hf_ieee80211_wfa_ie_wme_acp_aci,
19231      {"ACI", "wlan_mgt.wfa.ie.wme.acp.aci",
19232       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wme_acs_vals), 0x60,
19233       NULL, HFILL }},
19234
19235     {&hf_ieee80211_wfa_ie_wme_acp_acm,
19236      {"Admission Control Mandatory", "wlan_mgt.wfa.ie.wme.acp.aci",
19237       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
19238       NULL, HFILL }},
19239
19240     {&hf_ieee80211_wfa_ie_wme_acp_aifsn,
19241      {"AIFSN", "wlan_mgt.wfa.ie.wme.acp.aifsn",
19242       FT_UINT8, BASE_DEC, NULL, 0x0F,
19243       NULL, HFILL }},
19244
19245     {&hf_ieee80211_wfa_ie_wme_acp_reserved,
19246      {"Reserved", "wlan_mgt.wfa.ie.wme.acp.reserved",
19247       FT_UINT8, BASE_DEC, NULL, 0x80,
19248       "Must be Zero", HFILL }},
19249
19250     {&hf_ieee80211_wfa_ie_wme_acp_ecw,
19251      {"ECW", "wlan_mgt.wfa.ie.wme.acp.ecw",
19252       FT_UINT8, BASE_HEX, NULL, 0x00,
19253       NULL, HFILL }},
19254
19255     {&hf_ieee80211_wfa_ie_wme_acp_ecw_max,
19256      {"ECW Max", "wlan_mgt.wfa.ie.wme.acp.ecw.max",
19257       FT_UINT8, BASE_DEC, NULL, 0xF0,
19258       NULL, HFILL }},
19259
19260     {&hf_ieee80211_wfa_ie_wme_acp_ecw_min,
19261      {"ECW Min", "wlan_mgt.wfa.ie.wme.acp.ecw.min",
19262       FT_UINT8, BASE_DEC, NULL, 0x0F,
19263       NULL, HFILL }},
19264
19265     {&hf_ieee80211_wfa_ie_wme_acp_txop_limit,
19266      {"TXOP Limit", "wlan_mgt.wfa.ie.wme.acp.txop_limit",
19267       FT_UINT16, BASE_DEC, NULL, 0x00,
19268       NULL, HFILL }},
19269
19270     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
19271      {"TS Info", "wlan_mgt.wfa.ie.wme.tspec.ts_info",
19272       FT_UINT24, BASE_HEX, NULL, 0,
19273       "Traffic Stream (TS) Info", HFILL }},
19274
19275     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
19276      {"TID", "wlan_mgt.wfa.ie.wme.tspec.ts_info.tid",
19277       FT_UINT24, BASE_DEC, NULL, 0x00001E,
19278       "Traffic Stream Info ID (TID)", HFILL }},
19279
19280     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
19281      {"Direction", "wlan_mgt.wfa.ie.wme.tspec.ts_info.dir",
19282       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals), 0x000060,
19283       "Traffic Stream (TS) Info Direction", HFILL }},
19284
19285     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
19286      {"PSB", "wlan_mgt.wfa.ie.wme.tspec.ts_info.psb",
19287       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals), 0x000400,
19288       "Traffic Stream (TS) Info Power Save Behavior (PSB)", HFILL }},
19289
19290     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
19291      {"UP", "wlan_mgt.wfa.ie.wme.tspec.ts_info.up",
19292       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals), 0x003800,
19293       "Traffic Stream (TS) Info User Priority (UP)", HFILL }},
19294
19295     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
19296      {"Reserved", "wlan_mgt.wfa.ie.wme.tspec.ts_info.reserved",
19297       FT_UINT24, BASE_HEX, NULL, 0xFFC381,
19298       "Must be Zero", HFILL }},
19299
19300     {&hf_ieee80211_wfa_ie_wme_tspec_nor_msdu,
19301      {"Normal MSDU Size", "wlan_mgt.wfa.ie.wme.tspec.nor_msdu",
19302       FT_UINT16, BASE_DEC, NULL, 0,
19303       NULL, HFILL }},
19304
19305     {&hf_ieee80211_wfa_ie_wme_tspec_max_msdu,
19306      {"Maximum MSDU Size", "wlan_mgt.wfa.ie.wme.tspec.max_msdu",
19307       FT_UINT16, BASE_DEC, NULL, 0,
19308       NULL, HFILL }},
19309
19310     {&hf_ieee80211_wfa_ie_wme_tspec_min_srv,
19311      {"Minimum Service Interval", "wlan_mgt.wfa.ie.wme.tspec.min_srv",
19312       FT_UINT32, BASE_DEC, NULL, 0,
19313       NULL, HFILL }},
19314
19315     {&hf_ieee80211_wfa_ie_wme_tspec_max_srv,
19316      {"Maximum Service Interval", "wlan_mgt.wfa.ie.wme.tspec.max_srv",
19317       FT_UINT32, BASE_DEC, NULL, 0,
19318       NULL, HFILL }},
19319
19320     {&hf_ieee80211_wfa_ie_wme_tspec_inact_int,
19321      {"Inactivity Interval", "wlan_mgt.wfa.ie.wme.tspec.inact_int",
19322       FT_UINT32, BASE_DEC, NULL, 0,
19323       NULL, HFILL }},
19324
19325     {&hf_ieee80211_wfa_ie_wme_tspec_susp_int,
19326      {"Suspension Interval", "wlan_mgt.wfa.ie.wme.tspec.susp_int",
19327       FT_UINT32, BASE_DEC, NULL, 0,
19328       NULL, HFILL }},
19329
19330     {&hf_ieee80211_wfa_ie_wme_tspec_srv_start,
19331      {"Service Start Time", "wlan_mgt.wfa.ie.wme.tspec.srv_start",
19332       FT_UINT32, BASE_DEC, NULL, 0,
19333       NULL, HFILL }},
19334
19335     {&hf_ieee80211_wfa_ie_wme_tspec_min_data,
19336      {"Minimum Data Rate", "wlan_mgt.wfa.ie.wme.tspec.min_data",
19337       FT_UINT32, BASE_DEC, NULL, 0,
19338       NULL, HFILL }},
19339
19340     {&hf_ieee80211_wfa_ie_wme_tspec_mean_data,
19341      {"Mean Data Rate", "wlan_mgt.wfa.ie.wme.tspec.mean_data",
19342       FT_UINT32, BASE_DEC, NULL, 0,
19343       NULL, HFILL }},
19344
19345     {&hf_ieee80211_wfa_ie_wme_tspec_peak_data,
19346      {"Peak Data Rate", "wlan_mgt.wfa.ie.wme.tspec.peak_data",
19347       FT_UINT32, BASE_DEC, NULL, 0,
19348       NULL, HFILL }},
19349
19350     {&hf_ieee80211_wfa_ie_wme_tspec_burst_size,
19351      {"Burst Size", "wlan_mgt.wfa.ie.wme.tspec.burst_size",
19352       FT_UINT32, BASE_DEC, NULL, 0,
19353       NULL, HFILL }},
19354
19355     {&hf_ieee80211_wfa_ie_wme_tspec_delay_bound,
19356      {"Delay Bound", "wlan_mgt.wfa.ie.wme.tspec.delay_bound",
19357       FT_UINT32, BASE_DEC, NULL, 0,
19358       NULL, HFILL }},
19359
19360     {&hf_ieee80211_wfa_ie_wme_tspec_min_phy,
19361      {"Minimum PHY Rate", "wlan_mgt.wfa.ie.wme.tspec.min_phy",
19362       FT_UINT32, BASE_DEC, NULL, 0,
19363       NULL, HFILL }},
19364
19365     {&hf_ieee80211_wfa_ie_wme_tspec_surplus,
19366      {"Surplus Bandwidth Allowance", "wlan_mgt.wfa.ie.wme.tspec.surplus",
19367       FT_UINT16, BASE_DEC, NULL, 0,
19368       NULL, HFILL }},
19369
19370     {&hf_ieee80211_wfa_ie_wme_tspec_medium,
19371      {"Medium Time", "wlan_mgt.wfa.ie.wme.tspec.medium",
19372       FT_UINT16, BASE_DEC, NULL, 0,
19373       NULL, HFILL }},
19374
19375     {&hf_ieee80211_rsn_ie_pmkid,
19376      {"RSN PMKID", "wlan_mgt.rsn.ie.pmkid",
19377       FT_BYTES, BASE_NONE, NULL, 0,
19378       NULL, HFILL }},
19379
19380     {&hf_ieee80211_rsn_ie_unknown,
19381      {"RSN Unknown", "wlan_mgt.rsn.ie.unknown",
19382       FT_BYTES, BASE_NONE, NULL, 0,
19383       NULL, HFILL }},
19384
19385     {&hf_ieee80211_marvell_ie_type,
19386      {"Type", "wlan_mgt.marvell.ie.type",
19387       FT_UINT8, BASE_HEX, NULL, 0,
19388       NULL, HFILL }},
19389
19390     {&hf_ieee80211_marvell_ie_mesh_subtype,
19391      {"Subtype", "wlan_mgt.marvell.ie.subtype",
19392       FT_UINT8, BASE_HEX, NULL, 0,
19393       NULL, HFILL }},
19394
19395     {&hf_ieee80211_marvell_ie_mesh_version,
19396      {"Version", "wlan_mgt.marvell.ie.version",
19397       FT_UINT8, BASE_HEX, NULL, 0,
19398       NULL, HFILL }},
19399
19400     {&hf_ieee80211_marvell_ie_mesh_active_proto_id,
19401      {"Path Selection Protocol", "wlan_mgt.marvell.ie.proto_id",
19402       FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0,
19403       NULL, HFILL }},
19404
19405     {&hf_ieee80211_marvell_ie_mesh_active_metric_id,
19406      {"Path Selection Metric", "wlan_mgt.marvell.ie.metric_id",
19407       FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0,
19408       NULL, HFILL }},
19409
19410     {&hf_ieee80211_marvell_ie_mesh_cap,
19411      {"Mesh Capabilities", "wlan_mgt.marvell.ie.cap",
19412       FT_UINT8, BASE_HEX, NULL, 0,
19413       NULL, HFILL }},
19414
19415     {&hf_ieee80211_marvell_ie_data,
19416      { "Marvell IE data", "wlan_mgt.marvell.data",
19417        FT_BYTES, BASE_NONE, NULL, 0x0,
19418        NULL, HFILL }},
19419
19420     {&hf_ieee80211_atheros_ie_type,
19421      {"Type", "wlan_mgt.atheros.ie.type",
19422       FT_UINT8, BASE_HEX, VALS(atheros_ie_type_vals), 0,
19423       NULL, HFILL }},
19424
19425     {&hf_ieee80211_atheros_ie_subtype,
19426      {"Subtype", "wlan_mgt.atheros.ie.subtype",
19427       FT_UINT8, BASE_HEX, NULL, 0,
19428       NULL, HFILL }},
19429
19430     {&hf_ieee80211_atheros_ie_version,
19431      {"Version", "wlan_mgt.atheros.ie.version",
19432       FT_UINT8, BASE_HEX, NULL, 0,
19433       NULL, HFILL }},
19434
19435     {&hf_ieee80211_atheros_ie_cap_f_turbop,
19436      {"Turbo Prime", "wlan_mgt.ie.atheros.capabilities.turbop",
19437       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_TURBOP,
19438       NULL, HFILL }},
19439
19440     {&hf_ieee80211_atheros_ie_cap_f_comp,
19441      {"Compression", "wlan_mgt.ie.atheros.capabilities.comp",
19442       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_COMP,
19443       NULL, HFILL }},
19444
19445     {&hf_ieee80211_atheros_ie_cap_f_ff,
19446      {"Fast Frames", "wlan_mgt.ie.atheros.capabilities.ff",
19447       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_FF,
19448       NULL, HFILL }},
19449
19450     {&hf_ieee80211_atheros_ie_cap_f_xr,
19451      {"eXtended Range", "wlan_mgt.ie.atheros.capabilities.xr",
19452       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_XR,
19453       NULL, HFILL }},
19454
19455     {&hf_ieee80211_atheros_ie_cap_f_ar,
19456      {"Advanced Radar", "wlan_mgt.ie.atheros.capabilities.ar",
19457       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_AR,
19458       NULL, HFILL }},
19459
19460     {&hf_ieee80211_atheros_ie_cap_f_burst,
19461      {"Burst", "wlan_mgt.ie.atheros.capabilities.burst",
19462       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BURST,
19463       NULL, HFILL }},
19464
19465     {&hf_ieee80211_atheros_ie_cap_f_wme,
19466      {"CWMin tuning", "wlan_mgt.ie.atheros.capabilities.wme",
19467       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_WME,
19468       NULL, HFILL }},
19469
19470     {&hf_ieee80211_atheros_ie_cap_f_boost,
19471      {"Boost", "wlan_mgt.ie.atheros.capabilities.boost",
19472       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BOOST,
19473       NULL, HFILL }},
19474
19475     {&hf_ieee80211_atheros_ie_advcap_cap,
19476      {"Capabilities", "wlan_mgt.atheros.ie.advcap.cap",
19477       FT_UINT8, BASE_HEX, NULL, 0,
19478       NULL, HFILL }},
19479
19480     {&hf_ieee80211_atheros_ie_advcap_defkey,
19481      {"Default key index", "wlan_mgt.atheros.ie.advcap.defkey",
19482       FT_UINT16, BASE_HEX, NULL, 0,
19483       NULL, HFILL }},
19484
19485     {&hf_ieee80211_atheros_ie_xr_info,
19486      {"Info", "wlan_mgt.atheros.ie.xr.info",
19487       FT_UINT8, BASE_HEX, NULL, 0,
19488       NULL, HFILL }},
19489
19490     {&hf_ieee80211_atheros_ie_xr_base_bssid,
19491      {"Base BSS Id", "wlan_mgt.atheros.ie.xr.base_bssid",
19492       FT_ETHER, BASE_NONE, NULL, 0,
19493       NULL, HFILL }},
19494
19495     {&hf_ieee80211_atheros_ie_xr_xr_bssid,
19496      {"XR BSS Id", "wlan_mgt.atheros.ie.xr.xr_bssid",
19497       FT_ETHER, BASE_NONE, NULL, 0,
19498       NULL, HFILL }},
19499
19500     {&hf_ieee80211_atheros_ie_xr_xr_beacon,
19501      {"XR Beacon Interval", "wlan_mgt.atheros.ie.xr.xr_beacon",
19502       FT_UINT32, BASE_CUSTOM, beacon_interval_base_custom, 0,
19503       NULL, HFILL }},
19504
19505     {&hf_ieee80211_atheros_ie_xr_base_cap,
19506      {"Base capabilities", "wlan_mgt.atheros.ie.xr.base_cap",
19507       FT_UINT8, BASE_HEX, NULL, 0,
19508       NULL, HFILL }},
19509
19510     {&hf_ieee80211_atheros_ie_xr_xr_cap,
19511      {"XR capabilities", "wlan_mgt.atheros.ie.xr.xr_cap",
19512       FT_UINT8, BASE_HEX, NULL, 0,
19513       NULL, HFILL }},
19514
19515     {&hf_ieee80211_atheros_ie_data,
19516      {"Atheros IE data", "wlan_mgt.atheros.data",
19517       FT_BYTES, BASE_NONE, NULL, 0,
19518       NULL, HFILL }},
19519
19520     {&hf_ieee80211_aironet_ie_type,
19521      {"Aironet IE type", "wlan_mgt.aironet.type",
19522       FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0,
19523       NULL, HFILL }},
19524
19525     {&hf_ieee80211_aironet_ie_version,
19526      {"Aironet IE CCX version?", "wlan_mgt.aironet.version",
19527       FT_UINT8, BASE_DEC, NULL, 0,
19528       NULL, HFILL }},
19529
19530     {&hf_ieee80211_aironet_ie_data,
19531      { "Aironet IE data", "wlan_mgt.aironet.data",
19532        FT_BYTES, BASE_NONE, NULL, 0x0,
19533        NULL, HFILL }},
19534
19535     {&hf_ieee80211_qbss_version,
19536      {"QBSS Version", "wlan_mgt.qbss.version",
19537       FT_UINT8, BASE_DEC, NULL, 0,
19538       NULL, HFILL }},
19539
19540     {&hf_ieee80211_qbss_scount,
19541      {"Station Count", "wlan_mgt.qbss.scount",
19542       FT_UINT16, BASE_DEC, NULL, 0,
19543       NULL, HFILL }},
19544
19545     {&hf_ieee80211_qbss_cu,
19546      {"Channel Utilization", "wlan_mgt.qbss.cu",
19547       FT_UINT8, BASE_DEC, NULL, 0,
19548       NULL, HFILL }},
19549
19550     {&hf_ieee80211_qbss_adc,
19551      {"Available Admission Capabilities", "wlan_mgt.qbss.adc",
19552       FT_UINT8, BASE_DEC, NULL, 0,
19553       NULL, HFILL }},
19554
19555     {&hf_ieee80211_qbss2_cu,
19556      {"Channel Utilization", "wlan_mgt.qbss2.cu",
19557       FT_UINT8, BASE_DEC, NULL, 0,
19558       NULL, HFILL }},
19559
19560     {&hf_ieee80211_qbss2_gl,
19561      {"G.711 CU Quantum", "wlan_mgt.qbss2.glimit",
19562       FT_UINT8, BASE_DEC, NULL, 0,
19563       NULL, HFILL }},
19564
19565     {&hf_ieee80211_qbss2_cal,
19566      {"Call Admission Limit", "wlan_mgt.qbss2.cal",
19567       FT_UINT8, BASE_DEC, NULL, 0,
19568       NULL, HFILL }},
19569
19570     {&hf_ieee80211_qbss2_scount,
19571      {"Station Count", "wlan_mgt.qbss2.scount",
19572       FT_UINT16, BASE_DEC, NULL, 0,
19573       NULL, HFILL }},
19574
19575     {&hf_ieee80211_aironet_ie_qos_reserved,
19576      {"Aironet IE QoS reserved", "wlan_mgt.aironet.qos.reserved",
19577       FT_UINT8, BASE_HEX, NULL, 0,
19578       NULL, HFILL }},
19579
19580     {&hf_ieee80211_aironet_ie_qos_paramset,
19581      {"Aironet IE QoS paramset", "wlan_mgt.aironet.qos.paramset",
19582       FT_UINT8, BASE_DEC, NULL, 0,
19583       NULL, HFILL }},
19584
19585     {&hf_ieee80211_aironet_ie_qos_val,
19586      {"Aironet IE QoS valueset", "wlan_mgt.aironet.qos.val",
19587       FT_BYTES, BASE_NONE, NULL, 0,
19588       NULL, HFILL }},
19589
19590     /* Vendor Specific : Aruba Networks */
19591     {&hf_ieee80211_vs_aruba_subtype,
19592      {"Subtype", "wlan_mgt.vs.aruba.subtype",
19593       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_aruba_subtype_vals), 0,
19594       NULL, HFILL }},
19595
19596     {&hf_ieee80211_vs_aruba_apname,
19597      {"AP Name", "wlan_mgt.vs.aruba.ap_name",
19598       FT_STRINGZ, BASE_NONE, NULL, 0,
19599       NULL, HFILL }},
19600
19601     {&hf_ieee80211_vs_aruba_data,
19602      {"Data", "wlan_mgt.vs.aruba.data",
19603       FT_BYTES, BASE_NONE, NULL, 0,
19604       NULL, HFILL }},
19605
19606     {&hf_ieee80211_tsinfo,
19607      {"Traffic Stream (TS) Info", "wlan_mgt.ts_info",
19608       FT_UINT24, BASE_HEX, NULL, 0,
19609       "Traffic Stream (TS) Info field", HFILL }},
19610
19611     {&hf_ieee80211_tsinfo_type,
19612      {"Traffic Type", "wlan_mgt.ts_info.type",
19613       FT_UINT24, BASE_DEC, VALS(tsinfo_type), 0x000001,
19614       "Traffic Stream (TS) Info Traffic Type", HFILL }},
19615
19616     {&hf_ieee80211_tsinfo_tsid,
19617      {"Traffic Stream ID (TSID)", "wlan_mgt.ts_info.tsid",
19618       FT_UINT24, BASE_DEC, NULL, 0x00001E,
19619       "Traffic Stream ID (TSID) Info TSID", HFILL }},
19620
19621     {&hf_ieee80211_tsinfo_dir,
19622      {"Direction", "wlan_mgt.ts_info.dir",
19623       FT_UINT24, BASE_DEC, VALS(tsinfo_direction), 0x000060,
19624       "Traffic Stream (TS) Info Direction", HFILL }},
19625
19626     {&hf_ieee80211_tsinfo_access,
19627      {"Access Policy", "wlan_mgt.ts_info.dir",
19628       FT_UINT24, BASE_DEC, VALS(tsinfo_access), 0x000180,
19629       "Traffic Stream (TS) Info Access Policy", HFILL }},
19630
19631     {&hf_ieee80211_tsinfo_agg,
19632      {"Aggregation", "wlan_mgt.ts_info.agg",
19633       FT_UINT24, BASE_DEC, NULL, 0x000200,
19634       "Traffic Stream (TS) Info Access Policy", HFILL }},
19635
19636     {&hf_ieee80211_tsinfo_apsd,
19637      {"Automatic Power-Save Delivery (APSD)", "wlan_mgt.ts_info.apsd",
19638       FT_UINT24, BASE_DEC, NULL, 0x000400,
19639       "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
19640
19641     {&hf_ieee80211_tsinfo_up,
19642      {"User Priority", "wlan_mgt.ts_info.up",
19643       FT_UINT24, BASE_DEC, VALS(qos_up), 0x003800,
19644       "Traffic Stream (TS) Info User Priority", HFILL }},
19645
19646     {&hf_ieee80211_tsinfo_ack,
19647      {"Ack Policy", "wlan_mgt.ts_info.ack",
19648       FT_UINT24, BASE_DEC, VALS(ack_policy), 0x00C000,
19649       "Traffic Stream (TS) Info Ack Policy", HFILL }},
19650
19651     {&hf_ieee80211_tsinfo_sched,
19652      {"Schedule", "wlan_mgt.ts_info.sched",
19653       FT_UINT24, BASE_DEC, NULL, 0x010000,
19654       "Traffic Stream (TS) Info Schedule", HFILL }},
19655
19656     {&hf_ieee80211_tsinfo_rsv,
19657      {"Reserved", "wlan_mgt.ts_info.rsv",
19658       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
19659       "Must be Zero", HFILL }},
19660
19661     {&hf_ieee80211_tspec_nor_msdu,
19662      {"Normal MSDU Size", "wlan_mgt.tspec.nor_msdu",
19663       FT_UINT16, BASE_DEC, NULL, 0,
19664       NULL, HFILL }},
19665
19666     {&hf_ieee80211_tspec_max_msdu,
19667      {"Maximum MSDU Size", "wlan_mgt.tspec.max_msdu",
19668       FT_UINT16, BASE_DEC, NULL, 0,
19669       NULL, HFILL }},
19670
19671     {&hf_ieee80211_tspec_min_srv,
19672      {"Minimum Service Interval", "wlan_mgt.tspec.min_srv",
19673       FT_UINT32, BASE_DEC, NULL, 0,
19674       NULL, HFILL }},
19675
19676     {&hf_ieee80211_tspec_max_srv,
19677      {"Maximum Service Interval", "wlan_mgt.tspec.max_srv",
19678       FT_UINT32, BASE_DEC, NULL, 0,
19679       NULL, HFILL }},
19680
19681     {&hf_ieee80211_tspec_inact_int,
19682      {"Inactivity Interval", "wlan_mgt.tspec.inact_int",
19683       FT_UINT32, BASE_DEC, NULL, 0,
19684       NULL, HFILL }},
19685
19686     {&hf_ieee80211_tspec_susp_int,
19687      {"Suspension Interval", "wlan_mgt.tspec.susp_int",
19688       FT_UINT32, BASE_DEC, NULL, 0,
19689       NULL, HFILL }},
19690
19691     {&hf_ieee80211_tspec_srv_start,
19692      {"Service Start Time", "wlan_mgt.tspec.srv_start",
19693       FT_UINT32, BASE_DEC, NULL, 0,
19694       NULL, HFILL }},
19695
19696     {&hf_ieee80211_tspec_min_data,
19697      {"Minimum Data Rate", "wlan_mgt.tspec.min_data",
19698       FT_UINT32, BASE_DEC, NULL, 0,
19699       NULL, HFILL }},
19700
19701     {&hf_ieee80211_tspec_mean_data,
19702      {"Mean Data Rate", "wlan_mgt.tspec.mean_data",
19703       FT_UINT32, BASE_DEC, NULL, 0,
19704       NULL, HFILL }},
19705
19706     {&hf_ieee80211_tspec_peak_data,
19707      {"Peak Data Rate", "wlan_mgt.tspec.peak_data",
19708       FT_UINT32, BASE_DEC, NULL, 0,
19709       NULL, HFILL }},
19710
19711     {&hf_ieee80211_tspec_burst_size,
19712      {"Burst Size", "wlan_mgt.tspec.burst_size",
19713       FT_UINT32, BASE_DEC, NULL, 0,
19714       NULL, HFILL }},
19715
19716     {&hf_ieee80211_tspec_delay_bound,
19717      {"Delay Bound", "wlan_mgt.tspec.delay_bound",
19718       FT_UINT32, BASE_DEC, NULL, 0,
19719       NULL, HFILL }},
19720
19721     {&hf_ieee80211_tspec_min_phy,
19722      {"Minimum PHY Rate", "wlan_mgt.tspec.min_phy",
19723       FT_UINT32, BASE_DEC, NULL, 0,
19724       NULL, HFILL }},
19725
19726     {&hf_ieee80211_tspec_surplus,
19727      {"Surplus Bandwidth Allowance", "wlan_mgt.tspec.surplus",
19728       FT_UINT16, BASE_DEC, NULL, 0,
19729       NULL, HFILL }},
19730
19731     {&hf_ieee80211_tspec_medium,
19732      {"Medium Time", "wlan_mgt.tspec.medium",
19733       FT_UINT16, BASE_DEC, NULL, 0,
19734       NULL, HFILL }},
19735
19736     {&hf_ieee80211_ts_delay,
19737      {"Traffic Stream (TS) Delay", "wlan_mgt.ts_delay",
19738       FT_UINT32, BASE_DEC, NULL, 0,
19739       NULL, HFILL }},
19740
19741     {&hf_ieee80211_tclas_process,
19742      {"Processing", "wlan_mgt.tclas_proc.processing",
19743       FT_UINT8, BASE_DEC, VALS(ieee80211_tclas_process_flag), 0,
19744       "TCLAS Processing", HFILL }},
19745
19746     {&hf_ieee80211_tag_qos_cap_qos_info,
19747      {"QoS Info", "wlan_mgt.tag.qos_cap.qos_info",
19748       FT_UINT8, BASE_HEX, NULL, 0,
19749       "TCLAS Processing", HFILL }},
19750
19751     {&hf_ieee80211_qos_info_field_vo_uapsd,
19752      {"AC_VO U-APSD Flag", "wlan_mgt.tag.qos_cap.qos_info.vo_uapsd",
19753       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
19754       NULL, HFILL }},
19755
19756     {&hf_ieee80211_qos_info_field_vi_uapsd,
19757      {"AC_VI U-APSD Flag", "wlan_mgt.tag.qos_cap.qos_info.vi_uapsd",
19758       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
19759       NULL, HFILL }},
19760
19761     {&hf_ieee80211_qos_info_field_bk_uapsd,
19762      {"AC_BK U-APSD Flag", "wlan_mgt.tag.qos_cap.qos_info.bk_uapsd",
19763       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
19764       NULL, HFILL }},
19765
19766     {&hf_ieee80211_qos_info_field_be_uapsd,
19767      {"AC_BE U-APSD Flag", "wlan_mgt.tag.qos_cap.qos_info.be_uapsd",
19768       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
19769       NULL, HFILL }},
19770
19771     {&hf_ieee80211_qos_info_field_qack,
19772      {"Q-ACK", "wlan_mgt.tag.qos_cap.qos_info.qack",
19773       FT_BOOLEAN, 8, TFS(&qos_info_field_qack_flags), 0x10,
19774       NULL, HFILL }},
19775
19776     {&hf_ieee80211_qos_info_field_max_sp_length,
19777      {"Max SP-Length", "wlan_mgt.tag.qos_cap.qos_info.max_sp_length",
19778       FT_UINT8, BASE_HEX, VALS(qos_info_field_max_sp_length_flags), 0x60,
19779       NULL , HFILL }},
19780
19781     {&hf_ieee80211_qos_info_field_more_data_ack,
19782      {"More Data Ack", "wlan_mgt.tag.qos_cap.qos_info.more_data_ack",
19783       FT_BOOLEAN, 8, TFS(&qos_info_field_more_data_ack_flags) , 0x80,
19784       NULL, HFILL }},
19785
19786     {&hf_ieee80211_qos_info_field_edca_upd_cnt,
19787      {"EDCA Parameter Set Update Count", "wlan_mgt.tag.qos_cap.qos_info.edca_upd_cnt",
19788       FT_UINT8, BASE_DEC, NULL, 0x07,
19789       NULL, HFILL}},
19790
19791     {&hf_ieee80211_qos_info_field_queue_req,
19792      {"Queue Request", "wlan_mgt.tag.qos_cap.qos_info.queue_req",
19793       FT_BOOLEAN, 8, TFS(&qos_info_field_queue_req_flags), 0x07,
19794       NULL, HFILL}},
19795
19796     {&hf_ieee80211_qos_info_field_txop_req,
19797      {"TXOP Request", "wlan_mgt.tag.qos_cap.qos_info.txop_req",
19798       FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x40,
19799       NULL, HFILL}},
19800
19801     {&hf_ieee80211_qos_info_field_reserved,
19802      {"Reserved", "wlan_mgt.tag.qos_cap.qos_info.reserved",
19803       FT_BOOLEAN, 8, NULL, 0x80,
19804       NULL, HFILL}},
19805
19806     {&hf_ieee80211_tag_ext_supp_rates,
19807      {"Extended Supported Rates", "wlan_mgt.extended_supported_rates",
19808       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
19809       "In Mbit/sec, (B) for Basic Rates", HFILL }},
19810
19811     {&hf_ieee80211_sched_info,
19812      {"Schedule Info", "wlan_mgt.sched.sched_info",
19813       FT_UINT16, BASE_HEX, NULL, 0,
19814       "Schedule Info field", HFILL }},
19815
19816     {&hf_ieee80211_sched_info_agg,
19817      {"Schedule Aggregation", "wlan_mgt.sched_info.agg",
19818       FT_UINT16, BASE_DEC, NULL, 0x0001,
19819       "Traffic Stream (TS) Info Access Policy", HFILL }},
19820
19821     {&hf_ieee80211_sched_info_tsid,
19822      {"Schedule Traffic Stream ID (TSID)", "wlan_mgt.sched_info.tsid",
19823       FT_UINT16, BASE_DEC, NULL, 0x001E,
19824       "Traffic Stream ID (TSID) Info TSID", HFILL }},
19825
19826     {&hf_ieee80211_sched_info_dir,
19827      {"Schedule Direction", "wlan_mgt.sched_info.dir",
19828       FT_UINT16, BASE_DEC, VALS(tsinfo_direction), 0x0060,
19829       "Traffic Stream (TS) Info Direction", HFILL }},
19830
19831     {&hf_ieee80211_sched_srv_start,
19832      {"Service Start Time", "wlan_mgt.sched.srv_start",
19833       FT_UINT32, BASE_HEX, NULL, 0,
19834       NULL, HFILL }},
19835
19836     {&hf_ieee80211_sched_srv_int,
19837      {"Service Interval", "wlan_mgt.sched.srv_int",
19838       FT_UINT32, BASE_HEX, NULL, 0,
19839       NULL, HFILL }},
19840
19841     {&hf_ieee80211_sched_spec_int,
19842      {"Specification Interval", "wlan_mgt.sched.spec_int",
19843       FT_UINT16, BASE_HEX, NULL, 0,
19844       NULL, HFILL }},
19845
19846     {&hf_ieee80211_aruba,
19847      {"Aruba Type", "wlan_mgt.aruba.type",
19848       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &aruba_mgt_typevals_ext, 0,
19849       "Aruba Management", HFILL }},
19850
19851     {&hf_ieee80211_aruba_hb_seq,
19852      {"Aruba Heartbeat Sequence", "wlan_mgt.aruba.heartbeat_sequence",
19853       FT_UINT64, BASE_DEC, NULL, 0,
19854       NULL, HFILL }},
19855
19856     {&hf_ieee80211_aruba_mtu,
19857      {"Aruba MTU Size", "wlan_mgt.aruba.mtu_size",
19858       FT_UINT16, BASE_DEC, NULL, 0,
19859       NULL, HFILL }},
19860
19861     /* Start: HT Control (+HTC) */
19862     {&hf_ieee80211_htc,
19863      {"HT Control (+HTC)", "wlan_mgt.htc",
19864       FT_UINT32, BASE_HEX, NULL, 0,
19865       "High Throughput Control (+HTC)", HFILL }},
19866
19867     {&hf_ieee80211_htc_lac,
19868      {"Link Adaptation Control (LAC)", "wlan_mgt.htc.lac",
19869       FT_UINT16, BASE_HEX, NULL, 0,
19870       "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
19871
19872     {&hf_ieee80211_htc_lac_reserved,
19873      {"Reserved", "wlan_mgt.htc.lac.reserved",
19874       FT_BOOLEAN, 16, NULL, 0x0001,
19875       "High Throughput Control Link Adaptation Control Reserved", HFILL }},
19876
19877     {&hf_ieee80211_htc_lac_trq,
19878      {"Training Request (TRQ)", "wlan_mgt.htc.lac.trq",
19879       FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002,
19880       "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
19881
19882     {&hf_ieee80211_htc_lac_mai_aseli,
19883      {"Antenna Selection Indication (ASELI)", "wlan_mgt.htc.lac.mai.aseli",
19884       FT_UINT16, BASE_HEX, NULL, 0x003C,
19885       "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
19886
19887     {&hf_ieee80211_htc_lac_mai_mrq,
19888      {"MCS Request (MRQ)", "wlan_mgt.htc.lac.mai.mrq",
19889       FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004,
19890       "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
19891
19892     {&hf_ieee80211_htc_lac_mai_msi,
19893      {"MCS Request Sequence Identifier (MSI)", "wlan_mgt.htc.lac.mai.msi",
19894       FT_UINT16, BASE_HEX, NULL, 0x0038,
19895       "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
19896
19897     {&hf_ieee80211_htc_lac_mai_reserved,
19898      {"Reserved", "wlan_mgt.htc.lac.mai.reserved",
19899       FT_UINT16, BASE_HEX, NULL, 0x0038,
19900       "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
19901
19902     {&hf_ieee80211_htc_lac_mfsi,
19903      {"MCS Feedback Sequence Identifier (MFSI)", "wlan_mgt.htc.lac.mfsi",
19904       FT_UINT16, BASE_DEC, NULL, 0x01C0,
19905       "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
19906
19907     {&hf_ieee80211_htc_lac_asel_command,
19908      {"Antenna Selection (ASEL) Command", "wlan_mgt.htc.lac.asel.command",
19909       FT_UINT16, BASE_HEX, VALS(ieee80211_htc_lac_asel_command_flags), 0x0E00,
19910       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
19911
19912     {&hf_ieee80211_htc_lac_asel_data,
19913      {"Antenna Selection (ASEL) Data", "wlan_mgt.htc.lac.asel.data",
19914       FT_UINT16, BASE_HEX, NULL, 0xF000,
19915       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
19916
19917     {&hf_ieee80211_htc_lac_mfb,
19918      {"MCS Feedback (MFB)", "wlan_mgt.htc.lac.mfb",
19919       FT_UINT16, BASE_HEX, NULL, 0xFE00,
19920       "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
19921
19922     {&hf_ieee80211_htc_cal_pos,
19923      {"Calibration Position", "wlan_mgt.htc.cal.pos",
19924       FT_UINT16, BASE_DEC, VALS(ieee80211_htc_cal_pos_flags), 0x0003,
19925       "High Throughput Control Calibration Position", HFILL }},
19926
19927     {&hf_ieee80211_htc_cal_seq,
19928      {"Calibration Sequence Identifier", "wlan_mgt.htc.cal.seq",
19929       FT_UINT16, BASE_DEC, NULL, 0x000C,
19930       "High Throughput Control Calibration Sequence Identifier", HFILL }},
19931
19932     {&hf_ieee80211_htc_reserved1,
19933      {"Reserved", "wlan_mgt.htc.reserved1",
19934       FT_UINT16, BASE_DEC, NULL, 0x0030,
19935       "High Throughput Control Reserved", HFILL }},
19936
19937     {&hf_ieee80211_htc_csi_steering,
19938      {"CSI/Steering", "wlan_mgt.htc.csi_steering",
19939       FT_UINT16, BASE_DEC, VALS(ieee80211_htc_csi_steering_flags), 0x00C0,
19940       "High Throughput Control CSI/Steering", HFILL }},
19941
19942     {&hf_ieee80211_htc_ndp_announcement,
19943      {"NDP Announcement", "wlan_mgt.htc.ndp_announcement",
19944       FT_BOOLEAN, 16, TFS(&ieee80211_htc_ndp_announcement_flag), 0x0100,
19945       "High Throughput Control NDP Announcement", HFILL }},
19946
19947     {&hf_ieee80211_htc_reserved2,
19948      {"Reserved", "wlan_mgt.htc.reserved2",
19949       FT_UINT16, BASE_HEX, NULL, 0x3E00,
19950       "High Throughput Control Reserved", HFILL }},
19951
19952     {&hf_ieee80211_htc_ac_constraint,
19953      {"AC Constraint", "wlan_mgt.htc.ac_constraint",
19954       FT_BOOLEAN, 16, NULL, 0x4000,
19955       "High Throughput Control AC Constraint", HFILL }},
19956
19957     {&hf_ieee80211_htc_rdg_more_ppdu,
19958      {"RDG/More PPDU", "wlan_mgt.htc.rdg_more_ppdu",
19959       FT_BOOLEAN, 16, NULL, 0x8000,
19960       "High Throughput Control RDG/More PPDU", HFILL }},
19961     /* End: HT Control (+HTC) */
19962
19963     /* MDIE */
19964     {&hf_ieee80211_tag_mobility_domain_mdid,
19965      {"Mobility Domain Identifier", "wlan_mgt.mobility_domain.mdid",
19966       FT_UINT16, BASE_HEX, NULL, 0,
19967       NULL, HFILL }},
19968
19969     {&hf_ieee80211_tag_mobility_domain_ft_capab,
19970      {"FT Capability and Policy", "wlan_mgt.mobility_domain.ft_capab",
19971       FT_UINT8, BASE_HEX, NULL, 0,
19972       NULL, HFILL }},
19973
19974     {&hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
19975      {"Fast BSS Transition over DS",
19976       "wlan_mgt.mobility_domain.ft_capab.ft_over_ds",
19977       FT_UINT8, BASE_HEX, NULL, 0x01,
19978       NULL, HFILL }},
19979
19980     {&hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
19981      {"Resource Request Protocol Capability",
19982       "wlan_mgt.mobility_domain.ft_capab.resource_req",
19983       FT_UINT8, BASE_HEX, NULL, 0x02,
19984       NULL, HFILL }},
19985
19986     /* FTIE */
19987     {&hf_ieee80211_tag_ft_mic_control,
19988      {"MIC Control", "wlan_mgt.ft.mic_control",
19989       FT_UINT16, BASE_HEX, NULL, 0,
19990       NULL, HFILL }},
19991
19992     {&hf_ieee80211_tag_ft_element_count,
19993      {"Element Count", "wlan_mgt.ft.element_count",
19994       FT_UINT16, BASE_DEC, NULL, 0xff00,
19995       NULL, HFILL }},
19996
19997     {&hf_ieee80211_tag_ft_mic,
19998      {"MIC", "wlan_mgt.ft.mic",
19999       FT_BYTES, BASE_NONE, NULL, 0,
20000       NULL, HFILL }},
20001
20002     {&hf_ieee80211_tag_ft_anonce,
20003      {"ANonce", "wlan_mgt.ft.anonce",
20004       FT_BYTES, BASE_NONE, NULL, 0,
20005       NULL, HFILL }},
20006
20007     {&hf_ieee80211_tag_ft_snonce,
20008      {"SNonce", "wlan_mgt.ft.snonce",
20009       FT_BYTES, BASE_NONE, NULL, 0,
20010       NULL, HFILL }},
20011
20012     {&hf_ieee80211_tag_ft_subelem_id,
20013      {"Subelement ID", "wlan_mgt.ft.subelem.id",
20014       FT_UINT8, BASE_DEC, VALS(ft_subelem_id_vals), 0,
20015       NULL, HFILL }},
20016
20017     {&hf_ieee80211_tag_ft_subelem_len,
20018      {"Length", "wlan_mgt.ft.subelem.len",
20019       FT_UINT8, BASE_DEC, NULL, 0,
20020       NULL, HFILL }},
20021
20022     {&hf_ieee80211_tag_ft_subelem_data,
20023      {"Data", "wlan_mgt.ft.subelem.data",
20024       FT_BYTES, BASE_NONE, NULL, 0,
20025       NULL, HFILL }},
20026
20027     {&hf_ieee80211_tag_ft_subelem_r1kh_id,
20028      {"PMK-R1 key holder identifier (R1KH-ID)", "wlan_mgt.ft.subelem.r1kh_id",
20029       FT_BYTES, BASE_NONE, NULL, 0,
20030       NULL, HFILL }},
20031
20032     {&hf_ieee80211_tag_ft_subelem_gtk_key_info,
20033      {"Key Info", "wlan_mgt.ft.subelem.gtk.key_info",
20034       FT_UINT16, BASE_HEX, NULL, 0,
20035       NULL, HFILL }},
20036
20037     {&hf_ieee80211_tag_ft_subelem_gtk_key_id,
20038      {"Key ID", "wlan_mgt.ft.subelem.gtk.key_id",
20039       FT_UINT16, BASE_DEC, NULL, 0x0003,
20040       NULL, HFILL }},
20041
20042     {&hf_ieee80211_tag_ft_subelem_gtk_key_length,
20043      {"Key Length", "wlan_mgt.ft.subelem.gtk.key_length",
20044       FT_UINT8, BASE_HEX, NULL, 0,
20045       NULL, HFILL }},
20046
20047     {&hf_ieee80211_tag_ft_subelem_gtk_rsc,
20048      {"RSC", "wlan_mgt.ft.subelem.gtk.rsc",
20049       FT_BYTES, BASE_NONE, NULL, 0,
20050       NULL, HFILL }},
20051
20052     {&hf_ieee80211_tag_ft_subelem_gtk_key,
20053      {"GTK", "wlan_mgt.ft.subelem.gtk.key",
20054       FT_BYTES, BASE_NONE, NULL, 0,
20055       NULL, HFILL }},
20056
20057     {&hf_ieee80211_tag_ft_subelem_r0kh_id,
20058      {"PMK-R0 key holder identifier (R0KH-ID)", "wlan_mgt.ft.subelem.r0kh_id",
20059       FT_STRING, BASE_NONE, NULL, 0,
20060       NULL, HFILL }},
20061
20062     {&hf_ieee80211_tag_ft_subelem_igtk_key_id,
20063      {"Key ID", "wlan_mgt.ft.subelem.igtk.key_id",
20064       FT_UINT16, BASE_DEC, NULL, 0,
20065       NULL, HFILL }},
20066
20067     {&hf_ieee80211_tag_ft_subelem_igtk_ipn,
20068      {"IPN", "wlan_mgt.ft.subelem.igtk.ipn",
20069       FT_BYTES, BASE_NONE, NULL, 0,
20070       NULL, HFILL }},
20071
20072     {&hf_ieee80211_tag_ft_subelem_igtk_key_length,
20073      {"Key Length", "wlan_mgt.ft.subelem.igtk.key_length",
20074       FT_UINT8, BASE_HEX, NULL, 0,
20075       NULL, HFILL }},
20076
20077     {&hf_ieee80211_tag_ft_subelem_igtk_key,
20078      {"Wrapped Key (IGTK)", "wlan_mgt.ft.subelem.igtk.key",
20079       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
20080
20081     /* RIC Data IE: 802.11-2012: 8.4.2.52 */
20082     {&hf_ieee80211_tag_ric_data_id,
20083      {"Resource Handshake Identifier", "wlan_mgt.ric_data.id",
20084       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20085
20086     {&hf_ieee80211_tag_ric_data_desc_cnt,
20087      {"Resource Descriptor Count", "wlan_mgt.ric_data.desc_cnt",
20088       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20089
20090     {&hf_ieee80211_tag_ric_data_status_code,
20091      {"Status Code", "wlan_mgt.ric_data.status_code",
20092       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
20093       "Status of requested Resource", HFILL }},
20094
20095     /* RIC Descriptor IE: 802.11-2012: 8.4.2.53 */
20096     {&hf_ieee80211_tag_ric_desc_rsrc_type,
20097      {"Resource Type", "wlan_mgt.ric_desc.rsrc_type",
20098       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20099
20100     {&hf_ieee80211_tag_ric_desc_var_params,
20101      {"Variable Params", "wlan_mgt.ric_desc.var_params",
20102       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
20103
20104     /* MMIE */
20105     {&hf_ieee80211_tag_mmie_keyid,
20106      {"KeyID", "wlan_mgt.mmie.keyid",
20107       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
20108
20109     {&hf_ieee80211_tag_mmie_ipn,
20110      {"IPN", "wlan_mgt.mmie.ipn",
20111       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
20112
20113     {&hf_ieee80211_tag_mmie_mic,
20114      {"MIC", "wlan_mgt.mmie.mic",
20115       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
20116
20117     /* WAPI Parameter Set*/
20118     {&hf_ieee80211_tag_wapi_param_set_version,
20119      {"Version", "wlan_mgt.wapi.version",
20120       FT_UINT16, BASE_DEC, NULL, 0,
20121       NULL, HFILL }},
20122
20123     {&hf_ieee80211_tag_wapi_param_set_akm_suite_count,
20124      {"AKM Suite Count", "wlan_mgt.wapi.akm_suite.count",
20125       FT_UINT16, BASE_DEC, NULL, 0,
20126       NULL, HFILL }},
20127
20128     {&hf_ieee80211_tag_wapi_param_set_akm_suite_oui,
20129      {"AKM Suite OUI", "wlan_mgt.wapi.akm_suite.oui",
20130       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
20131       NULL, HFILL }},
20132
20133     {&hf_ieee80211_tag_wapi_param_set_akm_suite_type,
20134      {"AKM Suite Type", "wlan_mgt.wapi.akm_suite.type",
20135       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_suite_type) , 0,
20136       NULL, HFILL }},
20137
20138     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
20139      {"Unicast Cipher Suite Count", "wlan_mgt.wapi.unicast_cipher.suite.count",
20140       FT_UINT16, BASE_DEC, NULL, 0,
20141       NULL, HFILL }},
20142
20143     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui,
20144      {"Unicast Cipher Suite OUI", "wlan_mgt.wapi.unicast_cipher.suite.oui",
20145       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
20146       NULL, HFILL }},
20147
20148     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type,
20149      {"Unicast Cipher Suite Type", "wlan_mgt.wapi.unicast_cipher.suite.type",
20150       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
20151       NULL, HFILL }},
20152
20153     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui,
20154      {"Multicast Cipher Suite OUI", "wlan_mgt.wapi.multicast_cipher.suite.oui",
20155       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
20156       NULL, HFILL }},
20157
20158     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type,
20159      {"Multicast Cipher Suite Type", "wlan_mgt.wapi.multicast_cipher.suite.type",
20160       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
20161       NULL, HFILL }},
20162
20163     {&hf_ieee80211_tag_wapi_param_set_capab,
20164      {"WAPI Capability Info", "wlan_mgt.wapi.capab",
20165       FT_UINT16, BASE_HEX, NULL, 0,
20166       NULL, HFILL }},
20167
20168     {&hf_ieee80211_tag_wapi_param_set_capab_preauth,
20169      {"Supports Preauthentication?", "wlan_mgt.wapi.capab.preauth",
20170       FT_BOOLEAN, 16 , NULL, 0x0001,
20171       NULL, HFILL }},
20172
20173     {&hf_ieee80211_tag_wapi_param_set_capab_rsvd,
20174      {"Reserved", "wlan_mgt.wapi.capab.rsvd",
20175       FT_UINT16, BASE_DEC , NULL, 0xFFFE,
20176       NULL, HFILL }},
20177
20178     {&hf_ieee80211_tag_wapi_param_set_bkid_count,
20179      {"No of BKID's", "wlan_mgt.wapi.bkid.count",
20180       FT_UINT16, BASE_DEC, NULL, 0,
20181       NULL, HFILL }},
20182
20183     {&hf_ieee80211_tag_wapi_param_set_bkid_list,
20184      {"BKID", "wlan_mgt.wapi.bkid",
20185       FT_BYTES, BASE_NONE, NULL, 0,
20186       NULL, HFILL }},
20187
20188     /* BSS Max Idle Period */
20189     {&hf_ieee80211_tag_bss_max_idle_period,
20190      {"BSS Max Idle Period (1000 TUs)", "wlan_mgt.bss_max_idle.period",
20191       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
20192     {&hf_ieee80211_tag_bss_max_idle_options_protected,
20193      {"BSS Max Idle Period Options: Protected Keep-Alive Required",
20194       "wlan_mgt.bss_max_idle.options.protected",
20195       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
20196
20197     /* TFS Request */
20198     {&hf_ieee80211_tag_tfs_request_id,
20199      {"TFS ID", "wlan_mgt.tfs_request.id",
20200       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20201     {&hf_ieee80211_tag_tfs_request_ac_delete_after_match,
20202      {"TFS Action Code - Delete after match",
20203       "wlan_mgt.tfs_request.action_code.delete_after_match",
20204       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
20205     {&hf_ieee80211_tag_tfs_request_ac_notify,
20206      {"TFS Action Code - Notify",
20207       "wlan_mgt.tfs_request.action_code.notify",
20208       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
20209     {&hf_ieee80211_tag_tfs_request_subelem_id,
20210      {"Subelement ID", "wlan_mgt.tfs_request.subelem.id",
20211       FT_UINT8, BASE_DEC, VALS(tfs_request_subelem_ids), 0,
20212       "TFS Request Subelement ID", HFILL }},
20213     {&hf_ieee80211_tag_tfs_request_subelem_len,
20214      {"Length", "wlan_mgt.tfs_request.subelem.len",
20215       FT_UINT8, BASE_DEC, NULL, 0,
20216       "TFS Request Subelement Length", HFILL }},
20217     {&hf_ieee80211_tag_tfs_request_subelem,
20218      {"Subelement Data", "wlan_mgt.tfs_request.subelem",
20219       FT_BYTES, BASE_NONE, NULL, 0,
20220       "TFS Request Subelement Data", HFILL }},
20221
20222     /* TFS Response */
20223     {&hf_ieee80211_tag_tfs_response_subelem_id,
20224      {"Subelement ID", "wlan_mgt.tfs_response.subelem.id",
20225       FT_UINT8, BASE_DEC, VALS(tfs_response_subelem_ids), 0,
20226       "TFS Response Subelement ID", HFILL }},
20227     {&hf_ieee80211_tag_tfs_response_subelem_len,
20228      {"Length", "wlan_mgt.tfs_response.subelem.len",
20229       FT_UINT8, BASE_DEC, NULL, 0,
20230       "TFS Response Subelement Length", HFILL }},
20231     {&hf_ieee80211_tag_tfs_response_subelem,
20232      {"Subelement Data", "wlan_mgt.tfs_response.subelem",
20233       FT_BYTES, BASE_NONE, NULL, 0,
20234       "TFS Response Subelement Data", HFILL }},
20235     {&hf_ieee80211_tag_tfs_response_status,
20236      {"TFS Response Status", "wlan_mgt.tfs_response.status",
20237       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20238     {&hf_ieee80211_tag_tfs_response_id,
20239      {"TFS ID", "wlan_mgt.tfs_response.tfs_id",
20240       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20241
20242     /* WNM-Sleep Mode */
20243     {&hf_ieee80211_tag_wnm_sleep_mode_action_type,
20244      {"Action Type", "wlan_mgt.wnm_sleep_mode.action_type",
20245       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_action_types), 0,
20246       "WNM-Sleep Mode Action Type", HFILL }},
20247     {&hf_ieee80211_tag_wnm_sleep_mode_response_status,
20248      {"WNM-Sleep Mode Response Status",
20249       "wlan_mgt.wnm_sleep_mode.response_status",
20250       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_response_status_vals), 0, NULL,
20251       HFILL }},
20252     {&hf_ieee80211_tag_wnm_sleep_mode_interval,
20253      {"WNM-Sleep Interval", "wlan_mgt.wnm_sleep_mode.interval",
20254       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
20255
20256     /* Time Advertisement */
20257     {&hf_ieee80211_tag_time_adv_timing_capab,
20258      {"Timing capabilities", "wlan_mgt.time_adv.timing_capab",
20259       FT_UINT8, BASE_DEC, VALS(time_adv_timing_capab_vals), 0,
20260       NULL, HFILL }},
20261
20262     {&hf_ieee80211_tag_time_adv_time_value,
20263      {"Time Value", "wlan_mgt.time_adv.time_value",
20264       FT_BYTES, BASE_NONE, NULL, 0,
20265       NULL, HFILL }},
20266
20267     {&hf_ieee80211_tag_time_adv_time_value_year,
20268      {"Time Value: Year", "wlan_mgt.time_adv.time_value.year",
20269       FT_UINT16, BASE_DEC, NULL, 0,
20270       NULL, HFILL }},
20271
20272     {&hf_ieee80211_tag_time_adv_time_value_month,
20273      {"Time Value: Month", "wlan_mgt.time_adv.time_value.month",
20274       FT_UINT8, BASE_DEC, NULL, 0,
20275       NULL, HFILL }},
20276
20277     {&hf_ieee80211_tag_time_adv_time_value_day,
20278      {"Time Value: Day", "wlan_mgt.time_adv.time_value.month",
20279       FT_UINT8, BASE_DEC, NULL, 0,
20280       NULL, HFILL }},
20281
20282     {&hf_ieee80211_tag_time_adv_time_value_hours,
20283      {"Time Value: Hours", "wlan_mgt.time_adv.time_value.hours",
20284       FT_UINT8, BASE_DEC, NULL, 0,
20285       NULL, HFILL }},
20286
20287     {&hf_ieee80211_tag_time_adv_time_value_minutes,
20288      {"Time Value: Minutes", "wlan_mgt.time_adv.time_value.minutes",
20289       FT_UINT8, BASE_DEC, NULL, 0,
20290       NULL, HFILL }},
20291
20292     {&hf_ieee80211_tag_time_adv_time_value_seconds,
20293      {"Time Value: Seconds", "wlan_mgt.time_adv.time_value.seconds",
20294       FT_UINT8, BASE_DEC, NULL, 0,
20295       NULL, HFILL }},
20296
20297     {&hf_ieee80211_tag_time_adv_time_value_milliseconds,
20298      {"Time Value: Milliseconds", "wlan_mgt.time_adv.time_value.milliseconds",
20299       FT_UINT16, BASE_DEC, NULL, 0,
20300       NULL, HFILL }},
20301
20302     {&hf_ieee80211_tag_time_adv_time_value_reserved,
20303      {"Time Value: Reserved", "wlan_mgt.time_adv.time_value.reserved",
20304       FT_UINT8, BASE_DEC, NULL, 0,
20305       NULL, HFILL }},
20306
20307     {&hf_ieee80211_tag_time_adv_time_error,
20308      {"Time Error", "wlan_mgt.time_adv.time_error",
20309       FT_BYTES, BASE_NONE, NULL, 0,
20310       NULL, HFILL }},
20311
20312     {&hf_ieee80211_tag_time_adv_time_update_counter,
20313      {"Time Update Counter", "wlan_mgt.time_adv.time_update_counter",
20314       FT_UINT8, BASE_DEC, NULL, 0,
20315       NULL, HFILL }},
20316
20317     /* Time Zone */
20318     {&hf_ieee80211_tag_time_zone,
20319      {"Time Zone", "wlan_mgt.time_zone",
20320       FT_STRING, BASE_NONE, NULL, 0,
20321       NULL, HFILL }},
20322
20323     /* Interworking */
20324     {&hf_ieee80211_tag_interworking_access_network_type,
20325      {"Access Network Type", "wlan_mgt.interworking.access_network_type",
20326       FT_UINT8, BASE_DEC, VALS(access_network_type_vals), 0x0f,
20327       NULL, HFILL }},
20328
20329     {&hf_ieee80211_tag_interworking_internet,
20330      {"Internet", "wlan_mgt.interworking.internet",
20331       FT_UINT8, BASE_DEC, NULL, 0x10,
20332       NULL, HFILL }},
20333
20334     {&hf_ieee80211_tag_interworking_asra,
20335      {"ASRA", "wlan_mgt.interworking.asra",
20336       FT_UINT8, BASE_DEC, NULL, 0x20,
20337       "Additional Step Required for Access", HFILL }},
20338
20339     {&hf_ieee80211_tag_interworking_esr,
20340      {"ESR", "wlan_mgt.interworking.esr",
20341       FT_UINT8, BASE_DEC, NULL, 0x40,
20342       "Emergency services reachable", HFILL }},
20343
20344     {&hf_ieee80211_tag_interworking_uesa,
20345      {"UESA", "wlan_mgt.interworking.uesa",
20346       FT_UINT8, BASE_DEC, NULL, 0x80,
20347       "Unauthenticated emergency service accessible", HFILL }},
20348
20349     {&hf_ieee80211_tag_interworking_hessid,
20350      {"HESSID", "wlan_mgt.interworking.hessid",
20351       FT_ETHER, BASE_NONE, NULL, 0,
20352       "Homogeneous ESS identifier", HFILL }},
20353
20354     /* Advertisement Protocol */
20355     {&hf_ieee80211_tag_adv_proto_resp_len_limit,
20356      {"Query Response Length Limit", "wlan_mgt.adv_proto.resp_len_limit",
20357       FT_UINT8, BASE_DEC, NULL, 0x7f,
20358       NULL, HFILL }},
20359
20360     {&hf_ieee80211_tag_adv_proto_pame_bi,
20361      {"PAME-BI", "wlan_mgt.adv_proto.pame_bi",
20362       FT_UINT8, BASE_DEC, NULL, 0x80,
20363       "Pre-Association Message Xchange BSSID Independent (PAME-BI)", HFILL }},
20364
20365     {&hf_ieee80211_tag_adv_proto_id,
20366      {"Advertisement Protocol ID", "wlan_mgt.adv_proto.id",
20367       FT_UINT8, BASE_DEC, VALS(adv_proto_id_vals), 0,
20368       NULL, HFILL }},
20369
20370     /* Roaming Consortium */
20371     {&hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
20372      {"Number of ANQP OIs", "wlan_mgt.roaming_consortium.num_anqp_oi",
20373       FT_UINT8, BASE_DEC, NULL, 0,
20374       NULL, HFILL }},
20375
20376     {&hf_ieee80211_tag_roaming_consortium_oi1_len,
20377      {"OI #1 Length", "wlan_mgt.roaming_consortium.oi1_len",
20378       FT_UINT8, BASE_DEC, NULL, 0x0f,
20379       NULL, HFILL }},
20380
20381     {&hf_ieee80211_tag_roaming_consortium_oi2_len,
20382      {"OI #2 Length", "wlan_mgt.roaming_consortium.oi2_len",
20383       FT_UINT8, BASE_DEC, NULL, 0xf0,
20384       NULL, HFILL }},
20385
20386     {&hf_ieee80211_tag_roaming_consortium_oi1,
20387      {"OI #1", "wlan_mgt.roaming_consortium.oi1",
20388       FT_BYTES, BASE_NONE, NULL, 0,
20389       NULL, HFILL }},
20390
20391     {&hf_ieee80211_tag_roaming_consortium_oi2,
20392      {"OI #2", "wlan_mgt.roaming_consortium.oi2",
20393       FT_BYTES, BASE_NONE, NULL, 0,
20394       NULL, HFILL }},
20395
20396     {&hf_ieee80211_tag_roaming_consortium_oi3,
20397      {"OI #3", "wlan_mgt.roaming_consortium.oi3",
20398       FT_BYTES, BASE_NONE, NULL, 0,
20399       NULL, HFILL }},
20400
20401     /* Timeout Interval */
20402     {&hf_ieee80211_tag_timeout_int_type,
20403      {"Timeout Interval Type", "wlan_mgt.timeout_int.type",
20404       FT_UINT8, BASE_DEC, VALS(timeout_int_types), 0,
20405       NULL, HFILL }},
20406
20407     {&hf_ieee80211_tag_timeout_int_value,
20408      {"Timeout Interval Value", "wlan_mgt.timeout_int.value",
20409       FT_UINT32, BASE_DEC, NULL, 0,
20410       NULL, HFILL }},
20411
20412     /* Link Identifier */
20413     {&hf_ieee80211_tag_link_id_bssid,
20414      {"BSSID", "wlan_mgt.link_id.bssid",
20415       FT_ETHER, BASE_NONE, NULL, 0,
20416       NULL, HFILL }},
20417
20418     {&hf_ieee80211_tag_link_id_init_sta,
20419      {"TDLS initiator STA Address", "wlan_mgt.link_id.init_sta",
20420       FT_ETHER, BASE_NONE, NULL, 0,
20421       NULL, HFILL }},
20422
20423     {&hf_ieee80211_tag_link_id_resp_sta,
20424      {"TDLS responder STA Address", "wlan_mgt.link_id.resp_sta",
20425       FT_ETHER, BASE_NONE, NULL, 0,
20426       NULL, HFILL }},
20427
20428     /* Wakeup Schedule */
20429     {&hf_ieee80211_tag_wakeup_schedule_offset,
20430      {"Offset", "wlan_mgt.wakeup_schedule.offset",
20431       FT_UINT32, BASE_DEC, NULL, 0,
20432       NULL, HFILL }},
20433
20434     {&hf_ieee80211_tag_wakeup_schedule_interval,
20435      {"Interval", "wlan_mgt.wakeup_schedule.interval",
20436       FT_UINT32, BASE_DEC, NULL, 0,
20437       NULL, HFILL }},
20438
20439     {&hf_ieee80211_tag_wakeup_schedule_awake_window_slots,
20440      {"Awake Window Slots", "wlan_mgt.wakeup_schedule.awake_window_slots",
20441       FT_UINT32, BASE_DEC, NULL, 0,
20442       NULL, HFILL }},
20443
20444     {&hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
20445      {"Maximum Awake Window Duration", "wlan_mgt.wakeup_schedule.max_awake_dur",
20446       FT_UINT32, BASE_DEC, NULL, 0,
20447       NULL, HFILL }},
20448
20449     {&hf_ieee80211_tag_wakeup_schedule_idle_count,
20450      {"Idle Count", "wlan_mgt.wakeup_schedule.idle_count",
20451       FT_UINT16, BASE_DEC, NULL, 0,
20452       NULL, HFILL }},
20453
20454     /* Channel Switch Timing */
20455     {&hf_ieee80211_tag_channel_switch_timing_switch_time,
20456      {"Switch Time", "wlan_mgt.channel_switch_timing.switch_time",
20457       FT_UINT16, BASE_DEC, NULL, 0,
20458       NULL, HFILL }},
20459
20460     {&hf_ieee80211_tag_channel_switch_timing_switch_timeout,
20461      {"Switch Timeout", "wlan_mgt.channel_switch_timing.switch_timeout",
20462       FT_UINT16, BASE_DEC, NULL, 0,
20463       NULL, HFILL }},
20464
20465     /* PTI Control */
20466     {&hf_ieee80211_tag_pti_control_tid,
20467      {"TID", "wlan_mgt.pti_control.tid",
20468       FT_UINT8, BASE_DEC, NULL, 0,
20469       NULL, HFILL }},
20470
20471     {&hf_ieee80211_tag_pti_control_sequence_control,
20472      {"Sequence Control", "wlan_mgt.pti_control.sequence_control",
20473       FT_UINT16, BASE_HEX, NULL, 0,
20474       NULL, HFILL }},
20475
20476     /* PU Buffer Status */
20477     {&hf_ieee80211_tag_pu_buffer_status_ac_bk,
20478      {"AC_BK traffic available", "wlan_mgt.pu_buffer_status.ac_bk",
20479       FT_UINT8, BASE_DEC, NULL, 0x01,
20480       NULL, HFILL }},
20481
20482     {&hf_ieee80211_tag_pu_buffer_status_ac_be,
20483      {"AC_BE traffic available", "wlan_mgt.pu_buffer_status.ac_be",
20484       FT_UINT8, BASE_DEC, NULL, 0x02,
20485       NULL, HFILL }},
20486
20487     {&hf_ieee80211_tag_pu_buffer_status_ac_vi,
20488      {"AC_VI traffic available", "wlan_mgt.pu_buffer_status.ac_vi",
20489       FT_UINT8, BASE_DEC, NULL, 0x04,
20490       NULL, HFILL }},
20491
20492     {&hf_ieee80211_tag_pu_buffer_status_ac_vo,
20493      {"AC_VO traffic available", "wlan_mgt.pu_buffer_status.ac_vo",
20494       FT_UINT8, BASE_DEC, NULL, 0x08,
20495       NULL, HFILL }}
20496   };
20497
20498   static hf_register_info aggregate_fields[] = {
20499     {&hf_ieee80211_amsdu_subframe,
20500      {"A-MSDU Subframe", "wlan_aggregate.a_mdsu.subframe",
20501       FT_NONE, BASE_NONE, NULL, 0x0,
20502       "Aggregate MAC Service Data Unit (MSDU) Subframe", HFILL }},
20503
20504     {&hf_ieee80211_amsdu_length,
20505      {"A-MSDU Length", "wlan_aggregate.a_mdsu.length",
20506       FT_UINT16, BASE_DEC, NULL, 0x0,
20507       NULL, HFILL }}
20508   };
20509
20510   static uat_field_t wep_uat_flds[] = {
20511
20512       UAT_FLD_VS(uat_wep_key_records, key, "Key type", wep_type_vals,
20513                         "Decryption key type used"),
20514       UAT_FLD_CSTRING(uat_wep_key_records, string, "Key",
20515                         "wep:<wep hexadecimal key>\n"
20516                         "wpa-pwd:<passphrase>[:<ssid>]\n"
20517                         "wpa-psk:<wpa hexadecimal key>"),
20518       UAT_END_FIELDS
20519     };
20520
20521   static gint *tree_array[] = {
20522     &ett_80211,
20523     &ett_fc_tree,
20524     &ett_proto_flags,
20525     &ett_fragments,
20526     &ett_fragment,
20527     &ett_block_ack,
20528     &ett_block_ack_bitmap,
20529     &ett_80211_mgt,
20530     &ett_fixed_parameters,
20531     &ett_tagged_parameters,
20532     &ett_tag_bmapctl_tree,
20533     &ett_tag_country_fnm_tree,
20534     &ett_tag_country_rcc_tree,
20535     &ett_qos_parameters,
20536     &ett_qos_ps_buf_state,
20537     &ett_qos_info_field_tree,
20538     &ett_wep_parameters,
20539     &ett_msh_control,
20540     &ett_hwmp_targ_flags_tree,
20541     &ett_cap_tree,
20542     &ett_rsn_gcs_tree,
20543     &ett_rsn_pcs_tree,
20544     &ett_rsn_sub_pcs_tree,
20545     &ett_rsn_akms_tree,
20546     &ett_rsn_sub_akms_tree,
20547     &ett_rsn_cap_tree,
20548     &ett_rsn_pmkid_tree,
20549     &ett_rsn_gmcs_tree,
20550     &ett_wpa_mcs_tree,
20551     &ett_wpa_ucs_tree,
20552     &ett_wpa_sub_ucs_tree,
20553     &ett_wpa_akms_tree,
20554     &ett_wpa_sub_akms_tree,
20555     &ett_wme_ac,
20556     &ett_wme_aci_aifsn,
20557     &ett_wme_ecw,
20558     &ett_wme_qos_info,
20559     &ett_ht_cap_tree,
20560     &ett_ath_cap_tree,
20561     &ett_ff_ba_param_tree,
20562     &ett_ff_qos_info,
20563     &ett_ff_sm_pwr_save,
20564     &ett_ff_psmp_param_set,
20565     &ett_ff_mimo_cntrl,
20566     &ett_ff_ant_sel,
20567     &ett_ff_chan_switch_announce,
20568     &ett_ff_ht_info,
20569     &ett_ff_psmp_sta_info,
20570     &ett_ff_delba_param_tree,
20571     &ett_ff_ba_ssc_tree,
20572     &ett_mimo_report,
20573     &ett_cntrl_wrapper_fc,
20574     &ett_cntrl_wrapper_payload,
20575     &ett_vht_cap_tree,
20576     &ett_vht_mcsset_tree,
20577     &ett_vht_rx_mcsbit_tree,
20578     &ett_vht_tx_mcsbit_tree,
20579     &ett_vht_basic_mcsbit_tree,
20580     &ett_vht_op_tree,
20581     &ett_ht_info_delimiter1_tree,
20582     &ett_ht_info_delimiter2_tree,
20583     &ett_ht_info_delimiter3_tree,
20584     &ett_msdu_aggregation_parent_tree,
20585     &ett_msdu_aggregation_subframe_tree,
20586     &ett_tag_measure_request_mode_tree,
20587     &ett_tag_measure_request_type_tree,
20588     &ett_tag_measure_report_mode_tree,
20589     &ett_tag_measure_report_type_tree,
20590     &ett_tag_measure_report_basic_map_tree,
20591     &ett_tag_measure_report_rpi_tree,
20592     &ett_tag_measure_report_frame_tree,
20593     &ett_tag_dfs_map_tree,
20594     &ett_tag_erp_info_tree,
20595     &ett_tag_ex_cap1,
20596     &ett_tag_ex_cap2,
20597     &ett_tag_ex_cap3,
20598     &ett_tag_ex_cap4,
20599     &ett_tag_ex_cap5,
20600     &ett_tag_ex_cap6,
20601     &ett_tag_ex_cap7,
20602     &ett_tag_ex_cap8,
20603     &ett_tag_rm_cap1,
20604     &ett_tag_rm_cap2,
20605     &ett_tag_rm_cap3,
20606     &ett_tag_rm_cap4,
20607     &ett_tag_rm_cap5,
20608     &ett_tag_tclas_mask_tree,
20609     &ett_tag_supported_channels,
20610     &ett_tag_neighbor_report_bssid_info_tree,
20611     &ett_tag_neighbor_report_bssid_info_capability_tree,
20612     &ett_tag_neighbor_report_sub_tag_tree,
20613     &ett_tag_bss_bitmask_tree,
20614     &ett_ampduparam_tree,
20615     &ett_mcsset_tree,
20616     &ett_mcsbit_tree,
20617     &ett_htex_cap_tree,
20618     &ett_txbf_tree,
20619     &ett_hta_cap_tree,
20620     &ett_hta_cap1_tree,
20621     &ett_hta_cap2_tree,
20622     &ett_htc_tree,
20623     &ett_antsel_tree,
20624     &ett_80211_mgt_ie,
20625     &ett_tsinfo_tree,
20626     &ett_sched_tree,
20627     &ett_fcs,
20628     &ett_tag_wapi_param_set_akm_tree,
20629     &ett_tag_wapi_param_set_ucast_tree,
20630     &ett_tag_wapi_param_set_mcast_tree,
20631     &ett_tag_wapi_param_set_preauth_tree,
20632     &ett_tag_time_adv_tree,
20633     &ett_adv_proto,
20634     &ett_adv_proto_tuple,
20635     &ett_gas_query,
20636     &ett_gas_resp_fragment,
20637     &ett_gas_resp_fragments,
20638     &ett_gas_anqp,
20639     &ett_nai_realm,
20640     &ett_nai_realm_eap,
20641     &ett_tag_ric_data_desc_ie,
20642     &ett_anqp_vendor_capab,
20643     &ett_hs20_cc_proto_port_tuple,
20644     &ett_ssid_list
20645   };
20646   module_t *wlan_module;
20647
20648   memset (&wlan_stats, 0, sizeof wlan_stats);
20649
20650   proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
20651       "IEEE 802.11 Aggregate Data", "wlan_aggregate");
20652   proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
20653
20654   proto_wlan = proto_register_protocol ("IEEE 802.11 wireless LAN",
20655       "IEEE 802.11", "wlan");
20656   proto_register_field_array (proto_wlan, hf, array_length (hf));
20657
20658   proto_wlan_mgt = proto_register_protocol ("IEEE 802.11 wireless LAN management frame",
20659       "802.11 MGT", "wlan_mgt");
20660   proto_register_field_array (proto_wlan_mgt, ff, array_length (ff));
20661
20662   proto_register_subtree_array (tree_array, array_length (tree_array));
20663
20664   register_dissector("wlan",         dissect_ieee80211,         proto_wlan);
20665   register_dissector("wlan_fixed",   dissect_ieee80211_fixed,   proto_wlan);
20666   register_dissector("wlan_bsfc",    dissect_ieee80211_bsfc,    proto_wlan);
20667   register_dissector("wlan_datapad", dissect_ieee80211_datapad, proto_wlan);
20668   register_dissector("wlan_ht",      dissect_ieee80211_ht,      proto_wlan);
20669
20670   register_init_routine(wlan_defragment_init);
20671   register_init_routine(wlan_retransmit_init);
20672   register_init_routine(ieee80211_gas_reassembly_init);
20673
20674   wlan_tap = register_tap("wlan");
20675
20676   /* Register configuration options */
20677   wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
20678   prefs_register_bool_preference(wlan_module, "defragment",
20679     "Reassemble fragmented 802.11 datagrams",
20680     "Whether fragmented 802.11 datagrams should be reassembled",
20681      &wlan_defragment);
20682
20683   prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
20684     "Ignore vendor-specific HT elements",
20685     "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
20686     &wlan_ignore_draft_ht);
20687
20688   prefs_register_bool_preference(wlan_module, "retransmitted",
20689     "Call subdissector for retransmitted 802.11 frames",
20690     "Whether retransmitted 802.11 frames should be subdissected",
20691     &wlan_subdissector);
20692
20693   prefs_register_bool_preference(wlan_module, "check_fcs",
20694     "Assume packets have FCS",
20695     "Some 802.11 cards include the FCS at the end of a packet, others do not.",
20696     &wlan_check_fcs);
20697
20698   /* Davide Schiera (2006-11-26): changed "WEP bit" in "Protection bit"    */
20699   /*    (according to the document IEEE Std 802.11i-2004)              */
20700   prefs_register_enum_preference(wlan_module, "ignore_wep",
20701     "Ignore the Protection bit",
20702     "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
20703     "and some also leave the IV (initialization vector).",
20704     &wlan_ignore_wep, wlan_ignore_wep_options, TRUE);
20705
20706   prefs_register_obsolete_preference(wlan_module, "wep_keys");
20707
20708   /* Davide Schiera (2006-11-26): added reference to WPA/WPA2 decryption    */
20709   prefs_register_bool_preference(wlan_module, "enable_decryption",
20710     "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
20711     &enable_decryption);
20712
20713   prefs_register_static_text_preference(wlan_module, "info_decryption_key",
20714     "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
20715     "010203040506070809101111213 (104/128-bit WEP),\n"
20716     "MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
20717     "0102030405...6061626364 (WPA + 256-bit key).  "
20718     "Invalid keys will be ignored.",
20719     "Valid key formats");
20720
20721   wep_uat = uat_new("WEP and WPA Decryption Keys",
20722             sizeof(uat_wep_key_record_t), /* record size */
20723             "80211_keys",                 /* filename */
20724             TRUE,                         /* from_profile */
20725             (void**) &uat_wep_key_records,/* data_ptr */
20726             &num_wepkeys_uat,             /* numitems_ptr */
20727             UAT_AFFECTS_DISSECTION,       /* affects dissection of packets, but not set of named fields */
20728             NULL,                         /* help */
20729             uat_wep_key_record_copy_cb,   /* copy callback */
20730             uat_wep_key_record_update_cb, /* update callback */
20731             uat_wep_key_record_free_cb,   /* free callback */
20732             init_wepkeys,                 /* post update callback - update the WEP/WPA keys */
20733             wep_uat_flds);                /* UAT field definitions */
20734
20735   prefs_register_uat_preference(wlan_module,
20736                                 "wep_key_table",
20737                                 "Decryption Keys",
20738                                 "WEP and pre-shared WPA keys",
20739                                 wep_uat);
20740 }
20741
20742 void
20743 proto_reg_handoff_ieee80211(void)
20744 {
20745   dissector_handle_t data_encap_handle;
20746
20747   /*
20748    * Get handles for the LLC, IPX and Ethernet  dissectors.
20749    */
20750   llc_handle            = find_dissector("llc");
20751   ipx_handle            = find_dissector("ipx");
20752   eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
20753   data_handle           = find_dissector("data");
20754
20755   ieee80211_handle = find_dissector("wlan");
20756   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
20757   dissector_add_uint("ethertype", ETHERTYPE_CENTRINO_PROMISC, ieee80211_handle);
20758
20759   /* Register handoff to Aruba GRE */
20760   dissector_add_uint("gre.proto", GRE_ARUBA_8200, ieee80211_handle);
20761   dissector_add_uint("gre.proto", GRE_ARUBA_8210, ieee80211_handle);
20762   dissector_add_uint("gre.proto", GRE_ARUBA_8220, ieee80211_handle);
20763   dissector_add_uint("gre.proto", GRE_ARUBA_8230, ieee80211_handle);
20764   dissector_add_uint("gre.proto", GRE_ARUBA_8240, ieee80211_handle);
20765   dissector_add_uint("gre.proto", GRE_ARUBA_8250, ieee80211_handle);
20766   dissector_add_uint("gre.proto", GRE_ARUBA_8260, ieee80211_handle);
20767   dissector_add_uint("gre.proto", GRE_ARUBA_8270, ieee80211_handle);
20768   dissector_add_uint("gre.proto", GRE_ARUBA_8280, ieee80211_handle);
20769   dissector_add_uint("gre.proto", GRE_ARUBA_8290, ieee80211_handle);
20770   dissector_add_uint("gre.proto", GRE_ARUBA_82A0, ieee80211_handle);
20771   dissector_add_uint("gre.proto", GRE_ARUBA_82B0, ieee80211_handle);
20772   dissector_add_uint("gre.proto", GRE_ARUBA_82C0, ieee80211_handle);
20773   dissector_add_uint("gre.proto", GRE_ARUBA_82D0, ieee80211_handle);
20774   dissector_add_uint("gre.proto", GRE_ARUBA_82E0, ieee80211_handle);
20775   dissector_add_uint("gre.proto", GRE_ARUBA_82F0, ieee80211_handle);
20776   dissector_add_uint("gre.proto", GRE_ARUBA_8300, ieee80211_handle);
20777   dissector_add_uint("gre.proto", GRE_ARUBA_8310, ieee80211_handle);
20778   dissector_add_uint("gre.proto", GRE_ARUBA_8320, ieee80211_handle);
20779   dissector_add_uint("gre.proto", GRE_ARUBA_8330, ieee80211_handle);
20780   dissector_add_uint("gre.proto", GRE_ARUBA_8340, ieee80211_handle);
20781   dissector_add_uint("gre.proto", GRE_ARUBA_8350, ieee80211_handle);
20782   dissector_add_uint("gre.proto", GRE_ARUBA_8360, ieee80211_handle);
20783   dissector_add_uint("gre.proto", GRE_ARUBA_8370, ieee80211_handle);
20784
20785   data_encap_handle = create_dissector_handle(dissect_data_encap, proto_wlan);
20786   dissector_add_uint("ethertype", ETHERTYPE_IEEE80211_DATA_ENCAP,
20787                 data_encap_handle);
20788 }
20789
20790 /*
20791  * Editor modelines
20792  *
20793  * Local Variables:
20794  * c-basic-offset: 2
20795  * tab-width: 8
20796  * indent-tabs-mode: nil
20797  * End:
20798  *
20799  * ex: set shiftwidth=2 tabstop=8 expandtab:
20800  * :indentSize=2:tabSize=8:noTabs=true:
20801  */