summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-zbee-zdp.c
blob: 1057fb017164301bc6718ad3d2f661a32a91fbd8 (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
/* packet-zbee-zdp.c
 * Dissector routines for the ZigBee Device Profile (ZDP)
 * By Owen Kirby <osk@exegin.com>
 * Copyright 2009 Exegin Technologies Limited
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

/*  Include Files */
#include "config.h"

#include <epan/packet.h>
#include <epan/expert.h>
#include <wsutil/bits_ctz.h>
#include <wsutil/str_util.h>

#include "packet-zbee.h"
#include "packet-zbee-aps.h"
#include "packet-zbee-nwk.h"
#include "packet-zbee-zdp.h"
#include "packet-zbee-zdp.h"

void proto_reg_handoff_zbee_zdp(void);
void proto_register_zbee_zdp(void);

/*************************/
/* Function Declarations */
/*************************/
/* Local Helper routines. */
static uint16_t zdp_convert_2003cluster     (uint8_t cluster);


/**************************************
 * Field indices
 **************************************
 */
/* Global field indices. */
static int proto_zbee_zdp;
static int hf_zbee_zdp_seqno;
#if 0
static int hf_zbee_zdp_length; /* Deprecates since ZigBee 2006. */
#endif

/* General indices. */
       int hf_zbee_zdp_ext_addr;
       int hf_zbee_zdp_nwk_addr;
       int hf_zbee_zdp_req_type;
       int hf_zbee_zdp_index;
static int hf_zbee_zdp_status;
       int hf_zbee_zdp_ep_count;
       int hf_zbee_zdp_endpoint;
       int hf_zbee_zdp_profile;
       int hf_zbee_zdp_cluster;
       int hf_zbee_zdp_addr_mode;
       int hf_zbee_zdp_table_size;
       int hf_zbee_zdp_table_count;
       int hf_zbee_zdp_in_count;
       int hf_zbee_zdp_out_count;
       int hf_zbee_zdp_in_cluster;
       int hf_zbee_zdp_out_cluster;
       int hf_zbee_zdp_assoc_device_count;
       int hf_zbee_zdp_assoc_device;
       int hf_zbee_zdp_cache_address;

/* Capability information indices. */
static int hf_zbee_zdp_cinfo;
static int hf_zbee_zdp_cinfo_alloc;
static int hf_zbee_zdp_cinfo_security;
static int hf_zbee_zdp_cinfo_idle_rx;
static int hf_zbee_zdp_cinfo_power;
static int hf_zbee_zdp_cinfo_ffd;
static int hf_zbee_zdp_cinfo_alt_coord;

/* Server mode flag indices. */
static int hf_zbee_zdp_server;
static int hf_zbee_zdp_server_pri_trust;
static int hf_zbee_zdp_server_bak_trust;
static int hf_zbee_zdp_server_pri_bind;
static int hf_zbee_zdp_server_bak_bind;
static int hf_zbee_zdp_server_pri_disc;
static int hf_zbee_zdp_server_bak_disc;
static int hf_zbee_zdp_server_network_manager;
static int hf_zbee_zdp_server_stk_compl_rev;

/* Node descriptor indices. */
static int hf_zbee_zdp_node_type;
static int hf_zbee_zdp_node_complex;
static int hf_zbee_zdp_node_user;
static int hf_zbee_zdp_node_frag_support;
static int hf_zbee_zdp_node_freq_868;
static int hf_zbee_zdp_node_freq_900;
static int hf_zbee_zdp_node_freq_2400;
static int hf_zbee_zdp_node_freq_eu_sub_ghz;
static int hf_zbee_zdp_node_manufacturer;
static int hf_zbee_zdp_node_max_buffer;
static int hf_zbee_zdp_node_max_incoming_transfer;
static int hf_zbee_zdp_node_max_outgoing_transfer;
static int hf_zbee_zdp_dcf;
static int hf_zbee_zdp_dcf_eaela;
static int hf_zbee_zdp_dcf_esdla;

/* Power descriptor indices. */
static int hf_zbee_zdp_power;
static int hf_zbee_zdp_power_mode;
static int hf_zbee_zdp_power_avail_ac;
static int hf_zbee_zdp_power_avail_recharge;
static int hf_zbee_zdp_power_avail_dispose;
static int hf_zbee_zdp_power_source_ac;
static int hf_zbee_zdp_power_source_recharge;
static int hf_zbee_zdp_power_source_dispose;
static int hf_zbee_zdp_power_level;

/* Simple descriptor indices. */
static int hf_zbee_zdp_simple_app_device;
static int hf_zbee_zdp_simple_zll_app_device;
static int hf_zbee_zdp_simple_ha_app_device;
static int hf_zbee_zdp_simple_app_version;
       int hf_zbee_zdp_simple_length;

/* Complex descriptor indices. */
       int hf_zbee_zdp_complex_length;
static int hf_zbee_zdp_complex;

/* User descriptor indices. */
       int hf_zbee_zdp_user;
       int hf_zbee_zdp_user_length;

/* Discovery indices. */
       int hf_zbee_zdp_cache;
       int hf_zbee_zdp_disc_node_size;
       int hf_zbee_zdp_disc_power_size;
       int hf_zbee_zdp_disc_ep_count;
       int hf_zbee_zdp_disc_simple_count;
       int hf_zbee_zdp_disc_simple_size;

/* Binding indices. */
       int hf_zbee_zdp_target;
       int hf_zbee_zdp_replacement;
       int hf_zbee_zdp_replacement_ep;
       int hf_zbee_zdp_bind_src;
       int hf_zbee_zdp_bind_src64;
       int hf_zbee_zdp_bind_src_ep;
       int hf_zbee_zdp_bind_dst;
       int hf_zbee_zdp_bind_dst64;
       int hf_zbee_zdp_bind_dst_ep;

/* Network Management indices. */
       int hf_zbee_zdp_duration;
       int hf_zbee_zdp_leave_children;
       int hf_zbee_zdp_leave_rejoin;
       int hf_zbee_zdp_significance;
       int hf_zbee_zdp_scan_count;
       int hf_zbee_zdp_update_id;
       int hf_zbee_zdp_manager;
       int hf_zbee_zdp_tx_total;
       int hf_zbee_zdp_tx_fail;
       int hf_zbee_zdp_tx_retries;
       int hf_zbee_zdp_period_time_results;
       int hf_zbee_zdp_channel_count;
       int hf_zbee_zdp_channel_mask;
       int hf_zbee_zdp_channel_page;
       int hf_zbee_zdp_channel_page_count;
       int hf_zbee_zdp_channel_energy;
       int hf_zbee_zdp_pan_eui64;
       int hf_zbee_zdp_pan_uint;
       int hf_zbee_zdp_channel;
       int hf_zbee_zdp_nwk_desc_profile;
       int hf_zbee_zdp_profile_version;
       int hf_zbee_zdp_beacon;
       int hf_zbee_zdp_superframe;
       int hf_zbee_zdp_permit_joining;
       int hf_zbee_zdp_extended_pan;
       int hf_zbee_zdp_addr;
       int hf_zbee_zdp_table_entry_type;
       int hf_zbee_zdp_table_entry_idle_rx_0c;
       int hf_zbee_zdp_table_entry_relationship_70;
       int hf_zbee_zdp_table_entry_idle_rx_04;
       int hf_zbee_zdp_table_entry_relationship_18;
       int hf_zbee_zdp_depth;
       int hf_zbee_zdp_permit_joining_03;
       int hf_zbee_zdp_lqi;
static int hf_zbee_zdp_scan_channel;
       int hf_zbee_zdp_ieee_join_start_index;
       int hf_zbee_zdp_ieee_join_update_id;
       int hf_zbee_zdp_ieee_join_policy;
       int hf_zbee_zdp_ieee_join_list_total;
       int hf_zbee_zdp_ieee_join_list_start;
       int hf_zbee_zdp_ieee_join_list_count;
       int hf_zbee_zdp_ieee_join_list_ieee;
       int hf_zbee_zdp_number_of_children;
       int hf_zbee_zdp_beacon_survey_scan_mask;
       int hf_zbee_zdp_beacon_survey_scan_mask_cnt;
       int hf_zbee_zdp_beacon_survey_conf_mask;
       int hf_zbee_zdp_beacon_survey_total;
       int hf_zbee_zdp_beacon_survey_cur_zbn;
       int hf_zbee_zdp_beacon_survey_cur_zbn_potent_parents;
       int hf_zbee_zdp_beacon_survey_other_zbn;
       int hf_zbee_zdp_beacon_survey_current_parent;
       int hf_zbee_zdp_beacon_survey_cnt_parents;
       int hf_zbee_zdp_beacon_survey_parent;
       int hf_zbee_zdp_tlv_count;
       int hf_zbee_zdp_tlv_id;
/* Routing Table */
       int hf_zbee_zdp_rtg;
       int hf_zbee_zdp_rtg_entry;
       int hf_zbee_zdp_rtg_destination;
       int hf_zbee_zdp_rtg_next_hop;
       int hf_zbee_zdp_rtg_status;


/* Subtree indices. */
static int ett_zbee_zdp;
       int ett_zbee_zdp_endpoint;
       int ett_zbee_zdp_match_in;
       int ett_zbee_zdp_match_out;
       int ett_zbee_zdp_node;
static int ett_zbee_zdp_node_in;
static int ett_zbee_zdp_node_out;
       int ett_zbee_zdp_power;
       int ett_zbee_zdp_simple;
       int ett_zbee_zdp_cinfo;
       int ett_zbee_zdp_server;
       int ett_zbee_zdp_simple_sizes;
       int ett_zbee_zdp_bind;
       int ett_zbee_zdp_bind_entry;
       int ett_zbee_zdp_bind_end_in;
       int ett_zbee_zdp_bind_end_out;
static int ett_zbee_zdp_bind_table;
       int ett_zbee_zdp_bind_source;
       int ett_zbee_zdp_assoc_device;
       int ett_zbee_zdp_nwk;
       int ett_zbee_zdp_perm_join_fc;
       int ett_zbee_zdp_lqi;
       int ett_zbee_zdp_rtg;
       int ett_zbee_zdp_cache;
       int ett_zbee_zdp_nwk_desc;
       int ett_zbee_zdp_table_entry;
static int ett_zbee_zdp_descriptor_capability_field;

/* Expert Info */
static expert_field ei_deprecated_command;

/**************************************
 * Value Strings
 **************************************
 */
static const value_string zbee_zdp_req_types[] = {
    { ZBEE_ZDP_REQ_TYPE_SINGLE,     "Single Device Response" },
    { ZBEE_ZDP_REQ_TYPE_EXTENDED,   "Extended Response" },
    { 0, NULL }
};

const value_string zbee_zdp_cluster_names[] = {
    { ZBEE_ZDP_REQ_NWK_ADDR,                      "Network Address Request" },
    { ZBEE_ZDP_REQ_IEEE_ADDR,                     "Extended Address Request" },
    { ZBEE_ZDP_REQ_NODE_DESC,                     "Node Descriptor Request" },
    { ZBEE_ZDP_REQ_POWER_DESC,                    "Power Descriptor Request" },
    { ZBEE_ZDP_REQ_SIMPLE_DESC,                   "Simple Descriptor Request" },
    { ZBEE_ZDP_REQ_ACTIVE_EP,                     "Active Endpoint Request" },
    { ZBEE_ZDP_REQ_MATCH_DESC,                    "Match Descriptor Request" },
    { ZBEE_ZDP_REQ_COMPLEX_DESC,                  "Complex Descriptor Request" },
    { ZBEE_ZDP_REQ_USER_DESC,                     "User Descriptor Request" },
    { ZBEE_ZDP_REQ_DISCOVERY_CACHE,               "Discovery Cache Request" },
    { ZBEE_ZDP_REQ_DEVICE_ANNCE,                  "Device Announcement" },
    { ZBEE_ZDP_REQ_PARENT_ANNCE,                  "Parent Announce" },
    { ZBEE_ZDP_REQ_SET_USER_DESC,                 "Set User Descriptor Request" },
    { ZBEE_ZDP_REQ_SYSTEM_SERVER_DISC,            "Server Discovery Request" },
    { ZBEE_ZDP_REQ_STORE_DISCOVERY,               "Store Discovery Request" },
    { ZBEE_ZDP_REQ_STORE_NODE_DESC,               "Store Node Descriptor Request" },
    { ZBEE_ZDP_REQ_STORE_POWER_DESC,              "Store Power Descriptor Request" },
    { ZBEE_ZDP_REQ_STORE_ACTIVE_EP,               "Store Active Endpoints Request" },
    { ZBEE_ZDP_REQ_STORE_SIMPLE_DESC,             "Store Simple Descriptor Request" },
    { ZBEE_ZDP_REQ_REMOVE_NODE_CACHE,             "Remove Node Cache Request" },
    { ZBEE_ZDP_REQ_FIND_NODE_CACHE,               "Find Node Cache Request" },
    { ZBEE_ZDP_REQ_EXT_SIMPLE_DESC,               "Extended Simple Descriptor Request" },
    { ZBEE_ZDP_REQ_EXT_ACTIVE_EP,                 "Extended Active Endpoint Request" },
    { ZBEE_ZDP_REQ_END_DEVICE_BIND,               "End Device Bind Request" },
    { ZBEE_ZDP_REQ_BIND,                          "Bind Request" },
    { ZBEE_ZDP_REQ_UNBIND,                        "Unbind Request" },
    { ZBEE_ZDP_REQ_BIND_REGISTER,                 "Bind Register Request" },
    { ZBEE_ZDP_REQ_REPLACE_DEVICE,                "Replace Device Request" },
    { ZBEE_ZDP_REQ_STORE_BAK_BIND_ENTRY,          "Store Backup Binding Request" },
    { ZBEE_ZDP_REQ_REMOVE_BAK_BIND_ENTRY,         "Remove Backup Binding Request" },
    { ZBEE_ZDP_REQ_BACKUP_BIND_TABLE,             "Backup Binding Table Request" },
    { ZBEE_ZDP_REQ_RECOVER_BIND_TABLE,            "Recover Binding Table Request" },
    { ZBEE_ZDP_REQ_BACKUP_SOURCE_BIND,            "Backup Source Binding Request" },
    { ZBEE_ZDP_REQ_RECOVER_SOURCE_BIND,           "Recover Source Binding Request" },
    { ZBEE_ZDP_REQ_CLEAR_ALL_BINDINGS,            "Clear All Bindings Request" },

    { ZBEE_ZDP_REQ_MGMT_NWK_DISC,                 "Network Discovery Request" },
    { ZBEE_ZDP_REQ_MGMT_LQI,                      "Link Quality Request" },
    { ZBEE_ZDP_REQ_MGMT_RTG,                      "Routing Table Request" },
    { ZBEE_ZDP_REQ_MGMT_BIND,                     "Binding Table Request" },
    { ZBEE_ZDP_REQ_MGMT_LEAVE,                    "Leave Request" },
    { ZBEE_ZDP_REQ_MGMT_DIRECT_JOIN,              "Direct Join Request" },
    { ZBEE_ZDP_REQ_MGMT_PERMIT_JOIN,              "Permit Join Request" },
    { ZBEE_ZDP_REQ_MGMT_CACHE,                    "Cache Request" },
    { ZBEE_ZDP_REQ_MGMT_NWKUPDATE,                "Network Update Request" },
    { ZBEE_ZDP_REQ_MGMT_NWKUPDATE_ENH,            "Network Update Enhanced Request" },
    { ZBEE_ZDP_REQ_MGMT_IEEE_JOIN_LIST,           "IEEE Joining List Request" },
    { ZBEE_ZDP_REQ_MGMT_NWK_BEACON_SURVEY,        "Beacon Survey Request"},
    { ZBEE_ZDP_REQ_SECURITY_START_KEY_NEGOTIATION,"Security Start Key Negotiation Request" },
    { ZBEE_ZDP_REQ_SECURITY_GET_AUTH_TOKEN,       "Security Get Authentication Token Request"},
    { ZBEE_ZDP_REQ_SECURITY_GET_AUTH_LEVEL,       "Security Get Authentication Level Request"},
    { ZBEE_ZDP_REQ_SECURITY_SET_CONFIGURATION,    "Security Set Configuration Request"},
    { ZBEE_ZDP_REQ_SECURITY_GET_CONFIGURATION,    "Security Get Configuration Request"},
    { ZBEE_ZDP_REQ_SECURITY_START_KEY_UPDATE,     "Security Start Key Update Request"},
    { ZBEE_ZDP_REQ_SECURITY_DECOMMISSION,         "Security Decommission Request"},
    { ZBEE_ZDP_REQ_SECURITY_CHALLENGE,            "Security Challenge Request"},

    { ZBEE_ZDP_RSP_NWK_ADDR,                      "Network Address Response" },
    { ZBEE_ZDP_RSP_IEEE_ADDR,                     "Extended Address Response" },
    { ZBEE_ZDP_RSP_NODE_DESC,                     "Node Descriptor Response" },
    { ZBEE_ZDP_RSP_POWER_DESC,                    "Power Descriptor Response" },
    { ZBEE_ZDP_RSP_SIMPLE_DESC,                   "Simple Descriptor Response" },
    { ZBEE_ZDP_RSP_ACTIVE_EP,                     "Active Endpoint Response" },
    { ZBEE_ZDP_RSP_MATCH_DESC,                    "Match Descriptor Response" },
    { ZBEE_ZDP_RSP_COMPLEX_DESC,                  "Complex Descriptor Response" },
    { ZBEE_ZDP_RSP_USER_DESC,                     "User Descriptor Response" },
    { ZBEE_ZDP_RSP_DISCOVERY_CACHE,               "Discovery Cache Response" },
    { ZBEE_ZDP_RSP_CONF_USER_DESC,                "Set User Descriptor Confirm" },
    { ZBEE_ZDP_RSP_SYSTEM_SERVER_DISC,            "Server Discovery Response" },
    { ZBEE_ZDP_RSP_STORE_DISCOVERY,               "Store Discovery Response" },
    { ZBEE_ZDP_RSP_STORE_NODE_DESC,               "Store Node Descriptor Response" },
    { ZBEE_ZDP_RSP_STORE_POWER_DESC,              "Store Power Descriptor Response" },
    { ZBEE_ZDP_RSP_STORE_ACTIVE_EP,               "Store Active Endpoints Response" },
    { ZBEE_ZDP_RSP_STORE_SIMPLE_DESC,             "Store Simple Descriptor Response" },
    { ZBEE_ZDP_RSP_REMOVE_NODE_CACHE,             "Remove Node Cache Response" },
    { ZBEE_ZDP_RSP_FIND_NODE_CACHE,               "Find Node Cache Response" },
    { ZBEE_ZDP_RSP_EXT_SIMPLE_DESC,               "Extended Simple Descriptor Response" },
    { ZBEE_ZDP_RSP_EXT_ACTIVE_EP,                 "Extended Active Endpoint Response" },
    { ZBEE_ZDP_RSP_PARENT_ANNCE,                  "Parent Announce Response" },
    { ZBEE_ZDP_RSP_END_DEVICE_BIND,               "End Device Bind Response" },
    { ZBEE_ZDP_RSP_BIND,                          "Bind Response" },
    { ZBEE_ZDP_RSP_UNBIND,                        "Unbind Response" },
    { ZBEE_ZDP_RSP_BIND_REGISTER,                 "Bind Register Response" },
    { ZBEE_ZDP_RSP_REPLACE_DEVICE,                "Replace Device Response" },
    { ZBEE_ZDP_RSP_STORE_BAK_BIND_ENTRY,          "Store Backup Binding Response" },
    { ZBEE_ZDP_RSP_REMOVE_BAK_BIND_ENTRY,         "Remove Backup Binding Response" },
    { ZBEE_ZDP_RSP_BACKUP_BIND_TABLE,             "Backup Binding Table Response" },
    { ZBEE_ZDP_RSP_RECOVER_BIND_TABLE,            "Recover Binding Table Response" },
    { ZBEE_ZDP_RSP_BACKUP_SOURCE_BIND,            "Backup Source Binding Response" },
    { ZBEE_ZDP_RSP_RECOVER_SOURCE_BIND,           "Recover Source Binding Response" },
    { ZBEE_ZDP_RSP_CLEAR_ALL_BINDINGS,            "Clear All Bindings Response" },
    { ZBEE_ZDP_RSP_MGMT_NWK_DISC,                 "Network Discovery Response" },
    { ZBEE_ZDP_RSP_MGMT_LQI,                      "Link Quality Response" },
    { ZBEE_ZDP_RSP_MGMT_RTG,                      "Routing Table Response" },
    { ZBEE_ZDP_RSP_MGMT_BIND,                     "Binding Table Response" },
    { ZBEE_ZDP_RSP_MGMT_LEAVE,                    "Leave Response" },
    { ZBEE_ZDP_RSP_MGMT_DIRECT_JOIN,              "Direct Join Response" },
    { ZBEE_ZDP_RSP_MGMT_PERMIT_JOIN,              "Permit Join Response" },
    { ZBEE_ZDP_RSP_MGMT_CACHE,                    "Cache Response" },
    { ZBEE_ZDP_NOT_MGMT_NWKUPDATE,                "Network Update Notify" },
    { ZBEE_ZDP_NOT_MGMT_NWKUPDATE_ENH,            "Network Enhanced Update Notify" },
    { ZBEE_ZDP_RSP_MGMT_IEEE_JOIN_LIST,           "IEEE Joining List Response" },
    { ZBEE_ZDP_NOT_MGMT_UNSOLICITED_NWKUPDATE,    "Unsolicited Enhanced Network Update Notify" },
    { ZBEE_ZDP_RSP_MGMT_NWK_BEACON_SURVEY,        "Beacon Survey Response"},
    { ZBEE_ZDP_RSP_SECURITY_START_KEY_NEGOTIATION,"Security Start Key Negotiation Response" },
    { ZBEE_ZDP_RSP_SECURITY_GET_AUTH_TOKEN,       "Security Get Authentication Token Response"},
    { ZBEE_ZDP_RSP_SECURITY_GET_AUTH_LEVEL,       "Security Get Authentication Level Response"},
    { ZBEE_ZDP_RSP_SECURITY_SET_CONFIGURATION,    "Security Set Configuration Response"},
    { ZBEE_ZDP_RSP_SECURITY_GET_CONFIGURATION,    "Security Get Configuration Response"},
    { ZBEE_ZDP_RSP_SECURITY_START_KEY_UPDATE,     "Security Start Key Update Response"},
    { ZBEE_ZDP_RSP_SECURITY_DECOMMISSION,         "Security Decommission Response"},
    { ZBEE_ZDP_RSP_SECURITY_CHALLENGE,            "Security Challenge Response"},
    { 0, NULL }
};

static const value_string zbee_zdp_status_names[] = {
    { ZBEE_ZDP_STATUS_SUCCESS,                    "Success" },
    { ZBEE_ZDP_STATUS_INV_REQUESTTYPE,            "Invalid Request Type" },
    { ZBEE_ZDP_STATUS_DEVICE_NOT_FOUND,           "Device Not Found" },
    { ZBEE_ZDP_STATUS_INVALID_EP,                 "Invalid Endpoint" },
    { ZBEE_ZDP_STATUS_NOT_ACTIVE,                 "Not Active" },
    { ZBEE_ZDP_STATUS_NOT_SUPPORTED,              "Not Supported" },
    { ZBEE_ZDP_STATUS_TIMEOUT,                    "Timeout" },
    { ZBEE_ZDP_STATUS_NO_MATCH,                   "No Match" },
    { ZBEE_ZDP_STATUS_NO_ENTRY,                   "No Entry" },
    { ZBEE_ZDP_STATUS_NO_DESCRIPTOR,              "No Descriptor" },
    { ZBEE_ZDP_STATUS_INSUFFICIENT_SPACE,         "Insufficient Space" },
    { ZBEE_ZDP_STATUS_NOT_PERMITTED,              "Not Permitted" },
    { ZBEE_ZDP_STATUS_TABLE_FULL,                 "Table Full" },
    { ZBEE_ZDP_STATUS_NOT_AUTHORIZED,             "Not Authorized" },
    { ZBEE_ZDP_STATUS_DEVICE_BINDING_TABLE_FULL,  "Device Binding Table Full" },
    { ZBEE_ZDP_STATUS_INVALID_INDEX,              "Invalid Index" },
    { ZBEE_ZDP_STATUS_RESPONSE_TOO_LARGE,         "Response Too Large" },
    { ZBEE_ZDP_STATUS_MISSING_TLV,                "Missing TLV" },
    { 0, NULL }
};

static const value_string zbee_zll_device_names[] = {
    { ZBEE_ZLL_DEVICE_ON_OFF_LIGHT,               "On/Off light" },
    { ZBEE_ZLL_DEVICE_ON_OFF_PLUG_IN_UNIT,        "On/Off plug-in unit" },
    { ZBEE_ZLL_DEVICE_DIMMABLE_LIGHT,             "Dimmable light" },
    { ZBEE_ZLL_DEVICE_DIMMABLE_PLUG_IN_UNIT,      "Dimmable plug-in unit" },
    { ZBEE_ZLL_DEVICE_COLOR_LIGHT,                "Color light" },
    { ZBEE_ZLL_DEVICE_EXTENDED_COLOR_LIGHT,       "Extended color light" },
    { ZBEE_ZLL_DEVICE_COLOR_TEMPERATURE_LIGHT,    "Color temperature light" },
    { ZBEE_ZLL_DEVICE_COLOR_CONTROLLER,           "Color controller" },
    { ZBEE_ZLL_DEVICE_COLOR_SCENE_CONTROLLER,     "Color scene controller" },
    { ZBEE_ZLL_DEVICE_NON_COLOR_CONTROLLER,       "Non-color controller" },
    { ZBEE_ZLL_DEVICE_NON_COLOR_SCENE_CONTROLLER, "Non-color scene controller" },
    { ZBEE_ZLL_DEVICE_CONTROL_BRIDGE,             "Control Bridge" },
    { ZBEE_ZLL_DEVICE_ON_OFF_SENSOR,              "On/Off sensor" },
    { 0, NULL }
};

static const value_string zbee_ha_device_names[] = {
    { ZBEE_HA_DEVICE_ON_OFF_LIGHT,               "On/Off light" },
    { ZBEE_HA_DEVICE_DIMMABLE_LIGHT,             "Dimmable light" },
    { ZBEE_HA_DEVICE_COLOR_DIMMABLE_LIGHT,       "Color dimmable light" },
    { ZBEE_HA_DEVICE_ON_OFF_LIGHT_SWITCH,        "On/Off light switch" },
    { ZBEE_HA_DEVICE_DIMMER_SWITCH,              "Dimmer switch" },
    { ZBEE_HA_DEVICE_COLOR_DIMMER_SWITCH,        "Color dimmer switch" },
    { ZBEE_HA_DEVICE_LIGHT_SENSOR,               "Light sensor" },
    { ZBEE_HA_DEVICE_OCCUPANCY_SENSOR,           "Occupancy sensor" },
    { ZBEE_HA_DEVICE_ON_OFF_BALLAST,             "On/Off ballast" },
    { ZBEE_HA_DEVICE_DIMMABLE_BALLAST,           "Dimmable ballast" },
    { ZBEE_HA_DEVICE_ON_OFF_PLUG_IN_UNIT,        "On/Off plug-in unit" },
    { ZBEE_HA_DEVICE_DIMMABLE_PLUG_IN_UNIT,      "Dimmable plug-in unit" },
    { ZBEE_HA_DEVICE_COLOR_TEMPERATURE_LIGHT,    "Color temperature light" },
    { ZBEE_HA_DEVICE_EXTENDED_COLOR_LIGHT,       "Extended color light" },
    { ZBEE_HA_DEVICE_LIGHT_LEVEL_SENSOR,         "Light level sensor" },
    { ZBEE_HA_DEVICE_COLOR_CONTROLLER,           "Color controller" },
    { ZBEE_HA_DEVICE_COLOR_SCENE_CONTROLLER,     "Color scene controller" },
    { ZBEE_HA_DEVICE_NON_COLOR_CONTROLLER,       "Non-color controller" },
    { ZBEE_HA_DEVICE_NON_COLOR_SCENE_CONTROLLER, "Non-color scene controller" },
    { ZBEE_HA_DEVICE_CONTROL_BRIDGE,             "Control Bridge" },
    { ZBEE_HA_DEVICE_ON_OFF_SENSOR,              "On/Off sensor" },
    { 0, NULL }
};

const value_string zbee_zdp_rtg_status_vals[] = {
    { 0x00,  "Active" },
    { 0x01,  "Discovery Underway" },
    { 0x02,  "Discovery Failed" },
    { 0x03,  "Inactive" },
    { 0, NULL }
};

static const value_string zbee_zdp_ieee_join_policy_vals[] = {
    { 0x00,  "All Join" },
    { 0x01,  "IEEE Join" },
    { 0x02,  "No Join" },
    { 0, NULL }
};

/* The reason this has it's own value_string and doesn't use
   tfs_get_string(), is that some hf_ fields use bitmasks larger
   than 0x01, and it's intentional that those other values be
   "Unknown" (which is what value_string will give us)
 */
static const value_string zbee_zdp_true_false_plus_vals[] = {
    { 0x00,  "False" },
    { 0x01,  "True" },
    { 0, NULL }
};

static const value_string zbee_zdp_table_entry_type_vals[] = {
    { 0x00,  "Coordinator" },
    { 0x01,  "Router" },
    { 0x02,  "End Device" },
    { 0, NULL }
};

static const value_string zbee_zdp_relationship_vals[] = {
    { 0x00,  "Parent" },
    { 0x01,  "Child" },
    { 0x02,  "Sibling" },
    { 0x03,  "None" },
    { 0x04,  "Previous Child" },
    { 0, NULL }
};

static const range_string zbee_zcl_zdp_address_modes[] = {
    { 0x0, 0x0, "Reserved" },
    { ZBEE_ZDP_ADDR_MODE_GROUP, ZBEE_ZDP_ADDR_MODE_GROUP, "Group" },
    { 0x02, 0x02, "Reserved" },
    { ZBEE_ZDP_ADDR_MODE_UNICAST, ZBEE_ZDP_ADDR_MODE_UNICAST, "Unicast" },
    { 0x03, 0xFF, "Reserved" },
    { 0, 0, NULL }
};

/*
    if (tree) {
        if (type == 0x00)       proto_item_append_text(ti, ", Type: Coordinator");
        else if (type == 0x01)  proto_item_append_text(ti, ", Type: Router");
        else if (type == 0x02)  proto_item_append_text(ti, ", Type: End Device");
        else                    proto_item_append_text(ti, ", Type: Unknown");

        if (idle_rx == 0x00)    proto_item_append_text(ti, ", Idle Rx: False");
        else if (idle_rx==0x01) proto_item_append_text(ti, ", Idle Rx: True");
        else                    proto_item_append_text(ti, ", Idle Rx: Unknown");

        if (rel == 0x00)        proto_item_append_text(ti, ", Relationship: Parent");
        else if (rel == 0x01)   proto_item_append_text(ti, ", Relationship: Child");
        else if (rel == 0x02)   proto_item_append_text(ti, ", Relationship: Sibling");
        else if (rel == 0x03)   proto_item_append_text(ti, ", Relationship: None");
        else if (rel == 0x04)   proto_item_append_text(ti, ", Relationship: Previous Child");
        else                    proto_item_append_text(ti, ", Relationship: Unknown");
    }
*/

/**
 *Returns a status name for a given status value.
 *
*/
const char *
zdp_status_name(uint8_t status)
{
    return val_to_str_const(status, zbee_zdp_status_names, "Reserved");
} /* zdp_status_name */

/**
 *Converts a ZigBee 2003 & earlier cluster ID to a 2006
 *
*/
static uint16_t
zdp_convert_2003cluster(uint8_t cluster)
{
    uint16_t cluster16 = (uint16_t)cluster;

    if (cluster16 & ZBEE_ZDP_MSG_RESPONSE_BIT_2003) {
        /* Clear the 2003 request bit. */
        cluster16 &= ~(ZBEE_ZDP_MSG_RESPONSE_BIT_2003);
        /* Set the 2006 request bit. */
        cluster16 |= (ZBEE_ZDP_MSG_RESPONSE_BIT);
    }
    return cluster16;
} /* zdp_convert_2003cluster */

/**
 *Helper functions dumps any excess data into the data dissector.
 *
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset after parsing last item.
 *@param pinfo packet information structure.
 *@param tree pointer to data tree Wireshark uses to display packet.
*/
void
zdp_dump_excess(tvbuff_t *tvb, unsigned offset, packet_info *pinfo, proto_tree *tree)
{
    proto_tree  *root = proto_tree_get_root(tree);
    unsigned    length = tvb_captured_length_remaining(tvb, offset);
    tvbuff_t    *excess;

    if (length > 0) {
        excess = tvb_new_subset_remaining(tvb, offset);
        call_data_dissector(excess, pinfo, root);
    }
} /* zdp_dump_excess */

/**
 *ZigBee helper function. Appends the info to the info column
 *
 *@param item item to display info on.
 *@param pinfo packet info struct.
 *@param format format string.
*/
void
zbee_append_info(proto_item *item, packet_info *pinfo, const char *format, ...)
{
    static char     buffer[512];
    va_list         ap;

    va_start(ap, format);
    vsnprintf(buffer, 512, format, ap);
    va_end(ap);

    proto_item_append_text(item, "%s", buffer);

    col_append_str(pinfo->cinfo, COL_INFO, buffer);
} /* zbee_add_info */

/**
 *ZigBee helper function. extracts an EUI64 address and displays
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param hfindex index to field information.
 *@param tvb pointer to buffer containing raw packet.
 *@param offset pointer to value of offset.
 *@param length length of the value to extract.
 *@param ti optional pointer to get the created proto item.
 *@return the value read out of the tvbuff and added to the tree.
*/
uint64_t
zbee_parse_eui64(proto_tree *tree, int hfindex, tvbuff_t *tvb, unsigned *offset, unsigned length, proto_item **ti)
{
    proto_item          *item = NULL;
    uint64_t            value;

    /* Get the value. */
    value = tvb_get_letoh64(tvb, *offset);

    /* Display it. */
    item = proto_tree_add_eui64(tree, hfindex, tvb, *offset, length, value);

    /* Increment the offset. */
    *offset += (int)sizeof(uint64_t);

    /* return the item if requested. */
    if (ti) *ti = item;

    /* return the value. */
    return value;
} /* zbee_parse_eui64 */

/**
 *Parses and displays the status value.
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset into the tvb to find the status value.
*/
uint8_t
zdp_parse_status(proto_tree *tree, tvbuff_t *tvb, unsigned *offset)
{
    uint8_t     status;

    /* Get and display the flags. */
    status = tvb_get_uint8(tvb, *offset);
    proto_tree_add_uint(tree, hf_zbee_zdp_status, tvb, *offset, (int)sizeof(uint8_t), status);

    *offset += (int)sizeof(uint8_t);

    return status;
} /* zdp_parse_status */


/**
 *Parses and displays the a channel mask.
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset into the tvb to find the status value.
*/
uint32_t
zdp_parse_chanmask(proto_tree *tree, tvbuff_t *tvb, unsigned *offset, int hf_page, int hf_channel)
{
    int         i;
    uint32_t    mask;
    uint8_t     page;
    proto_item  *ti;

    /* Get and display the channel mask. */
    mask = tvb_get_letohl(tvb, *offset);

    page = (uint8_t)((mask & ZBEE_ZDP_NWKUPDATE_PAGE) >> 27);
    mask &= ZBEE_ZDP_NWKUPDATE_CHANNEL;

    proto_tree_add_uint(tree, hf_page, tvb, *offset, 4, page);
    ti = proto_tree_add_uint_format(tree, hf_channel, tvb, *offset, 4, mask, "Channels: ");

    /* Check if there are any channels to display. */
    if (mask==0) {
        proto_item_append_text(ti, "None");
    }
    /* Display the first channel #. */
    for (i=0; i<32; i++) {
        if ((1<<i) & mask) {
            proto_item_append_text(ti, "%d", i++);
            break;
        }
    } /* for */
    /* Display the rest of the channels. */
    for (;i<32; i++) {
        if (!((1<<i) & mask)) {
            /* This channel isn't selected. */
            continue;
        }
        /* If the previous channel wasn't selected, then display the
         * channel number.
         */
        if ( ! ((1<<(i-1)) & mask) ) {
            proto_item_append_text(ti, ", %d", i);
        }
        /*
         * If the next channel is selected too, skip past it and display
         * a range of values instead.
         */
        if ((2<<i) & mask) {
            while ((2<<i) & mask) i++;
            proto_item_append_text(ti, "-%d", i);
        }
    } /* for */

    *offset += (int)sizeof(uint32_t);

    return mask;
} /* zdp_parse_chanmask */

/**
 *Parses and displays MAC capability info flags.
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param ettindex subtree index to create the node descriptor in, or -1
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset into the tvb to find the node descriptor.
*/
uint8_t
zdp_parse_cinfo(proto_tree *tree, int ettindex, tvbuff_t *tvb, unsigned *offset)
{
    uint8_t     flags;
    static int * const cinfo[] = {
        &hf_zbee_zdp_cinfo_alt_coord,
        &hf_zbee_zdp_cinfo_ffd,
        &hf_zbee_zdp_cinfo_power,
        &hf_zbee_zdp_cinfo_idle_rx,
        &hf_zbee_zdp_cinfo_security,
        &hf_zbee_zdp_cinfo_alloc,
        NULL
    };

    /* Get and display the flags. */
    proto_tree_add_bitmask_with_flags(tree, tvb, *offset, hf_zbee_zdp_cinfo, ettindex, cinfo, ENC_NA, BMT_NO_APPEND);
    flags = tvb_get_uint8(tvb, *offset);
    *offset += 1;

    return flags;
} /* zdp_parse_cinfo */

/**
 *Parses and displays server mode flags.
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param ettindex subtree index to create the node descriptor in, or -1
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset into the tvb to find the node descriptor.
*/
uint16_t
zdp_parse_server_flags(proto_tree *tree, int ettindex, tvbuff_t *tvb, unsigned *offset)
{
    uint16_t     flags;
    static int * const server_flags[] = {
        &hf_zbee_zdp_server_pri_trust,
        &hf_zbee_zdp_server_bak_trust,
        &hf_zbee_zdp_server_pri_bind,
        &hf_zbee_zdp_server_bak_bind,
        &hf_zbee_zdp_server_pri_disc,
        &hf_zbee_zdp_server_bak_disc,
        &hf_zbee_zdp_server_network_manager,
        &hf_zbee_zdp_server_stk_compl_rev,
        NULL
    };

    /* Get and display the flags. */
    flags = tvb_get_letohs(tvb, *offset);
    proto_tree_add_bitmask_with_flags(tree, tvb, *offset, hf_zbee_zdp_server, ettindex, server_flags, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
    *offset += 2;

    return flags;
} /* zdp_parse_server_flags */

/**
 *Parses and displays a node descriptor to the specified
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param ettindex subtree index to create the node descriptor in, or -1
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset into the tvb to find the node descriptor.
*/
void
zdp_parse_node_desc(proto_tree *tree, packet_info *pinfo, bool show_ver_flags, int ettindex, tvbuff_t *tvb, unsigned *offset, uint8_t version)
{
    proto_item  *ti;
    proto_item  *field_root = NULL;
    proto_tree  *field_tree = NULL;

    uint16_t    flags;
    /*uint8_t     capability;*/
    /*uint16_t    mfr_code;*/
    /*uint8_t     max_buff;*/
    /*uint16_t    max_transfer;*/
    static int * const nodes[] = {
        &hf_zbee_zdp_node_complex,
        &hf_zbee_zdp_node_user,
        &hf_zbee_zdp_node_frag_support,
        &hf_zbee_zdp_node_freq_868,
        &hf_zbee_zdp_node_freq_900,
        &hf_zbee_zdp_node_freq_2400,
        &hf_zbee_zdp_node_freq_eu_sub_ghz,
        NULL
    };

    if ((tree) && (ettindex != -1)) {
        field_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ettindex, &field_root, "Node Descriptor");
    }
    else
        field_tree = tree;

    /* Get and display the flags. */
    flags = tvb_get_letohs(tvb, *offset);
    if (tree) {
        uint16_t type = flags & ZBEE_ZDP_NODE_TYPE;
        ti = proto_tree_add_uint(field_tree, hf_zbee_zdp_node_type, tvb, *offset, 2, type);
        /* XXX - should probably be converted to proto_tree_add_bitmask */
        proto_tree_add_bitmask_list(field_tree, tvb, *offset, 2, nodes, ENC_LITTLE_ENDIAN);

        /* Enumerate the type field. */
        if (type == ZBEE_ZDP_NODE_TYPE_COORD)    proto_item_append_text(ti, " (Coordinator)");
        else if (type == ZBEE_ZDP_NODE_TYPE_FFD) proto_item_append_text(ti, " (Router)");
        else if (type == ZBEE_ZDP_NODE_TYPE_RFD) proto_item_append_text(ti, " (End Device)");
        else proto_item_append_text(ti, " (Reserved)");
    }
    *offset += 2;

    /* Get and display the capability flags. */
    /*capability      =*/ zdp_parse_cinfo(field_tree, ett_zbee_zdp_cinfo, tvb, offset);
    proto_tree_add_item(field_tree, hf_zbee_zdp_node_manufacturer, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
    *offset += 2;
    proto_tree_add_item(field_tree, hf_zbee_zdp_node_max_buffer, tvb, *offset, 1, ENC_LITTLE_ENDIAN);
    *offset += 1;
    proto_tree_add_item(field_tree, hf_zbee_zdp_node_max_incoming_transfer, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
    *offset += 2;

    /* Get and display the server flags. */
    if (version >= ZBEE_VERSION_2007) {
        uint16_t ver_flags;
        static int * const descriptors[] = {
            &hf_zbee_zdp_dcf_eaela,
            &hf_zbee_zdp_dcf_esdla,
            NULL
        };

        ver_flags = zdp_parse_server_flags(field_tree, ett_zbee_zdp_server, tvb, offset) & ZBEE_ZDP_NODE_SERVER_STACK_COMPL_REV;
        if (show_ver_flags && ver_flags) {
            zbee_append_info(tree, pinfo, ", Rev: %d",
                             (ver_flags >> ws_ctz(ZBEE_ZDP_NODE_SERVER_STACK_COMPL_REV)));
        }
        proto_tree_add_item(field_tree, hf_zbee_zdp_node_max_outgoing_transfer, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
        *offset += 2;
        proto_tree_add_bitmask_with_flags(field_tree, tvb, *offset, hf_zbee_zdp_dcf, ett_zbee_zdp_descriptor_capability_field, descriptors, ENC_NA, BMT_NO_APPEND);
        *offset += 1;
    }

    /* Correct the length of the subtree. */
    if (tree && (ettindex != -1)) {
        proto_item_set_len(field_root, *offset);
    }

} /* zdp_parse_node_desc */


static const value_string zbee_zdp_power_mode_vals[] = {
   { ZBEE_ZDP_POWER_MODE_RX_ON,              "Receiver Always On"          },
   { ZBEE_ZDP_POWER_MODE_RX_PERIODIC,        "Receiver Periodically On"    },
   { ZBEE_ZDP_POWER_MODE_RX_STIMULATE,       "Receiver On When Stimulated" },

   { 0,                    NULL }
};

static const value_string zbee_zdp_power_level_vals[] = {
   { ZBEE_ZDP_POWER_LEVEL_FULL,      "Full"          },
   { ZBEE_ZDP_POWER_LEVEL_OK,        "OK"    },
   { ZBEE_ZDP_POWER_LEVEL_LOW,       "Low" },
   { ZBEE_ZDP_POWER_LEVEL_CRITICAL,  "Critical" },

   { 0,                    NULL }
};
/**
 *Parses and displays a node descriptor to the specified
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param ettindex subtree index to create the node descriptor in, or -1
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset into the tvb to find the node descriptor.
*/
void
zdp_parse_power_desc(proto_tree *tree, int ettindex, tvbuff_t *tvb, unsigned *offset)
{
    static int * const power_desc[] = {
        &hf_zbee_zdp_power_mode,
        &hf_zbee_zdp_power_avail_ac,
        &hf_zbee_zdp_power_avail_recharge,
        &hf_zbee_zdp_power_avail_dispose,
        &hf_zbee_zdp_power_source_ac,
        &hf_zbee_zdp_power_source_recharge,
        &hf_zbee_zdp_power_source_dispose,
        &hf_zbee_zdp_power_level,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, *offset, hf_zbee_zdp_power, ettindex, power_desc, ENC_LITTLE_ENDIAN, BMT_NO_APPEND);
    *offset += 2;
} /* zdp_parse_power_desc */

/**
 *Parses and displays a simple descriptor to the specified
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param ettindex subtree index to create the node descriptor in, or -1
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset into the tvb to find the node descriptor.
*/
void
zdp_parse_simple_desc(proto_tree *tree, int ettindex, tvbuff_t *tvb, unsigned *offset, uint8_t version)
{
    proto_item  *field_root = NULL;
    proto_tree  *field_tree = NULL, *cluster_tree = NULL;
    unsigned    i, sizeof_cluster;

    int         hf_app_device;
    uint32_t    profile;
    uint32_t    in_count, out_count;

    if ((tree) && (ettindex != -1)) {
        field_tree = proto_tree_add_subtree(tree, tvb, *offset, -1, ettindex, &field_root, "Simple Descriptor");
    }
    else field_tree = tree;

    proto_tree_add_item(field_tree, hf_zbee_zdp_endpoint, tvb, *offset, 1, ENC_LITTLE_ENDIAN);
    *offset += 1;

    proto_tree_add_item_ret_uint(field_tree, hf_zbee_zdp_profile, tvb, *offset, 2, ENC_LITTLE_ENDIAN, &profile);
    *offset += 2;

    switch (profile)
    {
    case ZBEE_PROFILE_ZLL: hf_app_device = hf_zbee_zdp_simple_zll_app_device; break;
    case ZBEE_PROFILE_HA:  hf_app_device = hf_zbee_zdp_simple_ha_app_device;  break;
    default:               hf_app_device = hf_zbee_zdp_simple_app_device;     break;
    }
    proto_tree_add_item(field_tree, hf_app_device, tvb, *offset, 2, ENC_LITTLE_ENDIAN);
    *offset += 2;

    proto_tree_add_item(field_tree, hf_zbee_zdp_simple_app_version, tvb, *offset, 1, ENC_LITTLE_ENDIAN);
    *offset += 1;

    sizeof_cluster = (version >= ZBEE_VERSION_2007)?(int)sizeof(uint16_t):(int)sizeof(uint8_t);

    proto_tree_add_item_ret_uint(field_tree, hf_zbee_zdp_in_count, tvb, *offset, 1, ENC_LITTLE_ENDIAN, &in_count);
    *offset += 1;

    if ((tree) && (in_count)) {
        cluster_tree = proto_tree_add_subtree(field_tree, tvb, *offset, in_count*sizeof_cluster,
                                                ett_zbee_zdp_node_in, NULL, "Input Cluster List");
    }
    for (i=0; i<in_count && tvb_bytes_exist(tvb, *offset, sizeof_cluster); i++) {
        proto_tree_add_item(cluster_tree, hf_zbee_zdp_in_cluster, tvb, *offset, sizeof_cluster, ENC_LITTLE_ENDIAN);
        *offset += sizeof_cluster;
    }

    proto_tree_add_item_ret_uint(field_tree, hf_zbee_zdp_out_count, tvb, *offset, 1, ENC_LITTLE_ENDIAN, &out_count);
    *offset += 1;
    if ((tree) && (out_count)) {
        cluster_tree = proto_tree_add_subtree(field_tree, tvb, *offset, out_count*sizeof_cluster,
                                                ett_zbee_zdp_node_out, NULL, "Output Cluster List");
    }
    for (i=0; (i<out_count) && tvb_bytes_exist(tvb, *offset, sizeof_cluster); i++) {
        proto_tree_add_item(cluster_tree, hf_zbee_zdp_out_cluster, tvb, *offset, sizeof_cluster, ENC_LITTLE_ENDIAN);
        *offset += sizeof_cluster;
    }

    if (tree && (ettindex != -1)) {
        proto_item_set_len(field_root, *offset);
    }
} /* zdp_parse_simple_desc */

/**
 *Parses and displays a simple descriptor to the specified
 *
 *@param tree pointer to data tree Wireshark uses to display packet.
 *@param ettindex subtree index to create the node descriptor in, or -1
 *@param tvb pointer to buffer containing raw packet.
 *@param offset offset into the tvb to find the node descriptor.
 *@param length length of the complex descriptor.
*/
void
zdp_parse_complex_desc(packet_info *pinfo, proto_tree *tree, int ettindex, tvbuff_t *tvb, unsigned *offset, unsigned length)
{
    enum {
        tag_charset = 1,
        tag_mfr_name = 2,
        tag_model_name = 3,
        tag_serial_no = 4,
        tag_url = 5,
        tag_icon = 6,
        tag_icon_url = 7
    };

    static const char *tag_name[] = {
        "Reserved Tag",
        "languageChar",
        "manufacturerName",
        "modelName",
        "serialNumber",
        "deviceURL",
        "icon",
        "outliner"
    };

    proto_tree  *field_tree;

    char    *complex;
    uint8_t tag;

    if ((tree) && (ettindex != -1)) {
        field_tree = proto_tree_add_subtree(tree, tvb, *offset, length, ettindex, NULL, "Complex Descriptor");
    }
    else
        field_tree = tree;

    tag = tvb_get_uint8(tvb, *offset);
    if (tag == tag_charset) {
        char    *lang_str[2];
        uint8_t ch;
        uint8_t charset  = tvb_get_uint8(tvb, *offset + 3);
        const char *charset_str;

        if (charset == 0x00) charset_str = "ASCII";
        else                 charset_str = "Unknown Character Set";

        ch = tvb_get_uint8(tvb, *offset + 1);
        lang_str[0] = format_char(pinfo->pool, ch);
        ch = tvb_get_uint8(tvb, *offset + 2);
        lang_str[1] = format_char(pinfo->pool, ch);

        complex = wmem_strdup_printf(pinfo->pool, "<%s>%s%s, %s</%s>", tag_name[tag_charset], lang_str[0], lang_str[1], charset_str, tag_name[tag_charset]);
    }
    else if (tag == tag_icon) {
        /* TODO: */
        complex = wmem_strdup_printf(pinfo->pool, "<%s>FixMe</%s>", tag_name[tag_icon], tag_name[tag_icon]);
    }
    else {
        char *str;

        str = (char *) tvb_get_string_enc(pinfo->pool, tvb, *offset+1, length-1, ENC_ASCII);
        /* Handles all string type XML tags. */
        if (tag <= tag_icon_url) {
            complex = wmem_strdup_printf(pinfo->pool, "<%s>%s</%s>", tag_name[tag], str, tag_name[tag]);
        }
        else {
            complex = wmem_strdup_printf(pinfo->pool, "<%s>%s</%s>", tag_name[0], str, tag_name[0]);
        }
    }
    proto_tree_add_string(field_tree, hf_zbee_zdp_complex, tvb, *offset, length, complex);
    *offset += (length);
} /* zdp_parse_complex_desc */

/**
 *ZigBee Device Profile dissector for wireshark.
 *
 *@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_zbee_zdp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
    proto_tree      *zdp_tree;
    proto_item      *proto_root;
    tvbuff_t        *zdp_tvb;

    uint8_t         seqno;
    uint16_t        cluster;
    unsigned        offset = 0;
    zbee_nwk_packet *nwk;

    /* Reject the packet if data is NULL */
    if (data == NULL)
        return 0;
    nwk = (zbee_nwk_packet *)data;

    /* Create the protocol tree. */
    proto_root = proto_tree_add_protocol_format(tree, proto_zbee_zdp, tvb, offset, tvb_captured_length(tvb), "ZigBee Device Profile");
    zdp_tree = proto_item_add_subtree(proto_root, ett_zbee_zdp);

#if 0
    /* Overwrite the protocol column */
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "ZigBee ZDP");
#endif
    /* Get and display the sequence number. */
    seqno = tvb_get_uint8(tvb, offset);
    proto_tree_add_uint(zdp_tree, hf_zbee_zdp_seqno, tvb, offset, (int)sizeof(uint8_t), seqno);

    offset += (int)sizeof(uint8_t);

    if (nwk->version <= ZBEE_VERSION_2004) {
        /* ZigBee 2004 and earlier had different cluster identifiers, need to convert
         * them into the ZigBee 2006 & later values. */
        cluster = zdp_convert_2003cluster((uint8_t)nwk->cluster_id);
    }
    else {
        cluster = nwk->cluster_id;
    }

    /* Update info. */
    proto_item_append_text(zdp_tree, ", %s", val_to_str_const(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));
    col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(cluster, zbee_zdp_cluster_names, "Unknown Cluster"));

    /* Create a new tvb for the zdp message. */
    zdp_tvb = tvb_new_subset_remaining(tvb, offset);

    switch (cluster) {
        case ZBEE_ZDP_REQ_NWK_ADDR:
            dissect_zbee_zdp_req_nwk_addr(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_IEEE_ADDR:
            dissect_zbee_zdp_req_ext_addr(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_NODE_DESC:
            dissect_zbee_zdp_req_node_desc(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_POWER_DESC:
            dissect_zbee_zdp_req_power_desc(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SIMPLE_DESC:
            dissect_zbee_zdp_req_simple_desc(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_ACTIVE_EP:
            dissect_zbee_zdp_req_active_ep(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MATCH_DESC:
            dissect_zbee_zdp_req_match_desc(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_REQ_COMPLEX_DESC:
            dissect_zbee_zdp_req_complex_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_USER_DESC:
            dissect_zbee_zdp_req_user_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_DISCOVERY_CACHE:
            dissect_zbee_zdp_req_discovery_cache(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_DEVICE_ANNCE:
            dissect_zbee_zdp_device_annce(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SET_USER_DESC:
            dissect_zbee_zdp_req_set_user_desc(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_SYSTEM_SERVER_DISC:
            dissect_zbee_zdp_req_system_server_disc(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_STORE_DISCOVERY:
            dissect_zbee_zdp_req_store_discovery(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_STORE_NODE_DESC:
            dissect_zbee_zdp_req_store_node_desc(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_STORE_POWER_DESC:
            dissect_zbee_zdp_req_store_power_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_STORE_ACTIVE_EP:
            dissect_zbee_zdp_req_store_active_ep(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_STORE_SIMPLE_DESC:
            dissect_zbee_zdp_req_store_simple_desc(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_REMOVE_NODE_CACHE:
            dissect_zbee_zdp_req_remove_node_cache(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_FIND_NODE_CACHE:
            dissect_zbee_zdp_req_find_node_cache(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_EXT_SIMPLE_DESC:
            dissect_zbee_zdp_req_ext_simple_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_EXT_ACTIVE_EP:
            dissect_zbee_zdp_req_ext_active_ep(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_PARENT_ANNCE:
            dissect_zbee_zdp_parent_annce(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_END_DEVICE_BIND:
            dissect_zbee_zdp_req_end_device_bind(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_BIND:
            dissect_zbee_zdp_req_bind(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_REQ_UNBIND:
            dissect_zbee_zdp_req_unbind(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_REQ_BIND_REGISTER:
            dissect_zbee_zdp_req_bind_register(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_REPLACE_DEVICE:
            dissect_zbee_zdp_req_replace_device(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_STORE_BAK_BIND_ENTRY:
            dissect_zbee_zdp_req_store_bak_bind_entry(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_REMOVE_BAK_BIND_ENTRY:
            dissect_zbee_zdp_req_remove_bak_bind_entry(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_BACKUP_BIND_TABLE:
            dissect_zbee_zdp_req_backup_bind_table(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_RECOVER_BIND_TABLE:
            dissect_zbee_zdp_req_recover_bind_table(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_BACKUP_SOURCE_BIND:
            dissect_zbee_zdp_req_backup_source_bind(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_RECOVER_SOURCE_BIND:
            dissect_zbee_zdp_req_recover_source_bind(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_CLEAR_ALL_BINDINGS:
            dissect_zbee_zdp_req_clear_all_bindings(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MGMT_NWK_DISC:
            dissect_zbee_zdp_req_mgmt_nwk_disc(zdp_tvb, pinfo, zdp_tree, hf_zbee_zdp_scan_channel);
            break;
        case ZBEE_ZDP_REQ_MGMT_LQI:
            dissect_zbee_zdp_req_mgmt_lqi(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MGMT_RTG:
            dissect_zbee_zdp_req_mgmt_rtg(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MGMT_BIND:
            dissect_zbee_zdp_req_mgmt_bind(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MGMT_LEAVE:
            dissect_zbee_zdp_req_mgmt_leave(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_REQ_MGMT_DIRECT_JOIN:
            dissect_zbee_zdp_req_mgmt_direct_join(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_MGMT_PERMIT_JOIN:
            dissect_zbee_zdp_req_mgmt_permit_join(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MGMT_CACHE:
            dissect_zbee_zdp_req_mgmt_cache(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_REQ_MGMT_NWKUPDATE:
            dissect_zbee_zdp_req_mgmt_nwkupdate(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MGMT_NWKUPDATE_ENH:
            dissect_zbee_zdp_req_mgmt_nwkupdate_enh(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MGMT_IEEE_JOIN_LIST:
            dissect_zbee_zdp_req_mgmt_ieee_join_list(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_MGMT_NWK_BEACON_SURVEY:
            dissect_zbee_zdp_req_mgmt_nwk_beacon_survey(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SECURITY_START_KEY_NEGOTIATION:
            dissect_zbee_zdp_req_security_start_key_negotiation(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SECURITY_GET_AUTH_TOKEN:
            dissect_zbee_zdp_req_security_get_auth_token(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SECURITY_GET_AUTH_LEVEL:
            dissect_zbee_zdp_req_security_get_auth_level(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SECURITY_SET_CONFIGURATION:
            dissect_zbee_zdp_req_security_set_configuration(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SECURITY_GET_CONFIGURATION:
            dissect_zbee_zdp_req_security_get_configuration(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SECURITY_START_KEY_UPDATE:
            dissect_zbee_zdp_req_security_start_key_update(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SECURITY_DECOMMISSION:
            dissect_zbee_zdp_req_security_decommission(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_REQ_SECURITY_CHALLENGE:
            dissect_zbee_zdp_req_security_challenge(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_NWK_ADDR:
            dissect_zbee_zdp_rsp_nwk_addr(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_IEEE_ADDR:
            dissect_zbee_zdp_rsp_ext_addr(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_NODE_DESC:
            dissect_zbee_zdp_rsp_node_desc(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_RSP_POWER_DESC:
            dissect_zbee_zdp_rsp_power_desc(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SIMPLE_DESC:
            dissect_zbee_zdp_rsp_simple_desc(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_RSP_ACTIVE_EP:
            dissect_zbee_zdp_rsp_active_ep(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_MATCH_DESC:
            dissect_zbee_zdp_rsp_match_desc(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_COMPLEX_DESC:
            dissect_zbee_zdp_rsp_complex_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_USER_DESC:
            dissect_zbee_zdp_rsp_user_desc(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_DISCOVERY_CACHE:
            dissect_zbee_zdp_rsp_discovery_cache(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_CONF_USER_DESC:
            dissect_zbee_zdp_rsp_user_desc_conf(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_SYSTEM_SERVER_DISC:
            dissect_zbee_zdp_rsp_system_server_disc(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_STORE_DISCOVERY:
            dissect_zbee_zdp_rsp_discovery_store(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_STORE_NODE_DESC:
            dissect_zbee_zdp_rsp_store_node_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_STORE_POWER_DESC:
            dissect_zbee_zdp_rsp_store_power_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_STORE_ACTIVE_EP:
            dissect_zbee_zdp_rsp_store_active_ep(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_STORE_SIMPLE_DESC:
            dissect_zbee_zdp_rsp_store_simple_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_REMOVE_NODE_CACHE:
            dissect_zbee_zdp_rsp_remove_node_cache(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_FIND_NODE_CACHE:
            dissect_zbee_zdp_rsp_find_node_cache(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_EXT_SIMPLE_DESC:
            dissect_zbee_zdp_rsp_ext_simple_desc(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_EXT_ACTIVE_EP:
            dissect_zbee_zdp_rsp_ext_active_ep(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_PARENT_ANNCE:
            dissect_zbee_zdp_rsp_parent_annce(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_END_DEVICE_BIND:
            dissect_zbee_zdp_rsp_end_device_bind(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_BIND:
            dissect_zbee_zdp_rsp_bind(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_UNBIND:
            dissect_zbee_zdp_rsp_unbind(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_BIND_REGISTER:
            dissect_zbee_zdp_rsp_bind_register(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_REPLACE_DEVICE:
            dissect_zbee_zdp_rsp_replace_device(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_STORE_BAK_BIND_ENTRY:
            dissect_zbee_zdp_rsp_store_bak_bind_entry(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_REMOVE_BAK_BIND_ENTRY:
            dissect_zbee_zdp_rsp_remove_bak_bind_entry(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_BACKUP_BIND_TABLE:
            dissect_zbee_zdp_rsp_backup_bind_table(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_RECOVER_BIND_TABLE:
            dissect_zbee_zdp_rsp_recover_bind_table(zdp_tvb, pinfo, zdp_tree, nwk->version);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_BACKUP_SOURCE_BIND:
            dissect_zbee_zdp_rsp_backup_source_bind(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_RECOVER_SOURCE_BIND:
            dissect_zbee_zdp_rsp_recover_source_bind(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_CLEAR_ALL_BINDINGS:
            dissect_zbee_zdp_rsp_clear_all_bindings(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_MGMT_NWK_DISC:
            dissect_zbee_zdp_rsp_mgmt_nwk_disc(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_RSP_MGMT_LQI:
            dissect_zbee_zdp_rsp_mgmt_lqi(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_RSP_MGMT_RTG:
            dissect_zbee_zdp_rsp_mgmt_rtg(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_MGMT_BIND:
            dissect_zbee_zdp_rsp_mgmt_bind(zdp_tvb, pinfo, zdp_tree, nwk->version);
            break;
        case ZBEE_ZDP_RSP_MGMT_LEAVE:
            dissect_zbee_zdp_rsp_mgmt_leave(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_MGMT_DIRECT_JOIN:
            dissect_zbee_zdp_rsp_mgmt_direct_join(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_RSP_MGMT_PERMIT_JOIN:
            dissect_zbee_zdp_rsp_mgmt_permit_join(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_MGMT_CACHE:
            dissect_zbee_zdp_rsp_mgmt_cache(zdp_tvb, pinfo, zdp_tree);
            expert_add_info(pinfo, zdp_tree, &ei_deprecated_command);
            break;
        case ZBEE_ZDP_NOT_MGMT_NWKUPDATE:
        case ZBEE_ZDP_NOT_MGMT_NWKUPDATE_ENH:
            dissect_zbee_zdp_not_mgmt_nwkupdate(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_MGMT_IEEE_JOIN_LIST:
            dissect_zbee_zdp_rsp_mgmt_ieee_join_list(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_NOT_MGMT_UNSOLICITED_NWKUPDATE:
            dissect_zbee_zdp_not_mgmt_unsolicited_nwkupdate(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_MGMT_NWK_BEACON_SURVEY:
            dissect_zbee_zdp_rsp_mgmt_nwk_beacon_survey(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SECURITY_START_KEY_NEGOTIATION:
            dissect_zbee_zdp_rsp_security_start_key_negotiation(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SECURITY_GET_AUTH_TOKEN:
            dissect_zbee_zdp_rsp_security_get_auth_token(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SECURITY_GET_AUTH_LEVEL:
            dissect_zbee_zdp_rsp_security_get_auth_level(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SECURITY_SET_CONFIGURATION:
            dissect_zbee_zdp_rsp_security_set_configuration(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SECURITY_GET_CONFIGURATION:
            dissect_zbee_zdp_rsp_security_get_configuration(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SECURITY_START_KEY_UPDATE:
            dissect_zbee_zdp_rsp_security_start_key_update(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SECURITY_DECOMMISSION:
            dissect_zbee_zdp_rsp_security_decommission(zdp_tvb, pinfo, zdp_tree);
            break;
        case ZBEE_ZDP_RSP_SECURITY_CHALLENGE:
            dissect_zbee_zdp_rsp_security_challenge(zdp_tvb, pinfo, zdp_tree);
            break;
        default:
            /* Invalid Cluster Identifier. */
            call_data_dissector(zdp_tvb, pinfo, tree);
            break;
    } /* switch */

    return tvb_captured_length(tvb);
} /* dissect_zbee_zdp */

/**
 *ZigBee Device Profile protocol registration routine.
 *
*/
void proto_register_zbee_zdp(void)
{
    static hf_register_info hf[] = {
        { &hf_zbee_zdp_seqno,
        { "Sequence Number",            "zbee_zdp.seqno", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

#if 0
        { &hf_zbee_zdp_length,
        { "Length",                     "zbee_zdp.length", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},
#endif

        { &hf_zbee_zdp_ext_addr,
        { "Extended Address",           "zbee_zdp.ext_addr", FT_EUI64, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_nwk_addr,
        { "Nwk Addr of Interest",       "zbee_zdp.nwk_addr", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_req_type,
        { "Request Type",               "zbee_zdp.req_type", FT_UINT8, BASE_DEC, VALS(zbee_zdp_req_types), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_index,
        { "Index",                      "zbee_zdp.index", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_status,
        { "Status",                     "zbee_zdp.status", FT_UINT8, BASE_HEX, VALS(zbee_zdp_status_names), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_endpoint,
        { "Endpoint",                   "zbee_zdp.endpoint", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_ep_count,
        { "Endpoint Count",             "zbee_zdp.ep_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_profile,
        { "Profile",                    "zbee_zdp.profile", FT_UINT16, BASE_HEX | BASE_RANGE_STRING, RVALS(zbee_aps_apid_names), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_addr_mode,
        { "Address Mode",               "zbee_zdp.addr_mode", FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(zbee_zcl_zdp_address_modes), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_cluster,
        { "Cluster",                    "zbee_zdp.cluster", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_table_size,
        { "Table Size",                 "zbee_zdp.table_size", FT_UINT16, BASE_DEC, NULL, 0x0,
            "Number of entries in the table.", HFILL }},

        { &hf_zbee_zdp_table_count,
        { "Table Count",                "zbee_zdp.table_count", FT_UINT16, BASE_DEC, NULL, 0x0,
            "Number of table entries included in this message.", HFILL }},

        { &hf_zbee_zdp_cache_address,
        { "Cache Address",                "zbee_zdp.cache_address", FT_EUI64, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_in_count,
        { "Input Cluster Count",        "zbee_zdp.in_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_out_count,
        { "Output Cluster Count",       "zbee_zdp.out_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_in_cluster,
        { "Input Cluster",              "zbee_zdp.in_cluster", FT_UINT16, BASE_HEX | BASE_RANGE_STRING, RVALS(zbee_aps_cid_names), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_out_cluster,
        { "Output Cluster",             "zbee_zdp.out_cluster", FT_UINT16, BASE_HEX | BASE_RANGE_STRING, RVALS(zbee_aps_cid_names), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_assoc_device_count,
        { "Associated Device Count",    "zbee_zdp.assoc_device_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_assoc_device,
        { "Associated Device",          "zbee_zdp.assoc_device", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_cinfo,
        { "Capability Information",    "zbee_zdp.cinfo", FT_UINT8, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_cinfo_alt_coord,
        { "Alternate Coordinator",      "zbee_zdp.cinfo.alt_coord", FT_BOOLEAN, 8, NULL, ZBEE_CINFO_ALT_COORD,
            "Indicates that the device is able to operate as a PAN coordinator.", HFILL }},

        { &hf_zbee_zdp_cinfo_ffd,
        { "Full-Function Device",       "zbee_zdp.cinfo.ffd", FT_BOOLEAN, 8, NULL, ZBEE_CINFO_FFD,
            NULL, HFILL }},

        { &hf_zbee_zdp_cinfo_power,
        { "AC Power",                   "zbee_zdp.cinfo.power", FT_BOOLEAN, 8, NULL, ZBEE_CINFO_POWER,
            "Indicates this device is using AC/Mains power.", HFILL }},

        { &hf_zbee_zdp_cinfo_idle_rx,
        { "Rx On When Idle",            "zbee_zdp.cinfo.idle_rx", FT_BOOLEAN, 8, NULL, ZBEE_CINFO_IDLE_RX,
            "Indicates the receiver is active when the device is idle.", HFILL }},

        { &hf_zbee_zdp_cinfo_security,
        { "Security Capability",        "zbee_zdp.cinfo.security", FT_BOOLEAN, 8, NULL, ZBEE_CINFO_SECURITY,
            "Indicates this device is capable of performing encryption/decryption.", HFILL }},

        { &hf_zbee_zdp_cinfo_alloc,
        { "Allocate Short Address",     "zbee_zdp.cinfo.alloc", FT_BOOLEAN, 8, NULL, ZBEE_CINFO_ALLOC,
            "Flag requesting the parent to allocate a short address for this device.", HFILL }},

        { &hf_zbee_zdp_dcf,
        { "Descriptor Capability Field", "zbee_zdp.dcf", FT_UINT8, BASE_HEX, NULL, 0,
            NULL, HFILL }},

        { &hf_zbee_zdp_dcf_eaela,
        { "Extended Active Endpoint List Available", "zbee_zdp.dcf.eaela", FT_BOOLEAN, 8, NULL, ZBEE_ZDP_DCF_EAELA,
            NULL, HFILL }},

        { &hf_zbee_zdp_dcf_esdla,
        { "Extended Simple Descriptor List Available", "zbee_zdp.dcf.esdla", FT_BOOLEAN, 8, NULL, ZBEE_ZDP_DCF_ESDLA,
            NULL, HFILL }},

        { &hf_zbee_zdp_server,
        { "Server Flags",          "zbee_zdp.server", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_server_pri_trust,
        { "Primary Trust Center",       "zbee_zdp.server.pri_trust", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_SERVER_PRIMARY_TRUST,
            NULL, HFILL }},

        { &hf_zbee_zdp_server_bak_trust,
        { "Backup Trust Center",        "zbee_zdp.server.bak_trust", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_SERVER_BACKUP_TRUST,
            NULL, HFILL }},

        { &hf_zbee_zdp_server_pri_bind,
        { "Primary Binding Table Cache","zbee_zdp.server.pri_bind", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_SERVER_PRIMARY_BIND,
            NULL, HFILL }},

        { &hf_zbee_zdp_server_bak_bind,
        { "Backup Binding Table Cache", "zbee_zdp.server.bak_bind", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_SERVER_BACKUP_BIND,
            NULL, HFILL }},

        { &hf_zbee_zdp_server_pri_disc,
        { "Primary Discovery Cache",    "zbee_zdp.server.pri_disc", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_SERVER_PRIMARY_DISC,
            NULL, HFILL }},

        { &hf_zbee_zdp_server_bak_disc,
        { "Backup Discovery Cache",     "zbee_zdp.server.bak_disc", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_SERVER_BACKUP_DISC,
            NULL, HFILL }},

        { &hf_zbee_zdp_server_network_manager,
        { "Network Manager",     "zbee_zdp.server.nwk_mgr", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_SERVER_NETWORK_MANAGER,
            NULL, HFILL }},

        { &hf_zbee_zdp_server_stk_compl_rev,
          { "Stack Compliance Revision",   "zbee_zdp.server.stack_compliance_revision", FT_UINT16, BASE_DEC, NULL, ZBEE_ZDP_NODE_SERVER_STACK_COMPL_REV,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_type,
        { "Type",                       "zbee_zdp.node.type", FT_UINT16, BASE_DEC, NULL, ZBEE_ZDP_NODE_TYPE,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_complex,
        { "Complex Descriptor",         "zbee_zdp.node.complex", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_COMPLEX,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_user,
        { "User Descriptor",            "zbee_zdp.node.user", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_USER,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_frag_support,
        { "Fragmentation Supported",    "zbee_zdp.node.frag_support", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_FRAG_SUPPORT,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_freq_868,
        { "868MHz BPSK Band",           "zbee_zdp.node.freq.868mhz", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_FREQ_868MHZ,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_freq_900,
        { "900MHz BPSK Band",           "zbee_zdp.node.freq.900mhz", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_FREQ_900MHZ,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_freq_2400,
        { "2.4GHz OQPSK Band",          "zbee_zdp.node.freq.2400mhz", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_FREQ_2400MHZ,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_freq_eu_sub_ghz,
        { "EU Sub-GHz FSK Band",        "zbee_zdp.node.freq.eu_sub_ghz", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_NODE_FREQ_EU_SUB_GHZ,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_manufacturer,
        { "Manufacturer Code",          "zbee_zdp.node.manufacturer", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_max_buffer,
        { "Max Buffer Size",            "zbee_zdp.node.max_buffer", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_max_incoming_transfer,
        { "Max Incoming Transfer Size", "zbee_zdp.node.max_incoming_transfer", FT_UINT16, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_node_max_outgoing_transfer,
        { "Max Outgoing Transfer Size", "zbee_zdp.node.max_outgoing_transfer", FT_UINT16, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_power,
        { "Power Descriptor", "zbee_zdp.power", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_power_mode,
        { "Mode",                       "zbee_zdp.power.mode", FT_UINT16, BASE_DEC, VALS(zbee_zdp_power_mode_vals), ZBEE_ZDP_POWER_MODE,
            NULL, HFILL }},

        { &hf_zbee_zdp_power_avail_ac,
        { "Available AC Power",         "zbee_zdp.power.avail.ac", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_POWER_AVAIL_AC,
            NULL, HFILL }},

        { &hf_zbee_zdp_power_avail_recharge,
        { "Available Rechargeable Battery", "zbee_zdp.power.avail.rech", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_POWER_AVAIL_RECHARGEABLE,
            NULL, HFILL }},

        { &hf_zbee_zdp_power_avail_dispose,
        { "Available Disposable Battery",  "zbee_zdp.power.avail.disp", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_POWER_AVAIL_DISPOSABLE,
            NULL, HFILL }},

        { &hf_zbee_zdp_power_source_ac,
        { "Using AC Power",             "zbee_zdp.power.source.ac", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_POWER_SOURCE_AC,
            NULL, HFILL }},

        { &hf_zbee_zdp_power_source_recharge,
        { "Using Rechargeable Battery", "zbee_zdp.power.source.recharge", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_POWER_SOURCE_RECHARGEABLE,
            NULL, HFILL }},

        { &hf_zbee_zdp_power_source_dispose,
        { "Using Disposable Battery",  "zbee_zdp.power.source.dispose", FT_BOOLEAN, 16, NULL, ZBEE_ZDP_POWER_SOURCE_DISPOSABLE,
            NULL, HFILL }},

        { &hf_zbee_zdp_power_level,
        { "Level",                      "zbee_zdp.power.level", FT_UINT16, BASE_DEC, VALS(zbee_zdp_power_level_vals), ZBEE_ZDP_POWER_LEVEL,
            NULL, HFILL }},

        { &hf_zbee_zdp_simple_app_device,
        { "Application Device",         "zbee_zdp.app.device", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_simple_zll_app_device,
        { "Application Device",         "zbee_zdp.app.device", FT_UINT16, BASE_HEX, VALS(zbee_zll_device_names), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_simple_ha_app_device,
        { "Application Device",         "zbee_zdp.app.device", FT_UINT16, BASE_HEX, VALS(zbee_ha_device_names), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_simple_app_version,
        { "Application Version",        "zbee_zdp.app.version", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_complex_length,
        { "Complex Descriptor Length",  "zbee_zdp.complex_length", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_complex,
        { "Complex Descriptor",         "zbee_zdp.complex", FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_user,
        { "User Descriptor",            "zbee_zdp.user", FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_user_length,
        { "User Descriptor Length",     "zbee_zdp.user_length", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_simple_length,
        { "Simple Descriptor Length",   "zbee_zdp.simple_length", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_disc_node_size,
        { "Node Descriptor Size",       "zbee_zdp.node_size", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_disc_power_size,
        { "Power Descriptor Size",      "zbee_zdp.power_size", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_cache,
        { "Cache",                      "zbee_zdp.cache", FT_UINT16, BASE_HEX, NULL, 0x0,
            "Address of the device containing the discovery cache.", HFILL }},

        { &hf_zbee_zdp_disc_ep_count,
        { "Active Endpoint Count",      "zbee_zdp.ep_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_disc_simple_count,
        { "Simple Descriptor Count",    "zbee_zdp.simple_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_disc_simple_size,
        { "Simple Descriptor Size",     "zbee_zdp.simple_size", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_target,
        { "Target",                     "zbee_zdp.target", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_replacement,
        { "Replacement",                "zbee_zdp.replacement", FT_EUI64, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_replacement_ep,
        { "Replacement Endpoint",       "zbee_zdp.replacement_ep", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_bind_src,
        { "Source",                     "zbee_zdp.bind.src", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_bind_src64,
        { "Source",                     "zbee_zdp.bind.src64", FT_EUI64, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_bind_src_ep,
        { "Source Endpoint",            "zbee_zdp.bind.src_ep", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_bind_dst,
        { "Destination",                "zbee_zdp.bind.dst", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_bind_dst64,
        { "Destination",                "zbee_zdp.bind.dst64", FT_EUI64, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_bind_dst_ep,
        { "Destination Endpoint",       "zbee_zdp.bind.dst_ep", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_duration,
        { "Duration",                   "zbee_zdp.duration", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_leave_children,
        { "Remove Children",            "zbee_zdp.leave.children", FT_BOOLEAN, 8, NULL, ZBEE_ZDP_MGMT_LEAVE_CHILDREN,
            NULL, HFILL }},

        { &hf_zbee_zdp_leave_rejoin,
        { "Rejoin",                     "zbee_zdp.leave.rejoin", FT_BOOLEAN, 8, NULL, ZBEE_ZDP_MGMT_LEAVE_REJOIN,
            NULL, HFILL }},

        { &hf_zbee_zdp_significance,
        { "Significance",               "zbee_zdp.significance", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_scan_count,
        { "Scan Count",                 "zbee_zdp.scan_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_update_id,
        { "Update ID",                  "zbee_zdp.update_id", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_manager,
        { "Network Manager",            "zbee_zdp.manager", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_tx_total,
        { "Total Transmissions",        "zbee_zdp.tx_total", FT_UINT16, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_tx_fail,
        { "Failed Transmissions",       "zbee_zdp.tx_fail", FT_UINT16, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_tx_retries,
        { "Retried Transmissions",       "zbee_zdp.tx_retries", FT_UINT16, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_period_time_results,
        { "Period of Time For Results",  "zbee_zdp.period_time_results", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_channel_count,
        { "Channel List Count",         "zbee_zdp.channel_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_channel_page_count,
        { "Channel Page Count",         "zbee_zdp.channel_page_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_channel_page,
        { "Channel Page",               "zbee_zdp.channel_page", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_channel_mask,
        { "Channels",                   "zbee_zdp.channel_mask", FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_channel_energy,
        { "Channel Energy",         "zbee_zdp.channel_energy", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_pan_eui64,
        { "Pan",         "zbee_zdp.pan.eui64", FT_EUI64, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_pan_uint,
        { "Pan",         "zbee_zdp.pan.uint", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_channel,
        { "Channel",         "zbee_zdp.channel", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_nwk_desc_profile,
        { "Profile",         "zbee_zdp.profile", FT_UINT16, BASE_HEX, NULL, 0x0F,
            NULL, HFILL }},

        { &hf_zbee_zdp_profile_version,
        { "Version",         "zbee_zdp.profile_version", FT_UINT8, BASE_DEC, NULL, 0xF0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon,
        { "Beacon Order",         "zbee_zdp.beacon", FT_UINT8, BASE_DEC, NULL, 0x0F,
            NULL, HFILL }},

        { &hf_zbee_zdp_superframe,
        { "Superframe Order",         "zbee_zdp.superframe", FT_UINT8, BASE_DEC, NULL, 0xF0,
            NULL, HFILL }},

        { &hf_zbee_zdp_permit_joining,
        { "Permit Joining",         "zbee_zdp.permit_joining", FT_UINT8, BASE_DEC, VALS(zbee_zdp_true_false_plus_vals), 0x01,
            NULL, HFILL }},

        { &hf_zbee_zdp_permit_joining_03,
        { "Permit Joining",         "zbee_zdp.permit_joining", FT_UINT8, BASE_DEC, VALS(zbee_zdp_true_false_plus_vals), 0x03,
            NULL, HFILL }},

        { &hf_zbee_zdp_extended_pan,
        { "Extended Pan",         "zbee_zdp.extended_pan", FT_EUI64, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_addr,
        { "Addr",       "zbee_zdp.addr", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_depth,
        { "Depth",         "zbee_zdp.depth", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_lqi,
        { "LQI",         "zbee_zdp.lqi", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_scan_channel,
        { "Scan Channels",         "zbee_zdp.scan_channel", FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_table_entry_type,
        { "Type",         "zbee_zdp.table_entry_type", FT_UINT8, BASE_DEC, VALS(zbee_zdp_table_entry_type_vals), 0x03,
            NULL, HFILL }},

        { &hf_zbee_zdp_table_entry_idle_rx_0c,
        { "Idle Rx",         "zbee_zdp.idle_rx", FT_UINT8, BASE_DEC, VALS(zbee_zdp_true_false_plus_vals), 0x0c,
            NULL, HFILL }},

        { &hf_zbee_zdp_table_entry_idle_rx_04,
        { "Idle Rx",         "zbee_zdp.idle_rx", FT_UINT8, BASE_DEC, VALS(zbee_zdp_true_false_plus_vals), 0x04,
            NULL, HFILL }},

        { &hf_zbee_zdp_table_entry_relationship_18,
        { "Relationship",         "zbee_zdp.relationship", FT_UINT8, BASE_DEC, VALS(zbee_zdp_relationship_vals), 0x18,
            NULL, HFILL }},

        { &hf_zbee_zdp_table_entry_relationship_70,
        { "Relationship",         "zbee_zdp.relationship", FT_UINT8, BASE_DEC, VALS(zbee_zdp_relationship_vals), 0x70,
            NULL, HFILL }},

        { &hf_zbee_zdp_rtg,
        { "Routing Table",         "zbee_zdp.routing", FT_NONE, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_rtg_entry,
        { "Routing Table Entry",         "zbee_zdp.routing.entry", FT_NONE, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_rtg_destination,
        { "Destination",         "zbee_zdp.routing.destination", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_rtg_status,
        { "Status",         "zbee_zdp.routing.status", FT_UINT8, BASE_DEC, VALS(zbee_zdp_rtg_status_vals), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_rtg_next_hop,
        { "Next Hop",         "zbee_zdp.routing.next_hop", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_ieee_join_start_index,
        { "Start Index",                "zbee_zdp.ieee_joining_list.start_index", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_ieee_join_update_id,
        { "Update Id",                "zbee_zdp.ieee_joining_list.update_id", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_ieee_join_policy,
        { "Policy",                "zbee_zdp.ieee_joining_list.policy", FT_UINT8, BASE_DEC, VALS(zbee_zdp_ieee_join_policy_vals), 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_ieee_join_list_total,
        { "List Total Count",                "zbee_zdp.ieee_joining_list.total", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_ieee_join_list_start,
        { "List Start",                "zbee_zdp.ieee_joining_list.start", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_ieee_join_list_count,
        { "List Count",                "zbee_zdp.ieee_joining_list.count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_ieee_join_list_ieee,
        { "IEEE",                "zbee_zdp.ieee_joining_list.ieee", FT_EUI64, BASE_NONE, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_number_of_children,
          { "NumberOfChildren",    "zbee_zdp.n_children", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_scan_mask,
          { "ScanChannelItem",    "zbee_zdp.scan_ch_list", FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_scan_mask_cnt,
          { "ScanChannelCount",    "zbee_zdp.scan_ch_cnt", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_conf_mask,
          { "Configuration Bitmask",    "zbee_zdp.conf_mask", FT_UINT8, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_total,
          { "Total beacons surveyed", "zbee_zdp.total_beacons", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_cur_zbn,
          { "On-network beacons", "zbee_zdp.on_nwk_beacons", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_cur_zbn_potent_parents,
          { "Potential Parent Beacons", "zbee_zdp.num_of_parents", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_other_zbn,
          { "Other Network Beacons", "zbee_zdp.other_nwk_beacons", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_current_parent,
          { "Current Parent", "zbee_zdp.cur_parent", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_parent,
          { "Potential Parent", "zbee_zdp.p_parent", FT_UINT16, BASE_HEX, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_beacon_survey_cnt_parents,
          { "Count of potential parents", "zbee_zdp.cnt_parents", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_tlv_count,
          { "TLV Count", "zbee_zdp.tlv_count", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},

        { &hf_zbee_zdp_tlv_id,
          { "TLV_ID", "zbee_zdp.tlv_id", FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }},
    };

    /*  APS subtrees */
    static int *ett[] = {
        &ett_zbee_zdp,
        &ett_zbee_zdp_endpoint,
        &ett_zbee_zdp_match_in,
        &ett_zbee_zdp_match_out,
        &ett_zbee_zdp_node,
        &ett_zbee_zdp_node_in,
        &ett_zbee_zdp_node_out,
        &ett_zbee_zdp_power,
        &ett_zbee_zdp_simple,
        &ett_zbee_zdp_cinfo,
        &ett_zbee_zdp_server,
        &ett_zbee_zdp_simple_sizes,
        &ett_zbee_zdp_bind,
        &ett_zbee_zdp_bind_entry,
        &ett_zbee_zdp_bind_end_in,
        &ett_zbee_zdp_bind_end_out,
        &ett_zbee_zdp_bind_table,
        &ett_zbee_zdp_bind_source,
        &ett_zbee_zdp_assoc_device,
        &ett_zbee_zdp_nwk,
        &ett_zbee_zdp_lqi,
        &ett_zbee_zdp_rtg,
        &ett_zbee_zdp_cache,
        &ett_zbee_zdp_nwk_desc,
        &ett_zbee_zdp_table_entry,
        &ett_zbee_zdp_descriptor_capability_field,
        &ett_zbee_zdp_perm_join_fc,
    };

    expert_module_t *expert_zbee_zdp;

    static ei_register_info ei[] = {
        {
            &ei_deprecated_command,
            { "zbee_zdp.zdo_command_deprecated", PI_DEPRECATED, PI_WARN,
              "Deprecated ZDO Command", EXPFILL }
        }
    };

    /* Register ZigBee ZDP protocol with Wireshark. */
    proto_zbee_zdp = proto_register_protocol("ZigBee Device Profile", "ZigBee ZDP", "zbee_zdp");
    proto_register_field_array(proto_zbee_zdp, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_zbee_zdp = expert_register_protocol(proto_zbee_zdp);
    expert_register_field_array(expert_zbee_zdp, ei, array_length(ei));

    /* Register the ZDP dissector. */
    register_dissector("zbee_zdp", dissect_zbee_zdp, proto_zbee_zdp);
} /* proto_register_zbee_zdp */

/**
 *Registers the Zigbee Device Profile dissector with Wireshark.
 *
*/
void proto_reg_handoff_zbee_zdp(void)
{
    dissector_handle_t  zdp_handle;

    /* Register our dissector with the ZigBee application dissectors. */
    zdp_handle = find_dissector("zbee_zdp");
    dissector_add_uint("zbee.profile", ZBEE_ZDP_PROFILE, zdp_handle);
} /* proto_reg_handoff_zbee_zdp */

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