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

#include "packet-ieee802154.h"
#include "packet-zbncp.h"

void proto_reg_handoff_zbncp(void);
void proto_register_zbncp(void);
extern void dissect_zbee_nwk_status_code(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);
extern void dissect_zbee_aps_status_code(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset);

#define ZBNCP_PROTOABBREV "zbncp"

#define ZBNCP_SIGN_FST_BYTE                                                                0xDEU
#define ZBNCP_SIGN_SEC_BYTE                                                                0xADU
#define ZBNCP_HDR_SIZE                                                                     7

#define ZBNCP_HDR_FLAGS_ISACK_MASK                                                         0x01
#define ZBNCP_HDR_FLAGS_RETRANS_MASK                                                       0x02
#define ZBNCP_HDR_FLAGS_PKT_SEQ_MASK                                                       0x0C
#define ZBNCP_HDR_FLAGS_ACK_SEQ_MASK                                                       0x30
#define ZBNCP_HDR_FLAGS_ISFIRST_MASK                                                       0x40
#define ZBNCP_HDR_FLAGS_ISLAST_MASK                                                        0x80

#define ZBNCP_DUMP_INFO_SIGN                                                               "ZBNCP"
#define ZBNCP_DUMP_INFO_SIGN_SIZE                                                          (sizeof(ZBNCP_DUMP_INFO_SIGN) - 1)
#define ZBNCP_DUMP_INFO_PAYLOAD_SIZE                                                       3
#define ZBNCP_DUMP_INFO_NCP_TYPE                                                           0x06U
#define ZBNCP_DUMP_INFO_SIZE                                                               (ZBNCP_DUMP_INFO_SIGN_SIZE + ZBNCP_DUMP_INFO_PAYLOAD_SIZE)
#define ZBNCP_DUMP_DIR_MASK                                                                0x01U
#define ZBNCP_DUMP_HOST_INT_DUMP_MASK                                                      0x02U
#define ZBNCP_DUMP_POTENTIAL_TX_RX_ERROR_MASK                                              0x04U

/*  Bit Masks for Configuration Parameters Field   */
#define CONF_PARAMS_RESERVED                                                            0x07
#define CONF_PARAMS_DIS_PANID_CHANGE                                                    0x08
#define CONF_PARAMS_DIS_CHAN_CHANGE                                                     0x10
#define CONF_PARAMS_LEAVE_REQ_ALLOW                                                     0x20
#define CONF_PARAMS_REQ_TCLK                                                            0x40
#define CONF_PARAMS_RESTRICT_MODE_EN                                                    0x80


/* decryption helpers */
static unsigned dissect_zbncp_ll_hdr(tvbuff_t *, packet_info *, proto_tree *, unsigned, uint8_t *);
static void dissect_zbncp_body(tvbuff_t *, packet_info *, proto_tree *, unsigned, uint16_t *);
static void dissect_zbncp_high_level(tvbuff_t *, packet_info *, proto_tree *, unsigned, uint16_t *);
static unsigned dissect_zbncp_high_level_hdr(tvbuff_t *, packet_info *, proto_tree *, unsigned, uint8_t *, uint16_t *);
static void dissect_zbncp_high_level_body(tvbuff_t *, packet_info *, proto_tree *, unsigned, uint8_t, uint16_t);
static void dissect_zbncp_fragmentation_body(tvbuff_t *, packet_info *, proto_tree *, unsigned);
static unsigned dissect_zbncp_packet(tvbuff_t *, packet_info *, proto_tree *, unsigned);
static unsigned dissect_zbncp_status(tvbuff_t *, packet_info *, proto_tree *, unsigned);

static tvbuff_t *dissect_zbncp_dump_info(tvbuff_t *, packet_info *, proto_tree *);

/*-------------------------------------
 * Dissector Function Prototypes
 *-------------------------------------
 */
/* Dissection Routines. */

/* Initialize Protocol and Registered fields */

/* ZBNCP hdr */
static int zbncp_frame = -1;
static int proto_zbncp;

static int hf_zbncp_hdr_sign;
static int hf_zbncp_packet_len;
static int hf_zbncp_hdr_type;
static int hf_zbncp_hdr_flags;
static int hf_zbncp_hdr_flags_isack;
static int hf_zbncp_hdr_flags_retrans;
static int hf_zbncp_hdr_flags_packetseq;
static int hf_zbncp_hdr_flags_ackseq;
static int hf_zbncp_hdr_flags_first_frag;
static int hf_zbncp_hdr_flags_last_frag;
static int hf_zbncp_hdr_crc8;

static int hf_zbncp_body_data_crc16;
static int hf_zbncp_data_hl_version;
static int hf_zbncp_data_hl_packet_type;
static int hf_zbncp_data_hl_call_id;
static int hf_zbncp_data_hl_tsn;
static int hf_zbncp_data_hl_status_cat;
static int hf_zbncp_data_hl_status;
static int hf_zbncp_data_hl_status_generic;
static int hf_zbncp_data_hl_status_mac;
static int hf_zbncp_data_hl_status_nwk;
static int hf_zbncp_data_hl_status_cbke;
static int hf_zbncp_data_fw_vers;
static int hf_zbncp_data_stack_vers;
static int hf_zbncp_data_proto_vers;
static int hf_zbncp_data_reset_opt;
static int hf_zbncp_data_zb_role;
static int hf_zbncp_data_ch_list_len;
static int hf_zbncp_data_page;
static int hf_zbncp_data_ch_mask;
static int hf_zbncp_data_channel;
static int hf_zbncp_data_channel4;
static int hf_zbncp_data_pan_id;
static int hf_zbncp_data_mac_int_num;
static int hf_zbncp_data_index;
static int hf_zbncp_data_enable;
static int hf_zbncp_data_bind_type;
static int hf_zbncp_data_ieee_addr;
static int hf_zbncp_data_ext_pan_id;
static int hf_zbncp_data_coordinator_version;
static int hf_zbncp_data_trust_center_addres;
static int hf_zbncp_data_remote_ieee_addr;
static int hf_zbncp_data_src_ieee_addr;
static int hf_zbncp_data_dst_ieee_addr;
static int hf_zbncp_data_partner_ieee_addr;
static int hf_zbncp_data_trace_mask;
static int hf_zbncp_data_trace_wireless_traf;
static int hf_zbncp_data_trace_reserved;
static int hf_zbncp_data_trace_ncp_ll_proto;
static int hf_zbncp_data_trace_host_int_line;
static int hf_zbncp_data_trace_sleep_awake;
static int hf_zbncp_data_trace_input_output;
static int hf_zbncp_data_trace_timestamp;
static int hf_zbncp_data_trace;
static int hf_zbncp_data_key_neg_method;
static int hf_zbncp_data_psk_secrets;
static int hf_zbncp_data_r22_join_usage;
static int hf_zbncp_data_nwk_conf_preset;
static int hf_zbncp_data_short_address;
static int hf_zbncp_data_raw_data;
static int hf_zbncp_data_conf_params;
static int hf_zbncp_data_channel_page_count;
static int hf_zbncp_data_config_mask;
static int hf_zbncp_data_dest_short_address;
static int hf_zbncp_data_current_parents_short_address;
static int hf_zbncp_data_current_parents_lqi;
static int hf_zbncp_data_potential_parent_count;
static int hf_zbncp_data_classification_mask;
static int hf_zbncp_data_total_beacons_surveyed;
static int hf_zbncp_data_current_pan_id_beacons;
static int hf_zbncp_data_current_nwk_potential_parents;
static int hf_zbncp_data_other_zigbee_beacons;
static int hf_zbncp_data_pan_id_conflict_tlv;
static int hf_zbncp_data_eui64_count;
static int hf_zbncp_data_eui64;
static int hf_zbncp_data_target_ieee_addr;
static int hf_zbncp_data_initial_join_auth;
static int hf_zbncp_data_key_update_method;
static int hf_zbncp_data_next_pan_id_change;
static int hf_zbncp_data_next_channel_change;
static int hf_zbncp_data_error_count;
static int hf_zbncp_data_keepalive;
static int hf_zbncp_data_rx_on_idle;
static int hf_zbncp_data_res_tx_power;
static int hf_zbncp_data_req_tx_power;
static int hf_zbncp_data_joined;
static int hf_zbncp_data_joined_bit;
static int hf_zbncp_data_parent_bit;
static int hf_zbncp_data_authenticated;
static int hf_zbncp_data_timeout;
static int hf_zbncp_data_keepalive_mode;
static int hf_zbncp_force_route_record_sending;
static int hf_zbncp_data_nwk_addr;
static int hf_zbncp_data_nwk_parent_addr;
static int hf_zbncp_data_src_nwk_addr;
static int hf_zbncp_data_dst_nwk_addr;
static int hf_zbncp_data_remote_nwk_addr;
static int hf_zbncp_data_group_nwk_addr;
static int hf_zbncp_data_src_mac_addr;
static int hf_zbncp_data_dst_mac_addr;
static int hf_zbncp_data_nwk_key;
static int hf_zbncp_data_key_num;
static int hf_zbncp_data_serial_num;
static int hf_zbncp_data_size;
static int hf_zbncp_data_vendor_data;
static int hf_zbncp_data_dump_type;
static int hf_zbncp_data_dump_text;
static int hf_zbncp_data_dump_bin;
static int hf_zbncp_data_parameter_id;
static int hf_zbncp_data_value8_dec;
static int hf_zbncp_data_value16_dec;
static int hf_zbncp_data_aps_ack_to_non_sleepy;
static int hf_zbncp_data_aps_ack_to_sleepy;
static int hf_zbncp_data_min16;
static int hf_zbncp_data_max16;
static int hf_zbncp_data_default8_sign;
static int hf_zbncp_data_current8_sign;
static int hf_zbncp_data_is_concentrator;
static int hf_zbncp_data_concentrator_radius;
static int hf_zbncp_data_time16;
static int hf_zbncp_data_lock_status;
static int hf_zbncp_data_reset_source;
static int hf_zbncp_nwk_leave_allowed;
static int hf_zbncp_data_nvram_dataset_quantity;
static int hf_zbncp_data_nvram_dataset_type;
static int hf_zbncp_data_nvram_version;
static int hf_zbncp_data_dataset_version;
static int hf_zbncp_data_dataset_length;
static int hf_zbncp_data_nvram_dataset_data;
static int hf_zbncp_data_tc_policy_type;
static int hf_zbncp_data_tc_policy_value;
static int hf_zbncp_ed_capacity;
static int hf_zbncp_max_joins;
static int hf_zbncp_zdo_leave_allowed;
static int hf_zbncp_zdo_leave_wo_rejoin_allowed;
static int hf_zbncp_data_aps_key;
static int hf_zbncp_data_endpoint;
static int hf_zbncp_data_aps_group_num;
static int hf_zbncp_data_aps_group;
static int hf_zbncp_data_src_endpoint;
static int hf_zbncp_data_dst_endpoint;
static int hf_zbncp_data_poll_pkt_cnt;
static int hf_zbncp_data_poll_timeout;
static int hf_zbncp_data_poll_permit_flag;
static int hf_zbncp_data_profile_id;
static int hf_zbncp_data_device_id;
static int hf_zbncp_data_dev_version;
static int hf_zbncp_data_in_cl_cnt;
static int hf_zbncp_data_out_cl_cnt;
static int hf_zbncp_data_cluster_id;
static int hf_zbncp_data_mac_cap;
static int hf_zbncp_data_manuf_id;
static int hf_zbncp_data_cur_pwr_mode;
static int hf_zbncp_data_cur_pwr_lvl;
static int hf_zbncp_data_susp_period;
static int hf_zbncp_data_av_pwr_src;
static int hf_zbncp_data_cur_pwr_src;
static int hf_zbncp_data_pwr_src_const;
static int hf_zbncp_data_pwr_src_recharge;
static int hf_zbncp_data_pwr_src_disposable;
static int hf_zbncp_data_req_type;
static int hf_zbncp_data_start_idx;
static int hf_zbncp_data_start_idx_16b;
static int hf_zbncp_data_upd_idx;
static int hf_zbncp_data_entry_idx;
static int hf_zbncp_data_num_asoc_dec;
static int hf_zbncp_data_pwr_desc;
static int hf_zbncp_data_pwr_desc_cur_power_mode;
static int hf_zbncp_data_pwr_desc_av_pwr_src;
static int hf_zbncp_data_pwr_desc_cur_pwr_src;
static int hf_zbncp_data_pwr_desc_cur_pwr_lvl;
static int hf_zbncp_data_max_buf_size;
static int hf_zbncp_data_max_inc_trans_size;
static int hf_zbncp_data_max_out_trans_size;
static int hf_zbncp_data_desc_cap;
static int hf_zbncp_data_desc_cap_ext_act_ep_list_av;
static int hf_zbncp_data_desc_cap_ext_simple_desc_list_av;
static int hf_zbncp_data_flags8;
static int hf_zbncp_data_flags_permit_join;
static int hf_zbncp_data_flags_router_cap;
static int hf_zbncp_data_flags_ed_cap;
static int hf_zbncp_data_flags_stack_profile;
static int hf_zbncp_data_flags16;
static int hf_zbncp_data_flags_zb_role;
static int hf_zbncp_data_flags_comp_desc_av;
static int hf_zbncp_data_flags_user_desc_av;
static int hf_zbncp_data_flags_freq_868;
static int hf_zbncp_data_flags_freq_902;
static int hf_zbncp_data_flags_freq_2400;
static int hf_zbncp_data_flags_freq_eu_sub_ghz;
static int hf_zbncp_data_srv_msk;
static int hf_zbncp_data_srv_msk_prim_tc;
static int hf_zbncp_data_srv_msk_backup_tc;
static int hf_zbncp_data_srv_msk_prim_bind_tbl_cache;
static int hf_zbncp_data_srv_msk_backup_bind_tbl_cache;
static int hf_zbncp_data_remote_bind_offset;
static int hf_zbncp_data_srv_msk_prim_disc_cache;
static int hf_zbncp_data_srv_msk_backup_disc_cache;
static int hf_zbncp_data_srv_msk_nwk_manager;
static int hf_zbncp_data_srv_msk_stack_compl_rev;
static int hf_zbncp_data_ep_cnt;
static int hf_zbncp_data_dst_addr_mode;
static int hf_zbncp_data_leave_flags;
static int hf_zbncp_data_leave_flags_remove_chil;
static int hf_zbncp_data_leave_flags_rejoin;
static int hf_zbncp_data_permit_dur;
static int hf_zbncp_data_tc_sign;
static int hf_zbncp_data_secur_rejoin;
static int hf_zbncp_data_zdo_rejoin_flags;
static int hf_zbncp_data_zdo_rejoin_flags_tcsw_happened;
static int hf_zbncp_data_dlen8;
static int hf_zbncp_data_dlen16;
static int hf_zbncp_data_param_len;
static int hf_zbncp_data_radius;
static int hf_zbncp_data_time_between_disc;
static int hf_zbncp_data_enable_flag;
static int hf_zbncp_data_array;
static int hf_zbncp_data_use_alias;
static int hf_zbncp_data_alias_src;
static int hf_zbncp_data_alias_seq;
static int hf_zbncp_data_tx_opt;
static int hf_zbncp_data_tx_opt_secur;
static int hf_zbncp_data_tx_opt_obsolete;
static int hf_zbncp_data_tx_opt_ack;
static int hf_zbncp_data_tx_opt_frag;
static int hf_zbncp_data_tx_opt_inc_ext_nonce;
static int hf_zbncp_data_tx_opt_force_mesh_route;
static int hf_zbncp_data_tx_opt_send_route_record;
static int hf_zbncp_data_lqi;
static int hf_zbncp_data_rssi;
static int hf_zbncp_data_do_cleanup;
static int hf_zbncp_data_max_rx_bcast;
static int hf_zbncp_data_mac_tx_bcast;
static int hf_zbncp_data_mac_rx_ucast;
static int hf_zbncp_data_mac_tx_ucast_total_zcl;
static int hf_zbncp_data_mac_tx_ucast_failures_zcl;
static int hf_zbncp_data_mac_tx_ucast_retries_zcl;
static int hf_zbncp_data_mac_tx_ucast_total;
static int hf_zbncp_data_mac_tx_ucast_failures;
static int hf_zbncp_data_mac_tx_ucast_retries;
static int hf_zbncp_data_mac_validate_drop_cnt;
static int hf_zbncp_data_mac_phy_cca_fail_count;
static int hf_zbncp_data_phy_to_mac_que_lim_reached;
static int hf_zbncp_data_period_of_time;
static int hf_zbncp_data_last_msg_lqi;
static int hf_zbncp_data_last_msg_rssi;
static int hf_zbncp_data_number_of_resets;
static int hf_zbncp_data_aps_tx_bcast;
static int hf_zbncp_data_aps_tx_ucast_success;
static int hf_zbncp_data_aps_tx_ucast_retry;
static int hf_zbncp_data_aps_tx_ucast_fail;
static int hf_zbncp_data_route_disc_initiated;
static int hf_zbncp_data_nwk_neighbor_added;
static int hf_zbncp_data_nwk_neighbor_removed;
static int hf_zbncp_data_nwk_neighbor_stale;
static int hf_zbncp_upd_status_code;
static int hf_zbncp_data_join_indication;
static int hf_zbncp_data_childs_removed;
static int hf_zbncp_data_aps_decrypt_failure;
static int hf_zbncp_data_packet_buffer_allocate_failures;
static int hf_zbncp_data_aps_unauthorized_key;
static int hf_zbncp_data_nwk_decrypt_failure;
static int hf_zbncp_data_average_mac_retry_per_aps_message_sent;
static int hf_zbncp_data_nwk_fc_failure;
static int hf_zbncp_data_aps_fc_failure;
static int hf_zbncp_data_nwk_retry_overflow;
static int hf_zbncp_data_nwk_bcast_table_full;
static int hf_zbncp_data_status;
static int hf_zbncp_zdo_auth_type;
static int hf_zbncp_zdo_leg_auth_status_code;
static int hf_zbncp_zdo_tclk_auth_status_code;
static int hf_zbncp_zdo_server_mask;
static int hf_zbncp_zdo_start_entry_idx;
static int hf_zbncp_zdo_scan_duration;
static int hf_zbncp_zdo_scan_cnt;
static int hf_zbncp_zdo_scan_mgr_addr;
static int hf_zbncp_data_aps_cnt;
static int hf_zbncp_data_aps_fc;
static int hf_zbncp_data_aps_fc_deliv_mode;
static int hf_zbncp_data_aps_fc_secur;
static int hf_zbncp_data_aps_fc_ack_retrans;
static int hf_zbncp_data_aps_key_attr;
static int hf_zbncp_data_aps_key_attr_key_src;
static int hf_zbncp_data_aps_key_attr_key_used;
static int hf_zbncp_data_pkt_len;
static int hf_zbncp_data_pkt;
static int hf_zbncp_data_scan_dur;
static int hf_zbncp_data_distr_nwk_flag;
static int hf_zbncp_data_nwk_count;
static int hf_zbncp_data_nwk_upd_id;
static int hf_zbncp_data_rejoin;
static int hf_zbncp_data_rejoin_nwk;
static int hf_zbncp_data_secur_en;
static int hf_zbncp_data_beacon_type;
static int hf_zbncp_data_beacon_order;
static int hf_zbncp_data_superframe_order;
static int hf_zbncp_data_battery_life_ext;
static int hf_zbncp_data_enh_beacon;
static int hf_zbncp_data_mac_if;
static int hf_zbncp_data_mac_if_idx;
static int hf_zbncp_data_ed_config;
static int hf_zbncp_data_timeout_cnt;
static int hf_zbncp_data_dev_timeout;
static int hf_zbncp_data_relationship;
static int hf_zbncp_data_tx_fail_cnt;
static int hf_zbncp_data_out_cost;
static int hf_zbncp_data_age;
static int hf_zbncp_data_keepalive_rec;
static int hf_zbncp_data_fast_poll_int;
static int hf_zbncp_data_long_poll_int;
static int hf_zbncp_data_fast_poll_flag;
static int hf_zbncp_data_stop_fast_poll_result;
static int hf_zbncp_data_time;
static int hf_zbncp_data_pan_id_cnt;
static int hf_zbncp_data_ic;
static int hf_zbncp_data_ic_table_size;
static int hf_zbncp_data_ic_ent_cnt;
static int hf_zbncp_data_cs;
static int hf_zbncp_data_ca_pub_key;
static int hf_zbncp_data_ca_priv_key;
static int hf_zbncp_data_cert;
static int hf_zbncp_data_ic_en;
static int hf_zbncp_data_key_type;
static int hf_zbncp_data_issuer;
static int hf_zbncp_data_tx_power;
static int hf_zbncp_data_seed;
static int hf_zbncp_data_tx_time;
static int hf_zbncp_data_link_key;
static int hf_zbncp_data_aps_link_key_type;
static int hf_zbncp_data_key_src;
static int hf_zbncp_data_key_attr;
static int hf_zbncp_data_out_frame_cnt;
static int hf_zbncp_data_inc_frame_cnt;
static int hf_zbncp_data_offset;
static int hf_zbncp_data_do_erase;
static int hf_zbncp_data_calibration_status;
static int hf_zbncp_data_calibration_value;
static int hf_zbncp_data_zgp_key_type;
static int hf_zbncp_data_zgp_link_key;
static int hf_zbncp_data_prod_conf_hdr_crc;
static int hf_zbncp_data_prod_conf_hdr_len;
static int hf_zbncp_data_prod_conf_hdr_version;
static int hf_zbncp_data_prod_conf_body;

/* IEEE802.15.4 capability info (copied from IEEE802.15.4 95e212e6c7 commit)*/
static int hf_ieee802154_cinfo_alt_coord;
static int hf_ieee802154_cinfo_device_type;
static int hf_ieee802154_cinfo_power_src;
static int hf_ieee802154_cinfo_idle_rx;
static int hf_ieee802154_cinfo_sec_capable;
static int hf_ieee802154_cinfo_alloc_addr;

/* Configuration parameters */
static int hf_zbncp_data_conf_params_reserved;
static int hf_zbncp_data_conf_params_disable_pan_id_change;
static int hf_zbncp_data_conf_params_disable_channel_change;
static int hf_zbncp_data_conf_params_leave_request_allowed;
static int hf_zbncp_data_conf_params_require_tclk;
static int hf_zbncp_data_conf_params_restricted_enabled;

/* ZBNCP traffic dump */
static int hf_zbncp_dump_preamble;
static int hf_zbncp_dump_version;
static int hf_zbncp_dump_type;
static int hf_zbncp_dump_options;
static int hf_zbncp_dump_options_dir;
static int hf_zbncp_dump_options_int_state;
static int hf_zbncp_dump_options_tx_conflict;

/* Initialize subtree pointers */
static int ett_zbncp_hdr;
static int ett_zbncp_hdr_flags;
static int ett_zbncp_ll_body;
static int ett_zbncp_hl_hdr;
static int ett_zbncp_hl_body;
static int ett_zbncp_data_in_cl_list;
static int ett_zbncp_data_out_cl_list;
static int ett_zbncp_data_mac_cap;
static int ett_zbncp_data_pwr_src;
static int ett_zbncp_data_cur_pwr_src;
static int ett_zbncp_data_asoc_nwk_list;
static int ett_zbncp_data_pwr_desc;
static int ett_zbncp_data_desc_cap;
static int ett_zbncp_data_flags;
static int ett_zbncp_data_server_mask;
static int ett_zbncp_data_ep_list;
static int ett_zbncp_data_leave_flags;
static int ett_zbncp_data_tx_opt;
static int ett_zbncp_data_zdo_rejoin_flags;
static int ett_zbncp_data_apc_fc;
static int ett_zbncp_data_prod_conf_hdr;
static int ett_zbncp_data_aps_key_attr;
static int ett_zbncp_data_ch_list;
static int ett_zbncp_data_channel;
static int ett_zbncp_data_nwk_descr;
static int ett_zbncp_data_cmd_opt;
static int ett_zbncp_data_joind_bitmask;
static int ett_zbncp_data_trace_bitmask;
static int ett_zbncp_data_conf_params;

static int ett_zbncp_dump;
static int ett_zbncp_dump_opt;

static dissector_handle_t zbncp_handle;

