summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mih.c
blob: a34992c0c912331d95a5daabeefbf03653f0f424 (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
/* packet-mih.c
 * Definitions for MIH (Media independent Handover) packet disassembly structures and routines
 * Refer to (IEEE 802.21) IEEE Standard for Local and metropolitan area networks- Part 21: Media Independent Handover Services, 21 Jan 2009
 *
 * Copyright 2011, ANKITH AGARWAL <ankitha@cdac.in>
 *
 * The original patch submitted in 2011 was improved and expanded in 2012 by Fraunhofer Institute for Open Communication Systems (FOKUS)
 * The improvements include filtering of all fields as well as including definitions from the revised IEEE 802.21b document from 10 May 2012
 *
 * Copyright 2012, Alton MacDonald <alton.kenneth.macdonald@fokus.fraunhofer.de>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */



#include "config.h"

#include <epan/packet.h>
#include <epan/exceptions.h>
#include <epan/etypes.h>
void proto_register_mih(void);
void proto_reg_handoff_mih(void);

static dissector_handle_t mih_handle;

#define MIH_PORT 4551

#define VERSION_MASK    0xF0
#define ACKREQ_MASK     0x8
#define ACKRESP_MASK    0x4
#define UIR_MASK        0x2
#define MORE_FRAG_MASK  0x1
#define FRAG_NO_MASK    0xFE
#define SID_MASK        0xF000
#define OPCODE_MASK     0x0C00
#define AID_MASK        0x03FF
#define TRANS_ID_MASK   0x0FFF
#define LEN_OF_LEN_MASK 0x80

/*Type values for TLV encoding*/
#define SRC_MIHF_ID             1
#define DEST_MIHF_ID            2
#define STATUS                  3
#define LINK_TYPE               4
#define MIH_EVT_LIST            5
#define MIH_CMD_LIST            6
#define MIH_IQ_TYPE_LIST        7
#define MIH_TRANS_LIST          8
#define LINK_ADDR_LIST          9
#define MBB_HO_SUPP_LIST        10
#define REG_REQUEST_CODE        11
#define VALID_TIME_INTR         12
#define LINK_ID                 13
#define NEW_LINK_ID             14
#define OLD_ACCESS_ROUTER       15
#define NEW_ACCESS_ROUTER       16
#define IP_RENEWAL_FLAG         17
#define IP_MOB_MGMT             18
#define IP_CFG_MTHDS            19
#define LINK_DN_REASON          20
#define TIMER_INTERVAL          21
#define LINK_GOING_DN_REASON    22
#define LINK_PARAM_RPT_LIST     23
#define DEV_STATES_REQ          24
#define LINK_ID_LIST            25
#define DEV_STATES_RSP_LIST     26
#define STATUS_REQ_SET          27
#define STATUS_RSP_LIST         28
#define CFG_REQ_LIST            29
#define CFG_RSP_LIST            30
#define LINK_POA_LIST           31
#define PREF_LINK_LIST          32
#define HO_REQ_QUERY_LIST       33
#define HO_STATUS               34
#define ACCESS_ROUTER_ADDR      35
#define DHCP_SER_ADDR           36
#define FA_ADDR                 37
#define LINK_ACTION_REQ_LIST    38
#define LINK_ACTION_RSP_LIST    39
#define HO_RESULT               40
#define LINK_RES_STATUS         41
#define RES_RETENTION_STATUS    42
#define IQ_BIN_DATA_LIST        43
#define IQ_RDF_DATA_LIST        44
#define IQ_RDF_SCHEMA_URL       45
#define IQ_RDF_SCHM_LIST        46
#define MAX_RSP_SIZE            47
#define IR_BIN_DATA_LIST        48
#define IR_RDF_DATA_LIST        49
#define IR_SCHM_URL_LIST        50
#define IR_RDF_SCHM_LIST        51
#define MN_MIHF_ID              52
#define Q_RES_RPT_FLAG          53
#define EVT_CFG_INFO_LIST       54
#define TGT_NET_INFO            55
#define TGT_NET_INFO_LIST       56
#define ASGN_RES_SET            57
#define LINK_DET_INFO_LIST      58
#define MN_LINK_ID              59
#define POA_LINK_ADDR           60
#define UNAUTH_INFO_REQ         61
#define NET_TYPE                62
#define REQ_RES_SET             63
#define VEND_SPECIFIC_TLV       100

/*Bitmasks in 802.21 are encoded in Network-Byte-Order: bit0 is leftmost bit*/

/*MASK for event list*/
#define LINK_DETECT_MASK        0x80000000
#define LINK_UP_MASK            0x40000000
#define LINK_DOWN_MASK          0x20000000
#define LINK_PARAM_MASK         0x10000000
#define LINK_GD_MASK            0x08000000
#define LINK_HO_IMM_MASK        0x04000000
#define LINK_HO_COMP_MASK       0x02000000
#define LINK_PDU_MASK           0x01000000

/*MASK for command list*/
/*1st bit is reserved*/
#define CMD_EVT_SUBS_MASK       0x40000000
#define CMD_EVT_UNSUBS_MASK     0x20000000
#define CMD_GET_PARA_MASK       0x10000000
#define CMD_CONF_TH_MASK        0x08000000
#define CMD_LINK_AC_MASK        0x04000000

/*MASK for Info Query list*/
#define IQ_BIN_DATA_MASK        0x80000000
#define IQ_RDF_DATA_MASK        0x40000000
#define IQ_RDF_SCH_U_MASK       0x20000000
#define IQ_RDF_SCH_MASK         0x10000000
#define IQ_IE_NET_TYPE_MASK     0x08000000
#define IQ_IE_OP_ID_MASK        0x04000000
#define IQ_SERV_ID_MASK         0x02000000
#define IQ_IE_COUN_MASK         0x01000000
#define IQ_NET_ID_MASK          0x00800000
#define IQ_NET_AUX_MASK         0x00400000
#define IQ_IE_ROAM_MASK         0x00200000
#define IQ_IE_COST_MASK         0x00100000
#define IQ_IE_QOS_MASK          0x00080000
#define IQ_IE_DATA_MASK         0x00040000
#define IQ_IE_REGDOM_MASK       0x00020000
#define IQ_IE_FREQ_MASK         0x00010000
#define IQ_IE_IP_CFG_MASK       0x00008000
#define IQ_IE_CAP_MASK          0x00004000
#define IQ_IE_SUP_MASK          0x00002000
#define IQ_IE_MOB_MG_MASK       0x00001000
#define IQ_IE_EM_SERV_MASK      0x00000800
#define IQ_IE_IMS_MASK          0x00000400
#define IQ_IE_MOB_NET_MASK      0x00000200
#define IQ_IE_POA_ADDR_MASK     0x00000100
#define IQ_IE_POA_LOC_MASK      0x00000080
#define IQ_IE_POA_CHAN_MASK     0x00000040
#define IQ_IE_POA_SYS_MASK      0x00000020
#define IQ_IE_POA_SUB_MASK      0x00000010
#define IQ_IE_POA_IP_MASK       0x00000008

/*MASK for mobility Management methods*/
#define MOB_MIP4_MASK           0x8000
#define MOB_MIP4_REG_MASK       0x4000
#define MOB_MIP6_MASK           0x2000
#define MOB_HMIP6_MASK          0x1000
#define MOB_LOW_LAT_MASK        0x0800
#define MOB_FMIP6_MASK          0x0400
#define MOB_IKE_MULTI_MASK      0x0200

/*MASK for ip configuration methods*/
#define IP_CFG_STAT_MASK        0x80000000
#define IP_CFG_DHCP4_MASK       0x40000000
#define IP_CFG_MIP4_FA_MASK     0x20000000
#define IP_CFG_MIP4_NFA_MASK    0x10000000
/*bits 4-10 reserved for IPv4 address configuration*/
#define IP_CFG_IP6_SL_MASK      0x00100000
#define IP_CFG_DHCP6_MASK       0x00080000
#define IP_CFG_IP6_MAN_MASK     0x00040000

/*information holder integers...*/
static int proto_mih;
static int hf_mih_version;
static int hf_mih_ack_req;
static int hf_mih_ack_resp;
static int hf_mih_uir;
static int hf_mih_more_frag;
static int hf_mih_frag_no;
static int hf_mih_mid;
static int hf_mih_service_id;
static int hf_mih_opcode;
static int hf_mih_serv_actionid;
static int hf_mih_event_actionid;
static int hf_mih_command_actionid;
static int hf_mih_info_actionid;
static int hf_mih_tid;
static int hf_mih_pay_len;
static int hf_mih_type;
static int hf_mih_type_length;
static int hf_mih_type_length_ext;
static int hf_mihf_id;
static int hf_mihf_id_mac;
static int hf_mihf_id_ipv4;
static int hf_mihf_id_ipv6;
static int hf_status;
static int hf_ip_methods_supported;
static int hf_ip_dhcp_services;
static int hf_fn_agent;
static int hf_access_router;
static int hf_link_type;
static int hf_link_type_ext;
static int hf_ipv4_addr;
static int hf_ipv6_addr;
static int hf_link_dn_reason;
static int hf_link_gdn_reason;
static int hf_mac_addr;
static int hf_link_param_gen;
static int hf_link_param_qos;
static int hf_link_param_gg;
static int hf_link_param_802_11;
static int hf_link_param_fdd;
static int hf_link_param_edge;
static int hf_link_param_eth;
static int hf_link_param_c2k;
static int hf_link_param_hrpd;
static int hf_link_param_802_16;
static int hf_link_param_802_20;
static int hf_link_param_802_22;
static int hf_link_param_value;
static int hf_op_mode;
static int hf_link_ac_type;
static int hf_link_ac_ext_time;
static int hf_link_ac_result;
static int hf_ho_reason;
static int hf_ho_status;
static int hf_reg_request_code;
static int hf_ip_renewal;
static int hf_max_resp_size;
static int hf_time_interval;
static int hf_valid_time_interval;
static int hf_tsp_carrier;
static int hf_mbb_ho_supp;
static int hf_link_addr_type;
static int hf_link_transport_addr_type;
static int hf_link_addr_string;
static int hf_link_data_rate;
static int hf_plmn_id;
static int hf_location_area_id;
static int hf_cell_id;
static int hf_ci;
static int hf_threshold_val;
static int hf_threshold_x_dir;
static int hf_threshold_action;
static int hf_config_status;
static int hf_num_cos;
static int hf_num_queue;
static int hf_channel_id;
static int hf_predef_cfg_id;
static int hf_network_id;
static int hf_net_aux_id;
static int hf_sig_strength_dbm;
static int hf_sig_strength_per;
static int hf_cos_id;
static int hf_cos_value;
static int hf_sinr;
static int hf_rdf_data;
static int hf_rdf_mime_type;
static int hf_link_res_status;
static int hf_res_retention_status;
static int hf_res_rpt_flag;
static int hf_unauth_info_req;
static int hf_rdf_sch;
static int hf_rdf_sch_url;
static int hf_ir_bin_data;
static int hf_iq_bin_data_x;
static int hf_vendor_specific_tlv;
static int hf_reserved_tlv;
static int hf_experimental_tlv;
static int hf_unknown_tlv;
static int hf_fragmented_tlv;

/*header fields for event list */
static int hf_event_list;
static int hf_event_link_detect;
static int hf_event_link_up;
static int hf_event_link_dn;
static int hf_event_link_param;
static int hf_event_link_gd;
static int hf_event_ho_imm;
static int hf_event_ho_comp;
static int hf_event_pdu_tx_stat;

/*header fields for command list*/
static int hf_cmd_list;
static int hf_cmd_event_subs;
static int hf_cmd_event_unsub;
static int hf_cmd_get_param;
static int hf_cmd_con_thres;
static int hf_cmd_link_action;

/*header fields for iq type list*/
static int hf_iq_list;
static int hf_iq_bin_data;
static int hf_iq_rdf_data;
static int hf_iq_rdf_sch_url;
static int hf_iq_rdf_sch;
static int hf_iq_net_type;
static int hf_iq_op_id;
static int hf_iq_serv_pro_id;
static int hf_iq_country_code;
static int hf_iq_net_id;
static int hf_iq_net_aux_id;
static int hf_iq_roam_part;
static int hf_iq_cost;
static int hf_iq_net_qos;
static int hf_iq_net_dat_rt;
static int hf_iq_net_reg_dom;
static int hf_iq_freq_bands;
static int hf_iq_ip_cfg_mthds;
static int hf_iq_net_cap;
static int hf_iq_supp_lcp;
static int hf_iq_net_mob_mg;
static int hf_iq_net_emserv;
static int hf_iq_net_ims_pcscf;
static int hf_iq_net_mob_net;
static int hf_iq_link_addr;
static int hf_iq_poa_loc;
static int hf_iq_poa_chan_range;
static int hf_iq_poa_sys_info;
static int hf_iq_poa_sub_info;
static int hf_iq_poa_ip;

/*header fields for mob mgmt*/
static int hf_mob_list;
static int hf_mob_mip4;
static int hf_mob_mip4_reg;
static int hf_mob_mip6;
static int hf_mob_hmip6;
static int hf_mob_low_lat;
static int hf_mob_fmip6;
static int hf_mob_ike_multi;

/*header fields for configure methods*/
static int hf_cfg_mthds;
static int hf_cfg_ip4_stat;
static int hf_cfg_dhcp4;
static int hf_cfg_mip_fa;
static int hf_cfg_mip_wo_fa;
static int hf_cfg_ip6_sac;
static int hf_cfg_dhcp6;
static int hf_cfg_ip6_manual;

/*header fields for transport list*/
static int hf_trans_list;
static int hf_trans_udp;
static int hf_trans_tcp;

/*header fields for device state requests and responses*/
static int hf_dev_states_req;
static int hf_dev_states_req_dev_info;
static int hf_dev_states_req_batt_lvl;
static int hf_dev_states_resp;
static int hf_dev_batt_level;
static int hf_dev_info;

/*header fields for Link Action Attributes*/
static int hf_link_ac_attr;
static int hf_link_ac_attr_link_scan;
static int hf_link_ac_attr_link_res_retain;
static int hf_link_ac_attr_data_fwd_req;

/*header fields for transport subtypes*/
static int hf_link_subtype_eth;
static int hf_link_subtype_eth_10m;
static int hf_link_subtype_eth_100m;
static int hf_link_subtype_eth_1000m;
static int hf_link_subtype_wireless_other;
static int hf_link_subtype_wireless_other_dvb;
static int hf_link_subtype_wireless_other_tdmb;
static int hf_link_subtype_wireless_other_atsc;
static int hf_link_subtype_ieee80211;
static int hf_link_subtype_ieee80211_24;
static int hf_link_subtype_ieee80211_5;
static int hf_link_subtype_ieee80211_49;
static int hf_link_subtype_ieee80211_365;
static int hf_link_subtype_ieee80211_316;
static int hf_link_subtype_umts;
static int hf_link_subtype_umts_99;
static int hf_link_subtype_umts_4;
static int hf_link_subtype_umts_5;
static int hf_link_subtype_umts_6;
static int hf_link_subtype_umts_7;
static int hf_link_subtype_umts_8;
static int hf_link_subtype_cdma2000;
static int hf_link_subtype_cdma2000_0;
static int hf_link_subtype_cdma2000_a;
static int hf_link_subtype_cdma2000_b;
static int hf_link_subtype_cdma2000_c;
static int hf_link_subtype_ieee80216;
static int hf_link_subtype_ieee80216_25;
static int hf_link_subtype_ieee80216_35;

/*header fields for MIH Capabilities*/
static int hf_mihcap;
static int hf_mihcap_es;
static int hf_mihcap_cs;
static int hf_mihcap_is;

/*header fields for High Level Network Capabilities*/
static int hf_net_caps;
static int hf_net_caps_sec;
static int hf_net_caps_qos0;
static int hf_net_caps_qos1;
static int hf_net_caps_qos2;
static int hf_net_caps_qos3;
static int hf_net_caps_qos4;
static int hf_net_caps_qos5;
static int hf_net_caps_ia;
static int hf_net_caps_es;
static int hf_net_caps_mihcap;

/*trees and subtrees...*/
static int ett_mih;
static int ett_ver_flags;
static int ett_mid;
static int ett_tlv;
static int ett_cmd_bitmap;
static int ett_event_bitmap;
static int ett_mob_mgt_bitmap;
static int ett_cfg_mtd_bitmap;
static int ett_iq_type_bitmap;
static int ett_trans_list_bitmap;
static int ett_dev_states_bitmap;
static int ett_mihcap_bitmap;
static int ett_net_caps_bitmap;
static int ett_ac_attr_bitmap;
static int ett_subtype_eth_bitmap;
static int ett_subtype_wireless_other_bitmap;
static int ett_subtype_ieee80211_bitmap;
static int ett_subtype_umts_bitmap;
static int ett_subtype_cdma2000_bitmap;
static int ett_subtype_ieee80216_bitmap;
static int ett_min_pk_tx_delay;
static int ett_avg_pk_tx_delay;
static int ett_max_pk_tx_delay;
static int ett_pk_delay_jitter;
static int ett_pk_loss_rate;
static int ett_list_prefer_link;
static int ett_ip_dhcp_server;
static int ett_fn_agent;
static int ett_access_router;
static int ett_link_states_req;
static int ett_link_desc_req;
static int ett_dev_states_resp;

/*field definitions of evt, cmd, mob mgmt, ip cfg, iq type */
static int * const event_fields[] = {
        &hf_event_link_detect,
        &hf_event_link_up,
        &hf_event_link_dn,
        &hf_event_link_param,
        &hf_event_link_gd,
        &hf_event_ho_imm,
        &hf_event_ho_comp,
        &hf_event_pdu_tx_stat,
        NULL
};

static int * const cmd_fields[] = {
        &hf_cmd_event_subs,
        &hf_cmd_event_unsub,
        &hf_cmd_get_param,
        &hf_cmd_con_thres,
        &hf_cmd_link_action,
        NULL
};

static int * const iq_type_fields[] = {
        &hf_iq_bin_data,
        &hf_iq_rdf_data,
        &hf_iq_rdf_sch_url,
        &hf_iq_rdf_sch,
        &hf_iq_net_type,
        &hf_iq_op_id,
        &hf_iq_serv_pro_id,
        &hf_iq_country_code,
        &hf_iq_net_id,
        &hf_iq_net_aux_id,
        &hf_iq_roam_part,
        &hf_iq_cost,
        &hf_iq_net_qos,
        &hf_iq_net_dat_rt,
        &hf_iq_net_reg_dom,
        &hf_iq_freq_bands,
        &hf_iq_ip_cfg_mthds,
        &hf_iq_net_cap,
        &hf_iq_supp_lcp,
        &hf_iq_net_mob_mg,
        &hf_iq_net_emserv,
        &hf_iq_net_ims_pcscf,
        &hf_iq_net_mob_net,
        &hf_iq_link_addr,
        &hf_iq_poa_loc,
        &hf_iq_poa_chan_range,
        &hf_iq_poa_sys_info,
        &hf_iq_poa_sub_info,
        &hf_iq_poa_ip,
        NULL
};

static int * const mob_fields[] = {
        &hf_mob_mip4,
        &hf_mob_mip4_reg,
        &hf_mob_mip6,
        &hf_mob_hmip6,
        &hf_mob_low_lat,
        &hf_mob_fmip6,
        &hf_mob_ike_multi,
        NULL
};

static int * const cfg_fields[] = {
        &hf_cfg_ip4_stat,
        &hf_cfg_dhcp4,
        &hf_cfg_mip_fa,
        &hf_cfg_mip_wo_fa,
        &hf_cfg_ip6_sac,
        &hf_cfg_dhcp6,
        &hf_cfg_ip6_manual,
        NULL
};

/*field definitions for various bitmaps */
static int * const trans_fields[] = {
        &hf_trans_udp,
        &hf_trans_tcp,
        NULL
};

static int * const dev_states_fields[] = {
        &hf_dev_states_req_dev_info,
        &hf_dev_states_req_batt_lvl,
        NULL
};

static int * const mihcap_fields[] = {
        &hf_mihcap_es,
        &hf_mihcap_cs,
        &hf_mihcap_is,
        NULL
};

static int * const net_caps_fields[] = {
        &hf_net_caps_sec,
        &hf_net_caps_qos0,
        &hf_net_caps_qos1,
        &hf_net_caps_qos2,
        &hf_net_caps_qos3,
        &hf_net_caps_qos4,
        &hf_net_caps_qos5,
        &hf_net_caps_ia,
        &hf_net_caps_es,
        &hf_net_caps_mihcap,
        NULL
};

static int * const ac_attr_fields[] = {
        &hf_link_ac_attr_link_scan,
        &hf_link_ac_attr_link_res_retain,
        &hf_link_ac_attr_data_fwd_req,
        NULL
};

static int * const subtype_eth_fields[] = {
        &hf_link_subtype_eth_10m,
        &hf_link_subtype_eth_100m,
        &hf_link_subtype_eth_1000m,
        NULL
};

static int * const subtype_wireless_other_fields[] = {
        &hf_link_subtype_wireless_other_dvb,
        &hf_link_subtype_wireless_other_tdmb,
        &hf_link_subtype_wireless_other_atsc,
        NULL
};

static int * const subtype_ieee80211_fields[] = {
        &hf_link_subtype_ieee80211_24,
        &hf_link_subtype_ieee80211_5,
        &hf_link_subtype_ieee80211_49,
        &hf_link_subtype_ieee80211_365,
        &hf_link_subtype_ieee80211_316,
        NULL
};

static int * const subtype_umts_fields[] = {
        &hf_link_subtype_umts_99,
        &hf_link_subtype_umts_4,
        &hf_link_subtype_umts_5,
        &hf_link_subtype_umts_6,
        &hf_link_subtype_umts_7,
        &hf_link_subtype_umts_8,
        NULL
};

static int * const subtype_cdma2000_fields[] = {
        &hf_link_subtype_cdma2000_0,
        &hf_link_subtype_cdma2000_a,
        &hf_link_subtype_cdma2000_b,
        &hf_link_subtype_cdma2000_c,
        NULL
};

static int * const subtype_ieee80216_fields[] = {
        &hf_link_subtype_ieee80216_25,
        &hf_link_subtype_ieee80216_35,
        NULL
};

static const value_string servicevalues[] = {
{1, "Service Management"},
{2, "Event Service"},
{3, "Command Service"},
{4, "Information Service"},
{0, NULL}
};

static const value_string opcodevalues[] = {
{0, "Confirm"},
{1, "Request"},
{2, "Response"},
{3, "Indication"},
{0, NULL},
};

static const value_string link_ac_result_vals[] = {
{0, "Success"},
{1, "Failure"},
{2, "Refused"},
{3, "Incapable"},
{0, NULL},
};

static const value_string serv_act_id_values[] = {
{1, "MIH_Capability_Discover"},
{2, "MIH_Register"},
{3, "MIH_DeRegister"},
{4, "MIH_Event_Subscribe"},
{5, "MIH_Event_Unsubscribe"},
{0, NULL}
};

static const value_string event_act_id_values[] = {
{1, "MIH_Link_Detected"},
{2, "MIH_Link_UP"},
{3, "MIH_Link_Down"},
{5, "MIH_Link_Parameter_Report"},
{6, "MIH_Link_Going_down"},
{7, "MIH_Link_Handover_Imminent"},
{8, "MIH_Handover_Complete"},
{0, NULL}
};

static const value_string status_types[] = {
{0, "Success"},
{1, "Unspecified Failure"},
{2, "Rejected"},
{3, "Authorization Failure"},
{4, "Network Error"},
{0, NULL}
};

static const value_string ho_status_vals[] = {
{0, "Handover Permitted"},
{1, "Handover Declined"},
{0, NULL}
};

static const value_string mbb_ho_supp_vals[] = {
{0, "Make before break is not supported."},
{1, "Make before break is supported."},
{0, NULL}
};

static const value_string reg_request_code_vals[] = {
{0, "Make"},
{1, "Re-Registration"},
{0, NULL}
};

static const value_string ip_renewal_vals[] = {
{0, "Change Not Required"},
{1, "Change Required"},
{0, NULL}
};

static const value_string dev_states_req_vals[] = {
{0, "DEVICE_INFO"},
{1, "BATT_LEVEL"},
{0, NULL}
};

static const value_string link_addr_types[] ={
{0, "MAC_ADDR"},
{1, "3GPP_3G_CELL_ID"},
{2, "3GPP_2G_CELL_ID"},
{3, "3GPP_ADDR"},
{4, "3GPP2_ADDR"},
{5, "OTHER_L2_ADDR"},
{0, NULL}
};

static const value_string threshold_x_dir_vals[] ={
{0, "Above Threshold"},
{1, "Below Threshold"},
{0, NULL}
};

static const value_string threshold_action_vals[] ={
{0, "Set Normal Threshold"},
{1, "Set one-shot Threshold"},
{2, "Cancel Threshold"},
{0, NULL}
};

static const value_string boolean_types[] ={
{0, "False"},
{1, "True"},
{0, NULL}
};

static const value_string command_act_id_values[] = {
{1, "MIH_Link_Get_Parameters"},
{2, "MIH_Link_Configure_Thresholds"},
{3, "MIH_Link_Actions"},
{4, "MIH_Net_HO_Candidate_Query"},
{5, "MIH_MN_HO_Candidate_Query"},
{6, "MIH_N2N_HO_Query_Resources"},
{7, "MIH_MN_HO_Commit"},
{8, "MIH_Net_HO-Commit"},
{9, "MN_N2N_HO_Commit"},
{10, "MIH_MN_HO_Complete"},
{11, "MIH_N2N_HO_Complete"},
{12, "MIH_Net_HO_Best_Commit"},
{0, NULL}
};

static const value_string info_act_id_values[] = {
{1, "MIH_Get_Information"},
{2, "MIH_Push_information"},
{0, NULL}
};

static const value_string link_dn_reason_vals[] = {
{0, "Explicit Disconnect"},
{1, "Packet Timeout"},
{2, "No resource"},
{3, "No broadcast"},
{4, "Authentication Failure"},
{5, "Billing Failure"},
{0, NULL}
};

static const value_string link_gdn_reason_vals[] = {
{0, "Explicit Disconnect"},
{1, "Link Parameter Degrading"},
{2, "Low Power"},
{3, "No resource"},
{0, NULL}
};

static const value_string link_type_vals[] = {
{0, "Reserved"},
{1, "Wireless - GSM"},
{2, "Wireless - GPRS"},
{3, "Wireless - EDGE"},
{15, "Ethernet"},
{18, "Wireless - Other"},
{19, "Wireless - IEEE 802.11"},
{22, "Wireless - CDMA2000"},
{23, "Wireless - UMTS"},
{24, "Wireless - cdma2000-HRPD"},
{27, "Wireless - IEEE 802.16"},
{28, "Wireless - IEEE 802.20"},
{29, "Wireless - IEEE 802.22"},
{40, "DVB"},
{41, "T-DMB"},
{42, "ATSC-M/H"},
{0, NULL}
};

static const value_string link_param_gen_vals[] = {
{0, "Data Rate"},
{1, "Signal Strength"},
{2, "SINR"},
{3, "Throughput"},
{4, "Packet Error Rate"},
{5, "Channel Frequency"},
{6, "Channel Bandwidth"},
{7, "Channel TX Power"},
{8, "Higher Adjacent Channel Frequency"},
{9, "Higher Adjacent Channel Bandwidth"},
{10, "Higher Adjacent Channel TX Power"},
{11, "Lower Adjacent Channel Frequency"},
{12, "Lower Adjacent Channel Bandwidth"},
{13, "Lower Adjacent Channel TX Power"},
{0, NULL}
};

static const value_string link_ac_type_vals[] = {
{0, "NONE"},
{1, "LINK_DISCONNECT"},
{2, "LINK_LOW_POWER"},
{3, "LINK_POWER_DOWN"},
{4, "LINK_POWER_UP"},
{5, "LINK_CONFIGURE"},
{0, NULL}
};

static const value_string link_param_gg_vals[] = {
{0, "Rx Qual"},
{1, "RsLev"},
{2, "Mean BEP"},
{3, "StDev BEP"},
{0, NULL}
};

static const value_string link_param_fdd_vals[] = {
{0, "CPICH RSCP"},
{1, "PCCPCH RSCP"},
{2, "UTRA carrier RSSI"},
{3, "GSM carrier RSSI"},
{4, "CPICH Ec/No"},
{5, "Transport channel BLER"},
{6, "User equipment (UE) transmitted power"},
{0, NULL}
};

static const value_string link_param_802_11_vals[] = {
{0, "RSSI"},
{1, "No QoS resource Available"},
{2, "Multicast packet loss rate"},
{0, NULL}
};

static const value_string op_mode_vals[] = {
{0, "Normal Mode"},
{1, "Power Saving Mode"},
{2, "Powered Down"},
{0, NULL}
};

static const value_string link_param_qos_vals[] = {
{0, "Max no of differentiable classes"},
{1, "Min Packet transfer delay"},
{2, "Avg packet transfer delay"},
{3, "Max packet transfer delay"},
{4, "delay jitter"},
{5, "Packet loss"},
{0, NULL}
};

static const value_string link_param_c2k_hrpd_vals[] = {
{0, "Pilot Strength"},
{0, NULL}
};

static const value_string typevaluenames[] = {
{ 1, "Source MIHIF ID" },
{ 2, "Destination MIHIF ID" },
{ 3, "Status" },
{ 4, "Link type" },
{ 5, "MIH event list" },
{ 6, "MIH command list" },
{ 7, "MIIS query type list" },
{ 8, "Transport option list" },
{ 9, "Link address list" },
{ 10, "MBB handover support" },
{ 11, "Register request code" },
{ 12, "Valid time interval" },
{ 13, "Link identifier" },
{ 14, "New Link identifier" },
{ 15, "Old access router" },
{ 16, "New access  router" },
{ 17, "IP renewal flag" },
{ 18, "Mobility management support" },
{ 19, "IP address configuration methods" },
{ 20, "Link down reason code" },
{ 21, "Time interval" },
{ 22, "Link going down reason" },
{ 23, "Link parameter report list" },
{ 24, "Device states request" },
{ 25, "Link identifier list" },
{ 26, "Device states response list" },
{ 27, "Get status request set" },
{ 28, "Get status response list" },
{ 29, "Configure request list" },
{ 30, "Configure response list" },
{ 31, "List of link PoA list" },
{ 32, "Preferred link list" },
{ 33, "Handover resource query list" },
{ 34, "Handover status" },
{ 35, "Access router address" },
{ 36, "DHCP server address" },
{ 37, "FA address" },
{ 38, "Link actions list" },
{ 39, "Link actions result list" },
{ 40, "Handover result" },
{ 41, "Resource status" },
{ 42, "Resource retention status" },
{ 43, "Info query binary data list" },
{ 44, "Info query RDF data list" },
{ 45, "Info query RDF schema URL" },
{ 46, "Info query RDF schema list" },
{ 47, "Max response size" },
{ 48, "Info response binary data list" },
{ 49, "Info response RDF data list" },
{ 50, "Info response RDF schema URL list" },
{ 51, "Info response RDF schema list" },
{ 52, "Mobile node MIHF ID" },
{ 53, "Query resource report flag" },
{ 54, "Event configuration info list" },
{ 55, "Target network info" },
{ 56, "List of target network info" },
{ 57, "Assigned resource set" },
{ 58, "Link detected info list" },
{ 59, "MN link ID" },
{ 60, "PoA" },
{ 61, "Unauthenticated information request" },
{ 62, "Network type" },
{ 63, "Requested resource set" },
{0, NULL}
};

static int16_t dissect_mih_list(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree, int16_t (*base_dissect)(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree))
{
        uint8_t i = 0;
        uint8_t list_len = tvb_get_uint8(tvb, offset);
        offset ++;
        for(i=0; i < list_len; i++)
                offset = base_dissect(tvb, offset, tlv_tree);
        return (offset);
}

static int16_t dissect_ip_addr(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint16_t addr_type = tvb_get_ntohs(tvb, offset);
        uint8_t len = 0;
        if(addr_type == 1 )
        {
                /*IPv4 Addr*/
                len = tvb_get_uint8(tvb, offset + 3);
                proto_tree_add_item(tlv_tree, hf_ipv4_addr, tvb, offset+2, len, ENC_BIG_ENDIAN);
                return (offset+3+len);
        }
        if(addr_type == 2)
        {
                /*IPv6 Addr*/
                len = tvb_get_uint8(tvb, offset + 3);
                proto_tree_add_item(tlv_tree,hf_ipv6_addr, tvb, offset+2, len, ENC_NA);
                return (offset+3+len);
        }
        else
        {
                len = tvb_get_uint8(tvb, offset + 3);
                return (offset+3+len);
        }
}

static int16_t dissect_qos_val(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        proto_tree_add_item(tlv_tree, hf_cos_id, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++ ;
        proto_tree_add_item(tlv_tree, hf_cos_value, tvb, offset, 2, ENC_BIG_ENDIAN);
        offset += 2;
        return (offset);
}

static int16_t dissect_link_addr(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree )
{
        uint8_t link_addr_choice = tvb_get_uint8(tvb, offset);
        uint8_t len = 0;

        proto_tree_add_item(tlv_tree, hf_link_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
        switch (link_addr_choice)
        {
        case 0 : /*MAC_ADDR*/
                proto_tree_add_item(tlv_tree, hf_link_transport_addr_type, tvb, offset+1, 2, ENC_BIG_ENDIAN);
                if(tvb_get_ntohs(tvb, offset+1) == 0x06)
                        proto_tree_add_item(tlv_tree, hf_mac_addr, tvb, offset+4, tvb_get_uint8(tvb, offset+3), ENC_NA);
                return (offset + 10);

        case 1 :/*3GPP_3G_CELL_ID*/
                proto_tree_add_item(tlv_tree, hf_plmn_id, tvb, offset+1, 3, ENC_BIG_ENDIAN);
                proto_tree_add_item(tlv_tree, hf_cell_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
                return (offset + 8);

        case 2 :/*3GPP_2G_CELL_ID*/
                proto_tree_add_item(tlv_tree, hf_plmn_id, tvb, offset+1, 3, ENC_BIG_ENDIAN);
                proto_tree_add_item(tlv_tree, hf_location_area_id, tvb, offset+4, 2, ENC_BIG_ENDIAN);
                proto_tree_add_item(tlv_tree, hf_ci, tvb, offset+6, 2, ENC_BIG_ENDIAN);
                return (offset + 8);

        case 3 :/*3GPP_ADDR*/
        case 4 :/*3GPP2_ADDR*/
        case 5 :/*OTHER_L2_ADDR*/
                len = tvb_get_uint8(tvb, offset+1);
                proto_tree_add_item(tlv_tree, hf_link_addr_string, tvb, offset+2, len, ENC_ASCII);
                return (offset + 2 + len);
        }
        return 0;
}

static int16_t dissect_tsp_container(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t len = 0;
        if(tvb_get_uint8(tvb, offset) == 1)
        {
                proto_tree_add_item(tlv_tree, hf_predef_cfg_id, tvb, offset+1, 1, ENC_BIG_ENDIAN);
                return (offset + 2);
        }
        else if(tvb_get_uint8(tvb, offset) == 2)
        {
                len = tvb_get_uint8(tvb, offset+1);
                proto_tree_add_item(tlv_tree, hf_tsp_carrier, tvb, offset+2, len, ENC_ASCII);
                return (offset + len + 2);
        }
        else
                return (offset + 1);
}

static int16_t dissect_iq_rdf_data(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t len = 0;
        if(tvb_get_uint8(tvb, offset))
        {
                len = tvb_get_uint8(tvb, offset+1);
                proto_tree_add_item(tlv_tree, hf_rdf_mime_type, tvb, offset+2, len, ENC_ASCII);
                offset += len + 1;
        }
        offset++;
        len = tvb_get_uint8(tvb, offset);
        proto_tree_add_item(tlv_tree, hf_rdf_data, tvb, offset+1, len, ENC_ASCII);
        return (offset+len+1);
}

static int16_t dissect_qos_list(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        proto_tree *subtree;

        proto_tree_add_item(tlv_tree, hf_num_cos, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset += 1;
        subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_min_pk_tx_delay, NULL, "MIN_PK_TX_DELAY");
        offset = dissect_mih_list(tvb, offset, subtree, dissect_qos_val);
        subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_avg_pk_tx_delay, NULL, "AVG_PK_TX_DELAY");
        offset = dissect_mih_list(tvb, offset, subtree, dissect_qos_val);
        subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_max_pk_tx_delay, NULL, "MAX_PK_TX_DELAY");
        offset = dissect_mih_list(tvb, offset, subtree, dissect_qos_val);
        subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_pk_delay_jitter, NULL, "PK_DELAY_JITTER");
        offset = dissect_mih_list(tvb, offset, subtree, dissect_qos_val);
        subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_pk_loss_rate, NULL, "PK_LOSS_RATE");
        offset = dissect_mih_list(tvb, offset, subtree, dissect_qos_val);
        return (offset);
}

