aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-capwap.c
blob: bc6d70e24cd8c4f2dc13bf17531529d43a80d297 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
/* packet-capwap.c
 * Routines for CAPWAP dissection (RFC 5415 / RFC 5416)
 * Copyright 2009, Alexis La Goutte <alexis.lagoutte at gmail dot com>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#include "config.h"

#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/reassemble.h>
#include <epan/expert.h>

#include <epan/sminmpec.h>
#include "packet-ieee80211.h"

void proto_register_capwap_control(void);
void proto_reg_handoff_capwap(void);

#define UDP_PORT_CAPWAP_CONTROL 5246
#define UDP_PORT_CAPWAP_DATA 5247

static guint global_capwap_data_udp_port = UDP_PORT_CAPWAP_DATA;
static gboolean global_capwap_draft_8_cisco = FALSE;
static gboolean global_capwap_reassemble = TRUE;
static gboolean global_capwap_swap_frame_control = TRUE;

static reassembly_table capwap_reassembly_table;

/* TODO LIST !
* add decryption of DLTS Message
* add support of all Messages Element Type
*/

static int proto_capwap_control = -1;
static int proto_capwap_data = -1;

static int hf_capwap_preamble = -1;
static int hf_capwap_preamble_version = -1;
static int hf_capwap_preamble_type = -1;
static int hf_capwap_preamble_reserved = -1;

static int hf_capwap_header = -1;
static int hf_capwap_header_hlen = -1;
static int hf_capwap_header_rid = -1;
static int hf_capwap_header_wbid = -1;

static int hf_capwap_header_flags = -1;
static int hf_capwap_header_flags_t = -1;
static int hf_capwap_header_flags_f = -1;
static int hf_capwap_header_flags_l = -1;
static int hf_capwap_header_flags_w = -1;
static int hf_capwap_header_flags_m = -1;
static int hf_capwap_header_flags_k = -1;
static int hf_capwap_header_flags_r = -1;

static int hf_capwap_header_fragment_id = -1;
static int hf_capwap_header_fragment_offset = -1;
static int hf_capwap_header_reserved = -1;

static int hf_capwap_header_mac_length = -1;
static int hf_capwap_header_mac_eui48 = -1;
static int hf_capwap_header_mac_eui64 = -1;
static int hf_capwap_header_mac_data = -1;

static int hf_capwap_header_wireless_length = -1;
static int hf_capwap_header_wireless_data = -1;

static int hf_capwap_header_wireless_data_ieee80211_fi = -1;
static int hf_capwap_header_wireless_data_ieee80211_fi_rssi = -1;
static int hf_capwap_header_wireless_data_ieee80211_fi_snr = -1;
static int hf_capwap_header_wireless_data_ieee80211_fi_data_rate = -1;
static int hf_capwap_header_wireless_data_ieee80211_dest_wlan = -1;
static int hf_capwap_header_wireless_data_ieee80211_dw_wlan_id_bitmap = -1;
static int hf_capwap_header_wireless_data_ieee80211_dw_reserved = -1;
static int hf_capwap_header_padding = -1;

static int hf_capwap_control_header = -1;
static int hf_capwap_control_header_msg_type = -1;
static int hf_capwap_control_header_msg_type_enterprise_nbr = -1;
static int hf_capwap_control_header_msg_type_enterprise_specific = -1;
static int hf_capwap_control_header_seq_number = -1;
static int hf_capwap_control_header_flags = -1;
static int hf_capwap_control_header_msg_element_length = -1;

static int hf_capwap_message_element = -1;
static int hf_capwap_msg_element = -1;
static int hf_capwap_msg_element_type = -1;
static int hf_capwap_msg_element_length = -1;
static int hf_capwap_msg_element_value = -1;

static int hf_capwap_msg_element_type_ac_descriptor_stations = -1;
static int hf_capwap_msg_element_type_ac_descriptor_limit = -1;
static int hf_capwap_msg_element_type_ac_descriptor_active_wtp = -1;
static int hf_capwap_msg_element_type_ac_descriptor_max_wtp = -1;
/* AC Descriptor Security Flags... */
static int hf_capwap_msg_element_type_ac_descriptor_security = -1;
static int hf_capwap_msg_element_type_ac_descriptor_security_s = -1;
static int hf_capwap_msg_element_type_ac_descriptor_security_x = -1;
static int hf_capwap_msg_element_type_ac_descriptor_security_r = -1;
static int hf_capwap_msg_element_type_ac_descriptor_rmac_field = -1;
static int hf_capwap_msg_element_type_ac_descriptor_reserved = -1;
/* AC Descriptor DTLS Policy Flags... */
static int hf_capwap_msg_element_type_ac_descriptor_dtls_policy = -1;
static int hf_capwap_msg_element_type_ac_descriptor_dtls_policy_d = -1;
static int hf_capwap_msg_element_type_ac_descriptor_dtls_policy_c = -1;
static int hf_capwap_msg_element_type_ac_descriptor_dtls_policy_r = -1;

static int hf_capwap_msg_element_type_ac_information = -1;
static int hf_capwap_msg_element_type_ac_information_vendor = -1;
static int hf_capwap_msg_element_type_ac_information_type = -1;
static int hf_capwap_msg_element_type_ac_information_length = -1;
static int hf_capwap_msg_element_type_ac_information_value = -1;
static int hf_capwap_msg_element_type_ac_information_hardware_version = -1;
static int hf_capwap_msg_element_type_ac_information_software_version = -1;

static int hf_capwap_msg_element_type_ac_name = -1;
static int hf_capwap_msg_element_type_ac_name_with_priority = -1;

static int hf_capwap_msg_element_type_ac_timestamp = -1;

static int hf_capwap_msg_element_type_add_station_radio_id = -1;
static int hf_capwap_msg_element_type_add_station_length = -1;
static int hf_capwap_msg_element_type_add_station_mac_eui48 = -1;
static int hf_capwap_msg_element_type_add_station_mac_eui64 = -1;
static int hf_capwap_msg_element_type_add_station_mac_data = -1;
static int hf_capwap_msg_element_type_add_station_vlan_name = -1;

static int hf_capwap_msg_element_type_ac_ipv4_list = -1;
static int hf_capwap_msg_element_type_ac_ipv6_list = -1;

static int hf_capwap_msg_element_type_capwap_control_ipv4 = -1;
static int hf_capwap_msg_element_type_capwap_control_ipv6 = -1;
static int hf_capwap_msg_element_type_capwap_control_wtp_count = -1;

static int hf_capwap_msg_element_type_capwap_timers_discovery = -1;
static int hf_capwap_msg_element_type_capwap_timers_echo_request = -1;

static int hf_capwap_msg_element_type_decryption_error_report_period_radio_id = -1;
static int hf_capwap_msg_element_type_decryption_error_report_period_interval = -1;

static int hf_capwap_msg_element_type_delete_station_radio_id = -1;
static int hf_capwap_msg_element_type_delete_station_length = -1;
static int hf_capwap_msg_element_type_delete_station_mac_eui48 = -1;
static int hf_capwap_msg_element_type_delete_station_mac_eui64 = -1;
static int hf_capwap_msg_element_type_delete_station_mac_data = -1;

static int hf_capwap_msg_element_type_discovery_type = -1;

static int hf_capwap_msg_element_type_location_data = -1;

static int hf_capwap_msg_element_type_maximum_message_length = -1;

static int hf_capwap_msg_element_type_capwap_local_ipv4_address = -1;

static int hf_capwap_msg_element_type_idle_timeout = -1;
static int hf_capwap_msg_element_type_radio_admin_id = -1;
static int hf_capwap_msg_element_type_radio_admin_state = -1;

static int hf_capwap_msg_element_type_radio_op_state_radio_id = -1;
static int hf_capwap_msg_element_type_radio_op_state_radio_state = -1;
static int hf_capwap_msg_element_type_radio_op_state_radio_cause = -1;
static int hf_capwap_msg_element_type_result_code = -1;

static int hf_capwap_msg_element_type_session_id = -1;

static int hf_capwap_msg_element_type_statistics_timer = -1;

static int hf_capwap_msg_element_type_vsp_vendor_identifier = -1;
static int hf_capwap_msg_element_type_vsp_vendor_element_id = -1;
static int hf_capwap_msg_element_type_vsp_vendor_data = -1;

static int hf_capwap_msg_element_type_wtp_board_data = -1;
static int hf_capwap_msg_element_type_wtp_board_data_vendor = -1;
static int hf_capwap_msg_element_type_wtp_board_data_type = -1;
static int hf_capwap_msg_element_type_wtp_board_data_length = -1;
static int hf_capwap_msg_element_type_wtp_board_data_value = -1;
static int hf_capwap_msg_element_type_wtp_board_data_wtp_model_number  = -1;
static int hf_capwap_msg_element_type_wtp_board_data_wtp_serial_number  = -1;
static int hf_capwap_msg_element_type_wtp_board_data_wtp_board_id  = -1;
static int hf_capwap_msg_element_type_wtp_board_data_wtp_board_revision  = -1;
static int hf_capwap_msg_element_type_wtp_board_data_base_mac_address  = -1;

static int hf_capwap_msg_element_type_wtp_descriptor_max_radios = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_radio_in_use = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_number_encrypt = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_encrypt = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_encrypt_reserved = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_encrypt_wbid = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_encrypt_capabilities = -1;

static int hf_capwap_msg_element_type_wtp_descriptor = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_vendor = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_type = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_length = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_value = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_hardware_version = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_active_software_version = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_boot_version = -1;
static int hf_capwap_msg_element_type_wtp_descriptor_other_software_version = -1;

static int hf_capwap_msg_element_type_wtp_fallback = -1;
static int hf_capwap_msg_element_type_wtp_frame_tunnel_mode = -1;
static int hf_capwap_msg_element_type_wtp_frame_tunnel_mode_n = -1;
static int hf_capwap_msg_element_type_wtp_frame_tunnel_mode_e = -1;
static int hf_capwap_msg_element_type_wtp_frame_tunnel_mode_l = -1;
static int hf_capwap_msg_element_type_wtp_frame_tunnel_mode_r = -1;

static int hf_capwap_msg_element_type_wtp_mac_type = -1;

static int hf_capwap_msg_element_type_wtp_name = -1;

static int hf_capwap_msg_element_type_wtp_reboot_statistics_reboot_count = -1;
static int hf_capwap_msg_element_type_wtp_reboot_statistics_ac_initiated_count = -1;
static int hf_capwap_msg_element_type_wtp_reboot_statistics_link_failure_count = -1;
static int hf_capwap_msg_element_type_wtp_reboot_statistics_sw_failure_count = -1;
static int hf_capwap_msg_element_type_wtp_reboot_statistics_hw_failure_count = -1;
static int hf_capwap_msg_element_type_wtp_reboot_statistics_other_failure_count = -1;
static int hf_capwap_msg_element_type_wtp_reboot_statistics_unknown_failure_count = -1;
static int hf_capwap_msg_element_type_wtp_reboot_statistics_last_failure_type = -1;

static int hf_capwap_msg_element_type_capwap_local_ipv6_address = -1;

static int hf_capwap_msg_element_type_capwap_transport_protocol = -1;

static int hf_capwap_msg_element_type_mtu_discovery_padding = -1;

static int hf_capwap_msg_element_type_ecn_support = -1;

static int hf_capwap_msg_element_type_ieee80211_add_wlan_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_wlan_id = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_e = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_i = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_c = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_f = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_p = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_s = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_b = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_a = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_m = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_q = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_t = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_d = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_v = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_o = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_k = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_capability_l = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_key_index = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_key_status = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_key_length = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_key = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_group_tsc = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_qos = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_auth_type = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_mac_mode = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_tunnel_mode = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_suppress_ssid = -1;
static int hf_capwap_msg_element_type_ieee80211_add_wlan_ssid = -1;

static int hf_capwap_msg_element_type_ieee80211_antenna_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_antenna_diversity = -1;
static int hf_capwap_msg_element_type_ieee80211_antenna_combiner = -1;
static int hf_capwap_msg_element_type_ieee80211_antenna_count = -1;
static int hf_capwap_msg_element_type_ieee80211_antenna_selection = -1;

static int hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_wlan_id = -1;
static int hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_bssid = -1;

static int hf_capwap_msg_element_type_ieee80211_delete_wlan_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_delete_wlan_wlan_id = -1;

static int hf_capwap_msg_element_type_ieee80211_direct_sequence_control_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_direct_sequence_control_reserved = -1;
static int hf_capwap_msg_element_type_ieee80211_direct_sequence_control_current_channel = -1;
static int hf_capwap_msg_element_type_ieee80211_direct_sequence_control_current_cca = -1;
static int hf_capwap_msg_element_type_ieee80211_direct_sequence_control_energy_detect_threshold = -1;

static int hf_capwap_msg_element_type_ieee80211_ie_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_ie_wlan_id = -1;
static int hf_capwap_msg_element_type_ieee80211_ie_flags = -1;
static int hf_capwap_msg_element_type_ieee80211_ie_flags_b = -1;
static int hf_capwap_msg_element_type_ieee80211_ie_flags_p = -1;
static int hf_capwap_msg_element_type_ieee80211_ie_flags_rsv = -1;

static int hf_capwap_msg_element_type_ieee80211_mac_operation_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_mac_operation_reserved = -1;
static int hf_capwap_msg_element_type_ieee80211_mac_operation_rts_threshold = -1;
static int hf_capwap_msg_element_type_ieee80211_mac_operation_short_retry = -1;
static int hf_capwap_msg_element_type_ieee80211_mac_operation_long_retry = -1;
static int hf_capwap_msg_element_type_ieee80211_mac_operation_fragmentation_threshold = -1;
static int hf_capwap_msg_element_type_ieee80211_mac_operation_tx_msdu_lifetime = -1;
static int hf_capwap_msg_element_type_ieee80211_mac_operation_rx_msdu_lifetime = -1;

static int hf_capwap_msg_element_type_ieee80211_mic_countermeasures_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_mic_countermeasures_wlan_id = -1;
static int hf_capwap_msg_element_type_ieee80211_mic_countermeasures_mac_address = -1;

static int hf_capwap_msg_element_type_ieee80211_ofdm_control_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_reserved = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_current_channel = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit0 = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit1 = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit2 = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit3 = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit4 = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit5 = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit6 = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit7 = -1;
static int hf_capwap_msg_element_type_ieee80211_ofdm_control_ti_threshold = -1;

static int hf_capwap_msg_element_type_ieee80211_multi_domain_capability_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_multi_domain_capability_reserved = -1;
static int hf_capwap_msg_element_type_ieee80211_multi_domain_capability_first_channel = -1;
static int hf_capwap_msg_element_type_ieee80211_multi_domain_capability_number_of_channels = -1;
static int hf_capwap_msg_element_type_ieee80211_multi_domain_capability_max_tx_power_level = -1;

static int hf_capwap_msg_element_type_ieee80211_rate_set_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_rate_set_rate_set = -1;

static int hf_capwap_msg_element_type_ieee80211_station_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_station_association_id = -1;
static int hf_capwap_msg_element_type_ieee80211_station_flags = -1;
static int hf_capwap_msg_element_type_ieee80211_station_mac_address = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_e = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_i = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_c = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_f = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_p = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_s = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_b = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_a = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_m = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_q = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_t = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_d = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_v = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_o = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_k = -1;
static int hf_capwap_msg_element_type_ieee80211_station_capabilities_l = -1;
static int hf_capwap_msg_element_type_ieee80211_station_wlan_id = -1;
static int hf_capwap_msg_element_type_ieee80211_station_supported_rates = -1;

static int hf_capwap_msg_element_type_ieee80211_station_session_key_mac = -1;
static int hf_capwap_msg_element_type_ieee80211_station_session_key_flags = -1;
static int hf_capwap_msg_element_type_ieee80211_station_session_key_flags_a = -1;
static int hf_capwap_msg_element_type_ieee80211_station_session_key_flags_c = -1;
static int hf_capwap_msg_element_type_ieee80211_station_session_key_pairwire_tsc = -1;
static int hf_capwap_msg_element_type_ieee80211_station_session_key_pairwire_rsc = -1;
static int hf_capwap_msg_element_type_ieee80211_station_session_key_key = -1;

static int hf_capwap_msg_element_type_ieee80211_supported_rates_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_supported_rates_rate = -1;

static int hf_capwap_msg_element_type_ieee80211_tx_power_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_tx_power_reserved = -1;
static int hf_capwap_msg_element_type_ieee80211_tx_power_current_tx_power  = -1;

static int hf_capwap_msg_element_type_ieee80211_tx_power_level_radio_id  = -1;
static int hf_capwap_msg_element_type_ieee80211_tx_power_level_num_levels  = -1;
static int hf_capwap_msg_element_type_ieee80211_tx_power_level_power_level = -1;

static int hf_capwap_msg_element_type_ieee80211_update_wlan_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_wlan_id = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_e = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_i = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_c = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_f = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_p = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_s = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_b = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_a = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_m = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_q = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_t = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_d = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_v = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_o = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_k = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_capability_l = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_key_index = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_key_status = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_key_length = -1;
static int hf_capwap_msg_element_type_ieee80211_update_wlan_key = -1;

static int hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_short_preamble = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_num_of_bssids = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_dtim_period = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_bssid = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_beacon_period = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_country_string = -1;

static int hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_id = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_reserved = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_n = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_g = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_a = -1;
static int hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_b = -1;

static int hf_capwap_msg_element_type_ieee80211_supported_mac_profiles_numbers = -1;
static int hf_capwap_msg_element_type_ieee80211_supported_mac_profiles_profile = -1;
static int hf_capwap_msg_element_type_ieee80211_mac_profile = -1;

static int hf_capwap_data_keep_alive = -1;
static int hf_capwap_data_keep_alive_length = -1;

static int hf_capwap_fortinet_element_id = -1;
static int hf_capwap_fortinet_value = -1;
static int hf_capwap_fortinet_ap_scan_rid = -1;
static int hf_capwap_fortinet_ap_scan_bgscan_intv = -1;
static int hf_capwap_fortinet_ap_scan_bgscan_idle = -1;
static int hf_capwap_fortinet_ap_scan_bgscan_rpt_intv = -1;
static int hf_capwap_fortinet_ap_scan_fgscan_rpt_intv = -1;
static int hf_capwap_fortinet_passive_rid = -1;
static int hf_capwap_fortinet_passive = -1;
static int hf_capwap_fortinet_daemon_rst = -1;
static int hf_capwap_fortinet_mac_rid = -1;
static int hf_capwap_fortinet_mac_wid = -1;
static int hf_capwap_fortinet_mac_len = -1;
static int hf_capwap_fortinet_mac = -1;
static int hf_capwap_fortinet_wtp_allow_sn = -1;
static int hf_capwap_fortinet_wtp_allow_allow = -1;
static int hf_capwap_fortinet_wbh_sta_rid = -1;
static int hf_capwap_fortinet_wbh_sta_len = -1;
static int hf_capwap_fortinet_wbh_sta_mac = -1;
static int hf_capwap_fortinet_wbh_sta_bssid = -1;
static int hf_capwap_fortinet_wbh_sta_mhc = -1;
static int hf_capwap_fortinet_htcap_rid = -1;
static int hf_capwap_fortinet_htcap_mcs = -1;
static int hf_capwap_fortinet_htcap_gi = -1;
static int hf_capwap_fortinet_htcap_bw = -1;
static int hf_capwap_fortinet_mvap_sn_length = -1;
static int hf_capwap_fortinet_mvap_sn = -1;
static int hf_capwap_fortinet_mvap_unknown = -1;
static int hf_capwap_fortinet_mvap_age = -1;
static int hf_capwap_fortinet_mvap_period = -1;
static int hf_capwap_fortinet_mvap_vfid = -1;
static int hf_capwap_fortinet_mode_rid = -1;
static int hf_capwap_fortinet_mode = -1;
static int hf_capwap_fortinet_coext_rid = -1;
static int hf_capwap_fortinet_coext = -1;
static int hf_capwap_fortinet_amsdu_rid = -1;
static int hf_capwap_fortinet_amsdu = -1;
static int hf_capwap_fortinet_ps_opt_rid = -1;
static int hf_capwap_fortinet_ps_opt = -1;
static int hf_capwap_fortinet_pure_rid = -1;
static int hf_capwap_fortinet_pure = -1;
static int hf_capwap_fortinet_ebptag_ebp = -1;
static int hf_capwap_fortinet_ebptag_tag = -1;
static int hf_capwap_fortinet_telnet_enable = -1;
static int hf_capwap_fortinet_admin_passwd = -1;
static int hf_capwap_fortinet_regcode = -1;
static int hf_capwap_fortinet_countrycode_rid = -1;
static int hf_capwap_fortinet_countrycode_code = -1;
static int hf_capwap_fortinet_countrycode_string = -1;
static int hf_capwap_fortinet_sta_scan_rid = -1;
static int hf_capwap_fortinet_sta_scan = -1;
static int hf_capwap_fortinet_fho_rid = -1;
static int hf_capwap_fortinet_fho = -1;
static int hf_capwap_fortinet_apho_rid = -1;
static int hf_capwap_fortinet_apho = -1;
static int hf_capwap_fortinet_sta_locate_rid = -1;
static int hf_capwap_fortinet_sta_locate_enable = -1;
static int hf_capwap_fortinet_sta_locate_interval = -1;
static int hf_capwap_fortinet_sa_rid = -1;
static int hf_capwap_fortinet_sa_enable = -1;
static int hf_capwap_fortinet_sa_ssid = -1;
static int hf_capwap_fortinet_darrp_cfg_rid = -1;
static int hf_capwap_fortinet_darrp_cfg_enable = -1;
static int hf_capwap_fortinet_darrp_cfg_interval = -1;
static int hf_capwap_fortinet_ap_suppress_list_ver = -1;
static int hf_capwap_fortinet_ap_suppress_list_op = -1;
static int hf_capwap_fortinet_ap_suppress_list_rid = -1;
static int hf_capwap_fortinet_ap_suppress_list_len = -1;
static int hf_capwap_fortinet_wds_rid = -1;
static int hf_capwap_fortinet_wds_wid = -1;
static int hf_capwap_fortinet_wds_enable = -1;
static int hf_capwap_fortinet_vap_vlan_tag_rid = -1;
static int hf_capwap_fortinet_vap_vlan_tag_wid = -1;
static int hf_capwap_fortinet_vap_vlan_tag = -1;
static int hf_capwap_fortinet_vap_bitmap_rid = -1;
static int hf_capwap_fortinet_vap_bitmap = -1;
static int hf_capwap_fortinet_mcast_rate_rid = -1;
static int hf_capwap_fortinet_mcast_rate_wid = -1;
static int hf_capwap_fortinet_mcast_rate = -1;
static int hf_capwap_fortinet_cfg_rid = -1;
static int hf_capwap_fortinet_cfg_wid = -1;
static int hf_capwap_fortinet_cfg_ip = -1;
static int hf_capwap_fortinet_cfg_mask = -1;
static int hf_capwap_fortinet_split_tun_cfg_enable_local_subnet = -1;
static int hf_capwap_fortinet_split_tun_cfg_cnt = -1;
static int hf_capwap_fortinet_mgmt_vlan_id = -1;
static int hf_capwap_fortinet_vap_psk_passwd_rid = -1;
static int hf_capwap_fortinet_vap_psk_passwd_wid = -1;
static int hf_capwap_fortinet_vap_psk_passwd_key = -1;
static int hf_capwap_fortinet_mesh_eth_bridge_enable = -1;
static int hf_capwap_fortinet_mesh_eth_bridge_type = -1;
static int hf_capwap_fortinet_wtp_cap = -1;
static int hf_capwap_fortinet_txpwr_rid = -1;
static int hf_capwap_fortinet_txpwr = -1;
static int hf_capwap_fortinet_wids_enable_rid = -1;
static int hf_capwap_fortinet_wids_enable = -1;
static int hf_capwap_fortinet_unknown_rid = -1;
static int hf_capwap_fortinet_unknown_wid = -1;
static int hf_capwap_fortinet_unknown = -1;

static int hf_capwap_cisco_element_id = -1;
static int hf_capwap_cisco_value = -1;
static int hf_capwap_cisco_mwar_addr = -1;
static int hf_capwap_cisco_rad_name = -1;
static int hf_capwap_cisco_mwar_type = -1;
static int hf_capwap_cisco_mwar_hardware = -1;
static int hf_capwap_cisco_mwar_software = -1;
static int hf_capwap_cisco_mwar_active_ms = -1;
static int hf_capwap_cisco_mwar_supported_ms = -1;
static int hf_capwap_cisco_mwar_active_rad = -1;
static int hf_capwap_cisco_mwar_supported_rad = -1;
static int hf_capwap_cisco_ap_mode_and_type_mode = -1;
static int hf_capwap_cisco_ap_mode_and_type_type = -1;
static int hf_capwap_cisco_ap_static_ip_addr = -1;
static int hf_capwap_cisco_ap_static_ip_netmask = -1;
static int hf_capwap_cisco_ap_static_ip_gateway = -1;
static int hf_capwap_cisco_ap_static_ip_type = -1;
static int hf_capwap_cisco_ap_static_ip_reserved = -1;
static int hf_capwap_cisco_ap_uptime_current = -1;
static int hf_capwap_cisco_ap_uptime_last = -1;
static int hf_capwap_cisco_ap_group_name = -1;
static int hf_capwap_cisco_ap_led_state = -1;
static int hf_capwap_cisco_ap_timesync = -1;
static int hf_capwap_cisco_ap_timesync_type = -1;
static int hf_capwap_cisco_board_data_options_ant_type = -1;
static int hf_capwap_cisco_board_data_options_flex_connect = -1;
static int hf_capwap_cisco_board_data_options_ap_type = -1;
static int hf_capwap_cisco_board_data_options_join_priority = -1;
static int hf_capwap_cisco_unknown = -1;