static const value_string zbncp_hl_type[] =
{
    {ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST, "Request"},
    {ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE, "Response"},
    {ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION, "Indication"},
    {0, NULL}
};

static const value_string zbncp_hl_status_cat[] =
{
    {ZBNCP_HIGH_LVL_STAT_CAT_GENERIC, "Generic"},
    {ZBNCP_HIGH_LVL_STAT_CAT_SYSTEM, "System"},
    {ZBNCP_HIGH_LVL_STAT_CAT_MAC, "MAC"},
    {ZBNCP_HIGH_LVL_STAT_CAT_NWK, "NWK"},
    {ZBNCP_HIGH_LVL_STAT_CAT_APS, "APS"},
    {ZBNCP_HIGH_LVL_STAT_CAT_ZDO, "ZDO"},
    {ZBNCP_HIGH_LVL_STAT_CAT_CBKE, "CBKE"},
    {0, NULL}
};

static const value_string zbncp_reset_opt[] =
{
    {0, "No options"},
    {1, "Erase NVRAM"},
    {2, "Factory Reset"},
    {3, "Locking reading keys"},
    {0, NULL}
};

static const value_string zbncp_zb_role[] =
{
    {0, "ZC"},
    {1, "ZR"},
    {2, "ZED"},
    {0, NULL}
};

static const value_string zbncp_bind_type_vals[] =
{
    {0, "NCP_HL_UNUSED_BINDING"},
    {1, "NCP_HL_UNICAST_BINDING"},
    {0, NULL}
};

static const value_string zbncp_tc_policy_types[] =
{
    {0, "TC Link Keys Required"},
    {1, "IC Required"},
    {2, "TC Rejoin Enabled"},
    {3, "Ignore TC Rejoin"},
    {4, "APS Insecure Join"},
    {5, "Disable NWK MGMT Channel Update"},
    {6, "Unsecure TC Rejoin Enable"},
    {7, "Enable Device Interview"},
    {8, "Set APS encryption for ZDO"},
    {0, NULL}
};

static const value_string zbncp_dev_update_status_code[] =
{
    {0, "Standard Device Secured Rejoin"},
    {1, "Standard Device Unsecured Join"},
    {2, "Device Left"},
    {3, "Standard Device Trust Center Rejoin"},
    {0, NULL}
};

static const value_string zbncp_nwk_conf_behavior[] =
{
    {0, "None"},
    {1, "R22 Behavior"},
    {2, "R23 Behavior"},
    {0, NULL}
};

static const value_string zbncp_hl_call_id[] =
{
    {ZBNCP_CMD_GET_MODULE_VERSION, "GET_MODULE_VERSION"},
    {ZBNCP_CMD_NCP_RESET, "NCP_RESET"},
    {ZBNCP_CMD_GET_ZIGBEE_ROLE, "GET_ZIGBEE_ROLE"},
    {ZBNCP_CMD_SET_ZIGBEE_ROLE, "SET_ZIGBEE_ROLE"},
    {ZBNCP_CMD_GET_ZIGBEE_CHANNEL_MASK, "GET_ZIGBEE_CHANNEL_MASK"},
    {ZBNCP_CMD_SET_ZIGBEE_CHANNEL_MASK, "SET_ZIGBEE_CHANNEL_MASK"},
    {ZBNCP_CMD_GET_ZIGBEE_CHANNEL, "GET_ZIGBEE_CHANNEL"},
    {ZBNCP_CMD_GET_PAN_ID, "GET_PAN_ID"},
    {ZBNCP_CMD_SET_PAN_ID, "SET_PAN_ID"},
    {ZBNCP_CMD_GET_LOCAL_IEEE_ADDR, "GET_LOCAL_IEEE_ADDR"},
    {ZBNCP_CMD_SET_LOCAL_IEEE_ADDR, "SET_LOCAL_IEEE_ADDR"},
    {ZBNCP_CMD_SET_TRACE, "SET_TRACE"},
    {ZBNCP_CMD_GET_KEEPALIVE_TIMEOUT, "GET_KEEPALIVE_TIMEOUT"},
    {ZBNCP_CMD_SET_KEEPALIVE_TIMEOUT, "SET_KEEPALIVE_TIMEOUT"},
    {ZBNCP_CMD_GET_TX_POWER, "GET_TX_POWER"},
    {ZBNCP_CMD_SET_TX_POWER, "SET_TX_POWER"},
    {ZBNCP_CMD_GET_RX_ON_WHEN_IDLE, "GET_RX_ON_WHEN_IDLE"},
    {ZBNCP_CMD_SET_RX_ON_WHEN_IDLE, "SET_RX_ON_WHEN_IDLE"},
    {ZBNCP_CMD_GET_JOINED, "GET_JOINED"},
    {ZBNCP_CMD_GET_AUTHENTICATED, "GET_AUTHENTICATED"},
    {ZBNCP_CMD_GET_ED_TIMEOUT, "GET_ED_TIMEOUT"},
    {ZBNCP_CMD_SET_ED_TIMEOUT, "SET_ED_TIMEOUT"},
    {ZBNCP_CMD_ADD_VISIBLE_DEV, "ADD_VISIBLE_DEV"},
    {ZBNCP_CMD_ADD_INVISIBLE_SHORT, "ADD_INVISIBLE_SHORT"},
    {ZBNCP_CMD_RM_INVISIBLE_SHORT, "RM_INVISIBLE_SHORT"},
    {ZBNCP_CMD_SET_NWK_KEY, "SET_NWK_KEY"},
    {ZBNCP_CMD_GET_SERIAL_NUMBER, "GET_SERIAL_NUMBER"},
    {ZBNCP_CMD_GET_VENDOR_DATA, "GET_VENDOR_DATA"},
    {ZBNCP_CMD_GET_NWK_KEYS, "GET_NWK_KEYS"},
    {ZBNCP_CMD_GET_APS_KEY_BY_IEEE, "GET_APS_KEY_BY_IEEE"},
    {ZBNCP_CMD_BIG_PKT_TO_NCP, "BIG_PKT_TO_NCP"},
    {ZBNCP_CMD_GET_PARENT_ADDR, "GET_PARENT_ADDR"},
    {ZBNCP_CMD_GET_EXT_PAN_ID, "GET_EXT_PAN_ID"},
    {ZBNCP_CMD_GET_COORDINATOR_VERSION, "GET_COORDINATOR_VERSION"},
    {ZBNCP_CMD_GET_SHORT_ADDRESS, "GET_SHORT_ADDRESS"},
    {ZBNCP_CMD_GET_TRUST_CENTER_ADDRESS, "GET_TRUST_CENTER_ADDRESS"},
    {ZBNCP_CMD_DEBUG_WRITE, "DEBUG_WRITE"},
    {ZBNCP_CMD_GET_CONFIG_PARAMETER, "GET_CONFIG_PARAMETER"},
    {ZBNCP_CMD_GET_LOCK_STATUS, "GET_LOCK_STATUS"},
    {ZBNCP_CMD_GET_TRACE, "GET_TRACE"},
    {ZBNCP_CMD_NCP_RESET_IND, "NCP_RESET_IND"},
    {ZBNCP_CMD_SET_NWK_LEAVE_ALLOWED, "SET_NWK_LEAVE_ALLOWED"},
    {ZBNCP_CMD_GET_NWK_LEAVE_ALLOWED, "GET_NWK_LEAVE_ALLOWED"},
    {ZBNCP_CMD_NVRAM_WRITE, "NVRAM_WRITE"},
    {ZBNCP_CMD_NVRAM_READ, "NVRAM_READ"},
    {ZBCNP_CMD_NVRAM_CLEAR, "NVRAM_CLEAR"},
    {ZBNCP_CMD_NVRAM_ERASE, "NVRAM_ERASE"},
    {ZBNCP_CMD_SET_TC_POLICY, "SET_TC_POLICY"},
    {ZBNCP_CMD_SET_EXTENDED_PAN_ID, "SET_EXTENDED_PAN_ID"},
    {ZBNCP_CMD_SET_ED_CAPACITY, "SET_ED_CAPACITY"},
    {ZBNCP_CMD_GET_ED_CAPACITY, "GET_ED_CAPACITY"},
    {ZBNCP_CMD_SET_ZDO_LEAVE_ALLOWED, "SET_ZDO_LEAVE_ALLOWED"},
    {ZBNCP_CMD_GET_ZDO_LEAVE_ALLOWED, "GET_ZDO_LEAVE_ALLOWED"},
    {ZBNCP_CMD_SET_LEAVE_WO_REJOIN_ALLOWED, "SET_LEAVE_WO_REJOIN_ALLOWED"},
    {ZBNCP_CMD_GET_LEAVE_WO_REJOIN_ALLOWED, "GET_LEAVE_WO_REJOIN_ALLOWED"},
    {ZBNCP_CMD_DISABLE_GPPB, "DISABLE_GPPB"},
    {ZBNCP_CMD_GP_SET_SHARED_KEY_TYPE, "GP_SET_SHARED_KEY_TYPE"},
    {ZBNCP_CMD_GP_SET_DEFAULT_LINK_KEY, "GP_SET_DEFAULT_LINK_KEY"},
    {ZBNCP_CMD_PRODUCTION_CONFIG_READ, "PRODUCTION_CONFIG_READ"},
    {ZBNCP_CMD_SET_MAX_JOINS, "SET_MAX_JOINS"},
    {ZBNCP_CMD_GET_MAX_JOINS, "GET_MAX_JOINS"},
    {ZBNCP_CMD_TRACE_IND, "TRACE_IND"},
    {ZBNCP_CMD_GET_KEY_NEG_METHOD, "GET_KEY_NEG_METHOD"},
    {ZBNCP_CMD_SET_KEY_NEG_METHOD, "SET_KEY_NEG_METHOD"},
    {ZBNCP_CMD_GET_PSK_SECRETS, "GET_PSK_SECRETS"},
    {ZBNCP_CMD_SET_PSK_SECRETS, "SET_PSK_SECRETS"},
    {ZBNCP_CMD_SET_R22_JOIN_USAGE, "SET_R22_JOIN_USAGE"},
    {ZBNCP_CMD_SET_NWK_CONF_PRESET, "SET_NWK_CONF_PRESET"},
    {ZBNCP_CMD_DEBUG_BROAD_NWK_KEY, "DEBUG_BROAD_NWK_KEY"},
    {ZBNCP_CMD_DEBUG_BROAD_APS_KEY, "DEBUG_BROAD_APS_KEY"},
    {ZBNCP_CMD_AF_SET_SIMPLE_DESC, "AF_SET_SIMPLE_DESC"},
    {ZBNCP_CMD_AF_DEL_EP, "AF_DEL_EP"},
    {ZBNCP_CMD_AF_SET_NODE_DESC, "AF_SET_NODE_DESC"},
    {ZBNCP_CMD_AF_SET_POWER_DESC, "AF_SET_POWER_DESC"},
    {ZBNCP_CMD_AF_SUBGHZ_SUSPEND_IND, "AF_SUBGHZ_SUSPEND_IND"},
    {ZBNCP_CMD_AF_SUBGHZ_RESUME_IND, "AF_SUBGHZ_RESUME_IND"},
    {ZBNCP_CMD_ZDO_NWK_ADDR_REQ, "ZDO_NWK_ADDR_REQ"},
    {ZBNCP_CMD_ZDO_IEEE_ADDR_REQ, "ZDO_IEEE_ADDR_REQ"},
    {ZBNCP_CMD_ZDO_POWER_DESC_REQ, "ZDO_POWER_DESC_REQ"},
    {ZBNCP_CMD_ZDO_NODE_DESC_REQ, "ZDO_NODE_DESC_REQ"},
    {ZBNCP_CMD_ZDO_SIMPLE_DESC_REQ, "ZDO_SIMPLE_DESC_REQ"},
    {ZBNCP_CMD_ZDO_ACTIVE_EP_REQ, "ZDO_ACTIVE_EP_REQ"},
    {ZBNCP_CMD_ZDO_MATCH_DESC_REQ, "ZDO_MATCH_DESC_REQ"},
    {ZBNCP_CMD_ZDO_BIND_REQ, "ZDO_BIND_REQ"},
    {ZBNCP_CMD_ZDO_UNBIND_REQ, "ZDO_UNBIND_REQ"},
    {ZBNCP_CMD_ZDO_MGMT_LEAVE_REQ, "ZDO_MGMT_LEAVE_REQ"},
    {ZBNCP_CMD_ZDO_PERMIT_JOINING_REQ, "ZDO_PERMIT_JOINING_REQ"},
    {ZBNCP_CMD_ZDO_DEV_ANNCE_IND, "ZDO_DEV_ANNCE_IND"},
    {ZBNCP_CMD_ZDO_REJOIN, "ZDO_REJOIN"},
    {ZBNCP_CMD_ZDO_SYSTEM_SRV_DISCOVERY_REQ, "ZDO_SYSTEM_SRV_DISCOVERY_REQ"},
    {ZBNCP_CMD_ZDO_MGMT_BIND_REQ, "ZDO_MGMT_BIND_REQ"},
    {ZBNCP_CMD_ZDO_MGMT_LQI_REQ, "ZDO_MGMT_LQI_REQ"},
    {ZBNCP_CMD_ZDO_MGMT_NWK_UPDATE_REQ, "ZDO_MGMT_NWK_UPDATE_REQ"},
    {ZBNCP_CMD_ZDO_REMOTE_CMD_IND, "ZDO_REMOTE_CMD_IND"},
    {ZBNCP_CMD_ZDO_GET_STATS, "ZDO_GET_STATS"},
    {ZBNCP_CMD_ZDO_DEV_AUTHORIZED_IND, "ZDO_DEV_AUTHORIZED_IND"},
    {ZBNCP_CMD_ZDO_DEV_UPDATE_IND, "ZDO_DEV_UPDATE_IND"},
    {ZBNCP_CMD_ZDO_SET_NODE_DESC_MANUF_CODE, "ZDO_SET_NODE_DESC_MANUF_CODE"},
    {ZBNCP_CMD_HL_ZDO_GET_DIAG_DATA_REQ, "ZDO_GET_DIAG_DATA_REQ"},
    {ZBNCP_CMD_HL_ZDO_RAW_REQ, "ZDO_RAW_REQ"},
    {ZBNCP_CMD_HL_ZDO_SEND_CONF_PARAMS_REQ, "ZDO_SEND_CONF_PARAMS_REQ"},
    {ZBNCP_CMD_HL_ZDO_MGMT_BEACON_SURVEY_REQ, "ZDO_MGMT_BEACON_SURVEY_REQ"},
    {ZBNCP_CMD_HL_ZDO_DECOMMISSION_REQ, "ZDO_DECOMMISSION_REQ"},
    {ZBNCP_CMD_HL_ZDO_GET_AUTH_LEVEL_REQ, "ZDO_GET_AUTH_LEVEL_REQ"},
    {ZBNCP_CMD_APSDE_DATA_REQ, "APSDE_DATA_REQ"},
    {ZBNCP_CMD_APSME_BIND, "APSME_BIND"},
    {ZBNCP_CMD_APSME_UNBIND, "APSME_UNBIND"},
    {ZBNCP_CMD_APSME_ADD_GROUP, "APSME_ADD_GROUP"},
    {ZBNCP_CMD_APSME_RM_GROUP, "APSME_RM_GROUP"},
    {ZBNCP_CMD_APSDE_DATA_IND, "APSDE_DATA_IND"},
    {ZBNCP_CMD_APSME_RM_ALL_GROUPS, "APSME_RM_ALL_GROUPS"},
    {ZBNCP_CMD_APS_GET_GROUP_TABLE, "APS_GET_GROUP_TABLE"},
    {ZBNCP_CMD_APSME_UNBIND_ALL, "APSME_UNBIND_ALL"},
    {ZBNCP_CMD_APSME_RM_BIND_ENTRY_BY_ID, "APSME_RM_BIND_ENTRY_BY_ID"},
    {ZBNCP_CMD_APSME_CLEAR_BIND_TABLE, "APSME_CLEAR_BIND_TABLE"},
    {ZBNCP_CMD_APSME_REMOTE_BIND_IND, "APSME_REMOTE_BIND_IND"},
    {ZBNCP_CMD_APSME_REMOTE_UNBIND_IND, "APSME_REMOTE_UNBIND_IND"},
    {ZBNCP_CMD_APSME_SET_REMOTE_BIND_OFFSET, "APSME_SET_REMOTE_BIND_OFFSET"},
    {ZBNCP_CMD_APSME_GET_REMOTE_BIND_OFFSET, "APSME_GET_REMOTE_BIND_OFFSET"},
    {ZBNCP_CMD_APSME_GET_BIND_ENTRY_BY_ID, "APSME_GET_BIND_ENTRY_BY_ID"},
    {ZBNCP_CMD_NWK_FORMATION, "NWK_FORMATION"},
    {ZBNCP_CMD_NWK_DISCOVERY, "NWK_DISCOVERY"},
    {ZBNCP_CMD_NWK_NLME_JOIN, "NWK_NLME_JOIN"},
    {ZBNCP_CMD_NWK_PERMIT_JOINING, "NWK_PERMIT_JOINING"},
    {ZBNCP_CMD_NWK_GET_IEEE_BY_SHORT, "NWK_GET_IEEE_BY_SHORT"},
    {ZBNCP_CMD_NWK_GET_SHORT_BY_IEEE, "NWK_GET_SHORT_BY_IEEE"},
    {ZBNCP_CMD_NWK_GET_NEIGHBOR_BY_IEEE, "NWK_GET_NEIGHBOR_BY_IEEE"},
    {ZBNCP_CMD_NWK_STARTED_IND, "NWK_STARTED_IND"},
    {ZBNCP_CMD_NWK_REJOINED_IND, "NWK_REJOINED_IND"},
    {ZBNCP_CMD_NWK_REJOIN_FAILED_IND, "NWK_REJOIN_FAILED_IND"},
    {ZBNCP_CMD_NWK_LEAVE_IND, "NWK_LEAVE_IND"},
    {ZBNCP_CMD_PIM_SET_FAST_POLL_INTERVAL, "PIM_SET_FAST_POLL_INTERVAL"},
    {ZBNCP_CMD_PIM_SET_LONG_POLL_INTERVAL, "PIM_SET_LONG_POLL_INTERVAL"},
    {ZBNCP_CMD_PIM_START_FAST_POLL, "PIM_START_FAST_POLL"},
    {ZBNCP_CMD_PIM_START_POLL, "PIM_START_POLL"},
    {ZBNCP_CMD_PIM_SET_ADAPTIVE_POLL, "PIM_SET_ADAPTIVE_POLL"},
    {ZBNCP_CMD_PIM_STOP_FAST_POLL, "PIM_STOP_FAST_POLL"},
    {ZBNCP_CMD_PIM_STOP_POLL, "PIM_STOP_POLL"},
    {ZBNCP_CMD_PIM_ENABLE_TURBO_POLL, "PIM_ENABLE_TURBO_POLL"},
    {ZBNCP_CMD_PIM_DISABLE_TURBO_POLL, "PIM_DISABLE_TURBO_POLL"},
    {ZBNCP_CMD_NWK_GET_FIRST_NBT_ENTRY, "NWK_GET_FIRST_NBT_ENTRY"},
    {ZBNCP_CMD_NWK_GET_NEXT_NBT_ENTRY, "NWK_GET_NEXT_NBT_ENTRY"},
    {ZBNCP_CMD_NWK_PAN_ID_CONFLICT_RESOLVE, "NWK_PAN_ID_CONFLICT_RESOLVE"},
    {ZBNCP_CMD_NWK_PAN_ID_CONFLICT_IND, "NWK_PAN_ID_CONFLICT_IND"},
    {ZBNCP_CMD_NWK_ADDRESS_UPDATE_IND, "NWK_ADDRESS_UPDATE_IND"},
    {ZBNCP_CMD_NWK_START_WITHOUT_FORMATION, "NWK_START_WITHOUT_FORMATION"},
    {ZBNCP_CMD_NWK_NLME_ROUTER_START, "NWK_NLME_ROUTER_START"},
    {ZBNCP_CMD_PIM_SINGLE_POLL, "PIM_SINGLE_POLL"},
    {ZBNCP_CMD_PARENT_LOST_IND, "PARENT_LOST_IND"},
    {ZBNCP_CMD_PIM_START_TURBO_POLL_PACKETS, "PIM_START_TURBO_POLL_PACKETS"},
    {ZBNCP_CMD_PIM_START_TURBO_POLL_CONTINUOUS, "PIM_START_TURBO_POLL_CONTINUOUS"},
    {ZBNCP_CMD_PIM_TURBO_POLL_CONTINUOUS_LEAVE, "PIM_TURBO_POLL_CONTINUOUS_LEAVE"},
    {ZBNCP_CMD_PIM_TURBO_POLL_PACKETS_LEAVE, "PIM_TURBO_POLL_PACKETS_LEAVE"},
    {ZBNCP_CMD_PIM_PERMIT_TURBO_POLL, "PIM_PERMIT_TURBO_POLL"},
    {ZBNCP_CMD_PIM_SET_FAST_POLL_TIMEOUT, "PIM_SET_FAST_POLL_TIMEOUT"},
    {ZBNCP_CMD_PIM_GET_LONG_POLL_INTERVAL, "PIM_GET_LONG_POLL_INTERVAL"},
    {ZBNCP_CMD_PIM_GET_IN_FAST_POLL_FLAG, "PIM_GET_IN_FAST_POLL_FLAG"},
    {ZBNCP_CMD_SET_KEEPALIVE_MODE, "SET_KEEPALIVE_MODE"},
    {ZBNCP_CMD_START_CONCENTRATOR_MODE, "START_CONCENTRATOR_MODE"},
    {ZBNCP_CMD_STOP_CONCENTRATOR_MODE, "STOP_CONCENTRATOR_MODE"},
    {ZBNCP_CMD_NWK_ENABLE_PAN_ID_CONFLICT_RESOLUTION, "NWK_ENABLE_PAN_ID_CONFLICT_RESOLUTION"},
    {ZBNCP_CMD_NWK_ENABLE_AUTO_PAN_ID_CONFLICT_RESOLUTION, "NWK_ENABLE_AUTO_PAN_ID_CONFLICT_RESOLUTION"},
    {ZBNCP_CMD_PIM_TURBO_POLL_CANCEL_PACKET, "PIM_TURBO_POLL_CANCEL_PACKET"},
    {ZBNCP_CMD_SET_FORCE_ROUTE_RECORD, "SET_FORCE_ROUTE_RECORD"},
    {ZBNCP_CMD_GET_FORCE_ROUTE_RECORD, "GET_FORCE_ROUTE_RECORD"},
    {ZBNCP_CMD_NWK_NBR_ITERATOR_NEXT, "NWK_NBR_ITERATOR_NEXT"},
    {ZBNCP_CMD_ZB_DEBUG_SIGNAL_TCLK_READY_IND, "DEBUG_SIGNAL_TCLK_READY_IND"},
    {ZBNCP_CMD_ZB_DEVICE_READY_FOR_INTERVIEW_IND, "DEVICE_READY_FOR_INTERVIEW_IND"},
    {ZBNCP_CMD_ZB_DEVICE_INTERVIEW_FINISHED_IND, "DEVICE_INTERVIEW_FINISHED_IND"},
    {ZBNCP_CMD_ZB_PREPARE_NETWORK_FOR_CHANNEL_PAN_ID_CHANGE, "PREPARE_NETWORK_FOR_CHANNEL_PAN_ID_CHANGE"},
    {ZBNCP_CMD_ZB_PREPARE_NETWORK_FOR_CHANNEL_CHANGE, "PREPARE_NETWORK_FOR_CHANNEL_CHANGE"},
    {ZBNCP_CMD_ZB_START_CHANNEL_CHANGE, "START_CHANNEL_CHANGE"},
    {ZBNCP_CMD_ZB_START_PAN_ID_CHANGE, "START_PAN_ID_CHANGE"},
    {ZBNCP_CMD_SECUR_SET_LOCAL_IC, "SECUR_SET_LOCAL_IC"},
    {ZBNCP_CMD_SECUR_ADD_IC, "SECUR_ADD_IC"},
    {ZBNCP_CMD_SECUR_DEL_IC, "SECUR_DEL_IC"},
    {ZBNCP_CMD_SECUR_ADD_CERT, "SECUR_ADD_CERT"},
    {ZBNCP_CMD_SECUR_DEL_CERT, "SECUR_DEL_CERT"},
    {ZBNCP_CMD_SECUR_START_KE, "SECUR_START_KE"},
    {ZBNCP_CMD_SECUR_START_PARTNER_LK, "SECUR_START_PARTNER_LK"},
    {ZBNCP_CMD_SECUR_CBKE_SRV_FINISHED_IND, "SECUR_CBKE_SRV_FINISHED_IND"},
    {ZBNCP_CMD_SECUR_PARTNER_LK_FINISHED_IND, "SECUR_PARTNER_LK_FINISHED_IND"},
    {ZBNCP_CMD_SECUR_KE_WHITELIST_ADD, "SECUR_KE_WHITELIST_ADD"},
    {ZBNCP_CMD_SECUR_KE_WHITELIST_DEL, "SECUR_KE_WHITELIST_DEL"},
    {ZBNCP_CMD_SECUR_KE_WHITELIST_DEL_ALL, "SECUR_KE_WHITELIST_DEL_ALL"},
    {ZBNCP_CMD_SECUR_JOIN_USES_IC, "SECUR_JOIN_USES_IC"},
    {ZBNCP_CMD_SECUR_GET_IC_BY_IEEE, "SECUR_GET_IC_BY_IEEE"},
    {ZBNCP_CMD_SECUR_GET_CERT, "SECUR_GET_CERT"},
    {ZBNCP_CMD_SECUR_GET_LOCAL_IC, "SECUR_GET_LOCAL_IC"},
    {ZBNCP_CMD_SECUR_TCLK_IND, "SECUR_TCLK_IND"},
    {ZBNCP_CMD_SECUR_TCLK_EXCHANGE_FAILED_IND, "SECUR_TCLK_EXCHANGE_FAILED_IND"},
    {ZBNCP_CMD_SECUR_GET_KEY_IDX, "SECUR_GET_KEY_IDX"},
    {ZBNCP_CMD_SECUR_GET_KEY, "SECUR_GET_KEY"},
    {ZBNCP_CMD_SECUR_ERASE_KEY, "SECUR_ERASE_KEY"},
    {ZBNCP_CMD_SECUR_CLEAR_KEY_TABLE, "SECUR_CLEAR_KEY_TABLE"},
    {ZBNCP_CMD_SECUR_NWK_INITIATE_KEY_SWITCH_PROCEDURE, "SECUR_NWK_INITIATE_KEY_SWITCH_PROCEDURE"},
    {ZBNCP_CMD_SECUR_GET_IC_LIST, "SECUR_GET_IC_LIST"},
    {ZBNCP_CMD_SECUR_GET_IC_BY_IDX, "SECUR_GET_IC_BY_IDX"},
    {ZBNCP_CMD_SECUR_REMOVE_ALL_IC, "SECUR_REMOVE_ALL_IC"},
    {ZBNCP_CMD_SECUR_PARTNER_LK_ENABLE, "SECUR_PARTNER_LK_ENABLE"},
    {ZBNCP_CMD_SECUR_AUTH_DEVICE_AFTER_INTERVIEW, "SECUR_AUTH_DEVICE_AFTER_INTERVIEW"},
    {ZBNCP_CMD_ZDO_SECUR_UPDATE_DEVICE_TCLK, "SECUR_UPDATE_DEVICE_TCLK"},
    {ZBNCP_CMD_MANUF_MODE_START, "MANUF_MODE_START"},
    {ZBNCP_CMD_MANUF_MODE_END, "MANUF_MODE_END"},
    {ZBNCP_CMD_MANUF_SET_CHANNEL, "MANUF_SET_CHANNEL"},
    {ZBNCP_CMD_MANUF_GET_CHANNEL, "MANUF_GET_CHANNEL"},
    {ZBNCP_CMD_MANUF_SET_POWER, "MANUF_SET_POWER"},
    {ZBNCP_CMD_MANUF_GET_POWER, "MANUF_GET_POWER"},
    {ZBNCP_CMD_MANUF_START_TONE, "MANUF_START_TONE"},
    {ZBNCP_CMD_MANUF_STOP_TONE, "MANUF_STOP_TONE"},
    {ZBNCP_CMD_MANUF_START_STREAM_RANDOM, "MANUF_START_STREAM_RANDOM"},
    {ZBNCP_CMD_MANUF_STOP_STREAM_RANDOM, "MANUF_STOP_STREAM_RANDOM"},
    {ZBNCP_CMD_NCP_HL_MANUF_SEND_SINGLE_PACKET, "MANUF_SEND_SINGLE_PACKET"},
    {ZBNCP_CMD_MANUF_START_TEST_RX, "MANUF_START_TEST_RX"},
    {ZBNCP_CMD_MANUF_STOP_TEST_RX, "MANUF_STOP_TEST_RX"},
    {ZBNCP_CMD_MANUF_RX_PACKET_IND, "MANUF_RX_PACKET_IND"},
    {ZBNCP_CMD_OTA_RUN_BOOTLOADER, "OTA_RUN_BOOTLOADER"},
    {ZBNCP_CMD_OTA_START_UPGRADE_IND, "OTA_START_UPGRADE_IND"},
    {ZBNCP_CMD_OTA_SEND_PORTION_FW, "OTA_SEND_PORTION_FW"},
    {ZBNCP_CMD_READ_NVRAM_RESERVED, "READ_NVRAM_RESERVED"},
    {ZBNCP_CMD_WRITE_NVRAM_RESERVED, "WRITE_NVRAM_RESERVED"},
    {ZBNCP_CMD_GET_CALIBRATION_INFO, "GET_CALIBRATION_INFO"},
    {0, NULL}
};

