From Jouni Malinen via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8711 Wi...
[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
106 /*     Davide Schiera (2006-11-22): including AirPDcap project                */
107 #include <epan/crypt/airpdcap_ws.h>
108 /* Davide Schiera (2006-11-22) ---------------------------------------------- */
109
110 extern value_string_ext eap_type_vals_ext; /* from packet-eap.c */
111
112 /* To Avoid Compilation warnings/errors because
113  * dissectors such as RIC will use this function recursively
114  */
115 static int add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype);
116
117 #ifndef roundup2
118 #define roundup2(x, y)  (((x)+((y)-1))&(~((y)-1)))  /* if y is powers of two */
119 #endif
120
121 /* Defragment fragmented 802.11 datagrams */
122 static gboolean wlan_defragment = TRUE;
123
124 /* call subdissector for retransmitted frames */
125 static gboolean wlan_subdissector = TRUE;
126
127 /* Check for the presence of the 802.11 FCS */
128 static gboolean wlan_check_fcs = FALSE;
129
130 /* Ignore vendor-specific HT elements */
131 static gboolean wlan_ignore_draft_ht = FALSE;
132
133 /* Ignore the WEP bit; assume packet is decrypted */
134 #define WLAN_IGNORE_WEP_NO     0
135 #define WLAN_IGNORE_WEP_WO_IV  1
136 #define WLAN_IGNORE_WEP_W_IV   2
137 static gint wlan_ignore_wep = WLAN_IGNORE_WEP_NO;
138
139 /* Table for reassembly of fragments. */
140 static reassembly_table wlan_reassembly_table;
141
142 /* Statistical data */
143 static struct _wlan_stats wlan_stats;
144
145 /*-------------------------------------
146  * UAT for WEP decoder
147  *-------------------------------------
148  */
149 static uat_wep_key_record_t *uat_wep_key_records = NULL;
150 static uat_t                *wep_uat             = NULL;
151 static guint                 num_wepkeys_uat     = 0;
152
153 static void *
154 uat_wep_key_record_copy_cb(void* n, const void* o, size_t siz _U_)
155 {
156     uat_wep_key_record_t* new_key = (uat_wep_key_record_t *)n;
157     const uat_wep_key_record_t* old_key = (const uat_wep_key_record_t *)o;
158
159     if (old_key->string) {
160         new_key->string = g_strdup(old_key->string);
161     } else {
162         new_key->string = NULL;
163     }
164
165     return new_key;
166 }
167
168 static void
169 uat_wep_key_record_update_cb(void* r, const char** err)
170 {
171     uat_wep_key_record_t* rec = (uat_wep_key_record_t *)r;
172     decryption_key_t* dk;
173
174     if (rec->string == NULL) {
175          *err = ep_strdup_printf("Key can't be blank");
176     } else {
177         g_strstrip(rec->string);
178         dk = parse_key_string(rec->string, rec->key);
179
180         if (dk != NULL) {
181            switch (dk->type) {
182               case AIRPDCAP_KEY_TYPE_WEP:
183               case AIRPDCAP_KEY_TYPE_WEP_40:
184               case AIRPDCAP_KEY_TYPE_WEP_104:
185                  if (rec->key != AIRPDCAP_KEY_TYPE_WEP) {
186                     *err = ep_strdup_printf("Invalid key format");
187                  }
188                  break;
189               case AIRPDCAP_KEY_TYPE_WPA_PWD:
190                  if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PWD) {
191                     *err = ep_strdup_printf("Invalid key format");
192                  }
193                  break;
194               case AIRPDCAP_KEY_TYPE_WPA_PSK:
195                  if (rec->key != AIRPDCAP_KEY_TYPE_WPA_PSK) {
196                     *err = ep_strdup_printf("Invalid key format");
197                  }
198                  break;
199               default:
200                  *err = ep_strdup_printf("Invalid key format");
201                  break;
202            }
203         } else {
204            *err = ep_strdup_printf("Invalid key format");
205         }
206     }
207 }
208
209 static void
210 uat_wep_key_record_free_cb(void*r)
211 {
212     uat_wep_key_record_t* key = (uat_wep_key_record_t *)r;
213
214     if (key->string) g_free(key->string);
215 }
216
217 UAT_VS_DEF(uat_wep_key_records, key, uat_wep_key_record_t, guint8, 0, STRING_KEY_TYPE_WEP)
218 UAT_CSTRING_CB_DEF(uat_wep_key_records, string, uat_wep_key_record_t)
219
220 /* Stuff for the WEP decoder */
221 static gboolean enable_decryption = FALSE;
222
223 /* Davide Schiera (2006-11-26): created function to decrypt WEP and WPA/WPA2  */
224 static tvbuff_t *try_decrypt(tvbuff_t *tvb, guint32 offset, guint32 len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer);
225
226 static int weak_iv(guchar *iv);
227
228 typedef struct mimo_control
229 {
230   guint8 nc;
231   guint8 nr;
232   gboolean chan_width;
233   guint8 grouping;
234   guint8 coefficient_size;
235   guint8 codebook_info;
236   guint8 remaining_matrix_segment;
237 } mimo_control_t;
238
239 /* ************************************************************************* */
240 /*                          Miscellaneous Constants                          */
241 /* ************************************************************************* */
242 #define SHORT_STR 256
243
244 /* ************************************************************************* */
245 /*  Define some very useful macros that are used to analyze frame types etc. */
246 /* ************************************************************************* */
247
248 /*
249  * Fetch the frame control field and swap it if needed.  "fcf" and "tvb"
250  * must be valid variables.
251  */
252 #define FETCH_FCF(off) (wlan_broken_fc ? \
253   BSWAP16(tvb_get_letohs(tvb, off)) : \
254   tvb_get_letohs(tvb, off))
255
256 /*
257  * Extract the protocol version from the frame control field
258  */
259 #define FCF_PROT_VERSION(x)  ((x) & 0x3)
260
261 /*
262  * Extract the frame type from the frame control field.
263  */
264 #define FCF_FRAME_TYPE(x)    (((x) & 0xC) >> 2)
265
266 /*
267  * Extract the frame subtype from the frame control field.
268  */
269 #define FCF_FRAME_SUBTYPE(x) (((x) & 0xF0) >> 4)
270
271 /*
272  * Convert the frame type and subtype from the frame control field into
273  * one of the MGT_, CTRL_, or DATA_ values.
274  */
275 #define COMPOSE_FRAME_TYPE(x) (((x & 0x0C)<< 2)+FCF_FRAME_SUBTYPE(x))  /* Create key to (sub)type */
276
277 /*
278  * The subtype field of a data frame is, in effect, composed of 4 flag
279  * bits - CF-Ack, CF-Poll, Null (means the frame doesn't actually have
280  * any data), and QoS.
281  */
282 #define DATA_FRAME_IS_CF_ACK(x)  ((x) & 0x01)
283 #define DATA_FRAME_IS_CF_POLL(x) ((x) & 0x02)
284 #define DATA_FRAME_IS_NULL(x)    ((x) & 0x04)
285 #define DATA_FRAME_IS_QOS(x)     ((x) & 0x08)
286
287 /*
288  * Extract the flags from the frame control field.
289  */
290 #define FCF_FLAGS(x)           (((x) & 0xFF00) >> 8)
291
292 /*
293  * Bits from the flags field.
294  */
295 #define FLAG_TO_DS            0x01
296 #define FLAG_FROM_DS          0x02
297 #define FLAG_MORE_FRAGMENTS   0x04
298 #define FLAG_RETRY            0x08
299 #define FLAG_POWER_MGT        0x10
300 #define FLAG_MORE_DATA        0x20
301 #define FLAG_PROTECTED        0x40
302 #define FLAG_ORDER            0x80
303
304 /*
305  * Test bits in the flags field.
306  */
307 /*
308  * XXX - Only HAVE_FRAGMENTS, IS_PROTECTED, and IS_STRICTLY_ORDERED
309  * are in use.  Should the rest be removed?
310  */
311 #define IS_TO_DS(x)            ((x) & FLAG_TO_DS)
312 #define IS_FROM_DS(x)          ((x) & FLAG_FROM_DS)
313 #define HAVE_FRAGMENTS(x)      ((x) & FLAG_MORE_FRAGMENTS)
314 #define IS_RETRY(x)            ((x) & FLAG_RETRY)
315 #define POWER_MGT_STATUS(x)    ((x) & FLAG_POWER_MGT)
316 #define HAS_MORE_DATA(x)       ((x) & FLAG_MORE_DATA)
317 #define IS_PROTECTED(x)        ((x) & FLAG_PROTECTED)
318 #define IS_STRICTLY_ORDERED(x) ((x) & FLAG_ORDER)
319
320 /*
321  * Extract subfields from the flags field.
322  */
323 #define FLAGS_DS_STATUS(x)          ((x) & (FLAG_FROM_DS|FLAG_TO_DS))
324
325 /*
326  * Extract an indication of the types of addresses in a data frame from
327  * the frame control field.
328  */
329 #define FCF_ADDR_SELECTOR(x) ((x) & ((FLAG_TO_DS|FLAG_FROM_DS) << 8))
330
331 #define DATA_ADDR_T1         0
332 #define DATA_ADDR_T2         (FLAG_FROM_DS << 8)
333 #define DATA_ADDR_T3         (FLAG_TO_DS << 8)
334 #define DATA_ADDR_T4         ((FLAG_TO_DS|FLAG_FROM_DS) << 8)
335
336 /*
337  * Extract the fragment number and sequence number from the sequence
338  * control field.
339  */
340 #define SEQCTL_FRAGMENT_NUMBER(x) ((x) & 0x000F)
341 #define SEQCTL_SEQUENCE_NUMBER(x) (((x) & 0xFFF0) >> 4)
342
343 /*
344  * Extract subfields from the QoS control field.
345  */
346 #define QOS_TID(x)            ((x) & 0x000F)
347 #define QOS_PRIORITY(x)       ((x) & 0x0007)
348 #define QOS_EOSP(x)           (((x) & 0x0010) >> 4) /* end of service period */
349 #define QOS_ACK_POLICY(x)     (((x) & 0x0060) >> 5)
350 #define QOS_AMSDU_PRESENT(x)  (((x) & 0x0080) >> 6)
351 #define QOS_FIELD_CONTENT(x)  (((x) & 0xFF00) >> 8)
352 #define QOS_MESH_CONTROL_PRESENT(x) (((x) & 0x0100) >> 8)
353
354 #define QOS_FLAG_EOSP    0x0010
355
356 /*
357  * Extract subfields from the result of QOS_FIELD_CONTENT().
358  */
359 #define QOS_PS_BUF_STATE_INDICATED(x)  (((x) & 0x02) >> 1)
360 #define QOS_PS_HIGHEST_PRI_BUF_AC(x)   (((x) & 0x0C) >> 2)
361 #define QOS_PS_QAP_BUF_LOAD(x)         (((x) & 0xF0) >> 4)
362
363 /*
364  * Extract subfields from the HT Control field.
365  * .11n D-1.10 & D-2.0, 7.1.3.5a, 32 bits.
366  */
367 #define HTC_LAC(htc)           ((htc) & 0xFF)
368 #define HTC_LAC_MAI(htc)       (((htc) >> 2) & 0xF)
369 #define HTC_IS_ASELI(htc)      (HTC_LAC_MAI(htc) == 0xE)
370 #define HTC_LAC_MAI_MRQ(htc)   ((HTC_LAC_MAI(htc))  & 0x1)
371 #define HTC_LAC_MAI_MSI(htc)   ((HTC_LAC_MAI(htc) >> 1) & 0x7)
372 #define HTC_LAC_MFSI(htc)      (((htc) >> 4) & 0x7)
373 #define HTC_LAC_ASEL_CMD(htc)  (((htc) >> 9) & 0x7)
374 #define HTC_LAC_ASEL_DATA(htc) (((htc) >> 12) & 0xF)
375 #define HTC_LAC_MFB(htc)       (((htc) >> 9) & 0x7F)
376 #define HTC_CAL_POS(htc)       (((htc) >> 16) & 0x3)
377 #define HTC_CAL_SEQ(htc)       (((htc) >> 18) & 0x3)
378 #define HTC_CSI_STEERING(htc)  (((htc) >> 22) & 0x3)
379 #define HTC_NDP_ANN(htc)       (((htc) >> 24) & 0x1)
380 #define HTC_AC_CONSTRAINT(htc) (((htc) >> 30) & 0x1)
381 #define HTC_RDG_MORE_PPDU(htc) (((htc) >> 31) & 0x1)
382
383 /*
384  * Extract subfields from the key octet in WEP-encrypted frames.
385  */
386 #define KEY_OCTET_WEP_KEY(x)   (((x) & 0xC0) >> 6)
387
388 #define KEY_EXTIV    0x20
389 #define EXTIV_LEN    8
390
391 /*
392  * Bits from the Mesh Flags field
393  */
394 #define MESH_FLAGS_ADDRESS_EXTENSION  0x3
395
396 /* ************************************************************************* */
397 /*              Constants used to identify cooked frame types                */
398 /* ************************************************************************* */
399 #define MGT_FRAME            0x00  /* Frame type is management */
400 #define CONTROL_FRAME        0x01  /* Frame type is control */
401 #define DATA_FRAME           0x02  /* Frame type is Data */
402
403 #define DATA_SHORT_HDR_LEN     24
404 #define DATA_LONG_HDR_LEN      30
405 #define MGT_FRAME_HDR_LEN      24  /* Length of Management frame-headers */
406
407 /*
408  * COMPOSE_FRAME_TYPE() values for management frames.
409  */
410 #define MGT_ASSOC_REQ          0x00  /* association request        */
411 #define MGT_ASSOC_RESP         0x01  /* association response       */
412 #define MGT_REASSOC_REQ        0x02  /* reassociation request      */
413 #define MGT_REASSOC_RESP       0x03  /* reassociation response     */
414 #define MGT_PROBE_REQ          0x04  /* Probe request              */
415 #define MGT_PROBE_RESP         0x05  /* Probe response             */
416 #define MGT_MEASUREMENT_PILOT  0x06  /* Measurement Pilot          */
417 #define MGT_BEACON             0x08  /* Beacon frame               */
418 #define MGT_ATIM               0x09  /* ATIM                       */
419 #define MGT_DISASS             0x0A  /* Disassociation             */
420 #define MGT_AUTHENTICATION     0x0B  /* Authentication             */
421 #define MGT_DEAUTHENTICATION   0x0C  /* Deauthentication           */
422 #define MGT_ACTION             0x0D  /* Action                     */
423 #define MGT_ACTION_NO_ACK      0x0E  /* Action No Ack              */
424 #define MGT_ARUBA_WLAN         0x0F  /* Aruba WLAN Specific        */
425
426 /*
427  * COMPOSE_FRAME_TYPE() values for control frames.
428  */
429 #define CTRL_CONTROL_WRAPPER 0x17  /* Control Wrapper        */
430 #define CTRL_BLOCK_ACK_REQ   0x18  /* Block ack Request        */
431 #define CTRL_BLOCK_ACK       0x19  /* Block ack          */
432 #define CTRL_PS_POLL         0x1A  /* power-save poll               */
433 #define CTRL_RTS             0x1B  /* request to send               */
434 #define CTRL_CTS             0x1C  /* clear to send                 */
435 #define CTRL_ACKNOWLEDGEMENT 0x1D  /* acknowledgement               */
436 #define CTRL_CFP_END         0x1E  /* contention-free period end    */
437 #define CTRL_CFP_ENDACK      0x1F  /* contention-free period end/ack */
438
439 /*
440  * COMPOSE_FRAME_TYPE() values for data frames.
441  */
442 #define DATA                        0x20  /* Data                       */
443 #define DATA_CF_ACK                 0x21  /* Data + CF-Ack              */
444 #define DATA_CF_POLL                0x22  /* Data + CF-Poll             */
445 #define DATA_CF_ACK_POLL            0x23  /* Data + CF-Ack + CF-Poll    */
446 #define DATA_NULL_FUNCTION          0x24  /* Null function (no data)    */
447 #define DATA_CF_ACK_NOD             0x25  /* CF-Ack (no data)           */
448 #define DATA_CF_POLL_NOD            0x26  /* CF-Poll (No data)          */
449 #define DATA_CF_ACK_POLL_NOD        0x27  /* CF-Ack + CF-Poll (no data) */
450
451 #define DATA_QOS_DATA               0x28  /* QoS Data                   */
452 #define DATA_QOS_DATA_CF_ACK        0x29  /* QoS Data + CF-Ack        */
453 #define DATA_QOS_DATA_CF_POLL       0x2A  /* QoS Data + CF-Poll      */
454 #define DATA_QOS_DATA_CF_ACK_POLL   0x2B  /* QoS Data + CF-Ack + CF-Poll    */
455 #define DATA_QOS_NULL               0x2C  /* QoS Null        */
456 #define DATA_QOS_CF_POLL_NOD        0x2E  /* QoS CF-Poll (No Data)      */
457 #define DATA_QOS_CF_ACK_POLL_NOD    0x2F  /* QoS CF-Ack + CF-Poll (No Data) */
458
459
460 /* ************************************************************************* */
461 /*        Logical field codes (dissector's encoding of fixed fields)         */
462 /* ************************************************************************* */
463 enum fixed_field {
464   FIELD_TIMESTAMP,                            /* 64-bit timestamp */
465   FIELD_BEACON_INTERVAL,                      /* 16-bit beacon interval */
466   FIELD_CAP_INFO,                             /* Add capability information tree */
467   FIELD_AUTH_ALG,                             /* Authentication algorithm used */
468   FIELD_AUTH_TRANS_SEQ,                       /* Authentication sequence number */
469   FIELD_CURRENT_AP_ADDR,
470   FIELD_LISTEN_IVAL,
471   FIELD_REASON_CODE,
472   FIELD_ASSOC_ID,
473   FIELD_STATUS_CODE,
474   FIELD_CATEGORY_CODE,                        /* Management action category */
475   FIELD_ACTION_CODE,                          /* Management action code */
476   FIELD_DIALOG_TOKEN,                         /* Management action dialog token */
477   FIELD_WME_ACTION_CODE,                      /* Management notification action code */
478   FIELD_WME_DIALOG_TOKEN,                     /* Management notification dialog token */
479   FIELD_WME_STATUS_CODE,                      /* Management notification setup response status code */
480   FIELD_QOS_ACTION_CODE,
481   FIELD_QOS_TS_INFO,
482   FIELD_DLS_ACTION_CODE,
483   FIELD_DST_MAC_ADDR,                         /* DLS destination MAC address */
484   FIELD_SRC_MAC_ADDR,                         /* DLS source MAC address */
485   FIELD_DLS_TIMEOUT,                          /* DLS timeout value */
486   FIELD_SCHEDULE_INFO,                        /* Schedule Info field */
487   FIELD_ACTION,                               /* Action field */
488   FIELD_BLOCK_ACK_ACTION_CODE,
489   FIELD_QOS_INFO_AP,
490   FIELD_QOS_INFO_STA,
491   FIELD_BLOCK_ACK_PARAM,
492   FIELD_BLOCK_ACK_TIMEOUT,
493   FIELD_BLOCK_ACK_SSC,
494   FIELD_DELBA_PARAM_SET,
495   FIELD_MAX_REG_PWR,
496   FIELD_MEASUREMENT_PILOT_INT,
497   FIELD_COUNTRY_STR,
498   FIELD_MAX_TX_PWR,
499   FIELD_TX_PWR_USED,
500   FIELD_TRANSCEIVER_NOISE_FLOOR,
501   FIELD_DS_PARAM_SET,
502   FIELD_CHANNEL_WIDTH,
503   FIELD_SM_PWR_CNTRL,
504   FIELD_PCO_PHASE_CNTRL,
505   FIELD_PSMP_PARAM_SET,
506   FIELD_PSMP_STA_INFO,
507   FIELD_MIMO_CNTRL,
508   FIELD_ANT_SELECTION,
509   FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT,
510   FIELD_HT_INFORMATION,
511   FIELD_HT_ACTION_CODE,
512   FIELD_PA_ACTION_CODE,
513   FIELD_FT_ACTION_CODE,
514   FIELD_STA_ADDRESS,
515   FIELD_TARGET_AP_ADDRESS,
516   FIELD_GAS_COMEBACK_DELAY,
517   FIELD_GAS_FRAGMENT_ID,
518   FIELD_SA_QUERY_ACTION_CODE,
519   FIELD_TRANSACTION_ID,
520   FIELD_TDLS_ACTION_CODE,
521   FIELD_TARGET_CHANNEL,
522   FIELD_REGULATORY_CLASS,
523   FIELD_MESH_ACTION,
524   FIELD_MULTIHOP_ACTION,
525   FIELD_MESH_CONTROL,
526   FIELD_SELFPROT_ACTION,
527   FIELD_WNM_ACTION_CODE,
528   FIELD_KEY_DATA_LENGTH,
529   FIELD_WNM_NOTIFICATION_TYPE,
530                                               /* add any new fixed field value above this line */
531   MAX_FIELD_NUM
532 };
533
534 /* ************************************************************************* */
535 /*        Logical field codes (IEEE 802.11 encoding of tags)                 */
536 /* ************************************************************************* */
537 #define TAG_SSID                       0
538 #define TAG_SUPP_RATES                 1
539 #define TAG_FH_PARAMETER               2
540 #define TAG_DS_PARAMETER               3
541 #define TAG_CF_PARAMETER               4
542 #define TAG_TIM                        5
543 #define TAG_IBSS_PARAMETER             6
544 #define TAG_COUNTRY_INFO               7
545 #define TAG_FH_HOPPING_PARAMETER       8
546 #define TAG_FH_HOPPING_TABLE           9
547 #define TAG_REQUEST                   10
548 #define TAG_QBSS_LOAD                 11
549 #define TAG_EDCA_PARAM_SET            12
550 #define TAG_TSPEC                     13
551 #define TAG_TCLAS                     14
552 #define TAG_SCHEDULE                  15
553 #define TAG_CHALLENGE_TEXT            16
554
555 #define TAG_POWER_CONSTRAINT          32
556 #define TAG_POWER_CAPABILITY          33
557 #define TAG_TPC_REQUEST               34
558 #define TAG_TPC_REPORT                35
559 #define TAG_SUPPORTED_CHANNELS        36
560 #define TAG_CHANNEL_SWITCH_ANN        37
561 #define TAG_MEASURE_REQ               38
562 #define TAG_MEASURE_REP               39
563 #define TAG_QUIET                     40
564 #define TAG_IBSS_DFS                  41
565 #define TAG_ERP_INFO                  42
566 #define TAG_TS_DELAY                  43
567 #define TAG_TCLAS_PROCESS             44
568 #define TAG_HT_CAPABILITY             45 /* IEEE Stc 802.11n/D2.0 */
569 #define TAG_QOS_CAPABILITY            46
570 #define TAG_ERP_INFO_OLD              47 /* IEEE Std 802.11g/D4.0 */
571 #define TAG_RSN_IE                    48
572 /* Reserved 49 */
573 #define TAG_EXT_SUPP_RATES            50
574 #define TAG_AP_CHANNEL_REPORT         51
575 #define TAG_NEIGHBOR_REPORT           52
576 #define TAG_RCPI                      53
577 #define TAG_MOBILITY_DOMAIN           54  /* IEEE Std 802.11r-2008 */
578 #define TAG_FAST_BSS_TRANSITION       55  /* IEEE Std 802.11r-2008 */
579 #define TAG_TIMEOUT_INTERVAL          56  /* IEEE Std 802.11r-2008 */
580 #define TAG_RIC_DATA                  57  /* IEEE Std 802.11r-2008 */
581 #define TAG_DSE_REG_LOCATION          58
582 #define TAG_SUPPORTED_REGULATORY_CLASSES            59 /* IEEE Std 802.11w-2009 */
583 #define TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT    60 /* IEEE Std 802.11w-2009 */
584 #define TAG_HT_INFO                   61  /* IEEE Stc 802.11n/D2.0 */
585 #define TAG_SECONDARY_CHANNEL_OFFSET  62  /* IEEE Stc 802.11n/D1.10/D2.0 */
586 #define TAG_BSS_AVG_ACCESS_DELAY      63
587 #define TAG_ANTENNA                   64
588 #define TAG_RSNI                      65
589 #define TAG_MEASURE_PILOT_TRANS       66
590 #define TAG_BSS_AVB_ADM_CAPACITY      67
591 #define TAG_IE_68_CONFLICT            68  /* Conflict: WAPI Vs. IEEE */
592 #define TAG_WAPI_PARAM_SET            68
593 #define TAG_BSS_AC_ACCESS_DELAY       68
594 #define TAG_TIME_ADV                  69  /* IEEE Std 802.11p-2010 */
595 #define TAG_RM_ENABLED_CAPABILITY     70
596 #define TAG_MULTIPLE_BSSID            71
597 #define TAG_20_40_BSS_CO_EX           72  /* IEEE P802.11n/D6.0 */
598 #define TAG_20_40_BSS_INTOL_CH_REP    73  /* IEEE P802.11n/D6.0 */
599 #define TAG_OVERLAP_BSS_SCAN_PAR      74  /* IEEE P802.11n/D6.0 */
600 #define TAG_RIC_DESCRIPTOR            75  /* IEEE Std 802.11r-2008 */
601 #define TAG_MMIE                      76  /* IEEE Std 802.11w-2009 */
602 #define TAG_EVENT_REQUEST             78
603 #define TAG_EVENT_REPORT              79
604 #define TAG_DIAGNOSTIC_REQUEST        80
605 #define TAG_DIAGNOSTIC_REPORT         81
606 #define TAG_LOCATION_PARAMETERS       82
607 #define TAG_NO_BSSID_CAPABILITY       83
608 #define TAG_SSID_LIST                 84
609 #define TAG_MULTIPLE_BSSID_INDEX      85
610 #define TAG_FMS_DESCRIPTOR            86
611 #define TAG_FMS_REQUEST               87
612 #define TAG_FMS_RESPONSE              88
613 #define TAG_QOS_TRAFFIC_CAPABILITY    89
614 #define TAG_BSS_MAX_IDLE_PERIOD       90
615 #define TAG_TFS_REQUEST               91
616 #define TAG_TFS_RESPONSE              92
617 #define TAG_WNM_SLEEP_MODE            93
618 #define TAG_TIM_BROADCAST_REQUEST     94
619 #define TAG_TIM_BROADCAST_RESPONSE    95
620 #define TAG_COLLOCATED_INTER_REPORT   96
621 #define TAG_CHANNEL_USAGE             97
622 #define TAG_TIME_ZONE                 98  /* IEEE Std 802.11v-2011 */
623 #define TAG_DMS_REQUEST               99
624 #define TAG_DMS_RESPONSE             100
625 #define TAG_LINK_IDENTIFIER          101  /* IEEE Std 802.11z-2010 */
626 #define TAG_WAKEUP_SCHEDULE          102  /* IEEE Std 802.11z-2010 */
627 #define TAG_CHANNEL_SWITCH_TIMING    104  /* IEEE Std 802.11z-2010 */
628 #define TAG_PTI_CONTROL              105  /* IEEE Std 802.11z-2010 */
629 #define TAG_PU_BUFFER_STATUS         106  /* IEEE Std 802.11z-2010 */
630 #define TAG_INTERWORKING             107  /* IEEE Std 802.11u-2011 */
631 #define TAG_ADVERTISEMENT_PROTOCOL   108  /* IEEE Std 802.11u-2011 */
632 #define TAG_EXPIDITED_BANDWIDTH_REQ  109  /* IEEE Std 802.11u-2011 */
633 #define TAG_QOS_MAP_SET              110  /* IEEE Std 802.11u-2011 */
634 #define TAG_ROAMING_CONSORTIUM       111  /* IEEE Std 802.11u-2011 */
635 #define TAG_EMERGENCY_ALERT_ID       112  /* IEEE Std 802.11u-2011 */
636 #define TAG_MESH_CONFIGURATION       113  /* IEEE Std 802.11s-2011 */
637 #define TAG_MESH_ID                  114  /* IEEE Std 802.11s-2011 */
638 #define TAG_MESH_LINK_METRIC_REPORT  115
639 #define TAG_CONGESTION_NOTIFICATION  116
640 #define TAG_MESH_PEERING_MGMT        117  /* IEEE Std 802.11s-2011 */
641 #define TAG_MESH_CHANNEL_SWITCH      118
642 #define TAG_MESH_AWAKE_WINDOW        119
643 #define TAG_BEACON_TIMING            120
644 #define TAG_MCCAOP_SETUP_REQUEST     121
645 #define TAG_MCCAOP_SETUP_REPLY       122
646 #define TAG_MCCAOP_ADVERTISSEMENT    123
647 #define TAG_MCCAOP_TEARDOWN          124
648 #define TAG_GANN                     125
649 #define TAG_RANN                     126  /* IEEE Std 802.11s-2011 */
650 #define TAG_EXTENDED_CAPABILITIES    127  /* IEEE Stc 802.11n/D1.10/D2.0 */
651 #define TAG_AGERE_PROPRIETARY        128
652 #define TAG_MESH_PREQ                130  /* IEEE Std 802.11s-2011 */
653 #define TAG_MESH_PREP                131  /* IEEE Std 802.11s-2011 */
654 #define TAG_MESH_PERR                132  /* IEEE Std 802.11s-2011 */
655 #define TAG_CISCO_CCX1_CKIP          133  /* Cisco Compatible eXtensions v1 */
656 #define TAG_CISCO_CCX2               136  /* Cisco Compatible eXtensions v2 */
657 #define TAG_PXU                      137
658 #define TAG_PXUC                     138
659 #define TAG_AUTH_MESH_PEERING_EXCH   139
660 #define TAG_MIC                      140
661 #define TAG_DESTINATION_URI          141
662 #define TAG_U_APSD_COEX              142
663 #define TAG_CISCO_CCX3               149  /* Cisco Compatible eXtensions v3 */
664 #define TAG_CISCO_UNKNOWN_96         150  /* Cisco Compatible eXtensions */
665 #define TAG_SYMBOL_PROPRIETARY       173
666 #define TAG_MCCAOP_ADVERTISSEMENT_OV 174
667 #define TAG_VHT_CAPABILITY           191  /* IEEE Stc 802.11ac/D3.1 */
668 #define TAG_VHT_OPERATION            192  /* IEEE Stc 802.11ac/D3.1 */
669 #define TAG_VENDOR_SPECIFIC_IE       221
670
671 static const value_string tag_num_vals[] = {
672   { TAG_SSID,                                 "SSID parameter set" },
673   { TAG_SUPP_RATES,                           "Supported Rates" },
674   { TAG_FH_PARAMETER,                         "FH Parameter set" },
675   { TAG_DS_PARAMETER,                         "DS Parameter set" },
676   { TAG_CF_PARAMETER,                         "CF Parameter set" },
677   { TAG_TIM,                                  "Traffic Indication Map (TIM)" },
678   { TAG_IBSS_PARAMETER,                       "IBSS Parameter set" },
679   { TAG_COUNTRY_INFO,                         "Country Information" },
680   { TAG_FH_HOPPING_PARAMETER,                 "Hopping Pattern Parameters" },
681   { TAG_FH_HOPPING_TABLE,                     "Hopping Pattern Table" },
682   { TAG_REQUEST,                              "Request" },
683   { TAG_QBSS_LOAD,                            "QBSS Load Element" },
684   { TAG_EDCA_PARAM_SET,                       "EDCA Parameter Set" },
685   { TAG_TSPEC,                                "Traffic Specification" },
686   { TAG_TCLAS,                                "Traffic Classification" },
687   { TAG_SCHEDULE,                             "Schedule" },
688   { TAG_CHALLENGE_TEXT,                       "Challenge text" },
689   { TAG_POWER_CONSTRAINT,                     "Power Constraint" },
690   { TAG_POWER_CAPABILITY,                     "Power Capability" },
691   { TAG_TPC_REQUEST,                          "TPC Request" },
692   { TAG_TPC_REPORT,                           "TPC Report" },
693   { TAG_SUPPORTED_CHANNELS,                   "Supported Channels" },
694   { TAG_CHANNEL_SWITCH_ANN,                   "Channel Switch Announcement" },
695   { TAG_MEASURE_REQ,                          "Measurement Request" },
696   { TAG_MEASURE_REP,                          "Measurement Report" },
697   { TAG_QUIET,                                "Quiet" },
698   { TAG_IBSS_DFS,                             "IBSS DFS" },
699   { TAG_ERP_INFO,                             "ERP Information" },
700   { TAG_TS_DELAY,                             "TS Delay" },
701   { TAG_TCLAS_PROCESS,                        "TCLAS Processing" },
702   { TAG_HT_CAPABILITY,                        "HT Capabilities (802.11n D1.10)" },
703   { TAG_QOS_CAPABILITY,                       "QoS Capability" },
704   { TAG_ERP_INFO_OLD,                         "ERP Information" }, /* Reserved... */
705   { TAG_RSN_IE,                               "RSN Information" },
706   { TAG_EXT_SUPP_RATES,                       "Extended Supported Rates" },
707   { TAG_AP_CHANNEL_REPORT,                    "AP Channel Report" },
708   { TAG_NEIGHBOR_REPORT,                      "Neighbor Report" },
709   { TAG_RCPI,                                 "RCPI" },
710   { TAG_MOBILITY_DOMAIN,                      "Mobility Domain" },
711   { TAG_FAST_BSS_TRANSITION,                  "Fast BSS Transition" },
712   { TAG_TIMEOUT_INTERVAL,                     "Timeout Interval" },
713   { TAG_RIC_DATA,                             "RIC Data" },
714   { TAG_DSE_REG_LOCATION,                     "DSE Registered Location" },
715   { TAG_SUPPORTED_REGULATORY_CLASSES,         "Supported Regulatory Classes" },
716   { TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT, "Extended Channel Switch Announcement" },
717   { TAG_HT_INFO,                              "HT Information (802.11n D1.10)" },
718   { TAG_SECONDARY_CHANNEL_OFFSET,             "Secondary Channel Offset (802.11n D1.10)" },
719   { TAG_BSS_AVG_ACCESS_DELAY,                 "BSS Average Access Delay" },
720   { TAG_ANTENNA,                              "Antenna" },
721   { TAG_RSNI,                                 "RSNI" },
722   { TAG_MEASURE_PILOT_TRANS,                  "Measurement Pilot Transmission" },
723   { TAG_BSS_AVB_ADM_CAPACITY,                 "BSS Available Admission Capacity" },
724   { TAG_IE_68_CONFLICT,                       "BSS AC Access Delay/WAPI Parameter Set" },
725   { TAG_TIME_ADV,                             "Time Advertisement" },
726   { TAG_RM_ENABLED_CAPABILITY,                "RM Enabled Capabilities" },
727   { TAG_MULTIPLE_BSSID,                       "Multiple BSSID" },
728   { TAG_20_40_BSS_CO_EX,                      "20/40 BSS Coexistence" },
729   { TAG_20_40_BSS_INTOL_CH_REP,               "20/40 BSS Intolerant Channel Report" },   /* IEEE P802.11n/D6.0 */
730   { TAG_OVERLAP_BSS_SCAN_PAR,                 "Overlapping BSS Scan Parameters" },       /* IEEE P802.11n/D6.0 */
731   { TAG_RIC_DESCRIPTOR,                       "RIC Descriptor" },
732   { TAG_MMIE,                                 "Management MIC" },
733   { TAG_EVENT_REQUEST,                        "Event Request" },
734   { TAG_EVENT_REPORT,                         "Event Report" },
735   { TAG_DIAGNOSTIC_REQUEST,                   "Diagnostic Request" },
736   { TAG_DIAGNOSTIC_REPORT,                    "Diagnostic Report" },
737   { TAG_LOCATION_PARAMETERS,                  "Location Parameters" },
738   { TAG_NO_BSSID_CAPABILITY,                  "Non Transmitted BSSID Capability" },
739   { TAG_SSID_LIST,                            "SSID List" },
740   { TAG_MULTIPLE_BSSID_INDEX,                 "Multiple BSSID Index" },
741   { TAG_FMS_DESCRIPTOR,                       "FMS Descriptor" },
742   { TAG_FMS_REQUEST,                          "FMS Request" },
743   { TAG_FMS_RESPONSE,                         "FMS Response" },
744   { TAG_QOS_TRAFFIC_CAPABILITY,               "QoS Traffic Capability" },
745   { TAG_BSS_MAX_IDLE_PERIOD,                  "BSS Max Idle Period" },
746   { TAG_TFS_REQUEST,                          "TFS Request" },
747   { TAG_TFS_RESPONSE,                         "TFS Response" },
748   { TAG_WNM_SLEEP_MODE,                       "WNM-Sleep Mode" },
749   { TAG_TIM_BROADCAST_REQUEST,                "TIM Broadcast Request" },
750   { TAG_TIM_BROADCAST_RESPONSE,               "TIM Broadcast Response" },
751   { TAG_COLLOCATED_INTER_REPORT,              "Collocated Interference Report" },
752   { TAG_CHANNEL_USAGE,                        "Channel Usage" },
753   { TAG_TIME_ZONE,                            "Time Zone" },
754   { TAG_DMS_REQUEST,                          "DMS Request" },
755   { TAG_DMS_RESPONSE,                         "DMS Response" },
756   { TAG_LINK_IDENTIFIER,                      "Link Identifier" },
757   { TAG_WAKEUP_SCHEDULE,                      "Wakeup Schedule" },
758   { TAG_CHANNEL_SWITCH_TIMING,                "Channel Switch Timing" },
759   { TAG_PTI_CONTROL,                          "PTI Control" },
760   { TAG_PU_BUFFER_STATUS,                     "PU Buffer Status" },
761   { TAG_INTERWORKING,                         "Interworking" },
762   { TAG_ADVERTISEMENT_PROTOCOL,               "Advertisement Protocol"},
763   { TAG_EXPIDITED_BANDWIDTH_REQ,              "Expedited Bandwidth Request" },
764   { TAG_QOS_MAP_SET,                          "QoS Map Set" },
765   { TAG_ROAMING_CONSORTIUM,                   "Roaming Consortium" },
766   { TAG_EMERGENCY_ALERT_ID,                   "Emergency Alert Identifier" },
767   { TAG_MESH_CONFIGURATION,                   "Mesh Configuration" },
768   { TAG_MESH_ID,                              "Mesh ID" },
769   { TAG_MESH_LINK_METRIC_REPORT,              "Mesh Link Metric Report" },
770   { TAG_CONGESTION_NOTIFICATION,              "Congestion Notification" },
771   { TAG_MESH_PEERING_MGMT,                    "Mesh Peering Management" },
772   { TAG_MESH_CHANNEL_SWITCH,                  "Mesh Channel Switch Parameters" },
773   { TAG_MESH_AWAKE_WINDOW,                    "Mesh Awake Windows" },
774   { TAG_BEACON_TIMING,                        "Beacon Timing" },
775   { TAG_MCCAOP_SETUP_REQUEST,                 "MCCAOP Setup Request" },
776   { TAG_MCCAOP_SETUP_REPLY,                   "MCCAOP SETUP Reply" },
777   { TAG_MCCAOP_ADVERTISSEMENT,                "MCCAOP Advertissement" },
778   { TAG_MCCAOP_TEARDOWN,                      "MCCAOP Teardown" },
779   { TAG_GANN,                                 "Gate Announcemen" },
780   { TAG_RANN,                                 "Root Announcement" },
781   { TAG_EXTENDED_CAPABILITIES,                "Extended Capabilities" },
782   { TAG_AGERE_PROPRIETARY,                    "Agere Proprietary" },
783   { TAG_MESH_PREQ,                            "Path Request" },
784   { TAG_MESH_PREP,                            "Path Reply" },
785   { TAG_MESH_PERR,                            "Path Error" },
786   { TAG_CISCO_CCX1_CKIP,                      "Cisco CCX1 CKIP + Device Name" },
787   { TAG_CISCO_CCX2,                           "Cisco CCX2" },
788   { TAG_PXU,                                  "Proxy Update" },
789   { TAG_PXUC,                                 "Proxy Update Confirmation"},
790   { TAG_AUTH_MESH_PEERING_EXCH,               "Auhenticated Mesh Perring Exchange" },
791   { TAG_MIC,                                  "MIC (Message Integrity Code)" },
792   { TAG_DESTINATION_URI,                      "Destination URI" },
793   { TAG_U_APSD_COEX,                          "U-APSD Coexistence" },
794   { TAG_CISCO_CCX3,                           "Cisco Unknown 95" },
795   { TAG_CISCO_UNKNOWN_96,                     "Cisco Unknown 96" },
796   { TAG_SYMBOL_PROPRIETARY,                   "Symbol Proprietary" },
797   { TAG_MCCAOP_ADVERTISSEMENT_OV,             "MCCAOP Advertissement Overviw" },
798   { TAG_VHT_CAPABILITY,                       "VHT Capabilities (IEEE Stc 802.11ac/D3.1)" },
799   { TAG_VHT_OPERATION,                        "VHT Operation (IEEE Stc 802.11ac/D3.1)" },
800   { TAG_VENDOR_SPECIFIC_IE,                   "Vendor Specific" },
801   { 0, NULL }
802 };
803 static value_string_ext tag_num_vals_ext = VALUE_STRING_EXT_INIT(tag_num_vals);
804
805 /* WFA vendor specific subtypes */
806 #define WFA_SUBTYPE_P2P 9
807 #define WFA_SUBTYPE_WIFI_DISPLAY 10
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_WIFI_DISPLAY:
8017     dissect_wifi_display_ie(pinfo, item, tag_tvb, 4, tag_len - 4);
8018     proto_item_append_text(item, ": Wi-Fi Display");
8019     break;
8020   case WFA_SUBTYPE_HS20_INDICATION:
8021     dissect_hs20_indication(item, tag_tvb, 4);
8022     proto_item_append_text(item, ": Hotspot 2.0 Indication");
8023     break;
8024   }
8025 }
8026
8027 static void
8028 dissect_vendor_ie_rsn(proto_item * item, proto_tree * tree, tvbuff_t * tvb, int offset, guint32 tag_len)
8029 {
8030
8031   switch(tvb_get_guint8(tvb, offset)){
8032     case 4:
8033     {
8034       /* IEEE 802.11i / Key Data Encapsulation / Data Type=4 - PMKID.
8035        * This is only used within EAPOL-Key frame Key Data. */
8036       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_pmkid, tvb, offset, 16, ENC_NA);
8037     }
8038     break;
8039     default:
8040       proto_tree_add_item(tree, hf_ieee80211_rsn_ie_unknown, tvb, offset, tag_len, ENC_NA);
8041     break;
8042   }
8043
8044   proto_item_append_text(item, ": RSN");
8045
8046 }
8047
8048 typedef enum {
8049   MARVELL_IE_MESH = 4
8050 } marvell_ie_type_t;
8051
8052 static void
8053 dissect_vendor_ie_marvell(proto_item *item _U_, proto_tree *ietree,
8054                           tvbuff_t *tvb, int offset, guint32 tag_len)
8055 {
8056   guint8 type;
8057
8058   type = tvb_get_guint8(tvb, offset);
8059   proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8060   offset += 1;
8061
8062   switch (type) {
8063   case MARVELL_IE_MESH:
8064     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_subtype, tvb,
8065                          offset++, 1, ENC_LITTLE_ENDIAN);
8066     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_version, tvb,
8067                          offset++, 1, ENC_LITTLE_ENDIAN);
8068     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_active_proto_id, tvb,
8069                          offset++, 1, ENC_LITTLE_ENDIAN);
8070     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_active_metric_id, tvb,
8071                          offset++, 1, ENC_LITTLE_ENDIAN);
8072     proto_tree_add_item (ietree, hf_ieee80211_marvell_ie_mesh_cap, tvb,
8073                          offset++, 1, ENC_LITTLE_ENDIAN);
8074     break;
8075
8076   default:
8077     proto_tree_add_item(ietree, hf_ieee80211_marvell_ie_data, tvb, offset,
8078       tag_len - 1, ENC_NA);
8079     break;
8080   }
8081 }
8082
8083 typedef enum {
8084   ATHEROS_IE_ADVCAP = 1,
8085   ATHEROS_IE_XR = 3
8086 } atheros_ie_type_t;
8087
8088 typedef enum {
8089   ATHEROS_IE_ADVCAP_S = 1
8090 } atheros_ie_advcap_subtype_t;
8091
8092 typedef enum {
8093   ATHEROS_IE_XR_S = 1
8094 } atheros_ie_xr_subtype_t;
8095
8096 typedef enum {
8097   ATHEROS_IE_CAP_TURBOP = 0x01,
8098   ATHEROS_IE_CAP_COMP   = 0x02,
8099   ATHEROS_IE_CAP_FF     = 0x04,
8100   ATHEROS_IE_CAP_XR     = 0x08,
8101   ATHEROS_IE_CAP_AR     = 0x10,
8102   ATHEROS_IE_CAP_BURST  = 0x20,
8103   ATHEROS_IE_CAP_WME    = 0x40,
8104   ATHEROS_IE_CAP_BOOST  = 0x80
8105 } atheros_ie_cap_t;
8106
8107 static const value_string atheros_ie_type_vals[] = {
8108   { ATHEROS_IE_ADVCAP, "Advanced Capability"},
8109   { ATHEROS_IE_XR,     "eXtended Range"},
8110   { 0,                 NULL }
8111 };
8112
8113 static void
8114 dissect_vendor_ie_atheros_cap(proto_item *item _U_, tvbuff_t *tvb, int offset)
8115 {
8116   proto_tree *cap_tree;
8117
8118   cap_tree = proto_item_add_subtree(item, ett_ath_cap_tree);
8119
8120   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_turbop, tvb, offset, 1, ENC_NA);
8121   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_comp,   tvb, offset, 1, ENC_NA);
8122   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_ff,     tvb, offset, 1, ENC_NA);
8123   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_xr,     tvb, offset, 1, ENC_NA);
8124   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_ar,     tvb, offset, 1, ENC_NA);
8125   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_burst,  tvb, offset, 1, ENC_NA);
8126   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_wme,    tvb, offset, 1, ENC_NA);
8127   proto_tree_add_item(cap_tree, hf_ieee80211_atheros_ie_cap_f_boost,  tvb, offset, 1, ENC_NA);
8128
8129 }
8130
8131 static void
8132 dissect_vendor_ie_atheros(proto_item *item _U_, proto_tree *ietree,
8133                           tvbuff_t *tvb, int offset, guint tag_len,
8134                           packet_info *pinfo, proto_item *ti_len)
8135 {
8136   guint8      type;
8137   guint8      subtype;
8138   guint8      version;
8139   proto_item *cap_item;
8140
8141   if (tag_len <= 3) {
8142         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 */
8143         return;
8144   }
8145   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_type, tvb, offset, 1, ENC_NA);
8146   type = tvb_get_guint8(tvb, offset);
8147   proto_item_append_text(item, ": %s", val_to_str_const(type, atheros_ie_type_vals, "Unknown"));
8148   offset  += 1;
8149   tag_len -= 1;
8150
8151   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_subtype, tvb, offset, 1, ENC_NA);
8152   subtype  = tvb_get_guint8(tvb, offset);
8153   offset  += 1;
8154   tag_len -= 1;
8155
8156   proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_version, tvb, offset, 1, ENC_NA);
8157   version  = tvb_get_guint8(tvb, offset);
8158   offset  += 1;
8159   tag_len -= 1;
8160
8161   if (version == 0)
8162   {
8163     switch (type) {
8164       case ATHEROS_IE_ADVCAP:
8165       {
8166         switch (subtype) {
8167           case ATHEROS_IE_ADVCAP_S:
8168           {
8169             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_cap, tvb, offset, 1, ENC_NA);
8170             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
8171             offset   += 1;
8172             tag_len  -= 1;
8173
8174             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_advcap_defkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8175             offset  += 2;
8176             tag_len -= 2;
8177             break;
8178           }
8179           default:
8180           /* No default Action */
8181           break;
8182         } /* End switch (subtype) */
8183         break;
8184       }
8185       case ATHEROS_IE_XR:
8186       {
8187         switch (subtype) {
8188           case ATHEROS_IE_XR_S:
8189           {
8190             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_info, tvb, offset, 1, ENC_NA);
8191             offset  += 1;
8192             tag_len -= 1;
8193
8194             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_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_bssid, tvb, offset, 6, ENC_NA);
8199             offset  += 6;
8200             tag_len -= 6;
8201
8202             proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_beacon, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8203             offset  += 2;
8204             tag_len -= 2;
8205
8206             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_base_cap, tvb, offset, 1, ENC_NA);
8207             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
8208             offset   += 1;
8209             tag_len  -= 1;
8210
8211             cap_item  = proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_xr_xr_cap, tvb, offset, 1, ENC_NA);
8212             dissect_vendor_ie_atheros_cap(cap_item, tvb, offset);
8213             offset   += 1;
8214             tag_len  -= 1;
8215             break;
8216           }
8217           default:
8218           /* No default Action */
8219           break;
8220         } /* End switch (subtype) */
8221         break;
8222         default:
8223         /* No default Action */
8224         break;
8225       } /* End switch (type) */
8226
8227     }
8228   }
8229   if (tag_len > 0) {
8230     proto_tree_add_item(ietree, hf_ieee80211_atheros_ie_data, tvb, offset, tag_len, ENC_NA);
8231   }
8232 }
8233
8234 typedef enum {
8235   AIRONET_IE_VERSION = 3,
8236   AIRONET_IE_QOS,
8237   AIRONET_IE_QBSS_V2 = 14
8238 } aironet_ie_type_t;
8239
8240 static const value_string aironet_ie_type_vals[] = {
8241   { AIRONET_IE_VERSION,   "CCX version"},
8242   { AIRONET_IE_QOS,       "Qos"},
8243   { AIRONET_IE_QBSS_V2,   "QBSS V2 - CCA"},
8244   { 0,                    NULL }
8245 };
8246
8247 static void
8248 dissect_vendor_ie_aironet(proto_item *aironet_item, proto_tree *ietree,
8249                           tvbuff_t *tvb, int offset, guint32 tag_len)
8250 {
8251   guint8  type;
8252   int i;
8253   gboolean dont_change = FALSE; /* Don't change the IE item text to default */
8254
8255   type = tvb_get_guint8(tvb, offset);
8256   proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8257   offset += 1;
8258
8259   switch (type) {
8260   case AIRONET_IE_VERSION:
8261     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8262     proto_item_append_text(aironet_item, ": Aironet CCX version = %d",
8263     tvb_get_guint8(tvb, offset));
8264     dont_change = TRUE;
8265     break;
8266   case AIRONET_IE_QOS:
8267     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_qos_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8268     offset += 1;
8269     proto_tree_add_item (ietree, hf_ieee80211_aironet_ie_qos_paramset, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8270     offset += 1;
8271
8272     /* XXX: just copied over from WME. Maybe "Best Effort" and "Background"
8273      *  need to be swapped. Also, the "TXOP" may be TXOP - or not.
8274      */
8275     for (i = 0; i < 4; i++) {
8276       guint8 byte1, byte2;
8277       guint16 txop;
8278       byte1 = tvb_get_guint8(tvb, offset);
8279       byte2 = tvb_get_guint8(tvb, offset + 1);
8280       txop = tvb_get_letohs(tvb, offset + 2);
8281       proto_tree_add_bytes_format(ietree, hf_ieee80211_aironet_ie_qos_val, tvb, offset, 4, NULL,
8282           "CCX QoS Parameters: ACI %u (%s), Admission Control %sMandatory, AIFSN %u, ECWmin %u, ECWmax %u, TXOP %u",
8283         (byte1 & 0x60) >> 5, val_to_str((byte1 & 0x60) >> 5, wme_acs, "(Unknown: %d)"),
8284         (byte1 & 0x10) ? "" : "not ", byte1 & 0x0f,
8285         byte2 & 0x0f, (byte2 & 0xf0) >> 4,
8286         txop);
8287       offset += 4;
8288     }
8289     break;
8290   case AIRONET_IE_QBSS_V2:
8291     /* Extract Values */
8292     proto_tree_add_item (ietree, hf_ieee80211_qbss2_scount, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8293     proto_tree_add_item (ietree, hf_ieee80211_qbss2_cu, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
8294     proto_tree_add_item (ietree, hf_ieee80211_qbss2_cal, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8295     proto_tree_add_item (ietree, hf_ieee80211_qbss2_gl, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
8296     break;
8297   default:
8298     proto_tree_add_item(ietree, hf_ieee80211_aironet_ie_data, tvb, offset,
8299       tag_len - 1, ENC_NA);
8300     break;
8301   }
8302   if (!dont_change) {
8303     proto_item_append_text(aironet_item, ": Aironet %s",
8304       val_to_str_const(type, aironet_ie_type_vals, "Unknown"));
8305   }
8306 }
8307
8308 #define ARUBA_APNAME  3
8309 static const value_string ieee80211_vs_aruba_subtype_vals[] = {
8310   { ARUBA_APNAME, "AP Name"},
8311   { 0,                 NULL }
8312 };
8313 static void
8314 dissect_vendor_ie_aruba(proto_item *item, proto_tree *ietree,
8315                           tvbuff_t *tvb, int offset, guint32 tag_len)
8316 {
8317   guint8 type;
8318
8319   offset += 1; /* VS OUI Type */
8320   tag_len -= 1;
8321
8322   type = tvb_get_guint8(tvb, offset);
8323   proto_tree_add_item (ietree, hf_ieee80211_vs_aruba_subtype, tvb, offset, 1, ENC_NA);
8324   proto_item_append_text(item, ": %s", val_to_str_const(type, ieee80211_vs_aruba_subtype_vals, "Unknown"));
8325   offset += 1;
8326   tag_len -= 1;
8327
8328   switch (type) {
8329   case ARUBA_APNAME:
8330     offset += 1;
8331     tag_len -= 1;
8332
8333     proto_tree_add_item (ietree, hf_ieee80211_vs_aruba_apname, tvb,
8334                          offset, tag_len, ENC_ASCII|ENC_NA);
8335     proto_item_append_text(item, " (%s)", tvb_get_ephemeral_string(tvb, offset, tag_len));
8336     break;
8337
8338   default:
8339     proto_tree_add_item(ietree, hf_ieee80211_vs_aruba_data, tvb, offset,
8340       tag_len, ENC_NA);
8341     proto_item_append_text(item, " (Data: %s)", tvb_bytes_to_str(tvb, offset, tag_len));
8342     break;
8343   }
8344 }
8345
8346 /* 802.11e 7.3.2.33 QoS Capability element */
8347 static int
8348 dissect_qos_capability(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, int ftype)
8349 {
8350   proto_item *cap_info_item;
8351   proto_tree *cap_info_tree;
8352
8353   cap_info_item = proto_tree_add_item(tree, hf_ieee80211_tag_qos_cap_qos_info, tvb, offset, 1, ENC_NA);
8354   cap_info_tree = proto_item_add_subtree(cap_info_item, ett_qos_info_field_tree);
8355   switch (ftype) {
8356     case MGT_ASSOC_REQ:
8357     case MGT_PROBE_REQ:
8358     case MGT_REASSOC_REQ:
8359     {
8360       /* To AP so decode as STA: Figure 33h-QoS Info field when set by a non-AP QSTA */
8361       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_vo_uapsd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8362       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_vi_uapsd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8363       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_bk_uapsd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8364       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_be_uapsd, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8365       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_qack, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8366       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_max_sp_length, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8367       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_more_data_ack, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8368       break;
8369     }
8370     case MGT_BEACON:
8371     case MGT_PROBE_RESP:
8372     case MGT_ASSOC_RESP:
8373     case MGT_REASSOC_RESP:
8374     {
8375       /* From AP so decode as AP: Figure 33g-QoS Info field when sent by a QAP */
8376       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_edca_upd_cnt, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8377       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_qack, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8378       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_queue_req, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8379       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_txop_req, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8380       proto_tree_add_item(cap_info_tree, hf_ieee80211_qos_info_field_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8381       break;
8382     }
8383     default:
8384         expert_add_info_format(pinfo, cap_info_item, PI_UNDECODED, PI_WARN, "Could not deduce direction to decode correctly, ftype %u", ftype);
8385       break;
8386   }
8387
8388   return offset + 1;
8389 }
8390
8391 /* 7.3.2.25 RSN information element */
8392 static int
8393 dissect_rsn_ie(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
8394                int offset, guint32 tag_len)
8395 {
8396   proto_item *rsn_gcs_item, *rsn_pcs_item, *rsn_akms_item, *rsn_cap_item, *rsn_pmkid_item, *rsn_gmcs_item;
8397   proto_item *rsn_sub_pcs_item, *rsn_sub_akms_item;
8398   proto_item *rsn_pcs_count, *rsn_akms_count, *rsn_pmkid_count;
8399   proto_tree *rsn_gcs_tree, *rsn_pcs_tree, *rsn_akms_tree, *rsn_cap_tree, *rsn_pmkid_tree, *rsn_gmcs_tree;
8400   proto_tree *rsn_sub_pcs_tree, *rsn_sub_akms_tree;
8401   guint16     pcs_count, akms_count, pmkid_count;
8402   guint       ii;
8403   int         tag_end = offset + tag_len;
8404
8405   proto_tree_add_item(tree, hf_ieee80211_rsn_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8406   offset += 2;
8407
8408   /* 7.3.2.25.1 Group Cipher suites */
8409   rsn_gcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gcs, tvb, offset, 4, ENC_BIG_ENDIAN);
8410   rsn_gcs_tree = proto_item_add_subtree(rsn_gcs_item, ett_rsn_gcs_tree);
8411   proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
8412
8413     /* Check if OUI is 00:0F:AC (ieee80211) */
8414   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
8415   {
8416     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_80211_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8417   } else {
8418     proto_tree_add_item(rsn_gcs_tree, hf_ieee80211_rsn_gcs_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8419   }
8420   offset += 4;
8421
8422   /* 7.3.2.25.2 Pairwise Cipher suites */
8423   rsn_pcs_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8424   pcs_count = tvb_get_letohs(tvb, offset);
8425   offset += 2;
8426
8427   if (offset + (pcs_count * 4) > tag_end)
8428   {
8429     expert_add_info_format(pinfo, rsn_pcs_count, PI_MALFORMED, PI_ERROR,
8430         "Pairwise Cipher Suite Count too large, 4*%u > %d", pcs_count, tag_end - offset);
8431     pcs_count = (tag_end - offset) / 4;
8432   }
8433
8434   rsn_pcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pcs_list, tvb, offset, pcs_count * 4, ENC_NA);
8435   rsn_pcs_tree = proto_item_add_subtree(rsn_pcs_item, ett_rsn_pcs_tree);
8436   for (ii = 0; ii < pcs_count; ii++)
8437   {
8438     rsn_sub_pcs_item = proto_tree_add_item(rsn_pcs_tree, hf_ieee80211_rsn_pcs, tvb, offset, 4, ENC_BIG_ENDIAN);
8439     rsn_sub_pcs_tree = proto_item_add_subtree(rsn_sub_pcs_item, ett_rsn_sub_pcs_tree);
8440     proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
8441
8442     /* Check if OUI is 00:0F:AC (ieee80211) */
8443     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
8444     {
8445       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_80211_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
8446       proto_item_append_text(rsn_pcs_item, " %s", rsn_pcs_return(tvb_get_ntohl(tvb, offset)));
8447     } else {
8448       proto_tree_add_item(rsn_sub_pcs_tree, hf_ieee80211_rsn_pcs_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
8449     }
8450     offset += 4;
8451   }
8452
8453   if (offset >= tag_end)
8454   {
8455     return offset;
8456   }
8457
8458   /* 7.3.2.25.2 AKM suites */
8459   rsn_akms_count = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8460   akms_count = tvb_get_letohs(tvb, offset);
8461   offset += 2;
8462
8463   if (offset + (akms_count * 4) > tag_end)
8464   {
8465     expert_add_info_format(pinfo, rsn_akms_count, PI_MALFORMED, PI_ERROR,
8466         "Auth Key Management (AKM) Suite Count too large, 4*%u > %d", akms_count, tag_end - offset);
8467     akms_count = (tag_end - offset) / 4;
8468   }
8469
8470   rsn_akms_item = proto_tree_add_item(tree, hf_ieee80211_rsn_akms_list, tvb, offset, akms_count * 4, ENC_NA);
8471   rsn_akms_tree = proto_item_add_subtree(rsn_akms_item, ett_rsn_akms_tree);
8472   for (ii = 0; ii < akms_count; ii++)
8473   {
8474     rsn_sub_akms_item = proto_tree_add_item(rsn_akms_tree, hf_ieee80211_rsn_akms, tvb, offset, 4, ENC_BIG_ENDIAN);
8475     rsn_sub_akms_tree = proto_item_add_subtree(rsn_sub_akms_item, ett_rsn_sub_akms_tree);
8476     proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
8477
8478     /* Check if OUI is 00:0F:AC (ieee80211) */
8479     if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
8480     {
8481       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_80211_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
8482       proto_item_append_text(rsn_akms_item, " %s", rsn_akms_return(tvb_get_ntohl(tvb, offset)));
8483     } else {
8484       proto_tree_add_item(rsn_sub_akms_tree, hf_ieee80211_rsn_akms_type, tvb, offset+3, 1, ENC_BIG_ENDIAN);
8485     }
8486     offset += 4;
8487   }
8488
8489   /* 7.3.2.25.3 RSN capabilities */
8490   rsn_cap_item = proto_tree_add_item(tree, hf_ieee80211_rsn_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8491   rsn_cap_tree = proto_item_add_subtree(rsn_cap_item, ett_rsn_cap_tree);
8492
8493   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_preauth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8494   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_no_pairwise, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8495   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_ptksa_replay_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8496   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_gtksa_replay_counter, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8497   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_mfpr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8498   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_mfpc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8499   proto_tree_add_item(rsn_cap_tree, hf_ieee80211_rsn_cap_peerkey, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8500   offset += 2;
8501   if (offset >= tag_end)
8502   {
8503     return offset;
8504   }
8505   /* 7.3.2.25.4 PMKID */
8506   rsn_pmkid_count = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8507   pmkid_count = tvb_get_letohs(tvb, offset);
8508   offset += 2;
8509
8510   if (offset + (pmkid_count * 16) > tag_end)
8511   {
8512     expert_add_info_format(pinfo, rsn_pmkid_count, PI_MALFORMED, PI_ERROR,
8513         "PMKID Count too large, 16*%u > %d", pmkid_count, tag_end - offset);
8514     pmkid_count = (tag_end - offset) / 16;
8515   }
8516
8517   rsn_pmkid_item = proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid_list, tvb, offset, pmkid_count * 16, ENC_NA);
8518   rsn_pmkid_tree = proto_item_add_subtree(rsn_pmkid_item, ett_rsn_pmkid_tree);
8519   for (ii = 0; ii < pmkid_count; ii++)
8520   {
8521     proto_tree_add_item(rsn_pmkid_tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
8522     offset += 16;
8523   }
8524
8525   if (offset >= tag_end)
8526   {
8527     return offset;
8528   }
8529   /* Group Management Cipher Suite (802.11w)*/
8530   rsn_gmcs_item = proto_tree_add_item(tree, hf_ieee80211_rsn_gmcs, tvb, offset, 4, ENC_BIG_ENDIAN);
8531   rsn_gmcs_tree = proto_item_add_subtree(rsn_gmcs_item, ett_rsn_gmcs_tree);
8532   proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_oui, tvb, offset, 3, ENC_BIG_ENDIAN);
8533   /* Check if OUI is 00:0F:AC (ieee80211) */
8534   if (tvb_get_ntoh24(tvb, offset) == OUI_RSN)
8535   {
8536     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_80211_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8537   } else {
8538     proto_tree_add_item(rsn_gmcs_tree, hf_ieee80211_rsn_gmcs_type, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
8539   }
8540   offset += 4;
8541
8542   return offset;
8543 }
8544 static int
8545 dissect_extended_capabilities_ie(packet_info *pinfo, proto_tree *tree,
8546                          proto_item *ti, proto_item *ti_len,
8547                          guint32 tag_len, tvbuff_t *tvb,
8548                          int offset, int tag_end)
8549 {
8550   proto_item *ti_ex_cap;
8551   proto_tree *ex_cap_tree;
8552
8553   if (tag_len < 1)
8554   {
8555     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be greater than 0", tag_len);
8556     return offset;
8557   }
8558   proto_item_append_text(ti, " (%u octet%s)", tag_len, plurality(tag_len, "", "s"));
8559
8560   /* Extended Capability octet 1 */
8561   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8562   proto_item_append_text(ti_ex_cap, " (octet 1)");
8563   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap1);
8564   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b0, tvb, offset, 1, ENC_NA);
8565   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b1, tvb, offset, 1, ENC_NA);
8566   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b2, tvb, offset, 1, ENC_NA);
8567   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b3, tvb, offset, 1, ENC_NA);
8568   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b4, tvb, offset, 1, ENC_NA);
8569   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b5, tvb, offset, 1, ENC_NA);
8570   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b6, tvb, offset, 1, ENC_NA);
8571   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b7, tvb, offset, 1, ENC_NA);
8572   offset += 1;
8573
8574   /* Extended Capability octet 2 */
8575   if (offset >= tag_end) {
8576     return offset;
8577   }
8578   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8579   proto_item_append_text(ti_ex_cap, " (octet 2)");
8580   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap2);
8581   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b8, tvb, offset, 1, ENC_NA);
8582   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b9, tvb, offset, 1, ENC_NA);
8583   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b10, tvb, offset, 1, ENC_NA);
8584   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b11, tvb, offset, 1, ENC_NA);
8585   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b12, tvb, offset, 1, ENC_NA);
8586   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b13, tvb, offset, 1, ENC_NA);
8587   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b14, tvb, offset, 1, ENC_NA);
8588   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b15, tvb, offset, 1, ENC_NA);
8589   offset += 1;
8590
8591   /* Extended Capability octet 3 */
8592   if (offset >= tag_end) {
8593     return offset;
8594   }
8595   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8596   proto_item_append_text(ti_ex_cap, " (octet 3)");
8597   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_ex_cap3);
8598   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b16, tvb, offset, 1, ENC_NA);
8599   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b17, tvb, offset, 1, ENC_NA);
8600   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b18, tvb, offset, 1, ENC_NA);
8601   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b19, tvb, offset, 1, ENC_NA);
8602   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b20, tvb, offset, 1, ENC_NA);
8603   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b21, tvb, offset, 1, ENC_NA);
8604   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b22, tvb, offset, 1, ENC_NA);
8605   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b23, tvb, offset, 1, ENC_NA);
8606   offset += 1;
8607
8608   /* Extended Capability octet 4 */
8609   if (offset >= tag_end) {
8610     return offset;
8611   }
8612   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8613   proto_item_append_text(ti_ex_cap, " (octet 4)");
8614   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap4);
8615   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b24, tvb, offset, 1, ENC_NA);
8616   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b25, tvb, offset, 1, ENC_NA);
8617   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b26, tvb, offset, 1, ENC_NA);
8618   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b27, tvb, offset, 1, ENC_NA);
8619   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b28, tvb, offset, 1, ENC_NA);
8620   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b29, tvb, offset, 1, ENC_NA);
8621   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b30, tvb, offset, 1, ENC_NA);
8622   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b31, tvb, offset, 1, ENC_NA);
8623   offset += 1;
8624
8625   /* Extended Capability octet 5 */
8626   if (offset >= tag_end) {
8627     return offset;
8628   }
8629   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8630   proto_item_append_text(ti_ex_cap, " (octet 5)");
8631   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap5);
8632   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b32, tvb, offset, 1, ENC_NA);
8633   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b33, tvb, offset, 1, ENC_NA);
8634   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b34, tvb, offset, 1, ENC_NA);
8635   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b35, tvb, offset, 1, ENC_NA);
8636   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b36, tvb, offset, 1, ENC_NA);
8637   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b37, tvb, offset, 1, ENC_NA);
8638   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b38, tvb, offset, 1, ENC_NA);
8639   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b39, tvb, offset, 1, ENC_NA);
8640   offset += 1;
8641
8642   /* Extended Capability octet 6 */
8643   if (offset >= tag_end) {
8644     return offset;
8645   }
8646   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8647   proto_item_append_text(ti_ex_cap, " (octet 6)");
8648   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap6);
8649   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b40, tvb, offset, 1, ENC_NA);
8650   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_serv_int_granularity, tvb, offset, 1, ENC_NA);
8651   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b44, tvb, offset, 1, ENC_NA);
8652   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b45, tvb, offset, 1, ENC_NA);
8653   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b46, tvb, offset, 1, ENC_NA);
8654   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b47, tvb, offset, 1, ENC_NA);
8655   offset += 1;
8656
8657
8658   /* Extended Capability octet 7 */
8659   if (offset >= tag_end) {
8660     return offset;
8661   }
8662   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8663   proto_item_append_text(ti_ex_cap, " (octet 7)");
8664   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap7);
8665   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_b48, tvb, offset, 1, ENC_NA);
8666   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o7, tvb, offset, 1, ENC_NA);
8667   offset += 1;
8668
8669   /* Extended Capability octet 8 */
8670   if (offset >= tag_end) {
8671     return offset;
8672   }
8673   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_extended_capabilities, tvb, offset, 1, ENC_NA);
8674   proto_item_append_text(ti_ex_cap, " (octet 8)");
8675   ex_cap_tree = proto_item_add_subtree(ti_ex_cap, ett_tag_ex_cap8);
8676   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_extended_capabilities_o8, tvb, offset, 1, ENC_NA);
8677   offset += 1;
8678
8679   return offset;
8680 }
8681 static int
8682 dissect_vht_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset)
8683 {
8684   proto_item *ti;
8685   proto_tree *mcs_tree, *rx_mcs_tree, *tx_mcs_tree;
8686
8687   /* 8 byte Supported MCS set */
8688   ti = proto_tree_add_item(tree, hf_ieee80211_vht_mcsset, tvb, offset, 8, ENC_NA);
8689
8690   mcs_tree = proto_item_add_subtree(ti, ett_vht_mcsset_tree);
8691
8692   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8693   rx_mcs_tree = proto_item_add_subtree(ti, ett_vht_rx_mcsbit_tree);
8694
8695   /* B0 - B15 */
8696   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8697   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8698   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8699   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8700   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8701   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8702   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8703   proto_tree_add_item(rx_mcs_tree, hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8704
8705   offset += 2;
8706   /* B16 - B28 13 bits*/
8707   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_rx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8708
8709   /* B29 - B31 2 reserved bits*/
8710
8711   offset += 2;
8712   /* B32 - B47 */
8713
8714   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8715   tx_mcs_tree = proto_item_add_subtree(ti, ett_vht_tx_mcsbit_tree);
8716   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8717   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8718   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8719   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8720   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8721   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8722   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8723   proto_tree_add_item(tx_mcs_tree, hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8724
8725   offset += 2;
8726   /* B48 - B60 13 bits */
8727   proto_tree_add_item(mcs_tree, hf_ieee80211_vht_mcsset_tx_highest_long_gi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8728   /* B61 - B63 2 reserved bits*/
8729
8730   offset += 2;
8731   return offset;
8732 }
8733
8734 static int
8735 dissect_vht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
8736          guint32 tag_len, proto_item *ti_len)
8737 {
8738   proto_item *cap_item;
8739   proto_tree *cap_tree;
8740
8741   if (tag_len != 12) {
8742     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
8743                            "VHT Capabilities IE length %u wrong, must be = 12", tag_len);
8744     return offset;
8745   }
8746
8747   /* 4 byte VHT Capabilities  Info*/
8748   cap_item = proto_tree_add_item(tree, hf_ieee80211_vht_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8749
8750   cap_tree = proto_item_add_subtree(cap_item, ett_vht_cap_tree);
8751
8752   /* B0 - B1 2 bits */
8753   proto_tree_add_item(cap_tree, hf_ieee80211_vht_max_mpdu_length, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8754   /* B2 - B3 2 bits*/
8755   proto_tree_add_item(cap_tree, hf_ieee80211_vht_supported_chan_width_set, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8756
8757   /* B4 - B7 4x 1 bit fields */
8758   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_ldpc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8759   proto_tree_add_item(cap_tree, hf_ieee80211_vht_short_gi_for_80, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8760   proto_tree_add_item(cap_tree, hf_ieee80211_vht_short_gi_for_160, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8761   proto_tree_add_item(cap_tree, hf_ieee80211_vht_tx_stbc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8762
8763   /* End of first byte */
8764
8765   /* B8 - B10 3 bit field */
8766   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_stbc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8767
8768   /* B11 - B12 2x 1 bit fields */
8769   proto_tree_add_item(cap_tree, hf_ieee80211_vht_su_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8770   proto_tree_add_item(cap_tree, hf_ieee80211_vht_su_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8771
8772   /* B13 - B15 3 bit field */
8773   proto_tree_add_item(cap_tree, hf_ieee80211_vht_beamformer_antennas, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8774
8775   /* End of second byte */
8776
8777   /* B16 - B18 */
8778   proto_tree_add_item(cap_tree, hf_ieee80211_vht_sounding_dimensions, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8779   /* B19 */
8780   proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformer_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8781
8782   /* B20 - B22 2x 1 bit fields */
8783   proto_tree_add_item(cap_tree, hf_ieee80211_vht_mu_beamformee_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8784   proto_tree_add_item(cap_tree, hf_ieee80211_vht_txop_ps, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8785   proto_tree_add_item(cap_tree, hf_ieee80211_vht_var_htc_field, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8786
8787   /* B23 - B25 3 bit field which takes us 2 bits into next byte */
8788   proto_tree_add_item(cap_tree, hf_ieee80211_vht_max_ampdu, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8789
8790   /* B26 - B27 2 bit field */
8791   proto_tree_add_item(cap_tree, hf_ieee80211_vht_link_adaptation_cap, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8792
8793   /* B28 - B29 2x 1 bit fields */
8794   proto_tree_add_item(cap_tree, hf_ieee80211_vht_rx_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8795   proto_tree_add_item(cap_tree, hf_ieee80211_vht_tx_pattern, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8796
8797   /* B30 - B31 Reserved */
8798   proto_tree_add_item(cap_tree, hf_ieee80211_vht_reserv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
8799
8800   offset += 4;
8801
8802   /* 8 byte MCS set */
8803   offset = dissect_vht_mcs_set(tree, tvb, offset);
8804
8805   return offset;
8806 }
8807
8808 static int
8809 dissect_vht_operation_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
8810          guint32 tag_len, proto_item *ti_len)
8811 {
8812   proto_item *op_item, *ti;
8813   proto_tree *op_tree, *basic_mcs_tree;
8814
8815   if (tag_len != 5) {
8816     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
8817                            "VHT Operation IE length %u wrong, must be = 5", tag_len);
8818     return offset;
8819   }
8820
8821   /* 3 byte VHT Operation Info*/
8822   op_item = proto_tree_add_item(tree, hf_ieee80211_vht_op, tvb, offset, 3, ENC_NA);
8823   op_tree = proto_item_add_subtree(op_item, ett_vht_op_tree);
8824   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_width, tvb, offset, 1, ENC_LITTLE_ENDIAN);
8825   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center0, tvb, offset+1, 1, ENC_LITTLE_ENDIAN);
8826   proto_tree_add_item(op_tree, hf_ieee80211_vht_op_channel_center1, tvb, offset+2, 1, ENC_LITTLE_ENDIAN);
8827
8828   offset += 3;
8829   /* VHT Basic MCS Set */
8830   ti = proto_tree_add_item(tree, hf_ieee80211_vht_op_basic_mcs_map, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8831   basic_mcs_tree = proto_item_add_subtree(ti, ett_vht_basic_mcsbit_tree);
8832   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_1_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8833   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_2_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8834   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_3_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8835   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_4_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8836   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_5_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8837   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_6_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8838   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_7_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8839   proto_tree_add_item(basic_mcs_tree, hf_ieee80211_vht_op_max_basic_mcs_for_8_ss, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8840
8841   offset += 2;
8842
8843   return offset;
8844 }
8845
8846
8847 static void
8848 dissect_mobility_domain(proto_tree *tree, tvbuff_t *tvb, int offset,
8849                         guint32 tag_len)
8850 {
8851   if (tag_len < 3) {
8852     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
8853                           "MDIE content length must be at least 3 bytes");
8854     return;
8855   }
8856
8857   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_mdid,
8858                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8859   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab,
8860                       tvb, offset + 2, 1, ENC_BIG_ENDIAN);
8861   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
8862                       tvb, offset + 2, 1, ENC_BIG_ENDIAN);
8863   proto_tree_add_item(tree, hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
8864                       tvb, offset + 2, 1, ENC_BIG_ENDIAN);
8865 }
8866
8867 static void
8868 dissect_fast_bss_transition(proto_tree *tree, tvbuff_t *tvb, int offset,
8869                             guint32 tag_len)
8870 {
8871   int end = offset + tag_len;
8872   if (tag_len < 82) {
8873     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
8874                           "FTIE content length must be at least 82 bytes");
8875     return;
8876   }
8877
8878   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic_control,
8879                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8880   proto_tree_add_item(tree, hf_ieee80211_tag_ft_element_count,
8881                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
8882   offset += 2;
8883   proto_tree_add_item(tree, hf_ieee80211_tag_ft_mic,
8884                       tvb, offset, 16, ENC_NA);
8885   offset += 16;
8886   proto_tree_add_item(tree, hf_ieee80211_tag_ft_anonce,
8887                       tvb, offset, 32, ENC_NA);
8888   offset += 32;
8889   proto_tree_add_item(tree, hf_ieee80211_tag_ft_snonce,
8890                       tvb, offset, 32, ENC_NA);
8891   offset += 32;
8892
8893   while (offset + 2 <= end) {
8894     guint8 id, len;
8895     int s_end;
8896     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_id,
8897                         tvb, offset, 1, ENC_BIG_ENDIAN);
8898     id = tvb_get_guint8(tvb, offset);
8899     offset += 1;
8900
8901     proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_len,
8902                         tvb, offset, 1, ENC_BIG_ENDIAN);
8903     len = tvb_get_guint8(tvb, offset);
8904     offset += 1;
8905
8906     if (offset + len > end) {
8907       proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset,
8908                             end - offset, "Invalid FTIE subelement");
8909       return;
8910     }
8911
8912     s_end = offset + len;
8913     switch (id) {
8914     case 1:
8915       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r1kh_id,
8916                           tvb, offset, len, ENC_NA);
8917       break;
8918     case 2:
8919       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_info,
8920                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
8921       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_id,
8922                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
8923       offset += 2;
8924       if (offset > s_end)
8925         break;
8926       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key_length,
8927                           tvb, offset, 1, ENC_BIG_ENDIAN);
8928       offset += 1;
8929       if (offset > s_end)
8930         break;
8931       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_rsc,
8932                           tvb, offset, 8, ENC_NA);
8933       offset += 8;
8934       if (offset > s_end)
8935         break;
8936       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_gtk_key,
8937                           tvb, offset, s_end - offset, ENC_NA);
8938       break;
8939     case 3:
8940       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_r0kh_id,
8941                           tvb, offset, len, ENC_ASCII|ENC_NA);
8942       break;
8943     case 4:
8944       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_id,
8945                           tvb, offset, 2, ENC_LITTLE_ENDIAN);
8946       offset += 2;
8947       if (offset > s_end)
8948         break;
8949       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_ipn,
8950                           tvb, offset, 6, ENC_NA);
8951       offset += 6;
8952       if (offset > s_end)
8953         break;
8954       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key_length,
8955                           tvb, offset, 1, ENC_BIG_ENDIAN);
8956       offset += 1;
8957       if (offset > s_end)
8958         break;
8959       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_igtk_key,
8960                           tvb, offset, 24, ENC_NA);
8961       break;
8962     default:
8963       proto_tree_add_item(tree, hf_ieee80211_tag_ft_subelem_data,
8964                           tvb, offset, len, ENC_NA);
8965       break;
8966     }
8967     offset = s_end;
8968   }
8969 }
8970
8971 static void
8972 dissect_mmie(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
8973 {
8974   if (tag_len < 16) {
8975     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
8976                           "MMIE content length must be at least 16 bytes");
8977     return;
8978   }
8979
8980   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_keyid, tvb, offset, 2, ENC_LITTLE_ENDIAN);
8981   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_ipn, tvb, offset + 2, 6,
8982                       ENC_NA);
8983   proto_tree_add_item(tree, hf_ieee80211_tag_mmie_mic, tvb, offset + 8, 8,
8984                       ENC_NA);
8985 }
8986
8987 static void
8988 dissect_ssid_list(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
8989 {
8990   int end = offset + tag_len;
8991   proto_item *ssid;
8992   proto_tree *entry;
8993   gboolean first = TRUE;
8994
8995   while (offset + 1 <= end) {
8996     guint8 len = tvb_get_guint8(tvb, offset + 1);
8997     guint8 *str;
8998
8999     if (offset + 2 + len > end)
9000       break;
9001
9002     str = tvb_get_ephemeral_string(tvb, offset + 2, len);
9003     proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
9004     first = FALSE;
9005     ssid = proto_tree_add_text(tree, tvb, offset, 2 + len, "SSID: %s", str);
9006     entry = proto_item_add_subtree(ssid, ett_ssid_list);
9007     proto_tree_add_item(entry, hf_ieee80211_tag_number, tvb, offset, 1,
9008                         ENC_BIG_ENDIAN);
9009     offset++;
9010     proto_tree_add_uint(entry, hf_ieee80211_tag_length, tvb, offset, 1, len);
9011     offset++;
9012     proto_tree_add_item(entry, hf_ieee80211_tag_ssid, tvb, offset, len,
9013                         ENC_ASCII|ENC_NA);
9014     offset += len;
9015   }
9016 }
9017
9018 static void
9019 dissect_link_identifier(proto_tree *tree, tvbuff_t *tvb, int offset,
9020                         guint32 tag_len)
9021 {
9022   if (tag_len < 18) {
9023     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9024                           "Link Identifier content length must be at least "
9025                           "18 bytes");
9026     return;
9027   }
9028
9029   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_bssid, tvb,
9030                       offset, 6, ENC_NA);
9031   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_init_sta, tvb,
9032                       offset + 6, 6, ENC_NA);
9033   proto_tree_add_item(tree, hf_ieee80211_tag_link_id_resp_sta, tvb,
9034                       offset + 12, 6, ENC_NA);
9035 }
9036
9037 static void
9038 dissect_wakeup_schedule(proto_tree *tree, tvbuff_t *tvb, int offset,
9039                         guint32 tag_len)
9040 {
9041   if (tag_len < 18) {
9042     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9043                           "Wakeup Schedule content length must be at least "
9044                           "18 bytes");
9045     return;
9046   }
9047
9048   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_offset, tvb,
9049                       offset, 4, ENC_LITTLE_ENDIAN);
9050   offset += 4;
9051
9052   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_interval, tvb,
9053                       offset, 4, ENC_LITTLE_ENDIAN);
9054   offset += 4;
9055
9056   proto_tree_add_item(tree,
9057                       hf_ieee80211_tag_wakeup_schedule_awake_window_slots, tvb,
9058                       offset, 4, ENC_LITTLE_ENDIAN);
9059   offset += 4;
9060
9061   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
9062                       tvb, offset, 4, ENC_LITTLE_ENDIAN);
9063   offset += 4;
9064
9065   proto_tree_add_item(tree, hf_ieee80211_tag_wakeup_schedule_idle_count, tvb,
9066                       offset, 2, ENC_LITTLE_ENDIAN);
9067 }
9068
9069 static void
9070 dissect_channel_switch_timing(proto_tree *tree, tvbuff_t *tvb, int offset,
9071                               guint32 tag_len)
9072 {
9073   if (tag_len < 4) {
9074     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9075                           "Channel Switch Timing content length must be at "
9076                           "least 4 bytes");
9077     return;
9078   }
9079
9080   proto_tree_add_item(tree, hf_ieee80211_tag_channel_switch_timing_switch_time,
9081                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9082   offset += 2;
9083
9084   proto_tree_add_item(tree,
9085                       hf_ieee80211_tag_channel_switch_timing_switch_timeout,
9086                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9087 }
9088
9089 static void
9090 dissect_pti_control(proto_tree *tree, tvbuff_t *tvb, int offset,
9091                     guint32 tag_len)
9092 {
9093   if (tag_len < 3) {
9094     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9095                           "PTI Control content length must be at least "
9096                           "3 bytes");
9097     return;
9098   }
9099
9100   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_tid, tvb,
9101                       offset, 1, ENC_BIG_ENDIAN);
9102   offset += 1;
9103
9104   proto_tree_add_item(tree, hf_ieee80211_tag_pti_control_sequence_control, tvb,
9105                       offset, 2, ENC_LITTLE_ENDIAN);
9106 }
9107
9108 static void
9109 dissect_pu_buffer_status(proto_tree *tree, tvbuff_t *tvb, int offset,
9110                          guint32 tag_len)
9111 {
9112   if (tag_len < 1) {
9113     proto_tree_add_string(tree, hf_ieee80211_tag_interpretation, tvb, offset, tag_len,
9114                           "PU Buffer Status content length must be at least "
9115                           "1 byte");
9116     return;
9117   }
9118
9119   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_bk, tvb,
9120                       offset, 1, ENC_BIG_ENDIAN);
9121   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_be, tvb,
9122                       offset, 1, ENC_BIG_ENDIAN);
9123   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_vi, tvb,
9124                       offset, 1, ENC_BIG_ENDIAN);
9125   proto_tree_add_item(tree, hf_ieee80211_tag_pu_buffer_status_ac_vo, tvb,
9126                       offset, 1, ENC_BIG_ENDIAN);
9127 }
9128
9129 static void
9130 dissect_timeout_interval(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset,
9131                          guint32 tag_len)
9132 {
9133   proto_item *pi;
9134
9135   pi = proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_type, tvb,
9136                            offset, 1, ENC_BIG_ENDIAN);
9137   if (tag_len < 5) {
9138     expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
9139                            "Timeout Interval content length must be at least "
9140                           "5 bytes");
9141     return;
9142   }
9143
9144   proto_tree_add_item(tree, hf_ieee80211_tag_timeout_int_value, tvb,
9145                       offset + 1, 4, ENC_LITTLE_ENDIAN);
9146 }
9147
9148 static int
9149 dissect_ric_data(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
9150                          guint32 tag_len, proto_item *ti, proto_item *ti_len, int ftype)
9151 {
9152
9153   proto_tree  *sub_tree;
9154   guint8       desc_cnt = 0;
9155   guint32      next_ie;
9156   int          offset_r = 0;
9157
9158   if (tag_len !=  4)  {
9159     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9160                            "RIC Data Length must be 4 bytes");
9161     return 0;
9162   }
9163
9164   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_id, tvb,
9165                            offset, 1, ENC_LITTLE_ENDIAN);
9166   offset += 1;
9167
9168   desc_cnt = tvb_get_guint8(tvb,offset);
9169   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_desc_cnt, tvb,
9170                            offset, 1, ENC_LITTLE_ENDIAN);
9171   offset += 1;
9172
9173   proto_tree_add_item(tree, hf_ieee80211_tag_ric_data_status_code, tvb,
9174                            offset, 2, ENC_LITTLE_ENDIAN);
9175   offset += 2;
9176
9177   /* Our Design is such that all the Resource request IE's part of the RIC
9178    * must be in the sub tree of RIC for better readability
9179    * Even omnipeek does the same way.
9180    */
9181   sub_tree = proto_item_add_subtree(tree, ett_tag_ric_data_desc_ie);
9182
9183   proto_item_append_text(ti, " :Resource Descriptor List");
9184   if (desc_cnt == 0) {
9185     proto_item_append_text(ti, " :0 (Weird?)");
9186   }
9187
9188   while ( desc_cnt !=0 ) {
9189
9190     next_ie = tvb_get_guint8(tvb,offset);
9191     proto_item_append_text(ti, " :(%d:%s)", desc_cnt,val_to_str_ext(next_ie, &tag_num_vals_ext, "Reserved (%d)"));
9192     /* Recursive call to avoid duplication of code*/
9193     offset_r = add_tagged_field(pinfo, sub_tree, tvb, offset, ftype);
9194     if (offset_r == 0 )/* should never happen, returns a min of 2*/
9195       break;
9196     /* This will ensure that the IE after RIC is processed
9197      * only once. This gives us a good looking RIC IE :-)
9198      */
9199     tag_len += offset_r;
9200     desc_cnt--;
9201   }
9202
9203   return tag_len;
9204 }
9205
9206 static int
9207 dissect_ric_descriptor(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset,
9208                          guint32 tag_len, proto_item *ti, proto_item *ti_len)
9209 {
9210
9211   guint8       rsrc_type = 0;
9212
9213   if (tag_len < 1)  {
9214     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9215                            "RIC Data Length must be at least 1 byte");
9216     return 0;
9217   }
9218
9219   rsrc_type = tvb_get_guint8(tvb,offset);
9220   proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_rsrc_type, tvb,
9221                            offset, 1, ENC_LITTLE_ENDIAN);
9222   offset += 1;
9223
9224   if (rsrc_type == 1) {
9225     /* Block ACK params
9226      * 802.11-2012: 8.4.2.53 RIC Descriptor element
9227      * Block Ack parameter set as defined in 8.4.1.14,
9228      * Block Ack timeout value as defined in 8.4.1.15, and
9229      * Block Ack starting sequence control as defined in 8.3.1.8
9230      */
9231     /* TODO: Still figuring out how to parse these ones,
9232      * need a sample capture with at least HEX Dump
9233      */
9234     proto_item_append_text(ti, " :RIC Descriptors: Block ACK Params");
9235     proto_tree_add_item(tree, hf_ieee80211_tag_ric_desc_var_params, tvb,
9236                         offset, tag_len-1, ENC_NA);
9237     offset += tag_len -1;
9238   }else {
9239     /* 0,2-255 are reserved*/
9240     proto_item_append_text(ti, " :RIC Descriptors: 0(Reserved)");
9241   }
9242   return offset;
9243 }
9244 static int
9245 dissect_mcs_set(proto_tree *tree, tvbuff_t *tvb, int offset, gboolean basic, gboolean vs)
9246 {
9247   proto_item *ti;
9248   proto_tree *mcs_tree, *bit_tree;
9249
9250   /* 16 byte Supported MCS set */
9251   if (vs)
9252   {
9253     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset_vs, tvb, offset, 16,
9254       basic ? "Basic MCS Set" : "MCS Set");
9255   } else
9256   {
9257     ti = proto_tree_add_string(tree, hf_ieee80211_mcsset, tvb, offset, 16,
9258       basic ? "Basic MCS Set" : "MCS Set");
9259   }
9260   mcs_tree = proto_item_add_subtree(ti, ett_mcsset_tree);
9261
9262   /* Rx MCS Bitmask */
9263   ti = proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_rx_bitmask, tvb, offset, 10, ENC_NA);
9264   bit_tree = proto_item_add_subtree(ti, ett_mcsbit_tree);
9265
9266   /* Bits 0 - 31 */
9267   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_0to7, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9268   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_8to15, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9269   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_16to23, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9270   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_24to31, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9271   offset += 4;
9272
9273   /* Bits 32 - 52 */
9274   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_32, tvb, offset , 4, ENC_LITTLE_ENDIAN);
9275   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_33to38, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9276   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_39to52, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9277   offset += 2;
9278
9279   /* Bits 53 - 76 */
9280   proto_tree_add_item(bit_tree, hf_ieee80211_mcsset_rx_bitmask_53to76, tvb, offset, 4, ENC_LITTLE_ENDIAN);
9281   offset += 4;
9282
9283   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_highest_data_rate, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9284   offset += 2;
9285
9286   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_mcs_set_defined, tvb, offset, 1,
9287       ENC_LITTLE_ENDIAN);
9288   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal, tvb, offset, 1,
9289       ENC_LITTLE_ENDIAN);
9290   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_max_spatial_streams, tvb, offset, 1,
9291       ENC_LITTLE_ENDIAN);
9292   proto_tree_add_item(mcs_tree, hf_ieee80211_mcsset_tx_unequal_modulation, tvb, offset, 1,
9293       ENC_LITTLE_ENDIAN);
9294   offset += 1;
9295
9296   offset += 3;
9297   return offset;
9298 }
9299
9300 /*  802.11n D1.10 - HT Information IE  */
9301 static int
9302 dissect_ht_info_ie_1_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
9303                        guint32 tag_len, proto_item *ti_len)
9304 {
9305   proto_item *cap_item;
9306   proto_tree *cap_tree;
9307
9308   cap_tree = tree;
9309
9310   if (tag_len < 22) {
9311     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9312                            "HT Information IE content length %u wrong, must be at least 22 bytes", tag_len);
9313     return offset;
9314   }
9315
9316
9317   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_primary_channel, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9318   offset += 1;
9319
9320   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter1, tvb,
9321                     offset, 1, ENC_LITTLE_ENDIAN);
9322   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter1_tree);
9323   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_secondary_channel_offset, tvb,
9324                     offset, 1, ENC_LITTLE_ENDIAN);
9325   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_channel_width, tvb,
9326                     offset, 1, ENC_LITTLE_ENDIAN);
9327   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_rifs_mode, tvb,
9328                     offset, 1, ENC_LITTLE_ENDIAN);
9329   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_psmp_stas_only, tvb,
9330                     offset, 1, ENC_LITTLE_ENDIAN);
9331   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_service_interval_granularity, tvb,
9332                     offset, 1, ENC_LITTLE_ENDIAN);
9333   offset += 1;
9334
9335   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter2, tvb,
9336                     offset, 2, ENC_LITTLE_ENDIAN);
9337   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter2_tree);
9338   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_operating_mode, tvb,
9339                     offset, 1, ENC_LITTLE_ENDIAN);
9340   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_non_greenfield_sta_present, tvb,
9341                     offset, 1, ENC_LITTLE_ENDIAN);
9342   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_transmit_burst_limit, tvb,
9343                     offset, 1, ENC_LITTLE_ENDIAN);
9344   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_obss_non_ht_stas_present, tvb,
9345                     offset, 1, ENC_LITTLE_ENDIAN);
9346   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_1, tvb,
9347                     offset, 2, ENC_LITTLE_ENDIAN);
9348   offset += 2;
9349
9350   cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_info_delimiter3, tvb,
9351                     offset, 2, ENC_LITTLE_ENDIAN);
9352   cap_tree = proto_item_add_subtree(cap_item, ett_ht_info_delimiter3_tree);
9353   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_2, tvb,
9354                     offset, 1, ENC_LITTLE_ENDIAN);
9355   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_dual_beacon, tvb,
9356                     offset, 1, ENC_LITTLE_ENDIAN);
9357   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_dual_cts_protection, tvb,
9358                     offset, 1, ENC_LITTLE_ENDIAN);
9359   offset += 1;
9360   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_secondary_beacon, tvb,
9361                     offset, 1, ENC_LITTLE_ENDIAN);
9362   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_lsig_txop_protection_full_support, tvb,
9363                     offset, 1, ENC_LITTLE_ENDIAN);
9364   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_pco_active, tvb,
9365                     offset, 1, ENC_LITTLE_ENDIAN);
9366   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_pco_phase, tvb,
9367                     offset, 1, ENC_LITTLE_ENDIAN);
9368   proto_tree_add_item(cap_tree, hf_ieee80211_ht_info_reserved_3, tvb,
9369                     offset, 1, ENC_LITTLE_ENDIAN);
9370   offset += 1;
9371
9372   offset = dissect_mcs_set(tree, tvb, offset, TRUE, FALSE);
9373
9374   return offset;
9375 }
9376
9377
9378 static int
9379 dissect_wapi_param_set(tvbuff_t *tvb, packet_info *pinfo,
9380                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
9381                           proto_item *ti, int ftype)
9382 {
9383   /* Parse the WAPI Parameter Set IE Here*/
9384   proto_item *item;
9385   proto_tree *subtree;
9386   guint16 loop_cnt, version  = 1, akm_cnt  = 1, ucast_cnt = 1, bkid_cnt = 1;
9387   guint8  akm_suite_type = 0, ucast_cipher_type = 0, mcast_cipher_type = 0;
9388
9389   version = tvb_get_letohs(tvb, offset);
9390   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9391   offset += 2;
9392
9393   /*MIN: 2 + (2+4)+ (2+4) + 4 + 2 + 0 (BKID CNT and LIST)  =20*/
9394   if (tag_len < 20) {
9395       expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9396                 "tag_len is  %d, its neither WAPI not BSS-AC-Access-Delay", tag_len);
9397     return offset;
9398   }
9399
9400   if (version != 1) {
9401     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9402                            "Version of WAPI protocol is %d, must be = 1", version);
9403     return offset;
9404   }
9405
9406   /* AKM Suites: list can't be 0*/
9407   akm_cnt = tvb_get_letohs(tvb, offset);
9408   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_akm_suite_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9409   offset += 2;
9410   if (akm_cnt != 0) {
9411     proto_item_append_text(ti, " : AKM Suite List:");
9412     for (loop_cnt = 0; loop_cnt < akm_cnt; loop_cnt++) {
9413       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_akm_tree);
9414       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_oui, tvb, offset, 3, ENC_NA);
9415       offset += 3;
9416       akm_suite_type = tvb_get_guint8(tvb,offset);
9417       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_akm_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9418       offset += 1;
9419       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1,val_to_str(akm_suite_type,
9420       ieee80211_wapi_suite_type_short,"Reserved: %d"));
9421     }
9422     proto_item_append_text(ti, " /");
9423   } else {
9424     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Number of AKM suites is 0, must be min 1");
9425     return offset;
9426
9427   }
9428   /* Unicast Cipher Suites: list can't be 0*/
9429   ucast_cnt = tvb_get_letohs(tvb, offset);
9430   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
9431                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9432   offset += 2;
9433   if (ucast_cnt != 0) {
9434     proto_item_append_text(ti, " Unicast Cipher List:");
9435     for (loop_cnt = 0; loop_cnt < ucast_cnt; loop_cnt++) {
9436       subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_ucast_tree);
9437       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
9438       offset += 3;
9439       ucast_cipher_type = tvb_get_guint8(tvb,offset);
9440       proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9441       offset += 1;
9442       proto_item_append_text(ti, " (%d,%s)", loop_cnt+1, val_to_str(ucast_cipher_type,ieee80211_wapi_cipher_type,"Reserved: %d"));
9443     }
9444   proto_item_append_text(ti, " /");
9445   } else {
9446     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Number of Unicast Cipher suites is 0, must be min  1");
9447     return offset;
9448
9449   }
9450
9451   /* Multicast Cipher Suites*/
9452   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui, tvb, offset, 3, ENC_NA);
9453   offset += 3;
9454   mcast_cipher_type = tvb_get_guint8(tvb,offset);
9455   proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9456   offset += 1;
9457   proto_item_append_text(ti, " Multicast Cipher: %s", val_to_str(mcast_cipher_type,ieee80211_wapi_cipher_type,"Reserved: %d"));
9458
9459   /* WAPI capability*/
9460   item = proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_capab, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9461   subtree = proto_item_add_subtree(item, ett_tag_wapi_param_set_preauth_tree);
9462   proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_capab_preauth, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9463   proto_tree_add_item(subtree, hf_ieee80211_tag_wapi_param_set_capab_rsvd, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9464
9465   offset += 2;
9466   /* BKID List: The list can be 0
9467    * Applicable only for assoc/re-assoc
9468    */
9469   if (ftype == MGT_ASSOC_REQ || ftype == MGT_REASSOC_REQ ) {
9470     bkid_cnt = tvb_get_letohs(tvb, offset);
9471     proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9472     offset += 2;
9473     if (bkid_cnt != 0) {
9474       for (loop_cnt = 0; loop_cnt < bkid_cnt; loop_cnt++) {
9475         proto_tree_add_item(tree, hf_ieee80211_tag_wapi_param_set_bkid_list, tvb, offset, 16, ENC_NA);
9476         offset += 16;
9477       }
9478     }
9479   }
9480   return offset;
9481 }
9482
9483 static int dissect_bss_max_idle_period(proto_tree *tree, tvbuff_t *tvb,
9484                                        int offset)
9485 {
9486   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_period,
9487                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9488   offset += 2;
9489   proto_tree_add_item(tree, hf_ieee80211_tag_bss_max_idle_options_protected,
9490                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9491   offset++;
9492   return offset;
9493 }
9494
9495 static int add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb,
9496                             int offset, int ftype);
9497
9498 enum tfs_request_subelem_id {
9499   TFS_REQ_SUBELEM_TFS = 1,
9500   TFS_REQ_SUBELEM_VENDOR_SPECIFIC = 221
9501 };
9502
9503 static const value_string tfs_request_subelem_ids[] = {
9504   { TFS_REQ_SUBELEM_TFS, "TFS subelement" },
9505   { TFS_REQ_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
9506   { 0, NULL }
9507 };
9508
9509 static int dissect_tfs_request(packet_info *pinfo, proto_tree *tree,
9510                                tvbuff_t *tvb, int offset, guint32 tag_len,
9511                                int ftype)
9512 {
9513   int end = offset + tag_len;
9514
9515   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_id,
9516                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9517   offset++;
9518   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_delete_after_match,
9519                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9520   proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_ac_notify,
9521                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9522   offset++;
9523   if (offset + 1 >= end) {
9524     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_WARN,
9525                            "No TFS Request subelements in TFS Request");
9526     return end;
9527   }
9528
9529   while (offset + 1 < end) {
9530     guint8 id, len;
9531     int s_offset, s_end;
9532
9533     id = tvb_get_guint8(tvb, offset);
9534     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_id,
9535                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9536     offset++;
9537     len = tvb_get_guint8(tvb, offset);
9538     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem_len,
9539                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9540     offset++;
9541     if (offset + len > end) {
9542       expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
9543                              "Not enough data for TFS Request subelement");
9544       return end;
9545     }
9546     switch (id) {
9547     case TFS_REQ_SUBELEM_TFS:
9548       s_offset = offset;
9549       s_end = offset + len;
9550       while (s_offset < s_end) {
9551         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, ftype);
9552         s_offset += tlen;
9553       }
9554       break;
9555     default:
9556       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_request_subelem,
9557                           tvb, offset, len, ENC_NA);
9558       break;
9559     }
9560     offset += len;
9561   }
9562
9563   if (offset < end) {
9564     proto_tree_add_text(tree, tvb, offset, end - offset,
9565                         "Unexpected extra data");
9566     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_WARN,
9567                            "Extra data after TFS Subelements");
9568   }
9569
9570   return end;
9571 }
9572
9573 enum tfs_response_subelem_id {
9574   TFS_RESP_SUBELEM_TFS_STATUS = 1,
9575   TFS_RESP_SUBELEM_TFS = 2,
9576   TFS_RESP_SUBELEM_VENDOR_SPECIFIC = 221
9577 };
9578
9579 static const value_string tfs_response_subelem_ids[] = {
9580   { TFS_RESP_SUBELEM_TFS_STATUS, "TFS Status subelement" },
9581   { TFS_RESP_SUBELEM_TFS, "TFS subelement" },
9582   { TFS_RESP_SUBELEM_VENDOR_SPECIFIC, "Vendor Specific subelement" },
9583   { 0, NULL }
9584 };
9585
9586 static int dissect_tfs_response(packet_info *pinfo, proto_tree *tree,
9587                                 tvbuff_t *tvb, int offset, guint32 tag_len,
9588                                 int ftype)
9589 {
9590   int end = offset + tag_len;
9591
9592   while (offset + 3 <= end) {
9593     guint8 id, len;
9594     int s_offset, s_end;
9595
9596     id = tvb_get_guint8(tvb, offset);
9597     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_id,
9598                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9599     offset++;
9600     len = tvb_get_guint8(tvb, offset);
9601     proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem_len,
9602                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9603     offset++;
9604     if (offset + len > end) {
9605       expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_ERROR,
9606                              "Not enough data for TFS Request subelement");
9607       return end;
9608     }
9609     switch (id) {
9610     case TFS_RESP_SUBELEM_TFS_STATUS:
9611       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_status,
9612                           tvb, offset, 1, ENC_LITTLE_ENDIAN);
9613       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_id,
9614                           tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
9615       break;
9616     case TFS_RESP_SUBELEM_TFS:
9617       s_offset = offset;
9618       s_end = offset + len;
9619       while (s_offset < s_end) {
9620         int tlen = add_tagged_field(pinfo, tree, tvb, s_offset, ftype);
9621         s_offset += tlen;
9622       }
9623       break;
9624     default:
9625       proto_tree_add_item(tree, hf_ieee80211_tag_tfs_response_subelem,
9626                           tvb, offset, len, ENC_NA);
9627       break;
9628     }
9629
9630     offset += len;
9631   }
9632
9633   if (offset < end) {
9634     proto_tree_add_text(tree, tvb, offset, end - offset,
9635                         "Unexpected extra data");
9636     expert_add_info_format(pinfo, tree, PI_MALFORMED, PI_WARN,
9637                            "Extra data after TFS Status subelements");
9638   }
9639
9640   return end;
9641 }
9642
9643 static const value_string wnm_sleep_mode_action_types[] = {
9644   { 0, "Enter WNM-Sleep Mode" },
9645   { 1, "Exit WNM-Sleep Mode" },
9646   { 0, NULL }
9647 };
9648
9649 static const value_string wnm_sleep_mode_response_status_vals[] = {
9650   { 0, "Enter/Exit WNM-Sleep Mode Accept" },
9651   { 1, "Exit WNM-Sleep Mode Accept, GTK/IGTK update required" },
9652   { 2, "Denied. The AP is unable to perform the requested action." },
9653   { 3, "Denied temporarily. The AP is unable to perform the requested action "
9654     "at the current time. The request can be submitted again at a later time."
9655   },
9656   { 4, "Denied. Due to the pending key expiration." },
9657   { 5, "Denied. The requested action was not granted due to other WNM services "
9658     "in use by the requesting STA." },
9659   { 0, NULL }
9660 };
9661
9662 static int dissect_wnm_sleep_mode(proto_tree *tree, tvbuff_t *tvb, int offset)
9663 {
9664   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_action_type,
9665                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9666   offset++;
9667   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_response_status,
9668                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9669   offset++;
9670   proto_tree_add_item(tree, hf_ieee80211_tag_wnm_sleep_mode_interval,
9671                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
9672   offset += 2;
9673   return offset;
9674 }
9675
9676 static const value_string time_adv_timing_capab_vals[] = {
9677   { 0, "No standardized external time source" },
9678   { 1, "Timestamp offset based on UTC" },
9679   { 2, "UTC time at which the TSF timer is 0" },
9680   { 0, NULL }
9681 };
9682
9683 static int
9684 dissect_time_adv(proto_tree *tree, tvbuff_t *tvb, int offset)
9685 {
9686   guint8 capab;
9687   proto_item *item;
9688   proto_tree *subtree;
9689   struct tm tm, *now;
9690   time_t t;
9691
9692   capab = tvb_get_guint8(tvb, offset);
9693   proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_timing_capab,
9694                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
9695   offset += 1;
9696
9697   switch (capab) {
9698   case 1:
9699     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
9700                         tvb, offset, 10, ENC_NA);
9701     offset += 10;
9702
9703     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
9704                         tvb, offset, 5, ENC_NA);
9705     offset += 5;
9706     break;
9707   case 2:
9708     item = proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_value,
9709                                tvb, offset, 10, ENC_NA);
9710     subtree = proto_item_add_subtree(item, ett_tag_time_adv_tree);
9711     memset(&tm, 0, sizeof(tm));
9712     tm.tm_year = tvb_get_letohs(tvb, offset) - 1900;
9713     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_year,
9714                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
9715     offset += 2;
9716     tm.tm_mon = tvb_get_guint8(tvb, offset) - 1;
9717     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_month,
9718                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9719     offset += 1;
9720     tm.tm_mday = tvb_get_guint8(tvb, offset);
9721     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_day,
9722                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9723     offset += 1;
9724     tm.tm_hour = tvb_get_guint8(tvb, offset);
9725     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_hours,
9726                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9727     offset += 1;
9728     tm.tm_min = tvb_get_guint8(tvb, offset);
9729     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_minutes,
9730                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9731     offset += 1;
9732     tm.tm_sec = tvb_get_guint8(tvb, offset);
9733     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_seconds,
9734                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9735     offset += 1;
9736     proto_tree_add_item(subtree,
9737                         hf_ieee80211_tag_time_adv_time_value_milliseconds,
9738                         tvb, offset, 2, ENC_LITTLE_ENDIAN);
9739     offset += 2;
9740     proto_tree_add_item(subtree, hf_ieee80211_tag_time_adv_time_value_reserved,
9741                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9742     offset += 1;
9743
9744     tm.tm_isdst = -1;
9745     t = mktime(&tm);
9746     if (t != -1) {
9747       t += (time_t)(last_timestamp / 1000000);
9748       now = localtime(&t);
9749       if (now)
9750         proto_item_append_text(item,
9751                                ": current time=%u-%02u-%02u %02u:%02u:%02u",
9752                                now->tm_year + 1900, now->tm_mon + 1,
9753                                now->tm_mday, now->tm_hour, now->tm_min,
9754                                now->tm_sec);
9755     }
9756
9757     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_error,
9758                         tvb, offset, 5, ENC_NA);
9759     offset += 5;
9760
9761     proto_tree_add_item(tree, hf_ieee80211_tag_time_adv_time_update_counter,
9762                         tvb, offset, 1, ENC_LITTLE_ENDIAN);
9763     offset += 1;
9764     break;
9765   }
9766
9767   return offset;
9768 }
9769
9770 static int
9771 dissect_time_zone(proto_tree *tree, tvbuff_t *tvb, int offset,
9772                   guint32 tag_len)
9773 {
9774   proto_tree_add_item(tree, hf_ieee80211_tag_time_zone, tvb, offset, tag_len,
9775                       ENC_ASCII|ENC_NA);
9776   return offset + tag_len;
9777 }
9778
9779 static int
9780 dissect_ap_channel_report(tvbuff_t *tvb, packet_info *pinfo,
9781                           proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len,
9782                           int tag_end, proto_item *ti)
9783 {
9784   if (tag_len < 1) {
9785     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9786                            "AP Channel Report length %u wrong, must be > 1", tag_len);
9787     return offset;
9788   }
9789
9790   proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_regulatory_class, tvb,
9791                       offset, 1, ENC_LITTLE_ENDIAN);
9792   proto_item_append_text(ti, ": Regulatory Class %u, Channel List :", tvb_get_guint8(tvb, offset));
9793   offset += 1;
9794
9795   while (offset < tag_end)
9796   {
9797     proto_tree_add_item(tree, hf_ieee80211_tag_ap_channel_report_channel_list, tvb, offset, 1, ENC_NA);
9798     proto_item_append_text(ti, " %u,", tvb_get_guint8(tvb, offset));
9799     offset += 1;
9800   }
9801   return offset;
9802 }
9803 static int
9804 dissect_secondary_channel_offset_ie(tvbuff_t *tvb, packet_info *pinfo,
9805                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9806 {
9807
9808   if (tag_len != 1) {
9809     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9810                            "Secondary Channel Offset length %u wrong, must be = 1", tag_len);
9811     return offset;
9812   }
9813
9814   proto_tree_add_item(tree, hf_ieee80211_tag_secondary_channel_offset, tvb,
9815                       offset, 1, ENC_LITTLE_ENDIAN);
9816
9817   offset += 1;
9818
9819   return offset;
9820 }
9821
9822 static int
9823 dissect_bss_avg_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
9824                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9825 {
9826
9827   if (tag_len != 1) {
9828     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9829                            "BSS Average Access Delay length %u wrong, must be = 1", tag_len);
9830     return offset;
9831   }
9832
9833   proto_tree_add_item(tree, hf_ieee80211_tag_bss_ap_avg_access_delay, tvb,
9834                       offset, 1, ENC_LITTLE_ENDIAN);
9835
9836   offset += 1;
9837
9838   return offset;
9839 }
9840
9841 static int
9842 dissect_antenna_ie(tvbuff_t *tvb, packet_info *pinfo,
9843                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9844 {
9845
9846   if (tag_len != 1) {
9847     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9848                            "Antenna length %u wrong, must be = 1", tag_len);
9849     return offset;
9850   }
9851
9852   proto_tree_add_item(tree, hf_ieee80211_tag_antenna_id, tvb,
9853                       offset, 1, ENC_LITTLE_ENDIAN);
9854
9855   offset += 1;
9856
9857   return offset;
9858 }
9859
9860 static int
9861 dissect_rsni_ie(tvbuff_t *tvb, packet_info *pinfo,
9862                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9863 {
9864
9865   if (tag_len != 1) {
9866     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9867                            "RSNI length %u wrong, must be = 1", tag_len);
9868     return offset;
9869   }
9870
9871   proto_tree_add_item(tree, hf_ieee80211_tag_rsni, tvb,
9872                       offset, 1, ENC_LITTLE_ENDIAN);
9873
9874   offset += 1;
9875
9876   return offset;
9877 }
9878
9879 static int
9880 dissect_bss_available_admission_capacity_ie(tvbuff_t *tvb, packet_info *pinfo,
9881                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9882 {
9883   proto_item *ti;
9884   proto_tree *btree;
9885   guint16 bitmask;
9886   if (tag_len < 2) {
9887     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9888                            "BSS Available Admission Capacity length %u wrong, must > = 2", tag_len);
9889     return offset;
9890   }
9891
9892   ti = proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask, tvb,
9893                       offset, 2, ENC_LITTLE_ENDIAN);
9894   btree = proto_item_add_subtree(ti, ett_tag_bss_bitmask_tree);
9895   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9896   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9897   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9898   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9899   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9900   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9901   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9902   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9903   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9904   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9905   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9906   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9907   proto_tree_add_item(btree, hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9908   bitmask = tvb_get_letohs(tvb, offset);
9909   offset += 2;
9910
9911   if(bitmask & BSS_BITMASK_UP0)
9912   {
9913     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9914     offset += 2;
9915   }
9916   if(bitmask & BSS_BITMASK_UP1)
9917   {
9918     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9919     offset += 2;
9920   }
9921   if(bitmask & BSS_BITMASK_UP2)
9922   {
9923     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9924     offset += 2;
9925   }
9926   if(bitmask & BSS_BITMASK_UP3)
9927   {
9928     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9929     offset += 2;
9930   }
9931   if(bitmask & BSS_BITMASK_UP4)
9932   {
9933     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up4, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9934     offset += 2;
9935   }
9936   if(bitmask & BSS_BITMASK_UP5)
9937   {
9938     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up5, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9939     offset += 2;
9940   }
9941   if(bitmask & BSS_BITMASK_UP6)
9942   {
9943     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up6, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9944     offset += 2;
9945   }
9946   if(bitmask & BSS_BITMASK_UP7)
9947   {
9948     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_up7, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9949     offset += 2;
9950   }
9951   if(bitmask & BSS_BITMASK_AC0)
9952   {
9953     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac0, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9954     offset += 2;
9955   }
9956   if(bitmask & BSS_BITMASK_AC1)
9957   {
9958     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9959     offset += 2;
9960   }
9961   if(bitmask & BSS_BITMASK_AC2)
9962   {
9963     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9964     offset += 2;
9965   }
9966   if(bitmask & BSS_BITMASK_AC3)
9967   {
9968     proto_tree_add_item(tree, hf_ieee80211_tag_bss_avb_adm_cap_ac3, tvb, offset, 2, ENC_LITTLE_ENDIAN);
9969     offset += 2;
9970   }
9971   return offset;
9972 }
9973
9974 static int
9975 dissect_bss_ac_access_delay_ie(tvbuff_t *tvb, packet_info *pinfo,
9976                                     proto_tree *tree, int offset, guint32 tag_len, proto_item *ti_len)
9977 {
9978
9979   if (tag_len == 4) {
9980     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
9981                            "BSS AC Access Delay length %u wrong, must = 4", tag_len);
9982     return offset;
9983   }
9984
9985   /* TODO: Display the scaled representation of the average
9986     medium access delay (a big (precalculed) value_string ?)
9987     See 8.4.2.46 BSS AC Access Delay element ... */
9988
9989   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_be, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9990   offset += 1;
9991   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_bk, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9992   offset += 1;
9993   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9994   offset += 1;
9995   proto_tree_add_item(tree, hf_ieee80211_tag_bss_avg_ac_access_delay_vo, tvb, offset, 1, ENC_LITTLE_ENDIAN);
9996   offset += 1;
9997
9998   return offset;
9999 }
10000
10001 static int
10002 dissect_rm_enabled_capabilities_ie(packet_info *pinfo, proto_tree *tree,
10003                          proto_item *ti, proto_item *ti_len,
10004                          guint32 tag_len, tvbuff_t *tvb,
10005                          int offset, int tag_end _U_)
10006 {
10007   proto_item *ti_ex_cap;
10008   proto_tree *ex_cap_tree;
10009
10010   if (tag_len != 5)
10011   {
10012     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "RM Enabled Capabilities length %u wrong, must = 4", tag_len);
10013     return offset;
10014   }
10015   proto_item_append_text(ti, " (%d octets)", tag_len);
10016
10017   /* RM Enabled Capability octet 1 */
10018   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10019   proto_item_append_text(ti_ex_cap, " (octet 1)");
10020   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap1);
10021   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b0, tvb, offset, 1, ENC_NA);
10022   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b1, tvb, offset, 1, ENC_NA);
10023   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b2, tvb, offset, 1, ENC_NA);
10024   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b3, tvb, offset, 1, ENC_NA);
10025   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b4, tvb, offset, 1, ENC_NA);
10026   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b5, tvb, offset, 1, ENC_NA);
10027   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b6, tvb, offset, 1, ENC_NA);
10028   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b7, tvb, offset, 1, ENC_NA);
10029   offset += 1;
10030
10031   /* RM Enabled Capability octet 2 */
10032   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10033   proto_item_append_text(ti_ex_cap, " (octet 2)");
10034   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap2);
10035   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b8, tvb, offset, 1, ENC_NA);
10036   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b9, tvb, offset, 1, ENC_NA);
10037   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b10, tvb, offset, 1, ENC_NA);
10038   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b11, tvb, offset, 1, ENC_NA);
10039   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b12, tvb, offset, 1, ENC_NA);
10040   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b13, tvb, offset, 1, ENC_NA);
10041   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b14, tvb, offset, 1, ENC_NA);
10042   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b15, tvb, offset, 1, ENC_NA);
10043   offset += 1;
10044
10045   /* RM Enabled Capability octet 3 */
10046   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10047   proto_item_append_text(ti_ex_cap, " (octet 3)");
10048   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap3);
10049   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b16, tvb, offset, 1, ENC_NA);
10050   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b17, tvb, offset, 1, ENC_NA);
10051   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b18to20, tvb, offset, 1, ENC_NA);
10052   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b21to23, tvb, offset, 1, ENC_NA);
10053   offset += 1;
10054
10055   /* RM Enabled Capability octet 4 */
10056   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10057   proto_item_append_text(ti_ex_cap, " (octet 4)");
10058   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap4);
10059   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b24to26, tvb, offset, 1, ENC_NA);
10060   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b27, tvb, offset, 1, ENC_NA);
10061   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b28, tvb, offset, 1, ENC_NA);
10062   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b29, tvb, offset, 1, ENC_NA);
10063   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b30, tvb, offset, 1, ENC_NA);
10064   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b31, tvb, offset, 1, ENC_NA);
10065   offset += 1;
10066
10067   /* RM Enabled Capability octet 5 */
10068   ti_ex_cap = proto_tree_add_item(tree, hf_ieee80211_tag_rm_enabled_capabilities, tvb, offset, 1, ENC_NA);
10069   proto_item_append_text(ti_ex_cap, " (octet 5)");
10070   ex_cap_tree = proto_item_add_subtree (ti_ex_cap, ett_tag_rm_cap5);
10071   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b32, tvb, offset, 1, ENC_NA);
10072   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_b33, tvb, offset, 1, ENC_NA);
10073   proto_tree_add_item(ex_cap_tree, hf_ieee80211_tag_rm_enabled_capabilities_o5, tvb, offset, 1, ENC_NA);
10074   offset += 1;
10075
10076   return offset;
10077 }
10078
10079 static int
10080 dissect_ht_capability_ie(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
10081                          guint32 tag_len, proto_item *ti_len, gboolean vs)
10082 {
10083   proto_item *cap_item, *ti;
10084   proto_tree *cap_tree;
10085
10086   if (tag_len != 26) {
10087     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10088                            "HT Capabilities IE length %u wrong, must be = 26", tag_len);
10089     return offset;
10090   }
10091
10092   if (wlan_ignore_draft_ht && vs)
10093     return offset;
10094
10095   /* 2 byte HT Capabilities  Info*/
10096   if (vs)
10097   {
10098     cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_vs_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10099   }
10100   else
10101   {
10102     cap_item = proto_tree_add_item(tree, hf_ieee80211_ht_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10103   }
10104   cap_tree = proto_item_add_subtree(cap_item, ett_ht_cap_tree);
10105   proto_tree_add_item(cap_tree, hf_ieee80211_ht_ldpc_coding, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10106   proto_tree_add_item(cap_tree, hf_ieee80211_ht_chan_width, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10107   proto_tree_add_item(cap_tree, hf_ieee80211_ht_sm_pwsave, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10108   proto_tree_add_item(cap_tree, hf_ieee80211_ht_green, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10109   proto_tree_add_item(cap_tree, hf_ieee80211_ht_short20, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10110   proto_tree_add_item(cap_tree, hf_ieee80211_ht_short40, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10111   proto_tree_add_item(cap_tree, hf_ieee80211_ht_tx_stbc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10112
10113   proto_tree_add_item(cap_tree, hf_ieee80211_ht_rx_stbc, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10114   proto_tree_add_item(cap_tree, hf_ieee80211_ht_delayed_block_ack, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10115   proto_tree_add_item(cap_tree, hf_ieee80211_ht_max_amsdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10116   proto_tree_add_item(cap_tree, hf_ieee80211_ht_dss_cck_40, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10117   proto_tree_add_item(cap_tree, hf_ieee80211_ht_psmp, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10118   proto_tree_add_item(cap_tree, hf_ieee80211_ht_40_mhz_intolerant, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10119   proto_tree_add_item(cap_tree, hf_ieee80211_ht_l_sig, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10120   offset += 2;
10121
10122   /* 1 byte A-MPDU Parameters */
10123   if (vs)
10124   {
10125     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10126   } else
10127   {
10128     cap_item = proto_tree_add_item(tree, hf_ieee80211_ampduparam, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10129   }
10130   cap_tree = proto_item_add_subtree(cap_item, ett_ampduparam_tree);
10131   ti = proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10132   proto_item_append_text(ti, " (%04.0f[Bytes])",pow(2,13+(tvb_get_guint8(tvb, offset) & 0x3))-1);
10133   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_mpdu_start_spacing, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10134   proto_tree_add_item(cap_tree, hf_ieee80211_ampduparam_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10135   offset += 1;
10136
10137   /* 16 byte MCS set */
10138   offset = dissect_mcs_set(tree, tvb, offset, FALSE, vs);
10139
10140
10141   /* 2 byte HT Extended Capabilities */
10142   if (vs)
10143   {
10144     cap_item = proto_tree_add_item(tree, hf_ieee80211_htex_vs_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10145   } else {
10146     cap_item = proto_tree_add_item(tree, hf_ieee80211_htex_cap, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10147   }
10148   cap_tree = proto_item_add_subtree(cap_item, ett_htex_cap_tree);
10149   proto_tree_add_item(cap_tree, hf_ieee80211_htex_pco, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10150   proto_tree_add_item(cap_tree, hf_ieee80211_htex_transtime, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10151   offset += 1;
10152   proto_tree_add_item(cap_tree, hf_ieee80211_htex_mcs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10153   proto_tree_add_item(cap_tree, hf_ieee80211_htex_htc_support, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10154   proto_tree_add_item(cap_tree, hf_ieee80211_htex_rd_responder, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10155   offset += 1;
10156
10157
10158   /* 4 byte TxBF capabilities */
10159   if (vs)
10160   {
10161     cap_item = proto_tree_add_item(tree, hf_ieee80211_txbf_vs, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10162   } else {
10163     cap_item = proto_tree_add_item(tree, hf_ieee80211_txbf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10164   }
10165   cap_tree = proto_item_add_subtree(cap_item, ett_txbf_tree);
10166   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_cap, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10167   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_rcv_ssc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10168   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_tx_ssc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10169   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_rcv_ndp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10170   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_tx_ndp, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10171   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_impl_txbf, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10172   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_calib, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10173   offset += 1;
10174
10175   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_csi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10176   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_uncomp_fm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10177   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_comp_fm, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10178   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_bf_csi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10179   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_uncomp_fm_feed, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10180   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_expl_comp_fm_feed, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10181   offset += 1;
10182
10183   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_min_group, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10184   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_csi_num_bf_ant, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10185   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_uncomp_sm_bf_ant, tvb, offset, 1,  ENC_LITTLE_ENDIAN);
10186   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_comp_sm_bf_ant, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10187   offset += 1;
10188
10189   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_csi_max_rows_bf, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10190   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_chan_est, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10191   proto_tree_add_item(cap_tree, hf_ieee80211_txbf_resrv, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10192   offset += 1;
10193
10194   /* 1 byte Antenna Selection (ASEL) capabilities */
10195   if (vs)
10196   {
10197     cap_item = proto_tree_add_item(tree, hf_ieee80211_antsel_vs, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10198   }
10199   else
10200   {
10201     cap_item = proto_tree_add_item(tree, hf_ieee80211_antsel, tvb,  offset, 1, ENC_LITTLE_ENDIAN);
10202   }
10203   cap_tree = proto_item_add_subtree(cap_item, ett_antsel_tree);
10204   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b0, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10205   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b1, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10206   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b2, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10207   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b3, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10208   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b4, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10209   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b5, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10210   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b6, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10211   proto_tree_add_item(cap_tree, hf_ieee80211_antsel_b7, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10212
10213   offset += 1;
10214
10215   return offset;
10216 }
10217
10218 static int
10219 dissect_ht_info_ie_1_0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
10220                        guint32 tag_len, proto_item *ti_len)
10221 {
10222   proto_item *cap_item;
10223   proto_tree *cap_tree;
10224
10225   if (tag_len != 22) {
10226     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10227                            "Tag length %u wrong, must be = 22", tag_len);
10228     return offset;
10229   }
10230
10231   if (wlan_ignore_draft_ht)
10232     return offset;
10233
10234   /* 1 HT Control Channel */
10235   proto_tree_add_item(tree, hf_ieee80211_hta_cc, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10236   offset += 1;
10237
10238   /* 1 byte HT additional capabilities */
10239   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 1,
10240              ENC_LITTLE_ENDIAN);
10241   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap_tree);
10242
10243   proto_tree_add_item(cap_tree, hf_ieee80211_hta_ext_chan_offset, tvb, offset, 1,
10244              ENC_LITTLE_ENDIAN);
10245   proto_tree_add_item(cap_tree, hf_ieee80211_hta_rec_tx_width, tvb, offset, 1,
10246              ENC_LITTLE_ENDIAN);
10247   proto_tree_add_item(cap_tree, hf_ieee80211_hta_rifs_mode, tvb, offset, 1,
10248              ENC_LITTLE_ENDIAN);
10249   proto_tree_add_item(cap_tree, hf_ieee80211_hta_controlled_access, tvb, offset, 1,
10250              ENC_LITTLE_ENDIAN);
10251   proto_tree_add_item(cap_tree, hf_ieee80211_hta_service_interval, tvb, offset, 1,
10252              ENC_LITTLE_ENDIAN);
10253   offset += 1;
10254
10255   /* 2 byte HT additional capabilities */
10256   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 2,
10257              ENC_LITTLE_ENDIAN);
10258   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap1_tree);
10259
10260   proto_tree_add_item(cap_tree, hf_ieee80211_hta_operating_mode, tvb, offset, 2,
10261              ENC_LITTLE_ENDIAN);
10262   proto_tree_add_item(cap_tree, hf_ieee80211_hta_non_gf_devices, tvb, offset, 2,
10263              ENC_LITTLE_ENDIAN);
10264
10265   offset += 2;
10266
10267   /* 2 byte HT additional capabilities */
10268   cap_item = proto_tree_add_item(tree, hf_ieee80211_hta_cap, tvb, offset, 2,
10269              ENC_LITTLE_ENDIAN);
10270   cap_tree = proto_item_add_subtree(cap_item, ett_hta_cap2_tree);
10271
10272   proto_tree_add_item(cap_tree, hf_ieee80211_hta_basic_stbc_mcs, tvb, offset, 2,
10273              ENC_LITTLE_ENDIAN);
10274   proto_tree_add_item(cap_tree, hf_ieee80211_hta_dual_stbc_protection, tvb, offset, 2,
10275              ENC_LITTLE_ENDIAN);
10276   proto_tree_add_item(cap_tree, hf_ieee80211_hta_secondary_beacon, tvb, offset, 2,
10277              ENC_LITTLE_ENDIAN);
10278   proto_tree_add_item(cap_tree, hf_ieee80211_hta_lsig_txop_protection, tvb, offset, 2,
10279              ENC_LITTLE_ENDIAN);
10280   proto_tree_add_item(cap_tree, hf_ieee80211_hta_pco_active, tvb, offset, 2,
10281              ENC_LITTLE_ENDIAN);
10282   proto_tree_add_item(cap_tree, hf_ieee80211_hta_pco_phase, tvb, offset, 2,
10283              ENC_LITTLE_ENDIAN);
10284   offset += 2;
10285
10286   /* 16 byte Supported MCS set */
10287   offset = dissect_mcs_set(tree, tvb, offset, FALSE, TRUE);
10288
10289   return offset;
10290 }
10291
10292 /* 802.11n-D1.10 and 802.11n-D2.0, 7.1.3.5a */
10293
10294 /*
10295  * 7.1.3.1.10 says:
10296  * "The Order field is 1 bit in length and is set to 1 in any non-QoS Data
10297  * frame that contains an MSDU, or fragment thereof, which is being
10298  * transferred using the StrictlyOrdered service class. The presence of the
10299  * HT Control field in frames is indicated by setting the Order field to 1
10300  * in any Data type or Management type frame that  is transmitted with a
10301  * value of HT_GF or HT_MM for the FORMAT parameter of the TXVECTOR except
10302  * a non-QoS Data frame or a Control Wrapper frame. The Order field is set
10303  * to 0 in all other frames. All non-HT QoS STAs set the Order field to 0."
10304  *
10305  * ...so does this mean that we can check for the presence of +HTC by
10306  * looking for QoS frames with the Order bit set, or do we need extra
10307  * information from the PHY (which would be monumentally silly)?
10308  *
10309  * At any rate, it doesn't look like any equipment we have produces
10310  * +HTC frames, so the code is completely untested.
10311  */
10312
10313 static void
10314 dissect_ht_control(proto_tree *tree, tvbuff_t *tvb, int offset)
10315 {
10316   proto_item *ti;
10317   proto_tree *htc_tree, *lac_subtree;
10318   guint16 htc;
10319
10320   htc = tvb_get_letohs(tvb, offset);
10321
10322   ti = proto_tree_add_item(tree, hf_ieee80211_htc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
10323   htc_tree = proto_item_add_subtree(ti, ett_htc_tree);
10324
10325   /* Start: Link Adaptation Control */
10326   ti = proto_tree_add_item(htc_tree, hf_ieee80211_htc_lac, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10327   lac_subtree = proto_item_add_subtree(ti, ett_htc_tree);
10328   proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_reserved, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10329   proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_trq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10330
10331   if (HTC_IS_ASELI(htc)) {
10332     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_aseli, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10333   } else {
10334     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_mrq, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10335     if (HTC_LAC_MAI_MRQ(htc)) {
10336       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_msi, tvb, offset, 1, ENC_LITTLE_ENDIAN);
10337     } else {
10338       proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mai_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10339     }
10340   }
10341
10342   proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfsi, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10343
10344   if (HTC_IS_ASELI(htc)) {
10345     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_command, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10346     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_asel_data, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10347   } else {
10348     proto_tree_add_item(lac_subtree, hf_ieee80211_htc_lac_mfb, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10349   }
10350   offset += 2;
10351   /* End: Link Adaptation Control */
10352
10353   proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_pos, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10354   proto_tree_add_item(htc_tree, hf_ieee80211_htc_cal_seq, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10355   proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved1, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10356   proto_tree_add_item(htc_tree, hf_ieee80211_htc_csi_steering, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10357
10358   proto_tree_add_item(htc_tree, hf_ieee80211_htc_ndp_announcement, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10359   proto_tree_add_item(htc_tree, hf_ieee80211_htc_reserved2, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10360   proto_tree_add_item(htc_tree, hf_ieee80211_htc_ac_constraint, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10361   proto_tree_add_item(htc_tree, hf_ieee80211_htc_rdg_more_ppdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
10362
10363   /* offset += 2; */
10364 }
10365
10366 static void
10367 dissect_frame_control(proto_tree *tree, tvbuff_t *tvb, gboolean wlan_broken_fc,
10368                       guint32 offset, packet_info *pinfo)
10369 {
10370   guint16 fcf, flags, frame_type_subtype;
10371   proto_tree *fc_tree, *flag_tree;
10372   proto_item *fc_item, *flag_item, *hidden_item, *ti;
10373
10374   fcf = FETCH_FCF(offset);
10375
10376   flags = FCF_FLAGS(fcf);
10377   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
10378
10379   /* Swap offset... */
10380   if(wlan_broken_fc)
10381   {
10382     offset += 1;
10383   }
10384
10385   proto_tree_add_uint(tree, hf_ieee80211_fc_frame_type_subtype, tvb, offset, 1, frame_type_subtype);
10386
10387   fc_item = proto_tree_add_item(tree, hf_ieee80211_fc_field, tvb, offset, 2, ENC_BIG_ENDIAN);
10388
10389   fc_tree = proto_item_add_subtree(fc_item, ett_fc_tree);
10390
10391   proto_tree_add_item(fc_tree, hf_ieee80211_fc_proto_version, tvb, offset, 1, ENC_NA);
10392   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_type, tvb, offset, 1, ENC_NA);
10393   proto_tree_add_item(fc_tree, hf_ieee80211_fc_frame_subtype, tvb, offset, 1, ENC_NA);
10394   offset += 1;
10395
10396   /* Reswap offset...*/
10397   if(wlan_broken_fc)
10398   {
10399     offset -= 1;
10400     proto_item_append_text(fc_item, "(Swapped)");
10401   }
10402
10403   /* Flags */
10404   flag_item = proto_tree_add_item(fc_tree, hf_ieee80211_fc_flags, tvb, offset, 1, ENC_NA);
10405   flag_tree = proto_item_add_subtree (flag_item, ett_proto_flags);
10406   proto_tree_add_item (flag_tree, hf_ieee80211_fc_data_ds, tvb, offset, 1, ENC_NA);
10407   hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_to_ds, tvb, offset, 1, ENC_NA);
10408   PROTO_ITEM_SET_HIDDEN(hidden_item);
10409   hidden_item = proto_tree_add_item(flag_tree, hf_ieee80211_fc_from_ds, tvb, offset, 1, ENC_NA);
10410   PROTO_ITEM_SET_HIDDEN(hidden_item);
10411   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_frag, tvb, offset, 1,ENC_NA);
10412   ti = proto_tree_add_item(flag_tree, hf_ieee80211_fc_retry, tvb, offset, 1, ENC_NA);
10413   if( IS_RETRY(flags) )
10414   {
10415     expert_add_info_format(pinfo, ti, PI_SEQUENCE, PI_NOTE, "Retransmission (retry)");
10416   }
10417   proto_tree_add_item(flag_tree, hf_ieee80211_fc_pwr_mgt, tvb, offset, 1, ENC_NA);
10418   proto_tree_add_item(flag_tree, hf_ieee80211_fc_more_data, tvb, offset, 1, ENC_NA);
10419   proto_tree_add_item(flag_tree, hf_ieee80211_fc_protected, tvb, offset, 1,ENC_NA);
10420   proto_tree_add_item(flag_tree, hf_ieee80211_fc_order, tvb, offset, 1, ENC_NA);
10421 }
10422
10423 static void
10424 dissect_durid(proto_tree *hdr_tree, tvbuff_t *tvb, guint16 fts, gint offset)
10425 {
10426   guint16 durid = tvb_get_letohs(tvb, offset);
10427
10428   if (durid < 0x8000) {
10429     proto_tree_add_uint_format_value(hdr_tree, hf_ieee80211_did_duration, tvb,
10430       offset, 2, durid, "%u microseconds", durid);
10431   } else if (((durid & 0xC000) == 0xC000) &&
10432              ((durid & 0x3FFF) > 0) && ((durid & 0x3FFF) <= 2007) &&
10433              (fts == CTRL_PS_POLL)) {
10434     proto_tree_add_item(hdr_tree, hf_ieee80211_assoc_id, tvb, 2, offset,
10435       ENC_LITTLE_ENDIAN);
10436   } else if (durid == 0x8000) {
10437     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
10438       offset, 2, durid, "Duration/ID: %u", durid);
10439   } else {
10440     proto_tree_add_uint_format(hdr_tree, hf_ieee80211_did_duration, tvb,
10441       offset, 2, durid, "Duration/ID: %u (reserved)", durid & 0x3FFF);
10442   }
10443 }
10444
10445
10446 static void
10447 dissect_vendor_ie_ht(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
10448                     guint offset, proto_item *item, proto_item *ti_len, gint tag_len)
10449 {
10450
10451   guint8 type;
10452
10453   proto_tree_add_item(tree, hf_ieee80211_ht_pren_type, tvb, offset, 1, ENC_NA);
10454   type = tvb_get_guint8(tvb, offset);
10455   offset += 1;
10456   tag_len -= 1;
10457
10458
10459   switch(type){
10460     case 51:
10461       dissect_ht_capability_ie(tvb, pinfo, tree, offset, tag_len, ti_len, TRUE);
10462       proto_item_append_text(item, ": HT Capabilities (802.11n D1.10)");
10463     break;
10464
10465     case 52:
10466       dissect_ht_info_ie_1_0(tvb, pinfo, tree, offset, tag_len, ti_len);
10467       proto_item_append_text(item, ": HT Additional Capabilities (802.11n D1.00)");
10468     break;
10469
10470     default:
10471       proto_tree_add_item(tree, hf_ieee80211_ht_pren_unknown, tvb, offset, tag_len, ENC_NA);
10472     break;
10473   }
10474
10475 }
10476
10477 static guint
10478 dissect_interworking(packet_info *pinfo, proto_tree *tree, proto_item *item,
10479                      tvbuff_t *tvb, int offset)
10480 {
10481   guint8 len;
10482
10483   offset += 1;
10484   len = tvb_get_guint8(tvb, offset);
10485   offset += 1;
10486
10487   if ((tvb_reported_length_remaining(tvb, offset) < len) || (len == 0)) {
10488     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10489                            "Truncated Interworking element");
10490     return offset;
10491   }
10492
10493   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_access_network_type,
10494                       tvb, offset, 1, ENC_BIG_ENDIAN);
10495   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_internet,
10496                       tvb, offset, 1, ENC_BIG_ENDIAN);
10497   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_asra,
10498                       tvb, offset, 1, ENC_BIG_ENDIAN);
10499   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_esr,
10500                       tvb, offset, 1, ENC_BIG_ENDIAN);
10501   proto_tree_add_item(tree, hf_ieee80211_tag_interworking_uesa,
10502                       tvb, offset, 1, ENC_BIG_ENDIAN);
10503   offset += 1;
10504
10505   if ((len == (1 + 2)) || (len == (1 + 2 + 6))) {
10506     dissect_venue_info(tree, tvb, offset);
10507     offset += 2;
10508   }
10509
10510   if ((len == (1 + 6)) || (len == (1 + 2 + 6))) {
10511     proto_tree_add_item(tree, hf_ieee80211_tag_interworking_hessid,
10512                         tvb, offset, 6, ENC_NA);
10513     offset += 6;
10514   }
10515
10516   if ((len != 1) && (len != (1 + 2)) && (len != (1 + 6)) && (len != (1 + 2 + 6))) {
10517     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10518                            "Invalid Interworking element length");
10519   }
10520
10521   return offset;
10522 }
10523
10524 static guint
10525 dissect_roaming_consortium(packet_info *pinfo, proto_tree *tree,
10526                            proto_item *item, tvbuff_t *tvb, int offset)
10527 {
10528   guint8 len, oi_lens, oi1_len, oi2_len;
10529   int end;
10530
10531   offset += 1;
10532   len = tvb_get_guint8(tvb, offset);
10533   offset += 1;
10534   end = offset + len;
10535
10536   if ((tvb_reported_length_remaining(tvb, offset) < len) || (len < 2)) {
10537     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10538                            "Truncated Roaming Consortium element");
10539     return 2 + len;
10540   }
10541
10542   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
10543                       tvb, offset, 1, ENC_BIG_ENDIAN);
10544   offset += 1;
10545
10546   oi_lens = tvb_get_guint8(tvb, offset);
10547   oi1_len = oi_lens & 0x0f;
10548   oi2_len = (oi_lens & 0xf0) >> 4;
10549   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1_len,
10550                       tvb, offset, 1, ENC_BIG_ENDIAN);
10551   proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2_len,
10552                       tvb, offset, 1, ENC_BIG_ENDIAN);
10553   offset += 1;
10554
10555   if (offset + oi1_len > end) {
10556     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10557                            "Truncated Roaming Consortium element");
10558     return 2 + len;
10559   }
10560
10561   item = proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi1,
10562                              tvb, offset, oi1_len, ENC_NA);
10563   add_manuf(item, tvb, offset);
10564   offset += oi1_len;
10565
10566   if (offset + oi2_len > end) {
10567     expert_add_info_format(pinfo, item, PI_MALFORMED, PI_ERROR,
10568                            "Truncated Roaming Consortium element");
10569     return 2 + len;
10570   }
10571
10572   if (oi2_len > 0) {
10573     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi2,
10574                         tvb, offset, oi2_len, ENC_NA);
10575     offset += oi2_len;
10576   }
10577
10578   if (end > offset) {
10579     proto_tree_add_item(tree, hf_ieee80211_tag_roaming_consortium_oi3,
10580                         tvb, offset, end - offset, ENC_NA);
10581   }
10582
10583   return 2 + len;
10584 }
10585
10586
10587 /* ************************************************************************* */
10588 /*           Dissect and add tagged (optional) fields to proto tree          */
10589 /* ************************************************************************* */
10590
10591 static int beacon_padding = 0; /* beacon padding bug */
10592
10593 static int
10594 ieee80211_tag_ssid(packet_info *pinfo, proto_tree *tree,
10595                    proto_item *ti, proto_item *ti_len,
10596                    guint32 tag_len, tvbuff_t *tvb, int offset)
10597 {
10598   /* 7.3.2.1 SSID element (0) */
10599   gchar *ssid; /* The SSID may consist of arbitrary bytes */
10600   const gchar *ssid_end;
10601   gint ssid_len = tag_len;
10602
10603   if (beacon_padding != 0) /* padding bug */
10604     return offset;
10605
10606   if (ssid_len > MAX_SSID_LEN) {
10607     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10608                            "SSID length (%u) greater than maximum (%u)",
10609                            ssid_len, MAX_SSID_LEN);
10610     ssid_len = MAX_SSID_LEN;
10611   }
10612
10613   ssid = tvb_get_ephemeral_string(tvb, offset + 2, ssid_len);
10614   if (ssid_len == (gint)tag_len) {
10615     AirPDcapSetLastSSID(&airpdcap_ctx, (CHAR *) ssid, ssid_len);
10616   }
10617   g_utf8_validate(ssid, ssid_len, &ssid_end);
10618   ssid[ssid_end - ssid] = '\0';
10619   if ((gint)(ssid_end - ssid) == ssid_len) {
10620     proto_tree_add_item(tree, hf_ieee80211_tag_ssid, tvb, offset + 2, tag_len,
10621                         ENC_ASCII|ENC_NA);
10622   } else {
10623     emem_strbuf_t *ssid_sb = ep_strbuf_new(ssid);
10624     ep_strbuf_append(ssid_sb, " [truncated]");
10625     proto_tree_add_string_format_value(tree, hf_ieee80211_tag_ssid, tvb, offset + 2, tag_len,
10626                         ssid, "%s", ssid_sb->str);
10627     ssid = ssid_sb->str;
10628   }
10629
10630   if (tag_len > 0) {
10631     proto_item_append_text(ti, ": %s", ssid);
10632
10633     col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", ssid);
10634
10635     /* Wlan Stats */
10636     memcpy(wlan_stats.ssid, ssid, MIN(tag_len, MAX_SSID_LEN));
10637     wlan_stats.ssid_len = tag_len;
10638   } else {
10639     proto_item_append_text(ti, ": Broadcast");
10640
10641     col_append_str(pinfo->cinfo, COL_INFO, ", SSID=Broadcast");
10642   }
10643
10644   beacon_padding += 1; /* padding bug */
10645
10646   return offset + 2 + tag_len;
10647 }
10648
10649 static int
10650 ieee80211_tag_supp_rates(packet_info *pinfo, proto_tree *tree,
10651                          proto_item *ti, proto_item *ti_len,
10652                          guint32 tag_len, tvbuff_t *tvb,
10653                          int offset, int tag_end)
10654 {
10655   /* 7.3.2.2 Supported Rates element (1) */
10656   if (tag_len < 1) {
10657     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10658                            "Tag length %u too short, must be greater than 0",
10659                            tag_len);
10660     return offset;
10661   }
10662
10663   offset += 2;
10664
10665   while (offset < tag_end) {
10666     proto_tree_add_item(tree, hf_ieee80211_tag_supp_rates, tvb, offset, 1,
10667                         ENC_BIG_ENDIAN);
10668     proto_item_append_text(ti, " %s,",
10669                            val_to_str_ext_const(tvb_get_guint8(tvb, offset),
10670                                                 &ieee80211_supported_rates_vals_ext,
10671                                                 "Unknown Rate"));
10672     offset += 1;
10673   }
10674
10675   proto_item_append_text(ti, " [Mbit/sec]");
10676
10677   return offset;
10678 }
10679
10680 static int
10681 ieee80211_tag_fh_parameter(packet_info *pinfo, proto_tree *tree,
10682                            proto_item *ti_len, guint32 tag_len,
10683                            tvbuff_t *tvb, int offset)
10684 {
10685   /* 7.3.2.3 FH Parameter Set element (2) */
10686   if (tag_len < 5) {
10687     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10688                            "Tag length %u too short, must be >= 5", tag_len);
10689     return offset;
10690   }
10691
10692   offset += 2;
10693
10694   proto_tree_add_item(tree, hf_ieee80211_tag_fh_dwell_time,
10695                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
10696   offset += 2;
10697
10698   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_set,
10699                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10700   offset += 1;
10701
10702   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_pattern,
10703                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10704   offset += 1;
10705
10706   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hop_index,
10707                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10708   offset += 1;
10709
10710   return offset;
10711 }
10712
10713 static int
10714 ieee80211_tag_ds_parameter(packet_info *pinfo, proto_tree *tree,
10715                            proto_item *ti, proto_item *ti_len,
10716                            guint32 tag_len, tvbuff_t *tvb,
10717                            int offset)
10718 {
10719   /* 7.3.2.4 DS Parameter Set element (3) */
10720   if (tag_len != 1) {
10721     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10722         "Tag length %u wrong, must be = 1", tag_len);
10723     return offset;
10724   }
10725
10726   offset += 2;
10727
10728   proto_tree_add_item(tree, hf_ieee80211_tag_ds_param_channel,
10729         tvb, offset, 1, ENC_BIG_ENDIAN);
10730
10731   proto_item_append_text(ti, ": Current Channel: %u",
10732                          tvb_get_guint8(tvb, offset));
10733
10734   wlan_stats.channel = tvb_get_guint8(tvb, offset);
10735   offset += 1;
10736
10737   return offset;
10738 }
10739
10740 static int
10741 ieee80211_tag_cf_parameter(packet_info *pinfo, proto_tree *tree,
10742                            proto_item *ti, proto_item *ti_len,
10743                            guint32 tag_len, tvbuff_t *tvb,
10744                            int offset)
10745 {
10746   /* 7.3.2.5 CF Parameter Set element (4) */
10747   if (tag_len != 6) {
10748     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10749                            "Tag length %u wrong, must be = 6", tag_len);
10750     return offset;
10751   }
10752
10753   offset += 2;
10754
10755   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_count,
10756                       tvb, offset, 1, ENC_BIG_ENDIAN);
10757   proto_item_append_text(ti, ": CFP count %u", tvb_get_guint8(tvb, offset));
10758   offset += 1;
10759
10760   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_period,
10761                       tvb, offset, 1, ENC_BIG_ENDIAN);
10762   proto_item_append_text(ti, ": CFP Period %u", tvb_get_guint8(tvb, offset));
10763   offset += 1;
10764
10765   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_max_duration,
10766                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
10767   proto_item_append_text(ti, ": CFP Max Duration %u",
10768                          tvb_get_letohs(tvb, offset));
10769   offset += 2;
10770
10771   proto_tree_add_item(tree, hf_ieee80211_tag_cfp_dur_remaining,
10772                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
10773   proto_item_append_text(ti, ": CFP Dur Remaining %u",
10774                          tvb_get_letohs(tvb, offset));
10775   offset += 1;
10776
10777   return offset;
10778 }
10779
10780 static int
10781 ieee80211_tag_tim(packet_info *pinfo, proto_tree *tree,
10782                   proto_item *ti, proto_item *ti_len,
10783                   guint32 tag_len, tvbuff_t *tvb, int offset)
10784 {
10785   proto_tree *bmapctl_tree;
10786   proto_item *bmapctl_item;
10787
10788   /* 7.3.2.6 TIM (5) */
10789   if (tag_len < 4) {
10790     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10791                            "Tag length %u too short, must be >= 4", tag_len);
10792     return offset;
10793   }
10794
10795   offset += 2;
10796
10797   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_count,
10798                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10799   proto_item_append_text(ti, ": DTIM %u of", tvb_get_guint8(tvb, offset));
10800   offset += 1;
10801
10802   proto_tree_add_item(tree, hf_ieee80211_tim_dtim_period,
10803                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10804   proto_item_append_text(ti, " %u bitmap", tvb_get_guint8(tvb, offset + 1));
10805   offset += 1;
10806
10807   bmapctl_item = proto_tree_add_item(tree, hf_ieee80211_tim_bmapctl,
10808                                      tvb, offset, 1, ENC_LITTLE_ENDIAN);
10809   bmapctl_tree = proto_item_add_subtree(bmapctl_item, ett_tag_bmapctl_tree);
10810   proto_tree_add_item(bmapctl_tree, hf_ieee80211_tim_bmapctl_mcast,
10811                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10812   proto_tree_add_item(bmapctl_tree, hf_ieee80211_tim_bmapctl_offset,
10813                       tvb, offset, 1, ENC_LITTLE_ENDIAN);
10814   offset += 1;
10815
10816   proto_tree_add_item(tree, hf_ieee80211_tim_partial_virtual_bitmap,
10817                       tvb, offset, tag_len - 3, ENC_NA);
10818   offset += tag_len - 3;
10819
10820   return offset;
10821 }
10822
10823 static int
10824 ieee80211_tag_ibss_parameter(packet_info *pinfo, proto_tree *tree,
10825                              proto_item *ti, proto_item *ti_len,
10826                              guint32 tag_len, tvbuff_t *tvb,
10827                              int offset)
10828 {
10829   /* 7.3.2.7 IBSS Parameter Set element (6) */
10830
10831   if (tag_len != 2) {
10832     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10833                            "Tag length %u wrong, must be = 2", tag_len);
10834     return offset;
10835   }
10836
10837   offset += 2;
10838
10839   proto_tree_add_item(tree, hf_ieee80211_tag_ibss_atim_window,
10840                       tvb, offset, 2, ENC_LITTLE_ENDIAN);
10841   proto_item_append_text(ti, ": ATIM window 0x%x",
10842                          tvb_get_letohs(tvb, offset));
10843   offset += 2;
10844
10845   return offset;
10846 }
10847
10848 static const value_string environment_vals[] = {
10849   { 0x20, "Any" },
10850   { 0x4f, "Outdoor" },
10851   { 0x49, "Indoor" },
10852   { 0,    NULL }
10853 };
10854
10855 static int
10856 ieee80211_tag_country_info(packet_info *pinfo, proto_tree *tree,
10857                            proto_item *ti, proto_item *ti_len,
10858                            guint32 tag_len, tvbuff_t *tvb,
10859                            int offset, int tag_end)
10860 {
10861   /* 7.3.2.9 Country information element (7) */
10862   proto_tree *sub_tree;
10863   proto_item *sub_item;
10864
10865   if (tag_len < 6) {
10866     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10867                            "Tag length %u too short, must be >= 6", tag_len);
10868     return offset;
10869   }
10870
10871   offset += 2;
10872
10873   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_code,
10874                       tvb, offset, 2, ENC_ASCII|ENC_NA);
10875   proto_item_append_text(ti, ": Country Code %s",
10876                          tvb_get_ephemeral_string(tvb, offset, 2));
10877   offset += 2;
10878
10879   proto_tree_add_item(tree, hf_ieee80211_tag_country_info_env,
10880                       tvb, offset, 1, ENC_BIG_ENDIAN);
10881   proto_item_append_text(ti, ", Environment %s",
10882                          val_to_str(tvb_get_guint8(tvb, offset),
10883                                     environment_vals,"Unknown (0x%02x)"));
10884   offset += 1;
10885
10886   while (offset < tag_end) {
10887     /* Padding ? */
10888     if ((tag_end - offset) < 3) {
10889       proto_tree_add_item(tree, hf_ieee80211_tag_country_info_pad,
10890                           tvb, offset, 1, ENC_NA);
10891       offset += 1;
10892       continue;
10893     }
10894     if (tvb_get_guint8(tvb, offset) <= 200) { /* 802.11d */
10895       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_fnm,
10896                                      tvb, offset, 3, ENC_NA);
10897       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_fnm_tree);
10898
10899       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_fcn,
10900                           tvb, offset, 1, ENC_BIG_ENDIAN);
10901       proto_item_append_text(sub_item, ": First Channel Number: %d",
10902                              tvb_get_guint8(tvb, offset));
10903       offset += 1;
10904       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_nc,
10905                           tvb, offset, 1, ENC_BIG_ENDIAN);
10906       proto_item_append_text(sub_item, ", Number of Channels: %d",
10907                              tvb_get_guint8(tvb, offset));
10908       offset += 1;
10909       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_fnm_mtpl,
10910                           tvb, offset, 1, ENC_BIG_ENDIAN);
10911       proto_item_append_text(sub_item,
10912                              ", Maximum Transmit Power Level: %d dBm",
10913                              tvb_get_guint8(tvb, offset));
10914       offset += 1;
10915     } else { /* 802.11j */
10916       sub_item = proto_tree_add_item(tree, hf_ieee80211_tag_country_info_rrc,
10917                                      tvb, offset, 3, ENC_NA);
10918       sub_tree = proto_item_add_subtree(sub_item, ett_tag_country_rcc_tree);
10919
10920       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_rei,
10921                           tvb, offset, 1, ENC_BIG_ENDIAN);
10922       proto_item_append_text(sub_item,
10923                              ": Regulatory Extension Identifier: %d",
10924                              tvb_get_guint8(tvb, offset));
10925       offset += 1;
10926       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_rc,
10927                           tvb, offset, 1, ENC_BIG_ENDIAN);
10928       proto_item_append_text(sub_item, ", Regulatory Class: %d",
10929                              tvb_get_guint8(tvb, offset));
10930       offset += 1;
10931       proto_tree_add_item(sub_tree, hf_ieee80211_tag_country_info_rrc_cc,
10932                           tvb, offset, 1, ENC_BIG_ENDIAN);
10933       proto_item_append_text(sub_item, ", Coverage Class: %d",
10934                              tvb_get_guint8(tvb, offset));
10935       offset += 1;
10936     }
10937   }
10938
10939   return offset;
10940 }
10941
10942 static int
10943 ieee80211_tag_fh_hopping_parameter(packet_info *pinfo,
10944                                    proto_tree *tree,
10945                                    proto_item *ti,
10946                                    proto_item *ti_len,
10947                                    guint32 tag_len, tvbuff_t *tvb,
10948                                    int offset)
10949 {
10950   /* 7.3.2.10 Hopping Pattern Parameters information element (8) */
10951   if (tag_len < 2) {
10952     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10953                            "Tag length %u too short, must be >= 2", tag_len);
10954     return offset;
10955   }
10956
10957   offset += 2;
10958
10959   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
10960                       tvb, offset, 1, ENC_BIG_ENDIAN);
10961   proto_item_append_text(ti, ": Prime Radix: %u", tvb_get_guint8(tvb, offset));
10962   offset += 1;
10963
10964   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
10965                       tvb, offset, 1, ENC_BIG_ENDIAN);
10966   proto_item_append_text(ti, ", Number of Channels: %u",
10967                          tvb_get_guint8(tvb, offset));
10968   offset += 1;
10969
10970   return offset;
10971 }
10972
10973 static int
10974 ieee80211_tag_fh_hopping_table(packet_info *pinfo, proto_tree *tree,
10975                                proto_item *ti_len,
10976                                guint32 tag_len, tvbuff_t *tvb,
10977                                int offset, int tag_end)
10978 {
10979   /* 7.3.2.11 Hopping Pattern Table information element (9) */
10980   if (tag_len < 4) {
10981     expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
10982                            "Tag length %u too short, must be >= 4", tag_len);
10983     return offset;
10984   }
10985
10986   offset += 2;
10987
10988   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_flag,
10989                       tvb, offset, 1, ENC_BIG_ENDIAN);
10990   offset += 1;
10991
10992   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_number_of_sets,
10993                       tvb, offset, 1, ENC_BIG_ENDIAN);
10994   offset += 1;
10995
10996   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_modulus,
10997                       tvb, offset, 1, ENC_BIG_ENDIAN);
10998   offset += 1;
10999
11000   proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_table_offset,
11001                       tvb, offset, 1, ENC_BIG_ENDIAN);
11002   offset += 1;
11003
11004   while (offset < tag_end) {
11005     proto_tree_add_item(tree, hf_ieee80211_tag_fh_hopping_random_table,
11006                         tvb, offset, 2, ENC_BIG_ENDIAN);
11007     offset += 2;
11008   }
11009
11010   return offset;
11011 }
11012
11013 static int
11014 add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset, int ftype)
11015 {
11016   guint32       oui;
11017   tvbuff_t     *tag_tvb;
11018   const guint8 *tag_data_ptr;
11019   guint32       tag_no, tag_len;
11020   int           n, ret;
11021   char          print_buff[SHORT_STR];
11022   proto_tree   *orig_tree = tree;
11023   proto_item   *ti        = NULL;
11024   proto_item   *ti_len, *ti_tag;
11025   int           tag_end;
11026
11027   tag_no  = tvb_get_guint8(tvb, offset);
11028   tag_len = tvb_get_guint8(tvb, offset + 1);
11029   tag_end = offset + 2 + tag_len;
11030
11031   if (tree) {
11032     ti = proto_tree_add_item(orig_tree, hf_ieee80211_tag, tvb, offset, 2 + tag_len , ENC_NA);
11033     proto_item_append_text(ti, ": %s", val_to_str_ext(tag_no, &tag_num_vals_ext, "Reserved (%d)"));
11034
11035     tree = proto_item_add_subtree(ti, ett_80211_mgt_ie);
11036
11037   }
11038
11039   ti_tag = proto_tree_add_item(tree, hf_ieee80211_tag_number, tvb, offset, 1, ENC_BIG_ENDIAN);
11040
11041   ti_len = proto_tree_add_uint(tree, hf_ieee80211_tag_length, tvb, offset + 1, 1, tag_len);
11042
11043   switch (tag_no) {
11044   case TAG_SSID:
11045     offset += ieee80211_tag_ssid(pinfo, tree, ti, ti_len, tag_len, tvb,
11046                                  offset);
11047     break;
11048   case TAG_SUPP_RATES:
11049     offset += ieee80211_tag_supp_rates(pinfo, tree, ti, ti_len, tag_len, tvb,
11050                                        offset, tag_end);
11051     break;
11052   case TAG_FH_PARAMETER:
11053     offset += ieee80211_tag_fh_parameter(pinfo, tree, ti_len, tag_len, tvb,
11054                                          offset);
11055     break;
11056   case TAG_DS_PARAMETER:
11057     offset += ieee80211_tag_ds_parameter(pinfo, tree, ti, ti_len, tag_len, tvb,
11058                                          offset);
11059     break;
11060   case TAG_CF_PARAMETER:
11061     offset += ieee80211_tag_cf_parameter(pinfo, tree, ti, ti_len, tag_len, tvb,
11062                                          offset);
11063     break;
11064   case TAG_TIM:
11065     offset += ieee80211_tag_tim(pinfo, tree, ti, ti_len, tag_len, tvb, offset);
11066     break;
11067   case TAG_IBSS_PARAMETER:
11068     offset += ieee80211_tag_ibss_parameter(pinfo, tree, ti, ti_len, tag_len,
11069                                            tvb, offset);
11070     break;
11071   case TAG_COUNTRY_INFO:
11072     offset += ieee80211_tag_country_info(pinfo, tree, ti, ti_len, tag_len, tvb,
11073                                          offset, tag_end);
11074     break;
11075   case TAG_FH_HOPPING_PARAMETER:
11076     offset += ieee80211_tag_fh_hopping_parameter(pinfo, tree, ti, ti_len,
11077                                                  tag_len, tvb, offset);
11078     break;
11079   case TAG_FH_HOPPING_TABLE:
11080     offset += ieee80211_tag_fh_hopping_table(pinfo, tree, ti_len, tag_len,
11081                                              tvb, offset, tag_end);
11082     break;
11083
11084     case TAG_REQUEST: /* 7.3.2.12 Request information element (10) */
11085       while (offset < tag_end)
11086       {
11087         proto_tree_add_item(tree, hf_ieee80211_tag_request, tvb, offset, 1, ENC_BIG_ENDIAN);
11088         offset += 1;
11089       }
11090       break;
11091
11092     case TAG_QBSS_LOAD: /* 7.3.2.28 BSS Load element (11) */
11093       if ((tag_len < 4) || (tag_len > 5))
11094       {
11095         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 4 or 5", tag_len);
11096         break;
11097       }
11098
11099       if (tag_len == 4)
11100       {
11101         /* QBSS Version 1 */
11102         proto_item_append_text(ti, " Cisco QBSS Version 1 - non CCA");
11103
11104         /* Extract Values */
11105         proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 1);
11106         proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN);
11107         proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
11108         proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 1, ENC_BIG_ENDIAN);
11109       }
11110       else if (tag_len == 5)
11111       {
11112          /* QBSS Version 2 */
11113          proto_item_append_text(ti, " 802.11e CCA Version");
11114
11115          /* Extract Values */
11116          proto_tree_add_uint(tree, hf_ieee80211_qbss_version, tvb, offset + 2, tag_len, 2);
11117          proto_tree_add_item(tree, hf_ieee80211_qbss_scount, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN);
11118          proto_tree_add_item(tree, hf_ieee80211_qbss_cu, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
11119          proto_tree_add_item(tree, hf_ieee80211_qbss_adc, tvb, offset + 5, 2, ENC_LITTLE_ENDIAN);
11120       }
11121       break;
11122
11123     case TAG_TSPEC: /* 7.3.2.30 TSPEC element (13) */
11124       if (tag_len != 55)
11125       {
11126         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 55", tag_len);
11127         break;
11128       }
11129       offset += 2;
11130
11131       add_fixed_field(tree, tvb, pinfo, offset, FIELD_QOS_TS_INFO);
11132       offset += 3;
11133
11134       proto_tree_add_item(tree, hf_ieee80211_tspec_nor_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11135       offset += 2;
11136
11137       proto_tree_add_item(tree, hf_ieee80211_tspec_max_msdu, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11138       offset += 2;
11139
11140       proto_tree_add_item(tree, hf_ieee80211_tspec_min_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11141       offset += 4;
11142
11143       proto_tree_add_item(tree, hf_ieee80211_tspec_max_srv, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11144       offset += 4;
11145
11146       proto_tree_add_item(tree, hf_ieee80211_tspec_inact_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11147       offset += 4;
11148
11149       proto_tree_add_item(tree, hf_ieee80211_tspec_susp_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11150       offset += 4;
11151
11152       proto_tree_add_item(tree, hf_ieee80211_tspec_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11153       offset += 4;
11154
11155       proto_tree_add_item(tree, hf_ieee80211_tspec_min_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11156       offset += 4;
11157
11158       proto_tree_add_item(tree, hf_ieee80211_tspec_mean_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11159       offset += 4;
11160
11161       proto_tree_add_item(tree, hf_ieee80211_tspec_peak_data, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11162       offset += 4;
11163
11164       proto_tree_add_item(tree, hf_ieee80211_tspec_burst_size, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11165       offset += 4;
11166
11167       proto_tree_add_item(tree, hf_ieee80211_tspec_delay_bound, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11168       offset += 4;
11169
11170       proto_tree_add_item(tree, hf_ieee80211_tspec_min_phy, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11171       offset += 4;
11172
11173       proto_tree_add_item(tree, hf_ieee80211_tspec_surplus, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11174       offset += 2;
11175
11176       proto_tree_add_item(tree, hf_ieee80211_tspec_medium, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11177       offset += 2;
11178
11179       break;
11180
11181     case TAG_TCLAS: /* 7.3.2.31 TCLAS element (14) */
11182       if (tag_len < 6)
11183       {
11184         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be >= 6", tag_len);
11185         break;
11186       }
11187       {
11188       guint8 type;
11189       guint8 version;
11190       proto_item *class_mask;
11191       proto_tree *mask_tree;
11192
11193       offset += 2;
11194       proto_tree_add_item(tree, hf_ieee80211_tclas_up, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11195       offset += 1;
11196
11197       type = tvb_get_guint8(tvb, offset);
11198       proto_tree_add_item(tree, hf_ieee80211_tclas_class_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11199       offset += 1;
11200
11201       class_mask = proto_tree_add_item(tree, hf_ieee80211_tclas_class_mask,
11202                                        tvb, offset, 1, ENC_LITTLE_ENDIAN);
11203       offset += 1;
11204
11205       switch (type)
11206         {
11207           case 0:
11208             offset--;
11209             mask_tree = proto_item_add_subtree(class_mask,
11210                                                ett_tag_tclas_mask_tree);
11211             proto_tree_add_item(mask_tree,
11212                                 hf_ieee80211_tclas_class_mask0_src_addr,
11213                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11214             proto_tree_add_item(mask_tree,
11215                                 hf_ieee80211_tclas_class_mask0_dst_addr,
11216                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11217             proto_tree_add_item(mask_tree,
11218                                 hf_ieee80211_tclas_class_mask0_type,
11219                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11220             offset++;
11221
11222             proto_tree_add_item(tree, hf_ieee80211_tclas_src_mac_addr, tvb, offset, 6, ENC_NA);
11223             offset += 6;
11224
11225             proto_tree_add_item(tree, hf_ieee80211_tclas_dst_mac_addr, tvb, offset, 6, ENC_NA);
11226             offset += 6;
11227
11228             proto_tree_add_item(tree, hf_ieee80211_tclas_ether_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11229             offset += 2;
11230             break;
11231
11232           case 1:
11233             version = tvb_get_guint8(tvb, offset);
11234             offset--;
11235
11236             mask_tree = proto_item_add_subtree(class_mask,
11237                                                ett_tag_tclas_mask_tree);
11238             proto_tree_add_item(mask_tree,
11239                                 hf_ieee80211_tclas_class_mask1_ver,
11240                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11241             proto_tree_add_item(mask_tree,
11242                                 hf_ieee80211_tclas_class_mask1_src_ip,
11243                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11244             proto_tree_add_item(mask_tree,
11245                                 hf_ieee80211_tclas_class_mask1_dst_ip,
11246                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11247             proto_tree_add_item(mask_tree,
11248                                 hf_ieee80211_tclas_class_mask1_src_port,
11249                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11250             proto_tree_add_item(mask_tree,
11251                                 hf_ieee80211_tclas_class_mask1_dst_port,
11252                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11253             if (version == 4) {
11254               proto_tree_add_item(mask_tree,
11255                                   hf_ieee80211_tclas_class_mask1_ipv4_dscp,
11256                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
11257               proto_tree_add_item(mask_tree,
11258                                   hf_ieee80211_tclas_class_mask1_ipv4_proto,
11259                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
11260             } else {
11261               proto_tree_add_item(mask_tree,
11262                                   hf_ieee80211_tclas_class_mask1_ipv6_flow,
11263                                   tvb, offset, 1, ENC_LITTLE_ENDIAN);
11264             }
11265             offset += 1;
11266
11267             proto_tree_add_item(tree, hf_ieee80211_tclas_version, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11268             offset += 1;
11269             if (version == 4)
11270             {
11271               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
11272               offset += 4;
11273               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
11274               offset += 4;
11275               proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
11276               offset += 2;
11277               proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
11278               offset += 2;
11279               proto_tree_add_item(tree, hf_ieee80211_tclas_dscp, tvb, offset, 1, ENC_BIG_ENDIAN);
11280               offset += 1;
11281               proto_tree_add_item(tree, hf_ieee80211_tclas_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
11282               offset += 1;
11283             }
11284             else if (version == 6)
11285             {
11286               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_src, tvb, offset, 16, ENC_NA);
11287               offset += 16;
11288               proto_tree_add_item(tree, hf_ieee80211_tclas_ipv6_dst, tvb, offset, 16, ENC_NA);
11289               offset += 16;
11290               proto_tree_add_item(tree, hf_ieee80211_tclas_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
11291               offset += 2;
11292               proto_tree_add_item(tree, hf_ieee80211_tclas_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
11293               offset += 2;
11294               proto_tree_add_item(tree, hf_ieee80211_tclas_flow, tvb, offset, 3, ENC_BIG_ENDIAN);
11295               offset += 3;
11296             }
11297             break;
11298
11299           case 2:
11300             offset--;
11301             mask_tree = proto_item_add_subtree(class_mask,
11302                                                ett_tag_tclas_mask_tree);
11303             proto_tree_add_item(mask_tree,
11304                                 hf_ieee80211_tclas_class_mask2_tci,
11305                                 tvb, offset, 1, ENC_LITTLE_ENDIAN);
11306             offset++;
11307
11308             proto_tree_add_item(tree, hf_ieee80211_tclas_tag_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11309             offset += 2;
11310             break;
11311
11312           default:
11313             break;
11314         }
11315       }
11316       break;
11317
11318     case TAG_SCHEDULE: /* 7.3.2.34 Schedule element (15) */
11319       if (tag_len != 14)
11320       {
11321         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 14", tag_len);
11322         break;
11323       }
11324       offset += 2;
11325
11326       add_fixed_field(tree, tvb, pinfo, offset, FIELD_SCHEDULE_INFO);
11327       offset += 2;
11328
11329       proto_tree_add_item(tree, hf_ieee80211_sched_srv_start, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11330       offset += 4;
11331
11332       proto_tree_add_item(tree, hf_ieee80211_sched_srv_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11333       offset += 4;
11334
11335       proto_tree_add_item(tree, hf_ieee80211_sched_spec_int, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11336       offset += 2;
11337       break;
11338
11339     case TAG_CHALLENGE_TEXT: /* 7.3.2.8 Challenge Text element (16) */
11340       offset += 2;
11341       proto_tree_add_item(tree, hf_ieee80211_tag_challenge_text, tvb, offset, tag_len, ENC_NA);
11342       break;
11343
11344     case TAG_POWER_CONSTRAINT: /* 7.3.2.15 Power Constraint element (32) */
11345     {
11346       if (tag_len != 1)
11347       {
11348         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 1", tag_len);
11349         break;
11350       }
11351       offset += 2;
11352
11353       proto_tree_add_item(tree, hf_ieee80211_tag_power_constraint_local, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11354       proto_item_append_text(ti, ": %d", tvb_get_guint8(tvb, offset));
11355       offset += 1;
11356
11357       break;
11358     }
11359
11360     case TAG_POWER_CAPABILITY: /* 7.3.2.16 Power Capability element (33) */
11361     {
11362       if (tag_len != 2)
11363       {
11364         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 2", tag_len);
11365         break;
11366       }
11367       offset += 2;
11368
11369       proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_min, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11370       proto_item_append_text(ti, " Min: %d", tvb_get_guint8(tvb, offset));
11371       offset += 1;
11372
11373       proto_tree_add_item(tree, hf_ieee80211_tag_power_capability_max, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11374       proto_item_append_text(ti, ", Max :%d", tvb_get_guint8(tvb, offset));
11375       offset += 1;
11376       break;
11377     }
11378
11379     case TAG_TPC_REQUEST: /* 7.3.2.18 TPC Request element (34) */
11380     {
11381       if (tag_len != 0)
11382       {
11383         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 0", tag_len);
11384         break;
11385       }
11386       offset += 2;
11387
11388       /* No Data */
11389       break;
11390     }
11391
11392     case TAG_TPC_REPORT: /* 7.3.2.18 TPC Report element (35) */
11393     {
11394       if (tag_len != 2)
11395       {
11396         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 2", tag_len);
11397         break;
11398       }
11399       offset += 2;
11400
11401       proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_trsmt_pow, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11402       proto_item_append_text(ti, " Transmit Power: %d", tvb_get_guint8(tvb, offset));
11403       offset += 1;
11404
11405       proto_tree_add_item(tree, hf_ieee80211_tag_tpc_report_link_mrg, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11406       proto_item_append_text(ti, ", Link Margin: %d", tvb_get_guint8(tvb, offset));
11407       offset += 1;
11408
11409       break;
11410     }
11411
11412     case TAG_SUPPORTED_CHANNELS: /* 7.3.2.19 Supported Channels element (36) */
11413       {
11414         proto_item *chan_item;
11415         proto_tree *chan_tree;
11416         guint       i = 1;
11417
11418         offset += 2;
11419         if (tag_len % 2 == 1) {
11420            expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u must be even",tag_len);
11421            break;
11422         }
11423         while (offset < tag_end)
11424         {
11425           chan_item = proto_tree_add_item(tree, hf_ieee80211_tag_supported_channels, tvb, offset, 2, ENC_NA);
11426           proto_item_append_text(chan_item, " #%d", i);
11427           i += 1;
11428
11429           chan_tree = proto_item_add_subtree(chan_item , ett_tag_supported_channels);
11430
11431           proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_first, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11432           proto_item_append_text(chan_item, " First: %d", tvb_get_guint8(tvb, offset));
11433           offset += 1;
11434
11435           proto_tree_add_item(chan_tree, hf_ieee80211_tag_supported_channels_range, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11436           proto_item_append_text(chan_item, ", Range: %d ", tvb_get_guint8(tvb, offset));
11437           offset += 1;
11438
11439         }
11440         break;
11441       }
11442     case TAG_CHANNEL_SWITCH_ANN: /* 7.3.2.20 Channel Switch Announcement element (37) */
11443     {
11444       if (tag_len != 3)
11445       {
11446         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 3", tag_len);
11447         break;
11448       }
11449       offset += 2;
11450
11451       proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11452       proto_item_append_text(ti, " Mode: %d", tvb_get_guint8(tvb, offset));
11453       offset += 1;
11454
11455       proto_tree_add_item(tree, hf_ieee80211_csa_new_channel_number, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11456       proto_item_append_text(ti, ", Number: %d ", tvb_get_guint8(tvb, offset));
11457       offset += 1;
11458
11459       proto_tree_add_item(tree, hf_ieee80211_csa_channel_switch_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11460       proto_item_append_text(ti, ", Count: %d ", tvb_get_guint8(tvb, offset));
11461       offset += 1;
11462
11463       break;
11464     }
11465
11466     case TAG_MEASURE_REQ: /* 7.3.2.21 Measurement Request element (38) with update from 802.11k-2008 */
11467       if (tag_len < 3)
11468       {
11469         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be >= 3", tag_len);
11470         break;
11471       }
11472       {
11473         guint8 request_type;
11474         proto_item *parent_item;
11475         proto_tree *sub_tree;
11476
11477         offset += 2;
11478
11479         proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_token, tvb, offset, 1, ENC_NA);
11480         offset += 1;
11481
11482         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_mode, tvb, offset, 1, ENC_NA);
11483         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_mode_tree);
11484         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_parallel, tvb, offset, 1, ENC_NA);
11485         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_enable, tvb, offset, 1, ENC_NA);
11486         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_request, tvb, offset, 1, ENC_NA);
11487         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_report, tvb, offset, 1, ENC_NA);
11488         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_duration_mandatory, tvb, offset, 1, ENC_NA);
11489         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mode_reserved, tvb, offset, 1, ENC_NA);
11490         offset += 1;
11491
11492
11493         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_request_type, tvb, offset, 1, ENC_NA);
11494         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_request_type_tree);
11495         request_type = tvb_get_guint8 (tvb, offset);
11496         offset += 1;
11497
11498         switch (request_type) {
11499           case 0: /* Basic Request */
11500           case 1: /* Clear channel assessment (CCA) request */
11501           case 2: /* Receive power indication (RPI) histogram request */
11502           {
11503
11504             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
11505             offset += 1;
11506
11507             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11508             offset += 8;
11509
11510             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11511             offset += 2;
11512             break;
11513           }
11514           case 3: /* Channel Load Request */
11515           case 4: /* Noise Histogram Request */
11516           {
11517             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_regulatory_class, tvb, offset, 1, ENC_NA);
11518             offset += 1;
11519
11520             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
11521             offset += 1;
11522
11523             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11524             offset += 2;
11525
11526             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11527             offset += 2;
11528             /* TODO Add Optional Subelements */
11529             break;
11530           }
11531           case 5: /* Beacon Request */
11532           {
11533             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_regulatory_class, tvb, offset, 1, ENC_NA);
11534             offset += 1;
11535
11536             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
11537             offset += 1;
11538
11539             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11540             offset += 2;
11541
11542             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11543             offset += 2;
11544
11545             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_measurement_mode, tvb, offset, 1, ENC_NA);
11546             offset += 1;
11547
11548             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_bssid, tvb, offset, 6, ENC_NA);
11549             offset += 6;
11550
11551             while (offset < tag_end)
11552             {
11553               guint8 sub_id, sub_length, sub_tag_end;
11554               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_id, tvb, offset, 1, ENC_NA);
11555               sub_id = tvb_get_guint8(tvb, offset);
11556               offset += 1;
11557
11558               proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_subelement_length, tvb, offset, 1, ENC_NA);
11559               sub_length = tvb_get_guint8(tvb, offset);
11560               offset += 1;
11561               sub_tag_end = offset + sub_length;
11562
11563               switch (sub_id) {
11564                 case MEASURE_REQ_BEACON_SUB_SSID: /* SSID (0) */
11565                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_ssid, tvb, offset, sub_length, ENC_ASCII|ENC_NA);
11566                   offset += sub_length;
11567                   break;
11568                 case MEASURE_REQ_BEACON_SUB_BRI: /* Beacon Reporting Information (1) */
11569                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition, tvb, offset, 1, ENC_BIG_ENDIAN);
11570                   offset += 1;
11571                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset, tvb, offset, 1, ENC_BIG_ENDIAN);
11572                   offset += 1;
11573                   break;
11574                 case MEASURE_REQ_BEACON_SUB_RD: /* Reporting Detail (2) */
11575                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail, tvb, offset, 1, ENC_BIG_ENDIAN);
11576                   offset += 1;
11577                   break;
11578                 case MEASURE_REQ_BEACON_SUB_REQUEST: /* Request (10) */
11579                   proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_sub_request, tvb, offset, 1, ENC_BIG_ENDIAN);
11580                   offset += 1;
11581                   break;
11582                 case MEASURE_REQ_BEACON_SUB_APCP: /* Request (51) */
11583                   /* TODO */
11584                   break;
11585                 default:
11586                   /* no default action */
11587                   break;
11588              }
11589              if (offset < sub_tag_end)
11590              {
11591                proto_item *tix;
11592                tix = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_beacon_unknown, tvb, offset, sub_tag_end - offset, ENC_NA);
11593                expert_add_info_format(pinfo, tix, PI_UNDECODED, PI_WARN, " Unknown Data (not interpreted)");
11594                offset = sub_tag_end;
11595              }
11596             }
11597
11598             break;
11599           }
11600           case 6: /* Frame Request */
11601           {
11602             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_regulatory_class, tvb, offset, 1, ENC_NA);
11603             offset += 1;
11604
11605             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_channel_number, tvb, offset, 1, ENC_NA);
11606             offset += 1;
11607
11608             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11609             offset += 2;
11610
11611             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11612             offset += 2;
11613
11614             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_frame_request_type, tvb, offset, 1, ENC_NA);
11615             offset += 1;
11616
11617             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_mac_address, tvb, offset, 6, ENC_NA);
11618             offset += 6;
11619
11620             /* TODO Add Optional Subelements */
11621             break;
11622           }
11623           case 7: /* BSTA Statistics Request */
11624           {
11625             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_peer_mac_address, tvb, offset, 6, ENC_NA);
11626             offset += 6;
11627
11628             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_randomization_interval, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11629             offset += 2;
11630
11631             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11632             offset += 2;
11633
11634             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_request_group_id, tvb, offset, 1, ENC_NA);
11635             offset += 1;
11636
11637             /* TODO Add Optional Subelements */
11638             break;
11639           }
11640           case 8: /* Location Configuration Indication (LCI) Request */
11641             /* TODO */
11642           case 9: /* Transmit Stream Measurement Request */
11643             /* TODO */
11644           case 255: /* Measurement Pause Request*/
11645             /* TODO */
11646           default: /* unknown */
11647             break;
11648         }
11649       }
11650
11651       break;
11652     case TAG_MEASURE_REP: /* 7.3.2.22 Measurement Report element (39) with update from 802.11k-2008 */
11653       if (tag_len < 3)
11654       {
11655         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be >= 3", tag_len);
11656         break;
11657       }
11658       {
11659         proto_item *parent_item;
11660         proto_tree *sub_tree;
11661         guint8 report_type;
11662
11663         offset += 2;
11664         proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_measurement_token, tvb, offset, 1, ENC_NA);
11665         offset += 1;
11666
11667         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_mode, tvb, offset, 1, ENC_NA);
11668         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_mode_tree);
11669         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_late, tvb, offset, 1, ENC_NA);
11670         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_incapable, tvb, offset, 1, ENC_NA);
11671         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_refused, tvb, offset, 1, ENC_NA);
11672         proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_mode_reserved, tvb, offset, 1, ENC_NA);
11673         offset += 1;
11674
11675         report_type = tvb_get_guint8(tvb, offset);
11676         parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_report_type, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11677         sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_type_tree);
11678         offset += 1;
11679
11680         if (tag_len == 3)
11681             break;
11682         switch (report_type) {
11683           case 0: /* Basic Report */
11684           {
11685             proto_tree *sub_tree_map_field;
11686
11687             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11688             offset += 1;
11689
11690             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11691             offset += 8;
11692
11693             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11694             offset += 2;
11695
11696
11697             parent_item = proto_tree_add_item(tree, hf_ieee80211_tag_measure_basic_map_field, tvb, offset, 1, ENC_NA);
11698             sub_tree_map_field = proto_item_add_subtree(parent_item, ett_tag_measure_report_basic_map_tree);
11699             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_bss, tvb, offset, 1, ENC_NA);
11700             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_odfm, tvb, offset, 1, ENC_NA);
11701             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_unident_signal, tvb, offset, 1, ENC_NA);
11702             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_radar, tvb, offset, 1, ENC_NA);
11703             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_unmeasured, tvb, offset, 1, ENC_NA);
11704             proto_tree_add_item(sub_tree_map_field, hf_ieee80211_tag_measure_map_field_reserved, tvb, offset, 1, ENC_NA);
11705             break;
11706           }
11707           case 1: /* Clear channel assessment (CCA) report */
11708             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11709             offset += 1;
11710
11711             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11712             offset += 8;
11713
11714             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11715             offset += 2;
11716
11717             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_cca_busy_fraction, tvb, offset, 1, ENC_NA);
11718             offset += 1;
11719             break;
11720           case 2: /* Receive power indication (RPI) histogram report */
11721             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11722             offset += 1;
11723
11724             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11725             offset += 8;
11726
11727             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11728             offset += 2;
11729
11730             parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report, tvb, offset, 8, ENC_NA);
11731             sub_tree = proto_item_add_subtree(parent_item, ett_tag_measure_report_rpi_tree);
11732
11733             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_0, tvb, offset, 1, ENC_NA);
11734             offset += 1;
11735
11736             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_1, tvb, offset, 1, ENC_NA);
11737             offset += 1;
11738
11739             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_2, tvb, offset, 1, ENC_NA);
11740             offset += 1;
11741
11742             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_3, tvb, offset, 1, ENC_NA);
11743             offset += 1;
11744
11745             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_4, tvb, offset, 1, ENC_NA);
11746             offset += 1;
11747
11748             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_5, tvb, offset, 1, ENC_NA);
11749             offset += 1;
11750
11751             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_6, tvb, offset, 1, ENC_NA);
11752             offset += 1;
11753
11754             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_rpi_histogram_report_7, tvb, offset, 1, ENC_NA);
11755             offset += 1;
11756             break;
11757           case 3: /* Channel Load Report */
11758           {
11759             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_regulatory_class, tvb, offset, 1, ENC_NA);
11760             offset += 1;
11761
11762             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11763             offset += 1;
11764
11765             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11766             offset += 8;
11767
11768             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11769             offset += 2;
11770
11771             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_load, tvb, offset, 1, ENC_NA);
11772             offset += 1;
11773
11774             /* TODO Add Optional Subelements */
11775             break;
11776           }
11777           case 4: /* Noise Histogram Report */
11778             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_regulatory_class, tvb, offset, 1, ENC_NA);
11779             offset += 1;
11780
11781             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11782             offset += 1;
11783
11784             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11785             offset += 8;
11786
11787             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11788             offset += 2;
11789
11790             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
11791             offset += 1;
11792
11793             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_anpi, tvb, offset, 1, ENC_NA);
11794             offset += 1;
11795
11796             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_0, tvb, offset, 1, ENC_NA);
11797             offset += 1;
11798
11799             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_1, tvb, offset, 1, ENC_NA);
11800             offset += 1;
11801
11802             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_2, tvb, offset, 1, ENC_NA);
11803             offset += 1;
11804
11805             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_3, tvb, offset, 1, ENC_NA);
11806             offset += 1;
11807
11808             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_4, tvb, offset, 1, ENC_NA);
11809             offset += 1;
11810
11811             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_5, tvb, offset, 1, ENC_NA);
11812             offset += 1;
11813
11814             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_6, tvb, offset, 1, ENC_NA);
11815             offset += 1;
11816
11817             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_7, tvb, offset, 1, ENC_NA);
11818             offset += 1;
11819
11820             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_8, tvb, offset, 1, ENC_NA);
11821             offset += 1;
11822
11823             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_9, tvb, offset, 1, ENC_NA);
11824             offset += 1;
11825
11826             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ipi_density_10, tvb, offset, 1, ENC_NA);
11827             offset += 1;
11828
11829             /* TODO Add Optional Subelements */
11830             break;
11831           case 5: /* Beacon Report */
11832           {
11833             proto_tree *sub_tree_frame_info;
11834
11835             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_regulatory_class, tvb, offset, 1, ENC_NA);
11836             offset += 1;
11837
11838             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11839             offset += 1;
11840
11841             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11842             offset += 8;
11843
11844             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11845             offset += 2;
11846
11847             parent_item = proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_frame_info, tvb, offset, 1, ENC_NA);
11848             sub_tree_frame_info = proto_item_add_subtree(parent_item, ett_tag_measure_report_frame_tree);
11849             proto_tree_add_item(sub_tree_frame_info, hf_ieee80211_tag_measure_report_frame_info_phy_type, tvb, offset, 1, ENC_NA);
11850             proto_tree_add_item(sub_tree_frame_info, hf_ieee80211_tag_measure_report_frame_info_frame_type, tvb, offset, 1, ENC_NA);
11851             offset += 1;
11852
11853             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rcpi, tvb, offset, 1, ENC_NA);
11854             offset += 1;
11855
11856             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_rsni, tvb, offset, 1, ENC_NA);
11857             offset += 1;
11858
11859             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_bssid, tvb, offset, 6, ENC_NA);
11860             offset += 6;
11861
11862             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_ant_id, tvb, offset, 1, ENC_NA);
11863             offset += 1;
11864
11865             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_parent_tsf, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11866             offset += 4;
11867             /* TODO Add Optional Subelements */
11868             break;
11869           }
11870           case 6: /* Frame Report */
11871             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_regulatory_class, tvb, offset, 1, ENC_NA);
11872             offset += 1;
11873
11874             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_channel_number, tvb, offset, 1, ENC_NA);
11875             offset += 1;
11876
11877             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_start_time, tvb, offset, 8, ENC_LITTLE_ENDIAN);
11878             offset += 8;
11879
11880             proto_tree_add_item(sub_tree, hf_ieee80211_tag_measure_report_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11881             offset += 2;
11882
11883             /* TODO Add Optional Subelements */
11884             break;
11885           case 7: /* BSTA Statistics Report */
11886             /* TODO */
11887           case 8: /* Location Configuration Information Report element */
11888             /* TODO */
11889           case 9: /* Transmit Stream Measurement Report */
11890             /* TODO */
11891           default: /* unknown */
11892             break;
11893         }
11894       }
11895
11896     case TAG_QUIET: /* 7.3.2.23 Quiet element (40) */
11897       if (tag_len != 6)
11898       {
11899         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 6", tag_len);
11900         break;
11901       }
11902       offset += 2;
11903
11904       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_count, tvb, offset, 1, ENC_NA);
11905       proto_item_append_text(ti, " Count: %d", tvb_get_guint8(tvb, offset));
11906       offset += 1;
11907
11908       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_period, tvb, offset, 1, ENC_NA);
11909       proto_item_append_text(ti, " Period: %d", tvb_get_guint8(tvb, offset));
11910       offset += 1;
11911
11912       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_duration, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11913       proto_item_append_text(ti, " Duration: %d", tvb_get_letohs(tvb, offset));
11914       offset += 2;
11915
11916       proto_tree_add_item(tree, hf_ieee80211_tag_quiet_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
11917       proto_item_append_text(ti, " Offset: %d", tvb_get_letohs(tvb, offset));
11918       offset += 2;
11919       break;
11920
11921
11922     case TAG_IBSS_DFS: /* 7.3.2.24 IBSS DFS element (41) */
11923       if (tag_len < 7)
11924       {
11925         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be >= 7", tag_len);
11926         break;
11927       }
11928       {
11929         proto_item *ti_sup_map;
11930         proto_tree *sub_map_tree;
11931         offset += 2;
11932
11933         proto_tree_add_item(tree, hf_ieee80211_tag_dfs_owner, tvb, offset, 6, ENC_NA);
11934         proto_item_append_text(ti, " Owner: %s", tvb_ether_to_str(tvb, offset));
11935         offset += 6;
11936
11937         proto_tree_add_item(tree, hf_ieee80211_tag_dfs_recovery_interval, tvb, offset, 1, ENC_NA);
11938         offset += 1;
11939
11940         while (offset < tag_end)
11941         {
11942           ti_sup_map = proto_tree_add_item(tree, hf_ieee80211_tag_dfs_channel_map, tvb, offset, 2, ENC_NA);
11943           sub_map_tree = proto_item_add_subtree(ti_sup_map, ett_tag_dfs_map_tree);
11944           proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_channel_number, tvb, offset, 1, ENC_NA);
11945           proto_tree_add_item(sub_map_tree, hf_ieee80211_tag_dfs_map, tvb, offset, 1, ENC_NA);
11946           offset += 2;
11947         }
11948         break;
11949       }
11950     case TAG_ERP_INFO: /* 7.3.2.13 ERP Information element (42) */
11951     case TAG_ERP_INFO_OLD:
11952       if (tag_len != 1)
11953       {
11954         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 1", tag_len);
11955         break;
11956       }
11957       {
11958         proto_item *ti_erp;
11959         proto_tree *erp_tree;
11960
11961         offset += 2;
11962
11963         ti_erp = proto_tree_add_item(tree, hf_ieee80211_tag_erp_info, tvb, offset, 1, ENC_NA);
11964         erp_tree = proto_item_add_subtree(ti_erp, ett_tag_erp_info_tree);
11965         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_erp_present, tvb, offset, 1, ENC_NA);
11966         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_use_protection, tvb, offset, 1, ENC_NA);
11967         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_barker_preamble_mode, tvb, offset, 1, ENC_NA);
11968         proto_tree_add_item(erp_tree, hf_ieee80211_tag_erp_info_reserved, tvb, offset, 1, ENC_NA);
11969         offset += 1;
11970         break;
11971       }
11972
11973     case TAG_TS_DELAY: /* 7.3.2.32 TS Delay element (43) */
11974       if (tag_len != 4)
11975       {
11976         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 4", tag_len);
11977         break;
11978       }
11979       offset += 2;
11980
11981       proto_tree_add_item(tree, hf_ieee80211_ts_delay, tvb, offset, 4, ENC_LITTLE_ENDIAN);
11982       proto_item_append_text(ti, " : %d", tvb_get_ntohl(tvb, offset));
11983       offset += 4;
11984       break;
11985
11986     case TAG_TCLAS_PROCESS: /* 7.3.2.33 TCLAS Processing element (44) */
11987       if (tag_len != 1)
11988       {
11989         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 1", tag_len);
11990         break;
11991       }
11992       offset += 2;
11993
11994       proto_tree_add_item(tree, hf_ieee80211_tclas_process, tvb, offset, 1, ENC_LITTLE_ENDIAN);
11995       proto_item_append_text(ti, " : %s", val_to_str(tvb_get_guint8(tvb, offset), ieee80211_tclas_process_flag, "Unknown %d"));
11996       offset += 1;
11997       break;
11998
11999     case TAG_QOS_CAPABILITY: /* 7.3.2.35 QoS Capability element (46) */
12000       if (tag_len != 1)
12001       {
12002         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be = 1", tag_len);
12003         break;
12004       }
12005       {
12006         /* proto_item *ti_cap;
12007         proto_tree *cap_tree; */
12008         offset += 2;
12009         offset = dissect_qos_capability(tree, tvb, pinfo, offset, ftype);
12010       }
12011       break;
12012
12013     case TAG_RSN_IE: /* 7.3.2.25 RSN information element (48) */
12014       if (tag_len < 18)
12015       {
12016         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be >= 18", tag_len);
12017         break;
12018       }
12019       offset += 2;
12020
12021       offset = dissect_rsn_ie(pinfo, tree, tvb, offset, tag_len);
12022       break;
12023
12024     case TAG_EXT_SUPP_RATES: /* 7.3.2.14 Extended Supported Rates element (50) */
12025       if (tag_len < 1)
12026       {
12027         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag length %u too short, must be greater than 0", tag_len);
12028         break;
12029       }
12030       offset += 2;
12031
12032       while (offset < tag_end)
12033       {
12034         proto_tree_add_item(tree, hf_ieee80211_tag_ext_supp_rates, tvb, offset, 1, ENC_NA);
12035         proto_item_append_text(ti, " %s,", val_to_str_ext_const(tvb_get_guint8(tvb, offset), &ieee80211_supported_rates_vals_ext, "Unknown Rate"));
12036         offset += 1;
12037       }
12038       proto_item_append_text(ti, " [Mbit/sec]");
12039       break;
12040
12041     case TAG_EXTENDED_CAPABILITIES: /* 7.3.2.27 Extended Capabilities information element (127) */
12042       dissect_extended_capabilities_ie(pinfo, tree, ti, ti_len, tag_len, tvb, offset+2, tag_end);
12043       break;
12044
12045     case TAG_CISCO_CCX1_CKIP: /* Cisco CCX1 CKIP + Device Name (133) */
12046       /* From WCS manual:
12047        * If Aironet IE support is enabled, the access point sends an Aironet
12048        * IE 0x85 (which contains the access point name, load, number of
12049        * associated clients, and so on) in the beacon and probe responses of
12050        * this WLAN, and the controller sends Aironet IEs 0x85 and 0x95
12051        * (which contains the management IP address of the controller and
12052        * the IP address of the access point) in the reassociation response
12053        * if it receives Aironet IE 0x85 in the reassociation request.
12054        */
12055
12056       if (tag_len < 26)
12057       {
12058         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u too short, must be >= 26", tag_len);
12059         break;
12060       }
12061       offset += 2;
12062       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown, tvb, offset, 10, ENC_NA);
12063       offset += 10;
12064
12065       /* The Name of the sending device starts at offset 10 and is up to
12066          15 or 16 bytes in length, \0 padded */
12067       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_name, tvb, offset, 16, ENC_ASCII|ENC_NA);
12068       offset += 16;
12069
12070       /* Total number off associated clients and repeater access points */
12071       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_clients, tvb, offset, 1, ENC_NA);
12072       offset += 1;
12073       proto_tree_add_item(tree, hf_ieee80211_tag_cisco_ccx1_unknown2, tvb, offset, 3, ENC_NA);
12074       offset += 3;
12075       break;
12076
12077     case TAG_VHT_CAPABILITY:
12078       dissect_vht_capability_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len);
12079       break;
12080
12081     case TAG_VHT_OPERATION:
12082       dissect_vht_operation_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len);
12083       break;
12084
12085     case TAG_VENDOR_SPECIFIC_IE: /* 7.3.2.26 Vendor Specific information element (221) */
12086       if (tag_len < 3)
12087       {
12088         expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR, "Tag Length %u wrong, must be >= 3", tag_len);
12089         break;
12090       }
12091       {
12092         guint32 tag_vs_len = tag_len;
12093
12094         offset += 2;
12095         oui = tvb_get_ntoh24(tvb, offset);
12096         tag_tvb = tvb_new_subset(tvb, offset, tag_len, tag_len);
12097         proto_tree_add_item(tree, hf_ieee80211_tag_oui, tvb, offset, 3, ENC_NA);
12098         proto_item_append_text(ti, ": %s", uint_get_manuf_name(oui));
12099         offset += 3;
12100         tag_vs_len -= 3;
12101
12102         if (tag_len > 0) {
12103           proto_tree_add_item(ti, hf_ieee80211_tag_vendor_oui_type, tvb, offset, 1, ENC_BIG_ENDIAN);
12104         }
12105
12106       switch (oui) {
12107         /* 802.11 specific vendor ids */
12108         case OUI_WPAWME:
12109           offset = dissect_vendor_ie_wpawme(tree, tvb, pinfo, offset, tag_vs_len, ftype);
12110           break;
12111         case OUI_RSN:
12112           dissect_vendor_ie_rsn(ti, tree, tvb, offset, tag_vs_len);
12113           break;
12114         case OUI_PRE11N:
12115           dissect_vendor_ie_ht(tvb, pinfo, tree, offset, ti, ti_len, tag_vs_len);
12116           break;
12117         case OUI_WFA:
12118           dissect_vendor_ie_wfa(pinfo, ti, tag_tvb);
12119           break;
12120
12121         /* Normal IEEE vendor ids (from oui.h) */
12122         case OUI_CISCOWL:  /* Cisco Wireless (Aironet) */
12123           dissect_vendor_ie_aironet(ti, tree, tvb, offset, tag_vs_len);
12124           break;
12125         case OUI_MARVELL:
12126           dissect_vendor_ie_marvell(ti, tree, tvb, offset, tag_vs_len);
12127           break;
12128         case OUI_ATHEROS:
12129           dissect_vendor_ie_atheros(ti, tree, tvb, offset, tag_vs_len, pinfo, ti_len);
12130           break;
12131         case OUI_ARUBA:
12132           dissect_vendor_ie_aruba(ti, tree, tvb, offset, tag_vs_len);
12133           break;
12134         default:
12135           proto_tree_add_item(tree, hf_ieee80211_tag_vendor_data, tvb, offset, tag_vs_len, ENC_NA);
12136           break;
12137         }
12138
12139       }
12140       break;
12141
12142     case TAG_MOBILITY_DOMAIN:
12143       dissect_mobility_domain(tree, tvb, offset + 2, tag_len);
12144       break;
12145
12146     case TAG_FAST_BSS_TRANSITION:
12147       dissect_fast_bss_transition(tree, tvb, offset + 2, tag_len);
12148       break;
12149
12150     case TAG_MMIE:
12151       dissect_mmie(tree, tvb, offset + 2, tag_len);
12152       break;
12153
12154     case TAG_SSID_LIST:
12155       dissect_ssid_list(tree, tvb, offset + 2, tag_len);
12156       break;
12157
12158     case TAG_TIME_ZONE:
12159       dissect_time_zone(tree, tvb, offset + 2, tag_len);
12160       break;
12161
12162     case TAG_TIMEOUT_INTERVAL:
12163       dissect_timeout_interval(tree, tvb, pinfo, offset + 2, tag_len);
12164       break;
12165
12166     case TAG_RIC_DATA: /* RIC Data (RDE) (57) */
12167      /* Assigning the return value will ensure that the IE after RIC is processed
12168       * only once. This gives us a good looking RIC IE :-)
12169       */
12170       tag_len = dissect_ric_data(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len, ftype);
12171       break;
12172
12173     case TAG_LINK_IDENTIFIER:
12174       dissect_link_identifier(tree, tvb, offset + 2, tag_len);
12175       break;
12176
12177     case TAG_WAKEUP_SCHEDULE:
12178       dissect_wakeup_schedule(tree, tvb, offset + 2, tag_len);
12179       break;
12180
12181     case TAG_CHANNEL_SWITCH_TIMING:
12182       dissect_channel_switch_timing(tree, tvb, offset + 2, tag_len);
12183       break;
12184
12185     case TAG_PTI_CONTROL:
12186       dissect_pti_control(tree, tvb, offset + 2, tag_len);
12187       break;
12188
12189     case TAG_PU_BUFFER_STATUS:
12190       dissect_pu_buffer_status(tree, tvb, offset + 2, tag_len);
12191       break;
12192
12193     case TAG_HT_CAPABILITY:
12194       dissect_ht_capability_ie(tvb, pinfo, tree, offset+2, tag_len, ti_len, FALSE);
12195       break;
12196
12197     case TAG_HT_INFO:
12198       dissect_ht_info_ie_1_1(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12199       break;
12200
12201     case TAG_SECONDARY_CHANNEL_OFFSET:
12202       dissect_secondary_channel_offset_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12203       break;
12204
12205     case TAG_BSS_AVG_ACCESS_DELAY: /* BSS Average Access Delay element (63) */
12206       dissect_bss_avg_access_delay_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12207       break;
12208
12209     case TAG_ANTENNA: /* Antenna element (64) */
12210       dissect_antenna_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12211       break;
12212
12213     case TAG_RSNI: /* RSNI element (65) */
12214       dissect_rsni_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12215       break;
12216
12217     case TAG_BSS_AVB_ADM_CAPACITY:
12218       dissect_bss_available_admission_capacity_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12219       break;
12220
12221     case TAG_IE_68_CONFLICT: /* Conflict: WAPI Vs. IEEE */
12222       if (tag_len >= 20) { /* It Might be WAPI*/
12223         dissect_wapi_param_set(tvb, pinfo, tree, offset + 2,tag_len, ti_len, ti, ftype);
12224       }
12225       else { /* BSS AC Access Delay (68) */
12226         dissect_bss_ac_access_delay_ie(tvb, pinfo, tree, offset + 2, tag_len, ti_len);
12227       }
12228       break;
12229
12230     case TAG_BSS_MAX_IDLE_PERIOD:
12231       dissect_bss_max_idle_period(tree, tvb, offset + 2);
12232       break;
12233
12234     case TAG_TFS_REQUEST:
12235       dissect_tfs_request(pinfo, tree, tvb, offset + 2, tag_len, ftype);
12236       break;
12237
12238     case TAG_TFS_RESPONSE:
12239       dissect_tfs_response(pinfo, tree, tvb, offset + 2, tag_len, ftype);
12240       break;
12241
12242     case TAG_WNM_SLEEP_MODE:
12243       dissect_wnm_sleep_mode(tree, tvb, offset + 2);
12244       break;
12245
12246     case TAG_TIME_ADV:
12247       dissect_time_adv(tree, tvb, offset + 2);
12248       break;
12249
12250     case TAG_RM_ENABLED_CAPABILITY: /* RM Enabled Capabilities (70) */
12251       dissect_rm_enabled_capabilities_ie(pinfo, tree, ti, ti_len, tag_len, tvb, offset+2, tag_end);
12252       break;
12253
12254     case TAG_RIC_DESCRIPTOR: /* RIC Descriptor (75) */
12255       dissect_ric_descriptor(pinfo, tree, tvb, offset + 2, tag_len, ti, ti_len);
12256       break;
12257
12258     case TAG_MESH_PEERING_MGMT:
12259       {
12260         guint start = offset + 2;
12261         offset += 2;
12262         proto_tree_add_item (tree, hf_ieee80211_mesh_peering_proto, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12263         offset += 2;
12264         proto_tree_add_item (tree, hf_ieee80211_mesh_peering_local_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12265         offset += 2;
12266         switch (tvb_get_guint8(tvb, 1))
12267           {                                         /* Self-protected action field */
12268           case SELFPROT_ACTION_MESH_PEERING_OPEN:
12269             break;
12270
12271           case SELFPROT_ACTION_MESH_PEERING_CONFIRM:
12272             proto_tree_add_item (tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12273             offset += 2;
12274             break;
12275
12276           case SELFPROT_ACTION_MESH_PEERING_CLOSE:
12277             if ((tag_len == 8) || (tag_len == 24))
12278               {
12279                 proto_tree_add_item (tree, hf_ieee80211_mesh_peering_peer_link_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
12280                 offset += 2;
12281               }
12282             offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
12283             break;
12284
12285           /* unexpected values */
12286           default:
12287             proto_tree_add_text (tree, tvb, offset, tag_len, "Unexpected Self-protected action");
12288             offset += tag_len;
12289             break;
12290           }
12291         if (tag_len - (offset - start) == 16)
12292           {
12293             proto_tree_add_item(tree, hf_ieee80211_rsn_pmkid, tvb, offset, 16, ENC_NA);
12294             offset += 16;
12295           }
12296         break;
12297       }
12298
12299     case TAG_MESH_CONFIGURATION:
12300       {
12301         offset += 2;
12302         proto_tree_add_item (tree, hf_ieee80211_mesh_config_path_sel_protocol, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12303         proto_tree_add_item (tree, hf_ieee80211_mesh_config_path_sel_metric, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
12304         proto_tree_add_item (tree, hf_ieee80211_mesh_config_congestion_control, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN);
12305         proto_tree_add_item (tree, hf_ieee80211_mesh_config_sync_method, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN);
12306         proto_tree_add_item (tree, hf_ieee80211_mesh_config_auth_protocol, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN);
12307         proto_tree_add_item (tree, hf_ieee80211_mesh_config_formation_info, tvb, offset + 5, 1, ENC_LITTLE_ENDIAN);
12308         proto_tree_add_item (tree, hf_ieee80211_mesh_config_capability, tvb, offset + 6, 1, ENC_LITTLE_ENDIAN);
12309         break;
12310       }
12311
12312     case TAG_MESH_ID:
12313       {
12314         offset += 2;
12315
12316         proto_tree_add_item(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA);
12317         if (tag_len > 0) {
12318             col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", tvb_get_ephemeral_string(tvb, offset, tag_len));
12319             proto_item_append_text(ti, ": %s", tvb_get_ephemeral_string(tvb, offset, tag_len));
12320         }
12321
12322       break;
12323       }
12324
12325     case TAG_MESH_PREQ:
12326       {
12327         guint8 flags = tvb_get_guint8(tvb, offset + 2);
12328         guint8 targs, i;
12329         proto_item *item;
12330         proto_tree *subtree;
12331
12332         offset += 2;
12333         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12334         offset += 1;
12335         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12336         offset += 1;
12337         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12338         offset += 1;
12339         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_pdid, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12340         offset += 4;
12341         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
12342         offset += 6;
12343         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12344         offset += 4;
12345
12346         if (flags & (1<<6)) {
12347           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_ext, tvb, offset, 6, ENC_NA);
12348           offset += 6;
12349         }
12350         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12351         offset += 4;
12352         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12353         offset += 4;
12354         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12355         targs = tvb_get_guint8 (tvb, offset);
12356         offset += 1;
12357         for (i = 0; i < targs; i++) {
12358           item = proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12359           subtree = proto_item_add_subtree(item, ett_hwmp_targ_flags_tree);
12360           proto_tree_add_boolean(subtree, hf_ieee80211_ff_hwmp_targ_to_flags, tvb, offset, 1, flags);
12361           proto_tree_add_boolean(subtree, hf_ieee80211_ff_hwmp_targ_usn_flags, tvb, offset, 1, flags);
12362           offset += 1;
12363           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
12364           offset += 6;
12365           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12366           offset += 4;
12367         }
12368         break;
12369       }
12370
12371     case TAG_MESH_PREP:
12372       {
12373         guint8 flags = tvb_get_guint8(tvb, offset + 2);
12374         offset += 2;
12375         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12376         offset += 1;
12377         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12378         offset += 1;
12379         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset , 1, ENC_LITTLE_ENDIAN);
12380         offset += 1;
12381         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
12382         offset += 6;
12383         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12384         offset += 4;
12385         if (flags & (1<<6)) {
12386           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
12387           offset += 6;
12388         }
12389         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_lifetime, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12390         offset += 4;
12391         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12392         offset += 4;
12393         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sta, tvb, offset, 6, ENC_NA);
12394         offset += 6;
12395         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_orig_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12396         offset += 4;
12397         break;
12398       }
12399
12400     case TAG_MESH_PERR:
12401       {
12402         guint8 targs, i;
12403
12404         offset += 2;
12405         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12406         offset += 1;
12407         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_count, tvb, offset, 1, ENC_BIG_ENDIAN);
12408         targs = tvb_get_guint8 (tvb, offset);
12409         offset += 1;
12410         for (i = 0; i < targs; i++) {
12411           guint8 flags = tvb_get_guint8(tvb, offset);
12412
12413           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
12414           offset += 1;
12415           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sta, tvb, offset, 6, ENC_NA);
12416           offset += 6;
12417           proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12418           offset += 4;
12419           if (flags & (1<<6)) {
12420             proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_targ_ext, tvb, offset, 6, ENC_NA);
12421             offset += 6;
12422           }
12423           offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_REASON_CODE);
12424         }
12425         break;
12426       }
12427
12428     case TAG_RANN:
12429       {
12430         offset += 2;
12431         proto_tree_add_item (tree, hf_ieee80211_rann_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
12432         offset += 1;
12433         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_hopcount, tvb, offset, 1, ENC_BIG_ENDIAN);
12434         offset += 1;
12435         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_ttl, tvb, offset, 1, ENC_BIG_ENDIAN);
12436         offset += 1;
12437         proto_tree_add_item (tree, hf_ieee80211_rann_root_sta, tvb, offset, 6, ENC_NA);
12438         offset += 6;
12439         proto_tree_add_item (tree, hf_ieee80211_rann_sn, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12440         offset += 4;
12441         proto_tree_add_item (tree, hf_ieee80211_rann_interval, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12442         offset += 4;
12443         proto_tree_add_item (tree, hf_ieee80211_ff_hwmp_metric, tvb, offset, 4, ENC_LITTLE_ENDIAN);
12444         offset += 4;
12445         break;
12446       }
12447       break;
12448
12449     case TAG_INTERWORKING:
12450       dissect_interworking(pinfo, tree, ti, tvb, offset);
12451       break;
12452     case TAG_ADVERTISEMENT_PROTOCOL:
12453     {
12454       dissect_advertisement_protocol(pinfo, tree, tvb, offset, NULL);
12455       break;
12456     }
12457     case TAG_ROAMING_CONSORTIUM:
12458       dissect_roaming_consortium(pinfo, tree, ti, tvb, offset);
12459       break;
12460     case TAG_AP_CHANNEL_REPORT: /* 7.3.2.36 AP Channel Report element */
12461       dissect_ap_channel_report(tvb, pinfo, tree, offset + 2, tag_len, ti_len, tag_end, ti);
12462       break;
12463     case TAG_NEIGHBOR_REPORT:
12464     {
12465       #define SUB_TAG_TSF_INFO                 0x01
12466       #define SUB_TAG_MEASUREMENT_PILOT_INFO   0x02
12467       #define SUB_TAG_HT_CAPABILITIES          0x03
12468       #define SUB_TAG_HT_INFO                  0x04
12469       #define SUB_TAG_SEC_CHANNEL_OFFSET       0x05
12470       #define SUB_TAG_VENDOR_SPECIFIC          0xDD
12471
12472
12473       guint tag_offset;
12474       guint8 sub_tag_id;
12475       guint32 bssid_info, info, sub_tag_length;
12476       proto_item *parent_item;
12477       proto_tree *bssid_info_subtree, *sub_tag_tree;
12478       tvbuff_t *volatile sub_tag_tvb = NULL;
12479
12480       if (tag_len < 13)
12481       {
12482         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
12483             "Neighbor Report: Error: Tag length must be at least 13 bytes long");
12484         break;
12485       }
12486       offset += 2;
12487       tag_offset = offset;
12488
12489       proto_tree_add_item(tree, hf_ieee80211_tag_neighbor_report_bssid, tvb, offset, 6, ENC_NA);
12490
12491       /*** Begin: BSSID Information ***/
12492       offset += 6;
12493       bssid_info = tvb_get_letohl (tvb, offset);
12494       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);
12495       bssid_info_subtree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_bssid_info_tree);
12496
12497       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reachability, tvb, offset, 1, bssid_info);
12498       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_security, tvb, offset, 1, bssid_info);
12499       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_key_scope, tvb, offset, 1, bssid_info);
12500       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng, tvb, offset, 1, bssid_info);
12501       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos, tvb, offset, 1, bssid_info);
12502       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd, tvb, offset, 1, bssid_info);
12503       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt, tvb, offset, 1, bssid_info);
12504       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback, tvb, offset+1, 1, bssid_info);
12505       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback, tvb, offset+1, 1, bssid_info);
12506       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain, tvb, offset+1, 1, bssid_info);
12507       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput, tvb, offset+1, 1, bssid_info);
12508       proto_tree_add_uint(bssid_info_subtree, hf_ieee80211_tag_neighbor_report_bssid_info_reserved, tvb, offset+1, 3, (bssid_info & 0xfffff000) >> 12);
12509       /*** End: BSSID Information ***/
12510
12511       offset += 4;
12512       info = tvb_get_guint8 (tvb, offset);
12513       proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_reg_class, tvb, offset, 1, info, "Regulatory Class: 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_channel_number, tvb, offset, 1, info, "Channel Number: 0x%02X", info);
12518
12519       offset += 1;
12520       info = tvb_get_guint8 (tvb, offset);
12521       proto_tree_add_uint_format(tree, hf_ieee80211_tag_neighbor_report_phy_type, tvb, offset, 1, info, "PHY Type: 0x%02X", info);
12522
12523       offset += 1;
12524       sub_tag_id = tvb_get_guint8 (tvb, offset);
12525       offset += 1;
12526       sub_tag_length = tvb_get_guint8 (tvb, offset);
12527
12528       offset += 1;
12529       sub_tag_tvb = tvb_new_subset(tvb, offset, sub_tag_length, -1);
12530
12531       switch (sub_tag_id) {
12532         case SUB_TAG_TSF_INFO:
12533           /* TODO */
12534           break;
12535         case SUB_TAG_MEASUREMENT_PILOT_INFO:
12536           /* TODO */
12537           break;
12538         case SUB_TAG_HT_CAPABILITIES:
12539           parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "HT Capabilities");
12540           sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
12541           dissect_ht_capability_ie(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len, FALSE);
12542           break;
12543         case SUB_TAG_HT_INFO:
12544           parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "HT Information");
12545           sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
12546           dissect_ht_info_ie_1_1(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len);
12547           break;
12548         case SUB_TAG_SEC_CHANNEL_OFFSET:
12549           parent_item = proto_tree_add_text (tree, tvb, offset, sub_tag_length, "Secondary Channel Offset");
12550           sub_tag_tree = proto_item_add_subtree(parent_item, ett_tag_neighbor_report_sub_tag_tree);
12551           dissect_secondary_channel_offset_ie(sub_tag_tvb, pinfo, sub_tag_tree, 0, sub_tag_length, ti_len);
12552           break;
12553         case SUB_TAG_VENDOR_SPECIFIC:
12554         default:
12555           break;
12556       }
12557
12558       offset += sub_tag_length;
12559
12560       if (tag_len > (offset - tag_offset))
12561       {
12562         proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
12563         break;
12564       }
12565       break;
12566     }
12567
12568     case TAG_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT:
12569     {
12570       guint tag_offset;
12571
12572       if (tag_len != 4)
12573       {
12574         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
12575             "Extended Channel Switch Announcement: Error: Tag length must be exactly 4 bytes long");
12576         break;
12577       }
12578
12579       offset += 2;
12580       tag_offset = offset;
12581
12582       offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_EXTENDED_CHANNEL_SWITCH_ANNOUNCEMENT);
12583
12584       if (tag_len > (offset - tag_offset))
12585       {
12586         proto_tree_add_text (tree, tvb, offset, tag_len - (offset - tag_offset), "Unknown Data");
12587         break;
12588       }
12589       break;
12590     }
12591     case TAG_SUPPORTED_REGULATORY_CLASSES:
12592     {
12593       guint8 current_field;
12594       guint i;
12595
12596       if (tag_len < 2) {
12597         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
12598             "Supported Regulatory Classes: Error: Tag length must be at least 2 bytes long");
12599         break;
12600       } else if (tag_len > 32) {
12601         proto_tree_add_text (tree, tvb, offset + 2, tag_len,
12602             "Supported Regulatory Classes: Error: Tag length must be no more than 32 bytes long");
12603         break;
12604       }
12605
12606       offset += 2;
12607
12608       current_field = tvb_get_guint8 (tvb, offset);
12609       proto_tree_add_uint(tree, hf_ieee80211_tag_supported_reg_classes_current, tvb, offset, 1, current_field);
12610
12611       offset += 1;
12612       /* Partially taken from the ssid section */
12613       tag_data_ptr = tvb_get_ptr (tvb, offset, tag_len);
12614       for (i = 0, n = 0; (i < tag_len) && (n < SHORT_STR); i++) {
12615         ret = g_snprintf (print_buff + n, SHORT_STR - n, (i == tag_len-1)?"%d":"%d, ", tag_data_ptr[i]);
12616         if (ret >= SHORT_STR - n) {
12617           /* ret >= <buf_size> means buffer truncated  */
12618           break;
12619         }
12620         n += ret;
12621       }
12622       proto_tree_add_string (tree, hf_ieee80211_tag_supported_reg_classes_alternate, tvb, offset, tag_len, print_buff);
12623
12624       break;
12625     }
12626     default:
12627       proto_tree_add_item(tree, hf_ieee80211_tag_data, tvb, offset + 1 + 1, tag_len, ENC_NA);
12628       expert_add_info_format(pinfo, ti_tag, PI_UNDECODED, PI_NOTE,
12629                              "Dissector for 802.11 IE Tag"
12630                              " (%s) code not implemented, Contact"
12631                              " Wireshark developers if you want this supported", val_to_str_ext(tag_no,
12632                                             &tag_num_vals_ext, "(%d)"));
12633       proto_item_append_text(ti, ": Undecoded");
12634       break;
12635   }
12636   if (offset < tag_end) {
12637     /* TODO: add Expert info to indicate there is unknown data ! but all tagged option don't yet return offset.
12638       For the moment, this code only remove Clang Warnings about not used offset... */
12639   }
12640   return tag_len + 1 + 1;
12641 }
12642
12643 void
12644 ieee_80211_add_tagged_parameters (tvbuff_t *tvb, int offset, packet_info *pinfo,
12645                                   proto_tree *tree, int tagged_parameters_len, int ftype)
12646 {
12647   int next_len;
12648
12649   beacon_padding = 0; /* this is for the beacon padding confused with ssid fix */
12650   while (tagged_parameters_len > 0) {
12651     if ((next_len=add_tagged_field (pinfo, tree, tvb, offset, ftype))==0)
12652       break;
12653     if (next_len > tagged_parameters_len) {
12654       /* XXX - flag this as an error? */
12655       next_len = tagged_parameters_len;
12656     }
12657     offset                += next_len;
12658     tagged_parameters_len -= next_len;
12659   }
12660 }
12661
12662 /* ************************************************************************* */
12663 /*                     Dissect 802.11 management frame                       */
12664 /* ************************************************************************* */
12665 static void
12666 dissect_ieee80211_mgt (guint16 fcf, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
12667 {
12668   proto_item *ti;
12669   proto_tree *mgt_tree;
12670   proto_tree *fixed_tree;
12671   proto_tree *tagged_tree;
12672   int         offset = 0;
12673   int         tagged_parameter_tree_len;
12674
12675   ieee80211_tvb_invalid = FALSE;
12676
12677   CHECK_DISPLAY_AS_X(data_handle,proto_wlan_mgt, tvb, pinfo, tree);
12678
12679   ti = proto_tree_add_item (tree, proto_wlan_mgt, tvb, 0, -1, ENC_NA);
12680   mgt_tree = proto_item_add_subtree (ti, ett_80211_mgt);
12681
12682   switch (COMPOSE_FRAME_TYPE(fcf))
12683   {
12684
12685     case MGT_ASSOC_REQ:
12686       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 4);
12687       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
12688       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_LISTEN_IVAL);
12689       offset = 4;  /* Size of fixed fields */
12690
12691       tagged_parameter_tree_len =
12692           tvb_reported_length_remaining(tvb, offset);
12693       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12694                  tagged_parameter_tree_len);
12695       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12696           tagged_parameter_tree_len, MGT_ASSOC_REQ);
12697       break;
12698
12699
12700     case MGT_ASSOC_RESP:
12701       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
12702       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
12703       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_STATUS_CODE);
12704       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_ASSOC_ID);
12705       offset = 6;  /* Size of fixed fields */
12706
12707       tagged_parameter_tree_len =
12708           tvb_reported_length_remaining(tvb, offset);
12709       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12710                  tagged_parameter_tree_len);
12711       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12712           tagged_parameter_tree_len, MGT_ASSOC_RESP);
12713       break;
12714
12715
12716     case MGT_REASSOC_REQ:
12717       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 10);
12718       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
12719       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_LISTEN_IVAL);
12720       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_CURRENT_AP_ADDR);
12721       offset = 10;  /* Size of fixed fields */
12722
12723       tagged_parameter_tree_len =
12724           tvb_reported_length_remaining(tvb, offset);
12725       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12726                  tagged_parameter_tree_len);
12727       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12728           tagged_parameter_tree_len, MGT_REASSOC_REQ);
12729       break;
12730
12731     case MGT_REASSOC_RESP:
12732       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
12733       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_CAP_INFO);
12734       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_STATUS_CODE);
12735       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_ASSOC_ID);
12736       offset = 6;  /* Size of fixed fields */
12737
12738       tagged_parameter_tree_len =
12739           tvb_reported_length_remaining(tvb, offset);
12740       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12741                  tagged_parameter_tree_len);
12742       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12743           tagged_parameter_tree_len, MGT_REASSOC_RESP);
12744       break;
12745
12746
12747     case MGT_PROBE_REQ:
12748       offset = 0;
12749       tagged_parameter_tree_len =
12750           tvb_reported_length_remaining(tvb, offset);
12751       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12752                  tagged_parameter_tree_len);
12753       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12754           tagged_parameter_tree_len, MGT_PROBE_REQ);
12755       break;
12756
12757     case MGT_PROBE_RESP:
12758     {
12759       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
12760       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_TIMESTAMP);
12761       add_fixed_field(fixed_tree, tvb, pinfo, 8, FIELD_BEACON_INTERVAL);
12762       add_fixed_field(fixed_tree, tvb, pinfo, 10, FIELD_CAP_INFO);
12763       offset = 12;  /* Size of fixed fields */
12764
12765       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12766       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
12767       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_PROBE_RESP);
12768       break;
12769     }
12770     case MGT_MEASUREMENT_PILOT:
12771     {
12772       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
12773       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TIMESTAMP);
12774       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MEASUREMENT_PILOT_INT);
12775       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_BEACON_INTERVAL);
12776       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_CAP_INFO);
12777       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_COUNTRY_STR);
12778       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MAX_REG_PWR);
12779       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_MAX_TX_PWR);
12780       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TX_PWR_USED);
12781       offset += add_fixed_field(fixed_tree, tvb, pinfo, offset, FIELD_TRANSCEIVER_NOISE_FLOOR);
12782       /* TODO DS Parameter Set ??? */
12783
12784       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12785       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset, tagged_parameter_tree_len);
12786       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree, tagged_parameter_tree_len, MGT_MEASUREMENT_PILOT);
12787       break;
12788     }
12789     case MGT_BEACON:    /* Dissect protocol payload fields  */
12790       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 12);
12791       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_TIMESTAMP);
12792       add_fixed_field(fixed_tree, tvb, pinfo, 8, FIELD_BEACON_INTERVAL);
12793       add_fixed_field(fixed_tree, tvb, pinfo, 10, FIELD_CAP_INFO);
12794       offset = 12;  /* Size of fixed fields */
12795
12796       tagged_parameter_tree_len =
12797           tvb_reported_length_remaining(tvb, offset);
12798       tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12799       tagged_parameter_tree_len);
12800       ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12801       tagged_parameter_tree_len, MGT_BEACON);
12802       break;
12803
12804     case MGT_ATIM:
12805       break;
12806
12807     case MGT_DISASS:
12808       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
12809       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_REASON_CODE);
12810       offset = 2; /* Size of fixed fields */
12811       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12812       if (tagged_parameter_tree_len > 0) {
12813         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
12814                                                 tagged_parameter_tree_len);
12815         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
12816                                          tagged_parameter_tree_len, MGT_DISASS);
12817       }
12818       break;
12819
12820     case MGT_AUTHENTICATION:
12821       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 6);
12822       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_AUTH_ALG);
12823       add_fixed_field(fixed_tree, tvb, pinfo, 2, FIELD_AUTH_TRANS_SEQ);
12824       add_fixed_field(fixed_tree, tvb, pinfo, 4, FIELD_STATUS_CODE);
12825       offset = 6;  /* Size of fixed fields */
12826
12827       tagged_parameter_tree_len =
12828         tvb_reported_length_remaining(tvb, offset);
12829       if (tagged_parameter_tree_len > 0)
12830       {
12831         tagged_tree = get_tagged_parameter_tree (mgt_tree,
12832             tvb,
12833             offset,
12834             tagged_parameter_tree_len);
12835         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12836         tagged_parameter_tree_len, MGT_AUTHENTICATION);
12837       }
12838       break;
12839
12840     case MGT_DEAUTHENTICATION:
12841       fixed_tree = get_fixed_parameter_tree (mgt_tree, tvb, 0, 2);
12842       add_fixed_field(fixed_tree, tvb, pinfo, 0, FIELD_REASON_CODE);
12843       offset = 2; /* Size of fixed fields */
12844       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12845       if (tagged_parameter_tree_len > 0) {
12846         tagged_tree = get_tagged_parameter_tree(mgt_tree, tvb, offset,
12847                                                 tagged_parameter_tree_len);
12848         ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
12849                                          tagged_parameter_tree_len, MGT_DEAUTHENTICATION);
12850       }
12851       break;
12852
12853     case MGT_ACTION:
12854     {
12855       proto_item *lcl_fixed_hdr;
12856       proto_tree *lcl_fixed_tree;
12857       lcl_fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters");
12858       lcl_fixed_tree = proto_item_add_subtree (lcl_fixed_hdr, ett_fixed_parameters);
12859
12860       offset += add_fixed_field(lcl_fixed_tree, tvb, pinfo, 0, FIELD_ACTION);
12861
12862       proto_item_set_len(lcl_fixed_hdr, offset);
12863       if (ieee80211_tvb_invalid)
12864         break; /* Buffer not available for further processing */
12865       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12866       if (tagged_parameter_tree_len > 0)
12867       {
12868         tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12869           tagged_parameter_tree_len);
12870         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12871           tagged_parameter_tree_len, MGT_ACTION);
12872       }
12873       break;
12874     }
12875     case MGT_ACTION_NO_ACK:
12876     {
12877       proto_item *lcl_fixed_hdr;
12878       proto_tree *lcl_fixed_tree;
12879       lcl_fixed_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Fixed parameters");
12880       lcl_fixed_tree = proto_item_add_subtree (lcl_fixed_hdr, ett_fixed_parameters);
12881
12882       offset += add_fixed_field(lcl_fixed_tree, tvb, pinfo, 0, FIELD_ACTION);
12883
12884       proto_item_set_len(lcl_fixed_hdr, offset);
12885       if (ieee80211_tvb_invalid)
12886         break; /* Buffer not available for further processing */
12887       tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
12888       if (tagged_parameter_tree_len > 0)
12889       {
12890         tagged_tree = get_tagged_parameter_tree (mgt_tree, tvb, offset,
12891           tagged_parameter_tree_len);
12892         ieee_80211_add_tagged_parameters (tvb, offset, pinfo, tagged_tree,
12893           tagged_parameter_tree_len, MGT_ACTION_NO_ACK);
12894       }
12895       break;
12896     }
12897     case MGT_ARUBA_WLAN:
12898     {
12899       proto_item *aruba_hdr;
12900       proto_tree *aruba_tree;
12901       guint16 type;
12902       type = tvb_get_ntohs(tvb, offset);
12903
12904       aruba_hdr = proto_tree_add_text(mgt_tree, tvb, 0, 0, "Aruba Management");
12905       aruba_tree = proto_item_add_subtree(aruba_hdr, ett_fixed_parameters);
12906
12907       proto_tree_add_item(aruba_tree, hf_ieee80211_aruba, tvb, offset, 2, ENC_BIG_ENDIAN);
12908       offset += 2;
12909       /* HeartBeat Sequence */
12910       if (type == 0x0005)
12911       {
12912         proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_hb_seq, tvb, offset, 8, ENC_BIG_ENDIAN);
12913       }
12914       /* MTU Size */
12915       if (type == 0x0003)
12916       {
12917         proto_tree_add_item(aruba_tree, hf_ieee80211_aruba_mtu, tvb, offset, 2, ENC_BIG_ENDIAN);
12918       }
12919       break;
12920     }
12921   }
12922 }
12923
12924 static void
12925 set_src_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type)
12926 {
12927   col_add_fstr(pinfo->cinfo, COL_RES_DL_SRC, "%s (%s)",
12928         get_ether_name(addr), type);
12929   col_add_str(pinfo->cinfo, COL_UNRES_DL_SRC, ether_to_str(addr));
12930 }
12931
12932 static void
12933 set_dst_addr_cols(packet_info *pinfo, const guint8 *addr, const char *type)
12934 {
12935   col_add_fstr(pinfo->cinfo, COL_RES_DL_DST, "%s (%s)",
12936         get_ether_name(addr), type);
12937   col_add_str(pinfo->cinfo, COL_UNRES_DL_DST, ether_to_str(addr));
12938 }
12939
12940 static guint32
12941 crc32_802_tvb_padded(tvbuff_t *tvb, guint hdr_len, guint hdr_size, guint len)
12942 {
12943   guint32 c_crc;
12944
12945   c_crc = crc32_ccitt_tvb(tvb, hdr_len);
12946   c_crc = crc32_ccitt_seed(tvb_get_ptr(tvb, hdr_size, len), len, ~c_crc);
12947
12948   /* Byte reverse. */
12949   c_crc = ((unsigned char)(c_crc>>0)<<24) |
12950     ((unsigned char)(c_crc>>8)<<16) |
12951     ((unsigned char)(c_crc>>16)<<8) |
12952     ((unsigned char)(c_crc>>24)<<0);
12953
12954   return (c_crc);
12955 }
12956
12957 typedef enum {
12958     ENCAP_802_2,
12959     ENCAP_IPX,
12960     ENCAP_ETHERNET
12961 } encap_t;
12962
12963
12964 /* ************************************************************************* */
12965 /*                          Dissect 802.11 frame                             */
12966 /* ************************************************************************* */
12967
12968 /*
12969  * The 802.11n specification makes some fairly significant changes to the
12970  * layout of the MAC header.  The first two bits of the MAC header are the
12971  * protocol version.  You'd think that the 802.11 committee would have
12972  * bumped the version to indicate a different MAC layout, but NOOOO -- we
12973  * have to go digging for bits in various locations instead.
12974  */
12975
12976 static void
12977 dissect_ieee80211_common (tvbuff_t *tvb, packet_info *pinfo,
12978                           proto_tree *tree, gboolean fixed_length_header, gint fcs_len,
12979                           gboolean wlan_broken_fc, gboolean datapad,
12980                           gboolean is_ht)
12981 {
12982   guint16          fcf, flags, frame_type_subtype, ctrl_fcf, ctrl_type_subtype;
12983   guint16          seq_control;
12984   guint32          seq_number, frag_number;
12985   gboolean         more_frags;
12986   const guint8    *src         = NULL;
12987   const guint8    *dst         = NULL;
12988   const guint8    *bssid       = NULL;
12989   proto_item      *ti          = NULL;
12990   proto_item      *fcs_item    = NULL;
12991   proto_item      *cw_item     = NULL;
12992   proto_item      *hidden_item;
12993   proto_tree      *fcs_tree    = NULL;
12994   proto_tree      *cw_tree     = NULL;
12995   guint16          hdr_len, ohdr_len;
12996   guint16          htc_len     = 0;
12997   gboolean         has_fcs, fcs_good, fcs_bad;
12998   gint             len, reported_len, ivlen;
12999   gboolean         is_amsdu    = 0;
13000   gboolean         save_fragmented;
13001   guint32          addr_type;
13002   guint8           octet1, octet2;
13003   char             out_buff[SHORT_STR];
13004   gint             is_iv_bad;
13005   guchar           iv_buff[4];
13006   const char      *addr1_str   = NULL;
13007   int              addr1_hf    = -1;
13008   guint            offset;
13009   const gchar     *fts_str;
13010   gchar            flag_str[]  = "opmPRMFTC";
13011   gint             ii;
13012   guint16          qosoff      = 0;
13013   guint16          qos_control = 0;
13014   gint             meshctl_len = 0;
13015   guint8           mesh_flags;
13016   guint16          meshoff     = 0;
13017   static wlan_hdr  whdrs[4];
13018   gboolean         retransmitted;
13019
13020   volatile encap_t encap_type;
13021   proto_tree *volatile hdr_tree = NULL;
13022   tvbuff_t   *volatile next_tvb = NULL;
13023   wlan_hdr   *volatile whdr;
13024
13025   whdr= &whdrs[0];
13026
13027   col_set_str (pinfo->cinfo, COL_PROTOCOL, "802.11");
13028   col_clear(pinfo->cinfo, COL_INFO);
13029
13030   fcf = FETCH_FCF(0);
13031   frame_type_subtype = COMPOSE_FRAME_TYPE(fcf);
13032   if (frame_type_subtype == CTRL_CONTROL_WRAPPER)
13033     ctrl_fcf = FETCH_FCF(10);
13034   else
13035     ctrl_fcf = 0;
13036
13037   if (fixed_length_header)
13038     hdr_len = DATA_LONG_HDR_LEN;
13039   else
13040     hdr_len = find_header_length (fcf, ctrl_fcf, is_ht);
13041
13042   fts_str = val_to_str_ext_const(frame_type_subtype, &frame_type_subtype_vals_ext,
13043                                  "Unrecognized (Reserved frame)");
13044   col_set_str (pinfo->cinfo, COL_INFO, fts_str);
13045
13046
13047   flags = FCF_FLAGS (fcf);
13048   more_frags = HAVE_FRAGMENTS (flags);
13049
13050   for (ii = 0; ii < 8; ii++) {
13051     if (! (flags & 0x80 >> ii)) {
13052       flag_str[ii] = '.';
13053     }
13054   }
13055
13056   if (is_ht && IS_STRICTLY_ORDERED(flags) &&
13057       ((FCF_FRAME_TYPE(fcf) == MGT_FRAME) ||
13058        ((FCF_FRAME_TYPE(fcf) == DATA_FRAME) && DATA_FRAME_IS_QOS(frame_type_subtype)))) {
13059     htc_len = 4;
13060   }
13061
13062   /* adjust the header length depending on the Mesh Control field */
13063   if ((FCF_FRAME_TYPE(fcf) == DATA_FRAME) &&
13064       DATA_FRAME_IS_QOS(frame_type_subtype)) {
13065         qosoff = hdr_len - htc_len - 2;
13066         qos_control = tvb_get_letohs(tvb, qosoff);
13067         if (tvb_length(tvb) > hdr_len) {
13068             meshoff = hdr_len;
13069             mesh_flags = tvb_get_guint8 (tvb, hdr_len);
13070             if (has_mesh_control(fcf, qos_control, mesh_flags)) {
13071               meshctl_len = find_mesh_control_length(mesh_flags);
13072               hdr_len += meshctl_len;
13073             }
13074         }
13075   }
13076
13077   /*
13078    * Some portions of this code calculate offsets relative to the end of the
13079    * header.  But when the header has been padded to align the data this must
13080    * be done relative to true header size, not the padded/aligned value.  To
13081    * simplify this work we stash the original header size in ohdr_len instead
13082    * of recalculating it every time we need it.
13083    */
13084   ohdr_len = hdr_len;
13085   if (datapad)
13086     hdr_len = roundup2(hdr_len, 4);
13087
13088   /* Add the FC and duration/id to the current tree */
13089   if (tree)
13090     {
13091       ti = proto_tree_add_protocol_format (tree, proto_wlan, tvb, 0, hdr_len,
13092                                            "IEEE 802.11 %s", fts_str);
13093       hdr_tree = proto_item_add_subtree (ti, ett_80211);
13094
13095       dissect_frame_control(hdr_tree, tvb, wlan_broken_fc, 0, pinfo);
13096       dissect_durid(hdr_tree, tvb, frame_type_subtype, 2);
13097     }
13098
13099   /*
13100    * Decode the part of the frame header that isn't the same for all
13101    * frame types.
13102    */
13103   seq_control = 0;
13104   frag_number = 0;
13105   seq_number = 0;
13106
13107   switch (FCF_FRAME_TYPE (fcf))
13108   {
13109
13110     case MGT_FRAME:
13111       /*
13112        * All management frame types have the same header.
13113        */
13114       TVB_SET_ADDRESS_HF(&pinfo->dl_src, AT_ETHER, tvb, 10, 6, hf_ieee80211_addr_sa);
13115       COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->dl_src);
13116       TVB_SET_ADDRESS_HF(&pinfo->dl_dst, AT_ETHER, tvb, 4, 6, hf_ieee80211_addr_da);
13117       COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->dl_dst);
13118
13119       /* for tap */
13120       TVB_SET_ADDRESS_HF(&whdr->bssid, AT_ETHER, tvb, 16, 6, hf_ieee80211_addr_bssid);
13121       COPY_ADDRESS_SHALLOW(&whdr->src, &pinfo->dl_src);
13122       COPY_ADDRESS_SHALLOW(&whdr->dst, &pinfo->dl_dst);
13123       whdr->type = frame_type_subtype;
13124
13125       seq_control = tvb_get_letohs(tvb, 22);
13126       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
13127       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
13128
13129       col_append_fstr(pinfo->cinfo, COL_INFO,
13130             ", SN=%d", seq_number);
13131
13132       col_append_fstr(pinfo->cinfo, COL_INFO,
13133             ", FN=%d",frag_number);
13134
13135       if (tree)
13136       {
13137         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13138         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
13139
13140         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13141         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
13142
13143         proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
13144
13145         /* add items for wlan.addr filter */
13146         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13147         PROTO_ITEM_SET_HIDDEN(hidden_item);
13148         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13149         PROTO_ITEM_SET_HIDDEN(hidden_item);
13150
13151         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13152         PROTO_ITEM_SET_HIDDEN(hidden_item);
13153
13154         proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13155         proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13156       }
13157       break;
13158
13159     case CONTROL_FRAME:
13160     {
13161       /*
13162        * Control Wrapper frames insert themselves between address 1
13163        * and address 2 in a normal control frame.  Process address 1
13164        * first, then handle the rest of the frame in dissect_control.
13165        */
13166       if (frame_type_subtype == CTRL_CONTROL_WRAPPER) {
13167         offset = 10; /* FC + D/ID + Address 1 + CFC + HTC */
13168         ctrl_fcf = FETCH_FCF(10);
13169         ctrl_type_subtype = COMPOSE_FRAME_TYPE(ctrl_fcf);
13170       } else {
13171         offset = 10; /* FC + D/ID + Address 1 */
13172         ctrl_type_subtype = frame_type_subtype;
13173       }
13174
13175       switch (ctrl_type_subtype)
13176       {
13177         case CTRL_PS_POLL:
13178           addr1_str = "BSSID";
13179           addr1_hf = hf_ieee80211_addr_bssid;
13180           break;
13181         case CTRL_RTS:
13182         case CTRL_CTS:
13183         case CTRL_ACKNOWLEDGEMENT:
13184         case CTRL_CFP_END:
13185         case CTRL_CFP_ENDACK:
13186         case CTRL_BLOCK_ACK_REQ:
13187         case CTRL_BLOCK_ACK:
13188           addr1_str = "RA";
13189           addr1_hf = hf_ieee80211_addr_ra;
13190           break;
13191         default:
13192           break;
13193       }
13194
13195       if (!addr1_str) /* XXX - Should we throw some sort of error? */
13196         break;
13197
13198       /* Add address 1 */
13199       dst = tvb_get_ptr(tvb, 4, 6);
13200       set_dst_addr_cols(pinfo, dst, addr1_str);
13201       if (tree) {
13202         proto_tree_add_item(hdr_tree, addr1_hf, tvb, 4, 6, ENC_BIG_ENDIAN);
13203         hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13204         PROTO_ITEM_SET_HIDDEN(hidden_item);
13205       }
13206
13207       /*
13208        * Start shoving in other fields if needed.
13209        * XXX - Should we look for is_ht as well?
13210        */
13211       if ((frame_type_subtype == CTRL_CONTROL_WRAPPER) && tree) {
13212         cw_item = proto_tree_add_text(hdr_tree, tvb, offset, 2,
13213           "Contained Frame Control");
13214         cw_tree = proto_item_add_subtree (cw_item, ett_cntrl_wrapper_fc);
13215         dissect_frame_control(cw_tree, tvb, FALSE, offset, pinfo);
13216         dissect_ht_control(hdr_tree, tvb, offset + 2);
13217         offset += 6;
13218         cw_item = proto_tree_add_text(hdr_tree, tvb, offset, 2,
13219           "Carried Frame");
13220         hdr_tree = proto_item_add_subtree (cw_item, ett_cntrl_wrapper_fc);
13221       }
13222
13223       switch (ctrl_type_subtype)
13224       {
13225         case CTRL_PS_POLL:
13226         case CTRL_CFP_END:
13227         case CTRL_CFP_ENDACK:
13228         {
13229           src = tvb_get_ptr (tvb, offset, 6);
13230           set_src_addr_cols(pinfo, src, "BSSID");
13231           if (tree) {
13232             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
13233             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
13234             PROTO_ITEM_SET_HIDDEN(hidden_item);
13235           }
13236           break;
13237         }
13238
13239         case CTRL_RTS:
13240         {
13241           src = tvb_get_ptr (tvb, offset, 6);
13242           set_src_addr_cols(pinfo, src, "TA");
13243           if (tree) {
13244             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
13245             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
13246             PROTO_ITEM_SET_HIDDEN(hidden_item);
13247           }
13248           break;
13249         }
13250
13251         case CTRL_CONTROL_WRAPPER:
13252         {
13253           /* XXX - We shouldn't see this.  Should we throw an error? */
13254           break;
13255         }
13256
13257         case CTRL_BLOCK_ACK_REQ:
13258         {
13259           src = tvb_get_ptr (tvb, offset, 6);
13260           set_src_addr_cols(pinfo, src, "TA");
13261
13262           if (tree)
13263           {
13264             guint16 bar_control;
13265             guint8 block_ack_type;
13266             proto_item *bar_parent_item;
13267             proto_tree *bar_sub_tree;
13268
13269             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
13270             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
13271             PROTO_ITEM_SET_HIDDEN(hidden_item);
13272             offset += 6;
13273
13274             bar_control = tvb_get_letohs(tvb, offset);
13275             block_ack_type = (bar_control & 0x0006) >> 1;
13276             proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_request_type, tvb,
13277               offset, 2, ENC_LITTLE_ENDIAN);
13278             bar_parent_item = proto_tree_add_item(hdr_tree,
13279               hf_ieee80211_block_ack_request_control, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13280             bar_sub_tree = proto_item_add_subtree(bar_parent_item,
13281               ett_block_ack);
13282             proto_tree_add_item(bar_sub_tree,
13283               hf_ieee80211_block_ack_control_ack_policy, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13284             proto_tree_add_item(bar_sub_tree, hf_ieee80211_block_ack_control_multi_tid,
13285               tvb, offset, 2, ENC_LITTLE_ENDIAN);
13286             proto_tree_add_item(bar_sub_tree,
13287               hf_ieee80211_block_ack_control_compressed_bitmap, tvb, offset, 2,
13288               ENC_LITTLE_ENDIAN);
13289             proto_tree_add_item(bar_sub_tree, hf_ieee80211_block_ack_control_reserved,
13290               tvb, offset, 2, ENC_LITTLE_ENDIAN);
13291
13292             switch (block_ack_type)
13293             {
13294               case 0: /*Basic BlockAckReq */
13295               {
13296                 proto_tree_add_item(bar_sub_tree,
13297                 hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13298                 offset += 2;
13299
13300                 /*offset +=*/ add_fixed_field(hdr_tree, tvb, pinfo, offset,
13301                   FIELD_BLOCK_ACK_SSC);
13302                 break;
13303               }
13304               case 2: /* Compressed BlockAckReq */
13305               {
13306                 proto_tree_add_item(bar_sub_tree,
13307                 hf_ieee80211_block_ack_control_compressed_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13308                 offset += 2;
13309
13310                 /*offset +=*/ add_fixed_field(hdr_tree, tvb, pinfo, offset,
13311                   FIELD_BLOCK_ACK_SSC);
13312                 break;
13313               }
13314               case 3: /* Multi-TID BlockAckReq */
13315               {
13316                 guint8 tid_count;
13317                 guint iii;
13318                 proto_tree *bar_mtid_tree, *bar_mtid_sub_tree;
13319
13320                 tid_count = ((bar_control & 0xF000) >> 12) + 1;
13321                 proto_tree_add_uint(bar_sub_tree, hf_ieee80211_block_ack_control_multi_tid_info, tvb, offset, 2, tid_count);
13322                 offset += 2;
13323
13324                 bar_parent_item = proto_tree_add_text (hdr_tree, tvb, offset, tid_count*4, "Per TID Info");
13325                 bar_mtid_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
13326                 for (iii = 0; iii < tid_count; iii++) {
13327                   bar_parent_item = proto_tree_add_uint(bar_mtid_tree, hf_ieee80211_block_ack_multi_tid_info, tvb, offset, 4, iii);
13328                   bar_mtid_sub_tree = proto_item_add_subtree(bar_parent_item, ett_block_ack);
13329
13330                   proto_tree_add_item(bar_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13331                   proto_tree_add_item(bar_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13332                   offset += 2;
13333
13334                   offset += add_fixed_field(bar_mtid_sub_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
13335                 }
13336                 break;
13337               }
13338             }
13339           }
13340           break;
13341         }
13342
13343         case CTRL_BLOCK_ACK:
13344         {
13345           src = tvb_get_ptr (tvb, offset, 6);
13346           set_src_addr_cols(pinfo, src, "TA");
13347
13348           if (tree)
13349           {
13350             guint16 ba_control;
13351             guint8 block_ack_type;
13352             proto_item *ba_parent_item;
13353             proto_tree *ba_sub_tree;
13354
13355             proto_tree_add_item(hdr_tree, hf_ieee80211_addr_ta, tvb, offset, 6, ENC_NA);
13356             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, offset, 6, ENC_NA);
13357             PROTO_ITEM_SET_HIDDEN(hidden_item);
13358             offset += 6;
13359
13360             ba_control = tvb_get_letohs(tvb, offset);
13361             block_ack_type = (ba_control & 0x0006) >> 1;
13362             proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13363             ba_parent_item = proto_tree_add_item(hdr_tree,
13364               hf_ieee80211_block_ack_control, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13365             ba_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
13366             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_ack_policy,
13367               tvb, offset, 2, ENC_LITTLE_ENDIAN);
13368             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_multi_tid,
13369               tvb, offset, 2, ENC_LITTLE_ENDIAN);
13370             proto_tree_add_item(ba_sub_tree,
13371               hf_ieee80211_block_ack_control_compressed_bitmap, tvb, offset, 2,
13372               ENC_LITTLE_ENDIAN);
13373             proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_reserved, tvb,
13374               offset, 2, ENC_LITTLE_ENDIAN);
13375
13376             switch (block_ack_type)
13377             {
13378               case 0: /*Basic BlockAck */
13379               {
13380                 proto_tree_add_item(ba_sub_tree,
13381                 hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13382                 offset += 2;
13383
13384                 offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
13385                 proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 128, ENC_NA);
13386                 /*offset += 128;*/
13387                 break;
13388               }
13389               case 2: /* Compressed BlockAck */
13390               {
13391                 guint16 ssn;
13392                 guint64 bmap;
13393                 int f;
13394                 proto_item *ba_bitmap_item;
13395                 proto_tree *ba_bitmap_tree;
13396
13397                 proto_tree_add_item(ba_sub_tree, hf_ieee80211_block_ack_control_basic_tid_info, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13398                 offset += 2;
13399
13400                 ssn = tvb_get_letohs(tvb, offset);
13401                 ssn >>= 4;
13402                 offset += add_fixed_field(hdr_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
13403                 bmap = tvb_get_letoh64(tvb, offset);
13404                 ba_bitmap_item = proto_tree_add_item(hdr_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
13405                 ba_bitmap_tree = proto_item_add_subtree(ba_bitmap_item, ett_block_ack_bitmap);
13406                 for (f = 0; f < 64; f++) {
13407                   if (bmap & (G_GINT64_CONSTANT(1) << f))
13408                     continue;
13409                   proto_tree_add_uint_format_value(ba_bitmap_tree, hf_ieee80211_block_ack_bitmap_missing_frame,
13410                                                    tvb, offset + (f/8), 1, ssn + f, "%u", ssn + f);
13411                 }
13412                 /*offset += 8;*/
13413                 break;
13414               }
13415               case 3:  /* Multi-TID BlockAck */
13416               {
13417                 guint8 tid_count;
13418                 guint iii;
13419                 proto_tree *ba_mtid_tree, *ba_mtid_sub_tree;
13420
13421                 tid_count = ((ba_control & 0xF000) >> 12) + 1;
13422                 proto_tree_add_uint(ba_sub_tree,
13423                 hf_ieee80211_block_ack_control_compressed_tid_info, tvb, offset, 2, tid_count);
13424                 offset += 2;
13425
13426                 ba_parent_item = proto_tree_add_text (hdr_tree, tvb, offset, tid_count*4, "Per TID Info");
13427                 ba_mtid_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
13428                 for (iii = 0; iii < tid_count; iii++) {
13429                   ba_parent_item = proto_tree_add_uint(ba_mtid_tree, hf_ieee80211_block_ack_multi_tid_info, tvb, offset, 4, iii);
13430                   ba_mtid_sub_tree = proto_item_add_subtree(ba_parent_item, ett_block_ack);
13431
13432                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_reserved, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13433                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_multi_tid_value, tvb, offset, 2, ENC_LITTLE_ENDIAN);
13434                   offset += 2;
13435
13436                   offset += add_fixed_field(ba_mtid_sub_tree, tvb, pinfo, offset, FIELD_BLOCK_ACK_SSC);
13437                   proto_tree_add_item(ba_mtid_sub_tree, hf_ieee80211_block_ack_bitmap, tvb, offset, 8, ENC_NA);
13438                   offset += 8;
13439                 }
13440                 break;
13441               }
13442             }
13443           }
13444           break;
13445         }
13446       }
13447       break;
13448     }
13449
13450     case DATA_FRAME:
13451     {
13452       guint32 src_offset, dst_offset, bssid_offset;
13453       addr_type = FCF_ADDR_SELECTOR (fcf);
13454
13455       /* In order to show src/dst address we must always do the following */
13456       switch (addr_type)
13457       {
13458
13459         case DATA_ADDR_T1:
13460           src_offset = 10;
13461           dst_offset = 4;
13462           bssid_offset = 16;
13463           break;
13464
13465         case DATA_ADDR_T2:
13466           src_offset = 16;
13467           dst_offset = 4;
13468           bssid_offset = 10;
13469           break;
13470
13471         case DATA_ADDR_T3:
13472           src_offset = 10;
13473           dst_offset = 16;
13474           bssid_offset = 4;
13475           break;
13476
13477         case DATA_ADDR_T4:
13478           src_offset = 24;
13479           dst_offset = 16;
13480           bssid_offset = 16;
13481           break;
13482         default:
13483           /* Should never happen? */
13484           src_offset = 0;
13485           dst_offset = 0;
13486           bssid_offset = 0;
13487           break;
13488       }
13489
13490       TVB_SET_ADDRESS_HF(&pinfo->dl_src, AT_ETHER, tvb, src_offset, 6, hf_ieee80211_addr_sa);
13491       COPY_ADDRESS_SHALLOW(&pinfo->src, &pinfo->dl_src);
13492       TVB_SET_ADDRESS_HF(&pinfo->dl_dst, AT_ETHER, tvb, dst_offset, 6, hf_ieee80211_addr_da);
13493       COPY_ADDRESS_SHALLOW(&pinfo->dst, &pinfo->dl_dst);
13494
13495       /* for tap */
13496
13497       TVB_SET_ADDRESS_HF(&whdr->bssid, AT_ETHER, tvb, bssid_offset, 6, hf_ieee80211_addr_bssid);
13498       COPY_ADDRESS_SHALLOW(&whdr->src, &pinfo->dl_src);
13499       COPY_ADDRESS_SHALLOW(&whdr->dst, &pinfo->dl_dst);
13500       whdr->type = frame_type_subtype;
13501
13502       seq_control = tvb_get_letohs(tvb, 22);
13503       frag_number = SEQCTL_FRAGMENT_NUMBER(seq_control);
13504       seq_number = SEQCTL_SEQUENCE_NUMBER(seq_control);
13505
13506       col_append_fstr(pinfo->cinfo, COL_INFO,
13507             ", SN=%d, FN=%d", seq_number,frag_number);
13508
13509       /* Now if we have a tree we start adding stuff */
13510       if (tree)
13511       {
13512
13513         switch (addr_type)
13514         {
13515           /* XXX - using the offsets set above, could all of these cases be collapsed into one? */
13516           case DATA_ADDR_T1:
13517             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13518             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
13519             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13520             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
13521             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 16, 6, ENC_NA);
13522             proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13523             proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13524
13525             /* add items for wlan.addr filter */
13526             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13527             PROTO_ITEM_SET_HIDDEN(hidden_item);
13528             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13529             PROTO_ITEM_SET_HIDDEN(hidden_item);
13530             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13531             PROTO_ITEM_SET_HIDDEN(hidden_item);
13532             break;
13533
13534           case DATA_ADDR_T2:
13535             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13536             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 4, 6, ENC_NA);
13537             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13538             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 10, 6, ENC_NA);
13539             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 16, 6, ENC_NA);
13540             proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13541             proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13542
13543             /* add items for wlan.addr filter */
13544             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13545             PROTO_ITEM_SET_HIDDEN(hidden_item);
13546             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13547             PROTO_ITEM_SET_HIDDEN(hidden_item);
13548             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13549             PROTO_ITEM_SET_HIDDEN(hidden_item);
13550             break;
13551
13552           case DATA_ADDR_T3:
13553             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13554             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_bssid, tvb, 4, 6, ENC_NA);
13555             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13556             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 10, 6, ENC_NA);
13557             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 16, 6, ENC_NA);
13558             proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13559             proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13560
13561             /* add items for wlan.addr filter */
13562             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13563             PROTO_ITEM_SET_HIDDEN(hidden_item);
13564             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13565             PROTO_ITEM_SET_HIDDEN(hidden_item);
13566             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13567             PROTO_ITEM_SET_HIDDEN(hidden_item);
13568             break;
13569
13570           case DATA_ADDR_T4:
13571             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ra, tvb, 4, 6, ENC_NA);
13572             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_ta, tvb, 10, 6, ENC_NA);
13573             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_da, tvb, 16, 6, ENC_NA);
13574             proto_tree_add_uint (hdr_tree, hf_ieee80211_frag_number, tvb, 22, 2, frag_number);
13575             proto_tree_add_uint (hdr_tree, hf_ieee80211_seq_number, tvb, 22, 2, seq_number);
13576             proto_tree_add_item (hdr_tree, hf_ieee80211_addr_sa, tvb, 24, 6, ENC_NA);
13577
13578             /* add items for wlan.addr filter */
13579             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 4, 6, ENC_NA);
13580             PROTO_ITEM_SET_HIDDEN(hidden_item);
13581             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 10, 6, ENC_NA);
13582             PROTO_ITEM_SET_HIDDEN(hidden_item);
13583             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 16, 6, ENC_NA);
13584             PROTO_ITEM_SET_HIDDEN(hidden_item);
13585             hidden_item = proto_tree_add_item (hdr_tree, hf_ieee80211_addr, tvb, 24, 6, ENC_NA);
13586             PROTO_ITEM_SET_HIDDEN(hidden_item);
13587             break;
13588         }
13589
13590       }
13591       break;
13592     }
13593   }
13594
13595   len = tvb_length_remaining(tvb, hdr_len);
13596   reported_len = tvb_reported_length_remaining(tvb, hdr_len);
13597
13598   switch (fcs_len)
13599     {
13600       case 0: /* Definitely has no FCS */
13601         has_fcs = FALSE;
13602         break;
13603
13604       case 4: /* Definitely has an FCS */
13605         has_fcs = TRUE;
13606         break;
13607
13608       case -2: /* Data frames have no FCS, other frames have an FCS */
13609         if (FCF_FRAME_TYPE (fcf) == DATA_FRAME)
13610           has_fcs = FALSE;
13611         else
13612           has_fcs = TRUE;
13613         break;
13614
13615       default: /* Don't know - use "wlan_check_fcs" */
13616         has_fcs = wlan_check_fcs;
13617         break;
13618     }
13619   if (has_fcs)
13620     {
13621       /*
13622        * Well, this packet should, in theory, have an FCS.
13623        * Do we have the entire packet, and does it have enough data for
13624        * the FCS?
13625        */
13626       if (reported_len < 4)
13627       {
13628         /*
13629          * The packet is claimed not to even have enough data for a 4-byte
13630          * FCS.
13631          * Pretend it doesn't have an FCS.
13632          */
13633         ;
13634       }
13635       else if (len < reported_len)
13636       {
13637         /*
13638          * The packet is claimed to have enough data for a 4-byte FCS, but
13639          * we didn't capture all of the packet.
13640          * Slice off the 4-byte FCS from the reported length, and trim the
13641          * captured length so it's no more than the reported length; that
13642          * will slice off what of the FCS, if any, is in the captured
13643          * length.
13644          */
13645         reported_len -= 4;
13646         if (len > reported_len)
13647             len = reported_len;
13648       }
13649       else
13650       {
13651         /*
13652          * We have the entire packet, and it includes a 4-byte FCS.
13653          * Slice it off, and put it into the tree.
13654          */
13655         len          -= 4;
13656         reported_len -= 4;
13657         if (tree)
13658         {
13659           guint32 sent_fcs = tvb_get_ntohl(tvb, hdr_len + len);
13660           guint32 fcs;
13661
13662           if (datapad)
13663             fcs = crc32_802_tvb_padded(tvb, ohdr_len, hdr_len, len);
13664           else
13665             fcs = crc32_802_tvb(tvb, hdr_len + len);
13666           if (fcs == sent_fcs) {
13667             fcs_good = TRUE;
13668             fcs_bad = FALSE;
13669           } else {
13670             fcs_good = FALSE;
13671             fcs_bad = TRUE;
13672           }
13673
13674           fcs_item = proto_tree_add_item(hdr_tree, hf_ieee80211_fcs, tvb,
13675                 hdr_len + len, 4, ENC_LITTLE_ENDIAN);
13676           if (fcs_good) {
13677             proto_item_append_text(fcs_item, " [correct]");
13678           } else {
13679             proto_item_append_text(fcs_item, " [incorrect, should be 0x%08x]", fcs);
13680             flag_str[8] = '.';
13681           }
13682
13683           proto_tree_set_appendix(hdr_tree, tvb, hdr_len + len, 4);
13684
13685           fcs_tree = proto_item_add_subtree(fcs_item, ett_fcs);
13686
13687           fcs_item = proto_tree_add_boolean(fcs_tree,
13688               hf_ieee80211_fcs_good, tvb,
13689               hdr_len + len, 4,
13690               fcs_good);
13691           PROTO_ITEM_SET_GENERATED(fcs_item);
13692
13693           fcs_item = proto_tree_add_boolean(fcs_tree,
13694               hf_ieee80211_fcs_bad, tvb,
13695               hdr_len + len, 4,
13696               fcs_bad);
13697           PROTO_ITEM_SET_GENERATED(fcs_item);
13698         }
13699       }
13700     } else {
13701       flag_str[8] = '\0';
13702     }
13703
13704     proto_item_append_text(ti, ", Flags: %s", flag_str);
13705     col_append_fstr (pinfo->cinfo, COL_INFO, ", Flags=%s", flag_str);
13706
13707
13708   /*
13709    * Only management and data frames have a body, so we don't have
13710    * anything more to do for other types of frames.
13711    */
13712   switch (FCF_FRAME_TYPE (fcf))
13713     {
13714
13715     case MGT_FRAME:
13716       if (htc_len == 4) {
13717         dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
13718       }
13719       break;
13720
13721     case DATA_FRAME:
13722       if (tree && DATA_FRAME_IS_QOS(frame_type_subtype))
13723       {
13724         proto_item *qos_fields, *qos_ti;
13725         proto_tree *qos_tree;
13726
13727         guint16 qos_eosp;
13728         guint16 qos_field_content;
13729
13730         qos_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_qos, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13731         qos_tree = proto_item_add_subtree (qos_fields, ett_qos_parameters);
13732
13733         qos_eosp = QOS_EOSP(qos_control);
13734         qos_field_content = QOS_FIELD_CONTENT(qos_control);
13735
13736         proto_tree_add_item(qos_tree, hf_ieee80211_qos_tid, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13737
13738         qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_priority, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13739         PROTO_ITEM_SET_GENERATED(qos_ti);
13740
13741         if (flags & FLAG_FROM_DS) {
13742           proto_tree_add_item(qos_tree, hf_ieee80211_qos_eosp, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13743         } else {
13744           proto_tree_add_item(qos_tree, hf_ieee80211_qos_bit4, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13745         }
13746
13747         proto_tree_add_item(qos_tree, hf_ieee80211_qos_ack_policy, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13748
13749         if (flags & FLAG_FROM_DS) {
13750           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
13751             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13752             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
13753           }
13754           if (DATA_FRAME_IS_CF_POLL(frame_type_subtype)) {
13755             /* txop limit */
13756               qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_limit, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13757             if (qos_field_content == 0) {
13758               proto_item_append_text(qos_ti, " (transmit one frame immediately)");
13759             }
13760           } else {
13761             /* qap ps buffer state */
13762             proto_item *qos_ps_buf_state_fields;
13763             proto_tree *qos_ps_buf_state_tree;
13764
13765             qos_ps_buf_state_fields = proto_tree_add_item(qos_tree, hf_ieee80211_qos_ps_buf_state, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13766             qos_ps_buf_state_tree = proto_item_add_subtree (qos_ps_buf_state_fields, ett_qos_ps_buf_state);
13767
13768             proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_buf_state_indicated, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13769
13770             if (QOS_PS_BUF_STATE_INDICATED(qos_field_content)) {
13771               proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_highest_pri_buf_ac, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13772               qos_ti = proto_tree_add_item(qos_ps_buf_state_tree, hf_ieee80211_qos_qap_buf_load, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13773               switch (QOS_PS_QAP_BUF_LOAD(qos_field_content)) {
13774
13775               case 0:
13776                 proto_item_append_text(qos_ti, " (no buffered traffic)");
13777                 break;
13778
13779               default:
13780                 proto_item_append_text(qos_ti, " (%d octets)", QOS_PS_QAP_BUF_LOAD(qos_field_content)*4096);
13781                 break;
13782
13783               case 15:
13784                 proto_item_append_text(qos_ti, " (greater than 57344 octets)");
13785                 break;
13786               }
13787
13788             }
13789           }
13790         } else {
13791           if (!DATA_FRAME_IS_NULL(frame_type_subtype)) {
13792             proto_tree_add_item(qos_tree, hf_ieee80211_qos_amsdu_present, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13793             is_amsdu = QOS_AMSDU_PRESENT(qos_control);
13794           }
13795           if (qos_eosp) {
13796             /* queue size */
13797             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_queue_size, tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13798             switch (qos_field_content) {
13799             case 0:
13800               proto_item_append_text(qos_ti, " (no buffered traffic in the queue)");
13801               break;
13802
13803             default:
13804               proto_item_append_text(qos_ti, " (%u bytes)", qos_field_content*256);
13805               break;
13806
13807             case 254:
13808               proto_item_append_text(qos_ti, " (more than 64768 octets)");
13809               break;
13810
13811             case 255:
13812               proto_item_append_text(qos_ti, " (unspecified or unknown)");
13813               break;
13814             }
13815           } else {
13816             /* txop duration requested */
13817             qos_ti = proto_tree_add_item(qos_tree, hf_ieee80211_qos_txop_dur_req,
13818                                    tvb, qosoff, 2, ENC_LITTLE_ENDIAN);
13819             if (qos_field_content == 0) {
13820               proto_item_append_text(qos_ti, " (no TXOP requested)");
13821             }
13822           }
13823         }
13824
13825         /* Do we have +HTC? */
13826         if (htc_len == 4) {
13827           dissect_ht_control(hdr_tree, tvb, ohdr_len - 4);
13828         }
13829
13830         if (meshctl_len != 0) {
13831           proto_item *msh_fields;
13832           proto_tree *msh_tree;
13833
13834           msh_fields = proto_tree_add_item(hdr_tree, hf_ieee80211_mesh_control_field, tvb, meshoff, meshctl_len, ENC_NA);
13835           msh_tree = proto_item_add_subtree (msh_fields, ett_msh_control);
13836           add_fixed_field(msh_tree, tvb, pinfo, meshoff, FIELD_MESH_CONTROL);
13837         }
13838
13839       } /* end of qos control field */
13840       /* Davide Schiera (2006-11-21): process handshake packet with AirPDcap    */
13841       /* the processing will take care of 4-way handshake sessions for WPA    */
13842       /* and WPA2 decryption                                  */
13843       if (enable_decryption && !pinfo->fd->flags.visited) {
13844         const guint8 *enc_data = tvb_get_ptr(tvb, 0, hdr_len+reported_len);
13845         AirPDcapPacketProcess(&airpdcap_ctx, enc_data, hdr_len, hdr_len+reported_len, NULL, 0, NULL, TRUE, FALSE);
13846       }
13847       /* Davide Schiera --------------------------------------------------------  */
13848
13849       /*
13850        * No-data frames don't have a body.
13851        */
13852       if (DATA_FRAME_IS_NULL(frame_type_subtype))
13853         return;
13854
13855       if (!wlan_subdissector) {
13856         guint fnum = 0;
13857
13858         /* key: bssid:src
13859          * data: last seq_control seen and frame number
13860          */
13861         retransmitted = FALSE;
13862         if (!pinfo->fd->flags.visited) {
13863           retransmit_key key;
13864           retransmit_key *result;
13865
13866           memcpy(key.bssid, bssid, 6);
13867           memcpy(key.src, src, 6);
13868           key.seq_control = 0;
13869           result = (retransmit_key *)g_hash_table_lookup(fc_analyse_retransmit_table, &key);
13870           if (result && (result->seq_control == seq_control)) {
13871             /* keep a pointer to the first seen frame, could be done with proto data? */
13872             fnum = result->fnum;
13873             g_hash_table_insert(fc_first_frame_table, GINT_TO_POINTER(pinfo->fd->num),
13874                                 GINT_TO_POINTER(fnum));
13875             retransmitted = TRUE;
13876           } else {
13877             /* first time or new seq*/
13878             if (!result) {
13879               result = se_new(retransmit_key);
13880               *result = key;
13881               g_hash_table_insert(fc_analyse_retransmit_table, result, result);
13882             }
13883             result->seq_control = seq_control;
13884             result->fnum =  pinfo->fd->num;
13885           }
13886         }
13887         else if ((fnum = GPOINTER_TO_UINT(g_hash_table_lookup(fc_first_frame_table, GINT_TO_POINTER(pinfo->fd->num))))) {
13888           retransmitted = TRUE;
13889         }
13890
13891         if (retransmitted) {
13892           col_append_str(pinfo->cinfo, COL_INFO, " [retransmitted]");
13893           if (tree) {
13894             proto_item *item;
13895
13896             item=proto_tree_add_none_format(hdr_tree, hf_ieee80211_fc_analysis_retransmission, tvb, 0, 0,
13897                                             "Retransmitted frame");
13898             PROTO_ITEM_SET_GENERATED(item);
13899             item=proto_tree_add_uint(hdr_tree, hf_ieee80211_fc_analysis_retransmission_frame,tvb, 0, 0, fnum);
13900             PROTO_ITEM_SET_GENERATED(item);
13901           }
13902           next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
13903           call_dissector(data_handle, next_tvb, pinfo, tree);
13904           goto end_of_wlan;
13905         }
13906       }
13907
13908       break;
13909
13910     case CONTROL_FRAME:
13911       return;
13912
13913     default:
13914       return;
13915     }
13916
13917   if (IS_PROTECTED(FCF_FLAGS(fcf))
13918       && !pinfo->pseudo_header->ieee_802_11.decrypted
13919       && (wlan_ignore_wep != WLAN_IGNORE_WEP_WO_IV)) {
13920     /*
13921      * It's a WEP or WPA encrypted frame, and it hasn't already been
13922      * decrypted; dissect the protections parameters and decrypt the data,
13923      * if we have a matching key. Otherwise display it as data.
13924      */
13925
13926     gboolean    can_decrypt = FALSE;
13927     proto_tree *wep_tree    = NULL;
13928     guint32     iv;
13929     guint8      key, keybyte;
13930
13931     /* Davide Schiera (2006-11-27): define algorithms constants and macros  */
13932 #define PROTECTION_ALG_WEP  AIRPDCAP_KEY_TYPE_WEP
13933 #define PROTECTION_ALG_TKIP  AIRPDCAP_KEY_TYPE_TKIP
13934 #define PROTECTION_ALG_CCMP  AIRPDCAP_KEY_TYPE_CCMP
13935 #define PROTECTION_ALG_RSNA  PROTECTION_ALG_CCMP | PROTECTION_ALG_TKIP
13936     guint8 algorithm=G_MAXUINT8;
13937     /* Davide Schiera (2006-11-27): added macros to check the algorithm    */
13938     /* used could be TKIP or CCMP                            */
13939 #define IS_TKIP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 1) == \
13940   ((tvb_get_guint8(tvb, hdr_len) | 0x20) & 0x7f))
13941 #define IS_CCMP(tvb, hdr_len)  (tvb_get_guint8(tvb, hdr_len + 2) == 0)
13942     /* Davide Schiera -----------------------------------------------------  */
13943
13944     /* Davide Schiera (2006-11-21): recorded original lengths to pass them  */
13945     /* to the packets process function                        */
13946     guint32 sec_header=0;
13947     guint32 sec_trailer=0;
13948
13949     next_tvb = try_decrypt(tvb, hdr_len, reported_len, &algorithm, &sec_header, &sec_trailer);
13950     /* Davide Schiera -----------------------------------------------------  */
13951
13952     keybyte = tvb_get_guint8(tvb, hdr_len + 3);
13953     key = KEY_OCTET_WEP_KEY(keybyte);
13954     if ((keybyte & KEY_EXTIV) && (len >= EXTIV_LEN)) {
13955       /* Extended IV; this frame is likely encrypted with TKIP or CCMP */
13956       if (tree) {
13957         proto_item *extiv_fields;
13958
13959         /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if  */
13960         /* it's possible                                */
13961         if (algorithm==PROTECTION_ALG_TKIP)
13962           extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13963               "TKIP parameters");
13964         else if (algorithm==PROTECTION_ALG_CCMP)
13965           extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13966             "CCMP parameters");
13967         else {
13968           /* Davide Schiera --------------------------------------------  */
13969           /* Davide Schiera (2006-11-27): differentiated CCMP and TKIP if*/
13970           /* it's possible                              */
13971           if (IS_TKIP(tvb, hdr_len)) {
13972             algorithm=PROTECTION_ALG_TKIP;
13973             extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13974                 "TKIP parameters");
13975           } else if (IS_CCMP(tvb, hdr_len)) {
13976             algorithm=PROTECTION_ALG_CCMP;
13977             extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13978                 "CCMP parameters");
13979           } else
13980             extiv_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 8,
13981                 "TKIP/CCMP parameters");
13982         }
13983         proto_item_set_len (ti, hdr_len + 8);
13984
13985         wep_tree = proto_item_add_subtree (extiv_fields, ett_wep_parameters);
13986
13987         if (algorithm==PROTECTION_ALG_TKIP) {
13988           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
13989               tvb_get_letohl(tvb, hdr_len + 4),
13990               tvb_get_guint8(tvb, hdr_len),
13991               tvb_get_guint8(tvb, hdr_len + 2));
13992           proto_tree_add_string(wep_tree, hf_ieee80211_tkip_extiv, tvb, hdr_len,
13993               EXTIV_LEN, out_buff);
13994         } else if (algorithm==PROTECTION_ALG_CCMP) {
13995           g_snprintf(out_buff, SHORT_STR, "0x%08X%02X%02X",
13996               tvb_get_letohl(tvb, hdr_len + 4),
13997               tvb_get_guint8(tvb, hdr_len + 1),
13998               tvb_get_guint8(tvb, hdr_len));
13999           proto_tree_add_string(wep_tree, hf_ieee80211_ccmp_extiv, tvb, hdr_len,
14000               EXTIV_LEN, out_buff);
14001         }
14002
14003         proto_tree_add_uint(wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
14004       }
14005
14006       /* Subtract out the length of the IV. */
14007       len          -= EXTIV_LEN;
14008       reported_len -= EXTIV_LEN;
14009       ivlen         = EXTIV_LEN;
14010       /* It is unknown whether this is TKIP or CCMP, so let's not even try to
14011        * parse TKIP Michael MIC+ICV or CCMP MIC. */
14012
14013       /* Davide Schiera (2006-11-21): enable TKIP and CCMP decryption      */
14014       /* checking for the trailer                            */
14015       if (next_tvb!=NULL) {
14016         if (reported_len < (gint) sec_trailer) {
14017           /* There is no space for a trailer, ignore it and don't decrypt  */
14018           ;
14019         } else if (len < reported_len) {
14020           /* There is space for a trailer, but we haven't capture all the  */
14021           /* packet. Slice off the trailer, but don't try to decrypt      */
14022           reported_len -= sec_trailer;
14023           if (len > reported_len)
14024             len = reported_len;
14025         } else {
14026           /* Ok, we have a trailer and the whole packet. Decrypt it!      */
14027           /* TODO: At the moment we won't add the trailer to the tree,    */
14028           /* so don't remove the trailer from the packet                  */
14029           len          -= sec_trailer;
14030           reported_len -= sec_trailer;
14031           can_decrypt   = TRUE;
14032         }
14033       }
14034       /* Davide Schiera --------------------------------------------------  */
14035     } else {
14036       /* No Ext. IV - WEP packet */
14037       /*
14038        * XXX - pass the IV and key to "try_decrypt_wep()", and have it pass
14039        * them to "wep_decrypt()", rather than having "wep_decrypt()" extract
14040        * them itself.
14041        *
14042        * Also, just pass the data *following* the WEP parameters as the
14043        * buffer to decrypt.
14044        */
14045       iv = tvb_get_ntoh24(tvb, hdr_len);
14046       if (tree) {
14047         proto_item *wep_fields;
14048
14049         wep_fields = proto_tree_add_text(hdr_tree, tvb, hdr_len, 4,
14050             "WEP parameters");
14051
14052         wep_tree = proto_item_add_subtree (wep_fields, ett_wep_parameters);
14053         proto_tree_add_uint (wep_tree, hf_ieee80211_wep_iv, tvb, hdr_len, 3, iv);
14054         tvb_memcpy(tvb, iv_buff, hdr_len, 3);
14055         is_iv_bad = weak_iv(iv_buff);
14056         if (is_iv_bad != -1) {
14057           proto_tree_add_boolean_format (wep_tree, hf_ieee80211_wep_iv_weak,
14058               tvb, 0, 0, TRUE,
14059               "Weak IV for key byte %d",
14060               is_iv_bad);
14061         }
14062       }
14063       if (tree)
14064         proto_tree_add_uint (wep_tree, hf_ieee80211_wep_key, tvb, hdr_len + 3, 1, key);
14065
14066       /* Subtract out the length of the IV. */
14067       len          -= 4;
14068       reported_len -= 4;
14069       ivlen         = 4;
14070
14071       /* Davide Schiera (2006-11-27): Even if the decryption was not */
14072       /* successful, set the algorithm                               */
14073       algorithm=PROTECTION_ALG_WEP;
14074
14075       /*
14076        * Well, this packet should, in theory, have an ICV.
14077        * Do we have the entire packet, and does it have enough data for
14078        * the ICV?
14079        */
14080       if (reported_len < 4) {
14081         /*
14082          * The packet is claimed not to even have enough data for a
14083          * 4-byte ICV.
14084          * Pretend it doesn't have an ICV.
14085          */
14086         ;
14087       } else if (len < reported_len) {
14088         /*
14089          * The packet is claimed to have enough data for a 4-byte ICV,
14090          * but we didn't capture all of the packet.
14091          * Slice off the 4-byte ICV from the reported length, and trim
14092          * the captured length so it's no more than the reported length;
14093          * that will slice off what of the ICV, if any, is in the
14094          * captured length.
14095          */
14096         reported_len -= 4;
14097         if (len > reported_len)
14098           len         = reported_len;
14099       } else {
14100         /*
14101          * We have the entire packet, and it includes a 4-byte ICV.
14102          * Slice it off, and put it into the tree.
14103          *
14104          * We only support decrypting if we have the the ICV.
14105          *
14106          * XXX - the ICV is encrypted; we're putting the encrypted
14107          * value, not the decrypted value, into the tree.
14108          */
14109         len          -= 4;
14110         reported_len -= 4;
14111         can_decrypt   = TRUE;
14112       }
14113     }
14114
14115     if (algorithm == PROTECTION_ALG_WEP) {
14116       g_strlcpy (wlan_stats.protection, "WEP", MAX_PROTECT_LEN);
14117     } else if (algorithm == PROTECTION_ALG_TKIP) {
14118       g_strlcpy (wlan_stats.protection, "TKIP", MAX_PROTECT_LEN);
14119     } else if (algorithm == PROTECTION_ALG_CCMP) {
14120       g_strlcpy (wlan_stats.protection, "CCMP", MAX_PROTECT_LEN);
14121     } else {
14122       g_strlcpy (wlan_stats.protection, "Unknown", MAX_PROTECT_LEN);
14123     }
14124
14125     /* Davide Schiera (2006-11-26): decrypted before parsing header and    */
14126     /* protection header                                  */
14127     if (!can_decrypt || (next_tvb == NULL)) {
14128       /*
14129        * WEP decode impossible or failed, treat payload as raw data
14130        * and don't attempt fragment reassembly or further dissection.
14131        */
14132       next_tvb = tvb_new_subset(tvb, hdr_len + ivlen, len, reported_len);
14133
14134       if (tree) {
14135         /* Davide Schiera (2006-11-21): added WEP or WPA separation      */
14136         if (algorithm == PROTECTION_ALG_WEP) {
14137           if (can_decrypt)
14138             proto_tree_add_uint_format (wep_tree, hf_ieee80211_wep_icv, tvb,
14139                 hdr_len + ivlen + len, 4,
14140                 tvb_get_ntohl(tvb, hdr_len + ivlen + len),
14141                 "WEP ICV: 0x%08x (not verified)",
14142                 tvb_get_ntohl(tvb, hdr_len + ivlen + len));
14143         } else if (algorithm == PROTECTION_ALG_CCMP) {
14144         } else if (algorithm == PROTECTION_ALG_TKIP) {
14145         }
14146       }
14147       /* Davide Schiera (2006-11-21) ----------------------------------  */
14148
14149       if ((pinfo->ethertype != ETHERTYPE_CENTRINO_PROMISC) && (wlan_ignore_wep == WLAN_IGNORE_WEP_NO)) {
14150         /* Some wireless drivers (such as Centrino) WEP payload already decrypted */
14151         call_dissector(data_handle, next_tvb, pinfo, tree);
14152         goto end_of_wlan;
14153       }
14154     } else {
14155       /* Davide Schiera (2006-11-21): added WEP or WPA separation        */
14156       if (algorithm == PROTECTION_ALG_WEP) {
14157         if (tree)
14158           proto_tree_add_uint_format (wep_tree, hf_ieee80211_wep_icv, tvb,
14159               hdr_len + ivlen + len, 4,
14160               tvb_get_ntohl(tvb, hdr_len + ivlen + len),
14161               "WEP ICV: 0x%08x (correct)",
14162               tvb_get_ntohl(tvb, hdr_len + ivlen + len));
14163
14164         add_new_data_source(pinfo, next_tvb, "Decrypted WEP data");
14165       } else if (algorithm==PROTECTION_ALG_CCMP) {
14166         add_new_data_source(pinfo, next_tvb, "Decrypted CCMP data");
14167       } else if (algorithm==PROTECTION_ALG_TKIP) {
14168         add_new_data_source(pinfo, next_tvb, "Decrypted TKIP data");
14169       }
14170       /* Davide Schiera (2006-11-21) -------------------------------------  */
14171       /* Davide Schiera (2006-11-27): undefine macros and definitions  */
14172 #undef IS_TKIP
14173 #undef IS_CCMP
14174 #undef PROTECTION_ALG_CCMP
14175 #undef PROTECTION_ALG_TKIP
14176 #undef PROTECTION_ALG_WEP
14177       /* Davide Schiera --------------------------------------------------  */
14178     }
14179
14180     /*
14181      * WEP decryption successful!
14182      *
14183      * Use the tvbuff we got back from the decryption; the data starts at
14184      * the beginning.  The lengths are already correct for the decoded WEP
14185      * payload.
14186      */
14187     hdr_len = 0;
14188
14189   } else {
14190     /*
14191      * Not a WEP-encrypted frame; just use the data from the tvbuff
14192      * handed to us.
14193      *
14194      * The payload starts at "hdr_len" (i.e., just past the 802.11
14195      * MAC header), the length of data in the tvbuff following the
14196      * 802.11 header is "len", and the length of data in the packet
14197      * following the 802.11 header is "reported_len".
14198      */
14199     next_tvb = tvb;
14200   }
14201
14202   /*
14203    * Do defragmentation if "wlan_defragment" is true, and we have more
14204    * fragments or this isn't the first fragment.
14205    *
14206    * We have to do some special handling to catch frames that
14207    * have the "More Fragments" indicator not set but that
14208    * don't show up as reassembled and don't have any other
14209    * fragments present.  Some networking interfaces appear
14210    * to do reassembly even when you're capturing raw packets
14211    * *and* show the reassembled packet without the "More
14212    * Fragments" indicator set *but* with a non-zero fragment
14213    * number.
14214    *
14215    * "fragment_add_seq_802_11()" handles that; we want to call it
14216    * even if we have a short frame, so that it does those checks - if
14217    * the frame is short, it doesn't do reassembly on it.
14218    *
14219    * (This could get some false positives if we really *did* only
14220    * capture the last fragment of a fragmented packet, but that's
14221    * life.)
14222    */
14223   save_fragmented = pinfo->fragmented;
14224   if (wlan_defragment && (more_frags || (frag_number != 0))) {
14225     fragment_data *fd_head;
14226
14227     /*
14228      * If we've already seen this frame, look it up in the
14229      * table of reassembled packets, otherwise add it to
14230      * whatever reassembly is in progress, if any, and see
14231      * if it's done.
14232      */
14233     if (reported_len < 0)
14234       THROW(ReportedBoundsError);
14235     fd_head = fragment_add_seq_802_11(&wlan_reassembly_table,
14236         next_tvb, hdr_len, pinfo, seq_number, NULL,
14237         frag_number,
14238         reported_len,
14239         more_frags);
14240     next_tvb = process_reassembled_data(tvb, hdr_len, pinfo,
14241         "Reassembled 802.11", fd_head,
14242         &frag_items, NULL, hdr_tree);
14243   } else {
14244     /*
14245      * If this is the first fragment, dissect its contents, otherwise
14246      * just show it as a fragment.
14247      */
14248     if (frag_number != 0) {
14249       /* Not the first fragment - don't dissect it. */
14250       next_tvb = NULL;
14251     } else {
14252       /* First fragment, or not fragmented.  Dissect what we have here. */
14253
14254       /* Get a tvbuff for the payload. */
14255       next_tvb = tvb_new_subset (next_tvb, hdr_len, len, reported_len);
14256
14257       /*
14258        * If this is the first fragment, but not the only fragment,
14259        * tell the next protocol that.
14260        */
14261       if (more_frags)
14262         pinfo->fragmented = TRUE;
14263       else
14264         pinfo->fragmented = FALSE;
14265     }
14266   }
14267
14268   if (next_tvb == NULL) {
14269     /* Just show this as an incomplete fragment. */
14270     col_set_str(pinfo->cinfo, COL_INFO, "Fragmented IEEE 802.11 frame");
14271     next_tvb = tvb_new_subset (tvb, hdr_len, len, reported_len);
14272     call_dissector(data_handle, next_tvb, pinfo, tree);
14273     pinfo->fragmented = save_fragmented;
14274     goto end_of_wlan;
14275   }
14276
14277   switch (FCF_FRAME_TYPE (fcf))
14278     {
14279
14280     case MGT_FRAME:
14281       dissect_ieee80211_mgt (fcf, next_tvb, pinfo, tree);
14282       break;
14283
14284     case DATA_FRAME:
14285       if (is_amsdu && (tvb_reported_length_remaining(next_tvb, 0) > 4)) {
14286         proto_item   *parent_item;
14287         proto_tree   *mpdu_tree;
14288         guint32       msdu_offset = 0;
14289         guint         i           = 1;
14290
14291         parent_item = proto_tree_add_protocol_format(tree, proto_aggregate, next_tvb, 0,
14292                                     tvb_reported_length_remaining(next_tvb, 0), "IEEE 802.11 Aggregate MSDU");
14293         mpdu_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_parent_tree);
14294
14295         do {
14296           tvbuff_t *volatile  msdu_tvb;
14297           guint16             msdu_length;
14298           proto_tree         *subframe_tree;
14299
14300           msdu_length = tvb_get_ntohs (next_tvb, msdu_offset+12);
14301
14302           parent_item = proto_tree_add_item(mpdu_tree, hf_ieee80211_amsdu_subframe, next_tvb,
14303                             msdu_offset, roundup2(msdu_offset+14+msdu_length, 4), ENC_NA);
14304           proto_item_append_text(parent_item, " #%u", i);
14305           subframe_tree = proto_item_add_subtree(parent_item, ett_msdu_aggregation_subframe_tree);
14306           i += 1;
14307
14308           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_da, next_tvb, msdu_offset, 6, ENC_NA);
14309           proto_tree_add_item(subframe_tree, hf_ieee80211_addr_sa, next_tvb, msdu_offset+6, 6, ENC_NA);
14310           proto_tree_add_item(subframe_tree, hf_ieee80211_amsdu_length, next_tvb, msdu_offset+12, 2, ENC_BIG_ENDIAN);
14311
14312           msdu_offset += 14;
14313           msdu_tvb = tvb_new_subset(next_tvb, msdu_offset, msdu_length, -1);
14314           call_dissector(llc_handle, msdu_tvb, pinfo, subframe_tree);
14315           msdu_offset = roundup2(msdu_offset+msdu_length, 4);
14316         } while (tvb_reported_length_remaining(next_tvb, msdu_offset) > 14);
14317
14318         break;
14319       }
14320       /* I guess some bridges take Netware Ethernet_802_3 frames,
14321          which are 802.3 frames (with a length field rather than
14322          a type field, but with no 802.2 header in the payload),
14323          and just stick the payload into an 802.11 frame.  I've seen
14324          captures that show frames of that sort.
14325
14326          We also handle some odd form of encapsulation in which a
14327          complete Ethernet frame is encapsulated within an 802.11
14328          data frame, with no 802.2 header.  This has been seen
14329          from some hardware.
14330
14331          On top of that, at least at some point it appeared that
14332          the OLPC XO sent out frames with two bytes of 0 between
14333          the "end" of the 802.11 header and the beginning of
14334          the payload.
14335
14336          So, if the packet doesn't start with 0xaa 0xaa:
14337
14338            we first use the same scheme that linux-wlan-ng does to detect
14339            those encapsulated Ethernet frames, namely looking to see whether
14340            the frame either starts with 6 octets that match the destination
14341            address from the 802.11 header or has 6 octets that match the
14342            source address from the 802.11 header following the first 6 octets,
14343            and, if so, treat it as an encapsulated Ethernet frame;
14344
14345            otherwise, we use the same scheme that we use in the Ethernet
14346            dissector to recognize Netware 802.3 frames, namely checking
14347            whether the packet starts with 0xff 0xff and, if so, treat it
14348            as an encapsulated IPX frame, and then check whether the
14349            packet starts with 0x00 0x00 and, if so, treat it as an OLPC
14350            frame. */
14351       encap_type = ENCAP_802_2;
14352       if (tvb_bytes_exist(next_tvb, 0, 2)) {
14353         octet1 = tvb_get_guint8(next_tvb, 0);
14354         octet2 = tvb_get_guint8(next_tvb, 1);
14355         if ((octet1 != 0xaa) || (octet2 != 0xaa)) {
14356           if ((tvb_memeql(next_tvb, 6, (const guint8 *)pinfo->dl_src.data, 6) == 0) ||
14357               (tvb_memeql(next_tvb, 0, (const guint8 *)pinfo->dl_dst.data, 6) == 0))
14358             encap_type = ENCAP_ETHERNET;
14359           else if ((octet1 == 0xff) && (octet2 == 0xff))
14360             encap_type = ENCAP_IPX;
14361           else if ((octet1 == 0x00) && (octet2 == 0x00)) {
14362             proto_tree_add_text(tree, next_tvb, 0, 2, "Mysterious OLPC stuff");
14363             next_tvb = tvb_new_subset_remaining (next_tvb, 2);
14364           }
14365         }
14366       }
14367
14368       switch (encap_type) {
14369
14370       case ENCAP_802_2:
14371         call_dissector(llc_handle, next_tvb, pinfo, tree);
14372         break;
14373
14374       case ENCAP_ETHERNET:
14375         call_dissector(eth_withoutfcs_handle, next_tvb, pinfo, tree);
14376         break;
14377
14378       case ENCAP_IPX:
14379         call_dissector(ipx_handle, next_tvb, pinfo, tree);
14380         break;
14381       }
14382       break;
14383     }
14384   pinfo->fragmented = save_fragmented;
14385
14386   end_of_wlan:
14387   whdr->stats = wlan_stats;
14388   tap_queue_packet(wlan_tap, pinfo, whdr);
14389   memset (&wlan_stats, 0, sizeof wlan_stats);
14390 }
14391
14392 /*
14393  * Dissect 802.11 with a variable-length link-layer header.
14394  */
14395 static void
14396 dissect_ieee80211 (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14397 {
14398   dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
14399                             pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, FALSE);
14400 }
14401
14402 /*
14403  * Dissect 802.11 with a variable-length link-layer header and data padding.
14404  */
14405 static void
14406 dissect_ieee80211_datapad (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14407 {
14408   dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
14409                             pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, TRUE, FALSE);
14410 }
14411
14412 /*
14413  * Dissect 802.11 with a variable-length link-layer header and a byte-swapped
14414  * control field (some hardware sends out LWAPP-encapsulated 802.11
14415  * packets with the control field byte swapped).
14416  */
14417 static void
14418 dissect_ieee80211_bsfc (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14419 {
14420   dissect_ieee80211_common (tvb, pinfo, tree, FALSE, 0, TRUE, FALSE, FALSE);
14421 }
14422
14423 /*
14424  * Dissect 802.11 with a fixed-length link-layer header (padded to the
14425  * maximum length).
14426  */
14427 static void
14428 dissect_ieee80211_fixed (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14429 {
14430   dissect_ieee80211_common (tvb, pinfo, tree, TRUE, 0, FALSE, FALSE, FALSE);
14431 }
14432
14433 /*
14434  * Dissect an HT 802.11 frame with a variable-length link-layer header.
14435  * XXX - Can we tell if a frame is +HTC just by looking at the MAC header?
14436  * If so, we can dispense with this.
14437  */
14438 static void
14439 dissect_ieee80211_ht (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14440 {
14441   dissect_ieee80211_common (tvb, pinfo, tree, FALSE,
14442                             pinfo->pseudo_header->ieee_802_11.fcs_len, FALSE, FALSE, TRUE);
14443 }
14444
14445 static void
14446 wlan_defragment_init(void)
14447 {
14448   reassembly_table_init(&wlan_reassembly_table,
14449                         &addresses_reassembly_table_functions);
14450 }
14451
14452 /* ------------- */
14453 static guint
14454 retransmit_hash(gconstpointer k)
14455 {
14456   const retransmit_key *key = (const retransmit_key *)k;
14457   guint hash_val;
14458   int   i;
14459
14460   hash_val = 0;
14461   for (i = 0; i < 6; i++)
14462     hash_val += key->bssid[i];
14463
14464   for (i = 0; i < 6; i++)
14465     hash_val += key->src[i];
14466
14467   return hash_val;
14468 }
14469
14470 static gint
14471 retransmit_equal(gconstpointer k1, gconstpointer k2)
14472 {
14473   const retransmit_key *key1 = (const retransmit_key *)k1;
14474   const retransmit_key *key2 = (const retransmit_key *)k2;
14475
14476   return ((!memcmp(key1->bssid, key2->bssid, 6) && !memcmp(key1->src, key2->src, 6)) ? TRUE:FALSE);
14477 }
14478
14479 static guint
14480 frame_hash(gconstpointer k)
14481 {
14482   guint32 frame = GPOINTER_TO_UINT(k);
14483
14484   return frame;
14485 }
14486
14487 static gint
14488 frame_equal(gconstpointer k1, gconstpointer k2)
14489 {
14490   guint32 frame1 = GPOINTER_TO_UINT(k1);
14491   guint32 frame2 = GPOINTER_TO_UINT(k2);
14492
14493   return frame1==frame2;
14494 }
14495
14496 /* Davide Schiera (2006-11-26): this function will try to decrypt with WEP or  */
14497 /* WPA and return a tvb to the caller to add a new tab. It returns the    */
14498 /* algorithm used for decryption (WEP, TKIP, CCMP) and the header and    */
14499 /* trailer lengths.                                      */
14500 static tvbuff_t *
14501 try_decrypt(tvbuff_t *tvb, guint offset, guint len, guint8 *algorithm, guint32 *sec_header, guint32 *sec_trailer)
14502 {
14503   const guint8      *enc_data;
14504   tvbuff_t          *decr_tvb = NULL;
14505   guint32            dec_caplen;
14506   guchar             dec_data[AIRPDCAP_MAX_CAPLEN];
14507   AIRPDCAP_KEY_ITEM  used_key;
14508
14509   if (!enable_decryption)
14510     return NULL;
14511
14512   /* get the entire packet                                  */
14513   enc_data = tvb_get_ptr(tvb, 0, len+offset);
14514
14515   /*  process packet with AirPDcap                              */
14516   if (AirPDcapPacketProcess(&airpdcap_ctx, enc_data, offset, offset+len, dec_data, &dec_caplen,
14517                             &used_key, FALSE, TRUE)==AIRPDCAP_RET_SUCCESS)
14518   {
14519     guint8 *tmp;
14520     *algorithm=used_key.KeyType;
14521     switch (*algorithm) {
14522       case AIRPDCAP_KEY_TYPE_WEP:
14523         *sec_header=AIRPDCAP_WEP_HEADER;
14524         *sec_trailer=AIRPDCAP_WEP_TRAILER;
14525         break;
14526       case AIRPDCAP_KEY_TYPE_CCMP:
14527         *sec_header=AIRPDCAP_RSNA_HEADER;
14528         *sec_trailer=AIRPDCAP_CCMP_TRAILER;
14529         break;
14530       case AIRPDCAP_KEY_TYPE_TKIP:
14531         *sec_header=AIRPDCAP_RSNA_HEADER;
14532         *sec_trailer=AIRPDCAP_TKIP_TRAILER;
14533         break;
14534       default:
14535         return NULL;
14536     }
14537
14538     /* allocate buffer for decrypted payload                      */
14539     tmp = (guint8 *)g_memdup(dec_data+offset, dec_caplen-offset);
14540
14541     len = dec_caplen-offset;
14542
14543     /* decrypt successful, let's set up a new data tvb.              */
14544     decr_tvb = tvb_new_child_real_data(tvb, tmp, len, len);
14545     tvb_set_free_cb(decr_tvb, g_free);
14546   }
14547
14548   return decr_tvb;
14549 }
14550 /*  Davide Schiera -----------------------------------------------------------  */
14551
14552
14553 /* Collect our WEP and WPA keys */
14554 static void
14555 set_airpdcap_keys(void)
14556 {
14557   PAIRPDCAP_KEYS_COLLECTION  keys;
14558   GByteArray                *bytes = NULL;
14559   guint                      i;
14560
14561   keys = (PAIRPDCAP_KEYS_COLLECTION)se_alloc(sizeof(AIRPDCAP_KEYS_COLLECTION));
14562   keys->nKeys = 0;
14563
14564   for (i = 0; (uat_wep_key_records != NULL) && (i < num_wepkeys_uat) && (i < MAX_ENCRYPTION_KEYS); i++)
14565   {
14566     decryption_key_t *dk;
14567     dk = parse_key_string(uat_wep_key_records[i].string, uat_wep_key_records[i].key);
14568
14569     if (dk != NULL)
14570     {
14571       AIRPDCAP_KEY_ITEM          key;
14572       if (dk->type == AIRPDCAP_KEY_TYPE_WEP)
14573       {
14574         gboolean res;
14575         key.KeyType = AIRPDCAP_KEY_TYPE_WEP;
14576
14577         bytes = g_byte_array_new();
14578         res = hex_str_to_bytes(dk->key->str, bytes, FALSE);
14579
14580         if (dk->key->str && res && (bytes->len > 0) && (bytes->len <= AIRPDCAP_WEP_KEY_MAXLEN))
14581         {
14582           /*
14583            * WEP key is correct (well, the can be even or odd, so it is not
14584            * a real check, I think... is a check performed somewhere in the
14585            * AirPDcap function???)
14586            */
14587           memcpy(key.KeyData.Wep.WepKey, bytes->data, bytes->len);
14588           key.KeyData.Wep.WepKeyLen = bytes->len;
14589           keys->Keys[keys->nKeys] = key;
14590           keys->nKeys += 1;
14591         }
14592       }
14593       else if (dk->type == AIRPDCAP_KEY_TYPE_WPA_PWD)
14594       {
14595         key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PWD;
14596
14597         /* XXX - This just lops the end if the key off if it's too long.
14598          *       Should we handle this more gracefully? */
14599         g_strlcpy(key.UserPwd.Passphrase, dk->key->str, AIRPDCAP_WPA_PASSPHRASE_MAX_LEN+1);
14600
14601         key.UserPwd.SsidLen = 0;
14602         if ((dk->ssid != NULL) && (dk->ssid->len <= AIRPDCAP_WPA_SSID_MAX_LEN))
14603         {
14604           memcpy(key.UserPwd.Ssid, dk->ssid->data, dk->ssid->len);
14605           key.UserPwd.SsidLen = dk->ssid->len;
14606         }
14607
14608         keys->Keys[keys->nKeys] = key;
14609         keys->nKeys += 1;
14610       }
14611       else if (dk->type == AIRPDCAP_KEY_TYPE_WPA_PSK)
14612       {
14613         key.KeyType = AIRPDCAP_KEY_TYPE_WPA_PSK;
14614
14615         bytes = g_byte_array_new();
14616         hex_str_to_bytes(dk->key->str, bytes, FALSE);
14617
14618         /* XXX - Pass the correct array of bytes... */
14619         if (bytes->len <= AIRPDCAP_WPA_PSK_LEN) {
14620           memcpy(key.KeyData.Wpa.Psk, bytes->data, bytes->len);
14621
14622           keys->Keys[keys->nKeys] = key;
14623           keys->nKeys += 1;
14624         }
14625       }
14626     }
14627   }
14628
14629   /* Now set the keys */
14630   AirPDcapSetKeys(&airpdcap_ctx, keys->Keys, keys->nKeys);
14631   if (bytes)
14632     g_byte_array_free(bytes, TRUE);
14633
14634 }
14635
14636 static void
14637 init_wepkeys(void)
14638 {
14639
14640   /*
14641    * XXX - AirPDcap - That God sends it to us beautiful (che dio ce la mandi bona)
14642    * The next lines will add a key to the AirPDcap context. The keystring will be added
14643    * to the old WEP array too, but we don't care, because the packets will come here
14644    * already decrypted... One of these days we will fix this too
14645    */
14646   set_airpdcap_keys();
14647 }
14648
14649 /*
14650  * This code had been taken from AirSnort crack.c function classify()
14651  * Permission granted by snax <at> shmoo dot com
14652  * weak_iv - determine which key byte an iv is useful in resolving
14653  * parm     - p, pointer to the first byte of an IV
14654  * return   -  n - this IV is weak for byte n of a WEP key
14655  *            -1 - this IV is not weak for any key bytes
14656  *
14657  * This function tests for IVs that are known to satisfy the criteria
14658  * for a weak IV as specified in FMS section 7.1
14659  *
14660  */
14661 static int
14662 weak_iv(guchar *iv)
14663 {
14664   guchar sum, k;
14665
14666   if ((iv[1] == 255) && (iv[0] > 2) && (iv[0] < 16)) {
14667     return iv[0] -3;
14668   }
14669
14670   sum = iv[0] + iv[1];
14671   if (sum == 1) {
14672     if (iv[2] <= 0x0a) {
14673       return iv[2] +2;
14674     }
14675     else if (iv[2] == 0xff) {
14676       return 0;
14677     }
14678   }
14679   k = 0xfe - iv[2];
14680   if ((sum == k)  && ((iv[2] >= 0xf2) && (iv[2] <= 0xfe) && (iv[2] != 0xfd))) {
14681     return k;
14682   }
14683   return -1;
14684 }
14685
14686 static void
14687 wlan_retransmit_init(void)
14688 {
14689   if (fc_analyse_retransmit_table) {
14690     g_hash_table_destroy(fc_analyse_retransmit_table);
14691     fc_analyse_retransmit_table = NULL;
14692   }
14693
14694   if (fc_first_frame_table) {
14695     g_hash_table_destroy(fc_first_frame_table);
14696     fc_first_frame_table = NULL;
14697   }
14698
14699   if (wlan_subdissector)
14700     return;
14701
14702   fc_analyse_retransmit_table= g_hash_table_new(retransmit_hash, retransmit_equal);
14703   fc_first_frame_table = g_hash_table_new(frame_hash, frame_equal);
14704
14705 }
14706
14707 static void
14708 dissect_data_encap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
14709 {
14710   int         offset = 0;
14711   guint8      type;
14712   int         tagged_parameter_tree_len;
14713   proto_tree *tagged_tree;
14714
14715   type = tvb_get_guint8(tvb, offset);
14716   proto_tree_add_item(tree, hf_ieee80211_data_encap_payload_type, tvb, offset,
14717                       1, ENC_BIG_ENDIAN);
14718   offset += 1;
14719   switch (type) {
14720   case 1:
14721     col_set_str(pinfo->cinfo, COL_PROTOCOL, "RRB");
14722     /* TODO: IEEE 802.11r */
14723     break;
14724   case 2:
14725     col_set_str(pinfo->cinfo, COL_PROTOCOL, "TDLS");
14726     col_clear(pinfo->cinfo, COL_INFO);
14727     offset += add_fixed_field(tree, tvb, pinfo, offset, FIELD_ACTION);
14728     tagged_parameter_tree_len = tvb_reported_length_remaining(tvb, offset);
14729     if (tagged_parameter_tree_len > 0) {
14730       tagged_tree = get_tagged_parameter_tree(tree, tvb, offset,
14731                                               tagged_parameter_tree_len);
14732       ieee_80211_add_tagged_parameters(tvb, offset, pinfo, tagged_tree,
14733                                        tagged_parameter_tree_len, -1);
14734     }
14735     break;
14736   }
14737 }
14738
14739 void
14740 proto_register_ieee80211 (void)
14741 {
14742
14743   static hf_register_info hf[] = {
14744     {&hf_ieee80211_fc_field,
14745      {"Frame Control Field", "wlan.fc",
14746       FT_UINT16, BASE_HEX, NULL, 0,
14747       "MAC Frame control", HFILL }},
14748
14749     {&hf_ieee80211_fc_proto_version,
14750      {"Version", "wlan.fc.version",
14751       FT_UINT8, BASE_DEC, NULL, 0x03,
14752       "MAC Protocol version", HFILL }},  /* 0 */
14753
14754     {&hf_ieee80211_fc_frame_type,
14755      {"Type", "wlan.fc.type",
14756       FT_UINT8, BASE_DEC, VALS(frame_type), 0x0C,
14757       "Frame type", HFILL }},
14758
14759     {&hf_ieee80211_fc_frame_subtype,
14760      {"Subtype", "wlan.fc.subtype",
14761       FT_UINT8, BASE_DEC, NULL, 0xF0,
14762       "Frame subtype", HFILL }},  /* 2 */
14763
14764     {&hf_ieee80211_fc_frame_type_subtype,
14765      {"Type/Subtype", "wlan.fc.type_subtype",
14766       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &frame_type_subtype_vals_ext, 0x0,
14767       "Type and subtype combined (first byte: type, second byte: subtype)", HFILL }},
14768
14769     {&hf_ieee80211_fc_flags,
14770      {"Flags", "wlan.flags",
14771       FT_UINT8, BASE_HEX, NULL, 0,
14772       NULL, HFILL }},
14773
14774     {&hf_ieee80211_fc_data_ds,
14775      {"DS status", "wlan.fc.ds",
14776       FT_UINT8, BASE_HEX, VALS(tofrom_ds), (FLAG_FROM_DS|FLAG_TO_DS),
14777       "Data-frame DS-traversal status", HFILL }},  /* 3 */
14778
14779     {&hf_ieee80211_fc_to_ds,
14780      {"To DS", "wlan.fc.tods",
14781       FT_BOOLEAN, 8, TFS (&tods_flag), FLAG_TO_DS,
14782       "To DS flag", HFILL }},    /* 4 */
14783
14784     {&hf_ieee80211_fc_from_ds,
14785      {"From DS", "wlan.fc.fromds",
14786       FT_BOOLEAN, 8, TFS (&fromds_flag), FLAG_FROM_DS,
14787       "From DS flag", HFILL }},    /* 5 */
14788
14789     {&hf_ieee80211_fc_more_frag,
14790      {"More Fragments", "wlan.fc.frag",
14791       FT_BOOLEAN, 8, TFS (&more_fragments), FLAG_MORE_FRAGMENTS,
14792       "More Fragments flag", HFILL }},  /* 6 */
14793
14794     {&hf_ieee80211_fc_retry,
14795      {"Retry", "wlan.fc.retry",
14796       FT_BOOLEAN, 8, TFS (&retry_flags), FLAG_RETRY,
14797       "Retransmission flag", HFILL }},
14798
14799     { &hf_ieee80211_fc_analysis_retransmission,
14800      {"Retransmission", "wlan.analysis.retransmission",
14801       FT_NONE, BASE_NONE, NULL, 0x0,
14802       "This frame is a suspected wireless retransmission", HFILL }},
14803
14804     { &hf_ieee80211_fc_analysis_retransmission_frame,
14805      {"Retransmission of frame", "wlan.analysis.retransmission_frame",
14806       FT_FRAMENUM, BASE_NONE, NULL, 0x0,
14807       "This is a retransmission of frame #", HFILL }},
14808
14809     {&hf_ieee80211_fc_pwr_mgt,
14810      {"PWR MGT", "wlan.fc.pwrmgt",
14811       FT_BOOLEAN, 8, TFS (&pm_flags), FLAG_POWER_MGT,
14812       "Power management status", HFILL }},
14813
14814     {&hf_ieee80211_fc_more_data,
14815      {"More Data", "wlan.fc.moredata",
14816       FT_BOOLEAN, 8, TFS (&md_flags), FLAG_MORE_DATA,
14817       "More data flag", HFILL }},
14818
14819     {&hf_ieee80211_fc_protected,
14820      {"Protected flag", "wlan.fc.protected",
14821       FT_BOOLEAN, 8, TFS (&protected_flags), FLAG_PROTECTED,
14822       NULL, HFILL }},
14823
14824     {&hf_ieee80211_fc_order,
14825      {"Order flag", "wlan.fc.order",
14826       FT_BOOLEAN, 8, TFS (&order_flags), FLAG_ORDER,
14827       "Strictly ordered flag", HFILL }},
14828
14829     {&hf_ieee80211_assoc_id,
14830      {"Association ID","wlan.aid"
14831       ,FT_UINT16, BASE_DEC, NULL, 0x3FFF,
14832       "Association-ID field", HFILL }},
14833
14834     {&hf_ieee80211_did_duration,
14835      {"Duration", "wlan.duration",
14836       FT_UINT16, BASE_DEC, NULL, 0x7FFF,
14837       "Duration field", HFILL }},
14838
14839     {&hf_ieee80211_addr_da,
14840      {"Destination address", "wlan.da",
14841       FT_ETHER, BASE_NONE, NULL, 0,
14842       "Destination Hardware Address", HFILL }},
14843
14844     {&hf_ieee80211_addr_sa,
14845      {"Source address", "wlan.sa",
14846       FT_ETHER, BASE_NONE, NULL, 0,
14847       "Source Hardware Address", HFILL }},
14848
14849     { &hf_ieee80211_addr,
14850       {"Hardware address", "wlan.addr",
14851        FT_ETHER, BASE_NONE, NULL, 0,
14852        "SA, DA, BSSID, RA or TA Hardware Address", HFILL }},
14853
14854     {&hf_ieee80211_addr_ra,
14855      {"Receiver address", "wlan.ra",
14856       FT_ETHER, BASE_NONE, NULL, 0,
14857       "Receiving Station Hardware Address", HFILL }},
14858
14859     {&hf_ieee80211_addr_ta,
14860      {"Transmitter address", "wlan.ta",
14861       FT_ETHER, BASE_NONE, NULL, 0,
14862       "Transmitting Station Hardware Address", HFILL }},
14863
14864     {&hf_ieee80211_addr_bssid,
14865      {"BSS Id", "wlan.bssid",
14866       FT_ETHER, BASE_NONE, NULL, 0,
14867       "Basic Service Set ID", HFILL }},
14868
14869     {&hf_ieee80211_frag_number,
14870      {"Fragment number", "wlan.frag",
14871       FT_UINT16, BASE_DEC, NULL, 0,
14872       NULL, HFILL }},
14873
14874     {&hf_ieee80211_seq_number,
14875      {"Sequence number", "wlan.seq",
14876       FT_UINT16, BASE_DEC, NULL, 0,
14877       NULL, HFILL }},
14878
14879     {&hf_ieee80211_mesh_control_field,
14880      {"Mesh Control Field", "wlan.mesh.control_field",
14881       FT_NONE, BASE_NONE, NULL, 0,
14882       NULL, HFILL }},
14883
14884     {&hf_ieee80211_qos,
14885      {"Qos Control", "wlan.qos",
14886       FT_UINT16, BASE_HEX, NULL, 0,
14887       NULL, HFILL }},
14888
14889     {&hf_ieee80211_qos_tid,
14890      {"TID", "wlan.qos.tid",
14891       FT_UINT16, BASE_DEC, NULL, 0x000F,
14892       NULL, HFILL }},
14893
14894     {&hf_ieee80211_qos_priority,
14895      {"Priority", "wlan.qos.priority",
14896       FT_UINT16, BASE_DEC, VALS(ieee80211_qos_tags_acs), 0x0007,
14897       "802.1D Tag", HFILL }},
14898
14899     {&hf_ieee80211_qos_eosp,
14900      {"EOSP", "wlan.qos.eosp",
14901       FT_BOOLEAN, 16, TFS (&eosp_flag), QOS_FLAG_EOSP,
14902       "EOSP Field", HFILL }},
14903
14904     {&hf_ieee80211_qos_bit4,
14905      {"QoS bit 4", "wlan.qos.bit4",
14906       FT_BOOLEAN, 16, TFS (&bit4_flag), QOS_FLAG_EOSP,
14907       NULL, HFILL }},
14908
14909     {&hf_ieee80211_qos_ack_policy,
14910      {"Ack Policy", "wlan.qos.ack",
14911       FT_UINT16, BASE_HEX,  VALS(ack_policy), 0x0060,
14912       NULL, HFILL }},
14913
14914     {&hf_ieee80211_qos_amsdu_present,
14915      {"Payload Type", "wlan.qos.amsdupresent",
14916       FT_BOOLEAN, 16,
14917       TFS(&ieee80211_qos_amsdu_present_flag), 0x0080, NULL, HFILL }},
14918
14919     {&hf_ieee80211_qos_txop_limit,
14920      {"TXOP Limit", "wlan.qos.txop_limit",
14921       FT_UINT16, BASE_DEC, NULL, 0xFF00,
14922       NULL, HFILL }},
14923
14924     {&hf_ieee80211_qos_ps_buf_state,
14925      {"QAP PS Buffer State", "wlan.qos.ps_buf_state",
14926       FT_UINT16, BASE_HEX, NULL, 0xFF00,
14927       NULL, HFILL }},
14928
14929     {&hf_ieee80211_qos_buf_state_indicated,
14930      {"Buffer State Indicated", "wlan.qos.buf_state_indicated",
14931       FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
14932       NULL, HFILL }},
14933
14934     {&hf_ieee80211_qos_highest_pri_buf_ac,
14935      {"Highest-Priority Buffered AC", "wlan.qos.highest_pri_buf_ac",
14936        FT_UINT16, BASE_DEC, VALS(wme_acs), 0x0C00,
14937       NULL, HFILL }},
14938
14939     {&hf_ieee80211_qos_qap_buf_load,
14940      {"QAP Buffered Load", "wlan.qos.qap_buf_load",
14941       FT_UINT16, BASE_DEC, NULL, 0xF000,
14942       NULL, HFILL }},
14943
14944     {&hf_ieee80211_qos_txop_dur_req,
14945      {"TXOP Duration Requested", "wlan.qos.txop_dur_req",
14946       FT_UINT16, BASE_DEC, NULL, 0xFF00,
14947       NULL, HFILL }},
14948
14949     {&hf_ieee80211_qos_queue_size,
14950      {"Queue Size", "wlan.qos.queue_size",
14951       FT_UINT16, BASE_DEC, NULL, 0xFF00,
14952       NULL, HFILL }},
14953
14954     {&hf_ieee80211_fcs,
14955      {"Frame check sequence", "wlan.fcs",
14956       FT_UINT32, BASE_HEX, NULL, 0,
14957       "Frame Check Sequence (FCS)", HFILL }},
14958
14959     {&hf_ieee80211_fcs_good,
14960      {"Good", "wlan.fcs_good",
14961       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14962       "True if the FCS is correct", HFILL }},
14963
14964     {&hf_ieee80211_fcs_bad,
14965      {"Bad", "wlan.fcs_bad",
14966       FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14967       "True if the FCS is incorrect", HFILL }},
14968
14969     {&hf_ieee80211_fragment_overlap,
14970       {"Fragment overlap", "wlan.fragment.overlap",
14971        FT_BOOLEAN, BASE_NONE,
14972        NULL, 0x0,
14973        "Fragment overlaps with other fragments", HFILL }},
14974
14975     {&hf_ieee80211_fragment_overlap_conflict,
14976       {"Conflicting data in fragment overlap", "wlan.fragment.overlap.conflict",
14977        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14978        "Overlapping fragments contained conflicting data", HFILL }},
14979
14980     {&hf_ieee80211_fragment_multiple_tails,
14981       {"Multiple tail fragments found", "wlan.fragment.multipletails",
14982        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14983        "Several tails were found when defragmenting the packet", HFILL }},
14984
14985     {&hf_ieee80211_fragment_too_long_fragment,
14986       {"Fragment too long", "wlan.fragment.toolongfragment",
14987        FT_BOOLEAN, BASE_NONE, NULL, 0x0,
14988        "Fragment contained data past end of packet", HFILL }},
14989
14990     {&hf_ieee80211_fragment_error,
14991       {"Defragmentation error", "wlan.fragment.error",
14992        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
14993        "Defragmentation error due to illegal fragments", HFILL }},
14994
14995     {&hf_ieee80211_fragment_count,
14996       {"Fragment count", "wlan.fragment.count",
14997        FT_UINT32, BASE_DEC, NULL, 0x0,
14998        NULL, HFILL }},
14999
15000     {&hf_ieee80211_fragment,
15001       {"802.11 Fragment", "wlan.fragment",
15002        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
15003        NULL, HFILL }},
15004
15005     {&hf_ieee80211_fragments,
15006       {"802.11 Fragments", "wlan.fragments",
15007        FT_NONE, BASE_NONE, NULL, 0x0,
15008        NULL, HFILL }},
15009
15010     {&hf_ieee80211_reassembled_in,
15011       {"Reassembled 802.11 in frame", "wlan.reassembled_in",
15012        FT_FRAMENUM, BASE_NONE, NULL, 0x0,
15013        "This 802.11 packet is reassembled in this frame", HFILL }},
15014
15015     {&hf_ieee80211_reassembled_length,
15016       {"Reassembled 802.11 length", "wlan.reassembled.length",
15017        FT_UINT32, BASE_DEC, NULL, 0x0,
15018        "The total length of the reassembled payload", HFILL }},
15019
15020     {&hf_ieee80211_wep_iv,
15021      {"Initialization Vector", "wlan.wep.iv",
15022       FT_UINT24, BASE_HEX, NULL, 0,
15023       NULL, HFILL }},
15024
15025     {&hf_ieee80211_wep_iv_weak,
15026      {"Weak IV", "wlan.wep.weakiv",
15027       FT_BOOLEAN, BASE_NONE, NULL,0x0,
15028        NULL,HFILL}},
15029
15030     {&hf_ieee80211_tkip_extiv,
15031      {"TKIP Ext. Initialization Vector", "wlan.tkip.extiv",
15032       FT_STRING, BASE_NONE, NULL, 0,
15033       "TKIP Extended Initialization Vector", HFILL }},
15034
15035     {&hf_ieee80211_ccmp_extiv,
15036      {"CCMP Ext. Initialization Vector", "wlan.ccmp.extiv",
15037       FT_STRING, BASE_NONE, NULL, 0,
15038       "CCMP Extended Initialization Vector", HFILL }},
15039
15040     {&hf_ieee80211_wep_key,
15041      {"Key Index", "wlan.wep.key",
15042       FT_UINT8, BASE_DEC, NULL, 0,
15043       NULL, HFILL }},
15044
15045     {&hf_ieee80211_wep_icv,
15046      {"WEP ICV", "wlan.wep.icv",
15047       FT_UINT32, BASE_HEX, NULL, 0,
15048       NULL, HFILL }},
15049
15050     {&hf_ieee80211_block_ack_request_control,
15051      {"Block Ack Request (BAR) Control", "wlan.bar.control",
15052       FT_UINT16, BASE_HEX, NULL, 0,
15053       NULL, HFILL }},
15054
15055     {&hf_ieee80211_block_ack_control,
15056      {"Block Ack Request Control", "wlan.ba.control",
15057       FT_UINT16, BASE_HEX, NULL, 0,
15058       NULL, HFILL }},
15059
15060     {&hf_ieee80211_block_ack_control_ack_policy,
15061      {"BAR Ack Policy", "wlan.ba.control.ackpolicy",
15062       FT_BOOLEAN, 16, TFS (&ieee80211_block_ack_control_ack_policy_flag), 0x01,
15063       "Block Ack Request (BAR) Ack Policy", HFILL }},
15064
15065     {&hf_ieee80211_block_ack_control_multi_tid,
15066      {"Multi-TID", "wlan.ba.control.multitid",
15067       FT_BOOLEAN, 16, 0, 0x02,
15068       "Multi-Traffic Identifier (TID)", HFILL }},
15069
15070     {&hf_ieee80211_block_ack_control_compressed_bitmap,
15071      {"Compressed Bitmap", "wlan.ba.control.cbitmap",
15072       FT_BOOLEAN, 16, 0, 0x04,
15073       NULL, HFILL }},
15074
15075     {&hf_ieee80211_block_ack_control_reserved,
15076      {"Reserved", "wlan.ba.control.cbitmap",
15077       FT_UINT16, BASE_HEX, NULL, 0x0ff8,
15078       NULL, HFILL }},
15079
15080     {&hf_ieee80211_block_ack_control_basic_tid_info,
15081      {"TID for which a Basic BlockAck frame is requested", "wlan.ba.basic.tidinfo",
15082       FT_UINT16, BASE_HEX, NULL, 0xf000,
15083       "Traffic Identifier (TID) for which a Basic BlockAck frame is requested", HFILL }},
15084
15085     {&hf_ieee80211_block_ack_control_compressed_tid_info,
15086      {"TID for which a BlockAck frame is requested", "wlan.bar.compressed.tidinfo",
15087       FT_UINT16, BASE_HEX, NULL, 0xf000,
15088       "Traffic Identifier (TID) for which a BlockAck frame is requested", HFILL }},
15089
15090     {&hf_ieee80211_block_ack_control_multi_tid_info,
15091      {"Number of TIDs Present", "wlan.ba.mtid.tidinfo",
15092       FT_UINT16, BASE_HEX, NULL, 0xf000,
15093       "Number of Traffic Identifiers (TIDs) Present", HFILL }},
15094
15095     {&hf_ieee80211_block_ack_multi_tid_info,
15096      {"Traffic Identifier (TID) Info", "wlan.ba.mtid.tid",
15097       FT_UINT8, BASE_DEC, 0, 0,
15098       NULL, HFILL }},
15099
15100     {&hf_ieee80211_block_ack_multi_tid_reserved,
15101      {"Reserved", "wlan.bar.mtid.tidinfo.reserved",
15102       FT_UINT16, BASE_HEX, 0, 0x0fff,
15103       NULL, HFILL }},
15104
15105     {&hf_ieee80211_block_ack_multi_tid_value,
15106      {"Multi-TID Value", "wlan.bar.mtid.tidinfo.value",
15107       FT_UINT16, BASE_HEX, 0, 0xf000,
15108       NULL, HFILL }},
15109
15110     {&hf_ieee80211_block_ack_request_type,
15111      {"Block Ack Request Type", "wlan.bar.type",
15112       FT_UINT8, BASE_HEX, VALS(ieee80211_block_ack_request_type_flags), 0x06,
15113       "Block Ack Request (BAR) Type", HFILL }},
15114
15115     {&hf_ieee80211_block_ack_type,
15116      {"Block Ack Type", "wlan.ba.type",
15117       FT_UINT8, BASE_HEX, VALS(ieee80211_block_ack_type_flags), 0x06,
15118       NULL, HFILL }},
15119
15120     {&hf_ieee80211_block_ack_bitmap,
15121      {"Block Ack Bitmap", "wlan.ba.bm",
15122       FT_BYTES, BASE_NONE, NULL, 0,
15123       NULL, HFILL }},
15124
15125     {&hf_ieee80211_block_ack_bitmap_missing_frame,
15126      {"Missing frame", "wlan.ba.bm.missing_frame",
15127       FT_UINT32, BASE_DEC, NULL, 0,
15128       NULL, HFILL }},
15129
15130     {&hf_ieee80211_data_encap_payload_type,
15131      {"Payload Type", "wlan.data_encap.payload_type",
15132       FT_UINT8, BASE_DEC, VALS(ieee80211_data_encap_payload_types), 0,
15133       NULL, HFILL }},
15134
15135     {&hf_ieee80211_ff_tdls_action_code,
15136      {"Action code", "wlan_mgt.fixed.action_code",
15137       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tdls_action_codes_ext, 0,
15138       "Management action code", HFILL }},
15139
15140     {&hf_ieee80211_ff_target_channel,
15141      {"Target Channel", "wlan_mgt.fixed.target_channel",
15142       FT_UINT8, BASE_DEC, NULL, 0,
15143       NULL, HFILL }},
15144
15145     {&hf_ieee80211_ff_regulatory_class,
15146      {"Regulatory Class", "wlan_mgt.fixed.regulatory_class",
15147       FT_UINT8, BASE_DEC, NULL, 0,
15148       NULL, HFILL }},
15149
15150     {&hf_ieee80211_ff_wnm_action_code,
15151      {"Action code", "wlan_mgt.fixed.action_code",
15152       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_action_codes_ext, 0,
15153       "Management action code", HFILL }},
15154
15155     {&hf_ieee80211_ff_key_data,
15156      {"Key Data", "wlan_mgt.fixed.key_data",
15157       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
15158
15159     {&hf_ieee80211_ff_key_data_length,
15160      {"Key Data Length", "wlan_mgt.fixed.key_data_length",
15161       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
15162
15163     {&hf_ieee80211_ff_wnm_notification_type,
15164      {"WNM-Notification type", "wlan_mgt.fixed.wnm_notification_type",
15165       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &wnm_notification_types_ext, 0,
15166       NULL, HFILL }},
15167
15168     {&hf_ieee80211_ff_request_mode_pref_cand,
15169      {"Preferred Candidate List Included","wlan_mgt.fixed.request_mode.pref_cand",
15170       FT_UINT8, BASE_DEC, NULL, 0x01,
15171       NULL, HFILL }},
15172
15173     {&hf_ieee80211_ff_request_mode_abridged,
15174      {"Abridged", "wlan_mgt.fixed.request_mode.abridged",
15175       FT_UINT8, BASE_DEC, NULL, 0x02,
15176       NULL, HFILL }},
15177
15178     {&hf_ieee80211_ff_request_mode_disassoc_imminent,
15179      {"Disassociation Imminent", "wlan_mgt.fixed.request_mode.disassoc_imminent",
15180       FT_UINT8, BASE_DEC, NULL, 0x04,
15181       NULL, HFILL }},
15182
15183     {&hf_ieee80211_ff_request_mode_bss_term_included,
15184      {"BSS Termination Included", "wlan_mgt.fixed.request_mode.bss_term_included",
15185       FT_UINT8, BASE_DEC, NULL, 0x08,
15186       NULL, HFILL }},
15187
15188     {&hf_ieee80211_ff_request_mode_ess_disassoc_imminent,
15189      {"ESS Disassociation Imminent", "wlan_mgt.fixed.request_mode.ess_disassoc_imminent",
15190       FT_UINT8, BASE_DEC, NULL, 0x10,
15191       NULL, HFILL }},
15192
15193     {&hf_ieee80211_ff_disassoc_timer,
15194      {"Disassociation Timer", "wlan_mgt.fixed.disassoc_timer",
15195       FT_UINT16, BASE_DEC, NULL, 0,
15196       NULL, HFILL }},
15197
15198     {&hf_ieee80211_ff_validity_interval,
15199      {"Validity Interval", "wlan_mgt.fixed.validity_interval",
15200       FT_UINT8, BASE_DEC, NULL, 0,
15201       NULL, HFILL }},
15202
15203     {&hf_ieee80211_ff_url_len,
15204      {"Session Information URL Length",
15205       "wlan_mgt.fixed.session_information.url_length",
15206       FT_UINT8, BASE_DEC, NULL, 0,
15207       NULL, HFILL }},
15208
15209     {&hf_ieee80211_ff_url,
15210      {"Session Information URL", "wlan_mgt.fixed.session_information.url",
15211       FT_STRING, BASE_NONE, NULL, 0,
15212       NULL, HFILL }},
15213   };
15214
15215   static hf_register_info ff[] = {
15216
15217     {&hf_ieee80211_ff_timestamp,
15218      {"Timestamp", "wlan_mgt.fixed.timestamp",
15219       FT_UINT64, BASE_HEX, NULL, 0,
15220       NULL, HFILL }},
15221
15222     {&hf_ieee80211_ff_auth_alg,
15223      {"Authentication Algorithm", "wlan_mgt.fixed.auth.alg",
15224       FT_UINT16, BASE_DEC, VALS(auth_alg), 0,
15225       NULL, HFILL }},
15226
15227     {&hf_ieee80211_ff_beacon_interval,
15228      {"Beacon Interval", "wlan_mgt.fixed.beacon",
15229       FT_UINT32, BASE_CUSTOM, beacon_interval_base_custom, 0,
15230       NULL, HFILL }},
15231
15232     {&hf_ieee80211_fixed_parameters,
15233      {"Fixed parameters", "wlan_mgt.fixed.all",
15234       FT_NONE, BASE_NONE, NULL, 0,
15235       NULL, HFILL }},
15236
15237     {&hf_ieee80211_tagged_parameters,
15238      {"Tagged parameters", "wlan_mgt.tagged.all",
15239       FT_NONE, BASE_NONE, NULL, 0,
15240       NULL, HFILL }},
15241
15242     {&hf_ieee80211_tag_ssid,
15243      {"SSID", "wlan_mgt.ssid",
15244       FT_STRING, BASE_NONE, NULL, 0,
15245       "Indicates the identity of an ESS or IBSS", HFILL }},
15246
15247     {&hf_ieee80211_tag_supp_rates,
15248      {"Supported Rates", "wlan_mgt.supported_rates",
15249       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
15250       "In Mbit/sec, (B) for Basic Rates", HFILL }},
15251
15252     {&hf_ieee80211_tag_fh_dwell_time,
15253      {"Dwell Time", "wlan_mgt.fh.dwell_time",
15254       FT_UINT16, BASE_HEX, NULL, 0x0,
15255       "In Time Unit (TU)", HFILL }},
15256
15257     {&hf_ieee80211_tag_fh_hop_set,
15258      {"Hop Set", "wlan_mgt.fh.hop_set",
15259       FT_UINT8, BASE_DEC, NULL, 0x0,
15260       NULL, HFILL }},
15261
15262     {&hf_ieee80211_tag_fh_hop_pattern,
15263      {"Hop Pattern", "wlan_mgt.fh.hop_pattern",
15264       FT_UINT8, BASE_DEC, NULL, 0x0,
15265       NULL, HFILL }},
15266
15267     {&hf_ieee80211_tag_fh_hop_index,
15268      {"Hop Index", "wlan_mgt.fh.hop_index",
15269       FT_UINT8, BASE_DEC, NULL, 0x0,
15270       NULL, HFILL }},
15271
15272     {&hf_ieee80211_ff_block_ack_params,
15273      {"Block Ack Parameters", "wlan_mgt.fixed.baparams",
15274       FT_UINT16, BASE_HEX, NULL, 0,
15275       NULL, HFILL }},
15276
15277     {&hf_ieee80211_ff_block_ack_params_amsdu_permitted,
15278      {"A-MSDUs", "wlan_mgt.fixed.baparams.amsdu",
15279       FT_BOOLEAN, 16, TFS (&ff_block_ack_params_amsdu_permitted_flag), 0x0001,
15280       "A-MSDU Permitted in QoS Data MPDUs", HFILL }},
15281
15282     {&hf_ieee80211_ff_block_ack_params_policy,
15283      {"Block Ack Policy", "wlan_mgt.fixed.baparams.policy",
15284       FT_BOOLEAN, 16, TFS (&ff_block_ack_params_policy_flag), 0x0002,
15285       NULL, HFILL }},
15286
15287     {&hf_ieee80211_ff_block_ack_params_tid,
15288      {"Traffic Identifier", "wlan_mgt.fixed.baparams.tid",
15289       FT_UINT16, BASE_HEX, NULL, 0x003C,
15290       NULL, HFILL }},
15291
15292     {&hf_ieee80211_ff_block_ack_params_buffer_size,
15293      {"Number of Buffers (1 Buffer = 2304 Bytes)", "wlan_mgt.fixed.baparams.buffersize",
15294       FT_UINT16, BASE_DEC, NULL, 0xFFC0,
15295       "Number of Buffers", HFILL }},
15296
15297     {&hf_ieee80211_ff_block_ack_timeout,
15298      {"Block Ack Timeout", "wlan_mgt.fixed.batimeout",
15299       FT_UINT16, BASE_HEX, NULL, 0,
15300       NULL, HFILL }},
15301
15302     {&hf_ieee80211_ff_block_ack_ssc,
15303      {"Block Ack Starting Sequence Control (SSC)", "wlan_mgt.fixed.ssc",
15304       FT_UINT16, BASE_HEX, 0, 0,
15305       NULL, HFILL }},
15306
15307     {&hf_ieee80211_ff_block_ack_ssc_fragment,
15308      {"Fragment", "wlan_mgt.fixed.fragment",
15309       FT_UINT16, BASE_DEC, 0, 0x000f,
15310       NULL, HFILL }},
15311
15312     {&hf_ieee80211_ff_block_ack_ssc_sequence,
15313      {"Starting Sequence Number", "wlan_mgt.fixed.sequence",
15314       FT_UINT16, BASE_DEC, 0, 0xfff0,
15315       NULL, HFILL }},
15316
15317     {&hf_ieee80211_ff_delba_param,
15318      {"Delete Block Ack (DELBA) Parameter Set", "wlan_mgt.fixed.delba.param",
15319       FT_UINT16, BASE_HEX, 0, 0,
15320       NULL, HFILL }},
15321
15322     {&hf_ieee80211_ff_delba_param_reserved,
15323      {"Reserved", "wlan_mgt.fixed.delba.param.reserved",
15324       FT_UINT16, BASE_HEX, 0, 0x07ff,
15325       NULL, HFILL }},
15326
15327     {&hf_ieee80211_ff_delba_param_init,
15328      {"Initiator", "wlan_mgt.fixed.delba.param.initiator",
15329       FT_BOOLEAN, 16, 0, 0x0800,
15330       NULL, HFILL }},
15331
15332     {&hf_ieee80211_ff_delba_param_tid,
15333      {"TID", "wlan_mgt.fixed.delba.param.tid",
15334       FT_UINT16, BASE_HEX, 0, 0xf000,
15335       "Traffic Identifier (TID)", HFILL }},
15336
15337     {&hf_ieee80211_ff_max_reg_pwr,
15338      {"Maximum Regulation Power", "wlan_mgt.fixed.maxregpwr",
15339       FT_UINT16, BASE_HEX, 0, 0,
15340       NULL, HFILL }},
15341
15342     {&hf_ieee80211_ff_measurement_pilot_int,
15343      {"Measurement Pilot Interval", "wlan_mgt.fixed.msmtpilotint",
15344       FT_UINT16, BASE_HEX, 0, 0,
15345       "Measurement Pilot Interval Fixed Field", HFILL }},
15346
15347     {&hf_ieee80211_ff_country_str,
15348      {"Country String", "wlan_mgt.fixed.country",
15349       FT_STRING, BASE_NONE, 0, 0,
15350       NULL, HFILL }},
15351
15352     {&hf_ieee80211_ff_max_tx_pwr,
15353      {"Maximum Transmit Power", "wlan_mgt.fixed.maxtxpwr",
15354       FT_UINT8, BASE_HEX, 0, 0,
15355       NULL, HFILL }},
15356
15357     {&hf_ieee80211_ff_tx_pwr_used,
15358      {"Transmit Power Used", "wlan_mgt.fixed.txpwr",
15359       FT_UINT8, BASE_HEX, 0, 0,
15360       NULL, HFILL }},
15361
15362     {&hf_ieee80211_ff_transceiver_noise_floor,
15363      {"Transceiver Noise Floor", "wlan_mgt.fixed.tnoisefloor",
15364       FT_UINT8, BASE_HEX, 0, 0,
15365       NULL, HFILL }},
15366
15367     {&hf_ieee80211_ff_channel_width,
15368      {"Supported Channel Width", "wlan_mgt.fixed.chanwidth",
15369       FT_UINT8, BASE_HEX, VALS(ff_channel_width_vals), 0,
15370       NULL, HFILL }},
15371
15372     {&hf_ieee80211_ff_qos_info_ap,
15373      {"QoS Information (AP)", "wlan_mgt.fixed.qosinfo.ap",
15374       FT_UINT8, BASE_HEX, NULL, 0,
15375       NULL, HFILL }},
15376
15377     {&hf_ieee80211_ff_qos_info_ap_edca_param_set_counter,
15378      {"EDCA Parameter Set Update Count", "wlan_mgt.fixed.qosinfo.ap.edcaupdate",
15379       FT_UINT8, BASE_HEX, NULL, 0x0F,
15380       "Enhanced Distributed Channel Access (EDCA) Parameter Set Update Count", HFILL }},
15381
15382     {&hf_ieee80211_ff_qos_info_ap_q_ack,
15383      {"Q-Ack", "wlan_mgt.fixed.qosinfo.ap.qack",
15384       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_q_ack_flag), 0x10,
15385       "QoS Ack", HFILL }},
15386
15387     {&hf_ieee80211_ff_qos_info_ap_queue_req,
15388      {"Queue Request", "wlan_mgt.fixed.qosinfo.ap",
15389       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_queue_req_flag), 0x20,
15390       NULL, HFILL }},
15391
15392     {&hf_ieee80211_ff_qos_info_ap_txop_request,
15393      {"TXOP Request", "wlan_mgt.fixed.qosinfo.ap.txopreq",
15394       FT_BOOLEAN, 8, TFS (&ff_qos_info_ap_txop_request_flag), 0x40,
15395       "Transmit Opportunity (TXOP) Request", HFILL }},
15396
15397     {&hf_ieee80211_ff_qos_info_ap_reserved,
15398      {"Reserved", "wlan_mgt.fixed.qosinfo.ap.reserved",
15399       FT_BOOLEAN, 8, NULL, 0x80,
15400       NULL, HFILL }},
15401
15402     {&hf_ieee80211_ff_qos_info_sta,
15403      {"QoS Information (STA)", "wlan_mgt.fixed.qosinfo.sta",
15404       FT_UINT8, BASE_HEX, NULL, 0,
15405       NULL, HFILL }},
15406
15407     {&hf_ieee80211_ff_qos_info_sta_ac_vo,
15408      {"AC_VO", "wlan_mgt.fixed.qosinfo.sta.ac.vo",
15409       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x01,
15410       NULL, HFILL }},
15411
15412     {&hf_ieee80211_ff_qos_info_sta_ac_vi,
15413      {"AC_VI", "wlan_mgt.fixed.qosinfo.sta.ac.vi",
15414       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x02,
15415       NULL, HFILL }},
15416
15417     {&hf_ieee80211_ff_qos_info_sta_ac_bk,
15418      {"AC_BK", "wlan_mgt.fixed.qosinfo.sta.ac.bk",
15419       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x04,
15420       NULL, HFILL }},
15421
15422     {&hf_ieee80211_ff_qos_info_sta_ac_be,
15423      {"AC_BE", "wlan_mgt.fixed.qosinfo.sta.ac.be",
15424       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_ac_flag), 0x08,
15425       NULL, HFILL }},
15426
15427     {&hf_ieee80211_ff_qos_info_sta_q_ack,
15428      {"Q-Ack", "wlan_mgt.fixed.qosinfo.sta.qack",
15429       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_q_ack_flag), 0x10,
15430       "QoS Ack", HFILL }},
15431
15432     {&hf_ieee80211_ff_qos_info_sta_max_sp_len,
15433      {"Service Period (SP) Length", "wlan_mgt.fixed.qosinfo.sta.splen",
15434       FT_UINT8, BASE_HEX, VALS(ff_qos_info_sta_max_sp_len_flags) , 0x60,
15435       NULL, HFILL }},
15436
15437     {&hf_ieee80211_ff_qos_info_sta_more_data_ack,
15438      {"More Data Ack", "wlan_mgt.fixed.qosinfo.sta.moredataack",
15439       FT_BOOLEAN, 8, TFS (&ff_qos_info_sta_more_data_ack_flag), 0x80,
15440       NULL, HFILL }},
15441
15442     {&hf_ieee80211_ff_sm_pwr_save,
15443      {"Spatial Multiplexing (SM) Power Control", "wlan_mgt.fixed.sm.powercontrol",
15444       FT_UINT8, BASE_HEX, NULL, 0,
15445       NULL, HFILL }},
15446
15447     {&hf_ieee80211_ff_sm_pwr_save_enabled,
15448      {"SM Power Save", "wlan_mgt.fixed.sm.powercontrol.enabled",
15449       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x01,
15450       "Spatial Multiplexing (SM) Power Save", HFILL }},
15451
15452     {&hf_ieee80211_ff_sm_pwr_save_sm_mode,
15453      {"SM Mode", "wlan_mgt.fixed.sm.powercontrol.mode",
15454       FT_BOOLEAN, 8, TFS (&ff_sm_pwr_save_sm_mode_flag), 0x02,
15455       "Spatial Multiplexing (SM) Mode", HFILL }},
15456
15457     {&hf_ieee80211_ff_sm_pwr_save_reserved,
15458      {"Reserved", "wlan_mgt.fixed.sm.powercontrol.reserved",
15459       FT_UINT8, BASE_HEX, NULL, 0xFC,
15460       NULL, HFILL }},
15461
15462     {&hf_ieee80211_ff_pco_phase_cntrl,
15463      {"Phased Coexistence Operation (PCO) Phase Control", "wlan_mgt.fixed.pco.phasecntrl",
15464       FT_BOOLEAN, BASE_NONE, TFS (&ff_pco_phase_cntrl_flag), 0x0,
15465       NULL, HFILL }},
15466
15467     {&hf_ieee80211_ff_psmp_param_set,
15468      {"Power Save Multi-Poll (PSMP) Parameter Set", "wlan_mgt.fixed.psmp.paramset",
15469       FT_UINT16, BASE_HEX, 0, 0,
15470       NULL, HFILL }},
15471
15472     {&hf_ieee80211_ff_psmp_param_set_n_sta,
15473      {"Number of STA Info Fields Present", "wlan_mgt.fixed.psmp.paramset.nsta",
15474       FT_UINT16, BASE_HEX, 0, 0x000F,
15475       NULL, HFILL }},
15476
15477     {&hf_ieee80211_ff_psmp_param_set_more_psmp,
15478      {"More PSMP", "wlan_mgt.fixed.psmp.paramset.more",
15479       FT_BOOLEAN, 16, TFS(&ff_psmp_param_set_more_psmp_flag), 0x0010,
15480       "More Power Save Multi-Poll (PSMP)", HFILL }},
15481
15482     {&hf_ieee80211_ff_psmp_param_set_psmp_sequence_duration,
15483      {"PSMP Sequence Duration [us]", "wlan_mgt.fixed.psmp.paramset.seqduration",
15484       FT_UINT16, BASE_DEC, 0, 0xFFE0,
15485       "Power Save Multi-Poll (PSMP) Sequence Duration", HFILL }},
15486
15487     {&hf_ieee80211_ff_mimo_cntrl,
15488      {"MIMO Control", "wlan_mgt.fixed.mimo.control.",
15489       FT_BYTES, BASE_NONE, 0, 0x0,
15490       NULL, HFILL }},
15491
15492     {&hf_ieee80211_ff_mimo_cntrl_nc_index,
15493      {"Nc Index", "wlan_mgt.fixed.mimo.control.ncindex",
15494       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nc_index_flags), 0x0003,
15495       "Number of Columns Less One", HFILL }},
15496
15497     {&hf_ieee80211_ff_mimo_cntrl_nr_index,
15498      {"Nr Index", "wlan_mgt.fixed.mimo.control.nrindex",
15499       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_nr_index_flags), 0x000C,
15500       "Number of Rows Less One", HFILL }},
15501
15502     {&hf_ieee80211_ff_mimo_cntrl_channel_width,
15503      {"Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
15504       FT_BOOLEAN, 16, TFS(&ff_mimo_cntrl_channel_width_flag), 0x0010,
15505       NULL, HFILL }},
15506
15507     {&hf_ieee80211_ff_mimo_cntrl_grouping,
15508      {"Grouping (Ng)", "wlan_mgt.fixed.mimo.control.grouping",
15509       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_grouping_flags), 0x0060,
15510       NULL, HFILL }},
15511
15512     {&hf_ieee80211_ff_mimo_cntrl_coefficient_size,
15513      {"Coefficient Size (Nb)", "wlan_mgt.fixed.mimo.control.cosize",
15514       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_coefficient_size_flags), 0x0180,
15515       NULL, HFILL }},
15516
15517     {&hf_ieee80211_ff_mimo_cntrl_codebook_info,
15518      {"Codebook Information", "wlan_mgt.fixed.mimo.control.codebookinfo",
15519       FT_UINT16, BASE_HEX, VALS(ff_mimo_cntrl_codebook_info_flags), 0x0600,
15520       NULL, HFILL }},
15521
15522     {&hf_ieee80211_ff_mimo_cntrl_remaining_matrix_segment,
15523      {"Remaining Matrix Segment", "wlan_mgt.fixed.mimo.control.matrixseg",
15524       FT_UINT16, BASE_HEX, 0, 0x3800,
15525       NULL, HFILL }},
15526
15527     {&hf_ieee80211_ff_mimo_cntrl_reserved,
15528      {"Reserved", "wlan_mgt.fixed.mimo.control.reserved",
15529       FT_UINT16, BASE_HEX, 0, 0xC000,
15530       NULL, HFILL }},
15531
15532     {&hf_ieee80211_ff_mimo_cntrl_sounding_timestamp,
15533      {"Sounding Timestamp", "wlan_mgt.fixed.mimo.control.soundingtime",
15534       FT_UINT32, BASE_HEX, 0, 0,
15535       NULL, HFILL }},
15536
15537     {&hf_ieee80211_ff_psmp_sta_info,
15538      {"Power Save Multi-Poll (PSMP) Station Information", "wlan_mgt.fixed.psmp.stainfo",
15539       FT_UINT64, BASE_HEX, 0, 0,
15540       NULL, HFILL }},
15541
15542     {&hf_ieee80211_ff_psmp_sta_info_type,
15543      {"Sta Info Type", "wlan_mgt.fixed.psmp.stainfo.type",
15544       FT_UINT32, BASE_HEX, VALS(ff_psmp_sta_info_flags), PSMP_STA_INFO_FLAG_TYPE,
15545       NULL, HFILL }},
15546
15547     {&hf_ieee80211_ff_psmp_sta_info_dtt_start_offset,
15548      {"DTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.dttstart",
15549       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_START,
15550       NULL, HFILL }},
15551
15552     {&hf_ieee80211_ff_psmp_sta_info_dtt_duration,
15553      {"DTT Duration", "wlan_mgt.fixed.psmp.stainfo.dttduration",
15554       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_DTT_DURATION,
15555       NULL, HFILL }},
15556
15557     {&hf_ieee80211_ff_psmp_sta_info_sta_id,
15558      {"Target Station ID", "wlan_mgt.fixed.psmp.stainfo.staid",
15559       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_STA_ID,
15560       NULL, HFILL }},
15561
15562     {&hf_ieee80211_ff_psmp_sta_info_utt_start_offset,
15563      {"UTT Start Offset", "wlan_mgt.fixed.psmp.stainfo.uttstart",
15564       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_START,
15565       NULL, HFILL }},
15566
15567     {&hf_ieee80211_ff_psmp_sta_info_utt_duration,
15568      {"UTT Duration", "wlan_mgt.fixed.psmp.stainfo.uttduration",
15569       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_UTT_DURATION,
15570       NULL, HFILL }},
15571
15572     {&hf_ieee80211_ff_psmp_sta_info_reserved_small,
15573      {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
15574       FT_UINT32, BASE_HEX, 0, PSMP_STA_INFO_FLAG_IA_RESERVED,
15575       NULL, HFILL }},
15576
15577     {&hf_ieee80211_ff_psmp_sta_info_reserved_large,
15578      {"Reserved", "wlan_mgt.fixed.psmp.stainfo.reserved",
15579       FT_UINT64, BASE_HEX, 0, 0,
15580       NULL, HFILL }},
15581
15582     {&hf_ieee80211_ff_psmp_sta_info_psmp_multicast_id,
15583      {"Power Save Multi-Poll (PSMP) Multicast ID", "wlan_mgt.fixed.psmp.stainfo.multicastid",
15584       FT_UINT64, BASE_HEX, 0, 0,
15585       NULL, HFILL }},
15586
15587     {&hf_ieee80211_ff_ant_selection,
15588      {"Antenna Selection", "wlan_mgt.fixed.antsel",
15589       FT_UINT8, BASE_HEX, 0, 0,
15590       NULL, HFILL }},
15591
15592     {&hf_ieee80211_ff_ant_selection_0,
15593      {"Antenna 0", "wlan_mgt.fixed.antsel.ant0",
15594       FT_UINT8, BASE_HEX, 0, 0x01,
15595       NULL, HFILL }},
15596
15597     {&hf_ieee80211_ff_ant_selection_1,
15598      {"Antenna 1", "wlan_mgt.fixed.antsel.ant1",
15599       FT_UINT8, BASE_HEX, 0, 0x02,
15600       NULL, HFILL }},
15601
15602     {&hf_ieee80211_ff_ant_selection_2,
15603      {"Antenna 2", "wlan_mgt.fixed.antsel.ant2",
15604       FT_UINT8, BASE_HEX, 0, 0x04,
15605       NULL, HFILL }},
15606
15607     {&hf_ieee80211_ff_ant_selection_3,
15608      {"Antenna 3", "wlan_mgt.fixed.antsel.ant3",
15609       FT_UINT8, BASE_HEX, 0, 0x08,
15610       NULL, HFILL }},
15611
15612     {&hf_ieee80211_ff_ant_selection_4,
15613      {"Antenna 4", "wlan_mgt.fixed.antsel.ant4",
15614       FT_UINT8, BASE_HEX, 0, 0x10,
15615       NULL, HFILL }},
15616
15617     {&hf_ieee80211_ff_ant_selection_5,
15618      {"Antenna 5", "wlan_mgt.fixed.antsel.ant5",
15619       FT_UINT8, BASE_HEX, 0, 0x20,
15620       NULL, HFILL }},
15621
15622     {&hf_ieee80211_ff_ant_selection_6,
15623      {"Antenna 6", "wlan_mgt.fixed.antsel.ant6",
15624       FT_UINT8, BASE_HEX, 0, 0x40,
15625       NULL, HFILL }},
15626
15627     {&hf_ieee80211_ff_ant_selection_7,
15628      {"Antenna 7", "wlan_mgt.fixed.antsel.ant7",
15629       FT_UINT8, BASE_HEX, 0, 0x80,
15630       NULL, HFILL }},
15631
15632     {&hf_ieee80211_ff_ext_channel_switch_announcement,
15633      {"Extended Channel Switch Announcement", "wlan_mgt.fixed.extchansw",
15634       FT_UINT32, BASE_HEX, 0, 0,
15635       NULL, HFILL }},
15636
15637     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_mode,
15638      {"Channel Switch Mode", "wlan_mgt.fixed.extchansw.switchmode",
15639       FT_UINT32, BASE_HEX, VALS(ieee80211_tag_ext_channel_switch_announcement_switch_mode_flags), 0x000000FF,
15640       NULL, HFILL }},
15641
15642     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_reg_class,
15643      {"New Regulatory Class", "wlan_mgt.fixed.extchansw.new.regclass",
15644       FT_UINT32, BASE_HEX, NULL, 0x0000FF00,
15645       NULL, HFILL }},
15646
15647     {&hf_ieee80211_ff_ext_channel_switch_announcement_new_chan_number,
15648      {"New Channel Number", "wlan_mgt.fixed.extchansw.new.channumber",
15649       FT_UINT32, BASE_HEX, NULL, 0x00FF0000,
15650       NULL, HFILL }},
15651
15652     {&hf_ieee80211_ff_ext_channel_switch_announcement_switch_count,
15653      {"Channel Switch Count", "wlan_mgt.extchanswitch.switchcount",
15654       FT_UINT32, BASE_HEX, NULL, 0xFF000000,
15655       NULL, HFILL }},
15656
15657     {&hf_ieee80211_ff_ht_info,
15658      {"HT Information", "wlan_mgt.fixed.extchansw",
15659       FT_UINT8, BASE_HEX, 0, 0,
15660       "HT Information Fixed Field", HFILL }},
15661
15662     {&hf_ieee80211_ff_ht_info_information_request,
15663      {"Information Request", "wlan_mgt.fixed.mimo.control.chanwidth",
15664       FT_BOOLEAN, 8, TFS(&ff_ht_info_information_request_flag), 0x01,
15665       NULL, HFILL }},
15666
15667     {&hf_ieee80211_ff_ht_info_40_mhz_intolerant,
15668      {"40 MHz Intolerant", "wlan_mgt.fixed.mimo.control.chanwidth",
15669       FT_BOOLEAN, 8, TFS(&ff_ht_info_40_mhz_intolerant_flag), 0x02,
15670       NULL, HFILL }},
15671
15672     {&hf_ieee80211_ff_ht_info_sta_chan_width,
15673      {"Station Channel Width", "wlan_mgt.fixed.mimo.control.chanwidth",
15674       FT_BOOLEAN, 8, TFS(&ff_ht_info_sta_chan_width_flag), 0x04,
15675       NULL, HFILL }},
15676
15677     {&hf_ieee80211_ff_ht_info_reserved,
15678      {"Reserved", "wlan_mgt.fixed.extchansw",
15679       FT_UINT8, BASE_HEX, 0, 0xF8,
15680       "Reserved Field", HFILL }},
15681
15682     {&hf_ieee80211_ff_ht_action,
15683      {"HT Action", "wlan_mgt.fixed.htact",
15684       FT_UINT8, BASE_HEX, VALS(ff_ht_action_flags), 0,
15685       "HT Action Code", HFILL }},
15686
15687     {&hf_ieee80211_ff_mimo_csi_snr,
15688      {"Signal to Noise Ratio (SNR)", "wlan_mgt.mimo.csimatrices.snr",
15689       FT_UINT8, BASE_HEX, NULL, 0,
15690       NULL, HFILL }},
15691
15692     {&hf_ieee80211_ff_public_action,
15693      {"Public Action", "wlan_mgt.fixed.publicact",
15694       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ff_pa_action_codes_ext, 0,
15695       "Public Action Code", HFILL }},
15696
15697     {&hf_ieee80211_ff_capture,
15698      {"Capabilities Information", "wlan_mgt.fixed.capabilities",
15699       FT_UINT16, BASE_HEX, NULL, 0,
15700       "Capability information", HFILL }},
15701
15702     {&hf_ieee80211_ff_cf_ess,
15703      {"ESS capabilities", "wlan_mgt.fixed.capabilities.ess",
15704       FT_BOOLEAN, 16, TFS (&cf_ess_flags), 0x0001,
15705       NULL, HFILL }},
15706
15707     {&hf_ieee80211_ff_cf_ibss,
15708      {"IBSS status", "wlan_mgt.fixed.capabilities.ibss",
15709       FT_BOOLEAN, 16, TFS(&cf_ibss_flags), 0x0002,
15710       "IBSS participation", HFILL }},
15711
15712     {&hf_ieee80211_ff_cf_sta_poll,
15713      {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.sta",
15714       FT_UINT16, BASE_HEX, VALS(sta_cf_pollable), 0x020C,
15715       "CF-Poll capabilities for a STA", HFILL }},
15716
15717     {&hf_ieee80211_ff_cf_ap_poll,
15718      {"CFP participation capabilities", "wlan_mgt.fixed.capabilities.cfpoll.ap",
15719       FT_UINT16, BASE_HEX, VALS(ap_cf_pollable), 0x020C,
15720       "CF-Poll capabilities for an AP", HFILL }},
15721
15722     {&hf_ieee80211_ff_cf_privacy,
15723      {"Privacy", "wlan_mgt.fixed.capabilities.privacy",
15724       FT_BOOLEAN, 16, TFS(&cf_privacy_flags), 0x0010,
15725       "WEP support", HFILL }},
15726
15727     {&hf_ieee80211_ff_cf_preamble,
15728      {"Short Preamble", "wlan_mgt.fixed.capabilities.preamble",
15729       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0020,
15730       NULL, HFILL }},
15731
15732     {&hf_ieee80211_ff_cf_pbcc,
15733      {"PBCC", "wlan_mgt.fixed.capabilities.pbcc",
15734       FT_BOOLEAN, 16, TFS(&tfs_allowed_not_allowed), 0x0040,
15735       "PBCC Modulation", HFILL }},
15736
15737     {&hf_ieee80211_ff_cf_agility,
15738      {"Channel Agility", "wlan_mgt.fixed.capabilities.agility",
15739       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0080,
15740       NULL, HFILL }},
15741
15742     {&hf_ieee80211_ff_cf_spec_man,
15743      {"Spectrum Management", "wlan_mgt.fixed.capabilities.spec_man",
15744       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0100,
15745       NULL, HFILL }},
15746
15747     {&hf_ieee80211_ff_short_slot_time,
15748      {"Short Slot Time", "wlan_mgt.fixed.capabilities.short_slot_time",
15749       FT_BOOLEAN, 16, TFS(&tfs_inuse_not_inuse), 0x0400,
15750       NULL, HFILL }},
15751
15752     {&hf_ieee80211_ff_cf_apsd,
15753      {"Automatic Power Save Delivery", "wlan_mgt.fixed.capabilities.apsd",
15754       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x0800,
15755       NULL, HFILL }},
15756
15757     {&hf_ieee80211_ff_radio_measurement,
15758      {"Radio Measurement", "wlan_mgt.fixed.capabilities.radio_measurement",
15759       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x1000,
15760       NULL, HFILL }},
15761
15762     {&hf_ieee80211_ff_dsss_ofdm,
15763      {"DSSS-OFDM", "wlan_mgt.fixed.capabilities.dsss_ofdm",
15764       FT_BOOLEAN, 16,  TFS(&tfs_allowed_not_allowed), 0x2000,
15765       "DSSS-OFDM Modulation", HFILL }},
15766
15767     {&hf_ieee80211_ff_cf_del_blk_ack,
15768      {"Delayed Block Ack", "wlan_mgt.fixed.capabilities.del_blk_ack",
15769       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x4000,
15770       NULL, HFILL }},
15771
15772     {&hf_ieee80211_ff_cf_imm_blk_ack,
15773      {"Immediate Block Ack", "wlan_mgt.fixed.capabilities.imm_blk_ack",
15774       FT_BOOLEAN, 16, TFS(&tfs_implemented_not_implemented), 0x8000,
15775       NULL, HFILL }},
15776
15777     {&hf_ieee80211_ff_auth_seq,
15778      {"Authentication SEQ", "wlan_mgt.fixed.auth_seq",
15779       FT_UINT16, BASE_HEX, NULL, 0,
15780       "Authentication Sequence Number", HFILL }},
15781
15782     {&hf_ieee80211_ff_assoc_id,
15783      {"Association ID", "wlan_mgt.fixed.aid",
15784       FT_UINT16, BASE_HEX, NULL, 0x3FFF,
15785       NULL, HFILL }},
15786
15787     {&hf_ieee80211_ff_listen_ival,
15788      {"Listen Interval", "wlan_mgt.fixed.listen_ival",
15789       FT_UINT16, BASE_HEX, NULL, 0,
15790       NULL, HFILL }},
15791
15792     {&hf_ieee80211_ff_current_ap,
15793      {"Current AP", "wlan_mgt.fixed.current_ap",
15794       FT_ETHER, BASE_NONE, NULL, 0,
15795       "MAC address of current AP", HFILL }},
15796
15797     {&hf_ieee80211_ff_reason,
15798      {"Reason code", "wlan_mgt.fixed.reason_code",
15799       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_reason_code_ext, 0,
15800       "Reason for unsolicited notification", HFILL }},
15801
15802     {&hf_ieee80211_ff_status_code,
15803      {"Status code", "wlan_mgt.fixed.status_code",
15804       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
15805       "Status of requested event", HFILL }},
15806
15807     {&hf_ieee80211_ff_category_code,
15808      {"Category code", "wlan_mgt.fixed.category_code",
15809       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &category_codes_ext, 0,
15810       "Management action category", HFILL }},
15811
15812     {&hf_ieee80211_ff_action_code,
15813      {"Action code", "wlan_mgt.fixed.action_code",
15814       FT_UINT16, BASE_DEC, VALS(action_codes), 0,
15815       "Management action code", HFILL }},
15816
15817     {&hf_ieee80211_ff_dialog_token,
15818      {"Dialog token", "wlan_mgt.fixed.dialog_token",
15819       FT_UINT8, BASE_HEX, NULL, 0,
15820       "Management action dialog token", HFILL }},
15821
15822     {&hf_ieee80211_ff_marvell_action_type,
15823      {"Marvell Action type", "wlan_mgt.fixed.mrvl_action_type",
15824       FT_UINT8, BASE_DEC, VALS(vendor_action_types_mrvl), 0,
15825       "Vendor Specific Action Type (Marvell)", HFILL }},
15826
15827     {&hf_ieee80211_ff_marvell_mesh_mgt_action_code,
15828      {"Mesh action(Marvell)", "wlan_mgt.fixed.mrvl_mesh_action",
15829       FT_UINT8, BASE_HEX, VALS(mesh_mgt_action_codes_mrvl), 0,
15830       "Mesh action code(Marvell)", HFILL }},
15831
15832     {&hf_ieee80211_ff_marvell_mesh_mgt_length,
15833      {"Message Length", "wlan_mgt.fixed.length",
15834       FT_UINT8, BASE_DEC, NULL, 0,
15835       NULL, HFILL }},
15836
15837     {&hf_ieee80211_ff_marvell_mesh_mgt_mode,
15838      {"Message Mode", "wlan_mgt.fixed.mode",
15839       FT_UINT8, BASE_HEX, NULL, 0,
15840       NULL, HFILL }},
15841
15842     {&hf_ieee80211_ff_marvell_mesh_mgt_ttl,
15843      {"Message TTL", "wlan_mgt.fixed.ttl",
15844       FT_UINT8, BASE_DEC, NULL, 0,
15845       NULL, HFILL }},
15846
15847     {&hf_ieee80211_ff_marvell_mesh_mgt_dstcount,
15848      {"Destination Count", "wlan_mgt.fixed.dstcount",
15849       FT_UINT8, BASE_DEC, NULL, 0,
15850       NULL, HFILL }},
15851
15852     {&hf_ieee80211_ff_marvell_mesh_mgt_hopcount,
15853      {"Hop Count", "wlan_mgt.fixed.hopcount",
15854       FT_UINT8, BASE_DEC, NULL, 0,
15855       NULL, HFILL }},
15856
15857     {&hf_ieee80211_ff_marvell_mesh_mgt_rreqid,
15858      {"RREQ ID", "wlan_mgt.fixed.rreqid",
15859       FT_UINT32, BASE_DEC, NULL, 0,
15860       NULL, HFILL }},
15861
15862     {&hf_ieee80211_ff_marvell_mesh_mgt_sa,
15863      {"Source Address", "wlan_mgt.fixed.sa",
15864       FT_ETHER, BASE_NONE, NULL, 0,
15865       "Source MAC address", HFILL }},
15866
15867     {&hf_ieee80211_ff_marvell_mesh_mgt_ssn,
15868      {"SSN", "wlan_mgt.fixed.ssn",
15869       FT_UINT32, BASE_DEC, NULL, 0,
15870       "Source Sequence Number", HFILL }},
15871
15872     {&hf_ieee80211_ff_marvell_mesh_mgt_metric,
15873      {"Metric", "wlan_mgt.fixed.metric",
15874       FT_UINT32, BASE_DEC, NULL, 0,
15875       "Route Metric", HFILL }},
15876
15877     {&hf_ieee80211_ff_marvell_mesh_mgt_flags,
15878      {"RREQ Flags", "wlan_mgt.fixed.hopcount",
15879       FT_UINT8, BASE_HEX, NULL, 0,
15880       NULL, HFILL }},
15881
15882     {&hf_ieee80211_ff_marvell_mesh_mgt_da,
15883      {"Destination Address", "wlan_mgt.fixed.da",
15884       FT_ETHER, BASE_NONE, NULL, 0,
15885       "Destination MAC address", HFILL }},
15886
15887     {&hf_ieee80211_ff_marvell_mesh_mgt_dsn,
15888      {"DSN", "wlan_mgt.fixed.dsn",
15889       FT_UINT32, BASE_DEC, NULL, 0,
15890       "Destination Sequence Number", HFILL }},
15891
15892     {&hf_ieee80211_ff_marvell_mesh_mgt_lifetime,
15893      {"Lifetime", "wlan_mgt.fixed.lifetime",
15894       FT_UINT32, BASE_DEC, NULL, 0,
15895       "Route Lifetime", HFILL }},
15896
15897     {&hf_ieee80211_ff_wme_action_code,
15898      {"Action code", "wlan_mgt.fixed.action_code",
15899       FT_UINT16, BASE_HEX, VALS(wme_action_codes), 0,
15900       "Management notification action code", HFILL }},
15901
15902     {&hf_ieee80211_ff_wme_status_code,
15903      {"Status code", "wlan_mgt.fixed.status_code",
15904       FT_UINT16, BASE_HEX, VALS(wme_status_codes), 0,
15905       "Management notification setup response status code", HFILL }},
15906
15907     {&hf_ieee80211_ff_mesh_action,
15908      {"Mesh Action code", "wlan_mgt.fixed.mesh_action",
15909       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &mesh_action_ext, 0,
15910       NULL, HFILL }},
15911
15912     {&hf_ieee80211_ff_multihop_action,
15913      {"Multihop Action code", "wlan_mgt.fixed.multihop_action",
15914       FT_UINT8, BASE_HEX, VALS(multihop_action), 0,
15915       NULL, HFILL }},
15916
15917     {&hf_ieee80211_ff_mesh_flags,
15918      {"Mesh Flags", "wlan_mgt.fixed.mesh_flags",
15919       FT_UINT8, BASE_HEX, NULL, 0,
15920       NULL, HFILL }},
15921
15922     {&hf_ieee80211_ff_mesh_ttl,
15923      {"Mesh TTL", "wlan_mgt.fixed.mesh_ttl",
15924       FT_UINT8, BASE_HEX, NULL, 0,
15925       NULL, HFILL }},
15926
15927     {&hf_ieee80211_ff_mesh_sequence,
15928      {"Sequence Number", "wlan_mgt.fixed.mesh_sequence",
15929       FT_UINT32, BASE_HEX, NULL, 0,
15930       NULL, HFILL }},
15931
15932     {&hf_ieee80211_ff_mesh_addr4,
15933      {"Mesh Extended Address 4", "wlan_mgt.fixed.mesh_addr4",
15934       FT_ETHER, BASE_NONE, NULL, 0,
15935       NULL, HFILL }},
15936
15937     {&hf_ieee80211_ff_mesh_addr5,
15938      {"Mesh Extended Address 5", "wlan_mgt.fixed.mesh_addr5",
15939       FT_ETHER, BASE_NONE, NULL, 0,
15940       NULL, HFILL }},
15941
15942     {&hf_ieee80211_ff_mesh_addr6,
15943      {"Mesh Extended Address 6", "wlan_mgt.fixed.mesh_addr6",
15944       FT_ETHER, BASE_NONE, NULL, 0,
15945       NULL, HFILL }},
15946
15947     {&hf_ieee80211_ff_selfprot_action,
15948      {"Self-protected Action code", "wlan_mgt.fixed.selfprot_action",
15949       FT_UINT8, BASE_HEX, VALS(selfprot_action), 0,
15950       NULL, HFILL }},
15951
15952     {&hf_ieee80211_mesh_peering_proto,
15953      {"Mesh Peering Protocol ID", "wlan.peering.proto",
15954       FT_UINT16, BASE_HEX, VALS(mesh_peering_proto_ids), 0,
15955       NULL, HFILL }},
15956
15957     {&hf_ieee80211_mesh_peering_local_link_id,
15958      {"Local Link ID", "wlan.peering.local_id",
15959       FT_UINT16, BASE_HEX, NULL, 0,
15960       "Mesh Peering Management Local Link ID", HFILL }},
15961
15962     {&hf_ieee80211_mesh_peering_peer_link_id,
15963      {"Peer Link ID", "wlan.peering.peer_id",
15964       FT_UINT16, BASE_HEX, NULL, 0,
15965       "Mesh Peering Management Peer Link ID", HFILL }},
15966
15967     {&hf_ieee80211_ff_hwmp_flags,
15968      {"HWMP Flags", "wlan.hwmp.flags",
15969       FT_UINT8, BASE_HEX, NULL, 0,
15970       NULL, HFILL }},
15971
15972     {&hf_ieee80211_ff_hwmp_hopcount,
15973      {"HWMP Hop Count", "wlan.hwmp.hopcount",
15974       FT_UINT8, BASE_DEC, NULL, 0,
15975       NULL, HFILL }},
15976
15977     {&hf_ieee80211_ff_hwmp_ttl,
15978      {"HWMP TTL", "wlan.hwmp.ttl",
15979       FT_UINT8, BASE_DEC, NULL, 0,
15980       NULL, HFILL }},
15981
15982     {&hf_ieee80211_ff_hwmp_pdid,
15983      {"HWMP Path Discovery ID", "wlan.hwmp.pdid",
15984       FT_UINT32, BASE_DEC, NULL, 0,
15985       NULL, HFILL }},
15986
15987     {&hf_ieee80211_ff_hwmp_orig_sta,
15988      {"Originator STA Address", "wlan.hwmp.orig_sta",
15989       FT_ETHER, BASE_NONE, NULL, 0,
15990       NULL, HFILL }},
15991
15992     {&hf_ieee80211_ff_hwmp_orig_sn,
15993      {"HWMP Originator Sequence Number", "wlan.hwmp.orig_sn",
15994       FT_UINT32, BASE_DEC, NULL, 0,
15995       NULL, HFILL}},
15996
15997     {&hf_ieee80211_ff_hwmp_orig_ext,
15998      {"Originator External Address", "wlan.hwmp.orig_ext",
15999       FT_ETHER, BASE_NONE, NULL, 0,
16000       NULL, HFILL }},
16001
16002     {&hf_ieee80211_ff_hwmp_lifetime,
16003      {"HWMP Lifetime", "wlan.hwmp.lifetime",
16004       FT_UINT32, BASE_DEC, NULL, 0,
16005       NULL, HFILL }},
16006
16007     {&hf_ieee80211_ff_hwmp_metric,
16008      {"HWMP Metric", "wlan.hwmp.metric",
16009       FT_UINT32, BASE_DEC, NULL, 0,
16010       NULL, HFILL }},
16011
16012     {&hf_ieee80211_ff_hwmp_targ_count,
16013      {"HWMP Target Count", "wlan.hwmp.targ_count",
16014       FT_UINT8, BASE_DEC, NULL, 0,
16015       NULL, HFILL }},
16016
16017     {&hf_ieee80211_ff_hwmp_targ_flags,
16018      {"HWMP Per-Target Flags", "wlan.hwmp.targ_flags",
16019       FT_UINT8, BASE_HEX, NULL, 0,
16020       NULL, HFILL }},
16021
16022     {&hf_ieee80211_ff_hwmp_targ_to_flags,
16023      {"TO Flag", "wlan.hwmp.to_flag",
16024       FT_BOOLEAN, 8, TFS (&hwmp_targ_to_flags), 0x01,
16025       "Target Only Flag", HFILL }},
16026
16027     {&hf_ieee80211_ff_hwmp_targ_usn_flags,
16028      {"USN Flag", "wlan.hwmp.usn_flag",
16029       FT_BOOLEAN, 8, TFS (&hwmp_targ_usn_flags), 0x04,
16030       "Unknown Target HWMP Sequence Number Flag", HFILL }},
16031
16032     {&hf_ieee80211_ff_hwmp_targ_sta,
16033      {"Target STA Address", "wlan.hwmp.targ_sta",
16034       FT_ETHER, BASE_NONE, NULL, 0,
16035       NULL, HFILL }},
16036
16037     {&hf_ieee80211_ff_hwmp_targ_ext,
16038      {"Target External Address", "wlan.hwmp.targ_ext",
16039       FT_ETHER, BASE_NONE, NULL, 0,
16040       NULL, HFILL }},
16041
16042     {&hf_ieee80211_ff_hwmp_targ_sn,
16043      {"Target HWMP Sequence Number", "wlan.hwmp.targ_sn",
16044       FT_UINT32, BASE_DEC, NULL, 0,
16045       NULL, HFILL }},
16046
16047     {&hf_ieee80211_mesh_config_path_sel_protocol,
16048      {"Path Selection Protocol", "wlan.mesh.config.ps_protocol",
16049       FT_UINT8, BASE_HEX, NULL, 0,
16050       "Mesh Configuration Path Selection Protocol", HFILL }},
16051
16052     {&hf_ieee80211_mesh_config_path_sel_metric,
16053      {"Path Selection Metric", "wlan.mesh.config.ps_metric",
16054       FT_UINT8, BASE_HEX, NULL, 0,
16055       "Mesh Configuration Path Selection Metric", HFILL }},
16056
16057     {&hf_ieee80211_mesh_config_congestion_control,
16058      {"Congestion Control", "wlan.mesh.config.cong_ctl",
16059       FT_UINT8, BASE_HEX, NULL, 0,
16060       "Mesh Configuration Congestion Control", HFILL }},
16061
16062     {&hf_ieee80211_mesh_config_sync_method,
16063      {"Synchronization Method", "wlan.mesh.config.sync_method",
16064       FT_UINT8, BASE_HEX, NULL, 0,
16065       "Mesh Configuration Synchronization Method", HFILL }},
16066
16067     {&hf_ieee80211_mesh_config_auth_protocol,
16068      {"Authentication Protocol", "wlan.mesh.config.auth_protocol",
16069       FT_UINT8, BASE_HEX, NULL, 0,
16070       "Mesh Configuration Authentication Protocol", HFILL }},
16071
16072     {&hf_ieee80211_mesh_config_formation_info,
16073      {"Formation Info", "wlan.mesh.config.formation_info",
16074       FT_UINT8, BASE_HEX, NULL, 0,
16075       "Mesh Configuration Formation Info", HFILL }},
16076
16077     {&hf_ieee80211_mesh_config_capability,
16078      {"Capability", "wlan.mesh.config.cap",
16079       FT_UINT8, BASE_HEX, NULL, 0,
16080       "Mesh Configuration Capability", HFILL }},
16081
16082     {&hf_ieee80211_mesh_id,
16083      {"Mesh ID", "wlan.mesh.id",
16084       FT_STRING, BASE_NONE, NULL, 0,
16085       NULL, HFILL }},
16086
16087     {&hf_ieee80211_rann_flags,
16088      {"RANN Flags", "wlan.rann.flags",
16089       FT_UINT8, BASE_HEX, NULL, 0,
16090       "Root Announcement Flags", HFILL }},
16091
16092     {&hf_ieee80211_rann_root_sta,
16093      {"Root STA Address", "wlan.rann.root_sta", FT_ETHER, BASE_NONE, NULL, 0,
16094       "Root Mesh STA Address", HFILL }},
16095
16096     {&hf_ieee80211_rann_sn,
16097      {"Root STA Sequence Number", "wlan.rann.rann_sn",
16098       FT_UINT32, BASE_DEC, NULL, 0,
16099       "Root Mesh STA Sequence Number", HFILL }},
16100
16101     {&hf_ieee80211_rann_interval,
16102      {"RANN Interval", "wlan.rann.interval",
16103       FT_UINT32, BASE_DEC, NULL, 0,
16104       "Root Announcement Interval", HFILL }},
16105
16106     {&hf_ieee80211_ff_qos_action_code,
16107      {"Action code", "wlan_mgt.fixed.action_code",
16108       FT_UINT16, BASE_HEX, VALS(qos_action_codes), 0,
16109       "QoS management action code", HFILL }},
16110
16111     {&hf_ieee80211_ff_ba_action,
16112      {"Action code", "wlan_mgt.fixed.action_code",
16113       FT_UINT8, BASE_HEX, VALS(ba_action_codes), 0,
16114       "Block Ack action code", HFILL }},
16115
16116     {&hf_ieee80211_ff_dls_action_code,
16117      {"Action code", "wlan_mgt.fixed.action_code",
16118       FT_UINT16, BASE_HEX, VALS(dls_action_codes), 0,
16119       "DLS management action code", HFILL }},
16120
16121     {&hf_ieee80211_ff_dst_mac_addr,
16122      {"Destination address", "wlan_mgt.fixed.dst_mac_addr",
16123       FT_ETHER, BASE_NONE, NULL, 0,
16124       "Destination MAC address", HFILL }},
16125
16126     {&hf_ieee80211_ff_src_mac_addr,
16127      {"Source address", "wlan_mgt.fixed.src_mac_addr",
16128       FT_ETHER, BASE_NONE, NULL, 0,
16129       "Source MAC address", HFILL }},
16130
16131     {&hf_ieee80211_ff_ft_action_code,
16132      {"Action code", "wlan_mgt.fixed.action_code",
16133       FT_UINT8, BASE_DEC, VALS(ft_action_codes), 0,
16134       "Management action code", HFILL }},
16135
16136     {&hf_ieee80211_ff_sta_address,
16137      {"STA Address", "wlan_mgt.fixed.sta_address",
16138       FT_ETHER, BASE_NONE, NULL, 0,
16139       NULL, HFILL }},
16140
16141     {&hf_ieee80211_ff_target_ap_address,
16142      {"Target AP Address", "wlan_mgt.fixed.target_ap_address",
16143       FT_ETHER, BASE_NONE, NULL, 0,
16144       "Target AP MAC address", HFILL }},
16145
16146     {&hf_ieee80211_ff_gas_comeback_delay,
16147      {"GAS Comeback Delay", "wlan_mgt.fixed.gas_comeback_delay",
16148       FT_UINT16, BASE_DEC, NULL, 0,
16149       NULL, HFILL }},
16150
16151     {&hf_ieee80211_ff_gas_fragment_id,
16152      {"GAS Query Response Fragment ID", "wlan_mgt.fixed.gas_fragment_id",
16153       FT_UINT8, BASE_DEC, NULL, 0x7f,
16154       NULL, HFILL }},
16155
16156     {&hf_ieee80211_ff_more_gas_fragments,
16157      {"More GAS Fragments", "wlan_mgt.fixed.more_gas_fragments",
16158       FT_UINT8, BASE_DEC, NULL, 0x80,
16159       NULL, HFILL }},
16160
16161     {&hf_ieee80211_ff_query_request_length,
16162      {"Query Request Length", "wlan_mgt.fixed.query_request_length",
16163       FT_UINT16, BASE_DEC, NULL, 0,
16164       NULL, HFILL }},
16165
16166     {&hf_ieee80211_ff_query_request,
16167      {"Query Request", "wlan_mgt.fixed.query_request",
16168       FT_BYTES, BASE_NONE, NULL, 0,
16169       NULL, HFILL }},
16170
16171     {&hf_ieee80211_ff_query_response_length,
16172      {"Query Response Length", "wlan_mgt.fixed.query_response_length",
16173       FT_UINT16, BASE_DEC, NULL, 0,
16174       NULL, HFILL }},
16175
16176     {&hf_ieee80211_ff_query_response,
16177      {"Query Response", "wlan_mgt.fixed.query_response",
16178       FT_BYTES, BASE_NONE, NULL, 0,
16179       NULL, HFILL }},
16180
16181     {&hf_ieee80211_gas_resp_fragments,
16182      {"GAS Query Response fragments", "wlan_mgt.fixed.fragments",
16183       FT_NONE, BASE_NONE, NULL, 0x00,
16184       NULL, HFILL } },
16185
16186     {&hf_ieee80211_gas_resp_fragment,
16187      {"GAS Query Response fragment", "wlan_mgt.fixed.fragment",
16188       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
16189       NULL, HFILL } },
16190
16191     {&hf_ieee80211_gas_resp_fragment_overlap,
16192      {"GAS Query Response fragment overlap", "wlan_mgt.fixed.fragment.overlap",
16193       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
16194       NULL, HFILL } },
16195
16196     {&hf_ieee80211_gas_resp_fragment_overlap_conflict,
16197      {"GAS Query Response fragment overlapping with conflicting data", "wlan_mgt.fixed.fragment.overlap.conflicts",
16198       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
16199       NULL, HFILL } },
16200
16201     {&hf_ieee80211_gas_resp_fragment_multiple_tails,
16202      {"GAS Query Response has multiple tail fragments",  "wlan_mgt.fixed.fragment.multiple_tails",
16203       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
16204       NULL, HFILL } },
16205
16206     {&hf_ieee80211_gas_resp_fragment_too_long_fragment,
16207      {"GAS Query Response fragment too long", "wlan_mgt.fixed.fragment.too_long_fragment",
16208       FT_BOOLEAN, BASE_NONE, NULL, 0x00,
16209       NULL, HFILL } },
16210
16211     {&hf_ieee80211_gas_resp_fragment_error,
16212      {"GAS Query Response reassembly error", "wlan_mgt.fixed.fragment.error",
16213       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
16214       NULL, HFILL } },
16215
16216     {&hf_ieee80211_gas_resp_fragment_count,
16217      {"GAS Query Response fragment count", "wlan_mgt.fixed.fragment.count",
16218       FT_UINT32, BASE_DEC, NULL, 0x00,
16219       NULL, HFILL } },
16220
16221     {&hf_ieee80211_gas_resp_reassembled_in,
16222      {"Reassembled in", "wlan_mgt.fixed.reassembled.in",
16223       FT_FRAMENUM, BASE_NONE, NULL, 0x00,
16224       NULL, HFILL } },
16225
16226     {&hf_ieee80211_gas_resp_reassembled_length,
16227      {"Reassembled length", "wlan_mgt.fixed.reassembled.length",
16228       FT_UINT32, BASE_DEC, NULL, 0x00,
16229       NULL, HFILL } },
16230
16231     {&hf_ieee80211_ff_anqp_info_id,
16232      {"Info ID", "wlan_mgt.fixed.anqp.info_id",
16233       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
16234       "Access Network Query Protocol Info ID", HFILL }},
16235
16236     {&hf_ieee80211_ff_anqp_info_length,
16237      {"Length", "wlan_mgt.fixed.anqp.info_length",
16238       FT_UINT16, BASE_DEC, NULL, 0,
16239       "Access Network Query Protocol Length", HFILL }},
16240
16241     {&hf_ieee80211_ff_anqp_info,
16242      {"Information", "wlan_mgt.fixed.anqp.info",
16243       FT_BYTES, BASE_NONE, NULL, 0,
16244       "Access Network Query Protocol Information", HFILL }},
16245
16246     {&hf_ieee80211_ff_anqp_query_id,
16247      {"ANQP Query ID", "wlan_mgt.fixed.anqp.query_id",
16248       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
16249       "Access Network Query Protocol Query ID", HFILL }},
16250
16251     {&hf_ieee80211_ff_anqp_capability,
16252      {"ANQP Capability", "wlan_mgt.fixed.anqp.capability",
16253       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &anqp_info_id_vals_ext, 0,
16254       "Access Network Query Protocol Query ID", HFILL }},
16255
16256     {&hf_ieee80211_ff_anqp_capability_vlen,
16257      {"Vendor-specific Capability Length", "wlan_mgt.fixed.anqp.capability_vlen",
16258       FT_UINT16, BASE_DEC, NULL, 0,
16259       NULL, HFILL }},
16260
16261     {&hf_ieee80211_ff_anqp_capability_vendor,
16262      {"Vendor-specific Capability", "wlan_mgt.fixed.anqp.capability_vendor",
16263       FT_BYTES, BASE_NONE, NULL, 0,
16264       NULL, HFILL }},
16265
16266     {&hf_ieee80211_ff_venue_info_group,
16267      {"Venue Group", "wlan_mgt.fixed.venue_info.group",
16268       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &venue_group_vals_ext, 0,
16269       NULL, HFILL }},
16270
16271     {&hf_ieee80211_ff_venue_info_type,
16272      {"Venue Type", "wlan_mgt.fixed.venue_info.type",
16273       FT_UINT8, BASE_DEC, NULL, 0,
16274       NULL, HFILL }},
16275
16276     {&hf_ieee80211_ff_anqp_venue_length,
16277      {"Venue Name Duple Length", "wlan_mgt.fixed.anqp.venue.length",
16278       FT_UINT8, BASE_DEC, NULL, 0,
16279       NULL, HFILL }},
16280
16281     {&hf_ieee80211_ff_anqp_venue_language,
16282      {"Language Code", "wlan_mgt.fixed.anqp.venue.language",
16283       FT_STRING, BASE_NONE, NULL, 0,
16284       "Venue Name Language Code", HFILL }},
16285
16286     {&hf_ieee80211_ff_anqp_venue_name,
16287      {"Venue Name", "wlan_mgt.fixed.anqp.venue.name",
16288       FT_STRING, BASE_NONE, NULL, 0,
16289       NULL, HFILL }},
16290
16291     {&hf_ieee80211_ff_anqp_nw_auth_type_indicator,
16292      {"Network Authentication Type Indicator", "wlan_mgt.fixed.anqp.nw_auth_type.indicator",
16293       FT_UINT8, BASE_DEC, VALS(nw_auth_type_vals), 0,
16294       NULL, HFILL }},
16295
16296     {&hf_ieee80211_ff_anqp_nw_auth_type_url_len,
16297      {"Re-direct URL Length", "wlan_mgt.fixed.anqp.nw_auth_type.url_len",
16298       FT_UINT16, BASE_DEC, NULL, 0,
16299       NULL, HFILL }},
16300
16301     {&hf_ieee80211_ff_anqp_nw_auth_type_url,
16302      {"Re-direct URL", "wlan_mgt.fixed.anqp.nw_auth_type_url",
16303       FT_STRING, BASE_NONE, NULL, 0,
16304       NULL, HFILL }},
16305
16306     {&hf_ieee80211_ff_anqp_roaming_consortium_oi_len,
16307      {"OI Length", "wlan_mgt.fixed.anqp.roaming_consortium.oi_len",
16308       FT_UINT8, BASE_DEC, NULL, 0,
16309       "Roaming Consortium OI Length", HFILL }},
16310
16311     {&hf_ieee80211_ff_anqp_roaming_consortium_oi,
16312      {"OI", "wlan_mgt.fixed.anqp.roaming_consortium.oi",
16313       FT_BYTES, BASE_NONE, NULL, 0,
16314       "Roaming Consortium OI", HFILL }},
16315
16316     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv6,
16317      {"IPv6 Address", "wlan_mgt.fixed.anqp.ip_addr_availability.ipv6",
16318       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv6_vals), 0x03,
16319       "IP Address Type Availability information for IPv6", HFILL }},
16320
16321     {&hf_ieee80211_ff_anqp_ip_addr_avail_ipv4,
16322      {"IPv4 Address", "wlan_mgt.fixed.anqp.ip_addr_availability.ipv4",
16323       FT_UINT8, BASE_DEC, VALS(ip_addr_avail_ipv4_vals), 0xfc,
16324       "IP Address Type Availability information for IPv4", HFILL }},
16325
16326     {&hf_ieee80211_ff_anqp_nai_realm_count,
16327      {"NAI Realm Count", "wlan_mgt.fixed.anqp.nai_realm_list.count",
16328       FT_UINT16, BASE_DEC, NULL, 0,
16329       NULL, HFILL }},
16330
16331     {&hf_ieee80211_ff_anqp_nai_field_len,
16332      {"NAI Realm Data Field Length", "wlan_mgt.fixed.anqp.nai_realm_list.field_len",
16333       FT_UINT16, BASE_DEC, NULL, 0,
16334       NULL, HFILL }},
16335
16336     {&hf_ieee80211_ff_anqp_nai_realm_encoding,
16337      {"NAI Realm Encoding", "wlan_mgt.fixed.naqp_nai_realm_list.encoding",
16338       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals), 0x01,
16339       NULL, HFILL }},
16340
16341     {&hf_ieee80211_ff_anqp_nai_realm_length,
16342      {"NAI Realm Length", "wlan_mgt.fixed.naqp_nai_realm_list.realm_length",
16343       FT_UINT8, BASE_DEC, NULL, 0,
16344       NULL, HFILL }},
16345
16346     {&hf_ieee80211_ff_anqp_nai_realm,
16347      {"NAI Realm", "wlan_mgt.fixed.naqp_nai_realm_list.realm",
16348       FT_STRING, BASE_NONE, NULL, 0,
16349       NULL, HFILL }},
16350
16351     {&hf_ieee80211_ff_anqp_nai_realm_eap_count,
16352      {"EAP Method Count", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method_count",
16353       FT_UINT8, BASE_DEC, NULL, 0,
16354       NULL, HFILL }},
16355
16356     {&hf_ieee80211_ff_anqp_nai_realm_eap_len,
16357      {"EAP Method subfield Length", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method_len",
16358       FT_UINT8, BASE_DEC, NULL, 0,
16359       NULL, HFILL }},
16360
16361     {&hf_ieee80211_ff_anqp_nai_realm_eap_method,
16362      {"EAP Method", "wlan_mgt.fixed.naqp_nai_realm_list.eap_method",
16363       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &eap_type_vals_ext, 0,
16364       NULL, HFILL }},
16365
16366     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_count,
16367      {"Authentication Parameter Count", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_count",
16368       FT_UINT8, BASE_DEC, NULL, 0,
16369       NULL, HFILL }},
16370
16371     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_id,
16372      {"Authentication Parameter ID", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_id",
16373       FT_UINT8, BASE_DEC, VALS(nai_realm_auth_param_id_vals), 0,
16374       NULL, HFILL }},
16375
16376     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_len,
16377      {"Authentication Parameter Length", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_len",
16378       FT_UINT8, BASE_DEC, NULL, 0,
16379       NULL, HFILL }},
16380
16381     {&hf_ieee80211_ff_anqp_nai_realm_auth_param_value,
16382      {"Authentication Parameter Value", "wlan_mgt.fixed.naqp_nai_realm_list.auth_param_value",
16383       FT_BYTES, BASE_NONE, NULL, 0,
16384       NULL, HFILL }},
16385
16386     {&hf_ieee80211_3gpp_gc_gud,
16387      {"GUD", "wlan_mgt.fixed.anqp.3gpp_cellular_info.gud",
16388       FT_UINT8, BASE_DEC, NULL, 0,
16389       "Generic container User Data", HFILL }},
16390
16391     {&hf_ieee80211_3gpp_gc_udhl,
16392      {"UDHL", "wlan_mgt.fixed.anqp.3gpp_cellular_info.udhl",
16393       FT_UINT8, BASE_DEC, NULL, 0,
16394       "User Data Header Length", HFILL }},
16395
16396     {&hf_ieee80211_3gpp_gc_iei,
16397      {"IEI", "wlan_mgt.fixed.anqp.3gpp_cellular_info.iei",
16398       FT_UINT8, BASE_DEC, NULL, 0,
16399       "Information Element Identity", HFILL }},
16400
16401     {&hf_ieee80211_3gpp_gc_plmn_len,
16402      {"PLMN Length", "wlan_mgt.fixed.anqp.3gpp_cellular_info.plmn_len",
16403       FT_UINT8, BASE_DEC, NULL, 0,
16404       "Length of PLMN List value contents", HFILL }},
16405
16406     {&hf_ieee80211_3gpp_gc_num_plmns,
16407      {"Number of PLMNs", "wlan_mgt.fixed.anqp.3gpp_cellular_info.num_plmns",
16408       FT_UINT8, BASE_DEC, NULL, 0,
16409       NULL, HFILL }},
16410
16411     {&hf_ieee80211_3gpp_gc_plmn,
16412      {"PLMN", "wlan_mgt.fixed.anqp.3gpp_cellular_info.plmn",
16413       FT_STRING, BASE_NONE, NULL, 0,
16414       "PLMN information", HFILL }},
16415
16416     {&hf_ieee80211_ff_anqp_domain_name_len,
16417      {"Domain Name Length", "wlan_mgt.fixed.anqp.domain_name_list.len",
16418       FT_UINT8, BASE_DEC, NULL, 0,
16419       NULL, HFILL }},
16420
16421     {&hf_ieee80211_ff_anqp_domain_name,
16422      {"Domain Name", "wlan_mgt.fixed.anqp.domain_name_list.name",
16423       FT_STRING, BASE_NONE, NULL, 0,
16424       NULL, HFILL }},
16425
16426     {&hf_ieee80211_ff_dls_timeout,
16427      {"DLS timeout", "wlan_mgt.fixed.dls_timeout",
16428       FT_UINT16, BASE_HEX, NULL, 0,
16429       "DLS timeout value", HFILL }},
16430
16431     {&hf_ieee80211_ff_sa_query_action_code,
16432      {"Action code", "wlan_mgt.fixed.action_code",
16433       FT_UINT8, BASE_DEC, VALS(sa_query_action_codes), 0,
16434       "Management action code", HFILL }},
16435
16436     {&hf_ieee80211_ff_transaction_id,
16437      {"Transaction Id", "wlan_mgt.fixed.transaction_id",
16438       FT_UINT16, BASE_HEX, NULL, 0,
16439       NULL, HFILL }},
16440
16441     {&hf_ieee80211_anqp_wfa_subtype,
16442      {"ANQP WFA Subtype", "wlan_mgt.anqp.wfa.subtype",
16443       FT_UINT8, BASE_DEC, VALS(wfa_subtype_vals), 0, NULL, HFILL }},
16444
16445     {&hf_hs20_indication_dgaf_disabled,
16446      {"DGAF Disabled", "wlan_mgt.hs20.indication.dgaf_disabled",
16447       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
16448
16449     {&hf_hs20_anqp_subtype,
16450      {"Subtype", "wlan_mgt.hs20.anqp.subtype",
16451       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
16452       "Hotspot 2.0 ANQP Subtype", HFILL }},
16453
16454     {&hf_hs20_anqp_reserved,
16455      {"Reserved", "wlan_mgt.hs20.anqp.reserved",
16456       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16457
16458     {&hf_hs20_anqp_payload,
16459      {"Payload", "wlan_mgt.hs20.anqp.payload",
16460       FT_BYTES, BASE_NONE, NULL, 0,
16461       "Hotspot 2.0 ANQP Payload", HFILL }},
16462
16463     {&hf_hs20_anqp_hs_query_list,
16464      {"Queried Subtype", "wlan_mgt.hs20.anqp.hs_query_list",
16465       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
16466       "Queried HS 2.0 Element Subtype", HFILL }},
16467
16468     {&hf_hs20_anqp_hs_capability_list,
16469      {"Capability", "wlan_mgt.hs20.anqp.hs_capability_list",
16470       FT_UINT8, BASE_DEC, VALS(hs20_anqp_subtype_vals), 0,
16471       "Hotspot 2.0 ANQP Subtype Capability", HFILL }},
16472
16473     {&hf_hs20_anqp_ofn_length,
16474      {"Length", "wlan_mgt.hs20.anqp.ofn.length",
16475       FT_UINT8, BASE_DEC, NULL, 0,
16476       "Operator Friendly Name Length", HFILL }},
16477
16478     {&hf_hs20_anqp_ofn_language,
16479      {"Language Code", "wlan_mgt.hs20.anqp.ofn.language",
16480       FT_STRING, BASE_NONE, NULL, 0,
16481       "Operator Friendly Name Language Code", HFILL }},
16482
16483     {&hf_hs20_anqp_ofn_name,
16484      {"Operator Friendly Name", "wlan_mgt.hs20.anqp.ofn.name",
16485       FT_STRING, BASE_NONE, NULL, 0,
16486       NULL, HFILL }},
16487
16488     {&hf_hs20_anqp_wan_metrics_link_status,
16489      {"Link Status", "wlan_mgt.hs20.anqp.wan_metrics.link_status",
16490       FT_UINT8, BASE_DEC, VALS(hs20_wm_link_status_vals), 0x03, NULL, HFILL }},
16491
16492     {&hf_hs20_anqp_wan_metrics_symmetric_link,
16493      {"Symmetric Link", "wlan_mgt.hs20.anqp.wan_metrics.symmetric_link",
16494       FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL }},
16495
16496     {&hf_hs20_anqp_wan_metrics_at_capacity,
16497      {"At Capacity", "wlan_mgt.hs20.anqp.wan_metrics.at_capacity",
16498       FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
16499
16500     {&hf_hs20_anqp_wan_metrics_reserved,
16501      {"Reserved", "wlan_mgt.hs20.anqp.wan_metrics.reserved",
16502       FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }},
16503
16504     {&hf_hs20_anqp_wan_metrics_downlink_speed,
16505      {"Downlink Speed", "wlan_mgt.hs20.anqp.wan_metrics.downlink_speed",
16506       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
16507
16508     {&hf_hs20_anqp_wan_metrics_uplink_speed,
16509      {"Uplink Speed", "wlan_mgt.hs20.anqp.wan_metrics.uplink_speed",
16510       FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
16511
16512     {&hf_hs20_anqp_wan_metrics_downlink_load,
16513      {"Downlink Load", "wlan_mgt.hs20.anqp.wan_metrics.downlink_load",
16514       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16515
16516     {&hf_hs20_anqp_wan_metrics_uplink_load,
16517      {"Uplink Load", "wlan_mgt.hs20.anqp.wan_metrics.uplink_load",
16518       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16519
16520     {&hf_hs20_anqp_wan_metrics_lmd,
16521      {"LMD", "wlan_mgt.hs20.anqp.wan_metrics.lmd",
16522       FT_UINT16, BASE_DEC, NULL, 0, "Load Measurement Duration", HFILL }},
16523
16524     {&hf_hs20_anqp_cc_proto_ip_proto,
16525      {"IP Protocol", "wlan_mgt.hs20.anqp.cc.ip_proto",
16526       FT_UINT8, BASE_DEC, NULL, 0,
16527       "ProtoPort Tuple - IP Protocol", HFILL }},
16528
16529     {&hf_hs20_anqp_cc_proto_port_num,
16530      {"Port Number", "wlan_mgt.hs20.anqp.cc.port_num",
16531       FT_UINT16, BASE_DEC, NULL, 0,
16532       "ProtoPort Tuple - Port Number", HFILL }},
16533
16534     {&hf_hs20_anqp_cc_proto_status,
16535      {"Status", "wlan_mgt.hs20.anqp.cc.status",
16536       FT_UINT8, BASE_DEC, VALS(hs20_cc_status_vals), 0,
16537       "ProtoPort Tuple - Status", HFILL }},
16538
16539     {&hf_hs20_anqp_nai_hrq_count,
16540      {"NAI Home Realm Count", "wlan_mgt.hs20.anqp.nai_hrq.count",
16541       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16542
16543     {&hf_hs20_anqp_nai_hrq_encoding_type,
16544      {"NAI Home Realm Encoding Type",
16545       "wlan_mgt.hs20.anqp.nai_hrq.encoding_type",
16546       FT_UINT8, BASE_DEC, VALS(nai_realm_encoding_vals),
16547       0x01, NULL, HFILL }},
16548
16549     {&hf_hs20_anqp_nai_hrq_length,
16550      {"NAI Home Realm Name Length", "wlan_mgt.hs20.anqp.nai_hrq.length",
16551       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16552
16553     {&hf_hs20_anqp_nai_hrq_realm_name,
16554      {"NAI Home Realm Name", "wlan_mgt.hs20.anqp.nai_hrq.name",
16555       FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
16556
16557     {&hf_hs20_anqp_oper_class_indic,
16558      {"Operating Class", "wlan_mgt.hs20.anqp.oper_class_indic.oper_class",
16559       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
16560
16561     {&hf_ieee80211_tag,
16562      {"Tag", "wlan_mgt.tag",
16563       FT_NONE, BASE_NONE, 0x0, 0,
16564       NULL, HFILL }},
16565
16566     {&hf_ieee80211_tag_number,
16567      {"Tag Number", "wlan_mgt.tag.number",
16568       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
16569       "Element ID", HFILL }},
16570
16571     {&hf_ieee80211_tag_length,
16572      {"Tag length", "wlan_mgt.tag.length",
16573       FT_UINT32, BASE_DEC, NULL, 0,
16574       "Length of tag", HFILL }},
16575
16576     {&hf_ieee80211_tag_interpretation,
16577      {"Tag interpretation", "wlan_mgt.tag.interpretation",
16578       FT_STRING, BASE_NONE, NULL, 0,
16579       "Interpretation of tag", HFILL }},
16580
16581     {&hf_ieee80211_tag_data,
16582      {"Tag Data", "wlan_mgt.tag.data",
16583       FT_BYTES, BASE_NONE, NULL, 0,
16584       "Data Interpretation of tag", HFILL }},
16585
16586     {&hf_ieee80211_tag_oui,
16587      {"OUI", "wlan_mgt.tag.oui",
16588       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0, "OUI of vendor specific IE", HFILL }},
16589
16590     {&hf_ieee80211_tag_ds_param_channel,
16591      {"Current Channel", "wlan_mgt.ds.current_channel",
16592       FT_UINT8, BASE_DEC, NULL, 0,
16593       "DS Parameter Set - Current Channel", HFILL }},
16594
16595     {&hf_ieee80211_tag_cfp_count,
16596      {"CFP Count", "wlan_mgt.cfp.count",
16597       FT_UINT8, BASE_DEC, NULL, 0,
16598       "Indicates how many delivery traffic indication messages (DTIMs)", HFILL }},
16599
16600     {&hf_ieee80211_tag_cfp_period,
16601      {"CFP Period", "wlan_mgt.cfp.period",
16602       FT_UINT8, BASE_DEC, NULL, 0,
16603       "Indicates the number of DTIM intervals between the start of CFPs", HFILL }},
16604
16605     {&hf_ieee80211_tag_cfp_max_duration,
16606      {"CFP Max Duration", "wlan_mgt.cfp.max_duration",
16607       FT_UINT16, BASE_DEC, NULL, 0,
16608       "Indicates the maximum duration (in TU) of the CFP that may be generated by this PCF", HFILL }},
16609
16610     {&hf_ieee80211_tag_cfp_dur_remaining,
16611      {"CFP Dur Remaining", "wlan_mgt.cfp.dur_remaining",
16612       FT_UINT16, BASE_DEC, NULL, 0,
16613       "Indicates the maximum time (in TU) remaining in the present CFP", HFILL }},
16614
16615     {&hf_ieee80211_tag_vendor_oui_type,
16616      {"Vendor Specific OUI Type", "wlan_mgt.tag.vendor.oui.type",
16617       FT_UINT8, BASE_DEC, NULL, 0,
16618       NULL, HFILL }},
16619
16620     {&hf_ieee80211_tag_vendor_data,
16621      {"Vendor Specific Data", "wlan_mgt.tag.vendor.data",
16622       FT_BYTES, BASE_NONE, NULL, 0,
16623       "Unknown/undecoded Vendor Specific Data", HFILL }},
16624
16625     {&hf_ieee80211_tim_dtim_count,
16626      {"DTIM count", "wlan_mgt.tim.dtim_count",
16627       FT_UINT8, BASE_DEC, NULL, 0,
16628       "Indicates how many Beacon frames (including the current frame) appear before the next DTIM", HFILL }},
16629
16630     {&hf_ieee80211_tim_dtim_period,
16631      {"DTIM period", "wlan_mgt.tim.dtim_period",
16632       FT_UINT8, BASE_DEC, NULL, 0,
16633       "Indicates the number of beacon intervals between successive DTIMs", HFILL }},
16634
16635     {&hf_ieee80211_tim_bmapctl,
16636      {"Bitmap control", "wlan_mgt.tim.bmapctl",
16637       FT_UINT8, BASE_HEX, NULL, 0,
16638       NULL, HFILL }},
16639
16640     {&hf_ieee80211_tim_bmapctl_mcast,
16641      {"Multicast", "wlan_mgt.tim.bmapctl.multicast",
16642       FT_BOOLEAN, 8, NULL, 0x1,
16643       "Contains the Traffic Indicator bit associated with Association ID 0", HFILL }},
16644
16645     {&hf_ieee80211_tim_bmapctl_offset,
16646      {"Bitmap Offset", "wlan_mgt.tim.bmapctl.offset",
16647       FT_UINT8, BASE_HEX, NULL, 0xFE,
16648       NULL, HFILL }},
16649
16650     {&hf_ieee80211_tim_partial_virtual_bitmap,
16651      {"Partial Virtual Bitmap", "wlan_mgt.tim.partial_virtual_bitmap",
16652       FT_BYTES, BASE_NONE, NULL, 0x0,
16653       NULL, HFILL }},
16654
16655     {&hf_ieee80211_tag_ibss_atim_window,
16656      {"Atim Windows", "wlan_mgt.ibss.atim_windows",
16657       FT_UINT16, BASE_HEX, NULL, 0x0,
16658       "Contains the ATIM Window length in TU", HFILL }},
16659
16660     {&hf_ieee80211_tag_country_info_code,
16661      {"Code", "wlan_mgt.country_info.code",
16662       FT_STRING, BASE_NONE, NULL, 0x0,
16663       NULL, HFILL }},
16664
16665     {&hf_ieee80211_tag_country_info_env,
16666      {"Environment", "wlan_mgt.country_info.environment",
16667       FT_UINT8, BASE_HEX, VALS(environment_vals), 0x0,
16668       NULL, HFILL }},
16669
16670     {&hf_ieee80211_tag_country_info_pad,
16671      {"Padding", "wlan_mgt.country_info.padding",
16672       FT_BYTES, BASE_NONE, NULL, 0x0,
16673       NULL, HFILL }},
16674
16675     {&hf_ieee80211_tag_country_info_fnm,
16676      {"Country Info", "wlan_mgt.country_info.fnm",
16677       FT_NONE, BASE_NONE, NULL, 0x0,
16678       NULL, HFILL }},
16679
16680     {&hf_ieee80211_tag_country_info_fnm_fcn,
16681      {"First Channel Number", "wlan_mgt.country_info.fnm.fcn",
16682       FT_UINT8, BASE_DEC, NULL, 0x0,
16683       NULL, HFILL }},
16684
16685     {&hf_ieee80211_tag_country_info_fnm_nc,
16686      {"Number of Channels", "wlan_mgt.country_info.fnm.nc",
16687       FT_UINT8, BASE_DEC, NULL, 0x0,
16688       NULL, HFILL }},
16689
16690     {&hf_ieee80211_tag_country_info_fnm_mtpl,
16691      {"Maximum Transmit Power Level (in dBm)", "wlan_mgt.country_info.fnm.mtpl",
16692       FT_UINT8, BASE_DEC, NULL, 0x0,
16693       NULL, HFILL }},
16694
16695     {&hf_ieee80211_tag_country_info_rrc,
16696      {"Country Info", "wlan_mgt.country_info.rrc",
16697       FT_NONE, BASE_NONE, NULL, 0x0,
16698       NULL, HFILL }},
16699
16700     {&hf_ieee80211_tag_country_info_rrc_rei,
16701      {"Regulatory Extension Identifier", "wlan_mgt.country_info.rrc.rei",
16702       FT_UINT8, BASE_DEC, NULL, 0x0,
16703       NULL, HFILL }},
16704
16705     {&hf_ieee80211_tag_country_info_rrc_rc,
16706      {"Regulatory Class", "wlan_mgt.country_info.rrc.rc",
16707       FT_UINT8, BASE_DEC, NULL, 0x0,
16708       NULL, HFILL }},
16709
16710     {&hf_ieee80211_tag_country_info_rrc_cc,
16711      {"Coverage Class", "wlan_mgt.country_info.rrc.cc",
16712       FT_UINT8, BASE_DEC, NULL, 0x0,
16713       NULL, HFILL }},
16714
16715     {&hf_ieee80211_tag_fh_hopping_parameter_prime_radix,
16716      {"Prime Radix", "wlan_mgt.fh_hopping.parameter.prime_radix",
16717       FT_UINT8, BASE_DEC, NULL, 0x0,
16718       NULL, HFILL }},
16719
16720     {&hf_ieee80211_tag_fh_hopping_parameter_nb_channels,
16721      {"Number of Channels", "wlan_mgt.fh_hopping.parameter.nb_channels",
16722       FT_UINT8, BASE_DEC, NULL, 0x0,
16723       NULL, HFILL }},
16724
16725     {&hf_ieee80211_tag_fh_hopping_table_flag,
16726      {"Flag", "wlan_mgt.fh_hopping.table.flag",
16727       FT_UINT8, BASE_HEX, NULL, 0x0,
16728       "Indicates that a Random Table is present when the value is 1", HFILL }},
16729
16730     {&hf_ieee80211_tag_fh_hopping_table_number_of_sets,
16731      {"Number of Sets", "wlan_mgt.fh_hopping.table.number_of_sets",
16732       FT_UINT8, BASE_DEC, NULL, 0x0,
16733       "Indicates the total number of sets within the hopping patterns", HFILL }},
16734
16735     {&hf_ieee80211_tag_fh_hopping_table_modulus,
16736      {"Modulus", "wlan_mgt.fh_hopping.table.modulus",
16737       FT_UINT8, BASE_HEX, NULL, 0x0,
16738       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
16739
16740     {&hf_ieee80211_tag_fh_hopping_table_offset,
16741      {"Offset", "wlan_mgt.fh_hopping.table.offset",
16742       FT_UINT8, BASE_HEX, NULL, 0x0,
16743       "Indicate the values to be used in the equations to create a hopping sequence from the Random Table information", HFILL }},
16744
16745     {&hf_ieee80211_tag_fh_hopping_random_table,
16746      {"Random Table", "wlan_mgt.fh_hopping.table.random_table",
16747       FT_UINT16, BASE_HEX, NULL, 0x0,
16748       "It is a vector of single octet values that indicate the random sequence to be followed during a hopping sequence", HFILL }},
16749
16750     {&hf_ieee80211_tag_request,
16751      {"Requested Element ID", "wlan_mgt.tag.request",
16752       FT_UINT8, BASE_DEC|BASE_EXT_STRING, &tag_num_vals_ext, 0,
16753       "The list of elements that are to be included in the responding STA Probe Response frame", HFILL }},
16754
16755     {&hf_ieee80211_tclas_up,
16756      {"User Priority", "wlan_mgt.tclas.user_priority",
16757       FT_UINT8, BASE_DEC, NULL, 0,
16758       "Contains the value of the UP of the associated MSDUs", HFILL }},
16759
16760     {&hf_ieee80211_tclas_class_type,
16761      {"Classifier Type", "wlan_mgt.tclas.class_type",
16762       FT_UINT8, BASE_DEC, VALS (classifier_type), 0,
16763       "Specifies the type of classifier parameters", HFILL }},
16764
16765     {&hf_ieee80211_tclas_class_mask,
16766      {"Classifier Mask", "wlan_mgt.tclas.class_mask",
16767       FT_UINT8, BASE_HEX,  NULL, 0,
16768       "Specifies a bitmap where bits that are set to 1 identify a subset of the classifier parameters", HFILL }},
16769     {&hf_ieee80211_tclas_class_mask0_src_addr,
16770      {"Source Address", "wlan_mgt.tclas.class_mask.src_addr",
16771       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
16772     {&hf_ieee80211_tclas_class_mask0_dst_addr,
16773      {"Destination Address", "wlan_mgt.tclas.class_mask.dst_addr",
16774       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
16775     {&hf_ieee80211_tclas_class_mask0_type,
16776      {"Type", "wlan_mgt.tclas.class_mask.type",
16777       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
16778     {&hf_ieee80211_tclas_class_mask1_ver,
16779      {"Version", "wlan_mgt.tclas.class_mask.version",
16780       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
16781     {&hf_ieee80211_tclas_class_mask1_src_ip,
16782      {"Source IP Address", "wlan_mgt.tclas.class_mask.src_ip",
16783       FT_UINT8, BASE_HEX, NULL, 0x02, NULL, HFILL }},
16784     {&hf_ieee80211_tclas_class_mask1_dst_ip,
16785      {"Destination IP Address", "wlan_mgt.tclas.class_mask.dst_ip",
16786       FT_UINT8, BASE_HEX, NULL, 0x04, NULL, HFILL }},
16787     {&hf_ieee80211_tclas_class_mask1_src_port,
16788      {"Source Port", "wlan_mgt.tclas.class_mask.src_port",
16789       FT_UINT8, BASE_HEX, NULL, 0x08, NULL, HFILL }},
16790     {&hf_ieee80211_tclas_class_mask1_dst_port,
16791      {"Destination Port", "wlan_mgt.tclas.class_mask.dst_port",
16792       FT_UINT8, BASE_HEX, NULL, 0x10, NULL, HFILL }},
16793     {&hf_ieee80211_tclas_class_mask1_ipv4_dscp,
16794      {"DSCP", "wlan_mgt.tclas.class_mask.dscp",
16795       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
16796     {&hf_ieee80211_tclas_class_mask1_ipv4_proto,
16797      {"Protocol", "wlan_mgt.tclas.class_mask.proto",
16798       FT_UINT8, BASE_HEX, NULL, 0x40, NULL, HFILL }},
16799     {&hf_ieee80211_tclas_class_mask1_ipv6_flow,
16800      {"Flow Label", "wlan_mgt.tclas.class_mask.flow_label",
16801       FT_UINT8, BASE_HEX, NULL, 0x20, NULL, HFILL }},
16802     {&hf_ieee80211_tclas_class_mask2_tci,
16803      {"802.1Q CLAN TCI", "wlan_mgt.tclas.class_mask.tci",
16804       FT_UINT8, BASE_HEX, NULL, 0x01, NULL, HFILL }},
16805
16806     {&hf_ieee80211_tclas_src_mac_addr,
16807      {"Source address", "wlan_mgt.tclas.type",
16808       FT_ETHER, BASE_NONE, NULL, 0,
16809       "Classifier Parameters Ethernet Type", HFILL }},
16810
16811     {&hf_ieee80211_tclas_dst_mac_addr,
16812      {"Destination address", "wlan_mgt.tclas.type",
16813       FT_ETHER, BASE_NONE, NULL, 0,
16814       NULL, HFILL }},
16815
16816     {&hf_ieee80211_tclas_ether_type,
16817      {"Ethernet Type", "wlan_mgt.tclas.type",
16818       FT_UINT8, BASE_DEC, NULL, 0,
16819       NULL, HFILL }},
16820
16821     {&hf_ieee80211_tclas_version,
16822      {"IP Version", "wlan_mgt.tclas.version",
16823       FT_UINT8, BASE_DEC, NULL, 0,
16824       NULL, HFILL }},
16825
16826     {&hf_ieee80211_tclas_ipv4_src,
16827      {"IPv4 Src Addr", "wlan_mgt.tclas.ipv4_src",
16828       FT_IPv4, BASE_NONE, NULL, 0,
16829       NULL, HFILL }},
16830
16831     {&hf_ieee80211_tclas_ipv4_dst,
16832      {"IPv4 Dst Addr", "wlan_mgt.tclas.ipv4_dst",
16833       FT_IPv4, BASE_NONE, NULL, 0,
16834       NULL, HFILL }},
16835
16836     {&hf_ieee80211_tclas_src_port,
16837      {"Source Port", "wlan_mgt.tclas.src_port",
16838       FT_UINT16, BASE_DEC, NULL, 0,
16839       NULL, HFILL }},
16840
16841     {&hf_ieee80211_tclas_dst_port,
16842      {"Destination Port", "wlan_mgt.tclas.dst_port",
16843       FT_UINT16, BASE_DEC, NULL, 0,
16844       NULL, HFILL }},
16845
16846     {&hf_ieee80211_tclas_dscp,
16847      {"IPv4 DSCP", "wlan_mgt.tclas.dscp",
16848       FT_UINT8, BASE_HEX, NULL, 0,
16849       "IPv4 Differentiated Services Code Point (DSCP) Field", HFILL }},
16850
16851     {&hf_ieee80211_tclas_protocol,
16852      {"Protocol", "wlan_mgt.tclas.protocol",
16853       FT_UINT8, BASE_HEX, NULL, 0,
16854       "IPv4 Protocol", HFILL }},
16855
16856     {&hf_ieee80211_tclas_ipv6_src,
16857      {"IPv6 Src Addr", "wlan_mgt.tclas.ipv6_src",
16858       FT_IPv6, BASE_NONE, NULL, 0,
16859       NULL, HFILL }},
16860
16861     {&hf_ieee80211_tclas_ipv6_dst,
16862      {"IPv6 Dst Addr", "wlan_mgt.tclas.ipv6_dst",
16863       FT_IPv6, BASE_NONE, NULL, 0,
16864       NULL, HFILL }},
16865
16866     {&hf_ieee80211_tclas_flow,
16867      {"Flow Label", "wlan_mgt.tclas.flow",
16868       FT_UINT24, BASE_HEX, NULL, 0,
16869       "IPv6 Flow Label", HFILL }},
16870
16871     {&hf_ieee80211_tclas_tag_type,
16872      {"802.1Q Tag Type", "wlan_mgt.tclas.tag_type",
16873       FT_UINT16, BASE_HEX, NULL, 0,
16874       NULL, HFILL }},
16875
16876     {&hf_ieee80211_tag_challenge_text,
16877      {"Challenge Text", "wlan_mgt.tag.challenge_text",
16878       FT_BYTES, BASE_NONE, NULL, 0,
16879       NULL, HFILL }},
16880
16881     {&hf_ieee80211_rsn_version,
16882      {"RSN Version", "wlan_mgt.rsn.version",
16883       FT_UINT16, BASE_DEC, NULL, 0,
16884       "Indicates the version number of the RSNA protocol", HFILL }},
16885
16886     {&hf_ieee80211_rsn_gcs,
16887      {"Group Cipher Suite", "wlan_mgt.rsn.gcs",
16888       FT_UINT32, BASE_CUSTOM, rsn_gcs_base_custom, 0,
16889       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
16890
16891     {&hf_ieee80211_rsn_gcs_oui,
16892      {"Group Cipher Suite OUI", "wlan_mgt.rsn.gcs.oui",
16893       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
16894       NULL, HFILL }},
16895
16896     {&hf_ieee80211_rsn_gcs_type,
16897      {"Group Cipher Suite type", "wlan_mgt.rsn.gcs.type",
16898       FT_UINT8, BASE_DEC, NULL, 0,
16899       NULL, HFILL }},
16900
16901     {&hf_ieee80211_rsn_gcs_80211_type,
16902      {"Group Cipher Suite type", "wlan_mgt.rsn.gcs.type",
16903       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
16904       NULL, HFILL }},
16905
16906     {&hf_ieee80211_rsn_pcs_count,
16907      {"Pairwise Cipher Suite Count", "wlan_mgt.rsn.pcs.count",
16908       FT_UINT16, BASE_DEC,  NULL, 0,
16909       "Indicates the number of pairwise cipher suite selectors that are contained in the Pairwise Cipher Suite List", HFILL }},
16910
16911     {&hf_ieee80211_rsn_pcs_list,
16912      {"Pairwise Cipher Suite List", "wlan_mgt.rsn.pcs.list",
16913       FT_NONE, BASE_NONE, NULL, 0,
16914       "Contains a series of cipher suite selectors that indicate the pairwisecipher suites", HFILL }},
16915
16916     {&hf_ieee80211_rsn_pcs,
16917      {"Pairwise Cipher Suite", "wlan_mgt.rsn.pcs",
16918       FT_UINT32, BASE_CUSTOM, rsn_pcs_base_custom, 0,
16919       NULL, HFILL }},
16920
16921     {&hf_ieee80211_rsn_pcs_oui,
16922      {"Pairwise Cipher Suite OUI", "wlan_mgt.rsn.pcs.oui",
16923       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
16924       NULL, HFILL }},
16925
16926     {&hf_ieee80211_rsn_pcs_type,
16927      {"Pairwise Cipher Suite type", "wlan_mgt.rsn.pcs.type",
16928       FT_UINT8, BASE_DEC, NULL, 0,
16929       NULL, HFILL }},
16930
16931     {&hf_ieee80211_rsn_pcs_80211_type,
16932      {"Pairwise Cipher Suite type", "wlan_mgt.rsn.pcs.type",
16933       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
16934       NULL, HFILL }},
16935
16936     {&hf_ieee80211_rsn_akms_count,
16937      {"Auth Key Management (AKM) Suite Count", "wlan_mgt.rsn.akms.count",
16938       FT_UINT16, BASE_DEC, NULL, 0,
16939       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
16940
16941     {&hf_ieee80211_rsn_akms_list,
16942      {"Auth Key Management (AKM) List", "wlan_mgt.rsn.akms.list",
16943       FT_NONE, BASE_NONE, NULL, 0,
16944       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
16945
16946     {&hf_ieee80211_rsn_akms,
16947      {"Auth Key Management (AKM) Suite", "wlan_mgt.rsn.akms",
16948       FT_UINT32, BASE_CUSTOM, rsn_akms_base_custom, 0,
16949       NULL, HFILL }},
16950
16951     {&hf_ieee80211_rsn_akms_oui,
16952      {"Auth Key Management (AKM) OUI", "wlan_mgt.rsn.akms.oui",
16953       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
16954       NULL, HFILL }},
16955
16956     {&hf_ieee80211_rsn_akms_type,
16957      {"Auth Key Management (AKM) type", "wlan_mgt.rsn.akms.type",
16958       FT_UINT8, BASE_DEC, NULL, 0,
16959       NULL, HFILL }},
16960
16961     {&hf_ieee80211_rsn_akms_80211_type,
16962      {"Auth Key Management (AKM) type", "wlan_mgt.rsn.akms.type",
16963       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_keymgmt_vals), 0,
16964       NULL, HFILL }},
16965
16966     {&hf_ieee80211_rsn_cap,
16967      {"RSN Capabilities", "wlan_mgt.rsn.capabilities",
16968       FT_UINT16, BASE_HEX, NULL, 0,
16969       "RSN Capability information", HFILL }},
16970
16971     {&hf_ieee80211_rsn_cap_preauth,
16972      {"RSN Pre-Auth capabilities", "wlan_mgt.rsn.capabilities.preauth",
16973       FT_BOOLEAN, 16, TFS(&rsn_preauth_flags), 0x0001,
16974       NULL, HFILL }},
16975
16976     {&hf_ieee80211_rsn_cap_no_pairwise,
16977      {"RSN No Pairwise capabilities", "wlan_mgt.rsn.capabilities.no_pairwise",
16978       FT_BOOLEAN, 16, TFS(&rsn_no_pairwise_flags), 0x0002,
16979       NULL, HFILL }},
16980
16981     {&hf_ieee80211_rsn_cap_ptksa_replay_counter,
16982      {"RSN PTKSA Replay Counter capabilities", "wlan_mgt.rsn.capabilities.ptksa_replay_counter",
16983       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x000C,
16984       NULL, HFILL }},
16985
16986     {&hf_ieee80211_rsn_cap_gtksa_replay_counter,
16987      {"RSN GTKSA Replay Counter capabilities", "wlan_mgt.rsn.capabilities.gtksa_replay_counter",
16988       FT_UINT16, BASE_HEX, VALS(rsn_cap_replay_counter), 0x0030,
16989       NULL, HFILL }},
16990
16991     {&hf_ieee80211_rsn_cap_mfpr,
16992      {"Management Frame Protection Required", "wlan_mgt.rsn.capabilities.mfpr",
16993       FT_BOOLEAN, 16, NULL, 0x0040,
16994       NULL, HFILL }},
16995
16996     {&hf_ieee80211_rsn_cap_mfpc,
16997      {"Management Frame Protection Capable", "wlan_mgt.rsn.capabilities.mfpc",
16998       FT_BOOLEAN, 16, NULL, 0x0080,
16999       NULL, HFILL }},
17000
17001     {&hf_ieee80211_rsn_cap_peerkey,
17002      {"PeerKey Enabled", "wlan_mgt.rsn.capabilities.peerkey",
17003       FT_BOOLEAN, 16, NULL, 0x0200,
17004       NULL, HFILL }},
17005
17006     {&hf_ieee80211_rsn_pmkid_count,
17007      {"PMKID Count", "wlan_mgt.rsn.pmkid.count",
17008       FT_UINT16, BASE_DEC, NULL, 0,
17009       "Indicates the number of PMKID  selectors that are contained in the PMKID Suite List", HFILL }},
17010
17011     {&hf_ieee80211_rsn_pmkid_list,
17012      {"PMKID List", "wlan_mgt.rsn.pmkid.list",
17013       FT_NONE, BASE_NONE, NULL, 0,
17014       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
17015
17016     {&hf_ieee80211_rsn_pmkid,
17017      {"PMKID", "wlan_mgt.pmkid.akms",
17018       FT_BYTES, BASE_NONE, NULL, 0,
17019       NULL, HFILL }},
17020
17021     {&hf_ieee80211_rsn_gmcs,
17022      {"Group Management Cipher Suite", "wlan_mgt.rsn.gmcs",
17023       FT_UINT32, BASE_CUSTOM, rsn_gmcs_base_custom, 0,
17024       "Contains the cipher suite selector used by the BSS to protect broadcast/multicast traffic", HFILL }},
17025
17026     {&hf_ieee80211_rsn_gmcs_oui,
17027      {"Group Management Cipher Suite OUI", "wlan_mgt.rsn.gmcs.oui",
17028       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
17029       NULL, HFILL }},
17030
17031     {&hf_ieee80211_rsn_gmcs_type,
17032      {"Group Management Cipher Suite type", "wlan_mgt.rsn.gmcs.type",
17033       FT_UINT8, BASE_DEC, NULL, 0,
17034       NULL, HFILL }},
17035
17036     {&hf_ieee80211_rsn_gmcs_80211_type,
17037      {"Group Management Cipher Suite type", "wlan_mgt.rsn.gmcs.type",
17038       FT_UINT8, BASE_DEC, VALS(ieee80211_rsn_cipher_vals), 0,
17039       NULL, HFILL }},
17040
17041     {&hf_ieee80211_ht_pren_type,
17042      {"802.11n (Pre) Type", "wlan_mgt.vs.pren.type",
17043       FT_UINT8, BASE_DEC, VALS(ieee80211_ht_pren_type_vals), 0,
17044       "Vendor Specific HT Type", HFILL }},
17045     {&hf_ieee80211_ht_pren_unknown,
17046      {"802.11n (Pre) Unknown Data", "wlan_mgt.vs.pren.unknown_data",
17047       FT_BYTES, BASE_NONE, NULL, 0,
17048       NULL, HFILL }},
17049
17050     {&hf_ieee80211_ht_cap,
17051      {"HT Capabilities Info", "wlan_mgt.ht.capabilities",
17052       FT_UINT16, BASE_HEX, NULL, 0,
17053       "HT Capabilities information", HFILL }},
17054
17055     {&hf_ieee80211_ht_vs_cap,
17056      {"HT Capabilities Info (VS)", "wlan_mgt.vs.ht.capabilities",
17057       FT_UINT16, BASE_HEX, NULL, 0,
17058       "Vendor Specific HT Capabilities information", HFILL }},
17059
17060     {&hf_ieee80211_ht_ldpc_coding,
17061      {"HT LDPC coding capability", "wlan_mgt.ht.capabilities.ldpccoding",
17062       FT_BOOLEAN, 16, TFS (&ht_ldpc_coding_flag), 0x0001,
17063       NULL, HFILL }},
17064
17065     {&hf_ieee80211_ht_chan_width,
17066      {"HT Support channel width", "wlan_mgt.ht.capabilities.width",
17067       FT_BOOLEAN, 16, TFS (&ht_chan_width_flag), 0x0002,
17068       NULL, HFILL }},
17069
17070     {&hf_ieee80211_ht_sm_pwsave,
17071      {"HT SM Power Save", "wlan_mgt.ht.capabilities.sm",
17072       FT_UINT16, BASE_HEX, VALS(ht_sm_pwsave_flag), 0x000c,
17073       NULL, HFILL }},
17074
17075     {&hf_ieee80211_ht_green,
17076      {"HT Green Field", "wlan_mgt.ht.capabilities.green",
17077       FT_BOOLEAN, 16, TFS (&ht_green_flag), 0x0010,
17078       NULL, HFILL }},
17079
17080     {&hf_ieee80211_ht_short20,
17081      {"HT Short GI for 20MHz", "wlan_mgt.ht.capabilities.short20",
17082       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0020,
17083       NULL, HFILL }},
17084
17085     {&hf_ieee80211_ht_short40,
17086      {"HT Short GI for 40MHz", "wlan_mgt.ht.capabilities.short40",
17087       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0040,
17088       NULL, HFILL }},
17089
17090     {&hf_ieee80211_ht_tx_stbc,
17091      {"HT Tx STBC", "wlan_mgt.ht.capabilities.txstbc",
17092       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0080,
17093       NULL, HFILL }},
17094
17095     {&hf_ieee80211_ht_rx_stbc,
17096      {"HT Rx STBC", "wlan_mgt.ht.capabilities.rxstbc",
17097       FT_UINT16, BASE_HEX, VALS(ht_rx_stbc_flag), 0x0300,
17098       "HT Tx STBC", HFILL }},
17099
17100     {&hf_ieee80211_ht_delayed_block_ack,
17101      {"HT Delayed Block ACK", "wlan_mgt.ht.capabilities.delayedblockack",
17102       FT_BOOLEAN, 16, TFS (&ht_delayed_block_ack_flag), 0x0400,
17103       NULL, HFILL }},
17104
17105     {&hf_ieee80211_ht_max_amsdu,
17106      {"HT Max A-MSDU length", "wlan_mgt.ht.capabilities.amsdu",
17107       FT_BOOLEAN, 16, TFS (&ht_max_amsdu_flag), 0x0800,
17108       NULL, HFILL }},
17109
17110     {&hf_ieee80211_ht_dss_cck_40,
17111      {"HT DSSS/CCK mode in 40MHz", "wlan_mgt.ht.capabilities.dsscck",
17112       FT_BOOLEAN, 16, TFS (&ht_dss_cck_40_flag), 0x1000,
17113       "HT DSS/CCK mode in 40MHz", HFILL }},
17114
17115     {&hf_ieee80211_ht_psmp,
17116      {"HT PSMP Support", "wlan_mgt.ht.capabilities.psmp",
17117       FT_BOOLEAN, 16, TFS (&ht_psmp_flag), 0x2000,
17118       NULL, HFILL }},
17119
17120     {&hf_ieee80211_ht_40_mhz_intolerant,
17121      {"HT Forty MHz Intolerant", "wlan_mgt.ht.capabilities.40mhzintolerant",
17122       FT_BOOLEAN, 16, TFS (&ht_40_mhz_intolerant_flag), 0x4000,
17123       NULL, HFILL }},
17124
17125     {&hf_ieee80211_ht_l_sig,
17126      {"HT L-SIG TXOP Protection support", "wlan_mgt.ht.capabilities.lsig",
17127       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x8000,
17128       NULL, HFILL }},
17129
17130     {&hf_ieee80211_ampduparam,
17131      {"A-MPDU Parameters", "wlan_mgt.ht.ampduparam",
17132       FT_UINT8, BASE_HEX, NULL, 0,
17133       NULL, HFILL }},
17134
17135     {&hf_ieee80211_ampduparam_vs,
17136      {"A-MPDU Parameters (VS)", "wlan_mgt.vs.ht.ampduparam",
17137       FT_UINT8, BASE_HEX, NULL, 0,
17138       "Vendor Specific A-MPDU Parameters", HFILL }},
17139
17140     {&hf_ieee80211_ampduparam_mpdu,
17141      {"Maximum Rx A-MPDU Length", "wlan_mgt.ht.ampduparam.maxlength",
17142       FT_UINT8, BASE_HEX, 0, 0x03,
17143       NULL, HFILL }},
17144
17145     {&hf_ieee80211_ampduparam_mpdu_start_spacing,
17146      {"MPDU Density", "wlan_mgt.ht.ampduparam.mpdudensity",
17147       FT_UINT8, BASE_HEX, VALS(&ampduparam_mpdu_start_spacing_flags), 0x1c,
17148       NULL, HFILL }},
17149
17150     {&hf_ieee80211_ampduparam_reserved,
17151      {"Reserved", "wlan_mgt.ht.ampduparam.reserved",
17152       FT_UINT8, BASE_HEX, NULL, 0xE0,
17153       NULL, HFILL }},
17154
17155     {&hf_ieee80211_mcsset,
17156      {"Rx Supported Modulation and Coding Scheme Set", "wlan_mgt.ht.mcsset",
17157       FT_STRING, BASE_NONE, NULL, 0,
17158       NULL, HFILL }},
17159
17160     {&hf_ieee80211_mcsset_vs,
17161      {"Rx Supported Modulation and Coding Scheme Set (VS)", "wlan_mgt.vs.ht.mcsset",
17162       FT_STRING, BASE_NONE, NULL, 0,
17163       "Vendor Specific Rx Supported Modulation and Coding Scheme Set", HFILL }},
17164
17165     {&hf_ieee80211_mcsset_rx_bitmask,
17166      {"Rx Modulation and Coding Scheme (One bit per modulation)", "wlan_mgt.ht.mcsset.rxbitmask",
17167       FT_NONE, BASE_NONE, NULL, 0,
17168       "One bit per modulation", HFILL }},
17169
17170     {&hf_ieee80211_mcsset_rx_bitmask_0to7,
17171      {"Rx Bitmask Bits 0-7", "wlan_mgt.ht.mcsset.rxbitmask.0to7",
17172       FT_UINT32, BASE_HEX, 0, 0x000000ff,
17173       NULL, HFILL }},
17174
17175     {&hf_ieee80211_mcsset_rx_bitmask_8to15,
17176      {"Rx Bitmask Bits 8-15", "wlan_mgt.ht.mcsset.rxbitmask.8to15",
17177       FT_UINT32, BASE_HEX, 0, 0x0000ff00,
17178       NULL, HFILL }},
17179
17180     {&hf_ieee80211_mcsset_rx_bitmask_16to23,
17181      {"Rx Bitmask Bits 16-23", "wlan_mgt.ht.mcsset.rxbitmask.16to23",
17182       FT_UINT32, BASE_HEX, 0, 0x00ff0000,
17183       NULL, HFILL }},
17184
17185     {&hf_ieee80211_mcsset_rx_bitmask_24to31,
17186      {"Rx Bitmask Bits 24-31", "wlan_mgt.ht.mcsset.rxbitmask.24to31",
17187       FT_UINT32, BASE_HEX, 0, 0xff000000,
17188       NULL, HFILL }},
17189
17190     {&hf_ieee80211_mcsset_rx_bitmask_32,
17191      {"Rx Bitmask Bit 32", "wlan_mgt.ht.mcsset.rxbitmask.32",
17192       FT_UINT32, BASE_HEX, 0, 0x000001,
17193       NULL, HFILL }},
17194
17195     {&hf_ieee80211_mcsset_rx_bitmask_33to38,
17196      {"Rx Bitmask Bits 33-38", "wlan_mgt.ht.mcsset.rxbitmask.33to38",
17197       FT_UINT32, BASE_HEX, 0, 0x00007e,
17198       NULL, HFILL }},
17199
17200     {&hf_ieee80211_mcsset_rx_bitmask_39to52,
17201      {"Rx Bitmask Bits 39-52", "wlan_mgt.ht.mcsset.rxbitmask.39to52",
17202       FT_UINT32, BASE_HEX, 0, 0x1fff80,
17203       NULL, HFILL }},
17204
17205     {&hf_ieee80211_mcsset_rx_bitmask_53to76,
17206      {"Rx Bitmask Bits 53-76", "wlan_mgt.ht.mcsset.rxbitmask.53to76",
17207       FT_UINT32, BASE_HEX, 0, 0x1fffffe0,
17208       NULL, HFILL }},
17209
17210     {&hf_ieee80211_mcsset_highest_data_rate,
17211      {"Highest Supported Data Rate", "wlan_mgt.ht.mcsset.highestdatarate",
17212       FT_UINT16, BASE_HEX, 0, 0x03ff,
17213       NULL, HFILL }},
17214
17215     {&hf_ieee80211_mcsset_tx_mcs_set_defined,
17216      {"Tx Supported MCS Set", "wlan_mgt.ht.mcsset.txsetdefined",
17217       FT_BOOLEAN, 16, TFS (&mcsset_tx_mcs_set_defined_flag), 0x0001,
17218       NULL, HFILL }},
17219
17220     {&hf_ieee80211_mcsset_tx_rx_mcs_set_not_equal,
17221      {"Tx and Rx MCS Set", "wlan_mgt.ht.mcsset.txrxmcsnotequal",
17222       FT_BOOLEAN, 16, TFS (&mcsset_tx_rx_mcs_set_not_equal_flag), 0x0002,
17223       NULL, HFILL }},
17224
17225     {&hf_ieee80211_mcsset_tx_max_spatial_streams,
17226      {"Tx Maximum Number of Spatial Streams Supported", "wlan_mgt.ht.mcsset.txmaxss",
17227       FT_UINT16, BASE_HEX, VALS(mcsset_tx_max_spatial_streams_flags) , 0x000c,
17228       NULL, HFILL }},
17229
17230     {&hf_ieee80211_mcsset_tx_unequal_modulation,
17231      {"Unequal Modulation", "wlan_mgt.ht.mcsset.txunequalmod",
17232       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0010,
17233       NULL, HFILL }},
17234
17235     {&hf_ieee80211_htex_cap,
17236      {"HT Extended Capabilities", "wlan_mgt.htex.capabilities",
17237       FT_UINT16, BASE_HEX, NULL, 0,
17238       "HT Extended Capability information", HFILL }},
17239
17240     {&hf_ieee80211_htex_vs_cap,
17241      {"HT Extended Capabilities (VS)", "wlan_mgt.vs.htex.capabilities",
17242       FT_UINT16, BASE_HEX, NULL, 0,
17243       "Vendor Specific HT Extended Capability information", HFILL }},
17244
17245     {&hf_ieee80211_htex_pco,
17246      {"Transmitter supports PCO", "wlan_mgt.htex.capabilities.pco",
17247       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0001,
17248       NULL, HFILL }},
17249
17250     {&hf_ieee80211_htex_transtime,
17251      {"Time needed to transition between 20MHz and 40MHz", "wlan_mgt.htex.capabilities.transtime",
17252       FT_UINT16, BASE_HEX, VALS(htex_transtime_flags), 0x0006,
17253       NULL, HFILL }},
17254
17255     {&hf_ieee80211_htex_mcs,
17256      {"MCS Feedback capability", "wlan_mgt.htex.capabilities.mcs",
17257       FT_UINT16, BASE_HEX, VALS(htex_mcs_flags), 0x0300,
17258       NULL, HFILL }},
17259
17260     {&hf_ieee80211_htex_htc_support,
17261      {"High Throughput", "wlan_mgt.htex.capabilities.htc",
17262       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0400,
17263       NULL, HFILL }},
17264
17265     {&hf_ieee80211_htex_rd_responder,
17266      {"Reverse Direction Responder", "wlan_mgt.htex.capabilities.rdresponder",
17267       FT_BOOLEAN, 16, TFS (&tfs_supported_not_supported), 0x0800,
17268       NULL, HFILL }},
17269
17270     {&hf_ieee80211_txbf,
17271      {"Transmit Beam Forming (TxBF) Capabilities", "wlan_mgt.txbf",
17272       FT_UINT16, BASE_HEX, NULL, 0,
17273       NULL, HFILL }},
17274
17275     {&hf_ieee80211_txbf_vs,
17276      {"Transmit Beam Forming (TxBF) Capabilities (VS)", "wlan_mgt.vs.txbf",
17277       FT_UINT16, BASE_HEX, NULL, 0,
17278       "Vendor Specific Transmit Beam Forming (TxBF) Capabilities", HFILL }},
17279
17280     {&hf_ieee80211_txbf_cap,
17281      {"Transmit Beamforming", "wlan_mgt.txbf.txbf",
17282       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000001,
17283       NULL, HFILL }},
17284
17285     {&hf_ieee80211_txbf_rcv_ssc,
17286      {"Receive Staggered Sounding", "wlan_mgt.txbf.rxss",
17287       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000002,
17288       NULL, HFILL }},
17289
17290     {&hf_ieee80211_txbf_tx_ssc,
17291      {"Transmit Staggered Sounding", "wlan_mgt.txbf.txss",
17292       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000004,
17293       NULL, HFILL }},
17294
17295     {&hf_ieee80211_txbf_rcv_ndp,
17296      {"Receive Null Data packet (NDP)", "wlan_mgt.txbf.rxndp",
17297       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000008,
17298       NULL, HFILL }},
17299
17300     {&hf_ieee80211_txbf_tx_ndp,
17301      {"Transmit Null Data packet (NDP)", "wlan_mgt.txbf.txndp",
17302       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000010,
17303       NULL, HFILL }},
17304
17305     {&hf_ieee80211_txbf_impl_txbf,
17306      {"Implicit TxBF capable", "wlan_mgt.txbf.impltxbf",
17307       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000020,
17308       "Implicit Transmit Beamforming (TxBF) capable", HFILL }},
17309
17310     {&hf_ieee80211_txbf_calib,
17311      {"Calibration", "wlan_mgt.txbf.calibration",
17312       FT_UINT32, BASE_HEX, VALS(txbf_calib_flag), 0x000000c0,
17313       NULL, HFILL }},
17314
17315     {&hf_ieee80211_txbf_expl_csi,
17316      {"STA can apply TxBF using CSI explicit feedback", "wlan_mgt.txbf.csi",
17317       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000100,
17318       "Station can apply TxBF using CSI explicit feedback", HFILL }},
17319
17320     {&hf_ieee80211_txbf_expl_uncomp_fm,
17321      {"STA can apply TxBF using uncompressed beamforming feedback matrix", "wlan_mgt.txbf.fm.uncompressed.tbf",
17322       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000200,
17323       "Station can apply TxBF using uncompressed beamforming feedback matrix", HFILL }},
17324
17325     {&hf_ieee80211_txbf_expl_comp_fm,
17326      {"STA can apply TxBF using compressed beamforming feedback matrix", "wlan_mgt.txbf.fm.compressed.tbf",
17327       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000400,
17328       "Station can apply TxBF using compressed beamforming feedback matrix", HFILL }},
17329
17330     {&hf_ieee80211_txbf_expl_bf_csi,
17331      {"Receiver can return explicit CSI feedback", "wlan_mgt.txbf.rcsi",
17332       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00001800,
17333       NULL, HFILL }},
17334
17335     {&hf_ieee80211_txbf_expl_uncomp_fm_feed,
17336      {"Receiver can return explicit uncompressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.uncompressed.rbf",
17337       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00006000,
17338       NULL, HFILL }},
17339
17340     {&hf_ieee80211_txbf_expl_comp_fm_feed,
17341      {"STA can compress and use compressed Beamforming Feedback Matrix", "wlan_mgt.txbf.fm.compressed.bf",
17342       FT_UINT32, BASE_HEX, VALS(txbf_feedback_flags), 0x00018000,
17343       "Station can compress and use compressed Beamforming Feedback Matrix", HFILL }},
17344
17345     {&hf_ieee80211_txbf_min_group,
17346      {"Minimal grouping used for explicit feedback reports", "wlan_mgt.txbf.mingroup",
17347       FT_UINT32, BASE_HEX, VALS(txbf_min_group_flags), 0x00060000,
17348       NULL, HFILL }},
17349
17350     {&hf_ieee80211_vht_cap,
17351      {"VHT Capabilities Info", "wlan_mgt.vht.capabilities",
17352       FT_UINT32, BASE_HEX, NULL, 0,
17353       "VHT Capabilities information", HFILL }},
17354
17355     {&hf_ieee80211_vht_max_mpdu_length,
17356      {"Maximum MPDU Length", "wlan_mgt.vht.capabilities.maxmpdulength",
17357       FT_UINT32, BASE_HEX, VALS(vht_max_mpdu_length_flag), 0x00000003,
17358       "In Octets unit", HFILL }},
17359
17360     {&hf_ieee80211_vht_supported_chan_width_set,
17361      {"Supported Channel Width Set", "wlan_mgt.vht.capabilities.supportedchanwidthset",
17362       FT_UINT32, BASE_HEX, VALS(vht_supported_chan_width_set_flag), 0x0000000c,
17363       NULL, HFILL }},
17364
17365     {&hf_ieee80211_vht_rx_ldpc,
17366      {"Rx LDPC", "wlan_mgt.vht.capabilities.rxldpc",
17367       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000010,
17368       NULL, HFILL }},
17369
17370     {&hf_ieee80211_vht_short_gi_for_80,
17371      {"Short GI for 80MHz", "wlan_mgt.vht.capabilities.short80",
17372       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000020,
17373       NULL, HFILL }},
17374
17375     {&hf_ieee80211_vht_short_gi_for_160,
17376      {"Short GI for 160MHz and 80+80MHz", "wlan_mgt.vht.capabilities.short160",
17377       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000040,
17378       NULL, HFILL }},
17379
17380     {&hf_ieee80211_vht_tx_stbc,
17381      {"Tx STBC", "wlan_mgt.vht.capabilities.txstbc",
17382       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000080,
17383       NULL, HFILL }},
17384
17385     {&hf_ieee80211_vht_rx_stbc,
17386      {"Rx STBC", "wlan_mgt.vht.capabilities.rxstbc",
17387       FT_UINT32, BASE_HEX, VALS(vht_rx_stbc_flag), 0x00000700,
17388       NULL, HFILL }},
17389
17390     {&hf_ieee80211_vht_su_beamformer_cap,
17391      {"SU Beam-former Capable", "wlan_mgt.vht.capabilities.subeamformer",
17392       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00000800,
17393       NULL, HFILL }},
17394
17395     {&hf_ieee80211_vht_su_beamformee_cap,
17396      {"SU Beam-formee Capable", "wlan_mgt.vht.capabilities.subeamformee",
17397       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00001000,
17398       NULL, HFILL }},
17399
17400     {&hf_ieee80211_vht_beamformer_antennas,
17401      {"Compressed Steering Number of Beamformer Antennas Supported", "wlan_mgt.vht.capabilities.beamformerants",
17402       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x0000e000,
17403       NULL, HFILL }},
17404
17405     {&hf_ieee80211_vht_sounding_dimensions,
17406      {"Number of Sounding Dimensions", "wlan_mgt.vht.capabilities.soundingdimensions",
17407       FT_UINT32, BASE_HEX, VALS(num_plus_one_3bit_flag), 0x00070000,
17408       NULL, HFILL }},
17409
17410     {&hf_ieee80211_vht_mu_beamformer_cap,
17411      {"MU Beam-former Capable", "wlan_mgt.vht.capabilities.mubeamformer",
17412       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00080000,
17413       NULL, HFILL }},
17414
17415     {&hf_ieee80211_vht_mu_beamformee_cap,
17416      {"MU Beam-formee Capable", "wlan_mgt.vht.capabilities.mubeamformee",
17417       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00100000,
17418       NULL, HFILL }},
17419
17420     {&hf_ieee80211_vht_txop_ps,
17421      {"VHT TXOP PS", "wlan_mgt.vht.capabilities.vhttxopps",
17422       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00200000,
17423       NULL, HFILL }},
17424
17425     {&hf_ieee80211_vht_var_htc_field,
17426      {"+HTC-VHT Capable (VHT variant HT Control field)", "wlan_mgt.vht.capabilities.vhthtc",
17427       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x00400000,
17428       NULL, HFILL }},
17429
17430     {&hf_ieee80211_vht_max_ampdu,
17431      {"Max A-MPDU Length", "wlan_mgt.vht.capabilities.maxampdu",
17432       FT_UINT32, BASE_HEX, VALS(vht_max_ampdu_flag), 0x03800000,
17433       "In Octets unit", HFILL }},
17434
17435     {&hf_ieee80211_vht_link_adaptation_cap,
17436      {"VHT Link Adaptation", "wlan_mgt.vht.capabilities.linkadapt",
17437       FT_UINT32, BASE_HEX, VALS(vht_link_adapt_flag), 0x0c000000,
17438       NULL, HFILL }},
17439
17440     {&hf_ieee80211_vht_rx_pattern,
17441      {"Rx Antenna Pattern Consistency", "wlan_mgt.vht.capabilities.rxpatconsist",
17442       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x10000000,
17443       NULL, HFILL }},
17444
17445     {&hf_ieee80211_vht_tx_pattern,
17446      {"Tx Antenna Pattern Consistency", "wlan_mgt.vht.capabilities.txpatconsist",
17447       FT_BOOLEAN, 32, TFS (&tfs_supported_not_supported), 0x20000000,
17448       NULL, HFILL }},
17449
17450     {&hf_ieee80211_vht_reserv,
17451      {"Reserved", "wlan_mgt.vht.reserved",
17452       FT_BOOLEAN, 32, NULL, 0xc0000000,
17453       NULL, HFILL }},
17454
17455     {&hf_ieee80211_vht_mcsset,
17456      {"VHT Supported MCS Set", "wlan_mgt.vht.mcsset",
17457       FT_NONE, BASE_NONE, NULL, 0,
17458       NULL, HFILL }},
17459
17460     {&hf_ieee80211_vht_mcsset_rx_mcs_map,
17461      {"Rx MCS Map", "wlan_mgt.vht.mcsset.rxmcsmap",
17462       FT_UINT16, BASE_HEX, NULL, 0,
17463       NULL, HFILL }},
17464
17465     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_1_ss,
17466      {"Rx 1 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss1",
17467       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
17468       NULL, HFILL }},
17469
17470     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_2_ss,
17471      {"Rx 2 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss2",
17472       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
17473       NULL, HFILL }},
17474
17475     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_3_ss,
17476      {"Rx 3 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss3",
17477       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
17478       NULL, HFILL }},
17479
17480     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_4_ss,
17481      {"Rx 4 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss4",
17482       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
17483       NULL, HFILL }},
17484
17485     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_5_ss,
17486      {"Rx 5 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss5",
17487       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
17488       NULL, HFILL }},
17489
17490     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_6_ss,
17491      {"Rx 6 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss6",
17492       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
17493       NULL, HFILL }},
17494
17495     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_7_ss,
17496      {"Rx 7 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss7",
17497       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
17498       NULL, HFILL }},
17499
17500     {&hf_ieee80211_vht_mcsset_rx_max_mcs_for_8_ss,
17501      {"Rx 8 SS", "wlan_mgt.vht.mcsset.rxmcsmap.ss8",
17502       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
17503       NULL, HFILL }},
17504
17505     {&hf_ieee80211_vht_mcsset_rx_highest_long_gi,
17506      {"Rx Highest Long GI Data Rate (in Mb/s, 0 = subfield not in use)", "wlan_mgt.vht.mcsset.rxhighestlonggirate",
17507       FT_UINT16, BASE_HEX, NULL, 0x1fff,
17508       NULL, HFILL }},
17509
17510     {&hf_ieee80211_vht_mcsset_tx_mcs_map,
17511      {"Tx MCS Map", "wlan_mgt.vht.mcsset.txmcsmap",
17512       FT_UINT16, BASE_HEX, NULL, 0,
17513       NULL, HFILL }},
17514
17515     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_1_ss,
17516      {"Tx 1 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss1",
17517       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
17518       NULL, HFILL }},
17519
17520     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_2_ss,
17521      {"Tx 2 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss2",
17522       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
17523       NULL, HFILL }},
17524
17525     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_3_ss,
17526      {"Tx 3 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss3",
17527       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
17528       NULL, HFILL }},
17529
17530     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_4_ss,
17531      {"Tx 4 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss4",
17532       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
17533       NULL, HFILL }},
17534
17535     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_5_ss,
17536      {"Tx 5 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss5",
17537       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
17538       NULL, HFILL }},
17539
17540     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_6_ss,
17541      {"Tx 6 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss6",
17542       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
17543       NULL, HFILL }},
17544
17545     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_7_ss,
17546      {"Tx 7 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss7",
17547       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
17548       NULL, HFILL }},
17549
17550     {&hf_ieee80211_vht_mcsset_tx_max_mcs_for_8_ss,
17551      {"Tx 8 SS", "wlan_mgt.vht.mcsset.txmcsmap.ss8",
17552       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
17553       NULL, HFILL }},
17554
17555     {&hf_ieee80211_vht_mcsset_tx_highest_long_gi,
17556      {"Tx Highest Long GI Data Rate  (in Mb/s, 0 = subfield not in use)", "wlan_mgt.vht.mcsset.txhighestlonggirate",
17557       FT_UINT16, BASE_HEX, NULL, 0x1fff,
17558       NULL, HFILL }},
17559
17560     {&hf_ieee80211_vht_op,
17561      {"VHT Operation Info", "wlan_mgt.vht.op",
17562       FT_NONE, BASE_NONE, NULL, 0,
17563       NULL, HFILL }},
17564
17565     {&hf_ieee80211_vht_op_channel_width,
17566      {"Channel Width", "wlan_mgt.vht.op.channelwidth",
17567       FT_UINT8, BASE_HEX, VALS(vht_op_channel_width_flag), 0,
17568       NULL, HFILL }},
17569
17570     {&hf_ieee80211_vht_op_channel_center0,
17571      {"Channel Center Segment 0", "wlan_mgt.vht.op.channelcenter0",
17572       FT_UINT8, BASE_DEC, NULL, 0,
17573       NULL, HFILL }},
17574
17575     {&hf_ieee80211_vht_op_channel_center1,
17576      {"Channel Center Segment 1", "wlan_mgt.vht.op.channelcenter1",
17577       FT_UINT8, BASE_DEC, NULL, 0,
17578       NULL, HFILL }},
17579
17580     {&hf_ieee80211_vht_op_basic_mcs_map,
17581      {"Basic MCS Map", "wlan_mgt.vht.op.basicmcsmap",
17582       FT_UINT16, BASE_HEX, NULL, 0,
17583       NULL, HFILL }},
17584
17585     {&hf_ieee80211_vht_op_max_basic_mcs_for_1_ss,
17586      {"Basic 1 SS", "wlan_mgt.vht.op.basicmcsmap.ss1",
17587       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0003,
17588       NULL, HFILL }},
17589
17590     {&hf_ieee80211_vht_op_max_basic_mcs_for_2_ss,
17591      {"Basic 2 SS", "wlan_mgt.vht.op.basicmcsmap.ss2",
17592       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x000c,
17593       NULL, HFILL }},
17594
17595     {&hf_ieee80211_vht_op_max_basic_mcs_for_3_ss,
17596      {"Basic 3 SS", "wlan_mgt.vht.op.basicmcsmap.ss3",
17597       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0030,
17598       NULL, HFILL }},
17599
17600     {&hf_ieee80211_vht_op_max_basic_mcs_for_4_ss,
17601      {"Basic 4 SS", "wlan_mgt.vht.op.basicmcsmap.ss4",
17602       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x00c0,
17603       NULL, HFILL }},
17604
17605     {&hf_ieee80211_vht_op_max_basic_mcs_for_5_ss,
17606      {"Basic 5 SS", "wlan_mgt.vht.op.basicmcsmap.ss5",
17607       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0300,
17608       NULL, HFILL }},
17609
17610     {&hf_ieee80211_vht_op_max_basic_mcs_for_6_ss,
17611      {"Basic 6 SS", "wlan_mgt.vht.op.basicmcsmap.ss6",
17612       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x0c00,
17613       NULL, HFILL }},
17614
17615     {&hf_ieee80211_vht_op_max_basic_mcs_for_7_ss,
17616      {"Basic 7 SS", "wlan_mgt.vht.op.basicmcsmap.ss7",
17617       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0x3000,
17618       NULL, HFILL }},
17619
17620     {&hf_ieee80211_vht_op_max_basic_mcs_for_8_ss,
17621      {"Basic 8 SS", "wlan_mgt.vht.op.basicmcsmap.ss8",
17622       FT_UINT16, BASE_HEX, VALS(vht_supported_mcs_flag), 0xc000,
17623       NULL, HFILL }},
17624
17625     {&hf_ieee80211_txbf_csi_num_bf_ant,
17626      {"Max antennae STA can support when CSI feedback required", "wlan_mgt.txbf.csinumant",
17627       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00180000,
17628       "Max antennae station can support when CSI feedback required", HFILL }},
17629
17630     {&hf_ieee80211_txbf_uncomp_sm_bf_ant,
17631      {"Max antennae STA can support when uncompressed Beamforming feedback required", "wlan_mgt.txbf.fm.uncompressed.maxant",
17632       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x00600000,
17633       "Max antennae station can support when uncompressed Beamforming feedback required", HFILL }},
17634
17635     {&hf_ieee80211_txbf_comp_sm_bf_ant,
17636      {"Max antennae STA can support when compressed Beamforming feedback required", "wlan_mgt.txbf.fm.compressed.maxant",
17637       FT_UINT32, BASE_HEX, VALS(txbf_antenna_flags), 0x01800000,
17638       "Max antennae station can support when compressed Beamforming feedback required", HFILL }},
17639
17640     {&hf_ieee80211_txbf_csi_max_rows_bf,
17641      {"Maximum number of rows of CSI explicit feedback", "wlan_mgt.txbf.csi.maxrows",
17642       FT_UINT32, BASE_HEX, VALS(txbf_csi_max_rows_bf_flags), 0x06000000,
17643       NULL, HFILL }},
17644
17645     {&hf_ieee80211_txbf_chan_est,
17646      {"Maximum number of space time streams for which channel dimensions can be simultaneously estimated", "wlan_mgt.txbf.channelest",
17647       FT_UINT32, BASE_HEX, VALS(txbf_chan_est_flags), 0x18000000,
17648       NULL, HFILL }},
17649
17650     {&hf_ieee80211_txbf_resrv,
17651      {"Reserved", "wlan_mgt.txbf.reserved",
17652       FT_UINT32, BASE_HEX, NULL, 0xe0000000,
17653       NULL, HFILL }},
17654
17655     {&hf_ieee80211_hta_cc,
17656      {"HT Control Channel", "wlan_mgt.hta.control_channel",
17657       FT_UINT8, BASE_DEC, NULL, 0,
17658       NULL, HFILL }},
17659
17660     {&hf_ieee80211_hta_cap,
17661      {"HT Additional Capabilities", "wlan_mgt.hta.capabilities",
17662       FT_UINT16, BASE_HEX, NULL, 0,
17663       "HT Additional Capability information", HFILL }},
17664
17665     {&hf_ieee80211_hta_ext_chan_offset,
17666      {"Extension Channel Offset", "wlan_mgt.hta.capabilities.extchan",
17667       FT_UINT16, BASE_HEX, VALS(hta_ext_chan_offset_flag), 0x0003,
17668       NULL, HFILL }},
17669
17670     {&hf_ieee80211_hta_rec_tx_width,
17671      {"Recommended Tx Channel Width", "wlan_mgt.hta.capabilities.rectxwidth",
17672       FT_BOOLEAN, 16, TFS (&hta_rec_tx_width_flag), 0x0004,
17673       "Recommended Transmit Channel Width", HFILL }},
17674
17675     {&hf_ieee80211_hta_rifs_mode,
17676      {"Reduced Interframe Spacing (RIFS) Mode", "wlan_mgt.hta.capabilities.rifsmode",
17677       FT_BOOLEAN, 16, TFS (&hta_rifs_mode_flag), 0x0008,
17678       NULL, HFILL }},
17679
17680     {&hf_ieee80211_hta_controlled_access,
17681      {"Controlled Access Only", "wlan_mgt.hta.capabilities.controlledaccess",
17682       FT_BOOLEAN, 16, TFS (&hta_controlled_access_flag), 0x0010,
17683       NULL, HFILL }},
17684
17685     {&hf_ieee80211_hta_service_interval,
17686      {"Service Interval Granularity", "wlan_mgt.hta.capabilities.serviceinterval",
17687       FT_UINT16, BASE_HEX, VALS(hta_service_interval_flag), 0x00E0,
17688       NULL, HFILL }},
17689
17690     {&hf_ieee80211_hta_operating_mode,
17691      {"Operating Mode", "wlan_mgt.hta.capabilities.operatingmode",
17692       FT_UINT16, BASE_HEX, VALS(hta_operating_mode_flag), 0x0003,
17693       NULL, HFILL }},
17694
17695     {&hf_ieee80211_hta_non_gf_devices,
17696      {"Non Greenfield (GF) devices Present", "wlan_mgt.hta.capabilities.nongfdevices",
17697       FT_BOOLEAN, 16, TFS (&hta_non_gf_devices_flag), 0x0004,
17698       "on Greenfield (GF) devices Present", HFILL }},
17699
17700     {&hf_ieee80211_hta_basic_stbc_mcs,
17701      {"Basic STB Modulation and Coding Scheme (MCS)", "wlan_mgt.hta.capabilities.",
17702       FT_UINT16, BASE_HEX, NULL , 0x007f,
17703       NULL, HFILL }},
17704
17705     {&hf_ieee80211_hta_dual_stbc_protection,
17706      {"Dual Clear To Send (CTS) Protection", "wlan_mgt.hta.capabilities.",
17707       FT_BOOLEAN, 16, TFS (&hta_dual_stbc_protection_flag), 0x0080,
17708       NULL, HFILL }},
17709
17710     {&hf_ieee80211_hta_secondary_beacon,
17711      {"Secondary Beacon", "wlan_mgt.hta.capabilities.",
17712       FT_BOOLEAN, 16, TFS (&hta_secondary_beacon_flag), 0x0100,
17713       NULL, HFILL }},
17714
17715     {&hf_ieee80211_hta_lsig_txop_protection,
17716      {"L-SIG TXOP Protection Support", "wlan_mgt.hta.capabilities.",
17717       FT_BOOLEAN, 16, TFS (&hta_lsig_txop_protection_flag), 0x0200,
17718       NULL, HFILL }},
17719
17720     {&hf_ieee80211_hta_pco_active,
17721      {"Phased Coexistence Operation (PCO) Active", "wlan_mgt.hta.capabilities.",
17722       FT_BOOLEAN, 16, TFS (&hta_pco_active_flag), 0x0400,
17723       NULL, HFILL }},
17724
17725     {&hf_ieee80211_hta_pco_phase,
17726      {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.hta.capabilities.",
17727       FT_BOOLEAN, 16, TFS (&hta_pco_phase_flag), 0x0800,
17728       NULL, HFILL }},
17729
17730     {&hf_ieee80211_antsel,
17731      {"Antenna Selection (ASEL) Capabilities", "wlan_mgt.asel",
17732       FT_UINT8, BASE_HEX, NULL, 0,
17733       NULL, HFILL }},
17734
17735     {&hf_ieee80211_antsel_vs,
17736      {"Antenna Selection (ASEL) Capabilities (VS)", "wlan_mgt.vs.asel",
17737       FT_UINT8, BASE_HEX, NULL, 0,
17738       "Vendor Specific Antenna Selection (ASEL) Capabilities", HFILL }},
17739
17740     {&hf_ieee80211_antsel_b0,
17741      {"Antenna Selection Capable", "wlan_mgt.asel.capable",
17742       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x01,
17743       NULL, HFILL }},
17744
17745     {&hf_ieee80211_antsel_b1,
17746      {"Explicit CSI Feedback Based Tx ASEL", "wlan_mgt.asel.txcsi",
17747       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x02,
17748       NULL, HFILL }},
17749
17750     {&hf_ieee80211_antsel_b2,
17751      {"Antenna Indices Feedback Based Tx ASEL", "wlan_mgt.asel.txif",
17752       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x04,
17753       NULL, HFILL }},
17754
17755     {&hf_ieee80211_antsel_b3,
17756      {"Explicit CSI Feedback", "wlan_mgt.asel.csi",
17757       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x08,
17758       NULL, HFILL }},
17759
17760     {&hf_ieee80211_antsel_b4,
17761      {"Antenna Indices Feedback", "wlan_mgt.asel.if",
17762       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x10,
17763       NULL, HFILL }},
17764
17765     {&hf_ieee80211_antsel_b5,
17766      {"Rx ASEL", "wlan_mgt.asel.rx",
17767       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x20,
17768       NULL, HFILL }},
17769
17770     {&hf_ieee80211_antsel_b6,
17771      {"Tx Sounding PPDUs", "wlan_mgt.asel.sppdu",
17772       FT_BOOLEAN, 8, TFS (&tfs_supported_not_supported), 0x40,
17773       NULL, HFILL }},
17774
17775     {&hf_ieee80211_antsel_b7,
17776      {"Reserved", "wlan_mgt.asel.reserved",
17777       FT_UINT8, BASE_HEX, NULL, 0x80,
17778       NULL, HFILL }},
17779
17780     {&hf_ieee80211_ht_info_delimiter1,
17781      {"HT Information Subset (1 of 3)", "wlan_mgt.ht.info.delim1",
17782       FT_UINT8, BASE_HEX, NULL, 0,
17783       NULL, HFILL }},
17784
17785     {&hf_ieee80211_ht_info_primary_channel,
17786      {"Primary Channel", "wlan_mgt.ht.info.primarychannel",
17787       FT_UINT8, BASE_DEC, NULL, 0,
17788       NULL, HFILL }},
17789
17790     {&hf_ieee80211_ht_info_secondary_channel_offset,
17791      {"Secondary channel offset", "wlan_mgt.ht.info.secchanoffset",
17792       FT_UINT8, BASE_HEX, VALS(ht_info_secondary_channel_offset_flags), 0x03,
17793       NULL, HFILL }},
17794
17795     {&hf_ieee80211_ht_info_channel_width,
17796      {"Supported channel width", "wlan_mgt.ht.info.chanwidth",
17797       FT_BOOLEAN, 8, TFS (&ht_info_channel_width_flag), 0x04,
17798       NULL, HFILL }},
17799
17800     {&hf_ieee80211_ht_info_rifs_mode,
17801      {"Reduced Interframe Spacing (RIFS)", "wlan_mgt.ht.info.rifs",
17802       FT_BOOLEAN, 8, TFS (&ht_info_rifs_mode_flag), 0x08,
17803       NULL, HFILL }},
17804
17805     {&hf_ieee80211_ht_info_psmp_stas_only,
17806      {"Power Save Multi-Poll (PSMP) stations only", "wlan_mgt.ht.info.psmponly",
17807       FT_BOOLEAN, 8, TFS (&ht_info_psmp_stas_only_flag), 0x10,
17808       NULL, HFILL }},
17809
17810     {&hf_ieee80211_ht_info_service_interval_granularity,
17811      {"Shortest service interval", "wlan_mgt.ht.info.",
17812       FT_UINT8, BASE_HEX, VALS(ht_info_service_interval_granularity_flags), 0xe0,
17813       NULL, HFILL }},
17814
17815     {&hf_ieee80211_ht_info_delimiter2,
17816      {"HT Information Subset (2 of 3)", "wlan_mgt.ht.info.delim2",
17817       FT_UINT16, BASE_HEX, NULL, 0,
17818       NULL, HFILL }},
17819
17820     {&hf_ieee80211_ht_info_operating_mode,
17821      {"Operating mode of BSS", "wlan_mgt.ht.info.operatingmode",
17822       FT_UINT16, BASE_HEX, VALS(ht_info_operating_mode_flags), 0x0003,
17823       NULL, HFILL }},
17824
17825     {&hf_ieee80211_ht_info_non_greenfield_sta_present,
17826      {"Non-greenfield STAs present", "wlan_mgt.ht.info.greenfield",
17827       FT_BOOLEAN, 16, TFS (&ht_info_non_greenfield_sta_present_flag), 0x0004,
17828       NULL, HFILL }},
17829
17830     {&hf_ieee80211_ht_info_transmit_burst_limit,
17831      {"Transmit burst limit", "wlan_mgt.ht.info.burstlim",
17832       FT_BOOLEAN, 16, TFS (&ht_info_transmit_burst_limit_flag), 0x0008,
17833       NULL, HFILL }},
17834
17835     {&hf_ieee80211_ht_info_obss_non_ht_stas_present,
17836      {"OBSS non-HT STAs present", "wlan_mgt.ht.info.obssnonht",
17837       FT_BOOLEAN, 16, TFS (&ht_info_obss_non_ht_stas_present_flag), 0x0010,
17838       NULL, HFILL }},
17839
17840     {&hf_ieee80211_ht_info_reserved_1,
17841      {"Reserved", "wlan_mgt.ht.info.reserved1",
17842       FT_UINT16, BASE_HEX, NULL, 0xffe0,
17843       NULL, HFILL }},
17844
17845     {&hf_ieee80211_ht_info_delimiter3,
17846      {"HT Information Subset (3 of 3)", "wlan_mgt.ht.info.delim3",
17847       FT_UINT16, BASE_HEX, NULL, 0,
17848       NULL, HFILL }},
17849
17850     {&hf_ieee80211_ht_info_reserved_2,
17851      {"Reserved", "wlan_mgt.ht.info.reserved2",
17852       FT_UINT16, BASE_HEX, NULL, 0x003f,
17853       NULL, HFILL }},
17854
17855     {&hf_ieee80211_ht_info_dual_beacon,
17856      {"Dual beacon", "wlan_mgt.ht.info.dualbeacon",
17857       FT_BOOLEAN, 16, TFS (&ht_info_dual_beacon_flag), 0x0040,
17858       NULL, HFILL }},
17859
17860     {&hf_ieee80211_ht_info_dual_cts_protection,
17861      {"Dual Clear To Send (CTS) protection", "wlan_mgt.ht.info.dualcts",
17862       FT_BOOLEAN, 16, TFS (&ht_info_dual_cts_protection_flag), 0x0080,
17863       NULL, HFILL }},
17864
17865     {&hf_ieee80211_ht_info_secondary_beacon,
17866      {"Beacon ID", "wlan_mgt.ht.info.secondarybeacon",
17867       FT_BOOLEAN, 16, TFS (&ht_info_secondary_beacon_flag), 0x0100,
17868       NULL, HFILL }},
17869
17870     {&hf_ieee80211_ht_info_lsig_txop_protection_full_support,
17871      {"L-SIG TXOP Protection Full Support", "wlan_mgt.ht.info.lsigprotsupport",
17872       FT_BOOLEAN, 16, TFS (&ht_info_lsig_txop_protection_full_support_flag), 0x0200,
17873       NULL, HFILL }},
17874
17875     {&hf_ieee80211_ht_info_pco_active,
17876      {"Phased Coexistence Operation (PCO)", "wlan_mgt.ht.info.pco.active",
17877       FT_BOOLEAN, 16, TFS (&tfs_active_inactive), 0x0400,
17878       NULL, HFILL }},
17879
17880     {&hf_ieee80211_ht_info_pco_phase,
17881      {"Phased Coexistence Operation (PCO) Phase", "wlan_mgt.ht.info.pco.phase",
17882       FT_BOOLEAN, 16, TFS (&ht_info_pco_phase_flag), 0x0800,
17883       NULL, HFILL }},
17884
17885     {&hf_ieee80211_ht_info_reserved_3,
17886      {"Reserved", "wlan_mgt.ht.info.reserved3",
17887       FT_UINT16, BASE_HEX, NULL, 0xf000,
17888       NULL, HFILL }},
17889
17890     {&hf_ieee80211_tag_ap_channel_report_regulatory_class,
17891      {"Regulatory Class", "wlan_mgt.ap_channel_report.regulatory_class",
17892       FT_UINT8, BASE_DEC, NULL, 0,
17893       NULL, HFILL }},
17894
17895     {&hf_ieee80211_tag_ap_channel_report_channel_list,
17896      {"Channel List", "wlan_mgt.ap_channel_report.channel_list",
17897       FT_UINT8, BASE_DEC, NULL, 0,
17898       NULL, HFILL }},
17899
17900     {&hf_ieee80211_tag_secondary_channel_offset,
17901      {"Secondary Channel Offset", "wlan_mgt.secchanoffset",
17902       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_secondary_channel_offset_flags), 0,
17903       NULL, HFILL }},
17904
17905     {&hf_ieee80211_tag_bss_ap_avg_access_delay,
17906      {"AP Average Access Delay", "wlan_mgt.bss_ap_avg_access_delay",
17907       FT_UINT8, BASE_DEC, NULL, 0x0,
17908       NULL, HFILL }},
17909
17910     {&hf_ieee80211_tag_antenna_id,
17911      {"Antenna ID", "wlan_mgt.antenna.id",
17912       FT_UINT8, BASE_DEC, NULL, 0x0,
17913       NULL, HFILL }},
17914
17915     {&hf_ieee80211_tag_rsni,
17916      {"RSNI", "wlan_mgt.rsni",
17917       FT_UINT8, BASE_CUSTOM, rsni_base_custom, 0x0,
17918       NULL, HFILL }},
17919
17920     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask,
17921      {"Available Admission Capacity Bitmask", "wlan_mgt.bss_avb_adm_cap.bitmask",
17922       FT_UINT16, BASE_HEX, NULL, 0,
17923       NULL, HFILL }},
17924     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up0,
17925      {"UP0 (bit0)", "wlan_mgt.bss_avb_adm_cap.bitmask.up0",
17926       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP0,
17927       NULL, HFILL }},
17928     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up1,
17929      {"UP1 (bit1)", "wlan_mgt.bss_avb_adm_cap.bitmask.up1",
17930       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP1,
17931       NULL, HFILL }},
17932     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up2,
17933      {"UP2 (bit2)", "wlan_mgt.bss_avb_adm_cap.bitmask.up2",
17934       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP2,
17935       NULL, HFILL }},
17936     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up3,
17937      {"UP3 (bit3)", "wlan_mgt.bss_avb_adm_cap.bitmask.up3",
17938       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP3,
17939       NULL, HFILL }},
17940     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up4,
17941      {"UP4 (bit4)", "wlan_mgt.bss_avb_adm_cap.bitmask.up4",
17942       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP4,
17943       NULL, HFILL }},
17944     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up5,
17945      {"UP5 (bit5)", "wlan_mgt.bss_avb_adm_cap.bitmask.up5",
17946       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP5,
17947       NULL, HFILL }},
17948     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up6,
17949      {"UP0 (bit6)", "wlan_mgt.bss_avb_adm_cap.bitmask.up6",
17950       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP6,
17951       NULL, HFILL }},
17952     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_up7,
17953      {"UP7 (bit7)", "wlan_mgt.bss_avb_adm_cap.bitmask.up7",
17954       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_UP7,
17955       NULL, HFILL }},
17956     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac0,
17957      {"AC0 (bit8)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac0",
17958       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC0,
17959       NULL, HFILL }},
17960     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac1,
17961      {"AC1 (bit9)", "wlan_mgt.bss_avb_adm_cap.bitmask.AC1",
17962       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC1,
17963       NULL, HFILL }},
17964     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac2,
17965      {"AC2 (bit10)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac2",
17966       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC2,
17967       NULL, HFILL }},
17968     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_ac3,
17969      {"AC3 (bit11)", "wlan_mgt.bss_avb_adm_cap.bitmask.ac3",
17970       FT_BOOLEAN, 16, TFS(&tfs_set_notset), BSS_BITMASK_AC3,
17971       NULL, HFILL }},
17972     {&hf_ieee80211_tag_bss_avb_adm_cap_bitmask_rsv,
17973      {"Reserved", "wlan_mgt.bss_avb_adm_cap.bitmask.rsv",
17974       FT_UINT16, BASE_HEX, NULL, BSS_BITMASK_RSV,
17975       NULL, HFILL }},
17976     {&hf_ieee80211_tag_bss_avb_adm_cap_up0,
17977      {"UP0", "wlan_mgt.bss_avb_adm_cap.up0",
17978       FT_UINT16, BASE_DEC, NULL, 0x0,
17979       NULL, HFILL }},
17980     {&hf_ieee80211_tag_bss_avb_adm_cap_up1,
17981      {"UP1", "wlan_mgt.bss_avb_adm_cap.up1",
17982       FT_UINT16, BASE_DEC, NULL, 0x0,
17983       NULL, HFILL }},
17984     {&hf_ieee80211_tag_bss_avb_adm_cap_up2,
17985      {"UP2", "wlan_mgt.bss_avb_adm_cap.up2",
17986       FT_UINT16, BASE_DEC, NULL, 0x0,
17987       NULL, HFILL }},
17988     {&hf_ieee80211_tag_bss_avb_adm_cap_up3,
17989      {"UP3", "wlan_mgt.bss_avb_adm_cap.up3",
17990       FT_UINT16, BASE_DEC, NULL, 0x0,
17991       NULL, HFILL }},
17992     {&hf_ieee80211_tag_bss_avb_adm_cap_up4,
17993      {"UP4", "wlan_mgt.bss_avb_adm_cap.up4",
17994       FT_UINT16, BASE_DEC, NULL, 0x0,
17995       NULL, HFILL }},
17996     {&hf_ieee80211_tag_bss_avb_adm_cap_up5,
17997      {"UP5", "wlan_mgt.bss_avb_adm_cap.up5",
17998       FT_UINT16, BASE_DEC, NULL, 0x0,
17999       NULL, HFILL }},
18000     {&hf_ieee80211_tag_bss_avb_adm_cap_up6,
18001      {"UP6", "wlan_mgt.bss_avb_adm_cap.up6",
18002       FT_UINT16, BASE_DEC, NULL, 0x0,
18003       NULL, HFILL }},
18004     {&hf_ieee80211_tag_bss_avb_adm_cap_up7,
18005      {"UP7", "wlan_mgt.bss_avb_adm_cap.up7",
18006       FT_UINT16, BASE_DEC, NULL, 0x0,
18007       NULL, HFILL }},
18008     {&hf_ieee80211_tag_bss_avb_adm_cap_ac0,
18009      {"AC0", "wlan_mgt.bss_avb_adm_cap.ac0",
18010       FT_UINT16, BASE_DEC, NULL, 0x0,
18011       NULL, HFILL }},
18012     {&hf_ieee80211_tag_bss_avb_adm_cap_ac1,
18013      {"AC1", "wlan_mgt.bss_avb_adm_cap.ac1",
18014       FT_UINT16, BASE_DEC, NULL, 0x0,
18015       NULL, HFILL }},
18016     {&hf_ieee80211_tag_bss_avb_adm_cap_ac2,
18017      {"AC2", "wlan_mgt.bss_avb_adm_cap.ac2",
18018       FT_UINT16, BASE_DEC, NULL, 0x0,
18019       NULL, HFILL }},
18020     {&hf_ieee80211_tag_bss_avb_adm_cap_ac3,
18021      {"AC3", "wlan_mgt.bss_avb_adm_cap.ac3",
18022       FT_UINT16, BASE_DEC, NULL, 0x0,
18023       NULL, HFILL }},
18024
18025     {&hf_ieee80211_tag_bss_avg_ac_access_delay_be,
18026      {"AC Average Access Delay for Best Effort", "wlan_mgt.bss_avg_ac_access_delay.be",
18027       FT_UINT8, BASE_DEC, NULL, 0x0,
18028       NULL, HFILL }},
18029     {&hf_ieee80211_tag_bss_avg_ac_access_delay_bk,
18030      {"AC Average Access Delay for Best Background", "wlan_mgt.bss_avg_ac_access_delay.bk",
18031       FT_UINT8, BASE_DEC, NULL, 0x0,
18032       NULL, HFILL }},
18033     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vi,
18034      {"AC Average Access Delay for Video", "wlan_mgt.bss_avg_ac_access_delay_vi",
18035       FT_UINT8, BASE_DEC, NULL, 0x0,
18036       NULL, HFILL }},
18037     {&hf_ieee80211_tag_bss_avg_ac_access_delay_vo,
18038      {"AC Average Access Delay for Voice", "wlan_mgt.bss_avg_ac_access_delay_vo",
18039       FT_UINT8, BASE_DEC, NULL, 0x0,
18040       NULL, HFILL }},
18041
18042
18043     /* 802.11-2012 Table 8-119-RM Enabled Capabilities definition */
18044     {&hf_ieee80211_tag_rm_enabled_capabilities,
18045      {"RM Capabilities", "wlan_mgt.rmcap",
18046       FT_UINT8, BASE_HEX, NULL, 0,
18047       "Signals support for radio measurements in a device", HFILL }},
18048
18049     /* RM Enabled Capability octet 1 */
18050     {&hf_ieee80211_tag_rm_enabled_capabilities_b0,
18051      {"Link Measurement", "wlan_mgt.rmcap.b0",
18052       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
18053       NULL, HFILL }},
18054     {&hf_ieee80211_tag_rm_enabled_capabilities_b1,
18055      {"Neighbor Report", "wlan_mgt.rmcap.b1",
18056       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
18057       NULL, HFILL }},
18058     {&hf_ieee80211_tag_rm_enabled_capabilities_b2,
18059      {"Parallel Measurements", "wlan_mgt.rmcap.b2",
18060       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
18061       NULL, HFILL }},
18062     {&hf_ieee80211_tag_rm_enabled_capabilities_b3,
18063      {"Repeated Measurements", "wlan_mgt.rmcap.b3",
18064       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
18065       NULL, HFILL }},
18066     {&hf_ieee80211_tag_rm_enabled_capabilities_b4,
18067      {"Beacon Passive Measurement", "wlan_mgt.rmcap.b4",
18068       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
18069       NULL, HFILL }},
18070     {&hf_ieee80211_tag_rm_enabled_capabilities_b5,
18071      {"Beacon Active Measurement", "wlan_mgt.rmcap.b5",
18072       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
18073       NULL, HFILL }},
18074     {&hf_ieee80211_tag_rm_enabled_capabilities_b6,
18075      {"Beacon Table Measurement", "wlan_mgt.rmcap.b6",
18076       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18077       NULL, HFILL }},
18078     {&hf_ieee80211_tag_rm_enabled_capabilities_b7,
18079      {"Beacon Measurement Reporting Conditions", "wlan_mgt.rmcap.b7",
18080       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
18081       NULL, HFILL }},
18082
18083     /* RM Enabled Capability octet 2 */
18084     {&hf_ieee80211_tag_rm_enabled_capabilities_b8,
18085      {"Frame Measurement", "wlan_mgt.rmcap.b8",
18086       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
18087       NULL, HFILL }},
18088     {&hf_ieee80211_tag_rm_enabled_capabilities_b9,
18089      {"Channel Load Measurement", "wlan_mgt.rmcap.b9",
18090       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
18091       NULL, HFILL }},
18092     {&hf_ieee80211_tag_rm_enabled_capabilities_b10,
18093      {"Noise Histogram Measurement", "wlan_mgt.rmcap.b10",
18094       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
18095       NULL, HFILL }},
18096     {&hf_ieee80211_tag_rm_enabled_capabilities_b11,
18097      {"Statistics Measurement", "wlan_mgt.rmcap.b11",
18098       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
18099       NULL, HFILL }},
18100     {&hf_ieee80211_tag_rm_enabled_capabilities_b12,
18101      {"LCI Measurement", "wlan_mgt.rmcap.b12",
18102       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
18103       NULL, HFILL }},
18104     {&hf_ieee80211_tag_rm_enabled_capabilities_b13,
18105      {"LCI Azimuth capability", "wlan_mgt.rmcap.b13",
18106       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
18107       NULL, HFILL }},
18108     {&hf_ieee80211_tag_rm_enabled_capabilities_b14,
18109      {"Transmit Stream/Category Measurement", "wlan_mgt.rmcap.b14",
18110       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18111       NULL, HFILL }},
18112     {&hf_ieee80211_tag_rm_enabled_capabilities_b15,
18113      {"Triggered Transmit Stream/Category Measurement", "wlan_mgt.rmcap.b15",
18114       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
18115       NULL, HFILL }},
18116
18117     /* RM Enabled Capability octet 3 */
18118     {&hf_ieee80211_tag_rm_enabled_capabilities_b16,
18119      {"AP Channel Report capability", "wlan_mgt.rmcap.b16",
18120       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
18121       NULL, HFILL }},
18122     {&hf_ieee80211_tag_rm_enabled_capabilities_b17,
18123      {"RM MIB capability", "wlan_mgt.rmcap.b17",
18124       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
18125       NULL, HFILL }},
18126     {&hf_ieee80211_tag_rm_enabled_capabilities_b18to20,
18127      {"Operating Channel Max Measurement Duration", "wlan_mgt.rmcap.b18to20",
18128       FT_UINT8, BASE_DEC, NULL, 0x1C,
18129       NULL, HFILL }},
18130     {&hf_ieee80211_tag_rm_enabled_capabilities_b21to23,
18131      {"Nonoperating Channel Max Measurement Duration", "wlan_mgt.rmcap.b21to23",
18132       FT_UINT8, BASE_DEC, NULL, 0xE0,
18133       NULL, HFILL }},
18134
18135     /* RM Enabled Capability octet 4 */
18136     {&hf_ieee80211_tag_rm_enabled_capabilities_b24to26,
18137      {"Measurement Pilotcapability", "wlan_mgt.rmcap.b24to26",
18138       FT_UINT8, BASE_DEC, NULL, 0x07,
18139       NULL, HFILL }},
18140     {&hf_ieee80211_tag_rm_enabled_capabilities_b27,
18141      {"Measurement Pilot Transmission Information", "wlan_mgt.rmcap.b27",
18142       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
18143       NULL, HFILL }},
18144     {&hf_ieee80211_tag_rm_enabled_capabilities_b28,
18145      {"Neighbor Report TSF Offset", "wlan_mgt.rmcap.b28",
18146       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
18147       NULL, HFILL }},
18148     {&hf_ieee80211_tag_rm_enabled_capabilities_b29,
18149      {"RCPI Measurement capability", "wlan_mgt.rmcap.b29",
18150       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
18151       NULL, HFILL }},
18152     {&hf_ieee80211_tag_rm_enabled_capabilities_b30,
18153      {"RSNI Measurement capability", "wlan_mgt.rmcap.b30",
18154       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18155       NULL, HFILL }},
18156     {&hf_ieee80211_tag_rm_enabled_capabilities_b31,
18157      {"BSS Average Access Delay capability", "wlan_mgt.rmcap.b31",
18158       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
18159       NULL, HFILL }},
18160
18161     /* RM Enabled Capability octet 5 */
18162     {&hf_ieee80211_tag_rm_enabled_capabilities_b32,
18163      {"BSS Available Admission Capacity capability", "wlan_mgt.rmcap.b32",
18164       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
18165       NULL, HFILL }},
18166     {&hf_ieee80211_tag_rm_enabled_capabilities_b33,
18167      {"Antenna capability", "wlan_mgt.rmcap.b33",
18168       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
18169       NULL, HFILL }},
18170     {&hf_ieee80211_tag_rm_enabled_capabilities_o5,
18171      {"Reserved", "wlan_mgt.rmcap.o5",
18172       FT_UINT8, BASE_HEX, NULL, 0xFC,
18173       "Must be zero", HFILL }},
18174
18175     {&hf_ieee80211_tag_power_constraint_local,
18176      {"Local Power Constraint", "wlan_mgt.powercon.local",
18177       FT_UINT8, BASE_DEC, NULL, 0,
18178       "Value that allows the mitigation requirements to be satisfied in the current channel", HFILL }},
18179
18180     {&hf_ieee80211_tag_power_capability_min,
18181      {"Minimum Transmit Power", "wlan_mgt.powercap.min",
18182       FT_UINT8, BASE_HEX, NULL, 0,
18183       "The nominal minimum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
18184
18185     {&hf_ieee80211_tag_power_capability_max,
18186      {"Maximum Transmit Power", "wlan_mgt.powercap.max",
18187       FT_UINT8, BASE_HEX, NULL, 0,
18188       "The nominal maximum transmit power with which the STA is capable of transmitting in the current channel", HFILL }},
18189
18190     {&hf_ieee80211_tag_tpc_report_trsmt_pow,
18191      {"Transmit Power", "wlan_mgt.tcprep.trsmt_pow",
18192       FT_INT8, BASE_DEC, NULL, 0,
18193       NULL, HFILL }},
18194
18195     {&hf_ieee80211_tag_tpc_report_link_mrg,
18196      {"Link Margin", "wlan_mgt.tcprep.link_mrg",
18197       FT_INT8, BASE_DEC, NULL, 0,
18198       NULL, HFILL }},
18199
18200     {&hf_ieee80211_tag_supported_channels,
18201      {"Supported Channels Set", "wlan_mgt.supchan",
18202       FT_NONE, BASE_NONE, NULL, 0,
18203       NULL, HFILL }},
18204
18205     {&hf_ieee80211_tag_supported_channels_first,
18206      {"First Supported Channel", "wlan_mgt.supchan.first",
18207       FT_UINT8, BASE_DEC, NULL, 0,
18208       NULL, HFILL }},
18209
18210     {&hf_ieee80211_tag_supported_channels_range,
18211      {"Supported Channel Range", "wlan_mgt.supchan.range",
18212       FT_UINT8, BASE_DEC, NULL, 0,
18213       NULL, HFILL }},
18214
18215     {&hf_ieee80211_csa_channel_switch_mode,
18216      {"Channel Switch Mode", "wlan_mgt.csa.channel_switch_mode",
18217       FT_UINT8, BASE_HEX, NULL, 0,
18218       "Indicates any restrictions on transmission until a channel switch", HFILL }},
18219
18220     {&hf_ieee80211_csa_new_channel_number,
18221      {"New Channel Number", "wlan_mgt.csa.new_channel_number",
18222       FT_UINT8, BASE_HEX, NULL, 0,
18223       "Set to the number of the channel to which the STA is moving", HFILL }},
18224
18225     {&hf_ieee80211_csa_channel_switch_count,
18226      {"Channel Switch Count", "wlan_mgt.csa.channel_switch_count",
18227       FT_UINT8, BASE_DEC, NULL, 0,
18228       "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 }},
18229
18230     {&hf_ieee80211_tag_measure_request_token,
18231      {"Measurement Token", "wlan_mgt.measure.req.token",
18232       FT_UINT8, BASE_HEX, NULL, 0xff,
18233       NULL, HFILL }},
18234
18235     {&hf_ieee80211_tag_measure_request_mode,
18236      {"Measurement Request Mode", "wlan_mgt.measure.req.mode",
18237       FT_UINT8, BASE_HEX, NULL, 0xff,
18238       NULL, HFILL }},
18239
18240     {&hf_ieee80211_tag_measure_request_mode_parallel,
18241      {"Parallel", "wlan_mgt.measure.req.reqmode.parallel",
18242       FT_BOOLEAN, 8, NULL, 0x01,
18243       NULL, HFILL }},
18244
18245     {&hf_ieee80211_tag_measure_request_mode_enable,
18246      {"Measurement Request Mode Field", "wlan_mgt.measure.req.reqmode.enable",
18247       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x02,
18248       NULL, HFILL }},
18249
18250     {&hf_ieee80211_tag_measure_request_mode_request,
18251      {"Measurement Reports", "wlan_mgt.measure.req.reqmode.request",
18252       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x04,
18253       NULL, HFILL }},
18254
18255     {&hf_ieee80211_tag_measure_request_mode_report,
18256      {"Autonomous Measurement Reports", "wlan_mgt.measure.req.reqmode.report",
18257       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x08,
18258       NULL, HFILL }},
18259
18260     {&hf_ieee80211_tag_measure_request_mode_duration_mandatory,
18261      {"Duration Mandatory", "wlan_mgt.measure.req.reqmode.duration_mandatory",
18262       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x10,
18263       NULL, HFILL }},
18264
18265     {&hf_ieee80211_tag_measure_request_mode_reserved,
18266      {"Reserved", "wlan_mgt.measure.req.reqmode.reserved",
18267       FT_UINT8, BASE_HEX, NULL, 0xE0,
18268       NULL, HFILL }},
18269
18270     {&hf_ieee80211_tag_measure_request_type,
18271      {"Measurement Request Type", "wlan_mgt.measure.req.reqtype",
18272       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_type_flags_ext, 0x00,
18273       NULL, HFILL }},
18274
18275     {&hf_ieee80211_tag_measure_request_channel_number,
18276      {"Measurement Channel Number", "wlan_mgt.measure.req.channelnumber",
18277       FT_UINT8, BASE_HEX, NULL, 0,
18278       NULL, HFILL }},
18279
18280     {&hf_ieee80211_tag_measure_request_start_time,
18281      {"Measurement Start Time", "wlan_mgt.measure.req.starttime",
18282       FT_UINT64, BASE_HEX, NULL, 0,
18283       NULL, HFILL }},
18284
18285     {&hf_ieee80211_tag_measure_request_duration,
18286      {"Measurement Duration", "wlan_mgt.measure.req.channelnumber",
18287       FT_UINT16, BASE_HEX, NULL, 0,
18288       "in TU (1 TU = 1024 us)", HFILL }},
18289
18290     {&hf_ieee80211_tag_measure_request_regulatory_class,
18291      {"Measurement Channel Number", "wlan_mgt.measure.req.regclass",
18292       FT_UINT8, BASE_HEX, NULL, 0,
18293       NULL, HFILL }},
18294
18295     {&hf_ieee80211_tag_measure_request_randomization_interval,
18296      {"Randomization Interval", "wlan_mgt.measure.req.randint",
18297       FT_UINT16, BASE_HEX, NULL, 0,
18298       "in TU (1 TU = 1024 us)", HFILL }},
18299
18300     {&hf_ieee80211_tag_measure_request_measurement_mode,
18301      {"Measurement Mode", "wlan_mgt.measure.req.measurementmode",
18302       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_measurement_mode_flags), 0,
18303       NULL, HFILL }},
18304
18305     {&hf_ieee80211_tag_measure_request_bssid,
18306      {"BSSID", "wlan_mgt.measure.req.bssid",
18307       FT_ETHER, BASE_NONE, NULL, 0,
18308       NULL, HFILL }},
18309
18310     {&hf_ieee80211_tag_measure_request_subelement_length,
18311      {"Length", "wlan_mgt.measure.req.sub.length",
18312       FT_UINT8, BASE_DEC, NULL, 0,
18313       NULL, HFILL }},
18314
18315     {&hf_ieee80211_tag_measure_request_beacon_sub_id,
18316      {"SubElement ID", "wlan_mgt.measure.req.beacon.sub.id",
18317       FT_UINT8, BASE_DEC, VALS(ieee80211_tag_measure_request_beacon_sub_id_flags), 0,
18318       NULL, HFILL }},
18319
18320     {&hf_ieee80211_tag_measure_request_beacon_sub_ssid,
18321      {"SSID", "wlan_mgt.measure.req.beacon.sub.ssid",
18322       FT_STRING, BASE_NONE, 0, 0,
18323       NULL, HFILL }},
18324
18325     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition,
18326      {"Reporting Condition", "wlan_mgt.measure.req.beacon.sub.bri.repcond",
18327       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_bri_reporting_condition_flags), 0,
18328       NULL, HFILL }},
18329
18330     {&hf_ieee80211_tag_measure_request_beacon_sub_bri_threshold_offset,
18331      {"Threshold/Offset", "wlan_mgt.measure.req.beacon.sub.bri.threshold_offset",
18332       FT_UINT8, BASE_HEX, NULL, 0,
18333       NULL, HFILL }},
18334
18335     {&hf_ieee80211_tag_measure_request_beacon_sub_reporting_detail,
18336      {"Reporting Detail", "wlan_mgt.measure.req.beacon.sub.bri.reporting_detail",
18337       FT_UINT8, BASE_HEX, VALS(ieee80211_tag_measure_request_beacon_sub_reporting_detail_flags), 0,
18338       NULL, HFILL }},
18339
18340     {&hf_ieee80211_tag_measure_request_beacon_sub_request,
18341      {"Request", "wlan_mgt.measure.req.beacon.sub.request",
18342       FT_UINT8, BASE_DEC, 0, 0,
18343       NULL, HFILL }},
18344
18345     {&hf_ieee80211_tag_measure_request_beacon_unknown,
18346      {"Unknown Data", "wlan_mgt.measure.req.beacon.unknown",
18347       FT_BYTES, BASE_NONE, NULL, 0,
18348       "(not interpreted)", HFILL }},
18349
18350     {&hf_ieee80211_tag_measure_request_frame_request_type,
18351      {"Frame Request Type", "wlan_mgt.measure.req.frame_request_type",
18352       FT_UINT8, BASE_HEX, NULL, 0,
18353       NULL, HFILL }},
18354
18355     {&hf_ieee80211_tag_measure_request_mac_address,
18356      {"MAC Address", "wlan_mgt.measure.req.mac_address",
18357       FT_BYTES, BASE_NONE, NULL, 0,
18358       NULL, HFILL }},
18359
18360     {&hf_ieee80211_tag_measure_request_peer_mac_address,
18361      {"Peer MAC Address", "wlan_mgt.measure.req.peer_mac_address",
18362       FT_BYTES, BASE_NONE, NULL, 0,
18363       NULL, HFILL }},
18364
18365     {&hf_ieee80211_tag_measure_request_group_id,
18366      {"Group ID", "wlan_mgt.measure.req.groupid",
18367       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_request_group_id_flags_ext, 0,
18368       NULL, HFILL }},
18369
18370     {&hf_ieee80211_tag_measure_report_measurement_token,
18371      {"Measurement Token", "wlan_mgt.measure.req.token",
18372       FT_UINT8, BASE_HEX, NULL, 0,
18373       NULL, HFILL }},
18374
18375     {&hf_ieee80211_tag_measure_report_mode,
18376      {"Measurement Report Mode", "wlan_mgt.measure.req.mode",
18377       FT_UINT8, BASE_HEX, NULL, 0,
18378       NULL, HFILL }},
18379
18380     {&hf_ieee80211_tag_measure_report_mode_late,
18381      {"Measurement Report Mode Field", "wlan_mgt.measure.rep.repmode.late",
18382       FT_BOOLEAN, 8, TFS (&tfs_enabled_disabled), 0x01,
18383       NULL, HFILL }},
18384
18385     {&hf_ieee80211_tag_measure_report_mode_incapable,
18386      {"Measurement Reports", "wlan_mgt.measure.rep.repmode.incapable",
18387       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x02,
18388       NULL, HFILL }},
18389
18390     {&hf_ieee80211_tag_measure_report_mode_refused,
18391      {"Autonomous Measurement Reports", "wlan_mgt.measure.rep.repmode.refused",
18392       FT_BOOLEAN, 8, TFS (&tfs_accepted_not_accepted), 0x04,
18393       NULL, HFILL }},
18394
18395     {&hf_ieee80211_tag_measure_report_mode_reserved,
18396      {"Reserved", "wlan_mgt.measure.rep.repmode.reserved",
18397       FT_UINT8, BASE_HEX, NULL, 0xf8,
18398       NULL, HFILL }},
18399
18400     {&hf_ieee80211_tag_measure_report_type,
18401      {"Measurement Report Type", "wlan_mgt.measure.rep.reptype",
18402       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_tag_measure_report_type_flags_ext, 0x00,
18403       NULL, HFILL }},
18404
18405     {&hf_ieee80211_tag_measure_report_channel_number,
18406      {"Measurement Channel Number", "wlan_mgt.measure.rep.channelnumber",
18407       FT_UINT8, BASE_HEX, NULL, 0,
18408       NULL, HFILL }},
18409
18410     {&hf_ieee80211_tag_measure_report_start_time,
18411      {"Measurement Start Time", "wlan_mgt.measure.rep.starttime",
18412       FT_UINT64, BASE_HEX, NULL, 0,
18413       NULL, HFILL }},
18414
18415     {&hf_ieee80211_tag_measure_report_duration,
18416      {"Measurement Duration", "wlan_mgt.measure.rep.channelnumber",
18417       FT_UINT16, BASE_HEX, NULL, 0,
18418       NULL, HFILL }},
18419
18420     {&hf_ieee80211_tag_measure_cca_busy_fraction,
18421      {"CCA Busy Fraction", "wlan_mgt.measure.rep.ccabusy",
18422       FT_UINT8, BASE_HEX, NULL, 0,
18423       NULL, HFILL }},
18424
18425     {&hf_ieee80211_tag_measure_basic_map_field,
18426      {"Map Field", "wlan_mgt.measure.rep.mapfield",
18427       FT_UINT8, BASE_HEX, NULL, 0,
18428       NULL, HFILL }},
18429
18430     {&hf_ieee80211_tag_measure_map_field_bss,
18431      {"BSS", "wlan_mgt.measure.rep.repmode.mapfield.bss",
18432       FT_BOOLEAN, 8, TFS (&ieee80211_tag_measure_map_field_bss_flag), 0x01,
18433       NULL, HFILL }},
18434
18435     {&hf_ieee80211_tag_measure_map_field_odfm,
18436      {"Orthogonal Frequency Division Multiplexing (ODFM) Preamble", "wlan_mgt.measure.rep.repmode.mapfield.bss",
18437       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x02,
18438       NULL, HFILL }},
18439
18440     {&hf_ieee80211_tag_measure_map_field_unident_signal,
18441      {"Unidentified Signal", "wlan_mgt.measure.rep.repmode.mapfield.unidentsig",
18442       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x04,
18443       NULL, HFILL }},
18444
18445     {&hf_ieee80211_tag_measure_map_field_radar,
18446      {"Radar", "wlan_mgt.measure.rep.repmode.mapfield.radar",
18447       FT_BOOLEAN, 8, TFS (&tfs_detected_not_detected), 0x08,
18448       NULL, HFILL }},
18449
18450     {&hf_ieee80211_tag_measure_map_field_unmeasured,
18451      {"Unmeasured", "wlan_mgt.measure.rep.repmode.mapfield.unmeasured",
18452       FT_BOOLEAN, 8, TFS (&tfs_true_false), 0x10,
18453       NULL, HFILL }},
18454
18455     {&hf_ieee80211_tag_measure_map_field_reserved,
18456      {"Reserved", "wlan_mgt.measure.rep.repmode.mapfield.reserved",
18457       FT_UINT8, BASE_HEX, NULL, 0xe0,
18458       NULL, HFILL }},
18459
18460     {&hf_ieee80211_tag_measure_rpi_histogram_report,
18461      {"Receive Power Indicator (RPI) Histogram Report", "wlan_mgt.measure.rep.rpi.histogram_report",
18462       FT_BYTES, BASE_NONE, NULL, 0,
18463       NULL, HFILL }},
18464
18465     {&hf_ieee80211_tag_measure_rpi_histogram_report_0,
18466      {"RPI 0 Density", "wlan_mgt.measure.rep.rpi.rpi0density",
18467       FT_UINT8, BASE_HEX, NULL, 0,
18468       "Receive Power Indicator (RPI) 0 Density", HFILL }},
18469
18470     {&hf_ieee80211_tag_measure_rpi_histogram_report_1,
18471      {"RPI 1 Density", "wlan_mgt.measure.rep.rpi.rpi1density",
18472       FT_UINT8, BASE_HEX, NULL, 0,
18473       "Receive Power Indicator (RPI) 1 Density", HFILL }},
18474
18475     {&hf_ieee80211_tag_measure_rpi_histogram_report_2,
18476      {"RPI 2 Density", "wlan_mgt.measure.rep.rpi.rpi2density",
18477       FT_UINT8, BASE_HEX, NULL, 0,
18478       "Receive Power Indicator (RPI) 2 Density", HFILL }},
18479
18480     {&hf_ieee80211_tag_measure_rpi_histogram_report_3,
18481      {"RPI 3 Density", "wlan_mgt.measure.rep.rpi.rpi3density",
18482       FT_UINT8, BASE_HEX, NULL, 0,
18483       "Receive Power Indicator (RPI) 3 Density", HFILL }},
18484
18485     {&hf_ieee80211_tag_measure_rpi_histogram_report_4,
18486      {"RPI 4 Density", "wlan_mgt.measure.rep.rpi.rpi4density",
18487       FT_UINT8, BASE_HEX, NULL, 0,
18488       "Receive Power Indicator (RPI) 4 Density", HFILL }},
18489
18490     {&hf_ieee80211_tag_measure_rpi_histogram_report_5,
18491      {"RPI 5 Density", "wlan_mgt.measure.rep.rpi.rpi5density",
18492       FT_UINT8, BASE_HEX, NULL, 0,
18493       "Receive Power Indicator (RPI) 5 Density", HFILL }},
18494
18495     {&hf_ieee80211_tag_measure_rpi_histogram_report_6,
18496      {"RPI 6 Density", "wlan_mgt.measure.rep.rpi.rpi6density",
18497       FT_UINT8, BASE_HEX, NULL, 0,
18498       "Receive Power Indicator (RPI) 6 Density", HFILL }},
18499
18500     {&hf_ieee80211_tag_measure_rpi_histogram_report_7,
18501      {"RPI 7 Density", "wlan_mgt.measure.rep.rpi.rpi7density",
18502       FT_UINT8, BASE_HEX, NULL, 0,
18503       "Receive Power Indicator (RPI) 7 Density", HFILL }},
18504
18505     {&hf_ieee80211_tag_measure_report_regulatory_class,
18506      {"Regulatory Class", "wlan_mgt.measure.rep.regclass",
18507       FT_UINT8, BASE_HEX, NULL, 0,
18508       NULL, HFILL }},
18509
18510     {&hf_ieee80211_tag_measure_report_channel_load,
18511      {"Channel Load", "wlan_mgt.measure.rep.chanload",
18512       FT_UINT8, BASE_HEX, NULL, 0,
18513       NULL, HFILL }},
18514
18515     {&hf_ieee80211_tag_measure_report_frame_info,
18516      {"Reported Frame Information", "wlan_mgt.measure.rep.frameinfo",
18517       FT_UINT8, BASE_HEX, NULL, 0,
18518       NULL, HFILL }},
18519
18520     {&hf_ieee80211_tag_measure_report_frame_info_phy_type,
18521      {"Condensed PHY", "wlan_mgt.measure.rep.frameinfo.phytype",
18522       FT_UINT8, BASE_HEX, NULL, 0x7F,
18523       NULL, HFILL }},
18524
18525     {&hf_ieee80211_tag_measure_report_frame_info_frame_type,
18526      {"Reported Frame Type", "wlan_mgt.measure.rep.frameinfo.frametype",
18527       FT_BOOLEAN, 8, TFS(&ieee80211_tag_measure_report_frame_info_frame_type_flag), 0x80,
18528       NULL, HFILL }},
18529
18530     {&hf_ieee80211_tag_measure_report_rcpi,
18531      {"Received Channel Power Indicator (RCPI)", "wlan_mgt.measure.rep.rcpi",
18532       FT_UINT8, BASE_HEX, NULL, 0,
18533       "in dBm", HFILL }},
18534
18535     {&hf_ieee80211_tag_measure_report_rsni,
18536      {"Received Signal to Noise Indicator (RSNI)", "wlan_mgt.measure.rep.rsni",
18537       FT_UINT8, BASE_HEX, NULL, 0,
18538       "in dB", HFILL }},
18539
18540     {&hf_ieee80211_tag_measure_report_bssid,
18541      {"BSSID Being Reported", "wlan_mgt.measure.rep.bssid",
18542       FT_ETHER, BASE_NONE, NULL, 0,
18543       NULL, HFILL }},
18544
18545     {&hf_ieee80211_tag_measure_report_ant_id,
18546      {"Antenna ID", "wlan_mgt.measure.rep.antid",
18547       FT_UINT8, BASE_HEX, NULL, 0,
18548       NULL, HFILL }},
18549
18550     {&hf_ieee80211_tag_measure_report_anpi,
18551      {"ANPI", "wlan_mgt.measure.rep.anpi",
18552       FT_UINT8, BASE_HEX, NULL, 0,
18553       NULL, HFILL }},
18554
18555     {&hf_ieee80211_tag_measure_report_ipi_density_0,
18556      {"IPI Density 0", "wlan_mgt.measure.rep.ipi_density0",
18557       FT_UINT8, BASE_HEX, NULL, 0,
18558       NULL, HFILL }},
18559
18560     {&hf_ieee80211_tag_measure_report_ipi_density_1,
18561      {"IPI Density 1", "wlan_mgt.measure.rep.ipi_density1",
18562       FT_UINT8, BASE_HEX, NULL, 0,
18563       NULL, HFILL }},
18564
18565     {&hf_ieee80211_tag_measure_report_ipi_density_2,
18566      {"IPI Density 2", "wlan_mgt.measure.rep.ipi_density2",
18567       FT_UINT8, BASE_HEX, NULL, 0,
18568       NULL, HFILL }},
18569
18570     {&hf_ieee80211_tag_measure_report_ipi_density_3,
18571      {"IPI Density 3", "wlan_mgt.measure.rep.ipi_density3",
18572       FT_UINT8, BASE_HEX, NULL, 0,
18573       NULL, HFILL }},
18574
18575     {&hf_ieee80211_tag_measure_report_ipi_density_4,
18576      {"IPI Density 4", "wlan_mgt.measure.rep.ipi_density4",
18577       FT_UINT8, BASE_HEX, NULL, 0,
18578       NULL, HFILL }},
18579
18580     {&hf_ieee80211_tag_measure_report_ipi_density_5,
18581      {"IPI Density 5", "wlan_mgt.measure.rep.ipi_density5",
18582       FT_UINT8, BASE_HEX, NULL, 0,
18583       NULL, HFILL }},
18584
18585     {&hf_ieee80211_tag_measure_report_ipi_density_6,
18586      {"IPI Density 6", "wlan_mgt.measure.rep.ipi_density6",
18587       FT_UINT8, BASE_HEX, NULL, 0,
18588       NULL, HFILL }},
18589
18590     {&hf_ieee80211_tag_measure_report_ipi_density_7,
18591      {"IPI Density 7", "wlan_mgt.measure.rep.ipi_density7",
18592       FT_UINT8, BASE_HEX, NULL, 0,
18593       NULL, HFILL }},
18594
18595     {&hf_ieee80211_tag_measure_report_ipi_density_8,
18596      {"IPI Density 8", "wlan_mgt.measure.rep.ipi_density8",
18597       FT_UINT8, BASE_HEX, NULL, 0,
18598       NULL, HFILL }},
18599
18600     {&hf_ieee80211_tag_measure_report_ipi_density_9,
18601      {"IPI Density 9", "wlan_mgt.measure.rep.ipi_density9",
18602       FT_UINT8, BASE_HEX, NULL, 0,
18603       NULL, HFILL }},
18604
18605     {&hf_ieee80211_tag_measure_report_ipi_density_10,
18606      {"IPI Density 10", "wlan_mgt.measure.rep.ipi_density10",
18607       FT_UINT8, BASE_HEX, NULL, 0,
18608       NULL, HFILL }},
18609
18610     {&hf_ieee80211_tag_measure_report_parent_tsf,
18611      {"Parent Timing Synchronization Function (TSF)", "wlan_mgt.measure.rep.parenttsf",
18612       FT_UINT32, BASE_HEX, NULL, 0,
18613       NULL, HFILL }},
18614
18615     {&hf_ieee80211_tag_quiet_count,
18616      {"Count", "wlan_mgt.quiet.count",
18617       FT_UINT8, BASE_DEC, NULL, 0,
18618       "Set to the number of TBTTs until the beacon interval during which the next quiet interval shall start", HFILL }},
18619
18620     {&hf_ieee80211_tag_quiet_period,
18621      {"Period", "wlan_mgt.quiet.period",
18622       FT_UINT8, BASE_DEC, NULL, 0,
18623       "Set to the number of beacon intervals between the start of regularly scheduled quiet intervals", HFILL }},
18624
18625     {&hf_ieee80211_tag_quiet_duration,
18626      {"Duration", "wlan_mgt.quiet.duration",
18627       FT_UINT16, BASE_DEC, NULL, 0,
18628       "Set to the duration of the quiet interval", HFILL }},
18629
18630     {&hf_ieee80211_tag_quiet_offset,
18631      {"Offset", "wlan_mgt.quiet.offset",
18632       FT_UINT16, BASE_DEC, NULL, 0,
18633       "Set to the offset of the start of the quiet interval from the TBTT", HFILL }},
18634
18635     {&hf_ieee80211_tag_dfs_owner,
18636      {"Owner", "wlan_mgt.dfs.owner",
18637       FT_ETHER, BASE_NONE, NULL, 0,
18638       "Set to the individual IEEE MAC address of the STA that is the currently known DFS Owner in the IBSS", HFILL  }},
18639
18640     {&hf_ieee80211_tag_dfs_recovery_interval,
18641      {"Recovery Interval", "wlan_mgt.dfs.recovery_interval",
18642       FT_UINT8, BASE_DEC, NULL, 0,
18643       "Indicates the time interval that shall be used for DFS owner recovery", HFILL  }},
18644
18645     {&hf_ieee80211_tag_dfs_channel_map,
18646      {"Channel Map", "wlan_mgt.dfs.channel_map",
18647       FT_NONE, BASE_NONE, NULL, 0,
18648       NULL, HFILL  }},
18649
18650     {&hf_ieee80211_tag_dfs_channel_number,
18651      {"Channel Number", "wlan_mgt.dfs.channel_number",
18652       FT_UINT8, BASE_DEC, NULL, 0,
18653       NULL, HFILL  }},
18654
18655     {&hf_ieee80211_tag_dfs_map,
18656      {"Map", "wlan_mgt.dfs.map",
18657       FT_UINT8, BASE_HEX, NULL, 0,
18658       NULL, HFILL  }},
18659
18660     {&hf_ieee80211_tag_erp_info,
18661      {"ERP Information", "wlan_mgt.erp_info",
18662       FT_UINT8, BASE_HEX, NULL, 0,
18663       NULL, HFILL  }},
18664
18665     {&hf_ieee80211_tag_erp_info_erp_present,
18666      {"Non ERP Present", "wlan_mgt.erp_info.erp_present",
18667       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
18668       NULL, HFILL  }},
18669
18670     {&hf_ieee80211_tag_erp_info_use_protection,
18671      {"Use Protection", "wlan_mgt.erp_info.use_protection",
18672       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
18673       NULL, HFILL  }},
18674
18675     {&hf_ieee80211_tag_erp_info_barker_preamble_mode,
18676      {"Barker Preamble Mode", "wlan_mgt.erp_info.barker_preamble_mode",
18677       FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
18678       NULL, HFILL  }},
18679
18680     {&hf_ieee80211_tag_erp_info_reserved,
18681      {"Reserved", "wlan_mgt.erp_info.reserved",
18682       FT_UINT8, BASE_HEX, NULL, 0xF8,
18683       NULL, HFILL  }},
18684
18685     /* Table 8-103-Capabilities field */
18686     {&hf_ieee80211_tag_extended_capabilities,
18687      {"Extended Capabilities", "wlan_mgt.extcap",
18688       FT_UINT8, BASE_HEX, NULL, 0,
18689       NULL, HFILL }},
18690
18691     /* P802.11n/D6.0 */
18692     /* Extended Capability octet 1 */
18693     {&hf_ieee80211_tag_extended_capabilities_b0,
18694      {"20/40 BSS Coexistence Management Support", "wlan_mgt.extcap.b0",
18695       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18696       "HT Information Exchange Support", HFILL }},
18697
18698     /* P802.11p/D4.0 */
18699     {&hf_ieee80211_tag_extended_capabilities_b1,
18700      {"On-demand beacon", "wlan_mgt.extcap.b1",
18701       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18702       NULL, HFILL }},
18703
18704     {&hf_ieee80211_tag_extended_capabilities_b2,
18705      {"Extended Channel Switching", "wlan_mgt.extcap.b2",
18706       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18707       NULL, HFILL }},
18708
18709     {&hf_ieee80211_tag_extended_capabilities_b3,
18710      {"WAVE indication", "wlan_mgt.extcap.b3",
18711       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
18712       NULL, HFILL }},
18713     /*End: P802.11p/D4.0 */
18714
18715     {&hf_ieee80211_tag_extended_capabilities_b4,
18716      {"PSMP Capability", "wlan_mgt.extcap.b4",
18717       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18718       NULL, HFILL }},
18719
18720     {&hf_ieee80211_tag_extended_capabilities_b5,
18721      {"Reserved", "wlan_mgt.extcap.b5",
18722       FT_UINT8, BASE_HEX, NULL, 0x20,
18723       "Must be zero", HFILL }},
18724
18725     {&hf_ieee80211_tag_extended_capabilities_b6,
18726      {"S-PSMP Support", "wlan_mgt.extcap.b6",
18727       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18728       NULL, HFILL }},
18729
18730     {&hf_ieee80211_tag_extended_capabilities_b7,
18731      {"Event", "wlan_mgt.extcap.b7",
18732       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18733       NULL, HFILL }},
18734
18735
18736     /* Extended Capability octet 2 */
18737     {&hf_ieee80211_tag_extended_capabilities_b8,
18738      {"Diagnostics", "wlan_mgt.extcap.b8",
18739       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18740       NULL, HFILL }},
18741
18742     {&hf_ieee80211_tag_extended_capabilities_b9,
18743      {"Multicast Diagnostics", "wlan_mgt.extcap.b9",
18744       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18745       NULL, HFILL }},
18746
18747     {&hf_ieee80211_tag_extended_capabilities_b10,
18748      {"Location Tracking", "wlan_mgt.extcap.b10",
18749       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18750       NULL, HFILL }},
18751
18752     {&hf_ieee80211_tag_extended_capabilities_b11,
18753      {"FMS", "wlan_mgt.extcap.b11",
18754       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
18755       NULL, HFILL }},
18756
18757     {&hf_ieee80211_tag_extended_capabilities_b12,
18758      {"Proxy ARP Service", "wlan_mgt.extcap.b12",
18759       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18760       NULL, HFILL }},
18761
18762     {&hf_ieee80211_tag_extended_capabilities_b13,
18763      {"Collocated Interference Reporting", "wlan_mgt.extcap.b13",
18764       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18765       NULL, HFILL }},
18766
18767     {&hf_ieee80211_tag_extended_capabilities_b14,
18768      {"Civic Location", "wlan_mgt.extcap.b14",
18769       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18770       NULL, HFILL }},
18771
18772     {&hf_ieee80211_tag_extended_capabilities_b15,
18773      {"Geospatial Location", "wlan_mgt.extcap.b15",
18774       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18775       NULL, HFILL }},
18776
18777
18778     /* Extended Capability octet 3 */
18779     {&hf_ieee80211_tag_extended_capabilities_b16,
18780      {"TFS", "wlan_mgt.extcap.b16",
18781       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18782       NULL, HFILL }},
18783
18784     {&hf_ieee80211_tag_extended_capabilities_b17,
18785      {"WNM-Sleep Mode", "wlan_mgt.extcap.b17",
18786       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18787       NULL, HFILL }},
18788
18789     {&hf_ieee80211_tag_extended_capabilities_b18,
18790      {"TIM Broadcast", "wlan_mgt.extcap.b18",
18791       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18792       NULL, HFILL }},
18793
18794     {&hf_ieee80211_tag_extended_capabilities_b19,
18795      {"BSS Transition", "wlan_mgt.extcap.b19",
18796       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
18797       NULL, HFILL }},
18798
18799     {&hf_ieee80211_tag_extended_capabilities_b20,
18800      {"QoS Traffic Capability", "wlan_mgt.extcap.b20",
18801       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18802       NULL, HFILL }},
18803
18804     {&hf_ieee80211_tag_extended_capabilities_b21,
18805      {"AC Station Count", "wlan_mgt.extcap.b21",
18806       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18807       NULL, HFILL }},
18808
18809     {&hf_ieee80211_tag_extended_capabilities_b22,
18810      {"Multiple BSSID", "wlan_mgt.extcap.b22",
18811       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18812       NULL, HFILL }},
18813
18814     {&hf_ieee80211_tag_extended_capabilities_b23,
18815      {"Timing Measurement", "wlan_mgt.extcap.b23",
18816       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18817       NULL, HFILL }},
18818
18819
18820     /* Extended Capability octet 4 */
18821     {&hf_ieee80211_tag_extended_capabilities_b24,
18822      {"Channel Usage", "wlan_mgt.extcap.b24",
18823       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18824       NULL, HFILL }},
18825
18826     {&hf_ieee80211_tag_extended_capabilities_b25,
18827      {"SSID List", "wlan_mgt.extcap.b25",
18828       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18829       NULL, HFILL }},
18830
18831     {&hf_ieee80211_tag_extended_capabilities_b26,
18832      {"DMS", "wlan_mgt.extcap.b26",
18833       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18834       NULL, HFILL }},
18835
18836     {&hf_ieee80211_tag_extended_capabilities_b27,
18837      {"UTC TSF Offset", "wlan_mgt.extcap.b27",
18838       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08,
18839       NULL, HFILL }},
18840
18841     {&hf_ieee80211_tag_extended_capabilities_b28,
18842      {"Peer U-APSD Buffer STA Support", "wlan_mgt.extcap.b28",
18843       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18844       NULL, HFILL }},
18845
18846     {&hf_ieee80211_tag_extended_capabilities_b29,
18847      {"TDLS Peer PSM Support", "wlan_mgt.extcap.b29",
18848       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18849       NULL, HFILL }},
18850
18851     {&hf_ieee80211_tag_extended_capabilities_b30,
18852      {"TDLS channel switching", "wlan_mgt.extcap.b30",
18853       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18854       NULL, HFILL }},
18855
18856     {&hf_ieee80211_tag_extended_capabilities_b31,
18857      {"Interworking", "wlan_mgt.extcap.b31",
18858       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18859       NULL, HFILL }},
18860
18861
18862     /* Extended Capability octet 5 */
18863     {&hf_ieee80211_tag_extended_capabilities_b32,
18864      {"QoS Map", "wlan_mgt.extcap.b32",
18865       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18866       NULL, HFILL }},
18867
18868     {&hf_ieee80211_tag_extended_capabilities_b33,
18869      {"EBR", "wlan_mgt.extcap.b33",
18870       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02,
18871       NULL, HFILL }},
18872
18873     {&hf_ieee80211_tag_extended_capabilities_b34,
18874      {"SSPN Interface", "wlan_mgt.extcap.b34",
18875       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04,
18876       NULL, HFILL }},
18877
18878     {&hf_ieee80211_tag_extended_capabilities_b35,
18879      {"Reserved", "wlan_mgt.extcap.b35",
18880       FT_UINT8, BASE_HEX, NULL, 0x08,
18881       "Must be zero", HFILL }},
18882
18883     {&hf_ieee80211_tag_extended_capabilities_b36,
18884      {"MSGCF Capability", "wlan_mgt.extcap.b36",
18885       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18886       NULL, HFILL }},
18887
18888     {&hf_ieee80211_tag_extended_capabilities_b37,
18889      {"TDLS support", "wlan_mgt.extcap.b37",
18890       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18891       NULL, HFILL }},
18892
18893     {&hf_ieee80211_tag_extended_capabilities_b38,
18894      {"TDLS Prohibited", "wlan_mgt.extcap.b38",
18895       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18896       NULL, HFILL }},
18897
18898     {&hf_ieee80211_tag_extended_capabilities_b39,
18899      {"TDLS Channel Switching Prohibited", "wlan_mgt.extcap.b39",
18900       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x80,
18901       NULL, HFILL }},
18902
18903
18904     /* Extended Capability octet 6 */
18905     {&hf_ieee80211_tag_extended_capabilities_b40,
18906      {"Reject Unadmitted Frame", "wlan_mgt.extcap.b40",
18907       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18908       NULL, HFILL }},
18909
18910     {&hf_ieee80211_tag_extended_capabilities_serv_int_granularity,
18911      {"Service Interval Granularity",
18912       "wlan_mgt.extcap.serv_int_granularity",
18913       FT_UINT8, BASE_DEC, VALS(service_interval_granularity_vals), 0x0e,
18914       NULL, HFILL }},
18915
18916     {&hf_ieee80211_tag_extended_capabilities_b44,
18917      {"Identifier Location", "wlan_mgt.extcap.b44",
18918       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x10,
18919       NULL, HFILL }},
18920
18921     {&hf_ieee80211_tag_extended_capabilities_b45,
18922      {"U-APSD Coexistence", "wlan_mgt.extcap.b45",
18923       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x20,
18924       NULL, HFILL }},
18925
18926     {&hf_ieee80211_tag_extended_capabilities_b46,
18927      {"WNM-Notification", "wlan_mgt.extcap.b46",
18928       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x40,
18929       NULL, HFILL }},
18930
18931     {&hf_ieee80211_tag_extended_capabilities_b47,
18932      {"Reserved", "wlan_mgt.extcap.b47",
18933       FT_UINT8, BASE_HEX, NULL, 0x80,
18934       "Must be zero", HFILL }},
18935
18936     /* Extended Capability octet 7 */
18937     {&hf_ieee80211_tag_extended_capabilities_b48,
18938      {"UTF-8 SSID", "wlan_mgt.extcap.b48",
18939       FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
18940       "The SSID in this BSS is interpreted using UTF-8 encoding", HFILL }},
18941
18942     {&hf_ieee80211_tag_extended_capabilities_o7,
18943      {"Reserved", "wlan_mgt.extcap.o7",
18944       FT_UINT8, BASE_HEX, NULL, 0xfe,
18945       "Must be zero", HFILL }},
18946
18947     /* Extended Capability octet 8 */
18948
18949     {&hf_ieee80211_tag_extended_capabilities_o8,
18950      {"Reserved", "wlan_mgt.extcap.o8",
18951       FT_UINT8, BASE_HEX, NULL, 0xff,
18952       "Must be zero", HFILL }},
18953
18954     {&hf_ieee80211_tag_cisco_ccx1_unknown,
18955      {"Unknown", "wlan_mgt.cisco.ccx1.unknown",
18956       FT_BYTES, BASE_NONE, NULL, 0,
18957       NULL, HFILL }},
18958
18959     {&hf_ieee80211_tag_cisco_ccx1_name,
18960      {"Name", "wlan_mgt.cisco.ccx1.name",
18961       FT_STRING, BASE_NONE, NULL, 0,
18962       NULL, HFILL }},
18963
18964     {&hf_ieee80211_tag_cisco_ccx1_clients,
18965      {"Clients", "wlan_mgt.cisco.ccx1.clients",
18966       FT_UINT8, BASE_DEC, NULL, 0,
18967       NULL, HFILL }},
18968
18969     {&hf_ieee80211_tag_cisco_ccx1_unknown2,
18970      {"Unknown2", "wlan_mgt.cisco.ccx1.unknown2",
18971       FT_BYTES, BASE_NONE, NULL, 0,
18972       NULL, HFILL }},
18973
18974     {&hf_ieee80211_tag_neighbor_report_bssid,
18975      {"BSSID", "wlan_mgt.nreport.bssid",
18976       FT_ETHER, BASE_NONE, NULL, 0,
18977       NULL, HFILL }},
18978
18979     {&hf_ieee80211_tag_neighbor_report_bssid_info,
18980      {"BSSID Information", "wlan_mgt.nreport.bssid.info",
18981       FT_UINT32, BASE_HEX, NULL, 0,
18982       NULL, HFILL }},
18983
18984     {&hf_ieee80211_tag_neighbor_report_bssid_info_reachability,
18985      {"AP Reachability", "wlan_mgt.nreport.bssid.info.reachability",
18986       FT_UINT16, BASE_HEX, NULL, 0x0003,
18987       NULL, HFILL }},
18988
18989     {&hf_ieee80211_tag_neighbor_report_bssid_info_security,
18990      {"Security", "wlan_mgt.nreport.bssid.info.security",
18991       FT_UINT16, BASE_HEX, NULL, 0x0004,
18992       NULL, HFILL }},
18993
18994     {&hf_ieee80211_tag_neighbor_report_bssid_info_key_scope,
18995      {"Key Scope", "wlan_mgt.nreport.bssid.info.keyscope",
18996       FT_UINT16, BASE_HEX, NULL, 0x0008,
18997       NULL, HFILL }},
18998
18999     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_spec_mng,
19000      {"Capability: Spectrum Management", "wlan_mgt.nreport.bssid.info.capability.specmngt",
19001       FT_UINT16, BASE_HEX, NULL, 0x0010,
19002       NULL, HFILL }},
19003
19004     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_qos,
19005      {"Capability: QoS", "wlan_mgt.nreport.bssid.info.capability.qos",
19006       FT_UINT16, BASE_HEX, NULL, 0x0020,
19007       NULL, HFILL }},
19008
19009     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_apsd,
19010      {"Capability: APSD", "wlan_mgt.nreport.bssid.info.capability.apsd",
19011       FT_UINT16, BASE_HEX, NULL, 0x0040,
19012       NULL, HFILL }},
19013
19014     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_radio_msnt,
19015      {"Capability: Radio Measurement", "wlan_mgt.nreport.bssid.info.capability.radiomsnt",
19016       FT_UINT16, BASE_HEX, NULL, 0x0080,
19017       NULL, HFILL }},
19018
19019     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_dback,
19020      {"Capability: Delayed Block Ack", "wlan_mgt.nreport.bssid.info.capability.dback",
19021       FT_UINT16, BASE_HEX, NULL, 0x0100,
19022       NULL, HFILL }},
19023
19024     {&hf_ieee80211_tag_neighbor_report_bssid_info_capability_iback,
19025      {"Capability: Immediate Block Ack", "wlan_mgt.nreport.bssid.info.capability.iback",
19026       FT_UINT16, BASE_HEX, NULL, 0x0200,
19027       NULL, HFILL }},
19028
19029     {&hf_ieee80211_tag_neighbor_report_bssid_info_mobility_domain,
19030      {"Mobility Domain", "wlan_mgt.nreport.bssid.info.mobilitydomain",
19031       FT_UINT16, BASE_HEX, NULL, 0x0400,
19032       NULL, HFILL }},
19033
19034     {&hf_ieee80211_tag_neighbor_report_bssid_info_high_throughput,
19035      {"High Throughput", "wlan_mgt.nreport.bssid.info.hthoughput",
19036       FT_UINT16, BASE_HEX, NULL, 0x0800,
19037       NULL, HFILL }},
19038
19039     {&hf_ieee80211_tag_neighbor_report_bssid_info_reserved,
19040      {"Reserved", "wlan_mgt.nreport.bssid.info.reserved",
19041       FT_UINT32, BASE_HEX, NULL, 0,
19042       NULL, HFILL }},
19043
19044     {&hf_ieee80211_tag_neighbor_report_reg_class,
19045      {"Regulatory Class", "wlan_mgt.nreport.regclass",
19046       FT_UINT8, BASE_HEX, NULL, 0,
19047       NULL, HFILL }},
19048
19049     {&hf_ieee80211_tag_neighbor_report_channel_number,
19050      {"Channel Number", "wlan_mgt.nreport.channumber",
19051       FT_UINT8, BASE_HEX, NULL, 0,
19052       NULL, HFILL }},
19053
19054     {&hf_ieee80211_tag_neighbor_report_phy_type,
19055      {"PHY Type", "wlan_mgt.nreport.phytype",
19056       FT_UINT8, BASE_HEX, NULL, 0,
19057       NULL, HFILL }},
19058
19059     {&hf_ieee80211_tag_supported_reg_classes_current,
19060      {"Current Regulatory Class", "wlan_mgt.supregclass.current",
19061       FT_UINT8, BASE_HEX, NULL, 0,
19062       NULL, HFILL }},
19063
19064     {&hf_ieee80211_tag_supported_reg_classes_alternate,
19065      {"Alternate Regulatory Classes", "wlan_mgt.supregclass.alt",
19066       FT_STRING, BASE_NONE, NULL, 0,
19067       NULL, HFILL }},
19068
19069     {&hf_ieee80211_wfa_ie_type,
19070      {"Type", "wlan_mgt.wfa.ie.type",
19071       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_type_vals), 0,
19072       NULL, HFILL }},
19073
19074     {&hf_ieee80211_wfa_ie_wpa_version,
19075      {"WPA Version", "wlan_mgt.wfa.ie.wpa.version",
19076       FT_UINT16, BASE_DEC, NULL, 0,
19077       NULL, HFILL }},
19078
19079     {&hf_ieee80211_wfa_ie_wpa_mcs,
19080      {"Multicast Cipher Suite", "wlan_mgt.wfa.ie.wpa.mcs",
19081       FT_UINT32, BASE_CUSTOM, wpa_mcs_base_custom, 0,
19082       "Contains the cipher suite selector used by the BSS to protect broadcast/multicasttraffic", HFILL }},
19083
19084     {&hf_ieee80211_wfa_ie_wpa_mcs_oui,
19085      {"Multicast Cipher Suite OUI", "wlan_mgt.wfa.ie.wpa.mcs.oui",
19086       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
19087       NULL, HFILL }},
19088
19089     {&hf_ieee80211_wfa_ie_wpa_mcs_type,
19090      {"Multicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.mcs.type",
19091       FT_UINT8, BASE_DEC, NULL, 0,
19092       NULL, HFILL }},
19093
19094     {&hf_ieee80211_wfa_ie_wpa_mcs_wfa_type,
19095      {"Multicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.mcs.type",
19096       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
19097       NULL, HFILL }},
19098
19099     {&hf_ieee80211_wfa_ie_wpa_ucs_count,
19100      {"Unicast Cipher Suite Count", "wlan_mgt.wfa.ie.wpa.ucs.count",
19101       FT_UINT16, BASE_DEC, NULL, 0,
19102       "Indicates the number of pairwise cipher suite selectors that are contained in the Unicast Cipher Suite List", HFILL }},
19103
19104     {&hf_ieee80211_wfa_ie_wpa_ucs_list,
19105      {"Unicast Cipher Suite List", "wlan_mgt.wfa.ie.wpa.ucs.list",
19106       FT_NONE, BASE_NONE, NULL, 0,
19107       "Contains a series of cipher suite selectors that indicate the Unicast cipher suites", HFILL }},
19108
19109     {&hf_ieee80211_wfa_ie_wpa_ucs,
19110      {"Unicast Cipher Suite", "wlan_mgt.wfa.ie.wpa.ucs",
19111       FT_UINT32, BASE_CUSTOM, wpa_ucs_base_custom, 0,
19112       NULL, HFILL }},
19113
19114     {&hf_ieee80211_wfa_ie_wpa_ucs_oui,
19115      {"Unicast Cipher Suite OUI", "wlan_mgt.wfa.ie.wpau.cs.oui",
19116       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
19117       NULL, HFILL }},
19118
19119     {&hf_ieee80211_wfa_ie_wpa_ucs_type,
19120      {"Unicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.ucs.type",
19121       FT_UINT8, BASE_DEC, NULL, 0,
19122       NULL, HFILL }},
19123
19124     {&hf_ieee80211_wfa_ie_wpa_ucs_wfa_type,
19125      {"Unicast Cipher Suite type", "wlan_mgt.wfa.ie.wpa.ucs.type",
19126       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_cipher_vals), 0,
19127       NULL, HFILL }},
19128
19129     {&hf_ieee80211_wfa_ie_wpa_akms_count,
19130      {"Auth Key Management (AKM) Suite Count", "wlan_mgt.wfa.ie.wpa.akms.count",
19131       FT_UINT16, BASE_DEC, NULL, 0,
19132       "Indicates the number of Auth Key Management suite selectors that are contained in the Auth Key Management Suite List", HFILL }},
19133
19134     {&hf_ieee80211_wfa_ie_wpa_akms_list,
19135      {"Auth Key Management (AKM) List", "wlan_mgt.wfa.ie.wpa.akms.list",
19136       FT_NONE, BASE_NONE, NULL, 0,
19137       "Contains a series of cipher suite selectors that indicate the AKM suites", HFILL }},
19138
19139     {&hf_ieee80211_wfa_ie_wpa_akms,
19140      {"Auth Key Management (AKM) Suite", "wlan_mgt.wfa.ie.wpa.akms",
19141       FT_UINT32, BASE_CUSTOM, wpa_akms_base_custom, 0,
19142       NULL, HFILL }},
19143
19144     {&hf_ieee80211_wfa_ie_wpa_akms_oui,
19145      {"Auth Key Management (AKM) OUI", "wlan_mgt.wfa.ie.wpa.akms.oui",
19146       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
19147       NULL, HFILL }},
19148
19149     {&hf_ieee80211_wfa_ie_wpa_akms_type,
19150      {"Auth Key Management (AKM) type", "wlan_mgt.wfa.ie.wpa.akms.type",
19151       FT_UINT8, BASE_DEC, NULL, 0,
19152       NULL, HFILL }},
19153
19154     {&hf_ieee80211_wfa_ie_wpa_akms_wfa_type,
19155      {"Auth Key Management (AKM) type", "wlan_mgt.wfa.ie.wpa.type",
19156       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wpa_keymgmt_vals), 0,
19157       NULL, HFILL }},
19158
19159     {&hf_ieee80211_wfa_ie_wme_subtype,
19160      {"WME Subtype", "wlan_mgt.wfa.ie.wme.subtype",
19161       FT_UINT8, BASE_DEC, VALS(ieee802111_wfa_ie_wme_type), 0,
19162       NULL, HFILL }},
19163
19164     {&hf_ieee80211_wfa_ie_wme_version,
19165      {"WME Version", "wlan_mgt.wfa.ie.wme.version",
19166       FT_UINT8, BASE_DEC, NULL, 0,
19167       NULL, HFILL }},
19168
19169     {&hf_ieee80211_wfa_ie_wme_qos_info,
19170      {"WME QoS Info", "wlan_mgt.wfa.ie.wme.qos_info",
19171       FT_UINT8, BASE_HEX, NULL, 0,
19172       NULL, HFILL }},
19173
19174     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_max_sp_length,
19175      {"Max SP Length", "wlan_mgt.wfa.ie.wme.qos_info.sta.max_sp_length",
19176       FT_UINT8, BASE_HEX, VALS(ieee802111_wfa_ie_wme_qos_info_sta_max_sp_length_vals), 0x60,
19177       NULL, HFILL }},
19178
19179     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_be,
19180      {"AC_BE", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_be",
19181       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x08,
19182       NULL, HFILL }},
19183
19184     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_bk,
19185      {"AC_BK", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_bk",
19186       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x04,
19187       NULL, HFILL }},
19188
19189     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vi,
19190      {"AC_VI", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_vi",
19191       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x02,
19192       NULL, HFILL }},
19193
19194     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_ac_vo,
19195      {"AC_VO", "wlan_mgt.wfa.ie.wme.qos_info.sta.ac_vo",
19196       FT_BOOLEAN, 8, TFS(&ieee802111_wfa_ie_wme_qos_info_sta_ac_tfs), 0x01,
19197       NULL, HFILL }},
19198
19199     {&hf_ieee80211_wfa_ie_wme_qos_info_sta_reserved,
19200      {"Reserved", "wlan_mgt.wfa.ie.wme.qos_info.sta.reserved",
19201       FT_UINT8, BASE_HEX, NULL, 0x90,
19202       "Must Be Zero", HFILL }},
19203
19204     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_u_apsd,
19205      {"U-APSD", "wlan_mgt.wfa.ie.wme.qos_info.ap.u_apsd",
19206       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
19207       "Indicates the WMM AP is currently supporting unscheduled automatic power save delivery", HFILL }},
19208
19209     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_parameter_set_count,
19210      {"Parameter Set Count", "wlan_mgt.wfa.ie.wme.qos_info.ap.parameter_set_count",
19211       FT_UINT8, BASE_HEX, NULL, 0x0F,
19212       NULL, HFILL }},
19213
19214     {&hf_ieee80211_wfa_ie_wme_qos_info_ap_reserved,
19215      {"Reserved", "wlan_mgt.wfa.ie.wme.qos_info.ap.reserved",
19216       FT_UINT8, BASE_HEX, NULL, 0x70,
19217       "Must Be Zero", HFILL }},
19218
19219     {&hf_ieee80211_wfa_ie_wme_reserved,
19220      {"Reserved", "wlan_mgt.wfa.ie.wme.reserved",
19221       FT_BYTES, BASE_NONE, NULL, 0,
19222       "Must Be Zero", HFILL }},
19223
19224     {&hf_ieee80211_wfa_ie_wme_ac_parameters,
19225      {"Ac Parameters", "wlan_mgt.wfa.ie.wme.acp",
19226       FT_NONE, BASE_NONE, NULL, 0,
19227       NULL, HFILL }},
19228
19229     {&hf_ieee80211_wfa_ie_wme_acp_aci_aifsn,
19230      {"ACI / AIFSN Field", "wlan_mgt.wfa.ie.wme.acp.aci_aifsn",
19231       FT_UINT8, BASE_HEX, NULL, 0,
19232       NULL, HFILL }},
19233
19234     {&hf_ieee80211_wfa_ie_wme_acp_aci,
19235      {"ACI", "wlan_mgt.wfa.ie.wme.acp.aci",
19236       FT_UINT8, BASE_DEC, VALS(ieee80211_wfa_ie_wme_acs_vals), 0x60,
19237       NULL, HFILL }},
19238
19239     {&hf_ieee80211_wfa_ie_wme_acp_acm,
19240      {"Admission Control Mandatory", "wlan_mgt.wfa.ie.wme.acp.aci",
19241       FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
19242       NULL, HFILL }},
19243
19244     {&hf_ieee80211_wfa_ie_wme_acp_aifsn,
19245      {"AIFSN", "wlan_mgt.wfa.ie.wme.acp.aifsn",
19246       FT_UINT8, BASE_DEC, NULL, 0x0F,
19247       NULL, HFILL }},
19248
19249     {&hf_ieee80211_wfa_ie_wme_acp_reserved,
19250      {"Reserved", "wlan_mgt.wfa.ie.wme.acp.reserved",
19251       FT_UINT8, BASE_DEC, NULL, 0x80,
19252       "Must be Zero", HFILL }},
19253
19254     {&hf_ieee80211_wfa_ie_wme_acp_ecw,
19255      {"ECW", "wlan_mgt.wfa.ie.wme.acp.ecw",
19256       FT_UINT8, BASE_HEX, NULL, 0x00,
19257       NULL, HFILL }},
19258
19259     {&hf_ieee80211_wfa_ie_wme_acp_ecw_max,
19260      {"ECW Max", "wlan_mgt.wfa.ie.wme.acp.ecw.max",
19261       FT_UINT8, BASE_DEC, NULL, 0xF0,
19262       NULL, HFILL }},
19263
19264     {&hf_ieee80211_wfa_ie_wme_acp_ecw_min,
19265      {"ECW Min", "wlan_mgt.wfa.ie.wme.acp.ecw.min",
19266       FT_UINT8, BASE_DEC, NULL, 0x0F,
19267       NULL, HFILL }},
19268
19269     {&hf_ieee80211_wfa_ie_wme_acp_txop_limit,
19270      {"TXOP Limit", "wlan_mgt.wfa.ie.wme.acp.txop_limit",
19271       FT_UINT16, BASE_DEC, NULL, 0x00,
19272       NULL, HFILL }},
19273
19274     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo,
19275      {"TS Info", "wlan_mgt.wfa.ie.wme.tspec.ts_info",
19276       FT_UINT24, BASE_HEX, NULL, 0,
19277       "Traffic Stream (TS) Info", HFILL }},
19278
19279     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_tid,
19280      {"TID", "wlan_mgt.wfa.ie.wme.tspec.ts_info.tid",
19281       FT_UINT24, BASE_DEC, NULL, 0x00001E,
19282       "Traffic Stream Info ID (TID)", HFILL }},
19283
19284     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_direction,
19285      {"Direction", "wlan_mgt.wfa.ie.wme.tspec.ts_info.dir",
19286       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_direction_vals), 0x000060,
19287       "Traffic Stream (TS) Info Direction", HFILL }},
19288
19289     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_psb,
19290      {"PSB", "wlan_mgt.wfa.ie.wme.tspec.ts_info.psb",
19291       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_psb_vals), 0x000400,
19292       "Traffic Stream (TS) Info Power Save Behavior (PSB)", HFILL }},
19293
19294     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_up,
19295      {"UP", "wlan_mgt.wfa.ie.wme.tspec.ts_info.up",
19296       FT_UINT24, BASE_DEC, VALS(ieee80211_wfa_ie_wme_tspec_tsinfo_up_vals), 0x003800,
19297       "Traffic Stream (TS) Info User Priority (UP)", HFILL }},
19298
19299     {&hf_ieee80211_wfa_ie_wme_tspec_tsinfo_reserved,
19300      {"Reserved", "wlan_mgt.wfa.ie.wme.tspec.ts_info.reserved",
19301       FT_UINT24, BASE_HEX, NULL, 0xFFC381,
19302       "Must be Zero", HFILL }},
19303
19304     {&hf_ieee80211_wfa_ie_wme_tspec_nor_msdu,
19305      {"Normal MSDU Size", "wlan_mgt.wfa.ie.wme.tspec.nor_msdu",
19306       FT_UINT16, BASE_DEC, NULL, 0,
19307       NULL, HFILL }},
19308
19309     {&hf_ieee80211_wfa_ie_wme_tspec_max_msdu,
19310      {"Maximum MSDU Size", "wlan_mgt.wfa.ie.wme.tspec.max_msdu",
19311       FT_UINT16, BASE_DEC, NULL, 0,
19312       NULL, HFILL }},
19313
19314     {&hf_ieee80211_wfa_ie_wme_tspec_min_srv,
19315      {"Minimum Service Interval", "wlan_mgt.wfa.ie.wme.tspec.min_srv",
19316       FT_UINT32, BASE_DEC, NULL, 0,
19317       NULL, HFILL }},
19318
19319     {&hf_ieee80211_wfa_ie_wme_tspec_max_srv,
19320      {"Maximum Service Interval", "wlan_mgt.wfa.ie.wme.tspec.max_srv",
19321       FT_UINT32, BASE_DEC, NULL, 0,
19322       NULL, HFILL }},
19323
19324     {&hf_ieee80211_wfa_ie_wme_tspec_inact_int,
19325      {"Inactivity Interval", "wlan_mgt.wfa.ie.wme.tspec.inact_int",
19326       FT_UINT32, BASE_DEC, NULL, 0,
19327       NULL, HFILL }},
19328
19329     {&hf_ieee80211_wfa_ie_wme_tspec_susp_int,
19330      {"Suspension Interval", "wlan_mgt.wfa.ie.wme.tspec.susp_int",
19331       FT_UINT32, BASE_DEC, NULL, 0,
19332       NULL, HFILL }},
19333
19334     {&hf_ieee80211_wfa_ie_wme_tspec_srv_start,
19335      {"Service Start Time", "wlan_mgt.wfa.ie.wme.tspec.srv_start",
19336       FT_UINT32, BASE_DEC, NULL, 0,
19337       NULL, HFILL }},
19338
19339     {&hf_ieee80211_wfa_ie_wme_tspec_min_data,
19340      {"Minimum Data Rate", "wlan_mgt.wfa.ie.wme.tspec.min_data",
19341       FT_UINT32, BASE_DEC, NULL, 0,
19342       NULL, HFILL }},
19343
19344     {&hf_ieee80211_wfa_ie_wme_tspec_mean_data,
19345      {"Mean Data Rate", "wlan_mgt.wfa.ie.wme.tspec.mean_data",
19346       FT_UINT32, BASE_DEC, NULL, 0,
19347       NULL, HFILL }},
19348
19349     {&hf_ieee80211_wfa_ie_wme_tspec_peak_data,
19350      {"Peak Data Rate", "wlan_mgt.wfa.ie.wme.tspec.peak_data",
19351       FT_UINT32, BASE_DEC, NULL, 0,
19352       NULL, HFILL }},
19353
19354     {&hf_ieee80211_wfa_ie_wme_tspec_burst_size,
19355      {"Burst Size", "wlan_mgt.wfa.ie.wme.tspec.burst_size",
19356       FT_UINT32, BASE_DEC, NULL, 0,
19357       NULL, HFILL }},
19358
19359     {&hf_ieee80211_wfa_ie_wme_tspec_delay_bound,
19360      {"Delay Bound", "wlan_mgt.wfa.ie.wme.tspec.delay_bound",
19361       FT_UINT32, BASE_DEC, NULL, 0,
19362       NULL, HFILL }},
19363
19364     {&hf_ieee80211_wfa_ie_wme_tspec_min_phy,
19365      {"Minimum PHY Rate", "wlan_mgt.wfa.ie.wme.tspec.min_phy",
19366       FT_UINT32, BASE_DEC, NULL, 0,
19367       NULL, HFILL }},
19368
19369     {&hf_ieee80211_wfa_ie_wme_tspec_surplus,
19370      {"Surplus Bandwidth Allowance", "wlan_mgt.wfa.ie.wme.tspec.surplus",
19371       FT_UINT16, BASE_DEC, NULL, 0,
19372       NULL, HFILL }},
19373
19374     {&hf_ieee80211_wfa_ie_wme_tspec_medium,
19375      {"Medium Time", "wlan_mgt.wfa.ie.wme.tspec.medium",
19376       FT_UINT16, BASE_DEC, NULL, 0,
19377       NULL, HFILL }},
19378
19379     {&hf_ieee80211_rsn_ie_pmkid,
19380      {"RSN PMKID", "wlan_mgt.rsn.ie.pmkid",
19381       FT_BYTES, BASE_NONE, NULL, 0,
19382       NULL, HFILL }},
19383
19384     {&hf_ieee80211_rsn_ie_unknown,
19385      {"RSN Unknown", "wlan_mgt.rsn.ie.unknown",
19386       FT_BYTES, BASE_NONE, NULL, 0,
19387       NULL, HFILL }},
19388
19389     {&hf_ieee80211_marvell_ie_type,
19390      {"Type", "wlan_mgt.marvell.ie.type",
19391       FT_UINT8, BASE_HEX, NULL, 0,
19392       NULL, HFILL }},
19393
19394     {&hf_ieee80211_marvell_ie_mesh_subtype,
19395      {"Subtype", "wlan_mgt.marvell.ie.subtype",
19396       FT_UINT8, BASE_HEX, NULL, 0,
19397       NULL, HFILL }},
19398
19399     {&hf_ieee80211_marvell_ie_mesh_version,
19400      {"Version", "wlan_mgt.marvell.ie.version",
19401       FT_UINT8, BASE_HEX, NULL, 0,
19402       NULL, HFILL }},
19403
19404     {&hf_ieee80211_marvell_ie_mesh_active_proto_id,
19405      {"Path Selection Protocol", "wlan_mgt.marvell.ie.proto_id",
19406       FT_UINT8, BASE_HEX, VALS(mesh_path_selection_codes), 0,
19407       NULL, HFILL }},
19408
19409     {&hf_ieee80211_marvell_ie_mesh_active_metric_id,
19410      {"Path Selection Metric", "wlan_mgt.marvell.ie.metric_id",
19411       FT_UINT8, BASE_HEX, VALS(mesh_metric_codes), 0,
19412       NULL, HFILL }},
19413
19414     {&hf_ieee80211_marvell_ie_mesh_cap,
19415      {"Mesh Capabilities", "wlan_mgt.marvell.ie.cap",
19416       FT_UINT8, BASE_HEX, NULL, 0,
19417       NULL, HFILL }},
19418
19419     {&hf_ieee80211_marvell_ie_data,
19420      { "Marvell IE data", "wlan_mgt.marvell.data",
19421        FT_BYTES, BASE_NONE, NULL, 0x0,
19422        NULL, HFILL }},
19423
19424     {&hf_ieee80211_atheros_ie_type,
19425      {"Type", "wlan_mgt.atheros.ie.type",
19426       FT_UINT8, BASE_HEX, VALS(atheros_ie_type_vals), 0,
19427       NULL, HFILL }},
19428
19429     {&hf_ieee80211_atheros_ie_subtype,
19430      {"Subtype", "wlan_mgt.atheros.ie.subtype",
19431       FT_UINT8, BASE_HEX, NULL, 0,
19432       NULL, HFILL }},
19433
19434     {&hf_ieee80211_atheros_ie_version,
19435      {"Version", "wlan_mgt.atheros.ie.version",
19436       FT_UINT8, BASE_HEX, NULL, 0,
19437       NULL, HFILL }},
19438
19439     {&hf_ieee80211_atheros_ie_cap_f_turbop,
19440      {"Turbo Prime", "wlan_mgt.ie.atheros.capabilities.turbop",
19441       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_TURBOP,
19442       NULL, HFILL }},
19443
19444     {&hf_ieee80211_atheros_ie_cap_f_comp,
19445      {"Compression", "wlan_mgt.ie.atheros.capabilities.comp",
19446       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_COMP,
19447       NULL, HFILL }},
19448
19449     {&hf_ieee80211_atheros_ie_cap_f_ff,
19450      {"Fast Frames", "wlan_mgt.ie.atheros.capabilities.ff",
19451       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_FF,
19452       NULL, HFILL }},
19453
19454     {&hf_ieee80211_atheros_ie_cap_f_xr,
19455      {"eXtended Range", "wlan_mgt.ie.atheros.capabilities.xr",
19456       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_XR,
19457       NULL, HFILL }},
19458
19459     {&hf_ieee80211_atheros_ie_cap_f_ar,
19460      {"Advanced Radar", "wlan_mgt.ie.atheros.capabilities.ar",
19461       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_AR,
19462       NULL, HFILL }},
19463
19464     {&hf_ieee80211_atheros_ie_cap_f_burst,
19465      {"Burst", "wlan_mgt.ie.atheros.capabilities.burst",
19466       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BURST,
19467       NULL, HFILL }},
19468
19469     {&hf_ieee80211_atheros_ie_cap_f_wme,
19470      {"CWMin tuning", "wlan_mgt.ie.atheros.capabilities.wme",
19471       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_WME,
19472       NULL, HFILL }},
19473
19474     {&hf_ieee80211_atheros_ie_cap_f_boost,
19475      {"Boost", "wlan_mgt.ie.atheros.capabilities.boost",
19476       FT_BOOLEAN, 8, NULL, ATHEROS_IE_CAP_BOOST,
19477       NULL, HFILL }},
19478
19479     {&hf_ieee80211_atheros_ie_advcap_cap,
19480      {"Capabilities", "wlan_mgt.atheros.ie.advcap.cap",
19481       FT_UINT8, BASE_HEX, NULL, 0,
19482       NULL, HFILL }},
19483
19484     {&hf_ieee80211_atheros_ie_advcap_defkey,
19485      {"Default key index", "wlan_mgt.atheros.ie.advcap.defkey",
19486       FT_UINT16, BASE_HEX, NULL, 0,
19487       NULL, HFILL }},
19488
19489     {&hf_ieee80211_atheros_ie_xr_info,
19490      {"Info", "wlan_mgt.atheros.ie.xr.info",
19491       FT_UINT8, BASE_HEX, NULL, 0,
19492       NULL, HFILL }},
19493
19494     {&hf_ieee80211_atheros_ie_xr_base_bssid,
19495      {"Base BSS Id", "wlan_mgt.atheros.ie.xr.base_bssid",
19496       FT_ETHER, BASE_NONE, NULL, 0,
19497       NULL, HFILL }},
19498
19499     {&hf_ieee80211_atheros_ie_xr_xr_bssid,
19500      {"XR BSS Id", "wlan_mgt.atheros.ie.xr.xr_bssid",
19501       FT_ETHER, BASE_NONE, NULL, 0,
19502       NULL, HFILL }},
19503
19504     {&hf_ieee80211_atheros_ie_xr_xr_beacon,
19505      {"XR Beacon Interval", "wlan_mgt.atheros.ie.xr.xr_beacon",
19506       FT_UINT32, BASE_CUSTOM, beacon_interval_base_custom, 0,
19507       NULL, HFILL }},
19508
19509     {&hf_ieee80211_atheros_ie_xr_base_cap,
19510      {"Base capabilities", "wlan_mgt.atheros.ie.xr.base_cap",
19511       FT_UINT8, BASE_HEX, NULL, 0,
19512       NULL, HFILL }},
19513
19514     {&hf_ieee80211_atheros_ie_xr_xr_cap,
19515      {"XR capabilities", "wlan_mgt.atheros.ie.xr.xr_cap",
19516       FT_UINT8, BASE_HEX, NULL, 0,
19517       NULL, HFILL }},
19518
19519     {&hf_ieee80211_atheros_ie_data,
19520      {"Atheros IE data", "wlan_mgt.atheros.data",
19521       FT_BYTES, BASE_NONE, NULL, 0,
19522       NULL, HFILL }},
19523
19524     {&hf_ieee80211_aironet_ie_type,
19525      {"Aironet IE type", "wlan_mgt.aironet.type",
19526       FT_UINT8, BASE_DEC, VALS(aironet_ie_type_vals), 0,
19527       NULL, HFILL }},
19528
19529     {&hf_ieee80211_aironet_ie_version,
19530      {"Aironet IE CCX version?", "wlan_mgt.aironet.version",
19531       FT_UINT8, BASE_DEC, NULL, 0,
19532       NULL, HFILL }},
19533
19534     {&hf_ieee80211_aironet_ie_data,
19535      { "Aironet IE data", "wlan_mgt.aironet.data",
19536        FT_BYTES, BASE_NONE, NULL, 0x0,
19537        NULL, HFILL }},
19538
19539     {&hf_ieee80211_qbss_version,
19540      {"QBSS Version", "wlan_mgt.qbss.version",
19541       FT_UINT8, BASE_DEC, NULL, 0,
19542       NULL, HFILL }},
19543
19544     {&hf_ieee80211_qbss_scount,
19545      {"Station Count", "wlan_mgt.qbss.scount",
19546       FT_UINT16, BASE_DEC, NULL, 0,
19547       NULL, HFILL }},
19548
19549     {&hf_ieee80211_qbss_cu,
19550      {"Channel Utilization", "wlan_mgt.qbss.cu",
19551       FT_UINT8, BASE_DEC, NULL, 0,
19552       NULL, HFILL }},
19553
19554     {&hf_ieee80211_qbss_adc,
19555      {"Available Admission Capabilities", "wlan_mgt.qbss.adc",
19556       FT_UINT8, BASE_DEC, NULL, 0,
19557       NULL, HFILL }},
19558
19559     {&hf_ieee80211_qbss2_cu,
19560      {"Channel Utilization", "wlan_mgt.qbss2.cu",
19561       FT_UINT8, BASE_DEC, NULL, 0,
19562       NULL, HFILL }},
19563
19564     {&hf_ieee80211_qbss2_gl,
19565      {"G.711 CU Quantum", "wlan_mgt.qbss2.glimit",
19566       FT_UINT8, BASE_DEC, NULL, 0,
19567       NULL, HFILL }},
19568
19569     {&hf_ieee80211_qbss2_cal,
19570      {"Call Admission Limit", "wlan_mgt.qbss2.cal",
19571       FT_UINT8, BASE_DEC, NULL, 0,
19572       NULL, HFILL }},
19573
19574     {&hf_ieee80211_qbss2_scount,
19575      {"Station Count", "wlan_mgt.qbss2.scount",
19576       FT_UINT16, BASE_DEC, NULL, 0,
19577       NULL, HFILL }},
19578
19579     {&hf_ieee80211_aironet_ie_qos_reserved,
19580      {"Aironet IE QoS reserved", "wlan_mgt.aironet.qos.reserved",
19581       FT_UINT8, BASE_HEX, NULL, 0,
19582       NULL, HFILL }},
19583
19584     {&hf_ieee80211_aironet_ie_qos_paramset,
19585      {"Aironet IE QoS paramset", "wlan_mgt.aironet.qos.paramset",
19586       FT_UINT8, BASE_DEC, NULL, 0,
19587       NULL, HFILL }},
19588
19589     {&hf_ieee80211_aironet_ie_qos_val,
19590      {"Aironet IE QoS valueset", "wlan_mgt.aironet.qos.val",
19591       FT_BYTES, BASE_NONE, NULL, 0,
19592       NULL, HFILL }},
19593
19594     /* Vendor Specific : Aruba Networks */
19595     {&hf_ieee80211_vs_aruba_subtype,
19596      {"Subtype", "wlan_mgt.vs.aruba.subtype",
19597       FT_UINT8, BASE_DEC, VALS(ieee80211_vs_aruba_subtype_vals), 0,
19598       NULL, HFILL }},
19599
19600     {&hf_ieee80211_vs_aruba_apname,
19601      {"AP Name", "wlan_mgt.vs.aruba.ap_name",
19602       FT_STRINGZ, BASE_NONE, NULL, 0,
19603       NULL, HFILL }},
19604
19605     {&hf_ieee80211_vs_aruba_data,
19606      {"Data", "wlan_mgt.vs.aruba.data",
19607       FT_BYTES, BASE_NONE, NULL, 0,
19608       NULL, HFILL }},
19609
19610     {&hf_ieee80211_tsinfo,
19611      {"Traffic Stream (TS) Info", "wlan_mgt.ts_info",
19612       FT_UINT24, BASE_HEX, NULL, 0,
19613       "Traffic Stream (TS) Info field", HFILL }},
19614
19615     {&hf_ieee80211_tsinfo_type,
19616      {"Traffic Type", "wlan_mgt.ts_info.type",
19617       FT_UINT24, BASE_DEC, VALS(tsinfo_type), 0x000001,
19618       "Traffic Stream (TS) Info Traffic Type", HFILL }},
19619
19620     {&hf_ieee80211_tsinfo_tsid,
19621      {"Traffic Stream ID (TSID)", "wlan_mgt.ts_info.tsid",
19622       FT_UINT24, BASE_DEC, NULL, 0x00001E,
19623       "Traffic Stream ID (TSID) Info TSID", HFILL }},
19624
19625     {&hf_ieee80211_tsinfo_dir,
19626      {"Direction", "wlan_mgt.ts_info.dir",
19627       FT_UINT24, BASE_DEC, VALS(tsinfo_direction), 0x000060,
19628       "Traffic Stream (TS) Info Direction", HFILL }},
19629
19630     {&hf_ieee80211_tsinfo_access,
19631      {"Access Policy", "wlan_mgt.ts_info.dir",
19632       FT_UINT24, BASE_DEC, VALS(tsinfo_access), 0x000180,
19633       "Traffic Stream (TS) Info Access Policy", HFILL }},
19634
19635     {&hf_ieee80211_tsinfo_agg,
19636      {"Aggregation", "wlan_mgt.ts_info.agg",
19637       FT_UINT24, BASE_DEC, NULL, 0x000200,
19638       "Traffic Stream (TS) Info Access Policy", HFILL }},
19639
19640     {&hf_ieee80211_tsinfo_apsd,
19641      {"Automatic Power-Save Delivery (APSD)", "wlan_mgt.ts_info.apsd",
19642       FT_UINT24, BASE_DEC, NULL, 0x000400,
19643       "Traffic Stream (TS) Info Automatic Power-Save Delivery (APSD)", HFILL }},
19644
19645     {&hf_ieee80211_tsinfo_up,
19646      {"User Priority", "wlan_mgt.ts_info.up",
19647       FT_UINT24, BASE_DEC, VALS(qos_up), 0x003800,
19648       "Traffic Stream (TS) Info User Priority", HFILL }},
19649
19650     {&hf_ieee80211_tsinfo_ack,
19651      {"Ack Policy", "wlan_mgt.ts_info.ack",
19652       FT_UINT24, BASE_DEC, VALS(ack_policy), 0x00C000,
19653       "Traffic Stream (TS) Info Ack Policy", HFILL }},
19654
19655     {&hf_ieee80211_tsinfo_sched,
19656      {"Schedule", "wlan_mgt.ts_info.sched",
19657       FT_UINT24, BASE_DEC, NULL, 0x010000,
19658       "Traffic Stream (TS) Info Schedule", HFILL }},
19659
19660     {&hf_ieee80211_tsinfo_rsv,
19661      {"Reserved", "wlan_mgt.ts_info.rsv",
19662       FT_UINT24, BASE_HEX, NULL, 0xFE0000,
19663       "Must be Zero", HFILL }},
19664
19665     {&hf_ieee80211_tspec_nor_msdu,
19666      {"Normal MSDU Size", "wlan_mgt.tspec.nor_msdu",
19667       FT_UINT16, BASE_DEC, NULL, 0,
19668       NULL, HFILL }},
19669
19670     {&hf_ieee80211_tspec_max_msdu,
19671      {"Maximum MSDU Size", "wlan_mgt.tspec.max_msdu",
19672       FT_UINT16, BASE_DEC, NULL, 0,
19673       NULL, HFILL }},
19674
19675     {&hf_ieee80211_tspec_min_srv,
19676      {"Minimum Service Interval", "wlan_mgt.tspec.min_srv",
19677       FT_UINT32, BASE_DEC, NULL, 0,
19678       NULL, HFILL }},
19679
19680     {&hf_ieee80211_tspec_max_srv,
19681      {"Maximum Service Interval", "wlan_mgt.tspec.max_srv",
19682       FT_UINT32, BASE_DEC, NULL, 0,
19683       NULL, HFILL }},
19684
19685     {&hf_ieee80211_tspec_inact_int,
19686      {"Inactivity Interval", "wlan_mgt.tspec.inact_int",
19687       FT_UINT32, BASE_DEC, NULL, 0,
19688       NULL, HFILL }},
19689
19690     {&hf_ieee80211_tspec_susp_int,
19691      {"Suspension Interval", "wlan_mgt.tspec.susp_int",
19692       FT_UINT32, BASE_DEC, NULL, 0,
19693       NULL, HFILL }},
19694
19695     {&hf_ieee80211_tspec_srv_start,
19696      {"Service Start Time", "wlan_mgt.tspec.srv_start",
19697       FT_UINT32, BASE_DEC, NULL, 0,
19698       NULL, HFILL }},
19699
19700     {&hf_ieee80211_tspec_min_data,
19701      {"Minimum Data Rate", "wlan_mgt.tspec.min_data",
19702       FT_UINT32, BASE_DEC, NULL, 0,
19703       NULL, HFILL }},
19704
19705     {&hf_ieee80211_tspec_mean_data,
19706      {"Mean Data Rate", "wlan_mgt.tspec.mean_data",
19707       FT_UINT32, BASE_DEC, NULL, 0,
19708       NULL, HFILL }},
19709
19710     {&hf_ieee80211_tspec_peak_data,
19711      {"Peak Data Rate", "wlan_mgt.tspec.peak_data",
19712       FT_UINT32, BASE_DEC, NULL, 0,
19713       NULL, HFILL }},
19714
19715     {&hf_ieee80211_tspec_burst_size,
19716      {"Burst Size", "wlan_mgt.tspec.burst_size",
19717       FT_UINT32, BASE_DEC, NULL, 0,
19718       NULL, HFILL }},
19719
19720     {&hf_ieee80211_tspec_delay_bound,
19721      {"Delay Bound", "wlan_mgt.tspec.delay_bound",
19722       FT_UINT32, BASE_DEC, NULL, 0,
19723       NULL, HFILL }},
19724
19725     {&hf_ieee80211_tspec_min_phy,
19726      {"Minimum PHY Rate", "wlan_mgt.tspec.min_phy",
19727       FT_UINT32, BASE_DEC, NULL, 0,
19728       NULL, HFILL }},
19729
19730     {&hf_ieee80211_tspec_surplus,
19731      {"Surplus Bandwidth Allowance", "wlan_mgt.tspec.surplus",
19732       FT_UINT16, BASE_DEC, NULL, 0,
19733       NULL, HFILL }},
19734
19735     {&hf_ieee80211_tspec_medium,
19736      {"Medium Time", "wlan_mgt.tspec.medium",
19737       FT_UINT16, BASE_DEC, NULL, 0,
19738       NULL, HFILL }},
19739
19740     {&hf_ieee80211_ts_delay,
19741      {"Traffic Stream (TS) Delay", "wlan_mgt.ts_delay",
19742       FT_UINT32, BASE_DEC, NULL, 0,
19743       NULL, HFILL }},
19744
19745     {&hf_ieee80211_tclas_process,
19746      {"Processing", "wlan_mgt.tclas_proc.processing",
19747       FT_UINT8, BASE_DEC, VALS(ieee80211_tclas_process_flag), 0,
19748       "TCLAS Processing", HFILL }},
19749
19750     {&hf_ieee80211_tag_qos_cap_qos_info,
19751      {"QoS Info", "wlan_mgt.tag.qos_cap.qos_info",
19752       FT_UINT8, BASE_HEX, NULL, 0,
19753       "TCLAS Processing", HFILL }},
19754
19755     {&hf_ieee80211_qos_info_field_vo_uapsd,
19756      {"AC_VO U-APSD Flag", "wlan_mgt.tag.qos_cap.qos_info.vo_uapsd",
19757       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
19758       NULL, HFILL }},
19759
19760     {&hf_ieee80211_qos_info_field_vi_uapsd,
19761      {"AC_VI U-APSD Flag", "wlan_mgt.tag.qos_cap.qos_info.vi_uapsd",
19762       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
19763       NULL, HFILL }},
19764
19765     {&hf_ieee80211_qos_info_field_bk_uapsd,
19766      {"AC_BK U-APSD Flag", "wlan_mgt.tag.qos_cap.qos_info.bk_uapsd",
19767       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
19768       NULL, HFILL }},
19769
19770     {&hf_ieee80211_qos_info_field_be_uapsd,
19771      {"AC_BE U-APSD Flag", "wlan_mgt.tag.qos_cap.qos_info.be_uapsd",
19772       FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
19773       NULL, HFILL }},
19774
19775     {&hf_ieee80211_qos_info_field_qack,
19776      {"Q-ACK", "wlan_mgt.tag.qos_cap.qos_info.qack",
19777       FT_BOOLEAN, 8, TFS(&qos_info_field_qack_flags), 0x10,
19778       NULL, HFILL }},
19779
19780     {&hf_ieee80211_qos_info_field_max_sp_length,
19781      {"Max SP-Length", "wlan_mgt.tag.qos_cap.qos_info.max_sp_length",
19782       FT_UINT8, BASE_HEX, VALS(qos_info_field_max_sp_length_flags), 0x60,
19783       NULL , HFILL }},
19784
19785     {&hf_ieee80211_qos_info_field_more_data_ack,
19786      {"More Data Ack", "wlan_mgt.tag.qos_cap.qos_info.more_data_ack",
19787       FT_BOOLEAN, 8, TFS(&qos_info_field_more_data_ack_flags) , 0x80,
19788       NULL, HFILL }},
19789
19790     {&hf_ieee80211_qos_info_field_edca_upd_cnt,
19791      {"EDCA Parameter Set Update Count", "wlan_mgt.tag.qos_cap.qos_info.edca_upd_cnt",
19792       FT_UINT8, BASE_DEC, NULL, 0x07,
19793       NULL, HFILL}},
19794
19795     {&hf_ieee80211_qos_info_field_queue_req,
19796      {"Queue Request", "wlan_mgt.tag.qos_cap.qos_info.queue_req",
19797       FT_BOOLEAN, 8, TFS(&qos_info_field_queue_req_flags), 0x07,
19798       NULL, HFILL}},
19799
19800     {&hf_ieee80211_qos_info_field_txop_req,
19801      {"TXOP Request", "wlan_mgt.tag.qos_cap.qos_info.txop_req",
19802       FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x40,
19803       NULL, HFILL}},
19804
19805     {&hf_ieee80211_qos_info_field_reserved,
19806      {"Reserved", "wlan_mgt.tag.qos_cap.qos_info.reserved",
19807       FT_BOOLEAN, 8, NULL, 0x80,
19808       NULL, HFILL}},
19809
19810     {&hf_ieee80211_tag_ext_supp_rates,
19811      {"Extended Supported Rates", "wlan_mgt.extended_supported_rates",
19812       FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
19813       "In Mbit/sec, (B) for Basic Rates", HFILL }},
19814
19815     {&hf_ieee80211_sched_info,
19816      {"Schedule Info", "wlan_mgt.sched.sched_info",
19817       FT_UINT16, BASE_HEX, NULL, 0,
19818       "Schedule Info field", HFILL }},
19819
19820     {&hf_ieee80211_sched_info_agg,
19821      {"Schedule Aggregation", "wlan_mgt.sched_info.agg",
19822       FT_UINT16, BASE_DEC, NULL, 0x0001,
19823       "Traffic Stream (TS) Info Access Policy", HFILL }},
19824
19825     {&hf_ieee80211_sched_info_tsid,
19826      {"Schedule Traffic Stream ID (TSID)", "wlan_mgt.sched_info.tsid",
19827       FT_UINT16, BASE_DEC, NULL, 0x001E,
19828       "Traffic Stream ID (TSID) Info TSID", HFILL }},
19829
19830     {&hf_ieee80211_sched_info_dir,
19831      {"Schedule Direction", "wlan_mgt.sched_info.dir",
19832       FT_UINT16, BASE_DEC, VALS(tsinfo_direction), 0x0060,
19833       "Traffic Stream (TS) Info Direction", HFILL }},
19834
19835     {&hf_ieee80211_sched_srv_start,
19836      {"Service Start Time", "wlan_mgt.sched.srv_start",
19837       FT_UINT32, BASE_HEX, NULL, 0,
19838       NULL, HFILL }},
19839
19840     {&hf_ieee80211_sched_srv_int,
19841      {"Service Interval", "wlan_mgt.sched.srv_int",
19842       FT_UINT32, BASE_HEX, NULL, 0,
19843       NULL, HFILL }},
19844
19845     {&hf_ieee80211_sched_spec_int,
19846      {"Specification Interval", "wlan_mgt.sched.spec_int",
19847       FT_UINT16, BASE_HEX, NULL, 0,
19848       NULL, HFILL }},
19849
19850     {&hf_ieee80211_aruba,
19851      {"Aruba Type", "wlan_mgt.aruba.type",
19852       FT_UINT16, BASE_DEC|BASE_EXT_STRING, &aruba_mgt_typevals_ext, 0,
19853       "Aruba Management", HFILL }},
19854
19855     {&hf_ieee80211_aruba_hb_seq,
19856      {"Aruba Heartbeat Sequence", "wlan_mgt.aruba.heartbeat_sequence",
19857       FT_UINT64, BASE_DEC, NULL, 0,
19858       NULL, HFILL }},
19859
19860     {&hf_ieee80211_aruba_mtu,
19861      {"Aruba MTU Size", "wlan_mgt.aruba.mtu_size",
19862       FT_UINT16, BASE_DEC, NULL, 0,
19863       NULL, HFILL }},
19864
19865     /* Start: HT Control (+HTC) */
19866     {&hf_ieee80211_htc,
19867      {"HT Control (+HTC)", "wlan_mgt.htc",
19868       FT_UINT32, BASE_HEX, NULL, 0,
19869       "High Throughput Control (+HTC)", HFILL }},
19870
19871     {&hf_ieee80211_htc_lac,
19872      {"Link Adaptation Control (LAC)", "wlan_mgt.htc.lac",
19873       FT_UINT16, BASE_HEX, NULL, 0,
19874       "High Throughput Control Link Adaptation Control (LAC)", HFILL }},
19875
19876     {&hf_ieee80211_htc_lac_reserved,
19877      {"Reserved", "wlan_mgt.htc.lac.reserved",
19878       FT_BOOLEAN, 16, NULL, 0x0001,
19879       "High Throughput Control Link Adaptation Control Reserved", HFILL }},
19880
19881     {&hf_ieee80211_htc_lac_trq,
19882      {"Training Request (TRQ)", "wlan_mgt.htc.lac.trq",
19883       FT_BOOLEAN, 16, TFS(&htc_lac_trq_flag), 0x0002,
19884       "High Throughput Control Link Adaptation Control Training Request (TRQ)", HFILL }},
19885
19886     {&hf_ieee80211_htc_lac_mai_aseli,
19887      {"Antenna Selection Indication (ASELI)", "wlan_mgt.htc.lac.mai.aseli",
19888       FT_UINT16, BASE_HEX, NULL, 0x003C,
19889       "High Throughput Control Link Adaptation Control MAI Antenna Selection Indication", HFILL }},
19890
19891     {&hf_ieee80211_htc_lac_mai_mrq,
19892      {"MCS Request (MRQ)", "wlan_mgt.htc.lac.mai.mrq",
19893       FT_BOOLEAN, 16, TFS(&htc_lac_mai_mrq_flag), 0x0004,
19894       "High Throughput Control Link Adaptation Control MAI MCS Request", HFILL }},
19895
19896     {&hf_ieee80211_htc_lac_mai_msi,
19897      {"MCS Request Sequence Identifier (MSI)", "wlan_mgt.htc.lac.mai.msi",
19898       FT_UINT16, BASE_HEX, NULL, 0x0038,
19899       "High Throughput Control Link Adaptation Control MAI MCS Request Sequence Identifier", HFILL }},
19900
19901     {&hf_ieee80211_htc_lac_mai_reserved,
19902      {"Reserved", "wlan_mgt.htc.lac.mai.reserved",
19903       FT_UINT16, BASE_HEX, NULL, 0x0038,
19904       "High Throughput Control Link Adaptation Control MAI Reserved", HFILL }},
19905
19906     {&hf_ieee80211_htc_lac_mfsi,
19907      {"MCS Feedback Sequence Identifier (MFSI)", "wlan_mgt.htc.lac.mfsi",
19908       FT_UINT16, BASE_DEC, NULL, 0x01C0,
19909       "High Throughput Control Link Adaptation Control MCS Feedback Sequence Identifier (MSI)", HFILL }},
19910
19911     {&hf_ieee80211_htc_lac_asel_command,
19912      {"Antenna Selection (ASEL) Command", "wlan_mgt.htc.lac.asel.command",
19913       FT_UINT16, BASE_HEX, VALS(ieee80211_htc_lac_asel_command_flags), 0x0E00,
19914       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Command", HFILL }},
19915
19916     {&hf_ieee80211_htc_lac_asel_data,
19917      {"Antenna Selection (ASEL) Data", "wlan_mgt.htc.lac.asel.data",
19918       FT_UINT16, BASE_HEX, NULL, 0xF000,
19919       "High Throughput Control Link Adaptation Control Antenna Selection (ASEL) Data", HFILL }},
19920
19921     {&hf_ieee80211_htc_lac_mfb,
19922      {"MCS Feedback (MFB)", "wlan_mgt.htc.lac.mfb",
19923       FT_UINT16, BASE_HEX, NULL, 0xFE00,
19924       "High Throughput Control Link Adaptation Control MCS Feedback", HFILL }},
19925
19926     {&hf_ieee80211_htc_cal_pos,
19927      {"Calibration Position", "wlan_mgt.htc.cal.pos",
19928       FT_UINT16, BASE_DEC, VALS(ieee80211_htc_cal_pos_flags), 0x0003,
19929       "High Throughput Control Calibration Position", HFILL }},
19930
19931     {&hf_ieee80211_htc_cal_seq,
19932      {"Calibration Sequence Identifier", "wlan_mgt.htc.cal.seq",
19933       FT_UINT16, BASE_DEC, NULL, 0x000C,
19934       "High Throughput Control Calibration Sequence Identifier", HFILL }},
19935
19936     {&hf_ieee80211_htc_reserved1,
19937      {"Reserved", "wlan_mgt.htc.reserved1",
19938       FT_UINT16, BASE_DEC, NULL, 0x0030,
19939       "High Throughput Control Reserved", HFILL }},
19940
19941     {&hf_ieee80211_htc_csi_steering,
19942      {"CSI/Steering", "wlan_mgt.htc.csi_steering",
19943       FT_UINT16, BASE_DEC, VALS(ieee80211_htc_csi_steering_flags), 0x00C0,
19944       "High Throughput Control CSI/Steering", HFILL }},
19945
19946     {&hf_ieee80211_htc_ndp_announcement,
19947      {"NDP Announcement", "wlan_mgt.htc.ndp_announcement",
19948       FT_BOOLEAN, 16, TFS(&ieee80211_htc_ndp_announcement_flag), 0x0100,
19949       "High Throughput Control NDP Announcement", HFILL }},
19950
19951     {&hf_ieee80211_htc_reserved2,
19952      {"Reserved", "wlan_mgt.htc.reserved2",
19953       FT_UINT16, BASE_HEX, NULL, 0x3E00,
19954       "High Throughput Control Reserved", HFILL }},
19955
19956     {&hf_ieee80211_htc_ac_constraint,
19957      {"AC Constraint", "wlan_mgt.htc.ac_constraint",
19958       FT_BOOLEAN, 16, NULL, 0x4000,
19959       "High Throughput Control AC Constraint", HFILL }},
19960
19961     {&hf_ieee80211_htc_rdg_more_ppdu,
19962      {"RDG/More PPDU", "wlan_mgt.htc.rdg_more_ppdu",
19963       FT_BOOLEAN, 16, NULL, 0x8000,
19964       "High Throughput Control RDG/More PPDU", HFILL }},
19965     /* End: HT Control (+HTC) */
19966
19967     /* MDIE */
19968     {&hf_ieee80211_tag_mobility_domain_mdid,
19969      {"Mobility Domain Identifier", "wlan_mgt.mobility_domain.mdid",
19970       FT_UINT16, BASE_HEX, NULL, 0,
19971       NULL, HFILL }},
19972
19973     {&hf_ieee80211_tag_mobility_domain_ft_capab,
19974      {"FT Capability and Policy", "wlan_mgt.mobility_domain.ft_capab",
19975       FT_UINT8, BASE_HEX, NULL, 0,
19976       NULL, HFILL }},
19977
19978     {&hf_ieee80211_tag_mobility_domain_ft_capab_ft_over_ds,
19979      {"Fast BSS Transition over DS",
19980       "wlan_mgt.mobility_domain.ft_capab.ft_over_ds",
19981       FT_UINT8, BASE_HEX, NULL, 0x01,
19982       NULL, HFILL }},
19983
19984     {&hf_ieee80211_tag_mobility_domain_ft_capab_resource_req,
19985      {"Resource Request Protocol Capability",
19986       "wlan_mgt.mobility_domain.ft_capab.resource_req",
19987       FT_UINT8, BASE_HEX, NULL, 0x02,
19988       NULL, HFILL }},
19989
19990     /* FTIE */
19991     {&hf_ieee80211_tag_ft_mic_control,
19992      {"MIC Control", "wlan_mgt.ft.mic_control",
19993       FT_UINT16, BASE_HEX, NULL, 0,
19994       NULL, HFILL }},
19995
19996     {&hf_ieee80211_tag_ft_element_count,
19997      {"Element Count", "wlan_mgt.ft.element_count",
19998       FT_UINT16, BASE_DEC, NULL, 0xff00,
19999       NULL, HFILL }},
20000
20001     {&hf_ieee80211_tag_ft_mic,
20002      {"MIC", "wlan_mgt.ft.mic",
20003       FT_BYTES, BASE_NONE, NULL, 0,
20004       NULL, HFILL }},
20005
20006     {&hf_ieee80211_tag_ft_anonce,
20007      {"ANonce", "wlan_mgt.ft.anonce",
20008       FT_BYTES, BASE_NONE, NULL, 0,
20009       NULL, HFILL }},
20010
20011     {&hf_ieee80211_tag_ft_snonce,
20012      {"SNonce", "wlan_mgt.ft.snonce",
20013       FT_BYTES, BASE_NONE, NULL, 0,
20014       NULL, HFILL }},
20015
20016     {&hf_ieee80211_tag_ft_subelem_id,
20017      {"Subelement ID", "wlan_mgt.ft.subelem.id",
20018       FT_UINT8, BASE_DEC, VALS(ft_subelem_id_vals), 0,
20019       NULL, HFILL }},
20020
20021     {&hf_ieee80211_tag_ft_subelem_len,
20022      {"Length", "wlan_mgt.ft.subelem.len",
20023       FT_UINT8, BASE_DEC, NULL, 0,
20024       NULL, HFILL }},
20025
20026     {&hf_ieee80211_tag_ft_subelem_data,
20027      {"Data", "wlan_mgt.ft.subelem.data",
20028       FT_BYTES, BASE_NONE, NULL, 0,
20029       NULL, HFILL }},
20030
20031     {&hf_ieee80211_tag_ft_subelem_r1kh_id,
20032      {"PMK-R1 key holder identifier (R1KH-ID)", "wlan_mgt.ft.subelem.r1kh_id",
20033       FT_BYTES, BASE_NONE, NULL, 0,
20034       NULL, HFILL }},
20035
20036     {&hf_ieee80211_tag_ft_subelem_gtk_key_info,
20037      {"Key Info", "wlan_mgt.ft.subelem.gtk.key_info",
20038       FT_UINT16, BASE_HEX, NULL, 0,
20039       NULL, HFILL }},
20040
20041     {&hf_ieee80211_tag_ft_subelem_gtk_key_id,
20042      {"Key ID", "wlan_mgt.ft.subelem.gtk.key_id",
20043       FT_UINT16, BASE_DEC, NULL, 0x0003,
20044       NULL, HFILL }},
20045
20046     {&hf_ieee80211_tag_ft_subelem_gtk_key_length,
20047      {"Key Length", "wlan_mgt.ft.subelem.gtk.key_length",
20048       FT_UINT8, BASE_HEX, NULL, 0,
20049       NULL, HFILL }},
20050
20051     {&hf_ieee80211_tag_ft_subelem_gtk_rsc,
20052      {"RSC", "wlan_mgt.ft.subelem.gtk.rsc",
20053       FT_BYTES, BASE_NONE, NULL, 0,
20054       NULL, HFILL }},
20055
20056     {&hf_ieee80211_tag_ft_subelem_gtk_key,
20057      {"GTK", "wlan_mgt.ft.subelem.gtk.key",
20058       FT_BYTES, BASE_NONE, NULL, 0,
20059       NULL, HFILL }},
20060
20061     {&hf_ieee80211_tag_ft_subelem_r0kh_id,
20062      {"PMK-R0 key holder identifier (R0KH-ID)", "wlan_mgt.ft.subelem.r0kh_id",
20063       FT_STRING, BASE_NONE, NULL, 0,
20064       NULL, HFILL }},
20065
20066     {&hf_ieee80211_tag_ft_subelem_igtk_key_id,
20067      {"Key ID", "wlan_mgt.ft.subelem.igtk.key_id",
20068       FT_UINT16, BASE_DEC, NULL, 0,
20069       NULL, HFILL }},
20070
20071     {&hf_ieee80211_tag_ft_subelem_igtk_ipn,
20072      {"IPN", "wlan_mgt.ft.subelem.igtk.ipn",
20073       FT_BYTES, BASE_NONE, NULL, 0,
20074       NULL, HFILL }},
20075
20076     {&hf_ieee80211_tag_ft_subelem_igtk_key_length,
20077      {"Key Length", "wlan_mgt.ft.subelem.igtk.key_length",
20078       FT_UINT8, BASE_HEX, NULL, 0,
20079       NULL, HFILL }},
20080
20081     {&hf_ieee80211_tag_ft_subelem_igtk_key,
20082      {"Wrapped Key (IGTK)", "wlan_mgt.ft.subelem.igtk.key",
20083       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
20084
20085     /* RIC Data IE: 802.11-2012: 8.4.2.52 */
20086     {&hf_ieee80211_tag_ric_data_id,
20087      {"Resource Handshake Identifier", "wlan_mgt.ric_data.id",
20088       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20089
20090     {&hf_ieee80211_tag_ric_data_desc_cnt,
20091      {"Resource Descriptor Count", "wlan_mgt.ric_data.desc_cnt",
20092       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20093
20094     {&hf_ieee80211_tag_ric_data_status_code,
20095      {"Status Code", "wlan_mgt.ric_data.status_code",
20096       FT_UINT16, BASE_HEX|BASE_EXT_STRING, &ieee80211_status_code_ext, 0,
20097       "Status of requested Resource", HFILL }},
20098
20099     /* RIC Descriptor IE: 802.11-2012: 8.4.2.53 */
20100     {&hf_ieee80211_tag_ric_desc_rsrc_type,
20101      {"Resource Type", "wlan_mgt.ric_desc.rsrc_type",
20102       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20103
20104     {&hf_ieee80211_tag_ric_desc_var_params,
20105      {"Variable Params", "wlan_mgt.ric_desc.var_params",
20106       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
20107
20108     /* MMIE */
20109     {&hf_ieee80211_tag_mmie_keyid,
20110      {"KeyID", "wlan_mgt.mmie.keyid",
20111       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
20112
20113     {&hf_ieee80211_tag_mmie_ipn,
20114      {"IPN", "wlan_mgt.mmie.ipn",
20115       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
20116
20117     {&hf_ieee80211_tag_mmie_mic,
20118      {"MIC", "wlan_mgt.mmie.mic",
20119       FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
20120
20121     /* WAPI Parameter Set*/
20122     {&hf_ieee80211_tag_wapi_param_set_version,
20123      {"Version", "wlan_mgt.wapi.version",
20124       FT_UINT16, BASE_DEC, NULL, 0,
20125       NULL, HFILL }},
20126
20127     {&hf_ieee80211_tag_wapi_param_set_akm_suite_count,
20128      {"AKM Suite Count", "wlan_mgt.wapi.akm_suite.count",
20129       FT_UINT16, BASE_DEC, NULL, 0,
20130       NULL, HFILL }},
20131
20132     {&hf_ieee80211_tag_wapi_param_set_akm_suite_oui,
20133      {"AKM Suite OUI", "wlan_mgt.wapi.akm_suite.oui",
20134       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
20135       NULL, HFILL }},
20136
20137     {&hf_ieee80211_tag_wapi_param_set_akm_suite_type,
20138      {"AKM Suite Type", "wlan_mgt.wapi.akm_suite.type",
20139       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_suite_type) , 0,
20140       NULL, HFILL }},
20141
20142     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_count,
20143      {"Unicast Cipher Suite Count", "wlan_mgt.wapi.unicast_cipher.suite.count",
20144       FT_UINT16, BASE_DEC, NULL, 0,
20145       NULL, HFILL }},
20146
20147     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_oui,
20148      {"Unicast Cipher Suite OUI", "wlan_mgt.wapi.unicast_cipher.suite.oui",
20149       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
20150       NULL, HFILL }},
20151
20152     {&hf_ieee80211_tag_wapi_param_set_ucast_cipher_suite_type,
20153      {"Unicast Cipher Suite Type", "wlan_mgt.wapi.unicast_cipher.suite.type",
20154       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
20155       NULL, HFILL }},
20156
20157     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_oui,
20158      {"Multicast Cipher Suite OUI", "wlan_mgt.wapi.multicast_cipher.suite.oui",
20159       FT_UINT24, BASE_CUSTOM, oui_base_custom, 0,
20160       NULL, HFILL }},
20161
20162     {&hf_ieee80211_tag_wapi_param_set_mcast_cipher_suite_type,
20163      {"Multicast Cipher Suite Type", "wlan_mgt.wapi.multicast_cipher.suite.type",
20164       FT_UINT8, BASE_DEC, VALS(ieee80211_wapi_cipher_type) , 0,
20165       NULL, HFILL }},
20166
20167     {&hf_ieee80211_tag_wapi_param_set_capab,
20168      {"WAPI Capability Info", "wlan_mgt.wapi.capab",
20169       FT_UINT16, BASE_HEX, NULL, 0,
20170       NULL, HFILL }},
20171
20172     {&hf_ieee80211_tag_wapi_param_set_capab_preauth,
20173      {"Supports Preauthentication?", "wlan_mgt.wapi.capab.preauth",
20174       FT_BOOLEAN, 16 , NULL, 0x0001,
20175       NULL, HFILL }},
20176
20177     {&hf_ieee80211_tag_wapi_param_set_capab_rsvd,
20178      {"Reserved", "wlan_mgt.wapi.capab.rsvd",
20179       FT_UINT16, BASE_DEC , NULL, 0xFFFE,
20180       NULL, HFILL }},
20181
20182     {&hf_ieee80211_tag_wapi_param_set_bkid_count,
20183      {"No of BKID's", "wlan_mgt.wapi.bkid.count",
20184       FT_UINT16, BASE_DEC, NULL, 0,
20185       NULL, HFILL }},
20186
20187     {&hf_ieee80211_tag_wapi_param_set_bkid_list,
20188      {"BKID", "wlan_mgt.wapi.bkid",
20189       FT_BYTES, BASE_NONE, NULL, 0,
20190       NULL, HFILL }},
20191
20192     /* BSS Max Idle Period */
20193     {&hf_ieee80211_tag_bss_max_idle_period,
20194      {"BSS Max Idle Period (1000 TUs)", "wlan_mgt.bss_max_idle.period",
20195       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
20196     {&hf_ieee80211_tag_bss_max_idle_options_protected,
20197      {"BSS Max Idle Period Options: Protected Keep-Alive Required",
20198       "wlan_mgt.bss_max_idle.options.protected",
20199       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
20200
20201     /* TFS Request */
20202     {&hf_ieee80211_tag_tfs_request_id,
20203      {"TFS ID", "wlan_mgt.tfs_request.id",
20204       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20205     {&hf_ieee80211_tag_tfs_request_ac_delete_after_match,
20206      {"TFS Action Code - Delete after match",
20207       "wlan_mgt.tfs_request.action_code.delete_after_match",
20208       FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL }},
20209     {&hf_ieee80211_tag_tfs_request_ac_notify,
20210      {"TFS Action Code - Notify",
20211       "wlan_mgt.tfs_request.action_code.notify",
20212       FT_UINT8, BASE_DEC, NULL, 0x02, NULL, HFILL }},
20213     {&hf_ieee80211_tag_tfs_request_subelem_id,
20214      {"Subelement ID", "wlan_mgt.tfs_request.subelem.id",
20215       FT_UINT8, BASE_DEC, VALS(tfs_request_subelem_ids), 0,
20216       "TFS Request Subelement ID", HFILL }},
20217     {&hf_ieee80211_tag_tfs_request_subelem_len,
20218      {"Length", "wlan_mgt.tfs_request.subelem.len",
20219       FT_UINT8, BASE_DEC, NULL, 0,
20220       "TFS Request Subelement Length", HFILL }},
20221     {&hf_ieee80211_tag_tfs_request_subelem,
20222      {"Subelement Data", "wlan_mgt.tfs_request.subelem",
20223       FT_BYTES, BASE_NONE, NULL, 0,
20224       "TFS Request Subelement Data", HFILL }},
20225
20226     /* TFS Response */
20227     {&hf_ieee80211_tag_tfs_response_subelem_id,
20228      {"Subelement ID", "wlan_mgt.tfs_response.subelem.id",
20229       FT_UINT8, BASE_DEC, VALS(tfs_response_subelem_ids), 0,
20230       "TFS Response Subelement ID", HFILL }},
20231     {&hf_ieee80211_tag_tfs_response_subelem_len,
20232      {"Length", "wlan_mgt.tfs_response.subelem.len",
20233       FT_UINT8, BASE_DEC, NULL, 0,
20234       "TFS Response Subelement Length", HFILL }},
20235     {&hf_ieee80211_tag_tfs_response_subelem,
20236      {"Subelement Data", "wlan_mgt.tfs_response.subelem",
20237       FT_BYTES, BASE_NONE, NULL, 0,
20238       "TFS Response Subelement Data", HFILL }},
20239     {&hf_ieee80211_tag_tfs_response_status,
20240      {"TFS Response Status", "wlan_mgt.tfs_response.status",
20241       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20242     {&hf_ieee80211_tag_tfs_response_id,
20243      {"TFS ID", "wlan_mgt.tfs_response.tfs_id",
20244       FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
20245
20246     /* WNM-Sleep Mode */
20247     {&hf_ieee80211_tag_wnm_sleep_mode_action_type,
20248      {"Action Type", "wlan_mgt.wnm_sleep_mode.action_type",
20249       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_action_types), 0,
20250       "WNM-Sleep Mode Action Type", HFILL }},
20251     {&hf_ieee80211_tag_wnm_sleep_mode_response_status,
20252      {"WNM-Sleep Mode Response Status",
20253       "wlan_mgt.wnm_sleep_mode.response_status",
20254       FT_UINT8, BASE_DEC, VALS(wnm_sleep_mode_response_status_vals), 0, NULL,
20255       HFILL }},
20256     {&hf_ieee80211_tag_wnm_sleep_mode_interval,
20257      {"WNM-Sleep Interval", "wlan_mgt.wnm_sleep_mode.interval",
20258       FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
20259
20260     /* Time Advertisement */
20261     {&hf_ieee80211_tag_time_adv_timing_capab,
20262      {"Timing capabilities", "wlan_mgt.time_adv.timing_capab",
20263       FT_UINT8, BASE_DEC, VALS(time_adv_timing_capab_vals), 0,
20264       NULL, HFILL }},
20265
20266     {&hf_ieee80211_tag_time_adv_time_value,
20267      {"Time Value", "wlan_mgt.time_adv.time_value",
20268       FT_BYTES, BASE_NONE, NULL, 0,
20269       NULL, HFILL }},
20270
20271     {&hf_ieee80211_tag_time_adv_time_value_year,
20272      {"Time Value: Year", "wlan_mgt.time_adv.time_value.year",
20273       FT_UINT16, BASE_DEC, NULL, 0,
20274       NULL, HFILL }},
20275
20276     {&hf_ieee80211_tag_time_adv_time_value_month,
20277      {"Time Value: Month", "wlan_mgt.time_adv.time_value.month",
20278       FT_UINT8, BASE_DEC, NULL, 0,
20279       NULL, HFILL }},
20280
20281     {&hf_ieee80211_tag_time_adv_time_value_day,
20282      {"Time Value: Day", "wlan_mgt.time_adv.time_value.month",
20283       FT_UINT8, BASE_DEC, NULL, 0,
20284       NULL, HFILL }},
20285
20286     {&hf_ieee80211_tag_time_adv_time_value_hours,
20287      {"Time Value: Hours", "wlan_mgt.time_adv.time_value.hours",
20288       FT_UINT8, BASE_DEC, NULL, 0,
20289       NULL, HFILL }},
20290
20291     {&hf_ieee80211_tag_time_adv_time_value_minutes,
20292      {"Time Value: Minutes", "wlan_mgt.time_adv.time_value.minutes",
20293       FT_UINT8, BASE_DEC, NULL, 0,
20294       NULL, HFILL }},
20295
20296     {&hf_ieee80211_tag_time_adv_time_value_seconds,
20297      {"Time Value: Seconds", "wlan_mgt.time_adv.time_value.seconds",
20298       FT_UINT8, BASE_DEC, NULL, 0,
20299       NULL, HFILL }},
20300
20301     {&hf_ieee80211_tag_time_adv_time_value_milliseconds,
20302      {"Time Value: Milliseconds", "wlan_mgt.time_adv.time_value.milliseconds",
20303       FT_UINT16, BASE_DEC, NULL, 0,
20304       NULL, HFILL }},
20305
20306     {&hf_ieee80211_tag_time_adv_time_value_reserved,
20307      {"Time Value: Reserved", "wlan_mgt.time_adv.time_value.reserved",
20308       FT_UINT8, BASE_DEC, NULL, 0,
20309       NULL, HFILL }},
20310
20311     {&hf_ieee80211_tag_time_adv_time_error,
20312      {"Time Error", "wlan_mgt.time_adv.time_error",
20313       FT_BYTES, BASE_NONE, NULL, 0,
20314       NULL, HFILL }},
20315
20316     {&hf_ieee80211_tag_time_adv_time_update_counter,
20317      {"Time Update Counter", "wlan_mgt.time_adv.time_update_counter",
20318       FT_UINT8, BASE_DEC, NULL, 0,
20319       NULL, HFILL }},
20320
20321     /* Time Zone */
20322     {&hf_ieee80211_tag_time_zone,
20323      {"Time Zone", "wlan_mgt.time_zone",
20324       FT_STRING, BASE_NONE, NULL, 0,
20325       NULL, HFILL }},
20326
20327     /* Interworking */
20328     {&hf_ieee80211_tag_interworking_access_network_type,
20329      {"Access Network Type", "wlan_mgt.interworking.access_network_type",
20330       FT_UINT8, BASE_DEC, VALS(access_network_type_vals), 0x0f,
20331       NULL, HFILL }},
20332
20333     {&hf_ieee80211_tag_interworking_internet,
20334      {"Internet", "wlan_mgt.interworking.internet",
20335       FT_UINT8, BASE_DEC, NULL, 0x10,
20336       NULL, HFILL }},
20337
20338     {&hf_ieee80211_tag_interworking_asra,
20339      {"ASRA", "wlan_mgt.interworking.asra",
20340       FT_UINT8, BASE_DEC, NULL, 0x20,
20341       "Additional Step Required for Access", HFILL }},
20342
20343     {&hf_ieee80211_tag_interworking_esr,
20344      {"ESR", "wlan_mgt.interworking.esr",
20345       FT_UINT8, BASE_DEC, NULL, 0x40,
20346       "Emergency services reachable", HFILL }},
20347
20348     {&hf_ieee80211_tag_interworking_uesa,
20349      {"UESA", "wlan_mgt.interworking.uesa",
20350       FT_UINT8, BASE_DEC, NULL, 0x80,
20351       "Unauthenticated emergency service accessible", HFILL }},
20352
20353     {&hf_ieee80211_tag_interworking_hessid,
20354      {"HESSID", "wlan_mgt.interworking.hessid",
20355       FT_ETHER, BASE_NONE, NULL, 0,
20356       "Homogeneous ESS identifier", HFILL }},
20357
20358     /* Advertisement Protocol */
20359     {&hf_ieee80211_tag_adv_proto_resp_len_limit,
20360      {"Query Response Length Limit", "wlan_mgt.adv_proto.resp_len_limit",
20361       FT_UINT8, BASE_DEC, NULL, 0x7f,
20362       NULL, HFILL }},
20363
20364     {&hf_ieee80211_tag_adv_proto_pame_bi,
20365      {"PAME-BI", "wlan_mgt.adv_proto.pame_bi",
20366       FT_UINT8, BASE_DEC, NULL, 0x80,
20367       "Pre-Association Message Xchange BSSID Independent (PAME-BI)", HFILL }},
20368
20369     {&hf_ieee80211_tag_adv_proto_id,
20370      {"Advertisement Protocol ID", "wlan_mgt.adv_proto.id",
20371       FT_UINT8, BASE_DEC, VALS(adv_proto_id_vals), 0,
20372       NULL, HFILL }},
20373
20374     /* Roaming Consortium */
20375     {&hf_ieee80211_tag_roaming_consortium_num_anqp_oi,
20376      {"Number of ANQP OIs", "wlan_mgt.roaming_consortium.num_anqp_oi",
20377       FT_UINT8, BASE_DEC, NULL, 0,
20378       NULL, HFILL }},
20379
20380     {&hf_ieee80211_tag_roaming_consortium_oi1_len,
20381      {"OI #1 Length", "wlan_mgt.roaming_consortium.oi1_len",
20382       FT_UINT8, BASE_DEC, NULL, 0x0f,
20383       NULL, HFILL }},
20384
20385     {&hf_ieee80211_tag_roaming_consortium_oi2_len,
20386      {"OI #2 Length", "wlan_mgt.roaming_consortium.oi2_len",
20387       FT_UINT8, BASE_DEC, NULL, 0xf0,
20388       NULL, HFILL }},
20389
20390     {&hf_ieee80211_tag_roaming_consortium_oi1,
20391      {"OI #1", "wlan_mgt.roaming_consortium.oi1",
20392       FT_BYTES, BASE_NONE, NULL, 0,
20393       NULL, HFILL }},
20394
20395     {&hf_ieee80211_tag_roaming_consortium_oi2,
20396      {"OI #2", "wlan_mgt.roaming_consortium.oi2",
20397       FT_BYTES, BASE_NONE, NULL, 0,
20398       NULL, HFILL }},
20399
20400     {&hf_ieee80211_tag_roaming_consortium_oi3,
20401      {"OI #3", "wlan_mgt.roaming_consortium.oi3",
20402       FT_BYTES, BASE_NONE, NULL, 0,
20403       NULL, HFILL }},
20404
20405     /* Timeout Interval */
20406     {&hf_ieee80211_tag_timeout_int_type,
20407      {"Timeout Interval Type", "wlan_mgt.timeout_int.type",
20408       FT_UINT8, BASE_DEC, VALS(timeout_int_types), 0,
20409       NULL, HFILL }},
20410
20411     {&hf_ieee80211_tag_timeout_int_value,
20412      {"Timeout Interval Value", "wlan_mgt.timeout_int.value",
20413       FT_UINT32, BASE_DEC, NULL, 0,
20414       NULL, HFILL }},
20415
20416     /* Link Identifier */
20417     {&hf_ieee80211_tag_link_id_bssid,
20418      {"BSSID", "wlan_mgt.link_id.bssid",
20419       FT_ETHER, BASE_NONE, NULL, 0,
20420       NULL, HFILL }},
20421
20422     {&hf_ieee80211_tag_link_id_init_sta,
20423      {"TDLS initiator STA Address", "wlan_mgt.link_id.init_sta",
20424       FT_ETHER, BASE_NONE, NULL, 0,
20425       NULL, HFILL }},
20426
20427     {&hf_ieee80211_tag_link_id_resp_sta,
20428      {"TDLS responder STA Address", "wlan_mgt.link_id.resp_sta",
20429       FT_ETHER, BASE_NONE, NULL, 0,
20430       NULL, HFILL }},
20431
20432     /* Wakeup Schedule */
20433     {&hf_ieee80211_tag_wakeup_schedule_offset,
20434      {"Offset", "wlan_mgt.wakeup_schedule.offset",
20435       FT_UINT32, BASE_DEC, NULL, 0,
20436       NULL, HFILL }},
20437
20438     {&hf_ieee80211_tag_wakeup_schedule_interval,
20439      {"Interval", "wlan_mgt.wakeup_schedule.interval",
20440       FT_UINT32, BASE_DEC, NULL, 0,
20441       NULL, HFILL }},
20442
20443     {&hf_ieee80211_tag_wakeup_schedule_awake_window_slots,
20444      {"Awake Window Slots", "wlan_mgt.wakeup_schedule.awake_window_slots",
20445       FT_UINT32, BASE_DEC, NULL, 0,
20446       NULL, HFILL }},
20447
20448     {&hf_ieee80211_tag_wakeup_schedule_max_awake_dur,
20449      {"Maximum Awake Window Duration", "wlan_mgt.wakeup_schedule.max_awake_dur",
20450       FT_UINT32, BASE_DEC, NULL, 0,
20451       NULL, HFILL }},
20452
20453     {&hf_ieee80211_tag_wakeup_schedule_idle_count,
20454      {"Idle Count", "wlan_mgt.wakeup_schedule.idle_count",
20455       FT_UINT16, BASE_DEC, NULL, 0,
20456       NULL, HFILL }},
20457
20458     /* Channel Switch Timing */
20459     {&hf_ieee80211_tag_channel_switch_timing_switch_time,
20460      {"Switch Time", "wlan_mgt.channel_switch_timing.switch_time",
20461       FT_UINT16, BASE_DEC, NULL, 0,
20462       NULL, HFILL }},
20463
20464     {&hf_ieee80211_tag_channel_switch_timing_switch_timeout,
20465      {"Switch Timeout", "wlan_mgt.channel_switch_timing.switch_timeout",
20466       FT_UINT16, BASE_DEC, NULL, 0,
20467       NULL, HFILL }},
20468
20469     /* PTI Control */
20470     {&hf_ieee80211_tag_pti_control_tid,
20471      {"TID", "wlan_mgt.pti_control.tid",
20472       FT_UINT8, BASE_DEC, NULL, 0,
20473       NULL, HFILL }},
20474
20475     {&hf_ieee80211_tag_pti_control_sequence_control,
20476      {"Sequence Control", "wlan_mgt.pti_control.sequence_control",
20477       FT_UINT16, BASE_HEX, NULL, 0,
20478       NULL, HFILL }},
20479
20480     /* PU Buffer Status */
20481     {&hf_ieee80211_tag_pu_buffer_status_ac_bk,
20482      {"AC_BK traffic available", "wlan_mgt.pu_buffer_status.ac_bk",
20483       FT_UINT8, BASE_DEC, NULL, 0x01,
20484       NULL, HFILL }},
20485
20486     {&hf_ieee80211_tag_pu_buffer_status_ac_be,
20487      {"AC_BE traffic available", "wlan_mgt.pu_buffer_status.ac_be",
20488       FT_UINT8, BASE_DEC, NULL, 0x02,
20489       NULL, HFILL }},
20490
20491     {&hf_ieee80211_tag_pu_buffer_status_ac_vi,
20492      {"AC_VI traffic available", "wlan_mgt.pu_buffer_status.ac_vi",
20493       FT_UINT8, BASE_DEC, NULL, 0x04,
20494       NULL, HFILL }},
20495
20496     {&hf_ieee80211_tag_pu_buffer_status_ac_vo,
20497      {"AC_VO traffic available", "wlan_mgt.pu_buffer_status.ac_vo",
20498       FT_UINT8, BASE_DEC, NULL, 0x08,
20499       NULL, HFILL }}
20500   };
20501
20502   static hf_register_info aggregate_fields[] = {
20503     {&hf_ieee80211_amsdu_subframe,
20504      {"A-MSDU Subframe", "wlan_aggregate.a_mdsu.subframe",
20505       FT_NONE, BASE_NONE, NULL, 0x0,
20506       "Aggregate MAC Service Data Unit (MSDU) Subframe", HFILL }},
20507
20508     {&hf_ieee80211_amsdu_length,
20509      {"A-MSDU Length", "wlan_aggregate.a_mdsu.length",
20510       FT_UINT16, BASE_DEC, NULL, 0x0,
20511       NULL, HFILL }}
20512   };
20513
20514   static uat_field_t wep_uat_flds[] = {
20515
20516       UAT_FLD_VS(uat_wep_key_records, key, "Key type", wep_type_vals,
20517                         "Decryption key type used"),
20518       UAT_FLD_CSTRING(uat_wep_key_records, string, "Key",
20519                         "wep:<wep hexadecimal key>\n"
20520                         "wpa-pwd:<passphrase>[:<ssid>]\n"
20521                         "wpa-psk:<wpa hexadecimal key>"),
20522       UAT_END_FIELDS
20523     };
20524
20525   static gint *tree_array[] = {
20526     &ett_80211,
20527     &ett_fc_tree,
20528     &ett_proto_flags,
20529     &ett_fragments,
20530     &ett_fragment,
20531     &ett_block_ack,
20532     &ett_block_ack_bitmap,
20533     &ett_80211_mgt,
20534     &ett_fixed_parameters,
20535     &ett_tagged_parameters,
20536     &ett_tag_bmapctl_tree,
20537     &ett_tag_country_fnm_tree,
20538     &ett_tag_country_rcc_tree,
20539     &ett_qos_parameters,
20540     &ett_qos_ps_buf_state,
20541     &ett_qos_info_field_tree,
20542     &ett_wep_parameters,
20543     &ett_msh_control,
20544     &ett_hwmp_targ_flags_tree,
20545     &ett_cap_tree,
20546     &ett_rsn_gcs_tree,
20547     &ett_rsn_pcs_tree,
20548     &ett_rsn_sub_pcs_tree,
20549     &ett_rsn_akms_tree,
20550     &ett_rsn_sub_akms_tree,
20551     &ett_rsn_cap_tree,
20552     &ett_rsn_pmkid_tree,
20553     &ett_rsn_gmcs_tree,
20554     &ett_wpa_mcs_tree,
20555     &ett_wpa_ucs_tree,
20556     &ett_wpa_sub_ucs_tree,
20557     &ett_wpa_akms_tree,
20558     &ett_wpa_sub_akms_tree,
20559     &ett_wme_ac,
20560     &ett_wme_aci_aifsn,
20561     &ett_wme_ecw,
20562     &ett_wme_qos_info,
20563     &ett_ht_cap_tree,
20564     &ett_ath_cap_tree,
20565     &ett_ff_ba_param_tree,
20566     &ett_ff_qos_info,
20567     &ett_ff_sm_pwr_save,
20568     &ett_ff_psmp_param_set,
20569     &ett_ff_mimo_cntrl,
20570     &ett_ff_ant_sel,
20571     &ett_ff_chan_switch_announce,
20572     &ett_ff_ht_info,
20573     &ett_ff_psmp_sta_info,
20574     &ett_ff_delba_param_tree,
20575     &ett_ff_ba_ssc_tree,
20576     &ett_mimo_report,
20577     &ett_cntrl_wrapper_fc,
20578     &ett_cntrl_wrapper_payload,
20579     &ett_vht_cap_tree,
20580     &ett_vht_mcsset_tree,
20581     &ett_vht_rx_mcsbit_tree,
20582     &ett_vht_tx_mcsbit_tree,
20583     &ett_vht_basic_mcsbit_tree,
20584     &ett_vht_op_tree,
20585     &ett_ht_info_delimiter1_tree,
20586     &ett_ht_info_delimiter2_tree,
20587     &ett_ht_info_delimiter3_tree,
20588     &ett_msdu_aggregation_parent_tree,
20589     &ett_msdu_aggregation_subframe_tree,
20590     &ett_tag_measure_request_mode_tree,
20591     &ett_tag_measure_request_type_tree,
20592     &ett_tag_measure_report_mode_tree,
20593     &ett_tag_measure_report_type_tree,
20594     &ett_tag_measure_report_basic_map_tree,
20595     &ett_tag_measure_report_rpi_tree,
20596     &ett_tag_measure_report_frame_tree,
20597     &ett_tag_dfs_map_tree,
20598     &ett_tag_erp_info_tree,
20599     &ett_tag_ex_cap1,
20600     &ett_tag_ex_cap2,
20601     &ett_tag_ex_cap3,
20602     &ett_tag_ex_cap4,
20603     &ett_tag_ex_cap5,
20604     &ett_tag_ex_cap6,
20605     &ett_tag_ex_cap7,
20606     &ett_tag_ex_cap8,
20607     &ett_tag_rm_cap1,
20608     &ett_tag_rm_cap2,
20609     &ett_tag_rm_cap3,
20610     &ett_tag_rm_cap4,
20611     &ett_tag_rm_cap5,
20612     &ett_tag_tclas_mask_tree,
20613     &ett_tag_supported_channels,
20614     &ett_tag_neighbor_report_bssid_info_tree,
20615     &ett_tag_neighbor_report_bssid_info_capability_tree,
20616     &ett_tag_neighbor_report_sub_tag_tree,
20617     &ett_tag_bss_bitmask_tree,
20618     &ett_ampduparam_tree,
20619     &ett_mcsset_tree,
20620     &ett_mcsbit_tree,
20621     &ett_htex_cap_tree,
20622     &ett_txbf_tree,
20623     &ett_hta_cap_tree,
20624     &ett_hta_cap1_tree,
20625     &ett_hta_cap2_tree,
20626     &ett_htc_tree,
20627     &ett_antsel_tree,
20628     &ett_80211_mgt_ie,
20629     &ett_tsinfo_tree,
20630     &ett_sched_tree,
20631     &ett_fcs,
20632     &ett_tag_wapi_param_set_akm_tree,
20633     &ett_tag_wapi_param_set_ucast_tree,
20634     &ett_tag_wapi_param_set_mcast_tree,
20635     &ett_tag_wapi_param_set_preauth_tree,
20636     &ett_tag_time_adv_tree,
20637     &ett_adv_proto,
20638     &ett_adv_proto_tuple,
20639     &ett_gas_query,
20640     &ett_gas_resp_fragment,
20641     &ett_gas_resp_fragments,
20642     &ett_gas_anqp,
20643     &ett_nai_realm,
20644     &ett_nai_realm_eap,
20645     &ett_tag_ric_data_desc_ie,
20646     &ett_anqp_vendor_capab,
20647     &ett_hs20_cc_proto_port_tuple,
20648     &ett_ssid_list
20649   };
20650   module_t *wlan_module;
20651
20652   memset (&wlan_stats, 0, sizeof wlan_stats);
20653
20654   proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame",
20655       "IEEE 802.11 Aggregate Data", "wlan_aggregate");
20656   proto_register_field_array(proto_aggregate, aggregate_fields, array_length(aggregate_fields));
20657
20658   proto_wlan = proto_register_protocol ("IEEE 802.11 wireless LAN",
20659       "IEEE 802.11", "wlan");
20660   proto_register_field_array (proto_wlan, hf, array_length (hf));
20661
20662   proto_wlan_mgt = proto_register_protocol ("IEEE 802.11 wireless LAN management frame",
20663       "802.11 MGT", "wlan_mgt");
20664   proto_register_field_array (proto_wlan_mgt, ff, array_length (ff));
20665
20666   proto_register_subtree_array (tree_array, array_length (tree_array));
20667
20668   register_dissector("wlan",         dissect_ieee80211,         proto_wlan);
20669   register_dissector("wlan_fixed",   dissect_ieee80211_fixed,   proto_wlan);
20670   register_dissector("wlan_bsfc",    dissect_ieee80211_bsfc,    proto_wlan);
20671   register_dissector("wlan_datapad", dissect_ieee80211_datapad, proto_wlan);
20672   register_dissector("wlan_ht",      dissect_ieee80211_ht,      proto_wlan);
20673
20674   register_init_routine(wlan_defragment_init);
20675   register_init_routine(wlan_retransmit_init);
20676   register_init_routine(ieee80211_gas_reassembly_init);
20677
20678   wlan_tap = register_tap("wlan");
20679
20680   /* Register configuration options */
20681   wlan_module = prefs_register_protocol(proto_wlan, init_wepkeys);
20682   prefs_register_bool_preference(wlan_module, "defragment",
20683     "Reassemble fragmented 802.11 datagrams",
20684     "Whether fragmented 802.11 datagrams should be reassembled",
20685      &wlan_defragment);
20686
20687   prefs_register_bool_preference(wlan_module, "ignore_draft_ht",
20688     "Ignore vendor-specific HT elements",
20689     "Don't dissect 802.11n draft HT elements (which might contain duplicate information).",
20690     &wlan_ignore_draft_ht);
20691
20692   prefs_register_bool_preference(wlan_module, "retransmitted",
20693     "Call subdissector for retransmitted 802.11 frames",
20694     "Whether retransmitted 802.11 frames should be subdissected",
20695     &wlan_subdissector);
20696
20697   prefs_register_bool_preference(wlan_module, "check_fcs",
20698     "Assume packets have FCS",
20699     "Some 802.11 cards include the FCS at the end of a packet, others do not.",
20700     &wlan_check_fcs);
20701
20702   /* Davide Schiera (2006-11-26): changed "WEP bit" in "Protection bit"    */
20703   /*    (according to the document IEEE Std 802.11i-2004)              */
20704   prefs_register_enum_preference(wlan_module, "ignore_wep",
20705     "Ignore the Protection bit",
20706     "Some 802.11 cards leave the Protection bit set even though the packet is decrypted, "
20707     "and some also leave the IV (initialization vector).",
20708     &wlan_ignore_wep, wlan_ignore_wep_options, TRUE);
20709
20710   prefs_register_obsolete_preference(wlan_module, "wep_keys");
20711
20712   /* Davide Schiera (2006-11-26): added reference to WPA/WPA2 decryption    */
20713   prefs_register_bool_preference(wlan_module, "enable_decryption",
20714     "Enable decryption", "Enable WEP and WPA/WPA2 decryption",
20715     &enable_decryption);
20716
20717   prefs_register_static_text_preference(wlan_module, "info_decryption_key",
20718     "Key examples: 01:02:03:04:05 (40/64-bit WEP),\n"
20719     "010203040506070809101111213 (104/128-bit WEP),\n"
20720     "MyPassword[:MyAP] (WPA + plaintext password [+ SSID]),\n"
20721     "0102030405...6061626364 (WPA + 256-bit key).  "
20722     "Invalid keys will be ignored.",
20723     "Valid key formats");
20724
20725   wep_uat = uat_new("WEP and WPA Decryption Keys",
20726             sizeof(uat_wep_key_record_t), /* record size */
20727             "80211_keys",                 /* filename */
20728             TRUE,                         /* from_profile */
20729             (void**) &uat_wep_key_records,/* data_ptr */
20730             &num_wepkeys_uat,             /* numitems_ptr */
20731             UAT_AFFECTS_DISSECTION,       /* affects dissection of packets, but not set of named fields */
20732             NULL,                         /* help */
20733             uat_wep_key_record_copy_cb,   /* copy callback */
20734             uat_wep_key_record_update_cb, /* update callback */
20735             uat_wep_key_record_free_cb,   /* free callback */
20736             init_wepkeys,                 /* post update callback - update the WEP/WPA keys */
20737             wep_uat_flds);                /* UAT field definitions */
20738
20739   prefs_register_uat_preference(wlan_module,
20740                                 "wep_key_table",
20741                                 "Decryption Keys",
20742                                 "WEP and pre-shared WPA keys",
20743                                 wep_uat);
20744 }
20745
20746 void
20747 proto_reg_handoff_ieee80211(void)
20748 {
20749   dissector_handle_t data_encap_handle;
20750
20751   /*
20752    * Get handles for the LLC, IPX and Ethernet  dissectors.
20753    */
20754   llc_handle            = find_dissector("llc");
20755   ipx_handle            = find_dissector("ipx");
20756   eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
20757   data_handle           = find_dissector("data");
20758
20759   ieee80211_handle = find_dissector("wlan");
20760   dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11, ieee80211_handle);
20761   dissector_add_uint("ethertype", ETHERTYPE_CENTRINO_PROMISC, ieee80211_handle);
20762
20763   /* Register handoff to Aruba GRE */
20764   dissector_add_uint("gre.proto", GRE_ARUBA_8200, ieee80211_handle);
20765   dissector_add_uint("gre.proto", GRE_ARUBA_8210, ieee80211_handle);
20766   dissector_add_uint("gre.proto", GRE_ARUBA_8220, ieee80211_handle);
20767   dissector_add_uint("gre.proto", GRE_ARUBA_8230, ieee80211_handle);
20768   dissector_add_uint("gre.proto", GRE_ARUBA_8240, ieee80211_handle);
20769   dissector_add_uint("gre.proto", GRE_ARUBA_8250, ieee80211_handle);
20770   dissector_add_uint("gre.proto", GRE_ARUBA_8260, ieee80211_handle);
20771   dissector_add_uint("gre.proto", GRE_ARUBA_8270, ieee80211_handle);
20772   dissector_add_uint("gre.proto", GRE_ARUBA_8280, ieee80211_handle);
20773   dissector_add_uint("gre.proto", GRE_ARUBA_8290, ieee80211_handle);
20774   dissector_add_uint("gre.proto", GRE_ARUBA_82A0, ieee80211_handle);
20775   dissector_add_uint("gre.proto", GRE_ARUBA_82B0, ieee80211_handle);
20776   dissector_add_uint("gre.proto", GRE_ARUBA_82C0, ieee80211_handle);
20777   dissector_add_uint("gre.proto", GRE_ARUBA_82D0, ieee80211_handle);
20778   dissector_add_uint("gre.proto", GRE_ARUBA_82E0, ieee80211_handle);
20779   dissector_add_uint("gre.proto", GRE_ARUBA_82F0, ieee80211_handle);
20780   dissector_add_uint("gre.proto", GRE_ARUBA_8300, ieee80211_handle);
20781   dissector_add_uint("gre.proto", GRE_ARUBA_8310, ieee80211_handle);
20782   dissector_add_uint("gre.proto", GRE_ARUBA_8320, ieee80211_handle);
20783   dissector_add_uint("gre.proto", GRE_ARUBA_8330, ieee80211_handle);
20784   dissector_add_uint("gre.proto", GRE_ARUBA_8340, ieee80211_handle);
20785   dissector_add_uint("gre.proto", GRE_ARUBA_8350, ieee80211_handle);
20786   dissector_add_uint("gre.proto", GRE_ARUBA_8360, ieee80211_handle);
20787   dissector_add_uint("gre.proto", GRE_ARUBA_8370, ieee80211_handle);
20788
20789   data_encap_handle = create_dissector_handle(dissect_data_encap, proto_wlan);
20790   dissector_add_uint("ethertype", ETHERTYPE_IEEE80211_DATA_ENCAP,
20791                 data_encap_handle);
20792 }
20793
20794 /*
20795  * Editor modelines
20796  *
20797  * Local Variables:
20798  * c-basic-offset: 2
20799  * tab-width: 8
20800  * indent-tabs-mode: nil
20801  * End:
20802  *
20803  * ex: set shiftwidth=2 tabstop=8 expandtab:
20804  * :indentSize=2:tabSize=8:noTabs=true:
20805  */