static int16_t dissect_dev_states(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t len = 0;
        proto_item *item;
        proto_tree *sub_tree;

        item = proto_tree_add_item(tlv_tree, hf_dev_states_resp, tvb, offset, 1, ENC_BIG_ENDIAN);
        sub_tree = proto_item_add_subtree(item, ett_dev_states_resp);
        if(tvb_get_uint8(tvb, offset))
        {
                /*BATT_LEVEL*/
                offset++;
                proto_tree_add_item(sub_tree, hf_dev_batt_level, tvb, offset, 1, ENC_BIG_ENDIAN);
                return (offset+1);
        }
        else
        {
                /*DEVICE INFO*/
                offset++;
                len = tvb_get_uint8(tvb, offset);
                proto_tree_add_item(sub_tree, hf_dev_info, tvb, offset+1, len, ENC_ASCII);
                return (offset + len + 1);

        }
}

static int16_t dissect_net_type(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t len = 0;
        uint8_t type = 0;
        if(!tvb_get_uint8(tvb, offset))
        {
                /*LINK_TYPE*/
                type = tvb_get_uint8(tvb, offset+1);
                proto_tree_add_item(tlv_tree, hf_link_type, tvb, offset+1, 1, ENC_BIG_ENDIAN);
                offset += 1;
        }
        offset += 1;
        if(!tvb_get_uint8(tvb, offset))
        {
                /*LINK_SUBTYPE*/
                switch (type)
                {
                        /* last 32 bits are not read since proto_tree_add_bitmask only handles bitmasks of length 32
                         Even though the standard defines a bitmasks of length 64, there are no definitions in the standard that require more than 32 bits
                         1 (identifier) + 4(bitmask defined values) + 4 (unused bits) = 9 (final offset)*/
                        case 15 : /*subtype ethernet*/
                                proto_tree_add_bitmask(tlv_tree, tvb, offset+1, hf_link_subtype_eth, ett_subtype_eth_bitmap, subtype_eth_fields, ENC_BIG_ENDIAN);
                                break;
                        case 18 : /*subtype wireless other*/
                                proto_tree_add_bitmask(tlv_tree, tvb, offset+1, hf_link_subtype_wireless_other, ett_subtype_wireless_other_bitmap, subtype_wireless_other_fields, ENC_BIG_ENDIAN);
                                break;
                        case 19 : /*subtype 802.11*/
                                proto_tree_add_bitmask(tlv_tree, tvb, offset+1, hf_link_subtype_ieee80211, ett_subtype_ieee80211_bitmap, subtype_ieee80211_fields, ENC_BIG_ENDIAN);
                                break;
                        case 23 : /*subtype UMTS*/
                                proto_tree_add_bitmask(tlv_tree, tvb, offset+1, hf_link_subtype_umts, ett_subtype_umts_bitmap, subtype_umts_fields, ENC_BIG_ENDIAN);
                                break;
                        case 24 : /*subtype cdma2000*/
                                proto_tree_add_bitmask(tlv_tree, tvb, offset+1, hf_link_subtype_cdma2000, ett_subtype_cdma2000_bitmap, subtype_cdma2000_fields, ENC_BIG_ENDIAN);
                                break;
                        case 27 : /*subtype 802.16*/
                                proto_tree_add_bitmask(tlv_tree, tvb, offset+1, hf_link_subtype_ieee80216, ett_subtype_ieee80216_bitmap, subtype_ieee80216_fields, ENC_BIG_ENDIAN);
                                break;
                        default :
                                proto_item_append_text(tlv_tree, "N/A");
                }
                /*4(bitmask defined values) + 4 (unused bits) = 8 bits*/
                offset += 8;
        }
        /*1 (identifier) = 1 bit*/
        offset += 1;
        if(!tvb_get_uint8(tvb, offset))
        {
                /*TYPE_EXT*/
                len = tvb_get_uint8(tvb, offset+1);
                proto_tree_add_item(tlv_tree, hf_link_type_ext, tvb, offset+2, len, ENC_ASCII);
                offset += len + 2;
        }
        return (offset);
}