static int hf_msg_fragments = -1;
static int hf_msg_fragment = -1;
static int hf_msg_fragment_overlap = -1;
static int hf_msg_fragment_overlap_conflicts = -1;
static int hf_msg_fragment_multiple_tails = -1;
static int hf_msg_fragment_too_long_fragment = -1;
static int hf_msg_fragment_error = -1;
static int hf_msg_fragment_count = -1;
static int hf_msg_reassembled_in = -1;
static int hf_msg_reassembled_length = -1;

static dissector_handle_t dtls_handle;
static dissector_handle_t ieee8023_handle;
static dissector_handle_t ieee80211_handle;
static dissector_handle_t ieee80211_bsfc_handle;

static gint ett_capwap = -1;
static gint ett_capwap_control = -1;
static gint ett_capwap_data = -1;
static gint ett_capwap_preamble = -1;
static gint ett_capwap_header = -1;
static gint ett_capwap_header_flags = -1;
static gint ett_capwap_control_header = -1;
static gint ett_capwap_control_header_msg = -1;
static gint ett_capwap_data_keep_alive = -1;
static gint ett_capwap_message_element = -1;
static gint ett_capwap_data_message_bindings_ieee80211 = -1;
static gint ett_capwap_encryption_capabilities = -1;
static gint ett_capwap_encryption_capability = -1;
static gint ett_capwap_ac_information = -1;
static gint ett_capwap_wtp_descriptor = -1;
static gint ett_capwap_board_data = -1;
static gint ett_capwap_message_element_type = -1;
static gint ett_capwap_ac_descriptor_security_flags = -1;
static gint ett_capwap_ac_descriptor_dtls_flags = -1;
static gint ett_capwap_wtp_frame_tunnel_mode = -1;
static gint ett_capwap_ieee80211_add_wlan_capability = -1;
static gint ett_capwap_ieee80211_ie_flags = -1;
static gint ett_capwap_ieee80211_update_wlan_capability = -1;
static gint ett_capwap_ieee80211_station_capabilities = -1;
static gint ett_capwap_ieee80211_ofdm_control_band_support = -1;

static gint ett_msg_fragment = -1;
static gint ett_msg_fragments = -1;

static expert_field ei_capwap_header_length_bad = EI_INIT;
static expert_field ei_capwap_data_keep_alive_length = EI_INIT;
static expert_field ei_capwap_msg_element_length = EI_INIT;
static expert_field ei_capwap_message_element_type = EI_INIT;
static expert_field ei_capwap_fortinet_mac_len = EI_INIT;
static expert_field ei_capwap_message_element_fortinet_type = EI_INIT;
static expert_field ei_capwap_message_element_cisco_type = EI_INIT;

static const int *ieee80211_ofdm_control_band_support_flags[] = {
    &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit0,
    &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit1,
    &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit2,
    &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit3,
    &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit4,
    &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit5,
    &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit6,
    &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit7,
    NULL
};

static const int *ieee80211_ie_flags[] = {
    &hf_capwap_msg_element_type_ieee80211_ie_flags_b,
    &hf_capwap_msg_element_type_ieee80211_ie_flags_p,
    &hf_capwap_msg_element_type_ieee80211_ie_flags_rsv,
    NULL
};

static const int *capwap_ac_descriptor_security_flags[] = {
    &hf_capwap_msg_element_type_ac_descriptor_security_r,
    &hf_capwap_msg_element_type_ac_descriptor_security_s,
    &hf_capwap_msg_element_type_ac_descriptor_security_x,
    NULL
};

static const int *capwap_ac_descriptor_dtls_flags[] = {
    &hf_capwap_msg_element_type_ac_descriptor_dtls_policy_r,
    &hf_capwap_msg_element_type_ac_descriptor_dtls_policy_d,
    &hf_capwap_msg_element_type_ac_descriptor_dtls_policy_c,
    NULL
};

static const int *capwap_wtp_frame_tunnel_mode_flags[] = {
    &hf_capwap_msg_element_type_wtp_frame_tunnel_mode_n,
    &hf_capwap_msg_element_type_wtp_frame_tunnel_mode_e,
    &hf_capwap_msg_element_type_wtp_frame_tunnel_mode_l,
    &hf_capwap_msg_element_type_wtp_frame_tunnel_mode_r,
    NULL
};

static int const *ieee80211_add_wlan_capability_flags[] = {
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_e,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_i,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_c,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_f,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_p,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_s,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_b,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_a,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_m,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_q,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_t,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_d,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_v,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_o,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_k,
    &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_l,
    NULL
};

static const int *ieee80211_station_capabilities_flags[] ={
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_e,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_i,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_c,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_f,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_p,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_s,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_b,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_a,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_m,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_q,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_t,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_d,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_v,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_o,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_k,
    &hf_capwap_msg_element_type_ieee80211_station_capabilities_l,
    NULL
};

static const int * ieee80211_update_wlan_capability_flags[] = {
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_e,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_i,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_c,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_f,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_p,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_s,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_b,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_a,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_m,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_q,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_t,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_d,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_v,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_o,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_k,
    &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_l,
    NULL
};

/* ************************************************************************* */
/*                  Fragment items                                           */
/* ************************************************************************* */

static const fragment_items capwap_frag_items = {
    /* Fragment subtrees */
    &ett_msg_fragment,
    &ett_msg_fragments,
    /* Fragment fields */
    &hf_msg_fragments,
    &hf_msg_fragment,
    &hf_msg_fragment_overlap,
    &hf_msg_fragment_overlap_conflicts,
    &hf_msg_fragment_multiple_tails,
    &hf_msg_fragment_too_long_fragment,
    &hf_msg_fragment_error,
    &hf_msg_fragment_count,
    /* Reassembled in field */
    &hf_msg_reassembled_in,
    /* Reassembled length field */
    &hf_msg_reassembled_length,
    /* Reassembled data field */
    NULL,
    /* Tag */
    "Message fragments"
};