static const value_string zbncp_parameter_id_list[] =
{
    {ZBNCP_PARAMETER_ID_IEEE_ADDR_TABLE_SIZE, "IEEE_ADDR_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_NEIGHBOR_TABLE_SIZE, "NEIGHBOR_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_APS_SRC_BINDING_TABLE_SIZE, "APS_SRC_BINDING_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_APS_GROUP_TABLE_SIZE, "APS_GROUP_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_NWK_ROUTING_TABLE_SIZE, "NWK_ROUTING_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_NWK_ROUTE_DISCOVERY_TABLE_SIZE, "NWK_ROUTE_DISCOVERY_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_IOBUF_POOL_SIZE, "IOBUF_POOL_SIZE"},
    {ZBNCP_PARAMETER_ID_PANID_TABLE_SIZE, "PANID_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_APS_DUPS_TABLE_SIZE, "APS_DUPS_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_APS_BIND_TRANS_TABLE_SIZE, "APS_BIND_TRANS_TABLE_SIZE"},
    {ZBNCP_PARAMETER_ID_N_APS_RETRANS_ENTRIES, "N_APS_RETRANS_ENTRIES"},
    {ZBNCP_PARAMETER_ID_NWK_MAX_HOPS, "NWK_MAX_HOPS"},
    {ZBNCP_PARAMETER_ID_NIB_MAX_CHILDREN, "NIB_MAX_CHILDREN"},
    {ZBNCP_PARAMETER_ID_N_APS_KEY_PAIR_ARR_MAX_SIZE, "N_APS_KEY_PAIR_ARR_MAX_SIZE"},
    {ZBNCP_PARAMETER_ID_NWK_MAX_SRC_ROUTES, "NWK_MAX_SRC_ROUTES"},
    {ZBNCP_PARAMETER_ID_APS_MAX_WINDOW_SIZE, "APS_MAX_WINDOW_SIZE"},
    {ZBNCP_PARAMETER_ID_APS_INTERFRAME_DELAY, "APS_INTERFRAME_DELAY"},
    {ZBNCP_PARAMETER_ID_ZDO_ED_BIND_TIMEOUT, "ZDO_ED_BIND_TIMEOUT"},
    {ZBNCP_PARAMETER_ID_NIB_PASSIVE_ASK_TIMEOUT, "NIB_PASSIVE_ASK_TIMEOUT"},
    {ZBNCP_PARAMETER_ID_APS_ACK_TIMEOUTS, "APS_ACK_TIMEOUTS"},
    {ZBNCP_PARAMETER_ID_MAC_BEACON_JITTER, "MAC_BEACON_JITTER"},
    {ZBNCP_PARAMETER_ID_TX_POWER, "TX_POWER"},
    {ZBNCP_PARAMETER_ID_ZLL_DEFAULT_RSSI_THRESHOLD, "ZLL_DEFAULT_RSSI_THRESHOLD"},
    {ZBNCP_PARAMETER_ID_NIB_MTORR, "NIB_MTORR"},
    {0, NULL}
};

static const value_string zbncp_rst_src_list[] =
{
    {0, "ZB_RESET_SRC_POWER_ON"},
    {1, "ZB_RESET_SRC_SW_RESET"},
    {2, "ZB_RESET_SRC_RESET_PIN"},
    {3, "ZB_RESET_SRC_BROWN_OUT"},
    {4, "ZB_RESET_SRC_CLOCK_LOSS"},
    {5, "ZB_RESET_SRC_OTHER"},
    {0, NULL}
};

static const value_string zbncp_power_level[] =
{
    {0, "Critical"},
    {4, "33%"},
    {8, "66%"},
    {12, "100%"},
    {0, NULL}
};

static const value_string zbncp_nwk_req_type[] =
{
    {0, "Single device response"},
    {1, "Extended response"},
    {0, NULL}
};

static const value_string zbncp_hl_status_generic[] =
{
    {0, "OK"},
    {1, "ERROR"},
    {2, "BLOCKED"},
    {3, "EXIT"},
    {4, "BUSY"},
    {5, "EOF"},
    {6, "OUT_OF_RANGE"},
    {7, "EMPTY"},
    {8, "CANCELLED"},
    {10, "INVALID_PARAMETER_1"},
    {11, "INVALID_PARAMETER_2"},
    {12, "INVALID_PARAMETER_3"},
    {13, "INVALID_PARAMETER_4"},
    {14, "INVALID_PARAMETER_5"},
    {15, "INVALID_PARAMETER_6"},
    {16, "INVALID_PARAMETER_7"},
    {17, "INVALID_PARAMETER_8"},
    {18, "INVALID_PARAMETER_9"},
    {19, "INVALID_PARAMETER_10"},
    {20, "INVALID_PARAMETER_11_OR_MORE"},
    {21, "PENDING"},
    {22, "NO_MEMORY"},
    {23, "INVALID_PARAMETER"},
    {24, "OPERATION_FAILED"},
    {25, "BUFFER_TOO_SMALL"},
    {26, "END_OF_LIST"},
    {27, "ALREADY_EXISTS"},
    {28, "NOT_FOUND"},
    {29, "OVERFLOW"},
    {30, "TIMEOUT"},
    {31, "NOT_IMPLEMENTED"},
    {32, "NO_RESOURCES"},
    {33, "UNINITIALIZED"},
    {34, "NO_SERVER"},
    {35, "INVALID_STATE"},
    {37, "CONNECTION_FAILED"},
    {38, "CONNECTION_LOST"},
    {40, "UNAUTHORIZED"},
    {41, "CONFLICT"},
    {42, "INVALID_FORMAT"},
    {43, "NO_MATCH"},
    {44, "PROTOCOL_ERROR"},
    {45, "VERSION"},
    {46, "MALFORMED_ADDRESS"},
    {47, "COULD_NOT_READ_FILE"},
    {48, "FILE_NOT_FOUND"},
    {49, "DIRECTORY_NOT_FOUND"},
    {50, "CONVERSION_ERROR"},
    {51, "INCOMPATIBLE_TYPES"},
    {56, "FILE_CORRUPTED"},
    {57, "PAGE_NOT_FOUND"},
    {62, "ILLEGAL_REQUEST"},
    {64, "INVALID_GROUP"},
    {65, "TABLE_FULL"},
    {69, "IGNORE"},
    {70, "AGAIN"},
    {71, "DEVICE_NOT_FOUND"},
    {72, "OBSOLETE"},
    {0, NULL}
};

static const value_string zb_mac_state[] =
{
    {MAC_ENUM_SUCCESS, "SUCCESS"},
    {MAC_ENUM_BEACON_LOSS, "BEACON_LOSS"},
    {MAC_ENUM_CHANNEL_ACCESS_FAILURE, "CHANNEL_ACCESS_FAILURE"},
    {MAC_ENUM_COUNTER_ERROR, "COUNTER_ERROR"},
    {MAC_ENUM_DENIED, "DENIED"},
    {MAC_ENUM_DISABLE_TRX_FAILURE, "DISABLE_TRX_FAILURE"},
    {MAC_ENUM_FRAME_TOO_LONG, "FRAME_TOO_LONG"},
    {MAC_ENUM_IMPROPER_KEY_TYPE, "IMPROPER_KEY_TYPE"},
    {MAC_ENUM_IMPROPER_SECURITY_LEVEL, "IMPROPER_SECURITY_LEVEL"},
    {MAC_ENUM_INVALID_ADDRESS, "INVALID_ADDRESS"},
    {MAC_ENUM_INVALID_GTS, "INVALID_GTS"},
    {MAC_ENUM_INVALID_HANDLE, "INVALID_HANDLE"},
    {MAC_ENUM_INVALID_INDEX, "INVALID_INDEX"},
    {MAC_ENUM_INVALID_PARAMETER, "INVALID_PARAMETER"},
    {MAC_ENUM_LIMIT_REACHED, "LIMIT_REACHED"},
    {MAC_ENUM_NO_ACK, "NO_ACK"},
    {MAC_ENUM_NO_BEACON, "NO_BEACON"},
    {MAC_ENUM_NO_DATA, "NO_DATA"},
    {MAC_ENUM_NO_SHORT_ADDRESS, "NO_SHORT_ADDRESS"},
    {MAC_ENUM_ON_TIME_TOO_LONG, "ON_TIME_TOO_LONG"},
    {MAC_ENUM_OUT_OF_CAP, "OUT_OF_CAP"},
    {MAC_ENUM_PAN_ID_CONFLICT, "PAN_ID_CONFLICT"},
    {MAC_ENUM_PAST_TIME, "PAST_TIME"},
    {MAC_ENUM_READ_ONLY, "READ_ONLY"},
    {MAC_ENUM_REALIGNMENT, "REALIGNMENT"},
    {MAC_ENUM_SCAN_IN_PROGRESS, "SCAN_IN_PROGRESS"},
    {MAC_ENUM_SECURITY_ERROR, "SECURITY_ERROR"},
    {MAC_ENUM_SUPERFRAME_OVERLAP, "SUPERFRAME_OVERLAP"},
    {MAC_ENUM_TRACKING_OFF, "TRACKING_OFF"},
    {MAC_ENUM_TRANSACTION_EXPIRED, "TRANSACTION_EXPIRED"},
    {MAC_ENUM_TRANSACTION_OVERFLOW, "TRANSACTION_OVERFLOW"},
    {MAC_ENUM_TX_ACTIVE, "TX_ACTIVE"},
    {MAC_ENUM_UNAVAILABLE_KEY, "UNAVAILABLE_KEY"},
    {MAC_ENUM_UNSUPPORTED_LEGACY, "UNSUPPORTED_LEGACY"},
    {MAC_ENUM_UNSUPPORTED_SECURITY, "UNSUPPORTED_SECURITY"},
    {0, NULL}
};

static const value_string zb_nwk_state[] =
{
    {ZBNCP_NWK_STATUS_SUCCESS, "SUCCESS"},
    {ZBNCP_NWK_STATUS_INVALID_PARAMETER, "INVALID_PARAMETER"},
    {ZBNCP_NWK_STATUS_INVALID_REQUEST, "INVALID_REQUEST"},
    {ZBNCP_NWK_STATUS_NOT_PERMITTED, "NOT_PERMITTED, "},
    {ZBNCP_NWK_STATUS_ALREADY_PRESENT, "ALREADY_PRESENT"},
    {ZBNCP_NWK_STATUS_SYNC_FAILURE, "SYNC_FAILURE"},
    {ZBNCP_NWK_STATUS_NEIGHBOR_TABLE_FULL, "NEIGHBOR_TABLE_FULL"},
    {ZBNCP_NWK_STATUS_UNKNOWN_DEVICE, "UNKNOWN_DEVICE"},
    {ZBNCP_NWK_STATUS_UNSUPPORTED_ATTRIBUTE, "UNSUPPORTED_ATTRIBUTE"},
    {ZBNCP_NWK_STATUS_NO_NETWORKS, "NO_NETWORKS"},
    {ZBNCP_NWK_STATUS_MAX_FRM_COUNTER, "MAX_FRM_COUNTER"},
    {ZBNCP_NWK_STATUS_NO_KEY, "NO_KEY"},
    {ZBNCP_NWK_STATUS_ROUTE_DISCOVERY_FAILED, "ROUTE_DISCOVERY_FAILED"},
    {ZBNCP_NWK_STATUS_ROUTE_ERROR, "ROUTE_ERROR"},
    {ZBNCP_NWK_STATUS_BT_TABLE_FULL, "BT_TABLE_FULL"},
    {ZBNCP_NWK_STATUS_FRAME_NOT_BUFFERED, "FRAME_NOT_BUFFERED"},
    {ZBNCP_NWK_STATUS_INVALID_INTERFACE, "INVALID_INTERFACE"},
    {0, NULL}
};

static const value_string zb_cbke_state[] =
{
    {ZBNCP_CBKE_STATUS_OK, "OK"},
    {ZBNCP_CBKE_STATUS_UNKNOWN_ISSUER, "UNKNOWN_ISSUER"},
    {ZBNCP_CBKE_STATUS_BAD_KEY_CONFIRM, "BAD_KEY_CONFIRM"},
    {ZBNCP_CBKE_STATUS_BAD_MESSAGE, "BAD_MESSAGE"},
    {ZBNCP_CBKE_STATUS_NO_RESOURCES, "NO_RESOURCES"},
    {ZBNCP_CBKE_STATUS_UNSUPPORTED_SUITE, "UNSUPPORTED_SUITE"},
    {ZBNCP_CBKE_STATUS_INVALID_CERTIFICATE, "INVALID_CERTIFICATE"},
    {ZBNCP_CBKE_STATUS_NO_KE_EP, "NO_KE_EP"},
    {0, NULL}
};

static const value_string zb_nvram_database_types[] =
{
    {ZB_NVRAM_RESERVED, "ZB_NVRAM_RESERVED"},
    {ZB_NVRAM_COMMON_DATA, "ZB_NVRAM_COMMON_DATA"},
    {ZB_NVRAM_HA_DATA, "ZB_NVRAM_HA_DATA"},
    {ZB_NVRAM_ZCL_REPORTING_DATA, "ZB_NVRAM_ZCL_REPORTING_DATA"},
    {ZB_NVRAM_APS_SECURE_DATA_GAP, "ZB_NVRAM_APS_SECURE_DATA_GAP"},
    {ZB_NVRAM_APS_BINDING_DATA_GAP, "ZB_NVRAM_APS_BINDING_DATA_GAP"},
    {ZB_NVRAM_HA_POLL_CONTROL_DATA, "ZB_NVRAM_HA_POLL_CONTROL_DATA"},
    {ZB_IB_COUNTERS, "ZB_IB_COUNTERS"},
    {ZB_NVRAM_DATASET_GRPW_DATA, "ZB_NVRAM_DATASET_GRPW_DATA"},
    {ZB_NVRAM_APP_DATA1, "ZB_NVRAM_APP_DATA1"},
    {ZB_NVRAM_APP_DATA2, "ZB_NVRAM_APP_DATA2"},
    {ZB_NVRAM_ADDR_MAP, "ZB_NVRAM_ADDR_MAP"},
    {ZB_NVRAM_NEIGHBOUR_TBL, "ZB_NVRAM_NEIGHBOUR_TBL"},
    {ZB_NVRAM_INSTALLCODES, "ZB_NVRAM_INSTALLCODES"},
    {ZB_NVRAM_APS_SECURE_DATA, "ZB_NVRAM_APS_SECURE_DATA"},
    {ZB_NVRAM_APS_BINDING_DATA, "ZB_NVRAM_APS_BINDING_DATA"},
    {ZB_NVRAM_DATASET_GP_PRPOXYT, "ZB_NVRAM_DATASET_GP_PRPOXYT"},
    {ZB_NVRAM_DATASET_GP_SINKT, "ZB_NVRAM_DATASET_GP_SINKT"},
    {ZB_NVRAM_DATASET_GP_CLUSTER, "ZB_NVRAM_DATASET_GP_CLUSTER"},
    {ZB_NVRAM_APS_GROUPS_DATA, "ZB_NVRAM_APS_GROUPS_DATA"},
    {ZB_NVRAM_DATASET_SE_CERTDB, "ZB_NVRAM_DATASET_SE_CERTDB"},
    {ZB_NVRAM_DATASET_GP_APP_TBL, "ZB_NVRAM_DATASET_GP_APP_TBL"},
    {ZB_NVRAM_APP_DATA3, "ZB_NVRAM_APP_DATA3"},
    {ZB_NVRAM_APP_DATA4, "ZB_NVRAM_APP_DATA4"},
    {ZB_NVRAM_KE_WHITELIST, "ZB_NVRAM_KE_WHITELIST"},
    {ZB_NVRAM_ZDO_DIAGNOSTICS_DATA, "ZB_NVRAM_ZDO_DIAGNOSTICS_DATA"},
    {ZB_NVRAM_DATASET_NUMBER, "ZB_NVRAM_DATASET_NUMBER"},
    {ZB_NVRAM_DATA_SET_TYPE_PAGE_HDR, "ZB_NVRAM_DATA_SET_TYPE_PAGE_HDR"},
    {0, NULL}
};

static const value_string zbncp_zgp_key_types[] =
{
    {0, "No key"},
    {1, "Zigbee NWK key"},
    {2, "ZGPD group key"},
    {3, "NWK-key derived ZGPD group key"},
    {4, "(Individual) out-of-the-box ZGPD key"},
    {7, "Derived individual ZGPD key"},
    {0, NULL}
};

static const value_string zbncp_deliv_mode[] =
{
    {0, "Unicast"},
    {2, "Broadcast"},
    {3, "Group"},
    {0, NULL}
};

static const value_string zbncp_aps_key_src[] =
{
    {0, "Unknown"},
    {1, "CBKE"},
    {0, NULL}
};

static const value_string zbncp_aps_key_used[] =
{
    {0, "Provisional TCLK"},
    {1, "Unverified TCLK"},
    {2, "Verified TCLK"},
    {3, "Application LK"},
    {0, NULL}
};

static const value_string zbncp_rejoin_nwk[] =
{
    {0, "Associate"},
    {2, "Rejoin"},
    {0, NULL}
};

static const value_string zbncp_beacon_type[] =
{
    {0, "Non-enhanced beacon"},
    {1, "Enhanced Beacon"},
    {0, NULL}
};

static const value_string zbncp_relationship[] =
{
    {0x00, "neighbor is the parent"},
    {0x01, "neighbor is a child"},
    {0x02, "neighbor is a sibling"},
    {0x03, "none of the above"},
    {0x04, "previous child"},
    {0x05, "unauthenticated child"},
    {0, NULL}
};

static const value_string zbncp_keepalive_mode[] =
{
    {0, "ED_KEEPALIVE_DISABLED"},
    {1, "MAC_DATA_POLL_KEEPALIVE"},
    {2, "ED_TIMEOUT_REQUEST_KEEPALIVE"},
    {3, "BOTH_KEEPALIVE_METHODS"},
    {0, NULL}
};

static const value_string zbncp_stop_fast_poll_result[] =
{
    {0, "Not started"},
    {1, "Not stopped"},
    {2, "Stopped"},
    {0, NULL}
};

static const value_string zbncp_aps_addr_modes[] =
{
    {ZB_APSDE_DST_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT, "No addr, no EP"},
    {ZB_APSDE_DST_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT, "16-bit group addr, no EP"},
    {ZB_APSDE_DST_ADDR_MODE_16_ENDP_PRESENT, "16-bit short addr and EP"},
    {ZB_APSDE_DST_ADDR_MODE_64_ENDP_PRESENT, "64-bit ext addr and EP"},
    {ZB_APSDE_DST_ADDR_MODE_BIND_TBL_ID, "From the dst binding table"},
    {0, NULL}
};