static int16_t dissect_net_type_addr(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        offset = dissect_net_type(tvb, offset, tlv_tree);
        offset = dissect_link_addr(tvb, offset, tlv_tree);
        return (offset) ;
}

static int16_t dissect_mbb_ho_supp(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        offset = dissect_net_type(tvb, offset, tlv_tree);
        offset = dissect_net_type(tvb, offset, tlv_tree);
        proto_tree_add_item(tlv_tree, hf_mbb_ho_supp, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++;
        return (offset);
}

static int16_t dissect_tgt_net_info(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t len = 0;
        if(!tvb_get_uint8(tvb, offset))
        {
                offset +=1;

                /*NETWORK_ID*/
                len = tvb_get_uint8(tvb, offset);
                proto_tree_add_item(tlv_tree, hf_network_id, tvb, offset+1, len, ENC_ASCII);
                offset += len + 2;
                if(!tvb_get_uint8(tvb, offset))
                {
                        /*NET_AUX_ID*/
                        offset +=1;
                        len = tvb_get_uint8(tvb, offset);
                        proto_tree_add_item(tlv_tree, hf_net_aux_id, tvb, offset+1, len, ENC_ASCII);
                        return (offset + 1);
                }
                return (offset + 2);
        }
        else
        {
                /*LINK_ADDR*/
                offset +=1;
                offset = dissect_link_addr(tvb, offset, tlv_tree);
                return (offset);
        }
}

static int16_t dissect_link_id(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{

        int16_t next_offset = 0;

        /*LINK_TYPE*/
        proto_tree_add_item(tlv_tree, hf_link_type, tvb, offset, 1, ENC_BIG_ENDIAN);
        next_offset = dissect_link_addr(tvb, offset+1, tlv_tree);
        return (next_offset);
}

static int16_t dissect_link_poa(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        offset = dissect_link_id(tvb, offset, tlv_tree);
        offset = dissect_mih_list(tvb, offset, tlv_tree, dissect_link_addr);
        return (offset);
}

static int16_t dissect_rq_result(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        proto_tree *subtree;
        subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_list_prefer_link, NULL, "List of preferred links");
        offset = dissect_link_poa(tvb, offset, subtree);
        offset = dissect_qos_list(tvb, offset, tlv_tree);
        offset++;
        switch(tvb_get_uint8(tvb, offset-1))
        {
                case 1:
                        proto_tree_add_item(tlv_tree, hf_ip_methods_supported, tvb, offset, 1, ENC_BIG_ENDIAN);
                        offset++;
                        break;
                case 2:
                        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_cfg_mthds, ett_cfg_mtd_bitmap, cfg_fields, ENC_BIG_ENDIAN);
                        offset += 2;
                        break;
        }
        offset++;
        switch(tvb_get_uint8(tvb, offset-1))
        {
                case 1:
                        proto_tree_add_item(tlv_tree, hf_ip_dhcp_services, tvb, offset, 1, ENC_BIG_ENDIAN);
                        offset++;
                        break;
                case 2: subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_ip_dhcp_server, NULL, "IP DHCP server");
                        offset = dissect_ip_addr(tvb, offset, subtree);
                        break;
        }
        offset++;
        switch(tvb_get_uint8(tvb, offset-1))
        {
                case 1:
                        proto_tree_add_item(tlv_tree, hf_fn_agent, tvb, offset, 1, ENC_BIG_ENDIAN);
                        offset++;
                        break;
                case 2: subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_fn_agent, NULL, "FN Agent");
                        offset = dissect_ip_addr(tvb, offset, subtree);
                        break;
        }
        offset++;
        switch(tvb_get_uint8(tvb, offset-1))
        {
                case 1:
                        proto_tree_add_item(tlv_tree, hf_access_router, tvb, offset, 1, ENC_BIG_ENDIAN);
                        offset++;
                        break;
                case 2: subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 1, ett_access_router, NULL, "Access Router");
                        offset = dissect_ip_addr(tvb, offset, subtree);
                        break;
        }
        return (offset+1);
}