/* ************************************************************************* */
/*                  Header Type                                              */
/* ************************************************************************* */
static const value_string type_header_vals[] = {
    { 0, "CAPWAP Header" },
    { 1, "CAPWAP DTLS Header" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                   Wireless Binding IDentifier (WBID)                      */
/* ************************************************************************* */
static const value_string type_wbid[] = {
    { 0, "Reserved" },
    { 1, "IEEE 802.11" },
    { 2, "IEEE 802.16" }, /* From old RFC Draft... */
    { 3, "EPCGlobal" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                 flag Type Transported (payload)                           */
/* ************************************************************************* */
static const true_false_string flag_type_t = {
    "Native frame format (see Wireless Binding ID field)",
    "IEEE 802.3 frame"
};
/* ************************************************************************* */
/*                 flag Type Fragment                                        */
/* ************************************************************************* */
static const true_false_string flag_type_f = {
    "Fragmented",
    "Don't Fragment"
};
/* ************************************************************************* */
/*                 flag Type Last Fragment                                   */
/* ************************************************************************* */
static const true_false_string flag_type_l = {
    "This is the last fragment",
    "More fragments follow"
 };
/* ************************************************************************* */
/*                 flag Type Wireless                                        */
/* ************************************************************************* */
static const true_false_string flag_type_w = {
    "Wireless Specific Information is present",
    "No Wireless Specific Information"
 };
/* ************************************************************************* */
/*                 flag Type Radio Mac                                       */
/* ************************************************************************* */
static const true_false_string flag_type_m = {
    "Radio MAC Address is present",
    "No Radio MAC Address"
 };
/* ************************************************************************* */
/*                 flag Type Keep Alive                                      */
/* ************************************************************************* */
static const true_false_string flag_type_k = {
    "Keep-Alive Packet",
    "No Keep-Alive"
 };
/* ************************************************************************* */
/*                  Message Type Value                                       */
/* ************************************************************************* */
static const value_string message_type[] = {
    { 1, "Discovery Request" },
    { 2, "Discovery Response" },
    { 3, "Join Request" },
    { 4, "Join Response" },
    { 5, "Configuration Status Request" },
    { 6, "Configuration Status Response" },
    { 7, "Configuration Update Request" },
    { 8, "Configuration Update Response" },
    { 9, "WTP Event Request" },
    { 10, "WTP Event Response" },
    { 11, "Change State Request" },
    { 12, "Change State Response" },
    { 13, "Echo Request" },
    { 14, "Echo Response" },
    { 15, "Image Data Request" },
    { 16, "Image Data Response" },
    { 17, "Reset Request" },
    { 18, "Reset Response" },
    { 19, "Primary Discovery Request" },
    { 20, "Primary Discovery Response" },
    { 21, "Data Transfer Request" },
    { 22, "Data Transfer Response" },
    { 23, "Clear Configuration Request" },
    { 24, "Clear Configuration Response" },
    { 25, "Station Configuration Request" },
    { 26, "Station Configuration Response" },
    /* RFC5416 : Section 3 : IEEE 802.11 Specific CAPWAP Control Messages */
    { 3398913, "IEEE 802.11 WLAN Configuration Request" },
    { 3398914, "IEEE 802.11 WLAN Configuration Response" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      Message Element Type                                 */
/* ************************************************************************* */
#define TYPE_AC_DESCRIPTOR                        1
#define TYPE_AC_IPV4_LIST                         2
#define TYPE_AC_IPV6_LIST                         3
#define TYPE_AC_NAME                              4
#define TYPE_AC_NAME_W_PRIORITY                   5
#define TYPE_AC_TIMESTAMP                         6
#define TYPE_ADD_MAC_ACL_ENTRY                    7
#define TYPE_ADD_STATION                          8
#define TYPE_RESERVED_9                           9
#define TYPE_CAPWAP_CONTROL_IPV4_ADDRESS          10
#define TYPE_CAPWAP_CONTROL_IPV6_ADDRESS          11
#define TYPE_CAPWAP_TIMERS                        12
#define TYPE_DATA_TRANSFER_DATA                   13
#define TYPE_DATA_TRANSFER_MODE                   14
#define TYPE_DESCRYPTION_ERROR_REPORT             15
#define TYPE_DECRYPTION_ERROR_REPORT_PERIOD       16
#define TYPE_DELETE_MAC_ENTRY                     17
#define TYPE_DELETE_STATION                       18
#define TYPE_RESERVED_19                          19
#define TYPE_DISCOVERY_TYPE                       20
#define TYPE_DUPLICATE_IPV4_ADDRESS               21
#define TYPE_DUPLICATE_IPV6_ADDRESS               22
#define TYPE_IDLE_TIMEOUT                         23
#define TYPE_IMAGE_DATA                           24
#define TYPE_IMAGE_IDENTIFIER                     25
#define TYPE_IMAGE_INFORMATION                    26
#define TYPE_INITIATE_DOWNLOAD                    27
#define TYPE_LOCATION_DATA                        28
#define TYPE_MAXIMUM_MESSAGE_LENGTH               29
#define TYPE_CAPWAP_LOCAL_IPV4_ADDRESS            30
#define TYPE_RADIO_ADMINISTRATIVE_STATE           31
#define TYPE_RADIO_OPERATIONAL_STATE              32
#define TYPE_RESULT_CODE                          33
#define TYPE_RETURNED_MESSAGE_ELEMENT             34
#define TYPE_SESSION_ID                           35
#define TYPE_STATISTICS_TIMER                     36
#define TYPE_VENDOR_SPECIFIC_PAYLOAD              37
#define TYPE_WTP_BOARD_DATA                       38
#define TYPE_WTP_DESCRIPTOR                       39
#define TYPE_WTP_FALLBACK                         40
#define TYPE_WTP_FRAME_TUNNEL_MODE                41
#define TYPE_RESERVED_42                          42
#define TYPE_RESERVED_43                          43
#define TYPE_WTP_MAC_TYPE                         44
#define TYPE_WTP_NAME                             45
#define TYPE_RESERVED_46                          46
#define TYPE_WTP_RADIO_STATISTICS                 47
#define TYPE_WTP_REBOOT_STATISTICS                48
#define TYPE_WTP_STATIC_IP_ADDRESS_INFORMATION    49
#define TYPE_CAPWAP_LOCAL_IPV6_ADDRESS            50
#define TYPE_CAPWAP_TRANSPORT_PROTOCOL            51
#define TYPE_MTU_DISCOVERY_PADDING                52
#define TYPE_ECN_SUPPORT                          53

#define IEEE80211_ADD_WLAN                        1024
#define IEEE80211_ANTENNA                         1025
#define IEEE80211_ASSIGNED_WTP_BSSID              1026
#define IEEE80211_DELETE_WLAN                     1027
#define IEEE80211_DIRECT_SEQUENCE_CONTROL         1028
#define IEEE80211_INFORMATION_ELEMENT             1029
#define IEEE80211_MAC_OPERATION                   1030
#define IEEE80211_MIC_COUNTERMEASURES             1031
#define IEEE80211_MULTI_DOMAIN_CAPABILITY         1032
#define IEEE80211_OFDM_CONTROL                    1033
#define IEEE80211_RATE_SET                        1034
#define IEEE80211_RSNA_ERROR_REPORT_FROM_STATION  1035
#define IEEE80211_STATION                         1036
#define IEEE80211_STATION_QOS_PROFILE             1037
#define IEEE80211_STATION_SESSION_KEY             1038
#define IEEE80211_STATISTICS                      1039
#define IEEE80211_SUPPORTED_RATES                 1040
#define IEEE80211_TX_POWER                        1041
#define IEEE80211_TX_POWER_LEVEL                  1042
#define IEEE80211_UPDATE_STATION_QOS              1043
#define IEEE80211_UPDATE_WLAN                     1044
#define IEEE80211_WTP_QUALITY_OF_SERVICE          1045
#define IEEE80211_WTP_RADIO_CONFIGURATION         1046
#define IEEE80211_WTP_RADIO_FAIL_ALARM_INDICATION 1047
#define IEEE80211_WTP_RADIO_INFORMATION           1048
#define IEEE80211_SUPPORTED_MAC_PROFILES          1060
#define IEEE80211_MAC_PROFILE                     1061
/* ************************************************************************* */
/*                      Message Element Type Value                           */
/* ************************************************************************* */
static const value_string message_element_type_vals[] = {
    { TYPE_AC_DESCRIPTOR, "AC Descriptor" },
    { TYPE_AC_IPV4_LIST, "AC IPv4 List" },
    { TYPE_AC_IPV6_LIST, "AC IPv6 List" },
    { TYPE_AC_NAME, "AC Name" },
    { TYPE_AC_NAME_W_PRIORITY, "AC Name With Priority" },
    { TYPE_AC_TIMESTAMP, "AC Timestamp" },
    { TYPE_ADD_MAC_ACL_ENTRY, "Add MAC ACL Entry" },
    { TYPE_ADD_STATION, "Add Station" },
    { TYPE_RESERVED_9, "Reserved" },
    { TYPE_CAPWAP_CONTROL_IPV4_ADDRESS, "CAPWAP Control IPv4 Address" },
    { TYPE_CAPWAP_CONTROL_IPV6_ADDRESS, "CAPWAP Control IPv6 Address" },
    { TYPE_CAPWAP_TIMERS, "CAPWAP Timers" },
    { TYPE_DATA_TRANSFER_DATA, "Data Transfer Data" },
    { TYPE_DATA_TRANSFER_MODE, "Data Transfer Mode" },
    { TYPE_DESCRYPTION_ERROR_REPORT, "Decryption Error Report" },
    { TYPE_DECRYPTION_ERROR_REPORT_PERIOD, "Decryption Error Report Period" },
    { TYPE_DELETE_MAC_ENTRY, "Delete MAC ACL Entry" },
    { TYPE_DELETE_STATION, "Delete Station" },
    { TYPE_RESERVED_19, "Reserved" },
    { TYPE_DISCOVERY_TYPE, "Discovery Type" },
    { TYPE_DUPLICATE_IPV4_ADDRESS, "Duplicate IPv4 Address" },
    { TYPE_DUPLICATE_IPV6_ADDRESS, "Duplicate IPv6 Address" },
    { TYPE_IDLE_TIMEOUT, "Idle Timeout" },
    { TYPE_IMAGE_DATA, "Image Data" },
    { TYPE_IMAGE_IDENTIFIER, "Image Identifier" },
    { TYPE_IMAGE_INFORMATION, "Image Information" },
    { TYPE_INITIATE_DOWNLOAD, "Initiate Download" },
    { TYPE_LOCATION_DATA, "Location Data" },
    { TYPE_MAXIMUM_MESSAGE_LENGTH, "Maximum Message Length" },
    { TYPE_CAPWAP_LOCAL_IPV4_ADDRESS, "CAPWAP Local IPv4 Address" },
    { TYPE_RADIO_ADMINISTRATIVE_STATE, "Radio Administrative State " },
    { TYPE_RADIO_OPERATIONAL_STATE, "Radio Operational State" },
    { TYPE_RESULT_CODE, "Result Code" },
    { TYPE_RETURNED_MESSAGE_ELEMENT, "Returned Message Element" },
    { TYPE_SESSION_ID, "Session ID" },
    { TYPE_STATISTICS_TIMER, "Statistics Timer" },
    { TYPE_VENDOR_SPECIFIC_PAYLOAD, "Vendor Specific Payload" },
    { TYPE_WTP_BOARD_DATA, "WTP Board Data" },
    { TYPE_WTP_DESCRIPTOR, "WTP Descriptor" },
    { TYPE_WTP_FALLBACK, "WTP Fallback " },
    { TYPE_WTP_FRAME_TUNNEL_MODE, "WTP Frame Tunnel Mode " },
    { TYPE_RESERVED_42, "Reserved" },
    { TYPE_RESERVED_43, "Reserved" },
    { TYPE_WTP_MAC_TYPE, "WTP MAC Type" },
    { TYPE_WTP_NAME, "WTP Name" },
    { TYPE_RESERVED_46, "Unused/Reserved" },
    { TYPE_WTP_RADIO_STATISTICS, "WTP Radio Statistics" },
    { TYPE_WTP_REBOOT_STATISTICS, "WTP Reboot Statistics" },
    { TYPE_WTP_STATIC_IP_ADDRESS_INFORMATION, "WTP Static IP Address Information" },
    { TYPE_CAPWAP_LOCAL_IPV6_ADDRESS, "CAPWAP Local IPv6 Address" },
    { TYPE_CAPWAP_TRANSPORT_PROTOCOL, "CAPWAP Transport Protocol" },
    { TYPE_MTU_DISCOVERY_PADDING, "MTU Discovery Padding" },
    { TYPE_ECN_SUPPORT, "ECN Support" },

    { IEEE80211_ADD_WLAN, "IEEE 802.11 Add WLAN" },
    { IEEE80211_ANTENNA, "IEEE 802.11 Antenna" },
    { IEEE80211_ASSIGNED_WTP_BSSID, "IEEE 802.11 Assigned WTP BSSID" },
    { IEEE80211_DELETE_WLAN, "IEEE 802.11 Delete WLAN" },
    { IEEE80211_DIRECT_SEQUENCE_CONTROL, "IEEE 802.11 Direct Sequence Control" },
    { IEEE80211_INFORMATION_ELEMENT, "IEEE 802.11 Information Element" },
    { IEEE80211_MAC_OPERATION, "IEEE 802.11 MAC Operation" },
    { IEEE80211_MIC_COUNTERMEASURES, "IEEE 802.11 MIC Countermeasures" },
    { IEEE80211_MULTI_DOMAIN_CAPABILITY, "IEEE 802.11 Multi-Domain Capability" },
    { IEEE80211_OFDM_CONTROL, "IEEE 802.11 OFDM Control" },
    { IEEE80211_RATE_SET, "IEEE 802.11 Rate Set" },
    { IEEE80211_RSNA_ERROR_REPORT_FROM_STATION, "IEEE 802.11 RSNA Error Report From Station" },
    { IEEE80211_STATION, "IEEE 802.11 Station" },
    { IEEE80211_STATION_QOS_PROFILE, "IEEE 802.11 Station QoS Profile" },
    { IEEE80211_STATION_SESSION_KEY, "IEEE 802.11 Station Session Key" },
    { IEEE80211_STATISTICS, "IEEE 802.11 Statistics" },
    { IEEE80211_SUPPORTED_RATES, "IEEE 802.11 Supported Rates" },
    { IEEE80211_TX_POWER, "IEEE 802.11 Tx Power" },
    { IEEE80211_TX_POWER_LEVEL, "IEEE 802.11 Tx Power Level" },
    { IEEE80211_UPDATE_STATION_QOS, "IEEE 802.11 Update Station QoS" },
    { IEEE80211_UPDATE_WLAN, "IEEE 802.11 Update WLAN" },
    { IEEE80211_WTP_QUALITY_OF_SERVICE, "IEEE 802.11 WTP Quality of Service" },
    { IEEE80211_WTP_RADIO_CONFIGURATION, "IEEE 802.11 WTP Radio Configuration" },
    { IEEE80211_WTP_RADIO_FAIL_ALARM_INDICATION, "IEEE 802.11 WTP Radio Fail Alarm Indication" },
    { IEEE80211_WTP_RADIO_INFORMATION, "IEEE 802.11 WTP Radio Information" },
    { IEEE80211_SUPPORTED_MAC_PROFILES, "IEEE 802.11 Supported MAC Profiles" },
    { IEEE80211_MAC_PROFILE, "IEEE 802.11 MAC Profile" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      Discovery Type                                       */
/* ************************************************************************* */
static const value_string discovery_type_vals[] = {
    { 0, "Unknown" },
    { 1, "Static Configuration" },
    { 2, "DHCP" },
    { 3, "DNS" },
    { 4, "AC Referral" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      Radio Administrative State                           */
/* ************************************************************************* */
static const value_string radio_admin_state_vals[] = {
    { 1, "Enabled" },
    { 2, "Disabled" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      Radio Operational State                              */
/* ************************************************************************* */
static const value_string radio_op_state_vals[] = {
    { 0, "Reserved" },
    { 1, "Enabled" },
    { 2, "Disabled" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      Radio Operational Cause                              */
/* ************************************************************************* */
static const value_string radio_op_cause_vals[] = {
    { 0, "Normal" },
    { 1, "Radio Failure" },
    { 2, "Software Failure" },
    { 3, "Administratively Set" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      Result Code                                          */
/* ************************************************************************* */
static const value_string result_code_vals[] = {
    { 0 , "Success" },
    { 1 , "Failure (AC List Message Element MUST Be Present)" },
    { 2 , "Success (NAT Detected)" },
    { 3 , "Join Failure (Unspecified)" },
    { 4 , "Join Failure (Resource Depletion)" },
    { 5 , "Join Failure (Unknown Source)" },
    { 6 , "Join Failure (Incorrect Data)" },
    { 7 , "Join Failure (Session ID Already in Use)" },
    { 8 , "Join Failure (WTP Hardware Not Supported)" },
    { 9 , "Join Failure (Binding Not Supported)" },
    { 10, "Reset Failure (Unable to Reset)" },
    { 11, "Reset Failure (Firmware Write Error)" },
    { 12, "Configuration Failure (Unable to Apply Requested Configuration - Service Provided Anyhow)" },
    { 13, "Configuration Failure (Unable to Apply Requested Configuration - Service Not Provided)" },
    { 14, "Image Data Error (Invalid Checksum)" },
    { 15, "Image Data Error (Invalid Data Length)" },
    { 16, "Image Data Error (Other Error)" },
    { 17, "Image Data Error (Image Already Present)" },
    { 18, "Message Unexpected (Invalid in Current State)" },
    { 19, "Message Unexpected (Unrecognized Request)" },
    { 20, "Failure - Missing Mandatory Message Element" },
    { 21, "Failure - Unrecognized Message Element" },
    { 22, "Data Transfer Error (No Information to Transfer)" },
    { 0 ,     NULL     }
};
/* ************************************************************************* */
/*                      Radio MAC Address Field                              */
/* ************************************************************************* */
static const value_string rmac_field_vals[] = {
    { 0, "Reserved" },
    { 1, "Supported" },
    { 2, "Not Supported" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      Board Data Type Value                                */
/* ************************************************************************* */
#define BOARD_DATA_WTP_MODEL_NUMBER 0
#define BOARD_DATA_WTP_SERIAL_NUMBER 1
#define BOARD_DATA_BOARD_ID 2
#define BOARD_DATA_BOARD_REVISION 3
#define BOARD_DATA_BASE_MAC_ADDRESS 4

static const value_string board_data_type_vals[] = {
    { BOARD_DATA_WTP_MODEL_NUMBER, "WTP Model Number" },
    { BOARD_DATA_WTP_SERIAL_NUMBER, "WTP Serial Number" },
    { BOARD_DATA_BOARD_ID, "Board ID" },
    { BOARD_DATA_BOARD_REVISION, "Board Revision" },
    { BOARD_DATA_BASE_MAC_ADDRESS, "Base MAC Address" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      Descriptor WTP Type Value                            */
/* ************************************************************************* */
#define WTP_DESCRIPTOR_HARDWARE_VERSION 0
#define WTP_DESCRIPTOR_ACTIVE_SOFTWARE_VERSION 1
#define WTP_DESCRIPTOR_BOOT_VERSION 2
#define WTP_DESCRIPTOR_OTHER_SOFTWARE_VERSION 3

static const value_string wtp_descriptor_type_vals[] = {
    { WTP_DESCRIPTOR_HARDWARE_VERSION, "WTP Hardware Version" },
    { WTP_DESCRIPTOR_ACTIVE_SOFTWARE_VERSION, "WTP Active Software Version" },
    { WTP_DESCRIPTOR_BOOT_VERSION, "WTP Boot Version" },
    { WTP_DESCRIPTOR_OTHER_SOFTWARE_VERSION, "WTP Other Software Version" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      AC Information Type Value                            */
/* ************************************************************************* */
#define AC_INFORMATION_HARDWARE_VERSION 4
#define AC_INFORMATION_SOFTWARE_VERSION 5

static const value_string ac_information_type_vals[] = {
    { AC_INFORMATION_HARDWARE_VERSION, "AC Hardware Version" },
    { AC_INFORMATION_SOFTWARE_VERSION, "AC Software Version" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      WTP MAC Type                                         */
/* ************************************************************************* */
static const value_string wtp_mac_vals[] = {
    { 0, "Local MAC" },
    { 1, "Split MAC" },
    { 2, "Both (Local and Split MAC)" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                      WTP Fallback                                         */
/* ************************************************************************* */
static const value_string wtp_fallback_vals[] = {
    { 0, "Reserved" },
    { 1, "Enabled" },
    { 2, "Disabled" },
    { 0,     NULL     }
};
/* ************************************************************************* */
/*                     Last Failure Type                                     */
/* ************************************************************************* */
static const value_string last_failure_type_vals[] = {
    { 0, "Not Supported" },
    { 1, "AC Initiated" },
    { 2, "Link Failure" },
    { 3, "Software Failure" },
    { 4, "Hardware Failure" },
    { 5, "Other Failure" },
    { 255, "Unknown (e.g., WTP doesn't keep track of info)" },
    { 0,     NULL     }
};

/* ************************************************************************* */
/*                     CAPWAP Transport Protocol                             */
/* ************************************************************************* */
static const value_string capwap_transport_protocol_vals[] = {
    { 1, "UDP-Lite" },
    { 2, "UDP" },
    { 0,     NULL     }
};

/* ************************************************************************* */
/*                     ECN Support                                           */
/* ************************************************************************* */
static const value_string ecn_support_vals[] = {
    { 0, "Limited ECN Support" },
    { 1, "Full and Limited ECN Support" },
    { 0,     NULL     }
};

/* ************************************************************************* */
/*                     Add/Update WLAN : Key Status                          */
/* ************************************************************************* */
static const value_string ieee80211_wlan_key_status_vals[] = {
    { 0, "SN Information Element means that the WLAN uses per-station encryption keys" },
    { 1, "static WEP Key" },
    { 2, "Rekeying the GTK with the STA's in the BSS" },
    { 3, "Rekeying the GTK and broadcast" },
    { 0,     NULL     }
};

/* ************************************************************************* */
/*                     Add WLAN : QoS                                        */
/* ************************************************************************* */
static const value_string ieee80211_add_wlan_qos_vals[] = {
    { 0, "Best Effort" },
    { 1, "Video" },
    { 2, "Voice" },
    { 3, "Background" },
    { 0,     NULL     }
};

/* ************************************************************************* */
/*                     Add WLAN : Auth Type                                  */
/* ************************************************************************* */
static const value_string ieee80211_add_wlan_auth_type_vals[] = {
    { 0, "Open System" },
    { 1, "WEP Shared Key" },
    { 0,     NULL     }
};

/* ************************************************************************* */
/*                     Add WLAN : MAC Mode                                   */
/* ************************************************************************* */
static const value_string ieee80211_add_wlan_mac_mode_vals[] = {
    { 0, "Local MAC" },
    { 1, "Split MAC" },
    { 0,     NULL     }
};

/* ************************************************************************* */
/*                     Add WLAN : Tunnel Mode                                */
/* ************************************************************************* */
static const value_string ieee80211_add_wlan_tunnel_mode_vals[] = {
    { 0, "Local Bridging" },
    { 1, "802.3 Tunnel" },
    { 2, "802.11 Tunnel" },
    { 0,     NULL     }
};

/* ************************************************************************* */
/*                     IEE8011 Antenna                                       */
/* ************************************************************************* */
static const value_string ieee80211_antenna_diversity_vals[] = {
    { 0, "Disabled" },
    { 1, "Enabled" },
    { 0, NULL }
};

static const value_string ieee80211_antenna_combiner_vals[] = {
    { 1, "Sectorized (Left)" },
    { 2, "Sectorized (Right)" },
    { 3, "Omni" },
    { 4, "Multiple Input/Multiple Output (MIMO)" },
    { 0, NULL }
};

static const value_string ieee80211_antenna_selection_vals[] = {
    { 1, "Internal Antenna" },
    { 2, "External Antenna" },
    { 0, NULL }
};
/* ************************************************************************* */
/*                     IEE8011 MAC Profile                                   */
/* ************************************************************************* */
static const value_string ieee80211_mac_profile_vals[] = {
    { 0, "Split MAC with WTP encryption" },
    { 1, "Split MAC with AC encryption" },
    { 0,     NULL     }
};

static void
dissect_capwap_data_message_bindings_ieee80211(tvbuff_t *tvb, proto_tree *data_message_binding_tree, guint offset, packet_info *pinfo)
{
    proto_item *data_message_binding_item, *ti;
    proto_tree *sub_data_message_binding_tree;

    if (global_capwap_data_udp_port == pinfo->destport)
    {
        guint16 data_rate;
        /* (WTP -> AC) IEEE 802.11 Frame Info */
        data_message_binding_item = proto_tree_add_item(data_message_binding_tree, hf_capwap_header_wireless_data_ieee80211_fi, tvb, offset, 4, ENC_NA);
        sub_data_message_binding_tree = proto_item_add_subtree(data_message_binding_item, ett_capwap_data_message_bindings_ieee80211);

        proto_tree_add_item(sub_data_message_binding_tree, hf_capwap_header_wireless_data_ieee80211_fi_rssi, tvb, offset, 1, ENC_BIG_ENDIAN);

        proto_tree_add_item(sub_data_message_binding_tree, hf_capwap_header_wireless_data_ieee80211_fi_snr, tvb, offset+1, 1, ENC_BIG_ENDIAN);

        ti = proto_tree_add_item(sub_data_message_binding_tree, hf_capwap_header_wireless_data_ieee80211_fi_data_rate, tvb, offset+2, 2, ENC_BIG_ENDIAN);
        data_rate = tvb_get_ntohs(tvb, offset+2);
        proto_item_append_text(ti, " (%.1f Mb/s)", ((float)data_rate / 10));
    }
    else
    {
        /* (AC -> WTP) IEEE 802.11 Destination Wlans */
        data_message_binding_item = proto_tree_add_item(data_message_binding_tree, hf_capwap_header_wireless_data_ieee80211_dest_wlan,tvb, offset, 4, ENC_NA);
        sub_data_message_binding_tree = proto_item_add_subtree(data_message_binding_item, ett_capwap_data_message_bindings_ieee80211);

        proto_tree_add_item(sub_data_message_binding_tree, hf_capwap_header_wireless_data_ieee80211_dw_wlan_id_bitmap, tvb, offset, 2, ENC_BIG_ENDIAN);

        proto_tree_add_item(sub_data_message_binding_tree, hf_capwap_header_wireless_data_ieee80211_dw_reserved, tvb, offset+2, 2, ENC_BIG_ENDIAN);
    }
}

static void
dissect_capwap_encryption_capabilities(tvbuff_t *tvb, proto_tree *encryption_capabilities_tree, guint offset)
{
    proto_item *encryption_capabilities_item;
    proto_tree *sub_encryption_capabilities_tree;

    encryption_capabilities_item = proto_tree_add_item(encryption_capabilities_tree, hf_capwap_msg_element_type_wtp_descriptor_encrypt, tvb, offset, 3, ENC_NA);
    sub_encryption_capabilities_tree = proto_item_add_subtree(encryption_capabilities_item, ett_capwap_encryption_capability);

    proto_tree_add_item(sub_encryption_capabilities_tree, hf_capwap_msg_element_type_wtp_descriptor_encrypt_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);

    proto_tree_add_item (sub_encryption_capabilities_tree, hf_capwap_msg_element_type_wtp_descriptor_encrypt_wbid, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_item_append_text(encryption_capabilities_item, ": (WBID %d)",tvb_get_guint8(tvb, offset) & 0x1F);


    proto_tree_add_item(sub_encryption_capabilities_tree, hf_capwap_msg_element_type_wtp_descriptor_encrypt_capabilities, tvb, offset+1, 2, ENC_BIG_ENDIAN);
    proto_item_append_text(encryption_capabilities_item, " %d",tvb_get_ntohs(tvb, offset+1));

}

/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_ac_information(tvbuff_t *tvb, proto_tree *ac_information_type_tree, guint offset)
{
    guint optlen,ac_information_type = 0;
    proto_item *ac_information_type_item;
    proto_tree *sub_ac_information_type_tree;

    ac_information_type = tvb_get_ntohs(tvb, offset+4);
    optlen = tvb_get_ntohs(tvb, offset+6);
    ac_information_type_item = proto_tree_add_item(ac_information_type_tree, hf_capwap_msg_element_type_ac_information, tvb, offset, 4+2+2+optlen, ENC_NA );

    proto_item_append_text(ac_information_type_item,": (t=%d,l=%d) %s", ac_information_type, optlen, val_to_str(ac_information_type,ac_information_type_vals,"Unknown AC Information Type (%02d)") );

    sub_ac_information_type_tree = proto_item_add_subtree(ac_information_type_item, ett_capwap_ac_information);

    proto_tree_add_item(sub_ac_information_type_tree, hf_capwap_msg_element_type_ac_information_vendor, tvb, offset, 4, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_ac_information_type_tree, hf_capwap_msg_element_type_ac_information_type, tvb, offset+4, 2, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_ac_information_type_tree, hf_capwap_msg_element_type_ac_information_length, tvb, offset+6, 2, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_ac_information_type_tree, hf_capwap_msg_element_type_ac_information_value, tvb, offset+8, optlen, ENC_NA);

    switch (ac_information_type) {
    case AC_INFORMATION_HARDWARE_VERSION:
        proto_tree_add_item(sub_ac_information_type_tree, hf_capwap_msg_element_type_ac_information_hardware_version, tvb, offset+8, optlen, ENC_ASCII|ENC_NA);
        break;

    case AC_INFORMATION_SOFTWARE_VERSION:
        proto_tree_add_item(sub_ac_information_type_tree, hf_capwap_msg_element_type_ac_information_software_version, tvb, offset+8, optlen, ENC_ASCII|ENC_NA);
        break;

    default:
        /* No Default Action */
        break;
    }
    return 4+2+2+optlen;
}

/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_wtp_descriptor(tvbuff_t *tvb, proto_tree *wtp_descriptor_type_tree, guint offset)
{
    guint optlen,wtp_descriptor_type = 0;
    proto_item *wtp_descriptor_type_item;
    proto_tree *sub_wtp_descriptor_type_tree;

    wtp_descriptor_type = tvb_get_ntohs(tvb, offset+4);
    optlen = tvb_get_ntohs(tvb, offset+6);
    wtp_descriptor_type_item = proto_tree_add_item(wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor, tvb, offset, 4+2+2+optlen, ENC_NA);

    proto_item_append_text(wtp_descriptor_type_item, ": (t=%d,l=%d) %s", wtp_descriptor_type, optlen, val_to_str(wtp_descriptor_type,wtp_descriptor_type_vals,"Unknown WTP Descriptor Type (%02d)") );

    sub_wtp_descriptor_type_tree = proto_item_add_subtree(wtp_descriptor_type_item, ett_capwap_wtp_descriptor);

    proto_tree_add_item(sub_wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor_vendor, tvb, offset, 4, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor_type, tvb, offset+4, 2, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor_length, tvb, offset+6, 2, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor_value, tvb, offset+8, optlen, ENC_NA);

    switch (wtp_descriptor_type) {
    case WTP_DESCRIPTOR_HARDWARE_VERSION:
        proto_tree_add_item(sub_wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor_hardware_version, tvb, offset+8, optlen, ENC_ASCII|ENC_NA);
        break;

    case WTP_DESCRIPTOR_ACTIVE_SOFTWARE_VERSION:
        proto_tree_add_item(sub_wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor_active_software_version, tvb, offset+8, optlen, ENC_ASCII|ENC_NA);
        break;

    case WTP_DESCRIPTOR_BOOT_VERSION:
        proto_tree_add_item(sub_wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor_boot_version, tvb, offset+8, optlen, ENC_ASCII|ENC_NA);
        break;

    case WTP_DESCRIPTOR_OTHER_SOFTWARE_VERSION:
        proto_tree_add_item(sub_wtp_descriptor_type_tree, hf_capwap_msg_element_type_wtp_descriptor_other_software_version, tvb, offset+8, optlen, ENC_ASCII|ENC_NA);
        break;

    default:
        /* No Default Action */
        break;
    }

    return 4+2+2+optlen;
}

/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_board_data(tvbuff_t *tvb, proto_tree *board_data_type_tree, guint offset)
{
    guint optlen,board_data_type = 0;
    proto_item *board_data_type_item;
    proto_tree *sub_board_data_type_tree;

    board_data_type = tvb_get_ntohs(tvb, offset);
    optlen = tvb_get_ntohs(tvb, offset+2);
    board_data_type_item = proto_tree_add_item(board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data, tvb, offset, 2+2+optlen, ENC_NA );

    proto_item_append_text(board_data_type_item, ": (t=%d,l=%d) %s", board_data_type, optlen, val_to_str(board_data_type,board_data_type_vals,"Unknown Board Data Type (%02d)") );

    sub_board_data_type_tree = proto_item_add_subtree(board_data_type_item, ett_capwap_board_data);

    proto_tree_add_item(sub_board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data_type, tvb, offset, 2, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data_value, tvb, offset+4, optlen, ENC_NA);
    switch (board_data_type) {
    case BOARD_DATA_WTP_MODEL_NUMBER:
        proto_tree_add_item(sub_board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data_wtp_model_number, tvb, offset+4, optlen, ENC_ASCII|ENC_NA);
        break;

    case BOARD_DATA_WTP_SERIAL_NUMBER:
        proto_tree_add_item(sub_board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data_wtp_serial_number, tvb, offset+4, optlen, ENC_ASCII|ENC_NA);
        break;

    case BOARD_DATA_BOARD_ID:
        proto_tree_add_item(sub_board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data_wtp_board_id, tvb, offset+4, optlen, ENC_ASCII|ENC_NA);
        break;

    case BOARD_DATA_BOARD_REVISION:
        proto_tree_add_item(sub_board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data_wtp_board_revision, tvb, offset+4, optlen, ENC_ASCII|ENC_NA);
        break;

    case BOARD_DATA_BASE_MAC_ADDRESS:
        proto_tree_add_item(sub_board_data_type_tree, hf_capwap_msg_element_type_wtp_board_data_base_mac_address, tvb, offset+4, 6, ENC_NA);
        break;

    default:
        /* No Default Action */
        break;
    }

    return 2+2+optlen;
}

/* From FortiAP/WiFI 5.2.0


*/
#define VSP_FORTINET_AP_SCAN 16
#define VSP_FORTINET_PASSIVE 24
#define VSP_FORTINET_DAEMON_RST 32
#define VSP_FORTINET_MAC 33
#define VSP_FORTINET_WTP_ALLOW 34
#define VSP_FORTINET_WBH_STA 36
#define VSP_FORTINET_HTCAP 49
#define VSP_FORTINET_MGMT_VAP 50 /* MVAP */
#define VSP_FORTINET_MODE 51
#define VSP_FORTINET_COEXT 52
#define VSP_FORTINET_AMSDU 53
#define VSP_FORTINET_PS_OPT 54
#define VSP_FORTINET_PURE 55
#define VSP_FORTINET_EBP_TAG 56 /* ?? */
#define VSP_FORTINET_TELNET_ENABLE 81
#define VSP_FORTINET_ADMIN_PASSWD 82
#define VSP_FORTINET_REGCODE 83
#define VSP_FORTINET_COUNTRYCODE 84
#define VSP_FORTINET_STA_SCAN 99
#define VSP_FORTINET_FHO 103
#define VSP_FORTINET_APHO 104
#define VSP_FORTINET_STA_LOCATE 106
#define VSP_FORTINET_SPECTRUM_ANALYSIS 108
#define VSP_FORTINET_DARRP_CFG 112
#define VSP_FORTINET_AP_SUPPRESS_LIST 128
#define VSP_FORTINET_WDS 145
#define VSP_FORTINET_VAP_VLAN_TAG 147
#define VSP_FORTINET_VAP_BITMAP 148
#define VSP_FORTINET_MCAST_RATE 149
#define VSP_FORTINET_CFG 150
#define VSP_FORTINET_SPLIT_TUN_CFG 151
#define VSP_FORTINET_MGMT_VLAN_TAG 161
#define VSP_FORTINET_VAP_PSK_PASSWD 167
#define VSP_FORTINET_MESH_ETH_BRIDGE_ENABLE 176
#define VSP_FORTINET_MESH_ETH_BRIDGE_TYPE 177
#define VSP_FORTINET_WTP_CAP 192
#define VSP_FORTINET_TXPWR 193
#define VSP_FORTINET_WIDS_ENABLE 209

static const value_string fortinet_element_id_vals[] = {
    { VSP_FORTINET_AP_SCAN, "AP Scan" },
    { VSP_FORTINET_DAEMON_RST, "Daemon Reset" },
    { VSP_FORTINET_MAC, "MAC" },
    { VSP_FORTINET_PASSIVE, "Passive" },
    { VSP_FORTINET_WTP_ALLOW, "WTP Allow" },
    { VSP_FORTINET_WBH_STA, "Mesh WBH STA" },
    { VSP_FORTINET_HTCAP, "HT Capabilities" },
    { VSP_FORTINET_MGMT_VAP, "Management VAP" },
    { VSP_FORTINET_MODE, "Mode" },
    { VSP_FORTINET_COEXT, "Coext" },
    { VSP_FORTINET_AMSDU, "AMSDU" },
    { VSP_FORTINET_PS_OPT, "PS OPT" },
    { VSP_FORTINET_PURE, "Pure" },
    { VSP_FORTINET_EBP_TAG, "EBP Tag" },
    { VSP_FORTINET_TELNET_ENABLE, "Telnet Enable" },
    { VSP_FORTINET_ADMIN_PASSWD, "Admin Password" },
    { VSP_FORTINET_REGCODE, "Reg Code" },
    { VSP_FORTINET_COUNTRYCODE, "Country Code" },
    { VSP_FORTINET_STA_SCAN, "STA Scan" },
    { VSP_FORTINET_FHO, "FHO" },
    { VSP_FORTINET_APHO, "APHO" },
    { VSP_FORTINET_STA_LOCATE, "STA Locate" },
    { VSP_FORTINET_SPECTRUM_ANALYSIS, "Spectrum Analysis" },
    { VSP_FORTINET_DARRP_CFG, "DARRP Configuration" },
    { VSP_FORTINET_AP_SUPPRESS_LIST, "AP Suppress List" },
    { VSP_FORTINET_WDS, "WDS" },
    { VSP_FORTINET_VAP_VLAN_TAG, "VAP Vlan" },
    { VSP_FORTINET_VAP_BITMAP, "VAP Bitmap" },
    { VSP_FORTINET_MCAST_RATE, "Multicast Rate" },
    { VSP_FORTINET_CFG, "Configuration" },
    { VSP_FORTINET_SPLIT_TUN_CFG, "Split Tunnel Configuration" },
    { VSP_FORTINET_MGMT_VLAN_TAG, "Management Vlan" },
    { VSP_FORTINET_VAP_PSK_PASSWD, "VAP PSK Password" },
    { VSP_FORTINET_MESH_ETH_BRIDGE_ENABLE, "Mesh Eth Bridge Enable" },
    { VSP_FORTINET_MESH_ETH_BRIDGE_TYPE, "Mesh Eth Bridge Type" },
    { VSP_FORTINET_WTP_CAP, "WTP Capabilities" },
    { VSP_FORTINET_TXPWR, "Tx Power" },
    { VSP_FORTINET_WIDS_ENABLE, "WIDS Enable" },
    { 0,     NULL     }
};


static int
dissect_capwap_message_element_vendor_fortinet_type(tvbuff_t *tvb, proto_tree *sub_msg_element_type_tree, guint offset, packet_info *pinfo, guint optlen,  proto_item *msg_element_type_item)
{
    guint element_id, i;

    proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_element_id, tvb, offset, 2, ENC_BIG_ENDIAN);
    element_id = tvb_get_ntohs(tvb, offset);
    proto_item_append_text(msg_element_type_item, ": Fortinet %s", val_to_str(element_id, fortinet_element_id_vals,"Unknown Vendor Specific Element Type (%02d)") );
    offset += 2;

    /* Remove length and element id to optlen */
    optlen -= 6;
    proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_value, tvb, offset, optlen, ENC_NA);

    switch(element_id){
        case VSP_FORTINET_AP_SCAN: /* 16 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_scan_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_scan_bgscan_intv, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_scan_bgscan_idle, tvb, offset, 3, ENC_BIG_ENDIAN);
            offset += 3;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_scan_bgscan_rpt_intv, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_scan_fgscan_rpt_intv, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
        break;
        case VSP_FORTINET_PASSIVE: /* 24 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_passive_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_passive, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_DAEMON_RST: /* 32 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_daemon_rst, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_MAC:{ /* 33 */
            guint mac_length;
            proto_item *ti;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mac_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mac_wid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            ti =proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mac_len, tvb, offset, 1, ENC_BIG_ENDIAN);
            mac_length = tvb_get_guint8(tvb, offset);
            offset += 1;
            if(mac_length %6 != 0)
            {
                expert_add_info(pinfo, ti, &ei_capwap_fortinet_mac_len );
                break;
            }
            for(i = 0; i < mac_length/6; i++){
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mac, tvb, offset, 6, ENC_NA);
                offset += 6;
            }
            }
        break;
        case VSP_FORTINET_WTP_ALLOW: /* 34 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wtp_allow_sn, tvb, offset, optlen-1, ENC_ASCII|ENC_NA);
            offset += optlen - 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wtp_allow_allow, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_WBH_STA:{ /* 36 */
            guint mac_length;
            proto_item *ti;

            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wbh_sta_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            ti = proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wbh_sta_len, tvb, offset, 1, ENC_BIG_ENDIAN);
            mac_length = tvb_get_guint8(tvb, offset);
            offset += 1;
            if(mac_length %6 != 0)
            {
                expert_add_info(pinfo, ti, &ei_capwap_fortinet_mac_len );
                break;
            }
            for(i = 0; i < mac_length/6; i++){
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wbh_sta_mac, tvb, offset, 6, ENC_NA);
                offset += 6;
            }
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wbh_sta_bssid, tvb, offset, 6, ENC_NA);
            offset += 6;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wbh_sta_mhc, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            }
        break;
        case VSP_FORTINET_HTCAP: /* 49 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_htcap_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_htcap_mcs, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_htcap_gi, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_htcap_bw, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_MGMT_VAP:{ /* 50 */
            guint16 sn_length;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mvap_sn_length, tvb, offset, 2, ENC_NA);
            sn_length = tvb_get_ntohs(tvb, offset);
            offset += 2;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mvap_sn, tvb, offset, sn_length, ENC_ASCII|ENC_NA);
            offset += sn_length;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mvap_unknown, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mvap_unknown, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mvap_age, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mvap_period, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mvap_vfid, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
        break;
        }
        case VSP_FORTINET_MODE: /* 51 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mode_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_COEXT: /* 52 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_coext_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_coext, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_AMSDU: /* 53 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_amsdu_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_amsdu, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_PS_OPT: /* 54 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ps_opt_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ps_opt, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_PURE: /* 55 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_pure_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_pure, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_EBP_TAG: /* 56 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ebptag_ebp, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ebptag_tag, tvb, offset, 6, ENC_NA);
            offset += 6;
        break;
        case VSP_FORTINET_TELNET_ENABLE: /* 81 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_telnet_enable, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
        break;
        case VSP_FORTINET_ADMIN_PASSWD: /* 82 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_admin_passwd, tvb, offset, optlen, ENC_ASCII|ENC_NA);
            offset += optlen;
        break;
        case VSP_FORTINET_REGCODE: /* 83 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_regcode, tvb, offset, 3, ENC_ASCII|ENC_NA);
            offset += 3;
        break;
        case VSP_FORTINET_COUNTRYCODE: /* 84 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_countrycode_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_countrycode_code, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_countrycode_string, tvb, offset, 3, ENC_ASCII|ENC_NA);
            offset += 3;
        break;
        case VSP_FORTINET_STA_SCAN: /* 99 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_sta_scan_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_sta_scan, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
        break;
        case VSP_FORTINET_FHO: /* 103 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_fho_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_fho, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_APHO: /* 104 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_apho_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_apho, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_STA_LOCATE: /* 106 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_sta_locate_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_sta_locate_enable, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_sta_locate_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
        break;
        case VSP_FORTINET_SPECTRUM_ANALYSIS: /* 108 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_sa_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            optlen -= 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_sa_enable, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            optlen -= 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_sa_ssid, tvb, offset, optlen, ENC_ASCII|ENC_NA);
            offset += optlen;
        break;
        case VSP_FORTINET_DARRP_CFG: /* 112 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_darrp_cfg_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_darrp_cfg_enable, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_darrp_cfg_interval, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_AP_SUPPRESS_LIST: /* 128 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_suppress_list_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_suppress_list_op, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_suppress_list_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_ap_suppress_list_len, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_WDS: /* 145 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wds_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wds_wid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wds_enable, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_VAP_VLAN_TAG: /* 147 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_vap_vlan_tag_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_vap_vlan_tag_wid, tvb, offset, 1, ENC_BIG_ENDIAN);
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_vap_vlan_tag, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
        break;
        case VSP_FORTINET_VAP_BITMAP: /* 148 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_vap_bitmap_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_vap_bitmap, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
        break;
        case VSP_FORTINET_MCAST_RATE: /* 149 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mcast_rate_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mcast_rate_wid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mcast_rate, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
        break;
        case VSP_FORTINET_CFG: /* 150 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_cfg_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_cfg_wid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_cfg_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_cfg_mask, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
        break;
        case VSP_FORTINET_SPLIT_TUN_CFG: /* 151 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_split_tun_cfg_enable_local_subnet, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_split_tun_cfg_cnt, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_MGMT_VLAN_TAG: /* 161 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mgmt_vlan_id, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
        break;
        case VSP_FORTINET_VAP_PSK_PASSWD: /* 167 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_vap_psk_passwd_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            optlen -= 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_vap_psk_passwd_wid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            optlen -= 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_vap_psk_passwd_key, tvb, offset, optlen, ENC_ASCII|ENC_NA);
            offset += optlen;
        break;
        case VSP_FORTINET_MESH_ETH_BRIDGE_ENABLE: /* 176 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mesh_eth_bridge_enable, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_FORTINET_MESH_ETH_BRIDGE_TYPE: /* 177 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_mesh_eth_bridge_type, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
        break;
        case VSP_FORTINET_WTP_CAP: /* 192 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wtp_cap, tvb, offset, optlen, ENC_NA);
            offset += optlen;
        break;
        case VSP_FORTINET_TXPWR: /* 193 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_txpwr_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_txpwr, tvb, offset, 2, ENC_NA);
            offset += 2;
        break;
        case VSP_FORTINET_WIDS_ENABLE: /* 209 */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wids_enable_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_wids_enable, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
        break;
        case 146: /* VAP (ak Virtual AP) stuff, there is Radio ID and Wlan ID to start... */
        case 152:
        case 153:
        case 163:
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_unknown_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            optlen -= 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_unknown_wid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            optlen -= 1;
            expert_add_info_format(pinfo, msg_element_type_item, &ei_capwap_message_element_fortinet_type,
                                 "Dissector for CAPWAP Vendor Specific (Fortinet) Message Element"
                                 " (%d) type not implemented (VAP Stuff..)", element_id);
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_unknown, tvb, offset, optlen, ENC_NA);
            offset += optlen;
        break;

        case 65: /* Radio stuff, there is Radio ID  to start... */
        case 170:
        case 171:
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_unknown_rid, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            optlen -= 1;
            expert_add_info_format(pinfo, msg_element_type_item, &ei_capwap_message_element_fortinet_type,
                                 "Dissector for CAPWAP Vendor Specific (Fortinet) Message Element"
                                 " (%d) type not implemented (VAP Stuff..)", element_id);
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_unknown, tvb, offset, optlen, ENC_NA);
            offset += optlen;
        break;
        default:
            expert_add_info_format(pinfo, msg_element_type_item, &ei_capwap_message_element_fortinet_type,
                                 "Dissector for CAPWAP Vendor Specific (Fortinet) Message Element"
                                 " (%d) type not implemented", element_id);
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_fortinet_unknown, tvb, offset, optlen, ENC_NA);
            offset += optlen;
        break;
    }

    return offset;
}

/* From Cisco WLC with help of actube  (http://www.github.com/7u83/actube */

/* Copy and rename (CW_ => VSP_ for actube/capwap/capwap_cisco.h (revision g387cc5da) */
#define VSP_CISCO_AP_NAME 5
#define VSP_CISCO_MWAR 6
#define VSP_CISCO_AP_TIMESYNC 151

#define VSP_CISCO_MWAR_ADDR                 2
#define VSP_CISCO_RAD                       3
#define VSP_CISCO_RAD_SLOT                  4
#define VSP_CISCO_RAD_NAME                  5
#define VSP_CISCO_MWAR                      6
#define VSP_CISCO_ADD_WLAN                  7
#define VSP_CISCO_WTP_RADIO_CFG             8

#define VSP_CISCO_MULTI_DOMAIN_CAPAB        10
#define VSP_CISCO_MAC_OPERATION             11

#define VSP_CISCO_TX_POWER                  12
#define VSP_CISCO_TX_POWER_LEVELS           13
#define VSP_CISCO_DIRECT_SEQUENCE_CONTROL   14
#define VSP_CISCO_SUPPORTED_RATES           16

#define VSP_CISCO_80211_DELETE_WLAN         28

#define VSP_CISCO_MWAR_NAME                 31

#define VSP_CISCO_LOCATION_DATA             35
#define VSP_CISCO_STATISTICS_TIMER          37

#define VSP_CISCO_ANTENNA_PAYLOAD           41

#define VSP_CISCO_CERTIFICATE               44
#define VSP_CISCO_WTP_BOARD_DATA            50
#define VSP_CISCO_AP_MODE_AND_TYPE          54
#define VSP_CISCO_AP_QOS                    57
#define VSP_CISCO_AC_IPV4_LIST              59

#define VSP_CISCO_AP_STATIC_IP_ADDR         83
#define VSP_CISCO_SIG_PAYLOAD               84
#define VSP_CISCO_SIG_TOGGLE                87

#define VSP_CISCO_AC_NAME_WITH_INDEX        91
#define VSP_CISCO_SPAM_DOMAIN_SECRET        96

#define VSP_CISCO_SPAM_VENDOR_SPECIFIC      104

#define VSP_CISCO_AP_UPTIME                 108

#define VSP_CISCO_AP_GROUP_NAME             123

#define VSP_CISCO_AP_LED_STATE_CONFIG       125
#define VSP_CISCO_AP_REGULATORY_DOMAIN      126
#define VSP_CISCO_AP_MODEL                  127
#define VSP_CISCO_AP_RESET_BUTTON_STATE     128

#define VSP_CISCO_LWAPP_CHANNEL_POWER       134
#define VSP_CISCO_AP_PRE_STD_SWITCH_CONFIG  137
#define VSP_CISCO_AP_POWER_INJECTOR_CONFIG  138

#define VSP_CISCO_AP_MINIOS_VERSION         149
#define VSP_CISCO_AP_TIMESYNC               151
#define VSP_CISCO_AP_DOMAIN                 169
#define VSP_CISCO_AP_DNS                    170

#define VSP_CISCO_AP_BACKUP_SOFTWARE_VERSION 183
#define VSP_CISCO_BOARD_DATA_OPTIONS        207
#define VSP_CISCO_MWAR_TYPE                 208
#define VSP_CISCO_80211_ASSOC_LIMIT         213
#define VSP_CISCO_TLV_PAYLOAD               215
#define VSP_CISCO_AP_LOG_FACILITY           224
#define VSP_CISCO_AP_RETRANSMIT_PARAM       240
#define VSP_CISCO_AP_VENUE_SETTINGS         249


static const value_string cisco_element_id_vals[] = {
    { VSP_CISCO_MWAR_ADDR, "MWAR Address" },
    { VSP_CISCO_RAD, "RAD" },
    { VSP_CISCO_RAD_SLOT, "RAD Slot" },
    { VSP_CISCO_RAD_NAME, "RAD (AP) Name" },
    { VSP_CISCO_MWAR, "MWAR" },
    { VSP_CISCO_ADD_WLAN, "Add WLAN" },
    { VSP_CISCO_WTP_RADIO_CFG, "WTP Radio Configuration" },

    { VSP_CISCO_MULTI_DOMAIN_CAPAB, "Multi Domain Capability" },
    { VSP_CISCO_MAC_OPERATION, "MAC Operation" },

    { VSP_CISCO_TX_POWER, "TX Power" },
    { VSP_CISCO_TX_POWER_LEVELS, "TX Power Levels" },
    { VSP_CISCO_DIRECT_SEQUENCE_CONTROL, "Direct Sequence Control" },
    { VSP_CISCO_SUPPORTED_RATES, "Supported Rates" },

    { VSP_CISCO_80211_DELETE_WLAN, "802.11 Delete WLAN" },

    { VSP_CISCO_MWAR_NAME, "MWAR NAME" },

    { VSP_CISCO_LOCATION_DATA, "Location Data" },
    { VSP_CISCO_STATISTICS_TIMER, "Statistics Timer" },

    { VSP_CISCO_ANTENNA_PAYLOAD, "Antenna Payload" },

    { VSP_CISCO_CERTIFICATE, "Certificate" },
    { VSP_CISCO_WTP_BOARD_DATA, "WTP Board Data" },
    { VSP_CISCO_AP_MODE_AND_TYPE, "AP Mode and Type" },

    { VSP_CISCO_AP_QOS, "AP QoS"},
    { VSP_CISCO_AC_IPV4_LIST, "AC IPv4 List" },

    { VSP_CISCO_AP_STATIC_IP_ADDR, "AP Static IP Addr" },
    { VSP_CISCO_SIG_PAYLOAD, "SIG Payload" },
    { VSP_CISCO_SIG_TOGGLE, "SIG Toggle" },

    { VSP_CISCO_AC_NAME_WITH_INDEX, "AC Name with Index" },
    { VSP_CISCO_SPAM_DOMAIN_SECRET, "SPAM Domain Secret" },

    { VSP_CISCO_SPAM_VENDOR_SPECIFIC, "SPAM Vendor Specific" },

    { VSP_CISCO_AP_UPTIME, "AP Uptime" },

    { VSP_CISCO_AP_GROUP_NAME, "AP Group Name" },
    { VSP_CISCO_AP_MODEL, "AP Model" },
    { VSP_CISCO_AP_RESET_BUTTON_STATE, "AP reset button state" },

    { VSP_CISCO_AP_LED_STATE_CONFIG, "AP Led State Config" },
    { VSP_CISCO_AP_REGULATORY_DOMAIN, "AP Regulatory domain" },

    { VSP_CISCO_LWAPP_CHANNEL_POWER, "LWAPP Channel Power" },
    { VSP_CISCO_AP_PRE_STD_SWITCH_CONFIG, "AP Pre STD Switch Config" },
    { VSP_CISCO_AP_POWER_INJECTOR_CONFIG, "AP Power Injector config" },

    { VSP_CISCO_AP_MINIOS_VERSION, "AP MinIOS Version" },
    { VSP_CISCO_AP_TIMESYNC, "AP Time Sync" },
    { VSP_CISCO_AP_DOMAIN, "AP Domain" },
    { VSP_CISCO_AP_DNS, "AP DNS" },

    { VSP_CISCO_AP_BACKUP_SOFTWARE_VERSION, "AP Backup software version" },
    { VSP_CISCO_BOARD_DATA_OPTIONS, "Board Data Options" },
    { VSP_CISCO_MWAR_TYPE, "MWAR Type" },
    { VSP_CISCO_80211_ASSOC_LIMIT, "802.11 Assoc Limit" },
    { VSP_CISCO_TLV_PAYLOAD, "TLV Payload" },
    { VSP_CISCO_AP_LOG_FACILITY, "AP Log Facility" },

    { VSP_CISCO_AP_RETRANSMIT_PARAM, "AP Retransmit Param" },
    { VSP_CISCO_AP_VENUE_SETTINGS, "AP Venue Settings" },
    { 0,     NULL     }
};

static const value_string cisco_ap_mode_and_type_mode_vals[] = {
    { 0, "Split MAC / Local Mode" },
    { 1, "Monitor" },
    { 2, "Local MAC / FlexConnect" },
    { 3, "Rogue Detector" },
    { 4, "Sniffer" },
    { 0,     NULL     }
};


static int
dissect_capwap_message_element_vendor_cisco_type(tvbuff_t *tvb, proto_tree *sub_msg_element_type_tree, guint offset, packet_info *pinfo, guint optlen,  proto_item *msg_element_type_item)
{
    guint element_id;

    proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_element_id, tvb, offset, 2, ENC_BIG_ENDIAN);
    element_id = tvb_get_ntohs(tvb, offset);
    proto_item_append_text(msg_element_type_item, ": Cisco %s", val_to_str(element_id, cisco_element_id_vals,"Unknown Vendor Specific Element Type (%02d)") );
    offset += 2;

    /* Remove length and element id to optlen */
    optlen -= 6;
    proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_value, tvb, offset, optlen, ENC_NA);

    switch(element_id){
        case VSP_CISCO_MWAR_ADDR: /* MWAR Address (2) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_type, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
        break;
        case VSP_CISCO_RAD_NAME: /* RAD (AP) Name (5) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_rad_name, tvb, offset, optlen, ENC_ASCII|ENC_NA);
            offset += optlen;
        break;
        case VSP_CISCO_MWAR: /* MWAR (6) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_type, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_hardware, tvb, offset, 4, ENC_ASCII|ENC_NA);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_software, tvb, offset, 4, ENC_ASCII|ENC_NA);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_active_ms, tvb, offset, 2, ENC_NA);
            offset += 2;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_supported_ms, tvb, offset, 2, ENC_NA);
            offset += 2;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_active_rad, tvb, offset, 2, ENC_NA);
            offset += 2;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_supported_rad, tvb, offset, 2, ENC_NA);
            offset += 2;
        break;
        case VSP_CISCO_AP_MODE_AND_TYPE: /* AP_MODE_AND_TYPE (54) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_mode_and_type_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_mode_and_type_type, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        break;
        case VSP_CISCO_AP_STATIC_IP_ADDR: /* AP_MODE_AND_TYPE (83) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_static_ip_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_static_ip_netmask, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_static_ip_gateway, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_static_ip_type, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_static_ip_reserved, tvb, offset, 4, ENC_NA);
            offset += 4;
        break;
        case VSP_CISCO_AP_UPTIME: /* AP Uptime (108) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_uptime_current, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_uptime_last, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;
        break;
        case VSP_CISCO_AP_GROUP_NAME: /* AP Group Name (123) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_group_name, tvb, offset, optlen, ENC_ASCII|ENC_NA);
            offset += optlen;
        break;
        case VSP_CISCO_AP_LED_STATE_CONFIG: /* AP Led State (125) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_led_state, tvb, offset, 2, ENC_NA);
            offset += 2;
        break;
        case VSP_CISCO_AP_TIMESYNC: /* AP Timesync (151) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_timesync, tvb, offset, 4, ENC_NA);
            offset += 4;

            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_ap_timesync_type, tvb, offset, 1, ENC_NA);
            offset += 1;
        break;
        case VSP_CISCO_BOARD_DATA_OPTIONS: /* Board Data Options (207) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_board_data_options_ant_type, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_board_data_options_flex_connect, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_board_data_options_ap_type, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_board_data_options_join_priority, tvb, offset, 1, ENC_NA);
            offset += 1;
        break;

        case VSP_CISCO_MWAR_TYPE: /* MWAR_TYPE (208) */
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_mwar_type, tvb, offset, 1, ENC_NA);
            offset += 1;
        break;
        default:
            expert_add_info_format(pinfo, msg_element_type_item, &ei_capwap_message_element_cisco_type,
                                 "Dissector for CAPWAP Vendor Specific (Cisco) Message Element"
                                 " (%d) type not implemented", element_id);
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_cisco_unknown, tvb, offset, optlen, ENC_NA);
            offset += optlen;
        break;
    }

    return offset;
}
/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_message_element_type(tvbuff_t *tvb, proto_tree *msg_element_type_tree, guint offset, packet_info *pinfo)
{
    guint optlen, offset_end, number_encrypt, i, msg_element_type = 0;
    proto_item *msg_element_type_item, *msg_element_type_item_flag, *ti_len, *ti_type;
    proto_tree *sub_msg_element_type_tree, *sub_msg_element_type_flag_tree;

    msg_element_type = tvb_get_ntohs(tvb, offset);
    optlen = tvb_get_ntohs(tvb, offset+2);
    msg_element_type_item = proto_tree_add_item(msg_element_type_tree, hf_capwap_msg_element, tvb, offset, 2+2+optlen, ENC_NA );

    proto_item_append_text(msg_element_type_item, ": (t=%d,l=%d) %s", msg_element_type, optlen, val_to_str(msg_element_type,message_element_type_vals,"Unknown Message Element Type (%02d)") );

    sub_msg_element_type_tree = proto_item_add_subtree(msg_element_type_item, ett_capwap_message_element_type);

    ti_type = proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type, tvb, offset, 2, ENC_BIG_ENDIAN);

    ti_len = proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);

    proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_value, tvb, offset+4, optlen, ENC_NA);

    switch (msg_element_type) {
    case TYPE_AC_DESCRIPTOR: /* AC Descriptor (1) */
        if (optlen < 12) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "AC Descriptor length %u wrong, must be >= 12", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_descriptor_stations, tvb, offset+4, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_descriptor_limit, tvb, offset+6, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_descriptor_active_wtp, tvb, offset+8, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_descriptor_max_wtp, tvb, offset+10, 2, ENC_BIG_ENDIAN);

        /* AC Descriptor Security Flags... */
        proto_tree_add_bitmask_with_flags(sub_msg_element_type_tree, tvb, offset+12,
hf_capwap_msg_element_type_ac_descriptor_security, ett_capwap_ac_descriptor_security_flags, capwap_ac_descriptor_security_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);

        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_descriptor_rmac_field, tvb, offset+13, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_descriptor_reserved, tvb, offset+14, 1, ENC_BIG_ENDIAN);

        /* AC Descriptor DTLS Flags... */
        proto_tree_add_bitmask_with_flags(sub_msg_element_type_tree, tvb, offset+15,
hf_capwap_msg_element_type_ac_descriptor_dtls_policy, ett_capwap_ac_descriptor_dtls_flags,  capwap_ac_descriptor_dtls_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);

        offset_end = offset + optlen -4;
        offset += 4 + 12;
        while (offset < offset_end) {
            offset += dissect_capwap_ac_information(tvb, sub_msg_element_type_tree, offset);
        }
        break;

    case TYPE_AC_IPV4_LIST: /* AC IPv4 List (2) */
        if (optlen < 4) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "AC IPv4 List length %u wrong, must be >= 4", optlen);
        break;
        }
        offset += 4;

        if (optlen%4 == 0)
        {
            for (i = 0; i < optlen/4; i++)
            {
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_ipv4_list, tvb, offset, 4, ENC_BIG_ENDIAN);
                offset += 4;
            }

        }
        break;
    case TYPE_AC_IPV6_LIST: /* AC IPv6 List (3) */
        if (optlen < 16) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "AC IPv6 List length %u wrong, must be >= 4", optlen);
        break;
        }
        offset += 4;

        if (optlen%16 == 0)
        {
            for (i = 0; i < optlen/16; i++)
            {
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_ipv6_list, tvb, offset, 16, ENC_NA);
                offset += 16;
            }

        }
        break;
    case TYPE_AC_NAME: /* AC Name (4) */
        if (optlen < 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "AC Name length %u wrong, must be >= 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_name, tvb, offset+4, optlen, ENC_ASCII|ENC_NA);
        break;

    case TYPE_AC_NAME_W_PRIORITY: /* AC Name With Priority (5) */
        if (optlen < 2) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "AC Name with Priority length %u wrong, must be >= 2", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_name_with_priority, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_name, tvb, offset+5, optlen-1, ENC_ASCII|ENC_NA);
        break;

    case TYPE_AC_TIMESTAMP: /* AC Timestamp (6) */
        if (optlen != 4) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "AC Timestamp length %u wrong, must be = 4", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ac_timestamp, tvb, offset + 4, 4, ENC_TIME_SECS_NTP|ENC_BIG_ENDIAN);
        break;

    case TYPE_ADD_STATION:{ /* Add Station (8) */
        guint8 maclength;
        if (optlen < 8) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Add Station length %u wrong, must be >= 8", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_add_station_radio_id, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_add_station_length, tvb, offset + 5, 1, ENC_BIG_ENDIAN);
        maclength = tvb_get_guint8(tvb, offset+5);
        switch(maclength){
            case 6:
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_add_station_mac_eui48, tvb, offset+6, maclength, ENC_NA);
            break;
            case 8:
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_add_station_mac_eui64, tvb, offset+6, maclength, ENC_BIG_ENDIAN);
            break;
            default:
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_add_station_mac_data, tvb, offset+6, maclength, ENC_NA);
            break;
        }

        if(optlen -(2 + maclength)) {
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_add_station_vlan_name, tvb, offset+6+maclength, optlen -(2 + maclength), ENC_ASCII|ENC_NA);
        }
        }
        break;

    case TYPE_CAPWAP_CONTROL_IPV4_ADDRESS: /* CAPWAP Control IPv4 Address (10) */
        if (optlen != 6) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "CAPWAP Control IPv4 Address length %u wrong, must be = 6", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_control_ipv4, tvb, offset+4, 4, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_control_wtp_count, tvb, offset+8, 2, ENC_BIG_ENDIAN);
        break;

    case TYPE_CAPWAP_CONTROL_IPV6_ADDRESS: /* CAPWAP Control IPv6 Address (11) */
        if (optlen != 18) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "CAPWAP Control IPv6 Address length %u wrong, must be = 18", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_control_ipv6, tvb, offset+4, 16, ENC_NA);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_control_wtp_count, tvb, offset+20, 2, ENC_BIG_ENDIAN);
        break;

    case TYPE_CAPWAP_TIMERS: /* CAPWAP Timers (12) */
        if (optlen != 2) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "CAPWAP Timers length %u wrong, must be = 2", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_timers_discovery, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_timers_echo_request, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        break;

    case TYPE_DECRYPTION_ERROR_REPORT_PERIOD: /* Decryption Error Report Period (16) */
        if (optlen != 3) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Decryption Error Report Period length %u wrong, must be = 3", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_decryption_error_report_period_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree,hf_capwap_msg_element_type_decryption_error_report_period_interval, tvb, offset+5, 2, ENC_BIG_ENDIAN);
        break;

    case TYPE_DELETE_STATION:{ /* Delete Station (18) */
        guint8 maclength;
        if (optlen < 8) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Delete Station length %u wrong, must be >= 8", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_delete_station_radio_id, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_delete_station_length, tvb, offset + 5, 1, ENC_BIG_ENDIAN);
        maclength = tvb_get_guint8(tvb, offset+5);
        switch(maclength){
            case 6:
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_delete_station_mac_eui48, tvb, offset+6, maclength, ENC_NA);
            break;
            case 8:
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_delete_station_mac_eui64, tvb, offset+6, maclength, ENC_BIG_ENDIAN);
            break;
            default:
                proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_delete_station_mac_data, tvb, offset+6, maclength, ENC_NA);
            break;
        }

        }
        break;

    case TYPE_DISCOVERY_TYPE: /* Discovery Type (20) */
        if (optlen != 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Discovery Type length %u wrong, must be = 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_discovery_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        break;
    case TYPE_IDLE_TIMEOUT: /* Idle Timeout (23) */
        if (optlen != 4) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Idle Timeout length %u wrong, must be = 4", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_idle_timeout, tvb, offset+4, 4, ENC_BIG_ENDIAN);
        break;

    case TYPE_LOCATION_DATA: /* Location Data (28) */
        if (optlen < 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Location Data length %u wrong, must be >= 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_location_data, tvb, offset+4, optlen, ENC_ASCII|ENC_NA);
        break;

    case TYPE_MAXIMUM_MESSAGE_LENGTH: /* Maximum Message Length (29) */
        if (optlen != 2) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Maximum Message length %u wrong, must be = 2", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_maximum_message_length, tvb, offset+4, 2, ENC_BIG_ENDIAN);
        break;

    case TYPE_CAPWAP_LOCAL_IPV4_ADDRESS: /* CAPWAP Local IPv4 Address (30) */
        if (optlen != 4) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "CAPWAP Local IPv4 Address length %u wrong, must be = 4", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_local_ipv4_address, tvb, offset+4, 4, ENC_BIG_ENDIAN);
        break;


    case TYPE_RADIO_ADMINISTRATIVE_STATE: /* Radio Administrative State (31) */
        if (optlen != 2) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Radio Administrative State length %u wrong, must be = 2", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_radio_admin_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_radio_admin_state, tvb, offset+5, 1, ENC_BIG_ENDIAN);

        break;

    case TYPE_RADIO_OPERATIONAL_STATE: /* Radio Operational State (32) */
        if (optlen != 3) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Radio Operational State length %u wrong, must be = 3", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_radio_op_state_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_radio_op_state_radio_state, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_radio_op_state_radio_cause, tvb, offset+6, 1, ENC_BIG_ENDIAN);
        break;

    case TYPE_RESULT_CODE: /* Result Code (33) */
        if (optlen != 4) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Result Code length %u wrong, must be = 4", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_result_code, tvb, offset+4, 4, ENC_BIG_ENDIAN);

        break;

    case TYPE_SESSION_ID: /* Session ID (35) */
        if (optlen != 16) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Session ID length %u wrong, must be = 16", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_session_id, tvb, offset+4, 16, ENC_NA);
        break;

    case TYPE_STATISTICS_TIMER: /* Statistics Timer (36) */
        if (optlen != 2) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Statistics Timer length %u wrong, must be = 2", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_statistics_timer, tvb, offset+4, 2, ENC_BIG_ENDIAN);
        break;

    case TYPE_VENDOR_SPECIFIC_PAYLOAD:{ /* Vendor Specific Payload (37) */
        guint32 vendor_id;
        if (optlen < 7) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "Vendor Specific Payload length %u wrong, must be >= 7", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_vsp_vendor_identifier, tvb, offset+4, 4, ENC_BIG_ENDIAN);
        vendor_id = tvb_get_ntohl(tvb, offset+4);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_vsp_vendor_element_id, tvb, offset+8, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_vsp_vendor_data, tvb, offset+10, optlen-6, ENC_NA);
        switch(vendor_id){
            case VENDOR_FORTINET:
                dissect_capwap_message_element_vendor_fortinet_type(tvb, sub_msg_element_type_tree, offset+8, pinfo, optlen, msg_element_type_item);
            break;
            case VENDOR_CISCO_WIFI:
                dissect_capwap_message_element_vendor_cisco_type(tvb, sub_msg_element_type_tree, offset+8, pinfo, optlen, msg_element_type_item);
            break;
            default:
                /* No default... */
            break;
        }
        }
        break;

    case TYPE_WTP_BOARD_DATA: /* WTP Board Data (38) */
        if (optlen < 14) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "WTP Board Data length %u wrong, must be >= 14", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_board_data_vendor, tvb, offset+4, 4, ENC_BIG_ENDIAN);
        offset += 8;
        offset_end = offset + optlen -4;
        while (offset < offset_end) {
            offset += dissect_capwap_board_data(tvb, sub_msg_element_type_tree, offset);
        }
        break;

    case TYPE_WTP_DESCRIPTOR: /* WTP Descriptor (39) */
        if (optlen < 33) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "WTP Descriptor length %u wrong, must be >= 33", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_descriptor_max_radios, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_descriptor_radio_in_use, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        if (global_capwap_draft_8_cisco == 0)
        {
            number_encrypt = tvb_get_guint8(tvb,offset+6);
            msg_element_type_item_flag = proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_descriptor_number_encrypt, tvb, offset+6, 1, ENC_BIG_ENDIAN);
            sub_msg_element_type_flag_tree = proto_item_add_subtree(msg_element_type_item_flag, ett_capwap_encryption_capabilities);
            for (i=0; i < number_encrypt; i++) {
                dissect_capwap_encryption_capabilities(tvb, sub_msg_element_type_flag_tree, offset+4+3+i*3);
            }
            offset_end = offset + optlen -4;
            offset += 4 + 3 + number_encrypt * 3;
        }
        else
        {
            /*in Draft 8, there is only one "encryption_capabilities*/
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_descriptor_encrypt_capabilities, tvb, offset+6, 2, ENC_BIG_ENDIAN);
            offset_end = offset + optlen -4;
            offset += 6 + 2;
        }
        while (offset < offset_end) {
            offset += dissect_capwap_wtp_descriptor(tvb, sub_msg_element_type_tree, offset);
        }
        break;

    case TYPE_WTP_FALLBACK: /* WTP Fallback (40) */
        if (optlen != 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "WTP Fallback length %u wrong, must be = 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_fallback, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        break;

    case TYPE_WTP_FRAME_TUNNEL_MODE: /* WTP Frame Tunnel Mode (41) */
        if (optlen != 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "WTP Frame Tunnel Mode length %u wrong, must be = 1", optlen);
        break;
        }

        proto_tree_add_bitmask_with_flags(sub_msg_element_type_tree, tvb, offset+4,
hf_capwap_msg_element_type_wtp_frame_tunnel_mode, ett_capwap_wtp_frame_tunnel_mode, capwap_wtp_frame_tunnel_mode_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        break;
    case TYPE_WTP_MAC_TYPE: /* WTP MAC Type (44) */
        if (optlen != 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "WTP MAC Type length %u wrong, must be = 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_mac_type, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        break;

    case TYPE_WTP_NAME: /* WTP Name (45) */
        if (optlen < 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "WTP Name length %u wrong, must be >= 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_name, tvb, offset+4, optlen, ENC_ASCII|ENC_NA);
        break;

    case TYPE_WTP_REBOOT_STATISTICS: /* WTP Reboot Statistics (48) */
        if (optlen != 15) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "WTP Reboot Statistics length %u wrong, must be = 15", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_reboot_statistics_reboot_count, tvb, offset+4, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_reboot_statistics_ac_initiated_count, tvb, offset+6, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_reboot_statistics_link_failure_count, tvb, offset+8, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_reboot_statistics_sw_failure_count, tvb, offset+10, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_reboot_statistics_hw_failure_count, tvb, offset+12, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_reboot_statistics_other_failure_count, tvb, offset+14, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_reboot_statistics_unknown_failure_count, tvb, offset+16, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_wtp_reboot_statistics_last_failure_type, tvb, offset+18, 1, ENC_BIG_ENDIAN);
        break;

    case TYPE_CAPWAP_LOCAL_IPV6_ADDRESS: /* CAPWAP Local IPv6 Address (50) */
        if (optlen != 16) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "CAPWAP Local IPv6 Address length %u wrong, must be = 16", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_local_ipv6_address, tvb, offset+4, 16, ENC_NA);
        break;

    case TYPE_CAPWAP_TRANSPORT_PROTOCOL: /* CAPWAP Transport Protocol (51) */
        if (optlen != 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "CAPWAP Transport Protocol length %u wrong, must be = 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_capwap_transport_protocol, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        break;

    case TYPE_MTU_DISCOVERY_PADDING: /* MTU Discovery Padding (52) */
        if (optlen < 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "MTU Discovery Padding length %u wrong, must be >= 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_mtu_discovery_padding, tvb, offset+4, optlen, ENC_NA);
        break;


    case TYPE_ECN_SUPPORT: /* ECN Support (53) */
        if (optlen != 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "ECN Support length %u wrong, must be = 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ecn_support, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        break;

    case IEEE80211_ADD_WLAN:{ /* ieee80211 Add WLAN (1024) */
        guint16 key_length;
        if (optlen < 20) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Add Wlan length %u wrong, must be >= 20", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_wlan_id, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bitmask_with_flags(sub_msg_element_type_tree, tvb, offset+6,
hf_capwap_msg_element_type_ieee80211_add_wlan_capability, ett_capwap_ieee80211_add_wlan_capability, ieee80211_add_wlan_capability_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_key_index, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_key_status, tvb, offset+9, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_key_length, tvb, offset+10, 2, ENC_BIG_ENDIAN);
        key_length = tvb_get_ntohs(tvb, offset+10);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_key, tvb, offset+12, key_length, ENC_NA);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_group_tsc, tvb, offset+key_length+12, 6, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_qos, tvb, offset+key_length+18, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_auth_type, tvb, offset+key_length+19, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_mac_mode, tvb, offset+key_length+20, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_tunnel_mode, tvb, offset+key_length+21, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_suppress_ssid, tvb, offset+key_length+22, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_add_wlan_ssid, tvb, offset+key_length+23, optlen-(key_length+23-4), ENC_ASCII|ENC_NA);
        }
        break;

    case IEEE80211_ANTENNA:{ /* ieee80211 Antenna (1025) */
        guint8 antenna_count, antenna = 0;
        if (optlen < 5) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Antenna length %u wrong, must be >= 5", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_antenna_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_antenna_diversity, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_antenna_combiner, tvb, offset+6, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_antenna_count, tvb, offset+7, 1, ENC_BIG_ENDIAN);
        antenna_count = tvb_get_guint8(tvb, offset+7);
        while(antenna < antenna_count){
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_antenna_selection, tvb, offset+8+antenna, 1, ENC_BIG_ENDIAN);
            antenna += 1;
        }
    }
    break;

    case IEEE80211_ASSIGNED_WTP_BSSID: /* ieee80211 Assigned WTP BSSID (1026) */
        if (optlen != 8) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Assigned WTP BSSID length %u wrong, must be = 8", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_wlan_id, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_bssid, tvb, offset+6, 6, ENC_NA);
        break;

    case IEEE80211_DELETE_WLAN: /* ieee80211 Delete WLAN (1027) */
        if (optlen != 2) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Delete Wlan length %u wrong, must be = 2", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_delete_wlan_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_delete_wlan_wlan_id, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        break;

    case IEEE80211_DIRECT_SEQUENCE_CONTROL: /* ieee80211 Direct Sequence Control (1028) */
        if (optlen != 8) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Direct Sequence Control length %u wrong, must be = 8", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_direct_sequence_control_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_direct_sequence_control_reserved, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_direct_sequence_control_current_channel, tvb, offset+6, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_direct_sequence_control_current_cca, tvb, offset+7, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_direct_sequence_control_energy_detect_threshold, tvb, offset+8, 4, ENC_BIG_ENDIAN);
        break;

    case IEEE80211_INFORMATION_ELEMENT: /* ieee80211 Information Element (1029) */
        if (optlen < 4) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Information Element length %u wrong, must be >= 4", optlen);
        break;
        }
        offset += 4;
        offset_end = offset + optlen;

        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_ie_radio_id, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset += 1;

        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_ie_wlan_id, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset += 1;

        proto_tree_add_bitmask_with_flags(sub_msg_element_type_tree, tvb, offset,
hf_capwap_msg_element_type_ieee80211_ie_flags, ett_capwap_ieee80211_ie_flags, ieee80211_ie_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        offset += 1;

        while (offset < offset_end) {
            offset += add_tagged_field(pinfo, sub_msg_element_type_tree, tvb, offset, 0, NULL, 0, NULL);
        }

        break;

    case IEEE80211_MAC_OPERATION: /* ieee80211 MAC Operation (1030) */
        if (optlen != 16) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 MAC Operation length %u wrong, must be = 16", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_operation_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_operation_reserved, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_operation_rts_threshold, tvb, offset+6, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_operation_short_retry, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_operation_long_retry, tvb, offset+9, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_operation_fragmentation_threshold, tvb, offset+10, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_operation_tx_msdu_lifetime, tvb, offset+12, 4, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_operation_rx_msdu_lifetime, tvb, offset+16, 4, ENC_BIG_ENDIAN);
        break;

    case IEEE80211_MIC_COUNTERMEASURES: /* ieee80211 MIC Countermeasures (1031) */
        if (optlen != 8) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 MIC Countermeasures length %u wrong, must be = 8", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mic_countermeasures_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mic_countermeasures_wlan_id, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mic_countermeasures_mac_address, tvb, offset+6, 6, ENC_NA);
        break;

    case IEEE80211_MULTI_DOMAIN_CAPABILITY: /* ieee80211 Multi-Domain Capability (1032) */
        if (optlen != 8) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Multi-Domain Capability length %u wrong, must be = 8", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_multi_domain_capability_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_multi_domain_capability_reserved, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_multi_domain_capability_first_channel, tvb, offset+6, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_multi_domain_capability_number_of_channels, tvb, offset+8, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_multi_domain_capability_max_tx_power_level, tvb, offset+10, 2, ENC_BIG_ENDIAN);
        break;

    case IEEE80211_OFDM_CONTROL: /* ieee80211 OFDM Control (1033) */
        if (optlen != 8) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 OFDM Control length %u wrong, must be = 8", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_ofdm_control_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_ofdm_control_reserved, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_ofdm_control_current_channel, tvb, offset+6, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bitmask_with_flags(sub_msg_element_type_tree, tvb, offset+7, hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support, ett_capwap_ieee80211_ofdm_control_band_support, ieee80211_ofdm_control_band_support_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);

        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_ofdm_control_ti_threshold, tvb, offset+8, 4, ENC_BIG_ENDIAN);
        break;

    case IEEE80211_RATE_SET: /* ieee80211 Rate Set (1034) */
        if (optlen < 3) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Rate Set length %u wrong, must be >= 3", optlen);
        break;
        }
        offset += 4;
        offset_end = offset + optlen;

        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_rate_set_radio_id, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset += 1;

        while (offset < offset_end) {
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_rate_set_rate_set, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        }


        break;
    case IEEE80211_STATION: /* ieee80211 Station (1036) */
        if (optlen < 14) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Station length %u wrong, must be >= 14", optlen);
        break;
        }
        offset_end = offset + 4 + optlen;
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_association_id, tvb, offset+5, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_flags, tvb, offset+7, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_mac_address, tvb, offset+8, 6, ENC_NA);
        proto_tree_add_bitmask_with_flags(sub_msg_element_type_tree, tvb, offset+14,
hf_capwap_msg_element_type_ieee80211_station_capabilities, ett_capwap_ieee80211_station_capabilities, ieee80211_station_capabilities_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_wlan_id, tvb, offset+16, 1, ENC_BIG_ENDIAN);

        offset += 17;
        while (offset < offset_end) {
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_supported_rates, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        }

        break;

    case IEEE80211_STATION_SESSION_KEY: /* ieee80211 Station Session Key (1038) */
        if (optlen < 25) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Station Session Key length %u wrong, must be >= 25", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_session_key_mac, tvb, offset+4, 6, ENC_NA);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_session_key_flags, tvb, offset+10, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_session_key_flags_a, tvb, offset+10, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_session_key_flags_c, tvb, offset+10, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_session_key_pairwire_tsc, tvb, offset+12, 6, ENC_NA);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_session_key_pairwire_rsc, tvb, offset+18, 6, ENC_NA);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_station_session_key_key, tvb, offset+24, optlen-24, ENC_NA);
        break;

    case IEEE80211_SUPPORTED_RATES: /* ieee80211 Supported Rates (1040) */
        if (optlen < 3) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Supported Rates length %u wrong, must be >= 3", optlen);
        break;
        }
        offset += 4;
        offset_end = offset + optlen;

        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_supported_rates_radio_id, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset += 1;

        while (offset < offset_end) {
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_supported_rates_rate, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset += 1;
        }
        break;

    case IEEE80211_TX_POWER: /* ieee80211 Tx Power (1041) */
        if (optlen != 4) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Tx Power length %u wrong, must be = 4", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_tx_power_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_tx_power_reserved, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_tx_power_current_tx_power, tvb, offset+6, 2, ENC_BIG_ENDIAN);
        break;

    case IEEE80211_TX_POWER_LEVEL:{ /* ieee80211 Tx Power Level (1042) */
        guint8 num_levels, level = 0;
        if (optlen < 3) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Antenna length %u wrong, must be >= 3", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_tx_power_level_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_tx_power_level_num_levels, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        num_levels = tvb_get_guint8(tvb, offset+5);
        while(level < num_levels){
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_tx_power_level_power_level, tvb, offset+6+(level*2), 2, ENC_BIG_ENDIAN);
            level += 1;
        }
        }
        break;

    case IEEE80211_UPDATE_WLAN:{ /* ieee80211 Update WLAN (1044) */
        guint16 key_length;
        if (optlen < 8) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Update Wlan length %u wrong, must be >= 8", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_update_wlan_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_update_wlan_wlan_id, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bitmask_with_flags(sub_msg_element_type_tree, tvb, offset+6,
hf_capwap_msg_element_type_ieee80211_update_wlan_capability, ett_capwap_ieee80211_update_wlan_capability, ieee80211_update_wlan_capability_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_update_wlan_key_index, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_update_wlan_key_status, tvb, offset+9, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_update_wlan_key_length, tvb, offset+10, 2, ENC_BIG_ENDIAN);
        key_length = tvb_get_ntohs(tvb, offset+10);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_update_wlan_key, tvb, offset+12, key_length, ENC_NA);
        }
        break;

    case IEEE80211_WTP_RADIO_CONFIGURATION: /* ieee80211 WTP Radio Configuration (1046) */
        if (optlen != 16) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 WTP Radio Configuration length %u wrong, must be = 16", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_short_preamble, tvb, offset+5, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_num_of_bssids, tvb, offset+6, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_dtim_period, tvb, offset+7, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_bssid, tvb, offset+8, 6, ENC_NA);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_beacon_period, tvb, offset+14, 2, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_country_string, tvb, offset+16, 4, ENC_ASCII|ENC_NA);
        break;

    case IEEE80211_WTP_RADIO_INFORMATION: /* ieee80211 WTP Radio Information (1048) */
        if (optlen != 5) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 WTP Radio Information length %u wrong, must be = 5", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_id, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_reserved, tvb, offset+5, 3, ENC_NA);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_n, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_g, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_a, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_b, tvb, offset+8, 1, ENC_BIG_ENDIAN);
        break;



    case IEEE80211_SUPPORTED_MAC_PROFILES:{ /* ieee80211 Supported MAC Profiles (1060) */
        guint8 num_profiles;
        if (optlen < 2) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 Supported MAC Profiles length %u wrong, must be >= 2", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_supported_mac_profiles_numbers, tvb, offset+4, 1, ENC_BIG_ENDIAN);
        num_profiles = tvb_get_guint8(tvb ,offset);
        while(num_profiles){
            proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_supported_mac_profiles_profile, tvb, offset+5, 1, ENC_BIG_ENDIAN);
            offset += 1;
            num_profiles--;
        }
        }
        break;

    case IEEE80211_MAC_PROFILE: /* ieee80211 MAC Profile (1061) */
        if (optlen != 1) {
            expert_add_info_format(pinfo, ti_len, &ei_capwap_msg_element_length,
                           "IEEE80211 MAC Profile length %u wrong, must be = 1", optlen);
        break;
        }
        proto_tree_add_item(sub_msg_element_type_tree, hf_capwap_msg_element_type_ieee80211_mac_profile, tvb, offset+4, 1, ENC_BIG_ENDIAN);

        break;

    default:
      expert_add_info_format(pinfo, ti_type, &ei_capwap_message_element_type,
                             "Dissector for CAPWAP Message Element"
                             " (%s) type not implemented, Contact"
                             " Wireshark developers if you want this supported",
                             val_to_str(msg_element_type, message_element_type_vals, "(%d)"));
        break;
    }

    return 2+2+optlen;
}