static const value_string zbncp_cs[] =
{
    {1, "KEC Crypto-suite #1"},
    {2, "KEC Crypto-suite #2"},
    {0, NULL}
};

static const value_string zbncp_key_src[] =
{
    {0, "Unknown"},
    {1, "CBKE"},
    {0, NULL}
};

static const value_string zbncp_key_attr[] =
{
    {0, "Provisional key"},
    {1, "Unverified key"},
    {2, "Verified key"},
    {3, "Application key"},
    {0, NULL}
};

static const value_string zbncp_zdo_auth_types[] =
{
    {ZB_ZDO_AUTH_LEGACY_TYPE, "legacy"},
    {ZB_ZDO_AUTH_TCLK_TYPE, "TCLK"},
    {0, NULL}
};

static const value_string zbncp_zdo_leg_auth_status_codes[] =
{
    {0, "Authorization Success"},
    {1, "Authorization Failure"},
    {0, NULL}
};

static const value_string zbncp_zdo_tclk_auth_status_codes[] =
{
    {0, "Authorization Success"},
    {1, "Authorization Timeout"},
    {2, "Authorization Failure"},
    {0, NULL}
};

static const value_string zbncp_dump_type[] =
{
    {0, "Text"},
    {1, "Binary"},
    {0, NULL}
};

static const value_string zbncp_calibration_status[] =
{
    {0x00, "Customer value"},
    {0x01, "Default value"},
    {0x02, "Error"},
    {0, NULL}
};

static const value_string zbncp_force_route_record_sending_modes[] =
{
    {0x00, "Disabled"},
    {0x01, "Enabled"},
    {0, NULL}
};

static const true_false_string tfs_cinfo_device_type = {"FFD", "RFD"};
static const true_false_string tfs_cinfo_power_src = {"AC/Mains Power", "Battery"};

/* Returns changed offset */
static unsigned
dissect_zbncp_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
    unsigned status_category = tvb_get_uint8(tvb, offset);
    unsigned status;

    proto_tree_add_item(tree, hf_zbncp_data_hl_status_cat, tvb, offset, 1, ENC_NA);
    offset += 1;

    /* Add status */
    status = tvb_get_uint8(tvb, offset);
    switch (status_category)
    {
    case ZBNCP_HIGH_LVL_STAT_CAT_GENERIC:
        proto_tree_add_item(tree, hf_zbncp_data_hl_status_generic, tvb, offset, 1, ENC_NA);
        col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zbncp_hl_status_generic, "Unknown Status"));
        break;

    case ZBNCP_HIGH_LVL_STAT_CAT_MAC:
        proto_tree_add_item(tree, hf_zbncp_data_hl_status_mac, tvb, offset, 1, ENC_NA);
        col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_mac_state, "Unknown Status"));
        break;

    case ZBNCP_HIGH_LVL_STAT_CAT_NWK:
        proto_tree_add_item(tree, hf_zbncp_data_hl_status_nwk, tvb, offset, 1, ENC_NA);
        col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_nwk_state, "Unknown Status"));
        break;

    case ZBNCP_HIGH_LVL_STAT_CAT_APS:
        dissect_zbee_aps_status_code(tvb, pinfo, tree, offset);
        break;

    case ZBNCP_HIGH_LVL_STAT_CAT_CBKE:
        proto_tree_add_item(tree, hf_zbncp_data_hl_status_cbke, tvb, offset, 1, ENC_NA);
        col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_cbke_state, "Unknown Status"));
        break;

    default:
        proto_tree_add_item(tree, hf_zbncp_data_hl_status, tvb, offset, 1, ENC_NA);
        col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: 0x%x", status);
    }
    offset += 1;

    return offset;
}

static tvbuff_t *
dissect_zbncp_dump_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
    proto_tree *zbncp_dump_info_tree;
    unsigned idx, offset;
    uint8_t options;

    static int *const options_field[] = {
        &hf_zbncp_dump_options_dir,
        &hf_zbncp_dump_options_int_state,
        &hf_zbncp_dump_options_tx_conflict,
        NULL};

    /* check is it ZBNCP dump sign or not */
    for (idx = 0; idx < ZBNCP_DUMP_INFO_SIGN_SIZE; idx++)
    {
        if (tvb_get_uint8(tvb, idx) != ZBNCP_DUMP_INFO_SIGN[idx])
        {
            return tvb;
        }
    }

    /* Check type */
    if (tvb_get_uint8(tvb, ZBNCP_DUMP_INFO_SIGN_SIZE + 1) != ZBNCP_DUMP_INFO_NCP_TYPE)
    {
        return tvb;
    }

    zbncp_dump_info_tree = proto_tree_add_subtree(tree, tvb, 0, ZBNCP_DUMP_INFO_SIZE, ett_zbncp_dump, NULL, "ZBNCP Dump");

    proto_tree_add_item(zbncp_dump_info_tree, hf_zbncp_dump_preamble, tvb, 0, ZBNCP_DUMP_INFO_SIGN_SIZE, ENC_ASCII|ENC_NA);
    offset = ZBNCP_DUMP_INFO_SIGN_SIZE;

    proto_tree_add_item(zbncp_dump_info_tree, hf_zbncp_dump_version, tvb, offset, 1, ENC_NA);
    offset += 1;

    proto_tree_add_item(zbncp_dump_info_tree, hf_zbncp_dump_type, tvb, offset, 1, ENC_NA);
    offset += 1;

    /* options subtree */
    options = tvb_get_uint8(tvb, offset);
    proto_tree_add_bitmask(zbncp_dump_info_tree, tvb, offset, hf_zbncp_dump_options, ett_zbncp_dump_opt, options_field, ENC_NA);
    offset += 1;

    if (options & ZBNCP_DUMP_DIR_MASK)
    {
        col_set_str(pinfo->cinfo, COL_DEF_SRC, "NCP");
        col_set_str(pinfo->cinfo, COL_DEF_DST, "HOST");
    }
    else
    {
        col_set_str(pinfo->cinfo, COL_DEF_SRC, "HOST");
        col_set_str(pinfo->cinfo, COL_DEF_DST, "NCP");
    }

    if (options & ZBNCP_DUMP_POTENTIAL_TX_RX_ERROR_MASK)
    {
        col_append_str(pinfo->cinfo, COL_INFO, ", Potential RX/TX Conflict");
    }

    return tvb_new_subset_remaining(tvb, offset);
}