static int16_t dissect_link_det_info(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t len = 0;
        offset = dissect_link_id(tvb, offset, tlv_tree);
        if(tvb_get_uint8(tvb, offset))
        {
                offset++;
                offset = dissect_link_addr(tvb, offset, tlv_tree);
                offset --;
        }
        offset++;
        len = tvb_get_uint8(tvb, offset);
        proto_tree_add_item(tlv_tree, hf_network_id, tvb, offset+1, len, ENC_ASCII);
        offset += len + 1;
        len = tvb_get_uint8(tvb, offset);
        proto_tree_add_item(tlv_tree, hf_net_aux_id, tvb, offset+1, len, ENC_ASCII);
        offset += len + 1;
        if(tvb_get_uint8(tvb, offset))
                proto_tree_add_item(tlv_tree, hf_sig_strength_per, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        else
                proto_tree_add_item(tlv_tree, hf_sig_strength_dbm, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        offset += 2;
        proto_tree_add_item(tlv_tree, hf_sinr, tvb, offset, 2, ENC_BIG_ENDIAN);
        offset += 2;
        proto_tree_add_item(tlv_tree, hf_link_data_rate, tvb, offset,4, ENC_BIG_ENDIAN);
        offset += 4;
        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_mihcap, ett_mihcap_bitmap, mihcap_fields, ENC_BIG_ENDIAN);
        offset++;
        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_net_caps, ett_net_caps_bitmap, net_caps_fields, ENC_BIG_ENDIAN);
        offset += 4;
        return (offset);
}