/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_message_element(tvbuff_t *tvb, proto_tree *capwap_control_tree, guint offset, packet_info *pinfo)
{
    guint plen = 0, offset_end;
    proto_item *ti;
    proto_tree *capwap_message_element_tree;

    ti = proto_tree_add_item(capwap_control_tree, hf_capwap_message_element, tvb, offset, tvb_reported_length(tvb) - offset, ENC_NA);
    capwap_message_element_tree = proto_item_add_subtree(ti, ett_capwap_message_element);

    offset_end = tvb_reported_length(tvb);

    while (offset+plen < offset_end) {
        plen += dissect_capwap_message_element_type(tvb, capwap_message_element_tree, offset+plen, pinfo);
    }

    return plen;
}

/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_data_keep_alive(tvbuff_t *tvb, packet_info *pinfo, proto_tree *capwap_data_tree, guint offset)
{
    guint16 len;
    guint plen = 0, offset_end;
    proto_item *ti;
    proto_tree *capwap_data_keep_alive_tree;

    ti = proto_tree_add_item(capwap_data_tree, hf_capwap_data_keep_alive, tvb, offset, tvb_reported_length(tvb), ENC_NA);
    capwap_data_keep_alive_tree = proto_item_add_subtree(ti, ett_capwap_data_keep_alive);

    ti = proto_tree_add_item(capwap_data_keep_alive_tree, hf_capwap_data_keep_alive_length, tvb, offset, 2, ENC_BIG_ENDIAN);
    len = tvb_get_ntohs(tvb, offset);
    if (len != tvb_reported_length(tvb))
        expert_add_info(pinfo, ti, &ei_capwap_data_keep_alive_length);

    plen += 2;

    offset_end = tvb_reported_length(tvb);

    while (offset+plen < offset_end) {
        plen += dissect_capwap_message_element_type(tvb, capwap_data_keep_alive_tree, offset+plen, pinfo);
    }

    return plen;
}