static unsigned
dissect_zbncp_high_level_hdr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint8_t *ptype, uint16_t *call_id)
{
    proto_tree *zbncp_comm_hdr_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_zbncp_hl_hdr, NULL, "High Level Header");

    /* Dissect common header */

    proto_tree_add_item(zbncp_comm_hdr_tree, hf_zbncp_data_hl_version, tvb, offset, 1, ENC_NA);
    offset += 1;

    *ptype = tvb_get_uint8(tvb, offset);
    proto_tree_add_item(zbncp_comm_hdr_tree, hf_zbncp_data_hl_packet_type, tvb, offset, 1, ENC_NA);
    offset += 1;

    *call_id = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
    proto_tree_add_item(zbncp_comm_hdr_tree, hf_zbncp_data_hl_call_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
    offset += 2;

    /* Update col */
    col_append_str(pinfo->cinfo, COL_INFO, val_to_str_const(*ptype, zbncp_hl_type, "Unknown Type"));
    col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", val_to_str_const(*call_id, zbncp_hl_call_id, "Unknown Call ID"));

    /* Dissect additional values */

    if (*ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST ||
        *ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
    {
        /* add TSN */
        proto_tree_add_item(zbncp_comm_hdr_tree, hf_zbncp_data_hl_tsn, tvb, offset, 1, ENC_NA);
        offset += 1;
    }

    if (*ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
    {
        offset = dissect_zbncp_status(tvb, pinfo, zbncp_comm_hdr_tree, offset);
    }

    return offset;
}

static void
dissect_zbncp_high_level(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint16_t *cmd_id)
{
    uint8_t packet_type;

    offset = dissect_zbncp_high_level_hdr(tvb, pinfo, tree, offset, &packet_type, cmd_id);

    dissect_zbncp_high_level_body(tvb, pinfo, tree, offset, packet_type, *cmd_id);
}

static void
dissect_zbncp_dst_addrs(proto_tree *zbncp_hl_body_tree, tvbuff_t *tvb, unsigned dst_addr_mode_offset, unsigned *offset)
{
    uint8_t dst_addr_mode = tvb_get_uint8(tvb, dst_addr_mode_offset);

    if (dst_addr_mode == ZB_APSDE_DST_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT || dst_addr_mode == ZB_APSDE_DST_ADDR_MODE_64_ENDP_PRESENT || dst_addr_mode == ZB_APSDE_DST_ADDR_MODE_BIND_TBL_ID)
    {
        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_ieee_addr, tvb, *offset, 8, ENC_NA);
        *offset += 8;
    }
    else if (dst_addr_mode == ZB_APSDE_DST_ADDR_MODE_16_GROUP_ENDP_NOT_PRESENT || dst_addr_mode == ZB_APSDE_DST_ADDR_MODE_16_ENDP_PRESENT)
    {
        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_nwk_addr, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
        *offset += 8;
    }
}

static void
dissect_zbncp_high_level_body(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint8_t ptype _U_, uint16_t cmd_id)
{
    proto_tree *zbncp_hl_body_tree;

    if (offset >= tvb_reported_length(tvb))
    {
        return;
    }

    zbncp_hl_body_tree = proto_tree_add_subtree_format(tree, tvb, offset, tvb_reported_length(tvb) - offset, ett_zbncp_hl_body, NULL, "Data");

    switch (cmd_id)
    {
    /* NCP Configuration API */
    case ZBNCP_CMD_GET_MODULE_VERSION:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_fw_vers, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_stack_vers, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_proto_vers, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_NCP_RESET:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_reset_opt, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_ZIGBEE_ROLE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_zb_role, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_ZIGBEE_ROLE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_zb_role, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_ZIGBEE_CHANNEL_MASK:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            unsigned i;
            uint8_t ch_list_len = tvb_get_uint8(tvb, offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ch_list_len, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (ch_list_len)
            {
                proto_tree *zbncp_hl_body_data_ch_list = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, ch_list_len * 5, ett_zbncp_data_ch_list, NULL, "Channel List");
                for (i = 0; i < ch_list_len; i++)
                {
                    proto_tree *zbncp_hl_body_data_channel_tree = proto_tree_add_subtree_format(
                        zbncp_hl_body_data_ch_list, tvb, offset, 5, ett_zbncp_data_channel, NULL, "Channel");

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
                    offset += 1;

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_ch_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
                    offset += 4;
                }
            }
        }
        break;

    case ZBNCP_CMD_SET_ZIGBEE_CHANNEL_MASK:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ch_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_GET_ZIGBEE_CHANNEL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_channel, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_PAN_ID:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pan_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_SET_PAN_ID:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pan_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_GET_LOCAL_IEEE_ADDR:
        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_int_num, tvb, offset, 1, ENC_NA);
        offset += 1;
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SET_LOCAL_IEEE_ADDR:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_int_num, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SET_TRACE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            static int *const trace_bitmask[] = {
                &hf_zbncp_data_trace_wireless_traf,
                &hf_zbncp_data_trace_reserved,
                &hf_zbncp_data_trace_ncp_ll_proto,
                &hf_zbncp_data_trace_host_int_line,
                &hf_zbncp_data_trace_sleep_awake,
                NULL};

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_trace_mask, ett_zbncp_data_trace_bitmask, trace_bitmask, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_GET_KEEPALIVE_TIMEOUT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_keepalive, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_SET_KEEPALIVE_TIMEOUT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_keepalive, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_GET_TX_POWER:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_res_tx_power, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_TX_POWER:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_req_tx_power, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_res_tx_power, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_RX_ON_WHEN_IDLE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rx_on_idle, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_RX_ON_WHEN_IDLE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rx_on_idle, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_JOINED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            static int *const join_bitmask[] = {
                &hf_zbncp_data_joined_bit,
                &hf_zbncp_data_parent_bit,
                NULL};

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_joined, ett_zbncp_data_joind_bitmask, join_bitmask, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_AUTHENTICATED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_authenticated, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_ED_TIMEOUT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_timeout, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_ED_TIMEOUT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_timeout, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ADD_VISIBLE_DEV:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_ADD_INVISIBLE_SHORT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_RM_INVISIBLE_SHORT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_SET_NWK_KEY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_key, tvb, offset, 16, ENC_NA);
            offset += 16;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_num, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_SERIAL_NUMBER:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_serial_num, tvb, offset, 16, ENC_NA);
            offset += 16;
        }
        break;

    case ZBNCP_CMD_GET_VENDOR_DATA:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            uint8_t size = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_size, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_vendor_data, tvb, offset, size, ENC_NA);
            offset += size;
        }
        break;

    case ZBNCP_CMD_GET_NWK_KEYS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_key, tvb, offset, 16, ENC_NA);
            offset += 16;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_num, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_key, tvb, offset, 16, ENC_NA);
            offset += 16;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_num, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_key, tvb, offset, 16, ENC_NA);
            offset += 16;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_num, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_APS_KEY_BY_IEEE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_key, tvb, offset, 16, ENC_NA);
            offset += 16;
        }
        break;

    case ZBNCP_CMD_BIG_PKT_TO_NCP:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            uint16_t pkt_len;

            pkt_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pkt_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pkt, tvb, offset, pkt_len, ENC_NA);
            offset += pkt_len;
        }
        break;

    case ZBNCP_CMD_GET_PARENT_ADDR:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_parent_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_GET_EXT_PAN_ID:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ext_pan_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_GET_COORDINATOR_VERSION:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_coordinator_version, tvb, offset++, 1, ENC_NA);
        }
        break;

    case ZBNCP_CMD_GET_SHORT_ADDRESS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_GET_TRUST_CENTER_ADDRESS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_trust_center_addres, tvb, offset, 8, ENC_NA);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_DEBUG_WRITE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            int dump_len;

            uint8_t dump_type = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dump_type, tvb, offset, 1, ENC_NA);
            offset += 1;

            dump_len = tvb_reported_length(tvb) - offset;
            if (dump_type == 0)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dump_text, tvb, offset, dump_len, ENC_ASCII | ENC_NA);
                offset += dump_len;
            }
            else if (dump_type == 1)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dump_bin, tvb, offset, dump_len, ENC_NA);
                offset += dump_len;
            }
        }
        break;

    case ZBNCP_CMD_GET_CONFIG_PARAMETER:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_parameter_id, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            uint8_t param_id;

            param_id = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_parameter_id, tvb, offset, 1, ENC_NA);
            offset += 1;

            switch (param_id)
            {
            case ZBNCP_PARAMETER_ID_IEEE_ADDR_TABLE_SIZE:
            case ZBNCP_PARAMETER_ID_NEIGHBOR_TABLE_SIZE:
            case ZBNCP_PARAMETER_ID_APS_SRC_BINDING_TABLE_SIZE:
            case ZBNCP_PARAMETER_ID_APS_GROUP_TABLE_SIZE:
            case ZBNCP_PARAMETER_ID_NWK_ROUTE_DISCOVERY_TABLE_SIZE:
            case ZBNCP_PARAMETER_ID_IOBUF_POOL_SIZE:
            case ZBNCP_PARAMETER_ID_PANID_TABLE_SIZE:
            case ZBNCP_PARAMETER_ID_APS_DUPS_TABLE_SIZE:
            case ZBNCP_PARAMETER_ID_APS_BIND_TRANS_TABLE_SIZE:
            case ZBNCP_PARAMETER_ID_N_APS_RETRANS_ENTRIES:
            case ZBNCP_PARAMETER_ID_NWK_MAX_HOPS:
            case ZBNCP_PARAMETER_ID_NIB_MAX_CHILDREN:
            case ZBNCP_PARAMETER_ID_N_APS_KEY_PAIR_ARR_MAX_SIZE:
            case ZBNCP_PARAMETER_ID_NWK_MAX_SRC_ROUTES:
            case ZBNCP_PARAMETER_ID_APS_MAX_WINDOW_SIZE:
            case ZBNCP_PARAMETER_ID_APS_INTERFRAME_DELAY:
            case ZBNCP_PARAMETER_ID_ZDO_ED_BIND_TIMEOUT:
            case ZBNCP_PARAMETER_ID_ZLL_DEFAULT_RSSI_THRESHOLD:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_value8_dec, tvb, offset, 1, ENC_NA);
                offset += 1;
                break;

            case ZBNCP_PARAMETER_ID_NIB_PASSIVE_ASK_TIMEOUT:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_value16_dec, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;
                break;

            case ZBNCP_PARAMETER_ID_APS_ACK_TIMEOUTS:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_ack_to_non_sleepy, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_ack_to_sleepy, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;
                break;

            case ZBNCP_PARAMETER_ID_MAC_BEACON_JITTER:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_min16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_max16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;
                break;

            case ZBNCP_PARAMETER_ID_TX_POWER:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_default8_sign, tvb, offset, 1, ENC_NA);
                offset += 1;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_current8_sign, tvb, offset, 1, ENC_NA);
                offset += 1;

                break;

            case ZBNCP_PARAMETER_ID_NIB_MTORR:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_is_concentrator, tvb, offset, 1, ENC_NA);
                offset += 1;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_concentrator_radius, tvb, offset, 1, ENC_NA);
                offset += 1;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_time16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;
                break;
            }
        }
        break;

    case ZBNCP_CMD_GET_LOCK_STATUS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_lock_status, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_TRACE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            static int *const trace_bitmask[] = {
                &hf_zbncp_data_trace_wireless_traf,
                &hf_zbncp_data_trace_ncp_ll_proto,
                &hf_zbncp_data_trace_host_int_line,
                &hf_zbncp_data_trace_sleep_awake,
                NULL};

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_trace_mask, ett_zbncp_data_trace_bitmask, trace_bitmask, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_NCP_RESET_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_reset_source, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_NWK_LEAVE_ALLOWED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_nwk_leave_allowed, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_NWK_LEAVE_ALLOWED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_nwk_leave_allowed, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NVRAM_WRITE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned dataset_count, idx;
            uint16_t dataset_len;

            dataset_count = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nvram_dataset_quantity, tvb, offset, 1, ENC_NA);
            offset += 1;

            /* multiple datasets */
            for (idx = 0; idx < dataset_count; idx++)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nvram_dataset_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dataset_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;

                dataset_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dataset_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nvram_dataset_data, tvb, offset, dataset_len, ENC_NA);
                offset += dataset_len;
            }
        }
        break;

    case ZBNCP_CMD_NVRAM_READ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nvram_dataset_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            uint16_t dataset_len;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nvram_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nvram_dataset_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dataset_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            dataset_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dataset_length, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nvram_dataset_data, tvb, offset, dataset_len, ENC_NA);
            offset += dataset_len;
        }
        break;

    case ZBNCP_CMD_SET_TC_POLICY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tc_policy_type, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tc_policy_value, tvb, offset + 2, 1, ENC_NA);
            offset += 3;
        }
        break;

    case ZBNCP_CMD_SET_EXTENDED_PAN_ID:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ext_pan_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SET_ED_CAPACITY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_ed_capacity, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_ED_CAPACITY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_ed_capacity, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_ZDO_LEAVE_ALLOWED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_leave_allowed, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_ZDO_LEAVE_ALLOWED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_leave_allowed, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_LEAVE_WO_REJOIN_ALLOWED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_leave_wo_rejoin_allowed, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_LEAVE_WO_REJOIN_ALLOWED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_leave_wo_rejoin_allowed, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GP_SET_SHARED_KEY_TYPE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_zgp_key_type, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GP_SET_DEFAULT_LINK_KEY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_zgp_link_key, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_PRODUCTION_CONFIG_READ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree *prod_conf_hdr_subtree;
            prod_conf_hdr_subtree = proto_tree_add_subtree(zbncp_hl_body_tree, tvb, offset, 8, ett_zbncp_data_prod_conf_hdr, NULL, "Production config header");

            proto_tree_add_item(prod_conf_hdr_subtree, hf_zbncp_data_prod_conf_hdr_crc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(prod_conf_hdr_subtree, hf_zbncp_data_prod_conf_hdr_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(prod_conf_hdr_subtree, hf_zbncp_data_prod_conf_hdr_version, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_prod_conf_body, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
            offset = tvb_captured_length(tvb);
        }
        break;

    case ZBNCP_CMD_SET_MAX_JOINS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_max_joins, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_MAX_JOINS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_max_joins, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_TRACE_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_trace_input_output, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_trace_timestamp, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_trace, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
            offset = tvb_captured_length(tvb);
        }
        break;

    case ZBNCP_CMD_GET_KEY_NEG_METHOD:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_neg_method, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_KEY_NEG_METHOD:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_neg_method, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_PSK_SECRETS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_psk_secrets, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_PSK_SECRETS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_psk_secrets, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_R22_JOIN_USAGE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_r22_join_usage, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_NWK_CONF_PRESET:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_conf_preset, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    /* AF API */
    case ZBNCP_CMD_AF_SET_SIMPLE_DESC:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint8_t in_cl_cnt;
            uint8_t out_cl_cnt;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_profile_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_device_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dev_version, tvb, offset, 1, ENC_NA);
            offset += 1;

            in_cl_cnt = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_in_cl_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            out_cl_cnt = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_out_cl_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (in_cl_cnt)
            {
                proto_tree *zbncp_hl_body_in_cl_list_tree =
                    proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, 2 * in_cl_cnt, ett_zbncp_data_in_cl_list, NULL, "Input Cluster List");
                for (i = 0; i < in_cl_cnt; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_in_cl_list_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                    offset += 2;
                }
            }

            if (out_cl_cnt)
            {
                proto_tree *zbncp_hl_body_out_cl_list_tree =
                    proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, 2 * out_cl_cnt, ett_zbncp_data_out_cl_list, NULL, "Output Cluster List");
                for (i = 0; i < out_cl_cnt; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_out_cl_list_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                    offset += 2;
                }
            }
        }
        break;

    case ZBNCP_CMD_AF_DEL_EP:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_AF_SET_NODE_DESC:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            /* copy-pasted from packet-ieee802154.c */
            static int *const capability[] = {
                &hf_ieee802154_cinfo_alt_coord,
                &hf_ieee802154_cinfo_device_type,
                &hf_ieee802154_cinfo_power_src,
                &hf_ieee802154_cinfo_idle_rx,
                &hf_ieee802154_cinfo_sec_capable,
                &hf_ieee802154_cinfo_alloc_addr,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_zb_role, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_mac_cap, ett_zbncp_data_mac_cap, capability, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_manuf_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_AF_SET_POWER_DESC:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            static int *const pwr_sources[] = {
                &hf_zbncp_data_pwr_src_const,
                &hf_zbncp_data_pwr_src_recharge,
                &hf_zbncp_data_pwr_src_disposable,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cur_pwr_mode, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_av_pwr_src, ett_zbncp_data_pwr_src, pwr_sources, ENC_NA);
            offset += 1;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_cur_pwr_src, ett_zbncp_data_cur_pwr_src, pwr_sources, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cur_pwr_lvl, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_AF_SUBGHZ_SUSPEND_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_susp_period, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_AF_SUBGHZ_RESUME_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_susp_period, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    /* ZDO API */
    case ZBNCP_CMD_ZDO_NWK_ADDR_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_req_type, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_start_idx, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_remote_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_remote_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            if (offset < tvb_reported_length(tvb))
            {
                uint8_t num_assoc_dev = tvb_get_uint8(tvb, offset);

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_num_asoc_dec, tvb, offset, 1, ENC_NA);
                offset += 1;

                if (num_assoc_dev)
                {
                    unsigned i;
                    proto_tree *zbncp_hl_body_asoc_nwk_list;

                    proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_start_idx, tvb, offset, 1, ENC_NA);
                    offset += 1;

                    zbncp_hl_body_asoc_nwk_list =
                        proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, 2 * num_assoc_dev, ett_zbncp_data_asoc_nwk_list, NULL, "Assoc Dev NWK Addr List");

                    for (i = 0; i < num_assoc_dev; i++)
                    {
                        proto_tree_add_item(zbncp_hl_body_asoc_nwk_list, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                        offset += 2;
                    }
                }
            }
        }
        break;

    case ZBNCP_CMD_ZDO_IEEE_ADDR_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_req_type, tvb, offset, 1, ENC_NA);
                offset += 1;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_start_idx, tvb, offset, 1, ENC_NA);
                offset += 1;
            }
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_remote_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_remote_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            if (offset < tvb_reported_length(tvb))
            {
                uint8_t num_assoc_dev = tvb_get_uint8(tvb, offset);

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_num_asoc_dec, tvb, offset, 1, ENC_NA);
                offset += 1;

                if (num_assoc_dev)
                {
                    unsigned i;
                    proto_tree *zbncp_hl_body_asoc_nwk_list;

                    proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_start_idx, tvb, offset, 1, ENC_NA);
                    offset += 1;

                    zbncp_hl_body_asoc_nwk_list =
                        proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, 2 * num_assoc_dev, ett_zbncp_data_asoc_nwk_list, NULL, "Assoc Dev NWK Addr List");

                    for (i = 0; i < num_assoc_dev; i++)
                    {
                        proto_tree_add_item(zbncp_hl_body_asoc_nwk_list, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                        offset += 2;
                    }
                }
            }
        }
        break;

    case ZBNCP_CMD_ZDO_POWER_DESC_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            static int *const pwr_desc[] = {
                &hf_zbncp_data_pwr_desc_cur_power_mode,
                &hf_zbncp_data_pwr_desc_av_pwr_src,
                &hf_zbncp_data_pwr_desc_cur_pwr_src,
                &hf_zbncp_data_pwr_desc_cur_pwr_lvl,
                NULL};

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_pwr_desc, ett_zbncp_data_pwr_desc, pwr_desc, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZDO_NODE_DESC_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            static int *const flags[] = {
                &hf_zbncp_data_flags_zb_role,
                &hf_zbncp_data_flags_comp_desc_av,
                &hf_zbncp_data_flags_user_desc_av,
                &hf_zbncp_data_flags_freq_868,
                &hf_zbncp_data_flags_freq_902,
                &hf_zbncp_data_flags_freq_2400,
                &hf_zbncp_data_flags_freq_eu_sub_ghz,
                NULL};

            static int *const mac_capability[] = {
                &hf_ieee802154_cinfo_alt_coord,
                &hf_ieee802154_cinfo_device_type,
                &hf_ieee802154_cinfo_power_src,
                &hf_ieee802154_cinfo_idle_rx,
                &hf_ieee802154_cinfo_sec_capable,
                &hf_ieee802154_cinfo_alloc_addr,
                NULL};

            static int *const server_mask[] = {
                &hf_zbncp_data_srv_msk_prim_tc,
                &hf_zbncp_data_srv_msk_backup_tc,
                &hf_zbncp_data_srv_msk_prim_bind_tbl_cache,
                &hf_zbncp_data_srv_msk_backup_bind_tbl_cache,
                &hf_zbncp_data_srv_msk_prim_disc_cache,
                &hf_zbncp_data_srv_msk_backup_disc_cache,
                &hf_zbncp_data_srv_msk_nwk_manager,
                &hf_zbncp_data_srv_msk_stack_compl_rev,
                NULL};

            static int *const desc_capability[] = {
                &hf_zbncp_data_desc_cap_ext_act_ep_list_av,
                &hf_zbncp_data_desc_cap_ext_simple_desc_list_av,
                NULL};

            proto_tree_add_bitmask_with_flags(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_flags16, ett_zbncp_data_flags, flags, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
            offset += 2;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_mac_cap, ett_zbncp_data_mac_cap, mac_capability, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_manuf_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_max_buf_size, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_max_inc_trans_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_bitmask_with_flags(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_srv_msk, ett_zbncp_data_server_mask, server_mask, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_max_out_trans_size, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_desc_cap, ett_zbncp_data_desc_cap, desc_capability, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZDO_SIMPLE_DESC_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            unsigned i;
            uint8_t in_cl_cnt;
            uint8_t out_cl_cnt;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_profile_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_device_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dev_version, tvb, offset, 1, ENC_NA);
            offset += 1;

            in_cl_cnt = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_in_cl_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            out_cl_cnt = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_out_cl_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (in_cl_cnt)
            {
                proto_tree *zbncp_hl_body_in_cl_list_tree =
                    proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, 2 * in_cl_cnt, ett_zbncp_data_in_cl_list, NULL, "Input Cluster List");
                for (i = 0; i < in_cl_cnt; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_in_cl_list_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                    offset += 2;
                }
            }

            if (out_cl_cnt)
            {
                proto_tree *zbncp_hl_body_out_cl_list_tree =
                    proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, 2 * out_cl_cnt, ett_zbncp_data_out_cl_list, NULL, "Output Cluster List");
                for (i = 0; i < out_cl_cnt; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_out_cl_list_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                    offset += 2;
                }
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZDO_ACTIVE_EP_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            unsigned i;
            uint8_t ep_cnt = tvb_get_uint8(tvb, offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ep_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (ep_cnt)
            {
                proto_tree *zbncp_hl_body_tree_ep_list =
                    proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, ep_cnt, ett_zbncp_data_ep_list, NULL, "Endpoint List");
                for (i = 0; i < ep_cnt; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_tree_ep_list, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
                    offset += 1;
                }
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZDO_MATCH_DESC_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint8_t in_cl_cnt;
            uint8_t out_cl_cnt;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_profile_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            in_cl_cnt = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_in_cl_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            out_cl_cnt = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_out_cl_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (in_cl_cnt)
            {
                proto_tree *zbncp_hl_body_in_cl_list_tree =
                    proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, 2 * in_cl_cnt, ett_zbncp_data_in_cl_list, NULL, "Input Cluster List");
                for (i = 0; i < in_cl_cnt; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_in_cl_list_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                    offset += 2;
                }
            }

            if (out_cl_cnt)
            {
                proto_tree *zbncp_hl_body_out_cl_list_tree =
                    proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, 2 * out_cl_cnt, ett_zbncp_data_out_cl_list, NULL, "Output Cluster List");
                for (i = 0; i < out_cl_cnt; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_out_cl_list_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                    offset += 2;
                }
            }
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            unsigned i;
            uint8_t ep_cnt = tvb_get_uint8(tvb, offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ep_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (ep_cnt)
            {
                proto_tree *zbncp_hl_body_tree_ep_list =
                    proto_tree_add_subtree_format(zbncp_hl_body_tree, tvb, offset, ep_cnt, ett_zbncp_data_ep_list, NULL, "Endpoint List");
                for (i = 0; i < ep_cnt; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_tree_ep_list, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
                    offset += 1;
                }
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZDO_BIND_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
            offset += 1;

            dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset - 1, &offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_UNBIND_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_ieee_addr, tvb, offset, 8, ENC_NA);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
            offset += 1;

            dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset - 1, &offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_MGMT_LEAVE_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            static int *const leave_flags[] = {
                &hf_zbncp_data_leave_flags_remove_chil,
                &hf_zbncp_data_leave_flags_rejoin,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_leave_flags, ett_zbncp_data_leave_flags, leave_flags, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_PERMIT_JOINING_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_permit_dur, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tc_sign, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_DEV_ANNCE_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            static int *const mac_capability[] = {
                &hf_ieee802154_cinfo_alt_coord,
                &hf_ieee802154_cinfo_device_type,
                &hf_ieee802154_cinfo_power_src,
                &hf_ieee802154_cinfo_idle_rx,
                &hf_ieee802154_cinfo_sec_capable,
                &hf_ieee802154_cinfo_alloc_addr,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_mac_cap, ett_zbncp_data_mac_cap, mac_capability, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_REJOIN:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint8_t ch_list_len;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ext_pan_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            ch_list_len = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ch_list_len, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (ch_list_len)
            {
                proto_tree *zbncp_hl_body_data_ch_list = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, ch_list_len * 5, ett_zbncp_data_ch_list, NULL, "Channel List");
                for (i = 0; i < ch_list_len; i++)
                {
                    proto_tree *zbncp_hl_body_data_channel_tree = proto_tree_add_subtree_format(
                        zbncp_hl_body_data_ch_list, tvb, offset, 5, ett_zbncp_data_channel, NULL, "Channel");

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
                    offset += 1;

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_ch_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
                    offset += 4;
                }
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_secur_rejoin, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            static int *const zdo_rejoin_flags[] = {
                &hf_zbncp_data_zdo_rejoin_flags_tcsw_happened,
                NULL};
            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_zdo_rejoin_flags, ett_zbncp_data_zdo_rejoin_flags, zdo_rejoin_flags, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_SYSTEM_SRV_DISCOVERY_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_server_mask, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZDO_MGMT_BIND_REQ:
    case ZBNCP_CMD_ZDO_MGMT_LQI_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_start_entry_idx, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_MGMT_NWK_UPDATE_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ch_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_scan_duration, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_scan_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_scan_mgr_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZDO_REMOTE_CMD_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            uint16_t data_len;
            static int *const aps_fc[] = {
                &hf_zbncp_data_aps_fc_deliv_mode,
                &hf_zbncp_data_aps_fc_secur,
                &hf_zbncp_data_aps_fc_ack_retrans,
                NULL};

            static int *const aps_key_attr[] = {
                &hf_zbncp_data_aps_key_attr_key_src,
                &hf_zbncp_data_aps_key_attr_key_used,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_param_len, tvb, offset, 1, ENC_NA);
            offset += 1;

            data_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_aps_fc, ett_zbncp_data_apc_fc, aps_fc, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_group_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_profile_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_mac_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_mac_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rssi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_aps_key_attr, ett_zbncp_data_aps_key_attr, aps_key_attr, ENC_NA);
            offset += 1;

            if (data_len > (tvb_reported_length(tvb) - offset))
            {
                data_len = tvb_reported_length(tvb) - offset;
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_array, tvb, offset, data_len, ENC_NA);
            offset += data_len;
        }
        break;

    case ZBNCP_CMD_ZDO_GET_STATS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_do_cleanup, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_max_rx_bcast, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_tx_bcast, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_rx_ucast, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_tx_ucast_total_zcl, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_tx_ucast_failures_zcl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_tx_ucast_retries_zcl, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_tx_ucast_total, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_tx_ucast_failures, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_tx_ucast_retries, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_phy_to_mac_que_lim_reached, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_validate_drop_cnt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_phy_cca_fail_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_period_of_time, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_last_msg_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_last_msg_rssi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_number_of_resets, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_tx_bcast, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_tx_ucast_success, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_tx_ucast_retry, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_tx_ucast_fail, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_route_disc_initiated, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_neighbor_added, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_neighbor_removed, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_neighbor_stale, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_join_indication, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_childs_removed, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_fc_failure, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_fc_failure, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_unauthorized_key, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_decrypt_failure, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_decrypt_failure, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_packet_buffer_allocate_failures, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_average_mac_retry_per_aps_message_sent, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_retry_overflow, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_bcast_table_full, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_status, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_DEV_AUTHORIZED_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            uint8_t auth_type;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            auth_type = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_auth_type, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (auth_type == ZB_ZDO_AUTH_LEGACY_TYPE)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_leg_auth_status_code, tvb, offset, 1, ENC_NA);
                offset += 1;
            }
            else if (auth_type == ZB_ZDO_AUTH_TCLK_TYPE)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_zdo_tclk_auth_status_code, tvb, offset, 1, ENC_NA);
                offset += 1;
            }
        }
        break;

    case ZBNCP_CMD_ZDO_DEV_UPDATE_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_upd_status_code, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZDO_SET_NODE_DESC_MANUF_CODE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_manuf_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_HL_ZDO_GET_DIAG_DATA_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rssi, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_HL_ZDO_RAW_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_raw_data, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
            offset = tvb_captured_length(tvb);
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_raw_data, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
            offset = tvb_captured_length(tvb);
        }
        break;

    case ZBNCP_CMD_HL_ZDO_SEND_CONF_PARAMS_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            static int *const parameters[] = {
                &hf_zbncp_data_conf_params_reserved,
                &hf_zbncp_data_conf_params_disable_pan_id_change,
                &hf_zbncp_data_conf_params_disable_channel_change,
                &hf_zbncp_data_conf_params_leave_request_allowed,
                &hf_zbncp_data_conf_params_require_tclk,
                &hf_zbncp_data_conf_params_restricted_enabled,
                NULL
            };
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_conf_params, ett_zbncp_data_conf_params, parameters, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_HL_ZDO_MGMT_BEACON_SURVEY_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint8_t ch_list_len;

            ch_list_len = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_channel_page_count, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (ch_list_len)
            {
                proto_tree *zbncp_hl_body_data_ch_list = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, ch_list_len * 4, ett_zbncp_data_ch_list, NULL, "Channel List");
                for (i = 0; i < ch_list_len; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_data_ch_list, hf_zbncp_data_ch_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
                    offset += 4;
                }
            }
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_config_mask, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dest_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            unsigned i;
            uint8_t parent_list_len;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_current_parents_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_current_parents_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            parent_list_len = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_potential_parent_count, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (parent_list_len)
            {
                proto_tree *zbncp_hl_body_data_parent_list = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, parent_list_len * 5, ett_zbncp_data_ch_list, NULL, "Potential Parent Surveys");
                for (i = 0; i < parent_list_len; i++)
                {
                    proto_tree *zbncp_hl_body_data_parent_tree = proto_tree_add_subtree_format(
                        zbncp_hl_body_data_parent_list, tvb, offset, 5, ett_zbncp_data_channel, NULL, "Parent");

                    proto_tree_add_item(zbncp_hl_body_data_parent_tree, hf_zbncp_data_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                    offset += 2;
                    proto_tree_add_item(zbncp_hl_body_data_parent_tree, hf_zbncp_data_rssi, tvb, offset, 1, ENC_NA);
                    offset += 1;
                    proto_tree_add_item(zbncp_hl_body_data_parent_tree, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
                    offset += 1;
                    proto_tree_add_item(zbncp_hl_body_data_parent_tree, hf_zbncp_data_classification_mask, tvb, offset, 1, ENC_NA);
                    offset += 1;
                }
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_total_beacons_surveyed, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_current_pan_id_beacons, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_current_nwk_potential_parents, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_other_zigbee_beacons, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pan_id_conflict_tlv, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_HL_ZDO_DECOMMISSION_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint8_t eui64_list_len;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dest_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            eui64_list_len = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_eui64_count, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (eui64_list_len)
            {
                proto_tree *zbncp_hl_body_data_parent_list = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, eui64_list_len * 8, ett_zbncp_data_ch_list, NULL, "EUI64s");
                for (i = 0; i < eui64_list_len; i++)
                {
                    proto_tree_add_item(zbncp_hl_body_data_parent_list, hf_zbncp_data_eui64, tvb, offset, 8, ENC_LITTLE_ENDIAN);
                    offset += 8;
                }
            }
        }
        break;

    case ZBNCP_CMD_HL_ZDO_GET_AUTH_LEVEL_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_target_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_target_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_initial_join_auth, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_update_method, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    /* APS API */
    case ZBNCP_CMD_APSDE_DATA_REQ:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            uint16_t data_len;
            static int *const tx_options[] = {
                &hf_zbncp_data_tx_opt_secur,
                &hf_zbncp_data_tx_opt_obsolete,
                &hf_zbncp_data_tx_opt_ack,
                &hf_zbncp_data_tx_opt_frag,
                &hf_zbncp_data_tx_opt_inc_ext_nonce,
                &hf_zbncp_data_tx_opt_force_mesh_route,
                &hf_zbncp_data_tx_opt_send_route_record,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_param_len, tvb, offset, 1, ENC_NA);
            offset += 1;

            data_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset + ZBNCP_CMD_APSDE_DATA_REQ_DST_ADDR_MODE_OFFSET, &offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_profile_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_radius, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_tx_opt, ett_zbncp_data_tx_opt, tx_options, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_use_alias, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_alias_src, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_alias_seq, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (data_len > (tvb_reported_length(tvb) - offset))
            {
                data_len = tvb_reported_length(tvb) - offset;
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_array, tvb, offset, data_len, ENC_NA);
            offset += data_len;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset + ZBNCP_CMD_APSDE_DATA_REQ_RSP_DST_ADDR_MODE_OFFSET, &offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tx_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_APSME_BIND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
            offset += 1;

            dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset - 1, &offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }

        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST || ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            uint16_t data_len;
            /* Binding table ID - it's an additional field for SNCP only */
            data_len = tvb_reported_length(tvb) - offset;
            if (data_len == 1)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 1, ENC_NA);
                offset += 1;
            }
        }
        break;

    case ZBNCP_CMD_APSME_UNBIND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
            offset += 1;

            dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset - 1, &offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }

        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST || ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            uint16_t data_len;
            /* Binding table ID - it's an additional field for SNCP only */
            data_len = tvb_reported_length(tvb) - offset;
            if (data_len == 1)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 1, ENC_NA);
                offset += 1;
            }
        }
        break;

    case ZBNCP_CMD_APSME_ADD_GROUP:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_group_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_APSME_RM_GROUP:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_group_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_APSDE_DATA_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            uint16_t data_len;
            static int *const aps_fc[] = {
                &hf_zbncp_data_aps_fc_deliv_mode,
                &hf_zbncp_data_aps_fc_secur,
                &hf_zbncp_data_aps_fc_ack_retrans,
                NULL};

            static int *const aps_key_attr[] = {
                &hf_zbncp_data_aps_key_attr_key_src,
                &hf_zbncp_data_aps_key_attr_key_used,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_param_len, tvb, offset, 1, ENC_NA);
            offset += 1;

            data_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_aps_fc, ett_zbncp_data_apc_fc, aps_fc, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_group_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_profile_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_mac_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_mac_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rssi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_aps_key_attr, ett_zbncp_data_aps_key_attr, aps_key_attr, ENC_NA);
            offset += 1;

            if (data_len > (tvb_reported_length(tvb) - offset))
            {
                data_len = tvb_reported_length(tvb) - offset;
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_array, tvb, offset, data_len, ENC_NA);
            offset += data_len;
        }
        break;

    case ZBNCP_CMD_APSME_RM_ALL_GROUPS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_APS_GET_GROUP_TABLE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            uint8_t group_num;
            group_num = tvb_get_int8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_group_num, tvb, offset++, 1, ENC_NA);

            if (group_num)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_group, tvb, offset, group_num * 2, ENC_LITTLE_ENDIAN);
                offset += group_num * 2;
            }
        }
        break;

    case ZBNCP_CMD_APSME_RM_BIND_ENTRY_BY_ID:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_APSME_CLEAR_BIND_TABLE:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_APSME_GET_BIND_ENTRY_BY_ID:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
            offset += 1;

            dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset - 1, &offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_bind_type, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_APSME_REMOTE_BIND_IND:
        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
        offset += 1;

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
        offset += 2;

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
        offset += 1;

        dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset - 1, &offset);

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
        offset += 1;

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 1, ENC_NA);
        offset += 1;

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_bind_type, tvb, offset, 1, ENC_NA);
        offset += 1;
        break;

    case ZBNCP_CMD_APSME_REMOTE_UNBIND_IND:
        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_src_endpoint, tvb, offset, 1, ENC_NA);
        offset += 1;

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cluster_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
        offset += 2;

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_addr_mode, tvb, offset, 1, ENC_NA);
        offset += 1;

        dissect_zbncp_dst_addrs(zbncp_hl_body_tree, tvb, offset - 1, &offset);

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dst_endpoint, tvb, offset, 1, ENC_NA);
        offset += 1;

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 1, ENC_NA);
        offset += 1;

        proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_bind_type, tvb, offset, 1, ENC_NA);
        offset += 1;
        break;

    case ZBNCP_CMD_APSME_SET_REMOTE_BIND_OFFSET:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_remote_bind_offset, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_APSME_GET_REMOTE_BIND_OFFSET:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_remote_bind_offset, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    /* NWK Management API*/
    case ZBNCP_CMD_NWK_FORMATION:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint8_t ch_list_len = tvb_get_uint8(tvb, offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ch_list_len, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (ch_list_len)
            {
                proto_tree *zbncp_hl_body_data_ch_list = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, ch_list_len * 5, ett_zbncp_data_ch_list, NULL, "Channel List");
                for (i = 0; i < ch_list_len; i++)
                {
                    proto_tree *zbncp_hl_body_data_channel_tree = proto_tree_add_subtree_format(
                        zbncp_hl_body_data_ch_list, tvb, offset, 5, ett_zbncp_data_channel, NULL, "Channel");

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
                    offset += 1;

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_ch_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
                    offset += 4;
                }
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_scan_dur, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_distr_nwk_flag, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ext_pan_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_NWK_DISCOVERY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint8_t ch_list_len = tvb_get_uint8(tvb, offset);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ch_list_len, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (ch_list_len)
            {
                proto_tree *zbncp_hl_body_data_ch_list = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, ch_list_len * 5, ett_zbncp_data_ch_list, NULL, "Channel List");
                for (i = 0; i < ch_list_len; i++)
                {
                    proto_tree *zbncp_hl_body_data_channel_tree = proto_tree_add_subtree_format(
                        zbncp_hl_body_data_ch_list, tvb, offset, 5, ett_zbncp_data_channel, NULL, "Channel");

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
                    offset += 1;

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_ch_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
                    offset += 4;
                }
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_scan_dur, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            unsigned i;
            uint8_t nwk_count = tvb_get_uint8(tvb, offset);
            static int *flags[] = {
                &hf_zbncp_data_flags_permit_join,
                &hf_zbncp_data_flags_router_cap,
                &hf_zbncp_data_flags_ed_cap,
                &hf_zbncp_data_flags_stack_profile,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_count, tvb, offset, 1, ENC_NA);
            offset += 1;

            for (i = 0; i < nwk_count; i++)
            {
                proto_tree *zbncp_hl_body_data_nwk_descr = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, 14, ett_zbncp_data_nwk_descr, NULL, "Network Descriptor");

                proto_tree_add_item(zbncp_hl_body_data_nwk_descr, hf_zbncp_data_ext_pan_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
                offset += 8;

                proto_tree_add_item(zbncp_hl_body_data_nwk_descr, hf_zbncp_data_pan_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;

                proto_tree_add_item(zbncp_hl_body_data_nwk_descr, hf_zbncp_data_nwk_upd_id, tvb, offset, 1, ENC_NA);
                offset += 1;

                proto_tree_add_item(zbncp_hl_body_data_nwk_descr, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
                offset += 1;

                proto_tree_add_item(zbncp_hl_body_data_nwk_descr, hf_zbncp_data_channel, tvb, offset, 1, ENC_NA);
                offset += 1;

                proto_tree_add_bitmask(zbncp_hl_body_data_nwk_descr, tvb, offset, hf_zbncp_data_flags8, ett_zbncp_data_flags, flags, ENC_NA);
                offset += 1;

                proto_tree_add_item(zbncp_hl_body_data_nwk_descr, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
                offset += 1;

                proto_tree_add_item(zbncp_hl_body_data_nwk_descr, hf_zbncp_data_rssi, tvb, offset, 1, ENC_NA);
                offset += 1;
            }
        }
        break;

    case ZBNCP_CMD_NWK_NLME_JOIN:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint8_t ch_list_len;
            static int *const mac_capability[] = {
                &hf_ieee802154_cinfo_alt_coord,
                &hf_ieee802154_cinfo_device_type,
                &hf_ieee802154_cinfo_power_src,
                &hf_ieee802154_cinfo_idle_rx,
                &hf_ieee802154_cinfo_sec_capable,
                &hf_ieee802154_cinfo_alloc_addr,
                NULL};

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ext_pan_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rejoin_nwk, tvb, offset, 1, ENC_NA);
            offset += 1;

            ch_list_len = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ch_list_len, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (ch_list_len)
            {
                proto_tree *zbncp_hl_body_data_ch_list = proto_tree_add_subtree_format(
                    zbncp_hl_body_tree, tvb, offset, ch_list_len * 5, ett_zbncp_data_ch_list, NULL, "Channel List");
                for (i = 0; i < ch_list_len; i++)
                {
                    proto_tree *zbncp_hl_body_data_channel_tree = proto_tree_add_subtree_format(
                        zbncp_hl_body_data_ch_list, tvb, offset, 5, ett_zbncp_data_channel, NULL, "Channel");

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
                    offset += 1;

                    proto_tree_add_item(zbncp_hl_body_data_channel_tree, hf_zbncp_data_ch_mask, tvb, offset, 4, ENC_LITTLE_ENDIAN);
                    offset += 4;
                }
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_scan_dur, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_bitmask(zbncp_hl_body_tree, tvb, offset, hf_zbncp_data_mac_cap, ett_zbncp_data_mac_cap, mac_capability, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_secur_en, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ext_pan_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_channel, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_enh_beacon, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_if, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_PERMIT_JOINING:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_permit_dur, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_GET_IEEE_BY_SHORT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_NWK_GET_SHORT_BY_IEEE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_NWK_GET_NEIGHBOR_BY_IEEE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_zb_role, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rx_on_idle, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ed_config, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_timeout_cnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dev_timeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_relationship, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tx_fail_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_out_cost, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_age, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_keepalive_rec, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_if_idx, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_REJOINED_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ext_pan_id, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_channel, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_beacon_type, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_if, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_REJOIN_FAILED_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            unsigned status_category = tvb_get_uint8(tvb, offset);
            unsigned status;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_cat, tvb, offset, 1, ENC_NA);
            offset += 1;

            /* Add status */
            status = tvb_get_uint8(tvb, offset);
            switch (status_category)
            {
            case ZBNCP_HIGH_LVL_STAT_CAT_GENERIC:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_generic, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zbncp_hl_status_generic, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_MAC:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_mac, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_mac_state, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_NWK:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_nwk, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_nwk_state, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_APS:
                dissect_zbee_aps_status_code(tvb, pinfo, zbncp_hl_body_tree, offset);
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_CBKE:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_cbke, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_cbke_state, "Unknown Status"));
                break;

            default:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: 0x%x", status);
            }
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_LEAVE_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rejoin, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_PIM_SET_FAST_POLL_INTERVAL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_fast_poll_int, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_PIM_SET_LONG_POLL_INTERVAL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_long_poll_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_PIM_START_FAST_POLL:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_PIM_START_POLL:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_PIM_SET_ADAPTIVE_POLL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_PIM_STOP_FAST_POLL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_stop_fast_poll_result, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_PIM_STOP_POLL:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_PIM_ENABLE_TURBO_POLL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_time, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_PIM_DISABLE_TURBO_POLL:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_NWK_GET_FIRST_NBT_ENTRY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_zb_role, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rx_on_idle, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ed_config, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_timeout_cnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dev_timeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_relationship, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tx_fail_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_out_cost, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_age, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_keepalive_rec, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_if_idx, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_GET_NEXT_NBT_ENTRY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_zb_role, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rx_on_idle, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ed_config, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_timeout_cnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dev_timeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_relationship, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tx_fail_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_out_cost, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_age, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_keepalive_rec, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_mac_if_idx, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_PAN_ID_CONFLICT_RESOLVE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            unsigned i;
            uint16_t pan_id_cnt = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pan_id_cnt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            for (i = 0; i < pan_id_cnt; i++)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pan_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;
            }
        }
        break;

    case ZBNCP_CMD_NWK_PAN_ID_CONFLICT_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            unsigned i;
            uint16_t pan_id_cnt = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pan_id_cnt, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            for (i = 0; i < pan_id_cnt; i++)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_pan_id, tvb, offset, 2, ENC_LITTLE_ENDIAN);
                offset += 2;
            }
        }
        break;

    case ZBNCP_CMD_NWK_ADDRESS_UPDATE_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_NWK_START_WITHOUT_FORMATION:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_NWK_NLME_ROUTER_START:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_beacon_order, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_superframe_order, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_battery_life_ext, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_PIM_SINGLE_POLL:
        /* Empty: only common headers  */
        break;

    case ZBNCP_CMD_PARENT_LOST_IND:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_PIM_START_TURBO_POLL_PACKETS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_poll_pkt_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_PIM_START_TURBO_POLL_CONTINUOUS:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_poll_timeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_PIM_TURBO_POLL_CONTINUOUS_LEAVE:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_PIM_TURBO_POLL_PACKETS_LEAVE:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_PIM_PERMIT_TURBO_POLL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_poll_permit_flag, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_PIM_SET_FAST_POLL_TIMEOUT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_poll_timeout, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_PIM_GET_LONG_POLL_INTERVAL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_long_poll_int, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_PIM_GET_IN_FAST_POLL_FLAG:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_fast_poll_flag, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SET_KEEPALIVE_MODE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_keepalive_mode, tvb, offset, 1, ENC_LITTLE_ENDIAN);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_START_CONCENTRATOR_MODE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_radius, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_time_between_disc, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_STOP_CONCENTRATOR_MODE:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_NWK_ENABLE_PAN_ID_CONFLICT_RESOLUTION:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_enable_flag, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_ENABLE_AUTO_PAN_ID_CONFLICT_RESOLUTION:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_enable_flag, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_PIM_TURBO_POLL_CANCEL_PACKET:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_SET_FORCE_ROUTE_RECORD:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_force_route_record_sending, tvb, offset, 1, ENC_LITTLE_ENDIAN);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_GET_FORCE_ROUTE_RECORD:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_force_route_record_sending, tvb, offset, 1, ENC_LITTLE_ENDIAN);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_NWK_NBR_ITERATOR_NEXT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_start_idx_16b, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_upd_idx, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_ZB_DEBUG_SIGNAL_TCLK_READY_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_ZB_DEVICE_READY_FOR_INTERVIEW_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZB_DEVICE_INTERVIEW_FINISHED_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_short_address, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_ZB_PREPARE_NETWORK_FOR_CHANNEL_PAN_ID_CHANGE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_next_pan_id_change, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_error_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZB_PREPARE_NETWORK_FOR_CHANNEL_CHANGE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_next_channel_change, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_error_count, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_ZB_START_CHANNEL_CHANGE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_next_channel_change, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_ZB_START_PAN_ID_CHANGE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_next_pan_id_change, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    /* Security API */
    case ZBNCP_CMD_SECUR_SET_LOCAL_IC:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic, tvb, offset, tvb_reported_length(tvb) - offset, ENC_NA);
            offset = tvb_reported_length(tvb);
        }
        break;

    case ZBNCP_CMD_SECUR_ADD_IC:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic, tvb, offset, tvb_reported_length(tvb) - offset, ENC_NA);
            offset = tvb_reported_length(tvb);
        }
        break;

    case ZBNCP_CMD_SECUR_DEL_IC:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SECUR_ADD_CERT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            uint8_t crypto_suite = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cs, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (crypto_suite == 1)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ca_pub_key, tvb, offset, 22, ENC_NA);
                offset += 22;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cert, tvb, offset, 48, ENC_NA);
                offset += 48;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ca_priv_key, tvb, offset, 21, ENC_NA);
                offset += 21;
            }
            else if (crypto_suite == 2)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ca_pub_key, tvb, offset, 37, ENC_NA);
                offset += 37;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cert, tvb, offset, 74, ENC_NA);
                offset += 74;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ca_priv_key, tvb, offset, 36, ENC_NA);
                offset += 36;
            }
        }
        break;

    case ZBNCP_CMD_SECUR_DEL_CERT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cs, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_issuer, tvb, offset, 8, ENC_NA);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SECUR_START_KE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cs, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            unsigned status_category = tvb_get_uint8(tvb, offset);
            unsigned status;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_cat, tvb, offset, 1, ENC_NA);
            offset += 1;

            /* Add status */
            status = tvb_get_uint8(tvb, offset);
            switch (status_category)
            {
            case ZBNCP_HIGH_LVL_STAT_CAT_GENERIC:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_generic, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zbncp_hl_status_generic, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_MAC:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_mac, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_mac_state, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_NWK:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_nwk, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_nwk_state, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_APS:
                dissect_zbee_aps_status_code(tvb, pinfo, zbncp_hl_body_tree, offset);
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_CBKE:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_cbke, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_cbke_state, "Unknown Status"));
                break;

            default:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: 0x%x", status);
            }
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SECUR_START_PARTNER_LK:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_SECUR_CBKE_SRV_FINISHED_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            unsigned status_category = tvb_get_uint8(tvb, offset);
            unsigned status;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_cat, tvb, offset, 1, ENC_NA);
            offset += 1;

            /* Add status */
            status = tvb_get_uint8(tvb, offset);
            switch (status_category)
            {
            case ZBNCP_HIGH_LVL_STAT_CAT_GENERIC:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_generic, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zbncp_hl_status_generic, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_MAC:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_mac, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_mac_state, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_NWK:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_nwk, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_nwk_state, "Unknown Status"));
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_APS:
                dissect_zbee_aps_status_code(tvb, pinfo, zbncp_hl_body_tree, offset);
                break;

            case ZBNCP_HIGH_LVL_STAT_CAT_CBKE:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status_cbke, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: %s", val_to_str_const(status, zb_cbke_state, "Unknown Status"));
                break;

            default:
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_hl_status, tvb, offset, 1, ENC_NA);
                col_append_fstr(pinfo->cinfo, COL_INFO, ", Status: 0x%x", status);
            }
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_nwk_addr, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SECUR_PARTNER_LK_FINISHED_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SECUR_KE_WHITELIST_ADD:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SECUR_KE_WHITELIST_DEL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SECUR_KE_WHITELIST_DEL_ALL:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_SECUR_JOIN_USES_IC:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic_en, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SECUR_GET_IC_BY_IEEE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic, tvb, offset, tvb_reported_length(tvb) - offset, ENC_NA);
            offset = tvb_reported_length(tvb);
        }
        break;

    case ZBNCP_CMD_SECUR_GET_CERT:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cs, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            uint8_t crypto_suite = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cs, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (crypto_suite == 1)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ca_pub_key, tvb, offset, 22, ENC_NA);
                offset += 22;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cert, tvb, offset, 48, ENC_NA);
                offset += 48;
            }
            else if (crypto_suite == 2)
            {
                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ca_pub_key, tvb, offset, 37, ENC_NA);
                offset += 37;

                proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_cert, tvb, offset, 74, ENC_NA);
                offset += 74;
            }
        }
        break;

    case ZBNCP_CMD_SECUR_GET_LOCAL_IC:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic, tvb, offset, tvb_reported_length(tvb) - offset, ENC_NA);
            offset = tvb_reported_length(tvb);
        }
        break;

    case ZBNCP_CMD_SECUR_TCLK_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_type, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SECUR_TCLK_EXCHANGE_FAILED_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            offset = dissect_zbncp_status(tvb, pinfo, zbncp_hl_body_tree, offset);
        }
        break;

    case ZBNCP_CMD_SECUR_GET_KEY_IDX:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_SECUR_GET_KEY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_link_key, tvb, offset, 16, ENC_NA);
            offset += 16;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_aps_link_key_type, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_src, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_key_attr, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_out_frame_cnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_inc_frame_cnt, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_partner_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_SECUR_ERASE_KEY:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_index, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_SECUR_CLEAR_KEY_TABLE:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_SECUR_NWK_INITIATE_KEY_SWITCH_PROCEDURE:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_SECUR_GET_IC_LIST:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_start_idx, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic_table_size, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_start_idx, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic_ent_cnt, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
            offset += tvb_captured_length(tvb) - offset;
        }
        break;

    case ZBNCP_CMD_SECUR_GET_IC_BY_IDX:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_entry_idx, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ic, tvb, offset, tvb_captured_length(tvb) - offset, ENC_NA);
            offset += tvb_captured_length(tvb) - offset;
        }
        break;

    case ZBNCP_CMD_SECUR_REMOVE_ALL_IC:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_SECUR_PARTNER_LK_ENABLE:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_enable, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_SECUR_AUTH_DEVICE_AFTER_INTERVIEW:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    case ZBNCP_CMD_ZDO_SECUR_UPDATE_DEVICE_TCLK:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_ieee_addr, tvb, offset, 8, ENC_LITTLE_ENDIAN);
            offset += 8;
        }
        break;

    /* Manufacturing Test API */
    case ZBNCP_CMD_MANUF_MODE_START:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_channel4, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_MANUF_MODE_END:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_MANUF_SET_CHANNEL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_channel4, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_MANUF_GET_CHANNEL:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_page, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_channel4, tvb, offset, 4, ENC_LITTLE_ENDIAN);
            offset += 4;
        }
        break;

    case ZBNCP_CMD_MANUF_SET_POWER:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tx_power, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_MANUF_GET_POWER:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_tx_power, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    case ZBNCP_CMD_MANUF_START_TONE:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_MANUF_STOP_TONE:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_MANUF_START_STREAM_RANDOM:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_seed, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;
        }
        break;

    case ZBNCP_CMD_MANUF_STOP_STREAM_RANDOM:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_NCP_HL_MANUF_SEND_SINGLE_PACKET:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            uint8_t data_len = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen8, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (data_len > (tvb_reported_length(tvb) - offset))
            {
                data_len = tvb_reported_length(tvb) - offset;
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_array, tvb, offset, data_len, ENC_NA);
            offset += data_len;
        }
        break;

    case ZBNCP_CMD_MANUF_START_TEST_RX:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_MANUF_STOP_TEST_RX:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_MANUF_RX_PACKET_IND:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_INDICATION)
        {
            uint16_t data_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_lqi, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_rssi, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (data_len > (tvb_reported_length(tvb) - offset))
            {
                data_len = tvb_reported_length(tvb) - offset;
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_array, tvb, offset, data_len, ENC_NA);
            offset += data_len;
        }
        break;

    /*  NCP FW upgrade API */
    case ZBNCP_CMD_OTA_RUN_BOOTLOADER:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_OTA_START_UPGRADE_IND:
        /* Empty: only common headers */
        break;

    case ZBNCP_CMD_OTA_SEND_PORTION_FW:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            uint16_t data_len = tvb_get_uint16(tvb, offset, ENC_LITTLE_ENDIAN);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            if (data_len > (tvb_reported_length(tvb) - offset))
            {
                data_len = tvb_reported_length(tvb) - offset;
            }

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_array, tvb, offset, data_len, ENC_NA);
            offset += data_len;
        }
        break;

    case ZBNCP_CMD_READ_NVRAM_RESERVED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen8, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        else if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            uint8_t data_len;

            data_len = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen8, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (data_len > (tvb_reported_length(tvb) - offset))
            {
                data_len = tvb_reported_length(tvb) - offset;
            }
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_array, tvb, offset, data_len, ENC_NA);
            offset += data_len;
        }
        break;

    case ZBNCP_CMD_WRITE_NVRAM_RESERVED:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_REQUEST)
        {
            uint8_t data_len;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_do_erase, tvb, offset, 1, ENC_NA);
            offset += 1;

            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN);
            offset += 2;

            data_len = tvb_get_uint8(tvb, offset);
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_dlen8, tvb, offset, 1, ENC_NA);
            offset += 1;

            if (data_len > (tvb_reported_length(tvb) - offset))
            {
                data_len = tvb_reported_length(tvb) - offset;
            }
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_array, tvb, offset, data_len, ENC_NA);
            offset += data_len;
        }
        break;

    case ZBNCP_CMD_GET_CALIBRATION_INFO:
        if (ptype == ZBNCP_HIGH_LVL_PACKET_TYPE_RESPONSE)
        {
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_calibration_status, tvb, offset, 1, ENC_NA);
            offset += 1;
            proto_tree_add_item(zbncp_hl_body_tree, hf_zbncp_data_calibration_value, tvb, offset, 1, ENC_NA);
            offset += 1;
        }
        break;

    default:;
    }

    /* Dump the tail. */
    if (offset < tvb_reported_length(tvb))
    {
        tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
        call_data_dissector(leftover_tvb, pinfo, tree);
    }
}