static int16_t dissect_link_scan_rsp(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t len = 0;
        offset = dissect_link_addr(tvb, offset, tlv_tree);
        len = tvb_get_uint8(tvb, offset);
        proto_tree_add_item(tlv_tree, hf_network_id, tvb, offset+1, len, ENC_ASCII);
        offset = offset + len + 1;
        if(tvb_get_uint8(tvb, offset))
                proto_tree_add_item(tlv_tree, hf_sig_strength_per, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        else
                proto_tree_add_item(tlv_tree, hf_sig_strength_dbm, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        return offset+2;
}

static int16_t dissect_link_action_rsp(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        offset = dissect_link_id(tvb, offset, tlv_tree);
        proto_tree_add_item(tlv_tree, hf_link_ac_result, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++;
        if(tvb_get_uint8(tvb, offset))
        {
                offset = dissect_mih_list(tvb, offset+1, tlv_tree, dissect_link_scan_rsp);
                return offset;
        }
        else
                return (offset+1);

}

static int16_t dissect_link_action_req(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        offset = dissect_link_id(tvb, offset, tlv_tree);
        if(tvb_get_uint8(tvb, offset))
        {
                offset = dissect_link_addr(tvb, offset+1, tlv_tree);
        }
        else
        {
                offset++;
        }
        proto_tree_add_item(tlv_tree, hf_link_ac_type, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++;
        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_link_ac_attr, ett_ac_attr_bitmap, ac_attr_fields, ENC_BIG_ENDIAN);
        offset++;
        proto_tree_add_item(tlv_tree, hf_link_ac_ext_time, tvb, offset, 2, ENC_BIG_ENDIAN);
        return (offset+2);
}

static int16_t dissect_link_states_rsp(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        if(!tvb_get_uint8(tvb, offset))
        {
                proto_tree_add_item(tlv_tree, hf_op_mode, tvb, offset+1, 1, ENC_BIG_ENDIAN);
                offset += 2;
        }
        else
        {
                proto_tree_add_item(tlv_tree, hf_channel_id, tvb, offset+1, 2, ENC_BIG_ENDIAN);
                offset += 3;
        }
        return (offset);
}

static int16_t dissect_link_param_type(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t type = tvb_get_uint8(tvb, offset);
        offset++;

        /*LINK_PARAM_TYPE*/
        switch (type)
        {
                case 0 :/*LINK_PARAM_GEN*/
                        proto_tree_add_item(tlv_tree, hf_link_param_gen, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 1 :/*LINK_PARAM_QOS*/
                        proto_tree_add_item(tlv_tree, hf_link_param_qos, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 2 :/*LINK_PARAM_GG*/
                        proto_tree_add_item(tlv_tree, hf_link_param_gg, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 3 :/*LINK_PARAM_EDGE*/
                        proto_tree_add_item(tlv_tree, hf_link_param_edge, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 4 :/*LINK_PARAM_ETH*/
                        proto_tree_add_item(tlv_tree, hf_link_param_eth, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 5 :/*LINK_PARAM_802_11*/
                        proto_tree_add_item(tlv_tree, hf_link_param_802_11, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 6 :/*LINK_PARAM_C2K*/
                         proto_tree_add_item(tlv_tree, hf_link_param_c2k, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 7 :/*LINK_PARAM_FDD*/
                        proto_tree_add_item(tlv_tree, hf_link_param_fdd, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 8 :/*LINK_PARAM_HRPD*/
                        proto_tree_add_item(tlv_tree, hf_link_param_hrpd, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 9 :/*LINK_PARAM_802_16*/
                        proto_tree_add_item(tlv_tree, hf_link_param_802_16, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 10 :/*LINK_PARAM_802_20*/
                        proto_tree_add_item(tlv_tree, hf_link_param_802_20, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case 11 :/*LINK_PARAM_802_22*/
                        proto_tree_add_item(tlv_tree, hf_link_param_802_22, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;
        }
        return (offset+1);
}

static void dissect_link_status_req(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        proto_tree *subtree;

        /*LINK_STATES_REQ*/
        uint16_t temp = tvb_get_ntohs(tvb, offset);
        if(!temp)
        {
                subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 3, ett_link_states_req, NULL, "LINK_STATES_REQ: ");
                proto_tree_add_item(subtree, hf_op_mode, tvb, offset+2, 1, ENC_BIG_ENDIAN);
                offset+=3;
        }
        else
        {
                subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 4, ett_link_states_req, NULL, "LINK_STATES_REQ: ");
                proto_tree_add_item(subtree, hf_channel_id, tvb, offset+2, 2, ENC_BIG_ENDIAN);
                offset+=4;
        }

        /*LINK_PARAM_TYPE_LIST*/
        offset = dissect_mih_list(tvb, offset, tlv_tree, dissect_link_param_type);

        /*LINK_DESC_REQ*/
        temp = tvb_get_ntohs(tvb, offset);
        subtree = proto_tree_add_subtree(tlv_tree, tvb, offset, 3, ett_link_desc_req, NULL, "LINK_DESC_REQ");
        offset+=2;
        if(!temp)
                proto_tree_add_item(subtree, hf_num_cos, tvb, offset, 1, ENC_BIG_ENDIAN);
        else
                proto_tree_add_item(subtree, hf_num_queue, tvb, offset, 1, ENC_BIG_ENDIAN);
}

static int16_t dissect_link_cfg_status(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        offset = dissect_link_param_type(tvb, offset, tlv_tree);
        proto_tree_add_item(tlv_tree, hf_threshold_val, tvb, offset, 2, ENC_BIG_ENDIAN);
        offset += 2;
        proto_tree_add_item(tlv_tree, hf_threshold_x_dir, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset ++;
        proto_tree_add_item(tlv_tree, hf_config_status, tvb, offset, 1, ENC_BIG_ENDIAN);
        return (offset+1);
}

static int16_t dissect_link_param(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        /*LINK_PARAM_TYPE*/
        offset = dissect_link_param_type(tvb, offset, tlv_tree);
        if(!tvb_get_uint8(tvb, offset))
        {
                offset ++;
                /*LINK_PARAM_VALUE*/
                proto_tree_add_item(tlv_tree, hf_link_param_value, tvb, offset, 2, ENC_BIG_ENDIAN);
                offset += 2;
        }
        else
        {
                proto_tree *subtree;
                offset ++;
                /*QOS_PARAM_VALUE*/
                switch(tvb_get_uint8(tvb, offset))
                {
                        case 0:
                                proto_tree_add_item(tlv_tree, hf_num_cos, tvb, offset+1, 1, ENC_BIG_ENDIAN);
                                offset += 2;
                                break;
                        case 1:
                                subtree = proto_tree_add_subtree(tlv_tree, tvb, offset+1, 1, ett_min_pk_tx_delay, NULL, "MIN_PK_TX_DELAY");
                                offset = dissect_mih_list(tvb, offset+1, subtree, dissect_qos_val);
                                break;
                        case 2:
                                subtree = proto_tree_add_subtree(tlv_tree, tvb, offset+1, 1, ett_avg_pk_tx_delay, NULL, "AVG_PK_TX_DELAY");
                                offset = dissect_mih_list(tvb, offset+1, subtree, dissect_qos_val);
                                break;
                        case 3:
                                subtree = proto_tree_add_subtree(tlv_tree, tvb, offset+1, 1, ett_max_pk_tx_delay, NULL, "MAX_PK_TX_DELAY");
                                offset = dissect_mih_list(tvb, offset+1, subtree, dissect_qos_val);
                                break;
                        case 4:
                                subtree = proto_tree_add_subtree(tlv_tree, tvb, offset+1, 1, ett_pk_delay_jitter, NULL, "PK_DELAY_JITTER");
                                offset = dissect_mih_list(tvb, offset+1, subtree, dissect_qos_val);
                                break;
                        case 5:
                                subtree = proto_tree_add_subtree(tlv_tree, tvb, offset+1, 1, ett_pk_loss_rate, NULL, "PK_LOSS_RATE");
                                offset = dissect_mih_list(tvb, offset+1, subtree, dissect_qos_val);
                                break;
                }
        }
        return offset;
}

static int16_t dissect_link_param_rpt(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        /*LINK_PARAM*/
        offset = dissect_link_param(tvb, offset, tlv_tree);
        if(tvb_get_uint8(tvb, offset))
        {
                /*Threshold*/
                offset++;
                proto_tree_add_item(tlv_tree, hf_threshold_val, tvb, offset, 2, ENC_BIG_ENDIAN);
                offset += 2;
                proto_tree_add_item(tlv_tree, hf_threshold_x_dir, tvb, offset, 1, ENC_BIG_ENDIAN);
                return (offset+1);
        }
        else
                return (offset+1);
}

static int16_t dissect_link_desc_rsp(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        if(!tvb_get_uint8(tvb, offset))
                proto_tree_add_item(tlv_tree, hf_num_cos, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        else
                proto_tree_add_item(tlv_tree, hf_num_queue, tvb, offset+1, 1, ENC_BIG_ENDIAN);
        return (offset+2);
}

static int16_t dissect_status_list(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        /*LINK_ID*/
        offset = dissect_link_id(tvb, offset, tlv_tree);

        /*LINK_STATES_RSP*/
        offset = dissect_mih_list(tvb, offset, tlv_tree, dissect_link_states_rsp);

        /*LINK_PARAM*/
        offset = dissect_mih_list(tvb, offset, tlv_tree, dissect_link_param);

        /*LINK_DESC_RSP*/
        offset = dissect_mih_list(tvb, offset, tlv_tree, dissect_link_desc_rsp);
        return offset;
}

static int16_t dissect_link_det_cfg(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        uint8_t len = 0;
        if(tvb_get_uint8(tvb, offset))
        {
                len = tvb_get_uint8(tvb, offset+1);
                proto_tree_add_item(tlv_tree, hf_network_id, tvb, offset+2, len, ENC_ASCII);
                offset += len + 1;
        }
        offset++;
        if(tvb_get_uint8(tvb, offset))
        {
                if(tvb_get_uint8(tvb, offset+1))
                        proto_tree_add_item(tlv_tree, hf_sig_strength_per, tvb, offset+2, 1, ENC_BIG_ENDIAN);
                else
                        proto_tree_add_item(tlv_tree, hf_sig_strength_dbm, tvb, offset+2, 1, ENC_BIG_ENDIAN);
                offset += 2;
        }
        offset++;
        if(tvb_get_uint8(tvb, offset))
        {
                proto_tree_add_item(tlv_tree, hf_link_data_rate, tvb, offset+1,4, ENC_BIG_ENDIAN);
                offset += 4;
        }
        return (offset+1);
}

static int16_t dissect_link_cfg_param(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        offset = dissect_link_param_type(tvb, offset, tlv_tree);
        if(tvb_get_uint8(tvb, offset))
        {
                proto_tree_add_item(tlv_tree, hf_time_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
                offset += 2;
        }
        offset++;
        proto_tree_add_item(tlv_tree, hf_threshold_action, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++;
        proto_tree_add_item(tlv_tree, hf_threshold_val, tvb, offset, 2, ENC_BIG_ENDIAN);
        offset += 2;
        proto_tree_add_item(tlv_tree, hf_threshold_x_dir, tvb, offset, 1, ENC_BIG_ENDIAN);
        return (offset+1) ;
}

static int16_t dissect_mih_evt_cfg_info(tvbuff_t *tvb, int16_t offset, proto_tree *tlv_tree)
{
        offset = dissect_mih_list(tvb, offset, tlv_tree, dissect_link_det_cfg);
        offset = dissect_mih_list(tvb, offset, tlv_tree, dissect_link_cfg_param);
        return offset;
}

static void dissect_mih_tlv(tvbuff_t *tvb,int offset, proto_tree *tlv_tree, uint8_t type, uint32_t length)
{

        uint8_t mihf_id_len = 0;
        char mihf_id_first_char = 0;
        uint8_t i = 0;
        uint8_t len = 0;

        tvbuff_t *volatile tvb_mihf_id = NULL;
        tvbuff_t* tvb_temp = NULL;
        volatile bool composite_error = false;

        /*For Value fields*/
        switch (type)
        {
                case SRC_MIHF_ID :
                case DEST_MIHF_ID :
                case MN_MIHF_ID :
                        /*MIHF ID*/
                        mihf_id_len = tvb_get_uint8(tvb, offset);
                        /*taken from the 802.21 standard:
                        If L2 communication is used then MIHF_ID is the NAI-encoded linklayer
                        address (LINK_ADDR) of the entity that hosts the MIH services.
                        In an NAI-encoded IP address or link-layer address, each octet
                        of binary-encoded IP4_ADDR, IP6_ADDR and LINK_ADDR data is
                        encoded in the username part of the NAI as "\" followed by the octet
                        value.*/
                        mihf_id_first_char = (char)tvb_get_uint8(tvb, offset+1);
                        if(mihf_id_first_char!='\\')
                                proto_tree_add_item(tlv_tree, hf_mihf_id, tvb, offset+1, mihf_id_len, ENC_ASCII);
                        else
                        {
                                if(mihf_id_len<tvb_reported_length_remaining(tvb,0) && (mihf_id_len==12 || mihf_id_len==64 || mihf_id_len==128))
                                {
                                        tvb_mihf_id = tvb_new_composite();
                                        for(i=0; i < mihf_id_len/2; i++)
                                        {
                                                tvb_temp = tvb_new_subset_length(tvb, offset + 2 + 2*i, 1);
                                                if (tvb_captured_length(tvb_temp)) {
                                                        tvb_composite_append(tvb_mihf_id, tvb_temp);
                                                }
                                        }
                                        TRY
                                        {
                                                tvb_composite_finalize(tvb_mihf_id);
                                        }
                                        CATCH_ALL
                                        {
                                                composite_error = true;
                                        }
                                        ENDTRY;

                                        if(!composite_error)
                                        {
                                                switch(mihf_id_len)
                                                {
                                                        case 12:  /* checks if the length corresponds to a MAC address */
                                                                proto_tree_add_item(tlv_tree, hf_mihf_id_mac, tvb_mihf_id, 0, mihf_id_len/2, ENC_NA);
                                                                break;
                                                        case 64:  /* checks if the length corresponds to an IPv4 address */
                                                                proto_tree_add_item(tlv_tree, hf_mihf_id_ipv4, tvb_mihf_id, 0, mihf_id_len/2, ENC_BIG_ENDIAN);
                                                                break;
                                                        case 128: /* checks if the length corresponds to an IPv6 address */
                                                                proto_tree_add_item(tlv_tree, hf_mihf_id_ipv6, tvb_mihf_id, 0, mihf_id_len/2, ENC_NA);
                                                                break;
                                                }
                                        }
                                        else
                                                tvb_free(tvb_mihf_id);
                                }
                        }
                        break;

                case STATUS :
                        /*STATUS*/
                        proto_tree_add_item(tlv_tree, hf_status, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case LINK_TYPE :
                        /*LINK_TYPE*/
                        proto_tree_add_item(tlv_tree, hf_link_type, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case MIH_EVT_LIST :
                        /*MIH_EVT_LIST*/
                        proto_tree_add_bitmask(tlv_tree/*evt_list_tree*/, tvb, offset, hf_event_list, ett_event_bitmap, event_fields, ENC_BIG_ENDIAN);
                        break;

                case MIH_CMD_LIST :
                        /*MIH_CMD_LSIT*/
                        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_cmd_list, ett_cmd_bitmap, cmd_fields, ENC_BIG_ENDIAN);
                        break;

                case MIH_IQ_TYPE_LIST :
                        /*MIH_IQ_TYPE_LIST*/
                        /*last 32 bits are not read since proto_tree_add_bitmask only handles bitmasks of length 32
                         Even though the standard defines a bitmasks of length 64, there are no definitions in the standard that require more than 32 bits*/
                        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_iq_list, ett_iq_type_bitmap, iq_type_fields, ENC_BIG_ENDIAN);
                        break;

                case MIH_TRANS_LIST :
                        /*MIH_TRANS_LIST*/
                        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_trans_list, ett_trans_list_bitmap, trans_fields, ENC_BIG_ENDIAN);
                        break;

                case LINK_ADDR_LIST :
                        /*NET_TYPE_ADDR_LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_net_type_addr);
                        break;

                case MBB_HO_SUPP_LIST :
                        /*MBB_HO_SUPP_LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_mbb_ho_supp);
                        break;

                case REG_REQUEST_CODE :
                        /*REG_REQUEST_CODE*/
                        proto_tree_add_item(tlv_tree, hf_reg_request_code, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case VALID_TIME_INTR :
                        /*Valid Time interval*/
                        proto_tree_add_item(tlv_tree, hf_valid_time_interval, tvb, offset, 4, ENC_BIG_ENDIAN);
                        break;

                case LINK_ID :
                case NEW_LINK_ID :
                case MN_LINK_ID :
                        /*Link identifier*/
                        dissect_link_id(tvb, offset, tlv_tree);
                        break;

                case OLD_ACCESS_ROUTER :
                case NEW_ACCESS_ROUTER :
                case POA_LINK_ADDR :
                        /*LINK ADDR*/
                        dissect_link_addr(tvb, offset, tlv_tree);
                        break;

                case IP_RENEWAL_FLAG :
                        /*IP_RENEWAL_FLAG*/
                        proto_tree_add_item(tlv_tree, hf_ip_renewal, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case IP_MOB_MGMT :
                        /*IP_MOB_MGMT*/
                        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_mob_list, ett_mob_mgt_bitmap, mob_fields, ENC_BIG_ENDIAN);
                        break;

                case IP_CFG_MTHDS :
                        /*IP_CFG_MTHDS*/
                        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_cfg_mthds, ett_cfg_mtd_bitmap, cfg_fields, ENC_BIG_ENDIAN);
                        break;

                case LINK_DN_REASON :
                        /*LINK_DN_REASON*/
                        proto_tree_add_item(tlv_tree, hf_link_dn_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case TIMER_INTERVAL :
                        /*Time interval*/
                        proto_tree_add_item(tlv_tree, hf_time_interval, tvb, offset, 2, ENC_BIG_ENDIAN);
                        break;

                case LINK_GOING_DN_REASON :
                        /*LINK_GOING_DN REASON*/
                        proto_tree_add_item(tlv_tree, hf_link_gdn_reason, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case LINK_PARAM_RPT_LIST :
                        /*LINK_PARAM_RPT_LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_link_param_rpt);
                        break;

                case DEV_STATES_REQ :
                        /*DEV_STATES_REQ*/
                        proto_tree_add_bitmask(tlv_tree, tvb, offset, hf_dev_states_req, ett_dev_states_bitmap, dev_states_fields, ENC_BIG_ENDIAN);
                        break;

                case LINK_ID_LIST :
                        /*LINK ID List*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_link_id);
                        break;

                case DEV_STATES_RSP_LIST :
                        /*DEV_STATES_RSP List*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_dev_states);
                        break;

                case STATUS_REQ_SET :
                        /*LINK_STATUS_REQ*/
                        dissect_link_status_req(tvb, offset, tlv_tree);
                        break;

                case STATUS_RSP_LIST :
                        /*Status Response List*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_status_list);
                        break;

                case CFG_REQ_LIST :
                        /*LINK_CFG_PARAM_LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_link_cfg_param);
                        break;

                case CFG_RSP_LIST :
                        /*LINK_CFG_STATUS_LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_link_cfg_status);
                        break;

                case LINK_POA_LIST :
                        /*LINK_POA_LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_link_poa);
                        break;

                case PREF_LINK_LIST :
                        /*RQ_RESULT*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_rq_result);
                        break;

                case HO_REQ_QUERY_LIST :
                        /*QoS_LIST*/
                        dissect_qos_list(tvb, offset, tlv_tree);
                        break;

                case HO_STATUS:
                        /*HO_STATUS*/
                        proto_tree_add_item(tlv_tree, hf_ho_status, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case ACCESS_ROUTER_ADDR :
                case DHCP_SER_ADDR :
                case FA_ADDR :
                        /*IP_ADDR*/
                        dissect_ip_addr(tvb, offset, tlv_tree);
                        break;

                case LINK_ACTION_REQ_LIST :
                        /*LINK_ACTION_REQ LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_link_action_req);
                        break;

                case LINK_ACTION_RSP_LIST :
                        /*LINK_ACTION_RSP LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_link_action_rsp);
                        break;

                case HO_RESULT :
                        /*HO_RESULT*/
                        proto_tree_add_item(tlv_tree, hf_status, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case LINK_RES_STATUS :
                        /*LINK_RES_STATUS*/
                        proto_tree_add_item(tlv_tree, hf_link_res_status, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case RES_RETENTION_STATUS :
                        /*BOOLEAN*/
                        proto_tree_add_item(tlv_tree, hf_res_retention_status, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case IQ_RDF_SCHEMA_URL :
                        /*BOOLEAN*/
                        proto_tree_add_item(tlv_tree, hf_iq_rdf_sch_url, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case Q_RES_RPT_FLAG :
                        /*BOOLEAN*/
                        proto_tree_add_item(tlv_tree, hf_res_rpt_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case UNAUTH_INFO_REQ :
                        /*BOOLEAN*/
                        proto_tree_add_item(tlv_tree, hf_unauth_info_req, tvb, offset, 1, ENC_BIG_ENDIAN);
                        break;

                case IQ_BIN_DATA_LIST :
                        /*IQ_BIN_DATA LIST*/
                        proto_tree_add_item(tlv_tree, hf_iq_bin_data_x, tvb, offset, length, ENC_ASCII);
                        break;

                case IQ_RDF_DATA_LIST :
                case IR_RDF_DATA_LIST :
                case IR_RDF_SCHM_LIST :
                        /*IQ_RDF_DATA LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_iq_rdf_data);
                        break;

                case IQ_RDF_SCHM_LIST :
                        /*IQ_RDF_SCHM*/
                        for(i=0; i < tvb_get_uint8(tvb, offset); i++)
                        {
                                len = tvb_get_uint8(tvb, offset+1);
                                proto_tree_add_item(tlv_tree, hf_rdf_sch, tvb, offset+2, len, ENC_ASCII);
                                offset += len;
                        }
                        break;

                case MAX_RSP_SIZE :
                        /*Max Response Size*/
                        proto_tree_add_item(tlv_tree, hf_max_resp_size, tvb, offset, 2, ENC_BIG_ENDIAN);
                        break;

                case IR_BIN_DATA_LIST :
                        /*IR_BIN_DATA LIST*/
                        proto_tree_add_item(tlv_tree, hf_ir_bin_data, tvb, offset, length, ENC_ASCII);
                        break;

                case IR_SCHM_URL_LIST :
                        /*IR_SCHM_URL*/
                        for(i=0; i < tvb_get_uint8(tvb, offset); i++)
                        {
                                len = tvb_get_uint8(tvb, offset+1);
                                proto_tree_add_item(tlv_tree, hf_rdf_sch_url, tvb, offset+2, len, ENC_ASCII);
                                offset += len;
                        }
                        break;

                case EVT_CFG_INFO_LIST :
                        /*EVT_CFG_INFO LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_mih_evt_cfg_info);
                        break;

                case TGT_NET_INFO :
                        /*TGT_NET_INFO*/
                        dissect_tgt_net_info(tvb, offset, tlv_tree);
                        break;

                case TGT_NET_INFO_LIST :
                        /*List of TGT_NET_INFO*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_tgt_net_info);
                        break;

                case ASGN_RES_SET :
                        /*ASGN_RES_SET*/
                        offset = dissect_qos_list(tvb, offset, tlv_tree);
                        dissect_tsp_container(tvb, offset, tlv_tree);
                        break;

                case LINK_DET_INFO_LIST :
                        /*LINK_DET_INFO LIST*/
                        dissect_mih_list(tvb, offset, tlv_tree, dissect_link_det_info);
                        break;

                case NET_TYPE :
                        /*NETWORK TYPE*/
                        dissect_net_type(tvb, offset, tlv_tree);
                        break;

                case REQ_RES_SET :
                        /*REQ_RES_SET*/
                        offset = dissect_qos_list(tvb, offset, tlv_tree);
                        offset = dissect_tsp_container(tvb, offset, tlv_tree);
                        proto_tree_add_item(tlv_tree, hf_ho_reason, tvb, offset, 1, ENC_BIG_ENDIAN );
                        break;

                case VEND_SPECIFIC_TLV :
                        /*Vendor specific tlv*/
                        proto_tree_add_item(tlv_tree, hf_vendor_specific_tlv, tvb, offset, length, ENC_ASCII);
                        break;

                default :/*did not match type*/
                        /*do switch case for range of numbers*/

                        /*RESERVED TLVs*/
                        if(type > 63 && type < 100)
                                proto_tree_add_item(tlv_tree, hf_reserved_tlv, tvb, offset, length, ENC_ASCII);

                                                /*EXPERIMENTAL TLVs*/
                        else if(type > 100 && type < 255)
                                proto_tree_add_item(tlv_tree, hf_experimental_tlv, tvb, offset, length, ENC_ASCII);

                        /*UNKNOWN TLVs*/
                        else
                                proto_tree_add_item(tlv_tree, hf_unknown_tlv, tvb, offset, length, ENC_ASCII);
        }
        return;
}

static int dissect_mih(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
        proto_item *ti = NULL;
        int offset = 0;
        proto_item *item = NULL;
        proto_tree *mih_tree = NULL;
        proto_tree *ver_flags_tree = NULL;
        uint8_t serviceid = 0;
        uint8_t opcode = 0;
        uint8_t service = 0;
        uint16_t action = 0;
        int32_t payload_length = 0;
        uint64_t len = 0;
        uint8_t len_of_len = 0;
        uint8_t type = 0;
        proto_tree *mid_tree = NULL;
        proto_tree *tlv_tree = NULL;
        uint8_t fragment = 0;

        col_set_str(pinfo->cinfo, COL_PROTOCOL, "MIH");
        col_clear(pinfo->cinfo,COL_INFO);

        /* we are being asked for details */
        ti = proto_tree_add_item(tree, proto_mih, tvb, 0, -1, ENC_NA);
        mih_tree = proto_item_add_subtree(ti, ett_mih);
        if(mih_tree)
        {
                /* TODO: should have a different hf item for this version root */
                item = proto_tree_add_item(mih_tree, hf_mih_version, tvb, offset, 1, ENC_BIG_ENDIAN);

                ver_flags_tree = proto_item_add_subtree(item, ett_ver_flags);
                proto_tree_add_item(ver_flags_tree, hf_mih_version, tvb, offset, 1, ENC_BIG_ENDIAN);
                proto_tree_add_item(ver_flags_tree, hf_mih_ack_req, tvb, offset, 1, ENC_BIG_ENDIAN);
                proto_tree_add_item(ver_flags_tree, hf_mih_ack_resp, tvb, offset, 1, ENC_BIG_ENDIAN);
                proto_tree_add_item(ver_flags_tree, hf_mih_uir, tvb, offset, 1, ENC_BIG_ENDIAN);
                proto_tree_add_item(ver_flags_tree, hf_mih_more_frag, tvb, offset, 1, ENC_BIG_ENDIAN);
        }
        fragment = tvb_get_uint8(tvb, offset);
        fragment = fragment << 7;

        offset += 1;

        if(mih_tree)
        {
                /*flags and version tree is done.....*/
                proto_tree_add_item(mih_tree, hf_mih_frag_no, tvb, offset, 1, ENC_BIG_ENDIAN);

                /*for MIH message ID*/
                item = proto_tree_add_item(mih_tree, hf_mih_mid, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
        }
        fragment = fragment + (tvb_get_uint8(tvb, offset)>>1);
        offset += 1;
        mid_tree = proto_item_add_subtree(item, ett_mid);
        serviceid = tvb_get_uint8(tvb, offset);
        serviceid = serviceid & 0xF0;
        serviceid >>= 4;
        proto_tree_add_item(mid_tree, hf_mih_service_id, tvb, offset, 2, ENC_BIG_ENDIAN);

        /*filling the info column with the service type...*/
        col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(serviceid, servicevalues, "Unknown"));
        opcode = tvb_get_uint8(tvb, offset);
        opcode = opcode & 0x0C;
        opcode >>= 2;
        if(mid_tree)
                proto_tree_add_item(mid_tree, hf_mih_opcode, tvb, offset, 2, ENC_BIG_ENDIAN);

        /*filling the info column with the opcode type...*/
        col_append_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str_const(opcode, opcodevalues, "Unknown"));

        /*check for type of service..*/
        service = tvb_get_uint8(tvb, offset);
        service = service & 0xF0;
        service >>= 4;

        /*get the action id.*/
        action = tvb_get_ntohs(tvb, offset);
        action = action & 0x03FF;
        switch (service)
        {
        case 1 :/*for Service Management..*/
                proto_tree_add_item(mid_tree, hf_mih_serv_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
                col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str_const(action, serv_act_id_values, "Unknown"));
                break;
        case 2 :/*for event services..*/
                proto_tree_add_item(mid_tree, hf_mih_event_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
                col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str_const(action, event_act_id_values, "Unknown"));
                break;
        case 3 :/*for Command Services..*/
                proto_tree_add_item(mid_tree, hf_mih_command_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
                col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str_const(action, command_act_id_values, "Unknown"));
                break;
        case 4 :/*for Information Services..*/
                proto_tree_add_item(mid_tree, hf_mih_info_actionid, tvb, offset, 2, ENC_BIG_ENDIAN);
                col_append_fstr(pinfo->cinfo, COL_INFO, "\"%s\"", val_to_str_const(action, info_act_id_values, "Unknown"));
                break;
        }
        offset += 2;
        if(mih_tree)
        {

                /* displaying the transaction id*/
                proto_tree_add_item(mih_tree, hf_mih_tid, tvb, offset, 2, ENC_BIG_ENDIAN );

                /*displaying the payload length...*/
                proto_tree_add_item(mih_tree, hf_mih_pay_len, tvb, offset + 2, 2, ENC_BIG_ENDIAN );
        }
        offset += 2;
        payload_length = tvb_get_ntohs(tvb, offset);
        offset += 2;

        /*now the type length values list is present get them and decode it...
        loop for showing all the tlvs....*/
        while(payload_length > 0 && fragment==0)
        {
                /* Adding a third case here since the 802.21 standard defines 3 cases */
                /*extract length*/
                /*case 1: If the number of octets occupied by the Value field is LESS THAN 128, the size of the Length field is always
                        one octet and the MSB of the octet is set to the value 0. The values of the other seven bits of this octet
                        indicate the actual length of the Value field.
                */
                /*case 2: If the number of octets occupied by the Value field is EXACTLY 128, the size of the Length field is one octet.
                        The MSB of the Length octet is set to the value '1' and the other seven bits of this octet are all set to the value '0'.
                */
                /*case 3: If the number of octets occupied by the Value field is GREATER THAN 128, then the Length field is always greater
                        than one octet. The MSB of the first octet of the Length field is set to the value 1 and the remaining seven
                        bits of the first octet indicate the number of octets that are appended further. The number represented by the
                        second and subsequent octets of the Length field, when added to 128, indicates the total size of the Value field, in octets.
                */
                /*cases 2 and 3 can be logically programmed as the same condition since the whole octet is used to represent the len_of_len parameter. */

                /*code for testing if length is less than or equal to 128*/
                len = tvb_get_uint8(tvb, offset+1);
                if(len > 128)
                {
                        /*length is greater than 128 => len of len is greater than 1 byte*/
                        /*Expanding conditions where the length values can be from 1- 8 octets long*/
                        /*TODO: this assumes the maximum value length is 2^64. If larger data types are used, we have to implement our own tvb_get function*/
                        len_of_len = (uint8_t)len - 128;
                        switch (len_of_len) /*depending on the detected length , we read a different amount of bytes from the tvb buffer*/
                        {
                                case 1:
                                        len = tvb_get_uint8(tvb, offset+2);
                                        break;
                                case 2:
                                        len = tvb_get_ntohs(tvb, offset+2);
                                        break;
                                case 3:
                                        len = tvb_get_ntoh24(tvb, offset+2);
                                        break;
                                case 4:
                                        len = tvb_get_ntohl(tvb, offset+2);
                                        break;
                                case 5:
                                        len = tvb_get_ntoh40(tvb, offset+2);
                                        break;
                                case 6:
                                        len = tvb_get_ntoh48(tvb, offset+2);
                                        break;
                                case 7:
                                        len = tvb_get_ntoh56(tvb, offset+2);
                                        break;
                                case 8:
                                        len = tvb_get_ntoh64(tvb, offset+2);
                        }
                        len_of_len++;
                        len = 128 + len;
                }
                else
                        len_of_len = 1;


                /*TODO: TLVs greater than the payload_length are fragmented, and currently not parsed*/
                if(len <= (uint64_t)payload_length)
                {
                        /*for type...*/
                        tlv_tree = proto_tree_add_subtree_format(mih_tree, tvb, offset, 1 + len_of_len + (uint32_t)len, ett_tlv, NULL,
                                                "MIH TLV : %s", val_to_str_const(tvb_get_uint8(tvb, offset), typevaluenames, "UNKNOWN"));
                        if(tlv_tree)
                        {
                                proto_tree_add_item(tlv_tree, hf_mih_type, tvb, offset, 1, ENC_BIG_ENDIAN);
                                type = tvb_get_uint8(tvb, offset);

                                /*for length...*/
                                if(len_of_len == 1)
                                {
                                        proto_tree_add_item(tlv_tree, hf_mih_type_length, tvb, offset+1, len_of_len, ENC_BIG_ENDIAN);
                                }
                                else if(len_of_len>1 && len_of_len<=5)
                                {
                                        proto_tree_add_item(tlv_tree, hf_mih_type_length_ext, tvb, offset+2, len_of_len-1, ENC_BIG_ENDIAN);
                                }

                        }
                        offset += 1 + len_of_len;

                        /*For Value fields*/
                        /*TODO: this assumes the maximum value length is 2^32. Dissecting bigger data fields would require breaking the data into chunks*/
                        if(len < (UINT64_C(1) << 32)){  /* XXX: always true ? see above */
                                dissect_mih_tlv(tvb, offset, tlv_tree, type, (uint32_t)len);
                                offset += (uint32_t)len;
                                payload_length -= (1 + len_of_len + (uint32_t)len);
                        }else{
                            return offset;
                        }
                }
                else
                {
                        proto_tree_add_item(mih_tree, hf_fragmented_tlv, tvb, offset, -1, ENC_NA);
                        payload_length = 0;
                }
        }
        if(fragment!=0)
                proto_tree_add_item(mih_tree, hf_fragmented_tlv, tvb, offset, -1, ENC_NA);

        return tvb_captured_length(tvb);
}

/*dissector initialisation*/
void proto_register_mih(void)
{
        static hf_register_info hf[] =
        {
                {
                        &hf_mih_version,
                        {
                                "MIH Version",
                                "mih.version",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                VERSION_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_ack_req,
                        {
                                "MIH ACK-Req",
                                "mih.acq_req",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                ACKREQ_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_ack_resp,
                        {
                                "MIH ACK-Resp",
                                "mih.acq_resp",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                ACKRESP_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_uir,
                        {
                                "MIH Unauthenticated info request",
                                "mih.uir",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                UIR_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_more_frag,
                        {
                                "MIH more fragment",
                                "mih.more_frag",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                MORE_FRAG_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_frag_no,
                        {
                                "Fragment No",
                                "mih.frag_no",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                FRAG_NO_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_mid,
                        {
                                "MIH message ID",
                                "mih.mid",
                                FT_UINT16,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_service_id,
                        {
                                "Service ID",
                                "mih.service_id",
                                FT_UINT16,
                                BASE_HEX,
                                VALS(servicevalues),
                                SID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_opcode,
                        {
                                "Opcode",
                                "mih.opcode",
                                FT_UINT16,
                                BASE_HEX,
                                VALS(opcodevalues),
                                OPCODE_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_serv_actionid,
                        {
                                "Action ID",
                                "mih.action_id",
                                FT_UINT16,
                                BASE_HEX,
                                VALS(serv_act_id_values),
                                AID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_event_actionid,
                        {
                                "Action ID",
                                "mih.action_id",
                                FT_UINT16,
                                BASE_HEX,
                                VALS(event_act_id_values),
                                AID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_command_actionid,
                        {
                                "Action ID",
                                "mih.action_id",
                                FT_UINT16,
                                BASE_HEX,
                                VALS(command_act_id_values),
                                AID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_info_actionid,
                        {
                                "Action ID",
                                "mih.action_id",
                                FT_UINT16,
                                BASE_HEX,
                                VALS(info_act_id_values),
                                AID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_tid,
                        {
                                "TID",
                                "mih.tid",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                TRANS_ID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_pay_len,
                        {
                                "Payload length",
                                "mih.pay_len",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_type,
                        {
                                "MIH TLV type",
                                "mih.tlv_type",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(typevaluenames),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_type_length,
                        {
                                "MIH TLV length",
                                "mih.tlv_length",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mih_type_length_ext,
                        {
                                "MIH TLV length",
                                "mih.tlv_length_ext",
                                FT_UINT64,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mihf_id,
                        {
                                "MIHF_ID",
                                "mih.mihf_id",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mihf_id_mac,
                        {
                                "MIHF_ID",
                                "mih.mihf_id.mac",
                                FT_ETHER,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mihf_id_ipv4,
                        {
                                "MIHF_ID",
                                "mih.mihf_id.ipv4",
                                FT_IPv4,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mihf_id_ipv6,
                        {
                                "MIHF_ID",
                                "mih.mihf_id.ipv6",
                                FT_IPv6,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_status,
                        {
                                "STATUS",
                                "mih.status",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(status_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_ip_methods_supported,
                        {
                                "IP methods supported",
                                "mih.ip_methods_supported",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_ip_dhcp_services,
                        {
                                "IP DHCP services",
                                "mih.ip_dhcp_services",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_fn_agent,
                        {
                                "FN Agent",
                                "mih.fn_agent",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_access_router,
                        {
                                "Access Router",
                                "mih.access_router",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_type,
                        {
                                "Link Type",
                                "mih.link_type",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_type_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
{
                        &hf_link_subtype_eth,
                        {
                                "Ethernet - IEEE802.3 Subtype",
                                "mih.link_subtype_eth",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_eth_10m,
                        {
                                "Ethernet 10 Mb",
                                "mih.link_subtype_eth.10mb",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000001,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_eth_100m,
                        {
                                "Ethernet 100 Mb",
                                "mih.link_subtype_eth.100mb",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000002,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_eth_1000m,
                        {
                                "Ethernet 1000 Mb",
                                "mih.link_subtype_eth.1000mb",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000004,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_wireless_other,
                        {
                                "Wireless Other Subtype",
                                "mih.link_subtype_wireless_other",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_wireless_other_dvb,
                        {
                                "DVB",
                                "mih.link_subtype_wireless_other.dvb",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000001,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_wireless_other_tdmb,
                        {
                                "T-DVB",
                                "mih.link_subtype_wireless_other.tdmb",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000002,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_wireless_other_atsc,
                        {
                                "ATSC-M/H",
                               "mih.link_subtype_wireless_other.atsc",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000004,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80211,
                        {
                                "Wireless - IEEE 802.11 Subtype",
                                "mih.link_subtype_ieee80211",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80211_24,
                        {
                                "2.4 GHz",
                                "mih.link_subtype_ieee80211.2_4ghz",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000001,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80211_5,
                        {
                                "5 GHz",
                                "mih.link_subtype_ieee80211.5ghz",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000002,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80211_49,
                        {
                                "4.9 GHz",
                                "mih.link_subtype_ieee80211.4_9ghz",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000004,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80211_365,
                        {
                                "3.65 GHz",
                                "mih.link_subtype_ieee80211.3_65ghz",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000008,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80211_316,
                        {
                                "316 THz",
                               "mih.link_subtype_ieee80211.316thz",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000010,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_umts,
                        {
                                "Wireless - UMTS Subtype",
                                "mih.link_subtype_umts",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_umts_99,
                        {
                                "Rel-99",
                                "mih.link_subtype_umts.rel99",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000001,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_umts_4,
                        {
                                "Rel-4",
                                "mih.link_subtype_umts.rel4",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000002,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_umts_5,
                        {
                                "Rel-5 (w/HSDPA)",
                                "mih.link_subtype_umts.rel5",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000004,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_umts_6,
                        {
                                "Rel-6 (w/ HSUPA)",
                                "mih.link_subtype_umts.rel6",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000008,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_umts_7,
                        {
                                "Rel-7 (MIMO/OFDM)",
                                "mih.link_subtype_umts.rel7",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000010,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_umts_8,
                        {
                                "Rel-8",
                               "mih.link_subtype_umts.rel8",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000020,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_cdma2000,
                        {
                                "Wireless - cdma2000-HRPD",
                                "mih.link_subtype_cdma2000",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_cdma2000_0,
                        {
                                "Rev-0",
                                "mih.link_subtype_cdma2000.rev0",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000001,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_cdma2000_a,
                        {
                                "Rev-A",
                                "mih.link_subtype_cdma2000.reva",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000002,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_cdma2000_b,
                        {
                                "Rev-B",
                                "mih.link_subtype_cdma2000.revb",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000004,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_cdma2000_c,
                        {
                                "Rev-C",
                                "mih.link_subtype_cdma2000.revc",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000008,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80216,
                        {
                                "Wireless - IEEE 802.16",
                                "mih.link_subtype_ieee80216",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80216_25,
                        {
                                "2.5 GHz",
                                "mih.link_subtype_ieee80216.2_5ghz",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000001,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_subtype_ieee80216_35,
                        {
                                "3.5 GHz",
                                "mih.link_subtype_ieee80216.3_5ghz",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00000002,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_type_ext,
                        {
                                "LINK_TYPE_EXT",
                                "mih.link_type_ext",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_ipv4_addr,
                        {
                                "IP Address",
                                "mih.ipv4_addr",
                                FT_IPv4,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_ipv6_addr,
                        {
                                "IP Address",
                                "mih.ipv6_addr",
                                FT_IPv6,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_dn_reason,
                        {
                                "LINK Down Reason",
                                "mih.link_dn_reason",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_dn_reason_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_gdn_reason,
                        {
                                "LINK Going Down Reason",
                                "mih.link_gdn_reason",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_gdn_reason_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mac_addr,
                        {
                                "MAC ADDRESS",
                                "mih.mac_addr",
                                FT_ETHER,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_gen,
                        {
                                "LINK_PARAM",
                                "mih.link_param_gen",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_param_gen_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_qos,
                        {
                                "LINK_PARAM",
                                "mih.link_param_qos",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_param_qos_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_gg,
                        {
                                "LINK_PARAM",
                                "mih.link_param_gg",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_param_gg_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_edge,
                        {
                                "LINK_PARAM",
                                "mih.link_param_edge",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_eth,
                        {
                                "LINK_PARAM",
                                "mih.link_param_eth",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_802_11,
                        {
                                "LINK_PARAM",
                                "mih.link_param_802_11",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_param_802_11_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_c2k,
                        {
                                "LINK_PARAM",
                                "mih.link_param_c2k",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_param_c2k_hrpd_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_fdd,
                        {
                                "LINK_PARAM",
                                "mih.link_param_fdd",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_param_fdd_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_hrpd,
                        {
                                "LINK_PARAM",
                                "mih.link_param_hrpd",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_param_c2k_hrpd_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_802_16,
                        {
                                "LINK_PARAM",
                                "mih.link_param_802_16",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_802_20,
                        {
                                "LINK_PARAM",
                                "mih.link_param_802_20",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_802_22,
                        {
                                "LINK_PARAM",
                                "mih.link_param_802_22",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_param_value,
                        {
                                "LINK_VALUE",
                                "mih.link_param_value",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_op_mode,
                        {
                                "OP_MODE",
                                "mih.op_mode",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(op_mode_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_ac_type,
                        {
                                "LINK_AC_TYPE",
                                "mih.link_ac_type",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_ac_type_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_ac_ext_time,
                        {
                                "LINK_AC_ext_time",
                                "mih.link_ac_ext_time",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_ac_result,
                        {
                                "LINK_AC_RESULT",
                                "mih.link_ac_result",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_ac_result_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_ho_reason,
                        {
                                "HO CAUSE",
                                "mih.ho_reason",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_dn_reason_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_ho_status,
                        {
                                "HO STATUS",
                                "mih.ho_status",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(ho_status_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mbb_ho_supp,
                        {
                                "MBB HO SUPP",
                                "mih.mbb_ho_supp",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(mbb_ho_supp_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_reg_request_code,
                        {
                                "REGISTER REQUEST CODE",
                                "mih.reg_request_code",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(reg_request_code_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_ip_renewal,
                        {
                                "IP RENEWAL FLAG",
                                "mih.ip_renewal",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(ip_renewal_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_dev_states_resp,
                        {
                                "SUPPORTED TRANSPORTS",
                                "mih.dev_states_resp",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(dev_states_req_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_dev_batt_level,
                        {
                                "Battery Level",
                                "mih.dev_states_resp.batt_level",
                                FT_INT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_dev_info,
                        {
                                "Device Info",
                                "mih.dev_states_resp.dev_info",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_max_resp_size,
                        {
                                "Maximum Response Size",
                                "mih.max_resp_size",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_time_interval,
                        {
                                "Time Interval",
                                "mih.time_interval",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_valid_time_interval,
                        {
                                "Valid Time Interval",
                                "mih.valid_time_interval",
                                FT_UINT32,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_tsp_carrier,
                        {
                                "TSP Carrier",
                                "mih.tsp_carrier",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_addr_type,
                        {
                                "Link Address Type",
                                "mih.link_addr_type",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(link_addr_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_transport_addr_type,
                        {
                                "Link Transport Address Type",
                                "mih.link_transport_addr_type",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_addr_string,
                        {
                                "Link Address String",
                                "mih.link_addr_string",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cell_id,
                        {
                                "3G Cell ID",
                                "mih.cell_id",
                                FT_UINT32,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_ci,
                        {
                                "2G Cell ID",
                                "mih.ci",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_plmn_id,
                        {
                                "Public Land Mobile Network (PLMN) ID",
                                "mih.plmn_id",
                                FT_UINT24,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_location_area_id,
                        {
                                "Location Area Code (LAC)",
                                "mih.lac",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_threshold_val,
                        {
                                "Threshold Value",
                                "mih.threshold_val",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_threshold_x_dir,
                        {
                                "Threshold Direction",
                                "mih.threshold_x_dir",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(threshold_x_dir_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_threshold_action,
                        {
                                "Threshold Action",
                                "mih.threshold_action",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(threshold_action_vals),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_config_status,
                        {
                                "Config Status",
                                "mih.config_status",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_num_cos,
                        {
                                "Number of differentiable classes",
                                "mih.num_cos",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_num_queue,
                        {
                                "Number of transmit queues supported",
                                "mih.num_queue",
                                FT_UINT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_channel_id,
                        {
                                "Channel ID",
                                "mih.channel_id",
                                FT_UINT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_predef_cfg_id,
                        {
                                "Pre-defined Configuration Identifier",
                                "mih.predef_cfg_id",
                                FT_INT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_network_id,
                        {
                                "Network ID",
                                "mih.network_id",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_aux_id,
                        {
                                "Auxiliary Network ID",
                                "mih.net_aux_id",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_sig_strength_dbm,
                        {
                                "Signal Strength (dBm)",
                                "mih.sig_strength",
                                FT_INT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_sig_strength_per,
                        {
                                "Signal Strength (%)",
                                "mih.sig_strength",
                                FT_INT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cos_id,
                        {
                                "Class of Service ID",
                                "mih.cos_id",
                                FT_INT8,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cos_value,
                        {
                                "Class of Service Value",
                                "mih.cos_value",
                                FT_INT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_sinr,
                        {
                                "SINR",
                                "mih.sinr",
                                FT_INT16,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_data_rate,
                        {
                                "Link Data Rate (kb/s)",
                                "mih.link_data_rate",
                                FT_UINT32,
                                BASE_DEC,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_rdf_data,
                        {
                                "RDF data",
                                "mih.rdf_data",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_rdf_mime_type,
                        {
                                "RDF data",
                                "mih.rdf_mime_type",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_res_status,
                        {
                                "Resource Status",
                                "mih.res_status",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_res_retention_status,
                        {
                                "Info query RDF schema URL",
                                "mih.res_retention_status",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_res_rpt_flag,
                        {
                                "Query resource report flag",
                                "mih.res_rpt_flag",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_unauth_info_req,
                        {
                                "Unauthenticated information request",
                                "mih.unauth_info_req",
                                FT_UINT8,
                                BASE_DEC,
                                VALS(boolean_types),
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_rdf_sch,
                        {
                                "RDF Schema",
                                "mih.rdf_sch",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_rdf_sch_url,
                        {
                                "RDF Schema URL",
                                "mih.rdf_sch_url",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_ir_bin_data,
                        {
                                "IR Binary Data",
                                "mih.ir_bin_data",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_iq_bin_data_x,
                        {
                                "IQ Binary Data",
                                "mih.iq_bin_data",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_vendor_specific_tlv,
                        {
                                "Vendor Specific TLV",
                                "mih.vendor_specific_tlv",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_reserved_tlv,
                        {
                                "Reserved TLV",
                                "mih.reserved_tlv",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_experimental_tlv,
                        {
                                "Experimental TLV",
                                "mih.experimental_tlv",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_unknown_tlv,
                        {
                                "UNKNOWN TLV",
                                "mih.unknown_tlv",
                                FT_STRING,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                       &hf_fragmented_tlv,
                        {
                                "FRAGMENTED TLV",
                                "mih.fragmented_tlv",
                                FT_BYTES,
                                BASE_NONE,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },

                /*event related hf fields*/
                {
                        &hf_event_list,
                        {
                                "List of Events",
                                "mih.event_list",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_event_link_detect,
                        {
                                "MIH LINK Detected",
                                "mih.event_list.link_detect",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                LINK_DETECT_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_event_link_up,
                        {
                                "MIH LINK UP",
                                "mih.event_list.link_up",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                LINK_UP_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_event_link_dn,
                        {
                                "MIH LINK DOWN",
                                "mih.event_list.link_down",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                LINK_DOWN_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_event_link_param,
                        {
                                "MIH LINK Parameters Report",
                                "mih.event_list.link_param_rpt",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                LINK_PARAM_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_event_link_gd,
                        {
                                "MIH LINK Going Down",
                                "mih.event_list.link_gd",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                LINK_GD_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_event_ho_imm,
                        {
                                "Link Handover Imminent",
                                "mih.event_list.link_ho_imm",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                LINK_HO_IMM_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_event_ho_comp,
                        {
                                "MIH LINK Handover Complete",
                                "mih.event_list.link_ho_comp",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                LINK_HO_COMP_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_event_pdu_tx_stat,
                        {
                                "MIH LINK PDU Transmit Status",
                                "mih.event_list.link_pdu_tx_stat",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                LINK_PDU_MASK,
                                NULL, HFILL
                        }
                },

                /* cmd related hf fields */
                {
                        &hf_cmd_list,
                        {
                                "List of Commands",
                                "mih.command_list",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {

                        &hf_cmd_event_subs,
                        {
                                "MIH LINK Event Subscribe",
                                "mih.cmd_list.evt_subs",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                CMD_EVT_SUBS_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cmd_event_unsub,
                        {
                                "Link Event Unsubscribe",
                                "mih.cmd_list.evt_unsubs",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                CMD_EVT_UNSUBS_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cmd_get_param,
                        {
                                "MIH LINK Get Parameters",
                                "mih.cmd_list.evt_get_param",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                CMD_GET_PARA_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cmd_con_thres,
                        {
                                "Link Configure Thresholds",
                                "mih.cmd_list.evt_conf_th",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                CMD_CONF_TH_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cmd_link_action,
                        {
                                "MIH LINK Action",
                                "mih.cmd_list.evt_link_action",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                CMD_LINK_AC_MASK,
                                NULL, HFILL
                        }
                },

                /*header fields for iq type list*/
                {
                        &hf_iq_list,
                        {
                                "List of of IS query types",
                                "mih.iq_type_list",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_bin_data,
                        {
                                "Binary data",
                                "mih.iq_type_list.bin_data",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_BIN_DATA_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_rdf_data,
                        {
                                "RDF data",
                                "mih.iq_type_list.rdf_data",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_RDF_DATA_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_rdf_sch_url,
                        {
                                "RDF schema URL",
                                "mih.iq_type_list.rdf_sch_u",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_RDF_SCH_U_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_rdf_sch,
                        {
                                "RDF schema",
                                "mih.iq_type_list.rdf_sch",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_RDF_SCH_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_type,
                        {
                                "IE_NETWORK_TYPE",
                                "mih.iq_type_list.ie_net_type",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_NET_TYPE_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_op_id,
                        {
                                "IE_OPERATOR_ID",
                                "mih.iq_type_list.ie_op_id",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_OP_ID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_serv_pro_id,
                        {
                                "IE_SERVICE_PROVIDER_ID",
                                "mih.iq_type_list.ie_serv_id",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_SERV_ID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_country_code,
                        {
                                "IE_COUNTRY_CODE",
                                "mih.iq_type_list.ie_country_code",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_COUN_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_id,
                        {
                                "IE_NETWORK_ID",
                                "mih.iq_type_list.ie_net_id",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_NET_ID_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_aux_id,
                        {
                                "IE_NETWORK_AUX_ID",
                                "mih.iq_type_list.net_aux_id",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_NET_AUX_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_roam_part,
                        {
                                "IE_ROAMING_PARTNERS",
                                "mih.iq_type_list.ie_roam_part",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_ROAM_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_cost,
                        {
                                "IE_COST",
                                "mih.iq_type_list.ie_cost",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_COST_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_qos,
                        {
                                "IE_NETWORK_QOS",
                                "mih.iq_type_list.ie_net_qos",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_QOS_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_dat_rt,
                        {
                                "IE_NETWORK_DATA_RATE",
                                "mih.iq_type_list.ie_net_dat_rt",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_DATA_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_reg_dom,
                        {
                                "IE_NET_REGULT_DOMAIN",
                                "mih.iq_type_list.ie_net_reg_dom",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_REGDOM_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_freq_bands,
                        {
                                "IE_NET_FREQUENCY_BANDS",
                                "mih.iq_type_list.ie_net_freq",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_FREQ_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_ip_cfg_mthds,
                        {
                                "IE_NET_IP_CFG_METHODS",
                                "mih.iq_type_list.ie_net_ip_cfg",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_IP_CFG_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_cap,
                        {
                                "IE_NET_CAPABILITIES",
                                "mih.iq_type_list.ie_net_cap",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_CAP_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_supp_lcp,
                        {
                                "IE_NET_SUPPORTED_LCP",
                                "mih.iq_type_list.ie_net_sup_lcp",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_SUP_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_mob_mg,
                        {
                                "IE_NET_MOB_MGMT_PROT",
                                "mih.iq_type_list.ie_net_mob_mg",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_MOB_MG_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_emserv,
                        {
                                "IE_NET_EMSERV_PROXY",
                                "mih.iq_type_list.ie_net_emer_serv",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_EM_SERV_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_ims_pcscf,
                        {
                                "IE_NET_IMS_PROXY_CSCF",
                                "mih.iq_type_list.ie_net_ims_pcscf",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_IMS_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_net_mob_net,
                        {
                                "IE_NET_MOBILE_NETWORK",
                                "mih.iq_type_list.ie_net_mob_net",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_MOB_NET_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_link_addr,
                        {
                                "IE_POA_LINK_ADDR",
                                "mih.iq_type_list.ie_poa_link",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_POA_ADDR_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_poa_loc,
                        {
                                "IE_POA_LOCATION",
                                "mih.iq_type_list.ie_poa_loc",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_POA_LOC_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_poa_chan_range,
                        {
                                "IE_POA_CHANNEL_RANGE",
                                "mih.iq_type_list.ie_poa_chan_rg",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_POA_CHAN_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_poa_sys_info,
                        {
                                "IE_POA_SYSTEM_INFO",
                                "mih.iq_type_list.ie_poa_syst_info",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_POA_SYS_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_poa_sub_info,
                        {
                                "IE_POA_SUBNET_INFO",
                                "mih.iq_type_list.ie_poa_sub_info",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_POA_SUB_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_iq_poa_ip,
                        {
                                "IE_POA_IP_ADDR",
                                "mih.iq_type_list.ie_poa_ip",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IQ_IE_POA_IP_MASK,
                                NULL, HFILL
                        }
                },

                /*header fields for mob mgmt*/
                {
                        &hf_mob_list,
                        {
                                "List of supported mobility management protocols",
                                "mih.mob_list",
                                FT_UINT16,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mob_mip4,
                        {
                                "Mobile IPv4",
                                "mih.mob_list.mip4",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                MOB_MIP4_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mob_mip4_reg,
                        {
                                "Mobile IPv4 Regional Registration",
                                "mih.mob_list.mip4_reg",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                MOB_MIP4_REG_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mob_mip6,
                        {
                                "Mobile IPv6",
                                "mih.mob_list.mip6",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                MOB_MIP6_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mob_hmip6,
                        {
                                "Hierarchical Mobile IPv6",
                                "mih.mob_list.hmip6",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                MOB_HMIP6_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mob_low_lat,
                        {
                                "Low Latency Handoffs",
                                "mih.mob_list.low_lat",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                MOB_LOW_LAT_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mob_fmip6,
                        {
                                "Mobile IPv6 Fast Handovers",
                                "mih.mob_list.fmip6",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                MOB_FMIP6_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mob_ike_multi,
                        {
                                "IKEv2 Mobility and Multihoming Protocol",
                                "mih.mob_list.ike_multi",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                MOB_IKE_MULTI_MASK,
                                NULL, HFILL
                        }
                },

                /*header fields for configure methods*/
                {
                        &hf_cfg_mthds,
                        {
                                "A set of IP configuration methods",
                                "mih.cfg_mthds",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cfg_ip4_stat,
                        {
                                "IPv4 static configuration",
                                "mih.ip_cfg_mthds.static",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IP_CFG_STAT_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cfg_dhcp4,
                        {
                                "DHCPv4",
                                "mih.ip_cfg_mthds.dhcp4",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IP_CFG_DHCP4_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cfg_mip_fa,
                        {
                                "Mobile IPv4 with foreign agent",
                                "mih.ip_cfg_mthds.mip4_fa",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IP_CFG_MIP4_FA_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cfg_mip_wo_fa,
                        {
                                "Mobile IPv4 without FA",
                                "mih.ip_cfg_mthds.mip4_wo_fa",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IP_CFG_MIP4_NFA_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cfg_ip6_sac,
                        {
                                "IPv6 stateless address configuration",
                                "mih.ip_cfg_mthds.ip6_state_less",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IP_CFG_IP6_SL_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cfg_dhcp6,
                        {
                                "DHCPv6",
                                "mih.ip_cfg_mthds.dhcp6",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IP_CFG_DHCP6_MASK,
                                NULL, HFILL
                        }
                },
                {
                        &hf_cfg_ip6_manual,
                        {
                                "IPv6 manual configuration",
                                "mih.ip_cfg_mthds.ip6_manual",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                IP_CFG_IP6_MAN_MASK,
                                NULL, HFILL
                        }
                },

                /*header fields for transport lists*/
                {
                        &hf_trans_list,
                        {
                                "Supported Transports",
                                "mih.trans_list",
                                FT_UINT16,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_trans_udp,
                        {
                                "UDP",
                                "mih.trans_list.udp",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                0x8000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_trans_tcp,
                        {
                                "TCP",
                                "mih.trans_list.tcp",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                0x4000,
                                NULL, HFILL
                        }
                },

                /*header fields for device state request*/
                {
                        &hf_dev_states_req,
                        {
                                "Device Status Request",
                                "mih.dev_states_req",
                                FT_UINT16,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_dev_states_req_dev_info,
                        {
                                "Device Info",
                                "mih.dev_states_req.dev_info",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                0x8000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_dev_states_req_batt_lvl,
                        {
                                "Battery Level",
                                "mih.dev_states_req.batt_level",
                                FT_BOOLEAN,
                                16,
                                NULL,
                                0x4000,
                                NULL, HFILL
                        }
                },

                /*header fields for MIH Capabilities*/
                {
                        &hf_mihcap,
                        {
                                "Supported MIH Capability",
                                "mih.mihcap",
                                FT_UINT8,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mihcap_es,
                        {
                                "Event Service (ES)",
                                "mih.mihcap.event_service",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                0x80,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mihcap_cs,
                        {
                                "Command Service (CS)",
                                "mih.mihcap.command_service",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                0x40,
                                NULL, HFILL
                        }
                },
                {
                        &hf_mihcap_is,
                        {
                                "Information Service (IS)",
                                "mih.mihcap.information_service",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                0x20,
                                NULL, HFILL
                        }
                },

                /*header fields for High Level Network Capabilities*/
                {
                        &hf_net_caps,
                        {
                                "High Level Network Capability",
                                "mih.net_caps",
                                FT_UINT32,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_sec,
                        {
                                "Security",
                                "mih.net_caps.sec",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x80000000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_qos0,
                        {
                                "QoS Class 0",
                                "mih.net_caps.qos0",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x40000000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_qos1,
                        {
                                "QoS Class 1",
                                "mih.net_caps.qos1",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x20000000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_qos2,
                        {
                                "QoS Class 2",
                                "mih.net_caps.qos2",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x10000000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_qos3,
                        {
                                "QoS Class 3",
                                "mih.net_caps.qos3",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x08000000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_qos4,
                        {
                                "QoS Class 4",
                                "mih.net_caps.qos4",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x04000000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_qos5,
                        {
                                "QoS Class 5",
                                "mih.net_caps.qos5",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x02000000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_ia,
                        {
                                "Internet Access",
                                "mih.net_caps.internet_access",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x01000000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_es,
                        {
                                "Emergency Services",
                                "mih.net_caps.emergency_services",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00800000,
                                NULL, HFILL
                        }
                },
                {
                        &hf_net_caps_mihcap,
                        {
                                "MIH Capability",
                                "mih.net_caps.mihcap",
                                FT_BOOLEAN,
                                32,
                                NULL,
                                0x00400000,
                                NULL, HFILL
                        }
                },

                /*header fields for Link Action attributes*/
                {
                        &hf_link_ac_attr,
                        {
                                "Link Action Attribute",
                                "mih.link_ac_attr",
                                FT_UINT8,
                                BASE_HEX,
                                NULL,
                                0x0,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_ac_attr_link_scan,
                        {
                                "Link_Scan",
                                "mih.link_ac_attr.link_scan",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                0x80,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_ac_attr_link_res_retain,
                        {
                                "Link Resource Retain",
                                "mih.link_ac_attr.link_res_retain",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                0x40,
                                NULL, HFILL
                        }
                },
                {
                        &hf_link_ac_attr_data_fwd_req,
                        {
                                "Forward Data Request",
                                "mih.link_ac_attr.data_fwd_req",
                                FT_BOOLEAN,
                                8,
                                NULL,
                                0x20,
                                NULL, HFILL
                        }
                }
        };

        /* Setup protocol subtree array */
        static int *ett[] =
        {
                &ett_mih,
                &ett_ver_flags,
                &ett_mid,
                &ett_tlv,
                &ett_cmd_bitmap,
                &ett_event_bitmap,
                &ett_mob_mgt_bitmap,
                &ett_cfg_mtd_bitmap,
                &ett_iq_type_bitmap,
                &ett_trans_list_bitmap,
                &ett_dev_states_bitmap,
                &ett_mihcap_bitmap,
                &ett_net_caps_bitmap,
                &ett_ac_attr_bitmap,
                &ett_subtype_eth_bitmap,
                &ett_subtype_wireless_other_bitmap,
                &ett_subtype_ieee80211_bitmap,
                &ett_subtype_umts_bitmap,
                &ett_subtype_cdma2000_bitmap,
                &ett_subtype_ieee80216_bitmap,
                &ett_min_pk_tx_delay,
                &ett_avg_pk_tx_delay,
                &ett_max_pk_tx_delay,
                &ett_pk_delay_jitter,
                &ett_pk_loss_rate,
                &ett_list_prefer_link,
                &ett_ip_dhcp_server,
                &ett_fn_agent,
                &ett_access_router,
                &ett_link_states_req,
                &ett_link_desc_req,
                &ett_dev_states_resp
        };

        proto_mih = proto_register_protocol("Media-Independent Handover", "MIH", "mih");
        proto_register_field_array(proto_mih, hf, array_length(hf));
        proto_register_subtree_array(ett, array_length(ett));

        mih_handle = register_dissector("mih", dissect_mih, proto_mih);
}


/*dissector handoff*/
void proto_reg_handoff_mih(void)
{
        /*Layer 3 handle*/
        dissector_add_uint_with_preference("udp.port", MIH_PORT, mih_handle);
        dissector_add_uint_with_preference("tcp.port", MIH_PORT, mih_handle);

        /*Layer 2 handle*/
        dissector_add_uint("ethertype", ETHERTYPE_MIH, mih_handle);
}


/*
 * Editor modelines  -  https://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 8
 * tab-width: 8
 * indent-tabs-mode: nil
 * End:
 *
 * vi: set shiftwidth=8 tabstop=8 expandtab:
 * :indentSize=8:tabSize=8:noTabs=true:
 */