/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_control_header(tvbuff_t *tvb, proto_tree *capwap_control_tree, guint offset, packet_info *pinfo)
{
    guint plen = 0;
    proto_item *ti, *ti_flag;
    proto_tree *capwap_control_header_tree;
    proto_tree *capwap_control_msg_type_tree;

    ti = proto_tree_add_item(capwap_control_tree, hf_capwap_control_header, tvb, offset, 8, ENC_NA);
    capwap_control_header_tree = proto_item_add_subtree(ti, ett_capwap_control_header);

    /* Message Type 32 bits */
    ti_flag = proto_tree_add_item(capwap_control_header_tree, hf_capwap_control_header_msg_type, tvb, offset, 4, ENC_BIG_ENDIAN);
    capwap_control_msg_type_tree = proto_item_add_subtree(ti_flag, ett_capwap_control_header_msg);

    proto_tree_add_item(capwap_control_msg_type_tree, hf_capwap_control_header_msg_type_enterprise_nbr, tvb, offset, 3, ENC_BIG_ENDIAN);
    proto_tree_add_item(capwap_control_msg_type_tree, hf_capwap_control_header_msg_type_enterprise_specific, tvb, offset, 4, ENC_BIG_ENDIAN);

    col_append_fstr(pinfo->cinfo, COL_INFO, " - %s",val_to_str(tvb_get_ntohl(tvb, offset),message_type,"Unknown Message Type (0x%x)"));

    plen += 4;
    /* Sequence 8 bits */
    proto_tree_add_item(capwap_control_header_tree, hf_capwap_control_header_seq_number, tvb, offset+plen, 1, ENC_BIG_ENDIAN);
    plen += 1;

    /* Message Element Length 16 bits */
    proto_tree_add_item(capwap_control_header_tree, hf_capwap_control_header_msg_element_length, tvb, offset+plen, 2, ENC_BIG_ENDIAN);
    plen += 2;
    /* Flags 8 bits */
    proto_tree_add_item(capwap_control_header_tree, hf_capwap_control_header_flags, tvb, offset+plen, 1, ENC_BIG_ENDIAN);
    plen += 1;
    return plen;
}