static void
dissect_zbncp_fragmentation_body(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset)
{
    proto_tree *zbncp_body_tree = proto_tree_add_subtree_format(tree, tvb, offset, tvb_reported_length(tvb) - offset, ett_zbncp_ll_body, NULL, "ZBNCP Packet Body");

    /* CRC */
    proto_tree_add_item(zbncp_body_tree, hf_zbncp_body_data_crc16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
    offset += 2;

    /* Dump the tail. */
    if (offset < tvb_reported_length(tvb))
    {
        tvbuff_t *leftover_tvb = tvb_new_subset_remaining(tvb, offset);
        call_data_dissector(leftover_tvb, pinfo, zbncp_body_tree);
    }
}

static void
dissect_zbncp_body(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, unsigned offset, uint16_t *cmd_id)
{
    proto_tree *zbncp_body_tree = proto_tree_add_subtree_format(tree, tvb, offset, tvb_reported_length(tvb) - offset, ett_zbncp_ll_body, NULL, "ZBNCP Packet Body");

    /* CRC */
    proto_tree_add_item(zbncp_body_tree, hf_zbncp_body_data_crc16, tvb, offset, 2, ENC_LITTLE_ENDIAN);
    offset += 2;

    dissect_zbncp_high_level(tvb, pinfo, zbncp_body_tree, offset, cmd_id);
}

static unsigned
dissect_zbncp_ll_hdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset, uint8_t *hdr_flags)
{
    proto_tree *ncp_ll_hdr_tree;
    proto_item *proto_root;

    static int *const packet_flags[] = {
        &hf_zbncp_hdr_flags_isack,
        &hf_zbncp_hdr_flags_retrans,
        &hf_zbncp_hdr_flags_packetseq,
        &hf_zbncp_hdr_flags_ackseq,
        &hf_zbncp_hdr_flags_first_frag,
        &hf_zbncp_hdr_flags_last_frag,
        NULL};

    if (tvb_get_uint8(tvb, 0) != ZBNCP_SIGN_FST_BYTE ||
        tvb_get_uint8(tvb, 1) != ZBNCP_SIGN_SEC_BYTE)
    {
        return 0;
    }

    col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZB NCP");

    proto_root = proto_tree_add_protocol_format(tree, zbncp_frame, tvb, 0, tvb_captured_length(tvb), "ZBNCP Low Level Header");
    ncp_ll_hdr_tree = proto_item_add_subtree(proto_root, ett_zbncp_hdr);

    /* hdr */
    proto_tree_add_item(ncp_ll_hdr_tree, hf_zbncp_hdr_sign, tvb, offset, 2, ENC_ASCII);
    offset += 2;

    /* pkt length without sign */
    proto_tree_add_item(ncp_ll_hdr_tree, hf_zbncp_packet_len, tvb, offset, 2, ENC_LITTLE_ENDIAN);
    offset += 2;

    /* hl packet type */
    proto_tree_add_item(ncp_ll_hdr_tree, hf_zbncp_hdr_type, tvb, offset, 1, ENC_NA);
    offset += 1;

    /* hdr flags */
    *hdr_flags = tvb_get_uint8(tvb, offset);
    proto_tree_add_bitmask(ncp_ll_hdr_tree, tvb, offset, hf_zbncp_hdr_flags, ett_zbncp_hdr_flags, packet_flags, ENC_NA);
    offset += 1;

    /* check is ack */
    if (*hdr_flags & ZBNCP_HDR_FLAGS_ISACK_MASK)
    {
        col_set_str(pinfo->cinfo, COL_INFO, "ACK");
    }

    /* crc 8 */
    proto_tree_add_item(ncp_ll_hdr_tree, hf_zbncp_hdr_crc8, tvb, offset++, 1, ENC_NA);

    return offset;
}

static unsigned
dissect_zbncp_packet(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, unsigned offset)
{
    uint8_t flags;
    uint16_t cmd_id;

    conversation_t *conversation;
    char *zbncp_ctx_str;

    flags = 0;
    offset = dissect_zbncp_ll_hdr(tvb, pinfo, tree, offset, &flags);

    if (!offset)
    {
        return 0;
    }

    if (offset < tvb_reported_length(tvb))
    {
        if (ZBNCP_GET_PACKET_FLAGS_FIRST_FRAG_BIT(flags))
        {
            /* No fragmentation or first fragment */
            dissect_zbncp_body(tvb, pinfo, tree, offset, &cmd_id);

            /* First fragment */
            if (!ZBNCP_GET_PACKET_FLAGS_LAST_FRAG_BIT(flags))
            {
                const char *tmp = val_to_str_const(cmd_id, zbncp_hl_call_id, "Unknown Call ID");
                zbncp_ctx_str = wmem_alloc(wmem_file_scope(), 64);

                if(zbncp_ctx_str != NULL)
                {
                    memcpy(zbncp_ctx_str, tmp, strlen(tmp) + 1);

                    conversation = conversation_new(pinfo->num,  &pinfo->src, &pinfo->dst,
                        conversation_pt_to_conversation_type(pinfo->ptype),
                        pinfo->srcport, pinfo->destport, 0);

                    conversation_add_proto_data(conversation, zbncp_frame, (void *)zbncp_ctx_str);
                }

                col_append_str(pinfo->cinfo, COL_INFO, ", first fragment");
            }
        }
        else /* It's fragmentation frame */
        {
            /* Fragmentation frame */
            dissect_zbncp_fragmentation_body(tvb, pinfo, tree, offset);

            conversation = find_conversation(pinfo->num, &pinfo->src, &pinfo->dst,
                conversation_pt_to_conversation_type(pinfo->ptype),
                pinfo->srcport, pinfo->destport, 0);

            if (conversation != NULL)
            {
                zbncp_ctx_str = (char *) conversation_get_proto_data(conversation, zbncp_frame);

                if (zbncp_ctx_str != NULL)
                {
                    col_append_fstr(pinfo->cinfo, COL_INFO, ", %s", zbncp_ctx_str);
                    conversation_delete_proto_data(conversation, zbncp_frame);
                }
            }

            if (ZBNCP_GET_PACKET_FLAGS_LAST_FRAG_BIT(flags))
            {
                col_append_str(pinfo->cinfo, COL_INFO, ", last fragment");
            }
            else
            {
                col_append_str(pinfo->cinfo, COL_INFO, ", fragment");
            }
        }
    }

    return tvb_captured_length(tvb);
}

/**
 * Dissector for ZBOSS NCP packet with an additional dump info.
 *
 * @param tvb pointer to buffer containing raw packet.
 * @param pinfo pointer to packet information fields.
 * @param tree pointer to data tree wireshark uses to display packet.
 */
static int
dissect_zbncp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    tvbuff_t *new_tvb;
    new_tvb = dissect_zbncp_dump_info(tvb, pinfo, tree);

    dissect_zbncp_packet(new_tvb, pinfo, tree, 0);

    return tvb_captured_length(tvb);
}

/**
 * Proto ZBOSS Network Coprocessor product registration routine
 */
void proto_register_zbncp(void)
{
    /* NCP protocol headers */
    static hf_register_info hf_zbncp_phy[] = {
        {&hf_zbncp_hdr_sign,
         {"Signature", "zbncp.hdr.sign", FT_UINT16, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_packet_len,
         {"Packet length", "zbncp.hdr.plen", FT_UINT16, BASE_DEC, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_hdr_type,
         {"Packet type", "zbncp.hdr.ptype", FT_UINT8, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_hdr_flags,
         {"Packet flags", "zbncp.hdr.flags", FT_UINT8, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_hdr_flags_isack,
         {"isACK", "zbncp.hdr.flags.isack", FT_BOOLEAN, 8, NULL,
          ZBNCP_HDR_FLAGS_ISACK_MASK, NULL, HFILL}},

        {&hf_zbncp_hdr_flags_retrans,
         {"Should retransmit", "zbncp.hdr.flags.retrans", FT_BOOLEAN, 8, NULL,
          ZBNCP_HDR_FLAGS_RETRANS_MASK, NULL, HFILL}},

        {&hf_zbncp_hdr_flags_packetseq,
         {"Packet#", "zbncp.hdr.flags.packet_seq", FT_UINT8, BASE_DEC, NULL,
          ZBNCP_HDR_FLAGS_PKT_SEQ_MASK, NULL, HFILL}},

        {&hf_zbncp_hdr_flags_ackseq,
         {"ACK#", "zbncp.hdr.flags.ack_seq", FT_UINT8, BASE_DEC, NULL,
          ZBNCP_HDR_FLAGS_ACK_SEQ_MASK, NULL, HFILL}},

        {&hf_zbncp_hdr_flags_first_frag,
         {"First fragment", "zbncp.hdr.flags.first_frag", FT_BOOLEAN, 8, NULL,
          ZBNCP_HDR_FLAGS_ISFIRST_MASK, NULL, HFILL}},

        {&hf_zbncp_hdr_flags_last_frag,
         {"Last fragment", "zbncp.hdr.flags.last_frag", FT_BOOLEAN, 8, NULL,
          ZBNCP_HDR_FLAGS_ISLAST_MASK, NULL, HFILL}},

        {&hf_zbncp_hdr_crc8,
         {"CRC8", "zbncp.hdr.crc8", FT_UINT8, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_body_data_crc16,
         {"CRC16", "zbncp.data.crc16", FT_UINT16, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_version,
         {"Version", "zbncp.data.hl.vers", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_packet_type,
         {"Packet type", "zbncp.data.hl.ptype", FT_UINT8, BASE_HEX, VALS(zbncp_hl_type), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_call_id,
         {"Call/evt id", "zbncp.data.hl.id", FT_UINT16, BASE_HEX, VALS(zbncp_hl_call_id), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_tsn,
         {"TSN", "zbncp.data.hl.tsn", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_status_cat,
         {"Status category", "zbncp.data.hl.status_cat", FT_UINT8, BASE_HEX, VALS(zbncp_hl_status_cat), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_status,
         {"Status", "zbncp.data.hl.status", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_status_generic,
         {"Status", "zbncp.data.hl.status", FT_UINT8, BASE_HEX, VALS(zbncp_hl_status_generic), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_status_mac,
         {"Status", "zbncp.data.hl.status", FT_UINT8, BASE_HEX, VALS(zb_mac_state), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_status_nwk,
         {"Status", "zbncp.data.hl.status", FT_UINT8, BASE_HEX, VALS(zb_nwk_state), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_hl_status_cbke,
         {"Status", "zbncp.data.hl.status", FT_UINT8, BASE_HEX, VALS(zb_cbke_state), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_fw_vers,
         {"FW Version", "zbncp.data.fw_vers", FT_UINT32, BASE_HEX, NULL, 0x0, "NCP module firmware version", HFILL}},

        {&hf_zbncp_data_stack_vers,
         {"Stack Version", "zbncp.data.stack_vers", FT_UINT32, BASE_HEX, NULL, 0x0, "NCP module stack version", HFILL}},

        {&hf_zbncp_data_proto_vers,
         {"Protocol Version", "zbncp.data.proto_vers", FT_UINT32, BASE_HEX, NULL, 0x0, "NCP module protocol version", HFILL}},

        {&hf_zbncp_data_reset_opt,
         {"Options", "zbncp.data.rst_opt", FT_UINT8, BASE_HEX, VALS(zbncp_reset_opt), 0x0, "Force NCP module reboot", HFILL}},

        {&hf_zbncp_data_zb_role,
         {"Zigbee role", "zbncp.data.zb_role", FT_UINT8, BASE_HEX, VALS(zbncp_zb_role), 0x0, "Zigbee role code", HFILL}},

        {&hf_zbncp_data_ch_list_len,
         {"Channel list length", "zbncp.data.ch_list_len", FT_UINT8, BASE_HEX, NULL, 0x0, "Number of entries in the following Channel List array", HFILL}},

        {&hf_zbncp_data_page,
         {"Channel page", "zbncp.data.page", FT_UINT8, BASE_DEC_HEX, VALS(zboss_page_names), 0x0,
          "IEEE802.15.4 page number", HFILL}},

        {&hf_zbncp_data_ch_mask,
         {"Channel mask", "zbncp.data.ch_mask", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_channel,
         {"Channel", "zbncp.data.mask", FT_UINT8, BASE_DEC, NULL, 0x0,
          "Channel number", HFILL}},

        {&hf_zbncp_data_channel4,
         {"Channel", "zbncp.data.mask", FT_UINT32, BASE_DEC, NULL, 0x0,
          "Channel number", HFILL}},

        {&hf_zbncp_data_pan_id,
         {"PAN ID", "zbncp.data.pan_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_index,
         {"Index", "zbncp.data.index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_enable,
         {"Enable", "zbncp.data.enable", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_bind_type,
         {"Bind Type", "zbncp.data.bind_type", FT_UINT8, BASE_DEC, VALS(zbncp_bind_type_vals), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_int_num,
         {"MAC Interface Num", "zbncp.data.mac_int_num", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_ext_pan_id,
         {"Ext PAN ID", "zbncp.data.ext_pan_id", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_coordinator_version,
         {"Coordinator version", "zbncp.data.coord_version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_trust_center_addres,
         {"IEEE trust center address", "zbncp.data.ieee_trust_center_addr", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_ieee_addr,
         {"IEEE address", "zbncp.data.ieee_addr", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_remote_ieee_addr,
         {"Remote IEEE address", "zbncp.data.rmt_ieee_addr", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_src_ieee_addr,
         {"Source IEEE address", "zbncp.data.src_ieee_addr", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dst_ieee_addr,
         {"Destination IEEE address", "zbncp.data.dst_ieee_addr", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_target_ieee_addr,
         {"Target IEEE address", "zbncp.data.target_ieee_addr", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_partner_ieee_addr,
         {"Partner IEEE address", "zbncp.data.partner_ieee_addr", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_keepalive,
         {"Keepalive Timeout", "zbncp.data.keepalive", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_force_route_record_sending,
         {"Force route record sending mode", "zbncp.data.force_route_rec_mode", FT_UINT8, BASE_DEC, VALS(zbncp_force_route_record_sending_modes), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_rx_on_idle,
         {"Rx On When Idle", "zbncp.data.rx_on_idle", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_res_tx_power,
         {"Resultant TX power", "zbncp.data.tx_power", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_req_tx_power,
         {"Required TX power", "zbncp.data.tx_power", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_joined,
         {"Joined", "zbncp.data.joined", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_joined_bit,
         {"Device is joined", "zbncp.data.device_is_joined", FT_BOOLEAN, 8, NULL, 0x1, NULL, HFILL}},

        {&hf_zbncp_data_parent_bit,
         {"Parent is lost", "zbncp.data.parent_is_lost", FT_BOOLEAN, 8, NULL, 0x2, NULL, HFILL}},

        {&hf_zbncp_data_authenticated,
         {"Authenticated", "zbncp.data.auth", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_timeout,
         {"Timeout", "zbncp.data.timeout", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_addr,
         {"NWK address", "zbncp.data.nwk_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_parent_addr,
         {"NWK parent address", "zbncp.data.nwk_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dst_nwk_addr,
         {"Destination NWK address", "zbncp.data.dst_nwk_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_src_nwk_addr,
         {"Source NWK address", "zbncp.data.src_nwk_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_remote_nwk_addr,
         {"Remote NWK address", "zbncp.data.rmt_nwk_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_group_nwk_addr,
         {"Group NWK address", "zbncp.data.group_nwk_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_src_mac_addr,
         {"Source MAC address", "zbncp.data.src_mac_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dst_mac_addr,
         {"Destination MAC address", "zbncp.data.dst_mac_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_key,
         {"NWK Key", "zbncp.data.nwk_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_key_num,
         {"Key number", "zbncp.data.key_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_serial_num,
         {"Serial number", "zbncp.data.serial_num", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_size,
         {"Size", "zbncp.data.size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_parameter_id,
         {"Parameter ID", "zbncp.data.param_id", FT_UINT8, BASE_DEC, VALS(zbncp_parameter_id_list), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_value8_dec,
         {"Value", "zbncp.data.value", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_value16_dec,
         {"Value", "zbncp.data.value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_ack_to_non_sleepy,
         {"Value (for non-sleepy dev)", "zbncp.data.non_sleepy_value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_ack_to_sleepy,
         {"Value (for sleepy dev)", "zbncp.data.sleepy_value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_min16,
         {"Min", "zbncp.data.min_value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_max16,
         {"Max", "zbncp.data.max_value", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_default8_sign,
         {"Default", "zbncp.data.default_val", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_current8_sign,
         {"Current", "zbncp.data.current_val", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_is_concentrator,
         {"Is concentrator", "zbncp.data.is_conc", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_concentrator_radius,
         {"Concentrator radius", "zbncp.data.conc_rad", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_time16,
         {"Time", "zbncp.data.conc_time", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_lock_status,
         {"Locking status", "zbncp.data.lock_status", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_nwk_leave_allowed,
         {"NWK Leave Allowed", "zbncp.data.nwk_leave_allow", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nvram_dataset_quantity,
         {"Dataset quantity", "zbncp.data.nvram_dataset_quantity", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nvram_dataset_type,
         {"NVRAM Database type", "zbncp.data.nvram_database_type", FT_UINT16, BASE_HEX, VALS(zb_nvram_database_types), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nvram_version,
         {"NVRAM Version", "zbncp.data.nvram_version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dataset_version,
         {"NVRAM Dataset Version", "zbncp.data.dataset_version", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dataset_length,
         {"NVRAM Dataset size", "zbncp.data.dataset_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nvram_dataset_data,
         {"NVRAM Dataset data", "zbncp.data.dataset_data", FT_UINT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_tc_policy_type,
         {"Trust center policy type", "zbncp.data.tc_policy_type", FT_UINT16, BASE_HEX, VALS(zbncp_tc_policy_types), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_tc_policy_value,
         {"Trust center policy value", "zbncp.data.tc_policy_value", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_ed_capacity,
         {"Number of children", "zbncp.data.num_children", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_max_joins,
         {"Max successfull join attempts", "zbncp.data.max_joins", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_leave_allowed,
         {"ZDO Leave Allowed", "zbncp.data.zdo_leave_allow", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_leave_wo_rejoin_allowed,
         {"ZDO Leave Without Rejoin Allowed", "zbncp.data.zdo_leave_wo_rejoin_allow", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_reset_source,
         {"Reset source", "zbncp.data.rst_src", FT_UINT8, BASE_DEC, VALS(zbncp_rst_src_list), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_vendor_data,
         {"Vendor data", "zbncp.data.vendor_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_aps_key,
         {"APS Key", "zbncp.data.aps_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_endpoint,
         {"Endpoint", "zbncp.data.endpoint", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_group_num,
         {"APS group number", "zbncp.data.aps_group_num", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_group,
         {"APS group", "zbncp.data.aps_group", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_src_endpoint,
         {"Source Endpoint", "zbncp.data.src_endpoint", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dst_endpoint,
         {"Destination Endpoint", "zbncp.data.dst_endpoint", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_poll_pkt_cnt,
         {"Packet count", "zbncp.data.poll_pkt_cnt", FT_UINT8, BASE_DEC, NULL, 0x0, "The number of packets to poll", HFILL}},

        {&hf_zbncp_data_poll_timeout,
         {"Poll Timeout", "zbncp.data.poll_timeout", FT_UINT32, BASE_DEC, NULL, 0x0, "The duration of poll in ms", HFILL}},

        {&hf_zbncp_data_poll_permit_flag,
         {"Permit flag", "zbncp.data.poll_permit_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_profile_id,
         {"Profile ID", "zbncp.data.profile_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_device_id,
         {"Device ID", "zbncp.data.device_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dev_version,
         {"Device Version", "zbncp.data.dev_vers", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_in_cl_cnt,
         {"Input Cluster Count", "zbncp.data.in_cl_cnt", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_out_cl_cnt,
         {"Output Cluster Count", "zbncp.data.out_cl_cnt", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_cluster_id,
         {"Cluster ID", "zbncp.data.cluster_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_cap,
         {"MAC capability", "zbncp.data.mac_cap", FT_UINT8, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_data_manuf_id,
         {"Manufacturer ID", "zbncp.data.manuf_id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_cur_pwr_mode,
         {"Current Power Mode", "zbncp.data.pwr_mode", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_cur_pwr_lvl,
         {"Current Power Level", "zbncp.data.pwr_lvl", FT_UINT8, BASE_DEC, VALS(zbncp_power_level), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_susp_period,
         {"Suspension Period", "zbncp.data.susp_period", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_av_pwr_src,
         {"Available Power Sources", "zbncp.data.av_pwr_src", FT_UINT8, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_data_cur_pwr_src,
         {"Current Power Source", "zbncp.data.cur_pwr_src", FT_UINT8, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_data_pwr_src_const,
         {"Constant (mains) power", "zbncp.data.pwr_src_const", FT_BOOLEAN, 8, NULL,
          0x01, NULL, HFILL}},

        {&hf_zbncp_data_pwr_src_recharge,
         {"Rechargeable battery", "zbncp.data.pwr_src_recharge", FT_BOOLEAN, 8, NULL,
          0x02, NULL, HFILL}},

        {&hf_zbncp_data_pwr_src_disposable,
         {"Disposable battery", "zbncp.data.pwr_src_disp", FT_BOOLEAN, 8, NULL,
          0x04, NULL, HFILL}},

        {&hf_zbncp_data_req_type,
         {"Request Type", "zbncp.data.nwk_req_type", FT_UINT8, BASE_DEC, VALS(zbncp_nwk_req_type), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_start_idx,
         {"Start Index", "zbncp.data.start_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_start_idx_16b,
         {"Start Index", "zbncp.data.start_idx", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_upd_idx,
         {"Update Index", "zbncp.data.update_idx", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_entry_idx,
         {"Entry Index", "zbncp.data.entry_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_num_asoc_dec,
         {"Num Assoc Dev", "zbncp.data.num_asoc_dev", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_pwr_desc,
         {"Power Descriptor", "zbncp.data.pwr_desc", FT_UINT16, BASE_HEX, NULL,
          0x0, NULL, HFILL}},

        {&hf_zbncp_data_pwr_desc_cur_power_mode,
         {"Current Power Mode", "zbncp.data.pwr_desc.pwr_mode", FT_UINT16, BASE_DEC, NULL,
          0x000F, NULL, HFILL}},

        {&hf_zbncp_data_pwr_desc_av_pwr_src,
         {"Available Power Sources", "zbncp.data.pwr_desc.av_pwr_src", FT_UINT16, BASE_DEC, NULL,
          0x00F0, NULL, HFILL}}, /* todo */

        {&hf_zbncp_data_pwr_desc_cur_pwr_src,
         {"Current Power Sources", "zbncp.data.pwr_desc.cur_pwr_src", FT_UINT16, BASE_DEC, NULL,
          0x0F00, NULL, HFILL}}, /* todo */

        {&hf_zbncp_data_pwr_desc_cur_pwr_lvl,
         {"Current Power Level", "zbncp.data.cur_pwr_lvl", FT_UINT16, BASE_DEC, VALS(zbncp_power_level),
          0xF000, NULL, HFILL}},

        {&hf_zbncp_data_max_buf_size,
         {"Max buffer size", "zbncp.data.max_buf_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_max_inc_trans_size,
         {"Max Incoming transfer size", "zbncp.data.max_inc_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_max_out_trans_size,
         {"Max Outgoing transfer size", "zbncp.data.max_out_size", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_desc_cap,
         {"Descriptor Capabilities", "zbncp.data.desc_cap", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_desc_cap_ext_act_ep_list_av,
         {"Extended Active Endpoint List Available", "zbncp.data.desc_cap.active_ep_list", FT_BOOLEAN, 8, NULL,
          0x1, NULL, HFILL}},

        {&hf_zbncp_data_desc_cap_ext_simple_desc_list_av,
         {"Extended Simple Descriptor List Available", "zbncp.data.desc_cap.simple_desc_list", FT_BOOLEAN, 8, NULL,
          0x2, NULL, HFILL}},

        {&hf_zbncp_data_flags8,
         {"Flags", "zbncp.data.flags8", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_flags_permit_join,
         {"Permit Joining", "zbncp.data.flags.perm_join", FT_BOOLEAN, 8, NULL,
          0x1, NULL, HFILL}},

        {&hf_zbncp_data_flags_router_cap,
         {"Router capacity", "zbncp.data.flags.router_cap", FT_BOOLEAN, 8, NULL,
          0x2, NULL, HFILL}},

        {&hf_zbncp_data_flags_ed_cap,
         {"ED capacity", "zbncp.data.flags.ed_cap", FT_BOOLEAN, 8, NULL,
          0x4, NULL, HFILL}},

        {&hf_zbncp_data_flags_stack_profile,
         {"Stack profile", "zbncp.data.flags.stack_profile", FT_UINT8, BASE_DEC, NULL,
          0xF0, NULL, HFILL}},

        {&hf_zbncp_data_flags16,
         {"Flags", "zbncp.data.flags16", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_flags_zb_role,
         {"Zigbee role", "zbncp.data.flags.zb_role", FT_UINT16, BASE_HEX, VALS(zbncp_zb_role),
          0x7, NULL, HFILL}},

        {&hf_zbncp_data_flags_comp_desc_av,
         {"Complex desc available", "zbncp.data.flags.comp_desc_av", FT_BOOLEAN, 16, NULL,
          0x8, NULL, HFILL}},

        {&hf_zbncp_data_flags_user_desc_av,
         {"User desc available", "zbncp.data.flags.user_desc_av", FT_BOOLEAN, 16, NULL,
          0x0010, NULL, HFILL}},

        {&hf_zbncp_data_flags_freq_868,
         {"868MHz BPSK Band", "zbncp.data.flags.freq.868mhz", FT_BOOLEAN, 16, NULL,
          0x0800, NULL, HFILL}},

        {&hf_zbncp_data_flags_freq_902,
         {"902MHz BPSK Band", "zbncp.data.flags.freq.902mhz", FT_BOOLEAN, 16, NULL,
          0x2000, NULL, HFILL}},

        {&hf_zbncp_data_flags_freq_2400,
         {"2.4GHz OQPSK Band", "zbncp.data.flags.freq.2400mhz", FT_BOOLEAN, 16, NULL,
          0x4000, NULL, HFILL}},

        {&hf_zbncp_data_flags_freq_eu_sub_ghz,
         {"EU Sub-GHz FSK Band", "zbncp.data.flags.freq.eu_sub_ghz", FT_BOOLEAN, 16, NULL,
          0x8000, NULL, HFILL}},

        {&hf_zbncp_data_srv_msk,
         {"Server mask", "zbncp.data.srv_msk", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_srv_msk_prim_tc,
         {"Primary Trust Center", "zbncp.data.srv_msk.prim_tc", FT_BOOLEAN, 16, NULL,
          0x0001, NULL, HFILL}},

        {&hf_zbncp_data_srv_msk_backup_tc,
         {"Backup Trust Center", "zbncp.data.srv_msk.backup_tc", FT_BOOLEAN, 16, NULL,
          0x0002, NULL, HFILL}},

        {&hf_zbncp_data_srv_msk_prim_bind_tbl_cache,
         {"Primary Binding Table Cache", "zbncp.data.srv_msk.prim_bind_tbl_cache", FT_BOOLEAN, 16, NULL,
          0x0004, NULL, HFILL}},

        {&hf_zbncp_data_srv_msk_backup_bind_tbl_cache,
         {"Backup Binding Table Cache", "zbncp.data.srv_msk.backup_bind_tbl_cache", FT_BOOLEAN, 16, NULL,
          0x0008, NULL, HFILL}},

        {&hf_zbncp_data_remote_bind_offset,
         {"Remote Bind Offset", "zbncp.data.remote_bind_access", FT_UINT8, BASE_HEX, NULL,
          0x0,
          "Remote bind offset, divides the bind table in two parts [0:remote_bind_offset) are for localbindings and "
          "[remote_bind_offset:tbl_size) to remote bindings",
          HFILL}},

        {&hf_zbncp_data_srv_msk_prim_disc_cache,
         {"Primary Discovery Cache", "zbncp.data.srv_msk.prim_disc_cache", FT_BOOLEAN, 16, NULL,
          0x0010, NULL, HFILL}},

        {&hf_zbncp_data_srv_msk_backup_disc_cache,
         {"Backup Discovery Cache", "zbncp.data.srv_msk.backup_disc_cache", FT_BOOLEAN, 16, NULL,
          0x0020, NULL, HFILL}},

        {&hf_zbncp_data_srv_msk_nwk_manager,
         {"Network Manager", "zbncp.data.srv_msk.nwk_manager", FT_BOOLEAN, 16, NULL,
          0x0040, NULL, HFILL}},

        {&hf_zbncp_data_srv_msk_stack_compl_rev,
         {"Stack Compliance Revision", "zbncp.data.srv_msk.stack_compl_rev", FT_UINT16, BASE_DEC, NULL,
          0xFE00, NULL, HFILL}},

        {&hf_zbncp_data_ep_cnt,
         {"Endpoint Count", "zbncp.data.endpoint_cnt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dst_addr_mode,
         {"Dst Address Mode", "zbncp.data.dst_addr_mode", FT_UINT8, BASE_HEX, VALS(zbncp_aps_addr_modes), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_leave_flags,
         {"Leave flags", "zbncp.data.leave_flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_leave_flags_remove_chil,
         {"Remove children", "zbncp.data.leave_flags.remove_chil", FT_BOOLEAN, 8, NULL,
          0x40, NULL, HFILL}},

        {&hf_zbncp_data_leave_flags_rejoin,
         {"Rejoin", "zbncp.data.leave_flags.rejoin", FT_BOOLEAN, 8, NULL,
          0x80, NULL, HFILL}},

        {&hf_zbncp_data_permit_dur,
         {"Permit Duration", "zbncp.data.permit_dur", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_tc_sign,
         {"TC Significance", "zbncp.data.tc_sign", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_secur_rejoin,
         {"Secure Rejoin", "zbncp.data.secure_rejoin", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_zdo_rejoin_flags,
         {"Flags", "zbncp.data.zdo_rejoin.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_zdo_rejoin_flags_tcsw_happened,
         {"Trust Center Swap-out happened", "zbncp.data.zdo_rejoin.flags.tcsw_happened", FT_BOOLEAN, 8, NULL,
          0x01, NULL, HFILL}},

        {&hf_zbncp_data_dlen8,
         {"Data Length", "zbncp.data.dlen8", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dlen16,
         {"Data Length", "zbncp.data.dlen16", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_param_len,
         {"Param Length", "zbncp.data.param_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_radius,
         {"Radius", "zbncp.data.radius", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_time_between_disc,
         {"Time between discoveries", "zbncp.data.time_between_disc", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_enable_flag,
         {"Enable flag", "zbncp.data.enable_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, "0 - to disable, 1 - to enable", HFILL}},

        {&hf_zbncp_data_array,
         {"Data", "zbncp.data.data_arr", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_use_alias,
         {"Use alias", "zbncp.data.use_alias", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_alias_src,
         {"Alias source address", "zbncp.data.alias_src", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_alias_seq,
         {"Alias sequence number", "zbncp.data.alias_seq", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_tx_opt,
         {"TX Options", "zbncp.data.tx_opt", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_tx_opt_secur,
         {"Security enabled transmission", "zbncp.data.secur", FT_BOOLEAN, 8, NULL,
          0x01, NULL, HFILL}},

        {&hf_zbncp_data_tx_opt_obsolete,
         {"Obsolete", "zbncp.data.obsolete", FT_BOOLEAN, 8, NULL,
          0x02, NULL, HFILL}},

        {&hf_zbncp_data_tx_opt_ack,
         {"ACK", "zbncp.data.ack", FT_BOOLEAN, 8, NULL,
          0x04, NULL, HFILL}},

        {&hf_zbncp_data_tx_opt_frag,
         {"Fragmentation permitted", "zbncp.data.frag", FT_BOOLEAN, 8, NULL,
          0x08, NULL, HFILL}},

        {&hf_zbncp_data_tx_opt_inc_ext_nonce,
         {"Include extended nonce", "zbncp.data.ext_nonce", FT_BOOLEAN, 8, NULL,
          0x10, NULL, HFILL}},

        {&hf_zbncp_data_tx_opt_force_mesh_route,
         {"Force mesh route discovery for this request", "zbncp.data.force_mesh_route", FT_BOOLEAN, 8, NULL,
          0x20, NULL, HFILL}},

        {&hf_zbncp_data_tx_opt_send_route_record,
         {"Send route record for this request", "zbncp.data.send_route_record", FT_BOOLEAN, 8, NULL,
          0x40, NULL, HFILL}},

        {&hf_zbncp_data_lqi,
         {"LQI", "zbncp.data.lqi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_rssi,
         {"RSSI", "zbncp.data.rssi", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_do_cleanup,
         {"Do cleanup", "zbncp.data.do_clean", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_max_rx_bcast,
         {"max_rx_bcast", "zbncp.data.max_rx_bcast", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_tx_bcast,
         {"max_tx_bcast", "zbncp.data.max_tx_bcast", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_rx_ucast,
         {"mac_rx_ucast", "zbncp.data.mac_rx_ucast", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_tx_ucast_total_zcl,
         {"mac_tx_ucast_total_zcl", "zbncp.data.mac_tx_ucast_total_zcl", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_tx_ucast_failures_zcl,
         {"mac_tx_ucast_failures_zcl", "zbncp.data.mac_tx_ucast_failures_zcl", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_tx_ucast_retries_zcl,
         {"mac_tx_ucast_retries_zcl", "zbncp.data.mac_tx_ucast_retries_zcl", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_tx_ucast_total,
         {"mac_tx_ucast_total", "zbncp.data.mac_tx_ucast_total", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_tx_ucast_failures,
         {"mac_tx_ucast_failures", "zbncp.data.mac_tx_ucast_failures", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_tx_ucast_retries,
         {"mac_tx_ucast_retries", "zbncp.data.mac_tx_ucast_retries", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_validate_drop_cnt,
         {"mac_validate_drop_cnt", "zbncp.data.mac_validate_drop_cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_phy_cca_fail_count,
         {"phy_cca_fail_count", "zbncp.data.phy_cca_fail_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_phy_to_mac_que_lim_reached,
         {"phy_to_mac_que_lim_reached", "zbncp.data.phy_to_mac_que_lim_reached", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_period_of_time,
         {"period_of_time", "zbncp.data.period_of_time", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_last_msg_lqi,
         {"last_msg_lqi", "zbncp.data.last_msg_lqi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_last_msg_rssi,
         {"last_msg_rssi", "zbncp.data.last_msg_rssi", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_number_of_resets,
         {"number_of_resets", "zbncp.data.number_of_resets", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_tx_bcast,
         {"aps_tx_bcast", "zbncp.data.aps_tx_bcast", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_tx_ucast_success,
         {"aps_tx_ucast_success", "zbncp.data.aps_tx_ucast_success", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_tx_ucast_retry,
         {"aps_tx_ucast_retry", "zbncp.data.aps_tx_ucast_retry", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_tx_ucast_fail,
         {"aps_tx_ucast_fail", "zbncp.data.aps_tx_ucast_fail", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_route_disc_initiated,
         {"route_disc_initiated", "zbncp.data.route_disc_initiated", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_neighbor_added,
         {"nwk_neighbor_added", "zbncp.data.nwk_neighbor_added", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_neighbor_removed,
         {"nwk_neighbor_removed", "zbncp.data.nwk_neighbor_removed", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_neighbor_stale,
         {"nwk_neighbor_stale", "zbncp.data.nwk_neighbor_stale", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_upd_status_code,
         {"Device update status code", "zbncp.data.dev_upd_status_code", FT_UINT8, BASE_DEC, VALS(zbncp_dev_update_status_code), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_join_indication,
         {"join_indication", "zbncp.data.join_indication", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_childs_removed,
         {"childs_removed", "zbncp.data.childs_removed", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_fc_failure,
         {"nwk_fc_failure", "zbncp.data.nwk_fc_failure", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_unauthorized_key,
         {"aps_unauthorized_key", "zbncp.data.aps_unauthorized_key", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_decrypt_failure,
         {"nwk_decrypt_failure", "zbncp.data.nwk_decrypt_failure", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_decrypt_failure,
         {"aps_decrypt_failure", "zbncp.data.aps_decrypt_failure", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_packet_buffer_allocate_failures,
         {"packet_buffer_allocate_failures", "zbncp.data.packet_buffer_allocate_failures", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_average_mac_retry_per_aps_message_sent,
         {"average_mac_retry_per_aps_message_sent", "zbncp.data.avg_mac_retry", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_fc_failure,
         {"aps_fc_failure", "zbncp.data.aps_fc_failure", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_retry_overflow,
         {"nwk_retry_overflow", "zbncp.data.nwk_retry_overflow", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_bcast_table_full,
         {"nwk_bcast_table_full", "zbncp.data.nwk_bcast_table_full", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_status,
         {"status", "zbncp.data.status", FT_INT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_auth_type,
         {"Authorization type", "zbncp.data.zdo_auth_type", FT_UINT8, BASE_DEC, VALS(zbncp_zdo_auth_types), 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_leg_auth_status_code,
         {"Status code", "zbncp.data.zdo_status_code", FT_UINT8, BASE_DEC, VALS(zbncp_zdo_leg_auth_status_codes), 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_tclk_auth_status_code,
         {"Status code", "zbncp.data.zdo_status_code", FT_UINT8, BASE_DEC, VALS(zbncp_zdo_tclk_auth_status_codes), 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_server_mask,
         {"Server mask", "zbncp.data.zdo_serv_mask", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_start_entry_idx,
         {"Start entry index", "zbncp.data.zdo_start_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_scan_duration,
         {"Scan duration", "zbncp.data.zdo_scan_duration", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_scan_cnt,
         {"Scan count", "zbncp.data.zdo_scan_cnt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_zdo_scan_mgr_addr,
         {"Manager NWK address", "zbncp.data.zdo_mgr_addr", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_cnt,
         {"APS counter", "zbncp.data.aps_cnt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_fc,
         {"APS FC", "zbncp.data.aps_fc", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_fc_deliv_mode,
         {"Delivery mode", "zbncp.data.aps_fc.deliv_mode", FT_UINT8, BASE_DEC, VALS(zbncp_deliv_mode),
          0x0C, NULL, HFILL}},

        {&hf_zbncp_data_aps_fc_secur,
         {"Security", "zbncp.data.aps_fc.secur", FT_BOOLEAN, 8, NULL,
          0x20, NULL, HFILL}},

        {&hf_zbncp_data_aps_fc_ack_retrans,
         {"ACK & retransmit", "zbncp.data.aps_fc.ack_retrans", FT_BOOLEAN, 8, NULL,
          0x40, NULL, HFILL}},

        {&hf_zbncp_data_aps_key_attr,
         {"APS key source & attr", "zbncp.data.aps_key_attr", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_aps_key_attr_key_src,
         {"Key source", "zbncp.data.aps_key_attr.key_src", FT_UINT8, BASE_HEX, VALS(zbncp_aps_key_src),
          0x1, NULL, HFILL}},

        {&hf_zbncp_data_aps_key_attr_key_used,
         {"Key used", "zbncp.data.aps_key_attr.key_used", FT_UINT8, BASE_HEX, VALS(zbncp_aps_key_used),
          0x6, NULL, HFILL}},

        {&hf_zbncp_data_pkt_len,
         {"Packet length", "zbncp.data.pkt_len", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_pkt,
         {"Packet", "zbncp.data.pkt", FT_UINT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_scan_dur,
         {"Scan Duration", "zbncp.data.scan_dur", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_distr_nwk_flag,
         {"Distributed Network Flag", "zbncp.data.distr_nwk_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_count,
         {"Network Count", "zbncp.data.nwk_cnt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_upd_id,
         {"NWK Update ID", "zbncp.data.nwk_upd_id", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_rejoin,
         {"Rejoin", "zbncp.data.rejoin", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_rejoin_nwk,
         {"Rejoin Network", "zbncp.data.rejoin_nwk", FT_UINT8, BASE_DEC, VALS(zbncp_rejoin_nwk), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_secur_en,
         {"Security Enable", "zbncp.data.secur_en", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_enh_beacon,
         {"Enhanced Beacon", "zbncp.data.enh_beacon", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_beacon_type,
         {"Beacon Type", "zbncp.data.beacon_type", FT_UINT8, BASE_DEC, VALS(zbncp_beacon_type), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_beacon_order,
         {"Beacon Order", "zbncp.data.becon_order", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_superframe_order,
         {"Superframe Order", "zbncp.data.superframe_order", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_battery_life_ext,
         {"Battery Life Extension", "zbncp.data.battery_life_ext", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_if,
         {"MAC interface #", "zbncp.data.mac_if", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_ed_config,
         {"ED config", "zbncp.data.ed_cfg", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_timeout_cnt,
         {"Timeout Counter", "zbncp.data.timeout_cnt", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_keepalive_mode,
         {"Keepalive mode", "zbncp.data.keepalive", FT_UINT8, BASE_DEC, VALS(zbncp_keepalive_mode), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dev_timeout,
         {"Device Timeout", "zbncp.data.dev_timeout", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_relationship,
         {"Relationship", "zbncp.data.relationship", FT_UINT8, BASE_HEX, VALS(zbncp_relationship), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_tx_fail_cnt,
         {"Transmit Failure Cnt", "zbncp.data.tx_fail_cnt", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_out_cost,
         {"Outgoing Cost", "zbncp.data.out_cost", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_age,
         {"Age", "zbncp.data.age", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_trace_mask,
         {"Trace mask", "zbncp.data.trace_mask", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_trace_wireless_traf,
         {"Wireless traffic", "zbncp.data.trace_wireless_traf", FT_UINT32, BASE_DEC, NULL, 0x1, NULL, HFILL}},

        {&hf_zbncp_data_trace_reserved,
         {"Reserved", "zbncp.data.trace_reserved", FT_UINT32, BASE_DEC, NULL, 0x2, NULL, HFILL}},

        {&hf_zbncp_data_trace_ncp_ll_proto,
         {"NCP LL protocol", "zbncp.data.trace_ncp_ll_proto", FT_UINT32, BASE_DEC, NULL, 0x4, NULL, HFILL}},

        {&hf_zbncp_data_trace_host_int_line,
         {"HOST INT line", "zbncp.data.trace_host_int_line", FT_UINT32, BASE_DEC, NULL, 0x8, NULL, HFILL}},

        {&hf_zbncp_data_trace_sleep_awake,
         {"Sleep/awake", "zbncp.data.trace_sleep_awake", FT_UINT32, BASE_DEC, NULL, 0x10, NULL, HFILL}},

        {&hf_zbncp_data_trace_input_output,
         {"Input/Output trace", "zbncp.data.trace_input_output", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_trace_timestamp,
         {"Trace timestamp in beacon intervals", "zbncp.data.trace_timestamp", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_trace,
         {"Raw trace data", "zbncp.data.trace", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_key_neg_method,
         {"Key Negotiation Methods Mask", "zbncp.data.key_neg_method", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_psk_secrets,
         {"PSK Secrets Mask", "zbncp.data.psk_secrets", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_r22_join_usage,
         {"Use r22 join procedure", "zbncp.data.r22_join_usage", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_nwk_conf_preset,
         {"Network preset configuration", "zbncp.data.nwk_conf_preset", FT_UINT8, BASE_HEX, VALS(zbncp_nwk_conf_behavior), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_short_address,
         {"Short Network address", "zbncp.data.short_address", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_raw_data,
         {"Raw data", "zbncp.data.raw_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_conf_params,
         {"Configuration parameters", "zbncp.data.conf_params", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        /*  Configuration Parameter Fields */
        {&hf_zbncp_data_conf_params_reserved,
         {"Reserved", "zbncp.data.reserved", FT_BOOLEAN, 8, NULL, CONF_PARAMS_RESERVED,
          "Whether this device can act as a PAN coordinator or not.", HFILL}},

        {&hf_zbncp_data_conf_params_disable_pan_id_change,
         {"Disable PAN ID Change", "zbncp.data.conf_params.disable_pan_id_change", FT_BOOLEAN, 8, NULL, CONF_PARAMS_DIS_PANID_CHANGE, "", HFILL}},

        {&hf_zbncp_data_conf_params_disable_channel_change,
         {"Disable Channel Change", "zbncp.data.conf_params.disable_channel_change", FT_BOOLEAN, 8, NULL, CONF_PARAMS_DIS_CHAN_CHANGE, "", HFILL}},

        {&hf_zbncp_data_conf_params_leave_request_allowed,
         {"Leave Requests Allowed", "zbncp.data.conf_params.leave_request_allowed", FT_BOOLEAN, 8, NULL, CONF_PARAMS_LEAVE_REQ_ALLOW, "", HFILL}},

        {&hf_zbncp_data_conf_params_require_tclk,
         {"Require Link Key for Transport Key transmission", "zbncp.data.conf_params.require_tclk", FT_BOOLEAN, 8, NULL, CONF_PARAMS_REQ_TCLK, "", HFILL}},

        {&hf_zbncp_data_conf_params_restricted_enabled,
         {"Restricted Mode Enabled", "zbncp.data.conf_params.restricted_enabled", FT_BOOLEAN, 8, NULL, CONF_PARAMS_RESTRICT_MODE_EN, "", HFILL}},

        {&hf_zbncp_data_channel_page_count,
         {"Channel Page Count", "zbncp.data.channel_page_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_config_mask,
         {"Configuration mask", "zbncp.data.config_mask", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_dest_short_address,
         {"Destination Short Network address", "zbncp.data.short_address", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_current_parents_short_address,
         {"Current Parents Short Address", "zbncp.data.current_parents_short_address", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_current_parents_lqi,
         {"Current Parents' LQI", "zbncp.data.current_parents_lqi", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_potential_parent_count,
         {"Potential Parent Count", "zbncp.data.potential_parent_count", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_classification_mask,
         {"Classification Mask", "zbncp.data.classification_mask", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_total_beacons_surveyed,
         {"Total Beacons Surveyed", "zbncp.data.total_beacons_surveyed", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_current_pan_id_beacons,
         {"Number of Beacons with Current PAN ID", "zbncp.data.current_pan_id_beacons", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_current_nwk_potential_parents,
         {"Number of potential parents from current Zigbee Network", "zbncp.data.current_nwk_potential_parents", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_other_zigbee_beacons,
         {"Number of Other Zigbee Beacons", "zbncp.data.other_zigbee_beacons", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_pan_id_conflict_tlv,
         {"PAN ID Conflict TLV", "zbncp.data.pan_id_conflict_tlv", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_eui64_count,
         {"Amount of EUI64s'", "zbncp.data.eui64_count", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_eui64,
         {"EUI64", "zbncp.data.eui64", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_initial_join_auth,
         {"Initial Join Auth", "zbncp.data.initial_join_auth", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_key_update_method,
         {"Key Update Method", "zbncp.data.key_update_method", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_next_pan_id_change,
         {"Next PAN Id Change", "zbncp.data.next_pan_id_change", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_next_channel_change,
         {"Next Channel Change", "zbncp.data.next_channel_change", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_error_count,
         {"Error Count", "zbncp.data.error_count", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_keepalive_rec,
         {"Keepalive Received", "zbncp.data.keepalive_rec", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_mac_if_idx,
         {"MAC Interface Index", "zbncp.data.mac_if_idx", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_fast_poll_int,
         {"Fast Poll Interval", "zbncp.data.fast_poll", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_long_poll_int,
         {"Long Poll Interval", "zbncp.data.long_poll", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_fast_poll_flag,
         {"Fast Poll Flag", "zbncp.data.fast_poll_flag", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_stop_fast_poll_result,
         {"Stop Fast Poll Result", "zbncp.data.stop_fast_poll_result", FT_UINT8, BASE_HEX, VALS(zbncp_stop_fast_poll_result), 0x0, NULL, HFILL}},

        {&hf_zbncp_data_time,
         {"Time", "zbncp.data.time", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_pan_id_cnt,
         {"Pan ID count", "zbncp.data.pan_id_cnt", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_ic,
         {"Install Code", "zbncp.data.ic", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_ic_table_size,
         {"IC Table Size", "zbncp.data.table_size", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_ic_ent_cnt,
         {"Entry Count", "zbncp.data.entry_count", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_cs,
         {"Suite", "zbncp.data.cs", FT_UINT8, BASE_DEC, VALS(zbncp_cs), 0, NULL, HFILL}},

        {&hf_zbncp_data_ca_pub_key,
         {"CA Public Key", "zbncp.data.ca_pub_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_ca_priv_key,
         {"Device Private Key", "zbncp.data.ca_priv_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_cert,
         {"Certificate", "zbncp.data.cert", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_issuer,
         {"Issuer", "zbncp.data.issuer", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_ic_en,
         {"Enable IC", "zbncp.data.ic_en", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_key_type,
         {"Key type", "zbncp.data.key_type", FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_data_tx_power,
         {"TX Power", "zbncp.data.tx_power", FT_INT8, BASE_DEC, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_tx_time,
         {"TX Time", "zbncp.data.tx_time", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_seed,
         {"Seed", "zbncp.data.seed", FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_link_key,
         {"Link Key", "zbncp.data.link_key", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_aps_link_key_type,
         {"APS Link Key Type", "zbncp.data.link_key_type", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_key_src,
         {"Key source", "zbncp.data.key_src", FT_UINT8, BASE_DEC, VALS(zbncp_key_src), 0, NULL, HFILL}},

        {&hf_zbncp_data_key_attr,
         {"Key attributes", "zbncp.data.key_attr", FT_UINT8, BASE_DEC, VALS(zbncp_key_attr), 0, NULL, HFILL}},

        {&hf_zbncp_data_out_frame_cnt,
         {"Outgoing frame counter", "zbncp.data.out_cnt", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_inc_frame_cnt,
         {"Incoming frame counter", "zbncp.data.inc_cnt", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_dump_type,
         {"Dump Type", "zbncp.data.dump_type", FT_UINT8, BASE_DEC, VALS(zbncp_dump_type), 0, NULL, HFILL}},

        {&hf_zbncp_data_dump_text,
         {"Dump", "zbncp.data.dump_text", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_dump_bin,
         {"Dump", "zbncp.data.dump_bin", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_offset,
         {"Offset", "zbncp.data.offset", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_do_erase,
         {"Do erase", "zbncp.data.do_erase", FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_calibration_status,
         {"Calibration status", "zbncp.data.calibration_status", FT_UINT8, BASE_HEX, VALS(zbncp_calibration_status), 0, NULL, HFILL}},

        {&hf_zbncp_data_calibration_value,
         {"Calibration value", "zbncp.data.calibration_value", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_zgp_key_type,
         {"Key type", "zbncp.data.zgp_key_type", FT_UINT8, BASE_HEX, VALS(zbncp_zgp_key_types), 0, NULL, HFILL}},

        {&hf_zbncp_data_zgp_link_key,
         {"Link key", "zbncp.data.zgp_link_key", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_prod_conf_hdr_crc,
         {"Production config crc", "zbncp.data.prod_conf.hdr.crc", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_prod_conf_hdr_len,
         {"Length (with application section)", "zbncp.data.prod_conf.hdr.len", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_prod_conf_hdr_version,
         {"Version", "zbncp.data.prod_conf.hdr.version", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}},

        {&hf_zbncp_data_prod_conf_body,
         {"Production config body", "zbncp.data.prod_conf.body", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},

        /* ZBOSS NCP dump */
        {&hf_zbncp_dump_preamble,
         {"ZBNCP Dump preamble", "zbncp.dump.preamble", FT_STRING, BASE_NONE, NULL, 0x0,
          NULL, HFILL}},

        {&hf_zbncp_dump_version,
         {"ZBNCP Dump version", "zbncp.dump.version", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL}},

        {&hf_zbncp_dump_type,
         {"Frame type", "zbncp.dump.ftype", FT_UINT8, BASE_HEX, NULL, 0x0,
          NULL, HFILL}},

        {&hf_zbncp_dump_options,
         {"Options", "zbncp.dump.options", FT_UINT8, BASE_HEX, NULL, 0x0,
          NULL, HFILL}},

        {&hf_zbncp_dump_options_dir,
         {"Direction", "zbncp.dump.options.direction", FT_BOOLEAN, 8, NULL, ZBNCP_DUMP_DIR_MASK,
          NULL, HFILL}},

        {&hf_zbncp_dump_options_int_state,
         {"HOST INT", "zbncp.dump.options.int_state", FT_BOOLEAN, 8, NULL, ZBNCP_DUMP_HOST_INT_DUMP_MASK,
          NULL, HFILL}},

        {&hf_zbncp_dump_options_tx_conflict,
         {"Potential TX/TX conflict", "zbncp.dump.options.tx_conflict", FT_BOOLEAN, 8, NULL, ZBNCP_DUMP_POTENTIAL_TX_RX_ERROR_MASK,
          NULL, HFILL}},

        /*  Capability Information Fields */

        {&hf_ieee802154_cinfo_alt_coord,
         {"Alternate PAN Coordinator", "zbncp.wpan.cinfo.alt_coord", FT_BOOLEAN, 8, NULL, IEEE802154_CMD_CINFO_ALT_PAN_COORD,
          "Whether this device can act as a PAN coordinator or not.", HFILL}},

        {&hf_ieee802154_cinfo_device_type,
         {"Device Type", "zbncp.wpan.cinfo.device_type", FT_BOOLEAN, 8, TFS(&tfs_cinfo_device_type), IEEE802154_CMD_CINFO_DEVICE_TYPE,
          "Whether this device is RFD (reduced-function device) or FFD (full-function device).", HFILL}},

        {&hf_ieee802154_cinfo_power_src,
         {"Power Source", "zbncp.wpan.cinfo.power_src", FT_BOOLEAN, 8, TFS(&tfs_cinfo_power_src), IEEE802154_CMD_CINFO_POWER_SRC,
          "Whether this device is operating on AC/mains or battery power.", HFILL}},

        {&hf_ieee802154_cinfo_idle_rx,
         {"Receive On When Idle", "zbncp.wpan.cinfo.idle_rx", FT_BOOLEAN, 8, NULL, IEEE802154_CMD_CINFO_IDLE_RX,
          "Whether this device can receive packets while idle or not.", HFILL}},

        {&hf_ieee802154_cinfo_sec_capable,
         {"Security Capability", "zbncp.wpan.cinfo.sec_capable", FT_BOOLEAN, 8, NULL, IEEE802154_CMD_CINFO_SEC_CAPABLE,
          "Whether this device is capable of receiving encrypted packets.", HFILL}},

        {&hf_ieee802154_cinfo_alloc_addr,
         {"Allocate Address", "zbncp.wpan.cinfo.alloc_addr", FT_BOOLEAN, 8, NULL, IEEE802154_CMD_CINFO_ALLOC_ADDR,
          "Whether this device wishes to use a 16-bit short address instead of its IEEE 802.15.4 64-bit long address.", HFILL}}};

    /* Protocol subtrees */
    static int *ett[] =
        {
            &ett_zbncp_hdr,
            &ett_zbncp_hdr_flags,
            &ett_zbncp_ll_body,
            &ett_zbncp_hl_hdr,
            &ett_zbncp_hl_body,
            &ett_zbncp_data_in_cl_list,
            &ett_zbncp_data_out_cl_list,
            &ett_zbncp_data_mac_cap,
            &ett_zbncp_data_pwr_src,
            &ett_zbncp_data_cur_pwr_src,
            &ett_zbncp_data_asoc_nwk_list,
            &ett_zbncp_data_pwr_desc,
            &ett_zbncp_data_desc_cap,
            &ett_zbncp_data_flags,
            &ett_zbncp_data_server_mask,
            &ett_zbncp_data_ep_list,
            &ett_zbncp_data_leave_flags,
            &ett_zbncp_data_tx_opt,
            &ett_zbncp_data_zdo_rejoin_flags,
            &ett_zbncp_data_apc_fc,
            &ett_zbncp_data_prod_conf_hdr,
            &ett_zbncp_data_aps_key_attr,
            &ett_zbncp_data_ch_list,
            &ett_zbncp_data_channel,
            &ett_zbncp_data_nwk_descr,
            &ett_zbncp_data_cmd_opt,
            &ett_zbncp_data_joind_bitmask,
            &ett_zbncp_data_trace_bitmask,
            &ett_zbncp_data_conf_params,
            &ett_zbncp_dump,
            &ett_zbncp_dump_opt
        };

    zbncp_frame = proto_register_protocol("ZBOSS Network Coprocessor product", "ZB NCP",
                                          ZBNCP_PROTOABBREV);

    proto_register_field_array(zbncp_frame, hf_zbncp_phy, array_length(hf_zbncp_phy));
    proto_register_subtree_array(ett, array_length(ett));

    zbncp_handle = register_dissector("zbncp", dissect_zbncp, proto_zbncp);
} /* proto_register_zbncp */

void proto_reg_handoff_zbncp(void)
{
    dissector_add_uint("wtap_encap", WTAP_ENCAP_ZBNCP, zbncp_handle);
}