/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_header(tvbuff_t *tvb, proto_tree *capwap_control_tree, guint offset, packet_info *pinfo, guint8 *payload_type, guint8 *payload_wbid, gboolean *fragment_is, gboolean *fragment_more, guint32 *fragment_id, guint32 *fragment_offset)
{
    guint plen = 0, hlen = 0;
    proto_item *ti, *ti_flag, *ti_len;
    proto_tree *capwap_header_tree;
    proto_tree *capwap_header_flags_tree;
    guint flags = 0;
    guint8 maclength, wirelesslength;
    guint align = 0;

    /* RFC 5415  HLEN:  A 5-bit field containing the length of the CAPWAP transport header in 4-byte words */
    /* As we display the preamble separately reduce the length by 1 */
    hlen = tvb_get_bits8(tvb, (offset+plen)*8, 5)*4-1;
    ti = proto_tree_add_item(capwap_control_tree, hf_capwap_header, tvb, offset+plen, hlen, ENC_NA);
    capwap_header_tree = proto_item_add_subtree(ti, ett_capwap_header);

    /* Header Length : 5 Bits */
    ti_len = proto_tree_add_item(capwap_header_tree, hf_capwap_header_hlen, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
    proto_item_append_text(ti_len, " (%d)",hlen+1);
    /* Radio ID : 5 Bits */
    proto_tree_add_item(capwap_header_tree, hf_capwap_header_rid, tvb, offset+plen, 3, ENC_BIG_ENDIAN);

    /* Wireless Binding ID : 5 Bits */
    proto_tree_add_item(capwap_header_tree, hf_capwap_header_wbid, tvb, offset+plen, 3, ENC_BIG_ENDIAN);

    /* WBid of Payload (for CAPWAP Data Packet) */
    *payload_wbid = tvb_get_bits8(tvb, (offset+plen)*8+10, 5);

    /* Flags : 9 Bits */
    flags = tvb_get_bits16(tvb, (offset+plen)*8+15, 9, ENC_BIG_ENDIAN);
    ti_flag = proto_tree_add_item(capwap_header_tree, hf_capwap_header_flags, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
    capwap_header_flags_tree = proto_item_add_subtree(ti_flag, ett_capwap_header_flags);

    proto_tree_add_item(capwap_header_flags_tree, hf_capwap_header_flags_t, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
    proto_tree_add_item(capwap_header_flags_tree, hf_capwap_header_flags_f, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
    proto_tree_add_item(capwap_header_flags_tree, hf_capwap_header_flags_l, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
    proto_tree_add_item(capwap_header_flags_tree, hf_capwap_header_flags_w, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
    proto_tree_add_item(capwap_header_flags_tree, hf_capwap_header_flags_m, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
    proto_tree_add_item(capwap_header_flags_tree, hf_capwap_header_flags_k, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
    proto_tree_add_item(capwap_header_flags_tree, hf_capwap_header_flags_r, tvb, offset+plen, 3, ENC_BIG_ENDIAN);

    /* Fragment ??*/
    *fragment_is = ((flags & 0x80) == 0x80) ? TRUE : FALSE;
    *fragment_more = ((flags &0x40) == 0x40) ? FALSE : TRUE;

    /* Type of Payload (for CAPWAP Data Packet), use 0xff for Keep-Alive */
    if (flags &0x08 /* data channel Keep-Alive packet */) {
        col_append_str(pinfo->cinfo, COL_INFO, " Keep-Alive");
        *payload_type = 0xff;
    } else
        *payload_type = tvb_get_bits8(tvb, (offset+plen)*8+15,1);

    plen += 3;

    /* Fragment ID : 16 Bits */
    proto_tree_add_item(capwap_header_tree, hf_capwap_header_fragment_id, tvb, offset+plen, 2, ENC_BIG_ENDIAN);
    *fragment_id = (guint32)tvb_get_ntohs(tvb, offset+plen);
    plen += 2;

    /* Fragment offset : 13 Bits */
    proto_tree_add_item(capwap_header_tree, hf_capwap_header_fragment_offset, tvb, offset+plen, 2, ENC_BIG_ENDIAN);
    *fragment_offset = 8 * (guint32)tvb_get_bits16(tvb, (offset+plen)*8, 13, ENC_BIG_ENDIAN);

    /* Reserved 3 Bits */
    proto_tree_add_item(capwap_header_tree, hf_capwap_header_reserved, tvb, offset+plen+1, 1, ENC_BIG_ENDIAN);
    plen += 2;
    /* Optionnal Headers */
    if (flags & 0x10 /* Radio MAC address */) {
        maclength=tvb_get_guint8(tvb, offset+plen);
        proto_tree_add_item(capwap_header_tree, hf_capwap_header_mac_length, tvb, offset+plen, 1, ENC_BIG_ENDIAN);
        plen += 1;
        if (maclength == 6) {
            proto_tree_add_item(capwap_header_tree, hf_capwap_header_mac_eui48, tvb, offset+plen, maclength, ENC_NA);

        } else if (maclength == 8) {
            proto_tree_add_item(capwap_header_tree, hf_capwap_header_mac_eui64, tvb, offset+plen, maclength, ENC_BIG_ENDIAN);
        } else {
            proto_tree_add_item(capwap_header_tree, hf_capwap_header_mac_data, tvb, offset+plen, maclength, ENC_NA);
        }
        plen += maclength;
        /* 4 Bytes Alignment ? */
        align = 4-((offset+plen)%4);
        if (align != 4)
        {
            proto_tree_add_item(capwap_header_tree, hf_capwap_header_padding, tvb, offset+plen, align, ENC_NA);
            plen += align;
        }
    }
    if (flags & 0x20 /* Wireless specific information */) {
        wirelesslength=tvb_get_guint8(tvb, offset+plen);

        /* in Draft 8, the WBid is add in Wireless Specific Information*/
        if (global_capwap_draft_8_cisco == 1)
        {
            plen += 1;
            wirelesslength = 4;
        }
        proto_tree_add_item(capwap_header_tree, hf_capwap_header_wireless_length, tvb, offset+plen, 1, ENC_BIG_ENDIAN);
        plen += 1;
        proto_tree_add_item(capwap_header_tree, hf_capwap_header_wireless_data, tvb, offset+plen, wirelesslength, ENC_NA);

        /* Optional Wireless Specific Information for ieee80211 (wbid = 1) Section 4 of RFC5416 */
        if (*payload_wbid == 1)
        {
            dissect_capwap_data_message_bindings_ieee80211(tvb, capwap_header_tree, offset+plen, pinfo);
        }

        plen += wirelesslength;
        /* 4 Bytes Alignment ? */
        align = 4-((offset+plen)%4);
        if (align != 4)
        {
            proto_tree_add_item(capwap_header_tree, hf_capwap_header_padding, tvb, offset+plen, align, ENC_NA);
            plen += align;
        }
    }
    if ((plen != hlen) && global_capwap_draft_8_cisco == 0)
    {
        expert_add_info_format(pinfo, ti_len, &ei_capwap_header_length_bad, "Wrong calculate length (%d) =! header length (%d) ! (May be try to use Cisco Wireless Controller Support Preference ?)", plen, hlen);
    }
    return hlen;
}

/* Returns the number of bytes consumed by this option. */
static int
dissect_capwap_preamble(tvbuff_t *tvb, proto_tree *capwap_control_tree, guint offset, guint8 *type_header)
{
    guint plen = 0;
    proto_item *ti;
    proto_tree *capwap_preamble_tree;

    ti = proto_tree_add_item(capwap_control_tree, hf_capwap_preamble, tvb, offset+plen, -1, ENC_NA);
    capwap_preamble_tree = proto_item_add_subtree(ti, ett_capwap_preamble);

    proto_tree_add_item(capwap_preamble_tree, hf_capwap_preamble_version, tvb, offset+plen, 1, ENC_BIG_ENDIAN);
    proto_tree_add_item(capwap_preamble_tree, hf_capwap_preamble_type, tvb, offset+plen, 1, ENC_BIG_ENDIAN);
    *type_header = tvb_get_guint8(tvb, offset+plen) & 0x0F;
    plen++;
    /* DTLS Header ? */
    if (*type_header == 1) {
        proto_tree_add_item(capwap_preamble_tree, hf_capwap_preamble_reserved, tvb, offset+plen, 3, ENC_BIG_ENDIAN);
        plen +=3;
    }
    proto_item_set_len(ti, plen);
    return plen;
}

/* Code to actually dissect the packets */
static int
dissect_capwap_control(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    proto_item *ti;
    proto_tree *capwap_control_tree;
    guint offset = 0;
    tvbuff_t *next_tvb = NULL;
    guint8 type_header;
    guint8 payload_type;
    guint8 payload_wbid;
    gboolean fragment_is;
    gboolean fragment_more;
    guint32 fragment_id;
    guint32 fragment_offset;
    fragment_head *frag_msg = NULL;
    gboolean save_fragmented;

    col_set_str(pinfo->cinfo, COL_PROTOCOL, "CAPWAP-Control");
    col_set_str(pinfo->cinfo, COL_INFO, "CAPWAP-Control");

    ti = proto_tree_add_item(tree, proto_capwap_control, tvb, 0, -1, ENC_NA);
    capwap_control_tree = proto_item_add_subtree(ti, ett_capwap_control);

    /* CAPWAP Preamble */
    offset += dissect_capwap_preamble(tvb, capwap_control_tree, offset, &type_header);

    if (type_header == 1) {
        next_tvb = tvb_new_subset_remaining (tvb, offset);
        call_dissector(dtls_handle, next_tvb, pinfo, tree);
        return offset;
    }

    /* CAPWAP Header */
    offset += dissect_capwap_header(tvb, capwap_control_tree, offset, pinfo, &payload_type, &payload_wbid, &fragment_is, &fragment_more, &fragment_id, &fragment_offset );

    /* CAPWAP Reassemble */
    save_fragmented = pinfo->fragmented;

    if (global_capwap_reassemble && fragment_is)
    {
        const int len_rem = tvb_reported_length_remaining(tvb, offset);
        if (len_rem <= 0)
            return offset;

        pinfo->fragmented = TRUE;

        frag_msg = fragment_add_check(&capwap_reassembly_table,
                                      tvb, offset, pinfo, fragment_id, NULL,
                                      fragment_offset,
                                      len_rem,
                                      fragment_more);

        next_tvb = process_reassembled_data(tvb, offset, pinfo,
                                            "Reassembled CAPWAP", frag_msg,
                                            &capwap_frag_items, NULL, tree);

        if (next_tvb == NULL)
        { /* make a new subset */
            next_tvb = tvb_new_subset_remaining(tvb, offset);
            call_data_dissector(next_tvb, pinfo, tree);
            col_append_fstr(pinfo->cinfo, COL_INFO, " (Fragment ID: %u, Fragment Offset: %u)", fragment_id, fragment_offset);
        }
        else
        {
            /* CAPWAP Control Header */
            offset = dissect_capwap_control_header(next_tvb, capwap_control_tree, 0, pinfo);

            /* CAPWAP Message Element */
            offset += dissect_capwap_message_element(next_tvb, capwap_control_tree, offset, pinfo);
            col_append_fstr(pinfo->cinfo, COL_INFO, " (Reassembled, Fragment ID: %u)", fragment_id);
        }
    }
    else
    {
        /* CAPWAP Control Header */
        offset += dissect_capwap_control_header(tvb, capwap_control_tree, offset, pinfo);

        /* CAPWAP Message Element */
        offset += dissect_capwap_message_element(tvb, capwap_control_tree, offset, pinfo);
    }
    pinfo->fragmented = save_fragmented;
    return offset;
}

static int
dissect_capwap_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
    proto_item *ti;
    proto_tree *capwap_data_tree;
    guint offset = 0;
    tvbuff_t *next_tvb;
    guint8 type_header;
    guint8 payload_type;
    guint8 payload_wbid;
    gboolean fragment_is;
    gboolean fragment_more;
    guint32 fragment_id;
    guint32 fragment_offset;
    fragment_head *frag_msg = NULL;
    gboolean save_fragmented;


    col_set_str(pinfo->cinfo, COL_PROTOCOL, "CAPWAP-Data");
    col_set_str(pinfo->cinfo, COL_INFO, "CAPWAP-Data");

    ti = proto_tree_add_item(tree, proto_capwap_data, tvb, 0, -1, ENC_NA);
    capwap_data_tree = proto_item_add_subtree(ti, ett_capwap_data);

    /* CAPWAP Preamble */
    offset += dissect_capwap_preamble(tvb, capwap_data_tree, offset, &type_header);

    if (type_header == 1) {
        next_tvb = tvb_new_subset_remaining (tvb, offset);
        call_dissector(dtls_handle, next_tvb, pinfo, tree);
        return tvb_captured_length(tvb);
    }

    /* CAPWAP Header */
    offset += dissect_capwap_header(tvb, capwap_data_tree, offset, pinfo, &payload_type, &payload_wbid, &fragment_is, &fragment_more, &fragment_id, &fragment_offset);

    /* CAPWAP Reassemble */
    save_fragmented = pinfo->fragmented;

    if (global_capwap_reassemble && fragment_is)
    {
        gint len_rem = tvb_reported_length_remaining(tvb, offset);
        if (len_rem <= 0)
            return offset;

        pinfo->fragmented = TRUE;

        frag_msg = fragment_add_check(&capwap_reassembly_table,
                                      tvb, offset, pinfo, fragment_id, NULL,
                                      fragment_offset,
                                      len_rem,
                                      fragment_more);

        next_tvb = process_reassembled_data(tvb, offset, pinfo,
                                            "Reassembled CAPWAP", frag_msg,
                                            &capwap_frag_items, NULL, tree);

        if (next_tvb == NULL)
        { /* make a new subset */
            next_tvb = tvb_new_subset_remaining(tvb, offset);
            call_data_dissector(next_tvb, pinfo, tree);
            col_append_fstr(pinfo->cinfo, COL_INFO, " (Fragment ID: %u, Fragment Offset: %u)", fragment_id, fragment_offset);
            return tvb_captured_length(tvb);
        }
        else
        {
            col_append_fstr(pinfo->cinfo, COL_INFO, " (Reassembled, Fragment ID: %u)", fragment_id);
        }
    }
    else
    {
        next_tvb = tvb_new_subset_remaining (tvb, offset);
    }

    /* CAPWAP Data Payload */
    if (payload_type == 0) {
        /* IEEE 802.3 Frame */
        call_dissector(ieee8023_handle, next_tvb, pinfo, tree);
    }
    else if (payload_type == 0xff) {
        /* CAPWAP Keep-Alive Payload */
        dissect_capwap_data_keep_alive(next_tvb, pinfo, capwap_data_tree, 0);
    }
    else
    {
        switch (payload_wbid) {
        case 0: /* Reserved - Cisco seems to use this instead of 1 */
            /* It seems that just calling ieee80211_handle is not
             * quite enough to get this right, so call data dissector
             * for now:
             */
            call_data_dissector(next_tvb, pinfo, tree);
            break;
        case 1: /* IEEE 802.11 */
            call_dissector(global_capwap_swap_frame_control ? ieee80211_bsfc_handle : ieee80211_handle, next_tvb, pinfo, tree);
            break;
        default: /* Unknown Data */
            call_data_dissector(next_tvb, pinfo, tree);
            break;
        }
    }
    pinfo->fragmented = save_fragmented;
    return tvb_captured_length(tvb);
}

static void
apply_capwap_prefs(void)
{
  global_capwap_data_udp_port = prefs_get_uint_value("capwap.data", "udp.port");
}

void
proto_register_capwap_control(void)
{
    module_t *capwap_module;

    static hf_register_info hf[] = {
        /* Preamble */
        { &hf_capwap_preamble,
            { "Preamble", "capwap.preamble",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_preamble_version,
            { "Version", "capwap.preamble.version",
              FT_UINT8, BASE_DEC, NULL, 0xF0,
              "Version of CAPWAP", HFILL }
        },
        { &hf_capwap_preamble_type,
            { "Type", "capwap.preamble.type",
              FT_UINT8, BASE_DEC, VALS(type_header_vals), 0x0F,
              "Type of Payload", HFILL }
        },
        { &hf_capwap_preamble_reserved,
            { "Reserved", "capwap.preamble.reserved",
              FT_UINT24, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        /* CAPWAP Header */
        { &hf_capwap_header,
            { "Header", "capwap.header",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_hlen,
            { "Header Length", "capwap.header.length",
              FT_UINT24, BASE_DEC, NULL, 0xF80000,
              "Length of the CAPWAP transport header in 4-byte words (similar to IP header length)", HFILL }
        },
        { &hf_capwap_header_rid,
            { "Radio ID", "capwap.header.rid",
              FT_UINT24, BASE_DEC, NULL, 0x07C000,
              NULL, HFILL }
        },
        { &hf_capwap_header_wbid,
            { "Wireless Binding ID", "capwap.header.wbid",
              FT_UINT24, BASE_DEC, VALS(type_wbid), 0x003E00,
              NULL, HFILL }
        },
        { &hf_capwap_header_flags,
            { "Header Flags", "capwap.header.flags",
              FT_UINT24, BASE_HEX, NULL, 0x0001FF,
              NULL, HFILL }
        },
        { &hf_capwap_header_flags_t,
            { "Payload Type", "capwap.header.flags.t",
              FT_BOOLEAN, 24, TFS(&flag_type_t), 0x0000100,
              NULL, HFILL }
        },
        { &hf_capwap_header_flags_f,
            { "Fragment", "capwap.header.flags.f",
              FT_BOOLEAN, 24, TFS(&flag_type_f), 0x000080,
              NULL, HFILL }
        },
        { &hf_capwap_header_flags_l,
            { "Last Fragment", "capwap.header.flags.l",
              FT_BOOLEAN, 24, TFS(&flag_type_l), 0x000040,
              NULL, HFILL }
        },
        { &hf_capwap_header_flags_w,
        { "Wireless header", "capwap.header.flags.w",
            FT_BOOLEAN, 24, TFS(&flag_type_w), 0x000020,
            NULL, HFILL }
        },
        { &hf_capwap_header_flags_m,
            { "Radio MAC header", "capwap.header.flags.m",
              FT_BOOLEAN, 24, TFS(&flag_type_m), 0x000010,
              NULL, HFILL }
        },
        { &hf_capwap_header_flags_k,
            { "Keep-Alive", "capwap.header.flags.k",
              FT_BOOLEAN, 24, TFS(&flag_type_k), 0x000008,
              NULL, HFILL }
        },
        { &hf_capwap_header_flags_r,
            { "Reserved", "capwap.header.flags.r",
              FT_UINT24, BASE_HEX, 0x0, 0x000007,
              NULL, HFILL }
        },
        { &hf_capwap_header_fragment_id,
            { "Fragment ID", "capwap.header.fragment.id",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_fragment_offset,
            { "Fragment Offset", "capwap.header.fragment.offset",
              FT_UINT16, BASE_DEC, NULL, 0xFFF8,
              NULL, HFILL }
        },
        { &hf_capwap_header_reserved,
            { "Reserved", "capwap.header.fragment.reserved",
              FT_UINT16, BASE_DEC, NULL, 0x0007,
              NULL, HFILL }
        },
        { &hf_capwap_header_mac_length,
            { "MAC length", "capwap.header.mac.length",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_mac_eui48,
            { "MAC address", "capwap.header.mac.eui48",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_mac_eui64,
            { "MAC address", "capwap.header.mac.eui64",
              FT_EUI64, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_mac_data,
            { "MAC address", "capwap.header.mac.data",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_wireless_length,
            { "Wireless length", "capwap.header.wireless.length",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_wireless_data,
            { "Wireless data", "capwap.header.wireless.data",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_wireless_data_ieee80211_fi,
            { "Wireless data ieee80211 Frame Info", "capwap.header.wireless.data.ieee80211.fi",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_wireless_data_ieee80211_fi_rssi,
            { "Wireless data ieee80211 RSSI (dBm)", "capwap.header.wireless.data.ieee80211.fi.rssi",
              FT_INT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_wireless_data_ieee80211_fi_snr,
            { "Wireless data ieee80211 SNR (dB)", "capwap.header.wireless.data.ieee80211.fi.snr",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_wireless_data_ieee80211_fi_data_rate,
            { "Wireless data ieee80211 Data Rate (Mbps)", "capwap.header.wireless.data.ieee80211.fi.data_rate",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_wireless_data_ieee80211_dest_wlan,
            { "Wireless data ieee80211 Destination WLANs", "capwap.header.wireless.data.ieee80211.dw",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
            },
        { &hf_capwap_header_wireless_data_ieee80211_dw_wlan_id_bitmap,
            { "Wireless data ieee80211 Destination Wlan Id bitmap",
            "capwap.header.wireless.data.ieee80211.dw.wlan_id_bitmap",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_wireless_data_ieee80211_dw_reserved,
            { "Wireless data ieee80211 Destination Wlan reserved", "capwap.header.wireless.data.ieee80211.dw.reserved",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_header_padding,
            { "Padding for 4 Byte Alignement", "capwap.header.padding",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },

        /* CAPWAP Control Header Message */

        { &hf_capwap_control_header,
            { "Control Header", "capwap.control.header",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_control_header_msg_type,
            { "Message Type", "capwap.control.header.message_type",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_control_header_msg_type_enterprise_nbr,
            { "Message Type (Enterprise Number)", "capwap.control.header.message_type.enterprise_number",
              FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_control_header_msg_type_enterprise_specific,
            { "Message Type (Enterprise Specific)", "capwap.control.header.message_type.enterprise_specific",
              FT_UINT32, BASE_DEC, VALS(message_type), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_control_header_seq_number,
            { "Sequence Number", "capwap.control.header.sequence_number",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_control_header_msg_element_length,
            { "Message Element Length", "capwap.control.header.message_element_length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_control_header_flags,
            { "Flags", "capwap.control.header.flags",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },

        /* CAPWAP Protocol Message Elements */

        { &hf_capwap_message_element,
            { "Message Element", "capwap.message_element",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element,
            { "Type", "capwap.message_element",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type,
            { "Type", "capwap.message_element.type",
              FT_UINT16, BASE_DEC, VALS(message_element_type_vals), 0x0,
              "CAPWAP Message Element type", HFILL }
        },
        { &hf_capwap_msg_element_length,
            { "Length", "capwap.message_element.length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "CAPWAP Message Element length", HFILL }
        },
        { &hf_capwap_msg_element_value,
            { "Value", "capwap.message_element.value",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              "CAPWAP Message Element value", HFILL }
        },

        /* CAPWAP Protocol Message Element Type */

        /* AC Descriptor */
        { &hf_capwap_msg_element_type_ac_descriptor_stations,
            { "Stations", "capwap.control.message_element.ac_descriptor.stations",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_limit,
            { "Limit Stations", "capwap.control.message_element.ac_descriptor.limit",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_active_wtp,
            { "Active WTPs", "capwap.control.message_element.ac_descriptor.active_wtp",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_max_wtp,
            { "Max WTPs", "capwap.control.message_element.ac_descriptor.max_wtp",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        /* AC Descriptor Security Flags... */
        { &hf_capwap_msg_element_type_ac_descriptor_security,
            { "Security Flags", "capwap.control.message_element.ac_descriptor.security",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_security_s,
            { "AC supports the pre-shared", "capwap.control.message_element.ac_descriptor.security.s",
              FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_security_x,
            { "AC supports X.509 Certificate", "capwap.control.message_element.ac_descriptor.security.x",
              FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x02,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_security_r,
            { "Reserved", "capwap.control.message_element.ac_descriptor.security.r",
              FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0xF9,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_ac_descriptor_rmac_field,
            { "R-MAC Field", "capwap.control.message_element.ac_descriptor.rmac_field",
              FT_UINT8, BASE_DEC, VALS(rmac_field_vals), 0x0,
              NULL, HFILL }
            },
        { &hf_capwap_msg_element_type_ac_descriptor_reserved,
            { "Reserved", "capwap.control.message_element.ac_descriptor.reserved",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        /* AC Descriptor DTLS Policy Flags... */
        { &hf_capwap_msg_element_type_ac_descriptor_dtls_policy,
            { "DTLS Policy Flags", "capwap.control.message_element.ac_descriptor.dtls_policy",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_dtls_policy_d,
            { "DTLS-Enabled Data Channel Supported", "capwap.control.message_element.ac_descriptor.dtls_policy.d",
              FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_dtls_policy_c,
            { "Clear Text Data Channel Supported", "capwap.control.message_element.ac_descriptor.dtls_policy.c",
              FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x02,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_descriptor_dtls_policy_r,
            { "Reserved", "capwap.control.message_element.ac_descriptor.dtls_policy.r",
              FT_UINT8, BASE_HEX, 0x0, 0xF9,
              "Must be zero", HFILL }
        },

        { &hf_capwap_msg_element_type_ac_information,
            { "AC Information", "capwap.control.message_element.ac_information",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_ac_information_vendor,
            { "AC Information Vendor", "capwap.control.message_element.ac_information.vendor",
              FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_information_type,
            { "AC Information Type", "capwap.control.message_element.ac_information.type",
              FT_UINT16, BASE_DEC, VALS(ac_information_type_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_information_length,
            { "AC Information Length", "capwap.control.message_element.ac_information.length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_ac_information_value,
            { "AC Information Value", "capwap.control.message_element.ac_information.value",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_information_hardware_version,
            { "AC Hardware Version", "capwap.control.message_element.ac_information.hardware_version",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_information_software_version,
            { "AC Software Version", "capwap.control.message_element.ac_information.software_version",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_ipv4_list,
            { "AC IPv4 List", "capwap.control.message_element.message_element.ac_ipv4_list",
              FT_IPv4, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_ipv6_list,
            { "AC IPv6 List", "capwap.control.message_element.message_element.ac_ipv6_list",
              FT_IPv6, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        /* CAPWAP Control IPvX Address*/
        { &hf_capwap_msg_element_type_capwap_control_ipv4,
            { "CAPWAP Control IP Address", "capwap.control.message_element.message_element.capwap_control_ipv4",
              FT_IPv4, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_capwap_control_ipv6,
            { "CAPWAP Control IP Address", "capwap.control.message_element.message_element.capwap_control_ipv6",
              FT_IPv6, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_capwap_control_wtp_count,
            { "CAPWAP Control WTP Count", "capwap.control.message_element.capwap_control_wtp_count",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_capwap_timers_discovery,
            { "CAPWAP Timers Discovery (Sec)", "capwap.control.message_element.capwap_timers_discovery",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_capwap_timers_echo_request,
            { "CAPWAP Timers Echo Request (Sec)", "capwap.control.message_element.capwap_timers_echo_request",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_decryption_error_report_period_radio_id,
            { "Decryption Error Report Period Radio ID", "capwap.control.message_element.decryption_error_report_period.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_decryption_error_report_period_interval,
            { "Decryption Error Report Report Interval (Sec)", "capwap.control.message_element.decryption_error_report_period.interval",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_delete_station_radio_id,
            { "Radio ID", "capwap.control.message_element.delete_station.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              "Representing the radio, whose value is between one (1) and 31", HFILL }
        },
        { &hf_capwap_msg_element_type_delete_station_length,
            { "Mac Length", "capwap.control.message_element.delete_station.length",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              "The length of the MAC Address field", HFILL }
        },
        { &hf_capwap_msg_element_type_delete_station_mac_eui48,
            { "MAC address", "capwap.control.message_element.delete_station.mac.eui48",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_delete_station_mac_eui64,
            { "MAC address", "capwap.control.message_element.delete_station.mac.eui64",
              FT_EUI64, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_delete_station_mac_data,
            { "MAC address", "capwap.control.message_element.delete_station.mac.data",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_name,
            { "AC Name", "capwap.control.message_element.ac_name",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ac_name_with_priority,
            { "AC Name Priority", "capwap.control.message_element.ac_name_with_priority",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_ac_timestamp,
            { "AC Timestamp", "capwap.control.message_element.ac_timestamp",
              FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_add_station_radio_id,
            { "Radio ID", "capwap.control.message_element.add_station.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              "Representing the radio, whose value is between one (1) and 31", HFILL }
        },
        { &hf_capwap_msg_element_type_add_station_length,
            { "Mac Length", "capwap.control.message_element.add_station.length",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              "The length of the MAC Address field", HFILL }
        },
        { &hf_capwap_msg_element_type_add_station_mac_eui48,
            { "MAC address", "capwap.control.message_element.add_station.mac.eui48",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_add_station_mac_eui64,
            { "MAC address", "capwap.control.message_element.add_station.mac.eui64",
              FT_EUI64, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_add_station_mac_data,
            { "MAC address", "capwap.control.message_element.add_station.mac.data",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_add_station_vlan_name,
            { "Vlan Name", "capwap.control.message_element.add_station.vlan_name",
              FT_STRING, BASE_NONE, NULL, 0x0,
              "Containing the VLAN Name on which the WTP is to locally bridge user data", HFILL }
        },

        { &hf_capwap_msg_element_type_discovery_type,
            { "Discovery Type", "capwap.control.message_element.discovery_type",
              FT_UINT8, BASE_DEC, VALS(discovery_type_vals), 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_idle_timeout,
            { "Idle Timeout (Sec)", "capwap.control.message_element.idle_timeout",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_location_data,
            { "Location Data", "capwap.control.message_element.location_data",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_maximum_message_length,
            { "Maximum Message Length", "capwap.control.message_element.maximum_message_length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_capwap_local_ipv4_address,
            { "CAPWAP Local IPv4 Address", "capwap.control.message_element.capwap_local_ipv4_address",
              FT_IPv4, BASE_NONE, NULL, 0x0,
              "The IP address of the sender", HFILL }
        },


        { &hf_capwap_msg_element_type_radio_admin_id,
            { "Radio Administrative ID", "capwap.control.message_element.radio_admin.id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_radio_admin_state,
            { "Radio Administrative State", "capwap.control.message_element.radio_admin.state",
              FT_UINT8, BASE_DEC, VALS(radio_admin_state_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_radio_op_state_radio_id,
            { "Radio Operational ID", "capwap.control.message_element.radio_op_state.radio_id",
               FT_UINT8, BASE_DEC, NULL, 0x0,
               NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_radio_op_state_radio_state,
            { "Radio Operational State", "capwap.control.message_element.radio_op_state.radio_state",
              FT_UINT8, BASE_DEC, VALS(radio_op_state_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_radio_op_state_radio_cause,
            { "Radio Operational Cause", "capwap.control.message_element.radio_op_state.radio_cause",
               FT_UINT8, BASE_DEC, VALS(radio_op_cause_vals), 0x0,
               NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_result_code,
            { "Result Code", "capwap.control.message_element.result_code",
              FT_UINT32, BASE_DEC, VALS(result_code_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_session_id,
            { "Session ID", "capwap.control.message_element.session_id",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_statistics_timer,
            { "Statistics Timer (Sec)", "capwap.control.message_element.statistics_timer",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_vsp_vendor_identifier,
            { "Vendor Identifier", "capwap.control.message_element.vsp.vendor_identifier",
              FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_vsp_vendor_element_id,
            { "Vendor Element ID", "capwap.control.message_element.vsp.vendor_element_id",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_vsp_vendor_data,
            { "Vendor Data", "capwap.control.message_element.vsp.vendor_data",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_wtp_board_data,
            { "WTP Board Data", "capwap.control.message_element.wtp_board_data",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_board_data_vendor,
            { "WTP Board Data Vendor", "capwap.control.message_element.wtp_board_data.vendor",
               FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
               NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_board_data_type,
            { "Board Data Type", "capwap.control.message_element.wtp_board_data.type",
              FT_UINT16, BASE_DEC, VALS(board_data_type_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_board_data_length,
            { "Board Data Length", "capwap.control.message_element.wtp_board_data.length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_board_data_value,
            { "Board Data Value", "capwap.control.message_element.wtp_board_data.value",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_wtp_board_data_wtp_model_number,
            { "WTP Model Number", "capwap.control.message_element.wtp_board_data.wtp_model_number",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_board_data_wtp_serial_number,
            { "WTP Serial Number", "capwap.control.message_element.wtp_board_data.wtp_serial_number",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_board_data_wtp_board_id,
            { "WTP Board ID", "capwap.control.message_element.wtp_board_data.wtp_board_id",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_board_data_wtp_board_revision,
            { "WTP Board Revision", "capwap.control.message_element.wtp_board_data.wtp_board_revision",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_board_data_base_mac_address,
            { "Base Mac Address", "capwap.control.message_element.wtp_board_data.base_mac_address",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_wtp_descriptor_max_radios,
            { "Max Radios", "capwap.control.message_element.wtp_descriptor.max_radios",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_radio_in_use,
            { "Radio in use", "capwap.control.message_element.wtp_descriptor.radio_in_use",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_number_encrypt,
            { "Encryption Capabilities (Number)", "capwap.control.message_element.wtp_descriptor.number_encrypt",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_encrypt,
            { "Encryption Capabilities", "capwap.control.message_element.wtp_descriptor.encrypt",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_encrypt_reserved,
            { "Reserved (Encrypt)", "capwap.control.message_element.wtp_descriptor.encrypt_reserved",
              FT_UINT8, BASE_DEC, NULL, 0xE0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_encrypt_wbid,
            { "Encrypt WBID", "capwap.control.message_element.wtp_descriptor.encrypt_wbid",
              FT_UINT8, BASE_DEC, VALS(type_wbid), 0x1F,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_encrypt_capabilities,
            { "Encryption Capabilities", "capwap.control.message_element.wtp_descriptor.encrypt_capabilities",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_wtp_descriptor,
            { "WTP Descriptor", "capwap.control.message_element.wtp_descriptor",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_vendor,
            { "WTP Descriptor Vendor", "capwap.control.message_element.wtp_descriptor.vendor",
              FT_UINT32, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_type,
            { "Descriptor Type", "capwap.control.message_element.wtp_descriptor.type",
              FT_UINT16, BASE_DEC, VALS(wtp_descriptor_type_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_length,
            { "Descriptor Length", "capwap.control.message_element.wtp_descriptor.length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_value,
            { "Descriptor Value", "capwap.control.message_element.wtp_descriptor.value",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_hardware_version,
            { "WTP Hardware Version", "capwap.control.message_element.wtp_descriptor.hardware_version",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_active_software_version,
            { "WTP Active Software Version", "capwap.control.message_element.wtp_descriptor.active_software_version",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_boot_version,
            { "WTP Boot Version", "capwap.control.message_element.wtp_descriptor.boot_version",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_descriptor_other_software_version,
            { "WTP Other Software Version", "capwap.control.message_element.wtp_descriptor.other_software_version",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_fallback,
            { "WTP Fallback", "capwap.control.message_element.wtp_fallback",
              FT_UINT8, BASE_DEC, VALS(wtp_fallback_vals), 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_wtp_frame_tunnel_mode,
            { "WTP Frame Tunnel Mode", "capwap.control.message_element.wtp_frame_tunnel_mode",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_frame_tunnel_mode_n,
            { "Native Frame Tunnel Mode", "capwap.control.message_element.wtp_frame_tunnel_mode.n",
              FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x08,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_frame_tunnel_mode_e,
            { "802.3 Frame Tunnel Mode", "capwap.control.message_element.wtp_frame_tunnel_mode.e",
              FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x04,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_frame_tunnel_mode_l,
            { "Local Bridging", "capwap.control.message_element.wtp_frame_tunnel_mode.l",
              FT_BOOLEAN, 8, TFS(&tfs_true_false), 0x02,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_frame_tunnel_mode_r,
            { "Reserved", "capwap.control.message_element.wtp_frame_tunnel_mode.r",
              FT_UINT8, BASE_HEX, 0x0, 0xF1,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_wtp_mac_type,
            { "WTP MAC Type", "capwap.control.message_element.wtp_mac_type",
              FT_UINT8, BASE_DEC, VALS(wtp_mac_vals), 0x0,
              "The MAC mode of operation supported by the WTP", HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_name,
            { "WTP Name", "capwap.control.message_element.wtp_name",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_reboot_statistics_reboot_count,
            { "Reboot  Count", "capwap.control.message_element.wtp_reboot_statistics.reboot_count",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "The number of reboots that have occurred due to a WTP crash", HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_reboot_statistics_ac_initiated_count,
            { "AC Initiated Count", "capwap.control.message_element.wtp_reboot_statistics.ac_initiated_count",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "The number of reboots that have occurred at the request of a CAPWAP protocol message", HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_reboot_statistics_link_failure_count,
            { "Link Failure Count", "capwap.control.message_element.wtp_reboot_statistics.link_failure_count",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "The number of times that a CAPWAP protocol connection with an AC has failed due to link failure", HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_reboot_statistics_sw_failure_count,
            { "SW Failure Count", "capwap.control.message_element.wtp_reboot_statistics.sw_failure_count",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "The number of times that a CAPWAP protocol connection with an AC has failed due to software-related reasons", HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_reboot_statistics_hw_failure_count,
            { "HW Failure Count", "capwap.control.message_element.wtp_reboot_statistics.hw_failure_count",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "The number of times that a CAPWAP protocol connection with an AC has failed due to hardware-related reasons", HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_reboot_statistics_other_failure_count,
            { "Other Failure Count", "capwap.control.message_element.wtp_reboot_statistics.other_failure_count",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "The number of times that a CAPWAP protocol connection with an AC has failed due to known reasons, other than AC initiated, link, SW or HW failure", HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_reboot_statistics_unknown_failure_count,
            { "Unknown Failure Count", "capwap.control.message_element.wtp_reboot_statistics.unknown_failure_count",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "The number of times that a CAPWAP protocol connection with an AC has failed for unknown reasons", HFILL }
        },
        { &hf_capwap_msg_element_type_wtp_reboot_statistics_last_failure_type,
            { "Last Failure Type", "capwap.control.message_element.wtp_reboot_statistics.last_failure_type",
              FT_UINT8, BASE_DEC, VALS(last_failure_type_vals), 0x0,
              "The failure type of the most recent WTP failure", HFILL }
        },

        { &hf_capwap_msg_element_type_capwap_local_ipv6_address,
            { "CAPWAP Local IPv6 Address", "capwap.control.message_element.capwap_local_ipv6_address",
              FT_IPv6, BASE_NONE, NULL, 0x0,
              "The IP address of the sender", HFILL }
        },

        { &hf_capwap_msg_element_type_capwap_transport_protocol,
            { "CAPWAP Transport Protocol", "capwap.control.message_element.capwap_transport_protocol",
              FT_UINT8, BASE_DEC, VALS(capwap_transport_protocol_vals), 0x0,
              "The transport to use for the CAPWAP Data channel", HFILL }
        },

        { &hf_capwap_msg_element_type_mtu_discovery_padding,
            { "MTU Discovery Padding", "capwap.control.message_element.mtu_discovery_padding",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              "A variable-length pad, filled with the value 0xFF", HFILL }
        },

        { &hf_capwap_msg_element_type_ecn_support,
            { "ECN Support", "capwap.control.message_element.ecn_support",
              FT_UINT8, BASE_DEC, VALS(ecn_support_vals), 0x0,
              "The sender's support for ECN, as defined in [RFC3168]", HFILL }
        },


        /* Message element type IEEE80211 : RFC 5416 Section 6 */
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_add_wlan.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_wlan_id,
            { "WLAN ID", "capwap.control.message_element.ieee80211_add_wlan.wlan_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability,
            { "Capability", "capwap.control.message_element.ieee80211_add_wlan.capability",
              FT_UINT16, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_e,
            { "ESS", "capwap.control.message_element.ieee80211_add_wlan.capability.e",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x8000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_i,
            { "IBSS", "capwap.control.message_element.ieee80211_add_wlan.capability.i",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x4000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_c,
            { "CF-Pollable", "capwap.control.message_element.ieee80211_add_wlan.capability.c",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x2000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_f,
            { "CF-Poll Request", "capwap.control.message_element.ieee80211_add_wlan.capability.f",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x1000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_p,
            { "Privacy", "capwap.control.message_element.ieee80211_add_wlan.capability.p",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0800,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_s,
            { "Short Preamble", "capwap.control.message_element.ieee80211_add_wlan.capability.s",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0400,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_b,
            { "PBCC", "capwap.control.message_element.ieee80211_add_wlan.capability.b",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_a,
            { "Channek Agility", "capwap.control.message_element.ieee80211_add_wlan.capability.a",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0100,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_m,
            { "Spectrum Management", "capwap.control.message_element.ieee80211_add_wlan.capability.m",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0080,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_q,
            { "QoS", "capwap.control.message_element.ieee80211_add_wlan.capability.q",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0040,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_t,
            { "Short Slot Time", "capwap.control.message_element.ieee80211_add_wlan.capability.t",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0020,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_d,
            { "APSD", "capwap.control.message_element.ieee80211_add_wlan.capability.d",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0010,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_v,
            { "Reserved", "capwap.control.message_element.ieee80211_add_wlan.capability.v",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0008,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_o,
            { "DSSS-OFDM", "capwap.control.message_element.ieee80211_add_wlan.capability.o",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0004,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_k,
            { "Delayed Block ACK", "capwap.control.message_element.ieee80211_add_wlan.capability.k",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0002,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_capability_l,
            { "Immediate Block ACK", "capwap.control.message_element.ieee80211_add_wlan.capability.l",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0001,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_key_index,
            { "Key-Index", "capwap.control.message_element.ieee80211_add_wlan.key_index",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_key_status,
            { "Key Status", "capwap.control.message_element.ieee80211_add_wlan.key_status",
              FT_UINT8, BASE_DEC, VALS(ieee80211_wlan_key_status_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_key_length,
            { "Key Length", "capwap.control.message_element.ieee80211_add_wlan.key_length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_key,
            { "Key", "capwap.control.message_element.ieee80211_add_wlan.key",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_group_tsc,
            { "Group TSC", "capwap.control.message_element.ieee80211_add_wlan.group_tsc",
              FT_UINT64, BASE_DEC, NULL, 0x00FFFFFF,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_qos,
            { "QoS", "capwap.control.message_element.ieee80211_add_wlan.qos",
              FT_UINT8, BASE_DEC, VALS(ieee80211_add_wlan_qos_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_auth_type,
            { "Auth Type", "capwap.control.message_element.ieee80211_add_wlan.auth_type",
              FT_UINT8, BASE_DEC, VALS(ieee80211_add_wlan_auth_type_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_mac_mode,
            { "MAC Mode", "capwap.control.message_element.ieee80211_add_wlan.mac_mode",
              FT_UINT8, BASE_DEC, VALS(ieee80211_add_wlan_mac_mode_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_tunnel_mode,
            { "Tunnel Mode", "capwap.control.message_element.ieee80211_add_wlan.tunnel_mode",
              FT_UINT8, BASE_DEC, VALS(ieee80211_add_wlan_tunnel_mode_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_suppress_ssid,
            { "Suppress SSID", "capwap.control.message_element.ieee80211_add_wlan.supress_ssid",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_add_wlan_ssid,
            { "SSID", "capwap.control.message_element.ieee80211_add_wlan.ssid",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_antenna_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_antenna.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_antenna_diversity,
            { "Diversity", "capwap.control.message_element.ieee80211_antenna.diversity",
              FT_UINT8, BASE_DEC, VALS(ieee80211_antenna_diversity_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_antenna_combiner,
            { "Combiner", "capwap.control.message_element.ieee80211_antenna.combiner",
              FT_UINT8, BASE_DEC, VALS(ieee80211_antenna_combiner_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_antenna_count,
            { "Antenna Count", "capwap.control.message_element.ieee80211_antenna.count",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_antenna_selection,
            { "Selection", "capwap.control.message_element.ieee80211_antenna.selection",
              FT_UINT8, BASE_DEC, VALS(ieee80211_antenna_selection_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_assigned_wtp_bssid.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_wlan_id,
            { "WLAN ID", "capwap.control.message_element.ieee80211_assigned_wtp_bssid.wlan_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_assigned_wtp_bssid_bssid,
            { "BSSID", "capwap.control.message_element.ieee80211_assigned_wtp_bssid.bssid",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_delete_wlan_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_delete_wlan.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_delete_wlan_wlan_id,
            { "WLAN ID", "capwap.control.message_element.ieee80211_delete_wlan.wlan_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_direct_sequence_control_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_direct_sequence_control.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_direct_sequence_control_reserved,
            { "Reserved", "capwap.control.message_element.ieee80211_direct_sequence_control.reserved",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_direct_sequence_control_current_channel,
            { "Current Channel", "capwap.control.message_element.ieee80211_direct_sequence_control.current_channel",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_direct_sequence_control_current_cca,
            { "Current CCA", "capwap.control.message_element.ieee80211_direct_sequence_control.current_cca",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_direct_sequence_control_energy_detect_threshold,
            { "Energy Detect Threshold", "capwap.control.message_element.ieee80211_direct_sequence_control.energy_detect_threshold",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ie_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_ie.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ie_wlan_id,
            { "WLAN ID", "capwap.control.message_element.ieee80211_ie.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ie_flags,
            { "Flags", "capwap.control.message_element.ieee80211_ie.flags",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ie_flags_b,
            { "Include IE in Beacons", "capwap.control.message_element.ieee80211_ie.flags.b",
              FT_BOOLEAN, 8, NULL, 0x80,
              "When set, the WTP is to include the Information Element in IEEE 802.11 Beacons associated with the WLAN", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ie_flags_p,
            { "Include IE in  Probe Responses", "capwap.control.message_element.ieee80211_ie.flags.p",
              FT_BOOLEAN, 8, NULL, 0x40,
              "When set, the WTP is to include the Information Element in Probe Responses associated with the WLAN", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ie_flags_rsv,
            { "Reserved", "capwap.control.message_element.ieee80211_ie.flags.rsv",
              FT_UINT8, BASE_HEX, NULL, 0x3F,
              "Must be Zero", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_operation_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_mac_operation.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_operation_reserved,
            { "Reserved", "capwap.control.message_element.ieee80211_mac_operation.reserved",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_operation_rts_threshold,
            { "RTS Threshold", "capwap.control.message_element.ieee80211_mac_operation.rts_threshold",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_operation_short_retry,
            { "Short Retry", "capwap.control.message_element.ieee80211_mac_operation.short_retry",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_operation_long_retry,
            { "Long Retry", "capwap.control.message_element.ieee80211_mac_operation.long_retry",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_operation_fragmentation_threshold,
            { "Fragmentation Threshold", "capwap.control.message_element.ieee80211_mac_operation.fragmentation_threshold",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_operation_tx_msdu_lifetime,
            { "Tx MDSU Lifetime", "capwap.control.message_element.ieee80211_mac_operation.tx_msdu_lifetime",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_operation_rx_msdu_lifetime,
            { "Rx MDSU Lifetime", "capwap.control.message_element.ieee80211_mac_operation.rx_msdu_lifetime",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mic_countermeasures_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_mic_countermeasures.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mic_countermeasures_wlan_id,
            { "WLAN ID", "capwap.control.message_element.ieee80211_mic_countermeasures.wlan_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mic_countermeasures_mac_address,
            { "MAC Address", "capwap.control.message_element.ieee80211_mic_countermeasures.mac_address",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_multi_domain_capability_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_multi_domain_capability.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_multi_domain_capability_reserved,
            { "Reserved", "capwap.control.message_element.ieee80211_multi_domain_capability.reserved",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_multi_domain_capability_first_channel,
            { "First Channel", "capwap.control.message_element.ieee80211_multi_domain_capability.first_channel",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_multi_domain_capability_number_of_channels,
            { "Number of  Channels", "capwap.control.message_element.ieee80211_multi_domain_capability.number_of_channels",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_multi_domain_capability_max_tx_power_level,
            { "Max TX Power Level", "capwap.control.message_element.ieee80211_multi_domain_capability.max_tx_power_level",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_ofdm_control.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_reserved,
            { "Reserved", "capwap.control.message_element.ieee80211_ofdm_control.reserved",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_current_channel,
            { "Current Channel", "capwap.control.message_element.ieee80211_ofdm_control.current_channel",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support,
            { "Band Support", "capwap.control.message_element.ieee80211_ofdm_control.band_support",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit0,
            { "Operating in the 5.15-5.25 GHz band", "capwap.control.message_element.ieee80211_ofdm_control.band_support.bit0",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x01,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit1,
            { "Operating in the 5.25-5.35 GHz band", "capwap.control.message_element.ieee80211_ofdm_control.band_support.bit1",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x02,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit2,
            { "Operating in the 5.725-5.825 GHz band", "capwap.control.message_element.ieee80211_ofdm_control.band_support.bit2",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x04,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit3,
            { "Operating in the 5.47-5.725 GHz band", "capwap.control.message_element.ieee80211_ofdm_control.band_support.bit3",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x08,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit4,
            { "Operating in the lower Japanese 5.25 GHz band", "capwap.control.message_element.ieee80211_ofdm_control.band_support.bit4",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit5,
            { "Operating in the l5.03-5.091 GHz band", "capwap.control.message_element.ieee80211_ofdm_control.band_support.bit5",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit6,
            { "Operating in the l5.03-5.091 GHz band", "capwap.control.message_element.ieee80211_ofdm_control.band_support.bit5",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_band_support_bit7,
            { "Reserved", "capwap.control.message_element.ieee80211_ofdm_control.band_support.bit7",
              FT_UINT8, BASE_HEX, NULL, 0x80,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_ofdm_control_ti_threshold,
            { "TI Threshold", "capwap.control.message_element.ieee80211_mofdm_control.ti_threshold",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_ieee80211_rate_set_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_rate_set.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_rate_set_rate_set,
            { "Rate Set", "capwap.control.message_element.ieee80211_rate_set.rate_set",
              FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
              "In Mbit/sec, (B) for Basic Rates", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_station.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_association_id,
            { "Association ID", "capwap.control.message_element.ieee80211_station.association_id",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_flags,
            { "Flags", "capwap.control.message_element.ieee80211_station.flags",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_mac_address,
            { "MAC Address", "capwap.control.message_element.ieee80211_station.mac_address",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities,
            { "Capabilities", "capwap.control.message_element.ieee80211_station.capabilities",
              FT_UINT16, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_e,
            { "ESS", "capwap.control.message_element.ieee80211_station.capabilities.e",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x8000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_i,
            { "IBSS", "capwap.control.message_element.ieee80211_station.capabilities.i",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x4000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_c,
            { "CF-Pollable", "capwap.control.message_element.ieee80211_station.capabilities.c",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x2000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_f,
            { "CF-Poll Request", "capwap.control.message_element.ieee80211_station.capabilities.f",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x1000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_p,
            { "Privacy", "capwap.control.message_element.ieee80211_station.capabilities.p",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0800,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_s,
            { "Short Preamble", "capwap.control.message_element.ieee80211_station.capabilities.s",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0400,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_b,
            { "PBCC", "capwap.control.message_element.ieee80211_station.capabilities.b",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_a,
            { "Channek Agility", "capwap.control.message_element.ieee80211_station.capabilities.a",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0100,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_m,
            { "Spectrum Management", "capwap.control.message_element.ieee80211_station.capabilities.m",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0080,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_q,
            { "QoS", "capwap.control.message_element.ieee80211_station.capabilities.q",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0040,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_t,
            { "Short Slot Time", "capwap.control.message_element.ieee80211_station.capabilities.t",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0020,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_d,
            { "APSD", "capwap.control.message_element.ieee80211_station.capabilities.d",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0010,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_v,
            { "Reserved", "capwap.control.message_element.ieee80211_station.capabilities.v",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0008,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_o,
            { "DSSS-OFDM", "capwap.control.message_element.ieee80211_station.capabilities.o",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0004,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_k,
            { "Delayed Block ACK", "capwap.control.message_element.ieee80211_station.capabilities.k",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0002,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_capabilities_l,
            { "Immediate Block ACK", "capwap.control.message_element.ieee80211_station.capabilities.l",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0001,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_wlan_id,
            { "WLAN ID", "capwap.control.message_element.ieee80211_station.wlan_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_supported_rates,
            { "Supported Rates", "capwap.control.message_element.ieee80211_station.supported_rates",
              FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
              "In Mbit/sec, (B) for Basic Rates", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_session_key_mac,
            { "Mac Address", "capwap.control.message_element.ieee80211_station_session_key.mac",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              "The station's MAC Address", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_session_key_flags,
            { "Flags", "capwap.control.message_element.ieee80211_station_session_key.flags",
              FT_UINT16, BASE_DEC, NULL, 0x3FFF,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_session_key_flags_a,
            { "Flag A", "capwap.control.message_element.ieee80211_station_session_key.flags_a",
              FT_BOOLEAN, 1, NULL, 0x2000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_session_key_flags_c,
            { "Flag C", "capwap.control.message_element.ieee80211_station_session_key.flags_c",
              FT_BOOLEAN, 1, NULL, 0x1000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_session_key_pairwire_tsc,
            { "Pairwise TSC", "capwap.control.message_element.ieee80211_station_session_key.pairwire_tsc",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              "Transmit Sequence Counter (TSC)", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_session_key_pairwire_rsc,
            { "Pairwise RSC", "capwap.control.message_element.ieee80211_station_session_key.pairwire_rsc",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              "Receive Sequence Counter (TSC)", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_station_session_key_key,
            { "Key", "capwap.control.message_element.ieee80211_station_session_key.key",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_supported_rates_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_supported_rates.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_supported_rates_rate,
            { "Rates", "capwap.control.message_element.ieee80211_supported_rates.rate",
              FT_UINT8, BASE_HEX|BASE_EXT_STRING, &ieee80211_supported_rates_vals_ext, 0x0,
              "In Mbit/sec, (B) for Basic Rates", HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_tx_power_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_tx_power.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_tx_power_reserved,
            { "Reserved", "capwap.control.message_element.ieee80211_tx_power.reserved",
              FT_UINT8, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_tx_power_current_tx_power,
            { "Current Tx Power", "capwap.control.message_element.ieee80211_tx_power.current_tx_power",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_tx_power_level_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_tx_power_level.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_tx_power_level_num_levels,
            { "Num Levels", "capwap.control.message_element.ieee80211_tx_power_level.num_levels",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_tx_power_level_power_level,
            { "Power Level", "capwap.control.message_element.ieee80211_tx_power_level.power_level",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_update_wlan.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_wlan_id,
            { "WLAN ID", "capwap.control.message_element.ieee80211_update_wlan.wlan_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability,
            { "Capability", "capwap.control.message_element.ieee80211_update_wlan.capability",
              FT_UINT16, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_e,
            { "ESS", "capwap.control.message_element.ieee80211_update_wlan.capability.e",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x8000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_i,
            { "IBSS", "capwap.control.message_element.ieee80211_update_wlan.capability.i",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x4000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_c,
            { "CF-Pollable", "capwap.control.message_element.ieee80211_update_wlan.capability.c",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x2000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_f,
            { "CF-Poll Request", "capwap.control.message_element.ieee80211_update_wlan.capability.f",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x1000,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_p,
            { "Privacy", "capwap.control.message_element.ieee80211_update_wlan.capability.p",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0800,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_s,
            { "Short Preamble", "capwap.control.message_element.ieee80211_update_wlan.capability.s",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0400,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_b,
            { "PBCC", "capwap.control.message_element.ieee80211_update_wlan.capability.b",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0200,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_a,
            { "Channek Agility", "capwap.control.message_element.ieee80211_update_wlan.capability.a",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0100,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_m,
            { "Spectrum Management", "capwap.control.message_element.ieee80211_update_wlan.capability.m",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0080,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_q,
            { "QoS", "capwap.control.message_element.ieee80211_update_wlan.capability.q",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0040,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_t,
            { "Short Slot Time", "capwap.control.message_element.ieee80211_update_wlan.capability.t",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0020,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_d,
            { "APSD", "capwap.control.message_element.ieee80211_update_wlan.capability.d",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0010,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_v,
            { "Reserved", "capwap.control.message_element.ieee80211_update_wlan.capability.v",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0008,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_o,
            { "DSSS-OFDM", "capwap.control.message_element.ieee80211_update_wlan.capability.o",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0004,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_k,
            { "Delayed Block ACK", "capwap.control.message_element.ieee80211_update_wlan.capability.k",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0002,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_capability_l,
            { "Immediate Block ACK", "capwap.control.message_element.ieee80211_update_wlan.capability.l",
              FT_BOOLEAN, 16, TFS(&tfs_yes_no), 0x0001,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_key_index,
            { "Key-Index", "capwap.control.message_element.ieee80211_update_wlan.key_index",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_key_status,
            { "Key Status", "capwap.control.message_element.ieee80211_update_wlan.key_status",
              FT_UINT8, BASE_DEC, VALS(ieee80211_wlan_key_status_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_key_length,
            { "Key Length", "capwap.control.message_element.ieee80211_update_wlan.key_length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_update_wlan_key,
            { "Key", "capwap.control.message_element.ieee80211_update_wlan.key",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_wtp_radio_info.cfg_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_short_preamble,
            { "Short Preamble", "capwap.control.message_element.ieee80211_wtp_radio_info.short_preamble",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_num_of_bssids,
            { "Num of BSSIDs", "capwap.control.message_element.ieee80211_wtp_radio_info.num_of_bssids",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_dtim_period,
            { "DTIM Period", "capwap.control.message_element.ieee80211_wtp_radio_info.dtim_period",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_bssid,
            { "BSSID", "capwap.control.message_element.ieee80211_wtp_radio_info.bssid",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_beacon_period,
            { "Beacon Period", "capwap.control.message_element.ieee80211_wtp_radio_info.beacon_period",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_cfg_country_string,
            { "Country String", "capwap.control.message_element.ieee80211_wtp_radio_info.country_string",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_id,
            { "Radio ID", "capwap.control.message_element.ieee80211_wtp_radio_info.radio_id",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_reserved,
            { "Radio Type Reserved", "capwap.control.message_element.ieee80211_wtp_info_radio.radio_type_reserved",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_n,
            { "Radio Type 802.11n", "capwap.control.message_element.ieee80211_wtp_info_radio.radio_type_n",
              FT_BOOLEAN, 4, TFS(&tfs_true_false), 0x0008,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_g,
            { "Radio Type 802.11g", "capwap.control.message_element.ieee80211_wtp_info_radio.radio_type_g",
              FT_BOOLEAN, 4, TFS(&tfs_true_false), 0x0004,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_a,
            { "Radio Type 802.11a", "capwap.control.message_element.ieee80211_wtp_info_radio.radio_type_a",
              FT_BOOLEAN, 4, TFS(&tfs_true_false), 0x0002,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_wtp_radio_info_radio_type_b,
            { "Radio Type 802.11b", "capwap.control.message_element.ieee80211_wtp_info_radio.radio_type_b",
              FT_BOOLEAN, 4, TFS(&tfs_true_false), 0x0001,
              NULL, HFILL }
        },

        { &hf_capwap_msg_element_type_ieee80211_supported_mac_profiles_numbers,
            { "Numbers Profiles", "capwap.control.message_element.ieee80211_supported_mac_profiles.numbers",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_supported_mac_profiles_profile,
            { "Profile", "capwap.control.message_element.ieee80211_supported_mac_profiles.profile",
              FT_UINT8, BASE_DEC, VALS(ieee80211_mac_profile_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_msg_element_type_ieee80211_mac_profile,
            { "Profile", "capwap.control.message_element.ieee80211_mac_profile",
              FT_UINT8, BASE_DEC, VALS(ieee80211_mac_profile_vals), 0x0,
              NULL, HFILL }
        },

        /* Data Channel Keep-Alive entries */
        { & hf_capwap_data_keep_alive,
            { "Keep-Alive", "capwap.keep_alive",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { & hf_capwap_data_keep_alive_length,
            { "Message Element Length", "capwap.keep_alive.length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },

        /* Fortinet Vendor Specific*/

        { &hf_capwap_fortinet_element_id,
            { "Fortinet Element ID", "capwap.control.fortinet.element_id",
              FT_UINT16, BASE_DEC, VALS(fortinet_element_id_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_value,
            { "Fortinet Value", "capwap.control.fortinet.value",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ap_scan_rid,
            { "Radio ID", "capwap.control.fortinet.ap_scan.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ap_scan_bgscan_intv,
            { "bg scan interval", "capwap.control.fortinet.ap_scan.bgpscan.interval",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ap_scan_bgscan_idle,
            { "bg scan idle", "capwap.control.fortinet.ap_scan.bgpscan.idle",
              FT_UINT24, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ap_scan_bgscan_rpt_intv,
            { "bg scan rpt interval", "capwap.control.fortinet.ap_scan.bgscan.rpt_interval",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ap_scan_fgscan_rpt_intv,
            { "fg scan rpt interval", "capwap.control.fortinet.ap_scan.fgscan.rpt_interval",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_passive_rid,
            { "Radio ID", "capwap.control.fortinet.passive.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_passive,
            { "Passive", "capwap.control.fortinet.passive",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_daemon_rst,
            { "Daemon RST", "capwap.control.fortinet.daemon_rst",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mac_rid,
            { "Radio ID", "capwap.control.fortinet.mac.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mac_wid,
            { "WLAN ID", "capwap.control.fortinet.mac.wid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mac_len,
            { "Length", "capwap.control.fortinet.mac.len",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mac,
            { "MAC", "capwap.control.fortinet.mac",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wtp_allow_sn,
            { "Serial Number", "capwap.control.fortinet.wtp_allow.sn",
              FT_STRING, BASE_NONE, NULL, 0x0,
              "WTP Serial Number", HFILL }
        },
        { &hf_capwap_fortinet_wtp_allow_allow,
            { "Allowed", "capwap.control.fortinet.wtp_allow.allowed",
              FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wbh_sta_rid,
            { "Radio ID", "capwap.control.fortinet.wbh_sta.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wbh_sta_len,
            { "Length", "capwap.control.fortinet.wbh_sta.length",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wbh_sta_mac,
            { "STA MAC", "capwap.control.fortinet.wbh_sta.mac",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wbh_sta_bssid,
            { "BSSID", "capwap.control.fortinet.wbh_sta.bssid",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wbh_sta_mhc,
            { "MHC", "capwap.control.fortinet.wbh_sta.mhc",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_htcap_rid,
            { "Radio ID", "capwap.control.fortinet.htcap.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_htcap_mcs,
            { "MCS", "capwap.control.fortinet.htcap.mcs",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_htcap_gi,
            { "HT Short GI", "capwap.control.fortinet.htcap.mcs.gi",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_htcap_bw,
            { "Bandwidth", "capwap.control.fortinet.htcap.mcs.bw",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              "20 or 40Mhz Mode", HFILL }
        },
        { &hf_capwap_fortinet_mvap_sn_length,
            { "SN Length", "capwap.control.fortinet.mvap.sn.length",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mvap_sn,
            { "SN", "capwap.control.fortinet.mvap.sn",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mvap_unknown,
            { "Unknown", "capwap.control.fortinet.mvap.unknown",
              FT_UINT32, BASE_DEC_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mvap_age,
            { "Age", "capwap.control.fortinet.mvap.age",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mvap_period,
            { "Period", "capwap.control.fortinet.mvap.period",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mvap_vfid,
            { "Vfid", "capwap.control.fortinet.mvap.vfid",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mode_rid,
            { "Radio ID", "capwap.control.fortinet.mode.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mode,
            { "Mode", "capwap.control.fortinet.mode",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_coext_rid,
            { "Radio ID", "capwap.control.fortinet.coext.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_coext,
            { "Coext", "capwap.control.fortinet.coext",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_amsdu_rid,
            { "Radio ID", "capwap.control.fortinet.amsdu.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_amsdu,
            { "AMSDU", "capwap.control.fortinet.amsdu",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ps_opt_rid,
            { "Radio ID", "capwap.control.fortinet.ps_opt.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ps_opt,
            { "PS OPT", "capwap.control.fortinet.ps_opt",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_pure_rid,
            { "Radio ID", "capwap.control.fortinet.pure.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_pure,
            { "Pure", "capwap.control.fortinet.pure",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ebptag_ebp,
            { "EBP", "capwap.control.fortinet.ebptag.ebp",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ebptag_tag,
            { "Tag", "capwap.control.fortinet.ebptag.tag",
              FT_ETHER, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_telnet_enable,
            { "Telnet Enable", "capwap.control.fortinet.telnet_enable",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_admin_passwd,
            { "Admin Password", "capwap.control.fortinet.admin_password",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_regcode,
            { "Reg Code", "capwap.control.fortinet.reg_code",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_countrycode_rid,
            { "Radio ID", "capwap.control.fortinet.countrycode.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_countrycode_code,
            { "Country Code", "capwap.control.fortinet.countrycode.code",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_countrycode_string,
            { "Country Code", "capwap.control.fortinet.countrycode.string",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_sta_scan_rid,
            { "Radio ID", "capwap.control.fortinet.sta_scan.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_sta_scan,
            { "STA Scan", "capwap.control.fortinet.sta_scan",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_fho_rid,
            { "Radio ID", "capwap.control.fortinet.fho.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_fho,
            { "FHO", "capwap.control.fortinet.fho",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_apho_rid,
            { "Radio ID", "capwap.control.fortinet.fho.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_apho,
            { "APHO", "capwap.control.fortinet.apho",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_sta_locate_rid,
            { "Radio ID", "capwap.control.fortinet.sta_locate.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_sta_locate_enable,
            { "Locate Enable", "capwap.control.fortinet.sta_locate.enable",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_sta_locate_interval,
            { "Locate Interval", "capwap.control.fortinet.sta_locate.interval",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_sa_rid,
            { "Radio ID", "capwap.control.fortinet.spectrum_analysis.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_sa_enable,
            { "Spectrum Analysis Enable", "capwap.control.fortinet.spectrum_analysis.enable",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_sa_ssid,
            { "SSID", "capwap.control.fortinet.spectrum_analysis.ssid",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_darrp_cfg_rid,
            { "Radio ID", "capwap.control.fortinet.darrp_cfg.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_darrp_cfg_enable,
            { "DARRP CFG Enable", "capwap.control.fortinet.darrp_cfg.enable",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_darrp_cfg_interval,
            { "DARRP CFG Interval", "capwap.control.fortinet.darrp_cfg.interval",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ap_suppress_list_ver,
            { "Ver", "capwap.control.fortinet.ap_suppress_list.ver",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ap_suppress_list_op,
            { "Op", "capwap.control.fortinet.ap_suppress_list.op",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              "Operation ?", HFILL }
        },
        { &hf_capwap_fortinet_ap_suppress_list_rid,
            { "Radio ID", "capwap.control.fortinet.ap_suppress_list.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_ap_suppress_list_len,
            { "Length", "capwap.control.fortinet.ap_suppress_list.length",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wds_rid,
            { "Radio ID", "capwap.control.fortinet.wds.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wds_wid,
            { "WLAN ID", "capwap.control.fortinet.wds.wid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wds_enable,
            { "WDS Enable", "capwap.control.fortinet.wds.enable",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_vap_vlan_tag_rid,
            { "Radio ID", "capwap.control.fortinet.vap_vlan_tag.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_vap_vlan_tag_wid,
            { "WLAN ID", "capwap.control.fortinet.vap_vlan_tag.wid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_vap_vlan_tag,
            { "Vlan ID", "capwap.control.fortinet.vap_vlan_tag",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_vap_bitmap_rid,
            { "Radio ID", "capwap.control.fortinet.bitmap.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_vap_bitmap,
            { "Bitmap", "capwap.control.fortinet.vap_bitmap",
              FT_UINT16, BASE_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mcast_rate_rid,
            { "Radio ID", "capwap.control.fortinet.mcast_rate.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mcast_rate_wid,
            { "WLAN ID", "capwap.control.fortinet.mcast_rate.wid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mcast_rate,
            { "Multicast Rate", "capwap.control.fortinet.mcast_rate",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_cfg_rid,
            { "Radio ID", "capwap.control.fortinet.cfg.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_cfg_wid,
            { "WLAN ID", "capwap.control.fortinet.cfg.wid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_cfg_ip,
            { "IP", "capwap.control.fortinet.cfg.ip",
              FT_IPv4, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_cfg_mask,
            { "Mask", "capwap.control.fortinet.cfg.mask",
              FT_IPv4, BASE_NETMASK, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_split_tun_cfg_enable_local_subnet,
            { "Enable Local Subnet", "capwap.control.fortinet.split_tun_cfg.enable_local_subnet",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_split_tun_cfg_cnt,
            { "CNT", "capwap.control.fortinet.split_tun_cfg.cnt",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mgmt_vlan_id,
            { "Vlan ID", "capwap.control.fortinet.mgmt_vlan.id",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_vap_psk_passwd_rid,
            { "Radio ID", "capwap.control.fortinet.vap_psk_passwd.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_vap_psk_passwd_wid,
            { "WLAN ID", "capwap.control.fortinet.vap_psk_passwd.wid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_vap_psk_passwd_key,
            { "Key", "capwap.control.fortinet.vap_psk_passwd.key",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mesh_eth_bridge_enable,
            { "Mesh Eth Bridge Enable", "capwap.control.fortinet.mesh_eth_bridge.enable",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_mesh_eth_bridge_type,
            { "Mesh Eth Bridge Type", "capwap.control.fortinet.mesh_eth_bridge.type",
              FT_UINT16, BASE_DEC_HEX, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wtp_cap,
            { "WTP CAP", "capwap.control.fortinet.wtp_cap",
              FT_BYTES, SEP_SPACE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_txpwr_rid,
            { "Radio ID", "capwap.control.fortinet.tx_power.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_txpwr,
            { "TX Power", "capwap.control.fortinet.tx_power",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              "In Pourcentage", HFILL }
        },
        { &hf_capwap_fortinet_wids_enable_rid,
            { "Radio ID", "capwap.control.fortinet.wids_enable.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_wids_enable,
            { "WIDS Enable", "capwap.control.fortinet.wids_enable.enable",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_unknown_rid,
            { "Radio ID", "capwap.control.fortinet.unknown.rid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_unknown_wid,
            { "WLAN ID", "capwap.control.fortinet.unknown.wid",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_fortinet_unknown,
            { "Unknown Data", "capwap.control.fortinet.unknown",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },


        /* Cisco Vendor Specific*/

        { &hf_capwap_cisco_element_id,
            { "Cisco Element ID", "capwap.control.cisco.element_id",
              FT_UINT16, BASE_DEC, VALS(cisco_element_id_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_value,
            { "Cisco Value", "capwap.control.cisco.value",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_mwar_addr,
            { "Address", "capwap.control.cisco.mwar.address",
              FT_IPv4, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_rad_name,
            { "RAD (AP) Name", "capwap.control.cisco.rad_name",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_mwar_type,
            { "Type", "capwap.control.cisco.mwar.type",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_mwar_hardware,
            { "Hardware version", "capwap.control.cisco.mwar.hardware",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_mwar_software,
            { "Software version", "capwap.control.cisco.mwar.software",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_mwar_active_ms,
            { "Active MS", "capwap.control.cisco.mwar.active_ms",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_mwar_supported_ms,
            { "Supported MS", "capwap.control.cisco.mwar.supported_ms",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_mwar_active_rad,
            { "Active RAD", "capwap.control.cisco.mwar.active_rad",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_mwar_supported_rad,
            { "Supported RAD", "capwap.control.cisco.mwar.supported_rad",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_mode_and_type_mode,
            { "Mode", "capwap.control.cisco.ap_mode_and_type.mode",
              FT_UINT8, BASE_DEC, VALS(cisco_ap_mode_and_type_mode_vals), 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_mode_and_type_type,
            { "Type", "capwap.control.cisco.ap_mode_and_type.type",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_static_ip_addr,
            { "IP Address", "capwap.control.cisco.ap_static_ip.addr",
              FT_IPv4, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_static_ip_netmask,
            { "Netmask", "capwap.control.cisco.ap_static_ip.netmask",
              FT_IPv4, BASE_NETMASK, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_static_ip_gateway,
            { "Gateway", "capwap.control.cisco.ap_static_ip.gateway",
              FT_IPv4, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_static_ip_type,
            { "Type", "capwap.control.cisco.ap_static_ip.type",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_static_ip_reserved,
            { "Reserved", "capwap.control.cisco.ap_static_ip.reserved",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_uptime_current,
            { "AP Uptime Current", "capwap.control.cisco.ap_uptime.current",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_uptime_last,
            { "AP Uptime Last", "capwap.control.cisco.ap_uptime.last",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_group_name,
            { "AP Group Name", "capwap.control.cisco.ap_group_name",
              FT_STRING, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_led_state,
            { "Led State", "capwap.control.cisco.ap_led_state",
              FT_UINT16, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_timesync,
            { "AP TimeSync", "capwap.control.cisco.ap_timesync",
              FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_ap_timesync_type,
            { "Type (?)", "capwap.control.cisco.ap_timesync.type",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_board_data_options_ant_type,
            { "Antenna Type", "capwap.control.cisco.board_data_options.ant_type",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_board_data_options_flex_connect,
            { "Flex Connect", "capwap.control.cisco.board_data_options.flex_connect",
              FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_board_data_options_ap_type,
            { "AP Type", "capwap.control.cisco.board_data_options.ap_type",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_board_data_options_join_priority,
            { "Join Priority", "capwap.control.cisco.board_data_options.join_priority",
              FT_UINT8, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_capwap_cisco_unknown,
            { "Unknown Data", "capwap.control.cisco.unknown",
              FT_BYTES, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },

        /* Fragment entries */
        { &hf_msg_fragments,
            { "Message fragments", "capwap.fragments",
              FT_NONE, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_fragment,
            { "Message fragment", "capwap.fragment",
              FT_FRAMENUM, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_fragment_overlap,
            { "Message fragment overlap", "capwap.fragment.overlap",
              FT_BOOLEAN, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_fragment_overlap_conflicts,
            { "Message fragment overlapping with conflicting data", "capwap.fragment.overlap.conflicts",
              FT_BOOLEAN, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_fragment_multiple_tails,
            { "Message has multiple tail fragments", "capwap.fragment.multiple_tails",
              FT_BOOLEAN, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_fragment_too_long_fragment,
            { "Message fragment too long", "capwap.fragment.too_long_fragment",
              FT_BOOLEAN, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_fragment_error,
            { "Message defragmentation error", "capwap.fragment.error",
              FT_FRAMENUM, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_fragment_count,
            { "Message fragment count", "capwap.fragment.count",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_reassembled_in,
            { "Reassembled in", "capwap.reassembled.in",
              FT_FRAMENUM, BASE_NONE, NULL, 0x0,
              NULL, HFILL }
        },
        { &hf_msg_reassembled_length,
            { "Reassembled CAPWAP length", "capwap.reassembled.length",
              FT_UINT32, BASE_DEC, NULL, 0x0,
              NULL, HFILL }
        }
    };

    /* Setup protocol subtree array */
    static gint *ett[] = {
        &ett_capwap,
        &ett_capwap_control,
        &ett_capwap_data,
        &ett_capwap_preamble,
        &ett_capwap_header,
        &ett_capwap_header_flags,
        &ett_capwap_control_header,
        &ett_capwap_control_header_msg,
        &ett_capwap_data_keep_alive,
        &ett_capwap_message_element,
        &ett_capwap_data_message_bindings_ieee80211,
        &ett_capwap_encryption_capabilities,
        &ett_capwap_encryption_capability,
        &ett_capwap_ac_information,
        &ett_capwap_wtp_descriptor,
        &ett_capwap_board_data,
        &ett_capwap_message_element_type,
        &ett_capwap_ac_descriptor_security_flags,
        &ett_capwap_ac_descriptor_dtls_flags,
        &ett_capwap_wtp_frame_tunnel_mode,
        &ett_capwap_ieee80211_add_wlan_capability,
        &ett_capwap_ieee80211_ie_flags,
        &ett_capwap_ieee80211_update_wlan_capability,
        &ett_capwap_ieee80211_station_capabilities,
        &ett_capwap_ieee80211_ofdm_control_band_support,
        &ett_msg_fragment,
        &ett_msg_fragments
    };

    static ei_register_info ei[] = {
        { &ei_capwap_header_length_bad, { "capwap.header.length.bad", PI_MALFORMED, PI_WARN, "Wrong calculate length =! header length", EXPFILL }},
        { &ei_capwap_data_keep_alive_length, { "capwap.keep_alive.length.bad", PI_MALFORMED, PI_WARN, "Invalid Keep Alive length", EXPFILL }},
        { &ei_capwap_msg_element_length, { "capwap.message_element.length.bad", PI_MALFORMED, PI_ERROR, "Bad Message Element length", EXPFILL }},
        { &ei_capwap_message_element_type, { "capwap.message_element.type.undecoded", PI_UNDECODED, PI_NOTE, "Dissector for CAPWAP message element Type not implemented, Contact Wireshark developers if you want this supported", EXPFILL }},
        { &ei_capwap_fortinet_mac_len, { "capwap.control.fortinet.mac.length.bad", PI_MALFORMED, PI_ERROR, "Bad length: Should be a multiple of 6", EXPFILL }},
        { &ei_capwap_message_element_fortinet_type, { "capwap.message_element.type.fortinet.undecoded", PI_UNDECODED, PI_NOTE, "Dissector for CAPWAP message element Fortinet Type not implemented", EXPFILL }},
        { &ei_capwap_message_element_cisco_type, { "capwap.message_element.type.fortinet.undecoded", PI_UNDECODED, PI_NOTE, "Dissector for CAPWAP message element Cisco Type not implemented", EXPFILL }}
    };

    expert_module_t* expert_capwap;

    proto_capwap_control = proto_register_protocol("Control And Provisioning of Wireless Access Points - Control", "CAPWAP-CONTROL", "capwap");
    proto_capwap_data = proto_register_protocol("Control And Provisioning of Wireless Access Points - Data", "CAPWAP-DATA", "capwap.data");

    proto_register_field_array(proto_capwap_control, hf, array_length(hf));

    proto_register_subtree_array(ett, array_length(ett));

    expert_capwap = expert_register_protocol(proto_capwap_control);
    expert_register_field_array(expert_capwap, ei, array_length(ei));

    reassembly_table_register(&capwap_reassembly_table,
                          &addresses_reassembly_table_functions);

    capwap_module = prefs_register_protocol(proto_capwap_control, NULL);
    /* Need to create a placeholder for "port" preferences so there is a callback */
    prefs_register_protocol(proto_capwap_data, apply_capwap_prefs);

    prefs_register_bool_preference(capwap_module, "draft_8_cisco", "Cisco Wireless Controller Support",
        "Enable support of Cisco Wireless Controller (based on old 8 draft revision).",
        &global_capwap_draft_8_cisco);

    prefs_register_bool_preference(capwap_module, "reassemble", "Reassemble fragmented CAPWAP packets",
        "Reassemble fragmented CAPWAP packets.",
        &global_capwap_reassemble);

    prefs_register_bool_preference(capwap_module, "swap_fc", "Swap Frame Control",
        "Swap frame control bytes (needed for some APs).",
        &global_capwap_swap_frame_control);

}

void
proto_reg_handoff_capwap(void)
{
    dissector_handle_t capwap_control_handle, capwap_data_handle;

    capwap_control_handle = create_dissector_handle(dissect_capwap_control, proto_capwap_control);
    capwap_data_handle    = create_dissector_handle(dissect_capwap_data, proto_capwap_data);
    dtls_handle           = find_dissector_add_dependency("dtls", proto_capwap_control);
    find_dissector_add_dependency("dtls", proto_capwap_data);
    ieee8023_handle       = find_dissector_add_dependency("eth_withoutfcs", proto_capwap_data);
    ieee80211_handle      = find_dissector_add_dependency("wlan_withoutfcs", proto_capwap_data);
    ieee80211_bsfc_handle = find_dissector_add_dependency("wlan_bsfc", proto_capwap_data);

    dissector_add_uint_with_preference("udp.port", UDP_PORT_CAPWAP_CONTROL, capwap_control_handle);
    dissector_add_uint_with_preference("udp.port", UDP_PORT_CAPWAP_DATA, capwap_data_handle);
}
/*
 * Editor modelines
 *
 * Local Variables:
 * c-basic-offset: 4
 * tab-width: 8
 * indent-tabs-mode: nil
 * End:
 *
 * ex: set shiftwidth=4 tabstop=8 expandtab:
 * :indentSize=4:tabSize=8:noTabs=true:
 */